Input:
	public void onResume(){
		super.onResume();
		if(isMyself()){
			try{
				int id = bookmark.getId();
				bookmark = BookmarkManager.GetById(id, base);
				Date d = new Date(bookmark.getTime());
				mTitle.setText(Boolean.toString(bookmark.getSynced()));
				mUrl.setText(bookmark.getUrl());
				mNotes.setText(bookmark.getNotes());
				mTime.setText(d.toString());
				mUsername.setText(bookmark.getAccount());
				if(!bookmark.getShared()) {
					mIcon.setImageResource(R.drawable.padlock);
				} else if(bookmark.getToRead()) {
					mIcon.setImageResource(R.drawable.book_open);
				}
        		SpannableStringBuilder tagBuilder = new SpannableStringBuilder();
        		for(Tag t : bookmark.getTags()) {
        			addTag(tagBuilder, t, tagOnClickListener);
        		}
        		mTags.setText(tagBuilder);
        		mTags.setMovementMethod(LinkMovementMethod.getInstance());
			}
			catch(ContentNotFoundException e){}
		} else {
			Date d = new Date(bookmark.getTime());
			if(!bookmark.getDescription().equals("null"))
				mTitle.setText(bookmark.getDescription());
			mUrl.setText(bookmark.getUrl());
			if(!bookmark.getNotes().equals("null"))
					mNotes.setText(bookmark.getNotes());
			mTime.setText(d.toString());
    		SpannableStringBuilder tagBuilder = new SpannableStringBuilder();
    		for(Tag t : bookmark.getTags()) {
    			addTag(tagBuilder, t, userTagOnClickListener);
    		}
    		mTags.setText(tagBuilder);
    		mTags.setMovementMethod(LinkMovementMethod.getInstance());
			SpannableStringBuilder builder = new SpannableStringBuilder();
			int start = builder.length();
			builder.append(bookmark.getAccount());
			int end = builder.length();
			AccountSpan span = new AccountSpan(bookmark.getAccount());
			span.setOnAccountClickListener(accountOnClickListener);
			builder.setSpan(span, start, end, 0);
			mUsername.setText(builder);
			mUsername.setMovementMethod(LinkMovementMethod.getInstance());
		}
	}

Output:
	public void onResume(){
		super.onResume();
		if(isMyself()){
			try{
				int id = bookmark.getId();
				bookmark = BookmarkManager.GetById(id, base);
				Date d = new Date(bookmark.getTime());
				mTitle.setText(bookmark.getDescription());
				mUrl.setText(bookmark.getUrl());
				mNotes.setText(bookmark.getNotes());
				mTime.setText(d.toString());
				mUsername.setText(bookmark.getAccount());
				if(!bookmark.getShared()) {
					mIcon.setImageResource(R.drawable.padlock);
				} else if(bookmark.getToRead()) {
					mIcon.setImageResource(R.drawable.book_open);
				}
        		SpannableStringBuilder tagBuilder = new SpannableStringBuilder();
        		for(Tag t : bookmark.getTags()) {
        			addTag(tagBuilder, t, tagOnClickListener);
        		}
        		mTags.setText(tagBuilder);
        		mTags.setMovementMethod(LinkMovementMethod.getInstance());
			}
			catch(ContentNotFoundException e){}
		} else {
			Date d = new Date(bookmark.getTime());
			if(!bookmark.getDescription().equals("null"))
				mTitle.setText(bookmark.getDescription());
			mUrl.setText(bookmark.getUrl());
			if(!bookmark.getNotes().equals("null"))
					mNotes.setText(bookmark.getNotes());
			mTime.setText(d.toString());
    		SpannableStringBuilder tagBuilder = new SpannableStringBuilder();
    		for(Tag t : bookmark.getTags()) {
    			addTag(tagBuilder, t, userTagOnClickListener);
    		}
    		mTags.setText(tagBuilder);
    		mTags.setMovementMethod(LinkMovementMethod.getInstance());
			SpannableStringBuilder builder = new SpannableStringBuilder();
			int start = builder.length();
			builder.append(bookmark.getAccount());
			int end = builder.length();
			AccountSpan span = new AccountSpan(bookmark.getAccount());
			span.setOnAccountClickListener(accountOnClickListener);
			builder.setSpan(span, start, end, 0);
			mUsername.setText(builder);
			mUsername.setMovementMethod(LinkMovementMethod.getInstance());
		}
	}


Input:
	private void writeSampleFile(Writer sampleWriter) throws IOException
	{
		StringBuilder sb = new StringBuilder();
		sb.append("ID_1");
		sb.append(SEPARATOR);
		sb.append("ID_2");
		sb.append(SEPARATOR);
		sb.append("missing");
		List<String> colNames = new ArrayList<String>();
		List<String> dataTypes = new ArrayList<String>();
		for (SampleAnnotation annotation : genotypeData.getSampleAnnotations())
		{
			if (annotation.getSampleAnnotationType() == SampleAnnotationType.COVARIATE)
			{
				switch (annotation.getType())
				{
					case INTEGER:
						colNames.add(annotation.getId());
						dataTypes.add("D");
						break;
					case FLOAT:
						colNames.add(annotation.getId());
						dataTypes.add("C");
					default:
						LOG.warn("Unsupported covariate datatype [" + annotation.getType() + "]");
				}
			}
			else if (annotation.getSampleAnnotationType() == SampleAnnotationType.PHENOTYPE)
			{
				switch (annotation.getType())
				{
					case BOOLEAN:
						colNames.add(annotation.getId());
						dataTypes.add("B");
						break;
					case FLOAT:
						colNames.add(annotation.getId());
						dataTypes.add("P");
					default:
						LOG.warn("Unsupported phenotype datatype [" + annotation.getType() + "]");
				}
			}
			else
			{
				LOG.warn("'OTHER' sample annotation type not supported by impute2");
			}
		}
		for (String colName : colNames)
		{
			sb.append(SEPARATOR);
			sb.append(colName);
		}
		sb.append(LINE_ENDING);
		sb.append("0");
		sb.append(SEPARATOR);
		sb.append("0");
		sb.append(SEPARATOR);
		sb.append("0");
		for (String dataType : dataTypes)
		{
			sb.append(SEPARATOR);
			sb.append(dataType);
		}
		sb.append(LINE_ENDING);
		sampleWriter.write(sb.toString());
		for (Sample sample : genotypeData.getSamples())
		{
			sb = new StringBuilder();
			sb.append(sample.getFamilyId() == null ? "NA" : sample.getFamilyId());
			sb.append(SEPARATOR);
			sb.append(sample.getId() == null ? "NA" : sample.getId());
			sb.append(SEPARATOR);
			sb.append(getValue("missing", sample, "0"));
			for (String colName : colNames)
			{
				sb.append(SEPARATOR);
				sb.append(getValue(colName, sample, "NA"));
			}
			sb.append(LINE_ENDING);
			sampleWriter.write(sb.toString());
		}
	}

Output:
	private void writeSampleFile(Writer sampleWriter) throws IOException
	{
		StringBuilder sb = new StringBuilder();
		sb.append("ID_1");
		sb.append(SEPARATOR);
		sb.append("ID_2");
		sb.append(SEPARATOR);
		sb.append("missing");
		List<String> colNames = new ArrayList<String>();
		List<String> dataTypes = new ArrayList<String>();
		for (SampleAnnotation annotation : genotypeData.getSampleAnnotations())
		{
			if (annotation.getSampleAnnotationType() == SampleAnnotationType.COVARIATE)
			{
				switch (annotation.getType())
				{
					case INTEGER:
						colNames.add(annotation.getId());
						dataTypes.add("D");
						break;
					case FLOAT:
						colNames.add(annotation.getId());
						dataTypes.add("C");
						break;
					default:
						LOG.warn("Unsupported covariate datatype [" + annotation.getType() + "]");
						break;
				}
			}
			else if (annotation.getSampleAnnotationType() == SampleAnnotationType.PHENOTYPE)
			{
				switch (annotation.getType())
				{
					case BOOLEAN:
						colNames.add(annotation.getId());
						dataTypes.add("B");
						break;
					case FLOAT:
						colNames.add(annotation.getId());
						dataTypes.add("P");
					default:
						LOG.warn("Unsupported phenotype datatype [" + annotation.getType() + "]");
				}
			}
			else
			{
				LOG.warn("'OTHER' sample annotation type not supported by impute2");
			}
		}
		for (String colName : colNames)
		{
			sb.append(SEPARATOR);
			sb.append(colName);
		}
		sb.append(LINE_ENDING);
		sb.append("0");
		sb.append(SEPARATOR);
		sb.append("0");
		sb.append(SEPARATOR);
		sb.append("0");
		for (String dataType : dataTypes)
		{
			sb.append(SEPARATOR);
			sb.append(dataType);
		}
		sb.append(LINE_ENDING);
		sampleWriter.write(sb.toString());
		for (Sample sample : genotypeData.getSamples())
		{
			sb = new StringBuilder();
			sb.append(sample.getFamilyId() == null ? "NA" : sample.getFamilyId());
			sb.append(SEPARATOR);
			sb.append(sample.getId() == null ? "NA" : sample.getId());
			sb.append(SEPARATOR);
			sb.append(getValue("missing", sample, "0"));
			for (String colName : colNames)
			{
				sb.append(SEPARATOR);
				sb.append(getValue(colName, sample, "NA"));
			}
			sb.append(LINE_ENDING);
			sampleWriter.write(sb.toString());
		}
	}


Input:
  public void parse(final Builder builder) throws IOException {
    builder.startDoc(token(filename));
    final Stack<NodeIterator> stack = new Stack<NodeIterator>();
    stack.push(new NodeIterator(root));
    while(!stack.empty()) {
      final NodeIterator ni = stack.peek();
      if(ni.more()) {
        final Node n = ni.curr();
        if(n instanceof Element) {
          stack.push(new NodeIterator(n));
          final NamedNodeMap at = n.getAttributes();
          final int as = at.getLength();
          atts.reset();
          for(int a = 0; a < as; a++) {
            atts.add(token(at.item(a).getNodeName()),
                token(at.item(a).getNodeValue()));
          }
          builder.startElem(token(n.getNodeName()), atts);
        } else if(n instanceof Text) {
          builder.text(new TokenBuilder(n.getNodeValue()));
        } else if(n instanceof Comment) {
          builder.comment(new TokenBuilder(n.getNodeValue()));
        } else if(n instanceof ProcessingInstruction) {
          builder.pi(new TokenBuilder(n.getNodeName() + ' ' +
              n.getNodeValue()));
          builder.text(new TokenBuilder(n.getNodeValue()));
        }
        nodes++;
      } else {
        stack.pop();
        if(stack.empty()) break;
        builder.endElem(token(stack.peek().curr().getNodeName()));
      }
    }
    builder.endDoc();
  }

