question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

PatternCompiler should have public modifier

See original GitHub issue

At 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:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
cpovirkcommented, May 29, 2018

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.

1reaction
jreznotcommented, May 19, 2018

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found