auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void runOneAtATimeExplorationUsersMemoryEnvironment() throws Exception { String testName = "WfMSTest"; int expectedNumExperiments = 16; String testID = testModelDAO.addTestModel(testName, user); String testDefinitionString = IOUtils.toString(TestFiles.getTestExplorationOneAtATimeUsersMemoryEnvironmentInputStream(), StandardCharsets.UTF_8); CountDownLatch countDownLatch = setUpExplorationMocks(testID, expectedNumExperiments, testDefinitionString); testTaskScheduler.handleTestState(testID); countDownLatch.await(10, TimeUnit.SECONDS); executorService.awaitTermination(1, TimeUnit.SECONDS); Assert.assertEquals(0, countDownLatch.getCount()); Assert.assertEquals(BenchFlowTestModel.BenchFlowTestState.TERMINATED, testModelDAO.getTestState(testID)); List<Integer> expectedIndices = new ArrayList<>(); for (int i = 0; i < expectedNumExperiments; i++) { expectedIndices.add(i); } Assert.assertEquals(expectedIndices, explorationModelDAO.getExplorationPointIndices(testID)); String deploymentDescriptor1 = IOUtils.toString(minioService.getExperimentDeploymentDescriptor( testID + BenchFlowConstants.MODEL_ID_DELIMITER + 1), StandardCharsets.UTF_8); Assert.assertTrue(deploymentDescriptor1.contains("mem_limit: 500m")); Assert.assertTrue(deploymentDescriptor1.contains("SIZE_OF_THREADPOOL=1")); Assert.assertTrue(deploymentDescriptor1.contains("AN_ENUM=A")); }

Target:
public void runOneAtATimeExplorationUsersMemoryEnvironment() throws Exception { String testName = "WfMSTest"; int expectedNumExperiments = 16; String testID = testModelDAO.addTestModel(testName, user); String testDefinitionString = IOUtils.toString(TestFiles.getTestExplorationOneAtATimeUsersMemoryEnvironmentInputStream(), StandardCharsets.UTF_8); CountDownLatch countDownLatch = setUpExplorationMocks(testID, expectedNumExperiments, testDefinitionString); testTaskScheduler.handleTestState(testID); countDownLatch.await(10, TimeUnit.SECONDS); executorService.awaitTermination(1, TimeUnit.SECONDS); Assert.assertEquals(0, countDownLatch.getCount()); Assert.assertEquals(BenchFlowTestModel.BenchFlowTestState.TERMINATED, testModelDAO.getTestState(testID)); List<Integer> expectedIndices = new ArrayList<>(); for (int i = 0; i < expectedNumExperiments; i++) { expectedIndices.add(i); } Assert.assertEquals(expectedIndices, explorationModelDAO.getExecutedExplorationPointIndices(testID)); String deploymentDescriptor1 = IOUtils.toString(minioService.getExperimentDeploymentDescriptor( testID + BenchFlowConstants.MODEL_ID_DELIMITER + 1), StandardCharsets.UTF_8); Assert.assertTrue(deploymentDescriptor1.contains("mem_limit: 500m")); Assert.assertTrue(deploymentDescriptor1.contains("SIZE_OF_THREADPOOL=1")); Assert.assertTrue(deploymentDescriptor1.contains("AN_ENUM=A")); }
Source:
public static boolean isCommandsFile(FileDescriptor file) { final String fqn = file.getName(); final int startIndexOfFileName = fqn.lastIndexOf(PROTO_FILE_SEPARATOR) + 1; final String fileName = fqn.substring(startIndexOfFileName); final boolean isCommandsFile = fileName.contains(COMMANDS_FILE_SUBSTRING); return isCommandsFile; }

Target:
public static boolean isCommandsFile(FileDescriptor file) { final String fqn = file.getName(); final int startIndexOfFileName = fqn.lastIndexOf(FILE_PATH_SEPARATOR) + 1; final int endIndexOfFileName = fqn.lastIndexOf(FILE_EXTENSION_SEPARATOR); final String fileName = fqn.substring(startIndexOfFileName, endIndexOfFileName); final boolean isCommandsFile = fileName.endsWith(FILE_NAME_SUFFIX); return isCommandsFile; }
Source:
public int hashCode() { return Objects.hash(getGroupID(), getArtifactID(), getVersion(), getScope()); }

Target:
public int hashCode() { int result = getGroupID().hashCode(); result = 31 * result + getArtifactID().hashCode(); result = 31 * result + getVersion().hashCode(); result = 31 * result + (getScope() != null ? getScope().hashCode() : 0); return result; }
Source:
public Alert alert() { try { return Wait().until(alertIsPresent()); } catch (TimeoutException e) { throw new NoAlertPresentException(); } }

Target:
public Alert alert() { try { return Wait().until(alertIsPresent()); } catch (TimeoutException e) { throw new NoAlertPresentException("Alert not found", e); } }
Source:
protected List<AttributeStatement> createUserNameAttributeStatements(final CallbackProperties properties) { final List<AttributeStatement> statements = new ArrayList<>(); final List<Attribute> attributes = new ArrayList<>(); final List<String> userNameValues = new ArrayList<>(); final String nameConstruct = properties.getUserFullName(); if (nameConstruct.length() > 0) { LOG.debug("UserName: {}", nameConstruct); userNameValues.add(nameConstruct); attributes.add(OpenSAML2ComponentBuilder.getInstance().createAttribute(null, SamlConstants.USERNAME_ATTR, null, userNameValues)); } else { LOG.warn("No information provided to fill in user name attribute"); } if (!attributes.isEmpty()) { statements.addAll(OpenSAML2ComponentBuilder.getInstance().createAttributeStatement(attributes)); } return statements; }

Target:
protected List<AttributeStatement> createUserNameAttributeStatements(final CallbackProperties properties) { final List<AttributeStatement> statements = new ArrayList<>(); final List<Attribute> attributes = new ArrayList<>(); final List<String> userNameValues = new ArrayList<>(); final String nameConstruct = properties.getUserFullName(); if (StringUtils.isNotEmpty(nameConstruct)) { LOG.debug("UserName: {}", nameConstruct); userNameValues.add(nameConstruct); attributes.add(OpenSAML2ComponentBuilder.getInstance().createAttribute(null, SamlConstants.USERNAME_ATTR, null, userNameValues)); } else { LOG.warn("No information provided to fill in user name attribute"); } if (!attributes.isEmpty()) { statements.addAll(OpenSAML2ComponentBuilder.getInstance().createAttributeStatement(attributes)); } return statements; }
Source:
public void shouldDeleteDiagnosis() { String uuid = "4e663d66-6b78-11e0-93c3-18a905e044dc"; Diagnosis diagnosis = diagnosisDAO.getDiagnosisByUuid(uuid); Assert.assertNotNull(diagnosis); diagnosisDAO.deleteDiagnosis(diagnosis); Assert.assertNull(diagnosisDAO.getDiagnosisByUuid(uuid)); }

