auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static File mkdirs(File dir) throws IOException { try { return Files.createDirectories(dir.toPath()).toFile(); } catch (UnsupportedOperationException e) { throw new IOException(e); } }

Target:
public static File mkdirs(File dir) throws IOException { try { return Files.createDirectories(fileToPath(dir)).toFile(); } catch (UnsupportedOperationException e) { throw new IOException(e); } }
Source:
public void progress() { this.progressCounter++; if (this.player.isDead() || !this.player.isOnline()) { this.remove(); return; } else if (this.currentLoc != null && GeneralMethods.isRegionProtectedFromBuild(this, this.currentLoc)) { this.remove(); return; } if (this.origin == null) { this.direction = this.player.getEyeLocation().getDirection().normalize(); this.origin = GeneralMethods.getMainHandLocation(player).add(this.direction.clone().multiply(10)); } if (this.progressCounter < 8) { return; } if (this.destination == null) { this.destination = GeneralMethods.getMainHandLocation(player).add(GeneralMethods.getMainHandLocation(player).getDirection().normalize().multiply(10)); final Vector origToDest = GeneralMethods.getDirection(this.origin, this.destination); for (double i = 0; i < 30; i++) { final Location endLoc = this.origin.clone().add(origToDest.clone().multiply(i / 30)); if (GeneralMethods.locationEqualsIgnoreDirection(GeneralMethods.getMainHandLocation(player), endLoc)) { continue; } final Vector vec = GeneralMethods.getDirection(GeneralMethods.getMainHandLocation(player), endLoc); final FireComboStream fs = new FireComboStream(this.player, this, vec, GeneralMethods.getMainHandLocation(player), this.range, this.speed); fs.setDensity(1); fs.setSpread(0F); fs.setUseNewParticles(true); fs.setParticleEffect(getAirbendingParticles()); fs.setCollides(false); fs.runTaskTimer(ProjectKorra.plugin, (long) (i / 2.5), 1L); this.tasks.add(fs); } } this.manageAirVectors(); }

Target:
public void progress() { this.progressCounter++; if (this.player.isDead() || !this.player.isOnline()) { this.remove(); return; } else if (this.currentLoc != null && GeneralMethods.isRegionProtectedFromBuild(this, this.currentLoc)) { this.remove(); return; } if (this.origin == null) { this.direction = this.player.getEyeLocation().getDirection().normalize(); this.origin = GeneralMethods.getMainHandLocation(player).add(this.direction.clone().multiply(10)); } if (this.progressCounter < 8) { return; } if (this.destination == null) { this.destination = GeneralMethods.getMainHandLocation(player).add(GeneralMethods.getMainHandLocation(player).getDirection().normalize().multiply(10)); final Vector origToDest = GeneralMethods.getDirection(this.origin, this.destination); final Location hand = GeneralMethods.getMainHandLocation(player); for (double i = 0; i < 30; i++) { final Location endLoc = this.origin.clone().add(origToDest.clone().multiply(i / 30)); if (GeneralMethods.locationEqualsIgnoreDirection(hand, endLoc)) { continue; } final Vector vec = GeneralMethods.getDirection(hand, endLoc); final FireComboStream fs = new FireComboStream(this.player, this, vec, hand, this.range, this.speed); fs.setDensity(1); fs.setSpread(0F); fs.setUseNewParticles(true); fs.setParticleEffect(getAirbendingParticles()); fs.setCollides(false); fs.runTaskTimer(ProjectKorra.plugin, (long) (i / 2.5), 1L); this.tasks.add(fs); } } this.manageAirVectors(); }
Source:
public ProjectType getProjectType(Path path) { for(ProjectType type : projectTypes.keySet()) { if(type.getLanguagePlugin().isExerciseTypeCorrect(path)) { return type; } } return null; }

Target:
public ProjectType getProjectType(Path path) { for (ProjectType type : ProjectType.values()) { if (type.getLanguagePlugin().isExerciseTypeCorrect(path)) { return type; } } return null; }
Source:
public int hashCode() { int result = name.hashCode(); result = 31 * result + (version != null ? version.hashCode(): 0); return result; }

Target:
public int hashCode() { return Objects.hash(name, version); }
Source:
private void zipFile(File file, String path, ZipOutputStream zos) throws FileNotFoundException, java.io.IOException { try (FileInputStream fis = new FileInputStream(file)) { ZipEntry zipEntry = new ZipEntry(path); zos.putNextEntry(zipEntry); int length; while ((length = fis.read(buffer)) >= 0) { zos.write(buffer, 0, length); } zos.closeEntry(); } }

Target:
private void zipFile(File file, String path, ZipOutputStream zos) throws java.io.IOException { try (FileInputStream fis = new FileInputStream(file)) { ZipEntry zipEntry = new ZipEntry(path); zos.putNextEntry(zipEntry); int length; while ((length = fis.read(buffer)) >= 0) { zos.write(buffer, 0, length); } zos.closeEntry(); } }
Source:
public String listRunningThirdPartyProcesses() { String psOutput = runAdbCommand("shell ps"); StringBuilder sb = new StringBuilder(); boolean isFirstHeaderLine = true; for (String line: Splitter.on(System.getProperty("line.separator")).split(psOutput)) { boolean isThirdPartyProcess = line.contains(".") && !line.contains("com.android"); if (isFirstHeaderLine || isThirdPartyProcess) { sb.append(line + System.getProperty("line.separator")); } isFirstHeaderLine = false; } return sb.toString(); }

Target:
public String listRunningThirdPartyProcesses() { String psOutput = runAdbCommand("shell ps"); StringBuilder sb = new StringBuilder(); boolean isFirstHeaderLine = true; for (String line: Splitter.on("\n").split(psOutput)) { boolean isThirdPartyProcess = line.contains(".") && !line.contains("com.android"); if (isFirstHeaderLine || isThirdPartyProcess) { sb.append(line + "\n"); } isFirstHeaderLine = false; } return sb.toString(); }
Source:
private static String getRealRelativeFilePath(String basepath, String absolutePath) throws IOException { String realAbsolutePath = Paths.get(absolutePath).toRealPath().toString(); String realBasePath = Paths.get(basepath).toRealPath().toString(); return basepath.endsWith("/") ? realAbsolutePath.substring(realBasePath.length()) : realAbsolutePath.substring(realBasePath.length() + 1); }

