Input:
    private void createBridge(SootClass sootClass, SootMethod method, String selectorName) {
        Jimple j = Jimple.v();
        SootMethod msgSendMethod = getMsgSendMethod(selectorName, method);
        sootClass.addMethod(msgSendMethod);
        addBridgeAnnotation(msgSendMethod);
        SootMethod msgSendSuperMethod = null;
        if (!method.isStatic()) {
            msgSendSuperMethod = getMsgSendSuperMethod(selectorName, method);
            sootClass.addMethod(msgSendSuperMethod);
            addBridgeAnnotation(msgSendSuperMethod);
        }
        method.setModifiers(method.getModifiers() & ~NATIVE);
        Body body = j.newBody(method);
        method.setActiveBody(body);
        PatchingChain<Unit> units = body.getUnits();
        if (!method.isStatic()) {
            Local thiz = j.newLocal("$this", sootClass.getType());
            body.getLocals().add(thiz);
            units.add(j.newIdentityStmt(thiz, j.newThisRef(sootClass.getType())));
        }
        LinkedList<Value> args = new LinkedList<>();
        for (int i = 0; i < method.getParameterCount(); i++) {
            Type t = method.getParameterType(i);
            Local p = j.newLocal("$p" + i, t);
            body.getLocals().add(p);
            units.add(j.newIdentityStmt(p, j.newParameterRef(t, i)));
            args.add(p);
        }
        Local sel = j.newLocal("$sel", org_robovm_objc_Selector.getType());
        body.getLocals().add(sel);
        units.add(
            j.newAssignStmt(
                sel,
                j.newStaticFieldRef(
                    Scene.v().makeFieldRef(
                        sootClass,
                        getSelectorFieldName(selectorName),
                        org_robovm_objc_Selector.getType(), true)))
        );
        args.addFirst(sel);
        Local objCClass = null;
        if (method.isStatic()) {
            objCClass = j.newLocal("$objCClass", org_robovm_objc_ObjCClass.getType());
            body.getLocals().add(objCClass);
            units.add(
                j.newAssignStmt(
                    objCClass,
                    j.newStaticFieldRef(
                        Scene.v().makeFieldRef(
                            sootClass,
                            "$objCClass", org_robovm_objc_ObjCClass.getType(), true))
                )
            );
        }
        Local customClass = null;
        if (!Modifier.isFinal(sootClass.getModifiers()) && !method.isStatic()) {
            customClass = j.newLocal("$customClass", BooleanType.v());
            body.getLocals().add(customClass);
            units.add(
                j.newAssignStmt(
                    customClass,
                    j.newInstanceFieldRef(
                        body.getThisLocal(),
                        org_robovm_objc_ObjCObject_customClass)
                )
            );
        }
        Local ret = null;
        if (method.getReturnType() != VoidType.v()) {
            ret = j.newLocal("$ret", method.getReturnType());
            body.getLocals().add(ret);
        }
        StaticInvokeExpr invokeMsgSendExpr =
            j.newStaticInvokeExpr(
                msgSendMethod.makeRef(),
                l(method.isStatic() ? objCClass : body.getThisLocal(), args));
        Stmt invokeMsgSendStmt = ret == null
                ? j.newInvokeStmt(invokeMsgSendExpr)
                : j.newAssignStmt(ret, invokeMsgSendExpr);
        if (customClass != null) {
            units.add(
                j.newIfStmt(
                    j.newEqExpr(customClass, IntConstant.v(0)),
                    invokeMsgSendStmt)
            );
            Local zuper = j.newLocal("$super", org_robovm_objc_ObjCSuper.getType());
            body.getLocals().add(zuper);
            units.add(
                j.newAssignStmt(
                    zuper,
                    j.newVirtualInvokeExpr(
                        body.getThisLocal(),
                        org_robovm_objc_ObjCObject_getSuper))
            );
            StaticInvokeExpr invokeMsgSendSuperExpr =
                j.newStaticInvokeExpr(
                    msgSendMethod.makeRef(),
                    l(zuper, args));
            units.add(
                ret == null
                    ? j.newInvokeStmt(invokeMsgSendSuperExpr)
                    : j.newAssignStmt(ret, invokeMsgSendSuperExpr)
            );
            if (ret != null) {
                units.add(j.newReturnStmt(ret));
            } else {
                units.add(j.newReturnVoidStmt());
            }
        }
        units.add(invokeMsgSendStmt);
        if (ret != null) {
            units.add(j.newReturnStmt(ret));
        } else {
            units.add(j.newReturnVoidStmt());
        }
    }

Output:
    private void createBridge(SootClass sootClass, SootMethod method, String selectorName) {
        Jimple j = Jimple.v();
        SootMethod msgSendMethod = getMsgSendMethod(selectorName, method);
        sootClass.addMethod(msgSendMethod);
        addBridgeAnnotation(msgSendMethod);
        SootMethod msgSendSuperMethod = null;
        if (!method.isStatic()) {
            msgSendSuperMethod = getMsgSendSuperMethod(selectorName, method);
            sootClass.addMethod(msgSendSuperMethod);
            addBridgeAnnotation(msgSendSuperMethod);
        }
        method.setModifiers(method.getModifiers() & ~NATIVE);
        Body body = j.newBody(method);
        method.setActiveBody(body);
        PatchingChain<Unit> units = body.getUnits();
        if (!method.isStatic()) {
            Local thiz = j.newLocal("$this", sootClass.getType());
            body.getLocals().add(thiz);
            units.add(j.newIdentityStmt(thiz, j.newThisRef(sootClass.getType())));
        }
        LinkedList<Value> args = new LinkedList<>();
        for (int i = 0; i < method.getParameterCount(); i++) {
            Type t = method.getParameterType(i);
            Local p = j.newLocal("$p" + i, t);
            body.getLocals().add(p);
            units.add(j.newIdentityStmt(p, j.newParameterRef(t, i)));
            args.add(p);
        }
        Local sel = j.newLocal("$sel", org_robovm_objc_Selector.getType());
        body.getLocals().add(sel);
        units.add(
            j.newAssignStmt(
                sel,
                j.newStaticFieldRef(
                    Scene.v().makeFieldRef(
                        sootClass,
                        getSelectorFieldName(selectorName),
                        org_robovm_objc_Selector.getType(), true)))
        );
        args.addFirst(sel);
        Local objCClass = null;
        if (method.isStatic()) {
            objCClass = j.newLocal("$objCClass", org_robovm_objc_ObjCClass.getType());
            body.getLocals().add(objCClass);
            units.add(
                j.newAssignStmt(
                    objCClass,
                    j.newStaticFieldRef(
                        Scene.v().makeFieldRef(
                            sootClass,
                            "$objCClass", org_robovm_objc_ObjCClass.getType(), true))
                )
            );
        }
        Local customClass = null;
        if (!Modifier.isFinal(sootClass.getModifiers()) && !method.isStatic()) {
            customClass = j.newLocal("$customClass", BooleanType.v());
            body.getLocals().add(customClass);
            units.add(
                j.newAssignStmt(
                    customClass,
                    j.newInstanceFieldRef(
                        body.getThisLocal(),
                        org_robovm_objc_ObjCObject_customClass)
                )
            );
        }
        Local ret = null;
        if (method.getReturnType() != VoidType.v()) {
            ret = j.newLocal("$ret", method.getReturnType());
            body.getLocals().add(ret);
        }
        StaticInvokeExpr invokeMsgSendExpr =
            j.newStaticInvokeExpr(
                msgSendMethod.makeRef(),
                l(method.isStatic() ? objCClass : body.getThisLocal(), args));
        Stmt invokeMsgSendStmt = ret == null
                ? j.newInvokeStmt(invokeMsgSendExpr)
                : j.newAssignStmt(ret, invokeMsgSendExpr);
        if (customClass != null) {
            units.add(
                j.newIfStmt(
                    j.newEqExpr(customClass, IntConstant.v(0)),
                    invokeMsgSendStmt)
            );
            Local zuper = j.newLocal("$super", org_robovm_objc_ObjCSuper.getType());
            body.getLocals().add(zuper);
            units.add(
                j.newAssignStmt(
                    zuper,
                    j.newVirtualInvokeExpr(
                        body.getThisLocal(),
                        org_robovm_objc_ObjCObject_getSuper))
            );
            StaticInvokeExpr invokeMsgSendSuperExpr =
                j.newStaticInvokeExpr(
                    msgSendSuperMethod.makeRef(),
                    l(zuper, args));
            units.add(
                ret == null
                    ? j.newInvokeStmt(invokeMsgSendSuperExpr)
                    : j.newAssignStmt(ret, invokeMsgSendSuperExpr)
            );
            if (ret != null) {
                units.add(j.newReturnStmt(ret));
            } else {
                units.add(j.newReturnVoidStmt());
            }
        }
        units.add(invokeMsgSendStmt);
        if (ret != null) {
            units.add(j.newReturnStmt(ret));
        } else {
            units.add(j.newReturnVoidStmt());
        }
    }


Input:
	public IStructureViewNode createNode(IProgramElement node, List children) {
		AbstractIcon icon = iconRegistry.getStructureIcon(node.getKind(), node.getAccessibility());
		IStructureViewNode svNode = createDeclaration(node, icon, children);
		String nodeHandle = node.getHandleIdentifier();
		if (nodeHandle != null && !node.getKind().equals(IProgramElement.Kind.FIELD)) {
			List relationships = AsmManager.getDefault().getRelationshipMap().get(nodeHandle);
			if (relationships != null) {
				for (Iterator it = relationships.iterator(); it.hasNext(); ) {
					IRelationship rel = (IRelationship)it.next();
					if (rel != null && rel.getTargets().size() > 0) {
						IStructureViewNode relNode = createRelationship(
							rel,
							iconRegistry.getIcon(rel.getKind())
						);
						if (relNode != null) {
						svNode.add(relNode, 0);
							for (Iterator it2 = rel.getTargets().iterator(); it2.hasNext(); ) {
								String handle = (String)it2.next();
								IProgramElement link = AsmManager.getDefault().getHierarchy().findElementForHandle(handle);
								if (link != null) {
									IStructureViewNode linkNode = createLink(
										link,
										iconRegistry.getStructureIcon(link.getKind(), link.getAccessibility())
									);
									relNode.add(linkNode);
								}
							}
						}
					}
				}
			}
		}
		return svNode;
	}

