ciera / crystalsaf

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

null pointer assignment #22

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Analyze the enclosed file taken from Apache Ftp Server application
2.CrystalSAF was installed on the latest version of Eclipse 3.6.1
3.Slelect Basic ConstantAnalysis and then RunAnalysis only for this file

What is the expected output? What do you see instead?
The file should be analyzed, instead an error message appears: "An internal 
error occurred during: "Crystal".
java.lang.NullPointerException"

The console contains more details: 
Sep 30, 2010 11:18:54 AM edu.cmu.cs.crystal.internal.CrystalPlugin 
setupCrystalAnalyses
INFO: CrystalPlugin::setupCrystalAnalyses() Begin
Sep 30, 2010 11:18:54 AM edu.cmu.cs.crystal.internal.CrystalPlugin 
setupCrystalAnalyses
INFO: CrystalPlugin::setupCrystalAnalyses() End
!SESSION 2010-09-30 11:18:05.312 -----------------------------------------------
eclipse.buildId=M20100909-0800
java.version=1.6.0_13
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Framework arguments:  -product org.eclipse.sdk.ide
Command-line arguments:  -product org.eclipse.sdk.ide -data 
L:\work\crystal_analyzer\workspace/../runtime-New_configuration -dev 
file:L:/work/crystal_analyzer/workspace/.metadata/.plugins/org.eclipse.pde.core/
New_configuration/dev.properties -os win32 -ws win32 -arch x86 -consoleLog

!ENTRY org.eclipse.core.jobs 4 2 2010-09-30 11:19:03.390
!MESSAGE An internal error occurred during: "Crystal".
!STACK 0
java.lang.NullPointerException
    at edu.cmu.cs.crystal.annotations.AnnotationDatabase.addAnnotationToMethod(AnnotationDatabase.java:567)
    at edu.cmu.cs.crystal.annotations.AnnotationFinder$AnnotationVisitor.visit(AnnotationFinder.java:171)
    at org.eclipse.jdt.core.dom.MethodDeclaration.accept0(MethodDeclaration.java:489)
    at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2480)
    at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2551)
    at org.eclipse.jdt.core.dom.TypeDeclaration.accept0(TypeDeclaration.java:484)
    at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2480)
    at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2551)
    at org.eclipse.jdt.core.dom.CompilationUnit.accept0(CompilationUnit.java:219)
    at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2480)
    at edu.cmu.cs.crystal.annotations.AnnotationFinder.analyzeCompilationUnit(AnnotationFinder.java:59)
    at edu.cmu.cs.crystal.AbstractCompilationUnitAnalysis.runAnalysis(AbstractCompilationUnitAnalysis.java:53)
    at edu.cmu.cs.crystal.internal.Crystal$2.runJobs(Crystal.java:312)
    at edu.cmu.cs.crystal.internal.Crystal.runCrystalJob(Crystal.java:135)
    at edu.cmu.cs.crystal.internal.Crystal.runAnalyses(Crystal.java:127)
    at edu.cmu.cs.crystal.internal.CrystalFileAction$1.run(CrystalFileAction.java:101)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

What version of the product are you using? On what operating system?
I am using the latest version downloaded using Eclipse  -> Install New Software 
option installed on September 29, 2010

Please provide any additional information below.
It looks like in the AnnotationDatabase file on line 566 the statement  
method.resolveBinding() returns null when the following method is analyzed: 
    /**
     * Get all listeners available on servers created by this factory
     * 
     * @return The current listeners
     */
    public Map<String, Listener> getListeners() {
        return serverContext.getListeners();
    }

Regards,

Radu

Original issue reported on code.google.com by vanciur...@gmail.com on 30 Sep 2010 at 3:29

Attachments:

GoogleCodeExporter commented 9 years ago
A small clarification: I used Crystal versions 3.4.1 and 3.4.2, with Eclipse 
3.5.2 and 3.6.1, the same error occur.

I hope this help,

I am looking forward to hear from you,

Regards,

Radu

Original comment by vanciur...@gmail.com on 30 Sep 2010 at 4:54

GoogleCodeExporter commented 9 years ago
Radu,

The AnnotationFinder was recently removed actually, since it was buggy, slow, 
and not really being used. We will be pushing out a more stable version of 
Crystal in the next couple of weeks. If you would like to access the new 
version now, you can get it from the source repository.

~Ciera

Original comment by ciera.christopher on 12 Nov 2010 at 7:55

GoogleCodeExporter commented 9 years ago
Thanks for reporting the issue. I tried to run the latest version of Crystal to 
make sure it fixed your issue, but I could not since I couldn't build your 
example file. Perhaps you could give it a try, using the latest source version 
of Crystal, and make sure it works? Or instead, perhaps you could post a link 
to a jar file that would enable us to build your example? 
Thanks. 
PS - I'm going to call this Fixed rather than WONTFIX.

Original comment by nels.bec...@gmail.com on 12 Nov 2010 at 8:29