Target:
private static String getRealRelativeFilePath(String basepath, String absolutePath) throws IOException { String realAbsolutePath = Paths.get(absolutePath).toRealPath().toString(); String realBasePath = Paths.get(basepath).toRealPath().toString(); return basepath.endsWith(File.separator) ? realAbsolutePath.substring(realBasePath.length()) : realAbsolutePath.substring(realBasePath.length() + 1); }
Source:
public BlazeArc(final Player player, final Location location, final Vector direction, final double range) { super(player); this.range = this.getDayFactor(range); this.speed = getConfig().getLong("Abilities.Fire.Blaze.Speed"); this.interval = (long) (1000. / this.speed); if(bPlayer.canUseSubElement(SubElement.BLUE_FIRE)) { this.range += BlueFireAbility.getRangeFactor() * range; } this.origin = location.clone(); this.location = this.origin.clone(); this.direction = direction.clone(); this.direction.setY(0); this.direction = this.direction.clone().normalize(); this.location = this.location.clone().add(this.direction); this.time = System.currentTimeMillis(); this.start(); }

Target:
public BlazeArc(final Player player, final Location location, final Vector direction, final double range) { super(player); this.range = this.getDayFactor(range); this.speed = getConfig().getLong("Abilities.Fire.Blaze.Speed"); this.interval = (long) (1000.0 / this.speed); if(bPlayer.canUseSubElement(SubElement.BLUE_FIRE)) { this.range += BlueFireAbility.getRangeFactor() * range - range; } this.origin = location.clone(); this.location = this.origin.clone(); this.direction = direction.clone(); this.direction.setY(0); this.direction = this.direction.clone().normalize(); this.location = this.location.clone().add(this.direction); this.time = System.currentTimeMillis(); this.start(); }
Source:
public void testConnectionFailed() { resetCallbacks(); createMediaBrowser(TEST_WRONG_BROWSER_SERVICE); mMediaBrowser.connect(); new PollingCheck(TIME_OUT_MS) { @Override protected boolean check() { return mConnectionCallback.mConnectionFailedCount > 0; } }.run(); }

Target:
public void testConnectionFailed() { resetCallbacks(); createMediaBrowser(TEST_INVALID_BROWSER_SERVICE); mMediaBrowser.connect(); new PollingCheck(TIME_OUT_MS) { @Override protected boolean check() { return mConnectionCallback.mConnectionFailedCount > 0 && mConnectionCallback.mConnectedCount == 0 && mConnectionCallback.mConnectionSuspendedCount == 0; } }.run(); }
Source:
public void gather(MetricsCollector collector) { List<LockInfo> locks = getLocks(); LocalDateTime limitForAcquired = LocalDateTime.now().minus(LONG_RUNNING_LOGS_THRESHOLD); collector.metric("locks-count", "Active Locks", locks.size(), null); collector.metric("locks-long-running", "Long locks", locks.stream() .filter(lock -> Objects.nonNull(lock.getAcquired())) .filter(lock -> lock.getAcquired().isBefore(limitForAcquired)) .count(), null); }

Target:
public void gather(MetricsCollector collector) { List<LockInfo> locks = getLocks(); LocalDateTime limitForAcquired = LocalDateTime.now().minus(LONG_RUNNING_LOGS_THRESHOLD); collector.metric("locks-count", "Active Locks", locks.size(), null); collector.metric("locks-long-running", "Long locks", locks.stream() .map(LockInfo::getAcquired) .filter(Objects::nonNull) .filter(date -> date.isBefore(limitForAcquired)) .count(), null); }
Source:
public void cannotReadForWrongSweepStrategy() { assertThat(readThorough(shard)).isEmpty(); assertThat(readConservative(shard2)).isEmpty(); }

Target:
public void cannotReadForWrongSweepStrategy() { assertThat(readThorough(shardCons)).isEmpty(); assertThat(readConservative(shardThor)).isEmpty(); }
Source:
int getClientWidth () { if ((state & ZERO_WIDTH) != 0) return 0; GtkAllocation allocation = new GtkAllocation(); if (handle != 0) { gtk_widget_get_allocation (handle, allocation); return allocation.width; } else { return 0; } }

Target:
int getClientWidth () { if (handle == 0 || (state & ZERO_WIDTH) != 0) return 0; GtkAllocation allocation = new GtkAllocation(); gtk_widget_get_allocation (handle, allocation); return allocation.width; }
Source:
public @Nullable DiskRequest getDiskRequestFrom(List<ITmfStateInterval> fullState) { if (fQuark > fullState.size()) { fLastRequest = null; return null; } if (fullState.get(fQuark).getStateValue().isNull()) { fLastRequest = null; return null; } DiskRequest request = fLastRequest; if (request != null && fullState.get(fQuark).getEndTime() == request.getEndTime()) { return request; } fLastRequest = fQueue.getRequestFrom(fullState, fQuark); return fLastRequest; }

Target:
public @Nullable DiskRequest getDiskRequestFrom(List<ITmfStateInterval> fullState) { if (fQuark > fullState.size()) { fLastRequest = null; return null; } ITmfStateInterval interval = fullState.get(fQuark); if (interval.getStateValue().isNull()) { fLastRequest = null; return null; } DiskRequest request = fLastRequest; if (request != null && interval.getEndTime() == request.getEndTime()) { return request; } fLastRequest = fQueue.getRequestFrom(fullState, fQuark); return fLastRequest; }
Source:
private void resetOffset( KafkaConsumer<byte[], byte[]> consumer, Set<Integer> assignment, TopicPartition topicPartition ) { log.warn( "Resetting consumer offset to [%s] for partition [%d]", ioConfig.isUseEarliestOffset() ? "earliest" : "latest", topicPartition.partition() ); if (ioConfig.isUseEarliestOffset()) { consumer.seekToBeginning(topicPartition); } else { consumer.seekToEnd(topicPartition); } nextOffsets.put(topicPartition.partition(), consumer.position(topicPartition)); log.warn("Consumer is now at offset [%d]", consumer.position(topicPartition)); if (consumer.position(topicPartition) >= endOffsets.get(topicPartition.partition()) && assignment.remove(topicPartition.partition())) { log.info( "Finished reading topic[%s], partition[%,d].", topicPartition.topic(), topicPartition.partition() ); } assignPartitions(consumer, topicPartition.topic(), assignment); }

