Skip to content

[WIP] Move to Java 11 as the minimum version to anticipate Lucene #3098

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 9 additions & 18 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,7 @@ addons:
jobs:
include:
- stage: test
name: Linux + OpenJDK 8
os: linux
dist: xenial
sudo: required
jdk: openjdk8
install: true
script: dev/main
before_install: dev/before_install
before_script: dev/before
- stage: test
name: Linux + Oracle JDK 11
name: Linux + OpenJDK 11
os: linux
dist: xenial
sudo: required
Expand All @@ -42,26 +32,27 @@ jobs:
before_install: dev/before_install
before_script: dev/before
- stage: test
name: macOS + Oracle JDK 8
name: macOS + Oracle JDK 11
os: osx
osx_image: xcode8.3
osx_image: xcode10.1
jdk: oraclejdk11
install: true
script: dev/main
before_install: dev/before_install
before_script: dev/before
- stage: test
name: Windows + Open JDK 8
name: Windows + Open JDK 11
# Use shell until Travis supports Java on Windows proper.
language: shell
os: windows
install: true
script: dev/main
before_install: dev/before_install.windows openjdk8
before_install: dev/before_install.windows openjdk11
before_script: dev/before
- stage: deploy
name: Github Release
dist: xenial
jdk: openjdk8
jdk: openjdk11
if: repo = "oracle/opengrok" AND tag IS present
before_install: dev/before_install
install: true
Expand All @@ -79,7 +70,7 @@ jobs:
- stage: docker
name: Docker image build
dist: xenial
jdk: openjdk8
jdk: openjdk11
install: true
services:
- docker
Expand All @@ -89,7 +80,7 @@ jobs:
name: Upload javadocs to Github pages
os: linux
dist: xenial
jdk: openjdk8
jdk: openjdk11
script: dev/javadoc.sh
install: true
if: repo = "oracle/opengrok" AND tag IS NOT present
2 changes: 1 addition & 1 deletion dev/main
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ fi

if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then
JAVA_BASE="/c/Program Files/OpenJDK"
JDK_DIR=$(find "$JAVA_BASE/" -type d -name 'openjdk*' -maxdepth 1 | head -1)
JDK_DIR=$(find "$JAVA_BASE/" -type d -name '*jdk*' -maxdepth 1 | head -1)
export JAVA_HOME=${JAVA_HOME:-$JDK_DIR}
echo "JAVA_HOME set to $JAVA_HOME"
export PATH=${JAVA_HOME}/bin:${PATH}
Expand Down
30 changes: 4 additions & 26 deletions opengrok-indexer/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -385,38 +385,16 @@ Portions Copyright (c) 2020-2020, Lubos Kosco <tarzanek@gmail.com>.
<!-- Test helper class with name that confuses surefire -->
<exclude>**/TestRepository.java</exclude>
</excludes>
<argLine>@{surefireArgLine}</argLine>
<argLine>
@{surefireArgLine}
--illegal-access=permit
</argLine>
</configuration>
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>java9plus</id>
<activation>
<jdk>[9,18]</jdk>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<excludes>
<!-- Test helper class with name that confuses surefire -->
<exclude>**/TestRepository.java</exclude>
</excludes>
<argLine>
@{surefireArgLine}
--illegal-access=permit
</argLine>
</configuration>
</plugin>
</plugins>
</build>
</profile>

