You only have to choose

	private int chooseOperation(String n, String s, String c) {
		if(c != null && c.equals(ON)){
			if (n != null && !VOID.equals(n) && (s == null || s.equals(VOID))){
				return ADD;
			}
			if ((s != null || !"".equals(s)) && (n != null)){
					return UPDATE;
			}
		}else if (c == null || c.equals(FALSE)){
			if (!VOID.equals(s)){
				return DELETE;
			}
		}
		return NULL;
	}

Wait, what??

Found in the codebase of a italian public company

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