All Questions
41 questions
0
votes
3
answers
198
views
Java exceptions that show the message when converted to String
I’m working with custom exceptions in Java for stack operations. However, I’m unsure if the exception handling is being handled properly, especially in terms of how exceptions are thrown and caught. ...
2
votes
1
answer
171
views
Beginner Java Tic-Tac-Toe
I had a Tic Tac Toe assignment for class and the program seems to work fine but I feel like the exception/input handling could be done in a much better way. Is this a good way to approach the ...
1
vote
3
answers
112
views
Extensible error code infrastructure
I was answering a question, Java Exception Error Enumerations Anti-pattern, on Software Engineering Stack Exchange and found myself writing up a fair bit of code. It could use a code review so I'm ...
3
votes
1
answer
963
views
Generic Scanner(System.in) Parsing
Often end up using a Scanner to grab some simple input and often when dealing with Number input it can result in a lot of little ...
4
votes
2
answers
254
views
Sanity check a simple RPG character
I'm writing an assistant for the tabletop RPG Pathfinder in Java. I intend to use the MVVM pattern using JavaFX, possibly through mvvmFX. Before I go into the V-VM phase, I have built a first ...
4
votes
2
answers
259
views
Reader for graph-file with ugly return and questionable use of streams
I wrote a class that contains a static method that reads in files from NetworkRepository and converts them into a list of integer-arrays, each representing an edge. The file format from ...
11
votes
2
answers
360
views
Self-inflicted killing utility
If you need to kill the same process that you're in (for testing purposes or whatever) this code will do it.
A definitive, quick, unmerciful dead of the current Java program/app.
Not a System.exit(0) ...
0
votes
1
answer
155
views
One try with multiple catch blocks vs nested try
I am creating program which will parse .csv file and I am using FileReader and Scanner classes from java API.
...
2
votes
1
answer
1k
views
Employee database
To keep in practice with good techniques of java programming, I've decided to write a database. All it does it stores employees, allows users that are logged in to get/set employees, and has a login ...
4
votes
2
answers
2k
views
Compiling and throwing simple dynamic exceptions at runtime for JVM
I've been using my Dynamic Exception with C# for quite some time already and it saved me a lot of time. This means, I don't have to create a new exception ...
2
votes
1
answer
84
views
0
votes
1
answer
100
views
Using a wrapper on a primitive as a generic for an interface used for Java lambda
I apologize for that title, lol.
I have a Java method that I'm writing where I want to be able to pass in an array of Objects and two interfaces that will be used for lambda expressions that specify ...
4
votes
2
answers
409
views
Automatic exception wrapper in java
There's a lot of place in my code where I need to do something like this
...
3
votes
1
answer
269
views
Custom exceptions for validating movie information
I wrote my first application about custom exceptions and catching them. Here is the GitHub link.
I Have 3 types of custom exceptions:
TimeException (validate time: hours, minutes)
MovieException (...
1
vote
1
answer
205
views
Is it a valid use case of using java.util.MissingResourceException?
I have a factory method that returns an Object based on a argument passed to it :
...