Target:
public void shouldDeleteDiagnosis() { String uuid = "4e663d66-6b78-11e0-93c3-18a905e044dc"; Diagnosis diagnosis = diagnosisDAO.getDiagnosisByUuid(uuid); assertNotNull(diagnosis); diagnosisDAO.deleteDiagnosis(diagnosis); assertNull(diagnosisDAO.getDiagnosisByUuid(uuid)); }
Source:
protected void viewerSelectionChanged(SelectionChangedEvent event) { actionBar.updateControls(); }

Target:
protected void viewerSelectionChanged(SelectionChangedEvent event) { if (actionBar != null) { actionBar.updateControls(); } }
Source:
public static Object convertStringToInternalValue(String valStr, DataType type) { if (valStr == null) { return null; } LogicalTypeRoot typeRoot = type.getLogicalType().getTypeRoot(); switch (typeRoot) { case CHAR: case VARCHAR: return StringData.fromString(valStr); case BOOLEAN: return Boolean.parseBoolean(valStr); case TINYINT: return Byte.parseByte(valStr); case SMALLINT: return Short.parseShort(valStr); case INTEGER: return Integer.parseInt(valStr); case BIGINT: return Long.parseLong(valStr); case FLOAT: return Float.parseFloat(valStr); case DOUBLE: return Double.parseDouble(valStr); case DATE: LocalDate date = ISO_LOCAL_DATE.parse(valStr).query(TemporalQueries.localDate()); return (int) date.toEpochDay(); case TIMESTAMP_WITHOUT_TIME_ZONE: return TimestampData.fromLocalDateTime(LocalDateTime.parse(valStr)); default: throw new RuntimeException(String.format( "Can not convert %s to type %s for partition value", valStr, type)); } }

Target:
public static Object convertStringToInternalValue(String valStr, DataType type) { if (valStr == null) { return null; } LogicalTypeRoot typeRoot = type.getLogicalType().getTypeRoot(); switch (typeRoot) { case CHAR: case VARCHAR: return StringData.fromString(valStr); case BOOLEAN: return Boolean.parseBoolean(valStr); case TINYINT: return Byte.parseByte(valStr); case SMALLINT: return Short.parseShort(valStr); case INTEGER: return Integer.parseInt(valStr); case BIGINT: return Long.parseLong(valStr); case FLOAT: return Float.parseFloat(valStr); case DOUBLE: return Double.parseDouble(valStr); case DATE: return (int) LocalDate.parse(valStr).toEpochDay(); case TIMESTAMP_WITHOUT_TIME_ZONE: return TimestampData.fromLocalDateTime(LocalDateTime.parse(valStr)); default: throw new RuntimeException(String.format( "Can not convert %s to type %s for partition value", valStr, type)); } }
Source:
public void testIdentityColumn() throws Exception { if (TestUtil.haveMinimumServerVersion(conn, ServerVersion.v10)) { assumePreparedStatementMetadataSupported(); PreparedStatement pstmt = conn.prepareStatement("SELECT id FROM identitytest"); ResultSet rs = pstmt.executeQuery(); ResultSetMetaData rsmd = pstmt.getMetaData(); Assert.assertTrue(rsmd.isAutoIncrement(1)); } }

Target:
public void testIdentityColumn() throws Exception { assumeMinimumServerVersion(ServerVersion.v10); assumePreparedStatementMetadataSupported(); PreparedStatement pstmt = conn.prepareStatement("SELECT id FROM identitytest"); ResultSet rs = pstmt.executeQuery(); ResultSetMetaData rsmd = pstmt.getMetaData(); Assert.assertTrue(rsmd.isAutoIncrement(1)); }
Source:
private void populateStatus(final List<GlusterGeoRepSessionDetails> details) { final VolumeGeoRepSessionDetailsModel windowModel = new VolumeGeoRepSessionDetailsModel(); windowModel.setHelpTag(HelpTag.geo_replication_status_detail); windowModel.setHashName("geo_replication_status_detail"); final UIConstants constants = ConstantsManager.getInstance().getConstants(); windowModel.setTitle(constants.geoReplicationSessionDetailsTitle()); UICommand okCommand = new UICommand("closeWindow", this); okCommand.setIsCancel(true); okCommand.setTitle(constants.ok()); windowModel.getCommands().add(okCommand); setWindow(windowModel); List<VdcQueryParametersBase> queryParamsList = new ArrayList<VdcQueryParametersBase>(); for(GlusterGeoRepSessionDetails detail : details) { queryParamsList.add(new IdQueryParameters(detail.getMasterBrickId())); } final List<EntityModel<GlusterGeoRepSessionDetails>> detailRows = new ArrayList<>(); for (GlusterGeoRepSessionDetails detail : details) { detailRows.add(new EntityModel<GlusterGeoRepSessionDetails>(detail)); } windowModel.getGeoRepSessionSummary().setItems(detailRows, detailRows.get(0)); }

Target:
private void populateStatus(final List<GlusterGeoRepSessionDetails> details) { final VolumeGeoRepSessionDetailsModel windowModel = new VolumeGeoRepSessionDetailsModel(); windowModel.setHelpTag(HelpTag.geo_replication_status_detail); windowModel.setHashName("geo_replication_status_detail"); final UIConstants constants = ConstantsManager.getInstance().getConstants(); windowModel.setTitle(constants.geoReplicationSessionDetailsTitle()); UICommand okCommand = new UICommand("closeWindow", this); okCommand.setIsCancel(true); okCommand.setTitle(constants.ok()); windowModel.getCommands().add(okCommand); setWindow(windowModel); final List<EntityModel<GlusterGeoRepSessionDetails>> detailRows = new ArrayList<>(); for (GlusterGeoRepSessionDetails detail : details) { detailRows.add(new EntityModel<GlusterGeoRepSessionDetails>(detail)); } windowModel.getGeoRepSessionSummary().setItems(detailRows, detailRows.get(0)); }
Source:
public synchronized boolean containsValuesOfType(Category.Type type) { return values.keySet().stream().anyMatch(e -> e.getType().equals(type)); }

Target:
public boolean containsValuesOfType(Category.Type type) { return values.keySet().stream().anyMatch(e -> e.getType().equals(type)); }
Source:
public TimestampSpec( @JsonProperty("column") String timestampColumn, @JsonProperty("format") String format ) { this.timestampColumn = (timestampColumn == null) ? defaultColumn : timestampColumn.toLowerCase(); this.timestampFormat = format == null ? defaultFormat : format; try { this.timestampConverter = ParserUtils.createTimestampParser(timestampFormat); } catch (ParseException e) { throw Throwables.propagate(e); } }

