auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void fireErrors(String fileName, SortedSet<LocalizedMessage> errors) { final String stripped = CommonUtils.relativizeAndNormalizePath(basedir, fileName); <START> boolean removeCache = false; <END> for (final LocalizedMessage element : errors) { final AuditEvent event = new AuditEvent(this, stripped, element); if (filters.accept(event)) { removeCache = true; for (final AuditListener listener : listeners) { listener.addError(event); } } } if (removeCache && cache != null) { cache.remove(fileName); } }</code><technical_language>please rename variable "hasNonFilteredViolations", naming base principle of contains used</technical_language>

Target:
public void fireErrors(String fileName, SortedSet<LocalizedMessage> errors) { final String stripped = CommonUtils.relativizeAndNormalizePath(basedir, fileName); boolean hasNonFilteredViolations = false; for (final LocalizedMessage element : errors) { final AuditEvent event = new AuditEvent(this, stripped, element); if (filters.accept(event)) { hasNonFilteredViolations = true; for (final AuditListener listener : listeners) { listener.addError(event); } } } if (hasNonFilteredViolations && cache != null) { cache.remove(fileName); } }
Source:
<code>public void setupContext() { super.setupContext(); final String tag = toTag(IMAGE_REPOSITORY, IMAGE_TAG_1); BuildOptions options = BuildOptions.Builder.tag(tag).verbose(false).nocache(false); InputStream buildImageStream; try { buildImageStream = api().getMiscApi().build(BaseDockerApiLiveTest.tarredDockerfile(), options); consumeStreamSilently(buildImageStream); } catch (IOException e) { <START> e.printStackTrace(); <END> } image = api().getImageApi().inspectImage(tag); api().getImageApi().tagImage(image.id(), IMAGE_REPOSITORY, IMAGE_TAG_2, true); }</code><technical_language>exception propagated instead, avoid executing tests</technical_language>

Target:
public void setupContext() { super.setupContext(); final String tag = toTag(IMAGE_REPOSITORY, IMAGE_TAG_1); BuildOptions options = BuildOptions.Builder.tag(tag).verbose(false).nocache(false); InputStream buildImageStream; try { buildImageStream = api().getMiscApi().build(BaseDockerApiLiveTest.tarredDockerfile(), options); consumeStreamSilently(buildImageStream); } catch (IOException e) { throw new RuntimeException("Error occured during building Docker image.", e); } image = api().getImageApi().inspectImage(tag); api().getImageApi().tagImage(image.id(), IMAGE_REPOSITORY, IMAGE_TAG_2, true); }
Source:
<code>public GdbTerminalConnector(Process process) { fProcess = process; new OutputReadJob(process.getInputStream()).schedule(); <START> new OutputReadJob(process.getErrorStream()).schedule(); <END> }</code><technical_language>This class starts reading GDB terminalControl registered, initial printouts (e.g., version printout) lost. However, leave this is for a future patch storing output anyway</technical_language>

Target:
public GdbTerminalConnector(Process process) { fProcess = process; fOutputStreamJob = new OutputReadJob(process.getInputStream()); fOutputStreamJob.schedule(); fErrorStreamJob = new OutputReadJob(process.getErrorStream()); fErrorStreamJob.schedule(); }
Source:
<code>private void ackImpl(long uso) { if (uso > 0) { try { releaseExportBytes(uso); } catch (IOException e) { VoltDB.crashLocalVoltDB("Error attempting to release export bytes", true, e); return; } if (m_retiredMaster && uso >= m_usoToDrain) { unacceptMastership(); m_generation.migrateDataSource(this); } <START> if (m_anarchy && uso >= m_usoToDrain) { <END> m_anarchy = false; m_usoToDrain = -1L; } } }</code><technical_language>is clear this anarchy flag is for. this usoToDrain check here</technical_language>

Target:
private void ackImpl(long uso) { if (uso > 0) { try { releaseExportBytes(uso); } catch (IOException e) { VoltDB.crashLocalVoltDB("Error attempting to release export bytes", true, e); return; } if (m_newLeaderHostId != null && uso >= m_usoToDrain) { unacceptMastership(); sendTakeMastershipEvent(uso); } } }
Source:
<code>public Future<ReadableStreamChannel> getBlob(String blobId, Callback<ReadableStreamChannel> callback) { FutureResult<ReadableStreamChannel> futureResult = new FutureResult<ReadableStreamChannel>(); if (isRunning.get()) { <START> getOperationController().getBlob(blobId, futureResult, null); <END> } else { completeOperation(futureResult, null, callback, new RouterException("Cannot accept operation because Router is closed", RouterErrorCode.RouterClosed)); } return futureResult; }</code><technical_language>callback is null</technical_language>

Target:
public Future<ReadableStreamChannel> getBlob(String blobId, Callback<ReadableStreamChannel> callback) { FutureResult<ReadableStreamChannel> futureResult = new FutureResult<ReadableStreamChannel>(); if (isOpen.get()) { getOperationController().getBlob(blobId, futureResult, callback); } else { completeOperation(futureResult, null, callback, new RouterException("Cannot accept operation because Router is closed", RouterErrorCode.RouterClosed)); } return futureResult; }
Source:
<code>public static Relation wbFromDMN(final JSITRelation dmn, final BiConsumer<String, HasComponentWidths> hasComponentWidthsConsumer) { final Id id = IdPropertyConverter.wbFromDMN(dmn.getId()); final Description description = DescriptionPropertyConverter.wbFromDMN(dmn.getDescription()); final QName typeRef = QNamePropertyConverter.wbFromDMN(dmn.getTypeRef()); final List<InformationItem> convertedColumns = new ArrayList<>(); final List<JSITInformationItem> jsiColumns = dmn.getColumn(); for (int i = 0; i < jsiColumns.size(); i++) { final JSITInformationItem jsiColumn = Js.uncheckedCast(jsiColumns.get(i)); convertedColumns.add(InformationItemPropertyConverter.wbFromDMN(jsiColumn)); } final List<org.kie.workbench.common.dmn.api.definition.model.List> convertedRows = new ArrayList<>(); final List<JSITList> jsiRows = dmn.getRow(); for (int i = 0; i < jsiRows.size(); i++) { final JSITList jsiRow = Js.uncheckedCast(jsiRows.get(i)); convertedRows.add(ListPropertyConverter.wbFromDMN(jsiRow, hasComponentWidthsConsumer)); } final Relation result = new Relation(id, description, typeRef, convertedColumns, convertedRows); <START> for (InformationItem c : convertedColumns) { <END> if (c != null) { c.setParent(result); } } for (org.kie.workbench.common.dmn.api.definition.model.List r : convertedRows) { if (r != null) { r.setParent(result); } } return result; }</code><technical_language>column instead of c code more readable, do think</technical_language>

