auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected String getQueryString() throws IOException { String condition = null; if (properties.manualQuery.getValue()) { return properties.query.getStringValue(); } else { condition = properties.condition.getStringValue(); } StringBuilder sb = new StringBuilder(); boolean isUpperCase = properties.convertColumnsAndTableToUppercase.getValue(); sb.append("select "); int count = 0; for (Schema.Field se : getSchema().getFields()) { if (count++ > 0) { sb.append(", "); } String fName = isUpperCase ? se.name() : "\"" + se.name() + "\""; sb.append(fName); } sb.append(" from "); String tableName = isUpperCase ? properties.getTableName() : "\"" + properties.getTableName() + "\""; sb.append(tableName); if (condition != null && condition.trim().length() > 0) { sb.append(" where "); sb.append(condition); } return sb.toString(); }

Target:
protected String getQueryString() throws IOException { String condition = null; if (properties.manualQuery.getValue()) { return properties.query.getStringValue(); } else { condition = properties.condition.getStringValue(); } StringBuilder sb = new StringBuilder(); boolean isUpperCase = properties.convertColumnsAndTableToUppercase.getValue(); sb.append("select "); int count = 0; for (Schema.Field se : getSchema().getFields()) { if (count++ > 0) { sb.append(", "); } String fName = isUpperCase ? se.name() : StringUtils.wrap(se.name(), '"'); sb.append(fName); } sb.append(" from "); String tableName = isUpperCase ? properties.getTableName() : StringUtils.wrap(properties.getTableName(), '"'); sb.append(tableName); if (condition != null && condition.trim().length() > 0) { sb.append(" where "); sb.append(condition); } return sb.toString(); }
Source:
public static RawText load(ObjectLoader ldr, int threshold) throws IOException, BinaryBlobException { long sz = ldr.getSize(); if (threshold < FIRST_FEW_BYTES) { threshold = FIRST_FEW_BYTES; } if (sz > threshold) { throw new BinaryBlobException(); } if (sz <= FIRST_FEW_BYTES) { byte []data = ldr.getCachedBytes(FIRST_FEW_BYTES); if (isBinary(data)) { throw new BinaryBlobException(); } return new RawText(data); } byte head[] = new byte[FIRST_FEW_BYTES]; try (InputStream stream = ldr.openStream()) { int off = 0; int left = head.length; while (left > 0) { int n = stream.read(head, off, left); if (n < 0) { throw new IllegalStateException("negative read"); } left -= n; off += n; } if (isBinary(head)) { throw new BinaryBlobException(); } byte data[]; try { data = new byte[(int)sz]; } catch (OutOfMemoryError e) { throw new LargeObjectException.OutOfMemory(e); } System.arraycopy(head, 0, data, 0, head.length); IO.readFully(stream, data, off, (int) (sz-off)); return new RawText(data); } }

Target:
public static RawText load(ObjectLoader ldr, int threshold) throws IOException, BinaryBlobException { long sz = ldr.getSize(); if (threshold < FIRST_FEW_BYTES) { threshold = FIRST_FEW_BYTES; } if (sz > threshold) { throw new BinaryBlobException(); } if (sz <= FIRST_FEW_BYTES) { byte[] data = ldr.getCachedBytes(FIRST_FEW_BYTES); if (isBinary(data)) { throw new BinaryBlobException(); } return new RawText(data); } byte[] head = new byte[FIRST_FEW_BYTES]; try (InputStream stream = ldr.openStream()) { int off = 0; int left = head.length; while (left > 0) { int n = stream.read(head, off, left); if (n < 0) { throw new EOFException(); } left -= n; off += n; } if (isBinary(head)) { throw new BinaryBlobException(); } byte data[]; try { data = new byte[(int)sz]; } catch (OutOfMemoryError e) { throw new LargeObjectException.OutOfMemory(e); } System.arraycopy(head, 0, data, 0, head.length); IO.readFully(stream, data, off, (int) (sz-off)); return new RawText(data); } }
Source:
public static String hash(File remoteFsRoot) { StringBuilder buf = new StringBuilder(); try { buf.append(remoteFsRoot.getCanonicalPath()).append('\n'); } catch (IOException e) { buf.append(remoteFsRoot.getAbsolutePath()).append('\n'); } try { for (NetworkInterface ni : Collections.list(NetworkInterface.getNetworkInterfaces())) { for (InetAddress ia : Collections.list(ni.getInetAddresses())) { if (ia instanceof Inet4Address) { buf.append(ia.getHostAddress()).append('\n'); } } byte[] hardwareAddress = ni.getHardwareAddress(); if (hardwareAddress != null) { buf.append(Arrays.toString(hardwareAddress)); } } } catch (SocketException e) { } return getDigestOf(buf.toString()).substring(0, 8); }

Target:
public static String hash(File remoteFsRoot) { StringBuilder buf = new StringBuilder(); try { buf.append(remoteFsRoot.getCanonicalPath()).append('\n'); } catch (IOException e) { buf.append(remoteFsRoot.getAbsolutePath()).append('\n'); } try { for (NetworkInterface ni : Collections.list(NetworkInterface.getNetworkInterfaces())) { for (InetAddress ia : Collections.list(ni.getInetAddresses())) { if (ia instanceof Inet4Address) { buf.append(ia.getHostAddress()).append('\n'); } else if (ia instanceof Inet6Address) { buf.append(ia.getHostAddress()).append('\n'); } } byte[] hardwareAddress = ni.getHardwareAddress(); if (hardwareAddress != null) { buf.append(Arrays.toString(hardwareAddress)); } } } catch (SocketException e) { } return DigestUtils.md5Hex(buf.toString()).substring(0, 8); }
Source:
public static Map<String,Object> sanitize(ConfigBag input) { return Sanitizer.sanitize(input.getAllConfig()); }

Target:
public static Map<String,Object> sanitize(ConfigBag input) { return Sanitizer.sanitize(input ); }
Source:
protected List<GroupModel> getLDAPGroupMappingsConverted() { if (cachedLDAPGroupMappings != null) { return new ArrayList<>(cachedLDAPGroupMappings); } List<LDAPObject> ldapGroups = getLDAPGroupMappings(ldapUser); List<GroupModel> result = new ArrayList<>(); for (LDAPObject ldapGroup : ldapGroups) { GroupModel kcGroup = findKcGroupOrSyncFromLDAP(realm, ldapGroup, this); if (kcGroup != null) { result.add(kcGroup); } } cachedLDAPGroupMappings = new HashSet<>(result); return result; }

