Browse Source

Resolve #200

pull/205/head
Decebal Suiu 7 years ago
parent
commit
235896b5c1
  1. 5
      pf4j/src/main/java/org/pf4j/processor/LegacyExtensionStorage.java
  2. 3
      pf4j/src/main/java/org/pf4j/processor/ServiceProviderExtensionStorage.java

5
pf4j/src/main/java/org/pf4j/processor/LegacyExtensionStorage.java

@ -23,6 +23,7 @@ import java.io.BufferedWriter;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.Reader;
import java.nio.file.NoSuchFileException;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
@ -68,8 +69,8 @@ public class LegacyExtensionStorage extends ExtensionStorage {
Set<String> entries = new HashSet<>();
read(file.openReader(true), entries);
extensions.put(null, entries);
} catch (FileNotFoundException e) {
// ignore
} catch (FileNotFoundException | NoSuchFileException e) {
// doesn't exist, ignore
} catch (FilerException e) {
// re-opening the file for reading or after writing is ignorable
} catch (IOException e) {

3
pf4j/src/main/java/org/pf4j/processor/ServiceProviderExtensionStorage.java

@ -23,6 +23,7 @@ import java.io.BufferedWriter;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.Reader;
import java.nio.file.NoSuchFileException;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
@ -69,7 +70,7 @@ public class ServiceProviderExtensionStorage extends ExtensionStorage {
Set<String> entries = new HashSet<>();
read(file.openReader(true), entries);
extensions.put(extensionPoint, entries);
} catch (FileNotFoundException e) {
} catch (FileNotFoundException | NoSuchFileException e) {
// doesn't exist, ignore
} catch (FilerException e) {
// re-opening the file for reading or after writing is ignorable

Loading…
Cancel
Save