You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2017/11/07 09:59:39 UTC
[sling-org-apache-sling-resourceresolver] 09/47: Remove unused code
This is an automated email from the ASF dual-hosted git repository.
rombert pushed a commit to annotated tag org.apache.sling.resourceresolver-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-resourceresolver.git
commit dba4068b061e5556f4785de2ef82c3df8ad9ebc6
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Thu Jul 12 09:10:14 2012 +0000
Remove unused code
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/resourceresolver@1360589 13f79535-47bb-0310-9956-ffa450edef68
---
.../impl/tree/ResourceProviderEntry.java | 31 ----------------------
1 file changed, 31 deletions(-)
diff --git a/src/main/java/org/apache/sling/resourceresolver/impl/tree/ResourceProviderEntry.java b/src/main/java/org/apache/sling/resourceresolver/impl/tree/ResourceProviderEntry.java
index f1322cd..76d9afc 100644
--- a/src/main/java/org/apache/sling/resourceresolver/impl/tree/ResourceProviderEntry.java
+++ b/src/main/java/org/apache/sling/resourceresolver/impl/tree/ResourceProviderEntry.java
@@ -59,14 +59,6 @@ public class ResourceProviderEntry implements Comparable<ResourceProviderEntry>
// below the path of this entry.
private ProviderHandler[] providers = new ProviderHandler[0];
- private long ttime = 0L;
-
- private long nmiss = 0L;
-
- private long nsynthetic = 0L;
-
- private long nreal = 0L;
-
private final FastTreeMap storageMap = new FastTreeMap();
private Collection<ResourceProviderEntry> storageMapValues = new ArrayList<ResourceProviderEntry>();
@@ -273,7 +265,6 @@ public class ResourceProviderEntry implements Comparable<ResourceProviderEntry>
try {
if (fullPath == null || fullPath.length() == 0 || fullPath.charAt(0) != '/') {
- nmiss++;
LOGGER.debug("Not absolute {} :{}", fullPath, (System.currentTimeMillis() - start));
return null; // fullpath must be absolute
}
@@ -289,7 +280,6 @@ public class ResourceProviderEntry implements Comparable<ResourceProviderEntry>
final Resource resource = rp.getResource(ctx, resourceResolver, fullPath);
if (resource != null) {
- nreal++;
LOGGER.debug("Resolved Full {} using {} from {} ", new Object[] { fullPath, rp, Arrays.toString(rps) });
return resource;
}
@@ -308,20 +298,16 @@ public class ResourceProviderEntry implements Comparable<ResourceProviderEntry>
// and there will be no resource provider at the end
if (list.size() > 0 && list.size() == elements.length) {
if (list.get(list.size() - 1).getResourceProviders().length == 0) {
- nsynthetic++;
LOGGER.debug("Resolved Synthetic {}", fullPath);
return new SyntheticResource(resourceResolver, fullPath, ResourceProvider.RESOURCE_TYPE_SYNTHETIC);
}
}
LOGGER.debug("Resource null {} ", fullPath);
- nmiss++;
return null;
} catch (final Exception ex) {
LOGGER.debug("Failed! ", ex);
return null;
- } finally {
- ttime += System.currentTimeMillis() - start;
}
}
@@ -330,7 +316,6 @@ public class ResourceProviderEntry implements Comparable<ResourceProviderEntry>
for (final ProviderHandler rp : rps) {
final Resource resource = rp.getResource(ctx, resourceResolver, fullPath);
if (resource != null) {
- nreal++;
LOGGER.debug("Resolved Base {} using {} ", fullPath, rp);
return resource;
}
@@ -382,22 +367,6 @@ public class ResourceProviderEntry implements Comparable<ResourceProviderEntry>
return e;
}
- public String getResolutionStats() {
- final long tot = nreal + nsynthetic + nmiss;
- if (tot == 0) {
- return null;
- }
- final float n = tot;
- final float t = ttime;
- final float persec = 1000 * n / t;
- final float avgtime = t / n;
-
- final String stat = "Resolved: Real(" + nreal + ") Synthetic(" + nsynthetic + ") Missing(" + nmiss + ") Total(" + tot + ") at "
- + persec + " ops/sec avg " + avgtime + " ms";
- ttime = nmiss = nsynthetic = nreal = 0L;
- return stat;
- }
-
/**
* {@inheritDoc}
*
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.