Input:
	private void autoClose(IDocument d, DocumentCommand c) {
		if (c.offset == -1)
			return;
		try {
			if (d.getChar(c.offset - 1) == '\\')
				return;
		} catch (BadLocationException e1) {
		}
		if ('\"' == c.text.charAt(0) && !prefs.closeStrings())
			return;
		if ('\'' == c.text.charAt(0) && !prefs.closeStrings())
			return;
		if (!prefs.closeBrackets()
				&& ('[' == c.text.charAt(0) || '(' == c.text.charAt(0) || '{' == c.text.charAt(0)))
			return;
		try {
			switch (c.text.charAt(0)) {
			case '\"':
			case '\'':
				if ('\"' == c.text.charAt(0) && c.offset > 0 && "\"".equals(d.get(c.offset - 1, 1)))
					return;
				if ('\'' == c.text.charAt(0) && c.offset > 0 && "\'".equals(d.get(c.offset - 1, 1)))
					return;
				if (c.offset != d.getLength() && c.text.charAt(0) == d.get(c.offset, 1).charAt(0))
					c.text = "";
				else {
					c.text += c.text;
					c.length = 0;
				}
				c.shiftsCaret = false;
				c.caretOffset = c.offset + 1;
				break;
			case '(':
			case '{':
			case '[':
				if (AutoEditUtils.getRegionType(d, fPartitioning, c.offset) != IDocument.DEFAULT_CONTENT_TYPE)
					return;
				if (c.offset != d.getLength() && c.text.charAt(0) == d.get(c.offset, 1).charAt(0))
					return;
				try {
					String regex = "^\\s*class\\s+.*";
					String regex2 = ".*\\(.*\\).*";
					int start = d.getLineOffset(d.getLineOfOffset(c.offset));
					String curLine = d.get(start, c.offset - start);
					if (Pattern.matches(regex, curLine) && !Pattern.matches(regex2, curLine)) {
						c.text = "():";
						c.shiftsCaret = false;
						c.caretOffset = c.offset + 1;
						return;
					}
				} catch (BadLocationException e) {
				}
				c.text = c.text + AutoEditUtils.getBracePair(c.text.charAt(0));
				c.length = 0;
				c.shiftsCaret = false;
				c.caretOffset = c.offset + 1;
				break;
			case '}':
			case ']':
			case ')':
				if (AutoEditUtils.getRegionType(d, fPartitioning, c.offset) != IDocument.DEFAULT_CONTENT_TYPE)
					return;
				if (!prefs.closeBrackets())
					return;
				if (c.offset != d.getLength() && c.text.charAt(0) == d.get(c.offset, 1).charAt(0)) {
					c.text = "";
					c.shiftsCaret = false;
					c.caretOffset = c.offset + 1;
					return;
				}
				break;
			}
		} catch (BadLocationException e) {
			e.printStackTrace();
		}
	}

Output:
	private void autoClose(IDocument d, DocumentCommand c) {
		if (c.offset == -1)
			return;
		try {
			if (d.getChar(c.offset - 1) == '\\')
				return;
		} catch (BadLocationException e1) {
		}
		if ('\"' == c.text.charAt(0) && !prefs.closeStrings())
			return;
		if ('\'' == c.text.charAt(0) && !prefs.closeStrings())
			return;
		if (!prefs.closeBrackets()
				&& ('[' == c.text.charAt(0) || '(' == c.text.charAt(0) || '{' == c.text.charAt(0)))
			return;
		try {
			switch (c.text.charAt(0)) {
			case '\"':
			case '\'':
				if ('\"' == c.text.charAt(0) && c.offset > 0 && "\"".equals(d.get(c.offset - 1, 1)))
					return;
				if ('\'' == c.text.charAt(0) && c.offset > 0 && "\'".equals(d.get(c.offset - 1, 1)))
					return;
				if (c.offset != d.getLength() && c.text.charAt(0) == d.get(c.offset, 1).charAt(0))
					c.text = "";
				else {
					c.text += c.text;
					c.length = 0;
				}
				c.shiftsCaret = false;
				c.caretOffset = c.offset + 1;
				break;
			case '(':
			case '{':
			case '[':
				if (AutoEditUtils.getRegionType(d, fPartitioning, c.offset) != IDocument.DEFAULT_CONTENT_TYPE)
					return;
				if (c.offset != d.getLength() && c.text.charAt(0) == d.get(c.offset, 1).charAt(0))
					return;
				try {
					String regex = "^\\s*class\\s+.*";
					String regex2 = ".*\\(.*\\).*";
					int start = d.getLineOffset(d.getLineOfOffset(c.offset));
					String curLine = d.get(start, c.offset - start);
					if (Pattern.matches(regex, curLine) && !Pattern.matches(regex2, curLine)) {
						c.text = "()";
						c.shiftsCaret = false;
						c.caretOffset = c.offset + 1;
						return;
					}
				} catch (BadLocationException e) {
				}
				c.text = c.text + AutoEditUtils.getBracePair(c.text.charAt(0));
				c.length = 0;
				c.shiftsCaret = false;
				c.caretOffset = c.offset + 1;
				break;
			case '}':
			case ']':
			case ')':
				if (AutoEditUtils.getRegionType(d, fPartitioning, c.offset) != IDocument.DEFAULT_CONTENT_TYPE)
					return;
				if (!prefs.closeBrackets())
					return;
				if (c.offset != d.getLength() && c.text.charAt(0) == d.get(c.offset, 1).charAt(0)) {
					c.text = "";
					c.shiftsCaret = false;
					c.caretOffset = c.offset + 1;
					return;
				}
				break;
			}
		} catch (BadLocationException e) {
			e.printStackTrace();
		}
	}


Input:
        public AsyncHttpClientConfig build() {
            if (reaper == null) {
                reaper = Executors.newScheduledThreadPool(Runtime.getRuntime().availableProcessors(), new ThreadFactory() {
                    public Thread newThread(Runnable r) {
                        Thread t = new Thread(r, "AsyncHttpClient-Reaper");
                        t.setDaemon(true);
                        return t;
                    }
                });
            }
            if (applicationThreadPool == null) {
                managedApplicationThreadPool = true;
                int count = Runtime.getRuntime().availableProcessors();
                applicationThreadPool =
                        Executors.newFixedThreadPool(count, new ThreadFactory() {
                            final AtomicInteger counter = new AtomicInteger();
                            public Thread newThread(Runnable r) {
                                Thread t = new Thread(r,
                                                      "AsyncHttpClient-Callback-" + counter.incrementAndGet());
                                t.setDaemon(true);
                                return t;
                            }
                        });
            }
            if (applicationThreadPool.isShutdown()) {
                throw new IllegalStateException("ExecutorServices closed");
            }
            if (proxyServerSelector == null && useProxySelector) {
                proxyServerSelector = ProxyUtils.getJdkDefaultProxyServerSelector();
            }
            if (proxyServerSelector == null && useProxyProperties) {
                proxyServerSelector = ProxyUtils.createProxyServerSelector(System.getProperties());
            }
            if (proxyServerSelector == null) {
                proxyServerSelector = ProxyServerSelector.NO_PROXY_SELECTOR;
            }
            return new AsyncHttpClientConfig(defaultMaxTotalConnections,
                    defaultMaxConnectionPerHost,
                    defaultConnectionTimeOutInMs,
                    defaultWebsocketIdleTimeoutInMs,
                    defaultIdleConnectionInPoolTimeoutInMs,
                    defaultIdleConnectionTimeoutInMs,
                    defaultRequestTimeoutInMs,
                    defaultMaxConnectionLifeTimeInMs,
                    redirectEnabled,
                    maxDefaultRedirects,
                    compressionEnabled,
                    userAgent,
                    allowPoolingConnection,
                    reaper,
                    applicationThreadPool,
                    proxyServerSelector,
                    sslContext,
                    sslEngineFactory,
                    providerConfig,
                    connectionsPool,
                    realm,
                    requestFilters,
                    responseFilters,
                    ioExceptionFilters,
                    requestCompressionLevel,
                    maxRequestRetry,
                    allowSslConnectionPool,
                    useRawUrl,
                    removeQueryParamOnRedirect,
                    hostnameVerifier,
                    ioThreadMultiplier,
                    strict302Handling,
                    useRelativeURIsWithSSLProxies,
                    spdyEnabled,
                    spdyInitialWindowSize,
                    spdyMaxConcurrentStreams,
                    rfc6265CookieEncoding,
                    asyncConnectMode,
                    managedApplicationThreadPool);
        }

Output:
        public AsyncHttpClientConfig build() {
            if (reaper == null) {
                reaper = Executors.newScheduledThreadPool(Runtime.getRuntime().availableProcessors(), new ThreadFactory() {
                    public Thread newThread(Runnable r) {
                        Thread t = new Thread(r, "AsyncHttpClient-Reaper");
                        t.setDaemon(true);
                        return t;
                    }
                });
            }
            if (applicationThreadPool == null) {
                managedApplicationThreadPool = true;
                applicationThreadPool =
                        Executors.newCachedThreadPool(new ThreadFactory() {
                            final AtomicInteger counter = new AtomicInteger();
                            public Thread newThread(Runnable r) {
                                Thread t = new Thread(r,
                                                      "AsyncHttpClient-Callback-" + counter.incrementAndGet());
                                t.setDaemon(true);
                                return t;
                            }
                        });
            }
            if (applicationThreadPool.isShutdown()) {
                throw new IllegalStateException("ExecutorServices closed");
            }
            if (proxyServerSelector == null && useProxySelector) {
                proxyServerSelector = ProxyUtils.getJdkDefaultProxyServerSelector();
            }
            if (proxyServerSelector == null && useProxyProperties) {
                proxyServerSelector = ProxyUtils.createProxyServerSelector(System.getProperties());
            }
            if (proxyServerSelector == null) {
                proxyServerSelector = ProxyServerSelector.NO_PROXY_SELECTOR;
            }
            return new AsyncHttpClientConfig(defaultMaxTotalConnections,
                    defaultMaxConnectionPerHost,
                    defaultConnectionTimeOutInMs,
                    defaultWebsocketIdleTimeoutInMs,
                    defaultIdleConnectionInPoolTimeoutInMs,
                    defaultIdleConnectionTimeoutInMs,
                    defaultRequestTimeoutInMs,
                    defaultMaxConnectionLifeTimeInMs,
                    redirectEnabled,
                    maxDefaultRedirects,
                    compressionEnabled,
                    userAgent,
                    allowPoolingConnection,
                    reaper,
                    applicationThreadPool,
                    proxyServerSelector,
                    sslContext,
                    sslEngineFactory,
                    providerConfig,
                    connectionsPool,
                    realm,
                    requestFilters,
                    responseFilters,
                    ioExceptionFilters,
                    requestCompressionLevel,
                    maxRequestRetry,
                    allowSslConnectionPool,
                    useRawUrl,
                    removeQueryParamOnRedirect,
                    hostnameVerifier,
                    ioThreadMultiplier,
                    strict302Handling,
                    useRelativeURIsWithSSLProxies,
                    spdyEnabled,
                    spdyInitialWindowSize,
                    spdyMaxConcurrentStreams,
                    rfc6265CookieEncoding,
                    asyncConnectMode,
                    managedApplicationThreadPool);
        }


