Package ro.redeul.google.go.intentions

Examples of ro.redeul.google.go.intentions.IntentionExecutionException


            GoStatement lastStatement = statements[statements.length - 1];
            if (isNodeOfType(lastStatement, GoElementTypes.FALLTHROUGH_STATEMENT)) {
                int start = lastStatement.getTextOffset() - se.getTextOffset();
                String msg = GoIntentionsBundle.message("error.refuse.to.convert.fallthrough");
                throw new IntentionExecutionException(msg, start, lastStatement.getTextLength());
            }
        }
    }
View Full Code Here


        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        try {
            doConvert(textBytes, baos);
            return new String(baos.toByteArray(), Charsets.UTF_8);
        } catch (IOException e) {
            throw new IntentionExecutionException(GoIntentionsBundle.message("error.convert.error"));
        }
    }
View Full Code Here

                    try {
                        out.write(Integer.parseInt(new String(textBytes, i + 2, 2), 16));
                        i += 2;
                    } catch (Exception e) {
                        String msg = GoIntentionsBundle.message("error.unknown.escape.sequence", (char) b);
                        throw new IntentionExecutionException(msg, i, 2);
                    }
                    break;
                case 'u':
                case 'U':
                    int len = b == 'u' ? 4 : 8;
                    try {
                        int codePoint = Integer.parseInt(new String(textBytes, i + 2, len), 16);
                        out.write(new String(Character.toChars(codePoint)).getBytes(Charsets.UTF_8));
                        i += len;
                    } catch (Exception e) {
                        String msg = GoIntentionsBundle.message("error.unknown.escape.sequence", (char) b);
                        throw new IntentionExecutionException(msg, i, 2);
                    }
                    break;
                default:
                    String msg = GoIntentionsBundle.message("error.unknown.escape.sequence", (char) b);
                    throw new IntentionExecutionException(msg, i, 2);
            }
            i++;
        }
        out.write('`');
    }
View Full Code Here

TOP

Related Classes of ro.redeul.google.go.intentions.IntentionExecutionException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.