auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private CommandBase<?> retrieveCommand(CommandEntity cmdEntity, CommandContext cmdContext) { CommandBase<?> command = null; if (cmdEntity != null) { if (cmdContext == null) { cmdContext = new CommandContext(new EngineContext()).withExecutionContext(new ExecutionContext()); } command = CommandsFactory.createCommand(cmdEntity.getCommandType(), cmdEntity.getCommandParameters(), cmdContext); if (command == null) { log.info("Unable to reconstruct command '{}' using parameters '{}'.", cmdEntity.getCommandType(), <START> cmdEntity.getCommandParameters()); <END> } else { command.setCommandStatus(cmdEntity.getCommandStatus(), false); command.setCommandData(cmdEntity.getData()); command.setReturnValue(cmdEntity.getReturnValue()); if (!Guid.isNullOrEmpty(cmdEntity.getParentCommandId()) && !cmdEntity.getParentCommandId().equals(cmdEntity.getId()) && command.getParameters().getParentParameters() == null) { CommandBase<?> parentCommand = retrieveCommand(cmdEntity.getParentCommandId()); if (parentCommand != null) { command.getParameters().setParentParameters(parentCommand.getParameters()); } } } } return command; }</code><technical_language>Please change logging in CommandsFactory.createCommand() include parameters remove logging here</technical_language>

Target:
private CommandBase<?> retrieveCommand(CommandEntity cmdEntity, CommandContext cmdContext) { CommandBase<?> command = null; if (cmdEntity != null) { if (cmdContext == null) { cmdContext = new CommandContext(new EngineContext()).withExecutionContext(new ExecutionContext()); } command = CommandsFactory.createCommand(cmdEntity.getCommandType(), cmdEntity.getCommandParameters(), cmdContext); if (command != null) { command.setCommandStatus(cmdEntity.getCommandStatus(), false); command.setCommandData(cmdEntity.getData()); command.setReturnValue(cmdEntity.getReturnValue()); if (!Guid.isNullOrEmpty(cmdEntity.getParentCommandId()) && !cmdEntity.getParentCommandId().equals(cmdEntity.getId()) && command.getParameters().getParentParameters() == null) { CommandBase<?> parentCommand = retrieveCommand(cmdEntity.getParentCommandId()); if (parentCommand != null) { command.getParameters().setParentParameters(parentCommand.getParameters()); } } } } return command; }
Source:
<code>public final void window(MessageCollector collector, TaskCoordinator coordinator) { context.getSystemStreamPartitions().forEach(ssp -> { <START> OperatorImpl impl = this.operatorGraph.get(ssp.getSystemStream()); <END> impl.onTimer(collector, coordinator); }); }</code><technical_language>nit: purpose impl reference here? If do this.operatorGraph.get(ssp.getSystemStream()).onTimer(collector, coordinator), save import well</technical_language>

Target:
public final void window(MessageCollector collector, TaskCoordinator coordinator) { systemStreamPartitions.forEach(ssp -> { this.operatorGraph.get(ssp.getSystemStream()) .onTick(collector, coordinator); }); }
Source:
<code>public SetAlarmNotificationsResponse setAlarmNotifications( @OrganisationIdentification final String organisationIdentification, @RequestPayload final SetAlarmNotificationsRequest request) throws OsgpException { LOGGER.info("Incoming SetAlarmNotificationsRequest for meter: {}.", request.getDeviceIdentification()); <START> LOGGER.info("=============> Platform, setAlarmNotifications, call received"); <END> final SetAlarmNotificationsResponse response = new SetAlarmNotificationsResponse(); try { final String deviceIdentification = request.getDeviceIdentification(); final SetAlarmNotificationsRequestData requestData = request.getSetAlarmNotificationsRequestData(); final AlarmNotifications alarmNotifications = this.configurationMapper.map( requestData.getAlarmNotifications(), AlarmNotifications.class); final String correlationUid = this.configurationService.setAlarmNotifications(organisationIdentification, deviceIdentification, alarmNotifications); final AsyncResponse asyncResponse = new AsyncResponse(); asyncResponse.setCorrelationUid(correlationUid); asyncResponse.setDeviceIdentification(request.getDeviceIdentification()); response.setAsyncResponse(asyncResponse); } catch (final Exception e) { LOGGER.error("Exception: while setting alarm notifications on device: for organisation {}.", new Object[] { e.getMessage(), request.getDeviceIdentification(), organisationIdentification }, e); this.handleException(e); } return response; }</code><technical_language>I this is unnecessary duplication of a log statement clear enough, added</technical_language>

Target:
public SetAlarmNotificationsResponse setAlarmNotifications( @OrganisationIdentification final String organisationIdentification, @RequestPayload final SetAlarmNotificationsRequest request) throws OsgpException { LOGGER.info("Incoming SetAlarmNotificationsRequest for meter: {}.", request.getDeviceIdentification()); final SetAlarmNotificationsResponse response = new SetAlarmNotificationsResponse(); try { final String deviceIdentification = request.getDeviceIdentification(); final SetAlarmNotificationsRequestData requestData = request.getSetAlarmNotificationsRequestData(); final AlarmNotifications alarmNotifications = this.configurationMapper.map( requestData.getAlarmNotifications(), AlarmNotifications.class); final String correlationUid = this.configurationService.setAlarmNotifications(organisationIdentification, deviceIdentification, alarmNotifications); final AsyncResponse asyncResponse = new AsyncResponse(); asyncResponse.setCorrelationUid(correlationUid); asyncResponse.setDeviceIdentification(request.getDeviceIdentification()); response.setAsyncResponse(asyncResponse); } catch (final Exception e) { LOGGER.error("Exception: while setting alarm notifications on device: for organisation {}.", new Object[] { e.getMessage(), request.getDeviceIdentification(), organisationIdentification }, e); this.handleException(e); } return response; }
Source:
<code>public String getKeyFilter() { <START> return keyFilter == null ? "" : keyFilter; <END> }</code><technical_language>Is this correct then</technical_language>

Target:
public String getKeyFilter() { return keyFilter; }
Source:
<code>public String getFieldName() { <START> return isAnnotatedFieldName ? annotatedFieldName : getProperty().getName(); <END> }</code><technical_language>java return annotatedFieldName == null ? getProperty().getName() : annotatedFieldName</technical_language>

