auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private LookupUserIdResponse(String serverResponse) { ObjectServerError error; String userId; Boolean isAdmin; String message; try { JSONObject obj = new JSONObject(serverResponse); JSONObject jsonUser = obj.getJSONObject(JSON_FIELD_USER); if (jsonUser != null) { <START> userId = jsonUser.has(JSON_FIELD_USER_ID) ? jsonUser.getString(JSON_FIELD_USER_ID) : null; <END> isAdmin = jsonUser.has(JSON_FIELD_USER_IS_ADMIN) ? jsonUser.getBoolean(JSON_FIELD_USER_IS_ADMIN) : null; error = null; message = String.format(Locale.US, "Identity %s; Path %b", userId, isAdmin); } else { userId = null; isAdmin = null; error = null; message = "user = null"; } } catch (JSONException e) { userId = null; isAdmin = null; error = new ObjectServerError(ErrorCode.JSON_EXCEPTION, e); message = String.format(Locale.US, "Error %s", error.getErrorMessage()); } RealmLog.debug("LookupUserIdResponse. " + message); setError(error); this.userId = userId; this.isAdmin = isAdmin; }</code><technical_language>jsonUser.optString(JSON_FIELD_USER_ID, null); is a lot shorter optBoolean</technical_language>

Target:
private LookupUserIdResponse(String serverResponse) { ObjectServerError error; String userId; Boolean isAdmin; String message; try { JSONObject obj = new JSONObject(serverResponse); JSONObject jsonUser = obj.getJSONObject(JSON_FIELD_USER); if (jsonUser != null) { userId = jsonUser.optString(JSON_FIELD_USER_ID, null); isAdmin = jsonUser.has(JSON_FIELD_USER_IS_ADMIN) ? jsonUser.getBoolean(JSON_FIELD_USER_IS_ADMIN) : null; error = null; message = String.format(Locale.US, "Identity %s; Path %b", userId, isAdmin); } else { userId = null; isAdmin = null; error = null; message = "user = null"; } } catch (JSONException e) { userId = null; isAdmin = null; error = new ObjectServerError(ErrorCode.JSON_EXCEPTION, e); message = String.format(Locale.US, "Error %s", error.getErrorMessage()); } RealmLog.debug("LookupUserIdResponse. " + message); setError(error); this.userId = userId; this.isAdmin = isAdmin; }
Source:
<code>public void checkForTransientDependency() { CyclicGraphDetector<Plugin> cycleDetector = new CyclicGraphDetector<UpdateSite.Plugin>() { @Override protected List<UpdateSite.Plugin> getEdges(UpdateSite.Plugin p) { List<UpdateSite.Plugin> next = new ArrayList<>(); addTo(p.getNeededDependencies(), next); <START> return next; <END> } private void addTo(List<UpdateSite.Plugin> dependencies, List<UpdateSite.Plugin> r) { for (UpdateSite.Plugin d : dependencies) { r.add(d); } } @Override protected void reactOnCycle(UpdateSite.Plugin q, List<UpdateSite.Plugin> cycle) throws CycleDetectedException { List<String> cycleWithNames = new ArrayList<String>(); for (UpdateSite.Plugin plugin : cycle){ cycleWithNames.add(plugin.name); } throw new CycleDetectedException(cycleWithNames); } }; List<UpdateSite.Plugin> pluginsTest = new ArrayList<UpdateSite.Plugin>(); pluginsTest.add(this); try { cycleDetector.run(pluginsTest); } catch (CyclicGraphDetector.CycleDetectedException ex) { throw new Failure(ex.getMessage()); } }</code><technical_language>nit: this replaced return new ArrayList<>(p.getNeededDependencies())? allow addTo method deleted</technical_language>

Target:
public void checkForTransientDependency() { CyclicGraphDetector<Plugin> cycleDetector = new CyclicGraphDetector<UpdateSite.Plugin>() { @Override protected List<UpdateSite.Plugin> getEdges(UpdateSite.Plugin p) { return new ArrayList<>(p.getNeededDependencies()); } @Override protected void reactOnCycle(UpdateSite.Plugin q, List<UpdateSite.Plugin> cycle) throws CycleDetectedException { List<String> cycleWithNames = new ArrayList<String>(); for (UpdateSite.Plugin plugin : cycle){ cycleWithNames.add(plugin.name); } throw new CycleDetectedException(cycleWithNames); } }; try { cycleDetector.run(Collections.singleton(this)); } catch (CyclicGraphDetector.CycleDetectedException ex) { throw new Failure(ex.getMessage()); } }
Source:
<code>public Response checkConnectivity( @Auth final AuthenticatedUser authenticatedUser, final String gameId) { if (!connectivityCheck.gameExists(authenticatedUser.getApiKey(), gameId)) { <START> return Response.status(400).build(); <END> } return Response.ok() .entity(connectivityCheck.canDoReverseConnect(authenticatedUser.getApiKey(), gameId)) .build(); }</code><technical_language>404 potentially issues: - 'resource' generally means URL resource (right?) - able distinguish actual 404 404 due bad data. For example, a common mistake is register a controller ServerApplication. In cases get a 404 path created is listening. right generic 400 more syntax error @RoiEXLab . 422 - unprocessable entity fit bill</technical_language>

Target:
public Response checkConnectivity( @Auth final AuthenticatedUser authenticatedUser, final String gameId) { final ConnectivityCheck.ReverseConnectionResult result = connectivityCheck.canDoReverseConnect(authenticatedUser.getApiKey(), gameId); switch (result) { case SUCCESS: return Response.ok().entity(true).build(); case FAILED: return Response.ok().entity(false).build(); case GAME_ID_NOT_FOUND: return Response.status(HttpStatus.UNPROCESSABLE_ENTITY_422).build(); default: throw new IllegalStateException("Switch case not handled: " + result); } }
Source:
<code>protected void fillToolBar(ToolBarManager toolBar) { Action hideAttributesAction = new Action() { @Override public void run() { EditorUtil.openHideAttributesWizard(getTaskEditorPage()); } }; <START> hideAttributesAction.setToolTipText("Configure Hidden Attributes..."); END> hideAttributesAction.setImageDescriptor(CommonImages.EDIT_SMALL); toolBar.add(hideAttributesAction); }</code><technical_language>Configure Attribute Visibility..</technical_language>

