maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From denn...@apache.org
Subject svn commit: r1054699 - in /maven/plugins/trunk/maven-changes-plugin/src: main/java/org/apache/maven/plugin/issues/ main/java/org/apache/maven/plugin/trac/ test/java/org/apache/maven/plugin/issues/
Date Mon, 03 Jan 2011 18:29:57 GMT
Author: dennisl
Date: Mon Jan  3 18:29:57 2011
New Revision: 1054699

URL: http://svn.apache.org/viewvc?rev=1054699&view=rev
Log:
o Refactoring: Rename fields, variables, methods and parameters.
o Refactoring: Reorder fields and methods.

Modified:
    maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/issues/Issue.java
    maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/trac/TracDownloader.java
    maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/trac/TracMojo.java
    maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/trac/TracReportGenerator.java
    maven/plugins/trunk/maven-changes-plugin/src/test/java/org/apache/maven/plugin/issues/IssueTestCase.java

Modified: maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/issues/Issue.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/issues/Issue.java?rev=1054699&r1=1054698&r2=1054699&view=diff
==============================================================================
--- maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/issues/Issue.java
(original)
+++ maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/issues/Issue.java
Mon Jan  3 18:29:57 2011
@@ -31,6 +31,10 @@ import java.util.List;
  */
 public class Issue
 {
+    private String assignee;
+
+    private List comments;
+
     private List components;
 
     private Date created;
@@ -47,86 +51,46 @@ public class Issue
 
     private String reporter;
 
+    private String resolution;
+
     private String summary;
 
     private String status;
 
+    private String title;
+
     private String type;
 
     private Date updated;
 
     private String version;
 
-    private String resolution;
-
-    private String assignee;
-
-    private List comments;
-
-    private String title;
-
     public Issue()
     {
     }
 
-    public String getKey()
-    {
-        return key;
-    }
-
-    public void setKey( String key )
-    {
-        this.key = key;
-    }
-
-    public String getLink()
-    {
-        return link;
-    }
-
-    public void setLink( String link )
-    {
-        this.link = link;
-    }
-
-    public String getSummary()
-    {
-        return summary;
-    }
-
-    public void setSummary( String summary )
-    {
-        this.summary = summary;
-    }
-
-    public String getStatus()
-    {
-        return status;
-    }
-
-    public void setStatus( String status )
-    {
-        this.status = status;
-    }
-
-    public String getResolution()
+    public String getAssignee()
     {
-        return resolution;
+        return assignee;
     }
 
-    public void setResolution( String resolution )
+    public void setAssignee( String assignee )
     {
-        this.resolution = resolution;
+        this.assignee = assignee;
     }
 
-    public String getAssignee()
+    public List getComments()
     {
-        return assignee;
+        return comments;
     }
 
-    public void setAssignee( String assignee )
+    public void addComment( String comment )
     {
-        this.assignee = assignee;
+        if ( comments == null )
+        {
+            comments = new ArrayList();
+        }
+        comments.add( comment );
     }
 
     public List getComponents()
@@ -177,6 +141,26 @@ public class Issue
         this.id = id;
     }
 
+    public String getKey()
+    {
+        return key;
+    }
+
+    public void setKey( String key )
+    {
+        this.key = key;
+    }
+
+    public String getLink()
+    {
+        return link;
+    }
+
+    public void setLink( String link )
+    {
+        this.link = link;
+    }
+
     public String getPriority()
     {
         return priority;
@@ -197,57 +181,73 @@ public class Issue
         this.reporter = reporter;
     }
 
-    public String getType()
+    public String getResolution()
     {
-        return type;
+        return resolution;
     }
 
-    public void setType( String type )
+    public void setResolution( String resolution )
     {
-        this.type = type;
+        this.resolution = resolution;
     }
 
-    public Date getUpdated()
+    public String getStatus()
     {
-        return updated;
+        return status;
     }
 
-    public void setUpdated( Date updated )
+    public void setStatus( String status )
     {
-        this.updated = updated;
+        this.status = status;
     }
 
-    public String getVersion()
+    public String getSummary()
     {
-        return version;
+        return summary;
     }
 
-    public void setVersion( String version )
+    public void setSummary( String summary )
     {
-        this.version = version;
+        this.summary = summary;
     }
 
