Skip to content

Commit

Permalink
Variable naming consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
lincolnthree committed Jan 23, 2014
1 parent 83be602 commit 268d7f3
Showing 1 changed file with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,22 +76,22 @@ public <T> ExportedInstance<T> getExportedInstance(String clazz)

@Override
@SuppressWarnings("unchecked")
public <T> ExportedInstance<T> getExportedInstance(final Class<T> requestedType)
public <T> ExportedInstance<T> getExportedInstance(final Class<T> clazz)
{
Assert.notNull(requestedType, "Requested Class type may not be null");
Assert.notNull(clazz, "Requested Class type may not be null");
Addons.waitUntilStarted(addon);

ExportedInstance<T> result = (ExportedInstance<T>) instanceCache.get(requestedType.hashCode());
ExportedInstance<T> result = (ExportedInstance<T>) instanceCache.get(clazz.hashCode());
if (result == null)
{
final Class<T> actualLoadedType;
try
{
actualLoadedType = loadAddonClass(requestedType);
actualLoadedType = loadAddonClass(clazz);
}
catch (ClassNotFoundException cnfe)
{
log.fine("Class " + requestedType.getName() + " is not present in this addon [" + addon + "]");
log.fine("Class " + clazz.getName() + " is not present in this addon [" + addon + "]");
return null;
}

Expand All @@ -112,7 +112,7 @@ public ExportedInstance<T> call() throws Exception
actualLoadedType,
actualLoadedType
);
instanceCache.put(requestedType.hashCode(), result);
instanceCache.put(clazz.hashCode(), result);
return result;
}
return null;
Expand All @@ -121,7 +121,7 @@ public ExportedInstance<T> call() throws Exception
}
catch (Exception e)
{
throw new ContainerException("Could not get service of type [" + requestedType + "] from addon [" + addon
throw new ContainerException("Could not get service of type [" + clazz + "] from addon [" + addon
+ "]", e);
}

Expand Down Expand Up @@ -183,30 +183,30 @@ public <T> Set<ExportedInstance<T>> getExportedInstances(String clazz)

@Override
@SuppressWarnings({ "unchecked", "rawtypes" })
public <T> Set<ExportedInstance<T>> getExportedInstances(Class<T> requestedType)
public <T> Set<ExportedInstance<T>> getExportedInstances(Class<T> clazz)
{
Addons.waitUntilStarted(addon);

final Class<T> requestedLoadedType;
final Class<T> actualLoadedType;
try
{
requestedLoadedType = loadAddonClass(requestedType);
actualLoadedType = loadAddonClass(clazz);
}
catch (ClassNotFoundException e)
{
log.fine("Class " + requestedType.getName() + " is not present in this addon [" + addon + "]");
log.fine("Class " + clazz.getName() + " is not present in this addon [" + addon + "]");
return Collections.emptySet();
}

Set<ExportedInstance<T>> result = (Set) instancesCache.get(requestedLoadedType.hashCode());
Set<ExportedInstance<T>> result = (Set) instancesCache.get(actualLoadedType.hashCode());

if (result == null)
{
result = new HashSet<>();
for (int i = 0; i < services.length; i++)
{
final Class<?> type = services[i];
if (requestedLoadedType.isAssignableFrom(type))
if (actualLoadedType.isAssignableFrom(type))
{
try
{
Expand All @@ -224,7 +224,7 @@ public Set<ExportedInstance<T>> call() throws Exception
addon,
manager,
(Bean<T>) bean,
requestedLoadedType,
actualLoadedType,
assignableClass
));
}
Expand All @@ -234,13 +234,13 @@ public Set<ExportedInstance<T>> call() throws Exception
}
catch (Exception e)
{
throw new ContainerException("Could not get services of type [" + requestedType + "] from addon ["
throw new ContainerException("Could not get services of type [" + clazz + "] from addon ["
+ addon
+ "]", e);
}

}
instancesCache.put(requestedLoadedType.hashCode(), (Set) result);
instancesCache.put(actualLoadedType.hashCode(), (Set) result);
}
}
return result;
Expand Down

0 comments on commit 268d7f3

Please sign in to comment.