Buggy code:
private void addPathField ( Class < ? > clazz , String parentFieldPath , String parentNodePath , EntityTreeNode entityNode ) throws CleverCdrDeployException { } private void addFieldToTableColumnFieldMap ( FieldWrapper wrapper ) { } private void walkEntityTree ( EntityTreeNode node , EntityTree tree ) { } @ SuppressWarnings ( "rawtypes" ) private List executeHqlWithOneListParameter ( String hql , String parameterName , Object [ ] values ) throws AqlExcuteException { } @ SuppressWarnings ( "rawtypes" ) private List executeHqlWithOneListParameter ( String hql , String parameterName , Collection < Object > values ) throws AqlExcuteException { } private List executeSql ( String sql , Map < String , Object > parameters ) throws AqlExcuteException { } private List executeSql ( String sql ) throws AqlExcuteException { } private List executeHql ( String hql , Map < String , Object > parameters ) throws AqlExcuteException { } @ SuppressWarnings ( "rawtypes" ) private List executeHql ( String hql ) throws AqlExcuteException { } private List executeListHql ( String hql , String paramName , List paramValue ) throws AqlExcuteException { } private List executeHqlWithTransaction ( String hql , Map < String , Object > parameters ) throws AqlExcuteException { } @ Override public Map < String , Document > executeLimitedQuery ( Query query ) throws AqlExcuteException { } private void queryEntityTreeNodeCandidates ( EntityTreeNode node ) throws AqlExcuteException { } private List < Pair < Integer , EntityTreeNode > > collectSelectTargetChildNodes ( EntityTreeNode node ) { } private void getSelectTargetChildNodes ( EntityTreeNode node , List < Pair < Integer , EntityTreeNode > > nodes , Integer length ) { } private List < Pair < Integer , EntityTreeNode > > collectConditionChildNodes ( EntityTreeNode node ) { } private void getConditionChildNodes ( EntityTreeNode node , List < Pair < Integer , EntityTreeNode > > nodes , Integer length ) { } private void mergeEntityTreeBottomUp ( EntityTree tree ) { } private void mergeEntityTreeNodeBottomUp ( EntityTreeNode node ) { } private void mergeEntityTreeTopDown ( EntityTree tree ) { } private void mergeEntityTreeNodeTopDown ( EntityTreeNode node ) { } private void queryEntityTreeNodeSelectTargets ( EntityTreeNode node ) throws AqlExcuteException { } private Map < String , Document > generateResults ( EntityTree tree ) throws AqlExcuteException { } private Element generateElementTreeAccordingPath ( List < Pair < String , String > > pathParts , Element element ) throws AqlExcuteException { } private void generateResultElementRecursively ( EntityTreeNode node ) throws AqlExcuteException { } @ Override public Map < String , String > executeQuery ( Query query ) throws AqlExcuteException { } private List < EntityTreeNode > getOneBranchEntityTreeNodes ( Set < EntityTreeNode > involvedEntityTreeNodes ) { } private void walkWhereExpression ( WhereExpression expression , EntityTree tree , Set < EntityTreeNode > involvedNodes ) throws AqlExcuteException { } private void walkWhereAndSegment ( WhereAndSegment segment , EntityTree tree , Set < EntityTreeNode > involvedNodes ) throws AqlExcuteException { } private StringBuilder getHqlFromWhereExpression ( WhereExpression expression , String templateName ) { } private StringBuilder getSqlFromWhereExpression ( WhereExpression expression , String templateName ) { } private StringBuilder getHqlFromWhereAndSegment ( WhereAndSegment segment , String templateName ) { } private StringBuilder getSqlFromWhereAndSegment ( WhereAndSegment segment , String templateName ) { } private Set < Object > processWhereExpression ( WhereExpression expression , EntityTree resultTree ) throws AqlExcuteException { } private Set < Object > processWhereAndSegment ( WhereAndSegment segment , EntityTree resultTree ) throws AqlExcuteException { } private StringBuilder constructJoinFromWhereSegment ( List < EntityTreeNode > branchNodes ) { StringBuilder fromSb = new StringBuilder ( ) ; fromSb . append ( "<seq2seq4repair_space>from<seq2seq4repair_space>" ) ; StringBuilder whereSb = new StringBuilder ( ) ; whereSb . append ( "<seq2seq4repair_space>where<seq2seq4repair_space>" ) ; EntityTreeNode branchFirstNode = branchNodes . get ( 0 ) ; String branchLastNodeVariable = this . classVariableGenerator . apply ( branchFirstNode . getEntityClass ( ) ) ; <START_BUG> fromSb . append ( ( ( ( branchFirstNode . getEntityClass ( ) . getSimpleName ( ) ) + "<seq2seq4repair_space>" ) + branchLastNodeVariable ) ) ; <END_BUG> for ( int i = 0 ; i < ( ( branchNodes . size ( ) ) - 1 ) ; i ++ ) { EntityTreeNode upperNode = branchNodes . get ( i ) ; String upperNodeVariable = this . classVariableGenerator . apply ( upperNode . getEntityClass ( ) ) ; EntityTreeNode lowerNode = branchNodes . get ( ( i + 1 ) ) ; String lowerNodeVariable = this . classVariableGenerator . apply ( lowerNode . getEntityClass ( ) ) ; fromSb . append ( ( ( ( ",<seq2seq4repair_space>" + ( lowerNode . getEntityClass ( ) . getSimpleName ( ) ) ) + "<seq2seq4repair_space>" ) + lowerNodeVariable ) ) ; whereSb . append ( ( ( ( ( ( ( ( upperNodeVariable + "." ) + ( upperNode . getIdField ( ) ) ) + "<seq2seq4repair_space>=<seq2seq4repair_space>" ) + lowerNodeVariable ) + "." ) + ( lowerNode . getFieldByLength ( ( ( lowerNode . getDepth ( ) ) - ( upperNode . getDepth ( ) ) ) ) ) ) + "<seq2seq4repair_space>and<seq2seq4repair_space>" ) ) ; } return fromSb . append ( whereSb ) ; } @ SuppressWarnings ( { "rawtypes" , "unchecked" } ) private void queryEntityTreeNodeSimpleCandidates ( EntityTreeNode node ) throws AqlExcuteException { } private void queryEntityTreeNodeSimpleSelectTargets ( EntityTreeNode node , Set < Object > rootNodeCandidates ) throws AqlExcuteException { } @ SuppressWarnings ( "rawtypes" ) private List queryEntityTreeNodeCandidatesThroughJoinQuery ( FromExpression fromExpression , WhereExpression whereExpression , List < EntityTreeNode > branchNodes ) throws AqlExcuteException { } private List queryEntityTreeNodeSelectTargetsThroughJoinQuery ( Query query , List < EntityTreeNode > branchNodes , Set < Object > candidates ) throws AqlExcuteException { } private List queryDirectlyThroughJoinQuery ( Query query , List < EntityTreeNode > branchNodes ) throws AqlExcuteException { } private void constructElementTemplate ( EntityTreeNode node ) throws AqlExcuteException { } private void generateResultElement ( EntityTreeNode node ) throws AqlExcuteException { } private Map < String , String > generateResults ( EntityTree tree , Set < Object > candidates ) throws AqlExcuteException { }

Fix:
fromSb . append ( ( ( ( this . getTableNameByClass ( branchFirstNode . getEntityClass ( ) ) ) + "<seq2seq4repair_space>" ) + branchLastNodeVariable ) ) ;