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);
} else if (type == Type.tLong) {
return (value instanceof Long
&& ((Integer)value).longValue() == 1L);
&& ((Long)value).longValue() == 1L);
} else if (type == Type.tFloat) {
return (value instanceof Float
&& ((Integer)value).floatValue() == 1.0f);
&& ((Float)value).floatValue() == 1.0f);
} else if (type == Type.tDouble) {
return (value instanceof Double
&& ((Integer)value).doubleValue() == 1.0);
&& ((Double)value).doubleValue() == 1.0);
}
return false;
}

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

@ -8,7 +8,7 @@ JAVADEP = $(top_builddir)/javaDependencies.pl -subdir=$(subdir)\
CLASSPATH = @CLASSPATH@
CLASSLIB = @CLASSLIB@
SUBSTCP = @SUBSTCP@
BUILD_CLASSPATH = $(top_srcdir):$(top_builddir):$(CLASSPATH):$(CLASSLIB)
FULL_CLASSPATH := $(shell $(SUBSTCP) $(top_srcdir):$(top_builddir):$(CLASSPATH):$(CLASSLIB))
MY_JAVA_FILES = \
ArrayLengthOperator.java \
@ -61,7 +61,7 @@ EXTRA_DIST = $(MY_JAVA_FILES)
@QUOTE@-include Makefile.dep
%.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)
$(JAVADEP) $^

Loading…
Cancel
Save