Output:
  public void parse(final Builder builder) throws IOException {
    builder.startDoc(token(filename));
    final Stack<NodeIterator> stack = new Stack<NodeIterator>();
    stack.push(new NodeIterator(root));
    while(!stack.empty()) {
      final NodeIterator ni = stack.peek();
      if(ni.more()) {
        final Node n = ni.curr();
        if(n instanceof Element) {
          stack.push(new NodeIterator(n));
          final NamedNodeMap at = n.getAttributes();
          final int as = at.getLength();
          atts.reset();
          for(int a = 0; a < as; a++) {
            final byte[] att = token(at.item(a).getNodeName());
            if (eq(att, XMLNS)) {
              builder.startNS(EMPTY, token(at.item(a).getNodeValue()));
            } else if (eq(att, XMLNSC)) {
              builder.startNS(substring(att, 6),
                  token(at.item(a).getNodeValue()));
            } else {
              atts.add(att, token(at.item(a).getNodeValue()));
            }
          }
          builder.startElem(token(n.getNodeName()), atts);
        } else if(n instanceof Text) {
          builder.text(new TokenBuilder(n.getNodeValue()));
        } else if(n instanceof Comment) {
          builder.comment(new TokenBuilder(n.getNodeValue()));
        } else if(n instanceof ProcessingInstruction) {
          builder.pi(new TokenBuilder(n.getNodeName() + ' ' +
              n.getNodeValue()));
          builder.text(new TokenBuilder(n.getNodeValue()));
        }
        nodes++;
      } else {
        stack.pop();
        if(stack.empty()) break;
        builder.endElem(token(stack.peek().curr().getNodeName()));
      }
    }
    builder.endDoc();
  }


Input:
  public void generateAndCompile() throws Exception
  {
    File componentDir = new File("src/test/resources/com/seitenbau/micgwaf/page");
    File generatedSourcesDir = new File("target/generated-sources");
    File generatedExtensionsDir = new File("target/generated-extension-sources");
    File compileRootDir = new File("target/manually-compiled-classes");
    FileUtils.deleteDirectory(generatedSourcesDir);
    FileUtils.deleteDirectory(generatedExtensionsDir);
    FileUtils.deleteDirectory(compileRootDir);
    Generator generator = new Generator();
    generator.generateComponent(
        componentDir,
        generatedSourcesDir,
        generatedExtensionsDir,
        "com.seitenbau.micgwaf.test.generated");
    compileRootDir.mkdirs();
    JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
    compiler.run(null, null, null,
        "-g",
        "-d", compileRootDir.getAbsolutePath(),
        "-sourcepath", generatedSourcesDir.getAbsolutePath() + ";" + generatedExtensionsDir.getAbsolutePath(),
        generatedExtensionsDir.getAbsolutePath() + "/com/seitenbau/micgwaf/test/generated/root/RootExtension.java");
  }

Output:
  public void generateAndCompile() throws Exception
  {
    File componentDir = new File("src/test/resources/com/seitenbau/micgwaf/page");
    File generatedSourcesDir = new File("target/generated-sources");
    File generatedExtensionsDir = new File("target/generated-extension-sources");
    File compileRootDir = new File("target/manually-compiled-classes");
    FileUtils.deleteDirectory(generatedSourcesDir);
    FileUtils.deleteDirectory(generatedExtensionsDir);
    FileUtils.deleteDirectory(compileRootDir);
    Generator generator = new Generator();
    generator.generateComponent(
        componentDir,
        generatedSourcesDir,
        generatedExtensionsDir,
        "com.seitenbau.micgwaf.test.generated");
    compileRootDir.mkdirs();
    JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
    compiler.run(null, null, null,
        "-g",
        "-d", compileRootDir.getAbsolutePath(),
        "-verbose",
        "-sourcepath", generatedSourcesDir.getAbsolutePath() + ";" + generatedExtensionsDir.getAbsolutePath(),
        generatedExtensionsDir.getAbsolutePath() + "/com/seitenbau/micgwaf/test/generated/root/RootExtension.java");
  }


Input:
    public void run() {
        Thread thisThread = Thread.currentThread();
        ExecutorService executor = Executors.newFixedThreadPool(POOL_SIZE);
        while (curThread == thisThread) {
            List<WebURL> part = collectionHandler.getNextPart(this);
            for (WebURL url : part) {
                executor.submit(new PageProcessingTask(new Page(url), collectionHandler));
            }
            try {
                executor.shutdown();
                executor.awaitTermination(20, TimeUnit.MINUTES);
            } catch (InterruptedException e) {
                stop();
                e.printStackTrace();
            }
        }
    }

Output:
    public void run() {
        Thread thisThread = Thread.currentThread();
        while (curThread == thisThread) {
            List<WebURL> part = collectionHandler.getNextPart(this);
            ExecutorService executor = Executors.newFixedThreadPool(POOL_SIZE);
            for (WebURL url : part) {
                executor.submit(new PageProcessingTask(new Page(url), collectionHandler));
            }
            try {
                executor.shutdown();
                executor.awaitTermination(20, TimeUnit.MINUTES);
            } catch (InterruptedException e) {
                stop();
                e.printStackTrace();
            }
        }
    }


Input:
    public Parser getParser(final MyInfo myInfo, final IrcAddress address) {
        final ServerInfo info = new ServerInfo(address.getServer(), address.getPort(6667),
                address.getPassword());
        info.setSSL(address.isSSL());
        if ("irc".equals(address.getProtocol())) {
            return new IRCParser(myInfo, info);
        } else if ("irc-test".equals(address.getProtocol())) {
            try {
                return (Parser) Class.forName("com.dmdirc.harness.parser.TestParser")
                        .getConstructor(MyInfo.class, ServerInfo.class)
                        .newInstance(myInfo, info);
            } catch (Exception ex) {
                Logger.userError(ErrorLevel.UNKNOWN, "Unable to create parser", ex);
            }
        }
        return null;
    }

Output:
    public Parser getParser(final MyInfo myInfo, final IrcAddress address) {
        final ServerInfo info = new ServerInfo(address.getServer(), address.getPort(6667),
                address.getPassword());
        info.setSSL(address.isSSL());
        if ("irc-test".equals(address.getProtocol())) {
            try {
                return (Parser) Class.forName("com.dmdirc.harness.parser.TestParser")
                        .getConstructor(MyInfo.class, ServerInfo.class)
                        .newInstance(myInfo, info);
            } catch (Exception ex) {
                Logger.userError(ErrorLevel.UNKNOWN, "Unable to create parser", ex);
            }
        }
        return new IRCParser(myInfo, info);
    }


Input:
    protected MultipleGradientPaintContext(MultipleGradientPaint mgp,
                                           ColorModel cm,
                                           Rectangle deviceBounds,
                                           Rectangle2D userBounds,
                                           AffineTransform t,
                                           RenderingHints hints,
                                           float[] fractions,
                                           Color[] colors,
                                           CycleMethod cycleMethod,
                                           ColorSpaceType colorSpace)
    {
        if (deviceBounds == null) {
            throw new NullPointerException("Device bounds cannot be null");
        }
        if (userBounds == null) {
            throw new NullPointerException("User bounds cannot be null");
        }
        if (t == null) {
            throw new NullPointerException("Transform cannot be null");
        }
        if (hints == null) {
            throw new NullPointerException("RenderingHints cannot be null");
        }
        AffineTransform tInv;
        try {
            tInv = t.createInverse();
        } catch (NoninvertibleTransformException e) {
            tInv = new AffineTransform();
        }
        double m[] = new double[6];
        tInv.getMatrix(m);
        a00 = (float)m[0];
        a10 = (float)m[1];
        a01 = (float)m[2];
        a11 = (float)m[3];
        a02 = (float)m[4];
        a12 = (float)m[5];
        this.cycleMethod = cycleMethod;
        this.colorSpace = colorSpace;
        this.fractions = fractions;
        int[] gradient =
            (mgp.gradient != null) ? mgp.gradient.get() : null;
        int[][] gradients =
            (mgp.gradients != null) ? mgp.gradients.get() : null;
        if (gradient == null && gradients == null) {
            calculateLookupData(colors);
            mgp.model               = this.model;
            mgp.normalizedIntervals = this.normalizedIntervals;
            mgp.isSimpleLookup      = this.isSimpleLookup;
            if (isSimpleLookup) {
                mgp.fastGradientArraySize = this.fastGradientArraySize;
                mgp.gradient = new SoftReference<int[]>(this.gradient);
            } else {
                mgp.gradients = new SoftReference<int[][]>(this.gradients);
            }
        } else {
            this.model                 = mgp.model;
            this.normalizedIntervals   = mgp.normalizedIntervals;
            this.isSimpleLookup        = mgp.isSimpleLookup;
            this.gradient              = gradient;
            this.fastGradientArraySize = mgp.fastGradientArraySize;
            this.gradients             = gradients;
        }
    }

Output:
    protected MultipleGradientPaintContext(MultipleGradientPaint mgp,
                                           ColorModel cm,
                                           Rectangle deviceBounds,
                                           Rectangle2D userBounds,
                                           AffineTransform t,
                                           RenderingHints hints,
                                           float[] fractions,
                                           Color[] colors,
                                           CycleMethod cycleMethod,
                                           ColorSpaceType colorSpace)
    {
        if (deviceBounds == null) {
            throw new NullPointerException("Device bounds cannot be null");
        }
        if (userBounds == null) {
            throw new NullPointerException("User bounds cannot be null");
        }
        if (t == null) {
            throw new NullPointerException("Transform cannot be null");
        }
        if (hints == null) {
        }
        AffineTransform tInv;
        try {
            tInv = t.createInverse();
        } catch (NoninvertibleTransformException e) {
            tInv = new AffineTransform();
        }
        double m[] = new double[6];
        tInv.getMatrix(m);
        a00 = (float)m[0];
        a10 = (float)m[1];
        a01 = (float)m[2];
        a11 = (float)m[3];
        a02 = (float)m[4];
        a12 = (float)m[5];
        this.cycleMethod = cycleMethod;
        this.colorSpace = colorSpace;
        this.fractions = fractions;
        int[] gradient =
            (mgp.gradient != null) ? mgp.gradient.get() : null;
        int[][] gradients =
            (mgp.gradients != null) ? mgp.gradients.get() : null;
        if (gradient == null && gradients == null) {
            calculateLookupData(colors);
            mgp.model               = this.model;
            mgp.normalizedIntervals = this.normalizedIntervals;
            mgp.isSimpleLookup      = this.isSimpleLookup;
            if (isSimpleLookup) {
                mgp.fastGradientArraySize = this.fastGradientArraySize;
                mgp.gradient = new SoftReference<int[]>(this.gradient);
            } else {
                mgp.gradients = new SoftReference<int[][]>(this.gradients);
            }
        } else {
            this.model                 = mgp.model;
            this.normalizedIntervals   = mgp.normalizedIntervals;
            this.isSimpleLookup        = mgp.isSimpleLookup;
            this.gradient              = gradient;
            this.fastGradientArraySize = mgp.fastGradientArraySize;
            this.gradients             = gradients;
        }
    }


Input:
	private static IResource getResourceForElement(Object element) {
		if (element instanceof DiffChangeSet) {
			IResource[] resources = ((DiffChangeSet) element).getResources();
			if (resources.length > 0) {
				return resources[0];
			}
		}
		if (element instanceof SynchronizeModelElement) {
			SynchronizeModelElement modelElement = (SynchronizeModelElement) element;
			IResource resource = modelElement.getResource();
			if (resource != null) {
				return resource;
			} else {
				IDiffElement[] elements = modelElement.getChildren();
				if (elements.length > 0) {
					if (elements[0] instanceof SynchronizeModelElement) {
						return ((SynchronizeModelElement) elements[0]).getResource();
					}
				}
			}
		}
		if (element instanceof IAdaptable) {
			IAdaptable adaptable = (IAdaptable) element;
			IResourceVariant resourceVariant = (IResourceVariant) adaptable.getAdapter(IResourceVariant.class);
			if (resourceVariant != null && resourceVariant instanceof RemoteResource) {
				RemoteResource remoteResource = (RemoteResource) resourceVariant;
				String path = remoteResource.getRepositoryRelativePath();
				for (IProject project : ResourcesPlugin.getWorkspace().getRoot().getProjects()) {
					if (project.isAccessible()) {
						ICVSResource cvsResource = CVSWorkspaceRoot.getCVSFolderFor(project);
						try {
							if (cvsResource != null && path.startsWith(cvsResource.getRepositoryRelativePath())) {
								return project;
							}
						} catch (CVSException ex) {
						}
					}
				}
			}
		}
		return null;
	}

