Skip to content

Commit

Permalink
Fix sonar warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
osmandin authored and Andrew Woods committed Feb 19, 2015
1 parent 7cd7cc4 commit 58874be
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
Expand Up @@ -352,7 +352,7 @@ public Response updateSparql(@ContentLocation final InputStream requestBodyStrea
return noContent().build();
} catch ( final RuntimeException ex ) {
final Throwable cause = ex.getCause();
if ( cause != null && cause instanceof PathNotFoundException) {
if (cause instanceof PathNotFoundException) {
// the sparql update referred to a repository resource that doesn't exist
throw new BadRequestException(cause.getMessage());
}
Expand Down
Expand Up @@ -129,17 +129,17 @@ protected FedoraResource doForward(final Resource resource) {
+ " that doesn't match the URI template");
} catch (final RepositoryException e) {
validatePath(session, path);
try {
if ( e instanceof PathNotFoundException ) {

if ( e instanceof PathNotFoundException ) {
try {
final Node preexistingNode = getClosestExistingAncestor(session, path);
if (TombstoneImpl.hasMixin(preexistingNode)) {
throw new TombstoneException(new TombstoneImpl(preexistingNode));
}
} catch (RepositoryException inner) {
LOGGER.debug("Error checking for parent tombstones", inner);
}
} catch (final RepositoryException inner) {
LOGGER.debug("Error checking for parent tombstones", inner);
}

throw new RepositoryRuntimeException(e);
}
}
Expand Down
Expand Up @@ -113,7 +113,7 @@ public Iterator<Triple> apply(final PropertyDefinition input) {

final Node rangeForJcrType = getRangeForJcrType(requiredType);

if (rangeForJcrType != UNMAPPED_TYPE) {
if (!rangeForJcrType.equals(UNMAPPED_TYPE)) {
LOGGER.trace("Adding RDFS:range for property: {} with required type: {} as: {}",
input.getName(), nameFromValue(requiredType), rangeForJcrType.getURI());
final Triple propertyTriple =
Expand Down
Expand Up @@ -170,6 +170,7 @@ private static final class TempFileInputStream extends FileInputStream {
*/
public TempFileInputStream(final File f) throws FileNotFoundException {
super(f);
this.f = f;
}

@Override
Expand Down

0 comments on commit 58874be

Please sign in to comment.