Output:
	public IStructureViewNode createNode(IProgramElement node, List children) {
		AbstractIcon icon = iconRegistry.getStructureIcon(node.getKind(), node.getAccessibility());
		IStructureViewNode svNode = createDeclaration(node, icon, children);
		String nodeHandle = node.getHandleIdentifier();
		if (nodeHandle != null && !node.getKind().equals(IProgramElement.Kind.FIELD)) {
			AsmManager manager = AsmManager.getDefault();
			IRelationshipMap relMap = (manager==null?null:manager.getRelationshipMap());
			List relationships = (relMap==null?null:relMap.get(nodeHandle));
			if (relationships != null) {
				for (Iterator it = relationships.iterator(); it.hasNext(); ) {
					IRelationship rel = (IRelationship)it.next();
					if (rel != null && rel.getTargets().size() > 0) {
						IStructureViewNode relNode = createRelationship(
							rel,
							iconRegistry.getIcon(rel.getKind())
						);
						if (relNode != null) {
						svNode.add(relNode, 0);
							for (Iterator it2 = rel.getTargets().iterator(); it2.hasNext(); ) {
								String handle = (String)it2.next();
								IProgramElement link = AsmManager.getDefault().getHierarchy().findElementForHandle(handle);
								if (link != null) {
									IStructureViewNode linkNode = createLink(
										link,
										iconRegistry.getStructureIcon(link.getKind(), link.getAccessibility())
									);
									relNode.add(linkNode);
								}
							}
						}
					}
				}
			}
		}
		return svNode;
	}


Input:
	private Point fixupDisplayBounds(Point tipSize, Point location) {
		if (respectDisplayBounds || respectMonitorBounds) {
			Rectangle bounds;
			Point rightBounds = new Point(tipSize.x + location.x, tipSize.y
					+ location.y);
			Monitor[] ms = control.getDisplay().getMonitors();
			if (respectMonitorBounds && ms.length > 1) {
				bounds = control.getMonitor().getBounds();
				Point p = new Point(location.x, location.y);
				Rectangle tmp;
				for (int i = 0; i < ms.length; i++) {
					tmp = ms[i].getBounds();
					if (tmp.contains(p)) {
						bounds = tmp;
						break;
					}
				}
			} else {
				bounds = control.getDisplay().getBounds();
			}
			if (!(bounds.contains(location) && bounds.contains(rightBounds))) {
				if (rightBounds.x > bounds.width) {
					location.x -= rightBounds.x - bounds.width;
				}
				if (rightBounds.y > bounds.height) {
					location.y -= rightBounds.y - bounds.height;
				}
				if (location.x < bounds.x) {
					location.x = bounds.x;
				}
				if (location.y < bounds.y) {
					location.y = bounds.y;
				}
			}
		}
		return location;
	}

Output:
	private Point fixupDisplayBounds(Point tipSize, Point location) {
		if (respectDisplayBounds || respectMonitorBounds) {
			Rectangle bounds;
			Point rightBounds = new Point(tipSize.x + location.x, tipSize.y
					+ location.y);
			Monitor[] ms = control.getDisplay().getMonitors();
			if (respectMonitorBounds && ms.length > 1) {
				bounds = control.getMonitor().getBounds();
				Point p = new Point(location.x, location.y);
				Rectangle tmp;
				for (int i = 0; i < ms.length; i++) {
					tmp = ms[i].getBounds();
					if (tmp.contains(p)) {
						bounds = tmp;
						break;
					}
				}
			} else {
				bounds = control.getDisplay().getBounds();
			}
			if (!(bounds.contains(location) && bounds.contains(rightBounds))) {
				if (rightBounds.x > bounds.x + bounds.width) {
					location.x -= rightBounds.x - (bounds.x + bounds.width);
				}
				if (rightBounds.y > bounds.y + bounds.height) {
					location.y -= rightBounds.y - (bounds.y + bounds.height);
				}
				if (location.x < bounds.x) {
					location.x = bounds.x;
				}
				if (location.y < bounds.y) {
					location.y = bounds.y;
				}
			}
		}
		return location;
	}


Input:
	synchronized public void fetchUpdatesCaller( String friend, File galleryDir) throws DB461Exception {
		SNetDB461 db = null;
		try {
			db = new SNetDB461(mDBName);
			DDNSRRecord.ARecord ddnsResult;
			JSONObject args;
			Log.i(TAG, "Call to fetchUpdatesCaller for friend "+friend);
			ddnsResult = ddnsResolverService.resolve(friend);
			Log.v(TAG, "Resolved friend "+friend+" to DDNS address "+ddnsResult);
			Log.d(TAG, "Putting together JSON glob");
			JSONObject community = new JSONObject();
			JSONArray needphotos = new JSONArray();
			RecordSet<CommunityRecord> communityRecords = db.COMMUNITYTABLE.readAll();
			for (CommunityRecord cRecord : communityRecords) {
				JSONObject value = new JSONObject()
						.put("generation", cRecord.generation)
						.put("myphotohash", cRecord.myPhotoHash)
						.put("chosenphotohash", cRecord.chosenPhotoHash);
				community.put(cRecord.name.toString(), value);
				if (cRecord.isFriend) {
					PhotoRecord pRecord;
					int photoHash;
					pRecord = db.PHOTOTABLE.readOne(cRecord.myPhotoHash);
					photoHash = cRecord.myPhotoHash;
					if (pRecord == null && photoHash != 0) {
						needphotos.put(photoHash);
					}
					pRecord = db.PHOTOTABLE.readOne(cRecord.chosenPhotoHash);
					photoHash = cRecord.chosenPhotoHash;
					if (pRecord == null && photoHash != 0) {
						needphotos.put(photoHash);
					}
				}
			}
			args = new JSONObject()
				.put("community", community)
				.put("needphotos", needphotos);
			Log.d(TAG, "sending fetchUpdates RPC call with args: "+args);
			JSONObject response = RPCCall.invoke(ddnsResult.ip(), ddnsResult.port(), "snet", "fetchUpdates", args);
			Log.d(TAG, "response JSON of "+response);
			Iterator<String> keysIter;
			JSONObject communityUpdates = response.getJSONObject("communityupdates");
			keysIter = communityUpdates.keys();
			while (keysIter.hasNext()) {
				String name = keysIter.next();
				CommunityRecord cRecord = db.COMMUNITYTABLE.readOne(name);
				if (cRecord == null) {
					Log.i(TAG, "creating new db record for "+name);
					cRecord = db.COMMUNITYTABLE.createRecord();
					cRecord.name = new DDNSFullName(name);
					cRecord.isFriend = false;
				}
				JSONObject recordUpdate = communityUpdates.getJSONObject(name);
				int genNum = recordUpdate.getInt("generation");
				if (cRecord.generation <= genNum && isValidGenNum(genNum)) {
					Log.v(TAG, "old record for "+name+" was "+cRecord);
					Log.d(TAG, "updating record for "+name+" to "+recordUpdate);
					cRecord.generation = genNum;
					int oldHash = cRecord.myPhotoHash;
					int newHash = recordUpdate.getInt("myphotohash");
					if (oldHash != newHash) {
						incrementPhotoDB(db, newHash, (galleryDir+newHash+".jpg"));
						decrementPhotoDB(db, oldHash);
						cRecord.myPhotoHash = newHash;
					}
					oldHash = cRecord.chosenPhotoHash;
					newHash = recordUpdate.getInt("chosenphotohash");
					if (oldHash != newHash) {
						incrementPhotoDB(db, newHash, (galleryDir+newHash+".jpg"));
						decrementPhotoDB(db, oldHash);
						cRecord.chosenPhotoHash = newHash;
					}
				} else {
					Log.i(TAG, "fetchUpdates returned record for "+name+", but was not more recent than ours");
				}
				db.COMMUNITYTABLE.write(cRecord);
			}
			JSONArray photoHashes = response.getJSONArray("photoupdates");
			for (int i=0; i<photoHashes.length(); i++) {
				int photoHash = photoHashes.getInt(i);
				PhotoRecord pRecord = db.PHOTOTABLE.readOne(photoHash);
				if (pRecord != null) {
					fetchPhotoAndSave(ddnsResult.ip(), ddnsResult.port(), pRecord);
				} else {
					Log.w(TAG, "Photo can't be updated because no Photo DB entry for its hash: "+photoHash);
				}
			}
		} catch(DDNSException e) {
			e.printStackTrace();
		} catch(JSONException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		} finally {
			if ( db != null ) db.discard();
		}
	}

Output:
	synchronized public void fetchUpdatesCaller( String friend, File galleryDir) throws DB461Exception {
		SNetDB461 db = null;
		try {
			db = new SNetDB461(mDBName);
			DDNSRRecord.ARecord ddnsResult;
			JSONObject args;
			Log.i(TAG, "Call to fetchUpdatesCaller for friend "+friend);
			ddnsResult = ddnsResolverService.resolve(friend);
			Log.v(TAG, "Resolved friend "+friend+" to DDNS address "+ddnsResult);
			Log.d(TAG, "Putting together JSON glob");
			JSONObject community = new JSONObject();
			JSONArray needphotos = new JSONArray();
			RecordSet<CommunityRecord> communityRecords = db.COMMUNITYTABLE.readAll();
			for (CommunityRecord cRecord : communityRecords) {
				JSONObject value = new JSONObject()
						.put("generation", cRecord.generation)
						.put("myphotohash", cRecord.myPhotoHash)
						.put("chosenphotohash", cRecord.chosenPhotoHash);
				community.put(cRecord.name.toString(), value);
				if (cRecord.isFriend) {
					PhotoRecord pRecord;
					int photoHash;
					pRecord = db.PHOTOTABLE.readOne(cRecord.myPhotoHash);
					photoHash = cRecord.myPhotoHash;
					if (pRecord == null && photoHash != 0) {
						needphotos.put(photoHash);
					}
					pRecord = db.PHOTOTABLE.readOne(cRecord.chosenPhotoHash);
					photoHash = cRecord.chosenPhotoHash;
					if (pRecord == null && photoHash != 0) {
						needphotos.put(photoHash);
					}
				}
			}
			args = new JSONObject()
				.put("community", community)
				.put("needphotos", needphotos);
			Log.d(TAG, "sending fetchUpdates RPC call with args: "+args);
			JSONObject response = RPCCall.invoke(ddnsResult.ip(), ddnsResult.port(), "snet", "fetchUpdates", args);
			Log.d(TAG, "response JSON of "+response);
			Iterator<String> keysIter;
			JSONObject communityUpdates = response.getJSONObject("communityupdates");
			keysIter = communityUpdates.keys();
			while (keysIter.hasNext()) {
				String name = keysIter.next();
				CommunityRecord cRecord = db.COMMUNITYTABLE.readOne(name);
				if (cRecord == null) {
					Log.i(TAG, "creating new db record for "+name);
					cRecord = db.COMMUNITYTABLE.createRecord();
					cRecord.name = new DDNSFullName(name);
					cRecord.isFriend = false;
				}
				JSONObject recordUpdate = communityUpdates.getJSONObject(name);
				int genNum = recordUpdate.getInt("generation");
				if (cRecord.generation <= genNum && isValidGenNum(genNum)) {
					Log.v(TAG, "old record for "+name+" was "+cRecord);
					Log.d(TAG, "updating record for "+name+" to "+recordUpdate);
					cRecord.generation = genNum;
					int oldHash = cRecord.myPhotoHash;
					int newHash = recordUpdate.getInt("myphotohash");
					if (oldHash != newHash) {
						incrementPhotoDB(db, newHash, (galleryDir.getCanonicalPath()+ File.separatorChar+newHash+".jpg"));
						decrementPhotoDB(db, oldHash);
						cRecord.myPhotoHash = newHash;
					}
					oldHash = cRecord.chosenPhotoHash;
					newHash = recordUpdate.getInt("chosenphotohash");
					if (oldHash != newHash) {
						incrementPhotoDB(db, newHash, (galleryDir.getCanonicalPath()+ File.separatorChar+newHash+".jpg"));
						decrementPhotoDB(db, oldHash);
						cRecord.chosenPhotoHash = newHash;
					}
				} else {
					Log.i(TAG, "fetchUpdates returned record for "+name+", but was not more recent than ours");
				}
				db.COMMUNITYTABLE.write(cRecord);
			}
			JSONArray photoHashes = response.getJSONArray("photoupdates");
			for (int i=0; i<photoHashes.length(); i++) {
				int photoHash = photoHashes.getInt(i);
				PhotoRecord pRecord = db.PHOTOTABLE.readOne(photoHash);
				if (pRecord != null) {
					fetchPhotoAndSave(ddnsResult.ip(), ddnsResult.port(), pRecord);
				} else {
					Log.w(TAG, "Photo can't be updated because no Photo DB entry for its hash: "+photoHash);
				}
			}
		} catch(DDNSException e) {
			e.printStackTrace();
		} catch(JSONException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		} finally {
			if ( db != null ) db.discard();
		}
	}


