auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public boolean onOptionsItemSelected(MenuItem item) { Intent intent = null; switch (item.getItemId()) { case R.id.menu_load: if (!NetworkUtils.isConnectedToNetwork(this)) { Toast.makeText(this, "No connection found, please connect your device and try again", Toast.LENGTH_SHORT).show(); return true; } if (syncInProgress) { Toast.makeText(this, "Already fetching forms, ignored the request", Toast.LENGTH_SHORT).show(); return true; } if (hasFormsWithData()) { <START> Toast.makeText(this, "There is existing form data for selected form(s). Finish Incomplete data and sync Complete data to Server first before downloading selected forms", Toast.LENGTH_SHORT).show(); <END> return true; } syncAllFormsInBackgroundService(); return true; case R.id.menu_upload: if (!NetworkUtils.isConnectedToNetwork(this)) { Toast.makeText(this, "No connection found, please connect your device and try again", Toast.LENGTH_SHORT).show(); return true; } if (syncInProgress) { Toast.makeText(this, "Already uploading forms, ignored the request", Toast.LENGTH_SHORT).show(); return true; } uploadAllFormsInBackgroundService(); return true; case R.id.menu_client_add: intent = new Intent(this, RegistrationFormsActivity.class); startActivity(intent); return true; case R.id.menu_tags: if (mainLayout.isDrawerOpen(GravityCompat.END)) { mainLayout.closeDrawer(GravityCompat.END); } else { mainLayout.openDrawer(GravityCompat.END); } return true; default: return super.onOptionsItemSelected(item); } }</code><technical_language>code fold next line code is long. put this text in strings.xml</technical_language>

Target:
public boolean onOptionsItemSelected(MenuItem item) { Intent intent = null; switch (item.getItemId()) { case R.id.menu_load: if (!NetworkUtils.isConnectedToNetwork(this)) { Toast.makeText(this, R.string.no_connection_found_msg, Toast.LENGTH_SHORT).show(); return true; } if (syncInProgress) { Toast.makeText(this, R.string.already_fetching_forms_msg, Toast.LENGTH_SHORT).show(); return true; } if (hasFormsWithData()) { AlertDialog alertDialog = new AlertDialog.Builder(this).create(); alertDialog.setMessage((getApplicationContext()) .getString(R.string.already_exists_some_forms_with_patient_data_msg) ); alertDialog.setButton(DialogInterface.BUTTON_POSITIVE, "Ok", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int i) { } }); alertDialog.show(); return true; } syncAllFormsInBackgroundService(); return true; case R.id.menu_upload: if (!NetworkUtils.isConnectedToNetwork(this)) { Toast.makeText(this, R.string.no_connection_found_msg, Toast.LENGTH_SHORT).show(); return true; } if (syncInProgress) { Toast.makeText(this, R.string.already_uploading_forms_msg, Toast.LENGTH_SHORT).show(); return true; } uploadAllFormsInBackgroundService(); return true; case R.id.menu_client_add: intent = new Intent(this, RegistrationFormsActivity.class); startActivity(intent); return true; case R.id.menu_tags: if (mainLayout.isDrawerOpen(GravityCompat.END)) { mainLayout.closeDrawer(GravityCompat.END); } else { mainLayout.openDrawer(GravityCompat.END); } return true; default: return super.onOptionsItemSelected(item); } }
Source:
<code>public void handle(XFormParser p, Element e, Object parent) { String event = e.getAttributeValue(null, "event"); FormDef form = (FormDef) parent; PollSensorAction action; String ref = e.getAttributeValue(null, "ref"); if (ref != null) { IDataReference dataRef = new XPathReference(ref); <START> if (dataRef != null) { <END> dataRef = XFormParser.getAbsRef(dataRef, TreeReference.rootRef()); } TreeReference treeRef = FormInstance.unpackReference(dataRef); p.registerActionTarget(treeRef); action = new PollSensorAction(treeRef); } else { action = new PollSensorAction(); } form.registerEventListener(event, action); }</code><technical_language>dataRef null assigned result of a class constructor it</technical_language>

Target:
public void handle(XFormParser p, Element e, Object parent) { String event = e.getAttributeValue(null, "event"); FormDef form = (FormDef) parent; PollSensorAction action; String ref = e.getAttributeValue(null, "ref"); if (ref != null) { IDataReference dataRef = new XPathReference(ref); dataRef = XFormParser.getAbsRef(dataRef, TreeReference.rootRef()); TreeReference treeRef = FormInstance.unpackReference(dataRef); p.registerActionTarget(treeRef); action = new PollSensorAction(treeRef); } else { action = new PollSensorAction(); } form.registerEventListener(event, action); }
Source:
<code>public void setQuotaMode(QuotaMode mode) { <START> logger.info("Setting Quota mode to " + mode.name()); <END> this.mode = mode; }</code><technical_language>nit: try avoid string concatenation in log. logger.info("Setting Quota mode {}", mode.name());</technical_language>

Target:
public void setQuotaMode(QuotaMode mode) { logger.info("Setting Quota mode to {}", mode.name()); this.mode = mode; }
Source:
<code>private static boolean isPreJava8() { <START> final String version = System.getProperty("java.version"); <END> final String[] parts = version.split("\\."); try { int major = Integer.parseInt(parts[1]); final int token = Integer.parseInt(parts[0]); boolean isJEP223 = token != 1; if (isJEP223) { major = token; } return major < 8; } catch (final Exception ex) { return true; } }</code><technical_language>this method delegate a package-private static boolean isPreJava8(String javaVersion) invoke test? reflective method is failures if refactor this code in future, setting java.version system property other consequences prefer avoid</technical_language>

Target:
private static boolean isPreJava8() { return org.apache.logging.log4j.util.Constants.JAVA_MAJOR_VERSION < 8; }
Source:
<code>public PagingProvider<ReconnectableConnection, ReconnectableConnection> pagedOperation(Integer failOn) { return new PagingProvider<ReconnectableConnection, ReconnectableConnection>() { Integer counter = 0; @Override public List<ReconnectableConnection> getPage(ReconnectableConnection connection) { counter++; if (counter == failOn) { <START> throw new ModuleException(MuleErrors.CONNECTIVITY, new ConnectionException("Failed to retrieve Page")); <END> } return Collections.singletonList(connection); } @Override public Optional<Integer> getTotalResults(ReconnectableConnection connection) { return Optional.empty(); } @Override public void close(ReconnectableConnection connection) { } }; }</code><technical_language>static import</technical_language>

