summaryrefslogtreecommitdiff
path: root/errorprone
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2020-11-19 11:52:53 -0700
committerJeff Sharkey <jsharkey@android.com>2020-11-30 20:45:25 -0700
commit1f5d9af0cde506204425e7ba66cba19b2bf0cb82 (patch)
tree259aa95b3d7e038d000085b7cb24acde302b85fe /errorprone
parent42bd76058f1ba49f5befd5412f205f153d3ff3c3 (diff)
Additional hand-migration to TypedXml interface.
Previous changes have applied mechanical refactorings, but this change hand-migrates the remaining logic which was too complex to identify. This change should have no behavior change; famous last words. Bug: 171832118 Test: manual Exempt-From-Owner-Approval: trivial refactoring Change-Id: If2d4b1a354481a83edb4bbcfa22f690b7f5e97c3
Diffstat (limited to 'errorprone')
-rw-r--r--errorprone/refaster/EfficientXml.java24
-rw-r--r--errorprone/refaster/EfficientXml.java.refasterbin36469 -> 38713 bytes
2 files changed, 24 insertions, 0 deletions
diff --git a/errorprone/refaster/EfficientXml.java b/errorprone/refaster/EfficientXml.java
index bd1ddfc92e91..ae797c46b77e 100644
--- a/errorprone/refaster/EfficientXml.java
+++ b/errorprone/refaster/EfficientXml.java
@@ -292,6 +292,30 @@ public class EfficientXml {
}
}
+ class BooleanToStringTrue {
+ @BeforeTemplate
+ void before(TypedXmlSerializer out, String n) throws Exception {
+ out.attribute(null, n, "true");
+ }
+
+ @AfterTemplate
+ void after(TypedXmlSerializer out, String n) throws Exception {
+ out.attributeBoolean(null, n, true);
+ }
+ }
+
+ class BooleanToStringFalse {
+ @BeforeTemplate
+ void before(TypedXmlSerializer out, String n) throws Exception {
+ out.attribute(null, n, "false");
+ }
+
+ @AfterTemplate
+ void after(TypedXmlSerializer out, String n) throws Exception {
+ out.attributeBoolean(null, n, false);
+ }
+ }
+
class BooleanFromString {
@BeforeTemplate
boolean beforeParse(TypedXmlPullParser in, String n) throws Exception {
diff --git a/errorprone/refaster/EfficientXml.java.refaster b/errorprone/refaster/EfficientXml.java.refaster
index f2974fffb83b..750c2dbe98c0 100644
--- a/errorprone/refaster/EfficientXml.java.refaster
+++ b/errorprone/refaster/EfficientXml.java.refaster
Binary files differ