Target:
protected void fillToolBar(ToolBarManager toolBar) { Action hideAttributesAction = new Action() { @Override public void run() { EditorUtil.openHideAttributesWizard(getTaskEditorPage()); } }; hideAttributesAction.setToolTipText("Configure Attribute Visibility..."); hideAttributesAction.setImageDescriptor(CommonImages.EDIT_SMALL); toolBar.add(hideAttributesAction); }
Source:
<code>private ComponentURI(CodeSystemURI codeSystemURI, short terminologyComponentId, String identifier) { checkNotNull(codeSystemURI, "Codesystem argument should not be null."); checkArgument(terminologyComponentId >= TerminologyRegistry.UNSPECIFIED_NUMBER_SHORT, "Terminology component id should be either unspecified (-1) or greater than zero. Got: '%s'.", terminologyComponentId); <START> boolean isUnspecified = codeSystemURI.getCodeSystem().equals(TerminologyRegistry.UNSPECIFIED) <END> || TerminologyRegistry.UNSPECIFIED_NUMBER_SHORT == terminologyComponentId; checkArgument(isUnspecified || !Strings.isNullOrEmpty(identifier), "Identifier should not be null or empty."); this.codeSystemUri = codeSystemURI; this.terminologyComponentId = terminologyComponentId; this.identifier = identifier; }</code><technical_language>Swap left right of equals check</technical_language>

Target:
private ComponentURI(CodeSystemURI codeSystemURI, short terminologyComponentId, String identifier) { checkNotNull(codeSystemURI, "CodeSystemURI argument should not be null."); checkArgument(terminologyComponentId >= TerminologyRegistry.UNSPECIFIED_NUMBER_SHORT, "TerminologyComponentId should be either unspecified (-1) or greater than zero. Got: '%s'.", terminologyComponentId); checkArgument(TerminologyRegistry.UNSPECIFIED.equals(codeSystemURI.getCodeSystem()) || !Strings.isNullOrEmpty(identifier), "Identifier should not be null or empty."); this.codeSystemUri = codeSystemURI; this.terminologyComponentId = terminologyComponentId; this.identifier = Strings.nullToEmpty(identifier); }
Source:
<code>public Observable<String> searchCategories(String filter, int itemLimit) { return CategoryInterface.searchCategories(filter, itemLimit) .flatMap(mwQueryResponse -> { List<MwQueryPage> pages = mwQueryResponse.query().pages(); if(pages != null) return Observable.fromIterable(pages); else Timber.d("No categories returned."); return Observable.empty(); }) .map(MwQueryPage::title) <START> .doOnEach(s->Timber.d("Category returned: %s", s)) <END> .map(cat->cat.replace("Category:", "")); }</code><technical_language>This logline removed merging PR. :)</technical_language>

Target:
public Observable<String> searchCategories(String filter, int itemLimit) { return searchCategories(filter, itemLimit, 0); }
Source:
<code>public void doTag() throws JspException { try { if (StringUtils.isBlank(var) || (type == null)) { throw new JspTagException("Var and Type must be set " + appName); } final PageContext pageContext = (PageContext) getJspContext(); <START> final Class typeClass = SliceTagUtils.getClassFromType(pageContext, type); <END> final Object model = SliceTagUtils.getFromCurrentPath(pageContext, typeClass, appName); pageContext.setAttribute(var, model, PageContext.PAGE_SCOPE); } catch (ClassNotFoundException e) { throw new JspTagException("Could not get class for " + type); } finally { clean(); } }</code><technical_language>ModelProvider capability create a model type provided String. refactor code this ModelProvider#get(String className, Resource resource)</technical_language>

Target:
public void doTag() throws JspException { try { if (StringUtils.isBlank(var) || (type == null && StringUtils.isEmpty(name))) { throw new JspTagException("Var and Type must be set " + appName); } final PageContext pageContext = (PageContext) getJspContext(); final Object model = StringUtils.isEmpty(name) ? SliceTagUtils.getFromCurrentPath(pageContext, type, appName) : SliceTagUtils.getFromCurrentPath(pageContext, name, appName); pageContext.setAttribute(var, model, PageContext.PAGE_SCOPE); } catch (ClassNotFoundException cause) { throw new JspTagException("Could not get class for " + name + cause.getMessage()); } finally { clean(); } }
Source:
<code>public static void main(String[] args) throws Exception { Opts opts = new Opts(); List<String> argsList = new ArrayList<>(args.length + 2); argsList.add("--old"); argsList.add("--new"); argsList.addAll(Arrays.asList(args)); opts.parseArgs(ChangeSecret.class.getName(), argsList.toArray(new String[0])); VolumeManager fs = VolumeManagerImpl.get(); Instance inst = opts.getInstance(); if (!verifyAccumuloIsDown(inst, opts.oldPass)) System.exit(-1); if (!verifyHdfsWritePermission(fs)) <START> System.exit(-1); <END> final String newInstanceId = UUID.randomUUID().toString(); updateHdfs(fs, inst, newInstanceId); rewriteZooKeeperInstance(inst, newInstanceId, opts.oldPass, opts.newPass); if (opts.oldPass != null) { deleteInstance(inst, opts.oldPass); } System.out.println("New instance id is " + newInstanceId); System.out.println("Be sure to put your new secret in accumulo-site.xml"); }</code><technical_language>print a message first. (and this is a minor nit), negative exit codes used. cross-platform. Also, special exit codes defined in sysexits.h avoided, stick values [1,63]. stick 1 for this (and other places in this class, currently -1)</technical_language>

Target:
public static void main(String[] args) throws Exception { VolumeManager fs = VolumeManagerImpl.get(); verifyHdfsWritePermission(fs); Opts opts = new Opts(); List<String> argsList = new ArrayList<>(args.length + 2); argsList.add("--old"); argsList.add("--new"); argsList.addAll(Arrays.asList(args)); opts.parseArgs(ChangeSecret.class.getName(), argsList.toArray(new String[0])); Instance inst = opts.getInstance(); verifyAccumuloIsDown(inst, opts.oldPass); final String newInstanceId = UUID.randomUUID().toString(); updateHdfs(fs, inst, newInstanceId); rewriteZooKeeperInstance(inst, newInstanceId, opts.oldPass, opts.newPass); if (opts.oldPass != null) { deleteInstance(inst, opts.oldPass); } System.out.println("New instance id is " + newInstanceId); System.out.println("Be sure to put your new secret in accumulo-site.xml"); }
Source:
<code>protected String getDomain(User user) { if (user.isSetDomain() && user.getDomain().isSetName()) { return user.getDomain().getName(); } else if (user.isSetDomain() && user.getDomain().isSetId()) { List<String> domains = getBackendCollection( String.class, VdcQueryType.GetDomainList, new VdcQueryParametersBase()); for (String domain :domains) { NGuid domainId = new NGuid(domain.getBytes(), true); if (domainId.toString().equals(user.getDomain().getId())) { return domain; } } <START> throw new WebFaultException(null, "Storage-Domain: '" + user.getDomain().getId().toString() + "' does not exist.", Response.Status.BAD_REQUEST); <END> } else if (user.isSetUserName() && user.getUserName().contains("@")) { return user.getUserName().substring(user.getUserName().indexOf("@")+1); } return getCurrentDomain(); }</code><technical_language>this is storage-domain, directory service domain</technical_language>