Target:
public TimestampSpec( @JsonProperty("column") String timestampColumn, @JsonProperty("format") String format ) { this.timestampColumn = (timestampColumn == null) ? defaultColumn : timestampColumn.toLowerCase(); this.timestampFormat = format == null ? defaultFormat : format; this.timestampConverter = ParserUtils.createTimestampParser(timestampFormat); }
Source:
public List<Integer> getIntersectingChildren(long time) { List<Integer> intersectingChildren = new LinkedList<>(); for (int i = 0; i < nbChildren; i++) { if (time >= childStart[i] && time <= childEnd[i]) { intersectingChildren.add(children[i]); } } return intersectingChildren; }

Target:
public List<Integer> getIntersectingChildren(long time) { List<Integer> intersectingChildren = new ArrayList<>(); for (int i = 0; i < nbChildren; i++) { if (time >= childStart[i] && time <= childEnd[i]) { intersectingChildren.add(children[i]); } } return intersectingChildren; }
Source:
private void _add(String fieldName, IonValueLite child) { if(!hasNullFieldName && fieldName == null) hasNullFieldName = true; int size = get_child_count(); add(size, child); if (_field_map != null) { add_field(fieldName, child._elementid()); } }

Target:
private void _add(String fieldName, IonValueLite child) { hasNullFieldName |= fieldName == null; int size = get_child_count(); add(size, child); if (_field_map != null) { add_field(fieldName, child._elementid()); } }
Source:
public void setField(final CheckboxMultipleField field) { this.field = field; if (this.field.isShowLabel()) { TextView label = findViewById(R.id.liferay_ddm_label); label.setText(field.getLabel()); label.setVisibility(VISIBLE); if (this.field.isRequired()) { label.append(ThemeUtil.getRequiredSpannable(getContext())); } } if (this.field.isInline()) { linearLayout.setOrientation(HORIZONTAL); } LayoutParams layoutParams = calculateLayoutParams(this.field.isInline(), this.field.showAsSwitcher()); List<Option> availableOptions = field.getAvailableOptions(); if (field.showAsSwitcher()) { for (Option opt : availableOptions) { Switch switchView = createSwitchView(opt, layoutParams); addView(field, switchView); } } else { for (Option opt : availableOptions) { CheckBox checkBoxView = createCheckBoxView(opt, layoutParams); addView(field, checkBoxView); } } refresh(); }

Target:
public void setField(final CheckboxMultipleField field) { this.field = field; if (field.isShowLabel()) { TextView label = findViewById(R.id.liferay_ddm_label); label.setText(field.getLabel()); label.setVisibility(VISIBLE); if (field.isRequired()) { label.append(ThemeUtil.getRequiredSpannable(getContext())); } } if (field.isInline()) { linearLayout.setOrientation(HORIZONTAL); } LayoutParams layoutParams = calculateLayoutParams(field.isInline(), field.showAsSwitcher()); List<Option> availableOptions = field.getAvailableOptions(); for (Option opt : availableOptions) { if (field.showAsSwitcher()) { Switch switchView = createSwitchView(opt, layoutParams); addView(field, switchView); } else { CheckBox checkBoxView = createCheckBoxView(opt, layoutParams); addView(field, checkBoxView); } } refresh(); }
Source:
public void synchToTime(final TmfTimeSynchSignal signal) { if (signal.getSource() == this || fTrace == null) { return; } final long time = signal.getCurrentTime().normalize(0, ITmfTimestamp.NANOSECOND_SCALE).getValue(); final int selectionValue = getSelectionValue(time); Display.getDefault().asyncExec(new Runnable() { @Override public void run() { if (fTimeGraphCombo.isDisposed()) { return; } fTimeGraphCombo.getTimeGraphViewer().setSelectedTime(time, true); startZoomThread(fTimeGraphCombo.getTimeGraphViewer().getTime0(), fTimeGraphCombo.getTimeGraphViewer().getTime1()); selectEntry(selectionValue); } }); }

Target:
public void synchToTime(final TmfTimeSynchSignal signal) { if (signal.getSource() == this || fTrace == null) { return; } final long time = signal.getCurrentTime().normalize(0, ITmfTimestamp.NANOSECOND_SCALE).getValue(); Display.getDefault().asyncExec(new Runnable() { @Override public void run() { if (fTimeGraphCombo.isDisposed()) { return; } fTimeGraphCombo.getTimeGraphViewer().setSelectedTime(time, true); startZoomThread(fTimeGraphCombo.getTimeGraphViewer().getTime0(), fTimeGraphCombo.getTimeGraphViewer().getTime1()); synchingToTime(time); } }); }
Source:
private void addPutEntriesForDelete(long indexSegmentStartOffset, List<IndexEntry> indexEntries) throws StoreException { Set<StoreKey> seenPuts = new HashSet<>(); List<IndexEntry> newEntries = new ArrayList<>(); for (IndexEntry entry : indexEntries) { IndexValue value = entry.getValue(); if (value.isFlagSet(IndexValue.Flags.Delete_Index)) { if (value.getOriginalMessageOffset() != IndexValue.UNKNOWN_ORIGINAL_MESSAGE_OFFSET && value.getOriginalMessageOffset() != value.getOffset().getOffset() && value.getOriginalMessageOffset() >= indexSegmentStartOffset && !seenPuts.contains(entry.getKey())) { IndexValue originalPutValue = getPutRecordForDeletedKey(entry.getKey(), value); newEntries.add(new IndexEntry(entry.getKey(), originalPutValue)); } } else if (!entry.getValue().isFlagSet(IndexValue.Flags.Ttl_Update_Index)) { seenPuts.add(entry.getKey()); } } indexEntries.addAll(newEntries); indexEntries.sort(KEY_OFFSET_COMPARATOR); }

Target:
private void addPutEntriesForDelete(long indexSegmentStartOffset, List<IndexEntry> indexEntries) throws StoreException { Set<StoreKey> seenPuts = new HashSet<>(); List<IndexEntry> newEntries = new ArrayList<>(); for (IndexEntry entry : indexEntries) { IndexValue value = entry.getValue(); if (value.isFlagSet(IndexValue.Flags.Delete_Index)) { if (value.getOriginalMessageOffset() != IndexValue.UNKNOWN_ORIGINAL_MESSAGE_OFFSET && value.getOriginalMessageOffset() < value.getOffset().getOffset() && value.getOriginalMessageOffset() >= indexSegmentStartOffset && !seenPuts.contains(entry.getKey())) { IndexValue originalPutValue = getPutRecordForDeletedKey(entry.getKey(), value); newEntries.add(new IndexEntry(entry.getKey(), originalPutValue)); } } else if (!entry.getValue().isFlagSet(IndexValue.Flags.Ttl_Update_Index)) { seenPuts.add(entry.getKey()); } } indexEntries.addAll(newEntries); }
Source:
public boolean equals(Object o) { if (!(o instanceof ViolationMessage)) { return false; } ViolationMessage message; message = (ViolationMessage)o; return this.filePath == message.filePath && this.lineNumber == message.lineNumber && this.columnNumber == message.columnNumber && this.classification == message.classification && this.violationMessage == message.violationMessage; }

