sonar issues

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1903687 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
PJ Fanning 2022-08-25 19:09:14 +00:00
parent deffaacd0f
commit 5896c595e7
2 changed files with 7 additions and 3 deletions

View File

@ -282,7 +282,7 @@ public abstract class OPCPackage implements RelationshipSource, Closeable {
throw new IllegalArgumentException("file must not be a directory");
}
OPCPackage pack = new ZipPackage(file, access);
OPCPackage pack = new ZipPackage(file, access); //NOSONAR
try {
if (pack.partList == null && access != PackageAccess.WRITE) {
pack.getParts();

View File

@ -234,7 +234,11 @@ import org.apache.poi.util.Internal;
public boolean untrackColumns(Collection<Integer> columns)
{
untrackedColumns.addAll(columns);
return maxColumnWidths.keySet().removeAll(columns);
boolean result = false;
for (Integer col : columns) {
result = maxColumnWidths.remove(col) != null || result;
}
return result;
}
/**
@ -248,7 +252,7 @@ import org.apache.poi.util.Internal;
*/
public boolean untrackColumn(int column) {
untrackedColumns.add(column);
return maxColumnWidths.keySet().remove(column);
return maxColumnWidths.remove(column) != null;
}
/**