auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void updateShardsAndIndex(long tableId, Map<UUID, DeltaUuidPair> toUpdateShard, Handle handle) throws SQLException { if (toUpdateShard.isEmpty()) { return; } String args = Joiner.on(",").join(nCopies(toUpdateShard.size(), "?")); ImmutableMap.Builder<Long, UUID> shardMapBuilder = ImmutableMap.builder(); String selectShards = format("" + "SELECT shard_id, shard_uuid\n" + "FROM shards\n" + "WHERE shard_uuid IN (%s)", args); try (PreparedStatement statement = handle.getConnection().prepareStatement(selectShards)) { bindUuids(statement, toUpdateShard.keySet()); try (ResultSet rs = statement.executeQuery()) { while (rs.next()) { shardMapBuilder.put(rs.getLong("shard_id"), uuidFromBytes(rs.getBytes("shard_uuid"))); } } } Map<Long, UUID> shardIdToUuid = shardMapBuilder.build(); if (toUpdateShard.size() != shardIdToUuid.size()) { throw transactionConflict(); } int updatedCount = 0; try (ShardsAndIndexUpdater shardsAndIndexUpdater = new ShardsAndIndexUpdater(handle.getConnection(), tableId)) { for (List<Long> batch : partition(shardIdToUuid.keySet(), batchSize(handle.getConnection()))) { for (int i = 0; i < batch.size(); i++) { Long shardId = batch.get(i); shardsAndIndexUpdater.update( shardId, toUpdateShard.get(shardIdToUuid.get(shardId)).getOldDeltaUuid(), toUpdateShard.get(shardIdToUuid.get(shardId)).getNewDeltaUuid()); } updatedCount += shardsAndIndexUpdater.execute(); } } if (updatedCount != shardIdToUuid.size()) { log.error("updatedCount is not equal to shardIdToUuid size"); throw transactionConflict(); } }

Target:
private void updateShardsAndIndex(long tableId, Map<UUID, DeltaUuidPair> toUpdateShard, Handle handle) throws SQLException { if (toUpdateShard.isEmpty()) { return; } String args = Joiner.on(",").join(nCopies(toUpdateShard.size(), "?")); ImmutableMap.Builder<Long, UUID> shardMapBuilder = ImmutableMap.builder(); String selectShards = format("" + "SELECT shard_id, shard_uuid\n" + "FROM shards\n" + "WHERE shard_uuid IN (%s)", args); try (PreparedStatement statement = handle.getConnection().prepareStatement(selectShards)) { bindUuids(statement, toUpdateShard.keySet()); try (ResultSet rs = statement.executeQuery()) { while (rs.next()) { shardMapBuilder.put(rs.getLong("shard_id"), uuidFromBytes(rs.getBytes("shard_uuid"))); } } } Map<Long, UUID> shardIdToUuid = shardMapBuilder.build(); if (toUpdateShard.size() != shardIdToUuid.size()) { throw transactionConflict(); } int updatedCount = 0; try (ShardsAndIndexUpdater shardsAndIndexUpdater = new ShardsAndIndexUpdater(handle.getConnection(), tableId)) { for (List<Long> batch : partition(shardIdToUuid.keySet(), batchSize(handle.getConnection()))) { for (long shardId : batch) { shardsAndIndexUpdater.update( shardId, toUpdateShard.get(shardIdToUuid.get(shardId)).getOldDeltaUuid(), toUpdateShard.get(shardIdToUuid.get(shardId)).getNewDeltaUuid()); } updatedCount += shardsAndIndexUpdater.execute(); } } if (updatedCount != shardIdToUuid.size()) { log.error("updatedCount is not equal to shardIdToUuid size"); throw transactionConflict(); } }
Source:
private boolean isVMsContainingBootableDisks(Disk diskInfo, List<VM> vms) { boolean vmsContainBootDisk = false; StringBuilder vmsContainingBootDisk = new StringBuilder(); for (VM vm : vms) { VmHandler.updateDisksForVm(vm, getOtherVmDisks(vm.getId())); for (Disk disk : vm.getDiskMap().values()) { if (disk.isBoot()) { if (vmsContainBootDisk) { vmsContainingBootDisk.append(", "); } vmsContainingBootDisk.append(vm.getName()); vmsContainBootDisk = true; } } } if (vmsContainBootDisk) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_VMS_BOOT_IN_USE); getReturnValue().getCanDoActionMessages().add( String.format("$VmsName %1$s", vmsContainingBootDisk.toString())); return false; } return true; }

Target:
private boolean isVMsContainingBootableDisks(Disk diskInfo, List<VM> vms) { boolean vmsContainBootDisk = false; StringBuilder vmsContainingBootDisk = new StringBuilder(); for (VM vm : vms) { Disk bootDisk = getDiskDao().getVmBootDisk(vm.getId()); if (bootDisk != null) { if (vmsContainBootDisk) { vmsContainingBootDisk.append(", "); } vmsContainingBootDisk.append(vm.getName()); vmsContainBootDisk = true; } } if (vmsContainBootDisk) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_VMS_BOOT_IN_USE); getReturnValue().getCanDoActionMessages().add( String.format("$VmsName %1$s", vmsContainingBootDisk.toString())); return false; } return true; }
Source:
public Set<WorkerNetAddress> getWorkerAddresses() throws UnavailableException { if (mSafeModeManager.isInSafeMode()) { throw new UnavailableException(ExceptionMessage.MASTER_IN_SAFEMODE.getMessage()); } Set<WorkerNetAddress> workerAddresses = new HashSet<>(); for (MasterWorkerInfo worker : mWorkers) { workerAddresses.add(worker.getWorkerAddress()); } return workerAddresses; }

Target:
public Set<WorkerNetAddress> getWorkerAddresses() throws UnavailableException { if (mSafeModeManager.isInSafeMode()) { throw new UnavailableException(ExceptionMessage.MASTER_IN_SAFEMODE.getMessage()); } Set<WorkerNetAddress> workerAddresses = new HashSet<>(mWorkers.size()); for (MasterWorkerInfo worker : mWorkers) { workerAddresses.add(worker.getWorkerAddress()); } return workerAddresses; }
Source:
public void body(String body) { this.body = body; if (!contentLengthManuallySet) { String charsetValue = response.getCharacterEncoding() == null ? "ISO-8859-1" : response.getCharacterEncoding(); Charset charset = null; if (charset != null) { response.setContentLength(this.body.getBytes(charset).length); } else if (LOG.isDebugEnabled()) { LOG.debug("unable to retrieve charset for name '{}'", charsetValue); } } }