Target:
protected Set<GroupModel> getLDAPGroupMappingsConverted() { if (cachedLDAPGroupMappings != null) { return new HashSet<>(cachedLDAPGroupMappings); } List<LDAPObject> ldapGroups = getLDAPGroupMappings(ldapUser); Set<GroupModel> result = new HashSet<>(); for (LDAPObject ldapGroup : ldapGroups) { GroupModel kcGroup = findKcGroupOrSyncFromLDAP(realm, ldapGroup, this); if (kcGroup != null) { result.add(kcGroup); } } cachedLDAPGroupMappings = new HashSet<>(result); return result; }
Source:
private Map<String, DbParameterAccessor> readIntoParams( String[] queryParameters, String query) throws SQLException { try (CallableStatement dc = currentConnection.prepareCall(query)) { for (int i = 0; i < queryParameters.length; i++) { dc.setString(i + 1, queryParameters[i].toUpperCase()); } ResultSet rs = dc.executeQuery(); Map<String, DbParameterAccessor> allParams = new HashMap<String, DbParameterAccessor>(); int position = 0; while (rs.next()) { String paramName = rs.getString(1); if (paramName == null) { paramName = ""; } if (paramName.equals("")) { paramName = ""; } String dataType = rs.getString(2); String direction = rs.getString(4); Direction paramDirection; if (paramName.trim().toUpperCase().equals("")) { paramDirection = Direction.RETURN_VALUE; } else { paramDirection = getParameterDirection(direction); } int intSqlType = getSqlType(dataType); Class<?> clsJavaClass = getJavaClass(dataType); DbParameterAccessor dbp = new DbParameterAccessor(paramName, paramDirection, intSqlType, clsJavaClass, paramDirection == Direction.RETURN_VALUE ? -1 : position++); allParams.put(NameNormaliser.normaliseName(paramName), dbp); } return allParams; } }

Target:
private Map<String, DbParameterAccessor> readIntoParams( String[] queryParameters, String query) throws SQLException { try (CallableStatement dc = currentConnection.prepareCall(query)) { for (int i = 0; i < queryParameters.length; i++) { dc.setString(i + 1, queryParameters[i]); } ResultSet rs = dc.executeQuery(); Map<String, DbParameterAccessor> allParams = new HashMap<String, DbParameterAccessor>(); int position = 0; while (rs.next()) { String paramName = rs.getString(1); if (paramName == null) { paramName = ""; } if (paramName.equals("")) { paramName = ""; } String dataType = rs.getString(2); String direction = rs.getString(4); Direction paramDirection; if (paramName.trim().equals("")) { paramDirection = Direction.RETURN_VALUE; } else { paramDirection = getParameterDirection(direction); } int intSqlType = getSqlType(dataType); Class<?> clsJavaClass = getJavaClass(dataType); DbParameterAccessor dbp = new DbParameterAccessor(paramName, paramDirection, intSqlType, clsJavaClass, paramDirection == Direction.RETURN_VALUE ? -1 : position++); allParams.put(NameNormaliser.normaliseName(paramName), dbp); } return allParams; } }
Source:
public FlowIdentifier updatePillarConfiguration(NameOrCrn nameOrCrn, Long workspaceId) { Stack stack = stackService.getByNameOrCrnInWorkspace(nameOrCrn, workspaceId); return clusterOperationService.updatePillarConfiguration(stack); }

Target:
public FlowIdentifier updatePillarConfiguration(NameOrCrn nameOrCrn, Long workspaceId) { Stack stack = stackService.getByNameOrCrnInWorkspace(nameOrCrn, workspaceId); MDCBuilder.buildMdcContext(stack); if (!stack.isAvailable()) { throw new BadRequestException(String.format( "Stack '%s' is currently in '%s' state. Updates to the Pillar Configuration can " + "only be made when the underlying stack is 'AVAILABLE'.", stack.getName(), stack.getStatus())); } return clusterOperationService.updatePillarConfiguration(stack); }
Source:
public void createBundleJar(File manifestFile) { Jar jarTask = (Jar) project.getTasks().findByName(JAR_TASK_NAME); jarTask.manifest( (Manifest mf) -> { mf.from(manifestFile); }); SourceSetContainer sourceSets = project.getExtensions().getByType(SourceSetContainer.class); jarTask.from(sourceSets.getByName(JAVA_MAIN_SOURCE_SET_NAME).getOutput()); jarTask.into( JAR_LIB_DESTINATION, (CopySpec cs) -> { cs.from(project.getConfigurations().getByName(RELEASE_CONFIG_NAME)); }); }

Target:
public void createBundleJar(File manifestFile) { Jar jarTask = (Jar) project.getTasks().findByName(JAR_TASK_NAME); if (jarTask == null) throw new GradleException("Unable to find the gradle task: " + JAR_TASK_NAME); jarTask.manifest((Manifest mf) -> mf.from(manifestFile)); SourceSetContainer sourceSets = project.getExtensions().getByType(SourceSetContainer.class); jarTask.from(sourceSets.getByName(JAVA_MAIN_SOURCE_SET_NAME).getOutput()); jarTask.into( JAR_LIB_DESTINATION, (CopySpec cs) -> cs.from(project.getConfigurations().getByName(RELEASE_CONFIG_NAME))); }
Source:
protected void setIsExecuting(boolean value) { synchronized (DefaultSchedulerMessageSource.this) { executing = value; } }

Target:
protected void setIsExecuting(boolean value) { synchronized (this) { executing = value; } }
Source:
public CliCommand init(final Arguments args) throws Exception { this.bucketName = args.getBucket(); if (this.bucketName == null) { throw new MissingOptionException("The get physical placement command requires '-b' to be set."); } this.objectName = args.getObjectName(); if (this.objectName == null) { throw new MissingOptionException("The get physical placement command requires '-o' to be set."); } return this; }

Target:
public CliCommand init(final Arguments args) throws Exception { if (args.getDirectory() != null) { throw new UnrecognizedOptionException("The get_physical_placement command does not work with '-d' as it only applies to a single object."); } this.bucketName = args.getBucket(); if (this.bucketName == null) { throw new MissingOptionException("The get_physical_placement command requires '-b' to be set."); } this.objectName = args.getObjectName(); if (this.objectName == null) { throw new MissingOptionException("The get_physical_placement command requires '-o' to be set."); } return this; }
Source:
Date getDateFromSeconds(Map<String, JsonNode> tree, String claimName) { JsonNode node = tree.get(claimName); if (node == null || node.isNull()) { return null; } if (!node.canConvertToLong()) { throw new JWTDecodeException(String.format("The claim '%s' contained an unexpected value.", claimName)); } final long ms = node.asLong() * 1000; return new Date(ms); }

