auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testSetScopedInstance() throws InterruptedException { AgentMessageProcessor processor = (AgentMessageProcessor) this.agent.getMessagingClient().getMessageProcessor(); TestApplicationTemplate app = new TestApplicationTemplate(); Assert.assertNull( processor.scopedInstance ); processor.processMessage( new MsgCmdSetScopedInstance( app.getMySql())); Assert.assertNull( processor.scopedInstance ); Assert.assertEquals( 0, this.client.messagesForAgents.size()); processor.processMessage( new MsgCmdSetScopedInstance( app.getTomcatVm())); Assert.assertEquals( app.getTomcatVm(), processor.scopedInstance ); Assert.assertEquals( InstanceStatus.DEPLOYED_STARTED, processor.scopedInstance.getStatus()); Assert.assertEquals( 1, this.client.messagesForAgents.size()); processor.processMessage( new MsgCmdSetScopedInstance( app.getMySqlVm())); Assert.assertEquals( app.getTomcatVm(), processor.scopedInstance ); processor.processMessage( new MsgCmdSetScopedInstance( app.getTomcat())); Assert.assertEquals( app.getTomcatVm(), processor.scopedInstance ); processor.scopedInstance = null; this.client.messagesForAgents.clear(); app.getTomcatVm().setStatus( InstanceStatus.DEPLOYED_STARTED ); processor.processMessage( new MsgCmdSetScopedInstance( app.getTomcatVm())); Assert.assertEquals( app.getTomcatVm(), processor.scopedInstance ); Assert.assertEquals( InstanceStatus.DEPLOYED_STARTED, processor.scopedInstance.getStatus()); Assert.assertEquals( "Expected a message for Tomcat, its VM and the WAR.", 1, this.client.messagesForAgents.size()); }

Target:
public void testSetScopedInstance() { AgentMessageProcessor processor = (AgentMessageProcessor) this.agent.getMessagingClient().getMessageProcessor(); TestApplicationTemplate app = new TestApplicationTemplate(); Assert.assertNull( processor.scopedInstance ); processor.processMessage( new MsgCmdSetScopedInstance( app.getMySql())); Assert.assertNull( processor.scopedInstance ); Assert.assertEquals( 0, this.client.messagesForAgents.size()); processor.processMessage( new MsgCmdSetScopedInstance( app.getTomcatVm())); Assert.assertEquals( app.getTomcatVm(), processor.scopedInstance ); Assert.assertEquals( InstanceStatus.DEPLOYED_STARTED, processor.scopedInstance.getStatus()); Assert.assertEquals( 1, this.client.messagesForAgents.size()); processor.processMessage( new MsgCmdSetScopedInstance( app.getMySqlVm())); Assert.assertEquals( app.getTomcatVm(), processor.scopedInstance ); processor.processMessage( new MsgCmdSetScopedInstance( app.getTomcat())); Assert.assertEquals( app.getTomcatVm(), processor.scopedInstance ); processor.scopedInstance = null; this.client.messagesForAgents.clear(); app.getTomcatVm().setStatus( InstanceStatus.DEPLOYED_STARTED ); processor.processMessage( new MsgCmdSetScopedInstance( app.getTomcatVm())); Assert.assertEquals( app.getTomcatVm(), processor.scopedInstance ); Assert.assertEquals( InstanceStatus.DEPLOYED_STARTED, processor.scopedInstance.getStatus()); Assert.assertEquals( "Expected a message for Tomcat, its VM and the WAR.", 1, this.client.messagesForAgents.size()); }
Source:
private void fill(MToolBar container, IContributionManager manager) { ToolBarManagerRenderer renderer = (ToolBarManagerRenderer) rendererFactory.getRenderer( container, null); for (IContributionItem item : manager.getItems()) { if (item == null) { continue; } MToolBarElement toolBarElem = renderer.getToolElement(item); if (toolBarElem != null) { if (container.isVisible()) { setChildVisible(toolBarElem, item, manager); } continue; } if (item instanceof IToolBarContributionItem) { IToolBarManager manager2 = ((IToolBarContributionItem) item).getToolBarManager(); fill(container, manager2); } else if (item instanceof IMenuManager) { continue; } else if (item instanceof IContributionManager) { fill(container, (IContributionManager) item); } else if (item instanceof CommandContributionItem) { CommandContributionItem cci = (CommandContributionItem) item; MToolItem toolItem = MenuHelper.createToolItem(application, cci); if (toolItem != null) { renderer.linkModelToContribution(toolItem, item); container.getChildren().add(toolItem); } } else { MToolItem toolItem = OpaqueElementUtil.createOpaqueToolItem(); toolItem.setElementId(item.getId()); OpaqueElementUtil.setOpaqueItem(toolItem, item); if (item instanceof AbstractGroupMarker) { toolItem.setVisible(item.isVisible()); } renderer.linkModelToContribution(toolItem, item); container.getChildren().add(toolItem); } } }

Target:
private void fill(MToolBar container, IContributionManager manager) { ToolBarManagerRenderer renderer = (ToolBarManagerRenderer) rendererFactory.getRenderer( container, null); IContributionItem[] items = manager.getItems(); for (int index = 0; index < items.length; index++) { IContributionItem item = items[index]; if (item == null) { continue; } MToolBarElement toolBarElem = renderer.getToolElement(item); if (toolBarElem != null) { if (container.isVisible()) { setChildVisible(toolBarElem, item, manager); } continue; } if (item instanceof IToolBarContributionItem) { IToolBarManager manager2 = ((IToolBarContributionItem) item).getToolBarManager(); fill(container, manager2); } else if (item instanceof IMenuManager) { continue; } else if (item instanceof IContributionManager) { fill(container, (IContributionManager) item); } else if (item instanceof CommandContributionItem) { MHandledToolItem toolItem = MenuHelper.createToolItem(application, (CommandContributionItem) item); if (toolItem == null) { continue; } toolItem.setRenderer(renderer); HandledContributionItem ci = ContextInjectionFactory.make(HandledContributionItem.class, window.getContext()); if (manager instanceof ContributionManager) { ContributionManager cm = (ContributionManager) manager; cm.insert(index, ci); cm.remove(item); } ci.setModel(toolItem); ci.setVisible(toolItem.isVisible()); renderer.linkModelToContribution(toolItem, ci); container.getChildren().add(toolItem); } else { MToolItem toolItem = OpaqueElementUtil.createOpaqueToolItem(); toolItem.setElementId(item.getId()); OpaqueElementUtil.setOpaqueItem(toolItem, item); if (item instanceof AbstractGroupMarker) { toolItem.setVisible(item.isVisible()); } renderer.linkModelToContribution(toolItem, item); container.getChildren().add(toolItem); } } }
Source:
private IncomingPhoneNumber findByRegex(List<String> numberQueries, Sid sourceOrganizationSid, Sid destOrg) { IncomingPhoneNumber numberFound = null; IncomingPhoneNumberFilter.Builder filterBuilder = IncomingPhoneNumberFilter.Builder.builder(); filterBuilder.byOrgSid(destOrg.toString()); filterBuilder.byPureSIP(Boolean.FALSE); List<IncomingPhoneNumber> regexList = numbersDao.getIncomingPhoneNumbersRegex(filterBuilder.build()); if (logger.isDebugEnabled()) { logger.debug(String.format("Found %d Regex IncomingPhone numbers.", regexList.size())); } Set<IncomingPhoneNumber> regexSet = new TreeSet<IncomingPhoneNumber>(new NumberLengthComparator()); regexSet.addAll(regexList); if (regexList != null && regexList.size() > 0) { IncomingPhoneNumber matchingRegex = findFirstMatchingRegex(numberQueries, regexSet, sourceOrganizationSid, destOrg); if (matchingRegex != null) { numberFound = matchingRegex; } } return numberFound; }

