W
Wojtek
I can legally do the following:
if (server.getConnectionType() == ConnectionType.ACTIVE)
ftp.enterLocalActiveMode();
else
ftp.enterLocalPassiveMode();
but I want to do:
(server.getConnectionType() == ConnectionType.ACTIVE) ?
ftp.enterLocalActiveMode() : ftp.enterLocalPassiveMode();
However the compiler insists that I must have an assignment even though
both ftp methods return void. I would think that the compiler would be
smart enough to realize that nothing CAN be returned.
Oh yes, I am using Eclipse with Java 7
Thoughts? I mean other than stylistic comments...
if (server.getConnectionType() == ConnectionType.ACTIVE)
ftp.enterLocalActiveMode();
else
ftp.enterLocalPassiveMode();
but I want to do:
(server.getConnectionType() == ConnectionType.ACTIVE) ?
ftp.enterLocalActiveMode() : ftp.enterLocalPassiveMode();
However the compiler insists that I must have an assignment even though
both ftp methods return void. I would think that the compiler would be
smart enough to realize that nothing CAN be returned.
Oh yes, I am using Eclipse with Java 7
Thoughts? I mean other than stylistic comments...