mirror of
https://github.com/lightbend/config.git
synced 2025-01-15 23:01:05 +08:00
Fix function name in scala and comments.
This commit is contained in:
parent
4a8e1023a3
commit
7c91260a70
@ -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"
|
||||
|
@ -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) }) ++
|
||||
|
@ -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))
|
||||
|
@ -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*) = {
|
||||
|
Loading…
Reference in New Issue
Block a user