1
0
mirror of https://github.com/chylex/IntelliJ-IdeaVim.git synced 2025-08-10 06:40:37 +02:00

Added 'final' modifiers for fields where possible

This commit is contained in:
Andrey Vlasovskikh 2014-05-07 22:09:57 +04:00
parent 7cc0a8db92
commit e7addf7fa8
65 changed files with 155 additions and 155 deletions

View File

@ -673,10 +673,10 @@ public class KeyHandler {
}
}
private Editor editor;
private DataContext context;
private Command cmd;
private KeyStroke key;
private final Editor editor;
private final DataContext context;
private final Command cmd;
private final KeyStroke key;
}
private static enum State {
@ -690,7 +690,7 @@ public class KeyHandler {
private int count;
private List<KeyStroke> keys;
private State state;
@NotNull private Stack<Command> currentCmd = new Stack<Command>();
@NotNull private final Stack<Command> currentCmd = new Stack<Command>();
@NotNull private Argument.Type currentArg;
private TypedActionHandler origHandler;
@Nullable private DigraphSequence digraph = null;

View File

@ -103,22 +103,22 @@ public class VimPlugin implements ApplicationComponent, PersistentStateComponent
// It is enabled by default to avoid any special configuration after plugin installation
private boolean enabled = true;
private static Logger LOG = Logger.getInstance(VimPlugin.class);
private static final Logger LOG = Logger.getInstance(VimPlugin.class);
private final Application myApp;
private MotionGroup motion;
private ChangeGroup change;
private CopyGroup copy;
private MarkGroup mark;
private RegisterGroup register;
private FileGroup file;
private SearchGroup search;
private ProcessGroup process;
private MacroGroup macro;
private DigraphGroup digraph;
private HistoryGroup history;
private KeyGroup key;
private final MotionGroup motion;
private final ChangeGroup change;
private final CopyGroup copy;
private final MarkGroup mark;
private final RegisterGroup register;
private final FileGroup file;
private final SearchGroup search;
private final ProcessGroup process;
private final MacroGroup macro;
private final DigraphGroup digraph;
private final HistoryGroup history;
private final KeyGroup key;
public VimPlugin(final Application app) {
myApp = app;

View File

@ -58,7 +58,7 @@ import static java.awt.event.KeyEvent.*;
public class VimShortcutKeyAction extends AnAction implements DumbAware {
private static final String ACTION_ID = "VimShortcutKeyAction";
@NotNull public static Set<KeyStroke> VIM_ONLY_EDITOR_KEYS = ImmutableSet.<KeyStroke>builder()
@NotNull public static final Set<KeyStroke> VIM_ONLY_EDITOR_KEYS = ImmutableSet.<KeyStroke>builder()
.addAll(getKeyStrokes(VK_ENTER, 0))
.addAll(getKeyStrokes(VK_ESCAPE, 0))
.addAll(getKeyStrokes(VK_TAB, 0))
@ -75,7 +75,7 @@ public class VimShortcutKeyAction extends AnAction implements DumbAware {
.addAll(getKeyStrokes(VK_PAGE_DOWN, 0, SHIFT_MASK, CTRL_MASK | SHIFT_MASK))
.build();
@NotNull private static Set<KeyStroke> NON_FILE_EDITOR_KEYS = ImmutableSet.<KeyStroke>builder()
@NotNull private static final Set<KeyStroke> NON_FILE_EDITOR_KEYS = ImmutableSet.<KeyStroke>builder()
.addAll(getKeyStrokes(VK_ESCAPE, 0))
.addAll(getKeyStrokes(VK_TAB, 0))
.addAll(getKeyStrokes(VK_UP, 0))

View File

@ -36,5 +36,5 @@ public abstract class MotionEditorAction extends EditorAction {
return handler.getOffset(editor, context, count, rawCount, argument);
}
private MotionEditorActionHandler handler;
private final MotionEditorActionHandler handler;
}

View File

@ -39,5 +39,5 @@ public abstract class TextObjectAction extends EditorAction {
return handler.getRange(editor, context, count, rawCount, argument);
}
private TextObjectActionHandler handler;
private final TextObjectActionHandler handler;
}

View File

@ -140,5 +140,5 @@ public class Argument {
private char charArg = 0;
@Nullable private Command motionArg = null;
@Nullable private String strArg = null;
@NotNull private Type type;
@NotNull private final Type type;
}

View File

@ -314,7 +314,7 @@ public class Command {
private int count;
private AnAction action;
@NotNull private Type type;
@NotNull private final Type type;
private int flags;
private Argument argument;
private List<KeyStroke> keys;

View File

@ -40,8 +40,8 @@ public class CommandState {
@Nullable private static Command ourLastChange = null;
private static char ourLastRegister = RegisterGroup.REGISTER_DEFAULT;
@NotNull private Stack<State> myStates = new Stack<State>();
@NotNull private State myDefaultState = new State(Mode.COMMAND, SubMode.NONE, MappingMode.NORMAL);
@NotNull private final Stack<State> myStates = new Stack<State>();
@NotNull private final State myDefaultState = new State(Mode.COMMAND, SubMode.NONE, MappingMode.NORMAL);
@Nullable private Command myCommand;
@NotNull private ParentNode myCurrentNode = VimPlugin.getKey().getKeyRoot(getMappingMode());
@NotNull private final List<KeyStroke> myMappingKeys = new ArrayList<KeyStroke>();
@ -329,9 +329,9 @@ public class CommandState {
}
private class State {
@NotNull private Mode myMode;
@NotNull private final Mode myMode;
@NotNull private SubMode mySubMode;
@NotNull private MappingMode myMappingMode;
@NotNull private final MappingMode myMappingMode;
public State(@NotNull Mode mode, @NotNull SubMode subMode, @NotNull MappingMode mappingMode) {
this.myMode = mode;

View File

@ -52,7 +52,7 @@ public class VisualChange {
return res.toString();
}
int lines;
int columns;
@NotNull SelectionType type;
final int lines;
final int columns;
@NotNull final SelectionType type;
}

View File

@ -58,8 +58,8 @@ public class VisualRange {
return res.toString();
}
int start;
int end;
@NotNull CommandState.SubMode type;
int offset;
final int start;
final int end;
@NotNull final CommandState.SubMode type;
final int offset;
}

View File

@ -86,5 +86,5 @@ public class Mark extends FileLocation {
}
}
private char key;
private final char key;
}

View File

@ -33,8 +33,8 @@ import java.util.List;
*/
public class Register {
private char name;
@NotNull private SelectionType type;
@NotNull private List<KeyStroke> keys;
@NotNull private final SelectionType type;
@NotNull private final List<KeyStroke> keys;
public Register(char name, @NotNull SelectionType type, @NotNull String text) {
this.name = name;

View File

@ -114,6 +114,6 @@ public class TextRange {
return sb.toString();
}
private int[] starts;
private int[] ends;
private final int[] starts;
private final int[] ends;
}

View File

@ -261,7 +261,7 @@ public abstract class CommandHandler {
*/
public abstract boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull ExCommand cmd) throws ExException;
@Nullable protected CommandName[] names;
protected int argFlags;
protected int optFlags;
@Nullable protected final CommandName[] names;
protected final int argFlags;
protected final int optFlags;
}

View File

@ -35,6 +35,6 @@ public class CommandName {
return optional;
}
private String required;
private String optional;
private final String required;
private final String optional;
}

View File

@ -57,5 +57,5 @@ public class CommandNode {
}
@Nullable private CommandHandler command;
@NotNull private HashMap<Character, CommandNode> nodes = new HashMap<Character, CommandNode>();
@NotNull private final HashMap<Character, CommandNode> nodes = new HashMap<Character, CommandNode>();
}

View File

@ -595,7 +595,7 @@ public class CommandParser {
}
}
@NotNull private CommandNode root = new CommandNode();
@NotNull private final CommandNode root = new CommandNode();
private boolean registered = false;
private static CommandParser ourInstance;
@ -622,5 +622,5 @@ public class CommandParser {
private static final int STATE_RANGE_DONE = 51;
private static final int STATE_ERROR = 99;
private static Logger logger = Logger.getInstance(CommandParser.class.getName());
private static final Logger logger = Logger.getInstance(CommandParser.class.getName());
}

