auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testReindexingSingleStringHashIdentityValueIsDeleted() { Patient p = new Patient(); p.addName().setFamily("family1"); final IIdType id = myPatientDao.create(p, mySrd).getId().toUnqualifiedVersionless(); SearchParameterMap searchParamMap = new SearchParameterMap(); searchParamMap.setLoadSynchronous(true); searchParamMap.add(Patient.SP_FAMILY, new StringParam("family1")); assertEquals(1, myPatientDao.search(searchParamMap).size().intValue()); runInTransaction(()->{ Long i = myEntityManager .createQuery("SELECT count(s) FROM ResourceIndexedSearchParamString s WHERE s.myHashIdentity IS null", Long.class) .getSingleResult(); assertEquals(0L, i.longValue()); myEntityManager .createQuery("UPDATE ResourceIndexedSearchParamString s SET s.myHashIdentity = null") .executeUpdate(); i = myEntityManager .createQuery("SELECT count(s) FROM ResourceIndexedSearchParamString s WHERE s.myHashIdentity IS null", Long.class) .getSingleResult(); assertThat(i, greaterThan(1L)); }); myResourceReindexingSvc.markAllResourcesForReindexing(); myResourceReindexingSvc.forceReindexingPass(); runInTransaction(()->{ Long i = myEntityManager .createQuery("SELECT count(s) FROM ResourceIndexedSearchParamString s WHERE s.myHashIdentity IS nullhir", Long.class) .getSingleResult(); assertEquals(0L, i.longValue()); }); }

Target:
public void testReindexingSingleStringHashIdentityValueIsDeleted() { Patient p = new Patient(); p.addName().setFamily("family1"); final IIdType id = myPatientDao.create(p, mySrd).getId().toUnqualifiedVersionless(); SearchParameterMap searchParamMap = new SearchParameterMap(); searchParamMap.setLoadSynchronous(true); searchParamMap.add(Patient.SP_FAMILY, new StringParam("family1")); assertEquals(1, myPatientDao.search(searchParamMap).size().intValue()); runInTransaction(()->{ Long i = myEntityManager .createQuery("SELECT count(s) FROM ResourceIndexedSearchParamString s WHERE s.myHashIdentity IS null", Long.class) .getSingleResult(); assertEquals(0L, i.longValue()); myEntityManager .createQuery("UPDATE ResourceIndexedSearchParamString s SET s.myHashIdentity = null") .executeUpdate(); i = myEntityManager .createQuery("SELECT count(s) FROM ResourceIndexedSearchParamString s WHERE s.myHashIdentity IS null", Long.class) .getSingleResult(); assertThat(i, greaterThan(1L)); }); myResourceReindexingSvc.markAllResourcesForReindexing(); myResourceReindexingSvc.forceReindexingPass(); runInTransaction(()->{ Long i = myEntityManager .createQuery("SELECT count(s) FROM ResourceIndexedSearchParamString s WHERE s.myHashIdentity IS null", Long.class) .getSingleResult(); assertEquals(0L, i.longValue()); }); }
Source:
public WorkspaceMetacardImpl() { super(TYPE); Set<String> setOfTags = new HashSet<String>(); setOfTags.add(WorkspaceAttributes.WORKSPACE_TAG); setOfTags.add(ShareableMetacardAttributes.NAME); setTags(setOfTags); }

Target:
public WorkspaceMetacardImpl() { super(TYPE); setTags(Collections.singleton(WorkspaceAttributes.WORKSPACE_TAG)); }
Source:
public void update() { FBO ssaoFbo = displayResolutionDependentFBOs.get(SSAO_FBO); outputFboWidth = ssaoFbo.width(); outputFboHeight = ssaoFbo.height(); }

Target:
public void update() { ssaoFbo = displayResolutionDependentFBOs.get(SSAO_FBO); outputFboWidth = ssaoFbo.width(); outputFboHeight = ssaoFbo.height(); }
Source:
public void run() { SourceDataLine line; AudioFormat audioFormat = convertAudioFormat(this.audioStream.getFormat()); if (audioFormat == null) { logger.warn("Audio format is unsupported or does not have enough details in order to be played"); return; } DataLine.Info info = new DataLine.Info(SourceDataLine.class, audioFormat); try { line = (SourceDataLine) AudioSystem.getLine(info); line.open(audioFormat); } catch (Exception e) { logger.warn("No line found: {}", e.getMessage()); logger.info("Available lines are:"); Mixer.Info[] mixerInfo = AudioSystem.getMixerInfo(); Mixer mixer = null; for (int cnt = 0; cnt < mixerInfo.length; cnt++) { mixer = AudioSystem.getMixer(mixerInfo[cnt]); Line.Info[] lineInfos = mixer.getSourceLineInfo(); for (Info lineInfo : lineInfos) { logger.info("{}", lineInfo.toString()); } } return; } line.start(); int nRead = 0; byte[] abData = new byte[65532]; try { while (-1 != nRead) { nRead = audioStream.read(abData, 0, abData.length); if (nRead >= 0) { line.write(abData, 0, nRead); } } } catch (IOException e) { logger.error("Error while playing audio: {}", e.getMessage()); return; } finally { line.drain(); line.close(); try { audioStream.close(); } catch (IOException e) { } } }

Target:
public void run() { SourceDataLine line; AudioFormat audioFormat = convertAudioFormat(this.audioStream.getFormat()); if (audioFormat == null) { logger.warn("Audio format is unsupported or does not have enough details in order to be played"); return; } DataLine.Info info = new DataLine.Info(SourceDataLine.class, audioFormat); try { line = (SourceDataLine) AudioSystem.getLine(info); line.open(audioFormat); } catch (Exception e) { logger.warn("No line found: {}", e.getMessage()); logger.info("Available lines are:"); Mixer.Info[] mixerInfo = AudioSystem.getMixerInfo(); Mixer mixer = null; for (int cnt = 0; cnt < mixerInfo.length; cnt++) { mixer = AudioSystem.getMixer(mixerInfo[cnt]); Line.Info[] lineInfos = mixer.getSourceLineInfo(); for (Info lineInfo : lineInfos) { logger.info("{}", lineInfo); } } return; } line.start(); int nRead = 0; byte[] abData = new byte[65532]; try { while (-1 != nRead) { nRead = audioStream.read(abData, 0, abData.length); if (nRead >= 0) { line.write(abData, 0, nRead); } } } catch (IOException e) { logger.error("Error while playing audio: {}", e.getMessage()); return; } finally { line.drain(); line.close(); try { audioStream.close(); } catch (IOException e) { } } }
Source:
private void addImportToSourcePackageTypes(ICompilationUnit movedUnit, IProgressMonitor pm) throws CoreException{ List<ICompilationUnit> cuList= Arrays.asList(fCus); IType[] allCuTypes= movedUnit.getAllTypes(); ImportRewrite importEdit= getImportRewrite(movedUnit); importEdit.setFilterImplicitImports(false); IPackageFragment srcPack= (IPackageFragment)movedUnit.getParent(); for (IType iType : ReferenceFinderUtil.getTypesReferencedIn(allCuTypes, pm)) { if (! iType.exists()) continue; if (!JavaModelUtil.isSamePackage(iType.getPackageFragment(), srcPack)) continue; if (cuList.contains(iType.getCompilationUnit())) continue; importEdit.addImport(iType.getFullyQualifiedName('.')); } }

