harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mikhail Markov (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-1639) [classlib][luni] Fresh install of jedit 4.3pre6 doesn't start - throws exception
Date Wed, 25 Apr 2007 07:07:15 GMT

    [ https://issues.apache.org/jira/browse/HARMONY-1639?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12491535
] 

Mikhail Markov commented on HARMONY-1639:
-----------------------------------------

The same problem is valid for TreeMap.
I'd like to mention that although it's possible to put *single* not-comparable object to TreeSet/TreeMap,
after that almost no manipulations could be made with this map (like addition of new objects,
calling contains() method etc.).

In addition to the example mentioned above I've made some experiments with maps/sets and got
the following results:
1)
    Set s1 = new TreeSet();
    Set s2 = new TreeSet();
    Object obj = new Object();
    s1.add(obj);
    s2.add(obj);
    System.out.println("Equals?: " + s1.equals(s2));
On RI the above piece of code returnse false which is unexpected as both sets contains the
same object. On Harmony - ClassCastException during equals() call.

2)
    TreeMap m1 = new TreeMap();
    TreeMap m2 = new TreeMap();
    Object obj = new Object();
    String str = "val";
    m1.put(obj, str);
    m2.put(obj, str);
    System.out.println("Equals?: " + m1.equals(m2));
Same results here: on RI - unexpected false, on Harmony - ClassCastException during equals()
call.

More interesting cases (and i think they are really related with the issue above):
3)
    HashMap h = new HashMap();
    TreeMap t = new TreeMap();
    h.put(new Object(), "val");
    t.put("key", "val");
    System.out.println("Equals?: " + t.equals(h));
Both on RI and Harmony - false.

4)
    HashMap h = new HashMap();
    TreeMap t = new TreeMap();
    h.put(new Object(), "val");
    t.put("key", "val");
    System.out.println("Equals?: " + h.equals(t));
On RI - false, on Harmony - ClassCastException.

5)
    HashSet h = new HashSet();
    TreeSet t = new TreeSet();
    h.add(new Object());
    t.add("key");
    System.out.println("Equals?: " + t.equals(h));
On RI - false, on Harmony - ClassCastException.

6) 
    HashSet h = new HashSet();
    TreeSet t = new TreeSet();
    h.add(new Object());
    t.add("key");
    System.out.println("Equals?: " + h.equals(t));
Both on RI and Harmony - false.

So, it seems that RI just catches ClassCastException in AbstractSet.equals() and AbstractMap.equals()
methods (as TreeSet and TreeMap do not override them). I'll provide the patch soon.


