Skip to content

Commit 3fa40fa

Browse files
committed
Restructures to move examples to a separate sub-project. Places examples under org.ObjectLayout.examples to facilitate importing into external modules (like benchmarks).
1 parent 2bbb491 commit 3fa40fa

27 files changed

Lines changed: 661 additions & 667 deletions

.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ target
33
out
44
classes
55
gh-pages
6-
ObjectLayout-parent.iml
7-
ObjectLayout.iml
8-
ObjectLayout-benchmarks.iml
6+
*.iml
97
.classpath
108
.project
119
.settings

ObjectLayout-benchmarks/pom.xml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,23 @@
2828
<dependency>
2929
<groupId>org.openjdk.jmh</groupId>
3030
<artifactId>jmh-core</artifactId>
31-
<version>0.9.5</version>
31+
<version>1.10.5</version>
3232
</dependency>
3333
<dependency>
3434
<groupId>org.openjdk.jmh</groupId>
3535
<artifactId>jmh-generator-annprocess</artifactId>
36-
<version>0.9.5</version>
36+
<version>1.10.5</version>
3737
</dependency>
3838
<dependency>
3939
<groupId>org.objectlayout</groupId>
4040
<artifactId>ObjectLayout</artifactId>
4141
<version>${project.version}</version>
4242
</dependency>
43+
<dependency>
44+
<groupId>org.objectlayout</groupId>
45+
<artifactId>ObjectLayout-benchmarks</artifactId>
46+
<version>${project.version}</version>
47+
</dependency>
4348
</dependencies>
4449

4550
<build>

ObjectLayout-benchmarks/src/main/java/bench/ObjectLayoutBench.java

Lines changed: 262 additions & 363 deletions
Large diffs are not rendered by default.

ObjectLayout-examples/pom.xml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<parent>
8+
<groupId>org.objectlayout</groupId>
9+
<artifactId>ObjectLayout-parent</artifactId>
10+
<version>1.0.5-SNAPSHOT</version>
11+
</parent>
12+
13+
<artifactId>ObjectLayout-examples</artifactId>
14+
<name>ObjectLayoutExamples</name>
15+
<packaging>jar</packaging>
16+
17+
<properties>
18+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
19+
</properties>
20+
21+
<dependencies>
22+
<dependency>
23+
<groupId>junit</groupId>
24+
<artifactId>junit</artifactId>
25+
<version>4.10</version>
26+
<scope>test</scope>
27+
</dependency>
28+
<dependency>
29+
<groupId>org.objectlayout</groupId>
30+
<artifactId>ObjectLayout</artifactId>
31+
<version>${project.version}</version>
32+
</dependency>
33+
</dependencies>
34+
35+
<build>
36+
<plugins>
37+
<plugin>
38+
<groupId>org.codehaus.mojo</groupId>
39+
<artifactId>build-helper-maven-plugin</artifactId>
40+
<version>1.7</version>
41+
<executions>
42+
<execution>
43+
<id>add-test-source</id>
44+
<phase>generate-test-sources</phase>
45+
<goals>
46+
<goal>add-test-source</goal>
47+
</goals>
48+
<configuration>
49+
<sources>
50+
<source>src/examples/java</source>
51+
</sources>
52+
</configuration>
53+
</execution>
54+
</executions>
55+
</plugin>
56+
<plugin>
57+
<groupId>org.apache.maven.plugins</groupId>
58+
<artifactId>maven-compiler-plugin</artifactId>
59+
<version>2.3.2</version>
60+
<configuration>
61+
<source>1.7</source>
62+
<target>1.7</target>
63+
<!-- Disable annotation processing for ourselves. -->
64+
<compilerArgument>-proc:none</compilerArgument>
65+
<encoding>UTF-8</encoding>
66+
</configuration>
67+
</plugin>
68+
<plugin>
69+
<groupId>org.apache.maven.plugins</groupId>
70+
<artifactId>maven-surefire-plugin</artifactId>
71+
<version>2.12.4</version>
72+
<configuration>
73+
<argLine>-Xmx1g</argLine>
74+
<enableAssertions>false</enableAssertions>
75+
</configuration>
76+
</plugin>
77+
</plugins>
78+
</build>
79+
80+
</project>