Target:
public static Relation wbFromDMN(final JSITRelation dmn, final BiConsumer<String, HasComponentWidths> hasComponentWidthsConsumer) { final Id id = IdPropertyConverter.wbFromDMN(dmn.getId()); final Description description = DescriptionPropertyConverter.wbFromDMN(dmn.getDescription()); final QName typeRef = QNamePropertyConverter.wbFromDMN(dmn.getTypeRef()); final List<InformationItem> convertedColumns = new ArrayList<>(); final List<JSITInformationItem> jsiColumns = dmn.getColumn(); for (int i = 0; i < jsiColumns.size(); i++) { final JSITInformationItem jsiColumn = Js.uncheckedCast(jsiColumns.get(i)); convertedColumns.add(InformationItemPropertyConverter.wbFromDMN(jsiColumn)); } final List<org.kie.workbench.common.dmn.api.definition.model.List> convertedRows = new ArrayList<>(); final List<JSITList> jsiRows = dmn.getRow(); for (int i = 0; i < jsiRows.size(); i++) { final JSITList jsiRow = Js.uncheckedCast(jsiRows.get(i)); convertedRows.add(ListPropertyConverter.wbFromDMN(jsiRow, hasComponentWidthsConsumer)); } final Relation result = new Relation(id, description, typeRef, convertedColumns, convertedRows); for (InformationItem column : convertedColumns) { if (Objects.nonNull(column)) { column.setParent(result); } } for (org.kie.workbench.common.dmn.api.definition.model.List row : convertedRows) { if (Objects.nonNull(row)) { row.setParent(result); } } return result; }
Source:
<code>private void validateNewFolderName() { String newFolderName = fNewFolderNameText.getText(); IWorkspace workspace = fFolder.getResource().getWorkspace(); IStatus nameStatus = workspace.validateName(newFolderName, IResource.FOLDER); if ("".equals(newFolderName)) { updateStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, IStatus.ERROR, Messages.Dialog_EmptyNameError, null)); return; } if (!nameStatus.isOK()) { updateStatus(nameStatus); return; } IPath newPath = new Path(newFolderName); IContainer parentFolder = fFolder.getResource().getParent(); <START> if (parentFolder.getFolder(newPath).exists() || parentFolder.getFile(newPath).exists()) { <END> updateStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, IStatus.ERROR, Messages.Dialog_ExistingNameError, null)); return; } updateStatus(new Status(IStatus.OK, Activator.PLUGIN_ID, "")); }</code><technical_language>findMember instead of</technical_language>

Target:
private void validateNewFolderName() { String newFolderName = fNewFolderNameText.getText(); IWorkspace workspace = fFolder.getResource().getWorkspace(); IStatus nameStatus = workspace.validateName(newFolderName, IResource.FOLDER); if ("".equals(newFolderName)) { updateStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, IStatus.ERROR, Messages.Dialog_EmptyNameError, null)); return; } if (!nameStatus.isOK()) { updateStatus(nameStatus); return; } IContainer parentFolder = fFolder.getResource().getParent(); if (parentFolder.findMember(newFolderName) != null) { updateStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, IStatus.ERROR, Messages.Dialog_ExistingNameError, null)); return; } updateStatus(new Status(IStatus.OK, Activator.PLUGIN_ID, "")); }
Source:
<code>private String readFromInputStream(InputStream inputStream) throws IOException { <START> InputStreamReader isr = new InputStreamReader((inputStream)); <END> BufferedReader br = new BufferedReader(isr); StringBuilder out = new StringBuilder(""); String line; while ((line = br.readLine()) != null) { out.append(line); } return out.toString(); }</code><technical_language>close input stream</technical_language>

Target:
private String readFromInputStream(InputStream inputStream) throws IOException { InputStreamReader isr = new InputStreamReader((inputStream)); BufferedReader br = new BufferedReader(isr); StringBuilder out = new StringBuilder(""); String line; try { while ((line = br.readLine()) != null) { out.append(line); } } finally { br.close(); isr.close(); } return out.toString(); }
Source:
<code>private StreamOperatorSpec(FlatMapFunction<M, OM> transformFn, OperatorSpec.OpCode opCode, String opId) { super(opCode, opId); this.transformFn = transformFn; <START> this.userFn = transformFn; <END> }</code><technical_language>do need userFn transformFn</technical_language>

Target:
protected StreamOperatorSpec(FlatMapFunction<M, OM> transformFn, OperatorSpec.OpCode opCode, String opId) { super(opCode, opId); this.transformFn = transformFn; }
Source:
<code>public boolean onCreateOptionsMenu(Menu menu) { MenuItem overflowItem = menu.add(0, MENU_OVERFLOW, 0, null); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) <START> overflowItem.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS); <END> overflowItem.setIcon(R.drawable.ic_menu_moreoverflow_normal_holo_light); return true; }</code><technical_language>MenuCompat for this</technical_language>

Target:
public boolean onCreateOptionsMenu(Menu menu) { MenuItem overflowItem = menu.add(0, MENU_OVERFLOW, 0, null); MenuItemCompat.setShowAsAction(overflowItem, MenuItem.SHOW_AS_ACTION_ALWAYS); overflowItem.setIcon(R.drawable.ic_menu_moreoverflow_normal_holo_light); return true; }
Source:
<code>protected void executeCommand() { StoragePoolIsoMap map = getStoragePoolIsoMapDAO().get (new StoragePoolIsoMapId(getParameters().getStorageDomainId(), getParameters().getStoragePoolId())); changeDomainStatusWithCompensation(map, StorageDomainStatus.Unknown, StorageDomainStatus.Locked); if (shouldPerformOvfUpdate()) { <START> Backend.getInstance().runInternalAction(VdcActionType.ProcessOvfUpdateForStoragePool, new StoragePoolParametersBase(getStoragePoolId())); <END> VdcReturnValueBase tmpRetValue = runInternalActionWithTasksContext(VdcActionType.ProcessOvfUpdateForStorageDomain, createProcessOvfUpdateForDomainParams(), getLock()); getReturnValue().getVdsmTaskIdList().addAll(tmpRetValue.getInternalVdsmTaskIdList()); } if (getReturnValue().getVdsmTaskIdList().isEmpty()) { executeDeactivateCommnad(); } else { setCommandShouldBeLogged(false); } setSucceeded(true); }</code><technical_language>runInternalAction (remove Backend.getInstance())</technical_language>

