Input:
    public void processEndOfRound() {
        InternalObject[] gameObjects = new InternalObject[gameObjectsByID.size()];
        gameObjects = gameObjectsByID.values().toArray(gameObjects);
        for (int i = 0; i < gameObjects.length; i++) {
            gameObjects[i].processEndOfRound();
        }
		if(timeLimitReached()&&winner==null) {
			List<InternalPowerNode> teamANodes = new ArrayList<InternalPowerNode>(connectedNodesByTeam.get(Team.A));
			List<InternalPowerNode> teamBNodes = new ArrayList<InternalPowerNode>(connectedNodesByTeam.get(Team.B));
			InternalRobot tower;
			for(InternalPowerNode n : teamANodes) {
				tower = nodeToTower(n);
				if(tower!=null)
					tower.takeDamage(GameConstants.TIME_LIMIT_DAMAGE/teamANodes.size());
			}
			for(InternalPowerNode n : teamBNodes) {
				tower = nodeToTower(n);
				if(tower!=null)
					tower.takeDamage(GameConstants.TIME_LIMIT_DAMAGE/teamBNodes.size());
			}
			removeDead();
			if(nodeToTower(baseNodes.get(Team.A))==null&&nodeToTower(baseNodes.get(Team.B))==null) {
				running=false;
				int diff=0;
				for(InternalPowerNode p : powerNodes) {
					if(p.getControllingTeam()==Team.A)
						diff++;
					else if(p.getControllingTeam()==Team.B)
						diff--;
				}
				if(!(setWinnerIfNonzero(diff,DominationFactor.BARELY_BEAT)||
					setWinnerIfNonzero(archons.get(Team.A).size()-archons.get(Team.B).size(),DominationFactor.BARELY_BEAT)||
					setWinnerIfNonzero(getEnergonDifference(),DominationFactor.BARELY_BEAT)))
				{
					if(teamAName.compareTo(teamBName)<=0)
						setWinner(Team.A,DominationFactor.WON_BY_DUBIOUS_REASONS);
					else
						setWinner(Team.B,DominationFactor.WON_BY_DUBIOUS_REASONS);
				}
			}
		}
        long aPoints = Math.round(teamRoundResources[Team.A.ordinal()] * 100), bPoints = Math.round(teamRoundResources[Team.B.ordinal()] * 100);
        roundStats = new RoundStats(teamResources[0] * 100, teamResources[1] * 100, teamRoundResources[0] * 100, teamRoundResources[1] * 100);
        lastRoundResources = teamRoundResources;
        teamRoundResources = new double[2];
    }

Output:
    public void processEndOfRound() {
        InternalObject[] gameObjects = new InternalObject[gameObjectsByID.size()];
        gameObjects = gameObjectsByID.values().toArray(gameObjects);
        for (int i = 0; i < gameObjects.length; i++) {
            gameObjects[i].processEndOfRound();
        }
		removeDead();
		if(timeLimitReached()&&winner==null) {
			List<InternalPowerNode> teamANodes = new ArrayList<InternalPowerNode>(connectedNodesByTeam.get(Team.A));
			List<InternalPowerNode> teamBNodes = new ArrayList<InternalPowerNode>(connectedNodesByTeam.get(Team.B));
			InternalRobot tower;
			for(InternalPowerNode n : teamANodes) {
				tower = nodeToTower(n);
				if(tower!=null)
					tower.takeDamage(GameConstants.TIME_LIMIT_DAMAGE/teamANodes.size());
			}
			for(InternalPowerNode n : teamBNodes) {
				tower = nodeToTower(n);
				if(tower!=null)
					tower.takeDamage(GameConstants.TIME_LIMIT_DAMAGE/teamBNodes.size());
			}
			removeDead();
			if(nodeToTower(baseNodes.get(Team.A))==null&&nodeToTower(baseNodes.get(Team.B))==null) {
				running=false;
				int diff=0;
				for(InternalPowerNode p : powerNodes) {
					if(p.getControllingTeam()==Team.A)
						diff++;
					else if(p.getControllingTeam()==Team.B)
						diff--;
				}
				if(!(setWinnerIfNonzero(diff,DominationFactor.BARELY_BEAT)||
					setWinnerIfNonzero(archons.get(Team.A).size()-archons.get(Team.B).size(),DominationFactor.BARELY_BEAT)||
					setWinnerIfNonzero(getEnergonDifference(),DominationFactor.BARELY_BEAT)))
				{
					if(teamAName.compareTo(teamBName)<=0)
						setWinner(Team.A,DominationFactor.WON_BY_DUBIOUS_REASONS);
					else
						setWinner(Team.B,DominationFactor.WON_BY_DUBIOUS_REASONS);
				}
			}
		}
        long aPoints = Math.round(teamRoundResources[Team.A.ordinal()] * 100), bPoints = Math.round(teamRoundResources[Team.B.ordinal()] * 100);
        roundStats = new RoundStats(teamResources[0] * 100, teamResources[1] * 100, teamRoundResources[0] * 100, teamRoundResources[1] * 100);
        lastRoundResources = teamRoundResources;
        teamRoundResources = new double[2];
    }


Input:
    private void describeKeySpace(String keySpaceName, KsDef metadata) throws TException
    {
        NodeProbe probe = sessionState.getNodeProbe();
        CompactionManagerMBean compactionManagerMBean = (probe == null) ? null : probe.getCompactionManagerProxy();
        sessionState.out.println("Keyspace: " + keySpaceName + ":");
        try
        {
            KsDef ks_def;
            ks_def = metadata == null ? thriftClient.describe_keyspace(keySpaceName) : metadata;
            sessionState.out.println("  Replication Strategy: " + ks_def.strategy_class);
            if (ks_def.strategy_class.endsWith(".NetworkTopologyStrategy"))
            {
                Map<String, String> options = ks_def.strategy_options;
                sessionState.out.println("    Options: [" + ((options == null) ? "" : FBUtilities.toString(options)) + "]");
            }
            else
            {
                sessionState.out.println("    Replication Factor: " + ks_def.replication_factor);
            }
            sessionState.out.println("  Column Families:");
            boolean isSuper;
            Collections.sort(ks_def.cf_defs, new CfDefNamesComparator());
            for (CfDef cf_def : ks_def.cf_defs)
            {
                ColumnFamilyStoreMBean cfMBean = (probe == null) ? null : probe.getCfsProxy(ks_def.getName(), cf_def.getName());
                isSuper = cf_def.column_type.equals("Super");
                sessionState.out.printf("    ColumnFamily: %s%s%n", cf_def.name, isSuper ? " (Super)" : "");
                if (cf_def.comment != null && !cf_def.comment.isEmpty())
                {
                    sessionState.out.printf("    \"%s\"%n", cf_def.comment);
                }
                if (cf_def.default_validation_class != null)
                    sessionState.out.printf("      default_validation_class: %s%n", cf_def.default_validation_class);
                sessionState.out.printf("      Columns sorted by: %s%s%n", cf_def.comparator_type, cf_def.column_type.equals("Super") ? "/" + cf_def.subcomparator_type : "");
                sessionState.out.printf("      Row cache size / save period in seconds: %s/%s%n", cf_def.row_cache_size, cf_def.row_cache_save_period_in_seconds);
                sessionState.out.printf("      Key cache size / save period in seconds: %s/%s%n", cf_def.key_cache_size, cf_def.key_cache_save_period_in_seconds);
                sessionState.out.printf("      Memtable thresholds: %s/%s/%s (millions of ops/minutes/MB)%n",
                                cf_def.memtable_operations_in_millions, cf_def.memtable_throughput_in_mb, cf_def.memtable_flush_after_mins);
                sessionState.out.printf("      GC grace seconds: %s%n", cf_def.gc_grace_seconds);
                sessionState.out.printf("      Compaction min/max thresholds: %s/%s%n", cf_def.min_compaction_threshold, cf_def.max_compaction_threshold);
                sessionState.out.printf("      Read repair chance: %s%n", cf_def.read_repair_chance);
                if (cfMBean != null)
                {
                    sessionState.out.printf("      Built indexes: %s%n", cfMBean.getBuiltIndexes());
                }
                if (cf_def.getColumn_metadataSize() != 0)
                {
                    String leftSpace = "      ";
                    String columnLeftSpace = leftSpace + "    ";
                    AbstractType columnNameValidator = getFormatTypeForColumn(isSuper ? cf_def.subcomparator_type
                                                                                : cf_def.comparator_type);
                    sessionState.out.println(leftSpace + "Column Metadata:");
                    for (ColumnDef columnDef : cf_def.getColumn_metadata())
                    {
                        String columnName = columnNameValidator.getString(columnDef.name);
                        if (columnNameValidator instanceof BytesType)
                        {
                            try
                            {
                                String columnString = UTF8Type.instance.getString(columnDef.name);
                                columnName = columnString + " (" + columnName + ")";
                            }
                            catch (MarshalException e)
                            {
                            }
                        }
                        sessionState.out.println(leftSpace + "  Column Name: " + columnName);
                        sessionState.out.println(columnLeftSpace + "Validation Class: " + columnDef.getValidation_class());
                        if (columnDef.isSetIndex_name())
                        {
                            sessionState.out.println(columnLeftSpace + "Index Name: " + columnDef.getIndex_name());
                        }
                        if (columnDef.isSetIndex_type())
                        {
                            sessionState.out.println(columnLeftSpace + "Index Type: " + columnDef.getIndex_type().name());
                        }
                    }
                }
            }
            if (compactionManagerMBean != null)
            {
                String compactionType = compactionManagerMBean.getCompactionType();
                if (compactionType != null && compactionType.contains("index build"))
                {
                    String indexName         = compactionManagerMBean.getColumnFamilyInProgress();
                    long bytesCompacted      = compactionManagerMBean.getBytesCompacted();
                    long totalBytesToProcess = compactionManagerMBean.getBytesTotalInProgress();
                    sessionState.out.printf("%nCurrently building index %s, completed %d of %d bytes.%n", indexName, bytesCompacted, totalBytesToProcess);
                }
            }
            if (probe != null)
                probe.close();
        }
        catch (InvalidRequestException e)
        {
            sessionState.out.println("Invalid request: " + e);
        }
        catch (NotFoundException e)
        {
            sessionState.out.println("Keyspace " + keySpaceName + " could not be found.");
        }
        catch (IOException e)
        {
            sessionState.out.println("Error while closing JMX connection: " + e.getMessage());
        }
    }

