[jboss-svn-commits] JBL Code SVN: r35835 - labs/jbossrules/trunk/drools-repository/src/main/java/org/drools/repository.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Tue Nov 2 08:07:25 EDT 2010
Author: ge0ffrey
Date: 2010-11-02 08:07:24 -0400 (Tue, 02 Nov 2010)
New Revision: 35835
Modified:
labs/jbossrules/trunk/drools-repository/src/main/java/org/drools/repository/AssetItem.java
Log:
refactor StringBuffer into StringBuilder and use append instead of +
Modified: labs/jbossrules/trunk/drools-repository/src/main/java/org/drools/repository/AssetItem.java
===================================================================
--- labs/jbossrules/trunk/drools-repository/src/main/java/org/drools/repository/AssetItem.java 2010-11-02 11:54:08 UTC (rev 35834)
+++ labs/jbossrules/trunk/drools-repository/src/main/java/org/drools/repository/AssetItem.java 2010-11-02 12:07:24 UTC (rev 35835)
@@ -438,25 +438,22 @@
*/
public String toString() {
try {
- StringBuffer returnString = new StringBuffer();
- returnString.append("Content of rule item named '" + this.getName()
- + "':\n");
- returnString.append("Content: " + this.getContent() + "\n");
+ StringBuilder returnString = new StringBuilder();
+ returnString.append("Content of rule item named '").append(this.getName()).append("':\n");
+ returnString.append("Content: ").append(this.getContent()).append("\n");
returnString.append("------\n");
- returnString.append("Archived: " + this.isArchived() + "\n");
+ returnString.append("Archived: ").append(this.isArchived()).append("\n");
returnString.append("------\n");
- returnString.append("Date Effective: " + this.getDateEffective()
- + "\n");
- returnString
- .append("Date Expired: " + this.getDateExpired() + "\n");
+ returnString.append("Date Effective: ").append(this.getDateEffective()).append("\n");
+ returnString.append("Date Expired: ").append(this.getDateExpired()).append("\n");
returnString.append("------\n");
returnString.append("Rule state: ");
StateItem stateItem = this.getState();
if (stateItem != null) {
- returnString.append(this.getState().getName() + "\n");
+ returnString.append(this.getState().getName()).append("\n");
} else {
returnString.append("NO STATE SET FOR THIS NODE\n");
}
@@ -465,7 +462,7 @@
returnString.append("Rule tags:\n");
for (Iterator it = this.getCategories().iterator(); it.hasNext();) {
CategoryItem currentTag = (CategoryItem) it.next();
- returnString.append(currentTag.getName() + "\n");
+ returnString.append(currentTag.getName()).append("\n");
}
returnString.append("--------------\n");
return returnString.toString();
@@ -598,4 +595,4 @@
}
-}
\ No newline at end of file
+}
More information about the jboss-svn-commits
mailing list