incubator-odf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From svanteschub...@apache.org
Subject svn commit: r1310096 - in /incubator/odf/trunk: generator/schema2template/src/main/resources/examples/odf/odfdom-java/dom/java-odfdom-stylefamily.vm odfdom/src/main/java/org/odftoolkit/odfdom/dom/style/OdfStyleFamily.java validator/pom.xml
Date Thu, 05 Apr 2012 22:03:31 GMT
Author: svanteschubert
Date: Thu Apr  5 22:03:31 2012
New Revision: 1310096

URL: http://svn.apache.org/viewvc?rev=1310096&view=rev
Log:
#ODFTOOLKIT-299# Fix for JDK 7: TreeSet workaround for StyleFamily [Developer:svanteschubert]

Modified:
    incubator/odf/trunk/generator/schema2template/src/main/resources/examples/odf/odfdom-java/dom/java-odfdom-stylefamily.vm
    incubator/odf/trunk/odfdom/src/main/java/org/odftoolkit/odfdom/dom/style/OdfStyleFamily.java
    incubator/odf/trunk/validator/pom.xml

Modified: incubator/odf/trunk/generator/schema2template/src/main/resources/examples/odf/odfdom-java/dom/java-odfdom-stylefamily.vm
URL: http://svn.apache.org/viewvc/incubator/odf/trunk/generator/schema2template/src/main/resources/examples/odf/odfdom-java/dom/java-odfdom-stylefamily.vm?rev=1310096&r1=1310095&r2=1310096&view=diff
==============================================================================
--- incubator/odf/trunk/generator/schema2template/src/main/resources/examples/odf/odfdom-java/dom/java-odfdom-stylefamily.vm
(original)
+++ incubator/odf/trunk/generator/schema2template/src/main/resources/examples/odf/odfdom-java/dom/java-odfdom-stylefamily.vm
Thu Apr  5 22:03:31 2012
@@ -33,7 +33,8 @@
  */
 package org.odftoolkit.odfdom.dom.style;
 
-import org.odftoolkit.odfdom.dom.attribute.style.StyleFamilyAttribute;
+import java.util.Arrays;
+import java.util.Collections;
 import org.odftoolkit.odfdom.dom.style.props.OdfStyleProperty;
 import java.util.Set;
 import java.util.TreeSet;
@@ -48,8 +49,6 @@ import org.odftoolkit.odfdom.dom.element
 
 public class OdfStyleFamily implements Comparable<OdfStyleFamily> {
 
-	private String m_name;
-//    private Class m_styleClass;
 	private Set<OdfStyleProperty> m_properties = new TreeSet<OdfStyleProperty>();
 	private static Map<String, OdfStyleFamily> m_familyByName = new HashMap<String,
OdfStyleFamily>();
 
@@ -57,15 +56,17 @@ public class OdfStyleFamily implements C
 		return m_familyByName.get(name);
 	}
 
-	private OdfStyleFamily(String name /*, Class styleClass*/, OdfStyleProperty[] props) {
+	private OdfStyleFamily(String name, OdfStyleProperty[] props) {
 		m_name = name;
-//        m_styleClass = styleClass;
-		for (OdfStyleProperty prop : props) {
-			m_properties.add(prop);
-		}
+		m_properties.addAll(Arrays.asList(props));
 		m_familyByName.put(name, this);
 	}
 
+	private OdfStyleFamily(String name) {
+		m_name = name;
+		m_familyByName.put(name, this);
+	}
+		
 	public String getName() {
 		return m_name;
 	}
@@ -76,17 +77,19 @@ public class OdfStyleFamily implements C
 
 	public static OdfStyleFamily valueOf(String name) {
 		OdfStyleFamily family = getByName(name);
-		if (family == null)
-			family = new OdfStyleFamily(name,  new OdfStyleProperty[]{ null });
-
+		if (family == null) {
+			family = new OdfStyleFamily(name);
+		} 
 		return family;
 	}
 
 	public static String toString(OdfStyleFamily family) {
-		if (family != null)
+		if (family != null) {
 			return family.toString();
-		else
+		}
+		else {
 			return new String();
+		}
 	}
 
 	@Override
@@ -95,7 +98,7 @@ public class OdfStyleFamily implements C
 	}
 
 	public Set<OdfStyleProperty> getProperties() {
-		return m_properties;
+		return Collections.unmodifiableSet(m_properties);
 	}
 
 #foreach ($family in ${odfmodel.getStyleFamilies()})

