Example usage for org.eclipse.jdt.core.compiler IProblem ParsingErrorInvalidToken

List of usage examples for org.eclipse.jdt.core.compiler IProblem ParsingErrorInvalidToken

Introduction

In this page you can find the example usage for org.eclipse.jdt.core.compiler IProblem ParsingErrorInvalidToken.

Prototype

int ParsingErrorInvalidToken

To view the source code for org.eclipse.jdt.core.compiler IProblem ParsingErrorInvalidToken.

Click Source Link

Usage

From source file:org.eclipse.jst.jsp.core.internal.java.JSPTranslator.java

License:Open Source License

protected void translateUseBean(ITextRegionCollection container) {
    ITextRegion r = null;/*from  w  w  w. j av  a  2s  .  co m*/
    String attrName = null;
    String attrValue = null;
    String id = null;
    ITextRegion idRegion = null;
    String type = null;
    ITextRegion typeRegion = null;
    String className = null;
    ITextRegion classnameRegion = null;
    String beanName = null;
    ITextRegion beanNameRegion = null;

    if (DOMRegionContext.XML_END_TAG_OPEN.equals(container.getFirstRegion().getType())) {
        if (!fUseBeansStack.isEmpty()) {
            fUseBeansStack.pop();
            appendToBuffer("}", fUserCode, false, fCurrentNode); //$NON-NLS-1$ 
        } else {
            // no useBean start tag being remembered
            ITextRegionCollection extraEndRegion = container;
            IJSPProblem missingStartTag = createJSPProblem(IJSPProblem.UseBeanStartTagMissing,
                    IJSPProblem.F_PROBLEM_ID_LITERAL,
                    NLS.bind(JSPCoreMessages.JSPTranslator_4, JSP11Namespace.ElementName.USEBEAN),
                    extraEndRegion.getStartOffset(), extraEndRegion.getEndOffset());
            fTranslationProblems.add(missingStartTag);
        }
        return;
    }

    Iterator regions = container.getRegions().iterator();
    while (regions.hasNext() && (r = (ITextRegion) regions.next()) != null
            && (r.getType() != DOMRegionContext.XML_TAG_CLOSE
                    || r.getType() != DOMRegionContext.XML_EMPTY_TAG_CLOSE)) {
        attrName = attrValue = null;
        if (r.getType().equals(DOMRegionContext.XML_TAG_ATTRIBUTE_NAME)) {
            attrName = container.getText(r).trim();
            if (regions.hasNext() && (r = (ITextRegion) regions.next()) != null
                    && r.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS) {
                if (regions.hasNext() && (r = (ITextRegion) regions.next()) != null
                        && r.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
                    attrValue = StringUtils.stripQuotes(container.getText(r));
                }
                // has equals, but no value?
            }
            // an attribute with no equals?
        }
        // (pa) might need different logic here if we wanna support more
        if (attrName != null && attrValue != null) {
            if (attrName.equals("id")) {//$NON-NLS-1$
                id = attrValue;
                idRegion = r;
            } else if (attrName.equals("class")) {//$NON-NLS-1$
                className = attrValue;
                classnameRegion = r;
            } else if (attrName.equals("type")) {//$NON-NLS-1$
                type = attrValue;
                typeRegion = r;
            } else if (attrName.equals("beanName")) { //$NON-NLS-1$
                beanName = attrValue;
                beanNameRegion = r;
            }
        }
    }

    if (id != null) {
        // The id is not a valid Java identifier
        if (!isValidJavaIdentifier(id) && idRegion != null) {
            Object problem = createJSPProblem(IJSPProblem.UseBeanInvalidID, IProblem.ParsingErrorInvalidToken,
                    MessageFormat.format(JSPCoreMessages.JSPTranslator_0, new String[] { id }),
                    container.getStartOffset(idRegion), container.getTextEndOffset(idRegion) - 1);
            fTranslationProblems.add(problem);
        }
        // No Type information is provided
        if (((type == null && className == null) || (type == null && beanName != null)) && idRegion != null) {
            Object problem = createJSPProblem(IJSPProblem.UseBeanMissingTypeInfo, IProblem.UndefinedType,
                    NLS.bind(JSPCoreMessages.JSPTranslator_3, new String[] { id }),
                    container.getStartOffset(idRegion), container.getTextEndOffset(idRegion) - 1);
            fTranslationProblems.add(problem);
        }
        // Cannot specify both a class and a beanName
        if (className != null && beanName != null && beanNameRegion != null) {
            ITextRegion nameRegion = container.getRegions().get(1);
            Object problem = createJSPProblem(IJSPProblem.UseBeanAmbiguousType, IProblem.AmbiguousType,
                    JSPCoreMessages.JSPTranslator_2, container.getStartOffset(nameRegion),
                    container.getTextEndOffset(nameRegion) - 1);
            fTranslationProblems.add(problem);
        }
        /*
         * Only have a class or a beanName at this point, and potentially
         * a type has id w/ type and/or classname/beanName
         */
        // Type id = new Classname/Beanname();
        // or
        // Type id = null; // if there is no classname or beanname
        if ((type != null || className != null)) {
            if (className != null)
                className = decodeType(className);

            if (type == null) {
                type = className;
                typeRegion = classnameRegion;
            } else
                type = decodeType(type);

            /* Now check the types (multiple of generics may be involved) */
            List errorTypeNames = new ArrayList(2);
            if (!isTypeFound(type, errorTypeNames)) {
                for (int i = 0; i < errorTypeNames.size(); i++) {
                    Object problem = createJSPProblem(IJSPProblem.F_PROBLEM_ID_LITERAL, IProblem.UndefinedType,
                            MessageFormat.format(JSPCoreMessages.JSPTranslator_1,
                                    new String[] { errorTypeNames.get(i).toString() }),
                            container.getStartOffset(typeRegion), container.getTextEndOffset(typeRegion) - 1);
                    fTranslationProblems.add(problem);
                }
            } else {
                String prefix = type + " " + id + " = "; //$NON-NLS-1$ //$NON-NLS-2$
                String suffix = "null;" + ENDL; //$NON-NLS-1$
                if (className != null)
                    suffix = "new " + className + "();" + ENDL; //$NON-NLS-1$ //$NON-NLS-2$
                else if (beanName != null)
                    suffix = "(" + type + ") java.beans.Beans.instantiate(getClass().getClassLoader(), \"" //$NON-NLS-1$//$NON-NLS-2$
                            + beanName + "\");" + ENDL; //$NON-NLS-1$
                appendToBuffer(prefix + suffix, fUserCode, true, fCurrentNode);
            }
        }
    }
    /*
     * Add a brace and remember the start tag regardless of whether a
     * variable was correctly created
     */
    if (!DOMRegionContext.XML_EMPTY_TAG_CLOSE.equals(container.getLastRegion().getType())) {
        fUseBeansStack.push(container);
        appendToBuffer("{", fUserCode, false, fCurrentNode); //$NON-NLS-1$ 
    }
}