Target:
public String getFieldName() { return annotatedFieldName == null ? getProperty().getName() : annotatedFieldName; }
Source:
<code>public String makeSizeString(long size) { long t = size; if (t==0) return "0"+suffixBytes; if (t<0) return "-"+makeSizeString(-t); long b = t%bytesPerMetricUnit; t = t/bytesPerMetricUnit; long kb = t%bytesPerMetricUnit; t = t/bytesPerMetricUnit; long mb = t%bytesPerMetricUnit; t = t/bytesPerMetricUnit; long gb = t; <START> if (gb>2) <END> return Strings.makeRealString(gb + (1.0*mb/bytesPerMetricUnit), maxLen, precision, 0) + suffixGiga; if (mb>2) return Strings.makeRealString((gb*bytesPerMetricUnit) + mb + (1.0*kb/bytesPerMetricUnit), maxLen, precision, 0) + suffixMega; if (kb>2) return Strings.makeRealString((mb*bytesPerMetricUnit) + kb + (1.0*b/bytesPerMetricUnit), maxLen, precision, 0) + suffixKilo; return (kb*bytesPerMetricUnit) + b + suffixBytes; }</code><technical_language>if gb > 2, for kb > 2 etc? thought 1.5GB normal of writing (similar 1.5GHz etc). For java() for in -Xmx, I a number leave in a number rounding error significant. gb > x needs configurable well. Thoughts</technical_language>

Target:
public String makeSizeString(long size) { return makeSizeString(size, precision); }
Source:
<code>protected boolean requiresRuntime(OperationContext context) { <START> return context.getProcessType() != ProcessType.EMBEDDED_SERVER || context.getRunningMode() != RunningMode.ADMIN_ONLY; <END> }</code><technical_language>This needs account for ProcessType.EMBEDDED_HOST_CONTROLLER well. this ProcessType expose isEmbedded() property keeping this kind of discrimination consistent. hesitation is a single for process types. For example, for SELF_CONTAINED false a flavor of kind of is ambiguous</technical_language>

Target:
protected boolean requiresRuntime(OperationContext context) { return (context.getProcessType() != ProcessType.EMBEDDED_SERVER || context.getRunningMode() != RunningMode.ADMIN_ONLY) && (context.getProcessType() != ProcessType.EMBEDDED_HOST_CONTROLLER); }
Source:
<code>private void upload(HttpServletRequest request, HttpServletResponse response) { response.setContentType("text/html"); File nodeSourceJsonFile = null; try { String sessionId = null; CatalogObject catalogObject = new CatalogObject(); for (FileItem formItem : new ServletRequestTransformer().getFormItems(request)) { if (formItem.isFormField()) { if (formItem.getFieldName().equals("sessionId")) { sessionId = formItem.getString(); } else if (formItem.getFieldName().equals(BUCKET_NAME_PARAM)) { catalogObject.setBucketName(formItem.getString()); } else if (formItem.getFieldName().equals(NAME_PARAM)) { catalogObject.setNodeSourceName(formItem.getString()); } else if (formItem.getFieldName().equals(FILE_CONTENT_PARAM)) { nodeSourceJsonFile = File.createTempFile("node-source-configuration", ".json"); new PrintWriter(nodeSourceJsonFile).write(formItem.getString()); formItem.write(nodeSourceJsonFile); catalogObject.setNodeSourceJsonFile(nodeSourceJsonFile); } else if (formItem.getFieldName().equals(KIND_PARAM)) { catalogObject.setKind(formItem.getString()); } else if (formItem.getFieldName().equals(COMMIT_MESSAGE_PARAM)) { catalogObject.setCommitMessage(formItem.getString()); } else if (formItem.getFieldName().equals(OBJECT_CONTENT_TYPE_PARAM)) { catalogObject.setObjectContentType(formItem.getString()); <START> } <END> } formItem.delete(); } CatalogRequestBuilder catalogRequestBuilder = new CatalogRequestBuilder(catalogObject); String requestUri = catalogRequestBuilder.build(); LOGGER.info("Node Source exported to catalog using resource URI: " + requestUri); catalogRequestBuilder.postNodeSourceRequestToCatalog(sessionId, requestUri, response); } catch (Exception e) { logErrorAndWriteResponseToClient(e, response); } finally { if (nodeSourceJsonFile != null) { nodeSourceJsonFile.delete(); } } }</code><technical_language>is replace else-if switch string. java 8</technical_language>

Target:
private void upload(HttpServletRequest request, HttpServletResponse response) { response.setContentType("text/html"); try (CatalogObjectAction catalogObjectAction = buildCatalogObjetAction(request)) { CatalogRequestBuilder catalogRequestBuilder = new CatalogRequestBuilder(catalogObjectAction); String requestUri = catalogRequestBuilder.build(); LOGGER.info("Post node source to catalog with URI: " + requestUri); postRequestAndHandleResponse(response, catalogObjectAction, catalogRequestBuilder, requestUri); } catch (Exception e) { logErrorAndWriteResponseToClient(e, response); } }
Source:
<code>protected void processTuple(T tuple, boolean isStream1Data) { Spillable.SpillableByteArrayListMultimap<K,T> store = isStream1Data ? stream1Data : stream2Data; K key = extractKey(tuple,isStream1Data); long timeBucket = extractTime(tuple,isStream1Data); if (!((ManagedTimeStateMultiValue)store).put(key, tuple,timeBucket)) { return; } Spillable.SpillableByteArrayListMultimap<K, T> valuestore = isStream1Data ? stream2Data : stream1Data; Future<List> future = ((ManagedTimeStateMultiValue)valuestore).getAsync(key); if (future.isDone()) { try { joinStream(tuple,isStream1Data, future.get()); <START> } catch (InterruptedException e) { <END> throw new RuntimeException(e); } catch (ExecutionException e) { throw new RuntimeException(e); } } else { waitingEvents.put(new JoinEvent<>(key,tuple,isStream1Data),future); } }</code><technical_language>catch (InterruptedException | ExecutionException e)</technical_language>

