auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code><START> public void nonInterleavedOperationsTest() <END> throws Exception { for (int i = 0; i < 10; i++) { Queue<OperationType> opChain = new LinkedList<>(); opChain.add(OperationType.PUT_NB); opChain.add(OperationType.AWAIT_CREATION); opChain.add(OperationType.GET_INFO_NB); opChain.add(OperationType.GET_NB); opChain.add(OperationType.DELETE_NB); opChain.add(OperationType.AWAIT_DELETION); opChain.add(OperationType.GET_INFO_DELETED_NB); opChain.add(OperationType.GET_DELETED_NB); testFramework.checkOperationChains( Collections.singletonList(testFramework.startOperationChain(32 * 1024, i, opChain))); } }</code><technical_language>case covered interleavedOperationsTest()? Or, error identified this test</technical_language>

Target:
public void nonInterleavedOperationsTest() throws Exception { Random random = new Random(); for (int i = 0; i < 10; i++) { Queue<OperationType> operations = new LinkedList<>(); operations.add(OperationType.PUT_NB); operations.add(OperationType.AWAIT_CREATION); operations.add(OperationType.GET_INFO_NB); operations.add(OperationType.GET_NB); operations.add(OperationType.DELETE_NB); operations.add(OperationType.AWAIT_DELETION); operations.add(OperationType.GET_INFO_DELETED_NB); operations.add(OperationType.GET_DELETED_NB); int blobSize = random.nextInt(100 * 1024); testFramework.checkOperationChains( Collections.singletonList(testFramework.startOperationChain(blobSize, i, operations))); } }
Source:
<code>private List<Integer> getKeys(final Collection<NMFData> dataValues) { final List<Integer> keys = new ArrayList<>(); final Set<Integer> keySet = Sets.newTreeSet(); for (final NMFData datum : dataValues) { keySet.addAll( datum.getColumns() .stream() .map(Pair::getFirst) .collect(Collectors.toList())); } <START> return keys; <END> }</code><technical_language>returning empty ArrayList keys</technical_language>

Target:
private List<Integer> getKeys(final Collection<NMFData> dataValues) { final ArrayList<Integer> keys = new ArrayList<>(); final Set<Integer> keySet = Sets.newTreeSet(); for (final NMFData datum : dataValues) { keySet.addAll( datum.getColumns() .stream() .distinct() .map(Pair::getFirst) .collect(Collectors.toList())); } keys.ensureCapacity(keySet.size()); keys.addAll(keySet); return keys; }
Source:
<code>public BlobIdTransformerTest() throws IOException { BlobIdStringPair[] blobIdStringPairs = new BlobIdStringPair[]{BLOB_ID_PAIR_VERSION_1_CONVERTED, BLOB_ID_PAIR_VERSION_2_CONVERTED, BLOB_ID_PAIR_VERSION_3_CONVERTED}; mockStoreKeyConverter = createAndSetupMockStoreKeyConverter(blobIdStringPairs); <START> transformer = new BlobIdTransformer(mockStoreKeyConverter, blobIdFactory, null); <END> blobIdStringPairList = new ArrayList<>(Arrays.asList(blobIdStringPairs)); blobIdStringPairList.add(new BlobIdStringPair(VERSION_3_UNCONVERTED, null)); }</code><technical_language>test cache code exercised</technical_language>

Target:
public BlobIdTransformerTest() throws IOException { Pair<String, String>[] pairs = new Pair[]{BLOB_ID_PAIR_VERSION_1_CONVERTED, BLOB_ID_PAIR_VERSION_2_CONVERTED, BLOB_ID_PAIR_VERSION_3_CONVERTED, BLOB_ID_PAIR_VERSION_3_NULL}; factory = new MockStoreKeyConverterFactory(null, null); factory.setReturnInputIfAbsent(true); StoreKeyConverter storeKeyConverter = createAndSetupMockStoreKeyConverter(factory, pairs); transformer = new BlobIdTransformer(storeKeyConverter, blobIdFactory); pairList = new ArrayList<>(Arrays.asList(pairs)); pairList.add(new Pair<>(VERSION_3_UNCONVERTED, VERSION_3_UNCONVERTED)); }
Source:
<code>public SweepResults sweepSnapshotValues() { TodoSchemaTableFactory tableFactory = TodoSchemaTableFactory.of(Namespace.DEFAULT_NAMESPACE); <START> TableReference indexTable = tableFactory.getSnapshotsStreamValueTable(null).getTableRef(); <END> SweepBatchConfig sweepConfig = ImmutableSweepBatchConfig.builder() .candidateBatchSize(AtlasDbConstants.DEFAULT_SWEEP_CANDIDATE_BATCH_HINT) .deleteBatchSize(AtlasDbConstants.DEFAULT_SWEEP_DELETE_BATCH_HINT) .maxCellTsPairsToExamine(AtlasDbConstants.DEFAULT_SWEEP_READ_LIMIT) .build(); return sweepTaskRunner.get().run(indexTable, sweepConfig, PtBytes.EMPTY_BYTE_ARRAY); }</code><technical_language>extract part below? Also, rename tableRef</technical_language>

Target:
public SweepResults sweepSnapshotValues() { TodoSchemaTableFactory tableFactory = TodoSchemaTableFactory.of(Namespace.DEFAULT_NAMESPACE); TableReference valueTable = tableFactory.getSnapshotsStreamValueTable(null).getTableRef(); return sweepTable(valueTable); }
Source:
<code>public String forwardMenuDefaultPlugin(@Valid @NotNull @PathVariable String menuId, Model model) { Menu menu = menuReaderService .getMenu() <START> .flatMap(it -> it.findMenu(menuId)) <END> .orElseThrow( () -> new RuntimeException("menu with id [" + menuId + "] does not exist")); model.addAttribute(KEY_MENU_ID, menuId); String pluginId = menu.firstItem().map(MenuItem::getId).orElse(VoidPluginController.ID); String contextUri = URI + '/' + menuId + '/' + pluginId; addModelAttributes(model, contextUri); return getForwardPluginUri(pluginId); }</code><technical_language>'it' stand for , please a variable name sense in context of domain</technical_language>

