From 473c8cda3191ca5b1c2c019d7d31607674efb5cd Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Mon, 31 Jan 2011 19:04:03 +0100 Subject: [PATCH] Cleanup --- .../src/com/intellij/lexer/JavaLexer.java | 18 ++++++++---------- .../codeInspection/LocalQuickFixProvider.java | 6 ++++-- .../daemon/impl/quickfix/QuickFixAction.java | 9 ++++----- 3 files changed, 16 insertions(+), 17 deletions(-) diff --git a/java/java-impl/src/com/intellij/lexer/JavaLexer.java b/java/java-impl/src/com/intellij/lexer/JavaLexer.java index 4a6ee9fcb0f7..83e8222d956f 100644 --- a/java/java-impl/src/com/intellij/lexer/JavaLexer.java +++ b/java/java-impl/src/com/intellij/lexer/JavaLexer.java @@ -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 { } } } + */ } diff --git a/platform/lang-api/src/com/intellij/codeInspection/LocalQuickFixProvider.java b/platform/lang-api/src/com/intellij/codeInspection/LocalQuickFixProvider.java index baab38d8b460..503179fbed7c 100644 --- a/platform/lang-api/src/com/intellij/codeInspection/LocalQuickFixProvider.java +++ b/platform/lang-api/src/com/intellij/codeInspection/LocalQuickFixProvider.java @@ -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(); } \ No newline at end of file diff --git a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/QuickFixAction.java b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/QuickFixAction.java index a0b76005f07b..4652d6104cde 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/QuickFixAction.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/QuickFixAction.java @@ -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 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 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 condition) {