Output:
	private static IResource getResourceForElement(Object element) {
		if (element instanceof DiffChangeSet) {
			IResource[] resources = ((DiffChangeSet) element).getResources();
			if (resources.length > 0) {
				return resources[0];
			}
		}
		if (element instanceof SynchronizeModelElement) {
			SynchronizeModelElement modelElement = (SynchronizeModelElement) element;
			IResource resource = modelElement.getResource();
			if (resource != null) {
				return resource;
			} else {
				IDiffElement[] elements = modelElement.getChildren();
				if (elements.length > 0) {
					if (elements[0] instanceof SynchronizeModelElement) {
						return ((SynchronizeModelElement) elements[0]).getResource();
					}
				}
			}
		}
		if (element instanceof IAdaptable) {
			IAdaptable adaptable = (IAdaptable) element;
			IResourceVariant resourceVariant = (IResourceVariant) adaptable.getAdapter(IResourceVariant.class);
			if (resourceVariant != null && resourceVariant instanceof RemoteResource) {
				RemoteResource remoteResource = (RemoteResource) resourceVariant;
				String path = remoteResource.getRepositoryRelativePath();
				if (path != null) {
					for (IProject project : ResourcesPlugin.getWorkspace().getRoot().getProjects()) {
						if (project.isAccessible()) {
							ICVSResource cvsResource = CVSWorkspaceRoot.getCVSFolderFor(project);
							try {
								if (cvsResource != null && path.startsWith(cvsResource.getRepositoryRelativePath())) {
									return project;
								}
							} catch (CVSException ex) {
							}
						}
					}
				}
			}
		}
		return null;
	}


Input:
    public Response loadData(int action, int startIndex, Map filteredColumns, ArrayList currentSortedColumns, ArrayList currentSortedVersusColumns, Class valueObjectType, Map otherGridParams) {
        ReportesGridFrame frame = (ReportesGridFrame) gridFrame;
        Session s = null;
        try {
            filteredColumns.put(
                    "mostarEnListado",
                    new FilterWhereClause[]{
                        new FilterWhereClause("mostarEnListado", "=", true),
                        null
                    });
            String sql = "FROM " + claseModeloFullPath + " C ";
            boolean sw = false;
            if (frame.getCategoria() != null) {
                sql += " WHERE C.categoria='" + frame.getCategoria() + "' ";
                sw = true;
            }
            if (frame.getTipo() != -1) {
                if (sw) {
                    sql += " AND ";
                } else {
                    sql += " WHERE ";
                }
                sql += " C.tipo=" + frame.getTipo() + " ";
            }
            SessionFactory sf = HibernateUtil.getSessionFactory();
            s = sf.openSession();
            Response res = HibernateUtils.getAllFromQuery(
                    filteredColumns,
                    currentSortedColumns,
                    currentSortedVersusColumns,
                    valueObjectType,
                    sql,
                    new Object[0],
                    new Type[0],
                    "C",
                    sf,
                    s);
            return res;
        } catch (Exception ex) {
            LoggerUtil.error(this.getClass(), "loadData", ex);
            return new ErrorResponse(ex.getMessage());
        } finally {
            if (s != null) {
                s.close();
            }
        }
    }

Output:
    public Response loadData(int action, int startIndex, Map filteredColumns, ArrayList currentSortedColumns, ArrayList currentSortedVersusColumns, Class valueObjectType, Map otherGridParams) {
        ReportesGridFrame frame = (ReportesGridFrame) gridFrame;
        Session s = null;
        try {
            String sql = "FROM " + claseModeloFullPath + " C ";
            boolean sw = false;
            if (frame.getCategoria() != null) {
                sql += " WHERE C.categoria='" + frame.getCategoria() + "' ";
                sw = true;
            }
            if (frame.getTipo() != -1) {
                if (sw) {
                    sql += " AND ";
                } else {
                    sql += " WHERE ";
                }
                sql += " C.tipo=" + frame.getTipo() + " ";
            }
            SessionFactory sf = HibernateUtil.getSessionFactory();
            s = sf.openSession();
            Response res = HibernateUtils.getAllFromQuery(
                    filteredColumns,
                    currentSortedColumns,
                    currentSortedVersusColumns,
                    valueObjectType,
                    sql,
                    new Object[0],
                    new Type[0],
                    "C",
                    sf,
                    s);
            return res;
        } catch (Exception ex) {
            LoggerUtil.error(this.getClass(), "loadData", ex);
            return new ErrorResponse(ex.getMessage());
        } finally {
            if (s != null) {
                s.close();
            }
        }
    }


Input:
	private Composite createForm(Composite parent, EMFDataBindingContext context, WritableValue master) {
		CTabFolder folder = new CTabFolder(parent, SWT.BOTTOM);
		CTabItem item = new CTabItem(folder, SWT.NONE);
		item.setText(Messages.ModelTooling_Common_TabDefault);
		parent = createScrollableContainer(folder);
		item.setControl(parent.getParent());
		if (getEditor().isShowXMIId() || getEditor().isLiveModel()) {
			ControlFactory.createXMIId(parent, this);
		}
		IWidgetValueProperty textProp = WidgetProperties.text(SWT.Modify);
		{
			Label l = new Label(parent, SWT.NONE);
			l.setText(Messages.CoreExpressionEditor_ExpressionId);
			l.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
			final Text t = new Text(parent, SWT.BORDER);
			TextPasteHandler.createFor(t);
			GridData gd = new GridData(GridData.FILL_HORIZONTAL);
			t.setLayoutData(gd);
			context.bindValue(textProp.observeDelayed(200, t), EMFEditProperties.value(getEditingDomain(), UiPackageImpl.Literals.CORE_EXPRESSION__CORE_EXPRESSION_ID).observeDetail(getMaster()));
			if (getEditor().getExtensionLookup() == null) {
				gd.horizontalSpan = 2;
			} else {
				Button b = new Button(parent, SWT.PUSH | SWT.FLAT);
				b.setText(Messages.ModelTooling_Common_FindEllipsis);
				b.addSelectionListener(new SelectionAdapter() {
					@Override
					public void widgetSelected(SelectionEvent e) {
						ExpressionIdDialog dialog = new ExpressionIdDialog(t.getShell(), getEditor().getExtensionLookup(), (MCoreExpression) getMaster().getValue(), getEditingDomain(), getEditor().isLiveModel(), Messages);
						dialog.open();
					}
				});
			}
		}
		item = new CTabItem(folder, SWT.NONE);
		item.setText(Messages.ModelTooling_Common_TabSupplementary);
		parent = createScrollableContainer(folder);
		item.setControl(parent.getParent());
		ControlFactory.createStringListWidget(parent, Messages, this, Messages.CategoryEditor_Tags, ApplicationPackageImpl.Literals.APPLICATION_ELEMENT__TAGS, VERTICAL_LIST_WIDGET_INDENT);
		ControlFactory.createMapProperties(parent, Messages, this, Messages.ModelTooling_Contribution_PersistedState, ApplicationPackageImpl.Literals.APPLICATION_ELEMENT__PERSISTED_STATE, VERTICAL_LIST_WIDGET_INDENT);
		folder.setSelection(0);
		return folder;
	}

Output:
	private Composite createForm(Composite parent, EMFDataBindingContext context, WritableValue master) {
		CTabFolder folder = new CTabFolder(parent, SWT.BOTTOM);
		CTabItem item = new CTabItem(folder, SWT.NONE);
		item.setText(Messages.ModelTooling_Common_TabDefault);
		parent = createScrollableContainer(folder);
		item.setControl(parent.getParent());
		if (getEditor().isShowXMIId() || getEditor().isLiveModel()) {
			ControlFactory.createXMIId(parent, this);
		}
		IWidgetValueProperty textProp = WidgetProperties.text(SWT.Modify);
		{
			Label l = new Label(parent, SWT.NONE);
			l.setText(Messages.CoreExpressionEditor_ExpressionId);
			l.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
			final Text t = new Text(parent, SWT.BORDER);
			TextPasteHandler.createFor(t);
			GridData gd = new GridData(GridData.FILL_HORIZONTAL);
			t.setLayoutData(gd);
			context.bindValue(textProp.observeDelayed(200, t), EMFEditProperties.value(getEditingDomain(), UiPackageImpl.Literals.CORE_EXPRESSION__CORE_EXPRESSION_ID).observeDetail(getMaster()));
			if (getEditor().getExtensionLookup() == null) {
				gd.horizontalSpan = 2;
			} else {
				Button b = new Button(parent, SWT.PUSH | SWT.FLAT);
				b.setText(Messages.ModelTooling_Common_FindEllipsis);
				b.setImage(createImage(ResourceProvider.IMG_Obj16_zoom));
				b.addSelectionListener(new SelectionAdapter() {
					@Override
					public void widgetSelected(SelectionEvent e) {
						ExpressionIdDialog dialog = new ExpressionIdDialog(t.getShell(), getEditor().getExtensionLookup(), (MCoreExpression) getMaster().getValue(), getEditingDomain(), getEditor().isLiveModel(), Messages);
						dialog.open();
					}
				});
			}
		}
		item = new CTabItem(folder, SWT.NONE);
		item.setText(Messages.ModelTooling_Common_TabSupplementary);
		parent = createScrollableContainer(folder);
		item.setControl(parent.getParent());
		ControlFactory.createStringListWidget(parent, Messages, this, Messages.CategoryEditor_Tags, ApplicationPackageImpl.Literals.APPLICATION_ELEMENT__TAGS, VERTICAL_LIST_WIDGET_INDENT);
		ControlFactory.createMapProperties(parent, Messages, this, Messages.ModelTooling_Contribution_PersistedState, ApplicationPackageImpl.Literals.APPLICATION_ELEMENT__PERSISTED_STATE, VERTICAL_LIST_WIDGET_INDENT);
		folder.setSelection(0);
		return folder;
	}