Target:
private IncomingPhoneNumber findByRegex(List<String> numberQueries, Sid sourceOrganizationSid, Sid destOrg) { IncomingPhoneNumber numberFound = null; IncomingPhoneNumberFilter.Builder filterBuilder = IncomingPhoneNumberFilter.Builder.builder(); filterBuilder.byOrgSid(destOrg.toString()); filterBuilder.byPureSIP(Boolean.TRUE); List<IncomingPhoneNumber> regexList = numbersDao.getIncomingPhoneNumbersRegex(filterBuilder.build()); if (logger.isDebugEnabled()) { logger.debug(String.format("Found %d Regex IncomingPhone numbers.", regexList.size())); } Set<IncomingPhoneNumber> regexSet = new TreeSet<IncomingPhoneNumber>(new NumberLengthComparator()); regexSet.addAll(regexList); if (regexList != null && regexList.size() > 0) { IncomingPhoneNumber matchingRegex = findFirstMatchingRegex(numberQueries, regexSet); if (matchingRegex != null) { numberFound = matchingRegex; } } return numberFound; }
Source:
public static Message validateVariableValues(final MeasurementVariable variable, final String value) { if ((variable.getDataTypeId() != null && variable.getDataTypeId().equals(DataType.NUMERIC_VARIABLE.getId())) || variable.getDataType().equals(DataType.NUMERIC_VARIABLE.getDataTypeCode())) { if (!StringUtils.isNumeric(value)) { return new Message(Constants.INVALID_NUMERIC_VALUE_MESSAGE, variable.getLabel(), value); } } return null; }

Target:
public static Optional<Message> validateVariableValues(final MeasurementVariable variable, final String value) { if ((variable.getDataTypeId() != null && variable.getDataTypeId().equals(DataType.NUMERIC_VARIABLE.getId())) || variable.getDataType().equals(DataType.NUMERIC_VARIABLE.getDataTypeCode())) { if (!StringUtils.isNumeric(value)) { return Optional.of(new Message(Constants.INVALID_NUMERIC_VALUE_MESSAGE, variable.getLabel(), value)); } } return Optional.absent(); }
Source:
public void addAbbreviation() { addAbbreviation(Localization.lang("Name"), Localization.lang("Abbreviation"), Localization.lang("Shortest unique")); }

Target:
public void addAbbreviation() { addAbbreviation(Localization.lang("Name"), Localization.lang("Abbreviation"), Localization.lang("Shortest unique abbreviation")); }
Source:
protected boolean mergeImpl() throws IOException { boolean implicitDirCache = false; boolean clean = false; int callDepth = 0; if (dircache == null) { dircache = getRepository().lockDirCache(); implicitDirCache = true; } clean = mergeRecursive(callDepth, sourceCommits[0], sourceCommits[1], getBaseCommits(0, 1)); if (implicitDirCache) dircache.unlock(); return clean; }

Target:
protected boolean mergeImpl() throws IOException { boolean implicitDirCache = false; if (dircache == null) { dircache = getRepository().lockDirCache(); implicitDirCache = true; } try { return mergeRecursive(0, sourceCommits[0], sourceCommits[1], getBaseCommits(0, 1)); } finally { if (implicitDirCache) dircache.unlock(); } }
Source:
void updateButton() { getButtonWidget().setVisible(command.getIsAvailable() && command.getIsVisible()); getButtonWidget().setEnabled(command.getIsExecutionAllowed()); String title = ""; if (!command.getExecuteProhibitionReasons().isEmpty()) { for (String reason : command.getExecuteProhibitionReasons()) { title += reason; } } else { title = command.getTitle(); } getButtonWidget().setTitle(title); if (command.getTitle() != null) { getButtonWidget().setText(command.getTitle()); } }

Target:
void updateButton() { getButtonWidget().setVisible(command.getIsAvailable() && command.getIsVisible()); getButtonWidget().setEnabled(command.getIsExecutionAllowed()); String title = ""; if (!command.getExecuteProhibitionReasons().isEmpty()) { for (String reason : command.getExecuteProhibitionReasons()) { title += reason + ","; } } else { title = command.getTitle(); } getButtonWidget().setTitle(title); if (command.getTitle() != null) { getButtonWidget().setText(command.getTitle()); } }
Source:
public Object execute(ExecutionEvent event) throws ExecutionException { IStructuredSelection selection = getSelection(getPage()); if (selection.isEmpty()) { return null; } RevCommit commit = (RevCommit) selection.getFirstElement(); Object input = getPage().getInputInternal().getSingleFile(); Repository repository = getRepository(event); try { IWorkbenchPage workBenchPage = HandlerUtil .getActiveWorkbenchWindowChecked(event).getActivePage(); if (input instanceof IFile) { IFile file = (IFile) input; if (CompareUtils.canDirectlyOpenInCompare(file)) { CompareUtils.compareWorkspaceWithRef(repository, file, commit.getId().getName(), workBenchPage); } else { GitModelSynchronize.synchronizeModelWithWorkspace(file, repository, commit.getName()); } } else { CompareUtils.compareLocalWithRef(repository, (File) input, commit.getId().getName(), workBenchPage); } } catch (IOException e) { Activator.handleError( UIText.CompareWithRefAction_errorOnSynchronize, e, true); } return null; }

