auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public HdfsToTeradataJobRunnerMain() throws FileNotFoundException, IOException { _logger = JobUtils.initJobLogger(); _jobProps = HadoopSecureWrapperUtils.loadAzkabanProps(); _jobProps.put(HadoopSecurityManager.ENABLE_PROXYING, "true"); Props props = new Props(null, _jobProps); HadoopConfigurationInjector.injectResources(props); UserGroupInformation.setConfiguration(new Configuration()); props.getString(HadoopSecurityManager.USER_TO_PROXY); _params = TdchParameters.builder() .mrParams(TdchConstants.MAP_REDUCE_PARAMS) .libJars(props.getString(TdchConstants.LIB_JARS_KEY)) .tdJdbcClassName(TdchConstants.TERADATA_JDBCDRIVER_CLASSNAME) .teradataHostname(props.getString(TdchConstants.TD_HOSTNAME_KEY)) .fileFormat(_jobProps.getProperty(TdchConstants.HDFS_FILE_FORMAT_KEY)) .fieldSeparator(_jobProps.getProperty(TdchConstants.HDFS_FIELD_SEPARATOR_KEY)) .jobType(TdchConstants.TDCH_JOB_TYPE) .userName(props.getString(TdchConstants.TD_USERID_KEY)) .tdPassword(String.format(TdchConstants.TD_WALLET_FORMAT, props.getString(TdchConstants.TD_USERID_KEY))) .avroSchemaPath(_jobProps.getProperty(TdchConstants.AVRO_SCHEMA_PATH_KEY)) .sourceHdfsPath(props.getString(TdchConstants.SOURCE_HDFS_PATH_KEY)) .targetTdTableName(props.getString(TdchConstants.TARGET_TD_TABLE_NAME_KEY)) .tdInsertMethod(_jobProps.getProperty(TdchConstants.TD_INSERT_METHOD_KEY)) .numMapper(DEFAULT_NO_MAPPERS) .build(); }

Target:
public HdfsToTeradataJobRunnerMain() throws FileNotFoundException, IOException { _logger = JobUtils.initJobLogger(); _jobProps = HadoopSecureWrapperUtils.loadAzkabanProps(); Props props = new Props(null, _jobProps); HadoopConfigurationInjector.injectResources(props); UserGroupInformation.setConfiguration(new Configuration()); _params = TdchParameters.builder() .mrParams(_jobProps.getProperty(TdchConstants.HADOOP_CONFIG_KEY)) .libJars(props.getString(TdchConstants.LIB_JARS_KEY)) .tdJdbcClassName(TdchConstants.TERADATA_JDBCDRIVER_CLASSNAME) .teradataHostname(props.getString(TdchConstants.TD_HOSTNAME_KEY)) .fileFormat(_jobProps.getProperty(TdchConstants.HDFS_FILE_FORMAT_KEY)) .fieldSeparator(_jobProps.getProperty(TdchConstants.HDFS_FIELD_SEPARATOR_KEY)) .jobType(TdchConstants.TDCH_JOB_TYPE) .userName(props.getString(TdchConstants.TD_USERID_KEY)) .tdPassword(String.format(TdchConstants.TD_WALLET_FORMAT, props.getString(TdchConstants.TD_USERID_KEY))) .avroSchemaPath(_jobProps.getProperty(TdchConstants.AVRO_SCHEMA_PATH_KEY)) .sourceHdfsPath(props.getString(TdchConstants.SOURCE_HDFS_PATH_KEY)) .targetTdTableName(props.getString(TdchConstants.TARGET_TD_TABLE_NAME_KEY)) .tdInsertMethod(_jobProps.getProperty(TdchConstants.TD_INSERT_METHOD_KEY)) .numMapper(DEFAULT_NO_MAPPERS) .build(); }
Source:
public static CompositeBlobInfo deserializeMetadataContentRecord(DataInputStream stream, StoreKeyFactory storeKeyFactory) throws IOException { List<Pair<StoreKey, Long>> keysAndContentSizes = new ArrayList<>(); stream.readLong(); int numberOfKeys = stream.readInt(); for (int i = 0; i < numberOfKeys; i++) { long contentSize = stream.readLong(); StoreKey storeKey = storeKeyFactory.getStoreKey(stream); keysAndContentSizes.add(new Pair<>(storeKey, contentSize)); } return new CompositeBlobInfo(keysAndContentSizes); }

Target:
public static CompositeBlobInfo deserializeMetadataContentRecord(DataInputStream stream, StoreKeyFactory storeKeyFactory) throws IOException { List<Pair<StoreKey, Long>> keysAndContentSizes = new ArrayList<>(); long totalSize = stream.readLong(); long sum = 0; int numberOfKeys = stream.readInt(); for (int i = 0; i < numberOfKeys; i++) { long contentSize = stream.readLong(); StoreKey storeKey = storeKeyFactory.getStoreKey(stream); keysAndContentSizes.add(new Pair<>(storeKey, contentSize)); sum += contentSize; } if (sum != totalSize) { throw new IllegalArgumentException("Key content sizes do not equal total size"); } return new CompositeBlobInfo(keysAndContentSizes); }
Source:
static File getLastExecVersionFile() { return new File(Jenkins.getInstance().getRootDir(), "last_run_version"); }

Target:
static File getLastExecVersionFile() { return new File(Jenkins.getInstance().getRootDir(), "jenkins.install.InstallUtil.lastExecVersion"); }
Source:
public void hasActiveIDs() throws Exception { TransformerFactory factory = TransformerFactory.newInstance(); File xslt_file = new File(getClass().getClassLoader().getResource("library_patron.xsl").getFile()); Source xslt = new StreamSource(xslt_file); Transformer transformer = factory.newTransformer(xslt); File patron_file = new File(this.getClass().getResource("/patron_one.xml").getFile()); Source text = new StreamSource(patron_file); StringWriter outWriter = new StringWriter(); transformer.transform(text, new StreamResult(outWriter)); StringBuffer sb = outWriter.getBuffer(); String symphony_user_rec = sb.toString(); File fixture_record = new File(this.getClass().getResource("/symph_user_one").getFile()); System.out.println(fixture_record.getAbsolutePath()); String filePath = fixture_record.getPath(); assertEquals(symphony_user_rec, fileToString(filePath)); }