Target:
public void body(String body) { this.body = body; if (!contentLengthManuallySet) { calculateContentLength(); } }
Source:
public ElasticSearchIndexProvider(MetaModelStore metaModelStore, ElasticSearchContext elasticSearchContext, Analyzer analyzer) { this.elasticMetaModel = new ElasticSearchMappingStore(this); this.metaModelStore = metaModelStore; this.elasticSearchContext = elasticSearchContext; this.analyzer = analyzer; this.fieldFactory = new MappingFieldFactory(this.elasticMetaModel); }

Target:
public ElasticSearchIndexProvider(MetaModelStore metaModelStore, ElasticSearchContext elasticSearchContext, Analyzer analyzer) { this.elasticSearchMappingStore = new ElasticSearchMappingStore(this); this.metaModelStore = metaModelStore; this.elasticSearchContext = elasticSearchContext; this.analyzer = analyzer; this.fieldFactory = new MappingFieldFactory(this.elasticSearchMappingStore); }
Source:
public boolean execute(BlockComponentHolder component) { try { for (Component c : component.values()) { if (c.canTick()) { c.tick(dt); } } } catch (Exception e) { Spout.getLogger().log(Level.SEVERE, "Unhandled exception while ticking block component", e); } return true; }

Target:
public boolean execute(BlockComponentHolder component) { for (Component c : component.values()) { try { if (c.canTick()) { c.tick(dt); } } catch (Exception e) { Spout.getLogger().log(Level.SEVERE, "Unhandled exception while ticking block component", e); } } return true; }
Source:
public KafkaSystemConsumer(Consumer<K, V> kafkaConsumer, String systemName, Config config, String clientId, KafkaConsumerProxyFactory<K, V> kafkaConsumerProxyFactory, KafkaSystemConsumerMetrics metrics, Clock clock) { super(metrics.registry(), clock, metrics.getClass().getName()); this.kafkaConsumer = kafkaConsumer; this.clientId = clientId; this.systemName = systemName; this.config = config; this.metrics = metrics; fetchThresholdBytesEnabled = new KafkaConfig(config).isConsumerFetchThresholdBytesEnabled(systemName); messageSink = new KafkaConsumerMessageSink(); String metricName = String.format("%s-%s", systemName, clientId); proxy = kafkaConsumerProxyFactory.create(this.messageSink); LOG.info("{}: Created proxy ", this, proxy); }

Target:
public KafkaSystemConsumer(Consumer<K, V> kafkaConsumer, String systemName, Config config, String clientId, KafkaConsumerProxyFactory<K, V> kafkaConsumerProxyFactory, KafkaSystemConsumerMetrics metrics, Clock clock) { super(metrics.registry(), clock, metrics.getClass().getName()); this.kafkaConsumer = kafkaConsumer; this.clientId = clientId; this.systemName = systemName; this.config = config; this.metrics = metrics; fetchThresholdBytesEnabled = new KafkaConfig(config).isConsumerFetchThresholdBytesEnabled(systemName); messageSink = new KafkaConsumerMessageSink(); proxy = kafkaConsumerProxyFactory.create(this.messageSink); LOG.info("{}: Created proxy ", this, proxy); }
Source:
protected String[] fillTypeCombo() { ArrayList<String> list = new ArrayList<>(); for(DataType dataType : EventTypeLibrary.getInstance().getEventTypes()){ list.add(dataType.getName()); } return list.toArray(new String[0]); }

Target:
protected String[] fillTypeCombo() { List<String> list = new ArrayList<>(); for(DataType dataType : EventTypeLibrary.getInstance().getEventTypes()){ list.add(dataType.getName()); } return list.toArray(new String[0]); }
Source:
public Boolean isCgroupEnabled() { return Optional.fromNullable(cgroupEnabled).or(false); }

Target:
public Boolean isCgroupEnabled() { return Optional.fromNullable(cgroupEnabled).or(DEFAULT_CGROUPS_ENABLED); }
Source:
static RestApi config(Project.NameKey name) { return ProjectApi.project(name).view("config"); }

Target:
static RestApi config(Project.NameKey name) { return project(name).view("config"); }
Source:
public Response getWorkerConfigHistory( @QueryParam("interval") final String interval, @QueryParam("count") final Integer count ) { Interval theInterval = interval == null ? null : new Interval(interval); if (theInterval == null && count != null && count > 0) { return Response.ok( auditManager.fetchAuditHistory( WorkerBehaviorConfig.CONFIG_KEY, WorkerBehaviorConfig.CONFIG_KEY, count ) ) .build(); } return Response.ok( auditManager.fetchAuditHistory( WorkerBehaviorConfig.CONFIG_KEY, WorkerBehaviorConfig.CONFIG_KEY, theInterval ) ) .build(); }

Target:
public Response getWorkerConfigHistory( @QueryParam("interval") final String interval, @QueryParam("count") final Integer count ) { Interval theInterval = interval == null ? null : new Interval(interval); if (theInterval == null && count != null) { try { return Response.ok( auditManager.fetchAuditHistory( WorkerBehaviorConfig.CONFIG_KEY, WorkerBehaviorConfig.CONFIG_KEY, count ) ) .build(); } catch (IllegalArgumentException e) { return Response.status(Response.Status.BAD_REQUEST) .entity(ImmutableMap.<String, Object>of("error", e.getMessage())) .build(); } } return Response.ok( auditManager.fetchAuditHistory( WorkerBehaviorConfig.CONFIG_KEY, WorkerBehaviorConfig.CONFIG_KEY, theInterval ) ) .build(); }
Source:
public Response updateFields( @PathParam("typeIdOrVarName") final String typeIdOrVarName, final UpdateFieldForm updateFieldForm, @Context final HttpServletRequest req) throws DotDataException, DotSecurityException { final InitDataObject initData = this.webResource.init(null, true, req, true, null); final User user = initData.getUser(); final List<Field> fieldsToUpdate = updateFieldForm.getFields(); final ContentType contentType = APILocator.getContentTypeAPI(user).find(typeIdOrVarName); final FieldLayout fieldLayout = new FieldLayout(contentType.fields()); final FieldLayout fieldLayoutUpdated = fieldLayout.update(fieldsToUpdate); fieldLayoutUpdated.validate(); this.saveFields(fieldsToUpdate, user); return Response.ok(new ResponseEntityView(fieldLayoutUpdated.getRows())).build(); }