Input:
	public void renderHead(HtmlHeaderContainer container)
	{
		super.renderHead(container);
		PageParameters parameters = new PageParameters();
		parameters.put("fieldName", this.getId());
		CharSequence url = urlFor(null, page, parameters);
		JavascriptBuilder builder = new JavascriptBuilder();
		builder.addLine("new Ajax.Autocompleter(");
		builder.addLine("  '" + getMarkupId() + "', ");
		builder.addLine("  '" + getAutocompleteId() + "', ");
		builder.addLine("  '" + url + "', {} );");
	}

Output:
	public void renderHead(HtmlHeaderContainer container)
	{
		super.renderHead(container);
		PageParameters parameters = new PageParameters();
		parameters.put("fieldName", this.getMarkupId());
		CharSequence url = urlFor(null, page, parameters);
		JavascriptBuilder builder = new JavascriptBuilder();
		builder.addLine("new Ajax.Autocompleter(");
		builder.addLine("  '" + getMarkupId() + "', ");
		builder.addLine("  '" + getAutocompleteId() + "', ");
		builder.addLine("  '" + url + "', {} );");
	}


Input:
    public void enqueueNotificationInternal(String pkg, int callingUid, int callingPid,
            String tag, int id, Notification notification, int[] idOut)
    {
        if (DBG) {
            Slog.v(TAG, "enqueueNotificationInternal: pkg=" + pkg + " id=" + id + " notification=" + notification);
        }
        checkCallerIsSystemOrSameApp(pkg);
        final boolean isSystemNotification = ("android".equals(pkg));
        if (!isSystemNotification) {
            synchronized (mNotificationList) {
                int count = 0;
                final int N = mNotificationList.size();
                for (int i=0; i<N; i++) {
                    final NotificationRecord r = mNotificationList.get(i);
                    if (r.pkg.equals(pkg)) {
                        count++;
                        if (count >= MAX_PACKAGE_NOTIFICATIONS) {
                            Slog.e(TAG, "Package has already posted " + count
                                    + " notifications.  Not showing more.  package=" + pkg);
                            return;
                        }
                    }
                }
            }
        }
        if (!pkg.equals("com.android.providers.downloads")
                || Log.isLoggable("DownloadManager", Log.VERBOSE)) {
            EventLog.writeEvent(EventLogTags.NOTIFICATION_ENQUEUE, pkg, id, tag,
                    notification.toString());
        }
        if (pkg == null || notification == null) {
            throw new IllegalArgumentException("null not allowed: pkg=" + pkg
                    + " id=" + id + " notification=" + notification);
        }
        if (notification.icon != 0) {
            if (notification.contentView == null) {
                throw new IllegalArgumentException("contentView required: pkg=" + pkg
                        + " id=" + id + " notification=" + notification);
            }
        }
        notification.priority = clamp(notification.priority, Notification.PRIORITY_MIN, Notification.PRIORITY_MAX);
        if (0 != (notification.flags & Notification.FLAG_HIGH_PRIORITY)) {
            if (notification.priority < Notification.PRIORITY_MAX) notification.priority = Notification.PRIORITY_MAX;
        } else if (SCORE_ONGOING_HIGHER && 0 != (notification.flags & Notification.FLAG_ONGOING_EVENT)) {
            if (notification.priority < Notification.PRIORITY_HIGH) notification.priority = Notification.PRIORITY_HIGH;
        }
        int score = notification.priority * NOTIFICATION_PRIORITY_MULTIPLIER;
        if (ENABLE_BLOCKED_NOTIFICATIONS && !isSystemNotification && !areNotificationsEnabledForPackageInt(pkg)) {
            score = JUNK_SCORE;
            Slog.e(TAG, "Suppressing notification from package " + pkg + " by user request.");
        }
        if (DBG) {
            Slog.v(TAG, "Assigned score=" + score + " to " + notification);
        }
        if (score < SCORE_DISPLAY_THRESHOLD) {
            return;
        }
        synchronized (mNotificationList) {
            final boolean inQuietHours = inQuietHours();
            NotificationRecord r = new NotificationRecord(pkg, tag, id,
                    callingUid, callingPid,
                    score,
                    notification);
            NotificationRecord old = null;
            int index = indexOfNotificationLocked(pkg, tag, id);
            if (index < 0) {
                mNotificationList.add(r);
            } else {
                old = mNotificationList.remove(index);
                mNotificationList.add(index, r);
                if (old != null) {
                    notification.flags |=
                        old.notification.flags&Notification.FLAG_FOREGROUND_SERVICE;
                }
            }
            if ((notification.flags&Notification.FLAG_FOREGROUND_SERVICE) != 0) {
                notification.flags |= Notification.FLAG_ONGOING_EVENT
                        | Notification.FLAG_NO_CLEAR;
            }
            if (notification.icon != 0) {
                StatusBarNotification n = new StatusBarNotification(pkg, id, tag,
                        r.uid, r.initialPid, score, notification);
                if (old != null && old.statusBarKey != null) {
                    r.statusBarKey = old.statusBarKey;
                    long identity = Binder.clearCallingIdentity();
                    try {
                        mStatusBar.updateNotification(r.statusBarKey, n);
                    }
                    finally {
                        Binder.restoreCallingIdentity(identity);
                    }
                } else {
                    long identity = Binder.clearCallingIdentity();
                    try {
                        r.statusBarKey = mStatusBar.addNotification(n);
                        if ((n.notification.flags & Notification.FLAG_SHOW_LIGHTS) != 0) {
                            mAttentionLight.pulse();
                        }
                    }
                    finally {
                        Binder.restoreCallingIdentity(identity);
                    }
                }
                sendAccessibilityEvent(notification, pkg);
            } else {
                Slog.e(TAG, "Ignoring notification with icon==0: " + notification);
                if (old != null && old.statusBarKey != null) {
                    long identity = Binder.clearCallingIdentity();
                    try {
                        mStatusBar.removeNotification(old.statusBarKey);
                    }
                    finally {
                        Binder.restoreCallingIdentity(identity);
                    }
                }
            }
            try {
                final ProfileManager profileManager =
                        (ProfileManager) mContext.getSystemService(Context.PROFILE_SERVICE);
                ProfileGroup group = profileManager.getActiveProfileGroup(pkg);
                notification = group.processNotification(notification);
            } catch(Throwable th) {
                Log.e(TAG, "An error occurred profiling the notification.", th);
            }
            if (((mDisabledNotifications & StatusBarManager.DISABLE_NOTIFICATION_ALERTS) == 0)
                    && (!(old != null
                        && (notification.flags & Notification.FLAG_ONLY_ALERT_ONCE) != 0 ))
                    && mSystemReady) {
                final AudioManager audioManager = (AudioManager) mContext
                .getSystemService(Context.AUDIO_SERVICE);
                final boolean useDefaultSound =
                    (notification.defaults & Notification.DEFAULT_SOUND) != 0;
                if (!(inQuietHours && mQuietHoursMute)
                        && (useDefaultSound || notification.sound != null)) {
                    Uri uri;
                    if (useDefaultSound) {
                        uri = Settings.System.DEFAULT_NOTIFICATION_URI;
                    } else {
                        uri = notification.sound;
                    }
                    boolean looping = (notification.flags & Notification.FLAG_INSISTENT) != 0;
                    int audioStreamType;
                    if (notification.audioStreamType >= 0) {
                        audioStreamType = notification.audioStreamType;
                    } else {
                        audioStreamType = DEFAULT_STREAM_TYPE;
                    }
                    mSoundNotification = r;
                    if (audioManager.getStreamVolume(audioStreamType) != 0) {
                        final long identity = Binder.clearCallingIdentity();
                        try {
                            final IRingtonePlayer player = mAudioService.getRingtonePlayer();
                            if (player != null) {
                                player.playAsync(uri, looping, audioStreamType);
                            }
                        } catch (RemoteException e) {
                        } finally {
                            Binder.restoreCallingIdentity(identity);
                        }
                    }
                }
                final boolean useDefaultVibrate =
                    (notification.defaults & Notification.DEFAULT_VIBRATE) != 0;
                if (!(inQuietHours && mQuietHoursStill)
                        && (useDefaultVibrate || notification.vibrate != null)
                        && !(audioManager.getRingerMode() == AudioManager.RINGER_MODE_SILENT)) {
                    mVibrateNotification = r;
                    mVibrator.vibrate(useDefaultVibrate ? DEFAULT_VIBRATE_PATTERN
                                                        : notification.vibrate,
                              ((notification.flags & Notification.FLAG_INSISTENT) != 0) ? 0: -1);
                }
            }
            mLights.remove(old);
            if (mLedNotification == old) {
                mLedNotification = null;
            }
            if ((notification.flags & Notification.FLAG_SHOW_LIGHTS) != 0) {
                mLights.add(r);
                updateLightsLocked();
            } else {
                if (old != null
                        && ((old.notification.flags & Notification.FLAG_SHOW_LIGHTS) != 0)) {
                    updateLightsLocked();
                }
            }
        }
        idOut[0] = id;
    }