Target:
public void hasActiveIDs() throws Exception { String symphony_user_rec = symphonyUserRecord(new File(this.getClass().getResource("/patron_one.xml").getFile())); File fixture_record = new File(this.getClass().getResource("/symph_user_one").getFile()); String filePath = fixture_record.getPath(); assertEquals(symphony_user_rec, fileToString(filePath)); }
Source:
public HttpWebResponse send() throws IOException { Logger.v(TAG, "HttpWebRequest send thread:" + Process.myTid()); final HttpURLConnection connection = setupConnection(); if (connection == null) { return null; } final HttpWebResponse response; try { InputStream responseStream = null; try { responseStream = connection.getInputStream(); } catch (IOException ex) { Logger.e(TAG, "IOException:" + ex.getMessage(), "", ADALError.SERVER_ERROR); responseStream = connection.getErrorStream(); if (responseStream == null) { throw ex; } } final int statusCode = getStatusCode(connection); byte[] responseBody = null; if (responseStream != null) { ByteArrayOutputStream byteStream = new ByteArrayOutputStream(); byte[] buffer = new byte[4096]; int bytesRead = -1; while ((bytesRead = responseStream.read(buffer)) > 0) { byteStream.write(buffer, 0, bytesRead); } responseBody = byteStream.toByteArray(); } if (Debug.isDebuggerConnected() && sDebugSimulateDelay > 0) { Logger.v(TAG, "Sleeping to simulate slow network response"); try { Thread.sleep(sDebugSimulateDelay); } catch (InterruptedException e) { Logger.v(TAG, "Thread.sleep got interrupted exception " + e); } } Logger.v(TAG, "Response is received"); response = new HttpWebResponse(statusCode, responseBody, connection.getHeaderFields()); } finally { connection.disconnect(); } return response; }

Target:
public HttpWebResponse send() throws IOException { Logger.v(TAG, "HttpWebRequest send thread:" + Process.myTid()); final HttpURLConnection connection = setupConnection(); final HttpWebResponse response; InputStream responseStream = null; try { try { responseStream = connection.getInputStream(); } catch (IOException ex) { Logger.e(TAG, "IOException:" + ex.getMessage(), "", ADALError.SERVER_ERROR); responseStream = connection.getErrorStream(); if (responseStream == null) { throw ex; } } final int statusCode = getStatusCode(connection); final String responseBody = convertStreamToString(responseStream); if (Debug.isDebuggerConnected() && sDebugSimulateDelay > 0) { Logger.v(TAG, "Sleeping to simulate slow network response"); try { Thread.sleep(sDebugSimulateDelay); } catch (InterruptedException e) { Logger.v(TAG, "Thread.sleep got interrupted exception " + e); } } Logger.v(TAG, "Response is received"); response = new HttpWebResponse(statusCode, responseBody, connection.getHeaderFields()); } finally { safeCloseStream(responseStream); connection.disconnect(); } return response; }
Source:
public ObservableList<File> getAuxclasspathFiles() { return auxclasspathFiles; }

Target:
public String getAuxclasspathFiles() { return auxclasspathFiles.getValue().stream().map(p -> p.getAbsolutePath()).collect(Collectors.joining(File.pathSeparator)); }
Source:
public synchronized <T extends HasMetadata> SharedIndexInformer<T> sharedIndexInformerForCustomResource(Class<T> apiTypeClass, OperationContext operationContext, long resyncPeriodInMillis) { return sharedIndexInformerFor(apiTypeClass, CustomResourceOperationsImpl.inferListType(apiTypeClass), operationContext.withPlural(CustomResourceDefinitionContext.fromCustomResourceType(apiTypeClass).getPlural()), resyncPeriodInMillis); }

Target:
public synchronized <T extends CustomResource> SharedIndexInformer<T> sharedIndexInformerForCustomResource(Class<T> apiTypeClass, OperationContext operationContext, long resyncPeriodInMillis) { return sharedIndexInformerFor(apiTypeClass, CustomResourceOperationsImpl.inferListType(apiTypeClass), operationContext, resyncPeriodInMillis); }
Source:
HllSketchAggregatorFactory(final String name, final String fieldName, @Nullable final Integer lgK, @Nullable final String tgtHllType) { if (name == null) { throw new IAE("Aggregator name must be specified"); } this.name = name; if (fieldName == null) { throw new IAE("Parameter fieldName must be specified"); } this.fieldName = fieldName; this.lgK = lgK == null ? DEFAULT_LG_K : lgK; this.tgtHllType = tgtHllType == null ? DEFAULT_TGT_HLL_TYPE : TgtHllType.valueOf(tgtHllType); }

Target:
HllSketchAggregatorFactory( final String name, final String fieldName, @Nullable final Integer lgK, @Nullable final String tgtHllType ) { this.name = Objects.requireNonNull(name); this.fieldName = Objects.requireNonNull(fieldName); this.lgK = lgK == null ? DEFAULT_LG_K : lgK; this.tgtHllType = tgtHllType == null ? DEFAULT_TGT_HLL_TYPE : TgtHllType.valueOf(tgtHllType); }
Source:
public V3X509CertificateGenerator(Date startDate, X509Principal issuerDn, X509Principal subjectDn, PublicKey publicKey, BigInteger serialNumber) { X509V3CertificateGenerator gen = new X509V3CertificateGenerator(); gen.reset(); gen.setSignatureAlgorithm("SHA256WithRSAEncryption"); gen.setNotBefore(startDate); DateTime now = new DateTime(new Date()); gen.setNotAfter(now.plusYears(YEARS).toDate()); gen.setIssuerDN(issuerDn); gen.setSubjectDN(subjectDn); gen.setPublicKey(publicKey); gen.setSerialNumber(serialNumber); this.v3CertGen = gen; }