Target:
public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof ViolationMessage)) return false; ViolationMessage candidateObject = (ViolationMessage) o; return (this.lineNumber == candidateObject.lineNumber) && (this.columnNumber == candidateObject.columnNumber) && (this.filePath.equals(candidateObject.filePath)) && (this.classification.equals(candidateObject.classification)) && (this.violationMessage.equals(candidateObject.violationMessage)); }
Source:
public static ItemStack getFilledBucket(@Nonnull UniversalBucket item, FluidStack fluidStack) { Fluid fluid = fluidStack.getFluid(); if (fluidStack.tag == null || fluidStack.tag.hasNoTags()) { if (fluid == net.minecraftforge.fluids.FluidRegistry.WATER) { return new ItemStack(Items.WATER_BUCKET); } else if (fluid == net.minecraftforge.fluids.FluidRegistry.LAVA) { return new ItemStack(Items.LAVA_BUCKET); } else if (fluid.getName().equals("milk")) { return new ItemStack(Items.MILK_BUCKET); } } if (net.minecraftforge.fluids.FluidRegistry.getBucketFluids().contains(fluid)) { ItemStack bucket = new ItemStack(item); NBTTagCompound tag = new NBTTagCompound(); FluidStack fluidContents = new FluidStack(fluid, item.getCapacity()); fluidContents.writeToNBT(tag); bucket.setTagCompound(tag); return bucket; } return ItemStack.EMPTY; }

Target:
public static ItemStack getFilledBucket(@Nonnull UniversalBucket item, FluidStack fluidStack) { if (net.minecraftforge.fluids.FluidRegistry.getBucketFluids().contains(fluidStack.getFluid())) { ItemStack bucket = new ItemStack(item); NBTTagCompound tag = new NBTTagCompound(); FluidStack fluidContents = new FluidStack(fluidStack.getFluid(), item.getCapacity()); fluidContents.writeToNBT(tag); bucket.setTagCompound(tag); return bucket; } return ItemStack.EMPTY; }
Source:
private GHRepository create() throws IOException, InterruptedException { GHRepository repo = gitHub.createRepository(repoName).create(); for (int attempts = 0; attempts < 5; attempts++) { try { repo = gitHub.getRepository(repo.getFullName()); break; } catch (Exception e) { LOG.info("Waiting for to be created", repo.getFullName()); Thread.sleep(TimeUnit.SECONDS.toMillis(1)); } } LOG.info("GitHub repo has been created", repo.getHtmlUrl()); return repo; }

Target:
private GHRepository create() throws IOException, InterruptedException { GHRepository repo = gitHub.createRepository(repoName).create(); ensureRepositoryCreated(repo); LOG.info("GitHub repo has been created", repo.getHtmlUrl()); return repo; }
Source:
public boolean hasPreview(String xpath) { String srcMT = getMimeType(xpath); if (!Framework.getService(ConfigurationService.class).isBooleanPropertyTrue(ALLOW_ZIP_PREVIEW) && "application/zip".equals(srcMT)) { return false; } MimeTypePreviewer mtPreviewer = getPreviewManager().getPreviewer(srcMT); return mtPreviewer != null || getConversionService().getConverterName(srcMT, "text/html") != null; }

Target:
public boolean hasPreview(String xpath) { String srcMT = getMimeType(xpath); if ("application/zip".equals(srcMT) && !Framework.getService(ConfigurationService.class).isBooleanPropertyTrue(ALLOW_ZIP_PREVIEW)) { return false; } MimeTypePreviewer mtPreviewer = getPreviewManager().getPreviewer(srcMT); return mtPreviewer != null || getConversionService().getConverterName(srcMT, "text/html") != null; }
Source:
public TestGerritTaskEditorPage() { super(getMockEditor()); model = mock(TaskDataModel.class); TaskRepository repository = new TaskRepository(GerritConnector.CONNECTOR_KIND, "mock"); TaskData taskData = new TaskData(new TaskAttributeMapper(repository), GerritConnector.CONNECTOR_KIND, "mock", "mock"); taskData.getRoot().createAttribute(GerritQueryResultSchema.getDefault().BRANCH.getKey()); taskData.getRoot().createAttribute(GerritQueryResultSchema.getDefault().PROJECT.getKey()); taskData.getRoot().createAttribute(GerritQueryResultSchema.getDefault().STATUS.getKey()); when(model.getTaskData()).thenReturn(taskData); when(model.getTaskRepository()).thenReturn(repository); IEditorSite editorSite = mock(IEditorSite.class); IHandlerService service = mock(IHandlerService.class); when(editorSite.getService(IHandlerService.class)).thenReturn(service); TaskEditorInput taskEditorInput = new TaskEditorInput(repository, linkedTask); when(getTaskEditor().getTaskEditorInput()).thenReturn(taskEditorInput); when(taskEditorInput.getTask()).thenReturn(linkedTask); init(editorSite, taskEditorInput); }

Target:
public TestGerritTaskEditorPage() { super(getMockEditor()); model = mock(TaskDataModel.class); TaskData taskData = new TaskData(new TaskAttributeMapper(repository), GerritConnector.CONNECTOR_KIND, "mock", "mock"); taskData.getRoot().createAttribute(GerritQueryResultSchema.getDefault().BRANCH.getKey()); taskData.getRoot().createAttribute(GerritQueryResultSchema.getDefault().PROJECT.getKey()); taskData.getRoot().createAttribute(GerritQueryResultSchema.getDefault().STATUS.getKey()); when(model.getTaskData()).thenReturn(taskData); when(model.getTaskRepository()).thenReturn(repository); IEditorSite editorSite = mock(IEditorSite.class); IHandlerService service = mock(IHandlerService.class); when(editorSite.getService(IHandlerService.class)).thenReturn(service); when(getTaskEditor().getTaskEditorInput()).thenReturn(taskEditorInput); init(editorSite, taskEditorInput); }
Source:
AllocatedEvaluator allocateContainer(String id, int cpu, int mem) { EvaluatorRequest evaluatorRequest = createEvaluatorRequest(cpu, mem); LOG.log(Level.INFO, "Requesting container for executor, id: {0}, mem: {1}, cpu: {2}", new Object[]{id, mem, cpu}); requestor.submit(evaluatorRequest); try { AllocatedEvaluator evaluator = allocatedContainerQ.take(); LOG.log(Level.INFO, "Container {0} is allocated for executor, id: {1}", new Object[]{evaluator.getId(), id}); return evaluator; } catch (InterruptedException e) { LOG.log(Level.WARNING, "Interrupted while waiting for container allocation", e); return null; } }