Output:
    public void enqueueNotificationInternal(String pkg, int callingUid, int callingPid,
            String tag, int id, Notification notification, int[] idOut)
    {
        if (DBG) {
            Slog.v(TAG, "enqueueNotificationInternal: pkg=" + pkg + " id=" + id + " notification=" + notification);
        }
        checkCallerIsSystemOrSameApp(pkg);
        final boolean isSystemNotification = ("android".equals(pkg));
        if (!isSystemNotification) {
            synchronized (mNotificationList) {
                int count = 0;
                final int N = mNotificationList.size();
                for (int i=0; i<N; i++) {
                    final NotificationRecord r = mNotificationList.get(i);
                    if (r.pkg.equals(pkg)) {
                        count++;
                        if (count >= MAX_PACKAGE_NOTIFICATIONS) {
                            Slog.e(TAG, "Package has already posted " + count
                                    + " notifications.  Not showing more.  package=" + pkg);
                            return;
                        }
                    }
                }
            }
        }
        if (!pkg.equals("com.android.providers.downloads")
                || Log.isLoggable("DownloadManager", Log.VERBOSE)) {
            EventLog.writeEvent(EventLogTags.NOTIFICATION_ENQUEUE, pkg, id, tag,
                    notification.toString());
        }
        if (pkg == null || notification == null) {
            throw new IllegalArgumentException("null not allowed: pkg=" + pkg
                    + " id=" + id + " notification=" + notification);
        }
        if (notification.icon != 0) {
            if (notification.contentView == null) {
                throw new IllegalArgumentException("contentView required: pkg=" + pkg
                        + " id=" + id + " notification=" + notification);
            }
        }
        notification.priority = clamp(notification.priority, Notification.PRIORITY_MIN, Notification.PRIORITY_MAX);
        if (0 != (notification.flags & Notification.FLAG_HIGH_PRIORITY)) {
            if (notification.priority < Notification.PRIORITY_MAX) notification.priority = Notification.PRIORITY_MAX;
        } else if (SCORE_ONGOING_HIGHER && 0 != (notification.flags & Notification.FLAG_ONGOING_EVENT)) {
            if (notification.priority < Notification.PRIORITY_HIGH) notification.priority = Notification.PRIORITY_HIGH;
        }
        int score = notification.priority * NOTIFICATION_PRIORITY_MULTIPLIER;
        if (ENABLE_BLOCKED_NOTIFICATIONS && !isSystemNotification && !areNotificationsEnabledForPackageInt(pkg)) {
            score = JUNK_SCORE;
            Slog.e(TAG, "Suppressing notification from package " + pkg + " by user request.");
        }
        if (DBG) {
            Slog.v(TAG, "Assigned score=" + score + " to " + notification);
        }
        if (score < SCORE_DISPLAY_THRESHOLD) {
            return;
        }
        synchronized (mNotificationList) {
            final boolean inQuietHours = inQuietHours();
            NotificationRecord r = new NotificationRecord(pkg, tag, id,
                    callingUid, callingPid,
                    score,
                    notification);
            NotificationRecord old = null;
            int index = indexOfNotificationLocked(pkg, tag, id);
            if (index < 0) {
                mNotificationList.add(r);
            } else {
                old = mNotificationList.remove(index);
                mNotificationList.add(index, r);
                if (old != null) {
                    notification.flags |=
                        old.notification.flags&Notification.FLAG_FOREGROUND_SERVICE;
                }
            }
            if ((notification.flags&Notification.FLAG_FOREGROUND_SERVICE) != 0) {
                notification.flags |= Notification.FLAG_ONGOING_EVENT
                        | Notification.FLAG_NO_CLEAR;
            }
            if (notification.icon != 0) {
                StatusBarNotification n = new StatusBarNotification(pkg, id, tag,
                        r.uid, r.initialPid, score, notification);
                if (old != null && old.statusBarKey != null) {
                    r.statusBarKey = old.statusBarKey;
                    long identity = Binder.clearCallingIdentity();
                    try {
                        mStatusBar.updateNotification(r.statusBarKey, n);
                    }
                    finally {
                        Binder.restoreCallingIdentity(identity);
                    }
                } else {
                    long identity = Binder.clearCallingIdentity();
                    try {
                        r.statusBarKey = mStatusBar.addNotification(n);
                        if ((n.notification.flags & Notification.FLAG_SHOW_LIGHTS) != 0) {
                            mAttentionLight.pulse();
                        }
                    }
                    finally {
                        Binder.restoreCallingIdentity(identity);
                    }
                }
                sendAccessibilityEvent(notification, pkg);
            } else {
                Slog.e(TAG, "Ignoring notification with icon==0: " + notification);
                if (old != null && old.statusBarKey != null) {
                    long identity = Binder.clearCallingIdentity();
                    try {
                        mStatusBar.removeNotification(old.statusBarKey);
                    }
                    finally {
                        Binder.restoreCallingIdentity(identity);
                    }
                }
            }
            try {
                final ProfileManager profileManager =
                        (ProfileManager) mContext.getSystemService(Context.PROFILE_SERVICE);
                ProfileGroup group = profileManager.getActiveProfileGroup(pkg);
                if (group != null) {
                    notification = group.processNotification(notification);
                }
            } catch(Throwable th) {
                Log.e(TAG, "An error occurred profiling the notification.", th);
            }
            if (((mDisabledNotifications & StatusBarManager.DISABLE_NOTIFICATION_ALERTS) == 0)
                    && (!(old != null
                        && (notification.flags & Notification.FLAG_ONLY_ALERT_ONCE) != 0 ))
                    && mSystemReady) {
                final AudioManager audioManager = (AudioManager) mContext
                .getSystemService(Context.AUDIO_SERVICE);
                final boolean useDefaultSound =
                    (notification.defaults & Notification.DEFAULT_SOUND) != 0;
                if (!(inQuietHours && mQuietHoursMute)
                        && (useDefaultSound || notification.sound != null)) {
                    Uri uri;
                    if (useDefaultSound) {
                        uri = Settings.System.DEFAULT_NOTIFICATION_URI;
                    } else {
                        uri = notification.sound;
                    }
                    boolean looping = (notification.flags & Notification.FLAG_INSISTENT) != 0;
                    int audioStreamType;
                    if (notification.audioStreamType >= 0) {
                        audioStreamType = notification.audioStreamType;
                    } else {
                        audioStreamType = DEFAULT_STREAM_TYPE;
                    }
                    mSoundNotification = r;
                    if (audioManager.getStreamVolume(audioStreamType) != 0) {
                        final long identity = Binder.clearCallingIdentity();
                        try {
                            final IRingtonePlayer player = mAudioService.getRingtonePlayer();
                            if (player != null) {
                                player.playAsync(uri, looping, audioStreamType);
                            }
                        } catch (RemoteException e) {
                        } finally {
                            Binder.restoreCallingIdentity(identity);
                        }
                    }
                }
                final boolean useDefaultVibrate =
                    (notification.defaults & Notification.DEFAULT_VIBRATE) != 0;
                if (!(inQuietHours && mQuietHoursStill)
                        && (useDefaultVibrate || notification.vibrate != null)
                        && !(audioManager.getRingerMode() == AudioManager.RINGER_MODE_SILENT)) {
                    mVibrateNotification = r;
                    mVibrator.vibrate(useDefaultVibrate ? DEFAULT_VIBRATE_PATTERN
                                                        : notification.vibrate,
                              ((notification.flags & Notification.FLAG_INSISTENT) != 0) ? 0: -1);
                }
            }
            mLights.remove(old);
            if (mLedNotification == old) {
                mLedNotification = null;
            }
            if ((notification.flags & Notification.FLAG_SHOW_LIGHTS) != 0) {
                mLights.add(r);
                updateLightsLocked();
            } else {
                if (old != null
                        && ((old.notification.flags & Notification.FLAG_SHOW_LIGHTS) != 0)) {
                    updateLightsLocked();
                }
            }
        }
        idOut[0] = id;
    }


Input:
    public void execute( Map context )
        throws ContinuumException, ContinuumStoreException
    {
        int projectGroupId = getProjectGroupId( context );
        ProjectGroup projectGroup = store.getProjectGroup( projectGroupId );
        try
        {
            if ( !roleManager.templatedRoleExists( "project-administrator", projectGroup.getName() ) )
            {
                roleManager.removeTemplatedRole( "project-administrator", projectGroup.getName() );
            }
            if ( !roleManager.templatedRoleExists( "project-developer", projectGroup.getName() ) )
            {
                roleManager.removeTemplatedRole( "project-developer", projectGroup.getName() );
            }
            if ( !roleManager.templatedRoleExists( "project-user", projectGroup.getName() ) )
            {
                roleManager.removeTemplatedRole( "project-user", projectGroup.getName() );
            }
        }
        catch ( RoleManagerException e )
        {
            e.printStackTrace();
            throw new ContinuumException( "error removing tempalted role for project " + projectGroup.getName(), e );
        }
    }

Output:
    public void execute( Map context )
        throws ContinuumException, ContinuumStoreException
    {
        int projectGroupId = getProjectGroupId( context );
        ProjectGroup projectGroup = store.getProjectGroup( projectGroupId );
        try
        {
            if ( !roleManager.templatedRoleExists( "project-administrator", projectGroup.getName() ) )
            {
                roleManager.removeTemplatedRole( "project-administrator", projectGroup.getName() );
            }
            if ( !roleManager.templatedRoleExists( "project-developer", projectGroup.getName() ) )
            {
                roleManager.removeTemplatedRole( "project-developer", projectGroup.getName() );
            }
            if ( !roleManager.templatedRoleExists( "project-user", projectGroup.getName() ) )
            {
                roleManager.removeTemplatedRole( "project-user", projectGroup.getName() );
            }
        }
        catch ( RoleManagerException e )
        {
            e.printStackTrace();
            throw new ContinuumException( "error removing templated role for project " + projectGroup.getName(), e );
        }
    }


Input:
	public boolean processFeedMetadata(OPDSFeedMetadata feed, boolean beforeEntries) {
		Icon = (feed.Icon != null) ? ZLNetworkUtil.url(myBaseURL, feed.Icon.Uri) : null;
		Title = feed.Title;
		Summary = feed.Subtitle;
		for (ATOMLink link: feed.Links) {
			final MimeType type = MimeType.get(link.getType());
			final String rel = myLink.relation(link.getRel(), type);
			if ("search".equals(rel)) {
				if (MimeType.APP_OPENSEARCHDESCRIPTION.equals(type)) {
					myOpensearchDescriptionURLs.add(ZLNetworkUtil.url(myBaseURL, link.getHref()));
				} else if (MimeType.APP_ATOM_XML.weakEquals(type)) {
					final String template = ZLNetworkUtil.url(myBaseURL, link.getHref());
					final OpenSearchDescription descr = OpenSearchDescription.createDefault(template);
					if (descr.isValid()) {
						DirectOpenSearchDescription = descr;
					}
				}
			}
		}
		return true;
	}