View File

@ -95,8 +95,8 @@ public class ExCommand {
return ranges;
}
@NotNull private Ranges ranges;
@NotNull private String command;
@NotNull private final Ranges ranges;
@NotNull private final String command;
@NotNull private String argument;
private static Logger logger = Logger.getInstance(ExCommand.class.getName());

View File

@ -41,6 +41,6 @@ public class LineRange {
return endLine;
}
private int startLine;
private int endLine;
private final int startLine;
private final int endLine;
}

View File

@ -24,9 +24,9 @@ import org.jetbrains.annotations.NotNull;
*
*/
public class ParseResult {
@NotNull private Ranges ranges;
@NotNull private String command;
@NotNull private String argument;
@NotNull private final Ranges ranges;
@NotNull private final String command;
@NotNull private final String argument;
public ParseResult(@NotNull Ranges ranges, @NotNull String command, @NotNull String argument) {
this.ranges = ranges;

View File

@ -240,5 +240,5 @@ public class Ranges {
private int count = 0;
private int defaultLine = -1;
private boolean done = false;
private List<Range> ranges;
private final List<Range> ranges;
}

View File

@ -76,5 +76,5 @@ public class CmdFilterHandler extends CommandHandler {
}
}
private static Logger logger = Logger.getInstance(CmdFilterHandler.class.getName());
private static final Logger logger = Logger.getInstance(CmdFilterHandler.class.getName());
}

