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 252852 - Method chain call is incorrectly auto-indented in nested blocks such as anonymous classes
Summary: Method chain call is incorrectly auto-indented in nested blocks such as anony...
Status: RESOLVED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Formatting & Indentation (show other bugs)
Version: 8.0.2
Hardware: PC Mac OS X
: P2 normal (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-07 08:08 UTC by csbubbles
Modified: 2016-06-10 13:41 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Wrong indentation (69.37 KB, image/png)
2015-06-07 08:08 UTC, csbubbles
Details

Note You need to log in before you can comment on or make changes to this bug.
Description csbubbles 2015-06-07 08:08:40 UTC
Created attachment 154087 [details]
Wrong indentation

See the screenshot attached.


** Actual result:

protected void go() {
    controls
        .animate()
        .setListener(new AbstractAnimatorListener() {

            @Override
            public void onAnimationEnd(Animator animation) {
                adView
                .animate()
                .alpha(1);
            }

        })
        .alpha(0);
}


** Expected:

protected void go() {
    controls
        .animate()
        .setListener(new AbstractAnimatorListener() {

            @Override
            public void onAnimationEnd(Animator animation) {
                adView
                    .animate()
                    .alpha(1);
            }

        })
        .alpha(0);
}
Comment 1 Jiri Prox 2015-06-08 13:43:45 UTC
I can reproduce this issue in 8.0.2 but in dev build it is already fixed.
Comment 2 csbubbles 2015-06-08 14:01:26 UTC
Can you please provide the link to the changeset that fixes this issue?
Comment 3 Jiri Prox 2015-06-08 14:08:26 UTC
I'm not sure which issue fixed this, there were two fixes in continuation indentation, see issue 246505 and issue 251677
Comment 4 csbubbles 2015-11-16 23:31:28 UTC
This still doesn't work in v. 8.1.


ACTUAL:

import com.google.common.collect.ImmutableSet;
import java.util.Set;

public class A {

	private void doIt(Object object, Set<Object> obejcts) {
	}

	private void doIt() {
		doIt(
			null,
			ImmutableSet
			.<Object>builder()
			.add(1)
			.add(2)
			.build()
		);
	}

}


ACTUAL:

import com.google.common.collect.ImmutableSet;
import java.util.Set;

public class A {

    private void doIt(Object object, Set<Object> objects) {
    }

    private void doIt() {
        doIt(
            null,
            ImmutableSet
            .<Object>builder()
            .add(1)
            .add(2)
            .build()
        );
    }

}


EXPECTED:

import com.google.common.collect.ImmutableSet;
import java.util.Set;

public class A {

    private void doIt(Object object, Set<Object> objects) {
    }

    private void doIt() {
        doIt(
            null,
            ImmutableSet
                .<Object>builder()
                .add(1)
                .add(2)
                .build()
        );
    }

}
Comment 5 csbubbles 2015-11-16 23:37:25 UTC
Though, that might be a different issue with indentation. The anonymous classes look okay, I think. Should we spawn another bug instead?
Comment 6 Dusan Balek 2016-06-10 13:41:37 UTC
Fixed in jet-main.

http://hg.netbeans.org/jet-main/rev/c17a5af3988f