Target:
public Object execute(ExecutionEvent event) throws ExecutionException { IStructuredSelection selection = getSelection(getPage()); if (selection.isEmpty()) return null; RevCommit commit = (RevCommit) selection.getFirstElement(); Object input = getPage().getInputInternal().getSingleFile(); Repository repository = getRepository(event); try { IWorkbenchPage workBenchPage = HandlerUtil .getActiveWorkbenchWindowChecked(event).getActivePage(); if (input instanceof IFile) { IFile file = (IFile) input; if (CompareUtils.canDirectlyOpenInCompare(file)) CompareUtils.compareWorkspaceWithRef(repository, file, commit.getId().getName(), workBenchPage); else GitModelSynchronize.synchronizeModelWithWorkspace(file, repository, commit.getName()); } else CompareUtils.compareLocalWithRef(repository, (File) input, commit.getId().getName(), workBenchPage); } catch (IOException e) { Activator.handleError( UIText.CompareWithRefAction_errorOnSynchronize, e, true); } return null; }
Source:
public void hashcodeTest() { assertEquals(32, fixture.hashCode()); StringDeclaration a = StringDeclaration.getStringDeclaration(Encoding.ASCII); StringDeclaration b = StringDeclaration.getStringDeclaration(Encoding.UTF8); StringDeclaration c = StringDeclaration.getStringDeclaration(Encoding.UTF8); StringDeclaration d = StringDeclaration.getStringDeclaration(Encoding.ASCII); assertEquals(b.hashCode(), c.hashCode()); assertEquals(a.hashCode(), d.hashCode()); assertEquals(a.hashCode(), a.hashCode()); }

Target:
public void hashcodeTest() { assertEquals(32, fixture.hashCode()); StringDeclaration a = StringDeclaration.getStringDeclaration(Encoding.ASCII); StringDeclaration b = StringDeclaration.getStringDeclaration(); StringDeclaration c = StringDeclaration.getStringDeclaration(Encoding.UTF8); StringDeclaration d = StringDeclaration.getStringDeclaration(Encoding.ASCII); assertEquals(b.hashCode(), c.hashCode()); assertEquals(a.hashCode(), d.hashCode()); assertEquals(a.hashCode(), a.hashCode()); }
Source:
public void startFieldName(JsonParser parser) throws HyracksDataException { if (levelObject > spStack.size()) { keyStack.add(new ArrayBackedValueStorage()); spStack.add(new UTF8StringPointable()); } keyStack.get(levelObject - 1).reset(); DataOutput outk = keyStack.get(levelObject - 1).getDataOutput(); try { svb.write(parser.getText(), outk); spStack.get(levelObject - 1).set(keyStack.get(levelObject - 1)); if (this.valueSeq != null) { ByteArrayOutputStream field = new ByteArrayOutputStream(); int length = 0; byte[] barr = spStack.get(levelObject - 1).getByteArray(); field.write(barr, 0, spStack.get(levelObject - 1).getLength()); field.close(); allKeys.add(ArrayUtils.toObject(field.toByteArray())); for (int i = 0; i < allKeys.size() - 1; i++) { TaggedValuePointable tvp = new TaggedValuePointable(); tvp.set(ArrayUtils.toPrimitive(allKeys.get(i)), 0, ArrayUtils.toPrimitive(allKeys.get(i)).length); length += ArrayUtils.toPrimitive(allKeys.get(i)).length; } if (length <= path.getLength() && (length + 2) <= path.getLength()) { TaggedValuePointable tvp = new TaggedValuePointable(); tvp.set(path.getByteArray(), length, length + 2); if (tvp.getTag() == ValueTag.XS_BOOLEAN_TAG) { abvsStack.get(0).reset(); out.write(ValueTag.XS_STRING_TAG); svb.write(parser.getText(), out); writeElement(abvsStack.get(0)); } } } } catch (Exception e) { throw new HyracksDataException(e.toString()); } }

Target:
public void startFieldName(JsonParser parser) throws HyracksDataException { if (levelObject > spStack.size()) { keyStack.add(new ArrayBackedValueStorage()); spStack.add(new UTF8StringPointable()); } keyStack.get(levelObject - 1).reset(); DataOutput outk = keyStack.get(levelObject - 1).getDataOutput(); try { svb.write(parser.getText(), outk); spStack.get(levelObject - 1).set(keyStack.get(levelObject - 1)); if (this.valueSeq != null) { int length = 0; byte[] barr = spStack.get(levelObject - 1).getByteArray(); outputStream.reset(); outputStream.write(barr, 0, spStack.get(levelObject - 1).getLength()); allKeys.add(ArrayUtils.toObject(outputStream.toByteArray())); for (int i = 0; i < allKeys.size() - 1; i++) { tvp.set(ArrayUtils.toPrimitive(allKeys.get(i)), 0, ArrayUtils.toPrimitive(allKeys.get(i)).length); length += ArrayUtils.toPrimitive(allKeys.get(i)).length; } if (length <= pathStream.size() && (length + 2) <= pathStream.size()) { tvp.set(pathStream.toByteArray(), length, length + 2); if (tvp.getTag() == ValueTag.XS_BOOLEAN_TAG) { abvsStack.get(0).reset(); out.write(ValueTag.XS_STRING_TAG); svb.write(parser.getText(), out); writeElement(abvsStack.get(0)); } } } } catch (Exception e) { throw new HyracksDataException("Writing in out of bounds space", e); } }
Source:
protected void configure() { if (Boolean.parseBoolean(firstNonNull(System.getenv("CHE_PLUGIN_TRAEFIK_ENABLED"), "false"))) { final TraefikCreateContainerInterceptor traefikCreateContainerInterceptor = new TraefikCreateContainerInterceptor(); requestInjection(traefikCreateContainerInterceptor); bindInterceptor(subclassesOf(DockerConnector.class), names("createContainer"), traefikCreateContainerInterceptor); } }

Target:
protected void configure() { if (parseBoolean(getenv("CHE_PLUGIN_TRAEFIK_ENABLED"))) { final TraefikCreateContainerInterceptor traefikCreateContainerInterceptor = new TraefikCreateContainerInterceptor(); requestInjection(traefikCreateContainerInterceptor); bindInterceptor(subclassesOf(DockerConnector.class), names("createContainer"), traefikCreateContainerInterceptor); } }
Source:
private BucketedValue getValueFromTimeBucketReader(Slice key, long timeBucket) { if (bloomFilter != null) { boolean mightContain = bloomFilter.mightContain(key); verifyBloomFilter(mightContain); if (!mightContain) { return null; } } FileAccess.FileReader fileReader = readers.get(timeBucket); if (fileReader != null) { return readValue(fileReader, key, timeBucket); } try { if (loadFileReader(timeBucket)) { return readValue(readers.get(timeBucket), key, timeBucket); } return null; } catch (IOException e) { throw new RuntimeException("while loading " + bucketId + ", " + timeBucket, e); } }

