Skip to content

Commit

Permalink
Upgrade kotlin version
Browse files Browse the repository at this point in the history
  • Loading branch information
aalmiray committed May 30, 2018
1 parent ee0458a commit e0e2dc0
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 18 deletions.
Expand Up @@ -16,7 +16,7 @@ The following dependencies have been upgraded
* org.awaitility:awaitility-groovy:3.1.0
* com.google.inject:guice:4.2.0
* com.google.guava:guava:24.0-jre
* org.jetbrains.kotlin:kotlin-stdlib:1.2.40
* org.jetbrains.kotlin:kotlin-stdlib:1.2.41

=== Runtime

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Expand Up @@ -25,7 +25,7 @@ jettyVersion = 9.4.9.v20180320
jipsyVersion = 0.4.1
jsr305Version = 3.0.2
junitVersion = 4.12
kotlinVersion = 1.2.40
kotlinVersion = 1.2.41
ikonliVersion = 2.1.1
lanternaVersion = 2.1.9
mockitoVersion = 2.18.3
Expand Down
Expand Up @@ -41,6 +41,10 @@ class ConfigurationSpec extends Specification {
@Inject
private Configuration configuration

def cleanup() {
PropertyEditorResolver.clear()
}

def 'Calling configuration.get(#key, #defaultValue) returns #expectedValue'() {
expect:
expectedValue == configuration.get(key, defaultValue)
Expand Down Expand Up @@ -79,9 +83,6 @@ class ConfigurationSpec extends Specification {
then:
value == expectedValue

cleanup:
PropertyEditorResolver.clear()

where:
key || expectedValue
'key.int.null' || null
Expand All @@ -100,9 +101,6 @@ class ConfigurationSpec extends Specification {
then:
value == expectedValue

cleanup:
PropertyEditorResolver.clear()

where:
key || expectedValue
'key.date.string' || Date.parse('YYYY-MM-dd', '1970-12-24')
Expand Down
Expand Up @@ -192,13 +192,13 @@ class ConfigReader {
GroovySystem.metaClassRegistry.removeMetaClass(script.class)
def mc = script.class.metaClass
def prefix = ""
LinkedList stack = new LinkedList()
Stack<Map<String, Object>> stack = new Stack<>()
stack << [config: config, scope: [:]]
def pushStack = { co ->
stack << [config: co, scope: stack.last.scope.clone()]
stack << [config: co, scope: stack.peek().scope.clone()]
}
def assignName = { name, co ->
def current = stack.last
def current = stack.peek()
/*
def cfg = current.config
if (cfg instanceof ConfigObject) {
Expand All @@ -218,7 +218,7 @@ class ConfigReader {
current.scope[name] = co
}
mc.getProperty = { String name ->
def current = stack.last
def current = stack.peek()
def result
if (current.config.get(name)) {
result = current.config.get(name)
Expand Down Expand Up @@ -247,7 +247,7 @@ class ConfigReader {
} finally {
currentConditionalBlock.pop()
for (entry in conditionalBlocks.pop().entrySet()) {
def c = stack.last.config
def c = stack.peek().config
(c != config ? c : overrides).merge(entry.value)
}
}
Expand All @@ -268,8 +268,8 @@ class ConfigReader {
}
} else {
def co
if (stack.last.config.get(name) instanceof ConfigObject) {
co = stack.last.config.get(name)
if (stack.peek().config.get(name) instanceof ConfigObject) {
co = stack.peek().config.get(name)
} else {
co = new ConfigObject()
}
Expand Down
Expand Up @@ -246,7 +246,7 @@ class ObservableStreamSpec extends Specification {
result.get() == 4

when:
LongProperty m = new SimpleLongProperty<>(1l)
LongProperty m = new SimpleLongProperty(1l)
result = stream.limit(m)
.map({ g -> g.name })
.filter({ n -> n.endsWith('y') })
Expand Down Expand Up @@ -284,7 +284,7 @@ class ObservableStreamSpec extends Specification {
result.get() == 11

when:
LongProperty m = new SimpleLongProperty<>(1l)
LongProperty m = new SimpleLongProperty(1l)
result = stream.skip(m)
.map({ g -> g.name })
.filter({ n -> n.endsWith('y') })
Expand Down
Expand Up @@ -3,5 +3,5 @@ version = ${project_version}
griffonVersion = ${griffon_version}
groovyVersion = 2.4.15
slf4jVersion = 1.7.25
kotlinVersion = 1.2.40
kotlinVersion = 1.2.41
spockVersion = 1.1-groovy-2.4

0 comments on commit e0e2dc0

Please sign in to comment.