New Upstream Snapshot - libjuniversalchardet-java

Ready changes

Summary

Merged new upstream version: 2.4.0+git20221115.1.335e8da (was: 2.4.0).

Resulting package

Built on 2022-12-20T07:45 (took 6m30s)

The resulting binary packages can be installed (if you have the apt repository enabled) by running one of:

apt install -t fresh-snapshots libjuniversalchardet-java

Lintian Result

Diff

diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
deleted file mode 100644
index e4e1a83..0000000
--- a/.github/workflows/codeql-analysis.yml
+++ /dev/null
@@ -1,71 +0,0 @@
-# For most projects, this workflow file will not need changing; you simply need
-# to commit it to your repository.
-#
-# You may wish to alter this file to override the set of languages analyzed,
-# or to provide custom queries or build logic.
-name: "CodeQL"
-
-on:
-  push:
-    branches: [master]
-  pull_request:
-    # The branches below must be a subset of the branches above
-    branches: [master]
-  schedule:
-    - cron: '0 13 * * 0'
-
-jobs:
-  analyze:
-    name: Analyze
-    runs-on: ubuntu-latest
-
-    strategy:
-      fail-fast: false
-      matrix:
-        # Override automatic language detection by changing the below list
-        # Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
-        language: ['java']
-        # Learn more...
-        # https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection
-
-    steps:
-    - name: Checkout repository
-      uses: actions/checkout@v2
-      with:
-        # We must fetch at least the immediate parents so that if this is
-        # a pull request then we can checkout the head.
-        fetch-depth: 2
-
-    # If this run was triggered by a pull request event, then checkout
-    # the head of the pull request instead of the merge commit.
-    - run: git checkout HEAD^2
-      if: ${{ github.event_name == 'pull_request' }}
-
-    # Initializes the CodeQL tools for scanning.
-    - name: Initialize CodeQL
-      uses: github/codeql-action/init@v1
-      with:
-        languages: ${{ matrix.language }}
-        # If you wish to specify custom queries, you can do so here or in a config file.
-        # By default, queries listed here will override any specified in a config file. 
-        # Prefix the list here with "+" to use these queries and those in the config file.
-        # queries: ./path/to/local/query, your-org/your-repo/queries@main
-
-    # Autobuild attempts to build any compiled languages  (C/C++, C#, or Java).
-    # If this step fails, then you should remove it and run the build manually (see below)
-    - name: Autobuild
-      uses: github/codeql-action/autobuild@v1
-
-    # ℹ️ Command-line programs to run using the OS shell.
-    # 📚 https://git.io/JvXDl
-
-    # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
-    #    and modify them (or add more) to build your code if your project
-    #    uses a compiled language
-
-    #- run: |
-    #   make bootstrap
-    #   make release
-
-    - name: Perform CodeQL Analysis
-      uses: github/codeql-action/analyze@v1
diff --git a/.gitignore b/.gitignore
deleted file mode 100644
index e9670ac..0000000
--- a/.gitignore
+++ /dev/null
@@ -1,5 +0,0 @@
-target/
-.project
-.classpath
-.settings/
-*~
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index 5d251cc..0000000
--- a/.travis.yml
+++ /dev/null
@@ -1,12 +0,0 @@
-language: java
-
-dist: trusty
-
-install: mvn install -DskipTests=true -Dgpg.skip=true -Dmaven.javadoc.skip=true
-
-jdk:
-  - openjdk7
-  - openjdk8
-  - openjdk9
-  - openjdk10
-  - openjdk11
diff --git a/debian/changelog b/debian/changelog
index 3092f5c..a609d9e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+libjuniversalchardet-java (2.4.0+git20221115.1.335e8da-1) UNRELEASED; urgency=low
+
+  * New upstream snapshot.
+
+ -- Debian Janitor <janitor@jelmer.uk>  Tue, 20 Dec 2022 07:41:45 -0000
+
 libjuniversalchardet-java (2.4.0-3) unstable; urgency=medium
 
   * Team upload
diff --git a/pom.xml b/pom.xml
index 0a092c0..c8fa858 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,7 +4,7 @@
 	<modelVersion>4.0.0</modelVersion>
 	<groupId>com.github.albfernandez</groupId>
 	<artifactId>juniversalchardet</artifactId>
-	<version>2.4.0</version>
+	<version>2.5.0-SNAPSHOT</version>
 	<url>https://github.com/albfernandez/juniversalchardet</url>
 	<packaging>jar</packaging>
 	<name>juniversalchardet</name>
@@ -48,7 +48,7 @@
 		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
 		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
 
-		<version.spotbugs-maven-plugin>4.1.4</version.spotbugs-maven-plugin>
+		<version.spotbugs-maven-plugin>4.4.2.2</version.spotbugs-maven-plugin>
 		<version.findsecbugs-plugin>1.11.0</version.findsecbugs-plugin>
 		<version.sb-contrib>7.4.7</version.sb-contrib>
 	</properties>
