auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public static PrestoThriftTupleDomain tupleDomainToThriftTupleDomain(TupleDomain<ColumnHandle> tupleDomain) { if (!tupleDomain.getDomains().isPresent()) { return new PrestoThriftTupleDomain(null); } Map<String, PrestoThriftDomain> thriftDomains = tupleDomain.getDomains().get() .entrySet().stream() .collect(toImmutableMap( entry -> ((ThriftColumnHandle) entry.getKey()).getColumnName(), entry -> fromDomain(entry.getValue()))); <START> return new PrestoThriftTupleDomain(thriftDomains); <END> }</code><technical_language>inline thriftDomain... I simpler read code need types</technical_language>

Target:
public static PrestoThriftTupleDomain tupleDomainToThriftTupleDomain(TupleDomain<ColumnHandle> tupleDomain) { if (!tupleDomain.getDomains().isPresent()) { return new PrestoThriftTupleDomain(null); } return new PrestoThriftTupleDomain(tupleDomain.getDomains().get() .entrySet().stream() .collect(toImmutableMap( entry -> ((ThriftColumnHandle) entry.getKey()).getColumnName(), entry -> fromDomain(entry.getValue())))); }
Source:
<code>protected WorkbenchJob doCreateRefreshJob() { WorkbenchJob job = super.doCreateRefreshJob(); job.addJobChangeListener(new JobChangeAdapter() { @Override public void done(IJobChangeEvent event) { CheckboxTreeViewer checkboxTreeViewer = getCheckboxTreeViewer(); if (checkboxTreeViewer.getTree().isDisposed()) { return; } checkboxTreeViewer.expandAll(); <START> checkboxTreeViewer.setCheckedElements(getCheckedElements()); <END> maintainAllCheckIntegrity(); } }); return job; }</code><technical_language>base class actions, in case, necessary base class's JobChangeAdapter do anyways</technical_language>

Target:
protected WorkbenchJob doCreateRefreshJob() { WorkbenchJob job = super.doCreateRefreshJob(); job.addJobChangeListener(new JobChangeAdapter() { @Override public void done(IJobChangeEvent event) { maintainAllCheckIntegrity(); } }); return job; }
Source:
<code>private void checkMeanResTimeLimit(double meanResTimeLimit) { if (meanResTimeLimit < meanResTime / 1000) { double exceededMeanResTime = meanResTime / 1000 - meanResTimeLimit; resultsErrorMessage += "Avg resp time is " + String.format("%.2f", exceededMeanResTime) <START> + "s higher than the threshold."; <END> } }</code><technical_language>threshold</technical_language>

Target:
private void checkMeanResTimeLimit(double meanResTimeLimit) { if (meanResTimeLimit < meanResTime / 1000) { double exceededMeanResTime = meanResTime / 1000 - meanResTimeLimit; resultsErrorMessage += "Avg resp time is " + String.format("%.2f", exceededMeanResTime) + "s higher than the specified threshold."; } }
Source:
<code>MethodHandle findStatic(Class<?> refc, String name, MethodType type) throws NoSuchMethodException, IllegalAccessException { if (refc == MethodHandle.class) { MethodHandle mh = findVirtualForMH(name, type); if (mh != <START> null) <END> return mh; } Method method = refc.getDeclaredMethod(name, type.ptypes()); final int modifiers = method.getModifiers(); if (!Modifier.isStatic(modifiers)) { throw new IllegalAccessException("Method" + method + " is not static"); } checkAccess(refc, method.getDeclaringClass(), modifiers, method.getName()); return new MethodHandleImpl(method.getArtMethod(), MethodHandle.INVOKE_STATIC, type); }</code><technical_language>WS, if upstream ignore. If upstream: // Android-changed</technical_language>

Target:
MethodHandle findStatic(Class<?> refc, String name, MethodType type) throws NoSuchMethodException, IllegalAccessException { if (refc == MethodHandle.class) { MethodHandle mh = findVirtualForMH(name, type); if (mh != null) { return mh; } } Method method = refc.getDeclaredMethod(name, type.ptypes()); final int modifiers = method.getModifiers(); if (!Modifier.isStatic(modifiers)) { throw new IllegalAccessException("Method" + method + " is not static"); } checkAccess(refc, method.getDeclaringClass(), modifiers, method.getName()); return new MethodHandleImpl(method.getArtMethod(), MethodHandle.INVOKE_STATIC, type); }
Source:
<code>private synchronized void setQueryOutputInfo(QueryExecution.QueryOutputInfo outputInfo) { if (columns == null) { List<String> columnNames = outputInfo.getColumnNames(); List<Type> columnTypes = outputInfo.getColumnTypes(); checkArgument(columnNames.size() == columnTypes.size(), "Column names and types size mismatch"); ImmutableList.Builder<Column> list = ImmutableList.builder(); for (int i = 0; i < columnNames.size(); i++) { list.add(new Column(columnNames.get(i), columnTypes.get(i))); } columns = list.build(); types = outputInfo.getColumnTypes(); } for (URI outputLocation : outputInfo.getBufferLocations()) { <START> exchangeClient.addLocation(outputLocation, TaskId.valueOf("taskid")); <END> } if (outputInfo.isNoMoreBufferLocations()) { exchangeClient.noMoreLocations(); } }</code><technical_language>this magic constant a static final give a proper name, a bit confusing a hardcoded task id here</technical_language>

Target:
private synchronized void setQueryOutputInfo(QueryExecution.QueryOutputInfo outputInfo) { if (columns == null) { List<String> columnNames = outputInfo.getColumnNames(); List<Type> columnTypes = outputInfo.getColumnTypes(); checkArgument(columnNames.size() == columnTypes.size(), "Column names and types size mismatch"); ImmutableList.Builder<Column> list = ImmutableList.builder(); for (int i = 0; i < columnNames.size(); i++) { list.add(new Column(columnNames.get(i), columnTypes.get(i))); } columns = list.build(); types = outputInfo.getColumnTypes(); } outputInfo.getBufferLocations().forEach(exchangeClient::addLocation); if (outputInfo.isNoMoreBufferLocations()) { exchangeClient.noMoreLocations(); } }
Source:
<code>public static File createTempFile(@Nonnull String prefix, @Nonnull String suffix) throws CannotCreateFileException, CannotChangePermissionException { String tmpdir = System.getProperty("java.io.tmpdir"); assert tmpdir != null; Directory baseDir; try { baseDir = new Directory( tmpdir, null, Existence.MUST_EXIST, Permission.READ | Permission.WRITE, ChangePermission.NOCHANGE); return createTempFile(prefix, suffix, baseDir); } catch (NotDirectoryException | WrongPermissionException | NoSuchFileException | FileAlreadyExistsException e) { <START> throw new AssertionError(e.getMessage(), e); <END> } }</code><technical_language>Setting a wrong java.io.tmpdir a InternalCompilerError? weird</technical_language>