Target:
protected void processTuple(T tuple, boolean isStream1Data) { Spillable.SpillableByteArrayListMultimap<K,T> store = isStream1Data ? stream1Data : stream2Data; K key = extractKey(tuple,isStream1Data); long timeBucket = extractTime(tuple,isStream1Data); if (!((ManagedTimeStateMultiValue)store).put(key, tuple,timeBucket)) { return; } Spillable.SpillableByteArrayListMultimap<K, T> valuestore = isStream1Data ? stream2Data : stream1Data; Future<List> future = ((ManagedTimeStateMultiValue)valuestore).getAsync(key); if (future.isDone()) { try { joinStream(tuple,isStream1Data, future.get()); } catch (InterruptedException | ExecutionException e) { throw new RuntimeException(e); } } else { waitingEvents.put(new JoinEvent<>(key,tuple,isStream1Data),future); } }
Source:
<code>protected boolean validateFieldValueRequired(FormField field, Object value) { String message = translationService.getTranslation(ProcessingEngineConstants.FieldStateValidatorImplFieldIsRequired); <START> Optional<Object> optional = Optional.ofNullable(value); <END> Predicate predicate = optional.map((Function<Object, Predicate>) o -> validators.get(o.getClass())).orElse(o -> o != null); if (!predicate.test(value)) { field.setError(message); return false; } return true; }</code><technical_language>This code would, in opinion, readable if avoid needless Optional - work null. point of Optional is supposed return null, necessarily avoid null altogether</technical_language>

Target:
protected boolean validateFieldValueRequired(FormField field, Object value) { String message = translationService.getTranslation(ProcessingEngineConstants.FieldStateValidatorImplFieldIsRequired); if (value == null) { field.setError(message); return false; } if (validators.containsKey(value.getClass())) { Predicate predicate = validators.get(value.getClass()); if (!predicate.test(value)) { field.setError(message); return false; } } return true; }
Source:
<code>public void acceptAlert() { Alert alert = driver.switchTo().alert(); <START> alert.accept(); <END> }</code><technical_language>add Reporter.log(String.format("<br>INFO&nbsp;&nbsp; - Accepted alert <b>%s</b>", alert.getMessage());</technical_language>

Target:
public void acceptAlert() { Alert alert = driver.switchTo().alert(); String alertText = alert.getText(); alert.accept(); Reporter.log(String.format("INFO - Accepted alert: %s", alertText)); }
Source:
<code>public synchronized void paintLayer(Graphics2D g, Rectangle2D region) { g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY); super.paintLayer(g, region); if (_ctx.isEmpty()) return; if (!_imgInfoValid) { if (!setBasePos(_basePos)) { return; } } final java.util.List<TpeMessage> messages = new ArrayList<>(); for (int i = 0; i < _featureList.size(); ++i) { <START> final TpeImageFeature tif = _featureList.elementAt(i); <END> tif.draw(g, _imgInfo); final Option<Collection<TpeMessage>> opt = tif.getMessages(); if (opt.isDefined()) { messages.addAll(opt.getValue()); } } if (_baseOutOfView) { messages.add(TpeMessage.warningMessage("Base position is out of view.")); } if (messages.size() > 0) displayMessages(messages, g); }</code><technical_language>Is a reason (I one) this loop index instead of simply being: for (TpeImageFeature tif : _featureList) { ... }</technical_language>

Target:
public synchronized void paintLayer(Graphics2D g, Rectangle2D region) { g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY); super.paintLayer(g, region); if (_ctx.isEmpty()) return; if (!_imgInfoValid) { if (!setBasePos(_basePos)) { return; } } final java.util.List<TpeMessage> messages = new ArrayList<>(); for (final TpeImageFeature tif : _featureList) { tif.draw(g, _imgInfo); final Option<Collection<TpeMessage>> opt = tif.getMessages(); if (opt.isDefined()) { messages.addAll(opt.getValue()); } } if (_baseOutOfView) { messages.add(TpeMessage.warningMessage("Base position is out of view.")); } if (messages.size() > 0) displayMessages(messages, g); }
Source:
<code>private void resolveCharsets(String dbCharset, Table resolved) { if ( this.charset != null ) resolved.charset = this.charset; else resolved.charset = dbCharset; <START> for ( StringColumnDef c : resolved.getStringColumns() ) { <END> if ( c.charset == null ) c.charset = resolved.charset; } }</code><technical_language>replace resolved.setDefaultColumnCharsets();</technical_language>

Target:
private void resolveCharsets(String dbCharset, Table resolved) { if ( this.charset != null ) resolved.charset = this.charset; else resolved.charset = dbCharset; resolved.setDefaultColumnCharsets(); }
Source:
<code>public ImmutableBitmap getBitmapIndex(String dimension, String value) { if (isVirtualColumn(dimension)) { return null; } final Column column = index.getColumn(dimension); if (column == null || !columnSupportsFiltering(column)) { <START> if (value == null) { <END> return bitmapFactory.complement(bitmapFactory.makeEmptyImmutableBitmap(), getNumRows()); } else { return bitmapFactory.makeEmptyImmutableBitmap(); } } if (!column.getCapabilities().hasBitmapIndexes()) { return null; } final BitmapIndex bitmapIndex = column.getBitmapIndex(); return bitmapIndex.getBitmap(bitmapIndex.getIndex(value)); }</code><technical_language>this full fill smooth transition path checking NullHandlingHelper.isNullOrDefault</technical_language>

Target:
public ImmutableBitmap getBitmapIndex(String dimension, String value) { if (isVirtualColumn(dimension)) { return null; } final Column column = index.getColumn(dimension); if (column == null || !columnSupportsFiltering(column)) { if (NullHandling.isNullOrEquivalent(value)) { return bitmapFactory.complement(bitmapFactory.makeEmptyImmutableBitmap(), getNumRows()); } else { return bitmapFactory.makeEmptyImmutableBitmap(); } } if (!column.getCapabilities().hasBitmapIndexes()) { return null; } final BitmapIndex bitmapIndex = column.getBitmapIndex(); return bitmapIndex.getBitmap(bitmapIndex.getIndex(value)); }
Source:
<code>public Void call() throws Exception { LOGGER.info("\n\nThread Starting " + t.getName() + " ; " + query.getStatement() + " for " + numberOfExecutions + "times\n\n"); Long start = EnvironmentEdgeManager.currentTimeMillis(); for (long i = numberOfExecutions; (i > 0 && ((EnvironmentEdgeManager.currentTimeMillis() - start) < executionDurationInMs)); i--) { try { <START> if (diffQuery()) { <END> break; } } catch (Exception e) { e.printStackTrace(); } } LOGGER.info("\n\nThread exiting." + t.getName() + "\n\n"); return null; }</code><technical_language>Again, if query executions in differ, changes affect it</technical_language>

