Skip to content

Commit 14dffa0

Browse files
author
emmanue1
committed
Fix generic cast expression
1 parent 31dafec commit 14dffa0

File tree

4 files changed

+23
-16
lines changed

4 files changed

+23
-16
lines changed

src/main/java/org/jd/core/v1/service/converter/classfiletojavasyntax/model/javasyntax/expression/ClassFileMethodInvocationExpression.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public class ClassFileMethodInvocationExpression extends MethodInvocationExpress
1919
protected AbstractTypeParametersToTypeArgumentsBinder binder;
2020
protected BaseTypeParameter typeParameters;
2121
protected BaseType parameterTypes;
22-
protected boolean binded = false;
22+
protected boolean bound = false;
2323

2424
public ClassFileMethodInvocationExpression(
2525
AbstractTypeParametersToTypeArgumentsBinder binder,
@@ -47,11 +47,11 @@ public void setParameterTypes(BaseType parameterTypes) {
4747
this.parameterTypes = parameterTypes;
4848
}
4949

50-
public boolean isBinded() {
51-
return binded;
50+
public boolean isBound() {
51+
return bound;
5252
}
5353

54-
public void setBinded(boolean binded) {
55-
this.binded = binded;
54+
public void setBound(boolean bound) {
55+
this.bound = bound;
5656
}
5757
}

src/main/java/org/jd/core/v1/service/converter/classfiletojavasyntax/model/javasyntax/expression/ClassFileNewExpression.java

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,21 @@
1515

1616
public class ClassFileNewExpression extends NewExpression {
1717
protected BaseType parameterTypes;
18-
protected boolean binded = false;
18+
protected boolean bound;
1919

2020
public ClassFileNewExpression(int lineNumber, ObjectType type) {
2121
super(lineNumber, type, null);
22+
this.bound = false;
2223
}
2324

2425
public ClassFileNewExpression(int lineNumber, ObjectType type, BodyDeclaration bodyDeclaration) {
2526
super(lineNumber, type, null, bodyDeclaration);
27+
this.bound = false;
28+
}
29+
30+
public ClassFileNewExpression(int lineNumber, ObjectType type, BodyDeclaration bodyDeclaration, boolean bound) {
31+
super(lineNumber, type, null, bodyDeclaration);
32+
this.bound = bound;
2633
}
2734

2835
public BaseType getParameterTypes() {
@@ -33,12 +40,12 @@ public void setParameterTypes(BaseType parameterTypes) {
3340
this.parameterTypes = parameterTypes;
3441
}
3542

36-
public boolean isBinded() {
37-
return binded;
43+
public boolean isBound() {
44+
return bound;
3845
}
3946

40-
public void setBinded(boolean binded) {
41-
this.binded = binded;
47+
public void setBound(boolean bound) {
48+
this.bound = bound;
4249
}
4350

4451
public void set(String descriptor, BaseType parameterTypes, BaseExpression parameters) {

src/main/java/org/jd/core/v1/service/converter/classfiletojavasyntax/util/ByteCodeParser.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1773,9 +1773,9 @@ private Expression newNewExpression(int lineNumber, String internalTypeName) {
17731773
}
17741774

17751775
if (declaration.getInterfaces() != null) {
1776-
return new ClassFileNewExpression(lineNumber, (ObjectType) declaration.getInterfaces(), bodyDeclaration);
1776+
return new ClassFileNewExpression(lineNumber, (ObjectType) declaration.getInterfaces(), bodyDeclaration, true);
17771777
} else if (declaration.getSuperType() != null) {
1778-
return new ClassFileNewExpression(lineNumber, declaration.getSuperType(), bodyDeclaration);
1778+
return new ClassFileNewExpression(lineNumber, declaration.getSuperType(), bodyDeclaration, true);
17791779
} else {
17801780
return new ClassFileNewExpression(lineNumber, ObjectType.TYPE_OBJECT, bodyDeclaration);
17811781
}

src/main/java/org/jd/core/v1/service/converter/classfiletojavasyntax/util/Java5TypeParametersToTypeArgumentsBinder.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ public void visit(MethodInvocationExpression expression) {
365365
public void visit(MethodInvocationExpression expression) {
366366
ClassFileMethodInvocationExpression mie = (ClassFileMethodInvocationExpression)expression;
367367

368-
if (! mie.isBinded()) {
368+
if (! mie.isBound()) {
369369
BaseType parameterTypes = mie.getParameterTypes();
370370
BaseExpression parameters = mie.getParameters();
371371
Expression exp = mie.getExpression();
@@ -466,7 +466,7 @@ public void visit(MethodInvocationExpression expression) {
466466

467467
bindParameters(parameterTypes, parameters);
468468

469-
mie.setBinded(true);
469+
mie.setBound(true);
470470
}
471471
}
472472

@@ -483,7 +483,7 @@ public void visit(LocalVariableReferenceExpression expression) {
483483
public void visit(NewExpression expression) {
484484
ClassFileNewExpression ne = (ClassFileNewExpression)expression;
485485

486-
if (! ne.isBinded()) {
486+
if (! ne.isBound()) {
487487
BaseType parameterTypes = ne.getParameterTypes();
488488
BaseExpression parameters = ne.getParameters();
489489
ObjectType neObjectType = ne.getObjectType();
@@ -537,7 +537,7 @@ public void visit(NewExpression expression) {
537537

538538
bindParameters(parameterTypes, parameters);
539539

540-
ne.setBinded(true);
540+
ne.setBound(true);
541541
}
542542
}
543543

0 commit comments

Comments
 (0)