Input:
    void readFolderList () throws IOException {
        String tag = writeCommand(mWriter, "list \"\" *");
        String line;
        char dchar = '/';
        userLog("Loading folder list...");
        ArrayList<String> parentList = new ArrayList<String>();
        ArrayList<Mailbox> mailboxList = new ArrayList<Mailbox>();
        while (true) {
            line = mReader.readLine();
            userLog(line);
            if (line.startsWith(tag)) {
                break;
            } else {
                Parser p = new Parser(line, 2);
                String cmd = p.parseAtom();
                if (cmd.equalsIgnoreCase("list")) {
                    @SuppressWarnings("unused")
                    String props = p.parseListOrNil();
                    String delim = p.parseString();
                    if (delim == null)
                        delim = "~";
                    if (delim.length() == 1)
                        dchar = delim.charAt(0);
                    String serverId = p.parseStringOrAtom();
                    int lastDelim = serverId.lastIndexOf(delim);
                    String displayName;
                    String parentName;
                    if (lastDelim > 0) {
                        displayName = serverId.substring(lastDelim + 1);
                        parentName = serverId.substring(0, lastDelim);
                    } else {
                        displayName = serverId;
                        parentName = null;
                    }
                    Mailbox m = new Mailbox();
                    m.mDisplayName = displayName;
                    m.mAccountKey = mAccountId;
                    m.mServerId = serverId;
                    if (parentName != null && !parentList.contains(parentName)) {
                        parentList.add(parentName);
                    }
                    m.mFlagVisible = true;
                    m.mParentServerId = parentName;
                    m.mDelimiter = dchar;
                    m.mSyncInterval = Mailbox.CHECK_INTERVAL_NEVER;
                    mailboxList.add(m);
                } else {
                }
            }
        }
        Cursor c = mResolver.query(Mailbox.CONTENT_URI, Mailbox.CONTENT_PROJECTION,
                Mailbox.ACCOUNT_KEY + "=?", new String[] {Long.toString(mAccountId)},
                MailboxColumns.SERVER_ID + " asc");
        if (c == null) return;
        int cnt = c.getCount();
        String[] serverIds = new String[cnt];
        long[] uidvals = new long[cnt];
        long[] ids = new long[cnt];
        int i = 0;
        try {
            if (c.moveToFirst()) {
                do {
                    serverIds[i] = c.getString(Mailbox.CONTENT_SERVER_ID_COLUMN);
                    uidvals[i] = c.getLong(Mailbox.CONTENT_SYNC_KEY_COLUMN);
                    ids[i] = c.getLong(Mailbox.CONTENT_ID_COLUMN);
                    i++;
                } while (c.moveToNext());
            }
        } finally {
            c.close();
        }
        ArrayList<Mailbox> addList = new ArrayList<Mailbox>();
        for (Mailbox m: mailboxList) {
            int loc = Arrays.binarySearch(serverIds, m.mServerId);
            if (loc >= 0) {
                if (uidvals[loc] == 0) {
                    uidvals[loc] = -1;
                } else {
                    uidvals[loc] = -1;
                }
            } else {
                addList.add(m);
            }
        }
        ArrayList<ContentProviderOperation> ops = new ArrayList<ContentProviderOperation>();
        try {
            for (i = 0; i < cnt; i++) {
                String name = serverIds[i];
                long uidval = uidvals[i];
                if (uidval == 0 && !name.equals("Outbox") &&
                        !name.equalsIgnoreCase(INBOX_SERVER_NAME)) {
                    ops.add(ContentProviderOperation.newDelete(ContentUris.withAppendedId(
                            Mailbox.CONTENT_URI, ids[i])).build());
                    userLog("Deleting unseen mailbox; no match: " + name);
                } else if (uidval > 0 && !name.equalsIgnoreCase(INBOX_SERVER_NAME)) {
                    boolean found = false;
                    for (Mailbox m : addList) {
                        tag = writeCommand(mWriter, "status \"" + m.mServerId + "\" (UIDVALIDITY)");
                        if (readResponse(mReader, tag, "STATUS").equals(IMAP_OK)) {
                            String str = mImapResponse.get(0).toLowerCase();
                            int idx = str.indexOf("uidvalidity");
                            long num = readLong(str, idx + 12);
                            if (uidval == num) {
                                found = true;
                                break;
                            }
                        }
                    }
                    if (!found) {
                        ops.add(ContentProviderOperation.newDelete(ContentUris.withAppendedId(
                                Mailbox.CONTENT_URI, ids[i])).build());
                        userLog("Deleting uidval mailbox; no match: " + name);
                    }
                }
            }
            for (Mailbox m : addList) {
                String serverId = m.mServerId;
                if (serverId == null)
                    continue;
                if (!serverId.equalsIgnoreCase(INBOX_SERVER_NAME)
                        && !serverId.equalsIgnoreCase("Outbox")) {
                    m.mHierarchicalName = m.mServerId;
                    m.mType = Mailbox.TYPE_MAIL;
                    ops.add(ContentProviderOperation.newInsert(
                            Mailbox.CONTENT_URI).withValues(m.toContentValues()).build());
                    userLog("Adding new mailbox: " + m.mServerId);
                }
            }
            applyBatch(ops);
            MailboxUtilities.fixupUninitializedParentKeys(mContext,
                    Mailbox.ACCOUNT_KEY + "=" + mAccountId);
        } finally {
            SyncManager.kick("folder list");
        }
    }

Output:
    void readFolderList () throws IOException {
        String tag = writeCommand(mWriter, "list \"\" *");
        String line;
        char dchar = '/';
        userLog("Loading folder list...");
        ArrayList<String> parentList = new ArrayList<String>();
        ArrayList<Mailbox> mailboxList = new ArrayList<Mailbox>();
        while (true) {
            line = mReader.readLine();
            userLog(line);
            if (line.startsWith(tag)) {
                break;
            } else {
                Parser p = new Parser(line, 2);
                String cmd = p.parseAtom();
                if (cmd.equalsIgnoreCase("list")) {
                    @SuppressWarnings("unused")
                    String props = p.parseListOrNil();
                    String delim = p.parseString();
                    if (delim == null)
                        delim = "~";
                    if (delim.length() == 1)
                        dchar = delim.charAt(0);
                    String serverId = p.parseStringOrAtom();
                    int lastDelim = serverId.lastIndexOf(delim);
                    String displayName;
                    String parentName;
                    if (lastDelim > 0) {
                        displayName = serverId.substring(lastDelim + 1);
                        parentName = serverId.substring(0, lastDelim);
                    } else {
                        displayName = serverId;
                        parentName = null;
                    }
                    Mailbox m = new Mailbox();
                    m.mDisplayName = decodeFolderName(displayName, null);
                    m.mAccountKey = mAccountId;
                    m.mServerId = decodeFolderName(serverId, null);
                    if (parentName != null && !parentList.contains(parentName)) {
                        parentList.add(parentName);
                    }
                    m.mFlagVisible = true;
                    m.mParentServerId = parentName;
                    m.mDelimiter = dchar;
                    m.mSyncInterval = Mailbox.CHECK_INTERVAL_NEVER;
                    mailboxList.add(m);
                } else {
                }
            }
        }
        Cursor c = mResolver.query(Mailbox.CONTENT_URI, Mailbox.CONTENT_PROJECTION,
                Mailbox.ACCOUNT_KEY + "=?", new String[] {Long.toString(mAccountId)},
                MailboxColumns.SERVER_ID + " asc");
        if (c == null) return;
        int cnt = c.getCount();
        String[] serverIds = new String[cnt];
        long[] uidvals = new long[cnt];
        long[] ids = new long[cnt];
        int i = 0;
        try {
            if (c.moveToFirst()) {
                do {
                    serverIds[i] = c.getString(Mailbox.CONTENT_SERVER_ID_COLUMN);
                    uidvals[i] = c.getLong(Mailbox.CONTENT_SYNC_KEY_COLUMN);
                    ids[i] = c.getLong(Mailbox.CONTENT_ID_COLUMN);
                    i++;
                } while (c.moveToNext());
            }
        } finally {
            c.close();
        }
        ArrayList<Mailbox> addList = new ArrayList<Mailbox>();
        for (Mailbox m: mailboxList) {
            int loc = Arrays.binarySearch(serverIds, m.mServerId);
            if (loc >= 0) {
                if (uidvals[loc] == 0) {
                    uidvals[loc] = -1;
                } else {
                    uidvals[loc] = -1;
                }
            } else {
                addList.add(m);
            }
        }
        ArrayList<ContentProviderOperation> ops = new ArrayList<ContentProviderOperation>();
        try {
            for (i = 0; i < cnt; i++) {
                String name = serverIds[i];
                long uidval = uidvals[i];
                if (uidval == 0 && !name.equals("Outbox") &&
                        !name.equalsIgnoreCase(INBOX_SERVER_NAME)) {
                    ops.add(ContentProviderOperation.newDelete(ContentUris.withAppendedId(
                            Mailbox.CONTENT_URI, ids[i])).build());
                    userLog("Deleting unseen mailbox; no match: " + name);
                } else if (uidval > 0 && !name.equalsIgnoreCase(INBOX_SERVER_NAME)) {
                    boolean found = false;
                    for (Mailbox m : addList) {
                        tag = writeCommand(mWriter, "status \"" + m.mServerId + "\" (UIDVALIDITY)");
                        if (readResponse(mReader, tag, "STATUS").equals(IMAP_OK)) {
                            String str = mImapResponse.get(0).toLowerCase();
                            int idx = str.indexOf("uidvalidity");
                            long num = readLong(str, idx + 12);
                            if (uidval == num) {
                                found = true;
                                break;
                            }
                        }
                    }
                    if (!found) {
                        ops.add(ContentProviderOperation.newDelete(ContentUris.withAppendedId(
                                Mailbox.CONTENT_URI, ids[i])).build());
                        userLog("Deleting uidval mailbox; no match: " + name);
                    }
                }
            }
            for (Mailbox m : addList) {
                String serverId = m.mServerId;
                if (serverId == null)
                    continue;
                if (!serverId.equalsIgnoreCase(INBOX_SERVER_NAME)
                        && !serverId.equalsIgnoreCase("Outbox")) {
                    m.mHierarchicalName = m.mServerId;
                    m.mType = Mailbox.TYPE_MAIL;
                    ops.add(ContentProviderOperation.newInsert(
                            Mailbox.CONTENT_URI).withValues(m.toContentValues()).build());
                    userLog("Adding new mailbox: " + m.mServerId);
                }
            }
            applyBatch(ops);
            MailboxUtilities.fixupUninitializedParentKeys(mContext,
                    Mailbox.ACCOUNT_KEY + "=" + mAccountId);
        } finally {
            SyncManager.kick("folder list");
        }
    }


Input:
	public void doOpen(final URI uri) {
		IFile file = getContainingResourceSetFile(uri);
		IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
		IEditorPart openEditor = null;
		try {
			if (file != null) {
				openEditor = IDE.openEditor(page, file);
			} else if (uri.isArchive()) {
				IEditorInput input = new XtextReadonlyEditorInput(new ReadonlyArchiveStorage(uri));
				openEditor = IDE.openEditor(page, input, PlatformUI.getWorkbench().getEditorRegistry()
						.getDefaultEditor(uri.lastSegment()).getId());
			} else {
				URL url = FileLocator.toFileURL(new URL(uri.scheme()+ ":" +uri.devicePath()));
				URI urlAsUri = URI.createURI(url.toString());
				String path = urlAsUri.toFileString();
				File ioFile = new File(path);
				IEditorInput input = new XtextReadonlyEditorInput(new ReadonlyFileStorage(ioFile, uri));
				openEditor = IDE.openEditor(page, input, PlatformUI.getWorkbench().getEditorRegistry()
						.getDefaultEditor(uri.lastSegment()).getId());
			}
		} catch (PartInitException partInitException) {
			logger.error("Error while opening editor part for EMF URI '" + uri + "'",
					partInitException);
		} catch (IOException e) {
			logger.error("Error while opening editor part for EMF URI '" + uri + "'", e);
		}
		if (openEditor != null && openEditor instanceof XtextEditor) {
			final XtextEditor edit = (XtextEditor) openEditor;
			if (uri.fragment()!=null) {
				edit.getDocument().readOnly(new UnitOfWork<Object>(){
				public Object exec(XtextResource resource) throws Exception {
					EObject object = resource.getEObject(uri.fragment());
					Region region = locationProvider.getLocation(object);
					edit.selectAndReveal(region.getOffset(),region.getLength());
					return null;
				}});
			}
		} else if (openEditor instanceof ISelectionProvider) {
		}
	}

