ConstOperator.isOne was wrong

InvokeOperator: Don't show Warnings for interpreter failed
Makefile optimized


git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@1218 379699f6-c40d-0410-875b-85095c16579e
branch_1_1
jochen 25 years ago
parent 9ce95e120a
commit d79c1f7b8b
  1. 6
      jode/jode/expr/ConstOperator.java
  2. 18
      jode/jode/expr/InvokeOperator.java.in
  3. 4
      jode/jode/expr/Makefile.am

@ -85,13 +85,13 @@ public class ConstOperator extends NoArgOperator {
&& ((Integer)value).intValue() == 1); && ((Integer)value).intValue() == 1);
} else if (type == Type.tLong) { } else if (type == Type.tLong) {
return (value instanceof Long return (value instanceof Long
&& ((Integer)value).longValue() == 1L); && ((Long)value).longValue() == 1L);
} else if (type == Type.tFloat) { } else if (type == Type.tFloat) {
return (value instanceof Float return (value instanceof Float
&& ((Integer)value).floatValue() == 1.0f); && ((Float)value).floatValue() == 1.0f);
} else if (type == Type.tDouble) { } else if (type == Type.tDouble) {
return (value instanceof Double return (value instanceof Double
&& ((Integer)value).doubleValue() == 1.0); && ((Double)value).doubleValue() == 1.0);
} }
return false; return false;
} }

@ -447,14 +447,20 @@ public final class InvokeOperator extends Operator
result = (String) interpreter.interpretMethod result = (String) interpreter.interpretMethod
(ma.getBytecodeInfo(), null, new Object[] { op.getValue() }); (ma.getBytecodeInfo(), null, new Object[] { op.getValue() });
} catch (InterpreterException ex) { } catch (InterpreterException ex) {
GlobalOptions.err.println("Warning: Can't interpret method " if ((GlobalOptions.debuggingFlags &
+methodName); GlobalOptions.DEBUG_INTERPRT) != 0) {
ex.printStackTrace(GlobalOptions.err); GlobalOptions.err.println("Warning: Can't interpret method "
+methodName);
ex.printStackTrace(GlobalOptions.err);
}
return null; return null;
} catch (InvocationTargetException ex) { } catch (InvocationTargetException ex) {
GlobalOptions.err.println("Warning: Interpreted method throws" if ((GlobalOptions.debuggingFlags &
+" an uncaught exception: "); GlobalOptions.DEBUG_INTERPRT) != 0) {
ex.getTargetException().printStackTrace(GlobalOptions.err); GlobalOptions.err.println("Warning: Interpreted method throws"
+" an uncaught exception: ");
ex.getTargetException().printStackTrace(GlobalOptions.err);
}
return null; return null;
} }
return new ConstOperator(result); return new ConstOperator(result);

@ -8,7 +8,7 @@ JAVADEP = $(top_builddir)/javaDependencies.pl -subdir=$(subdir)\
CLASSPATH = @CLASSPATH@ CLASSPATH = @CLASSPATH@
CLASSLIB = @CLASSLIB@ CLASSLIB = @CLASSLIB@
SUBSTCP = @SUBSTCP@ SUBSTCP = @SUBSTCP@
BUILD_CLASSPATH = $(top_srcdir):$(top_builddir):$(CLASSPATH):$(CLASSLIB) FULL_CLASSPATH := $(shell $(SUBSTCP) $(top_srcdir):$(top_builddir):$(CLASSPATH):$(CLASSLIB))
MY_JAVA_FILES = \ MY_JAVA_FILES = \
ArrayLengthOperator.java \ ArrayLengthOperator.java \
@ -61,7 +61,7 @@ EXTRA_DIST = $(MY_JAVA_FILES)
@QUOTE@-include Makefile.dep @QUOTE@-include Makefile.dep
%.class: %.java %.class: %.java
$(JAVAC) -classpath `$(SUBSTCP) $(BUILD_CLASSPATH):$(CLASSLIB)` -d $(top_builddir) $< $(JAVAC) -classpath $(FULL_CLASSPATH) -d $(top_builddir) $<
Makefile.dep: $(MY_JAVA_FILES:.java=.class) Makefile.dep: $(MY_JAVA_FILES:.java=.class)
$(JAVADEP) $^ $(JAVADEP) $^

Loading…
Cancel
Save