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 236295 - [inline] cannot inline method with multiple return statements, but inline is possible
Summary: [inline] cannot inline method with multiple return statements, but inline is ...
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 7.4
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Ralph Ruijs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-09-23 20:54 UTC by markiewb
Modified: 2015-04-27 15:18 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 markiewb 2013-09-23 20:54:49 UTC
* Take this sample
package sample;
public class Foo {

    boolean method() {
        if ("foo".equals("boo")) {
            return true;
        }
        return false;
    }

    boolean otherMethod() {
        return method();
    }
}

* try to inline method()
-> 

ACTUAL: cannot inline - error "Cannot inline method with multiple return statements."

EXPECTED: inline is possible. The expected result is
package sample;
public class Foo {

    boolean otherMethod() {
        if ("foo".equals("boo")) {
            return true;
        }
        return false;
    }
}

Product Version: NetBeans IDE 7.4 RC1 (Build 201309162201)
Java: 1.7.0_40; Java HotSpot(TM) 64-Bit Server VM 24.0-b56
Runtime: Java(TM) SE Runtime Environment 1.7.0_40-b43
System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)
Comment 1 Ralph Ruijs 2015-04-27 15:18:02 UTC
changeset:   6f17eeaf37d9
user:        Ralph Benjamin Ruijs <ralphbenjamin@netbeans.org>
date:        Mon Apr 27 17:15:48 2015 +0200
summary:     # 236295 - [inline] cannot inline method with multiple return statements, but inline is possible