Target:
public Void call() throws Exception { LOGGER.info("\n\nThread Starting " + t.getName() + " ; " + query.getStatement() + " for " + numberOfExecutions + "times\n\n"); Long start = EnvironmentEdgeManager.currentTimeMillis(); for (long i = numberOfExecutions; (i > 0 && ((EnvironmentEdgeManager.currentTimeMillis() - start) < executionDurationInMs)); i--) { try { diffQuery(); } catch (Exception e) { e.printStackTrace(); } } LOGGER.info("\n\nThread exiting." + t.getName() + "\n\n"); return null; }
Source:
<code>public RelDataType getNamedType(SqlIdentifier typeName) { Pair<CalciteSchema, String> pair = Util.schema(getRootSchema(), ImmutableList.<String>of(), typeName); CalciteSchema.TypeEntry typeEntry = pair.left.getType(pair.right, false); <START> if (typeEntry != null) { <END> return typeEntry.getType().apply(typeFactory); } else { return null; } }</code><technical_language>try some instead of null</technical_language>

Target:
public RelDataType getNamedType(SqlIdentifier typeName) { CalciteSchema.TypeEntry typeEntry = SqlValidatorUtil.getTypeEntry(getRootSchema(), typeName); if (typeEntry != null) { return typeEntry.getType().apply(typeFactory); } else { return null; } }
Source:
<code>public byte[] get() { try { FileInputStream inputStream = null; try { inputStream = new FileInputStream(file); return IOUtils.toByteArray(inputStream); } finally { if (inputStream != null) { inputStream.close(); } <START> } <END> } catch (IOException e) { throw new Error(e); } }</code><technical_language>Note simpler idiom (which converts more cleanly Java 7 syntax) is InputStream inputStream = new FileInputStream(file); try { return IOUtils.toByteArray(inputStream); } finally { inputStream.close(); }</technical_language>

Target:
public byte[] get() { try { FileInputStream inputStream = new FileInputStream(file); try { return IOUtils.toByteArray(inputStream); } finally { inputStream.close(); } } catch (IOException e) { throw new Error(e); } }
Source:
<code>private Response<QueueDescription> deserializeQueue(Response<Object> response) { final QueueDescriptionEntry entry = deserialize(response.getValue(), QueueDescriptionEntry.class); if (entry == null) { return new SimpleResponse<>(response.getRequest(), response.getStatusCode(), response.getHeaders(), null); } <START> final QueueDescription result = entry.getContent().getQueueDescription(); <END> final String queueName = getTitleValue(entry.getTitle()); QueueHelper.setName(result, queueName); return new SimpleResponse<>(response.getRequest(), response.getStatusCode(), response.getHeaders(), result); }</code><technical_language>Is this null entry.getContent() ? this throw NPE</technical_language>

Target:
private Response<QueueDescription> deserializeQueue(Response<Object> response) { final QueueDescriptionEntry entry = deserialize(response.getValue(), QueueDescriptionEntry.class); if (entry == null) { return new SimpleResponse<>(response.getRequest(), response.getStatusCode(), response.getHeaders(), null); } else if (entry.getContent() == null) { logger.warning("entry.getContent() is null. There should have been content returned. Entry: {}", entry); return new SimpleResponse<>(response.getRequest(), response.getStatusCode(), response.getHeaders(), null); } final QueueDescription result = entry.getContent().getQueueDescription(); final String queueName = getTitleValue(entry.getTitle()); QueueHelper.setName(result, queueName); return new SimpleResponse<>(response.getRequest(), response.getStatusCode(), response.getHeaders(), result); }
Source:
<code>public List<ReplPathMapping> write(boolean isExportTask) throws SemanticException { List<ReplPathMapping> replPathMappings = Collections.emptyList(); if (tableSpec == null) { writeMetaData(null); } else if (shouldExport()) { PartitionIterable withPartitions = getPartitions(); writeMetaData(withPartitions); if (!replicationSpec.isMetadataOnly() <START> && !Utils.shouldDumpMetaDataOnlyForExternalTables(tableSpec.tableHandle, conf) <END> && !(replicationSpec.isRepl() && tableSpec.tableHandle.getTableType().equals(TableType.EXTERNAL_TABLE))) { replPathMappings = writeData(withPartitions, isExportTask); } } else if (isExportTask) { throw new SemanticException(ErrorMsg.INCOMPATIBLE_SCHEMA.getMsg()); } return replPathMappings; }</code><technical_language>skipping this for external table ..this new check is required</technical_language>

Target:
public List<ReplPathMapping> write(boolean isExportTask) throws SemanticException { List<ReplPathMapping> replPathMappings = Collections.emptyList(); if (tableSpec == null) { writeMetaData(null); } else if (shouldExport()) { PartitionIterable withPartitions = getPartitions(); writeMetaData(withPartitions); if (!replicationSpec.isMetadataOnly() && !(replicationSpec.isRepl() && tableSpec.tableHandle.getTableType().equals(TableType.EXTERNAL_TABLE))) { replPathMappings = writeData(withPartitions, isExportTask); } } else if (isExportTask) { throw new SemanticException(ErrorMsg.INCOMPATIBLE_SCHEMA.getMsg()); } return replPathMappings; }
Source:
<code>protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Log.d(Constants.TAG, "NfcOperationActivity.onCreate"); getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); mInputParcel = getIntent().getParcelableExtra(EXTRA_CRYPTO_INPUT); if (mInputParcel == null) { <START> mInputParcel = new CryptoInputParcel(mRequiredInput.mSignatureTime); <END> } setTitle(R.string.nfc_text); vAnimator = (ViewAnimator) findViewById(R.id.view_animator); vAnimator.setDisplayedChild(0); vErrorText = (TextView) findViewById(R.id.nfc_activity_3_error_text); vErrorTryAgainButton = (Button) findViewById(R.id.nfc_activity_3_error_try_again); vErrorTryAgainButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { resumeTagHandling(); if (mRequiredInput.mType != RequiredInputParcel.RequiredInputType.NFC_MOVE_KEY_TO_CARD) { obtainYubiKeyPin(mRequiredInput); } vAnimator.setDisplayedChild(0); } }); Intent intent = getIntent(); Bundle data = intent.getExtras(); mRequiredInput = data.getParcelable(EXTRA_REQUIRED_INPUT); mServiceIntent = data.getParcelable(EXTRA_SERVICE_INTENT); if (mRequiredInput.mType != RequiredInputParcel.RequiredInputType.NFC_MOVE_KEY_TO_CARD) { obtainYubiKeyPin(mRequiredInput); } }</code><technical_language>This a change introduce future bugs. assume NFC operation is a signing operation here</technical_language>

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Log.d(Constants.TAG, "NfcOperationActivity.onCreate"); getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); mInputParcel = getIntent().getParcelableExtra(EXTRA_CRYPTO_INPUT); if (mInputParcel == null) { mInputParcel = new CryptoInputParcel(); } setTitle(R.string.nfc_text); vAnimator = (ViewAnimator) findViewById(R.id.view_animator); vAnimator.setDisplayedChild(0); vErrorText = (TextView) findViewById(R.id.nfc_activity_3_error_text); vErrorTryAgainButton = (Button) findViewById(R.id.nfc_activity_3_error_try_again); vErrorTryAgainButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { resumeTagHandling(); if (mRequiredInput.mType != RequiredInputParcel.RequiredInputType.NFC_MOVE_KEY_TO_CARD) { obtainYubiKeyPin(mRequiredInput); } vAnimator.setDisplayedChild(0); } }); Intent intent = getIntent(); Bundle data = intent.getExtras(); mRequiredInput = data.getParcelable(EXTRA_REQUIRED_INPUT); mServiceIntent = data.getParcelable(EXTRA_SERVICE_INTENT); if (mRequiredInput.mType != RequiredInputParcel.RequiredInputType.NFC_MOVE_KEY_TO_CARD) { obtainYubiKeyPin(mRequiredInput); } }
Source:
<code>public ListenerContainerIdleEvent(Object source, long idleTime, @Nullable String id, String... queueNames) { super(source); <START> this.idleTime = Duration.ofMillis(idleTime); <END> this.listenerId = id; this.queueNames = Arrays.asList(queueNames); }</code><technical_language>wrap, a simple long afterwards</technical_language>

