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 7495 - Adding duplicate inner class or interface doesn't throw SourceException.
Summary: Adding duplicate inner class or interface doesn't throw SourceException.
Status: CLOSED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 3.x
Hardware: PC Windows ME/2000
: P2 normal (vote)
Assignee: issues@java
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2000-08-25 15:02 UTC by Antanas Radzius
Modified: 2007-09-26 09:14 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 Antanas Radzius 2000-08-25 15:02:32 UTC
Adding duplicate inner class or interface doesn't throw SourceException.
Source code:

ClassElement innerClass = new ClassElement();
if (contition1)
{
	innerClass.setClassOrInterface(true);
}
else if (condition2)
{
	innerClass.setClassOrInterface(false);
}
// get simple class name(not fully qualified)
String className = getNewClassName();

Identifier name = Identifier.create(className);
innerClass.setName(name);
innerClass.setModifiers(Modifier.PUBLIC);

classElement.addClass(innerClass);
Comment 1 Svata Dedic 2000-08-25 15:24:59 UTC
The error occurs if a class with some FQN != simple name is being added twice;
the bounding ClassElement incorrectly tries to find a class using its FQN
instead of using either simple name or FQN constructed to match the target of
the addition.
Comment 2 Svata Dedic 2000-08-25 15:50:59 UTC
[dev-22] ClassElement.addClass() and addClasses() now checks for existence of
innerclasses using SimpleNames, not FQNs.
Comment 3 Jan Becicka 2000-10-11 09:14:59 UTC
[1120] Verified
Comment 4 Quality Engineering 2003-07-01 13:18:30 UTC
Resolved for 3.4.x or earlier, no new info since then -> closing.