@@ -445,7 +445,7 @@ private Set<Field> getAllInterfacesFields(List<JavaClass> interfaces) {
445445 private void processMethod (Method m , JavaClass clazz , boolean isInterface , Set <String > methodsSet ) {
446446 String name = m .getName ();
447447
448- if (name . startsWith ( "zz" )) return ;
448+ if (isPrivateGoogleApiMember ( name )) return ;
449449
450450 if (m .isSynthetic () || (!m .isPublic () && !m .isProtected ())) {
451451 return ;
@@ -504,9 +504,9 @@ private void writeMethods(Set<String> methodsSet) {
504504 }
505505
506506 private void cacheMethodBySignature (Method m ) {
507- String currMethodSig = m .getName (); //getMethodFullSignature(m );
508- if (!mapNameMethod .containsKey (currMethodSig )) {
509- mapNameMethod .put (currMethodSig , m );
507+ String methodName = m .getName ();
508+ if (!mapNameMethod .containsKey (methodName )) {
509+ mapNameMethod .put (methodName , m );
510510 }
511511 }
512512
@@ -620,7 +620,7 @@ private String getMethodParamSignature(JavaClass clazz, Method m) {
620620 private void processField (Field f , JavaClass clazz ) {
621621 String fieldName = f .getName ();
622622
623- if (fieldName . startsWith ( "zz" )) return ;
623+ if (isPrivateGoogleApiMember ( fieldName )) return ;
624624
625625 String tabs = getTabs (this .indent + 1 );
626626 sbContent .append (tabs + "public " );
@@ -661,7 +661,7 @@ private String getTypeScriptTypeFromJavaType(JavaClass clazz, Type type) {
661661 convertToTypeScriptType (type , sb );
662662 tsType = sb .toString ();
663663
664- if (tsType .startsWith ("java.util.function" ) || tsType . contains ( "zz" )) {
664+ if (tsType .startsWith ("java.util.function" ) || isPrivateGoogleApiClass ( tsType )) {
665665 tsType = "any /* " + tsType + "*/" ;
666666 }
667667 }
@@ -700,7 +700,7 @@ private void convertToTypeScriptType(Type type, StringBuilder tsType) {
700700 typeName = typeName .replaceAll ("\\ $" , "\\ ." );
701701 }
702702
703- if (!typeBelongsInCurrentTopLevelNamespace (typeName ) && !typeName .startsWith ("java.util.function." ) && !typeName . contains ( "zz" )) {
703+ if (!typeBelongsInCurrentTopLevelNamespace (typeName ) && !typeName .startsWith ("java.util.function." ) && !isPrivateGoogleApiClass ( typeName )) {
704704 tsType .append (getAliasedClassName (typeName ));
705705 } else {
706706 tsType .append (typeName );
@@ -772,6 +772,15 @@ private String getTabs(int count) {
772772 return tabs ;
773773 }
774774
775+ private boolean isPrivateGoogleApiMember (String memberName ) {
776+ return memberName .startsWith ("zz" );
777+ }
778+
779+ private boolean isPrivateGoogleApiClass (String name ) {
780+ String [] classNameParts = name .replace ('$' , '.' ).split ("\\ ." );
781+ return classNameParts .length > 0 && classNameParts [classNameParts .length - 1 ].startsWith ("zz" );
782+ }
783+
775784 private void overrideFieldComparator () {
776785 BCELComparator cmp = Field .getComparator ();
777786
0 commit comments