auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void should_create_issue_pom_xml() { <START> assumeTrue(orchestrator.getServer().version().isGreaterThanOrEquals(6, 3)); <END> orchestrator.getServer().restoreProfile(FileLocation.ofClasspath("/profile-pom-xml.xml")); orchestrator.getServer().provisionProject("org.sonarsource.java:test-project", "Test Project"); orchestrator.getServer().associateProjectToQualityProfile("org.sonarsource.java:test-project", "java", "java-pom-xml"); MavenBuild build = MavenBuild.create() .setPom(TestUtils.projectPom("pom-xml")) .setCleanPackageSonarGoals(); orchestrator.executeBuild(build); IssueClient issueClient = orchestrator.getServer().wsClient().issueClient(); List<Issue> issues = issueClient.find(IssueQuery.create().components("org.sonarsource.java:test-project:pom.xml")).list(); assertThat(issues).hasSize(1); assertThat(issues.iterator().next().ruleKey()).isEqualTo("squid:S3423"); }</code><technical_language>drop line altogether in fact..</technical_language>

Target:
public void should_create_issue_pom_xml() { orchestrator.getServer().restoreProfile(FileLocation.ofClasspath("/profile-pom-xml.xml")); orchestrator.getServer().provisionProject("org.sonarsource.java:test-project", "Test Project"); orchestrator.getServer().associateProjectToQualityProfile("org.sonarsource.java:test-project", "java", "java-pom-xml"); MavenBuild build = MavenBuild.create() .setPom(TestUtils.projectPom("pom-xml")) .setCleanPackageSonarGoals(); orchestrator.executeBuild(build); IssueClient issueClient = orchestrator.getServer().wsClient().issueClient(); List<Issue> issues = issueClient.find(IssueQuery.create().components("org.sonarsource.java:test-project:pom.xml")).list(); assertThat(issues).hasSize(1); assertThat(issues.iterator().next().ruleKey()).isEqualTo("squid:S3423"); }
Source:
<code>private boolean hasEnoughNumberOfSpecialChars(String value) { int numberOfSpecialChars = 0; for (char c : value.toCharArray()) { if (SPECIAL_CHARS.contains(c)) { numberOfSpecialChars++; } } <START> return numberOfSpecialChars >= 2; <END> }</code><technical_language>return loop this var is greater 2. do get rid of set a switch : for () { switch(c) { case '+': case '*': case '{': nb++; break; } if(nb == 2) return true; } return false;</technical_language>

Target:
private boolean hasEnoughNumberOfSpecialChars(String value) { int numberOfSpecialChars = 0; for (char c : value.toCharArray()) { if (SPECIAL_CHARS.contains(c)) { numberOfSpecialChars++; } if (numberOfSpecialChars == 2) { return true; } } return false; }
Source:
<code>public Set<String> getKnoxGatewayGroups(Stack stack) { <START> LOGGER.info("Fetching list of instance groups with Knox gateway installed"); <END> Set<String> groupNames = new HashSet<>(); Cluster cluster = stack.getCluster(); if (cluster != null) { CmTemplateProcessor cmTemplateProcessor = new CmTemplateProcessor(cluster.getBlueprint().getBlueprintText()); Map<String, Set<ServiceComponent>> components = cmTemplateProcessor.getServiceComponentsByHostGroup(); LOGGER.info("Checking if Knox gateway is explicitly defined"); groupNames = components.entrySet().stream() .filter(e -> e.getValue().stream().anyMatch(c -> KnoxRoles.KNOX_GATEWAY.equals(c.getComponent()))) .map(Map.Entry::getKey) .collect(Collectors.toSet()); } if (groupNames.isEmpty()) { LOGGER.info("Knox gateway is not explicitly defined; searching for CM gateway hosts"); groupNames = stack.getInstanceGroups().stream() .filter(i -> InstanceGroupType.isGateway(i.getInstanceGroupType())) .map(InstanceGroup::getGroupName) .collect(Collectors.toSet()); } if (groupNames.isEmpty()) { LOGGER.info("No Knox gateway instance groups found"); } return groupNames; }</code><technical_language>if cluster is null</technical_language>

Target:
public Set<String> getKnoxGatewayGroups(Stack stack) { LOGGER.info("Fetching list of instance groups with Knox gateway installed"); Set<String> groupNames = new HashSet<>(); Cluster cluster = stack.getCluster(); if (cluster != null) { LOGGER.debug("Checking if Knox gateway is explicitly defined"); CmTemplateProcessor cmTemplateProcessor = new CmTemplateProcessor(cluster.getBlueprint().getBlueprintText()); groupNames = cmTemplateProcessor.getHostGroupsWithComponent(KnoxRoles.KNOX_GATEWAY); } if (groupNames.isEmpty()) { LOGGER.info("Knox gateway is not explicitly defined; searching for CM gateway hosts"); groupNames = stack.getInstanceGroups().stream() .filter(i -> InstanceGroupType.isGateway(i.getInstanceGroupType())) .map(InstanceGroup::getGroupName) .collect(Collectors.toSet()); } if (groupNames.isEmpty()) { LOGGER.info("No Knox gateway instance groups found"); } return groupNames; }
Source:
<code>private String getHTML(Alert alert) { StringBuilder httpMessage = new StringBuilder(); HttpMessage message = alert.getMessage(); if (message == null) { <START> LOGGER.warn(String.format(Constant.messages.getString("codedx.error.httpMessage"), alert.getAlertId())); <END> return httpMessage.toString(); } String requestHeader = message.getRequestHeader().toString(); String requestBody = message.getRequestBody().toString(); String responseHeader = message.getResponseHeader().toString(); String responseBody = message.getResponseBody().toString(); httpMessage.append("<requestdata>"); httpMessage.append(ReportGenerator.entityEncode(requestHeader)); httpMessage.append(ReportGenerator.entityEncode(requestBody)); httpMessage.append("\n</requestdata>\n"); httpMessage.append("<responsedata>"); httpMessage.append(ReportGenerator.entityEncode(responseHeader)); httpMessage.append(ReportGenerator.entityEncode(responseBody)); httpMessage.append("\n</responsedata>\n"); return httpMessage.toString(); }</code><technical_language>@kingthorin suggesting Constant.messages.getString("codedx.error.httpMessage", alert.getAlertId()) require extra formatting caller</technical_language>

