public static String formatShaderSource(String source) {      
        String[] sourceLines = source.split("\n");
        int lineNumber = 0;
        StringBuilder out = new StringBuilder();       
        for (String string : sourceLines) {
            lineNumber++;
            out.append(lineNumber).append("\t").append(string).append("\n");
        }
        return out.toString();
    }
Prepend line numbers to the source code of a shader, for output.

@param source the source
@return the formatted source code
jme3-core/src/tools/java/jme3tools/shader/ShaderDebug.java