[jira] [Updated] (NETBEANS-958) inexplicable "throwable method result is ignored" warning

2018-06-14 Thread Alvin Thompson (JIRA)


 [ 
https://issues.apache.org/jira/browse/NETBEANS-958?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Alvin Thompson updated NETBEANS-958:

Description: 
I have the following code:

{code:java}
public Map sendStandingOrders() {
  Map out = new LinkedHashMap<>();
  List standingOrders = getStandingOrdersThatNeedToRunNow();
  for (StandingOrderInfo standingOrderInfo : standingOrders) {
try {
  sendStandingOrder(standingOrderInfo);
  out.put(standingOrderInfo, null); // warning here
} catch (Exception ex) {
  // TODO: send emails
  logger.log(Level.SEVERE, "could not send standing order ", ex);
  out.put(standingOrderInfo, ex); // warning here
}
  }
  return out;
}
{code}

Judging from the warning description, this warning shouldn't even apply to the 
method that's returning the Throwable, but rather the code that calls the 
method. In any case, the catch clause is clearly doing something with the 
exception. If the warning is intended behavior (that I don't understand), I 
don't see how the code above rises to the level of "probable bug". Can you 
please explain?

What's even more puzzling is that this similar but simpler code works:


{code:java}
private Throwable foo() {
  try {
Thread.sleep(0);
return null;
  } catch (Exception ex) {
return ex;
  }
}
{code}


  was:
I have the following code:

{code:java}
public Map sendStandingOrders() {
  Map out = new LinkedHashMap<>();
  List standingOrders = getStandingOrdersThatNeedToRunNow();
  for (StandingOrderInfo standingOrderInfo : standingOrders) {
try {
  sendStandingOrder(standingOrderInfo);
  out.put(standingOrderInfo, null);
} catch (Exception ex) {
  // TODO: send emails
  logger.log(Level.SEVERE, "could not send standing order ", ex);
  out.put(standingOrderInfo, ex);
}
  }
  return out;
}
{code}

Judging from the warning description, this warning shouldn't even apply to the 
method that's returning the Throwable, but rather the code that calls the 
method. In any case, the catch clause is clearly doing something with the 
exception. If the warning is intended behavior (that I don't understand), I 
don't see how the code above rises to the level of "probable bug". Can you 
please explain?

What's even more puzzling is that this similar but simpler code works:


{code:java}
private Throwable foo() {
  try {
Thread.sleep(0);
return null;
  } catch (Exception ex) {
return ex;
  }
}
{code}



> inexplicable "throwable method result is ignored" warning
> -
>
> Key: NETBEANS-958
> URL: https://issues.apache.org/jira/browse/NETBEANS-958
> Project: NetBeans
>  Issue Type: Bug
>  Components: cnd - Editor
>Affects Versions: 9.0
> Environment: project JDK: 8
> IDE JDK: 10
>Reporter: Alvin Thompson
>Priority: Major
>
> I have the following code:
> {code:java}
> public Map sendStandingOrders() {
>   Map out = new LinkedHashMap<>();
>   List standingOrders = 
> getStandingOrdersThatNeedToRunNow();
>   for (StandingOrderInfo standingOrderInfo : standingOrders) {
> try {
>   sendStandingOrder(standingOrderInfo);
>   out.put(standingOrderInfo, null); // warning here
> } catch (Exception ex) {
>   // TODO: send emails
>   logger.log(Level.SEVERE, "could not send standing order ", ex);
>   out.put(standingOrderInfo, ex); // warning here
> }
>   }
>   return out;
> }
> {code}
> Judging from the warning description, this warning shouldn't even apply to 
> the method that's returning the Throwable, but rather the code that calls the 
> method. In any case, the catch clause is clearly doing something with the 
> exception. If the warning is intended behavior (that I don't understand), I 
> don't see how the code above rises to the level of "probable bug". Can you 
> please explain?
> What's even more puzzling is that this similar but simpler code works:
> {code:java}
> private Throwable foo() {
>   try {
> Thread.sleep(0);
> return null;
>   } catch (Exception ex) {
> return ex;
>   }
> }
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[jira] [Updated] (NETBEANS-958) inexplicable "throwable method result is ignored" warning

2018-06-14 Thread Alvin Thompson (JIRA)


 [ 
https://issues.apache.org/jira/browse/NETBEANS-958?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Alvin Thompson updated NETBEANS-958:

Description: 
I have the following code:

{code:java}
public Map sendStandingOrders() {
  Map out = new LinkedHashMap<>();
  List standingOrders = getStandingOrdersThatNeedToRunNow();
  for (StandingOrderInfo standingOrderInfo : standingOrders) {
try {
  sendStandingOrder(standingOrderInfo);
  out.put(standingOrderInfo, null);
} catch (Exception ex) {
  // TODO: send emails
  logger.log(Level.SEVERE, "could not send standing order ", ex);
  out.put(standingOrderInfo, ex);
}
  }
  return out;
}
{code}

Judging from the warning description, this warning shouldn't even apply to the 
method that's returning the Throwable, but rather the code that calls the 
method. In any case, the catch clause is clearly doing something with the 
exception. If the warning is intended behavior (that I don't understand), I 
don't see how the code above rises to the level of "probable bug". Can you 
please explain?

What's even more puzzling is that this similar but simpler code works:


{code:java}
private Throwable foo() {
  try {
Thread.sleep(0);
return null;
  } catch (Exception ex) {
return ex;
  }
}
{code}


  was:
I have the following code:

{code:java}
public Map sendStandingOrders() {
Map out = new LinkedHashMap<>();
List standingOrders = 
getStandingOrdersThatNeedToRunNow();
for (StandingOrderInfo standingOrderInfo : standingOrders) {
try {
sendStandingOrder(standingOrderInfo);
out.put(standingOrderInfo, null);
} catch (Exception ex) {
// TODO: send emails
logger.log(
Level.SEVERE,
"could not send standing order ",
ex
);
out.put(standingOrderInfo, ex);
}
}
return out;
}
{code}

Judging from the warning description, this warning shouldn't even apply to the 
method that's returning the Throwable, but rather the code that calls the 
method. In any case, the catch clause is clearly doing something with the 
exception. If the warning is intended behavior (that I don't understand), I 
don't see how the code above rises to the level of "probable bug". Can you 
please explain?

What's even more puzzling is that this similar but simpler code works:


{code:java}
private Throwable foo() {
  try {
Thread.sleep(0);
return null;
  } catch (Exception ex) {
return ex;
  }
}
{code}



> inexplicable "throwable method result is ignored" warning
> -
>
> Key: NETBEANS-958
> URL: https://issues.apache.org/jira/browse/NETBEANS-958
> Project: NetBeans
>  Issue Type: Bug
>  Components: cnd - Editor
>Affects Versions: 9.0
> Environment: project JDK: 8
> IDE JDK: 10
>Reporter: Alvin Thompson
>Priority: Major
>
> I have the following code:
> {code:java}
> public Map sendStandingOrders() {
>   Map out = new LinkedHashMap<>();
>   List standingOrders = 
> getStandingOrdersThatNeedToRunNow();
>   for (StandingOrderInfo standingOrderInfo : standingOrders) {
> try {
>   sendStandingOrder(standingOrderInfo);
>   out.put(standingOrderInfo, null);
> } catch (Exception ex) {
>   // TODO: send emails
>   logger.log(Level.SEVERE, "could not send standing order ", ex);
>   out.put(standingOrderInfo, ex);
> }
>   }
>   return out;
> }
> {code}
> Judging from the warning description, this warning shouldn't even apply to 
> the method that's returning the Throwable, but rather the code that calls the 
> method. In any case, the catch clause is clearly doing something with the 
> exception. If the warning is intended behavior (that I don't understand), I 
> don't see how the code above rises to the level of "probable bug". Can you 
> please explain?
> What's even more puzzling is that this similar but simpler code works:
> {code:java}
> private Throwable foo() {
>   try {
> Thread.sleep(0);
> return null;
>   } catch (Exception ex) {
> return ex;
>   }
> }
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[jira] [Updated] (NETBEANS-958) inexplicable "throwable method result is ignored" warning

2018-06-14 Thread Alvin Thompson (JIRA)


 [ 
https://issues.apache.org/jira/browse/NETBEANS-958?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Alvin Thompson updated NETBEANS-958:

Description: 
I have the following code:

{code:java}
public Map sendStandingOrders() {
Map out = new LinkedHashMap<>();
List standingOrders = 
getStandingOrdersThatNeedToRunNow();
for (StandingOrderInfo standingOrderInfo : standingOrders) {
try {
sendStandingOrder(standingOrderInfo);
out.put(standingOrderInfo, null);
} catch (Exception ex) {
// TODO: send emails
logger.log(
Level.SEVERE,
"could not send standing order ",
ex
);
out.put(standingOrderInfo, ex);
}
}
return out;
}
{code}

Judging from the warning description, this warning shouldn't even apply to the 
method that's returning the Throwable, but rather the code that calls the 
method. In any case, the catch clause is clearly doing something with the 
exception. If the warning is intended behavior (that I don't understand), I 
don't see how the code above rises to the level of "probable bug". Can you 
please explain?

What's even more puzzling is that this similar but simpler code works:


{code:java}
private Throwable foo() {
  try {
Thread.sleep(0);
return null;
  } catch (Exception ex) {
return ex;
  }
}
{code}


  was:
I have the following code:

{code:java}
public Map sendStandingOrders() {
Map out = new LinkedHashMap<>();
List standingOrders = 
getStandingOrdersThatNeedToRunNow();
for (StandingOrderInfo standingOrderInfo : standingOrders) {
try {
sendStandingOrder(standingOrderInfo);
out.put(standingOrderInfo, null);
} catch (Exception ex) {
// TODO: send emails
logger.log(
Level.SEVERE,
"could not send standing order ",
ex
);
out.put(standingOrderInfo, ex);
}
}
return out;
}
{code}

Judging from the warning description, this warning shouldn't even apply to the 
method that's returning the Throwable, but rather the code that calls the 
method. In any case, the catch clause is clearly doing something with the 
exception. If the warning is intended behavior (that I don't understand), I 
don't see how the code above rises to the level of "probable bug". Can you 
please explain?

What's even more puzzling is that this similar but simpler code works:


{code:java}
private Throwable foo() {
try {
Thread.sleep(0);
return null;
} catch (Exception ex) {
return ex;
}
}
{code}



> inexplicable "throwable method result is ignored" warning
> -
>
> Key: NETBEANS-958
> URL: https://issues.apache.org/jira/browse/NETBEANS-958
> Project: NetBeans
>  Issue Type: Bug
>  Components: cnd - Editor
>Affects Versions: 9.0
> Environment: project JDK: 8
> IDE JDK: 10
>Reporter: Alvin Thompson
>Priority: Major
>
> I have the following code:
> {code:java}
> public Map sendStandingOrders() {
>   Map out = new LinkedHashMap<>();
>   List standingOrders = 
> getStandingOrdersThatNeedToRunNow();
>   for (StandingOrderInfo standingOrderInfo : standingOrders) {
>   try {
>   sendStandingOrder(standingOrderInfo);
>   out.put(standingOrderInfo, null);
>   } catch (Exception ex) {
>   // TODO: send emails
>   logger.log(
>   Level.SEVERE,
>   "could not send standing order ",
>   ex
>   );
>   out.put(standingOrderInfo, ex);
>   }
>   }
>   return out;
> }
> {code}
> Judging from the warning description, this warning shouldn't even apply to 
> the method that's returning the Throwable, but rather the code that calls the 
> method. In any case, the catch clause is clearly doing something with the 
> exception. If the warning is intended behavior (that I don't understand), I 
> don't see how the code above rises to the level of "probable bug". Can you 
> please explain?
> What's even more puzzling is that this similar but simpler code works:
> {code:java}
> private Throwable foo() 

[jira] [Updated] (NETBEANS-958) inexplicable "throwable method result is ignored" warning

2018-06-14 Thread Alvin Thompson (JIRA)


 [ 
https://issues.apache.org/jira/browse/NETBEANS-958?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Alvin Thompson updated NETBEANS-958:

Description: 
I have the following code:

{code:java}
public Map sendStandingOrders() {
Map out = new LinkedHashMap<>();
List standingOrders = 
getStandingOrdersThatNeedToRunNow();
for (StandingOrderInfo standingOrderInfo : standingOrders) {
try {
sendStandingOrder(standingOrderInfo);
out.put(standingOrderInfo, null);
} catch (Exception ex) {
// TODO: send emails
logger.log(
Level.SEVERE,
"could not send standing order ",
ex
);
out.put(standingOrderInfo, ex);
}
}
return out;
}
{code}

Judging from the warning description, this warning shouldn't even apply to the 
method that's returning the Throwable, but rather the code that calls the 
method. In any case, the catch clause is clearly doing something with the 
exception. If the warning is intended behavior (that I don't understand), I 
don't see how the code above rises to the level of "probable bug". Can you 
please explain?

What's even more puzzling is that this similar but simpler code works:


{code:java}
private Throwable foo() {
try {
Thread.sleep(0);
return null;
} catch (Exception ex) {
return ex;
}
}
{code}


  was:
I have the following code:

{code:java}
public Map sendStandingOrders() {
Map out = new LinkedHashMap<>();
List standingOrders = 
getStandingOrdersThatNeedToRunNow();
for (StandingOrderInfo standingOrderInfo : standingOrders) {
try {
sendStandingOrder(standingOrderInfo);
out.put(standingOrderInfo, null);
} catch (Exception ex) {
// TODO: send emails
logger.log(Level.SEVERE, "could not send 
standing order ", ex);
out.put(standingOrderInfo, ex);
}
}
return out;
}
{code}

Judging from the warning description, this warning shouldn't even apply to the 
method that's returning the Throwable, but rather the code that calls the 
method. In any case, the catch clause is clearly doing something with the 
exception. If the warning is intended behavior (that I don't understand), I 
don't see how the code above rises to the level of "probable bug". Can you 
please explain?

What's even more puzzling is that this similar but simpler code works:


{code:java}
private Throwable foo() {
try {
Thread.sleep(0);
return null;
} catch (Exception ex) {
return ex;
}
}
{code}



> inexplicable "throwable method result is ignored" warning
> -
>
> Key: NETBEANS-958
> URL: https://issues.apache.org/jira/browse/NETBEANS-958
> Project: NetBeans
>  Issue Type: Bug
>  Components: cnd - Editor
>Affects Versions: 9.0
> Environment: project JDK: 8
> IDE JDK: 10
>Reporter: Alvin Thompson
>Priority: Major
>
> I have the following code:
> {code:java}
> public Map sendStandingOrders() {
>   Map out = new LinkedHashMap<>();
>   List standingOrders = 
> getStandingOrdersThatNeedToRunNow();
>   for (StandingOrderInfo standingOrderInfo : standingOrders) {
>   try {
>   sendStandingOrder(standingOrderInfo);
>   out.put(standingOrderInfo, null);
>   } catch (Exception ex) {
>   // TODO: send emails
>   logger.log(
>   Level.SEVERE,
>   "could not send standing order ",
>   ex
>   );
>   out.put(standingOrderInfo, ex);
>   }
>   }
>   return out;
> }
> {code}
> Judging from the warning description, this warning shouldn't even apply to 
> the method that's returning the Throwable, but rather the code that calls the 
> method. In any case, the catch clause is clearly doing something with the 
> exception. If the warning is intended behavior (that I don't understand), I 
> don't see how the code above rises to the level of "probable bug". Can you 
> please 

[jira] [Updated] (NETBEANS-958) inexplicable "throwable method result is ignored" warning

2018-06-14 Thread Alvin Thompson (JIRA)


 [ 
https://issues.apache.org/jira/browse/NETBEANS-958?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Alvin Thompson updated NETBEANS-958:

Description: 
I have the following code:

{code:java}
public Map sendStandingOrders() {
Map out = new LinkedHashMap<>();
List standingOrders = 
getStandingOrdersThatNeedToRunNow();
for (StandingOrderInfo standingOrderInfo : standingOrders) {
try {
sendStandingOrder(standingOrderInfo);
out.put(standingOrderInfo, null);
} catch (Exception ex) {
// TODO: send emails
logger.log(Level.SEVERE, "could not send 
standing order ", ex);
out.put(standingOrderInfo, ex);
}
}
return out;
}
{code}

Judging from the warning description, this warning shouldn't even apply to the 
method that's returning the Throwable, but rather the code that calls the 
method. In any case, the catch clause is clearly doing something with the 
exception. If the warning is intended behavior (that I don't understand), I 
don't see how the code above rises to the level of "probable bug". Can you 
please explain?

What's even more puzzling is that this similar but simpler code works:


{code:java}
private Throwable foo() {
try {
Thread.sleep(0);
return null;
} catch (Exception ex) {
return ex;
}
}
{code}


  was:
I have the following code:

{code:java}
public Map sendStandingOrders() {
Map out = new LinkedHashMap<>();
List standingOrders = 
getStandingOrdersThatNeedToRunNow();
for (StandingOrderInfo standingOrderInfo : standingOrders) {
try {
sendStandingOrder(standingOrderInfo);
out.put(standingOrderInfo, null);
} catch (Exception ex) {
// TODO: send emails
logger.log(
Level.SEVERE,
"could not send standing order " + 
standingOrderInfo.standingOrder.getId() + " for "
+ standingOrderInfo.dayOfWeek + 
", " + standingOrderInfo.dateRequested,
ex
);
out.put(standingOrderInfo, ex);
}
}
return out;
}
{code}

Judging from the warning description, this warning shouldn't even apply to the 
method that's returning the Throwable, but rather the code that calls the 
method. In any case, the catch clause is clearly doing something with the 
exception. If the warning is intended behavior (that I don't understand), I 
don't see how the code above rises to the level of "probable bug". Can you 
please explain?

What's even more puzzling is that this similar but simpler code works:


{code:java}
private Throwable foo() {
try {
Thread.sleep(0);
return null;
} catch (Exception ex) {
return ex;
}
}
{code}



> inexplicable "throwable method result is ignored" warning
> -
>
> Key: NETBEANS-958
> URL: https://issues.apache.org/jira/browse/NETBEANS-958
> Project: NetBeans
>  Issue Type: Bug
>  Components: cnd - Editor
>Affects Versions: 9.0
> Environment: project JDK: 8
> IDE JDK: 10
>Reporter: Alvin Thompson
>Priority: Major
>
> I have the following code:
> {code:java}
>   public Map sendStandingOrders() {
>   Map out = new LinkedHashMap<>();
>   List standingOrders = 
> getStandingOrdersThatNeedToRunNow();
>   for (StandingOrderInfo standingOrderInfo : standingOrders) {
>   try {
>   sendStandingOrder(standingOrderInfo);
>   out.put(standingOrderInfo, null);
>   } catch (Exception ex) {
>   // TODO: send emails
>   logger.log(Level.SEVERE, "could not send 
> standing order ", ex);
>   out.put(standingOrderInfo, ex);
>   }
>   }
>   return out;
>   }
> {code}
> Judging from the warning description, this warning shouldn't even apply to 
> the 

[jira] [Updated] (NETBEANS-958) inexplicable "throwable method result is ignored" warning

2018-06-14 Thread Alvin Thompson (JIRA)


 [ 
https://issues.apache.org/jira/browse/NETBEANS-958?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Alvin Thompson updated NETBEANS-958:

Description: 
I have the following code:

{code:java}
public Map sendStandingOrders() {
Map out = new LinkedHashMap<>();
List standingOrders = 
getStandingOrdersThatNeedToRunNow();
for (StandingOrderInfo standingOrderInfo : standingOrders) {
try {
sendStandingOrder(standingOrderInfo);
out.put(standingOrderInfo, null);
} catch (Exception ex) {
// TODO: send emails
logger.log(
Level.SEVERE,
"could not send standing order " + 
standingOrderInfo.standingOrder.getId() + " for "
+ standingOrderInfo.dayOfWeek + 
", " + standingOrderInfo.dateRequested,
ex
);
out.put(standingOrderInfo, ex);
}
}
return out;
}
{code}

Judging from the warning description, this warning shouldn't even apply to the 
method that's returning the Throwable, but rather the code that calls the 
method. In any case, the catch clause is clearly doing something with the 
exception. If the warning is intended behavior (that I don't understand), I 
don't see how the code above rises to the level of "probable bug". Can you 
please explain?

What's even more puzzling is that this similar but simpler code works:


{code:java}
private Throwable foo() {
try {
Thread.sleep(0);
return null;
} catch (Exception ex) {
return ex;
}
}
{code}


  was:
I have the following code:

{{
foo
}}

{{public Map sendStandingOrders() {}}
 {{  Map out = new LinkedHashMap<>();}}
 {{  List standingOrders = 
getStandingOrdersThatNeedToRunNow();}}
 {{  for (StandingOrderInfo standingOrderInfo : standingOrders) {}}
 {{    try {}}
 {{      sendStandingOrder(standingOrderInfo);}}
 {{      out.put(standingOrderInfo, null); // warning here}}
 {{    } catch (Exception ex) {}}
 {{      // TODO: send emails}}
 {{      logger.log(}}
 {{        Level.SEVERE,}}
 {{        "could not send standing order " + 
standingOrderInfo.standingOrder.getId() + " for "}}
 \{{ + standingOrderInfo.dayOfWeek + ", " + standingOrderInfo.dateRequested,}}
 {{        ex}}
 {{      );}}
 {{      out.put(standingOrderInfo, ex); // warning here}}
 \{{    }}}
 \{{  }}}
 {{  return out;}}
 \{{ }}}

Judging from the warning description, this warning shouldn't even apply to the 
method that's returning the Throwable, but rather the code that calls the 
method. In any case, the catch clause is clearly doing something with the 
exception. If the warning is intended behavior (that I don't understand), I 
don't see how the code above rises to the level of "probable bug". Can you 
please explain?

What's even more puzzling is that this similar but simpler code works:

{\{ private Throwable foo() {}}
 {{  try {}}
 {{    Thread.sleep(0);}}
 {{    return null;}}
 {{  } catch (Exception ex) {}}
 {{    return ex;}}
 \{{  }}}
 \{{ }}}

 


> inexplicable "throwable method result is ignored" warning
> -
>
> Key: NETBEANS-958
> URL: https://issues.apache.org/jira/browse/NETBEANS-958
> Project: NetBeans
>  Issue Type: Bug
>  Components: cnd - Editor
>Affects Versions: 9.0
> Environment: project JDK: 8
> IDE JDK: 10
>Reporter: Alvin Thompson
>Priority: Major
>
> I have the following code:
> {code:java}
>   public Map sendStandingOrders() {
>   Map out = new LinkedHashMap<>();
>   List standingOrders = 
> getStandingOrdersThatNeedToRunNow();
>   for (StandingOrderInfo standingOrderInfo : standingOrders) {
>   try {
>   sendStandingOrder(standingOrderInfo);
>   out.put(standingOrderInfo, null);
>   } catch (Exception ex) {
>   // TODO: send emails
>   logger.log(
>   Level.SEVERE,
>   "could not send standing order " + 
> standingOrderInfo.standingOrder.getId() + " for "
>   + standingOrderInfo.dayOfWeek + 
> ", " + standingOrderInfo.dateRequested,
>   ex
>   

[jira] [Updated] (NETBEANS-958) inexplicable "throwable method result is ignored" warning

2018-06-14 Thread Alvin Thompson (JIRA)


 [ 
https://issues.apache.org/jira/browse/NETBEANS-958?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Alvin Thompson updated NETBEANS-958:

Description: 
I have the following code:

{{
foo
}}

{{public Map sendStandingOrders() {}}
 {{  Map out = new LinkedHashMap<>();}}
 {{  List standingOrders = 
getStandingOrdersThatNeedToRunNow();}}
 {{  for (StandingOrderInfo standingOrderInfo : standingOrders) {}}
 {{    try {}}
 {{      sendStandingOrder(standingOrderInfo);}}
 {{      out.put(standingOrderInfo, null); // warning here}}
 {{    } catch (Exception ex) {}}
 {{      // TODO: send emails}}
 {{      logger.log(}}
 {{        Level.SEVERE,}}
 {{        "could not send standing order " + 
standingOrderInfo.standingOrder.getId() + " for "}}
 \{{ + standingOrderInfo.dayOfWeek + ", " + standingOrderInfo.dateRequested,}}
 {{        ex}}
 {{      );}}
 {{      out.put(standingOrderInfo, ex); // warning here}}
 \{{    }}}
 \{{  }}}
 {{  return out;}}
 \{{ }}}

Judging from the warning description, this warning shouldn't even apply to the 
method that's returning the Throwable, but rather the code that calls the 
method. In any case, the catch clause is clearly doing something with the 
exception. If the warning is intended behavior (that I don't understand), I 
don't see how the code above rises to the level of "probable bug". Can you 
please explain?

What's even more puzzling is that this similar but simpler code works:

{\{ private Throwable foo() {}}
 {{  try {}}
 {{    Thread.sleep(0);}}
 {{    return null;}}
 {{  } catch (Exception ex) {}}
 {{    return ex;}}
 \{{  }}}
 \{{ }}}

 

  was:
I have the following code:

{{public Map sendStandingOrders() {}}
 {{  Map out = new LinkedHashMap<>();}}
 {{  List standingOrders = 
getStandingOrdersThatNeedToRunNow();}}
 {{  for (StandingOrderInfo standingOrderInfo : standingOrders) {}}
 {{    try {}}
 {{      sendStandingOrder(standingOrderInfo);}}
 {{      out.put(standingOrderInfo, null); // warning here}}
 {{    } catch (Exception ex) {}}
 {{      // TODO: send emails}}
 {{      logger.log(}}
 {{        Level.SEVERE,}}
 {{        "could not send standing order " + 
standingOrderInfo.standingOrder.getId() + " for "}}
 \{{ + standingOrderInfo.dayOfWeek + ", " + standingOrderInfo.dateRequested,}}
 {{        ex}}
 {{      );}}
 {{      out.put(standingOrderInfo, ex); // warning here}}
 \{{    }}}
 \{{  }}}
 {{  return out;}}
 \{{ }}}

Judging from the warning description, this warning shouldn't even apply to the 
method that's returning the Throwable, but rather the code that calls the 
method. In any case, the catch clause is clearly doing something with the 
exception. If the warning is intended behavior (that I don't understand), I 
don't see how the code above rises to the level of "probable bug". Can you 
please explain?

What's even more puzzling is that this similar but simpler code works:

{\{ private Throwable foo() {}}
 {{  try {}}
 {{    Thread.sleep(0);}}
 {{    return null;}}
 {{  } catch (Exception ex) {}}
 {{    return ex;}}
 \{{  }}}
 \{{ }}}

 


> inexplicable "throwable method result is ignored" warning
> -
>
> Key: NETBEANS-958
> URL: https://issues.apache.org/jira/browse/NETBEANS-958
> Project: NetBeans
>  Issue Type: Bug
>  Components: cnd - Editor
>Affects Versions: 9.0
> Environment: project JDK: 8
> IDE JDK: 10
>Reporter: Alvin Thompson
>Priority: Major
>
> I have the following code:
> {{
> foo
> }}
> {{public Map sendStandingOrders() {}}
>  {{  Map out = new LinkedHashMap<>();}}
>  {{  List standingOrders = 
> getStandingOrdersThatNeedToRunNow();}}
>  {{  for (StandingOrderInfo standingOrderInfo : standingOrders) {}}
>  {{    try {}}
>  {{      sendStandingOrder(standingOrderInfo);}}
>  {{      out.put(standingOrderInfo, null); // warning here}}
>  {{    } catch (Exception ex) {}}
>  {{      // TODO: send emails}}
>  {{      logger.log(}}
>  {{        Level.SEVERE,}}
>  {{        "could not send standing order " + 
> standingOrderInfo.standingOrder.getId() + " for "}}
>  \{{ + standingOrderInfo.dayOfWeek + ", " + standingOrderInfo.dateRequested,}}
>  {{        ex}}
>  {{      );}}
>  {{      out.put(standingOrderInfo, ex); // warning here}}
>  \{{    }}}
>  \{{  }}}
>  {{  return out;}}
>  \{{ }}}
> Judging from the warning description, this warning shouldn't even apply to 
> the method that's returning the Throwable, but rather the code that calls the 
> method. In any case, the catch clause is clearly doing something with the 
> exception. If the warning is intended behavior (that I don't understand), I 
> don't see how the code above rises to the level of "probable bug". Can you 
> please explain?
> What's even more puzzling is that this similar but simpler code works:
> {\{ private Throwable foo() {}}
>  {{  try {}}
>  {{    

[jira] [Updated] (NETBEANS-958) inexplicable "throwable method result is ignored" warning

2018-06-14 Thread Alvin Thompson (JIRA)


 [ 
https://issues.apache.org/jira/browse/NETBEANS-958?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Alvin Thompson updated NETBEANS-958:

Description: 
I have the following code:

{{public Map sendStandingOrders() {}}
 {{  Map out = new LinkedHashMap<>();}}
 {{  List standingOrders = 
getStandingOrdersThatNeedToRunNow();}}
 {{  for (StandingOrderInfo standingOrderInfo : standingOrders) {}}
 {{    try {}}
 {{      sendStandingOrder(standingOrderInfo);}}
 {{      out.put(standingOrderInfo, null); // warning here}}
 {{    } catch (Exception ex) {}}
 {{      // TODO: send emails}}
 {{      logger.log(}}
 {{        Level.SEVERE,}}
 {{        "could not send standing order " + 
standingOrderInfo.standingOrder.getId() + " for "}}
 \{{ + standingOrderInfo.dayOfWeek + ", " + standingOrderInfo.dateRequested,}}
 {{        ex}}
 {{      );}}
 {{      out.put(standingOrderInfo, ex); // warning here}}
 \{{    }}}
 \{{  }}}
 {{  return out;}}
 \{{ }}}

Judging from the warning description, this warning shouldn't even apply to the 
method that's returning the Throwable, but rather the code that calls the 
method. In any case, the catch clause is clearly doing something with the 
exception. If the warning is intended behavior (that I don't understand), I 
don't see how the code above rises to the level of "probable bug". Can you 
please explain?

What's even more puzzling is that this similar but simpler code works:

{\{ private Throwable foo() {}}
 {{  try {}}
 {{    Thread.sleep(0);}}
 {{    return null;}}
 {{  } catch (Exception ex) {}}
 {{    return ex;}}
 \{{  }}}
 \{{ }}}

 

  was:
I have the following code:

{{public Map sendStandingOrders() {}}
{{  Map out = new LinkedHashMap<>();}}
{{  List standingOrders = 
getStandingOrdersThatNeedToRunNow();}}
{{  for (StandingOrderInfo standingOrderInfo : standingOrders) {}}
{{    try {}}
{{      sendStandingOrder(standingOrderInfo);}}
{{      out.put(standingOrderInfo, null); // warning here}}
{{    } catch (Exception ex) {}}
{{      // TODO: send emails}}
{{      logger.log(}}
{{        Level.SEVERE,}}
{{        "could not send standing order " + 
standingOrderInfo.standingOrder.getId() + " for "}}
{{ + standingOrderInfo.dayOfWeek + ", " + standingOrderInfo.dateRequested,}}
{{        ex}}
{{      );}}
{{      out.put(standingOrderInfo, ex); // warning here}}
{{    }}}
{{  }}}
{{  return out;}}
{{ }}}

Judging from the warning description, this warning shouldn't even apply to the 
method that's returning the Throwable, but rather the code that calls the 
method. In any case, the catch clause is clearly doing something with the 
exception. If the warning is intended behavior (that I don't understand), I 
don't see how the code above rises to the level of "probable bug". Can you 
please explain?

What's even more puzzling is that this similar but simpler code works:

{{ private Throwable foo() {}}
{{  try {}}
{{    Thread.sleep(0);}}
{{    return null;}}
{{  } catch (Exception ex) {}}
{{    return ex;}}
{{  }}}
{{ }}}

 


> inexplicable "throwable method result is ignored" warning
> -
>
> Key: NETBEANS-958
> URL: https://issues.apache.org/jira/browse/NETBEANS-958
> Project: NetBeans
>  Issue Type: Bug
>  Components: cnd - Editor
>Affects Versions: 9.0
> Environment: project JDK: 8
> IDE JDK: 10
>Reporter: Alvin Thompson
>Priority: Major
>
> I have the following code:
> {{public Map sendStandingOrders() {}}
>  {{  Map out = new LinkedHashMap<>();}}
>  {{  List standingOrders = 
> getStandingOrdersThatNeedToRunNow();}}
>  {{  for (StandingOrderInfo standingOrderInfo : standingOrders) {}}
>  {{    try {}}
>  {{      sendStandingOrder(standingOrderInfo);}}
>  {{      out.put(standingOrderInfo, null); // warning here}}
>  {{    } catch (Exception ex) {}}
>  {{      // TODO: send emails}}
>  {{      logger.log(}}
>  {{        Level.SEVERE,}}
>  {{        "could not send standing order " + 
> standingOrderInfo.standingOrder.getId() + " for "}}
>  \{{ + standingOrderInfo.dayOfWeek + ", " + standingOrderInfo.dateRequested,}}
>  {{        ex}}
>  {{      );}}
>  {{      out.put(standingOrderInfo, ex); // warning here}}
>  \{{    }}}
>  \{{  }}}
>  {{  return out;}}
>  \{{ }}}
> Judging from the warning description, this warning shouldn't even apply to 
> the method that's returning the Throwable, but rather the code that calls the 
> method. In any case, the catch clause is clearly doing something with the 
> exception. If the warning is intended behavior (that I don't understand), I 
> don't see how the code above rises to the level of "probable bug". Can you 
> please explain?
> What's even more puzzling is that this similar but simpler code works:
> {\{ private Throwable foo() {}}
>  {{  try {}}
>  {{    Thread.sleep(0);}}
>  {{    return null;}}
>  {{  } catch