Target:
public V3X509CertificateGenerator(Date startDate, X509Principal issuerDn, X509Principal subjectDn, PublicKey publicKey, BigInteger serialNumber) { X509V3CertificateGenerator gen = new X509V3CertificateGenerator(); gen.reset(); gen.setSignatureAlgorithm(new SystemEnvironment().get(GO_SSL_CERTS_PUBLIC_KEY_ALGORITHM)); gen.setNotBefore(startDate); DateTime now = new DateTime(new Date()); gen.setNotAfter(now.plusYears(YEARS).toDate()); gen.setIssuerDN(issuerDn); gen.setSubjectDN(subjectDn); gen.setPublicKey(publicKey); gen.setSerialNumber(serialNumber); this.v3CertGen = gen; }
Source:
private SimpleTableDef detectSchema(String url, String indexName) { SimpleTableDef tableDef = null; url += "/schema"; try { HttpClient httpclient = new DefaultHttpClient(); HttpGet request = new HttpGet(url); HttpResponse response = httpclient.execute(request); InputStreamReader inputStream = new InputStreamReader(response .getEntity().getContent()); ObjectReader reader = new ObjectMapper().reader(HashMap.class); Map<String, Object> outerMap = reader.readValue(inputStream); Map<String, Object> schemaMap = (Map) outerMap.get("schema"); if (outerMap != null) { List<Map<String, String>> fieldMapList = (List) schemaMap .get("fields"); List<String> columnNames = new ArrayList<String>(); List<ColumnType> columnTypes = new ArrayList<ColumnType>(); for (int i = 0; i < fieldMapList.size(); i++) { Map<String, String> fieldMap = fieldMapList.get(i); columnNames.add(fieldMap.get("name")); columnTypes.add(ColumnType.VARCHAR); } String[] columnNamesArr = new String[columnNames.size()]; columnNamesArr = columnNames.toArray(columnNamesArr); ColumnType[] columnTypesArr = new ColumnType[columnTypes.size()]; columnTypesArr = columnTypes.toArray(columnTypesArr); tableDef = new SimpleTableDef(indexName, columnNamesArr, columnTypesArr); } } catch (IOException e) { logger.error("Failed to parse schema", "", e); } return tableDef; }

Target:
private SimpleTableDef detectSchema(String url, String indexName) { SimpleTableDef tableDef = null; url += "/schema"; try { HttpClient httpclient = new DefaultHttpClient(); HttpGet request = new HttpGet(url); HttpResponse response = httpclient.execute(request); InputStreamReader inputStream = new InputStreamReader(response .getEntity().getContent()); ObjectReader reader = new ObjectMapper().reader(HashMap.class); Map<String, Object> outerMap = reader.readValue(inputStream); Map<String, Object> schemaMap = null; if (outerMap != null) { schemaMap = (Map) outerMap.get("schema"); } if (schemaMap != null) { List<Map<String, String>> fieldMapList = (List) schemaMap .get("fields"); List<String> columnNames = new ArrayList<String>(); List<ColumnType> columnTypes = new ArrayList<ColumnType>(); for (int i = 0; i < fieldMapList.size(); i++) { Map<String, String> fieldMap = fieldMapList.get(i); columnNames.add(fieldMap.get("name")); columnTypes.add(ColumnType.STRING); } String[] columnNamesArr = new String[columnNames.size()]; columnNamesArr = columnNames.toArray(columnNamesArr); ColumnType[] columnTypesArr = new ColumnType[columnTypes.size()]; columnTypesArr = columnTypes.toArray(columnTypesArr); tableDef = new SimpleTableDef(indexName, columnNamesArr, columnTypesArr); } } catch (IOException e) { logger.error("Failed to parse schema", "", e); } return tableDef; }
Source:
public void stop() { cacheNotifier.getListenerCollectionForAnnotation(CacheEntryActivated.class).removeAll(filteringInvocations.values()); cacheNotifier.getListenerCollectionForAnnotation(CacheEntryCreated.class).removeAll(filteringInvocations.values()); cacheNotifier.getListenerCollectionForAnnotation(CacheEntryInvalidated.class).removeAll(filteringInvocations.values()); cacheNotifier.getListenerCollectionForAnnotation(CacheEntryLoaded.class).removeAll(filteringInvocations.values()); cacheNotifier.getListenerCollectionForAnnotation(CacheEntryModified.class).removeAll(filteringInvocations.values()); cacheNotifier.getListenerCollectionForAnnotation(CacheEntryPassivated.class).removeAll(filteringInvocations.values()); cacheNotifier.getListenerCollectionForAnnotation(CacheEntryRemoved.class).removeAll(filteringInvocations.values()); cacheNotifier.getListenerCollectionForAnnotation(CacheEntryVisited.class).removeAll(filteringInvocations.values()); cacheNotifier.getListenerCollectionForAnnotation(CacheEntryEvicted.class).removeAll(filteringInvocations.values()); filteringInvocations.clear(); }

Target:
public void stop() { cacheNotifier.getListenerCollectionForAnnotation(CacheEntryActivated.class).removeAll(filteringInvocations.values()); cacheNotifier.getListenerCollectionForAnnotation(CacheEntryCreated.class).removeAll(filteringInvocations.values()); cacheNotifier.getListenerCollectionForAnnotation(CacheEntryInvalidated.class).removeAll(filteringInvocations.values()); cacheNotifier.getListenerCollectionForAnnotation(CacheEntryLoaded.class).removeAll(filteringInvocations.values()); cacheNotifier.getListenerCollectionForAnnotation(CacheEntryModified.class).removeAll(filteringInvocations.values()); cacheNotifier.getListenerCollectionForAnnotation(CacheEntryPassivated.class).removeAll(filteringInvocations.values()); cacheNotifier.getListenerCollectionForAnnotation(CacheEntryRemoved.class).removeAll(filteringInvocations.values()); cacheNotifier.getListenerCollectionForAnnotation(CacheEntryVisited.class).removeAll(filteringInvocations.values()); cacheNotifier.getListenerCollectionForAnnotation(CacheEntriesEvicted.class).removeAll(filteringInvocations.values()); cacheNotifier.getListenerCollectionForAnnotation(CacheEntryEvicted.class).removeAll(filteringInvocations.values()); filteringInvocations.clear(); }
Source:
public void reset() { this.currentKey = null; this.cells = new TreeMap<>(); this.family = null; this.qualifier = null; this.labels = null; this.timestamp = 0L; this.value = null; this.previousFamily = null; this.totalCellCount = 0; }

Target:
public void reset() { this.currentKey = null; this.family = null; this.qualifier = null; this.labels = null; this.timestamp = 0L; this.value = null; this.cells = new TreeMap<>(); this.currentFamilyCells = null; this.previousFamily = null; this.totalCellCount = 0; }
Source:
protected void showDialog(Bundle state) { super.showDialog(state); final AlertDialog dialog = (AlertDialog) getDialog(); final Button positiveButton = dialog.getButton(DialogInterface.BUTTON_POSITIVE); if (positiveButton != null) { positiveButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { callChangeListener(getEditText().getText()); dialog.dismiss(); } }); positiveButton.setTextColor(ContextCompat.getColorStateList(getContext(), R.color.primary_400_neutral_400_selector)); getEditText().addTextChangedListener(new TextWatcher() { @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { } @Override public void onTextChanged(CharSequence s, int start, int before, int count) { } @Override public void afterTextChanged(Editable s) { switch (mValidationType) { case NONE: break; case EMAIL: positiveButton.setEnabled(ValidationUtils.validateEmail(s)); break; case PASSWORD: positiveButton.setEnabled(ValidationUtils.validatePassword(s)); break; case URL: positiveButton.setEnabled(ValidationUtils.validateUrl(s)); break; case NOT_EMPTY: positiveButton.setEnabled(!s.toString().isEmpty()); } } }); } CharSequence summary = getSummary(); if (summary == null || summary.equals(mStringToIgnoreForPrefilling)) { getEditText().setText(""); } else { getEditText().setText(summary); getEditText().setSelection(0, summary.length()); } hideInputCharacters(mValidationType == ValidationType.PASSWORD); }