Target:
public String forwardMenuDefaultPlugin(@Valid @NotNull @PathVariable String menuId, Model model) { Menu filteredMenu = menuReaderService .getMenu() .flatMap(menu -> menu.findMenu(menuId)) .orElseThrow( () -> new RuntimeException("menu with id [" + menuId + "] does not exist")); model.addAttribute(KEY_MENU_ID, menuId); String pluginId = filteredMenu.firstItem().map(MenuItem::getId).orElse(VoidPluginController.ID); String contextUri = URI + '/' + menuId + '/' + pluginId; addModelAttributes(model, contextUri); return getForwardPluginUri(pluginId); }
Source:
<code>public void error_missingIndexBackend_emptyOptional() { String keyPrefix = "somePrefix."; resetAll(); EasyMock.expect( configurationSourceMock.get( "indexes.indexName.backend" ) ) .andReturn( Optional.empty() ); EasyMock.expect( configurationSourceMock.resolve( "indexes.indexName.backend" ) ) .andReturn( Optional.of( keyPrefix + "indexes.indexName.backend" ) ); EasyMock.expect( configurationSourceMock.get( "indexes.default.backend" ) ) .andReturn( Optional.empty() ); EasyMock.expect( configurationSourceMock.resolve( "indexes.default.backend" ) ) .andReturn( Optional.of( keyPrefix + "indexes.default.backend" ) ); replayAll(); thrown.expect( SearchException.class ); thrown.expectMessage( "Missing backend reference for index 'indexName'" ); thrown.expectMessage( "Set the property 'somePrefix.indexes.indexName.backend' to a supported value" ); <START> thrown.expectMessage( "or set 'somePrefix.indexes.default.backend' to set a default for all indexes" ); <END> holder.startBuilding( "indexName", false ); verifyAll(); }</code><technical_language>If change message, changed here</technical_language>

Target:
public void error_missingIndexBackend_emptyOptional() { String keyPrefix = "somePrefix."; resetAll(); EasyMock.expect( configurationSourceMock.get( "indexes.indexName.backend" ) ) .andReturn( Optional.empty() ); EasyMock.expect( configurationSourceMock.resolve( "indexes.indexName.backend" ) ) .andReturn( Optional.of( keyPrefix + "indexes.indexName.backend" ) ); EasyMock.expect( configurationSourceMock.get( "indexes.default.backend" ) ) .andReturn( Optional.empty() ); EasyMock.expect( configurationSourceMock.resolve( "indexes.default.backend" ) ) .andReturn( Optional.of( keyPrefix + "indexes.default.backend" ) ); replayAll(); thrown.expect( SearchException.class ); thrown.expectMessage( "Missing backend reference for index 'indexName'" ); thrown.expectMessage( "Set the property 'somePrefix.indexes.indexName.backend' to a supported value" ); thrown.expectMessage( "or set 'somePrefix.indexes.default.backend' to set a default value for all indexes" ); holder.startBuilding( "indexName", false ); verifyAll(); }
Source:
<code><START> public GenericRow transform(GenericRow record) { <END> for (Map.Entry<String, ExpressionEvaluator> entry : _expressionEvaluators.entrySet()) { String column = entry.getKey(); ExpressionEvaluator transformExpressionEvaluator = entry.getValue(); if (record.getValue(column) == null || column.equals(_timeColumn)) { Object result = transformExpressionEvaluator.evaluate(record); record.putValue(column, result); } } return record; }</code><technical_language>consider this evaluators ordered? derived a field based another derived field</technical_language>

Target:
public GenericRow transform(GenericRow record) { for (Map.Entry<String, ExpressionEvaluator> entry : _expressionEvaluators.entrySet()) { String column = entry.getKey(); ExpressionEvaluator transformExpressionEvaluator = entry.getValue(); if (record.getValue(column) == null) { Object result = transformExpressionEvaluator.evaluate(record); record.putValue(column, result); } } return record; }
Source:
<code><START> public static String urlDecode(String arg) { <END> try { return URLDecoder.decode(arg, UTF_8.name()); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); } }</code><technical_language>revert this code in this PR</technical_language>

Target:
private static String urlDecode(String arg) { try { return URLDecoder.decode(arg, UTF_8.name()); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); } }
Source:
<code>public ServerConversation(List<ServerMessage> messages) { this.messages = messages; long latest = 0; for (ServerMessage message : messages) { if (message.sentEpochMillis > latest) latest = message.sentEpochMillis; } ServerMessage lastMessage = messages.get(messages.size() - 1); <START> this.isDismissed = lastMessage.isDismissed || lastMessage.type == ServerMessage.Type.FromUser; <END> this.latestEpochMillis = latest; }</code><technical_language>part of this statement is surprising (but i it)</technical_language>

Target:
public ServerConversation(List<ServerMessage> messages) { this.messages = messages; long latest = 0; for (ServerMessage message : messages) { if (message.sentEpochMillis > latest) latest = message.sentEpochMillis; } ServerMessage lastMessage = messages.get(messages.size() - 1); this.isDisplayable = !lastMessage.isDismissed && lastMessage.type != ServerMessage.Type.FromUser; this.latestEpochMillis = latest; }
Source:
<code>public static void editSelectedCell(final GridWidget gridWidget) { final GridData gridModel = gridWidget.getModel(); <START> <END> if (gridModel.getSelectedHeaderCells().size() > 0) { final GridData.SelectedCell selectedCell = gridModel.getSelectedHeaderCells().get(0); final int uiHeaderRowIndex = selectedCell.getRowIndex(); final int uiColumnIndex = ColumnIndexUtilities.findUiColumnIndex(gridModel.getColumns(), selectedCell.getColumnIndex()); final GridColumn<?> column = gridModel.getColumns().get(uiColumnIndex); final GridColumn.HeaderMetaData headerMetaData = column.getHeaderMetaData().get(uiHeaderRowIndex); final BaseGridRendererHelper rendererHelper = gridWidget.getRendererHelper(); final BaseGridRendererHelper.RenderingInformation ri = rendererHelper.getRenderingInformation(); final double columnXCoordinate = rendererHelper.getColumnOffset(column) + column.getWidth() / 2; final BaseGridRendererHelper.ColumnInformation ci = rendererHelper.getColumnInformation(columnXCoordinate); final GridBodyCellEditContext context = CellContextUtilities.makeRenderContext(gridWidget, ri, ci, null, uiHeaderRowIndex); headerMetaData.edit(context); } else if (gridModel.getSelectedCells().size() == 1) { final GridData.SelectedCell origin = gridModel.getSelectedCellsOrigin(); if (origin == null) { return; } gridWidget.startEditingCell(origin.getRowIndex(), ColumnIndexUtilities.findUiColumnIndex(gridModel.getColumns(), origin.getColumnIndex())); } }</code><technical_language>@jomarko Good point, true</technical_language>

