Input:
	protected Dialog onCreateDialog(final int id) {
		AlertDialog.Builder builder = new AlertDialog.Builder(this);
		LayoutInflater inflater = (LayoutInflater) this.getSystemService(LAYOUT_INFLATER_SERVICE);
		switch (ChatDialog.values()[id]) {
		case Challenge: {
			if (netServ == null) {
				removeDialog(id);
				dismissDialog(id);
			}
			final IncomingChallenge challenge = netServ.challenges.poll();
			View challengedLayout = inflater.inflate(R.layout.player_info_dialog, (LinearLayout)findViewById(R.id.player_info_dialog));
			PlayerInfo opp = netServ.players.get(challenge.opponent);
			ImageView[] oppPokeIcons = new ImageView[6];
			TextView oppInfo, oppTeam, oppName, oppTier, oppRating;
			builder.setView(challengedLayout)
			.setCancelable(false)
			.setNegativeButton(this.getString(R.string.decline), new DialogInterface.OnClickListener() {
				public void onClick(DialogInterface dialog, int which) {
					if (netServ.socket.isConnected())
						netServ.socket.sendMessage(
								constructChallenge(ChallengeDesc.Refused.ordinal(),
										challenge.opponent,
										challenge.clauses,
										challenge.mode),
										Command.ChallengeStuff);
					removeDialog(id);
					checkChallenges();
				}
			})
			.setPositiveButton(this.getString(R.string.accept), new DialogInterface.OnClickListener() {
				public void onClick(DialogInterface dialog, int which) {
					if (netServ.socket.isConnected())
						netServ.socket.sendMessage(
								constructChallenge(ChallengeDesc.Accepted.ordinal(),
										challenge.opponent,
										challenge.clauses,
										challenge.mode),
										Command.ChallengeStuff);
					removeDialog(id);
					checkChallenges();
				}
			});
			final AlertDialog oppInfoDialog = builder.create();
			for(int i = 0; i < 6; i++){
				oppPokeIcons[i] = (ImageView)challengedLayout.findViewById(getResources().getIdentifier("player_info_poke" +
						(i+1), "id", packName));
			}
			oppInfo = (TextView)challengedLayout.findViewById(getResources().getIdentifier("player_info", "id", packName));
			oppInfo.setText(Html.fromHtml("<b>Info: </b>" + StringUtilities.escapeHtml(opp.info())));
			oppTeam = (TextView)challengedLayout.findViewById(getResources().getIdentifier("player_info_team", "id", packName));
			oppTeam.setText(opp.nick() + "'s team:");
			oppName = (TextView)challengedLayout.findViewById(getResources().getIdentifier("player_info_name", "id", packName));
			oppName.setText(this.getString(R.string.accept_challenge) + " " + opp.nick() + "?");
			oppName.setTextSize(18);
			oppTier = (TextView)challengedLayout.findViewById(getResources().getIdentifier("player_info_tier", "id", packName));
			oppRating = (TextView)challengedLayout.findViewById(getResources().getIdentifier("player_info_rating", "id", packName));
			return oppInfoDialog;
		} case AskForPass: {
        	final EditText passField = new EditText(this);
        	passField.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);
			builder.setMessage("Please enter your password " + netServ.mePlayer.nick() + ".")
			.setCancelable(true)
			.setView(passField)
			.setPositiveButton("Done", new DialogInterface.OnClickListener() {
				public void onClick(DialogInterface dialog, int which) {
					if (netServ != null) {
						netServ.sendPass(passField.getText().toString());
					}
					removeDialog(id);
				}
			})
			.setOnCancelListener(new OnCancelListener() {
				public void onCancel(DialogInterface dialog) {
					removeDialog(id);
					disconnect();
				}
			});
			final AlertDialog dialog = builder.create();
        	passField.setOnFocusChangeListener(new View.OnFocusChangeListener() {
				public void onFocusChange(View v, boolean hasFocus) {
					if (hasFocus) {
						dialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
					}
				}
			});
			return dialog;
		} case ConfirmDisconnect: {
			builder.setMessage("Really disconnect?")
			.setCancelable(true)
			.setPositiveButton("Disconnect", new DialogInterface.OnClickListener() {
				public void onClick(DialogInterface dialog, int which) {
					disconnect();
				}
			})
			.setNegativeButton("Cancel", null);
			return builder.create();
		} case FindBattle: {
			final EditText range = new EditText(this);
			range.append("" + (prefs.contains("range") ? prefs.getInt("range", 0) : ""));
			range.setInputType(InputType.TYPE_CLASS_NUMBER);
			range.setHint("Range");
			builder.setTitle(R.string.find_a_battle)
			.setMultiChoiceItems(new CharSequence[]{"Force Rated", "Force Same Tier", "Only within range"}, new boolean[]{prefs.getBoolean("findOption0", false), prefs.getBoolean("findOption1", false), prefs.getBoolean("findOption2", false)}, new DialogInterface.OnMultiChoiceClickListener() {
				public void onClick(DialogInterface dialog, int which, boolean isChecked) {
					prefs.edit().putBoolean("findOption" + which, isChecked).commit();
				}
			})
			.setView(range)
			.setPositiveButton("Find", new DialogInterface.OnClickListener() {
				public void onClick(DialogInterface dialog, int which) {
					if (netServ != null && netServ.socket.isConnected()) {
						netServ.findingBattle = true;
						try {
							prefs.edit().putInt("range", Integer.valueOf(range.getText().toString())).commit();
						} catch (NumberFormatException e) {
							prefs.edit().remove("range").commit();
						}
						netServ.socket.sendMessage(
								constructFindBattle(prefs.getBoolean("findOption0", false), prefs.getBoolean("findOption1", false), prefs.getBoolean("findOption2", false), prefs.getInt("range", 200), (byte) 0),
								Command.FindBattle);
					}
				}
			});
			return builder.create();
		} case TierSelection: {
			if (netServ == null) {
				return null;
			}
			return new TierAlertDialog(this, netServ.superTier);
		} case PlayerInfo: {
			View layout = inflater.inflate(R.layout.player_info_dialog, (LinearLayout)findViewById(R.id.player_info_dialog));
            ImageView[] pPokeIcons = new ImageView[6];
            TextView pInfo, pName;
            ListView ratings;
			builder.setView(layout)
            .setNegativeButton("Back", new DialogInterface.OnClickListener(){
            	public void onClick(DialogInterface dialog, int which) {
            		removeDialog(id);
            	}
            })
            .setOnCancelListener(new DialogInterface.OnCancelListener(){
            	public void onCancel(DialogInterface dialog) {
            		removeDialog(id);
            	}
            })
            .setPositiveButton("Challenge", new DialogInterface.OnClickListener(){
            	public void onClick(DialogInterface dialog, int which) {
        			showDialog(ChatDialog.ChallengeMode.ordinal());
            		removeDialog(id);
            	}});
            final AlertDialog pInfoDialog = builder.create();
            for(int i = 0; i < 6; i++){
        	pPokeIcons[i] = (ImageView)layout.findViewById(getResources().getIdentifier("player_info_poke" +
        			(i+1), "id", packName));
            }
        	pInfo = (TextView)layout.findViewById(R.id.player_info);
        	pInfo.setText(Html.fromHtml("<b>Info: </b>" + StringUtilities.escapeHtml(lastClickedPlayer.info())));
        	pName = (TextView)layout.findViewById(R.id.player_info_name);
        	pName.setText(lastClickedPlayer.nick());
        	ratings = (ListView)layout.findViewById(R.id.player_info_tiers);
        	ratings.setAdapter(new TwoViewsArrayAdapter<TierStanding>(this, android.R.layout.simple_list_item_2,
        			android.R.id.text1, android.R.id.text2, lastClickedPlayer.tierStandings, PlayerInfo.tierGetter));
            return pInfoDialog;
		} case ChallengeMode: {
            final Clauses[] clauses = Clauses.values();
            final int numClauses = clauses.length;
			final String[] clauseNames = new String[numClauses];
			final boolean[] checked = new boolean[numClauses];
			for (int i=0; i < numClauses; i++) {
				clauseNames[i] = clauses[i].toString();
				checked[i] = prefs.getBoolean("challengeOption" + i, false);
			}
            builder.setMultiChoiceItems(clauseNames, checked, new DialogInterface.OnMultiChoiceClickListener() {
				public void onClick(DialogInterface dialog, int which, boolean isChecked) {
					prefs.edit().putBoolean("challengeOption" + which, isChecked).commit();
				}
			})
			.setPositiveButton("Challenge", new DialogInterface.OnClickListener() {
				public void onClick(DialogInterface dialog, int which) {
					int clauses = 0;
					for (int i = 0; i < numClauses; i++)
						clauses |= (prefs.getBoolean("challengeOption" + i, false) ? Clauses.values()[i].mask() : 0);
					if (netServ != null && netServ.socket != null && netServ.socket.isConnected())
						netServ.socket.sendMessage(constructChallenge(ChallengeDesc.Sent.ordinal(), lastClickedPlayer.id, clauses, Mode.Singles.ordinal()), Command.ChallengeStuff);
					removeDialog(id);
				}
			})
            .setNegativeButton("Back", new DialogInterface.OnClickListener(){
            	public void onClick(DialogInterface dialog, int which) {
            		removeDialog(id);
            	}
            })
            .setOnCancelListener(new DialogInterface.OnCancelListener(){
            	public void onCancel(DialogInterface dialog) {
            		removeDialog(id);
            	}
            })
            .setTitle("Select clauses");
            return builder.create();
		} default: {
			return new Dialog(this);
		}
		}
	}

