Skip to content

Commit 9b3a168

Browse files
author
emmanue1
committed
Fix syntax errors in decompiled sources
1 parent 8ed4e58 commit 9b3a168

17 files changed

+77
-65
lines changed

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

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,16 @@
1111

1212
public class AnnotationDeclaration extends TypeDeclaration {
1313
protected BaseFieldDeclarator annotationDeclarators;
14-
protected BodyDeclaration bodyDeclaration;
1514

1615
public AnnotationDeclaration(BaseAnnotationReference annotationReferences, int flags, String internalName, String name, BaseFieldDeclarator annotationDeclarators, BodyDeclaration bodyDeclaration) {
17-
super(annotationReferences, flags, internalName, name);
16+
super(annotationReferences, flags, internalName, name, bodyDeclaration);
1817
this.annotationDeclarators = annotationDeclarators;
19-
this.bodyDeclaration = bodyDeclaration;
2018
}
2119

2220
public BaseFieldDeclarator getAnnotationDeclarators() {
2321
return annotationDeclarators;
2422
}
2523

26-
public BodyDeclaration getBodyDeclaration() {
27-
return bodyDeclaration;
28-
}
29-
3024
@Override
3125
public void accept(DeclarationVisitor visitor) {
3226
visitor.visit(this);

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

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,16 @@
1616
public class EnumDeclaration extends TypeDeclaration {
1717
protected BaseType interfaces;
1818
protected List<Constant> constants;
19-
protected BodyDeclaration bodyDeclaration;
2019

2120
public EnumDeclaration(int flags, String internalName, String name, List<Constant> constants, BodyDeclaration bodyDeclaration) {
22-
super(null, flags, internalName, name);
21+
super(null, flags, internalName, name, bodyDeclaration);
2322
this.constants = constants;
24-
this.bodyDeclaration = bodyDeclaration;
2523
}
2624

2725
public EnumDeclaration(BaseAnnotationReference annotationReferences, int flags, String internalName, String name, BaseType interfaces, List<Constant> constants, BodyDeclaration bodyDeclaration) {
28-
super(annotationReferences, flags, internalName, name);
26+
super(annotationReferences, flags, internalName, name, bodyDeclaration);
2927
this.interfaces = interfaces;
3028
this.constants = constants;
31-
this.bodyDeclaration = bodyDeclaration;
3229
}
3330

3431
public BaseType getInterfaces() {
@@ -39,10 +36,6 @@ public List<Constant> getConstants() {
3936
return constants;
4037
}
4138

42-
public BodyDeclaration getBodyDeclaration() {
43-
return bodyDeclaration;
44-
}
45-
4639
@Override
4740
public void accept(DeclarationVisitor visitor) {
4841
visitor.visit(this);

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

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,16 @@
1414
public class InterfaceDeclaration extends TypeDeclaration {
1515
protected BaseTypeParameter typeParameters;
1616
protected BaseType interfaces;
17-
protected BodyDeclaration bodyDeclaration;
1817

1918
public InterfaceDeclaration(int flags, String internalName, String name, BaseType interfaces) {
20-
super(null, flags, internalName, name);
19+
super(null, flags, internalName, name, null);
2120
this.interfaces = interfaces;
2221
}
2322

2423
public InterfaceDeclaration(BaseAnnotationReference annotationReferences, int flags, String internalName, String name, BaseTypeParameter typeParameters, BaseType interfaces, BodyDeclaration bodyDeclaration) {
25-
super(annotationReferences, flags, internalName, name);
24+
super(annotationReferences, flags, internalName, name, bodyDeclaration);
2625
this.typeParameters = typeParameters;
2726
this.interfaces = interfaces;
28-
this.bodyDeclaration = bodyDeclaration;
2927
}
3028

3129
public BaseTypeParameter getTypeParameters() {
@@ -36,10 +34,6 @@ public BaseType getInterfaces() {
3634
return interfaces;
3735
}
3836

39-
public BodyDeclaration getBodyDeclaration() {
40-
return bodyDeclaration;
41-
}
42-
4337
@Override
4438
public void accept(DeclarationVisitor visitor) {
4539
visitor.visit(this);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public class ModuleDeclaration extends TypeDeclaration {
1818
protected List<ServiceInfo> provides;
1919

2020
public ModuleDeclaration(int flags, String internalName, String name, String version, List<ModuleInfo> requires, List<PackageInfo> exports, List<PackageInfo> opens, List<String> uses, List<ServiceInfo> provides) {
21-
super(null, flags, internalName, name);
21+
super(null, flags, internalName, name, null);
2222
this.version = version;
2323
this.requires = requires;
2424
this.exports = exports;

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,14 @@ public abstract class TypeDeclaration implements BaseTypeDeclaration, MemberDecl
1414
protected int flags;
1515
protected String internalTypeName;
1616
protected String name;
17+
protected BodyDeclaration bodyDeclaration;
1718

18-
protected TypeDeclaration(BaseAnnotationReference annotationReferences, int flags, String internalTypeName, String name) {
19+
protected TypeDeclaration(BaseAnnotationReference annotationReferences, int flags, String internalTypeName, String name, BodyDeclaration bodyDeclaration) {
1920
this.annotationReferences = annotationReferences;
2021
this.flags = flags;
2122
this.internalTypeName = internalTypeName;
2223
this.name = name;
24+
this.bodyDeclaration = bodyDeclaration;
2325
}
2426

2527
public BaseAnnotationReference getAnnotationReferences() {
@@ -37,4 +39,8 @@ public String getInternalTypeName() {
3739
public String getName() {
3840
return name;
3941
}
42+
43+
public BodyDeclaration getBodyDeclaration() {
44+
return bodyDeclaration;
45+
}
4046
}

src/main/java/org/jd/core/v1/service/converter/classfiletojavasyntax/model/javasyntax/declaration/ClassFileAnnotationDeclaration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import org.jd.core.v1.model.javasyntax.declaration.AnnotationDeclaration;
1111
import org.jd.core.v1.model.javasyntax.reference.BaseAnnotationReference;
1212

13-
public class ClassFileAnnotationDeclaration extends AnnotationDeclaration implements ClassFileMemberDeclaration {
13+
public class ClassFileAnnotationDeclaration extends AnnotationDeclaration implements ClassFileTypeDeclaration {
1414
protected int firstLineNumber;
1515

1616
public ClassFileAnnotationDeclaration(BaseAnnotationReference annotationReferences, int flags, String internalName, String name, ClassFileBodyDeclaration bodyDeclaration) {

src/main/java/org/jd/core/v1/service/converter/classfiletojavasyntax/model/javasyntax/declaration/ClassFileBodyDeclaration.java

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99

1010
import org.jd.core.v1.model.javasyntax.declaration.BaseMemberDeclaration;
1111
import org.jd.core.v1.model.javasyntax.declaration.BodyDeclaration;
12-
import org.jd.core.v1.model.javasyntax.declaration.TypeDeclaration;
13-
import org.jd.core.v1.model.javasyntax.expression.FieldReferenceExpression;
1412
import org.jd.core.v1.model.javasyntax.type.BaseType;
1513
import org.jd.core.v1.model.javasyntax.type.ObjectType;
1614
import org.jd.core.v1.model.javasyntax.type.TypeArgument;
@@ -24,8 +22,8 @@
2422
public class ClassFileBodyDeclaration extends BodyDeclaration implements ClassFileMemberDeclaration {
2523
protected List<ClassFileFieldDeclaration> fieldDeclarations;
2624
protected List<ClassFileConstructorOrMethodDeclaration> methodDeclarations;
27-
protected List<ClassFileMemberDeclaration> innerTypeDeclarations;
28-
protected Map<String, ClassFileMemberDeclaration> innerTypeMap = Collections.emptyMap();
25+
protected List<ClassFileTypeDeclaration> innerTypeDeclarations;
26+
protected Map<String, ClassFileTypeDeclaration> innerTypeMap = Collections.emptyMap();
2927
protected int firstLineNumber;
3028
protected ObjectType outerType;
3129
protected DefaultList<String> syntheticInnerFieldNames;
@@ -64,25 +62,24 @@ public void setMethodDeclarations(List<ClassFileConstructorOrMethodDeclaration>
6462
}
6563
}
6664

67-
public List<ClassFileMemberDeclaration> getInnerTypeDeclarations() {
65+
public List<ClassFileTypeDeclaration> getInnerTypeDeclarations() {
6866
return innerTypeDeclarations;
6967
}
7068

71-
public void setInnerTypeDeclarations(List<ClassFileMemberDeclaration> innerTypeDeclarations) {
69+
public void setInnerTypeDeclarations(List<ClassFileTypeDeclaration> innerTypeDeclarations) {
7270
if (innerTypeDeclarations != null) {
7371
updateFirstLineNumber(this.innerTypeDeclarations = innerTypeDeclarations);
7472

7573
innerTypeMap = new HashMap<>();
7674

77-
for (ClassFileMemberDeclaration innerType : innerTypeDeclarations) {
78-
TypeDeclaration td = (TypeDeclaration) innerType;
79-
innerTypeMap.put(td.getInternalTypeName(), innerType);
75+
for (ClassFileTypeDeclaration innerType : innerTypeDeclarations) {
76+
innerTypeMap.put(innerType.getInternalTypeName(), innerType);
8077
}
8178
}
8279
}
8380

84-
public ClassFileMemberDeclaration getInnerTypeDeclaration(String internalName) {
85-
ClassFileMemberDeclaration declaration = innerTypeMap.get(internalName);
81+
public ClassFileTypeDeclaration getInnerTypeDeclaration(String internalName) {
82+
ClassFileTypeDeclaration declaration = innerTypeMap.get(internalName);
8683

8784
if ((declaration == null) && (outerBodyDeclaration != null)) {
8885
return outerBodyDeclaration.getInnerTypeDeclaration(internalName);

src/main/java/org/jd/core/v1/service/converter/classfiletojavasyntax/model/javasyntax/declaration/ClassFileClassDeclaration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import org.jd.core.v1.model.javasyntax.type.BaseTypeParameter;
1414
import org.jd.core.v1.model.javasyntax.type.ObjectType;
1515

16-
public class ClassFileClassDeclaration extends ClassDeclaration implements ClassFileMemberDeclaration {
16+
public class ClassFileClassDeclaration extends ClassDeclaration implements ClassFileTypeDeclaration {
1717
protected int firstLineNumber;
1818

1919
public ClassFileClassDeclaration(BaseAnnotationReference annotationReferences, int flags, String internalName, String name, BaseTypeParameter typeParameters, ObjectType superType, BaseType interfaces, ClassFileBodyDeclaration bodyDeclaration) {

src/main/java/org/jd/core/v1/service/converter/classfiletojavasyntax/model/javasyntax/declaration/ClassFileEnumDeclaration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
import java.util.List;
1717

18-
public class ClassFileEnumDeclaration extends EnumDeclaration implements ClassFileMemberDeclaration {
18+
public class ClassFileEnumDeclaration extends EnumDeclaration implements ClassFileTypeDeclaration {
1919
protected int firstLineNumber;
2020

2121
public ClassFileEnumDeclaration(BaseAnnotationReference annotationReferences, int flags, String internalName, String name, BaseType interfaces, ClassFileBodyDeclaration bodyDeclaration) {

src/main/java/org/jd/core/v1/service/converter/classfiletojavasyntax/model/javasyntax/declaration/ClassFileInterfaceDeclaration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import org.jd.core.v1.model.javasyntax.type.BaseType;
1313
import org.jd.core.v1.model.javasyntax.type.BaseTypeParameter;
1414

15-
public class ClassFileInterfaceDeclaration extends InterfaceDeclaration implements ClassFileMemberDeclaration {
15+
public class ClassFileInterfaceDeclaration extends InterfaceDeclaration implements ClassFileTypeDeclaration {
1616
protected int firstLineNumber;
1717

1818
public ClassFileInterfaceDeclaration(BaseAnnotationReference annotationReferences, int flags, String internalName, String name, BaseTypeParameter typeParameters, BaseType interfaces, ClassFileBodyDeclaration bodyDeclaration) {

0 commit comments

Comments
 (0)