Target:
public static void editSelectedCell(final GridWidget gridWidget) { final GridData gridModel = gridWidget.getModel(); if (gridModel.getSelectedHeaderCells().size() > 0) { final GridData.SelectedCell selectedCell = gridModel.getSelectedHeaderCells().get(0); final int uiHeaderRowIndex = selectedCell.getRowIndex(); final int uiColumnIndex = ColumnIndexUtilities.findUiColumnIndex(gridModel.getColumns(), selectedCell.getColumnIndex()); final GridColumn<?> column = gridModel.getColumns().get(uiColumnIndex); final GridColumn.HeaderMetaData headerMetaData = column.getHeaderMetaData().get(uiHeaderRowIndex); final BaseGridRendererHelper rendererHelper = gridWidget.getRendererHelper(); final BaseGridRendererHelper.RenderingInformation ri = rendererHelper.getRenderingInformation(); final double columnXCoordinate = rendererHelper.getColumnOffset(column) + column.getWidth() / 2; final BaseGridRendererHelper.ColumnInformation ci = rendererHelper.getColumnInformation(columnXCoordinate); final GridBodyCellEditContext context = CellContextUtilities.makeRenderContext(gridWidget, ri, ci, null, uiHeaderRowIndex); headerMetaData.edit(context); } else if (gridModel.getSelectedCells().size() > 0) { final GridData.SelectedCell origin = gridModel.getSelectedCellsOrigin(); if (origin == null) { return; } gridWidget.startEditingCell(origin.getRowIndex(), ColumnIndexUtilities.findUiColumnIndex(gridModel.getColumns(), origin.getColumnIndex())); } }
Source:
<code>public RecordReader<NullWritable, StructuredRecord> createRecordReader(InputSplit split, TaskAttemptContext context) throws IOException, InterruptedException { if (!(split instanceof FileSplit)) { throw new IllegalStateException("Input split is not a FileSplit."); } FileSplit fileSplit = (FileSplit) split; String pathField = context.getConfiguration().get(PATH_FIELD); boolean filenameOnly = context.getConfiguration().getBoolean(FILENAME_ONLY, false); String path = filenameOnly ? fileSplit.getPath().getName() : fileSplit.getPath().toUri().toString(); <START> fileSourceFormat = fileSourceFormat.toLowerCase(); <END> if (Objects.equals(fileSourceFormat, "avro")) { RecordReader<AvroKey<GenericRecord>, NullWritable> delegate = (new AvroKeyInputFormat<GenericRecord>()) .createRecordReader(split, context); return new TrackingAvroRecordReader(delegate, pathField, path); } else if (Objects.equals(fileSourceFormat, "parquet")) { RecordReader<Void, GenericRecord> delegate = (new AvroParquetInputFormat<GenericRecord>()) .createRecordReader(split, context); return new TrackingParquetRecordReader(delegate, pathField, path); } else { RecordReader<LongWritable, Text> delegate = (new TextInputFormat()).createRecordReader(split, context); return new TrackingTextRecordReader(delegate, pathField, path); } }</code><technical_language>this throw a null pointer exception in distributed mode. reason tests passing is running locally in JVM. Please plugin works a cluster</technical_language>

Target:
public RecordReader<NullWritable, StructuredRecord> createRecordReader(InputSplit split, TaskAttemptContext context) throws IOException, InterruptedException { if (!(split instanceof FileSplit)) { throw new IllegalStateException("Input split is not a FileSplit."); } FileSplit fileSplit = (FileSplit) split; String pathField = context.getConfiguration().get(PATH_FIELD); boolean filenameOnly = context.getConfiguration().getBoolean(FILENAME_ONLY, false); String format = context.getConfiguration().get(FORMAT); String path = filenameOnly ? fileSplit.getPath().getName() : fileSplit.getPath().toUri().toString(); String schema = context.getConfiguration().get(SCHEMA); if ("avro".equalsIgnoreCase(format)) { RecordReader<AvroKey<GenericRecord>, NullWritable> delegate = (new AvroKeyInputFormat<GenericRecord>()) .createRecordReader(split, context); return new TrackingAvroRecordReader(delegate, pathField, path, schema, job); } else if ("parquet".equalsIgnoreCase(format)) { RecordReader<Void, GenericRecord> delegate = (new AvroParquetInputFormat<GenericRecord>()) .createRecordReader(split, context); return new TrackingParquetRecordReader(delegate, pathField, path, schema, job); } else { RecordReader<LongWritable, Text> delegate = (new TextInputFormat()).createRecordReader(split, context); return new TrackingTextRecordReader(delegate, pathField, path); } }
Source:
<code>default ClusteredGetCommand buildClusteredGetCommand(Object key, long flagsBitSet, boolean acquireRemoteLock, GlobalTransaction gtx) { <START> if (acquireRemoteLock) throw new UnsupportedOperationException(); <END> return buildClusteredGetCommand(key, flagsBitSet); }</code><technical_language>please add some information exception</technical_language>

Target:
default ClusteredGetCommand buildClusteredGetCommand(Object key, long flagsBitSet, boolean acquireRemoteLock, GlobalTransaction gtx) { if (acquireRemoteLock) throw new UnsupportedOperationException("acquireRemoteLock is not supported, use Flag.FORCE_WRITE_LOCK"); return buildClusteredGetCommand(key, flagsBitSet); }
Source:
<code>public boolean remove(K key) throws CacheAccessException { checkKey(key); XATransactionContext<K, V> currentContext = getCurrentContext(); if (currentContext.touched(key)) { V oldValue = currentContext.oldValueOf(key); currentContext.addCommand(key, new StoreRemoveCommand<V>(oldValue)); <START> return true; <END> } ValueHolder<SoftLock<V>> softLockValueHolder = getSoftLockValueHolderFromUnderlyingStore(key); if (softLockValueHolder != null) { SoftLock<V> softLock = softLockValueHolder.value(); if (isInDoubt(softLock)) { currentContext.addCommand(key, new StoreEvictCommand<V>(softLock.getOldValue())); } else { currentContext.addCommand(key, new StoreRemoveCommand<V>(softLock.getOldValue())); } } return true; }</code><technical_language>if oldValue is null, if is eviction command</technical_language>