Modified: incubator/odf/trunk/odfdom/src/main/java/org/odftoolkit/odfdom/dom/style/OdfStyleFamily.java
URL: http://svn.apache.org/viewvc/incubator/odf/trunk/odfdom/src/main/java/org/odftoolkit/odfdom/dom/style/OdfStyleFamily.java?rev=1310096&r1=1310095&r2=1310096&view=diff
==============================================================================
--- incubator/odf/trunk/odfdom/src/main/java/org/odftoolkit/odfdom/dom/style/OdfStyleFamily.java
(original)
+++ incubator/odf/trunk/odfdom/src/main/java/org/odftoolkit/odfdom/dom/style/OdfStyleFamily.java
Thu Apr  5 22:03:31 2012
@@ -26,7 +26,8 @@
  */
 package org.odftoolkit.odfdom.dom.style;
 
-import org.odftoolkit.odfdom.dom.attribute.style.StyleFamilyAttribute;
+import java.util.Arrays;
+import java.util.Collections;
 import org.odftoolkit.odfdom.dom.style.props.OdfStyleProperty;
 import java.util.Set;
 import java.util.TreeSet;
@@ -50,7 +51,6 @@ import org.odftoolkit.odfdom.dom.element
 public class OdfStyleFamily implements Comparable<OdfStyleFamily> {
 
 	private String m_name;
-//    private Class m_styleClass;
 	private Set<OdfStyleProperty> m_properties = new TreeSet<OdfStyleProperty>();
 	private static Map<String, OdfStyleFamily> m_familyByName = new HashMap<String,
OdfStyleFamily>();
 
@@ -58,15 +58,17 @@ public class OdfStyleFamily implements C
 		return m_familyByName.get(name);
 	}
 
-	private OdfStyleFamily(String name /*, Class styleClass*/, OdfStyleProperty[] props) {
+	private OdfStyleFamily(String name, OdfStyleProperty[] props) {
 		m_name = name;
-//        m_styleClass = styleClass;
-		for (OdfStyleProperty prop : props) {
-			m_properties.add(prop);
-		}
+		m_properties.addAll(Arrays.asList(props));
 		m_familyByName.put(name, this);
 	}
 
+	private OdfStyleFamily(String name) {
+		m_name = name;
+		m_familyByName.put(name, this);
+	}
+		
 	public String getName() {
 		return m_name;
 	}
@@ -77,17 +79,19 @@ public class OdfStyleFamily implements C
 
 	public static OdfStyleFamily valueOf(String name) {
 		OdfStyleFamily family = getByName(name);
-		if (family == null)
-			family = new OdfStyleFamily(name,  new OdfStyleProperty[]{ null });
-
+		if (family == null) {
+			family = new OdfStyleFamily(name);
+		} 
 		return family;
 	}
 
 	public static String toString(OdfStyleFamily family) {
-		if (family != null)
+		if (family != null) {
 			return family.toString();
-		else
+		}
+		else {
 			return new String();
+		}
 	}
 
 	@Override
@@ -96,7 +100,7 @@ public class OdfStyleFamily implements C
 	}
 
 	public Set<OdfStyleProperty> getProperties() {
-		return m_properties;
+		return Collections.unmodifiableSet(m_properties);
 	}
 
 	public final static OdfStyleFamily Chart = new OdfStyleFamily("chart",

Modified: incubator/odf/trunk/validator/pom.xml
URL: http://svn.apache.org/viewvc/incubator/odf/trunk/validator/pom.xml?rev=1310096&r1=1310095&r2=1310096&view=diff
==============================================================================
--- incubator/odf/trunk/validator/pom.xml (original)
+++ incubator/odf/trunk/validator/pom.xml Thu Apr  5 22:03:31 2012
@@ -46,7 +46,6 @@
     <properties>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
         <maven.build.timestamp.format>yyyy-MM-dd'T'HH:mm:ss</maven.build.timestamp.format>
-        <netbeans.hint.deploy.server>Tomcat</netbeans.hint.deploy.server>
     </properties>
 
     <!-- Build Settings -->



Mime
View raw message