Target:
public PagingProvider<ReconnectableConnection, ReconnectableConnection> pagedOperation(Integer failOn) { return new PagingProvider<ReconnectableConnection, ReconnectableConnection>() { @Override public List<ReconnectableConnection> getPage(ReconnectableConnection connection) { getPageCalls++; if (getPageCalls == failOn) { throw new ModuleException(CONNECTIVITY, new ConnectionException("Failed to retrieve Page")); } return singletonList(connection); } @Override public Optional<Integer> getTotalResults(ReconnectableConnection connection) { return empty(); } @Override public void close(ReconnectableConnection connection) { closePagingProviderCalls++; } }; }
Source:
<code>public boolean writeMutexCell(String tenantId, String schemaName, String tableName, String columnName, String familyName) throws SQLException { try { byte[] rowKey = columnName != null ? SchemaUtil.getColumnKey(tenantId, schemaName, tableName, columnName, familyName) : SchemaUtil.getTableKey(tenantId, schemaName, tableName); <START> byte[] sysMutexPhysicalTableNameBytes = getSysMutexPhysicalTableNameBytes(); <END> try (Table sysMutexTable = getTable(sysMutexPhysicalTableNameBytes)) { byte[] family = PhoenixDatabaseMetaData.SYSTEM_MUTEX_FAMILY_NAME_BYTES; byte[] qualifier = PhoenixDatabaseMetaData.SYSTEM_MUTEX_COLUMN_NAME_BYTES; byte[] value = MUTEX_LOCKED; Put put = new Put(rowKey); put.addColumn(family, qualifier, value); boolean checkAndPut = sysMutexTable.checkAndPut(rowKey, family, qualifier, null, put); String processName = ManagementFactory.getRuntimeMXBean().getName(); String msg = " tenantId : " + tenantId + " schemaName : " + schemaName + " tableName : " + tableName + " columnName : " + columnName + " familyName : " + familyName; if (!checkAndPut) { LOGGER.error(processName + " failed to acquire mutex for "+ msg); } else { LOGGER.debug(processName + " acquired mutex for "+ msg); } return checkAndPut; } } catch (IOException e) { throw ServerUtil.parseServerException(e); } }</code><technical_language>byte[] sysMutexPhysicalTableNameBytes = getSysMutexPhysicalTableNameBytes(); If I understand correctly @ChinmaySKulkarni in ticket, this call result admin.tableExists call check existance of SYSTEM.MUTEX/SYSTEM:MUTEX changed that</technical_language>

Target:
public boolean writeMutexCell(String tenantId, String schemaName, String tableName, String columnName, String familyName) throws SQLException { try { byte[] rowKey = columnName != null ? SchemaUtil.getColumnKey(tenantId, schemaName, tableName, columnName, familyName) : SchemaUtil.getTableKey(tenantId, schemaName, tableName); try (Table sysMutexTable = getSysMutexTable()) { byte[] family = PhoenixDatabaseMetaData.SYSTEM_MUTEX_FAMILY_NAME_BYTES; byte[] qualifier = PhoenixDatabaseMetaData.SYSTEM_MUTEX_COLUMN_NAME_BYTES; byte[] value = MUTEX_LOCKED; Put put = new Put(rowKey); put.addColumn(family, qualifier, value); boolean checkAndPut = sysMutexTable.checkAndPut(rowKey, family, qualifier, null, put); String processName = ManagementFactory.getRuntimeMXBean().getName(); String msg = " tenantId : " + tenantId + " schemaName : " + schemaName + " tableName : " + tableName + " columnName : " + columnName + " familyName : " + familyName; if (!checkAndPut) { LOGGER.error(processName + " failed to acquire mutex for "+ msg); } else { LOGGER.debug(processName + " acquired mutex for "+ msg); } return checkAndPut; } } catch (IOException e) { throw ServerUtil.parseServerException(e); } }
Source:
<code>public ReadableByteChannel get(PageId pageId, int pageOffset) throws IOException, PageNotFoundException { Path p = getFilePath(pageId); if (!Files.exists(p)) { throw new PageNotFoundException(p.toString()); } FileInputStream fis = new FileInputStream(p.toFile()); <START> fis.skip(pageOffset); <END> return fis.getChannel(); }</code><technical_language>[ERROR] alluxio.client.file.cache.store.LocalPageStore.get(PageId, int) fail clean java.io.InputStream checked exception [alluxio.client.file.cache.store.LocalPageStore, alluxio.client.file.cache.store.LocalPageStore] Obligation clean resource created LocalPageStore.java:[line 78] is dischargedPath continues LocalPageStore.java:[line 79] OBL_UNSATISFIED_OBLIGATION_EXCEPTION_EDGE</technical_language>

Target:
public ReadableByteChannel get(PageId pageId, int pageOffset) throws IOException, PageNotFoundException { Preconditions.checkArgument(pageOffset >= 0, "page offset should be non-negative"); Path p = getFilePath(pageId); if (!Files.exists(p)) { throw new PageNotFoundException(p.toString()); } File f = p.toFile(); Preconditions.checkArgument(pageOffset <= f.length(), "page offset %s exceeded page size %s", pageOffset, f.length()); FileInputStream fis = new FileInputStream(p.toFile()); try { fis.skip(pageOffset); return fis.getChannel(); } catch (Throwable t) { fis.close(); throw t; } }
Source:
<code>String extractMetadataFromSlots(List<oasis.names.tc.ebxml_regrep.xsd.rim._3.SlotType1> documentSlots, String slotName, int valueIndex) { LOG.debug("extractMetadataFromSlots slotname: {}; index: {}", slotName, valueIndex); String slotValue = null; for (SlotType1 slot : documentSlots) { if (slotName.equals(slot.getName())) { <START> LOG.debug("Found {}: {}", slotName, slot.getValueList().getValue()); <END> if (valueIndex < 0) { slotValue = StringUtils.join(slot.getValueList().getValue(), VALUE_LIST_SEPERATOR); } else if (slot.getValueList() != null && slot.getValueList().getValue() != null && !slot.getValueList().getValue().isEmpty()) { slotValue = slot.getValueList().getValue().get(valueIndex); } else { slotValue = ""; } break; } } LOG.debug("{}: {}", slotName, slotValue); return slotValue; }</code><technical_language>This statement slot.getValueList().getValue()) NPE</technical_language>

