EA-44349 - NPE: GroovyQuoteHandler.hasNonClosedLiteral

This commit is contained in:
Max Medvedev
2013-03-01 17:24:24 +04:00
parent 30e352bcdd
commit c2c13ebc5b
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2012 JetBrains s.r.o.
* Copyright 2000-2013 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -63,6 +63,7 @@ public class GroovyQuoteHandler implements MultiCharQuoteHandler {
final IElementType tokenType = iterator.getTokenType();
if (tokenType == mSTRING_LITERAL || tokenType == mGSTRING_BEGIN || tokenType == mGSTRING_LITERAL || tokenType == mGSTRING_CONTENT) {
final Document document = iterator.getDocument();
if (document == null) return false;
final String literal = document.getText().substring(iterator.getStart(), offset + 1);
if ("'''".equals(literal) || "\"\"\"".equals(literal) || "'".equals(literal) || "\"".equals(literal)) {
return true;