Skip to content

Commit

Permalink
DATACMNS-201 - Fixed critical FindBugs warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
odrotbohm committed Jul 18, 2012
1 parent 96795f2 commit d7df08f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
@@ -1,5 +1,5 @@
/*
* Copyright 2011 the original author or authors.
* Copyright 2011-2012 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -48,8 +48,10 @@ public String convert(PersistentProperty<?> source) {
* @param properties must not be {@literal null}.
*/
public DefaultPersistentPropertyPath(List<T> properties) {

Assert.notNull(properties);
Assert.isTrue(!properties.isEmpty());

this.properties = properties;
}

Expand Down Expand Up @@ -141,7 +143,8 @@ public boolean isBasePathOf(PersistentPropertyPath<T> path) {
return true;
}

/* (non-Javadoc)
/*
* (non-Javadoc)
* @see org.springframework.data.mapping.context.PersistentPropertyPath#getExtensionForBaseOf(org.springframework.data.mapping.context.PersistentPropertyPath)
*/
public PersistentPropertyPath<T> getExtensionForBaseOf(PersistentPropertyPath<T> base) {
Expand All @@ -153,8 +156,7 @@ public PersistentPropertyPath<T> getExtensionForBaseOf(PersistentPropertyPath<T>
List<T> properties = new ArrayList<T>();
Iterator<T> iterator = iterator();

for (@SuppressWarnings("unused")
T candidate : base) {
for (int i = 0; i < base.getLength(); i++) {
iterator.next();
}

Expand Down Expand Up @@ -222,6 +224,10 @@ public int hashCode() {
return properties.hashCode();
}

/*
* (non-Javadoc)
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
return toDotPath();
Expand Down
Expand Up @@ -39,7 +39,7 @@ public abstract class AbstractRepositoryPopulatorFactoryBean extends
* @param resources the resources to set
*/
public void setResources(Resource[] resources) {
this.resources = resources;
this.resources = resources.clone();
}

/*
Expand Down Expand Up @@ -72,7 +72,7 @@ protected ResourceReaderRepositoryPopulator createInstance() throws Exception {
*/
public void onApplicationEvent(ContextRefreshedEvent event) {

if (event.equals(getBeanFactory())) {
if (event.getApplicationContext().equals(getBeanFactory())) {
Repositories repositories = new Repositories(event.getApplicationContext());
populator.populate(repositories);
}
Expand Down

0 comments on commit d7df08f

Please sign in to comment.