Target:
protected String getDomain(User user) { if (user.isSetDomain() && user.getDomain().isSetName()) { return user.getDomain().getName(); } else if (user.isSetDomain() && user.getDomain().isSetId()) { List<String> domains = getBackendCollection( String.class, VdcQueryType.GetDomainList, new VdcQueryParametersBase()); for (String domain :domains) { NGuid domainId = new NGuid(domain.getBytes(), true); if (domainId.toString().equals(user.getDomain().getId())) { return domain; } } throw new WebFaultException(null, "Domain: '" + user.getDomain().getId().toString() + "' does not exist.", Response.Status.BAD_REQUEST); } else if (user.isSetUserName() && user.getUserName().contains("@")) { return user.getUserName().substring(user.getUserName().indexOf("@")+1); } return getCurrentDomain(); }
Source:
<code>public void start() { CacheMode mode = configuration.clustering().cacheMode(); isFetchEnabled = (mode.isDistributed() || mode.isReplicated()) && (configuration.clustering().stateTransfer().fetchInMemoryState() || configuration.persistence().fetchPersistentState()); <START> rpcOptions = rpcManager.getRpcOptionsBuilder(ResponseMode.SYNCHRONOUS_IGNORE_LEAVERS) <END> .timeout(timeout, TimeUnit.MILLISECONDS).build(); stateRequestExecutor = new LimitedExecutor("StateRequest-" + cacheName, stateTransferExecutor, 1); }</code><technical_language>rename field syncIgnoreLeavers other potential aware</technical_language>

Target:
public void start() { CacheMode mode = configuration.clustering().cacheMode(); isFetchEnabled = (mode.isDistributed() || mode.isReplicated()) && (configuration.clustering().stateTransfer().fetchInMemoryState() || configuration.persistence().fetchPersistentState()); synchronousRpcOptions = rpcManager.getRpcOptionsBuilder(ResponseMode.SYNCHRONOUS) .timeout(timeout, TimeUnit.MILLISECONDS).build(); synchronousIgnoreLeaversRpcOptions = rpcManager.getRpcOptionsBuilder(ResponseMode.SYNCHRONOUS_IGNORE_LEAVERS) .timeout(timeout, TimeUnit.MILLISECONDS).build(); stateRequestExecutor = new LimitedExecutor("StateRequest-" + cacheName, stateTransferExecutor, 1); }
Source:
<code>public Map<String, Statistic<?, ?>> queryStatistics() { <START> Map<String, Statistic<?, ?>> stats = new TreeMap<String, Statistic<?, ?>>(); <END> for (String fullStatName : statistics.keySet()) { stats.put(fullStatName, queryStatistic(fullStatName)); } return stats; }</code><technical_language>a TreeMap</technical_language>

Target:
public Map<String, Statistic<?, ?>> queryStatistics() { Map<String, Statistic<?, ?>> stats = new HashMap<String, Statistic<?, ?>>(); for (String fullStatName : statistics.keySet()) { Statistic<?, ?> statistic = queryStatistic(fullStatName); if (statistic != null) { stats.put(fullStatName, statistic); } } return stats; }
Source:
<code>public void execute() throws MojoExecutionException, MojoFailureException { if (!skip) { boolean ansiRestore = Ansi.isEnabled(); log = new AnsiLogger(getLog(), <START> useColor && MessageUtils.isColorEnabled() <END> && !(EnvUtil.isWindows() && !EnvUtil.isMaven350OrLater(session)), verbose, !settings.getInteractiveMode(), getLogPrefix()); try { authConfigFactory.setLog(log); imageConfigResolver.setLog(log); LogOutputSpecFactory logSpecFactory = new LogOutputSpecFactory(useColor, logStdout, logDate); ConfigHelper.validateExternalPropertyActivation(project, images); DockerAccess access = null; try { this.minimalApiVersion = initImageConfiguration(getBuildTimestamp()); if (isDockerAccessRequired()) { DockerAccessFactory.DockerAccessContext dockerAccessContext = getDockerAccessContext(); access = dockerAccessFactory.createDockerAccess(dockerAccessContext); } ServiceHub serviceHub = serviceHubFactory.createServiceHub(project, session, access, log, logSpecFactory); executeInternal(serviceHub); } catch (IOException | ExecException exp) { logException(exp); throw new MojoExecutionException(log.errorMessage(exp.getMessage()), exp); } catch (MojoExecutionException exp) { logException(exp); throw exp; } finally { if (access != null) { access.shutdown(); } } } finally { Ansi.setEnabled(ansiRestore); } } }</code><technical_language>please move this extra method, 'useColorForLogging()' ...</technical_language>

