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 123831 - [Insert Code Add Property] PropertyVetoException added both with fqn and import
Summary: [Insert Code Add Property] PropertyVetoException added both with fqn and import
Status: RESOLVED WONTFIX
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 6.x
Hardware: PC Linux
: P4 blocker (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-12-11 16:14 UTC by Max Sauer
Modified: 2016-07-07 07:16 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 Max Sauer 2007-12-11 16:14:48 UTC
Unnecessary import/fqn added when creating bound vetoable property via 'Insert Code | Add Property'.

Steps to reproduce
------------------
1) Create an empty class
2) Invoke 'InsertCode|AddProperty' inside its body
3) Check 'Bound' and 'Vetoable
=>
import:
import java.beans.PropertyVetoException;
setter:
public void setString(String newstring) throws java.beans.PropertyVetoException

---
Product Version: NetBeans IDE Dev (Build 20071211082736)
Java: 1.5.0_14; Java HotSpot(TM) Client VM 1.5.0_14-b03
System: Linux version 2.6.20-16-generic running on i386; UTF-8; en_US (nb)
Userdir: /home/maxa/.netbeans/dev
Comment 1 _ rkusterer 2008-03-09 19:35:22 UTC
Also when adding properties using the code insertion shortcut, the new code is inserted where the cursor is. E.g. if the
cursor happens to be inside a code block (if-block or try-catch-block, etc), then the property and its accessor methods
are inserted right there, which results in uncompilable code (= a protected variable, and a getter and setter *inside*
another method). 

Also there is a newline right after the generated access modifier, is this on purpose? 

--------
Product Version: NetBeans IDE 6.1 Beta (Build 200803050202)
Java: 1.5.0_13; Java HotSpot(TM) Client VM 1.5.0_13-121
System: Mac OS X version 10.4.11 running on i386; MacRoman; de_DE (nb)
Comment 2 Rastislav Komara 2009-02-03 10:55:08 UTC
Overtake.
Comment 3 Jan Lahoda 2009-08-20 09:59:35 UTC
Reassigning all moonko's java/source bugs to myself.
Comment 4 Martin Balin 2016-07-07 07:16:30 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss