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 23727 - ClassElement.setModifiers() sets Interface keyword twice in source
Summary: ClassElement.setModifiers() sets Interface keyword twice in source
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 3.x
Hardware: PC Windows ME/2000
: P3 blocker (vote)
Assignee: Pavel Flaska
URL:
Keywords:
: 51673 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-05-18 02:45 UTC by Dana Kaufman
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 Dana Kaufman 2002-05-18 02:45:15 UTC
ClassElement.setModifiers() inserts multiple interface 
keywords if called with the Modifier.INTERFACE flag set on 
an interface file.  The correct behavior should be to 
ignore (as per newgroup response listed below):

Yes, mask the INTERFACE modifier out ;-) It's unsupported 
value in setModifiers() and I guess it should be ignored, 
rather than generated into the text (please file a bug). 
Use classElement.setClassOrInterface(false) to turn the 
ClassElement to an interface, or setClassOrInterface(true) 
to make a class from it.

-Svata

Dana Kaufman wrote:
> I have a class that is an interface.  Part of my code 
takes the ClassElement
> for this class and updates the modifiers using 
ClassElement.setModifiers().
> One of the modifiers in Modifier.INTERFACE.  After the 
modifiers are
> updated, my class now has two interface keywords:
> 
> Before:
> 
> public interface interface Interest1Home extends 
javax.ejb.EJBHome {
> 
> }
> 
> After:
> public interface interface Interest1Home extends 
javax.ejb.EJBHome {
> 
> }
>
Comment 1 Svata Dedic 2002-05-21 17:48:05 UTC
Cleaning up before 4.0 planning
Comment 2 Marek Grummich 2002-07-19 16:36:21 UTC
Target milestone was changed from not determined to TBD
Comment 3 Martin Matula 2004-11-12 10:06:47 UTC
This is still the case. IMO it is a bug. I guess the same is true for
enums and annotations on JDK 5.0.
Comment 4 Pavel Flaska 2004-11-15 10:21:46 UTC
Checking in
src/org/netbeans/modules/javacore/jmiimpl/javamodel/AnnotationTypeImpl.java;
/cvs/java/javacore/src/org/netbeans/modules/javacore/jmiimpl/javamodel/AnnotationTypeImpl.java,v
 <--  AnnotationTypeImpl.java
new revision: 1.7; previous revision: 1.6
done
Checking in
src/org/netbeans/modules/javacore/jmiimpl/javamodel/FeatureImpl.java;
/cvs/java/javacore/src/org/netbeans/modules/javacore/jmiimpl/javamodel/FeatureImpl.java,v
 <--  FeatureImpl.java
new revision: 1.27; previous revision: 1.26
done
Checking in
src/org/netbeans/modules/javacore/jmiimpl/javamodel/JavaClassImpl.java;
/cvs/java/javacore/src/org/netbeans/modules/javacore/jmiimpl/javamodel/JavaClassImpl.java,v
 <--  JavaClassImpl.java
new revision: 1.42; previous revision: 1.41
done
Comment 5 Pavel Flaska 2004-11-19 15:18:56 UTC
*** Issue 51673 has been marked as a duplicate of this issue. ***
Comment 6 Quality Engineering 2007-09-20 12:28:17 UTC
Reorganization of java component