Output:
	public void doOpen(final URI uri) {
		IFile file = getContainingResourceSetFile(uri);
		IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
		IEditorPart openEditor = null;
		try {
			if (file != null) {
				openEditor = IDE.openEditor(page, file);
			} else if (uri.isArchive()) {
				IEditorInput input = new XtextReadonlyEditorInput(new ReadonlyArchiveStorage(uri));
				openEditor = IDE.openEditor(page, input, PlatformUI.getWorkbench().getEditorRegistry()
						.getDefaultEditor(uri.lastSegment()).getId());
			} else {
				URL url = FileLocator.toFileURL(new URL(uri.scheme()+ ":" +uri.devicePath()));
				URI urlAsUri = URI.createURI(url.toString());
				String path = urlAsUri.toFileString();
				if (path != null) {
					File ioFile = new File(path);
					IEditorInput input = new XtextReadonlyEditorInput(new ReadonlyFileStorage(ioFile, uri));
					openEditor = IDE.openEditor(page, input, PlatformUI.getWorkbench().getEditorRegistry()
							.getDefaultEditor(uri.lastSegment()).getId());
				}
			}
		} catch (PartInitException partInitException) {
			logger.error("Error while opening editor part for EMF URI '" + uri + "'",
					partInitException);
		} catch (IOException e) {
			logger.error("Error while opening editor part for EMF URI '" + uri + "'", e);
		}
		if (openEditor != null && openEditor instanceof XtextEditor) {
			final XtextEditor edit = (XtextEditor) openEditor;
			if (uri.fragment()!=null) {
				edit.getDocument().readOnly(new UnitOfWork<Object>(){
				public Object exec(XtextResource resource) throws Exception {
					EObject object = resource.getEObject(uri.fragment());
					Region region = locationProvider.getLocation(object);
					edit.selectAndReveal(region.getOffset(),region.getLength());
					return null;
				}});
			}
		} else if (openEditor instanceof ISelectionProvider) {
		}
	}


Input:
	public boolean inject(World world, EntityLiving entity, ItemStack syringe)
	{
		if(world.rand.nextInt(100) < 5)
		{
			Entity e;
			if(entity instanceof EntityPig)
			{
				e = new EntityZombie(world);
			}
			else
			{
				e = new EntityPigZombie(world);
			}
			e.setLocationAndAngles(entity.posX, entity.posY, entity.posZ, entity.rotationYaw, entity.rotationPitch);
			world.spawnEntityInWorld(e);
			entity.setDead();
		}
		else
		{
			((EntityAgeable)entity).setGrowingAge(0);
		}
		return true;
	}

Output:
	public boolean inject(World world, EntityLiving entity, ItemStack syringe)
	{
		if(world.rand.nextInt(100) < 5)
		{
			Entity e;
			if(entity instanceof EntityPig)
			{
				e = new EntityPigZombie(world);
			}
			else
			{
				e = new EntityZombie(world);
			}
			e.setLocationAndAngles(entity.posX, entity.posY, entity.posZ, entity.rotationYaw, entity.rotationPitch);
			world.spawnEntityInWorld(e);
			entity.setDead();
		}
		else
		{
			((EntityAgeable)entity).setGrowingAge(0);
		}
		return true;
	}


Input:
	public void issue(Database db, ServerCredentials cred) throws APIException {
		URI uri;
		if (!query.contains("key=") && key != null) {
			String suffix = (query.contains("?")) ? "&key="+key : "?key="+key;
			query = query + suffix;
		}
		method = method.toLowerCase();
		Log.i(TAG, "Request "+ method +": " + query);
		try {
			uri = new URI(query);
		} catch (URISyntaxException e1) {
			throw new APIException(APIException.INVALID_URI, "Invalid URI: "+query, this);
		}
		HttpClient client = new DefaultHttpClient();
		client.getParams().setParameter("http.protocol.expect-continue", false);
		client.getParams().setParameter("http.protocol.content-charset", "UTF-8");
		HttpGet get = new HttpGet(uri);
		HttpPost post = new HttpPost(uri);
		HttpPut put = new HttpPut(uri);
		HttpDelete delete = new HttpDelete(uri);
		if ("post".equals(method) || "put".equals(method)) {
			if(ifMatch != null) {
				post.setHeader("If-Match", ifMatch);
				put.setHeader("If-Match", ifMatch);
			}
			if(contentType != null) {
				post.setHeader("Content-Type", contentType);
				put.setHeader("Content-Type", contentType);
			}
			if (body != null) {
				Log.d(TAG, "Request body: "+body);
				StringEntity entity;
				try {
					entity = new StringEntity(body,"UTF-8");
				} catch (UnsupportedEncodingException e) {
					throw new APIException(APIException.INVALID_UUID,
							"UnsupportedEncodingException. This shouldn't " +
							"be possible-- UTF-8 is certainly supported", this);
				}
				post.setEntity(entity);
				put.setEntity(entity);
			}
		}
		if ("get".equals(method)) {
			if(contentType != null) {
				get.setHeader("Content-Type", contentType);
			}
		}
		if ("xml".equals(disposition)) {
			XMLResponseParser parse = new XMLResponseParser(this);
			if (type == ITEM_NEW
					|| type == ITEM_ATTACHMENT_NEW) {
				parse.update(updateType, updateKey);
			}
			try {
				HttpResponse hr;
				if ("post".equals(method)) {
					hr = client.execute(post);
				} else if ("put".equals(method)) {
					hr = client.execute(put);
				} else {
					if (!"get".equals(method)) {
						throw new APIException(APIException.INVALID_METHOD,
								"Unexpected method: "+method, this);
					}
					hr = client.execute(get);
				}
				status = hr.getStatusLine().getStatusCode();
				Log.d(TAG, status + " : "+ hr.getStatusLine().getReasonPhrase());
				if (status < 400) {
					HttpEntity he = hr.getEntity();
					InputStream in = he.getContent();
					parse.setInputStream(in);
					int mode = ("put".equals(method) || type == APIRequest.ITEM_BY_KEY) ?
							XMLResponseParser.MODE_ENTRY : XMLResponseParser.MODE_FEED;
					try {
						parse.parse(mode, uri.toString(), db);
					} catch (RuntimeException e) {
						throw new RuntimeException("Parser threw exception on request: "+method+" "+query, e);
					}
				} else {
					ByteArrayOutputStream ostream = new ByteArrayOutputStream();
					hr.getEntity().writeTo(ostream);
					Log.e(TAG,"Error Body: "+ ostream.toString());
					Log.e(TAG,"Request Body:"+ body);
					if (status == 412) {
						getHandler().onError(this, APIRequest.HTTP_ERROR_CONFLICT);
					} else {
						Log.e(TAG, "Response status "+status+" : "+ostream.toString());
						getHandler().onError(this, APIRequest.HTTP_ERROR_UNSPECIFIED);
					}
					status = getHttpStatus() + REQ_FAILING;
					recordAttempt(db);
					throw new APIException(APIException.HTTP_ERROR, ostream.toString(), this);
				}
			} catch (IOException e) {
				StringBuilder sb = new StringBuilder();
				for (StackTraceElement el : e.getStackTrace()) {
					sb.append(el.toString()+"\n");
				}
				recordAttempt(db);
				throw new APIException(APIException.HTTP_ERROR,
						"An IOException was thrown: " + sb.toString(), this);
			}
		}
		else {
			BasicResponseHandler brh = new BasicResponseHandler();
			String resp;
			try {
				if ("post".equals(method)) {
					resp = client.execute(post, brh);
				} else if ("put".equals(method)) {
					resp = client.execute(put, brh);
				} else if ("delete".equals(method)) {
					resp = client.execute(delete, brh);
				} else {
					if (!"get".equals(method)) {
						throw new APIException(APIException.INVALID_METHOD,
								"Unexpected method: "+method, this);
					}
					resp = client.execute(get, brh);
				}
			} catch (IOException e) {
				StringBuilder sb = new StringBuilder();
				for (StackTraceElement el : e.getStackTrace()) {
					sb.append(el.toString()+"\n");
				}
				recordAttempt(db);
				throw new APIException(APIException.HTTP_ERROR,
						"An IOException was thrown: " + sb.toString(), this);
			}
			if ("raw".equals(disposition)) {
				String[] keys = resp.split("\n");
				ArrayList<String> missing = new ArrayList<String>();
				if (type == ITEMS_ALL ||
						type == ITEMS_FOR_COLLECTION) {
            		int colloc = query.indexOf("/collections/");
            		int itemloc = query.indexOf("/items");
					ItemCollection coll = ItemCollection.load(
							query.substring(colloc+13, itemloc), db);
					if (coll != null) {
						coll.loadChildren(db);
						ArrayList<String> keyAL = new ArrayList<String>(Arrays.asList(keys));
						ArrayList<Item> notThere = coll.notInKeys(keyAL);
						for (Item i : notThere) {
							coll.remove(i, true, db);
						}
					}
					ArrayList<Item> recd = new ArrayList<Item>();
					for (int j = 0; j < keys.length; j++) {
						Item got = Item.load(keys[j], db);
						if (got == null) {
							missing.add(keys[j]);
						} else {
							if (coll != null) coll.add(got, true, db);
							recd.add(got);
						}
					}
					if (coll != null) {
						coll.saveChildren(db);
						coll.save(db);
					}
					Log.d(TAG, "Received "+keys.length+" keys, "+missing.size() + " missing ones");
					Log.d(TAG, "Have "+(double) recd.size() / keys.length + " of list");
					if (recd.size() == keys.length) {
						Log.d(TAG, "No new items");
						succeeded(db);
					} else if ((double) recd.size() / keys.length < REREQUEST_CUTOFF) {
						Log.d(TAG, "Requesting full list");
						APIRequest mReq;
						if (type == ITEMS_FOR_COLLECTION) {
							mReq = fetchItems(coll, false, cred);
						} else {
							mReq = fetchItems(false, cred);
						}
						mReq.status = REQ_NEW;
						mReq.save(db);
					} else {
						Log.d(TAG, "Requesting "+missing.size()+" items one by one");
						APIRequest mReq;
						for (String key : missing) {
							mReq = fetchItem(key, cred);
							mReq.status = REQ_NEW;
							mReq.save(db);
						}
						if (type == ITEMS_FOR_COLLECTION) {
							fetchItems(coll, true, cred).save(db);
						}
					}
				} else if (type == ITEMS_CHILDREN) {
            		int itemloc = query.indexOf("/items/");
            		int childloc = query.indexOf("/children");
					Item item = Item.load(
							query.substring(itemloc+7, childloc), db);
					ArrayList<Attachment> recd = new ArrayList<Attachment>();
					for (int j = 0; j < keys.length; j++) {
						Attachment got = Attachment.load(keys[j], db);
						if (got == null) missing.add(keys[j]);
						else recd.add(got);
					}
					if ((double) recd.size() / keys.length < REREQUEST_CUTOFF) {
						APIRequest mReq;
						mReq = cred.prep(children(item));
						mReq.status = REQ_NEW;
						mReq.save(db);
					} else {
						APIRequest mReq;
						for (String key : missing) {
							mReq = fetchItem(key, cred);
							mReq.status = REQ_NEW;
							mReq.save(db);
						}
					}
				}
			} else if ("json".equals(disposition)) {
			} else {
			}
			getHandler().onComplete(this);
		}
	}

