You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by Alexei Fedotov <al...@gmail.com> on 2008/04/06 13:15:16 UTC

[classlib][swing] committer attention. please Was: the method called via reflection in UIDefaults is undefined Re: JRootPane NPE

Dear committer,
I believe both FreeCol patches [1], [2] worth your attention to be
reviewed and committed.

[1] https://issues.apache.org/jira/browse/HARMONY-4252
[2] https://issues.apache.org/jira/browse/HARMONY-5643

Good job, Tharindu.
Feel free to file the next JIRA and continue your colonization quest.

Thanks, Tharindu, Aleksey!

On Sun, Apr 6, 2008 at 6:50 AM, Tharindu Mathew <mc...@gmail.com> wrote:
> Improved the code on the patch and submitted a new patch.
>
>  https://issues.apache.org/jira/browse/HARMONY-4252
>
>  On Sat, Apr 5, 2008 at 3:35 PM, Alexei Fedotov <al...@gmail.com>
>
>
> wrote:
>
>  > Great work, Alexey!
>  >
>  > I have a small comment concerning this patch. It would be easy to
>  > improve the code so getCreateUIMethodPriveledged(uiClass) would be
>  > called in one place. This would also simplify the logic behind the
>  > code. First, we create class if it is not created yet. Second, we
>  > create method if it is not created yet. More items may continue the
>  > sequence. This is not very important though.
>  >
>  > Generally I would kindly suggest being focused on your task. It is
>  > hard enough to get all three months for successful completion.
>  >
>  > Thanks, Alexei
>  >
>  > On Sat, Apr 5, 2008 at 5:34 AM, Aleksey Lagoshin <ay...@gmail.com>
>  > wrote:
>  > > Hello Tharindu and Alexei.
>  > >
>  > >  Good news - I was able to start FreeCol. :)
>  > >
>  > >  getUI exception was the last exception and after I've fixed it FreeCol
>  > >  successfully started on Harmony. But it is still not playable. Some
>  > modal
>  > >  dialogs are broken and don't respond to keyboard and mouse, so it's
>  > >  impossible to close them. Also there are many small UI bugs and a
>  > strange
>  > >  problem with performance (FreeCol is very slow on Harmony :/ ).
>  > >
>  > >  I have attached a patch to this issue [1]. The problem was that getUI
>  > method
>  > >  didn't create default createUI methods for registered Look and Feel
>  > >  components of FreeCol.
>  > >
>  > >  Tharindu, so the main problems now are buggy modal dialogs, performance
>  > and
>  > >  many bugs in UI. Actually, modal dialogs problem is showstopper, so I
>  > think
>  > >  it should be fixed first.
>  > >
>  > >  [1] http://issues.apache.org/jira/browse/HARMONY-4252
>  > >
>  > >
>  > >  2008/4/4, Alexei Fedotov <al...@gmail.com>:
>  > >
>  > >
>  > > >
>  > >  > Tharindu,
>  > >  > Yes, learning basics is a proper thing to do. I found your article
>  > >  > much better than the book I had read [1].
>  > >  >
>  > >  > [1] Kathy Walrath, Mary Campione The JFC Swing Tutorial
>  > >  > http://books.google.com/books?id=3rWTX-vjUhEC&printsec=frontcover
>  > >  >
>  > >  >
>  > >  > On Fri, Apr 4, 2008 at 8:59 PM, Tharindu Mathew <mc...@gmail.com>
>  > >  > wrote:
>  > >  > > Before digging deep on the problem, I feel I should understand the
>  > Swing
>  > >  > >  subsystem more. I'm reading the following article to get a proper
>  > idea.
>  > >  > >
>  > >  > >  http://java.sun.com/products/jfc/tsc/articles/architecture/
>  > >  > >
>  > >  > >  Please tell me if there is more relevant articles that will help
>  > me
>  > >  > along
>  > >  > >  the way. Thanks for the help.
>  > >  > >
>  > >  > >
>  > >  > >  On Fri, Apr 4, 2008 at 7:17 PM, Alexei Fedotov <
>  > >  > alexei.fedotov@gmail.com>
>  > >  > >  wrote:
>  > >  > >
>  > >  > >
>  > >  > >
>  > >  > >  > Tharindu,
>  > >  > >  > Thanks for the question. If I understand you correctly
>  > UIDefaults
>  > >  > hash
>  > >  > >  > table does not contain a proper value for a method to call for
>  > the
>  > >  > key
>  > >  > >  > corresponding to JRootPane.class. Why? The brief answer is "I
>  > don't
>  > >  > >  > know". Keep digging deeper. BTW, do we have swing gurus on the
>  > list
>  > >  > >  > who could shed the light on the problem?
>  > >  > >  >
>  > >  > >  > To guess what should be in the method variable I suggest you
>  > setting
>  > >  > a
>  > >  > >  > breakpoint on this line and try to collect a statistics for
>  > working
>  > >  > >  > swing demos. Why do they work? If JRootPanne would work, it
>  > probably
>  > >  > >  > has a different look and feel or setup in standard demos.
>  > >  > >  >
>  > >  > >  > I like that you have come with the guess. I checked how setUI()
>  > is
>  > >  > >  > called from java/common/javax/swing/JRootPane.java: it is
>  > mentioned
>  > >  > >  > three times as in other components. So, keeping an eye on this
>  > method
>  > >  > >  > does not help. I believe someone should register a method for
>  > this
>  > >  > >  > class in UIDefaults, for example, call new UIDefaults(a proper
>  > >  > array).
>  > >  > >  > I found that this is done in the following places.
>  > >  > >  >
>  > >  > >  > $  grep -rlI 'new UIDefaults' ./java/common/javax/swing/* | grep
>  > -v
>  > >  > svn
>  > >  > >  > ./java/common/javax/swing/LookAndFeel.java
>  > >  > >  > ./java/common/javax/swing/UIManager.java
>  > >  > >  > ./java/common/javax/swing/plaf/basic/BasicLookAndFeel.java
>  > >  > >  > ./java/common/javax/swing/plaf/metal/MetalLookAndFeel.java
>  > >  > >  > ./java/common/javax/swing/plaf/multi/MultiLookAndFeel.java
>  > >  > >  > ./java/common/javax/swing/plaf/synth/SynthLookAndFeel.java
>  > >  > >  > ./java/common/javax/swing/text/AbstractDocument.java
>  > >  > >  >
>  > >  > >  > Based on this list I may guess that the chosen look and feel
>  > does not
>  > >  > >  > register JRootPane look and feel correctly. Please, keep us
>  > posted on
>  > >  > >  > your advances.
>  > >  > >  >
>  > >  > >  > Thanks!
>  > >  > >  >
>  > >  > >  > On Fri, Apr 4, 2008 at 10:12 AM, Tharindu Mathew <
>  > mccloud35@gmail.com
>  > >  > >
>  > >  > >  > wrote:
>  > >  > >  > > ERROR: UIDefaults.getUI() failed:
>  > java.lang.NullPointerException
>  > >  > >  > >     at javax.swing.UIDefaults.getUI(UIDefaults.java:339)
>  > >  > >  > >     at javax.swing.UIManager.getUI(UIManager.java:222)
>  > >  > >  > >     at javax.swing.JPanel.updateUI(JPanel.java:141)
>  > >  > >  > >     at javax.swing.JPanel.<init>(JPanel.java:56)
>  > >  > >  > >     at javax.swing.JPanel.<init>(JPanel.java:76)
>  > >  > >  > >     at
>  > javax.swing.JRootPane.createGlassPane(JRootPane.java:278)
>  > >  > >  > >     at javax.swing.JRootPane.<init>(JRootPane.java:78)
>  > >  > >  > >     at javax.swing.JFrame.createRootPane(JFrame.java:175)
>  > >  > >  > >     at javax.swing.JFrame.frameInit(JFrame.java:393)
>  > >  > >  > >     at javax.swing.JFrame.<init>(JFrame.java:123)
>  > >  > >  > >     at
>  > >  > >  > >
>  > >  >
>  > >  > >  >
>  >  net.sf.freecol.client.gui.FullScreenFrame.<init>(FullScreenFrame.java:34)
>  > >  > >  > >     at
>  > >  > >  >
>  > net.sf.freecol.client.FreeColClient.startGUI(FreeColClient.java:218)
>  > >  > >  > >     at
>  > >  > >  >
>  > net.sf.freecol.client.FreeColClient.access$000(FreeColClient.java:31)
>  > >  > >  > >     at
>  > >  > net.sf.freecol.client.FreeColClient$1.run(FreeColClient.java:142)
>  > >  > >  > >     at
>  > >  > >  >
>  > java.awt.event.InvocationEvent.runAndNotify(InvocationEvent.java:98)
>  > >  > >  > >     at
>  > >  > java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:78)
>  > >  > >  > >     at
>  > >  > >  >
>  > java.awt.EventQueueCore.dispatchEventImpl(EventQueueCore.java:138)
>  > >  > >  > >     at java.awt.EventQueue.dispatchEvent(EventQueue.java:144)
>  > >  > >  > >     at
>  > >  > >  >
>  > >  > >
>  >  java.awt.EventDispatchThread.runModalLoop(EventDispatchThread.java:74)
>  > >  > >  > >     at
>  > >  > java.awt.EventDispatchThread.run(EventDispatchThread.java:48)
>  > >  > >  > >
>  > >  > >  > >
>  > >  > >  > >  In the UI defaults class:
>  > >  > >  > >
>  > >  > >  > >   Method method = null;
>  > >  > >  > >             if (uiClass == null) {
>  > >  > >  > >                 uiClass = getUIClass(classID,
>  > >  > >  > >  comp.getClass().getClassLoader());
>  > >  > >  > >                 method =
>  > getCreateUIMethodPriveledged(uiClass);
>  > >  > >  > >
>  > >  > >  > >                 put(fullClassName, uiClass);
>  > >  > >  > >                 put(uiClass, method);
>  > >  > >  > >             } else {
>  > >  > >  > >                 method = (Method)get(uiClass); *<--- method is
>  > >  > null,
>  > >  > >  > because
>  > >  > >  > >  no value exists for the uiClass key*
>  > >  > >  > >             }
>  > >  > >  > >             return (ComponentUI)method.invoke(null, new
>  > Object[] {
>  > >  > comp
>  > >  > >  > });
>  > >  > >  > >  *<--- causes NPE when tryin to invoke*
>  > >  > >  > >
>  > >  > >  > >  What is supposed to return to the method variable? Does this
>  > >  > return
>  > >  > >  > null
>  > >  > >  > >  because the setUI() method is not called from within
>  > JRootPane?
>  > >  > >  > >
>  > >  > >  > >  --
>  > >  > >  > >  Regards,
>  > >  > >  > >
>  > >  > >  > >  Tharindu
>  > >  > >  > >
>  > >  > >  >
>  > >  > >  >
>  > >  > >  >
>  > >  > >  > --
>  > >  > >  > With best regards,
>  > >  > >  > Alexei
>  > >  > >  >
>  > >  > >
>  > >  > >
>  > >  > >
>  > >  > >  --
>  > >  > >  Regards,
>  > >  > >
>  > >  > >  Tharindu
>  > >  > >
>  > >  >
>  > >  >
>  > >  >
>  > >  >
>  > >  > --
>  > >  > With best regards,
>  > >  >
>  > >  > Alexei
>  > >  >
>  > >
>  > >
>  > >
>  > >  --
>  > >  Thanks,
>  > >  Aleksey
>  > >
>  >
>  >
>  >
>  > --
>  > With best regards,
>  > Alexei
>  >
>
>
>
>  --
>  Regards,
>
>  Tharindu
>



-- 
With best regards,
Alexei

Re: [classlib][swing] committer attention. please

Posted by Alexei Fedotov <al...@gmail.com>.
Thanks, Tharindu. This thread would serve as an explanation.

On Tue, Apr 8, 2008 at 4:48 PM, Tharindu Mathew <mc...@gmail.com> wrote:
> Yes I understood that it was implied. But initially, it was a point of
>  confusion, so I brought it up.
>
>
>
>  On Tue, Apr 8, 2008 at 5:31 PM, Tim Ellison <t....@gmail.com> wrote:
>
>  > Alexei Zakharov wrote:
>  >
>  > >  I submitted some patches in Harmony but the ACQ asks whether I have
>  > > > read the
>  > > >  source, fixed bugs... (part 3 of the ACQ). I assumed that it was on
>  > > > any Java
>  > > >  implementation other than Harmony.
>  > > >
>  > >
>  > > Yes, of course this is not about Harmony - this is about Sun java,
>  > > Classpath, GCJ and etc - did you happen to look into sources of these
>  > > (or some other) VMs and/or corresponding class libraries.
>  > >
>  >
>  > Yes, indeed.
>  >
>  > Regards,
>  > Tim
>  >
>  >
>
>
>  --
>  Regards,
>
>  Tharindu
>



-- 
With best regards,
Alexei

Re: [classlib][swing] committer attention. please

Posted by Tharindu Mathew <mc...@gmail.com>.
Yes I understood that it was implied. But initially, it was a point of
confusion, so I brought it up.

On Tue, Apr 8, 2008 at 5:31 PM, Tim Ellison <t....@gmail.com> wrote:

> Alexei Zakharov wrote:
>
> >  I submitted some patches in Harmony but the ACQ asks whether I have
> > > read the
> > >  source, fixed bugs... (part 3 of the ACQ). I assumed that it was on
> > > any Java
> > >  implementation other than Harmony.
> > >
> >
> > Yes, of course this is not about Harmony - this is about Sun java,
> > Classpath, GCJ and etc - did you happen to look into sources of these
> > (or some other) VMs and/or corresponding class libraries.
> >
>
> Yes, indeed.
>
> Regards,
> Tim
>
>


-- 
Regards,

Tharindu

Re: [classlib][swing] committer attention. please

Posted by Tim Ellison <t....@gmail.com>.
Alexei Zakharov wrote:
>>  I submitted some patches in Harmony but the ACQ asks whether I have read the
>>  source, fixed bugs... (part 3 of the ACQ). I assumed that it was on any Java
>>  implementation other than Harmony.
> 
> Yes, of course this is not about Harmony - this is about Sun java,
> Classpath, GCJ and etc - did you happen to look into sources of these
> (or some other) VMs and/or corresponding class libraries.

Yes, indeed.

Regards,
Tim


Re: [classlib][swing] committer attention. please

Posted by Alexei Zakharov <al...@gmail.com>.
>  I submitted some patches in Harmony but the ACQ asks whether I have read the
>  source, fixed bugs... (part 3 of the ACQ). I assumed that it was on any Java
>  implementation other than Harmony.

Yes, of course this is not about Harmony - this is about Sun java,
Classpath, GCJ and etc - did you happen to look into sources of these
(or some other) VMs and/or corresponding class libraries.

Regards,
Alexei

2008/4/7, Tharindu Mathew <mc...@gmail.com>:
> Hey Tim,
>
>  I send the completed ACQ and ICLA to the private list.
>
>  Wanted to tell about some unclear areas I ran into in the ACQ:
>
>  I submitted some patches in Harmony but the ACQ asks whether I have read the
>  source, fixed bugs... (part 3 of the ACQ). I assumed that it was on any Java
>  implementation other than Harmony. I was a bit confused since this wasn't
>  stated explicitly. But I assumed it was so (confirmed with Alexei Fedotov)
>  and filled out the form.
>
>  I hope that this helps to improve the ACQ.
>
>
>  On Mon, Apr 7, 2008 at 8:55 PM, Tim Ellison <t....@gmail.com> wrote:
>
>  > Aleksey Lagoshin wrote:
>  >
>  > > Hello Tim,
>  > >
>  > > I have sent completed ACQ and ICLA to private@harmony.apache.org
>  > >
>  >
>  > Got it, thanks.
>  >
>  > Tim
>  >
>  >
>
>
>
> --
>  Regards,
>
>
>  Tharindu
>

Re: [classlib][swing] committer attention. please

Posted by Tharindu Mathew <mc...@gmail.com>.
Hey Tim,

I send the completed ACQ and ICLA to the private list.

Wanted to tell about some unclear areas I ran into in the ACQ:

I submitted some patches in Harmony but the ACQ asks whether I have read the
source, fixed bugs... (part 3 of the ACQ). I assumed that it was on any Java
implementation other than Harmony. I was a bit confused since this wasn't
stated explicitly. But I assumed it was so (confirmed with Alexei Fedotov)
and filled out the form.

I hope that this helps to improve the ACQ.

On Mon, Apr 7, 2008 at 8:55 PM, Tim Ellison <t....@gmail.com> wrote:

> Aleksey Lagoshin wrote:
>
> > Hello Tim,
> >
> > I have sent completed ACQ and ICLA to private@harmony.apache.org
> >
>
> Got it, thanks.
>
> Tim
>
>


-- 
Regards,

Tharindu

Re: [classlib][swing] committer attention. please

Posted by Tim Ellison <t....@gmail.com>.
Aleksey Lagoshin wrote:
> Hello Tim,
> 
> I have sent completed ACQ and ICLA to private@harmony.apache.org

Got it, thanks.

Tim


Re: [classlib][swing] committer attention. please

Posted by Aleksey Lagoshin <ay...@gmail.com>.
Hello Tim,

I have sent completed ACQ and ICLA to private@harmony.apache.org

2008/4/7, Tim Ellison <t....@gmail.com>:
>
> Alexei Fedotov wrote:
>
> > 1. Do I understand correctly that submitting to the "Harmony PMC"
> > means sending a fax of the document to Apache (+1.410.803.2258)? Or is
> > it ok to send a scanned pdf file to private@harmony.apache.org?
> >
>
> Either is fine, but sending a scanned copy to private@ is more direct
> since faxing it to the Secretary just means we get a scanned copy from him.
>  Just do whichever you find easiest.
>
>  2.Our site mentions that ICLA is required for committers only. Could
> > you confirm that students may omit ICLA [2] and send ACQ [1] only?
> >
>
> Yes, that is true.  You are encouraged to submit an ICLA but it is not
> required.  For some people it is in their interest to do so too.
>
> Regards,
> Tim
>
>  [1] ACQ, http://harmony.apache.org/auth_cont_quest.txt
> > [2] ICLA, http://www.apache.org/licenses/icla.txt
> >
> > Thanks!
> >
> > On Sun, Apr 6, 2008 at 11:04 PM, Tim Ellison <t....@gmail.com>
> > wrote:
> >
> > > Alexei Fedotov wrote:
> > >
> > >  Dear committer,
> > > > I believe both FreeCol patches [1],
> > > >
> > > >   It would be good to get a completed ACQ from Tharindu and/or
> > > Aleksey so we
> > > can accept non-trivial patches from them.
> > >
> > >  See http://harmony.apache.org/contribution_policy.html
> > >
> > >
> > >  [2] worth your attention to be
> > > > reviewed and committed.
> > > >
> > > >   [2] fixed at r645287.
> > >
> > >  Thanks,
> > >  Tim
> > >
> > >
> > >  [1] https://issues.apache.org/jira/browse/HARMONY-4252
> > > > [2] https://issues.apache.org/jira/browse/HARMONY-5643
> > > >
> > > > Good job, Tharindu.
> > > > Feel free to file the next JIRA and continue your colonization
> > > > quest.
> > > >
> > > >
> > >
> >
> >
> >


-- 
Thanks,
Aleksey

Re: [classlib][swing] committer attention. please

Posted by Tim Ellison <t....@gmail.com>.
Alexei Fedotov wrote:
> 1. Do I understand correctly that submitting to the "Harmony PMC"
> means sending a fax of the document to Apache (+1.410.803.2258)? Or is
> it ok to send a scanned pdf file to private@harmony.apache.org?

Either is fine, but sending a scanned copy to private@ is more direct 
since faxing it to the Secretary just means we get a scanned copy from 
him.  Just do whichever you find easiest.

> 2.Our site mentions that ICLA is required for committers only. Could
> you confirm that students may omit ICLA [2] and send ACQ [1] only?

Yes, that is true.  You are encouraged to submit an ICLA but it is not 
required.  For some people it is in their interest to do so too.

Regards,
Tim

> [1] ACQ, http://harmony.apache.org/auth_cont_quest.txt
> [2] ICLA, http://www.apache.org/licenses/icla.txt
> 
> Thanks!
> 
> On Sun, Apr 6, 2008 at 11:04 PM, Tim Ellison <t....@gmail.com> wrote:
>> Alexei Fedotov wrote:
>>
>>> Dear committer,
>>> I believe both FreeCol patches [1],
>>>
>>  It would be good to get a completed ACQ from Tharindu and/or Aleksey so we
>> can accept non-trivial patches from them.
>>
>>  See http://harmony.apache.org/contribution_policy.html
>>
>>
>>> [2] worth your attention to be
>>> reviewed and committed.
>>>
>>  [2] fixed at r645287.
>>
>>  Thanks,
>>  Tim
>>
>>
>>> [1] https://issues.apache.org/jira/browse/HARMONY-4252
>>> [2] https://issues.apache.org/jira/browse/HARMONY-5643
>>>
>>> Good job, Tharindu.
>>> Feel free to file the next JIRA and continue your colonization quest.
>>>
>>
> 
> 
> 

Re: [classlib][swing] committer attention. please

Posted by Alexei Fedotov <al...@gmail.com>.
Folks,

Sorry, core dumped. I read a web site and found the following:
> In order for a committer to become an Authorized Contributor to Harmony, each committer is also required to complete the Authorized Contributor Questionnaire and submit it to the Harmony PMC.

1. Do I understand correctly that submitting to the "Harmony PMC"
means sending a fax of the document to Apache (+1.410.803.2258)? Or is
it ok to send a scanned pdf file to private@harmony.apache.org?
2.Our site mentions that ICLA is required for committers only. Could
you confirm that students may omit ICLA [2] and send ACQ [1] only?

[1] ACQ, http://harmony.apache.org/auth_cont_quest.txt
[2] ICLA, http://www.apache.org/licenses/icla.txt

Thanks!

On Sun, Apr 6, 2008 at 11:04 PM, Tim Ellison <t....@gmail.com> wrote:
> Alexei Fedotov wrote:
>
> > Dear committer,
> > I believe both FreeCol patches [1],
> >
>
>  It would be good to get a completed ACQ from Tharindu and/or Aleksey so we
> can accept non-trivial patches from them.
>
>  See http://harmony.apache.org/contribution_policy.html
>
>
> > [2] worth your attention to be
> > reviewed and committed.
> >
>
>  [2] fixed at r645287.
>
>  Thanks,
>  Tim
>
>
> > [1] https://issues.apache.org/jira/browse/HARMONY-4252
> > [2] https://issues.apache.org/jira/browse/HARMONY-5643
> >
> > Good job, Tharindu.
> > Feel free to file the next JIRA and continue your colonization quest.
> >
>
>



-- 
With best regards,
Alexei

Re: [classlib][swing] committer attention. please

Posted by Tim Ellison <t....@gmail.com>.
Alexei Fedotov wrote:
> Dear committer,
> I believe both FreeCol patches [1],

It would be good to get a completed ACQ from Tharindu and/or Aleksey so 
we can accept non-trivial patches from them.

See http://harmony.apache.org/contribution_policy.html

> [2] worth your attention to be
> reviewed and committed.

[2] fixed at r645287.

Thanks,
Tim

> [1] https://issues.apache.org/jira/browse/HARMONY-4252
> [2] https://issues.apache.org/jira/browse/HARMONY-5643
> 
> Good job, Tharindu.
> Feel free to file the next JIRA and continue your colonization quest.