Target:
private BucketedValue getValueFromTimeBucketReader(Slice key, long timeBucket) { if (managedStateContext.getTimeBucketAssigner() instanceof MovingBoundaryTimeBucketAssigner && timeBucket <= ((MovingBoundaryTimeBucketAssigner)managedStateContext.getTimeBucketAssigner()).getLowestPurgeableTimeBucket()) { return null; } if (bloomFilter != null) { boolean mightContain = bloomFilter.mightContain(key); verifyBloomFilter(mightContain); if (!mightContain) { return null; } } FileAccess.FileReader fileReader = readers.get(timeBucket); if (fileReader != null) { return readValue(fileReader, key, timeBucket); } try { if (loadFileReader(timeBucket)) { return readValue(readers.get(timeBucket), key, timeBucket); } return null; } catch (IOException e) { throw new RuntimeException("while loading " + bucketId + ", " + timeBucket, e); } }
Source:
public void handleException(@Nullable Throwable exception) { final RuntimeException rException = (exception instanceof RuntimeException) ? (RuntimeException) exception : new RuntimeException("Error in threaded state history backend", exception); fail(rException); fPropagateExceptions = () -> { throw rException; }; ITmfEvent event = fEventsQueue.take(); while (event != END_EVENT) { if (event == EMPTY_QUEUE_EVENT) { event = fEventsQueue.take(); continue; } event = fEventsQueue.take(); } closeStateSystem(); }

Target:
public void handleException(@Nullable Throwable exception) { final RuntimeException rException = (exception instanceof RuntimeException) ? (RuntimeException) exception : new RuntimeException("Error in threaded state history backend", exception); fail(rException); fPropagateExceptions = () -> { throw rException; }; if (currentEvent == END_EVENT) { return; } ITmfEvent event = fEventsQueue.take(); while (event != END_EVENT) { if (event == EMPTY_QUEUE_EVENT) { event = fEventsQueue.take(); continue; } event = fEventsQueue.take(); } closeStateSystem(); }
Source:
public HighscoreLeaderboard getHighscoreLeaderboard() { HighscoreLeaderboard leaderboard = new HighscoreLeaderboard(); PlayerDTO[] players; try { players = ibs.getLeaderboard(); for (PlayerDTO pdto : players) { leaderboard.addEntry(pdto.getNickname(), pdto.getId(), pdto.getHighScore()); } leaderboard.refresh(); return leaderboard; } catch (RemoteException e) { e.printStackTrace(); } return null; }

Target:
public HighscoreLeaderboard getHighscoreLeaderboard() { HighscoreLeaderboard leaderboard = new HighscoreLeaderboard(); try { PlayerDTO[] players = ibs.getLeaderboard(); for (PlayerDTO pdto : players) { leaderboard.addEntry(pdto.getNickname(), pdto.getId(), pdto.getHighScore()); } leaderboard.refresh(); } catch (RemoteException e) { e.printStackTrace(); } return leaderboard; }
Source:
private void validateSemanticTagVcardAddressBody(Body body) throws ParamValidationException, PropertyValidationException { if (!(body instanceof VcardAddressBody)) throw new ParamValidationException(ParamValidationException.MESSAGE_MISSING_MANDATORY_FIELD, I18nConstants.MESSAGE_MISSING_MANDATORY_FIELD, new String[] { "tag.body.class", body.getClass().toString() }); Address address = ((VcardAddressBody) body).getAddress(); if (Strings.isNullOrEmpty(address.getVcardStreetAddress())) throw new PropertyValidationException(ParamValidationException.MESSAGE_MISSING_MANDATORY_FIELD, I18nConstants.MESSAGE_MISSING_MANDATORY_FIELD, new String[] { "tag.body.address.streetAddress" }); if (Strings.isNullOrEmpty(address.getVcardLocality())) throw new PropertyValidationException(ParamValidationException.MESSAGE_MISSING_MANDATORY_FIELD, I18nConstants.MESSAGE_MISSING_MANDATORY_FIELD, new String[] { "tag.body.address.locality" }); if (Strings.isNullOrEmpty(address.getVcardCountryName())) throw new PropertyValidationException(ParamValidationException.MESSAGE_MISSING_MANDATORY_FIELD, I18nConstants.MESSAGE_MISSING_MANDATORY_FIELD, new String[] { "tag.body.address.countryName" }); if (body.getType() == null || Strings.isNullOrEmpty(body.getType().get(0)) || !body.getType().get(0).equals(WebAnnotationModelKeywords.CLASS_VCARD_ADDRESS)) throw new PropertyValidationException(ParamValidationException.MESSAGE_MISSING_MANDATORY_FIELD, I18nConstants.MESSAGE_MISSING_MANDATORY_FIELD, new String[] { "tag.body.address.type" }); }

Target:
private void validateSemanticTagVcardAddressBody(Body body) throws ParamValidationException, PropertyValidationException { if (body.getType() == null || !(body.getType().size() == 1)) { } else if (!ResourceTypes.VCARD_ADDRESS.hasJsonValue(body.getType().get(0))) { throw new PropertyValidationException(I18nConstants.INVALID_PROPERTY_VALUE, I18nConstants.INVALID_PROPERTY_VALUE, new String[] { "vcardAddress.body.type" }); } Address address = ((VcardAddressBody) body).getAddress(); if (StringUtils.isBlank(address.getVcardStreetAddress())) throw new PropertyValidationException(ParamValidationException.MESSAGE_MISSING_MANDATORY_FIELD, I18nConstants.MESSAGE_MISSING_MANDATORY_FIELD, new String[] { "tag.body.address.streetAddress" }); if (StringUtils.isBlank(address.getVcardLocality())) throw new PropertyValidationException(ParamValidationException.MESSAGE_MISSING_MANDATORY_FIELD, I18nConstants.MESSAGE_MISSING_MANDATORY_FIELD, new String[] { "tag.body.address.locality" }); if (StringUtils.isBlank(address.getVcardCountryName())) throw new PropertyValidationException(ParamValidationException.MESSAGE_MISSING_MANDATORY_FIELD, I18nConstants.MESSAGE_MISSING_MANDATORY_FIELD, new String[] { "tag.body.address.countryName" }); if (body.getType() == null || StringUtils.isBlank(body.getType().get(0))) throw new PropertyValidationException(ParamValidationException.MESSAGE_MISSING_MANDATORY_FIELD, I18nConstants.MESSAGE_MISSING_MANDATORY_FIELD, new String[] { "tag.body.address.type" }); }
Source:
public void importFile(String filePath) throws IOException { File file = new File(filePath); if (!file.exists()) { throw new FileNotFoundException( Constant.messages.getString("graphql.error.filenotfound")); } if (!file.canRead() || !file.isFile()) { throw new IOException(Constant.messages.getString("graphql.error.importfile")); } String schemaSDL = FileUtils.readFileToString(file, "UTF-8"); Thread t = new Thread(() -> parse(schemaSDL)); t.start(); }

