diff options
author | Decebal Suiu <decebal.suiu@gmail.com> | 2016-02-20 05:55:23 +0200 |
---|---|---|
committer | Decebal Suiu <decebal.suiu@gmail.com> | 2016-02-20 05:55:23 +0200 |
commit | 0295f2caa30964624fec192452b0fe1fb8d10b9a (patch) | |
tree | d6f1b5f19833057e468b595a8cca2b954a79d8ce | |
parent | f02840a603a4416f73a2b6747c3224785d43fd7e (diff) | |
download | pf4j-0295f2caa30964624fec192452b0fe1fb8d10b9a.tar.gz pf4j-0295f2caa30964624fec192452b0fe1fb8d10b9a.zip |
Possible fix for #91
-rw-r--r-- | pf4j/src/main/java/ro/fortsoft/pf4j/processor/LegacyExtensionStorage.java | 5 | ||||
-rw-r--r-- | pf4j/src/main/java/ro/fortsoft/pf4j/processor/ServiceProviderExtensionStorage.java | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/pf4j/src/main/java/ro/fortsoft/pf4j/processor/LegacyExtensionStorage.java b/pf4j/src/main/java/ro/fortsoft/pf4j/processor/LegacyExtensionStorage.java index e742178..15d417a 100644 --- a/pf4j/src/main/java/ro/fortsoft/pf4j/processor/LegacyExtensionStorage.java +++ b/pf4j/src/main/java/ro/fortsoft/pf4j/processor/LegacyExtensionStorage.java @@ -15,6 +15,7 @@ */ package ro.fortsoft.pf4j.processor; +import javax.annotation.processing.FilerException; import javax.tools.FileObject; import javax.tools.StandardLocation; import java.io.BufferedReader; @@ -69,6 +70,8 @@ public class LegacyExtensionStorage extends ExtensionStorage { extensions.put(null, entries); } catch (FileNotFoundException e) { // ignore + } catch (FilerException e) { + // re-opening the file for reading or after writing is ignorable } catch (IOException e) { error(e.getMessage()); } @@ -93,6 +96,8 @@ public class LegacyExtensionStorage extends ExtensionStorage { writer.close(); } catch (FileNotFoundException e) { // it's the first time, create the file + } catch (FilerException e) { + // re-opening the file for reading or after writing is ignorable } catch (IOException e) { error(e.toString()); } diff --git a/pf4j/src/main/java/ro/fortsoft/pf4j/processor/ServiceProviderExtensionStorage.java b/pf4j/src/main/java/ro/fortsoft/pf4j/processor/ServiceProviderExtensionStorage.java index 8fb6b35..054dcdd 100644 --- a/pf4j/src/main/java/ro/fortsoft/pf4j/processor/ServiceProviderExtensionStorage.java +++ b/pf4j/src/main/java/ro/fortsoft/pf4j/processor/ServiceProviderExtensionStorage.java @@ -15,6 +15,7 @@ */ package ro.fortsoft.pf4j.processor; +import javax.annotation.processing.FilerException; import javax.tools.FileObject; import javax.tools.StandardLocation; import java.io.BufferedReader; @@ -70,6 +71,8 @@ public class ServiceProviderExtensionStorage extends ExtensionStorage { extensions.put(extensionPoint, entries); } catch (FileNotFoundException e) { // doesn't exist, ignore + } catch (FilerException e) { + // re-opening the file for reading or after writing is ignorable } catch (IOException e) { error(e.getMessage()); } @@ -100,6 +103,8 @@ public class ServiceProviderExtensionStorage extends ExtensionStorage { writer.close(); } catch (FileNotFoundException e) { // it's the first time, create the file + } catch (FilerException e) { + // re-opening the file for reading or after writing is ignorable } catch (IOException e) { error(e.toString()); } |