Output:
    private void describeKeySpace(String keySpaceName, KsDef metadata) throws TException
    {
        NodeProbe probe = sessionState.getNodeProbe();
        CompactionManagerMBean compactionManagerMBean = (probe == null) ? null : probe.getCompactionManagerProxy();
        sessionState.out.println("Keyspace: " + keySpaceName + ":");
        try
        {
            KsDef ks_def;
            ks_def = metadata == null ? thriftClient.describe_keyspace(keySpaceName) : metadata;
            sessionState.out.println("  Replication Strategy: " + ks_def.strategy_class);
            if (ks_def.strategy_class.endsWith(".NetworkTopologyStrategy"))
            {
                Map<String, String> options = ks_def.strategy_options;
                sessionState.out.println("    Options: [" + ((options == null) ? "" : FBUtilities.toString(options)) + "]");
            }
            else
            {
                sessionState.out.println("    Replication Factor: " + ks_def.replication_factor);
            }
            sessionState.out.println("  Column Families:");
            boolean isSuper;
            Collections.sort(ks_def.cf_defs, new CfDefNamesComparator());
            for (CfDef cf_def : ks_def.cf_defs)
            {
                ColumnFamilyStoreMBean cfMBean = (probe == null) ? null : probe.getCfsProxy(ks_def.getName(), cf_def.getName());
                isSuper = cf_def.column_type.equals("Super");
                sessionState.out.printf("    ColumnFamily: %s%s%n", cf_def.name, isSuper ? " (Super)" : "");
                if (cf_def.comment != null && !cf_def.comment.isEmpty())
                {
                    sessionState.out.printf("    \"%s\"%n", cf_def.comment);
                }
                if (cf_def.default_validation_class != null)
                    sessionState.out.printf("      default_validation_class: %s%n", cf_def.default_validation_class);
                sessionState.out.printf("      Columns sorted by: %s%s%n", cf_def.comparator_type, cf_def.column_type.equals("Super") ? "/" + cf_def.subcomparator_type : "");
                sessionState.out.printf("      Row cache size / save period in seconds: %s/%s%n", cf_def.row_cache_size, cf_def.row_cache_save_period_in_seconds);
                sessionState.out.printf("      Key cache size / save period in seconds: %s/%s%n", cf_def.key_cache_size, cf_def.key_cache_save_period_in_seconds);
                sessionState.out.printf("      Memtable thresholds: %s/%s/%s (millions of ops/minutes/MB)%n",
                                cf_def.memtable_operations_in_millions, cf_def.memtable_flush_after_mins, cf_def.memtable_throughput_in_mb);
                sessionState.out.printf("      GC grace seconds: %s%n", cf_def.gc_grace_seconds);
                sessionState.out.printf("      Compaction min/max thresholds: %s/%s%n", cf_def.min_compaction_threshold, cf_def.max_compaction_threshold);
                sessionState.out.printf("      Read repair chance: %s%n", cf_def.read_repair_chance);
                if (cfMBean != null)
                {
                    sessionState.out.printf("      Built indexes: %s%n", cfMBean.getBuiltIndexes());
                }
                if (cf_def.getColumn_metadataSize() != 0)
                {
                    String leftSpace = "      ";
                    String columnLeftSpace = leftSpace + "    ";
                    AbstractType columnNameValidator = getFormatTypeForColumn(isSuper ? cf_def.subcomparator_type
                                                                                : cf_def.comparator_type);
                    sessionState.out.println(leftSpace + "Column Metadata:");
                    for (ColumnDef columnDef : cf_def.getColumn_metadata())
                    {
                        String columnName = columnNameValidator.getString(columnDef.name);
                        if (columnNameValidator instanceof BytesType)
                        {
                            try
                            {
                                String columnString = UTF8Type.instance.getString(columnDef.name);
                                columnName = columnString + " (" + columnName + ")";
                            }
                            catch (MarshalException e)
                            {
                            }
                        }
                        sessionState.out.println(leftSpace + "  Column Name: " + columnName);
                        sessionState.out.println(columnLeftSpace + "Validation Class: " + columnDef.getValidation_class());
                        if (columnDef.isSetIndex_name())
                        {
                            sessionState.out.println(columnLeftSpace + "Index Name: " + columnDef.getIndex_name());
                        }
                        if (columnDef.isSetIndex_type())
                        {
                            sessionState.out.println(columnLeftSpace + "Index Type: " + columnDef.getIndex_type().name());
                        }
                    }
                }
            }
            if (compactionManagerMBean != null)
            {
                String compactionType = compactionManagerMBean.getCompactionType();
                if (compactionType != null && compactionType.contains("index build"))
                {
                    String indexName         = compactionManagerMBean.getColumnFamilyInProgress();
                    long bytesCompacted      = compactionManagerMBean.getBytesCompacted();
                    long totalBytesToProcess = compactionManagerMBean.getBytesTotalInProgress();
                    sessionState.out.printf("%nCurrently building index %s, completed %d of %d bytes.%n", indexName, bytesCompacted, totalBytesToProcess);
                }
            }
            if (probe != null)
                probe.close();
        }
        catch (InvalidRequestException e)
        {
            sessionState.out.println("Invalid request: " + e);
        }
        catch (NotFoundException e)
        {
            sessionState.out.println("Keyspace " + keySpaceName + " could not be found.");
        }
        catch (IOException e)
        {
            sessionState.out.println("Error while closing JMX connection: " + e.getMessage());
        }
    }


Input:
  public void scan(Collection<InputFile> files) {
    SourceProject project = new SourceProject("Java Project");
    index.index(project);
    project.setSourceCodeIndexer(index);
    VisitorContext context = new VisitorContext(project);
    context.setCommentAnalyser(commentAnalyser);
    for (SquidAstVisitor<LexerlessGrammar> visitor : visitors) {
      visitor.setContext(context);
      visitor.init();
    }
    AstWalker astWalker = new AstWalker(visitors);
    ProgressReport progressReport = new ProgressReport("Report about progress of Java AST analyzer", TimeUnit.SECONDS.toMillis(10));
    progressReport.start(files.size() + " source files to be analyzed");
    int count = 0;
    for (InputFile inputFile : files) {
      File file = inputFile.getFile();
      progressReport.message(count + "/" + files.size() + " files analyzed, current is " + file.getAbsolutePath());
      count++;
      context.setFile(file);
      context.setInputFile(inputFile);
      try {
        AstNode ast = parser.parse(file);
        astWalker.walkAndVisit(ast);
      } catch (RecognitionException e) {
        LOG.error("Unable to parse source file : " + file.getAbsolutePath());
        LOG.error(e.getMessage(), e);
        parseErrorWalkAndVisit(e, file);
      } catch (Exception e) {
        throw new AnalysisException(getAnalyisExceptionMessage(file), e);
      }
    }
    progressReport.stop(files.size() + "/" + files.size() + " source files analyzed");
    for (SquidAstVisitor<LexerlessGrammar> visitor : visitors) {
      visitor.destroy();
    }
    SourceCodeTreeDecorator decorator = new SourceCodeTreeDecorator(project);
    decorator.decorateWith(JavaMetric.values());
    decorator.decorateWith(org.sonar.squid.measures.Metric.values());
  }

Output:
  public void scan(Collection<InputFile> files) {
    SourceProject project = new SourceProject("Java Project");
    index.index(project);
    project.setSourceCodeIndexer(index);
    VisitorContext context = new VisitorContext(project);
    context.setCommentAnalyser(commentAnalyser);
    for (SquidAstVisitor<LexerlessGrammar> visitor : visitors) {
      visitor.setContext(context);
      visitor.init();
    }
    AstWalker astWalker = new AstWalker(visitors);
    ProgressReport progressReport = new ProgressReport("Report about progress of Java AST analyzer", TimeUnit.SECONDS.toMillis(10));
    progressReport.start(files.size() + " source files to be analyzed");
    int count = 0;
    for (InputFile inputFile : files) {
      File file = inputFile.getFile();
      progressReport.message(count + "/" + files.size() + " files analyzed, current is " + file.getAbsolutePath());
      count++;
      context.setFile(file);
      context.setInputFile(inputFile);
      try {
        AstNode ast = parser.parse(file);
        astWalker.walkAndVisit(ast);
      } catch (RecognitionException e) {
        LOG.error("Unable to parse source file : " + file.getAbsolutePath());
        LOG.error(e.getMessage());
        parseErrorWalkAndVisit(e, file);
      } catch (Exception e) {
        throw new AnalysisException(getAnalyisExceptionMessage(file), e);
      }
    }
    progressReport.stop(files.size() + "/" + files.size() + " source files analyzed");
    for (SquidAstVisitor<LexerlessGrammar> visitor : visitors) {
      visitor.destroy();
    }
    SourceCodeTreeDecorator decorator = new SourceCodeTreeDecorator(project);
    decorator.decorateWith(JavaMetric.values());
    decorator.decorateWith(org.sonar.squid.measures.Metric.values());
  }


Input:
    public ScopeMetadata resolveScopeMetadata(BeanDefinition beanDefinition) {
        ScopeMetadata meta = new ScopeMetadata();
        meta.setScopedProxyMode(ScopedProxyMode.INTERFACES);
        meta.setScopeName("prototype");
        return meta;
    }

Output:
    public ScopeMetadata resolveScopeMetadata(BeanDefinition beanDefinition) {
        ScopeMetadata meta = new ScopeMetadata();
        meta.setScopedProxyMode(ScopedProxyMode.NO);
        meta.setScopeName("prototype");
        return meta;
    }


Input:
    public void eventFired(EventObject event) {
		if (event instanceof ChangeEvent) {
			final ChangeEvent changeEvent = (ChangeEvent)event;
			final Object source = changeEvent.getSource();
			if (source instanceof IModel) {
				IPeerModel node = (IPeerModel)((IModel)source).getAdapter(IPeerModel.class);
				refresh(node, false);
			}
			else if (source instanceof IModelNode) {
				if ("expanded".equals(changeEvent.getEventId())) {
					boolean expanded = ((Boolean)changeEvent.getNewValue()).booleanValue();
					getViewer().setExpandedState(source, expanded);
				} else {
					refresh(source, false);
				}
			}
		}
	}

Output:
    public void eventFired(EventObject event) {
		if (event instanceof ChangeEvent) {
			final ChangeEvent changeEvent = (ChangeEvent)event;
			final Object source = changeEvent.getSource();
			if (source instanceof IModel) {
				IPeerModel node = (IPeerModel)((IModel)source).getAdapter(IPeerModel.class);
				refresh(node, false);
			}
			else if (source instanceof IModelNode) {
				if ("expanded".equals(changeEvent.getEventId())) {
					boolean expanded = ((Boolean)changeEvent.getNewValue()).booleanValue();
					if (getViewer() != null) getViewer().setExpandedState(source, expanded);
				} else {
					refresh(source, false);
				}
			}
		}
	}


Input:
    public void load(final PluginInfo pluginInfo, final ObjectGraph graph) {
        super.load(pluginInfo, graph);
        setObjectGraph(graph.plus(new LoggingModule(pluginInfo.getDomain())));
        manager = getObjectGraph().get(LoggingManager.class);
        registerCommand(LoggingCommand.class, LoggingCommand.INFO);
    }

Output:
    public void load(final PluginInfo pluginInfo, final ObjectGraph graph) {
        super.load(pluginInfo, graph);
        setObjectGraph(graph.plus(new LoggingModule(pluginInfo)));
        manager = getObjectGraph().get(LoggingManager.class);
        registerCommand(LoggingCommand.class, LoggingCommand.INFO);
    }


Input:
    public void testWaitAndSignal() throws InterruptedException {
        WaitingThread thread = new WaitingThread(_semaphore, 0);
        thread.start();
        Thread.sleep(1);
        assertFalse("The thread should be waiting.", thread.hasFinished());
        _semaphore.signalEvent();
        Thread.sleep(1);
        assertTrue("The thread should have finished.", thread.hasFinished());
    }

Output:
    public void testWaitAndSignal() throws InterruptedException {
        WaitingThread thread = new WaitingThread(_semaphore, 0);
        thread.start();
        Thread.sleep(2);
        assertFalse("The thread should be waiting.", thread.hasFinished());
        _semaphore.signalEvent();
        Thread.sleep(2);
        assertTrue("The thread should have finished.", thread.hasFinished());
    }


