Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2017-07-05 11:40:50 +0000
committerAlexander Kurtakov2017-07-05 11:43:07 +0000
commit25a924b8f6a02aebf1e560f61f1640af50b53fb3 (patch)
treec2cf3f3891005e49cb74512391e18f07032c49d1 /bundles/org.eclipse.osgi/supplement
parentc85cb5f21d55784f3e9cbb7e195020338598f4f0 (diff)
downloadrt.equinox.framework-25a924b8f6a02aebf1e560f61f1640af50b53fb3.tar.gz
rt.equinox.framework-25a924b8f6a02aebf1e560f61f1640af50b53fb3.tar.xz
rt.equinox.framework-25a924b8f6a02aebf1e560f61f1640af50b53fb3.zip
Faster and less error prone code. Change-Id: Ia49c46c212d92a144405fdc2635347d2c3eb49b9 Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
Diffstat (limited to 'bundles/org.eclipse.osgi/supplement')
-rw-r--r--bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/internal/reliablefile/ReliableFile.java10
1 files changed, 3 insertions, 7 deletions
diff --git a/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/internal/reliablefile/ReliableFile.java b/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/internal/reliablefile/ReliableFile.java
index 6fd13b2e4..b8faeb4a3 100644
--- a/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/internal/reliablefile/ReliableFile.java
+++ b/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/internal/reliablefile/ReliableFile.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2016 IBM Corporation and others.
+ * Copyright (c) 2003, 2017 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -12,6 +12,7 @@
package org.eclipse.osgi.framework.internal.reliablefile;
import java.io.*;
+import java.nio.charset.StandardCharsets;
import java.util.*;
import java.util.zip.CRC32;
import java.util.zip.Checksum;
@@ -822,12 +823,7 @@ public class ReliableFile {
crc.update(data, 0, 16); // update crc w/ sig bytes
return FILETYPE_NOSIGNATURE;
}
- long crccmp;
- try {
- crccmp = Long.valueOf(new String(data, 4, 8, "UTF-8"), 16).longValue(); //$NON-NLS-1$
- } catch (UnsupportedEncodingException e) {
- crccmp = Long.valueOf(new String(data, 4, 8), 16).longValue();
- }
+ long crccmp = Long.valueOf(new String(data, 4, 8, StandardCharsets.UTF_8), 16).longValue();
if (crccmp == crc.getValue()) {
return FILETYPE_VALID;
}

Back to the top