Standard code formatting

This commit is contained in:
Peter Lawrey
2018-04-21 10:49:49 +01:00
parent c7efd950f8
commit 9323cf28a7
270 changed files with 2801 additions and 2551 deletions
@@ -12,44 +12,48 @@ import java.util.stream.IntStream;
*/
public class ValueInterfaceWithEnumTest {
/**
* This test will throw an {@link ArrayIndexOutOfBoundsException}. This seems to occur only with Enums having even number of
* values
*/
@Test
public void testValueInterface() {
LongValue longValue = Values.newHeapInstance(LongValue.class);
SimpleValueInterface simpleValueInterface = Values.newHeapInstance(SimpleValueInterface.class);
/**
* This test will throw an {@link ArrayIndexOutOfBoundsException}. This seems to occur only with Enums having even number of
* values
*/
@Test
public void testValueInterface() {
LongValue longValue = Values.newHeapInstance(LongValue.class);
SimpleValueInterface simpleValueInterface = Values.newHeapInstance(SimpleValueInterface.class);
ChronicleMap<LongValue, SimpleValueInterface> map = ChronicleMapBuilder.of(LongValue.class, SimpleValueInterface.class).entries(50).create();
ChronicleMap<LongValue, SimpleValueInterface> map = ChronicleMapBuilder.of(LongValue.class, SimpleValueInterface.class).entries(50).create();
IntStream.range(1, 20).forEach(value -> {
longValue.setValue(value);
simpleValueInterface.setId(value);
simpleValueInterface.setTruth(false);
simpleValueInterface.setSVIEnum(SimpleValueInterface.SVIEnum.SIX);
IntStream.range(1, 20).forEach(value -> {
longValue.setValue(value);
simpleValueInterface.setId(value);
simpleValueInterface.setTruth(false);
simpleValueInterface.setSVIEnum(SimpleValueInterface.SVIEnum.SIX);
map.put(longValue, simpleValueInterface);
});
map.put(longValue, simpleValueInterface);
});
IntStream.range(1, 10).forEach(value -> {
longValue.setValue(value);
SimpleValueInterface simpleValueInterface1 = map.get(longValue);
System.out.println(simpleValueInterface1.getId());
});
}
IntStream.range(1, 10).forEach(value -> {
longValue.setValue(value);
SimpleValueInterface simpleValueInterface1 = map.get(longValue);
System.out.println(simpleValueInterface1.getId());
});
}
public interface SimpleValueInterface {
enum SVIEnum {
ONE, TWO, THREE, FOUR, FIVE, SIX
}
public interface SimpleValueInterface {
int getId();
int getId();
void setId(int id);
boolean getTruth();
void setTruth(boolean truth);
void setId(int id);
SVIEnum getSVIEnum();
void setSVIEnum(SVIEnum val);
}
boolean getTruth();
void setTruth(boolean truth);
SVIEnum getSVIEnum();
void setSVIEnum(SVIEnum val);
enum SVIEnum {
ONE, TWO, THREE, FOUR, FIVE, SIX
}
}
}