Posts by biafreire2611 • 74 points
9 posts
-
0
votes1
answer15
viewsA: I cannot create table when running my project in Flyway
Create operations in separate files, one for CREATE and another file for Inserts. Check if the names are following the conventions. Recalling that the CREATE numbering must be earlier than the…
-
0
votes2
answers782
viewsA: How to use JUNIT to test void methods of my DAO class
One should be careful with Daos tests. Unit tests should test logic. So it should have a controlled environment. The inputs and outputs of these methods must be repeatable, retentable, reliable.…
-
0
votes1
answer200
viewsA: Transfer an object within a class method to another class
To read the various entries you can follow a another thread about that. It could all be in the same class, but as you necessarily want to work with two classes you can have the first to read and the…
javaanswered biafreire2611 74 -
0
votes2
answers208
viewsA: When no file is found, you should skip to the next step (Spring Batch)
One option is to use the decision tag. For example: <batch:decision id="decision" decider="decider"> <batch:next on="FULL" to="fullStep" /> <batch:next on="FAILED" to="nextStep" />…
-
1
votes1
answer63
viewsA: Keeping the context of a List out of Thread
You can use other structures that will help you control the competitor list: Copyonwritearraylist (javadoc)(example): this solution makes a a copy of the items to be written. In this way, read…
-
-1
votes1
answer26
viewsA: @update form not working, Java EE
As vezes (que não sei explicar exatamente pq :D) o javascript do página ilita. An option would be to update the component via page bean. RequestContext.getCurrentInstance().update("id_componente");…
java-eeanswered biafreire2611 74 -
0
votes2
answers300
viewsA: Multiply value in array
A leaner way would be to use the features of Java 8. You could use Streams and its operators. int countCards(int [] cards, int BLOCK_CARD){ return IntStream.of(cards) .filter(s -> s !=…
-
2
votes5
answers3667
viewsA: Is there any downside to always capturing Exception and not something more specific?
Specifying or generalizing the exception treatment will depend a lot on what the application needs. Imagine a very large system and that the error will be displayed on the user screen. How will you…
-
0
votes2
answers70
viewsA: How to remove 1 element from the Labels vector
I agree with the previous answer where the best option would be to use a list. However, it will not be possible to simply convert using Arrays.asList directly. List<Label> list =…