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 196877 - NPE during inserting getters and setters using Alt+Insert
Summary: NPE during inserting getters and setters using Alt+Insert
Status: RESOLVED DUPLICATE of bug 193826
Alias: None
Product: java
Classification: Unclassified
Component: Editor (show other bugs)
Version: 7.0
Hardware: All All
: P3 normal (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-19 18:22 UTC by serggt1
Modified: 2011-04-05 14:28 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description serggt1 2011-03-19 18:22:16 UTC
Product Version = NetBeans Platform Dev (Build 201103080000)
Operating System = Linux version 2.6.35-28-generic running on i386
Java; VM; Vendor = 1.6.0_24
Runtime = Java HotSpot(TM) Client VM 19.1-b02

I was inserting getters and setters using Alt+Insert for following class and got NPE.

java.lang.NullPointerException
	at org.netbeans.modules.java.editor.codegen.GetterSetterGenerator$1.run(GetterSetterGenerator.java:218)
	at org.netbeans.modules.java.editor.codegen.GetterSetterGenerator$1.run(GetterSetterGenerator.java:213)
	at org.netbeans.api.java.source.JavaSource$1.run(JavaSource.java:666)
	at org.netbeans.api.java.source.JavaSource$1.run(JavaSource.java:656)
	at org.netbeans.api.java.source.JavaSource$MultiTask.run(JavaSource.java:482)
	at org.netbeans.modules.parsing.api.ParserManager$UserTaskAction.run(ParserManager.java:154)
	at org.netbeans.modules.parsing.api.ParserManager$UserTaskAction.run(ParserManager.java:138)
	at org.netbeans.modules.parsing.impl.TaskProcessor$1.call(TaskProcessor.java:201)
	at org.netbeans.modules.parsing.impl.TaskProcessor$1.call(TaskProcessor.java:198)
	at org.netbeans.modules.masterfs.filebasedfs.utils.FileChangedManager.priorityIO(FileChangedManager.java:168)
	at org.netbeans.modules.masterfs.providers.ProvidedExtensions.priorityIO(ProvidedExtensions.java:356)
	at org.netbeans.modules.parsing.impl.Utilities.runPriorityIO(Utilities.java:66)
	at org.netbeans.modules.parsing.impl.TaskProcessor.runUserTask(TaskProcessor.java:198)
	at org.netbeans.modules.parsing.api.ParserManager.parse(ParserManager.java:106)
	at org.netbeans.api.java.source.JavaSource.runUserActionTaskImpl(JavaSource.java:432)
	at org.netbeans.api.java.source.JavaSource.runUserActionTask(JavaSource.java:403)
	at org.netbeans.api.java.source.JavaSource.runModificationTask(JavaSource.java:678)
	at org.netbeans.modules.java.editor.codegen.GetterSetterGenerator.invoke(GetterSetterGenerator.java:213)
	at org.netbeans.modules.editor.codegen.GenerateCodePanel.invokeSelected(GenerateCodePanel.java:171)
	at org.netbeans.modules.editor.codegen.GenerateCodePanel.listKeyReleased(GenerateCodePanel.java:140)
	at org.netbeans.modules.editor.codegen.GenerateCodePanel.access$100(GenerateCodePanel.java:66)
	at org.netbeans.modules.editor.codegen.GenerateCodePanel$3.keyReleased(GenerateCodePanel.java:115)
	at java.awt.AWTEventMulticaster.keyReleased(AWTEventMulticaster.java:243)
	at java.awt.Component.processKeyEvent(Component.java:6250)
	at javax.swing.JComponent.processKeyEvent(JComponent.java:2801)
	at java.awt.Component.processEvent(Component.java:6066)
	at java.awt.Container.processEvent(Container.java:2041)
	at java.awt.Component.dispatchEventImpl(Component.java:4652)
	at java.awt.Container.dispatchEventImpl(Container.java:2099)
	at java.awt.Component.dispatchEvent(Component.java:4482)
	at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1850)
	at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:712)
	at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:990)
	at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:855)
	at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:676)
	at java.awt.Component.dispatchEventImpl(Component.java:4524)
	at java.awt.Container.dispatchEventImpl(Container.java:2099)
	at java.awt.Window.dispatchEventImpl(Window.java:2478)
	at java.awt.Component.dispatchEvent(Component.java:4482)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:644)
	at java.awt.EventQueue.access$000(EventQueue.java:85)
	at java.awt.EventQueue$1.run(EventQueue.java:603)
	at java.awt.EventQueue$1.run(EventQueue.java:601)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
	at java.awt.EventQueue$2.run(EventQueue.java:617)
	at java.awt.EventQueue$2.run(EventQueue.java:615)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:614)
	at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:148)
[catch] at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)


package su.vistar.gps.persistence.entities.position;

import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Запись GPS-данных одной точки.
 * 
 * @author Sergey Ponomarev (sergey.ponomarev@vistar.su)
 */
@Embeddable
public class GPSRecord {
    
    @Basic(optional = false)
    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "theDateTime")
    private Date timestamp;
    @Basic(optional = false)
    @Column(name = "latitude")
    private double latitude;
    @Basic(optional = false)
    @Column(name = "longitude")
    private double longitude;
    @Basic(optional = false)
    @Column(name = "azimuth")
    private int azimuth;
    @Basic(optional = false)
    @Column(name = "speed")
    private int speed;

    public GPSRecord() {
    }

    public GPSRecord(Date timestamp, double latitude, double longitude, int azimuth, int speed) {
        this.timestamp = timestamp;
        this.latitude = latitude;
        this.longitude = longitude;
        this.azimuth = azimuth;
        this.speed = speed;
    }
    
    
}
Comment 1 Marian Mirilovic 2011-03-21 09:28:51 UTC
I tried in NB 7.0 RC 1 (20110320) and it works ...
Comment 2 serggt1 2011-03-21 09:33:33 UTC
It works in 99% cases but sometimes fails. Not sure it is important, just added this bugreport to point a possible problem.
Comment 3 Dusan Balek 2011-04-05 14:28:57 UTC

*** This bug has been marked as a duplicate of bug 193826 ***