Target:
public static File createTempFile(@Nonnull String prefix, @Nonnull String suffix) throws CannotCreateFileException, CannotChangePermissionException, NotDirectoryException, WrongPermissionException, NoSuchFileException { String tmpdir = System.getProperty("java.io.tmpdir"); assert tmpdir != null; Directory baseDir; try { baseDir = new Directory( tmpdir, null, Existence.MUST_EXIST, Permission.READ | Permission.WRITE, ChangePermission.NOCHANGE); return createTempFile(prefix, suffix, baseDir); } catch (FileAlreadyExistsException e) { throw new AssertionError(e.getMessage(), e); } }
Source:
<code>public void testProcessQueryGraphqlApiEmptyResults() throws NoHttpResponseException, URISyntaxException, MalformedURLException { TableExport queryObj = new TableExport(); String query = "/group?sort=commonName&fields%5Bgroup%5D=commonName,description"; String id = "edc4a871-dff2-4054-804e-d80075cf827d"; queryObj.setId(id); queryObj.setQuery(query); queryObj.setQueryType(QueryType.GRAPHQL_V1_0); queryObj.setResultType(ResultType.CSV); when(exporter.export(any())).thenReturn(Observable.empty()); when(engine.storeResults(any(), any())).thenReturn(queryObj); TableExportThread queryThread = new TableExportThread(queryObj, engine, exporter); TableExportResult queryResultObj = (TableExportResult) queryThread.call(); <START> assertEquals(queryResultObj.getHttpStatus(), 200); <END> assertEquals(queryResultObj.getRecordCount(), 0); }</code><technical_language>test body for JSON-API CSV</technical_language>

Target:
public void testProcessQueryGraphqlApiEmptyResults() throws NoHttpResponseException, URISyntaxException, MalformedURLException { TableExport queryObj = new TableExport(); String query = "/tableExport"; String id = "edc4a871-dff2-4054-804e-d80075cf827d"; queryObj.setId(id); queryObj.setQuery(query); queryObj.setQueryType(QueryType.GRAPHQL_V1_0); queryObj.setResultType(ResultType.CSV); when(exporter.export(any())).thenReturn(Observable.empty()); when(engine.storeResults(any(), any())).thenReturn(queryObj); TableExportThread queryThread = new TableExportThread(queryObj, engine, exporter); TableExportResult queryResultObj = (TableExportResult) queryThread.call(); assertEquals(queryResultObj.getHttpStatus(), 200); assertEquals(queryResultObj.getRecordCount(), 0); }
Source:
<code>private void updateStoragePoolFormatType() { final StoragePool storagePool = getStoragePool(); final Guid spId = storagePool.getId(); final Version spVersion = storagePool.getcompatibility_version(); final Version oldSpVersion = _oldStoragePool.getcompatibility_version(); if (oldSpVersion.equals(spVersion)) { return; } StorageFormatType targetFormat = updatePoolAndDomainsFormat(spVersion); if (_oldStoragePool.getStatus() == StoragePoolStatus.Up) { try { runVdsCommand(VDSCommandType.UpgradeStoragePool, new UpgradeStoragePoolVDSCommandParameters(spId, targetFormat)); } catch (VdcBLLException e) { log.warnFormat("Upgrade process of Storage Pool '{}' has encountered a problem due to following reason: {}", <START> spId, e.getMessage()); <END> AuditLogDirector.log(this, AuditLogType.UPGRADE_STORAGE_POOL_ENCOUNTERED_PROBLEMS); if (e.getVdsError() != null && e.getErrorCode() == VdcBllErrors.PoolUpgradeInProgress) { updatePoolAndDomainsFormat(oldSpVersion); return; } } } runSynchronizeOperation(new RefreshPoolSingleAsyncOperationFactory(), new ArrayList<Guid>()); }</code><technical_language>Logging in 3.5 integer notation</technical_language>

Target:
private void updateStoragePoolFormatType() { final StoragePool storagePool = getStoragePool(); final Guid spId = storagePool.getId(); final Version spVersion = storagePool.getcompatibility_version(); final Version oldSpVersion = _oldStoragePool.getcompatibility_version(); if (oldSpVersion.equals(spVersion)) { return; } StorageFormatType targetFormat = updatePoolAndDomainsFormat(spVersion); if (_oldStoragePool.getStatus() == StoragePoolStatus.Up) { try { runVdsCommand(VDSCommandType.UpgradeStoragePool, new UpgradeStoragePoolVDSCommandParameters(spId, targetFormat)); } catch (VdcBLLException e) { log.warnFormat("Upgrade process of Storage Pool '{0}' has encountered a problem due to following reason: {1}", spId, e.getMessage()); AuditLogDirector.log(this, AuditLogType.UPGRADE_STORAGE_POOL_ENCOUNTERED_PROBLEMS); if (e.getVdsError() != null && e.getErrorCode() == VdcBllErrors.PoolUpgradeInProgress) { updatePoolAndDomainsFormat(oldSpVersion); return; } } } runSynchronizeOperation(new RefreshPoolSingleAsyncOperationFactory(), new ArrayList<Guid>()); }
Source:
<code>public Object visit(ASTClassOrInterfaceDeclaration node, Object data) { if (node.isInterface()) { return data; } Map<MethodNameDeclaration, List<NameOccurrence>> methods = node.getScope().getEnclosingScope(ClassScope.class) .getMethodDeclarations(); List<ASTMethodDeclarator> getSetMethList = new ArrayList<>(methods.size()); for (MethodNameDeclaration d : methods.keySet()) { ASTMethodDeclarator mnd = d.getMethodNameDeclaratorNode(); if (isBeanAccessor(mnd)) { getSetMethList.add(mnd); } } String[] methNameArray = imagesOf(getSetMethList); Arrays.sort(methNameArray); Map<VariableNameDeclaration, List<NameOccurrence>> vars = node.getScope() .getDeclarations(VariableNameDeclaration.class); <START> for (Map.Entry<VariableNameDeclaration, List<NameOccurrence>> entry : vars.entrySet()) { <END> AccessNode accessNodeParent = entry.getKey().getAccessNodeParent(); if (entry.getValue().isEmpty() || accessNodeParent.isTransient() || accessNodeParent.isStatic()) { continue; } String varName = trimIfPrefix(entry.getKey().getImage()); varName = varName.substring(0, 1).toUpperCase() + varName.substring(1, varName.length()); boolean hasGetMethod = Arrays.binarySearch(methNameArray, "get" + varName) >= 0 || Arrays.binarySearch(methNameArray, "is" + varName) >= 0; boolean hasSetMethod = Arrays.binarySearch(methNameArray, "set" + varName) >= 0; if (!hasGetMethod || !accessNodeParent.isFinal() && !hasSetMethod) { addViolation(data, entry.getKey().getNode(), entry.getKey().getImage()); } } return super.visit(node, data); }</code><technical_language>add a VariableNameDeclaration decl = entry.getKey(); for readability</technical_language>

