Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import java.lang.reflect.Constructor;
import java.util.Arrays;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.List;
Expand Down Expand Up @@ -192,8 +193,8 @@ private Map<String, Class> loadTypeMap() throws ClassNotFoundException {
Organisation.class, Person.class, Contact.class,
PartyRelationship.class, Role.class, Capability.class };

typeMap = new HashMap<String, Class>();
upperCaseMap = new HashMap<String, Class>();
typeMap = new LinkedHashMap<String, Class>();
upperCaseMap = new LinkedHashMap<String, Class>();
for (Class klass : classes) {
String name = klass.getSimpleName();
if (klass.getSimpleName().equalsIgnoreCase("Double")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,8 @@ private Map<String, Class> loadTypeMap() throws ClassNotFoundException {
Organisation.class, Person.class, Contact.class,
PartyRelationship.class, Role.class, Capability.class };

typeMap = new HashMap<String, Class>();
upperCaseMap = new HashMap<String, Class>();
typeMap = new LinkedHashMap<String, Class>();
upperCaseMap = new LinkedHashMap<String, Class>();
for (Class klass : classes) {
String name = klass.getSimpleName();
typeMap.put(name, klass);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,9 @@ public int hashCode() {
.hashCode());
result = prime * result
+ ((otherDetails == null) ? 0 : otherDetails.hashCode());
/* this can cause infinite recursion and a stack overflow
result = prime * result
+ ((parentResource == null) ? 0 : parentResource.hashCode());
+ ((parentResource == null) ? 0 : parentResource.hashCode());*/
result = prime
* result
+ ((resourcePackageUri == null) ? 0 : resourcePackageUri
Expand Down Expand Up @@ -259,8 +260,9 @@ public boolean equals(Object obj) {
if (parentResource == null) {
if (other.parentResource != null)
return false;
} else if (!parentResource.equals(other.parentResource))
return false;
} /* this can cause infinite recursion and a stack overflow
else if (!parentResource.equals(other.parentResource))
return false; */
if (resourcePackageUri == null) {
if (other.resourcePackageUri != null)
return false;
Expand Down Expand Up @@ -298,4 +300,4 @@ public boolean equals(Object obj) {
* License.
*
* ***** END LICENSE BLOCK *****
*/
*/
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,14 @@ public void test() {
TestTerminologyService.getInstance());
rd = new ResourceDescription(hashMap("Sam Heard", "Dr. Sam Heard"),
null, "initial", details(en, purpose), null, null, ar);


AuthoredResource ar2 = new AuthoredResourceImpl(orgLang, null, null, null, false,
TestTerminologyService.getInstance());
ResourceDescription rd2 = new ResourceDescription(hashMap("Sam Heard", "Dr. Sam Heard"),
null, "initial", details(en, purpose), null, null, ar2);
assertEquals(rd, rd2);

ar.toString();
}

public void testFails() {
Expand Down Expand Up @@ -102,7 +109,6 @@ private void failConstructor(HashMap<String, String> orgAuthor, List<String>
}
}
}

/*
* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
Expand Down Expand Up @@ -131,4 +137,4 @@ private void failConstructor(HashMap<String, String> orgAuthor, List<String>
* License.
*
* ***** END LICENSE BLOCK *****
*/
*/
240 changes: 121 additions & 119 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,121 +1,123 @@
<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>openehr</groupId>
<artifactId>ref_impl_java</artifactId>
<packaging>pom</packaging>
<version>1.0.11-SNAPSHOT</version>
<name>The openEHR Reference Java Implementation</name>
<organization>
<name>The openEHR Foundation</name>
</organization>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<scm>
<developerConnection>scm:git:ssh://git@css-cds-3:7999/cds/ref_impl_java.git</developerConnection>
<tag>HEAD</tag>
</scm>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.5</source>
<target>1.5</target>
<compilerArgument />
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9</version>
<configuration>
<doclet>org.umlgraph.doclet.UmlGraphDoc</doclet>
<!-- <docletPath>/path/to/UmlGraph.jar</docletPath> -->
<docletArtifact>
<groupId>org.umlgraph</groupId>
<artifactId>umlgraph</artifactId>
<version>5.6</version>
</docletArtifact>
<additionalparam>
-inferrel -inferdep -quiet -hide java.*
-collpackages java.util.* -qualify
-postfixpackage -nodefontsize 9
-nodefontpackagesize 7
-edgefontname "Trebuchet MS"
-nodefontabstractname "Trebuchet MS"
-nodefontclassabstractname
"Trebuchet MS"
-nodefontclassname "Trebuchet MS"
-nodefontname
"Trebuchet MS"
-nodefontpackagename "Trebuchet MS"
-nodefonttagname
"Trebuchet MS"
</additionalparam>
<useStandardDocletOptions>true</useStandardDocletOptions>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<check />
<formats>
<format>xml</format>
</formats>
</configuration>
</plugin>
<plugin>
<artifactId>maven-source-plugin</artifactId>
<version>2.1.2</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<modules>
<module>openehr-rm-core</module>
<module>openehr-rm-domain</module>
<module>openehr-aom</module>
<module>openehr-ap</module>
<module>adl-parser</module>
<module>dadl-parser</module>
<module>oet-parser</module>
<module>adl-serializer</module>
<module>xml-serializer</module>
<module>measure-serv</module>
<module>mini-termserv</module>
<module>rm-builder</module>
<module>xml-binding</module>
<module>dadl-binding</module>
<module>rm-skeleton</module>
<module>archetype-validator</module>
</modules>
<distributionManagement>
<repository>
<id>repo.cambio.se_releases</id>
<name>releases</name>
<url>http://repo.cambio.se/content/repositories/releases</url>
</repository>
<snapshotRepository>
<id>repo.cambio.se_snapshots</id>
<name>snapshots</name>
<url>http://repo.cambio.se/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>openehr</groupId>
<artifactId>ref_impl_java</artifactId>
<packaging>pom</packaging>
<version>1.0.11-SNAPSHOT</version>
<name>The openEHR Reference Java Implementation</name>
<organization>
<name>The openEHR Foundation</name>
</organization>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<scm>
<developerConnection>scm:git:ssh://git@css-cds-3:7999/cds/ref_impl_java.git</developerConnection>
<tag>HEAD</tag>
</scm>
<build>
<plugins>

<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.5</source>
<target>1.5</target>
<compilerArgument/>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9</version>
<configuration>
<doclet>org.umlgraph.doclet.UmlGraphDoc</doclet>
<!-- <docletPath>/path/to/UmlGraph.jar</docletPath> -->
<docletArtifact>
<groupId>org.umlgraph</groupId>
<artifactId>umlgraph</artifactId>
<version>5.6</version>
</docletArtifact>
<additionalparam>
-inferrel -inferdep -quiet -hide java.*
-collpackages java.util.* -qualify
-postfixpackage -nodefontsize 9
-nodefontpackagesize 7
-edgefontname "Trebuchet MS"
-nodefontabstractname "Trebuchet MS"
-nodefontclassabstractname
"Trebuchet MS"
-nodefontclassname "Trebuchet MS"
-nodefontname
"Trebuchet MS"
-nodefontpackagename "Trebuchet MS"
-nodefonttagname
"Trebuchet MS"
</additionalparam>
<useStandardDocletOptions>true</useStandardDocletOptions>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<check/>
<formats>
<format>xml</format>
</formats>
</configuration>
</plugin>
<plugin>
<artifactId>maven-source-plugin</artifactId>
<version>2.1.2</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<modules>
<module>openehr-rm-core</module>
<module>openehr-rm-domain</module>
<module>openehr-aom</module>
<module>openehr-ap</module>
<module>adl-parser</module>
<module>dadl-parser</module>
<module>oet-parser</module>
<module>adl-serializer</module>
<module>xml-serializer</module>
<module>measure-serv</module>
<module>mini-termserv</module>
<module>rm-builder</module>
<module>xml-binding</module>
<module>dadl-binding</module>
<module>rm-skeleton</module>
<module>archetype-validator</module>
</modules>
<distributionManagement>
<repository>
<id>repo.cambio.se_releases</id>
<name>releases</name>
<url>http://repo.cambio.se/content/repositories/releases</url>
</repository>
<snapshotRepository>
<id>repo.cambio.se_snapshots</id>
<name>snapshots</name>
<url>http://repo.cambio.se/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>
</project>
23 changes: 11 additions & 12 deletions rm-builder/src/main/java/org/openehr/build/RMObjectBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ private Map<String, Class> loadTypeMap() throws ClassNotFoundException {
Organisation.class, Person.class, Contact.class,
PartyRelationship.class, Role.class, Capability.class };

typeMap = new HashMap<String, Class>();
upperCaseMap = new HashMap<String, Class>();
typeMap = new LinkedHashMap<String, Class>();
upperCaseMap = new LinkedHashMap<String, Class>();
for (Class klass : classes) {
String name = klass.getSimpleName();
typeMap.put(name, klass);
Expand Down Expand Up @@ -427,12 +427,7 @@ else if (value != null && value.getClass().equals(Long.class))
ret = constructor.newInstance(valueArray);
} catch (Exception e) {

if (log.isDebugEnabled()) {
e.printStackTrace();
}

log.debug("failed in constructor.newInstance()", e);


if (stringParsingTypes.contains(rmClassName)) {
throw new AttributeFormatException("wrong format for type "
+ rmClassName);
Expand All @@ -441,14 +436,16 @@ else if (value != null && value.getClass().equals(Long.class))
throw new RMObjectBuildingException(
"failed to create new instance of " + rmClassName
+ " with valueMap: " + toString(valueMap) + ", cause: "
+ e.getMessage());
+ e.getMessage(), e);
}
return (RMObject) ret;
}

private String toString(Map<String,Object> map) {
StringBuffer buf = new StringBuffer();
buf.append("\n");
for(String key : map.keySet()) {
buf.append(" ");
buf.append(key);
buf.append("=");
Object value = map.get(key);
Expand All @@ -459,8 +456,10 @@ private String toString(Map<String,Object> map) {
} else {
buf.append("null");
}
buf.append(", ");
}
buf.append(",\n");
}
buf.deleteCharAt(buf.length()-1);
buf.deleteCharAt(buf.length()-1);
return buf.toString();
}

Expand Down Expand Up @@ -708,4 +707,4 @@ private Object defaultValue(Class type) {
* the specific language governing rights and limitations under the License.
*
* ***** END LICENSE BLOCK *****
*/
*/
Loading