auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private JSONObject buildExtensionJobDetailResult(final String jobName) throws FalconException { ExtensionMetaStore metaStore = ExtensionStore.getMetaStore(); ExtensionJobsBean jobsBean = metaStore.getExtensionJobDetails(jobName); if (jobsBean == null) { throw new ValidationException("Job name not found:" + jobName); } ExtensionBean extensionBean = metaStore.getDetail(jobsBean.getExtensionName()); JSONObject detailsObject = new JSONObject(); try { detailsObject.put(JOB_NAME, jobsBean.getJobName()); detailsObject.put(EXTENSION_NAME, jobsBean.getExtensionName()); JSONObject feedsObject = new JSONObject(); for (String feed : jobsBean.getFeeds()) { try { EntityUtil.getEntity(EntityType.FEED, feed); } catch (EntityNotRegisteredException e) { feedsObject.put(feed, ENTITY_NOT_EXISTS_STATUS); } feedsObject.put(feed, ENTITY_EXISTS_STATUS); } detailsObject.put(FEEDS, feedsObject); JSONObject processObject = new JSONObject(); for (String process : jobsBean.getProcesses()) { try { EntityUtil.getEntity(EntityType.PROCESS, process); } catch (EntityNotRegisteredException e) { processObject.put(process, ENTITY_NOT_EXISTS_STATUS); } processObject.put(process, ENTITY_EXISTS_STATUS); } detailsObject.put(PROCESSES, processObject); detailsObject.put(CONFIG, jobsBean.getConfig()); detailsObject.put(CREATION_TIME, jobsBean.getCreationTime()); detailsObject.put(LAST_UPDATE_TIME, jobsBean.getLastUpdatedTime()); detailsObject.put(EXTENSION_LOCATION, extensionBean.getLocation()); detailsObject.put(EXTENSION_TYPE, extensionBean.getExtensionType()); } catch (JSONException e) { LOG.error("Exception while building extension jon details for job {}", jobName, e); } return detailsObject; }

Target:
private JSONObject buildExtensionJobDetailResult(final String jobName) throws FalconException { ExtensionMetaStore metaStore = ExtensionStore.getMetaStore(); ExtensionJobsBean jobsBean = metaStore.getExtensionJobDetails(jobName); if (jobsBean == null) { throw new ValidationException("Job name not found:" + jobName); } ExtensionBean extensionBean = metaStore.getDetail(jobsBean.getExtensionName()); JSONObject detailsObject = new JSONObject(); try { detailsObject.put(JOB_NAME, jobsBean.getJobName()); detailsObject.put(EXTENSION_NAME, jobsBean.getExtensionName()); detailsObject.put(FEEDS, getEntitiesStatus(jobsBean.getFeeds(), EntityType.FEED)); detailsObject.put(PROCESSES, getEntitiesStatus(jobsBean.getProcesses(), EntityType.PROCESS)); detailsObject.put(CONFIG, jobsBean.getConfig()); detailsObject.put(CREATION_TIME, jobsBean.getCreationTime()); detailsObject.put(LAST_UPDATE_TIME, jobsBean.getLastUpdatedTime()); detailsObject.put(EXTENSION_LOCATION, extensionBean.getLocation()); detailsObject.put(EXTENSION_TYPE, extensionBean.getExtensionType()); } catch (JSONException e) { LOG.error("Exception while building extension jon details for job {}", jobName, e); } return detailsObject; }
Source:
public void loadTSnePlots(String experimentAccession) { DataFileHub.SingleCellExperimentFiles files = dataFileHub.getSingleCellExperimentFiles(experimentAccession); try (TSnePlotStreamer tSnePlotStreamer = new TSnePlotStreamer(files.tSnePlotTsvs)) { tSnePlotStreamer.availablePerplexities() .forEach(p -> tSnePlotDao.loadTSnePlot(experimentAccession, p, tSnePlotStreamer.stream(p))); } }

Target:
private void loadTSnePlots(String experimentAccession) { DataFileHub.SingleCellExperimentFiles files = dataFileHub.getSingleCellExperimentFiles(experimentAccession); try (TSnePlotStreamer tSnePlotStreamer = new TSnePlotStreamer(files.tSnePlotTsvs)) { tSnePlotStreamer.availablePerplexities() .forEach(p -> tSnePlotDao.loadTSnePlot(experimentAccession, p, tSnePlotStreamer.stream(p))); } }
Source:
public void createAssertionWithExplicitProvider_correct() throws IOException { PrivateKey privateKey = ServiceAccountCredentials.privateKeyFromPkcs8(PRIVATE_KEY_PKCS8); List<String> scopes = Arrays.asList("scope1", "scope2"); ServiceAccountCredentials credentials = ServiceAccountCredentials.newBuilder() .setClientId(CLIENT_ID) .setClientEmail(CLIENT_EMAIL) .setPrivateKey(privateKey) .setPrivateKeyId(PRIVATE_KEY_ID) .setScopes(scopes) .setServiceAccountUser(USER) .setProjectId(PROJECT_ID) .setSignatureProvider(defaultRsaSignatureProvider) .build(); JsonFactory jsonFactory = OAuth2Utils.JSON_FACTORY; long currentTimeMillis = Clock.SYSTEM.currentTimeMillis(); String assertion = credentials.createAssertion(jsonFactory, currentTimeMillis, null); JsonWebSignature signature = JsonWebSignature.parse(jsonFactory, assertion); JsonWebToken.Payload payload = signature.getPayload(); assertEquals(CLIENT_EMAIL, payload.getIssuer()); assertEquals(OAuth2Utils.TOKEN_SERVER_URI.toString(), payload.getAudience()); assertEquals(currentTimeMillis / 1000, (long) payload.getIssuedAtTimeSeconds()); assertEquals(currentTimeMillis / 1000 + 3600, (long) payload.getExpirationTimeSeconds()); assertEquals(USER, payload.getSubject()); assertEquals(Joiner.on(' ').join(scopes), payload.get("scope")); }