Input:
	public void start(BundleContext context) throws Exception {
		super.start(context);
		try {
			WebUtil.init();
			WebClientLog.setLoggingEnabled(DEBUG_HTTPCLIENT);
			initializePreferences(getPreferenceStore());
			CommonFonts.BOLD.toString();
			File dataDir = new File(getDataDirectory());
			dataDir.mkdirs();
			externalizationManager = new ExternalizationManager(getDataDirectory());
			repositoryManager = new TaskRepositoryManager();
			IExternalizationParticipant repositoryParticipant = new RepositoryExternalizationParticipant(
					externalizationManager, repositoryManager);
			externalizationManager.addParticipant(repositoryParticipant);
			taskList = new TaskList();
			repositoryModel = new RepositoryModel(taskList, repositoryManager);
			taskListExternalizer = new TaskListExternalizer(repositoryModel, repositoryManager);
			TaskListElementImporter taskListImporter = new TaskListElementImporter(repositoryManager, repositoryModel);
			taskListSaveParticipant = new TaskListExternalizationParticipant(repositoryModel, taskList,
					taskListExternalizer, externalizationManager, repositoryManager);
			externalizationManager.addParticipant(taskListSaveParticipant);
			taskList.addChangeListener(taskListSaveParticipant);
			taskActivityManager = new TaskActivityManager(repositoryManager, taskList);
			taskActivityManager.addActivationListener(taskListSaveParticipant);
			taskListManager = new TaskListManager(taskList, taskListSaveParticipant, taskListImporter);
			updateTaskActivityManager();
			proxyServiceReference = context.getServiceReference(IProxyService.class.getName());
			if (proxyServiceReference != null) {
				IProxyService proxyService = (IProxyService) context.getService(proxyServiceReference);
				if (proxyService != null) {
					proxyChangeListener = new IProxyChangeListener() {
						public void proxyInfoChanged(IProxyChangeEvent event) {
							List<TaskRepository> repos = repositoryManager.getAllRepositories();
							for (TaskRepository repo : repos) {
								if (repo.isDefaultProxyEnabled()) {
									repositoryManager.notifyRepositorySettingsChanged(repo);
								}
							}
						}
					};
					proxyService.addProxyChangeListener(proxyChangeListener);
				}
			}
			repositoryTemplateManager = new RepositoryTemplateManager();
			TasksUiExtensionReader.initStartupExtensions(taskListExternalizer, taskListImporter);
			File root = new File(this.getDataDirectory() + '/' + FOLDER_OFFLINE);
			OfflineFileStorage storage = new OfflineFileStorage(root);
			OfflineCachingStorage cachedStorage = new OfflineCachingStorage(storage);
			taskDataStorageManager = new TaskDataStorageManager(repositoryManager, cachedStorage);
			taskDataStorageManager.start();
			TaskDataStore taskDataStore = new TaskDataStore(repositoryManager);
			taskDataManager = new TaskDataManager(taskDataStorageManager, taskDataStore, repositoryManager,
					taskListManager.getTaskList(), taskActivityManager);
			taskDataManager.setDataPath(getDataDirectory());
			for (AbstractRepositoryConnector connector : repositoryManager.getRepositoryConnectors()) {
				if (connector instanceof AbstractLegacyRepositoryConnector) {
					((AbstractLegacyRepositoryConnector) connector).init(taskDataManager);
				}
			}
			taskJobFactory = new TaskJobFactory(taskListManager.getTaskList(), taskDataManager, repositoryManager,
					repositoryModel);
			taskActivityManager.addActivationListener(CONTEXT_TASK_ACTIVATION_LISTENER);
			taskActivityMonitor = new TaskActivityMonitor(taskActivityManager, ContextCorePlugin.getContextManager());
			taskActivityMonitor.start();
			saveParticipant = new ISaveParticipant() {
				public void doneSaving(ISaveContext context) {
				}
				public void prepareToSave(ISaveContext context) throws CoreException {
				}
				public void rollback(ISaveContext context) {
				}
				public void saving(ISaveContext context) throws CoreException {
					if (context.getKind() == ISaveContext.FULL_SAVE) {
						externalizationManager.stop();
						taskDataStorageManager.stop();
					}
				}
			};
			ResourcesPlugin.getWorkspace().addSaveParticipant(this, saveParticipant);
			ActivityExternalizationParticipant ACTIVITY_EXTERNALIZTAION_PARTICIPANT = new ActivityExternalizationParticipant(
					externalizationManager);
			externalizationManager.addParticipant(ACTIVITY_EXTERNALIZTAION_PARTICIPANT);
			taskActivityManager.addActivityListener(ACTIVITY_EXTERNALIZTAION_PARTICIPANT);
			taskActivityMonitor.setExternalizationParticipant(ACTIVITY_EXTERNALIZTAION_PARTICIPANT);
			loadDataSources();
			new TasksUiInitializationJob().schedule();
		} catch (Exception e) {
			StatusHandler.log(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN, "Task list initialization failed", e));
		}
	}

Output:
	public void start(BundleContext context) throws Exception {
		super.start(context);
		try {
			WebUtil.init();
			WebClientLog.setLoggingEnabled(DEBUG_HTTPCLIENT);
			initializePreferences(getPreferenceStore());
			if (CommonFonts.BOLD == null) {
			}
			File dataDir = new File(getDataDirectory());
			dataDir.mkdirs();
			externalizationManager = new ExternalizationManager(getDataDirectory());
			repositoryManager = new TaskRepositoryManager();
			IExternalizationParticipant repositoryParticipant = new RepositoryExternalizationParticipant(
					externalizationManager, repositoryManager);
			externalizationManager.addParticipant(repositoryParticipant);
			taskList = new TaskList();
			repositoryModel = new RepositoryModel(taskList, repositoryManager);
			taskListExternalizer = new TaskListExternalizer(repositoryModel, repositoryManager);
			TaskListElementImporter taskListImporter = new TaskListElementImporter(repositoryManager, repositoryModel);
			taskListSaveParticipant = new TaskListExternalizationParticipant(repositoryModel, taskList,
					taskListExternalizer, externalizationManager, repositoryManager);
			externalizationManager.addParticipant(taskListSaveParticipant);
			taskList.addChangeListener(taskListSaveParticipant);
			taskActivityManager = new TaskActivityManager(repositoryManager, taskList);
			taskActivityManager.addActivationListener(taskListSaveParticipant);
			taskListManager = new TaskListManager(taskList, taskListSaveParticipant, taskListImporter);
			updateTaskActivityManager();
			proxyServiceReference = context.getServiceReference(IProxyService.class.getName());
			if (proxyServiceReference != null) {
				IProxyService proxyService = (IProxyService) context.getService(proxyServiceReference);
				if (proxyService != null) {
					proxyChangeListener = new IProxyChangeListener() {
						public void proxyInfoChanged(IProxyChangeEvent event) {
							List<TaskRepository> repos = repositoryManager.getAllRepositories();
							for (TaskRepository repo : repos) {
								if (repo.isDefaultProxyEnabled()) {
									repositoryManager.notifyRepositorySettingsChanged(repo);
								}
							}
						}
					};
					proxyService.addProxyChangeListener(proxyChangeListener);
				}
			}
			repositoryTemplateManager = new RepositoryTemplateManager();
			TasksUiExtensionReader.initStartupExtensions(taskListExternalizer, taskListImporter);
			File root = new File(this.getDataDirectory() + '/' + FOLDER_OFFLINE);
			OfflineFileStorage storage = new OfflineFileStorage(root);
			OfflineCachingStorage cachedStorage = new OfflineCachingStorage(storage);
			taskDataStorageManager = new TaskDataStorageManager(repositoryManager, cachedStorage);
			taskDataStorageManager.start();
			TaskDataStore taskDataStore = new TaskDataStore(repositoryManager);
			taskDataManager = new TaskDataManager(taskDataStorageManager, taskDataStore, repositoryManager,
					taskListManager.getTaskList(), taskActivityManager);
			taskDataManager.setDataPath(getDataDirectory());
			for (AbstractRepositoryConnector connector : repositoryManager.getRepositoryConnectors()) {
				if (connector instanceof AbstractLegacyRepositoryConnector) {
					((AbstractLegacyRepositoryConnector) connector).init(taskDataManager);
				}
			}
			taskJobFactory = new TaskJobFactory(taskListManager.getTaskList(), taskDataManager, repositoryManager,
					repositoryModel);
			taskActivityManager.addActivationListener(CONTEXT_TASK_ACTIVATION_LISTENER);
			taskActivityMonitor = new TaskActivityMonitor(taskActivityManager, ContextCorePlugin.getContextManager());
			taskActivityMonitor.start();
			saveParticipant = new ISaveParticipant() {
				public void doneSaving(ISaveContext context) {
				}
				public void prepareToSave(ISaveContext context) throws CoreException {
				}
				public void rollback(ISaveContext context) {
				}
				public void saving(ISaveContext context) throws CoreException {
					if (context.getKind() == ISaveContext.FULL_SAVE) {
						externalizationManager.stop();
						taskDataStorageManager.stop();
					}
				}
			};
			ResourcesPlugin.getWorkspace().addSaveParticipant(this, saveParticipant);
			ActivityExternalizationParticipant ACTIVITY_EXTERNALIZTAION_PARTICIPANT = new ActivityExternalizationParticipant(
					externalizationManager);
			externalizationManager.addParticipant(ACTIVITY_EXTERNALIZTAION_PARTICIPANT);
			taskActivityManager.addActivityListener(ACTIVITY_EXTERNALIZTAION_PARTICIPANT);
			taskActivityMonitor.setExternalizationParticipant(ACTIVITY_EXTERNALIZTAION_PARTICIPANT);
			loadDataSources();
			new TasksUiInitializationJob().schedule();
		} catch (Exception e) {
			StatusHandler.log(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN, "Task list initialization failed", e));
		}
	}


Input:
    public static void main(String[] args) {
	if (args.length != 1) {
	    System.err.println("need filename argument");
	    System.exit(1);
	}
	try {
	    JEditorPane editor = new JEditorPane();
	    JavaEditorKit kit = new JavaEditorKit();
	    editor.setEditorKitForContentType("text/java", kit);
	    editor.setContentType("text/java");
	    editor.setBackground(Color.white);
	    editor.setFont(new Font("Courier", 0, 12));
	    editor.setEditable(true);
	    JavaContext styles = kit.getStylePreferences();
	    Style s;
	    s = styles.getStyleForScanValue(Token.COMMENT.getScanValue());
	    StyleConstants.setForeground(s, new Color(102, 153, 153));
	    s = styles.getStyleForScanValue(Token.STRINGVAL.getScanValue());
	    StyleConstants.setForeground(s, new Color(102, 153, 102));
	    Color keyword = new Color(102, 102, 255);
	    for (int code = 70; code <= 130; code++) {
		s = styles.getStyleForScanValue(code);
		if (s != null) {
		    StyleConstants.setForeground(s, keyword);
		}
	    }
                File file = new File(args[0]);
                editor.read(new FileReader(file), file);
                JScrollPane scroller = new JScrollPane();
                JViewport vp = scroller.getViewport();
                vp.setBackingStoreEnabled(true);
                vp.add(editor);
	    JFrame f = new JFrame("JavaEditorKit: " + args[0]);
	    f.getContentPane().setLayout(new BorderLayout());
	    f.getContentPane().add("Center", scroller);
	    f.pack();
	    f.setSize(600, 600);
	    f.setVisible(true);
	} catch (Throwable e) {
	    e.printStackTrace();
	    System.exit(1);
	}
    }

Output:
    public static void main(String[] args) {
	if (args.length != 1) {
	    System.err.println("need filename argument");
	    System.exit(1);
	}
	try {
	    JEditorPane editor = new JEditorPane();
	    JavaEditorKit kit = new JavaEditorKit();
	    editor.setEditorKitForContentType("text/java", kit);
	    editor.setContentType("text/java");
	    editor.setBackground(Color.white);
	    editor.setFont(new Font("Courier", 0, 12));
	    editor.setEditable(true);
	    JavaContext styles = kit.getStylePreferences();
	    Style s;
	    s = styles.getStyleForScanValue(Token.COMMENT.getScanValue());
	    StyleConstants.setForeground(s, new Color(102, 153, 153));
	    s = styles.getStyleForScanValue(Token.STRINGVAL.getScanValue());
	    StyleConstants.setForeground(s, new Color(102, 153, 102));
	    Color keyword = new Color(102, 102, 255);
	    for (int code = 70; code <= 130; code++) {
		s = styles.getStyleForScanValue(code);
		if (s != null) {
		    StyleConstants.setForeground(s, keyword);
		}
	    }
                File file = new File(args[0]);
                editor.read(new FileReader(file), file);
                JScrollPane scroller = new JScrollPane();
                JViewport vp = scroller.getViewport();
                vp.setBackingStoreEnabled(true);
                vp.add(editor);
	    JFrame f = new JFrame(org.openide.util.NbBundle.getMessage(JavaKitTest.class, "JavaKitTest.main(String[]).f.title", args[0]));
	    f.getContentPane().setLayout(new BorderLayout());
	    f.getContentPane().add("Center", scroller);
	    f.pack();
	    f.setSize(600, 600);
	    f.setVisible(true);
	} catch (Throwable e) {
	    e.printStackTrace();
	    System.exit(1);
	}
    }


