Jindent - Java Source Code Formatter http://www.jindent.com
 



title
5.6.1.2.2 Labels

Indent labels

Indent labels

Controls indentation of labels.


No indentation aligns labels to first column:

public class Test {                     
                                        
    
public void method() {              
                                        
myLabel: 
while (a < 10) {               
            ...                         
            
break myLabel;              
            ...                         
        }                               
    }                                   
}                                       


Using indentation of labels aligns them to correct indentation level:

public class Test {                     
                                        
    
public void method() {              
                                        
        myLabel: 
while (a < 10) {       
            ...                         
            
break myLabel;              
            ...                         
        }                               
    }                                   
}                                       



Labels on new lines

Labels on new lines

Controls whether labels appear on a new line or not.


Labels on new line combined with no indentation:

public class Test {                     
                                        
    
public void method() {              
                                        
myLabel:                                
        
while (a < 10) {                
            ...                         
            
break myLabel;              
            ...                         
        }                               
    }                                   
}                                       


Labels on new line combined with indentation of labels:

public class Test {                     
                                        
    
public void method() {              
                                        
        myLabel:                        
        
while (a < 10) {                
            ...                         
            
break myLabel;              
            ...                         
        }                               
    }                                   
}                                       




See also... See also: Space before colons of labels , Space after colons of labels