Target:
protected void showDialog(Bundle state) { super.showDialog(state); final AlertDialog dialog = (AlertDialog) getDialog(); final Button positiveButton = dialog.getButton(DialogInterface.BUTTON_POSITIVE); if (positiveButton != null) { positiveButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { callChangeListener(getEditText().getText()); dialog.dismiss(); } }); positiveButton.setTextColor(ContextCompat.getColorStateList(getContext(), R.color.primary_400_neutral_400_selector)); getEditText().addTextChangedListener(new TextWatcher() { @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { } @Override public void onTextChanged(CharSequence s, int start, int before, int count) { } @Override public void afterTextChanged(Editable s) { switch (mValidationType) { case NONE: break; case EMAIL: positiveButton.setEnabled(ValidationUtils.validateEmail(s)); break; case PASSWORD: positiveButton.setEnabled(ValidationUtils.validatePassword(s)); break; case URL: positiveButton.setEnabled(ValidationUtils.validateUrl(s)); break; case PASSWORD_SELF_HOSTED: positiveButton.setEnabled(ValidationUtils.validatePasswordSelfHosted(s)); } } }); } CharSequence summary = getSummary(); if (summary == null || summary.equals(mStringToIgnoreForPrefilling)) { getEditText().setText(""); } else { getEditText().setText(summary); getEditText().setSelection(0, summary.length()); } hideInputCharacters( mValidationType == ValidationType.PASSWORD || mValidationType == ValidationType.PASSWORD_SELF_HOSTED); }
Source:
protected void executeCommand() { CopyHostNetworksHelper helper = getCopyHostNetworksHelper(); helper.clearDestinationHost(); helper.prepareBondsAndCopyNicAttachments(); helper.createDestinationBondDefinitionsAndCopyAttachments(); helper.resuseAttachmentsOnDestination(); var setupNetworksParameters = new HostSetupNetworksParameters(getParameters().getVdsId()); setupNetworksParameters.setRemovedBonds(helper.getBondsToRemove()); setupNetworksParameters.setRemovedNetworkAttachments(helper.getAttachmentsToRemove()); setupNetworksParameters.setNetworkAttachments(helper.getAttachmentsToApply()); setupNetworksParameters.setCreateOrUpdateBonds(helper.getBondsToApply()); setupNetworksParameters.setCommitOnSuccess(true); ActionReturnValue returnValue = runInternalAction(ActionType.HostSetupNetworks, setupNetworksParameters, cloneContextAndDetachFromParent()); if (!returnValue.getSucceeded()) { propagateFailure(returnValue); } setSucceeded(returnValue.getSucceeded()); }

Target:
protected void executeCommand() { CopyHostNetworksHelper helper = getCopyHostNetworksHelper(); helper.buildDestinationConfig(); var setupNetworksParameters = new HostSetupNetworksParameters(getParameters().getVdsId()); setupNetworksParameters.setRemovedBonds(helper.getBondsToRemove()); setupNetworksParameters.setRemovedNetworkAttachments(helper.getAttachmentsToRemove()); setupNetworksParameters.setNetworkAttachments(helper.getAttachmentsToApply()); setupNetworksParameters.setCreateOrUpdateBonds(helper.getBondsToApply()); setupNetworksParameters.setCommitOnSuccess(true); ActionReturnValue returnValue = runInternalAction(ActionType.HostSetupNetworks, setupNetworksParameters, cloneContextAndDetachFromParent()); if (!returnValue.getSucceeded()) { propagateFailure(returnValue); } setSucceeded(returnValue.getSucceeded()); }
Source:
public void testParameterIsNull() throws SQLException{ long now = System.currentTimeMillis(); PreparedStatement insertStmt = con.prepareStatement("INSERT INTO " + TEST_TABLE + " VALUES (?, ?)"); insertStmt.setTimestamp(1, new java.sql.Timestamp(now++)); insertStmt.setTimestamp(2, new java.sql.Timestamp(now++)); assertEquals(1, insertStmt.executeUpdate()); insertStmt.setTimestamp(1, new java.sql.Timestamp(now++)); insertStmt.setTimestamp(2, new java.sql.Timestamp(now++)); assertEquals(1, insertStmt.executeUpdate()); insertStmt.setTimestamp(1, new java.sql.Timestamp(now++)); insertStmt.setTimestamp(2, new java.sql.Timestamp(now++)); assertEquals(1, insertStmt.executeUpdate()); insertStmt.close(); PreparedStatement selectStmt = con.prepareStatement("Select * from " + TEST_TABLE + " Where ts = ? or ? is null"); selectStmt.setTimestamp(1, new java.sql.Timestamp(now++)); selectStmt.setTimestamp(2, new java.sql.Timestamp(now++)); ResultSet rs1 = selectStmt.executeQuery(); assertFalse(rs1.next()); rs1.close(); selectStmt.setTimestamp(1, new java.sql.Timestamp(now++)); selectStmt.setTimestamp(2, null); ResultSet rs2 = selectStmt.executeQuery(); assertTrue(rs2.next()); assertTrue(rs2.next()); assertTrue(rs2.next()); assertFalse(rs2.next()); rs2.close(); selectStmt.close(); }