> [classlib][luni] Fresh install of jedit 4.3pre6 doesn't start - throws exception
> --------------------------------------------------------------------------------
>
>                 Key: HARMONY-1639
>                 URL: https://issues.apache.org/jira/browse/HARMONY-1639
>             Project: Harmony
>          Issue Type: Bug
>          Components: App-Oriented Bug Reports, Classlib
>         Environment: winXP and ubuntu 6,  snapshot r450941, jedit 4.3pre6 fresh install
on both platforms
>            Reporter: Geir Magnusson Jr
>
> Do the install.  Run java -jar jedit.jar.  Splash screen comes up, progress bar gets
to completion, and then : 
> C:\Program Files\jEdit 4.3pre6>java -jar jedit.jar
> [error] AWT-EventDispatchThread: java.lang.ClassCastException
> [error] AWT-EventDispatchThread:  at java.util.TreeMap.toComparable(TreeMap.java:77)
> [error] AWT-EventDispatchThread:  at java.util.TreeMap.find(TreeMap.java:905)
> [error] AWT-EventDispatchThread:  at java.util.TreeMap.containsKey(TreeMap.java:823)
> [error] AWT-EventDispatchThread:  at java.util.TreeSet.contains(TreeSet.java:193)
> [error] AWT-EventDispatchThread:  at java.util.AbstractCollection.containsAll(AbstractCollection.java:151)
> [error] AWT-EventDispatchThread:  at java.util.AbstractSet.equals(AbstractSet.java:52)
> [error] AWT-EventDispatchThread:  at java.beans.PropertyChangeSupport.doFirePropertyChange(PropertyChangeSupport.java:30
> 4)
> [error] AWT-EventDispatchThread:  at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:56)
> [error] AWT-EventDispatchThread:  at java.awt.Component.firePropertyChangeImpl(Component.java:1666)
> [error] AWT-EventDispatchThread:  at java.awt.Component.firePropertyChange(Component.java:1680)
> [error] AWT-EventDispatchThread:  at java.awt.Component.setFocusTraversalKeys(Component.java:3047)
> [error] AWT-EventDispatchThread:  at java.awt.Container.setFocusTraversalKeys(Container.java:1037)
> [error] AWT-EventDispatchThread:  at org.gjt.sp.jedit.gui.HistoryTextArea.<init>(HistoryTextArea.java:54)
> [error] AWT-EventDispatchThread:  at org.gjt.sp.jedit.search.SearchDialog.createFindLabelAndField(SearchDialog.java:332)
> [error] AWT-EventDispatchThread:  at org.gjt.sp.jedit.search.SearchDialog.createFieldPanel(SearchDialog.java:410)
> [error] AWT-EventDispatchThread:  at org.gjt.sp.jedit.search.SearchDialog.<init>(SearchDialog.java:306)
> [error] AWT-EventDispatchThread:  at org.gjt.sp.jedit.search.SearchDialog.preloadSearchDialog(SearchDialog.java:78)
> [error] AWT-EventDispatchThread:  at org.gjt.sp.jedit.View.<init>(View.java:1309)
> [error] AWT-EventDispatchThread:  at org.gjt.sp.jedit.jEdit.newView(jEdit.java:2138)
> [error] AWT-EventDispatchThread:  at org.gjt.sp.jedit.PerspectiveManager$PerspectiveHandler.endElement(PerspectiveManage
> r.java:326)
> [error] AWT-EventDispatchThread:  at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown
Source)
> [error] AWT-EventDispatchThread:  at org.apache.xerces.impl.dtd.XMLNSDTDValidator.endNamespaceScope(Unknown
Source)
> [error] AWT-EventDispatchThread:  at org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(Unknown
Source)
> [error] AWT-EventDispatchThread:  at org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(Unknown
Source)
> [error] AWT-EventDispatchThread:  at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown
Source)
> [error] AWT-EventDispatchThread:  at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dis
> patch(Unknown Source)
> [error] AWT-EventDispatchThread:  at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
> [error] AWT-EventDispatchThread:  at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
> [error] AWT-EventDispatchThread:  at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
> [error] AWT-EventDispatchThread:  at org.apache.xerces.parsers.XMLParser.parse(Unknown
Source)
> [error] AWT-EventDispatchThread:  at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
Source)
> [error] AWT-EventDispatchThread:  at org.gjt.sp.util.XMLUtilities.parseXML(XMLUtilities.java:125)
> [error] AWT-EventDispatchThread:  at org.gjt.sp.jedit.PerspectiveManager.loadPerspective(PerspectiveManager.java:104)
> [error] AWT-EventDispatchThread:  at org.gjt.sp.jedit.jEdit$5.run(jEdit.java:3478)
> [error] AWT-EventDispatchThread:  at java.awt.event.InvocationEvent.runAndNotify(InvocationEvent.java:92)
> [error] AWT-EventDispatchThread:  at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:72)
> [error] AWT-EventDispatchThread:  at java.awt.EventQueueCore.dispatchEventImpl(EventQueueCore.java:130)
> [error] AWT-EventDispatchThread:  at java.awt.EventQueue.dispatchEvent(EventQueue.java:143)
> [error] AWT-EventDispatchThread:  at java.awt.EventDispatchThread.runModalLoop(EventDispatchThread.java:73)
> [error] AWT-EventDispatchThread:  at java.awt.EventDispatchThread.run(EventDispatchThread.java:44)
> [error] AWT-EventDispatchThread:  at java.lang.Thread.runImpl(Unknown Source)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message