Target:
public void importFile(String filePath) throws IOException { File file = new File(filePath); if (!file.exists()) { throw new FileNotFoundException( Constant.messages.getString("graphql.error.filenotfound")); } if (!file.canRead() || !file.isFile()) { throw new IOException(Constant.messages.getString("graphql.error.importfile")); } String schemaSdl = FileUtils.readFileToString(file, StandardCharsets.UTF_8); parse(schemaSdl); }
Source:
protected URL toURL(File file) { try { return file.toURI().toURL(); } catch (MalformedURLException e) { throw new RuntimeException(e); } }

Target:
protected URL toURL(File file) { try { return file.toURI().toURL(); } catch (MalformedURLException e) { throw new RuntimeServiceException(e); } }
Source:
private boolean evaluateReturnValues(AuditLogType auditLogType, List<VdcReturnValueBase> returnValues) { boolean succeeded = true; List<String> errors = new ArrayList<String>(); for (VdcReturnValueBase currentReturnValue : returnValues) { boolean currentExecutionStatus = currentReturnValue.getSucceeded(); succeeded &= currentExecutionStatus; if (!currentExecutionStatus) { errors.addAll(currentReturnValue.getExecuteFailedMessages()); } } if (!succeeded) { handleVdsErrors(auditLogType, errors); } return succeeded; }

Target:
private boolean evaluateReturnValues(AuditLogType auditLogType, List<VdcReturnValueBase> returnValues) { boolean succeeded = true; List<String> errors = new ArrayList<>(); for (VdcReturnValueBase currentReturnValue : returnValues) { boolean currentExecutionStatus = currentReturnValue.getSucceeded(); succeeded = succeeded && currentExecutionStatus; if (!currentExecutionStatus) { errors.addAll(currentReturnValue.getExecuteFailedMessages()); } } if (!succeeded) { handleVdsErrors(auditLogType, errors); } return succeeded; }
Source:
public void updated(Dictionary<String, ?> config) throws ConfigurationException { if (config != null) { Enumeration<String> keys = config.keys(); if ( serverList == null ) { serverList = new HashMap<String, OWServerConfig>(); } while (keys.hasMoreElements()) { String key = (String) keys.nextElement(); if ("service.pid".equals(key)) { continue; } Matcher matcher = EXTRACT_CONFIG_PATTERN.matcher(key); if (!matcher.matches()) { continue; } matcher.reset(); matcher.find(); String serverId = matcher.group(1); OWServerConfig deviceConfig = serverList.get(serverId); if (deviceConfig == null) { deviceConfig = new OWServerConfig(); serverList.put(serverId, deviceConfig); } String configKey = matcher.group(2); String value = (String) config.get(key); if ("host".equals(configKey)) { deviceConfig.host = value; } if ("user".equals(configKey)) { deviceConfig.user = value; } if ("password".equals(configKey)) { deviceConfig.password = value; } } String timeoutString = (String) config.get("timeout"); if (StringUtils.isNotBlank(timeoutString)) { timeout = Integer.parseInt(timeoutString); } String granularityString = (String) config.get("granularity"); if (StringUtils.isNotBlank(granularityString)) { granularity = Integer.parseInt(granularityString); } String cacheString = (String) config.get("cache"); if (StringUtils.isNotBlank(cacheString)) { cacheDuration = Integer.parseInt(cacheString); } setProperlyConfigured(true); } }

Target:
public void updated(Dictionary<String, ?> config) throws ConfigurationException { if (config != null) { Enumeration<String> keys = config.keys(); if ( serverList == null ) { serverList = new HashMap<String, OWServerConfig>(); } while (keys.hasMoreElements()) { String key = (String) keys.nextElement(); if ("service.pid".equals(key)) { continue; } Matcher matcher = EXTRACT_CONFIG_PATTERN.matcher(key); if (!matcher.matches()) { continue; } matcher.reset(); matcher.find(); String serverId = matcher.group(1); OWServerConfig deviceConfig = serverList.get(serverId); if (deviceConfig == null) { deviceConfig = new OWServerConfig(); serverList.put(serverId, deviceConfig); } String configKey = matcher.group(2); String value = (String) config.get(key); if ("host".equals(configKey)) { deviceConfig.host = value; } else if ("user".equals(configKey)) { deviceConfig.user = value; } else if ("password".equals(configKey)) { deviceConfig.password = value; } else { throw new ConfigurationException(configKey, "The given OWServer configKey '" + configKey + "' is unknown"); } } String timeoutString = (String) config.get("timeout"); if (StringUtils.isNotBlank(timeoutString)) { timeout = Integer.parseInt(timeoutString); } String granularityString = (String) config.get("granularity"); if (StringUtils.isNotBlank(granularityString)) { granularity = Integer.parseInt(granularityString); } String cacheString = (String) config.get("cache"); if (StringUtils.isNotBlank(cacheString)) { cacheDuration = Integer.parseInt(cacheString); } setProperlyConfigured(true); } }
Source:
public RawDataFile execute() throws MSDKException { logger.info("Started Filter " + this.filteringAlgorithm.getName() + " with Raw Data File #" + rawDataFile.getName()); result = MSDKObjectBuilder.getRawDataFile(this.rawDataFile.getName(), this.rawDataFile.getOriginalFile(), this.rawDataFile.getRawDataFileType(), DataPointStoreFactory.getMemoryDataStore()); List<MsScan> scans = rawDataFile.getScans(); totalScans = scans.size(); for (MsScan scan : scans) { if (canceled) { return null; } MsSpectrum newScan = this.filteringAlgorithm.performFilter(scan); if (newScan != null) { result.addScan((MsScan) newScan); } processedScans++; } logger.info("Finished Filter " + this.filteringAlgorithm.getName() + " with Raw Data File #" + rawDataFile.getName()); return result; }

Target:
public RawDataFile execute() throws MSDKException { logger.info("Started Filter " + this.filteringAlgorithm.getName() + " with Raw Data File #" + rawDataFile.getName()); result = MSDKObjectBuilder.getRawDataFile(this.rawDataFile.getName(), this.rawDataFile.getOriginalFile(), this.rawDataFile.getRawDataFileType(), store); List<MsScan> scans = rawDataFile.getScans(); totalScans = scans.size(); for (MsScan scan : scans) { if (canceled) { return null; } MsSpectrum newScan = this.filteringAlgorithm.performFilter(scan); if (newScan != null) { result.addScan((MsScan) newScan); } processedScans++; } logger.info("Finished Filter " + this.filteringAlgorithm.getName() + " with Raw Data File #" + rawDataFile.getName()); return result; }
Source:
public boolean onNewOptionInDropDownClicked(View v) { spinnerSelectionBuffer = spinner.getSelectedItemPosition(); new NewLookDialogFragment(this, ProjectManager.getInstance().getCurrentScene(), ProjectManager.getInstance().getCurrentSprite()) { @Override public void onCancel(DialogInterface dialog) { super.onCancel(dialog); spinner.setSelection(spinnerSelectionBuffer); } }.show(((Activity) v.getContext()).getFragmentManager(), NewLookDialogFragment.TAG); return false; }