Target:
public boolean remove(K key) throws CacheAccessException { checkKey(key); XATransactionContext<K, V> currentContext = getCurrentContext(); if (currentContext.touched(key)) { V oldValue = currentContext.oldValueOf(key); currentContext.addCommand(key, new StoreRemoveCommand<V>(oldValue)); if (oldValue == null) { return false; } else { return true; } } ValueHolder<SoftLock<V>> softLockValueHolder = getSoftLockValueHolderFromUnderlyingStore(key); boolean status = true; if (softLockValueHolder != null) { SoftLock<V> softLock = softLockValueHolder.value(); if (isInDoubt(softLock)) { status = currentContext.addCommand(key, new StoreEvictCommand<V>(softLock.getOldValue())); } else { status = currentContext.addCommand(key, new StoreRemoveCommand<V>(softLock.getOldValue())); } } return status; }
Source:
<code>public void onEvent(SyncedMapEvent event) { switch (event.getAction()) { case SET: case ADD: for (Pair<Integer, String> item : event.getModifiedElements()) { final int id = item.getLeft(); final String clazzName = item.getRight(); if (id >= opcodeTable.length) { throw new IllegalStateException("Server sent a packet id which is greater than the client has allowed."); } <START> <END> MessageCodec<?> codec = opcodeTable[id]; if ((codec != null && codec.getClass().getName().equals(clazzName))) { continue; } try { Class<? extends MessageCodec> clazz = Class.forName(clazzName, true, loader).asSubclass(MessageCodec.class); Constructor<? extends MessageCodec> constr = clazz.getConstructor(int.class); codec = constr.newInstance(id); codec.setDynamic(true); register(codec); } catch (ClassCastException | ClassNotFoundException | NoSuchMethodException | IllegalAccessException | InstantiationException | InvocationTargetException e) { if (Spout.debugMode()) { e.printStackTrace(); } } } break; case REMOVE: for (Pair<Integer, String> item : event.getModifiedElements()) { MessageCodec<?> codec = find(item.getLeft()); if (codec != null && codec.getClass().getName().equals(item.getRight())) { opcodeTable[codec.getOpcode()] = null; classTable.remove(codec.getType()); } } break; } }</code><technical_language>Lose this line</technical_language>

Target:
public void onEvent(SyncedMapEvent event) { switch (event.getAction()) { case SET: case ADD: for (Pair<Integer, String> item : event.getModifiedElements()) { final int id = item.getLeft(); final String className = item.getRight(); if (id >= opcodeTable.length) { throw new IllegalStateException("Server sent a packet id which is greater than the client has allowed."); } MessageCodec<?> codec = opcodeTable[id]; if ((codec != null && codec.getClass().getName().equals(className))) { throw new IllegalArgumentException("Trying to add a codec which already exists: " + className); } try { final Class<? extends MessageCodec> clazz = Class.forName(className, true, loader).asSubclass(MessageCodec.class); final Constructor<? extends MessageCodec> constr = clazz.getConstructor(int.class); codec = constr.newInstance(id); register(codec); } catch (ClassCastException | ClassNotFoundException | NoSuchMethodException | IllegalAccessException | InstantiationException | InvocationTargetException e) { if (Spout.debugMode()) { e.printStackTrace(); } } } break; case REMOVE: for (Pair<Integer, String> item : event.getModifiedElements()) { MessageCodec<?> codec = find(item.getLeft()); if (codec != null && codec.getClass().getName().equals(item.getRight())) { opcodeTable[codec.getOpcode()] = null; classTable.remove(codec.getType()); } } break; } }
Source:
<code>public void set(@NonNull ContentSet values, @Nullable Boolean value) { <START> values.put(mFieldName, new BooleanBinaryLong(value).value()); <END> }</code><technical_language>long</technical_language>

Target:
public void set(@NonNull ContentSet values, @Nullable Boolean value) { values.put(mFieldName, new BooleanBinaryInt(value).value()); }
Source:
<code>protected RegistryConnHandler getConnHandler() throws IOException { RegistryConnHandler connection = (RegistryConnHandler) ConnectionPool .getConnectionHandler(this, fileURL, true); try { connection.checkConnection(); } catch (IOException e) { throw e; <START> } <END> return connection; }</code><technical_language>for debugging</technical_language>

Target:
protected RegistryConnHandler getConnHandler() throws IOException { RegistryConnHandler connection = (RegistryConnHandler) ConnectionPool .getConnectionHandler(this, fileURL, true); connection.checkConnection(); return connection; }
Source:
<code>public void testContainerPropertiesTab() { DockerImagesTab imageTab = new DockerImagesTab(); imageTab.activate(); imageTab.refresh(); new WaitWhile(new JobIsRunning()); imageTab.runImage(this.imageName); RunADockerImagePageOneWizard firstPage = new RunADockerImagePageOneWizard(); firstPage.setName(this.containerName); firstPage.finish(); new WaitWhile(new JobIsRunning()); DockerContainersTab containerTab = new DockerContainersTab(); containerTab.activate(); containerTab.refresh(); new WaitWhile(new JobIsRunning(), TimePeriod.NORMAL); <START> for (TableItem item : containerTab.getTableItems()) { <END> if (item.getText(1).contains(this.imageName)) { item.click(); break; } } PropertiesView propertiesView = new PropertiesView(); propertiesView.open(); try { propertiesView.selectTab("Info"); } catch (SWTLayerException ex) { fail("Properties tab Info is not opened, is image selected in Images Tab?"); } }</code><technical_language>method DockerContainersTab.select(String containerName)? method here</technical_language>

Target:
public void testContainerPropertiesTab() { DockerImagesTab imageTab = new DockerImagesTab(); imageTab.activate(); imageTab.refresh(); new WaitWhile(new JobIsRunning()); imageTab.runImage(this.imageName); RunADockerImagePageOneWizard firstPage = new RunADockerImagePageOneWizard(); firstPage.setName(this.containerName); firstPage.finish(); new WaitWhile(new JobIsRunning()); DockerContainersTab containerTab = new DockerContainersTab(); containerTab.activate(); containerTab.refresh(); new WaitWhile(new JobIsRunning(), TimePeriod.NORMAL); containerTab.select(imageName); PropertiesView propertiesView = new PropertiesView(); propertiesView.open(); try { propertiesView.selectTab("Info"); } catch (SWTLayerException ex) { fail("Properties tab Info is not opened, is image selected in Images Tab?"); } }
Source:
<code><START> Keyword(String searchTerm, boolean isLiteral, boolean isWholeWord) { <END> this.searchTerm = Normalizer.normalize(searchTerm, Normalizer.Form.NFKD);; this.isLiteral = isLiteral; this.isWholeWord = isWholeWord; this.listName = ""; this.originalTerm = searchTerm; }</code><technical_language>this constructor call 5 parameter instead of assigning values</technical_language>