Target:
public void createAssertionWithExplicitProvider_correct() throws IOException { PrivateKey privateKey = ServiceAccountCredentials.privateKeyFromPkcs8(PRIVATE_KEY_PKCS8); List<String> scopes = Arrays.asList("scope1", "scope2"); ServiceAccountCredentials credentials = ServiceAccountCredentials.newBuilder() .setClientId(CLIENT_ID) .setClientEmail(CLIENT_EMAIL) .setPrivateKey(privateKey) .setPrivateKeyId(PRIVATE_KEY_ID) .setScopes(scopes) .setServiceAccountUser(USER) .setProjectId(PROJECT_ID) .setSignatureProvider(defaultRsaSignatureProvider) .build(); long currentTimeMillis = FixedClock.SYSTEM.currentTimeMillis(); String assertion = credentials.createAssertion(OAuth2Utils.JSON_FACTORY, currentTimeMillis, null); JsonWebSignature signature = JsonWebSignature.parse(OAuth2Utils.JSON_FACTORY, assertion); JsonWebToken.Payload payload = signature.getPayload(); assertEquals(CLIENT_EMAIL, payload.getIssuer()); assertEquals(OAuth2Utils.TOKEN_SERVER_URI.toString(), payload.getAudience()); assertEquals(currentTimeMillis / 1000, (long) payload.getIssuedAtTimeSeconds()); assertEquals(currentTimeMillis / 1000 + 3600, (long) payload.getExpirationTimeSeconds()); assertEquals(USER, payload.getSubject()); assertEquals(Joiner.on(' ').join(scopes), payload.get("scope")); }
Source:
private static Command getTargetReconnectionCommand(ISequenceEventEditPart parent, Range parentRange, SequenceMessageEditPart msg) { CompoundCommand result = new CompoundCommand(); Range currentRange = msg.getISequenceEvent().getVerticalRange(); SetMessageRangeOperation smrc = new SetMessageRangeOperation((Edge) msg.getNotationView(), currentRange, true); IGraphicalEditPart source = (IGraphicalEditPart) msg.getSource(); Rectangle sourceBounds; if (source instanceof ISequenceEventEditPart) { Range sourceRange = SequenceEditPartsOperations.getVerticalRange((ISequenceEventEditPart) source); sourceBounds = new Rectangle(0, sourceRange.getLowerBound(), 0, sourceRange.width()); } else if (source instanceof LostMessageEndEditPart) { LostMessageEnd lostMessageEnd = ((LostMessageEndEditPart) source).getLostMessageEnd(); sourceBounds = lostMessageEnd.getProperLogicalBounds().getCopy(); } else { throw new RuntimeException(Messages.ExecutionOperations_invalidMessageSource + String.valueOf(source)); } smrc.setSource(source.getNotationView(), sourceBounds); smrc.setTarget(parent.getNotationView(), new Rectangle(0, parentRange.getLowerBound(), 0, parentRange.width())); result.append(CommandFactory.createRecordingCommand(parent.getEditingDomain(), smrc)); return result; }

Target:
private static Command getTargetReconnectionCommand(ISequenceEventEditPart parent, Range parentRange, SequenceMessageEditPart msg) { CompoundCommand result = new CompoundCommand(); Range currentRange = msg.getISequenceEvent().getVerticalRange(); SetMessageRangeOperation smrc = new SetMessageRangeOperation((Edge) msg.getNotationView(), currentRange, true); IGraphicalEditPart source = (IGraphicalEditPart) msg.getSource(); Rectangle sourceBounds; if (source instanceof ISequenceEventEditPart) { Range sourceRange = SequenceEditPartsOperations.getVerticalRange((ISequenceEventEditPart) source); sourceBounds = new Rectangle(0, sourceRange.getLowerBound(), 0, sourceRange.width()); } else if (source instanceof LostMessageEndEditPart) { LostMessageEnd lostMessageEnd = ((LostMessageEndEditPart) source).getLostMessageEnd(); sourceBounds = lostMessageEnd.getProperLogicalBounds().getCopy(); } else { throw new RuntimeException(MessageFormat.format(Messages.ExecutionOperations_invalidMessageSource, String.valueOf(source))); } smrc.setSource(source.getNotationView(), sourceBounds); smrc.setTarget(parent.getNotationView(), new Rectangle(0, parentRange.getLowerBound(), 0, parentRange.width())); result.append(CommandFactory.createRecordingCommand(parent.getEditingDomain(), smrc)); return result; }
Source:
public static VmWatchdog map(WatchDog model, VmWatchdog template) { VmWatchdog entity = template == null ? new VmWatchdog() : template; entity.setAction( VmWatchdogAction.getByName(model.getAction())); entity.setId(new Guid(model.getId())); entity.setModel( VmWatchdogType.getByName(model.getModel())); return entity; }

Target:
public static VmWatchdog map(WatchDog model, VmWatchdog template) { VmWatchdog entity = template == null ? new VmWatchdog() : template; if (model.isSetAction()) { WatchdogAction wdAction = WatchdogAction.fromValue(model.getAction().toUpperCase()); if (wdAction != null) { entity.setAction(map(wdAction, null)); } } if (model.isSetModel()) { WatchdogModel wdModel = WatchdogModel.fromValue(model.getModel().toUpperCase()); if (wdModel != null) { entity.setModel(map(wdModel, null)); } } entity.setModel(VmWatchdogType.getByName(model.getModel())); entity.setId(new Guid(model.getId())); return entity; }
Source:
public final int parseArguments(final Parameters params) throws CmdLineException { final String token = params.getParameter(0); final String[] tokens = token.split(","); if (tokens.length != 3) { throw new CmdLineException(owner, "change should be specified as " + "<project>,<branch>,<change-id>"); } try { final Change.Key key = Change.Key.parse(tokens[2]); for (final Change change : db.changes().byKey(key)) { if (change.getProject().get().equals(tokens[0]) && change.getDest().getShortName().equals(tokens[1])) { setter.addValue(change.getId()); return 1; } } } catch (IllegalArgumentException e) { throw new CmdLineException(owner, "Change-Id is not valid"); } catch (OrmException e) { throw new CmdLineException(owner, "Database error: " + e.getMessage()); } throw new CmdLineException(owner, "\"" + token + "\": change not found"); }

Target:
public final int parseArguments(final Parameters params) throws CmdLineException { final String token = params.getParameter(0); final String[] tokens = token.split(","); if (tokens.length != 3) { throw new CmdLineException(owner, "change should be specified as " + "<project>,<branch>,<change-id>"); } try { final Change.Key key = Change.Key.parse(tokens[2]); final Project.NameKey project = new Project.NameKey(tokens[0]); final Branch.NameKey branch = new Branch.NameKey(project, tokens[1]); for (final Change change : db.changes().byBranchKey(branch, key)) { setter.addValue(change.getId()); return 1; } } catch (IllegalArgumentException e) { throw new CmdLineException(owner, "Change-Id is not valid"); } catch (OrmException e) { throw new CmdLineException(owner, "Database error: " + e.getMessage()); } throw new CmdLineException(owner, "\"" + token + "\": change not found"); }
Source:
public Double getPropeller(int bp) { if (bp < 0 || bp >= getPairingParameters().length) throw new IllegalArgumentException(); return pairingParameters[bp][1]; }

