Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Removing whitespace change, using PropertyValueIterator
  • Loading branch information
escowles committed Jul 20, 2015
1 parent beab847 commit 701a36c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
Expand Up @@ -203,8 +203,8 @@ public Iterator<Triple> apply(final FedoraResource child) {
return Iterators.transform(values, new Function<Value, Triple>() {
@Override
public Triple apply(final Value input) {
final RDFNode membershipResource = new ValueConverter(session(),
translator()).convert(input);
final RDFNode membershipResource = new ValueConverter(session(),translator())
.convert(input);
return create(subject(), memberRelation, membershipResource.asNode());
}
});
Expand Down
Expand Up @@ -17,7 +17,6 @@

import static org.fcrepo.kernel.impl.identifiers.NodeResourceConverter.nodeConverter;
import static org.fcrepo.kernel.impl.rdf.converters.ValueConverter.nodeForValue;
import static java.util.Collections.addAll;
import static javax.jcr.PropertyType.PATH;
import static javax.jcr.PropertyType.REFERENCE;
import static javax.jcr.PropertyType.WEAKREFERENCE;
Expand All @@ -31,15 +30,13 @@
import org.fcrepo.kernel.models.FedoraResource;
import org.fcrepo.kernel.identifiers.IdentifierConverter;
import org.fcrepo.kernel.impl.rdf.impl.mappings.PropertyToTriple;
import org.fcrepo.kernel.impl.rdf.impl.mappings.PropertyValueIterator;
import javax.jcr.Node;
import javax.jcr.Property;
import javax.jcr.PropertyIterator;
import javax.jcr.RepositoryException;
import javax.jcr.Value;

import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;

/**
* Accumulate inbound references to a given resource
Expand Down Expand Up @@ -80,20 +77,11 @@ show up in getReferences()/getWeakReferences(). Instead, we should check referr
private Function<Property, Iterator<Value>> potentialProxies = new Function<Property, Iterator<Value>>() {
@Override
public Iterator<Value> apply(final Property p) {
final Set<Value> values = new HashSet<Value>();
try {
for ( final PropertyIterator it = p.getParent().getProperties(); it.hasNext(); ) {
final Property potentialProxy = it.nextProperty();
if (potentialProxy.isMultiple()) {
addAll(values, potentialProxy.getValues());
} else {
values.add(potentialProxy.getValue());
}
}
return Iterators.filter(new PropertyValueIterator(p.getParent().getProperties()), isReference);
} catch (RepositoryException ex) {
throw new RepositoryRuntimeException(ex);
}
return Iterators.filter(values.iterator(), isReference);
}
};
private Function<Value, Iterator<Triple>> triplesForValue = new Function<Value, Iterator<Triple>>() {
Expand Down

0 comments on commit 701a36c

Please sign in to comment.