harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From qi...@apache.org
Subject svn commit: r791082 [8/8] - in /harmony/enhanced/classlib/branches/java6: ./ depends/build/ depends/build/platform/ depends/manifests/asm-3.1/ make/ modules/accessibility/ modules/accessibility/make/ modules/accessibility/src/main/java/javax/accessibil...
Date Sat, 04 Jul 2009 08:38:24 GMT
Modified: harmony/enhanced/classlib/branches/java6/modules/swing/src/main/java/common/org/apache/harmony/x/swing/text/html/cssparser/ParseException.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/swing/src/main/java/common/org/apache/harmony/x/swing/text/html/cssparser/ParseException.java?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/swing/src/main/java/common/org/apache/harmony/x/swing/text/html/cssparser/ParseException.java
(original)
+++ harmony/enhanced/classlib/branches/java6/modules/swing/src/main/java/common/org/apache/harmony/x/swing/text/html/cssparser/ParseException.java
Sat Jul  4 08:38:13 2009
@@ -98,7 +98,7 @@
     if (!specialConstructor) {
       return super.getMessage();
     }
-    StringBuffer expected = new StringBuffer();
+    StringBuilder expected = new StringBuilder();
     int maxSize = 0;
     for (int i = 0; i < expectedTokenSequences.length; i++) {
       if (maxSize < expectedTokenSequences[i].length) {
@@ -145,7 +145,7 @@
    * string literal.
    */
   protected String add_escapes(String str) {
-      StringBuffer retval = new StringBuffer();
+      StringBuilder retval = new StringBuilder();
       char ch;
       for (int i = 0; i < str.length(); i++) {
         switch (str.charAt(i))

Modified: harmony/enhanced/classlib/branches/java6/modules/swing/src/main/java/common/org/apache/harmony/x/swing/text/html/cssparser/TokenMgrError.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/swing/src/main/java/common/org/apache/harmony/x/swing/text/html/cssparser/TokenMgrError.java?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/swing/src/main/java/common/org/apache/harmony/x/swing/text/html/cssparser/TokenMgrError.java
(original)
+++ harmony/enhanced/classlib/branches/java6/modules/swing/src/main/java/common/org/apache/harmony/x/swing/text/html/cssparser/TokenMgrError.java
Sat Jul  4 08:38:13 2009
@@ -39,7 +39,7 @@
     * equivalents in the given string
     */
    protected static final String addEscapes(String str) {
-      StringBuffer retval = new StringBuffer();
+      StringBuilder retval = new StringBuilder();
       char ch;
       for (int i = 0; i < str.length(); i++) {
         switch (str.charAt(i))

Modified: harmony/enhanced/classlib/branches/java6/modules/swing/src/main/java/common/org/apache/harmony/x/swing/text/html/cssparser/TokenResolver.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/swing/src/main/java/common/org/apache/harmony/x/swing/text/html/cssparser/TokenResolver.java?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/swing/src/main/java/common/org/apache/harmony/x/swing/text/html/cssparser/TokenResolver.java
(original)
+++ harmony/enhanced/classlib/branches/java6/modules/swing/src/main/java/common/org/apache/harmony/x/swing/text/html/cssparser/TokenResolver.java
Sat Jul  4 08:38:13 2009
@@ -28,7 +28,7 @@
     }
 
     public static String resolve(final Token start, final Token end, final boolean allowSeparation)
{
-        StringBuffer result = new StringBuffer();
+        StringBuilder result = new StringBuilder();
         Token nextToken = start;
         do {
             if (allowSeparation && result.length() != 0) {

Modified: harmony/enhanced/classlib/branches/java6/modules/swing/src/main/java/common/org/apache/harmony/x/swing/text/html/cssparser/metamodel/RuleSet.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/swing/src/main/java/common/org/apache/harmony/x/swing/text/html/cssparser/metamodel/RuleSet.java?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/swing/src/main/java/common/org/apache/harmony/x/swing/text/html/cssparser/metamodel/RuleSet.java
(original)
+++ harmony/enhanced/classlib/branches/java6/modules/swing/src/main/java/common/org/apache/harmony/x/swing/text/html/cssparser/metamodel/RuleSet.java
Sat Jul  4 08:38:13 2009
@@ -51,7 +51,7 @@
     }
 
     public String toString() {
-        StringBuffer result = new StringBuffer();
+        StringBuilder result = new StringBuilder();
         result.append("\nselectors:")
               .append(selectors)
               .append('\n')

Modified: harmony/enhanced/classlib/branches/java6/modules/swing/src/main/java/common/org/apache/harmony/x/swing/text/html/cssparser/metamodel/Sheet.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/swing/src/main/java/common/org/apache/harmony/x/swing/text/html/cssparser/metamodel/Sheet.java?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/swing/src/main/java/common/org/apache/harmony/x/swing/text/html/cssparser/metamodel/Sheet.java
(original)
+++ harmony/enhanced/classlib/branches/java6/modules/swing/src/main/java/common/org/apache/harmony/x/swing/text/html/cssparser/metamodel/Sheet.java
Sat Jul  4 08:38:13 2009
@@ -63,7 +63,7 @@
 
 
     public String toString() {
-        StringBuffer result = new StringBuffer();
+        StringBuilder result = new StringBuilder();
         result.append("imports:")
               .append(imports)
               .append("\n")

Modified: harmony/enhanced/classlib/branches/java6/modules/swing/src/main/java/common/org/apache/harmony/x/swing/text/rtf/ParseException.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/swing/src/main/java/common/org/apache/harmony/x/swing/text/rtf/ParseException.java?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/swing/src/main/java/common/org/apache/harmony/x/swing/text/rtf/ParseException.java
(original)
+++ harmony/enhanced/classlib/branches/java6/modules/swing/src/main/java/common/org/apache/harmony/x/swing/text/rtf/ParseException.java
Sat Jul  4 08:38:13 2009
@@ -98,7 +98,7 @@
     if (!specialConstructor) {
       return super.getMessage();
     }
-    StringBuffer expected = new StringBuffer();
+    StringBuilder expected = new StringBuilder();
     int maxSize = 0;
     for (int i = 0; i < expectedTokenSequences.length; i++) {
       if (maxSize < expectedTokenSequences[i].length) {
@@ -145,7 +145,7 @@
    * string literal.
    */
   protected String add_escapes(String str) {
-      StringBuffer retval = new StringBuffer();
+      StringBuilder retval = new StringBuilder();
       char ch;
       for (int i = 0; i < str.length(); i++) {
         switch (str.charAt(i))

Modified: harmony/enhanced/classlib/branches/java6/modules/swing/src/main/java/common/org/apache/harmony/x/swing/text/rtf/RTFParser.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/swing/src/main/java/common/org/apache/harmony/x/swing/text/rtf/RTFParser.java?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/swing/src/main/java/common/org/apache/harmony/x/swing/text/rtf/RTFParser.java
(original)
+++ harmony/enhanced/classlib/branches/java6/modules/swing/src/main/java/common/org/apache/harmony/x/swing/text/rtf/RTFParser.java
Sat Jul  4 08:38:13 2009
@@ -95,7 +95,7 @@
   byte[] bytes;
   String text;
   ByteArrayOutputStream textBytes = new ByteArrayOutputStream();
-  StringBuffer parsedText = new StringBuffer();
+  StringBuilder parsedText = new StringBuilder();
     label_1:
     while (true) {
       switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
@@ -220,7 +220,7 @@
 
   final public String parseUnicodeText() throws ParseException {
   int param;
-  StringBuffer unicodeBuffer = new StringBuffer();
+  StringBuilder unicodeBuffer = new StringBuilder();
     label_3:
     while (true) {
       jj_consume_token(U);

Modified: harmony/enhanced/classlib/branches/java6/modules/swing/src/main/java/common/org/apache/harmony/x/swing/text/rtf/TokenMgrError.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/swing/src/main/java/common/org/apache/harmony/x/swing/text/rtf/TokenMgrError.java?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/swing/src/main/java/common/org/apache/harmony/x/swing/text/rtf/TokenMgrError.java
(original)
+++ harmony/enhanced/classlib/branches/java6/modules/swing/src/main/java/common/org/apache/harmony/x/swing/text/rtf/TokenMgrError.java
Sat Jul  4 08:38:13 2009
@@ -38,7 +38,7 @@
     * equivalents in the given string
     */
    protected static final String addEscapes(String str) {
-      StringBuffer retval = new StringBuffer();
+      StringBuilder retval = new StringBuilder();
       char ch;
       for (int i = 0; i < str.length(); i++) {
         switch (str.charAt(i))

Propchange: harmony/enhanced/classlib/branches/java6/modules/swing/src/test/api/java.injected/javax/swing/BasicSwingTestCase.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Jul  4 08:38:13 2009
@@ -1 +1 @@
-/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java.injected/javax/swing/BasicSwingTestCase.java:768152-785553
+/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java.injected/javax/swing/BasicSwingTestCase.java:768152-790471

Propchange: harmony/enhanced/classlib/branches/java6/modules/swing/src/test/api/java.injected/javax/swing/SwingTestCase.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Jul  4 08:38:13 2009
@@ -1 +1 @@
-/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java.injected/javax/swing/SwingTestCase.java:768152-785553
+/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java.injected/javax/swing/SwingTestCase.java:768152-790471

Modified: harmony/enhanced/classlib/branches/java6/modules/swing/src/test/api/java.injected/javax/swing/text/ComponentViewTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/swing/src/test/api/java.injected/javax/swing/text/ComponentViewTest.java?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/swing/src/test/api/java.injected/javax/swing/text/ComponentViewTest.java
(original)
+++ harmony/enhanced/classlib/branches/java6/modules/swing/src/test/api/java.injected/javax/swing/text/ComponentViewTest.java
Sat Jul  4 08:38:13 2009
@@ -33,6 +33,10 @@
 import javax.swing.JTextArea;
 import javax.swing.JTextPane;
 import javax.swing.SwingTestCase;
+import javax.swing.text.Element;
+import javax.swing.text.PlainDocument;
+import javax.swing.text.PlainView;
+
 
 public class ComponentViewTest extends SwingTestCase {
     StyledDocument document;
@@ -649,6 +653,47 @@
         }
     }
 
+    public void testSetParent_View() {
+        // Regression test for HARMONY-1767 
+        PlainDocument doc = new PlainDocument();
+        Element e = doc.getDefaultRootElement();
+        ComponentView obj = new ComponentView(new TestElement());
+        obj.setParent(new PlainView(e));
+    }  
+
+    private static class TestElement implements Element {
+        public boolean isLeaf() {
+            return false;
+        }
+        public Element getElement(int index) {
+            return null;
+        }
+        public int getElementCount() {
+            return 0;
+        }
+        public int getElementIndex(int offset) {
+            return 0;
+        }
+        public int getEndOffset() {
+            return 0;
+        }       
+        public int getStartOffset() {
+            return 0;
+        }       
+        public AttributeSet getAttributes() {
+            return null;
+        }
+        public String getName() {
+            return "AA";
+        }
+        public Element getParentElement() {
+            return null;
+        }
+        public Document getDocument() {
+            return null;
+        }
+    }
+
     private void checkBounds(final int x, final int y, final int height, final Shape box)
{
         Rectangle bounds = box.getBounds();
         assertEquals(x, bounds.x);
@@ -688,4 +733,4 @@
             assertEquals(position, componentElement.getStartOffset());
         }
     }
-}
\ No newline at end of file
+}

Modified: harmony/enhanced/classlib/branches/java6/modules/swing/src/test/api/java.injected/javax/swing/text/StyleConstantsTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/swing/src/test/api/java.injected/javax/swing/text/StyleConstantsTest.java?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/swing/src/test/api/java.injected/javax/swing/text/StyleConstantsTest.java
(original)
+++ harmony/enhanced/classlib/branches/java6/modules/swing/src/test/api/java.injected/javax/swing/text/StyleConstantsTest.java
Sat Jul  4 08:38:13 2009
@@ -20,12 +20,15 @@
  */
 package javax.swing.text;
 
-import junit.framework.TestCase;
 import java.awt.Color;
 import java.awt.Component;
 import java.awt.Graphics;
+
 import javax.swing.Icon;
 import javax.swing.JLabel;
+import javax.swing.SwingUtilities;
+
+import junit.framework.TestCase;
 
 public class StyleConstantsTest extends TestCase {
     protected StyleConstants sc;
@@ -34,6 +37,8 @@
 
     String message = "Test for StyleConstants";
 
+    private Component component;
+
     @Override
     protected void setUp() throws Exception {
         super.setUp();
@@ -427,22 +432,40 @@
         assertEquals("component", StyleConstants.ComponentAttribute.toString());
     }
 
-    public void testGetComponent() {
+    public void testGetComponent() throws Exception {
         assertNull(StyleConstants.getComponent(SimpleAttributeSet.EMPTY));
-        Component val = new JLabel("test component");
-        putAttribute(StyleConstants.ComponentAttribute, val);
-        assertEquals(val, StyleConstants.getComponent(attr));
-    }
-
-    public void testSetComponent() {
-        attr.removeAttributes(attr);
-        Component val = new JLabel("test component");
-        StyleConstants.setComponent(attr, val);
-        assertEquals(AbstractDocument.ElementNameAttribute + "=component component=" + val
-                + " ", attr.toString());
-        assertEquals(val, attr.getAttribute(StyleConstants.ComponentAttribute));
-        assertEquals(StyleConstants.ComponentElementName, attr
-                .getAttribute(AbstractDocument.ElementNameAttribute));
+        SwingUtilities.invokeAndWait(new Runnable() {
+                public void run() {
+                    component = new JLabel("test component");
+                }
+            });
+        putAttribute(StyleConstants.ComponentAttribute, component);
+        assertEquals(component, StyleConstants.getComponent(attr));
+    }
+
+    public void testGetComponent_Null() {
+        // Regression test for HARMONY-1767
+        try {
+            StyleConstants.getComponent(null);
+            fail("NullPointerException should be thrown");
+        } catch (NullPointerException e) {
+            // expected
+        }
+    }
+
+    public void testSetComponent() throws Exception {
+        attr.removeAttributes(attr);
+        SwingUtilities.invokeAndWait(new Runnable() {
+                public void run() {
+                    component = new JLabel("test component");
+                }
+            });
+        StyleConstants.setComponent(attr, component);
+        assertEquals(2, attr.getAttributeCount());
+        assertEquals(component,
+                     attr.getAttribute(StyleConstants.ComponentAttribute));
+        assertEquals(StyleConstants.ComponentElementName,
+                     attr.getAttribute(AbstractDocument.ElementNameAttribute));
     }
 
     public void testFontFamily() {
@@ -499,8 +522,7 @@
             }
         };
         StyleConstants.setIcon(attr, val);
-        assertEquals(AbstractDocument.ElementNameAttribute + "=icon icon=" + val + " ", attr
-                .toString());
+        assertEquals(2, attr.getAttributeCount());
         assertEquals(val, attr.getAttribute(StyleConstants.IconAttribute));
         assertEquals(StyleConstants.IconElementName, attr
                 .getAttribute(AbstractDocument.ElementNameAttribute));

Propchange: harmony/enhanced/classlib/branches/java6/modules/swing/src/test/api/java.injected/javax/swing/text/parser/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Jul  4 08:38:13 2009
@@ -1 +1 @@
-/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java.injected/javax/swing/text/parser:768152-785553
+/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java.injected/javax/swing/text/parser:768152-790471

Modified: harmony/enhanced/classlib/branches/java6/modules/text/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/text/META-INF/MANIFEST.MF?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/text/META-INF/MANIFEST.MF (original)
+++ harmony/enhanced/classlib/branches/java6/modules/text/META-INF/MANIFEST.MF Sat Jul  4
08:38:13 2009
@@ -14,7 +14,6 @@
 Import-Package: com.ibm.icu.math,
  com.ibm.icu.text,
  com.ibm.icu.util,
- java.awt.font,
  java.io,
  java.lang,
  java.lang.reflect,

Modified: harmony/enhanced/classlib/branches/java6/modules/text/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/text/build.xml?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/text/build.xml (original)
+++ harmony/enhanced/classlib/branches/java6/modules/text/build.xml Sat Jul  4 08:38:13 2009
@@ -23,6 +23,8 @@
     <property name="hy.hdk" location="${basedir}/../../deploy" />
     <import file="${hy.hdk}/build/ant/properties.xml" />
 
+    <property name="tests.output" location="../../build/test_report" />
+
     <!-- set global properties for this build. -->
     <xmlproperty file="make/hyproperties.xml" semanticAttributes="true" />
 
@@ -151,7 +153,7 @@
 
     <target name="run-tests">
 
-        <mkdir dir="${hy.tests.reports}" />
+        <mkdir dir="${tests.output}" />
 
         <property name="test.jre.home" value="${hy.jdk}/jre" />
 
@@ -178,7 +180,7 @@
 
             <formatter type="xml" />
 
-            <batchtest todir="${hy.tests.reports}" haltonfailure="no" >
+            <batchtest todir="${tests.output}" haltonfailure="no" >
 
                 <fileset dir="${hy.text.src.test.java}">
                     <!-- if ${test.case}     -->
@@ -194,12 +196,12 @@
     </target>
 
     <target name="touch-failures-file" if="test.failures">
-        <echo file="${hy.tests.reports}/test.failures"
+        <echo file="${tests.output}/test.failures"
             append="true">text${line.separator}</echo>
     </target>
 
     <target name="touch-errors-file" if="test.errors">
-        <echo file="${hy.tests.reports}/test.errors"
+        <echo file="${tests.output}/test.errors"
             append="true">text${line.separator}</echo>
     </target>
 

Modified: harmony/enhanced/classlib/branches/java6/modules/text/make/hyproperties.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/text/make/hyproperties.xml?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/text/make/hyproperties.xml (original)
+++ harmony/enhanced/classlib/branches/java6/modules/text/make/hyproperties.xml Sat Jul  4
08:38:13 2009
@@ -42,10 +42,4 @@
    <jdk location="../../deploy/jdk" />
    <build location="../../build/classes" />
 
-   <tests>
-      <reports location="../../build/test_report" />
-      <support>
-          <bin location="../../build/tests" />
-      </support>
-   </tests>
 </hy>

Modified: harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/AttributedString.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/AttributedString.java?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/AttributedString.java
(original)
+++ harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/AttributedString.java
Sat Jul  4 08:38:13 2009
@@ -392,7 +392,7 @@
             // text.0A=Invalid substring range
             throw new IllegalArgumentException(Messages.getString("text.0A")); //$NON-NLS-1$
         }
-        StringBuffer buffer = new StringBuffer();
+        StringBuilder buffer = new StringBuilder();
         for (int i = iterator.getBeginIndex(); i < iterator.getEndIndex(); i++) {
             buffer.append(iterator.current());
             iterator.next();
@@ -433,7 +433,7 @@
             return;
         }
 
-        StringBuffer buffer = new StringBuffer();
+        StringBuilder buffer = new StringBuilder();
         iterator.setIndex(start);
         while (iterator.getIndex() < end) {
             buffer.append(iterator.current());

Modified: harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/ChoiceFormat.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/ChoiceFormat.java?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/ChoiceFormat.java
(original)
+++ harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/ChoiceFormat.java
Sat Jul  4 08:38:13 2009
@@ -446,7 +446,7 @@
      * @return the pattern.
      */
     public String toPattern() {
-        StringBuffer buffer = new StringBuffer();
+        StringBuilder buffer = new StringBuilder();
         for (int i = 0; i < choiceLimits.length; i++) {
             if (i != 0) {
                 buffer.append('|');

Modified: harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/DateFormatSymbols.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/DateFormatSymbols.java?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/DateFormatSymbols.java
(original)
+++ harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/DateFormatSymbols.java
Sat Jul  4 08:38:13 2009
@@ -100,7 +100,20 @@
      *            the locale.
      */
     public DateFormatSymbols(Locale locale) {
-        icuSymbols = new com.ibm.icu.text.DateFormatSymbols(locale);
+        this(locale, new com.ibm.icu.text.DateFormatSymbols(locale));
+    }
+
+    private void writeObject(ObjectOutputStream oos) throws IOException {
+        if (zoneStrings == null) {
+            zoneStrings = icuSymbols.getZoneStrings();
+        }
+        oos.defaultWriteObject();
+    }
+
+    DateFormatSymbols(Locale locale,
+            com.ibm.icu.text.DateFormatSymbols icuSymbols) {
+
+        this.icuSymbols = icuSymbols;
         localPatternChars = icuSymbols.getLocalPatternChars();
         ampms = icuSymbols.getAmPmStrings();
         eras = icuSymbols.getEras();
@@ -201,13 +214,6 @@
 
     }
 
-    private void writeObject(ObjectOutputStream oos) throws IOException {
-        if (zoneStrings == null) {
-            zoneStrings = icuSymbols.getZoneStrings();
-        }
-        oos.defaultWriteObject();
-    }
-
     @Override
     public Object clone() {
         if (zoneStrings == null) {

Modified: harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/DecimalFormat.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/DecimalFormat.java?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/DecimalFormat.java
(original)
+++ harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/DecimalFormat.java
Sat Jul  4 08:38:13 2009
@@ -606,7 +606,7 @@
      */
     public DecimalFormat(String pattern, DecimalFormatSymbols value) {
         symbols = (DecimalFormatSymbols) value.clone();
-        Locale locale = symbols.getLocale(); //$NON-NLS-1$
+        Locale locale = symbols.getLocale();
         icuSymbols = new com.ibm.icu.text.DecimalFormatSymbols(locale);
         copySymbols(icuSymbols, symbols);
 
@@ -618,6 +618,17 @@
         super.setMinimumIntegerDigits(dform.getMinimumIntegerDigits());
     }
 
+    DecimalFormat(String pattern, DecimalFormatSymbols value, com.ibm.icu.text.DecimalFormat
icuFormat) {
+        symbols = value;
+        icuSymbols = value.getIcuSymbols();
+        dform = icuFormat;
+
+        super.setMaximumFractionDigits(dform.getMaximumFractionDigits());
+        super.setMaximumIntegerDigits(dform.getMaximumIntegerDigits());
+        super.setMinimumFractionDigits(dform.getMinimumFractionDigits());
+        super.setMinimumIntegerDigits(dform.getMinimumIntegerDigits());
+    }
+
     /**
      * Changes the pattern of this decimal format to the specified pattern which
      * uses localized pattern characters.
@@ -1385,7 +1396,7 @@
             final DecimalFormatSymbols dfs) {
         Currency currency = dfs.getCurrency();
         if (currency == null) {
-            icu.setCurrency(com.ibm.icu.util.Currency.getInstance("XXX"));
+            icu.setCurrency(com.ibm.icu.util.Currency.getInstance("XXX")); //$NON-NLS-1$
         } else {
             icu.setCurrency(com.ibm.icu.util.Currency.getInstance(dfs
                     .getCurrency().getCurrencyCode()));

Modified: harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/DecimalFormatSymbols.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/DecimalFormatSymbols.java?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/DecimalFormatSymbols.java
(original)
+++ harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/DecimalFormatSymbols.java
Sat Jul  4 08:38:13 2009
@@ -87,8 +87,14 @@
      *            the locale.
      */
     public DecimalFormatSymbols(Locale locale) {
-        com.ibm.icu.text.DecimalFormatSymbols icuSymbols = new com.ibm.icu.text.DecimalFormatSymbols(
-                locale);
+        this(locale, new com.ibm.icu.text.DecimalFormatSymbols(locale));
+    }
+
+    transient private com.ibm.icu.text.DecimalFormatSymbols icuSymbols;
+
+    DecimalFormatSymbols(Locale locale,
+            com.ibm.icu.text.DecimalFormatSymbols icuSymbols) {
+        this.icuSymbols = icuSymbols;
         infinity = icuSymbols.getInfinity();
         NaN = icuSymbols.getNaN();
         this.locale = locale;
@@ -96,7 +102,7 @@
         intlCurrencySymbol = icuSymbols.getInternationalCurrencySymbol();
         exponentialSeparator = icuSymbols.getExponentSeparator();
         if (locale.getCountry().length() == 0) {
-            currency = Currency.getInstance("XXX");
+            currency = Currency.getInstance("XXX"); //$NON-NLS-1$
         } else {
             currency = Currency.getInstance(locale);
         }
@@ -115,6 +121,7 @@
 
     }
 
+ 
     /**
      * Get all locales which <code>getInstance(Locale)</code> method support
      * to return localize instance. The returned array locales include Java
@@ -691,4 +698,8 @@
     Locale getLocale() {
         return locale;
     }
+
+    com.ibm.icu.text.DecimalFormatSymbols getIcuSymbols() {
+        return icuSymbols;
+    }
 }

Modified: harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/MessageFormat.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/MessageFormat.java?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/MessageFormat.java
(original)
+++ harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/MessageFormat.java
Sat Jul  4 08:38:13 2009
@@ -1255,7 +1255,7 @@
         int offset = 0;
         int offsetsLength = maxOffset + 1;
         int[] offsets = new int[offsetsLength];
-        StringBuffer pattern = new StringBuffer();
+        StringBuilder pattern = new StringBuilder();
         for (int i = 0; i <= maxOffset; i++) {
             offset += strings[i].length();
             offsets[i] = offset;

Modified: harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/NumberFormat.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/NumberFormat.java?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/NumberFormat.java
(original)
+++ harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/NumberFormat.java
Sat Jul  4 08:38:13 2009
@@ -470,7 +470,7 @@
         com.ibm.icu.text.DecimalFormat icuFormat = (com.ibm.icu.text.DecimalFormat) com.ibm.icu.text.NumberFormat
                 .getNumberInstance(locale);
         String pattern = icuFormat.toPattern();
-        return new DecimalFormat(pattern, new DecimalFormatSymbols(locale));
+        return new DecimalFormat(pattern, new DecimalFormatSymbols(locale, icuFormat.getDecimalFormatSymbols()),
icuFormat);
     }
 
     /**

Modified: harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/SimpleDateFormat.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/SimpleDateFormat.java?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/SimpleDateFormat.java
(original)
+++ harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/SimpleDateFormat.java
Sat Jul  4 08:38:13 2009
@@ -328,7 +328,7 @@
         this(Locale.getDefault());
         icuFormat = new com.ibm.icu.text.SimpleDateFormat();
         icuFormat.setTimeZone(com.ibm.icu.util.TimeZone.getTimeZone(tzId));
-        pattern = (String)getInternalField("pattern",icuFormat);
+        pattern = (String)getInternalField("pattern", icuFormat); //$NON-NLS-1$
         formatData = new DateFormatSymbols(Locale.getDefault());
     }
 
@@ -482,14 +482,14 @@
         icuFormat = new com.ibm.icu.text.SimpleDateFormat(template, locale);
         icuFormat.setTimeZone(com.ibm.icu.util.TimeZone.getTimeZone(tzId));
         pattern = template;
-        formatData = new DateFormatSymbols(locale);
+        formatData = new DateFormatSymbols(locale, icuFormat.getDateFormatSymbols());
     }
 
     SimpleDateFormat(Locale locale, com.ibm.icu.text.SimpleDateFormat icuFormat){
         this(locale);
         this.icuFormat = icuFormat;
         this.icuFormat.setTimeZone(com.ibm.icu.util.TimeZone.getTimeZone(tzId));
-        pattern = (String)Format.getInternalField("pattern", icuFormat);
+        pattern = (String)Format.getInternalField("pattern", icuFormat); //$NON-NLS-1$
         formatData = new DateFormatSymbols(locale);
     }
     
@@ -527,7 +527,6 @@
      * @throws IllegalArgumentException
      *                if the pattern is invalid.
      */
-    @SuppressWarnings("nls")
     public void applyPattern(String template) {
         validatePattern(template);
         /*

Modified: harmony/enhanced/classlib/branches/java6/modules/x-net/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/x-net/build.xml?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/x-net/build.xml (original)
+++ harmony/enhanced/classlib/branches/java6/modules/x-net/build.xml Sat Jul  4 08:38:13 2009
@@ -23,6 +23,8 @@
     <property name="hy.hdk" location="${basedir}/../../deploy" />
     <import file="${hy.hdk}/build/ant/properties.xml" />
 
+    <property name="tests.output" location="../../build/test_report" />
+
     <!-- set global properties for this build. -->
     <xmlproperty file="make/hyproperties.xml" semanticAttributes="true" />
 
@@ -174,7 +176,7 @@
                     <pathelement path="../../build/tests" />
                 </classpath>
 
-                <batchtest todir="${hy.tests.reports}" haltonfailure="no" >
+                <batchtest todir="${tests.output}" haltonfailure="no" >
                     <fileset dir="${hy.x-net.src.test}/api/java">
                         <!-- if ${test.case}     -->
                         <include name="${converted.tc}" if="test.case" />
@@ -199,7 +201,7 @@
                     <pathelement path="${hy.hdk}/build/test/support.jar" />
                 </classpath>
                 
-                <batchtest todir="${hy.tests.reports}" haltonfailure="no" >
+                <batchtest todir="${tests.output}" haltonfailure="no" >
                     <fileset dir="${hy.x-net.src.test}/impl/java">
                         <!-- if ${test.case}     -->
                         <include name="${converted.tc}" if="test.case" />
@@ -216,7 +218,7 @@
                 <!-- to pick up junit.jar               -->
                 <jvmarg value="-Xbootclasspath/a:${hy.x-net.bin.test}/impl.injected${path.separator}../../${junit.jar}${path.separator}../../build/tests${path.separator}${hy.hdk}/build/test/support.jar"/>
 
-                <batchtest todir="${hy.tests.reports}" haltonfailure="no" >
+                <batchtest todir="${tests.output}" haltonfailure="no" >
                     <fileset dir="${hy.x-net.src.test}/impl/java.injected">
                         <!-- if ${test.case}     -->
                         <include name="${converted.tc}" if="test.case" />
@@ -234,12 +236,12 @@
     </target>
 
     <target name="touch-failures-file" if="test.failures">
-        <echo file="${hy.tests.reports}/test.failures"
+        <echo file="${tests.output}/test.failures"
             append="true">x-net${line.separator}</echo>
     </target>
 
     <target name="touch-errors-file" if="test.errors">
-        <echo file="${hy.tests.reports}/test.errors"
+        <echo file="${tests.output}/test.errors"
             append="true">x-net${line.separator}</echo>
     </target>
     
@@ -280,7 +282,7 @@
         <sequential>
             <echo message="Running X-NET @{description}" />
 
-            <mkdir dir="${hy.tests.reports}" />
+            <mkdir dir="${tests.output}" />
 
             <property name="test.jre.home" value="${hy.jdk}/jre" />
 

Modified: harmony/enhanced/classlib/branches/java6/modules/x-net/make/hyproperties.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/x-net/make/hyproperties.xml?rev=791082&r1=791081&r2=791082&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/x-net/make/hyproperties.xml (original)
+++ harmony/enhanced/classlib/branches/java6/modules/x-net/make/hyproperties.xml Sat Jul 
4 08:38:13 2009
@@ -41,7 +41,4 @@
    <jdk location="../../deploy/jdk" />
    <build location="../../build/classes" />
 
-   <tests>
-      <reports location="../../build/test_report" />
-   </tests>
 </hy>



Mime
View raw message