View File

@ -44,5 +44,5 @@ public class DigraphHandler extends CommandHandler {
return VimPlugin.getDigraph().parseCommandLine(editor, cmd.getArgument());
}
private static Logger logger = Logger.getInstance(DigraphHandler.class.getName());
private static final Logger logger = Logger.getInstance(DigraphHandler.class.getName());
}

View File

@ -55,5 +55,5 @@ public class DumpLineHandler extends CommandHandler {
return true;
}
private static Logger logger = Logger.getInstance(DumpLineHandler.class.getName());
private static final Logger logger = Logger.getInstance(DumpLineHandler.class.getName());
}

View File

@ -39,5 +39,5 @@ public class EmptyHandler extends CommandHandler {
return true;
}
private static Logger logger = Logger.getInstance(EmptyHandler.class.getName());
private static final Logger logger = Logger.getInstance(EmptyHandler.class.getName());
}

View File

@ -173,5 +173,5 @@ public class HistoryHandler extends CommandHandler {
return res.toString();
}
private static Logger logger = Logger.getInstance(HistoryHandler.class.getName());
private static final Logger logger = Logger.getInstance(HistoryHandler.class.getName());
}

View File

@ -144,6 +144,6 @@ public abstract class AbstractRange implements Range {
*/
protected abstract int getRangeLine(Editor editor, DataContext context, boolean lastZero);
protected int offset;
protected boolean move;
protected final int offset;
protected final boolean move;
}

View File

@ -72,5 +72,5 @@ public class MarkRange extends AbstractRange {
return res.toString();
}
private char mark;
private final char mark;
}

View File

@ -139,8 +139,8 @@ public class SearchRange extends AbstractRange {
return res.toString();
}
@NotNull private List<String> patterns = new ArrayList<String>();
@NotNull private List<Integer> flags = new ArrayList<Integer>();
@NotNull private final List<String> patterns = new ArrayList<String>();
@NotNull private final List<Integer> flags = new ArrayList<Integer>();
private static Logger logger = Logger.getInstance(SearchRange.class.getName());
private static final Logger logger = Logger.getInstance(SearchRange.class.getName());
}

View File