Target:
public Double getPropeller(int bp) { checkArgument(bp); return pairingParameters[bp][1]; }
Source:
private String getLog(StructuredRecord input) { Schema.Field inputField = input.getSchema().getField(config.inputName); if (inputField == null) { LOG.debug("Invalid inputName, no known inputField matches given input of " + config.inputName); return null; } Schema inputSchema = inputField.getSchema(); if (inputSchema.isNullableSimple()) { inputSchema = inputSchema.getNonNullable(); } Schema.Type inputType = inputSchema.getType(); try { validateInputSchemaType(inputSchema, config.inputName, getContext().getFailureCollector()); } catch (Exception e) { LOG.error(e.getMessage()); } if (Schema.Type.STRING.equals(inputType)) { return input.get(config.inputName); } else { Object data = input.get(config.inputName); if (data instanceof ByteBuffer) { return Bytes.toString((ByteBuffer) input.get(config.inputName)); } else if (data instanceof byte[]) { return Bytes.toString((byte[]) input.get(config.inputName)); } else { LOG.debug("Not a byte type, type is {}", data.getClass().toString()); return null; } } }

Target:
private String getLog(StructuredRecord input) { Schema.Field inputField = input.getSchema().getField(config.inputName); if (inputField == null) { LOG.debug("Invalid inputName, no known inputField matches given input of " + config.inputName); return null; } Schema inputSchema = inputField.getSchema(); if (inputSchema.isNullableSimple()) { inputSchema = inputSchema.getNonNullable(); } Schema.Type inputType = inputSchema.getType(); try { validateInputSchemaType(inputSchema, config.inputName); } catch (Exception e) { LOG.error(e.getMessage()); } if (Schema.Type.STRING.equals(inputType)) { return input.get(config.inputName); } else { Object data = input.get(config.inputName); if (data instanceof ByteBuffer) { return Bytes.toString((ByteBuffer) input.get(config.inputName)); } else if (data instanceof byte[]) { return Bytes.toString((byte[]) input.get(config.inputName)); } else { LOG.debug("Not a byte type, type is {}", data.getClass().toString()); return null; } } }
Source:
public String toString() { return "ConnectionPolicy{" + "requestTimeout=" + requestTimeout + ", connectionMode=" + connectionMode + ", maxConnectionPoolSize=" + maxConnectionPoolSize + ", idleHttpConnectionTimeout=" + idleHttpConnectionTimeout + ", idleTcpConnectionTimeout=" + idleTcpConnectionTimeout + ", userAgentSuffix='" + userAgentSuffix + '\'' + ", throttlingRetryOptions=" + throttlingRetryOptions + ", endpointDiscoveryEnabled=" + endpointDiscoveryEnabled + ", preferredRegions=" + preferredRegions + ", multipleWriteRegionsEnabled=" + multipleWriteRegionsEnabled + ", proxyType=" + (proxy != null ? proxy.getType() : null) + ", inetSocketProxyAddress=" + (proxy != null ? proxy.getAddress() : null) + ", readRequestsFallbackEnabled=" + readRequestsFallbackEnabled + ", connectTimeout=" + connectTimeout + ", idleTcpEndpointTimeout=" + idleTcpEndpointTimeout + ", maxConnectionsPerEndpoint=" + maxConnectionsPerEndpoint + ", maxRequestsPerConnection=" + maxRequestsPerConnection + ", tcpConnectionEndpointRediscoveryEnabled=" + tcpConnectionEndpointRediscoveryEnabled + '}'; }

Target:
public String toString() { return "ConnectionPolicy{" + "requestTimeout=" + requestTimeout + ", connectionMode=" + connectionMode + ", maxConnectionPoolSize=" + maxConnectionPoolSize + ", idleHttpConnectionTimeout=" + idleHttpConnectionTimeout + ", idleTcpConnectionTimeout=" + idleTcpConnectionTimeout + ", userAgentSuffix='" + userAgentSuffix + '\'' + ", throttlingRetryOptions=" + throttlingRetryOptions + ", endpointDiscoveryEnabled=" + endpointDiscoveryEnabled + ", preferredRegions=" + preferredRegions + ", multipleWriteRegionsEnabled=" + multipleWriteRegionsEnabled + ", proxyType=" + (proxy != null ? proxy.getType() : null) + ", inetSocketProxyAddress=" + (proxy != null ? proxy.getAddress() : null) + ", readRequestsFallbackEnabled=" + readRequestsFallbackEnabled + ", connectTimeout=" + connectTimeout + ", idleTcpEndpointTimeout=" + idleTcpEndpointTimeout + ", maxConnectionsPerEndpoint=" + maxConnectionsPerEndpoint + ", maxRequestsPerConnection=" + maxRequestsPerConnection + ", tcpConnectionEndpointRediscoveryEnabled=" + tcpConnectionEndpointRediscoveryEnabled + ", clientTelemetryEnabled=" + clientTelemetryEnabled + '}'; }
Source:
private Map<String,String> parseCompoundText (XMLStreamReader xmlr, String endTag) throws XMLStreamException { Map<String,String> returnMap = new HashMap<>(); String text = ""; while (true) { int event = xmlr.next(); if (event == XMLStreamConstants.CHARACTERS) { if (!"".equals(text)) { text += "\n";} text += xmlr.getText().trim().replace('\n',' '); } else if (event == XMLStreamConstants.START_ELEMENT) { if (xmlr.getLocalName().equals("ExtLink")) { String mapKey = ("image".equalsIgnoreCase( xmlr.getAttributeValue(null, "role") ) || "logo".equalsIgnoreCase(xmlr.getAttributeValue(null, "title")))? "logo" : "url"; returnMap.put( mapKey, xmlr.getAttributeValue(null, "URI") ); parseText(xmlr, "ExtLink"); } } else if (event == XMLStreamConstants.END_ELEMENT) { if (xmlr.getLocalName().equals(endTag)) { break; } } } returnMap.put( "name", text ); return returnMap; }

Target:
private Map<String,String> parseCompoundText (XMLStreamReader xmlr, String endTag) throws XMLStreamException { Map<String,String> returnMap = new HashMap<>(); String text = ""; while (true) { int event = xmlr.next(); if (event == XMLStreamConstants.CHARACTERS) { if (!text.isEmpty()) { text += "\n";} text += xmlr.getText().trim().replace('\n',' '); } else if (event == XMLStreamConstants.START_ELEMENT) { if (xmlr.getLocalName().equals("ExtLink")) { String mapKey = ("image".equalsIgnoreCase( xmlr.getAttributeValue(null, "role") ) || "logo".equalsIgnoreCase(xmlr.getAttributeValue(null, "title")))? "logo" : "url"; returnMap.put( mapKey, xmlr.getAttributeValue(null, "URI") ); parseText(xmlr, "ExtLink"); } } else if (event == XMLStreamConstants.END_ELEMENT) { if (xmlr.getLocalName().equals(endTag)) break; } } returnMap.put( "name", text ); return returnMap; }
Source:
public void process() { PerformanceMonitor.startActivity("rendering/chunksrefractivereflective"); boolean isHeadUnderWater = worldRenderer.isHeadUnderWater(); preRenderSetupSceneReflectiveRefractive(isHeadUnderWater); worldRenderer.renderChunks(renderQueues.chunksAlphaBlend, ChunkMesh.RenderPhase.REFRACTIVE, playerCamera, WorldRendererImpl.ChunkRenderMode.DEFAULT); postRenderCleanupSceneReflectiveRefractive(isHeadUnderWater); PerformanceMonitor.endActivity(); }