Target:
Keyword(String searchTerm, boolean isLiteral, boolean isWholeWord) { this(searchTerm, isLiteral, isWholeWord, "", searchTerm); }
Source:
<code>private void fetchMedia(Uri mediaUri) { if (!MediaUtils.isInMediaStore(mediaUri)) { <START> Uri downloadedUri = MediaUtils.downloadExternalMedia(EditPostActivity.this, mediaUri); <END> if (downloadedUri != null) { addMedia(downloadedUri); } else { Toast.makeText(EditPostActivity.this, getString(R.string.error_downloading_image), Toast.LENGTH_SHORT).show(); } } else { addMedia(mediaUri); } }</code><technical_language>enclose this call in try...catch(IllegalStateException) block done in this line <LINK_1></technical_language>

Target:
private void fetchMedia(Uri mediaUri) { if (!MediaUtils.isInMediaStore(mediaUri)) { Uri downloadedUri = null; try { downloadedUri = MediaUtils.downloadExternalMedia(EditPostActivity.this, mediaUri); } catch (IllegalStateException e) { AppLog.e(AppLog.T.UTILS, "Can't download the image at: " + mediaUri.toString(), e); CrashlyticsUtils.logException(e, AppLog.T.MEDIA, "Can't download the image at: " + mediaUri.toString() + " See issue #5823"); } if (downloadedUri != null) { addMedia(downloadedUri); } else { Toast.makeText(EditPostActivity.this, getString(R.string.error_downloading_image), Toast.LENGTH_SHORT).show(); } } else { addMedia(mediaUri); } }
Source:
<code>public Patient updatePatientMotechId(Config config, String patientUuid, String newMotechId) { Identifier patientIdentifier = getPatientIdentifier(config, patientUuid); patientIdentifier.setIdentifier(newMotechId); <START> String requestJson = buildGson().toJson(patientIdentifier); <END> String responseJson = postForJson(config, requestJson, "/patient/{patientUuid}/identifier/{identifierUuid}", patientUuid, patientIdentifier.getUuid()); return (Patient) JsonUtils.readJson(responseJson, Patient.class); }</code><technical_language>do test this request ? I Gson option 'excludeFieldsWithoutExposeAnnotation'. I previously identifierType location nulled, check this request</technical_language>

Target:
public void updatePatientMotechId(Config config, String patientUuid, String newMotechId) { Identifier patientIdentifier = getPatientIdentifier(config, patientUuid); patientIdentifier.setIdentifier(newMotechId); String requestJson = buildGson().toJson(patientIdentifier); postForJson(config, requestJson, "/patient/{patientUuid}/identifier/{identifierUuid}", patientUuid, patientIdentifier.getUuid()); }
Source:
<code>private List<LUNs> getVgInfo() { if (getParameters().getVgInfo() != null) { <START> return getParameters().getVgInfo(); <END> } GetVGInfoVDSCommandParameters params = new GetVGInfoVDSCommandParameters(getParameters().getVdsId(), getStorageDomain().getStorage()); if (getParameters().getVdsId() == null) { return (List<LUNs>) VdsCommandsHelper.runVdsCommandWithoutFailover( VDSCommandType.GetVGInfo, params, getStoragePoolId(), null).getReturnValue(); } return (List<LUNs>) runVdsCommand(VDSCommandType.GetVGInfo, params).getReturnValue(); }</code><technical_language>worth logging</technical_language>

Target:
private List<LUNs> getVgInfo() { if (getParameters().getVgInfo() != null) { log.debug("Using the virtual group's information from the command's parameters rather" + "than calling getVgInfo and getting the information directly from vdsm."); return getParameters().getVgInfo(); } GetVGInfoVDSCommandParameters params = new GetVGInfoVDSCommandParameters(getParameters().getVdsId(), getStorageDomain().getStorage()); if (getParameters().getVdsId() == null) { return (List<LUNs>) VdsCommandsHelper.runVdsCommandWithoutFailover( VDSCommandType.GetVGInfo, params, getStoragePoolId(), null).getReturnValue(); } return (List<LUNs>) runVdsCommand(VDSCommandType.GetVGInfo, params).getReturnValue(); }
Source:
<code>protected ModelNode invokeCommand(Cache<?, ?> cache, ModelNode operation) throws Exception { <START> cache.getAdvancedCache().getComponentRegistry().start(); <END> return null; }</code><technical_language>This needs wrapped in a SecurityAction. Also, invoking cache.start() stop() instead</technical_language>

Target:
protected ModelNode invokeCommand(Cache<?, ?> cache, ModelNode operation) throws Exception { SecurityActions.startCache(cache.getAdvancedCache()); return null; }
Source:
<code>private void dataCenter_SelectedItemChanged() { if (getCurrentStorageItem() instanceof SanStorageModelBase) { SanStorageModelBase sanStorageModel = (SanStorageModelBase) getCurrentStorageItem(); sanStorageModel.updateRemovableLuns(getDataCenter().getSelectedItem().getCompatibilityVersion()); <START> sanStorageModel.getRequireTableRefresh().setEntity(null); <END> sanStorageModel.getRequireTableRefresh().setEntity(true); } updateItemsAvailability(); behavior.updateDataCenterAlert(); }</code><technical_language>try removing lines (371/372), work</technical_language>

Target:
private void dataCenter_SelectedItemChanged() { if (getCurrentStorageItem() instanceof SanStorageModelBase) { SanStorageModelBase sanStorageModel = (SanStorageModelBase) getCurrentStorageItem(); sanStorageModel.updateRemovableLuns(getDataCenter().getSelectedItem().getCompatibilityVersion()); } updateItemsAvailability(); behavior.updateDataCenterAlert(); }
Source:
<code><START> private String getMigrationNetworkIp() { <END> String migrationIp = null; if (FeatureSupported.migrationNetwork(getVm().getVdsGroupCompatibilityVersion())) { Network migrationNetwork = null; List<Network> allNetworksInCluster = DbFacade.getInstance().getNetworkDao().getAllForCluster(getVm().getVdsGroupId()); for (Network tempNetwork : allNetworksInCluster) { if (tempNetwork.getCluster().isMigration()) { migrationNetwork = tempNetwork; break; } } if (migrationNetwork != null) { final List<VdsNetworkInterface> allInterfacesForDstVds = DbFacade.getInstance().getInterfaceDao().getAllInterfacesForVds(getDestinationVds().getId()); for (VdsNetworkInterface nic : allInterfacesForDstVds) { if (migrationNetwork.getName().equals(nic.getNetworkName())) { migrationIp = nic.getAddress(); break; } } } } return migrationIp; }</code><technical_language>levels of nesting if invert checks return null in case check is true, i.e if migration network feature is supported, return null. This way, nesting of control structures code, flow easier understand</technical_language>

