This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 60444 - Editor looks and does not provide extension , refactoring
Summary: Editor looks and does not provide extension , refactoring
Status: RESOLVED DUPLICATE of bug 59033
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 4.x
Hardware: PC Linux
: P3 blocker (vote)
Assignee: issues@java
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-23 15:22 UTC by cz
Modified: 2007-09-26 09:14 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
The java file causing the problem (7.26 KB, text/plain)
2005-06-23 15:23 UTC, cz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description cz 2005-06-23 15:22:29 UTC
Hello, 

I run into an issue when editing a java file. The error info :


------------------------------
Annotation: Exception occurred in Request Processor
java.lang.NullPointerException
	at
org.netbeans.modules.javacore.parser.ClassFileInfoUtil.getJavadocFile(ClassFileInfoUtil.java:705)
	at
org.netbeans.modules.javacore.parser.ClassFileInfoUtil.getHtmlReader(ClassFileInfoUtil.java:633)
	at
org.netbeans.modules.javacore.parser.ClassFileInfoUtil.createParamsInfo(ClassFileInfoUtil.java:582)
	at
org.netbeans.modules.javacore.parser.ClassFileInfoUtil.createMethodInfo(ClassFileInfoUtil.java:213)
	at
org.netbeans.modules.javacore.parser.ClassFileInfoUtil.createClassInfo(ClassFileInfoUtil.java:153)
	at
org.netbeans.modules.javacore.parser.ClassFileInfoUtil.createClassInfo(ClassFileInfoUtil.java:66)
	at
org.netbeans.modules.javacore.jmiimpl.javamodel.ResourceImpl.getResInfoFromClassFile(ResourceImpl.java:413)
	at
org.netbeans.modules.javacore.jmiimpl.javamodel.ResourceImpl.directClassFileUpdate(ResourceImpl.java:670)
	at
org.netbeans.modules.javacore.jmiimpl.javamodel.ResourceImpl.checkUpToDate(ResourceImpl.java:644)
	at
org.netbeans.modules.javacore.jmiimpl.javamodel.ResourceImpl.checkUpToDate(ResourceImpl.java:582)
	at
org.netbeans.modules.javacore.jmiimpl.javamodel.SemiPersistentElement.checkUpToDate(SemiPersistentElement.java:263)
	at
org.netbeans.modules.javacore.jmiimpl.javamodel.SemiPersistentElement.checkUpToDate(SemiPersistentElement.java:267)
	at
org.netbeans.modules.javacore.jmiimpl.javamodel.JavaClassImpl.getSuperClass(JavaClassImpl.java:321)
	at org.netbeans.jmi.javamodel.JavaClass$Impl.getSuperClass(Unknown Source)
	at
org.netbeans.modules.javacore.parser.MDRParser.getSuperClass(MDRParser.java:1453)
	at
org.netbeans.modules.javacore.parser.Scope.constructMemberTypeScope(Scope.java:130)
	at org.netbeans.modules.javacore.parser.Scope.createMemberTypeScope(Scope.java:118)
	at
org.netbeans.modules.javacore.parser.Scope.constructMemberTypeScope(Scope.java:135)
	at org.netbeans.modules.javacore.parser.Scope.createMemberTypeScope(Scope.java:118)
	at org.netbeans.modules.javacore.parser.MDRParser.processAST(MDRParser.java:474)
	at org.netbeans.modules.javacore.parser.MDRParser.processAST(MDRParser.java:364)
	at org.netbeans.modules.javacore.parser.MDRParser.processAST(MDRParser.java:326)
	at org.netbeans.modules.javacore.parser.MDRParser.processAST(MDRParser.java:304)
	at org.netbeans.modules.javacore.parser.MDRParser.enterMembers(MDRParser.java:234)
	at
org.netbeans.modules.javacore.jmiimpl.javamodel.ResourceImpl.directUpdate(ResourceImpl.java:732)
	at
org.netbeans.modules.javacore.jmiimpl.javamodel.ResourceImpl.checkUpToDate(ResourceImpl.java:640)
	at
org.netbeans.modules.javacore.jmiimpl.javamodel.ResourceImpl.checkUpToDate(ResourceImpl.java:582)
	at
org.netbeans.modules.javacore.jmiimpl.javamodel.ResourceImpl.initResource(ResourceImpl.java:422)
	at