Target:
Date getDateFromSeconds(Map<String, JsonNode> tree, String claimName) { JsonNode node = tree.get(claimName); if (node == null || node.isNull()) { return null; } if (!node.canConvertToLong()) { throw new JWTDecodeException(String.format("The claim '%s' contained a non-numeric date value.", claimName)); } final long ms = node.asLong() * 1000; return new Date(ms); }
Source:
public int compare(T o1, T o2) { for (int i = 0; i < propertyId.length; i++) { String currentProperty = propertyId[i].toString(); Comparator underlyingComparator = getUnderlyingComparator(currentProperty); Comparator currentComparator = underlyingComparator != null ? underlyingComparator : ComparableComparator.getInstance(); if (!ascending[i]) { currentComparator = currentComparator.reversed(); } Object o1Prop = getContainerProperty(o1, currentProperty).getValue(); Object o2Prop = getContainerProperty(o2, currentProperty).getValue(); int compare = currentComparator.compare(o1Prop, o2Prop); if (compare != 0) { return compare; } } return 0; }

Target:
public int compare(T o1, T o2) { for (int i = 0; i < propertyId.length; i++) { String currentProperty = propertyId[i].toString(); Comparator underlyingComparator = getUnderlyingComparator(currentProperty); Comparator currentComparator = underlyingComparator != null ? underlyingComparator : ComparableComparator.getInstance(); if (!ascending[i]) { currentComparator = new ReverseComparator(currentComparator); } Object o1Prop = getContainerProperty(o1, currentProperty).getValue(); Object o2Prop = getContainerProperty(o2, currentProperty).getValue(); int compare = currentComparator.compare(o1Prop, o2Prop); if (compare != 0) { return compare; } } return 0; }
Source:
public static void main(String[] argv) { log.info("Cleaning up asset store"); CommandLineParser parser = new PosixParser(); CommandLine line = null; Options options = new Options(); options.addOption("l", "leave", false, "Leave database records but delete file from assetstore"); options.addOption("b", "batchSize", true, "commitBatches, default 100"); options.addOption("v", "verbose", false, "Provide verbose output"); options.addOption("h", "help", false, "Help"); try { line = parser.parse(options, argv); if (line.hasOption('h')) { printHelp(options); } else { boolean deleteDbRecords = !line.hasOption('l'); boolean verbose = line.hasOption('v'); int commitBatch = 100; if (line.hasOption('b')) { try { commitBatch = Integer.parseInt(line.getOptionValue('b')); } catch (NumberFormatException ne) { throw new ParseException("batchSize must be greater equal 1"); } if (commitBatch < 1) { throw new ParseException("batchSize must be greater equal 1"); } } if (log.isDebugEnabled()) { log.debug("leave db records = " + deleteDbRecords); log.debug("batchSize = " + commitBatch); } if (verbose) { System.out.println("leave db records = " + deleteDbRecords); System.out.println("batchSize = " + commitBatch); } StorageServiceFactory.getInstance().getBitstreamStorageService().cleanup(deleteDbRecords, commitBatch, verbose); } } catch (Exception e) { log.fatal("Caught exception:", e); printHelp(options); System.exit(1); } }

Target:
public static void main(String[] argv) { log.info("Cleaning up asset store"); CommandLineParser parser = new PosixParser(); CommandLine line = null; Options options = new Options(); boolean deleteDbRecords = true; boolean verbose = false; int commitBatch = 100; options.addOption("l", "leave", false, "Leave database records but delete file from assetstore"); options.addOption("b", "batchSize", true, "commitBatches, default " + commitBatch); options.addOption("v", "verbose", false, "Provide verbose output"); options.addOption("h", "help", false, "Help"); try { line = parser.parse(options, argv); if (line.hasOption('h')) { printHelp(options); return; } else { deleteDbRecords = !line.hasOption('l'); verbose = line.hasOption('v'); if (line.hasOption('b')) { try { commitBatch = Integer.parseInt(line.getOptionValue('b')); } catch (NumberFormatException ne) { throw new RuntimeException( "'" + line.getOptionValue('b') + "' is not a positive integer"); } if (commitBatch < 1) { throw new RuntimeException( "batchSize must be greater or equal 1"); } } } } catch (Exception e) { System.err.println(e.getMessage()); printHelp(options); System.exit(1); } if (log.isDebugEnabled()) { log.debug("leave db records = " + !deleteDbRecords); log.debug("batchSize = " + commitBatch); } if (verbose) { System.out.println("leave db records = " + !deleteDbRecords); System.out.println("batchSize = " + commitBatch); } try { StorageServiceFactory.getInstance().getBitstreamStorageService().cleanup(deleteDbRecords, commitBatch, verbose); } catch (Exception e) { System.err.println(e.getMessage()); log.fatal("Caught exception:", e); System.exit(1); } }
Source:
protected void executeCommand() { vds_spm_id_map newMap = new vds_spm_id_map(getVds().getstorage_pool_id(), getVdsId(), 0); DbFacade.getInstance().getVdsSpmIdMapDAO().save(newMap); if (getParameters().isCompensationEnabled()) { getCompensationContext().snapshotNewEntity(newMap); getCompensationContext().stateChanged(); } setSucceeded(true); }

Target:
protected void executeCommand() { vds_spm_id_map newMap = new vds_spm_id_map(getVds().getstorage_pool_id(), getVdsId()); DbFacade.getInstance().getVdsSpmIdMapDAO().save(newMap); if (getParameters().isCompensationEnabled()) { getCompensationContext().snapshotNewEntity(newMap); getCompensationContext().stateChanged(); } setSucceeded(true); }
Source:
public void addTraceMarker(ITmfTrace trace, long startTime, @ScriptParameter(defaultValue = DEFAULT_ENDTIME) long endTime, @ScriptParameter(defaultValue = DEFAULT_LABEL) @Nullable String label, @ScriptParameter(defaultValue = DEFAULT_CATEGORY) @Nullable String category, @ScriptParameter(defaultValue = DEFAULT_COLOR) @Nullable String color) throws NullPointerException, IllegalArgumentException { ScriptingMarkerSource source = getMarkerSource(trace); if (source == null) { try { source = findMarkerSourceFromAdapters(trace); if (source == null) { source = createMarkerSource(trace); } } catch (NullPointerException e) { throw new NullPointerException(INVALID_TRACE); } } try { TraceMarker traceMarker = createTraceMarker(trace, label, category, startTime, endTime, color); source.configureMarker(traceMarker); } catch (IllegalArgumentException e) { String markerName = label == null ? DEFAULT_LABEL : label; String exceptionMessage = e + " for marker : " + markerName + " at " + startTime; throw new IllegalArgumentException(exceptionMessage); } }

