Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #37638 > unrolled thread
| Started by | Eric Douglas <e.d.programmer@gmail.com> |
|---|---|
| First post | 2017-11-03 05:23 -0700 |
| Last post | 2017-11-03 10:31 -0400 |
| Articles | 8 — 3 participants |
Back to article view | Back to comp.lang.java.programmer
Where is the source? Eric Douglas <e.d.programmer@gmail.com> - 2017-11-03 05:23 -0700
Re: Where is the source? Andreas Leitgeb <avl@logic.at> - 2017-11-03 12:55 +0000
Re: Where is the source? Eric Douglas <e.d.programmer@gmail.com> - 2017-11-03 06:25 -0700
Re: Where is the source? Andreas Leitgeb <avl@logic.at> - 2017-11-03 13:45 +0000
Re: Where is the source? Eric Douglas <e.d.programmer@gmail.com> - 2017-11-03 06:51 -0700
Re: Where is the source? Andreas Leitgeb <avl@logic.at> - 2017-11-03 14:12 +0000
Re: Where is the source? Eric Douglas <e.d.programmer@gmail.com> - 2017-11-03 07:30 -0700
Re: Where is the source? Eric Sosman <esosman@comcast-dot-net.invalid> - 2017-11-03 10:31 -0400
| From | Eric Douglas <e.d.programmer@gmail.com> |
|---|---|
| Date | 2017-11-03 05:23 -0700 |
| Subject | Where is the source? |
| Message-ID | <41184dc1-97f9-46db-be03-b5685f8e3304@googlegroups.com> |
I'm calling javax.swing.JTable.convertColumnIndexToModel and it's crashing. All it tells me is Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at sun.swing.SwingUtilities2.convertColumnIndexToModel(SwingUtilities2.java:1988) The column model is not null. The column should not be null. It would really help if I could see the line that's crashing.
[toc] | [next] | [standalone]
| From | Andreas Leitgeb <avl@logic.at> |
|---|---|
| Date | 2017-11-03 12:55 +0000 |
| Message-ID | <slrnovopp6.774.avl@logic.at> |
| In reply to | #37638 |
Eric Douglas <e.d.programmer@gmail.com> wrote:
> I'm calling javax.swing.JTable.convertColumnIndexToModel and it's crashing.
> All it tells me is
> Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
> at sun.swing.SwingUtilities2.convertColumnIndexToModel(SwingUtilities2.java:1988)
> The column model is not null. The column should not be null. It would really help if I could see the line that's crashing.
Last time I installed Oracle JDK (1.8.0_131), then its $JAVA_HOME
had a file named src.zip in it. (but version 8 doesn't seem to have
that particular class)
If you're using openjdk in Linux (e.g. debian or ubuntu), then you
might want to also install package "openjdk-9-source"
As it seems, both openjdk-8-source and openjdk-9-source each have a
src.zip that does contain sun/swing/SwingUtilities2.java
$ unzip -l /usr/lib/jvm/openjdk-8/src.zip | grep SwingUtilities2.java
77994 2017-03-10 08:20 sun/swing/SwingUtilities2.java
$ unzip -l /usr/lib/jvm/openjdk-9/src.zip | grep SwingUtilities2.java
76468 2016-04-11 19:00 sun/swing/SwingUtilities2.java
Happy debugging.
[toc] | [prev] | [next] | [standalone]
| From | Eric Douglas <e.d.programmer@gmail.com> |
|---|---|
| Date | 2017-11-03 06:25 -0700 |
| Message-ID | <61359ae0-e0e7-4464-a4d7-78a908028127@googlegroups.com> |
| In reply to | #37639 |
On Friday, November 3, 2017 at 8:55:10 AM UTC-4, Andreas Leitgeb wrote: > Last time I installed Oracle JDK (1.8.0_131), then its $JAVA_HOME > had a file named src.zip in it. (but version 8 doesn't seem to have > that particular class) > > If you're using openjdk in Linux (e.g. debian or ubuntu), then you > might want to also install package "openjdk-9-source" > > As it seems, both openjdk-8-source and openjdk-9-source each have a > src.zip that does contain sun/swing/SwingUtilities2.java > > $ unzip -l /usr/lib/jvm/openjdk-8/src.zip | grep SwingUtilities2.java > 77994 2017-03-10 08:20 sun/swing/SwingUtilities2.java > $ unzip -l /usr/lib/jvm/openjdk-9/src.zip | grep SwingUtilities2.java > 76468 2016-04-11 19:00 sun/swing/SwingUtilities2.java > > Happy debugging. I have source attached, using the file C:\Program Files\Java\jdk1.8.0_144\src.zip This gives me the source for JTable, which calls SwingUtilities2, which says it doesn't have source.
[toc] | [prev] | [next] | [standalone]
| From | Andreas Leitgeb <avl@logic.at> |
|---|---|
| Date | 2017-11-03 13:45 +0000 |
| Message-ID | <slrnovosnl.774.avl@logic.at> |
| In reply to | #37640 |
Eric Douglas <e.d.programmer@gmail.com> wrote:
> I have source attached, using the file
> C:\Program Files\Java\jdk1.8.0_144\src.zip
> This gives me the source for JTable, which calls SwingUtilities2, which says it doesn't have source.
Well, seems like Oracle's src.zip just isn't complete.
In the hope that openjdk's and Oracle's version of that file aren't
all that different:
public static int convertColumnIndexToModel(TableColumnModel cm,
int viewColumnIndex) {
if (viewColumnIndex < 0) {
return viewColumnIndex;
}
return cm.getColumn(viewColumnIndex).getModelIndex(); // this is line 1988
}
So, while your Table column model might not have been null, it
may not like the index that's being passed to its getColumn.
[toc] | [prev] | [next] | [standalone]
| From | Eric Douglas <e.d.programmer@gmail.com> |
|---|---|
| Date | 2017-11-03 06:51 -0700 |
| Message-ID | <774979c7-fc2f-4efb-8378-687ce2501199@googlegroups.com> |
| In reply to | #37641 |
On Friday, November 3, 2017 at 9:45:33 AM UTC-4, Andreas Leitgeb wrote:
> Well, seems like Oracle's src.zip just isn't complete.
> In the hope that openjdk's and Oracle's version of that file aren't
> all that different:
>
> public static int convertColumnIndexToModel(TableColumnModel cm,
> int viewColumnIndex) {
> if (viewColumnIndex < 0) {
> return viewColumnIndex;
> }
> return cm.getColumn(viewColumnIndex).getModelIndex(); // this is line 1988
> }
>
> So, while your Table column model might not have been null, it
> may not like the index that's being passed to its getColumn.
I don't know if or where Oracle packages this source. The best I could find is one web site which has the method but not the right line numbers.
http://www.docjar.com/html/api/sun/swing/SwingUtilities2.java.html
[toc] | [prev] | [next] | [standalone]
| From | Andreas Leitgeb <avl@logic.at> |
|---|---|
| Date | 2017-11-03 14:12 +0000 |
| Message-ID | <slrnovouan.774.avl@logic.at> |
| In reply to | #37642 |
Eric Douglas <e.d.programmer@gmail.com> wrote: > I don't know if or where Oracle packages this source. The best I could > find is one web site which has the method but not the right line numbers. > http://www.docjar.com/html/api/sun/swing/SwingUtilities2.java.html On the top of the linked page it says that file is from openjdk-7 My snippet was from openjdk-8 and seemed to plausibly match the line. With the information I posted so far, can you fix your problem at hand? I could upload the openjdk's src.zip or the particular .java file to some filesharing site, if you need it to find your bug at hand. (But I guess it must already exist somewhere out there on the 'net) I cannot help you with mere rants about Oracle's packaging policy...
[toc] | [prev] | [next] | [standalone]
| From | Eric Douglas <e.d.programmer@gmail.com> |
|---|---|
| Date | 2017-11-03 07:30 -0700 |
| Message-ID | <78fab62a-a7b5-417b-820e-3c3a86860857@googlegroups.com> |
| In reply to | #37643 |
On Friday, November 3, 2017 at 10:12:48 AM UTC-4, Andreas Leitgeb wrote: > > http://www.docjar.com/html/api/sun/swing/SwingUtilities2.java.html > > On the top of the linked page it says that file is from openjdk-7 > > My snippet was from openjdk-8 and seemed to plausibly match the line. > > With the information I posted so far, can you fix your problem at hand? > > I could upload the openjdk's src.zip or the particular .java file to > some filesharing site, if you need it to find your bug at hand. > (But I guess it must already exist somewhere out there on the 'net) > > I cannot help you with mere rants about Oracle's packaging policy... I figured I must be missing something, very odd if Oracle is calling a method from openjdk and not including their source somewhere. I did notice that snippet I found was openjdk-7 and figured there must be an 8? Is there source for 8 online somewhere or would I have to download and install it? I did figure out my problem, thanks.
[toc] | [prev] | [next] | [standalone]
| From | Eric Sosman <esosman@comcast-dot-net.invalid> |
|---|---|
| Date | 2017-11-03 10:31 -0400 |
| Message-ID | <othujn$rro$1@dont-email.me> |
| In reply to | #37639 |
On 11/3/2017 8:55 AM, Andreas Leitgeb wrote:
> Eric Douglas <e.d.programmer@gmail.com> wrote:
>> I'm calling javax.swing.JTable.convertColumnIndexToModel and it's crashing.
>> All it tells me is
>> Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
>> at sun.swing.SwingUtilities2.convertColumnIndexToModel(SwingUtilities2.java:1988)
>> The column model is not null. The column should not be null. It would really help if I could see the line that's crashing.
>
> Last time I installed Oracle JDK (1.8.0_131), then its $JAVA_HOME
> had a file named src.zip in it. (but version 8 doesn't seem to have
> that particular class)
... because it's not part of "Java SE," but part of Snoracle's
proprietary implementation thereof.
> If you're using openjdk in Linux (e.g. debian or ubuntu), then you
> might want to also install package "openjdk-9-source"
>
> As it seems, both openjdk-8-source and openjdk-9-source each have a
> src.zip that does contain sun/swing/SwingUtilities2.java
... which might or might not resemble Sun's, but could be worth
studying.
--
esosman@comcast-dot-net.invalid
Eleven hundred seventy-four days to go.
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.java.programmer
csiph-web