minor performance: remove redundant initializers from volatile fields

This commit is contained in:
Alexey Kudravtsev
2016-04-29 15:04:29 +03:00
parent 954022b07d
commit 747012b19b
49 changed files with 123 additions and 123 deletions
@@ -20,8 +20,8 @@ import com.intellij.openapi.application.ModalityState;
import org.jetbrains.annotations.NotNull;
public class EmptyProgressIndicator implements StandardProgressIndicator {
private volatile boolean myIsRunning = false;
private volatile boolean myIsCanceled = false;
private volatile boolean myIsRunning;
private volatile boolean myIsCanceled;
@Override
public void start() {
@@ -91,7 +91,7 @@ public interface PsiElementProcessor<T extends PsiElement> {
class CollectElementsWithLimit<T extends PsiElement> extends CollectElements<T>{
private final AtomicInteger myCount = new AtomicInteger(0);
private volatile boolean myOverflow = false;
private volatile boolean myOverflow;
private final int myLimit;
public CollectElementsWithLimit(int limit) {
@@ -119,7 +119,7 @@ public interface PsiElementProcessor<T extends PsiElement> {
}
class FindElement<T extends PsiElement> implements PsiElementProcessor<T> {
private volatile T myFoundElement = null;
private volatile T myFoundElement;
public boolean isFound() {
return myFoundElement != null;
@@ -36,7 +36,7 @@ import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
public class ZipHandler extends ArchiveHandler {
private volatile String myCanonicalPathToZip = null;
private volatile String myCanonicalPathToZip;
private volatile long myFileStamp;
private volatile long myFileLength;
@@ -46,7 +46,7 @@ public class PsiToDocumentSynchronizer extends PsiTreeChangeAdapter {
private final MessageBus myBus;
private final Map<Document, Pair<DocumentChangeTransaction, Integer>> myTransactionsMap = new HashMap<Document, Pair<DocumentChangeTransaction, Integer>>();
private volatile Document mySyncDocument = null;
private volatile Document mySyncDocument;
public PsiToDocumentSynchronizer(PsiDocumentManagerBase psiDocumentManager, MessageBus bus) {
myPsiDocumentManager = psiDocumentManager;
@@ -51,7 +51,7 @@ public class MetaRegistry extends MetaDataRegistrar {
private static final Logger LOG = Logger.getInstance(MetaRegistry.class);
private static final List<MyBinding> ourBindings = ContainerUtil.createLockFreeCopyOnWriteList();
private static volatile boolean ourContributorsLoaded = false;
private static volatile boolean ourContributorsLoaded;
private static final Key<CachedValue<PsiMetaData>> META_DATA_KEY = Key.create("META DATA KEY");
@@ -31,7 +31,7 @@ public class DummyHolder extends PsiFileImpl {
private final CharTable myTable;
private final Boolean myExplicitlyValid;
private final Language myLanguage;
private volatile FileElement myFileElement = null;
private volatile FileElement myFileElement;
@SuppressWarnings("EmptyClass") private static class DummyHolderTreeLock {}
private final DummyHolderTreeLock myTreeElementLock = new DummyHolderTreeLock();
@@ -162,7 +162,7 @@ public class DummyHolder extends PsiFileImpl {
return psiClone;
}
private FileViewProvider myViewProvider = null;
private FileViewProvider myViewProvider;
@Override
@NotNull
@@ -35,7 +35,7 @@ import java.util.List;
*/
public abstract class CachedValueBase<T> {
private static final Logger LOG = Logger.getInstance("#com.intellij.psi.impl.CachedValueImpl");
private volatile SoftReference<Data<T>> myData = null;
private volatile SoftReference<Data<T>> myData;
private Data<T> computeData(@Nullable CachedValueProvider.Result<T> result) {
T value = result == null ? null : result.getValue();
@@ -34,7 +34,7 @@ public class ResolveProfiler {
private static final boolean DISABLED = true;
private static final ThreadLocal<ThreadInfo> threadMap = new ThreadLocal<ThreadInfo>();
private static volatile int fileCount = 0;
private static volatile int fileCount;
private static class ThreadInfo {
private final String myFileName;
@@ -51,7 +51,7 @@ public interface PsiReferenceProcessor{
}
class FindElement implements PsiReferenceProcessor{
private volatile PsiReference myFoundElement = null;
private volatile PsiReference myFoundElement;
public boolean isFound() {
return myFoundElement != null;
@@ -31,7 +31,7 @@ import java.util.List;
public abstract class SerializationManager {
protected final List<ObjectStubSerializer> myAllSerializers = new ArrayList<ObjectStubSerializer>();
private volatile boolean mySerializersLoaded = false;
private volatile boolean mySerializersLoaded;
public static SerializationManager getInstance() {
return ApplicationManager.getApplication().getComponent(SerializationManager.class);
@@ -29,7 +29,7 @@ import org.jetbrains.annotations.Nullable;
* @author Danila Ponomarenko
*/
public abstract class BaseElementAtCaretIntentionAction extends BaseIntentionAction {
private volatile boolean useElementToTheLeft = false;
private volatile boolean useElementToTheLeft;
@Override
public final boolean isAvailable(@NotNull Project project, Editor editor, PsiFile file) {
@@ -173,9 +173,9 @@ public class CodeStyleSettings extends CommonCodeStyleSettings implements Clonea
}
public boolean USE_SAME_INDENTS = false;
public boolean USE_SAME_INDENTS;
public boolean IGNORE_SAME_INDENTS_FOR_LANGUAGES = false;
public boolean IGNORE_SAME_INDENTS_FOR_LANGUAGES;
public boolean AUTODETECT_INDENTS = true;
@@ -228,8 +228,8 @@ public class CodeStyleSettings extends CommonCodeStyleSettings implements Clonea
public final TypeToNameMap LOCAL_VARIABLE_TYPE_TO_NAME = new TypeToNameMap();
//----------------- 'final' modifier settings -------
public boolean GENERATE_FINAL_LOCALS = false;
public boolean GENERATE_FINAL_PARAMETERS = false;
public boolean GENERATE_FINAL_LOCALS;
public boolean GENERATE_FINAL_PARAMETERS;
//----------------- visibility -----------------------------
public String VISIBILITY = "public";
@@ -238,7 +238,7 @@ public class CodeStyleSettings extends CommonCodeStyleSettings implements Clonea
public boolean PARENTHESES_AROUND_METHOD_ARGUMENTS = true;
//----------------- annotations ----------------
public boolean USE_EXTERNAL_ANNOTATIONS = false;
public boolean USE_EXTERNAL_ANNOTATIONS;
public boolean INSERT_OVERRIDE_ANNOTATION = true;
//----------------- override -------------------
@@ -247,12 +247,12 @@ public class CodeStyleSettings extends CommonCodeStyleSettings implements Clonea
//----------------- IMPORTS --------------------
public boolean LAYOUT_STATIC_IMPORTS_SEPARATELY = true;
public boolean USE_FQ_CLASS_NAMES = false;
public boolean USE_FQ_CLASS_NAMES;
@Deprecated
public boolean USE_FQ_CLASS_NAMES_IN_JAVADOC = true;
public boolean USE_SINGLE_CLASS_IMPORTS = true;
public boolean INSERT_INNER_CLASS_IMPORTS = false;
public boolean INSERT_INNER_CLASS_IMPORTS;
public int CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND = 5;
public int NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND = 3;
public final PackageEntryTable PACKAGES_TO_USE_IMPORT_ON_DEMAND = new PackageEntryTable();
@@ -280,7 +280,7 @@ public class CodeStyleSettings extends CommonCodeStyleSettings implements Clonea
*
* @see #WRAP_ON_TYPING
*/
public boolean WRAP_WHEN_TYPING_REACHES_RIGHT_MARGIN = false;
public boolean WRAP_WHEN_TYPING_REACHES_RIGHT_MARGIN;
// ---------------------------------- Javadoc formatting options -------------------------
@@ -296,14 +296,14 @@ public class CodeStyleSettings extends CommonCodeStyleSettings implements Clonea
*/
public boolean JD_ALIGN_EXCEPTION_COMMENTS = true;
public boolean JD_ADD_BLANK_AFTER_PARM_COMMENTS = false;
public boolean JD_ADD_BLANK_AFTER_RETURN = false;
public boolean JD_ADD_BLANK_AFTER_PARM_COMMENTS;
public boolean JD_ADD_BLANK_AFTER_RETURN;
public boolean JD_ADD_BLANK_AFTER_DESCRIPTION = true;
public boolean JD_P_AT_EMPTY_LINES = true;
public boolean JD_KEEP_INVALID_TAGS = true;
public boolean JD_KEEP_EMPTY_LINES = true;
public boolean JD_DO_NOT_WRAP_ONE_LINE_COMMENTS = false;
public boolean JD_DO_NOT_WRAP_ONE_LINE_COMMENTS;
public boolean JD_USE_THROWS_NOT_EXCEPTION = true;
public boolean JD_KEEP_EMPTY_PARAMETER = true;
@@ -313,8 +313,8 @@ public class CodeStyleSettings extends CommonCodeStyleSettings implements Clonea
public boolean JD_LEADING_ASTERISKS_ARE_ENABLED = true;
public boolean JD_PRESERVE_LINE_FEEDS = false;
public boolean JD_PARAM_DESCRIPTION_ON_NEW_LINE = false;
public boolean JD_PRESERVE_LINE_FEEDS;
public boolean JD_PARAM_DESCRIPTION_ON_NEW_LINE;
// ---------------------------------------------------------------------------------------
@@ -324,7 +324,7 @@ public class CodeStyleSettings extends CommonCodeStyleSettings implements Clonea
/**
* @deprecated Use XmlCodeStyleSettings.
*/
public boolean XML_KEEP_WHITESPACES = false;
public boolean XML_KEEP_WHITESPACES;
/**
* @deprecated Use XmlCodeStyleSettings.
*/
@@ -353,32 +353,32 @@ public class CodeStyleSettings extends CommonCodeStyleSettings implements Clonea
/**
* @deprecated Use XmlCodeStyleSettings.
*/
public boolean XML_ALIGN_TEXT = false;
public boolean XML_ALIGN_TEXT;
/**
* @deprecated Use XmlCodeStyleSettings.
*/
public boolean XML_SPACE_AROUND_EQUALITY_IN_ATTRIBUTE = false;
public boolean XML_SPACE_AROUND_EQUALITY_IN_ATTRIBUTE;
/**
* @deprecated Use XmlCodeStyleSettings.
*/
public boolean XML_SPACE_AFTER_TAG_NAME = false;
public boolean XML_SPACE_AFTER_TAG_NAME;
/**
* @deprecated Use XmlCodeStyleSettings.
*/
public boolean XML_SPACE_INSIDE_EMPTY_TAG = false;
public boolean XML_SPACE_INSIDE_EMPTY_TAG;
/**
* @deprecated Use XmlCodeStyleSettings.
*/
public boolean XML_KEEP_WHITE_SPACES_INSIDE_CDATA = false;
public boolean XML_KEEP_WHITE_SPACES_INSIDE_CDATA;
/**
* @deprecated Use XmlCodeStyleSettings.
*/
public int XML_WHITE_SPACE_AROUND_CDATA = 0;
public int XML_WHITE_SPACE_AROUND_CDATA;
// ---------------------------------------------------------------------------------------
// ---------------------------------- HTML formatting options -------------------------
public boolean HTML_KEEP_WHITESPACES = false;
public boolean HTML_KEEP_WHITESPACES;
public int HTML_ATTRIBUTE_WRAP = WRAP_AS_NEEDED;
public int HTML_TEXT_WRAP = WRAP_AS_NEEDED;
@@ -387,16 +387,16 @@ public class CodeStyleSettings extends CommonCodeStyleSettings implements Clonea
public int HTML_KEEP_BLANK_LINES = 2;
public boolean HTML_ALIGN_ATTRIBUTES = true;
public boolean HTML_ALIGN_TEXT = false;
public boolean HTML_ALIGN_TEXT;
public boolean HTML_SPACE_AROUND_EQUALITY_IN_ATTRINUTE = false;
public boolean HTML_SPACE_AFTER_TAG_NAME = false;
public boolean HTML_SPACE_INSIDE_EMPTY_TAG = false;
public boolean HTML_SPACE_AROUND_EQUALITY_IN_ATTRINUTE;
public boolean HTML_SPACE_AFTER_TAG_NAME;
public boolean HTML_SPACE_INSIDE_EMPTY_TAG;
@NonNls public String HTML_ELEMENTS_TO_INSERT_NEW_LINE_BEFORE = "body,div,p,form,h1,h2,h3";
@NonNls public String HTML_ELEMENTS_TO_REMOVE_NEW_LINE_BEFORE = "br";
@NonNls public String HTML_DO_NOT_INDENT_CHILDREN_OF = "html,body,thead,tbody,tfoot";
public int HTML_DO_NOT_ALIGN_CHILDREN_OF_MIN_LINES = 0;
public int HTML_DO_NOT_ALIGN_CHILDREN_OF_MIN_LINES;
@NonNls public String HTML_KEEP_WHITESPACES_INSIDE = "span,pre,textarea";
@NonNls public String HTML_INLINE_ELEMENTS =
@@ -409,19 +409,19 @@ public class CodeStyleSettings extends CommonCodeStyleSettings implements Clonea
// true if <%page import="x.y.z, x.y.t"%>
// false if <%page import="x.y.z"%>
// <%page import="x.y.t"%>
public boolean JSP_PREFER_COMMA_SEPARATED_IMPORT_LIST = false;
public boolean JSP_PREFER_COMMA_SEPARATED_IMPORT_LIST;
//----------------------------------------------------------------------------------------
// region Formatter control
public boolean FORMATTER_TAGS_ENABLED = false;
public boolean FORMATTER_TAGS_ENABLED;
public String FORMATTER_ON_TAG = "@formatter:on";
public String FORMATTER_OFF_TAG = "@formatter:off";
public volatile boolean FORMATTER_TAGS_ACCEPT_REGEXP = false;
private volatile Pattern myFormatterOffPattern = null;
private volatile Pattern myFormatterOnPattern = null;
public volatile boolean FORMATTER_TAGS_ACCEPT_REGEXP;
private volatile Pattern myFormatterOffPattern;
private volatile Pattern myFormatterOnPattern;
@Nullable
public Pattern getFormatterOffPattern() {
@@ -33,11 +33,11 @@ import org.jetbrains.annotations.Nullable;
public class CodeStyleSettingsManager implements PersistentStateComponent<Element> {
private static final Logger LOG = Logger.getInstance("#" + CodeStyleSettingsManager.class.getName());
public volatile CodeStyleSettings PER_PROJECT_SETTINGS = null;
public volatile boolean USE_PER_PROJECT_SETTINGS = false;
public volatile String PREFERRED_PROJECT_CODE_STYLE = null;
public volatile CodeStyleSettings PER_PROJECT_SETTINGS;
public volatile boolean USE_PER_PROJECT_SETTINGS;
public volatile String PREFERRED_PROJECT_CODE_STYLE;
private volatile CodeStyleSettings myTemporarySettings;
private volatile boolean myIsLoaded = false;
private volatile boolean myIsLoaded;
public static CodeStyleSettingsManager getInstance(@Nullable Project project) {
if (project == null || project.isDefault()) return getInstance();
@@ -50,7 +50,7 @@ public abstract class BackgroundUpdaterTask<T> extends Task.Backgroundable {
private final Alarm myAlarm = new Alarm(Alarm.ThreadToUse.SWING_THREAD);
private final Object lock = new Object();
private volatile boolean myCanceled = false;
private volatile boolean myCanceled;
public BackgroundUpdaterTask(Project project, String title, boolean canBeCancelled) {
super(project, title, canBeCancelled);
@@ -24,8 +24,8 @@ import javax.swing.tree.TreeNode;
* @author Dmitry Batkovich
*/
public abstract class CachedInspectionTreeNode extends InspectionTreeNode implements RefElementAndDescriptorAware {
private volatile String myPresentableName = null;
private volatile Boolean myValid = null;
private volatile String myPresentableName;
private volatile Boolean myValid;
protected CachedInspectionTreeNode(Object userObject) {
super(userObject);
@@ -80,7 +80,7 @@ class RunConfigurable extends BaseConfigurable {
}
};
private volatile boolean isDisposed = false;
private volatile boolean isDisposed;
private final Project myProject;
private RunDialogBase myRunDialog;
@@ -40,7 +40,7 @@ import org.jetbrains.annotations.NotNull;
public class FindInProjectManager {
private final Project myProject;
private volatile boolean myIsFindInProgress = false;
private volatile boolean myIsFindInProgress;
public static FindInProjectManager getInstance(Project project) {
return ServiceManager.getService(project, FindInProjectManager.class);
@@ -610,8 +610,8 @@ public class PsiVFSListener extends VirtualFileAdapter {
}
private class MyModuleRootListener implements ModuleRootListener {
private VirtualFile[] myOldContentRoots = null;
private volatile int depthCounter = 0;
private VirtualFile[] myOldContentRoots;
private volatile int depthCounter;
@Override
public void beforeRootsChange(final ModuleRootEvent event) {
if (!myFileManager.isInitialized()) return;
@@ -84,7 +84,7 @@ public abstract class ValueContainer<Value> {
return true;
}
private volatile boolean myNeedsCompacting = false;
private volatile boolean myNeedsCompacting;
boolean needsCompacting() {
return myNeedsCompacting;
@@ -29,12 +29,12 @@ import java.beans.PropertyChangeListener;
abstract class DocumentsSynchronizer {
private static final Logger LOG = Logger.getInstance("#com.intellij.openapi.diff.DocumentsSynchonizer");
private Document myOriginal = null;
private Document myCopy = null;
private Document myOriginal;
private Document myCopy;
private final Project myProject;
private volatile boolean myDuringModification = false;
private int myAssignedCount = 0;
private volatile boolean myDuringModification;
private int myAssignedCount;
private final DocumentAdapter myOriginalListener = new DocumentAdapter() {
@Override
@@ -46,7 +46,7 @@ public class CommonProxy extends ProxySelector {
public final static List<Proxy> NO_PROXY_LIST = Collections.singletonList(Proxy.NO_PROXY);
private final static long ourErrorInterval = TimeUnit.MINUTES.toMillis(3);
private static volatile int ourNotificationCount;
private volatile static long ourErrorTime = 0;
private volatile static long ourErrorTime;
private volatile static ProxySelector ourWrong;
private static final AtomicReference<Map<String, String>> ourProps = new AtomicReference<Map<String, String>>();
@@ -40,7 +40,7 @@ public abstract class Animator implements Disposable {
private long myStartTime;
private long myStartDeltaTime;
private boolean myInitialStep;
private volatile boolean myDisposed = false;
private volatile boolean myDisposed;
public Animator(@NonNls final String name,
final int totalFrames,
@@ -40,7 +40,7 @@ public class DialogAppender extends AppenderSkeleton {
private static final ErrorLogger DEFAULT_LOGGER = new DefaultIdeaErrorLogger();
private static final int MAX_ASYNC_LOGGING_EVENTS = 5;
private volatile Runnable myDialogRunnable = null;
private volatile Runnable myDialogRunnable;
private final AtomicInteger myPendingAppendCounts = new AtomicInteger();
@Override
@@ -56,7 +56,7 @@ public class SaveAndSyncHandlerImpl extends SaveAndSyncHandler implements Dispos
private final SingleAlarm myRefreshDelayAlarm = new SingleAlarm(this::doScheduledRefresh, 300, this);
private final AtomicInteger myBlockSaveOnFrameDeactivationCount = new AtomicInteger();
private final AtomicInteger myBlockSyncOnFrameActivationCount = new AtomicInteger();
private volatile long myRefreshSessionId = 0;
private volatile long myRefreshSessionId;
public SaveAndSyncHandlerImpl(@NotNull GeneralSettings generalSettings,
@NotNull ProgressManager progressManager,
@@ -64,12 +64,12 @@ import java.util.List;
public class NewErrorTreeViewPanel extends JPanel implements DataProvider, OccurenceNavigator, MutableErrorTreeView, CopyProvider {
protected static final Logger LOG = Logger.getInstance("#com.intellij.ide.errorTreeView.NewErrorTreeViewPanel");
private volatile String myProgressText = "";
private volatile float myFraction = 0.0f;
private volatile float myFraction;
private final boolean myCreateExitAction;
private final ErrorViewStructure myErrorViewStructure;
private final ErrorViewTreeBuilder myBuilder;
private final Alarm myUpdateAlarm = new Alarm(Alarm.ThreadToUse.SWING_THREAD);
private volatile boolean myIsDisposed = false;
private volatile boolean myIsDisposed;
private final ErrorTreeViewConfiguration myConfiguration;
public interface ProcessController {
@@ -65,11 +65,11 @@ public class StartupManagerImpl extends StartupManagerEx {
private final List<Runnable> myDumbAwarePostStartupActivities = Collections.synchronizedList(new LinkedList<Runnable>());
private final List<Runnable> myNotDumbAwarePostStartupActivities = Collections.synchronizedList(new LinkedList<Runnable>());
private boolean myPostStartupActivitiesPassed = false; // guarded by this
private boolean myPostStartupActivitiesPassed; // guarded by this
private volatile boolean myPreStartupActivitiesPassed = false;
private volatile boolean myStartupActivitiesRunning = false;
private volatile boolean myStartupActivitiesPassed = false;
private volatile boolean myPreStartupActivitiesPassed;
private volatile boolean myStartupActivitiesRunning;
private volatile boolean myStartupActivitiesPassed;
private final Project myProject;
@@ -37,7 +37,7 @@ class IgnoredFileCache {
private final ConcurrentBitSet myCheckedIds = new ConcurrentBitSet();
private final ConcurrentIntObjectMap<Object> myIgnoredIds = ContainerUtil.createConcurrentIntObjectMap();
private final IgnoredPatternSet myIgnoredPatterns;
private volatile int myVfsEventNesting = 0;
private volatile int myVfsEventNesting;
IgnoredFileCache(@NotNull IgnoredPatternSet ignoredPatterns) {
myIgnoredPatterns = ignoredPatterns;
@@ -58,7 +58,7 @@ public class DumbServiceImpl extends DumbService implements Disposable, Modifica
}
};
private static Throwable ourForcedTrace;
private volatile boolean myDumb = false;
private volatile boolean myDumb;
private volatile Throwable myDumbStart;
private volatile TransactionId myDumbStartTransaction;
private boolean myUpdateFinishedQueued;
@@ -65,8 +65,8 @@ public class NativeFileWatcherImpl extends PluggableFileWatcher {
private File myExecutable;
private volatile MyProcessHandler myProcessHandler;
private volatile int myStartAttemptCount = 0;
private volatile boolean myIsShuttingDown = false;
private volatile int myStartAttemptCount;
private volatile boolean myIsShuttingDown;
private final AtomicInteger mySettingRoots = new AtomicInteger(0);
private volatile List<String> myRecursiveWatchRoots = Collections.emptyList();
private volatile List<String> myFlatWatchRoots = Collections.emptyList();
@@ -287,7 +287,7 @@ public class NativeFileWatcherImpl extends PluggableFileWatcher {
private class MyProcessHandler extends OSProcessHandler {
private final BufferedWriter myWriter;
private WatcherOp myLastOp = null;
private WatcherOp myLastOp;
private final List<String> myLines = ContainerUtil.newArrayList();
@SuppressWarnings("IOResourceOpenedButNotSafelyClosed")
@@ -59,7 +59,7 @@ public class RefreshWorker {
private final boolean myIsRecursive;
private final Queue<Pair<NewVirtualFile, FileAttributes>> myRefreshQueue = new Queue<Pair<NewVirtualFile, FileAttributes>>(100);
private final List<VFileEvent> myEvents = new ArrayList<VFileEvent>();
private volatile boolean myCancelled = false;
private volatile boolean myCancelled;
public RefreshWorker(@NotNull NewVirtualFile refreshRoot, boolean isRecursive) {
myIsRecursive = isRecursive;
@@ -418,7 +418,7 @@ public class RefreshWorker {
}
}
private static Function<VirtualFile, Boolean> ourCancellingCondition = null;
private static Function<VirtualFile, Boolean> ourCancellingCondition;
@TestOnly
public static void setCancellingCondition(@Nullable Function<VirtualFile, Boolean> condition) {
@@ -44,7 +44,7 @@ public class GroupNode extends Node implements Navigatable, Comparable<GroupNode
private final Map<UsageGroup, GroupNode> mySubgroupNodes = new THashMap<UsageGroup, GroupNode>();
private final List<UsageNode> myUsageNodes = new SmartList<UsageNode>();
@NotNull private final UsageViewTreeModelBuilder myUsageTreeModel;
private volatile int myRecursiveUsageCount = 0;
private volatile int myRecursiveUsageCount;
public GroupNode(@Nullable UsageGroup group, int ruleIndex, @NotNull UsageViewTreeModelBuilder treeModel) {
super(treeModel);
@@ -108,7 +108,7 @@ public class UsageViewImpl implements UsageView, UsageModelTracker.UsageModelTra
private final ButtonPanel myButtonPanel = new ButtonPanel();
private final JComponent myAdditionalComponent = new JPanel(new BorderLayout());
private volatile boolean isDisposed;
private volatile boolean myChangesDetected = false;
private volatile boolean myChangesDetected;
public static final Comparator<Usage> USAGE_COMPARATOR = new Comparator<Usage>() {
@Override
public int compare(final Usage o1, final Usage o2) {
@@ -104,7 +104,7 @@ public class PagedFileStorage implements Forceable {
private final Object myLastAccessedBufferCacheLock = new Object();
private final byte[] myTypedIOBuffer;
private volatile boolean isDirty = false;
private volatile boolean isDirty;
private final File myFile;
protected volatile long mySize = -1;
protected final int myPageSize;
@@ -31,7 +31,7 @@ public class RandomAccessDataFile implements Forceable, Closeable {
protected static final Logger LOG = Logger.getInstance("#com.intellij.util.io.RandomAccessDataFile");
private static final OpenChannelsCache ourCache = new OpenChannelsCache(150, "rw");
private static int ourFilesCount = 0;
private static int ourFilesCount;
private final int myCount = ourFilesCount++;
private final File myFile;
@@ -43,8 +43,8 @@ public class RandomAccessDataFile implements Forceable, Closeable {
private final FileWriter log;
private volatile long mySize;
private volatile boolean myIsDirty = false;
private volatile boolean myIsDisposed = false;
private volatile boolean myIsDirty;
private volatile boolean myIsDisposed;
private static final boolean DEBUG = false;
@@ -243,12 +243,12 @@ public class RandomAccessDataFile implements Forceable, Closeable {
}
}
public static int totalReads = 0;
public static long totalReadBytes = 0;
public static int totalReads;
public static long totalReadBytes;
public static int seekcount = 0;
public static int totalWrites = 0;
public static long totalWriteBytes = 0;
public static int seekcount;
public static int totalWrites;
public static long totalWriteBytes;
void loadPage(final Page page) {
assertNotDisposed();
@@ -292,7 +292,7 @@ public class UIUtil {
}
};
private static volatile Pair<String, Integer> ourSystemFontData = null;
private static volatile Pair<String, Integer> ourSystemFontData;
public static final float DEF_SYSTEM_FONT_SIZE = 12f; // TODO: consider 12 * 1.33 to compensate JDK's 72dpi font scale
@@ -3503,7 +3503,7 @@ public class UIUtil {
return null;
}
private static Map<String, String> ourRealFontFamilies = null;
private static Map<String, String> ourRealFontFamilies;
//Experimental, seems to be reliable under MacOS X only
@@ -39,7 +39,7 @@ import java.util.List;
*/
public class GrClosureType extends GrLiteralClassType {
private final GrSignature mySignature;
private volatile PsiType[] myTypeArgs = null;
private volatile PsiType[] myTypeArgs;
private GrClosureType(LanguageLevel languageLevel,
@NotNull GlobalSearchScope scope,
@@ -32,7 +32,7 @@ import org.jetbrains.plugins.groovy.lang.psi.api.types.GrTypeElement;
* @author ven
*/
public abstract class GrReferenceElementImpl<Q extends PsiElement> extends GroovyPsiElementImpl implements GrReferenceElement<Q> {
private volatile String myCachedQName = null;
private volatile String myCachedQName;
private volatile String myCachedTextSkipWhiteSpaceAndComments;
public GrReferenceElementImpl(@NotNull ASTNode node) {
@@ -57,7 +57,7 @@ import java.util.List;
*/
public abstract class GroovyFileBaseImpl extends PsiFileBase implements GroovyFileBase, GrControlFlowOwner {
private GrMethod[] myMethods = null;
private GrMethod[] myMethods;
@Override
public void subtreeChanged() {
@@ -220,7 +220,7 @@ public abstract class GroovyFileBaseImpl extends PsiFileBase implements GroovyFi
myControlFlow = null;
}
private volatile SoftReference<Instruction[]> myControlFlow = null;
private volatile SoftReference<Instruction[]> myControlFlow;
@Override
public Instruction[] getControlFlow() {
@@ -79,7 +79,7 @@ public class GroovyFileImpl extends GroovyFileBaseImpl implements GroovyFile {
private volatile Boolean myScript;
private volatile GroovyScriptClass myScriptClass;
private volatile GrParameter mySyntheticArgsParameter = null;
private volatile GrParameter mySyntheticArgsParameter;
private volatile PsiElement myContext;
public GroovyFileImpl(FileViewProvider viewProvider) {
@@ -55,8 +55,8 @@ public class GrListOrMapImpl extends GrExpressionImpl implements GrListOrMap {
private static final Function<GrListOrMapImpl, PsiType> TYPES_CALCULATOR = new MyTypesCalculator();
private final PsiReference myLiteralReference = new LiteralConstructorReference(this);
private volatile GrExpression[] myInitializers = null;
private volatile GrNamedArgument[] myNamedArguments = null;
private volatile GrExpression[] myInitializers;
private volatile GrNamedArgument[] myNamedArguments;
public GrListOrMapImpl(@NotNull ASTNode node) {
super(node);
@@ -38,7 +38,7 @@ public class GrLightParameter extends LightVariableBuilder<GrLightParameter> imp
public static final GrLightParameter[] EMPTY_ARRAY = new GrLightParameter[0];
private volatile boolean myOptional;
private volatile GrModifierList myModifierList;
private volatile GrExpression myInitializer = null;
private volatile GrExpression myInitializer;
private final PsiElement myScope;
private final GrTypeElement myTypeElement;
private final PsiType myTypeGroovy;
@@ -54,10 +54,10 @@ import java.util.List;
*/
public class GroovyScriptClass extends LightElement implements PsiClass, SyntheticElement {
private final GroovyFile myFile;
private volatile PsiMethod myMainMethod = null;
private volatile PsiMethod myRunMethod = null;
private volatile PsiMethod myMainMethod;
private volatile PsiMethod myRunMethod;
private volatile boolean myInitialized = false;
private volatile boolean myInitialized;
private final LightModifierList myModifierList;
@@ -33,7 +33,7 @@ import java.util.ArrayList;
* @author Max Medvedev
*/
public class GrDisjunctionTypeElementImpl extends GroovyPsiElementImpl implements GrDisjunctionTypeElement {
private volatile PsiType myCachedType = null;
private volatile PsiType myCachedType;
public GrDisjunctionTypeElementImpl(@NotNull ASTNode node) {
super(node);
@@ -163,9 +163,9 @@ public class XmlAttributeImpl extends XmlElementImpl implements XmlAttribute, Hi
return valueElement != null ? valueElement.getValue() : null;
}
private volatile String myDisplayText = null;
private volatile int[] myGapDisplayStarts = null;
private volatile int[] myGapPhysicalStarts = null;
private volatile String myDisplayText;
private volatile int[] myGapDisplayStarts;
private volatile int[] myGapPhysicalStarts;
private volatile TextRange myValueTextRange; // text inside quotes, if there are any
protected void appendChildToDisplayValue(StringBuilder buffer, ASTNode child) {
@@ -101,13 +101,13 @@ public class XmlTagImpl extends XmlElementImpl implements XmlTag, HintedReferenc
}
};
private final int myHC = ourHC++;
private volatile String myName = null;
private volatile String myName;
private volatile String myLocalName;
private volatile XmlAttribute[] myAttributes = null;
private volatile TextRange[] myTextElements = null;
private volatile Map<String, String> myAttributeValueMap = null;
private volatile XmlTagValue myValue = null;
private volatile boolean myHasNamespaceDeclarations = false;
private volatile XmlAttribute[] myAttributes;
private volatile TextRange[] myTextElements;
private volatile Map<String, String> myAttributeValueMap;
private volatile XmlTagValue myValue;
private volatile boolean myHasNamespaceDeclarations;
public XmlTagImpl() {
this(XmlElementType.XML_TAG);
@@ -1270,7 +1270,7 @@ public class XmlTagImpl extends XmlElementImpl implements XmlTag, HintedReferenc
private final ASTNode myAnchor;
private final boolean myBefore;
private final PomModel myModel;
private TreeElement myFirstInserted = null;
private TreeElement myFirstInserted;
public InsertAttributeTransaction(final TreeElement child, final ASTNode anchor, final boolean before, final PomModel model) {
super(XmlTagImpl.this);
@@ -36,9 +36,9 @@ public class XmlTagValueImpl implements XmlTagValue{
private final XmlTag myTag;
private final XmlTagChild[] myElements;
private volatile XmlText[] myTextElements = null;
private volatile String myText = null;
private volatile String myTrimmedText = null;
private volatile XmlText[] myTextElements;
private volatile String myText;
private volatile String myTrimmedText;
public XmlTagValueImpl(@NotNull XmlTagChild[] bodyElements, @NotNull XmlTag tag) {
myTag = tag;
@@ -163,7 +163,7 @@ public class XmlTagValueImpl implements XmlTagValue{
final List<XmlTagChild> bodyElements = new ArrayList<XmlTagChild>();
tag.processElements(new PsiElementProcessor() {
boolean insideBody = false;
boolean insideBody;
@Override
public boolean execute(@NotNull PsiElement element) {
final ASTNode treeElement = element.getNode();
@@ -50,9 +50,9 @@ import java.util.Arrays;
public class XmlTextImpl extends XmlElementImpl implements XmlText, PsiLanguageInjectionHost {
private static final Logger LOG = Logger.getInstance("#com.intellij.psi.impl.source.xml.XmlTextImpl");
private volatile String myDisplayText = null;
private volatile int[] myGapDisplayStarts = null;
private volatile int[] myGapPhysicalStarts = null;
private volatile String myDisplayText;
private volatile int[] myGapDisplayStarts;
private volatile int[] myGapPhysicalStarts;
public XmlTextImpl() {
super(XmlElementType.XML_TEXT);
@@ -26,7 +26,7 @@ import com.intellij.xml.XmlElementsGroup;
import java.util.HashMap;
public abstract class BaseXmlElementDescriptorImpl implements XmlElementDescriptor {
private volatile XmlElementDescriptor[] myElementDescriptors = null;
private volatile XmlElementDescriptor[] myElementDescriptors;
private volatile XmlAttributeDescriptor[] myAttributeDescriptors;
private volatile HashMap<String,XmlElementDescriptor> myElementDescriptorsMap;
private volatile HashMap<String,XmlAttributeDescriptor> attributeDescriptorsMap;
@@ -107,8 +107,8 @@ public class ComplexTypeDescriptor extends TypeDescriptor {
}
};
private volatile XmlElementDescriptor[] myElementDescriptors = null;
private volatile XmlAttributeDescriptor[] myAttributeDescriptors = null;
private volatile XmlElementDescriptor[] myElementDescriptors;
private volatile XmlAttributeDescriptor[] myAttributeDescriptors;
@NonNls
private static final String PROHIBITED_ATTR_VALUE = "prohibited";
@NonNls