Output:
	protected Dialog onCreateDialog(final int id) {
		AlertDialog.Builder builder = new AlertDialog.Builder(this);
		LayoutInflater inflater = (LayoutInflater) this.getSystemService(LAYOUT_INFLATER_SERVICE);
		switch (ChatDialog.values()[id]) {
		case Challenge: {
			if (netServ == null) {
				return null;
			}
			final IncomingChallenge challenge = netServ.challenges.poll();
			View challengedLayout = inflater.inflate(R.layout.player_info_dialog, (LinearLayout)findViewById(R.id.player_info_dialog));
			PlayerInfo opp = netServ.players.get(challenge.opponent);
			ImageView[] oppPokeIcons = new ImageView[6];
			TextView oppInfo, oppTeam, oppName, oppTier, oppRating;
			builder.setView(challengedLayout)
			.setCancelable(false)
			.setNegativeButton(this.getString(R.string.decline), new DialogInterface.OnClickListener() {
				public void onClick(DialogInterface dialog, int which) {
					if (netServ.socket.isConnected())
						netServ.socket.sendMessage(
								constructChallenge(ChallengeDesc.Refused.ordinal(),
										challenge.opponent,
										challenge.clauses,
										challenge.mode),
										Command.ChallengeStuff);
					removeDialog(id);
					checkChallenges();
				}
			})
			.setPositiveButton(this.getString(R.string.accept), new DialogInterface.OnClickListener() {
				public void onClick(DialogInterface dialog, int which) {
					if (netServ.socket.isConnected())
						netServ.socket.sendMessage(
								constructChallenge(ChallengeDesc.Accepted.ordinal(),
										challenge.opponent,
										challenge.clauses,
										challenge.mode),
										Command.ChallengeStuff);
					removeDialog(id);
					checkChallenges();
				}
			});
			final AlertDialog oppInfoDialog = builder.create();
			for(int i = 0; i < 6; i++){
				oppPokeIcons[i] = (ImageView)challengedLayout.findViewById(getResources().getIdentifier("player_info_poke" +
						(i+1), "id", packName));
			}
			oppInfo = (TextView)challengedLayout.findViewById(getResources().getIdentifier("player_info", "id", packName));
			oppInfo.setText(Html.fromHtml("<b>Info: </b>" + StringUtilities.escapeHtml(opp.info())));
			oppTeam = (TextView)challengedLayout.findViewById(getResources().getIdentifier("player_info_team", "id", packName));
			oppTeam.setText(opp.nick() + "'s team:");
			oppName = (TextView)challengedLayout.findViewById(getResources().getIdentifier("player_info_name", "id", packName));
			oppName.setText(this.getString(R.string.accept_challenge) + " " + opp.nick() + "?");
			oppName.setTextSize(18);
			oppTier = (TextView)challengedLayout.findViewById(getResources().getIdentifier("player_info_tier", "id", packName));
			oppRating = (TextView)challengedLayout.findViewById(getResources().getIdentifier("player_info_rating", "id", packName));
			return oppInfoDialog;
		} case AskForPass: {
        	final EditText passField = new EditText(this);
        	passField.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);
			builder.setMessage("Please enter your password " + netServ.mePlayer.nick() + ".")
			.setCancelable(true)
			.setView(passField)
			.setPositiveButton("Done", new DialogInterface.OnClickListener() {
				public void onClick(DialogInterface dialog, int which) {
					if (netServ != null) {
						netServ.sendPass(passField.getText().toString());
					}
					removeDialog(id);
				}
			})
			.setOnCancelListener(new OnCancelListener() {
				public void onCancel(DialogInterface dialog) {
					removeDialog(id);
					disconnect();
				}
			});
			final AlertDialog dialog = builder.create();
        	passField.setOnFocusChangeListener(new View.OnFocusChangeListener() {
				public void onFocusChange(View v, boolean hasFocus) {
					if (hasFocus) {
						dialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
					}
				}
			});
			return dialog;
		} case ConfirmDisconnect: {
			builder.setMessage("Really disconnect?")
			.setCancelable(true)
			.setPositiveButton("Disconnect", new DialogInterface.OnClickListener() {
				public void onClick(DialogInterface dialog, int which) {
					disconnect();
				}
			})
			.setNegativeButton("Cancel", null);
			return builder.create();
		} case FindBattle: {
			final EditText range = new EditText(this);
			range.append("" + (prefs.contains("range") ? prefs.getInt("range", 0) : ""));
			range.setInputType(InputType.TYPE_CLASS_NUMBER);
			range.setHint("Range");
			builder.setTitle(R.string.find_a_battle)
			.setMultiChoiceItems(new CharSequence[]{"Force Rated", "Force Same Tier", "Only within range"}, new boolean[]{prefs.getBoolean("findOption0", false), prefs.getBoolean("findOption1", false), prefs.getBoolean("findOption2", false)}, new DialogInterface.OnMultiChoiceClickListener() {
				public void onClick(DialogInterface dialog, int which, boolean isChecked) {
					prefs.edit().putBoolean("findOption" + which, isChecked).commit();
				}
			})
			.setView(range)
			.setPositiveButton("Find", new DialogInterface.OnClickListener() {
				public void onClick(DialogInterface dialog, int which) {
					if (netServ != null && netServ.socket.isConnected()) {
						netServ.findingBattle = true;
						try {
							prefs.edit().putInt("range", Integer.valueOf(range.getText().toString())).commit();
						} catch (NumberFormatException e) {
							prefs.edit().remove("range").commit();
						}
						netServ.socket.sendMessage(
								constructFindBattle(prefs.getBoolean("findOption0", false), prefs.getBoolean("findOption1", false), prefs.getBoolean("findOption2", false), prefs.getInt("range", 200), (byte) 0),
								Command.FindBattle);
					}
				}
			});
			return builder.create();
		} case TierSelection: {
			if (netServ == null) {
				return null;
			}
			return new TierAlertDialog(this, netServ.superTier);
		} case PlayerInfo: {
			View layout = inflater.inflate(R.layout.player_info_dialog, (LinearLayout)findViewById(R.id.player_info_dialog));
            ImageView[] pPokeIcons = new ImageView[6];
            TextView pInfo, pName;
            ListView ratings;
			builder.setView(layout)
            .setNegativeButton("Back", new DialogInterface.OnClickListener(){
            	public void onClick(DialogInterface dialog, int which) {
            		removeDialog(id);
            	}
            })
            .setOnCancelListener(new DialogInterface.OnCancelListener(){
            	public void onCancel(DialogInterface dialog) {
            		removeDialog(id);
            	}
            })
            .setPositiveButton("Challenge", new DialogInterface.OnClickListener(){
            	public void onClick(DialogInterface dialog, int which) {
        			showDialog(ChatDialog.ChallengeMode.ordinal());
            		removeDialog(id);
            	}});
            final AlertDialog pInfoDialog = builder.create();
            for(int i = 0; i < 6; i++){
        	pPokeIcons[i] = (ImageView)layout.findViewById(getResources().getIdentifier("player_info_poke" +
        			(i+1), "id", packName));
            }
        	pInfo = (TextView)layout.findViewById(R.id.player_info);
        	pInfo.setText(Html.fromHtml("<b>Info: </b>" + StringUtilities.escapeHtml(lastClickedPlayer.info())));
        	pName = (TextView)layout.findViewById(R.id.player_info_name);
        	pName.setText(lastClickedPlayer.nick());
        	ratings = (ListView)layout.findViewById(R.id.player_info_tiers);
        	ratings.setAdapter(new TwoViewsArrayAdapter<TierStanding>(this, android.R.layout.simple_list_item_2,
        			android.R.id.text1, android.R.id.text2, lastClickedPlayer.tierStandings, PlayerInfo.tierGetter));
            return pInfoDialog;
		} case ChallengeMode: {
            final Clauses[] clauses = Clauses.values();
            final int numClauses = clauses.length;
			final String[] clauseNames = new String[numClauses];
			final boolean[] checked = new boolean[numClauses];
			for (int i=0; i < numClauses; i++) {
				clauseNames[i] = clauses[i].toString();
				checked[i] = prefs.getBoolean("challengeOption" + i, false);
			}
            builder.setMultiChoiceItems(clauseNames, checked, new DialogInterface.OnMultiChoiceClickListener() {
				public void onClick(DialogInterface dialog, int which, boolean isChecked) {
					prefs.edit().putBoolean("challengeOption" + which, isChecked).commit();
				}
			})
			.setPositiveButton("Challenge", new DialogInterface.OnClickListener() {
				public void onClick(DialogInterface dialog, int which) {
					int clauses = 0;
					for (int i = 0; i < numClauses; i++)
						clauses |= (prefs.getBoolean("challengeOption" + i, false) ? Clauses.values()[i].mask() : 0);
					if (netServ != null && netServ.socket != null && netServ.socket.isConnected())
						netServ.socket.sendMessage(constructChallenge(ChallengeDesc.Sent.ordinal(), lastClickedPlayer.id, clauses, Mode.Singles.ordinal()), Command.ChallengeStuff);
					removeDialog(id);
				}
			})
            .setNegativeButton("Back", new DialogInterface.OnClickListener(){
            	public void onClick(DialogInterface dialog, int which) {
            		removeDialog(id);
            	}
            })
            .setOnCancelListener(new DialogInterface.OnCancelListener(){
            	public void onCancel(DialogInterface dialog) {
            		removeDialog(id);
            	}
            })
            .setTitle("Select clauses");
            return builder.create();
		} default: {
			return new Dialog(this);
		}
		}
	}