Target:
private String getHTML(Alert alert) { StringBuilder httpMessage = new StringBuilder(); HttpMessage message = alert.getMessage(); if (message == null) { LOGGER.warn(Constant.messages.getString("codedx.error.httpMessage", alert.getAlertId())); return httpMessage.toString(); } String requestHeader = message.getRequestHeader().toString(); String requestBody = message.getRequestBody().toString(); String responseHeader = message.getResponseHeader().toString(); String responseBody = message.getResponseBody().toString(); httpMessage.append("<requestdata>"); httpMessage.append(ReportGenerator.entityEncode(requestHeader)); httpMessage.append(ReportGenerator.entityEncode(requestBody)); httpMessage.append("\n</requestdata>\n"); httpMessage.append("<responsedata>"); httpMessage.append(ReportGenerator.entityEncode(responseHeader)); httpMessage.append(ReportGenerator.entityEncode(responseBody)); httpMessage.append("\n</responsedata>\n"); return httpMessage.toString(); }
Source:
<code><START> private byte[] marshall(final ActorMapping model) throws XmlParseException { <END> try (ByteArrayOutputStream baos = new ByteArrayOutputStream()){ final JAXBContext contextObj = JAXBContext.newInstance(model.getClass()); final Marshaller m = contextObj.createMarshaller(); m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); m.marshal(model, baos); return baos.toByteArray(); } catch (JAXBException| IOException e){ throw new XmlParseException("Failed to serialize the ActorMapping",e); } }</code><technical_language>marshal is parse, IOExceptions</technical_language>

Target:
private byte[] marshall(final ActorMapping model) throws XmlMarshallException { try (ByteArrayOutputStream baos = new ByteArrayOutputStream()) { final JAXBContext contextObj = JAXBContext.newInstance(model.getClass()); final Marshaller m = contextObj.createMarshaller(); m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); m.marshal(model, baos); return baos.toByteArray(); } catch (JAXBException | IOException e) { throw new XmlMarshallException("Failed to serialize the ActorMapping", e); } }
Source:
<code>private static int bufferPadding(int numBytes) { <START> if (numBytes == 3) { <END> return Ints.BYTES - numBytes; } else { return 0; } }</code><technical_language>magic number explained some more (why 3)? more preferably show calculated in a static constant</technical_language>

Target:
private static int bufferPadding(int numBytes) { switch (numBytes) { case Shorts.BYTES: case 1: return 0; default: return Ints.BYTES - numBytes; } }
Source:
<code><START> protected InterProcessMutex(CuratorFramework client, String path, LockInternalsDriver driver) <END> { this(client, path, LOCK_NAME, 1, driver); }</code><technical_language>This private. Is a reason protected</technical_language>

Target:
public InterProcessMutex(CuratorFramework client, String path, LockInternalsDriver driver) { this(client, path, LOCK_NAME, 1, driver); }
Source:
<code>public Map<MetricEntity, MetricSummaryValueEntity> getMetricSummary(Collection<MetricEntity> metrics) { <START> Set<MetricNameDto> metricNameDtoList = new HashSet<MetricNameDto>(); <END> Map<MetricNameDto,MetricEntity> matchMap = new HashMap<MetricNameDto, MetricEntity>(); for (MetricEntity metric : metrics) { if (metric.isSummaryAvailable()) { metricNameDtoList.add(metric.getMetricNameDto()); matchMap.put(metric.getMetricNameDto(),metric); } } List<MetricDto> metricDtoList = databaseService.getSummaryByMetricNameDto(metricNameDtoList); Map<MetricEntity,MetricSummaryValueEntity> result = new HashMap<MetricEntity,MetricSummaryValueEntity>(); for (MetricDto metricDto : metricDtoList) { MetricEntity metricEntity = matchMap.get(metricDto.getMetricName()); MetricSummaryValueEntity value = new MetricSummaryValueEntity(); value.setValue(Double.parseDouble(metricDto.getValues().iterator().next().getValue())); value.setDecision(metricDto.getValues().iterator().next().getDecision()); result.put(metricEntity,value); } return result; }</code><technical_language>metricNameDtoSet</technical_language>

Target:
public Map<MetricEntity, MetricSummaryValueEntity> getMetricSummary(Collection<MetricEntity> metrics) { Set<MetricNameDto> metricNameDtoSet = new HashSet<MetricNameDto>(); Map<MetricNameDto,MetricEntity> matchMap = new HashMap<MetricNameDto, MetricEntity>(); for (MetricEntity metric : metrics) { if (metric.isSummaryAvailable()) { metricNameDtoSet.add(metric.getMetricNameDto()); matchMap.put(metric.getMetricNameDto(),metric); } } Collection<SummarySingleDto> metricDtoList = databaseService.getSummaryByMetricNameDto(metricNameDtoSet).values(); Map<MetricEntity,MetricSummaryValueEntity> result = new HashMap<MetricEntity,MetricSummaryValueEntity>(); for (SummarySingleDto metricDto : metricDtoList) { MetricEntity metricEntity = matchMap.get(metricDto.getMetricName()); MetricSummaryValueEntity value = new MetricSummaryValueEntity(); value.setValue(Double.parseDouble(metricDto.getValues().iterator().next().getValue())); value.setDecision(metricDto.getValues().iterator().next().getDecision()); result.put(metricEntity,value); } return result; }
Source:
<code>private void setRawTargets(PlanContext context, Target[] targets, String[] referenceNames, Projection projection) throws PlanningException { LogicalPlan plan = context.plan; QueryBlock block = context.queryBlock; Target rawTargets = new Target[projection.getNamedExprs().length]; for (int i = 0; i < projection.getNamedExprs().length; i++) { NamedExpr namedExpr = projection.getNamedExprs()[i]; <START> EvalNode evalNode = exprAnnotator.createEvalNode(plan, block, namedExpr.getExpr(), <END> NameResolvingMode.SUBEXPRS_AND_RELS); rawTargets[i] = new Target(evalNode, referenceNames[i]); } block.setRawTargets(rawTargets); }</code><technical_language>In setRawTargets(), raw expressions instead of references. So, resolving level set RELS_ONLY. If I misunderstand, please know. Thanks</technical_language>