Target:
String extractMetadataFromSlots(List<oasis.names.tc.ebxml_regrep.xsd.rim._3.SlotType1> documentSlots, String slotName, int valueIndex) { LOG.debug("extractMetadataFromSlots slotname: {}; index: {}", slotName, valueIndex); String slotValue = null; for (SlotType1 slot : documentSlots) { if (slotName.equals(slot.getName())) { LOG.debug("Found slot with name: {}", slotName); if (valueIndex < 0) { slotValue = StringUtils.join(slot.getValueList().getValue(), VALUE_LIST_SEPERATOR); } else if (slot.getValueList().getValue() != null && valueIndex < slot.getValueList().getValue().size()) { slotValue = slot.getValueList().getValue().get(valueIndex); } else { slotValue = ""; } break; } } LOG.debug("Value for slot name {}: {}", slotName, slotValue); return slotValue; }
Source:
<code>public PartitionStatistics getTableStatistics(String databaseName, String tableName) { try { Table table = getTable(databaseName, tableName).orElseThrow( () -> new PrestoException(HIVE_METASTORE_ERROR, String.format("Could not retrieve table %s.%s", databaseName, tableName))); HiveBasicStatistics basicStats = getHiveBasicStatistics(table.getParameters()); List<Column> columns = table.getPartitionColumns(); List<String> columnNames = columns.stream().map(Column::getName).collect(toImmutableList()); <START> List<ColumnStatisticsInfo> colStatsList = client.getTableColumnStatistics(table.getDatabaseName(), table.getTableName(), columnNames); <END> return new PartitionStatistics(basicStats, groupStatisticsByColumn(colStatsList, basicStats.getRowCount())); } catch (Exception e) { throw new PrestoException(HIVE_METASTORE_ERROR, e); } }</code><technical_language>columnStatistics</technical_language>

Target:
public PartitionStatistics getTableStatistics(String databaseName, String tableName) { try { Table table = getTable(databaseName, tableName).orElseThrow( () -> new PrestoException(HIVE_METASTORE_ERROR, String.format("Could not retrieve table %s.%s", databaseName, tableName))); HiveBasicStatistics basicStatistics = getHiveBasicStatistics(table.getParameters()); List<Column> columns = table.getPartitionColumns(); List<String> columnNames = columns.stream().map(Column::getName).collect(toImmutableList()); List<ColumnStatisticsInfo> columnStatistics = client.getTableColumnStatistics(table.getDatabaseName(), table.getTableName(), columnNames); return new PartitionStatistics(basicStatistics, groupStatisticsByColumn(columnStatistics, basicStatistics.getRowCount())); } catch (Exception e) { throw new PrestoException(HIVE_METASTORE_ERROR, e); } }
Source:
<code>private void lazyLoadModulesConfig() throws IOException, ConfigInvalidException { <START> if (modulesConfig == null) { <END> loadModulesConfig(); } }</code><technical_language>curly braces required</technical_language>

Target:
private void lazyLoadModulesConfig() throws IOException, ConfigInvalidException { if (modulesConfig == null) loadModulesConfig(); }
Source:
<code>public void run() { try { if (!makeResourceWritable(provider.getShell())) { return; } <START> } catch (CoreException e) { <END> MessageDialog.openWarning(provider.getShell(), "Resource Not Accessible", e.getMessage()); return; } if (LaunchUtils.hasLaunchedTestCases()) { MessageDialog.openWarning(provider.getShell(), Messages.RenameAction_ErrorDialogTitle, Messages.RenameAction_ErrorDialogMsg); return; } if (!RefactoringSaveHelper.checkDirtyEditors(provider.getShell())) { return; } if (containsSingleTag(getStructuredSelection())) { RenameTagWizard wizard = new RenameTagWizard(getSelectedTag()); run(wizard, provider.getShell()); } else { List<?> resources = getSelectedResources(); if (resources.size() == 1) { IResource resource = (IResource) resources.get(0); Q7RenameResourceWizard wizard = new Q7RenameResourceWizard( resource); run(wizard, provider.getShell()); } } }</code><technical_language>do handle error this</technical_language>

Target:
public void run() { try { if (!makeResourceWritable(provider.getShell())) { return; } } catch (CoreException e) { Q7UIPlugin.log(e); return; } if (LaunchUtils.hasLaunchedTestCases()) { MessageDialog.openWarning(provider.getShell(), Messages.RenameAction_ErrorDialogTitle, Messages.RenameAction_ErrorDialogMsg); return; } if (!RefactoringSaveHelper.checkDirtyEditors(provider.getShell())) { return; } if (containsSingleTag(getStructuredSelection())) { RenameTagWizard wizard = new RenameTagWizard(getSelectedTag()); run(wizard, provider.getShell()); } else { List<?> resources = getSelectedResources(); if (resources.size() == 1) { IResource resource = (IResource) resources.get(0); Q7RenameResourceWizard wizard = new Q7RenameResourceWizard( resource); run(wizard, provider.getShell()); } } }
Source:
<code>private void setValue(Type type, BlockBuilder blockBuilder, String value) { if (value == null) { blockBuilder.appendNull(); return; } if (!(type instanceof FixedWidthType) && !(type instanceof VarcharType)) { throw new PinotException(PINOT_UNSUPPORTED_COLUMN_TYPE, Optional.empty(), "type '" + type + "' not supported"); } if (type instanceof FixedWidthType) { completedBytes += ((FixedWidthType) type).getFixedSize(); if (type instanceof BigintType) { type.writeLong(blockBuilder, parseDouble(value).longValue()); } else if (type instanceof IntegerType) { blockBuilder.writeInt(parseDouble(value).intValue()); } else if (type instanceof TinyintType) { blockBuilder.writeByte(parseDouble(value).byteValue()); } else if (type instanceof SmallintType) { blockBuilder.writeShort(parseDouble(value).shortValue()); } else if (type instanceof BooleanType) { type.writeBoolean(blockBuilder, parseBoolean(value)); } else if (type instanceof DecimalType || type instanceof DoubleType) { type.writeDouble(blockBuilder, parseDouble(value)); } else if (type instanceof TimestampType) { type.writeLong(blockBuilder, parseLong(value)); } else if (type instanceof DateType) { <START> blockBuilder.writeInt(parseDouble(value).intValue()); <END> } else { throw new PinotException(PINOT_UNSUPPORTED_COLUMN_TYPE, Optional.empty(), "type '" + type + "' not supported"); } } else { Slice slice = Slices.utf8Slice(value); blockBuilder.writeBytes(slice, 0, slice.length()).closeEntry(); completedBytes += slice.length(); } }</code><technical_language>parseDouble convert int instead of parsing int</technical_language>