Target:
public void addTraceMarker(ITmfTrace trace, long startTime, @ScriptParameter(defaultValue = DEFAULT_ENDTIME) long endTime, @ScriptParameter(defaultValue = DEFAULT_LABEL) @Nullable String label, @ScriptParameter(defaultValue = DEFAULT_CATEGORY) @Nullable String category, @ScriptParameter(defaultValue = DEFAULT_COLOR) @Nullable String color) throws NullPointerException, IllegalArgumentException { ScriptingMarkerSource source = getMarkerSource(trace); if (source == null) { try { source = findMarkerSourceFromAdapters(trace); if (source == null) { source = createMarkerSource(trace); } } catch (NullPointerException e) { throw new NullPointerException(INVALID_TRACE); } } try { TraceMarker traceMarker = createTraceMarker(trace, label, category, startTime, endTime, color); source.configureMarker(traceMarker); } catch (IllegalArgumentException e) { String markerName = label == null ? DEFAULT_LABEL : label; String exceptionMessage = e + " for marker : " + markerName + " at " + startTime; throw new IllegalArgumentException(exceptionMessage, e); } }
Source:
public void testFailQuery() throws Exception { QueryManager queryManager = queryRunner.getCoordinator().getQueryManager(); QueryId queryId = queryManager.createQuery(new TestingSessionContext(TEST_SESSION), "SELECT * FROM lineitem").getQueryId(); while (true) { QueryInfo queryInfo = queryManager.getQueryInfo(queryId); if (queryInfo.getState().isDone()) { assertEquals(queryInfo.getState(), FAILED); throw queryInfo.getFailureInfo().toException(); } if (queryInfo.getState() == RUNNING) { break; } Thread.sleep(100); } queryManager.failQuery(queryId, new PrestoException(GENERIC_INTERNAL_ERROR, "mock exception")); QueryInfo queryInfo = queryManager.getQueryInfo(queryId); assertEquals(queryInfo.getState(), QueryState.FAILED); assertEquals(queryInfo.getErrorCode(), GENERIC_INTERNAL_ERROR.toErrorCode()); assertNotNull(queryInfo.getFailureInfo()); assertEquals(queryInfo.getFailureInfo().getMessage(), "mock exception"); }

Target:
public void testFailQuery() throws Exception { QueryManager queryManager = queryRunner.getCoordinator().getQueryManager(); QueryId queryId = queryManager.createQuery(new TestingSessionContext(TEST_SESSION), "SELECT * FROM lineitem").getQueryId(); while (true) { QueryInfo queryInfo = queryManager.getQueryInfo(queryId); if (queryInfo.getState().isDone()) { fail("unexpected query state: " + queryInfo.getState()); } if (queryInfo.getState() == RUNNING) { break; } Thread.sleep(100); } queryManager.failQuery(queryId, new PrestoException(GENERIC_INTERNAL_ERROR, "mock exception")); QueryInfo queryInfo = queryManager.getQueryInfo(queryId); assertEquals(queryInfo.getState(), QueryState.FAILED); assertEquals(queryInfo.getErrorCode(), GENERIC_INTERNAL_ERROR.toErrorCode()); assertNotNull(queryInfo.getFailureInfo()); assertEquals(queryInfo.getFailureInfo().getMessage(), "mock exception"); }
Source:
public static int countLines(String str) { String lineSeparator = System.lineSeparator(); if (str == null || str.isEmpty()) { return 0; } int lines = 1; int pos = 0; while ((pos = str.indexOf(lineSeparator, pos) + 1) != 0) { lines++; } return lines; }

Target:
public static int countLines(String str) { return Lists.newArrayList(Splitter.on(System.lineSeparator()).split(str)).size(); }
Source:
public void testSuccess() throws Exception { TransactionsGetRequest request = new TransactionsGetRequest(accessToken, startDate, endDate) .withCount(100); Response<TransactionsGetResponse> response = null; for (int i = 0; i < 5; i++) { response = client().service().transactionsGet(request).execute(); if (response.isSuccessful()) { break; } else { ErrorResponse errorResponse = client().parseError(response); assertEquals(errorResponse.getErrorCode(), "PRODUCT_NOT_READY"); Thread.sleep(5000); } } assertSuccessResponse(response); assertNotNull(response.body().getTotalTransactions()); assertNotNull(response.body().getItem()); assertNotNull(response.body().getAccounts()); assertFalse(response.body().getAccounts().isEmpty()); assertTrue(response.body().getTransactions().size() > 0); for (TransactionsGetResponse.Transaction txn : response.body().getTransactions()) { assertNotNull(txn.getTransactionId()); assertNotNull(txn.getAccountId()); assertNotNull(txn.getPending()); assertNotNull(txn.getTransactionType()); assertNotNull(txn.getPaymentMeta()); assertNotNull(txn.getDate()); assertNotNull(txn.getName()); assertNotNull(txn.getAmount()); assertNotNull(txn.getLocation()); assertNotNull(txn.getIsoCurrencyCode()); } }

Target:
public void testSuccess() throws Exception { TransactionsGetRequest request = new TransactionsGetRequest(accessToken, startDate, endDate) .withCount(100); Response<TransactionsGetResponse> response = null; for (int i = 0; i < 5; i++) { response = client().service().transactionsGet(request).execute(); if (response.isSuccessful()) { break; } else { ErrorResponse errorResponse = client().parseError(response); assertEquals(errorResponse.getErrorCode(), "PRODUCT_NOT_READY"); Thread.sleep(3000); } } assertSuccessResponse(response); assertNotNull(response.body().getTotalTransactions()); assertNotNull(response.body().getItem()); assertNotNull(response.body().getAccounts()); assertFalse(response.body().getAccounts().isEmpty()); assertTrue(response.body().getTransactions().size() > 0); for (TransactionsGetResponse.Transaction txn : response.body().getTransactions()) { assertNotNull(txn.getTransactionId()); assertNotNull(txn.getAccountId()); assertNotNull(txn.getPending()); assertNotNull(txn.getTransactionType()); assertNotNull(txn.getPaymentMeta()); assertNotNull(txn.getDate()); assertNotNull(txn.getName()); assertNotNull(txn.getAmount()); assertNotNull(txn.getLocation()); assertNotNull(txn.getIsoCurrencyCode()); } }
Source:
public void stopGracefully() { try { synchronized (this) { if (!stopped) { stopped = true; if (isFirehoseDrainableByClosing(spec.getIOConfig().getFirehoseFactory())) { firehose.close(); } } } } catch (Exception e) { throw Throwables.propagate(e); } }