Target:
private void setRawTargets(PlanContext context, Target[] targets, String[] referenceNames, Projection projection) throws PlanningException { LogicalPlan plan = context.plan; QueryBlock block = context.queryBlock; Target rawTargets = new Target[projection.getNamedExprs().length]; for (int i = 0; i < projection.getNamedExprs().length; i++) { NamedExpr namedExpr = projection.getNamedExprs()[i]; EvalNode evalNode = exprAnnotator.createEvalNode(plan, block, namedExpr.getExpr(), NameResolvingMode.RELS_AND_SUBEXPRS); rawTargets[i] = new Target(evalNode, referenceNames[i]); } block.setRawTargets(rawTargets); }
Source:
<code>public PrometheusMetricsTrackerFactory(CollectorRegistry registry) { if (globalCollector == null) { synchronized (PrometheusMetricsTrackerFactory.class) { if (globalCollector == null) { globalCollector = new HikariCPCollector(); } } <START> } <END> this.registry = registry; this.collector = globalCollector.register(registry); }</code><technical_language>[Broken Double-checked locking](<LINK_0> pattern</technical_language>

Target:
public PrometheusMetricsTrackerFactory(CollectorRegistry registry) { checkGlobalCollector(); this.registry = registry; this.collector = globalCollector.register(registry); }
Source:
<code>public Object execute(ExecutionEvent event) throws ExecutionException { IResource[] resources = getSelectedResources(event); repo = getRepository(true, event); fileListReturned = new HashSet<String>(); if (repo == null) return null; if (resources.length == 0) return null; CleanOperation op = new CleanOperation(resources); Set<String> fileList = op.dryRun(); ListSelectionDialog dialog = new ListSelectionDialog( getShell(event), fileList, new ArrayContentProvider(), new ItemLabelProvider(), UIText.CleanDialog_HeaderMessage ); dialog.setTitle(UIText.CleanDialog_TitleMessage); if (dialog.open() != IDialogConstants.OK_ID) return null; <START> for (int i = 0; i < dialog.getResult().length; i++) { <END> fileListReturned.add(dialog.getResult()[i].toString()); } JobUtil.scheduleUserJob(op.setPaths(fileListReturned), "Clean", JobFamilies.CLEAN); try { ResourcesPlugin.getWorkspace().getRoot().refreshLocal( IResource.DEPTH_INFINITE, null); } catch (CoreException e) { e.printStackTrace(); } return null; }</code><technical_language>curly brackets line statements</technical_language>

Target:
public Object execute(ExecutionEvent event) throws ExecutionException { IResource[] resources = getSelectedResources(event); repo = getRepository(true, event); fileListReturned = new HashSet<String>(); if (repo == null) return null; if (resources.length == 0) return null; CleanOperation op = new CleanOperation(resources); Set<String> fileList = op.dryRun(); ListSelectionDialog dialog = new ListSelectionDialog( getShell(event), fileList, new ArrayContentProvider(), new ItemLabelProvider(), UIText.CleanDialog_HeaderMessage ); dialog.setTitle(UIText.CleanDialog_TitleMessage); if (dialog.open() != IDialogConstants.OK_ID) return null; for (int i = 0; i < dialog.getResult().length; i++) fileListReturned.add(dialog.getResult()[i].toString()); JobUtil.scheduleUserJob(op.setPaths(fileListReturned), "Clean", JobFamilies.CLEAN); try { ResourcesPlugin.getWorkspace().getRoot().refreshLocal( IResource.DEPTH_INFINITE, null); } catch (CoreException e) { Activator.getDefault().getLog().log( new org.eclipse.core.runtime.Status( IStatus.INFO, Activator.getPluginId(), IStatus.ERROR, e.getMessage(), e ) ); } return null; }
Source:
<code><START> public List<Encounter> getEncountersModifiedOnOrAfter(@Nullable Date date) { <END> return dao.getEncountersModifiedOnOrAfter(date); }</code><technical_language>wondering -- is this return iterator, if want return page of 100 results do fetching entire list? stuck list Criteria offers other option</technical_language>

Target:
public List<Encounter> getEncountersModifiedOnOrAfter(@Nullable Date date) { return dao.getEncountersCreatedAtOrAfter(date); }
Source:
<code>public void keepCurrentState(Item item) { scheduler.schedule(() -> { constructAndSendEvents(item, item.getState()); <START> }, 200, TimeUnit.MILLISECONDS); <END> }</code><technical_language>200ms a bit tight, for 300ms for UI related feedback</technical_language>

Target:
public void keepCurrentState(Item item) { scheduler.schedule(() -> { constructAndSendEvents(item, item.getState()); }, REVERT_INTERVAL, TimeUnit.MILLISECONDS); }
Source:
<code><START> public SearchScrollRequestBuilder prepareSearchScroll(String scrollId) <END> { return client.prepareSearchScroll(scrollId).setScroll(new TimeValue(scrollTime.toMillis())); }</code><technical_language>a StringBuilder overkill is a single concat, do .setPreference("_shards:" + shard)</technical_language>

Target:
public SearchScrollRequestBuilder prepareSearchScroll(String scrollId) { return client.prepareSearchScroll(scrollId).setScroll(new TimeValue(scrollTimeout.toMillis())); }
Source:
<code><START> public void setBackupBuffer(final StreamingStateEncoding<?> stateEncoding) { <END> StreamingState state = null; if (stateEncoding instanceof KeepMinValueStateEncoding) { state = new KeepMinValue(((KeepMinValueStateEncoding) stateEncoding).keyColIndices, ((KeepMinValueStateEncoding) stateEncoding).valueColIndices); } else if (stateEncoding instanceof KeepAndSortOnMinValueStateEncoding) { state = new KeepAndSortOnMinValue(((KeepAndSortOnMinValueStateEncoding) stateEncoding).keyColIndices, ((KeepAndSortOnMinValueStateEncoding) stateEncoding).valueColIndices); } else if (stateEncoding instanceof DupElimStateEncoding) { state = new DupElim(); } else if (stateEncoding instanceof SimpleAppenderStateEncoding) { state = new SimpleAppender(); } else { state = new CountFilter(((CountFilterStateEncoding) stateEncoding).threshold, ((CountFilterStateEncoding) stateEncoding).keyColIndices); } List<StreamingState> states = new ArrayList<StreamingState>(); for (int i = 0; i < outputIDs.length; i++) { states.add(i, state.newInstanceFromMyself()); } setStreamingStates(states); }</code><technical_language>Is extend StreamingStateEncoding abstract getStreamingState() method delegates constructing StreamingState StreamingStateEncoding subclass</technical_language>

Target:
public void setBackupBuffer(final StreamingStateEncoding<?> stateEncoding) { List<StreamingState> states = new ArrayList<StreamingState>(); for (int i = 0; i < outputIDs.length; i++) { states.add(i, stateEncoding.construct().duplicate()); } setStreamingStates(states); }
Source:
<code>public Document generate(final DocumentTemplate docTemplate, final Object documentVersion) { if (false == handles(docTemplate)) { Activator.log.warn(NLS.bind("The generator {0} is not able to create the document structure for {1}.", getClass().getSimpleName(), docTemplate.toString())); return null; } final List<AbstractTemplateToStructureMapper<?>> mappers = Template2StructureRegistry.INSTANCE.getMappers(docTemplate); if (mappers.isEmpty()) { return null; } final IMappingService service = new TemplateToStructureMappingService(mappers); final List<Document> result = service.map(docTemplate, null, Document.class); if (result.isEmpty()) { return null; } Assert.isTrue(result.size() >= 1, "The generation contains more than one object as result"); final EObject res = result.iterator().next(); Assert.isTrue(res instanceof Document, "The result of the transformation is not Document."); final Document generatedDocument = (Document) res; if (documentVersion instanceof String) { generatedDocument.setVersion(createVersionFromString((String) documentVersion)); } else if (documentVersion instanceof Version) { generatedDocument.setVersion((Version) documentVersion); } if (null != documentVersion) { <START> updateGeneratedDocumentName(generatedDocument); <END> } return generatedDocument; }</code><technical_language>call in previous conditions blocks</technical_language>

Target:
public Document generate(final DocumentTemplate docTemplate, final Object documentVersion) { if (false == handles(docTemplate)) { Activator.log.warn(NLS.bind("The generator {0} is not able to create the document structure for {1}.", getClass().getSimpleName(), docTemplate.toString())); return null; } final List<AbstractTemplateToStructureMapper<?>> mappers = Template2StructureRegistry.INSTANCE.getMappers(docTemplate); if (mappers.isEmpty()) { return null; } final IMappingService service = new TemplateToStructureMappingService(mappers); final List<Document> result = service.map(docTemplate, null, Document.class); if (result.isEmpty()) { return null; } Assert.isTrue(result.size() >= 1, "The generation contains more than one object as result"); final EObject res = result.iterator().next(); Assert.isTrue(res instanceof Document, "The result of the transformation is not Document."); final Document generatedDocument = (Document) res; if (null != documentVersion) { if (documentVersion instanceof String) { generatedDocument.setVersion(createVersionFromString((String) documentVersion)); } else if (documentVersion instanceof Version) { generatedDocument.setVersion((Version) documentVersion); } updateGeneratedDocumentName(generatedDocument); } return generatedDocument; }
Source:
<code><START> private boolean vmNotInStatusExists(VMStatus status) { <END> for (VM vm : getVmList()) { if (vm.getStatus() != status) return true; } return false; }</code><technical_language>this method return false, if does, please show that, a bug else need fixed urgently</technical_language>

Target:
private boolean vmNotInStatusExists(VMStatus status) { for (VM vm : getVmList()) { VM vmInDb = getVmDAO().get(vm.getId()); if (vmInDb != null && vmInDb.getStatus() != status) return true; } return false; }
Source:
<code>public void afterPropertiesSet() { Path[] directoryPaths = new Path[] { <START> this.cacheDirectory.resolve("bin"), <END> this.cacheDirectory.resolve("gamedata") }; try { for (Path directoryPath : directoryPaths) { Files.createDirectories(directoryPath); Files.walk(directoryPath).forEach(this::deleteCachedFileIfNeeded); } } catch (IOException e) { e.printStackTrace(); } }</code><technical_language>This hard coded</technical_language>

Target:
public void afterPropertiesSet() { Path cacheDirectory = preferencesService.getFeaturedModCachePath(); if (!Files.isDirectory(cacheDirectory)) { try { Files.createDirectories(cacheDirectory); } catch (IOException e) { log.error("Could not create Featured Mod Cache directory in ''{}''", cacheDirectory); throw new RuntimeException(MessageFormat.format("Could not create Featured Mod Cache directory in ''{}''." + " You might have to delete it or check if the needed permission are given.", cacheDirectory)); } } cleanUnusedFilesFromCache(); }
Source:
<code>public BodyPart addPart(BodyPart bodyPart) { <START> BodyPart temp = bodyPart; <END> try { Multipart multipart = getMultipart(); multipart.addBodyPart(bodyPart); } catch (Exception e) { setError(e); temp = null; } return temp; }</code><technical_language>I prefer naming variables represent. In this case for example: returnedBodyPart result</technical_language>

Target:
public void addPart(BodyPart bodyPart) { addPart(null, bodyPart); }
Source:
<code>public Integrator(final File ditaDir) { this.ditaDir = ditaDir; <START> workspace = Configuration.workspace != null ? Configuration.workspace : ditaDir; <END> pluginTable = new HashMap<>(16); descSet = new HashSet<>(16); loadedPlugin = new HashSet<>(16); featureTable = new Hashtable<>(16); extensionPoints = new HashSet<>(); try { final SAXParserFactory parserFactory = SAXParserFactory.newInstance(); parserFactory.setNamespaceAware(true); reader = parserFactory.newSAXParser().getXMLReader(); } catch (final Exception e) { throw new RuntimeException("Failed to initialize XML parser: " + e.getMessage(), e); } reader.setErrorHandler(new ErrorHandler() { @Override public void error(final SAXParseException e) throws SAXException { throw e; } @Override public void fatalError(final SAXParseException e) throws SAXException { throw e; } @Override public void warning(final SAXParseException e) throws SAXException { throw e; } }); parser = new PluginParser(ditaDir); pluginsDoc = XMLUtils.getDocumentBuilder().newDocument(); pluginList = getPluginIds(readPlugins()); }</code><technical_language>I guess workspace Optional<File> in Configuration do orElse simplify code in other places, too? place used, though, work - a thought</technical_language>

Target:
public Integrator(final File ditaDir) { this.ditaDir = ditaDir; workspace = Configuration.workspace.orElse(ditaDir); pluginTable = new HashMap<>(16); templateSet = new HashMap<>(16); descSet = new HashSet<>(16); loadedPlugin = new HashSet<>(16); featureTable = new Hashtable<>(16); extensionPoints = new HashSet<>(); try { final SAXParserFactory parserFactory = SAXParserFactory.newInstance(); parserFactory.setNamespaceAware(true); reader = parserFactory.newSAXParser().getXMLReader(); } catch (final Exception e) { throw new RuntimeException("Failed to initialize XML parser: " + e.getMessage(), e); } reader.setErrorHandler(new ErrorHandler() { @Override public void error(final SAXParseException e) throws SAXException { throw e; } @Override public void fatalError(final SAXParseException e) throws SAXException { throw e; } @Override public void warning(final SAXParseException e) throws SAXException { throw e; } }); parser = new PluginParser(ditaDir); pluginsDoc = XMLUtils.getDocumentBuilder().newDocument(); pluginList = getPluginIds(readPlugins()); }
Source:
<code>public static @Nullable String getLocalIpv4HostAddress() { <START> return new NetUtil().getPrimaryIpv4HostAddress(); <END> }</code><technical_language>In this case, user's configured primaryAddress account. This meet expectations..</technical_language>

Target:
public static @Nullable String getLocalIpv4HostAddress() { return new NetUtil().getPrimaryHostAddress(); }
Source:
<code>private void assertTag(Project.NameKey project, String branch, String tagName) throws IOException { Repository r = repoManager.openRepository(project); try { <START> RevWalk rw = new RevWalk(r); <END> try { ObjectId headCommit = r.getRef(branch).getObjectId(); ObjectId taggedCommit = r.getRef(tagName).getObjectId(); assertEquals(headCommit, taggedCommit); } finally { rw.release(); } } finally { r.close(); } }</code><technical_language>Is this RevWalk used? ObjectReader released r.close(), I this try { } finally block is needed</technical_language>

Target:
private void assertTag(Project.NameKey project, String branch, String tagName) throws IOException { Repository r = repoManager.openRepository(project); try { ObjectId headCommit = r.getRef(branch).getObjectId(); ObjectId taggedCommit = r.getRef(tagName).getObjectId(); assertEquals(headCommit, taggedCommit); } finally { r.close(); } }
Source:
<code>private String assembleEntityQuery(final boolean count) { String typeKey = template.getConverter().getTypeKey(); String typeValue = template.support().getJavaNameForEntity(domainType); final StringBuilder statement = new StringBuilder(); StringBasedN1qlQueryParser.N1qlSpelValues n1ql = StringBasedN1qlQueryParser.createN1qlSpelValues( template.getBucketName(), typeKey, typeValue, count ); if(query.hasInlineN1qlQuery()) { query.appendInlineN1qlStatement(statement); } else { query.appendString(statement,n1ql.selectEntity); } query.appendWhereString(statement,n1ql.filter); int[] paramIndexPtr=null; JsonValue params=query.getParameters(); if(params instanceof JsonArray) { if(query.hasInlineN1qlQuery()) { paramIndexPtr = new int[] { ((JsonArray) params).size() }; } else { paramIndexPtr = new int[] { 0 }; } } else { paramIndexPtr = new int[]{-1}; } <START> if(!query.hasInlineN1qlQuery()) END> paramIndexPtr = null; query.appendWhere(statement, paramIndexPtr); query.appendSort(statement); query.appendSkipAndLimit(statement); return statement.toString(); }</code><technical_language>code formatting is (also please single line blocks)</technical_language>

Target:
private String assembleEntityQuery(final boolean count) { return query.toN1qlString(template, this.domainType, count); }
Source:
<code>protected Event createSelectionEvent(int stateMask) { int stateMaskSelection = <START> SWT.getPlatform().equals("win32") ? <END> stateMask | SWT.BUTTON1 : stateMask; Event event = super.createSelectionEvent(stateMaskSelection); event.item = widget; return event; }</code><technical_language>ORing BUTTON1 for macOS also</technical_language>

Target:
protected Event createSelectionEvent(int stateMask) { int stateMaskSelection = SWT.getPlatform().equals("gtk") ? stateMask : stateMask | SWT.BUTTON1; Event event = super.createSelectionEvent(stateMaskSelection); event.item = widget; return event; }
Source:
<code>public void onError(Throwable e) { if (done) { RxJavaPlugins.onError(e); return; } <START> value = null; <END> actual.onError(e); }</code><technical_language>needs done=true</technical_language>

Target:
public void onError(Throwable e) { if (done) { RxJavaPlugins.onError(e); return; } done = true; value = null; actual.onError(e); }
Source:
<code><START> private StompFrame transformToMessage(StompFrame sendFrame, StompSubscription subscription) { <END> StompFrame messageFrame = new DefaultStompFrame(StompCommand.MESSAGE, sendFrame.content().retainedDuplicate()); String id = UUID.randomUUID().toString(); messageFrame.headers() .set(MESSAGE_ID, id) .set(SUBSCRIPTION, subscription.id()); return messageFrame; }</code><technical_language>static</technical_language>

Target:
private static StompFrame transformToMessage(StompFrame sendFrame, StompSubscription subscription) { StompFrame messageFrame = new DefaultStompFrame(StompCommand.MESSAGE, sendFrame.content().retainedDuplicate()); String id = UUID.randomUUID().toString(); messageFrame.headers() .set(MESSAGE_ID, id) .set(SUBSCRIPTION, subscription.id()) .set(CONTENT_LENGTH, Integer.toString(messageFrame.content().readableBytes())); CharSequence contentType = sendFrame.headers().get(CONTENT_TYPE); if (contentType != null) { messageFrame.headers().set(CONTENT_TYPE, contentType); } return messageFrame; }
Source:
<code>public void testGetCoordinateDataFilterOptions() throws Exception { Resolver resolver = cn.getResolver(); final StringBuffer filterCalls = new StringBuffer(); Resolver.CoordinateDataFilter filter = new Resolver.CoordinateDataFilter() { @Override public boolean includeCell(final String datacenter) {; filterCalls.append(datacenter + ":"); return true; } @Override <START> public boolean includeUser(final String user) { <END> filterCalls.append(user + ":"); return true; } @Override public boolean includeService(final String service) { filterCalls.append(service + ":"); return true; } @Override public boolean includeEndpointname(final String endpointName) { return endpointName.equals("foo"); } @Override public boolean includeServiceState(final ServiceState state) { return state == ServiceState.RUNNING; } }; Set<Endpoint> endpoints = resolver.getEndpoints(filter); assertEquals(1, endpoints.size()); Endpoint selectedEndpoint = endpoints.iterator().next(); assertEquals("foo", selectedEndpoint.getName()); assertEquals("cell:user:service:", filterCalls.toString()); }</code><technical_language>double space</technical_language>

Target:
public void testGetCoordinateDataFilterOptions() throws Exception { Resolver resolver = cn.getResolver(); final StringBuilder filterCalls = new StringBuilder(); Resolver.CoordinateDataFilter filter = new Resolver.CoordinateDataFilter() { @Override public boolean includeCell(final String datacenter) { filterCalls.append(datacenter + ":"); return true; } @Override public boolean includeUser(final String user) { filterCalls.append(user + ":"); return true; } @Override public boolean includeService(final String service) { filterCalls.append(service + ":"); return true; } @Override public boolean includeEndpointname(final String endpointName) { return endpointName.equals("foo"); } @Override public boolean includeServiceState(final ServiceState state) { return state == ServiceState.RUNNING; } }; Set<Endpoint> endpoints = resolver.getEndpoints(filter); assertEquals(1, endpoints.size()); Endpoint selectedEndpoint = endpoints.iterator().next(); assertEquals("foo", selectedEndpoint.getName()); assertEquals("cell:user:service:", filterCalls.toString()); }
Source:
<code>private RecordLayer getRecordLayerForPeer(final Connection connection) { return new RecordLayer() { @Override public void sendRecord(Record record) { sendRecord(record); } @Override public void sendFlight(DTLSFlight flight) { sendHandshakeFlight(flight, connection); } public void cancelRetransmissions() { <START> if (config.isEarlyStopRetransmission()) <END> connection.cancelPendingFlight(); } }; }</code><technical_language>{ }</technical_language>

Target:
private RecordLayer getRecordLayerForPeer(final Connection connection) { return new RecordLayer() { @Override public void sendRecord(Record record) { sendRecord(record); } @Override public void sendFlight(DTLSFlight flight) { sendHandshakeFlight(flight, connection); } public void cancelRetransmissions() { if (config.isEarlyStopRetransmission()) { connection.cancelPendingFlight(); } } }; }
Source:
<code>public KeyDeletingService(OzoneManager ozoneManager, ScmBlockLocationProtocol scmClient, KeyManager manager, long serviceInterval, long serviceTimeout, Configuration conf) { super("KeyDeletingService", serviceInterval, TimeUnit.MILLISECONDS, KEY_DELETING_CORE_POOL_SIZE, serviceTimeout); this.ozoneManager = ozoneManager; this.scmClient = scmClient; this.manager = manager; this.keyLimitPerTask = conf.getInt(OZONE_KEY_DELETING_LIMIT_PER_TASK, <START> OZONE_KEY_DELETING_LIMIT_PER_TASK_DEFAULT); <END> this.deletedKeyCount = new AtomicLong(0); this.runCount = new AtomicLong(0); }</code><technical_language>of a avoid passing OzoneManager this class? a level class depending a higher level class potentially a circular dependency</technical_language>

Target:
KeyDeletingService(OzoneManager ozoneManager, ScmBlockLocationProtocol scmClient, KeyManager manager, long serviceInterval, long serviceTimeout, Configuration conf) { super("KeyDeletingService", serviceInterval, TimeUnit.MILLISECONDS, KEY_DELETING_CORE_POOL_SIZE, serviceTimeout); this.ozoneManager = ozoneManager; this.scmClient = scmClient; this.manager = manager; this.keyLimitPerTask = conf.getInt(OZONE_KEY_DELETING_LIMIT_PER_TASK, OZONE_KEY_DELETING_LIMIT_PER_TASK_DEFAULT); this.deletedKeyCount = new AtomicLong(0); this.runCount = new AtomicLong(0); }
Source:
<code>public void testRewriteBasicLambda() throws Exception { final Map<Symbol, Type> symbols = ImmutableMap.of(new Symbol("a"), BigintType.BIGINT); final SymbolAllocator allocator = new SymbolAllocator(symbols); assertEquals(rewrite(expression("x -> a + x"), symbols, allocator), new BindExpression( ImmutableList.of(expression("a")), new LambdaExpression( <START> ImmutableList.of("a_0", "x").stream().map(Identifier::new).map(LambdaArgumentDeclaration::new).collect(toList()), <END> expression("a_0 + x")))); }</code><technical_language>I write this as: Stream.of("a_0", "x") .map(Identifier::new) .map(LambdaArgumentDeclaration::new) .collect(toImmutableList())</technical_language>

Target:
public void testRewriteBasicLambda() throws Exception { final Map<Symbol, Type> symbols = ImmutableMap.of(new Symbol("a"), BigintType.BIGINT); final SymbolAllocator allocator = new SymbolAllocator(symbols); assertEquals(rewrite(expression("x -> a + x"), symbols, allocator), new BindExpression( ImmutableList.of(expression("a")), new LambdaExpression( Stream.of("a_0", "x") .map(Identifier::new) .map(LambdaArgumentDeclaration::new) .collect(toList()), expression("a_0 + x")))); }
Source:
<code>private void onLoadMore() { final int instanceLoadId = activeLoadId.get(); adapter.setProgressVisible(true); pageLoader.loadNextPage(new PageLoadCallback<T>() { @Override public void onPartialPageLoaded(List<T> newItems) { if (isResetCalled()) { return; } adapter.addAll(newItems); <START> adapter.setProgressVisible(false); <END> } @Override public void onPageLoaded(List<T> newItems, boolean hasMore) { if (isResetCalled()) { return; } adapter.addAll(newItems); if (!hasMore) { adapter.setProgressVisible(false); } hasMoreItems = hasMore; loading = false; } private boolean isResetCalled() { return instanceLoadId != activeLoadId.get(); } }); }</code><technical_language>partial load callback changing progress loader visibility state, this line removed</technical_language>

Target:
private void onLoadMore() { final int instanceLoadId = activeLoadId.get(); adapter.setProgressVisible(true); pageLoader.loadNextPage(new PageLoadCallback<T>() { @Override public void onPartialPageLoaded(List<T> newItems) { if (isAbandoned()) { return; } adapter.addAll(newItems); } @Override public void onPageLoaded(List<T> newItems, boolean hasMore) { if (isAbandoned()) { return; } adapter.addAll(newItems); if (!hasMore) { adapter.setProgressVisible(false); } hasMoreItems = hasMore; loading = false; } private boolean isAbandoned() { return instanceLoadId != activeLoadId.get(); } }); }
Source:
<code>private Mapping(String sourceName, String sourceParameterName, String sourcePropertyName, String constant, String expression, String targetName, String dateFormat, AnnotationMirror mirror, AnnotationValue sourceAnnotationValue, AnnotationValue targetAnnotationValue) { this.sourceName = sourceName; this.sourceParameterName = sourceParameterName; this.sourcePropertyName = sourcePropertyName; this.constant = constant; this.expression = expression; Matcher javaExpressionMatcher = JAVA_EXPRESSION.matcher( expression ); <START> this.javaExpression = javaExpressionMatcher.matches() ? javaExpressionMatcher.group( 1 ) : ""; <END> this.targetName = targetName.equals( "" ) ? sourceName : targetName; this.dateFormat = dateFormat; this.mirror = mirror; this.sourceAnnotationValue = sourceAnnotationValue; this.targetAnnotationValue = targetAnnotationValue; }</code><technical_language>trim expression? Currently I in generated code (note double white space beginning): target.setTimeAndFormat( new org.mapstruct.ap.test.source.expressions.java.TimeAndFormat( s.getTime(), s.getFormat() ) );</technical_language>

Target:
private Mapping(String sourceName, String sourceParameterName, String sourcePropertyName, String constant, String expression, String targetName, String dateFormat, AnnotationMirror mirror, AnnotationValue sourceAnnotationValue, AnnotationValue targetAnnotationValue) { this.sourceName = sourceName; this.sourceParameterName = sourceParameterName; this.sourcePropertyName = sourcePropertyName; this.constant = constant; this.expression = expression; Matcher javaExpressionMatcher = JAVA_EXPRESSION.matcher( expression ); this.javaExpression = javaExpressionMatcher.matches() ? javaExpressionMatcher.group( 1 ).trim() : ""; this.targetName = targetName.equals( "" ) ? sourceName : targetName; this.dateFormat = dateFormat; this.mirror = mirror; this.sourceAnnotationValue = sourceAnnotationValue; this.targetAnnotationValue = targetAnnotationValue; }
Source:
<code>public void testAddColumnAfterDropColumn() { assertNull(metadata.getTableHandle(SESSION, DEFAULT_TEST_ORDERS)); metadata.createTable(SESSION, buildTable(ImmutableMap.of(), tableMetadataBuilder(DEFAULT_TEST_ORDERS) .column("orderkey", BIGINT) .column("price", BIGINT)), false); ConnectorTableHandle tableHandle = metadata.getTableHandle(SESSION, DEFAULT_TEST_ORDERS); assertInstanceOf(tableHandle, RaptorTableHandle.class); RaptorTableHandle raptorTableHandle = (RaptorTableHandle) tableHandle; <START> ColumnHandle lastColumn = metadata.getColumnHandles(SESSION, tableHandle).get("orderkey"); <END> metadata.dropColumn(SESSION, raptorTableHandle, lastColumn); metadata.addColumn(SESSION, raptorTableHandle, new ColumnMetadata("new_col", BIGINT)); assertNull(metadata.getColumnHandles(SESSION, tableHandle).get("orderkey")); assertNotNull(metadata.getColumnHandles(SESSION, raptorTableHandle).get("new_col")); }</code><technical_language>This name wrong column. dropColumn column</technical_language>

Target:
public void testAddColumnAfterDropColumn() { assertNull(metadata.getTableHandle(SESSION, DEFAULT_TEST_ORDERS)); metadata.createTable(SESSION, buildTable(ImmutableMap.of(), tableMetadataBuilder(DEFAULT_TEST_ORDERS) .column("orderkey", BIGINT) .column("price", BIGINT)), false); ConnectorTableHandle tableHandle = metadata.getTableHandle(SESSION, DEFAULT_TEST_ORDERS); assertInstanceOf(tableHandle, RaptorTableHandle.class); RaptorTableHandle raptorTableHandle = (RaptorTableHandle) tableHandle; ColumnHandle column = metadata.getColumnHandles(SESSION, tableHandle).get("orderkey"); metadata.dropColumn(SESSION, raptorTableHandle, column); metadata.addColumn(SESSION, raptorTableHandle, new ColumnMetadata("new_col", BIGINT)); assertNull(metadata.getColumnHandles(SESSION, tableHandle).get("orderkey")); assertNotNull(metadata.getColumnHandles(SESSION, raptorTableHandle).get("new_col")); }
Source:
<code>void addListener(final Session session) { Preconditions.checkNotNull(session); <START> Preconditions.checkNotNull(session.getId()); <END> sessionSet.put(session); }</code><technical_language>ID is longer required, need non-null</technical_language>

Target:
void addListener(final Session session) { sessionSet.put(session); }
Source:
<code>private EntityType cutDefaultValues(EntityType copy, CopyState state) { stream(copy.getAtomicAttributes()) .filter(EntityTypeUtils::isReferenceType) <START> .filter(attr -> attr.getDefaultValue() != null) <END> .forEach( attr -> { state.referenceDefaultValues().put(attr.getIdentifier(), attr.getDefaultValue()); attr.setDefaultValue(null); }); return copy; }</code><technical_language>suggestion .filter(Attribute::hasDefaultValue)</technical_language>

Target:
private EntityType cutDefaultValues(EntityType copy, CopyState state) { stream(copy.getAtomicAttributes()) .filter(EntityTypeUtils::isReferenceType) .filter(Attribute::hasDefaultValue) .forEach( attr -> { state.referenceDefaultValues().put(attr.getIdentifier(), attr.getDefaultValue()); attr.setDefaultValue(null); }); return copy; }
Source:
<code>public void testCreateAndCaptureTransactionWithOfflineDebitCard() throws Throwable { <START> transaction = transactionFactory.create("offline"); <END> transaction.setCapture(true); transaction.save(); Assert.assertEquals(transaction.getPaymentMethod(), Transaction.PaymentMethod.DEBIT_CARD); Assert.assertEquals(transaction.getStatus(), Transaction.Status.PAID); }</code><technical_language>Change java transactionFactory.createBoletoTransaction(); transactionFactory.createDebitOfflineTransaction(); transactionFactory.createDebitOnlineTransaction();</technical_language>

Target:
public void testCreateAndCaptureTransactionWithOfflineDebitCard() throws Throwable { transaction = transactionFactory.createCreditCardOfflineTransaction(); transaction.setCapture(true); transaction.save(); Assert.assertEquals(transaction.getPaymentMethod(), Transaction.PaymentMethod.DEBIT_CARD); Assert.assertEquals(transaction.getStatus(), Transaction.Status.PAID); }
Source:
<code>public ExtendedQueryResult<T> orderDesc(String attribute, boolean appendEntityName) { lastPaginatedQuery = null; <START> if (!context.getRepositoryMethod().isQuery()) { <END> context.addCriteriaBuilderPostProcessor(new OrderByCriteriaBuilderPostProcessor(attribute, OrderDirection.DESC)); } else { context.addQueryStringPostProcessor(new OrderByQueryStringPostProcessor(attribute, OrderDirection.ASC, appendEntityName)); } return this; }</code><technical_language>negative logic</technical_language>

Target:
public ExtendedQueryResult<T> orderDesc(String attribute, boolean appendEntityName) { lastPaginatedQuery = null; if (context.getRepositoryMethod().isQuery()) { context.addQueryStringPostProcessor(new OrderByQueryStringPostProcessor(attribute, OrderDirection.ASC, appendEntityName)); } else { context.addCriteriaBuilderPostProcessor(new OrderByCriteriaBuilderPostProcessor(attribute, OrderDirection.DESC)); } return this; }
Source:
<code>private boolean getSucceeded() { <START> return (result.mStatus.mCode == 0); <END> }</code><technical_language>able do result.mStatus.mCode in setting modifiers for GlusterVolumeStatusReturnForXmlRpc.mStatus done properly</technical_language>

Target:
private boolean getSucceeded() { return (result.getmStatus().mCode == 0); }
Source:
<code><START> public List<String> getStreamConsumerArns() { <END> return streamConsumerArns; }</code><technical_language>@xiaolong-sn a map add a method public String getStreamConsumerArn(String stream)</technical_language>

Target:
public Optional<Map<String, String>> getStreamConsumerArns() { return Optional.ofNullable(streamConsumerArns); }
Source:
<code>@Test public void clear() { LinkedHashTreeMap<String, String> map = new LinkedHashTreeMap<>(); map.put("a", "android"); map.put("c", "cola"); map.put("b", "bbq"); map.clear(); assertIterationOrder(map.keySet()); <START> assertThat(map.size()).isEqualTo(0); <END> }</code><technical_language>assertThat(map).isEmpty()</technical_language>

Target:
@Test public void clear() { LinkedHashTreeMap<String, String> map = new LinkedHashTreeMap<>(); map.put("a", "android"); map.put("c", "cola"); map.put("b", "bbq"); map.clear(); assertThat(map.keySet()).containsExactly(); assertThat(map).isEmpty(); }
Source:
<code>public void testTotalPriceColumn(User user) { HomePage homePage = new HomePage(driver); UserInfoPage userInfoPage = homePage.logIn(user.getLogin(), user.getPassword()); OrderingPage orderingPage = userInfoPage.clickOrderingTab(); List<Order> tableFromView = orderingPage.getTableFromView(); tableFromView.sort(Comparator.comparing(Order::getTotalPrice)); <START> orderingPage.clickOrdersTableColumn(OrdersTable.TOTAL_PRICE.toString()); <END> List<Order> sortedTableByTotalPriceAsc = orderingPage.getTableFromView(); orderingPage.clickOrdersTableColumn(OrdersTable.TOTAL_PRICE.toString()); List<Order> sortedTableByTotalPriceDesc = orderingPage.getTableFromView(); for (int i = 0; i < tableFromView.size(); i++) { Assert.assertTrue(sortedTableByTotalPriceAsc.get(i).getTotalPrice().equals(tableFromView.get(i).getTotalPrice()), "Sorting by total price doesn't work."); } for (int i = 0, j = tableFromView.size() - 1; i < tableFromView.size(); i++, j--) { Assert.assertTrue(sortedTableByTotalPriceDesc.get(i).getTotalPrice().equals(tableFromView.get(j).getTotalPrice()), "Sorting by total price doesn't work."); } }</code><technical_language>move toString() clickOrdersTableColumn() method for OrdersTable.ELEM.toString() calls</technical_language>

Target:
public void testTotalPriceColumn(User user) { HomePage homePage = new HomePage(driver); UserInfoPage userInfoPage = homePage.logIn(user.getLogin(), user.getPassword()); OrderingPage orderingPage = userInfoPage.clickOrderingTab(); List<Order> tableFromView = orderingPage.getTableFromView(); tableFromView.sort(Comparator.comparing(Order::getTotalPrice)); orderingPage.clickOrdersTableColumn(OrdersTable.TOTAL_PRICE); List<Order> sortedTableByTotalPriceAsc = orderingPage.getTableFromView(); orderingPage.clickOrdersTableColumn(OrdersTable.TOTAL_PRICE); List<Order> sortedTableByTotalPriceDesc = orderingPage.getTableFromView(); for (int i = 0; i < tableFromView.size(); i++) { Assert.assertTrue(sortedTableByTotalPriceAsc.get(i).getTotalPrice().equals(tableFromView.get(i).getTotalPrice()), "Sorting by total price doesn't work."); } for (int i = 0, j = tableFromView.size() - 1; i < tableFromView.size(); i++, j--) { Assert.assertTrue(sortedTableByTotalPriceDesc.get(i).getTotalPrice().equals(tableFromView.get(j).getTotalPrice()), "Sorting by total price doesn't work."); } }
Source:
<code>public CreateBranchPage(Repository repo, Ref baseRef) { super(CreateBranchPage.class.getName()); this.myRepository = repo; <START> this.myBaseRef = baseRef != null ? baseRef.getName() : null; <END> this.myBaseCommit = null; this.myValidator = ValidationUtils.getRefNameInputValidator( myRepository, Constants.R_HEADS, true); this.upstreamConfig = baseRef != null ? getDefaultUpstreamConfig(repo, baseRef.getName()) : UpstreamConfig.NONE; setTitle(UIText.CreateBranchPage_Title); setMessage(UIText.CreateBranchPage_ChooseBranchAndNameMessage); }</code><technical_language>Is this eGit convention? baseref == null ? null : baseref.getName() avoid negation</technical_language>

Target:
public CreateBranchPage(Repository repo, Ref baseRef) { super(CreateBranchPage.class.getName()); this.myRepository = repo; this.myBaseRef = baseRef == null ? null : baseRef.getName(); this.myBaseCommit = null; this.myValidator = ValidationUtils.getRefNameInputValidator( myRepository, Constants.R_HEADS, true); this.upstreamConfig = baseRef != null ? getDefaultUpstreamConfig(repo, baseRef.getName()) : UpstreamConfig.NONE; setTitle(UIText.CreateBranchPage_Title); setMessage(UIText.CreateBranchPage_ChooseBranchAndNameMessage); }