Skip to content

Commit 3f94ab1

Browse files
author
emmanue1
committed
Fix syntax errors in decompiled sources - score 0
1 parent e8035a0 commit 3f94ab1

File tree

53 files changed

+1893
-1125
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+1893
-1125
lines changed

src/main/java/org/jd/core/v1/model/classfile/attribute/CodeException.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2008-2019 Emmanuel Dupuy.
2+
* Copyright (c) 2008, 2019 Emmanuel Dupuy.
33
* This project is distributed under the GPLv3 license.
44
* This is a Copyleft license that gives the user the right to use,
55
* copy and modify the code freely for non-commercial purposes.
@@ -51,7 +51,7 @@ public boolean equals(Object o) {
5151

5252
@Override
5353
public int hashCode() {
54-
return 31 * startPc + endPc;
54+
return 969815374 + 31 * startPc + endPc;
5555
}
5656

5757
@Override

src/main/java/org/jd/core/v1/model/javasyntax/declaration/ExpressionVariableInitializer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public boolean equals(Object o) {
4343

4444
@Override
4545
public int hashCode() {
46-
return expression != null ? expression.hashCode() : 0;
46+
return 25107399 + (expression != null ? expression.hashCode() : 0);
4747
}
4848

4949
@Override

src/main/java/org/jd/core/v1/model/javasyntax/declaration/FieldDeclaration.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2008-2019 Emmanuel Dupuy.
2+
* Copyright (c) 2008, 2019 Emmanuel Dupuy.
33
* This project is distributed under the GPLv3 license.
44
* This is a Copyleft license that gives the user the right to use,
55
* copy and modify the code freely for non-commercial purposes.
@@ -65,7 +65,7 @@ public boolean equals(Object o) {
6565

6666
@Override
6767
public int hashCode() {
68-
int result = flags;
68+
int result = 327494460 + flags;
6969
result = 31 * result + (annotationReferences != null ? annotationReferences.hashCode() : 0);
7070
result = 31 * result + type.hashCode();
7171
result = 31 * result + fieldDeclarators.hashCode();

src/main/java/org/jd/core/v1/model/javasyntax/declaration/FieldDeclarator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public boolean equals(Object o) {
7070

7171
@Override
7272
public int hashCode() {
73-
int result = name.hashCode();
73+
int result = 544278669 + name.hashCode();
7474
result = 31 * result + dimension;
7575
result = 31 * result + (variableInitializer != null ? variableInitializer.hashCode() : 0);
7676
return result;

src/main/java/org/jd/core/v1/model/javasyntax/reference/AnnotationReference.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2008-2019 Emmanuel Dupuy.
2+
* Copyright (c) 2008, 2019 Emmanuel Dupuy.
33
* This project is distributed under the GPLv3 license.
44
* This is a Copyleft license that gives the user the right to use,
55
* copy and modify the code freely for non-commercial purposes.
@@ -63,7 +63,7 @@ public boolean equals(Object o) {
6363

6464
@Override
6565
public int hashCode() {
66-
int result = type.hashCode();
66+
int result = 970748295 + type.hashCode();
6767
result = 31 * result + (elementValue != null ? elementValue.hashCode() : 0);
6868
result = 31 * result + (elementValuePairs != null ? elementValuePairs.hashCode() : 0);
6969
return result;

src/main/java/org/jd/core/v1/model/javasyntax/type/AbstractTypeArgumentVisitor.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@
1010
public abstract class AbstractTypeArgumentVisitor implements TypeArgumentVisitor {
1111
@Override
1212
public void visit(TypeArguments arguments) {
13-
for (TypeArgument typeArgument : arguments)
13+
for (TypeArgument typeArgument : arguments) {
1414
typeArgument.accept(this);
15+
}
1516
}
1617

1718
@Override
@@ -47,7 +48,8 @@ public void visit(GenericType type) {}
4748
public void visit(WildcardTypeArgument argument) {}
4849

4950
protected void safeAccept(TypeArgumentVisitable visitable) {
50-
if (visitable != null)
51+
if (visitable != null) {
5152
visitable.accept(this);
53+
}
5254
}
5355
}

src/main/java/org/jd/core/v1/model/javasyntax/type/GenericType.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public boolean equals(Object o) {
6060

6161
@Override
6262
public int hashCode() {
63-
int result = name.hashCode();
63+
int result = 991890290 + name.hashCode();
6464
result = 31 * result + dimension;
6565
return result;
6666
}

src/main/java/org/jd/core/v1/model/javasyntax/type/InnerObjectType.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public boolean equals(Object o) {
7878

7979
@Override
8080
public int hashCode() {
81-
int result = super.hashCode();
81+
int result = 111476860 + super.hashCode();
8282
result = 31 * result + outerType.hashCode();
8383
return result;
8484
}

src/main/java/org/jd/core/v1/model/javasyntax/type/ObjectType.java

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@ public class ObjectType implements Type {
1111
public static final ObjectType TYPE_BOOLEAN = new ObjectType("java/lang/Boolean", "java.lang.Boolean", "Boolean");
1212
public static final ObjectType TYPE_BYTE = new ObjectType("java/lang/Byte", "java.lang.Byte", "Byte");
1313
public static final ObjectType TYPE_CHARACTER = new ObjectType("java/lang/Character", "java.lang.Character", "Character");
14-
public static final ObjectType TYPE_CLASS = new ObjectType("java/lang/Class", "java.lang.Class", "Class", WildcardTypeArgument.WILDCARD_TYPE_ARGUMENT);
14+
public static final ObjectType TYPE_CLASS = new ObjectType("java/lang/Class", "java.lang.Class", "Class");
15+
public static final ObjectType TYPE_CLASS_WILDCARD = TYPE_CLASS.createType(WildcardTypeArgument.WILDCARD_TYPE_ARGUMENT);
1516
public static final ObjectType TYPE_DOUBLE = new ObjectType("java/lang/Double", "java.lang.Double", "Double");
1617
public static final ObjectType TYPE_EXCEPTION = new ObjectType("java/lang/Exception", "java.lang.Exception", "Exception");
1718
public static final ObjectType TYPE_FLOAT = new ObjectType("java/lang/Float", "java.lang.Float", "Float");
1819
public static final ObjectType TYPE_INTEGER = new ObjectType("java/lang/Integer", "java.lang.Integer", "Integer");
20+
public static final ObjectType TYPE_ITERABLE = new ObjectType("java/lang/Iterable", "java.lang.Iterable", "Iterable");
1921
public static final ObjectType TYPE_LONG = new ObjectType("java/lang/Long", "java.lang.Long", "Long");
2022
public static final ObjectType TYPE_MATH = new ObjectType("java/lang/Math", "java.lang.Math", "Math");
2123
public static final ObjectType TYPE_OBJECT = new ObjectType("java/lang/Object", "java.lang.Object", "Object");
@@ -153,7 +155,11 @@ public Type createType(int dimension) {
153155
}
154156

155157
public ObjectType createType(BaseTypeArgument typeArguments) {
156-
return new ObjectType(internalName, qualifiedName, name, typeArguments, dimension);
158+
if (this.typeArguments == typeArguments) {
159+
return this;
160+
} else {
161+
return new ObjectType(internalName, qualifiedName, name, typeArguments, dimension);
162+
}
157163
}
158164

159165
@Override
@@ -180,7 +186,7 @@ public boolean equals(Object o) {
180186

181187
@Override
182188
public int hashCode() {
183-
int result = internalName.hashCode();
189+
int result = 735485092 + internalName.hashCode();
184190
result = 31 * result + (typeArguments != null ? typeArguments.hashCode() : 0);
185191
result = 31 * result + dimension;
186192
return result;
@@ -198,7 +204,9 @@ public void accept(TypeArgumentVisitor visitor) {
198204

199205
@Override
200206
public boolean isTypeArgumentAssignableFrom(BaseTypeArgument typeArgument) {
201-
if (typeArgument.getClass() != ObjectType.class) {
207+
Class typeArgumentClass = typeArgument.getClass();
208+
209+
if ((typeArgumentClass != ObjectType.class) && (typeArgumentClass != InnerObjectType.class)) {
202210
return false;
203211
}
204212

src/main/java/org/jd/core/v1/model/javasyntax/type/PrimitiveType.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ public boolean equals(Object o) {
145145

146146
@Override
147147
public int hashCode() {
148-
return flags;
148+
return 750039781 + flags;
149149
}
150150

151151
@Override

0 commit comments

Comments
 (0)