Input:
    public void onPlayerInteract(PlayerInteractEvent event) {
        if (event.getAction() != Action.LEFT_CLICK_BLOCK && event.getAction() != Action.RIGHT_CLICK_BLOCK) {
            return;
        }
        if (event.getPlayer().getItemInHand().getType().equals(Material.BONE)) {
            if (!UtilPermissions.playerCanUseCommand(event.getPlayer(), "castaway.admin")) {
                PlayerUtils.sendError(event.getPlayer(), CastAwayCore.NAME, "You are not allowed to do this!");
                event.setCancelled(true);
                return;
            }
            event.setCancelled(true);
            event.setUseInteractedBlock(Event.Result.DENY);
            event.setUseItemInHand(Event.Result.DENY);
            Player player = event.getPlayer();
            boolean isLeftClick = (event.getAction() == Action.LEFT_CLICK_BLOCK);
            if (player.isSneaking()) {
                Dungeon dungeon = CastAwayCore.gameManager.getDungeonByName("test");
                if (dungeon != null) {
                    if (isLeftClick && event.getClickedBlock().getType().equals(Material.STONE_PLATE)) {
                        AbstractBlock actionBlock = new DungeonStartBlock(new BlockVector(event.getClickedBlock()), dungeon);
                        if (CastAwayCore.databaseManager.addActionBlock(actionBlock)) {
                            CastAwayCore.databaseManager.addActionBlock(actionBlock);
                            CastAwayCore.gameManager.addBlock(actionBlock.getVector(), actionBlock);
                            PlayerUtils.sendSuccess(event.getPlayer(), CastAwayCore.NAME, "Start block added for '" + dungeon.getDungeonName() + "'.");
                        } else {
                            PlayerUtils.sendError(event.getPlayer(), CastAwayCore.NAME, "Error creating block in database!");
                        }
                    } else if (!isLeftClick && event.getClickedBlock().getType().equals(Material.STONE_BUTTON)) {
                        AbstractBlock actionBlock = new DungeonEndBlock(new BlockVector(event.getClickedBlock()), dungeon);
                        if (CastAwayCore.databaseManager.addActionBlock(actionBlock)) {
                            CastAwayCore.gameManager.addBlock(actionBlock.getVector(), actionBlock);
                            PlayerUtils.sendSuccess(event.getPlayer(), CastAwayCore.NAME, "End block added for '" + dungeon.getDungeonName() + "'.");
                        } else {
                            PlayerUtils.sendError(event.getPlayer(), CastAwayCore.NAME, "Error creating block in database!");
                        }
                    }
                }
            } else {
                PlayerUtils.sendError(event.getPlayer(), CastAwayCore.NAME, "Dungeon 'test' not found!");
            }
        }
    }

Output:
    public void onPlayerInteract(PlayerInteractEvent event) {
        if (event.getAction() != Action.LEFT_CLICK_BLOCK && event.getAction() != Action.RIGHT_CLICK_BLOCK) {
            return;
        }
        if (event.getPlayer().getItemInHand().getType().equals(Material.BONE)) {
            if (!UtilPermissions.playerCanUseCommand(event.getPlayer(), "castaway.admin")) {
                PlayerUtils.sendError(event.getPlayer(), CastAwayCore.NAME, "You are not allowed to do this!");
                event.setCancelled(true);
                return;
            }
            event.setCancelled(true);
            event.setUseInteractedBlock(Event.Result.DENY);
            event.setUseItemInHand(Event.Result.DENY);
            Player player = event.getPlayer();
            boolean isLeftClick = (event.getAction() == Action.LEFT_CLICK_BLOCK);
            if (player.isSneaking()) {
                Dungeon dungeon = CastAwayCore.gameManager.getDungeonByName("test");
                if (dungeon != null) {
                    if (isLeftClick && event.getClickedBlock().getType().equals(Material.STONE_PLATE)) {
                        AbstractBlock actionBlock = new DungeonStartBlock(new BlockVector(event.getClickedBlock()), dungeon);
                        if (CastAwayCore.databaseManager.addActionBlock(actionBlock)) {
                            CastAwayCore.databaseManager.addActionBlock(actionBlock);
                            CastAwayCore.gameManager.addBlock(actionBlock.getVector(), actionBlock);
                            PlayerUtils.sendSuccess(event.getPlayer(), CastAwayCore.NAME, "Start block added for '" + dungeon.getDungeonName() + "'.");
                        } else {
                            PlayerUtils.sendError(event.getPlayer(), CastAwayCore.NAME, "Error creating block in database!");
                        }
                    } else if (!isLeftClick && event.getClickedBlock().getType().equals(Material.STONE_BUTTON)) {
                        AbstractBlock actionBlock = new DungeonEndBlock(new BlockVector(event.getClickedBlock()), dungeon);
                        if (CastAwayCore.databaseManager.addActionBlock(actionBlock)) {
                            CastAwayCore.gameManager.addBlock(actionBlock.getVector(), actionBlock);
                            PlayerUtils.sendSuccess(event.getPlayer(), CastAwayCore.NAME, "End block added for '" + dungeon.getDungeonName() + "'.");
                        } else {
                            PlayerUtils.sendError(event.getPlayer(), CastAwayCore.NAME, "Error creating block in database!");
                        }
                    }
                } else {
                    PlayerUtils.sendError(event.getPlayer(), CastAwayCore.NAME, "Dungeon 'test' not found!");
                }
            }
        }
    }


Input:
    public Object ac_rep_ls_$_0_99(final Args args) throws Exception
    {
        if (args.argc() > 0) {
            StringBuilder sb   = new StringBuilder();
            for (int i = 0; i < args.argc(); i++) {
                PnfsId pnfsid = new PnfsId(args.argv(i));
                sb.append(_repository.getEntry(pnfsid));
                sb.append("\n");
            }
            return sb.toString();
        }
        final DelayedReply reply = new DelayedReply();
        Thread task = new Thread() {
                void reply(Object o)
                    throws InterruptedException
                {
                    try {
                        reply.send(o);
                    } catch (NoRouteToCellException e) {
                        _log.error("Failed to send reply for 'rep ls': " + e);
                    }
                }
                public void run()
                {
                    try {
                        try {
                            reply(list());
                        } catch (CacheException e) {
                            reply(e);
                        } catch (RuntimeException e) {
                            reply(e);
                        }
                    } catch (InterruptedException e) {
                        _log.warn("Interrupted while listing: " + e);
                    }
                }
                private Object list()
                    throws CacheException, InterruptedException
                {
                    StringBuilder sb = new StringBuilder();
                    String stat = args.getOpt("s");
                    if (stat != null) {
                        long dev = 1;
                        dev = (stat.indexOf("k") > -1) ||
                            (stat.indexOf("K") > -1) ? 1024L : dev;
                        dev = (stat.indexOf("m") > -1) ||
                            (stat.indexOf("M") > -1) ? (1024L*1024L) : dev;
                        dev = (stat.indexOf("g") > -1) ||
                            (stat.indexOf("G") > -1) ? (1024L*1024L*1024L) : dev;
                        dev = (stat.indexOf("t") > -1) ||
                            (stat.indexOf("T") > -1) ? (1024L*1024L*1024L*1024L) : dev;
                        Map<String,long[]> map = new HashMap<String,long[]>();
                        long removable = 0L;
                        for (PnfsId id: _repository) {
                            try {
                                CacheEntry entry = _repository.getEntry(id);
                                StorageInfo info = entry.getStorageInfo();
                                if (info == null) continue;
                                String sc = info.getStorageClass()
                                    + "@" + info.getHsm();
                                long[] counter = map.get(sc);
                                if (counter == null)
                                    map.put(sc, counter = new long[8]);
                                boolean sticky = entry.isSticky();
                                boolean precious =
                                    (entry.getState() == EntryState.PRECIOUS);
                                long entrySize = entry.getReplicaSize();
                                counter[0] += entrySize;
                                counter[1]++;
                                if (precious) {
                                    counter[2] += entrySize;
                                    counter[3]++;
                                }
                                if (sticky) {
                                    counter[4] += entrySize;
                                    counter[5]++;
                                }
                                if (!precious && !sticky) {
                                    counter[6] += entrySize;
                                    removable  += entrySize;
                                    counter[7]++;
                                }
                            } catch (FileNotInCacheException e) {
                            }
                        }
                        if (args.getOpt("sum") != null) {
                            long[] counter = new long[10];
                            map.put("total", counter);
                            SpaceRecord record = _repository.getSpaceRecord();
                            counter[0] = record.getTotalSpace();
                            counter[1] = record.getFreeSpace();
                            counter[2] = removable;
                        }
                        Iterator<String> e2 = map.keySet().iterator();
                        if (args.getOpt("binary") != null) {
                            Object [] result = new Object[map.size()];
                            for (int i = 0; e2.hasNext(); i++) {
                                Object[] ex =  new Object[2];
                                ex[0]  = e2.next();
                                ex[1]  = map.get(ex[0]);
                                result[i] = ex;
                            }
                            return result;
                        }
                        while (e2.hasNext()) {
                            String sc = e2.next();
                            long[] counter = map.get(sc);
                            sb.append(Formats.field(sc,24,Formats.LEFT)).
                                append("  ").
                                append(Formats.field(""+counter[0]/dev,10,Formats.RIGHT)).
                                append("  ").
                                append(Formats.field(""+counter[1],8,Formats.RIGHT)).
                                append("  ").
                                append(Formats.field(""+counter[2]/dev,10,Formats.RIGHT)).
                                append("  ").
                                append(Formats.field(""+counter[3],8,Formats.RIGHT)).
                                append("  ").
                                append(Formats.field(""+counter[4]/dev,10,Formats.RIGHT)).
                                append("  ").
                                append(Formats.field(""+counter[5],8,Formats.RIGHT)).
                                append("  ").
                                append(Formats.field(""+counter[6]/dev,10,Formats.RIGHT)).
                                append("  ").
                                append(Formats.field(""+counter[7],8,Formats.RIGHT)).
                                append("\n");
                        }
                    } else  {
                        String format = args.getOpt("l");
                        format = format == null ? "" : format;
                        boolean notcached = format.indexOf("nc") > -1;
                        boolean precious  = format.indexOf('p')  > -1;
                        boolean locked    = format.indexOf('l')  > -1;
                        boolean sticky    = format.indexOf('s')  > -1;
                        boolean used      = format.indexOf('u')  > -1;
                        boolean broken    = format.indexOf('e')  > -1;
                        for (PnfsId id: _repository) {
                            try {
                                CacheEntry entry = _repository.getEntry(id);
                                EntryState state = entry.getState();
                                if (format.length() == 0 ||
                                    (notcached && state != EntryState.CACHED) ||
                                    (precious && state == EntryState.PRECIOUS) ||
                                    (sticky && entry.isSticky()) ||
                                    (broken && state == EntryState.BROKEN) ||
                                    (used && entry.getLinkCount() > 0)) {
                                    sb.append(entry).append('\n');
                                }
                            } catch (FileNotInCacheException e) {
                            }
                        }
                    }
                    return sb.toString();
                }
            };
        task.start();
        return reply;
    }