Target:
public void process() { PerformanceMonitor.startActivity("rendering/chunksrefractivereflective"); isHeadUnderWater = worldRenderer.isHeadUnderWater(); preRenderSetupSceneReflectiveRefractive(); worldRenderer.renderChunks(renderQueues.chunksAlphaBlend, ChunkMesh.RenderPhase.REFRACTIVE, playerCamera, WorldRendererImpl.ChunkRenderMode.DEFAULT); postRenderCleanupSceneReflectiveRefractive(); PerformanceMonitor.endActivity(); }
Source:
private void setSessionUser(Session session) { User user = getUserResource().getUserByNameAndDomain(session.getUser().getUserName(), session.getUser().getDomain().getName()); session.getUser().setId(user.getId()); session.getUser().setHref(user.getHref()); session.getUser().getDomain().setId(user.getDomain().getId()); session.getUser().getDomain().setHref(user.getDomain().getHref()); }

Target:
private void setSessionUser(Session session) { User user = getUserResource().getUserByNameAndDomain(session.getUser().getUserName(), session.getUser().getDomain().getName()); if (user != null) { session.getUser().setId(user.getId()); session.getUser().setHref(user.getHref()); session.getUser().getDomain().setId(user.getDomain().getId()); session.getUser().getDomain().setHref(user.getDomain().getHref()); } }
Source:
public void eachNonZero(VectorProcedure procedure) { for (int i = 0; i < length; i++) { if (Math.abs(get(i))>Vectors.EPS) procedure.apply(i, get(i)); } }

Target:
public void eachNonZero(VectorProcedure procedure) { for (int i = 0; i < length; i++) { if (Math.abs(get(i)) > Vectors.EPS) { procedure.apply(i, get(i)); } } }
Source:
private void testAcceleratedGeometry(OGCGeometry geometry) { long initialSize = geometry.estimateMemorySize(); assertTrue(initialSize > 0); Envelope envelope = new Envelope(); geometry.getEsriGeometry().queryEnvelope(envelope); long withEnvelopeSize = geometry.estimateMemorySize(); assertTrue(withEnvelopeSize > initialSize); accelerate(geometry, GeometryAccelerationDegree.enumMild); long mildAcceleratedSize = geometry.estimateMemorySize(); assertTrue(mildAcceleratedSize > withEnvelopeSize); accelerate(geometry, GeometryAccelerationDegree.enumMedium); long mediumAcceleratedSize = geometry.estimateMemorySize(); assertTrue(mediumAcceleratedSize > mildAcceleratedSize); accelerate(geometry, GeometryAccelerationDegree.enumHot); long hotAcceleratedSize = geometry.estimateMemorySize(); assertTrue(hotAcceleratedSize > mediumAcceleratedSize); System.out.println(String.format("%s, %s, %s, %s, %s", initialSize, withEnvelopeSize, mildAcceleratedSize, mediumAcceleratedSize, hotAcceleratedSize)); }

Target:
private void testAcceleratedGeometry(OGCGeometry geometry) { long initialSize = geometry.estimateMemorySize(); assertTrue(initialSize > 0); Envelope envelope = new Envelope(); geometry.getEsriGeometry().queryEnvelope(envelope); long withEnvelopeSize = geometry.estimateMemorySize(); assertTrue(withEnvelopeSize > initialSize); accelerate(geometry, GeometryAccelerationDegree.enumMild); long mildAcceleratedSize = geometry.estimateMemorySize(); assertTrue(mildAcceleratedSize > withEnvelopeSize); accelerate(geometry, GeometryAccelerationDegree.enumMedium); long mediumAcceleratedSize = geometry.estimateMemorySize(); assertTrue(mediumAcceleratedSize > mildAcceleratedSize); accelerate(geometry, GeometryAccelerationDegree.enumHot); long hotAcceleratedSize = geometry.estimateMemorySize(); assertTrue(hotAcceleratedSize > mediumAcceleratedSize); }
Source:
private void initialize() { ColorServer colorServer = new ColorServer(); fileOpenController.dbPathProperty().set(welcomeController.getListedPaths()); fileOpenController.doneProperty().addListener((obj, oldV, newV) -> welcomeController.doneProperty().setValue(true)); fileOpenController.graphProperty().addListener((obj, oldV, newV) -> { strainView = new StrainView(colorServer, newV); }); fileOpenController.treeProperty().addListener((obj, oldV, newV) -> { phyloView = new PhylogeneticView(colorServer); phyloView.rootProperty().set(newV); }); welcomeController.doneProperty().addListener((obj, oldV, newV) -> { SplitPane splitPane = new SplitPane(strainView, phyloView); splitPane.setOrientation(Orientation.VERTICAL); root.setCenter(splitPane); }); welcomeController.dbProperty().addListener((obj, oldV, newV) -> { strainView = new StrainView(colorServer, newV); phyloView = new PhylogeneticView(colorServer); }); }

Target:
private void initialize() { ColorServer colorServer = new ColorServer(); fileOpenController.dbPathProperty().set(welcomeController.getListedPaths()); fileOpenController.graphProperty().addListener((obj, oldV, newV) -> { strainView = new StrainView(colorServer, newV); constructView(); }); fileOpenController.treeProperty().addListener((obj, oldV, newV) -> { phyloView = new PhylogeneticView(colorServer); phyloView.rootProperty().set(newV); }); welcomeController.dbProperty().addListener((obj, oldV, newV) -> { strainView = new StrainView(colorServer, newV); phyloView = new PhylogeneticView(colorServer); constructView(); }); }
Source:
public boolean matches(byte[] buf, int off, int len) { long ssrc = RawPacket.getSSRCAsLong(buf, off, len); if (primarySSRC != ssrc && rtxSSRC != ssrc) { return false; } int tid = track.getMediaStreamTrackReceiver() .getStream().getTemporalID(buf, off, len); return (tid == -1 && ArrayUtils.isNullOrEmpty(dependencyEncodings)) || tid == temporalId; }