Target:
public Object visit(ASTClassOrInterfaceDeclaration node, Object data) { if (node.isInterface()) { return data; } Map<MethodNameDeclaration, List<NameOccurrence>> methods = node.getScope().getEnclosingScope(ClassScope.class) .getMethodDeclarations(); List<ASTMethodDeclarator> getSetMethList = new ArrayList<>(methods.size()); for (MethodNameDeclaration d : methods.keySet()) { ASTMethodDeclarator mnd = d.getMethodNameDeclaratorNode(); if (isBeanAccessor(mnd)) { getSetMethList.add(mnd); } } String[] methNameArray = imagesOf(getSetMethList); Arrays.sort(methNameArray); Map<VariableNameDeclaration, List<NameOccurrence>> vars = node.getScope() .getDeclarations(VariableNameDeclaration.class); for (Map.Entry<VariableNameDeclaration, List<NameOccurrence>> entry : vars.entrySet()) { VariableNameDeclaration decl = entry.getKey(); AccessNode accessNodeParent = decl.getAccessNodeParent(); if (entry.getValue().isEmpty() || accessNodeParent.isTransient() || accessNodeParent.isStatic()) { continue; } String varName = trimIfPrefix(decl.getImage()); varName = varName.substring(0, 1).toUpperCase() + varName.substring(1, varName.length()); boolean hasGetMethod = Arrays.binarySearch(methNameArray, "get" + varName) >= 0 || Arrays.binarySearch(methNameArray, "is" + varName) >= 0; boolean hasSetMethod = Arrays.binarySearch(methNameArray, "set" + varName) >= 0; if (!hasGetMethod || !accessNodeParent.isFinal() && !hasSetMethod) { addViolation(data, decl.getNode(), decl.getImage()); } } return super.visit(node, data); }
Source:
<code><START> private static String GETRequest(String urlString) throws IOException { <END> URL url = new URL(urlString); HttpURLConnection urlConnection = (HttpURLConnection)url.openConnection(); urlConnection.setRequestMethod("GET"); return IOUtils.toString(urlConnection.getInputStream()); }</code><technical_language>feel more comfortable if a guaranteed timeout this method, in case is hanging. Do plausible</technical_language>

Target:
private static String GETRequest(String urlString) throws IOException { URL url = new URL(urlString); HttpURLConnection urlConnection = (HttpURLConnection)url.openConnection(); urlConnection.setConnectTimeout(10000); urlConnection.setReadTimeout(10000); urlConnection.setRequestMethod("GET"); return IOUtils.toString(urlConnection.getInputStream()); }
Source:
<code>public SetMultimap<String,ASMData> getAnnotationsFor(ModContainer container) { if (containerAnnotationData == null) { ImmutableMap.Builder<ModContainer, SetMultimap<String, ASMData>> mapBuilder = ImmutableMap.builder(); <START> containers.parallelStream().forEach(cont -> <END> { Multimap<String, ASMData> values = Multimaps.filterValues(globalAnnotationData, new ModContainerPredicate(cont)); ImmutableSetMultimap<String, ASMData> immutableValues = ImmutableSetMultimap.copyOf(values); synchronized (mapBuilder) { mapBuilder.put(cont, immutableValues); } }); containerAnnotationData = mapBuilder.build(); } return containerAnnotationData.get(container); }</code><technical_language>If a stream here, do it. like: suggestion containers.parallelStream() .map(cont -> Pair.of(cont, ImmutableSetMultimap.copyOf(Multimaps.filterValues(globalAnnotationData, new ModContainerPredicate(cont))))) .collect(ImmutableMap.toImmutableMap(pair -> pair.getKey(), pair -> pair.getValue()))</technical_language>

Target:
public SetMultimap<String,ASMData> getAnnotationsFor(ModContainer container) { if (containerAnnotationData == null) { containerAnnotationData = containers.parallelStream() .map(cont -> Pair.of(cont, ImmutableSetMultimap.copyOf(Multimaps.filterValues(globalAnnotationData, new ModContainerPredicate(cont))))) .collect(ImmutableMap.toImmutableMap(Pair::getKey, Pair::getValue)); } return containerAnnotationData.get(container); }
Source:
<code>public VDS get(Guid vdsId) { VDS vdsPartial = new VDS(); vdsPartial.setStaticData(DbFacade.getInstance().getVdsStaticDao().get(vdsId)); vdsPartial.setDynamicData(DbFacade.getInstance().getVdsDynamicDao().get(vdsId)); <START> VDSGroup group = DbFacade.getInstance().getVdsGroupDao().get(vdsPartial.getVdsGroupId()); <END> vdsPartial.setVdsGroupCompatibilityVersion(group.getcompatibility_version()); vdsPartial.setVdsGroupCpuName(group.getcpu_name()); vdsPartial.setVdsGroupDescription(group.getdescription()); vdsPartial.setVdsGroupName(group.getName()); vdsPartial.setStoragePoolId(group.getStoragePoolId()); vdsPartial.setStoragePoolName(group.getStoragePoolName()); vdsPartial.setMaxVdsMemoryOverCommit(group.getmax_vds_memory_over_commit()); return vdsPartial; }</code><technical_language>I thought assemble host in stored proc</technical_language>

