|
|
@ -163,7 +163,7 @@ public class NewExprent extends Exprent { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public String toJava(int indent) { |
|
|
|
public String toJava(int indent) { |
|
|
|
StringBuffer buf = new StringBuffer(); |
|
|
|
StringBuilder buf = new StringBuilder(); |
|
|
|
|
|
|
|
|
|
|
|
if(anonymous) { |
|
|
|
if(anonymous) { |
|
|
|
|
|
|
|
|
|
|
@ -189,9 +189,13 @@ public class NewExprent extends Exprent { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
boolean firstpar = true; |
|
|
|
boolean firstpar = true; |
|
|
|
for(int i=0;i<invsuper.getLstParameters().size();i++) { |
|
|
|
int start = 0, end = invsuper.getLstParameters().size(); |
|
|
|
|
|
|
|
if(enumconst) { |
|
|
|
|
|
|
|
start += 2; end -= 1; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
for(int i=start;i<end;i++) { |
|
|
|
if(sigFields == null || sigFields.get(i) == null) { |
|
|
|
if(sigFields == null || sigFields.get(i) == null) { |
|
|
|
if(!firstpar) { |
|
|
|
if(!firstpar) { |
|
|
|
buf.append(", "); |
|
|
|
buf.append(", "); |
|
|
@ -239,7 +243,11 @@ public class NewExprent extends Exprent { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
buf.append(")"); |
|
|
|
buf.append(")"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(enumconst && buf.length() == 2) { |
|
|
|
|
|
|
|
buf.setLength(0); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
StringWriter strwriter = new StringWriter(); |
|
|
|
StringWriter strwriter = new StringWriter(); |
|
|
|
BufferedWriter bufstrwriter = new BufferedWriter(strwriter); |
|
|
|
BufferedWriter bufstrwriter = new BufferedWriter(strwriter); |
|
|
|
|
|
|
|
|
|
|
@ -297,26 +305,29 @@ public class NewExprent extends Exprent { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
buf.append("("); |
|
|
|
int start = enumconst ? 2 : 0; |
|
|
|
|
|
|
|
if(start < lstParameters.size()) { |
|
|
|
boolean firstpar = true; |
|
|
|
buf.append("("); |
|
|
|
for(int i=0;i<lstParameters.size();i++) { |
|
|
|
|
|
|
|
if(sigFields == null || sigFields.get(i) == null) { |
|
|
|
boolean firstpar = true; |
|
|
|
if(!firstpar) { |
|
|
|
for(int i=start;i<lstParameters.size();i++) { |
|
|
|
buf.append(", "); |
|
|
|
if(sigFields == null || sigFields.get(i) == null) { |
|
|
|
} |
|
|
|
if(!firstpar) { |
|
|
|
|
|
|
|
buf.append(", "); |
|
|
|
StringBuilder buff = new StringBuilder(); |
|
|
|
} |
|
|
|
ExprProcessor.getCastedExprent(lstParameters.get(i), constructor.getDescriptor().params[i], buff, indent, true); |
|
|
|
|
|
|
|
|
|
|
|
StringBuilder buff = new StringBuilder(); |
|
|
|
buf.append(buff); |
|
|
|
ExprProcessor.getCastedExprent(lstParameters.get(i), constructor.getDescriptor().params[i], buff, indent, true); |
|
|
|
firstpar = false; |
|
|
|
|
|
|
|
} |
|
|
|
buf.append(buff); |
|
|
|
} |
|
|
|
firstpar = false; |
|
|
|
buf.append(")"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
buf.append(")"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if(!enumconst) { |
|
|
|
if(!enumconst) { |
|
|
|
String enclosing = null; |
|
|
|
String enclosing = null; |
|
|
|
if(constructor != null) { |
|
|
|
if(constructor != null) { |
|
|
@ -341,11 +352,11 @@ public class NewExprent extends Exprent { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
buf.append("new "+ExprProcessor.getTypeName(newtype)); |
|
|
|
buf.append("new ").append(ExprProcessor.getTypeName(newtype)); |
|
|
|
|
|
|
|
|
|
|
|
if(lstArrayElements.isEmpty()) { |
|
|
|
if(lstArrayElements.isEmpty()) { |
|
|
|
for(int i=0;i<newtype.arraydim;i++) { |
|
|
|
for(int i=0;i<newtype.arraydim;i++) { |
|
|
|
buf.append("["+(i<lstDims.size()?lstDims.get(i).toJava(indent):"")+"]"); |
|
|
|
buf.append("[").append(i < lstDims.size() ? lstDims.get(i).toJava(indent) : "").append("]"); |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
for(int i=0;i<newtype.arraydim;i++) { |
|
|
|
for(int i=0;i<newtype.arraydim;i++) { |
|
|
|