Target:
public void testParameterIsNull() throws SQLException{ long moment = 1450276739098L; PreparedStatement insertStmt = con.prepareStatement("INSERT INTO " + TEST_TABLE + " VALUES (?, ?)"); int testRows = 3; for(int i = 0; i < testRows; i++){ insertStmt.setTimestamp(1, new java.sql.Timestamp(moment++)); insertStmt.setTimestamp(2, new java.sql.Timestamp(moment++)); assertEquals("insert in " + TEST_TABLE + " failed", 1, insertStmt.executeUpdate()); } insertStmt.close(); PreparedStatement selectStmt = con.prepareStatement("Select * from " + TEST_TABLE + " Where ts = ? or ? is null"); selectStmt.setTimestamp(1, new java.sql.Timestamp(moment++)); selectStmt.setTimestamp(2, new java.sql.Timestamp(moment++)); ResultSet rs1 = selectStmt.executeQuery(); int rows1 = 0; while(rs1.next()){ ++rows1; } rs1.close(); assertEquals("Particular moment is found in " + TEST_TABLE, 0, rows1); selectStmt.setTimestamp(1, new java.sql.Timestamp(moment++)); selectStmt.setTimestamp(2, null); ResultSet rs2 = selectStmt.executeQuery(); int rows2 = 0; while(rs2.next()){ ++rows2; } rs2.close(); assertEquals("Not all records are fetched from " + TEST_TABLE, testRows, rows2); selectStmt.close(); }
Source:
public void update(CruiseConfig modifiedConfig) throws Exception { SCMs scms = modifiedConfig.getSCMs(); SCM scm = scms.find(globalScmConfig.getSCMId()); if (scm != null) { scm.setAutoUpdate(globalScmConfig.isAutoUpdate()); scm.setConfiguration(globalScmConfig.getConfiguration()); } else { result.notFound(LocalizedMessage.string("SCM_MATERIAL_NOT_FOUND"), HealthStateType.notFound()); throw new NullPointerException("The pluggable SCM Material is not found"); } }

Target:
public void update(CruiseConfig modifiedConfig) throws Exception { SCMs scms = modifiedConfig.getSCMs(); SCM scm = scms.find(globalScmConfig.getSCMId()); if (scm != null) { scm.setAutoUpdate(globalScmConfig.isAutoUpdate()); scm.setConfiguration(globalScmConfig.getConfiguration()); } else { result.notFound(LocalizedMessage.string("SCM_MATERIAL_NOT_FOUND"), HealthStateType.notFound()); throw new NullPointerException(String.format("The pluggable scm material with id '%s' is not found.", globalScmConfig.getSCMId())); } }
Source:
public DiskSpaceRequirements(long segmentSizeInBytes, long segmentsNeeded, long swapSegmentsInUse) { if (segmentSizeInBytes < 0 || segmentsNeeded < 0 || swapSegmentsInUse < 0) { throw new IllegalArgumentException( "Arguments cannot be negative. segmentSizeInBytes: " + segmentSizeInBytes + ", segmentsNeeded: " + segmentsNeeded + ", swapSegmentsInUse: " + swapSegmentsInUse); } this.segmentSizeInBytes = segmentSizeInBytes; this.segmentsNeeded = segmentsNeeded; this.swapSegmentsInUse = swapSegmentsInUse; }

Target:
DiskSpaceRequirements(long segmentSizeInBytes, long segmentsNeeded, long swapSegmentsInUse) { if (segmentSizeInBytes <= 0 || segmentsNeeded < 0 || swapSegmentsInUse < 0) { throw new IllegalArgumentException( "Arguments cannot be negative. segmentSizeInBytes: " + segmentSizeInBytes + ", segmentsNeeded: " + segmentsNeeded + ", swapSegmentsInUse: " + swapSegmentsInUse); } this.segmentSizeInBytes = segmentSizeInBytes; this.segmentsNeeded = segmentsNeeded; this.swapSegmentsInUse = swapSegmentsInUse; }
Source:
private void userHasLogin() { finish(); startActivity(new Intent(this, MainActivity.class)); }

Target:
private void userHasLogin() { startActivity(new Intent(this, MainActivity.class)); finish(); }
Source:
public List<String> tabComplete(CommandSender sender, String alias, String[] args) throws IllegalArgumentException { Validate.notNull(sender, "Sender cannot be null", new Object[0]); Validate.notNull(args, "Arguments cannot be null", new Object[0]); Validate.notNull(alias, "Alias cannot be null", new Object[0]); if (args.length == 1) { String arg = args[0]; ArrayList<String> completion = new ArrayList<>(); for (EntityType type : EntityType.values()) { if (!checkSummon(null, type)) { continue; } if (StringUtils.startsWithIgnoreCase(type.getName(), arg)) { completion.add(type.getName()); } } return completion; } else { return ImmutableList.of(); } }

Target:
public List<String> tabComplete(CommandSender sender, String alias, String[] args) throws IllegalArgumentException { Validate.notNull(sender, "Sender cannot be null", new Object[0]); Validate.notNull(args, "Arguments cannot be null", new Object[0]); Validate.notNull(alias, "Alias cannot be null", new Object[0]); if (args.length == 1) { String arg = args[0]; ArrayList<String> completion = new ArrayList<>(); for (EntityType type : EntityType.values()) { if (checkSummon(null, type) && StringUtils.startsWithIgnoreCase(type.getName(), arg)) { completion.add(type.getName()); } } return completion; } else { return ImmutableList.of(); } }
Source:
private List<InetSocketAddress> parseAddresses(String addressString) { List<InetSocketAddress> addresses = new ArrayList<>(); for (String address : addressString.split(",")) { addresses.add(new InetSocketAddress(address.split(":")[0], Integer.valueOf(address.split(":")[1]))); } return addresses; }

Target:
private List<InetSocketAddress> parseAddresses(String addressString) { List<InetSocketAddress> addresses = new ArrayList<>(); Map<String, String> ipPortMap = Splitter.on(",").omitEmptyStrings().trimResults() .withKeyValueSeparator(":").split(addressString); for (Map.Entry<String, String> ipPort : ipPortMap.entrySet()) { int port; try { port = Integer.valueOf(ipPort.getValue()); } catch (NumberFormatException e) { throw new IllegalArgumentException(String.format("Port should be an integer : %s", ipPort.getValue()), e); } addresses.add(new InetSocketAddress(ipPort.getKey(), port)); } return addresses; }
Source:
public void testAsyncCallAllPartitionProcedureWithStringPartition() throws Exception{ Client client = getClient(); client.callAllPartitionProcedure(new CallBack(STRING_PARTITION_EXPECTED_COUNTS), "PartitionStringTestProc"); Thread.sleep(2000); }

