cleanup the MagicConstantInspection warnings

This commit is contained in:
Alexey Kudravtsev
2016-04-19 13:46:27 +03:00
parent a566493b9c
commit 522ba1e5e1
47 changed files with 145 additions and 106 deletions
@@ -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;
@@ -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<ParameterIn
getCellState().updateRenderer(this);
setPaintFocusBorder(false);
}
append((String)value, new SimpleTextAttributes(Font.PLAIN, null));
append((String)value, new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN, null));
}
};
@@ -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.
@@ -51,7 +51,9 @@ public class InlineParameterDialog extends RefactoringDialog {
@Override
protected JComponent createNorthPanel() {
final JPanel panel = new JPanel(new BorderLayout());
panel.add(new JLabel(RefactoringBundle.message("inline.parameter.confirmation", myParameter.getName(), myInitializer.getText()), UIManager.getIcon("OptionPane.questionIcon"), 2), BorderLayout.NORTH);
String message = RefactoringBundle.message("inline.parameter.confirmation", myParameter.getName(), myInitializer.getText());
JLabel label = new JLabel(message, UIManager.getIcon("OptionPane.questionIcon"), SwingConstants.LEFT);
panel.add(label, BorderLayout.NORTH);
return panel;
}
@@ -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.
@@ -172,7 +172,7 @@ public class TextAttributes implements Cloneable {
public void setFontType(@JdkConstants.FontStyle int type) {
if (type < 0 || type > 3) {
LOG.error("Wrong font type: " + type);
type = 0;
type = Font.PLAIN;
}
myAttrs = myAttrs.withFontType(type);
}
@@ -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);
}
@@ -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)) {
@@ -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");
@@ -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
@@ -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<UnnamedCo
return checkBox.isSelected() != value;
}
@MagicConstant(intValues = {CodeInsightSettings.NO_REFORMAT, CodeInsightSettings.INDENT_BLOCK, CodeInsightSettings.INDENT_EACH_LINE, CodeInsightSettings.REFORMAT_BLOCK})
private int getReformatPastedBlockValue(){
Object selectedItem = myReformatOnPasteCombo.getSelectedItem();
if (NO_REFORMAT.equals(selectedItem)){
@@ -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.
@@ -40,7 +40,7 @@ import java.awt.*;
import java.util.Set;
public class ShowParameterInfoHandler implements CodeInsightActionHandler {
private boolean myRequestFocus;
private final boolean myRequestFocus;
public ShowParameterInfoHandler() {
this(false);
@@ -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.
@@ -340,7 +340,7 @@ public final class NavigationUtil {
boolean hasFocus) {
final GotoRelatedItem item = (GotoRelatedItem)value;
Color color = list.getForeground();
final SimpleTextAttributes nameAttributes = new SimpleTextAttributes(Font.PLAIN, color);
final SimpleTextAttributes nameAttributes = new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN, color);
final String name = item.getCustomName();
if (name == null) return false;
renderer.append(name, nameAttributes);
@@ -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.
@@ -97,7 +97,7 @@ public class LivePreview extends DocumentAdapter implements SearchResults.Search
private static TextAttributes strikeout() {
Color color = EditorColorsManager.getInstance().getGlobalScheme().getDefaultForeground();
return new TextAttributes(null, null, color, EffectType.STRIKEOUT, 0);
return new TextAttributes(null, null, color, EffectType.STRIKEOUT, Font.PLAIN);
}
@Override
@@ -233,7 +233,7 @@ public class LivePreview extends DocumentAdapter implements SearchResults.Search
if (cursor != null && cursor.getEndOffset() <= editor.getDocument().getTextLength()) {
Set<RangeHighlighter> dummy = new HashSet<RangeHighlighter>();
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);
}
@@ -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<Bookmark> {
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;
@@ -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()) {
@@ -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);
@@ -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<T extends PsiElement> 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<T extends PsiElement> 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);
}
@@ -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<PsiFileSyst
SimpleTextAttributes nameAttributes = attributes != null ? SimpleTextAttributes.fromTextAttributes(attributes) : null;
Color color = list.getForeground();
if (nameAttributes == null) nameAttributes = new SimpleTextAttributes(Font.PLAIN, color);
if (nameAttributes == null) nameAttributes = new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN, color);
renderer.append(item + " ", nameAttributes);
ItemPresentation itemPresentation = item.getPresentation();
@@ -124,7 +124,7 @@ public class GotoFileCellRenderer extends PsiElementListCellRenderer<PsiFileSyst
String locationString = itemPresentation.getLocationString();
if (!StringUtil.isEmpty(locationString)) {
renderer.append(locationString, new SimpleTextAttributes(Font.PLAIN, JBColor.GRAY));
renderer.append(locationString, new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN, JBColor.GRAY));
}
return true;
}
@@ -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.
@@ -36,7 +36,6 @@ import org.jetbrains.jps.model.module.JpsModuleSourceRootType;
import javax.swing.*;
import javax.swing.tree.DefaultMutableTreeNode;
import java.awt.*;
import java.util.List;
public class ContentEntryTreeCellRenderer extends NodeRenderer {
@@ -64,7 +63,7 @@ public class ContentEntryTreeCellRenderer extends NodeRenderer {
if (contentEntry != null) {
final String prefix = getPresentablePrefix(contentEntry, file);
if (!prefix.isEmpty()) {
append(" (" + prefix + ")", new SimpleTextAttributes(Font.PLAIN, JBColor.GRAY));
append(" (" + prefix + ")", new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN, JBColor.GRAY));
}
setIcon(updateIcon(contentEntry, file, getIcon()));
}
@@ -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.
@@ -81,7 +81,7 @@ public abstract class InspectionsConfigTreeRenderer extends DefaultTreeRenderer
SearchUtil.appendFragments(getFilter(), text, style, foreground, background, component);
}
if (hint != null) {
component.append(" " + hint, selected ? new SimpleTextAttributes(Font.PLAIN, foreground) : SimpleTextAttributes.GRAYED_ATTRIBUTES);
component.append(" " + hint, selected ? new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN, foreground) : SimpleTextAttributes.GRAYED_ATTRIBUTES);
}
component.setForeground(foreground);
return component;
@@ -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.
@@ -194,7 +194,7 @@ public abstract class ParameterTableModelBase<P extends ParameterInfo, TableItem
public void customizeCellRenderer(JTable table, Object value,
boolean isSelected, boolean hasFocus, int row, int column) {
if (value == null) return;
append((String)value, new SimpleTextAttributes(Font.PLAIN, null));
append((String)value, new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN, null));
}
};
}
@@ -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.
@@ -407,7 +407,7 @@ public abstract class AbstractMemberSelectionTable<T extends PsiElement, M exten
else if (problem == MemberInfoModel.WARNING && !isSelected) {
c = JBColor.BLUE;
}
append((String)value, new SimpleTextAttributes(Font.PLAIN, c));
append((String)value, new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN, c));
}
}
@@ -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.
@@ -73,7 +73,7 @@ public abstract class SimpleNode extends PresentableNodeDescriptor implements Co
}
protected SimpleTextAttributes getPlainAttributes() {
return new SimpleTextAttributes(Font.PLAIN, getColor());
return new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN, getColor());
}
private FileStatus getFileStatus() {
@@ -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.
@@ -16,7 +16,10 @@
package com.intellij.ide;
import com.intellij.openapi.extensions.ExtensionPointName;
import com.intellij.openapi.options.*;
import com.intellij.openapi.options.CompositeConfigurable;
import com.intellij.openapi.options.Configurable;
import com.intellij.openapi.options.ConfigurationException;
import com.intellij.openapi.options.SearchableConfigurable;
import com.intellij.openapi.options.ex.ConfigurableWrapper;
import com.intellij.ui.components.JBRadioButton;
import org.jetbrains.annotations.NotNull;
@@ -67,6 +70,7 @@ public class GeneralSettingsConfigurable extends CompositeConfigurable<Searchabl
settings.setUseSafeWrite(myComponent.myChkUseSafeWrite.isSelected());
}
@GeneralSettings.OpenNewProjectOption
private int getConfirmOpenNewProject() {
if (myComponent.myConfirmWindowToOpenProject.isSelected()) {
return GeneralSettings.OPEN_PROJECT_ASK;
@@ -43,7 +43,7 @@ public class ComplementaryFontsRegistry {
private static final List<String> ourFontNames;
private static final Map<String, Pair<String, Integer>[]> ourStyledFontMap = new HashMap<String, Pair<String, Integer>[]>();
private static final LinkedHashMap<FontKey, FontInfo> 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;
@@ -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) {
@@ -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;
@@ -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();
@@ -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) {
@@ -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<AnAction> myActions = new ArrayList<AnAction>(1);
private final Map<Container, BlockState> myRootPane2BlockedId = new HashMap<Container, BlockState>();
private int myLastHorScrolledComponentHash = 0;
private final ArrayList<AnAction> myActions = new ArrayList<>(1);
private final Map<Container, BlockState> 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;
@@ -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) {
@@ -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),
@@ -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);
}
}
}
@@ -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);
}
}
@@ -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;
@@ -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);
}
@@ -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() {
@@ -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);
}
});
@@ -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);
}
@@ -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);
}
@@ -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,
@@ -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,
@@ -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;
@@ -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();
@@ -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");
@@ -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;
@@ -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);
}
@@ -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()) {