Output:
    public Object ac_rep_ls_$_0_99(final Args args) throws Exception
    {
        if (args.argc() > 0) {
            StringBuilder sb   = new StringBuilder();
            for (int i = 0; i < args.argc(); i++) {
                PnfsId pnfsid = new PnfsId(args.argv(i));
                sb.append(_repository.getEntry(pnfsid));
                sb.append("\n");
            }
            return sb.toString();
        }
        final DelayedReply reply = new DelayedReply();
        Thread task = new Thread() {
                void reply(Object o)
                    throws InterruptedException
                {
                    try {
                        reply.send(o);
                    } catch (NoRouteToCellException e) {
                        _log.error("Failed to send reply for 'rep ls': " + e);
                    }
                }
                public void run()
                {
                    try {
                        try {
                            reply(list());
                        } catch (CacheException e) {
                            reply(e);
                        } catch (RuntimeException e) {
                            reply(e);
                        }
                    } catch (InterruptedException e) {
                        _log.warn("Interrupted while listing: " + e);
                    }
                }
                private Object list()
                    throws CacheException, InterruptedException
                {
                    StringBuilder sb = new StringBuilder();
                    String stat = args.getOpt("s");
                    if (stat != null) {
                        long dev = 1;
                        dev = (stat.indexOf("k") > -1) ||
                            (stat.indexOf("K") > -1) ? 1024L : dev;
                        dev = (stat.indexOf("m") > -1) ||
                            (stat.indexOf("M") > -1) ? (1024L*1024L) : dev;
                        dev = (stat.indexOf("g") > -1) ||
                            (stat.indexOf("G") > -1) ? (1024L*1024L*1024L) : dev;
                        dev = (stat.indexOf("t") > -1) ||
                            (stat.indexOf("T") > -1) ? (1024L*1024L*1024L*1024L) : dev;
                        Map<String,long[]> map = new HashMap<String,long[]>();
                        long removable = 0L;
                        for (PnfsId id: _repository) {
                            try {
                                CacheEntry entry = _repository.getEntry(id);
                                StorageInfo info = entry.getStorageInfo();
                                if (info == null) continue;
                                String sc = info.getStorageClass()
                                    + "@" + info.getHsm();
                                long[] counter = map.get(sc);
                                if (counter == null)
                                    map.put(sc, counter = new long[8]);
                                boolean sticky = entry.isSticky();
                                boolean precious =
                                    (entry.getState() == EntryState.PRECIOUS);
                                long entrySize = entry.getReplicaSize();
                                counter[0] += entrySize;
                                counter[1]++;
                                if (precious) {
                                    counter[2] += entrySize;
                                    counter[3]++;
                                }
                                if (sticky) {
                                    counter[4] += entrySize;
                                    counter[5]++;
                                }
                                if (!precious && !sticky) {
                                    counter[6] += entrySize;
                                    removable  += entrySize;
                                    counter[7]++;
                                }
                            } catch (FileNotInCacheException e) {
                            }
                        }
                        if (args.getOpt("sum") != null) {
                            long[] counter = new long[10];
                            map.put("total", counter);
                            SpaceRecord record = _repository.getSpaceRecord();
                            counter[0] = record.getTotalSpace();
                            counter[1] = record.getFreeSpace();
                            counter[2] = removable;
                        }
                        Iterator<String> e2 = map.keySet().iterator();
                        if (args.getOpt("binary") != null) {
                            Object [] result = new Object[map.size()];
                            for (int i = 0; e2.hasNext(); i++) {
                                Object[] ex =  new Object[2];
                                ex[0]  = e2.next();
                                ex[1]  = map.get(ex[0]);
                                result[i] = ex;
                            }
                            return result;
                        }
                        while (e2.hasNext()) {
                            String sc = e2.next();
                            long[] counter = map.get(sc);
                            sb.append(Formats.field(sc,24,Formats.LEFT)).
                                append("  ").
                                append(Formats.field(""+counter[0]/dev,10,Formats.RIGHT)).
                                append("  ").
                                append(Formats.field(""+counter[1],8,Formats.RIGHT)).
                                append("  ").
                                append(Formats.field(""+counter[2]/dev,10,Formats.RIGHT)).
                                append("  ").
                                append(Formats.field(""+counter[3],8,Formats.RIGHT)).
                                append("  ").
                                append(Formats.field(""+counter[4]/dev,10,Formats.RIGHT)).
                                append("  ").
                                append(Formats.field(""+counter[5],8,Formats.RIGHT)).
                                append("  ").
                                append(Formats.field(""+counter[6]/dev,10,Formats.RIGHT)).
                                append("  ").
                                append(Formats.field(""+counter[7],8,Formats.RIGHT)).
                                append("\n");
                        }
                    } else  {
                        String format = args.getOpt("l");
                        format = format == null ? "" : format;
                        boolean notcached = format.indexOf("nc") > -1;
                        boolean precious  = format.indexOf('p')  > -1;
                        boolean locked    = format.indexOf('l')  > -1;
                        boolean sticky    = format.indexOf('s')  > -1;
                        boolean used      = format.indexOf('u')  > -1;
                        boolean broken    = format.indexOf('e')  > -1;
                        boolean cached    = format.indexOf('c')  > -1;
                        for (PnfsId id: _repository) {
                            try {
                                CacheEntry entry = _repository.getEntry(id);
                                EntryState state = entry.getState();
                                if (format.length() == 0 ||
                                    (notcached && state != EntryState.CACHED) ||
                                    (precious && state == EntryState.PRECIOUS) ||
                                    (sticky && entry.isSticky()) ||
                                    (broken && state == EntryState.BROKEN) ||
                                    (cached && state == EntryState.CACHED) ||
                                    (used && entry.getLinkCount() > 0)) {
                                    sb.append(entry).append('\n');
                                }
                            } catch (FileNotInCacheException e) {
                            }
                        }
                    }
                    return sb.toString();
                }
            };
        task.start();
        return reply;
    }


Input:
    public boolean wearingSet(final LivingEntity entity)
    {
        ItemStack his = entity.getEquipment().getHelmet();
        ItemStack cis = entity.getEquipment().getChestplate();
        ItemStack lis = entity.getEquipment().getLeggings();
        ItemStack bis = entity.getEquipment().getBoots();
        if ((his == null) || (cis == null) || (lis == null) || (bis == null))
            return false;
        Set<ItemStack> sis = new HashSet<ItemStack>();
        sis.add(cis);
        sis.add(lis);
        sis.add(bis);
        ItemMeta meta = his.getItemMeta();
        String[] ss = ChatColor.stripColor(meta.getDisplayName()).split(" ");
        String potentialSet = ss[0];
        for (ItemStack is : sis)
        {
            ItemMeta ism = is.getItemMeta();
            String[] splits = ChatColor.stripColor(ism.getDisplayName()).split(" ");
            if (!splits[0].equalsIgnoreCase(potentialSet))
                return false;
        }
        return true;
    }

Output:
    public boolean wearingSet(final LivingEntity entity)
    {
        ItemStack his = entity.getEquipment().getHelmet();
        ItemStack cis = entity.getEquipment().getChestplate();
        ItemStack lis = entity.getEquipment().getLeggings();
        ItemStack bis = entity.getEquipment().getBoots();
        if ((his == null) || (cis == null) || (lis == null) || (bis == null))
            return false;
        Set<ItemStack> sis = new HashSet<ItemStack>();
        sis.add(cis);
        sis.add(lis);
        sis.add(bis);
        ItemMeta meta = his.getItemMeta();
        String[] ss = ChatColor.stripColor(meta.getDisplayName()).split(" ");
        String potentialSet = ss[0];
        for (ItemStack is : sis)
        {
            ItemMeta ism = is.getItemMeta();
            if(ism.getDisplayName()!=null){
            	String[] splits = ChatColor.stripColor(ism.getDisplayName()).split(" ");
            	if (!splits[0].equalsIgnoreCase(potentialSet))
            		return false;
            }
        }
        return true;
    }


Input:
        public void run() {
            Vector currentInvokeItems;
            synchronized(invokeLock) {
                currentInvokeItems = invokeItems;
                invokeItems = new Vector();
            }
            int size = currentInvokeItems.size();
            for(int i=0; i<size; i++) {
                Runnable runnable = (Runnable)currentInvokeItems.elementAt(i);
                runnable.run();
            }
            synchronized(invokeLock) {
                invokeInProgress = false;
            }
        }

Output:
        public void run() {
            Vector currentInvokeItems;
            synchronized(invokeLock) {
                currentInvokeItems = invokeItems;
                invokeItems = new Vector();
                invokeInProgress = false;
            }
            int size = currentInvokeItems.size();
            for(int i=0; i<size; i++) {
                Runnable runnable = (Runnable)currentInvokeItems.elementAt(i);
                runnable.run();
            }
        }