Target:
private void resetOffset( KafkaConsumer<byte[], byte[]> consumer, Set<Integer> assignment, TopicPartition topicPartition ) { log.warn( "Resetting consumer offset to [%s] for partition [%d]", ioConfig.isUseEarliestOffset() ? "earliest" : "latest", topicPartition.partition() ); if (ioConfig.isUseEarliestOffset()) { consumer.seekToBeginning(topicPartition); } else { consumer.seekToEnd(topicPartition); } nextOffsets.put(topicPartition.partition(), consumer.position(topicPartition)); log.warn("Consumer is now at offset [%d]", nextOffsets.get(topicPartition.partition())); if (nextOffsets.get(topicPartition.partition()) >= endOffsets.get(topicPartition.partition()) && assignment.remove(topicPartition.partition())) { log.info( "Finished reading topic[%s], partition[%,d].", topicPartition.topic(), topicPartition.partition() ); } assignPartitions(consumer, topicPartition.topic(), assignment); }
Source:
public String toString() { if (fieldString == null && fieldBytes != null) { try { Object array = readBinaryArray(1, 0); if (PrimitiveArraySupport.isSupportedPrimitiveArray(array)) { fieldString = PrimitiveArraySupport.arrayToString(connection.getTypeInfo().getArrayDelimiter(oid), array); } else { java.sql.Array tmpArray = connection.createArrayOf(getBaseTypeName(), (Object[]) array); fieldString = tmpArray.toString(); } } catch (SQLException e) { fieldString = "NULL"; } } return fieldString; }

Target:
public String toString() { if (fieldString == null && fieldBytes != null) { try { Object array = readBinaryArray(1, 0); final PrimitiveArraySupport arraySupport = PrimitiveArraySupport.getArraySupport(array); if (arraySupport != null) { fieldString = arraySupport.toArrayString(connection.getTypeInfo().getArrayDelimiter(oid), array); } else { java.sql.Array tmpArray = connection.createArrayOf(getBaseTypeName(), (Object[]) array); fieldString = tmpArray.toString(); } } catch (SQLException e) { fieldString = "NULL"; } } return fieldString; }
Source:
public MissingParameterException(String parameterName) { super(ERROR_CODE); this.parameterName = parameterName; }

Target:
public MissingParameterException(String parameterName) { super(ERROR_CODE); this.parameterName = requireNonNull(parameterName); }
Source:
public void testRegisterMultipleClusterListener() { reset(); TestClusterListener clusterListener1 = new TestClusterListener(); _state.registerClusterListener(clusterListener1); TestClusterListener clusterListener2 = new TestClusterListener(); _state.registerClusterListener(clusterListener2); _state.listenToCluster(CLUSTER1_CLUSTER_NAME, new NullStateListenerCallback()); _state.listenToCluster(CLUSTER2_CLUSTER_NAME, new NullStateListenerCallback()); _clusterRegistry.put(CLUSTER1_CLUSTER_NAME, new ClusterProperties(CLUSTER1_CLUSTER_NAME)); _clusterRegistry.put(CLUSTER2_CLUSTER_NAME, new ClusterProperties(CLUSTER2_CLUSTER_NAME)); _clusterRegistry.put(CLUSTER2_CLUSTER_NAME, new ClusterProperties(CLUSTER2_CLUSTER_NAME)); assertEquals(clusterListener1.getCount(CLUSTER1_CLUSTER_NAME), 1, "expected 1 call"); assertEquals(clusterListener2.getCount(CLUSTER2_CLUSTER_NAME), 2, "expected 2 call"); }

Target:
public void testRegisterMultipleClusterListener() { reset(); MockClusterListener clusterListener1 = new MockClusterListener(); _state.registerClusterListener(clusterListener1); MockClusterListener clusterListener2 = new MockClusterListener(); _state.registerClusterListener(clusterListener2); _state.listenToCluster(CLUSTER1_CLUSTER_NAME, new NullStateListenerCallback()); _state.listenToCluster(CLUSTER2_CLUSTER_NAME, new NullStateListenerCallback()); _clusterRegistry.put(CLUSTER1_CLUSTER_NAME, new ClusterProperties(CLUSTER1_CLUSTER_NAME)); _clusterRegistry.put(CLUSTER2_CLUSTER_NAME, new ClusterProperties(CLUSTER2_CLUSTER_NAME)); _clusterRegistry.put(CLUSTER2_CLUSTER_NAME, new ClusterProperties(CLUSTER2_CLUSTER_NAME)); assertEquals(clusterListener1.getClusterAddedCount(CLUSTER1_CLUSTER_NAME), 1, "expected 1 call for cluster1"); assertEquals(clusterListener2.getClusterAddedCount(CLUSTER2_CLUSTER_NAME), 2, "expected 2 call for cluster2"); assertEquals(clusterListener1.getClusterAddedCount(CLUSTER2_CLUSTER_NAME), 2, "expected 1 call for cluster2"); assertEquals(clusterListener2.getClusterAddedCount(CLUSTER1_CLUSTER_NAME), 1, "expected 1 call for cluster1"); }
Source:
public void makeBucket(String bucketName, String region) throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, IOException, InvalidKeyException, NoResponseException, XmlPullParserException, ErrorResponseException, InternalException { Map<String,String> headerMap = new HashMap<>(); String configString; if (region == null || US_EAST_1.equals(region)) { configString = ""; } else { CreateBucketConfiguration config = new CreateBucketConfiguration(region); configString = config.toString(); } executePut(bucketName, null, headerMap, null, US_EAST_1, configString, configString.length()); }

Target:
public void makeBucket(String bucketName, String region) throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, IOException, InvalidKeyException, NoResponseException, XmlPullParserException, ErrorResponseException, InternalException { String configString; if (region == null || US_EAST_1.equals(region)) { configString = ""; } else { CreateBucketConfiguration config = new CreateBucketConfiguration(region); configString = config.toString(); } HttpResponse response = executePut(bucketName, null, null, null, US_EAST_1, configString, 0); response.body().close(); }
Source:
public ServiceTest(TOptions options) throws IllegalStateException { super(options); String connectionString = System.getenv("EVENTHUBS_CONNECTION_STRING"); String eventHubName = System.getenv("EVENTHUB_NAME"); if (CoreUtils.isNullOrEmpty(connectionString)) { throw new IllegalStateException("Environment variable EVENTHUBS_CONNECTION_STRING must be set"); } if (CoreUtils.isNullOrEmpty(eventHubName)) { throw new IllegalStateException("Environment variable EVENTHUB_NAME must be set"); } EventHubClientBuilder builder = new EventHubClientBuilder() .connectionString(connectionString, eventHubName); eventHubProducerAsyncClient = builder.buildAsyncProducerClient(); eventHubProducerClient = builder.buildProducerClient(); }