-    public void addComment( String comment )
+    public String getTitle()
     {
-        if ( comments == null )
-        {
-            comments = new ArrayList();
-        }
-        comments.add( comment );
+        return title;
     }
 
-    public List getComments()
+    public void setTitle( String title )
     {
-        return comments;
+        this.title = title;
     }
 
-    public String getTitle()
+    public String getType()
     {
-        return title;
+        return type;
     }
 
-    public void setTitle( String title )
+    public void setType( String type )
     {
-        this.title = title;
+        this.type = type;
+    }
+
+    public Date getUpdated()
+    {
+        return updated;
+    }
+
+    public void setUpdated( Date updated )
+    {
+        this.updated = updated;
+    }
+
+    public String getVersion()
+    {
+        return version;
+    }
+
+    public void setVersion( String version )
+    {
+        this.version = version;
     }
 }

Modified: maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/trac/TracDownloader.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/trac/TracDownloader.java?rev=1054699&r1=1054698&r2=1054699&view=diff
==============================================================================
--- maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/trac/TracDownloader.java
(original)
+++ maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/trac/TracDownloader.java
Mon Jan  3 18:29:57 2011
@@ -55,39 +55,39 @@ public class TracDownloader
     /** The username for authentication into a private Trac installation. */
     private String tracUser;
 
-    private Issue createTicket( Object[] ticketObj )
+    private Issue createIssue( Object[] ticketObj )
     {
-        Issue ticket = new Issue();
+        Issue issue = new Issue();
 
-        ticket.setId( String.valueOf( ticketObj[0] ) );
+        issue.setId( String.valueOf( ticketObj[0] ) );
 
-        ticket.setLink( getUrl() + "/ticket/" + String.valueOf( ticketObj[0] ) );
+        issue.setLink( getUrl() + "/ticket/" + String.valueOf( ticketObj[0] ) );
 
-        ticket.setCreated( parseDate( String.valueOf( ticketObj[1] ) ) );
+        issue.setCreated( parseDate( String.valueOf( ticketObj[1] ) ) );
 
-        ticket.setUpdated( parseDate( String.valueOf( ticketObj[2] ) ) );
+        issue.setUpdated( parseDate( String.valueOf( ticketObj[2] ) ) );
 
         Map attributes = (Map) ticketObj[3];
 
-        ticket.setType( (String) attributes.get( "type" ) );
+        issue.setType( (String) attributes.get( "type" ) );
 
-        ticket.setSummary( (String) attributes.get( "summary" ) );
+        issue.setSummary( (String) attributes.get( "summary" ) );
 
-        ticket.setStatus( (String) attributes.get( "status" ) );
+        issue.setStatus( (String) attributes.get( "status" ) );
 
-        ticket.setResolution( (String) attributes.get( "resolution" ) );
+        issue.setResolution( (String) attributes.get( "resolution" ) );
 
-        ticket.setAssignee( (String) attributes.get( "owner" ) );
+        issue.setAssignee( (String) attributes.get( "owner" ) );
 
-        ticket.addFixVersion( (String) attributes.get( "milestone" ) );
+        issue.addFixVersion( (String) attributes.get( "milestone" ) );
 
-        ticket.setPriority( (String) attributes.get( "priority" ) );
+        issue.setPriority( (String) attributes.get( "priority" ) );
 
-        ticket.setReporter( (String) attributes.get( "reporter" ) );
+        issue.setReporter( (String) attributes.get( "reporter" ) );
 
-        ticket.addComponent( (String) attributes.get( "component" ) );
+        issue.addComponent( (String) attributes.get( "component" ) );
 
-        return ticket;
+        return issue;
     }
 
     public List getIssueList() throws MalformedURLException, XmlRpcException
@@ -110,7 +110,7 @@ public class TracDownloader
 
         client.setConfig( config );
 
-        // Fetch tickets
+        // Fetch issues
         String qstr = "";
 
         if ( !StringUtils.isEmpty( query ) )
@@ -120,7 +120,7 @@ public class TracDownloader
 
         Object[] params = new Object[] { new String( qstr ) };
         Object[] queryResult = null;