Target:
public Response updateFields( @PathParam("typeIdOrVarName") final String typeIdOrVarName, final UpdateFieldForm updateFieldForm, @Context final HttpServletRequest req) throws DotDataException, DotSecurityException { final InitDataObject initData = this.webResource.init(null, true, req, true, null); final User user = initData.getUser(); final List<Field> fieldsToUpdate = updateFieldForm.getFields(); final ContentType contentType = APILocator.getContentTypeAPI(user).find(typeIdOrVarName); final FieldLayout fieldLayout = new FieldLayout(contentType.fields()); final FieldLayout fieldLayoutUpdated = fieldLayout.update(fieldsToUpdate); fieldLayoutUpdated.validate(); fieldAPI.saveFields(fieldsToUpdate, user); return Response.ok(new ResponseEntityView(fieldLayoutUpdated.getRows())).build(); }
Source:
public int getKeyCode() { return KeyCodes.KEY_M; }

Target:
public int getKeyCode() { return KeyCodes.KEY_SPACE; }
Source:
public void endElement(String uri, String localName, String qName) { if (currentV2Repository != null && localName.equals(TaskRepositoriesExternalizer.ELEMENT_TASK_REPOSITORYV2)) { taskRepositoriesV2.add(currentV2Repository); currentV2Repository = null; } }

Target:
public void endElement(String uri, String localName, String qName) { if (currentRepository != null && localName.equals(TaskRepositoriesExternalizer.ELEMENT_TASK_REPOSITORY)) { taskRepositories.add(currentRepository); currentRepository = null; } }
Source:
protected String formatUndefined(String formatPattern) { String undefinedFormatPattern = formatPattern.replaceAll(IDENTIFY_FORMAT_PATTERN_PATTERN, "%1\\$s"); try { return String.format(undefinedFormatPattern, "-"); } catch (Exception e) { logger.warn("Exception while formatting undefined value [sourcePattern={}, targetPattern={}, exception= ", formatPattern, undefinedFormatPattern, e); return "Err"; } }

Target:
protected String formatUndefined(String formatPattern) { String undefinedFormatPattern = formatPattern.replaceAll(IDENTIFY_FORMAT_PATTERN_PATTERN, "%1\\$s"); try { return String.format(undefinedFormatPattern, "-"); } catch (Exception e) { logger.warn( "Exception while formatting undefined value [sourcePattern={}, targetPattern={}, exceptionMessage={}]", formatPattern, undefinedFormatPattern, e.getMessage()); return "Err"; } }
Source:
public static void tearDown() { System.clearProperty("spring.config.location"); }

Target:
public static void tearDown() { if (originalConfigLocation != null) { System.setProperty("spring.config.location", originalConfigLocation); } }
Source:
public TypeClass(final String name, final Type ... types) { this.name = name; Arrays.sort(types.clone()); this.types = ImmutableList.copyOf(Arrays.asList(types)); }

Target:
public TypeClass(final String name, final Type ... types) { this.name = name; Arrays.sort(types); this.types = ImmutableList.copyOf(types); }
Source:
public static UserSqlSandbox getStaticStorage(String username) { return new UserSqlSandbox(username, null); }

Target:
public static UserSqlSandbox getStaticStorage(String username) { return new UserSqlSandbox(username); }
Source:
public HiveAnalyzeProperties(TypeManager typeManager) { analyzeProperties = ImmutableList.of( new PropertyMetadata<>( PARTITION_LIST_PROPERTY, "Partitions to be analyzed", typeManager.getType(parseTypeSignature("array(array(varchar))")), List.class, ImmutableList.of(), false, value -> ImmutableList.copyOf(((Collection<?>) value).stream() .map(partition -> ImmutableList.copyOf(((Collection<?>) partition).stream() .map(name -> ((String) name).toLowerCase(ENGLISH)).collect(Collectors.toList()))) .collect(Collectors.toList())), value -> value)); }

Target:
public HiveAnalyzeProperties(TypeManager typeManager) { analyzeProperties = ImmutableList.of( new PropertyMetadata<>( PARTITIONS_PROPERTY, "Partitions to be analyzed", typeManager.getType(parseTypeSignature("array(array(varchar))")), List.class, null, false, HiveAnalyzeProperties::decodePartitionLists, value -> value)); }
Source:
private String getMinishiftLoc(RuntimeDefinition runtimeDefinition) { String fromDef = (String) runtimeDefinition.getProperty(OVERRIDE_MINISHIFT_LOCATION); if (fromDef != null && !fromDef.isEmpty() && new File(fromDef).exists()) { return fromDef; } return MinishiftBinaryUtility.getMinishiftLocation(); }

Target:
private String getMinishiftLoc(RuntimeDefinition runtimeDefinition) { String fromDef = (String) runtimeDefinition.getProperty(OVERRIDE_MINISHIFT_LOCATION); if (doesNotExist(fromDef)) { return fromDef; } return MinishiftBinaryUtility.getMinishiftLocation(); }
Source:
public void testInit() { final DataTypeConstraintRangeView mocked = mock(DataTypeConstraintRangeView.class); doCallRealMethod().when(mocked).init(any()); mocked.init(presenter); verify(mocked).setupInputFields(); }

Target:
public void testInit() { verify(view).setupInputFields(); }
Source:
public static void detectLogoGcs() throws Exception { String gcsUri = "gs://path/to/your/bucket/video.mp4"; detectLogoGcs(gcsUri); }

Target:
public static void detectLogoGcs() throws Exception { String gcsUri = "gs://YOUR_BUCKET_ID/path/to/your/video.mp4"; detectLogoGcs(gcsUri); }
Source:
public String process(String query) { LOG.info("Processing query: {}", query); try { String path = getPath(query, LOG); if (path != null && path.equalsIgnoreCase(DiagnosticsRequestType.POSITION.toString())) { final Map<PositionKey, PositionValue> positionData = PositionDataStore.getInstance() .getOrDefault(_connectorName, new ConcurrentHashMap<>()); final String response = JsonUtils.toJson(positionData); LOG.trace("Query: returns response: {}", query, response); return response; } else { LOG.warn("Could not process query with path {}", query, path); } } catch (Exception e) { LOG.warn("Failed to process query {}", query, e); } return null; }

Target:
public String process(String query) { LOG.info("Processing query: {}", query); try { String path = getPath(query, LOG); if (path != null && path.equalsIgnoreCase(DiagnosticsRequestType.POSITION.toString())) { final String response = processPositionRequest(); LOG.trace("Query: returns response: {}", query, response); return response; } else { LOG.warn("Could not process query with path {}", query, path); } } catch (Exception e) { LOG.warn("Failed to process query {}", query, e); throw new DatastreamRuntimeException(e); } return null; }
Source:
public RsWithHeaders(final Response res, final Iterable<? extends CharSequence> headers) { super( new Response() { @Override @SuppressWarnings("unchecked") public Iterable<String> head() throws IOException { return new Concat<String>( res.head(), new Transformer<String, String>( new Transformer<CharSequence, String>( (Iterable<CharSequence>) headers, new TransformAction.ToString() ) , new TransformAction.Trim() ) ); } @Override public InputStream body() throws IOException { return res.body(); } } ); }

