Buggy code:
public class MaterialDefUtils { public static void computeShaderNodeGenerationInfo ( TechniqueDef technique ) { List < ShaderNodeVariable > attributes = technique . getShaderGenerationInfo ( ) . getAttributes ( ) ; List < ShaderNodeVariable > fragmentGlobals = technique . getShaderGenerationInfo ( ) . getFragmentGlobals ( ) ; List < ShaderNodeVariable > fragmentUniforms = technique . getShaderGenerationInfo ( ) . getFragmentUniforms ( ) ; List < ShaderNodeVariable > vertexUniforms = technique . getShaderGenerationInfo ( ) . getVertexUniforms ( ) ; List < ShaderNodeVariable > varyings = technique . getShaderGenerationInfo ( ) . getVaryings ( ) ; List < String > unusedNodes = technique . getShaderGenerationInfo ( ) . getUnusedNodes ( ) ; for ( ShaderNode shaderNode : technique . getShaderNodes ( ) ) { unusedNodes . add ( shaderNode . getName ( ) ) ; } for ( ShaderNode sn : technique . getShaderNodes ( ) ) { ShaderNodeDefinition def = sn . getDefinition ( ) ; List < VariableMapping > in = sn . getInputMapping ( ) ; if ( in != null ) { for ( VariableMapping map : in ) { ShaderNodeVariable var = map . getRightVariable ( ) ; if ( var . getNameSpace ( ) . equals ( "Global" ) ) { MaterialDefUtils . computeGlobals ( technique , fragmentGlobals , def , var ) ; } else if ( var . getNameSpace ( ) . equals ( "Attr" ) ) { <START_BUG> attributes . add ( var ) ; <END_BUG> } else if ( ( var . getNameSpace ( ) . equals ( "MatParam" ) ) || ( var . getNameSpace ( ) . equals ( "WorldParam" ) ) ) { var . setName ( var . getName ( ) . replaceFirst ( "g_" , "" ) . replaceAll ( "m_" , "" ) ) ; if ( ( def . getType ( ) ) == ( ShaderType . Fragment ) ) { MaterialDefUtils . addUnique ( fragmentUniforms , var ) ; } else { MaterialDefUtils . addUnique ( vertexUniforms , var ) ; } } else { ShaderNode otherNode = null ; otherNode = MaterialDefUtils . findShaderNodeByName ( technique , var . getNameSpace ( ) ) ; if ( otherNode == null ) { continue ; } if ( ( otherNode . getDefinition ( ) . getType ( ) ) != ( def . getType ( ) ) ) { MaterialDefUtils . addUnique ( varyings , var ) ; var . setShaderOutput ( true ) ; for ( VariableMapping variableMapping : otherNode . getInputMapping ( ) ) { if ( variableMapping . getLeftVariable ( ) . getName ( ) . equals ( var . getName ( ) ) ) { variableMapping . getLeftVariable ( ) . setShaderOutput ( true ) ; } } } unusedNodes . remove ( otherNode . getName ( ) ) ; } } } List < VariableMapping > out = sn . getOutputMapping ( ) ; if ( ( out != null ) && ( ! ( out . isEmpty ( ) ) ) ) { for ( VariableMapping map : out ) { ShaderNodeVariable var = map . getLeftVariable ( ) ; if ( var . getNameSpace ( ) . equals ( "Global" ) ) { MaterialDefUtils . computeGlobals ( technique , fragmentGlobals , def , var ) ; } } unusedNodes . remove ( sn . getName ( ) ) ; } else { if ( sn . getDefinition ( ) . isNoOutput ( ) ) { unusedNodes . remove ( sn . getName ( ) ) ; } } } } public static void fixUniformNames ( ShaderGenerationInfo info ) { } private static void addUnique ( List < ShaderNodeVariable > variables , ShaderNodeVariable var ) { } private static void fixUniformName ( ShaderNodeVariable var ) { } private static ShaderNode findShaderNodeByName ( TechniqueDef technique , String name ) { } public static void getAllUniforms ( TechniqueDef technique , MaterialDef matDef , List < ShaderNodeVariable > uniforms ) { } private static void computeGlobals ( TechniqueDef technique , List < ShaderNodeVariable > fragmentGlobals , ShaderNodeDefinition def , ShaderNodeVariable var ) { } public static boolean contains ( List < ShaderNodeVariable > vars , ShaderNodeVariable var ) { } public static String makeConnectionKey ( String rightNameSpace , String rightName , String leftNameSpace , String leftName , String techName ) { } public static String makeShaderNodeKey ( String techName , String nodeName ) { } public static String makeGlobalOutKey ( String techName , String variableName , String index ) { } public static String makeInputKey ( String techName , String nameSpace , String variableName ) { } public static VariableMapping createVariableMapping ( Dot start , Dot end ) { } }

Fix:
MaterialDefUtils . addUnique ( attributes , var ) ;