Target:
public void stopGracefully() { try { synchronized (this) { if (!stopped) { stopped = true; log.info("Gracefully stopping."); if (isFirehoseDrainableByClosing(spec.getIOConfig().getFirehoseFactory())) { firehose.close(); } else { log.debug("Cannot drain firehose[%s] by closing, so skipping closing.", firehose); } } } } catch (Exception e) { throw Throwables.propagate(e); } }
Source:
public void setEnabledProtocols(String[] protocols) { protocolsVerified = verifyEnabledProtocols(protocols); }

Target:
public void setEnabledProtocols(String[] protocols) { capturedProtocols = protocols; protocolsEnabled = true; }
Source:
public void registerRenderers() { Block block; block = blockExperienceObelisk.getBlock(); if (block != null) { ObeliskSpecialRenderer<TileExperienceObelisk> eor = new ObeliskSpecialRenderer<TileExperienceObelisk>(new ItemStack(itemXpTransfer.getItem()), block); registerRenderer(block, TileExperienceObelisk.class, eor); } block = blockAttractorObelisk.getBlock(); if (block != null) { ObeliskSpecialRenderer<TileAttractor> eor = new ObeliskSpecialRenderer<TileAttractor>( new ItemStack(ModObject.itemMaterial.getItem(), 1, Material.ATTRACTOR_CRYSTAL.ordinal()), block); registerRenderer(block, TileAttractor.class, eor); } block = blockAversionObelisk.getBlock(); if (block != null) { AversionObeliskRenderer eor = new AversionObeliskRenderer(); registerRenderer(block, TileAversionObelisk.class, eor); } block = blockRelocatorObelisk.getBlock(); if (block != null) { RelocatorObeliskRenderer eor = new RelocatorObeliskRenderer(); registerRenderer(block, TileRelocatorObelisk.class, eor); } block = blockWeatherObelisk.getBlock(); if (block != null) { ObeliskSpecialRenderer<TileWeatherObelisk> eor = new WeatherObeliskSpecialRenderer(new ItemStack(Items.FIREWORKS)); registerRenderer(block, TileWeatherObelisk.class, eor); } block = blockInhibitorObelisk.getBlock(); if (block != null) { ObeliskSpecialRenderer<TileInhibitorObelisk> eor = new ObeliskSpecialRenderer<TileInhibitorObelisk>(new ItemStack(Items.ENDER_PEARL), block); registerRenderer(block, TileInhibitorObelisk.class, eor); } }

Target:
public void registerRenderers() { Block block; block = blockExperienceObelisk.getBlock(); if (block != null) { ObeliskSpecialRenderer<TileExperienceObelisk> eor = new ObeliskSpecialRenderer<TileExperienceObelisk>(new ItemStack(ModObject.itemXpTransfer.getItem()), block); registerRenderer(block, TileExperienceObelisk.class, eor); } block = blockAttractorObelisk.getBlock(); if (block != null) { ObeliskSpecialRenderer<TileAttractor> eor = new ObeliskSpecialRenderer<TileAttractor>( Material.ATTRACTOR_CRYSTAL.getStack(), block); registerRenderer(block, TileAttractor.class, eor); } block = blockAversionObelisk.getBlock(); if (block != null) { AversionObeliskRenderer eor = new AversionObeliskRenderer(); registerRenderer(block, TileAversionObelisk.class, eor); } block = blockRelocatorObelisk.getBlock(); if (block != null) { RelocatorObeliskRenderer eor = new RelocatorObeliskRenderer(); registerRenderer(block, TileRelocatorObelisk.class, eor); } block = blockWeatherObelisk.getBlock(); if (block != null) { ObeliskSpecialRenderer<TileWeatherObelisk> eor = new WeatherObeliskSpecialRenderer(new ItemStack(Items.FIREWORKS)); registerRenderer(block, TileWeatherObelisk.class, eor); } block = blockInhibitorObelisk.getBlock(); if (block != null) { ObeliskSpecialRenderer<TileInhibitorObelisk> eor = new ObeliskSpecialRenderer<TileInhibitorObelisk>(new ItemStack(Items.ENDER_PEARL), block); registerRenderer(block, TileInhibitorObelisk.class, eor); } }
Source:
public final void retrievesSingleKey() throws Exception { final PublicKeys keys = this.keys(); MatcherAssert.assertThat( keys.get(1).toString(), Matchers.endsWith("/keys/1") ); }

Target:
public final void retrievesSingleKey() throws Exception { final PublicKeys keys = this.keys(); final PublicKey key = keys.create("Title", "Key"); MatcherAssert.assertThat( keys.get(key.number()), Matchers.equalTo(key) ); keys.remove(key.number()); }
Source:
public Set<String> getAgents() throws AgentException { return unmodifiableSet(agents.keySet()); }

Target:
public List<String> getAgents() throws AgentException { return agentNames; }
Source:
private static boolean hasError(MavenExecutionResult mavenExecutionResult) { return mavenExecutionResult.getExceptions().stream().allMatch(ProjectBuildingException.class::isInstance) && mavenExecutionResult.getExceptions().stream() .map(ProjectBuildingException.class::cast) .flatMap(ex -> ex.getResults().stream()) .flatMap(result -> result.getProblems().stream()) .map(ModelProblem::getSeverity) .allMatch(ModelProblem.Severity.WARNING::equals); }

Target:
private static boolean hasError(MavenExecutionResult mavenExecutionResult) { return mavenExecutionResult.getExceptions().stream().anyMatch(ex -> !(ex instanceof ProjectBuildingException)) || mavenExecutionResult.getExceptions().stream() .map(ProjectBuildingException.class::cast) .flatMap(ex -> ex.getResults().stream()) .flatMap(result -> result.getProblems().stream()) .map(ModelProblem::getSeverity) .anyMatch(severity -> severity != Severity.WARNING); }
Source:
public static void map(VmPlacementPolicy placementPolicy, VmStatic staticVm) { if (placementPolicy.isSetHost() && placementPolicy.getHost().isSetId()) { staticVm.setDedicatedVmForVds(GuidUtils.asGuid(placementPolicy.getHost().getId())); } if (placementPolicy.isSetAffinity()) { MigrationSupport migrationSupport = map(VmAffinity.fromValue(placementPolicy.getAffinity()), null); if (migrationSupport != null) { staticVm.setMigrationSupport(migrationSupport); } } }

