diff --git a/platform/core-impl/src/com/intellij/extapi/psi/StubBasedPsiElementBase.java b/platform/core-impl/src/com/intellij/extapi/psi/StubBasedPsiElementBase.java index c38b1e3f54be..d854b6cbbd60 100644 --- a/platform/core-impl/src/com/intellij/extapi/psi/StubBasedPsiElementBase.java +++ b/platform/core-impl/src/com/intellij/extapi/psi/StubBasedPsiElementBase.java @@ -81,16 +81,14 @@ public class StubBasedPsiElementBase extends ASTDelegateP final FileElement fileElement = file.loadTreeElement(); node = myNode; if (node == null) { - String message = new StringBuilder(). - append("Failed to bind stub to AST for element "). - append(getClass()). - append(" in "). - append(file.getVirtualFile() == null ? "" : file.getVirtualFile().getPath()). - append("\nFile stub tree:\n"). - append(stubTree != null ? StringUtil.trimLog(((PsiFileStubImpl)stubTree.getRoot()).printTree(), 1024) : " is null"). - append("\nLoaded file AST:\n"). - append(StringUtil.trimLog(DebugUtil.treeToString(fileElement, true), 1024)). - toString(); + String message = "Failed to bind stub to AST for element " + + getClass() + + " in " + + (file.getVirtualFile() == null ? "" : file.getVirtualFile().getPath()) + + "\nFile stub tree:\n" + + (stubTree != null ? StringUtil.trimLog(((PsiFileStubImpl)stubTree.getRoot()).printTree(), 1024) : " is null") + + "\nLoaded file AST:\n" + + StringUtil.trimLog(DebugUtil.treeToString(fileElement, true), 1024); throw new IllegalArgumentException(message); } } diff --git a/platform/lang-api/src/com/intellij/openapi/project/ProjectUtil.java b/platform/lang-api/src/com/intellij/openapi/project/ProjectUtil.java index 0a7c42517dd7..cd22a9b403f6 100644 --- a/platform/lang-api/src/com/intellij/openapi/project/ProjectUtil.java +++ b/platform/lang-api/src/com/intellij/openapi/project/ProjectUtil.java @@ -83,12 +83,12 @@ public class ProjectUtil { final OrderEntry libraryEntry = LibraryUtil.findLibraryEntry(file, project); if (libraryEntry != null) { if (libraryEntry instanceof JdkOrderEntry) { - url = new StringBuilder(url).append(" - [").append(((JdkOrderEntry)libraryEntry).getJdkName()).append("]").toString(); + url = url + " - [" + ((JdkOrderEntry)libraryEntry).getJdkName() + "]"; } else { - url = new StringBuilder(url).append(" - [").append(libraryEntry.getPresentableName()).append("]").toString(); + url = url + " - [" + libraryEntry.getPresentableName() + "]"; } } else { - url = new StringBuilder(url).append(" - [").append(fileForJar.getName()).append("]").toString(); + url = url + " - [" + fileForJar.getName() + "]"; } } } @@ -96,8 +96,8 @@ public class ProjectUtil { final Module module = ModuleUtil.findModuleForFile(file, project); if (module == null) return url; return !keepModuleAlwaysOnTheLeft && SystemInfo.isMac ? - new StringBuffer().append(url).append(" - [").append(module.getName()).append("]").toString() : - new StringBuffer().append("[").append(module.getName()).append("] - ").append(url).toString(); + url + " - [" + module.getName() + "]" : + "[" + module.getName() + "] - " + url; } } diff --git a/platform/lang-impl/src/com/intellij/extapi/psi/StubPath.java b/platform/lang-impl/src/com/intellij/extapi/psi/StubPath.java index 3ba3c7b77b21..0ebd2584561d 100644 --- a/platform/lang-impl/src/com/intellij/extapi/psi/StubPath.java +++ b/platform/lang-impl/src/com/intellij/extapi/psi/StubPath.java @@ -67,12 +67,6 @@ public class StubPath { } public String toString() { - return new StringBuilder(). - append(myParentPath != null ? myParentPath.toString() : ""). - append("::("). - append(myType.toString()). - append(":"). - append(myId). - append(")").toString(); + return (myParentPath != null ? myParentPath.toString() : "") + "::(" + myType.toString() + ":" + myId + ")"; } } diff --git a/platform/platform-api/src/com/intellij/openapi/util/DimensionService.java b/platform/platform-api/src/com/intellij/openapi/util/DimensionService.java index 770d0256fe7e..2f19b937e14b 100644 --- a/platform/platform-api/src/com/intellij/openapi/util/DimensionService.java +++ b/platform/platform-api/src/com/intellij/openapi/util/DimensionService.java @@ -272,11 +272,6 @@ public class DimensionService implements PersistentStateComponent, Appl final Point topLeft = frame.getLocation(); Point center = new Point(topLeft.x + frame.getWidth() / 2, topLeft.y + frame.getHeight() / 2); final Rectangle frameScreen = ScreenUtil.getScreenRectangle(center); - return new StringBuffer(key) - .append('.').append(frameScreen.x) - .append('.').append(frameScreen.y) - .append('.').append(frameScreen.width) - .append('.').append(frameScreen.height) - .toString(); + return key + '.' + frameScreen.x + '.' + frameScreen.y + '.' + frameScreen.width + '.' + frameScreen.height; } } diff --git a/platform/platform-impl/src/com/intellij/internal/inspector/UiInspectorAction.java b/platform/platform-impl/src/com/intellij/internal/inspector/UiInspectorAction.java index 75a098b5906b..7b74cbcfbbc3 100644 --- a/platform/platform-impl/src/com/intellij/internal/inspector/UiInspectorAction.java +++ b/platform/platform-impl/src/com/intellij/internal/inspector/UiInspectorAction.java @@ -481,7 +481,7 @@ public class UiInspectorAction extends ToggleAction implements DumbAware { g2d.fillRect(insets.left, insets.top, bounds.width - insets.left - insets.right, bounds.height - insets.top - insets.bottom); g2d.setColor(getForeground()); - final String sizeString = new StringBuilder().append(myWidth).append(" x ").append(myHeight).toString(); + final String sizeString = String.valueOf(myWidth) + " x " + myHeight; FontMetrics fm = g2d.getFontMetrics(); int sizeWidth = fm.stringWidth(sizeString); @@ -595,46 +595,42 @@ public class UiInspectorAction extends ToggleAction implements DumbAware { private static class PointRenderer extends JLabel implements Renderer { public JComponent setValue(@NotNull final Point value) { - setText(new StringBuilder().append(value.x).append(':').append(value.y).toString()); + setText(String.valueOf(value.x) + ':' + value.y); return this; } } private static class DimensionRenderer extends JLabel implements Renderer { public JComponent setValue(@NotNull final Dimension value) { - setText(new StringBuilder().append(value.width).append(" x ").append(value.height).toString()); + setText(String.valueOf(value.width) + " x " + value.height); return this; } } private static class InsetsRenderer extends JLabel implements Renderer { public JComponent setValue(@NotNull final Insets value) { - setText(new StringBuilder("top: ").append(value.top).append(" left:").append(value.left).append(" bottom:").append(value.bottom) - .append(" right:").append(value.right).toString()); + setText("top: " + value.top + " left:" + value.left + " bottom:" + value.bottom + " right:" + value.right); return this; } } private static class RectangleRenderer extends JLabel implements Renderer { public JComponent setValue(@NotNull final Rectangle value) { - setText(new StringBuilder().append(value.x).append(":").append(value.y).append(", ").append(value.width) - .append(" x ").append(value.height).toString()); + setText(String.valueOf(value.x) + ":" + value.y + ", " + value.width + " x " + value.height); return this; } } private static class ColorRenderer extends JLabel implements Renderer { public JComponent setValue(@NotNull final Color value) { - setText(new StringBuilder("r:").append(value.getRed()).append(", g:").append(value.getGreen()).append(", b:").append(value.getBlue()) - .toString()); + setText("r:" + value.getRed() + ", g:" + value.getGreen() + ", b:" + value.getBlue()); return this; } } private static class FontRenderer extends JLabel implements Renderer { public JComponent setValue(@NotNull final Font value) { - setText(new StringBuilder(value.getFontName()).append(" (").append(value.getFamily()).append("), ").append(value.getSize()). - append("px").toString()); + setText(value.getFontName() + " (" + value.getFamily() + "), " + value.getSize() + "px"); return this; } } diff --git a/platform/util/src/com/intellij/ui/ColorUtil.java b/platform/util/src/com/intellij/ui/ColorUtil.java index c1adf1b26468..034adec7b502 100644 --- a/platform/util/src/com/intellij/ui/ColorUtil.java +++ b/platform/util/src/com/intellij/ui/ColorUtil.java @@ -53,11 +53,7 @@ public class ColorUtil { final String R = Integer.toHexString(c.getRed()); final String G = Integer.toHexString(c.getGreen()); final String B = Integer.toHexString(c.getBlue()); - return new StringBuffer() - .append(R.length() < 2 ? "0" : "").append(R) - .append(G.length() < 2 ? "0" : "").append(G) - .append(B.length() < 2 ? "0" : "").append(B) - .toString(); + return (R.length() < 2 ? "0" : "") + R + (G.length() < 2 ? "0" : "") + G + (B.length() < 2 ? "0" : "") + B; } /** diff --git a/platform/vcs-api/src/com/intellij/openapi/vcs/annotate/ShowAllAffectedGenericAction.java b/platform/vcs-api/src/com/intellij/openapi/vcs/annotate/ShowAllAffectedGenericAction.java index feb9988d3c32..f8ae000b3b93 100644 --- a/platform/vcs-api/src/com/intellij/openapi/vcs/annotate/ShowAllAffectedGenericAction.java +++ b/platform/vcs-api/src/com/intellij/openapi/vcs/annotate/ShowAllAffectedGenericAction.java @@ -96,8 +96,7 @@ public class ShowAllAffectedGenericAction extends AnAction { } private static String failedText(VirtualFile virtualFile, VcsRevisionNumber revision) { - return new StringBuilder().append("Show all affected files for ").append(virtualFile.getPath()).append(" at ") - .append(revision.asString()).append(" failed").toString(); + return "Show all affected files for " + virtualFile.getPath() + " at " + revision.asString() + " failed"; } @Override diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/VcsChangeDetailsManager.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/VcsChangeDetailsManager.java index 0de56dc1eaf5..ddf8e002b5c9 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/VcsChangeDetailsManager.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/VcsChangeDetailsManager.java @@ -303,9 +303,7 @@ public class VcsChangeDetailsManager { } private static String changeDescription(Change o) { - return new StringBuilder().append(ChangesUtil.getFilePath(o).getName()).append(" (").append( - o.getBeforeRevision() == null - ? "New" : beforeRevisionText(o)).append(")").toString(); + return ChangesUtil.getFilePath(o).getName() + " (" + (o.getBeforeRevision() == null ? "New" : beforeRevisionText(o)) + ")"; } private static String beforeRevisionText(Change o) { diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/patch/ApplyPatchAction.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/patch/ApplyPatchAction.java index f843dadf15ad..28b3c17313ab 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/patch/ApplyPatchAction.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/patch/ApplyPatchAction.java @@ -206,9 +206,10 @@ public class ApplyPatchAction extends DumbAwareAction { final VirtualFile file, ApplyPatchForBaseRevisionTexts texts, boolean readonly) { - final SimpleDiffRequest simpleRequest = new SimpleDiffRequest(project, new StringBuilder().append("Result Of Patch Apply To ") - .append(file.getName()).append(" (").append(file.getParent() == null ? file.getPath() : file.getParent().getPath()).append(")") - .toString()); + final SimpleDiffRequest simpleRequest = + new SimpleDiffRequest(project, "Result Of Patch Apply To " + file.getName() + " (" + + (file.getParent() == null ? file.getPath() : file.getParent().getPath()) + + ")"); final DocumentImpl patched = new DocumentImpl(texts.getPatched()); patched.setReadOnly(false); diff --git a/plugins/git4idea/src/git4idea/history/wholeTree/UsersFilterAction.java b/plugins/git4idea/src/git4idea/history/wholeTree/UsersFilterAction.java index 5d5bf6fe591d..f60ceea8ff7c 100644 --- a/plugins/git4idea/src/git4idea/history/wholeTree/UsersFilterAction.java +++ b/plugins/git4idea/src/git4idea/history/wholeTree/UsersFilterAction.java @@ -224,7 +224,7 @@ public class UsersFilterAction extends BasePopupAction { } private String getMeText(final String name) { - return new StringBuilder().append("me ( ").append(name).append(" )").toString(); + return "me ( " + name + " )"; } @Override diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn17/dialogs/UpgradeFormatDialog.java b/plugins/svn4idea/src/org/jetbrains/idea/svn17/dialogs/UpgradeFormatDialog.java index ce2580e197ce..890300075dac 100644 --- a/plugins/svn4idea/src/org/jetbrains/idea/svn17/dialogs/UpgradeFormatDialog.java +++ b/plugins/svn4idea/src/org/jetbrains/idea/svn17/dialogs/UpgradeFormatDialog.java @@ -81,8 +81,7 @@ public class UpgradeFormatDialog extends DialogWrapper { } protected String getTopMessage(final String label) { - return SvnBundle.message(new StringBuilder().append("label.configure.").append(label).append(".label").toString(), - ApplicationNamesInfo.getInstance().getFullProductName()); + return SvnBundle.message("label.configure." + label + ".label", ApplicationNamesInfo.getInstance().getFullProductName()); } @Nullable @@ -113,11 +112,11 @@ public class UpgradeFormatDialog extends DialogWrapper { panel.add(topLabel, gb); gb.gridy += 1; - myUpgradeNoneButton = new JRadioButton(SvnBundle.message(new StringBuilder().append("radio.configure.").append(label).append(".none").toString())); - myUpgradeAutoButton = new JRadioButton(SvnBundle.message(new StringBuilder().append("radio.configure.").append(label).append(".auto").toString())); - myUpgradeAuto15Button = new JRadioButton(SvnBundle.message(new StringBuilder().append("radio.configure.").append(label).append(".auto.15format").toString())); - myUpgradeAuto16Button = new JRadioButton(SvnBundle.message(new StringBuilder().append("radio.configure.").append(label).append(".auto.16format").toString())); - myUpgradeAuto17Button = new JRadioButton(SvnBundle.message(new StringBuilder().append("radio.configure.").append(label).append(".auto.17format").toString())); + myUpgradeNoneButton = new JRadioButton(SvnBundle.message("radio.configure." + label + ".none")); + myUpgradeAutoButton = new JRadioButton(SvnBundle.message("radio.configure." + label + ".auto")); + myUpgradeAuto15Button = new JRadioButton(SvnBundle.message("radio.configure." + label + ".auto.15format")); + myUpgradeAuto16Button = new JRadioButton(SvnBundle.message("radio.configure." + label + ".auto.16format")); + myUpgradeAuto17Button = new JRadioButton(SvnBundle.message("radio.configure." + label + ".auto.17format")); ButtonGroup group = new ButtonGroup(); group.add(myUpgradeNoneButton); diff --git a/plugins/svn4ideaOld/src/org/jetbrains/idea/svn/dialogs/UpgradeFormatDialog.java b/plugins/svn4ideaOld/src/org/jetbrains/idea/svn/dialogs/UpgradeFormatDialog.java index 8146e78bf67a..bd5d8a3de3b2 100644 --- a/plugins/svn4ideaOld/src/org/jetbrains/idea/svn/dialogs/UpgradeFormatDialog.java +++ b/plugins/svn4ideaOld/src/org/jetbrains/idea/svn/dialogs/UpgradeFormatDialog.java @@ -78,8 +78,7 @@ public class UpgradeFormatDialog extends DialogWrapper { } protected String getTopMessage(final String label) { - return SvnBundle.message(new StringBuilder().append("label.configure.").append(label).append(".label").toString(), - ApplicationNamesInfo.getInstance().getFullProductName()); + return SvnBundle.message("label.configure." + label + ".label", ApplicationNamesInfo.getInstance().getFullProductName()); } @Nullable @@ -110,10 +109,10 @@ public class UpgradeFormatDialog extends DialogWrapper { panel.add(topLabel, gb); gb.gridy += 1; - myUpgradeNoneButton = new JRadioButton(SvnBundle.message(new StringBuilder().append("radio.configure.").append(label).append(".none").toString())); - myUpgradeAutoButton = new JRadioButton(SvnBundle.message(new StringBuilder().append("radio.configure.").append(label).append(".auto").toString())); - myUpgradeAuto15Button = new JRadioButton(SvnBundle.message(new StringBuilder().append("radio.configure.").append(label).append(".auto.15format").toString())); - myUpgradeAuto16Button = new JRadioButton(SvnBundle.message(new StringBuilder().append("radio.configure.").append(label).append(".auto.16format").toString())); + myUpgradeNoneButton = new JRadioButton(SvnBundle.message("radio.configure." + label + ".none")); + myUpgradeAutoButton = new JRadioButton(SvnBundle.message("radio.configure." + label + ".auto")); + myUpgradeAuto15Button = new JRadioButton(SvnBundle.message("radio.configure." + label + ".auto.15format")); + myUpgradeAuto16Button = new JRadioButton(SvnBundle.message("radio.configure." + label + ".auto.16format")); ButtonGroup group = new ButtonGroup(); group.add(myUpgradeNoneButton);