Permalink
Browse files

Use string concat for performance (according to intellij)

  • Loading branch information...
benfortuna committed Jun 30, 2016
1 parent 773a263 commit 0c96c693009f14e4da29d736777515a20d7f0518
@@ -178,19 +178,18 @@ public Calendar(Calendar c) throws ParseException, IOException,
* {@inheritDoc}
*/
public final String toString() {
- final StringBuilder buffer = new StringBuilder();
- buffer.append(BEGIN);
- buffer.append(':');
- buffer.append(VCALENDAR);
- buffer.append(Strings.LINE_SEPARATOR);
- buffer.append(getProperties());
- buffer.append(getComponents());
- buffer.append(END);
- buffer.append(':');
- buffer.append(VCALENDAR);
- buffer.append(Strings.LINE_SEPARATOR);
-
- return buffer.toString();
+ String buffer = BEGIN +
+ ':' +
+ VCALENDAR +
+ Strings.LINE_SEPARATOR +
+ getProperties() +
+ getComponents() +
+ END +
+ ':' +
+ VCALENDAR +
+ Strings.LINE_SEPARATOR;
+
+ return buffer;
}
/**
@@ -143,18 +143,17 @@ protected Component(final String s, final PropertyList p) {
* {@inheritDoc}
*/
public String toString() {
- final StringBuilder buffer = new StringBuilder();
- buffer.append(BEGIN);
- buffer.append(':');
- buffer.append(getName());
- buffer.append(Strings.LINE_SEPARATOR);
- buffer.append(getProperties());
- buffer.append(END);
- buffer.append(':');
- buffer.append(getName());
- buffer.append(Strings.LINE_SEPARATOR);
-
- return buffer.toString();
+ String buffer = BEGIN +
+ ':' +
+ getName() +
+ Strings.LINE_SEPARATOR +
+ getProperties() +
+ END +
+ ':' +
+ getName() +
+ Strings.LINE_SEPARATOR;
+
+ return buffer;
}
/**
@@ -494,10 +494,9 @@ public final TimeZone getTimeZone() {
* {@inheritDoc}
*/
public final String toString() {
- final StringBuilder b = new StringBuilder(super.toString());
- b.append('T');
- b.append(time.toString());
- return b.toString();
+ String b = super.toString() + 'T' +
+ time.toString();
+ return b;
}
/**
@@ -143,18 +143,17 @@ public VAvailability(final PropertyList properties, final ComponentList<Availabl
* {@inheritDoc}
*/
public final String toString() {
- final StringBuilder b = new StringBuilder();
- b.append(BEGIN);
- b.append(':');
- b.append(getName());
- b.append(Strings.LINE_SEPARATOR);
- b.append(getProperties());
- b.append(getAvailable());
- b.append(END);
- b.append(':');
- b.append(getName());
- b.append(Strings.LINE_SEPARATOR);
- return b.toString();
+ String b = BEGIN +
+ ':' +
+ getName() +
+ Strings.LINE_SEPARATOR +
+ getProperties() +
+ getAvailable() +
+ END +
+ ':' +
+ getName() +
+ Strings.LINE_SEPARATOR;
+ return b;
}
/**
@@ -285,18 +285,17 @@ public VEvent(final Date start, final Dur duration, final String summary) {
* {@inheritDoc}
*/
public final String toString() {
- final StringBuilder b = new StringBuilder();
- b.append(BEGIN);
- b.append(':');
- b.append(getName());
- b.append(Strings.LINE_SEPARATOR);
- b.append(getProperties());
- b.append(getAlarms());
- b.append(END);
- b.append(':');
- b.append(getName());
- b.append(Strings.LINE_SEPARATOR);
- return b.toString();
+ String b = BEGIN +
+ ':' +
+ getName() +
+ Strings.LINE_SEPARATOR +
+ getProperties() +
+ getAlarms() +
+ END +
+ ':' +
+ getName() +
+ Strings.LINE_SEPARATOR;
+ return b;
}
/**
@@ -167,18 +167,17 @@ public VTimeZone(final PropertyList properties,
* {@inheritDoc}
*/
public final String toString() {
- final StringBuilder b = new StringBuilder();
- b.append(BEGIN);
- b.append(':');
- b.append(getName());
- b.append(Strings.LINE_SEPARATOR);
- b.append(getProperties());
- b.append(observances);
- b.append(END);
- b.append(':');
- b.append(getName());
- b.append(Strings.LINE_SEPARATOR);
- return b.toString();
+ String b = BEGIN +
+ ':' +
+ getName() +
+ Strings.LINE_SEPARATOR +
+ getProperties() +
+ observances +
+ END +
+ ':' +
+ getName() +
+ Strings.LINE_SEPARATOR;
+ return b;
}
/**
@@ -203,18 +203,17 @@ public VToDo(final Date start, final Dur duration, final String summary) {
* {@inheritDoc}
*/
public final String toString() {
- final StringBuilder buffer = new StringBuilder();
- buffer.append(BEGIN);
- buffer.append(':');
- buffer.append(getName());
- buffer.append(Strings.LINE_SEPARATOR);
- buffer.append(getProperties());
- buffer.append(getAlarms());
- buffer.append(END);
- buffer.append(':');
- buffer.append(getName());
- buffer.append(Strings.LINE_SEPARATOR);
- return buffer.toString();
+ String buffer = BEGIN +
+ ':' +
+ getName() +
+ Strings.LINE_SEPARATOR +
+ getProperties() +
+ getAlarms() +
+ END +
+ ':' +
+ getName() +
+ Strings.LINE_SEPARATOR;
+ return buffer;
}
/**
@@ -109,17 +109,16 @@ public VVenue(final PropertyList properties) {
* {@inheritDoc}
*/
public final String toString() {
- final StringBuilder b = new StringBuilder();
- b.append(BEGIN);
- b.append(':');
- b.append(getName());
- b.append(Strings.LINE_SEPARATOR);
- b.append(getProperties());
- b.append(END);
- b.append(':');
- b.append(getName());
- b.append(Strings.LINE_SEPARATOR);
- return b.toString();
+ String b = BEGIN +
+ ':' +
+ getName() +
+ Strings.LINE_SEPARATOR +
+ getProperties() +
+ END +
+ ':' +
+ getName() +
+ Strings.LINE_SEPARATOR;
+ return b;
}
/**

0 comments on commit 0c96c69

Please sign in to comment.