Some more bug fixes, see changelog.

git-svn-id: https://svn.code.sf.net/p/jode/code/branches/branch_1_1@1307 379699f6-c40d-0410-875b-85095c16579e
branch_1_1
hoenicke 24 years ago
parent f1cee9fca4
commit c5fae0c7ee
  1. 14
      jode/ChangeLog
  2. 16
      jode/jode/decompiler/LocalInfo.java
  3. 2
      jode/jode/decompiler/TabbedPrintWriter.java
  4. 4
      jode/jode/expr/IIncOperator.java
  5. 2
      jode/jode/expr/InvokeOperator.java.in
  6. 10
      jode/jode/expr/PrePostFixOperator.java
  7. 4
      jode/jode/expr/StoreInstruction.java
  8. 2
      jode/jode/flow/TransformConstructors.java

@ -1,3 +1,17 @@
2001-02-08 Jochen Hoenicke <jochen@gnu.org>
* jode/expr/StoreInstruction.java (dumpExpression): Java doesn't
allow parenthesis around left hand side, so use NO_PAREN and don't
call lhs.dumpExpression() with priority.
* jode/expr/PrePostFixOperator.java (dumpExpression): likewise.
* jode/expr/IIncOperator.java (dumpExpression): likewise.
* jode/flow/TransformConstructors.java (jikesAnonInner): Removed,
since it wasn't used: This information is stored in OuterValues
now.
* jode/decompiler/LocalInfo.java (isConstant): Always return true
so that inner classes that access final locals work, even if we
can't decide that the local can be final.
2001-02-05 Jochen Hoenicke <jochen@gnu.org> 2001-02-05 Jochen Hoenicke <jochen@gnu.org>
* jode/expr/InvokeOperator.java.in (Environment.invokeMethod): * jode/expr/InvokeOperator.java.in (Environment.invokeMethod):

@ -361,15 +361,13 @@ public class LocalInfo implements Declarable {
} }
public boolean isConstant() { public boolean isConstant() {
LocalInfo li = getLocalInfo(); /* Checking if a local can be declared final is tricky,
Enumeration enum = li.operators.elements(); * since it can also be the case if it is written in
int writes = 0; * the "then" and "else" part of an if statement.
while (enum.hasMoreElements()) { *
if (((LocalVarOperator) enum.nextElement()).isWrite()) * We return true now, otherwise some code would not be
writes++; * decompilable.
} */
if (writes > 1)
return false;
return true; return true;
} }

@ -124,7 +124,7 @@ public class TabbedPrintWriter {
* our child, if possible. * our child, if possible.
*/ */
BreakPoint child = (BreakPoint) childBPs.elementAt(0); BreakPoint child = (BreakPoint) childBPs.elementAt(0);
options = child.options; options = Math.min(options, child.options);
startPos = child.startPos; startPos = child.startPos;
endPos = child.endPos; endPos = child.endPos;
breakPenalty = child.breakPenalty; breakPenalty = child.breakPenalty;

@ -81,7 +81,9 @@ public class IIncOperator extends Operator
public void dumpExpression(TabbedPrintWriter writer) public void dumpExpression(TabbedPrintWriter writer)
throws java.io.IOException { throws java.io.IOException {
subExpressions[0].dumpExpression(writer, 950); writer.startOp(writer.NO_PAREN, 2);
subExpressions[0].dumpExpression(writer);
writer.endOp();
writer.print(getOperatorString() + value); writer.print(getOperatorString() + value);
} }
} }

@ -201,7 +201,7 @@ public final class InvokeOperator extends Operator
} }
/** /**
* Makes a non void expression out of this store instruction. * Makes a non void expression, in case this is a constructor.
*/ */
public void makeNonVoid() { public void makeNonVoid() {
if (type != Type.tVoid) if (type != Type.tVoid)

@ -52,13 +52,11 @@ public class PrePostFixOperator extends Operator {
public void dumpExpression(TabbedPrintWriter writer) public void dumpExpression(TabbedPrintWriter writer)
throws java.io.IOException { throws java.io.IOException {
boolean needBrace = false; if (!postfix)
int priority = 700;
if (!postfix) {
writer.print(getOperatorString()); writer.print(getOperatorString());
priority = 800; writer.startOp(writer.NO_PAREN, 2);
} subExpressions[0].dumpExpression(writer);
subExpressions[0].dumpExpression(writer, priority); writer.endOp();
if (postfix) if (postfix)
writer.print(getOperatorString()); writer.print(getOperatorString());
} }

@ -111,7 +111,9 @@ public class StoreInstruction extends Operator
public void dumpExpression(TabbedPrintWriter writer) public void dumpExpression(TabbedPrintWriter writer)
throws java.io.IOException throws java.io.IOException
{ {
subExpressions[0].dumpExpression(writer, 950); writer.startOp(writer.NO_PAREN, 2);
subExpressions[0].dumpExpression(writer);
writer.endOp();
writer.breakOp(); writer.breakOp();
writer.print(getOperatorString()); writer.print(getOperatorString());
subExpressions[1].dumpExpression(writer, 100); subExpressions[1].dumpExpression(writer, 100);

@ -99,8 +99,6 @@ public class TransformConstructors {
OuterValues outerValues; OuterValues outerValues;
boolean jikesAnonInner = false;
public TransformConstructors(ClassAnalyzer clazzAnalyzer, public TransformConstructors(ClassAnalyzer clazzAnalyzer,
boolean isStatic, MethodAnalyzer[] cons) { boolean isStatic, MethodAnalyzer[] cons) {
this.clazzAnalyzer = clazzAnalyzer; this.clazzAnalyzer = clazzAnalyzer;

Loading…
Cancel
Save