Buggy code:
final TypeMirror erasedType = SerializerCreator . getErasedType ( innerType , processingEnvironment ) ; resultClassname = erasedType . toString ( ) ; } cast = typeMirror . toString ( ) ; } else { resultClassname = resultType . toString ( ) ; cast = resultClassname ; } } final boolean hasReturn = ! ( "void" . equals ( resultClassname ) ) ; w . println ( "try{" ) ; w . indent ( ) ; final String s = "return" ; w . println ( ( ( ( ( ( ( "if<seq2seq4repair_space>(<seq2seq4repair_space>isMock()<seq2seq4repair_space>)<seq2seq4repair_space>{" + ( hasReturn ? "return" : "" ) ) + "<seq2seq4repair_space>createMock()." ) + methodName ) + "(" ) + ( argsBuilder . toString ( ) ) ) + ");<seq2seq4repair_space>}" ) ) ; w . println ( ( ( "java.lang.String<seq2seq4repair_space>subPath<seq2seq4repair_space>=<seq2seq4repair_space>\"" + ( ( method . getAnnotation ( Path . class ) ) != null ? method . getAnnotation ( Path . class ) . value ( ) : "" ) ) + "\";" ) ) ; w . println ( "final<seq2seq4repair_space>Map<java.lang.String,<seq2seq4repair_space>java.lang.String>additionalHeaders<seq2seq4repair_space>=<seq2seq4repair_space>new<seq2seq4repair_space>HashMap<>();" ) ; final String className = svcInf . getQualifiedName ( ) . toString ( ) ; boolean firstQueryParam = true ; final Types typeUtils = processingEnvironment . getTypeUtils ( ) ; final DeclaredType CollectionType ; { final Elements elementUtils = processingEnvironment . getElementUtils ( ) ; CollectionType = typeUtils . getDeclaredType ( elementUtils . getTypeElement ( Collection . class . getCanonicalName ( ) ) ) ; } String postParamName = null ; w . println ( "StringBuilder<seq2seq4repair_space>postBody<seq2seq4repair_space>=<seq2seq4repair_space>new<seq2seq4repair_space>StringBuilder();" ) ; for ( int i = 0 ; i < ( params . size ( ) ) ; i ++ ) { final VariableElement param = params . get ( i ) ; final TypeMirror paramType = param . asType ( ) ; String pname = "p" + i ; final QueryParam queryAnnotation = param . getAnnotation ( QueryParam . class ) ; final PathParam pathAnnotation = param . getAnnotation ( PathParam . class ) ; final HeaderParam headerAnnotation = param . getAnnotation ( HeaderParam . class ) ; if ( ( ( queryAnnotation != null ) || ( pathAnnotation != null ) ) || ( headerAnnotation != null ) ) { final boolean boxedCharacter = SerializerCreator . isBoxedCharacter ( paramType ) ; final boolean jsonPrimitive = ( SerializerCreator . isJsonPrimitive ( paramType ) ) || ( SerializerCreator . isBoxedPrimitive ( paramType ) ) ; final boolean jsonString = SerializerCreator . isJsonString ( paramType ) ; <START_BUG> if ( jsonPrimitive ) { <END_BUG> w . println ( "{" ) ; } else { w . println ( ( ( "if<seq2seq4repair_space>(" + pname ) + "<seq2seq4repair_space>!=<seq2seq4repair_space>null)<seq2seq4repair_space>{" ) ) ; } w . indent ( ) ; w . println ( "final<seq2seq4repair_space>StringBuilder<seq2seq4repair_space>param=<seq2seq4repair_space>new<seq2seq4repair_space>StringBuilder();" ) ; if ( boxedCharacter ) { w . println ( ( ( "param.append(" + pname ) + ".toString());" ) ) ; } else { if ( jsonPrimitive ) { if ( jsonString ) { w . println ( ( ( "param.append(" + pname ) + ");" ) ) ; } else { w . println ( ( ( "param.append(" + pname ) + "<seq2seq4repair_space>+<seq2seq4repair_space>\"\");" ) ) ; } } else { writeEncoded ( w , paramType , pname , serializerFields [ i ] ) ; } } w . println ( "<seq2seq4repair_space>" ) ; if ( queryAnnotation != null ) { if ( firstQueryParam ) { w . print ( "subPath<seq2seq4repair_space>+=<seq2seq4repair_space>\"?" ) ; firstQueryParam = false ; } else { w . print ( "subPath<seq2seq4repair_space>+=<seq2seq4repair_space>\"&" ) ; } w . println ( ( ( ( queryAnnotation . value ( ) ) + "=\"+param" ) + ".toString();" ) ) ; } if ( headerAnnotation != null ) { w . println ( ( ( "additionalHeaders.put(\"" + ( headerAnnotation . value ( ) ) ) + "\",<seq2seq4repair_space>param.toString());" ) ) ; } if ( pathAnnotation != null ) { final String pathVariable = ( "\\\\{" + ( pathAnnotation . value ( ) ) ) + "\\\\}" ; w . println ( ( ( "subPath<seq2seq4repair_space>=<seq2seq4repair_space>subPath.replaceFirst(\"" + pathVariable ) + "\",<seq2seq4repair_space>param.toString());" ) ) ; } w . outdent ( ) ; w . println ( "}" ) ; } else { if ( ( method . getAnnotation ( GET . class ) ) != null ) { throw new UnableToCompleteException ( ( ( ( ( ( ( "param<seq2seq4repair_space>type<seq2seq4repair_space>" + pname ) + "<seq2seq4repair_space>doesnt<seq2seq4repair_space>have<seq2seq4repair_space>a<seq2seq4repair_space>param<seq2seq4repair_space>annotation<seq2seq4repair_space>in<seq2seq4repair_space>" ) + className ) + "." ) + methodName ) + "<seq2seq4repair_space>Please<seq2seq4repair_space>use<seq2seq4repair_space>QueryParam,<seq2seq4repair_space>PathParam<seq2seq4repair_space>or<seq2seq4repair_space>HeaderParam" ) ) ; } if ( postParamName != null ) { throw new UnableToCompleteException ( ( ( ( ( ( ( ( ( "<seq2seq4repair_space>post<seq2seq4repair_space>param<seq2seq4repair_space>already<seq2seq4repair_space>set<seq2seq4repair_space>in<seq2seq4repair_space>" + className ) + "." ) + methodName ) + "<seq2seq4repair_space>" ) + postParamName ) + "," ) + pname ) + "<seq2seq4repair_space>only<seq2seq4repair_space>one<seq2seq4repair_space>post<seq2seq4repair_space>param<seq2seq4repair_space>is<seq2seq4repair_space>allowed." ) ) ; } writeBody ( w , paramType , pname , serializerFields [ i ] ) ; postParamName = pname ; } } final String methodType ; if ( ( method . getAnnotation ( POST . class ) ) != null ) { methodType = "POST" ; } else if ( ( method . getAnnotation ( PUT . class ) ) != null ) { methodType = "PUT" ; } else if ( ( method . getAnnotation ( DELETE . class ) ) != null ) { methodType = "DELETE" ; } else if ( ( method . getAnnotation ( GET . class ) ) != null ) { methodType = "GET" ; } else { throw new UnableToCompleteException ( ( ( ( "No<seq2seq4repair_space>accessor<seq2seq4repair_space>annotation<seq2seq4repair_space>on<seq2seq4repair_space>pubic<seq2seq4repair_space>method<seq2seq4repair_space>" + className ) + "." ) + methodName ) ) ; } writeCall ( w , resultType , resultField , containerClass , resultClassname , className , methodType ) ; if ( hasReturn ) { w . println ( ( ( "return<seq2seq4repair_space>(" + cast ) + ")<seq2seq4repair_space>result;" ) ) ; } w . outdent ( ) ; w . println ( "}<seq2seq4repair_space>catch<seq2seq4repair_space>(Exception<seq2seq4repair_space>ex)<seq2seq4repair_space>{" ) ; w . indent ( ) ; for ( TypeMirror exception : thrownTypes ) { String exName = exception . toString ( ) ; w . println ( ( ( ( ( "if<seq2seq4repair_space>(<seq2seq4repair_space>ex<seq2seq4repair_space>instanceof<seq2seq4repair_space>" + exName ) + "<seq2seq4repair_space>)<seq2seq4repair_space>throw<seq2seq4repair_space>(" ) + exName ) + ")<seq2seq4repair_space>ex;" ) ) ; } w . println ( "throw<seq2seq4repair_space>new<seq2seq4repair_space>RuntimeException(ex);" ) ; w . outdent ( ) ; w . println ( "}" ) ; w . outdent ( ) ; w . println ( "}"

Fix:
if ( jsonPrimitive && ( ! jsonString ) ) {