Target:
private void addImportToSourcePackageTypes(ICompilationUnit movedUnit, IProgressMonitor pm) throws CoreException{ List<ICompilationUnit> cuList= Arrays.asList(fCus); IType[] allCuTypes= movedUnit.getAllTypes(); ImportRewrite importEdit= getImportRewrite(movedUnit); importEdit.setFilterImplicitImports(false); IPackageFragment srcPack= (IPackageFragment)movedUnit.getParent(); for (IType type : ReferenceFinderUtil.getTypesReferencedIn(allCuTypes, pm)) { if (! type.exists()) continue; if (!JavaModelUtil.isSamePackage(type.getPackageFragment(), srcPack)) continue; if (cuList.contains(type.getCompilationUnit())) continue; importEdit.addImport(type.getFullyQualifiedName('.')); } }
Source:
public void finished(Request request) { RenderTimeStatistics statistics = (RenderTimeStatistics) request.getHttpRequest().getAttribute(RenderTimeStatistics.ID); RequestData data = monitor.current(); if (data == null) { return; } if (request.getError() != null) { data.setStatus(Status.FAILED); data.setErrorMessage(request.getError().getLocalizedMessage()); data.setError(request.getError()); monitor.update(); } if (statistics != null) { List<Long> renderingTimeLayers = new ArrayList<>(statistics.getRenderingLayersIdxs().size()); data.setLabellingProcessingTime(statistics.getLabellingTime()); data.setResources(statistics.getLayerNames()); for (Integer idx: statistics.getRenderingLayersIdxs()){ renderingTimeLayers.add(statistics.getRenderingTime(idx)); } data.setResourcesProcessingTime(renderingTimeLayers); if (data.getEndTime()==null) data.setEndTime(new Date()); monitor.complete(); monitor.postProcessed(data); } }

Target:
public void finished(Request request) { if (request.getError() != null) { RequestData data = monitor.current(); if (data == null) { return; } data.setStatus(Status.FAILED); data.setErrorMessage(request.getError().getLocalizedMessage()); data.setError(request.getError()); monitor.update(); } }
Source:
public boolean visit(ConstructorInvocation constructorInvocation) { List<?> arguments= constructorInvocation.arguments(); if (!arguments.isEmpty()) { IMethodBinding constructorBinding= constructorInvocation.resolveConstructorBinding(); IMethod method = resolveMethodBinding(constructorBinding); collectParameterNamesCodeMinings(method, arguments, constructorBinding.isVarargs()); } return super.visit(constructorInvocation); }

Target:
public boolean visit(ConstructorInvocation constructorInvocation) { List<?> arguments= constructorInvocation.arguments(); if (!arguments.isEmpty()) { IMethodBinding constructorBinding= constructorInvocation.resolveConstructorBinding(); if (constructorBinding != null) { IMethod method = resolveMethodBinding(constructorBinding); collectParameterNamesCodeMinings(method, arguments, constructorBinding.isVarargs()); } } return super.visit(constructorInvocation); }
Source:
private void writeMessageToDisk(EDUCore request) { PutMessageRequestType putMessage = EDUCoreFactory.createPutMessageFromCore(request); try { Marshaller marshaller = jaxbContextdomain.createMarshaller(); ByteArrayOutputStream bos = new ByteArrayOutputStream(); marshaller.marshal(new JAXBElement<>(new QName("uri", "local"), PutMessageRequestType.class, putMessage), bos); try { FileOutputStream fos = new FileOutputStream(new File("failed_messages/" + request.getId() + "_failed.xml")); bos.writeTo(fos); } catch (IOException e) { logger.error("Error writing failed message to disk", e); } } catch (JAXBException e) { logger.error("Failed marshalling message", e); } }

Target:
private void writeMessageToDisk(EDUCore request) { PutMessageRequestType putMessage = EDUCoreFactory.createPutMessageFromCore(request); try { Marshaller marshaller = jaxbContextdomain.createMarshaller(); ByteArrayOutputStream bos = new ByteArrayOutputStream(); marshaller.marshal(new JAXBElement<>(new QName("uri", "local"), PutMessageRequestType.class, putMessage), bos); FileOutputStream fos = new FileOutputStream(new File("failed_messages/" + request.getId() + "_failed.xml")); bos.writeTo(fos); } catch (JAXBException | IOException e) { logger.error("Failed writing message to disk", e); } }
Source:
public void createWithCorrectEvents() throws Exception { final Iterable<String> events = Arrays.asList("event1", "event2"); final int number = 123; final Coordinates coords = new Coordinates.Simple("user/repo"); final Directives xml = this.hookDirs(number, coords).add("events"); events.forEach(e -> xml.add("event").set(e).up()); final MkStorage storage = new MkStorage.InFile(); storage.apply(xml); MatcherAssert.assertThat( "", new MkHook( storage, "", coords, number ).json().getJsonArray("events") .stream() .map(JsonValue::toString) .map(event -> event.replace("\"", "")) .collect(Collectors.toList()), Matchers.containsInAnyOrder("event1", "event2") ); }