Target:
public boolean onNewOptionInDropDownClicked(View v) { previouslySelectedLook = getLook(); new NewLookDialogFragment(this, ProjectManager.getInstance().getCurrentScene(), ProjectManager.getInstance().getCurrentSprite()) { @Override public void onCancel(DialogInterface dialog) { super.onCancel(dialog); setLook(previouslySelectedLook); spinner.setSelection(spinnerAdapter.getPosition(getLook() != null ? getLook().getName() : null)); } }.show(((Activity) v.getContext()).getFragmentManager(), NewLookDialogFragment.TAG); return false; }
Source:
@Test public void jwtDownloadValidation_validSystemScope_Success() { executeAndAssert(DOWNLOAD, VALID_STUDY, NOT_EXPIRED, OK); }

Target:
@Test public void jwtDownloadValidation_validSystemScope_Success() { executeAndAssert(DOWNLOAD, VALID_SYSTEM, NOT_EXPIRED, OK); }
Source:
public synchronized boolean isTerminated() { List<ManagedChannel> c = new ArrayList<>(channels.get()); boolean allTerminated = true; for (Iterator<ManagedChannel> iterator = c.iterator(); iterator.hasNext();) { ManagedChannel managedChannel = iterator.next(); if (managedChannel.isTerminated()) { iterator.remove(); } else { allTerminated = false; } } setChannels(c); return allTerminated; }

Target:
public boolean isTerminated() { boolean allTerminated = true; for (ManagedChannel managedChannel: channels.get()) { if (!managedChannel.isTerminated()) { return false; } } return true; }
Source:
public HttpClient() { logger = LoggerFactory.getLogger(getClass()); commandsQueue = new LinkedList<>(); commandExecutor = () -> { while (true) { try { int delayTime = 0; synchronized (this.commandsQueue) { AsyncPutParameters payloadCallbackPair = HttpClient.this.commandsQueue.poll(); if (payloadCallbackPair != null) { logger.debug("Async sending put to address: delay: body: {}", payloadCallbackPair.address, payloadCallbackPair.delay, payloadCallbackPair.body); try { Result result = HttpClient.this.put(payloadCallbackPair.address, payloadCallbackPair.body); payloadCallbackPair.future.complete(result); } catch (IOException e) { payloadCallbackPair.future.completeExceptionally(e); } delayTime = payloadCallbackPair.delay; } else { return; } } Thread.sleep(delayTime); } catch (InterruptedException e) { logger.debug("commandExecutorThread was interrupted", e); } } }; job = null; }

Target:
public HttpClient() { logger = LoggerFactory.getLogger(getClass()); commandsQueue = new LinkedList<>(); commandExecutor = () -> { while (true) { try { int delayTime = 0; synchronized (this.commandsQueue) { AsyncPutParameters payloadCallbackPair = HttpClient.this.commandsQueue.poll(); if (payloadCallbackPair != null) { logger.debug("Async sending put to address: delay: body: {}", payloadCallbackPair.address, payloadCallbackPair.delay, payloadCallbackPair.body); try { Result result = HttpClient.this.put(payloadCallbackPair.address, payloadCallbackPair.body); payloadCallbackPair.future.complete(result); } catch (IOException e) { payloadCallbackPair.future.completeExceptionally(e); } delayTime = payloadCallbackPair.delay; } else { return; } } Thread.sleep(delayTime); } catch (InterruptedException e) { logger.debug("commandExecutorThread was interrupted", e); } } }; }
Source:
public void testSetup() { final String expectedWidget = "800px"; modal.setup(); verify(modal).setWidth(eq(expectedWidget)); verify(view).setup(treeList); }

Target:
public void testSetup() { final String expectedWidgetWidth = "800px"; modal.setup(); verify(modal).setWidth(eq(expectedWidgetWidth)); verify(view).setup(treeList); }
Source:
public boolean checkIfJobHasTasks(Guid jobId) { List<Step> steps = step.getStepsByJobIdForVdsmAndGluster(jobId); return steps.size() > 0; }

Target:
public boolean checkIfJobHasTasks(Guid jobId) { List<Step> steps = step.getStepsByJobIdForVdsmAndGluster(jobId); return !steps.isEmpty(); }
Source:
public Boolean isPasswordTogglerDisabled() { String togglerDisabled = passwordField.getAttribute("type"); return togglerDisabled.equals("password"); }

Target:
public Boolean isPasswordTogglerDisabled() { String togglerDisabled = passwordField.getAttribute("type"); return "password".equals(togglerDisabled); }
Source:
public void addExternallyManagedVms(List<VmStatic> externalVmList) { for (VmStatic currVm : externalVmList) { AddVmFromScratchParameters params = new AddVmFromScratchParameters(currVm, null, null); VdcReturnValueBase returnValue = Backend.getInstance().runInternalAction(VdcActionType.AddVmFromScratch, params, ExecutionHandler.createInternalJobContext()); if (!returnValue.getSucceeded()) { log.debugFormat("Failed adding Externally managed VM {0}", params.getVm().getName()); } } }

Target:
public void addExternallyManagedVms(List<VmStatic> externalVmList) { for (VmStatic currVm : externalVmList) { AddVmFromScratchParameters params = new AddVmFromScratchParameters(currVm, null, null); VdcReturnValueBase returnValue = Backend.getInstance().runInternalAction(VdcActionType.AddVmFromScratch, params, ExecutionHandler.createInternalJobContext()); if (!returnValue.getSucceeded()) { log.debugFormat("Failed adding Externally managed VM {0}", currVm.getName()); } } }
Source:
private void filterIntervals() { int numberOfMinutes = 600; switch (selectedInterval) { case MINUTES_10: numberOfMinutes = 10; break; case MINUTES_30: numberOfMinutes = 30; break; case HOUR_1: numberOfMinutes = 60; break; case HOURS_2: numberOfMinutes = 120; break; case HOURS_5: numberOfMinutes = 300; break; case HOURS_8: numberOfMinutes = 480; break; case HOURS_10: numberOfMinutes = 600; } ArrayList<IntervalBase> filteredIntervals = new ArrayList<IntervalBase>(); ArrayList<IntervalBase> intervalsToRemove = new ArrayList<IntervalBase>(); if (intervals.size() == 0) { return; } mostRecentDate = intervals.get(intervals.size() - 1).getEnd(); DateTime thresholdDateDatabase = new DateTime(mostRecentDate); thresholdDateDatabase = thresholdDateDatabase .minusMinutes(FILTERED_INTERVALS_IN_MINUTES); DateTime thresholdDateView = new DateTime(mostRecentDate); thresholdDateView = thresholdDateView.minusMinutes(numberOfMinutes); for (IntervalBase interval : intervals) { if (interval.getEnd().after(thresholdDateDatabase.toDate())) { if (interval.getEnd().after(thresholdDateView.toDate())) { IntervalBase clonedInterval = (IntervalBase) interval .clone(); if (interval.getStart().before(thresholdDateView.toDate())) { clonedInterval.setStartTime(thresholdDateView.toDate()); } if (!clonedInterval.isClosed()) { clonedInterval.setEndTime(mostRecentDate); } filteredIntervals.add(clonedInterval); } } else { intervalsToRemove.add(interval); } } oldestDate = filteredIntervals.get(0).getStart(); intervalPersister.removeIntervals(intervalsToRemove); intervals = filteredIntervals; }