org.netbeans.modules.javacore.jmiimpl.javamodel.MetadataElement.initCheck(MetadataElement.java:133)
	at
org.netbeans.modules.javacore.jmiimpl.javamodel.SemiPersistentElement.getElementInfo(SemiPersistentElement.java:185)
	at
org.netbeans.modules.javacore.jmiimpl.javamodel.SemiPersistentElement.getInternalForm(SemiPersistentElement.java:827)
	at
org.netbeans.modules.javacore.jmiimpl.javamodel.MetadataElement.getASTree(MetadataElement.java:451)
	at
org.netbeans.modules.javacore.jmiimpl.javamodel.SemiPersistentElement.getParser(SemiPersistentElement.java:822)
	at
org.netbeans.modules.javacore.jmiimpl.javamodel.ResourceImpl$ErrorList.initCheck(ResourceImpl.java:1421)
	at
org.netbeans.modules.javacore.jmiimpl.javamodel.ResourceImpl$ErrorList.size(ResourceImpl.java:1440)
	at org.netbeans.modules.java.JavaEditor.refreshAnnotations(JavaEditor.java:389)
	at org.netbeans.modules.java.JavaEditor.access$300(JavaEditor.java:83)
	at org.netbeans.modules.java.JavaEditor$2.run(JavaEditor.java:248)
	at org.openide.util.Task.run(Task.java:189)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:330)
[catch] at
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:721)


-------------------

The current file contents 


----------------------
package org.atlantec.adapter.alma;

import java.io.*;
import java.util.*;
import gnu.getopt.*;
import org.apache.log4j.*;
import org.atlantec.adapter.*;
import org.atlantec.adapter.alma.agi.AgiStatus;
import org.atlantec.adapter.mbean.*;
import org.atlantec.binding.POID;
import org.atlantec.directory.*;
import org.atlantec.directory.event.*;
import org.atlantec.directory.schema.*;
import org.atlantec.process.Job;
import org.atlantec.process.jmx.*;


/**
 * This is the place where AlmaAdapterInstances are created to fullfill their job.
 * The getProcessState method does caching of process states using
 *
 */
