From 7db71f70b5c56d7836e269cf871c664cb5c4d02e Mon Sep 17 00:00:00 2001 From: kstanger Date: Tue, 5 Jan 2016 08:34:18 -0800 Subject: [PATCH] Removes "Enum" suffix from generated enum class types. Provides backward compatible aliases. Change on 2016/01/05 by kstanger ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=111417795 --- jre_emul/Classes/IOSConcreteClass.m | 2 +- jre_emul/Classes/J2ObjC_common.h | 6 +- .../protobuf/compiler/j2objc/j2objc_enum.cc | 43 +++- .../compiler/j2objc/j2objc_extension.cc | 8 - .../protobuf/compiler/j2objc/j2objc_field.cc | 17 ++ .../protobuf/compiler/j2objc/j2objc_file.cc | 2 +- .../compiler/j2objc/j2objc_helpers.cc | 8 +- .../protobuf/compiler/j2objc/j2objc_helpers.h | 1 - .../src/com/google/protobuf/ByteString.h | 4 - .../src/com/google/protobuf/Descriptors.m | 146 +++++------ .../src/com/google/protobuf/FieldTypes.h | 235 +++++++++--------- .../j2objc/gen/StatementGenerator.java | 7 +- .../j2objc/gen/TypeDeclarationGenerator.java | 81 +++--- .../gen/TypePrivateDeclarationGenerator.java | 4 +- .../j2objc/translate/EnumRewriter.java | 13 +- .../devtools/j2objc/util/NameTable.java | 42 +--- .../gen/ObjectiveCHeaderGeneratorTest.java | 46 ++-- ...ObjectiveCImplementationGeneratorTest.java | 24 +- .../j2objc/gen/StatementGeneratorTest.java | 10 +- .../gen/TypeDeclarationGeneratorTest.java | 12 +- .../gen/TypeImplementationGeneratorTest.java | 6 +- .../AnonymousClassConverterTest.java | 30 +-- .../j2objc/translate/AutoboxerTest.java | 4 +- .../j2objc/translate/EnumRewriterTest.java | 2 +- .../j2objc/translate/FunctionizerTest.java | 16 +- .../devtools/j2objc/util/NameTableTest.java | 18 +- 26 files changed, 386 insertions(+), 401 deletions(-) diff --git a/jre_emul/Classes/IOSConcreteClass.m b/jre_emul/Classes/IOSConcreteClass.m index 4dfa80d829..a85a92d72b 100644 --- a/jre_emul/Classes/IOSConcreteClass.m +++ b/jre_emul/Classes/IOSConcreteClass.m @@ -96,7 +96,7 @@ - (jboolean)isEnum { return (metadata.modifiers & JavaLangReflectModifier_ENUM) > 0 && [self getSuperclass] == JavaLangEnum_class_(); } else { - return class_ != nil && [NSStringFromClass(class_) hasSuffix:@"Enum"]; + return class_ != nil && strcmp(class_getName(class_getSuperclass(class_)), "JavaLangEnum") == 0; } } diff --git a/jre_emul/Classes/J2ObjC_common.h b/jre_emul/Classes/J2ObjC_common.h index a301529f11..5ceb9f7059 100644 --- a/jre_emul/Classes/J2ObjC_common.h +++ b/jre_emul/Classes/J2ObjC_common.h @@ -22,9 +22,9 @@ @class IOSClass; // TODO(kstanger): Remove after users have migrated. -/*#ifndef J2OBJC_NO_RENAME_ALIASES -#define J2OBJC_RENAME_ALIASES 1 -#endif*/ +#ifndef J2OBJC_NO_RENAME2_ALIASES +#define J2OBJC_RENAME2_ALIASES 1 +#endif #ifndef __has_feature #define __has_feature(x) 0 // Compatibility with non-clang compilers. diff --git a/protobuf/compiler/src/google/protobuf/compiler/j2objc/j2objc_enum.cc b/protobuf/compiler/src/google/protobuf/compiler/j2objc/j2objc_enum.cc index 5815d76d09..7774ebc50f 100644 --- a/protobuf/compiler/src/google/protobuf/compiler/j2objc/j2objc_enum.cc +++ b/protobuf/compiler/src/google/protobuf/compiler/j2objc/j2objc_enum.cc @@ -83,28 +83,24 @@ void EnumGenerator::GenerateHeader(io::Printer* printer) { printer->Outdent(); printer->Print("};\n\n"); - // TODO(kstanger): Remove after users have migrated. - printer->Print("#ifdef J2OBJC_RENAME_ALIASES\n"); - printer->Print( - "#define $oldname$ $newname$\n", - "oldname", TypeName(descriptor_), - "newname", CEnumName(descriptor_)); for (int i = 0; i < canonical_values_.size(); i++) { printer->Print( - "#define $oldname$_$value$ $newname$_$value$\n", - "oldname", TypeName(descriptor_), - "newname", CEnumName(descriptor_), - "value", canonical_values_[i]->name()); + "#define $classname$_$name$_VALUE $value$\n", + "classname", ClassName(descriptor_), + "name", canonical_values_[i]->name(), + "value", SimpleItoa(canonical_values_[i]->number())); } - printer->Print("#endif // J2OBJC_RENAME_ALIASES\n"); + // TODO(kstanger): Remove after users have migrated. + printer->Print("#ifdef J2OBJC_RENAME2_ALIASES\n"); for (int i = 0; i < canonical_values_.size(); i++) { printer->Print( - "#define $classname$_$name$_VALUE $value$\n", + "#define $classname$Enum_$name$_VALUE $value$\n", "classname", ClassName(descriptor_), "name", canonical_values_[i]->name(), "value", SimpleItoa(canonical_values_[i]->number())); } + printer->Print("#endif // J2OBJC_RENAME2_ALIASES\n"); printer->Print( "\n" @@ -134,6 +130,18 @@ void EnumGenerator::GenerateHeader(io::Printer* printer) { "jint value);\n\n", "classname", ClassName(descriptor_)); + // TODO(kstanger): Remove when users have migrated. + printer->Print("#ifdef J2OBJC_RENAME2_ALIASES\n"); + printer->Print( + "#define $classname$Enum $classname$\n" + "#define $classname$Enum_initialize $classname$_initialize\n" + "#define $classname$Enum_values $classname$_values\n" + "#define $classname$Enum_valueOfWithNSString_" + " $classname$_valueOfWithNSString_\n" + "#define $classname$Enum_valueOfWithInt_ $classname$_valueOfWithInt_\n", + "classname", ClassName(descriptor_)); + printer->Print("#endif // J2OBJC_RENAME2_ALIASES\n"); + for (int i = 0; i < canonical_values_.size(); i++) { printer->Print( "#define $classname$_$name$ $classname$_values_[$nativeenumname$]\n" @@ -142,6 +150,17 @@ void EnumGenerator::GenerateHeader(io::Printer* printer) { "name", canonical_values_[i]->name(), "nativeenumname", EnumValueName(canonical_values_[i])); } + + // TODO(kstanger): Remove when users have migrated. + printer->Print("#ifdef J2OBJC_RENAME2_ALIASES\n"); + for (int i = 0; i < canonical_values_.size(); i++) { + printer->Print( + "#define $classname$Enum_$name$ $classname$_$name$\n" + "#define $classname$Enum_get_$name$ $classname$_get_$name$\n", + "classname", ClassName(descriptor_), + "name", canonical_values_[i]->name()); + } + printer->Print("#endif // J2OBJC_RENAME2_ALIASES\n"); } const int kMaxRowChars = 80; diff --git a/protobuf/compiler/src/google/protobuf/compiler/j2objc/j2objc_extension.cc b/protobuf/compiler/src/google/protobuf/compiler/j2objc/j2objc_extension.cc index 83b77afb19..46950d3af4 100644 --- a/protobuf/compiler/src/google/protobuf/compiler/j2objc/j2objc_extension.cc +++ b/protobuf/compiler/src/google/protobuf/compiler/j2objc/j2objc_extension.cc @@ -77,14 +77,6 @@ void ExtensionGenerator::GenerateMembersHeader(io::Printer* printer) { "ComGoogleProtobufGeneratedMessage_GeneratedExtension *)\n", "name", UnderscoresToCamelCase(descriptor_), "classname", ContainingClassName(descriptor_)); - // TODO(kstanger): Remove when users have migrated. - printer->Print("#ifdef J2OBJC_RENAME_ALIASES\n"); - printer->Print( - "#define $classname$_$name$_ $classname$_$name$\n" - "#define $classname$_get_$name$_ $classname$_get_$name$\n", - "name", UnderscoresToCamelCase(descriptor_), - "classname", ContainingClassName(descriptor_)); - printer->Print("#endif // J2OBJC_RENAME_ALIASES\n"); } void ExtensionGenerator::GenerateSourceDefinition(io::Printer* printer) { diff --git a/protobuf/compiler/src/google/protobuf/compiler/j2objc/j2objc_field.cc b/protobuf/compiler/src/google/protobuf/compiler/j2objc/j2objc_field.cc index da5f3a1331..7f2a7e01fa 100644 --- a/protobuf/compiler/src/google/protobuf/compiler/j2objc/j2objc_field.cc +++ b/protobuf/compiler/src/google/protobuf/compiler/j2objc/j2objc_field.cc @@ -226,6 +226,14 @@ void SingleFieldGenerator::GenerateFieldBuilderHeader(io::Printer* printer) " set$capitalized_name$With$parameter_type$_Builder:\n" " ($parameter_type$_Builder *)value;\n"); } + // TODO(kstanger): Remove after name migration. (b/25973003) + if (GetJavaType(descriptor_) == JAVATYPE_ENUM) { + printer->Print("#ifdef J2OBJC_RENAME2_ALIASES\n"); + printer->Print(variables_, + "#define set$capitalized_name$With$parameter_type$Enum " + "set$capitalized_name$With$parameter_type$\n"); + printer->Print("#endif // J2OBJC_RENAME2_ALIASES\n"); + } } void SingleFieldGenerator::GenerateMessageOrBuilderProtocol(io::Printer* printer) @@ -277,6 +285,15 @@ void RepeatedFieldGenerator::GenerateFieldBuilderHeader(io::Printer* printer) " add$capitalized_name$With$parameter_type$_Builder:\n" " ($parameter_type$_Builder *)value;\n"); } + // TODO(kstanger): Remove after name migration. (b/25973003) + if (GetJavaType(descriptor_) == JAVATYPE_ENUM) { + printer->Print("#ifdef J2OBJC_RENAME2_ALIASES\n"); + printer->Print(variables_, + "#define with$parameter_type$Enum with$parameter_type$\n" + "#define add$capitalized_name$With$parameter_type$Enum " + "add$capitalized_name$With$parameter_type$\n"); + printer->Print("#endif // J2OBJC_RENAME2_ALIASES\n"); + } } void RepeatedFieldGenerator::GenerateMessageOrBuilderProtocol( diff --git a/protobuf/compiler/src/google/protobuf/compiler/j2objc/j2objc_file.cc b/protobuf/compiler/src/google/protobuf/compiler/j2objc/j2objc_file.cc index 68b9569abc..4eb67f8dad 100644 --- a/protobuf/compiler/src/google/protobuf/compiler/j2objc/j2objc_file.cc +++ b/protobuf/compiler/src/google/protobuf/compiler/j2objc/j2objc_file.cc @@ -505,7 +505,7 @@ void FileGenerator::GenerateClassMappings(GeneratorContext* context) { PrintProperty(&printer, JavaClassName(file_), ClassName(file_)); for (int i = 0; i < file_->enum_type_count(); i++) { PrintProperty(&printer, JavaClassName(file_->enum_type(i)), - TypeName(file_->enum_type(i))); + ClassName(file_->enum_type(i))); } for (int i = 0; i < file_->message_type_count(); i++) { PrintClassMappings(file_->message_type(i), &printer); diff --git a/protobuf/compiler/src/google/protobuf/compiler/j2objc/j2objc_helpers.cc b/protobuf/compiler/src/google/protobuf/compiler/j2objc/j2objc_helpers.cc index fbc51fbc7f..19d05ae2bb 100644 --- a/protobuf/compiler/src/google/protobuf/compiler/j2objc/j2objc_helpers.cc +++ b/protobuf/compiler/src/google/protobuf/compiler/j2objc/j2objc_helpers.cc @@ -262,17 +262,13 @@ string ClassName(const Descriptor *descriptor) { + descriptor->name(); } -string TypeName(const EnumDescriptor *descriptor) { +string ClassName(const EnumDescriptor *descriptor) { return GetClassPrefix(descriptor->file(), descriptor->containing_type()) + descriptor->name(); } string CEnumName(const EnumDescriptor *descriptor) { - return TypeName(descriptor) + "_Enum"; -} - -string ClassName(const EnumDescriptor *descriptor) { - return TypeName(descriptor) + "Enum"; + return ClassName(descriptor) + "_Enum"; } string ClassName(const FileDescriptor *descriptor) { diff --git a/protobuf/compiler/src/google/protobuf/compiler/j2objc/j2objc_helpers.h b/protobuf/compiler/src/google/protobuf/compiler/j2objc/j2objc_helpers.h index ff1f48dcdd..a5465dead2 100644 --- a/protobuf/compiler/src/google/protobuf/compiler/j2objc/j2objc_helpers.h +++ b/protobuf/compiler/src/google/protobuf/compiler/j2objc/j2objc_helpers.h @@ -72,7 +72,6 @@ string ClassName(const Descriptor *descriptor); string ClassName(const EnumDescriptor *descriptor); string ClassName(const FileDescriptor *descriptor); -string TypeName(const EnumDescriptor *descriptor); string CEnumName(const EnumDescriptor *descriptor); string EnumValueName(const EnumValueDescriptor *descriptor); diff --git a/protobuf/runtime/src/com/google/protobuf/ByteString.h b/protobuf/runtime/src/com/google/protobuf/ByteString.h index 110c397677..da8879735a 100644 --- a/protobuf/runtime/src/com/google/protobuf/ByteString.h +++ b/protobuf/runtime/src/com/google/protobuf/ByteString.h @@ -92,10 +92,6 @@ J2OBJC_STATIC_INIT(ComGoogleProtobufByteString) FOUNDATION_EXPORT ComGoogleProtobufByteString *ComGoogleProtobufByteString_EMPTY; J2OBJC_STATIC_FIELD_GETTER(ComGoogleProtobufByteString, EMPTY, ComGoogleProtobufByteString *) -// TODO(kstanger): Remove when users have migrated. -#ifdef J2OBJC_RENAME_ALIASES -#define ComGoogleProtobufByteString_get_EMPTY_ ComGoogleProtobufByteString_get_EMPTY -#endif // J2OBJC_RENAME_ALIASES J2OBJC_TYPE_LITERAL_HEADER(ComGoogleProtobufByteString) diff --git a/protobuf/runtime/src/com/google/protobuf/Descriptors.m b/protobuf/runtime/src/com/google/protobuf/Descriptors.m index 35f6b32101..f271f1ca8a 100644 --- a/protobuf/runtime/src/com/google/protobuf/Descriptors.m +++ b/protobuf/runtime/src/com/google/protobuf/Descriptors.m @@ -147,8 +147,8 @@ void CGPInitDescriptor( } static inline ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum *GetTypeObj(CGPFieldType type) { - ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_initialize(); - return ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_values_[type]; + ComGoogleProtobufDescriptors_FieldDescriptor_Type_initialize(); + return ComGoogleProtobufDescriptors_FieldDescriptor_Type_values_[type]; } @implementation ComGoogleProtobufDescriptors_Descriptor @@ -410,9 +410,9 @@ - (NSString *)getName { // The remainder of this file is copied from the translation of the types // FieldDescriptor.Type and FieldDescriptor.JavaType in Descriptor.java. -J2OBJC_INITIALIZED_DEFN(ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum) +J2OBJC_INITIALIZED_DEFN(ComGoogleProtobufDescriptors_FieldDescriptor_Type) -ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum *ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_values_[18]; +ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum *ComGoogleProtobufDescriptors_FieldDescriptor_Type_values_[18]; @implementation ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum @@ -438,8 +438,8 @@ + (ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum *)valueOfWithComGoogleP } IOSObjectArray *ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_values() { - ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_initialize(); - return [IOSObjectArray arrayWithObjects:ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_values_ count:18 type:ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_class_()]; + ComGoogleProtobufDescriptors_FieldDescriptor_Type_initialize(); + return [IOSObjectArray arrayWithObjects:ComGoogleProtobufDescriptors_FieldDescriptor_Type_values_ count:18 type:ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_class_()]; } + (IOSObjectArray *)values { return ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_values(); @@ -450,9 +450,9 @@ + (ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum *)valueOfWithNSString:( } ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum *ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_valueOfWithNSString_(NSString *name) { - ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_initialize(); + ComGoogleProtobufDescriptors_FieldDescriptor_Type_initialize(); for (int i = 0; i < 18; i++) { - ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum *e = ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_values_[i]; + ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum *e = ComGoogleProtobufDescriptors_FieldDescriptor_Type_values_[i]; if ([name isEqual:[e name]]) { return e; } @@ -467,25 +467,25 @@ - (id)copyWithZone:(NSZone *)zone { + (void)initialize { if (self == [ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum class]) { - ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_DOUBLE = [[ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum alloc] initWithComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum:ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_get_DOUBLE() withNSString:@"DOUBLE" withInt:0]; - ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_FLOAT = [[ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum alloc] initWithComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum:ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_get_FLOAT() withNSString:@"FLOAT" withInt:1]; - ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_INT64 = [[ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum alloc] initWithComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum:ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_get_LONG() withNSString:@"INT64" withInt:2]; - ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_UINT64 = [[ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum alloc] initWithComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum:ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_get_LONG() withNSString:@"UINT64" withInt:3]; - ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_INT32 = [[ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum alloc] initWithComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum:ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_get_INT() withNSString:@"INT32" withInt:4]; - ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_FIXED64 = [[ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum alloc] initWithComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum:ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_get_LONG() withNSString:@"FIXED64" withInt:5]; - ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_FIXED32 = [[ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum alloc] initWithComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum:ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_get_INT() withNSString:@"FIXED32" withInt:6]; - ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_BOOL = [[ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum alloc] initWithComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum:ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_get_BOOLEAN() withNSString:@"BOOL" withInt:7]; - ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_STRING = [[ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum alloc] initWithComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum:ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_get_STRING() withNSString:@"STRING" withInt:8]; - ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_GROUP = [[ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum alloc] initWithComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum:ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_get_MESSAGE() withNSString:@"GROUP" withInt:9]; - ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_MESSAGE = [[ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum alloc] initWithComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum:ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_get_MESSAGE() withNSString:@"MESSAGE" withInt:10]; - ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_BYTES = [[ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum alloc] initWithComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum:ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_get_BYTE_STRING() withNSString:@"BYTES" withInt:11]; - ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_UINT32 = [[ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum alloc] initWithComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum:ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_get_INT() withNSString:@"UINT32" withInt:12]; - ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_ENUM = [[ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum alloc] initWithComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum:ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_get_ENUM() withNSString:@"ENUM" withInt:13]; - ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_SFIXED32 = [[ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum alloc] initWithComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum:ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_get_INT() withNSString:@"SFIXED32" withInt:14]; - ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_SFIXED64 = [[ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum alloc] initWithComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum:ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_get_LONG() withNSString:@"SFIXED64" withInt:15]; - ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_SINT32 = [[ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum alloc] initWithComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum:ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_get_INT() withNSString:@"SINT32" withInt:16]; - ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_SINT64 = [[ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum alloc] initWithComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum:ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_get_LONG() withNSString:@"SINT64" withInt:17]; - J2OBJC_SET_INITIALIZED(ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum) + ComGoogleProtobufDescriptors_FieldDescriptor_Type_DOUBLE = [[ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum alloc] initWithComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum:ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_get_DOUBLE() withNSString:@"DOUBLE" withInt:0]; + ComGoogleProtobufDescriptors_FieldDescriptor_Type_FLOAT = [[ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum alloc] initWithComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum:ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_get_FLOAT() withNSString:@"FLOAT" withInt:1]; + ComGoogleProtobufDescriptors_FieldDescriptor_Type_INT64 = [[ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum alloc] initWithComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum:ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_get_LONG() withNSString:@"INT64" withInt:2]; + ComGoogleProtobufDescriptors_FieldDescriptor_Type_UINT64 = [[ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum alloc] initWithComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum:ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_get_LONG() withNSString:@"UINT64" withInt:3]; + ComGoogleProtobufDescriptors_FieldDescriptor_Type_INT32 = [[ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum alloc] initWithComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum:ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_get_INT() withNSString:@"INT32" withInt:4]; + ComGoogleProtobufDescriptors_FieldDescriptor_Type_FIXED64 = [[ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum alloc] initWithComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum:ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_get_LONG() withNSString:@"FIXED64" withInt:5]; + ComGoogleProtobufDescriptors_FieldDescriptor_Type_FIXED32 = [[ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum alloc] initWithComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum:ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_get_INT() withNSString:@"FIXED32" withInt:6]; + ComGoogleProtobufDescriptors_FieldDescriptor_Type_BOOL = [[ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum alloc] initWithComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum:ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_get_BOOLEAN() withNSString:@"BOOL" withInt:7]; + ComGoogleProtobufDescriptors_FieldDescriptor_Type_STRING = [[ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum alloc] initWithComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum:ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_get_STRING() withNSString:@"STRING" withInt:8]; + ComGoogleProtobufDescriptors_FieldDescriptor_Type_GROUP = [[ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum alloc] initWithComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum:ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_get_MESSAGE() withNSString:@"GROUP" withInt:9]; + ComGoogleProtobufDescriptors_FieldDescriptor_Type_MESSAGE = [[ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum alloc] initWithComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum:ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_get_MESSAGE() withNSString:@"MESSAGE" withInt:10]; + ComGoogleProtobufDescriptors_FieldDescriptor_Type_BYTES = [[ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum alloc] initWithComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum:ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_get_BYTE_STRING() withNSString:@"BYTES" withInt:11]; + ComGoogleProtobufDescriptors_FieldDescriptor_Type_UINT32 = [[ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum alloc] initWithComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum:ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_get_INT() withNSString:@"UINT32" withInt:12]; + ComGoogleProtobufDescriptors_FieldDescriptor_Type_ENUM = [[ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum alloc] initWithComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum:ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_get_ENUM() withNSString:@"ENUM" withInt:13]; + ComGoogleProtobufDescriptors_FieldDescriptor_Type_SFIXED32 = [[ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum alloc] initWithComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum:ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_get_INT() withNSString:@"SFIXED32" withInt:14]; + ComGoogleProtobufDescriptors_FieldDescriptor_Type_SFIXED64 = [[ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum alloc] initWithComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum:ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_get_LONG() withNSString:@"SFIXED64" withInt:15]; + ComGoogleProtobufDescriptors_FieldDescriptor_Type_SINT32 = [[ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum alloc] initWithComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum:ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_get_INT() withNSString:@"SINT32" withInt:16]; + ComGoogleProtobufDescriptors_FieldDescriptor_Type_SINT64 = [[ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum alloc] initWithComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum:ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_get_LONG() withNSString:@"SINT64" withInt:17]; + J2OBJC_SET_INITIALIZED(ComGoogleProtobufDescriptors_FieldDescriptor_Type) } } @@ -497,24 +497,24 @@ + (const J2ObjcClassInfo *)__metadata { { "valueOfWithComGoogleProtobufDescriptorProtos_FieldDescriptorProto_TypeEnum:", "valueOf", "Lcom.google.protobuf.Descriptors$FieldDescriptor$Type;", 0x9, NULL }, }; static const J2ObjcFieldInfo fields[] = { - { "DOUBLE", "DOUBLE", 0x4019, "Lcom.google.protobuf.Descriptors$FieldDescriptor$Type;", &ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_DOUBLE, }, - { "FLOAT", "FLOAT", 0x4019, "Lcom.google.protobuf.Descriptors$FieldDescriptor$Type;", &ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_FLOAT, }, - { "INT64", "INT64", 0x4019, "Lcom.google.protobuf.Descriptors$FieldDescriptor$Type;", &ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_INT64, }, - { "UINT64", "UINT64", 0x4019, "Lcom.google.protobuf.Descriptors$FieldDescriptor$Type;", &ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_UINT64, }, - { "INT32", "INT32", 0x4019, "Lcom.google.protobuf.Descriptors$FieldDescriptor$Type;", &ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_INT32, }, - { "FIXED64", "FIXED64", 0x4019, "Lcom.google.protobuf.Descriptors$FieldDescriptor$Type;", &ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_FIXED64, }, - { "FIXED32", "FIXED32", 0x4019, "Lcom.google.protobuf.Descriptors$FieldDescriptor$Type;", &ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_FIXED32, }, - { "BOOL", "BOOL", 0x4019, "Lcom.google.protobuf.Descriptors$FieldDescriptor$Type;", &ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_BOOL, }, - { "STRING", "STRING", 0x4019, "Lcom.google.protobuf.Descriptors$FieldDescriptor$Type;", &ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_STRING, }, - { "GROUP", "GROUP", 0x4019, "Lcom.google.protobuf.Descriptors$FieldDescriptor$Type;", &ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_GROUP, }, - { "MESSAGE", "MESSAGE", 0x4019, "Lcom.google.protobuf.Descriptors$FieldDescriptor$Type;", &ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_MESSAGE, }, - { "BYTES", "BYTES", 0x4019, "Lcom.google.protobuf.Descriptors$FieldDescriptor$Type;", &ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_BYTES, }, - { "UINT32", "UINT32", 0x4019, "Lcom.google.protobuf.Descriptors$FieldDescriptor$Type;", &ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_UINT32, }, - { "ENUM", "ENUM", 0x4019, "Lcom.google.protobuf.Descriptors$FieldDescriptor$Type;", &ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_ENUM, }, - { "SFIXED32", "SFIXED32", 0x4019, "Lcom.google.protobuf.Descriptors$FieldDescriptor$Type;", &ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_SFIXED32, }, - { "SFIXED64", "SFIXED64", 0x4019, "Lcom.google.protobuf.Descriptors$FieldDescriptor$Type;", &ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_SFIXED64, }, - { "SINT32", "SINT32", 0x4019, "Lcom.google.protobuf.Descriptors$FieldDescriptor$Type;", &ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_SINT32, }, - { "SINT64", "SINT64", 0x4019, "Lcom.google.protobuf.Descriptors$FieldDescriptor$Type;", &ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_SINT64, }, + { "DOUBLE", "DOUBLE", 0x4019, "Lcom.google.protobuf.Descriptors$FieldDescriptor$Type;", &ComGoogleProtobufDescriptors_FieldDescriptor_Type_DOUBLE, }, + { "FLOAT", "FLOAT", 0x4019, "Lcom.google.protobuf.Descriptors$FieldDescriptor$Type;", &ComGoogleProtobufDescriptors_FieldDescriptor_Type_FLOAT, }, + { "INT64", "INT64", 0x4019, "Lcom.google.protobuf.Descriptors$FieldDescriptor$Type;", &ComGoogleProtobufDescriptors_FieldDescriptor_Type_INT64, }, + { "UINT64", "UINT64", 0x4019, "Lcom.google.protobuf.Descriptors$FieldDescriptor$Type;", &ComGoogleProtobufDescriptors_FieldDescriptor_Type_UINT64, }, + { "INT32", "INT32", 0x4019, "Lcom.google.protobuf.Descriptors$FieldDescriptor$Type;", &ComGoogleProtobufDescriptors_FieldDescriptor_Type_INT32, }, + { "FIXED64", "FIXED64", 0x4019, "Lcom.google.protobuf.Descriptors$FieldDescriptor$Type;", &ComGoogleProtobufDescriptors_FieldDescriptor_Type_FIXED64, }, + { "FIXED32", "FIXED32", 0x4019, "Lcom.google.protobuf.Descriptors$FieldDescriptor$Type;", &ComGoogleProtobufDescriptors_FieldDescriptor_Type_FIXED32, }, + { "BOOL", "BOOL", 0x4019, "Lcom.google.protobuf.Descriptors$FieldDescriptor$Type;", &ComGoogleProtobufDescriptors_FieldDescriptor_Type_BOOL, }, + { "STRING", "STRING", 0x4019, "Lcom.google.protobuf.Descriptors$FieldDescriptor$Type;", &ComGoogleProtobufDescriptors_FieldDescriptor_Type_STRING, }, + { "GROUP", "GROUP", 0x4019, "Lcom.google.protobuf.Descriptors$FieldDescriptor$Type;", &ComGoogleProtobufDescriptors_FieldDescriptor_Type_GROUP, }, + { "MESSAGE", "MESSAGE", 0x4019, "Lcom.google.protobuf.Descriptors$FieldDescriptor$Type;", &ComGoogleProtobufDescriptors_FieldDescriptor_Type_MESSAGE, }, + { "BYTES", "BYTES", 0x4019, "Lcom.google.protobuf.Descriptors$FieldDescriptor$Type;", &ComGoogleProtobufDescriptors_FieldDescriptor_Type_BYTES, }, + { "UINT32", "UINT32", 0x4019, "Lcom.google.protobuf.Descriptors$FieldDescriptor$Type;", &ComGoogleProtobufDescriptors_FieldDescriptor_Type_UINT32, }, + { "ENUM", "ENUM", 0x4019, "Lcom.google.protobuf.Descriptors$FieldDescriptor$Type;", &ComGoogleProtobufDescriptors_FieldDescriptor_Type_ENUM, }, + { "SFIXED32", "SFIXED32", 0x4019, "Lcom.google.protobuf.Descriptors$FieldDescriptor$Type;", &ComGoogleProtobufDescriptors_FieldDescriptor_Type_SFIXED32, }, + { "SFIXED64", "SFIXED64", 0x4019, "Lcom.google.protobuf.Descriptors$FieldDescriptor$Type;", &ComGoogleProtobufDescriptors_FieldDescriptor_Type_SFIXED64, }, + { "SINT32", "SINT32", 0x4019, "Lcom.google.protobuf.Descriptors$FieldDescriptor$Type;", &ComGoogleProtobufDescriptors_FieldDescriptor_Type_SINT32, }, + { "SINT64", "SINT64", 0x4019, "Lcom.google.protobuf.Descriptors$FieldDescriptor$Type;", &ComGoogleProtobufDescriptors_FieldDescriptor_Type_SINT64, }, { "javaType_", NULL, 0x2, "Lcom.google.protobuf.Descriptors$FieldDescriptor$JavaType;", NULL, }, }; static const char *superclass_type_args[] = {"Lcom.google.protobuf.Descriptors$FieldDescriptor$Type;"}; @@ -525,15 +525,15 @@ + (const J2ObjcClassInfo *)__metadata { @end ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum *ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_valueOfWithComGoogleProtobufDescriptorProtos_FieldDescriptorProto_TypeEnum_(ComGoogleProtobufDescriptorProtos_FieldDescriptorProto_TypeEnum *type) { - ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_initialize(); + ComGoogleProtobufDescriptors_FieldDescriptor_Type_initialize(); return IOSObjectArray_Get(nil_chk(ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_values()), [((ComGoogleProtobufDescriptorProtos_FieldDescriptorProto_TypeEnum *) nil_chk(type)) getNumber] - 1); } -J2OBJC_CLASS_TYPE_LITERAL_SOURCE(ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum) +J2OBJC_CLASS_TYPE_LITERAL_SOURCE(ComGoogleProtobufDescriptors_FieldDescriptor_Type) -J2OBJC_INITIALIZED_DEFN(ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum) +J2OBJC_INITIALIZED_DEFN(ComGoogleProtobufDescriptors_FieldDescriptor_JavaType) -ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum *ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_values_[9]; +ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum *ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_values_[9]; @implementation ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum @@ -547,8 +547,8 @@ - (instancetype)initWithId:(id)defaultDefault } IOSObjectArray *ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_values() { - ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_initialize(); - return [IOSObjectArray arrayWithObjects:ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_values_ count:9 type:ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_class_()]; + ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_initialize(); + return [IOSObjectArray arrayWithObjects:ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_values_ count:9 type:ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_class_()]; } + (IOSObjectArray *)values { return ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_values(); @@ -559,9 +559,9 @@ + (ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum *)valueOfWithNSStri } ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum *ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_valueOfWithNSString_(NSString *name) { - ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_initialize(); + ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_initialize(); for (int i = 0; i < 9; i++) { - ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum *e = ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_values_[i]; + ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum *e = ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_values_[i]; if ([name isEqual:[e name]]) { return e; } @@ -576,16 +576,16 @@ - (id)copyWithZone:(NSZone *)zone { + (void)initialize { if (self == [ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum class]) { - ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_INT = [[ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum alloc] initWithId:JavaLangInteger_valueOfWithInt_(0) withNSString:@"INT" withInt:0]; - ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_LONG = [[ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum alloc] initWithId:JavaLangLong_valueOfWithLong_(0LL) withNSString:@"LONG" withInt:1]; - ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_FLOAT = [[ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum alloc] initWithId:JavaLangFloat_valueOfWithFloat_(0.0f) withNSString:@"FLOAT" withInt:2]; - ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_DOUBLE = [[ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum alloc] initWithId:JavaLangDouble_valueOfWithDouble_(0.0) withNSString:@"DOUBLE" withInt:3]; - ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_BOOLEAN = [[ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum alloc] initWithId:JavaLangBoolean_valueOfWithBoolean_(NO) withNSString:@"BOOLEAN" withInt:4]; - ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_STRING = [[ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum alloc] initWithId:@"" withNSString:@"STRING" withInt:5]; - ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_BYTE_STRING = [[ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum alloc] initWithId:ComGoogleProtobufByteString_get_EMPTY() withNSString:@"BYTE_STRING" withInt:6]; - ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_ENUM = [[ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum alloc] initWithId:nil withNSString:@"ENUM" withInt:7]; - ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_MESSAGE = [[ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum alloc] initWithId:nil withNSString:@"MESSAGE" withInt:8]; - J2OBJC_SET_INITIALIZED(ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum) + ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_INT = [[ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum alloc] initWithId:JavaLangInteger_valueOfWithInt_(0) withNSString:@"INT" withInt:0]; + ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_LONG = [[ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum alloc] initWithId:JavaLangLong_valueOfWithLong_(0LL) withNSString:@"LONG" withInt:1]; + ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_FLOAT = [[ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum alloc] initWithId:JavaLangFloat_valueOfWithFloat_(0.0f) withNSString:@"FLOAT" withInt:2]; + ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_DOUBLE = [[ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum alloc] initWithId:JavaLangDouble_valueOfWithDouble_(0.0) withNSString:@"DOUBLE" withInt:3]; + ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_BOOLEAN = [[ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum alloc] initWithId:JavaLangBoolean_valueOfWithBoolean_(NO) withNSString:@"BOOLEAN" withInt:4]; + ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_STRING = [[ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum alloc] initWithId:@"" withNSString:@"STRING" withInt:5]; + ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_BYTE_STRING = [[ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum alloc] initWithId:ComGoogleProtobufByteString_get_EMPTY() withNSString:@"BYTE_STRING" withInt:6]; + ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_ENUM = [[ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum alloc] initWithId:nil withNSString:@"ENUM" withInt:7]; + ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_MESSAGE = [[ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum alloc] initWithId:nil withNSString:@"MESSAGE" withInt:8]; + J2OBJC_SET_INITIALIZED(ComGoogleProtobufDescriptors_FieldDescriptor_JavaType) } } @@ -594,15 +594,15 @@ + (const J2ObjcClassInfo *)__metadata { { "initWithId:withNSString:withInt:", "JavaType", NULL, 0x2, NULL }, }; static const J2ObjcFieldInfo fields[] = { - { "INT", "INT", 0x4019, "Lcom.google.protobuf.Descriptors$FieldDescriptor$JavaType;", &ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_INT, }, - { "LONG", "LONG", 0x4019, "Lcom.google.protobuf.Descriptors$FieldDescriptor$JavaType;", &ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_LONG, }, - { "FLOAT", "FLOAT", 0x4019, "Lcom.google.protobuf.Descriptors$FieldDescriptor$JavaType;", &ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_FLOAT, }, - { "DOUBLE", "DOUBLE", 0x4019, "Lcom.google.protobuf.Descriptors$FieldDescriptor$JavaType;", &ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_DOUBLE, }, - { "BOOLEAN", "BOOLEAN", 0x4019, "Lcom.google.protobuf.Descriptors$FieldDescriptor$JavaType;", &ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_BOOLEAN, }, - { "STRING", "STRING", 0x4019, "Lcom.google.protobuf.Descriptors$FieldDescriptor$JavaType;", &ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_STRING, }, - { "BYTE_STRING", "BYTE_STRING", 0x4019, "Lcom.google.protobuf.Descriptors$FieldDescriptor$JavaType;", &ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_BYTE_STRING, }, - { "ENUM", "ENUM", 0x4019, "Lcom.google.protobuf.Descriptors$FieldDescriptor$JavaType;", &ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_ENUM, }, - { "MESSAGE", "MESSAGE", 0x4019, "Lcom.google.protobuf.Descriptors$FieldDescriptor$JavaType;", &ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_MESSAGE, }, + { "INT", "INT", 0x4019, "Lcom.google.protobuf.Descriptors$FieldDescriptor$JavaType;", &ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_INT, }, + { "LONG", "LONG", 0x4019, "Lcom.google.protobuf.Descriptors$FieldDescriptor$JavaType;", &ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_LONG, }, + { "FLOAT", "FLOAT", 0x4019, "Lcom.google.protobuf.Descriptors$FieldDescriptor$JavaType;", &ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_FLOAT, }, + { "DOUBLE", "DOUBLE", 0x4019, "Lcom.google.protobuf.Descriptors$FieldDescriptor$JavaType;", &ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_DOUBLE, }, + { "BOOLEAN", "BOOLEAN", 0x4019, "Lcom.google.protobuf.Descriptors$FieldDescriptor$JavaType;", &ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_BOOLEAN, }, + { "STRING", "STRING", 0x4019, "Lcom.google.protobuf.Descriptors$FieldDescriptor$JavaType;", &ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_STRING, }, + { "BYTE_STRING", "BYTE_STRING", 0x4019, "Lcom.google.protobuf.Descriptors$FieldDescriptor$JavaType;", &ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_BYTE_STRING, }, + { "ENUM", "ENUM", 0x4019, "Lcom.google.protobuf.Descriptors$FieldDescriptor$JavaType;", &ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_ENUM, }, + { "MESSAGE", "MESSAGE", 0x4019, "Lcom.google.protobuf.Descriptors$FieldDescriptor$JavaType;", &ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_MESSAGE, }, { "defaultDefault_", NULL, 0x12, "Ljava.lang.Object;", NULL, }, }; static const char *superclass_type_args[] = {"Lcom.google.protobuf.Descriptors$FieldDescriptor$JavaType;"}; @@ -612,4 +612,4 @@ + (const J2ObjcClassInfo *)__metadata { @end -J2OBJC_CLASS_TYPE_LITERAL_SOURCE(ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum) +J2OBJC_CLASS_TYPE_LITERAL_SOURCE(ComGoogleProtobufDescriptors_FieldDescriptor_JavaType) diff --git a/protobuf/runtime/src/com/google/protobuf/FieldTypes.h b/protobuf/runtime/src/com/google/protobuf/FieldTypes.h index 58fe2c5531..ca826d209c 100644 --- a/protobuf/runtime/src/com/google/protobuf/FieldTypes.h +++ b/protobuf/runtime/src/com/google/protobuf/FieldTypes.h @@ -43,8 +43,8 @@ #import "java/lang/Integer.h" #import "java/lang/Long.h" -@class ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum; -@class ComGoogleProtobufDescriptorProtos_FieldDescriptorProto_TypeEnum; +@class ComGoogleProtobufDescriptors_FieldDescriptor_JavaType; +@class ComGoogleProtobufDescriptorProtos_FieldDescriptorProto_Type; #define TYPE_Int jint #define TYPE_Long jlong @@ -187,115 +187,121 @@ typedef NS_ENUM(NSUInteger, ComGoogleProtobufDescriptors_FieldDescriptor_Type_En ComGoogleProtobufDescriptors_FieldDescriptor_Type_Enum_SINT32 = 16, ComGoogleProtobufDescriptors_FieldDescriptor_Type_Enum_SINT64 = 17, }; -// TODO(kstanger): Remove after users have migrated. -#ifdef J2OBJC_RENAME_ALIASES -#define ComGoogleProtobufDescriptors_FieldDescriptor_Type ComGoogleProtobufDescriptors_FieldDescriptor_Type_Enum -#define ComGoogleProtobufDescriptors_FieldDescriptor_Type_DOUBLE ComGoogleProtobufDescriptors_FieldDescriptor_Type_Enum_DOUBLE -#define ComGoogleProtobufDescriptors_FieldDescriptor_Type_FLOAT ComGoogleProtobufDescriptors_FieldDescriptor_Type_Enum_FLOAT -#define ComGoogleProtobufDescriptors_FieldDescriptor_Type_INT64 ComGoogleProtobufDescriptors_FieldDescriptor_Type_Enum_INT64 -#define ComGoogleProtobufDescriptors_FieldDescriptor_Type_UINT64 ComGoogleProtobufDescriptors_FieldDescriptor_Type_Enum_UINT64 -#define ComGoogleProtobufDescriptors_FieldDescriptor_Type_INT32 ComGoogleProtobufDescriptors_FieldDescriptor_Type_Enum_INT32 -#define ComGoogleProtobufDescriptors_FieldDescriptor_Type_FIXED64 ComGoogleProtobufDescriptors_FieldDescriptor_Type_Enum_FIXED64 -#define ComGoogleProtobufDescriptors_FieldDescriptor_Type_FIXED32 ComGoogleProtobufDescriptors_FieldDescriptor_Type_Enum_FIXED32 -#define ComGoogleProtobufDescriptors_FieldDescriptor_Type_BOOL ComGoogleProtobufDescriptors_FieldDescriptor_Type_Enum_BOOL -#define ComGoogleProtobufDescriptors_FieldDescriptor_Type_STRING ComGoogleProtobufDescriptors_FieldDescriptor_Type_Enum_STRING -#define ComGoogleProtobufDescriptors_FieldDescriptor_Type_GROUP ComGoogleProtobufDescriptors_FieldDescriptor_Type_Enum_GROUP -#define ComGoogleProtobufDescriptors_FieldDescriptor_Type_MESSAGE ComGoogleProtobufDescriptors_FieldDescriptor_Type_Enum_MESSAGE -#define ComGoogleProtobufDescriptors_FieldDescriptor_Type_BYTES ComGoogleProtobufDescriptors_FieldDescriptor_Type_Enum_BYTES -#define ComGoogleProtobufDescriptors_FieldDescriptor_Type_UINT32 ComGoogleProtobufDescriptors_FieldDescriptor_Type_Enum_UINT32 -#define ComGoogleProtobufDescriptors_FieldDescriptor_Type_ENUM ComGoogleProtobufDescriptors_FieldDescriptor_Type_Enum_ENUM -#define ComGoogleProtobufDescriptors_FieldDescriptor_Type_SFIXED32 ComGoogleProtobufDescriptors_FieldDescriptor_Type_Enum_SFIXED32 -#define ComGoogleProtobufDescriptors_FieldDescriptor_Type_SFIXED64 ComGoogleProtobufDescriptors_FieldDescriptor_Type_Enum_SFIXED64 -#define ComGoogleProtobufDescriptors_FieldDescriptor_Type_SINT32 ComGoogleProtobufDescriptors_FieldDescriptor_Type_Enum_SINT32 -#define ComGoogleProtobufDescriptors_FieldDescriptor_Type_SINT64 ComGoogleProtobufDescriptors_FieldDescriptor_Type_Enum_SINT64 -#endif // J2OBJC_RENAME_ALIASES typedef ComGoogleProtobufDescriptors_FieldDescriptor_Type_Enum CGPFieldType; -@interface ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum : JavaLangEnum < NSCopying > { +@interface ComGoogleProtobufDescriptors_FieldDescriptor_Type : JavaLangEnum < NSCopying > { } -- (instancetype)initWithComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum:(ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum *)javaType - withNSString:(NSString *)__name - withInt:(jint)__ordinal; +- (instancetype)initWithComGoogleProtobufDescriptors_FieldDescriptor_JavaType:(ComGoogleProtobufDescriptors_FieldDescriptor_JavaType *)javaType + withNSString:(NSString *)__name + withInt:(jint)__ordinal; -- (ComGoogleProtobufDescriptorProtos_FieldDescriptorProto_TypeEnum *)toProto; +- (ComGoogleProtobufDescriptorProtos_FieldDescriptorProto_Type *)toProto; -- (ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum *)getJavaType; +- (ComGoogleProtobufDescriptors_FieldDescriptor_JavaType *)getJavaType; -+ (ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum *)valueOfWithComGoogleProtobufDescriptorProtos_FieldDescriptorProto_TypeEnum:(ComGoogleProtobufDescriptorProtos_FieldDescriptorProto_TypeEnum *)type; ++ (ComGoogleProtobufDescriptors_FieldDescriptor_Type *)valueOfWithComGoogleProtobufDescriptorProtos_FieldDescriptorProto_Type:(ComGoogleProtobufDescriptorProtos_FieldDescriptorProto_Type *)type; + (IOSObjectArray *)values; -FOUNDATION_EXPORT IOSObjectArray *ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_values(); +FOUNDATION_EXPORT IOSObjectArray *ComGoogleProtobufDescriptors_FieldDescriptor_Type_values(); -+ (ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum *)valueOfWithNSString:(NSString *)name; -FOUNDATION_EXPORT ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum *ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_valueOfWithNSString_(NSString *name); ++ (ComGoogleProtobufDescriptors_FieldDescriptor_Type *)valueOfWithNSString:(NSString *)name; +FOUNDATION_EXPORT ComGoogleProtobufDescriptors_FieldDescriptor_Type *ComGoogleProtobufDescriptors_FieldDescriptor_Type_valueOfWithNSString_(NSString *name); - (id)copyWithZone:(NSZone *)zone; @end -J2OBJC_STATIC_INIT(ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum) +J2OBJC_STATIC_INIT(ComGoogleProtobufDescriptors_FieldDescriptor_Type) -FOUNDATION_EXPORT ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum *ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_valueOfWithComGoogleProtobufDescriptorProtos_FieldDescriptorProto_TypeEnum_(ComGoogleProtobufDescriptorProtos_FieldDescriptorProto_TypeEnum *type); +FOUNDATION_EXPORT ComGoogleProtobufDescriptors_FieldDescriptor_Type *ComGoogleProtobufDescriptors_FieldDescriptor_Type_valueOfWithComGoogleProtobufDescriptorProtos_FieldDescriptorProto_Type_(ComGoogleProtobufDescriptorProtos_FieldDescriptorProto_Type *type); -FOUNDATION_EXPORT ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum *ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_values_[]; +FOUNDATION_EXPORT ComGoogleProtobufDescriptors_FieldDescriptor_Type *ComGoogleProtobufDescriptors_FieldDescriptor_Type_values_[]; -#define ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_DOUBLE ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_values_[ComGoogleProtobufDescriptors_FieldDescriptor_Type_Enum_DOUBLE] -J2OBJC_ENUM_CONSTANT_GETTER(ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum, DOUBLE) +#define ComGoogleProtobufDescriptors_FieldDescriptor_Type_DOUBLE ComGoogleProtobufDescriptors_FieldDescriptor_Type_values_[ComGoogleProtobufDescriptors_FieldDescriptor_Type_Enum_DOUBLE] +J2OBJC_ENUM_CONSTANT_GETTER(ComGoogleProtobufDescriptors_FieldDescriptor_Type, DOUBLE) -#define ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_FLOAT ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_values_[ComGoogleProtobufDescriptors_FieldDescriptor_Type_Enum_FLOAT] -J2OBJC_ENUM_CONSTANT_GETTER(ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum, FLOAT) +#define ComGoogleProtobufDescriptors_FieldDescriptor_Type_FLOAT ComGoogleProtobufDescriptors_FieldDescriptor_Type_values_[ComGoogleProtobufDescriptors_FieldDescriptor_Type_Enum_FLOAT] +J2OBJC_ENUM_CONSTANT_GETTER(ComGoogleProtobufDescriptors_FieldDescriptor_Type, FLOAT) -#define ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_INT64 ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_values_[ComGoogleProtobufDescriptors_FieldDescriptor_Type_Enum_INT64] -J2OBJC_ENUM_CONSTANT_GETTER(ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum, INT64) +#define ComGoogleProtobufDescriptors_FieldDescriptor_Type_INT64 ComGoogleProtobufDescriptors_FieldDescriptor_Type_values_[ComGoogleProtobufDescriptors_FieldDescriptor_Type_Enum_INT64] +J2OBJC_ENUM_CONSTANT_GETTER(ComGoogleProtobufDescriptors_FieldDescriptor_Type, INT64) -#define ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_UINT64 ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_values_[ComGoogleProtobufDescriptors_FieldDescriptor_Type_Enum_UINT64] -J2OBJC_ENUM_CONSTANT_GETTER(ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum, UINT64) +#define ComGoogleProtobufDescriptors_FieldDescriptor_Type_UINT64 ComGoogleProtobufDescriptors_FieldDescriptor_Type_values_[ComGoogleProtobufDescriptors_FieldDescriptor_Type_Enum_UINT64] +J2OBJC_ENUM_CONSTANT_GETTER(ComGoogleProtobufDescriptors_FieldDescriptor_Type, UINT64) -#define ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_INT32 ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_values_[ComGoogleProtobufDescriptors_FieldDescriptor_Type_Enum_INT32] -J2OBJC_ENUM_CONSTANT_GETTER(ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum, INT32) +#define ComGoogleProtobufDescriptors_FieldDescriptor_Type_INT32 ComGoogleProtobufDescriptors_FieldDescriptor_Type_values_[ComGoogleProtobufDescriptors_FieldDescriptor_Type_Enum_INT32] +J2OBJC_ENUM_CONSTANT_GETTER(ComGoogleProtobufDescriptors_FieldDescriptor_Type, INT32) -#define ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_FIXED64 ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_values_[ComGoogleProtobufDescriptors_FieldDescriptor_Type_Enum_FIXED64] -J2OBJC_ENUM_CONSTANT_GETTER(ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum, FIXED64) +#define ComGoogleProtobufDescriptors_FieldDescriptor_Type_FIXED64 ComGoogleProtobufDescriptors_FieldDescriptor_Type_values_[ComGoogleProtobufDescriptors_FieldDescriptor_Type_Enum_FIXED64] +J2OBJC_ENUM_CONSTANT_GETTER(ComGoogleProtobufDescriptors_FieldDescriptor_Type, FIXED64) -#define ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_FIXED32 ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_values_[ComGoogleProtobufDescriptors_FieldDescriptor_Type_Enum_FIXED32] -J2OBJC_ENUM_CONSTANT_GETTER(ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum, FIXED32) +#define ComGoogleProtobufDescriptors_FieldDescriptor_Type_FIXED32 ComGoogleProtobufDescriptors_FieldDescriptor_Type_values_[ComGoogleProtobufDescriptors_FieldDescriptor_Type_Enum_FIXED32] +J2OBJC_ENUM_CONSTANT_GETTER(ComGoogleProtobufDescriptors_FieldDescriptor_Type, FIXED32) -#define ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_BOOL ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_values_[ComGoogleProtobufDescriptors_FieldDescriptor_Type_Enum_BOOL] -J2OBJC_ENUM_CONSTANT_GETTER(ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum, BOOL) +#define ComGoogleProtobufDescriptors_FieldDescriptor_Type_BOOL ComGoogleProtobufDescriptors_FieldDescriptor_Type_values_[ComGoogleProtobufDescriptors_FieldDescriptor_Type_Enum_BOOL] +J2OBJC_ENUM_CONSTANT_GETTER(ComGoogleProtobufDescriptors_FieldDescriptor_Type, BOOL) -#define ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_STRING ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_values_[ComGoogleProtobufDescriptors_FieldDescriptor_Type_Enum_STRING] -J2OBJC_ENUM_CONSTANT_GETTER(ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum, STRING) +#define ComGoogleProtobufDescriptors_FieldDescriptor_Type_STRING ComGoogleProtobufDescriptors_FieldDescriptor_Type_values_[ComGoogleProtobufDescriptors_FieldDescriptor_Type_Enum_STRING] +J2OBJC_ENUM_CONSTANT_GETTER(ComGoogleProtobufDescriptors_FieldDescriptor_Type, STRING) -#define ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_GROUP ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_values_[ComGoogleProtobufDescriptors_FieldDescriptor_Type_Enum_GROUP] -J2OBJC_ENUM_CONSTANT_GETTER(ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum, GROUP) +#define ComGoogleProtobufDescriptors_FieldDescriptor_Type_GROUP ComGoogleProtobufDescriptors_FieldDescriptor_Type_values_[ComGoogleProtobufDescriptors_FieldDescriptor_Type_Enum_GROUP] +J2OBJC_ENUM_CONSTANT_GETTER(ComGoogleProtobufDescriptors_FieldDescriptor_Type, GROUP) -#define ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_MESSAGE ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_values_[ComGoogleProtobufDescriptors_FieldDescriptor_Type_Enum_MESSAGE] -J2OBJC_ENUM_CONSTANT_GETTER(ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum, MESSAGE) +#define ComGoogleProtobufDescriptors_FieldDescriptor_Type_MESSAGE ComGoogleProtobufDescriptors_FieldDescriptor_Type_values_[ComGoogleProtobufDescriptors_FieldDescriptor_Type_Enum_MESSAGE] +J2OBJC_ENUM_CONSTANT_GETTER(ComGoogleProtobufDescriptors_FieldDescriptor_Type, MESSAGE) -#define ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_BYTES ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_values_[ComGoogleProtobufDescriptors_FieldDescriptor_Type_Enum_BYTES] -J2OBJC_ENUM_CONSTANT_GETTER(ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum, BYTES) +#define ComGoogleProtobufDescriptors_FieldDescriptor_Type_BYTES ComGoogleProtobufDescriptors_FieldDescriptor_Type_values_[ComGoogleProtobufDescriptors_FieldDescriptor_Type_Enum_BYTES] +J2OBJC_ENUM_CONSTANT_GETTER(ComGoogleProtobufDescriptors_FieldDescriptor_Type, BYTES) -#define ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_UINT32 ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_values_[ComGoogleProtobufDescriptors_FieldDescriptor_Type_Enum_UINT32] -J2OBJC_ENUM_CONSTANT_GETTER(ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum, UINT32) +#define ComGoogleProtobufDescriptors_FieldDescriptor_Type_UINT32 ComGoogleProtobufDescriptors_FieldDescriptor_Type_values_[ComGoogleProtobufDescriptors_FieldDescriptor_Type_Enum_UINT32] +J2OBJC_ENUM_CONSTANT_GETTER(ComGoogleProtobufDescriptors_FieldDescriptor_Type, UINT32) -#define ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_ENUM ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_values_[ComGoogleProtobufDescriptors_FieldDescriptor_Type_Enum_ENUM] -J2OBJC_ENUM_CONSTANT_GETTER(ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum, ENUM) +#define ComGoogleProtobufDescriptors_FieldDescriptor_Type_ENUM ComGoogleProtobufDescriptors_FieldDescriptor_Type_values_[ComGoogleProtobufDescriptors_FieldDescriptor_Type_Enum_ENUM] +J2OBJC_ENUM_CONSTANT_GETTER(ComGoogleProtobufDescriptors_FieldDescriptor_Type, ENUM) -#define ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_SFIXED32 ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_values_[ComGoogleProtobufDescriptors_FieldDescriptor_Type_Enum_SFIXED32] -J2OBJC_ENUM_CONSTANT_GETTER(ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum, SFIXED32) +#define ComGoogleProtobufDescriptors_FieldDescriptor_Type_SFIXED32 ComGoogleProtobufDescriptors_FieldDescriptor_Type_values_[ComGoogleProtobufDescriptors_FieldDescriptor_Type_Enum_SFIXED32] +J2OBJC_ENUM_CONSTANT_GETTER(ComGoogleProtobufDescriptors_FieldDescriptor_Type, SFIXED32) -#define ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_SFIXED64 ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_values_[ComGoogleProtobufDescriptors_FieldDescriptor_Type_Enum_SFIXED64] -J2OBJC_ENUM_CONSTANT_GETTER(ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum, SFIXED64) +#define ComGoogleProtobufDescriptors_FieldDescriptor_Type_SFIXED64 ComGoogleProtobufDescriptors_FieldDescriptor_Type_values_[ComGoogleProtobufDescriptors_FieldDescriptor_Type_Enum_SFIXED64] +J2OBJC_ENUM_CONSTANT_GETTER(ComGoogleProtobufDescriptors_FieldDescriptor_Type, SFIXED64) -#define ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_SINT32 ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_values_[ComGoogleProtobufDescriptors_FieldDescriptor_Type_Enum_SINT32] -J2OBJC_ENUM_CONSTANT_GETTER(ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum, SINT32) +#define ComGoogleProtobufDescriptors_FieldDescriptor_Type_SINT32 ComGoogleProtobufDescriptors_FieldDescriptor_Type_values_[ComGoogleProtobufDescriptors_FieldDescriptor_Type_Enum_SINT32] +J2OBJC_ENUM_CONSTANT_GETTER(ComGoogleProtobufDescriptors_FieldDescriptor_Type, SINT32) -#define ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_SINT64 ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_values_[ComGoogleProtobufDescriptors_FieldDescriptor_Type_Enum_SINT64] -J2OBJC_ENUM_CONSTANT_GETTER(ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum, SINT64) +#define ComGoogleProtobufDescriptors_FieldDescriptor_Type_SINT64 ComGoogleProtobufDescriptors_FieldDescriptor_Type_values_[ComGoogleProtobufDescriptors_FieldDescriptor_Type_Enum_SINT64] +J2OBJC_ENUM_CONSTANT_GETTER(ComGoogleProtobufDescriptors_FieldDescriptor_Type, SINT64) -J2OBJC_TYPE_LITERAL_HEADER(ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum) +J2OBJC_TYPE_LITERAL_HEADER(ComGoogleProtobufDescriptors_FieldDescriptor_Type) +// TODO(kstanger): Remove after users have migrated. +#ifdef J2OBJC_RENAME2_ALIASES +#define ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum ComGoogleProtobufDescriptors_FieldDescriptor_Type +#define initWithComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum initWithComGoogleProtobufDescriptors_FieldDescriptor_JavaType +#define valueOfWithComGoogleProtobufDescriptorProtos_FieldDescriptorProto_TypeEnum valueOfWithComGoogleProtobufDescriptorProtos_FieldDescriptorProto_Type +#define ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_values ComGoogleProtobufDescriptors_FieldDescriptor_Type_values +#define ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_valueOfWithNSString_ ComGoogleProtobufDescriptors_FieldDescriptor_Type_valueOfWithNSString_ +#define ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_valueOfWithComGoogleProtobufDescriptorProtos_FieldDescriptorProto_TypeEnum_ ComGoogleProtobufDescriptors_FieldDescriptor_Type_valueOfWithComGoogleProtobufDescriptorProtos_FieldDescriptorProto_Type_ +#define ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_get_DOUBLE ComGoogleProtobufDescriptors_FieldDescriptor_Type_get_DOUBLE +#define ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_get_FLOAT ComGoogleProtobufDescriptors_FieldDescriptor_Type_get_FLOAT +#define ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_get_INT64 ComGoogleProtobufDescriptors_FieldDescriptor_Type_get_INT64 +#define ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_get_UINT64 ComGoogleProtobufDescriptors_FieldDescriptor_Type_get_UINT64 +#define ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_get_INT32 ComGoogleProtobufDescriptors_FieldDescriptor_Type_get_INT32 +#define ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_get_FIXED64 ComGoogleProtobufDescriptors_FieldDescriptor_Type_get_FIXED64 +#define ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_get_FIXED32 ComGoogleProtobufDescriptors_FieldDescriptor_Type_get_FIXED32 +#define ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_get_BOOL ComGoogleProtobufDescriptors_FieldDescriptor_Type_get_BOOL +#define ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_get_STRING ComGoogleProtobufDescriptors_FieldDescriptor_Type_get_STRING +#define ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_get_GROUP ComGoogleProtobufDescriptors_FieldDescriptor_Type_get_GROUP +#define ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_get_MESSAGE ComGoogleProtobufDescriptors_FieldDescriptor_Type_get_MESSAGE +#define ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_get_BYTES ComGoogleProtobufDescriptors_FieldDescriptor_Type_get_BYTES +#define ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_get_UINT32 ComGoogleProtobufDescriptors_FieldDescriptor_Type_get_UINT32 +#define ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_get_ENUM ComGoogleProtobufDescriptors_FieldDescriptor_Type_get_ENUM +#define ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_get_SFIXED32 ComGoogleProtobufDescriptors_FieldDescriptor_Type_get_SFIXED32 +#define ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_get_SFIXED64 ComGoogleProtobufDescriptors_FieldDescriptor_Type_get_SFIXED64 +#define ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_get_SINT32 ComGoogleProtobufDescriptors_FieldDescriptor_Type_get_SINT32 +#define ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_get_SINT64 ComGoogleProtobufDescriptors_FieldDescriptor_Type_get_SINT64 +#define ComGoogleProtobufDescriptors_FieldDescriptor_TypeEnum_class_ ComGoogleProtobufDescriptors_FieldDescriptor_Type_class_ +#endif // J2OBJC_RENAME2_ALIASES typedef NS_ENUM(NSUInteger, ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_Enum) { ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_Enum_INT = 0, @@ -308,21 +314,8 @@ typedef NS_ENUM(NSUInteger, ComGoogleProtobufDescriptors_FieldDescriptor_JavaTyp ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_Enum_ENUM = 7, ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_Enum_MESSAGE = 8, }; -// TODO(kstanger): Remove these defines when users have migrated. -#ifdef J2OBJC_RENAME_ALIASES -#define ComGoogleProtobufDescriptors_FieldDescriptor_JavaType ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_Enum -#define ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_INT ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_Enum_INT -#define ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_LONG ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_Enum_LONG -#define ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_FLOAT ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_Enum_FLOAT -#define ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_DOUBLE ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_Enum_DOUBLE -#define ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_BOOLEAN ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_Enum_BOOLEAN -#define ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_STRING ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_Enum_STRING -#define ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_BYTE_STRING ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_Enum_BYTE_STRING -#define ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_ENUM ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_Enum_ENUM -#define ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_MESSAGE ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_Enum_MESSAGE -#endif // J2OBJC_RENAME_ALIASES - -@interface ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum : JavaLangEnum < NSCopying > { + +@interface ComGoogleProtobufDescriptors_FieldDescriptor_JavaType : JavaLangEnum < NSCopying > { } - (instancetype)initWithId:(id)defaultDefault @@ -330,46 +323,62 @@ typedef NS_ENUM(NSUInteger, ComGoogleProtobufDescriptors_FieldDescriptor_JavaTyp withInt:(jint)__ordinal; + (IOSObjectArray *)values; -FOUNDATION_EXPORT IOSObjectArray *ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_values(); +FOUNDATION_EXPORT IOSObjectArray *ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_values(); -+ (ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum *)valueOfWithNSString:(NSString *)name; ++ (ComGoogleProtobufDescriptors_FieldDescriptor_JavaType *)valueOfWithNSString:(NSString *)name; -FOUNDATION_EXPORT ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum *ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_valueOfWithNSString_(NSString *name); +FOUNDATION_EXPORT ComGoogleProtobufDescriptors_FieldDescriptor_JavaType *ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_valueOfWithNSString_(NSString *name); - (id)copyWithZone:(NSZone *)zone; @end -J2OBJC_STATIC_INIT(ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum) +J2OBJC_STATIC_INIT(ComGoogleProtobufDescriptors_FieldDescriptor_JavaType) -FOUNDATION_EXPORT ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum *ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_values_[]; +FOUNDATION_EXPORT ComGoogleProtobufDescriptors_FieldDescriptor_JavaType *ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_values_[]; -#define ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_INT ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_values_[ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_Enum_INT] -J2OBJC_ENUM_CONSTANT_GETTER(ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum, INT) +#define ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_INT ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_values_[ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_Enum_INT] +J2OBJC_ENUM_CONSTANT_GETTER(ComGoogleProtobufDescriptors_FieldDescriptor_JavaType, INT) -#define ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_LONG ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_values_[ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_Enum_LONG] -J2OBJC_ENUM_CONSTANT_GETTER(ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum, LONG) +#define ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_LONG ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_values_[ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_Enum_LONG] +J2OBJC_ENUM_CONSTANT_GETTER(ComGoogleProtobufDescriptors_FieldDescriptor_JavaType, LONG) -#define ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_FLOAT ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_values_[ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_Enum_FLOAT] -J2OBJC_ENUM_CONSTANT_GETTER(ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum, FLOAT) +#define ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_FLOAT ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_values_[ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_Enum_FLOAT] +J2OBJC_ENUM_CONSTANT_GETTER(ComGoogleProtobufDescriptors_FieldDescriptor_JavaType, FLOAT) -#define ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_DOUBLE ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_values_[ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_Enum_DOUBLE] -J2OBJC_ENUM_CONSTANT_GETTER(ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum, DOUBLE) +#define ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_DOUBLE ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_values_[ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_Enum_DOUBLE] +J2OBJC_ENUM_CONSTANT_GETTER(ComGoogleProtobufDescriptors_FieldDescriptor_JavaType, DOUBLE) -#define ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_BOOLEAN ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_values_[ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_Enum_BOOLEAN] -J2OBJC_ENUM_CONSTANT_GETTER(ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum, BOOLEAN) +#define ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_BOOLEAN ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_values_[ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_Enum_BOOLEAN] +J2OBJC_ENUM_CONSTANT_GETTER(ComGoogleProtobufDescriptors_FieldDescriptor_JavaType, BOOLEAN) -#define ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_STRING ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_values_[ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_Enum_STRING] -J2OBJC_ENUM_CONSTANT_GETTER(ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum, STRING) +#define ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_STRING ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_values_[ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_Enum_STRING] +J2OBJC_ENUM_CONSTANT_GETTER(ComGoogleProtobufDescriptors_FieldDescriptor_JavaType, STRING) -#define ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_BYTE_STRING ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_values_[ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_Enum_BYTE_STRING] -J2OBJC_ENUM_CONSTANT_GETTER(ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum, BYTE_STRING) +#define ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_BYTE_STRING ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_values_[ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_Enum_BYTE_STRING] +J2OBJC_ENUM_CONSTANT_GETTER(ComGoogleProtobufDescriptors_FieldDescriptor_JavaType, BYTE_STRING) -#define ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_ENUM ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_values_[ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_Enum_ENUM] -J2OBJC_ENUM_CONSTANT_GETTER(ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum, ENUM) +#define ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_ENUM ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_values_[ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_Enum_ENUM] +J2OBJC_ENUM_CONSTANT_GETTER(ComGoogleProtobufDescriptors_FieldDescriptor_JavaType, ENUM) -#define ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_MESSAGE ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_values_[ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_Enum_MESSAGE] -J2OBJC_ENUM_CONSTANT_GETTER(ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum, MESSAGE) +#define ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_MESSAGE ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_values_[ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_Enum_MESSAGE] +J2OBJC_ENUM_CONSTANT_GETTER(ComGoogleProtobufDescriptors_FieldDescriptor_JavaType, MESSAGE) -J2OBJC_TYPE_LITERAL_HEADER(ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum) +J2OBJC_TYPE_LITERAL_HEADER(ComGoogleProtobufDescriptors_FieldDescriptor_JavaType) +// TODO(kstanger): Remove these defines when users have migrated. +#ifdef J2OBJC_RENAME2_ALIASES +#define ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum ComGoogleProtobufDescriptors_FieldDescriptor_JavaType +#define ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_values ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_values +#define ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_valueOfWithNSString_ ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_valueOfWithNSString_ +#define ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_get_INT ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_get_INT +#define ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_get_LONG ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_get_LONG +#define ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_get_FLOAT ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_get_FLOAT +#define ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_get_DOUBLE ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_get_DOUBLE +#define ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_get_BOOLEAN ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_get_BOOLEAN +#define ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_get_STRING ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_get_STRING +#define ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_get_BYTE_STRING ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_get_BYTE_STRING +#define ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_get_ENUM ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_get_ENUM +#define ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_get_MESSAGE ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_get_MESSAGE +#define ComGoogleProtobufDescriptors_FieldDescriptor_JavaTypeEnum_class_ ComGoogleProtobufDescriptors_FieldDescriptor_JavaType_class_ +#endif // J2OBJC_RENAME2_ALIASES #endif // __ComGoogleProtobufFieldTypes_H__ diff --git a/translator/src/main/java/com/google/devtools/j2objc/gen/StatementGenerator.java b/translator/src/main/java/com/google/devtools/j2objc/gen/StatementGenerator.java index b4795291c1..97543c5366 100644 --- a/translator/src/main/java/com/google/devtools/j2objc/gen/StatementGenerator.java +++ b/translator/src/main/java/com/google/devtools/j2objc/gen/StatementGenerator.java @@ -1120,11 +1120,8 @@ public boolean visit(SwitchCase node) { Expression expr = node.getExpression(); boolean isEnumConstant = expr.getTypeBinding().isEnum(); if (isEnumConstant) { - String typeName = nameTable.getFullName(expr.getTypeBinding()); - // TODO(kstanger): Add a NameTable method for getting the C enum name. - String bareTypeName = typeName.endsWith("Enum") - ? typeName.substring(0, typeName.length() - 4) + "_Enum" : typeName; - buffer.append(bareTypeName).append("_"); + String enumName = NameTable.getNativeEnumName(nameTable.getFullName(expr.getTypeBinding())); + buffer.append(enumName).append("_"); } if (isEnumConstant && expr instanceof SimpleName) { buffer.append(((SimpleName) expr).getIdentifier()); diff --git a/translator/src/main/java/com/google/devtools/j2objc/gen/TypeDeclarationGenerator.java b/translator/src/main/java/com/google/devtools/j2objc/gen/TypeDeclarationGenerator.java index 12fcd569f8..23309b1dc6 100644 --- a/translator/src/main/java/com/google/devtools/j2objc/gen/TypeDeclarationGenerator.java +++ b/translator/src/main/java/com/google/devtools/j2objc/gen/TypeDeclarationGenerator.java @@ -113,9 +113,9 @@ protected void generateInitialDeclaration() { println("\n@end"); // TODO(kstanger): Remove after users have migrated. if (!oldTypeName.equals(typeName)) { - println("#ifdef J2OBJC_RENAME_ALIASES"); + println("#ifdef J2OBJC_RENAME2_ALIASES"); printf("#define %s %s\n", oldTypeName, typeName); - println("#endif // J2OBJC_RENAME_ALIASES"); + println("#endif // J2OBJC_RENAME2_ALIASES"); } printCompanionClassDeclaration(); @@ -151,37 +151,23 @@ private void printNativeEnum() { } List constants = ((EnumDeclaration) typeNode).getEnumConstants(); - - // Strip enum type suffix. - String bareTypeName = typeName.endsWith("Enum") - ? typeName.substring(0, typeName.length() - 4) + "_Enum" : typeName; + String nativeName = NameTable.getNativeEnumName(typeName); // C doesn't allow empty enum declarations. Java does, so we skip the // C enum declaration and generate the type declaration. if (!constants.isEmpty()) { newline(); - printf("typedef NS_ENUM(NSUInteger, %s) {\n", bareTypeName); + printf("typedef NS_ENUM(NSUInteger, %s) {\n", nativeName); // Print C enum typedef. indent(); int ordinal = 0; for (EnumConstantDeclaration constant : constants) { printIndent(); - printf("%s_%s = %d,\n", bareTypeName, constant.getName().getIdentifier(), ordinal++); + printf("%s_%s = %d,\n", nativeName, constant.getName().getIdentifier(), ordinal++); } unindent(); print("};\n"); - - // TODO(kstanger): Remove after users have migrated. - String oldBareTypeName = oldTypeName.endsWith("Enum") - ? oldTypeName.substring(0, oldTypeName.length() - 4) : oldTypeName; - println("#ifdef J2OBJC_RENAME_ALIASES"); - printf("#define %s %s\n", oldBareTypeName, bareTypeName); - for (EnumConstantDeclaration constant : constants) { - String constantName = constant.getName().getIdentifier(); - printf("#define %s_%s %s_%s\n", oldBareTypeName, constantName, bareTypeName, constantName); - } - println("#endif // J2OBJC_RENAME_ALIASES"); } } @@ -397,25 +383,36 @@ private void printStaticInitFunction() { } else { printf("\nJ2OBJC_EMPTY_STATIC_INIT(%s)\n", typeName); } + // TODO(kstanger): Remove after users migrate. + if (!oldTypeName.equals(typeName)) { + println("#ifdef J2OBJC_RENAME2_ALIASES"); + printf("#define %s_initialize %s_initialize\n", oldTypeName, typeName); + println("#endif // J2OBJC_RENAME2_ALIASES"); + } } private void printEnumConstants() { if (typeNode instanceof EnumDeclaration) { - // Strip enum type suffix. - String bareTypeName = typeName.endsWith("Enum") - ? typeName.substring(0, typeName.length() - 4) + "_Enum" : typeName; + String nativeName = NameTable.getNativeEnumName(typeName); printf("\nFOUNDATION_EXPORT %s *%s_values_[];\n", typeName, typeName); + // TODO(kstanger): Remove after users migrate. + if (!oldTypeName.equals(typeName)) { + println("#ifdef J2OBJC_RENAME2_ALIASES"); + printf("#define %s_values_ %s_values_\n", oldTypeName, typeName); + println("#endif // J2OBJC_RENAME2_ALIASES"); + } for (EnumConstantDeclaration constant : ((EnumDeclaration) typeNode).getEnumConstants()) { String varName = nameTable.getVariableBaseName(constant.getVariableBinding()); String valueName = constant.getName().getIdentifier(); printf("\n#define %s_%s %s_values_[%s_%s]\n", - typeName, varName, typeName, bareTypeName, valueName); + typeName, varName, typeName, nativeName, valueName); printf("J2OBJC_ENUM_CONSTANT_GETTER(%s, %s)\n", typeName, varName); // TODO(kstanger): Remove after users migrate. if (!oldTypeName.equals(typeName)) { - println("#ifdef J2OBJC_RENAME_ALIASES"); + println("#ifdef J2OBJC_RENAME2_ALIASES"); + printf("#define %s_%s %s_%s\n", oldTypeName, varName, typeName, varName); printf("#define %s_get_%s %s_get_%s\n", oldTypeName, varName, typeName, varName); - println("#endif // J2OBJC_RENAME_ALIASES"); + println("#endif // J2OBJC_RENAME2_ALIASES"); } } } @@ -445,9 +442,9 @@ protected void printFieldSetters() { isVolatile, typeName, fieldName, typeStr)); // TODO(kstanger): Remove when users have migrated. if (!oldTypeName.equals(typeName)) { - println("#ifdef J2OBJC_RENAME_ALIASES"); + println("#ifdef J2OBJC_RENAME2_ALIASES"); printf("#define %s_set_%s %s_set_%s\n", oldTypeName, fieldName, typeName, fieldName); - println("#endif // J2OBJC_RENAME_ALIASES"); + println("#endif // J2OBJC_RENAME2_ALIASES"); } } } @@ -485,21 +482,6 @@ private void printStaticFieldFullDeclaration(VariableDeclarationFragment fragmen printf("J2OBJC_STATIC%s_FIELD_SETTER(%s, %s, %s)\n", volatileStr, typeName, name, objcType); } } - // TODO(kstanger): Remove when users have migrated. - String oldName = nameTable.getVariableShortName(var, true); - if (!oldName.equals(name) || !oldTypeName.equals(typeName)) { - println("#ifdef J2OBJC_RENAME_ALIASES"); - printf("#define %s_%s %s_%s\n", oldTypeName, oldName, typeName, name); - printf("#define %s_get_%s %s_get_%s\n", oldTypeName, oldName, typeName, name); - if (!isFinal) { - if (isPrimitive && !isVolatile) { - printf("#define %s_getRef_%s %s_getRef_%s\n", oldTypeName, oldName, typeName, name); - } else { - printf("#define %s_set_%s %s_set_%s\n", oldTypeName, oldName, typeName, name); - } - } - println("#endif // J2OBJC_RENAME_ALIASES"); - } } private void printTypeLiteralDeclaration() { @@ -507,9 +489,9 @@ private void printTypeLiteralDeclaration() { printf("J2OBJC_TYPE_LITERAL_HEADER(%s)\n", typeName); // TODO(kstanger): Remove when users have migrated. if (!oldTypeName.equals(typeName)) { - println("#ifdef J2OBJC_RENAME_ALIASES"); + println("#ifdef J2OBJC_RENAME2_ALIASES"); printf("#define %s_class_ %s_class_\n", oldTypeName, typeName); - println("#endif // J2OBJC_RENAME_ALIASES"); + println("#endif // J2OBJC_RENAME2_ALIASES"); } } @@ -564,9 +546,6 @@ private void printUnprefixedAlias() { String pkg = typeBinding.getPackage().getName(); if (nameTable.hasPrefix(pkg) && typeBinding.isTopLevel()) { String unprefixedName = NameTable.camelCaseQualifiedName(typeBinding.getQualifiedName()); - if (typeBinding.isEnum()) { - unprefixedName += "Enum"; - } if (!unprefixedName.equals(typeName)) { if (typeBinding.isInterface()) { // Protocols can't be used in typedefs. @@ -668,7 +647,7 @@ && needsObjcMethodFamilyNoneAttribute(methodName)) { } String[] selParts = methodName.split(":"); String[] oldSelParts = oldMethodName.split(":"); - println("#ifdef J2OBJC_RENAME_ALIASES"); + println("#ifdef J2OBJC_RENAME2_ALIASES"); for (int i = 0; i < selParts.length; i++) { String part = selParts[i]; String oldPart = oldSelParts[i]; @@ -676,7 +655,7 @@ && needsObjcMethodFamilyNoneAttribute(methodName)) { printf("#define %s %s\n", oldPart, part); } } - println("#endif // J2OBJC_RENAME_ALIASES"); + println("#endif // J2OBJC_RENAME2_ALIASES"); } private boolean needsObjcMethodFamilyNoneAttribute(String name) { @@ -721,9 +700,9 @@ protected void printFunctionDeclaration(FunctionDeclaration function) { String name = function.getName(); String oldName = function.getOldName(); if (!oldName.equals(name)) { - println("#ifdef J2OBJC_RENAME_ALIASES"); + println("#ifdef J2OBJC_RENAME2_ALIASES"); printf("#define %s %s\n", oldName, name); - println("#endif // J2OBJC_RENAME_ALIASES"); + println("#endif // J2OBJC_RENAME2_ALIASES"); } } diff --git a/translator/src/main/java/com/google/devtools/j2objc/gen/TypePrivateDeclarationGenerator.java b/translator/src/main/java/com/google/devtools/j2objc/gen/TypePrivateDeclarationGenerator.java index 5af1257f41..2cbd90ea19 100644 --- a/translator/src/main/java/com/google/devtools/j2objc/gen/TypePrivateDeclarationGenerator.java +++ b/translator/src/main/java/com/google/devtools/j2objc/gen/TypePrivateDeclarationGenerator.java @@ -110,9 +110,9 @@ protected void printFunctionDeclaration(FunctionDeclaration function) { String name = function.getName(); String oldName = function.getOldName(); if (!oldName.equals(name)) { - println("#ifdef J2OBJC_RENAME_ALIASES"); + println("#ifdef J2OBJC_RENAME2_ALIASES"); printf("#define %s %s\n", oldName, name); - println("#endif // J2OBJC_RENAME_ALIASES"); + println("#endif // J2OBJC_RENAME2_ALIASES"); } } } diff --git a/translator/src/main/java/com/google/devtools/j2objc/translate/EnumRewriter.java b/translator/src/main/java/com/google/devtools/j2objc/translate/EnumRewriter.java index a7f83e8d41..6ab6abad99 100644 --- a/translator/src/main/java/com/google/devtools/j2objc/translate/EnumRewriter.java +++ b/translator/src/main/java/com/google/devtools/j2objc/translate/EnumRewriter.java @@ -34,6 +34,7 @@ import com.google.devtools.j2objc.types.GeneratedMethodBinding; import com.google.devtools.j2objc.types.GeneratedVariableBinding; import com.google.devtools.j2objc.util.BindingUtil; +import com.google.devtools.j2objc.util.NameTable; import org.eclipse.jdt.core.dom.IMethodBinding; import org.eclipse.jdt.core.dom.ITypeBinding; @@ -141,21 +142,19 @@ private void addExtraNativeDecls(EnumDeclaration node) { // TODO(kstanger): Remove after users have migrated. String oldTypeName = nameTable.getFullName(node.getTypeBinding(), true); if (!oldTypeName.equals(typeName)) { - header.append("#ifdef J2OBJC_RENAME_ALIASES\n"); + header.append("#ifdef J2OBJC_RENAME2_ALIASES\n"); header.append(String.format( "#define %s_values %s_values\n" + "#define %s_valueOfWithNSString_ %s_valueOfWithNSString_\n", oldTypeName, typeName, oldTypeName, typeName)); - header.append("#endif // J2OBJC_RENAME_ALIASES\n"); + header.append("#endif // J2OBJC_RENAME2_ALIASES\n"); } // Append enum type suffix. - String bareTypeName = typeName.endsWith("Enum") - ? typeName.substring(0, typeName.length() - 4) + "_Enum" : typeName; + String nativeName = NameTable.getNativeEnumName(typeName); if (swiftFriendly) { - header.append(String.format( - "- (%s)toNSEnum;\n", bareTypeName)); + header.append(String.format("- (%s)toNSEnum;\n", nativeName)); } StringBuilder implementation = new StringBuilder(); @@ -196,7 +195,7 @@ private void addExtraNativeDecls(EnumDeclaration node) { implementation.append(String.format( "- (%s)toNSEnum {\n" + " return (%s)[self ordinal];\n" - + "}\n\n", bareTypeName, bareTypeName)); + + "}\n\n", nativeName, nativeName)); } // Enum constants needs to implement NSCopying. Being singletons, they diff --git a/translator/src/main/java/com/google/devtools/j2objc/util/NameTable.java b/translator/src/main/java/com/google/devtools/j2objc/util/NameTable.java index 37291340f6..9f75601f45 100644 --- a/translator/src/main/java/com/google/devtools/j2objc/util/NameTable.java +++ b/translator/src/main/java/com/google/devtools/j2objc/util/NameTable.java @@ -328,16 +328,7 @@ public void setVariableName(IVariableBinding var, String name) { * or suffix attached. */ public String getVariableBaseName(IVariableBinding var) { - return getVariableBaseName(var, false); - } - - // TODO(kstanger): Remove oldStyle param when users have migrated. - public String getVariableBaseName(IVariableBinding var, boolean oldStyle) { - if (oldStyle) { - return getVarBaseName(var, BindingUtil.isPrimitiveConstant(var) || var.isEnumConstant()); - } else { - return getVarBaseName(var, BindingUtil.isGlobalVar(var)); - } + return getVarBaseName(var, BindingUtil.isGlobalVar(var)); } /** @@ -383,15 +374,8 @@ public static String getDocCommentVariableName(IVariableBinding var) { * Gets the non-qualified variable name, with underscore suffix. */ public String getVariableShortName(IVariableBinding var) { - return getVariableShortName(var, false); - } - - // TODO(kstanger): Remove oldStyle param when users have migrated. - public String getVariableShortName(IVariableBinding var, boolean oldStyle) { - String baseName = getVariableBaseName(var, oldStyle); - if (var.isField() && (oldStyle - ? (!BindingUtil.isPrimitiveConstant(var) && !var.isEnumConstant()) - : !BindingUtil.isGlobalVar(var))) { + String baseName = getVariableBaseName(var); + if (var.isField() && !BindingUtil.isGlobalVar(var)) { return baseName + '_'; } return baseName; @@ -401,12 +385,7 @@ public String getVariableShortName(IVariableBinding var, boolean oldStyle) { * Gets the name of the variable as it is declared in ObjC, fully qualified. */ public String getVariableQualifiedName(IVariableBinding var) { - return getVariableQualifiedName(var, false); - } - - // TODO(kstanger): Remove oldStyle param when users have migrated. - public String getVariableQualifiedName(IVariableBinding var, boolean oldStyle) { - String shortName = getVariableShortName(var, oldStyle); + String shortName = getVariableShortName(var); if (BindingUtil.isGlobalVar(var)) { return getFullName(var.getDeclaringClass()) + '_' + shortName; } @@ -912,6 +891,10 @@ public static String fieldNames(List fragments) { return sb.toString(); } + public static String getNativeEnumName(String typeName) { + return typeName + "_Enum"; + } + /** * Return the full name of a type, including its package. For outer types, * is the type's full name; for example, java.lang.Object's full name is @@ -925,12 +908,11 @@ public String getFullName(ITypeBinding binding) { // TODO(kstanger): Remove oldStyle param after users migrate. public String getFullName(ITypeBinding binding, boolean oldStyle) { - String name = getFullNameInner(binding, oldStyle); - return binding.isEnum() ? (name + "Enum") : name; + String name = getFullNameInner(binding); + return binding.isEnum() && oldStyle ? (name + "Enum") : name; } - // TODO(kstanger): Remove oldStyle param after users migrate. - private String getFullNameInner(ITypeBinding binding, boolean oldStyle) { + private String getFullNameInner(ITypeBinding binding) { binding = typeEnv.mapType(binding.getErasure()); // Make sure type variables aren't included. // Use ObjectiveCType annotation, if it exists. @@ -941,7 +923,7 @@ private String getFullNameInner(ITypeBinding binding, boolean oldStyle) { ITypeBinding outerBinding = binding.getDeclaringClass(); if (outerBinding != null) { - return getFullNameInner(outerBinding, oldStyle) + '_' + getTypeSubName(binding); + return getFullNameInner(outerBinding) + '_' + getTypeSubName(binding); } String name = binding.getQualifiedName(); diff --git a/translator/src/test/java/com/google/devtools/j2objc/gen/ObjectiveCHeaderGeneratorTest.java b/translator/src/test/java/com/google/devtools/j2objc/gen/ObjectiveCHeaderGeneratorTest.java index 47908a5e8b..dccc142f1d 100644 --- a/translator/src/test/java/com/google/devtools/j2objc/gen/ObjectiveCHeaderGeneratorTest.java +++ b/translator/src/test/java/com/google/devtools/j2objc/gen/ObjectiveCHeaderGeneratorTest.java @@ -41,7 +41,7 @@ public void testInnerEnumWithPackage() throws IOException { assertTranslation(translation, "@interface MypackageExample"); // enum declaration assertTranslation(translation, "typedef NS_ENUM(NSUInteger, MypackageAbcd_Enum) {"); - assertTranslation(translation, "@interface MypackageAbcdEnum"); + assertTranslation(translation, "@interface MypackageAbcd"); assertTranslation(translation, "@interface MypackageMyClass"); assertTranslation(translation, "MypackageMyClass *myclass_;"); } @@ -466,19 +466,19 @@ public void testEnum() throws IOException { " Color_Enum_WHITE = 1,", " Color_Enum_BLUE = 2,", "};"); - assertTranslation(translation, "@interface ColorEnum : JavaLangEnum < NSCopying >"); + assertTranslation(translation, "@interface Color : JavaLangEnum < NSCopying >"); assertTranslation(translation, "+ (IOSObjectArray *)values;"); - assertTranslation(translation, "+ (ColorEnum *)valueOfWithNSString:(NSString *)name;"); - assertTranslation(translation, "FOUNDATION_EXPORT ColorEnum *ColorEnum_values_[];"); + assertTranslation(translation, "+ (Color *)valueOfWithNSString:(NSString *)name;"); + assertTranslation(translation, "FOUNDATION_EXPORT Color *Color_values_[];"); assertTranslatedLines(translation, - "#define ColorEnum_RED ColorEnum_values_[Color_Enum_RED]", - "J2OBJC_ENUM_CONSTANT_GETTER(ColorEnum, RED)"); + "#define Color_RED Color_values_[Color_Enum_RED]", + "J2OBJC_ENUM_CONSTANT_GETTER(Color, RED)"); assertTranslatedLines(translation, - "#define ColorEnum_WHITE ColorEnum_values_[Color_Enum_WHITE]", - "J2OBJC_ENUM_CONSTANT_GETTER(ColorEnum, WHITE)"); + "#define Color_WHITE Color_values_[Color_Enum_WHITE]", + "J2OBJC_ENUM_CONSTANT_GETTER(Color, WHITE)"); assertTranslatedLines(translation, - "#define ColorEnum_BLUE ColorEnum_values_[Color_Enum_BLUE]", - "J2OBJC_ENUM_CONSTANT_GETTER(ColorEnum, BLUE)"); + "#define Color_BLUE Color_values_[Color_Enum_BLUE]", + "J2OBJC_ENUM_CONSTANT_GETTER(Color, BLUE)"); } public void testEnumWithParameters() throws IOException { @@ -487,7 +487,7 @@ public void testEnumWithParameters() throws IOException { + "private int rgb; private Color(int rgb) { this.rgb = rgb; } " + "public int getRgb() { return rgb; }}", "Color", "Color.h"); - assertTranslation(translation, "@interface ColorEnum : JavaLangEnum"); + assertTranslation(translation, "@interface Color : JavaLangEnum"); translation = getTranslatedFile("Color.m"); assertTranslation(translation, "int rgb_;"); assertTranslatedLines(translation, @@ -505,7 +505,7 @@ public void testEnumWithMultipleConstructors() throws IOException { + "public int getRgb() { return rgb; }" + "public boolean isPrimaryColor() { return primary; }}", "Color", "Color.h"); - assertTranslation(translation, "@interface ColorEnum : JavaLangEnum"); + assertTranslation(translation, "@interface Color : JavaLangEnum"); translation = getTranslatedFile("Color.m"); assertTranslation(translation, "jboolean primary_;"); assertTranslatedLines(translation, @@ -518,11 +518,11 @@ public void testEnumWithMultipleConstructors() throws IOException { "withNSString:(NSString *)__name", "withInt:(jint)__ordinal {"); assertTranslation(translation, - "ColorEnum_initWithInt_withBoolean_withNSString_withInt_(" + "Color_initWithInt_withBoolean_withNSString_withInt_(" + "self, rgb, true, __name, __ordinal);"); assertTranslatedLines(translation, - "void ColorEnum_initWithInt_withBoolean_withNSString_withInt_(" - + "ColorEnum *self, jint rgb, jboolean primary, NSString *__name, jint __ordinal) {", + "void Color_initWithInt_withBoolean_withNSString_withInt_(" + + "Color *self, jint rgb, jboolean primary, NSString *__name, jint __ordinal) {", " JavaLangEnum_initWithNSString_withInt_(self, __name, __ordinal);", " self->rgb_ = rgb;", " self->primary_ = primary;", @@ -581,9 +581,9 @@ public void testEnumNaming() throws IOException { "public enum MyEnum { ONE, TWO, THREE }", "MyEnum", "MyEnum.h"); assertTranslation(translation, "typedef NS_ENUM(NSUInteger, MyEnum_Enum) {"); - assertTranslation(translation, "@interface MyEnumEnum : JavaLangEnum"); - assertTranslation(translation, "FOUNDATION_EXPORT MyEnumEnum *MyEnumEnum_values_[];"); - assertTranslation(translation, "#define MyEnumEnum_ONE MyEnumEnum_values_[MyEnum_Enum_ONE]"); + assertTranslation(translation, "@interface MyEnum : JavaLangEnum"); + assertTranslation(translation, "FOUNDATION_EXPORT MyEnum *MyEnum_values_[];"); + assertTranslation(translation, "#define MyEnum_ONE MyEnum_values_[MyEnum_Enum_ONE]"); } public void testNoImportForMappedTypes() throws IOException { @@ -613,8 +613,8 @@ public void testEmptyEnum() throws IOException { assertFalse(header.contains("typedef enum {\n} A_Foo;")); // Verify there's still a Java enum type. - assertTranslation(header, "@interface A_FooEnum : JavaLangEnum"); - assertTranslation(impl, "@implementation A_FooEnum"); + assertTranslation(header, "@interface A_Foo : JavaLangEnum"); + assertTranslation(impl, "@implementation A_Foo"); } public void testEnumWithInterfaces() throws IOException { @@ -623,7 +623,7 @@ public void testEnumWithInterfaces() throws IOException { + "enum Foo implements I, Runnable, Cloneable { " + "A, B, C; public void run() {}}}", "A", "A.h"); assertTranslation(translation, - "@interface A_FooEnum : JavaLangEnum < NSCopying, A_I, JavaLangRunnable >"); + "@interface A_Foo : JavaLangEnum < NSCopying, A_I, JavaLangRunnable >"); assertTranslation(translation, "#include \"java/lang/Runnable.h\""); } @@ -713,7 +713,7 @@ public void testEnumWithNameAndOrdinalParameters() throws IOException { + "private Test(String name, int ordinal) { this.name = name; this.ordinal = ordinal; }" + "public String getName() { return name; }}", "Test", "Test.h"); - assertTranslation(translation, "@interface TestEnum : JavaLangEnum"); + assertTranslation(translation, "@interface Test : JavaLangEnum"); translation = getTranslatedFile("Test.m"); assertTranslation(translation, "NSString *name_Test_;"); assertTranslation(translation, "int ordinal_Test_;"); @@ -728,7 +728,7 @@ public void testDeprecatedEnumType() throws IOException { Options.enableDeprecatedDeclarations(); String translation = translateSourceFile( "@Deprecated public enum Test { A, B }", "Test", "Test.h"); - assertTranslation(translation, "__attribute__((deprecated))\n@interface TestEnum"); + assertTranslation(translation, "__attribute__((deprecated))\n@interface Test"); } public void testLongConstants() throws IOException { diff --git a/translator/src/test/java/com/google/devtools/j2objc/gen/ObjectiveCImplementationGeneratorTest.java b/translator/src/test/java/com/google/devtools/j2objc/gen/ObjectiveCImplementationGeneratorTest.java index 98a1708da1..b6c377db9b 100644 --- a/translator/src/test/java/com/google/devtools/j2objc/gen/ObjectiveCImplementationGeneratorTest.java +++ b/translator/src/test/java/com/google/devtools/j2objc/gen/ObjectiveCImplementationGeneratorTest.java @@ -220,12 +220,12 @@ public void testEnum() throws IOException { String translation = translateSourceFile( "public enum Color { RED, WHITE, BLUE }", "Color", "Color.m"); - assertTranslation(translation, "ColorEnum *ColorEnum_values_[3];"); - assertTranslation(translation, "@implementation ColorEnum"); + assertTranslation(translation, "Color *Color_values_[3];"); + assertTranslation(translation, "@implementation Color"); assertTranslation(translation, - "ColorEnum_RED = new_ColorEnum_initWithNSString_withInt_(@\"RED\", 0);"); + "Color_RED = new_Color_initWithNSString_withInt_(@\"RED\", 0);"); assertTranslation(translation, "for (int i = 0; i < 3; i++) {"); - assertTranslation(translation, "ColorEnum *e = ColorEnum_values_[i];"); + assertTranslation(translation, "Color *e = Color_values_[i];"); } public void testEnumWithParameters() throws IOException { @@ -235,15 +235,15 @@ public void testEnumWithParameters() throws IOException { + "private Color(int rgb) { this.rgb = rgb; } " + "public int getRgb() { return rgb; }}"; String translation = translateSourceFile(sourceContent, "Color", "Color.m"); - assertTranslation(translation, "@implementation ColorEnum"); + assertTranslation(translation, "@implementation Color"); assertTranslation(translation, - "ColorEnum_RED = new_ColorEnum_initWithInt_withNSString_withInt_(" + "Color_RED = new_Color_initWithInt_withNSString_withInt_(" + "(jint) 0xff0000, @\"RED\", 0);"); assertTranslation(translation, - "ColorEnum_WHITE = new_ColorEnum_initWithInt_withNSString_withInt_(" + "Color_WHITE = new_Color_initWithInt_withNSString_withInt_(" + "(jint) 0xffffff, @\"WHITE\", 1);"); assertTranslation(translation, - "ColorEnum_BLUE = new_ColorEnum_initWithInt_withNSString_withInt_(" + "Color_BLUE = new_Color_initWithInt_withNSString_withInt_(" + "(jint) 0x0000ff, @\"BLUE\", 2);"); assertTranslation(translation, "- (jint)getRgb {"); assertTranslation(translation, "return rgb_;"); @@ -349,7 +349,7 @@ public void testEnumWithStaticVar() throws IOException { initializeOffset + initializeSignature.length()); assertTrue(initializeOffset == -1); - assertTranslation(translation, "int ExampleEnum_foo = 42;"); + assertTranslation(translation, "int Example_foo = 42;"); } public void testNativeCodeBlock() throws IOException { @@ -395,8 +395,8 @@ public void testEnumWithEnumField() throws IOException { assertFalse(header.contains("isPackableWithTest_TypeEnum")); assertFalse(impl.contains("\n return NO;\n [super initWithTest_TypeEnum:arg$0]}")); assertTranslation(impl, - "Test_FieldEnum_STRING = new_Test_Field_$1Enum_initWithTest_TypeEnum_withNSString_withInt_(" - + "JreLoadStatic(Test_TypeEnum, STRING), @\"STRING\", 2);"); + "Test_Field_STRING = new_Test_Field_$1_initWithTest_Type_withNSString_withInt_(" + + "JreLoadStatic(Test_Type, STRING), @\"STRING\", 2);"); } public void testAutoreleasePoolMethod() throws IOException { @@ -634,7 +634,7 @@ public void testFreeFormNativeCode() throws IOException { assertOccurrences(translation, "OCNI2", 1); assertOccurrences(translation, "OCNI3", 1); String testType = "@implementation Test\n"; - String innerType = "@implementation Test_InnerEnum"; + String innerType = "@implementation Test_Inner"; String method1 = "- (void)method1"; String method2 = "- (void)method2"; String method3 = "- (void)method3"; diff --git a/translator/src/test/java/com/google/devtools/j2objc/gen/StatementGeneratorTest.java b/translator/src/test/java/com/google/devtools/j2objc/gen/StatementGeneratorTest.java index 00d2e9a0f1..eed79594c9 100644 --- a/translator/src/test/java/com/google/devtools/j2objc/gen/StatementGeneratorTest.java +++ b/translator/src/test/java/com/google/devtools/j2objc/gen/StatementGeneratorTest.java @@ -66,7 +66,7 @@ public void testEnumConstantReferences() throws IOException { "public class A { static enum B { ONE, TWO; " + "public static B doSomething(boolean b) { return b ? ONE : TWO; }}}", "A", "A.m"); - assertTranslation(translation, "return b ? A_BEnum_ONE : A_BEnum_TWO;"); + assertTranslation(translation, "return b ? A_B_ONE : A_B_TWO;"); } public void testInnerClassFQN() throws IOException { @@ -450,7 +450,7 @@ public void testEnumInEqualsTest() throws IOException { "public class Test { enum TicTacToe { X, Y } " + "boolean isX(TicTacToe ttt) { return ttt == TicTacToe.X; } }", "Test", "Test.m"); - assertTranslation(translation, "return ttt == JreLoadStatic(Test_TicTacToeEnum, X);"); + assertTranslation(translation, "return ttt == JreLoadStatic(Test_TicTacToe, X);"); } public void testArrayLocalVariable() throws IOException { @@ -1014,7 +1014,7 @@ public void testThisCallInEnumConstructor() throws IOException { + " private Test() { this(0); }}", "Test", "Test.m"); assertTranslation(translation, - "TestEnum_initWithInt_withNSString_withInt_(self, 0, __name, __ordinal);"); + "Test_initWithInt_withNSString_withInt_(self, 0, __name, __ordinal);"); } public void testThisCallInInnerConstructor() throws IOException { @@ -1652,7 +1652,7 @@ public void testEnumThisCallWithNoArguments() throws IOException { "JavaLangEnum_initWithNSString_withInt_(self, __name, __ordinal);"); // Called from the "this()" call, the method wrapper, and the allocating constructor. assertOccurrences(translation, - "TestEnum_initWithNSString_withInt_(self, __name, __ordinal);", 3); + "Test_initWithNSString_withInt_(self, __name, __ordinal);", 3); } public void testForStatementWithMultipleInitializers() throws IOException { @@ -1668,7 +1668,7 @@ public void testSelfStaticVarAccess() throws IOException { String translation = translateSourceFile( "public class Test { enum Type { TYPE_BOOL; } Type test() { return Type.TYPE_BOOL; }}", "Test", "Test.m"); - assertTranslation(translation, "return JreLoadStatic(Test_TypeEnum, TYPE_BOOL);"); + assertTranslation(translation, "return JreLoadStatic(Test_Type, TYPE_BOOL);"); } public void testMakeQuotedStringHang() throws IOException { diff --git a/translator/src/test/java/com/google/devtools/j2objc/gen/TypeDeclarationGeneratorTest.java b/translator/src/test/java/com/google/devtools/j2objc/gen/TypeDeclarationGeneratorTest.java index 3198867ea6..d8a3952637 100644 --- a/translator/src/test/java/com/google/devtools/j2objc/gen/TypeDeclarationGeneratorTest.java +++ b/translator/src/test/java/com/google/devtools/j2objc/gen/TypeDeclarationGeneratorTest.java @@ -96,9 +96,9 @@ public void testEnumConstantAccessorMethods() throws IOException { Options.setStaticAccessorMethods(true); String source = "enum Test { ONE, TWO, EOF }"; // EOF is a reserved name. String translation = translateSourceFile(source, "Test", "Test.h"); - assertTranslation(translation, "+ (TestEnum *)ONE;"); - assertTranslation(translation, "+ (TestEnum *)TWO;"); - assertTranslation(translation, "+ (TestEnum *)EOF_;"); + assertTranslation(translation, "+ (Test *)ONE;"); + assertTranslation(translation, "+ (Test *)TWO;"); + assertTranslation(translation, "+ (Test *)EOF_;"); } // Verify that accessor methods for enum constants are generated by --swift-friendly flag. @@ -106,9 +106,9 @@ public void testSwiftFriendlyEnumConstantAccessorMethods() throws IOException { Options.setSwiftFriendly(true); String source = "enum Test { ONE, TWO, EOF }"; // EOF is a reserved name. String translation = translateSourceFile(source, "Test", "Test.h"); - assertTranslation(translation, "+ (TestEnum *)ONE;"); - assertTranslation(translation, "+ (TestEnum *)TWO;"); - assertTranslation(translation, "+ (TestEnum *)EOF_;"); + assertTranslation(translation, "+ (Test *)ONE;"); + assertTranslation(translation, "+ (Test *)TWO;"); + assertTranslation(translation, "+ (Test *)EOF_;"); } // Verify that accessor methods for enum constants are not generated by default. diff --git a/translator/src/test/java/com/google/devtools/j2objc/gen/TypeImplementationGeneratorTest.java b/translator/src/test/java/com/google/devtools/j2objc/gen/TypeImplementationGeneratorTest.java index a1b96642c5..31ffa1dbcd 100644 --- a/translator/src/test/java/com/google/devtools/j2objc/gen/TypeImplementationGeneratorTest.java +++ b/translator/src/test/java/com/google/devtools/j2objc/gen/TypeImplementationGeneratorTest.java @@ -125,9 +125,9 @@ public void testEnumConstantAccessorMethods() throws IOException { Options.setStaticAccessorMethods(true); String source = "enum Test { ONE, TWO, EOF }"; String translation = translateSourceFile(source, "Test", "Test.m"); - assertTranslatedLines(translation, "+ (TestEnum *)ONE {", "return TestEnum_ONE;"); - assertTranslatedLines(translation, "+ (TestEnum *)TWO {", "return TestEnum_TWO;"); - assertTranslatedLines(translation, "+ (TestEnum *)EOF_ {", "return TestEnum_EOF;"); + assertTranslatedLines(translation, "+ (Test *)ONE {", "return Test_ONE;"); + assertTranslatedLines(translation, "+ (Test *)TWO {", "return Test_TWO;"); + assertTranslatedLines(translation, "+ (Test *)EOF_ {", "return Test_EOF;"); } // Verify that accessor methods for enum constants are not generated by default. diff --git a/translator/src/test/java/com/google/devtools/j2objc/translate/AnonymousClassConverterTest.java b/translator/src/test/java/com/google/devtools/j2objc/translate/AnonymousClassConverterTest.java index ce5cad7e8a..86a14a9adb 100644 --- a/translator/src/test/java/com/google/devtools/j2objc/translate/AnonymousClassConverterTest.java +++ b/translator/src/test/java/com/google/devtools/j2objc/translate/AnonymousClassConverterTest.java @@ -338,16 +338,16 @@ public void testEnumConstantAnonymousClassNaming() throws IOException { + "public abstract boolean isUp(); }"; String impl = translateSourceFile(source, "Test", "Test.m"); - assertTranslation(impl, "@interface Test_$1Enum : TestEnum"); - assertTranslation(impl, "@interface Test_$2Enum : TestEnum"); + assertTranslation(impl, "@interface Test_$1 : Test"); + assertTranslation(impl, "@interface Test_$2 : Test"); assertTranslatedLines(impl, "- (instancetype)initWithNSString:(NSString *)__name", "withInt:(jint)__ordinal {"); - assertTranslation(impl, "TestEnum_initWithNSString_withInt_(self, __name, __ordinal);"); - assertTranslation(impl, "TestEnum_UP = new_Test_$1Enum_initWithNSString_withInt_(@\"UP\", 0);"); + assertTranslation(impl, "Test_initWithNSString_withInt_(self, __name, __ordinal);"); + assertTranslation(impl, "Test_UP = new_Test_$1_initWithNSString_withInt_(@\"UP\", 0);"); assertTranslation(impl, - "TestEnum_DOWN = new_Test_$2Enum_initWithNSString_withInt_(@\"DOWN\", 1);"); + "Test_DOWN = new_Test_$2_initWithNSString_withInt_(@\"DOWN\", 1);"); } public void testTwoOutersInAnonymousSubClassOfInner() throws IOException { @@ -401,22 +401,22 @@ public void testEnumWithParametersAndInnerClasses() throws IOException { + "Color(int n) {} public int getRGB() { return 0; }}", "Color", "Color.m"); - // Verify ColorEnum constructor. + // Verify Color constructor. assertTranslatedLines(impl, - "void ColorEnum_initWithInt_withNSString_withInt_(" - + "ColorEnum *self, jint n, NSString *__name, jint __ordinal) {", + "void Color_initWithInt_withNSString_withInt_(" + + "Color *self, jint n, NSString *__name, jint __ordinal) {", " JavaLangEnum_initWithNSString_withInt_(self, __name, __ordinal);", "}"); - // Verify ColorEnum$$1 constructor. + // Verify Color_$1 constructor. assertTranslatedLines(impl, - "void Color_$1Enum_initWithInt_withNSString_withInt_(" - + "Color_$1Enum *self, jint arg$0, NSString *__name, jint __ordinal) {", - " ColorEnum_initWithInt_withNSString_withInt_(self, arg$0, __name, __ordinal);", + "void Color_$1_initWithInt_withNSString_withInt_(" + + "Color_$1 *self, jint arg$0, NSString *__name, jint __ordinal) {", + " Color_initWithInt_withNSString_withInt_(self, arg$0, __name, __ordinal);", "}"); // Verify constant initialization. - assertTranslation(impl, "new_Color_$1Enum_initWithInt_withNSString_withInt_(42, @\"RED\", 0)"); + assertTranslation(impl, "new_Color_$1_initWithInt_withNSString_withInt_(42, @\"RED\", 0)"); } public void testEnumWithInnerEnum() throws IOException { @@ -430,11 +430,11 @@ public void testEnumWithInnerEnum() throws IOException { "OuterValue", "OuterValue.m"); // Verify OuterValue constant initialization. - assertTranslation(impl, "new_OuterValueEnum_initWithNSString_withInt_(@\"VALUE1\", 0)"); + assertTranslation(impl, "new_OuterValue_initWithNSString_withInt_(@\"VALUE1\", 0)"); // Verify InnerValue constant initialization. assertTranslation(impl, - "new_OuterValue_InnerValueEnum_initWithNSString_withInt_(@\"VALUE1\", 0)"); + "new_OuterValue_InnerValue_initWithNSString_withInt_(@\"VALUE1\", 0)"); } // Tests a field initialized with an anonymous class and multiple diff --git a/translator/src/test/java/com/google/devtools/j2objc/translate/AutoboxerTest.java b/translator/src/test/java/com/google/devtools/j2objc/translate/AutoboxerTest.java index 2d8d0e4f12..beae40bf99 100644 --- a/translator/src/test/java/com/google/devtools/j2objc/translate/AutoboxerTest.java +++ b/translator/src/test/java/com/google/devtools/j2objc/translate/AutoboxerTest.java @@ -294,10 +294,10 @@ public void testBoxedEnumConstructorArgs() throws IOException { String translation = translateSourceFile(source, "Test", "Test.m"); assertTranslation(translation, - "new_TestEnum_initWithId_withNSString_withInt_(" + "new_Test_initWithId_withNSString_withInt_(" + "JavaLangInteger_valueOfWithInt_(0), @\"INT\", 0)"); assertTranslation(translation, - "new_TestEnum_initWithId_withNSString_withInt_(" + "new_Test_initWithId_withNSString_withInt_(" + "JavaLangBoolean_valueOfWithBoolean_(false), @\"BOOLEAN\", 1)"); } diff --git a/translator/src/test/java/com/google/devtools/j2objc/translate/EnumRewriterTest.java b/translator/src/test/java/com/google/devtools/j2objc/translate/EnumRewriterTest.java index 5d0bc59cf1..e8df023417 100644 --- a/translator/src/test/java/com/google/devtools/j2objc/translate/EnumRewriterTest.java +++ b/translator/src/test/java/com/google/devtools/j2objc/translate/EnumRewriterTest.java @@ -34,7 +34,7 @@ public void testGenericEnumConstructor() throws IOException { "withNSString:(NSString *)__name", "withInt:(jint)__ordinal {"); assertTranslation(translation, - "TestEnum_A = new_TestEnum_initWithId_withNSString_withInt_(@\"foo\", @\"A\", 0);"); + "Test_A = new_Test_initWithId_withNSString_withInt_(@\"foo\", @\"A\", 0);"); } public void testNoDefaultToNsEnumConversion() throws Exception { diff --git a/translator/src/test/java/com/google/devtools/j2objc/translate/FunctionizerTest.java b/translator/src/test/java/com/google/devtools/j2objc/translate/FunctionizerTest.java index c35d889062..e953540ef2 100644 --- a/translator/src/test/java/com/google/devtools/j2objc/translate/FunctionizerTest.java +++ b/translator/src/test/java/com/google/devtools/j2objc/translate/FunctionizerTest.java @@ -334,15 +334,15 @@ public void testClassInitializerCalledFromEnumFunctions() throws IOException { + " void use() { test2(); }}", "A", "A.m"); // Verify valueOf function calls class init. - assertTranslatedLines(translation, "AEnum *AEnum_valueOfWithNSString_(NSString *name) {", - "AEnum_initialize();", "for (int i = 0; i < 2; i++) {"); + assertTranslatedLines(translation, "A *A_valueOfWithNSString_(NSString *name) {", + "A_initialize();", "for (int i = 0; i < 2; i++) {"); // Verify static class function calls class init. assertTranslatedLines(translation, - "id AEnum_foo() {", "AEnum_initialize();", "return AEnum_o;", "}"); + "id A_foo() {", "A_initialize();", "return A_o;", "}"); // Verify class method doesn't call class init. - assertTranslatedLines(translation, "- (void)test {", "AEnum_foo();", "}"); + assertTranslatedLines(translation, "- (void)test {", "A_foo();", "}"); // Verify non-static class function doesn't call class init. - assertTranslatedLines(translation, "void AEnum_test2(AEnum *self) {", "}"); + assertTranslatedLines(translation, "void A_test2(A *self) {", "}"); } public void testPrivateNativeMethod() throws IOException { @@ -375,9 +375,9 @@ public void testPrivateMethodCalledFromAnonymousEnum() throws IOException { String translation = translateSourceFile( "enum Test { A { void bar() { foo(); } }; private static void foo() {} }", "Test", "Test.m"); - assertTranslatedLines(translation, "- (void)bar {", "TestEnum_foo();"); - assertTranslation(translation, "static void TestEnum_foo();"); - assertTranslation(translation, "void TestEnum_foo() {"); + assertTranslatedLines(translation, "- (void)bar {", "Test_foo();"); + assertTranslation(translation, "static void Test_foo();"); + assertTranslation(translation, "void Test_foo() {"); } public void testNativeMethodsWithoutOcni() throws IOException { diff --git a/translator/src/test/java/com/google/devtools/j2objc/util/NameTableTest.java b/translator/src/test/java/com/google/devtools/j2objc/util/NameTableTest.java index 912148eeab..16a6570b01 100644 --- a/translator/src/test/java/com/google/devtools/j2objc/util/NameTableTest.java +++ b/translator/src/test/java/com/google/devtools/j2objc/util/NameTableTest.java @@ -73,7 +73,7 @@ public void testGetFullNameEnumWithInnerClasses() { assertEquals("FooBarSomeClass_Inner", nameTable.getFullName(decl.getTypeBinding())); // Inner enum should have "Enum" added to name. decl = unit.getTypes().get(2); - assertEquals("FooBarSomeClass_Inner2Enum", nameTable.getFullName(decl.getTypeBinding())); + assertEquals("FooBarSomeClass_Inner2", nameTable.getFullName(decl.getTypeBinding())); } // Verify local class name. @@ -277,17 +277,17 @@ public void testRenamePackageAnnotationEnum() throws IOException { " FBTest_Enum_FOO = 0,", " FBTest_Enum_BAR = 1,", "};"); - assertTranslation(translation, "@interface FBTestEnum : JavaLangEnum"); - assertTranslation(translation, "FBTestEnum_values()"); - assertTranslation(translation, "+ (FBTestEnum *)valueOfWithNSString:(NSString *)name;"); - assertTranslation(translation, "FBTestEnum *FBTestEnum_valueOfWithNSString_"); - assertTranslation(translation, "J2OBJC_STATIC_INIT(FBTestEnum"); - assertTranslation(translation, "@compatibility_alias FooBarTestEnum FBTestEnum;"); + assertTranslation(translation, "@interface FBTest : JavaLangEnum"); + assertTranslation(translation, "FBTest_values()"); + assertTranslation(translation, "+ (FBTest *)valueOfWithNSString:(NSString *)name;"); + assertTranslation(translation, "FBTest *FBTest_valueOfWithNSString_"); + assertTranslation(translation, "J2OBJC_STATIC_INIT(FBTest)"); + assertTranslation(translation, "@compatibility_alias FooBarTest FBTest;"); translation = getTranslatedFile("foo/bar/Test.m"); assertTranslation(translation, "#include \"foo/bar/Test.h\""); // should be full path. - assertTranslation(translation, "@implementation FBTestEnum"); - assertTranslation(translation, "J2ObjcClassInfo _FBTestEnum = { 2, \"Test\", \"foo.bar\", "); + assertTranslation(translation, "@implementation FBTest"); + assertTranslation(translation, "J2ObjcClassInfo _FBTest = { 2, \"Test\", \"foo.bar\", "); // Make sure package-info class doesn't use prefix for its own type name. translation = translateSourceFile("foo.bar.package-info", "foo/bar/package-info.m");