Target:
private String getMigrationNetworkIp() { if (!FeatureSupported.migrationNetwork(getVm().getVdsGroupCompatibilityVersion())) { return null; } Network migrationNetwork = null; List<Network> allNetworksInCluster = DbFacade.getInstance().getNetworkDao().getAllForCluster(getVm().getVdsGroupId()); for (Network tempNetwork : allNetworksInCluster) { if (tempNetwork.getCluster().isMigration()) { migrationNetwork = tempNetwork; break; } } if (migrationNetwork != null) { final List<VdsNetworkInterface> allInterfacesForDstVds = DbFacade.getInstance().getInterfaceDao().getAllInterfacesForVds(getDestinationVds().getId()); for (VdsNetworkInterface nic : allInterfacesForDstVds) { if (migrationNetwork.getName().equals(nic.getNetworkName())) { return nic.getAddress(); } } } return null; }
Source:
<code>public void testCallTrackers() throws Throwable { InternalOperationContext opCtx = new InternalOperationContext(); opCtx = opCtx.withTracker(new CallTracker() { @Override public boolean isCancelled() { return true; } @Override public Type getType() { return Type.GRPC_CLIENT_TRACKER; } }); opCtx = opCtx.withTracker(new CallTracker() { @Override public boolean isCancelled() { return false; } @Override public Type getType() { return Type.STATE_LOCK_TRACKER; } }); RpcContext rpcCtx = new RpcContext(mMockBDC, mMockJC, opCtx); assertTrue(rpcCtx.isCancelled()); try { rpcCtx.throwIfCancelled(); fail("Call should have been cancelled."); <START> } catch (RuntimeException e) { <END> } }</code><technical_language>This is a good case for ExpectedException rule assertions ;)</technical_language>

Target:
public void testCallTrackers() throws Throwable { InternalOperationContext opCtx = new InternalOperationContext(); opCtx = opCtx.withTracker(new CallTracker() { @Override public boolean isCancelled() { return true; } @Override public Type getType() { return Type.GRPC_CLIENT_TRACKER; } }); opCtx = opCtx.withTracker(new CallTracker() { @Override public boolean isCancelled() { return false; } @Override public Type getType() { return Type.STATE_LOCK_TRACKER; } }); RpcContext rpcCtx = new RpcContext(mMockBDC, mMockJC, opCtx); assertTrue(rpcCtx.isCancelled()); mException.expect(RuntimeException.class); rpcCtx.throwIfCancelled(); }
Source:
<code>public void removeProperty(Property property) { if (!decorators.containsKey(property)) return; <START> AbstractSquareDecorator squareToRemove = decorators.get(property); <END> if (squareToRemove.equals(square)) { square = squareToRemove.getSquare(); decorators.remove(property); return; } AbstractSquareDecorator decorator = (AbstractSquareDecorator) ((AbstractSquareDecorator) square) .getSquare(); AbstractSquareDecorator previousDecorator = (AbstractSquareDecorator) square; while (!squareToRemove.equals(decorator)) { previousDecorator = decorator; decorator = (AbstractSquareDecorator) ((AbstractSquareDecorator) decorator).getSquare(); } previousDecorator.setSquare(decorator.getSquare()); decorators.remove(property); }</code><technical_language>Bad variable name. square decorator. Confusing code</technical_language>

Target:
public void removeProperty(Property property) { if (!decorators.containsKey(property)) return; AbstractSquareDecorator decoratorToRemove = decorators.get(property); if (decoratorToRemove.equals(square)) { square = decoratorToRemove.getSquare(); decorators.remove(property); } else { AbstractSquareDecorator decorator = (AbstractSquareDecorator) ((AbstractSquareDecorator) square) .getSquare(); AbstractSquareDecorator previousDecorator = (AbstractSquareDecorator) square; while (!decoratorToRemove.equals(decorator)) { previousDecorator = decorator; decorator = (AbstractSquareDecorator) ((AbstractSquareDecorator) decorator) .getSquare(); } previousDecorator.setSquare(decorator.getSquare()); decorators.remove(property); } }
Source:
<code>public TmfExperiment instantiateTrace() { try { refreshSupplementaryFolder(); if (getTraceType() != null) { IConfigurationElement ce = sfTraceTypeAttributes.get(getTraceType()); if (ce == null) { return null; } TmfExperiment experiment = (TmfExperiment) ce.createExecutableExtension(TmfTraceType.TRACE_TYPE_ATTR); return experiment; } } catch (CoreException e) { <START> Activator.getDefault().logError("Error instantiating ITmfTrace object for trace " + getName(), e); END> } return null; }</code><technical_language>externalize</technical_language>

Target:
public TmfExperiment instantiateTrace() { try { refreshSupplementaryFolder(); if (getTraceType() != null) { IConfigurationElement ce = sfTraceTypeAttributes.get(getTraceType()); if (ce == null) { return null; } TmfExperiment experiment = (TmfExperiment) ce.createExecutableExtension(TmfTraceType.TRACE_TYPE_ATTR); return experiment; } } catch (CoreException e) { Activator.getDefault().logError(Messages.TmfExperimentElement_ErrorInstantiatingTrace + getName(), e); } return null; }
Source:
<code>private void updateDiskVmSnapshotId() { Guid snapshotId = getSnapshotDao().getId(getVmId(), SnapshotType.ACTIVE); if (disk.getDiskStorageType() == DiskStorageType.IMAGE) { DiskImage diskImage = ((DiskImage) disk); getImageDao().updateImageVmSnapshotId(diskImage.getImageId(), <START> snapshotId); <END> diskImage.setvm_snapshot_id(snapshotId); } else { throw new VdcBLLException(VdcBllErrors.StorageException, "update of snapshot id was initiated for unsupported disk type"); } }</code><technical_language>reason for line. Lets think: line update entry DB, I need update object is updated DB more. Why? is example of dead code. Dead code written</technical_language>

Target:
private void updateDiskVmSnapshotId() { Guid snapshotId = getSnapshotDao().getId(getVmId(), SnapshotType.ACTIVE); if (disk.getDiskStorageType() == DiskStorageType.IMAGE) { DiskImage diskImage = ((DiskImage) disk); getImageDao().updateImageVmSnapshotId(diskImage.getImageId(), snapshotId); } else { throw new VdcBLLException(VdcBllErrors.StorageException, "update of snapshot id was initiated for unsupported disk type"); } }
Source:
<code>protected void configure() { <START> bind(ImplicitLocationSupplier.class).to(OnlyLocationOrFirstZone.class).in(Singleton.class); <END> }</code><technical_language>This is ComputeService implementation. Please remove it</technical_language>

