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>
* jode/expr/InvokeOperator.java.in (Environment.invokeMethod):

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

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

@ -81,7 +81,9 @@ public class IIncOperator extends Operator
public void dumpExpression(TabbedPrintWriter writer)
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);
}
}

@ -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() {
if (type != Type.tVoid)

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

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

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

Loading…
Cancel
Save