From 7c91260a709ce2e159f9853d9f947be4ef244bc1 Mon Sep 17 00:00:00 2001 From: Wu Zhenwei Date: Sun, 25 Jan 2015 12:46:01 +0800 Subject: [PATCH] Fix function name in scala and comments. --- .../main/java/com/typesafe/config/impl/Parser.java | 2 +- .../com/typesafe/config/impl/ConfigValueTest.scala | 12 ++++++------ .../com/typesafe/config/impl/PublicApiTest.scala | 2 +- .../scala/com/typesafe/config/impl/TestUtils.scala | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/config/src/main/java/com/typesafe/config/impl/Parser.java b/config/src/main/java/com/typesafe/config/impl/Parser.java index 8f9b4735..7d1d301c 100644 --- a/config/src/main/java/com/typesafe/config/impl/Parser.java +++ b/config/src/main/java/com/typesafe/config/impl/Parser.java @@ -553,7 +553,7 @@ final class Parser { } } - // the setComments(null) is to ensure comments are only + // the withComments(null) is to ensure comments are only // on the exact leaf node they apply to. // a comment before "foo.bar" applies to the full setting // "foo.bar" not also to "foo" diff --git a/config/src/test/scala/com/typesafe/config/impl/ConfigValueTest.scala b/config/src/test/scala/com/typesafe/config/impl/ConfigValueTest.scala index df2aecec..e4a40d09 100644 --- a/config/src/test/scala/com/typesafe/config/impl/ConfigValueTest.scala +++ b/config/src/test/scala/com/typesafe/config/impl/ConfigValueTest.scala @@ -663,8 +663,8 @@ class ConfigValueTest extends TestUtils { def configOriginFileAndLine() { val hasFilename = SimpleConfigOrigin.newFile("foo") val noFilename = SimpleConfigOrigin.newSimple("bar") - val filenameWithLine = hasFilename.setLineNumber(3) - val noFilenameWithLine = noFilename.setLineNumber(4) + val filenameWithLine = hasFilename.withLineNumber(3) + val noFilenameWithLine = noFilename.withLineNumber(4) assertEquals("foo", hasFilename.filename()) assertEquals("foo", filenameWithLine.filename()) @@ -866,10 +866,10 @@ class ConfigValueTest extends TestUtils { val combos = bases.flatMap({ base => Seq( - (base, base.setComments(Seq("this is a comment", "another one").asJava)), - (base, base.setComments(null)), - (base, base.setLineNumber(41)), - (base, SimpleConfigOrigin.mergeOrigins(base.setLineNumber(10), base.setLineNumber(20)))) + (base, base.withComments(Seq("this is a comment", "another one").asJava)), + (base, base.withComments(null)), + (base, base.withLineNumber(41)), + (base, SimpleConfigOrigin.mergeOrigins(base.withLineNumber(10), base.withLineNumber(20)))) }) ++ bases.sliding(2).map({ seq => (seq.head, seq.tail.head) }) ++ bases.sliding(3).map({ seq => (seq.head, seq.tail.tail.head) }) ++ diff --git a/config/src/test/scala/com/typesafe/config/impl/PublicApiTest.scala b/config/src/test/scala/com/typesafe/config/impl/PublicApiTest.scala index 2e4e2624..7c9cd48e 100644 --- a/config/src/test/scala/com/typesafe/config/impl/PublicApiTest.scala +++ b/config/src/test/scala/com/typesafe/config/impl/PublicApiTest.scala @@ -888,7 +888,7 @@ class PublicApiTest extends TestUtils { def exceptionSerializable() { // ArrayList is a serialization problem so we want to cover it in tests val comments = new java.util.ArrayList(List("comment 1", "comment 2").asJava) - val e = new ConfigException.WrongType(SimpleConfigOrigin.newSimple("an origin").setComments(comments), + val e = new ConfigException.WrongType(SimpleConfigOrigin.newSimple("an origin").withComments(comments), "this is a message", new RuntimeException("this is a cause")) val eCopy = checkSerializableNoMeaningfulEquals(e) assertTrue("messages equal after deserialize", e.getMessage.equals(eCopy.getMessage)) diff --git a/config/src/test/scala/com/typesafe/config/impl/TestUtils.scala b/config/src/test/scala/com/typesafe/config/impl/TestUtils.scala index ef49c167..a444e72c 100644 --- a/config/src/test/scala/com/typesafe/config/impl/TestUtils.scala +++ b/config/src/test/scala/com/typesafe/config/impl/TestUtils.scala @@ -614,7 +614,7 @@ abstract trait TestUtils { def tokenDouble(d: Double) = Tokens.newDouble(fakeOrigin(), d, null) def tokenInt(i: Int) = Tokens.newInt(fakeOrigin(), i, null) def tokenLong(l: Long) = Tokens.newLong(fakeOrigin(), l, null) - def tokenLine(line: Int) = Tokens.newLine(fakeOrigin.setLineNumber(line)) + def tokenLine(line: Int) = Tokens.newLine(fakeOrigin.withLineNumber(line)) def tokenComment(text: String) = Tokens.newComment(fakeOrigin(), text) private def tokenMaybeOptionalSubstitution(optional: Boolean, expression: Token*) = {