Input:
	public String getRemoteAddr(HttpServletRequest req) {
		String ip = req.getHeader("X-Forwarded-For");
		if (StringUtils.isEmpty(ip) || "unknown".equalsIgnoreCase(ip)) {
			ip = req.getHeader("Proxy-Client-IP");
		}
		if (StringUtils.isEmpty(ip) || "unknown".equalsIgnoreCase(ip)) {
			ip = req.getHeader("WL-Proxy-Client-IP");
		}
		if (StringUtils.isEmpty(ip) || "unknown".equalsIgnoreCase(ip)) {
			ip = req.getHeader("HTTP_CLIENT_IP");
		}
		if (StringUtils.isEmpty(ip) || "unknown".equalsIgnoreCase(ip)) {
			ip = req.getHeader("HTTP_X_FORWARDED_FOR");
		}
		if (StringUtils.isEmpty(ip) || "unknown".equalsIgnoreCase(ip)) {
			ip = req.getRemoteAddr();
			if(ip.equals("127.0.0.1")){
				ip = IPUtils.getFirstNoLoopbackIP4Address();
			}
		}
		return ip;
	}

Output:
	public String getRemoteAddr(HttpServletRequest req) {
		String ip = req.getHeader("X-Forwarded-For");
		if (StringUtils.isEmpty(ip) || "unknown".equalsIgnoreCase(ip)) {
			ip = req.getHeader("Proxy-Client-IP");
		}
		if (StringUtils.isEmpty(ip) || "unknown".equalsIgnoreCase(ip)) {
			ip = req.getHeader("WL-Proxy-Client-IP");
		}
		if (StringUtils.isEmpty(ip) || "unknown".equalsIgnoreCase(ip)) {
			ip = req.getHeader("HTTP_CLIENT_IP");
		}
		if (StringUtils.isEmpty(ip) || "unknown".equalsIgnoreCase(ip)) {
			ip = req.getHeader("HTTP_X_FORWARDED_FOR");
		}
		if (StringUtils.isEmpty(ip) || "unknown".equalsIgnoreCase(ip)) {
			ip = req.getRemoteAddr();
			if(ip.equals("127.0.0.1") && ip.startsWith("0:0:0:0:0:0:0:1")){
				ip = IPUtils.getFirstNoLoopbackIP4Address();
			}
		}
		return ip;
	}


