forked from airlift/airline
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Once actually building with Java 11 the module-info.java files proved insufficient so these have been updated to reflect the shortcomings identified. One side effect of this is that in some modules the tests now have a separate tests package and associated module to make all the tests run properly under JPMS.
- Loading branch information
Showing
275 changed files
with
792 additions
and
713 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
airline-core/src/main/java/com/github/rvesse/airline/parser/resources/ModulePathLocator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/** | ||
* Copyright (C) 2010-16 the original author or authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package com.github.rvesse.airline.parser.resources; | ||
|
||
import java.io.IOException; | ||
import java.io.InputStream; | ||
|
||
public class ModulePathLocator implements ResourceLocator { | ||
@Override | ||
public InputStream open(String searchLocation, String filename) throws IOException { | ||
if (searchLocation == null) { | ||
return null; | ||
} | ||
|
||
// Strip off Classpath URI prefix if present | ||
if (searchLocation.startsWith(ClasspathLocator.CLASSPATH_URI_PREFIX)) { | ||
searchLocation = searchLocation.substring(ClasspathLocator.CLASSPATH_URI_PREFIX.length()); | ||
} | ||
|
||
// Strip off leading / if present | ||
// This is because when running on the Module Path the JVM translates the package name of the resource | ||
// to its associated module by simply replacing / characters with . characters. Thus, if we have a leading | ||
// slash we end up with an invalid module name like .foo.bar instead of foo.bar as was intended. And as a | ||
// result we never correctly locate resources when running on the Module Path if we didn't do this. | ||
if (searchLocation.startsWith("/")) { | ||
searchLocation = searchLocation.length() > 1 ? searchLocation.substring(1) : ""; | ||
} | ||
|
||
// Build the expected resource name | ||
StringBuilder resourceName = new StringBuilder(); | ||
resourceName.append(searchLocation); | ||
if (!searchLocation.endsWith("/") && searchLocation.length() > 0) { | ||
resourceName.append("/"); | ||
} | ||
resourceName.append(filename); | ||
|
||
// Try to open the classpath resource | ||
InputStream resourceStream = ClassLoader.getSystemResourceAsStream(resourceName.toString()); | ||
if (resourceStream != null) { | ||
return resourceStream; | ||
} | ||
|
||
// If the search location is not a package then return that directly if | ||
// it is a valid location | ||
if (!searchLocation.endsWith("/")) { | ||
InputStream locStream = ClassLoader.getSystemResourceAsStream(searchLocation); | ||
if (locStream != null) { | ||
return locStream; | ||
} | ||
} | ||
|
||
return null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
airline-core/src/main/resources/META-INF/services/com.github.rvesse.airline.ChannelFactory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
com.github.rvesse.airline.SystemChannelFactory | ||
com.github.rvesse.airline.SystemChannelFactory |
2 changes: 1 addition & 1 deletion
2
...es/META-INF/services/com.github.rvesse.airline.help.sections.factories.HelpSectionFactory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
com.github.rvesse.airline.help.sections.factories.CommonSectionsFactory | ||
com.github.rvesse.airline.help.sections.factories.CommonSectionsFactory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.