Target:
public void execute() throws MojoExecutionException, MojoFailureException { if (!skip) { boolean ansiRestore = Ansi.isEnabled(); log = new AnsiLogger(getLog(), useColorForLogging(), verbose, !settings.getInteractiveMode(), getLogPrefix()); try { authConfigFactory.setLog(log); imageConfigResolver.setLog(log); LogOutputSpecFactory logSpecFactory = new LogOutputSpecFactory(useColor, logStdout, logDate); ConfigHelper.validateExternalPropertyActivation(project, images); DockerAccess access = null; try { this.minimalApiVersion = initImageConfiguration(getBuildTimestamp()); if (isDockerAccessRequired()) { DockerAccessFactory.DockerAccessContext dockerAccessContext = getDockerAccessContext(); access = dockerAccessFactory.createDockerAccess(dockerAccessContext); } ServiceHub serviceHub = serviceHubFactory.createServiceHub(project, session, access, log, logSpecFactory); executeInternal(serviceHub); } catch (IOException | ExecException exp) { logException(exp); throw new MojoExecutionException(log.errorMessage(exp.getMessage()), exp); } catch (MojoExecutionException exp) { logException(exp); throw exp; } finally { if (access != null) { access.shutdown(); } } } finally { Ansi.setEnabled(ansiRestore); } } }
Source:
<code>public static EhcacheEntityMessage decode(byte[] payload) { ByteBuffer msg = ByteBuffer.wrap(payload); msg.get(); int cacheIdLen = msg.getInt(); byte[] idArr = new byte[cacheIdLen]; msg.get(idArr); String cacheId = new String(idArr, UTF_8); long key = msg.getLong(); byte opCode = msg.get(); byte[] remaining = new byte[msg.remaining()]; msg.get(remaining); switch (opCode) { case 0: return EhcacheEntityMessage.getOperation(cacheId, key); case 1: return EhcacheEntityMessage.getAndAppendOperation(cacheId, key, ByteBuffer.wrap(remaining).asReadOnlyBuffer()); case 2: return EhcacheEntityMessage.appendOperation(cacheId, key, ByteBuffer.wrap(remaining).asReadOnlyBuffer()); case 3: ByteBuffer replaceBuf = ByteBuffer.wrap(remaining); int expectChainLen = replaceBuf.getInt(); byte[] encodedExpectChain = new byte[expectChainLen]; replaceBuf.get(encodedExpectChain); int updateChainLen = replaceBuf.getInt(); byte[] encodedUpdateChain = new byte[updateChainLen]; replaceBuf.get(encodedUpdateChain); return EhcacheEntityMessage.replaceAtHeadOperation(cacheId, key, ChainCodec.decode(encodedExpectChain), ChainCodec.decode(encodedUpdateChain)); default: <START> throw new UnsupportedOperationException("This operation code is not supported" + opCode); <END> } }</code><technical_language>Please pay attention message's formatting: miss a space ideally a space-colon-space (' : ') concatenating opcode</technical_language>

Target:
public static EhcacheEntityMessage decode(byte[] payload) { ByteBuffer msg = ByteBuffer.wrap(payload); msg.get(); int cacheIdLen = msg.getInt(); byte[] idArr = new byte[cacheIdLen]; msg.get(idArr); String cacheId = new String(idArr, UTF_8); long key = msg.getLong(); byte opCode = msg.get(); ServerStoreOpMessage.ServerStoreOp storeOp = ServerStoreOpMessage.ServerStoreOp.getServerStoreOp(opCode); byte[] remaining = new byte[msg.remaining()]; msg.get(remaining); switch (storeOp) { case GET: return EhcacheEntityMessage.getOperation(cacheId, key); case GET_AND_APPEND: return EhcacheEntityMessage.getAndAppendOperation(cacheId, key, ByteBuffer.wrap(remaining).asReadOnlyBuffer()); case APPEND: return EhcacheEntityMessage.appendOperation(cacheId, key, ByteBuffer.wrap(remaining).asReadOnlyBuffer()); case REPLACE: ByteBuffer replaceBuf = ByteBuffer.wrap(remaining); int expectChainLen = replaceBuf.getInt(); byte[] encodedExpectChain = new byte[expectChainLen]; replaceBuf.get(encodedExpectChain); int updateChainLen = replaceBuf.getInt(); byte[] encodedUpdateChain = new byte[updateChainLen]; replaceBuf.get(encodedUpdateChain); return EhcacheEntityMessage.replaceAtHeadOperation(cacheId, key, ChainCodec.decode(encodedExpectChain), ChainCodec.decode(encodedUpdateChain)); default: throw new UnsupportedOperationException("This operation code is not supported : " + opCode); } }
Source:
<code>public void takeSnapshot(final String snapshotName) throws Exception { <START> new RetryableCallable<Void>() { <END> public Void retriableCall() throws Exception { JMXNodeTool nodetool = JMXNodeTool.instance(configuration); nodetool.takeSnapshot(snapshotName, null); return null; } }.call(); }</code><technical_language>Do want this 15 retries? multiple threads calling this method this is called 2 places already</technical_language>

Target:
public synchronized void takeSnapshot(final String snapshotName) throws Exception { try { new RetryableCallable<Void>(6, 10000) { public Void retriableCall() throws Exception { JMXNodeTool nodetool = JMXNodeTool.instance(configuration); nodetool.takeSnapshot(snapshotName, null); return null; } }.call(); }catch (Exception e){ logger.error("Error while taking snapshot {}. Asking Cassandra to clear snapshot to avoid accumulation of snapshots.", snapshotName); clearSnapshot(snapshotName); throw e; } }
Source:
<code>private boolean isAffectedBy(IResourceDelta delta) { boolean[] result = new boolean[] { false }; try { <START> delta.accept(d -> { <END> if (result[0]) { return false; } if (d.getKind() != IResourceDelta.CHANGED) { result[0] = true; return false; } int flags = d.getFlags(); if (flags != 0 && flags != IResourceDelta.MARKERS) { result[0] = true; return false; } return true; }); } catch (CoreException e) { } return result[0]; }</code><technical_language>IResourceDeltaVisitor anonymous implementation instance created for method invocation. I suggest extract separate type cover unit test explicitly, integration test is sufficient</technical_language>

Target:
private boolean isAffectedBy(IResourceDelta delta) { if (delta.getKind() != IResourceDelta.CHANGED) { return true; } int flags = delta.getFlags(); if (flags != 0 && flags != IResourceDelta.MARKERS) { return true; } IResourceDelta[] children = delta.getAffectedChildren(); for (IResourceDelta child : children) { if (isAffectedBy(child)) { return true; } } return false; }
Source:
<code>public boolean equals(Object o) { if (o == this) { return true; } if (!(o instanceof Hardware)) { return false; } Hardware hw = (Hardware) o; return mScreen.equals(hw.getScreen()) && mNetworking.equals(hw.getNetworking()) && mSensors.equals(hw.getSensors()) && mMic == hw.hasMic() && mCameras.equals(hw.getCameras()) && mKeyboard == hw.getKeyboard() && mNav == hw.getNav() && mRam.equals(hw.getRam()) && mButtons == hw.getButtonType() && mInternalStorage.equals(hw.getInternalStorage()) && mRemovableStorage.equals(hw.getRemovableStorage()) && mCpu.equals(hw.getCpu()) && mGpu.equals(hw.getGpu()) && mAbis.equals(hw.getSupportedAbis()) && mUiModes.equals(hw.getSupportedUiModes()) && mPluggedIn == hw.getChargeType() <START> && ((mSkinPath != null && mSkinPath.equals(hw.getSkinPath())) <END> || (mSkinPath == null && hw.getSkinPath() == null)); }</code><technical_language>I this is new change, Guava's && Objects.equal(mSkinPath, hw.skinPath) here</technical_language>