Target:
private void setValue(Type type, BlockBuilder blockBuilder, String value) { if (value == null) { blockBuilder.appendNull(); return; } if (!(type instanceof FixedWidthType) && !(type instanceof VarcharType)) { throw new PinotException(PINOT_UNSUPPORTED_COLUMN_TYPE, Optional.empty(), "type '" + type + "' not supported"); } if (type instanceof FixedWidthType) { completedBytes += ((FixedWidthType) type).getFixedSize(); if (type instanceof BigintType) { type.writeLong(blockBuilder, parseDouble(value).longValue()); } else if (type instanceof IntegerType) { blockBuilder.writeInt(parseDouble(value).intValue()); } else if (type instanceof TinyintType) { blockBuilder.writeByte(parseDouble(value).byteValue()); } else if (type instanceof SmallintType) { blockBuilder.writeShort(parseDouble(value).shortValue()); } else if (type instanceof BooleanType) { type.writeBoolean(blockBuilder, parseBoolean(value)); } else if (type instanceof DecimalType || type instanceof DoubleType) { type.writeDouble(blockBuilder, parseDouble(value)); } else if (type instanceof TimestampType) { type.writeLong(blockBuilder, parseLong(value)); } else if (type instanceof DateType) { type.writeLong(blockBuilder, parseLong(value)); } else { throw new PinotException(PINOT_UNSUPPORTED_COLUMN_TYPE, Optional.empty(), "type '" + type + "' not supported"); } } else { Slice slice = Slices.utf8Slice(value); blockBuilder.writeBytes(slice, 0, slice.length()).closeEntry(); completedBytes += slice.length(); } }
Source:
<code>private void initialize() { this.setName(Constant.messages.getString("proxies.options.title")); <START> this.add(getScrollPane()); <END> this.setLayout(new GridBagLayout()); this.add(getMainProxyPanel(), LayoutHelper.getGBC(0, 0, 1, 0.0)); this.add(getSecurityProtocolsPanel(), LayoutHelper.getGBC(0, 1, 1, 0.0)); this.add(getScrollPane(), LayoutHelper.getGBC(0, 2, 1, 1.0, 1.0)); }</code><technical_language>This removed? (Being added later.)</technical_language>

Target:
private void initialize() { this.setName(Constant.messages.getString("proxies.options.title")); this.setLayout(new GridBagLayout()); this.add(getScrollPane(), LayoutHelper.getGBC(0, 0, 1, 1.0, 1.0)); }
Source:
<code>public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } ImageTransfer other = (ImageTransfer) obj; return Objects.equals(commandId, other.commandId) && Objects.equals(phase, other.phase) <START> && type == other.type <END> && Objects.equals(lastUpdated, other.lastUpdated) && Objects.equals(message, other.message) && Objects.equals(vdsId, other.vdsId) && Objects.equals(diskId, other.diskId) && Objects.equals(imagedTicketId, other.imagedTicketId) && Objects.equals(proxyUri, other.proxyUri) && Objects.equals(signedTicket, other.signedTicket) && Objects.equals(bytesSent, other.bytesSent) && Objects.equals(bytesTotal, other.bytesTotal); }</code><technical_language>please move line 168, cleaner :)</technical_language>

Target:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } ImageTransfer other = (ImageTransfer) obj; return Objects.equals(commandId, other.commandId) && Objects.equals(phase, other.phase) && Objects.equals(lastUpdated, other.lastUpdated) && Objects.equals(message, other.message) && Objects.equals(vdsId, other.vdsId) && Objects.equals(diskId, other.diskId) && Objects.equals(imagedTicketId, other.imagedTicketId) && Objects.equals(proxyUri, other.proxyUri) && Objects.equals(signedTicket, other.signedTicket) && Objects.equals(bytesSent, other.bytesSent) && Objects.equals(bytesTotal, other.bytesTotal) && type == other.type; }
Source:
<code>private static void printNetworkParameters(NetworkParams networkParams) { <START> oshi.add("Network parameters:" + networkParams.toString()); <END> }</code><technical_language>match format, do "Network parameters:\n " here</technical_language>

Target:
private static void printNetworkParameters(NetworkParams networkParams) { oshi.add("Network parameters:\n" + networkParams.toString()); }
Source:
<code>public static OzoneAcl convertOzoneAcl(OzoneAclInfo aclInfo) { ACLIdentityType aclType; switch(aclInfo.getType()) { case USER: aclType = ACLIdentityType.USER; break; case GROUP: aclType = ACLIdentityType.GROUP; break; case WORLD: <START> aclType = ACLIdentityType.WORLD; <END> break; default: throw new IllegalArgumentException("ACL type is not recognized"); } List<IAccessAuthorizer.ACLType> aclRights = new ArrayList<>(); for(OzoneAclRights acl:aclInfo.getRightsList()) { try { aclRights.add(ACLType.valueOf(acl.name())); } catch(IllegalArgumentException iae) { LOG.error("ACL:{} right is not recognized.", acl); } } return new OzoneAcl(aclType, aclInfo.getName(), aclRights); }</code><technical_language>Do missing some enums here</technical_language>

Target:
public static OzoneAcl convertOzoneAcl(OzoneAclInfo aclInfo) { ACLIdentityType aclType; switch (aclInfo.getType()) { case USER: aclType = ACLIdentityType.USER; break; case GROUP: aclType = ACLIdentityType.GROUP; break; case WORLD: aclType = ACLIdentityType.WORLD; break; case ANONYMOUS: aclType = ACLIdentityType.ANONYMOUS; break; case CLIENT_IP: aclType = ACLIdentityType.CLIENT_IP; break; default: throw new IllegalArgumentException("ACL type is not recognized"); } List<IAccessAuthorizer.ACLType> aclRights = new ArrayList<>(); for (OzoneAclRights acl : aclInfo.getRightsList()) { aclRights.add(ACLType.valueOf(acl.name())); } return new OzoneAcl(aclType, aclInfo.getName(), aclRights); }
Source:
<code>public void shouldSubstituteHexValuesInReplacementString() { String replacement = "abc\\x01\\xaadef"; <START> ReplacerParamRule nonAsciiRegexRule = <END> new ReplacerParamRule( "", REQ_HEADER_STR, "anyMatchString", true, replacement, null, true); assertThat( nonAsciiRegexRule.getEscapedReplacement(), equalTo(new String(new byte[] {'a', 'b', 'c', 1, (byte) 170, 'd', 'e', 'f'}))); }</code><technical_language>renamed nonAscii</technical_language>