public class AlmaAdapterDriver extends AdapterDriver implements
AlmaAdapterDriverMBean, Publisher {

    private static final Logger log = Logger.getLogger( AlmaAdapterDriver.class );

    /** The minimal timeout for a process state request if no agi file exists */
    private static final long MIN_TIMEOUT = 1000 * 5;

    protected static long nextProcessId = 1;

    AlmaAdapterDriverCmdOptions aco = null;

    /** a map containing NestingTask POIDs / State pairs */
    private final Map nt2state = new HashMap();

    /** a map containing NestingTask POIDs / Long pairs representing the
     *  timestamp off an agi file
     */
    private final Map nt2timestamp = new HashMap();

    /** Creates a new instance of AlmaAdapterDriver */
    public AlmaAdapterDriver( String[] args ) {
        super( new AlmaAdapterConfiguration(),
AlmaAdapterDriverCmdOptions.class, args );
        this.aco = ( AlmaAdapterDriverCmdOptions ) super.aco;

        // register the publisher
        if ( aco.getOptionPublish() ) {
            System.setProperty( "org.atlantec.directory.publisher.interval", ""
+ Long.MAX_VALUE );
            getEnvProject().getInfoDir().publish( this );
        }

        // if running in test mode, do not allow more jobs to be submitted and
stop adapter when done.
        if ( aco.getOptionTest() ) {
            stop( 10000 );
        }

    }

    /**
     *   run the adapter driver. The given argument is the name nesting description.
     */
    public static void main( String[] args ) throws Exception {
        BasicConfigurator.resetConfiguration();
        BasicConfigurator.configure();

        AlmaAdapterDriver driver = null;
        try {
            driver = new AlmaAdapterDriver( args );
        } catch ( Exception ex ) {
            log.error( "adapter stopped due to error", ex );
            if ( driver != null ) {
                driver.shutdown();
            }

            if ( log.isDebugEnabled() ) {
                ex.printStackTrace();
            }

            AlmaAdapterDriverCmdOptions.usage( "" );
        }

        return;
    }

    /** @jmx:managed-attribute description="adapter mode" */
    public String getMode() {
        return AdapterAccessPoint.SUBSCRIBER;
    }

    public void poll( InformationDirectory infodir, Project project ) throws
IOException,
        DirectoryException {}

    /**
     * instantiates a new AlmaStateAdapter and return status
     * @jmx:managed-attribute description="process state"
     *
     */
    public State getProcessState( POID nestingTaskPOID ) {

        // check for a cached version
        State retval = null;
        if ( nt2state.containsKey( nestingTaskPOID ) ) {
            retval = ( State ) nt2state.get( nestingTaskPOID );

            Long lts = ( Long ) nt2timestamp.get( nestingTaskPOID );
            if ( lts == null ) {
                lts = new Long( 0 );
            }

            //look for the agi file and timestamp off last request
            String agiFile = ( String ) retval.getValue( AgiStatus.AGIFILENAME );
            if ( agiFile != null ) {

                File f = new File( agiFile );

                if ( f.exists() ) {
                    Long cts = new Long( f.lastModified() );
                    if ( cts.longValue() != lts.longValue() ) {
                        log.info( "timestamp of agi file " + f.getAbsolutePath() +
                            " changed since last check, request new state
retrival" );
                        retval = null;
                    } else {
                        log.info( "use cached state" );
                    }
                } else {
                    log.info(
                        "agi file was deleted since last check, request new
state retrieval" );
                    retval = null;
                }
            } else if ( ( System.currentTimeMillis() - lts.longValue() ) >
MIN_TIMEOUT ) {
                log.info( "no new state retrival within timeout" );
            } else {
                log.info( "request new state retrieval" );
                retval = null;
            }
        }

        if ( retval == null ) {

            AlmaAdapter adapterProcessor = new AlmaAdapter( this,
nestingTaskPOID, null, null );

            return adapterProcessor.getProcessState();
        }

        return retval;

    }

    /** implement abstract submit with specific parameter signature */
    public String submit( ProcessingRequest request ) {
        if ( !( request instanceof NestingRequest ) ) {
            throw new IllegalArgumentException( "invalid type of
ProcessingRequest submitted." );
        }

        return submit( ( NestingRequest ) request );
    }

    /** implement abstract submit with specific parameter signature */
    public String submit( NestingRequest request ) {
        NestingJob nestJob = new NestingJob( request );
        enqueue( nestJob );

        return nestJob.getId();
    }

    /** @jmx:managed-attribute description="the target" */
    public String getTarget() {
        try {
            return ( new File( ( ( AlmaAdapterConfiguration ) config
).getAlmaDataDir() )
                    .getCanonicalPath() );
        } catch ( IOException ioex ) {
            return "(error determining target dir)";
        }
    }

    /** execute a single job */
    protected void execute( Job job ) {
        if ( !( job instanceof NestingJob ) ) {
            throw new AdapterException( "request to execute a job which is no
Nesting Job: " + job );
        }

        NestingJob nestJob = ( NestingJob ) job;
        log.info( "executing job " + nestJob.getId() );

        // create and register a processor management object
        Processor processor = new Processor( AdapterControl.getJMXAgent(),
                AlmaAdapter.class.getName() + "-" + nextProcessId++ );

        // register the processor in the job
        nestJob.setProcessor( processor );

        log.info( "context " + nestJob.getProductContextPOID() );

        AlmaAdapter adapterProcessor = new AlmaAdapter( this,
nestJob.getNestingTaskPOID(),
                nestJob.getProductContextPOID(), processor );
        adapterProcessor.execute( nestJob.getEndTask(), nestJob.doPublish() );
        log.info( "finished executing job " + nestJob.getId() + "\n" );
    }

    /** overlays the generic method to stop the publisher
     */
    protected void shutdownServersAndConnections() {
        if ( aco.getOptionPublish() ) {
            getEnvProject().getInfoDir().unpublish( this );
        }

        super.shutdownServersAndConnections();
    }

} // AlmaAdapterDriver //
-----------------------------------------
Comment 1 cz 2005-06-23 15:23:27 UTC
Created attachment 22874 [details]
The java file causing the problem
Comment 2 Jan Lahoda 2005-06-24 12:21:18 UTC
Thanks for the report. Seems like duplicate of issue #59033 to me. Please reopen
if you disagree.


*** This issue has been marked as a duplicate of 59033 ***
Comment 3 Quality Engineering 2007-09-20 11:57:12 UTC
Reorganization of java component