Output:
	public void issue(Database db, ServerCredentials cred) throws APIException {
		URI uri;
		if (!query.contains("key=") && key != null) {
			String suffix = (query.contains("?")) ? "&key="+key : "?key="+key;
			query = query + suffix;
		}
		method = method.toLowerCase();
		Log.i(TAG, "Request "+ method +": " + query);
		try {
			uri = new URI(query);
		} catch (URISyntaxException e1) {
			throw new APIException(APIException.INVALID_URI, "Invalid URI: "+query, this);
		}
		HttpClient client = new DefaultHttpClient();
		client.getParams().setParameter("http.protocol.expect-continue", false);
		client.getParams().setParameter("http.protocol.content-charset", "UTF-8");
		HttpGet get = new HttpGet(uri);
		HttpPost post = new HttpPost(uri);
		HttpPut put = new HttpPut(uri);
		HttpDelete delete = new HttpDelete(uri);
		if ("post".equals(method) || "put".equals(method)) {
			if(ifMatch != null) {
				post.setHeader("If-Match", ifMatch);
				put.setHeader("If-Match", ifMatch);
			}
			if(contentType != null) {
				post.setHeader("Content-Type", contentType);
				put.setHeader("Content-Type", contentType);
			}
			if (body != null) {
				Log.d(TAG, "Request body: "+body);
				StringEntity entity;
				try {
					entity = new StringEntity(body,"UTF-8");
				} catch (UnsupportedEncodingException e) {
					throw new APIException(APIException.INVALID_UUID,
							"UnsupportedEncodingException. This shouldn't " +
							"be possible-- UTF-8 is certainly supported", this);
				}
				post.setEntity(entity);
				put.setEntity(entity);
			}
		}
		if ("get".equals(method)) {
			if(contentType != null) {
				get.setHeader("Content-Type", contentType);
			}
		}
		if ("xml".equals(disposition)) {
			XMLResponseParser parse = new XMLResponseParser(this);
			if (type == ITEM_NEW
					|| type == ITEM_ATTACHMENT_NEW) {
				parse.update(updateType, updateKey);
			}
			try {
				HttpResponse hr;
				if ("post".equals(method)) {
					hr = client.execute(post);
				} else if ("put".equals(method)) {
					hr = client.execute(put);
				} else {
					if (!"get".equals(method)) {
						throw new APIException(APIException.INVALID_METHOD,
								"Unexpected method: "+method, this);
					}
					hr = client.execute(get);
				}
				status = hr.getStatusLine().getStatusCode();
				Log.d(TAG, status + " : "+ hr.getStatusLine().getReasonPhrase());
				if (status < 400) {
					HttpEntity he = hr.getEntity();
					InputStream in = he.getContent();
					parse.setInputStream(in);
					int mode = ("put".equals(method) || type == APIRequest.ITEM_BY_KEY) ?
							XMLResponseParser.MODE_ENTRY : XMLResponseParser.MODE_FEED;
					try {
						parse.parse(mode, uri.toString(), db);
					} catch (RuntimeException e) {
						throw new RuntimeException("Parser threw exception on request: "+method+" "+query, e);
					}
				} else {
					ByteArrayOutputStream ostream = new ByteArrayOutputStream();
					hr.getEntity().writeTo(ostream);
					Log.e(TAG,"Error Body: "+ ostream.toString());
					Log.e(TAG,"Request Body:"+ body);
					if (status == 412) {
						getHandler().onError(this, APIRequest.HTTP_ERROR_CONFLICT);
					} else {
						Log.e(TAG, "Response status "+status+" : "+ostream.toString());
						getHandler().onError(this, APIRequest.HTTP_ERROR_UNSPECIFIED);
					}
					status = getHttpStatus() + REQ_FAILING;
					recordAttempt(db);
					throw new APIException(APIException.HTTP_ERROR, ostream.toString(), this);
				}
			} catch (Exception e) {
				StringBuilder sb = new StringBuilder();
				for (StackTraceElement el : e.getStackTrace()) {
					sb.append(el.toString()+"\n");
				}
				recordAttempt(db);
				throw new APIException(APIException.HTTP_ERROR,
						"An IOException was thrown: " + sb.toString(), this);
			}
		}
		else {
			BasicResponseHandler brh = new BasicResponseHandler();
			String resp;
			try {
				if ("post".equals(method)) {
					resp = client.execute(post, brh);
				} else if ("put".equals(method)) {
					resp = client.execute(put, brh);
				} else if ("delete".equals(method)) {
					resp = client.execute(delete, brh);
				} else {
					if (!"get".equals(method)) {
						throw new APIException(APIException.INVALID_METHOD,
								"Unexpected method: "+method, this);
					}
					resp = client.execute(get, brh);
				}
			} catch (IOException e) {
				StringBuilder sb = new StringBuilder();
				for (StackTraceElement el : e.getStackTrace()) {
					sb.append(el.toString()+"\n");
				}
				recordAttempt(db);
				throw new APIException(APIException.HTTP_ERROR,
						"An IOException was thrown: " + sb.toString(), this);
			}
			if ("raw".equals(disposition)) {
				String[] keys = resp.split("\n");
				ArrayList<String> missing = new ArrayList<String>();
				if (type == ITEMS_ALL ||
						type == ITEMS_FOR_COLLECTION) {
            		int colloc = query.indexOf("/collections/");
            		int itemloc = query.indexOf("/items");
					ItemCollection coll = ItemCollection.load(
							query.substring(colloc+13, itemloc), db);
					if (coll != null) {
						coll.loadChildren(db);
						ArrayList<String> keyAL = new ArrayList<String>(Arrays.asList(keys));
						ArrayList<Item> notThere = coll.notInKeys(keyAL);
						for (Item i : notThere) {
							coll.remove(i, true, db);
						}
					}
					ArrayList<Item> recd = new ArrayList<Item>();
					for (int j = 0; j < keys.length; j++) {
						Item got = Item.load(keys[j], db);
						if (got == null) {
							missing.add(keys[j]);
						} else {
							if (coll != null) coll.add(got, true, db);
							recd.add(got);
						}
					}
					if (coll != null) {
						coll.saveChildren(db);
						coll.save(db);
					}
					Log.d(TAG, "Received "+keys.length+" keys, "+missing.size() + " missing ones");
					Log.d(TAG, "Have "+(double) recd.size() / keys.length + " of list");
					if (recd.size() == keys.length) {
						Log.d(TAG, "No new items");
						succeeded(db);
					} else if ((double) recd.size() / keys.length < REREQUEST_CUTOFF) {
						Log.d(TAG, "Requesting full list");
						APIRequest mReq;
						if (type == ITEMS_FOR_COLLECTION) {
							mReq = fetchItems(coll, false, cred);
						} else {
							mReq = fetchItems(false, cred);
						}
						mReq.status = REQ_NEW;
						mReq.save(db);
					} else {
						Log.d(TAG, "Requesting "+missing.size()+" items one by one");
						APIRequest mReq;
						for (String key : missing) {
							mReq = fetchItem(key, cred);
							mReq.status = REQ_NEW;
							mReq.save(db);
						}
						if (type == ITEMS_FOR_COLLECTION) {
							fetchItems(coll, true, cred).save(db);
						}
					}
				} else if (type == ITEMS_CHILDREN) {
            		int itemloc = query.indexOf("/items/");
            		int childloc = query.indexOf("/children");
					Item item = Item.load(
							query.substring(itemloc+7, childloc), db);
					ArrayList<Attachment> recd = new ArrayList<Attachment>();
					for (int j = 0; j < keys.length; j++) {
						Attachment got = Attachment.load(keys[j], db);
						if (got == null) missing.add(keys[j]);
						else recd.add(got);
					}
					if ((double) recd.size() / keys.length < REREQUEST_CUTOFF) {
						APIRequest mReq;
						mReq = cred.prep(children(item));
						mReq.status = REQ_NEW;
						mReq.save(db);
					} else {
						APIRequest mReq;
						for (String key : missing) {
							mReq = fetchItem(key, cred);
							mReq.status = REQ_NEW;
							mReq.save(db);
						}
					}
				}
			} else if ("json".equals(disposition)) {
			} else {
			}
			getHandler().onComplete(this);
		}
	}


Input:
    public void testSetAndGetCommandArgs() throws Exception {
        Command command = new Command();
        Object[] args = new Object[2];
        args[0] = new String("foo");
        args[1] = new Integer(1);
        command.setCommandArgs(args);
        Object[] outArgs = command.getCommandArgs();
        assertEquals("foo", outArgs[0]);
        assertEquals(2, outArgs[1]);
    }

Output:
    public void testSetAndGetCommandArgs() throws Exception {
        Command command = new Command();
        Object[] args = new Object[2];
        args[0] = new String("foo");
        args[1] = new Integer(1);
        command.setCommandArgs(args);
        Object[] outArgs = command.getCommandArgs();
        assertEquals("foo", outArgs[0]);
        assertEquals(1, outArgs[1]);
    }


Input:
	public static XSDatatype getTypeByName( String dataTypeName ) {
		XSDatatype dt = (XSDatatype)builtinType.get(dataTypeName);
		if(dt!=null)	return dt;
		try {
			if( dataTypeName.equals("float") )
				add( builtinType, FloatType.theInstance );
			else
			if( dataTypeName.equals("double") )
				add( builtinType, DoubleType.theInstance );
			else
			if( dataTypeName.equals("duration") )
				add( builtinType, DurationType.theInstance );
			else
			if( dataTypeName.equals("dateTime") )
				add( builtinType, DateTimeType.theInstance );
			else
			if( dataTypeName.equals("time") )
				add( builtinType, TimeType.theInstance );
			else
			if( dataTypeName.equals("date") )
				add( builtinType, DateType.theInstance );
			else
			if( dataTypeName.equals("gYearMonth") )
				add( builtinType, GYearMonthType.theInstance );
			else
			if( dataTypeName.equals("gYear") )
				add( builtinType, GYearType.theInstance );
			else
			if( dataTypeName.equals("gMonthDay") )
				add( builtinType, GMonthDayType.theInstance );
			else
			if( dataTypeName.equals("gDay") )
				add( builtinType, GDayType.theInstance );
			else
			if( dataTypeName.equals("gMonth") )
				add( builtinType, GMonthType.theInstance );
			else
			if( dataTypeName.equals("hexBinary") )
				add( builtinType, HexBinaryType.theInstance );
			else
			if( dataTypeName.equals("base64Binary") )
				add( builtinType, Base64BinaryType.theInstance );
			else
			if( dataTypeName.equals("anyURI") )
				add( builtinType, AnyURIType.theInstance );
			else
			if( dataTypeName.equals("entity") )
				add( builtinType, EntityType.theInstance );
			else
			if( dataTypeName.equals("language") )
				add( builtinType, LanguageType.theInstance );
			else
			if( dataTypeName.equals("ENTITIES") )
				add( builtinType, new ListType("ENTITIES",EntityType.theInstance) );
			else
			if( dataTypeName.equals("NMTOKENS") )
				add( builtinType, new ListType("NMTOKENS",NmtokenType.theInstance) );
			else
			if( dataTypeName.equals("NOTATION") )
				add( builtinType, new StringType("NOTATION", WhiteSpaceProcessor.theCollapse) );
			else
			if( dataTypeName.equals("nonPositiveInteger") )
				add( builtinType, NonPositiveIntegerType.theInstance );
			else
			if( dataTypeName.equals("unsignedLong") )
				add( builtinType, UnsignedLongType.theInstance );
			else
			if( dataTypeName.equals("unsignedInt") )
				add( builtinType, UnsignedIntType.theInstance );
			else
			if( dataTypeName.equals("unsignedShort") )
				add( builtinType, UnsignedShortType.theInstance );
			else
			if( dataTypeName.equals("unsignedByte") )
				add( builtinType, UnsignedByteType.theInstance );
		} catch( DatatypeException dte )	{
			throw new Error();
		}
		return (XSDatatype)builtinType.get(dataTypeName);
	}