Target:
protected void configure()
Source:
<code>public void testPackagingRetrieve() throws LobException { String id = "1"; Packaging packaging = Packaging.retrieve(id, Lob.apiKey); assertEquals("1", packaging.getId()); assertEquals("Smart Packaging", packaging.getName()); <START> assertEquals("Automatically determined optimal packaging for safe and secure delivery", packaging.getDescription()); <END> assertEquals("packaging", packaging.getObject()); }</code><technical_language>I check description string change time. I check if description property exists. Ill merge this is changed</technical_language>

Target:
public void testPackagingRetrieve() throws LobException { String id = "1"; Packaging packaging = Packaging.retrieve(id, Lob.apiKey); assertEquals("1", packaging.getId()); assertEquals("Smart Packaging", packaging.getName()); assertTrue(packaging.getDescription().length() > 0); assertEquals("packaging", packaging.getObject()); }
Source:
<code>List<JcrPackage> getJcrPackages(final ResourceResolver resourceResolver, final String[] paths) { final List<JcrPackage> packages = new ArrayList<JcrPackage>(); for (final String path : paths) { final Resource eventResource = resourceResolver.getResource(path); JcrPackage jcrPackage = null; try { jcrPackage = packaging.open(eventResource.adaptTo(Node.class), false); if (jcrPackage != null) { packages.add(jcrPackage); } } catch (RepositoryException e) { log.warn("Error checking if the path [ ] is a JCR Package.", path); } finally { if (jcrPackage != null) { <START> jcrPackage.close(); <END> } } } return packages; }</code><technical_language>this is early, referencing jcr package</technical_language>

Target:
private List<JcrPackage> getJcrPackages(final ResourceResolver resourceResolver, final String[] paths) { final List<JcrPackage> packages = new ArrayList<JcrPackage>(); for (final String path : paths) { final Resource eventResource = resourceResolver.getResource(path); JcrPackage jcrPackage = null; try { jcrPackage = packaging.open(eventResource.adaptTo(Node.class), false); if (jcrPackage != null) { packages.add(jcrPackage); } } catch (RepositoryException e) { log.warn("Error checking if the path [ ] is a JCR Package.", path); } } return packages; }
Source:
<code>public static Object percent2( ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB ) throws KettleValueException { if ( dataA == null || dataB == null ) { return null; } switch ( metaA.getType() ) { case ValueMetaInterface.TYPE_NUMBER: return new Double( metaA.getNumber( dataA ).doubleValue() - divideDoubles( multiplyDoubles( metaA.getNumber( dataA ), metaB.getNumber( dataB ) ), 100.0D ) ); case ValueMetaInterface.TYPE_INTEGER: return new Long( metaA.getInteger( dataA ).longValue() - divideLongs( multiplyLongs( metaA.getInteger( dataA ), metaB.getInteger( dataB ) ), 100L ) ); case ValueMetaInterface.TYPE_BIGNUMBER: return metaA.getBigNumber( dataA ).subtract( divideBigDecimals( multiplyBigDecimals( <START> metaB.getBigNumber( dataB ), metaA.getBigNumber( dataA ), null ), new BigDecimal( 100 ) ) ); <END> default: throw new KettleValueException( "The 'A-B%' function only works on numeric data" ); } }</code><technical_language>Need put this - change API</technical_language>

Target:
public static Object percent2( ValueMetaInterface metaA, Object dataA, ValueMetaInterface metaB, Object dataB ) throws KettleValueException { if ( dataA == null || dataB == null ) { return null; } switch ( metaA.getType() ) { case ValueMetaInterface.TYPE_NUMBER: return new Double( metaA.getNumber( dataA ).doubleValue() - divideDoubles( multiplyDoubles( metaA.getNumber( dataA ), metaB.getNumber( dataB ) ), 100.0D ) ); case ValueMetaInterface.TYPE_INTEGER: return new Long( metaA.getInteger( dataA ).longValue() - divideLongs( multiplyLongs( metaA.getInteger( dataA ), metaB.getInteger( dataB ) ), 100L ) ); case ValueMetaInterface.TYPE_BIGNUMBER: return metaA.getBigNumber( dataA ).subtract( divideBigDecimals( multiplyBigDecimals( metaB.getBigNumber( dataB ), metaA.getBigNumber( dataA ), null ), new BigDecimal( 100 ), (MathContext) null ) ); default: throw new KettleValueException( "The 'A-B%' function only works on numeric data" ); } }
Source:
<code>public void visitNode(Tree tree) { <START> AnnotationTree annotationTree = (AnnotationTree) tree; <END> if (isSpringWebHandler(annotationTree)) { findParentMethod(annotationTree).ifPresent(annotatedMethod -> reportIssue(annotatedMethod.simpleName(), "Review this Spring request handler")); } }</code><technical_language>Matter of taste, fix : I tend prefer explicit semantic test relying it. I in this case works fine making explicit allows nicer refactor experiences in future IMO</technical_language>

Target:
public void visitNode(Tree tree) { if (!hasSemantic()) { return; } MethodTree methodTree = (MethodTree) tree; List<AnnotationTree> annotations = methodTree.modifiers().annotations(); annotations.stream().filter(SpringEndpointsCheck::isSpringWebHandler).forEach(annotationTree -> reportIssue(methodTree.simpleName(), "Review this Spring request handler")); }
Source:
<code><START> ConstraintFileType(String name, String prefix) { <END> this.name = name; this.prefix = prefix; }</code><technical_language>do need this change? I this constructor this class</technical_language>

Target:
private ConstraintFileType(String name, String prefix) { this.name = name; this.prefix = prefix; }
Source:
<code>public int compareTo(PersonAttribute other) { int retValue; if ((retValue = OpenmrsUtil.compareWithNullAsGreatest(this.getAttributeType(), other.getAttributeType())) != 0) { return retValue; } if ((retValue = this.isVoided().compareTo(other.isVoided())) != 0) { return retValue; } if ((retValue = OpenmrsUtil.compareWithNullAsLatest(this.getDateCreated(), other.getDateCreated())) != 0) { return retValue; } if ((retValue = OpenmrsUtil.compareWithNullAsGreatest(this.getValue(), other.getValue())) != 0) { return retValue; } return OpenmrsUtil.compareWithNullAsGreatest(this.getPersonAttributeId(), other.getPersonAttributeId()); <START> } <END></code><technical_language>LGTM = Good</technical_language>