Target:
public ListenerContainerIdleEvent(Object source, long idleTime, @Nullable String id, String... queueNames) { super(source); this.idleTime = idleTime; this.listenerId = id; this.queueNames = Arrays.asList(queueNames); }
Source:
<code>public DynamoDBConfiguration getPasswordResetDBConfiguration() { <START> return this.passwordResetDBConfiguration; <END> }</code><technical_language>need this. of above, stay consistent</technical_language>

Target:
public DynamoDBConfiguration getPasswordResetDBConfiguration() { return passwordResetDBConfiguration; }
Source:
<code>public void makeDisabled(boolean b) throws IOException { if(disabled==b) return; if (b && !supportsMakeDisabled()) return; this.disabled = b; if (b) { this.disabledSince = System.currentTimeMillis(); Jenkins.getInstance().getQueue().cancel(this); <START> } <END> save(); ItemListener.fireOnUpdated(this); }</code><technical_language>disabledSince is reset</technical_language>

Target:
public void makeDisabled(boolean b) throws IOException { if(disabled==b) return; if (b && !supportsMakeDisabled()) return; this.disabled = b; if (b) { this.disabledSince = System.currentTimeMillis(); Jenkins.getInstance().getQueue().cancel(this); } else { this.disabledSince = null; } save(); ItemListener.fireOnUpdated(this); }
Source:
<code>private Map<StoreKey, StoreKey> createConversionKeyMap(File[] replicas, Map<File, DumpIndexTool.IndexProcessingResults> results) throws Exception { <START> List<StoreKey> storeKeys = new ArrayList<>(); <END> for (File replica : replicas) { DumpIndexTool.IndexProcessingResults result = results.get(replica); for (Map.Entry<StoreKey, DumpIndexTool.Info> entry : result.getKeyToState().entrySet()) { storeKeys.add(entry.getKey()); } } return storeKeyConverter.convert(storeKeys); }</code><technical_language>a Set here? keys repeated stores</technical_language>

Target:
private Map<StoreKey, StoreKey> createConversionKeyMap(File[] replicas, Map<File, DumpIndexTool.IndexProcessingResults> results) throws Exception { Set<StoreKey> storeKeys = new HashSet<>(); for (File replica : replicas) { DumpIndexTool.IndexProcessingResults result = results.get(replica); for (Map.Entry<StoreKey, DumpIndexTool.Info> entry : result.getKeyToState().entrySet()) { storeKeys.add(entry.getKey()); } } return storeKeyConverter.convert(storeKeys); }
Source:
<code>public FileInStream openFile(AlluxioURI alluxioURI, OpenFilePOptions options) throws IOException { FSDataInputStream inputStream = fileSystem.open(toPath(alluxioURI)); <START> return new AlluxioCachingInputStream(inputStream); <END> }</code><technical_language>this a problem force FSDataInputStream openFile(Path path, HiveFileContext hiveFileContext) open files</technical_language>

Target:
public FileInStream openFile(AlluxioURI alluxioURI, OpenFilePOptions options) throws IOException { return new AlluxioCachingInputStream(fileSystem.open(toPath(alluxioURI))); }
Source:
<code>private static void assertGetAllResult(List<VmTemplate> result) { assertNotNull(result); assertFalse(result.isEmpty()); for (VmTemplate template : result){ <START> assertTrue("Template generation wasn't loaded as expected", template.getDbGeneration() == 1); <END> } }</code><technical_language>Wait, this is worse previous version. happened assertEquals()</technical_language>

Target:
private static void assertGetAllResult(List<VmTemplate> result) { assertNotNull(result); assertFalse(result.isEmpty()); for (VmTemplate template : result){ assertEquals("Template generation wasn't loaded as expected", 1, template.getDbGeneration()); } }
Source:
<code>public Operation exec(Prolog engine) throws PrologException { engine.setB0(); Term a1 = arg1.dereference(); PrologEnvironment env = (PrologEnvironment) engine.control; Change change = StoredValues.CHANGE.get(engine); Branch.NameKey name = change.getDest(); <START> if (!a1.unify(SymbolTerm.intern(name.get()), engine.trail)) { <END> return engine.fail(); } return cont; }</code><technical_language>intern. create instead. Intern pins string in memory forever. If a constant declared in code, is fine. for dynamic data a branch name bad, memory get released</technical_language>

Target:
public Operation exec(Prolog engine) throws PrologException { engine.setB0(); Term a1 = arg1.dereference(); PrologEnvironment env = (PrologEnvironment) engine.control; Change change = StoredValues.CHANGE.get(engine); Branch.NameKey name = change.getDest(); if (!a1.unify(SymbolTerm.create(name.get()), engine.trail)) { return engine.fail(); } return cont; }
Source:
<code>public List<String> getExtraStackDefinitionsUrls() { <START> return this != null ? getConfig(STACK_DEFINITION_URLS) : ImmutableList.<String>of(); <END> }</code><technical_language>more return getConfig(STACK_DEFINITION_URLS); ? this is null call this method, getConfig(STACK_DEFINITION_URLS) is set a default empty list</technical_language>