Target:
public VDS get(Guid vdsId) { VDS vdsPartial = new VDS(); vdsPartial.setStaticData(DbFacade.getInstance().getVdsStaticDao().get(vdsId)); if (vdsPartial.getStaticData() == null) { return null; } vdsPartial.setDynamicData(DbFacade.getInstance().getVdsDynamicDao().get(vdsId)); VDSGroup group = DbFacade.getInstance().getVdsGroupDao().get(vdsPartial.getVdsGroupId()); vdsPartial.setVdsGroupCompatibilityVersion(group.getcompatibility_version()); vdsPartial.setVdsGroupCpuName(group.getcpu_name()); vdsPartial.setVdsGroupDescription(group.getdescription()); vdsPartial.setVdsGroupName(group.getName()); vdsPartial.setStoragePoolId(group.getStoragePoolId()); vdsPartial.setStoragePoolName(group.getStoragePoolName()); vdsPartial.setMaxVdsMemoryOverCommit(group.getmax_vds_memory_over_commit()); return vdsPartial; }
Source:
<code>protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); binding = ActvityContactUsBinding.inflate(getLayoutInflater()); setContentView(binding.getRoot()); presenter = new ContactUsPresenter(this); ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { actionBar.setElevation(0); actionBar.setDisplayHomeAsUpEnabled(true); } binding.contactEmailButton.setOnClickListener(v -> { Intent sendMailIntent = new Intent(Intent.ACTION_SENDTO); <START> String mailTo = getString(R.string.MIME_type_mail).concat(binding.contactEmailText.getText().toString()); <END> sendMailIntent.setData(Uri.parse(mailTo)); try { startActivity(sendMailIntent); } catch (android.content.ActivityNotFoundException ex) { ToastUtil.showShortToast(this, ToastUtil.ToastType.ERROR, getString(R.string.no_mailing_client_found)); } }); binding.talksButton.setOnClickListener(v -> { Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(getString(R.string.contact_forum_url))); startActivity(intent); }); binding.ircButton.setOnClickListener(v -> { Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(getString(R.string.contact_irc_url))); startActivity(intent); }); }</code><technical_language>Place in ApplicationConstants instead</technical_language>

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); binding = ActvityContactUsBinding.inflate(getLayoutInflater()); setContentView(binding.getRoot()); presenter = new ContactUsPresenter(this); ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { actionBar.setElevation(0); actionBar.setDisplayHomeAsUpEnabled(true); } binding.contactEmailButton.setOnClickListener(v -> { Intent sendMailIntent = new Intent(Intent.ACTION_SENDTO); String mailTo = ApplicationConstants.MIME_TYPE_MAILTO.concat(binding.contactEmailText.getText().toString()); sendMailIntent.setData(Uri.parse(mailTo)); try { startActivity(sendMailIntent); } catch (android.content.ActivityNotFoundException ex) { ToastUtil.showShortToast(this, ToastUtil.ToastType.ERROR, getString(R.string.no_mailing_client_found)); } }); binding.talksButton.setOnClickListener(v -> { Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(getString(R.string.contact_forum_url))); startActivity(intent); }); binding.ircButton.setOnClickListener(v -> { Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(getString(R.string.contact_irc_url))); startActivity(intent); }); }
Source:
<code>public boolean extractQuestionDetails(Map<String, String[]> requestParameters, FeedbackQuestionType questionType) { super.extractQuestionDetails(requestParameters, questionType); List<String> options = new ArrayList<>(); String numOptionsCreatedString = HttpRequestHelper.getValueFromParamMap( requestParameters, Const.ParamsNames.FEEDBACK_QUESTION_NUMBEROFCHOICECREATED); Assumption.assertNotNull("Null number of choice for Rank", numOptionsCreatedString); int numOptionsCreated = Integer.parseInt(numOptionsCreatedString); for (int i = 0; i < numOptionsCreated; i++) { String rankOption = HttpRequestHelper.getValueFromParamMap( requestParameters, Const.ParamsNames.FEEDBACK_QUESTION_RANKOPTION + "-" + i); if (rankOption != null && !rankOption.trim().isEmpty()) { options.add(rankOption); } } this.initialiseQuestionDetails(options); String minOptionsToBeRankedParameter = Strings.nullToEmpty(HttpRequestHelper.getValueFromParamMap( requestParameters, Const.ParamsNames.FEEDBACK_QUESTION_RANK_MIN_OPTIONS_TO_BE_RANKED)); String maxOptionsToBeRankedParameter = Strings.nullToEmpty(HttpRequestHelper.getValueFromParamMap( requestParameters, Const.ParamsNames.FEEDBACK_QUESTION_RANK_MAX_OPTIONS_TO_BE_RANKED)); <START> Integer parsedMinOptionsToBeRanked = Ints.tryParse(minOptionsToBeRankedParameter); <END> Integer parsedMaxOptionsToBeRanked = Ints.tryParse(maxOptionsToBeRankedParameter); minOptionsToBeRanked = MoreObjects.firstNonNull(parsedMinOptionsToBeRanked, NO_VALUE); maxOptionsToBeRanked = MoreObjects.firstNonNull(parsedMaxOptionsToBeRanked, NO_VALUE); return true; }</code><technical_language>Is a separate variable useful actually? If is, a name parsed* appears worse (the information try is lost)</technical_language>

Target:
public boolean extractQuestionDetails(Map<String, String[]> requestParameters, FeedbackQuestionType questionType) { super.extractQuestionDetails(requestParameters, questionType); List<String> options = new ArrayList<>(); String numOptionsCreatedString = HttpRequestHelper.getValueFromParamMap( requestParameters, Const.ParamsNames.FEEDBACK_QUESTION_NUMBEROFCHOICECREATED); Assumption.assertNotNull("Null number of choice for Rank", numOptionsCreatedString); int numOptionsCreated = Integer.parseInt(numOptionsCreatedString); for (int i = 0; i < numOptionsCreated; i++) { String rankOption = HttpRequestHelper.getValueFromParamMap( requestParameters, Const.ParamsNames.FEEDBACK_QUESTION_RANKOPTION + "-" + i); if (rankOption != null && !rankOption.trim().isEmpty()) { options.add(rankOption); } } this.initialiseQuestionDetails(options); String minOptionsToBeRankedParameter = Strings.nullToEmpty(HttpRequestHelper.getValueFromParamMap( requestParameters, Const.ParamsNames.FEEDBACK_QUESTION_RANK_MIN_OPTIONS_TO_BE_RANKED)); String maxOptionsToBeRankedParameter = Strings.nullToEmpty(HttpRequestHelper.getValueFromParamMap( requestParameters, Const.ParamsNames.FEEDBACK_QUESTION_RANK_MAX_OPTIONS_TO_BE_RANKED)); minOptionsToBeRanked = MoreObjects.firstNonNull(Ints.tryParse(minOptionsToBeRankedParameter), NO_VALUE); maxOptionsToBeRanked = MoreObjects.firstNonNull(Ints.tryParse(maxOptionsToBeRankedParameter), NO_VALUE); return true; }
Source:
<code>public boolean getOnlyCreateReportWithDifferentName() { <START> return this.onlyCreateReportWithDifferentName; <END> }</code><technical_language>This need a null check done default is returned if field set (i.e. is null). getEscapeUnderscores for example default return :)</technical_language>