@@ -153,9 +153,9 @@
 
 	<profiles>
 		<profile>
-			<id>jdk7on</id>
+			<id>jdk7</id>
 			<activation>
-				<jdk>(,1.8]</jdk>
+				<jdk>(,1.7]</jdk>
 			</activation>
 			<build>
 				<plugins>
@@ -188,6 +188,60 @@
 				</plugins>
 			</build>
 		</profile>
+		<profile>
+			<id>jdk8</id>
+			<activation>
+				<jdk>1.8</jdk>
+			</activation>
+			<build>
+				<plugins>
+					<plugin>
+						<groupId>org.apache.maven.plugins</groupId>
+						<artifactId>maven-compiler-plugin</artifactId>
+						<version>3.7.0</version>
+						<configuration>
+							<excludes>
+								<exclude>module-info.java</exclude>
+							</excludes>
+							<source>${compiler.level}</source>
+							<target>${compiler.level}</target>
+						</configuration>
+					</plugin>
+					<plugin>
+						<groupId>com.github.spotbugs</groupId>
+						<artifactId>spotbugs-maven-plugin</artifactId>
+						<version>${version.spotbugs-maven-plugin}</version>
+						<configuration>
+							<effort>Max</effort>
+							<threshold>Medium</threshold>
+							<includeTests>false</includeTests>
+							<failOnError>false</failOnError>
+							<plugins>
+								<plugin>
+									<groupId>com.h3xstream.findsecbugs</groupId>
+									<artifactId>findsecbugs-plugin</artifactId>
+									<version>${version.findsecbugs-plugin}</version>
+								</plugin>
+								<plugin>
+									<groupId>com.mebigfatguy.sb-contrib</groupId>
+									<artifactId>sb-contrib</artifactId>
+									<version>${version.sb-contrib}</version>
+								</plugin>
+							</plugins>
+						</configuration>
+						<executions>
+							<execution>
+								<id>spotbugs-check</id>
+								<phase>verify</phase>
+								<goals>
+									<goal>check</goal>
+								</goals>
+							</execution>
+						</executions>
+					</plugin>
+				</plugins>
+			</build>
+		</profile>
 		<profile>
 			<id>jdk9on</id>
 			<activation>
