@@ -816,6 +816,7 @@ static void aOrAn(StringBuilder e, RxMethod m, String wrongPre, String word, Str
816816 }
817817 }
818818
819+ jdx = 0 ;
819820 for (;;) {
820821 idx = m .javadoc .indexOf (wrongPre + " {@link " + word , jdx );
821822 if (idx >= 0 ) {
@@ -832,6 +833,7 @@ static void aOrAn(StringBuilder e, RxMethod m, String wrongPre, String word, Str
832833 }
833834 }
834835
836+ jdx = 0 ;
835837 for (;;) {
836838 idx = m .javadoc .indexOf (wrongPre + " {@linkplain " + word , jdx );
837839 if (idx >= 0 ) {
@@ -848,6 +850,7 @@ static void aOrAn(StringBuilder e, RxMethod m, String wrongPre, String word, Str
848850 }
849851 }
850852
853+ jdx = 0 ;
851854 for (;;) {
852855 idx = m .javadoc .indexOf (wrongPre + " {@code " + word , jdx );
853856 if (idx >= 0 ) {
@@ -863,7 +866,43 @@ static void aOrAn(StringBuilder e, RxMethod m, String wrongPre, String word, Str
863866 break ;
864867 }
865868 }
869+
870+ // remove linebreaks and multi-spaces
871+ String javadoc2 = m .javadoc .replace ("\n " , " " ).replace ("\r " , " " )
872+ .replace (" * " , " " )
873+ .replaceAll ("\\ s+" , " " );
874+
875+ // strip {@xxx } tags
876+ int kk = 0 ;
877+ for (;;) {
878+ int jj = javadoc2 .indexOf ("{@" , kk );
879+ if (jj < 0 ) {
880+ break ;
881+ }
882+ int nn = javadoc2 .indexOf (" " , jj + 2 );
883+ int mm = javadoc2 .indexOf ("}" , jj + 2 );
884+
885+ javadoc2 = javadoc2 .substring (0 , jj ) + javadoc2 .substring (nn + 1 , mm ) + javadoc2 .substring (mm + 1 );
866886
887+ kk = mm + 1 ;
888+ }
889+
890+ jdx = 0 ;
891+ for (;;) {
892+ idx = javadoc2 .indexOf (wrongPre + " " + word , jdx );
893+ if (idx >= 0 ) {
894+ e .append ("java.lang.RuntimeException: a/an typo " )
895+ .append (word )
896+ .append ("\r \n at io.reactivex." )
897+ .append (baseTypeName )
898+ .append (" (" )
899+ .append (baseTypeName )
900+ .append (".java:" ).append (m .javadocLine ).append (")\r \n \r \n " );
901+ jdx = idx + wrongPre .length () + 1 + word .length ();
902+ } else {
903+ break ;
904+ }
905+ }
867906 }
868907
869908 static void missingClosingDD (StringBuilder e , RxMethod m , String baseTypeName ) {
0 commit comments