Target:
protected void executeCommand() { StoragePoolIsoMap map = getStoragePoolIsoMapDAO().get (new StoragePoolIsoMapId(getParameters().getStorageDomainId(), getParameters().getStoragePoolId())); changeDomainStatusWithCompensation(map, StorageDomainStatus.Unknown, StorageDomainStatus.Locked); if (shouldPerformOvfUpdate()) { runInternalAction(VdcActionType.ProcessOvfUpdateForStoragePool, new StoragePoolParametersBase(getStoragePoolId())); VdcReturnValueBase tmpRetValue = runInternalActionWithTasksContext(VdcActionType.ProcessOvfUpdateForStorageDomain, createProcessOvfUpdateForDomainParams(), getLock()); getReturnValue().getVdsmTaskIdList().addAll(tmpRetValue.getInternalVdsmTaskIdList()); } if (getReturnValue().getVdsmTaskIdList().isEmpty()) { executeDeactivateCommnad(); } else { setCommandShouldBeLogged(false); } setSucceeded(true); }
Source:
<code>public void testStringConcatenationWithMacroCPP() throws Exception { IASTTranslationUnit tu = parse(getAboveComment(), CPP, false, false); IASTProblem[] problems = tu.getPreprocessorProblems(); assertEquals(1, problems.length); <START> assertEquals(IProblem.PREPROCESS_INVALID_USER_DEFINED_SUFFIX, problems[0].getID()); <END> }</code><technical_language>CDT more picky clang g++. compilers option disable warnings related this. This means CDT issue warning error</technical_language>

Target:
public void testStringConcatenationWithMacroCPP() throws Exception { IASTTranslationUnit tu = parseAndCheckBindings(getAboveComment(), CPP); IASTFunctionDefinition testFn = (IASTFunctionDefinition) tu.getDeclarations()[1]; IASTCompoundStatement fnBody = (IASTCompoundStatement) testFn.getBody(); IASTFunctionCallExpression fnCall = (IASTFunctionCallExpression) ((IASTExpressionStatement)fnBody.getStatements()[0]).getExpression(); IASTLiteralExpression arg = (IASTLiteralExpression) fnCall.getArguments()[0]; assertEquals("\"aaamacro\"", arg.toString()); }
Source:
<code>public AsyncTasks mapRow(ResultSet rs, int rowNum) throws SQLException { AsyncTasks entity = new AsyncTasks(); entity.setaction_type(VdcActionType.forValue(rs.getInt("action_type"))); entity.setresult(AsyncTaskResultEnum.forValue(rs.getInt("result"))); entity.setstatus(AsyncTaskStatusEnum.forValue(rs.getInt("status"))); <START> entity.setTaskId(Guid.createGuidFromStringDefaultEmpty(rs.getString("task_id"))); <END> entity.setVdsmTaskId(Guid.createGuidFromString(rs.getString("vdsm_task_id"))); entity.setActionParameters(deserializeParameters(rs.getString("action_parameters"), rs.getString("action_params_class"))); entity.setTaskParameters(deserializeParameters(rs.getString("task_parameters"), rs.getString("task_params_class"))); entity.setStepId(Guid.createGuidFromString(rs.getString("step_id"))); entity.setCommandId(Guid.createGuidFromStringDefaultEmpty(rs.getString("command_id"))); entity.setRootCommandId(Guid.createGuidFromStringDefaultEmpty(rs.getString("root_command_id"))); entity.setStartTime(DbFacadeUtils.fromDate(rs.getTimestamp("started_at"))); entity.setTaskType(AsyncTaskType.forValue(rs.getInt("task_type"))); entity.setStoragePoolId(getGuidDefaultEmpty(rs, "storage_pool_id")); return entity; }</code><technical_language>getGuid("task_id")</technical_language>

Target:
public AsyncTasks mapRow(ResultSet rs, int rowNum) throws SQLException { AsyncTasks entity = new AsyncTasks(); entity.setaction_type(VdcActionType.forValue(rs.getInt("action_type"))); entity.setresult(AsyncTaskResultEnum.forValue(rs.getInt("result"))); entity.setstatus(AsyncTaskStatusEnum.forValue(rs.getInt("status"))); entity.setTaskId(getGuidDefaultEmpty(rs, "task_id")); entity.setVdsmTaskId(getGuid(rs, "vdsm_task_id")); entity.setActionParameters(deserializeParameters(rs.getString("action_parameters"),rs.getString("action_params_class"))); entity.setTaskParameters(deserializeParameters(rs.getString("task_parameters"),rs.getString("task_params_class"))); entity.setStepId(getGuid(rs, "step_id")); entity.setCommandId(getGuidDefaultEmpty(rs, "command_id")); entity.setRootCommandId(getGuidDefaultEmpty(rs, "root_command_id")); entity.setStartTime(DbFacadeUtils.fromDate(rs.getTimestamp("started_at"))); entity.setTaskType(AsyncTaskType.forValue(rs.getInt("task_type"))); entity.setStoragePoolId(getGuidDefaultEmpty(rs, "storage_pool_id")); return entity; }
Source:
<code>public void remove(Map<String, Object> input ){ <START> if(!(input instanceof Map)) <END> throw new SpecException("Expected a map. Got input of type: " + input.getClass().getName()); List<String> keysToBeRemoved = getKeysToBeRemoved(input); for (String key :keysToBeRemoved){ removeByKey(input, key); } }</code><technical_language>die if get a map. some tests input data is array die</technical_language>

Target:
public void remove(Map<String, Object> input ){ if(!(input instanceof Map)) return; List<String> keysToBeRemoved = findKeysToBeRemoved(input); for (String key : keysToBeRemoved){ removeByKey(input, key); } }
Source:
<code>public AsyncBlobStore getAsyncBlobStore(String regionId) { checkRegionId(regionId); <START> return new org.jclouds.openstack.swift.v1.blobstore.internal.SubmissionAsyncBlobStore( <END> blobStoreInRegion(regionId), executor); }</code><technical_language>curious...any reason for fully-qualified name here</technical_language>

Target:
public AsyncBlobStore getAsyncBlobStore(String regionId) { checkRegionId(regionId); return new SubmissionAsyncBlobStore(blobStoreInRegion(regionId), executor); }
Source:
<code>public FormController(ControllerConfigResolver configResolver) { <START> super(configResolver.getNextUri(), <END> configResolver.getView(), configResolver.getUri(), configResolver.getMessageSource(), configResolver.getLocaleResolver() ); this.csrfTokenManager = configResolver.getCsrfTokenManager(); this.fieldValueResolver = new ContentNegotiatingFieldValueResolver(); Assert.notNull(this.csrfTokenManager, "csrfTokenManager cannot be null."); Assert.notNull(this.fieldValueResolver, "fieldValueResolver cannot be null."); }</code><technical_language>Nop, I change this in register branch issue/583 is based out of this one</technical_language>

