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.
Summary: | Use 1.5 lang features in openide/util internally | ||
---|---|---|---|
Product: | platform | Reporter: | Jaroslav Tulach <jtulach> |
Component: | -- Other -- | Assignee: | apireviews <apireviews> |
Status: | RESOLVED DUPLICATE | ||
Severity: | blocker | CC: | jglick, jtulach |
Priority: | P1 | Keywords: | API_REVIEW_FAST |
Version: | 6.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | TASK | Exception Reporter: | |
Bug Depends on: | |||
Bug Blocks: | 67888 | ||
Attachments: |
The patch to allow javac.source=1.5 without a bunch of warnings
Fix for everything even APIs except Lookup Same as previous, just better type for topologicalSort |
Description
Jaroslav Tulach
2006-03-14 12:09:12 UTC
Sounds good. For tracking purposes, from 67888, API-visible generics changes possible in openide/util: WeakSet, Enumerations, Utilities.topologicalSort, Utilities.activeReferenceQueue, Mutex.{,Exception}Action and methods which use them, NbBundle.getLocalizedValue, Queue, SharedClassObject.findObject, WeakListeners.create, SystemAction.get. Others: use varargs for NbBundle.getMessage(Class,String,Object...) and Lookups.fixed(Object...). Created attachment 29248 [details]
The patch to allow javac.source=1.5 without a bunch of warnings
I'd like to apply the UsageOf15InUtilities.diff first and then move to other fixes in the API of openide/util BTW diff -u is a lot easier to read for this kind of patch. Value types of IconManager.{map,localizedMap} could use union type. @SuppressWarnings should not be needed on IconManager.ActiveRef if we fix Utilities.activeReferenceQueue. Enumerations.empty() could read return Collections.enumeration(Collections.<T>emptyList()); More to come... Why is WeakSet.Entry not <E>? IMHO all of WeakSet.java should compile without warnings, no? TimedSoftReference can be fully generified - it is not public. NbBundle.propsToStringMap could be written to actually wrap its arg in a type-safe proxy map (not copy). Generally I think it would be a bit simpler to update the APIs to be generic at the same time as you update the impl, because in a lot of cases you have to do some hacks to make the impl generic and the API nongeneric. For example, if SharedClassObject was fixed, to use public static <T extends SharedClassObject> T findObject(Class<T>, boolean); then the impl would be cleaner since SetAccessibleAction would be SetAccessibleAction<T extends SharedClassObject> implements PrivilegedExceptionAction<T> and be constructed using Class<T>, so e.g. the SharedClassObject.class.cast call would be unnecessary. (In this case the impl will get more complicated because of the static cache, but...) Created attachment 29262 [details]
Fix for everything even APIs except Lookup
Jesse, I have fixed most of your requests. I changed all the non-lookup APIs that needed change (in order to prevent warnings). I am realatively satisfied with the signature changes, except topologicalSort, I am not sure if it is typed in the most generic way[1]. Anyway I hope this is integratable. [1] Map<Object,List<String>> m; Collection<String> c; topoSort(c, m); // does not compile Created attachment 29267 [details]
Same as previous, just better type for topologicalSort
Re. topologicalSort - there are only a few usages, so just make sure those can be adapted and it will probably be OK. Will be merged together with issue 67888 soon. *** This issue has been marked as a duplicate of 67888 *** |