Target:
public boolean matches(byte[] buf, int off, int len) { long ssrc = RawPacket.getSSRCAsLong(buf, off, len); if (primarySSRC != ssrc && rtxSSRC != ssrc) { return false; } if (temporalId == -1) { return true; } int tid = track.getMediaStreamTrackReceiver() .getStream().getTemporalID(buf, off, len); return tid == -1 && idx == 0 || tid == temporalId; }
Source:
@Override void bind(Layer layer, boolean isVisible) { mParentCheckbox.setOnCheckedChangeListener(null); mParentCheckbox.setChecked(isVisible); mParentTextView.setText(layer.getName()); mParentCheckbox.setOnCheckedChangeListener( (buttonView, isChecked) -> mOnLayerCheckedChangedListener.layerCheckedChanged(layer, isChecked)); if (((GroupLayer) layer).isShowChildrenInLegend()) { for (Layer childLayer : ((GroupLayer) layer).getLayers()) { if (childLayer.getLoadStatus() != LoadStatus.LOADED) { childLayer.addDoneLoadingListener(() -> { addChildLayer(childLayer); }); childLayer.loadAsync(); } else { addChildLayer(childLayer); } } } }

Target:
@Override void bind(Layer layer, boolean isVisible) { mParentCheckbox.setOnCheckedChangeListener(null); mParentCheckbox.setChecked(isVisible); mParentTextView.setText(layer.getName()); mParentCheckbox.setOnCheckedChangeListener( (buttonView, isChecked) -> mOnLayerCheckedChangedListener.layerCheckedChanged(layer, isChecked)); if (((GroupLayer) layer).isShowChildrenInLegend()) { for (Layer childLayer : ((GroupLayer) layer).getLayers()) { if (childLayer.getLoadStatus() != LoadStatus.LOADED) { childLayer.addDoneLoadingListener(() -> addChildLayer(childLayer)); childLayer.loadAsync(); } else { addChildLayer(childLayer); } } } }
Source:
public void testDisplaySampleList(){ SampleList sampleList = Mockito.mock(SampleList.class); Mockito.when(sampleList.getListName()).thenReturn(SampleListControllerTest.TEST_LIST_NAME); Mockito.when(sampleList.getNotes()).thenReturn(SampleListControllerTest.TEST_LIST_NAME); Mockito.when(sampleList.getType()).thenReturn(SampleListType.SAMPLE_LIST); Mockito.doReturn(sampleList).when(this.sampleListService).getSampleList(SampleListControllerTest.TEST_SAMPLE_LIST_ID); List<SampleDetailsDTO> sampleDetailsDTOs = GenerateASampleDetails(10); Mockito.doReturn(sampleDetailsDTOs).when(this.sampleListService).getSampleDetailsDTOs(SampleListControllerTest.TEST_SAMPLE_LIST_ID); Model model = Mockito.mock(Model.class); this.slc.displaySampleList(SampleListControllerTest.TEST_SAMPLE_LIST_ID, Mockito.mock(HttpServletRequest.class), model); Mockito.verify(model).addAttribute(SampleListController.SAMPLE_LIST, sampleDetailsDTOs); Mockito.verify(model).addAttribute(SampleListController.TOTAL_NUMBER_OF_GERMPLASMS, sampleDetailsDTOs.size()); Mockito.verify(model).addAttribute(Matchers.eq(SampleListController.TABLE_HEADER_LIST), Matchers.anyListOf(TableHeader.class)); Mockito.verify(model).addAttribute("listId", SampleListControllerTest.TEST_SAMPLE_LIST_ID); Mockito.verify(model).addAttribute("listName", sampleList.getListName()); Mockito.verify(model).addAttribute("listNotes", sampleList.getNotes()); Mockito.verify(model).addAttribute("listType", sampleList.getType().name()); }

Target:
public void testDisplaySampleList(){ final SampleList sampleList = Mockito.mock(SampleList.class); Mockito.when(sampleList.getListName()).thenReturn(SampleListControllerTest.TEST_LIST_NAME); Mockito.when(sampleList.getNotes()).thenReturn(SampleListControllerTest.TEST_LIST_NAME); Mockito.when(sampleList.getType()).thenReturn(SampleListType.SAMPLE_LIST); Mockito.doReturn(sampleList).when(this.sampleListService).getSampleList(SampleListControllerTest.TEST_SAMPLE_LIST_ID); final List<SampleDetailsDTO> sampleDetailsDTOs = buildSampleDetailsList(10); Mockito.doReturn(sampleDetailsDTOs).when(this.sampleListService).getSampleDetailsDTOs(SampleListControllerTest.TEST_SAMPLE_LIST_ID); final Model model = Mockito.mock(Model.class); this.slc.displaySampleList(SampleListControllerTest.TEST_SAMPLE_LIST_ID, Mockito.mock(HttpServletRequest.class), model); Mockito.verify(model).addAttribute(SampleListController.SAMPLE_LIST, sampleDetailsDTOs); Mockito.verify(model).addAttribute(SampleListController.TOTAL_NUMBER_OF_GERMPLASMS, sampleDetailsDTOs.size()); Mockito.verify(model).addAttribute(Matchers.eq(SampleListController.TABLE_HEADER_LIST), Matchers.anyListOf(TableHeader.class)); Mockito.verify(model).addAttribute("listId", SampleListControllerTest.TEST_SAMPLE_LIST_ID); Mockito.verify(model).addAttribute("listName", sampleList.getListName()); Mockito.verify(model).addAttribute("listNotes", sampleList.getNotes()); Mockito.verify(model).addAttribute("listType", sampleList.getType().name()); }
Source:
private void clickClearInputButton() { if (clearInputButton.isDisplayed()) { clearInputButton.click(); PageObjectLogging.log("clickClearInputButton", "'x' button clicked to clear search", true); } }

Target:
private void clickClearInputButton() { if (clearInputButton.isDisplayed()) { waitForElementClickableByElement(clearInputButton); clearInputButton.click(); PageObjectLogging.log("clickClearInputButton", "'x' button clicked to clear search", true); } }
Source:
protected <T> Property<T> propertyFor(Class<? extends T> targetClass, String property) { Iterable<Field> fields = fieldsOf(targetClass); for(Field field : fields) { if (field.getName().equals(property) && ((field.getModifiers() & Modifier.PUBLIC) == Modifier.PUBLIC)) { return new DirectlyAccessedProperty<>(field, property); } } return null; }