Target:
public FormController(ControllerConfigResolver configResolver) { super(configResolver); this.csrfTokenManager = configResolver.getCsrfTokenManager(); this.formFields = configResolver.getFormFields(); this.fieldValueResolver = new ContentNegotiatingFieldValueResolver(); Assert.notNull(this.csrfTokenManager, "csrfTokenManager cannot be null."); Assert.notNull(this.fieldValueResolver, "fieldValueResolver cannot be null."); }
Source:
<code>private void configureProActiveDefaultConfigurationFile() { if (System.getProperty(CentralPAPropertyRepository.PA_CONFIGURATION_FILE.getName()) == null) { File defaultProActiveConfiguration = new File(System.getProperty(PAResourceManagerProperties.RM_HOME.getKey()), "config/network/node.ini"); if (defaultProActiveConfiguration.exists()) { System.setProperty(CentralPAPropertyRepository.PA_CONFIGURATION_FILE.getName(), defaultProActiveConfiguration.getAbsolutePath()); } else { System.setProperty(CentralPAPropertyRepository.PA_CONFIGURATION_FILE.getName(), <START> RMNodeStarter.class.getResource("/config/network/node.ini").toString()); <END> } } }</code><technical_language>create a default static final string hold this : "/config/network/node.ini"</technical_language>

Target:
private void configureProActiveDefaultConfigurationFile() { if (System.getProperty(CentralPAPropertyRepository.PA_CONFIGURATION_FILE.getName()) == null) { File defaultProActiveConfiguration = new File(System.getProperty(PAResourceManagerProperties.RM_HOME.getKey()), CONFIG_NETWORK_NODE_PATH_RELATIVE); if (defaultProActiveConfiguration.exists()) { System.setProperty(CentralPAPropertyRepository.PA_CONFIGURATION_FILE.getName(), defaultProActiveConfiguration.getAbsolutePath()); } else { System.setProperty(CentralPAPropertyRepository.PA_CONFIGURATION_FILE.getName(), RMNodeStarter.class.getResource("/" + CONFIG_NETWORK_NODE_PATH_RELATIVE).toString()); } } }
Source:
<code>public String resolve(IFile file, String baseLocation, String publicId, String systemId) { ICatalog catalog = JSONCorePlugin.getDefault().getDefaultJSONCatalog(); if (catalog == null) { Logger.log(Logger.ERROR_DEBUG, JSONCoreMessages.Catalog_resolution_null_catalog); return null; } if (publicId != null || systemId != null) { return null; } <START> if (file == null) { END> Logger.log(Logger.ERROR_DEBUG, JSONCoreMessages.Catalog_resolution_malformed_url); return null; } try { return catalog.resolveSchema(file.getName()); } catch (MalformedURLException me) { Logger.log(Logger.ERROR_DEBUG, JSONCoreMessages.Catalog_resolution_malformed_url); return null; } catch (IOException ie) { Logger.log(Logger.ERROR_DEBUG, JSONCoreMessages.Catalog_resolution_io_exception); return null; } }</code><technical_language>move this check check retrieve ICatalog</technical_language>

Target:
public String resolve(IFile file, String baseLocation, String publicId, String systemId) { if (publicId != null || systemId != null) { return null; } if (file == null) { Logger.log(Logger.ERROR_DEBUG, JSONCoreMessages.Catalog_resolution_malformed_url); return null; } ICatalog catalog = JSONCorePlugin.getDefault().getDefaultJSONCatalog(); if (catalog == null) { Logger.log(Logger.ERROR_DEBUG, JSONCoreMessages.Catalog_resolution_null_catalog); return null; } try { return catalog.resolveSchema(file.getName()); } catch (MalformedURLException me) { Logger.log(Logger.ERROR_DEBUG, JSONCoreMessages.Catalog_resolution_malformed_url); } catch (IOException ie) { Logger.log(Logger.ERROR_DEBUG, JSONCoreMessages.Catalog_resolution_io_exception); } return null; }
Source:
<code>private void push(DataComplex dataComplex, boolean isList) { if (_currObjSize >= 0) { _currObjSizeStack.push(_currObjSize); } <START> if (_currObjSize == 0) { addValue(dataComplex); return; } <END> if (!(_isCurrList || _stack.isEmpty())) { _currFieldStack.push(_currField); _currField = null; } _stack.push(dataComplex); _isCurrList = isList; updateExpected(); }</code><technical_language>Is this a bug? this logic is clear for me. explain</technical_language>

Target:
private void push(DataComplex dataComplex, boolean isList) { if (!(_isCurrList || _stack.isEmpty())) { _currFieldStack.push(_currField); _currField = null; } _stack.push(dataComplex); _isCurrList = isList; updateExpected(); }
Source:
<code><START> protected List<String> updateJVMOptions() throws Exception { <END> File jvmOptionsFile = new File(config.getJVMOptionsFileLocation()); validate(jvmOptionsFile); final GCType configuredGC = config.getGCType(); final Map<String, JVMOption> excludeSet = config.getJVMExcludeSet(); Map<String, JVMOption> upsertSet = config.getJVMUpsertSet(); List<String> optionsFromFile = Files.lines(jvmOptionsFile.toPath()).collect(Collectors.toList()); List<String> configuredOptions = new LinkedList<>(); for (String line: optionsFromFile) { configuredOptions.add(updateConfigurationValue(line, configuredGC, upsertSet, excludeSet)); } if (upsertSet != null && !upsertSet.isEmpty()) { configuredOptions.add("#################"); configuredOptions.add("# USER PROVIDED CUSTOM JVM CONFIGURATIONS #"); configuredOptions.add("#################"); configuredOptions.addAll(upsertSet.values().stream() .map(jvmOption -> jvmOption.toString()).collect(Collectors.toList())); } return configuredOptions; }</code><technical_language>is function? If is different, more descriptive name</technical_language>