Target:
AllocatedEvaluator allocateContainer(String id, int cpu, int mem) throws InterruptedException { EvaluatorRequest evaluatorRequest = createEvaluatorRequest(cpu, mem); LOG.log(Level.INFO, "Requesting container for executor, id: {0}, mem: {1}, cpu: {2}", new Object[]{id, mem, cpu}); requestor.submit(evaluatorRequest); AllocatedEvaluator evaluator = allocatedContainerQ.take(); LOG.log(Level.INFO, "Container {0} is allocated for executor, id: {1}", new Object[]{evaluator.getId(), id}); return evaluator; }
Source:
public CompressionOutputStream createOutputStream(OutputStream out) throws IOException { throw new RuntimeException("Not supported"); }

Target:
public CompressionOutputStream createOutputStream(OutputStream out) throws IOException { throw new UnsupportedOperationException("Not supported"); }
Source:
public StaticProfileUtil(Profile profile) { Stereotype ePkg = profile.getAppliedStereotype(EPackage_QNAME); definition = EcoreFactory.eINSTANCE.createEPackage(); if (ePkg != null) { basePackage = (String) profile.getValue(ePkg, EPKG_BASE_PACKAGE); packageName = (String) profile.getValue(ePkg, EPKG_PACKAGE_NAME); definition.setNsPrefix((String) profile.getValue(ePkg, EPKG_NS_PREFIX)); } else { basePackage = null; packageName = null; definition.setNsPrefix(""); } if (profile.getURI() != null) { definition.setNsURI(profile.getURI()); } else if (ePkg != null) { definition.setNsURI((String) profile.getValue(ePkg, EPKG_NS_URI)); } else { definition.setNsURI(""); } }

Target:
public StaticProfileUtil(Profile profile) { Stereotype ePkg = profile.getAppliedStereotype(EPackage_QNAME); definition = EcoreFactory.eINSTANCE.createEPackage(); if (ePkg != null) { basePackage = (String) profile.getValue(ePkg, EPKG_BASE_PACKAGE); packageName = (String) profile.getValue(ePkg, EPKG_PACKAGE_NAME); definition.setNsPrefix((String) profile.getValue(ePkg, EPKG_NS_PREFIX)); } else { basePackage = null; packageName = null; definition.setNsPrefix(""); } String nsURI = null; if (ePkg != null) { nsURI = (String) profile.getValue(ePkg, EPKG_NS_URI); } if (nsURI == null || nsURI.isEmpty()) { nsURI = profile.getURI(); } if (nsURI == null) { nsURI = ""; } definition.setNsURI(nsURI); }
Source:
private List<Column> getChartColumns() { List<Column> chartColumns = new ArrayList<>(metricBucket.size()); for (MetricAvailabilityBucket metricBucket : this.metricBucket) { MetricAvailability metricAvailability = null; if (metricBucket.getValue().equals("NaN")) { metricAvailability = MetricAvailability.from("unknown"); } else if (Float.parseFloat(metricBucket.getValue()) >= .5) { metricAvailability = MetricAvailability.from("up"); } else { metricAvailability = MetricAvailability.from("down"); } float columnValue = getColumnValue(metricAvailability); int columnColor = getColumnColor(metricAvailability); chartColumns.add(new Column(Collections.singletonList(new SubcolumnValue(columnValue, columnColor)))); } return chartColumns; }

Target:
private List<Column> getChartColumns() { List<Column> chartColumns = new ArrayList<>(metricBucket.size()); for (MetricBucket metricBucket : this.metricBucket) { MetricAvailability metricAvailability = null; if (metricBucket.getValue().equals("NaN")) { metricAvailability = MetricAvailability.from("unknown"); } else if (Float.parseFloat(metricBucket.getValue()) >= .5) { metricAvailability = MetricAvailability.from("up"); } else { metricAvailability = MetricAvailability.from("down"); } float columnValue = getColumnValue(metricAvailability); int columnColor = getColumnColor(metricAvailability); chartColumns.add(new Column(Collections.singletonList(new SubcolumnValue(columnValue, columnColor)))); } return chartColumns; }
Source:
protected void registerGetters() { registerFieldGetter(Keys.AGE, ImmutableSpongeAgeableData.this::getAge); registerKeyValue(Keys.AGE, ImmutableSpongeAgeableData.this::age); registerFieldGetter(Keys.BABY, ImmutableSpongeAgeableData.this::isBaby); registerKeyValue(Keys.BABY, ImmutableSpongeAgeableData.this::baby); registerFieldGetter(Keys.ADULT, ImmutableSpongeAgeableData.this::isAdult); registerKeyValue(Keys.ADULT, ImmutableSpongeAgeableData.this::adult); }

Target:
protected void registerGetters() { registerFieldGetter(Keys.AGE, ImmutableSpongeAgeableData.this::getAge); registerKeyValue(Keys.AGE, ImmutableSpongeAgeableData.this::age); registerFieldGetter(Keys.IS_ADULT, ImmutableSpongeAgeableData.this::isAdult); registerKeyValue(Keys.IS_ADULT, ImmutableSpongeAgeableData.this::adult); }
Source:
public void testSameSID() throws Exception { QuorumPeer peer = new QuorumPeer(peers, peerTmpdir[2], peerTmpdir[2], peerClientPort[2], 3, 2, 2000, 2, 2); QuorumCnxManager cnxManager = new QuorumCnxManager(peer); QuorumCnxManager.Listener listener = cnxManager.listener; if (listener != null) { Thread.UncaughtExceptionHandler handler = new Thread.UncaughtExceptionHandler() { @Override public void uncaughtException(Thread th, Throwable ex) { if (ex instanceof RuntimeException) { String msg = ex.getMessage(); LOG.error(msg); Assert.assertEquals("org.apache.zookeeper.server.quorum.QuorumPeerConfig$ConfigException:" + " Appearing duplicate SID: 2", msg); } } }; listener.setUncaughtExceptionHandler(handler); listener.start(); } else { LOG.error("Null listener when initializing cnx manager"); } try (Socket sock = new Socket()) { InetSocketAddress electionAddr = peers.get(peer.getId()).electionAddr; LOG.info("Creating socket connection, host: {}, port: {}", electionAddr.getHostString(), electionAddr.getPort()); sock.connect(electionAddr, 30000); try (DataOutputStream dout = new DataOutputStream(sock.getOutputStream())) { dout.writeLong(peer.getId()); dout.flush(); cnxManager.receiveConnection(sock); } } }