Target:
public ServiceTest(TOptions options) throws IllegalStateException { super(options); connectionString = System.getenv("EVENTHUBS_CONNECTION_STRING"); eventHubName = System.getenv("EVENTHUB_NAME"); if (CoreUtils.isNullOrEmpty(connectionString)) { throw new IllegalStateException("Environment variable EVENTHUBS_CONNECTION_STRING must be set"); } if (CoreUtils.isNullOrEmpty(eventHubName)) { throw new IllegalStateException("Environment variable EVENTHUB_NAME must be set"); } }
Source:
private FilePath createWindowsStandardAskpass(StandardUsernamePasswordCredentials creds) throws IOException, InterruptedException { FilePath askpass = workspace.createTempFile("pass", ".bat"); askpass.write("@set arg=%~1\n" + "@if (%arg:~0,8%)==(Username) echo " + quoteWindowsCredentials(creds.getUsername()) + "\n" + "@if (%arg:~0,8%)==(Password) echo " + quoteWindowsCredentials(Secret.toString(creds.getPassword())), null); askpass.chmod(0700); return askpass; }

Target:
private FilePath createWindowsStandardAskpass(StandardUsernamePasswordCredentials creds) throws IOException, InterruptedException { FilePath askpass = workspace.createTextTempFile("pass", ".bat", "@set arg=%~1\r\n" + "@if (%arg:~0,8%)==(Username) echo " + quoteWindowsCredentials(creds.getUsername()) + "\r\n" + "@if (%arg:~0,8%)==(Password) echo " + quoteWindowsCredentials(Secret.toString(creds.getPassword())), false); return askpass; }
Source:
public void testNullOperators() throws Exception { DataType<?> type; do { type = randomType(); } while (type == DataTypes.INTERVAL); execute("create table t1 (c " + type.getName() + ") with (number_of_replicas = 0)"); Supplier dataGenerator = DataTypeTesting.getDataGenerator(type); Object[][] bulkArgs = $$($(dataGenerator.get()), $(dataGenerator.get()), new Object[]{null}); execute("insert into t1 (c) values (?)", bulkArgs); execute("refresh table t1"); execute("select count(*) from t1 where c is null"); assertThat(printedTable(response.rows()), is("1\n")); execute("select count(*) from t1 where c is not null"); assertThat(printedTable(response.rows()), is("2\n")); }

Target:
public void testNullOperators() throws Exception { DataType<?> type = randomType(); execute("create table t1 (c " + type.getName() + ") with (number_of_replicas = 0)"); Supplier dataGenerator = DataTypeTesting.getDataGenerator(type); Object[][] bulkArgs = $$($(dataGenerator.get()), $(dataGenerator.get()), new Object[]{null}); execute("insert into t1 (c) values (?)", bulkArgs); execute("refresh table t1"); execute("select count(*) from t1 where c is null"); assertThat(printedTable(response.rows()), is("1\n")); execute("select count(*) from t1 where c is not null"); assertThat(printedTable(response.rows()), is("2\n")); }
Source:
protected void executeQueryCommand() { Optional<Network> defRouteNetwork = networkDao .getAllForCluster((getParameters()).getClusterId()).stream() .filter(n -> n.getCluster().isDefaultRoute()) .findFirst(); Optional<NetworkAttachment> attachment = networkAttachmentDao .getAllForHost((getParameters()).getHostId()).stream() .filter(na -> defRouteNetwork.isPresent() && Objects.equals(na.getNetworkId(), defRouteNetwork.get().getId())) .findFirst(); getQueryReturnValue().setReturnValue(attachment.isPresent()); }

Target:
protected void executeQueryCommand() { Optional<Network> defRouteNetwork = networkDao .getAllForCluster(getParameters().getClusterId()).stream() .filter(n -> n.getCluster().isDefaultRoute()) .findFirst(); Optional<NetworkAttachment> attachment = networkAttachmentDao .getAllForHost(getParameters().getHostId()).stream() .filter(na -> defRouteNetwork.isPresent() && Objects.equals(na.getNetworkId(), defRouteNetwork.get().getId())) .findFirst(); getQueryReturnValue().setReturnValue(attachment.isPresent()); }
Source:
public int findCloseOffset(String line, int lineOffset) { if (nestedBlock == null) { return findCloseOffset(line, lineOffset); } return nestedBlock.findCloseOffset(line, lineOffset); }

Target:
public int findCloseOffset(String line, int lineOffset) { if (nestedBlock == null) { return super.findCloseOffset(line, lineOffset); } return nestedBlock.findCloseOffset(line, lineOffset); }
Source:
private static JSONArray buildEnumerateResult(final List<String> extensions) throws FalconException { JSONArray results = new JSONArray(); ExtensionMetricStore metricStore = ExtensionStore.get().getMetricStore(); List<ExtensionMetadataBean> beanList = metricStore.getAllExtensions(); for (ExtensionMetadataBean bean : beanList) { JSONObject resultObject = new JSONObject(); try { resultObject.put(EXTENSION_NAME, bean.getExtensionName().toLowerCase()); resultObject.put(EXTENSION_TYPE, bean.getExtensionType()); resultObject.put(EXTENSION_DESC, bean.getDescription()); } catch (JSONException e) { throw new FalconException(e); } results.put(resultObject); } return results; }

Target:
private static JSONArray buildEnumerateResult(final List<String> extensions) throws FalconException { JSONArray results = new JSONArray(); ExtensionMetaStore metricStore = ExtensionStore.get().getMetaStore(); List<ExtensionMetadataBean> beanList = metricStore.getAllExtensions(); for (ExtensionMetadataBean bean : beanList) { JSONObject resultObject = new JSONObject(); try { resultObject.put(EXTENSION_NAME, bean.getExtensionName().toLowerCase()); resultObject.put(EXTENSION_TYPE, bean.getExtensionType()); resultObject.put(EXTENSION_DESC, bean.getDescription()); resultObject.put(EXTENSION_LOCATION, bean.getLocation()); } catch (JSONException e) { throw new FalconException(e); } results.put(resultObject); } return results; }
Source:
public Optional<String> getMqttUri() { String mqttUri = null; try { if (hasMqttConfig()) { mqttUri = config.getJSONObject(NSBarcodeConfigKeys.MQTT_CONFIG).getString(NSBarcodeConfigKeys.MQTT_URI); } else { return Optional.absent(); } } catch (JSONException e) { return Optional.absent(); } return Optional.of(mqttUri); }

