<Swing Dev> [PATCH] 6179357-related: Working on warnings removal

Pavel Porvatov Pavel.Porvatov at Sun.COM
Tue Oct 16 17:06:43 UTC 2007


Hi Florian,

I like Your idea to clean code and I hope we will make it ASAP. I will 
be a reviewer of Your changes and at the end I will put Your changes 
into JDK. At the first I want to notify about couple things:
1. We are moving on mercurial (http://www.selenic.com/mercurial/wiki/) 
now and it will take up to month
2. We are going to do some refactoring at the transition moment, so I 
don't see any reason to do big diffs now, because we will catch many 
conflicts! (now I cannot do commit).

I thought about our situation and I think the best way is:

1. We are waiting the end of mercurial transition (You will see it, 
because openJDK will be moved on mercurial too)
2. You prepare diffs on NEW SOURCES. Note, that I cannot review diffs 
with size 300kb, I'm sorry :(. I reviewed 20 kb and it took some time. 
And it will be difficult to review new changes in Your diffs, so try to 
separate Your changes into files not more than 5-10 kb. Let's start with 
the first change with size about 50 kb (select separation as you want)
3. You send me Your changes, I review it and return feedback
4. If Your change is excellent, I will commit these changes via our 
internal procedure (don't worry about this step :))
5. We repeat the steps 3-4 and so on... (We can increase a next diffs)

Ok, let's discuss about current diffs (I didn't see whole Your fix and I 
stop it now, let's wait mercurial transition and code refactoring):

1. DesktopProperty:
Can You change declaration into
private final static ReferenceQueue<Object> queue = new 
ReferenceQueue<Object>();
(note that I added final and replaced HashMap by Map) and remove a 
static section?

2. WindowsScrollBarUI:
Can You change declaration into
         private final static Map<String, WeakReference<Grid>> map = new 
HashMap<String, WeakReference<Grid>>();
and remove a static section?

3. AbstractButton:
What about
(JComponent)AbstractButton.this

4. ArrayTable:
(Hashtable<Object, Object>)table
has unchecked cast

Don't shy to ask me if You have questions...

Thanks, Pavel.

> Hi,
> 
> back from my holidays I finally found time to work the patch over. :-)
> 
> There is now one patch per package.
> 
> When compiling with
> -Xlint -J-Xms80m -J-Xmx256m -Xlint:-serial -Xlint:-deprecation 
> -Xlint:-fallthrough -Xmaxwarns 1200
> all patches together reduce the number of reported warnings from 1181 to 
> 88.
> 
> I tried only to change things related to the warnings and not to change 
> any public or protected APIs in public or protected classes in this patch.
> 
> No new @author tags are added.
> 
> At many places I tried to add type parameters as meaningful as possible, 
> but with some cases I just used Object, if a more meaningful type 
> parameter was not so trivial. You might want to refactor this if needed. 
> (Though everything should work as it is.)
> 
> The basis of this patch is revision 254. Apply it at 
> openjdk/jdk/trunk/j2se/src.
> 
> This will be the basis to add generics support to the Swing framework 
> and I will try to further reduce the number of warnings once I started 
> with this task.
> 
> -Florian
> 
> 
> Alexander Potochkin schrieb:
>> Hello Florian
>>> Hi,
>>>
>>> here's my first patch. When compiling with
>>> -Xlint -J-Xms80m -J-Xmx256m -Xlint:-serial -Xlint:-deprecation 
>>> -Xlint:-fallthrough -Xmaxwarns 1200
>>> this patch reduces the number of reported warnings from 1185 to 91.
>>>
>>> This will be the basis to add generics support to the Swing framework 
>>> and I will try to further reduce the number of warnings once I 
>>> started with this task.
>>>
>>> The basis of this patch is revision 250. Apply it at 
>>> openjdk/jdk/trunk/j2se/src.
>>>
>>> I tried not to change any public or protected APIs in public or 
>>> protected classes in this patch.
>>>
>>> At many places I tried to add type parameters as meaningful as 
>>> possible, but with some cases I just used Object, if a more 
>>> meaningful type parameter was not so trivial. You might want to 
>>> refactor this if needed. (Though everything should work as it is.)
>>
>> Could you please to split your fix to several ones ?
>> It is difficult to review so big fixes
>>
>> I'd suggest to make a fix for a package
>>
>> We also usually don't mix two problems in one fix
>> so it is better to factor out removing warnings from existent code
>> to another fix
>>
>> We also update the @author tag in a very rare occasion
>> when someone added a significant amount of code to a class
>>
>>>
>>> I also started a new project at java.net: 
>>> https://swing-generics.dev.java.net/ (pending approval)
>>> Am I correct that with the licences of openjdk I am allowed to 
>>> publish the modified swing project in source, binary and javadoc form?
>>
>> I hope you can do it, because I can't imagine it was not allowed by 
>> the lisence
>>
>> But since I am not a lawyer, probably someone else can confirm that ?
>>
>> Thanks
>> alexp
>>
>>
>>> **
>>> -Florian
>>>
>>> Alexander Potochkin schrieb:
>>>> Hello Florian
>>>>> Hi,
>>>>>
>>>>> I decided first to remove some warning for trivial cases, since 
>>>>> even if I compile with
>>>>> -Xlint:-serial -Xlint:-deprecation -Xlint:-cast -Xlint:-fallthrough 
>>>>> -Xmaxwarns 1200
>>>>> I get 977 warnings! And since most of them are [unckecked] 
>>>>> warnings, it's hard to see, if and where I introduce new 
>>>>> [unckecked] warnings, when adding generics.
>>>>
>>>> You are right, unfortunately we have a lot of warnings in compile time
>>>>
>>>> We should have paid more attention to this problem
>>>>
>>>> Thanks
>>>> alexp
>>>>
>>>>> Please tell me if somebody else is working on the warnings removal, 
>>>>> too.
>>>>>
>>>>> -Florian
>>>>>
>>>>> Florian Brunner schrieb:
>>>>>> Hi Alecander!
>>>>>>
>>>>>> Thanks for your help. I installed the basic environment and 
>>>>>> started to work on this issue.
>>>>>>
>>>>>> Note that the path at
>>>>>>
>>>>>> https://openjdk.dev.java.net/source/browse/openjdk/
>>>>>>
>>>>>> as well as at
>>>>>>
>>>>>> https://openjdk.dev.java.net/servlets/ProjectSource
>>>>>>
>>>>>> don't seem to be correct!
>>>>>>
>>>>>> At
>>>>>> |https://openjdk.dev.java.net/svn/openjdk/trunk
>>>>>>
>>>>>> there's only a www directory!
>>>>>>
>>>>>> Instead I checked out
>>>>>>
>>>>>> https://openjdk.dev.java.net/svn/openjdk/jdk/trunk/j2se/
>>>>>>
>>>>>> Is this the correct path to work on the Swing project?
>>>>>>
>>>>>> I'will post to this list again when there are more news or 
>>>>>> questions arise.
>>>>>>
>>>>>> -Florian
>>>>>>
>>>>>> |Alexander Potochkin schrieb:
>>>>>>>
>>>>>>> Hello Florian
>>>>>>>
>>>>>>> Welcome to the swing-dev
>>>>>>>
>>>>>>> The RFE #6179357 is definitely worth investigating
>>>>>>> we was going to generify Swing for 1.6
>>>>>>> but unfortunately didn't have enough time
>>>>>>>
>>>>>>> Your fixes are welcome
>>>>>>>
>>>>>>> Here is the information how to contribute:
>>>>>>> http://openjdk.java.net/contribute/
>>>>>>>
>>>>>>> For now the process is:
>>>>>>>
>>>>>>> Become a contributor
>>>>>>> download openJDK
>>>>>>> make the fix
>>>>>>> ask any related questions on this list
>>>>>>> submit a patch
>>>>>>> we'll assign a sponsor who we'll review your fix
>>>>>>> and put it back when it is done
>>>>>>>
>>>>>>> The whole process will be simplified when we complete moving to 
>>>>>>> Mercurial repository
>>>>>>>
>>>>>>> For this RFE you don't need to file JSR
>>>>>>> as you mentioned changes should as backward compatible as possible
>>>>>>>
>>>>>>> but we'll need the request to the special committee which keeps 
>>>>>>> track of the Java public API, the sponsor will do it for you
>>>>>>>
>>>>>>> Please note that we prefer to make the incremental fixes which 
>>>>>>> fix the particular problem, I mean, not to mix e.g. generifying 
>>>>>>> and optimization
>>>>>>> in one fix but split it to two ones.
>>>>>>>
>>>>>>> >I want my
>>>>>>> > progress to be visible by the public. So what is the best 
>>>>>>> strategy? Work at
>>>>>>> > openjdk.org? Work at SwingLabs? Start a new project at java.net?
>>>>>>>
>>>>>>> The current process doesn't seem to provide much visibility for 
>>>>>>> the public. To make it visible I personally would do the 
>>>>>>> following things:
>>>>>>>
>>>>>>> - start a project on java.net
>>>>>>> (not sure it helps for this particular case)
>>>>>>> - blog about your progress and discuss it with the community
>>>>>>> (this is the best way to make your work visible)
>>>>>>>
>>>>>>> Thanks
>>>>>>> alexp
>>>>>>>
>>>>>>>
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> I'm interessted in the RFE "6179357: Request interface 
>>>>>>>> javax.swing.tree.TreeModel to have a generic type for nodes". Is 
>>>>>>>> there already someone working on this issue? If not I would like 
>>>>>>>> to help there.
>>>>>>>>
>>>>>>>> I want to address following issues:
>>>>>>>> - add generics support to the Swing framework
>>>>>>>> - provide support for new language features like varargs
>>>>>>>> - provide better support for the collection framework
>>>>>>>> - optimize code where reasonable
>>>>>>>>
>>>>>>>> Do you think this is a good idea? How probable will such a 
>>>>>>>> change make its way to the "official" jdk?
>>>>>>>> I sent the signed SCA to Sun. So what would be the next steps? I 
>>>>>>>> want my progress to be visible by the public. So what is the 
>>>>>>>> best strategy? Work at openjdk.org? Work at SwingLabs? Start a 
>>>>>>>> new project at java.net?
>>>>>>>>
>>>>>>>> Should I work on a branch of openjdk? Or should I copy the 
>>>>>>>> current revision to a new repository? What is the easiest/ best 
>>>>>>>> way to get the source back to openjdk?
>>>>>>>>
>>>>>>>> Is a JSR needed for such a change? Note: the suggested changes 
>>>>>>>> should be backwards compatible (eg. thanks to the "raw type 
>>>>>>>> feature" of generics), as far as I can see up to now. (The only 
>>>>>>>> exception is of course reflection, which can always break if you 
>>>>>>>> change an API).
>>>>>>>> Thanks for your help.
>>>>>>>>
>>>>>>>> -Florian
>>>>>>>
>>>>>>
>>>>>
>>>>
>>>
>>>




More information about the swing-dev mailing list