Target:
public void testSameSID() throws Exception { QuorumPeer peer = new QuorumPeer(peers, peerTmpdir[2], peerTmpdir[2], peerClientPort[2], 3, 2, 2000, 2, 2); QuorumCnxManager cnxManager = new QuorumCnxManager(peer); QuorumCnxManager.Listener listener = cnxManager.listener; if (listener != null) { Thread.UncaughtExceptionHandler handler = new Thread.UncaughtExceptionHandler() { @Override public void uncaughtException(Thread th, Throwable ex) { if (ex instanceof RuntimeException) { String msg = ex.getMessage(); LOG.error(msg); Assert.assertEquals("org.apache.zookeeper.server.quorum.QuorumPeerConfig$ConfigException:" + " Duplicate SID 2 found", msg); } } }; listener.setUncaughtExceptionHandler(handler); listener.start(); } else { LOG.error("Null listener when initializing cnx manager"); } try (Socket sock = new Socket()) { InetSocketAddress electionAddr = peers.get(peer.getId()).electionAddr; LOG.info("Creating socket connection, host: {}, port: {}", electionAddr.getHostString(), electionAddr.getPort()); sock.connect(electionAddr, 5000); try (DataOutputStream dout = new DataOutputStream(sock.getOutputStream())) { dout.writeLong(peer.getId()); dout.flush(); cnxManager.receiveConnection(sock); } } }
Source:
protected void doStart() throws Exception { super.doStart(); if (this.taskExecutor == null) { this.taskExecutor = new SimpleAsyncTaskExecutor((getBeanName() == null ? "container" : getBeanName()) + "-"); } this.taskExecutor.execute(new Runnable() { boolean initialized = false; @Override public void run() { while (!initialized) { try { for (int i = 0; i < consumersPerQueue; i++) { for (String queue : getQueueNames()) { Connection connection = getConnectionFactory().createConnection(); Channel channel = connection.createChannel(false); channel.basicQos(prefetch); RabbitUtils.setPhysicalCloseRequired(true); SimpleConsumer consumer = new SimpleConsumer(channel, queue); consumers.add(consumer); channel.basicConsume(queue, consumer); } } } catch (Exception e) { logger.error("Error creating consumer", e); doShutdown(); try { Thread.sleep(5000); } catch (InterruptedException e1) { Thread.currentThread().interrupt(); } continue; } initialized = true; } } }); }

Target:
protected void doStart() throws Exception { super.doStart(); if (this.taskExecutor == null) { this.taskExecutor = new SimpleAsyncTaskExecutor((getBeanName() == null ? "container" : getBeanName()) + "-"); } this.taskExecutor.execute(new Runnable() { boolean initialized = false; @Override public void run() { while (!initialized) { try { for (int i = 0; i < SimpleDirectMessageListenerContainer.this.consumersPerQueue; i++) { for (String queue : getQueueNames()) { Connection connection = getConnectionFactory().createConnection(); Channel channel = connection.createChannel(false); channel.basicQos(SimpleDirectMessageListenerContainer.this.prefetch); RabbitUtils.setPhysicalCloseRequired(true); SimpleConsumer consumer = new SimpleConsumer(channel, queue); SimpleDirectMessageListenerContainer.this.consumers.add(consumer); channel.basicConsume(queue, consumer); } } } catch (Exception e) { logger.error("Error creating consumer", e); doShutdown(); try { Thread.sleep(5000); } catch (InterruptedException e1) { Thread.currentThread().interrupt(); } continue; } initialized = true; } } }); }
Source:
protected boolean amendDiskRequested() { if (getNewDisk().getDiskStorageType() == DiskStorageType.IMAGE && !(getNewDisk().isDiskSnapshot() && ((DiskImage) getNewDisk()).getImage().getVolumeFormat() == VolumeFormat.RAW)) { QcowCompat qcowCompat = ((DiskImage) getNewDisk()).getQcowCompat(); return getDiskImages(getOldDisk().getId()).stream().anyMatch(disk -> disk.isQcowFormat() && disk.getQcowCompat() != qcowCompat); } return false; }

Target:
protected boolean amendDiskRequested() { boolean isBaseSnapshotDisk = getNewDisk().isDiskSnapshot() && ((DiskImage) getNewDisk()).getImage().getVolumeFormat() == VolumeFormat.RAW; if (getNewDisk().getDiskStorageType() == DiskStorageType.IMAGE && !isBaseSnapshotDisk) { QcowCompat qcowCompat = ((DiskImage) getNewDisk()).getQcowCompat(); return getDiskImages(getOldDisk().getId()).stream().anyMatch(disk -> disk.isQcowFormat() && disk.getQcowCompat() != qcowCompat); } return false; }
Source:
public static Trackable searchTrackable(final String geocode) { Log.d("GeokretyConnector.searchTrackable: gkid=" + getId(geocode)); try { final String response = Network.getResponseData(Network.getRequest("<LINK_0>" + getId(geocode))); final InputSource is = new InputSource(); is.setEncoding("UTF-8"); is.setCharacterStream(new StringReader(response)); return GeokretyParser.parse(is).get(0); } catch (Exception e) { Log.w("GeokretyConnector.searchTrackable", e); return null; } }

Target:
public static Trackable searchTrackable(final String geocode) { Log.d("GeokretyConnector.searchTrackable: gkid=" + getId(geocode)); try { final InputStream response = Network.getResponseStream(Network.getRequest("<LINK_0>" + getId(geocode))); final InputSource is = new InputSource(response); return GeokretyParser.parse(is).get(0); } catch (Exception e) { Log.w("GeokretyConnector.searchTrackable", e); return null; } }
Source:
public static IPath getLocationForElement(IJavaElement next) { IResource resource = next.getResource(); if (resource != null) { return resource.getLocation() == null ? new Path("") : resource.getLocation(); } return next.getPath(); }

Target:
public static IPath getLocationForElement(IJavaElement next) { IResource resource = next.getResource(); if (resource != null) { return resource.getLocation() == null ? Path.EMPTY : resource.getLocation(); } return next.getPath(); }
Source:
private void setRedirectCookies(HttpMethod method) { ArrayList<HttpCookie> cookiesToSet = new ArrayList<>(); Header[] setCookieHeaders = method.getResponseHeaders("Set-Cookie"); for (Header setCookieHeader : setCookieHeaders) { try { cookiesToSet.addAll(HttpCookie.parse(setCookieHeader.getValue())); } catch (Exception e) { if (LOG.isDebugEnabled()) LOG.debug("Set-Cookie header: \" " + setCookieHeader.getValue() + " \" is malformed "); } } if (cookiesToSet.isEmpty()) return; redirectCookies.addAll(cookiesToSet); ArrayList<String> cookieNames = new ArrayList<>(); for (HttpCookie cookie : cookiesToSet) { cookieNames.add(cookie.getName()); } Header cookieHeader = method.getRequestHeader("Cookie"); if (cookieHeader != null) { HeaderElement[] cookieElements = cookieHeader.getElements(); for (HeaderElement cookieElement : cookieElements) { String cookieName = cookieElement.getName(); if (!cookieNames.contains(cookieName)) cookiesToSet.add(new HttpCookie(cookieName, cookieElement.getValue())); } } String cookieHeaderValue = ""; for (HttpCookie cookie : cookiesToSet) { cookieHeaderValue += cookie.toString() + "; "; } if (cookieHeaderValue.length() > 2) { cookieHeaderValue = cookieHeaderValue.substring(0, cookieHeaderValue.length() - 2); method.setRequestHeader("Cookie", cookieHeaderValue); } }

