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 97542 - Small java/source's API adjustments
Summary: Small java/source's API adjustments
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Jan Lahoda
URL:
Keywords: API, API_REVIEW_FAST
Depends on:
Blocks: 94330
  Show dependency tree
 
Reported: 2007-03-09 08:26 UTC by Jan Lahoda
Modified: 2007-03-18 10:05 UTC (History)
1 user (show)

See Also:
Issue Type: TASK
Exception Reporter:


Attachments
Proposed patch. (23.99 KB, text/plain)
2007-03-09 08:27 UTC, Jan Lahoda
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Lahoda 2007-03-09 08:26:08 UTC
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.
Comment 1 Jan Lahoda 2007-03-09 08:27:38 UTC
Created attachment 39328 [details]
Proposed patch.
Comment 2 Jan Lahoda 2007-03-16 09:02:09 UTC
If there are not objections, I will apply the patch tomorrow.
Comment 3 Jan Pokorsky 2007-03-16 12:57:53 UTC
TypeUtilities.isCastable and Types.isAssignable, how are they different?
Comment 4 Jan Lahoda 2007-03-16 13:53:35 UTC
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.
Comment 5 Jan Lahoda 2007-03-18 10:05:41 UTC
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