mirror of https://github.com/apache/jclouds.git
reverted pull 446
This commit is contained in:
parent
a01ca9adc0
commit
b4619a35fd
|
@ -139,20 +139,17 @@ public class TemplateBuilderImpl implements TemplateBuilder {
|
||||||
*
|
*
|
||||||
* If the input location is null, then the data isn't location sensitive
|
* If the input location is null, then the data isn't location sensitive
|
||||||
*
|
*
|
||||||
* If the input location is a child (descendent, recursively) of the specified location, then we are ok.
|
* If the input location is a parent of the specified location, then we are ok.
|
||||||
*/
|
*/
|
||||||
final Predicate<ComputeMetadata> locationPredicate = new Predicate<ComputeMetadata>() {
|
final Predicate<ComputeMetadata> locationPredicate = new Predicate<ComputeMetadata>() {
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(ComputeMetadata input) {
|
public boolean apply(ComputeMetadata input) {
|
||||||
if (location == null) return true;
|
boolean returnVal = true;
|
||||||
Location inputLocation = input.getLocation();
|
if (location != null && input.getLocation() != null)
|
||||||
if (inputLocation == null) return true;
|
returnVal = location.equals(input.getLocation()) || location.getParent() != null
|
||||||
while (inputLocation!=null) {
|
&& location.getParent().equals(input.getLocation()) || location.getParent().getParent() != null
|
||||||
if (location.equals(inputLocation))
|
&& location.getParent().getParent().equals(input.getLocation());
|
||||||
return true;
|
return returnVal;
|
||||||
inputLocation = inputLocation.getParent();
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue