Skip to content

Commit

Permalink
In open-source Guava, completely skip trying to discover pluggable Pa…
Browse files Browse the repository at this point in the history
…tternCompiler implementations.

It's never been possible to create such implementations externally, anyway, and users are now seeing problems running the useless discovery code under the module system.

Fixes #3147

RELNOTES=`base`: Fixed the `ServiceConfigurationError` that some users encountered when using Guava as a JPMS module.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=198449885
  • Loading branch information
cpovirk authored and ronshapiro committed May 31, 2018
1 parent 73bb080 commit 8287cdf
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions guava/src/com/google/common/base/Platform.java
Expand Up @@ -16,10 +16,8 @@

import com.google.common.annotations.GwtCompatible;
import java.lang.ref.WeakReference;
import java.util.Iterator;
import java.util.Locale;
import java.util.ServiceConfigurationError;
import java.util.ServiceLoader;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.regex.Pattern;
Expand Down Expand Up @@ -77,20 +75,6 @@ static boolean usingJdkPatternCompiler() {
}

private static PatternCompiler loadPatternCompiler() {
ServiceLoader<PatternCompiler> loader = ServiceLoader.load(PatternCompiler.class);
// Returns the first PatternCompiler that loads successfully.
try {
for (Iterator<PatternCompiler> it = loader.iterator(); it.hasNext(); ) {
try {
return it.next();
} catch (ServiceConfigurationError e) {
logPatternCompilerError(e);
}
}
} catch (ServiceConfigurationError e) { // from hasNext()
logPatternCompilerError(e);
}
// Fall back to the JDK regex library.
return new JdkPatternCompiler();
}

Expand Down

0 comments on commit 8287cdf

Please sign in to comment.