Input:
	public static void hookActivitySettings() {
		try {
			findAndHookMethod("com.android.internal.policy.impl.PhoneWindow", null, "generateLayout",
					"com.android.internal.policy.impl.PhoneWindow.DecorView", new XC_MethodHook() {
				@SuppressLint("InlinedApi")
				protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
					Window window = (Window) param.thisObject;
					Context context = window.getContext();
					String packageName = context.getPackageName();
					if (!XposedMod.isActive(packageName))
						return;
					int fullscreen;
					try {
						fullscreen = XposedMod.prefs.getInt(packageName + Common.PREF_FULLSCREEN,
								Common.FULLSCREEN_DEFAULT);
					} catch (ClassCastException ex) {
						fullscreen = XposedMod.prefs.getBoolean(packageName + Common.PREF_FULLSCREEN, false)
								? Common.FULLSCREEN_FORCE : Common.FULLSCREEN_DEFAULT;
					}
					if (fullscreen == Common.FULLSCREEN_FORCE) {
						window.addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
						setAdditionalInstanceField(window, PROP_FULLSCREEN, Boolean.TRUE);
					} else if (fullscreen == Common.FULLSCREEN_PREVENT) {
						window.clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
						setAdditionalInstanceField(window, PROP_FULLSCREEN, Boolean.FALSE);
					} else if (fullscreen == Common.FULLSCREEN_IMMERSIVE) {
						if (Build.VERSION.SDK_INT >= 19) {
							window.addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
							setAdditionalInstanceField(window, PROP_FULLSCREEN, Boolean.TRUE);
							View decorView = window.getDecorView();
							decorView.setSystemUiVisibility(
									View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
									| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
									| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
						}
					}
					if (XposedMod.prefs.getBoolean(packageName + Common.PREF_NO_TITLE, false))
						window.requestFeature(Window.FEATURE_NO_TITLE);
					if (XposedMod.prefs.getBoolean(packageName + Common.PREF_ALLOW_ON_LOCKSCREEN, false))
		    				window.addFlags(WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD |
		    				    WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED |
		    				    WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON);
					if (XposedMod.prefs.getBoolean(packageName + Common.PREF_SCREEN_ON, false)) {
						window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
						setAdditionalInstanceField(window, PROP_KEEP_SCREEN_ON, Boolean.TRUE);
					}
					int orientation = XposedMod.prefs.getInt(packageName + Common.PREF_ORIENTATION, XposedMod.prefs.getInt(Common.PREF_DEFAULT + Common.PREF_ORIENTATION, 0));
					if (orientation > 0 && orientation < Common.orientationCodes.length && context instanceof Activity) {
						((Activity) context).setRequestedOrientation(Common.orientationCodes[orientation]);
						setAdditionalInstanceField(context, PROP_ORIENTATION, orientation);
					}
				}
			});
		} catch (Throwable e) {
			XposedBridge.log(e);
		}
		try {
			findAndHookMethod(Window.class, "setFlags", int.class, int.class,
					new XC_MethodHook() {
				@Override
				protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
					int flags = (Integer) param.args[0];
					int mask = (Integer) param.args[1];
					if ((mask & WindowManager.LayoutParams.FLAG_FULLSCREEN) != 0) {
						Boolean fullscreen = (Boolean) getAdditionalInstanceField(param.thisObject, PROP_FULLSCREEN);
						if (fullscreen != null) {
							if (fullscreen.booleanValue()) {
								flags |= WindowManager.LayoutParams.FLAG_FULLSCREEN;
							} else {
								flags &= ~WindowManager.LayoutParams.FLAG_FULLSCREEN;
							}
							param.args[0] = flags;
						}
					}
					if ((mask & WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON) != 0) {
						Boolean keepScreenOn = (Boolean) getAdditionalInstanceField(param.thisObject, PROP_KEEP_SCREEN_ON);
						if (keepScreenOn != null) {
							if (keepScreenOn.booleanValue()) {
								flags |= WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON;
							}
							param.args[0] = flags;
						}
					}
				}
			});
		} catch (Throwable e) {
			XposedBridge.log(e);
		}
		try {
			findAndHookMethod(Activity.class, "setRequestedOrientation", int.class, new XC_MethodHook() {
				@Override
				protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
					Integer orientation = (Integer) getAdditionalInstanceField(param.thisObject, PROP_ORIENTATION);
					if (orientation != null)
						param.args[0] = orientation;
				}
			});
		} catch (Throwable e) {
			XposedBridge.log(e);
		}
		try {
			Method mthRealStartActivityLocked;
			if (Build.VERSION.SDK_INT <= 18) {
				try {
					mthRealStartActivityLocked = findMethodExact("com.android.server.am.ActivityStack", null, "realStartActivityLocked",
							"com.android.server.am.ActivityRecord", "com.android.server.am.ProcessRecord",
							boolean.class, boolean.class, boolean.class);
				} catch (NoSuchMethodError t) {
					mthRealStartActivityLocked = findMethodExact("com.android.server.am.ActivityStack", null, "realStartActivityLocked",
							"com.android.server.am.ActivityRecord", "com.android.server.am.ProcessRecord",
							boolean.class, boolean.class);
				}
			} else {
				mthRealStartActivityLocked = findMethodExact("com.android.server.am.ActivityStackSupervisor", null, "realStartActivityLocked",
						"com.android.server.am.ActivityRecord", "com.android.server.am.ProcessRecord",
						boolean.class, boolean.class);
			}
			hookMethod(mthRealStartActivityLocked, new XC_MethodHook() {
	    		@Override
	    		protected void afterHookedMethod(MethodHookParam param) throws Throwable {
	    			String pkgName = (String) getObjectField(param.args[0], "packageName");
	    			if (!XposedMod.isActive(pkgName, Common.PREF_RESIDENT))
	    				return;
					int adj = -12;
					Object proc = getObjectField(param.args[0], "app");
					if (proc != null) {
						setIntField(proc, "maxAdj", adj);
						if (Build.VERSION.SDK_INT <= 18)
							setIntField(proc, "hiddenAdj", adj);
						setIntField(proc, "curRawAdj", adj);
						setIntField(proc, "setRawAdj", adj);
						setIntField(proc, "curAdj", adj);
						setIntField(proc, "setAdj", adj);
					}
	    		}
	    	});
	    } catch (Throwable e) {
	        XposedBridge.log(e);
	    }
    }

Output:
	public static void hookActivitySettings() {
		try {
			findAndHookMethod("com.android.internal.policy.impl.PhoneWindow", null, "generateLayout",
					"com.android.internal.policy.impl.PhoneWindow.DecorView", new XC_MethodHook() {
				@SuppressLint("InlinedApi")
				protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
					Window window = (Window) param.thisObject;
					Context context = window.getContext();
					String packageName = context.getPackageName();
					if (!XposedMod.isActive(packageName))
						return;
					int fullscreen;
					try {
						fullscreen = XposedMod.prefs.getInt(packageName + Common.PREF_FULLSCREEN,
								Common.FULLSCREEN_DEFAULT);
					} catch (ClassCastException ex) {
						fullscreen = XposedMod.prefs.getBoolean(packageName + Common.PREF_FULLSCREEN, false)
								? Common.FULLSCREEN_FORCE : Common.FULLSCREEN_DEFAULT;
					}
					if (fullscreen == Common.FULLSCREEN_FORCE) {
						window.addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
						setAdditionalInstanceField(window, PROP_FULLSCREEN, Boolean.TRUE);
					} else if (fullscreen == Common.FULLSCREEN_PREVENT) {
						window.clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
						setAdditionalInstanceField(window, PROP_FULLSCREEN, Boolean.FALSE);
					} else if (fullscreen == Common.FULLSCREEN_IMMERSIVE) {
						if (Build.VERSION.SDK_INT >= 19) {
							window.addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
							setAdditionalInstanceField(window, PROP_FULLSCREEN, Boolean.TRUE);
							View decorView = window.getDecorView();
							decorView.setSystemUiVisibility(
									View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
									| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
									| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
						}
					}
					if (XposedMod.prefs.getBoolean(packageName + Common.PREF_NO_TITLE, false))
						window.requestFeature(Window.FEATURE_NO_TITLE);
					if (XposedMod.prefs.getBoolean(packageName + Common.PREF_ALLOW_ON_LOCKSCREEN, false))
		    				window.addFlags(WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD |
		    				    WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED |
		    				    WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON);
					if (XposedMod.prefs.getBoolean(packageName + Common.PREF_SCREEN_ON, false)) {
						window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
						setAdditionalInstanceField(window, PROP_KEEP_SCREEN_ON, Boolean.TRUE);
					}
					int orientation = XposedMod.prefs.getInt(packageName + Common.PREF_ORIENTATION, XposedMod.prefs.getInt(Common.PREF_DEFAULT + Common.PREF_ORIENTATION, 0));
					if (orientation > 0 && orientation < Common.orientationCodes.length && context instanceof Activity) {
						((Activity) context).setRequestedOrientation(Common.orientationCodes[orientation]);
						setAdditionalInstanceField(context, PROP_ORIENTATION, orientation);
					}
				}
			});
		} catch (Throwable e) {
			XposedBridge.log(e);
		}
		try {
			findAndHookMethod(Window.class, "setFlags", int.class, int.class,
					new XC_MethodHook() {
				@Override
				protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
					int flags = (Integer) param.args[0];
					int mask = (Integer) param.args[1];
					if ((mask & WindowManager.LayoutParams.FLAG_FULLSCREEN) != 0) {
						Boolean fullscreen = (Boolean) getAdditionalInstanceField(param.thisObject, PROP_FULLSCREEN);
						if (fullscreen != null) {
							if (fullscreen.booleanValue()) {
								flags |= WindowManager.LayoutParams.FLAG_FULLSCREEN;
							} else {
								flags &= ~WindowManager.LayoutParams.FLAG_FULLSCREEN;
							}
							param.args[0] = flags;
						}
					}
					if ((mask & WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON) != 0) {
						Boolean keepScreenOn = (Boolean) getAdditionalInstanceField(param.thisObject, PROP_KEEP_SCREEN_ON);
						if (keepScreenOn != null) {
							if (keepScreenOn.booleanValue()) {
								flags |= WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON;
							}
							param.args[0] = flags;
						}
					}
				}
			});
		} catch (Throwable e) {
			XposedBridge.log(e);
		}
		try {
			findAndHookMethod(Activity.class, "setRequestedOrientation", int.class, new XC_MethodHook() {
				@Override
				protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
					Integer orientation = (Integer) getAdditionalInstanceField(param.thisObject, PROP_ORIENTATION);
					if (orientation != null)
						param.args[0] = Common.orientationCodes[orientation];
				}
			});
		} catch (Throwable e) {
			XposedBridge.log(e);
		}
		try {
			Method mthRealStartActivityLocked;
			if (Build.VERSION.SDK_INT <= 18) {
				try {
					mthRealStartActivityLocked = findMethodExact("com.android.server.am.ActivityStack", null, "realStartActivityLocked",
							"com.android.server.am.ActivityRecord", "com.android.server.am.ProcessRecord",
							boolean.class, boolean.class, boolean.class);
				} catch (NoSuchMethodError t) {
					mthRealStartActivityLocked = findMethodExact("com.android.server.am.ActivityStack", null, "realStartActivityLocked",
							"com.android.server.am.ActivityRecord", "com.android.server.am.ProcessRecord",
							boolean.class, boolean.class);
				}
			} else {
				mthRealStartActivityLocked = findMethodExact("com.android.server.am.ActivityStackSupervisor", null, "realStartActivityLocked",
						"com.android.server.am.ActivityRecord", "com.android.server.am.ProcessRecord",
						boolean.class, boolean.class);
			}
			hookMethod(mthRealStartActivityLocked, new XC_MethodHook() {
	    		@Override
	    		protected void afterHookedMethod(MethodHookParam param) throws Throwable {
	    			String pkgName = (String) getObjectField(param.args[0], "packageName");
	    			if (!XposedMod.isActive(pkgName, Common.PREF_RESIDENT))
	    				return;
					int adj = -12;
					Object proc = getObjectField(param.args[0], "app");
					if (proc != null) {
						setIntField(proc, "maxAdj", adj);
						if (Build.VERSION.SDK_INT <= 18)
							setIntField(proc, "hiddenAdj", adj);
						setIntField(proc, "curRawAdj", adj);
						setIntField(proc, "setRawAdj", adj);
						setIntField(proc, "curAdj", adj);
						setIntField(proc, "setAdj", adj);
					}
	    		}
	    	});
	    } catch (Throwable e) {
	        XposedBridge.log(e);
	    }
    }


Input:
        public void run() {
            while (mActive) {
                synchronized (this) {
                    if (!mDirty && mActive) {
                        updateLoading(false);
                        Utils.waitWithoutInterrupt(this);
                        continue;
                    }
                }
                mDirty = false;
                UpdateInfo info = executeAndWait(new GetUpdateInfo());
                updateLoading(true);
                long version = mSource.reload();
                if (info.version != version) {
                    info.reloadContent = true;
                    info.size = mSource.getMediaItemCount();
                }
                if (!info.reloadContent) continue;
                info.items = mSource.getMediaItem(
                        info.contentStart, info.contentEnd);
                int index = MediaSet.INDEX_NOT_FOUND;
                if (mFocusHintPath != null) {
                    index = findIndexOfPathInCache(info, mFocusHintPath);
                    mFocusHintPath = null;
                }
                if (index == MediaSet.INDEX_NOT_FOUND) {
                    MediaItem item = findCurrentMediaItem(info);
                    if (item != null && item.getPath() == info.target) {
                        index = info.indexHint;
                    } else {
                        index = findIndexOfTarget(info);
                    }
                }
                if (index == MediaSet.INDEX_NOT_FOUND) {
                    index = info.indexHint;
                    int focusHintDirection = mFocusHintDirection;
                    if (index == (mCameraIndex + 1)) {
                        focusHintDirection = FOCUS_HINT_NEXT;
                    }
                    if (focusHintDirection == FOCUS_HINT_PREVIOUS
                            && index > 0) {
                        index--;
                    }
                }
                if (mSize > 0) {
                    if (index >= mSize) index = mSize - 1;
                }
                info.indexHint = index;
                executeAndWait(new UpdateContent(info));
            }
        }