Input:
    public ParameterWindow( TableViewer tv ) {
        super( "Table Parameters", tv );
        this.tv = tv;
        this.dataModel = tv.getDataModel();
        this.viewModel = tv.getViewModel();
        this.columnModel = tv.getColumnModel();
        params = new ArrayList();
        pseudoParams = new HashSet();
        uneditableParams = new HashSet();
        DescribedValue nameParam = new DescribedValue( NAME_INFO ) {
            public Object getValue() {
                return dataModel.getName();
            }
            public void setValue( Object value ) {
                String name = value == null ? null : value.toString();
                if ( name.trim().length() == 0 ) {
                    name = null;
                }
                dataModel.setName( name );
            }
        };
        params.add( nameParam );
        pseudoParams.add( nameParam );
        URL url = dataModel.getBaseTable().getURL();
        if ( url != null ) {
            DescribedValue urlParam = new DescribedValue( URL_INFO, url );
            params.add( urlParam );
            pseudoParams.add( urlParam );
            uneditableParams.add( urlParam );
        }
        ncolParam = new DescribedValue( NCOL_INFO );
        nrowParam = new DescribedValue( NROW_INFO );
        params.add( ncolParam );
        params.add( nrowParam );
        pseudoParams.add( ncolParam );
        pseudoParams.add( nrowParam );
        uneditableParams.add( ncolParam );
        uneditableParams.add( nrowParam );
        columnModel.addColumnModelListener( new TableColumnModelAdapter() {
            public void columnAdded( TableColumnModelEvent evt ) {
                configureColumnCount();
            }
            public void columnRemoved( TableColumnModelEvent evt ) {
                configureColumnCount();
            }
        } );
        viewModel.addTableModelListener( new TableModelListener() {
            public void tableChanged( TableModelEvent evt ) {
                configureRowCount();
            }
        } );
        ncolRowIndex = params.indexOf( ncolParam );
        nrowRowIndex = params.indexOf( nrowParam );
        for ( Iterator it = dataModel.getParameters().iterator();
              it.hasNext(); ) {
            DescribedValue param = (DescribedValue) it.next();
            params.add( param );
        }
        List metas = new ArrayList();
        metas.add( new MetaColumn( "Name", String.class ) {
            public Object getValue( int irow ) {
                return getParamInfo( irow ).getName();
            }
        } );
        metas.add( new MetaColumn( "Value", Object.class ) {
            public Object getValue( int irow ) {
                return getParam( irow ).getValue();
            }
            public boolean isEditable( int irow ) {
                return isEditableParameter( irow );
            }
            public void setValue( int irow, Object value ) {
                getParam( irow ).setValue( value );
            }
        } );
        int classPos = metas.size();
        metas.add( new MetaColumn( "Class", String.class ) {
            public Object getValue( int irow ) {
                return DefaultValueInfo
                      .formatClass( getParamInfo( irow ).getContentClass() );
            }
        } );
        metas.add( new MetaColumn( "Shape", String.class ) {
            public Object getValue( int irow ) {
                return DefaultValueInfo
                      .formatShape( getParamInfo( irow ).getShape() );
            }
        } );
        metas.add( new MetaColumn( "Units", String.class ) {
            public Object getValue( int irow ) {
                return getParamInfo( irow ).getUnitString();
            }
            public boolean isEditable( int irow ) {
                return ! isPseudoParameter( irow ) &&
                       getParamInfo( irow ) instanceof DefaultValueInfo;
            }
            public void setValue( int irow, Object value ) {
                ((DefaultValueInfo) getParamInfo( irow ))
               .setUnitString( value == null ? null : value.toString() );
            }
        } );
        metas.add( new MetaColumn( "Description", String.class ) {
            public Object getValue( int irow ) {
                return getParamInfo( irow ).getDescription();
            }
            public boolean isEditable( int irow ) {
                return ! isPseudoParameter( irow ) &&
                       getParamInfo( irow ) instanceof DefaultValueInfo;
            }
            public void setValue( int irow, Object value ) {
                ((DefaultValueInfo) getParamInfo( irow ))
               .setDescription( value == null ? null : value.toString() );
            }
        } );
        metas.add( new MetaColumn( "UCD", String.class ) {
            public Object getValue( int irow ) {
                return getParamInfo( irow ).getUCD();
            }
            public boolean isEditable( int irow ) {
                return ! isPseudoParameter( irow ) &&
                       getParamInfo( irow ) instanceof DefaultValueInfo;
            }
            public void setValue( int irow, Object value ) {
                ((DefaultValueInfo) getParamInfo( irow ))
               .setUCD( value == null ? null : value.toString() );
            }
        } );
        metas.add( new MetaColumn( "UCD description", String.class ) {
            public Object getValue( int irow ) {
                String ucdid = getParamInfo( irow ).getUCD();
                if ( ucdid != null ) {
                    UCD ucd = UCD.getUCD( dataModel.getColumnInfo( irow )
                                                   .getUCD() );
                    if ( ucd != null ) {
                        return ucd.getDescription();
                    }
                }
                return null;
            }
        } );
        metaTableModel = new MetaColumnTableModel( metas ) {
            public int getRowCount() {
                return params.size();
            }
        };
        JTable jtab = new JTable( metaTableModel );
        jtab.setAutoResizeMode( JTable.AUTO_RESIZE_OFF );
        jtab.setColumnSelectionAllowed( false );
        jtab.setRowSelectionAllowed( true );
        StarJTable.configureColumnWidths( jtab, 20000, 100 );
        MetaColumnModel metaColumnModel =
            new MetaColumnModel( jtab.getColumnModel(), metaTableModel );
        metaColumnModel.purgeEmptyColumns();
        jtab.setColumnModel( metaColumnModel );
        metaColumnModel.removeColumn( classPos );
        configureColumnCount();
        configureRowCount();
        getMainArea().add( new SizingScrollPane( jtab ) );
        setMainHeading( "Table Metadata" );
        JMenu displayMenu = metaColumnModel.makeCheckBoxMenu( "Display" );
        displayMenu.setMnemonic( KeyEvent.VK_D );
        getJMenuBar().add( displayMenu );
        addHelp( "ParameterWindow" );
        pack();
        setVisible( true );
    }

Output:
    public ParameterWindow( TableViewer tv ) {
        super( "Table Parameters", tv );
        this.tv = tv;
        this.dataModel = tv.getDataModel();
        this.viewModel = tv.getViewModel();
        this.columnModel = tv.getColumnModel();
        params = new ArrayList();
        pseudoParams = new HashSet();
        uneditableParams = new HashSet();
        DescribedValue nameParam = new DescribedValue( NAME_INFO ) {
            public Object getValue() {
                return dataModel.getName();
            }
            public void setValue( Object value ) {
                String name = value == null ? null : value.toString();
                if ( name.trim().length() == 0 ) {
                    name = null;
                }
                dataModel.setName( name );
            }
        };
        params.add( nameParam );
        pseudoParams.add( nameParam );
        URL url = dataModel.getBaseTable().getURL();
        if ( url != null ) {
            DescribedValue urlParam = new DescribedValue( URL_INFO, url );
            params.add( urlParam );
            pseudoParams.add( urlParam );
            uneditableParams.add( urlParam );
        }
        ncolParam = new DescribedValue( NCOL_INFO );
        nrowParam = new DescribedValue( NROW_INFO );
        params.add( ncolParam );
        params.add( nrowParam );
        pseudoParams.add( ncolParam );
        pseudoParams.add( nrowParam );
        uneditableParams.add( ncolParam );
        uneditableParams.add( nrowParam );
        columnModel.addColumnModelListener( new TableColumnModelAdapter() {
            public void columnAdded( TableColumnModelEvent evt ) {
                configureColumnCount();
            }
            public void columnRemoved( TableColumnModelEvent evt ) {
                configureColumnCount();
            }
        } );
        viewModel.addTableModelListener( new TableModelListener() {
            public void tableChanged( TableModelEvent evt ) {
                configureRowCount();
            }
        } );
        ncolRowIndex = params.indexOf( ncolParam );
        nrowRowIndex = params.indexOf( nrowParam );
        for ( Iterator it = dataModel.getParameters().iterator();
              it.hasNext(); ) {
            DescribedValue param = (DescribedValue) it.next();
            params.add( param );
        }
        List metas = new ArrayList();
        metas.add( new MetaColumn( "Name", String.class ) {
            public Object getValue( int irow ) {
                return getParamInfo( irow ).getName();
            }
        } );
        metas.add( new MetaColumn( "Value", Object.class ) {
            public Object getValue( int irow ) {
                return getParam( irow ).getValue();
            }
            public boolean isEditable( int irow ) {
                return isEditableParameter( irow );
            }
            public void setValue( int irow, Object value ) {
                getParam( irow ).setValue( value );
            }
        } );
        int classPos = metas.size();
        metas.add( new MetaColumn( "Class", String.class ) {
            public Object getValue( int irow ) {
                return DefaultValueInfo
                      .formatClass( getParamInfo( irow ).getContentClass() );
            }
        } );
        metas.add( new MetaColumn( "Shape", String.class ) {
            public Object getValue( int irow ) {
                return DefaultValueInfo
                      .formatShape( getParamInfo( irow ).getShape() );
            }
        } );
        metas.add( new MetaColumn( "Units", String.class ) {
            public Object getValue( int irow ) {
                return getParamInfo( irow ).getUnitString();
            }
            public boolean isEditable( int irow ) {
                return ! isPseudoParameter( irow ) &&
                       getParamInfo( irow ) instanceof DefaultValueInfo;
            }
            public void setValue( int irow, Object value ) {
                ((DefaultValueInfo) getParamInfo( irow ))
               .setUnitString( value == null ? null : value.toString() );
            }
        } );
        metas.add( new MetaColumn( "Description", String.class ) {
            public Object getValue( int irow ) {
                return getParamInfo( irow ).getDescription();
            }
            public boolean isEditable( int irow ) {
                return ! isPseudoParameter( irow ) &&
                       getParamInfo( irow ) instanceof DefaultValueInfo;
            }
            public void setValue( int irow, Object value ) {
                ((DefaultValueInfo) getParamInfo( irow ))
               .setDescription( value == null ? null : value.toString() );
            }
        } );
        metas.add( new MetaColumn( "UCD", String.class ) {
            public Object getValue( int irow ) {
                return getParamInfo( irow ).getUCD();
            }
            public boolean isEditable( int irow ) {
                return ! isPseudoParameter( irow ) &&
                       getParamInfo( irow ) instanceof DefaultValueInfo;
            }
            public void setValue( int irow, Object value ) {
                ((DefaultValueInfo) getParamInfo( irow ))
               .setUCD( value == null ? null : value.toString() );
            }
        } );
        metas.add( new MetaColumn( "UCD description", String.class ) {
            public Object getValue( int irow ) {
                String ucdid = getParamInfo( irow ).getUCD();
                if ( ucdid != null ) {
                    UCD ucd = UCD.getUCD( ucdid );
                    if ( ucd != null ) {
                        return ucd.getDescription();
                    }
                }
                return null;
            }
        } );
        metaTableModel = new MetaColumnTableModel( metas ) {
            public int getRowCount() {
                return params.size();
            }
        };
        JTable jtab = new JTable( metaTableModel );
        jtab.setAutoResizeMode( JTable.AUTO_RESIZE_OFF );
        jtab.setColumnSelectionAllowed( false );
        jtab.setRowSelectionAllowed( true );
        StarJTable.configureColumnWidths( jtab, 20000, 100 );
        MetaColumnModel metaColumnModel =
            new MetaColumnModel( jtab.getColumnModel(), metaTableModel );
        metaColumnModel.purgeEmptyColumns();
        jtab.setColumnModel( metaColumnModel );
        metaColumnModel.removeColumn( classPos );
        configureColumnCount();
        configureRowCount();
        getMainArea().add( new SizingScrollPane( jtab ) );
        setMainHeading( "Table Metadata" );
        JMenu displayMenu = metaColumnModel.makeCheckBoxMenu( "Display" );
        displayMenu.setMnemonic( KeyEvent.VK_D );
        getJMenuBar().add( displayMenu );
        addHelp( "ParameterWindow" );
        pack();
        setVisible( true );
    }


