From 0b6d118e6eeb3bc100fc6a6e66016ab812cb2783 Mon Sep 17 00:00:00 2001 From: Yigit Boyar Date: Fri, 4 Dec 2015 14:16:04 -0800 Subject: Avoid re-reading variables. This CL fixes a bad code generation where we would set a variable to itself, which breaks if you use a tool like ErrorProne. I've also updated gradle version and data binding versions. Bug: 25077399 Change-Id: I6620faf4cad5fa74dc7c35be03c46c4a76c9cfbc --- .../main/kotlin/android/databinding/tool/writer/LayoutBinderWriter.kt | 2 +- databinding.properties | 4 ++-- developmentPlugins/gradle/wrapper/gradle-wrapper.properties | 2 +- extensions/gradle/wrapper/gradle-wrapper.properties | 2 +- gradle/wrapper/gradle-wrapper.properties | 2 +- .../App With Spaces/gradle/wrapper/gradle-wrapper.properties | 2 +- .../IndependentLibrary/gradle/wrapper/gradle-wrapper.properties | 2 +- .../java/com/android/databinding/multimoduletestapp/EventIdsTest.java | 2 +- .../MultiModuleTestApp/gradle/wrapper/gradle-wrapper.properties | 2 +- integration-tests/TestApp/gradle/wrapper/gradle-wrapper.properties | 2 +- samples/BindingDemo/gradle/wrapper/gradle-wrapper.properties | 2 +- 11 files changed, 12 insertions(+), 12 deletions(-) diff --git a/compiler/src/main/kotlin/android/databinding/tool/writer/LayoutBinderWriter.kt b/compiler/src/main/kotlin/android/databinding/tool/writer/LayoutBinderWriter.kt index c36236f1..7874d401 100644 --- a/compiler/src/main/kotlin/android/databinding/tool/writer/LayoutBinderWriter.kt +++ b/compiler/src/main/kotlin/android/databinding/tool/writer/LayoutBinderWriter.kt @@ -829,7 +829,7 @@ class LayoutBinderWriter(val layoutBinder : LayoutBinder) { val dependants = ArrayList() expressions.groupBy { condition(it) }.forEach { val condition = it.key - val assignedValues = it.value.filter { it.needsLocalField } + val assignedValues = it.value.filter { it.needsLocalField && !it.isVariable() } if (!assignedValues.isEmpty()) { val assignment = kcode("") { assignedValues.forEach { expr: Expr -> diff --git a/databinding.properties b/databinding.properties index dbdbddca..191c2693 100644 --- a/databinding.properties +++ b/databinding.properties @@ -1,7 +1,7 @@ # global settings for projects kotlinVersion = 1.0.0-beta-1103 -version = 1.0 -releaseVersion = 1.0 +version = 1.1 +releaseVersion = 1.1 extensionsVersion = 1.0-rc5 # we use a public plugin so that it does not need data binding while compiling library androidPublicPluginVersion= 1.4.0-beta2 diff --git a/developmentPlugins/gradle/wrapper/gradle-wrapper.properties b/developmentPlugins/gradle/wrapper/gradle-wrapper.properties index c2fda826..9b2dc40d 100644 --- a/developmentPlugins/gradle/wrapper/gradle-wrapper.properties +++ b/developmentPlugins/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-all.zip diff --git a/extensions/gradle/wrapper/gradle-wrapper.properties b/extensions/gradle/wrapper/gradle-wrapper.properties index e5fd8793..4d8843e7 100644 --- a/extensions/gradle/wrapper/gradle-wrapper.properties +++ b/extensions/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-all.zip diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index e5fd8793..4d8843e7 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-all.zip diff --git a/integration-tests/App With Spaces/gradle/wrapper/gradle-wrapper.properties b/integration-tests/App With Spaces/gradle/wrapper/gradle-wrapper.properties index 992e276a..a1cdb4bb 100644 --- a/integration-tests/App With Spaces/gradle/wrapper/gradle-wrapper.properties +++ b/integration-tests/App With Spaces/gradle/wrapper/gradle-wrapper.properties @@ -19,4 +19,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-all.zip diff --git a/integration-tests/IndependentLibrary/gradle/wrapper/gradle-wrapper.properties b/integration-tests/IndependentLibrary/gradle/wrapper/gradle-wrapper.properties index de86a571..a8902c19 100644 --- a/integration-tests/IndependentLibrary/gradle/wrapper/gradle-wrapper.properties +++ b/integration-tests/IndependentLibrary/gradle/wrapper/gradle-wrapper.properties @@ -18,4 +18,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-all.zip diff --git a/integration-tests/MultiModuleTestApp/app/src/androidTest/java/com/android/databinding/multimoduletestapp/EventIdsTest.java b/integration-tests/MultiModuleTestApp/app/src/androidTest/java/com/android/databinding/multimoduletestapp/EventIdsTest.java index 8ef36b45..ec6df344 100644 --- a/integration-tests/MultiModuleTestApp/app/src/androidTest/java/com/android/databinding/multimoduletestapp/EventIdsTest.java +++ b/integration-tests/MultiModuleTestApp/app/src/androidTest/java/com/android/databinding/multimoduletestapp/EventIdsTest.java @@ -112,7 +112,7 @@ public class EventIdsTest extends AndroidTestCase { } private static class EventCounter extends OnPropertyChangedCallback { - Map mCounter = new HashMap<>(); + Map mCounter = new HashMap(); @Override public void onPropertyChanged(Observable observable, int propertyId) { diff --git a/integration-tests/MultiModuleTestApp/gradle/wrapper/gradle-wrapper.properties b/integration-tests/MultiModuleTestApp/gradle/wrapper/gradle-wrapper.properties index 992e276a..a1cdb4bb 100644 --- a/integration-tests/MultiModuleTestApp/gradle/wrapper/gradle-wrapper.properties +++ b/integration-tests/MultiModuleTestApp/gradle/wrapper/gradle-wrapper.properties @@ -19,4 +19,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-all.zip diff --git a/integration-tests/TestApp/gradle/wrapper/gradle-wrapper.properties b/integration-tests/TestApp/gradle/wrapper/gradle-wrapper.properties index 0c71e760..07fc193f 100644 --- a/integration-tests/TestApp/gradle/wrapper/gradle-wrapper.properties +++ b/integration-tests/TestApp/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-all.zip diff --git a/samples/BindingDemo/gradle/wrapper/gradle-wrapper.properties b/samples/BindingDemo/gradle/wrapper/gradle-wrapper.properties index f02c72ae..0e73e620 100644 --- a/samples/BindingDemo/gradle/wrapper/gradle-wrapper.properties +++ b/samples/BindingDemo/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-all.zip -- cgit v1.2.3