Output:
        public void run() {
            while (mActive) {
                synchronized (this) {
                    if (!mDirty && mActive) {
                        updateLoading(false);
                        Utils.waitWithoutInterrupt(this);
                        continue;
                    }
                }
                mDirty = false;
                UpdateInfo info = executeAndWait(new GetUpdateInfo());
                updateLoading(true);
                long version = mSource.reload();
                if (info.version != version) {
                    info.reloadContent = true;
                    info.size = mSource.getMediaItemCount();
                    int start = Utils.clamp(info.indexHint - DATA_CACHE_SIZE / 2,
                            0, Math.max(0, info.size - DATA_CACHE_SIZE));
                    info.contentStart = start;
                    info.contentEnd = Math.min(info.size, start + DATA_CACHE_SIZE);
                }
                if (!info.reloadContent) continue;
                info.items = mSource.getMediaItem(
                        info.contentStart, info.contentEnd);
                int index = MediaSet.INDEX_NOT_FOUND;
                if (mFocusHintPath != null) {
                    index = findIndexOfPathInCache(info, mFocusHintPath);
                    mFocusHintPath = null;
                }
                if (index == MediaSet.INDEX_NOT_FOUND) {
                    MediaItem item = findCurrentMediaItem(info);
                    if (item != null && item.getPath() == info.target) {
                        index = info.indexHint;
                    } else {
                        index = findIndexOfTarget(info);
                    }
                }
                if (index == MediaSet.INDEX_NOT_FOUND) {
                    index = info.indexHint;
                    int focusHintDirection = mFocusHintDirection;
                    if (index == (mCameraIndex + 1)) {
                        focusHintDirection = FOCUS_HINT_NEXT;
                    }
                    if (focusHintDirection == FOCUS_HINT_PREVIOUS
                            && index > 0) {
                        index--;
                    }
                }
                if (info.size > 0) {
                    if (index >= info.size) index = info.size - 1;
                }
                info.indexHint = index;
                executeAndWait(new UpdateContent(info));
            }
        }


Input:
    protected void performAction(final Node[] nodes) {
        final Map<RMUser, RegistryProject> map = new HashMap<RMUser, RegistryProject>();
        for (final Node node : nodes) {
            final Set<RMUser> users = node.getCookie(RMUserCookie.class).getRMUsers();
            final RegistryProject project = node.getCookie(RegistryProjectCookie.class).getProject();
            for (final RMUser user : users) {
                map.put(user, project);
            }
        }
        final String message = JOptionPane.showInputDialog(
                WindowManager.getDefault().getMainWindow(),
                NbBundle.getMessage(
                    SendMessageAction.class,
                    "SendMessageAction.performAction(Node[]).message",
                    map.size()));
        if ((message != null) && (message.trim().isEmpty())) {
            for (final Entry<RMUser, RegistryProject> entry : map.entrySet()) {
                final RegistryProject project = entry.getValue();
                final RMUser user = entry.getKey();
                try {
                    project.getMessageForwarder()
                            .sendMessage(
                                user.getQualifiedName(),
                                user.getIpAddress(),
                                message,
                                org.openide.util.NbBundle.getMessage(
                                    SendMessageAction.class,
                                    "SendMessageAction.performAction(Node[]).messageFromAdmin"));
                } catch (final RemoteException ex) {
                    LOG.error("could not send message", ex);
                } catch (final UnableToSendMessageException ex) {
                    LOG.error("could not send message", ex);
                }
            }
        }
    }

Output:
    protected void performAction(final Node[] nodes) {
        final Map<RMUser, RegistryProject> map = new HashMap<RMUser, RegistryProject>();
        for (final Node node : nodes) {
            final Set<RMUser> users = node.getCookie(RMUserCookie.class).getRMUsers();
            final RegistryProject project = node.getCookie(RegistryProjectCookie.class).getProject();
            for (final RMUser user : users) {
                map.put(user, project);
            }
        }
        final String message = JOptionPane.showInputDialog(
                WindowManager.getDefault().getMainWindow(),
                NbBundle.getMessage(
                    SendMessageAction.class,
                    "SendMessageAction.performAction(Node[]).message",
                    map.size()));
        if ((message != null) && (!message.trim().isEmpty())) {
            for (final Entry<RMUser, RegistryProject> entry : map.entrySet()) {
                final RegistryProject project = entry.getValue();
                final RMUser user = entry.getKey();
                try {
                    project.getMessageForwarder()
                            .sendMessage(
                                user.getQualifiedName(),
                                user.getIpAddress(),
                                message,
                                org.openide.util.NbBundle.getMessage(
                                    SendMessageAction.class,
                                    "SendMessageAction.performAction(Node[]).messageFromAdmin"));
                } catch (final RemoteException ex) {
                    LOG.error("could not send message", ex);
                } catch (final UnableToSendMessageException ex) {
                    LOG.error("could not send message", ex);
                }
            }
        }
    }


Input:
    public static IntervalCategoryDataset createDataset(final ProjectSchedule input) {
        final ProjectSchedule solution = GanttPanel.CLONER.cloneSolution(input);
        final TaskSeriesCollection collection = new TaskSeriesCollection();
        for (final Project p : solution.getProblem().getProjects()) {
            final TaskSeries series = new TaskSeries("P" + p.getId());
            for (final Job j : p.getJobs()) {
                if (j.isSink() || j.isSource()) {
                    continue;
                }
                final Allocation a = solution.getAllocation(j);
                if (!a.isInitialized()) {
                    continue;
                }
                series.add(new Task("J" + j.getId(), new SimpleTimePeriod(GanttPanel.date(a.getStartDate()),
                        GanttPanel.date(a.getDueDate()))));
            }
            collection.add(series);
        }
        return collection;
    }

Output:
    public static IntervalCategoryDataset createDataset(final ProjectSchedule input) {
        final ProjectSchedule solution = GanttPanel.CLONER.cloneSolution(input);
        final TaskSeriesCollection collection = new TaskSeriesCollection();
        for (final Project p : solution.getProblem().getProjects()) {
            final TaskSeries series = new TaskSeries("P" + p.getId());
            for (final Job j : p.getJobs()) {
                if (j.isSink() || j.isSource()) {
                    continue;
                }
                final Allocation a = solution.getAllocation(j);
                if (!a.isInitialized()) {
                    continue;
                }
                series.add(new Task("J" + j.getId(), new SimpleTimePeriod(GanttPanel.date(a.getStartDate()),
                        GanttPanel.date(a.getDueDate() + 1))));
            }
            collection.add(series);
        }
        return collection;
    }


Input:
    public <T> void addToCache(String k, Class<?> type, List<T> ret) {
        if (k == null) {
            return;
        }
        if (ret != null && !k.endsWith("idlist")) {
            Hashtable<Class<?>, Hashtable<ObjectId, Object>> idCacheClone = cloneIdCache();
            for (T record : ret) {
                if (idCacheClone.get(type) == null) {
                    idCacheClone.put(type, new Hashtable<ObjectId, Object>());
                }
                idCacheClone.get(type).put(annotationHelper.getId(record), record);
            }
            setIdCache(idCacheClone);
        }
        CacheElement<T> e = new CacheElement<T>(ret);
        e.setLru(System.currentTimeMillis());
        Hashtable<Class<?>, Hashtable<String, CacheElement>> cl = (Hashtable<Class<?>, Hashtable<String, CacheElement>>) cache.clone();
        if (cl.get(type) == null) {
            cl.put(type, new Hashtable<String, CacheElement>());
        }
        cl.get(type).put(k, e);
        cache = cl;
    }

Output:
    public <T> void addToCache(String k, Class<?> type, List<T> ret) {
        if (k == null) {
            return;
        }
        if (!k.endsWith("idlist")) {
            Hashtable<Class<?>, Hashtable<ObjectId, Object>> idCacheClone = cloneIdCache();
            for (T record : ret) {
                if (idCacheClone.get(type) == null) {
                    idCacheClone.put(type, new Hashtable<ObjectId, Object>());
                }
                idCacheClone.get(type).put(annotationHelper.getId(record), record);
            }
            setIdCache(idCacheClone);
        }
        CacheElement<T> e = new CacheElement<T>(ret);
        e.setLru(System.currentTimeMillis());
        Hashtable<Class<?>, Hashtable<String, CacheElement>> cl = (Hashtable<Class<?>, Hashtable<String, CacheElement>>) cache.clone();
        if (cl.get(type) == null) {
            cl.put(type, new Hashtable<String, CacheElement>());
        }
        cl.get(type).put(k, e);
        cache = cl;
    }


Input:
    void run() {
        printer.print(WELCOME);
        Question question = new Question(test1);
        question.addAnswer(ANSWER1A, 3);
        question.addAnswer(ANSWER1B, 5);
        question.addAnswer(ANSWER1C, 10);
        printer.print(question.toString());
        String answer = reado.get();
        int response = question.score(answer);
        printer.print("You got a " + response + "out of 10!");
    }

Output:
    void run() {
        printer.print(WELCOME);
        Question question = new Question(test1);
        question.addAnswer(ANSWER1A, 3);
        question.addAnswer(ANSWER1B, 5);
        question.addAnswer(ANSWER1C, 10);
        printer.print(question.toString());
        String answer = reado.get();
        int response = question.score(answer);
        printer.print("You got a " + response + " out of 10!");
    }


Input:
    public void startRelation(long statusId)
    {
        TweetModel start = TweetUtils.getOrCreateStatusModel(statusId);
        if (start == null)
        {
            Notificator.alert("ツイートの取得に失敗しました");
            return;
        }
        talkList.addToTop(start);
        long inReplyTo = start.getInReplyToStatusId();
        while (inReplyTo > 0)
        {
            TweetModel older = TweetUtils.getOrCreateStatusModel(inReplyTo);
            talkList.addToBottom(older);
            inReplyTo = older.getInReplyToStatusId();
        }
        inReplyTo = start.statusId;
        while (true)
        {
            long before = inReplyTo;
            for (TweetModel newer : TweetCache.getList())
            {
                if (newer.getInReplyToStatusId() == inReplyTo)
                {
                    talkList.addToTop(newer);
                    inReplyTo = newer.statusId;
                    break;
                }
            }
            if (before == inReplyTo)
            {
                break;
            }
        }
        updateChasingId(((TweetModel) talkList.getStatus(0)).statusId);
        StatusListManager.getAdapter(talkList).forceNotifyAdapter();
    }

Output:
    public void startRelation(long statusId)
    {
        TweetModel start = TweetUtils.getOrCreateStatusModel(statusId);
        if (start == null)
        {
            Notificator.alert("ツイートの取得に失敗しました");
            return;
        }
        talkList.addToTop(start);
        long inReplyTo = start.getInReplyToStatusId();
        while (inReplyTo > 0)
        {
            TweetModel older = TweetUtils.getOrCreateStatusModel(inReplyTo);
            if (older == null)
            {
                Notificator.alert("ツイートの取得に失敗しました");
                break;
            }
            talkList.addToBottom(older);
            inReplyTo = older.getInReplyToStatusId();
        }
        inReplyTo = start.statusId;
        while (true)
        {
            long before = inReplyTo;
            for (TweetModel newer : TweetCache.getList())
            {
                if (newer.getInReplyToStatusId() == inReplyTo)
                {
                    talkList.addToTop(newer);
                    inReplyTo = newer.statusId;
                    break;
                }
            }
            if (before == inReplyTo)
            {
                break;
            }
        }
        updateChasingId(((TweetModel) talkList.getStatus(0)).statusId);
        StatusListManager.getAdapter(talkList).forceNotifyAdapter();
    }