Target:
public void createWithCorrectEvents() throws Exception { final Iterable<String> events = Arrays.asList("event1", "event2"); final int number = 123; final Coordinates coords = new Coordinates.Simple("user/repo"); final Directives xml = this.hookDirs(number, coords).add("events"); events.forEach(e -> xml.add("event").set(e).up()); final MkStorage storage = new MkStorage.InFile(); storage.apply(xml); MatcherAssert.assertThat( "", new MkHook( storage, "", coords, number ).json().getJsonArray("events") .stream() .map(JsonValue::toString) .map(event -> event.replace("\"", "")) .collect(Collectors.toList()), new IsIterableContainingInAnyOrder<>( Arrays.asList( new IsEqual<>("event1"), new IsEqual<>("event2") ) ) ); }
Source:
protected void executeQueryCommand() { ArrayList<storage_domains> result = new ArrayList<storage_domains>(); VmTemplate vmTemplate = DbFacade.getInstance().getVmTemplateDAO() .get(getParameters().getId()); if (vmTemplate != null && vmTemplate.getstorage_pool_id() != null) { List<DiskImage> templateDisks = getTemplateDisks(); if (templateDisks.size() > 0) { Set<Guid> domains = new HashSet<Guid>(); for (DiskImage templateDisk : templateDisks) { domains.addAll(templateDisk.getstorage_ids()); } for (Guid domainId : domains) { storage_domains domain = DbFacade.getInstance().getStorageDomainDAO().getForStoragePool(domainId, vmTemplate.getstorage_pool_id().getValue(), getUserID(), getParameters().isFiltered()); if (domain != null) { result.add(domain); } } } } getQueryReturnValue().setReturnValue(result); }

Target:
protected void executeQueryCommand() { ArrayList<storage_domains> result = new ArrayList<storage_domains>(); VmTemplate vmTemplate = DbFacade.getInstance().getVmTemplateDAO() .get(getParameters().getId(), getUserID(), getParameters().isFiltered()); if (vmTemplate != null && vmTemplate.getstorage_pool_id() != null) { List<DiskImage> templateDisks = getTemplateDisks(); if (templateDisks.size() > 0) { Set<Guid> domains = new HashSet<Guid>(); for (DiskImage templateDisk : templateDisks) { domains.addAll(templateDisk.getstorage_ids()); } for (Guid domainId : domains) { storage_domains domain = DbFacade.getInstance().getStorageDomainDAO().getForStoragePool(domainId, vmTemplate.getstorage_pool_id().getValue()); if (domain != null) { result.add(domain); } } } } getQueryReturnValue().setReturnValue(result); }
Source:
public OmemoBundleElement_VAxolotl parse(XmlPullParser parser, int initialDepth) throws Exception { boolean stop = false; boolean inPreKeys = false; int signedPreKeyId = -1; String signedPreKey = null; String signedPreKeySignature = null; String identityKey = null; HashMap<Integer, String> preKeys = new HashMap<>(); while (!stop) { int tag = parser.next(); String name = parser.getName(); switch (tag) { case START_TAG: if (name.equals(SIGNED_PRE_KEY_PUB)) { for (int i = 0; i < parser.getAttributeCount(); i++) { if (parser.getAttributeName(i).equals(SIGNED_PRE_KEY_ID)) { int id = Integer.parseInt(parser.getAttributeValue(i)); signedPreKey = parser.nextText(); signedPreKeyId = id; } } } else if (name.equals(SIGNED_PRE_KEY_SIG)) { signedPreKeySignature = parser.nextText(); } else if (name.equals(IDENTITY_KEY)) { identityKey = parser.nextText(); } else if (name.equals(PRE_KEYS)) { inPreKeys = true; } else if (inPreKeys && name.equals(PRE_KEY_PUB)) { for (int i = 0; i < parser.getAttributeCount(); i++) { if (parser.getAttributeName(i).equals(PRE_KEY_ID)) { preKeys.put(Integer.parseInt(parser.getAttributeValue(i)), parser.nextText()); } } } break; case END_TAG: if (name.equals(BUNDLE)) { stop = true; } break; } } if (preKeys.isEmpty()) { throw new XmlPullParserException("OMEMO Bundle MUST contain at least one prekey."); } return new OmemoBundleElement_VAxolotl(signedPreKeyId, signedPreKey, signedPreKeySignature, identityKey, preKeys); }

Target:
public OmemoBundleElement_VAxolotl parse(XmlPullParser parser, int initialDepth) throws Exception { boolean stop = false; boolean inPreKeys = false; int signedPreKeyId = -1; String signedPreKey = null; String signedPreKeySignature = null; String identityKey = null; HashMap<Integer, String> preKeys = new HashMap<>(); while (!stop) { int tag = parser.next(); String name = parser.getName(); switch (tag) { case START_TAG: if (name.equals(SIGNED_PRE_KEY_PUB)) { for (int i = 0; i < parser.getAttributeCount(); i++) { if (parser.getAttributeName(i).equals(SIGNED_PRE_KEY_ID)) { int id = Integer.parseInt(parser.getAttributeValue(i)); signedPreKey = parser.nextText(); signedPreKeyId = id; } } } else if (name.equals(SIGNED_PRE_KEY_SIG)) { signedPreKeySignature = parser.nextText(); } else if (name.equals(IDENTITY_KEY)) { identityKey = parser.nextText(); } else if (name.equals(PRE_KEYS)) { inPreKeys = true; } else if (inPreKeys && name.equals(PRE_KEY_PUB)) { for (int i = 0; i < parser.getAttributeCount(); i++) { if (parser.getAttributeName(i).equals(PRE_KEY_ID)) { preKeys.put(Integer.parseInt(parser.getAttributeValue(i)), parser.nextText()); } } } break; case END_TAG: if (name.equals(BUNDLE)) { stop = true; } break; } } return new OmemoBundleElement_VAxolotl(signedPreKeyId, signedPreKey, signedPreKeySignature, identityKey, preKeys); }
Source:
public List<Timeline> getTimelines( @Scope(OAuthScope.SLEEP_TIMELINE)final AccessToken accessToken, @PathParam("date") String date) { boolean forceUpdate = false; if (this.hasHmmEnabled(accessToken.accountId)) { forceUpdate = true; } return getTimelinesFromCacheOrReprocess(accessToken.accountId, date,forceUpdate); }

Target:
public List<Timeline> getTimelines( @Scope(OAuthScope.SLEEP_TIMELINE)final AccessToken accessToken, @PathParam("date") String date) { return getTimelinesFromCacheOrReprocess(accessToken.accountId, date); }
Source:
private synchronized StreamObserver<CommandProviderOutbound> getSubscriberObserver() { if (subscriberStreamObserver == null) { logger.info("Create new subscriber"); StreamObserver<CommandProviderInbound> commandsFromRoutingServer = new StreamObserver<CommandProviderInbound>() { @Override public void onNext(CommandProviderInbound commandToSubscriber) { logger.debug("Received from server: {}", commandToSubscriber); switch (commandToSubscriber.getRequestCase()) { case COMMAND: commandQueue.add(commandToSubscriber.getCommand()); break; } } @Override public void onError(Throwable throwable) { logger.warn("Received error from server: {}", throwable.getMessage()); subscriberStreamObserver = null; resubscribe(); } @Override public void onCompleted() { logger.debug("Received completed from server"); subscriberStreamObserver = null; } }; StreamObserver<CommandProviderOutbound> stream = platformConnectionManager.getCommandStream(commandsFromRoutingServer, interceptors); subscriberStreamObserver = new FlowControllingStreamObserver<>(stream, configuration, flowControl -> CommandProviderOutbound.newBuilder().setFlowControl(flowControl).build(), t -> t.getRequestCase().equals(CommandProviderOutbound.RequestCase.COMMANDRESPONSE)).sendInitialPermits(); } return subscriberStreamObserver; }