Target:
public Optional<String> getMqttUri() { String mqttUri = null; try { if (hasMqttConfig()) { mqttUri = config.getJSONObject(NSBarcodeConfigKeys.MQTT_CONFIG).getString(NSBarcodeConfigKeys.MQTT_URI); } } catch (JSONException e) { return Optional.fromNullable(mqttUri); } return Optional.of(mqttUri); }
Source:
protected static Iterator<BucketResult> getResultsIterator(@AggregationState PrecisionRecallState state) { if (state.getTrueWeights() == null) { return Collections.<BucketResult>emptyList().iterator(); } final double totalTrueWeight = Streams.stream(state.getTrueWeights().iterator()) .mapToDouble(c -> c.getWeight()) .sum(); final double totalFalseWeight = Streams.stream(state.getFalseWeights().iterator()) .mapToDouble(c -> c.getWeight()) .sum(); return new Iterator<BucketResult>() { Iterator<FixedDoubleHistogram.Bucket> trueIt = state.getTrueWeights().iterator(); Iterator<FixedDoubleHistogram.Bucket> falseIt = state.getFalseWeights().iterator(); double runningFalseWeight; double runningTrueWeight; @Override public boolean hasNext() { return trueIt.hasNext() && totalTrueWeight > runningTrueWeight; } @Override public BucketResult next() { if (!trueIt.hasNext() || !falseIt.hasNext()) { throw new NoSuchElementException(); } final FixedDoubleHistogram.Bucket trueResult = trueIt.next(); final FixedDoubleHistogram.Bucket falseResult = falseIt.next(); final BucketResult result = new BucketResult( trueResult.getLeft(), totalTrueWeight, totalFalseWeight, totalTrueWeight - runningTrueWeight, runningFalseWeight, runningTrueWeight, totalFalseWeight - runningFalseWeight); runningTrueWeight += trueResult.getWeight(); runningFalseWeight += falseResult.getWeight(); return result; } @Override public void remove() { throw new UnsupportedOperationException(); } }; }

Target:
protected static Iterator<BucketResult> getResultsIterator(@AggregationState PrecisionRecallState state) { if (state.getTrueWeights() == null) { return Collections.<BucketResult>emptyList().iterator(); } double totalTrueWeight = Streams.stream(state.getTrueWeights().iterator()) .mapToDouble(FixedDoubleHistogram.Bucket::getWeight) .sum(); double totalFalseWeight = Streams.stream(state.getFalseWeights().iterator()) .mapToDouble(FixedDoubleHistogram.Bucket::getWeight) .sum(); return new Iterator<BucketResult>() { Iterator<FixedDoubleHistogram.Bucket> trueIterator = state.getTrueWeights().iterator(); Iterator<FixedDoubleHistogram.Bucket> falseIterator = state.getFalseWeights().iterator(); double runningFalseWeight; double runningTrueWeight; @Override public boolean hasNext() { return trueIterator.hasNext() && totalTrueWeight > runningTrueWeight; } @Override public BucketResult next() { if (!trueIterator.hasNext() || !falseIterator.hasNext()) { throw new NoSuchElementException(); } FixedDoubleHistogram.Bucket trueResult = trueIterator.next(); FixedDoubleHistogram.Bucket falseResult = falseIterator.next(); BucketResult result = new BucketResult( trueResult.getLeft(), totalTrueWeight, totalFalseWeight, totalTrueWeight - runningTrueWeight, runningFalseWeight, runningTrueWeight, totalFalseWeight - runningFalseWeight); runningTrueWeight += trueResult.getWeight(); runningFalseWeight += falseResult.getWeight(); return result; } @Override public void remove() { throw new UnsupportedOperationException(); } }; }
Source:
private VmStatsRefresher getRefresherForVds(VdsManager vdsManager) { Version version = vdsManager.getCompatibilityVersion(); VDS vds = vdsManager.getCopyVds(); if ((FeatureSupported.jsonProtocol(version) && VdsProtocol.STOMP == vds.getProtocol() && FeatureSupported.vmStatsEvents(version)) || (FeatureSupported.jsonProtocol(version) && VdsProtocol.STOMP == vds.getProtocol() && FeatureSupported.events(version))) { return new EventVmStatsRefresher(vdsManager); } return new PollListAndAllVmStatsRefresher(vdsManager); }

Target:
private VmStatsRefresher getRefresherForVds(VdsManager vdsManager) { Version version = vdsManager.getCompatibilityVersion(); VDS vds = vdsManager.getCopyVds(); if ((FeatureSupported.jsonProtocol(version) && VdsProtocol.STOMP == vds.getProtocol() && FeatureSupported.vmStatsEvents(version)) && FeatureSupported.events(version)){ return new EventVmStatsRefresher(vdsManager); } return new PollListAndAllVmStatsRefresher(vdsManager); }
Source:
public void getDefaultCredentials_envUser_providesToken() throws IOException { InputStream userStream = UserCredentialsTest.writeUserStream(USER_CLIENT_ID, USER_CLIENT_SECRET, REFRESH_TOKEN); TestDefaultCredentialsProvider testProvider = new TestDefaultCredentialsProvider(); File credentialFile = File.createTempFile("user", ".json"); credentialFile.deleteOnExit(); String userPath = credentialFile.getPath(); testProvider.addFile(userPath, userStream); testProvider.setEnv(DefaultCredentialsProvider.CREDENTIAL_ENV_VAR, userPath); testUserProvidesToken( testProvider, USER_CLIENT_ID, USER_CLIENT_SECRET, REFRESH_TOKEN); }

Target:
public void getDefaultCredentials_envUser_providesToken() throws IOException { InputStream userStream = UserCredentialsTest.writeUserStream(USER_CLIENT_ID, USER_CLIENT_SECRET, REFRESH_TOKEN); TestDefaultCredentialsProvider testProvider = new TestDefaultCredentialsProvider(); String userPath = tempFilePath("user.json"); testProvider.addFile(userPath, userStream); testProvider.setEnv(DefaultCredentialsProvider.CREDENTIAL_ENV_VAR, userPath); testUserProvidesToken( testProvider, USER_CLIENT_ID, USER_CLIENT_SECRET, REFRESH_TOKEN); }
Source:
protected Mediator createSpecificMediator(OMElement elem, Properties properties) { invoker = new InvokeMediator(); processAuditStatus(invoker, elem); OMAttribute targetTemplateAttr = elem.getAttribute(ATT_TARGET); if (targetTemplateAttr != null) { if (StringUtils.isNotEmpty(targetTemplateAttr.getAttributeValue())) { invoker.setTargetTemplate(targetTemplateAttr.getAttributeValue()); buildParameters(elem); } else { String msg = "EIP Invoke mediator should have a non empty target name specified."; log.error(msg); throw new SynapseException(msg); } } else { String msg = "EIP Invoke mediator should have a target template specified."; log.error(msg); throw new SynapseException(msg); } OMAttribute errorHandlerAttr = elem.getAttribute(ATT_ONERROR); if (errorHandlerAttr != null) { if (StringUtils.isNotEmpty(errorHandlerAttr.getAttributeValue())) { invoker.setErrorHandler(errorHandlerAttr.getAttributeValue()); } } addAllCommentChildrenToList(elem, invoker.getCommentsList()); return invoker; }