Output:
	public static XSDatatype getTypeByName( String dataTypeName ) {
		XSDatatype dt = (XSDatatype)builtinType.get(dataTypeName);
		if(dt!=null)	return dt;
		try {
			if( dataTypeName.equals("float") )
				add( builtinType, FloatType.theInstance );
			else
			if( dataTypeName.equals("double") )
				add( builtinType, DoubleType.theInstance );
			else
			if( dataTypeName.equals("duration") )
				add( builtinType, DurationType.theInstance );
			else
			if( dataTypeName.equals("dateTime") )
				add( builtinType, DateTimeType.theInstance );
			else
			if( dataTypeName.equals("time") )
				add( builtinType, TimeType.theInstance );
			else
			if( dataTypeName.equals("date") )
				add( builtinType, DateType.theInstance );
			else
			if( dataTypeName.equals("gYearMonth") )
				add( builtinType, GYearMonthType.theInstance );
			else
			if( dataTypeName.equals("gYear") )
				add( builtinType, GYearType.theInstance );
			else
			if( dataTypeName.equals("gMonthDay") )
				add( builtinType, GMonthDayType.theInstance );
			else
			if( dataTypeName.equals("gDay") )
				add( builtinType, GDayType.theInstance );
			else
			if( dataTypeName.equals("gMonth") )
				add( builtinType, GMonthType.theInstance );
			else
			if( dataTypeName.equals("hexBinary") )
				add( builtinType, HexBinaryType.theInstance );
			else
			if( dataTypeName.equals("base64Binary") )
				add( builtinType, Base64BinaryType.theInstance );
			else
			if( dataTypeName.equals("anyURI") )
				add( builtinType, AnyURIType.theInstance );
			else
			if( dataTypeName.equals("ENTITY") )
				add( builtinType, EntityType.theInstance );
			else
			if( dataTypeName.equals("language") )
				add( builtinType, LanguageType.theInstance );
			else
			if( dataTypeName.equals("ENTITIES") )
				add( builtinType, new ListType("ENTITIES",EntityType.theInstance) );
			else
			if( dataTypeName.equals("NMTOKENS") )
				add( builtinType, new ListType("NMTOKENS",NmtokenType.theInstance) );
			else
			if( dataTypeName.equals("NOTATION") )
				add( builtinType, new StringType("NOTATION", WhiteSpaceProcessor.theCollapse) );
			else
			if( dataTypeName.equals("nonPositiveInteger") )
				add( builtinType, NonPositiveIntegerType.theInstance );
			else
			if( dataTypeName.equals("unsignedLong") )
				add( builtinType, UnsignedLongType.theInstance );
			else
			if( dataTypeName.equals("unsignedInt") )
				add( builtinType, UnsignedIntType.theInstance );
			else
			if( dataTypeName.equals("unsignedShort") )
				add( builtinType, UnsignedShortType.theInstance );
			else
			if( dataTypeName.equals("unsignedByte") )
				add( builtinType, UnsignedByteType.theInstance );
		} catch( DatatypeException dte )	{
			throw new Error();
		}
		return (XSDatatype)builtinType.get(dataTypeName);
	}


Input:
	synchronized public void flush() throws BackingStoreException {
		checkRemoved();
		IEclipsePreferences loadLevel = getLoadLevel();
		if (loadLevel == null) {
			String[] childrenNames = childrenNames();
			for (int i = 0; i < childrenNames.length; i++)
				node(childrenNames[i]).flush();
			return;
		}
		if (this != loadLevel) {
			loadLevel.flush();
			return;
		}
		if (!dirty)
			return;
		dirty = false;
		try {
			save();
		} catch (BackingStoreException e) {
			dirty = true;
			throw e;
		}
	}

Output:
	public void flush() throws BackingStoreException {
		checkRemoved();
		IEclipsePreferences loadLevel = getLoadLevel();
		if (loadLevel == null) {
			String[] childrenNames = childrenNames();
			for (int i = 0; i < childrenNames.length; i++)
				node(childrenNames[i]).flush();
			return;
		}
		if (this != loadLevel) {
			loadLevel.flush();
			return;
		}
		if (!dirty)
			return;
		dirty = false;
		try {
			save();
		} catch (BackingStoreException e) {
			dirty = true;
			throw e;
		}
	}


Input:
	private void confirmArrivalToConf(HttpServletRequest request, HttpServletResponse response) throws Exception {
		JsonObject jsonObject = new JsonObject();
		String userIdstr = request.getParameter(ProjConst.USER_ID);
		String confName = request.getParameter(ProjConst.COMP_NAME);
		String answer =  request.getParameter(ProjConst.COMP_NAME);
		Long userId;
		boolean success;
		if ( userIdstr == null) {
			throw new Exception("Failed to get user id");
		}else{
			userId = Long.valueOf(userIdstr.trim());
		}
		if ( confName == null) {
			throw new Exception("Failed to get conference name");
		}
		if ( answer == null) {
			throw new Exception("Failed to get user's answer");
		}
    	String message;
    	try
    	{
    		User user = UserDao.getInstance().getUserById(userId);
    		Conference conf = ConferenceDao.getInstance().getConferenceByName(confName);
    		ConferencesUsersDao.getInstance().updateUserAttendanceApproval(conf, user, UserAttendanceStatus.valueOf(answer));
    		message = "response successfully updated";
    		success = true;
    	}
    	catch (Exception e)
    	{
    		message = "Error occurred, unable to update response";
    		success = false;
    	}
    	response.setContentType("application/json;charset=UTF-8");
        PrintWriter out = response.getWriter();
        try {
            Gson gson = new Gson();
           	String json;
           	if (success)
           	{
           		jsonObject.addProperty("resultSuccess", "true");
           		jsonObject.addProperty("message", message);
           		json = gson.toJson(jsonObject);
           	}
           	else
           	{
           		jsonObject.addProperty("resultSuccess", "false");
           		jsonObject.addProperty("message", message);
           		json = gson.toJson(jsonObject);
           	}
           	out.write(json);
            out.flush();
        }
         finally {
            out.close();
        }
	}

Output:
	private void confirmArrivalToConf(HttpServletRequest request, HttpServletResponse response) throws Exception {
		JsonObject jsonObject = new JsonObject();
		String userIdstr = request.getParameter(ProjConst.USER_ID);
		String confName = request.getParameter(ProjConst.CONF_NAME);
		String answer =  request.getParameter("answer");
		Long userId;
		boolean success;
		if ( userIdstr == null) {
			throw new Exception("Failed to get user id");
		}else{
			userId = Long.valueOf(userIdstr.trim());
		}
		if ( confName == null) {
			throw new Exception("Failed to get conference name");
		}
		if ( answer == null) {
			throw new Exception("Failed to get user's answer");
		}
    	String message;
    	try
    	{
    		User user = UserDao.getInstance().getUserById(userId);
    		Conference conf = ConferenceDao.getInstance().getConferenceByName(confName);
    		ConferencesUsersDao.getInstance().updateUserAttendanceApproval(conf, user, UserAttendanceStatus.valueOf(answer));
    		message = "response successfully updated";
    		success = true;
    	}
    	catch (Exception e)
    	{
    		message = "Error occurred, unable to update response";
    		success = false;
    	}
    	response.setContentType("application/json;charset=UTF-8");
        PrintWriter out = response.getWriter();
        try {
            Gson gson = new Gson();
           	String json;
           	if (success)
           	{
           		jsonObject.addProperty("resultSuccess", "true");
           		jsonObject.addProperty("message", message);
           		json = gson.toJson(jsonObject);
           	}
           	else
           	{
           		jsonObject.addProperty("resultSuccess", "false");
           		jsonObject.addProperty("message", message);
           		json = gson.toJson(jsonObject);
           	}
           	out.write(json);
            out.flush();
        }
         finally {
            out.close();
        }
	}


Input:
    private QuickAction prepareFileAction(final SeafDirent dirent, boolean cacheExists) {
        final QuickAction mQuickAction = new QuickAction(mActivity);
        Resources resources = mActivity.getResources();
        ActionItem shareAction, downloadAction, updateAction, exportAction, renameAction, deleteAction;
        if (!repoIsEncrypted) {
            shareAction = new ActionItem(ACTION_ID_SHARE,
                    resources.getString(R.string.file_action_share),
                    resources.getDrawable(R.drawable.action_share));
            mQuickAction.addActionItem(shareAction);
        }
        renameAction = new ActionItem(ACTION_ID_RENAME,
                resources.getString(R.string.file_action_rename),
                resources.getDrawable(R.drawable.action_rename));
        mQuickAction.addActionItem(renameAction);
        exportAction = new ActionItem(ACTION_ID_EXPORT,
                resources.getString(R.string.file_action_export),
                resources.getDrawable(R.drawable.action_export));
        mQuickAction.addActionItem(exportAction);
        if (cacheExists) {
            if (mActivity.hasRepoWritePermission()) {
                updateAction = new ActionItem(ACTION_ID_UPDATE,
                        resources.getString(R.string.file_action_update),
                        resources.getDrawable(R.drawable.action_update));
                mQuickAction.addActionItem(updateAction);
            }
        } else {
            downloadAction = new ActionItem(ACTION_ID_DOWNLOAD,
                    resources.getString(R.string.file_action_download),
                    resources.getDrawable(R.drawable.action_download));
            mQuickAction.addActionItem(downloadAction);
        }
        mQuickAction.setOnActionItemClickListener(new QuickAction.OnActionItemClickListener() {
            @Override
            public void onItemClick(QuickAction quickAction, int pos, int actionId) {
                NavContext nav = mActivity.getNavContext();
                String repoName = nav.getRepoName();
                String repoID = nav.getRepoID();
                String dir = nav.getDirPath();
                String path = Utils.pathJoin(dir, dirent.name);
                DataManager dataManager = mActivity.getDataManager();
                String localPath = dataManager.getLocalRepoFile(repoName, repoID, path).getPath();
                switch (actionId) {
                case ACTION_ID_SHARE:
                    mActivity.shareFile(repoID, path);
                    break;
                case ACTION_ID_EXPORT:
                    mActivity.exportFile(dirent.name);
                    break;
                case ACTION_ID_DOWNLOAD:
                    mActivity.onFileSelected(dirent);
                    break;
                case ACTION_ID_UPDATE:
                    mActivity.addUpdateTask(repoID, repoName, dir, localPath);
                    break;
                case ACTION_ID_RENAME:
                    break;
                }
            }
        });
        mQuickAction.mAnimateTrack(false);
        return mQuickAction;
    }

Output:
    private QuickAction prepareFileAction(final SeafDirent dirent, boolean cacheExists) {
        final QuickAction mQuickAction = new QuickAction(mActivity);
        Resources resources = mActivity.getResources();
        ActionItem shareAction, downloadAction, updateAction, exportAction, renameAction, deleteAction;
        if (!repoIsEncrypted) {
            shareAction = new ActionItem(ACTION_ID_SHARE,
                    resources.getString(R.string.file_action_share),
                    resources.getDrawable(R.drawable.action_share));
            mQuickAction.addActionItem(shareAction);
        }
        renameAction = new ActionItem(ACTION_ID_RENAME,
                resources.getString(R.string.file_action_rename),
                resources.getDrawable(R.drawable.action_rename));
        mQuickAction.addActionItem(renameAction);
        exportAction = new ActionItem(ACTION_ID_EXPORT,
                resources.getString(R.string.file_action_export),
                resources.getDrawable(R.drawable.action_export));
        mQuickAction.addActionItem(exportAction);
        if (cacheExists) {
            if (mActivity.hasRepoWritePermission()) {
                updateAction = new ActionItem(ACTION_ID_UPDATE,
                        resources.getString(R.string.file_action_update),
                        resources.getDrawable(R.drawable.action_update));
                mQuickAction.addActionItem(updateAction);
            }
        } else {
            downloadAction = new ActionItem(ACTION_ID_DOWNLOAD,
                    resources.getString(R.string.file_action_download),
                    resources.getDrawable(R.drawable.action_download));
            mQuickAction.addActionItem(downloadAction);
        }
        mQuickAction.setOnActionItemClickListener(new QuickAction.OnActionItemClickListener() {
            @Override
            public void onItemClick(QuickAction quickAction, int pos, int actionId) {
                NavContext nav = mActivity.getNavContext();
                String repoName = nav.getRepoName();
                String repoID = nav.getRepoID();
                String dir = nav.getDirPath();
                String path = Utils.pathJoin(dir, dirent.name);
                DataManager dataManager = mActivity.getDataManager();
                String localPath = dataManager.getLocalRepoFile(repoName, repoID, path).getPath();
                switch (actionId) {
                case ACTION_ID_SHARE:
                    mActivity.shareFile(repoID, path);
                    break;
                case ACTION_ID_EXPORT:
                    mActivity.exportFile(dirent.name);
                    break;
                case ACTION_ID_DOWNLOAD:
                    mActivity.onFileSelected(dirent);
                    break;
                case ACTION_ID_UPDATE:
                    mActivity.addUpdateTask(repoID, repoName, dir, localPath);
                    break;
                case ACTION_ID_RENAME:
                    mActivity.renameFile(repoID, repoName, path);
                    break;
                }
            }
        });
        mQuickAction.mAnimateTrack(false);
        return mQuickAction;
    }