Target:
private synchronized StreamObserver<CommandProviderOutbound> getSubscriberObserver() { if (subscriberStreamObserver == null) { logger.info("Create new subscriber"); StreamObserver<CommandProviderInbound> commandsFromRoutingServer = new StreamObserver<CommandProviderInbound>() { @Override public void onNext(CommandProviderInbound commandToSubscriber) { logger.debug("Received from server: {}", commandToSubscriber); switch (commandToSubscriber.getRequestCase()) { case COMMAND: commandQueue.add(commandToSubscriber.getCommand()); break; } } @Override public void onError(Throwable ex) { logger.warn("Received error from server: {}", ex.getMessage()); subscriberStreamObserver = null; if (ex instanceof StatusRuntimeException && ((StatusRuntimeException) ex).getStatus().getCode().equals( Status.UNAVAILABLE.getCode())) { return; } resubscribe(); } @Override public void onCompleted() { logger.debug("Received completed from server"); subscriberStreamObserver = null; } }; StreamObserver<CommandProviderOutbound> stream = platformConnectionManager.getCommandStream(commandsFromRoutingServer, interceptors); subscriberStreamObserver = new FlowControllingStreamObserver<>(stream, configuration, flowControl -> CommandProviderOutbound.newBuilder().setFlowControl(flowControl).build(), t -> t.getRequestCase().equals(CommandProviderOutbound.RequestCase.COMMANDRESPONSE)).sendInitialPermits(); } return subscriberStreamObserver; }
Source:
public void testDateFormatTransform() throws Exception { SimpleFeature f = transform(new DateFormatTransform("date", null, null, null), "date", String.class, "1980-09-10" ); GregorianCalendar cal = new GregorianCalendar(TimeZone.getTimeZone("UTC")); cal.setTime((Date) f.getAttribute("date")); assertEquals(1980, cal.get(GregorianCalendar.YEAR)); assertEquals(9, cal.get(GregorianCalendar.MONTH) + 1); assertEquals(10, cal.get(GregorianCalendar.DAY_OF_MONTH)); }

Target:
public void testDateFormatTransform() throws Exception { SimpleFeature f = transform(new DateFormatTransform("date", null), "date", String.class, "1980-09-10" ); GregorianCalendar cal = new GregorianCalendar(TimeZone.getTimeZone("UTC")); cal.setTime((Date) f.getAttribute("date")); assertEquals(1980, cal.get(GregorianCalendar.YEAR)); assertEquals(9, cal.get(GregorianCalendar.MONTH) + 1); assertEquals(10, cal.get(GregorianCalendar.DAY_OF_MONTH)); }
Source:
public void openFolderOnGitHubTest() { projectExplorer.waitAndSelectItem(PROJECT_NAME + PATH_TO_EXPAND); projectExplorer.openContextMenuByPathSelectedItem(PROJECT_NAME + PATH_TO_EXPAND); projectExplorer.waitContextMenu(); projectExplorer.clickOnItemInContextMenu( TestProjectExplorerContextMenuConstants.ContextMenuFirstLevelItems.OPEN_ON_GITHUB); seleniumWebDriverHelper.switchToNextWindow(seleniumWebDriver.getWindowHandle()); Assert.assertEquals( seleniumWebDriver.getCurrentUrl(), testRepo.getHtmlUrl() + "/tree/master" + PATH_TO_EXPAND); }

Target:
public void openFolderOnGitHubTest() { projectExplorer.waitAndSelectItem(PROJECT_NAME + "/" + PATH_TO_EXPAND, 5); projectExplorer.waitAndSelectItem(PROJECT_NAME + "/" + PATH_TO_EXPAND, 5); projectExplorer.openContextMenuByPathSelectedItem(PROJECT_NAME + "/" + PATH_TO_EXPAND); projectExplorer.waitContextMenu(); projectExplorer.clickOnItemInContextMenu( TestProjectExplorerContextMenuConstants.ContextMenuFirstLevelItems.OPEN_ON_GITHUB); seleniumWebDriverHelper.switchToNextWindow(seleniumWebDriver.getWindowHandle()); seleniumWebDriverHelper.waitSuccessCondition( urlToBe(testRepo.getHtmlUrl() + "/tree/master/" + PATH_TO_EXPAND)); }
Source:
public boolean equals(Object aThat){ if(this == aThat) return true; if(!(aThat instanceof NamespaceIdentifier)) return false; NamespaceIdentifier that = (NamespaceIdentifier)aThat; List<String> thisName = this.getName(); List<String> thatName = that.getName(); if(thisName.size() != thatName.size()) return false; for(int i = 0; i < thisName.size(); ++i){ String nThis = thisName.get(i); String nThat = thatName.get(i); if(!nThis.equals(nThat)) return false; } return true; }

Target:
public boolean equals(Object aThat){ if(this == aThat) return true; if(!(aThat instanceof NamespaceIdentifier)) return false; NamespaceIdentifier that = (NamespaceIdentifier)aThat; return this.getName().equals(that.getName()); }
Source:
public StreamsAddressRequest(Byte reqType) { this.reqType = reqType; this.streamsRanges = Collections.EMPTY_LIST; this.beforeCompactionMark = false; }

Target:
public StreamsAddressRequest(Byte reqType) { this.reqType = reqType; this.streamsRanges = Collections.emptyList(); this.forSequencerTrim = false; }
Source:
public ResourceTraversal[] getTraversals(ResourceMapping[] mappings, ResourceMappingContext context, IProgressMonitor monitor) throws CoreException { try { SubMonitor subMonitor = SubMonitor.convert(monitor, mappings.length); List<ResourceTraversal> traversals = new ArrayList<>(); for (int i = 0; i < mappings.length; i++) { ResourceMapping mapping = mappings[i]; Collections.addAll(traversals, mapping.getTraversals(context, subMonitor.newChild(1))); } return traversals.toArray(new ResourceTraversal[traversals.size()]); } finally { monitor.done(); } }

