Skip to main content
0 votes
2 answers
142 views

I'm currently trying to solve the Valid Parenthesis problem on Leetcode, in Java, that goes as follows: Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if ...
pxkaa's user avatar
  • 1
1 vote
2 answers
653 views

For example I need to get 2 arrays of the same type from different sources. Both of these requests may fail but I need to show any error (given by server) when these requests are failed simultaneously....
Gargo's user avatar
  • 1,398
-1 votes
3 answers
173 views

This question just asks why the generic cast is not used. The questions about Erasure do not seem to explain this edge case. Before I start let me preface this by saying I am NOT interested in type ...
ng.newbie's user avatar
  • 3,372
-1 votes
1 answer
373 views

I made my own excpetions and I have to print the error message from the exception with a method that uses getMessage(). e.getMessage() is highlighted and it says result of Throwable.getMessage is ...
kinkkelaade's user avatar
1 vote
1 answer
44 views

Discovered a Date setter that only does the typical assignment, yet has a throws ParseException for what seems like no good reason. No Date construction is happening in the body of the setter. Just ...
candied_orange's user avatar
0 votes
2 answers
253 views

So the idea is I have a bunch of methods separated in different 'repo' classes, each one of these can arise a personalized exception (all of them created by me, extending generic Java Exception). All ...
user avatar
0 votes
1 answer
656 views

In below async Javascript function (which I use server side in Node js), I am doing a Graphql request using fetch api: import GET_DATA from './getData.gql'; const getData = async (url: string) => { ...
meez's user avatar
  • 4,928
1 vote
0 answers
33 views

I had a question about the throws keyword in the code below. In the method testLoop3() I am indicating that the IndexOutOfBoundsException may be thrown with the throws keyword. But the method testLoop(...
Brian M's user avatar
  • 11
0 votes
1 answer
65 views

Consider the following clause from JLS: 8.4.8.3. If the unerased throws clause of m1 does not contain a supertype of each exception type in the throws clause of m2 (adapted, if necessary, to the type ...
theutonium.18's user avatar
0 votes
0 answers
37 views

basically the question is in the title. I'm looking for ways to set an interface method to throw 1..N java.lang.Exception subtypes. So far I'm only able to make it work using generic type parameters ...
laj0's user avatar
  • 3
2 votes
1 answer
2k views

I need to inform in my class code that the function passed by parameter (convertorCall) can throw an exception. suspend operator fun <T> invoke( convertorCall: () -> T ): T? For example, ...
Pierre Vieira's user avatar
0 votes
0 answers
1k views

I have some consistency issue with the Optionals in Java. According to the documentation: public T orElseThrow​(Supplier<? extends X> exceptionSupplier) throws X extends Throwable If a value ...
Jurgen Rutten's user avatar
7 votes
2 answers
443 views

I just recently found out that one can use multiple @throws tags for the same exception in Javadoc. One of my students used it to document one of his methods in Connect Four: /* * ... * @throws ...
Markus Weninger's user avatar
0 votes
2 answers
112 views

I am doing a method who return an UUID of a Minecraft player from his username using the Mojang API. This method takes a String in parameter (the username of the player who we want to know the UUID). ...
Machigan's user avatar
2 votes
2 answers
3k views

My method looks like this public EP updateEP(long id, EP eP) { EE eE = eRepo.findById(id).orElseThrow(EntityNotFoundException::new); //some code } and my test method looks like ...
Uga Rimad's user avatar
  • 107

15 30 50 per page
1
2 3 4 5
17