Target:
public void testAsyncCallAllPartitionProcedureWithStringPartition() throws Exception{ Client client = getClient(); CallBack cb = new CallBack(STRING_PARTITION_EXPECTED_COUNTS); client.callAllPartitionProcedure(cb, "PartitionStringTestProc"); Thread.sleep(2000); assertTrue(cb.m_callbackInvoked); }
Source:
public void createRequestContextSubscriberWhenParentContextHasDataHolderThenShouldReuseParentContext() throws Exception { RequestContextDataHolder testValue = mock(RequestContextDataHolder.class); final Context parentContext = Context.of(RequestContextSubscriber.REQUEST_CONTEXT_DATA_HOLDER, testValue); BaseSubscriber<Object> parent = new BaseSubscriber<Object>() { @Override public Context currentContext() { return parentContext; } }; RequestContextSubscriber<Object> requestContextSubscriber = new RequestContextSubscriber<>(parent, null, null, authentication); Context resultContext = requestContextSubscriber.currentContext(); assertThat(resultContext) .describedAs("parent context was replaced") .isSameAs(parentContext); }

Target:
public void createRequestContextSubscriberWhenParentContextHasDataHolderThenShouldReuseParentContext() throws Exception { RequestContextDataHolder testValue = new RequestContextDataHolder(null, null, null); final Context parentContext = Context.of(RequestContextSubscriber.REQUEST_CONTEXT_DATA_HOLDER, testValue); BaseSubscriber<Object> parent = new BaseSubscriber<Object>() { @Override public Context currentContext() { return parentContext; } }; RequestContextSubscriber<Object> requestContextSubscriber = new RequestContextSubscriber<>(parent, null, null, authentication); Context resultContext = requestContextSubscriber.currentContext(); assertThat(resultContext) .describedAs("parent context was replaced") .isSameAs(parentContext); }
Source:
LRESULT wmTimer (long wParam, long lParam) { checkWidget (); if (wParam == ID_TOOLTIP_TIMER) { POINT pt = new POINT (); OS.GetCursorPos (pt); if (selectedMenuItem != null) { RECT rect = new RECT (); OS.GetMenuItemRect (0, selectedMenuItem.parent.handle, selectedMenuItem.index, rect); if (OS.PtInRect (rect, pt)) { selectedMenuItem.showTooltip (pt.x, pt.y + OS.GetSystemMetrics(OS.SM_CYCURSOR) / 2 + 5); } else { selectedMenuItem.showTooltip ((rect.right + rect.left) / 2, rect.bottom + 5); } } } return null; }

Target:
LRESULT wmTimer (long wParam, long lParam) { if (wParam == ID_TOOLTIP_TIMER) { POINT pt = new POINT (); OS.GetCursorPos (pt); if (selectedMenuItem != null) { RECT rect = new RECT (); OS.GetMenuItemRect (0, selectedMenuItem.parent.handle, selectedMenuItem.index, rect); if (OS.PtInRect (rect, pt)) { selectedMenuItem.showTooltip (pt.x, pt.y + OS.GetSystemMetrics(OS.SM_CYCURSOR) / 2 + 5); } else { selectedMenuItem.showTooltip ((rect.right + rect.left) / 2, rect.bottom + 5); } } } return null; }
Source:
public void tearUp() { IPath path = Activator.getDefault().getStateLocation(); File dir = path.toFile(); if (!dir.exists() || !dir.isDirectory()) { return; } path = path.addTrailingSeparator().append(SESSION_FILENAME).addFileExtension(SessionConfigStrings.DEFAULT_SESSION_CONFIG_FILE_EXTENSION); File sessionConfigurationFile = path.toFile(); if(sessionConfigurationFile.exists()) { sessionConfigurationFile.delete(); } }

Target:
public void tearUp() { File sessionConfigurationFile = fSessionFilePath.toFile(); if (sessionConfigurationFile.exists()) { sessionConfigurationFile.delete(); } fValidRequirements.clear(); }
Source:
public Response deleteApplicationMember( @Parameter(name = "user", required = true) @NotNull @QueryParam("user") String userId) { applicationService.findById(application); try { userService.findById(userId); } catch (UserNotFoundException unfe) { return Response.status(Response.Status.BAD_REQUEST).entity(unfe.getMessage()).build(); } membershipService.deleteReferenceMember(MembershipReferenceType.APPLICATION, application, MembershipMemberType.USER, userId); return Response.noContent().build(); }

Target:
public Response deleteApplicationMember( @Parameter(name = "user", required = true) @NotNull @QueryParam("user") String userId) { applicationService.findById(application); try { userService.findById(userId); } catch (UserNotFoundException unfe) { return Response.status(Response.Status.BAD_REQUEST).entity(unfe.getMessage()).build(); } membershipService.deleteReferenceMember(MembershipReferenceType.APPLICATION, application, MembershipMemberType.USER, userId); return Response.ok().build(); }
Source:
private static Iterable<String> head(final Response origin, final int status, final CharSequence reason) throws IOException { if (status < 100 || status > 999) { throw new IllegalArgumentException( String.format( "according to RFC 7230 HTTP status code must have three digits: %d", status ) ); } return new Concat<String>( Collections.singleton( String.format("HTTP/1.1 %d %s", status, reason) ), new Concat<String>( origin.head(), Collections.EMPTY_LIST, new Condition<String>() { private boolean first = true; @Override public boolean add(final String element) { final boolean ret = this.first; if (this.first) { this.first = false; } return !ret; } } ) ); }

Target:
private static Iterable<String> head(final Response origin, final int status, final CharSequence reason) throws IOException { if (status < 100 || status > 999) { throw new IllegalArgumentException( String.format( "according to RFC 7230 HTTP status code must have three digits: %d", status ) ); } return new Concat<String>( Collections.singleton( String.format("HTTP/1.1 %d %s", status, reason) ), new Select<String>( origin.head(), new Condition<String>() { private boolean first = true; @Override public boolean fits(final String element) { final boolean ret = this.first; if (this.first) { this.first = false; } return !ret; } } ) ); }
Source:
public void updateConditionFromEntity(boolean checkForDestruction) { if(null != unit) { if(IArmorState.ARMOR_DESTROYED == unit.getEntity().getInternal(loc)) { remove(false); } else { damage = Math.max(unit.getEntity().getOInternal(loc) - unit.getEntity().getInternal(loc), 0); if(unit.isLocationBreached(loc)) { breached = true; } } } }

Target:
public void updateConditionFromEntity(boolean checkForDestruction) { if(null != unit) { if(IArmorState.ARMOR_DESTROYED == unit.getEntity().getInternal(loc)) { remove(false); } else { int originalInternal = unit.getEntity().getOInternal(loc); int internal = unit.getEntity().getInternal(loc); damage = originalInternal - Math.min(originalInternal, Math.max(internal, 0)); if(unit.isLocationBreached(loc)) { breached = true; } } } }
Source:
public Work<GroupByIdBlock> getGroupIds(Page page) { updateGroupCount(page); BlockBuilder blockBuilder = BIGINT.createFixedSizeBlockBuilder(page.getPositionCount()); for (int i = 0; i < page.getPositionCount(); i++) { blockBuilder.writeLong(0); } return new CompletedWork<>(new GroupByIdBlock(page.getPositionCount() > 0 ? 1 : 0, blockBuilder.build())); }