Target:
public boolean getOnlyCreateReportWithDifferentName() { if (this.onlyCreateReportWithDifferentName == null) { return false; } else { return this.onlyCreateReportWithDifferentName; } }
Source:
<code>private void loadAuthorizedScriptsSignatures(File folder) { authorizedSelectionScripts = new HashSet<>(); for (File file : folder.listFiles()) { if (file.isFile()) { try { String script = SelectionScript.readFile(file); logger.debug("Adding authorized selection script " + file.getAbsolutePath()); authorizedSelectionScripts.add(Script.digest(script.trim())); } catch (Exception e) { <START> logger.error(e.getMessage(), e); <END> } } } }</code><technical_language>throw exception here</technical_language>

Target:
private void loadAuthorizedScriptsSignatures(File folder) { authorizedSelectionScripts = new HashSet<>(); for (File file : folder.listFiles()) { if (file.isFile()) { try { String script = SelectionScript.readFile(file); logger.debug("Adding authorized selection script " + file.getAbsolutePath()); authorizedSelectionScripts.add(Script.digest(script.trim())); } catch (Exception e) { logger.error(e.getMessage(), e); throw new SecurityException("Error while reading authorized script file", e); } } } }
Source:
<code>private Map<String, T> sync() throws KeeperException { log.debug("syncing: {}", path); final Map<String, T> newSnapshot = Maps.newHashMap(); List<String> children = null; Stat childrenStat = new Stat(); try { List<String> possibleChildren; while (children == null) { <START> possibleChildren = curator.getChildren().storingStatIn(childrenStat) <END> .usingWatcher(childrenWatcher) .forPath(path); if (clusterId == null) { children = possibleChildren; continue; } try { curator.inTransaction() .check().forPath(String.format("/config/id/%s", clusterId)).and() .check().withVersion(childrenStat.getVersion()).forPath(path).and() .commit(); } catch (KeeperException.BadVersionException e) { continue; } children = possibleChildren; } log.debug("children: {}", children); for (final String child : children) { final String node = ZKPaths.makePath(path, child); final byte[] bytes = curator.getData() .usingWatcher(dataWatcher) .forPath(node); final String json = new String(bytes, UTF_8); log.debug("child: {}={}", node, json); final T value; try { value = Json.read(bytes, valueType); } catch (IOException e) { log.warn("failed to parse node: {}: {}", node, json, e); continue; } newSnapshot.put(node, value); } } catch (KeeperException e) { throw e; } catch (Exception e) { throw Throwables.propagate(e); } return newSnapshot; }</code><technical_language>Indentation is 4, 2</technical_language>

Target:
private Map<String, T> sync() throws KeeperException { log.debug("syncing: {}", path); final Map<String, T> newSnapshot = Maps.newHashMap(); try { final List<String> children = getChildren(); log.debug("children: {}", children); for (final String child : children) { final String node = ZKPaths.makePath(path, child); final byte[] bytes = curator.getData() .usingWatcher(dataWatcher) .forPath(node); final String json = new String(bytes, UTF_8); log.debug("child: {}={}", node, json); final T value; try { value = Json.read(bytes, valueType); } catch (IOException e) { log.warn("failed to parse node: {}: {}", node, json, e); continue; } newSnapshot.put(node, value); } } catch (KeeperException e) { throw e; } catch (Exception e) { throw Throwables.propagate(e); } return newSnapshot; }
Source:
<code>public void testSendSerialData802Timeout() throws Exception { PowerMockito.doReturn(XBeeProtocol.RAW_802_15_4).when(xbeeDevice, "getXBeeProtocol"); PowerMockito.doThrow(new XBeeException(XBeeException.CONNECTION_TIMEOUT)).when(xbeeDevice, "sendXBeePacket", tx16Packet); PowerMockito.doThrow(new XBeeException(XBeeException.CONNECTION_TIMEOUT)).when(xbeeDevice, "sendXBeePacket", tx64Packet); try { xbeeDevice.sendSerialData(XBEE_64BIT_ADDRESS, SEND_DATA_BYTES); fail("Tx64 frame shouldn't have been sent successfully."); } catch (InvalidOperatingModeException e) { fail("This exception shouldn't be thrown now."); } catch (XBeeException e) { assertEquals(XBeeException.CONNECTION_TIMEOUT, e.getErrorCode()); } try { <START> xbeeDevice.sendSerialData(XBEE_16BIT_ADDRESS, SEND_DATA_BYTES); <END> fail("TransmitRequest frame shouldn't have been sent successfully."); } catch (InvalidOperatingModeException e) { fail("This exception shouldn't be thrown now."); } catch (XBeeException e) { assertEquals(XBeeException.CONNECTION_TIMEOUT, e.getErrorCode()); } try { xbeeDevice.sendSerialData(mockedDevice, SEND_DATA_BYTES); fail("TransmitRequest frame shouldn't have been sent successfully."); } catch (InvalidOperatingModeException e) { fail("This exception shouldn't be thrown now."); } catch (XBeeException e) { assertEquals(XBeeException.CONNECTION_TIMEOUT, e.getErrorCode()); } }</code><technical_language>I XBEE_64BIT_ADDRESS</technical_language>

Target:
public void testSendSerialData802Timeout() throws Exception { PowerMockito.doReturn(XBeeProtocol.RAW_802_15_4).when(xbeeDevice, "getXBeeProtocol"); PowerMockito.doThrow(new XBeeException(XBeeException.CONNECTION_TIMEOUT)).when(xbeeDevice, "sendXBeePacket", tx16Packet); PowerMockito.doThrow(new XBeeException(XBeeException.CONNECTION_TIMEOUT)).when(xbeeDevice, "sendXBeePacket", tx64Packet); try { xbeeDevice.sendSerialData(XBEE_16BIT_ADDRESS, SEND_DATA_BYTES); fail("Tx16 frame shouldn't have been sent successfully."); } catch (InvalidOperatingModeException e) { fail("This exception shouldn't be thrown now."); } catch (XBeeException e) { assertEquals(XBeeException.CONNECTION_TIMEOUT, e.getErrorCode()); } try { xbeeDevice.sendSerialData(XBEE_64BIT_ADDRESS, SEND_DATA_BYTES); fail("Tx64 frame shouldn't have been sent successfully."); } catch (InvalidOperatingModeException e) { fail("This exception shouldn't be thrown now."); } catch (XBeeException e) { assertEquals(XBeeException.CONNECTION_TIMEOUT, e.getErrorCode()); } try { xbeeDevice.sendSerialData(mockedDevice, SEND_DATA_BYTES); fail("TransmitRequest frame shouldn't have been sent successfully."); } catch (InvalidOperatingModeException e) { fail("This exception shouldn't be thrown now."); } catch (XBeeException e) { assertEquals(XBeeException.CONNECTION_TIMEOUT, e.getErrorCode()); } }
Source:
<code>public void afterPropertiesSet() throws Exception { <START> Assert.notNull(this.delegate, "A delegate item reader is required"); <END> }</code><technical_language>message be: diff - "A delegate item reader is required" + "A delegate item writer is required"</technical_language>

