[RESOLVED] Code Style Wrapping
The code style doesn't seem to force wrapping in all cases.
If I take the code from here as an example
http://www.javacoffeebreak.com/articles/javarmi/javarmi.html
e.g.
// Calculate the power of a number
public BigInteger power ( int num1, int num2)
throws RemoteException
{
String numrep = String.valueOf(num1);
BigInteger bi = new BigInteger (numrep);
bi = bi.pow(num2);
return bi;
}
public static void main ( String args[] ) throws Exception
{
// Assign a security manager, in the event that dynamic
// classes are loaded
if (System.getSecurityManager() == null)
System.setSecurityManager ( new RMISecurityManager() );
// Create an instance of our power service server ...
PowerServiceServer svr = new PowerServiceServer();
// ... and bind it with the RMI Registry
Naming.bind ("PowerService", svr);
System.out.println ("Service bound....");
}
I can reformat it so that it aligns nicely and braces are forced (see if statements in second method).
However, I can't seem to force the throws statement onto the same line as the method (see first method)
// Calculate the power of a number
public BigInteger power(int num1, int num2)
throws RemoteException {
String numrep = String.valueOf(num1);
BigInteger bi = new BigInteger(numrep);
bi = bi.pow(num2);
return bi;
}
public static void main(String args[]) throws Exception {
// Assign a security manager, in the event that dynamic
// classes are loaded
if (System.getSecurityManager() == null) {
System.setSecurityManager(new RMISecurityManager());
}
// Create an instance of our power service server ...
PowerServiceServer svr = new PowerServiceServer();
// ... and bind it with the RMI Registry
Naming.bind("PowerService", svr);
System.out.println("Service bound....");
}
Please sign in to leave a comment.
Taking a more straightforward example from here
http://www.novell.com/documentation/extend52/Docs/help/MP/jms/tutorial/pointToPoint-1.htm
I would expect this
to be reformatted like this
Is that not a reasonable expectation?
Your right margin setting is too low.
When right margin is set to 200 for example :
gets reformatted to :
PS : the code doesn't work, just needed a long line
That combined with removing Keep When Reformating "Line breaks" in Alignement and Braces fixed it.
Thanks.