Skip to content

Commit bef3c55

Browse files
committed
nil() -> newNil() for method name consisitency
1 parent 005edf4 commit bef3c55

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

msgpack-core/src/main/java/org/msgpack/core/MessageUnpacker.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ public ImmutableValue unpackValue() throws IOException {
540540
switch(mf.getValueType()) {
541541
case NIL:
542542
unpackNil();
543-
return ValueFactory.nil();
543+
return ValueFactory.newNil();
544544
case BOOLEAN:
545545
return ValueFactory.newBoolean(unpackBoolean());
546546
case INTEGER:

msgpack-core/src/main/java/org/msgpack/value/ValueFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
public final class ValueFactory {
3333
private ValueFactory() { }
3434

35-
public static ImmutableNilValue nil() {
35+
public static ImmutableNilValue newNil() {
3636
return ImmutableNilValueImpl.get();
3737
}
3838

msgpack-core/src/main/java/org/msgpack/value/Variable.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ public NilValue asNilValue() {
232232

233233
@Override
234234
public ImmutableNilValue immutableValue() {
235-
return ValueFactory.nil();
235+
return ValueFactory.newNil();
236236
}
237237

238238
@Override
@@ -704,7 +704,7 @@ public Value get(int index) {
704704
public Value getOrNilValue(int index) {
705705
List<Value> l = list();
706706
if (l.size() < index && index >= 0) {
707-
return ValueFactory.nil();
707+
return ValueFactory.newNil();
708708
}
709709
return l.get(index);
710710
}

msgpack-core/src/test/scala/org/msgpack/value/ValueFactoryTest.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class ValueFactoryTest extends MessagePackSpec {
3737
"ValueFactory" should {
3838

3939
"create valid type values" in {
40-
isValid(ValueFactory.nil(), expected=ValueType.NIL, isNil = true)
40+
isValid(ValueFactory.newNil(), expected=ValueType.NIL, isNil = true)
4141
forAll{(v:Boolean) => isValid(ValueFactory.newBoolean(v), expected=ValueType.BOOLEAN, isBoolean = true)}
4242
forAll{(v:Int) => isValid(ValueFactory.newInteger(v), expected=ValueType.INTEGER, isInteger = true, isNumber = true)}
4343
forAll{(v:Float) => isValid(ValueFactory.newFloat(v), expected=ValueType.FLOAT, isFloat = true, isNumber = true)}

msgpack-jackson/src/main/java/org/msgpack/jackson/dataformat/MessagePackParser.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public class MessagePackParser extends ParserMinimalBase {
2929
private JsonReadContext parsingContext;
3030

3131
private final LinkedList<StackItem> stack = new LinkedList<StackItem>();
32-
private Value value = ValueFactory.nil();
32+
private Value value = ValueFactory.newNil();
3333
private Variable var = new Variable();
3434
private boolean isClosed;
3535
private long tokenPosition;
@@ -141,12 +141,12 @@ public JsonToken nextToken() throws IOException, JsonParseException {
141141
switch (type) {
142142
case NIL:
143143
messageUnpacker.unpackNil();
144-
value = ValueFactory.nil();
144+
value = ValueFactory.newNil();
145145
nextToken = JsonToken.VALUE_NULL;
146146
break;
147147
case BOOLEAN:
148148
boolean b = messageUnpacker.unpackBoolean();
149-
value = ValueFactory.nil();
149+
value = ValueFactory.newNil();
150150
nextToken = b ? JsonToken.VALUE_TRUE : JsonToken.VALUE_FALSE;
151151
break;
152152
case INTEGER:
@@ -178,11 +178,11 @@ public JsonToken nextToken() throws IOException, JsonParseException {
178178
}
179179
break;
180180
case ARRAY:
181-
value = ValueFactory.nil();
181+
value = ValueFactory.newNil();
182182
newStack = new StackItemForArray(messageUnpacker.unpackArrayHeader());
183183
break;
184184
case MAP:
185-
value = ValueFactory.nil();
185+
value = ValueFactory.newNil();
186186
newStack = new StackItemForObject(messageUnpacker.unpackMapHeader());
187187
break;
188188
case EXTENSION:

0 commit comments

Comments
 (0)