Re: bug in java.util.Map

2004-01-21 Thread Matthias Pfisterer
David Holmes wrote:
I found a minor bug in java.util.Map: the inner class Entry
has to be public. Diff is attached.


All interface members are implicitly public. The preferred style is to
not explicitly define them as public.
Well, I prefer to be explicit. But this goes beyond a matter of taste. 
Building with kjc, I get the following errors:
---
../java/beans/PropertyChangeSupport.java:1: error:Unaccessible class 
java/util/Map/Entry can not be imported [JLS 7.5.1]
../java/beans/VetoableChangeSupport.java:1: error:Unaccessible class 
java/util/Map/Entry can not be imported [JLS 7.5.1]
../javax/swing/JDesktopPane.java:62: error:Cannot find class 
AccessibleJComponent [JLS 8]
---
If I add the public, the first two errors disappear. It may be a 
compiler bug. I'll try to nail it down.

Matthias

--
Matthias Pfisterer  mailto:[EMAIL PROTECTED]
Reuchlinstrasse 28  phone ++49-711-62 87 12
D-70176 Stuttgart   (in Deutschland 0711-62 87 12)
GERMANY
Work like you don't need the money.
Love like you've never been hurt.
Dance like nobody is watching.
Java Sound Resources (examples, FAQ, applications):
http://www.jsresources.org/
Tritonus, the open source implementation of the Java Sound API:
http://www.tritonus.org/
--


___
Classpath mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/classpath


Re: bug in java.util.Map

2004-01-21 Thread Tom Tromey
 Matthias == Matthias Pfisterer [EMAIL PROTECTED] writes:

Matthias Building with kjc, I get the following errors:
Matthias ../java/beans/PropertyChangeSupport.java:1: error:Unaccessible class
Matthias java/util/Map/Entry can not be imported [JLS 7.5.1]

If it isn't fixable in the compiler we can add a workaround.  We
already work around some gcj bugs.  Workarounds need a comment
explaining what compiler and version they are for, though.  And of
course we'd prefer a compiler fix...

Tom


___
Classpath mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/classpath


Re: bug in java.util.Map

2004-01-21 Thread Matthias Pfisterer
Dalibor Topic wrote:
Tom Tromey wrote:

Matthias == Matthias Pfisterer [EMAIL PROTECTED] writes:



Matthias Building with kjc, I get the following errors:
Matthias ../java/beans/PropertyChangeSupport.java:1: 
error:Unaccessible class
Matthias java/util/Map/Entry can not be imported [JLS 7.5.1]

If it isn't fixable in the compiler we can add a workaround.  We
already work around some gcj bugs.  Workarounds need a comment
explaining what compiler and version they are for, though.  And of
course we'd prefer a compiler fix...
The weird thing is that I use the unmodified source from GNU Classpath 
in kaffe's CVS  and it builds without a hitch there. So I'd be against 
adding a 'public' to it. And our java/beans/PropertyChangeSupport.java 
is the same as in classpath, as well. Weird.

I can only guess that the set of files being built together in 
classpath's build process is somewhat different from the set of files 
being build together in kaffe's build process, and that somehow triggers 
the problem.
I've localized the problem and filed a bug against kjc (on the kopi 
developers m-l). The error only occurs if the 
not-explicit-public-inner-interface is compiled together with a file 
importing it in one step.

Matthias

--
Matthias Pfisterer  mailto:[EMAIL PROTECTED]
Reuchlinstrasse 28  phone ++49-711-62 87 12
D-70176 Stuttgart   (in Deutschland 0711-62 87 12)
GERMANY
Work like you don't need the money.
Love like you've never been hurt.
Dance like nobody is watching.
Java Sound Resources (examples, FAQ, applications):
http://www.jsresources.org/
Tritonus, the open source implementation of the Java Sound API:
http://www.tritonus.org/
--


___
Classpath mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/classpath


bug in java.util.Map

2004-01-20 Thread Matthias Pfisterer
Hi,

I found a minor bug in java.util.Map: the inner class Entry has to be 
public. Diff is attached.

Matthias

--
Matthias Pfisterer  mailto:[EMAIL PROTECTED]
Reuchlinstrasse 28  phone ++49-711-62 87 12
D-70176 Stuttgart   (in Deutschland 0711-62 87 12)
GERMANY
Work like you don't need the money.
Love like you've never been hurt.
Dance like nobody is watching.
Java Sound Resources (examples, FAQ, applications):
http://www.jsresources.org/
Tritonus, the open source implementation of the Java Sound API:
http://www.tritonus.org/
--
Index: java/util/Map.java
===
RCS file: /cvsroot/classpath/classpath/java/util/Map.java,v
retrieving revision 1.11
diff -u -r1.11 Map.java
--- java/util/Map.java  15 Oct 2003 12:29:35 -  1.11
+++ java/util/Map.java  20 Jan 2004 20:34:32 -
@@ -264,7 +264,7 @@
* @since 1.2
* @status updated to 1.4
*/
-  static interface Entry
+  public static interface Entry
   {
 /**
  * Get the key corresponding to this entry.
___
Classpath mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/classpath


RE: bug in java.util.Map

2004-01-20 Thread David Holmes
 I found a minor bug in java.util.Map: the inner class Entry
 has to be public. Diff is attached.

All interface members are implicitly public. The preferred style is to
not explicitly define them as public.

David Holmes



___
Classpath mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/classpath


Re: bug in java.util.Map

2004-01-20 Thread Eric Blake
[Shoot, I hit send too early.]

For that matter, you should delete the static modifier.  Inner classes 
declared in an interface are implicitly 'public static'.

Matthias Pfisterer wrote:

Hi,

I found a minor bug in java.util.Map: the inner class Entry has to be 
public. Diff is attached.

Matthias



Index: java/util/Map.java
===
RCS file: /cvsroot/classpath/classpath/java/util/Map.java,v
retrieving revision 1.11
diff -u -r1.11 Map.java
--- java/util/Map.java  15 Oct 2003 12:29:35 -  1.11
+++ java/util/Map.java  20 Jan 2004 20:34:32 -
@@ -264,7 +264,7 @@
* @since 1.2
* @status updated to 1.4
*/
-  static interface Entry
+  public static interface Entry
   {
 /**
  * Get the key corresponding to this entry.

--
Someday, I might put a cute statement here.
Eric Blake [EMAIL PROTECTED]



___
Classpath mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/classpath