-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master' into feature/RAT-293_son…
…arCloud Fetch release 0.15
- Loading branch information
Showing
28 changed files
with
787 additions
and
322 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,17 +31,19 @@ jobs: | |
os: [ubuntu-latest, windows-latest] | ||
# RAT-296: disable JDK10 due to | ||
# Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target | ||
java: [8, 11, 12, 13, 14, 15] | ||
# | ||
# Java 17 disabled, because we are running into https://bugs.openjdk.java.net/browse/JDK-8270866 | ||
java: [8, 11, 12, 13, 14, 15, 16] | ||
fail-fast: false | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up JDK | ||
uses: actions/setup-java@v2.5.0 | ||
uses: actions/setup-java@v3.4.1 | ||
with: | ||
distribution: adopt | ||
java-version: ${{ matrix.java }} | ||
|
@@ -50,3 +52,8 @@ jobs: | |
- name: Build with Maven | ||
run: mvn -e -B -V clean package site | ||
|
||
# as of 20220505: Invalid workflow file | ||
# The workflow is not valid. .github/workflows/maven.yml (Line: 55, Col: 1): Unexpected value 'notifications' | ||
#notifications: | ||
# jobs: [email protected] | ||
|
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,13 +1,9 @@ | ||
language: java | ||
dist: trusty | ||
dist: focal | ||
sudo: required | ||
|
||
jobs: | ||
include: | ||
- name: "Java 8" | ||
jdk: openjdk8 | ||
script: mvn -e -B -V clean package site | ||
|
||
- name: "Java 14" | ||
jdk: openjdk14 | ||
- name: "Java 16" | ||
jdk: openjdk16 | ||
script: mvn -e -B -V clean package site |
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 |
---|---|---|
|
@@ -41,7 +41,7 @@ pipeline { | |
|
||
tools { | ||
maven 'maven_3_latest' | ||
jdk 'jdk_14_latest' | ||
jdk 'jdk_16_latest' | ||
} | ||
|
||
options { | ||
|
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
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
64 changes: 64 additions & 0 deletions
64
apache-rat-core/src/main/java/org/apache/rat/header/LineNumberReader.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,64 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one * | ||
* or more contributor license agreements. See the NOTICE file * | ||
* distributed with this work for additional information * | ||
* regarding copyright ownership. The ASF licenses this file * | ||
* to you 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 org.apache.rat.header; | ||
|
||
import java.io.IOException; | ||
import java.io.Reader; | ||
|
||
/** Replacement for {@link java.io.LineNumberReader}. This class | ||
* provides a workaround for an incompatibility in the | ||
* {@link java.io.LineNumberReader}: If the last line in a file | ||
* isn't terminated with LF, or CR, or CRLF, then that line | ||
* is counted in Java 16, and beyond, but wasn't counted before. | ||
* This implementation is compatible with the latter variant, | ||
* thus providing upwards compatibility for RAT. | ||
*/ | ||
public class LineNumberReader { | ||
private final Reader parent; | ||
private boolean previousCharWasCR = false; | ||
private int lineNumber = 0; | ||
|
||
public LineNumberReader(Reader pReader) { | ||
parent = pReader; | ||
} | ||
|
||
public int read() throws IOException { | ||
final int c = parent.read(); | ||
switch(c) { | ||
case 13: | ||
previousCharWasCR = true; | ||
++lineNumber; | ||
break; | ||
case 10: | ||
if (!previousCharWasCR) { | ||
++lineNumber; | ||
} | ||
previousCharWasCR = false; | ||
break; | ||
default: | ||
previousCharWasCR = false; | ||
break; | ||
} | ||
return c; | ||
} | ||
|
||
public int getLineNumber() { | ||
return lineNumber; | ||
} | ||
} |
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
Oops, something went wrong.