Input:
    private void initComponents() {
        User user;
        if (id == null) {
            id = getSession().getUserId();
        }
        user = userManager.findUserById(id, true);
        if (user == null) {
            logger.warn("Not founded user for UserHistory page with id: " + id);
            error("A megadott felhasználóhoz nem tartozik közösségi történet!");
            throw new RestartResponseException(GroupHierarchy.class);
        }
        setHeaderLabelText(user.getFullName() + " közösségi története");
        setTitleText(user.getFullName() + " közösségi története");
        if (own_profile) {
            add(new BookmarkablePageLink<ShowUser>("simpleView", ShowUser.class));
        } else {
            add(new BookmarkablePageLink<ShowUser>("simpleView", ShowUser.class, new PageParameters().add("id", user.getId())));
        }
        add(new BookmarkablePageLink("profilelink", ShowPersonPage.class,
                new PageParameters().add("virid", id.toString())));
        setDefaultModel(new CompoundPropertyModel<User>(user));
        final List<String> groups = new ArrayList<String>();
        groups.add(EVERY_GROUP);
        List<Membership> ms = user.getMemberships();
        for (Membership csoporttagsag : ms) {
            groups.add(csoporttagsag.getGroup().getName());
        }
        DropDownChoice<String> ddc = new DropDownChoice<String>("group", new PropertyModel<String>(this, "selected_text"), groups) {
            @Override
            protected boolean wantOnSelectionChangedNotifications() {
                return true;
            }
            @Override
            protected void onSelectionChanged(final String newSelection) {
                PageParameters pp = new PageParameters();
                String Lselected = groups.get(Integer.valueOf(this.getInput()));
                if (Lselected.equals(EVERY_GROUP)) {
                } else {
                    Group group = groupManager.findGroupByName(Lselected);
                    pp.add("group", group.getId().toString());
                }
                pp.add("id", String.valueOf(id));
                setResponsePage(UserHistory.class, pp);
            }
        };
        add(ddc);
        List<SemesterPoint> semesterPoints = new ArrayList<SemesterPoint>();
        Semester prev = null;
        for (Semester s : userManager.getAllValuatedSemesterForUser(user)) {
            if(prev != null){
                while(!prev.getPrevious().equals(s)){
                    prev = prev.getPrevious();
                    semesterPoints.add(new SemesterPoint(prev, 0));
                }
            }
            prev = s;
            semesterPoints.add(new SemesterPoint(s, userManager.getSemesterPointForUser(user, s)));
        }
        ListView<SemesterPoint> splv = new ListView<SemesterPoint>("semesterPointList", semesterPoints) {
            @Override
            protected void populateItem(ListItem<SemesterPoint> item) {
                SemesterPoint p = item.getModelObject();
                item.add(new Label("semesterPoint.semester", p.getSemester().toString()));
                item.add(new Label("semesterPoint.point", String.valueOf(p.getPoint())));
            }
        };
        add(splv);
        List<ValuationData> list = valuationManager.findRequestsForUser(user, selectedGroupId);
        add(new ValuationTableForUser("table", list).getDataTable());
    }

Output:
    private void initComponents() {
        User user;
        if (id == null) {
            id = getSession().getUserId();
        }
        user = userManager.findUserById(id, true);
        if (user == null) {
            logger.warn("Not founded user for UserHistory page with id: " + id);
            error("A megadott felhasználóhoz nem tartozik közösségi történet!");
            throw new RestartResponseException(GroupHierarchy.class);
        }
        setHeaderLabelText(user.getFullName() + " közösségi története");
        setTitleText(user.getFullName() + " közösségi története");
        if (own_profile) {
            add(new BookmarkablePageLink<ShowUser>("simpleView", ShowUser.class));
        } else {
            add(new BookmarkablePageLink<ShowUser>("simpleView", ShowUser.class, new PageParameters().add("id", user.getId())));
        }
        add(new BookmarkablePageLink("profilelink", ShowPersonPage.class,
                new PageParameters().add("virid", id.toString())));
        setDefaultModel(new CompoundPropertyModel<User>(user));
        final List<String> groups = new ArrayList<String>();
        groups.add(EVERY_GROUP);
        List<Membership> ms = user.getMemberships();
        for (Membership csoporttagsag : ms) {
            groups.add(csoporttagsag.getGroup().getName());
        }
        DropDownChoice<String> ddc = new DropDownChoice<String>("group", new PropertyModel<String>(this, "selected_text"), groups) {
            @Override
            protected boolean wantOnSelectionChangedNotifications() {
                return true;
            }
            @Override
            protected void onSelectionChanged(final String newSelection) {
                PageParameters pp = new PageParameters();
                String Lselected = groups.get(Integer.valueOf(this.getInput()));
                if (Lselected.equals(EVERY_GROUP)) {
                } else {
                    Group group = groupManager.findGroupByName(Lselected);
                    pp.add("group", group.getId().toString());
                }
                pp.add("id", String.valueOf(id));
                setResponsePage(UserHistory.class, pp);
            }
        };
        add(ddc);
        List<SemesterPoint> semesterPoints = new ArrayList<SemesterPoint>();
        for (Semester s : userManager.getAllValuatedSemesterForUser(user)) {
            semesterPoints.add(new SemesterPoint(s, userManager.getSemesterPointForUser(user, s)));
        }
        ListView<SemesterPoint> splv = new ListView<SemesterPoint>("semesterPointList", semesterPoints) {
            @Override
            protected void populateItem(ListItem<SemesterPoint> item) {
                SemesterPoint p = item.getModelObject();
                item.add(new Label("semesterPoint.semester", p.getSemester().toString()));
                item.add(new Label("semesterPoint.point", String.valueOf(p.getPoint())));
            }
        };
        add(splv);
        List<ValuationData> list = valuationManager.findRequestsForUser(user, selectedGroupId);
        add(new ValuationTableForUser("table", list).getDataTable());
    }


Input:
  protected ResponseContext internalInvoke(
    RequestContext requestContext,
    ResponseContext responseContext)
      throws AbderaServerException {
    Target target = requestContext.getTarget();
    String method = requestContext.getMethod();
    if (target != null) {
      switch(target.getResourceType()) {
        case SERVICE: {
          try {
            if (requestContext.getIfNoneMatch().equals("\"service\""))
              throw new AbderaServerException(
                AbderaServerException.Code.NOTMODIFIED,
                "Not Modified", "");
          } catch (NullPointerException npe) {}
          return getServiceDocument();
        }
        case COLLECTION: {
          if (method.equals("GET")) {
            if (!target.getValue(1).equals("foo"))
              throw new AbderaServerException(
                AbderaServerException.Code.NOTFOUND,
                "Not Found", "");
            return getFeedDocument();
          } else if (method.equals("POST")) {
            try {
              Document<Entry> entry_doc =
                getEntryFromRequestContext(requestContext);
              if (entry_doc != null) {
                Entry entry = (Entry) entry_doc.getRoot().clone();
                if (!isValidEntry(entry))
                  throw new AbderaServerException(
                    AbderaServerException.Code.BADREQUEST, "Invalid Entry", "");
                entry.setUpdated(new Date());
                entry.setModified(entry.getUpdated());
                entry.getIdElement().setValue(FOMHelper.generateUuid());
                entry.addLink("foo/" + entry.getId().toString(), "edit");
                getFeed().getRoot().insertEntry((Entry) entry.clone());
                BaseResponseContext rc = getEntryDocument(entry);
                rc.setStatus(201);
                String elink = entry.getEditLink().getHref().toString();
                rc.setLocation(elink);
                rc.setContentLocation(elink);
                return rc;
              } else {
                throw new AbderaServerException(
                  AbderaServerException.Code.UNSUPPORTEDMEDIATYPE,
                  "Unsupported Media Type", "");
              }
            } catch (AbderaServerException e) {
              throw e;
            } catch (Exception e) {
              throw new AbderaServerException(e);
            }
          }
        }
        case ENTRY_EDIT: {
          Entry entry = getEntryFromFeed(requestContext);
          if (entry == null)
            throw new AbderaServerException(
              AbderaServerException.Code.NOTFOUND, "Not Found", "");
          if (method.equals("GET")) {
            Entry e = (Entry) entry.clone();
            return new BaseResponseContext(e.getDocument());
          } else if (method.equals("PUT")) {
            try {
              Document<Entry> entry_doc = getEntryFromRequestContext(requestContext);
              if (entry_doc == null)
                throw new AbderaServerException(
                  AbderaServerException.Code.UNSUPPORTEDMEDIATYPE,
                  "Unsupported Media Type", "");
              Document<Feed> feed_doc = getFeed();
              Entry e = (Entry) entry_doc.getRoot().clone();
              if (!isValidEntry(entry))
                throw new AbderaServerException(
                  AbderaServerException.Code.BADREQUEST, "Invalid Entry", "");
              if (!e.getId().equals(entry.getId()))
                throw new AbderaServerException(
                  AbderaServerException.Code.CONFLICT, "Conflict. Cannot change atom:id", "");
              e.setUpdated(new Date());
              e.setModified(e.getUpdated());
              Link editLink = e.getEditLink();
              if (editLink == null)
                e.addLink("foo/" + e.getId().toString(), "edit");
              else editLink.setHref("foo/" + e.getId().toString());
              entry.discard();
              feed_doc.getRoot().insertEntry((Entry) e.clone());
              return new EmptyResponseContext(204);
            } catch (Exception e) {
              throw new AbderaServerException(e);
            }
          } else if (method.equals("DELETE")) {
            entry.discard();
            return new EmptyResponseContext(204);
          }
        }
      }
      return null;
    } else {
      throw new AbderaServerException(
        AbderaServerException.Code.NOTFOUND,
        "Not Found", "");
    }
  }

