diff options
| author | Thomas Watson | 2014-02-26 16:26:09 +0000 |
|---|---|---|
| committer | Thomas Watson | 2014-02-26 16:26:09 +0000 |
| commit | c9690b2a0286be262c283a3653441bcbe4f2afaa (patch) | |
| tree | 45e52580c9a08901e9cf91fb8248624fe45001c6 | |
| parent | fb14d0b71f6b4bf654797ee92778c4086af56022 (diff) | |
| download | rt.equinox.framework-c9690b2a0286be262c283a3653441bcbe4f2afaa.tar.gz rt.equinox.framework-c9690b2a0286be262c283a3653441bcbe4f2afaa.tar.xz rt.equinox.framework-c9690b2a0286be262c283a3653441bcbe4f2afaa.zip | |
Bug 429158 - When in debug mode log a message with stack trace when Location.getURL is called for a Location that is not set
- fix by using the log service to issue a debug message
| -rw-r--r-- | bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/location/BasicLocation.java | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/location/BasicLocation.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/location/BasicLocation.java index 40e79ce01..9427d947c 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/location/BasicLocation.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/location/BasicLocation.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2013 IBM Corporation and others. + * Copyright (c) 2004, 2014 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 @@ -13,7 +13,10 @@ package org.eclipse.osgi.internal.location; import java.io.File; import java.io.IOException; import java.net.URL; +import org.eclipse.osgi.framework.log.FrameworkLogEntry; import org.eclipse.osgi.internal.framework.EquinoxConfiguration; +import org.eclipse.osgi.internal.framework.EquinoxContainer; +import org.eclipse.osgi.internal.log.EquinoxLogServices; import org.eclipse.osgi.internal.messages.Msg; import org.eclipse.osgi.service.datalocation.Location; import org.eclipse.osgi.util.NLS; @@ -60,8 +63,16 @@ public class BasicLocation implements Location { } public synchronized URL getURL() { - if (location == null && defaultValue != null) + if (location == null && defaultValue != null) { + if (debug) { + EquinoxLogServices logServices = environmentInfo.getHookRegistry().getContainer().getLogServices(); + // Note that logServices can be null if we are very early in the startup. + if (logServices != null) { + logServices.log(EquinoxContainer.NAME, FrameworkLogEntry.INFO, "Called Location.getURL() when it has not been set for: \"" + property + "\"", new RuntimeException("Call stack for Location.getURL()")); //$NON-NLS-1$//$NON-NLS-2$ + } + } setURL(defaultValue, false); + } return location; } |