@ -90,7 +90,7 @@ public class ChangeGroup {
}
}
@NotNull private EditorMouseAdapter listener = new EditorMouseAdapter() {
@NotNull private final EditorMouseAdapter listener = new EditorMouseAdapter() {
public void mouseClicked(@NotNull EditorMouseEvent event) {
Editor editor = event.getEditor();
if (!VimPlugin.isEnabled()) {
@ -843,10 +843,10 @@ public class ChangeGroup {
@Nullable
public static TextRange getDeleteMotionRange(@NotNull Editor editor,
DataContext context,
int count,
int rawCount,
@NotNull Argument argument) {
DataContext context,
int count,
int rawCount,
@NotNull Argument argument) {
TextRange range = MotionGroup.getMotionRange(editor, context, count, rawCount, argument, true);
// This is a kludge for dw, dW, and d[w. Without this kludge, an extra newline is deleted when it shouldn't be.
if (range != null) {
@ -1680,5 +1680,5 @@ public class ChangeGroup {
@Nullable private DocumentAdapter documentListener;
private int oldOffset = -1;
private static Logger logger = Logger.getInstance(ChangeGroup.class.getName());
private static final Logger logger = Logger.getInstance(ChangeGroup.class.getName());
}

View File

@ -445,5 +445,5 @@ public class CopyGroup {
markGroup.setMark(editor, ']', endOffset);
}
private static Logger logger = Logger.getInstance(CopyGroup.class.getName());
private static final Logger logger = Logger.getInstance(CopyGroup.class.getName());
}

View File

@ -127,8 +127,8 @@ public class DigraphGroup {
// TODO - load custom digraphs from .ideavimrc
}
@NotNull private HashMap<String, Character> digraphs = new HashMap<String, Character>(defaultDigraphs.length);
@NotNull private TreeMap<Character, String> keys = new TreeMap<Character, String>();
@NotNull private final HashMap<String, Character> digraphs = new HashMap<String, Character>(defaultDigraphs.length);
@NotNull private final TreeMap<Character, String> keys = new TreeMap<Character, String>();
private static final char defaultDigraphs[] = {
/*
@ -1729,5 +1729,5 @@ public class DigraphGroup {
's', 't', '\ufb06', // LATIN SMALL LIGATURE ST
};
private static Logger logger = Logger.getInstance(DigraphGroup.class.getName());
private static final Logger logger = Logger.getInstance(DigraphGroup.class.getName());
}

View File

@ -443,7 +443,7 @@ public class FileGroup {
}
}
@NotNull private static HashMap<FileEditorManager, VirtualFile> lastSelections = new HashMap<FileEditorManager, VirtualFile>();
@NotNull private static final HashMap<FileEditorManager, VirtualFile> lastSelections = new HashMap<FileEditorManager, VirtualFile>();
private static Logger logger = Logger.getInstance(FileGroup.class.getName());
private static final Logger logger = Logger.getInstance(FileGroup.class.getName());
}

View File

@ -208,11 +208,11 @@ public class HistoryGroup {
return entry;
}
private int number;
@NotNull private String entry;
private final int number;
@NotNull private final String entry;
}
@NotNull private Map<String, HistoryBlock> histories = new HashMap<String, HistoryBlock>();
@NotNull private final Map<String, HistoryBlock> histories = new HashMap<String, HistoryBlock>();
private static Logger logger = Logger.getInstance(HistoryGroup.class.getName());
private static final Logger logger = Logger.getInstance(HistoryGroup.class.getName());
}

View File

@ -56,10 +56,10 @@ public class KeyGroup {
public static final String OWNER_ATTRIBUTE = "owner";
public static final String TEXT_ELEMENT = "text";
@NotNull private Map<KeyStroke, ShortcutOwner> shortcutConflicts = new LinkedHashMap<KeyStroke, ShortcutOwner>();
@NotNull private Set<KeyStroke> requiredShortcutKeys = new HashSet<KeyStroke>();
@NotNull private HashMap<MappingMode, RootNode> keyRoots = new HashMap<MappingMode, RootNode>();
@NotNull private Map<MappingMode, KeyMapping> keyMappings = new HashMap<MappingMode, KeyMapping>();
@NotNull private final Map<KeyStroke, ShortcutOwner> shortcutConflicts = new LinkedHashMap<KeyStroke, ShortcutOwner>();
@NotNull private final Set<KeyStroke> requiredShortcutKeys = new HashSet<KeyStroke>();
@NotNull private final HashMap<MappingMode, RootNode> keyRoots = new HashMap<MappingMode, RootNode>();
@NotNull private final Map<MappingMode, KeyMapping> keyMappings = new HashMap<MappingMode, KeyMapping>();
public void registerRequiredShortcutKeys(@NotNull Editor editor) {
final Set<KeyStroke> requiredKeys = VimPlugin.getKey().getRequiredShortcutKeys();

View File

@ -159,5 +159,5 @@ public class MacroGroup {
}
private char lastRegister = 0;
private static Logger logger = Logger.getInstance(MacroGroup.class.getName());
private static final Logger logger = Logger.getInstance(MacroGroup.class.getName());
}

View File

@ -658,9 +658,9 @@ public class MarkGroup {
}
}
@NotNull private HashMap<String, FileMarks<Character, Mark>> fileMarks = new HashMap<String, FileMarks<Character, Mark>>();
@NotNull private HashMap<Character, Mark> globalMarks = new HashMap<Character, Mark>();
@NotNull private List<Jump> jumps = new ArrayList<Jump>();
@NotNull private final HashMap<String, FileMarks<Character, Mark>> fileMarks = new HashMap<String, FileMarks<Character, Mark>>();
@NotNull private final HashMap<Character, Mark> globalMarks = new HashMap<Character, Mark>();
@NotNull private final List<Jump> jumps = new ArrayList<Jump>();
private int jumpSpot = -1;
private static final int SAVE_MARK_COUNT = 20;
@ -681,5 +681,5 @@ public class MarkGroup {
private static final String VALID_SET_MARKS = WRITE_MARKS;
private static final String VALID_GET_MARKS = WRITE_MARKS + READONLY_MARKS;
private static Logger logger = Logger.getInstance(MarkGroup.class.getName());
private static final Logger logger = Logger.getInstance(MarkGroup.class.getName());
}

View File

@ -1809,8 +1809,8 @@ public class MotionGroup {
private int visualStart;
private int visualEnd;
private int visualOffset;
@NotNull private EditorMouseHandler mouseHandler = new EditorMouseHandler();
@NotNull private EditorSelectionHandler selectionHandler = new EditorSelectionHandler();
@NotNull private final EditorMouseHandler mouseHandler = new EditorMouseHandler();
@NotNull private final EditorSelectionHandler selectionHandler = new EditorSelectionHandler();
private static Logger logger = Logger.getInstance(MotionGroup.class.getName());
private static final Logger logger = Logger.getInstance(MotionGroup.class.getName());
}

View File

@ -261,5 +261,5 @@ public class ProcessGroup {
private String lastCommand;
private static Logger logger = Logger.getInstance(ProcessGroup.class.getName());
private static final Logger logger = Logger.getInstance(ProcessGroup.class.getName());
}

View File

@ -57,7 +57,7 @@ public class RegisterGroup {
private static final Logger logger = Logger.getInstance(RegisterGroup.class.getName());
private char lastRegister = REGISTER_DEFAULT;
@NotNull private HashMap<Character, Register> registers = new HashMap<Character, Register>();
@NotNull private final HashMap<Character, Register> registers = new HashMap<Character, Register>();
private char recordRegister = 0;
@Nullable private List<KeyStroke> recordList = null;
public RegisterGroup() {}

View File

@ -1197,7 +1197,7 @@ public class SearchGroup {
}
}
private int index;
private final int index;
}
public static class EditorSelectionCheck extends FileEditorManagerAdapter {
@ -1282,5 +1282,5 @@ public class SearchGroup {
private static final int RE_SEARCH = 2;
private static final int RE_SUBST = 3;
private static Logger logger = Logger.getInstance(SearchGroup.class.getName());
private static final Logger logger = Logger.getInstance(SearchGroup.class.getName());
}

View File

@ -53,5 +53,5 @@ public abstract class EditorActionHandlerBase extends EditorActionHandler {
protected abstract boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd);
private static Logger logger = Logger.getInstance(EditorActionHandlerBase.class.getName());
private static final Logger logger = Logger.getInstance(EditorActionHandlerBase.class.getName());
}

View File

@ -142,8 +142,8 @@ public abstract class VisualOperatorActionHandler extends EditorActionHandlerBas
}
}
private Command cmd;
private Editor editor;
private final Command cmd;
private final Editor editor;
private boolean res;
@NotNull private CommandState.SubMode lastMode;
private boolean wasRepeat;
@ -151,5 +151,5 @@ public abstract class VisualOperatorActionHandler extends EditorActionHandlerBas
@Nullable VisualChange change = null;
}
private static Logger logger = Logger.getInstance(VisualOperatorActionHandler.class.getName());
private static final Logger logger = Logger.getInstance(VisualOperatorActionHandler.class.getName());
}

View File

@ -226,8 +226,8 @@ public class DigraphSequence {
return result;
}
private int result;
@Nullable private KeyStroke stroke;
private final int result;
@Nullable private final KeyStroke stroke;
}
private int digraphState = DIG_STATE_START;
@ -243,5 +243,5 @@ public class DigraphSequence {
private static final int DIG_STATE_CODE_START = 10;
private static final int DIG_STATE_CODE_CHAR = 11;
private static Logger logger = Logger.getInstance(DigraphSequence.class.getName());
private static final Logger logger = Logger.getInstance(DigraphSequence.class.getName());
}

View File

@ -61,8 +61,8 @@ public class DocumentManager {
}
@NotNull private HashSet<DocumentListener> docListeners = new HashSet<DocumentListener>();
@NotNull private final HashSet<DocumentListener> docListeners = new HashSet<DocumentListener>();
private static final Key<String> LISTENER_MARKER = new Key<String>("listenerMarker");
@NotNull private static DocumentManager instance = new DocumentManager();
@NotNull private static final DocumentManager instance = new DocumentManager();
}

View File

@ -239,7 +239,7 @@ public class EditorData {
private static Key CONSOLE_VIEW_IN_EDITOR_VIEW = Key.create("CONSOLE_VIEW_IN_EDITOR_VIEW");
private static Logger logger = Logger.getInstance(EditorData.class.getName());
private static final Logger logger = Logger.getInstance(EditorData.class.getName());
static {
try {

View File

@ -48,5 +48,5 @@ public class EditorDataContext implements DataContext {
return null;
}
private Editor editor;
private final Editor editor;
}

View File

@ -1772,12 +1772,12 @@ public class SearchHelper {
return position;
}
private int count;
private int position;
private final int count;
private final int position;
}
@Nullable private static String pairsChars = null;
@NotNull private static String blockChars = "{}()[]<>";
@NotNull private static final String blockChars = "{}()[]<>";
private static Logger logger = Logger.getInstance(SearchHelper.class.getName());
private static final Logger logger = Logger.getInstance(SearchHelper.class.getName());
}

View File

@ -127,9 +127,9 @@ public class ArgumentNode implements Node {
return result;
}
protected String actionId;
protected AnAction action;
@NotNull protected Argument.Type argType;
protected Command.Type cmdType;
protected int flags;
protected final String actionId;
protected final AnAction action;
@NotNull protected final Argument.Type argType;
protected final Command.Type cmdType;
protected final int flags;
}

View File

@ -102,6 +102,6 @@ public class BranchNode extends ParentNode {
return res.toString();
}
protected KeyStroke key;
protected int flags;
protected final KeyStroke key;
protected final int flags;
}

View File

@ -124,9 +124,9 @@ public class CommandNode implements Node {
return result;
}
protected KeyStroke key;
protected AnAction action;
protected String actionId;
protected Command.Type type;
protected int flags;
protected final KeyStroke key;
protected final AnAction action;
protected final String actionId;
protected final Command.Type type;
protected final int flags;
}

View File

@ -30,8 +30,8 @@ import java.util.*;
* @author vlan
*/
public class KeyMapping implements Iterable<List<KeyStroke>> {
@NotNull private Map<ImmutableList<KeyStroke>, MappingInfo> myKeys = new HashMap<ImmutableList<KeyStroke>, MappingInfo>();
@NotNull private Map<ImmutableList<KeyStroke>, Integer> myPrefixes = new HashMap<ImmutableList<KeyStroke>, Integer>();
@NotNull private final Map<ImmutableList<KeyStroke>, MappingInfo> myKeys = new HashMap<ImmutableList<KeyStroke>, MappingInfo>();
@NotNull private final Map<ImmutableList<KeyStroke>, Integer> myPrefixes = new HashMap<ImmutableList<KeyStroke>, Integer>();
@NotNull
@Override

View File

@ -48,5 +48,5 @@ public abstract class ParentNode implements Node {
return children.get(key);
}
@NotNull protected HashMap<Object, Node> children = new HashMap<Object, Node>();
@NotNull protected final HashMap<Object, Node> children = new HashMap<Object, Node>();
}

View File

@ -75,5 +75,5 @@ public class Shortcut {
return keys;
}
private KeyStroke[] keys;
private final KeyStroke[] keys;
}

View File

@ -68,5 +68,5 @@ public class BoundListOption extends ListOption {
return true;
}
protected List<String> values;
protected final List<String> values;
}

View File

@ -69,5 +69,5 @@ public class BoundStringOption extends StringOption {
return false;
}
protected String[] values;
protected final String[] values;
}

View File

@ -231,7 +231,7 @@ public class ListOption extends TextOption {
return res.toString();
}
protected List<String> dflt;
protected final List<String> dflt;
@Nullable protected List<String> value;
protected String pattern;
protected final String pattern;
}

View File

@ -230,8 +230,8 @@ public class NumberOption extends TextOption {
return res.toString();
}
private int dflt;
private final int dflt;
private int value;
private int min;
private int max;
private final int min;
private final int max;
}

View File

@ -109,7 +109,7 @@ public abstract class Option {
}
}
protected String name;
protected String abbrev;
@NotNull protected List<OptionChangeListener> listeners = new ArrayList<OptionChangeListener>();
protected final String name;
protected final String abbrev;
@NotNull protected final List<OptionChangeListener> listeners = new ArrayList<OptionChangeListener>();
}