Target:
public boolean equals(Object o) { if (o == this) { return true; } if (!(o instanceof Hardware)) { return false; } Hardware hw = (Hardware) o; return mScreen.equals(hw.getScreen()) && mNetworking.equals(hw.getNetworking()) && mSensors.equals(hw.getSensors()) && mMic == hw.hasMic() && mCameras.equals(hw.getCameras()) && mKeyboard == hw.getKeyboard() && mNav == hw.getNav() && mRam.equals(hw.getRam()) && mButtons == hw.getButtonType() && mInternalStorage.equals(hw.getInternalStorage()) && mRemovableStorage.equals(hw.getRemovableStorage()) && mCpu.equals(hw.getCpu()) && mGpu.equals(hw.getGpu()) && mAbis.equals(hw.getSupportedAbis()) && mUiModes.equals(hw.getSupportedUiModes()) && mPluggedIn == hw.getChargeType() && Objects.equals(mSkinFile, hw.getSkinFile()); }
Source:
<code>protected void validateSource(Factory factory) throws ConflictException { for (ProjectConfigDto project : factory.getWorkspace().getProjects()) { String type = project.getSource().getType(); String location = project.getSource().getLocation(); String parameterTypeName = "project.storage.type"; String parameterLocationName = "project.storage.location"; <START> if (!("git".equals(type) || "esbwso2".equals(type) || "github".equals(type))) { <END> throw new ConflictException("Parameter '" + parameterTypeName + "' has illegal value."); } if (isNullOrEmpty(location)) { throw new ConflictException( format(FactoryConstants.PARAMETRIZED_ILLEGAL_PARAMETER_VALUE_MESSAGE, parameterLocationName, location)); } else { try { URLDecoder.decode(location, "UTF-8"); } catch (IllegalArgumentException | UnsupportedEncodingException e) { throw new ConflictException( format(FactoryConstants.PARAMETRIZED_ILLEGAL_PARAMETER_VALUE_MESSAGE, parameterLocationName, location)); } } } }</code><technical_language>Need figure out is</technical_language>

Target:
protected void validateSource(Factory factory) throws ConflictException { for (ProjectConfigDto project : factory.getWorkspace().getProjects()) { String location = project.getSource().getLocation(); String parameterLocationName = "project.storage.location"; if (isNullOrEmpty(location)) { throw new ConflictException( format(FactoryConstants.PARAMETRIZED_ILLEGAL_PARAMETER_VALUE_MESSAGE, parameterLocationName, location)); } else { try { URLDecoder.decode(location, "UTF-8"); } catch (IllegalArgumentException | UnsupportedEncodingException e) { throw new ConflictException( format(FactoryConstants.PARAMETRIZED_ILLEGAL_PARAMETER_VALUE_MESSAGE, parameterLocationName, location)); } } } }
Source:
<code>protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_user); Toolbar toolbar = (Toolbar) findViewById(R.id.app_bar); setSupportActionBar(toolbar); Button loginButton = (Button)findViewById(R.id.login_button); loginButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { <START> if (DropboxActivity.USE_SLT) { <END> Auth.startOAuth2PKCE(UserActivity.this, getString(R.string.app_key), DbxRequestConfigFactory.getRequestConfig()); } else { Auth.startOAuth2Authentication(UserActivity.this, getString(R.string.app_key)); } } }); Button filesButton = (Button)findViewById(R.id.files_button); filesButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { startActivity(FilesActivity.getIntent(UserActivity.this, "")); } }); Button openWithButton = (Button)findViewById(R.id.open_with); openWithButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent openWithIntent = new Intent(UserActivity.this, OpenWithActivity.class); startActivity(openWithIntent); } }); }</code><technical_language>this moved DropboxActivity classes needed USE_SLT? a starAuthentication method base this calls click decides Auth method call</technical_language>

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_user); Toolbar toolbar = (Toolbar) findViewById(R.id.app_bar); setSupportActionBar(toolbar); Button loginButton = (Button)findViewById(R.id.login_button); loginButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { DropboxActivity.startOAuth2Authentication(UserActivity.this); } }); Button filesButton = (Button)findViewById(R.id.files_button); filesButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { startActivity(FilesActivity.getIntent(UserActivity.this, "")); } }); Button openWithButton = (Button)findViewById(R.id.open_with); openWithButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent openWithIntent = new Intent(UserActivity.this, OpenWithActivity.class); startActivity(openWithIntent); } }); }
Source:
<code>protected void demandRemoteResolve(SynchronizedResourceSet resourceSet, URI uri, final ThreadSafeProgressMonitor monitor) { if (isInterruptedOrCanceled(monitor)) { demandResolvingAndUnloadingPoolShutdown(); return; } Collection<URI> uriCollection = dependencyProviderRegistry.getDependencies(uri); lock.lock(); try { for (URI currentUri : uriCollection) { if (resolvedResources.add(currentUri) && currentlyResolving.add(currentUri)) { <START> monitor.setWorkRemaining(1000); <END> ListenableFuture<?> future = resolvingPool.submit(new RemoteResourceResolver(resourceSet, currentUri, monitor)); Futures.addCallback(future, new ResolvingFutureCallback(monitor, currentUri)); } } } finally { lock.unlock(); } }</code><technical_language>do this in loop, loop. monitor ignore some work done</technical_language>

Target:
protected void demandRemoteResolve(SynchronizedResourceSet resourceSet, URI uri, final ThreadSafeProgressMonitor monitor) { if (isInterruptedOrCanceled(monitor)) { demandResolvingAndUnloadingPoolShutdown(); return; } Collection<URI> uriCollection = dependencyProviderRegistry.getDependencies(uri); lock.lock(); try { monitor.setWorkRemaining(1000); for (URI currentUri : uriCollection) { if (resolvedResources.add(currentUri) && currentlyResolving.add(currentUri)) { ListenableFuture<?> future = resolvingPool.submit(new RemoteResourceResolver(resourceSet, currentUri, monitor)); Futures.addCallback(future, new ResolvingFutureCallback(monitor, currentUri)); } } } finally { lock.unlock(); } }
Source:
<code>public WebResponse getResponse(final Ds3Request request) throws IOException { WebResponse webResponse = super.getResponse(request); <START> while (networkClientRetryBehavior.shouldRetry(webResponse)) <END> webResponse = super.getResponse(request); return webResponse; }</code><technical_language>For consistency, include curly braces for loops if-else statements, if line</technical_language>