Input:
	public static void LogLocationToFile(Context context, Location myLoc)
	{
		Uri fileUri = null;
		SharedPreferences sharedPrefs = PreferenceManager
				.getDefaultSharedPreferences(context);
		if (!DataStorage.isExternalStorageWritable())
		{
			Log.e(TAG, "External storage can not be written");
			Toast.makeText(context, "External Storage can not be written",
					Toast.LENGTH_SHORT).show();
		}
		try
		{
			File root;
			try
			{
				root = context.getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS);
			}
			catch (Exception e)
			{
				root = Environment.getExternalStorageDirectory();
			}
			String path = root.getAbsolutePath();
			if (root.canWrite())
			{
				String timestamp = DateUtils.now("yyyy-MM-dd_HHmmssSSS");
				File textFile = new File(root, FILENAME + ".txt");
				FileWriter fw = new FileWriter(textFile);
				BufferedWriter out = new BufferedWriter(fw);
				out.append(timestamp + ": "
						+ "LAT=" + myLoc.getLatitude()
						+ "LONG=" + myLoc.getLongitude() + "\n");
				out.close();
				File jsonFile = new File(root, FILENAME + ".json");
				fw = new FileWriter(jsonFile);
				out = new BufferedWriter(fw);
				out.append(timestamp + ": "
						+ "LAT=" + myLoc.getLatitude()
						+ "LONG=" + myLoc.getLongitude() + "\n");
				Gson gson = new GsonBuilder().setPrettyPrinting().serializeNulls().create();
				out.append(gson.toJson(new TrackEntry(myLoc)));
				out.close();
			}
			else
			{
				Log.i(TAG,
						"Write error. "
								+ Environment.getExternalStorageDirectory()
								+ " couldn't be written");
			}
		} catch (Exception e)
		{
			Log.e(TAG, "Exception: " + e.getMessage());
		}
	}

Output:
	public static void LogLocationToFile(Context context, Location myLoc)
	{
		Uri fileUri = null;
		SharedPreferences sharedPrefs = PreferenceManager
				.getDefaultSharedPreferences(context);
		if (!DataStorage.isExternalStorageWritable())
		{
			Log.e(TAG, "External storage can not be written");
			Toast.makeText(context, "External Storage can not be written",
					Toast.LENGTH_SHORT).show();
		}
		try
		{
			File root;
			try
			{
				root = context.getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS);
			}
			catch (Exception e)
			{
				root = Environment.getExternalStorageDirectory();
			}
			String path = root.getAbsolutePath();
			if (root.canWrite())
			{
				String timestamp = DateUtils.now("yyyy-MM-dd_HHmmssSSS");
				File textFile = new File(root, FILENAME + ".txt");
				FileWriter fw = new FileWriter(textFile);
				BufferedWriter out = new BufferedWriter(fw);
				out.append(timestamp + ": "
						+ "LAT=" + myLoc.getLatitude()
						+ "LONG=" + myLoc.getLongitude() + "\n");
				out.close();
				File jsonFile = new File(root, FILENAME + ".json");
				fw = new FileWriter(jsonFile);
				out = new BufferedWriter(fw);
				out.append("TrackEntry\n");
				Gson gson = new GsonBuilder().setPrettyPrinting().serializeNulls().create();
				out.append(gson.toJson(new TrackEntry(myLoc)));
				out.append("\n");
				out.close();
			}
			else
			{
				Log.i(TAG,
						"Write error. "
								+ Environment.getExternalStorageDirectory()
								+ " couldn't be written");
			}
		} catch (Exception e)
		{
			Log.e(TAG, "Exception: " + e.getMessage());
		}
	}


Input:
	public static List<CleanPlan> createCleanPlanFromJSON(Reader reader)
			throws InvalidRuleException, InvalidCleanPlanException {
		Preconditions.checkNotNull(reader);
		JSONObject jsonObject = (JSONObject) JSONValue.parse(reader);
		List<CleanPlan> result = Lists.newArrayList();
		boolean isCSV = false;
		List<Schema> schemas = Lists.newArrayList();
		Connection conn = null;
		try {
			JSONObject src = (JSONObject) jsonObject.get("source");
			String type = (String) src.get("type");
			DBConfig dbConfig;
			switch (type) {
			case "csv":
				isCSV = true;
				dbConfig = NadeefConfiguration.getDbConfig();
				break;
			default:
				SQLDialect sqlDialect = SQLDialect.POSTGRES;
				DBConfig.Builder builder = new DBConfig.Builder();
				dbConfig =
                    builder.username((String) src.get("username"))
						.password((String) src.get("password"))
						.url((String) src.get("url")).dialect(sqlDialect)
						.build();
			}
			DBConnectionFactory.initializeSource(dbConfig);
			JSONArray ruleArray = (JSONArray) jsonObject.get("rule");
			ArrayList<Rule> rules = Lists.newArrayList();
			List<String> targetTableNames;
            List<String> fileNames = Lists.newArrayList();
			for (int i = 0; i < ruleArray.size(); i++) {
				schemas.clear();
                fileNames.clear();
				JSONObject ruleObj = (JSONObject) ruleArray.get(i);
				if (isCSV) {
					List<String> fullFileNames = (List<String>) src.get("file");
                    for (String fullFileName : fullFileNames) {
                        fileNames.add(Files.getNameWithoutExtension(fullFileName));
                    }
					if (ruleObj.containsKey("table")) {
						targetTableNames = (List<String>) ruleObj.get("table");
						Preconditions.checkArgument(
					        targetTableNames.size() <= 2,
							"NADEEF only supports MAX 2 tables per rule."
                        );
                        for (String targetTableName : targetTableNames) {
                            if (!fileNames.contains(targetTableName)) {
                                throw new InvalidCleanPlanException("Unknown table name.");
                            }
                        }
					} else {
						targetTableNames = Lists.newArrayList();
						for (String fileName : fileNames) {
							targetTableNames.add(fileName);
                            if (targetTableNames.size() == 2) {
                                break;
                            }
						}
					}
					conn = DBConnectionFactory.getNadeefConnection();
                    HashSet<String> copiedTables = Sets.newHashSet();
                    for (int j = 0; j < targetTableNames.size(); j++) {
						File file = CommonTools.getFile(fullFileNames.get(j));
                        if (!copiedTables.contains(targetTableNames.get(j))) {
                            String tableName = CSVDumper.dump(conn, file, targetTableNames.get(j));
                            targetTableNames.set(j, tableName);
                            schemas.add(DBMetaDataTool.getSchema(tableName));
                        }
					}
				} else {
					List<String> sourceTableNames = (List<String>) ruleObj.get("table");
					for (String tableName : sourceTableNames) {
						if (!DBMetaDataTool.isTableExist(tableName)) {
                            throw new InvalidCleanPlanException(
                                "The specified table " +
                                tableName +
                                " cannot be found in the source database.");
						}
					}
					if (ruleObj.containsKey("target")) {
						targetTableNames = (List<String>) ruleObj.get("target");
					} else {
						targetTableNames = Lists.newArrayList();
						for (String sourceTableName : sourceTableNames) {
							targetTableNames.add(sourceTableName + "_copy");
						}
					}
					Preconditions.checkArgument(
                        sourceTableNames.size() == targetTableNames.size() &&
                        sourceTableNames.size() <= 2 &&
                        sourceTableNames.size() >= 1,
                        "Invalid Rule property, rule needs to have one or two tables.");
					for (int j = 0; j < sourceTableNames.size(); j++) {
						DBMetaDataTool.copy(
                            sourceTableNames.get(j),
						    targetTableNames.get(j)
                        );
                        schemas.add(
                            DBMetaDataTool.getSchema(
                                targetTableNames.get(j)
                            )
                        );
					}
				}
				type = (String) ruleObj.get("type");
				Rule rule;
				JSONArray value;
				value = (JSONArray) ruleObj.get("value");
				String ruleName = (String) ruleObj.get("name");
                if (Strings.isNullOrEmpty(ruleName)) {
                    ruleName = "Rule" + CommonTools.toHashCode((String)value.get(0));
                }
				switch (type) {
				case "udf":
					value = (JSONArray) ruleObj.get("value");
					Class udfClass =
                        CommonTools.loadClass((String) value.get(0));
					if (!Rule.class.isAssignableFrom(udfClass)) {
						throw new InvalidRuleException(
						    "The specified class is not a Rule class."
                        );
					}
					rule = (Rule) udfClass.newInstance();
					rule.initialize(ruleName, targetTableNames);
					rules.add(rule);
					break;
				default:
					RuleBuilder ruleBuilder = NadeefConfiguration.tryGetRuleBuilder(type);
					if (ruleBuilder != null) {
						rules.addAll(
                            ruleBuilder.name(ruleName)
                                .schema(schemas)
								.table(targetTableNames)
                                .value(value)
                                .build()
                        );
					} else {
						tracer.err("Unknown Rule type: " + type, null);
					}
					break;
				}
			}
			for (int i = 0; i < rules.size(); i++) {
				result.add(new CleanPlan(dbConfig, rules.get(i)));
			}
			return result;
		} catch (Exception ex) {
			ex.printStackTrace();
            if (ex instanceof InvalidRuleException) {
				throw (InvalidRuleException) ex;
			}
			throw new InvalidCleanPlanException(ex);
		} finally {
			if (conn != null) {
				try {
					conn.close();
				} catch (SQLException ex) {
				}
			}
		}
	}