Input:
	public void createSection(Composite parent)
	{
		super.createSection(parent);
		FormToolkit toolkit = new FormToolkit(parent.getDisplay());
		Section section = toolkit.createSection(parent, ExpandableComposite.TWISTIE|ExpandableComposite.EXPANDED|ExpandableComposite.TITLE_BAR);
		section.setText(Messages.swf_DeployEditorHeading);
		section.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL));
		Composite composite = toolkit.createComposite(section);
		composite.setLayout(new FormLayout());
		Label descriptionLabel = toolkit.createLabel(composite, Messages.swf_DeploymentDescription);
		Label label = toolkit.createLabel(composite, Messages.swf_DeployDirectory);
		final Text text = toolkit.createText(composite, getDeployDir(), SWT.BORDER);
		text.addModifyListener(new ModifyListener() {
			public void modifyText(ModifyEvent e) {
				execute(new SetDeployDirCommand(server, text, text.getText()));
			}
		});
		Button button = toolkit.createButton(composite, Messages.browse, SWT.PUSH);
		button.addSelectionListener(new SelectionListener() {
			public void widgetDefaultSelected(SelectionEvent e) {
			}
			public void widgetSelected(SelectionEvent e) {
				DirectoryDialog d = new DirectoryDialog(new Shell());
				d.setFilterPath(text.getText());
				String x = d.open();
				if( x != null )
					text.setText(x);
			}
		});
		Label tempDeployLabel = toolkit.createLabel(composite, Messages.swf_TempDeployDirectory);
		final Text tempDeployText = toolkit.createText(composite, getTempDeployDir(), SWT.BORDER);
		tempDeployText.addModifyListener(new ModifyListener() {
			public void modifyText(ModifyEvent e) {
				execute(new SetTempDeployDirCommand(server, tempDeployText, tempDeployText.getText()));
			}
		});
		Button tempDeployButton = toolkit.createButton(composite, Messages.browse, SWT.PUSH);
		tempDeployButton.addSelectionListener(new SelectionListener() {
			public void widgetDefaultSelected(SelectionEvent e) {
			}
			public void widgetSelected(SelectionEvent e) {
				DirectoryDialog d = new DirectoryDialog(new Shell());
				d.setFilterPath(tempDeployText.getText());
				String x = d.open();
				if( x != null )
					tempDeployText.setText(x);
			}
		});
		FormData descriptionLabelData = new FormData();
		descriptionLabelData.left = new FormAttachment(0,5);
		descriptionLabelData.top = new FormAttachment(0,5);
		descriptionLabel.setLayoutData(descriptionLabelData);
		FormData labelData = new FormData();
		labelData.left = new FormAttachment(0,5);
		labelData.top = new FormAttachment(descriptionLabel,5);
		label.setLayoutData(labelData);
		FormData textData = new FormData();
		textData.left = new FormAttachment(label, 5);
		textData.top = new FormAttachment(descriptionLabel,5);
		textData.right = new FormAttachment(0,300);
		text.setLayoutData(textData);
		FormData buttonData = new FormData();
		buttonData.right = new FormAttachment(100,-5);
		buttonData.top = new FormAttachment(descriptionLabel,5);
		button.setLayoutData(buttonData);
		FormData tempLabelData = new FormData();
		tempLabelData.left = new FormAttachment(0,5);
		tempLabelData.top = new FormAttachment(text,5);
		tempDeployLabel.setLayoutData(tempLabelData);
		FormData tempTextData = new FormData();
		tempTextData.left = new FormAttachment(tempDeployLabel, 5);
		tempTextData.top = new FormAttachment(text,5);
		tempTextData.right = new FormAttachment(0, 300);
		tempDeployText.setLayoutData(tempTextData);
		FormData tempButtonData = new FormData();
		tempButtonData.right = new FormAttachment(100,-5);
		tempButtonData.top = new FormAttachment(text,5);
		tempDeployButton.setLayoutData(tempButtonData);
		text.setEditable(false);
		tempDeployText.setEditable(false);
		toolkit.paintBordersFor(composite);
		section.setClient(composite);
	}

Output:
	public void createSection(Composite parent)
	{
		super.createSection(parent);
		FormToolkit toolkit = new FormToolkit(parent.getDisplay());
		Section section = toolkit.createSection(parent, ExpandableComposite.TWISTIE|ExpandableComposite.EXPANDED|ExpandableComposite.TITLE_BAR);
		section.setText(Messages.swf_DeployEditorHeading);
		section.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL));
		Composite composite = toolkit.createComposite(section);
		composite.setLayout(new FormLayout());
		Label descriptionLabel = toolkit.createLabel(composite, Messages.swf_DeploymentDescription);
		Label label = toolkit.createLabel(composite, Messages.swf_DeployDirectory);
		final Text text = toolkit.createText(composite, getDeployDir(), SWT.BORDER);
		text.addModifyListener(new ModifyListener() {
			public void modifyText(ModifyEvent e) {
				execute(new SetDeployDirCommand(server, text, text.getText()));
			}
		});
		Button button = toolkit.createButton(composite, Messages.browse, SWT.PUSH);
		button.addSelectionListener(new SelectionListener() {
			public void widgetDefaultSelected(SelectionEvent e) {
			}
			public void widgetSelected(SelectionEvent e) {
				DirectoryDialog d = new DirectoryDialog(new Shell());
				d.setFilterPath(text.getText());
				String x = d.open();
				if( x != null )
					text.setText(x);
			}
		});
		Label tempDeployLabel = toolkit.createLabel(composite, Messages.swf_TempDeployDirectory);
		final Text tempDeployText = toolkit.createText(composite, getTempDeployDir(), SWT.BORDER);
		tempDeployText.addModifyListener(new ModifyListener() {
			public void modifyText(ModifyEvent e) {
				execute(new SetTempDeployDirCommand(server, tempDeployText, tempDeployText.getText()));
			}
		});
		Button tempDeployButton = toolkit.createButton(composite, Messages.browse, SWT.PUSH);
		tempDeployButton.addSelectionListener(new SelectionListener() {
			public void widgetDefaultSelected(SelectionEvent e) {
			}
			public void widgetSelected(SelectionEvent e) {
				DirectoryDialog d = new DirectoryDialog(new Shell());
				d.setFilterPath(tempDeployText.getText());
				String x = d.open();
				if( x != null )
					tempDeployText.setText(x);
			}
		});
		FormData descriptionLabelData = new FormData();
		descriptionLabelData.left = new FormAttachment(0,5);
		descriptionLabelData.top = new FormAttachment(0,5);
		descriptionLabel.setLayoutData(descriptionLabelData);
		FormData labelData = new FormData();
		labelData.left = new FormAttachment(0,5);
		labelData.top = new FormAttachment(descriptionLabel,5);
		label.setLayoutData(labelData);
		FormData textData = new FormData();
		textData.left = new FormAttachment(label, 5);
		textData.top = new FormAttachment(descriptionLabel,5);
		textData.right = new FormAttachment(0,300);
		text.setLayoutData(textData);
		FormData buttonData = new FormData();
		buttonData.right = new FormAttachment(100,-5);
		buttonData.left = new FormAttachment(text, 5);
		buttonData.top = new FormAttachment(descriptionLabel,5);
		button.setLayoutData(buttonData);
		FormData tempLabelData = new FormData();
		tempLabelData.left = new FormAttachment(0,5);
		tempLabelData.top = new FormAttachment(text,5);
		tempDeployLabel.setLayoutData(tempLabelData);
		FormData tempTextData = new FormData();
		tempTextData.left = new FormAttachment(tempDeployLabel, 5);
		tempTextData.top = new FormAttachment(text,5);
		tempTextData.right = new FormAttachment(0, 300);
		tempDeployText.setLayoutData(tempTextData);
		FormData tempButtonData = new FormData();
		tempButtonData.right = new FormAttachment(100,-5);
		tempButtonData.left = new FormAttachment(tempDeployText,5);
		tempButtonData.top = new FormAttachment(text,5);
		tempDeployButton.setLayoutData(tempButtonData);
		text.setEditable(false);
		tempDeployText.setEditable(false);
		toolkit.paintBordersFor(composite);
		section.setClient(composite);
	}


Input:
    private void doAPKWithAPKBuilder( File outputFile, File dexFile, File zipArchive, ArrayList<File> sourceFolders,
                                      ArrayList<File> jarFiles, ArrayList<File> nativeFolders,
                                      boolean signWithDebugKeyStore ) throws MojoExecutionException
    {
        getLog().debug( "Building APK with internal APKBuilder" );
        sourceFolders.add( new File( project.getBuild().getOutputDirectory() ) );
        for ( Artifact artifact : getRelevantCompileArtifacts() )
        {
            if ( extractDuplicates )
            {
                try
                {
                    computeDuplicateFiles( artifact.getFile() );
                }
                catch ( Exception e )
                {
                    getLog().warn( "Cannot compute duplicates files from " + artifact.getFile().getAbsolutePath(), e );
                }
            }
            jarFiles.add( artifact.getFile() );
        }
        if ( extractDuplicates )
        {
            List<String> duplicates = new ArrayList<String>();
            List<File> jarToModify = new ArrayList<File>();
            for ( String s : jars.keySet() )
            {
                List<File> l = jars.get( s );
                if ( l.size() > 1 )
                {
                    getLog().warn( "Duplicate file " + s + " : " + l );
                    duplicates.add( s );
                    for ( int i = 1; i < l.size(); i++ )
                    {
                        if ( ! jarToModify.contains( l.get( i ) ) )
                        {
                            jarToModify.add( l.get( i ) );
                        }
                    }
                }
            }
            for ( File file : jarToModify )
            {
                File newJar;
                newJar = removeDuplicatesFromJar( file, duplicates );
                int index = jarFiles.indexOf( file );
                if ( newJar != null )
                {
                    jarFiles.set( index, newJar );
                }
            }
        }
        String debugKeyStore;
        ApkBuilder apkBuilder;
        try
        {
            debugKeyStore = ApkBuilder.getDebugKeystore();
            apkBuilder =
                    new ApkBuilder( outputFile, zipArchive, dexFile,
                            ( signWithDebugKeyStore ) ? debugKeyStore : null, null );
            if ( apkDebug )
            {
                apkBuilder.setDebugMode( apkDebug );
            }
            for ( File sourceFolder : sourceFolders )
            {
                apkBuilder.addSourceFolder( sourceFolder );
            }
            for ( File jarFile : jarFiles )
            {
                boolean excluded = false;
                if ( excludeJarResourcesPatterns != null )
                {
                    final String name = jarFile.getName();
                    getLog().debug( "Checking " + name + " against patterns" );
                    for ( Pattern pattern : excludeJarResourcesPatterns )
                    {
                        final Matcher matcher = pattern.matcher( name );
                        if ( matcher.matches() )
                        {
                            getLog().debug( "Jar " + name + " excluded by pattern " + pattern );
                            excluded = true;
                            break;
                        }
                        else
                        {
                            getLog().debug( "Jar " + name + " not excluded by pattern " + pattern );
                        }
                    }
                }
                if ( excluded )
                {
                    continue;
                }
                if ( jarFile.isDirectory() )
                {
                    String[] filenames = jarFile.list( new FilenameFilter()
                    {
                        public boolean accept( File dir, String name )
                        {
                            return PATTERN_JAR_EXT.matcher( name ).matches();
                        }
                    } );
                    for ( String filename : filenames )
                    {
                        apkBuilder.addResourcesFromJar( new File( jarFile, filename ) );
                    }
                }
                else
                {
                    apkBuilder.addResourcesFromJar( jarFile );
                }
            }
            for ( File nativeFolder : nativeFolders )
            {
                apkBuilder.addNativeLibraries( nativeFolder );
            }
            apkBuilder.sealApk();
        }
        catch ( ApkCreationException e )
        {
            throw new MojoExecutionException( e.getMessage() );
        }
        catch ( DuplicateFileException e )
        {
            throw new MojoExecutionException( e.getMessage() );
        }
        catch ( SealedApkException e )
        {
            throw new MojoExecutionException( e.getMessage() );
        }
    }