Target:
protected Mediator createSpecificMediator(OMElement elem, Properties properties) { invoker = new InvokeMediator(); processAuditStatus(invoker, elem); OMAttribute targetTemplateAttr = elem.getAttribute(ATT_TARGET); if (targetTemplateAttr != null) { if (StringUtils.isNotEmpty(targetTemplateAttr.getAttributeValue())) { invoker.setTargetTemplate(targetTemplateAttr.getAttributeValue()); buildParameters(elem); } else { String msg = "EIP Invoke mediator should have a non empty target name specified."; log.error(msg); throw new SynapseException(msg); } } else { String msg = "EIP Invoke mediator should have a target template specified."; log.error(msg); throw new SynapseException(msg); } OMAttribute errorHandlerAttr = elem.getAttribute(ATT_ONERROR); if ((errorHandlerAttr != null) && (StringUtils.isNotEmpty(errorHandlerAttr.getAttributeValue()))) { invoker.setErrorHandler(errorHandlerAttr.getAttributeValue()); } addAllCommentChildrenToList(elem, invoker.getCommentsList()); return invoker; }
Source:
public void addPartition(String dbName, String tableName, Map <String, String> partSpec) { String key = getKey(normalizeIdentifier(dbName), normalizeIdentifier(tableName)); updateMetaDataList.get(updateMetaDataMap.get(key)).addPartition(partSpec); }

Target:
public void addPartition(String dbName, String tableName, Map <String, String> partSpec) throws SemanticException { if (dbName == null) { throw new SemanticException("db name can not be null"); } String key = getKey(normalizeIdentifier(dbName), normalizeIdentifier(tableName)); Integer idx = updateMetaDataMap.get(key); if (idx == null) { throw new SemanticException("add partition to metadata map failed as list is not yet set for table : " + key); } updateMetaDataList.get(idx).addPartition(partSpec); }
Source:
public static QuantityType<?> operator_multiply(Number x, QuantityType<?> y) { BigDecimal xValue = numberToBigDecimal(x); if (xValue == null) { return new QuantityType<>("0"); } else if (y == null) { return new QuantityType<>("0"); } else { return y.multiply(xValue); } }

Target:
public static QuantityType<?> operator_multiply(Number x, QuantityType<?> y) { BigDecimal xValue = numberToBigDecimal(x); if (xValue == null) { return QuantityType.ZERO; } else if (y == null) { return QuantityType.ZERO; } else { return y.multiply(xValue); } }
Source:
public void addToClasspath(URL u, boolean updateDto) { if (updateDto) classpath.entries.add(u.toExternalForm()); addToClasspath(new URLClassLoader(new URL[] { u })); }

Target:
public void addToClasspath(URL u, boolean updateDto) { if (updateDto) classpath.getEntries().add(u.toExternalForm()); addToClasspath(new URLClassLoader(new URL[] { u })); }
Source:
public boolean isNUllRow(int[] row, Indexed<String> encodings) { if (row == null) { return true; } for (int i : row) { if (encodings.get(i) != null) { return false; } } return true; }

Target:
private boolean isNUllRow(int[] row, Indexed<String> encodings) { if (row == null) { return true; } for (int i : row) { if (encodings.get(i) != null) { return false; } } return true; }
Source:
protected boolean accept(EdgeIteratorState edge, SPTEntry currEdge, boolean reverse) { final int incEdge = getIncomingEdge(currEdge); final int prevOrNextEdgeId = getOrigEdgeId(edge, !reverse); double turnWeight = reverse ? turnWeighting.calcTurnWeight(prevOrNextEdgeId, edge.getBaseNode(), incEdge) : turnWeighting.calcTurnWeight(incEdge, edge.getBaseNode(), prevOrNextEdgeId); if (turnWeight == Double.POSITIVE_INFINITY) { return false; } return additionalEdgeFilter == null || additionalEdgeFilter.accept(edge); }

Target:
protected boolean accept(EdgeIteratorState edge, SPTEntry currEdge, boolean reverse) { final int incEdge = getIncomingEdge(currEdge); final int prevOrNextEdgeId = getOrigEdgeId(edge, !reverse); double turnWeight = reverse ? turnWeighting.calcTurnWeight(prevOrNextEdgeId, edge.getBaseNode(), incEdge) : turnWeighting.calcTurnWeight(incEdge, edge.getBaseNode(), prevOrNextEdgeId); if (Double.isInfinite(turnWeight)) { return false; } return additionalEdgeFilter == null || additionalEdgeFilter.accept(edge); }
Source:
private void handleInetSockLocalIn(ITmfEvent event) { Object cpuObj = TmfTraceUtils.resolveEventAspectOfClassForEvent(event.getTrace(), TmfCpuAspect.class, event); if (cpuObj == null) { throw new NullPointerException(); } Integer cpu = (Integer) cpuObj; String host = event.getTrace().getHostId(); LttngSystemModel system = getProvider().getSystem(); LttngInterruptContext intCtx = system.peekContextStack(host, cpu); Context context = intCtx.getContext(); if (context == Context.SOFTIRQ) { LttngWorker k = getOrCreateKernelWorker(event, cpu); TmfVertex endpoint = stateExtend(k, event.getTimestamp().getValue()); fTcpNodes.put(event, endpoint); fTcpMatching.matchEvent(event, event.getTrace(), new NullProgressMonitor()); } }

Target:
private void handleInetSockLocalIn(ITmfEvent event) { Object cpuObj = TmfTraceUtils.resolveEventAspectOfClassForEvent(event.getTrace(), TmfCpuAspect.class, event); if (cpuObj == null) { throw new NullPointerException(); } Integer cpu = (Integer) cpuObj; String host = event.getTrace().getHostId(); LttngSystemModel system = getProvider().getSystem(); LttngInterruptContext intCtx = system.peekContextStack(host, cpu); Context context = intCtx.getContext(); if (context == Context.SOFTIRQ) { LttngWorker k = getOrCreateKernelWorker(event, cpu); TmfVertex endpoint = stateExtend(k, event.getTimestamp().getValue()); fTcpNodes.put(event, endpoint); fTcpMatching.matchEvent(event, event.getTrace(), DEFAULT_PROGRESS_MONITOR); } }
Source:
public void onPlayerCrash(EntityDamageEvent e) { if (!(e.getEntity() instanceof Player)) return; if (!(e.getCause() == EntityDamageEvent.DamageCause.FALL || e.getCause() == EntityDamageEvent.DamageCause.FLY_INTO_WALL)) return; Player p = (Player) e.getEntity(); if (p.isGliding()) { ItemStack stack = p.getInventory().getHelmet(); SlimefunItem item = SlimefunItem.getByItem(stack); if (!Slimefun.hasUnlocked(p, item, true)) return; if (item instanceof ProtectiveArmor) { Optional<PlayerProfile> optional = PlayerProfile.find(p); if (!optional.isPresent()) { PlayerProfile.request(p); return; } PlayerProfile profile = optional.get(); if (profile.hasFullProtectionAgainst(ProtectionType.FLYING_INTO_WALL)) { e.setDamage(0); p.playSound(p.getLocation(), Sound.BLOCK_STONE_HIT, 20, 1); if (p.getGameMode() != GameMode.CREATIVE && item instanceof DamageableItem) { ((DamageableItem) item).damageItem(p, stack); } } } } }