Target:
public void shouldSubstituteHexValuesInReplacementString() { String replacement = "abc\\x01\\xaadef"; ReplacerParamRule hexValueRegexRule = new ReplacerParamRule( "", REQ_HEADER_STR, "anyMatchString", true, replacement, null, true); assertThat( hexValueRegexRule.getEscapedReplacement(), equalTo( new String( new byte[] {'a', 'b', 'c', 1, (byte) 170, 'd', 'e', 'f'}, StandardCharsets.US_ASCII))); }
Source:
<code>public Map<String, Discrepancy> getDiscrepanciesList() { Map<String, Discrepancy> toReturn = new HashMap<String, Discrepancy>(); String discrepanciesJson = artifact.getSoleAttributeAsString(DispoConstants.DispoDiscrepanciesJson, "{}"); try { <START> JsonNode node = JsonUtil.getMapper().readTree(discrepanciesJson); Iterator<JsonNode> elements = node.getElements(); while (elements.hasNext()) { Discrepancy discrepancy = JsonUtil.getMapper().readValue(elements.next().toString(), Discrepancy.class); toReturn.put(discrepancy.getId(), discrepancy); <END> } } catch (Exception ex) { throw new OseeCoreException("Could not parse Discrepancies Json", ex); } return toReturn; }</code><technical_language>Suggest JSON related capabilities isolated JsonUtil class</technical_language>

Target:
public Map<String, Discrepancy> getDiscrepanciesList() { String discrepanciesJson = artifact.getSoleAttributeAsString(DispoConstants.DispoDiscrepanciesJson, "{}"); return DispoUtil.jsonStringToDiscrepanciesMap(discrepanciesJson); }
Source:
<code>public void setup() throws IOException, InterruptedException { m_eventdIpcMgr.setEventWriter(m_database); OnmsMonitoringLocation location = new OnmsMonitoringLocation(); location.setLocationName("Default"); m_locationDao.save(location); final OnmsNode node = new OnmsNode(location, "node1"); node.setId(NODE_ID_ONE); m_nodeDao.save(node); Hashtable<String, Object> producerConfig = new Hashtable<String, Object>(); producerConfig.put("group.id", "OpenNMS"); producerConfig.put("bootstrap.servers", kafkaServer.getKafkaConnectString()); ConfigurationAdmin configAdmin = mock(ConfigurationAdmin.class, RETURNS_DEEP_STUBS); when(configAdmin.getConfiguration(KAFKA_PRODUCER_CLIENT_PID).getProperties()).thenReturn(producerConfig); ExecutorService executor = Executors.newSingleThreadExecutor(); kafkaConsumer = new KafkaMessageConsumerRunner(kafkaServer.getKafkaConnectString()); executor.execute(kafkaConsumer); kafkaProducer = new OpennmsKafkaProducer(protobufMapper, nodeCache, configAdmin, m_eventdIpcMgr, alarmLifecycleListenerManager); kafkaProducer.setEventTopic("events"); kafkaProducer.setEventFilter("getUei().equals(\"uei.opennms.org/internal/discovery/newSuspect\")"); kafkaProducer.setNodeTopic("nodes"); kafkaProducer.init(); <START> Thread.sleep(2000); <END> }</code><technical_language>if takes longer initialize? await().atMost(1, MINUTES).until(() -> kafkaProducer.isReady())</technical_language>

Target:
public void setup() throws IOException, InterruptedException { m_eventdIpcMgr.setEventWriter(m_database); OnmsMonitoringLocation location = new OnmsMonitoringLocation(); location.setLocationName("Default"); m_locationDao.save(location); final OnmsNode node = new OnmsNode(location, "node1"); node.setId(NODE_ID_ONE); m_nodeDao.save(node); Hashtable<String, Object> producerConfig = new Hashtable<String, Object>(); producerConfig.put("group.id", "OpenNMS"); producerConfig.put("bootstrap.servers", kafkaServer.getKafkaConnectString()); ConfigurationAdmin configAdmin = mock(ConfigurationAdmin.class, RETURNS_DEEP_STUBS); when(configAdmin.getConfiguration(KAFKA_PRODUCER_CLIENT_PID).getProperties()).thenReturn(producerConfig); ExecutorService executor = Executors.newSingleThreadExecutor(); kafkaConsumerRunner = new KafkaMessageConsumerRunner(kafkaServer.getKafkaConnectString()); executor.execute(kafkaConsumerRunner); kafkaProducer = new OpennmsKafkaProducer(protobufMapper, nodeCache, configAdmin, m_eventdIpcMgr, alarmLifecycleListenerManager); kafkaProducer.setEventTopic("events"); kafkaProducer.setEventFilter("getUei().equals(\"uei.opennms.org/internal/discovery/newSuspect\")"); kafkaProducer.setNodeTopic("nodes"); kafkaProducer.init(); waitUntilTopicsAreInitialized(); }
Source:
<code>public long updateHash( HashFunction hashFunction, long hash ) { <START> class CodePointCursor <END> { byte[] values; int i; @SuppressWarnings( "WeakerAccess" ) int codePointCount; @SuppressWarnings( "WeakerAccess" ) long next() { codePointCount++; byte b = values[i]; if ( b >= 0 ) { i++; return b; } int bytesNeeded = 0; while ( b < 0 ) { bytesNeeded++; b = (byte) (b << 1); } int codePoint = codePoint( values, b, i, bytesNeeded ); i += bytesNeeded; return codePoint; } } CodePointCursor cpc = new CodePointCursor(); cpc.values = bytes; cpc.i = offset; int len = offset + byteLength; while ( cpc.i < len ) { long codePointA = cpc.next() << 32; long codePointB = 0L; if ( cpc.i < len ) { codePointB = cpc.next(); } hash = hashFunction.update( hash, codePointA + codePointB ); } return hashFunction.update( hash, cpc.codePointCount ); }</code><technical_language>code point loop exists in this CodePointCursor is sort of duplicated too. a good idea port places too? objects optimized escape this method, right</technical_language>

Target:
public long updateHash( HashFunction hashFunction, long hash ) { CodePointCursor cpc = new CodePointCursor(); cpc.values = bytes; cpc.i = offset; int len = offset + byteLength; while ( cpc.i < len ) { long codePointA = cpc.nextCodePoint() << 32; long codePointB = 0L; if ( cpc.i < len ) { codePointB = cpc.nextCodePoint(); } hash = hashFunction.update( hash, codePointA + codePointB ); } return hashFunction.update( hash, cpc.codePointCount ); }
Source:
<code>public void triggerCompleted() { getProcessInstance().removeEventListener(getEventType(), getEventListener(), true); ((org.jbpm.workflow.instance.NodeInstanceContainer)getNodeInstanceContainer()).setCurrentLevel(getLevel()); ((org.jbpm.workflow.instance.NodeInstanceContainer) getNodeInstanceContainer()).removeNodeInstance(this); NodeInstanceContainer container = ((org.jbpm.workflow.instance.NodeInstanceContainer) getNodeInstanceContainer()); <START> NodeInstance instance = container.getNodeInstance(getNode()); <END> triggerNodeInstance((org.jbpm.workflow.instance.NodeInstance) instance, NodeImpl.CONNECTION_DEFAULT_TYPE); }</code><technical_language>reason for this extra variable container</technical_language>