Output:
	public static List<CleanPlan> createCleanPlanFromJSON(Reader reader)
			throws InvalidRuleException, InvalidCleanPlanException {
		Preconditions.checkNotNull(reader);
		JSONObject jsonObject = (JSONObject) JSONValue.parse(reader);
		List<CleanPlan> result = Lists.newArrayList();
		boolean isCSV = false;
		List<Schema> schemas = Lists.newArrayList();
		Connection conn = null;
		try {
			JSONObject src = (JSONObject) jsonObject.get("source");
			String type = (String) src.get("type");
			DBConfig dbConfig;
			switch (type) {
			case "csv":
				isCSV = true;
				dbConfig = NadeefConfiguration.getDbConfig();
				break;
			default:
				SQLDialect sqlDialect = SQLDialect.POSTGRES;
				DBConfig.Builder builder = new DBConfig.Builder();
				dbConfig =
                    builder.username((String) src.get("username"))
						.password((String) src.get("password"))
						.url((String) src.get("url")).dialect(sqlDialect)
						.build();
			}
			DBConnectionFactory.initializeSource(dbConfig);
			JSONArray ruleArray = (JSONArray) jsonObject.get("rule");
			ArrayList<Rule> rules = Lists.newArrayList();
			List<String> targetTableNames;
            List<String> fileNames = Lists.newArrayList();
            HashSet<String> copiedTables = Sets.newHashSet();
			for (int i = 0; i < ruleArray.size(); i++) {
				schemas.clear();
                fileNames.clear();
				JSONObject ruleObj = (JSONObject) ruleArray.get(i);
				if (isCSV) {
					List<String> fullFileNames = (List<String>) src.get("file");
                    for (String fullFileName : fullFileNames) {
                        fileNames.add(Files.getNameWithoutExtension(fullFileName));
                    }
					if (ruleObj.containsKey("table")) {
						targetTableNames = (List<String>) ruleObj.get("table");
						Preconditions.checkArgument(
					        targetTableNames.size() <= 2,
							"NADEEF only supports MAX 2 tables per rule."
                        );
                        for (String targetTableName : targetTableNames) {
                            if (!fileNames.contains(targetTableName)) {
                                throw new InvalidCleanPlanException("Unknown table name.");
                            }
                        }
					} else {
						targetTableNames = Lists.newArrayList();
						for (String fileName : fileNames) {
							targetTableNames.add(fileName);
                            if (targetTableNames.size() == 2) {
                                break;
                            }
						}
					}
					conn = DBConnectionFactory.getNadeefConnection();
                    for (int j = 0; j < targetTableNames.size(); j++) {
						File file = CommonTools.getFile(fullFileNames.get(j));
                        if (!copiedTables.contains(targetTableNames.get(j))) {
                            String tableName = CSVDumper.dump(conn, file, targetTableNames.get(j));
                            targetTableNames.set(j, tableName);
                            schemas.add(DBMetaDataTool.getSchema(tableName));
                            copiedTables.add(targetTableNames.get(j));
                        }
					}
				} else {
					List<String> sourceTableNames = (List<String>) ruleObj.get("table");
					for (String tableName : sourceTableNames) {
						if (!DBMetaDataTool.isTableExist(tableName)) {
                            throw new InvalidCleanPlanException(
                                "The specified table " +
                                tableName +
                                " cannot be found in the source database.");
						}
					}
					if (ruleObj.containsKey("target")) {
						targetTableNames = (List<String>) ruleObj.get("target");
					} else {
						targetTableNames = Lists.newArrayList();
						for (String sourceTableName : sourceTableNames) {
							targetTableNames.add(sourceTableName + "_copy");
						}
					}
					Preconditions.checkArgument(
                        sourceTableNames.size() == targetTableNames.size() &&
                        sourceTableNames.size() <= 2 &&
                        sourceTableNames.size() >= 1,
                        "Invalid Rule property, rule needs to have one or two tables.");
					for (int j = 0; j < sourceTableNames.size(); j++) {
						DBMetaDataTool.copy(
                            sourceTableNames.get(j),
						    targetTableNames.get(j)
                        );
                        schemas.add(
                            DBMetaDataTool.getSchema(
                                targetTableNames.get(j)
                            )
                        );
					}
				}
				type = (String) ruleObj.get("type");
				Rule rule;
				JSONArray value;
				value = (JSONArray) ruleObj.get("value");
				String ruleName = (String) ruleObj.get("name");
                if (Strings.isNullOrEmpty(ruleName)) {
                    ruleName = "Rule" + CommonTools.toHashCode((String)value.get(0));
                }
				switch (type) {
				case "udf":
					value = (JSONArray) ruleObj.get("value");
					Class udfClass =
                        CommonTools.loadClass((String) value.get(0));
					if (!Rule.class.isAssignableFrom(udfClass)) {
						throw new InvalidRuleException(
						    "The specified class is not a Rule class."
                        );
					}
					rule = (Rule) udfClass.newInstance();
					rule.initialize(ruleName, targetTableNames);
					rules.add(rule);
					break;
				default:
					RuleBuilder ruleBuilder = NadeefConfiguration.tryGetRuleBuilder(type);
					if (ruleBuilder != null) {
						rules.addAll(
                            ruleBuilder.name(ruleName)
                                .schema(schemas)
								.table(targetTableNames)
                                .value(value)
                                .build()
                        );
					} else {
						tracer.err("Unknown Rule type: " + type, null);
					}
					break;
				}
			}
			for (int i = 0; i < rules.size(); i++) {
				result.add(new CleanPlan(dbConfig, rules.get(i)));
			}
			return result;
		} catch (Exception ex) {
			ex.printStackTrace();
            if (ex instanceof InvalidRuleException) {
				throw (InvalidRuleException) ex;
			}
			throw new InvalidCleanPlanException(ex);
		} finally {
			if (conn != null) {
				try {
					conn.close();
				} catch (SQLException ex) {
				}
			}
		}
	}


Input:
    public void fillComponents(UIContainer tofill, ViewParameters viewparams,
            ComponentChecker checker) {
        AssignmentViewParams params = (AssignmentViewParams) viewparams;
        Assignment2 assignment = assignmentLogic.getAssignmentById(params.assignmentId);
        String titleHeading = assignment.getTitle();
        if (gradebookLogic.getGradebookGradeEntryType(assignment.getContextId()) == ExternalGradebookLogic.ENTRY_BY_POINTS) {
            GradebookItem gradebookItem = gradebookLogic.getGradebookItemById(assignment.getContextId(), assignment.getGradebookItemId());
            if (gradebookItem == null) {
                throw new GradebookItemNotFoundException("No gradebook item found with id: " + assignment.getGradebookItemId());
            }
            titleHeading += " [" + gradebookItem.getPointsPossible() + "]";
        }
        UIOutput.make(tofill, "title-header", titleHeading);
        boolean anyUngradable = false;
        if (uploadBean.parsedContent != null) {
        	Set<String> submitters = assignmentPermissionLogic.getSubmittersInSite(assignment.getContextId());
            Map<String, String> displayIdUserIdMap = externalLogic.getUserDisplayIdUserIdMapForUsers(submitters);
            for (List<String> parts: uploadBean.parsedContent) {
                if (parts.size() < 4) {
                    while (parts.size() < 4) {
                        parts.add(" ");
                    }
                }
                UIBranchContainer row = UIBranchContainer.make(tofill, "student-row:");
                UIOutput.make(row, "student-id", parts.get(0));
                UIOutput.make(row, "student-name", parts.get(1));
                UIOutput.make(row, "grade", parts.get(2));
                UIOutput.make(row, "comments", parts.get(3));
                if(displayIdUserIdMap.containsKey(parts.get(0)) &&
                		!assignmentPermissionLogic.isUserAllowedToManageSubmission(null, displayIdUserIdMap.get(parts.get(0)), assignment)){
                	row.decorate(new UIFreeAttributeDecorator("class", "uploadHighlight"));
                	anyUngradable = true;
                }
            }
        }
        if(anyUngradable){
        	messages.addMessage(new TargettedMessage("assignment2.upload_grades_confirm.warning.ids_not_imported"));
        }
        makeBreadcrumbs(tofill, assignment);
        UIForm finishForm = UIForm.make(tofill, "finish-form");
        UICommand.make(finishForm, "ok-button", UIMessage.make("assignment2.upload_grades_confirm.button.ok"), "UploadBean.processUploadConfirmAndSave");
        UICommand.make(finishForm, "cancel-button", UIMessage.make("assignment2.upload_grades_confirm.button.back"), "UploadBean.processBackToUpload");
    }

Output:
    public void fillComponents(UIContainer tofill, ViewParameters viewparams,
            ComponentChecker checker) {
        AssignmentViewParams params = (AssignmentViewParams) viewparams;
        Assignment2 assignment = assignmentLogic.getAssignmentById(params.assignmentId);
        String titleHeading = assignment.getTitle();
        if (gradebookLogic.getGradebookGradeEntryType(assignment.getContextId()) == ExternalGradebookLogic.ENTRY_BY_POINTS) {
            GradebookItem gradebookItem = gradebookLogic.getGradebookItemById(assignment.getContextId(), assignment.getGradebookItemId());
            if (gradebookItem == null) {
                throw new GradebookItemNotFoundException("No gradebook item found with id: " + assignment.getGradebookItemId());
            }
            titleHeading += " [" + gradebookItem.getPointsPossible() + "]";
        }
        UIOutput.make(tofill, "title-header", titleHeading);
        boolean anyUngradable = false;
        if (uploadBean.parsedContent != null) {
        	Set<String> submitters = assignmentPermissionLogic.getSubmittersInSite(assignment.getContextId());
            Map<String, String> displayIdUserIdMap = externalLogic.getUserDisplayIdUserIdMapForUsers(submitters);
            for (List<String> parts: uploadBean.parsedContent) {
                if (parts.size() < 4) {
                    while (parts.size() < 4) {
                        parts.add("");
                    }
                }
                UIBranchContainer row = UIBranchContainer.make(tofill, "student-row:");
                UIOutput.make(row, "student-id", parts.get(0));
                UIOutput.make(row, "student-name", parts.get(1));
                UIOutput.make(row, "grade", parts.get(2));
                UIOutput.make(row, "comments", parts.get(3));
                if(displayIdUserIdMap.containsKey(parts.get(0)) &&
                		!assignmentPermissionLogic.isUserAllowedToManageSubmission(null, displayIdUserIdMap.get(parts.get(0)), assignment)){
                	row.decorate(new UIFreeAttributeDecorator("class", "uploadHighlight"));
                	anyUngradable = true;
                }
            }
        }
        if(anyUngradable){
        	messages.addMessage(new TargettedMessage("assignment2.upload_grades_confirm.warning.ids_not_imported"));
        }
        makeBreadcrumbs(tofill, assignment);
        UIForm finishForm = UIForm.make(tofill, "finish-form");
        UICommand.make(finishForm, "ok-button", UIMessage.make("assignment2.upload_grades_confirm.button.ok"), "UploadBean.processUploadConfirmAndSave");
        UICommand.make(finishForm, "cancel-button", UIMessage.make("assignment2.upload_grades_confirm.button.back"), "UploadBean.processBackToUpload");
    }