Target:
public ResourceTraversal[] getTraversals(ResourceMapping[] mappings, ResourceMappingContext context, IProgressMonitor monitor) throws CoreException { SubMonitor subMonitor = SubMonitor.convert(monitor, mappings.length); List<ResourceTraversal> traversals = new ArrayList<>(); for (int i = 0; i < mappings.length; i++) { ResourceMapping mapping = mappings[i]; Collections.addAll(traversals, mapping.getTraversals(context, subMonitor.newChild(1))); } return traversals.toArray(new ResourceTraversal[traversals.size()]); }
Source:
private SelectionAdapter onFileSystemBrowseClicked() { return new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { FileDialog dialog = createFileDialog(model.getSource()); String file = dialog.open(); setLocalSourceFileName(file); } private FileDialog createFileDialog(String selectedFile) { FileDialog dialog = new FileDialog(getShell(), SWT.OPEN); dialog.setText("Select an OpenShift resource"); if(isFile(selectedFile)) { File file = new File(selectedFile); dialog.setFilterPath(file.getParentFile().getAbsolutePath()); } return dialog; } }; }

Target:
private SelectionAdapter onFileSystemBrowseClicked() { return new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { FileDialog dialog = createFileDialog(model.getSource()); String file = dialog.open(); setLocalSourceFileName(file); } private FileDialog createFileDialog(String selectedFile) { FileDialog dialog = new FileDialog(getShell(), SWT.OPEN); dialog.setText("Select an OpenShift resource"); dialog.setFilterExtensions(new String[] {"*.json"}); if(exists(selectedFile)) { File file = new File(selectedFile); if (file.isFile()) { file = file.getParentFile(); } dialog.setFilterPath(file.getAbsolutePath()); } return dialog; } }; }
Source:
public OrderedPartitionableRecord<Integer, Long> poll(long timeout) { ConsumerRecords<byte[], byte[]> polledRecords = consumer.poll(timeout); if (!polledRecords.isEmpty()) { ConsumerRecord<byte[], byte[]> record = polledRecords.iterator().next(); return new OrderedPartitionableRecord<>( record.topic(), record.partition(), record.offset(), record.value() == null ? null : ImmutableList.of(record.value()) ); } return null; }

Target:
public List<OrderedPartitionableRecord<Integer, Long>> poll(long timeout) { List<OrderedPartitionableRecord<Integer, Long>> polledRecords = new ArrayList<>(); for (ConsumerRecord<byte[], byte[]> record : consumer.poll(timeout)) { polledRecords.add(new OrderedPartitionableRecord<>( record.topic(), record.partition(), record.offset(), record.value() == null ? null : ImmutableList.of(record.value()) )); } return polledRecords; }
Source:
public void parseParallelPipelineOutput() throws IOException { Collection<FileAnnotation> warnings = parse("javac-parallel-pipeline.txt"); assertEquals(WRONG_NUMBER_OF_WARNINGS_DETECTED, 2, warnings.size()); }

Target:
public void parseParallelPipelineOutput() throws IOException { Collection<FileAnnotation> warnings = parse("javac-parallel-pipeline.txt"); assertEquals(WRONG_NUMBER_OF_WARNINGS_DETECTED, 2, warnings.size()); String fileName = "C:/Build/Results/jobs/ADT-Base/workspace/com.avaloq.adt.ui/src/main/java/com/avaloq/adt/ui/elements/AvaloqDialog.java"; Iterator<Warning> expectedWarnings = Arrays.asList( new Warning(fileName, 12, WARNING_TYPE, "Deprecation", "org.eclipse.jface.contentassist.SubjectControlContentAssistant in org.eclipse.jface.contentassist has been deprecated"), new Warning(fileName, 40, WARNING_TYPE, "Deprecation", "org.eclipse.ui.contentassist.ContentAssistHandler in org.eclipse.ui.contentassist has been deprecated") ).iterator(); Iterator<FileAnnotation> iterator = warnings.iterator(); while (iterator.hasNext()) { assertTrue(WRONG_NUMBER_OF_WARNINGS_DETECTED, expectedWarnings.hasNext()); Warning expectedWarning = expectedWarnings.next(); checkWarning(iterator.next(), expectedWarning.getPrimaryLineNumber(), expectedWarning.getMessage(), expectedWarning.getFileName(), expectedWarning.getType(), expectedWarning.getCategory(), expectedWarning.getPriority()); } }
Source:
public Map<StreamId, OrcInputStream> readDiskRanges(StripeId stripeId, Map<StreamId, DiskRange> diskRanges, AggregatedMemoryContext systemMemoryUsage) throws IOException { ImmutableMap.Builder<StreamId, DiskRange> diskRangesBuilder = ImmutableMap.builder(); for (Entry<StreamId, DiskRange> entry : diskRanges.entrySet()) { DiskRange diskRange = entry.getValue(); diskRangesBuilder.put(entry.getKey(), new DiskRange(stripeId.getOffset() + diskRange.getOffset(), diskRange.getLength())); } diskRanges = diskRangesBuilder.build(); Map<StreamId, OrcDataSourceInput> streamsData = orcDataSource.readFully(diskRanges); ImmutableMap.Builder<StreamId, OrcInputStream> streamsBuilder = ImmutableMap.builder(); for (Entry<StreamId, OrcDataSourceInput> entry : streamsData.entrySet()) { FixedLengthSliceInput input; if (entry.getKey().getStreamKind() == BLOOM_FILTER || entry.getKey().getStreamKind() == ROW_INDEX) { input = new BasicSliceInput(stripeMetadataSource.getStreamSlice(new StripeStreamId(stripeId, entry.getKey()), entry.getValue())); } else { input = entry.getValue().getInput(); } streamsBuilder.put(entry.getKey(), new OrcInputStream(orcDataSource.getId(), input, decompressor, systemMemoryUsage, input.getRetainedSize())); } return streamsBuilder.build(); }

Target:
private Map<StreamId, OrcInputStream> readDiskRanges(StripeId stripeId, Map<StreamId, DiskRange> diskRanges, AggregatedMemoryContext systemMemoryUsage) throws IOException { Map<StreamId, OrcDataSourceInput> streamsData = stripeMetadataSource.getInputs(orcDataSource, stripeId, diskRanges); ImmutableMap.Builder<StreamId, OrcInputStream> streamsBuilder = ImmutableMap.builder(); for (Entry<StreamId, OrcDataSourceInput> entry : streamsData.entrySet()) { OrcDataSourceInput sourceInput = entry.getValue(); streamsBuilder.put(entry.getKey(), new OrcInputStream(orcDataSource.getId(), sourceInput.getInput(), decompressor, systemMemoryUsage, sourceInput.getRetainedSizeInBytes())); } return streamsBuilder.build(); }
Source:
public void canReadNextIfNotProgressedBeyondForThorough() { progress.updateLastSweptTimestamp(thorough(shardCons), TS2); progress.updateLastSweptTimestamp(conservative(shardThor), TS2); progress.updateLastSweptTimestamp(thorough(shardThor), TS2 - 1); progress.updateLastSweptTimestamp(conservative(shardCons), TS2); assertThat(readThorough(shardThor)).contains(TS2_FINE_PARTITION); }