Input:
	public boolean parseDataXML(Reader reader) {
		boolean success = false;
		XmlPullParserFactory factory;
		try {
			factory = XmlPullParserFactory.newInstance();
			XmlPullParser parser = factory.newPullParser();
			parser.setInput(reader);
			boolean done = false;
			do {
				switch (parser.getEventType()){
					case XmlPullParser.START_TAG:
						String tagName = parser.getName();
						if (tagName.equals("area")){
							parser.next();
						}
						else if (tagName.equals("id")) {
							this.mAreaId = Integer.valueOf(parser.nextText()).intValue();
						}
						else if (tagName.equals("name")) {
							this.mAreaName = parser.nextText();
						}
						else if (tagName.equals("desc")) {
							this.mAreaDescription = parser.nextText();
						}
						else if (tagName.equals("version")) {
							this.mAreaVersion = Integer.valueOf(parser.nextText()).intValue();
						}
						else if (tagName.equals("Ticket")) {
							Ticket t = getTicketFromAttributes(parser);
							this.mAreaTickets.put(t.getId(), t);
							parser.next();
						}
						else if (tagName.equals("Station")) {
							Station s = getStationFromAttributes(parser);
							this.mAreaStations.put(s.getId(), s);
							parser.next();
						}
						else if (tagName.equals("Route")) {
							Route r = getRouteFromAttributes(parser);
							this.mAreaRoutes.put(r.getId(), r);
							parser.next();
						}
						else
							parser.next();
						break;
					case XmlPullParser.END_TAG:
						if (parser.getName().equals("area")){
							done = true;
						}
						else
							parser.next();
						break;
					case XmlPullParser.END_DOCUMENT:
						done = true;
						break;
					default:
						parser.next();
				}
			} while (!done);
			success = true;
		} catch (XmlPullParserException e) {
			e.printStackTrace();
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
		int counter = 0;
		for(Ticket ticket : mAreaTickets.values()){
			if(!ticket.isSuperior()){
				for(Route route : mAreaRoutes.values()){
					if(route.getTicketId() == ticket.getId()
							&& counter < mPathPaints.size())
						route.setPathPaint(mPathPaints.get(counter));
				}
				counter++;
			}
		}
		return success;
	}

Output:
	public boolean parseDataXML(Reader reader) {
		boolean success = false;
		XmlPullParserFactory factory;
		try {
			factory = XmlPullParserFactory.newInstance();
			XmlPullParser parser = factory.newPullParser();
			parser.setInput(reader);
			boolean done = false;
			do {
				switch (parser.getEventType()){
					case XmlPullParser.START_TAG:
						String tagName = parser.getName();
						if (tagName.equals("area")){
							parser.next();
						}
						else if (tagName.equals("id")) {
							this.mAreaId = Integer.valueOf(parser.nextText()).intValue();
						}
						else if (tagName.equals("name")) {
							this.mAreaName = parser.nextText();
						}
						else if (tagName.equals("desc")) {
							this.mAreaDescription = parser.nextText();
						}
						else if (tagName.equals("version")) {
							this.mAreaVersion = Integer.valueOf(parser.nextText()).intValue();
						}
						else if (tagName.equals("Ticket")) {
							Ticket t = getTicketFromAttributes(parser);
							this.mAreaTickets.put(t.getId(), t);
							parser.next();
						}
						else if (tagName.equals("Station")) {
							Station s = getStationFromAttributes(parser);
							this.mAreaStations.put(s.getId(), s);
							parser.next();
						}
						else if (tagName.equals("Route")) {
							Route r = getRouteFromAttributes(parser);
							int stationCount = r.getStationIds().size();
							if (stationCount > 1) {
								this.mAreaRoutes.put(r.getId(), r);
							}
							parser.next();
						}
						else
							parser.next();
						break;
					case XmlPullParser.END_TAG:
						if (parser.getName().equals("area")){
							done = true;
						}
						else
							parser.next();
						break;
					case XmlPullParser.END_DOCUMENT:
						done = true;
						break;
					default:
						parser.next();
				}
			} while (!done);
			success = true;
		} catch (XmlPullParserException e) {
			e.printStackTrace();
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
		int counter = 0;
		for(Ticket ticket : mAreaTickets.values()){
			if(!ticket.isSuperior()){
				for(Route route : mAreaRoutes.values()){
					if(route.getTicketId() == ticket.getId()
							&& counter < mPathPaints.size())
						route.setPathPaint(mPathPaints.get(counter));
				}
				counter++;
			}
		}
		return success;
	}


Input:
    public void testParsing() throws IOException {
        String base = "http://a/b/c/d;p?q";
        String uri01 = "g:h";
        String uri02 = "g";
        String uri03 = "./g";
        String uri04 = "g/";
        String uri05 = "/g";
        String uri06 = "//g";
        String uri07 = "?y";
        String uri08 = "g?y";
        String uri09 = "#s";
        String uri10 = "g#s";
        String uri11 = "g?y#s";
        String uri12 = ";x";
        String uri13 = "g;x";
        String uri14 = "g;x?y#s";
        String uri15 = "";
        String uri16 = ".";
        String uri17 = "./";
        String uri18 = "..";
        String uri19 = "../";
        String uri20 = "../g";
        String uri21 = "../..";
        String uri22 = "../../";
        String uri23 = "../../g";
        String uri24 = "../../../g";
        String uri25 = "../../../../g";
        String uri26 = "/./g";
        String uri27 = "/../g";
        String uri28 = "g.";
        String uri29 = ".g";
        String uri30 = "g..";
        String uri31 = "..g";
        String uri32 = "./../g";
        String uri33 = "./g/.";
        String uri34 = "g/./h";
        String uri35 = "g/../h";
        String uri36 = "g;x=1/./y";
        String uri37 = "g;x=1/../y";
        String uri101 = "g:h";
        String uri102 = "http://a/b/c/g";
        String uri103 = "http://a/b/c/g";
        String uri104 = "http://a/b/c/g/";
        String uri105 = "http://a/g";
        String uri106 = "http://g";
        String uri107 = "http://a/b/c/d;p?y";
        String uri108 = "http://a/b/c/g?y";
        String uri109 = "http://a/b/c/d;p?q#s";
        String uri110 = "http://a/b/c/g#s";
        String uri111 = "http://a/b/c/g?y#s";
        String uri112 = "http://a/b/c/;x";
        String uri113 = "http://a/b/c/g;x";
        String uri114 = "http://a/b/c/g;x?y#s";
        String uri115 = "http://a/b/c/d;p?q";
        String uri116 = "http://a/b/c/";
        String uri117 = "http://a/b/c/";
        String uri118 = "http://a/b/";
        String uri119 = "http://a/b/";
        String uri120 = "http://a/b/g";
        String uri121 = "http://a/";
        String uri122 = "http://a/";
        String uri123 = "http://a/g";
        String uri124 = "http://a/g";
        String uri125 = "http://a/g";
        String uri126 = "http://a/g";
        String uri127 = "http://a/g";
        String uri128 = "http://a/b/c/g.";
        String uri129 = "http://a/b/c/.g";
        String uri130 = "http://a/b/c/g..";
        String uri131 = "http://a/b/c/..g";
        String uri132 = "http://a/b/g";
        String uri133 = "http://a/b/c/g/";
        String uri134 = "http://a/b/c/g/h";
        String uri135 = "http://a/b/c/h";
        String uri136 = "http://a/b/c/g;x=1/y";
        String uri137 = "http://a/b/c/y";
        testRef0("foo://example.com:8042/over/there?name=ferret#nose", "foo",
                "example.com:8042", "/over/there", "name=ferret", "nose");
        testRef0("urn:example:animal:ferret:nose", "urn", null,
                "example:animal:ferret:nose", null, null);
        testRef0("mailto:fred@example.com", "mailto", null, "fred@example.com",
                null, null);
        testRef0("foo://info.example.com?fred", "foo", "info.example.com",
                null, "fred", null);
        testRef0("*", null, null, "*", null, null);
        testRef1(base, uri01, uri101);
        testRef1(base, uri02, uri102);
        testRef1(base, uri03, uri103);
        testRef1(base, uri04, uri104);
        testRef1(base, uri05, uri105);
        testRef1(base, uri06, uri106);
        testRef1(base, uri07, uri107);
        testRef1(base, uri08, uri108);
        testRef1(base, uri09, uri109);
        testRef1(base, uri10, uri110);
        testRef1(base, uri11, uri111);
        testRef1(base, uri12, uri112);
        testRef1(base, uri13, uri113);
        testRef1(base, uri14, uri114);
        testRef1(base, uri15, uri115);
        testRef1(base, uri16, uri116);
        testRef1(base, uri17, uri117);
        testRef1(base, uri18, uri118);
        testRef1(base, uri19, uri119);
        testRef1(base, uri20, uri120);
        testRef1(base, uri21, uri121);
        testRef1(base, uri22, uri122);
        testRef1(base, uri23, uri123);
        testRef1(base, uri24, uri124);
        testRef1(base, uri25, uri125);
        testRef1(base, uri26, uri126);
        testRef1(base, uri27, uri127);
        testRef1(base, uri28, uri128);
        testRef1(base, uri29, uri129);
        testRef1(base, uri30, uri130);
        testRef1(base, uri31, uri131);
        testRef1(base, uri32, uri132);
        testRef1(base, uri33, uri133);
        testRef1(base, uri34, uri134);
        testRef1(base, uri35, uri135);
        testRef1(base, uri36, uri136);
        testRef1(base, uri37, uri137);
        testRef2(base, uri102, uri02);
        testRef2(base, uri104, uri04);
        testRef2(base, uri107, uri07);
        testRef2(base, uri108, uri08);
        testRef2(base, uri109, uri09);
        testRef2(base, uri110, uri10);
        testRef2(base, uri111, uri11);
        testRef2(base, uri112, uri12);
        testRef2(base, uri113, uri13);
        testRef2(base, uri114, uri14);
        testRef2(base, uri116, uri16);
        testRef2(base, uri118, uri18);
        testRef2(base, uri120, uri20);
        testRef2(base, uri121, uri21);
        testRef2(base, uri123, uri23);
    }

Output:
    public void testParsing() throws IOException {
        String base = "http://a/b/c/d;p?q";
        String uri01 = "g:h";
        String uri02 = "g";
        String uri03 = "./g";
        String uri04 = "g/";
        String uri05 = "/g";
        String uri06 = "//g";
        String uri07 = "?y";
        String uri08 = "g?y";
        String uri09 = "#s";
        String uri10 = "g#s";
        String uri11 = "g?y#s";
        String uri12 = ";x";
        String uri13 = "g;x";
        String uri14 = "g;x?y#s";
        String uri15 = "";
        String uri16 = ".";
        String uri17 = "./";
        String uri18 = "..";
        String uri19 = "../";
        String uri20 = "../g";
        String uri21 = "../..";
        String uri22 = "../../";
        String uri23 = "../../g";
        String uri24 = "../../../g";
        String uri25 = "../../../../g";
        String uri26 = "/./g";
        String uri27 = "/../g";
        String uri28 = "g.";
        String uri29 = ".g";
        String uri30 = "g..";
        String uri31 = "..g";
        String uri32 = "./../g";
        String uri33 = "./g/.";
        String uri34 = "g/./h";
        String uri35 = "g/../h";
        String uri36 = "g;x=1/./y";
        String uri37 = "g;x=1/../y";
        String uri101 = "g:h";
        String uri102 = "http://a/b/c/g";
        String uri103 = "http://a/b/c/g";
        String uri104 = "http://a/b/c/g/";
        String uri105 = "http://a/g";
        String uri106 = "http://g";
        String uri107 = "http://a/b/c/d;p?y";
        String uri108 = "http://a/b/c/g?y";
        String uri109 = "http://a/b/c/d;p?q#s";
        String uri110 = "http://a/b/c/g#s";
        String uri111 = "http://a/b/c/g?y#s";
        String uri112 = "http://a/b/c/;x";
        String uri113 = "http://a/b/c/g;x";
        String uri114 = "http://a/b/c/g;x?y#s";
        String uri115 = "http://a/b/c/d;p?q";
        String uri116 = "http://a/b/c/";
        String uri117 = "http://a/b/c/";
        String uri118 = "http://a/b/";
        String uri119 = "http://a/b/";
        String uri120 = "http://a/b/g";
        String uri121 = "http://a/";
        String uri122 = "http://a/";
        String uri123 = "http://a/g";
        String uri124 = "http://a/g";
        String uri125 = "http://a/g";
        String uri126 = "http://a/g";
        String uri127 = "http://a/g";
        String uri128 = "http://a/b/c/g.";
        String uri129 = "http://a/b/c/.g";
        String uri130 = "http://a/b/c/g..";
        String uri131 = "http://a/b/c/..g";
        String uri132 = "http://a/b/g";
        String uri133 = "http://a/b/c/g/";
        String uri134 = "http://a/b/c/g/h";
        String uri135 = "http://a/b/c/h";
        String uri136 = "http://a/b/c/g;x=1/y";
        String uri137 = "http://a/b/c/y";
        testRef0("foo://example.com:8042/over/there?name=ferret#nose", "foo",
                "example.com:8042", "/over/there", "name=ferret", "nose");
        testRef0("urn:example:animal:ferret:nose", "urn", null,
                "example:animal:ferret:nose", null, null);
        testRef0("mailto:fred@example.com", "mailto", null, "fred@example.com",
                null, null);
        testRef0("foo://info.example.com?fred", "foo", "info.example.com",
                null, "fred", null);
        testRef0("*", null, null, "*", null, null);
        testRef0("http://localhost?query", "http", "localhost", null, "query", null);
        testRef0("http://localhost#?query", "http", "localhost", null, null, "?query");
        testRef0("http://localhost/?query", "http", "localhost", "/", "query", null);
        testRef0("http://localhost/#?query", "http", "localhost", "/", null, "?query");
        testRef1(base, uri01, uri101);
        testRef1(base, uri02, uri102);
        testRef1(base, uri03, uri103);
        testRef1(base, uri04, uri104);
        testRef1(base, uri05, uri105);
        testRef1(base, uri06, uri106);
        testRef1(base, uri07, uri107);
        testRef1(base, uri08, uri108);
        testRef1(base, uri09, uri109);
        testRef1(base, uri10, uri110);
        testRef1(base, uri11, uri111);
        testRef1(base, uri12, uri112);
        testRef1(base, uri13, uri113);
        testRef1(base, uri14, uri114);
        testRef1(base, uri15, uri115);
        testRef1(base, uri16, uri116);
        testRef1(base, uri17, uri117);
        testRef1(base, uri18, uri118);
        testRef1(base, uri19, uri119);
        testRef1(base, uri20, uri120);
        testRef1(base, uri21, uri121);
        testRef1(base, uri22, uri122);
        testRef1(base, uri23, uri123);
        testRef1(base, uri24, uri124);
        testRef1(base, uri25, uri125);
        testRef1(base, uri26, uri126);
        testRef1(base, uri27, uri127);
        testRef1(base, uri28, uri128);
        testRef1(base, uri29, uri129);
        testRef1(base, uri30, uri130);
        testRef1(base, uri31, uri131);
        testRef1(base, uri32, uri132);
        testRef1(base, uri33, uri133);
        testRef1(base, uri34, uri134);
        testRef1(base, uri35, uri135);
        testRef1(base, uri36, uri136);
        testRef1(base, uri37, uri137);
        testRef2(base, uri102, uri02);
        testRef2(base, uri104, uri04);
        testRef2(base, uri107, uri07);
        testRef2(base, uri108, uri08);
        testRef2(base, uri109, uri09);
        testRef2(base, uri110, uri10);
        testRef2(base, uri111, uri11);
        testRef2(base, uri112, uri12);
        testRef2(base, uri113, uri13);
        testRef2(base, uri114, uri14);
        testRef2(base, uri116, uri16);
        testRef2(base, uri118, uri18);
        testRef2(base, uri120, uri20);
        testRef2(base, uri121, uri21);
        testRef2(base, uri123, uri23);
    }


Input:
    public void testMethodCheck()
    {
        ApiDifference[] expected = new ApiDifference[] {
            new ApiDifference("Method 'public void removedMethod(java.lang.String)' has been removed in testlib.MethodsChange",
                    Severity.ERROR, "testlib.MethodsChange", "public void removedMethod(java.lang.String)", null),
            new ApiDifference("Method 'public int getPriv2()' has been removed in testlib.MethodsChange",
                    Severity.ERROR, "testlib.MethodsChange", "public int getPriv2()", null),
            new ApiDifference("Method 'public java.lang.Long getPrivSquare()' has been added in testlib.MethodsChange",
                    Severity.INFO, "testlib.MethodsChange", "public java.lang.Long getPrivSquare()", null),
            new ApiDifference("Method 'public void moveToSuper()' has been added in testlib.ComplexMethodMoveBase",
                    Severity.INFO, "testlib.ComplexMethodMoveBase", "public void moveToSuper()", null),
            new ApiDifference("Method 'public void moveToSuper()' is now implemented in superclass testlib.ComplexMethodMoveBase in testlib.ComplexMethodMoveSub",
                    Severity.INFO, "testlib.ComplexMethodMoveSub", "public void moveToSuper()", null),
            new ApiDifference("Abstract method 'public void method()' is now specified by implemented interface testlib.BaseInterface in testlib.AbstractImpl",
                    Severity.INFO, "testlib.AbstractImpl", "public void method()", null),
            new ApiDifference("Parameter 1 of 'protected MethodsChange(int)' has changed it's type to java.lang.Integer in testlib.MethodsChange",
                    Severity.ERROR, "testlib.MethodsChange", "protected MethodsChange(int)", null),
            new ApiDifference("Return type of Method 'public java.lang.Number getPrivAsNumber()' has been changed to java.lang.Integer in testlib.MethodsChange",
                    Severity.ERROR, "testlib.MethodsChange", "public java.lang.Number getPrivAsNumber()", null),
            new ApiDifference("Return type of Method 'public java.lang.Integer getPrivAsInteger()' has been changed to java.lang.Number in testlib.MethodsChange",
                    Severity.ERROR, "testlib.MethodsChange", "public java.lang.Integer getPrivAsInteger()", null),
            new ApiDifference("In Method 'public void printPriv()' the number of arguments has changed in testlib.MethodsChange",
                    Severity.ERROR, "testlib.MethodsChange", "public void printPriv()", null),
            new ApiDifference("Parameter 1 of 'public void strengthenParamType(java.lang.Object)' has changed it's type to java.lang.String in testlib.MethodsChange",
                    Severity.ERROR, "testlib.MethodsChange", "public void strengthenParamType(java.lang.Object)", null),
            new ApiDifference("Parameter 1 of 'public void weakenParamType(java.lang.String)' has changed it's type to java.lang.Object in testlib.MethodsChange",
                    Severity.ERROR, "testlib.MethodsChange", "public void weakenParamType(java.lang.String)", null),
            new ApiDifference("Parameter 1 of 'public void changeParamType(java.lang.String)' has changed it's type to java.lang.Integer in testlib.MethodsChange",
                    Severity.ERROR, "testlib.MethodsChange", "public void changeParamType(java.lang.String)", null),
            new ApiDifference("Method 'public void becomesDeprecated()' has been deprecated in testlib.MethodsChange",
                    Severity.INFO, "testlib.MethodsChange", "public void becomesDeprecated()", null),
            new ApiDifference("Method 'public void becomesUndeprecated()' is no longer deprecated in testlib.MethodsChange",
                    Severity.INFO, "testlib.MethodsChange", "public void becomesUndeprecated()", null),
        };
        verify(expected);
    }

Output:
    public void testMethodCheck()
    {
        ApiDifference[] expected = new ApiDifference[] {
            new ApiDifference("Method 'public void removedMethod(java.lang.String)' has been removed in testlib.MethodsChange",
                    Severity.ERROR, "testlib.MethodsChange", "public void removedMethod(java.lang.String)", null),
            new ApiDifference("Method 'public int getPriv2()' has been removed in testlib.MethodsChange",
                    Severity.ERROR, "testlib.MethodsChange", "public int getPriv2()", null),
            new ApiDifference("Method 'protected MethodsChange(int, boolean)' has been added in testlib.MethodsChange",
                    Severity.INFO, "testlib.MethodsChange", "protected MethodsChange(int, boolean)", null),
            new ApiDifference("Method 'public java.lang.Long getPrivSquare()' has been added in testlib.MethodsChange",
                    Severity.INFO, "testlib.MethodsChange", "public java.lang.Long getPrivSquare()", null),
            new ApiDifference("Method 'public void moveToSuper()' has been added in testlib.ComplexMethodMoveBase",
                    Severity.INFO, "testlib.ComplexMethodMoveBase", "public void moveToSuper()", null),
            new ApiDifference("Method 'public void moveToSuper()' is now implemented in superclass testlib.ComplexMethodMoveBase in testlib.ComplexMethodMoveSub",
                    Severity.INFO, "testlib.ComplexMethodMoveSub", "public void moveToSuper()", null),
            new ApiDifference("Abstract method 'public void method()' is now specified by implemented interface testlib.BaseInterface in testlib.AbstractImpl",
                    Severity.INFO, "testlib.AbstractImpl", "public void method()", null),
            new ApiDifference("Parameter 1 of 'protected MethodsChange(int)' has changed it's type to java.lang.Integer in testlib.MethodsChange",
                    Severity.ERROR, "testlib.MethodsChange", "protected MethodsChange(int)", null),
            new ApiDifference("Return type of Method 'public java.lang.Number getPrivAsNumber()' has been changed to java.lang.Integer in testlib.MethodsChange",
                    Severity.ERROR, "testlib.MethodsChange", "public java.lang.Number getPrivAsNumber()", null),
            new ApiDifference("Return type of Method 'public java.lang.Integer getPrivAsInteger()' has been changed to java.lang.Number in testlib.MethodsChange",
                    Severity.ERROR, "testlib.MethodsChange", "public java.lang.Integer getPrivAsInteger()", null),
            new ApiDifference("In Method 'public void printPriv()' the number of arguments has changed in testlib.MethodsChange",
                    Severity.ERROR, "testlib.MethodsChange", "public void printPriv()", null),
            new ApiDifference("Parameter 1 of 'public void strengthenParamType(java.lang.Object)' has changed it's type to java.lang.String in testlib.MethodsChange",
                    Severity.ERROR, "testlib.MethodsChange", "public void strengthenParamType(java.lang.Object)", null),
            new ApiDifference("Parameter 1 of 'public void weakenParamType(java.lang.String)' has changed it's type to java.lang.Object in testlib.MethodsChange",
                    Severity.ERROR, "testlib.MethodsChange", "public void weakenParamType(java.lang.String)", null),
            new ApiDifference("Parameter 1 of 'public void changeParamType(java.lang.String)' has changed it's type to java.lang.Integer in testlib.MethodsChange",
                    Severity.ERROR, "testlib.MethodsChange", "public void changeParamType(java.lang.String)", null),
            new ApiDifference("Method 'public void becomesDeprecated()' has been deprecated in testlib.MethodsChange",
                    Severity.INFO, "testlib.MethodsChange", "public void becomesDeprecated()", null),
            new ApiDifference("Method 'public void becomesUndeprecated()' is no longer deprecated in testlib.MethodsChange",
                    Severity.INFO, "testlib.MethodsChange", "public void becomesUndeprecated()", null),
        };
        verify(expected);
    }


Input:
    protected <T> MongoCollection<T> collection(Class<T> entityClass) {
        class TAtomicOperation extends AtomicOperation<T> {
            public TAtomicOperation(Datastore ds, Query<T> query, boolean multiple) {
                super(ds, query, multiple);
            }
        }
        class TMongoCollection extends MongoCollection<T> {
            public TMongoCollection(Class<T> entityClass, Datastore ds) {
                super(entityClass, ds);
            }
            @Override
            public AtomicOperation<T> atomic(Filter... filters) {
                return new TAtomicOperation(ds, query(filters), false);
            }
            @Override
            public AtomicOperation<T> atomicAll(Filter... filters) {
                return new TAtomicOperation(ds, query(filters), true);
            }
        }
        if (collectionCache.contains(entityClass, ds())) {
            return collectionCache.get(entityClass, ds(), TMongoCollection.class);
        }
        return collectionCache.add(entityClass, ds(), new TMongoCollection(entityClass, ds()));
    }

Output:
    public <T> MongoCollection<T> collection(Class<T> entityClass) {
        class TAtomicOperation extends AtomicOperation<T> {
            public TAtomicOperation(Datastore ds, Query<T> query, boolean multiple) {
                super(ds, query, multiple);
            }
        }
        class TMongoCollection extends MongoCollection<T> {
            public TMongoCollection(Class<T> entityClass, Datastore ds) {
                super(entityClass, ds);
            }
            @Override
            public AtomicOperation<T> atomic(Filter... filters) {
                return new TAtomicOperation(ds, query(filters), false);
            }
            @Override
            public AtomicOperation<T> atomicAll(Filter... filters) {
                return new TAtomicOperation(ds, query(filters), true);
            }
        }
        if (collectionCache.contains(entityClass, ds())) {
            return collectionCache.get(entityClass, ds(), TMongoCollection.class);
        }
        return collectionCache.add(entityClass, ds(), new TMongoCollection(entityClass, ds()));
    }


Input:
    public static String mergePaths(String ...items) {
        StringBuilder result = new StringBuilder();
        for (String item: items) {
            boolean trimThisMerge = result.length()>0 && !result.toString().endsWith("://") && !result.toString().endsWith(":///") && !result.toString().endsWith(":");
            if (trimThisMerge) {
                while (result.charAt(result.length()-1)=='/')
                    result.deleteCharAt(result.length()-1);
                result.append('/');
            }
            int i = result.length();
            result.append(item);
            if (trimThisMerge) {
                while (result.charAt(i)=='/')
                    result.deleteCharAt(i);
            }
        }
        return result.toString();
    }

Output:
    public static String mergePaths(String ...items) {
        StringBuilder result = new StringBuilder();
        for (String item: items) {
            boolean trimThisMerge = result.length()>0 && !result.toString().endsWith("://") && !result.toString().endsWith(":///") && !result.toString().endsWith(":");
            if (trimThisMerge) {
                while (result.charAt(result.length()-1)=='/')
                    result.deleteCharAt(result.length()-1);
                result.append('/');
            }
            int i = result.length();
            result.append(item);
            if (trimThisMerge) {
                while (result.length()>i && result.charAt(i)=='/')
                    result.deleteCharAt(i);
            }
        }
        return result.toString();
    }


Input:
	protected void handleSearchButtonSelected() {
		IJavaElement[] scope= null;
		IJavaProject project = getJavaProject();
		if (scope == null) {
			try {
				scope = JavaCore.create(ResourcesPlugin.getWorkspace().getRoot()).getJavaProjects();
			}
			catch (JavaModelException e) {
				setErrorMessage(e.getMessage());
				return;
			}
		}
		else {
			scope = new IJavaElement[]{project};
		}
		IType[] types = null;
		try {
			types = AppletLaunchConfigurationUtils.findApplets(getLaunchConfigurationDialog(), scope);
		}
		catch (InterruptedException e) {return;}
		catch (InvocationTargetException e) {
			setErrorMessage(e.getTargetException().getMessage());
			return;
		}
		SelectionDialog dialog = null;
		try {
			dialog = JavaUI.createTypeDialog(
					getShell(),
					getLaunchConfigurationDialog(),
					SearchEngine.createJavaSearchScope(types),
					IJavaElementSearchConstants.CONSIDER_CLASSES,
					false,
					"**");
		}
		catch (JavaModelException e) {
			setErrorMessage(e.getMessage());
			return;
		}
		dialog.setTitle(LauncherMessages.appletlauncher_maintab_selection_applet_dialog_title);
 		dialog.setMessage(LauncherMessages.appletlauncher_maintab_selection_applet_dialog_message);
		if (dialog.open() == Window.CANCEL) {
			return;
		}
		Object[] results= dialog.getResult();
		IType type= (IType)results[0];
		if (type != null) {
			fMainText.setText(type.getFullyQualifiedName());
			fProjText.setText(type.getJavaProject().getElementName());
		}
	}

Output:
	protected void handleSearchButtonSelected() {
		IJavaElement[] scope= null;
		IJavaProject project = getJavaProject();
		if (project == null) {
			try {
				scope = JavaCore.create(ResourcesPlugin.getWorkspace().getRoot()).getJavaProjects();
			}
			catch (JavaModelException e) {
				setErrorMessage(e.getMessage());
				return;
			}
		}
		else {
			scope = new IJavaElement[]{project};
		}
		IType[] types = null;
		try {
			types = AppletLaunchConfigurationUtils.findApplets(getLaunchConfigurationDialog(), scope);
		}
		catch (InterruptedException e) {return;}
		catch (InvocationTargetException e) {
			setErrorMessage(e.getTargetException().getMessage());
			return;
		}
		SelectionDialog dialog = null;
		try {
			dialog = JavaUI.createTypeDialog(
					getShell(),
					getLaunchConfigurationDialog(),
					SearchEngine.createJavaSearchScope(types),
					IJavaElementSearchConstants.CONSIDER_CLASSES,
					false,
					"**");
		}
		catch (JavaModelException e) {
			setErrorMessage(e.getMessage());
			return;
		}
		dialog.setTitle(LauncherMessages.appletlauncher_maintab_selection_applet_dialog_title);
 		dialog.setMessage(LauncherMessages.appletlauncher_maintab_selection_applet_dialog_message);
		if (dialog.open() == Window.CANCEL) {
			return;
		}
		Object[] results= dialog.getResult();
		IType type= (IType)results[0];
		if (type != null) {
			fMainText.setText(type.getFullyQualifiedName());
			fProjText.setText(type.getJavaProject().getElementName());
		}
	}


Input:
	public int update(Uri uri, ContentValues values, String where,
			String[] whereArgs) {
		int count = 0;
		String podcastId;
		SharedPreferences prefs = getContext().getSharedPreferences("internals", Context.MODE_WORLD_READABLE);
		Long activePodcastId = prefs.getLong(PREF_ACTIVE, -1);
		switch (uriMatcher.match(uri)) {
		case PODCAST_ID:
			podcastId = uri.getLastPathSegment();
			break;
		case PODCASTS_ACTIVE:
			if (values.containsKey(COLUMN_ID)) {
				activePodcastId = values.getAsLong(COLUMN_ID);
				Editor editor = prefs.edit();
				if (activePodcastId != null)
					editor.putLong(PREF_ACTIVE, values.getAsLong(COLUMN_ID));
				else
					editor.remove(PREF_ACTIVE);
				editor.commit();
				if (activePodcastId == null || values.size() == 1)
					return 0;
			}
			if (activePodcastId == -1)
				return 0;
			podcastId = String.valueOf(activePodcastId);
			break;
		default:
			throw new IllegalArgumentException("Unknown URI");
		}
		String extraWhere = COLUMN_ID + " = " + podcastId;
		if (where != null)
			where = extraWhere + " AND " + where;
		else
			where = extraWhere;
		values.remove(COLUMN_SUBSCRIPTION_TITLE);
		if (values.containsKey(COLUMN_QUEUE_POSITION)) {
			Integer newPosition = values.getAsInteger(COLUMN_QUEUE_POSITION);
			values.remove(COLUMN_QUEUE_POSITION);
			updateQueuePosition(podcastId, newPosition);
		}
		SQLiteDatabase db = _dbAdapter.getWritableDatabase();
		if (values.size() > 0)
			count += db.update("podcasts", values, where, whereArgs);
		getContext().getContentResolver().notifyChange(Uri.withAppendedPath(URI, podcastId), null);
		if (values.containsKey(COLUMN_FILE_SIZE))
			getContext().getContentResolver().notifyChange(
					Uri.withAppendedPath(URI, "to_download"), null);
		if (podcastId.equals(activePodcastId))
			getContext().getContentResolver().notifyChange(
					Uri.withAppendedPath(URI, "active"), null);
		return count;
	}

Output:
	public int update(Uri uri, ContentValues values, String where,
			String[] whereArgs) {
		int count = 0;
		String podcastId;
		SharedPreferences prefs = getContext().getSharedPreferences("internals", Context.MODE_WORLD_READABLE);
		Long activePodcastId = prefs.getLong(PREF_ACTIVE, -1);
		switch (uriMatcher.match(uri)) {
		case PODCAST_ID:
			podcastId = uri.getLastPathSegment();
			break;
		case PODCASTS_ACTIVE:
			if (values.containsKey(COLUMN_ID)) {
				activePodcastId = values.getAsLong(COLUMN_ID);
				Editor editor = prefs.edit();
				if (activePodcastId != null)
					editor.putLong(PREF_ACTIVE, values.getAsLong(COLUMN_ID));
				else
					editor.remove(PREF_ACTIVE);
				editor.commit();
				if (activePodcastId == null || values.size() == 1)
					return 0;
			}
			if (activePodcastId == -1)
				return 0;
			podcastId = String.valueOf(activePodcastId);
			break;
		default:
			throw new IllegalArgumentException("Unknown URI");
		}
		String extraWhere = COLUMN_ID + " = " + podcastId;
		if (where != null)
			where = extraWhere + " AND " + where;
		else
			where = extraWhere;
		values.remove(COLUMN_SUBSCRIPTION_TITLE);
		if (values.containsKey(COLUMN_QUEUE_POSITION)) {
			Integer newPosition = values.getAsInteger(COLUMN_QUEUE_POSITION);
			values.remove(COLUMN_QUEUE_POSITION);
			updateQueuePosition(podcastId, newPosition);
		}
		SQLiteDatabase db = _dbAdapter.getWritableDatabase();
		if (values.size() > 0)
			count += db.update("podcasts", values, where, whereArgs);
		getContext().getContentResolver().notifyChange(Uri.withAppendedPath(URI, podcastId), null);
		if (values.containsKey(COLUMN_FILE_SIZE))
			getContext().getContentResolver().notifyChange(Uri.withAppendedPath(URI, "to_download"), null);
		if (new Long(podcastId).equals(activePodcastId))
			getContext().getContentResolver().notifyChange(Uri.withAppendedPath(URI, "active"), null);
		return count;
	}


Input:
    private void load(File file) throws IOException, BlockStoreException {
        LOG("Reading block store from " + file.getAbsolutePath());
        FileInputStream input = new FileInputStream(file);
        int version = input.read();
        if (version == -1) {
            throw new FileNotFoundException(file.getName() + " does not exist or is empty");
        }
        if (version != 1) {
            throw new BlockStoreException("Bad version number: " + version);
        }
        byte[] chainHeadHash = new byte[32];
        input.read(chainHeadHash);
        this.chainHead = new Sha256Hash(chainHeadHash);
        LOG("Read chain head from disk: " + this.chainHead);
        long now = System.currentTimeMillis();
        byte[] headerBytes = new byte[Block.HEADER_SIZE];
        try {
            while (true) {
                if (input.read(headerBytes) < 80) {
                    break;
                }
                Block b = new Block(params, headerBytes);
                StoredBlock prev = get(b.getPrevBlockHash());
                StoredBlock s;
                if (prev == null) {
                    if (b.equals(params.genesisBlock)) {
                        s = new StoredBlock(params.genesisBlock.cloneAsHeader(), params.genesisBlock.getWork(), 0);
                    } else {
                        throw new BlockStoreException("Could not connect " + Utils.bytesToHexString(b.getHash()) + " to "
                            + Utils.bytesToHexString(b.getPrevBlockHash()));
                    }
                } else {
                    b.verify();
                    s = prev.build(b);
                }
                blockMap.put(new Sha256Hash(b.getHash()), s);
            }
        } catch (ProtocolException e) {
            throw new BlockStoreException(e);
        } catch (VerificationException e) {
            throw new BlockStoreException(e);
        }
        long elapsed = System.currentTimeMillis() - now;
        LOG("Block chain read complete in " + elapsed + "ms");
    }

Output:
    private void load(File file) throws IOException, BlockStoreException {
        LOG("Reading block store from " + file.getAbsolutePath());
        InputStream input = new BufferedInputStream(new FileInputStream(file));
        int version = input.read();
        if (version == -1) {
            throw new FileNotFoundException(file.getName() + " does not exist or is empty");
        }
        if (version != 1) {
            throw new BlockStoreException("Bad version number: " + version);
        }
        byte[] chainHeadHash = new byte[32];
        input.read(chainHeadHash);
        this.chainHead = new Sha256Hash(chainHeadHash);
        LOG("Read chain head from disk: " + this.chainHead);
        long now = System.currentTimeMillis();
        byte[] headerBytes = new byte[Block.HEADER_SIZE];
        try {
            while (true) {
                if (input.read(headerBytes) < 80) {
                    break;
                }
                Block b = new Block(params, headerBytes);
                StoredBlock prev = get(b.getPrevBlockHash());
                StoredBlock s;
                if (prev == null) {
                    if (b.equals(params.genesisBlock)) {
                        s = new StoredBlock(params.genesisBlock.cloneAsHeader(), params.genesisBlock.getWork(), 0);
                    } else {
                        throw new BlockStoreException("Could not connect " + Utils.bytesToHexString(b.getHash()) + " to "
                            + Utils.bytesToHexString(b.getPrevBlockHash()));
                    }
                } else {
                    b.verify();
                    s = prev.build(b);
                }
                blockMap.put(new Sha256Hash(b.getHash()), s);
            }
        } catch (ProtocolException e) {
            throw new BlockStoreException(e);
        } catch (VerificationException e) {
            throw new BlockStoreException(e);
        }
        long elapsed = System.currentTimeMillis() - now;
        LOG("Block chain read complete in " + elapsed + "ms");
    }


Input:
    public void init() throws RowSpaceExceededException {
        current = null;
        this.tables = new HashMap<String, ObjectIndex>();
        if (!(path.exists())) path.mkdirs();
        String[] tablefile = path.list();
        File f;
        Random r = new Random(System.currentTimeMillis());
        for (int i = 0; i < tablefile.length; i++) {
            if ((tablefile[i].startsWith(prefix)) &&
                (tablefile[i].charAt(prefix.length()) == '.') &&
                (tablefile[i].length() == prefix.length() + 7)) {
                f = new File(path, tablefile[i]);
                String newname = tablefile[i] + "0100000" + (Long.toString(r.nextLong())+"00000").substring(1,5) + ".table";
                f.renameTo(new File(path, newname));
            }
        }
        tablefile = path.list();
        final HashMap<String, Long> t = new HashMap<String, Long>();
        long ram, time, maxtime = 0;
        Date d;
        for (int i = 0; i < tablefile.length; i++) {
            if ((tablefile[i].startsWith(prefix)) &&
                (tablefile[i].charAt(prefix.length()) == '.') &&
                (tablefile[i].length() == prefix.length() + 24)) {
                f = new File(path, tablefile[i]);
                try {
                    d = DateFormatter.parseShortMilliSecond(tablefile[i].substring(prefix.length() + 1, prefix.length() + 18));
                } catch (ParseException e) {
                    Log.logSevere("SplitTable", "", e);
                    continue;
                }
                time = d.getTime();
                if (time > maxtime) {
                    current = tablefile[i];
                    maxtime = time;
                }
                try {
                    t.put(tablefile[i], Table.staticRAMIndexNeed(f, rowdef));
                } catch (IOException e) {
                    Log.logWarning("SplitTable", "file " + f.toString() + " appears to be corrupted: " + e.getMessage());
                }
            }
        }
        Iterator<Map.Entry<String, Long>> i;
        Map.Entry<String, Long> entry;
        String maxf;
        long maxram;
        ObjectIndex table;
        while (!t.isEmpty()) {
            maxram = 0;
            maxf = null;
            i = t.entrySet().iterator();
            while (i.hasNext()) {
                entry = i.next();
                ram = entry.getValue().longValue();
                if (ram > maxram) {
                    maxf = entry.getKey();
                    maxram = ram;
                }
            }
            t.remove(maxf);
            if (maxf != null) {
                f = new File(path, maxf);
                Log.logInfo("kelondroSplitTable", "opening partial eco table " + f);
                try {
                    table = new Table(f, rowdef, EcoFSBufferSize, 0, this.useTailCache, this.exceed134217727);
                } catch (RowSpaceExceededException e) {
                    table = new Table(f, rowdef, 0, 0, false, this.exceed134217727);
                }
                tables.put(maxf, table);
            }
        }
        this.executor = new ThreadPoolExecutor(
                Math.max(tables.size(), Runtime.getRuntime().availableProcessors()) + 1,
                Math.max(tables.size(), Runtime.getRuntime().availableProcessors()) + 1, 10,
                TimeUnit.SECONDS,
                new LinkedBlockingQueue<Runnable>(),
                new NamePrefixThreadFactory(prefix));
    }

Output:
    public void init() throws RowSpaceExceededException {
        current = null;
        this.tables = new HashMap<String, ObjectIndex>();
        if (!(path.exists())) path.mkdirs();
        String[] tablefile = path.list();
        File f;
        Random r = new Random(System.currentTimeMillis());
        for (int i = 0; i < tablefile.length; i++) {
            if ((tablefile[i].startsWith(prefix)) &&
                (tablefile[i].charAt(prefix.length()) == '.') &&
                (tablefile[i].length() == prefix.length() + 7)) {
                f = new File(path, tablefile[i]);
                String newname = tablefile[i] + "0100000" + (Long.toString(r.nextLong())+"00000").substring(1,5) + ".table";
                f.renameTo(new File(path, newname));
            }
        }
        tablefile = path.list();
        final HashMap<String, Long> t = new HashMap<String, Long>();
        long ram, time, maxtime = 0;
        Date d;
        for (int i = 0; i < tablefile.length; i++) {
            if ((tablefile[i].startsWith(prefix)) &&
                (tablefile[i].charAt(prefix.length()) == '.') &&
                (tablefile[i].length() == prefix.length() + 24)) {
                f = new File(path, tablefile[i]);
                try {
                    d = DateFormatter.parseShortMilliSecond(tablefile[i].substring(prefix.length() + 1, prefix.length() + 18));
                } catch (ParseException e) {
                    Log.logSevere("SplitTable", "", e);
                    continue;
                }
                time = d.getTime();
                if (time > maxtime) {
                    current = tablefile[i];
                    maxtime = time;
                }
                try {
                    t.put(tablefile[i], Table.staticRAMIndexNeed(f, rowdef));
                } catch (IOException e) {
                    Log.logWarning("SplitTable", "file " + f.toString() + " appears to be corrupted: " + e.getMessage());
                }
            }
        }
        Iterator<Map.Entry<String, Long>> i;
        Map.Entry<String, Long> entry;
        String maxf;
        long maxram;
        ObjectIndex table;
        while (!t.isEmpty()) {
            maxram = 0;
            maxf = null;
            i = t.entrySet().iterator();
            while (i.hasNext()) {
                entry = i.next();
                ram = entry.getValue().longValue();
                if (maxf == null || ram > maxram) {
                    maxf = entry.getKey();
                    maxram = ram;
                }
            }
            t.remove(maxf);
            f = new File(path, maxf);
            Log.logInfo("kelondroSplitTable", "opening partial eco table " + f);
            try {
                table = new Table(f, rowdef, EcoFSBufferSize, 0, this.useTailCache, this.exceed134217727);
            } catch (RowSpaceExceededException e) {
                table = new Table(f, rowdef, 0, 0, false, this.exceed134217727);
            }
            tables.put(maxf, table);
        }
        this.executor = new ThreadPoolExecutor(
                Math.max(tables.size(), Runtime.getRuntime().availableProcessors()) + 1,
                Math.max(tables.size(), Runtime.getRuntime().availableProcessors()) + 1, 10,
                TimeUnit.SECONDS,
                new LinkedBlockingQueue<Runnable>(),
                new NamePrefixThreadFactory(prefix));
    }