You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by dk...@apache.org on 2019/05/28 20:27:31 UTC
[sling-org-apache-sling-file-optimization] branch master updated:
Updating Commons Lang 3
This is an automated email from the ASF dual-hosted git repository.
dklco pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-file-optimization.git
The following commit(s) were added to refs/heads/master by this push:
new 9b3d431 Updating Commons Lang 3
new 2aa08a9 Merge branch 'master' of github.com:apache/sling-org-apache-sling-file-optimization
9b3d431 is described below
commit 9b3d431d67d1dbe621cc5ddb848d77f0b4587128
Author: Dan Klco <dk...@apache.org>
AuthorDate: Tue May 28 15:27:07 2019 -0500
Updating Commons Lang 3
---
pom.xml | 25 ++++++++++------------
.../fileoptim/impl/FileOptimizerServiceImpl.java | 6 +++---
2 files changed, 14 insertions(+), 17 deletions(-)
diff --git a/pom.xml b/pom.xml
index 5031824..08c7103 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,15 +1,12 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
-<!-- 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. -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<!-- 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. -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
+>
<modelVersion>4.0.0</modelVersion>
<parent>
@@ -153,9 +150,9 @@
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
- <groupId>commons-lang</groupId>
- <artifactId>commons-lang</artifactId>
- <version>2.4</version>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
+ <version>3.4</version>
<scope>provided</scope>
</dependency>
<dependency>
diff --git a/src/main/java/org/apache/sling/fileoptim/impl/FileOptimizerServiceImpl.java b/src/main/java/org/apache/sling/fileoptim/impl/FileOptimizerServiceImpl.java
index 3ffacee..29cc593 100644
--- a/src/main/java/org/apache/sling/fileoptim/impl/FileOptimizerServiceImpl.java
+++ b/src/main/java/org/apache/sling/fileoptim/impl/FileOptimizerServiceImpl.java
@@ -29,12 +29,12 @@ import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
+import java.util.Objects;
import java.util.Set;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.io.IOUtils;
-import org.apache.commons.lang.ObjectUtils;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
import org.apache.jackrabbit.JcrConstants;
import org.apache.sling.api.resource.ModifiableValueMap;
import org.apache.sling.api.resource.Resource;
@@ -207,7 +207,7 @@ public class FileOptimizerServiceImpl implements FileOptimizerService, ServiceLi
try {
String calculatedHash = calculateHash(IOUtils.toByteArray(of.getContent()));
log.debug("Comparing stored {} and calculated {} hashes", of.getHash(), calculatedHash);
- return ObjectUtils.equals(of.getHash(), calculatedHash);
+ return Objects.equals(of.getHash(), calculatedHash);
} catch (IOException e) {
log.error("Exception checking if file optimized, assuming false", e);
return false;