Target:
public void afterPropertiesSet() throws Exception { Assert.notNull(this.delegate, "A delegate item writer is required"); }
Source:
<code><START> public void returnFalseForIsConnectedToWifiWhenNetworkConnectedToWifiIsNotConnected() { <END> when(mockConnectivityManager.getNetworkInfo(WIFI.getValue())).thenReturn(mockNetworkInfo); when(mockNetworkInfo.isConnected()).thenReturn(false); assertThat(merlinsBeard.isConnectedTo(WIFI)).isFalse(); }</code><technical_language>good a test getActiveNetworkInfo() returns true for wifi false, show activeNetworkInfo is used</technical_language>

Target:
public void returnFalseForIsConnectedToWifiWhenNetworkConnectedToWifiIsNotConnected() { when(mockConnectivityManager.getNetworkInfo(ConnectivityManager.TYPE_WIFI)).thenReturn(mockNetworkInfo); when(mockNetworkInfo.isConnected()).thenReturn(false); assertThat(merlinsBeard.isConnectedToWifi()).isFalse(); }
Source:
<code>public void onCreate( Bundle savedInstanceState ) { super.onCreate( savedInstanceState ); setContentView( R.layout.main ); <START> if( Defaults.APPLICATION_ID.equals( "" ) || Defaults.API_KEY.equals( "" ) || Defaults.VERSION.equals( "" ) ) <END> { showAlert( this, "Missing application ID and api key arguments. Login to Backendless Console, select your app and get the ID and key from the Manage > App Settings screen. Copy/paste the values into the Backendless.initApp call" ); return; } Backendless.initApp( this, Defaults.APPLICATION_ID, Defaults.API_KEY ); final EditText emailField = (EditText) findViewById( R.id.emailField ); final EditText passwordField = (EditText) findViewById( R.id.passwordField ); findViewById( R.id.loginButton ).setOnClickListener( new View.OnClickListener() { @Override public void onClick( View view ) { Backendless.UserService.login( emailField.getText().toString(), passwordField.getText().toString(), new DefaultCallback<BackendlessUser>( MainActivity.this ) { public void handleResponse( BackendlessUser backendlessUser ) { super.handleResponse( backendlessUser ); startActivity( new Intent( getBaseContext(), LoggedInActivity.class ) ); } } ); } } ); findViewById( R.id.registerButton ).setOnClickListener( new View.OnClickListener() { @Override public void onClick( View view ) { startActivity( new Intent( getBaseContext(), RegisterActivity.class ) ); } } ); }</code><technical_language>get rid of VERSION</technical_language>

Target:
public void onCreate( Bundle savedInstanceState ) { super.onCreate( savedInstanceState ); setContentView( R.layout.main ); if( Defaults.APPLICATION_ID.equals( "" ) || Defaults.API_KEY.equals( "" ) ) { showAlert( this, "Missing application ID and api key arguments. Login to Backendless Console, select your app and get the ID and key from the Manage > App Settings screen. Copy/paste the values into the Backendless.initApp call" ); return; } Backendless.initApp( this, Defaults.APPLICATION_ID, Defaults.API_KEY ); final EditText emailField = (EditText) findViewById( R.id.emailField ); final EditText passwordField = (EditText) findViewById( R.id.passwordField ); findViewById( R.id.loginButton ).setOnClickListener( new View.OnClickListener() { @Override public void onClick( View view ) { Backendless.UserService.login( emailField.getText().toString(), passwordField.getText().toString(), new DefaultCallback<BackendlessUser>( MainActivity.this ) { public void handleResponse( BackendlessUser backendlessUser ) { super.handleResponse( backendlessUser ); startActivity( new Intent( getBaseContext(), LoggedInActivity.class ) ); } } ); } } ); findViewById( R.id.registerButton ).setOnClickListener( new View.OnClickListener() { @Override public void onClick( View view ) { startActivity( new Intent( getBaseContext(), RegisterActivity.class ) ); } } ); }
Source:
<code>public List<StreamsDatum> process(StreamsDatum entry) { try { if (!(entry.getDocument() instanceof Activity)) { return Lists.newArrayList(); } if (Strings.isNullOrEmpty(pattern)) { prepare(null); } Activity activity = (Activity) entry.getDocument(); Map<String, List<Integer>> matches = RegexUtils.extractMatches(pattern, activity.getContent()); Collection<T> entities = ensureTargetObject(activity); for (String key : matches.keySet()) { entities.add(prepareObject(key)); } return Lists.newArrayList(entry); <START> } catch (Throwable e) { <END> LOGGER.error("Throwable process {}", e); e.printStackTrace(); throw new RuntimeException(e); } }</code><technical_language>is purpose for try/catch/wrap? new checked exceptions wrapping</technical_language>

Target:
public List<StreamsDatum> process(StreamsDatum entry) { if (!(entry.getDocument() instanceof Activity)) { return Lists.newArrayList(); } if (Strings.isNullOrEmpty(pattern)) { prepare(null); } Activity activity = (Activity) entry.getDocument(); Map<String, List<Integer>> matches = RegexUtils.extractMatches(pattern, activity.getContent()); Collection<T> entities = ensureTargetObject(activity); for (String key : matches.keySet()) { entities.add(prepareObject(key)); } return Lists.newArrayList(entry); }
Source:
<code>public static void main(String[] args) throws Exception { Logging.initialize(); File baseDirFile = null; if (args.length > 0) { if (args.length != 1) { <START> log.error("Only one String argument (baseDir) is allowed. It must be a URI the user has write permission."); <END> return; } baseDirFile = new File(args[0]); } DistributedQueryRunner queryRunner = createQueryRunner(TpchTable.getTables(), ImmutableMap.of("http-server.http.port", "8080"), Optional.ofNullable(baseDirFile)); Thread.sleep(10); Logger log = Logger.get(DistributedQueryRunner.class); log.info("======== SERVER STARTED ========"); log.info("\n====\n%s\n====", queryRunner.getCoordinator().getBaseUrl()); }</code><technical_language>java System.err("usage: HiveQueryRunner [baseDir]\n"); System.exit(1);</technical_language>