View File

@ -454,10 +454,10 @@ public class Options {
abbrevs.put(option.getAbbreviation(), option);
}
@NotNull private HashMap<String, Option> options = new HashMap<String, Option>();
@NotNull private HashMap<String, Option> abbrevs = new HashMap<String, Option>();
@NotNull private final HashMap<String, Option> options = new HashMap<String, Option>();
@NotNull private final HashMap<String, Option> abbrevs = new HashMap<String, Option>();
private static Options ourInstance;
private static Logger logger = Logger.getInstance(Options.class.getName());
private static final Logger logger = Logger.getInstance(Options.class.getName());
}

View File

@ -138,6 +138,6 @@ public class StringOption extends TextOption {
return res.toString();
}
protected String dflt;
protected final String dflt;
protected String value;
}

View File

@ -117,6 +117,6 @@ public class ToggleOption extends Option {
value = dflt;
}
protected boolean dflt;
protected final boolean dflt;
protected boolean value;
}

View File

@ -117,7 +117,7 @@ public class ExEditorKit extends DefaultEditorKit {
public static final String HistoryDownFilter = "history-down-filter";
public static final String StartDigraph = "start-digraph";
@NotNull protected Action[] exActions = new Action[]{
@NotNull protected final Action[] exActions = new Action[]{
new ExEditorKit.CancelEntryAction(),
new ExEditorKit.CompleteEntryAction(),
new ExEditorKit.EscapeCharAction(),

View File

@ -205,17 +205,17 @@ public class ExEntryPanel extends JPanel {
}
@Nullable private JComponent parent;
private JLabel label;
private ExTextField entry;
private final JLabel label;
private final ExTextField entry;
private JComponent oldGlass;
private LayoutManager oldLayout;
private boolean wasOpaque;
private ComponentAdapter adapter;
private final ComponentAdapter adapter;
private int count;
private boolean active;
private static ExEntryPanel instance;
private static Logger logger = Logger.getInstance(ExEntryPanel.class.getName());
private static final Logger logger = Logger.getInstance(ExEntryPanel.class.getName());
}

View File

@ -46,11 +46,11 @@ import java.util.List;
public class ExOutputPanel extends JPanel {
@NotNull private final Editor myEditor;
@NotNull private JLabel myLabel = new JLabel("more");
@NotNull private JTextArea myText = new JTextArea();
@NotNull private JScrollPane myScrollPane =
@NotNull private final JLabel myLabel = new JLabel("more");
@NotNull private final JTextArea myText = new JTextArea();
@NotNull private final JScrollPane myScrollPane =
new JBScrollPane(myText, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
private ComponentAdapter myAdapter;
private final ComponentAdapter myAdapter;
private boolean myAtEnd = false;
private int myLineHeight = 0;
@ -296,7 +296,7 @@ public class ExOutputPanel extends JPanel {
}
private static class MoreKeyListener extends KeyAdapter {
private ExOutputPanel myExOutputPanel;
private final ExOutputPanel myExOutputPanel;
public MoreKeyListener(ExOutputPanel panel) {
this.myExOutputPanel = panel;