Output:
    private void doAPKWithAPKBuilder( File outputFile, File dexFile, File zipArchive, ArrayList<File> sourceFolders,
                                      ArrayList<File> jarFiles, ArrayList<File> nativeFolders,
                                      boolean signWithDebugKeyStore ) throws MojoExecutionException
    {
        getLog().debug( "Building APK with internal APKBuilder" );
        sourceFolders.add( new File( project.getBuild().getOutputDirectory() ) );
        for ( Artifact artifact : getRelevantCompileArtifacts() )
        {
            if ( extractDuplicates )
            {
                try
                {
                    computeDuplicateFiles( artifact.getFile() );
                }
                catch ( Exception e )
                {
                    getLog().warn( "Cannot compute duplicates files from " + artifact.getFile().getAbsolutePath(), e );
                }
            }
            jarFiles.add( artifact.getFile() );
        }
        if ( extractDuplicates )
        {
            List<String> duplicates = new ArrayList<String>();
            List<File> jarToModify = new ArrayList<File>();
            for ( String s : jars.keySet() )
            {
                List<File> l = jars.get( s );
                if ( l.size() > 1 )
                {
                    getLog().warn( "Duplicate file " + s + " : " + l );
                    duplicates.add( s );
                    for ( int i = 1; i < l.size(); i++ )
                    {
                        if ( ! jarToModify.contains( l.get( i ) ) )
                        {
                            jarToModify.add( l.get( i ) );
                        }
                    }
                }
            }
            for ( File file : jarToModify )
            {
                File newJar;
                newJar = removeDuplicatesFromJar( file, duplicates );
                int index = jarFiles.indexOf( file );
                if ( newJar != null )
                {
                    jarFiles.set( index, newJar );
                }
            }
        }
        String debugKeyStore;
        ApkBuilder apkBuilder;
        try
        {
            debugKeyStore = ApkBuilder.getDebugKeystore();
            apkBuilder =
                    new ApkBuilder( outputFile, zipArchive, dexFile,
                            ( signWithDebugKeyStore ) ? debugKeyStore : null, null );
            if ( apkDebug )
            {
                apkBuilder.setDebugMode( apkDebug );
            }
            for ( File sourceFolder : sourceFolders )
            {
                apkBuilder.addSourceFolder( sourceFolder );
            }
            for ( File jarFile : jarFiles )
            {
                boolean excluded = false;
                if ( excludeJarResourcesPatterns != null )
                {
                    final String name = jarFile.getName();
                    getLog().debug( "Checking " + name + " against patterns" );
                    for ( Pattern pattern : excludeJarResourcesPatterns )
                    {
                        final Matcher matcher = pattern.matcher( name );
                        if ( matcher.matches() )
                        {
                            getLog().debug( "Jar " + name + " excluded by pattern " + pattern );
                            excluded = true;
                            break;
                        }
                        else
                        {
                            getLog().debug( "Jar " + name + " not excluded by pattern " + pattern );
                        }
                    }
                }
                if ( excluded )
                {
                    continue;
                }
                if ( jarFile.isDirectory() )
                {
                    String[] filenames = jarFile.list( new FilenameFilter()
                    {
                        public boolean accept( File dir, String name )
                        {
                            return PATTERN_JAR_EXT.matcher( name ).matches();
                        }
                    } );
                    for ( String filename : filenames )
                    {
                        apkBuilder.addResourcesFromJar( new File( jarFile, filename ) );
                    }
                }
                else
                {
                    apkBuilder.addResourcesFromJar( jarFile );
                }
            }
            for ( File nativeFolder : nativeFolders )
            {
                apkBuilder.addNativeLibraries( nativeFolder );
            }
            apkBuilder.sealApk();
        }
        catch ( ApkCreationException e )
        {
            throw new MojoExecutionException( e.getMessage() );
        }
        catch ( DuplicateFileException e )
        {
            final String msg = String.format("Duplicate file! archive: %s, file1: %s, file2: %s",
                    e.getArchivePath(), e.getFile1(), e.getFile2());
            throw new MojoExecutionException( msg, e );
        }
        catch ( SealedApkException e )
        {
            throw new MojoExecutionException( e.getMessage() );
        }
    }


Input:
	public EconomicPlanet(int id, int owner, int numShips, int growthRate,
			double x, double y) {
		super(id, owner, numShips, x, y);
		this.revenue = growthRate;
	}

Output:
	public EconomicPlanet(int id, int owner, int numShips, int revenue,
			double x, double y) {
		super(id, owner, numShips, x, y);
		this.revenue = revenue;
	}


Input:
  public void updated(Dictionary properties) throws ConfigurationException {
    if (properties == null)
      return;
    String currentMountpoint = resourcesMountpoint;
    String mountpoint = (String) properties.get(OPT_RESOURCES_MOUNTPOINT);
    if (StringUtils.trimToNull(mountpoint) != null) {
      resourcesMountpoint = mountpoint;
      logger.debug("Configured value for the shared resource mountpoint is '{}'", mountpoint);
    }
    String externalResources = (String) properties.get(OPT_EXT_RESOURCES);
    if (StringUtils.trimToNull(externalResources) != null) {
      externalResourcesDir = new File(externalResources);
      servlet = new WebloungeResourcesServlet(externalResourcesDir, bundleContext.getBundle(), RESOURCES_BUNDLE_DIR);
      logger.debug("Configured external shared resources directory at '{}'", externalResources);
    } else {
      servlet = null;
    }
    if (currentMountpoint != null) {
      try {
        httpService.unregister(currentMountpoint);
        logger.info("Serving shared weblounge resources at {}", resourcesMountpoint);
        if (servlet != null) {
          httpService.registerServlet(resourcesMountpoint, servlet, null, httpContext);
          logger.info("Added {} to shared weblounge resources", externalResourcesDir);
        } else {
          httpService.registerResources(resourcesMountpoint, RESOURCES_BUNDLE_DIR, httpContext);
        }
      } catch (NamespaceException e) {
        logger.error("Error registering shared resources at " + resourcesMountpoint, e);
      } catch (ServletException e) {
        logger.error("Error registering shared resources servlet at " + resourcesMountpoint, e);
      }
    }
  }

Output:
  public void updated(Dictionary properties) throws ConfigurationException {
    if (properties == null)
      return;
    String currentMountpoint = resourcesMountpoint;
    String mountpoint = (String) properties.get(OPT_RESOURCES_MOUNTPOINT);
    if (StringUtils.isNotBlank(mountpoint)) {
      resourcesMountpoint = mountpoint;
      logger.debug("Configured value for the shared resource mountpoint is '{}'", mountpoint);
    } else {
      resourcesMountpoint = DEFAULT_RESOURCES_MOUNTPOINT;
      logger.debug("Using default mountpoint {} for shared resources", resourcesMountpoint);
    }
    String externalResources = (String) properties.get(OPT_EXT_RESOURCES);
    if (StringUtils.isNotBlank(externalResources)) {
      externalResourcesDir = new File(externalResources);
      servlet = new WebloungeResourcesServlet(externalResourcesDir, bundleContext.getBundle(), RESOURCES_BUNDLE_DIR);
      logger.debug("Configured external shared resources directory at '{}'", externalResources);
    } else {
      servlet = null;
    }
    if (currentMountpoint != null) {
      try {
        httpService.unregister(currentMountpoint);
        logger.info("Serving shared weblounge resources at {}", resourcesMountpoint);
        if (servlet != null) {
          httpService.registerServlet(resourcesMountpoint, servlet, null, httpContext);
          logger.info("Added {} to shared weblounge resources", externalResourcesDir);
        } else {
          httpService.registerResources(resourcesMountpoint, RESOURCES_BUNDLE_DIR, httpContext);
        }
      } catch (NamespaceException e) {
        logger.error("Error registering shared resources at " + resourcesMountpoint, e);
      } catch (ServletException e) {
        logger.error("Error registering shared resources servlet at " + resourcesMountpoint, e);
      }
    }
  }


Input:
	public InstallCommand(
		String featureId,
		String version,
		String fromSite,
		String toSite,
		String verifyOnly)
		throws Exception {
		super(verifyOnly);
		try {
			this.featureId = featureId;
			this.version = version;
			this.remoteSiteURL = new URL(URLDecoder.decode(fromSite, "UTF-8"));
			IConfiguredSite[] sites = getConfiguration().getConfiguredSites();
			if (toSite != null) {
				URL toSiteURL = new File(toSite).toURL();
				if (SiteManager.getSite(toSiteURL, null) == null) {
					throw new Exception(
						"Cannot find site to install to: " + toSite);
				}
				targetSite =
					SiteManager
						.getSite(toSiteURL, null)
						.getCurrentConfiguredSite();
			}
			if (targetSite == null) {
				for (int i = 0; i < sites.length; i++) {
					if (sites[i].isProductSite()) {
						targetSite = sites[i];
						break;
					}
				}
			}
			UpdateSearchScope searchScope = new UpdateSearchScope();
			searchScope.addSearchSite(
				"remoteSite",
				remoteSiteURL,
				new String[0]);
			searchRequest =
				new UpdateSearchRequest(new SiteSearchCategory(), searchScope);
			VersionedIdentifier vid =
				new VersionedIdentifier(featureId, version);
			searchRequest.addFilter(
				new VersionedIdentifiersFilter(
					new VersionedIdentifier[] { vid }));
			searchRequest.addFilter(new EnvironmentFilter());
			searchRequest.addFilter(new BackLevelFilter());
			collector = new UpdateSearchResultCollector();
		} catch (MalformedURLException e) {
			throw e;
		} catch (CoreException e) {
			throw e;
		}
	}

Output:
	public InstallCommand(
		String featureId,
		String version,
		String fromSite,
		String toSite,
		String verifyOnly)
		throws Exception {
		super(verifyOnly);
		try {
			this.featureId = featureId;
			this.version = version;
			this.remoteSiteURL = new URL(URLDecoder.decode(fromSite, "UTF-8"));
			IConfiguredSite[] sites = getConfiguration().getConfiguredSites();
			if (toSite != null) {
				File sitePath = new File(toSite);
				URL toSiteURL = sitePath.toURL();
				ISite site = SiteManager.getSite(toSiteURL, null);
				if (site == null) {
					throw new Exception(
						"Cannot find site to install to: " + toSite);
				}
				targetSite = site.getCurrentConfiguredSite();
				if (targetSite == null) {
					targetSite = getConfiguration().createConfiguredSite(sitePath);
					getConfiguration().addConfiguredSite(targetSite);
				}
			}
			if (targetSite == null) {
				for (int i = 0; i < sites.length; i++) {
					if (sites[i].isProductSite()) {
						targetSite = sites[i];
						break;
					}
				}
			}
			UpdateSearchScope searchScope = new UpdateSearchScope();
			searchScope.addSearchSite(
				"remoteSite",
				remoteSiteURL,
				new String[0]);
			searchRequest =
				new UpdateSearchRequest(new SiteSearchCategory(), searchScope);
			VersionedIdentifier vid =
				new VersionedIdentifier(featureId, version);
			searchRequest.addFilter(
				new VersionedIdentifiersFilter(
					new VersionedIdentifier[] { vid }));
			searchRequest.addFilter(new EnvironmentFilter());
			searchRequest.addFilter(new BackLevelFilter());
			collector = new UpdateSearchResultCollector();
		} catch (MalformedURLException e) {
			throw e;
		} catch (CoreException e) {
			throw e;
		}
	}