Target:
public void canReadNextIfNotProgressedBeyondForThorough() { progress.updateLastSweptTimestamp(thorough(shardThor), TS2 - 1); assertThat(readThorough(shardThor)).contains(TS2_FINE_PARTITION); }
Source:
private List<String> getOutputFolder() throws ValueStorageException { String outputDir; try { outputDir = extensionService.getOutputDir(prefixURI(wsPath)); } catch (Exception e) { throw new ValueStorageException( format("Failed to get '%s'. ", OUTPUT_FOLDER), e.getCause()); } String fsPath = transformer.transform(wsPath).toString(); return outputDir.startsWith(fsPath) ? singletonList(outputDir.substring(fsPath.length() + 1)) : singletonList(outputDir); }

Target:
private List<String> getOutputFolder() throws ValueStorageException { String outputDir; try { outputDir = extensionService.getOutputDir(wsPath); } catch (Exception e) { throw new ValueStorageException( format("Failed to get '%s'. ", OUTPUT_FOLDER), e.getCause()); } String fsPath = transformer.transform(wsPath).toString(); return outputDir.startsWith(fsPath) ? singletonList(outputDir.substring(fsPath.length() + 1)) : singletonList(outputDir); }
Source:
public boolean verifyEvidence(Evidence evidence) throws RealmUnavailableException { if (!isBearerTokenEvidence(evidence.getClass())) { return false; } BearerTokenEvidence tokenEvidence = BearerTokenEvidence.class.cast(evidence); try { return strategy.validate(tokenEvidence) != null; } catch (RealmUnavailableException rue) { throw rue; } catch (Exception unknown) { ElytronMessages.log.debugf(unknown, "Failed to verify token evidence [%s]", tokenEvidence.getToken()); } return false; }

Target:
public boolean verifyEvidence(Evidence evidence) throws RealmUnavailableException { return validateToken(evidence) != null; }
Source:
public List<ITestResult> call() { List<ITestResult> tmpResults = Lists.newArrayList(); long start = System.currentTimeMillis(); XmlSuite suite = m_testContext.getSuite().getXmlSuite(); final Invoker.FailureContext failure = new Invoker.FailureContext(); failure.count = m_failureCount; try { tmpResults.add( m_invoker.invokeTestMethod( m_instance, m_testMethod, m_parameterValues, m_parameterIndex, suite, m_parameters, m_testClass, m_beforeMethods, m_afterMethods, m_groupMethods, failure)); } finally { m_failureCount = failure.count; if (failure.instances.isEmpty()) { m_testResults.addAll(tmpResults); } else { for (Object instance : failure.instances) { List<ITestResult> retryResults = Lists.newArrayList(); m_failureCount = m_invoker.retryFailed( instance, m_testMethod, m_parameterValues, m_testClass, m_beforeMethods, m_afterMethods, m_groupMethods, retryResults, m_failureCount, m_testContext, m_parameters, m_parameterIndex) .count; m_testResults.addAll(retryResults); } } if (!m_skipFailedInvocationCounts) { m_skipFailedInvocationCounts = m_testMethod.skipFailedInvocations(); } if (m_failureCount > 0 && m_skipFailedInvocationCounts) { while (m_invocationCount-- > 0) { ITestResult r = TestResult.newEndTimeAwareTestResult(m_testMethod, null, start, m_testContext); r.setStatus(TestResult.SKIP); m_testResults.add(r); m_invoker.runTestListeners(r); m_notifier.addSkippedTest(m_testMethod, r); } } } m_parameterIndex++; return m_testResults; }

Target:
public List<ITestResult> call() { List<ITestResult> tmpResults = Lists.newArrayList(); long start = System.currentTimeMillis(); XmlSuite suite = m_testContext.getSuite().getXmlSuite(); final Invoker.FailureContext failure = new Invoker.FailureContext(); failure.count = m_failureCount; try { tmpResults.add( m_invoker.invokeTestMethod( m_instance, m_testMethod, m_parameterValues, m_parameterIndex, suite, m_parameters, m_testClass, m_beforeMethods, m_afterMethods, m_groupMethods, failure)); } finally { m_failureCount = failure.count; if (failure.instances.isEmpty()) { m_testResults.addAll(tmpResults); } else { for (Object instance : failure.instances) { List<ITestResult> retryResults = Lists.newArrayList(); m_failureCount = m_invoker.retryFailed( instance, m_testMethod, m_parameterValues, m_testClass, m_beforeMethods, m_afterMethods, m_groupMethods, retryResults, m_failureCount, m_testContext, m_parameters, m_parameterIndex) .count; m_testResults.addAll(retryResults); } } if (!m_skipFailedInvocationCounts) { m_skipFailedInvocationCounts = m_testMethod.skipFailedInvocations(); } if (m_failureCount > 0 && m_skipFailedInvocationCounts) { while (m_invocationCount-- > 0) { ITestResult r = TestResult.newEndTimeAwareTestResult(m_testMethod, m_testContext, null, start); r.setStatus(TestResult.SKIP); m_testResults.add(r); m_invoker.runTestResultListener(r); m_notifier.addSkippedTest(m_testMethod, r); } } } m_parameterIndex++; return m_testResults; }
Source:
public void setup() { EntityDictionary dictionary = new EntityDictionary(new HashMap<>()); dictionary.bindEntity(NoopBean.class); requestScope = mock(RequestScope.class); JsonApiMapper mapper = mock(JsonApiMapper.class); when(requestScope.getDictionary()).thenReturn(dictionary); when(requestScope.getObjectEntityCache()).thenReturn(new ObjectEntityCache()); when(requestScope.getObjectEntityCache()).thenReturn(new ObjectEntityCache()); when(requestScope.getMapper()).thenReturn(mapper); when(mapper.getObjectMapper()).thenReturn(new ObjectMapper()); }