Target:
protected List<String> updateJVMOptions() throws Exception { File jvmOptionsFile = new File(config.getJVMOptionsFileLocation()); validate(jvmOptionsFile); final GCType configuredGC = config.getGCType(); final Map<String, JVMOption> excludeSet = config.getJVMExcludeSet(); Map<String, JVMOption> upsertSet = config.getJVMUpsertSet(); List<String> optionsFromFile = Files.lines(jvmOptionsFile.toPath()).collect(Collectors.toList()); List<String> configuredOptions = new LinkedList<>(); for (String line : optionsFromFile) { configuredOptions.add(updateConfigurationValue(line, configuredGC, upsertSet, excludeSet)); } if (upsertSet != null && !upsertSet.isEmpty()) { configuredOptions.add("#################"); configuredOptions.add("# USER PROVIDED CUSTOM JVM CONFIGURATIONS #"); configuredOptions.add("#################"); configuredOptions.addAll(upsertSet.values().stream() .map(jvmOption -> jvmOption.toJVMOptionString()).collect(Collectors.toList())); } return configuredOptions; }
Source:
<code>public void testCostOfRootFileStatus() throws Throwable { Path root = path("/"); S3AFileStatus rootStatus = verifyRawInnerGetFileStatus( root, false, StatusProbeEnum.ALL, ROOT_FILE_STATUS_PROBE); <START> Assertions.assertThat(rootStatus.isDirectory()) <END> .describedAs("Status returned should be a directory") .isEqualTo(true); Assertions.assertThat(rootStatus.isEmptyDirectory()) .isEqualTo(Tristate.UNKNOWN); rootStatus = verifyRawInnerGetFileStatus( root, true, StatusProbeEnum.ALL, FILE_STATUS_DIR_PROBE); Assertions.assertThat(rootStatus.isDirectory()) .describedAs("Status returned should be a directory") .isEqualTo(true); Assertions.assertThat(rootStatus.isEmptyDirectory()) .isNotEqualByComparingTo(Tristate.UNKNOWN); }</code><technical_language>for strictness, L270 do a status.toString() a variable, include end of describedAs message. way, if assertion failure, status</technical_language>

Target:
public void testCostOfRootFileStatus() throws Throwable { Path root = path("/"); S3AFileStatus rootStatus = verifyRawInnerGetFileStatus( root, false, StatusProbeEnum.ALL, ROOT_FILE_STATUS_PROBE); String rootStatusContent = rootStatus.toString(); Assertions.assertThat(rootStatus.isDirectory()) .describedAs("Status returned should be a directory " + rootStatusContent) .isEqualTo(true); Assertions.assertThat(rootStatus.isEmptyDirectory()) .isEqualTo(Tristate.UNKNOWN); rootStatus = verifyRawInnerGetFileStatus( root, true, StatusProbeEnum.ALL, FILE_STATUS_DIR_PROBE); Assertions.assertThat(rootStatus.isDirectory()) .describedAs("Status returned should be a directory " + rootStatusContent) .isEqualTo(true); Assertions.assertThat(rootStatus.isEmptyDirectory()) .isNotEqualByComparingTo(Tristate.UNKNOWN); }
Source:
<code>public void finish() { if (finished) { return; } if (indexNotNeeded == null) { PagesSpatialIndex spatialIndex = index.createPagesSpatialIndex(operatorContext.getSession(), indexChannel, spatialRelationshipTest, filterFunctionFactory, outputChannels); localUserMemoryContext.setBytes(spatialIndex.getEstimatedMemorySizeInBytes()); indexNotNeeded = pagesSpatialIndexFactory.lendPagesSpatialIndex(spatialIndex); } <START> else if (indexNotNeeded.isDone()) { <END> index.clear(); localUserMemoryContext.setBytes(index.getEstimatedSize().toBytes()); finished = true; } }</code><technical_language>I want if here. if pagesSpatialIndexFactory returns immediately completed future, finish immediately</technical_language>

Target:
public void finish() { if (finishing) { return; } finishing = true; PagesSpatialIndexSupplier spatialIndex = index.createPagesSpatialIndex(operatorContext.getSession(), indexChannel, spatialRelationshipTest, filterFunctionFactory, outputChannels); localUserMemoryContext.setBytes(index.getEstimatedSize().toBytes() + spatialIndex.getEstimatedSize().toBytes()); indexNotNeeded = pagesSpatialIndexFactory.lendPagesSpatialIndex(spatialIndex); }
Source:
<code>private static boolean isAbsolute(String url) { <START> String pattern = <END> "^https?://.*"; return url.matches(pattern); }</code><technical_language>This variable is needed, pattern direct</technical_language>

Target:
private static boolean isAbsolute(String url) { return url.matches("^https?://.*"); }
Source:
<code>public void setData( String key, Object value ) { <START> if( RWT.BADGE.equals( key ) && ( style & ( SWT.CHECK | SWT.RADIO ) ) != 0 ) { <END> return; } else if( RWT.MARKUP_ENABLED.equals( key ) && isMarkupEnabledFor( this ) ) { return; } super.setData( key, value ); }</code><technical_language>Push buttons suffice</technical_language>

Target:
public void setData( String key, Object value ) { if( RWT.BADGE.equals( key ) && ( style & SWT.PUSH ) == 0 ) { return; } else if( RWT.MARKUP_ENABLED.equals( key ) && isMarkupEnabledFor( this ) ) { return; } super.setData( key, value ); }
Source:
<code>public String removeServiceTask(ServiceTaskSummary serviceTaskSummary) { <START> repoService.removeServiceTask(serviceTaskSummary.getId(), serviceTaskSummary.getInstalledOn().size() > 0 ? false : true); <END> return serviceTaskSummary.getName(); }</code><technical_language>@mswiderski is logic correct here? disable ST is project? ...</technical_language>

Target:
public String removeServiceTask(ServiceTaskSummary serviceTaskSummary) { repoService.removeServiceTask(serviceTaskSummary.getId()); return serviceTaskSummary.getName(); }
Source:
<code>public void start() throws Exception { subscriptionsCache.start(emptyList()); workTracker.start(ImmutableList.of(this)); <START> supervisor.start(); <END> consumersRegistry.start(); consumersRegistry.register(new BalancingJob( consumersRegistry, subscriptionsCache, new SelectiveWorkBalancer(configFactory.getIntProperty(CONSUMER_WORKLOAD_CONSUMERS_PER_SUBSCRIPTION), configFactory.getIntProperty(CONSUMER_WORKLOAD_MAX_SUBSCRIPTIONS_PER_CONSUMER)), workTracker, metrics, configFactory.getIntProperty(CONSUMER_WORKLOAD_REBALANCE_INTERVAL))); logger.info("Consumer boot complete. Workload config: [{}]", configFactory.print( CONSUMER_WORKLOAD_NODE_ID, CONSUMER_WORKLOAD_ALGORITHM, CONSUMER_WORKLOAD_REBALANCE_INTERVAL, CONSUMER_WORKLOAD_CONSUMERS_PER_SUBSCRIPTION, CONSUMER_WORKLOAD_MAX_SUBSCRIPTIONS_PER_CONSUMER)); }</code><technical_language>consumers module listens for retransmission events, for subscriptions for is assigned in selective algorithm. Retransmission spawns new consumer consumers for retransmitted subscription number of consumers modules is unexpected in selective algorithm</technical_language>