Target:
public Work<GroupByIdBlock> getGroupIds(Page page) { updateGroupCount(page); return new CompletedWork<>(new GroupByIdBlock(page.getPositionCount() > 0 ? 1 : 0, RunLengthEncodedBlock.create(BIGINT, 0L, page.getPositionCount()))); }
Source:
public static void main(String[] args) throws Exception { CliBuilder<Runnable> builder = Cli.<Runnable>builder("verifier") .withDescription("Presto Verifier") .withDefaultCommand(Help.class) .withCommands(Help.class, VerifyCommand.class); Cli<Runnable> verifierParser = builder.build(); verifierParser.parse(args).run(); }

Target:
public static void main(String[] args) throws Exception { Cli<Runnable> verifierParser = Cli.<Runnable>builder("verifier") .withDescription("Presto Verifier") .withDefaultCommand(Help.class) .withCommand(Help.class) .withCommand(VerifyCommand.class) .build(); verifierParser.parse(args).run(); }
Source:
@Override public Result implement(EnumerableRelImplementor implementor, Prefer pref) { if (!(readType == Type.LAZY && writeType == Type.LAZY)) { throw new UnsupportedOperationException( "EnumerableTableSpool supports for the moment only LAZY read and LAZY write"); } BlockBuilder builder = new BlockBuilder(); RelNode input = getInput(); Result inputResult = implementor.visitChild(this, 0, (EnumerableRel) input, pref); Expression tableExp = Expressions.convert_( Expressions.call( Expressions.call( implementor.getRootExpression(), BuiltInMethod.DATA_CONTEXT_GET_ROOT_SCHEMA.method), BuiltInMethod.SCHEMA_GET_TABLE.method, Expressions.constant(tableName, String.class)), ModifiableTable.class); Expression collectionExp = Expressions.call( tableExp, BuiltInMethod.MODIFIABLE_TABLE_GET_MODIFIABLE_COLLECTION.method); Expression inputExp = builder.append("input", inputResult.block); Expression spoolExp = Expressions.call( BuiltInMethod.LAZY_COLLECTION_SPOOL.method, collectionExp, inputExp); builder.add(spoolExp); PhysType physType = PhysTypeImpl.of( implementor.getTypeFactory(), getRowType(), pref.prefer(inputResult.format)); return implementor.result(physType, builder.toBlock()); }

Target:
@Override public Result implement(EnumerableRelImplementor implementor, Prefer pref) { if (readType != Type.LAZY || writeType != Type.LAZY) { throw new UnsupportedOperationException( "EnumerableTableSpool supports for the moment only LAZY read and LAZY write"); } BlockBuilder builder = new BlockBuilder(); RelNode input = getInput(); Result inputResult = implementor.visitChild(this, 0, (EnumerableRel) input, pref); Expression tableExp = Expressions.convert_( Expressions.call( Expressions.call( implementor.getRootExpression(), BuiltInMethod.DATA_CONTEXT_GET_ROOT_SCHEMA.method), BuiltInMethod.SCHEMA_GET_TABLE.method, Expressions.constant(tableName, String.class)), ModifiableTable.class); Expression collectionExp = Expressions.call( tableExp, BuiltInMethod.MODIFIABLE_TABLE_GET_MODIFIABLE_COLLECTION.method); Expression inputExp = builder.append("input", inputResult.block); Expression spoolExp = Expressions.call( BuiltInMethod.LAZY_COLLECTION_SPOOL.method, collectionExp, inputExp); builder.add(spoolExp); PhysType physType = PhysTypeImpl.of( implementor.getTypeFactory(), getRowType(), pref.prefer(inputResult.format)); return implementor.result(physType, builder.toBlock()); }
Source:
public void update() { if (!world.isRemote && world.getTotalWorldTime() % 25 == 0 && world.isBlockPowered(getPos())) { System.out.println(selectedSound); BlockAlarm.setActive(true, world, pos); switch(selectedSound){ case 1: world.playSound(null, getPos().getX(), getPos().getY(), getPos().getZ(), ModSounds.ALARM, SoundCategory.BLOCKS, 4F, 1F); break; case 2: world.playSound(null, getPos().getX(), getPos().getY(), getPos().getZ(), ModSounds.ALARM_2, SoundCategory.BLOCKS, 4F, 1F); break; case 3: world.playSound(null, getPos().getX(), getPos().getY(), getPos().getZ(), ModSounds.ALARM_3, SoundCategory.BLOCKS, 4F, 1F); break; } } else if (!world.isRemote && world.getTotalWorldTime() % 25 == 0) { BlockAlarm.setActive(false, world, pos); } }

Target:
public void update() { if (!world.isRemote && world.getTotalWorldTime() % 25 == 0 && world.isBlockPowered(getPos())) { BlockAlarm.setActive(true, world, pos); switch(selectedSound){ case 1: world.playSound(null, getPos().getX(), getPos().getY(), getPos().getZ(), ModSounds.ALARM, SoundCategory.BLOCKS, 4F, 1F); break; case 2: world.playSound(null, getPos().getX(), getPos().getY(), getPos().getZ(), ModSounds.ALARM_2, SoundCategory.BLOCKS, 4F, 1F); break; case 3: world.playSound(null, getPos().getX(), getPos().getY(), getPos().getZ(), ModSounds.ALARM_3, SoundCategory.BLOCKS, 4F, 1F); break; } } else if (!world.isRemote && world.getTotalWorldTime() % 25 == 0) { BlockAlarm.setActive(false, world, pos); } }
Source:
private void sendSuccesResponse(final MessageMetadata metadata, final ProtocolInfo protocolInfo, final FirmwareFileDto firmwareFileDto) { final DeviceMessageMetadata deviceMessageMetadata = new DeviceMessageMetadata( metadata.getDeviceIdentification(), metadata.getOrganisationIdentification(), metadata.getCorrelationUid(), metadata.getMessageType(), metadata.getMessagePriority(), metadata.getScheduleTime()); final ProtocolResponseMessage responseMessage = new ProtocolResponseMessage.Builder() .deviceMessageMetadata(deviceMessageMetadata).domain(metadata.getDomain()) .domainVersion(metadata.getDomainVersion()).result(ResponseMessageResultType.OK).osgpException(null) .dataObject(firmwareFileDto).retryCount(metadata.getRetryCount()).scheduled(metadata.isScheduled()) .build(); this.protocolResponseMessageSender.send(responseMessage, DeviceFunction.GET_FIRMWARE_FILE.name(), protocolInfo, metadata); }

