Skip to content
This repository was archived by the owner on Apr 10, 2021. It is now read-only.

Commit

Permalink
May fixes #87
Browse files Browse the repository at this point in the history
  • Loading branch information
Yserz committed Oct 4, 2015
1 parent 6d92fa3 commit 83a5766
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public class FileChangeListener extends FileChangeAdapter {
private static final Logger LOG = Logger.getLogger(FileChangeListener.class.getName());
private final Project project;
private final FileObject editorConfigFileObject;
private final EditorConfigProcessor editorConfigProcessor = new EditorConfigProcessor();

static {
LOG.setLevel(LISTENER_LOG_LEVEL);
Expand Down Expand Up @@ -53,7 +54,7 @@ public void fileChanged(FileEvent event) {
if (!event.firedFrom(new WriteEditorAction()) && !event.firedFrom(new WriteStringToFileAction())) {
if (applyRulesToFile(event)) {
try {
new EditorConfigProcessor().applyRulesToFile(DataObject.find(event.getFile()));
editorConfigProcessor.applyRulesToFile(DataObject.find(event.getFile()));
} catch (DataObjectNotFoundException ex) {
Exceptions.printStackTrace(ex);
} catch (Exception ex) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public EditorConfigProcessor() {
* @param dataObject Object that represents the file which was recognized by
* an EditorConfig rule
*/
public void applyRulesToFile(DataObject dataObject) {
public synchronized void applyRulesToFile(DataObject dataObject) {
FileObject primaryFile = dataObject.getPrimaryFile();
filePath = primaryFile.getPath();

Expand Down

0 comments on commit 83a5766

Please sign in to comment.