Skip to content

Commit 57b5bb9

Browse files
author
emmanue1
committed
Fix syntax errors in decompiled sources
1 parent 90d5e76 commit 57b5bb9

File tree

55 files changed

+1761
-970
lines changed

Some content is hidden

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

55 files changed

+1761
-970
lines changed

src/main/java/org/jd/core/v1/model/javasyntax/AbstractJavaSyntaxVisitor.java

Lines changed: 4 additions & 4 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.
@@ -87,7 +87,7 @@ public void visit(Expressions list) {
8787

8888
@Override
8989
public void visit(ExpressionVariableInitializer declaration) {
90-
safeAccept(declaration.getExpression());
90+
declaration.getExpression().accept(this);
9191
}
9292

9393
@Override
@@ -98,8 +98,8 @@ public void visit(FieldDeclaration declaration) {
9898
}
9999

100100
@Override
101-
public void visit(FieldDeclarator declaration) {
102-
safeAccept(declaration.getVariableInitializer());
101+
public void visit(FieldDeclarator declarator) {
102+
safeAccept(declarator.getVariableInitializer());
103103
}
104104

105105
@Override

src/main/java/org/jd/core/v1/model/javasyntax/declaration/AnnotationDeclaration.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.
@@ -34,6 +34,6 @@ public void accept(DeclarationVisitor visitor) {
3434

3535
@Override
3636
public String toString() {
37-
return "AnnotationDeclaration{" + internalName + "}";
37+
return "AnnotationDeclaration{" + internalTypeName + "}";
3838
}
3939
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ public void accept(DeclarationVisitor visitor) {
3535

3636
@Override
3737
public String toString() {
38-
return "ClassDeclaration{" + internalName + "}";
38+
return "ClassDeclaration{" + internalTypeName + "}";
3939
}
4040
}

src/main/java/org/jd/core/v1/model/javasyntax/declaration/EnumDeclaration.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.
@@ -50,7 +50,7 @@ public void accept(DeclarationVisitor visitor) {
5050

5151
@Override
5252
public String toString() {
53-
return "EnumDeclaration{" + internalName + "}";
53+
return "EnumDeclaration{" + internalTypeName + "}";
5454
}
5555

5656
public static class Constant implements Declaration {

src/main/java/org/jd/core/v1/model/javasyntax/declaration/InterfaceDeclaration.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.
@@ -47,6 +47,6 @@ public void accept(DeclarationVisitor visitor) {
4747

4848
@Override
4949
public String toString() {
50-
return "InterfaceDeclaration{" + internalName + "}";
50+
return "InterfaceDeclaration{" + internalTypeName + "}";
5151
}
5252
}

src/main/java/org/jd/core/v1/model/javasyntax/declaration/ModuleDeclaration.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.
@@ -41,7 +41,7 @@ public void accept(DeclarationVisitor visitor) {
4141

4242
@Override
4343
public String toString() {
44-
return "ModuleDeclaration{" + internalName + "}";
44+
return "ModuleDeclaration{" + internalTypeName + "}";
4545
}
4646

4747
public static class ModuleInfo {

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

Lines changed: 6 additions & 6 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.
@@ -12,13 +12,13 @@
1212
public abstract class TypeDeclaration implements BaseTypeDeclaration, MemberDeclaration {
1313
protected BaseAnnotationReference annotationReferences;
1414
protected int flags;
15-
protected String internalName;
15+
protected String internalTypeName;
1616
protected String name;
1717

18-
protected TypeDeclaration(BaseAnnotationReference annotationReferences, int flags, String internalName, String name) {
18+
protected TypeDeclaration(BaseAnnotationReference annotationReferences, int flags, String internalTypeName, String name) {
1919
this.annotationReferences = annotationReferences;
2020
this.flags = flags;
21-
this.internalName = internalName;
21+
this.internalTypeName = internalTypeName;
2222
this.name = name;
2323
}
2424

@@ -30,8 +30,8 @@ public int getFlags() {
3030
return flags;
3131
}
3232

33-
public String getInternalName() {
34-
return internalName;
33+
public String getInternalTypeName() {
34+
return internalTypeName;
3535
}
3636

3737
public String getName() {

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

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ public ArrayTypeArguments(List<TypeArgument> list) {
2020
}
2121

2222
@Override
23-
public void accept(TypeVisitor visitor) {
24-
visitor.visit(this);
23+
public boolean isList() {
24+
return true;
2525
}
2626

2727
@Override
@@ -47,4 +47,14 @@ public boolean isTypeArgumentAssignableFrom(BaseTypeArgument typeArgument) {
4747

4848
return true;
4949
}
50+
51+
@Override
52+
public int typeArgumentSize() {
53+
return size();
54+
}
55+
56+
@Override
57+
public void accept(TypeVisitor visitor) {
58+
visitor.visit(this);
59+
}
5060
}

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,21 @@
77

88
package org.jd.core.v1.model.javasyntax.type;
99

10+
import org.jd.core.v1.util.DefaultList;
11+
12+
@SuppressWarnings("unchecked")
1013
public interface BaseTypeArgument extends TypeVisitable {
1114
boolean isTypeArgumentAssignableFrom(BaseTypeArgument typeArgument);
15+
16+
default TypeArgument getTypeArgumentFirst() {
17+
return (TypeArgument)this;
18+
}
19+
20+
default DefaultList<TypeArgument> getTypeArgumentList() {
21+
return (DefaultList<TypeArgument>)this;
22+
}
23+
24+
default int typeArgumentSize() {
25+
return 1;
26+
}
1227
}

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,15 @@ public void accept(TypeVisitor visitor) {
6767

6868
@Override
6969
public boolean isTypeArgumentAssignableFrom(BaseTypeArgument typeArgument) {
70-
return equals(typeArgument);
70+
if (typeArgument.getClass() == GenericType.class) {
71+
return true;
72+
} else if (typeArgument instanceof Type) {
73+
return true;
74+
} else if (typeArgument instanceof WildcardTypeArgument) {
75+
return false;
76+
}
77+
78+
return false;
7179
}
7280

7381
@Override

0 commit comments

Comments
 (0)