Input:
    private void register() throws IOException {
	Logger.println("Registering with " + registrar);
        FromHeader fromHeader = getFromHeader();
        Address fromAddress = fromHeader.getAddress();
        SipURI requestURI = null;
        try {
            requestURI = addressFactory.createSipURI(null, registrar);
	} catch (ParseException e) {
            throw new IOException("Bad registrar address:" + registrar, e);
        }
        requestURI.setPort(registrarPort);
        try {
            requestURI.setTransportParam(sipProvider.getListeningPoint().getTransport());
        } catch (ParseException e) {
            throw new IOException(sipProvider.getListeningPoint().getTransport()
		+ " is not a valid transport!", e);
        }
        CallIdHeader callIdHeader = sipProvider.getNewCallId();
        CSeqHeader cSeqHeader = null;
        try {
            cSeqHeader = headerFactory.createCSeqHeader(1, Request.REGISTER);
        } catch (ParseException e) {
            throw new IOException("Corrupt Sip Stack " + e.getMessage());
        } catch (InvalidArgumentException e) {
            throw new IOException("The application is corrupt "  );
        }
        ToHeader toHeader = null;
        try {
            String proxyWorkAround =
                System.getProperty("com.sun.mc.softphone.REGISTRAR_WORKAROUND");
            if (proxyWorkAround != null &&
                    proxyWorkAround.toUpperCase().equals("TRUE")) {
                SipURI toURI = (SipURI)(requestURI.clone());
                toURI.setUser(System.getProperty("user.name"));
                toHeader = headerFactory.createToHeader(addressFactory.createAddress(toURI), null);
            } else {
                toHeader = headerFactory.createToHeader(fromAddress, null);
            }
        } catch (ParseException e) {
            throw new IOException("Could not create a To header for address:"
                + fromHeader.getAddress() + " " + e.getMessage());
        }
        ArrayList viaHeaders = getLocalViaHeaders();
        MaxForwardsHeader maxForwardsHeader = getMaxForwardsHeader();
        Request request = null;
        try {
            request = messageFactory.createRequest(requestURI,
                Request.REGISTER,
                callIdHeader,
                cSeqHeader, fromHeader, toHeader,
                viaHeaders,
                maxForwardsHeader);
        } catch (ParseException e) {
            throw new IOException("Could not create the register request! " + e.getMessage());
	}
        ExpiresHeader expHeader = null;
        for (int retry = 0; retry < 2; retry++) {
            try {
                expHeader = headerFactory.createExpiresHeader(
                    expires);
            } catch (InvalidArgumentException e) {
                if (retry == 0) {
                    continue;
                }
                throw new IOException(
                    "Invalid registrations expiration parameter - "
                    + expires + " " + e.getMessage());
            }
        }
        request.addHeader(expHeader);
        ContactHeader contactHeader = getRegistrationContactHeader();
	request.addHeader(contactHeader);
        ClientTransaction regTrans = null;
        try {
            regTrans = sipProvider.getNewClientTransaction(request);
        } catch (TransactionUnavailableException e) {
            throw new IOException("Could not create a register transaction!\n"
                + "Check that the Registrar address is correct! " + e.getMessage());
        } try {
	    sipCallId = callIdHeader.getCallId();
	    sipServerCallback.addSipListener(sipCallId, this);
	    registerRequest = request;
            regTrans.sendRequest();
	    if (Logger.logLevel >= Logger.LOG_MOREINFO) {
	        Logger.println("Sent register request " + registerRequest);
	    }
	    if (expires > 0) {
                scheduleReRegistration();
	    }
        } catch (Exception e) {
	    throw new IOException("Could not send out the register request! " + e.getMessage());
        }
        this.registerRequest = request;
    }

Output:
    private void register() throws IOException {
	Logger.println("Registering with " + registrar);
        FromHeader fromHeader = getFromHeader();
        Address fromAddress = fromHeader.getAddress();
        SipURI requestURI = null;
        try {
            requestURI = addressFactory.createSipURI(null, registrar);
	} catch (ParseException e) {
            throw new IOException("Bad registrar address:" + registrar + " "
		+ e.getMessage());
        }
        requestURI.setPort(registrarPort);
        try {
            requestURI.setTransportParam(sipProvider.getListeningPoint().getTransport());
        } catch (ParseException e) {
            throw new IOException(sipProvider.getListeningPoint().getTransport()
		+ " is not a valid transport! " + e.getMessage());
        }
        CallIdHeader callIdHeader = sipProvider.getNewCallId();
        CSeqHeader cSeqHeader = null;
        try {
            cSeqHeader = headerFactory.createCSeqHeader(1, Request.REGISTER);
        } catch (ParseException e) {
            throw new IOException("Corrupt Sip Stack " + e.getMessage());
        } catch (InvalidArgumentException e) {
            throw new IOException("The application is corrupt "  );
        }
        ToHeader toHeader = null;
        try {
            String proxyWorkAround =
                System.getProperty("com.sun.mc.softphone.REGISTRAR_WORKAROUND");
            if (proxyWorkAround != null &&
                    proxyWorkAround.toUpperCase().equals("TRUE")) {
                SipURI toURI = (SipURI)(requestURI.clone());
                toURI.setUser(System.getProperty("user.name"));
                toHeader = headerFactory.createToHeader(addressFactory.createAddress(toURI), null);
            } else {
                toHeader = headerFactory.createToHeader(fromAddress, null);
            }
        } catch (ParseException e) {
            throw new IOException("Could not create a To header for address:"
                + fromHeader.getAddress() + " " + e.getMessage());
        }
        ArrayList viaHeaders = getLocalViaHeaders();
        MaxForwardsHeader maxForwardsHeader = getMaxForwardsHeader();
        Request request = null;
        try {
            request = messageFactory.createRequest(requestURI,
                Request.REGISTER,
                callIdHeader,
                cSeqHeader, fromHeader, toHeader,
                viaHeaders,
                maxForwardsHeader);
        } catch (ParseException e) {
            throw new IOException("Could not create the register request! " + e.getMessage());
	}
        ExpiresHeader expHeader = null;
        for (int retry = 0; retry < 2; retry++) {
            try {
                expHeader = headerFactory.createExpiresHeader(
                    expires);
            } catch (InvalidArgumentException e) {
                if (retry == 0) {
                    continue;
                }
                throw new IOException(
                    "Invalid registrations expiration parameter - "
                    + expires + " " + e.getMessage());
            }
        }
        request.addHeader(expHeader);
        ContactHeader contactHeader = getRegistrationContactHeader();
	request.addHeader(contactHeader);
        ClientTransaction regTrans = null;
        try {
            regTrans = sipProvider.getNewClientTransaction(request);
        } catch (TransactionUnavailableException e) {
            throw new IOException("Could not create a register transaction!\n"
                + "Check that the Registrar address is correct! " + e.getMessage());
        } try {
	    sipCallId = callIdHeader.getCallId();
	    sipServerCallback.addSipListener(sipCallId, this);
	    registerRequest = request;
            regTrans.sendRequest();
	    if (Logger.logLevel >= Logger.LOG_MOREINFO) {
	        Logger.println("Sent register request " + registerRequest);
	    }
	    if (expires > 0) {
                scheduleReRegistration();
	    }
        } catch (Exception e) {
	    throw new IOException("Could not send out the register request! " + e.getMessage());
        }
        this.registerRequest = request;
    }