Target:
private void filterIntervals() { ArrayList<IntervalBase> filteredIntervals = new ArrayList<IntervalBase>(); ArrayList<IntervalBase> intervalsToRemove = new ArrayList<IntervalBase>(); if (intervals.size() == 0) { return; } mostRecentDate = intervals.get(intervals.size() - 1).getEnd(); DateTime thresholdDateDatabase = new DateTime(mostRecentDate); thresholdDateDatabase = thresholdDateDatabase .minusMinutes(FILTERED_INTERVALS_IN_MINUTES); DateTime thresholdDateView = new DateTime(mostRecentDate); thresholdDateView = thresholdDateView .minusMinutes(selectedInterval.numberOfMinutes); for (IntervalBase interval : intervals) { if (interval.getEnd().after(thresholdDateDatabase.toDate())) { if (interval.getEnd().after(thresholdDateView.toDate())) { IntervalBase clonedInterval = (IntervalBase) interval .clone(); if (interval.getStart().before(thresholdDateView.toDate())) { clonedInterval.setStartTime(thresholdDateView.toDate()); } if (!clonedInterval.isClosed()) { clonedInterval.setEndTime(mostRecentDate); } filteredIntervals.add(clonedInterval); } } else { intervalsToRemove.add(interval); } } oldestDate = filteredIntervals.get(0).getStart(); intervalPersister.removeIntervals(intervalsToRemove); intervals = filteredIntervals; }
Source:
private void logBrickStatusChange(GlusterVolumeEntity volume, final GlusterBrickEntity brick, final GlusterStatus fetchedStatus) { log.debug("Detected that status of brick '{}' in volume '{}' changed from '{}' to '{}'", brick.getQualifiedName(), volume.getName(), brick.getStatus(), fetchedStatus); logUtil.logAuditMessage(volume.getClusterId(), volume, null, AuditLogType.GLUSTER_BRICK_STATUS_CHANGED, new HashMap<String, String>() { { put(GlusterConstants.BRICK_PATH, brick.getQualifiedName()); put(GlusterConstants.OPTION_OLD_VALUE, brick.getStatus().toString()); put(GlusterConstants.OPTION_NEW_VALUE, fetchedStatus.toString()); } }); if(fetchedStatus == GlusterStatus.DOWN){ logUtil.logAuditMessage(volume.getClusterId(), volume, null, AuditLogType.GLUSTER_BRICK_STATUS_DOWN, brick.getId(), brick.getQualifiedName(), new HashMap<String, String>() { { put(GlusterConstants.BRICK_PATH, brick.getQualifiedName()); } }); }else if(fetchedStatus == GlusterStatus.UP){ AlertDirector.RemoveAlertsByBrickIdLogType(brick.getId(), AuditLogType.GLUSTER_BRICK_STATUS_DOWN); } }

Target:
private void logBrickStatusChange(GlusterVolumeEntity volume, final GlusterBrickEntity brick, final GlusterStatus fetchedStatus) { log.debug("Detected that status of brick '{}' in volume '{}' changed from '{}' to '{}'", brick.getQualifiedName(), volume.getName(), brick.getStatus(), fetchedStatus); logUtil.logAuditMessage(volume.getClusterId(), volume, null, AuditLogType.GLUSTER_BRICK_STATUS_CHANGED, new HashMap<String, String>() { { put(GlusterConstants.BRICK_PATH, brick.getQualifiedName()); put(GlusterConstants.OPTION_OLD_VALUE, brick.getStatus().toString()); put(GlusterConstants.OPTION_NEW_VALUE, fetchedStatus.toString()); } }); if(fetchedStatus == GlusterStatus.DOWN){ logUtil.logAuditMessage(volume.getClusterId(), volume, null, AuditLogType.GLUSTER_BRICK_STATUS_DOWN, brick.getId(), brick.getQualifiedName()); }else if(fetchedStatus == GlusterStatus.UP){ AlertDirector.RemoveAlertsByBrickIdLogType(brick.getId(), AuditLogType.GLUSTER_BRICK_STATUS_DOWN); } }
Source:
public void remove(final Session removedSession) { if (doGetSessions().contains(removedSession)) { getOwnedSessions().remove(removedSession); final SessionListener sessListener = sessionsToListeners.get(removedSession); if (sessListener != null) { removedSession.removeListener(sessListener); } sessionsToListeners.remove(removedSession); final Set<SessionManagerListener> listenersToIterate = Sets.newLinkedHashSet(getAllListeners()); for (final SessionManagerListener listener : listenersToIterate) { listener.notifyRemoveSession(removedSession); } this.fireVPSelectionDeselectionEvents(); if (sessionsToListeners.isEmpty()) { if (Platform.isRunning()) { SiriusPlugin.getDefault().getModelAccessorRegistry().dispose(); } } } }

Target:
public void remove(final Session removedSession) { if (doGetSessions().contains(removedSession)) { getOwnedSessions().remove(removedSession); final SessionListener sessListener = sessionsToListeners.get(removedSession); if (sessListener != null) { removedSession.removeListener(sessListener); } sessionsToListeners.remove(removedSession); final Set<SessionManagerListener> listenersToIterate = Sets.newLinkedHashSet(getAllListeners()); for (final SessionManagerListener listener : listenersToIterate) { listener.notifyRemoveSession(removedSession); } this.fireVPSelectionDeselectionEvents(); if (sessionsToListeners.isEmpty()) { SiriusPlugin.getDefault().getModelAccessorRegistry().dispose(); } } }
Source:
private void addSchemaToConf(JobConf jobConf) { List<String> typeStrs = Arrays.stream(fieldTypes) .map(t -> HiveTypeUtil.toHiveTypeInfo(t, true).toString()) .collect(Collectors.toList()); jobConf.set(IOConstants.COLUMNS, String.join(",", fieldNames)); jobConf.set(IOConstants.COLUMNS_TYPES, String.join(",", typeStrs)); int numPartCol = partitionKeys != null ? partitionKeys.size() : 0; int firstPartColIndex = fieldNames.length - numPartCol; if (numPartCol == 0) { jobConf.set(SCHEMA_EVOLUTION_COLUMNS, jobConf.get(IOConstants.COLUMNS)); jobConf.set(SCHEMA_EVOLUTION_COLUMNS_TYPES, jobConf.get(IOConstants.COLUMNS_TYPES)); } else { jobConf.set(SCHEMA_EVOLUTION_COLUMNS, String.join(",", Arrays.copyOfRange(fieldNames, 0, firstPartColIndex))); jobConf.set(SCHEMA_EVOLUTION_COLUMNS_TYPES, String.join(",", typeStrs.subList(0, firstPartColIndex))); } String readColIDs = Arrays.stream(selectedFields) .filter(i -> i < firstPartColIndex) .mapToObj(String::valueOf) .collect(Collectors.joining(",")); jobConf.set(ColumnProjectionUtils.READ_COLUMN_IDS_CONF_STR, readColIDs); }