Target:
public void start() throws Exception { adminCache.start(); adminCache.addCallback(this); subscriptionsCache.start(emptyList()); workTracker.start(ImmutableList.of(this)); supervisor.start(); consumersRegistry.start(); consumersRegistry.registerLeaderLatchListener(new BalancingJob( consumersRegistry, subscriptionsCache, new SelectiveWorkBalancer(configFactory.getIntProperty(CONSUMER_WORKLOAD_CONSUMERS_PER_SUBSCRIPTION), configFactory.getIntProperty(CONSUMER_WORKLOAD_MAX_SUBSCRIPTIONS_PER_CONSUMER)), workTracker, metrics, configFactory.getIntProperty(CONSUMER_WORKLOAD_REBALANCE_INTERVAL), configFactory.getStringProperty(KAFKA_CLUSTER_NAME))); logger.info("Consumer boot complete. Workload config: [{}]", configFactory.print( CONSUMER_WORKLOAD_NODE_ID, CONSUMER_WORKLOAD_ALGORITHM, CONSUMER_WORKLOAD_REBALANCE_INTERVAL, CONSUMER_WORKLOAD_CONSUMERS_PER_SUBSCRIPTION, CONSUMER_WORKLOAD_MAX_SUBSCRIPTIONS_PER_CONSUMER)); }
Source:
<code>public void testMappingExclude() throws Exception { String localTable = createTable("sourcefieldexclude"); String load = loadData("sourcefieldexclude"); String ddl = "CREATE EXTERNAL TABLE fieldexclude (" + "id BIGINT, " + "name STRING)" + tableProps(resource("hive-fieldexclude", "data"), "'es.mapping.id'='id'", "'es.mapping.exclude'='id'"); String selectTest = "SELECT s.id, s.name FROM sourcefieldexclude s"; String insert = "INSERT OVERWRITE TABLE fieldexclude " + "SELECT id, name FROM sourcefieldexclude "; System.out.println(ddl); System.out.println(server.execute(ddl)); System.out.println(server.execute(localTable)); System.out.println(server.execute(load)); System.out.println(server.execute(selectTest)); System.out.println(server.execute(insert)); String docEndpoint = resource("hive-fieldexclude", "data"); if (TestUtils.isTypelessVersion(targetVersion)) { docEndpoint = docEndpoint + "/_doc"; <START> } <END> String string = RestUtils.get(docEndpoint + "/1"); assertThat(string, containsString("MALICE")); string = RestUtils.get(docEndpoint + "/7"); assertThat(string, containsString("Manson")); assertFalse(RestUtils.getMappings("hive-fieldexclude").getResolvedView().toString().contains("id=")); }</code><technical_language>Is this right ? hive-fieldexclude/data/_doc ? conditionally hive-fieldexclude/_doc ? (same question too)</technical_language>

Target:
public void testMappingExclude() throws Exception { String localTable = createTable("sourcefieldexclude"); String load = loadData("sourcefieldexclude"); String ddl = "CREATE EXTERNAL TABLE fieldexclude (" + "id BIGINT, " + "name STRING)" + tableProps(resource("hive-fieldexclude", "data", targetVersion), "'es.mapping.id'='id'", "'es.mapping.exclude'='id'"); String selectTest = "SELECT s.id, s.name FROM sourcefieldexclude s"; String insert = "INSERT OVERWRITE TABLE fieldexclude " + "SELECT id, name FROM sourcefieldexclude "; System.out.println(ddl); System.out.println(server.execute(ddl)); System.out.println(server.execute(localTable)); System.out.println(server.execute(load)); System.out.println(server.execute(selectTest)); System.out.println(server.execute(insert)); String docEndpoint = docEndpoint("hive-fieldexclude", "data", targetVersion); String string = RestUtils.get(docEndpoint + "/1"); assertThat(string, containsString("MALICE")); string = RestUtils.get(docEndpoint + "/7"); assertThat(string, containsString("Manson")); assertFalse(RestUtils.getMappings("hive-fieldexclude").getResolvedView().toString().contains("id=")); }
Source:
<code>protected static SimpleFeatureCollection getFeatures(String endPoint, String user, String pass, Map<String, String> query, CoordinateReferenceSystem crs, boolean tryGeoJSON, OskariGMLDecoder gmlDecoder) { String url; ByteArrayOutputStream baos = new ByteArrayOutputStream(); byte[] response; Map<String, String> responseHeaders; SimpleFeatureCollection fc; if (tryGeoJSON) { query.put("OUTPUTFORMAT", "application/json"); url = IOHelper.constructUrl(endPoint, query); responseHeaders = OskariWFSClient.readResponseTo(endPoint, user, pass, query, baos); response = baos.toByteArray(); fc = parseGeoJSON(response, crs, url); if (fc != null) { return fc; } fc = parseGML(response, crs, url, user, pass, gmlDecoder); <START> if (fc != null) { <END> return fc; } } query.remove("OUTPUTFORMAT"); url = IOHelper.constructUrl(endPoint, query); baos.reset(); responseHeaders = OskariWFSClient.readResponseTo(endPoint, user, pass, query, baos); response = baos.toByteArray(); fc = parseGML(response, crs, url, user, pass, gmlDecoder); if (fc != null) { return fc; } throw new ServiceRuntimeException("Failed to get features"); }</code><technical_language>Add: LOG.warn("Requested JSON GML. Possibly misconfigured service for", url); similar</technical_language>