Input:
	public synchronized CaspReturn runCmd(CaspCmd cmd) throws IOException {
		open();
		out.println(new String(cmd.getCmdString().getBytes("UTF-8")));
		long requestTime = new Date().getTime();
		String line = in.readLine();
		Matcher myMatcher = Pattern.compile("^\\d+").matcher(line);
		myMatcher.find();
		int status = Integer.parseInt(line.substring(myMatcher.start(), myMatcher.end()));
		Pattern endSequence = null;
		String response = null;
		Boolean getResponse = true;
		int charsRemove = 0;
		if (status == 200) {
			endSequence = Pattern.compile("\\r\\n\\r\\n$");
			charsRemove = 4;
		}
		else if (status == 201) {
			endSequence = Pattern.compile("\\r\\n$");
			charsRemove = 2;
			response = in.readLine();
		}
		else {
			getResponse = false;
		}
		if (getResponse) {
			response = "";
			while(true) {
				char character = (char) in.read();
				response += character;
				if (endSequence.matcher(response).find()) {
					break;
				}
			}
			response = response.substring(0, response.length()-charsRemove);
		}
		return new CaspReturn(status, response, requestTime);
	}

Output:
	public synchronized CaspReturn runCmd(CaspCmd cmd) throws IOException {
		open();
		out.println(new String(cmd.getCmdString().getBytes("UTF-8")));
		long requestTime = new Date().getTime();
		String line = in.readLine();
		Matcher myMatcher = Pattern.compile("^\\d+").matcher(line);
		myMatcher.find();
		int status = Integer.parseInt(line.substring(myMatcher.start(), myMatcher.end()));
		Pattern endSequence = null;
		String response = null;
		Boolean getResponse = true;
		int charsRemove = 0;
		if (status == 200) {
			endSequence = Pattern.compile("\\r\\n\\r\\n$");
			charsRemove = 4;
		}
		else if (status == 201) {
			endSequence = Pattern.compile("\\r\\n$");
			charsRemove = 2;
		}
		else {
			getResponse = false;
		}
		if (getResponse) {
			response = "";
			while(true) {
				char character = (char) in.read();
				response += character;
				if (endSequence.matcher(response).find()) {
					break;
				}
			}
			response = response.substring(0, response.length()-charsRemove);
		}
		return new CaspReturn(status, response, requestTime);
	}


Input:
	public void addFlexTrapezoid(float x, float y, float z, int w, int h, int d, float scale, float bScale1, float bScale2, float bScale3, float bScale4, float fScale1, float fScale2, int dir)
	{
		float f4 = x + (float)w;
		float f5 = y + (float)h;
		float f6 = z + (float)d;
		x -= scale;
		y -= scale;
		z -= scale;
		f4 += scale;
		f5 += scale;
		f6 += scale;
		int m = (mirror ? -1 : 1);
		if(mirror)
		{
			float f7 = f4;
			f4 = x;
			x = f7;
		}
		float[] v = {x, y, z};
		float[] v1 = {f4, y, z};
		float[] v2 = {f4, f5, z};
		float[] v3 = {x, f5, z};
		float[] v4 = {x, y, f6};
		float[] v5 = {f4, y, f6};
		float[] v6 = {f4, f5, f6};
		float[] v7 = {x, f5, f6};
		switch(dir)
		{
			case MR_RIGHT:
				v[2] -= fScale1;
				v1[2] -= fScale1;
				v4[2] += fScale2;
				v5[2] += fScale2;
				v[1] -= bScale1;
				v[2] -= bScale3;
				v3[1] += bScale2;
				v3[2] -= bScale3;
				v4[1] -= bScale1;
				v4[2] += bScale4;
				v7[1] += bScale2;
				v7[2] += bScale4;
				break;
			case MR_LEFT:
				v[2] -= fScale1;
				v1[2] -= fScale1;
				v4[2] += fScale2;
				v5[2] += fScale2;
				v1[1] -= bScale1;
				v1[2] -= bScale3;
				v2[1] += bScale2;
				v2[2] -= bScale3;
				v5[1] -= bScale1;
				v5[2] += bScale4;
				v6[1] += bScale2;
				v6[2] += bScale4;
				break;
			case MR_FRONT:
				v2[1] += fScale1;
				v3[1] += fScale2;
				v6[1] += fScale2;
				v7[1] += fScale1;
				v[0] -= m * bScale4;
				v[1] -= bScale1;
				v1[0] += m * bScale3;
				v1[1] -= bScale1;
				v2[0] += m * bScale3;
				v2[1] += bScale2;
				v3[0] -= m * bScale4;
				v3[1] += bScale2;
				break;
			case MR_BACK:
				v2[1] += fScale1;
				v3[1] += fScale2;
				v6[1] += fScale2;
				v7[1] += fScale1;
				v4[0] -= m * bScale4;
				v4[1] -= bScale1;
				v5[0] += m * bScale3;
				v5[1] -= bScale1;
				v6[0] += m * bScale3;
				v6[1] += bScale2;
				v7[0] -= m * bScale4;
				v7[1] += bScale2;
				break;
			case MR_TOP:
				v1[2] -= fScale1;
				v2[2] -= fScale1;
				v5[2] += fScale2;
				v6[2] += fScale2;
				v[0] -= m * bScale1;
				v[2] -= bScale3;
				v1[0] += m * bScale2;
				v1[2] -= bScale3;
				v4[0] -= m * bScale1;
				v4[2] += bScale4;
				v5[0] += m * bScale2;
				v5[2] += bScale4;
				break;
			case MR_BOTTOM:
				v1[2] -= fScale1;
				v2[2] -= fScale1;
				v5[2] += fScale2;
				v6[2] += fScale2;
				v2[0] += m * bScale2;
				v2[2] -= bScale3;
				v3[0] -= m * bScale1;
				v3[2] -= bScale3;
				v6[0] += m * bScale2;
				v6[2] += bScale4;
				v7[0] -= m * bScale1;
				v7[2] += bScale4;
				break;
		}
		float[] qValues = new float[] {
				Math.abs((v[0] - v1[0])/(v3[0]-v2[0])),
				Math.abs((v[0] - v1[0])/(v4[0]-v5[0])),
				Math.abs((v4[0] - v5[0])/(v7[0]-v6[0])),
				Math.abs((v3[0] - v2[0])/(v7[0]-v6[0])),
				Math.abs((v[1] - v3[1])/(v1[1]-v2[1])),
				Math.abs((v4[1] - v7[1])/(v5[1]-v6[1])),
				Math.abs((v[1] - v3[1])/(v4[1]-v7[1])),
				Math.abs((v1[1] - v2[1])/(v5[1]-v6[1])),
				Math.abs((v[2] - v4[2])/(v1[2]-v5[2])),
				Math.abs((v[2] - v4[2])/(v3[2]-v7[2])),
				Math.abs((v1[2] - v5[2])/(v2[2]-v6[2])),
				Math.abs((v3[2] - v7[2])/(v2[2]-v6[2]))
		};
		addRectShape(v, v1, v2, v3, v4, v5, v6, v7, w, h, d, qValues);
	}

Output:
	public void addFlexTrapezoid(float x, float y, float z, int w, int h, int d, float scale, float bScale1, float bScale2, float bScale3, float bScale4, float fScale1, float fScale2, int dir)
	{
		float f4 = x + (float)w;
		float f5 = y + (float)h;
		float f6 = z + (float)d;
		x -= scale;
		y -= scale;
		z -= scale;
		f4 += scale;
		f5 += scale;
		f6 += scale;
		int m = (mirror ? -1 : 1);
		if(mirror)
		{
			float f7 = f4;
			f4 = x;
			x = f7;
		}
		float[] v = {x, y, z};
		float[] v1 = {f4, y, z};
		float[] v2 = {f4, f5, z};
		float[] v3 = {x, f5, z};
		float[] v4 = {x, y, f6};
		float[] v5 = {f4, y, f6};
		float[] v6 = {f4, f5, f6};
		float[] v7 = {x, f5, f6};
		switch(dir)
		{
			case MR_RIGHT:
				v[2] -= fScale1;
				v1[2] -= fScale1;
				v4[2] += fScale2;
				v5[2] += fScale2;
				v[1] -= bScale1;
				v[2] -= bScale3;
				v3[1] += bScale2;
				v3[2] -= bScale3;
				v4[1] -= bScale1;
				v4[2] += bScale4;
				v7[1] += bScale2;
				v7[2] += bScale4;
				break;
			case MR_LEFT:
				v[2] -= fScale1;
				v1[2] -= fScale1;
				v4[2] += fScale2;
				v5[2] += fScale2;
				v1[1] -= bScale1;
				v1[2] -= bScale3;
				v2[1] += bScale2;
				v2[2] -= bScale3;
				v5[1] -= bScale1;
				v5[2] += bScale4;
				v6[1] += bScale2;
				v6[2] += bScale4;
				break;
			case MR_FRONT:
				v1[1] -= fScale1;
				v5[1] -= fScale1;
				v2[1] += fScale2;
				v6[1] += fScale2;
				v[0] -= m * bScale4;
				v[1] -= bScale1;
				v1[0] += m * bScale3;
				v1[1] -= bScale1;
				v2[0] += m * bScale3;
				v2[1] += bScale2;
				v3[0] -= m * bScale4;
				v3[1] += bScale2;
				break;
			case MR_BACK:
				v1[1] -= fScale1;
				v5[1] -= fScale1;
				v2[1] += fScale2;
				v6[1] += fScale2;
				v4[0] -= m * bScale4;
				v4[1] -= bScale1;
				v5[0] += m * bScale3;
				v5[1] -= bScale1;
				v6[0] += m * bScale3;
				v6[1] += bScale2;
				v7[0] -= m * bScale4;
				v7[1] += bScale2;
				break;
			case MR_TOP:
				v1[2] -= fScale1;
				v2[2] -= fScale1;
				v5[2] += fScale2;
				v6[2] += fScale2;
				v[0] -= m * bScale1;
				v[2] -= bScale3;
				v1[0] += m * bScale2;
				v1[2] -= bScale3;
				v4[0] -= m * bScale1;
				v4[2] += bScale4;
				v5[0] += m * bScale2;
				v5[2] += bScale4;
				break;
			case MR_BOTTOM:
				v1[2] -= fScale1;
				v2[2] -= fScale1;
				v5[2] += fScale2;
				v6[2] += fScale2;
				v2[0] += m * bScale2;
				v2[2] -= bScale3;
				v3[0] -= m * bScale1;
				v3[2] -= bScale3;
				v6[0] += m * bScale2;
				v6[2] += bScale4;
				v7[0] -= m * bScale1;
				v7[2] += bScale4;
				break;
		}
		float[] qValues = new float[] {
				Math.abs((v[0] - v1[0])/(v3[0]-v2[0])),
				Math.abs((v[0] - v1[0])/(v4[0]-v5[0])),
				Math.abs((v4[0] - v5[0])/(v7[0]-v6[0])),
				Math.abs((v3[0] - v2[0])/(v7[0]-v6[0])),
				Math.abs((v[1] - v3[1])/(v1[1]-v2[1])),
				Math.abs((v4[1] - v7[1])/(v5[1]-v6[1])),
				Math.abs((v[1] - v3[1])/(v4[1]-v7[1])),
				Math.abs((v1[1] - v2[1])/(v5[1]-v6[1])),
				Math.abs((v[2] - v4[2])/(v1[2]-v5[2])),
				Math.abs((v[2] - v4[2])/(v3[2]-v7[2])),
				Math.abs((v1[2] - v5[2])/(v2[2]-v6[2])),
				Math.abs((v3[2] - v7[2])/(v2[2]-v6[2]))
		};
		addRectShape(v, v1, v2, v3, v4, v5, v6, v7, w, h, d, qValues);
	}