Target:
public static void main(String[] args) throws Exception { Logging.initialize(); Optional<Path> baseDataDir = Optional.empty(); if (args.length > 0) { if (args.length != 1) { log.error("usage: HiveQueryRunner [baseDataDir]\n"); log.error(" [baseDataDir] is a local directory under which you want the hive_data directory to be created.]\n"); System.exit(1); } File baseDataDirFile = new File(args[0]); if (baseDataDirFile.exists()) { if (!baseDataDirFile.isDirectory()) { log.error("Error: " + baseDataDirFile.getAbsolutePath() + " is not a directory."); System.exit(1); } else if (!baseDataDirFile.canRead() || !baseDataDirFile.canWrite()) { log.error("Error: " + baseDataDirFile.getAbsolutePath() + " is not readable/writable."); System.exit(1); } } else { while (!baseDataDirFile.exists()) { baseDataDirFile = baseDataDirFile.getParentFile(); } if (!baseDataDirFile.canRead() || !baseDataDirFile.canWrite()) { log.error("Error: The ancestor directory " + baseDataDirFile.getAbsolutePath() + " is not readable/writable."); System.exit(1); } } baseDataDir = Optional.of(baseDataDirFile.toPath()); } DistributedQueryRunner queryRunner = createQueryRunner(TpchTable.getTables(), ImmutableMap.of("http-server.http.port", "8080"), baseDataDir); Thread.sleep(10); Logger log = Logger.get(DistributedQueryRunner.class); log.info("======== SERVER STARTED ========"); log.info("\n====\n%s\n====", queryRunner.getCoordinator().getBaseUrl()); }
Source:
<code>public void testNonZeroReplicationFactor() throws Exception { <START> Map<Integer, Integer> sphMap = Maps.newHashMap(); <END> sphMap.put(0, 1); sphMap.put(1, 1); sphMap.put(2, 1); ClusterConfig config = new ClusterConfig(3, sphMap, 2); Map<Integer, String> topology = Maps.newHashMap(); topology.put(0, "0"); topology.put(1, "0"); topology.put(2, "0"); JSONObject obj = config.getTopology(topology); config.validate(); System.out.println(obj.toString(4)); JSONArray partitions = obj.getJSONArray("partitions"); assertEquals(1, partitions.length()); for (int ii = 0; ii < partitions.length(); ii++) { JSONObject partition = partitions.getJSONObject(ii); assertEquals(0, partition.getInt("partition_id")); JSONArray replicas = partition.getJSONArray("replicas"); assertEquals(3, replicas.length()); HashSet<Integer> replicasContents = new HashSet<Integer>(); for (int zz = 0; zz < replicas.length(); zz++) { replicasContents.add(replicas.getInt(zz)); } assertTrue(replicasContents.contains(0)); assertTrue(replicasContents.contains(1)); assertTrue(replicasContents.contains(2)); } }</code><technical_language>If create a static method input parameter: hostCount, SPH refactor of this copy map constructing line</technical_language>

Target:
public void testNonZeroReplicationFactor() throws Exception { final int hostCount = 3; final int Kfactor = 2; final int sitesperhost = 1; ClusterConfig config = new ClusterConfig(hostCount, generateSameSphMap(hostCount, sitesperhost), Kfactor); Map<Integer, String> topology = Maps.newHashMap(); topology.put(0, "0"); topology.put(1, "0"); topology.put(2, "0"); JSONObject obj = config.getTopology(topology); config.validate(); System.out.println(obj.toString(4)); JSONArray partitions = obj.getJSONArray("partitions"); assertEquals(1, partitions.length()); for (int ii = 0; ii < partitions.length(); ii++) { JSONObject partition = partitions.getJSONObject(ii); assertEquals(0, partition.getInt("partition_id")); JSONArray replicas = partition.getJSONArray("replicas"); assertEquals(3, replicas.length()); HashSet<Integer> replicasContents = new HashSet<Integer>(); for (int zz = 0; zz < replicas.length(); zz++) { replicasContents.add(replicas.getInt(zz)); } assertTrue(replicasContents.contains(0)); assertTrue(replicasContents.contains(1)); assertTrue(replicasContents.contains(2)); } }
Source:
<code>public void unlockSingleReturnsTrueIfTokenCanBeUnlocked() throws InterruptedException { <START> when(mockClient.unlock(any())).thenReturn(ImmutableSet.of(LOCK_TOKEN)); <END> assertTrue(client.unlockSingle(LOCK_TOKEN)); }</code><technical_language>nit: I prefer when(mockClient.unlock(any())).then(tokens -> tokens.getArguments()[0]); feel free push for readability. (Also for refresh)</technical_language>

Target:
public void unlockSingleReturnsTrueIfTokenCanBeUnlocked() throws InterruptedException { when(mockClient.unlock(any())).then(REPLY_WITH_FIRST_TOKEN); assertTrue(client.unlockSingle(LOCK_TOKEN)); }
Source:
<code><START> private TaskInfo createTask(SqlTaskManager sqlTaskManager, TaskId taskId, ImmutableSet<ScheduledSplit> splits, OutputBuffers outputBuffers) <END> { return sqlTaskManager.updateTask(TEST_SESSION, taskId, Optional.of(PLAN_FRAGMENT), ImmutableList.of(new TaskSource(TABLE_SCAN_NODE_ID, splits, true)), outputBuffers.withNoMoreBufferIds(), OptionalInt.empty()); }</code><technical_language>Place this bottom of file other creation utility methods createSqlTaskManager</technical_language>

