roterdam / crystalsaf

Automatically exported from code.google.com/p/crystalsaf
0 stars 0 forks source link

run crystal on .class files with source available #26

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
This task is to enable Crystal to run on .class files with source attachments.  
For such files it turns out Eclipse can build an AST just as for .java source 
files.

There are always a lot of .class files in the workspace because of the JDK and 
Crystal probably shouldn't run on all of them by default.  The way I  suggest 
doing it is that "Run Crystal" from the menu (or now Shift+F6 ) only includes 
.java files (as it does now).  But if you select projects, packages in 
libraries, individual .class files, maybe even libraries themselves (not sure 
if possible) in the package explorer and choose Run Crystal from the context 
menu then it would include any .class files in the selected items.

The challenge with this task is that a lot of basic Crystal interfaces should 
change to take ITypeRoots instead of ICompilationUnits.  Thoughts are welcome 
on how to do that without creating too many problems for existing analyses.  In 
particular, ICrystalAnalysis.runAnalysis would ideally change, but that would 
break any analysis that implements this interface directly.

Original issue reported on code.google.com by kevin.bi...@gmail.com on 8 Jan 2011 at 2:50

GoogleCodeExporter commented 9 years ago
I don't actually ever use any of this UI, so I don't have strong feelings about 
it. But I think other people like Ciera commonly invoke Crystal on a project, 
and I'm not sure that the extra overhead of running it on all of the class 
files it links to is a good idea. Maybe we just add a global flag option to the 
Crystal menu to run Crystal on class files? I'm not sure that people will 
frequently go back and forth, so one global option you set and forget might be 
easiest. And it makes it pretty obvious what Crystal is doing.

Original comment by lat...@gmail.com on 8 Jan 2011 at 6:36

GoogleCodeExporter commented 9 years ago
I invoke on an entire project rather frequently. The problem is that including 
class files would make my analysis take an excessively long time. I am fine 
with a global option though.

Original comment by ciera.christopher on 17 Jan 2011 at 5:06

GoogleCodeExporter commented 9 years ago
Also, to answer Kevin's other question, I only implement 
AbstractCrystalMethodAnalysis.

Original comment by ciera.christopher on 17 Jan 2011 at 5:12

GoogleCodeExporter commented 9 years ago
I like the flag idea.  Hopefully I'll have some time soon to implement this.  
I'll try to upload a review as a fair amount of files have to change.

Original comment by kevin.bi...@gmail.com on 25 Jan 2011 at 4:02

GoogleCodeExporter commented 9 years ago
Fixed in r329, see code review in issue #27 for details.

Original comment by kevin.bi...@gmail.com on 15 May 2011 at 4:46