From a0ae2046cbc41c7f501e50cef799a8c5019fd02a Mon Sep 17 00:00:00 2001 From: Piotrek Zygielo Date: Sat, 16 Apr 2022 22:20:24 +0200 Subject: [PATCH] Remove unused local variables --- .../hk2/classmodel/reflect/util/CommonModelRegistry.java | 2 +- .../hk2/classmodel/reflect/util/DirectoryArchive.java | 3 +-- .../sun/enterprise/module/common_impl/TracingUtilities.java | 4 +--- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/class-model/src/main/java/org/glassfish/hk2/classmodel/reflect/util/CommonModelRegistry.java b/class-model/src/main/java/org/glassfish/hk2/classmodel/reflect/util/CommonModelRegistry.java index 6b495341ba..2cf0993ba8 100755 --- a/class-model/src/main/java/org/glassfish/hk2/classmodel/reflect/util/CommonModelRegistry.java +++ b/class-model/src/main/java/org/glassfish/hk2/classmodel/reflect/util/CommonModelRegistry.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022 Contributors to Eclipse Foundation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -153,7 +154,6 @@ public URL getResource(String className) { // System.out.println("** CommonModelRegistry::getResource called for: " + className); - InputStream inputStream = null; if (pkg != null) { Bundle srcBundle = pkg.getExportingBundle(); // String resourceName = className.replace('.', '/'); diff --git a/class-model/src/main/java/org/glassfish/hk2/classmodel/reflect/util/DirectoryArchive.java b/class-model/src/main/java/org/glassfish/hk2/classmodel/reflect/util/DirectoryArchive.java index 75980d8863..f9f64f8cd4 100755 --- a/class-model/src/main/java/org/glassfish/hk2/classmodel/reflect/util/DirectoryArchive.java +++ b/class-model/src/main/java/org/glassfish/hk2/classmodel/reflect/util/DirectoryArchive.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022 Contributors to Eclipse Foundation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -75,8 +76,6 @@ private void parse(File dir, Selector selector, EntryTask task, Logger logger) t return; } - ByteBuffer buffer = ByteBuffer.allocate(52000); - for (File f : listFiles) { Entry ae = new Entry(mangle(f), f.length(), f.isDirectory()); if (!f.isDirectory()) { diff --git a/hk2-core/src/main/java/com/sun/enterprise/module/common_impl/TracingUtilities.java b/hk2-core/src/main/java/com/sun/enterprise/module/common_impl/TracingUtilities.java index 3912aacb1a..d9a27608ed 100755 --- a/hk2-core/src/main/java/com/sun/enterprise/module/common_impl/TracingUtilities.java +++ b/hk2-core/src/main/java/com/sun/enterprise/module/common_impl/TracingUtilities.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2007, 2018 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022 Contributors to Eclipse Foundation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -69,7 +70,6 @@ public static void traceState(ModulesRegistry registry, String state, long bundl w = new FileWriter(out); w.append("\n"); w.append("Module ["+ bundleId + "] " + state + " " + bundleName+"\n"); - String prefix="-"; StackTraceElement[] stack = Thread.currentThread().getStackTrace(); w.append("\n"); @@ -77,8 +77,6 @@ public static void traceState(ModulesRegistry registry, String state, long bundl w.append("Inhabitants / stack combination\n"); w.append("-----------------------------------\n"); - String currentBundleName = bundleName; - for (int i=0;i