Output:
	public boolean processFeedMetadata(OPDSFeedMetadata feed, boolean beforeEntries) {
		Icon = (feed.Icon != null) ? ZLNetworkUtil.url(myBaseURL, feed.Icon.Uri) : null;
		Title = feed.Title;
		Summary = feed.Subtitle;
		for (ATOMLink link: feed.Links) {
			final MimeType type = MimeType.get(link.getType());
			final String rel = myLink.relation(link.getRel(), type);
			if ("search".equals(rel)) {
				if (MimeType.APP_OPENSEARCHDESCRIPTION.equals(type)) {
					final String template = ZLNetworkUtil.url(myBaseURL, link.getHref());
					final OpenSearchDescription descr = OpenSearchDescription.createDefault(template);
					if (descr.isValid()) {
						DirectOpenSearchDescription = descr;
					}
				} else if (MimeType.APP_ATOM_XML.weakEquals(type)) {
					myOpensearchDescriptionURLs.add(ZLNetworkUtil.url(myBaseURL, link.getHref()));
				}
			}
		}
		return true;
	}


Input:
public boolean configure(Element element, ClientFactory clientFactory,
			Arguments args) {
		super.configure(element, clientFactory, args);
		sortable = !options.contains("NoSort");
		table.setWidth("100%");
		add(table, CENTER);
		name = new ClickableHtmlColumn<String>() {
			@Override
			public String getValue(String name) {
				return Measurement.getDisplayName(name);
			}
			@Override
			public void render(Context context, String name, SafeHtmlBuilder sb) {
				String s = getValue(name);
				Measurement m = history.getMeasurement(ptu, name);
				if (m == null) {
					return;
				}
				((ClickableTextCell) getCell()).render(context, decorate(s, m),
						sb);
			}
		};
		name.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
		name.setSortable(sortable);
		if (selectable) {
			name.setFieldUpdater(new FieldUpdater<String, String>() {
				@Override
				public void update(int index, String object, String value) {
					selectMeasurement(object);
				}
			});
		}
		table.addColumn(name, showHeader ? new TextHeader("") {
			@Override
			public String getValue() {
				if (!showName)
					return null;
				return ptu != null ? ptu.getName() : null;
			}
			public void render(Context context, SafeHtmlBuilder sb) {
				String s = getValue();
				if (s != null) {
					s = "PTU: " + ptu.getName();
					if (interventions != null) {
						String realName = interventions.get(ptu) != null ? interventions
								.get(ptu).getName() : null;
						if (realName != null) {
							s = "
" + realName
									+ "
";
						}
					}
					sb.append(SafeHtmlUtils.fromSafeConstant(s));
				}
			};
		}
				: null);
		ClickableTextColumn<String> value = new ClickableTextColumn<String>() {
			@Override
			public String getValue(String name) {
				if ((name == null) || (history == null) || (ptu == null)) {
					return "";
				}
				Measurement m = history.getMeasurement(ptu, name);
				return m != null ? format.format(m.getValue()) : "";
			}
			@Override
			public void render(Context context, String name, SafeHtmlBuilder sb) {
				String s = getValue(name);
				Measurement m = history != null ? history.getMeasurement(
						ptu, name) : null;
				if (m == null) {
					return;
				}
				double c = m.getValue().doubleValue();
				double lo = m.getLowLimit().doubleValue();
				double hi = m.getHighLimit().doubleValue();
				String status = lo >= hi ? "in_range" : c < lo ? "lo-limit"
						: c > hi ? "hi-limit" : "in-range";
				sb.append(SafeHtmlUtils.fromSafeConstant("
"));
				((ClickableTextCell) getCell()).render(context,
						decorate(s, m, last), sb);
				sb.append(SafeHtmlUtils.fromSafeConstant("
"));
			}
		};
		value.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
		if (selectable) {
			value.setFieldUpdater(new FieldUpdater<String, String>() {
				@Override
				public void update(int index, String object, String value) {
					selectMeasurement(object);
				}
			});
		}
		table.addColumn(value, showHeader ? new TextHeader("Value")
				: (Header<?>) null);
		ClickableHtmlColumn<String> unit = new ClickableHtmlColumn<String>() {
			@Override
			public String getValue(String name) {
				Measurement m = history != null ? history.getMeasurement(
						ptu, name) : null;
				return m != null ? m.getUnit() : "";
			}
			@Override
			public void render(Context context, String name, SafeHtmlBuilder sb) {
				String s = getValue(name);
				Measurement m = history != null ? history.getMeasurement(
						ptu, name) : null;
				if (m == null) {
					return;
				}
				((ClickableTextCell) getCell()).render(context, decorate(s, m),
						sb);
			}
		};
		unit.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
		unit.setSortable(sortable);
		if (selectable) {
			unit.setFieldUpdater(new FieldUpdater<String, String>() {
				@Override
				public void update(int index, String object, String value) {
					selectMeasurement(object);
				}
			});
		}
		table.addColumn(unit, showHeader ? new TextHeader("Unit")
				: (Header<?>) null);
		ClickableHtmlColumn<String> date = new ClickableHtmlColumn<String>() {
			@Override
			public String getValue(String name) {
				Measurement measurement = history
						.getMeasurement(ptu, name);
				return measurement != null ? PtuClientConstants.dateFormat
						.format(measurement.getDate()) : "";
			}
			@Override
			public void render(Context context, String name, SafeHtmlBuilder sb) {
				String s = getValue(name);
				Measurement m = history.getMeasurement(ptu, name);
				if (m == null) {
					return;
				}
				((ClickableTextCell) getCell()).render(context, decorate(s, m),
						sb);
			}
		};
		unit.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
		unit.setSortable(sortable);
		if (selectable) {
			unit.setFieldUpdater(new FieldUpdater<String, String>() {
				@Override
				public void update(int index, String object, String value) {
					selectMeasurement(object);
				}
			});
		}
		if (showDate) {
			table.addColumn(date, showHeader ? new TextHeader("Date")
					: (Header<?>) null);
		}
		List<String> list = new ArrayList<String>();
		dataProvider.addDataDisplay(table);
		dataProvider.setList(list);
		columnSortHandler = new ListHandler<String>(dataProvider.getList());
		columnSortHandler.setComparator(name, new Comparator<String>() {
			public int compare(String s1, String s2) {
				if (s1 == s2) {
					return 0;
				}
				if (s1 != null) {
					return s1.compareTo(s2);
				}
				return -1;
			}
		});
		columnSortHandler.setComparator(value, new Comparator<String>() {
			public int compare(String s1, String s2) {
				Measurement o1 = history.getMeasurement(ptu, s1);
				Measurement o2 = history.getMeasurement(ptu, s2);
				if (o1 == o2) {
					return 0;
				}
				if ((o1 != null) && (o1.getValue() != null)) {
					if ((o2 != null) && (o2.getValue() != null)) {
						double d1 = o1.getValue().doubleValue();
						double d2 = o2.getValue().doubleValue();
						return d1 < d2 ? -1 : d1 == d2 ? 0 : 1;
					}
					return 1;
				}
				return -1;
			}
		});
		columnSortHandler.setComparator(unit, new Comparator<String>() {
			public int compare(String s1, String s2) {
				Measurement o1 = history.getMeasurement(ptu, s1);
				Measurement o2 = history.getMeasurement(ptu, s2);
				if (o1 == o2) {
					return 0;
				}
				if (o1 != null) {
					return (o2 != null) ? o1.getUnit().compareTo(o2.getUnit())
							: 1;
				}
				return -1;
			}
		});
		columnSortHandler.setComparator(date, new Comparator<String>() {
			public int compare(String s1, String s2) {
				Measurement o1 = history.getMeasurement(ptu, s1);
				Measurement o2 = history.getMeasurement(ptu, s2);
				if (o1 == o2) {
					return 0;
				}
				if (o1 != null) {
					return (o2 != null) ? o1.getDate().compareTo(o2.getDate())
							: 1;
				}
				return -1;
			}
		});
		table.addColumnSortHandler(columnSortHandler);
		table.getColumnSortList().push(name);
		if (selectable) {
			table.setSelectionModel(selectionModel);
			selectionModel
					.addSelectionChangeHandler(new SelectionChangeEvent.Handler() {
						@Override
						public void onSelectionChange(SelectionChangeEvent event) {
							String s = selectionModel.getSelectedObject();
							log.info(s + " " + event.getSource());
						}
					});
		}
		return true;
	}

Output:
	public boolean configure(Element element, ClientFactory clientFactory,
			Arguments args) {
		super.configure(element, clientFactory, args);
		sortable = !options.contains("NoSort");
		table.setWidth("100%");
		add(table, CENTER);
		name = new ClickableHtmlColumn<String>() {
			@Override
			public String getValue(String name) {
				return Measurement.getDisplayName(name);
			}
			@Override
			public void render(Context context, String name, SafeHtmlBuilder sb) {
				String s = getValue(name);
				Measurement m = history.getMeasurement(ptu, name);
				if (m == null) {
					return;
				}
				((ClickableTextCell) getCell()).render(context, decorate(s, m),
						sb);
			}
		};
		name.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
		name.setSortable(sortable);
		if (selectable) {
			name.setFieldUpdater(new FieldUpdater<String, String>() {
				@Override
				public void update(int index, String object, String value) {
					selectMeasurement(object);
				}
			});
		}
		table.addColumn(name, showHeader ? new TextHeader("") {
			@Override
			public String getValue() {
				if (!showName)
					return null;
				return ptu != null ? ptu.getName() : null;
			}
			public void render(Context context, SafeHtmlBuilder sb) {
				String s = getValue();
				if (s != null) {
					s = "PTU: " + ptu.getName();
					if (interventions != null) {
						String realName = interventions.get(ptu) != null ? interventions
								.get(ptu).getName() : null;
						if (realName != null) {
							s = "<div title=\"" + s + "\">" + realName
									+ "</div>";
						}
					}
					sb.append(SafeHtmlUtils.fromSafeConstant(s));
				}
			};
		}
				: null);
		ClickableTextColumn<String> value = new ClickableTextColumn<String>() {
			@Override
			public String getValue(String name) {
				if ((name == null) || (history == null) || (ptu == null)) {
					return "";
				}
				Measurement m = history.getMeasurement(ptu, name);
				return m != null ? format.format(m.getValue()) : "";
			}
			@Override
			public void render(Context context, String name, SafeHtmlBuilder sb) {
				String s = getValue(name);
				Measurement m = history != null ? history.getMeasurement(
						ptu, name) : null;
				if (m == null) {
					return;
				}
				double c = m.getValue().doubleValue();
				Double lo = m.getLowLimit();
				Double hi = m.getHighLimit();
				String status = (lo != null) && (hi != null) && (lo >= hi) ? "in_range" : (lo != null) && (c < lo) ? "lo-limit"
						: (hi != null) && (c > hi) ? "hi-limit" : "in-range";
				sb.append(SafeHtmlUtils.fromSafeConstant("<div class=\""
						+ status + "\">"));
				((ClickableTextCell) getCell()).render(context,
						decorate(s, m, last), sb);
				sb.append(SafeHtmlUtils.fromSafeConstant("</div>"));
			}
		};
		value.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
		if (selectable) {
			value.setFieldUpdater(new FieldUpdater<String, String>() {
				@Override
				public void update(int index, String object, String value) {
					selectMeasurement(object);
				}
			});
		}
		table.addColumn(value, showHeader ? new TextHeader("Value")
				: (Header<?>) null);
		ClickableHtmlColumn<String> unit = new ClickableHtmlColumn<String>() {
			@Override
			public String getValue(String name) {
				Measurement m = history != null ? history.getMeasurement(
						ptu, name) : null;
				return m != null ? m.getUnit() : "";
			}
			@Override
			public void render(Context context, String name, SafeHtmlBuilder sb) {
				String s = getValue(name);
				Measurement m = history != null ? history.getMeasurement(
						ptu, name) : null;
				if (m == null) {
					return;
				}
				((ClickableTextCell) getCell()).render(context, decorate(s, m),
						sb);
			}
		};
		unit.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
		unit.setSortable(sortable);
		if (selectable) {
			unit.setFieldUpdater(new FieldUpdater<String, String>() {
				@Override
				public void update(int index, String object, String value) {
					selectMeasurement(object);
				}
			});
		}
		table.addColumn(unit, showHeader ? new TextHeader("Unit")
				: (Header<?>) null);
		ClickableHtmlColumn<String> date = new ClickableHtmlColumn<String>() {
			@Override
			public String getValue(String name) {
				Measurement measurement = history
						.getMeasurement(ptu, name);
				return measurement != null ? PtuClientConstants.dateFormat
						.format(measurement.getDate()) : "";
			}
			@Override
			public void render(Context context, String name, SafeHtmlBuilder sb) {
				String s = getValue(name);
				Measurement m = history.getMeasurement(ptu, name);
				if (m == null) {
					return;
				}
				((ClickableTextCell) getCell()).render(context, decorate(s, m),
						sb);
			}
		};
		unit.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
		unit.setSortable(sortable);
		if (selectable) {
			unit.setFieldUpdater(new FieldUpdater<String, String>() {
				@Override
				public void update(int index, String object, String value) {
					selectMeasurement(object);
				}
			});
		}
		if (showDate) {
			table.addColumn(date, showHeader ? new TextHeader("Date")
					: (Header<?>) null);
		}
		List<String> list = new ArrayList<String>();
		dataProvider.addDataDisplay(table);
		dataProvider.setList(list);
		columnSortHandler = new ListHandler<String>(dataProvider.getList());
		columnSortHandler.setComparator(name, new Comparator<String>() {
			public int compare(String s1, String s2) {
				if (s1 == s2) {
					return 0;
				}
				if (s1 != null) {
					return s1.compareTo(s2);
				}
				return -1;
			}
		});
		columnSortHandler.setComparator(value, new Comparator<String>() {
			public int compare(String s1, String s2) {
				Measurement o1 = history.getMeasurement(ptu, s1);
				Measurement o2 = history.getMeasurement(ptu, s2);
				if (o1 == o2) {
					return 0;
				}
				if ((o1 != null) && (o1.getValue() != null)) {
					if ((o2 != null) && (o2.getValue() != null)) {
						double d1 = o1.getValue().doubleValue();
						double d2 = o2.getValue().doubleValue();
						return d1 < d2 ? -1 : d1 == d2 ? 0 : 1;
					}
					return 1;
				}
				return -1;
			}
		});
		columnSortHandler.setComparator(unit, new Comparator<String>() {
			public int compare(String s1, String s2) {
				Measurement o1 = history.getMeasurement(ptu, s1);
				Measurement o2 = history.getMeasurement(ptu, s2);
				if (o1 == o2) {
					return 0;
				}
				if (o1 != null) {
					return (o2 != null) ? o1.getUnit().compareTo(o2.getUnit())
							: 1;
				}
				return -1;
			}
		});
		columnSortHandler.setComparator(date, new Comparator<String>() {
			public int compare(String s1, String s2) {
				Measurement o1 = history.getMeasurement(ptu, s1);
				Measurement o2 = history.getMeasurement(ptu, s2);
				if (o1 == o2) {
					return 0;
				}
				if (o1 != null) {
					return (o2 != null) ? o1.getDate().compareTo(o2.getDate())
							: 1;
				}
				return -1;
			}
		});
		table.addColumnSortHandler(columnSortHandler);
		table.getColumnSortList().push(name);
		if (selectable) {
			table.setSelectionModel(selectionModel);
			selectionModel
					.addSelectionChangeHandler(new SelectionChangeEvent.Handler() {
						@Override
						public void onSelectionChange(SelectionChangeEvent event) {
							String s = selectionModel.getSelectedObject();
							log.info(s + " " + event.getSource());
						}
					});
		}
		return true;
	}


Input:
    public void addComponentDescriptor( ComponentDescriptor componentDescriptor )
        throws ComponentRepositoryException
    {
        try
        {
            validateComponentDescriptor( componentDescriptor );
        }
        catch ( ComponentImplementationNotFoundException e )
        {
            throw new ComponentRepositoryException( "Component descriptor validation failed: ", e );
        }
        String role = componentDescriptor.getRole();
        String roleHint = componentDescriptor.getRoleHint();
        if ( roleHint != null )
        {
            if ( componentDescriptors.containsKey( role ) )
            {
                ComponentDescriptor desc = (ComponentDescriptor) componentDescriptors.get( role );
                if ( desc.getRoleHint() == null )
                {
                    String message = "Component descriptor " + componentDescriptor.getHumanReadableKey() +
                        " has a hint, but there are other implementations that don't";
                    throw new ComponentRepositoryException( message );
                }
            }
            Map map = (Map) componentDescriptorMaps.get( role );
            if ( map == null )
            {
                map = new HashMap();
                componentDescriptorMaps.put( role, map );
            }
            map.put( roleHint, componentDescriptor );
        }
        else
        {
            if ( componentDescriptorMaps.containsKey( role ) )
            {
                String message = "Component descriptor " + componentDescriptor.getHumanReadableKey() +
                    " has no hint, but there are other implementations that do";
                throw new ComponentRepositoryException( message );
            }
            else if ( componentDescriptors.containsKey( role ) )
            {
                if ( !componentDescriptors.get( role ).equals( componentDescriptor ) )
                {
                    String message = "Component role " + role +
                        " is already in the repository and different to attempted addition of " +
                        componentDescriptor.getHumanReadableKey();
                    throw new ComponentRepositoryException( message );
                }
            }
        }
        try
        {
            compositionResolver.addComponentDescriptor( componentDescriptor );
        }
        catch ( CompositionException e )
        {
            throw new ComponentRepositoryException( e.getMessage(), e );
        }
        componentDescriptors.put( componentDescriptor.getComponentKey(), componentDescriptor );
        if ( !componentDescriptors.containsKey( role ) )
        {
            componentDescriptors.put( role, componentDescriptor );
        }
    }

Output:
    public void addComponentDescriptor( ComponentDescriptor componentDescriptor )
        throws ComponentRepositoryException
    {
        try
        {
            validateComponentDescriptor( componentDescriptor );
        }
        catch ( ComponentImplementationNotFoundException e )
        {
            throw new ComponentRepositoryException( "Component descriptor validation failed: ", e );
        }
        String role = componentDescriptor.getRole();
        String roleHint = componentDescriptor.getRoleHint();
        if ( roleHint != null )
        {
            if ( componentDescriptors.containsKey( role ) )
            {
                ComponentDescriptor desc = (ComponentDescriptor) componentDescriptors.get( role );
                if ( desc.getRoleHint() == null )
                {
                    String message = "Component descriptor " + componentDescriptor.getHumanReadableKey()
                        + " has a hint, but implementation " + desc.getImplementation() + " doesn't";
                    throw new ComponentRepositoryException( message );
                }
            }
            Map map = (Map) componentDescriptorMaps.get( role );
            if ( map == null )
            {
                map = new HashMap();
                componentDescriptorMaps.put( role, map );
            }
            map.put( roleHint, componentDescriptor );
        }
        else
        {
            if ( componentDescriptorMaps.containsKey( role ) )
            {
                String message = "Component descriptor " + componentDescriptor.getHumanReadableKey() +
                    " has no hint, but there are other implementations that do";
                throw new ComponentRepositoryException( message );
            }
            else if ( componentDescriptors.containsKey( role ) )
            {
                if ( !componentDescriptors.get( role ).equals( componentDescriptor ) )
                {
                    String message = "Component role " + role +
                        " is already in the repository and different to attempted addition of " +
                        componentDescriptor.getHumanReadableKey();
                    throw new ComponentRepositoryException( message );
                }
            }
        }
        try
        {
            compositionResolver.addComponentDescriptor( componentDescriptor );
        }
        catch ( CompositionException e )
        {
            throw new ComponentRepositoryException( e.getMessage(), e );
        }
        componentDescriptors.put( componentDescriptor.getComponentKey(), componentDescriptor );
        if ( !componentDescriptors.containsKey( role ) )
        {
            componentDescriptors.put( role, componentDescriptor );
        }
    }


Input:
	public void invalidate() {
		if(!isValid) {
			throw new IllegalStateException("SipApplicationSession already invalidated !");
		}
		if(logger.isInfoEnabled()) {
			logger.info("Invalidating the following sip application session " + key);
		}
		for(MobicentsSipSession session: sipSessions.values()) {
			if(session.isValid()) {
				session.invalidate();
			}
		}
		for(HttpSession session: httpSessions.values()) {
			if(((Session)session).isValid()) {
				session.invalidate();
			}
		}
		for (String key : sipApplicationSessionAttributeMap.keySet()) {
			removeAttribute(key);
		}
		notifySipApplicationSessionListeners(SipApplicationSessionEventType.DELETION);
		isValid = false;
		for (Map.Entry<String, ServletTimer> servletTimerEntry : servletTimers.entrySet()) {
			ServletTimer timerEntry = servletTimerEntry.getValue();
			if(timerEntry != null) {
				timerEntry.cancel();
			}
		}
		if(!expired && expirationTimerFuture != null) {
			cancelExpirationTimer();
		}
        long timeNow = System.currentTimeMillis();
        int timeAlive = (int) ((timeNow - creationTime)/1000);
        SipManager manager = sipContext.getSipManager();
        synchronized (manager) {
            if (timeAlive > manager.getSipApplicationSessionMaxAliveTime()) {
                manager.setSipApplicationSessionMaxAliveTime(timeAlive);
            }
            int numExpired = manager.getExpiredSipApplicationSessions();
            numExpired++;
            manager.setExpiredSipApplicationSessions(numExpired);
            int average = manager.getSipApplicationSessionAverageAliveTime();
            average = ((average * (numExpired-1)) + timeAlive)/numExpired;
            manager.setSipApplicationSessionAverageAliveTime(average);
        }
		sipContext.getSipManager().removeSipApplicationSession(key);
		expirationTimerTask = null;
		expirationTimerFuture = null;
		httpSessions.clear();
		servletTimers.clear();
		sipApplicationSessionAttributeMap.clear();
		sipSessions.clear();
		httpSessions.clear();
		executorService.shutdown();
		executorService = null;
		httpSessions = null;
		sipSessions = null;
		sipApplicationSessionAttributeMap = null;
		servletTimers = null;
		sipContext = null;
		if(logger.isInfoEnabled()) {
			logger.info("The following sip application session " + key + " has been invalidated");
		}
		currentRequestHandler = null;
		key = null;
	}

Output:
	public void invalidate() {
		if(!isValid) {
			throw new IllegalStateException("SipApplicationSession already invalidated !");
		}
		if(logger.isInfoEnabled()) {
			logger.info("Invalidating the following sip application session " + key);
		}
		for(MobicentsSipSession session: sipSessions.values()) {
			if(session.isValid()) {
				session.invalidate();
			}
		}
		for(HttpSession session: httpSessions.values()) {
			try {
				session.invalidate();
			} catch(IllegalStateException ignore) {
			}
		}
		for (String key : sipApplicationSessionAttributeMap.keySet()) {
			removeAttribute(key);
		}
		notifySipApplicationSessionListeners(SipApplicationSessionEventType.DELETION);
		isValid = false;
		for (Map.Entry<String, ServletTimer> servletTimerEntry : servletTimers.entrySet()) {
			ServletTimer timerEntry = servletTimerEntry.getValue();
			if(timerEntry != null) {
				timerEntry.cancel();
			}
		}
		if(!expired && expirationTimerFuture != null) {
			cancelExpirationTimer();
		}
        long timeNow = System.currentTimeMillis();
        int timeAlive = (int) ((timeNow - creationTime)/1000);
        SipManager manager = sipContext.getSipManager();
        synchronized (manager) {
            if (timeAlive > manager.getSipApplicationSessionMaxAliveTime()) {
                manager.setSipApplicationSessionMaxAliveTime(timeAlive);
            }
            int numExpired = manager.getExpiredSipApplicationSessions();
            numExpired++;
            manager.setExpiredSipApplicationSessions(numExpired);
            int average = manager.getSipApplicationSessionAverageAliveTime();
            average = ((average * (numExpired-1)) + timeAlive)/numExpired;
            manager.setSipApplicationSessionAverageAliveTime(average);
        }
		sipContext.getSipManager().removeSipApplicationSession(key);
		expirationTimerTask = null;
		expirationTimerFuture = null;
		httpSessions.clear();
		servletTimers.clear();
		sipApplicationSessionAttributeMap.clear();
		sipSessions.clear();
		httpSessions.clear();
		executorService.shutdown();
		executorService = null;
		httpSessions = null;
		sipSessions = null;
		sipApplicationSessionAttributeMap = null;
		servletTimers = null;
		sipContext = null;
		if(logger.isInfoEnabled()) {
			logger.info("The following sip application session " + key + " has been invalidated");
		}
		currentRequestHandler = null;
		key = null;
	}


Input:
  public static void main(String[] args)
  throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException,
         InvocationTargetException, NoSuchFieldException {
    int[] arr = (int[]) Array.newInstance(int.class, 4);
    System.out.println(Arrays.toString(arr));
    int[][] mat = (int[][]) Array.newInstance(int.class, 2, 3);
    System.out.println(Arrays.deepToString(mat));
    System.out.println(Reflection.class.getEnclosingMethod());
    System.out.println(Reflection.classInMethod().getClass().getEnclosingMethod());
    SubClass sub = new SubClass();
    Field subf = Reflection.class.getDeclaredField("goodString");
    System.out.println(subf.get(sub));
    Method iface_method = Iface.class.getMethod("inYourIface", Object.class);
    iface_method.invoke(sub, "foo");
    Reflection obj = new Reflection();
    Class<Reflection> c = Reflection.class;
    Field f = c.getField("constValue");
    System.out.println(f.get(null));
    Field f2 = c.getField("constInt");
    System.out.println(f2.get(null));
    Field f3 = c.getField("constFloat");
    System.out.println(f3.get(null));
    Field f4 = c.getField("constDouble");
    System.out.println(f4.get(null));
    Field f5 = c.getField("constLong");
    System.out.println(f5.get(null));
    Field f6 = c.getField("constShort");
    System.out.println(f6.get(null));
    Field f7 = c.getField("constBool");
    System.out.println(f7.get(null));
    Method bytecodeMethod = c.getClass().getMethod("toString");
    Method nativeMethod = c.getClass().getMethod("isArray");
    Method nativeMethodWithArgs = c.getClass().getMethod("isInstance", Object.class);
    Method unboxingMethod = c.getMethod("add", long.class, long.class);
    Method boxingMethod = c.getMethod("add", Long.class, Long.class);
    Method voidMethod = c.getMethod("foo");
    System.out.println("toString: " + bytecodeMethod.invoke(c));
    System.out.println("is array? " + nativeMethod.invoke(c));
    System.out.println("is instance? " + nativeMethodWithArgs.invoke(c, obj));
    Long a = new Long(40L);
    Long b = new Long(2L);
    System.out.println("unboxing: " + unboxingMethod.invoke(null, a, b));
    System.out.println("boxing: " + boxingMethod.invoke(null, 1300L, 37L));
    System.out.println("void return: " + voidMethod.invoke(null));
    System.out.println("Testing java.lang.reflect.Array.set");
    byte[] byteArr = new byte[1];
    Array.set(byteArr, 0, new Byte((byte)1));
    System.out.println(byteArr[0]);
    char[] charArr = new char[1];
    Array.set(charArr, 0, new Character('a'));
    System.out.println(charArr[0]);
    double[] doubleArr = new double[1];
    Array.set(doubleArr, 0, new Double(1));
    System.out.println(doubleArr[0]);
    float[] floatArr = new float[1];
    Array.set(floatArr, 0, new Float(1));
    System.out.println(floatArr[0]);
    int[] intArr = new int[1];
    Array.set(intArr, 0, new Integer(1));
    System.out.println(intArr[0]);
    long[] longArr = new long[1];
    Array.set(longArr, 0, new Long(1));
    System.out.println(longArr[0]);
    short[] shortArr = new short[1];
    Array.set(shortArr, 0, new Short((short)1));
    System.out.println(shortArr[0]);
    boolean[] boolArr = new boolean[1];
    Array.set(boolArr, 0, new Boolean(true));
    System.out.println(boolArr[0]);
    Integer[] integerArr = new Integer[1];
    Array.set(integerArr, 0, new Integer(1));
    System.out.println(integerArr[0].getClass().getName());
    System.out.println(integerArr[0]);
    System.out.println("Checking Array.set's exceptions");
    try {
      Array.set(charArr, 1, new Character('a'));
    }
    catch (ArrayIndexOutOfBoundsException e) {
      System.out.println("Caught ArrayIndexOutOfBoundsException");
    }
    try {
      Array.set(charArr, -1, new Character('a'));
    }
    catch (ArrayIndexOutOfBoundsException e) {
      System.out.println("Caught ArrayIndexOutOfBoundsException");
    }
    try {
      Array.set(byteArr, 0, new Character('a'));
    }
    catch (IllegalArgumentException e) {
      System.out.println("Caught IllegalArgumentException");
    }
    try {
      Array.set(integerArr, 0, "foo");
    } catch (IllegalArgumentException e) {
      System.out.println("Caught IllegalArgumentException");
    }
    try {
      Array.set(byteArr, 1, new Character('a'));
    }
    catch (ArrayIndexOutOfBoundsException e) {
      System.out.println("Caught ArrayIndexOutOfBoundsException");
    }
    System.out.println("Testing java.lang.reflect.Array.get*");
    System.out.println(Array.getLength(byteArr));
    System.out.println(Array.getByte(byteArr, 0));
    System.out.println(Array.getChar(charArr, 0));
    System.out.println(Array.getDouble(doubleArr, 0));
    System.out.println(Array.getFloat(floatArr, 0));
    System.out.println(Array.getInt(intArr, 0));
    System.out.println(Array.getLong(longArr, 0));
    System.out.println(Array.getShort(shortArr, 0));
    System.out.println(Array.getBoolean(boolArr, 0));
    System.out.println(Array.get(integerArr, 0).getClass().getName());
    System.out.println("Checking Array.get*'s exceptions");
    try {
      Array.getChar(charArr, 1);
    }
    catch (ArrayIndexOutOfBoundsException e) {
      System.out.println("Caught ArrayIndexOutOfBoundsException");
    }
    try {
      Array.getChar(charArr, -1);
    }
    catch (ArrayIndexOutOfBoundsException e) {
      System.out.println("Caught ArrayIndexOutOfBoundsException");
    }
  }

Output:
  public static void main(String[] args)
  throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException,
         InvocationTargetException, NoSuchFieldException {
    int[] arr = (int[]) Array.newInstance(int.class, 4);
    System.out.println(Arrays.toString(arr));
    int[][] mat = (int[][]) Array.newInstance(int.class, 2, 3);
    System.out.println(Arrays.deepToString(mat));
    System.out.println(Reflection.class.getEnclosingMethod());
    System.out.println(Reflection.classInMethod().getClass().getEnclosingMethod());
    SubClass sub = new SubClass();
    Field subf = Reflection.class.getDeclaredField("goodString");
    System.out.println(subf.get(sub));
    Method iface_method = Iface.class.getMethod("inYourIface", Object.class);
    iface_method.invoke(sub, "foo");
    Reflection obj = new Reflection();
    Class<Reflection> c = Reflection.class;
    Field f = c.getField("constValue");
    System.out.println(f.get(null));
    Field f2 = c.getField("constInt");
    System.out.println(f2.get(null));
    Field f3 = c.getField("constFloat");
    System.out.println(f3.get(null));
    Field f4 = c.getField("constDouble");
    System.out.println(f4.get(null));
    Field f5 = c.getField("constLong");
    System.out.println(f5.get(null));
    Field f6 = c.getField("constShort");
    System.out.println(f6.get(null));
    Field f7 = c.getField("constBool");
    System.out.println(f7.get(null));
    Method bytecodeMethod = c.getClass().getMethod("toString");
    Method nativeMethod = c.getClass().getMethod("isArray");
    Method nativeMethodWithArgs = c.getClass().getMethod("isInstance", Object.class);
    Method unboxingMethod = c.getMethod("add", long.class, long.class);
    Method boxingMethod = c.getMethod("add", Long.class, Long.class);
    Method voidMethod = c.getMethod("foo");
    System.out.println("toString: " + bytecodeMethod.invoke(c));
    System.out.println("is array? " + nativeMethod.invoke(c));
    System.out.println("is instance? " + nativeMethodWithArgs.invoke(c, obj));
    Long a = new Long(40L);
    Long b = new Long(2L);
    System.out.println("unboxing: " + unboxingMethod.invoke(null, a, b));
    System.out.println("boxing: " + boxingMethod.invoke(null, 1300L, 37L));
    System.out.println("void return: " + voidMethod.invoke(null));
    System.out.println("Testing java.lang.reflect.Array.set");
    byte[] byteArr = new byte[1];
    Array.set(byteArr, 0, new Byte((byte)1));
    System.out.println(byteArr[0]);
    char[] charArr = new char[1];
    Array.set(charArr, 0, new Character('a'));
    System.out.println(charArr[0]);
    double[] doubleArr = new double[1];
    Array.set(doubleArr, 0, new Double(1));
    System.out.println(doubleArr[0]);
    float[] floatArr = new float[1];
    Array.set(floatArr, 0, new Float(1));
    System.out.println(floatArr[0]);
    int[] intArr = new int[1];
    Array.set(intArr, 0, new Integer(1));
    System.out.println(intArr[0]);
    long[] longArr = new long[1];
    Array.set(longArr, 0, new Long(1));
    System.out.println(longArr[0]);
    short[] shortArr = new short[1];
    Array.set(shortArr, 0, new Short((short)1));
    System.out.println(shortArr[0]);
    boolean[] boolArr = new boolean[1];
    Array.set(boolArr, 0, new Boolean(true));
    System.out.println(boolArr[0]);
    Integer[] integerArr = new Integer[1];
    Array.set(integerArr, 0, new Integer(1));
    System.out.println(integerArr[0].getClass().getName());
    System.out.println(integerArr[0]);
    System.out.println("Checking Array.set's exceptions");
    try {
      Array.set(charArr, 1, new Character('a'));
    }
    catch (ArrayIndexOutOfBoundsException e) {
      System.out.println("Caught ArrayIndexOutOfBoundsException");
    }
    try {
      Array.set(charArr, -1, new Character('a'));
    }
    catch (ArrayIndexOutOfBoundsException e) {
      System.out.println("Caught ArrayIndexOutOfBoundsException");
    }
    try {
      Array.set(byteArr, 0, new Character('a'));
    }
    catch (IllegalArgumentException e) {
      System.out.println("Caught IllegalArgumentException");
    }
    try {
      Array.set(integerArr, 0, "foo");
    } catch (IllegalArgumentException e) {
      System.out.println("Caught IllegalArgumentException");
    }
    try {
      Array.set(byteArr, 1, new Character('a'));
    }
    catch (ArrayIndexOutOfBoundsException e) {
      System.out.println("Caught ArrayIndexOutOfBoundsException");
    }
    System.out.println("Testing java.lang.reflect.Array.get*");
    System.out.println(Array.getLength(byteArr));
    System.out.println(Array.getByte(byteArr, 0));
    System.out.println(Array.getChar(charArr, 0));
    System.out.println(Array.getDouble(doubleArr, 0));
    System.out.println(Array.getFloat(floatArr, 0));
    System.out.println(Array.getInt(intArr, 0));
    System.out.println(Array.getLong(longArr, 0));
    System.out.println(Array.getShort(shortArr, 0));
    System.out.println(Array.getBoolean(boolArr, 0));
    System.out.println(Array.get(integerArr, 0).getClass().getName());
    System.out.println(Array.get(intArr, 0).getClass().getName());
    System.out.println("Checking Array.get*'s exceptions");
    try {
      Array.getChar(charArr, 1);
    }
    catch (ArrayIndexOutOfBoundsException e) {
      System.out.println("Caught ArrayIndexOutOfBoundsException");
    }
    try {
      Array.getChar(charArr, -1);
    }
    catch (ArrayIndexOutOfBoundsException e) {
      System.out.println("Caught ArrayIndexOutOfBoundsException");
    }
  }


Input:
	public boolean onCommand(CommandSender sender, Command command, String commandLabel, String[] args) {
		if (command.getName().equalsIgnoreCase("maze")) {
			Player player = null;
			if (sender instanceof Player)
				player = (Player) sender;
			if (args.length == 0) {
				sender.sendMessage(Util.formatMessage("---------------- MazeMania Help -----------------"));
				sender.sendMessage(Util.formatMessage("Player Commands:"));
				sender.sendMessage(Util.formatMessage("/maze join  - Join the MazeMania game"));
				sender.sendMessage(Util.formatMessage("/maze leave - Leave the MazeMania game"));
				sender.sendMessage(Util.formatMessage("/maze about - Show MazeMania credits and info"));
			}
			if (args.length > 0) {
				if (args[0].equalsIgnoreCase("set")) {
					if (!(sender instanceof Player)) {
						Util.sendMessageNotPlayer(sender);
						return true;
					}
					if (!plugin.util.hasPermMsg(player, "admin")) return true;
					return setCommand.handle(sender, args);
				} else if (args[0].equalsIgnoreCase("join")) {
					if (!(sender instanceof Player)) {
						Util.sendMessageNotPlayer(sender);
						return true;
					}
					if (!plugin.util.hasPermMsg(player, "use")) return true;
					return arenaCommand.joinHandle(player);
				} else if (args[0].equalsIgnoreCase("leave")) {
					if (!(sender instanceof Player)) {
						Util.sendMessageNotPlayer(sender);
						return true;
					}
					if (!plugin.util.hasPermMsg(player, "use")) return true;
					return arenaCommand.leaveHandle(player);
				} else if (args[0].equalsIgnoreCase("trigger")) {
					if (!plugin.util.hasPermMsg(player, "admin")) return true;
					return setCommand.triggerHandle(sender, args);
				} else if (args[0].equalsIgnoreCase("block")) {
					if (!plugin.util.hasPermMsg(player, "admin")) return true;
					if(args.length==1){
						sender.sendMessage("========================");
						sender.sendMessage("Block   Event   Args");
						for (Trigger t:plugin.TriggerManager.getTriggers()){
							sender.sendMessage(Material.getMaterial(t.blockID).name() + " " + t.effect + " " + t.arguments);
						}
						sender.sendMessage("=========================");
					}else if(args.length==2){
						plugin.TriggerManager.removeTrigger(Material.getMaterial(args[1]));
					}else if(args.length==3){
						plugin.TriggerManager.addTrigger(new Trigger(Material.matchMaterial(args[1]).getId(), args[2], ""));
					}else if(args.length>=4){
						plugin.TriggerManager.addTrigger(new Trigger(Material.matchMaterial(args[1]).getId(), args[2], plugin.util.join(args, " ", 3)));
					}else{
					}
				} else if (args[0].equalsIgnoreCase("about") || args[0].equalsIgnoreCase("info")) {
					sender.sendMessage(Util.formatMessage("---------------------- " + Util.pdfFile.getName() + " ----------------------"));
					sender.sendMessage(Util.formatMessage(plugin.getName() + " developed by " + Util.pdfFile.getAuthors().get(0)));
					sender.sendMessage(Util.formatMessage("To view more information visit http://plugmania.github.com/ (<-- You can click it!)"));
				}
			}
			return true;
		}
		return false;
	}

Output:
	public boolean onCommand(CommandSender sender, Command command, String commandLabel, String[] args) {
		if (command.getName().equalsIgnoreCase("maze")) {
			Player player = null;
			if (sender instanceof Player)
				player = (Player) sender;
			if (args.length == 0) {
				sender.sendMessage(Util.formatMessage("---------------- MazeMania Help -----------------"));
				sender.sendMessage(Util.formatMessage("Player Commands:"));
				sender.sendMessage(Util.formatMessage("/maze join  - Join the MazeMania game"));
				sender.sendMessage(Util.formatMessage("/maze leave - Leave the MazeMania game"));
				sender.sendMessage(Util.formatMessage("/maze about - Show MazeMania credits and info"));
			}
			if (args.length > 0) {
				if (args[0].equalsIgnoreCase("set")) {
					if (!(sender instanceof Player)) {
						Util.sendMessageNotPlayer(sender);
						return true;
					}
					if (!plugin.util.hasPermMsg(player, "admin")) return true;
					return setCommand.handle(sender, args);
				} else if (args[0].equalsIgnoreCase("join")) {
					if (!(sender instanceof Player)) {
						Util.sendMessageNotPlayer(sender);
						return true;
					}
					if (!plugin.util.hasPermMsg(player, "use")) return true;
					return arenaCommand.joinHandle(player);
				} else if (args[0].equalsIgnoreCase("leave")) {
					if (!(sender instanceof Player)) {
						Util.sendMessageNotPlayer(sender);
						return true;
					}
					if (!plugin.util.hasPermMsg(player, "use")) return true;
					return arenaCommand.leaveHandle(player);
				} else if (args[0].equalsIgnoreCase("trigger")) {
					if (!plugin.util.hasPermMsg(player, "admin")) return true;
					return setCommand.triggerHandle(sender, args);
				} else if (args[0].equalsIgnoreCase("block")) {
					if (!plugin.util.hasPermMsg(player, "admin")) return true;
					if(args.length==1){
						sender.sendMessage("========================");
						sender.sendMessage("Block   Event   Args");
						for (Trigger t:plugin.TriggerManager.getTriggers()){
							sender.sendMessage(Material.getMaterial(t.blockID).name() + " " + t.effect + " " + t.arguments);
						}
						sender.sendMessage("=========================");
					}else if(args.length==2){
						plugin.TriggerManager.removeTrigger(Material.matchMaterial(args[1]));
					}else if(args.length==3){
						plugin.TriggerManager.addTrigger(new Trigger(Material.matchMaterial(args[1]).getId(), args[2], ""));
					}else if(args.length>=4){
						plugin.TriggerManager.addTrigger(new Trigger(Material.matchMaterial(args[1]).getId(), args[2], plugin.util.join(args, " ", 3)));
					}else{
					}
				} else if (args[0].equalsIgnoreCase("about") || args[0].equalsIgnoreCase("info")) {
					sender.sendMessage(Util.formatMessage("---------------------- " + Util.pdfFile.getName() + " ----------------------"));
					sender.sendMessage(Util.formatMessage(plugin.getName() + " developed by " + Util.pdfFile.getAuthors().get(0)));
					sender.sendMessage(Util.formatMessage("To view more information visit http://plugmania.github.com/ (<-- You can click it!)"));
				}
			}
			return true;
		}
		return false;
	}