public boolean checkForAlreadyExistingNodesAndGenerateError(EclipseNode builderType,SingularData data){
  for (  EclipseNode child : builderType.down()) {
switch (child.getKind()) {
case FIELD:
{
        FieldDeclaration fd=(FieldDeclaration)child.get();
        char[] name=fd.name;
        if (name == null)         continue;
        if (getGeneratedBy(fd) != null)         continue;
        for (        char[] fieldToBeGenerated : listFieldsToBeGenerated(data,builderType)) {
          if (!Arrays.equals(name,fieldToBeGenerated))           continue;
          child.addError("Manually adding a field that @Singular @Builder would generate is not supported. If you want to manually manage the builder aspect for this field/parameter, don't use @Singular.");
          return true;
        }
        break;
      }
case METHOD:
{
      AbstractMethodDeclaration method=(AbstractMethodDeclaration)child.get();
      char[] name=method.selector;
      if (name == null)       continue;
      if (getGeneratedBy(method) != null)       continue;
      for (      char[] methodToBeGenerated : listMethodsToBeGenerated(data,builderType)) {
        if (!Arrays.equals(name,methodToBeGenerated))         continue;
        child.addError("Manually adding a method that @Singular @Builder would generate is not supported. If you want to manually manage the builder aspect for this field/parameter, don't use @Singular.");
        return true;
      }
      break;
    }
}
}
return false;
}

public boolean checkForAlreadyExistingNodesAndGenerateError ( EclipseNode builderType , SingularData data ) { for ( EclipseNode child : builderType . down ( ) ) { switch ( child . getKind ( ) ) { case FIELD : { FieldDeclaration fd = ( FieldDeclaration ) child . get ( ) ; char [ ] name = fd . name ; if ( name == null ) continue ; if ( getGeneratedBy ( fd ) != null ) continue ; for ( char [ ] fieldToBeGenerated : listFieldsToBeGenerated ( data , builderType ) ) { if ( ! Arrays . equals ( name , fieldToBeGenerated ) ) continue ; child . addError ( "Manually adding a field that @Singular @Builder would generate is not supported. If you want to manually manage the builder aspect for this field/parameter, don't use @Singular." ) ; return true ; } break ; } case METHOD : { AbstractMethodDeclaration method = ( AbstractMethodDeclaration ) child . get ( ) ; char [ ] name = method . selector ; if ( name == null ) continue ; if ( getGeneratedBy ( method ) != null ) continue ; for ( char [ ] methodToBeGenerated : listMethodsToBeGenerated ( data , builderType ) ) { if ( ! Arrays . equals ( name , methodToBeGenerated ) ) continue ; child . addError ( "Manually adding a method that @Singular @Builder would generate is not supported. If you want to manually manage the builder aspect for this field/parameter, don't use @Singular." ) ; return true ; } break ; } } } return false ; }
checks if any of the to - be - generated nodes ( fields , methods ) already exist . if so , errors on these ( singulars don ' t support manually writing some of it , and returns true ) .