Target:
public void onPlayerCrash(EntityDamageEvent e) { if (!(e.getEntity() instanceof Player)) return; if (!(e.getCause() == EntityDamageEvent.DamageCause.FALL || e.getCause() == EntityDamageEvent.DamageCause.FLY_INTO_WALL)) return; Player p = (Player) e.getEntity(); if (p.isGliding()) { Optional<PlayerProfile> optional = PlayerProfile.find(p); if (!optional.isPresent()) { PlayerProfile.request(p); return; } PlayerProfile profile = optional.get(); HashedArmorpiece helmet = profile.getArmor()[0]; if (helmet.getItem().isPresent()) { SlimefunItem item = helmet.getItem().get(); if (Slimefun.hasUnlocked(p, item, true) && profile.hasFullProtectionAgainst(ProtectionType.FLYING_INTO_WALL)) { e.setDamage(0); p.playSound(p.getLocation(), Sound.BLOCK_STONE_HIT, 20, 1); if (p.getGameMode() != GameMode.CREATIVE && item instanceof DamageableItem) { ((DamageableItem) item).damageItem(p, p.getInventory().getHelmet()); } } } } }
Source:
protected ListenerList<IDebugContextListener> getListeners(IWorkbenchPart part) { String id = null; if (part != null) { id = getCombinedPartId(part); ListenerList<IDebugContextListener> listenerList = fListenersByPartId.get(id); return listenerList != null ? listenerList : new ListenerList<IDebugContextListener>(); } else { ListenerList<IDebugContextListener> listenerList = fListenersByPartId.get(null); ListenerList<IDebugContextListener> retVal = new ListenerList<>(); if (listenerList != null) { for (IDebugContextListener iDebugContextListener : listenerList) { retVal.add(iDebugContextListener); } } outer: for (Iterator<String> itr = fListenersByPartId.keySet().iterator(); itr.hasNext();) { String listenerPartId = itr.next(); for (int i = 0; i < fProviders.size(); i++) { String providerPartId = getCombinedPartId(fProviders.get(i).getPart()); if ((listenerPartId == null && providerPartId == null) || (listenerPartId != null && listenerPartId.equals(providerPartId))) { continue outer; } } for (IDebugContextListener iDebugContextListener : fListenersByPartId.get(listenerPartId)) { if (iDebugContextListener != null) { retVal.add(iDebugContextListener); } } } return retVal; } }

Target:
protected ListenerList<IDebugContextListener> getListeners(IWorkbenchPart part) { String id = null; if (part != null) { id = getCombinedPartId(part); ListenerList<IDebugContextListener> listenerList = fListenersByPartId.get(id); return listenerList != null ? listenerList : new ListenerList<IDebugContextListener>(); } else { ListenerList<IDebugContextListener> listenerList = fListenersByPartId.get(null); ListenerList<IDebugContextListener> retVal = new ListenerList<>(); if (listenerList != null) { for (IDebugContextListener iDebugContextListener : listenerList) { retVal.add(iDebugContextListener); } } outer: for (Iterator<String> itr = fListenersByPartId.keySet().iterator(); itr.hasNext();) { String listenerPartId = itr.next(); for (int i = 0; i < fProviders.size(); i++) { String providerPartId = getCombinedPartId(fProviders.get(i).getPart()); if ((listenerPartId == null && providerPartId == null) || (listenerPartId != null && listenerPartId.equals(providerPartId))) { continue outer; } } ListenerList<IDebugContextListener> listenersForPart = fListenersByPartId.get(listenerPartId); if (listenersForPart != null) { for (IDebugContextListener iDebugContextListener : listenersForPart) { retVal.add(iDebugContextListener); } } } return retVal; } }
Source:
public void init() throws MojoFailureException { try { client = KieServicesFactory.newKieServicesClient(config); } catch (RuntimeException kieEx) { throw new MojoFailureException("error on establish connection with remote server: " + kieEx.getMessage()); } }

Target:
public void init() throws MojoFailureException { try { client = KieServicesFactory.newKieServicesClient(config); } catch (RuntimeException kieEx) { throw new MojoFailureException("error on establish connection with remote server: " + kieEx.getMessage(), kieEx.getCause()); } }
Source:
public void setPermissionLevel(FolderPermissionLevel value) throws ServiceLocalException { if (this.permissionLevel != value) { if (value == FolderPermissionLevel.Custom) { throw new ServiceLocalException( "The PermissionLevel property can't be set to FolderPermissionLevel.Custom. To define a custom permission, set its individual properties to the values you want."); } this.AssignIndividualPermissions(defaultPermissions.getMember() .get(value)); if (this.canSetFieldValue(this.permissionLevel, value)) { this.permissionLevel = value; this.changed(); } } }

Target:
public void setPermissionLevel(FolderPermissionLevel value) throws ServiceLocalException { if (this.permissionLevel != value) { if (value == FolderPermissionLevel.Custom) { throw new ServiceLocalException( "The PermissionLevel property can't be set to FolderPermissionLevel.Custom. " + "To define a custom permission, set its individual properties to the values you want."); } this.AssignIndividualPermissions(defaultPermissions.getMember() .get(value)); if (this.canSetFieldValue(this.permissionLevel, value)) { this.permissionLevel = value; this.changed(); } } }
Source:
public void shouldRecycleTask() { EasyMock.expectLastCall(); stateManager.flush(); EasyMock.expectLastCall(); stateManager.checkpoint(Collections.emptyMap()); EasyMock.expectLastCall(); stateManager.recycle(); EasyMock.expectLastCall(); EasyMock.expect(stateManager.changelogOffsets()).andReturn(Collections.emptyMap()); EasyMock.replay(stateManager); task = createStandbyTask(); task.initializeIfNeeded(); task.closeAndRecycleState(); EasyMock.verify(stateManager); }

