codespecs / daikon

Dynamic detection of likely invariants
http://plse.cs.washington.edu/daikon/
Other
214 stars 54 forks source link

instrumentation of runtime checks creates a body for abstract classes #18

Closed mernst closed 9 years ago

mernst commented 9 years ago

Originally reported on Google Code with ID 18

What steps will reproduce the problem?
1. javac -d bin -g src/com/example/AnAbstractClass.java 
2. java -cp daikon.jar:bin daikon.Chicory --daikon com.example.AnAbstractClass
3. java -cp daikon.jar:bin daikon.tools.runtimechecker.Main  instrument AnAbstractClass.inv.gz
src/com/example/AnAbstractClass.java 
4. javac -cp bin:daikon.jar instrumented-classes/com/example/AnAbstractClass.java 

What is the expected output? 
A compiled class file named bin/com/example/AnAbstractClass.class 

What do you see instead?
instrumented-classes/com/example/AnAbstractClass.java:5: error: illegal combination
of modifiers: abstract and private
   private abstract boolean internal$anAbstractMethod();
                            ^
instrumented-classes/com/example/AnAbstractClass.java:20: error: abstract methods cannot
have a body
   public abstract boolean anAbstractMethod()
                           ^

What version of the product are you using? 
Nov 27 revision (27b35b7e3299)

On what operating system?
Darwin dhcp-139.st.cs.uni-saarland.de 11.4.2 Darwin Kernel Version 11.4.2: Thu Aug
23 16:25:48 PDT 2012; root:xnu-1699.32.7~1/RELEASE_X86_64 x86_64

Please provide any additional information below.
While visiting a MethodDeclaration, instrumentation should skip instrumenting the method
if the method is abstract. In order to do so add a check and a return at 
daikon.tools.runtimechecker.InstrumentVisitor.visit(MethodDeclaration)

Reported by jgaleotti on 2013-12-04 10:20:42


mernst commented 9 years ago
runtimechecker should not instrument abstract classes

Modified:
  /java/daikon/tools/runtimechecker/InstrumentVisitor.java

Reported by markro@cs.washington.edu on 2015-04-01 18:40:17