Target:
protected static SimpleFeatureCollection getFeatures(String endPoint, String user, String pass, Map<String, String> query, CoordinateReferenceSystem crs, boolean tryGeoJSON, OskariGMLDecoder gmlDecoder) { String url; ByteArrayOutputStream baos = new ByteArrayOutputStream(); byte[] response; Map<String, String> responseHeaders; SimpleFeatureCollection fc; if (tryGeoJSON) { query.put("OUTPUTFORMAT", "application/json"); url = IOHelper.constructUrl(endPoint, query); responseHeaders = OskariWFSClient.readResponseTo(endPoint, user, pass, query, baos); response = baos.toByteArray(); fc = parseGeoJSON(response, crs, url); if (fc != null) { return fc; } fc = parseGML(response, crs, url, user, pass, gmlDecoder); if (fc != null) { LOG.info("Requested JSON but got GML. Possibly misconfigured service for", url); return fc; } LOG.warn("Requested JSON but didn't get a parseable result. Making a new request for GML. Possibly misconfigured service for", url); } query.remove("OUTPUTFORMAT"); url = IOHelper.constructUrl(endPoint, query); baos.reset(); responseHeaders = OskariWFSClient.readResponseTo(endPoint, user, pass, query, baos); response = baos.toByteArray(); fc = parseGML(response, crs, url, user, pass, gmlDecoder); if (fc != null) { return fc; } throw new ServiceRuntimeException("Failed to get features"); }
Source:
<code>private Module createAndConfigureModuleInstance(ModuleDescriptor moduleDescriptor, ModuleOptions moduleOptions, ModuleDeploymentProperties deploymentProperties) { String name = (String) moduleOptions.asPropertySource().getProperty(MODULE_EXECUTION_FRAMEWORK); <START> if (Processor.MODULE_EXECUTION_FRAMEWORK.equals(name)) { <END> return createSparkModule(moduleDescriptor, moduleOptions, deploymentProperties); } Module module = moduleDescriptor.isComposed() ? createCompositeModule(moduleDescriptor, moduleOptions, deploymentProperties) : createSimpleModule(moduleDescriptor, moduleOptions, deploymentProperties); return module; }</code><technical_language>constants named hard follow</technical_language>

Target:
private Module createAndConfigureModuleInstance(ModuleDescriptor moduleDescriptor, ModuleOptions moduleOptions, ModuleDeploymentProperties deploymentProperties) { Module module = moduleDescriptor.isComposed() ? createCompositeModule(moduleDescriptor, moduleOptions, deploymentProperties) : createSimpleModule(moduleDescriptor, moduleOptions, deploymentProperties); return module; }
Source:
<code>private GroupAwareQueryManagerImpl(final DagGenerator dagGenerator, final ScheduledExecutorServiceWrapper schedulerWrapper, final GroupInfoMap groupInfoMap, @Parameter(NumThreads.class) final int numThreads, final QueryInfoStore planStore, final GroupMetricTracker groupTracker) { this.dagGenerator = dagGenerator; this.scheduler = schedulerWrapper.getScheduler(); this.planStore = planStore; this.groupInfoMap = groupInfoMap; this.numThreads = numThreads; this.groupTracker = groupTracker; <START> groupTracker.start(groupInfoMap); <END> }</code><technical_language>get groupInfoMap constructor of GroupMetricTracker</technical_language>

Target:
private GroupAwareQueryManagerImpl(final DagGenerator dagGenerator, final ScheduledExecutorServiceWrapper schedulerWrapper, final GroupInfoMap groupInfoMap, @Parameter(NumThreads.class) final int numThreads, final QueryInfoStore planStore, final GroupMetricTracker groupTracker) { this.dagGenerator = dagGenerator; this.scheduler = schedulerWrapper.getScheduler(); this.planStore = planStore; this.groupInfoMap = groupInfoMap; this.numThreads = numThreads; this.groupTracker = groupTracker; groupTracker.start(); }
Source:
<code><START> public void publish(Exchange message) { <END> Map<Exchange, String> discardedMessages = null; try { mutex.lock(); if (!this.terminating && !this.terminated) { Collection<Exchange> discarded = this.backpressureStrategy.update(buffer, message); if (discarded.iterator().hasNext()) { discardedMessages = new HashMap<>(); for (Exchange ex : discarded) { discardedMessages.put(ex, "Exchange " + ex + " discarded by backpressure strategy " + this.backpressureStrategy); } } } else { discardedMessages = Collections.singletonMap(message, "Exchange " + message + " discarded: subscription closed"); } } finally { mutex.unlock(); } if (discardedMessages != null) { for (Map.Entry<Exchange, String> discarded : discardedMessages.entrySet()) { Exchange exchange = discarded.getKey(); DispatchCallback<Exchange> callback = ReactiveStreamsHelper.getCallback(exchange); if (callback != null) { callback.processed( exchange, new ReactiveStreamsDiscardedException("Discarded by backpressure strategy", exchange, name)); } } } checkAndFlush(); }</code><technical_language>do initialize new HashMap<Exchange, String>()? - avoid null check l.241 - avoid iterator creation .hasNext()</technical_language>

Target:
public void publish(Exchange message) { Map<Exchange, String> discardedMessages = null; try { mutex.lock(); if (!this.terminating && !this.terminated) { Collection<Exchange> discarded = this.backpressureStrategy.update(buffer, message); if (!discarded.isEmpty()) { discardedMessages = new HashMap<>(); for (Exchange ex : discarded) { discardedMessages.put(ex, "Exchange " + ex + " discarded by backpressure strategy " + this.backpressureStrategy); } } } else { discardedMessages = Collections.singletonMap(message, "Exchange " + message + " discarded: subscription closed"); } } finally { mutex.unlock(); } if (discardedMessages != null) { for (Exchange exchange: discardedMessages.keySet()) { ReactiveStreamsHelper.invokeDispatchCallback( exchange, new ReactiveStreamsDiscardedException("Discarded by backpressure strategy", exchange, name) ); } } checkAndFlush(); }
Source:
<code>public static DigestSource sha256() { return DigestUtils::sha256Hex; <START> } <END></code><technical_language>prefer a standard algorithm for password hashing instead of sha256 actually, like: KeySpec spec = new PBEKeySpec(valueToDigest.toCharArray(), salt, 65536, 256); SecretKeyFactory factory = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA256"); byte[] hash = factory.generateSecret(spec).getEncoded();</technical_language>

Target:
public static DigestSource sha256() { return (data, salt) -> { final byte[] dataDigest = DigestUtils.sha256(data); if (salt == null || salt.length == 0) { return EncodingUtils.BASE64_ENCODER.apply(dataDigest); } else { final byte[] digestedSalt = DigestUtils.sha256(salt); final byte[] result = new byte[digestedSalt.length + dataDigest.length]; System.arraycopy(digestedSalt, 0, result, 0, digestedSalt.length); System.arraycopy(dataDigest, 0, result, digestedSalt.length, dataDigest.length); return EncodingUtils.BASE64_ENCODER.apply(result); } }; }
Source:
<code><START> public void onPreInit(FMLPreInitializationEvent e) { <END> if (ENABLE_PREINIT) { throw new CustomModLoadingErrorDisplayException("Custom Test Exception", new RuntimeException("Thrown in Pre-Init")) { @Override public void initGui(GuiErrorScreen parent, FontRenderer fontRenderer) { } @Override public void drawScreen(GuiErrorScreen parent, FontRenderer fontRenderer, int mouseRelX, int mouseRelY, float tickTime) { parent.drawCenteredString(parent.mc.fontRenderer, "Custom Test Exception", parent.width / 2, 90, 16777215); parent.drawCenteredString(parent.mc.fontRenderer, LOREM_IPSUM, parent.width / 2, 110, 16777215); } }; } }</code><technical_language>braces new lines</technical_language>