Target:
public WebResponse getResponse(final Ds3Request request) throws IOException { WebResponse webResponse; do { webResponse = super.getResponse(request); } while (networkClientRetryBehavior.shouldRetry(webResponse)); return webResponse; }
Source:
<code>public void init() { ProcessSummary processSummaryOne = new ProcessSummary("test-def-id", "test-def-name", "testone", "1", false); ProcessSummary processSummaryTwo = new ProcessSummary("test-def-id", "test-def-name", "testtwo", "1", false); ProcessSummary processSummaryThree = new ProcessSummary("test-def-id", "test-def-name", "testtwo", "2", false); List<ProcessSummary> processSummaries = Arrays.asList(processSummaryOne, processSummaryTwo, processSummaryThree); doAnswer(answer -> { return processSummaries; }).when(processRuntimeDataService).getProcessesByFilter(anyString(), anyString(), anyInt(), anyInt(), anyString(), <START> anyBoolean()); <END> dataSetdef = ProcessDefinitionDataSetDefBuilder.get() .uuid(PROCESS_DEFINITION_DATASET) .generatorClass("org.jbpm.workbench.pr.backend.server.ProcessDefinitonDataSetGenerator") .name("Process Definition") .label(COL_ID_PROCESSNAME) .label(COL_ID_PROCESSVERSION) .label(COL_ID_PROJECT) .label(COL_ID_PROCESSDEF) .label(COL_DYNAMIC) .buildDef(); }</code><technical_language>duplicating is done in ProcessDefinitonDataSetGenerator</technical_language>

Target:
public void init() { ProcessSummary processSummaryOne = new ProcessSummary("test-def-id", "test-def-name-one", "testone", "1", false); ProcessSummary processSummaryTwo = new ProcessSummary("test-def-id", "test-def-name", "testtwo", "1", false); ProcessSummary processSummaryThree = new ProcessSummary("test-def-id", "test-def-name", "testtwo", "2", false); List<ProcessSummary> processSummaries = Arrays.asList(processSummaryOne, processSummaryTwo, processSummaryThree); doAnswer(answer -> Arrays.asList(processSummaryOne)).when(processRuntimeDataService).getProcessesByFilter(SERVER_TEMPLATE_ID, TEXT_SEARCH, 0, -1, SORT_COLUMN_NAME, false); doAnswer(answer -> processSummaries).when(processRuntimeDataService).getProcessesByFilter(SERVER_TEMPLATE_ID, "", 0, -1, SORT_COLUMN_NAME, false); dataSetdef = new ProcessDefinitionDataSetGenerator().getDataSetDef(); }
Source:
<code>static void registerOperation(final ManagementResourceRegistration registry, final ResourceDescriptionResolver resourceDescriptionResolver) { <START> registry.registerOperationHandler(new SimpleOperationDefinitionBuilder(MIGRATE, resourceDescriptionResolver) <END> .setRuntimeOnly() .build(), new MigrateOperation(false)); registry.registerOperationHandler(new SimpleOperationDefinitionBuilder(DESCRIBE_MIGRATION, resourceDescriptionResolver) .setRuntimeOnly() .build(), new MigrateOperation(true)); }</code><technical_language>I need a description of return type (see web migration commit for example)</technical_language>

Target:
static void registerOperation(final ManagementResourceRegistration registry, final ResourceDescriptionResolver resourceDescriptionResolver) { registry.registerOperationHandler(new SimpleOperationDefinitionBuilder(MIGRATE, resourceDescriptionResolver) .setRuntimeOnly() .setReplyParameters(MIGRATION_WARNINGS_ATTR, MIGRATION_ERROR_ATTR) .build(), new MigrateOperation(false)); registry.registerOperationHandler(new SimpleOperationDefinitionBuilder(DESCRIBE_MIGRATION, resourceDescriptionResolver) .setRuntimeOnly() .setReplyParameters(MIGRATION_WARNINGS_ATTR, MIGRATION_ERROR_ATTR) .build(), new MigrateOperation(true)); }
Source:
<code>public List<File> getExtensionsDirectories() { String path = getProperty("ENGINE_EXTENSION_PATH"); if (path == null) { log.warn("No extension configurations directories were provided"); return Collections.emptyList(); } List<File> results = new ArrayList<File>(); <START> for (String currentPath : path.split(":")) { <END> results.add(new File(currentPath)); } return results; }</code><technical_language>if blank</technical_language>

Target:
public List<File> getExtensionsDirectories() { String path = getProperty("ENGINE_EXTENSION_PATH"); if (path == null) { log.warn("No extension configurations directories were provided"); return Collections.emptyList(); } List<File> results = new ArrayList<File>(); for (String currentPath : path.split(":")) { if (StringUtils.isNotBlank(currentPath)) { results.add(new File(currentPath)); } } return results; }
Source:
<code>static byte[] getIDContext(byte[] oscoreOption) { if (oscoreOption.length == 0) { <START> oscoreOption = new byte[] { 0x00 }; <END> } byte flagByte = oscoreOption[0]; int n = flagByte & 0x07; int h = flagByte & 0x10; byte[] kidContext = null; int index = 1; index += n; if (h != 0) { int s = oscoreOption[index]; kidContext = Arrays.copyOfRange(oscoreOption, index + 1, index + 1 + s); index += s + 1; } return kidContext; }</code><technical_language>For this case return null, or</technical_language>

Target:
static byte[] getIDContext(byte[] oscoreOption) { if (oscoreOption.length == 0) { return null; } byte flagByte = oscoreOption[0]; int n = flagByte & 0x07; int h = flagByte & 0x10; byte[] kidContext = null; int index = 1; index += n; if (h != 0) { int s = oscoreOption[index]; kidContext = Arrays.copyOfRange(oscoreOption, index + 1, index + 1 + s); index += s + 1; } return kidContext; }
Source:
<code>public Digester(DigestSource digestSource) { <START> this(KeySources.random(8), "", digestSource); <END> }</code><technical_language>16 instead of 8</technical_language>