Target:
private void sendSuccesResponse(final MessageMetadata metadata, final ProtocolInfo protocolInfo, final FirmwareFileDto firmwareFileDto) { final ProtocolResponseMessage responseMessage = new ProtocolResponseMessage.Builder() .deviceMessageMetadata(new DeviceMessageMetadata(metadata)).domain(metadata.getDomain()) .domainVersion(metadata.getDomainVersion()).result(ResponseMessageResultType.OK).osgpException(null) .dataObject(firmwareFileDto).retryCount(metadata.getRetryCount()).scheduled(metadata.isScheduled()) .build(); this.protocolResponseMessageSender.send(responseMessage, DeviceFunction.GET_FIRMWARE_FILE.name(), protocolInfo, metadata); }
Source:
public synchronized MultiModel removeRepoModelById(String repoId) { Optional<Model> repoModelToBeDeleted = getModelById(repoId); if (repoModelToBeDeleted.isPresent()) { this.models.remove(repoModelToBeDeleted.get().getRepoId()); } return this; }

Target:
public synchronized MultiModel removeRepoModelById(String repoId) { Optional<Model> repoModelToBeDeleted = getModelById(repoId); if (repoModelToBeDeleted.isPresent()) { this.models.remove(repoModelToBeDeleted.get().getRepoId()); } else { logger.error("RepoModel to be deleted does not exist."); } return this; }
Source:
public void firePostMessageFromUI(String data, String origin) { if (!isEnabledIncludingParents() || !isVisible()) { return; } interceptPostMessage(data, origin); }

Target:
public void firePostMessageFromUI(String data, String origin) { if (!isEnabledIncludingParents() || !isVisibleIncludingParents()) { return; } interceptPostMessage(data, origin); }
Source:
public void onConnect(IClient client, RequestFunction function, AMFDataList params) { WMSProperties properties = client.getProperties(); String rtmpUrl = properties.getPropertyStr(Constants.CLIENT_PROPERTY_CONNECT_URL); String IP = client.getIp(); logger.debug("Geting url: " + rtmpUrl+ " from client "+ IP); try { HashMap<String, String> queryParameters = Utils.getRtmpUrlParameters(rtmpUrl, client.getQueryStr()); onClientConnect(properties, queryParameters, KalturaStreamType.RTMP); } catch (Exception e) { logger.error("Entry authentication failed with url [" + rtmpUrl + "]: " + e.getMessage()); client.rejectConnection(); sendClientOnStatusError((IClient)client, "NetStream.Play.Failed","Unable to authenticate url; [" + rtmpUrl + "]: " + e.getMessage()); DiagnosticsProvider.addRejectedRTMPStream(client, e.getMessage()); } }

Target:
public void onConnect(IClient client, RequestFunction function, AMFDataList params) { WMSProperties properties = client.getProperties(); String rtmpUrl = properties.getPropertyStr(Constants.CLIENT_PROPERTY_CONNECT_URL); String IP = client.getIp(); logger.debug("Geting url: " + rtmpUrl+ " from client "+ IP); try { HashMap<String, String> queryParameters = Utils.getRtmpUrlParameters(rtmpUrl, client.getQueryStr()); onClientConnect(properties, queryParameters); } catch (Exception e) { logger.error("Entry authentication failed with url [" + rtmpUrl + "]: " + e.getMessage()); client.rejectConnection(); sendClientOnStatusError((IClient)client, "NetStream.Play.Failed","Unable to authenticate url; [" + rtmpUrl + "]: " + e.getMessage()); DiagnosticsProvider.addRejectedRTMPStream(client, e.getMessage()); } }
Source:
public SourceRecord extractRecord() throws SQLException { Struct record = DataConverter.convertRecord(schema, resultSet); Map<String, String> partition = new HashMap<>(); partition.put("table", name); return new SourceRecord(partition, null, name, null, null, record); }

Target:
public SourceRecord extractRecord() throws SQLException { Struct record = DataConverter.convertRecord(schema, resultSet); Map<String, String> partition = Collections.singletonMap(JdbcSourceConnectorConstants.TABLE_NAME_KEY, name); return new SourceRecord(partition, null, name, null, null, record); }
Source:
private static void generateConfigIni(List<String> pluginList, Path configOutputPath) { try (FileWriter r = new FileWriter(configOutputPath.toFile())) { r.write("osgi.install.area=file\\:$eclipse.home$\n"); r.write("osgi.framework=file\\:$eclipse.home$/plugins/$osgi.jar$\n"); r.write("osgi.bundles="); for (int i =0; i < pluginList.size(); i++) { String pluginName = pluginList.get(i); if (PLUGINS_NOT_IN_SCRIPT_VERSION.contains(pluginName)) { continue; } r.write(pluginName); if (PLUGINS_WITH_START_LEVEL.containsKey(pluginName)) { r.write(PLUGINS_WITH_START_LEVEL.get(pluginName)); } if (i != pluginList.size() - 1) { r.write(','); } } r.write('\n'); r.write("osgi.configuration.cascaded=false\n"); r.write("osgi.bundles.defaultStartLevel=4\n"); } catch (IOException e) { e.printStackTrace(); System.exit(1); } }

Target:
private static void generateConfigIni(List<String> pluginList, Path configOutputPath) { try (FileWriter r = new FileWriter(configOutputPath.toFile())) { r.write("osgi.install.area=file\\:$eclipse.home$\n"); r.write("osgi.framework=file\\:$eclipse.home$/plugins/$osgi.jar$\n"); r.write("osgi.bundles="); for (int i =0; i < pluginList.size(); i++) { String pluginName = pluginList.get(i); if (PLUGINS_NOT_IN_SCRIPT_VERSION.contains(pluginName)) { continue; } r.write(pluginName); if (PLUGINS_WITH_START_LEVEL.containsKey(pluginName)) { r.write(PLUGINS_WITH_START_LEVEL.get(pluginName)); } r.write(','); } r.write('\n'); r.write("osgi.configuration.cascaded=false\n"); r.write("osgi.bundles.defaultStartLevel=4\n"); } catch (IOException e) { e.printStackTrace(); System.exit(1); } }