Target:
public void onPreInit(FMLPreInitializationEvent e) { if (ENABLE_PREINIT) { throwException("Thrown in Pre-Init"); } }
Source:
<code>private Map<String, List<Mapping>> getMappings(ExecutableElement method) { Map<String, List<Mapping>> mappings = new HashMap<>(); MappingPrism mappingAnnotation = MappingPrism.getInstanceOn( method ); MappingsPrism mappingsAnnotation = MappingsPrism.getInstanceOn( method ); if ( mappingAnnotation != null ) { if ( !mappings.containsKey( mappingAnnotation.target() ) ) { mappings.put( mappingAnnotation.target(), new ArrayList<>() ); } <START> if (mappingAnnotation.source().endsWith( ".*" )) { <END> Type parameterType = typeFactory.getType( method.getParameters().get( 0 ).asType() ); mappings.putAll( getAllMethodsFromClass( new ArrayList<>( Arrays.asList( mappingAnnotation.source().split( "\\." ) ) ), parameterType, "" ) ); } else { Mapping mapping = Mapping.fromMappingPrism( mappingAnnotation, method, messager, typeUtils ); if ( mapping != null ) { mappings.get( mappingAnnotation.target() ).add( mapping ); } } } if ( mappingsAnnotation != null ) { for ( MappingPrism mappingPrism : mappingsAnnotation.value() ) { if (mappingPrism.source().endsWith( ".*" )) { Type parameterType = typeFactory.getType( method.getParameters().get( 0 ).asType() ); mappings.putAll( getAllMethodsFromClass( new ArrayList<>( Arrays.asList( mappingPrism.source().split( "\\." ) ) ), parameterType, "" ) ); } } mappings.putAll( Mapping.fromMappingsPrism( mappingsAnnotation, method, messager, typeUtils ) ); } return mappings; }</code><technical_language>logic of analysing source reference / target reference is in classes SourceReference TargetReference.. a separation of concerns, feeling this is proper place put this kind of analysis</technical_language>

Target:
private Map<String, List<Mapping>> getMappings(ExecutableElement method) { Map<String, List<Mapping>> mappings = new HashMap<>(); MappingPrism mappingAnnotation = MappingPrism.getInstanceOn( method ); MappingsPrism mappingsAnnotation = MappingsPrism.getInstanceOn( method ); if ( mappingAnnotation != null ) { if ( !mappings.containsKey( mappingAnnotation.target() ) ) { mappings.put( mappingAnnotation.target(), new ArrayList<>() ); } if ( mappingAnnotation.target().equals( "." ) && mappingAnnotation.source().isEmpty() ) { return mappings; } Mapping mapping = Mapping.fromMappingPrism( mappingAnnotation, method, messager, typeUtils ); if ( mapping != null ) { mappings.get( mappingAnnotation.target() ).add( mapping ); } } if ( mappingsAnnotation != null ) { mappings.putAll( Mapping.fromMappingsPrism( mappingsAnnotation, method, messager, typeUtils ) ); } return mappings; }
Source:
<code>public void register(final Element element) { if (checkNotRegistered(element)) { final Object definition = ((Definition) element.getContent()).getDefinition(); if (!isDecisionServiceDefinition(definition)) { return; } final Canvas<?> canvas = canvasHandler.getCanvas(); final Shape<?> shape = canvas.getShape(element.getUUID()); final ShapeView<?> shapeView = shape.getShapeView(); if (!isDecisionServiceShapeView(shapeView)) { return; } final DecisionServiceSVGShapeView decisionServiceShapeView = (DecisionServiceSVGShapeView) shapeView; final DragHandler dragHandler = new DragHandler() { @Override <START> public void start(final DragEvent event) { <END> } @Override public void handle(final DragEvent event) { } @Override public void end(final DragEvent event) { final CommandResult<CanvasViolation> result = doMoveDivider(element, decisionServiceShapeView.getDividerLineY()); if (CommandUtils.isError(result)) { LOGGER.log(Level.WARNING, "Command failed at resize end [result=" + result + "]"); } } }; decisionServiceShapeView.addDividerDragHandler(dragHandler); registerHandler(element.getUUID(), dragHandler); } }</code><technical_language>WDYT creating default empty implementations DragHandler interface for methods (using default keyword)? This is need override do here..</technical_language>

Target:
public void register(final Element element) { if (checkNotRegistered(element)) { final Object definition = ((Definition) element.getContent()).getDefinition(); if (!isDecisionServiceDefinition(definition)) { return; } final Canvas<?> canvas = canvasHandler.getCanvas(); final Shape<?> shape = canvas.getShape(element.getUUID()); final ShapeView<?> shapeView = shape.getShapeView(); if (!isDecisionServiceShapeView(shapeView)) { return; } final DecisionServiceSVGShapeView decisionServiceShapeView = (DecisionServiceSVGShapeView) shapeView; final DragHandler dragHandler = new DragHandler() { @Override public void end(final DragEvent event) { final CommandResult<CanvasViolation> result = doMoveDivider(element, decisionServiceShapeView.getDividerLineY()); if (CommandUtils.isError(result)) { LOGGER.log(Level.WARNING, "Command failed at resize end [result=" + result + "]"); } } }; decisionServiceShapeView.addDividerDragHandler(dragHandler); registerHandler(element.getUUID(), dragHandler); } }
Source:
<code>private boolean checkCRC(byte[] data, int len) { byte checksum = PowerMaxCommDriver.computeCRC(data, len); byte expected = data[len - 2]; if (checksum != expected) { logger.debug("CRC check failed (expected {}, got {})", String.format("%02X", expected), <START> String.format("%02X", checksum)); <END> } return (checksum == expected); }</code><technical_language>Is this rare interesting enough WARN level</technical_language>

Target:
private boolean checkCRC(byte[] data, int len) { byte checksum = PowerMaxCommDriver.computeCRC(data, len); byte expected = data[len - 2]; if (checksum != expected) { byte[] logData = Arrays.copyOf(data, len); logger.warn("PowerMax alarm binding: message CRC check failed (expected {}, got {}, message {})", String.format("%02X", expected), String.format("%02X", checksum), DatatypeConverter.printHexBinary(logData)); } return (checksum == expected); }