Target:
public Digester(DigestSource digestSource) { this(KeySources.random(16), '-', digestSource); }
Source:
<code>public long getMaxWait() { ThroughputElement<E> e = this.underlyingQueue.peek(); long max = -1; try { this.takeCountsLock.readLock().lock(); if (e != null && e.getWaited() > this.maxQueuedTime) { <START> max = e.getWaited(); <END> } else { max = this.maxQueuedTime; } } finally { this.takeCountsLock.readLock().unlock(); } return max; }</code><technical_language>Do need assign e.getWaited() this.maxQueuedTime here</technical_language>

Target:
public long getMaxWait() { ThroughputElement<E> e = this.underlyingQueue.peek(); long max = -1; try { this.maxQueueTimeLock.readLock().lock(); if (e != null && e.getWaited() > this.maxQueuedTime) { max = e.getWaited(); } else { max = this.maxQueuedTime; } } finally { this.maxQueueTimeLock.readLock().unlock(); } return max; }
Source:
<code>public void testRunOnEmulator() throws IOException, ClassNotFoundException { String projectName = "SimpleApplication"; String appName = "app"; <START> WelcomeFrameFixture welcomeFrame = findWelcomeFrame(); welcomeFrame.clickOpenProjectButton(); <END> IdeFrameFixture projectFrame = openProject(projectName); ChooseDeviceDialogFixture chooseDeviceDialogFixture = projectFrame.runApp(appName); chooseDeviceDialogFixture.selectEmulator("Nexus7"); chooseDeviceDialogFixture.clickOk(); RunToolWindowFixture runToolWindowFixture = projectFrame.getRunToolWindowFixture(); String processName = projectFrame.scanLogCatOutputForProcessName(runToolWindowFixture, appName); projectFrame.terminateApp(processName); }</code><technical_language>lines redundant. Method "openProject" this. Please remove. Do in "testDebugInEmulator"</technical_language>

Target:
public void testRunOnEmulator() throws IOException, ClassNotFoundException { String appName = "app"; IdeFrameFixture projectFrame = openSimpleApplication(); projectFrame.runApp(appName); ChooseDeviceDialogFixture chooseDeviceDialogFixture = projectFrame.findChooseDeviceDialog(); chooseDeviceDialogFixture.selectEmulator("Nexus7"); chooseDeviceDialogFixture.clickOk(); ToolWindowTextFinder toolWindowTextFinder = new ToolWindowTextFinder(Pattern.compile("^\\s*remote path: (?:[^\\/]*[\\/])*([\\w\\.]+)$", Pattern.MULTILINE)); RunToolWindowFixture runToolWindowFixture = projectFrame.getRunToolWindowFixture(); runToolWindowFixture.waitForOutput(projectFrame, appName, toolWindowTextFinder, SHORT_TIMEOUT); String processName = toolWindowTextFinder.getMatchers()[0].group(1); projectFrame.terminateApp(processName); }
Source:
<code>public void renameMethodShouldThrowExceptionWhenNotIsNameEditable() { <START> NameNotEditableItem item = new NameNotEditableItem(null,"NameNotEditableItem"); <END> try { item.renameTo("NewName"); fail("An item with isNameEditable false must throw exception when trying to rename it."); } catch (IOException e) { assertEquals(e.getMessage(),"Trying to rename an item that has not editable name."); assertEquals("NameNotEditableItem",item.getName()); } }</code><technical_language>This is a pretty low-level test. fast, other hand is clear prevents bug. A stronger test a real item (createProject) try confirmRename REST endpoint WebClient. require item type in test classpath is a Job support renames, trickier</technical_language>

Target:
public void renameMethodShouldThrowExceptionWhenNotIsNameEditable() { NameNotEditableItem item = new NameNotEditableItem(null,"NameNotEditableItem"); try { item.renameTo("NewName"); fail("An item with isNameEditable false must throw exception when trying to rename it."); } catch (IOException e) { assertEquals(e.getMessage(),"Trying to rename an item that does not support this operation."); assertEquals("NameNotEditableItem",item.getName()); } }
Source:
<code>private void flushIfNecessary() { long totalBytes = 0; long maxBytes = 0; PageBuffer maxBuffer = null; if (pageStores.size() > maxOpenFiles) { <START> throw new PrestoException(RAPTOR_TOO_MANY_OPEN_FILES, format("Exceeded the limit of %s files created per worker for a query", maxOpenFiles)); <END> } for (PageStore store : pageStores.values()) { long bytes = store.getUsedMemoryBytes(); totalBytes += bytes; if ((maxBuffer == null) || (bytes > maxBytes)) { maxBuffer = store.getPageBuffer(); maxBytes = bytes; } } if ((totalBytes > maxBufferBytes) && (maxBuffer != null)) { maxBuffer.flush(); } }</code><technical_language>include number of files query is create worker</technical_language>

Target:
private void flushIfNecessary() { long totalBytes = 0; long maxBytes = 0; PageBuffer maxBuffer = null; if (pageStores.size() > maxAllowedFilesPerWriter) { throw new PrestoException(RAPTOR_TOO_MANY_FILES_CREATED, format("Number of files created: %s , has exceeded the limit of %s files created per worker per query", pageStores.size(), maxAllowedFilesPerWriter)); } for (PageStore store : pageStores.values()) { long bytes = store.getUsedMemoryBytes(); totalBytes += bytes; if ((maxBuffer == null) || (bytes > maxBytes)) { maxBuffer = store.getPageBuffer(); maxBytes = bytes; } } if ((totalBytes > maxBufferBytes) && (maxBuffer != null)) { maxBuffer.flush(); } }
Source:
<code>public ArrayList<String> fetchAll() throws IOException { ArrayList<String> atlasInformation = new ArrayList<>(); try (JsonReader reader = atlasInformationJsonFile.get()) { reader.beginObject(); while (reader.hasNext()) { String name = reader.nextName(); switch(name){ <START> case "ensembl": atlasInformation.add("Ensembl: " + reader.nextString()); break; <END> case "genomes": atlasInformation.add("Ensembl Genomes: " + reader.nextString()); break; case "paraSite": atlasInformation.add("WormBase paraSite: " + reader.nextString()); break; case "efo": atlasInformation.add("EFO: " + reader.nextString()); break; default: reader.skipValue(); } } reader.endObject(); } return atlasInformation; }</code><technical_language>is DAO's responsibility format data, responsibility is retrieve it. UI is responsible for this data means. side-effect of this implementation is end strange in .jsp add commas. do if wanted display EFO version, for example, a page altogether? parse string in list find out is EFO version, extract number. of a data structure allow retrieve for piece of metadata? Also, of a identify data pass strings around? Hint: read [enums in Java](<LINK_0></technical_language>