Input:
    public void paint(Graphics g)
    {
        final boolean[] keys = model.getCurrentOctaveKeys();
        final int width = getWidth();
        final int height = getHeight();
        final int fontHeight = g.getFont().getHeight();
        final int whiteKeyWidth = (width - MARGIN * 2) / 7;
        final int whiteKeyHeight = height -
                (MARGIN + KEYS_NOTES_DISTANCE + fontHeight * 2);
        final int blackKeyWidth = whiteKeyWidth / 2;
        final int blackKeyHeight = whiteKeyHeight / 2;
        final int blackKeyNarrowWidth = blackKeyWidth / 2;
        final int whiteKeyNarrowWidth = whiteKeyWidth - blackKeyNarrowWidth;
        final int whiteKeyLesserHeight = whiteKeyHeight - blackKeyHeight;
        g.setColor(WHITE_COLOR);
        g.fillRect(0, 0, width, height);
        final int cx1 = 0 + MARGIN;
        final int cy1 = 0 + MARGIN;
        final int cx2 = cx1 + whiteKeyNarrowWidth;
        final int cy2 = cy1;
        final int cx3 = cx2;
        final int cy3 = cy2 + blackKeyHeight;
        final int cx4 = cx1 + whiteKeyWidth;
        final int cy4 = cy3;
        final int cx5 = cx4;
        final int cy5 = cy1 + whiteKeyHeight;
        final int cx6 = cx1;
        final int cy6 = cy5;
        setKeyColor(g, NOTE_C, keys[NOTE_C]);
        g.fillRect(cx1, cy1, whiteKeyNarrowWidth, whiteKeyHeight);
        g.fillRect(cx3, cy3, blackKeyNarrowWidth, whiteKeyLesserHeight);
        if(!keys[NOTE_C])
        {
            g.setColor(CONTOUR_COLOR);
            g.drawLine(cx1, cy1, cx2, cy2);
            g.drawLine(cx2, cy2, cx3, cy3);
            g.drawLine(cx3, cy3, cx4, cy4);
            g.drawLine(cx4, cy4, cx5, cy5);
            g.drawLine(cx5, cy5, cx6, cy6);
            g.drawLine(cx6, cy6, cx1, cy1);
        }
        final int ccx1 = cx2;
        final int ccy1 = cy2;
        final int ccx2 = ccx1 + blackKeyWidth;
        final int ccy2 = ccy1;
        setKeyColor(g, NOTE_C_SHARP, keys[NOTE_C_SHARP]);
        g.fillRect(ccx1, ccy1, blackKeyWidth, blackKeyHeight);
        if(keys[NOTE_C_SHARP])
        {
            g.setColor(CONTOUR_COLOR);
            g.drawRect(ccx1, ccy1, blackKeyWidth, blackKeyHeight);
        }
        final int dx1 = ccx2;
        final int dy1 = ccy2;
        final int dx2 = dx1 + whiteKeyNarrowWidth - blackKeyNarrowWidth;
        final int dy2 = dy1;
        final int dx3 = dx2;
        final int dy3 = dy2 + blackKeyHeight;
        final int dx4 = cx4 + whiteKeyWidth;
        final int dy4 = dy3;
        final int dx5 = dx4;
        final int dy5 = dy2 + whiteKeyHeight;
        final int dx6 = cx5;
        final int dy6 = dy5;
        final int dx7 = dx6;
        final int dy7 = dy3;
        final int dx8 = dx1;
        final int dy8 = dy3;
        setKeyColor(g, NOTE_D, keys[NOTE_D]);
        g.fillRect(dx1, dy1, dx2 - dx1, blackKeyHeight);
        g.fillRect(dx7, dy7, whiteKeyWidth, whiteKeyLesserHeight);
        if(!keys[NOTE_D])
        {
            g.setColor(CONTOUR_COLOR);
            g.drawLine(dx1, dy1, dx2, dy2);
            g.drawLine(dx2, dy2, dx3, dy3);
            g.drawLine(dx3, dy3, dx4, dy4);
            g.drawLine(dx4, dy4, dx5, dy5);
            g.drawLine(dx5, dy5, dx6, dy6);
            g.drawLine(dx6, dy6, dx7, dy7);
            g.drawLine(dx7, dy7, dx8, dy8);
            g.drawLine(dx8, dy8, dx1, dy1);
        }
        final int ddx1 = dx2;
        final int ddy1 = dy2;
        final int ddx2 = ddx1 + blackKeyWidth;
        final int ddy2 = ddy1;
        setKeyColor(g, NOTE_D_SHARP, keys[NOTE_D_SHARP]);
        g.fillRect(ddx1, ddy1, blackKeyWidth, blackKeyHeight);
        if(keys[NOTE_D_SHARP])
        {
            g.setColor(CONTOUR_COLOR);
            g.drawRect(ddx1, ddy1, blackKeyWidth, blackKeyHeight);
        }
        final int ex1 = ddx2;
        final int ey1 = ddy2;
        final int ex2 = dx4 + whiteKeyWidth;
        final int ey2 = ey1;
        final int ex3 = ex2;
        final int ey3 = ey2 + whiteKeyHeight;
        final int ex4 = dx5;
        final int ey4 = ey3;
        final int ex5 = ex4;
        final int ey5 = dy4;
        final int ex6 = ex5 + blackKeyNarrowWidth;
        final int ey6 = ey5;
        setKeyColor(g, NOTE_E, keys[NOTE_E]);
        g.fillRect(ex1, ey1, whiteKeyNarrowWidth, blackKeyHeight);
        g.fillRect(ex5, ey5, whiteKeyWidth, whiteKeyLesserHeight);
        if(!keys[NOTE_E])
        {
            g.setColor(CONTOUR_COLOR);
            g.drawLine(ex1, ey1, ex2, ey2);
            g.drawLine(ex2, ey2, ex3, ey3);
            g.drawLine(ex3, ey3, ex4, ey4);
            g.drawLine(ex4, ey4, ex5, ey5);
            g.drawLine(ex5, ey5, ex6, ey6);
            g.drawLine(ex6, ey6, ex1, ey1);
        }
        final int fx1 = ex2;
        final int fy1 = ey2;
        final int fx2 = fx1 + whiteKeyNarrowWidth;
        final int fy2 = fy1;
        final int fx3 = fx2;
        final int fy3 = fy2 + blackKeyHeight;
        final int fx4 = fx1 + whiteKeyWidth;
        final int fy4 = fy3;
        final int fx5 = fx4;
        final int fy5 = fy1 + whiteKeyHeight;
        final int fx6 = fx1;
        final int fy6 = fy5;
        setKeyColor(g, NOTE_F, keys[NOTE_F]);
        g.fillRect(fx1, fy1, whiteKeyNarrowWidth, whiteKeyHeight);
        g.fillRect(fx3, fy3, blackKeyNarrowWidth, whiteKeyLesserHeight);
        if(!keys[NOTE_F])
        {
            g.setColor(CONTOUR_COLOR);
            g.drawLine(fx1, fy1, fx2, fy2);
            g.drawLine(fx2, fy2, fx3, fy3);
            g.drawLine(fx3, fy3, fx4, fy4);
            g.drawLine(fx4, fy4, fx5, fy5);
            g.drawLine(fx5, fy5, fx6, fy6);
            g.drawLine(fx6, fy6, fx1, fy1);
        }
        final int ffx1 = fx2;
        final int ffy1 = fy2;
        final int ffx2 = ffx1 + blackKeyWidth;
        final int ffy2 = ffy1;
        setKeyColor(g, NOTE_F_SHARP, keys[NOTE_F_SHARP]);
        g.fillRect(ffx1, ffy1, blackKeyWidth, blackKeyHeight);
        if(keys[NOTE_F_SHARP])
        {
            g.setColor(CONTOUR_COLOR);
            g.drawRect(ffx1, ffy1, blackKeyWidth, blackKeyHeight);
        }
        final int gx1 = ffx2;
        final int gy1 = ffy2;
        final int gx2 = gx1 + whiteKeyNarrowWidth - blackKeyNarrowWidth;
        final int gy2 = gy1;
        final int gx3 = gx2;
        final int gy3 = gy2 + blackKeyHeight;
        final int gx4 = fx4 + whiteKeyWidth;
        final int gy4 = gy3;
        final int gx5 = gx4;
        final int gy5 = gy2 + whiteKeyHeight;
        final int gx6 = fx5;
        final int gy6 = gy5;
        final int gx7 = gx6;
        final int gy7 = gy3;
        final int gx8 = gx1;
        final int gy8 = gy3;
        setKeyColor(g, NOTE_G, keys[NOTE_G]);
        g.fillRect(gx1, gy1, gx2 - gx1, blackKeyHeight);
        g.fillRect(gx7, gy7, whiteKeyWidth, whiteKeyLesserHeight);
        if(!keys[NOTE_G])
        {
            g.setColor(CONTOUR_COLOR);
            g.drawLine(gx1, gy1, gx2, gy2);
            g.drawLine(gx2, gy2, gx3, gy3);
            g.drawLine(gx3, gy3, gx4, gy4);
            g.drawLine(gx4, gy4, gx5, gy5);
            g.drawLine(gx5, gy5, gx6, gy6);
            g.drawLine(gx6, gy6, gx7, gy7);
            g.drawLine(gx7, gy7, gx8, gy8);
            g.drawLine(gx8, gy8, gx1, gy1);
        }
        final int ggx1 = gx2;
        final int ggy1 = gy2;
        final int ggx2 = ggx1 + blackKeyWidth;
        final int ggy2 = ggy1;
        setKeyColor(g, NOTE_G_SHARP, keys[NOTE_G_SHARP]);
        g.fillRect(ggx1, ggy1, blackKeyWidth, blackKeyHeight);
        if(keys[NOTE_G_SHARP])
        {
            g.setColor(CONTOUR_COLOR);
            g.drawRect(ggx1, ggy1, blackKeyWidth, blackKeyHeight);
        }
        final int ax1 = ggx2;
        final int ay1 = ggy2;
        final int ax2 = ax1 + whiteKeyNarrowWidth - blackKeyNarrowWidth;
        final int ay2 = ay1;
        final int ax3 = ax2;
        final int ay3 = ay2 + blackKeyHeight;
        final int ax4 = gx4 + whiteKeyWidth;
        final int ay4 = ay3;
        final int ax5 = ax4;
        final int ay5 = ay2 + whiteKeyHeight;
        final int ax6 = gx5;
        final int ay6 = ay5;
        final int ax7 = ax6;
        final int ay7 = ay3;
        final int ax8 = ax1;
        final int ay8 = ay3;
        setKeyColor(g, NOTE_A, keys[NOTE_A]);
        g.fillRect(ax1, ay1, ax2 - ax1, blackKeyHeight);
        g.fillRect(ax7, ay7, whiteKeyWidth, whiteKeyLesserHeight);
        if(!keys[NOTE_A])
        {
            g.setColor(CONTOUR_COLOR);
            g.drawLine(ax1, ay1, ax2, ay2);
            g.drawLine(ax2, ay2, ax3, ay3);
            g.drawLine(ax3, ay3, ax4, ay4);
            g.drawLine(ax4, ay4, ax5, ay5);
            g.drawLine(ax5, ay5, ax6, ay6);
            g.drawLine(ax6, ay6, ax7, ay7);
            g.drawLine(ax7, ay7, ax8, ay8);
            g.drawLine(ax8, ay8, ax1, ay1);
        }
        final int aax1 = ax2;
        final int aay1 = ay2;
        final int aax2 = aax1 + blackKeyWidth;
        final int aay2 = aay1;
        setKeyColor(g, NOTE_A_SHARP, keys[NOTE_A_SHARP]);
        g.fillRect(aax1, aay1, blackKeyWidth, blackKeyHeight);
        if(keys[PianoNotes.NOTE_A_SHARP])
        {
            g.setColor(CONTOUR_COLOR);
            g.drawRect(aax1, aay1, blackKeyWidth, blackKeyHeight);
        }
        final int hx1 = aax2;
        final int hy1 = aay2;
        final int hx2 = ax4 + whiteKeyWidth;
        final int hy2 = hy1;
        final int hx3 = hx2;
        final int hy3 = hy2 + whiteKeyHeight;
        final int hx4 = ax5;
        final int hy4 = hy3;
        final int hx5 = hx4;
        final int hy5 = ay4;
        final int hx6 = hx5 + blackKeyNarrowWidth;
        final int hy6 = hy5;
        setKeyColor(g, NOTE_H, keys[NOTE_H]);
        g.fillRect(hx1, hy1, whiteKeyNarrowWidth, blackKeyHeight);
        g.fillRect(hx5, hy5, whiteKeyWidth, whiteKeyLesserHeight);
        if(!keys[NOTE_H])
        {
            g.setColor(CONTOUR_COLOR);
            g.drawLine(hx1, hy1, hx2, hy2);
            g.drawLine(hx2, hy2, hx3, hy3);
            g.drawLine(hx3, hy3, hx4, hy4);
            g.drawLine(hx4, hy4, hx5, hy5);
            g.drawLine(hx5, hy5, hx6, hy6);
            g.drawLine(hx6, hy6, hx1, hy1);
        }
        g.setColor(CONTOUR_COLOR);
        final int dcyw = height;
        final int dcyb = dcyw - fontHeight;
        final int yl = cy6 + 5;
        final int dcylw = dcyb - 2;
        final int dcylb = dcylw - fontHeight;
        final int halfWhiteKeyWidth = whiteKeyWidth / 2;
        final int halfBlackKeyWidth = blackKeyWidth / 2;
        final int dccx1 = cx1 + halfWhiteKeyWidth;
        g.drawChar('1', dccx1, dcyw, Graphics.BOTTOM | Graphics.HCENTER);
        g.drawLine(dccx1, dcylw, dccx1, yl);
        final int dcccx1 = ccx1 + halfBlackKeyWidth;
        g.drawChar('2', dcccx1, dcyb, Graphics.BOTTOM | Graphics.HCENTER);
        g.drawLine(dcccx1, dcylb, dcccx1, yl);
        final int dcdx1 = dx6 + halfWhiteKeyWidth;
        g.drawChar('3', dcdx1, dcyw, Graphics.BOTTOM | Graphics.HCENTER);
        g.drawLine(dcdx1, dcylw, dcdx1, yl);
        final int dcddx1 = ddx1 + halfBlackKeyWidth;
        g.drawChar('4', dcddx1, dcyb, Graphics.BOTTOM | Graphics.HCENTER);
        g.drawLine(dcddx1, dcylb, dcddx1, yl);
        final int dcex1 = ex4 + halfWhiteKeyWidth;
        g.drawChar('5', dcex1, dcyw, Graphics.BOTTOM | Graphics.HCENTER);
        g.drawLine(dcex1, dcylw, dcex1, yl);
        final int dcfx1 = fx1 + halfWhiteKeyWidth;
        g.drawChar('6', dcfx1, dcyw, Graphics.BOTTOM | Graphics.HCENTER);
        g.drawLine(dcfx1, dcylw, dcfx1, yl);
        final int dcffx1 = ffx1 + halfBlackKeyWidth;
        g.drawChar('7', dcffx1, dcyb, Graphics.BOTTOM | Graphics.HCENTER);
        g.drawLine(dcffx1, dcylb, dcffx1, yl);
        final int dcgx1 = gx6 + halfWhiteKeyWidth;
        g.drawChar('8', dcgx1, dcyw, Graphics.BOTTOM | Graphics.HCENTER);
        g.drawLine(dcgx1, dcylw, dcgx1, yl);
        final int dcggx1 = ggx1 + halfBlackKeyWidth;
        g.drawChar('9', dcggx1, dcyb, Graphics.BOTTOM | Graphics.HCENTER);
        g.drawLine(dcggx1, dcylb, dcggx1, yl);
        final int dcax1 = ax6 + halfWhiteKeyWidth;
        g.drawChar('*', dcax1, dcyw, Graphics.BOTTOM | Graphics.HCENTER);
        g.drawLine(dcax1, dcylw, dcax1, yl);
        final int dcaax1 = aax1 + halfBlackKeyWidth;
        g.drawChar('0', dcaax1, dcyb, Graphics.BOTTOM | Graphics.HCENTER);
        g.drawLine(dcaax1, dcylb, dcaax1, yl);
        final int dchx1 = hx4 + halfWhiteKeyWidth;
        g.drawChar('#', dchx1, dcyw, Graphics.BOTTOM | Graphics.HCENTER);
        g.drawLine(dchx1, dcylw, dchx1, yl);
    }

