mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
correctly init fileTypeChangedCounter (because now we store this non-roamable property in other component)
This commit is contained in:
+7
-3
@@ -140,7 +140,11 @@ public class FileTypeManagerImpl extends FileTypeManagerEx implements Persistent
|
||||
private final AtomicInteger counterAutoDetect = new AtomicInteger();
|
||||
private final AtomicLong elapsedAutoDetect = new AtomicLong();
|
||||
|
||||
public FileTypeManagerImpl(MessageBus bus, SchemesManagerFactory schemesManagerFactory) {
|
||||
public FileTypeManagerImpl(MessageBus bus, SchemesManagerFactory schemesManagerFactory, PropertiesComponent propertiesComponent) {
|
||||
int fileTypeChangedCounter = StringUtilRt.parseInt(propertiesComponent.getValue("fileTypeChangedCounter"), 0);
|
||||
fileTypeChangedCount = new AtomicInteger(fileTypeChangedCounter);
|
||||
autoDetectedAttribute = new FileAttribute("AUTO_DETECTION_CACHE_ATTRIBUTE", fileTypeChangedCounter, true);
|
||||
|
||||
myMessageBus = bus;
|
||||
mySchemesManager = schemesManagerFactory.createSchemesManager(FILE_SPEC, new BaseSchemeProcessor<AbstractFileType>() {
|
||||
@NotNull
|
||||
@@ -536,7 +540,7 @@ public class FileTypeManagerImpl extends FileTypeManagerEx implements Persistent
|
||||
return file.getFileType();
|
||||
}
|
||||
|
||||
private volatile FileAttribute autoDetectedAttribute = new FileAttribute("AUTO_DETECTION_CACHE_ATTRIBUTE", 0, true);
|
||||
private volatile FileAttribute autoDetectedAttribute;
|
||||
private void cacheAutoDetectedFileType(@NotNull VirtualFile file, @NotNull FileType fileType) {
|
||||
DataOutputStream stream = autoDetectedAttribute.writeAttribute(file);
|
||||
boolean wasAutodetectedAsText = fileType == FileTypes.PLAIN_TEXT;
|
||||
@@ -802,7 +806,7 @@ public class FileTypeManagerImpl extends FileTypeManagerEx implements Persistent
|
||||
myMessageBus.syncPublisher(TOPIC).beforeFileTypesChanged(event);
|
||||
}
|
||||
|
||||
private final AtomicInteger fileTypeChangedCount = new AtomicInteger();
|
||||
private final AtomicInteger fileTypeChangedCount;
|
||||
@Override
|
||||
public void fireFileTypesChanged() {
|
||||
clearCaches();
|
||||
|
||||
Reference in New Issue
Block a user