Skip to content

Commit e55e60a

Browse files
eamonnmcmanusGoogle Java Core Libraries
authored andcommitted
Update AutoValue to reflect recent Kotlin Metadata API changes.
Some methods have been deleted for the final 2.0.0 version. RELNOTES=n/a PiperOrigin-RevId: 635804651
1 parent 29f739b commit e55e60a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

value/src/main/java/com/google/auto/value/processor/AutoBuilderProcessor.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
import javax.lang.model.type.TypeKind;
7373
import javax.lang.model.type.TypeMirror;
7474
import javax.tools.JavaFileObject;
75-
import kotlinx.metadata.Flag;
75+
import kotlinx.metadata.Attributes;
7676
import kotlinx.metadata.KmClass;
7777
import kotlinx.metadata.KmConstructor;
7878
import kotlinx.metadata.KmValueParameter;
@@ -626,16 +626,16 @@ private ImmutableList<Executable> kotlinConstructorsIn(
626626
(String) annotationValues.get("pn").getValue(),
627627
(Integer) annotationValues.get("xi").getValue());
628628
KotlinClassMetadata.Class classMetadata =
629-
(KotlinClassMetadata.Class) KotlinClassMetadata.read(header);
630-
KmClass kmClass = classMetadata.toKmClass();
629+
(KotlinClassMetadata.Class) KotlinClassMetadata.readStrict(header);
630+
KmClass kmClass = classMetadata.getKmClass();
631631
ImmutableList.Builder<Executable> kotlinConstructorsBuilder = ImmutableList.builder();
632632
for (KmConstructor constructor : kmClass.getConstructors()) {
633633
ImmutableSet.Builder<String> allBuilder = ImmutableSet.builder();
634634
ImmutableSet.Builder<String> optionalBuilder = ImmutableSet.builder();
635635
for (KmValueParameter param : constructor.getValueParameters()) {
636636
String name = param.getName();
637637
allBuilder.add(name);
638-
if (Flag.ValueParameter.DECLARES_DEFAULT_VALUE.invoke(param.getFlags())) {
638+
if (Attributes.getDeclaresDefaultValue(param)) {
639639
optionalBuilder.add(name);
640640
}
641641
}

0 commit comments

Comments
 (0)