From source file:org.grails.ide.eclipse.editor.gsp.translation.internal.GSPTranslator.java

License:Open Source License

protected void translateUseBean(ITextRegionCollection container) {
    ITextRegion r = null;/*from www. ja  v a  2  s.  c o m*/
    String attrName = null;
    String attrValue = null;
    String id = null;
    ITextRegion idRegion = null;
    String type = null;
    ITextRegion typeRegion = null;
    String className = null;
    ITextRegion classnameRegion = null;
    String beanName = null;
    ITextRegion beanNameRegion = null;

    if (DOMRegionContext.XML_END_TAG_OPEN.equals(container.getFirstRegion().getType())) {
        if (!fUseBeansStack.isEmpty()) {
            fUseBeansStack.pop();
            appendToBuffer("}", fUserCode, false, fCurrentNode); //$NON-NLS-1$ 
        } else {
            // no useBean start tag being remembered
            ITextRegionCollection extraEndRegion = container;
            IJSPProblem missingStartTag = createJSPProblem(IJSPProblem.UseBeanStartTagMissing,
                    IJSPProblem.F_PROBLEM_ID_LITERAL, "", extraEndRegion.getStartOffset(),
                    extraEndRegion.getEndOffset());
            fTranslationProblems.add(missingStartTag);
        }
        return;
    }

    Iterator regions = container.getRegions().iterator();
    while (regions.hasNext() && (r = (ITextRegion) regions.next()) != null
            && (r.getType() != DOMRegionContext.XML_TAG_CLOSE
                    || r.getType() != DOMRegionContext.XML_EMPTY_TAG_CLOSE)) {
        attrName = attrValue = null;
        if (r.getType().equals(DOMRegionContext.XML_TAG_ATTRIBUTE_NAME)) {
            attrName = container.getText(r).trim();
            if (regions.hasNext() && (r = (ITextRegion) regions.next()) != null
                    && r.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS) {
                if (regions.hasNext() && (r = (ITextRegion) regions.next()) != null
                        && r.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
                    attrValue = StringUtils.stripQuotes(container.getText(r));
                }
                // has equals, but no value?
            }
            // an attribute with no equals?
        }
        // (pa) might need different logic here if we wanna support more
        if (attrName != null && attrValue != null) {
            if (attrName.equals("id")) {//$NON-NLS-1$
                id = attrValue;
                idRegion = r;
            } else if (attrName.equals("class")) {//$NON-NLS-1$
                className = attrValue;
                classnameRegion = r;
            } else if (attrName.equals("type")) {//$NON-NLS-1$
                type = attrValue;
                typeRegion = r;
            } else if (attrName.equals("beanName")) { //$NON-NLS-1$
                beanName = attrValue;
                beanNameRegion = r;
            }
        }
    }

    if (id != null) {
        // The id is not a valid Java identifier
        if (!isValidJavaIdentifier(id) && idRegion != null) {
            Object problem = createJSPProblem(IJSPProblem.UseBeanInvalidID, IProblem.ParsingErrorInvalidToken,
                    MessageFormat.format(JSPCoreMessages.JSPTranslator_0, new String[] { id }),
                    container.getStartOffset(idRegion), container.getTextEndOffset(idRegion) - 1);
            fTranslationProblems.add(problem);
        }
        // No Type information is provided
        if (((type == null && className == null) || (type == null && beanName != null)) && idRegion != null) {
            Object problem = createJSPProblem(IJSPProblem.UseBeanMissingTypeInfo, IProblem.UndefinedType,
                    NLS.bind(JSPCoreMessages.JSPTranslator_3, new String[] { id }),
                    container.getStartOffset(idRegion), container.getTextEndOffset(idRegion) - 1);
            fTranslationProblems.add(problem);
        }
        // Cannot specify both a class and a beanName
        if (className != null && beanName != null && beanNameRegion != null) {
            ITextRegion nameRegion = container.getRegions().get(1);
            Object problem = createJSPProblem(IJSPProblem.UseBeanAmbiguousType, IProblem.AmbiguousType,
                    JSPCoreMessages.JSPTranslator_2, container.getStartOffset(nameRegion),
                    container.getTextEndOffset(nameRegion) - 1);
            fTranslationProblems.add(problem);
        }
        /*
         * Only have a class or a beanName at this point, and potentially
         * a type has id w/ type and/or classname/beanName
         */
        // Type id = new Classname/Beanname();
        // or
        // Type id = null; // if there is no classname or beanname
        if ((type != null || className != null)) {
            if (type == null) {
                type = className;
                typeRegion = classnameRegion;
            }

            /* Now check the types (multiple of generics may be involved) */
            List errorTypeNames = new ArrayList(2);
            if (!isTypeFound(type, errorTypeNames)) {
                for (int i = 0; i < errorTypeNames.size(); i++) {
                    Object problem = createJSPProblem(IJSPProblem.F_PROBLEM_ID_LITERAL, IProblem.UndefinedType,
                            MessageFormat.format(JSPCoreMessages.JSPTranslator_1,
                                    new String[] { errorTypeNames.get(i).toString() }),
                            container.getStartOffset(typeRegion), container.getTextEndOffset(typeRegion) - 1);
                    fTranslationProblems.add(problem);
                }
            } else {
                String prefix = type + " " + id + " = "; //$NON-NLS-1$ //$NON-NLS-2$
                String suffix = "null;" + ENDL; //$NON-NLS-1$
                if (className != null)
                    suffix = "new " + className + "();" + ENDL; //$NON-NLS-1$ //$NON-NLS-2$
                else if (beanName != null)
                    suffix = "(" + type + ") java.beans.Beans.instantiate(getClass().getClassLoader(), \"" //$NON-NLS-1$//$NON-NLS-2$
                            + beanName + "\");" + ENDL; //$NON-NLS-1$
                appendToBuffer(prefix + suffix, fUserCode, true, fCurrentNode);
            }
        }
    }
    /*
     * Add a brace and remember the start tag regardless of whether a
     * variable was correctly created
     */
    if (!DOMRegionContext.XML_EMPTY_TAG_CLOSE.equals(container.getLastRegion().getType())) {
        fUseBeansStack.push(container);
        // GRAILS Change: always need something around the anonymous block
        appendToBuffer("if(true){", fUserCode, false, fCurrentNode); //$NON-NLS-1$ 
        // GRAILS End
    }
}