Target:
public List<String> getExtraStackDefinitionsUrls() { return getConfig(STACK_DEFINITION_URLS); }
Source:
<code>public boolean visitEnter(FunctionParseNode node) throws SQLException { if (node.isAggregate()) { if (aggregateFunction != null) { throw new SQLFeatureNotSupportedException("Nested aggregate functions are not supported"); } this.aggregateFunction = node; this.isAggregate = true; <START> } else if(node.getClass().isAssignableFrom(ArrayIndexFunction.class)) { <END> this.isAggregate = true; } return true; }</code><technical_language>Remove this change please</technical_language>

Target:
public boolean visitEnter(FunctionParseNode node) throws SQLException { if (node.isAggregate()) { if (aggregateFunction != null) { throw new SQLFeatureNotSupportedException("Nested aggregate functions are not supported"); } this.aggregateFunction = node; this.isAggregate = true; } return true; }
Source:
<code>public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } if (!super.equals(obj)) { return false; } ExtendedVmDynamic other = (ExtendedVmDynamic) obj; <START> return ObjectUtils.objectsEqual(host, other.host); <END> }</code><technical_language>this is vdsbroker, able java.util.Objects.equals()</technical_language>

Target:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } if (!super.equals(obj)) { return false; } ExtendedVmDynamic other = (ExtendedVmDynamic) obj; return Objects.equals(host, other.host); }
Source:
<code><START> public CatalogMap(Catalog catalog, CatalogType parent, String name, Class<T> cls, int depth) { <END> m_catalog = catalog; m_parent = parent; m_name = name; m_cls = cls; m_depth = depth; if (depth <= 3) { m_cachedPath = getPath(); } }</code><technical_language>Revert this</technical_language>

Target:
CatalogMap(Catalog catalog, CatalogType parent, String name, Class<T> cls, int depth) { m_catalog = catalog; m_parent = parent; m_name = name; m_cls = cls; m_depth = depth; if (depth <= 3) { m_cachedPath = getPath(); } }
Source:
<code>public void close() { <START> isClosed = true; <END> }</code><technical_language>shouldnt delegate closed flushed</technical_language>

Target:
public void close() throws IOException { isClosed = true; try { flush(); } catch (InterruptedException interruptedException) { throw new IOException(interruptedException); } }
Source:
<code>private void addAllActorsToStage(@ResetSpriteType int reset) { boolean addPenActor = true; for (Sprite sprite : sprites) { if (reset == RESET_SPRITE) { sprite.resetSprite(); sprite.look.createBrightnessContrastHueShader(); } stage.addActor(sprite.look); <START> if (addPenActor) { <END> penActor = new PenActor(); stage.addActor(penActor); addPenActor = false; } } stage.addActor(passepartout); }</code><technical_language>please move this out of for loop, this is done once, do this loop. (then boolean flag removed aswell)</technical_language>

Target:
private void addAllActorsToStage(@ResetSpriteType int reset) { for (Sprite sprite : sprites) { if (reset == RESET_SPRITE) { sprite.resetSprite(); sprite.look.createBrightnessContrastHueShader(); } stage.addActor(sprite.look); } penActor = new PenActor(); stage.getRoot().addActorAt(Constants.Z_INDEX_BACKGROUND + 1, penActor); stage.addActor(passepartout); }
Source:
<code>public void getPreferredServerHostkeyAlgorithmOrder_Multiple() throws Exception { KnownHosts obj = new KnownHosts(); obj.addHostkeys(getKnownHosts("known_hosts")); assertThat(obj.getPreferredServerHostkeyAlgorithmOrder("multiple"), <START> nullValue()); <END> }</code><technical_language>this return null? if set preferred hostkey algorithms, e.g. rsa ecdsa keys, server ed25519 prefers, verifier receive ed25519 fail</technical_language>

Target:
public void getPreferredServerHostkeyAlgorithmOrder_Multiple() throws Exception { KnownHosts obj = new KnownHosts(); obj.addHostkeys(getKnownHosts("known_hosts")); assertThat(obj.getPreferredServerHostkeyAlgorithmOrder("multiple"), arrayContaining( equalTo("ecdsa-sha2-nistp256"), equalTo("rsa-sha2-512"), equalTo("rsa-sha2-256"), equalTo("ssh-rsa"), equalTo("ssh-ed25519"), equalTo("ecdsa-sha2-nistp384"), equalTo("ecdsa-sha2-nistp521"), equalTo("ssh-dss") )); }
Source:
<code>public IPaymentDocument copyAsPaymentDocument() { final PaymentRow paymentRow = this; final ICurrencyDAO currenciesRepo = Services.get(ICurrencyDAO.class); final CurrencyId currencyId = currenciesRepo.getByCurrencyCode(paymentRow.getCurrencyISOCode()).getId(); return PaymentDocument.builder() <START> .clientAndOrgId(ClientAndOrgId.ofClientAndOrg(ClientId.METASFRESH, paymentRow.getOrgId())) <END> .paymentId(PaymentId.ofRepoId(paymentRow.getC_Payment_ID())) .bpartnerId(BPartnerId.ofRepoIdOrNull(paymentRow.getC_BPartner_ID())) .paymentDirection(paymentRow.getPaymentDirection()) .documentNo(paymentRow.getDocumentNo()) .openAmt(Money.of(paymentRow.getOpenAmtConv_APAdjusted(), currencyId)) .amountToAllocate(Money.of(paymentRow.getAppliedAmt_APAdjusted(), currencyId)) .dateTrx(TimeUtil.asLocalDate(paymentRow.getDocumentDate())) .build(); }</code><technical_language>avoid avoid hardcoding ClientId. ClientId.METASFRESH is manly for testing</technical_language>

Target:
public IPaymentDocument copyAsPaymentDocument() { final PaymentRow paymentRow = this; final ICurrencyDAO currenciesRepo = Services.get(ICurrencyDAO.class); final CurrencyId currencyId = currenciesRepo.getByCurrencyCode(paymentRow.getCurrencyISOCode()).getId(); return PaymentDocument.builder() .clientAndOrgId(ClientAndOrgId.ofClientAndOrg(Env.getClientId(), paymentRow.getOrgId())) .paymentId(PaymentId.ofRepoId(paymentRow.getC_Payment_ID())) .bpartnerId(BPartnerId.ofRepoIdOrNull(paymentRow.getC_BPartner_ID())) .paymentDirection(paymentRow.getPaymentDirection()) .documentNo(paymentRow.getDocumentNo()) .openAmt(Money.of(paymentRow.getOpenAmtConv_APAdjusted(), currencyId)) .amountToAllocate(Money.of(paymentRow.getAppliedAmt_APAdjusted(), currencyId)) .dateTrx(TimeUtil.asLocalDate(paymentRow.getDocumentDate())) .build(); }
Source:
<code>private boolean isTransient( String dataServiceName ) { return dataServiceName.contains( DELIMITER ); <START> } <END></code><technical_language>If a data service name contains a ~ treated transient, right? Is safe? some other indicator</technical_language>

