This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 181445 - Fix for string concatenation in Logger methods mishandles Throwable param
Summary: Fix for string concatenation in Logger methods mishandles Throwable param
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 6.x
Hardware: PC Linux
: P4 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-02 12:33 UTC by Jesse Glick
Modified: 2015-12-09 12:46 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2010-03-02 12:33:48 UTC
//Exception x = ...;
LOG.warning("encountered a problem: " + x);

=>

LOG.log(Level.WARNING, "encountered a problem: {0}", x);

This invokes the (Level,String,Throwable) overload rather than the expected (Level,String,Object) overload. Need to translate to:

LOG.log(Level.WARNING, "encountered a problem: {0}", new Object[] {x});

I guess the same would apply if the single format param were of a reference array type.