squid:S1488 - Local Variables should not be declared and then immediately returned or thrown

This commit is contained in:
Mohammed Ezzat 2016-01-27 02:45:39 +02:00
parent 1a55f3a420
commit 4e40cc3888
4 changed files with 5 additions and 11 deletions

View File

@ -72,9 +72,7 @@ public class DbManager {
return null;
}
Document doc = iterable.first();
UserAccount userAccount =
new UserAccount(userId, doc.getString("userName"), doc.getString("additionalInfo"));
return userAccount;
return new UserAccount(userId, doc.getString("userName"), doc.getString("additionalInfo"));
}
/**

View File

@ -66,7 +66,6 @@ public class Customer {
@Override
public int hashCode() {
int result = getId();
return result;
return getId();
}
}

View File

@ -204,8 +204,7 @@ public class LazyFluentIterable<TYPE> implements FluentIterable<TYPE> {
*/
@Override
public List<TYPE> asList() {
List<TYPE> copy = FluentIterable.copyToList(iterable);
return copy;
return FluentIterable.copyToList(iterable);
}
@Override

View File

@ -118,8 +118,7 @@ public class SimpleApplication extends IsisWicketApplication {
} catch (Exception e) {
System.out.println(e);
}
WebRequest request = super.newWebRequest(servletRequest, filterPath);
return request;
return super.newWebRequest(servletRequest, filterPath);
}
@Override
@ -150,8 +149,7 @@ public class SimpleApplication extends IsisWicketApplication {
List<String> readLines =
Resources.readLines(Resources.getResource(contextClass, resourceName),
Charset.defaultCharset());
final String aboutText = Joiner.on("\n").join(readLines);
return aboutText;
return Joiner.on("\n").join(readLines);
} catch (IOException e) {
return "This is a simple app";
}