Target:
public static void map(VmPlacementPolicy placementPolicy, VmStatic staticVm) { if (placementPolicy.isSetHost() && placementPolicy.getHost().isSetId()) { staticVm.setDedicatedVmForVds(GuidUtils.asGuid(placementPolicy.getHost().getId())); } if (placementPolicy.isSetAffinity()) { MigrationSupport migrationSupport = VmMapper.map(VmAffinity.fromValue(placementPolicy.getAffinity()), null); if (migrationSupport != null) { staticVm.setMigrationSupport(migrationSupport); } } }
Source:
private boolean validateExtension(String path) { boolean isValid = false; String[] splittedPath = path.split("\\.", -1); if (splittedPath.length > 1) { String extension = splittedPath[splittedPath.length - 1]; for (ImageFileFormat element : ImageFileFormat.VALUES) { if (element.getName().toLowerCase().equals(extension.toLowerCase())) { isValid = true; break; } } } return isValid; }

Target:
private boolean validateExtension(String path) { boolean isValid = false; String extension = new org.eclipse.core.runtime.Path(path).getFileExtension(); for (ImageFileFormat element : ImageFileFormat.VALUES) { if (element.getName().equalsIgnoreCase(extension)) { isValid = true; break; } } return isValid; }
Source:
private Server createAndStartServer(int port, HandlerList handlers) throws Exception { final Server server = new Server(port); server.setHandler(handlers); server.setStopAtShutdown(true); server.start(); this.port = ((NetworkConnector)server.getConnectors()[0]).getLocalPort(); LOGGER.info("Jetty started on port {}", this.port); return server; }

Target:
private Server createAndStartServer(int port, HandlerList handlers) throws Exception { final Server server = new Server(port); server.setHandler(handlers); server.setStopAtShutdown(true); server.setRequestLog(createRequestLog()); server.start(); this.port = ((NetworkConnector)server.getConnectors()[0]).getLocalPort(); LOGGER.info("Jetty started on port {}", this.port); return server; }
Source:
private String convertToJSONString(Object content){ Gson gson = new Gson(); String json = gson.toJson(content); System.out.println(json); return json; }

Target:
private String convertToJSONString(Object content){ Gson gson = new Gson(); String json = gson.toJson(content); LOG.debug(json); return json; }
Source:
private static void append(StringBuilder builder, String value) { if (StringUtils.hasText(value)) { builder.append(value).append(SEPARATOR); } }

Target:
private static void append(StringBuilder builder, String value) { if (StringUtils.hasText(value)) { builder.append(SEPARATOR).append(value); } }
Source:
protected void configure() { super.configure(); install(new LocationsFromComputeServiceAdapterModule<ServerInDataCenter, Hardware, Provisionable, DataCenter>() { }); install(new FactoryModuleBuilder().build(ProvisioningJob.Factory.class)); bind(ImplicitLocationSupplier.class).to(OnlyLocationOrFirstZone.class).in(Singleton.class); bind(new TypeLiteral<ComputeServiceAdapter<ServerInDataCenter, Hardware, Provisionable, DataCenter>>() { }).to(ProfitBricksComputeServiceAdapter.class); bind(new TypeLiteral<Function<org.apache.jclouds.profitbricks.rest.domain.Location, Location>>() { }).to(LocationToLocation.class); bind(new TypeLiteral<Function<DataCenter, Location>>() { }).to(DataCenterToLocation.class); bind(new TypeLiteral<Function<ServerInDataCenter, NodeMetadata>>() { }).to(ServerInDataCenterToNodeMetadata.class); bind(new TypeLiteral<Function<Server, NodeMetadata>>() { }).to(ServerToNodeMetadata.class); bind(new TypeLiteral<Function<Provisionable, Image>>() { }).to(ProvisionableToImage.class); bind(new TypeLiteral<Function<org.apache.jclouds.profitbricks.rest.domain.Volume, Volume>>() { }).to(VolumeToVolume.class); bind(new TypeLiteral<Function<Hardware, Hardware>>() { }).to(Class.class.cast(IdentityFunction.class)); }

Target:
protected void configure() { super.configure(); install(new FactoryModuleBuilder().build(ProvisioningJob.Factory.class)); bind(ImplicitLocationSupplier.class).to(OnlyLocationOrFirstZone.class).in(Scopes.SINGLETON); bind(CreateNodesInGroupThenAddToSet.class).to(AssignDataCenterToTemplate.class).in(Scopes.SINGLETON); bind(new TypeLiteral<ComputeServiceAdapter<ServerInDataCenter, Hardware, Provisionable, Location>>() { }).to(ProfitBricksComputeServiceAdapter.class); bind(TemplateBuilderImpl.class).to(ArbitraryCpuRamTemplateBuilderImpl.class); bind(new TypeLiteral<Function<ServerInDataCenter, NodeMetadata>>() { }).to(ServerInDataCenterToNodeMetadata.class); bind(new TypeLiteral<Function<Provisionable, Image>>() { }).to(ProvisionableToImage.class); bind(new TypeLiteral<Function<org.apache.jclouds.profitbricks.rest.domain.Volume, Volume>>() { }).to(VolumeToVolume.class); bind(new TypeLiteral<Function<Hardware, Hardware>>() { }).to(Class.class.cast(IdentityFunction.class)); }
Source:
private boolean setLookAndFeel(String lookAndFeelClassname) { if (lookAndFeelClassname != "" && lookAndFeelClassname != null) { try { UIManager.setLookAndFeel(lookAndFeelClassname); lookAndFeelSet = true; } catch (final UnsupportedLookAndFeelException | ClassNotFoundException | InstantiationException | IllegalAccessException e) { logger.warn("Failed to set the look and feel: " + e.getMessage()); } } return lookAndFeelSet; }

Target:
private static boolean setLookAndFeel(String lookAndFeelClassname) { if (StringUtils.isNotEmpty(lookAndFeelClassname)) { try { UIManager.setLookAndFeel(lookAndFeelClassname); return true; } catch (final UnsupportedLookAndFeelException | ClassNotFoundException | InstantiationException | IllegalAccessException e) { logger.warn("Failed to set the look and feel: " + e.getMessage()); } } return false; }
Source:
public void truncate(long zxid) throws IOException { FileTxnIterator itr = null; RandomAccessFile raf = null; try { itr = new FileTxnIterator(this.logDir, zxid); PositionInputStream input = itr.inputStream; if(input == null) { throw new IOException("No log files found to truncate! This could " + "happen if you still have snapshots from an old setup or " + "log files were deleted accidentally or dataLogDir was changed in zoo.cfg."); } long pos = input.getPosition(); raf = new RandomAccessFile(itr.logFile, "rw"); raf.setLength(pos); while(itr.goToNextLog()) { try { Files.delete(itr.logFile.toPath()); } catch (NoSuchFileException e) { } } } finally { close(itr); if (raf != null) { raf.close(); } } }