Target:
public static boolean isTransient( String dataServiceName ) { return dataServiceName.startsWith( PREFIX ) && dataServiceName.contains( DELIMITER ); }
Source:
<code>protected UriBuilder createAuthorizationUrl(AuthenticationRequest request) { final UriBuilder uriBuilder = UriBuilder.fromUri(getConfig().getAuthorizationUrl()) .queryParam(OAUTH2_PARAMETER_SCOPE, getConfig().getDefaultScope()) .queryParam(OAUTH2_PARAMETER_STATE, request.getState().getEncoded()) .queryParam(OAUTH2_PARAMETER_RESPONSE_TYPE, "code") .queryParam(OAUTH2_PARAMETER_CLIENT_ID, getConfig().getClientId()) .queryParam(OAUTH2_PARAMETER_REDIRECT_URI, request.getRedirectUri()); String loginHint = request.getAuthenticationSession().getClientNote(OIDCLoginProtocol.LOGIN_HINT_PARAM); if (getConfig().isLoginHint() && loginHint != null) { uriBuilder.queryParam(OIDCLoginProtocol.LOGIN_HINT_PARAM, loginHint); } String prompt = getConfig().getPrompt(); if (prompt == null || prompt.isEmpty()) { prompt = request.getAuthenticationSession().getClientNote(OAuth2Constants.PROMPT); } if (prompt != null) { uriBuilder.queryParam(OAuth2Constants.PROMPT, prompt); } String acr = request.getAuthenticationSession().getClientNote(OAuth2Constants.ACR_VALUES); if (acr != null) { uriBuilder.queryParam(OAuth2Constants.ACR_VALUES, acr); } String nonce = request.getAuthenticationSession().getClientNote(OIDCLoginProtocol.NONCE_PARAM); if (nonce == null || nonce.isEmpty()) { nonce = UUID.randomUUID().toString(); request.getAuthenticationSession().setClientNote(OIDCLoginProtocol.NONCE_PARAM, nonce); } <START> if (nonce != null) { <END> uriBuilder.queryParam(OIDCLoginProtocol.NONCE_PARAM, nonce); } return uriBuilder; }</code><technical_language>happen "nonce" null if I read correctly? this "if" check unecessary? Besides that, PR good me</technical_language>

Target:
protected UriBuilder createAuthorizationUrl(AuthenticationRequest request) { final UriBuilder uriBuilder = UriBuilder.fromUri(getConfig().getAuthorizationUrl()) .queryParam(OAUTH2_PARAMETER_SCOPE, getConfig().getDefaultScope()) .queryParam(OAUTH2_PARAMETER_STATE, request.getState().getEncoded()) .queryParam(OAUTH2_PARAMETER_RESPONSE_TYPE, "code") .queryParam(OAUTH2_PARAMETER_CLIENT_ID, getConfig().getClientId()) .queryParam(OAUTH2_PARAMETER_REDIRECT_URI, request.getRedirectUri()); String loginHint = request.getAuthenticationSession().getClientNote(OIDCLoginProtocol.LOGIN_HINT_PARAM); if (getConfig().isLoginHint() && loginHint != null) { uriBuilder.queryParam(OIDCLoginProtocol.LOGIN_HINT_PARAM, loginHint); } String prompt = getConfig().getPrompt(); if (prompt == null || prompt.isEmpty()) { prompt = request.getAuthenticationSession().getClientNote(OAuth2Constants.PROMPT); } if (prompt != null) { uriBuilder.queryParam(OAuth2Constants.PROMPT, prompt); } String acr = request.getAuthenticationSession().getClientNote(OAuth2Constants.ACR_VALUES); if (acr != null) { uriBuilder.queryParam(OAuth2Constants.ACR_VALUES, acr); } String nonce = request.getAuthenticationSession().getClientNote(OIDCLoginProtocol.NONCE_PARAM); if (nonce == null || nonce.isEmpty()) { nonce = UUID.randomUUID().toString(); request.getAuthenticationSession().setClientNote(OIDCLoginProtocol.NONCE_PARAM, nonce); } uriBuilder.queryParam(OIDCLoginProtocol.NONCE_PARAM, nonce); return uriBuilder; }
Source:
<code>public void ecj() { final Label start = new Label(); final Label end = new Label(); final Label handler = new Label(); final Label handlerEnd = new Label(); <START> m.visitTryCatchBlock(start, end, handler, null); <END> m.visitTryCatchBlock(handler, handlerEnd, handler, null); m.visitVarInsn(Opcodes.ALOAD, 0); m.visitFieldInsn(Opcodes.GETFIELD, "Target", "lock", "Ljava/lang/Object;"); m.visitInsn(Opcodes.DUP); m.visitVarInsn(Opcodes.ASTORE, 1); m.visitInsn(Opcodes.MONITORENTER); m.visitLabel(start); m.visitVarInsn(Opcodes.ALOAD, 0); m.visitInsn(Opcodes.NOP); m.visitVarInsn(Opcodes.ALOAD, 1); m.visitInsn(Opcodes.MONITOREXIT); m.visitLabel(end); final Label exit = new Label(); m.visitJumpInsn(Opcodes.GOTO, exit); m.visitLabel(handler); m.visitVarInsn(Opcodes.ALOAD, 1); m.visitInsn(Opcodes.MONITOREXIT); m.visitLabel(handlerEnd); m.visitInsn(Opcodes.ATHROW); m.visitLabel(exit); m.visitInsn(Opcodes.RETURN); new SynchronizedFilter().filter(m, this); assertEquals(m.instructions.get(12), from); assertEquals(m.instructions.get(16), to); }</code><technical_language>BTW, get more readable byte code input I created a mini fluent API in prototype: <LINK_0></technical_language>

