question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

IllegalArgumentException thrown from afterPropertiesSet where IllegalStateException would be more appropriate

See original GitHub issue

Iwein Fuld opened BATCH-1337 and commented

public void afterPropertiesSet() throws Exception {
		Assert.notNull(lineMapper, "LineMapper is required");
	}

Should use Assert.state instead imo.


Affects: 2.0.1

Issue Analytics

  • State:closed
  • Created 14 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
danilopiazzacommented, Feb 7, 2022

Hi, I opened PR #4055 to address this issue.

0reactions
spring-projects-issuescommented, Dec 16, 2019

Mahmoud Ben Hassine commented

@Iwein Fuld I also agree. However, there are some places in the code base that use Assert.state (like AbstractJob and AbstractStep) while other places use Assert.notNull as you mentioned. It would be great to make this consistent across the whole code base and not only for the FlatFileItemReader. Feel free to open a PR if you want, contributions are welcome!

Read more comments on GitHub >

github_iconTop Results From Across the Web

java - Right exception to throw for the lack of a system property
IllegalArgumentException - Thrown to indicate that a method has been passed an illegal or inappropriate argument.
Read more >
When do IllegalStateException and IllegalArgumentException ...
This exception is thrown when you call a method at illegal or inappropriate time an IlleagalStateException is generated. For example, the remove ...
Read more >
How to Throw IllegalArgumentException in Java - Rollbar
The IllegalArgumentException is thrown to indicate an illegal or unsuitable argument passed to a method. Learn how to solve it.
Read more >
JndiObjectFactoryBean.setJndiName - Java - Tabnine
Thrown when trying to retrieve an element past the end of an Enumeration or Iterator. TreeMap (java.util). Walk the nodes of the tree...
Read more >
Setter injection versus constructor injection and the use of ...
I'd like to begin with reviewing constructor injection. ... (collaborator == null) { throw new IllegalArgumentException("Collaborator cannot ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found