bug-classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug classpath/26460] New: JEditorPane: small bug, testcase and easy bu


From: asraniel at fryx dot ch
Subject: [Bug classpath/26460] New: JEditorPane: small bug, testcase and easy bugfix included
Date: 24 Feb 2006 19:36:46 -0000

this is the testcase that shows the bug:
import javax.swing.JTextPane;

public class StringTest {
        public static void main(String[] args) {
                JTextPane test = new JTextPane();

                try{
                        test = new JTextPane();
                        test.setText(test.getText());
                        System.out.println("passed 1");
                }catch(Exception e ){
                        System.out.println("error 1");
                        e.printStackTrace();
                }
        }
}


works in the sun vm but not classpath. The reason is in javax.swing.JEditorPane
at line 929:
if (t == null || t == "")
        return;

but should be:

if (t == null || t.equals(""))
        return;

pretty simple error, but has a big inpact.
I did a quick search and found that java.util.Locale at line 550 there is also
this == "" problem. didnt test it, but there is a big chance that this could
lead to a bug.
Here the code of java.util.Locale:
    if (language == "")
      return "";


-- 
           Summary: JEditorPane: small bug, testcase and easy bugfix
                    included
           Product: classpath
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: classpath
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: asraniel at fryx dot ch


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26460





reply via email to

[Prev in Thread] Current Thread [Next in Thread]