Target:
public void truncate(long zxid) throws IOException { FileTxnIterator itr = null; RandomAccessFile raf = null; try { itr = new FileTxnIterator(this.logDir, zxid); PositionInputStream input = itr.inputStream; if(input == null) { throw new IOException("No log files found to truncate! This could " + "happen if you still have snapshots from an old setup or " + "log files were deleted accidentally or dataLogDir was changed in zoo.cfg."); } long pos = input.getPosition(); raf = new RandomAccessFile(itr.logFile, "rw"); raf.setLength(pos); while(itr.goToNextLog()) { try { Files.delete(itr.logFile.toPath()); } catch (NoSuchFileException e) { LOG.info("An NoSuchFileException was thrown when delete file {}" + ", but will continue. Assume this file has been deleted successfully.", itr.logFile); } } } finally { if (raf != null) { try { raf.close(); } catch (IOException e) { LOG.warn("Error closing RandomAccessFile {}, exception = ", raf, e); } } close(itr); } }
Source:
public void testBoundarySignalProcessInstance() throws Exception { Long processInstanceId = processClient.startProcess(CONTAINER_ID, PROCESS_ID_BOUNDARY_SIGNAL_PROCESS); assertNotNull(processInstanceId); assertTrue(processInstanceId.longValue() > 0); try { checkAvailableBoundarySignals(CONTAINER_ID, processInstanceId); } catch (Exception e){ processClient.abortProcessInstance(CONTAINER_ID, processInstanceId); e.printStackTrace(); fail(e.getMessage()); } }

Target:
public void testBoundarySignalProcessInstance() throws Exception { Long processInstanceId = processClient.startProcess(CONTAINER_ID, PROCESS_ID_BOUNDARY_SIGNAL_PROCESS); assertNotNull(processInstanceId); assertTrue(processInstanceId.longValue() > 0); try { checkAvailableBoundarySignals(CONTAINER_ID, processInstanceId); } finally { processClient.abortProcessInstance(CONTAINER_ID, processInstanceId); } }
Source:
public static void validateTaskConfig(final PluginTask task) { String username = task.getUsername(); if (isNullOrEmpty(username)) { throw new ConfigException("Username or email could not be empty"); } String password = task.getPassword(); if (isNullOrEmpty(password)) { throw new ConfigException("Password could not be empty"); } String uri = task.getUri(); if (isNullOrEmpty(uri)) { throw new ConfigException("JIRA API endpoint could not be empty"); } try (CloseableHttpClient client = HttpClientBuilder.create() .setDefaultRequestConfig(RequestConfig.custom() .setConnectTimeout(HTTP_TIMEOUT) .setConnectionRequestTimeout(HTTP_TIMEOUT) .setSocketTimeout(HTTP_TIMEOUT) .setCookieSpec(CookieSpecs.STANDARD) .build()) .build()) { HttpGet request = new HttpGet(task.getUri()); try (CloseableHttpResponse response = client.execute(request)) { response.getStatusLine().getStatusCode(); } } catch (IOException | IllegalArgumentException e) { throw new ConfigException("JIRA API endpoint is incorrect or not available"); } int retryInitialWaitSec = task.getInitialRetryIntervalMillis(); if (retryInitialWaitSec < 1) { throw new ConfigException("Initial retry delay should be equal or greater than 1"); } int retryLimit = task.getRetryLimit(); if (retryLimit < 0 || retryLimit > 10) { throw new ConfigException("Retry limit should between 0 and 10"); } }

Target:
public static void validateTaskConfig(final PluginTask task) { String username = task.getUsername(); if (isNullOrEmpty(username)) { throw new ConfigException("Username or email could not be empty"); } String password = task.getPassword(); if (isNullOrEmpty(password)) { throw new ConfigException("Password could not be empty"); } String uri = task.getUri(); if (isNullOrEmpty(uri)) { throw new ConfigException("JIRA API endpoint could not be empty"); } try (CloseableHttpClient client = HttpClientBuilder.create() .setDefaultRequestConfig(RequestConfig.custom() .setConnectTimeout(HTTP_TIMEOUT) .setConnectionRequestTimeout(HTTP_TIMEOUT) .setSocketTimeout(HTTP_TIMEOUT) .setCookieSpec(CookieSpecs.STANDARD) .build()) .build()) { HttpGet request = new HttpGet(uri); try (CloseableHttpResponse response = client.execute(request)) { response.getStatusLine().getStatusCode(); } } catch (IOException | IllegalArgumentException e) { throw new ConfigException("JIRA API endpoint is incorrect or not available"); } int retryInitialWaitSec = task.getInitialRetryIntervalMillis(); if (retryInitialWaitSec < 1) { throw new ConfigException("Initial retry delay should be equal or greater than 1"); } int retryLimit = task.getRetryLimit(); if (retryLimit < 0 || retryLimit > 10) { throw new ConfigException("Retry limit should between 0 and 10"); } }
Source:
private RoutingAlgorithm createAlgo() { StopWatch sw = new StopWatch().start(); RoutingAlgorithm algo = algoFactory.createAlgo(queryGraph, algoOpts); debug = ", algoInit:" + (sw.stop().getNanos() / 1000) + " micros"; return algo; }

Target:
private RoutingAlgorithm createAlgo() { StopWatch sw = new StopWatch().start(); RoutingAlgorithm algo = algoFactory.createAlgo(queryGraph, algoOpts); debug = ", algoInit:" + (sw.stop().getNanos() / 1000) + " μs"; return algo; }
Source:
@Override public void init(Context context) throws IOException { this.ctx = context; return; }

Target:
@Override public void init(Context context) throws IOException { this.ctx = context; }
Source:
public List<Facility> getFacilities(PerunSession sess, Map<String, String> attributesWithSearchingValues) throws PrivilegeException, InternalErrorException, AttributeNotExistsException, WrongAttributeAssignmentException { if (!AuthzResolver.authorizedInternal(sess, "getFacilities_Map<String, String>_policy", Collections.emptyList())) throw new PrivilegeException(sess, "getFacilities"); return searcherBl.getFacilities(sess, attributesWithSearchingValues); }

