Ignore:
Timestamp:
2016-05-30T01:17:28+02:00 (5 years ago)
Author:
Don-vip
Message:

sonar - Performance - Method passes constant String of length 1 to character overridden method + add unit tests/javadoc

Location:
trunk/src/org/openstreetmap/josm/tools/bugreport
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/bugreport/BugReport.java

    r10285 r10300  
    7070            if (className.equals(element.getClassName()) && "getCallingMethod".equals(element.getMethodName())) {
    7171                StackTraceElement toReturn = stackTrace[i + offset];
    72                 return toReturn.getClassName().replaceFirst(".*\\.", "") + "#" + toReturn.getMethodName();
     72                return toReturn.getClassName().replaceFirst(".*\\.", "") + '#' + toReturn.getMethodName();
    7373            }
    7474        }
  • trunk/src/org/openstreetmap/josm/tools/bugreport/ReportedException.java

    r10285 r10300  
    124124
    125125    private static String niceThreadName(Thread thread) {
    126         String name = "Thread: " + thread.getName() + " (" + thread.getId() + ")";
     126        String name = "Thread: " + thread.getName() + " (" + thread.getId() + ')';
    127127        ThreadGroup threadGroup = thread.getThreadGroup();
    128128        if (threadGroup != null) {
     
    221221    @Override
    222222    public String toString() {
    223         StringBuilder builder = new StringBuilder();
    224         builder.append("CrashReportedException [on thread ");
    225         builder.append(caughtOnThread);
    226         builder.append("]");
    227         return builder.toString();
     223        return new StringBuilder(48)
     224            .append("CrashReportedException [on thread ")
     225            .append(caughtOnThread)
     226            .append(']')
     227            .toString();
    228228    }
    229229
     
    235235            this.key = key;
    236236            this.value = value;
    237 
    238237        }
    239238
     
    273272         */
    274273        public void printSection(PrintWriter out) {
    275             out.println(sectionName + ":");
     274            out.println(sectionName + ':');
    276275            if (entries.isEmpty()) {
    277276                out.println("No data collected.");
Note: See TracChangeset for help on using the changeset viewer.