Target:
private void addSchemaToConf(JobConf jobConf) { List<String> typeStrs = Arrays.stream(fieldTypes) .map(t -> HiveTypeUtil.toHiveTypeInfo(t, true).toString()) .collect(Collectors.toList()); jobConf.set(IOConstants.COLUMNS, String.join(",", fieldNames)); jobConf.set(IOConstants.COLUMNS_TYPES, String.join(",", typeStrs)); int numNonPartCol = fieldNames.length - partitionKeys.size(); jobConf.set(SCHEMA_EVOLUTION_COLUMNS, String.join(",", Arrays.copyOfRange(fieldNames, 0, numNonPartCol))); jobConf.set(SCHEMA_EVOLUTION_COLUMNS_TYPES, String.join(",", typeStrs.subList(0, numNonPartCol))); String readColIDs = Arrays.stream(selectedFields) .filter(i -> i < numNonPartCol) .mapToObj(String::valueOf) .collect(Collectors.joining(",")); jobConf.set(ColumnProjectionUtils.READ_COLUMN_IDS_CONF_STR, readColIDs); }
Source:
public File getWorkingDir() { return this.workingDir.toFile(); }

Target:
public Path getWorkingDir() { return this.workingDir; }
Source:
public Response previewSnapshot(Action action) { validateParameters(action, "snapshot.id"); TryBackToAllSnapshotsOfVmParameters tryBackParams = new TryBackToAllSnapshotsOfVmParameters(guid, asGuid(action.getSnapshot().getId())); if (action.isSetRestoreMemory()) { tryBackParams.setRestoreMemory(action.isRestoreMemory()); } if (action.isSetDisks()) { Set<Guid> disksGuid = new HashSet<>(); List<DiskImage> disks = getParent().mapDisks(action.getDisks()); if (disks != null) { disksGuid = getDisksGuidSet(disks); } tryBackParams.setDisks(disksGuid); } Response response = doAction(ActionType.TryBackToAllSnapshotsOfVm, tryBackParams, action); return response; }

Target:
public Response previewSnapshot(Action action) { validateParameters(action, "snapshot.id"); TryBackToAllSnapshotsOfVmParameters tryBackParams = new TryBackToAllSnapshotsOfVmParameters(guid, asGuid(action.getSnapshot().getId())); if (action.isSetRestoreMemory()) { tryBackParams.setRestoreMemory(action.isRestoreMemory()); } if (action.isSetDisks()) { List<DiskImage> disks = getParent().mapDisks(action.getDisks()); tryBackParams.setDisks(getDisksGuidSet(disks)); } Response response = doAction(ActionType.TryBackToAllSnapshotsOfVm, tryBackParams, action); return response; }
Source:
public MediaFormat copyAsAdaptive() { return new MediaFormat(id, trackId, mimeType, NO_VALUE, NO_VALUE, durationUs, NO_VALUE, NO_VALUE, NO_VALUE, NO_VALUE, NO_VALUE, NO_VALUE, null, OFFSET_SAMPLE_RELATIVE, null, true, maxWidth, maxHeight); }

Target:
public MediaFormat copyAsAdaptive() { return new MediaFormat(null, mimeType, NO_VALUE, NO_VALUE, durationUs, NO_VALUE, NO_VALUE, NO_VALUE, NO_VALUE, NO_VALUE, NO_VALUE, null, OFFSET_SAMPLE_RELATIVE, null, true, maxWidth, maxHeight); }
Source:
public void test_services_config_port_increment_false() { Microservices node = Microservices.builder().clusterConfig( ClusterConfig.builder() .transportConfig(TransportConfig.builder() .port(3000) .portAutoIncrement(false) .build())) .build(); assertTrue(node.cluster().address().port() == 3000); }

Target:
public void test_services_config_port_increment_false() { Microservices node = Microservices.builder().clusterConfig( ClusterConfig.builder() .transportConfig(TransportConfig.builder() .port(3000) .portAutoIncrement(false) .build())) .build(); assertEquals(node.cluster().address().port() , 3000); node.cluster().shutdown(); }
Source:
public void run() { try { Thread.sleep(DELAY); } catch (InterruptedException e) { GlowServer.logger.severe("ShutdownMonitor interrupted"); return; } GlowServer.logger.warning("Still running after shutdown, finding rogue threads..."); final Map<Thread, StackTraceElement[]> traces = Thread.getAllStackTraces(); for (Map.Entry<Thread, StackTraceElement[]> entry : traces.entrySet()) { final Thread thread = entry.getKey(); final StackTraceElement[] stack = entry.getValue(); if (thread.isDaemon() || !thread.isAlive() || stack.length == 0) { continue; } GlowServer.logger.warning("Rogue thread: " + thread.toString()); for (StackTraceElement trace : stack) { GlowServer.logger.warning("\tat " + trace.toString()); } thread.interrupt(); } System.exit(1000); }

Target:
public void run() { try { Thread.sleep(DELAY); } catch (InterruptedException e) { GlowServer.logger.severe("ShutdownMonitor interrupted"); return; } GlowServer.logger.warning("Still running after shutdown, finding rogue threads..."); final Map<Thread, StackTraceElement[]> traces = Thread.getAllStackTraces(); for (Map.Entry<Thread, StackTraceElement[]> entry : traces.entrySet()) { final Thread thread = entry.getKey(); final StackTraceElement[] stack = entry.getValue(); if (thread.isDaemon() || !thread.isAlive() || stack.length == 0) { continue; } GlowServer.logger.log(Level.WARNING, "Rogue thread: {0}", thread); for (StackTraceElement trace : stack) { GlowServer.logger.log(Level.WARNING, "\tat {0}", trace); } thread.interrupt(); if (thread.isAlive()) { try { thread.join(1000); } catch (InterruptedException ex) { GlowServer.logger.log(Level.SEVERE, ex.getMessage(), ex); } } } System.exit(0); }