Input:
    private void paintNode(Graphics2D g, Node network, Node node, BufferedImage icon, boolean selected, boolean rendered, Node connectionOutput, Port hoverInputPort, boolean hoverOutput) {
        Rectangle r = nodeRect(node);
        String outputType = node.getOutputType();
        if (selected) {
            g.setColor(Color.WHITE);
            g.fillRect(r.x, r.y, NODE_WIDTH, NODE_HEIGHT);
        }
        g.setColor(portTypeColor(outputType));
        if (selected) {
            g.fillRect(r.x + 2, r.y + 2, NODE_WIDTH - 4, NODE_HEIGHT - 4);
        } else {
            g.fillRect(r.x, r.y, NODE_WIDTH, NODE_HEIGHT);
        }
        if (rendered) {
            g.setColor(Color.WHITE);
            GeneralPath gp = new GeneralPath();
            gp.moveTo(r.x + NODE_WIDTH - 2, r.y + NODE_HEIGHT - 20);
            gp.lineTo(r.x + NODE_WIDTH - 2, r.y + NODE_HEIGHT - 2);
            gp.lineTo(r.x + NODE_WIDTH - 20, r.y + NODE_HEIGHT - 2);
            g.fill(gp);
        }
        g.setColor(Color.WHITE);
        int portX = 0;
        for (Port input : node.getInputs()) {
            if (hoverInputPort == input) {
                g.setColor(PORT_HOVER_COLOR);
            } else {
                g.setColor(portTypeColor(input.getType()));
            }
            int portHeight = PORT_HEIGHT;
            if (connectionOutput != null) {
                if (connectionOutput.getOutputType().equals(input.getType())) {
                    portHeight = PORT_HEIGHT * 2;
                } else {
                    portHeight = 1;
                }
            }
            if (isPublished(network, node, input)) {
                Point2D topLeft = inverseViewTransformPoint(new Point(4, 0));
                g.setColor(portTypeColor(input.getType()));
                g.setStroke(CONNECTION_STROKE);
                paintConnectionLine(g, (int) topLeft.getX(), (int) topLeft.getY(), r.x + portX + 4, r.y - 2);
            }
            g.fillRect(r.x + portX, r.y - portHeight, PORT_WIDTH, portHeight);
            portX += PORT_WIDTH + PORT_SPACING;
        }
        if (hoverOutput && connectionOutput == null) {
            g.setColor(PORT_HOVER_COLOR);
        } else {
            g.setColor(portTypeColor(outputType));
        }
        g.fillRect(r.x, r.y + NODE_HEIGHT, PORT_WIDTH, PORT_HEIGHT);
        g.drawImage(icon, r.x + NODE_PADDING, r.y + NODE_PADDING, NODE_ICON_SIZE, NODE_ICON_SIZE, null);
        g.setColor(Color.WHITE);
        g.setFont(Theme.NETWORK_FONT);
        g.drawString(getShortenedName(node.getName(), 7), r.x + NODE_ICON_SIZE + NODE_PADDING * 2 + 2, r.y + 22);
    }

Output:
    private void paintNode(Graphics2D g, Node network, Node node, BufferedImage icon, boolean selected, boolean rendered, Node connectionOutput, Port hoverInputPort, boolean hoverOutput) {
        Rectangle r = nodeRect(node);
        String outputType = node.getOutputType();
        if (selected) {
            g.setColor(Color.WHITE);
            g.fillRect(r.x, r.y, NODE_WIDTH, NODE_HEIGHT);
        }
        g.setColor(portTypeColor(outputType));
        if (selected) {
            g.fillRect(r.x + 2, r.y + 2, NODE_WIDTH - 4, NODE_HEIGHT - 4);
        } else {
            g.fillRect(r.x, r.y, NODE_WIDTH, NODE_HEIGHT);
        }
        if (rendered) {
            g.setColor(Color.WHITE);
            GeneralPath gp = new GeneralPath();
            gp.moveTo(r.x + NODE_WIDTH - 2, r.y + NODE_HEIGHT - 20);
            gp.lineTo(r.x + NODE_WIDTH - 2, r.y + NODE_HEIGHT - 2);
            gp.lineTo(r.x + NODE_WIDTH - 20, r.y + NODE_HEIGHT - 2);
            g.fill(gp);
        }
        g.setColor(Color.WHITE);
        int portX = 0;
        for (Port input : node.getInputs()) {
            if (hoverInputPort == input) {
                g.setColor(PORT_HOVER_COLOR);
            } else {
                g.setColor(portTypeColor(input.getType()));
            }
            int portHeight = PORT_HEIGHT;
            if (connectionOutput != null) {
                String connectionOutputType = connectionOutput.getOutputType();
                String inputType = input.getType();
                if (connectionOutputType.equals(inputType) || inputType.equals(Port.TYPE_LIST)) {
                    portHeight = PORT_HEIGHT * 2;
                } else if (TypeConversions.canBeConverted(connectionOutputType, inputType)) {
                    portHeight = PORT_HEIGHT - 1;
                } else {
                    portHeight = 1;
                }
            }
            if (isPublished(network, node, input)) {
                Point2D topLeft = inverseViewTransformPoint(new Point(4, 0));
                g.setColor(portTypeColor(input.getType()));
                g.setStroke(CONNECTION_STROKE);
                paintConnectionLine(g, (int) topLeft.getX(), (int) topLeft.getY(), r.x + portX + 4, r.y - 2);
            }
            g.fillRect(r.x + portX, r.y - portHeight, PORT_WIDTH, portHeight);
            portX += PORT_WIDTH + PORT_SPACING;
        }
        if (hoverOutput && connectionOutput == null) {
            g.setColor(PORT_HOVER_COLOR);
        } else {
            g.setColor(portTypeColor(outputType));
        }
        g.fillRect(r.x, r.y + NODE_HEIGHT, PORT_WIDTH, PORT_HEIGHT);
        g.drawImage(icon, r.x + NODE_PADDING, r.y + NODE_PADDING, NODE_ICON_SIZE, NODE_ICON_SIZE, null);
        g.setColor(Color.WHITE);
        g.setFont(Theme.NETWORK_FONT);
        g.drawString(getShortenedName(node.getName(), 7), r.x + NODE_ICON_SIZE + NODE_PADDING * 2 + 2, r.y + 22);
    }


Input:
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        try {
            Collect.createODKDirs();
        } catch (RuntimeException e) {
            createErrorDialog(e.getMessage(), EXIT);
            return;
        }
        setContentView(R.layout.chooser_list_layout);
        setTitle(getString(R.string.app_name) + " > " + getString(R.string.review_data));
        TextView tv = (TextView) findViewById(R.id.status_text);
        tv.setVisibility(View.GONE);
        String selection = InstanceColumns.STATUS + " is not ?";
        String[] selectionArgs = {InstanceProviderAPI.STATUS_SUBMITTED};
        Cursor c = managedQuery(InstanceColumns.CONTENT_URI, null, selection, selectionArgs, InstanceColumns.STATUS + " desc");
        String[] data = new String[] {
                InstanceColumns.DISPLAY_NAME, InstanceColumns.DISPLAY_SUBTEXT
        };
        int[] view = new int[] {
                R.id.text1, R.id.text2
        };
        SimpleCursorAdapter instances =
            new SimpleCursorAdapter(this, R.layout.two_item, c, data, view);
        setListAdapter(instances);
    }

Output:
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        try {
            Collect.createODKDirs();
        } catch (RuntimeException e) {
            createErrorDialog(e.getMessage(), EXIT);
            return;
        }
        setContentView(R.layout.chooser_list_layout);
        setTitle(getString(R.string.app_name) + " > " + getString(R.string.review_data));
        TextView tv = (TextView) findViewById(R.id.status_text);
        tv.setVisibility(View.GONE);
        String selection = InstanceColumns.STATUS + " != ?";
        String[] selectionArgs = {InstanceProviderAPI.STATUS_SUBMITTED};
        Cursor c = managedQuery(InstanceColumns.CONTENT_URI, null, selection, selectionArgs, InstanceColumns.STATUS + " desc");
        String[] data = new String[] {
                InstanceColumns.DISPLAY_NAME, InstanceColumns.DISPLAY_SUBTEXT
        };
        int[] view = new int[] {
                R.id.text1, R.id.text2
        };
        SimpleCursorAdapter instances =
            new SimpleCursorAdapter(this, R.layout.two_item, c, data, view);
        setListAdapter(instances);
    }


