Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
0 votes
0 answers
173 views

Find Bugs Plugin Bug type NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE

I am having following piece of code which is failing findbugs plugin: LocalSessionFactoryBean bean= createSessionFactory(dSource); if(bean!=null) reader.setSessionFactory(bean.getObject()); // this ...
user124's user avatar
  • 483
0 votes
0 answers
277 views

Spring boot+JPA static metamodel - FindBug does not work and throw errors

I use JPA static metamodel in project and my findBug stopped working. I get errors like: Error:(10, 17) java: duplicate class: domain.entity.User_ For all autogenerated classess. I found this ...
ip696's user avatar
  • 7,084
3 votes
1 answer
917 views

spring 2.0 findbugs nullable throws error even when wrapped in null check

I'm having difficulty with Findbugs complaining about springs HttpEntity.getBody(). Below you'll see I call response.getBody().length, which I understand could cause a NPE. However when I wrap it ...
Ronnie J's user avatar
5 votes
2 answers
5k views

How to fix bug found by findbugs "Method accesses list or array with constant index"

java code: p.setCode((String) fileds[1]); p.setTitle((String) fileds[2]); p.setLogo((String) fileds[3]); p.setMaxBorrowAmt((Integer) fileds[4]); p.setMinBorrowAmt((Integer) fileds[5]); fileds[] is ...
桃桃桃子's user avatar
1 vote
1 answer
1k views

Sonar violation Unchecked/unconfirmed cast from Exception while using spring ExceptionHandler

I'm using SpringFramework 4.3.2 and SonarQube v5.6.1 with FindBugs and getting the following violation: Unchecked/unconfirmed cast from Exception to java.rmi.RemoteException this is the original ...
Yuval Simhon's user avatar
  • 1,459
5 votes
2 answers
5k views

How to fix Findbugs HTTP parameter directly written to HTTP header output

I have a class RequestFilter and @Override methods doFilterInternal. And when i add Header for response, findbugs show error HTTP parameter directly written to HTTP header output. So how can i fix ...
olalani's user avatar
  • 93
2 votes
0 answers
1k views

FindBugs @NonNull and @Autowired

Like described in Set findbugs NotNull as default for all classes under a package I annotated my packages so all class fields are automatically marked as @NonNull. Now are all the @Autowired not ...
mibutec's user avatar
  • 2,987
3 votes
1 answer
937 views

Use PMD to check someObject.methodCall when someObject exists in base class

We have applications that use the Spring framework's NamedParameterJdbcTemplate to execute various JDBC statements. Most of the methods in this class are overloaded. For example, one version of ...
user944849's user avatar
  • 14.9k
9 votes
4 answers
17k views

Method may fail to clean up stream or resource on checked exception -- FindBugs

I am using Spring JDBCTemplate to access data in database and its working fine. But FindBugs is pointing me a Minor issue in my code snippet. CODE: public String createUser(final User user) { ...
Kiran's user avatar
  • 20.3k
11 votes
2 answers
1k views

Code quality rule for finding non threadsafe singleton spring implementations

Is there any Checkstyle, PMD or Findbugs rule which could find the following non threadsafe spring singleton implementation? private String helperVar; public String getValue(String value) { ...
B4dT0bi's user avatar
  • 623
0 votes
1 answer
377 views

Delegating Struts action class management to Spring raises MTIA critical voilation in Findbugs

When i use "Delegate Struts Action management to Spring" approach explained in http://www.ibm.com/developerworks/java/library/j-sr2.html#N101B7 things work fine in terms of functionality but ...
shabeer's user avatar