Target:
public Map<String, String> fetchAll() { JsonReader reader = atlasInformationJsonFile.get(); Map<String, String> data = GsonProvider.GSON.fromJson(reader, HashMap.class); return data; }
Source:
<code>protected void writeMemoryBlock(final long offset, final byte[] bytes) throws DebugException { <START> final int addressableSize = getAddressableSize(); <END> final Addr64 address = new Addr64(fBaseAddress); Query<MemoryByte[]> query = new Query<MemoryByte[]>() { @Override protected void execute(final DataRequestMonitor<MemoryByte[]> drm) { IMemory memoryService = (IMemory) fRetrieval.getServiceTracker().getService(); if (memoryService != null) { memoryService.setMemory( fContext, address, offset, addressableSize, bytes.length, bytes, new RequestMonitor(fRetrieval.getExecutor(), drm)); } else { drm.done(); } } }; fRetrieval.getExecutor().execute(query); try { query.get(); } catch (InterruptedException e) { throw new DebugException(new Status(IStatus.ERROR, DsfPlugin.PLUGIN_ID, DebugException.INTERNAL_ERROR, "Error writing memory block (InterruptedException)", e)); } catch (ExecutionException e) { throw new DebugException(new Status(IStatus.ERROR, DsfPlugin.PLUGIN_ID, DebugException.INTERNAL_ERROR, "Error writing memory block (ExecutionException)", e)); } }</code><technical_language>surround try/catch debug exception thrown? sure. do think</technical_language>

Target:
protected void writeMemoryBlock(final long offset, final byte[] bytes) throws DebugException { int aSize; try { aSize = getAddressableSize(); } catch (DebugException e) { aSize = 1; } final int addressableSize = aSize; final int addressableUnits = bytes.length/addressableSize; final Addr64 address = new Addr64(fBaseAddress); Query<MemoryByte[]> query = new Query<MemoryByte[]>() { @Override protected void execute(final DataRequestMonitor<MemoryByte[]> drm) { IMemory memoryService = (IMemory) fRetrieval.getServiceTracker().getService(); if (memoryService != null) { memoryService.setMemory( fContext, address, offset, addressableSize, addressableUnits, bytes, new RequestMonitor(fRetrieval.getExecutor(), drm)); } else { drm.done(); } } }; fRetrieval.getExecutor().execute(query); try { query.get(); } catch (InterruptedException e) { throw new DebugException(new Status(IStatus.ERROR, DsfPlugin.PLUGIN_ID, DebugException.INTERNAL_ERROR, "Error writing memory block (InterruptedException)", e)); } catch (ExecutionException e) { throw new DebugException(new Status(IStatus.ERROR, DsfPlugin.PLUGIN_ID, DebugException.INTERNAL_ERROR, "Error writing memory block (ExecutionException)", e)); } }
Source:
<code>public Iterable<ServerInZone> listNodesByIds(final Iterable<String> ids) { return Iterables.filter(listNodes(), new Predicate<ServerInZone>() { @Override public boolean apply(ServerInZone server) { <START> return Iterables.contains(ids, server.slashEncode()); <END> } }); }</code><technical_language>..and again... ;-)</technical_language>

Target:
public Iterable<ServerInZone> listNodesByIds(final Iterable<String> ids) { return filter(listNodes(), new Predicate<ServerInZone>() { @Override public boolean apply(ServerInZone server) { return contains(ids, server.slashEncode()); } }); }
Source:
<code>public void validate(Object obj, Errors errors) throws APIException { log.debug("{}.validate...", this.getClass().getName()); <START> if (obj == null || !(obj instanceof Alert)) { <END> throw new IllegalArgumentException("error.general and must be of type " + Alert.class); } Alert alert = (Alert) obj; ValidationUtils.rejectIfEmptyOrWhitespace(errors, "text", "Alert.text.required"); ValidateUtil.validateFieldLengths(errors, obj.getClass(), "text"); }</code><technical_language>write unit tests for conditions</technical_language>

Target:
public void validate(Object obj, Errors errors) throws APIException { logger.debug("{}.validate...", this.getClass().getName()); if (obj == null || !(obj instanceof Alert)) { throw new IllegalArgumentException("error.general and must be of type " + Alert.class); } Alert alert = (Alert) obj; ValidationUtils.rejectIfEmptyOrWhitespace(errors, "text", "Alert.text.required"); ValidateUtil.validateFieldLengths(errors, obj.getClass(), "text"); }
Source:
<code>public List<MetricFamilySamples> collect() { List<MetricFamilySamples> sampleFamilies = new ArrayList<MetricFamilySamples>(); CounterMetricFamily allocated = new CounterMetricFamily( <START> "jvm_memory_pool_allocated_bytes", <END> "Total bytes allocated in a given JVM memory pool. Only updated after GC, not continuously.", Collections.singletonList("pool")); sampleFamilies.add(allocated); for (Map.Entry<String, AtomicLong> entry : allocatedMap.entrySet()) { String memoryPool = entry.getKey(); AtomicLong bytesAllocated = entry.getValue(); allocated.addMetric(Collections.singletonList(memoryPool), bytesAllocated.doubleValue()); } return sampleFamilies; }</code><technical_language>Counters end in _total</technical_language>

Target:
public List<MetricFamilySamples> collect() { return allocatedCounter.collect(); }
Source:
<code>public Date getTimestamp() { <START> return timestamp; <END> }</code><technical_language>add "this" qualifier</technical_language>

Target:
public Date getTimestamp() { return this.timestamp; }
Source:
<code>public boolean isEnabled() { List<StructuredViewer> viewers = getViewers(); <START> ISearchResultPage page = getCurrentPage(); <END> return viewers.size() > 0 && page != null && WHITELISTED_IDS.contains(page.getID()); }</code><technical_language>viewers > 0 implies page is non-null</technical_language>

Target:
public boolean isEnabled() { List<StructuredViewer> viewers = getViewers(); ISearchResultPage page = getCurrentPage(); return viewers.size() > 0 && WHITELISTED_IDS.contains(page.getID()); }