Output:
    public void paint(Graphics g)
    {
        final boolean[] keys = model.getCurrentOctaveKeys();
        final int width = getWidth();
        final int height = getHeight();
        final int fontHeight = g.getFont().getHeight();
        final int whiteKeyWidth = (width - MARGIN * 2) / 7;
        final int whiteKeyHeight = height -
                (MARGIN + KEYS_NOTES_DISTANCE + fontHeight * 2);
        final int blackKeyWidth = whiteKeyWidth / 2;
        final int blackKeyHeight = whiteKeyHeight / 2;
        final int blackKeyNarrowWidth = blackKeyWidth / 2;
        final int whiteKeyNarrowWidth = whiteKeyWidth - blackKeyNarrowWidth;
        final int whiteKeyLesserHeight = whiteKeyHeight - blackKeyHeight;
        g.setColor(WHITE_COLOR);
        g.fillRect(0, 0, width, height);
        final int cx1 = 0 + MARGIN;
        final int cy1 = 0 + MARGIN;
        final int cx2 = cx1 + whiteKeyNarrowWidth;
        final int cy2 = cy1;
        final int cx3 = cx2;
        final int cy3 = cy2 + blackKeyHeight;
        final int cx4 = cx1 + whiteKeyWidth;
        final int cy4 = cy3;
        final int cx5 = cx4;
        final int cy5 = cy1 + whiteKeyHeight;
        final int cx6 = cx1;
        final int cy6 = cy5;
        setKeyColor(g, NOTE_C, keys[NOTE_C]);
        g.fillRect(cx1, cy1, whiteKeyNarrowWidth, whiteKeyHeight);
        g.fillRect(cx3, cy3, blackKeyNarrowWidth, whiteKeyLesserHeight);
        if(!keys[NOTE_C])
        {
            g.setColor(CONTOUR_COLOR);
            g.drawLine(cx1, cy1, cx2, cy2);
            g.drawLine(cx2, cy2, cx3, cy3);
            g.drawLine(cx3, cy3, cx4, cy4);
            g.drawLine(cx4, cy4, cx5, cy5);
            g.drawLine(cx5, cy5, cx6, cy6);
            g.drawLine(cx6, cy6, cx1, cy1);
        }
        final int ccx1 = cx2;
        final int ccy1 = cy2;
        final int ccx2 = ccx1 + blackKeyWidth;
        final int ccy2 = ccy1;
        setKeyColor(g, NOTE_C_SHARP, keys[NOTE_C_SHARP]);
        g.fillRect(ccx1, ccy1, blackKeyWidth, blackKeyHeight);
        if(keys[NOTE_C_SHARP])
        {
            g.setColor(CONTOUR_COLOR);
            g.drawRect(ccx1, ccy1, blackKeyWidth, blackKeyHeight);
        }
        final int dx1 = ccx2;
        final int dy1 = ccy2;
        final int dx2 = dx1 + whiteKeyNarrowWidth - blackKeyNarrowWidth;
        final int dy2 = dy1;
        final int dx3 = dx2;
        final int dy3 = dy2 + blackKeyHeight;
        final int dx4 = cx4 + whiteKeyWidth;
        final int dy4 = dy3;
        final int dx5 = dx4;
        final int dy5 = dy2 + whiteKeyHeight;
        final int dx6 = cx5;
        final int dy6 = dy5;
        final int dx7 = dx6;
        final int dy7 = dy3;
        final int dx8 = dx1;
        final int dy8 = dy3;
        setKeyColor(g, NOTE_D, keys[NOTE_D]);
        g.fillRect(dx1, dy1, dx2 - dx1, blackKeyHeight);
        g.fillRect(dx7, dy7, whiteKeyWidth, whiteKeyLesserHeight);
        if(!keys[NOTE_D])
        {
            g.setColor(CONTOUR_COLOR);
            g.drawLine(dx1, dy1, dx2, dy2);
            g.drawLine(dx2, dy2, dx3, dy3);
            g.drawLine(dx3, dy3, dx4, dy4);
            g.drawLine(dx4, dy4, dx5, dy5);
            g.drawLine(dx5, dy5, dx6, dy6);
            g.drawLine(dx6, dy6, dx7, dy7);
            g.drawLine(dx7, dy7, dx8, dy8);
            g.drawLine(dx8, dy8, dx1, dy1);
        }
        final int ddx1 = dx2;
        final int ddy1 = dy2;
        final int ddx2 = ddx1 + blackKeyWidth;
        final int ddy2 = ddy1;
        setKeyColor(g, NOTE_D_SHARP, keys[NOTE_D_SHARP]);
        g.fillRect(ddx1, ddy1, blackKeyWidth, blackKeyHeight);
        if(keys[NOTE_D_SHARP])
        {
            g.setColor(CONTOUR_COLOR);
            g.drawRect(ddx1, ddy1, blackKeyWidth, blackKeyHeight);
        }
        final int ex1 = ddx2;
        final int ey1 = ddy2;
        final int ex2 = dx4 + whiteKeyWidth;
        final int ey2 = ey1;
        final int ex3 = ex2;
        final int ey3 = ey2 + whiteKeyHeight;
        final int ex4 = dx5;
        final int ey4 = ey3;
        final int ex5 = ex4;
        final int ey5 = dy4;
        final int ex6 = ex1;
        final int ey6 = ey5;
        setKeyColor(g, NOTE_E, keys[NOTE_E]);
        g.fillRect(ex1, ey1, whiteKeyNarrowWidth, blackKeyHeight);
        g.fillRect(ex5, ey5, whiteKeyWidth, whiteKeyLesserHeight);
        if(!keys[NOTE_E])
        {
            g.setColor(CONTOUR_COLOR);
            g.drawLine(ex1, ey1, ex2, ey2);
            g.drawLine(ex2, ey2, ex3, ey3);
            g.drawLine(ex3, ey3, ex4, ey4);
            g.drawLine(ex4, ey4, ex5, ey5);
            g.drawLine(ex5, ey5, ex6, ey6);
            g.drawLine(ex6, ey6, ex1, ey1);
        }
        final int fx1 = ex2;
        final int fy1 = ey2;
        final int fx2 = fx1 + whiteKeyNarrowWidth;
        final int fy2 = fy1;
        final int fx3 = fx2;
        final int fy3 = fy2 + blackKeyHeight;
        final int fx4 = fx1 + whiteKeyWidth;
        final int fy4 = fy3;
        final int fx5 = fx4;
        final int fy5 = fy1 + whiteKeyHeight;
        final int fx6 = fx1;
        final int fy6 = fy5;
        setKeyColor(g, NOTE_F, keys[NOTE_F]);
        g.fillRect(fx1, fy1, whiteKeyNarrowWidth, whiteKeyHeight);
        g.fillRect(fx3, fy3, blackKeyNarrowWidth, whiteKeyLesserHeight);
        if(!keys[NOTE_F])
        {
            g.setColor(CONTOUR_COLOR);
            g.drawLine(fx1, fy1, fx2, fy2);
            g.drawLine(fx2, fy2, fx3, fy3);
            g.drawLine(fx3, fy3, fx4, fy4);
            g.drawLine(fx4, fy4, fx5, fy5);
            g.drawLine(fx5, fy5, fx6, fy6);
            g.drawLine(fx6, fy6, fx1, fy1);
        }
        final int ffx1 = fx2;
        final int ffy1 = fy2;
        final int ffx2 = ffx1 + blackKeyWidth;
        final int ffy2 = ffy1;
        setKeyColor(g, NOTE_F_SHARP, keys[NOTE_F_SHARP]);
        g.fillRect(ffx1, ffy1, blackKeyWidth, blackKeyHeight);
        if(keys[NOTE_F_SHARP])
        {
            g.setColor(CONTOUR_COLOR);
            g.drawRect(ffx1, ffy1, blackKeyWidth, blackKeyHeight);
        }
        final int gx1 = ffx2;
        final int gy1 = ffy2;
        final int gx2 = gx1 + whiteKeyNarrowWidth - blackKeyNarrowWidth;
        final int gy2 = gy1;
        final int gx3 = gx2;
        final int gy3 = gy2 + blackKeyHeight;
        final int gx4 = fx4 + whiteKeyWidth;
        final int gy4 = gy3;
        final int gx5 = gx4;
        final int gy5 = gy2 + whiteKeyHeight;
        final int gx6 = fx5;
        final int gy6 = gy5;
        final int gx7 = gx6;
        final int gy7 = gy3;
        final int gx8 = gx1;
        final int gy8 = gy3;
        setKeyColor(g, NOTE_G, keys[NOTE_G]);
        g.fillRect(gx1, gy1, gx2 - gx1, blackKeyHeight);
        g.fillRect(gx7, gy7, whiteKeyWidth, whiteKeyLesserHeight);
        if(!keys[NOTE_G])
        {
            g.setColor(CONTOUR_COLOR);
            g.drawLine(gx1, gy1, gx2, gy2);
            g.drawLine(gx2, gy2, gx3, gy3);
            g.drawLine(gx3, gy3, gx4, gy4);
            g.drawLine(gx4, gy4, gx5, gy5);
            g.drawLine(gx5, gy5, gx6, gy6);
            g.drawLine(gx6, gy6, gx7, gy7);
            g.drawLine(gx7, gy7, gx8, gy8);
            g.drawLine(gx8, gy8, gx1, gy1);
        }
        final int ggx1 = gx2;
        final int ggy1 = gy2;
        final int ggx2 = ggx1 + blackKeyWidth;
        final int ggy2 = ggy1;
        setKeyColor(g, NOTE_G_SHARP, keys[NOTE_G_SHARP]);
        g.fillRect(ggx1, ggy1, blackKeyWidth, blackKeyHeight);
        if(keys[NOTE_G_SHARP])
        {
            g.setColor(CONTOUR_COLOR);
            g.drawRect(ggx1, ggy1, blackKeyWidth, blackKeyHeight);
        }
        final int ax1 = ggx2;
        final int ay1 = ggy2;
        final int ax2 = ax1 + whiteKeyNarrowWidth - blackKeyNarrowWidth;
        final int ay2 = ay1;
        final int ax3 = ax2;
        final int ay3 = ay2 + blackKeyHeight;
        final int ax4 = gx4 + whiteKeyWidth;
        final int ay4 = ay3;
        final int ax5 = ax4;
        final int ay5 = ay2 + whiteKeyHeight;
        final int ax6 = gx5;
        final int ay6 = ay5;
        final int ax7 = ax6;
        final int ay7 = ay3;
        final int ax8 = ax1;
        final int ay8 = ay3;
        setKeyColor(g, NOTE_A, keys[NOTE_A]);
        g.fillRect(ax1, ay1, ax2 - ax1, blackKeyHeight);
        g.fillRect(ax7, ay7, whiteKeyWidth, whiteKeyLesserHeight);
        if(!keys[NOTE_A])
        {
            g.setColor(CONTOUR_COLOR);
            g.drawLine(ax1, ay1, ax2, ay2);
            g.drawLine(ax2, ay2, ax3, ay3);
            g.drawLine(ax3, ay3, ax4, ay4);
            g.drawLine(ax4, ay4, ax5, ay5);
            g.drawLine(ax5, ay5, ax6, ay6);
            g.drawLine(ax6, ay6, ax7, ay7);
            g.drawLine(ax7, ay7, ax8, ay8);
            g.drawLine(ax8, ay8, ax1, ay1);
        }
        final int aax1 = ax2;
        final int aay1 = ay2;
        final int aax2 = aax1 + blackKeyWidth;
        final int aay2 = aay1;
        setKeyColor(g, NOTE_A_SHARP, keys[NOTE_A_SHARP]);
        g.fillRect(aax1, aay1, blackKeyWidth, blackKeyHeight);
        if(keys[PianoNotes.NOTE_A_SHARP])
        {
            g.setColor(CONTOUR_COLOR);
            g.drawRect(aax1, aay1, blackKeyWidth, blackKeyHeight);
        }
        final int hx1 = aax2;
        final int hy1 = aay2;
        final int hx2 = ax4 + whiteKeyWidth;
        final int hy2 = hy1;
        final int hx3 = hx2;
        final int hy3 = hy2 + whiteKeyHeight;
        final int hx4 = ax5;
        final int hy4 = hy3;
        final int hx5 = hx4;
        final int hy5 = ay4;
        final int hx6 = hx1;
        final int hy6 = hy5;
        setKeyColor(g, NOTE_H, keys[NOTE_H]);
        g.fillRect(hx1, hy1, whiteKeyNarrowWidth, blackKeyHeight);
        g.fillRect(hx5, hy5, whiteKeyWidth, whiteKeyLesserHeight);
        if(!keys[NOTE_H])
        {
            g.setColor(CONTOUR_COLOR);
            g.drawLine(hx1, hy1, hx2, hy2);
            g.drawLine(hx2, hy2, hx3, hy3);
            g.drawLine(hx3, hy3, hx4, hy4);
            g.drawLine(hx4, hy4, hx5, hy5);
            g.drawLine(hx5, hy5, hx6, hy6);
            g.drawLine(hx6, hy6, hx1, hy1);
        }
        g.setColor(CONTOUR_COLOR);
        final int dcyw = height;
        final int dcyb = dcyw - fontHeight;
        final int yl = cy6 + 5;
        final int dcylw = dcyb - 2;
        final int dcylb = dcylw - fontHeight;
        final int halfWhiteKeyWidth = whiteKeyWidth / 2;
        final int halfBlackKeyWidth = blackKeyWidth / 2;
        final int dccx1 = cx1 + halfWhiteKeyWidth;
        g.drawChar('1', dccx1, dcyw, Graphics.BOTTOM | Graphics.HCENTER);
        g.drawLine(dccx1, dcylw, dccx1, yl);
        final int dcccx1 = ccx1 + halfBlackKeyWidth;
        g.drawChar('2', dcccx1, dcyb, Graphics.BOTTOM | Graphics.HCENTER);
        g.drawLine(dcccx1, dcylb, dcccx1, yl);
        final int dcdx1 = dx6 + halfWhiteKeyWidth;
        g.drawChar('3', dcdx1, dcyw, Graphics.BOTTOM | Graphics.HCENTER);
        g.drawLine(dcdx1, dcylw, dcdx1, yl);
        final int dcddx1 = ddx1 + halfBlackKeyWidth;
        g.drawChar('4', dcddx1, dcyb, Graphics.BOTTOM | Graphics.HCENTER);
        g.drawLine(dcddx1, dcylb, dcddx1, yl);
        final int dcex1 = ex4 + halfWhiteKeyWidth;
        g.drawChar('5', dcex1, dcyw, Graphics.BOTTOM | Graphics.HCENTER);
        g.drawLine(dcex1, dcylw, dcex1, yl);
        final int dcfx1 = fx1 + halfWhiteKeyWidth;
        g.drawChar('6', dcfx1, dcyw, Graphics.BOTTOM | Graphics.HCENTER);
        g.drawLine(dcfx1, dcylw, dcfx1, yl);
        final int dcffx1 = ffx1 + halfBlackKeyWidth;
        g.drawChar('7', dcffx1, dcyb, Graphics.BOTTOM | Graphics.HCENTER);
        g.drawLine(dcffx1, dcylb, dcffx1, yl);
        final int dcgx1 = gx6 + halfWhiteKeyWidth;
        g.drawChar('8', dcgx1, dcyw, Graphics.BOTTOM | Graphics.HCENTER);
        g.drawLine(dcgx1, dcylw, dcgx1, yl);
        final int dcggx1 = ggx1 + halfBlackKeyWidth;
        g.drawChar('9', dcggx1, dcyb, Graphics.BOTTOM | Graphics.HCENTER);
        g.drawLine(dcggx1, dcylb, dcggx1, yl);
        final int dcax1 = ax6 + halfWhiteKeyWidth;
        g.drawChar('*', dcax1, dcyw, Graphics.BOTTOM | Graphics.HCENTER);
        g.drawLine(dcax1, dcylw, dcax1, yl);
        final int dcaax1 = aax1 + halfBlackKeyWidth;
        g.drawChar('0', dcaax1, dcyb, Graphics.BOTTOM | Graphics.HCENTER);
        g.drawLine(dcaax1, dcylb, dcaax1, yl);
        final int dchx1 = hx4 + halfWhiteKeyWidth;
        g.drawChar('#', dchx1, dcyw, Graphics.BOTTOM | Graphics.HCENTER);
        g.drawLine(dchx1, dcylw, dchx1, yl);
    }


