Not If

	if(sp001.getDtrfrmms1() == null && !sp001.getDtrfrmms1().equalsIgnoreCase("")) {
		
		
		
	}
	else {
		date = df.format((String)sp001.getDtrfrmms1().get(0));
		
		--... cut, not interesting --
	}
	
	if(sp001.getDtrfrmms2() == null && !sp001.getDtrfrmms2().equalsIgnoreCase("")) {
		
		
		
	}
	else {
		date = df.format((String)sp001.getDtrfrmms2().get(0));
		
		--... cut, not interesting --
	}
	
	if(sp001.getDtrfrmms3() == null && !sp001.getDtrfrmms3().equalsIgnoreCase("")) {
		
		
		
	}
	else {
		date = df.format((String)sp001.getDtrfrmms3().get(0));
		
		--... cut, not interesting --
	}
	
	
	...
	
	
	if(sp001.getDtrfrmms12() == null && !sp001.getDtrfrmms12().equalsIgnoreCase("")) {
		
		
		
	}
	else {
		date = df.format((String)sp001.getDtrfrmms12().get(0));
		
		--... cut, not interesting --
	}

A true reversed logic

Found in the codebase of the big italian bank, but I couldn’t stand in front of that… I’d rewritten the class

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s