Target:
protected <T> Property<T> propertyFor(Class<? extends T> targetClass, String property) { Field[] fields = targetClass.getFields(); for(Field field : fields) { if (field.getName().equals(property)) { return new DirectlyAccessedProperty<>(field, property); } } return null; }
Source:
private static String getKeyColumnName(ConfigurationService configurationService) { String driverClass = configurationService.getConfiguration().getStorageConfiguration().get("driver")!= null ? configurationService.getConfiguration().getStorageConfiguration().get("driver").asText() : null; if (!Strings.isNullOrEmpty(driverClass) && driverClass.contains("mysql")) { return "`key`"; } return "key"; }

Target:
private static String getKeyColumnName(ConfigurationService configurationService) { JsonNode driverNode = configurationService.getConfiguration().getStorageConfiguration().get("driver"); String driverClass = driverNode != null ? driverNode.asText() : null; if (!Strings.isNullOrEmpty(driverClass) && driverClass.contains("mysql")) { return "`key`"; } return "key"; }
Source:
public <T> T newInstance(Target<T> target) { Map<String, MethodHandler> nameToHandler = targetToHandlersByName.apply(target); Map<Method, MethodHandler> methodToHandler = new LinkedHashMap<Method, MethodHandler>(); Promise<Object> proxyPromise = new Promise<Object>(); for (Method method : target.type().getMethods()) { if (method.getDeclaringClass() == Object.class) { continue; } else if(Util.isDefault(method)) { methodToHandler.put(method, new DefaultMethodHandler(method, proxyPromise)); } else { methodToHandler.put(method, nameToHandler.get(Feign.configKey(target.type(), method))); } } InvocationHandler handler = factory.create(target, methodToHandler); T proxy = (T) Proxy.newProxyInstance(target.type().getClassLoader(), new Class<?>[]{target.type()}, handler); proxyPromise.set(proxy); return proxy; }

Target:
public <T> T newInstance(Target<T> target) { Map<String, MethodHandler> nameToHandler = targetToHandlersByName.apply(target); Map<Method, MethodHandler> methodToHandler = new LinkedHashMap<Method, MethodHandler>(); List<DefaultMethodHandler> defaultMethodHandlers = new LinkedList<DefaultMethodHandler>(); for (Method method : target.type().getMethods()) { if (method.getDeclaringClass() == Object.class) { continue; } else if(Util.isDefault(method)) { DefaultMethodHandler handler = new DefaultMethodHandler(method); defaultMethodHandlers.add(handler); methodToHandler.put(method, handler); } else { methodToHandler.put(method, nameToHandler.get(Feign.configKey(target.type(), method))); } } InvocationHandler handler = factory.create(target, methodToHandler); T proxy = (T) Proxy.newProxyInstance(target.type().getClassLoader(), new Class<?>[]{target.type()}, handler); for(DefaultMethodHandler defaultMethodHandler : defaultMethodHandlers) { defaultMethodHandler.bindTo(proxy); } return proxy; }
Source:
private void exportAnalysis() { FileDialog dialog = new FileDialog(Display.getCurrent().getActiveShell(), SWT.SAVE); dialog.setText(NLS.bind(Messages.ManageXMLAnalysisDialog_SelectFileExport, fAnalysesList.getSelection()[0])); dialog.setFilterExtensions(new String[] { XML_FILTER_EXTENSION, "*" }); String path = dialog.open(); if (path != null) { String selection = fAnalysesList.getSelection()[0]; if (!XmlUtils.exportXmlFile(selection + XmlUtils.XML_EXTENSION, path).isOK()) { Activator.logError(NLS.bind(Messages.ManageXMLAnalysisDialog_FailedToExport, selection + XmlUtils.XML_EXTENSION)); } } }

Target:
private void exportAnalysis() { FileDialog dialog = new FileDialog(Display.getCurrent().getActiveShell(), SWT.SAVE); dialog.setText(NLS.bind(Messages.ManageXMLAnalysisDialog_SelectFileExport, fAnalysesList.getSelection()[0])); dialog.setFilterExtensions(new String[] { XML_FILTER_EXTENSION, "*" }); dialog.setFileName(fAnalysesList.getSelection()[0] + XmlUtils.XML_EXTENSION); String path = dialog.open(); if (path != null) { String selection = fAnalysesList.getSelection()[0]; if (!XmlUtils.exportXmlFile(selection + XmlUtils.XML_EXTENSION, path).isOK()) { Activator.logError(NLS.bind(Messages.ManageXMLAnalysisDialog_FailedToExport, selection + XmlUtils.XML_EXTENSION)); } } }
Source:
public static void main(String[] args) { post("/books", (request, response) -> { String author = request.queryParams("author"); String title = request.queryParams("title"); Book book = new Book(author, title); Random random = new Random(); int id = random.nextInt(Integer.MAX_VALUE); books.put(String.valueOf(id), book); response.status(201); return id; }); get("/books/:id", (request, response) -> { Book book = books.get(request.params(":id")); if (book != null) { return "Title: " + book.getTitle() + ", Author: " + book.getAuthor(); } response.status(404); return "Book not found"; }); put("/books/:id", (request, response) -> { String id = request.params(":id"); Book book = books.get(id); if (book != null) { String newAuthor = request.queryParams("author"); String newTitle = request.queryParams("title"); if (newAuthor != null) { book.setAuthor(newAuthor); } if (newTitle != null) { book.setTitle(newTitle); } return "Book with id '" + id + "' updated"; } response.status(404); return "Book not found"; }); delete("/books/:id", (request, response) -> { String id = request.params(":id"); Book book = books.remove(id); if (book != null) { return "Book with id '" + id + "' deleted"; } response.status(404); return "Book not found"; }); get("/books", (request, response) -> { String ids = ""; for (String id : books.keySet()) { ids += id + " "; } return ids; }); }

Target:
public static void main(String[] args) { post("/books", (request, response) -> { String author = request.queryParams("author"); String title = request.queryParams("title"); Book book = new Book(author, title); Random random = new Random(); int id = random.nextInt(Integer.MAX_VALUE); books.put(String.valueOf(id), book); response.status(201); return id; }); get("/books/:id", (request, response) -> { Book book = books.get(request.params(":id")); if (book != null) { return "Title: " + book.getTitle() + ", Author: " + book.getAuthor(); } else { response.status(404); return "Book not found"; } }); put("/books/:id", (request, response) -> { String id = request.params(":id"); Book book = books.get(id); if (book != null) { String newAuthor = request.queryParams("author"); String newTitle = request.queryParams("title"); if (newAuthor != null) { book.setAuthor(newAuthor); } if (newTitle != null) { book.setTitle(newTitle); } return "Book with id '" + id + "' updated"; } else { response.status(404); return "Book not found"; } }); delete("/books/:id", (request, response) -> { String id = request.params(":id"); Book book = books.remove(id); if (book != null) { return "Book with id '" + id + "' deleted"; } else { response.status(404); return "Book not found"; } }); get("/books", (request, response) -> { String ids = ""; for (String id : books.keySet()) { ids += id + " "; } return ids; }); }
Source:
@Override protected void prepareCluster() throws Exception { Ignite srv = startGrid("srv", ALLOW_ALL, false); Permissions perms = new Permissions(); perms.add(new RuntimePermission("accessClassInPackage.org.apache.ignite.internal")); perms.add(new RuntimePermission("accessClassInPackage.org.apache.ignite.internal.*")); startGrid(CLNT_ALLOWED, ALLOW_ALL, perms, false); startGrid(CLNT_FORBIDDEN, ALLOW_ALL, false); srv.cluster().active(true); }

