Merge pull request #359 from DevFactory/release/Local-Variables-should-not-be-declared-and-then-immediately-returned-or-thrown-fix-1

squid:S1488 - Local Variables should not be declared and then immedia…
This commit is contained in:
Ilkka Seppälä 2016-01-30 14:42:05 +02:00
commit d24a12a9b2
4 changed files with 5 additions and 11 deletions

View File

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

View File

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

View File

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

View File

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