Target:
private void setRedirectCookies(HttpMethod method) { ArrayList<HttpCookie> cookiesToSet = new ArrayList<>(); Header[] setCookieHeaders = method.getResponseHeaders(HttpHeader.SET_COOKIE); for (Header setCookieHeader : setCookieHeaders) { try { cookiesToSet.addAll(HttpCookie.parse(setCookieHeader.getValue())); } catch (Exception e) { if (LOG.isDebugEnabled()) LOG.debug("Set-Cookie header: \" " + setCookieHeader.getValue() + " \" is malformed "); } } if (cookiesToSet.isEmpty()) return; redirectCookies.addAll(cookiesToSet); ArrayList<String> cookieNames = new ArrayList<>(); for (HttpCookie cookie : cookiesToSet) { cookieNames.add(cookie.getName()); } Header cookieHeader = method.getRequestHeader(HttpHeader.COOKIE); if (cookieHeader != null) { HeaderElement[] cookieElements = cookieHeader.getElements(); for (HeaderElement cookieElement : cookieElements) { String cookieName = cookieElement.getName(); if (!cookieNames.contains(cookieName)) cookiesToSet.add(new HttpCookie(cookieName, cookieElement.getValue())); } } String cookieHeaderValue = ""; for (HttpCookie cookie : cookiesToSet) { cookieHeaderValue += cookie.toString() + "; "; } if (cookieHeaderValue.length() > 2) { cookieHeaderValue = cookieHeaderValue.substring(0, cookieHeaderValue.length() - 2); method.setRequestHeader(HttpHeader.COOKIE, cookieHeaderValue); } }
Source:
public void testTocProvider() { JavaDocTocProvider provider = new JavaDocTocProvider(); ITocContribution[] contributions = provider .getTocContributions("en_US"); assertTrue(contributions.length > 0); assertTrue(contributions.length == 1); ITocContribution con = contributions[0]; assertEquals(con.getId(), "org.eclipse.linuxtools.javadocs.toc"); assertTrue(con.isPrimary()); assertEquals(con.getCategoryId(), null); assertEquals(con.getLocale(), "en_US"); String[] docs = con.getExtraDocuments(); assertEquals(docs.length, 0); assertTrue(con.getLinkTo().equals("org.eclipse.linuxtools.javadocs/")); assertEquals(con.getContributorId(), "org.eclipse.linuxtools.javadocs"); }

Target:
public void testTocProvider() { JavaDocTocProvider provider = new JavaDocTocProvider(); ITocContribution[] contributions = provider .getTocContributions("en_US"); assertTrue(contributions.length == 1); ITocContribution con = contributions[0]; assertEquals(con.getId(), "org.eclipse.linuxtools.javadocs.toc"); assertTrue(con.isPrimary()); assertEquals(con.getCategoryId(), null); assertEquals(con.getLocale(), "en_US"); String[] docs = con.getExtraDocuments(); assertEquals(docs.length, 0); assertTrue(con.getLinkTo().equals("org.eclipse.linuxtools.javadocs/")); assertEquals(con.getContributorId(), "org.eclipse.linuxtools.javadocs"); }
Source:
void completePlayerSetup(boolean asked) { if (asked) { skinLayout = (OoyalaSkinLayout) findViewById(R.id.ooyalaSkin); PlayerDomain playerDomain = new PlayerDomain(domain); Options.Builder optionBuilder = new Options.Builder().setShowNativeLearnMoreButton(false).setShowPromoImage(false).setUseExoPlayer(true); if(!selectedFormat.equalsIgnoreCase("default")) optionBuilder.setPlayerInfo(new CustomPlayerInfo(selectedFormat)); if(hevcMode.equalsIgnoreCase("HEVCPreferred")) optionBuilder.enableHevc(true); else if(hevcMode.equalsIgnoreCase("HEVCNotPreferred")) optionBuilder.enableHevc(false); Options options = optionBuilder.build(); player = new OoyalaPlayer(pcode, playerDomain, options); if(isStaging) { Log.i(TAG, "Environment Set to Staging:"); OoyalaPlayer.setEnvironment(Environment.EnvironmentType.STAGING, Environment.PROTOCOL_HTTPS); } SkinOptions skinOptions = new SkinOptions.Builder().build(); playerLayoutController = new OoyalaSkinLayoutController(getApplication(), skinLayout, player, skinOptions); playerLayoutController.addObserver(this); player.addObserver(this); @SuppressWarnings("unused") OoyalaFreewheelManager fwManager = new OoyalaFreewheelManager(this, skinLayout.getAdView(), player); if (player.setEmbedCode(embedCode)) { if(autoPlay) player.play(); } } }

Target:
void completePlayerSetup(boolean asked) { if (asked) { skinLayout = (OoyalaSkinLayout) findViewById(R.id.ooyalaSkin); PlayerDomain playerDomain = new PlayerDomain(domain); player = new OoyalaPlayer(pcode, playerDomain, getOptions()); if(isStaging) { Log.i(TAG, "Environment Set to Staging:"); OoyalaPlayer.setEnvironment(Environment.EnvironmentType.STAGING, Environment.PROTOCOL_HTTPS); } else { OoyalaPlayer.setEnvironment(Environment.EnvironmentType.PRODUCTION, Environment.PROTOCOL_HTTPS); } SkinOptions skinOptions = new SkinOptions.Builder().build(); playerLayoutController = new OoyalaSkinLayoutController(getApplication(), skinLayout, player, skinOptions); playerLayoutController.addObserver(this); player.addObserver(this); @SuppressWarnings("unused") OoyalaFreewheelManager fwManager = new OoyalaFreewheelManager(this, skinLayout.getAdView(), player); if (player.setEmbedCode(embedCode)) { if(autoPlay) { player.play(); } } } }
Source:
protected void onDraw(Canvas canvas) { if (mBounds == null) { return; } int width = mBounds.width(); int height = mBounds.height(); if (width == 0 || height == 0) { return; } if (!mCacheValid || width != mCachedWidth || height != mCachedHeight) { if (width == mCachedWidth && height == mCachedHeight) { mCacheBitmap.eraseColor(0); } else { mCacheBitmap.recycle(); mCacheBitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888); mCachedWidth = width; mCachedHeight = height; } Canvas cacheCanvas = new Canvas(mCacheBitmap); if (mMaskDrawable != null) { int sc = cacheCanvas.save(); mMaskDrawable.draw(cacheCanvas); mMaskedPaint.setColorFilter((mDesaturateOnPress && isPressed()) ? mDesaturateColorFilter : null); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { cacheCanvas.saveLayer(mBoundsF, mMaskedPaint); } else { cacheCanvas.saveLayer(mBoundsF, mMaskedPaint, Canvas.ALL_SAVE_FLAG); } super.onDraw(cacheCanvas); cacheCanvas.restoreToCount(sc); } else if (mDesaturateOnPress && isPressed()) { int sc = cacheCanvas.save(); cacheCanvas.drawRect(0, 0, mCachedWidth, mCachedHeight, mBlackPaint); mMaskedPaint.setColorFilter(mDesaturateColorFilter); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { cacheCanvas.saveLayer(mBoundsF, mMaskedPaint); } else { cacheCanvas.saveLayer(mBoundsF, mMaskedPaint, Canvas.ALL_SAVE_FLAG); } super.onDraw(cacheCanvas); cacheCanvas.restoreToCount(sc); } else { super.onDraw(cacheCanvas); } if (mBorderDrawable != null) { mBorderDrawable.draw(cacheCanvas); } } canvas.drawBitmap(mCacheBitmap, mBounds.left, mBounds.top, null); }

