PatternCompiler should have public modifier
See original GitHub issueAt the moment, we are trying to modularize guava on the fly before linking with jlink.
In order to use modular JAR in the future PatternCompiler must have public modifier.
Otherwise: ServiceLoader throws exception - java.util.ServiceConfigurationError: com.google.common.base.PatternCompiler: module com.google.common does not declare uses
Also, we cannot define “uses” in module-info.java for com.google.common.base.PatternCompiler:
~/com.google.common/module-info.java:27: error: PatternCompiler is not public in com.google.common.base; cannot be accessed from outside package
uses com.google.common.base.PatternCompiler;
Solution: define com.google.common.base.PatternCompiler as public, any way, split packages are not allowed in modular environment
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Should methods in a Java interface be declared with or ...
I think instead Java should enforce/require 'public' to be specified. Why? Because the absence of a modifier means 'package' access everywhere else, and...
Read more >Perl5Compiler (Jakarta-ORO 2.0.9-dev-1 API)
public final class Perl5Compiler; extends java.lang. ... methods to indicate a compiled regular expression should treat input as having multiple lines.
Read more >Controlling Access to Members of a Class - Oracle Help Center
A class may be declared with the modifier public , in which case that class is visible to all classes everywhere. If a...
Read more >Java Hierarchy Examples, org.apache.log.Hierarchy Java Examples ...
public class RegexFunction extends AbstractFunction implements Serializable { private static transient Logger log = Hierarchy.getDefaultHierarchy().
Read more >java - Can access modifiers be completely replaced with ...
You don't need to directly test private code. You test the reachable private code, as part of testing the public interface, and it's...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
And thank you for uncovering and reporting this! As you can tell, our Java 9 testing and fixes addressed only some of the issues that the module system can cause.
You could move this line https://github.com/google/guava/blob/master/guava/src/com/google/common/base/Platform.java#L80 into try block. Anyway, ServiceLoader will throw exception for package-private class in modularized environments, thus custom PatternCompiler will not work.