I'd like Netbeans to automatically ident a copied and pasted piece of code in function of where it is being pasted. Take this method public void test(byte value) { Object value = getValue(value); if (value != null) { // do something here, then return } else { // do some preparation value = getValue(value); } } Now after the line value = getValue(value); you need to run another check on value... so you copy the following piece of code if (value != null) { // do something here, then return } and you paste it to the line after value = getValue(value); The result looks like this: public void test(byte value) { Object value = getValue(value); if (value != null) { // do something here, then return } else { // do some preparation value = getValue(value); if (value != null) { // do something here, then return } } } And it should look like public void test(byte value) { Object value = getValue(value); if (value != null) { // do something here, then return } else { // do some preparation value = getValue(value); if (value != null) { // do something here, then return } } } Other IDEs (e.g. Visual Studio) automatically adapt the identation so that the entire bit of code matches up (so in order to do this, upon pasting, the "uppermost" bit of code should line up with the the default identation of the line where the code is being pasted. In the example, the pasted if is idented by two levels.. and the line where it is being pasted is idented by three levels.. meaning the whole bit of code needs an additional level of identation to line up.
*** This bug has been marked as a duplicate of bug 111536 ***