Input:
    public Object[] refreshDocument(DocumentRef ref, int refreshFlags,
            String[] schemas) throws ClientException {
        Object[] result = new Object[5];
        try {
            Document doc = resolveReference(ref);
            if (doc == null) {
                throw new ClientException("No Such Document: " + ref);
            }
            boolean readPermChecked = false;
            if ((refreshFlags & DocumentModel.REFRESH_PREFETCH) != 0) {
                if (!readPermChecked) {
                    checkPermission(doc, READ);
                    readPermChecked = true;
                }
                PrefetchInfo info = doc.getType().getPrefetchInfo();
                if (info != null) {
                    Schema[] pschemas = info.getSchemas();
                    if (pschemas != null) {
                    }
                    Field[] fields = info.getFields();
                    if (fields != null) {
                        Map<String, Serializable> prefetch = new HashMap<String, Serializable>();
                        for (Field field : fields) {
                            Object value = doc.getPropertyValue(field.getName().getPrefixedName());
                            prefetch.put(field.getDeclaringType().getName()
                                    + '.' + field.getName().getLocalName(),
                                    value == null ? Null.VALUE
                                            : (Serializable) value);
                        }
                        result[0] = prefetch;
                    }
                }
            }
            if ((refreshFlags & DocumentModel.REFRESH_LOCK) != 0) {
                if (!readPermChecked) {
                    checkPermission(doc, READ);
                    readPermChecked = true;
                }
                result[1] = doc.getLock();
            }
            if ((refreshFlags & DocumentModel.REFRESH_LIFE_CYCLE) != 0) {
                checkPermission(doc, READ_LIFE_CYCLE);
                result[2] = doc.getCurrentLifeCycleState();
                result[3] = doc.getLifeCyclePolicy();
            }
            if ((refreshFlags & DocumentModel.REFRESH_ACP) != 0) {
                checkPermission(doc, READ_SECURITY);
                result[4] = getSession().getSecurityManager().getMergedACP(doc);
            }
            if ((refreshFlags & (DocumentModel.REFRESH_CONTENT)) != 0) {
                if (!readPermChecked) {
                    checkPermission(doc, READ);
                    readPermChecked = true;
                }
                if (schemas == null) {
                    schemas = doc.getType().getSchemaNames();
                }
                DocumentType type = doc.getType();
                DocumentPart[] parts = new DocumentPart[schemas.length];
                for (int i = 0; i < schemas.length; i++) {
                    DocumentPart part = new DocumentPartImpl(
                            type.getSchema(schemas[i]));
                    doc.readDocumentPart(part);
                    parts[i] = part;
                }
                result[5] = parts;
            }
        } catch (ClientException e) {
            throw e;
        } catch (Exception e) {
            throw new ClientException("Failed to get refresh data", e);
        }
        return result;
    }

