Skip to content

Commit

Permalink
Remove internal usage of Equinox Framework Debug class
Browse files Browse the repository at this point in the history
These trace messages are not particularly useful and
I would like to remove this general debug flag from the
framework.

If trace is needed in transforms we should have a separate
option for it.
  • Loading branch information
tjwatson committed Jan 13, 2025
1 parent 5299f50 commit 2291f9f
Showing 1 changed file with 1 addition and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import java.util.regex.Pattern;
import org.eclipse.equinox.internal.transforms.LazyInputStream.InputStreamProvider;
import org.eclipse.osgi.framework.log.FrameworkLogEntry;
import org.eclipse.osgi.internal.debug.Debug;
import org.eclipse.osgi.internal.framework.EquinoxContainer;
import org.eclipse.osgi.storage.BundleInfo.Generation;
import org.eclipse.osgi.storage.StorageUtil;
Expand All @@ -38,7 +37,6 @@ public class TransformedBundleFile extends BundleFileWrapper {
private final TransformerHook transformerHook;
private final BundleFile delegate;
private final Generation generation;
private final Debug debug;

/**
* Create a wrapped bundle file. Requests into this file will be compared to the
Expand All @@ -54,7 +52,6 @@ public TransformedBundleFile(TransformerHook transformerHook, Generation generat
this.transformerHook = transformerHook;
this.generation = generation;
this.delegate = delegate;
this.debug = generation.getBundleInfo().getStorage().getConfiguration().getDebug();
}

Generation getGeneration() {
Expand Down Expand Up @@ -148,9 +145,6 @@ public File getFile(String path, boolean nativeCode) {
File nested = getExtractFile(path);
if (nested != null) {
if (nested.exists()) {
/* the entry is already cached */
if (debug.DEBUG_GENERAL)
Debug.println("File already present: " + nested.getPath()); //$NON-NLS-1$
if (nested.isDirectory())
// must ensure the complete directory is extracted (bug
// 182585)
Expand All @@ -165,10 +159,7 @@ public File getFile(String path, boolean nativeCode) {
InputStream in = getEntry(path).getInputStream();
if (in == null)
return null;
// if (in instanceof )
/* the entry has not been cached */
if (debug.DEBUG_GENERAL)
Debug.println("Creating file: " + nested.getPath()); //$NON-NLS-1$
/* create the necessary directories */
File dir = new File(nested.getParent());
if (!dir.exists() && !dir.mkdirs()) {
Expand All @@ -185,8 +176,7 @@ public File getFile(String path, boolean nativeCode) {
return nested;
}
} catch (IOException e) {
if (debug.DEBUG_GENERAL)
Debug.printStackTrace(e);
// consider logging
}
return null;
}
Expand Down

0 comments on commit 2291f9f

Please sign in to comment.