Skip to main content
Stack Overflow
  1. About
  2. For Teams
Filter by
Sorted by
Tagged with
0 votes
2 answers
129 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
610 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....
-1 votes
3 answers
165 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 ...
-1 votes
1 answer
354 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 ...
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 ...
1 vote
1 answer
90 views

I have a function fun1(), which calls fun2(), which might throw an Exception : public <T> T fun1(final String abc) throws XYZException { try { fun2() } catch (final Exception e)...
0 votes
2 answers
239 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
639 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) => { ...
1 vote
0 answers
27 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
64 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 ...
0 votes
0 answers
36 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, ...
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 ...
7 votes
2 answers
429 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 ...
0 votes
2 answers
104 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). ...

15 30 50 per page
1
2 3 4 5
...
17

AltStyle によって変換されたページ (->オリジナル) /