Output:
  protected ResponseContext internalInvoke(
    RequestContext requestContext,
    ResponseContext responseContext)
      throws AbderaServerException {
    Target target = requestContext.getTarget();
    String method = requestContext.getMethod();
    if (target != null) {
      ResourceType type = target.getResourceType();
      if (type == ResourceType.SERVICE) {
          try {
            if (requestContext.getIfNoneMatch().equals("\"service\""))
              throw new AbderaServerException(
                AbderaServerException.Code.NOTMODIFIED,
                "Not Modified", "");
          } catch (NullPointerException npe) {}
          return getServiceDocument();
      } else if (type == ResourceType.COLLECTION) {
          if (method.equals("GET")) {
            if (!target.getValue(1).equals("foo"))
              throw new AbderaServerException(
                AbderaServerException.Code.NOTFOUND,
                "Not Found", "");
            return getFeedDocument();
          } else if (method.equals("POST")) {
            try {
              Document<Entry> entry_doc =
                getEntryFromRequestContext(requestContext);
              if (entry_doc != null) {
                Entry entry = (Entry) entry_doc.getRoot().clone();
                if (!isValidEntry(entry))
                  throw new AbderaServerException(
                    AbderaServerException.Code.BADREQUEST, "Invalid Entry", "");
                entry.setUpdated(new Date());
                entry.setModified(entry.getUpdated());
                entry.getIdElement().setValue(FOMHelper.generateUuid());
                entry.addLink("foo/" + entry.getId().toString(), "edit");
                getFeed().getRoot().insertEntry((Entry) entry.clone());
                BaseResponseContext rc = getEntryDocument(entry);
                rc.setStatus(201);
                String elink = entry.getEditLink().getHref().toString();
                rc.setLocation(elink);
                rc.setContentLocation(elink);
                return rc;
              } else {
                throw new AbderaServerException(
                  AbderaServerException.Code.UNSUPPORTEDMEDIATYPE,
                  "Unsupported Media Type", "");
              }
            } catch (AbderaServerException e) {
              throw e;
            } catch (Exception e) {
              throw new AbderaServerException(e);
            }
          }
      } else if (type == ResourceType.ENTRY_EDIT) {
          Entry entry = getEntryFromFeed(requestContext);
          if (entry == null)
            throw new AbderaServerException(
              AbderaServerException.Code.NOTFOUND, "Not Found", "");
          if (method.equals("GET")) {
            Entry e = (Entry) entry.clone();
            return new BaseResponseContext(e.getDocument());
          } else if (method.equals("PUT")) {
            try {
              Document<Entry> entry_doc = getEntryFromRequestContext(requestContext);
              if (entry_doc == null)
                throw new AbderaServerException(
                  AbderaServerException.Code.UNSUPPORTEDMEDIATYPE,
                  "Unsupported Media Type", "");
              Document<Feed> feed_doc = getFeed();
              Entry e = (Entry) entry_doc.getRoot().clone();
              if (!isValidEntry(entry))
                throw new AbderaServerException(
                  AbderaServerException.Code.BADREQUEST, "Invalid Entry", "");
              if (!e.getId().equals(entry.getId()))
                throw new AbderaServerException(
                  AbderaServerException.Code.CONFLICT, "Conflict. Cannot change atom:id", "");
              e.setUpdated(new Date());
              e.setModified(e.getUpdated());
              Link editLink = e.getEditLink();
              if (editLink == null)
                e.addLink("foo/" + e.getId().toString(), "edit");
              else editLink.setHref("foo/" + e.getId().toString());
              entry.discard();
              feed_doc.getRoot().insertEntry((Entry) e.clone());
              return new EmptyResponseContext(204);
            } catch (Exception e) {
              throw new AbderaServerException(e);
            }
          } else if (method.equals("DELETE")) {
            entry.discard();
            return new EmptyResponseContext(204);
          }
      }
      return null;
    } else {
      throw new AbderaServerException(
        AbderaServerException.Code.NOTFOUND,
        "Not Found", "");
    }
  }


Input:
	public void run(final String... args) {
		if (args.length != 1) {
			outputHelp();
		}
		final File configFile = new File(args[0]);
		if (!configFile.canRead()) {
			System.err.println("Configuration file " + configFile.getAbsolutePath() + " not readable");
			System.exit(2);
		}
		final Bootstrapper bootstrapper = DefaultBootstrapper.bootstrap(configFile.getAbsolutePath());
		try {
			runBootstrapped(bootstrapper);
		} catch (final Exception e) {
			System.err.println("Exception raised during bootstrapping. Check out the logs for more information.");
			System.exit(3);
		}
	}

Output:
	public void run(final String... args) {
		if (args.length != 1) {
			outputHelp();
		}
		final File configFile = new File(args[0]);
		if (!configFile.canRead()) {
			System.err.println("Configuration file " + configFile.getAbsolutePath() + " not readable");
			System.exit(2);
		}
		final Bootstrapper bootstrapper = DefaultBootstrapper.bootstrap(configFile.getAbsolutePath());
		try {
			runBootstrapped(bootstrapper);
		} catch (final Exception e) {
			System.err.println("Exception raised during bootstrapping. Check out the logs for more information. Message: " + e.getMessage());
			System.exit(3);
		}
	}


Input:
    private void updateInCallNotification(boolean allowFullScreenIntent) {
        int resId;
        if (DBG) log("updateInCallNotification(allowFullScreenIntent = "
                     + allowFullScreenIntent + ")...");
        if (!PhoneApp.sVoiceCapable) {
            if (DBG) log("- non-voice-capable device; suppressing notification.");
            return;
        }
        if (mCM.getState() == Phone.State.IDLE) {
            cancelInCall();
            cancelMute();
            cancelSpeakerphone();
            return;
        }
        final boolean hasRingingCall = mCM.hasActiveRingingCall();
        final boolean hasActiveCall = mCM.hasActiveFgCall();
        final boolean hasHoldingCall = mCM.hasActiveBgCall();
        if (DBG) {
            log("  - hasRingingCall = " + hasRingingCall);
            log("  - hasActiveCall = " + hasActiveCall);
            log("  - hasHoldingCall = " + hasHoldingCall);
        }
        if (mApp.isShowingCallScreen() && !hasRingingCall) {
            cancelInCall();
            return;
        }
        boolean enhancedVoicePrivacy = mApp.notifier.getVoicePrivacyState();
        if (DBG) log("updateInCallNotification: enhancedVoicePrivacy = " + enhancedVoicePrivacy);
        if (hasRingingCall) {
            resId = R.drawable.stat_sys_phone_call_ringing;
        } else if (!hasActiveCall && hasHoldingCall) {
            if (enhancedVoicePrivacy) {
                resId = R.drawable.stat_sys_vp_phone_call_on_hold;
            } else {
                resId = R.drawable.stat_sys_phone_call_on_hold;
            }
        } else if (mApp.showBluetoothIndication()) {
            if (enhancedVoicePrivacy) {
                resId = R.drawable.stat_sys_vp_phone_call_bluetooth;
            } else {
                resId = R.drawable.stat_sys_phone_call_bluetooth;
            }
        } else {
            if (enhancedVoicePrivacy) {
                resId = R.drawable.stat_sys_vp_phone_call;
            } else {
                resId = R.drawable.stat_sys_phone_call;
            }
        }
        if (DBG) log("- Updating status bar icon: resId = " + resId);
        mInCallResId = resId;
        int expandedViewIcon = mInCallResId;
        Call currentCall;
        if (hasRingingCall) {
            currentCall = mCM.getFirstActiveRingingCall();
        } else if (hasActiveCall) {
            currentCall = mCM.getActiveFgCall();
        } else {
            currentCall = mCM.getFirstActiveBgCall();
        }
        Connection currentConn = currentCall.getEarliestConnection();
        Notification notification = new Notification();
        notification.icon = mInCallResId;
        notification.flags |= Notification.FLAG_ONGOING_EVENT;
        PendingIntent inCallPendingIntent =
                PendingIntent.getActivity(mContext, 0,
                                          PhoneApp.createInCallIntent(), 0);
        notification.contentIntent = inCallPendingIntent;
        RemoteViews contentView = new RemoteViews(mContext.getPackageName(),
                                                   R.layout.ongoing_call_notification);
        contentView.setImageViewResource(R.id.icon, expandedViewIcon);
        if (currentConn != null) {
            long callDurationMsec = currentConn.getDurationMillis();
            long chronometerBaseTime = SystemClock.elapsedRealtime() - callDurationMsec;
            String expandedViewLine1;
            if (hasRingingCall) {
                expandedViewLine1 = mContext.getString(R.string.notification_incoming_call);
            } else if (hasHoldingCall && !hasActiveCall) {
                expandedViewLine1 = mContext.getString(R.string.notification_on_hold);
            } else {
                expandedViewLine1 = mContext.getString(R.string.notification_ongoing_call_format);
            }
            if (DBG) log("- Updating expanded view: line 1 '" +  "xxxxxxx" + "'");
            contentView.setChronometer(R.id.text1,
                                       chronometerBaseTime,
                                       expandedViewLine1,
                                       true);
        } else if (DBG) {
            Log.w(LOG_TAG, "updateInCallNotification: null connection, can't set exp view line 1.");
        }
        String expandedViewLine2 = "";
        if (PhoneUtils.isConferenceCall(currentCall)) {
            expandedViewLine2 = mContext.getString(R.string.card_title_conf_call);
        } else {
            PhoneUtils.CallerInfoToken cit =
                PhoneUtils.startGetCallerInfo(mContext, currentCall, this, this);
            expandedViewLine2 = PhoneUtils.getCompactNameFromCallerInfo(cit.currentInfo, mContext);
        }
        if (DBG) log("- Updating expanded view: line 2 '" +  "xxxxxxx" + "'");
        contentView.setTextViewText(R.id.text2, expandedViewLine2);
        notification.contentView = contentView;
        if (hasRingingCall) {
            if (DBG) log("- Using hi-pri notification for ringing call!");
            notification.flags |= Notification.FLAG_HIGH_PRIORITY;
            notification.tickerText = expandedViewLine2;
            if (allowFullScreenIntent) {
                if (DBG) log("- Setting fullScreenIntent: " + inCallPendingIntent);
                notification.fullScreenIntent = inCallPendingIntent;
                Call ringingCall = mCM.getFirstActiveRingingCall();
                if ((ringingCall.getState() == Call.State.WAITING) && !mApp.isShowingCallScreen()) {
                    Log.i(LOG_TAG, "updateInCallNotification: call-waiting! force relaunch...");
                    mNotificationManager.cancel(IN_CALL_NOTIFICATION);
                }
            }
        }
        if (DBG) log("Notifying IN_CALL_NOTIFICATION: " + notification);
        mNotificationManager.notify(IN_CALL_NOTIFICATION,
                                notification);
        updateSpeakerNotification();
        updateMuteNotification();
    }