-        ArrayList ticketList = new ArrayList();
+        ArrayList issueList = new ArrayList();
         try
         {
             queryResult = (Object[]) client.execute( "ticket.query", params );
@@ -130,14 +130,14 @@ public class TracDownloader
                 params = new Object[] { queryResult[i] };
                 Object[] ticketGetResult = null;
                 ticketGetResult = (Object[]) client.execute( "ticket.get", params );
-                ticketList.add( createTicket( ticketGetResult ) );
+                issueList.add( createIssue( ticketGetResult ) );
             }
         }
         catch ( XmlRpcException e )
         {
             throw new XmlRpcException( "XmlRpc Error.", e );
         }
-        return ticketList;
+        return issueList;
     }
 
     private String getUrl()

Modified: maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/trac/TracMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/trac/TracMojo.java?rev=1054699&r1=1054698&r2=1054699&view=diff
==============================================================================
--- maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/trac/TracMojo.java
(original)
+++ maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/trac/TracMojo.java
Mon Jan  3 18:29:57 2011
@@ -110,12 +110,12 @@ public class TracMojo
 
         try
         {
-            List ticketList = issueDownloader.getIssueList();
+            List issueList = issueDownloader.getIssueList();
 
             // Generate the report
             TracReportGenerator report = new TracReportGenerator( columnNames );
 
-            if ( ticketList.isEmpty() )
+            if ( issueList.isEmpty() )
             {
                 report.doGenerateEmptyReport( getBundle( locale ), getSink() );
                 getLog().warn( "No ticket has matched." );
@@ -124,7 +124,7 @@ public class TracMojo
             {
                 try
                 {
-                    report.doGenerateReport( getBundle( locale ), getSink(), ticketList );
+                    report.doGenerateReport( getBundle( locale ), getSink(), issueList );
                 }
                 catch ( Exception e )
                 {

Modified: maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/trac/TracReportGenerator.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/trac/TracReportGenerator.java?rev=1054699&r1=1054698&r2=1054699&view=diff
==============================================================================
--- maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/trac/TracReportGenerator.java
(original)
+++ maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/trac/TracReportGenerator.java
Mon Jan  3 18:29:57 2011
@@ -112,20 +112,20 @@ public class TracReportGenerator
         sinkEndReport( sink );
     }
 
-    public void doGenerateReport( ResourceBundle bundle, Sink sink, List ticketList )
+    public void doGenerateReport( ResourceBundle bundle, Sink sink, List issueList )
     {
         sinkBeginReport( sink, bundle );
 
-        constructHeaderRow( sink, ticketList, bundle );
+        constructHeaderRow( sink, issueList, bundle );
 
-        constructDetailRows( sink, ticketList, bundle );
+        constructDetailRows( sink, issueList, bundle );
 
         sinkEndReport( sink );
     }
 
-    private void constructHeaderRow( Sink sink, List ticketList, ResourceBundle bundle )
+    private void constructHeaderRow( Sink sink, List issueList, ResourceBundle bundle )
     {
-        if ( ticketList == null )
+        if ( issueList == null )
         {
             return;
         }
@@ -183,18 +183,18 @@ public class TracReportGenerator
         sink.tableRow_();
     }
 
-    private void constructDetailRows( Sink sink, List ticketList, ResourceBundle bundle )
+    private void constructDetailRows( Sink sink, List issueList, ResourceBundle bundle )
     {
-        if ( ticketList == null )
+        if ( issueList == null )
         {
             return;
         }
 
-        for ( int idx = 0; idx < ticketList.size(); idx++ )
+        for ( int idx = 0; idx < issueList.size(); idx++ )
         {
             SimpleDateFormat sdf = new SimpleDateFormat( bundle.getString( "report.trac.dateformat"
) );
 
-            Issue ticket = (Issue) ticketList.get( idx );
+            Issue issue = (Issue) issueList.get( idx );
 
             sink.tableRow();
 
@@ -204,43 +204,43 @@ public class TracReportGenerator
                 {
                     case COLUMN_ID:
                         sink.tableCell();
-                        sink.link( ticket.getLink() );
-                        sink.text( ticket.getId() );
+                        sink.link( issue.getLink() );
+                        sink.text( issue.getId() );
                         sink.link_();
                         sink.tableCell_();
                         break;
                     case COLUMN_TYPE:
-                        sinkCell( sink, ticket.getType() );
+                        sinkCell( sink, issue.getType() );
                         break;
                     case COLUMN_SUMMARY:
-                        sinkCell( sink, ticket.getSummary() );
+                        sinkCell( sink, issue.getSummary() );
                         break;
                     case COLUMN_OWNER:
-                        sinkCell( sink, ticket.getAssignee() );
+                        sinkCell( sink, issue.getAssignee() );
                         break;
                     case COLUMN_REPORTER:
-                        sinkCell( sink, ticket.getReporter() );
+                        sinkCell( sink, issue.getReporter() );
                         break;
                     case COLUMN_PRIORITY:
-                        sinkCell( sink, ticket.getPriority() );
+                        sinkCell( sink, issue.getPriority() );
                         break;
                     case COLUMN_STATUS:
-                        sinkCell( sink, ticket.getStatus() );
+                        sinkCell( sink, issue.getStatus() );
                         break;
                     case COLUMN_RESOLUTION:
-                        sinkCell( sink, ticket.getResolution() );
+                        sinkCell( sink, issue.getResolution() );
                         break;
                     case COLUMN_CREATED:
-                        sinkCell( sink, sdf.format( ticket.getCreated() ) );
+                        sinkCell( sink, sdf.format( issue.getCreated() ) );
                         break;
                     case COLUMN_CHANGED:
-                        sinkCell( sink, sdf.format( ticket.getUpdated() ) );
+                        sinkCell( sink, sdf.format( issue.getUpdated() ) );
                         break;
                     case COLUMN_MILESTONE:
-                        sinkCell( sink, IssuesReportGenerator.printValues( ticket.getFixVersions()
) );
+                        sinkCell( sink, IssuesReportGenerator.printValues( issue.getFixVersions()
) );
                         break;
                     case COLUMN_COMPONENT:
-                        sinkCell( sink, IssuesReportGenerator.printValues( ticket.getComponents()
) );
+                        sinkCell( sink, IssuesReportGenerator.printValues( issue.getComponents()
) );
                         break;
                     default:
                         // Do not add details for this column

Modified: maven/plugins/trunk/maven-changes-plugin/src/test/java/org/apache/maven/plugin/issues/IssueTestCase.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-changes-plugin/src/test/java/org/apache/maven/plugin/issues/IssueTestCase.java?rev=1054699&r1=1054698&r2=1054699&view=diff
==============================================================================
--- maven/plugins/trunk/maven-changes-plugin/src/test/java/org/apache/maven/plugin/issues/IssueTestCase.java
(original)
+++ maven/plugins/trunk/maven-changes-plugin/src/test/java/org/apache/maven/plugin/issues/IssueTestCase.java
Mon Jan  3 18:29:57 2011
@@ -43,6 +43,13 @@ public class IssueTestCase
     {
     }
 
+    public void testGetSetAssignee()
+    {
+        issue.setAssignee( "assignee" );
+
+        assertEquals( "assignee", issue.getAssignee() );
+    }
+
     public void testGetSetKey()
     {
         issue.setKey( "key" );
@@ -50,11 +57,11 @@ public class IssueTestCase
         assertEquals( "key", issue.getKey() );
     }
 
-    public void testGetSetSummary()
+    public void testGetSetResolution()
     {
-        issue.setSummary( "summary" );
+        issue.setResolution( "resolution" );
 
-        assertEquals( "summary", issue.getSummary() );
+        assertEquals( "resolution", issue.getResolution() );
     }
 
     public void testGetSetStatus()
@@ -64,18 +71,10 @@ public class IssueTestCase
         assertEquals( "status", issue.getStatus() );
     }
 
-    public void testGetSetResolution()
-    {
-        issue.setResolution( "resolution" );
-
-        assertEquals( "resolution", issue.getResolution() );
-    }
-
-    public void testGetSetAssignee()
+    public void testGetSetSummary()
     {
-        issue.setAssignee( "assignee" );
+        issue.setSummary( "summary" );
 
-        assertEquals( "assignee", issue.getAssignee() );
+        assertEquals( "summary", issue.getSummary() );
     }
-
 }



Mime
View raw message