This commit is contained in:
Roman Shevchenko
2011-02-08 12:16:15 +01:00
parent 5388de895f
commit 473c8cda31
3 changed files with 16 additions and 17 deletions
@@ -23,16 +23,13 @@ import com.intellij.psi.impl.source.tree.JavaDocElementType;
import com.intellij.psi.tree.IElementType;
import gnu.trove.THashSet;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.Set;
public class JavaLexer extends LexerBase {
private JavaLexer(boolean isAssertKeywordEnabled, boolean isJDK15) {
myTable = getTable(isAssertKeywordEnabled, isJDK15);
myFlexlexer = new _JavaLexer(isAssertKeywordEnabled, isJDK15);
myFlexLexer = new _JavaLexer(isAssertKeywordEnabled, isJDK15);
}
public JavaLexer(LanguageLevel level) {
@@ -59,7 +56,7 @@ public class JavaLexer extends LexerBase {
private int myBufferEndOffset;
private IElementType myTokenType;
private _JavaLexer myFlexlexer;
private _JavaLexer myFlexLexer;
//Positioned after the last symbol of the current token
private int myTokenEndOffset;
@@ -179,7 +176,7 @@ public class JavaLexer extends LexerBase {
myBufferEndOffset = endOffset;
myTokenType = null;
myTokenEndOffset = startOffset;
myFlexlexer.reset(myBuffer, startOffset, endOffset, 0);
myFlexLexer.reset(myBuffer, startOffset, endOffset, 0);
}
public int getState() {
@@ -213,7 +210,6 @@ public class JavaLexer extends LexerBase {
}
private void _locateToken() {
if (myTokenEndOffset == myBufferEndOffset) {
myTokenType = null;
myBufferIndex = myBufferEndOffset;
@@ -297,9 +293,9 @@ public class JavaLexer extends LexerBase {
private void flexLocateToken() {
try {
myFlexlexer.goTo(myBufferIndex);
myTokenType = myFlexlexer.advance();
myTokenEndOffset = myFlexlexer.getTokenEnd();
myFlexLexer.goTo(myBufferIndex);
myTokenType = myFlexLexer.advance();
myTokenEndOffset = myFlexLexer.getTokenEnd();
}
catch (IOException e) {
// Can't be
@@ -416,6 +412,7 @@ public class JavaLexer extends LexerBase {
return myBufferEndOffset;
}
/*
public static void main(String[] args) throws IOException {
File root = new File(args[0]);
@@ -472,4 +469,5 @@ public class JavaLexer extends LexerBase {
}
}
}
*/
}
@@ -13,13 +13,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.intellij.codeInspection;
import org.jetbrains.annotations.Nullable;
/*
* User: anna
* Date: 30-Nov-2006
*/
package com.intellij.codeInspection;
public interface LocalQuickFixProvider {
@Nullable
LocalQuickFix[] getQuickFixes();
}
@@ -41,8 +41,7 @@ import java.util.List;
* @author Alexey Kudravtsev
*/
public final class QuickFixAction {
private QuickFixAction() {
}
private QuickFixAction() { }
public static void registerQuickFixAction(HighlightInfo info, IntentionAction action, HighlightDisplayKey key) {
registerQuickFixAction(info, null, action, key);
@@ -54,10 +53,10 @@ public final class QuickFixAction {
@Deprecated
public static void registerQuickFixAction(HighlightInfo info, IntentionAction action, List<IntentionAction> options, String displayName) {
doregister(info, action, options, displayName, null, null);
doRegister(info, action, options, displayName, null, null);
}
private static void doregister(HighlightInfo info,
private static void doRegister(HighlightInfo info,
IntentionAction action,
List<IntentionAction> options,
String displayName,
@@ -78,7 +77,7 @@ public final class QuickFixAction {
}
public static void registerQuickFixAction(HighlightInfo info, TextRange fixRange, IntentionAction action, final HighlightDisplayKey key) {
doregister(info, action, null, HighlightDisplayKey.getDisplayNameByKey(key), fixRange, key);
doRegister(info, action, null, HighlightDisplayKey.getDisplayNameByKey(key), fixRange, key);
}
public static void unregisterQuickFixAction(HighlightInfo info, Condition<IntentionAction> condition) {