Target:
public RsWithHeaders(final Response res, final Iterable<? extends CharSequence> headers) { super( new Response() { @Override @SuppressWarnings("unchecked") public Iterable<String> head() throws IOException { return new Concat<String>( res.head(), new Transform<String, String>( new Transform<CharSequence, String>( (Iterable<CharSequence>) headers, new TransformAction.ToString() ), new TransformAction.Trim() ) ); } @Override public InputStream body() throws IOException { return res.body(); } } ); }
Source:
private static int[] readArrayFromChannel(ReadableByteChannel channel) { int length = readIntFromByteChannel(channel); ByteBuffer tmpBuffer = ByteBuffer.allocate(length * INT_BYTES); try { while (tmpBuffer.hasRemaining() && (channel.read(tmpBuffer) >= 0)) { } } catch (Exception e) { e.printStackTrace(); } tmpBuffer.rewind(); IntBuffer intBuffer = tmpBuffer.asIntBuffer(); int[] array = new int[length]; intBuffer.get(array); return array; }

Target:
private static int[] readArrayFromChannel(ReadableByteChannel channel) throws IOException { int length = readIntFromByteChannel(channel); ByteBuffer tmpBuffer = ByteBuffer.allocate(length * INT_BYTES); while (tmpBuffer.hasRemaining() && (channel.read(tmpBuffer) >= 0)) { } tmpBuffer.rewind(); IntBuffer intBuffer = tmpBuffer.asIntBuffer(); int[] array = new int[length]; intBuffer.get(array); return array; }
Source:
public boolean containsNull() { Boolean r = containsNull; if (r == null) { r = false; reset(); while (next()) { Value[] row = currentRow; for (int i = 0; i < visibleColumnCount; i++) { if (row[i].containsNull()) { r = true; break; } } } reset(); containsNull = r; } return r; }

Target:
public boolean containsNull() { Boolean r = containsNull; if (r == null) { r = false; reset(); loop: while (next()) { Value[] row = currentRow; for (int i = 0; i < visibleColumnCount; i++) { if (row[i].containsNull()) { r = true; break loop; } } } reset(); containsNull = r; } return r; }
Source:
public boolean isConnectedToMobileNetwork() { if (androidVersion.isMarshmallowOrHigher()) { return connectedToNetworkTypeForMarshmallow(ConnectivityManager.TYPE_MOBILE); } else { NetworkInfo networkInfo = connectivityManager.getNetworkInfo(ConnectivityManager.TYPE_MOBILE); return networkInfo != null && networkInfo.isConnected(); } }

Target:
public boolean isConnectedToMobileNetwork() { return isConnectedTo(ConnectivityManager.TYPE_MOBILE); }
Source:
public void testAsyncStreamTask() { Config config = new MapConfig(new HashMap<String, String>() { { this.put("task.class", TestAsyncStreamTask.class.getName()); } }); Object retFactory = TaskFactoryUtil.createTaskFactory(config); assertTrue(retFactory instanceof AsyncStreamTaskFactory); assertTrue(((AsyncStreamTaskFactory) retFactory).createInstance() instanceof TestAsyncStreamTask); config = new MapConfig(new HashMap<String, String>() { { this.put("task.class", "no.such.class"); } }); try { TaskFactoryUtil.createTaskFactory(config); fail("Should have failed w/ no.such.class"); } catch (ConfigException cfe) { } }

Target:
public void testAsyncStreamTask() { TaskFactory retFactory = TaskFactoryUtil.getTaskFactory(MockAsyncStreamTask.class.getName()); assertTrue(retFactory instanceof AsyncStreamTaskFactory); assertTrue(((AsyncStreamTaskFactory) retFactory).createInstance() instanceof MockAsyncStreamTask); try { TaskFactoryUtil.getTaskFactory("no.such.class"); fail("Should have failed w/ no.such.class"); } catch (ConfigException cfe) { } }
Source:
public void findCashPoints_shouldReturnAnEmptyListIfNoCashpointsAreFound() throws Exception { Location location = Context.getLocationService().getLocation(0); List<CashPoint> results = service.findCashPoints(location,"Test 1 Cash Point",false); Assert.assertNotNull(results); Assert.assertEquals(1,results.size()); }

Target:
public void findCashPoints_shouldReturnAnEmptyListIfNoCashpointsAreFound() throws Exception { Location location = Context.getLocationService().getLocation(4); List<CashPoint> results = service.findCashPoints(location,"Test",false); Assert.assertNotNull(results); Assert.assertEquals(0,results.size()); }
Source:
protected Object decode( Channel channel, SocketAddress remoteAddress, Object msg) throws Exception { String sentence = (String) msg; int slen = sentence.length(); if (slen <= 5) { return null; } if (sentence.charAt(0) != '$') { return null; } if (sentence.charAt(slen - 3) != '*') { return null; } int checksum = Integer.parseInt(sentence.substring(slen - 2), 16); if (checksum != Checksum.xor(sentence.substring(1, slen - 3))) { return null; } Parser parser = new Parser(PATTERN_ECHK, sentence); if (parser.matches()) { return handleEchk(sentence, checksum, parser, channel, remoteAddress); } parser = new Parser(PATTERN_AVRMC, sentence); if (parser.matches()) { return handleAvrmc(sentence, checksum, parser, channel, remoteAddress); } return null; }

Target:
protected Object decode( Channel channel, SocketAddress remoteAddress, Object msg) throws Exception { String sentence = (String) msg; if (sentence.startsWith("$ECHK")) { if (channel != null) { channel.writeAndFlush(new NetworkMessage(sentence + "\r\n", remoteAddress)); } } else if (sentence.startsWith("$AVRMC")) { return decodeAvrmc(sentence, channel, remoteAddress); } return null; }
Source:
public TaskData createTask(PrivilegeLevel level, Map<String, String> additionalAttributeValues) throws Exception { if (!additionalAttributeValues.containsKey(TaskAttribute.SUMMARY) || !additionalAttributeValues.containsKey(TaskAttribute.DESCRIPTION)) { throw new CoreException(new Status(IStatus.ERROR, "org.eclipse.mylyn.bugzilla.tests", "need value for Summary and Description ")); } ITaskMapping initializationData = new TaskMapping() { @Override public String getProduct() { return "ManualTest"; } @Override public String getComponent() { return "ManualC1"; } }; BugzillaClient client = client(level); AbstractTaskDataHandler taskDataHandler = connector().getTaskDataHandler(); TaskAttributeMapper mapper = taskDataHandler.getAttributeMapper(repository()); TaskData taskData = new TaskData(mapper, repository().getConnectorKind(), repository().getRepositoryUrl(), ""); taskDataHandler.initializeTaskData(repository(), taskData, initializationData, null); for (String attributeKey : additionalAttributeValues.keySet()) { taskData.getRoot() .createMappedAttribute(attributeKey) .setValue(additionalAttributeValues.get(attributeKey)); } RepositoryResponse response = submitTask(taskData, client); String bugId = response.getTaskId(); return getTask(bugId, client); }