Target:
public List<Facility> getFacilities(PerunSession sess, Map<String, String> attributesWithSearchingValues) throws PrivilegeException, InternalErrorException, AttributeNotExistsException, WrongAttributeAssignmentException { if (!AuthzResolver.authorizedInternal(sess, "getFacilities_Map<String_String>_policy")) throw new PrivilegeException(sess, "getFacilities"); return searcherBl.getFacilities(sess, attributesWithSearchingValues); }
Source:
public List<String> getExpectedBannedColumns() { List<String> bannedColumns = new ArrayList<String>(); bannedColumns.add(COL_ID_PROCESSNAME); bannedColumns.add("Actions"); return bannedColumns; }

Target:
public List<String> getExpectedBannedColumns() { List<String> bannedColumns = new ArrayList<String>(); bannedColumns.add(COL_ID_PROCESSNAME); bannedColumns.add(COL_ID_ACTIONS); return bannedColumns; }
Source:
public Object java_switch() { String res; switch (random) { case 0: res = "zero"; break; default: res = "fallback"; } assert "zero".equals(res); return res; }

Target:
public Object java_switch() { String res; switch (random) { case 0: res = "0"; break; case 1: res = "1"; break; case 2: res = "2"; break; case 3: res = "3"; break; default: res = "error"; } assert String.valueOf(random).equals(res); return res; }
Source:
public void onMessage(String messageType, JSONObject messagePayload) { try { String href = messagePayload.getString("href"); if (href.startsWith(" href = "https:" + href; } Log.d("Wikipedia", "Link clicked was " + href); if (href.startsWith("/wiki/")) { bus.post(new NewWikiPageNavigationEvent(PageTitle.fromInternalLink(href, app.getPrimarySite()))); } else { handleExternalLink(href); } } catch (JSONException e) { throw new RuntimeException(e); } }

Target:
public void onMessage(String messageType, JSONObject messagePayload) { try { String href = messagePayload.getString("href"); if (href.startsWith(" href = "https:" + href; } Log.d("Wikipedia", "Link clicked was " + href); if (href.startsWith("/wiki/")) { bus.post(new NewWikiPageNavigationEvent(app.getPrimarySite().titleForInternalLink(href))); } else { handleExternalLink(href); } } catch (JSONException e) { throw new RuntimeException(e); } }
Source:
public void showOfflineModeDialog() { AlertDialog.Builder builder = new AlertDialog.Builder(getActivity(), R.style.MaterialAlertDialogStyle); builder.setTitle("Offline Mode"); builder.setMessage("You are in offline mode, Please go to Navigation drawer " + "and switch to online mode. \n\n If you are trying to sync Groups" + " Please make sure your internet connection is working well"); builder.setPositiveButton("OK", null); builder.show(); }

Target:
public void showOfflineModeDialog() { new MaterialDialog.Builder().init(getActivity()) .setTitle(R.string.offline_mode) .setMessage(R.string.dialog_message_offline_sync_alert) .setPositiveButton(R.string.dialog_action_go_online, this) .setNegativeButton(R.string.dialog_action_cancel, this) .createMaterialDialog() .show(); }
Source:
public void registerForPush(boolean clearFcmData){ boolean registerForPushAvailable = false; if (storageManagerPreferences != null) { if (allPushRegisterDataAvailable()) { new FcmConfigurationHandler(storageManagerPreferences, this).registerForPush(clearFcmData); registerForPushAvailable = true; } } if (!registerForPushAvailable) { if (isServiceAttached && listener != null) { listener.onWarning(RCClient.ErrorCodes.ERROR_DEVICE_PUSH_PARAMETERS_MISSING.ordinal(), RCClient.errorText(RCClient.ErrorCodes.ERROR_DEVICE_PUSH_PARAMETERS_MISSING)); } else { RCLogger.w(TAG, "RegisterForPush warning: " + RCClient.errorText(RCClient.ErrorCodes.ERROR_DEVICE_PUSH_PARAMETERS_MISSING)); } } }

Target:
public void registerForPush(boolean clearFcmData){ boolean registerForPushAvailable = false; if (storageManagerPreferences != null) { if (allPushRegisterDataAvailable()) { new FcmConfigurationHandler(storageManagerPreferences, this).registerForPush(clearFcmData); registerForPushAvailable = true; } } if (!registerForPushAvailable) { if (isServiceAttached && listener != null) { listener.onWarning(this, RCClient.ErrorCodes.ERROR_DEVICE_PUSH_PARAMETERS_MISSING.ordinal(), RCClient.errorText(RCClient.ErrorCodes.ERROR_DEVICE_PUSH_PARAMETERS_MISSING)); } else { RCLogger.w(TAG, "RegisterForPush warning: " + RCClient.errorText(RCClient.ErrorCodes.ERROR_DEVICE_PUSH_PARAMETERS_MISSING)); } } }
Source:
@Override public List<Pair<RelTraitSet, List<RelTraitSet>>> passThroughCorrelation(RelTraitSet nodeTraits, List<RelTraitSet> inTraits) { if (TraitUtils.correlation(nodeTraits).correlated()) return ImmutableList.of(); return ImmutableList.of(Pair.of(nodeTraits, Commons.transform(inTraits, t -> t.replace(CorrelationTrait.UNCORRELATED)))); }

Target:
@Override public List<Pair<RelTraitSet, List<RelTraitSet>>> passThroughCorrelation(RelTraitSet nodeTraits, List<RelTraitSet> inTraits) { return ImmutableList.of(Pair.of(nodeTraits, Commons.transform(inTraits, t -> t.replace(TraitUtils.correlation(nodeTraits))))); }
Source:
private void initUserAnswers() { OrderedHashtable<String, QueryPrompt> queryPrompts = queryDatum.getUserQueryPrompts(); for (Enumeration en = queryPrompts.keys(); en.hasMoreElements(); ) { String promptId = (String)en.nextElement(); QueryPrompt prompt = queryPrompts.get(promptId); userAnswers.put(prompt.getKey(), ""); } }

Target:
private void initUserAnswers() throws XPathException { OrderedHashtable<String, QueryPrompt> queryPrompts = queryDatum.getUserQueryPrompts(); for (Enumeration en = queryPrompts.keys(); en.hasMoreElements(); ) { String promptId = (String)en.nextElement(); QueryPrompt prompt = queryPrompts.get(promptId); String defaultValue = ""; if(prompt.getDefaultValueExpr() != null) { defaultValue = FunctionUtils.toString(prompt.getDefaultValueExpr().eval(evaluationContext)); } userAnswers.put(prompt.getKey(), defaultValue); } }