Target:
public void triggerCompleted() { getProcessInstance().removeEventListener(getEventType(), getEventListener(), true); ((org.jbpm.workflow.instance.NodeInstanceContainer)getNodeInstanceContainer()).setCurrentLevel(getLevel()); ((org.jbpm.workflow.instance.NodeInstanceContainer) getNodeInstanceContainer()).removeNodeInstance(this); NodeInstance instance = ((org.jbpm.workflow.instance.NodeInstanceContainer) getNodeInstanceContainer()).getNodeInstance(getNode()); triggerNodeInstance((org.jbpm.workflow.instance.NodeInstance) instance, NodeImpl.CONNECTION_DEFAULT_TYPE); }
Source:
<code>void mapActionItemsToSelection(ISelection selection) { setMoveItemsEnabled(false); if (selection == null || selection.isEmpty()) return; if (selection instanceof IStructuredSelection) { IStructuredSelection structured = (IStructuredSelection) selection; Object obj = structured.getFirstElement(); if (!(obj instanceof PlanElement)) return; PlanElement firstSelectedEntry = (PlanElement) obj; PlanElement lastSelectedEntry = firstSelectedEntry; ElementAction type = firstSelectedEntry.getPlanElementAction(); <START> unselectAllActionItemsExecpt(getItemFor(type)); <END> if (structured.size() > 1) { for (Iterator iterator = structured.iterator(); iterator .hasNext();) { Object selectedObj = iterator.next(); if (!(selectedObj instanceof PlanElement)) continue; PlanElement entry = lastSelectedEntry = (PlanElement) selectedObj; if (type != entry.getPlanElementAction()) { unselectAllActionItemsExecpt(null); } } } enableMoveButtons(firstSelectedEntry, lastSelectedEntry); } }</code><technical_language>find out if select one/deselect do right in UI if-block. This avoids unnecessary UI changes</technical_language>

Target:
void mapActionItemsToSelection(ISelection selection) { setMoveItemsEnabled(false); if (selection == null || selection.isEmpty()) return; if (selection instanceof IStructuredSelection) { IStructuredSelection structured = (IStructuredSelection) selection; Object obj = structured.getFirstElement(); if (!(obj instanceof PlanElement)) return; PlanElement firstSelectedEntry = (PlanElement) obj; PlanElement lastSelectedEntry = firstSelectedEntry; ElementAction type = firstSelectedEntry.getPlanElementAction(); boolean singleTypeSelected = true; if (structured.size() > 1) { for (Iterator iterator = structured.iterator(); iterator .hasNext();) { Object selectedObj = iterator.next(); if (!(selectedObj instanceof PlanElement)) continue; PlanElement entry = lastSelectedEntry = (PlanElement) selectedObj; if (type != entry.getPlanElementAction()) { singleTypeSelected = false; break; } } } if (singleTypeSelected) { unselectAllActionItemsExecpt(getItemFor(type)); } else { unselectAllActionItemsExecpt(null); } enableMoveButtons(firstSelectedEntry, lastSelectedEntry); } }
Source:
<code>public void testToMillisOverflow() throws Exception { Duration duration = Duration.parse("P60000000000000D"); try { context.getTypeConverter().convertTo(long.class, duration); } catch (TypeConversionException e) { assertIsInstanceOf(ArithmeticException.class, e.getCause().getCause()); <START> assertThat(e.getMessage(), is("Error during type conversion from type: java.time.Duration to the required type: " + <END> "long with value PT1440000000000000H due java.lang.ArithmeticException: long overflow")); } }</code><technical_language>I if people running locale GERMAN, CHINESE get localized error messages JDK? need check exception type, try change default locale restore test</technical_language>

Target:
public void testToMillisOverflow() throws Exception { Duration duration = Duration.parse("P60000000000000D"); try { context.getTypeConverter().convertTo(long.class, duration); } catch (TypeConversionException e) { assertIsInstanceOf(ArithmeticException.class, e.getCause().getCause()); } }
Source:
<code>private void publishChildren(IModule[] module, ArrayList<IStatus> results, IModule[] children, File parentModule, IProgressMonitor monitor) { if( children == null ) return; monitor.beginTask("Assembling child modules", children.length * 100); <START> for( int i = 0; i < children.length; i++ ) { <END> if( ServerModelUtilities.isBinaryModule(children[i])) results.addAll(Arrays.asList(fullBinaryPublish(module, children[i], ProgressMonitorUtil.submon(monitor, 100)))); else results.addAll(Arrays.asList(fullPublish(combine(module, children[i]), parentModule, ProgressMonitorUtil.submon(monitor, 100)))); } }</code><technical_language>check if monitor is cancelled</technical_language>

Target:
private void publishChildren(IModule[] module, ArrayList<IStatus> results, IModule[] children, File parentModule, IProgressMonitor monitor) { if( children == null ) return; monitor.beginTask("Assembling child modules", children.length * 100); for( int i = 0; i < children.length && !monitor.isCanceled(); i++ ) { if( ServerModelUtilities.isBinaryModule(children[i])) results.addAll(Arrays.asList(fullBinaryPublish(module, children[i], ProgressMonitorUtil.submon(monitor, 100)))); else results.addAll(Arrays.asList(fullPublish(combine(module, children[i]), parentModule, ProgressMonitorUtil.submon(monitor, 100)))); } }
Source:
<code>public boolean isReady() { <START> return false; <END> }</code><technical_language>@Irenyak1 return false here</technical_language>

Target:
public boolean isReady() { return this.isReady(); }
Source:
<code>private void queueWork(int maximumMessageCount, Duration maxWaitTime, FluxSink<ServiceBusReceivedMessageContext> emitter) { synchronized (lock) { final long id = idGenerator.getAndIncrement(); final SynchronousReceiveWork work = new SynchronousReceiveWork(id, maximumMessageCount, maxWaitTime, emitter); final SynchronousMessageSubscriber syncSubscriber = new SynchronousMessageSubscriber(work); EmitterProcessor<SynchronousMessageSubscriber> workProcessor = workQueueProcessor.get(); <START> workProcessor.onNext(syncSubscriber); <END> Disposable thisWorkSubscriber = workSubscriber.get(); if (thisWorkSubscriber != null) { logger.info("[{}]: Receive request is placed in queue to process.", id); return; } EmitterProcessor<ServiceBusReceivedMessageContext> source = messageSource.get(); if (source == null) { source = this.asyncClient.receive(DEFAULT_RECEIVE_OPTIONS) .subscribeWith(EmitterProcessor.create(asyncClient.getReceiverOptions().getPrefetchCount(), false)); messageSource.set(source); logger.info("Created source for receiving messages."); } EmitterProcessor<ServiceBusReceivedMessageContext> finalSource = source; thisWorkSubscriber = workProcessor .subscribe(currentWork -> finalSource.subscribe(currentWork), error -> { logger.error("Error in processing messages [{}]", error); }, () -> { logger.info("Receiving messages completed."); }); workSubscriber.set(thisWorkSubscriber); } }</code><technical_language>done a sink</technical_language>