From source file:processing.mode.java.pdex.CompileErrorMessageSimplifier.java

License:Open Source License

/**
 * Tones down the jargon in the ecj reported errors.
 *///from  www .j a  v a 2  s .c  om
public static String getSimplifiedErrorMessage(IProblem iprob, String badCode) {
    if (iprob == null)
        return null;

    String args[] = iprob.getArguments();

    if (DEBUG) {
        Messages.log("Simplifying message: " + iprob.getMessage() + " ID: " + getIDName(iprob.getID()));
        Messages.log("Arg count: " + args.length);
        for (String arg : args) {
            Messages.log("Arg " + arg);
        }
        Messages.log("Bad code: " + badCode);
    }

    String result = null;

    switch (iprob.getID()) {

    case IProblem.ParsingError:
        if (args.length > 0) {
            result = Language.interpolate("editor.status.error_on", args[0]);
        }
        break;

    case IProblem.ParsingErrorDeleteToken:
        if (args.length > 0) {
            if (args[0].equalsIgnoreCase("Invalid Character")) {
                result = getErrorMessageForCurlyQuote(badCode);
            }
        }
        break;

    case IProblem.ParsingErrorDeleteTokens:
        result = getErrorMessageForCurlyQuote(badCode);
        if (result == null) {
            result = Language.interpolate("editor.status.error_on", args[0]);
        }
        break;

    case IProblem.ParsingErrorInsertToComplete:
        if (args.length > 0) {
            if (args[0].length() == 1) {
                result = getErrorMessageForBracket(args[0].charAt(0));

            } else {
                if (args[0].equals("AssignmentOperator Expression")) {
                    result = Language.interpolate("editor.status.missing.add", "=");

                } else if (args[0].equalsIgnoreCase(") Statement")) {
                    result = getErrorMessageForBracket(args[0].charAt(0));

                } else {
                    result = Language.interpolate("editor.status.error_on", args[0]);
                }
            }
        }
        break;

    case IProblem.ParsingErrorInvalidToken:
        if (args.length > 0) {
            if (args[0].equals("int")) {
                if (args[1].equals("VariableDeclaratorId")) {
                    result = Language.text("editor.status.reserved_words");
                } else {
                    result = Language.interpolate("editor.status.error_on", args[0]);
                }
            } else if (args[0].equalsIgnoreCase("Invalid Character")) {
                result = getErrorMessageForCurlyQuote(badCode);
            }
            if (result == null) {
                result = Language.interpolate("editor.status.error_on", args[0]);
            }
        }
        break;

    case IProblem.ParsingErrorInsertTokenAfter:
        if (args.length > 0) {
            if (args[1].length() == 1) {
                result = getErrorMessageForBracket(args[1].charAt(0));
            } else {
                // https://github.com/processing/processing/issues/3104
                if (args[1].equalsIgnoreCase("Statement")) {
                    result = Language.interpolate("editor.status.error_on", args[0]);
                } else {
                    result = Language.interpolate("editor.status.error_on", args[0]) + " "
                            + Language.interpolate("editor.status.missing.add", args[1]);
                }
            }
        }
        break;

    case IProblem.ParsingErrorReplaceTokens:
        result = getErrorMessageForCurlyQuote(badCode);

    case IProblem.UndefinedConstructor:
        if (args.length == 2) {
            String constructorName = args[0];
            // For messages such as "contructor sketch_name.ClassXYZ() is undefined", change
            // constructor name to "ClassXYZ()". See #3434
            if (constructorName.contains(".")) {
                // arg[0] contains sketch name twice: sketch_150705a.sketch_150705a.Thing
                constructorName = constructorName.substring(constructorName.indexOf('.') + 1);
                constructorName = constructorName.substring(constructorName.indexOf('.') + 1);
            }
            String constructorArgs = removePackagePrefixes(args[args.length - 1]);
            result = Language.interpolate("editor.status.undefined_constructor", constructorName,
                    constructorArgs);
        }
        break;

    case IProblem.UndefinedMethod:
        if (args.length > 2) {
            String methodName = args[args.length - 2];
            String methodArgs = removePackagePrefixes(args[args.length - 1]);
            result = Language.interpolate("editor.status.undefined_method", methodName, methodArgs);
        }
        break;

    case IProblem.ParameterMismatch:
        if (args.length > 3) {
            // 2nd arg is method name, 3rd arg is correct param list
            if (args[2].trim().length() == 0) {
                // the case where no params are needed.
                result = Language.interpolate("editor.status.empty_param", args[1]);

            } else {
                result = Language.interpolate("editor.status.wrong_param", args[1], args[1],
                        removePackagePrefixes(args[2]));
                //          String method = q(args[1]);
                //          String methodDef = " \"" + args[1] + "(" + getSimpleName(args[2]) + ")\"";
                //          result = result.replace("method", method);
                //          result += methodDef;
            }
        }
        break;

    case IProblem.UndefinedField:
        if (args.length > 0) {
            result = Language.interpolate("editor.status.undef_global_var", args[0]);
        }
        break;

    case IProblem.UndefinedType:
        if (args.length > 0) {
            result = Language.interpolate("editor.status.undef_class", args[0]);
        }
        break;

    case IProblem.UnresolvedVariable:
        if (args.length > 0) {
            result = Language.interpolate("editor.status.undef_var", args[0]);
        }
        break;

    case IProblem.UndefinedName:
        if (args.length > 0) {
            result = Language.interpolate("editor.status.undef_name", args[0]);
        }
        break;

    case IProblem.UnterminatedString:
        if (badCode.contains("") || badCode.contains("?")) {
            result = Language.interpolate("editor.status.unterm_string_curly",
                    badCode.replaceAll("[^?]", ""));
        }
        break;

    case IProblem.TypeMismatch:
        if (args.length > 1) {
            result = Language.interpolate("editor.status.type_mismatch", args[0], args[1]);
            //        result = result.replace("typeA", q(args[0]));
            //        result = result.replace("typeB", q(args[1]));
        }
        break;

    case IProblem.LocalVariableIsNeverUsed:
        if (args.length > 0) {
            result = Language.interpolate("editor.status.unused_variable", args[0]);
        }
        break;

    case IProblem.UninitializedLocalVariable:
        if (args.length > 0) {
            result = Language.interpolate("editor.status.uninitialized_variable", args[0]);
        }
        break;

    case IProblem.AssignmentHasNoEffect:
        if (args.length > 0) {
            result = Language.interpolate("editor.status.no_effect_assignment", args[0]);
        }
        break;

    case IProblem.HidingEnclosingType:
        if (args.length > 0) {
            result = Language.interpolate("editor.status.hiding_enclosing_type", args[0]);
        }
        break;
    }

    if (result == null) {
        String message = iprob.getMessage();
        if (message != null) {
            // Remove all instances of token
            // "Syntax error on token 'blah', delete this token"
            Matcher matcher = tokenRegExp.matcher(message);
            message = matcher.replaceAll("");
            result = message;
        }
    }

    if (DEBUG) {
        Messages.log("Simplified Error Msg: " + result);
    }

    return result;
}

