apply license info for added source files
diff --git a/pom.xml b/pom.xml
index 7a5b76f..44ef90b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -39,8 +39,9 @@
<email>py4fun@gmail.com</email>
</developer>
<developer>
- <id>alexander.maslov</id>
+ <id>maslovalex</id><>
<name>Alexander Maslov</name>
+ <email>alexander.maslov@gmail.com</email>
</developer>
</developers>
<dependencies>
@@ -180,8 +181,9 @@
</configuration>
<executions>
<execution>
+ <phase>site</phase>
<goals>
- <goal>check</goal>
+ <goal>format</goal>
</goals>
</execution>
</executions>
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index fb8aec2..6e18dfb 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -7,6 +7,9 @@
</properties>
<body>
<release version="1.7" date="in Mercurial" description="development">
+ <action dev="maslovalex" type="update">
+ Fix generic collections which contain other collections (2010-05-18)
+ </action>
<action dev="py4fun" type="fix" issue="67" due-to="Manuel Sugawara">
Fix: java classes containing non-ASCII characters in names are
incorrectly encoded (2010-05-14)
@@ -313,7 +316,7 @@
<action dev="py4fun" type="fix" issue="5" due-to="infinity0x">
Fix: set the "cause" field for MarkedYAMLException (2009-07-10)
</action>
- <action dev="alexander.maslov" type="fix" issue="1" due-to="alexander.maslov">
+ <action dev="maslovalex" type="fix" issue="1">
Fix: Recursive objects are now fully supported (2009-07-09)
</action>
<action dev="py4fun" type="add">
diff --git a/src/main/java/org/yaml/snakeyaml/introspector/GenericProperty.java b/src/main/java/org/yaml/snakeyaml/introspector/GenericProperty.java
index 6695c15..66341cb 100644
--- a/src/main/java/org/yaml/snakeyaml/introspector/GenericProperty.java
+++ b/src/main/java/org/yaml/snakeyaml/introspector/GenericProperty.java
@@ -1,3 +1,19 @@
+/**
+ * Copyright (c) 2008-2010 Andrey Somov
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package org.yaml.snakeyaml.introspector;
import java.lang.reflect.GenericArrayType;
diff --git a/src/test/java/org/yaml/snakeyaml/generics/ObjectValues.java b/src/test/java/org/yaml/snakeyaml/generics/ObjectValues.java
index b35f625..453a1b9 100644
--- a/src/test/java/org/yaml/snakeyaml/generics/ObjectValues.java
+++ b/src/test/java/org/yaml/snakeyaml/generics/ObjectValues.java
@@ -1,3 +1,19 @@
+/**
+ * Copyright (c) 2008-2010 Andrey Somov
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package org.yaml.snakeyaml.generics;
import java.util.Map;
diff --git a/src/test/java/org/yaml/snakeyaml/generics/ObjectValuesTest.java b/src/test/java/org/yaml/snakeyaml/generics/ObjectValuesTest.java
index 5ec3c99..10d3204 100644
--- a/src/test/java/org/yaml/snakeyaml/generics/ObjectValuesTest.java
+++ b/src/test/java/org/yaml/snakeyaml/generics/ObjectValuesTest.java
@@ -1,10 +1,26 @@
+/**
+ * Copyright (c) 2008-2010 Andrey Somov
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package org.yaml.snakeyaml.generics;
+import static org.junit.Assert.assertArrayEquals;
+
import java.util.HashMap;
import java.util.Map;
-import static org.junit.Assert.*;
-
import junit.framework.TestCase;
import org.yaml.snakeyaml.JavaBeanDumper;
@@ -26,10 +42,10 @@
values.put(i, name + i);
}
}
-
+
ov.setValues(prop2values);
ov.setPossible(props);
-
+
JavaBeanDumper dumper = new JavaBeanDumper();
String dumpedStr = dumper.dump(ov);
@@ -42,12 +58,13 @@
ov.getPossible()[0] = ov2.getPossible()[0];
}
+ @SuppressWarnings("unchecked")
public void testObjectValuesWithParam() {
- ObjectValuesWithParam<String, Integer> ov = new ObjectValuesWithParam<String,Integer>();
+ ObjectValuesWithParam<String, Integer> ov = new ObjectValuesWithParam<String, Integer>();
Integer obj = new Integer(131313);
ov.setObject(obj);
final Map<String, Map<Integer, Object>> prop2values = new HashMap<String, Map<Integer, Object>>();
-
+
final String[] props = { "prop1", "prop2", "prop3" };
for (String name : props) {
Map<Integer, Object> values = new HashMap<Integer, Object>();
@@ -56,20 +73,27 @@
values.put(i, name + i);
}
}
-
+
ov.setValues(prop2values);
ov.setPossible(props);
-
+
JavaBeanDumper dumper = new JavaBeanDumper();
String dumpedStr = dumper.dump(ov);
- JavaBeanLoader<ObjectValuesWithParam<String,Integer>> loader = new JavaBeanLoader<ObjectValuesWithParam<String, Integer>>(new ObjectValuesWithParam<String, Integer>().getClass());
+ JavaBeanLoader<ObjectValuesWithParam<String, Integer>> loader = new JavaBeanLoader<ObjectValuesWithParam<String, Integer>>(
+ new ObjectValuesWithParam<String, Integer>().getClass());
ObjectValuesWithParam<String, Integer> ov2 = loader.load(dumpedStr);
-
+
assertEquals(ov.getObject(), ov2.getObject());
assertEquals(ov.getValues(), ov2.getValues());
assertArrayEquals(ov.getPossible(), ov2.getPossible());
-// ov.getPossible()[0] = ov2.getPossible()[0]; //TODO: This actually FAILS. Use of GenericArrays is ..... no words.
+ // TODO: This actually FAILS. Use of GenericArrays is ..... no words.
+ // assertEquals(ov.getPossible()[0], ov2.getPossible()[0]);
+ try {
+ ov2.getPossible()[0].toString();
+ } catch (Exception e) {
+ assertEquals("[Ljava.lang.Object; cannot be cast to [Ljava.lang.String;", e
+ .getMessage());
+ }
}
-
}
diff --git a/src/test/java/org/yaml/snakeyaml/generics/ObjectValuesWithParam.java b/src/test/java/org/yaml/snakeyaml/generics/ObjectValuesWithParam.java
index 791c246..bd47418 100644
--- a/src/test/java/org/yaml/snakeyaml/generics/ObjectValuesWithParam.java
+++ b/src/test/java/org/yaml/snakeyaml/generics/ObjectValuesWithParam.java
@@ -1,3 +1,19 @@
+/**
+ * Copyright (c) 2008-2010 Andrey Somov
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package org.yaml.snakeyaml.generics;
import java.util.Map;