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 258428 - "Use specific catch" hint incorrectly shown for type-parameter exception type
Summary: "Use specific catch" hint incorrectly shown for type-parameter exception type
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 8.1
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-03-18 00:06 UTC by matthies
Modified: 2016-04-30 01:59 UTC (History)
0 users

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 matthies 2016-03-18 00:06:55 UTC
Example:

    public abstract class Example<X extends Exception>
    {
        public abstract void foo() throws X, java.io.IOException;

        public void example()
        {
            try
            {
                foo();
            }
            catch (Exception ex)
            {
                // do something
            }
        }
    }

The hint "Can be replaced with multicatch or several catch clauses catching specific exceptions" is incorrectly shown. It is incorrect because it is not possible to write a catch clause for X, as it is a type parameter rather than a class.
Comment 1 Svata Dedic 2016-04-28 14:20:51 UTC
Fixed in jet-main#875484e483a1
Comment 2 Quality Engineering 2016-04-30 01:59:27 UTC
Integrated into 'main-silver', will be available in build *201604300002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/875484e483a1
User: Svata Dedic <sdedic@netbeans.org>
Log: #258428: type-parametrized exceptions replaced by their upper bounds