Target:
public TaskData createTask(PrivilegeLevel level, Map<String, String> additionalAttributeValues) throws Exception { Assert.isLegal(additionalAttributeValues.containsKey(TaskAttribute.SUMMARY) && additionalAttributeValues.containsKey(TaskAttribute.DESCRIPTION), "need value for Summary and Description "); ITaskMapping initializationData = new TaskMapping() { @Override public String getProduct() { return "ManualTest"; } @Override public String getComponent() { return "ManualC1"; } }; BugzillaClient client = client(level); AbstractTaskDataHandler taskDataHandler = connector().getTaskDataHandler(); TaskAttributeMapper mapper = taskDataHandler.getAttributeMapper(repository()); TaskData taskData = new TaskData(mapper, repository().getConnectorKind(), repository().getRepositoryUrl(), ""); taskDataHandler.initializeTaskData(repository(), taskData, initializationData, null); for (String attributeKey : additionalAttributeValues.keySet()) { taskData.getRoot() .createMappedAttribute(attributeKey) .setValue(additionalAttributeValues.get(attributeKey)); } RepositoryResponse response = submitTask(taskData, client); String bugId = response.getTaskId(); return getTask(bugId, client); }
Source:
public void setUp() { directory = new File(InstrumentationRegistry.getTargetContext().getCacheDir(), "DeviceValues"); directory.mkdir(); sprite = new Sprite("_sprite_"); userVariable = new UserVariable("globalVarX", initialValue); localUserVariable = new UserVariable("localVarY", initialValue); sprite.addUserVariable(localUserVariable); accessor = new DeviceVariableAccessor(directory); }

Target:
public void setUp() { directory = new File(InstrumentationRegistry.getTargetContext().getCacheDir(), "DeviceValues"); directory.mkdir(); userVariable = new UserVariable("globalVarX", initialValue); accessor = new DeviceVariableAccessor(directory); }
Source:
private void flush(boolean waitForNewLine) { if (this.count != 0) { if (this.count == lineSepBytes.length) { boolean isLineSep = true; for (int c = 0; c < lineSepBytes.length; ++c) { if (this.buf[c] != lineSepBytes[c]) { isLineSep = false; break; } } if (isLineSep) { this.reset(); return; } } byte[] theBytes = new byte[this.count]; System.arraycopy(this.buf, 0, theBytes, 0, this.count); if (waitForNewLine) { for (int c = 0; c < lineSepBytes.length; ++c) { if (this.count < lineSepBytes.length || theBytes[theBytes.length - lineSepBytes.length + c] != lineSepBytes[c]) { return; } } } this.logger.log(this.level, new String(theBytes)); this.reset(); } }

Target:
private void flush(boolean waitForNewLine) { if (this.count != 0) { if (this.count == lineSepBytes.length) { boolean isLineSep = checkBufferIsLineSeparator(); if (isLineSep) { this.reset(); return; } } byte[] theBytes = new byte[this.count]; System.arraycopy(this.buf, 0, theBytes, 0, this.count); if (waitForNewLine) { for (int c = 0; c < lineSepBytes.length; ++c) { if (this.count < lineSepBytes.length || theBytes[theBytes.length - lineSepBytes.length + c] != lineSepBytes[c]) { return; } } } this.logger.log(this.level, new String(theBytes)); this.reset(); } }
Source:
public void networkWithTheSameMTUAddedToNic() { Network net = createNetwork("nonVmMtu9000"); net.setVmNetwork(false); net.setMtu(9000); Network newNet = createNetwork("vLanVmMtu9000"); newNet.setMtu(9000); mockExistingNetworks(net, newNet); VdsNetworkInterface nic = createNic("nic0", net.getName()); nic.setBridged(false); mockExistingIfaces(nic); SetupNetworksHelper helper = createHelper( createParametersForNics(nic, createVlan(nic.getName(), 100, newNet.getName()))); validateAndExpectNoViolations(helper); }

Target:
public void networkWithTheSameMTUAddedToNic() { Network net = createNetwork("nonVmMtu9000"); net.setVmNetwork(false); net.setMtu(9000); Network newNet = createNetwork("VLanVmMtu9000"); newNet.setMtu(9000); newNet.setvlan_id(100); mockExistingNetworks(net, newNet); VdsNetworkInterface nic = createNicSyncedWithNetwork("nic0", net); mockExistingIfaces(nic); SetupNetworksHelper helper = createHelper( createParametersForNics(nic, createVlan(nic.getName(), newNet.getvlan_id(), newNet.getName()))); validateAndExpectNoViolations(helper); }
Source:
public Message read() { assert hasNext(); mNMessages = (mNMessages + 1) % mCheckMessagesPerSecond; if (mNMessages % mCheckMessagesPerSecond == 0) { RateLimitUtil.acquire(mCheckMessagesPerSecond); } MessageAndMetadata<byte[], byte[]> kafkaMessage = mIterator.next(); Long timestamp = null; if (mConfig.useKafkaTimestamp()) { timestamp = mKafkaMessageTimestampFactory.create(mKafkaMessageTimestampClassName).getTimestamp(kafkaMessage); } Message message = new Message(kafkaMessage.topic(), kafkaMessage.partition(), kafkaMessage.offset(), kafkaMessage.key(), kafkaMessage.message(), timestamp); TopicPartition topicPartition = new TopicPartition(message.getTopic(), message.getKafkaPartition()); updateAccessTime(topicPartition); long committedOffsetCount = mOffsetTracker.getTrueCommittedOffsetCount(topicPartition); LOG.debug("read message {}", message); if (mNMessages % mCheckMessagesPerSecond == 0) { exportStats(); } if (message.getOffset() < committedOffsetCount) { LOG.debug("skipping message because its offset precedes committed offset count {}", message, committedOffsetCount); return null; } return message; }

