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.
I would like to propose a few changes to the java/source's API: -removal of CommentUtilities (altogether with getCommentUtilities in CompilationInfo). This class is currently empty and so not useful. Comment handling methods are currently in TreeUtilities and TreeMaker. -removal of methods TreeMaker.Variable(..., TypeElement) and TreeMaker.Method(..., TypeElement) - clients should use their counterparts without the TypeElement. -addition of TypeUtilities, similar to ElementUtilities and TreeUtilities, altogether with its getter in CompilationInfo. -addition of TypeUtilities.isCastable, which checks if a TypeMirror can be cast to another TypeMirror The proposed diff is attached. Any objections or comments? Thanks.
Created attachment 39328 [details] Proposed patch.
If there are not objections, I will apply the patch tomorrow.
TypeUtilities.isCastable and Types.isAssignable, how are they different?
isAssignable checks whether a type can be assigned to another, while isCastable checks whether a cast is allowed. For example: int i; long l; i = l; //error, isAssignable == false i = (int) l; //no error, isCastable == true I have realized that the proposed version of isCastable uses opposite order of arguments than isAssignable - I will flip the argument of isCastable before the commit. Sorry for this.
Implemented: Checking in java/source/apichanges.xml; /cvs/java/source/apichanges.xml,v <-- apichanges.xml new revision: 1.4; previous revision: 1.3 done Checking in java/source/nbproject/project.properties; /cvs/java/source/nbproject/project.properties,v <-- project.properties new revision: 1.12; previous revision: 1.11 done Removing java/source/src/org/netbeans/api/java/source/CommentUtilities.java; /cvs/java/source/src/org/netbeans/api/java/source/CommentUtilities.java,v <-- CommentUtilities.java new revision: delete; previous revision: 1.6 done Checking in java/source/src/org/netbeans/api/java/source/CompilationController.java; /cvs/java/source/src/org/netbeans/api/java/source/CompilationController.java,v <-- CompilationController.java new revision: 1.6; previous revision: 1.5 done Checking in java/source/src/org/netbeans/api/java/source/CompilationInfo.java; /cvs/java/source/src/org/netbeans/api/java/source/CompilationInfo.java,v <-- CompilationInfo.java new revision: 1.8; previous revision: 1.7 done Checking in java/source/src/org/netbeans/api/java/source/TreeMaker.java; /cvs/java/source/src/org/netbeans/api/java/source/TreeMaker.java,v <-- TreeMaker.java new revision: 1.15; previous revision: 1.14 done RCS file: /cvs/java/source/src/org/netbeans/api/java/source/TypeUtilities.java,v done Checking in java/source/src/org/netbeans/api/java/source/TypeUtilities.java; /cvs/java/source/src/org/netbeans/api/java/source/TypeUtilities.java,v <-- TypeUtilities.java initial revision: 1.1 done Checking in java/source/src/org/netbeans/modules/java/source/builder/TreeFactory.java; /cvs/java/source/src/org/netbeans/modules/java/source/builder/TreeFactory.java,v <-- TreeFactory.java new revision: 1.13; previous revision: 1.12 done Checking in java/source/src/org/netbeans/modules/java/source/engine/TreeMakerInt.java; /cvs/java/source/src/org/netbeans/modules/java/source/engine/TreeMakerInt.java,v <-- TreeMakerInt.java new revision: 1.8; previous revision: 1.7 done RCS file: /cvs/java/source/test/unit/src/org/netbeans/api/java/source/TypeUtilitiesTest.java,v done Checking in java/source/test/unit/src/org/netbeans/api/java/source/TypeUtilitiesTest.java; /cvs/java/source/test/unit/src/org/netbeans/api/java/source/TypeUtilitiesTest.java,v <-- TypeUtilitiesTest.java initial revision: 1.1 done Checking in junit/src/org/netbeans/modules/junit/JUnit3TestGenerator.java; /cvs/junit/src/org/netbeans/modules/junit/JUnit3TestGenerator.java,v <-- JUnit3TestGenerator.java new revision: 1.2; previous revision: 1.1 done