ObjectLayout/src/examples/java/BPlusTree.java renamed to ObjectLayout-examples/src/main/java/org/ObjectLayout/examples/BPlusTree.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
1-
/*
1+
package org.ObjectLayout.examples;/*
22
* Written by Gil Tene, Martin Thompson and Michael Barker, and released
33
* to the public domain, as explained at:
44
* http://creativecommons.org/publicdomain/zero/1.0/
55
*/
66

7-
import java.lang.invoke.MethodHandle;
87
import java.lang.invoke.MethodHandles;
9-
import java.lang.reflect.Constructor;
108
import java.util.Comparator;
119
import java.util.Iterator;
1210
import java.util.Map;
1311
import java.util.NoSuchElementException;
1412

15-
import org.ObjectLayout.CtorAndArgs;
1613
import org.ObjectLayout.ReferenceArray;
1714
import org.ObjectLayout.StructuredArray;
1815

@@ -807,7 +804,7 @@ private static boolean isSplit(Object o) {
807804

808805
@Override
809806
public String toString() {
810-
return "BPlusTree [nodeSize=" + nodeSize + ", comparator=" + comparator
807+
return "org.ObjectLayout.examples.BPlusTree [nodeSize=" + nodeSize + ", comparator=" + comparator
811808
+ ", root=" + root + "]";
812809
}
813810

ObjectLayout/src/examples/java/Line.java renamed to ObjectLayout-examples/src/main/java/org/ObjectLayout/examples/Line.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
1-
/*
1+
package org.ObjectLayout.examples;/*
22
* Written by Gil Tene, and released to the public domain,
33
* as explained at http://creativecommons.org/publicdomain/zero/1.0/
44
*/
55

66
import org.ObjectLayout.Intrinsic;
77
import org.ObjectLayout.IntrinsicObjects;
88

9-
import java.lang.invoke.MethodHandle;
109
import java.lang.invoke.MethodHandles;
1110
import java.lang.reflect.Constructor;
1211

1312
/**
14-
* A simple Line class example with two intrinsic Point end point objects. Demonstrates use of
13+
* A simple org.ObjectLayout.examples.Line class example with two intrinsic org.ObjectLayout.examples.Point end point objects. Demonstrates use of
1514
* {@link org.ObjectLayout.IntrinsicObjectModel}
1615
* members and their initialization, either at field initialization or during construction.
1716
*

ObjectLayout/src/examples/java/MassOrder.java renamed to ObjectLayout-examples/src/main/java/org/ObjectLayout/examples/MassOrder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*
1+
package org.ObjectLayout.examples;/*
22
* Written by Gil Tene, Martin Thompson, and Michael Barker, and released to the public domain,
33
* as explained at http://creativecommons.org/publicdomain/zero/1.0/
44
*/

ObjectLayout/src/examples/java/MassOrderExample.java renamed to ObjectLayout-examples/src/main/java/org/ObjectLayout/examples/MassOrderExample.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*
1+
package org.ObjectLayout.examples;/*
22
* Written by Michael Barker, and released to the public domain,
33
* as explained at http://creativecommons.org/publicdomain/zero/1.0/
44
*/

ObjectLayout/src/examples/java/Octagon.java renamed to ObjectLayout-examples/src/main/java/org/ObjectLayout/examples/Octagon.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*
1+
package org.ObjectLayout.examples;/*
22
* Written by Gil Tene, and released to the public domain,
33
* as explained at http://creativecommons.org/publicdomain/zero/1.0/
44
*/
@@ -10,7 +10,7 @@
1010
import java.lang.invoke.MethodHandles;
1111

1212
/**
13-
* A simple Octagon class example with an intrinsic StructuredArray of Points. Demonstrates use of
13+
* A simple org.ObjectLayout.examples.Octagon class example with an intrinsic StructuredArray of Points. Demonstrates use of
1414
* {@link org.ObjectLayout.IntrinsicObjectModel} members and their initialization, when the
1515
* intrinsic member is a StructuredArray.
1616
*

ObjectLayout/src/examples/java/Octagons.java renamed to ObjectLayout-examples/src/main/java/org/ObjectLayout/examples/Octagons.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*
1+
package org.ObjectLayout.examples;/*
22
* Written by Gil Tene and Martin Thompson, and released to the public domain,
33
* as explained at http://creativecommons.org/publicdomain/zero/1.0/
44
*/

0 commit comments

Comments
 (0)