Skip to content

Commit

Permalink
Remove unnecessary calls to toString
Browse files Browse the repository at this point in the history
  • Loading branch information
liblit committed Sep 22, 2024
1 parent 38c41b7 commit 5d708e3
Show file tree
Hide file tree
Showing 18 changed files with 26 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ protected static class ManySubtypesWarning extends Warning {

@Override
public String getMsg() {
return getClass().toString() + " : " + T + ' ' + nImplementors;
return getClass() + " : " + T + ' ' + nImplementors;
}

public static ManySubtypesWarning create(TypeAbstraction T, int n) {
Expand All @@ -132,7 +132,7 @@ protected static class NoSubtypesWarning extends Warning {

@Override
public String getMsg() {
return getClass().toString() + " : " + T;
return getClass() + " : " + T;
}

public static NoSubtypesWarning create(TypeAbstraction T) {
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/com/ibm/wala/cfg/ShrikeCFG.java
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ private static class FailedExceptionResolutionWarning extends Warning {

@Override
public String getMsg() {
return getClass().toString() + " : " + T;
return getClass() + " : " + T;
}

public static FailedExceptionResolutionWarning create(TypeReference T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ private static class ClassNotFoundWarning extends Warning {

@Override
public String getMsg() {
return getClass().toString() + " : " + className;
return getClass() + " : " + className;
}

public static ClassNotFoundWarning create(ImmutableByteArray className) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ private static class InvalidClassLoaderImplementation extends Warning {

@Override
public String getMsg() {
return getClass().toString() + " : " + impl;
return getClass() + " : " + impl;
}

public static InvalidClassLoaderImplementation create(String impl) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ private static class MultipleImplementationsWarning extends Warning {

@Override
public String getMsg() {
return getClass().toString() + " : " + className;
return getClass() + " : " + className;
}

public static MultipleImplementationsWarning create(String className) {
Expand All @@ -370,7 +370,7 @@ private static class InvalidClassFile extends Warning {

@Override
public String getMsg() {
return getClass().toString() + " : " + className;
return getClass() + " : " + className;
}

public static InvalidClassFile create(String className) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public static class MethodResolutionFailure extends Warning {

@Override
public String getMsg() {
return getClass().toString() + " : " + method;
return getClass() + " : " + method;
}

public static MethodResolutionFailure moderate(MemberReference method) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ private static class AllocationFailure extends Warning {

@Override
public String getMsg() {
return getClass().toString() + " : " + t;
return getClass() + " : " + t;
}

public static AllocationFailure create(TypeReference t) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ public void summarizeByPackage() {
.append('/')
.append(n.getMethod().getName())
.append('/')
.append(n.getContext().getClass().toString());
.append(n.getContext().getClass());

if (n.getContext().isA(ReceiverInstanceContext.class)) {
nmBuilder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ private static class EntrypointResolutionWarning extends Warning {

@Override
public String getMsg() {
return getClass().toString() + " : " + entrypoint;
return getClass() + " : " + entrypoint;
}

public static EntrypointResolutionWarning create(Entrypoint entrypoint) {
Expand Down Expand Up @@ -467,7 +467,7 @@ private static class ExceptionLookupFailure extends Warning {

@Override
public String getMsg() {
return getClass().toString() + " : " + t;
return getClass() + " : " + t;
}

public static ExceptionLookupFailure create(TypeReference t) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2417,7 +2417,7 @@ private static class CheckcastFailure extends Warning {

@Override
public String getMsg() {
return getClass().toString() + " : " + type;
return getClass() + " : " + type;
}

public static CheckcastFailure create(TypeReference type) {
Expand All @@ -2440,7 +2440,7 @@ private static class FieldResolutionFailure extends Warning {

@Override
public String getMsg() {
return getClass().toString() + " : " + field;
return getClass() + " : " + field;
}

public static FieldResolutionFailure create(FieldReference field) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1259,7 +1259,7 @@ private static class ClassExclusion extends Warning {

@Override
public String getMsg() {
return getClass().toString() + " : " + klass + ' ' + message;
return getClass() + " : " + klass + ' ' + message;
}

public static ClassExclusion create(TypeReference klass, String message) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class ClassHierarchyWarning extends Warning {

@Override
public String getMsg() {
return getClass().toString() + " : " + message;
return getClass() + " : " + message;
}

public static ClassHierarchyWarning create(String message) {
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/com/ibm/wala/ssa/SSACFG.java
Original file line number Diff line number Diff line change
Expand Up @@ -1117,7 +1117,7 @@ private static class ExceptionLoadFailure extends Warning {

@Override
public String getMsg() {
return getClass().toString() + " : " + type + ' ' + method;
return getClass() + " : " + type + ' ' + method;
}

public static ExceptionLoadFailure create(TypeReference type, IMethod method) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ private static class FailedExceptionResolutionWarning extends Warning {

@Override
public String getMsg() {
return getClass().toString() + " : " + T;
return getClass() + " : " + T;
}

public static FailedExceptionResolutionWarning create(TypeReference T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ private static class MultipleDexImplementationsWarning extends Warning {

@Override
public String getMsg() {
return getClass().toString() + " : " + className;
return getClass() + " : " + className;
}

public static MultipleDexImplementationsWarning create(String className) {
Expand All @@ -214,7 +214,7 @@ private static class InvalidDexFile extends Warning {

@Override
public String getMsg() {
return getClass().toString() + " : " + className;
return getClass() + " : " + className;
}

public static InvalidDexFile create(String className) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -915,7 +915,7 @@ public SummarizedMethod getMethodAs(
System.err.println("\tcaller=\t" + caller);
System.err.println("\tinfo=\t" + info);
System.err.println("\tcallerND=\t" + callerNd);
System.err.println("\tthis=\t" + this.getClass().toString());
System.err.println("\tthis=\t" + this.getClass());
System.err.println("\tthis.name=\t" + this.name);

throw new IllegalStateException(e);
Expand Down Expand Up @@ -954,7 +954,7 @@ public IMethod getMethodEncap() throws CancelException {
new TypeSafeInstructionFactory(getClassHierarchy());
final ParameterAccessor acc = new ParameterAccessor(asMethod, /* hasImplicitThis: */ false);
final SSAValueManager pm = new SSAValueManager(acc);
pm.breadCrumb = "Encap: " + this.getClass().toString();
pm.breadCrumb = "Encap: " + this.getClass();

final SummarizedMethod model = getMethod();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public static AndroidModelClass getInstance(IClassHierarchy cha) {
throw new IllegalArgumentException(
String.format(
"android model class does not have expected type %s, but %s!",
AndroidModelClass.class, android.getClass().toString()));
AndroidModelClass.class, android.getClass()));
} else {
mClass = (AndroidModelClass) android;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ public void leave() {
names.add((String) oName);
} else {
throw new IllegalStateException(
"Unexpected Attribute type for name: " + oName.getClass().toString());
"Unexpected Attribute type for name: " + oName.getClass());
}
} else if (current == Tag.DATA) {
Object oUrl = attributesHistory.get(Attr.SCHEME).peek();
Expand All @@ -597,7 +597,7 @@ public void leave() {
urls.add((String) oUrl);
} else {
throw new IllegalStateException(
"Unexpected Attribute type for name: " + oUrl.getClass().toString());
"Unexpected Attribute type for name: " + oUrl.getClass());
}
} else {
throw new IllegalStateException("Error in parser implementation");
Expand Down Expand Up @@ -671,7 +671,7 @@ public void leave() {
overrideTargets.add((Intent) oIntent);
} else {
throw new IllegalStateException(
"Unexpected Attribute type for Intent: " + oIntent.getClass().toString());
"Unexpected Attribute type for Intent: " + oIntent.getClass());
}
} else {
throw new IllegalStateException("Error in parser implementation");
Expand Down

0 comments on commit 5d708e3

Please sign in to comment.