Target:
private void queueWork(int maximumMessageCount, Duration maxWaitTime, FluxSink<ServiceBusReceivedMessageContext> emitter) { final long id = idGenerator.getAndIncrement(); final SynchronousReceiveWork work = new SynchronousReceiveWork(id, maximumMessageCount, maxWaitTime, emitter); SynchronousMessageSubscriber messageSubscriber = synchronousMessageSubscriber.get(); if (messageSubscriber == null) { long prefetch = asyncClient.getReceiverOptions().getPrefetchCount(); SynchronousMessageSubscriber newSubscriber = new SynchronousMessageSubscriber(prefetch, work); if (!synchronousMessageSubscriber.compareAndSet(null, newSubscriber)) { newSubscriber.dispose(); SynchronousMessageSubscriber existing = synchronousMessageSubscriber.get(); existing.queueWork(work); } else { asyncClient.receive().subscribeWith(newSubscriber); } } else { messageSubscriber.queueWork(work); } logger.verbose("[{}] Receive request queued up.", work.getId()); }
Source:
<code>private static String truncateLegalFirstNameToMaximumAllowedLengthWhenFormattedWithLegalLastName(String legalLastName, String legalFirstName) { int maxAllowedLengthOfFirstName = VendorConstants.MAX_VENDOR_NAME_LENGTH - VendorConstants.NAME_DELIM.length() - legalLastName.length(); if (legalFirstName.length() <= maxAllowedLengthOfFirstName) { return legalFirstName; } else { <START> String truncatedLegalFirstName = legalFirstName.substring(0, maxAllowedLengthOfFirstName); <END> LOG.info("truncateLegalFirstNameToMaximumAllowedLengthWhenFormattedWithLegalLastName: Received legalFirstName '" + legalFirstName + "' with length of " + legalFirstName.length() + " and it is being truncated to '" + truncatedLegalFirstName + "' with length of " + truncatedLegalFirstName.length()); return truncatedLegalFirstName; } }</code><technical_language>If length of legal name is max length, legal name get truncated empty string. I this code handle it, if put in explicit check for that, code intention more easily understood</technical_language>

Target:
private static String truncateLegalFirstNameToMaximumAllowedLengthWhenFormattedWithLegalLastName(String legalLastName, String legalFirstName) { int maxAllowedLengthOfFirstName = VendorConstants.MAX_VENDOR_NAME_LENGTH - VendorConstants.NAME_DELIM.length() - legalLastName.length(); if (maxAllowedLengthOfFirstName <= 0) { LOG.info("truncateLegalFirstNameToMaximumAllowedLengthWhenFormattedWithLegalLastName: legalLastName is '" + legalLastName + "'. Received legalFirstName '" + legalFirstName + "' with length of " + legalFirstName.length() + " and it is being truncated to '" + KFSConstants.EMPTY_STRING + "' with length of 0."); return KFSConstants.EMPTY_STRING; } else if (legalFirstName.length() <= maxAllowedLengthOfFirstName) { return legalFirstName; } else { String truncatedLegalFirstName = legalFirstName.substring(0, maxAllowedLengthOfFirstName); LOG.info("truncateLegalFirstNameToMaximumAllowedLengthWhenFormattedWithLegalLastName: legalLastName is '" + legalLastName + "Received legalFirstName '" + legalFirstName + "' with length of " + legalFirstName.length() + " and it is being truncated to '" + truncatedLegalFirstName + "' with length of " + truncatedLegalFirstName.length()); return truncatedLegalFirstName; } }
Source:
<code>public void onTimer(String serverId, String volumeId, String snapshotNamePrefix, String description, boolean force) { GlusterVolumeEntity volume = getGlusterVolumeDao().getById(new Guid(volumeId)); GlusterVolumeSnapshotEntity snapshot = new GlusterVolumeSnapshotEntity(); snapshot.setClusterId(volume.getClusterId()); snapshot.setVolumeId(new Guid(volumeId)); DateFormat df = new SimpleDateFormat("yyyyMMddHHmmss"); String snapshotName = snapshotNamePrefix + "-snap-" + df.format(new Date()); snapshot.setSnapshotName(snapshotName); snapshot.setDescription(description); VDSReturnValue returnValue = getBackend().getResourceManager() .RunVdsCommand(VDSCommandType.CreateGlusterVolumeSnapshot, new GlusterVolumeCreateSnapshotVDSParameters(new Guid(serverId), volume.getName(), snapshotName, description, force)); if (returnValue.getSucceeded()) { snapshot.setSnapshotId((Guid) returnValue.getReturnValue()); snapshot.setCreatedAt(new Date()); snapshot.setStatus(GlusterSnapshotStatus.STARTED); getGlusterVolumeSnapshotDao().save(snapshot); } else { <START> log.error("Error while creating snapshot for volume '{}': {}", volume.getName(), returnValue.getVdsError() <END> .getMessage()); log.debug(returnValue.getVdsError().getMessage()); } }</code><technical_language>raising Audit log for failure? Otherwise, difficult track snapshots failed</technical_language>

