@@ -445,7 +445,7 @@ private Set<Field> getAllInterfacesFields(List<JavaClass> interfaces) {
445
445
private void processMethod (Method m , JavaClass clazz , boolean isInterface , Set <String > methodsSet ) {
446
446
String name = m .getName ();
447
447
448
- if (name . startsWith ( "zz" )) return ;
448
+ if (isPrivateGoogleApiMember ( name )) return ;
449
449
450
450
if (m .isSynthetic () || (!m .isPublic () && !m .isProtected ())) {
451
451
return ;
@@ -504,9 +504,9 @@ private void writeMethods(Set<String> methodsSet) {
504
504
}
505
505
506
506
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 );
510
510
}
511
511
}
512
512
@@ -620,7 +620,7 @@ private String getMethodParamSignature(JavaClass clazz, Method m) {
620
620
private void processField (Field f , JavaClass clazz ) {
621
621
String fieldName = f .getName ();
622
622
623
- if (fieldName . startsWith ( "zz" )) return ;
623
+ if (isPrivateGoogleApiMember ( fieldName )) return ;
624
624
625
625
String tabs = getTabs (this .indent + 1 );
626
626
sbContent .append (tabs + "public " );
@@ -661,7 +661,7 @@ private String getTypeScriptTypeFromJavaType(JavaClass clazz, Type type) {
661
661
convertToTypeScriptType (type , sb );
662
662
tsType = sb .toString ();
663
663
664
- if (tsType .startsWith ("java.util.function" ) || tsType . contains ( "zz" )) {
664
+ if (tsType .startsWith ("java.util.function" ) || isPrivateGoogleApiClass ( tsType )) {
665
665
tsType = "any /* " + tsType + "*/" ;
666
666
}
667
667
}
@@ -700,7 +700,7 @@ private void convertToTypeScriptType(Type type, StringBuilder tsType) {
700
700
typeName = typeName .replaceAll ("\\ $" , "\\ ." );
701
701
}
702
702
703
- if (!typeBelongsInCurrentTopLevelNamespace (typeName ) && !typeName .startsWith ("java.util.function." ) && !typeName . contains ( "zz" )) {
703
+ if (!typeBelongsInCurrentTopLevelNamespace (typeName ) && !typeName .startsWith ("java.util.function." ) && !isPrivateGoogleApiClass ( typeName )) {
704
704
tsType .append (getAliasedClassName (typeName ));
705
705
} else {
706
706
tsType .append (typeName );
@@ -772,6 +772,15 @@ private String getTabs(int count) {
772
772
return tabs ;
773
773
}
774
774
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
+
775
784
private void overrideFieldComparator () {
776
785
BCELComparator cmp = Field .getComparator ();
777
786
0 commit comments