Input:
    public AnyKeyboardBaseView(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
        TypedArray a = context.obtainStyledAttributes(
                attrs, R.styleable.AnyKeyboardBaseView, defStyle, R.style.AnyKeyboardBaseView);
        LayoutInflater inflate =
                (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        int previewLayout = 0;
        int keyTextSize = 0;
        int n = a.getIndexCount();
        for (int i = 0; i < n; i++) {
            int attr = a.getIndex(i);
            switch (attr) {
            case R.styleable.AnyKeyboardBaseView_keyBackground:
                mKeyBackground = a.getDrawable(attr);
                break;
            case R.styleable.AnyKeyboardBaseView_keyHysteresisDistance:
                mKeyHysteresisDistance = a.getDimensionPixelOffset(attr, 0);
                break;
            case R.styleable.AnyKeyboardBaseView_verticalCorrection:
                mVerticalCorrection = a.getDimensionPixelOffset(attr, 0);
                break;
            case R.styleable.AnyKeyboardBaseView_keyPreviewLayout:
                previewLayout = a.getResourceId(attr, 0);
                break;
            case R.styleable.AnyKeyboardBaseView_keyPreviewOffset:
                mPreviewOffset = a.getDimensionPixelOffset(attr, 0);
                break;
            case R.styleable.AnyKeyboardBaseView_keyPreviewHeight:
                mPreviewHeight = a.getDimensionPixelSize(attr, 80);
                break;
            case R.styleable.AnyKeyboardBaseView_keyTextSize:
                mKeyTextSize = a.getDimensionPixelSize(attr, 18);
                break;
            case R.styleable.AnyKeyboardBaseView_keyTextColor:
                mKeyTextColor = a.getColor(attr, 0xFF000000);
                break;
            case R.styleable.AnyKeyboardBaseView_labelTextSize:
                mLabelTextSize = a.getDimensionPixelSize(attr, 14);
                break;
            case R.styleable.AnyKeyboardBaseView_popupLayout:
                mPopupLayout = a.getResourceId(attr, 0);
                break;
            case R.styleable.AnyKeyboardBaseView_shadowColor:
                mShadowColor = a.getColor(attr, 0);
                break;
            case R.styleable.AnyKeyboardBaseView_shadowRadius:
                mShadowRadius = a.getFloat(attr, 0f);
                break;
            case R.styleable.AnyKeyboardBaseView_backgroundDimAmount:
                mBackgroundDimAmount = a.getFloat(attr, 0.5f);
                break;
            case R.styleable.AnyKeyboardBaseView_keyTextStyle:
                int textStyle = a.getInt(attr, 0);
                switch (textStyle) {
                    case 0:
                        mKeyTextStyle = Typeface.DEFAULT;
                        break;
                    case 1:
                        mKeyTextStyle = Typeface.DEFAULT_BOLD;
                        break;
                    default:
                        mKeyTextStyle = Typeface.defaultFromStyle(textStyle);
                        break;
                }
                break;
            case R.styleable.AnyKeyboardBaseView_symbolColorScheme:
                mSymbolColorScheme = a.getInt(attr, 0);
                break;
            }
        }
        final Resources res = getResources();
        mPreviewPopup = new PopupWindow(context);
        if (previewLayout != 0) {
            mPreviewText = (TextView) inflate.inflate(previewLayout, null);
            mPreviewTextSizeLarge = (int) res.getDimension(R.dimen.key_preview_text_size_large);
            mPreviewPopup.setContentView(mPreviewText);
            mPreviewPopup.setBackgroundDrawable(null);
        } else {
        	mPreviewText = null;
            mShowPreview = false;
        }
        mPreviewPopup.setTouchable(false);
        mPreviewPopup.setAnimationStyle(R.style.KeyPreviewAnimation);
        mDelayBeforePreview = 0;
        mDelayAfterPreview = 10;
        mMiniKeyboardParent = this;
        mMiniKeyboardPopup = new PopupWindow(context);
        mMiniKeyboardPopup.setBackgroundDrawable(null);
        mMiniKeyboardPopup.setAnimationStyle(R.style.MiniKeyboardAnimation);
        mPaint = new Paint();
        mPaint.setAntiAlias(true);
        mPaint.setTextSize(keyTextSize);
        mPaint.setTextAlign(Align.CENTER);
        mPaint.setAlpha(255);
        mPadding = new Rect(0, 0, 0, 0);
        mKeyBackground.getPadding(mPadding);
        mSwipeThreshold = (int) (500 * res.getDisplayMetrics().density);
        mDisambiguateSwipe = res.getBoolean(R.bool.config_swipeDisambiguation);
        mMiniKeyboardSlideAllowance = res.getDimension(R.dimen.mini_keyboard_slide_allowance);
        GestureDetector.SimpleOnGestureListener listener =
                new GestureDetector.SimpleOnGestureListener() {
            @Override
            public boolean onFling(MotionEvent me1, MotionEvent me2, float velocityX,
                    float velocityY) {
                final float absX = Math.abs(velocityX);
                final float absY = Math.abs(velocityY);
                float deltaX = me2.getX() - me1.getX();
                float deltaY = me2.getY() - me1.getY();
                int travelX = getWidth() / 2;
                int travelY = getHeight() / 2;
                mSwipeTracker.computeCurrentVelocity(1000);
                final float endingVelocityX = mSwipeTracker.getXVelocity();
                final float endingVelocityY = mSwipeTracker.getYVelocity();
                if (velocityX > mSwipeThreshold && absY < absX && deltaX > travelX) {
                    if (mDisambiguateSwipe && endingVelocityX >= velocityX / 4) {
                        swipeRight();
                        return true;
                    }
                } else if (velocityX < -mSwipeThreshold && absY < absX && deltaX < -travelX) {
                    if (mDisambiguateSwipe && endingVelocityX <= velocityX / 4) {
                        swipeLeft();
                        return true;
                    }
                } else if (velocityY < -mSwipeThreshold && absX < absY && deltaY < -travelY) {
                    if (mDisambiguateSwipe && endingVelocityY <= velocityY / 4) {
                        swipeUp();
                        return true;
                    }
                } else if (velocityY > mSwipeThreshold && absX < absY / 2 && deltaY > travelY) {
                    if (mDisambiguateSwipe && endingVelocityY >= velocityY / 4) {
                        swipeDown();
                        return true;
                    }
                }
                return false;
            }
        };
        mGestureDetector = createGestureDetector(listener);
        mGestureDetector.setIsLongpressEnabled(false);
        mHasDistinctMultitouch = systemHasMultitouch(context);
        Log.d(getKeyboardViewNameForLogging(), "mHasDistinctMultitouch : "+mHasDistinctMultitouch);
        mKeyRepeatInterval = 50;
        Log.i(getKeyboardViewNameForLogging(), "Created keyboard view of type "+getKeyboardViewNameForLogging());
    }

Output:
    public AnyKeyboardBaseView(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
        TypedArray a = context.obtainStyledAttributes(
                attrs, R.styleable.AnyKeyboardBaseView, defStyle, R.style.AnyKeyboardBaseView);
        LayoutInflater inflate =
                (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        int previewLayout = 0;
        int keyTextSize = 0;
        int n = a.getIndexCount();
        for (int i = 0; i < n; i++) {
            int attr = a.getIndex(i);
            switch (attr) {
            case R.styleable.AnyKeyboardBaseView_keyBackground:
                mKeyBackground = a.getDrawable(attr);
                break;
            case R.styleable.AnyKeyboardBaseView_keyHysteresisDistance:
                mKeyHysteresisDistance = a.getDimensionPixelOffset(attr, 0);
                break;
            case R.styleable.AnyKeyboardBaseView_verticalCorrection:
                mVerticalCorrection = a.getDimensionPixelOffset(attr, 0);
                break;
            case R.styleable.AnyKeyboardBaseView_keyPreviewLayout:
                previewLayout = a.getResourceId(attr, 0);
                break;
            case R.styleable.AnyKeyboardBaseView_keyPreviewOffset:
                mPreviewOffset = a.getDimensionPixelOffset(attr, 0);
                break;
            case R.styleable.AnyKeyboardBaseView_keyPreviewHeight:
                mPreviewHeight = a.getDimensionPixelSize(attr, 80);
                break;
            case R.styleable.AnyKeyboardBaseView_keyTextSize:
                mKeyTextSize = a.getDimensionPixelSize(attr, 18);
                break;
            case R.styleable.AnyKeyboardBaseView_keyTextColor:
                mKeyTextColor = a.getColor(attr, 0xFF000000);
                break;
            case R.styleable.AnyKeyboardBaseView_labelTextSize:
                mLabelTextSize = a.getDimensionPixelSize(attr, 14);
                break;
            case R.styleable.AnyKeyboardBaseView_popupLayout:
                mPopupLayout = a.getResourceId(attr, 0);
                break;
            case R.styleable.AnyKeyboardBaseView_shadowColor:
                mShadowColor = a.getColor(attr, 0);
                break;
            case R.styleable.AnyKeyboardBaseView_shadowRadius:
                mShadowRadius = a.getFloat(attr, 0f);
                break;
            case R.styleable.AnyKeyboardBaseView_backgroundDimAmount:
                mBackgroundDimAmount = a.getFloat(attr, 0.5f);
                break;
            case R.styleable.AnyKeyboardBaseView_keyTextStyle:
                int textStyle = a.getInt(attr, 0);
                switch (textStyle) {
                    case 0:
                        mKeyTextStyle = Typeface.DEFAULT;
                        break;
                    case 1:
                        mKeyTextStyle = Typeface.DEFAULT_BOLD;
                        break;
                    case 2:
                        mKeyTextStyle = Typeface.defaultFromStyle(Typeface.ITALIC);
                        break;
                    default:
                        mKeyTextStyle = Typeface.defaultFromStyle(textStyle);
                        break;
                }
                break;
            case R.styleable.AnyKeyboardBaseView_symbolColorScheme:
                mSymbolColorScheme = a.getInt(attr, 0);
                break;
            }
        }
        final Resources res = getResources();
        mPreviewPopup = new PopupWindow(context);
        if (previewLayout != 0) {
            mPreviewText = (TextView) inflate.inflate(previewLayout, null);
            mPreviewTextSizeLarge = (int) res.getDimension(R.dimen.key_preview_text_size_large);
            mPreviewPopup.setContentView(mPreviewText);
            mPreviewPopup.setBackgroundDrawable(null);
        } else {
        	mPreviewText = null;
            mShowPreview = false;
        }
        mPreviewPopup.setTouchable(false);
        mPreviewPopup.setAnimationStyle(R.style.KeyPreviewAnimation);
        mDelayBeforePreview = 20;
        mDelayAfterPreview = 10;
        mMiniKeyboardParent = this;
        mMiniKeyboardPopup = new PopupWindow(context);
        mMiniKeyboardPopup.setBackgroundDrawable(null);
        mMiniKeyboardPopup.setAnimationStyle(R.style.MiniKeyboardAnimation);
        mPaint = new Paint();
        mPaint.setAntiAlias(true);
        mPaint.setTextSize(keyTextSize);
        mPaint.setTextAlign(Align.CENTER);
        mPaint.setAlpha(255);
        mPadding = new Rect(0, 0, 0, 0);
        mKeyBackground.getPadding(mPadding);
        mSwipeThreshold = (int) (500 * res.getDisplayMetrics().density);
        mDisambiguateSwipe = res.getBoolean(R.bool.config_swipeDisambiguation);
        mMiniKeyboardSlideAllowance = res.getDimension(R.dimen.mini_keyboard_slide_allowance);
        GestureDetector.SimpleOnGestureListener listener =
                new GestureDetector.SimpleOnGestureListener() {
            @Override
            public boolean onFling(MotionEvent me1, MotionEvent me2, float velocityX,
                    float velocityY) {
                final float absX = Math.abs(velocityX);
                final float absY = Math.abs(velocityY);
                float deltaX = me2.getX() - me1.getX();
                float deltaY = me2.getY() - me1.getY();
                int travelX = getWidth() / 2;
                int travelY = getHeight() / 2;
                mSwipeTracker.computeCurrentVelocity(1000);
                final float endingVelocityX = mSwipeTracker.getXVelocity();
                final float endingVelocityY = mSwipeTracker.getYVelocity();
                if (velocityX > mSwipeThreshold && absY < absX && deltaX > travelX) {
                    if (mDisambiguateSwipe && endingVelocityX >= velocityX / 4) {
                        swipeRight();
                        return true;
                    }
                } else if (velocityX < -mSwipeThreshold && absY < absX && deltaX < -travelX) {
                    if (mDisambiguateSwipe && endingVelocityX <= velocityX / 4) {
                        swipeLeft();
                        return true;
                    }
                } else if (velocityY < -mSwipeThreshold && absX < absY && deltaY < -travelY) {
                    if (mDisambiguateSwipe && endingVelocityY <= velocityY / 4) {
                        swipeUp();
                        return true;
                    }
                } else if (velocityY > mSwipeThreshold && absX < absY / 2 && deltaY > travelY) {
                    if (mDisambiguateSwipe && endingVelocityY >= velocityY / 4) {
                        swipeDown();
                        return true;
                    }
                }
                return false;
            }
        };
        mGestureDetector = createGestureDetector(listener);
        mGestureDetector.setIsLongpressEnabled(false);
        mHasDistinctMultitouch = systemHasMultitouch(context);
        Log.d(getKeyboardViewNameForLogging(), "mHasDistinctMultitouch : "+mHasDistinctMultitouch);
        mKeyRepeatInterval = 50;
        Log.i(getKeyboardViewNameForLogging(), "Created keyboard view of type "+getKeyboardViewNameForLogging());
    }


Input:
    private C2DMConfig getDataMessagingConfig(PersistenceManager pm) {
        Key key = KeyFactory.createKey(C2DMConfig.class.getSimpleName(), 1);
        C2DMConfig dmConfig = null;
        try {
            dmConfig = pm.getObjectById(C2DMConfig.class, key);
        } catch (JDOObjectNotFoundException e) {
            dmConfig = new C2DMConfig();
            dmConfig.setKey(key);
            try {
                InputStream is = this.getClass().getClassLoader().getResourceAsStream("/dataMessagingToken.txt");
                if (is != null) {
                    BufferedReader reader = new BufferedReader(new InputStreamReader(is));
                    String token = reader.readLine();
                    dmConfig.setAuthToken(token);
                }
            } catch (Throwable t) {
                log.log(Level.SEVERE,
                        "Can't load initial token, use admin console", t);
            }
            pm.makePersistent(dmConfig);
        }
        return dmConfig;
    }

Output:
    private C2DMConfig getDataMessagingConfig(PersistenceManager pm) {
        Key key = KeyFactory.createKey(C2DMConfig.class.getSimpleName(), 1);
        C2DMConfig dmConfig = null;
        try {
            dmConfig = pm.getObjectById(C2DMConfig.class, key);
        } catch (JDOObjectNotFoundException e) {
            dmConfig = new C2DMConfig();
            dmConfig.setKey(key);
            try {
                InputStream is = this.getClass().getClassLoader().getResourceAsStream("dataMessagingToken.txt");
                if (is != null) {
                    BufferedReader reader = new BufferedReader(new InputStreamReader(is));
                    String token = reader.readLine();
                    dmConfig.setAuthToken(token);
                }
            } catch (Throwable t) {
                log.log(Level.SEVERE,
                        "Can't load initial token, use admin console", t);
            }
            pm.makePersistent(dmConfig);
        }
        return dmConfig;
    }