Skip to content

Commit 7133b24

Browse files
committed
Minor fixes/improvements
1 parent 43ca531 commit 7133b24

File tree

5 files changed

+30
-28
lines changed

5 files changed

+30
-28
lines changed

lang/src/main/java/net/openhft/lang/collection/impl/HugeArrayImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public HugeArrayImpl(DataValueGenerator valueGenerator, Class<T> tClass, long le
4848

4949
T ref = valueGenerator.nativeInstance(tClass);
5050
size = ((Byteable) ref).maxSize();
51-
store = new DirectStore(null, length * size);
51+
store = new DirectStore(length * size);
5252
((Byteable) ref).bytes(store.createSlice());
5353
recycle(ref);
5454
}

lang/src/main/java/net/openhft/lang/io/DirectStore.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ public class DirectStore {
3030
protected long address;
3131
protected long size;
3232

33+
public DirectStore(long size) {
34+
this(null, size);
35+
}
36+
3337
public DirectStore(BytesMarshallerFactory bytesMarshallerFactory, long size) {
3438
this.bytesMarshallerFactory = bytesMarshallerFactory;
3539
address = NativeBytes.UNSAFE.allocateMemory(size);
@@ -51,7 +55,7 @@ public void run() {
5155

5256
@Nullable
5357
public static DirectStore allocate(long size) {
54-
return new DirectStore(null, size);
58+
return new DirectStore(size);
5559
}
5660

5761
/* public void resize(long newSize) {

lang/src/test/java/net/openhft/lang/io/serialization/RawCopierTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public void testStartEnd() {
5454

5555
@Test
5656
public void testReadWrite() {
57-
DirectStore ds = new DirectStore(null, 1024);
57+
DirectStore ds = new DirectStore(1024);
5858
DirectBytes db = ds.createSlice();
5959
RawCopier<A> aRawCopier = RawCopier.copies(A.class);
6060
A a = new A();

lang/src/test/java/net/openhft/lang/osgi/OSGiBundleTest.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package net.openhft.chronicle.osgi;
17+
package net.openhft.lang.osgi;
1818

1919
import ch.qos.logback.classic.Level;
2020
import ch.qos.logback.classic.Logger;
@@ -47,15 +47,15 @@ public Option[] config() {
4747
root.setLevel(Level.INFO);
4848

4949
return options(
50-
systemProperty("org.osgi.framework.storage.clean").value("true"),
51-
systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("WARN"),
52-
mavenBundle("net.openhft", "compiler", "2.1"),
53-
bundle("reference:file:target/classes"),
54-
junitBundles(),
55-
systemPackage("sun.misc"),
56-
systemPackage("sun.nio.ch"),
57-
systemPackage("com.sun.tools.javac.api"),
58-
cleanCaches()
50+
systemProperty("org.osgi.framework.storage.clean").value("true"),
51+
systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("WARN"),
52+
mavenBundle("net.openhft", "compiler", "2.1"),
53+
mavenBundle("net.openhft", "lang", "6.1"),
54+
junitBundles(),
55+
systemPackage("sun.misc"),
56+
systemPackage("sun.nio.ch"),
57+
systemPackage("com.sun.tools.javac.api"),
58+
cleanCaches()
5959
);
6060
}
6161

lang/src/test/java/net/openhft/lang/osgi/OSGiCollectionTest.java

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,25 +18,23 @@
1818

1919
import ch.qos.logback.classic.Level;
2020
import ch.qos.logback.classic.Logger;
21+
import net.openhft.lang.collection.HugeArray;
22+
import net.openhft.lang.collection.HugeCollections;
23+
import net.openhft.lang.model.JavaBeanInterface;
2124
import org.junit.Test;
2225
import org.junit.runner.RunWith;
2326
import org.ops4j.pax.exam.Configuration;
2427
import org.ops4j.pax.exam.Option;
2528
import org.ops4j.pax.exam.junit.PaxExam;
26-
import org.osgi.framework.Bundle;
2729
import org.osgi.framework.BundleContext;
2830
import org.slf4j.LoggerFactory;
2931

3032
import javax.inject.Inject;
33+
import java.io.File;
3134

3235
import static junit.framework.Assert.assertNotNull;
33-
import static org.junit.Assert.assertTrue;
3436
import static org.ops4j.pax.exam.CoreOptions.*;
3537

36-
import net.openhft.lang.model.JavaBeanInterface;
37-
import net.openhft.lang.collection.HugeArray;
38-
import net.openhft.lang.collection.HugeCollections;
39-
4038
/**
4139
* @author lburgazzoli
4240
*/
@@ -51,15 +49,15 @@ public Option[] config() {
5149
root.setLevel(Level.INFO);
5250

5351
return options(
54-
systemProperty("org.osgi.framework.storage.clean").value("true"),
55-
systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("WARN"),
56-
mavenBundle("net.openhft", "compiler", "2.1"),
57-
bundle("reference:file:target/classes"),
58-
junitBundles(),
59-
systemPackage("sun.misc"),
60-
systemPackage("sun.nio.ch"),
61-
systemPackage("com.sun.tools.javac.api"),
62-
cleanCaches()
52+
systemProperty("org.osgi.framework.storage.clean").value("true"),
53+
systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("WARN"),
54+
mavenBundle("net.openhft", "compiler", "2.1"),
55+
new File("Java-Lang/lang/target/classes").exists() ? bundle("reference:file:Java-Lang/lang/target/classes") : bundle("reference:file:target/classes"),
56+
junitBundles(),
57+
systemPackage("sun.misc"),
58+
systemPackage("sun.nio.ch"),
59+
systemPackage("com.sun.tools.javac.api"),
60+
cleanCaches()
6361
);
6462
}
6563

0 commit comments

Comments
 (0)