Target:
public void onTimer(String serverId, String volumeId, String snapshotNamePrefix, String description, boolean force) { GlusterVolumeEntity volume = getGlusterVolumeDao().getById(new Guid(volumeId)); GlusterVolumeSnapshotEntity snapshot = new GlusterVolumeSnapshotEntity(); snapshot.setClusterId(volume.getClusterId()); snapshot.setVolumeId(new Guid(volumeId)); DateFormat df = new SimpleDateFormat("yyyyMMddHHmmss"); String snapshotName = snapshotNamePrefix + "-snap-" + df.format(new Date()); snapshot.setSnapshotName(snapshotName); snapshot.setDescription(description); VdcReturnValueBase returnValue = getBackend().runInternalAction(VdcActionType.CreateGlusterVolumeSnapshot, new CreateGlusterVolumeSnapshotParameters(snapshot, force)); if (!returnValue.getSucceeded()) { log.error("Error while creating snapshot for volume '{}': {}", volume.getName(), returnValue.getExecuteFailedMessages().toString()); log.debug(returnValue.getExecuteFailedMessages().toString()); } }
Source:
<code>public boolean removeFileEntry(String index, TransientStore ts) { BatchFileEntry fileEntry = getFileEntry(index, false); <START> if (fileEntry != null) { <END> if (fileEntry.isChunked()) { for (String chunkEntryKey : fileEntry.getChunkEntryKeys()) { List<Blob> chunkBlobs = ts.getBlobs(chunkEntryKey); if (chunkBlobs != null) { for (Blob blob : chunkBlobs) { try { FileUtils.deleteDirectory(blob.getFile().getParentFile()); } catch (IOException e) { log.error("Error while deleting chunk parent directory", e); } } } ts.remove(chunkEntryKey); } fileEntry.beforeRemove(); } String fileEntryKey = fileEntry.getKey(); List<Blob> fileBlobs = ts.getBlobs(fileEntryKey); if (fileBlobs != null) { for (Blob blob : fileBlobs) { try { FileUtils.deleteDirectory(blob.getFile().getParentFile()); } catch (IOException e) { log.error("Error while deleting file parent directory", e); } } } ts.remove(fileEntryKey); return true; } else { return false; } }</code><technical_language>if (fileEntry == null) {return false;} else allowing remove indentation level for successful case</technical_language>

Target:
public boolean removeFileEntry(String index, TransientStore ts) { BatchFileEntry fileEntry = getFileEntry(index, false); if (fileEntry == null) { return false; } if (fileEntry.isChunked()) { for (String chunkEntryKey : fileEntry.getChunkEntryKeys()) { List<Blob> chunkBlobs = ts.getBlobs(chunkEntryKey); if (chunkBlobs != null) { for (Blob blob : chunkBlobs) { try { FileUtils.deleteDirectory(blob.getFile().getParentFile()); } catch (IOException e) { log.error("Error while deleting chunk parent directory", e); } } } ts.remove(chunkEntryKey); } fileEntry.beforeRemove(); } String fileEntryKey = fileEntry.getKey(); List<Blob> fileBlobs = ts.getBlobs(fileEntryKey); if (fileBlobs != null) { for (Blob blob : fileBlobs) { try { FileUtils.deleteDirectory(blob.getFile().getParentFile()); } catch (IOException e) { log.error("Error while deleting file parent directory", e); } } } ts.remove(fileEntryKey); return true; }
Source:
<code>public CertificationRequest(CertificationRequestInfo certificationRequestInfo, SignatureAlgorithmIdentifier signatureAlgorithmIdentifier, byte[] signature) { this.certificationRequestInfo = requireNonNull(certificationRequestInfo, "certificationRequestInfo is null"); this.signatureAlgorithmIdentifier = requireNonNull(signatureAlgorithmIdentifier, "signatureAlgorithmIdentifier is null"); <START> this.signature = signature; <END> this.encoded = encodeSequence( certificationRequestInfo.getEncoded(), encodeSequence(signatureAlgorithmIdentifier.getEncoded()), encodeBitString(0, signature)); }</code><technical_language>Check for null a defensive copy java this.signature = requireNonNull(signature, "signature is null").clone();</technical_language>

Target:
public CertificationRequest(CertificationRequestInfo certificationRequestInfo, SignatureAlgorithmIdentifier signatureAlgorithmIdentifier, byte[] signature) { this.certificationRequestInfo = requireNonNull(certificationRequestInfo, "certificationRequestInfo is null"); this.signatureAlgorithmIdentifier = requireNonNull(signatureAlgorithmIdentifier, "signatureAlgorithmIdentifier is null"); this.signature = requireNonNull(signature, "signature is null").clone(); this.encoded = encodeSequence( certificationRequestInfo.getEncoded(), encodeSequence(signatureAlgorithmIdentifier.getEncoded()), encodeBitString(0, signature)); }
Source:
<code>public void load() { IEclipsePreferences prefs = EclipsePreferencesUtils.getInstanceScope().getNode(UiPlugin.PLUGIN_ID); this.projectTasksVisible = prefs.getBoolean(PREF_PROJECT_TASKS_VISIBLE, false); this.taskSelectorsVisible = prefs.getBoolean(PREF_TASK_SELECTORS_VISIBLE, true); this.privateTasksVisible = prefs.getBoolean(PREF_PRIVATE_TASKS_VISIBLE, false); this.sortByType = prefs.getBoolean(PREF_SORT_BY_TYPE, true); this.sortByVisibility = prefs.getBoolean(PREF_SORT_BY_VISIBILITY, true); this.linkToSelection = prefs.getBoolean(PREF_LINK_TO_SELECTION, false); this.headerNameColumnWidth = prefs.getInt(PREF_HEADER_NAME_COLUMN_WIDTH, 200); this.headerDescriptionColumnWidth = prefs.getInt(PREF_HEADER_DESCRIPTION_COLUMN_WIDTH, 400); <START> this.groupProjects = prefs.getBoolean(PREF_GROUP_PROJECTS_BY_HIERARCHY, true); <END> this.groupTasks = prefs.getBoolean(PREF_GROUP_TASKS, true); }</code><technical_language>Making hierarchical project representation default breaks test coverage. I ran build CI, able check results [here](<LINK_0> (credentials: guest/guest). If not, please know</technical_language>

Target:
public void load() { IEclipsePreferences prefs = EclipsePreferencesUtils.getInstanceScope().getNode(UiPlugin.PLUGIN_ID); this.projectTasksVisible = prefs.getBoolean(PREF_PROJECT_TASKS_VISIBLE, false); this.taskSelectorsVisible = prefs.getBoolean(PREF_TASK_SELECTORS_VISIBLE, true); this.privateTasksVisible = prefs.getBoolean(PREF_PRIVATE_TASKS_VISIBLE, false); this.sortByType = prefs.getBoolean(PREF_SORT_BY_TYPE, true); this.sortByVisibility = prefs.getBoolean(PREF_SORT_BY_VISIBILITY, true); this.linkToSelection = prefs.getBoolean(PREF_LINK_TO_SELECTION, false); this.headerNameColumnWidth = prefs.getInt(PREF_HEADER_NAME_COLUMN_WIDTH, 200); this.headerDescriptionColumnWidth = prefs.getInt(PREF_HEADER_DESCRIPTION_COLUMN_WIDTH, 400); this.groupTasks = prefs.getBoolean(PREF_GROUP_TASKS, true); this.projectHierarchyFlattened = prefs.getBoolean(PREF_FLATTEN_PROJECT_HIERARCHY, false); }