diff --git a/src/main/java/org/mozilla/universalchardet/Constants.java b/src/main/java/org/mozilla/universalchardet/Constants.java
index ec57af7..03ebf63 100644
--- a/src/main/java/org/mozilla/universalchardet/Constants.java
+++ b/src/main/java/org/mozilla/universalchardet/Constants.java
@@ -56,7 +56,15 @@ public final class Constants {
     public static final String CHARSET_UTF_32BE     = "UTF-32BE".intern();
     public static final String CHARSET_UTF_32LE     = "UTF-32LE".intern();
     public static final String CHARSET_TIS620       = "TIS620".intern();
+    
+    /**
+     * @deprecated Mispelled, you shoud use {@link #CHARSET_US_ASCII}
+     */
+    @Deprecated
     public static final String CHARSET_US_ASCCI     = "US-ASCII".intern();
+    public static final String CHARSET_US_ASCII     = "US-ASCII".intern();
+    
+    public static final String CHARSET_GBK          = "GBK".intern();
     
     
     // WARNING: Listed below are charsets which Java does not support.
diff --git a/src/main/java/org/mozilla/universalchardet/UniversalDetector.java b/src/main/java/org/mozilla/universalchardet/UniversalDetector.java
index 8df4f43..32a2f81 100644
--- a/src/main/java/org/mozilla/universalchardet/UniversalDetector.java
+++ b/src/main/java/org/mozilla/universalchardet/UniversalDetector.java
@@ -43,7 +43,7 @@
 
 package org.mozilla.universalchardet;
 
-import static org.mozilla.universalchardet.Constants.CHARSET_US_ASCCI;
+import static org.mozilla.universalchardet.Constants.CHARSET_US_ASCII;
 import static org.mozilla.universalchardet.Constants.CHARSET_UTF_16BE;
 import static org.mozilla.universalchardet.Constants.CHARSET_UTF_16LE;
 import static org.mozilla.universalchardet.Constants.CHARSET_UTF_32BE;
@@ -213,7 +213,7 @@ public class UniversalDetector {
                 this.escCharsetProber = new EscCharsetProber();
             }
             st = this.escCharsetProber.handleData(buf, offset, length);
-            if (st == CharsetProber.ProbingState.FOUND_IT) {
+            if (st == CharsetProber.ProbingState.FOUND_IT || 0.99f == this.escCharsetProber.getConfidence()) {
                 this.done = true;
                 this.detectedCharset = this.escCharsetProber.getCharSetName();
             }
@@ -313,7 +313,7 @@ public class UniversalDetector {
         } else if (this.inputState == InputState.ESC_ASCII) {
             // do nothing
         } else if (this.inputState == InputState.PURE_ASCII && this.onlyPrintableASCII) {
-        	this.detectedCharset = CHARSET_US_ASCCI;
+        	this.detectedCharset = CHARSET_US_ASCII;
         }
         else {
             // do nothing
diff --git a/src/main/java/org/mozilla/universalchardet/prober/MBCSGroupProber.java b/src/main/java/org/mozilla/universalchardet/prober/MBCSGroupProber.java
index 94ea5d6..de369a6 100644
--- a/src/main/java/org/mozilla/universalchardet/prober/MBCSGroupProber.java
+++ b/src/main/java/org/mozilla/universalchardet/prober/MBCSGroupProber.java
@@ -58,12 +58,13 @@ public class MBCSGroupProber extends CharsetProber {
 		super();
 
 
+		
+		probers.add(new GB18030Prober());
 		probers.add(new UTF8Prober());
+		probers.add(new Big5Prober());
 		probers.add(new SJISProber());
 		probers.add(new EUCJPProber());
-		probers.add(new GB18030Prober());
 		probers.add(new EUCKRProber());
-		probers.add(new Big5Prober());
 		probers.add(new EUCTWProber());
 
 		reset();
@@ -137,7 +138,7 @@ public class MBCSGroupProber extends CharsetProber {
         		continue;
         	}
         	st = prober.handleData(highbyteBuf, 0, highpos);
-        	if (st == ProbingState.FOUND_IT) {
+        	if (st == ProbingState.FOUND_IT || 0.99f == prober.getConfidence()) {
                 this.bestGuess = prober;
                 this.state = ProbingState.FOUND_IT;
                 break;
diff --git a/src/main/java/org/mozilla/universalchardet/prober/SBCSGroupProber.java b/src/main/java/org/mozilla/universalchardet/prober/SBCSGroupProber.java
index 25412d2..f79e46a 100644
--- a/src/main/java/org/mozilla/universalchardet/prober/SBCSGroupProber.java
+++ b/src/main/java/org/mozilla/universalchardet/prober/SBCSGroupProber.java
@@ -146,7 +146,7 @@ public class SBCSGroupProber extends CharsetProber {
 					continue;
 				}
 				st = prober.handleData(newbuf.array(), 0, newbuf.position());
-				if (st == ProbingState.FOUND_IT) {
+				if (st == ProbingState.FOUND_IT || 0.99f == prober.getConfidence()) {
 					this.bestGuess = prober;
 					this.state = ProbingState.FOUND_IT;
 					break;
diff --git a/src/main/java/org/mozilla/universalchardet/prober/distributionanalysis/EUCKRDistributionAnalysis.java b/src/main/java/org/mozilla/universalchardet/prober/distributionanalysis/EUCKRDistributionAnalysis.java
index 3fda373..21d0fbc 100644
--- a/src/main/java/org/mozilla/universalchardet/prober/distributionanalysis/EUCKRDistributionAnalysis.java
+++ b/src/main/java/org/mozilla/universalchardet/prober/distributionanalysis/EUCKRDistributionAnalysis.java
@@ -37,8 +37,7 @@
 
 package org.mozilla.universalchardet.prober.distributionanalysis;
 
-public class EUCKRDistributionAnalysis extends CharDistributionAnalysis
-{
+public class EUCKRDistributionAnalysis extends CharDistributionAnalysis {
     ////////////////////////////////////////////////////////////////
     // constants
     ////////////////////////////////////////////////////////////////
@@ -52,16 +51,14 @@ public class EUCKRDistributionAnalysis extends CharDistributionAnalysis
     ////////////////////////////////////////////////////////////////
     // methods
     ////////////////////////////////////////////////////////////////
-    public EUCKRDistributionAnalysis()
-    {
+	public EUCKRDistributionAnalysis() {
         super();
         this.typicalDistributionRatio = EUCKR_TYPICAL_DISTRIBUTION_RATIO;
         this.charToFreqOrder = euckrCharToFreqOrder;
     }
 
     @Override
-    protected int getOrder(final byte[] buf, int offset)
-    {
+	protected int getOrder(final byte[] buf, int offset) {
         int highbyte = buf[offset] & 0xFF;
         if (highbyte >= HIGHBYTE_BEGIN) {
             int lowbyte = buf[offset+1] & 0xFF;
diff --git a/src/main/java/org/mozilla/universalchardet/prober/sequence/CyrillicModel.java b/src/main/java/org/mozilla/universalchardet/prober/sequence/CyrillicModel.java
index 59b57b8..299c8a6 100644
--- a/src/main/java/org/mozilla/universalchardet/prober/sequence/CyrillicModel.java
+++ b/src/main/java/org/mozilla/universalchardet/prober/sequence/CyrillicModel.java
@@ -37,8 +37,7 @@
 
 package org.mozilla.universalchardet.prober.sequence;
 
-public class CyrillicModel extends SequenceModel
-{
+public class CyrillicModel extends SequenceModel {
     ////////////////////////////////////////////////////////////////
     // constants
     ////////////////////////////////////////////////////////////////
@@ -48,8 +47,7 @@ public class CyrillicModel extends SequenceModel
     ////////////////////////////////////////////////////////////////
     // methods
     ////////////////////////////////////////////////////////////////
-    public CyrillicModel(short[] charToOrderMap, String name)
-    {
+	public CyrillicModel(short[] charToOrderMap, String name) {
         super(
                 charToOrderMap,
                 russianLangModel,
diff --git a/src/main/java/org/mozilla/universalchardet/prober/statemachine/Big5SMModel.java b/src/main/java/org/mozilla/universalchardet/prober/statemachine/Big5SMModel.java
index 0cad645..48a83fb 100644
--- a/src/main/java/org/mozilla/universalchardet/prober/statemachine/Big5SMModel.java
+++ b/src/main/java/org/mozilla/universalchardet/prober/statemachine/Big5SMModel.java
@@ -54,8 +54,7 @@ public class Big5SMModel extends SMModel {
     ////////////////////////////////////////////////////////////////
     // methods
     ////////////////////////////////////////////////////////////////
-    public Big5SMModel()
-    {
+	public Big5SMModel() {
         super(
                 new PkgInt(INDEX_SHIFT_4BITS, SHIFT_MASK_4BITS, BIT_SHIFT_4BITS, UNIT_MASK_4BITS, big5ClassTable),
                 BIG5_CLASS_FACTOR,
diff --git a/src/main/java/org/mozilla/universalchardet/prober/statemachine/CodingStateMachine.java b/src/main/java/org/mozilla/universalchardet/prober/statemachine/CodingStateMachine.java
index d29a803..21bbf68 100644
--- a/src/main/java/org/mozilla/universalchardet/prober/statemachine/CodingStateMachine.java
+++ b/src/main/java/org/mozilla/universalchardet/prober/statemachine/CodingStateMachine.java
@@ -37,21 +37,18 @@
 
 package org.mozilla.universalchardet.prober.statemachine;
 
-public class CodingStateMachine
-{
+public class CodingStateMachine {
     protected SMModel    model;
     protected int        currentState;
     protected int        currentCharLen;
     protected int        currentBytePos;
     
-    public CodingStateMachine(SMModel model)
-    {
+	public CodingStateMachine(SMModel model) {
         this.model = model;
         this.currentState = SMModel.START;
     }
     
-    public int nextState(byte c)
-    {
+	public int nextState(byte c) {
         int byteCls = this.model.getClass(c);
         if (this.currentState == SMModel.START) {
             this.currentBytePos = 0;
@@ -64,18 +61,15 @@ public class CodingStateMachine
         return this.currentState;
     }
     
-    public int getCurrentCharLen()
-    {
+	public int getCurrentCharLen() {
         return this.currentCharLen;
     }
     
-    public void reset()
-    {
+	public void reset() {
         this.currentState = SMModel.START;
     }
     
-    public String getCodingStateMachine()
-    {
+	public String getCodingStateMachine() {
         return this.model.getName();
     }
 }

Debdiff

[The following lists of changes regard files as different if they have different names, permissions or owners.]

Files in second set of .debs but not in first

-rw-r--r--  root/root   /usr/share/maven-repo/com/github/albfernandez/juniversalchardet/2.5.0-SNAPSHOT/juniversalchardet-2.5.0-SNAPSHOT.pom
lrwxrwxrwx  root/root   /usr/share/java/juniversalchardet-2.5.0-SNAPSHOT.jar -> juniversalchardet.jar
lrwxrwxrwx  root/root   /usr/share/maven-repo/com/github/albfernandez/juniversalchardet/2.5.0-SNAPSHOT/juniversalchardet-2.5.0-SNAPSHOT.jar -> ../../../../../../java/juniversalchardet.jar

Files in first set of .debs but not in second

-rw-r--r--  root/root   /usr/share/maven-repo/com/github/albfernandez/juniversalchardet/2.4.0/juniversalchardet-2.4.0.pom
lrwxrwxrwx  root/root   /usr/share/java/juniversalchardet-2.4.0.jar -> juniversalchardet.jar
lrwxrwxrwx  root/root   /usr/share/maven-repo/com/github/albfernandez/juniversalchardet/2.4.0/juniversalchardet-2.4.0.jar -> ../../../../../../java/juniversalchardet.jar

No differences were encountered in the control files

More details

Full run details