Target:
public Message read() { assert hasNext(); mNMessages = (mNMessages + 1) % mCheckMessagesPerSecond; if (mNMessages % mCheckMessagesPerSecond == 0) { RateLimitUtil.acquire(mCheckMessagesPerSecond); } MessageAndMetadata<byte[], byte[]> kafkaMessage = mIterator.next(); long timestamp = (mConfig.useKafkaTimestamp()) ? mKafkaMessageTimestampFactory.getKafkaMessageTimestamp().getTimestamp(kafkaMessage) : 0l; Message message = new Message(kafkaMessage.topic(), kafkaMessage.partition(), kafkaMessage.offset(), kafkaMessage.key(), kafkaMessage.message(), timestamp); TopicPartition topicPartition = new TopicPartition(message.getTopic(), message.getKafkaPartition()); updateAccessTime(topicPartition); long committedOffsetCount = mOffsetTracker.getTrueCommittedOffsetCount(topicPartition); LOG.debug("read message {}", message); if (mNMessages % mCheckMessagesPerSecond == 0) { exportStats(); } if (message.getOffset() < committedOffsetCount) { LOG.debug("skipping message because its offset precedes committed offset count {}", message, committedOffsetCount); return null; } return message; }
Source:
public FeedbackResponseCommentRow getComment() { FeedbackResponseCommentRow frc = new FeedbackResponseCommentRow(comment, comment.giverEmail, giverName, recipientName, showCommentToString, showGiverNameToString, getResponseVisibilities(), instructorEmailNameTable, sessionTimeZone); frc.enableEditDelete(); String whoCanSeeComment; boolean isVisibilityIconShown = !frc.getShowCommentToString().isEmpty(); if (isVisibilityIconShown) { whoCanSeeComment = getTypeOfPeopleCanViewComment(comment, question); frc.setVisibilityIcon(true, whoCanSeeComment); } return frc; }

Target:
public FeedbackResponseCommentRow getComment() { FeedbackResponseCommentRow frc = new FeedbackResponseCommentRow(comment, comment.giverEmail, giverName, recipientName, showCommentToString, showGiverNameToString, getResponseVisibilities(), instructorEmailNameTable, sessionTimeZone, question); frc.enableEditDelete(); return frc; }
Source:
public double getDouble() { return beNull.getAsBoolean() ? 0L : baseSelector.getDouble(); }

Target:
public double getDouble() { return beNull.getAsBoolean() ? NullHandling.ZERO_DOUBLE : baseSelector.getDouble(); }
Source:
public void shouldReportEnvironmentVariables() throws Exception { buildWork = (BuildWork) getWork(WITH_ENV_VAR, PIPELINE_NAME); buildWork.doWork(agentIdentifier, buildRepository, artifactManipulator, environmentVariableContext, AgentRuntimeInfo.fromAgent(agentIdentifier, "cookie", null), packageAsRepositoryExtension, scmExtension, taskExtension); String consoleOut = artifactManipulator.consoleOut(); assertThat(trimTimeStamp(consoleOut), containsString("[go] setting environment variable 'GO_SERVER_URL' to value 'somewhere-does-not-matter'\n" + "[go] setting environment variable 'GO_TRIGGER_USER' to value ''\n" + "[go] setting environment variable 'GO_PIPELINE_NAME' to value 'pipeline1'\n" + "[go] setting environment variable 'GO_PIPELINE_COUNTER' to value '-2'\n" + "[go] setting environment variable 'GO_PIPELINE_LABEL' to value '100'\n" + "[go] setting environment variable 'GO_STAGE_NAME' to value 'mingle'\n" + "[go] setting environment variable 'GO_STAGE_COUNTER' to value '100'\n" + "[go] setting environment variable 'GO_JOB_NAME' to value 'run-ant'\n" + "[go] setting environment variable 'JOB_ENV' to value 'foobar'")); }

Target:
public void shouldReportEnvironmentVariables() throws Exception { buildWork = (BuildWork) getWork(WITH_ENV_VAR, PIPELINE_NAME); buildWork.doWork(agentIdentifier, buildRepository, artifactManipulator, environmentVariableContext, AgentRuntimeInfo.fromAgent(agentIdentifier, "cookie", null), packageAsRepositoryExtension, scmExtension, taskExtension); String consoleOut = artifactManipulator.consoleOut(); assertThat(consoleOut, matches("'GO_SERVER_URL' (to|with) value '" + SERVER_URL)); assertThat(consoleOut, matches("'GO_PIPELINE_LABEL' (to|with) value '" + PIPELINE_LABEL)); assertThat(consoleOut, matches("'GO_PIPELINE_NAME' (to|with) value '" + PIPELINE_NAME)); assertThat(consoleOut, matches("'GO_STAGE_NAME' (to|with) value '" + STAGE_NAME)); assertThat(consoleOut, matches("'GO_STAGE_COUNTER' (to|with) value '" + STAGE_COUNTER)); assertThat(consoleOut, matches("'GO_JOB_NAME' (to|with) value '" + JOB_PLAN_NAME)); assertThat(trimTimeStamp(consoleOut), containsString( "[go] setting environment variable 'JOB_ENV' to value 'foobar'\n" + "[go] overriding environment variable 'PATH' with value '/tmp'\n\n")); }
Source:
public WriteContext init(Configuration configuration) { if (rootAvroSchema == null) { this.rootAvroSchema = new Schema.Parser().parse(configuration.get(AVRO_SCHEMA)); this.rootSchema = new AvroSchemaConverter().convert(rootAvroSchema); } if (model == null) { this.model = getDataModel(configuration); } boolean writeOldListStructure = configuration.getBoolean( WRITE_OLD_LIST_STRUCTURE, WRITE_OLD_LIST_STRUCTURE_DEFAULT); if (writeOldListStructure) { this.listWriter = new TwoLevelWriter(); } else { this.listWriter = new ThreeLevelWriter(); } Map<String, String> extraMetaData = new HashMap<String, String>(); extraMetaData.put(AvroReadSupport.AVRO_SCHEMA_METADATA_KEY, rootAvroSchema.toString()); return new WriteContext(rootSchema, extraMetaData); }