Target:
@Override protected void prepareCluster() throws Exception { Ignite srv = startGrid("srv", ALLOW_ALL, false); Permissions perms = new Permissions(); perms.add(new RuntimePermission("accessClassInPackage." + IGNITE_INTERNAL_PACKAGE)); perms.add(new RuntimePermission("accessClassInPackage." + IGNITE_INTERNAL_PACKAGE + ".*")); startGrid(ALLOWED, ALLOW_ALL, perms, false); startGrid(FORBIDDEN, ALLOW_ALL, false); srv.cluster().active(true); }
Source:
public Matrix getTransform( Matrix transform, Rect parentBounds, int childWidth, int childHeight, float focusX, float focusY) { if (mMatrixValuesFrom == null) { mMatrixValuesFrom = new float[9]; mScaleTypeFrom.getTransform(transform, mBoundsFrom, childWidth, childHeight, focusX, focusY); transform.getValues(mMatrixValuesFrom); } if (mMatrixValuesTo == null) { mMatrixValuesTo = new float[9]; mScaleTypeTo.getTransform(transform, mBoundsTo, childWidth, childHeight, focusX, focusY); transform.getValues(mMatrixValuesTo); } for (int i = 0; i < 9; i++) { mMatrixValuesInterpolated[i] = mMatrixValuesFrom[i] * (1 - mInterpolatingValue) + mMatrixValuesTo[i] * mInterpolatingValue; } transform.setValues(mMatrixValuesInterpolated); return transform; }

Target:
public Matrix getTransform( Matrix transform, Rect parentBounds, int childWidth, int childHeight, float focusX, float focusY) { Rect boundsFrom = (mBoundsFrom != null) ? mBoundsFrom : parentBounds; Rect boundsTo = (mBoundsTo != null) ? mBoundsTo : parentBounds; mScaleTypeFrom.getTransform(transform, boundsFrom, childWidth, childHeight, focusX, focusY); transform.getValues(mMatrixValuesFrom); mScaleTypeTo.getTransform(transform, boundsTo, childWidth, childHeight, focusX, focusY); transform.getValues(mMatrixValuesTo); for (int i = 0; i < 9; i++) { mMatrixValuesInterpolated[i] = mMatrixValuesFrom[i] * (1 - mInterpolatingValue) + mMatrixValuesTo[i] * mInterpolatingValue; } transform.setValues(mMatrixValuesInterpolated); return transform; }
Source:
private boolean isUserRoleChanged(User posted, User existing) { return posted.getRole().equals(existing.getRole()); }

Target:
private boolean isUserRoleChanged(User posted, User existing) { return !posted.getRole().equals(existing.getRole()); }
Source:
public Stream<Node> stream() { return Arrays.stream(getComposite().getChildren()).map(control -> getElement(control)); }

Target:
public Stream<Node> stream() { return Arrays.stream(getComposite().getChildren()).map(this::getElement); }
Source:
public void init(List<TransformFunction> arguments, Map<String, DataSource> dataSourceMap) { Preconditions .checkArgument(arguments.size() == 1, "Exactly 1 argument is required for transform function: %s", getName()); TransformFunction transformFunction = arguments.get(0); Preconditions.checkArgument(transformFunction.getResultMetadata().isSingleValue(), "The argument must be single-valued for transform function: %s", getName()); _transformFunction = transformFunction; _reader = new WKBReader(getGeometryFactory()); }

Target:
public void init(List<TransformFunction> arguments, Map<String, DataSource> dataSourceMap) { Preconditions .checkArgument(arguments.size() == 1, "Exactly 1 argument is required for transform function: %s", getName()); TransformFunction transformFunction = arguments.get(0); Preconditions.checkArgument(transformFunction.getResultMetadata().isSingleValue(), "The argument must be single-valued for transform function: %s", getName()); Preconditions.checkArgument(transformFunction.getResultMetadata().getDataType() == FieldSpec.DataType.BYTES, "The argument must be of bytes type"); _transformFunction = transformFunction; _reader = new WKBReader(getGeometryFactory()); }
Source:
public static Timestamp checkIsPositive(Timestamp timestamp, String nameToLog) { checkNotNull(timestamp, nameToLog + " is null."); checkArgument(timestamp.getSeconds() > 0, nameToLog + " must have positive seconds."); checkArgument(timestamp.getNanos() >= 0, nameToLog + " must have positive nanoseconds."); return timestamp; }

Target:
public static Timestamp checkIsPositive(Timestamp timestamp, String nameToLog) { checkNotNull(timestamp, nameToLog + " is null."); checkArgument(timestamp.getSeconds() > 0, nameToLog + " must have a positive number of seconds."); checkArgument(timestamp.getNanos() >= 0, nameToLog + " must not have a negative number of nanoseconds."); return timestamp; }
Source:
public boolean vdsUpEvent(final VDS vds) { HostStoragePoolParametersBase params = new HostStoragePoolParametersBase(vds); boolean isSucceeded = Backend.getInstance().runInternalAction(VdcActionType.InitVdsOnUp, params).getSucceeded(); if (isSucceeded) { ThreadPoolUtil.execute(new Runnable() { @Override public void run() { try { List<VmStatic> vmsToMigrate = DbFacade.getInstance().getVmStaticDao().getAllWithFailbackByVds(vds.getId()); if (!vmsToMigrate.isEmpty()) { ExecutionContext executionContext = new ExecutionContext(); executionContext.setMonitored(true); Backend.getInstance().runInternalMultipleActions(VdcActionType.MigrateVmToServer, new ArrayList<>(createMigrateVmToServerParametersList(vmsToMigrate, vds)), new CommandContext(executionContext)); } } catch (RuntimeException e) { log.errorFormat("Failed to initialize Vds on up. Error: {0}", e); } } }); } return isSucceeded; }