Target:
private TaskInfo createTask(SqlTaskManager sqlTaskManager, TaskId taskId, ImmutableSet<ScheduledSplit> splits, OutputBuffers outputBuffers) { return sqlTaskManager.updateTask(TEST_SESSION, taskId, Optional.of(PLAN_FRAGMENT), ImmutableList.of(new TaskSource(TABLE_SCAN_NODE_ID, splits, true)), outputBuffers, OptionalInt.empty()); }
Source:
<code>public void createFeedbackQuestion(FeedbackQuestionAttributes fqa) throws InvalidParametersException { String feedbackSessionName = fqa.feedbackSessionName; String courseId = fqa.courseId; List<FeedbackQuestionAttributes> questions = getFeedbackQuestionsForSession(feedbackSessionName, courseId); <START> if (questions.isEmpty()) { <END> Assumption.fail("Session disappeared."); } if (fqa.questionNumber < 0) { fqa.questionNumber = questions.size() + 1; } adjustQuestionNumbers(questions.size() + 1, fqa.questionNumber, questions); createFeedbackQuestionNoIntegrityCheck(fqa, fqa.questionNumber); }</code><technical_language>Empty question list session exist. fsLogic.getFeedbackSession check if session exist. Update: I this is test fail</technical_language>

Target:
public void createFeedbackQuestion(FeedbackQuestionAttributes fqa) throws InvalidParametersException { String feedbackSessionName = fqa.feedbackSessionName; String courseId = fqa.courseId; if (fsLogic.getFeedbackSession(feedbackSessionName, courseId) == null) { Assumption.fail("Session disappeared."); } List<FeedbackQuestionAttributes> questions = getFeedbackQuestionsForSession(feedbackSessionName, courseId); if (fqa.questionNumber < 0) { fqa.questionNumber = questions.size() + 1; } adjustQuestionNumbers(questions.size() + 1, fqa.questionNumber, questions); createFeedbackQuestionNoIntegrityCheck(fqa, fqa.questionNumber); }
Source:
<code>public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; HostCriteria other = (HostCriteria) obj; if (m_bare != other.m_bare) return false; if (m_configHash == null) { if (other.m_configHash != null) return false; } else if (!m_configHash.equals(other.m_configHash)) return false; if (m_enterprise != other.m_enterprise) return false; if (m_addAllowed != other.m_addAllowed) return false; if (m_safeMode != other.m_safeMode) return false; if (m_hostCount != other.m_hostCount) return false; if (m_meshHash == null) { if (other.m_meshHash != null) return false; } else if (!m_meshHash.equals(other.m_meshHash)) return false; if (m_terminusNonce == null) { if (other.m_terminusNonce != null) return false; } else if (!m_terminusNonce.equals(other.m_terminusNonce)) return false; if (m_paused != other.m_paused) return false; if (m_startAction != other.m_startAction) return false; if (m_nodeState != other.m_nodeState) return false; <START> if ((m_startupCatalogHash == null) ^ (other.m_startupCatalogHash == null)){ <END> return false; } if ((m_startupCatalogHash != null) && !m_startupCatalogHash.equals(other.m_startupCatalogHash)){ return false; } return true; }</code><technical_language>compare m_meshHash</technical_language>

Target:
public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; HostCriteria other = (HostCriteria) obj; if (m_bare != other.m_bare) return false; if (m_configHash == null) { if (other.m_configHash != null) return false; } else if (!m_configHash.equals(other.m_configHash)) return false; if (m_enterprise != other.m_enterprise) return false; if (m_addAllowed != other.m_addAllowed) return false; if (m_safeMode != other.m_safeMode) return false; if (m_hostCount != other.m_hostCount) return false; if (m_meshHash == null) { if (other.m_meshHash != null) return false; } else if (!m_meshHash.equals(other.m_meshHash)) return false; if (m_terminusNonce == null) { if (other.m_terminusNonce != null) return false; } else if (!m_terminusNonce.equals(other.m_terminusNonce)) return false; if (m_paused != other.m_paused) return false; if (m_startAction != other.m_startAction) return false; if (m_nodeState != other.m_nodeState) return false; return true; }
Source:
<code><START> public CompletableFuture<Long> append(ByteBuf data) { <END> data.retain(); SyncAddCallback callback = new SyncAddCallback(); PendingAddOp op = new PendingAddOp(LedgerHandle.this, callback, null); doAsyncAddEntry(op, data, callback, null); return callback; }</code><technical_language>call #asyncAddEntry(data, callback, ctx)? logic retain bytebuf construct pending add op is handled #asyncAddEntry. need duplicate this logic</technical_language>

Target:
public CompletableFuture<Long> append(ByteBuf data) { SyncAddCallback callback = new SyncAddCallback(); asyncAddEntry(data, callback, null); return callback; }
Source:
<code>public void dispose() { logger.debug("Handler disposes. Unregistering listener."); if (lightId != null) { HueBridgeHandler bridgeHandler = getHueBridgeHandler(); if (bridgeHandler != null) { this.bridgeHandler.unregisterLightStatusListener(this); <START> this.bridgeHandler = null; <END> } lightId = null; } }</code><technical_language>consistent I remove "this." in front of bridgeHandler (it is missed in if clause already)</technical_language>

Target:
public void dispose() { logger.debug("Handler disposes. Unregistering listener."); if (lightId != null) { HueBridgeHandler bridgeHandler = getHueBridgeHandler(); if (bridgeHandler != null) { bridgeHandler.unregisterLightStatusListener(this); this.bridgeHandler = null; } lightId = null; } }
Source:
<code>public static SELinux map(VDS entity, SELinux template) { SELinux model = template != null ? template : new SELinux(); if (entity.getSELinuxEnforceMode() == null) { return model; } <START> model.setMode(entity.getSELinuxEnforceMode().toString().toLowerCase()); <END> return model; }</code><technical_language>copy backend enum, map other: String mode; switch (entity.getSELinuxEnforceMode()) { case ENFORCING: mode = SELinuxMode.ENFORCING.value(); break; case PERMISSIVE: mode = SELinuxMode.PERMISSIVE.value(); break; case DISABLED: mode = SELinuxMode.DISABLED.value(); break; default: mode = null; } model.setMode(mode);</technical_language>

Target:
public static SELinux map(VDS entity, SELinux template) { SELinux model = template != null ? template : new SELinux(); if (entity.getSELinuxEnforceMode() == null) { return model; } String mode = null; switch (entity.getSELinuxEnforceMode()) { case DISABLED: mode = SELinuxMode.DISABLED.value(); break; case PERMISSIVE: mode = SELinuxMode.PERMISSIVE.value(); break; case ENFORCING: mode = SELinuxMode.ENFORCING.value(); } model.setMode(mode); return model; }
Source:
<code>private void checkCanModify() { <START> if (isConstant) { MekanismAPI.logger.warn("TRIED TO MODIFY A CONSTANT FLOATING LONG"); <END> } }</code><technical_language>Remove this reversion</technical_language>

Target:
private void checkCanModify() { if (isConstant) { throw new IllegalStateException("Tried to modify a floating constant long"); } }