From 522ba1e5e1704d8b295ccf041f635c242e94fa73 Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Mon, 18 Apr 2016 19:20:51 +0300 Subject: [PATCH] cleanup the MagicConstantInspection warnings --- .../debugger/ui/impl/DebuggerTreeRenderer.java | 8 ++++---- .../JavaParameterTableModel.java | 4 ++-- .../inline/InlineParameterDialog.java | 6 ++++-- .../openapi/editor/markup/TextAttributes.java | 4 ++-- .../src/com/intellij/psi/impl/ElementBase.java | 2 +- .../src/com/intellij/util/IconUtil.java | 2 +- .../openapi/editor/colors/EditorColors.java | 7 +++++-- .../options/colors/ColorAndFontOptions.java | 4 ++-- .../editor/EditorSmartKeysConfigurable.java | 4 +++- .../hint/ShowParameterInfoHandler.java | 4 ++-- .../codeInsight/navigation/NavigationUtil.java | 4 ++-- .../find/impl/livePreview/LivePreview.java | 8 ++++---- .../com/intellij/ide/bookmarks/Bookmark.java | 4 ++-- .../ide/commander/ColoredCommanderRenderer.java | 4 ++-- .../util/NavigationItemListCellRenderer.java | 6 +++--- .../ide/util/PsiElementListCellRenderer.java | 8 ++++---- .../util/gotoByName/GotoFileCellRenderer.java | 6 +++--- .../ContentEntryTreeCellRenderer.java | 5 ++--- .../InspectionsConfigTreeRenderer.java | 4 ++-- .../ParameterTableModelBase.java | 4 ++-- .../ui/AbstractMemberSelectionTable.java | 4 ++-- .../intellij/ui/treeStructure/SimpleNode.java | 4 ++-- .../ide/GeneralSettingsConfigurable.java | 8 ++++++-- .../editor/impl/ComplementaryFontsRegistry.java | 4 ++-- .../DefaultEditorTextRepresentationHelper.java | 6 ++++-- .../openapi/editor/impl/EditorImpl.java | 2 +- .../mapping/SoftWrapApplianceManager.java | 2 +- .../editor/impl/view/IterationState.java | 2 +- .../keymap/impl/IdeMouseEventDispatcher.java | 11 ++++++++--- .../openapi/keymap/impl/ui/ActionsTree.java | 4 ++-- .../openapi/editor/impl/IterationStateTest.java | 8 ++++---- .../plugin/ui/ExistingTemplatesComponent.java | 17 ++++++++++++++++- .../util/src/com/intellij/util/BitUtil.java | 4 ++-- .../intellij/openapi/vcs/update/FileGroup.java | 6 ++---- .../vcs/update/FileOrDirectoryTreeNode.java | 4 ++-- .../xdebugger/impl/ui/XDebuggerUIConstants.java | 4 ++-- .../ui/experts/checkout/ChooseCheckoutMode.java | 9 ++------- .../jetbrains/plugins/groovy/geb/GebUtil.java | 6 +++--- .../lang/psi/api/statements/GrVariable.java | 7 ++++++- .../closure/ExtractClosureHelperImpl.java | 6 +++++- .../GrIntroduceExpressionSettingsImpl.java | 8 +++----- .../parameter/GrIntroduceParameterDialog.java | 7 +++++-- .../parameter/GrIntroduceParameterSettings.java | 5 ++++- .../org/jetbrains/idea/svn/SvnLockingTest.java | 3 ++- .../org/intellij/plugins/xpathView/Config.java | 4 ++-- .../projectView/StudyDirectoryNode.java | 6 +++--- .../jetbrains/plugins/ipnb/IpnbJfxUtils.java | 2 +- 47 files changed, 145 insertions(+), 106 deletions(-) diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/impl/DebuggerTreeRenderer.java b/java/debugger/impl/src/com/intellij/debugger/ui/impl/DebuggerTreeRenderer.java index a6bec84dc382..f307ac919ddb 100644 --- a/java/debugger/impl/src/com/intellij/debugger/ui/impl/DebuggerTreeRenderer.java +++ b/java/debugger/impl/src/com/intellij/debugger/ui/impl/DebuggerTreeRenderer.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * Copyright 2000-2016 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. @@ -38,9 +38,9 @@ import java.awt.*; public class DebuggerTreeRenderer extends ColoredTreeCellRenderer { - private static final SimpleTextAttributes DEFAULT_ATTRIBUTES = new SimpleTextAttributes(Font.PLAIN, null); - private static final SimpleTextAttributes SPECIAL_NODE_ATTRIBUTES = new SimpleTextAttributes(Font.PLAIN, new JBColor(Color.lightGray, Gray._130)); - private static final SimpleTextAttributes OBJECT_ID_HIGHLIGHT_ATTRIBUTES = new SimpleTextAttributes(Font.PLAIN, new JBColor(Color.lightGray, Gray._130)); + private static final SimpleTextAttributes DEFAULT_ATTRIBUTES = new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN, null); + private static final SimpleTextAttributes SPECIAL_NODE_ATTRIBUTES = new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN, new JBColor(Color.lightGray, Gray._130)); + private static final SimpleTextAttributes OBJECT_ID_HIGHLIGHT_ATTRIBUTES = new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN, new JBColor(Color.lightGray, Gray._130)); public void customizeCellRenderer(@NotNull JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) { final DebuggerTreeNodeImpl node = (DebuggerTreeNodeImpl) value; diff --git a/java/java-impl/src/com/intellij/refactoring/changeSignature/JavaParameterTableModel.java b/java/java-impl/src/com/intellij/refactoring/changeSignature/JavaParameterTableModel.java index 4a51d113455e..6c99de719aba 100644 --- a/java/java-impl/src/com/intellij/refactoring/changeSignature/JavaParameterTableModel.java +++ b/java/java-impl/src/com/intellij/refactoring/changeSignature/JavaParameterTableModel.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2011 JetBrains s.r.o. + * Copyright 2000-2016 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. @@ -228,7 +228,7 @@ public class JavaParameterTableModel extends ParameterTableModelBase 3) { LOG.error("Wrong font type: " + type); - type = 0; + type = Font.PLAIN; } myAttrs = myAttrs.withFontType(type); } diff --git a/platform/core-api/src/com/intellij/psi/impl/ElementBase.java b/platform/core-api/src/com/intellij/psi/impl/ElementBase.java index d0958cbafbd2..91fa79e52b39 100644 --- a/platform/core-api/src/com/intellij/psi/impl/ElementBase.java +++ b/platform/core-api/src/com/intellij/psi/impl/ElementBase.java @@ -243,7 +243,7 @@ public abstract class ElementBase extends UserDataHolderBase implements Iconable fileTypeIcon = file.getFileType().getIcon(); } else { - fileTypeIcon = IconUtil.getIcon(virtualFile, BitUtil.clear(flags, ICON_FLAG_READ_STATUS), file.getProject()); + fileTypeIcon = IconUtil.getIcon(virtualFile, flags & ~ICON_FLAG_READ_STATUS, file.getProject()); } return createLayeredIcon(this, fileTypeIcon, elementFlags); } diff --git a/platform/core-api/src/com/intellij/util/IconUtil.java b/platform/core-api/src/com/intellij/util/IconUtil.java index 0735c516c39b..bd6f97a40822 100644 --- a/platform/core-api/src/com/intellij/util/IconUtil.java +++ b/platform/core-api/src/com/intellij/util/IconUtil.java @@ -152,7 +152,7 @@ public class IconUtil { } // render without locked icon patch since we are going to apply it later anyway - icon = patcher.patchIcon(icon, file, BitUtil.clear(flags, Iconable.ICON_FLAG_READ_STATUS), project); + icon = patcher.patchIcon(icon, file, flags & ~Iconable.ICON_FLAG_READ_STATUS, project); } if (file.is(VFileProperty.SYMLINK)) { diff --git a/platform/editor-ui-api/src/com/intellij/openapi/editor/colors/EditorColors.java b/platform/editor-ui-api/src/com/intellij/openapi/editor/colors/EditorColors.java index 2a6a17fd58e2..dfa532ce3637 100644 --- a/platform/editor-ui-api/src/com/intellij/openapi/editor/colors/EditorColors.java +++ b/platform/editor-ui-api/src/com/intellij/openapi/editor/colors/EditorColors.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * Copyright 2000-2016 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. @@ -19,6 +19,8 @@ import com.intellij.openapi.editor.markup.EffectType; import com.intellij.openapi.editor.markup.TextAttributes; import com.intellij.ui.JBColor; +import java.awt.*; + public interface EditorColors { ColorKey CARET_ROW_COLOR = ColorKey.createColorKey("CARET_ROW_COLOR"); ColorKey CARET_COLOR = ColorKey.createColorKey("CARET_COLOR"); @@ -34,7 +36,8 @@ public interface EditorColors { ColorKey SELECTION_BACKGROUND_COLOR = ColorKey.createColorKey("SELECTION_BACKGROUND"); ColorKey SELECTION_FOREGROUND_COLOR = ColorKey.createColorKey("SELECTION_FOREGROUND"); - TextAttributesKey REFERENCE_HYPERLINK_COLOR = TextAttributesKey.createTextAttributesKey("CTRL_CLICKABLE", new TextAttributes(JBColor.blue, null, JBColor.blue, EffectType.LINE_UNDERSCORE, 0)); + TextAttributesKey REFERENCE_HYPERLINK_COLOR = TextAttributesKey.createTextAttributesKey("CTRL_CLICKABLE", new TextAttributes(JBColor.blue, null, JBColor.blue, EffectType.LINE_UNDERSCORE, + Font.PLAIN)); TextAttributesKey SEARCH_RESULT_ATTRIBUTES = TextAttributesKey.createTextAttributesKey("SEARCH_RESULT_ATTRIBUTES"); TextAttributesKey LIVE_TEMPLATE_ATTRIBUTES = TextAttributesKey.createTextAttributesKey("LIVE_TEMPLATE_ATTRIBUTES"); diff --git a/platform/lang-impl/src/com/intellij/application/options/colors/ColorAndFontOptions.java b/platform/lang-impl/src/com/intellij/application/options/colors/ColorAndFontOptions.java index a4bbd53f7377..5d37da2c62de 100644 --- a/platform/lang-impl/src/com/intellij/application/options/colors/ColorAndFontOptions.java +++ b/platform/lang-impl/src/com/intellij/application/options/colors/ColorAndFontOptions.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * Copyright 2000-2016 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. @@ -849,7 +849,7 @@ public class ColorAndFontOptions extends SearchableConfigurable.Parent.Abstract @Override public int getFontType() { - return 0; + return Font.PLAIN; } @Override diff --git a/platform/lang-impl/src/com/intellij/application/options/editor/EditorSmartKeysConfigurable.java b/platform/lang-impl/src/com/intellij/application/options/editor/EditorSmartKeysConfigurable.java index 4b8ca68a2fb6..1c11b55fd752 100644 --- a/platform/lang-impl/src/com/intellij/application/options/editor/EditorSmartKeysConfigurable.java +++ b/platform/lang-impl/src/com/intellij/application/options/editor/EditorSmartKeysConfigurable.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * Copyright 2000-2016 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. @@ -31,6 +31,7 @@ import com.intellij.openapi.options.CompositeConfigurable; import com.intellij.openapi.options.ConfigurationException; import com.intellij.openapi.options.UnnamedConfigurable; import com.intellij.openapi.options.ex.ConfigurableWrapper; +import org.intellij.lang.annotations.MagicConstant; import org.jetbrains.annotations.Nls; import org.jetbrains.annotations.NotNull; @@ -254,6 +255,7 @@ public class EditorSmartKeysConfigurable extends CompositeConfigurable dummy = new HashSet(); Color color = editor.getColorsScheme().getColor(EditorColors.CARET_COLOR); - highlightRange(cursor, new TextAttributes(null, null, color, EffectType.ROUNDED_BOX, 0), dummy); + highlightRange(cursor, new TextAttributes(null, null, color, EffectType.ROUNDED_BOX, Font.PLAIN), dummy); if (!dummy.isEmpty()) { myCursorHighlighter = dummy.iterator().next(); } @@ -363,7 +363,7 @@ public class LivePreview extends DocumentAdapter implements SearchResults.Search if (cursor != null && highlighter.getStartOffset() == cursor.getStartOffset() && highlighter.getEndOffset() == cursor.getEndOffset()) continue; final RangeHighlighter toAnnotate = highlightRange(new TextRange(highlighter.getStartOffset(), highlighter.getEndOffset()), - new TextAttributes(null, null, Color.WHITE, EffectType.ROUNDED_BOX, 0), toAdd); + new TextAttributes(null, null, Color.WHITE, EffectType.ROUNDED_BOX, Font.PLAIN), toAdd); highlighter.putUserData(IN_SELECTION_KEY, IN_SELECTION1); toAnnotate.putUserData(IN_SELECTION_KEY, IN_SELECTION2); } diff --git a/platform/lang-impl/src/com/intellij/ide/bookmarks/Bookmark.java b/platform/lang-impl/src/com/intellij/ide/bookmarks/Bookmark.java index ee498a170632..2c14f9d7fa7e 100644 --- a/platform/lang-impl/src/com/intellij/ide/bookmarks/Bookmark.java +++ b/platform/lang-impl/src/com/intellij/ide/bookmarks/Bookmark.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2016 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. @@ -70,7 +70,7 @@ public class Bookmark implements Navigatable, Comparable { private String myDescription; private char myMnemonic = 0; - public static final Font MNEMONIC_FONT = new Font("Monospaced", 0, 11); + public static final Font MNEMONIC_FONT = new Font("Monospaced", Font.PLAIN, 11); public Bookmark(@NotNull Project project, @NotNull VirtualFile file, int line, @NotNull String description) { myFile = file; diff --git a/platform/lang-impl/src/com/intellij/ide/commander/ColoredCommanderRenderer.java b/platform/lang-impl/src/com/intellij/ide/commander/ColoredCommanderRenderer.java index ba8e820942f1..313fc5bade8e 100644 --- a/platform/lang-impl/src/com/intellij/ide/commander/ColoredCommanderRenderer.java +++ b/platform/lang-impl/src/com/intellij/ide/commander/ColoredCommanderRenderer.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2016 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. @@ -91,7 +91,7 @@ final class ColoredCommanderRenderer extends ColoredListCellRenderer { } } - if(attributes == null) attributes = new SimpleTextAttributes(Font.PLAIN, color); + if(attributes == null) attributes = new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN, color); final String text = value.toString(); if (myCommanderPanel.isEnableSearchHighlighting()) { diff --git a/platform/lang-impl/src/com/intellij/ide/util/NavigationItemListCellRenderer.java b/platform/lang-impl/src/com/intellij/ide/util/NavigationItemListCellRenderer.java index e224b9a44ecb..617f4c18688c 100644 --- a/platform/lang-impl/src/com/intellij/ide/util/NavigationItemListCellRenderer.java +++ b/platform/lang-impl/src/com/intellij/ide/util/NavigationItemListCellRenderer.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * Copyright 2000-2016 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. @@ -186,13 +186,13 @@ public class NavigationItemListCellRenderer extends OpaquePanel implements ListC String containerText = presentation.getLocationString(); if (containerText != null && containerText.length() > 0) { - append(" " + containerText, new SimpleTextAttributes(Font.PLAIN, JBColor.GRAY)); + append(" " + containerText, new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN, JBColor.GRAY)); } } } else { setIcon(IconUtil.getEmptyIcon(false)); - append(value == null ? "" : value.toString(), new SimpleTextAttributes(Font.PLAIN, list.getForeground())); + append(value == null ? "" : value.toString(), new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN, list.getForeground())); } setPaintFocusBorder(false); setBackground(selected ? UIUtil.getListSelectionBackground() : bgColor); diff --git a/platform/lang-impl/src/com/intellij/ide/util/PsiElementListCellRenderer.java b/platform/lang-impl/src/com/intellij/ide/util/PsiElementListCellRenderer.java index e543fb06527c..b0da58a68f62 100644 --- a/platform/lang-impl/src/com/intellij/ide/util/PsiElementListCellRenderer.java +++ b/platform/lang-impl/src/com/intellij/ide/util/PsiElementListCellRenderer.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2016 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. @@ -156,7 +156,7 @@ public abstract class PsiElementListCellRenderer extends J SimpleTextAttributes nameAttributes = attributes != null ? SimpleTextAttributes.fromTextAttributes(attributes) : null; - if (nameAttributes == null) nameAttributes = new SimpleTextAttributes(Font.PLAIN, color); + if (nameAttributes == null) nameAttributes = new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN, color); assert name != null : "Null name for PSI element " + element + " (by " + PsiElementListCellRenderer.this + ")"; SpeedSearchUtil.appendColoredFragmentForMatcher(name, this, nameAttributes, myMatcher, bgColor, selected); @@ -168,12 +168,12 @@ public abstract class PsiElementListCellRenderer extends J String containerText = getContainerTextForLeftComponent(element, name + (myModuleName != null ? myModuleName + " " : "")); if (containerText != null) { - append(" " + containerText, new SimpleTextAttributes(Font.PLAIN, JBColor.GRAY)); + append(" " + containerText, new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN, JBColor.GRAY)); } } else if (!customizeNonPsiElementLeftRenderer(this, list, value, index, selected, hasFocus)) { setIcon(IconUtil.getEmptyIcon(false)); - append(value == null ? "" : value.toString(), new SimpleTextAttributes(Font.PLAIN, list.getForeground())); + append(value == null ? "" : value.toString(), new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN, list.getForeground())); } setBackground(selected ? UIUtil.getListSelectionBackground() : bgColor); } diff --git a/platform/lang-impl/src/com/intellij/ide/util/gotoByName/GotoFileCellRenderer.java b/platform/lang-impl/src/com/intellij/ide/util/gotoByName/GotoFileCellRenderer.java index 2fe7b4bb3bbc..b00aa5640e37 100644 --- a/platform/lang-impl/src/com/intellij/ide/util/gotoByName/GotoFileCellRenderer.java +++ b/platform/lang-impl/src/com/intellij/ide/util/gotoByName/GotoFileCellRenderer.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * Copyright 2000-2016 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. @@ -115,7 +115,7 @@ public class GotoFileCellRenderer extends PsiElementListCellRenderer ourFontNames; private static final Map[]> ourStyledFontMap = new HashMap[]>(); private static final LinkedHashMap ourUsedFonts; - private static FontKey ourSharedKeyInstance = new FontKey("", 0, 0, false); + private static FontKey ourSharedKeyInstance = new FontKey("", 0, Font.PLAIN, false); private static FontInfo ourSharedDefaultFont; private static final TIntHashSet ourUndisplayableChars = new TIntHashSet(); private static boolean ourOldUseAntialiasing; @@ -260,7 +260,7 @@ public class ComplementaryFontsRegistry { if (defaultFont == null) { defaultFont = new FontInfo(defaultFontFamily, size, style, originalStyle, useLigatures); ourUsedFonts.put(ourSharedKeyInstance, defaultFont); - ourSharedKeyInstance = new FontKey("", 0, 0, false); + ourSharedKeyInstance = new FontKey("", 0, Font.PLAIN, false); } ourSharedDefaultFont = defaultFont; diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/impl/DefaultEditorTextRepresentationHelper.java b/platform/platform-impl/src/com/intellij/openapi/editor/impl/DefaultEditorTextRepresentationHelper.java index 483d179fac3a..d5f916df286d 100644 --- a/platform/platform-impl/src/com/intellij/openapi/editor/impl/DefaultEditorTextRepresentationHelper.java +++ b/platform/platform-impl/src/com/intellij/openapi/editor/impl/DefaultEditorTextRepresentationHelper.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2016 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. @@ -20,6 +20,8 @@ import com.intellij.openapi.editor.ex.util.EditorUtil; import gnu.trove.TObjectIntHashMap; import org.intellij.lang.annotations.JdkConstants; +import java.awt.*; + /** * Not thread-safe. Performs caching of char widths, so cache reset must be invoked (via {@link #clearSymbolWidthCache()} method) when * font settings are changed in editor. @@ -126,7 +128,7 @@ public class DefaultEditorTextRepresentationHelper implements EditorTextRepresen private char c; private Key() { - this(0, ' '); + this(Font.PLAIN, ' '); } Key(@JdkConstants.FontStyle int fontType, char c) { diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorImpl.java b/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorImpl.java index fa2d861d102e..1c611d0ac866 100644 --- a/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorImpl.java @@ -147,7 +147,7 @@ public final class EditorImpl extends UserDataHolderBase implements EditorEx, Hi private int myLinePaintersWidth; static { - ComplementaryFontsRegistry.getFontAbleToDisplay(' ', 0, 0, UIManager.getFont("Label.font").getFamily()); // load costly font info + ComplementaryFontsRegistry.getFontAbleToDisplay(' ', 0, Font.PLAIN, UIManager.getFont("Label.font").getFamily()); // load costly font info } private final CommandProcessor myCommandProcessor; diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/impl/softwrap/mapping/SoftWrapApplianceManager.java b/platform/platform-impl/src/com/intellij/openapi/editor/impl/softwrap/mapping/SoftWrapApplianceManager.java index 9058aa046b8d..1e98bf863dbe 100644 --- a/platform/platform-impl/src/com/intellij/openapi/editor/impl/softwrap/mapping/SoftWrapApplianceManager.java +++ b/platform/platform-impl/src/com/intellij/openapi/editor/impl/softwrap/mapping/SoftWrapApplianceManager.java @@ -1255,7 +1255,7 @@ public class SoftWrapApplianceManager implements Dumpable { rangeEndOffset = 0; tokenStartOffset = 0; tokenEndOffset = 0; - fontType = 0; + fontType = Font.PLAIN; skipToLineEnd = false; fontType2spaceWidth.reset(); logicalLineData.reset(); diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/impl/view/IterationState.java b/platform/platform-impl/src/com/intellij/openapi/editor/impl/view/IterationState.java index d8bc746e2b99..c734b1b669cb 100644 --- a/platform/platform-impl/src/com/intellij/openapi/editor/impl/view/IterationState.java +++ b/platform/platform-impl/src/com/intellij/openapi/editor/impl/view/IterationState.java @@ -616,7 +616,7 @@ public class IterationState { @NotNull public TextAttributes getBeforeLineStartBackgroundAttributes() { - return new TextAttributes(null, getBreakBackgroundColor(false), null, null, 0); + return new TextAttributes(null, getBreakBackgroundColor(false), null, null, Font.PLAIN); } private Color getBreakBackgroundColor(boolean lineEnd) { diff --git a/platform/platform-impl/src/com/intellij/openapi/keymap/impl/IdeMouseEventDispatcher.java b/platform/platform-impl/src/com/intellij/openapi/keymap/impl/IdeMouseEventDispatcher.java index 740cd93eae74..a01b6723871e 100644 --- a/platform/platform-impl/src/com/intellij/openapi/keymap/impl/IdeMouseEventDispatcher.java +++ b/platform/platform-impl/src/com/intellij/openapi/keymap/impl/IdeMouseEventDispatcher.java @@ -34,6 +34,7 @@ import com.intellij.openapi.wm.impl.IdeGlassPaneImpl; import com.intellij.util.ReflectionUtil; import com.intellij.util.containers.HashMap; import com.intellij.util.ui.UIUtil; +import org.intellij.lang.annotations.JdkConstants; import org.jetbrains.annotations.Nullable; import javax.swing.*; @@ -56,11 +57,13 @@ import static java.awt.event.MouseEvent.*; */ public final class IdeMouseEventDispatcher { private final PresentationFactory myPresentationFactory = new PresentationFactory(); - private final ArrayList myActions = new ArrayList(1); - private final Map myRootPane2BlockedId = new HashMap(); - private int myLastHorScrolledComponentHash = 0; + private final ArrayList myActions = new ArrayList<>(1); + private final Map myRootPane2BlockedId = new HashMap<>(); + private int myLastHorScrolledComponentHash; private boolean myPressedModifiersStored; + @JdkConstants.InputEventMask private int myModifiers; + @JdkConstants.InputEventMask private int myModifiersEx; // Don't compare MouseEvent ids. Swing has wrong sequence of events: first is mouse_clicked(500) @@ -170,7 +173,9 @@ public final class IdeMouseEventDispatcher { ignore = true; } + @JdkConstants.InputEventMask int modifiers = e.getModifiers(); + @JdkConstants.InputEventMask int modifiersEx = e.getModifiersEx(); if (e.getID() == MOUSE_PRESSED) { myPressedModifiersStored = true; diff --git a/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ui/ActionsTree.java b/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ui/ActionsTree.java index c193f296eb07..192b329abe1d 100644 --- a/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ui/ActionsTree.java +++ b/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ui/ActionsTree.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * Copyright 2000-2016 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. @@ -604,7 +604,7 @@ public class ActionsTree { } if (!myHaveLink) { Color background = selected ? UIUtil.getTreeSelectionBackground() : UIUtil.getTreeTextBackground(); - SearchUtil.appendFragments(myFilter, text, Font.PLAIN, foreground, background, this); + SearchUtil.appendFragments(myFilter, text, SimpleTextAttributes.STYLE_PLAIN, foreground, background, this); if (actionId != null && myPaintInternalInfo) { String pluginName = myPluginNames.get(actionId); if (pluginName != null) { diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/IterationStateTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/IterationStateTest.java index 5941243eb018..4e7ceee57609 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/IterationStateTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/IterationStateTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * Copyright 2000-2016 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. @@ -125,11 +125,11 @@ public class IterationStateTest extends LightPlatformCodeInsightFixtureTestCase Color breakpointColor = Color.RED; myFixture.getEditor().getMarkupModel().addLineHighlighter(0, HighlighterLayer.CARET_ROW + 1, - new TextAttributes(null, breakpointColor, null, null, 0)); + new TextAttributes(null, breakpointColor, null, null, Font.PLAIN)); Color currentDebuggingLineColor = Color.CYAN; myFixture.getEditor().getMarkupModel().addLineHighlighter(0, HighlighterLayer.SELECTION - 1, - new TextAttributes(null, currentDebuggingLineColor, null, null, 0)); + new TextAttributes(null, currentDebuggingLineColor, null, null, Font.PLAIN)); mouse().pressAt(0, 4).dragTo(0, 6).release(); verifySplitting(false, @@ -146,7 +146,7 @@ public class IterationStateTest extends LightPlatformCodeInsightFixtureTestCase Color breakpointColor = Color.RED; myFixture.getEditor().getMarkupModel().addLineHighlighter(0, HighlighterLayer.CARET_ROW + 1, - new TextAttributes(null, breakpointColor, null, null, 0)); + new TextAttributes(null, breakpointColor, null, null, Font.PLAIN)); verifySplitting(false, new Segment(0, 5, breakpointColor), diff --git a/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/ExistingTemplatesComponent.java b/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/ExistingTemplatesComponent.java index b1d179ad13a7..22d342457c3e 100644 --- a/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/ExistingTemplatesComponent.java +++ b/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/ExistingTemplatesComponent.java @@ -1,3 +1,18 @@ +/* + * Copyright 2000-2016 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.intellij.structuralsearch.plugin.ui; import com.intellij.ide.CommonActionsManager; @@ -242,7 +257,7 @@ public class ExistingTemplatesComponent { if (created > 0) { final String createdString = DateFormatUtil.formatPrettyDateTime(created); append(" (" + createdString + ')', - selected ? new SimpleTextAttributes(Font.PLAIN, foreground) : SimpleTextAttributes.GRAYED_ATTRIBUTES); + selected ? new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN, foreground) : SimpleTextAttributes.GRAYED_ATTRIBUTES); } } } diff --git a/platform/util/src/com/intellij/util/BitUtil.java b/platform/util/src/com/intellij/util/BitUtil.java index 3a422d0ee826..7f3842b7c3e7 100644 --- a/platform/util/src/com/intellij/util/BitUtil.java +++ b/platform/util/src/com/intellij/util/BitUtil.java @@ -52,13 +52,13 @@ public class BitUtil { return set(value, mask, false); } - public static void assertOneBitMask(byte mask) { + private static void assertOneBitMask(byte mask) { assertOneBitMask(mask & 0xFFL); } public static void assertOneBitMask(int mask) { assertOneBitMask(mask & 0xFFFFFFFFL); } - public static void assertOneBitMask(long mask) { + private static void assertOneBitMask(long mask) { assert (mask & mask - 1) == 0 : "Mask must have only one bit set, but got: " + Long.toBinaryString(mask); } } \ No newline at end of file diff --git a/platform/vcs-api/src/com/intellij/openapi/vcs/update/FileGroup.java b/platform/vcs-api/src/com/intellij/openapi/vcs/update/FileGroup.java index 02461e639e67..a08d9fb9c016 100644 --- a/platform/vcs-api/src/com/intellij/openapi/vcs/update/FileGroup.java +++ b/platform/vcs-api/src/com/intellij/openapi/vcs/update/FileGroup.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2016 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. @@ -25,9 +25,7 @@ import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.awt.*; import java.util.*; -import java.util.List; public class FileGroup implements JDOMExternalizable { @@ -149,7 +147,7 @@ public class FileGroup implements JDOMExternalizable { public SimpleTextAttributes getInvalidAttributes() { if (myCanBeAbsent) { - return new SimpleTextAttributes(Font.PLAIN, FileStatus.DELETED.getColor()); + return new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN, FileStatus.DELETED.getColor()); } else { return SimpleTextAttributes.ERROR_ATTRIBUTES; diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/update/FileOrDirectoryTreeNode.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/update/FileOrDirectoryTreeNode.java index 5ab39fa37714..67d16dd3e04b 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/update/FileOrDirectoryTreeNode.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/update/FileOrDirectoryTreeNode.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 JetBrains s.r.o. + * Copyright 2000-2016 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. @@ -126,7 +126,7 @@ public abstract class FileOrDirectoryTreeNode extends AbstractTreeNode implement if (color == null) color = UIUtil.getListForeground(); if (!myFileStatusToAttributeMap.containsKey(status)) { - myFileStatusToAttributeMap.put(status, new SimpleTextAttributes(Font.PLAIN, color)); + myFileStatusToAttributeMap.put(status, new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN, color)); } return myFileStatusToAttributeMap.get(status); } diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/XDebuggerUIConstants.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/XDebuggerUIConstants.java index 18f2ebad2f9f..b3529767f873 100644 --- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/XDebuggerUIConstants.java +++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/XDebuggerUIConstants.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 JetBrains s.r.o. + * Copyright 2000-2016 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. @@ -49,7 +49,7 @@ public class XDebuggerUIConstants { public static final String LAYOUT_VIEW_BREAKPOINT_CONDITION = "breakpoint"; private static SimpleTextAttributes get(JBColor c) { - return new SimpleTextAttributes(Font.PLAIN, c); + return new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN, c); } private XDebuggerUIConstants() { diff --git a/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/ui/experts/checkout/ChooseCheckoutMode.java b/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/ui/experts/checkout/ChooseCheckoutMode.java index fabba066d749..fbe04c31d9df 100644 --- a/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/ui/experts/checkout/ChooseCheckoutMode.java +++ b/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/ui/experts/checkout/ChooseCheckoutMode.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2016 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. @@ -21,10 +21,6 @@ import com.intellij.cvsSupport2.config.CvsRootConfiguration; import com.intellij.cvsSupport2.connections.CvsEnvironment; import com.intellij.cvsSupport2.cvsBrowser.CvsElement; import com.intellij.cvsSupport2.cvsBrowser.CvsFile; -import com.intellij.cvsSupport2.cvsoperations.common.CvsCommandOperation; -import com.intellij.cvsSupport2.cvsoperations.cvsLog.LocalPathIndifferentLogOperation; -import com.intellij.cvsSupport2.cvsoperations.cvsLog.LogOperation; -import com.intellij.cvsSupport2.cvsoperations.cvsTagOrBranch.TagsProvider; import com.intellij.cvsSupport2.cvsoperations.cvsTagOrBranch.TagsProviderOnEnvironment; import com.intellij.cvsSupport2.cvsoperations.dateOrRevision.ui.DateOrRevisionOrTagSettings; import com.intellij.cvsSupport2.ui.ChangeKeywordSubstitutionPanel; @@ -33,7 +29,6 @@ import com.intellij.openapi.project.Project; import com.intellij.openapi.ui.VerticalFlowLayout; import com.intellij.openapi.util.Comparing; import com.intellij.openapi.util.io.FileUtil; -import com.intellij.openapi.vcs.VcsException; import com.intellij.openapi.vcs.checkout.CheckoutStrategy; import com.intellij.ui.ColoredListCellRenderer; import com.intellij.ui.ScrollPaneFactory; @@ -83,7 +78,7 @@ public class ChooseCheckoutMode extends WizardStep { @Override protected void customizeCellRenderer(JList list, Object value, int index, boolean selected, boolean hasFocus) { final CheckoutStrategy checkoutStrategy = (CheckoutStrategy)value; - append(checkoutStrategy.getResult().getAbsolutePath(), new SimpleTextAttributes(Font.PLAIN, list.getForeground())); + append(checkoutStrategy.getResult().getAbsolutePath(), new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN, list.getForeground())); setIcon(PlatformIcons.DIRECTORY_CLOSED_ICON); } }); diff --git a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/geb/GebUtil.java b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/geb/GebUtil.java index 3160b71e651e..ea8232982cc9 100644 --- a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/geb/GebUtil.java +++ b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/geb/GebUtil.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2016 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. @@ -18,6 +18,7 @@ package org.jetbrains.plugins.groovy.geb; import com.intellij.psi.*; import com.intellij.psi.scope.PsiScopeProcessor; import org.jetbrains.annotations.NotNull; +import org.jetbrains.plugins.groovy.lang.psi.api.auxiliary.modifiers.GrModifierFlags; import org.jetbrains.plugins.groovy.lang.psi.api.statements.GrField; import org.jetbrains.plugins.groovy.lang.psi.api.statements.blocks.GrClosableBlock; import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrCall; @@ -29,7 +30,6 @@ import org.jetbrains.plugins.groovy.lang.psi.impl.synthetic.GrLightField; import org.jetbrains.plugins.groovy.lang.psi.util.PsiUtil; import org.jetbrains.plugins.groovy.util.LightCacheKey; -import java.lang.reflect.Modifier; import java.util.Collections; import java.util.HashMap; import java.util.Map; @@ -115,7 +115,7 @@ public class GebUtil { } }; - field.getModifierList().addModifier(Modifier.STATIC); + field.getModifierList().addModifier(GrModifierFlags.STATIC_MASK); res.put(field.getName(), field); } diff --git a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/api/statements/GrVariable.java b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/api/statements/GrVariable.java index 42a4fdf63d06..569c93ce1976 100644 --- a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/api/statements/GrVariable.java +++ b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/api/statements/GrVariable.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2016 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. @@ -20,9 +20,11 @@ import com.intellij.psi.PsiType; import com.intellij.psi.PsiVariable; import com.intellij.util.ArrayFactory; import com.intellij.util.IncorrectOperationException; +import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.plugins.groovy.lang.psi.GrNamedElement; +import org.jetbrains.plugins.groovy.lang.psi.api.auxiliary.modifiers.GrModifier; import org.jetbrains.plugins.groovy.lang.psi.api.auxiliary.modifiers.GrModifierList; import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrExpression; import org.jetbrains.plugins.groovy.lang.psi.api.types.GrTypeElement; @@ -64,4 +66,7 @@ public interface GrVariable extends PsiVariable, GrNamedElement { GrModifierList getModifierList(); void setInitializerGroovy(@Nullable GrExpression initializer); + + @Override + boolean hasModifierProperty(@GrModifier.GrModifierConstant @NonNls @NotNull String name); } diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/refactoring/extract/closure/ExtractClosureHelperImpl.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/refactoring/extract/closure/ExtractClosureHelperImpl.java index 1074fc47fb0a..88115e53f945 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/refactoring/extract/closure/ExtractClosureHelperImpl.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/refactoring/extract/closure/ExtractClosureHelperImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2016 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. @@ -19,7 +19,9 @@ package org.jetbrains.plugins.groovy.refactoring.extract.closure; import com.intellij.psi.PsiClassType; import com.intellij.psi.PsiElement; import com.intellij.psi.PsiType; +import com.intellij.refactoring.IntroduceParameterRefactoring; import gnu.trove.TIntArrayList; +import org.intellij.lang.annotations.MagicConstant; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.plugins.groovy.lang.psi.api.statements.GrParametersOwner; @@ -41,6 +43,7 @@ public class ExtractClosureHelperImpl extends ExtractInfoHelperBase implements G private final boolean myFinal; private final TIntArrayList myToRemove; private final boolean myGenerateDelegate; + @MagicConstant(valuesFromClass = IntroduceParameterRefactoring.class) private final int myReplaceFieldsWithGetters; private final boolean myForceReturn; private final boolean myReplaceAllOccurrences; @@ -53,6 +56,7 @@ public class ExtractClosureHelperImpl extends ExtractInfoHelperBase implements G boolean declareFinal, TIntArrayList toRemove, boolean generateDelegate, + @MagicConstant(valuesFromClass = IntroduceParameterRefactoring.class) int replaceFieldsWithGetters, boolean forceReturn, boolean replaceAllOccurrences, diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/refactoring/introduce/parameter/GrIntroduceExpressionSettingsImpl.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/refactoring/introduce/parameter/GrIntroduceExpressionSettingsImpl.java index 5e2c29907d51..f56eec354891 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/refactoring/introduce/parameter/GrIntroduceExpressionSettingsImpl.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/refactoring/introduce/parameter/GrIntroduceExpressionSettingsImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2016 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. @@ -37,10 +37,8 @@ public class GrIntroduceExpressionSettingsImpl extends ExtractClosureHelperImpl boolean declareFinal, TIntArrayList toRemove, boolean generateDelegate, - @MagicConstant( - intValues = {IntroduceParameterRefactoring.REPLACE_FIELDS_WITH_GETTERS_ALL, - IntroduceParameterRefactoring.REPLACE_FIELDS_WITH_GETTERS_INACCESSIBLE, - IntroduceParameterRefactoring.REPLACE_FIELDS_WITH_GETTERS_NONE}) int replaceFieldsWithGetters, + @MagicConstant(valuesFromClass = IntroduceParameterRefactoring.class) + int replaceFieldsWithGetters, GrExpression expr, GrVariable var, PsiType selectedType, diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/refactoring/introduce/parameter/GrIntroduceParameterDialog.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/refactoring/introduce/parameter/GrIntroduceParameterDialog.java index 934ec49e0612..33a199dcc135 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/refactoring/introduce/parameter/GrIntroduceParameterDialog.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/refactoring/introduce/parameter/GrIntroduceParameterDialog.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * Copyright 2000-2016 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. @@ -43,6 +43,7 @@ import com.intellij.util.ui.UIUtil; import gnu.trove.TIntArrayList; import gnu.trove.TObjectIntHashMap; import gnu.trove.TObjectIntProcedure; +import org.intellij.lang.annotations.MagicConstant; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.plugins.groovy.GroovyFileType; @@ -337,7 +338,8 @@ public class GrIntroduceParameterDialog extends DialogWrapper { @Nullable private PsiType inferClosureReturnType() { final ExtractClosureHelperImpl mockHelper = - new ExtractClosureHelperImpl(myInfo, "__test___n_", false, new TIntArrayList(), false, 0, false, false, false); + new ExtractClosureHelperImpl(myInfo, "__test___n_", false, new TIntArrayList(), false, + IntroduceParameterRefactoring.REPLACE_FIELDS_WITH_GETTERS_NONE, false, false, false); final PsiType returnType; final AccessToken token = WriteAction.start(); try { @@ -532,6 +534,7 @@ public class GrIntroduceParameterDialog extends DialogWrapper { return GroovyIntroduceParameterUtil.suggestNames(var, expr, stringPart, myInfo.getToReplaceIn(), myProject); } + @MagicConstant(valuesFromClass = IntroduceParameterRefactoring.class) private int getReplaceFieldsWithGetter() { if (myDoNotReplaceRadioButton.isSelected()) return IntroduceParameterRefactoring.REPLACE_FIELDS_WITH_GETTERS_NONE; if (myReplaceFieldsInaccessibleInRadioButton.isSelected()) return IntroduceParameterRefactoring.REPLACE_FIELDS_WITH_GETTERS_INACCESSIBLE; diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/refactoring/introduce/parameter/GrIntroduceParameterSettings.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/refactoring/introduce/parameter/GrIntroduceParameterSettings.java index a4c86bc8f5d6..d70f9154c58a 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/refactoring/introduce/parameter/GrIntroduceParameterSettings.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/refactoring/introduce/parameter/GrIntroduceParameterSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2016 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. @@ -15,7 +15,9 @@ */ package org.jetbrains.plugins.groovy.refactoring.introduce.parameter; +import com.intellij.refactoring.IntroduceParameterRefactoring; import gnu.trove.TIntArrayList; +import org.intellij.lang.annotations.MagicConstant; import org.jetbrains.annotations.Nullable; import org.jetbrains.plugins.groovy.lang.psi.api.statements.GrVariable; import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrExpression; @@ -33,6 +35,7 @@ public interface GrIntroduceParameterSettings extends GrIntroduceSettings, Intro /** * @see com.intellij.refactoring.IntroduceParameterRefactoring */ + @MagicConstant(valuesFromClass = IntroduceParameterRefactoring.class) int replaceFieldsWithGetters(); boolean declareFinal(); diff --git a/plugins/svn4idea/testSource/org/jetbrains/idea/svn/SvnLockingTest.java b/plugins/svn4idea/testSource/org/jetbrains/idea/svn/SvnLockingTest.java index f4482651b936..77a2c4338432 100644 --- a/plugins/svn4idea/testSource/org/jetbrains/idea/svn/SvnLockingTest.java +++ b/plugins/svn4idea/testSource/org/jetbrains/idea/svn/SvnLockingTest.java @@ -36,6 +36,7 @@ import org.tmatesoft.svn.core.wc.SVNRevision; import org.tmatesoft.svn.core.wc.SVNWCClient; import java.io.File; +import java.util.Calendar; import java.util.concurrent.atomic.AtomicBoolean; /** @@ -188,7 +189,7 @@ public class SvnLockingTest extends TestCase { } }*/ - @Bombed(user="irengrig", year = 2020, month = 1, day = 1, + @Bombed(user="irengrig", year = 2020, month = Calendar.FEBRUARY, day = 1, description = "not clear. by specification, read should not get access if write lock is taken; sometimes it is not the case.") public void testReadInBetweenWrites() throws Exception { final HangInWrite operation1 = new HangInWrite("one1"); diff --git a/plugins/xpath/xpath-view/src/org/intellij/plugins/xpathView/Config.java b/plugins/xpath/xpath-view/src/org/intellij/plugins/xpathView/Config.java index 341b02f444af..132f71f368dc 100644 --- a/plugins/xpath/xpath-view/src/org/intellij/plugins/xpathView/Config.java +++ b/plugins/xpath/xpath-view/src/org/intellij/plugins/xpathView/Config.java @@ -34,8 +34,8 @@ public class Config { public SearchScope SEARCH_SCOPE = new SearchScope(); public boolean MATCH_RECURSIVELY = false; - public TextAttributes attributes = new TextAttributes(null, new Color(255, 213, 120), null, null, 0); - public TextAttributes contextAttributes = new TextAttributes(null, new Color(194, 255, 212), null, null, 0); + public TextAttributes attributes = new TextAttributes(null, new Color(255, 213, 120), null, null, Font.PLAIN); + public TextAttributes contextAttributes = new TextAttributes(null, new Color(194, 255, 212), null, null, Font.PLAIN); public boolean scrollToFirst = true; public boolean bUseContextAtCursor = true; public boolean bHighlightStartTagOnly = true; diff --git a/python/educational-core/student/src/com/jetbrains/edu/learning/projectView/StudyDirectoryNode.java b/python/educational-core/student/src/com/jetbrains/edu/learning/projectView/StudyDirectoryNode.java index 18b6d1c7c105..6d71a8276b7f 100644 --- a/python/educational-core/student/src/com/jetbrains/edu/learning/projectView/StudyDirectoryNode.java +++ b/python/educational-core/student/src/com/jetbrains/edu/learning/projectView/StudyDirectoryNode.java @@ -11,10 +11,10 @@ import com.intellij.psi.PsiDirectory; import com.intellij.psi.PsiElement; import com.intellij.ui.JBColor; import com.intellij.ui.SimpleTextAttributes; -import com.jetbrains.edu.learning.core.EduNames; -import com.jetbrains.edu.learning.core.EduUtils; import com.jetbrains.edu.learning.StudyTaskManager; import com.jetbrains.edu.learning.StudyUtils; +import com.jetbrains.edu.learning.core.EduNames; +import com.jetbrains.edu.learning.core.EduUtils; import com.jetbrains.edu.learning.courseFormat.*; import icons.InteractiveLearningIcons; import org.jetbrains.annotations.NotNull; @@ -126,7 +126,7 @@ public class StudyDirectoryNode extends PsiDirectoryNode { protected static void updatePresentation(PresentationData data, String additionalName, JBColor color, Icon icon) { data.clearText(); - data.addText(additionalName, new SimpleTextAttributes(Font.PLAIN, color)); + data.addText(additionalName, new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN, color)); data.setIcon(icon); } diff --git a/python/ipnb/src/org/jetbrains/plugins/ipnb/IpnbJfxUtils.java b/python/ipnb/src/org/jetbrains/plugins/ipnb/IpnbJfxUtils.java index d1504ad438f8..6104d8a2e7c6 100644 --- a/python/ipnb/src/org/jetbrains/plugins/ipnb/IpnbJfxUtils.java +++ b/python/ipnb/src/org/jetbrains/plugins/ipnb/IpnbJfxUtils.java @@ -131,7 +131,7 @@ public class IpnbJfxUtils { @NotNull private static String replaceLinks(@NotNull String source) { - final Pattern inlineLink = Pattern.compile("(\\[(.*?)\\]\\([ \\t]*?[ \\t]*(([\'\"])(.*?)\\5)?\\))", 32); + final Pattern inlineLink = Pattern.compile("(\\[(.*?)\\]\\([ \\t]*?[ \\t]*(([\'\"])(.*?)\\5)?\\))", Pattern.DOTALL); final Matcher matcher = inlineLink.matcher(source); final StringBuffer sb = new StringBuffer(); while (matcher.find()) {