Target:
public WriteContext init(Configuration configuration) { if (rootAvroSchema == null) { this.rootAvroSchema = new Schema.Parser().parse(configuration.get(AVRO_SCHEMA)); this.rootSchema = new AvroSchemaConverter().convert(rootAvroSchema); } if (model == null) { this.model = getDataModel(configuration); } boolean writeOldListStructure = configuration.getBoolean( WRITE_OLD_LIST_STRUCTURE, WRITE_OLD_LIST_STRUCTURE_DEFAULT); if (writeOldListStructure) { this.listWriter = new TwoLevelListWriter(); } else { this.listWriter = new ThreeLevelListWriter(); } Map<String, String> extraMetaData = new HashMap<String, String>(); extraMetaData.put(AvroReadSupport.AVRO_SCHEMA_METADATA_KEY, rootAvroSchema.toString()); return new WriteContext(rootSchema, extraMetaData); }
Source:
public void deleteCodeSystemVersion(TermCodeSystemVersion theCodeSystemVersion) { ourLog.info(" * Deleting code system version {}", theCodeSystemVersion.getCodeSystemVersionId()); deleteCodeSystemVersion(theCodeSystemVersion.getPid()); }

Target:
public void deleteCodeSystemVersion(TermCodeSystemVersion theCodeSystemVersion) { ourLog.info(" * Deleting TermCodeSystemVersion {}", theCodeSystemVersion.getCodeSystemVersionId()); deleteCodeSystemVersion(theCodeSystemVersion.getPid()); }
Source:
public void onPlayerSpawn(OnPlayerSpawnedEvent event, EntityRef player, InventoryComponent inventory) { BlockItemFactory blockItemFactory = new BlockItemFactory(entityManager); inventoryManager.giveItem(player, player, entityManager.create("MasterOfOreon:selectionTool")); inventoryManager.giveItem(player, player, blockItemFactory.newInstance(blockManager.getBlockFamily("MasterOfOreon:portal"), 10)); }

Target:
public void onPlayerSpawn(OnPlayerSpawnedEvent event, EntityRef player, InventoryComponent inventory) { BlockItemFactory blockItemFactory = new BlockItemFactory(entityManager); inventoryManager.giveItem(player, player, entityManager.create(Constants.SELECTION_TOOL_PREFAB)); inventoryManager.giveItem(player, player, blockItemFactory.newInstance(blockManager.getBlockFamily(Constants.PORTAL_PREFAB), 10)); }
Source:
public ObjectSpecification download(String objectId, long offset, long length, boolean forExternalUse) { try { checkAnalysisState(metadataService.getEntity(objectId)); checkArgument(offset > -1L); val objectSpec = getSpecification(objectId); if (!forExternalUse && (offset == 0L && length < 0L)) { return objectSpec; } if (!forExternalUse && (length < 0L)) { length = objectSpec.getObjectSize() - offset; } if ((offset + length) > objectSpec.getObjectSize()) { throw new InternalUnrecoverableError("Specified parameters exceed object size (object id: " + objectId + ", offset: " + offset + ", length: " + length + ")"); } val objectKey = ObjectKeys.getObjectKey(dataDir, objectId); List<Part> parts; if (forExternalUse) { parts = partCalculator.specify(0L, -1L); } else { parts = partCalculator.divide(offset, length); } fillPartUrls(objectKey, parts, objectSpec.isRelocated(), forExternalUse); return new ObjectSpecification(objectKey.getKey(), objectId, objectId, parts, length, objectSpec.getObjectMd5(), objectSpec.isRelocated()); } catch (Exception e) { log.error("Failed to download objectId: {}, offset: {}, length: {}, forExternalUse: {}: ", objectId, offset, length, forExternalUse, e); throw e; } }

Target:
public ObjectSpecification download(String objectId, long offset, long length, boolean forExternalUse) { try { checkPublishedAnalysisState(metadataService.getEntity(objectId)); checkArgument(offset > -1L); val objectSpec = getSpecification(objectId); if (!forExternalUse && (offset == 0L && length < 0L)) { return objectSpec; } if (!forExternalUse && (length < 0L)) { length = objectSpec.getObjectSize() - offset; } if ((offset + length) > objectSpec.getObjectSize()) { throw new InternalUnrecoverableError("Specified parameters exceed object size (object id: " + objectId + ", offset: " + offset + ", length: " + length + ")"); } val objectKey = ObjectKeys.getObjectKey(dataDir, objectId); List<Part> parts; if (forExternalUse) { parts = partCalculator.specify(0L, -1L); } else { parts = partCalculator.divide(offset, length); } fillPartUrls(objectKey, parts, objectSpec.isRelocated(), forExternalUse); return new ObjectSpecification(objectKey.getKey(), objectId, objectId, parts, length, objectSpec.getObjectMd5(), objectSpec.isRelocated()); } catch (Exception e) { log.error("Failed to download objectId: {}, offset: {}, length: {}, forExternalUse: {}: ", objectId, offset, length, forExternalUse, e); throw e; } }
Source:
private void preprocessUpdatedIssues(List<Model> newModels) { for (Model model : newModels) { assert models.containsKey(model.getRepoId()); Model existingModel = models.get(model.getRepoId()); if (!existingModel.getIssues().equals(model.getIssues())) { for (int i = 1; i <= model.getIssues().size(); i++) { if (!existingModel.getIssueById(i).equals(model.getIssueById(i))) { assert model.getIssueById(i).isPresent(); if (model.getIssueById(i).get().getUpdatedAt().isAfter(model.getIssueById(i).get().getMarkedReadAt().get())) { model.getIssueById(i).get().setIsCurrentlyRead(false); } } } } } }

Target:
private void preprocessUpdatedIssues(List<Model> newModels) { for (Model model : newModels) { assert models.containsKey(model.getRepoId()); Model existingModel = models.get(model.getRepoId()); if (existingModel.getIssues().equals(model.getIssues())) continue; for (int i = 1; i <= model.getIssues().size(); i++) { if (existingModel.getIssueById(i).equals(model.getIssueById(i)) || !wasNotJustMarkedAsRead(model.getIssueById(i).get())) continue; assert model.getIssueById(i).isPresent(); model.getIssueById(i).get().setIsCurrentlyRead(false); } } }
Source:
public String toString() { final List<String> dimStrs = dims == null ? ImmutableList.<String>of() : Lists.transform( Arrays.asList(dims), new Function<int[], String>() { @Nullable @Override public String apply(int[] input) { return input == null ? "null" : Arrays.toString(input); } } ); return "Rowboat{" + "timestamp=" + new DateTime(timestamp).toString() + ", dims=" + dimStrs + ", metrics=" + (metrics == null ? null : Arrays.asList(metrics)) + ", comprisedRows=" + comprisedRows + '}'; }

Target:
public String toString() { return "Rowboat{" + "timestamp=" + new DateTime(timestamp).toString() + ", dims=" + Arrays.deepToString(dims) + ", metrics=" + Arrays.toString(metrics) + ", comprisedRows=" + comprisedRows + '}'; }
Source:
private void verbose(Definition def) { sw.printTotal("Total"); if (context.globalOptions.verbose) { def.printStatistics(); } }