Target:
protected void onDraw(Canvas canvas) { if (mBounds == null) { return; } int width = mBounds.width(); int height = mBounds.height(); if (width == 0 || height == 0) { return; } if (!mCacheValid || width != mCachedWidth || height != mCachedHeight) { if (width == mCachedWidth && height == mCachedHeight) { mCacheBitmap.eraseColor(0); } else { mCacheBitmap.recycle(); mCacheBitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888); mCachedWidth = width; mCachedHeight = height; } Canvas cacheCanvas = new Canvas(mCacheBitmap); if (mMaskDrawable != null) { int sc = cacheCanvas.save(); mMaskDrawable.draw(cacheCanvas); mMaskedPaint.setColorFilter((mDesaturateOnPress && isPressed()) ? mDesaturateColorFilter : null); if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP) { saveLayer(cacheCanvas); } else { saveLayerCompat(cacheCanvas); } super.onDraw(cacheCanvas); cacheCanvas.restoreToCount(sc); } else if (mDesaturateOnPress && isPressed()) { int sc = cacheCanvas.save(); cacheCanvas.drawRect(0, 0, mCachedWidth, mCachedHeight, mBlackPaint); mMaskedPaint.setColorFilter(mDesaturateColorFilter); if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP) { saveLayer(cacheCanvas); } else { saveLayerCompat(cacheCanvas); } super.onDraw(cacheCanvas); cacheCanvas.restoreToCount(sc); } else { super.onDraw(cacheCanvas); } if (mBorderDrawable != null) { mBorderDrawable.draw(cacheCanvas); } } canvas.drawBitmap(mCacheBitmap, mBounds.left, mBounds.top, null); }
Source:
protected String getSubsystemXsdPath() throws Exception { return "schema/jboss-as-wise_1_0.xsd"; }

Target:
protected String getSubsystemXsdPath() throws Exception { return "schema/wildfly-wise_1_0.xsd"; }
Source:
public static Map<Integer, ? extends Collection<Tile>> readLaneTiles(final File illuminaRunDirectory, final ReadStructure readStructure, final ValidationStringency validationStringency, final boolean isNovaSeq) { final Collection<Tile> tiles; try { List<File> tileMetricsOutFiles = TileMetricsUtil.findTileMetricsFiles(illuminaRunDirectory, readStructure.totalCycles, isNovaSeq); if (isNovaSeq) { tiles = TileMetricsUtil.parseClusterRecordsFromTileMetricsV3( tileMetricsOutFiles, TileMetricsUtil.renderPhasingMetricsFilesFromBasecallingDirectory(illuminaRunDirectory), readStructure ); } else { tiles = TileMetricsUtil.parseTileMetrics(tileMetricsOutFiles.get(0), readStructure, validationStringency ); } } catch (final FileNotFoundException e) { throw new PicardException("Unable to open laneMetrics file.", e); } return tiles.stream().filter(tile -> tile.getLaneNumber() > 0).collect(Collectors.groupingBy(Tile::getLaneNumber)); }

Target:
public static Map<Integer, ? extends Collection<Tile>> readLaneTiles(final File illuminaRunDirectory, final ReadStructure readStructure, final ValidationStringency validationStringency, final boolean isNovaSeq) { final Collection<Tile> tiles; try { final List<File> tileMetricsOutFiles = TileMetricsUtil.findTileMetricsFiles(illuminaRunDirectory, readStructure.totalCycles, isNovaSeq); if (isNovaSeq) { tiles = TileMetricsUtil.parseClusterRecordsFromTileMetricsV3( tileMetricsOutFiles, TileMetricsUtil.renderPhasingMetricsFilesFromBasecallingDirectory(illuminaRunDirectory), readStructure ); } else { tiles = TileMetricsUtil.parseTileMetrics( tileMetricsOutFiles.get(0), readStructure, validationStringency ); } } catch (final FileNotFoundException e) { throw new PicardException("Unable to open laneMetrics file.", e); } return tiles.stream().filter(tile -> tile.getLaneNumber() > 0).collect(Collectors.groupingBy(Tile::getLaneNumber)); }
Source:
void updateRenderEntireFile() { for (CodeMirror cm : getCms()) { cm.removeKeyMap(RENDER_ENTIRE_FILE_KEYMAP); cm.removeKeyMap(RENDER_ENTIRE_FILE_KEYMAP); if (prefs.renderEntireFile()) { cm.addKeyMap(RENDER_ENTIRE_FILE_KEYMAP); } cm.setOption("viewportMargin", prefs.renderEntireFile() ? POSITIVE_INFINITY : 10); } }

Target:
void updateRenderEntireFile() { boolean entireFile = renderEntireFile(); for (CodeMirror cm : getCms()) { cm.removeKeyMap(RENDER_ENTIRE_FILE_KEYMAP); if (entireFile) { cm.addKeyMap(RENDER_ENTIRE_FILE_KEYMAP); } cm.setOption("viewportMargin", entireFile ? POSITIVE_INFINITY : 10); } }
Source:
static void containsSubset(@NonNull JSONObject subject, @NonNull JSONObject contains) throws JSONException { Iterator<String> iterator = contains.keys(); while (iterator.hasNext()) { String key = iterator.next(); if (contains.get(key) instanceof JSONObject && subject.get(key) instanceof JSONObject) equals((JSONObject) contains.get(key), (JSONObject) subject.get(key)); else assertEquals( normalizeType(contains.get(key)), normalizeType(subject.get(key)) ); } }

Target:
static void containsSubset(@NonNull JSONObject subject, @NonNull JSONObject contains) throws JSONException { Iterator<String> iterator = contains.keys(); while (iterator.hasNext()) { String key = iterator.next(); if (contains.get(key) instanceof JSONObject && subject.get(key) instanceof JSONObject) equals(contains.getJSONObject(key), subject.getJSONObject(key)); else assertEquals( normalizeType(contains.get(key)), normalizeType(subject.get(key)) ); } }