Target:
public int compareTo(PersonAttribute other) { DefaultComparator paDComparator = new DefaultComparator(); return paDComparator.compare(this, other); }
Source:
<code>private IStatus validateImagePath(IValidationContext ctx, ResourceSet rs, String path) { if (!StringUtil.isEmpty(path)) { if (!validateExtension(path)) { return ctx.createFailureStatus(new Object[] { "The path '" + path + "' <START> doesn't correspond <END> to an image." }); } if (!validateExistence(path, rs)) { return ctx.createFailureStatus(new Object[] { "The image '" + path + "' doesn't exist." }); } } return ctx.createSuccessStatus(); }</code><technical_language>Avoid contractions/abbreviations in formal error messages: "does not" instead of "doesn't"</technical_language>

Target:
private IStatus validateImagePath(IValidationContext ctx, ResourceSet rs, String path) { if (!StringUtil.isEmpty(path)) { if (!validateExtension(path)) { return ctx.createFailureStatus(new Object[] { "The path '" + path + "' does not correspond to an image." }); } if (!validateExistence(path, rs)) { return ctx.createFailureStatus(new Object[] { "The image '" + path + "' does not exist." }); } } return ctx.createSuccessStatus(); }
Source:
<code>private List<List<Map<String, Object>>> accumulateWithIndex(int index, List<List<Map<String, Object>>> accu, Object input) throws NoSuchFieldException { <START> input.getClass().getDeclaredField(keys[index]); <END> List<Map<String, Object>> curList = accu.get(index); Map map = pojoToMap(input,index + 1); curList.add(map); accu.set(index, curList); return accu; }</code><technical_language>is purpose of this line</technical_language>

Target:
private List<List<Map<String, Object>>> accumulateWithIndex(int index, List<List<Map<String, Object>>> accu, Object input) throws NoSuchFieldException { List<Map<String, Object>> curList = accu.get(index); Map map = pojoToMap(input,index + 1); curList.add(map); accu.set(index, curList); return accu; }
Source:
<code>public void <START> clear() <END> { if (!mMap.isEmpty()) { System.out.println("PREDEX CACHE HITS: " + mHits); System.out.println("PREDEX CACHE MISSES: " + mMisses); } mMap.clear(); }</code><technical_language>mMap is in synchronized context in "getItem", here. understanding is synchronized variables need be, well, synchronized, read/write access. adding "Guardedby(this)" implying that</technical_language>

Target:
public synchronized void clear() { if (!mMap.isEmpty()) { System.out.println("PREDEX CACHE HITS: " + mHits); System.out.println("PREDEX CACHE MISSES: " + mMisses); } mMap.clear(); }
Source:
<code>private void updateNetworkClusters(List<Guid> clusterInDataCenterIds, Network externalNetwork, Network networkInDataCenter) { Set<Guid> <START> networkClusters = <END> networkClusterDao.getAllForNetwork(networkInDataCenter.getId()).stream() .map(NetworkCluster::getClusterId) .collect(Collectors.toSet()); List<Guid> clustersToAttach = clusterInDataCenterIds.stream() .filter(id -> !networkClusters.contains(id)) .collect(Collectors.toList()); if (clustersToAttach.size() > 0) { propagateReturnValue(networkHelper.attachNetworkToClusters(networkInDataCenter.getId(), clustersToAttach)); } }</code><technical_language>networkClustersWithNetwork</technical_language>

Target:
private void updateNetworkClusters(List<Guid> clusterInDataCenterIds, Network externalNetwork, Network networkInDataCenter) { Set<Guid> networkClustersWithNetwork = networkClusterDao.getAllForNetwork(networkInDataCenter.getId()).stream() .map(NetworkCluster::getClusterId) .collect(Collectors.toSet()); List<Guid> clustersToAttach = clusterInDataCenterIds.stream() .filter(id -> !networkClustersWithNetwork.contains(id)) .collect(Collectors.toList()); if (clustersToAttach.size() > 0) { propagateReturnValue(networkHelper.attachNetworkToClusters(networkInDataCenter.getId(), clustersToAttach)); } }
Source:
<code>public Schema findSchema(String schemaName) { if (schemaName == null) { <START> throw DbException.get(ErrorCode.SCHEMA_NOT_FOUND_1, schemaName); <END> } Schema schema = schemas.get(schemaName); if (schema == infoSchema) { initMetaTables(); } return schema; }</code><technical_language>This method returns null for unknown schemes, exception is required for a null name</technical_language>

Target:
public Schema findSchema(String schemaName) { if (schemaName == null) { return null; } Schema schema = schemas.get(schemaName); if (schema == infoSchema) { initMetaTables(); } return schema; }
Source:
<code>private void setupKeyboardShortcuts() { addEventHandler(KeyEvent.KEY_PRESSED, event -> { if (MAXIMIZE_WINDOW.match(event)) { ui.maximizeWindow(); } <START> if (MINIMIZE_WINDOW.match(event)) { <END> ui.minimizeWindow(); } if (DEFAULT_SIZE_WINDOW.match(event)) { ui.setDefaultWidth(); } if (SWITCH_DEFAULT_REPO.match(event)) { ui.switchDefaultRepo(); } if (SWITCH_BOARD.match(event)) { ui.getMenuControl().switchBoard(); } if (JUMP_TO_FILTER_BOX.match(event)) { setFocusToFilterBox(); } if (JUMP_TO_FIRST_ISSUE.match(event)) { listView.selectNthItem(1); } for (Map.Entry<Integer, KeyCodeCombination> entry : JUMP_TO_NTH_ISSUE_KEYS.entrySet()) { if (entry.getValue().match(event)){ event.consume(); listView.selectNthItem(entry.getKey()); break; } } }); }</code><technical_language>else if instead, guarantee bindings mutually exclusive</technical_language>

Target:
private void setupKeyboardShortcuts() { addEventHandler(KeyEvent.KEY_PRESSED, event -> { if (MAXIMIZE_WINDOW.match(event)) { ui.maximizeWindow(); } else if (MINIMIZE_WINDOW.match(event)) { ui.minimizeWindow(); } else if (DEFAULT_SIZE_WINDOW.match(event)) { ui.setDefaultWidth(); } else if (SWITCH_DEFAULT_REPO.match(event)) { ui.switchDefaultRepo(); } else if (SWITCH_BOARD.match(event)) { ui.getMenuControl().switchBoard(); } else if (JUMP_TO_FILTER_BOX.match(event)) { setFocusToFilterBox(); } }); }