Output:
    public Object[] refreshDocument(DocumentRef ref, int refreshFlags,
            String[] schemas) throws ClientException {
        Object[] result = new Object[6];
        try {
            Document doc = resolveReference(ref);
            if (doc == null) {
                throw new ClientException("No Such Document: " + ref);
            }
            boolean readPermChecked = false;
            if ((refreshFlags & DocumentModel.REFRESH_PREFETCH) != 0) {
                if (!readPermChecked) {
                    checkPermission(doc, READ);
                    readPermChecked = true;
                }
                PrefetchInfo info = doc.getType().getPrefetchInfo();
                if (info != null) {
                    Schema[] pschemas = info.getSchemas();
                    if (pschemas != null) {
                    }
                    Field[] fields = info.getFields();
                    if (fields != null) {
                        Map<String, Serializable> prefetch = new HashMap<String, Serializable>();
                        for (Field field : fields) {
                            Object value = doc.getPropertyValue(field.getName().getPrefixedName());
                            prefetch.put(field.getDeclaringType().getName()
                                    + '.' + field.getName().getLocalName(),
                                    value == null ? Null.VALUE
                                            : (Serializable) value);
                        }
                        result[0] = prefetch;
                    }
                }
            }
            if ((refreshFlags & DocumentModel.REFRESH_LOCK) != 0) {
                if (!readPermChecked) {
                    checkPermission(doc, READ);
                    readPermChecked = true;
                }
                result[1] = doc.getLock();
            }
            if ((refreshFlags & DocumentModel.REFRESH_LIFE_CYCLE) != 0) {
                checkPermission(doc, READ_LIFE_CYCLE);
                result[2] = doc.getCurrentLifeCycleState();
                result[3] = doc.getLifeCyclePolicy();
            }
            if ((refreshFlags & DocumentModel.REFRESH_ACP) != 0) {
                checkPermission(doc, READ_SECURITY);
                result[4] = getSession().getSecurityManager().getMergedACP(doc);
            }
            if ((refreshFlags & (DocumentModel.REFRESH_CONTENT)) != 0) {
                if (!readPermChecked) {
                    checkPermission(doc, READ);
                    readPermChecked = true;
                }
                if (schemas == null) {
                    schemas = doc.getType().getSchemaNames();
                }
                DocumentType type = doc.getType();
                DocumentPart[] parts = new DocumentPart[schemas.length];
                for (int i = 0; i < schemas.length; i++) {
                    DocumentPart part = new DocumentPartImpl(
                            type.getSchema(schemas[i]));
                    doc.readDocumentPart(part);
                    parts[i] = part;
                }
                result[5] = parts;
            }
        } catch (ClientException e) {
            throw e;
        } catch (Exception e) {
            throw new ClientException("Failed to get refresh data", e);
        }
        return result;
    }


Input:
	public GNUScannerExtensionConfiguration() {
		addMacro("__complex__", "_Complex");
		addMacro("__extension__", "");
		addMacro("__imag__", "(int)");
		addMacro("__real__", "(int)");
		addMacro("__stdcall", "");
		addMacro("__builtin_va_arg(ap,type)", "*(type *)ap");
		addMacro("__builtin_constant_p(exp)", "0");
    	addPreprocessorKeyword(Keywords.cINCLUDE_NEXT, IPreprocessorDirective.ppInclude_next);
    	addPreprocessorKeyword(Keywords.cIMPORT, IPreprocessorDirective.ppImport);
    	addPreprocessorKeyword(Keywords.cWARNING, IPreprocessorDirective.ppWarning);
    	addPreprocessorKeyword(Keywords.cIDENT, IPreprocessorDirective.ppIgnore);
    	addPreprocessorKeyword(Keywords.cSCCS, IPreprocessorDirective.ppIgnore);
    	addPreprocessorKeyword(Keywords.cASSERT, IPreprocessorDirective.ppIgnore);
    	addPreprocessorKeyword(Keywords.cUNASSERT, IPreprocessorDirective.ppIgnore);
		addKeyword(GCCKeywords.cp__ALIGNOF__, IGCCToken.t___alignof__ );
		addKeyword(GCCKeywords.cp__ALIGNOF__, IGCCToken.t___alignof__ );
		addKeyword(GCCKeywords.cp__ASM, IToken.t_asm);
		addKeyword(GCCKeywords.cp__ASM__, IToken.t_asm);
		addKeyword(GCCKeywords.cp__ATTRIBUTE, IGCCToken.t__attribute__ );
		addKeyword(GCCKeywords.cp__ATTRIBUTE__, IGCCToken.t__attribute__ );
		addKeyword(GCCKeywords.cp__CONST, IToken.t_const);
		addKeyword(GCCKeywords.cp__CONST__, IToken.t_const);
		addKeyword(GCCKeywords.cp__DECLSPEC, IGCCToken.t__declspec );
		addKeyword(GCCKeywords.cp__INLINE, IToken.t_inline);
		addKeyword(GCCKeywords.cp__INLINE__, IToken.t_inline);
		addKeyword(GCCKeywords.cp__RESTRICT, IToken.t_restrict);
		addKeyword(GCCKeywords.cp__RESTRICT__, IToken.t_restrict);
		addKeyword(GCCKeywords.cp__VOLATILE, IToken.t_volatile);
		addKeyword(GCCKeywords.cp__VOLATILE__, IToken.t_volatile);
		addKeyword(GCCKeywords.cp__SIGNED, IToken.t_signed);
		addKeyword(GCCKeywords.cp__SIGNED__, IToken.t_signed);
		addKeyword(GCCKeywords.cp__TYPEOF, IGCCToken.t_typeof);
		addKeyword(GCCKeywords.cp__TYPEOF__, IGCCToken.t_typeof);
		addKeyword(GCCKeywords.cpTYPEOF, IGCCToken.t_typeof );
	}

Output:
	public GNUScannerExtensionConfiguration() {
		addMacro("__complex__", "_Complex");
		addMacro("__extension__", "");
		addMacro("__imag__", "(int)");
		addMacro("__real__", "(int)");
		addMacro("__stdcall", "");
		addMacro("__builtin_va_arg(ap,type)", "*(type *)ap");
		addMacro("__builtin_constant_p(exp)", "0");
		addMacro("__builtin_types_compatible_p(x,y)", "__builtin_types_compatible_p(sizeof(x),sizeof(y)");
    	addPreprocessorKeyword(Keywords.cINCLUDE_NEXT, IPreprocessorDirective.ppInclude_next);
    	addPreprocessorKeyword(Keywords.cIMPORT, IPreprocessorDirective.ppImport);
    	addPreprocessorKeyword(Keywords.cWARNING, IPreprocessorDirective.ppWarning);
    	addPreprocessorKeyword(Keywords.cIDENT, IPreprocessorDirective.ppIgnore);
    	addPreprocessorKeyword(Keywords.cSCCS, IPreprocessorDirective.ppIgnore);
    	addPreprocessorKeyword(Keywords.cASSERT, IPreprocessorDirective.ppIgnore);
    	addPreprocessorKeyword(Keywords.cUNASSERT, IPreprocessorDirective.ppIgnore);
		addKeyword(GCCKeywords.cp__ALIGNOF__, IGCCToken.t___alignof__ );
		addKeyword(GCCKeywords.cp__ALIGNOF__, IGCCToken.t___alignof__ );
		addKeyword(GCCKeywords.cp__ASM, IToken.t_asm);
		addKeyword(GCCKeywords.cp__ASM__, IToken.t_asm);
		addKeyword(GCCKeywords.cp__ATTRIBUTE, IGCCToken.t__attribute__ );
		addKeyword(GCCKeywords.cp__ATTRIBUTE__, IGCCToken.t__attribute__ );
		addKeyword(GCCKeywords.cp__CONST, IToken.t_const);
		addKeyword(GCCKeywords.cp__CONST__, IToken.t_const);
		addKeyword(GCCKeywords.cp__DECLSPEC, IGCCToken.t__declspec );
		addKeyword(GCCKeywords.cp__INLINE, IToken.t_inline);
		addKeyword(GCCKeywords.cp__INLINE__, IToken.t_inline);
		addKeyword(GCCKeywords.cp__RESTRICT, IToken.t_restrict);
		addKeyword(GCCKeywords.cp__RESTRICT__, IToken.t_restrict);
		addKeyword(GCCKeywords.cp__VOLATILE, IToken.t_volatile);
		addKeyword(GCCKeywords.cp__VOLATILE__, IToken.t_volatile);
		addKeyword(GCCKeywords.cp__SIGNED, IToken.t_signed);
		addKeyword(GCCKeywords.cp__SIGNED__, IToken.t_signed);
		addKeyword(GCCKeywords.cp__TYPEOF, IGCCToken.t_typeof);
		addKeyword(GCCKeywords.cp__TYPEOF__, IGCCToken.t_typeof);
		addKeyword(GCCKeywords.cpTYPEOF, IGCCToken.t_typeof );
	}


Input:
	public String getValueString() throws DebugException {
		if (!isAllocated()) {
			return JDIDebugModelMessages.getString("JDIValue.deallocated");
		}
		if (fValue == null) {
			return JDIDebugModelMessages.getString("JDIValue.null_4");
		}
		if (fValue instanceof StringReference) {
			try {
				return ((StringReference) fValue).value();
			} catch (RuntimeException e) {
				targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.getString("JDIValue.exception_retrieving_value"), new String[] {e.toString()}), e);
				return null;
			}
		}
		if (fValue instanceof ObjectReference) {
			StringBuffer name= new StringBuffer();
			if (fValue instanceof ClassObjectReference) {
				name.append('(');
				name.append(((ClassObjectReference)fValue).reflectedType());
				name.append(')');
			}
			name.append(" (");
			name.append(JDIDebugModelMessages.getString("JDIValue.id_8"));
			name.append('=');
			try {
				name.append(((ObjectReference)fValue).uniqueID());
			} catch (RuntimeException e) {
				targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.getString("JDIValue.exception_retrieving_unique_id"), new String[] {e.toString()}), e);
				return null;
			}
			name.append(')');
			return name.toString();
		} else {
			return fValue.toString();
		}
	}

Output:
	public String getValueString() throws DebugException {
		if (!isAllocated()) {
			return JDIDebugModelMessages.getString("JDIValue.deallocated");
		}
		if (fValue == null) {
			return JDIDebugModelMessages.getString("JDIValue.null_4");
		}
		if (fValue instanceof StringReference) {
			try {
				return ((StringReference) fValue).value();
			} catch (RuntimeException e) {
				targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.getString("JDIValue.exception_retrieving_value"), new String[] {e.toString()}), e);
				return null;
			}
		}
		if (fValue instanceof ObjectReference) {
			StringBuffer name= new StringBuffer();
			if (fValue instanceof ClassObjectReference) {
				name.append('(');
				name.append(((ClassObjectReference)fValue).reflectedType());
				name.append(')');
			}
			name.append(" (");
			name.append(JDIDebugModelMessages.getString("JDIValue.id_8"));
			name.append('=');
			try {
				name.append(((ObjectReference)fValue).uniqueID());
			} catch (RuntimeException e) {
				targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.getString("JDIValue.exception_retrieving_unique_id"), new String[] {e.toString()}), e);
				return null;
			}
			name.append(')');
			return name.toString();
		} else {
			return String.valueOf(fValue);
		}
	}