From source file:processing.mode.java.pdex.ErrorMessageSimplifier.java

License:Open Source License

/**
 * Tones down the jargon in the ecj reported errors.
 *//*from  w  ww  . java 2s. c om*/
public static String getSimplifiedErrorMessage(JavaProblem problem) {
    if (problem == null)
        return null;

    IProblem iprob = problem.getIProblem();
    String args[] = iprob.getArguments();
    //    Base.log("Simplifying message: " + problem.getMessage() + " ID: "
    //        + getIDName(iprob.getID()));
    //    Base.log("Arg count: " + args.length);
    //    for (int i = 0; i < args.length; i++) {
    //      Base.log("Arg " + args[i]);
    //    }

    String result = null;

    switch (iprob.getID()) {

    case IProblem.ParsingError:
        if (args.length > 0) {
            result = Language.interpolate("editor.status.error_on", args[0]);
        }
        break;

    case IProblem.ParsingErrorDeleteToken:
        if (args.length > 0) {
            result = Language.interpolate("editor.status.error_on", args[0]);
        }
        break;

    case IProblem.ParsingErrorInsertToComplete:
        if (args.length > 0) {
            if (args[0].length() == 1) {
                result = getErrorMessageForBracket(args[0].charAt(0));

            } else {
                if (args[0].equals("AssignmentOperator Expression")) {
                    result = Language.interpolate("editor.status.missing.add", "=");

                } else if (args[0].equalsIgnoreCase(") Statement")) {
                    result = getErrorMessageForBracket(args[0].charAt(0));

                } else {
                    result = Language.interpolate("editor.status.error_on", args[0]);
                }
            }
        }
        break;

    case IProblem.ParsingErrorInvalidToken:
        if (args.length > 0) {
            if (args[1].equals("VariableDeclaratorId")) {
                if (args[0].equals("int")) {
                    result = Language.text("editor.status.reserved_words");
                } else {
                    result = Language.interpolate("editor.status.error_on", args[0]);
                }
            } else {
                result = Language.interpolate("editor.status.error_on", args[0]);
            }
        }
        break;

    case IProblem.ParsingErrorInsertTokenAfter:
        if (args.length > 0) {
            if (args[1].length() == 1) {
                result = getErrorMessageForBracket(args[1].charAt(0));
            } else {
                // https://github.com/processing/processing/issues/3104
                if (args[1].equalsIgnoreCase("Statement")) {
                    result = Language.interpolate("editor.status.error_on", args[0]);
                } else {
                    result = Language.interpolate("editor.status.error_on", args[0]) + " "
                            + Language.interpolate("editor.status.missing.add", args[1]);
                }
            }
        }
        break;

    case IProblem.UndefinedConstructor:
        if (args.length == 2) {
            String constructorName = args[0];
            // For messages such as "contructor sketch_name.ClassXYZ() is undefined", change
            // constructor name to "ClassXYZ()". See #3434
            if (constructorName.contains(".")) {
                // arg[0] contains sketch name twice: sketch_150705a.sketch_150705a.Thing
                constructorName = constructorName.substring(constructorName.indexOf('.') + 1);
                constructorName = constructorName.substring(constructorName.indexOf('.') + 1);
            }
            String constructorArgs = removePackagePrefixes(args[args.length - 1]);
            result = Language.interpolate("editor.status.undefined_constructor", constructorName,
                    constructorArgs);
        }
        break;

    case IProblem.UndefinedMethod:
        if (args.length > 2) {
            String methodName = args[args.length - 2];
            String methodArgs = removePackagePrefixes(args[args.length - 1]);
            result = Language.interpolate("editor.status.undefined_method", methodName, methodArgs);
        }
        break;

    case IProblem.ParameterMismatch:
        if (args.length > 3) {
            // 2nd arg is method name, 3rd arg is correct param list
            if (args[2].trim().length() == 0) {
                // the case where no params are needed.
                result = Language.interpolate("editor.status.empty_param", args[1]);

            } else {
                result = Language.interpolate("editor.status.wrong_param", args[1], args[1],
                        removePackagePrefixes(args[2]));
                //          String method = q(args[1]);
                //          String methodDef = " \"" + args[1] + "(" + getSimpleName(args[2]) + ")\"";
                //          result = result.replace("method", method);
                //          result += methodDef;
            }
        }
        break;

    case IProblem.UndefinedField:
        if (args.length > 0) {
            result = Language.interpolate("editor.status.undef_global_var", args[0]);
        }
        break;

    case IProblem.UndefinedType:
        if (args.length > 0) {
            result = Language.interpolate("editor.status.undef_class", args[0]);
        }
        break;

    case IProblem.UnresolvedVariable:
        if (args.length > 0) {
            result = Language.interpolate("editor.status.undef_var", args[0]);
        }
        break;

    case IProblem.UndefinedName:
        if (args.length > 0) {
            result = Language.interpolate("editor.status.undef_name", args[0]);
        }
        break;

    case IProblem.TypeMismatch:
        if (args.length > 1) {
            result = Language.interpolate("editor.status.type_mismatch", args[0], args[1]);
            //        result = result.replace("typeA", q(args[0]));
            //        result = result.replace("typeB", q(args[1]));
        }
        break;

    case IProblem.LocalVariableIsNeverUsed:
        if (args.length > 0) {
            result = Language.interpolate("editor.status.unused_variable", args[0]);
        }
        break;

    case IProblem.UninitializedLocalVariable:
        if (args.length > 0) {
            result = Language.interpolate("editor.status.uninitialized_variable", args[0]);
        }
        break;

    case IProblem.AssignmentHasNoEffect:
        if (args.length > 0) {
            result = Language.interpolate("editor.status.no_effect_assignment", args[0]);
        }
        break;

    case IProblem.HidingEnclosingType:
        if (args.length > 0) {
            result = Language.interpolate("editor.status.hiding_enclosing_type", args[0]);
        }
    }

    //log("Simplified Error Msg: " + result);
    return (result == null) ? problem.getMessage() : result;
}