Output:
    private void updateInCallNotification(boolean allowFullScreenIntent) {
        int resId;
        if (DBG) log("updateInCallNotification(allowFullScreenIntent = "
                     + allowFullScreenIntent + ")...");
        if (!PhoneApp.sVoiceCapable) {
            if (DBG) log("- non-voice-capable device; suppressing notification.");
            return;
        }
        if (mCM.getState() == Phone.State.IDLE) {
            cancelInCall();
            cancelMute();
            cancelSpeakerphone();
            return;
        }
        final boolean hasRingingCall = mCM.hasActiveRingingCall();
        final boolean hasActiveCall = mCM.hasActiveFgCall();
        final boolean hasHoldingCall = mCM.hasActiveBgCall();
        if (DBG) {
            log("  - hasRingingCall = " + hasRingingCall);
            log("  - hasActiveCall = " + hasActiveCall);
            log("  - hasHoldingCall = " + hasHoldingCall);
        }
        if (mApp.isShowingCallScreen() && !hasRingingCall) {
            cancelInCall();
            return;
        }
        boolean enhancedVoicePrivacy = mApp.notifier.getVoicePrivacyState();
        if (DBG) log("updateInCallNotification: enhancedVoicePrivacy = " + enhancedVoicePrivacy);
        if (hasRingingCall) {
            resId = R.drawable.stat_sys_phone_call_ringing;
        } else if (!hasActiveCall && hasHoldingCall) {
            if (enhancedVoicePrivacy) {
                resId = R.drawable.stat_sys_vp_phone_call_on_hold;
            } else {
                resId = R.drawable.stat_sys_phone_call_on_hold;
            }
        } else if (mApp.showBluetoothIndication()) {
            if (enhancedVoicePrivacy) {
                resId = R.drawable.stat_sys_vp_phone_call_bluetooth;
            } else {
                resId = R.drawable.stat_sys_phone_call_bluetooth;
            }
        } else {
            if (enhancedVoicePrivacy) {
                resId = R.drawable.stat_sys_vp_phone_call;
            } else {
                resId = R.drawable.stat_sys_phone_call;
            }
        }
        if (DBG) log("- Updating status bar icon: resId = " + resId);
        mInCallResId = resId;
        int expandedViewIcon = mInCallResId;
        Call currentCall;
        if (hasRingingCall) {
            currentCall = mCM.getFirstActiveRingingCall();
        } else if (hasActiveCall) {
            currentCall = mCM.getActiveFgCall();
        } else {
            currentCall = mCM.getFirstActiveBgCall();
        }
        Connection currentConn = currentCall.getEarliestConnection();
        Notification notification = new Notification();
        notification.icon = mInCallResId;
        notification.flags |= Notification.FLAG_ONGOING_EVENT;
        PendingIntent inCallPendingIntent =
                PendingIntent.getActivity(mContext, 0,
                                          PhoneApp.createInCallIntent(), 0);
        notification.contentIntent = inCallPendingIntent;
        RemoteViews contentView = new RemoteViews(mContext.getPackageName(),
                                                   R.layout.ongoing_call_notification);
        contentView.setImageViewResource(R.id.icon, expandedViewIcon);
        if (currentConn != null) {
            long callDurationMsec = currentConn.getDurationMillis();
            long chronometerBaseTime = SystemClock.elapsedRealtime() - callDurationMsec;
            String expandedViewLine1;
            if (hasRingingCall) {
                expandedViewLine1 = mContext.getString(R.string.notification_incoming_call);
            } else if (hasHoldingCall && !hasActiveCall) {
                expandedViewLine1 = mContext.getString(R.string.notification_on_hold);
            } else {
                expandedViewLine1 = mContext.getString(R.string.notification_ongoing_call_format);
            }
            if (DBG) log("- Updating expanded view: line 1 '" +  "xxxxxxx" + "'");
            contentView.setChronometer(R.id.text1,
                                       chronometerBaseTime,
                                       expandedViewLine1,
                                       true);
        } else if (DBG) {
            Log.w(LOG_TAG, "updateInCallNotification: null connection, can't set exp view line 1.");
        }
        String expandedViewLine2 = "";
        if (PhoneUtils.isConferenceCall(currentCall)) {
            expandedViewLine2 = mContext.getString(R.string.card_title_conf_call);
        } else {
            PhoneUtils.CallerInfoToken cit =
                PhoneUtils.startGetCallerInfo(mContext, currentCall, this, this);
            expandedViewLine2 = PhoneUtils.getCompactNameFromCallerInfo(cit.currentInfo, mContext);
        }
        if (DBG) log("- Updating expanded view: line 2 '" +  "xxxxxxx" + "'");
        contentView.setTextViewText(R.id.title, expandedViewLine2);
        notification.contentView = contentView;
        if (hasRingingCall) {
            if (DBG) log("- Using hi-pri notification for ringing call!");
            notification.flags |= Notification.FLAG_HIGH_PRIORITY;
            notification.tickerText = expandedViewLine2;
            if (allowFullScreenIntent) {
                if (DBG) log("- Setting fullScreenIntent: " + inCallPendingIntent);
                notification.fullScreenIntent = inCallPendingIntent;
                Call ringingCall = mCM.getFirstActiveRingingCall();
                if ((ringingCall.getState() == Call.State.WAITING) && !mApp.isShowingCallScreen()) {
                    Log.i(LOG_TAG, "updateInCallNotification: call-waiting! force relaunch...");
                    mNotificationManager.cancel(IN_CALL_NOTIFICATION);
                }
            }
        }
        if (DBG) log("Notifying IN_CALL_NOTIFICATION: " + notification);
        mNotificationManager.notify(IN_CALL_NOTIFICATION,
                                notification);
        updateSpeakerNotification();
        updateMuteNotification();
    }


Input:
	private void printToFileIfApplicable(Object doc,
			OutputGenaratorParam outputGenaratorParam,String fileName) throws WsdlDocException {
		if (outputGenaratorParam.getParameters() != null) {
			if (outputGenaratorParam.getParameters().get("writeToFile") != null
					&& "true".equals(outputGenaratorParam.getParameters().get(
							"writeToFile"))) {
				String outFile = outputGenaratorParam.getParameters().get(
						"filePath");
				if (outFile != null) {
					try {
						writeFile(doc.toString(),outFile,fileName);
					} catch (IOException e) {
						throw new WsdlDocException(e);
					}
				}
			}
		}
	}

Output:
	private void printToFileIfApplicable(Object doc,
			OutputGenaratorParam outputGenaratorParam,String fileName) throws WsdlDocException {
		if (outputGenaratorParam.getParameters() != null) {
			if (outputGenaratorParam.getParameters().get("writeToFile") != null
					&& "true".equals(outputGenaratorParam.getParameters().get(
							"writeToFile"))) {
				String outFile = outputGenaratorParam.getOutputDir();
				if (outFile != null) {
					try {
						writeFile(doc.toString(),outFile,fileName);
					} catch (IOException e) {
						throw new WsdlDocException(e);
					}
				}
			}
		}
	}


Input:
	public LinkedList<AdjacentTile> getAdjacentTileEntities(boolean flag) {
		LinkedList<AdjacentTile> foundTiles = new LinkedList<AdjacentTile>();
		for (ForgeDirection o : ForgeDirection.values()) {
			if (o == ForgeDirection.UNKNOWN) continue;
			Position p = new Position(_x, _y, _z, o);
			p.moveForwards(1);
			TileEntity tile = _worldObj.getBlockTileEntity((int)p.x, (int)p.y, (int)p.z);
			if (tile == null) continue;
			if(flag) {
				TileEntity tilePipe = _worldObj.getBlockTileEntity(_x, _y, _z);
				if(tilePipe instanceof TileGenericPipe) {
					if(((TileGenericPipe)tilePipe).pipe != null) {
						((TileGenericPipe)tilePipe).pipe.isPipeConnected(tile);
					}
				}
			}
			foundTiles.add(new AdjacentTile(tile, o));
		}
		return foundTiles;
	}

Output:
	public LinkedList<AdjacentTile> getAdjacentTileEntities(boolean flag) {
		LinkedList<AdjacentTile> foundTiles = new LinkedList<AdjacentTile>();
		for (ForgeDirection o : ForgeDirection.values()) {
			if (o == ForgeDirection.UNKNOWN) continue;
			Position p = new Position(_x, _y, _z, o);
			p.moveForwards(1);
			TileEntity tile = _worldObj.getBlockTileEntity((int)p.x, (int)p.y, (int)p.z);
			if (tile == null) continue;
			if(flag) {
				TileEntity tilePipe = _worldObj.getBlockTileEntity(_x, _y, _z);
				if(tilePipe instanceof TileGenericPipe) {
					if(((TileGenericPipe)tilePipe).pipe != null) {
						if(!((TileGenericPipe)tilePipe).pipe.isPipeConnected(tile)) {
							continue;
						}
					}
				}
			}
			foundTiles.add(new AdjacentTile(tile, o));
		}
		return foundTiles;
	}


Input:
	public void dispose() {
		if (scp == null) {
			return;
		}
		if (Activator.DEBUG) {
			Activator.log.debug("ComponentInstanceImpl.dispose(): disposing instance of component " + scp.name, null);
		}
		if (!scp.isComponentFactory() && scp.serviceComponent.factory != null) {
			scp.serviceComponent.componentProps.removeElement(scp);
			Vector toDispose = new Vector(1);
			toDispose.addElement(scp);
			InstanceProcess.resolver.disposeComponentConfigs(toDispose, ComponentConstants.DEACTIVATION_REASON_DISPOSED);
			if (scp != null) {
				scp.setState(Component.STATE_DISPOSED);
				scp = null;
			}
		} else {
			scp.dispose(this, ComponentConstants.DEACTIVATION_REASON_DISPOSED);
		}
		freeServiceReferences();
		componentContext = null;
		instance = null;
	}

Output:
	public void dispose() {
		if (scp == null) {
			return;
		}
		if (Activator.DEBUG) {
			Activator.log.debug("ComponentInstanceImpl.dispose(): disposing instance of component " + scp.name, null);
		}
		if (!scp.isComponentFactory() && scp.serviceComponent.factory != null) {
			scp.serviceComponent.componentProps.removeElement(scp);
			Vector toDispose = new Vector(1);
			toDispose.addElement(scp);
			InstanceProcess.resolver.disposeComponentConfigs(toDispose, ComponentConstants.DEACTIVATION_REASON_DISPOSED);
			if (scp != null) {
				scp.setState(Component.STATE_DISPOSED);
			}
		} else {
			scp.dispose(this, ComponentConstants.DEACTIVATION_REASON_DISPOSED);
		}
		freeServiceReferences();
		scp = null;
		componentContext = null;
		instance = null;
	}


Input:
    public boolean onCommand(
            CommandSender sender, Command command, String label, String[] args) {
        if ( args.length <= 0 ) {
            return false;
        }
        String group = args[0];
        Hashtable<String, ArrayList<Player>> members =
                new Hashtable<String, ArrayList<Player>>();
        if ( !members.containsKey(group) ) {
            sender.sendMessage(PREERR + "グループ " + group + " は存在しません。");
            return true;
        }
        ArrayList<Player> playersToExplode = members.get(group);
        for ( Player p : playersToExplode ) {
            p.getWorld().createExplosion(p.getLocation(), 0);
            p.setHealth(0);
            p.sendMessage("どーーん！");
        }
        ColorMeTeaming.sendBroadcast(PRENOTICE + "グループ " + group + " ");
        return true;
    }

Output:
    public boolean onCommand(
            CommandSender sender, Command command, String label, String[] args) {
        if ( args.length <= 0 ) {
            return false;
        }
        String group = args[0];
        Hashtable<String, ArrayList<Player>> members =
                ColorMeTeaming.getAllColorMembers();
        if ( !members.containsKey(group) ) {
            sender.sendMessage(PREERR + "グループ " + group + " は存在しません。");
            return true;
        }
        ArrayList<Player> playersToExplode = members.get(group);
        for ( Player p : playersToExplode ) {
            p.getWorld().createExplosion(p.getLocation(), 0);
            p.setHealth(0);
            p.sendMessage("どーーん！");
        }
        ColorMeTeaming.sendBroadcast(PRENOTICE + "グループ " + group + " ");
        return true;
    }


Input:
    private File makeFinalOutputDirectoryPath(UploadSummary uploadSummary, File sessionTempFolder) throws IOException {
        final File outDirParent = config.getFinalOutputDir();
        final Date now = Calendar.getInstance().getTime();
        final String dateDirName = (new SimpleDateFormat("yyyy-MM-dd")).format(now);
        final File dateDir = new File(outDirParent, dateDirName);
        dateDir.mkdirs();
        if (!dateDir.exists()) {
            throw new IOException("Unable to create final output folder " + dateDir);
        }
        StringBuilder b = new StringBuilder();
        b.append(dateDirName)
                .append(File.separatorChar)
                .append(uploadSummary.senderAddress.getPersonal())
                .append(" (").append(uploadSummary.senderAddress.getAddress()).append(") ");
        if (uploadSummary.customerCode != null && !uploadSummary.customerCode.isEmpty()) {
            b.append("(C: ").append(uploadSummary.customerCode).append(')');
        }
        if (uploadSummary.bookingNumber != null && !uploadSummary.bookingNumber.isEmpty()) {
            b.append("(B: ").append(uploadSummary.bookingNumber).append(')');
        }
        b.append(' ').append((new SimpleDateFormat("hh-mm-ss").format(now)));
        uploadSummary.outputDirectory = new File(outDirParent, b.toString());
        return uploadSummary.outputDirectory;
    }

Output:
    private File makeFinalOutputDirectoryPath(UploadSummary uploadSummary, File sessionTempFolder) throws IOException {
        final File outDirParent = config.getFinalOutputDir();
        final Date now = Calendar.getInstance().getTime();
        final String dateDirName = (new SimpleDateFormat("yyyy-MM-dd")).format(now);
        final File dateDir = new File(outDirParent, dateDirName);
        StringBuilder b = new StringBuilder();
        b.append(dateDirName)
                .append(File.separatorChar)
                .append(uploadSummary.senderAddress.getPersonal())
                .append(" (").append(uploadSummary.senderAddress.getAddress()).append(") ");
        if (uploadSummary.customerCode != null && !uploadSummary.customerCode.isEmpty()) {
            b.append("(C: ").append(uploadSummary.customerCode).append(')');
        }
        if (uploadSummary.bookingNumber != null && !uploadSummary.bookingNumber.isEmpty()) {
            b.append("(B: ").append(uploadSummary.bookingNumber).append(')');
        }
        b.append(' ').append((new SimpleDateFormat("hh-mm-ss").format(now)));
        uploadSummary.outputDirectory = new File(outDirParent, b.toString());
        uploadSummary.outputDirectory.mkdirs();
        if (!uploadSummary.outputDirectory.exists()) {
            throw new IOException("Unable to create final output folder " + uploadSummary.outputDirectory);
        }
        return uploadSummary.outputDirectory;
    }