Target:
public void setup() { EntityDictionary dictionary = new EntityDictionary(new HashMap<>()); dictionary.bindEntity(NoopBean.class); requestScope = mock(RequestScope.class); JsonApiMapper mapper = mock(JsonApiMapper.class); when(requestScope.getDictionary()).thenReturn(dictionary); when(requestScope.getObjectEntityCache()).thenReturn(new ObjectEntityCache()); when(requestScope.getMapper()).thenReturn(mapper); when(mapper.getObjectMapper()).thenReturn(new ObjectMapper()); }
Source:
public Response renameSecret(@Auth User user, @PathParam("secretId") LongParam secretId, @PathParam("secretName") String secretName) { Optional<Secret> secret = secretController.getSecretByName(secretName); if (secret.isPresent()) { logger.info("User '{}' tried renaming a secret, but another secret with that name " + "already exists (name={})", user, secretId.get()); throw new NotAllowedException("That name is already taken by another secret"); } logger.info("User '{}' renamed secret id={} to name='{}'", user, secretId, secretName); secretDAOReadWrite.renameSecretById(secretId.get(), secretName); Map<String, String> extraInfo = new HashMap<>(); auditLog.recordEvent( new Event(Instant.now(), EventTag.SECRET_RENAME, user.getName(), secretName, extraInfo)); return Response.noContent().build(); }

Target:
public Response renameSecret(@Auth User user, @PathParam("secretId") LongParam secretId, @PathParam("secretName") String secretName) { Optional<Secret> secret = secretController.getSecretByName(secretName); if (secret.isPresent()) { logger.info("User '{}' tried renaming a secret, but another secret with that name " + "already exists (name={})", user, secretId.get()); throw new ConflictException("That name is already taken by another secret"); } logger.info("User '{}' renamed secret id={} to name='{}'", user, secretId, secretName); secretDAOReadWrite.renameSecretById(secretId.get(), secretName, user.getName()); Map<String, String> extraInfo = new HashMap<>(); auditLog.recordEvent( new Event(Instant.now(), EventTag.SECRET_RENAME, user.getName(), secretName, extraInfo)); return Response.noContent().build(); }
Source:
public void check(@Nullable GoSignature o, @NotNull ProblemsHolder holder) { super.check(o, holder); if (o == null) return; Set<String> names = getParamNames(o); GoResult result = o.getResult(); if (result == null) return; GoParameters parameters = result.getParameters(); if (parameters == null) return; checkParameters(holder, parameters, names); }

Target:
public void check(@Nullable GoSignature o, @NotNull ProblemsHolder holder) { if (o == null) return; Set<String> names = getParamNames(o); GoResult result = o.getResult(); if (result == null) return; GoParameters parameters = result.getParameters(); if (parameters == null) return; checkParameters(holder, parameters, names); }
Source:
protected void closeFile(InputStream is) throws IOException { String fileName = super.currentFile; super.closeFile(is); if (avroDataStream != null) { avroDataStream.close(); } if (completedFilesPort.isConnected()) { completedFilesPort.emit(fileName); } offset = 0; }

Target:
protected void closeFile(InputStream is) throws IOException { String fileName = super.currentFile; if (avroDataStream != null) { avroDataStream.close(); } super.closeFile(is); if (completedFilesPort.isConnected()) { completedFilesPort.emit(fileName); } offset = 0; }
Source:
public String titleFor(Content content) { if (!(content instanceof Episode) || content.getTitle() == null) { return content.getTitle(); } Episode episode = (Episode) content; String episodeTitle = episode.getTitle(); if (episodeTitle == null || episode.getEpisodeNumber() == null || DATE_PATTERN.matcher(episodeTitle).find(0) || EPISODE_NUMBER_PATTERN.matcher(episodeTitle).matches()) { return episodeTitle; } else { return String.format("%d. %s", episode.getEpisodeNumber(), episodeTitle); } }

Target:
public String titleFor(Content content) { if (!(content instanceof Episode) || content.getTitle() == null) { return content.getTitle(); } Episode episode = (Episode) content; String episodeTitle = episode.getTitle(); if (episodeTitle == null || episode.getEpisodeNumber() == null || DATE_PATTERN.matcher(episodeTitle).find(START_OF_STRING) || EPISODE_NUMBER_PATTERN.matcher(episodeTitle).find(START_OF_STRING)) { return episodeTitle; } else { return String.format("%d. %s", episode.getEpisodeNumber(), episodeTitle); } }
Source:
public void testTraceIdGeneration() throws Exception { assertThat(Tracers.longToPaddedHex(0)).isEqualTo("0000000000000000"); assertThat(Tracers.longToPaddedHex(42)).isEqualTo("000000000000002a"); assertThat(Tracers.longToPaddedHex(-42)).isEqualTo("ffffffffffffffd6"); assertThat(Tracers.longToPaddedHex(123456789L)).isEqualTo("00000000075bcd15"); }

Target:
public void testTraceIdGeneration() throws Exception { assertThat(Tracers.randomId()).hasSize(16); assertThat(Tracers.longToPaddedHex(0)).isEqualTo("0000000000000000"); assertThat(Tracers.longToPaddedHex(42)).isEqualTo("000000000000002a"); assertThat(Tracers.longToPaddedHex(-42)).isEqualTo("ffffffffffffffd6"); assertThat(Tracers.longToPaddedHex(123456789L)).isEqualTo("00000000075bcd15"); }
Source:
public void execute(final ExecutionStack stack, final IDelegateBridge bridge) { if (!intercept) { return; } final IExecutable roll = new IExecutable() { private static final long serialVersionUID = 6579019987019614374L; @Override public void execute(final ExecutionStack stack, final IDelegateBridge bridge) { dice = DiceRoll.airBattle(attackingUnits, false, attacker, bridge, "Attackers Fire, "); } }; final IExecutable calculateCasualties = new IExecutable() { private static final long serialVersionUID = 4556409970663527142L; @Override public void execute(final ExecutionStack stack, final IDelegateBridge bridge) { details = CasualtySelector.selectCasualties( defender, defendingUnits, defendingUnits, attackingUnits, false, battleSite, null, bridge, ATTACKERS_FIRE, dice, true, battleId, false, dice.getHits(), true); defendingWaitingToDie.addAll(details.getKilled()); markDamaged(details.getDamaged(), bridge); } }; final IExecutable notifyCasualties = new IExecutable() { private static final long serialVersionUID = 4224354422817922451L; @Override public void execute(final ExecutionStack stack, final IDelegateBridge bridge) { notifyCasualties(battleId, bridge, ATTACKERS_FIRE, dice, defender, attacker, details); } }; stack.push(notifyCasualties); stack.push(calculateCasualties); stack.push(roll); }