Target:
public boolean vdsUpEvent(final VDS vds) { HostStoragePoolParametersBase params = new HostStoragePoolParametersBase(vds); boolean isSucceeded = Backend.getInstance().runInternalAction(VdcActionType.InitVdsOnUp, params).getSucceeded(); if (isSucceeded) { ThreadPoolUtil.execute(new Runnable() { @Override public void run() { try { List<VmStatic> vmsToMigrate = DbFacade.getInstance().getVmStaticDao().getAllWithFailbackByVds(vds.getId()); if (!vmsToMigrate.isEmpty()) { ExecutionContext executionContext = new ExecutionContext(); executionContext.setMonitored(true); Backend.getInstance().runInternalMultipleActions(VdcActionType.MigrateVmToServer, new ArrayList<>(createMigrateVmToServerParametersList(vmsToMigrate, vds)), new CommandContext().setExecutionContext(executionContext)); } } catch (RuntimeException e) { log.errorFormat("Failed to initialize Vds on up. Error: {0}", e); } } }); } return isSucceeded; }
Source:
protected static void importDeltaspikeProject(String projectName, ServerRequirement sr) { try { importMavenProject(projectName); } catch (IOException e) { e.printStackTrace(); fail("Unable to import " + projectName); } ProjectExplorer pe = new ProjectExplorer(); pe.open(); pe.getProject(projectName).select(); new ContextMenu("Properties").select(); new DefaultShell("Properties for " + projectName); new DefaultTreeItem("Targeted Runtimes").select(); for (TableItem i : new DefaultTable().getItems()) { if (i.getText().equals(sr.getRuntimeNameLabelText(sr.getConfig()))) { i.setChecked(true); } else { i.setChecked(false); } } boolean needValidation = false; new DefaultTreeItem("CDI (Contexts and Dependency Injection) Settings").select(); LabeledCheckBox cdiSupportCheckBox = new LabeledCheckBox("CDI support:"); if (!cdiSupportCheckBox.isChecked()) { log.warn("CDI support is disabled! CDI should be enabled automatically after project import."); log.warn("Enabling CDI support for '%s' project.", projectName); cdiSupportCheckBox.toggle(true); needValidation = true; } new PushButton("OK").click(); new WaitWhile(new ShellWithTextIsAvailable("Properties for " + projectName)); new WaitWhile(new JobIsRunning(), TimePeriod.LONG); if (needValidation) { pe.getProject(projectName).select(); new ContextMenu("Validate").select(); new WaitWhile(new JobIsRunning(), TimePeriod.LONG); } }

Target:
protected static void importDeltaspikeProject(String projectName, ServerRequirement sr) { try { importMavenProject(projectName); } catch (IOException e) { e.printStackTrace(); fail("Unable to import " + projectName); } ProjectExplorer pe = new ProjectExplorer(); pe.open(); Project explorerItem = pe.getProject(projectName); PropertyDialog dialog = new ExplorerItemPropertyDialog(explorerItem); RuntimesPropertyPage runtimePage = new RuntimesPropertyPage(); CDISettingsPreferencePage cdiPage = new CDISettingsPreferencePage(); String targetRuntime = sr.getRuntimeNameLabelText(sr.getConfig()); dialog.open(); dialog.select(runtimePage); runtimePage.selectRuntime(targetRuntime); dialog.select(cdiPage); if (!cdiPage.isCDISupport()) { log.warn("CDI support is disabled! CDI should be enabled automatically after project import."); log.warn("Enabling CDI support for '%s' project.", projectName); cdiPage.toggleCDISupport(true); } dialog.ok(); new WaitWhile(new JobIsRunning(), TimePeriod.LONG); pe.getProject(projectName).select(); new ContextMenu("Validate").select(); new WaitWhile(new JobIsRunning(), TimePeriod.LONG); }
Source:
protected void waitJob() { AtomicBoolean removed = new AtomicBoolean(false); while (true) { mSubmittedJobAttempts = mSubmittedJobAttempts.stream().filter((jobAttempt) -> { Status check = jobAttempt.check(); switch (check) { case CREATED: case RUNNING: return true; case CANCELED: case COMPLETED: removed.set(true); return false; case FAILED: removed.set(true); return false; default: throw new IllegalStateException(String.format("Unexpected Status: %s", check)); } }).collect(Collectors.toList()); if (removed.get()) { return; } } }

Target:
protected void waitJob() { AtomicBoolean removed = new AtomicBoolean(false); while (true) { mSubmittedJobAttempts = mSubmittedJobAttempts.stream().filter((jobAttempt) -> { Status check = jobAttempt.check(); switch (check) { case CREATED: case RUNNING: return true; case CANCELED: case COMPLETED: removed.set(true); return false; case FAILED: removed.set(true); return false; default: throw new IllegalStateException(String.format("Unexpected Status: %s", check)); } }).collect(Collectors.toList()); if (removed.get()) { return; } CommonUtils.sleepMs(5); } }
Source:
public static Collection<Mutation> genDomainMutations(DomainUpdate update, long seq) { Map<RowColumn, Bytes> oldData = genDomainData(update.getDomain(), update.getOldPageCount()); Map<RowColumn, Bytes> newData = genDomainData(update.getDomain(), update.getNewPageCount()); return AccumuloExportQueue.generateMutations(seq, oldData, newData); }

Target:
public static Collection<Mutation> genDomainMutations(DomainUpdate update, long seq) { Map<RowColumn, Bytes> oldData = genDomainData(update.getDomain(), update.getOldPageCount()); Map<RowColumn, Bytes> newData = genDomainData(update.getDomain(), update.getNewPageCount()); return AccumuloExporter.generateMutations(seq, oldData, newData); }
Source:
public void register(ExtensionBuilder builder) { builder.service(TestEnricher.class, DroneTestEnricher.class); builder.observer(DroneCore.class); builder.observer(DroneRegistrar.class); builder.observer(DroneExecutorService.class); builder.observer(DroneConfigurator.class); builder.observer(DroneEnhancer.class); builder.observer(DroneDestructor.class); builder.service(Configurator.class, DroneCore.GlobalDroneFactory.class); builder.service(Instantiator.class, DroneCore.GlobalDroneFactory.class); builder.service(Destructor.class, DroneCore.GlobalDroneFactory.class); }

Target:
public void register(ExtensionBuilder builder) { builder.service(TestEnricher.class, DroneTestEnricher.class); builder.observer(DroneLifecycleManager.class); builder.observer(DroneRegistrar.class); builder.observer(DroneExecutorService.class); builder.observer(DroneConfigurator.class); builder.observer(DroneEnhancer.class); builder.observer(DroneDestructor.class); }
Source:
public Graph() { mSeries = new Vector<>(); mConfiguration = new Hashtable<>(); mAnnotations = new Vector<>(); }

Target:
public Graph() { mSeries = new Vector<XYSeries>(); mConfiguration = new Hashtable<String, Text>(); mAnnotations = new Vector<Annotation>(); }