Input:
protected void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
	    response.setHeader("Cache-Control", "no-cache");
	    response.setHeader("Pragma", "no-cache");
	    response.setContentType("text/html");
	    String equation = request.getParameter("equation");
	    String[] pnames = request.getParameterValues("pname");
	    String[] pvalues = request.getParameterValues("pvalue");
	    for (int i=0; i < pnames.length; i++)
	    	System.out.println("pname: "+pnames[i]+" pvalue: "+pvalues[i]);
	    PrintWriter out = response.getWriter();
	    GraphDescriber describer = new GraphDescriber(equation);
	    String newEquation = describer.getNewEquation(pnames, pvalues);
		System.out.println("NEW EQUATION IS: "+newEquation);
	    out.println("");
	    out.println("");
	    out.println("<form method='get' action='/Mde-Web-Service/GetEquationDescription'>");
	    out.println("Enter an equation: ");
	    out.println("<input type='text' name='equation'>");
	    out.println("<input type='submit'>");
	    out.println("</form>");
	    out.println("");
	    out.println("");
	}

Output:
	protected void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
	    response.setHeader("Cache-Control", "no-cache");
	    response.setHeader("Pragma", "no-cache");
	    response.setContentType("text/html");
	    String equation = request.getParameter("equation");
	    String[] pnames = request.getParameterValues("pname");
	    String[] pvalues = request.getParameterValues("pvalue");
	    for (int i=0; i < pnames.length; i++)
	    	System.out.println("pname: "+pnames[i]+" pvalue: "+pvalues[i]);
	    PrintWriter out = response.getWriter();
	    GraphDescriber describer = new GraphDescriber(equation);
	    String newEquation = describer.getNewEquation(pnames, pvalues);
	    out.print(newEquation);
	}


Input:
    protected MutableLayoutRow oneStep(@NotNull MutableLayoutRow row) {
        int newRowIndex = row.getGraphNodeRow().getRowIndex() + 1;
        if (newRowIndex == graph.getNodeRows().size()) {
            throw new NoSuchElementException();
        }
        List<GraphElement> layoutRow = row.getModifiableOrderedGraphElements();
        for (ListIterator<GraphElement> iterator = layoutRow.listIterator(); iterator.hasNext(); ) {
            GraphElement element = iterator.next();
            Node node = element.getNode();
            if (node != null) {
                List<Edge> edges = node.getDownEdges();
                if (edges.size() == 0) {
                    iterator.remove();
                } else {
                    iterator.remove();
                    for (Edge edge : orderAddEdges(edges)) {
                        Node downNode = edge.getDownNode();
                        if (downNode.getRowIndex() == newRowIndex) {
                            if (downNode.getBranch() == edge.getBranch()) {
                                iterator.add(downNode);
                            }
                        } else {
                            iterator.add(edge);
                        }
                    }
                }
            } else {
                Edge edge = element.getEdge();
                if (edge == null) {
                    throw new IllegalStateException("unexpected element class");
                }
                if (edge.getDownNode().getRowIndex() == newRowIndex) {
                    if (edge.getBranch() == edge.getDownNode().getBranch()) {
                        iterator.set(edge.getDownNode());
                    } else {
                        iterator.remove();
                    }
                }
            }
        }
        NodeRow nextGraphRow = graph.getNodeRows().get(newRowIndex);
        for (Node node : nextGraphRow.getNodes()) {
            if (node.getUpEdges().isEmpty()) {
                layoutRow.add(node);
            }
        }
        row.setNodeRow(nextGraphRow);
        return row;
    }

Output:
    protected MutableLayoutRow oneStep(@NotNull MutableLayoutRow row) {
        int newRowIndex = row.getGraphNodeRow().getRowIndex() + 1;
        if (newRowIndex == graph.getNodeRows().size()) {
            throw new NoSuchElementException();
        }
        List<GraphElement> layoutRow = row.getModifiableOrderedGraphElements();
        Set<Node> addedNodeInNextRow = new HashSet<Node>();
        for (ListIterator<GraphElement> iterator = layoutRow.listIterator(); iterator.hasNext(); ) {
            GraphElement element = iterator.next();
            Node node = element.getNode();
            if (node != null) {
                List<Edge> edges = node.getDownEdges();
                if (edges.size() == 0) {
                    iterator.remove();
                } else {
                    iterator.remove();
                    for (Edge edge : orderAddEdges(edges)) {
                        Node downNode = edge.getDownNode();
                        if (downNode.getRowIndex() == newRowIndex) {
                            if (!addedNodeInNextRow.contains(downNode)) {
                                iterator.add(downNode);
                                addedNodeInNextRow.add(downNode);
                            }
                        } else {
                            iterator.add(edge);
                        }
                    }
                }
            } else {
                Edge edge = element.getEdge();
                if (edge == null) {
                    throw new IllegalStateException("unexpected element class");
                }
                if (edge.getDownNode().getRowIndex() == newRowIndex) {
                    if (!addedNodeInNextRow.contains(edge.getDownNode())) {
                        iterator.set(edge.getDownNode());
                        addedNodeInNextRow.add(edge.getDownNode());
                    } else {
                        iterator.remove();
                    }
                }
            }
        }
        NodeRow nextGraphRow = graph.getNodeRows().get(newRowIndex);
        for (Node node : nextGraphRow.getNodes()) {
            if (node.getUpEdges().isEmpty()) {
                layoutRow.add(node);
            }
        }
        row.setNodeRow(nextGraphRow);
        return row;
    }


Input:
	public void updateNotifyIcon() {
		Context ctx   = getApplicationContext();
		int prcnt     = battery_state[0];
		int curplug   = battery_state[1];
		int voltage   = battery_state[2];
		int temp      = battery_state[3];
		int oldprcnt  = bconfig.GetPercentage();
		int oldplug   = bconfig.GetPlugStatus();
		int oldts     = bconfig.GetTimestamp();
		if(bconfig.IsMotorola() && bconfig.GetMotorolaPercent() != 0) {
			prcnt = bconfig.GetMotorolaPercent();
		}
		if(prcnt > 100) { prcnt = 100; }
		if(prcnt < 0)   { prcnt = 0;   }
		if( (curplug != oldplug) || (prcnt == 100) ) {
			Log.d(T, "++ STATUS CHANGE ++: oldplug="+oldplug+", curplug="+curplug+", percentage="+prcnt);
			oldprcnt = prcnt;
			oldts    = unixtimeAsInt();
			bconfig.SetPlugStatus(curplug);
			bconfig.SetPercentage(prcnt);
			bconfig.SetTimestamp(oldts);
		}
		String vx      = String.valueOf(voltage/1000.0);
		String ntext   = "";
		String ntitle  = ((prcnt == 100 && curplug == 1) ? gtx(R.string.fully_charged) :
		                  (curplug == 0 ? gtx(R.string.discharging_from)+" "+oldprcnt+"%" :
		                  gtx(R.string.charging_from)+" "+oldprcnt+"%"));
		String timetxt = getTimeString(oldts);
		int icon_id    = bconfig.GetIconFor(prcnt, (curplug!=0 && bconfig.ChargeGlow()) );
		if(bconfig.ShowDetails()) {
			String dgtmp = String.valueOf(temp/10.0)+gtx(R.string.degree)+"C";
			if(bconfig.TempInFahrenheit()) {
				dgtmp = String.valueOf( ( (int)((temp * 1.8)+320) )/10.0 )+gtx(R.string.degree)+"F";
			}
			ntext += vx+"V, "+dgtmp;
			ntext += _ICSFILTER_( ", "+gtx(R.string.capacity_at)+" "+prcnt+"%" );
		}
		else {
			ntext += (voltage == 0 ? "" : gtx(R.string.voltage)+" "+vx+" V");
			ntext += _ICSFILTER_( " // "+gtx(R.string.capacity_at)+" "+prcnt+"%" );
		}
		if(isICS() == true) {
			ntext = "...since "+timetxt+" / "+ntext;
		}
		else {
			ntitle += " "+gtx(R.string.since)+": "+timetxt;
			ntext  += " "+gtx(R.string.since)+":";
		}
		Notification this_notify = new Notification(icon_id, null, System.currentTimeMillis());
		this_notify.flags |= Notification.FLAG_ONGOING_EVENT | Notification.FLAG_NO_CLEAR;
		this_notify.setLatestEventInfo(ctx, ntitle, ntext, getConfiguredIntent() );
		notify_manager.notify(0, this_notify);
	}

Output:
	public void updateNotifyIcon() {
		Context ctx   = getApplicationContext();
		int prcnt     = battery_state[0];
		int curplug   = battery_state[1];
		int voltage   = battery_state[2];
		int temp      = battery_state[3];
		int oldprcnt  = bconfig.GetPercentage();
		int oldplug   = bconfig.GetPlugStatus();
		int oldts     = bconfig.GetTimestamp();
		if(bconfig.IsMotorola() && bconfig.GetMotorolaPercent() != 0) {
			prcnt = bconfig.GetMotorolaPercent();
		}
		if(prcnt > 100) { prcnt = 100; }
		if(prcnt < 0)   { prcnt = 0;   }
		if( (curplug != oldplug) || (prcnt == 100) ) {
			Log.d(T, "++ STATUS CHANGE ++: oldplug="+oldplug+", curplug="+curplug+", percentage="+prcnt);
			oldprcnt = prcnt;
			oldts    = unixtimeAsInt();
			bconfig.SetPlugStatus(curplug);
			bconfig.SetPercentage(prcnt);
			bconfig.SetTimestamp(oldts);
		}
		String vx      = String.valueOf(voltage/1000.0);
		String ntext   = "";
		String ntitle  = ((prcnt == 100 && curplug == 1) ? gtx(R.string.fully_charged) :
		                  (curplug == 0 ? gtx(R.string.discharging_from)+" "+oldprcnt+"%" :
		                  gtx(R.string.charging_from)+" "+oldprcnt+"%"));
		String timetxt = getTimeString(oldts);
		int icon_id    = bconfig.GetIconFor(prcnt, (curplug!=0 && bconfig.ChargeGlow()) );
		if(bconfig.ShowDetails()) {
			String dgtmp = String.valueOf(temp/10.0)+gtx(R.string.degree)+"C";
			if(bconfig.TempInFahrenheit()) {
				dgtmp = String.valueOf( ( (int)((temp * 1.8)+320) )/10.0 )+gtx(R.string.degree)+"F";
			}
			ntext += vx+"V, "+dgtmp;
			ntext += _ICSFILTER_( ", "+gtx(R.string.capacity_at)+" "+prcnt+"%" );
		}
		else {
			ntext += (voltage == 0 ? "" : gtx(R.string.voltage)+" "+vx+" V");
			ntext += _ICSFILTER_( " // "+gtx(R.string.capacity_at)+" "+prcnt+"%" );
		}
		if(isICS() == true) {
			ntext = "..."+gtx(R.string.since)+" "+timetxt+" / "+ntext;
		}
		else {
			ntitle += " "+gtx(R.string.since)+": "+timetxt;
			ntext  += " "+gtx(R.string.since)+":";
		}
		Notification this_notify = new Notification(icon_id, null, System.currentTimeMillis());
		this_notify.flags |= Notification.FLAG_ONGOING_EVENT | Notification.FLAG_NO_CLEAR;
		this_notify.setLatestEventInfo(ctx, ntitle, ntext, getConfiguredIntent() );
		notify_manager.notify(0, this_notify);
	}