You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2022/03/21 14:37:01 UTC
[commons-lang] branch master updated (e5910c7 -> a9f9ba4)
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/commons-lang.git.
from e5910c7 Bump animal-sniffer-maven-plugin from 1.20 to 1.21.
new 318cc6e Sort members.
new a9f9ba4 Bump SpotBugs to the current versions of Maven Plugin and underlying tool.
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
pom.xml | 4 +-
src/changes/changes.xml | 4 +-
src/conf/spotbugs-exclude-filter.xml | 16 ++++++++
.../org/apache/commons/lang3/time/GmtTimeZone.java | 47 ++++++++++++----------
4 files changed, 46 insertions(+), 25 deletions(-)
[commons-lang] 02/02: Bump SpotBugs to the current versions of Maven Plugin and underlying tool.
Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-lang.git
commit a9f9ba4fba7f009f0714331e3f7ddc47fc99254d
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Mon Mar 21 10:36:56 2022 -0400
Bump SpotBugs to the current versions of Maven Plugin and underlying
tool.
- TODO Can any of these be done without breaking binary compatibility?
EI_EXPOSE_REP, EI_EXPOSE_REP2, MS_EXPOSE_REP,
REFLF_REFLECTION_MAY_INCREASE_ACCESSIBILITY_OF_FIELD.
- Equals and hashcode do not match up.
---
pom.xml | 4 ++--
src/changes/changes.xml | 4 ++--
src/conf/spotbugs-exclude-filter.xml | 16 ++++++++++++++++
.../java/org/apache/commons/lang3/time/GmtTimeZone.java | 13 +++++++++----
4 files changed, 29 insertions(+), 8 deletions(-)
diff --git a/pom.xml b/pom.xml
index 17d789a..a28b732 100644
--- a/pom.xml
+++ b/pom.xml
@@ -638,8 +638,8 @@
<checkstyle.version>9.3</checkstyle.version>
<checkstyle.configdir>src/site/resources/checkstyle</checkstyle.configdir>
- <spotbugs.plugin.version>4.5.0.0</spotbugs.plugin.version>
- <spotbugs.impl.version>4.2.3</spotbugs.impl.version>
+ <spotbugs.plugin.version>4.5.3.0</spotbugs.plugin.version>
+ <spotbugs.impl.version>4.6.0</spotbugs.impl.version>
<japicmp.skip>false</japicmp.skip>
<clirr.skip>true</clirr.skip>
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 22bd94b..45e5cdc 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -125,11 +125,11 @@ The <action> type attribute can be add,update,fix,remove.
<action type="add" dev="ggregory" due-to="Gary Gregory">Add FutureTasks.</action>
<action type="add" dev="ggregory" due-to="Gary Gregory">Add Memoizer(Function) and Memoizer(Function, boolean).</action>
<!-- UPDATE -->
- <action type="update" dev="ggregory" due-to="Dependabot, Gary Gregory">Bump spotbugs-maven-plugin from 4.2.0 to 4.5.0.0 #735, #808, #822, #834.</action>
+ <action type="update" dev="ggregory" due-to="Dependabot, Gary Gregory">Bump spotbugs-maven-plugin from 4.2.0 to 4.5.3.0 #735, #808, #822, #834.</action>
<action type="update" dev="ggregory" due-to="Dependabot, XenoAmess">Bump actions/cache from v2.1.4 to v2.1.7 #742, #752, #764, #833.</action>
<action type="update" dev="ggregory" due-to="Gary Gregory">Bump actions/setup-java from v1.4.3 to v2.</action>
<action type="update" dev="ggregory" due-to="Dependabot">Bump actions/checkout from 2 to 3 #859.</action>
- <action type="update" dev="ggregory" due-to="Dependabot">Bump spotbugs from 4.2.2 to 4.2.3 #744.</action>
+ <action type="update" dev="ggregory" due-to="Dependabot, Gary Gregory">Bump spotbugs from 4.2.2 to 4.6.0 #744.</action>
<action type="update" dev="ggregory" due-to="Dependabot, Gary Gregory">Bump checkstyle from 8.41 to 9.2.1 #739, #768, #787, #811, #824, #843.</action>
<action type="update" dev="ggregory" due-to="Dependabot">Bump easymock from 4.2 to 4.3 #746.</action>
<action type="update" dev="ggregory" due-to="Gary Gregory">Bump commons.jacoco.version 0.8.6 -> 0.8.7.</action>
diff --git a/src/conf/spotbugs-exclude-filter.xml b/src/conf/spotbugs-exclude-filter.xml
index 10c8e81..7cbba7a 100644
--- a/src/conf/spotbugs-exclude-filter.xml
+++ b/src/conf/spotbugs-exclude-filter.xml
@@ -23,6 +23,22 @@
-->
<FindBugsFilter>
+ <!-- TODO Can any of these be done without breaking binary compatibility? -->
+ <Match>
+ <Class name="~.*" />
+ <Or>
+ <Bug pattern="EI_EXPOSE_REP" />
+ <Bug pattern="EI_EXPOSE_REP2" />
+ <Bug pattern="MS_EXPOSE_REP" />
+ </Or>
+ </Match>
+
+ <!-- TODO Can any of these be done without breaking binary compatibility? -->
+ <Match>
+ <Class name="org.apache.commons.lang3.reflect.FieldUtils" />
+ <Bug pattern="REFLF_REFLECTION_MAY_INCREASE_ACCESSIBILITY_OF_FIELD" />
+ </Match>
+
<!-- https://github.com/spotbugs/spotbugs/issues/1504 -->
<Match>
<Class name="org.apache.commons.lang3.ArrayUtils" />
diff --git a/src/main/java/org/apache/commons/lang3/time/GmtTimeZone.java b/src/main/java/org/apache/commons/lang3/time/GmtTimeZone.java
index 12045ad..63b7b19 100644
--- a/src/main/java/org/apache/commons/lang3/time/GmtTimeZone.java
+++ b/src/main/java/org/apache/commons/lang3/time/GmtTimeZone.java
@@ -17,6 +17,7 @@
package org.apache.commons.lang3.time;
import java.util.Date;
+import java.util.Objects;
import java.util.TimeZone;
/**
@@ -59,11 +60,15 @@ class GmtTimeZone extends TimeZone {
}
@Override
- public boolean equals(final Object other) {
- if (!(other instanceof GmtTimeZone)) {
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (!(obj instanceof GmtTimeZone)) {
return false;
}
- return zoneId == ((GmtTimeZone) other).zoneId;
+ GmtTimeZone other = (GmtTimeZone) obj;
+ return offset == other.offset && Objects.equals(zoneId, other.zoneId);
}
@Override
@@ -83,7 +88,7 @@ class GmtTimeZone extends TimeZone {
@Override
public int hashCode() {
- return offset;
+ return Objects.hash(offset, zoneId);
}
@Override
[commons-lang] 01/02: Sort members.
Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-lang.git
commit 318cc6ec4d38f90d5a6d6a28d45217e41fe37cfb
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Mon Mar 21 10:18:17 2022 -0400
Sort members.
---
.../org/apache/commons/lang3/time/GmtTimeZone.java | 42 +++++++++++-----------
1 file changed, 21 insertions(+), 21 deletions(-)
diff --git a/src/main/java/org/apache/commons/lang3/time/GmtTimeZone.java b/src/main/java/org/apache/commons/lang3/time/GmtTimeZone.java
index 03a836a..12045ad 100644
--- a/src/main/java/org/apache/commons/lang3/time/GmtTimeZone.java
+++ b/src/main/java/org/apache/commons/lang3/time/GmtTimeZone.java
@@ -33,7 +33,11 @@ class GmtTimeZone extends TimeZone {
// Serializable!
static final long serialVersionUID = 1L;
+ private static StringBuilder twoDigits(final StringBuilder sb, final int n) {
+ return sb.append((char) ('0' + (n / 10))).append((char) ('0' + (n % 10)));
+ }
private final int offset;
+
private final String zoneId;
GmtTimeZone(final boolean negate, final int hours, final int minutes) {
@@ -54,18 +58,22 @@ class GmtTimeZone extends TimeZone {
// @formatter:on
}
- private static StringBuilder twoDigits(final StringBuilder sb, final int n) {
- return sb.append((char) ('0' + (n / 10))).append((char) ('0' + (n % 10)));
+ @Override
+ public boolean equals(final Object other) {
+ if (!(other instanceof GmtTimeZone)) {
+ return false;
+ }
+ return zoneId == ((GmtTimeZone) other).zoneId;
}
@Override
- public int getOffset(final int era, final int year, final int month, final int day, final int dayOfWeek, final int milliseconds) {
- return offset;
+ public String getID() {
+ return zoneId;
}
@Override
- public void setRawOffset(final int offsetMillis) {
- throw new UnsupportedOperationException();
+ public int getOffset(final int era, final int year, final int month, final int day, final int dayOfWeek, final int milliseconds) {
+ return offset;
}
@Override
@@ -74,18 +82,18 @@ class GmtTimeZone extends TimeZone {
}
@Override
- public String getID() {
- return zoneId;
+ public int hashCode() {
+ return offset;
}
@Override
- public boolean useDaylightTime() {
+ public boolean inDaylightTime(final Date date) {
return false;
}
@Override
- public boolean inDaylightTime(final Date date) {
- return false;
+ public void setRawOffset(final int offsetMillis) {
+ throw new UnsupportedOperationException();
}
@Override
@@ -94,15 +102,7 @@ class GmtTimeZone extends TimeZone {
}
@Override
- public int hashCode() {
- return offset;
- }
-
- @Override
- public boolean equals(final Object other) {
- if (!(other instanceof GmtTimeZone)) {
- return false;
- }
- return zoneId == ((GmtTimeZone) other).zoneId;
+ public boolean useDaylightTime() {
+ return false;
}
}