Target:
public void shouldRecycleTask() { stateManager.flush(); EasyMock.expectLastCall(); stateManager.recycle(); EasyMock.expectLastCall(); EasyMock.replay(stateManager); task = createStandbyTask(); task.initializeIfNeeded(); task.closeAndRecycleState(); EasyMock.verify(stateManager); }
Source:
private void visitTypeDef(DetailAST typeDef) { if (isVerifiable(typeDef)) { checkIdent(typeDef.findFirstToken(TokenTypes.IDENT)); checkTypeParameters(typeDef); final DetailAST extendsClause = typeDef.findFirstToken(TokenTypes.EXTENDS_CLAUSE); if (extendsClause != null) { checkBaseTypes(extendsClause); } final DetailAST implementsClause = typeDef.findFirstToken(TokenTypes.IMPLEMENTS_CLAUSE); if (implementsClause != null) { checkBaseTypes(implementsClause); } } }

Target:
private void visitTypeDef(DetailAST typeDef) { if (isVerifiable(typeDef)) { checkTypeParameters(typeDef); final DetailAST extendsClause = typeDef.findFirstToken(TokenTypes.EXTENDS_CLAUSE); if (extendsClause != null) { checkBaseTypes(extendsClause); } final DetailAST implementsClause = typeDef.findFirstToken(TokenTypes.IMPLEMENTS_CLAUSE); if (implementsClause != null) { checkBaseTypes(implementsClause); } } }
Source:
public void initialize() throws Exception { super.init(userMode); backendUrl = gatewayContextMgt.getContextUrls().getBackEndUrl(); loginClient = new AuthenticatorClient(backendUrl); String session = loginClient.login(user.getUserName(), user.getPassword(), "localhost"); lifeCycleAdminClient = new LifeCycleAdminClient(backendUrl, session); originalLifeCycleContent = lifeCycleAdminClient.getLifecycleConfiguration(apiLifeCycleName); String customizedAPILifecycleContent = FileManager.readFile(customizedAPILifecyclePath); lifeCycleAdminClient.editLifeCycle(apiLifeCycleName, customizedAPILifecycleContent); String gatewayUrl; if (gatewayContextWrk.getContextTenant().getDomain().equals(MultitenantConstants.SUPER_TENANT_DOMAIN_NAME)) { gatewayUrl = gatewayUrlsWrk.getWebAppURLNhttp(); } else { gatewayUrl = gatewayUrlsWrk.getWebAppURLNhttp() + "t/" + gatewayContextWrk.getContextTenant().getDomain() + "/"; } apiEndPointUrl = gatewayUrl + "jaxrs_basic/services/customers/customerservice"; APIRequest apiRequest = new APIRequest(API_NAME, API_CONTEXT, new URL(apiEndPointUrl)); apiRequest.setVersion(API_VERSION_1_0_0); apiRequest.setSandbox(apiEndPointUrl); apiRequest.setProvider(user.getUserName()); HttpResponse serviceResponse = restAPIPublisher.addAPI(apiRequest); apiId = serviceResponse.getData(); }

Target:
public void initialize() throws Exception { super.init(userMode); backendUrl = gatewayContextMgt.getContextUrls().getBackEndUrl(); loginClient = new AuthenticatorClient(backendUrl); String session = loginClient.login(user.getUserName(), user.getPassword(), "localhost"); lifeCycleAdminClient = new LifeCycleAdminClient(backendUrl, session); originalLifeCycleContent = lifeCycleAdminClient.getLifecycleConfiguration(apiLifeCycleName); String customizedAPILifecycleContent = FileManager.readFile(customizedAPILifecyclePath); lifeCycleAdminClient.editLifeCycle(apiLifeCycleName, customizedAPILifecycleContent); String gatewayUrl; if (MultitenantConstants.SUPER_TENANT_DOMAIN_NAME.equals(gatewayContextWrk.getContextTenant().getDomain())) { gatewayUrl = gatewayUrlsWrk.getWebAppURLNhttp(); } else { gatewayUrl = gatewayUrlsWrk.getWebAppURLNhttp() + "t/" + gatewayContextWrk.getContextTenant().getDomain() + "/"; } apiEndPointUrl = gatewayUrl + "jaxrs_basic/services/customers/customerservice"; APIRequest apiRequest = new APIRequest(API_NAME, API_CONTEXT, new URL(apiEndPointUrl)); apiRequest.setVersion(API_VERSION_1_0_0); apiRequest.setSandbox(apiEndPointUrl); apiRequest.setProvider(user.getUserName()); HttpResponse serviceResponse = restAPIPublisher.addAPI(apiRequest); apiId = serviceResponse.getData(); }
Source:
public void addAttribute(String key, Object value) { fProperties.put(key, value); if (key.equals(NAME)) { fName = (String) value; } if (key.equals(FREQ)) { fIsScaled = !Objects.equals(getProperty(FREQ), ONE_BILLION_L); fClockScale = ONE_BILLION_D / ((Long) getProperty(FREQ)).doubleValue(); fClockAntiScale = 1.0 / fClockScale; fTotalClockOffset = internalGetOffset(); } if (key.equals(OFFSET)) { fClockOffset = (Long) getProperty(OFFSET); fTotalClockOffset = internalGetOffset(); } if (key.equals(OFFSET_S)) { BigDecimal offsetNs = BigDecimal.valueOf(((Long) getProperty(OFFSET_S))).multiply(BigDecimal.valueOf(ONE_BILLION_L)); fClockOffsetNanoSeconds = offsetNs.compareTo(BigDecimal.valueOf(Long.MAX_VALUE)) > 0 ? 0 : offsetNs.longValue(); fTotalClockOffset = internalGetOffset(); } }

Target:
public void addAttribute(String key, Object value) { fProperties.put(key, value); if (key.equals(NAME)) { fName = (String) value; } if (key.equals(FREQ)) { fIsScaled = !Objects.equals(getProperty(FREQ), ONE_BILLION_L); fClockScale = ONE_BILLION_D / ((Long) getProperty(FREQ)).doubleValue(); fClockAntiScale = 1.0 / fClockScale; } if (key.equals(OFFSET)) { fClockOffset = (Long) getProperty(OFFSET); } if (key.equals(OFFSET_S)) { BigDecimal offsetNs = BigDecimal.valueOf(((Long) getProperty(OFFSET_S))).multiply(BigDecimal.valueOf(ONE_BILLION_L)); fClockOffsetNanoSeconds = offsetNs.compareTo(BigDecimal.valueOf(Long.MAX_VALUE)) > 0 ? 0 : offsetNs.longValue(); } }
Source:
public FlowFactory getFlowFactory() { if (flowFactory == null) { throw new UnsupportedOperationException("TODO"); } return flowFactory; }

Target:
public FlowFactory getFlowFactory() { if (flowFactory == null) { throw new UnsupportedOperationException("The coroutines framework is missing from the classpath. " + "Remember to add it as an implementation dependency. " + "See <LINK_0> for more details"); } return flowFactory; }