Target:
private void verbose(Definition def) { sw.printTotal("Total"); if (context.globalOptions.verbose) { CountNodesVisitor visitor = new CountNodesVisitor(); visitor.visitNode(def); printStatistics(visitor); } }
Source:
public Builder addOption(String key, long value) { return addOption(key, value + ""); }

Target:
public Builder addOption(String key, long value) { return addOption(key, Long.toString(value)); }
Source:
public OutputStream decorate(OutputStream logger) throws IOException, InterruptedException { return new LineTransformationOutputStream() { @Override protected void eol(byte[] b, int len) throws IOException { String s = new String(b, 0, len, StandardCharsets.UTF_8); for (String value : values) { s = mask(s, value); } logger.write(s.getBytes(StandardCharsets.UTF_8)); } @Override public void flush() throws IOException { logger.flush(); } @Override public void close() throws IOException { super.close(); logger.close(); } private String mask(String s, String value) { if (value != null && value.length() > 0) { s = s.replace(value, secretReplacement); } return s; } }; }

Target:
public OutputStream decorate(OutputStream logger) throws IOException, InterruptedException { return new LineTransformationOutputStream() { @Override protected void eol(byte[] b, int len) throws IOException { String s = new String(b, 0, len, StandardCharsets.UTF_8); for (String value : values) { s = s.replace(value, "********"); } logger.write(s.getBytes(StandardCharsets.UTF_8)); } @Override public void flush() throws IOException { logger.flush(); } @Override public void close() throws IOException { super.close(); logger.close(); } }; }
Source:
public void getWorkflowDefinitionByCollectionId_nonValidUUID() throws Exception { String token = getAuthToken(eperson.getEmail(), password); String nonValidUUID = "TestNonValidUUID"; getClient(token).perform(get(WORKFLOW_DEFINITIONS_ENDPOINT + "/search/findByCollection?uuid=" + nonValidUUID)) .andExpect(status().is(HttpStatus.SC_BAD_REQUEST)) .andExpect(status().reason(containsString("Failed to convert " + nonValidUUID))); }

Target:
public void getWorkflowDefinitionByCollectionId_nonValidUUID() throws Exception { String token = getAuthToken(eperson.getEmail(), password); String nonValidUUID = "TestNonValidUUID"; getClient(token).perform(get(WORKFLOW_DEFINITIONS_ENDPOINT + "/search/findByCollection?uuid=" + nonValidUUID)) .andExpect(status().isBadRequest()) .andExpect(status().reason(containsString("Failed to convert " + nonValidUUID))); }
Source:
public static Boolean containVariantTumorTypeSummary(Integer entrezGeneId, String key) { return (variantTumorTypeSummary.containsKey(entrezGeneId) && variantTumorTypeSummary.get(entrezGeneId).containsKey(key)) ? true : false; }

Target:
public static Boolean containVariantTumorTypeSummary(Integer entrezGeneId, String key) { return variantTumorTypeSummary.containsKey(entrezGeneId) && variantTumorTypeSummary.get(entrezGeneId).containsKey(key); }
Source:
public String getActualCpuTopology() { if (actualCpuTopology < 0) { return ConstantsManager.getInstance().getConstants().notAvailableLabel(); } else { return String.valueOf(actualCpuTopology); } }

Target:
public String getActualCpuTopology() { if (actualCpuTopology > 0) { return String.valueOf(actualCpuTopology); } else { return ConstantsManager.getInstance().getConstants().notAvailableLabel(); } }
Source:
public LocalMultiwayProducer(final Operator child, final ExchangePairID[] operatorIDs) { super( child, operatorIDs, new int[] {IPCConnectionPool.SELF_IPC_ID}, new BroadcastDistributeFunction(operatorIDs.length)); }

Target:
public LocalMultiwayProducer(final Operator child, final ExchangePairID[] operatorIDs) { super( child, operatorIDs, new int[] {IPCConnectionPool.SELF_IPC_ID}, new BroadcastDistributeFunction()); this.distributeFunction.setDestinations(1, operatorIDs.length); }
Source:
public boolean visit(LambdaExpression node) { fCurrentMethodsAndLambdas.push(node); return visit((Expression) node); }

Target:
public boolean visit(LambdaExpression node) { fCurrentMethodsAndLambdas.push(node); return super.visit(node); }
Source:
private void setUpTimeLockBlockInRuntimeConfig() { when(runtimeConfig.timelockRuntime()).thenReturn(Optional.of(mockTimelockRuntimeConfig)); }

Target:
private void setUpTimeLockBlockInRuntimeConfig() { when(runtimeConfig.timelockRuntime()).thenReturn( Optional.of(ImmutableTimeLockRuntimeConfig.builder() .serversList(rawRemoteServerConfig) .build())); }
Source:
void handleSigInt() { UserConsole.getLogger().info( "Received SIGINT, terminating job (status: {})", executionContext.getCurrentJobStatus() ); executionContext.setJobKilProvenance(ExecutionContext.KillProvenance.SYSTEM_SIGNAL); stateMachine.stop(); }

Target:
void handleSigInt() { UserConsole.getLogger().info( "Received SIGINT, terminating job (status: {})", executionContext.getCurrentJobStatus() ); executionContext.setJobKillSource(ExecutionContext.KillSource.SYSTEM_SIGNAL); stateMachine.stop(); }
Source:
public static void destroy(Entity e) { if (isManaged(e)) { if (!isReadOnly(e)) { if (e instanceof Startable) Entities.invokeEffector((EntityLocal)e, e, Startable.STOP).getUnchecked(); if (e instanceof EntityInternal) ((EntityInternal)e).destroy(); } unmanage(e); log.debug("destroyed and unmanaged "+e+"; mgmt now "+ (e.getApplicationId()==null ? "(no app)" : e.getApplication().getManagementContext())+" - managed? "+isManaged(e)); } else { log.debug("skipping destroy of "+e+": not managed"); } }

Target:
public static void destroy(Entity e) { if (isManaged(e)) { if (isReadOnly(e)) { unmanage(e); log.debug("destroyed and unmanaged read-only copy of "+e); } else { if (e instanceof Startable) Entities.invokeEffector((EntityLocal)e, e, Startable.STOP).getUnchecked(); if (e instanceof EntityInternal) ((EntityInternal)e).destroy(); unmanage(e); log.debug("destroyed and unmanaged "+e+"; mgmt now "+ (e.getApplicationId()==null ? "(no app)" : e.getApplication().getManagementContext())+" - managed? "+isManaged(e)); } } else { log.debug("skipping destroy of "+e+": not managed"); } }