Target:
public void ecj() { final Label start = new Label(); final Label end = new Label(); final Label handler = new Label(); final Label handlerEnd = new Label(); m.visitTryCatchBlock(start, end, handler, null); m.visitTryCatchBlock(handler, handlerEnd, handler, null); m.visitVarInsn(Opcodes.ALOAD, 0); m.visitFieldInsn(Opcodes.GETFIELD, "Target", "lock", "Ljava/lang/Object;"); m.visitInsn(Opcodes.DUP); m.visitVarInsn(Opcodes.ASTORE, 1); m.visitInsn(Opcodes.MONITORENTER); m.visitLabel(start); m.visitVarInsn(Opcodes.ALOAD, 0); m.visitInsn(Opcodes.NOP); m.visitVarInsn(Opcodes.ALOAD, 1); m.visitInsn(Opcodes.MONITOREXIT); m.visitLabel(end); final Label exit = new Label(); m.visitJumpInsn(Opcodes.GOTO, exit); m.visitLabel(handler); m.visitVarInsn(Opcodes.ALOAD, 1); m.visitInsn(Opcodes.MONITOREXIT); m.visitLabel(handlerEnd); m.visitInsn(Opcodes.ATHROW); m.visitLabel(exit); m.visitInsn(Opcodes.RETURN); filter.filter(m, this); assertEquals(handler.info, fromInclusive); assertEquals(((LabelNode) exit.info).getPrevious(), toInclusive); }
Source:
<code>protected void executeQueryCommand() { List<? extends IVdcQueryable> returnValue = new ArrayList<IVdcQueryable>(); switch (getParameters().getSearchTypeValue()) { case VM: { returnValue = searchVmsFromDb(); break; } case DirectoryGroup: { returnValue = searchDirectoryGroups(); break; } case DirectoryUser: { returnValue = searchDirectoryUsers(); break; } case AuditLog: { returnValue = searchAuditLogEvents(); break; } case DBUser: { <START> returnValue = UserGroupUtil.retrieveUserAdGroups(searchDbUsers()); <END> break; } case DBGroup: { returnValue = searchDbGroups(); break; } case VDS: { returnValue = searchVDSsByDb(); break; } case VmTemplate: { returnValue = searchVMTemplates(); break; } case VmPools: { returnValue = searchVmPools(); break; } case Cluster: { returnValue = searchClusters(); break; } case StoragePool: { returnValue = searchStoragePool(); break; } case StorageDomain: { returnValue = searchStorageDomain(); break; } case Quota: { returnValue = searchQuota(); break; } case Disk: { returnValue = searchDisk(); break; } case GlusterVolume: { returnValue = searchGlusterVolumes(); break; } case Network: { returnValue = searchNetworks(); break; } case Provider: { returnValue = searchProviders(); break; } case InstanceType: { returnValue = searchInstanceTypes(); break; } case ImageType: { returnValue = searchVMTemplates(); break; } default: { log.error("Search object type not handled: {}", getParameters().getSearchTypeValue()); break; } } getQueryReturnValue().setReturnValue(returnValue); }</code><technical_language>do need groups in search</technical_language>

Target:
protected void executeQueryCommand() { List<? extends IVdcQueryable> returnValue = new ArrayList<IVdcQueryable>(); switch (getParameters().getSearchTypeValue()) { case VM: { returnValue = searchVmsFromDb(); break; } case DirectoryGroup: { returnValue = searchDirectoryGroups(); break; } case DirectoryUser: { returnValue = searchDirectoryUsers(); break; } case AuditLog: { returnValue = searchAuditLogEvents(); break; } case DBUser: { List<DbUser> users = searchDbUsers(); if (getParameters().getResolveGroups()) { UserGroupUtil.retrieveUserGroups(users); } returnValue = users; break; } case DBGroup: { returnValue = searchDbGroups(); break; } case VDS: { returnValue = searchVDSsByDb(); break; } case VmTemplate: { returnValue = searchVMTemplates(); break; } case VmPools: { returnValue = searchVmPools(); break; } case Cluster: { returnValue = searchClusters(); break; } case StoragePool: { returnValue = searchStoragePool(); break; } case StorageDomain: { returnValue = searchStorageDomain(); break; } case Quota: { returnValue = searchQuota(); break; } case Disk: { returnValue = searchDisk(); break; } case GlusterVolume: { returnValue = searchGlusterVolumes(); break; } case Network: { returnValue = searchNetworks(); break; } case Provider: { returnValue = searchProviders(); break; } case InstanceType: { returnValue = searchInstanceTypes(); break; } case ImageType: { returnValue = searchVMTemplates(); break; } default: { log.error("Search object type not handled: {}", getParameters().getSearchTypeValue()); break; } } getQueryReturnValue().setReturnValue(returnValue); }
Source:
<code>protected boolean considerEvent(@NonNull ITmfEvent event) { <START> return true; <END> }</code><technical_language>events a phase</technical_language>

Target:
protected boolean considerEvent(@NonNull ITmfEvent event) { String ph = event.getContent().getFieldValue(String.class, ITraceEventConstants.PHASE); return (ph != null); }
Source:
<code><START> public void setSelectedChapter(@NonNull Chapter chapter) { <END> if (mSelectedChapter != null) { trackView(); } this.mSelectedChapter = chapter; }</code><technical_language>If add @NonNull worth checking null inside. safely assume client of method is fulfilling null pre-condition. IDE client of method a null argument passed. So, remove @NonNull remove check for != null inside</technical_language>

Target:
public void setSelectedChapter(@NonNull Chapter chapter) { if (mSelectedChapter != null) { trackView(); } mSelectedChapter = chapter; }
Source:
<code>private synchronized void loadSettings() { try (InputStream is = settingsFacade.getRawConfig(SETTINGS)) { String jsonText = IOUtils.toString(is); Gson gson = new Gson(); settings = gson.fromJson(jsonText, Settings.class); } catch (Exception e) { <START> LOGGER.debug(e.toString()); <END> throw new JsonIOException(e); } }</code><technical_language>this debug is redundant</technical_language>

Target:
private synchronized void loadSettings() { try (InputStream is = settingsFacade.getRawConfig(SETTINGS)) { String jsonText = IOUtils.toString(is); Gson gson = new Gson(); settings = gson.fromJson(jsonText, Settings.class); } catch (Exception e) { throw new JsonIOException(e); } }
Source:
<code><START> private QualityProfileDto dto(String key) { <END> return new QualityProfileDto() { { setKey(key); } @Override public String toString() { return getKey(); } }; }</code><technical_language>Strange call simply new QualityProfileDto().setKey(key). Do I miss something</technical_language>

Target:
private QualityProfileDto dto(String key) { return new QualityProfileDto() { @Override public String toString() { return getKey(); } }.setKey(key); }