Target:
public void execute(final ExecutionStack stack, final IDelegateBridge bridge) { if (!intercept) { return; } final IExecutable roll = new IExecutable() { private static final long serialVersionUID = 6579019987019614374L; @Override public void execute(final ExecutionStack stack, final IDelegateBridge bridge) { dice = DiceRoll.airBattle(attackingUnits, false, attacker, bridge, "Attackers Fire, "); } }; final IExecutable calculateCasualties = new IExecutable() { private static final long serialVersionUID = 4556409970663527142L; @Override public void execute(final ExecutionStack stack, final IDelegateBridge bridge) { details = CasualtySelector.selectCasualties( defender, defendingUnits, defendingUnits, attackingUnits, battleSite, null, bridge, ATTACKERS_FIRE, dice, true, battleId, false, dice.getHits(), true); defendingWaitingToDie.addAll(details.getKilled()); markDamaged(details.getDamaged(), bridge); } }; final IExecutable notifyCasualties = new IExecutable() { private static final long serialVersionUID = 4224354422817922451L; @Override public void execute(final ExecutionStack stack, final IDelegateBridge bridge) { notifyCasualties(battleId, bridge, ATTACKERS_FIRE, dice, defender, attacker, details); } }; stack.push(notifyCasualties); stack.push(calculateCasualties); stack.push(roll); }
Source:
public void testParseOnDemandWithoutRegionEncodedIntoId() { Supplier<Set<? extends Location>> locations = Suppliers.<Set<? extends Location>> ofInstance(ImmutableSet .<Location> of(region)); Supplier<Set<? extends Image>> images = Suppliers.<Set<? extends Image>> ofInstance(ImmutableSet.<Image> of()); Supplier<Set<? extends Hardware>> sizes = Suppliers.<Set<? extends Hardware>> ofInstance(ImmutableSet .<Hardware> of(c1_medium().build())); Provider<TemplateOptions> optionsProvider = createMock(Provider.class); Provider<TemplateBuilder> templateBuilderProvider = createMock(Provider.class); TemplateOptions defaultOptions = createMock(TemplateOptions.class); Image knownImage = createMock(Image.class); GetImageStrategy getImageStrategy = createMock(GetImageStrategy.class); expect(knownImage.getId()).andReturn("region/ami").anyTimes(); expect(knownImage.getProviderId()).andReturn("ami").anyTimes(); expect(knownImage.getLocation()).andReturn(region).anyTimes(); expect(optionsProvider.get()).andReturn(defaultOptions); replay(knownImage); replay(defaultOptions); replay(optionsProvider); replay(templateBuilderProvider); replay(getImageStrategy); TemplateBuilderImpl template = createTemplateBuilder(knownImage, locations, images, sizes, region, optionsProvider, templateBuilderProvider, getImageStrategy); try { template.imageId("ami").build(); fail("Expected IllegalArgumentException"); } catch (IllegalArgumentException e) { } verify(knownImage); verify(defaultOptions); verify(optionsProvider); verify(templateBuilderProvider); verify(getImageStrategy); }

Target:
public void testParseOnDemandWithoutRegionEncodedIntoId() { Supplier<Set<? extends Location>> locations = Suppliers.<Set<? extends Location>> ofInstance(ImmutableSet .<Location> of(region)); Supplier<Set<? extends Image>> images = Suppliers.<Set<? extends Image>> ofInstance(ImmutableSet.<Image> of()); Supplier<Set<? extends Hardware>> sizes = Suppliers.<Set<? extends Hardware>> ofInstance(ImmutableSet .<Hardware> of(c1_medium().build())); Provider<TemplateOptions> optionsProvider = createMock(Provider.class); Provider<TemplateBuilder> templateBuilderProvider = createMock(Provider.class); TemplateOptions defaultOptions = createMock(TemplateOptions.class); Image knownImage = createMock(Image.class); GetImageStrategy getImageStrategy = createMock(GetImageStrategy.class); expect(knownImage.getId()).andReturn("region/ami").anyTimes(); expect(knownImage.getProviderId()).andReturn("ami").anyTimes(); expect(knownImage.getLocation()).andReturn(region).anyTimes(); expect(optionsProvider.get()).andReturn(defaultOptions); replay(knownImage, defaultOptions, optionsProvider, templateBuilderProvider, getImageStrategy); TemplateBuilderImpl template = createTemplateBuilder(knownImage, locations, images, sizes, region, optionsProvider, templateBuilderProvider, getImageStrategy); try { template.imageId("ami").build(); fail("Expected IllegalArgumentException"); } catch (IllegalArgumentException e) { } verify(knownImage, defaultOptions, optionsProvider, templateBuilderProvider, getImageStrategy); }
Source:
private void updateStyleToMatchStatus(TurboIssue issue){ if (!issue.isOpen()){ if (!getStyleClass().contains("issue-cell-closed")) { getStyleClass().add("issue-cell-closed"); } } else { if (getStyleClass().contains("issue-cell-closed")) { getStyleClass().remove("issue-cell-closed"); } } }

Target:
private void updateStyleToMatchStatus(TurboIssue issue){ final String closedStyle = "issue-cell-closed"; boolean isCurrentStyleClosed = getStyleClass().contains(closedStyle); if (!issue.isOpen()){ if (!isCurrentStyleClosed) { getStyleClass().add(closedStyle); } } else { if (isCurrentStyleClosed) { getStyleClass().remove(closedStyle); } } }
Source:
String toDisplayValue(final String dmnValue) { final YearsMonthsValue yearsMonthsValue = fromDMNString(dmnValue); return toDisplayValue(yearsMonthsValue); }

Target:
public String toDisplayValue(final String dmnValue) { final YearsMonthsValue yearsMonthsValue = fromDMNString(dmnValue); return toDisplayValue(yearsMonthsValue); }
Source:
public Response healthCheck() { SortedMap<String, HealthCheck.Result> results = environment.healthChecks().runHealthChecks(); Map<String, Map<String, Object>> response = results.entrySet() .stream() .collect(Collectors.toMap(Map.Entry::getKey, healthCheck -> ImmutableMap.of( "healthy", healthCheck.getValue().isHealthy(), "message", defaultString(healthCheck.getValue().getMessage(), "Healthy")) ) ); boolean allHealthy = results.values().stream().allMatch(HealthCheck.Result::isHealthy); Response.ResponseBuilder res = allHealthy ? Response.ok() : status(503); return res.entity(response).build(); }

Target:
public Response healthCheck() { SortedMap<String, HealthCheck.Result> results = environment.healthChecks().runHealthChecks(); Map<String, Map<String, Object>> response = results.entrySet() .stream() .collect(Collectors.toMap(Map.Entry::getKey, healthCheck -> ImmutableMap.of( "healthy", healthCheck.getValue().isHealthy(), "message", defaultString(healthCheck.getValue().getMessage(), "Healthy")) ) ); Response.ResponseBuilder res = allHealthy(results.values()) ? Response.ok() : status(503); return res.entity(response).build(); }