<profile>
<id>Windows environment</id>
<activation>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class PascalUtils {
* ¹Correctness in a long sequence of apostrophes is limited because Java
* look-behind is not variable length but instead must have a definite
* upper bound in the regex definition.
* </p>
*
*/
public static final Pattern CHARLITERAL_APOS_DELIMITER =
Pattern.compile("\\'((?<=^.(?!\\'))|(?<=[^\\'].(?!\\'))|(?<=^(\\'\\'){1,3}.(?!\\'))|(?<=[^\\'](\\'\\'){1,3}.(?!\\')))");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,18 +268,18 @@ public void addPlugin(AuthorizationStack stack, IAuthorizationPlugin plugin) {

/**
* Add a plug-in into the plug-in array.
*
* <h3>Configured plugin</h3>
* For plug-in that has an entry in configuration, the new plug-in is put
* <p>
* <p>Configured plugin:
* <p>For plug-in that has an entry in configuration, the new plug-in is put
* in the place respecting the user-defined order of execution.
*
* <h3>New plugin</h3>
* If there is no entry in configuration for this class, the plugin is
* <p>
* <p>New plugin:
* <p>If there is no entry in configuration for this class, the plugin is
* appended to the end of the plugin stack with flag <code>flag</code>
*
* <p><b>The plug-in's load method is NOT invoked at this point</b></p>
* <p>
* This has the same effect as invoking
* <p><b>The plug-in's load method is NOT invoked at this point</b>
* <p>
* <p>This has the same effect as invoking
* {@code addPlugin(new AuthorizationEntity(stack, flag,
* getClassName(plugin), plugin)}.
*
Expand Down Expand Up @@ -358,17 +358,14 @@ protected void beforeReload() {

/**
* Calling this function forces the framework to reload its stack.
*
* <p>
* Plugins are taken from the pluginDirectory.</p>
*
* <p>Plugins are taken from the pluginDirectory.
* <p>
* Old instances in stack are removed and new list of stack is constructed.
* Unload and load event is fired on each plugin.</p>
*
* <p>Old instances in stack are removed and new list of stack is constructed.
* Unload and load event is fired on each plugin.
* <p>
* This method is thread safe with respect to the currently running
* authorization checks.</p>
* <p>This method is thread safe with respect to the currently running
* authorization checks.
*
* @see IAuthorizationPlugin#load(java.util.Map)
* @see IAuthorizationPlugin#unload()
Expand Down Expand Up @@ -453,43 +450,40 @@ private boolean isSessionInvalid(HttpSession session) {
/**
* Checks if the request should have an access to a resource. This method is
* thread safe with respect to the concurrent reload of plugins.
*
* <p>
* Internally performed with a predicate. Using cache in request
* attributes.</p>
*
* <h3>Order of plugin invocation</h3>
*
* <p>Internally performed with a predicate. Using cache in request
* attributes.
* <p>
* <p>Order of plugin invocation:
* <p>
* The order of plugin invocation is given by the stack and appropriate
* actions are taken when traversing the stack with set of keywords,
* such as:</p>
*
* <h4>required</h4>
* such as:
* <p>
* <p>required:
* Failure of such a plugin will ultimately lead to the authorization
* framework returning failure but only after the remaining plugins have
* been invoked.
*
* <h4>requisite</h4>
* <p>
* <p>requisite:
* Like required, however, in the case that such a plugin returns a failure,
* control is directly returned to the application. The return value is that
* associated with the first required or requisite plugin to fail.
*
* <h4>sufficient</h4>
* If such a plugin succeeds and no prior required plugin has failed the
* <p>
* <p>sufficient
* <p>If such a plugin succeeds and no prior required plugin has failed the
* authorization framework returns success to the application immediately
* without calling any further plugins in the stack. A failure of a
* sufficient plugin is ignored and processing of the plugin list continues
* unaffected.
*
* <p>
* <p>
* Loaded plugins which do not occur in the configuration are appended to
* the list with "required" keyword. As of the nature of the class discovery
* this means that the order of invocation of these plugins is rather
* random.</p>
*
* random.
* <p>
* Plugins in the configuration which have not been loaded are skipped.</p>
* <p>Plugins in the configuration which have not been loaded are skipped.
*
* @param request request object
* @param cache cache
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,11 @@ public AuthorizationPlugin(AuthControlFlag flag, String name, IAuthorizationPlug
* Call the load method on the underlying plugin if the plugin exists. Note
* that the load method can throw any throwable from its body and it should
* not stop the application.
*
* <p>
* If the method is unable to load the plugin because of any reason (mostly
* <p>If the method is unable to load the plugin because of any reason (mostly
* the class is not found, not instantiable or the load method throws an
* exception) then any authorization check should fail for this plugin in
* the future.
* </p>
*
* @param parameters parameters given in the configuration
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,10 @@ public void remove(AuthorizationEntity s) {

/**
* Load all authorization entities in this stack.
*
* <p>
* If the method is unable to load any of the entities contained in this
* <p>If the method is unable to load any of the entities contained in this
* stack then this stack is marked as failed. Note that it does not affect
* the authorization decision made by this stack.
* </p>
*
* @param parameters parameters given in the configuration
*
Expand Down Expand Up @@ -286,13 +284,11 @@ protected boolean processStack(Nameable entity,
* Set the plugin to all classes in this stack which requires this class in
* the configuration. This creates a new instance of the plugin for each
* class which needs it.
*
* <p>
* This is where the loaded plugin classes get to be a part of the
* <p>This is where the loaded plugin classes get to be a part of the
* authorization process. When the {@link AuthorizationPlugin} does not get
* its {@link IAuthorizationPlugin} it is marked as failed and returns false
* to all authorization decisions.
* </p>
*
* @param plugin the new instance of a plugin
* @return true if there is such case; false otherwise
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,9 @@ public PluginType handleLoadClass(String classname) {
/**
* Load a class into JVM with custom class loader. Call a non-parametric
* constructor to create a new instance of that class.
*
* <p>
* The classes implementing/extending the {@code PluginType} type are
* <p>The classes implementing/extending the {@code PluginType} type are
* returned and initialized with a call to a non-parametric constructor.
* </p>
*
* @param classname the full name of the class to load
* @return the class implementing/extending the {@code PluginType} class
Expand Down Expand Up @@ -345,9 +343,8 @@ private String getClassName(JarEntry f) {

/**
* Calling this function forces the framework to reload the plugins.
*
* <p>
* Plugins are taken from the pluginDirectory.</p>
* <p>Plugins are taken from the pluginDirectory.
*/
public final void reload() {
if (pluginDirectory == null || !pluginDirectory.isDirectory() || !pluginDirectory.canRead()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,12 @@ public String getRepoCommand() {
/**
* <p>
* Get the history after a specified revision.
* </p>
*
* <p>
* The default implementation first fetches the full history and then throws
* <p>The default implementation first fetches the full history and then throws
* away the oldest revisions. This is not efficient, so subclasses should
* override it in order to get good performance. Once every subclass has
* implemented a more efficient method, the default implementation should be
* removed and made abstract.
* </p>
*
* @param file the file to get the history for
* @param sinceRevision the revision right before the first one to return,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,11 +272,9 @@ public void bug16883() throws Exception {
}

/**
* <p>
* Test the handling of #include in C and C++. In particular, these issues
* are tested:
* </p>
*
* <p>
* <ul>
*
* <li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,15 @@
import static org.opengrok.indexer.util.RandomString.generate;

/**
* <p>
* An dummy implementation of {@code HttpServletRequest} in which most methods
* simply throw an exception. Unit tests that need an instance of
* {@code HttpServletRequest} can create sub-classes that implement those
* methods needed by the test case.
* </p>
*
* <p>
* Some methods that would have similar implementations in all sub-classes,
* <p>Some methods that would have similar implementations in all sub-classes,
* like set/get pairs, could be implemented here. Methods that would require
* different implementations depending on the test, should rather just throw
* an exception and let the tests override them.
* </p>
*/
public class DummyHttpServletRequest implements HttpServletRequest {

Expand Down
Loading