auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public static DefaultExecutionTopology fromExecutionGraph(ExecutionGraph executionGraph) { checkNotNull(executionGraph, "execution graph can not be null"); ExecutionGraphIndex executionGraphIndex = computeExecutionGraphIndex( executionGraph.getAllExecutionVertices(), <START> executionGraph.getNumberOfExecutionJobVertices()); <END> IndexedPipelinedRegions indexedPipelinedRegions = computePipelinedRegions(executionGraphIndex.executionVerticesList); ensureCoLocatedVerticesInSameRegion(indexedPipelinedRegions.pipelinedRegions, executionGraph); return new DefaultExecutionTopology( executionGraphIndex.executionVerticesById, executionGraphIndex.executionVerticesList, executionGraphIndex.resultPartitionsById, indexedPipelinedRegions.pipelinedRegionsByVertex, indexedPipelinedRegions.pipelinedRegions); }</code><technical_language>suggestion executionGraph.getTotalNumberOfVertices());</technical_language>

Target:
public static DefaultExecutionTopology fromExecutionGraph(ExecutionGraph executionGraph) { checkNotNull(executionGraph, "execution graph can not be null"); ExecutionGraphIndex executionGraphIndex = computeExecutionGraphIndex( executionGraph.getAllExecutionVertices(), executionGraph.getTotalNumberOfVertices()); IndexedPipelinedRegions indexedPipelinedRegions = computePipelinedRegions(executionGraphIndex.executionVerticesList); ensureCoLocatedVerticesInSameRegion(indexedPipelinedRegions.pipelinedRegions, executionGraph); return new DefaultExecutionTopology( executionGraphIndex.executionVerticesById, executionGraphIndex.executionVerticesList, executionGraphIndex.resultPartitionsById, indexedPipelinedRegions.pipelinedRegionsByVertex, indexedPipelinedRegions.pipelinedRegions); }
Source:
<code>public void visitInsn(int opcode) { if (opcode == MONITORENTER) { onBeforeSyncEntry(); } else if (opcode == MONITOREXIT) { onBeforeSyncExit(); } <START> switch (opcode) { <END> case IRETURN: case ARETURN: case FRETURN: case LRETURN: case DRETURN: case RETURN: onMethodReturn(opcode); break; default: break; } super.visitInsn(opcode); if (opcode == MONITORENTER) { onAfterSyncEntry(); } else if (opcode == MONITOREXIT) { onAfterSyncExit(); } }</code><technical_language>I class hierarchy ErrorReturnInstrumentor extend MethodReturnInstrumentor should. Then, instead of repeating switch statement call super.visitInsn(opcode) effect same</technical_language>

Target:
public void visitInsn(int opcode) { if (opcode == MONITORENTER) { onBeforeSyncEntry(); } else if (opcode == MONITOREXIT) { onBeforeSyncExit(); } super.visitInsn(opcode); if (opcode == MONITORENTER) { onAfterSyncEntry(); } else if (opcode == MONITOREXIT) { onAfterSyncExit(); } }
Source:
<code>private void persistAutoStart(String serverName, ModelNode model) { Path startedFile = autoStartDataDir.resolve(serverName + STARTED_EXT); Path stoppedFile = autoStartDataDir.resolve(serverName + STOPPED_EXT); if (serverInventory != null && shouldUpdateAutoStart(model)) { ServerStatus status = serverInventory.determineServerStatus(serverName); try { if (status == ServerStatus.STARTED || status == ServerStatus.STARTING) { if (Files.notExists(startedFile)) { Files.createFile(startedFile); } Files.deleteIfExists(stoppedFile); model.get(AUTO_START).set(true); <START> HostControllerLogger.ROOT_LOGGER.warn("We are updating the auto-start attribute to TRUE for " + serverName); <END> } else if (status == ServerStatus.STOPPED || status == ServerStatus.STOPPING) { if (Files.notExists(stoppedFile)) { Files.createFile(stoppedFile); } Files.deleteIfExists(startedFile); model.get(AUTO_START).set(false); HostControllerLogger.ROOT_LOGGER.warn("We are updating the auto-start attribute to FALSE for " + serverName); } } catch (IOException ex) { HostControllerLogger.ROOT_LOGGER.error("Error persisting server autostart status", ex); } } }</code><technical_language>Needs internationalized</technical_language>

Target:
private void persistAutoStart(String serverName, ModelNode model) { Path startedFile = autoStartDataDir.resolve(serverName + STARTED_EXT); Path stoppedFile = autoStartDataDir.resolve(serverName + STOPPED_EXT); if (serverInventory != null && shouldUpdateAutoStart(model)) { ServerStatus status = serverInventory.determineServerStatus(serverName); try { if (status == ServerStatus.STARTED || status == ServerStatus.STARTING) { if (Files.notExists(startedFile)) { Files.createFile(startedFile); } Files.deleteIfExists(stoppedFile); model.get(AUTO_START).set(true); } else if (status == ServerStatus.STOPPED || status == ServerStatus.STOPPING) { if (Files.notExists(stoppedFile)) { Files.createFile(stoppedFile); } Files.deleteIfExists(startedFile); model.get(AUTO_START).set(false); } } catch (IOException ex) { HostControllerLogger.ROOT_LOGGER.couldNotPersistAutoStartServerStatus(ex); } } }
Source:
<code>private void handleAddingBarrier(BufferConsumer bufferConsumer, boolean insertAsHead) { assert Thread.holdsLock(buffers); if (insertAsHead) { <START> inflightBufferSnapshot.clear(); <END> for (BufferConsumer buffer : buffers) { try (BufferConsumer bc = buffer.copy()) { inflightBufferSnapshot.add(bc.build()); } } buffers.addFirst(bufferConsumer); } else { buffers.add(bufferConsumer); } }</code><technical_language>nit: more safe assert inflightBufferSnapshot is clear, clear reading (we change getInflightBufferSnapshot() return array clear buffers in "getter", return copy of list ?) #getInflightBufferSnapshot() is tested in way</technical_language>

Target:
private void handleAddingBarrier(BufferConsumer bufferConsumer, boolean insertAsHead) { assert Thread.holdsLock(buffers); if (insertAsHead) { checkState(inflightBufferSnapshot.isEmpty(), "Supporting only one concurrent checkpoint in unaligned " + "checkpoints"); for (BufferConsumer buffer : buffers) { try (BufferConsumer bc = buffer.copy()) { inflightBufferSnapshot.add(bc.build()); } } buffers.addFirst(bufferConsumer); } else { buffers.add(bufferConsumer); } }
Source:
<code>protected boolean canDoAction() { <START> if (validateNameAndStoragePoolNotNull()) { <END> NetworkQoS oldNetworkQoS = getNetworkQoSDao().get(getNetworkQoS().getId()); if (oldNetworkQoS == null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_NETWORK_QOS_NOT_FOUND); } else if (!oldNetworkQoS.getStoragePoolId().equals(getNetworkQoS().getStoragePoolId())) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_NETWORK_QOS_INVALID_DC_ID); } } return true; }</code><technical_language>is important for remove ? expect get entity contains NetworkQos ID is enough identify entity wish delete in system</technical_language>

Target:
protected boolean canDoAction() { if (validateParameters()) { NetworkQoS oldNetworkQoS = getNetworkQoSDao().get(getNetworkQoS().getId()); if (oldNetworkQoS == null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_NETWORK_QOS_NOT_FOUND); } else if (!oldNetworkQoS.getStoragePoolId().equals(getNetworkQoS().getStoragePoolId())) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_NETWORK_QOS_INVALID_DC_ID); } } return true; }
Source:
<code>public void returnsCorrectSize() { final List<String> VALID_LIST = Arrays.asList( "Accept: text/plain", "Accept-Charset: utf-8", "Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==", "Cache-Control: no-cache", "From: user@example.com"); <START> final String NO_NEXT_VALUE_ERROR = "Empty Error Message"; <END> MatcherAssert .assertThat(new VerboseIterable<String>( VALID_LIST, NO_NEXT_VALUE_ERROR), IsIterableWithSize .<String> iterableWithSize(VALID_LIST.size())); }</code><technical_language>@m4solutions here. I suggest error</technical_language>

Target:
public final void returnsCorrectSize() { final List<String> valid = Arrays.asList( "Accept: text/plain", "Accept-Charset: utf-8", "Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==", "Cache-Control: no-cache", "From: user@example.com" ); MatcherAssert.assertThat( new VerboseIterable<String>( valid, "Empty Error Message" ), Matchers.<String>iterableWithSize(valid.size()) ); }
Source:
<code>public void setSlaveConnectTimeout(int slaveConnectTimeout) { if (slaveConnectTimeout < 0) { <START> this.slaveConnectTimeout = 0; <END> } else { this.slaveConnectTimeout = slaveConnectTimeout; } }</code><technical_language>set default log a warning</technical_language>

Target:
public void setSlaveConnectTimeout(int slaveConnectTimeout) { if (slaveConnectTimeout <= 0) { LOGGER.log(Level.WARNING, "Slave -> Jenkins connection timeout " + "cannot be <= 0. Falling back to the default value: " + DEFAULT_SLAVE_JENKINS_CONNECTION_TIMEOUT); this.slaveConnectTimeout = DEFAULT_SLAVE_JENKINS_CONNECTION_TIMEOUT; } else { this.slaveConnectTimeout = slaveConnectTimeout; } }
Source:
<code>public InputStream open(String path, OpenOptions options) throws IOException { IOException te = null; FileSystem hdfs = getFs(); RetryPolicy retryPolicy = new CountingRetry(MAX_TRY); DistributedFileSystem dfs = null; if (hdfs instanceof DistributedFileSystem) { dfs = (DistributedFileSystem) hdfs; } while (retryPolicy.attempt()) { try { FSDataInputStream inputStream = hdfs.open(new Path(path)); if (options.getPositionShort()) { LOG.info("AMDEBUG: using pread"); <START> return new HdfsPositionedUnderFileInputStream(inputStream, options.getOffset()); <END> } try { inputStream.seek(options.getOffset()); } catch (IOException e) { inputStream.close(); throw e; } LOG.info("AMDEBUG: not using pread"); return new HdfsUnderFileInputStream(inputStream); } catch (IOException e) { LOG.warn("{} try to open : {}", retryPolicy.getAttemptCount(), path, e.getMessage()); te = e; if (options.getRecoverFailedOpen() && dfs != null && e.getMessage().toLowerCase() .startsWith("cannot obtain block length for")) { try { if (dfs.recoverLease(new Path(path))) { LOG.warn("HDFS recoverLease-1 success for: {}", path); } else { CommonUtils.sleepMs(5 * Constants.SECOND_MS); if (dfs.recoverLease(new Path(path))) { LOG.warn("HDFS recoverLease-2 success for: {}", path); } else { LOG.warn("HDFS recoverLease: path not closed: {}", path); } } } catch (IOException e1) { LOG.warn("HDFS recoverLease failed for: error: {}", path, e1.getMessage()); } } } } throw te; }</code><technical_language>Do end caching this stream anywhere, if a problem if is a type</technical_language>

Target:
public InputStream open(String path, OpenOptions options) throws IOException { IOException te = null; FileSystem hdfs = getFs(); RetryPolicy retryPolicy = new CountingRetry(MAX_TRY); DistributedFileSystem dfs = null; if (hdfs instanceof DistributedFileSystem) { dfs = (DistributedFileSystem) hdfs; } while (retryPolicy.attempt()) { try { FSDataInputStream inputStream = hdfs.open(new Path(path)); if (options.getPositionShort()) { LOG.debug("Using pread API to HDFS"); return new HdfsPositionedUnderFileInputStream(inputStream, options.getOffset()); } try { inputStream.seek(options.getOffset()); } catch (IOException e) { inputStream.close(); throw e; } return new HdfsUnderFileInputStream(inputStream); } catch (IOException e) { LOG.warn("{} try to open : {}", retryPolicy.getAttemptCount(), path, e.getMessage()); te = e; if (options.getRecoverFailedOpen() && dfs != null && e.getMessage().toLowerCase() .startsWith("cannot obtain block length for")) { try { if (dfs.recoverLease(new Path(path))) { LOG.warn("HDFS recoverLease-1 success for: {}", path); } else { CommonUtils.sleepMs(5 * Constants.SECOND_MS); if (dfs.recoverLease(new Path(path))) { LOG.warn("HDFS recoverLease-2 success for: {}", path); } else { LOG.warn("HDFS recoverLease: path not closed: {}", path); } } } catch (IOException e1) { LOG.warn("HDFS recoverLease failed for: error: {}", path, e1.getMessage()); } } } } throw te; }
Source:
<code><START> public void testGetDrugsByMapping_shouldGetAListOfNonRetiredDrugMappingsWithGivenCodeAndConceptSourceAndConceptmapTypes() throws Exception { <END> ConceptReferenceTerm conceptReferenceTerm = conceptService.getConceptReferenceTermByCode("2332523", new ConceptSource(2)); List<ConceptMapType> conceptMapTypeList = conceptService.getConceptMapTypes(false, true); List<Drug> drugs = conceptService.getDrugsByMapping(conceptReferenceTerm.getCode(), conceptReferenceTerm.getConceptSource(), conceptMapTypeList, false); assertEquals(0, drugs.size()); }</code><technical_language>plugin generate test methods</technical_language>

Target:
public void testGetDrugsByMapping_shouldGetAListOfNonRetiredDrugMappingsWithGivenCodeAndConceptSourceAndConceptmapTypes() throws Exception { executeDataSet(GET_DRUG_MAPPINGS); List<ConceptMapType> conceptMapTypeList = conceptService.getConceptMapTypes(false, true); List<Drug> drugs = conceptService.getDrugsByMapping("WGT234", conceptService.getConceptSource(1), conceptMapTypeList, false); assertEquals(2, drugs.size()); assertTrue(containsId(drugs,2)); }
Source:
<code>public void doIndex(StaplerRequest req, StaplerResponse rsp) { if (req.getHeader(URL_VALIDATION_HEADER) != null) { RSAPublicKey key = identity.getPublic(); rsp.setHeader(X_INSTANCE_IDENTITY, new String(Base64.encodeBase64(key.getEncoded()))); rsp.setStatus(200); return; } String eventType = req.getHeader("X-GitHub-Event"); <START> if("ping".equals(eventType)) { <END> LOGGER.info("Got a ping request from GitHub"); return; } if ("push".equals(eventType)) { String payload = req.getParameter("payload"); if (payload == null) { throw new IllegalArgumentException("Not intended to be browsed interactively (must specify payload parameter). " + "Make sure payload version is 'application/vnd.github+form'."); } processGitHubPayload(payload, GitHubPushTrigger.class); } else if (isNotEmpty(eventType)) { throw new IllegalArgumentException("Github Webhook event of type " + eventType + " is not supported. " + "Only push events are current supported"); } else { String payload = req.getParameter("payload"); if (payload == null) { throw new IllegalArgumentException("Not intended to be browsed interactively (must specify payload parameter)"); } processGitHubPayload(payload, GitHubPushTrigger.class); } }</code><technical_language>space</technical_language>

Target:
public void doIndex(StaplerRequest req, StaplerResponse rsp) { if (req.getHeader(URL_VALIDATION_HEADER) != null) { RSAPublicKey key = identity.getPublic(); rsp.setHeader(X_INSTANCE_IDENTITY, new String(Base64.encodeBase64(key.getEncoded()))); rsp.setStatus(200); return; } String eventType = req.getHeader("X-GitHub-Event"); if ("ping".equals(eventType)) { LOGGER.debug("Got a ping request from GitHub"); return; } if ("push".equals(eventType)) { String payload = req.getParameter("payload"); if (payload == null) { throw new IllegalArgumentException("Not intended to be browsed interactively (must specify payload parameter). " + "Make sure payload version is 'application/vnd.github+form'."); } processGitHubPayload(payload, GitHubPushTrigger.class); } else if (isNotEmpty(eventType)) { throw new IllegalArgumentException("Github Webhook event of type " + eventType + " is not supported. " + "Only push events are current supported"); } else { String payload = req.getParameter("payload"); if (payload == null) { throw new IllegalArgumentException("Not intended to be browsed interactively (must specify payload parameter)"); } processGitHubPayload(payload, GitHubPushTrigger.class); } }
Source:
<code>public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_gutenberg_editor, container, false); if (getArguments() != null) { mIsNewPost = getArguments().getBoolean(ARG_IS_NEW_POST); } mWPAndroidGlueCode.onCreateView( view.findViewById(R.id.gutenberg), mHtmlModeEnabled, new OnMediaLibraryButtonListener() { @Override public void onMediaLibraryButtonClicked() { onToolbarMediaButtonClicked(); } @Override public void onUploadMediaButtonClicked() { mEditorFragmentListener.onAddPhotoClicked(); } @Override public void onCapturePhotoButtonClicked() { checkAndRequestCameraAndStoragePermissions(); } }, new OnReattachQueryListener() { @Override public void onQueryCurrentProgressForUploadingMedia() { <START> for (String mediaId : mUploadingMediaProgressMax.keySet()) { <END> mWPAndroidGlueCode.mediaFileUploadProgress(Integer.valueOf(mediaId), mUploadingMediaProgressMax.get(mediaId)); } } }, getActivity().getApplication(), BuildConfig.DEBUG, BuildConfig.BUILD_GUTENBERG_FROM_SOURCE, mIsNewPost); if (getActivity() instanceof EditorFragmentActivity) { ((EditorFragmentActivity) getActivity()).initializeEditorFragment(); } setHasOptionsMenu(true); mInvalidateOptionsHandler = new Handler(); mInvalidateOptionsRunnable = new Runnable() { @Override public void run() { if (isAdded()) { getActivity().invalidateOptionsMenu(); } } }; mEditorFragmentListener.onEditorFragmentInitialized(); if (mIsNewPost) { showImplicitKeyboard(); } return view; }</code><technical_language>Hey @mzorz, moving this a separate method (e.g. updateMediaProgress similar) put this mUploadingMediaProgressMax.get(mediaId) variable (e.g. int currentProgress) passing method</technical_language>

Target:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_gutenberg_editor, container, false); if (getArguments() != null) { mIsNewPost = getArguments().getBoolean(ARG_IS_NEW_POST); } mWPAndroidGlueCode.onCreateView( view.findViewById(R.id.gutenberg), mHtmlModeEnabled, new OnMediaLibraryButtonListener() { @Override public void onMediaLibraryButtonClicked() { onToolbarMediaButtonClicked(); } @Override public void onUploadMediaButtonClicked() { mEditorFragmentListener.onAddPhotoClicked(); } @Override public void onCapturePhotoButtonClicked() { checkAndRequestCameraAndStoragePermissions(); } }, new OnReattachQueryListener() { @Override public void onQueryCurrentProgressForUploadingMedia() { updateMediaProgress(); } }, getActivity().getApplication(), BuildConfig.DEBUG, BuildConfig.BUILD_GUTENBERG_FROM_SOURCE, mIsNewPost); if (getActivity() instanceof EditorFragmentActivity) { ((EditorFragmentActivity) getActivity()).initializeEditorFragment(); } setHasOptionsMenu(true); mInvalidateOptionsHandler = new Handler(); mInvalidateOptionsRunnable = new Runnable() { @Override public void run() { if (isAdded()) { getActivity().invalidateOptionsMenu(); } } }; mEditorFragmentListener.onEditorFragmentInitialized(); if (mIsNewPost) { showImplicitKeyboard(); } return view; }
Source:
<code>public PerformancePublisher(String sourceDataFiles) { this.sourceDataFiles = sourceDataFiles; migrateParsers(); <START> } <END></code><technical_language>IMHO modify non-static field</technical_language>

Target:
public PerformancePublisher(String sourceDataFiles) { this.sourceDataFiles = sourceDataFiles; }
Source:
<code>public void updateConfiguration(Configuration configuration, HdfsContext context, URI uri) { if (cacheConfig.isCachingEnabled() && cacheConfig.getCacheType() == ALLUXIO) { configuration.set("alluxio.user.client.cache.async.write.enabled", String.valueOf(alluxioCacheConfig.isAsyncWriteEnabled())); configuration.set("alluxio.user.client.cache.dir", cacheConfig.getBaseDirectory().getPath()); <START> configuration.set("alluxio.user.client.cache.size", cacheConfig.getMaxInMemoryCacheSize().toString()); <END> configuration.set("alluxio.user.local.cache.enabled", String.valueOf(cacheConfig.isCachingEnabled())); configuration.set("alluxio.user.metrics.collection.enabled", String.valueOf(alluxioCacheConfig.isMetricsCollectionEnabled())); configuration.set("sink.jmx.class", alluxioCacheConfig.getJmxClass()); configuration.set("sink.jmx.domain", alluxioCacheConfig.getMetricsDomain()); } }</code><technical_language>getMaxInMemoryCacheSize() is in-memory space cache library use. is data allowed cache. Move getMaxInMemoryCacheSize FileMerge cache config create a new for alluxio</technical_language>

Target:
public void updateConfiguration(Configuration configuration, HdfsContext context, URI uri) { if (cacheConfig.isCachingEnabled() && cacheConfig.getCacheType() == ALLUXIO) { configuration.set("alluxio.user.local.cache.enabled", String.valueOf(cacheConfig.isCachingEnabled())); configuration.set("alluxio.user.client.cache.dir", cacheConfig.getBaseDirectory().getPath()); configuration.set("alluxio.user.client.cache.size", alluxioCacheConfig.getMaxCacheSize().toString()); configuration.set("alluxio.user.client.cache.async.write.enabled", String.valueOf(alluxioCacheConfig.isAsyncWriteEnabled())); configuration.set("alluxio.user.metrics.collection.enabled", String.valueOf(alluxioCacheConfig.isMetricsCollectionEnabled())); configuration.set("sink.jmx.class", alluxioCacheConfig.getJmxClass()); configuration.set("sink.jmx.domain", alluxioCacheConfig.getMetricsDomain()); } }
Source:
<code>public synchronized void jobSubmitted(JobState job) { ClientJobState storedJobState = new ClientJobState(job); jobsMap.put(job.getId(), storedJobState); sState.getPendingJobs().add(storedJobState); <START> job.setGenericInformation(storedJobState.getGenericInformation()); <END> dispatchJobSubmitted(job); }</code><technical_language>Is set generic information earlier, JobState instance passed in parameters is created? I a bit afraid setting this level enough for some cases</technical_language>

Target:
public synchronized void jobSubmitted(JobState job) { ClientJobState storedJobState = new ClientJobState(job); jobsMap.put(job.getId(), storedJobState); sState.getPendingJobs().add(storedJobState); dispatchJobSubmitted(job); }
Source:
<code>private void performSaveAfterChecks() { currentMessageBuilder = createMessageBuilder(true); if (currentMessageBuilder != null) { setProgressBarIndeterminateVisibility(true); <START> currentMessageBuilder.setHighPriority(isHighPriority); <END> currentMessageBuilder.buildAsync(this); } }</code><technical_language>this belong</technical_language>

Target:
private void performSaveAfterChecks() { currentMessageBuilder = createMessageBuilder(true); if (currentMessageBuilder != null) { setProgressBarIndeterminateVisibility(true); currentMessageBuilder.buildAsync(this); } }
Source:
<code><START> AlphaJumpTestAdapter() { <END> mStrings = new String[100]; for (int i = 0; i < 100; i++) { mStrings[i] = "Dummy" + i; } }</code><technical_language>nit: add a new line constructor</technical_language>

Target:
AlphaJumpTestAdapter() { for (int i = 0; i < sSize; i++) { mStrings[i] = "Dummy" + i; } }
Source:
<code><START> private static Class<? extends LwM2mNode> nodeClassFromPath(LwM2mPath path) { <END> if (path.isObject()) { return LwM2mObject.class; } else if (path.isObjectInstance()) { return LwM2mObjectInstance.class; } else if (path.isResource()) { return LwM2mResource.class; } throw new IllegalArgumentException("invalid path level: " + path); }</code><technical_language>sense this method public needed build decoder</technical_language>

Target:
public static Class<? extends LwM2mNode> nodeClassFromPath(LwM2mPath path) { if (path.isObject()) { return LwM2mObject.class; } else if (path.isObjectInstance()) { return LwM2mObjectInstance.class; } else if (path.isResource()) { return LwM2mResource.class; } throw new IllegalArgumentException("invalid path level: " + path); }
Source:
<code>public String getTitle() { <START> return "ProjectsDetailScreen"; <END> }</code><technical_language>i18n</technical_language>

Target:
public String getTitle() { return ts.getTranslation( LibraryConstants.ProjectDetailScreen ); }
Source:
<code>public void update(GameContainer container, StateBasedGame game, int delta) throws SlickException { <START> float deltaF = delta / 1000f; <END> for (Viewport viewport : viewports) { viewport.update(deltaF); } }</code><technical_language>I educated guess, this explicit delta is (i think) in miliseconds? deltaF means</technical_language>

Target:
public void update(GameContainer container, StateBasedGame game, int delta) throws SlickException { float deltaInSeconds = delta / 1000f; for (Structure structure : map.getStructures()) { structure.update(deltaInSeconds); } for (Viewport viewport : viewports) { viewport.update(deltaInSeconds); } }
Source:
<code>public void endToEndReplicationWithMultiNodeSinglePartitionTest() throws InterruptedException, IOException, InstantiationException { DataNodeId dataNodeId = nonSSLCluster.getFirstDataNode(); <START> endToEndReplicationWithMultiNodeSinglePartitionTest(nonSSLCluster, "DC1", "", dataNodeId.getPort(), <END> new Port(dataNodeId.getPort(), PortType.PLAINTEXT), new Port(dataNodeId.getPort() + 3, PortType.PLAINTEXT), new Port(dataNodeId.getPort() + 6, PortType.PLAINTEXT)); }</code><technical_language>I this defeats purpose of abstracting MockClusterMap if implementation (and implementation change). discuss if other ways do this</technical_language>

Target:
public void endToEndReplicationWithMultiNodeSinglePartitionTest() throws InterruptedException, IOException, InstantiationException { cluster = new MockCluster(notificationSystem); DataNodeId dataNodeId = cluster.getClusterMap().getDataNodeIds().get(0); ArrayList<String> dataCenterList = Utils.splitString("DC1,DC2,DC3", ","); List<DataNodeId> dataNodes = cluster.getOneDataNodeFromEachDatacenter(dataCenterList); endToEndReplicationWithMultiNodeSinglePartitionTest("DC1", "", dataNodeId.getPort(), new Port(dataNodes.get(0).getPort(), PortType.PLAINTEXT), new Port(dataNodes.get(1).getPort(), PortType.PLAINTEXT), new Port(dataNodes.get(2).getPort(), PortType.PLAINTEXT)); }
Source:
<code>private static List<KubernetesCloud> getUsageRestrictedKubernetesClouds() { List<KubernetesCloud> k8sClouds = new ArrayList<>(); <START> <END> for (Cloud cloud : Jenkins.getInstance().clouds) { if (isUsageRestrictedKubernetesCloud(cloud)) { k8sClouds.add((KubernetesCloud) cloud); } } Collections.sort(k8sClouds, CLOUD_BY_NAME); return k8sClouds; }</code><technical_language>Jenkins.getInstance().clouds.getAll(KubernetesCloud.class) need cast</technical_language>

Target:
private static List<KubernetesCloud> getUsageRestrictedKubernetesClouds() { List<KubernetesCloud> clouds = Jenkins.get().clouds .getAll(KubernetesCloud.class) .stream() .filter(KubernetesCloud::isUsageRestricted) .collect(Collectors.toList()); Collections.sort(clouds, Comparator.<Cloud, String>comparing(o -> o.name)); return clouds; }
Source:
<code>public String generateVersionChecksum(RepoObject repoObject) throws RepoException { StringBuilder sb = new StringBuilder(); sb.append(repoObject.getKey()); <START> sb.append(TimestampFormatter.getFormattedTimestamp(repoObject.getCreationDate())).append(System.nanoTime()); <END> if (repoObject.getTag() != null){ sb.append(repoObject.getTag()); } if (repoObject.getContentType() != null){ sb.append(repoObject.getContentType()); } if (repoObject.getDownloadName() != null ){ sb.append(repoObject.getDownloadName()); } sb.append(repoObject.getChecksum()); return checksumToString(this.digest(sb.toString())); }</code><technical_language>curious, is purpose of this change</technical_language>

Target:
public String generateVersionChecksum(RepoObject repoObject) throws RepoException { StringBuilder sb = new StringBuilder(); sb.append(repoObject.getKey()); sb.append(TimestampFormatter.getFormattedTimestamp(repoObject.getCreationDate())); if (repoObject.getTag() != null){ sb.append(repoObject.getTag()); } if (repoObject.getContentType() != null){ sb.append(repoObject.getContentType()); } if (repoObject.getDownloadName() != null ){ sb.append(repoObject.getDownloadName()); } if (repoObject.getUserMetadata() != null ){ sb.append(repoObject.getUserMetadata()); } sb.append(repoObject.getChecksum()); return checksumToString(this.digest(sb.toString())); }
Source:
<code>protected GoVisitor buildGoVisitor(@NotNull final ProblemsHolder holder, @NotNull LocalInspectionToolSession session) { return new GoVisitor() { @Override public void visitContinueStatement(@NotNull GoContinueStatement o) { <START> PsiElement parent = o.getContinue().getParent(); <END> while (parent != null) { if (parent instanceof GoForStatement) { return; } parent = parent.getParent(); } holder.registerProblem(o.getContinue(), "Continue statement not inside a for loop."); } }; }</code><technical_language>PsiTreeUtil#getParentOfType != null</technical_language>

Target:
protected GoVisitor buildGoVisitor(@NotNull final ProblemsHolder holder, @NotNull LocalInspectionToolSession session) { return new GoVisitor() { @Override public void visitContinueStatement(@NotNull GoContinueStatement o) { if (PsiTreeUtil.getParentOfType(o.getContinue(), GoForStatement.class) == null) { holder .registerProblem(o.getContinue(), "Continue statement not inside a for loop.", ProblemHighlightType.GENERIC_ERROR_OR_WARNING); } } }; }
Source:
<code>public PreferredProperties mergeWithParent(PreferredProperties parent, boolean mergePartitionPreference) { List<LocalProperty<Symbol>> newLocal = ImmutableList.<LocalProperty<Symbol>>builder() .addAll(localProperties) .addAll(parent.getLocalProperties()) .build(); Builder builder = builder() .local(newLocal); if (globalProperties.isPresent()) { Global currentGlobal = globalProperties.get(); Global newGlobal = parent.getGlobalProperties() .map(g -> currentGlobal.mergeWithParent(g, mergePartitionPreference)) <START> .orElse(currentGlobal); <END> builder.global(newGlobal); } else { builder.global(parent.getGlobalProperties()); } return builder.build(); }</code><technical_language>abbreviations</technical_language>

Target:
public PreferredProperties mergeWithParent(PreferredProperties parent, boolean mergePartitionPreference) { List<LocalProperty<VariableReferenceExpression>> newLocal = ImmutableList.<LocalProperty<VariableReferenceExpression>>builder() .addAll(localProperties) .addAll(parent.getLocalProperties()) .build(); Builder builder = builder() .local(newLocal); if (globalProperties.isPresent()) { Global currentGlobal = globalProperties.get(); Global newGlobal = parent.getGlobalProperties() .map(global -> currentGlobal.mergeWithParent(global, mergePartitionPreference)) .orElse(currentGlobal); builder.global(newGlobal); } else { builder.global(parent.getGlobalProperties()); } return builder.build(); }
Source:
<code>public AMQPMirrorControllerTarget(AMQPSessionCallback sessionSPI, AMQPConnectionContext connection, AMQPSessionContext protonSession, Receiver receiver, ActiveMQServer server) { super(sessionSPI, connection, protonSession, receiver); if (logger.isDebugEnabled()) { <START> logger.debug("Adding Remote Control target", new Exception("debug")); <END> } this.server = server; }</code><technical_language>Logging doesnt reflect prior class rename. other instances of this</technical_language>

Target:
public AMQPMirrorControllerTarget(AMQPSessionCallback sessionSPI, AMQPConnectionContext connection, AMQPSessionContext protonSession, Receiver receiver, ActiveMQServer server) { super(sessionSPI, connection, protonSession, receiver); this.server = server; }
Source:
<code>public void testFilterContentContainsSimpleExcludesEntry() throws Exception { <START> File filterFile = createFilterFile("excludes=SomeTest"); <END> RegexFileFilter filter = new RegexFileFilter(filterFile); assertThat(filter.match(mockClass("SomeTest")), is(true)); }</code><technical_language>excludes 'exclude' here? Is purpose</technical_language>

Target:
public void testFilterContentContainsSimpleExcludesEntry() throws Exception { File filterFile = createFilterFile("exclude=SomeTest"); RegexFileFilter filter = new RegexFileFilter(filterFile); assertThat(filter.match(mockClass("SomeTest")), is(true)); }
Source:
<code>public Object getAdapter(Class adapter) { if (adapter == IPropertySheetPage.class) { <START> return adapter.cast(new TabbedPropertySheetPage(this)); <END> } return super.getAdapter(adapter); }</code><technical_language>Is a good idea give access view page? class for sheet page access contents</technical_language>

Target:
public Object getAdapter(Class adapter) { if (adapter == IPropertySheetPage.class) { return adapter.cast(new TabbedPropertySheetPage(this.propertyPageContributor)); } return super.getAdapter(adapter); }
Source:
<code>private void ensureDirectory() throws IOException { File dir = new File(getDirectory()); <START> if (!dir.exists()) { <END> FileUtils.forceMkdir(dir); } Assert.isTrue(dir.exists()); }</code><technical_language>want verify dir is writable</technical_language>

Target:
private void ensureDirectory() throws IOException { File dir = new File(directory); if (!dir.exists()) { FileUtils.forceMkdir(dir); } Assert.isTrue(dir.exists()); Assert.isTrue(dir.canWrite()); }
Source:
<code>public void singFirstVerse() { assertEquals("99 bottles of beer on the wall, 99 bottles of beer.\n" + "Take one down and pass it around, 98 bottles of beer on the wall.\n\n", <START> new BeerSong().verse(99)); <END> }</code><technical_language>If a private BeerSong variable, initialise in a setup method do beerSong.verse(99) :) duplicate initialisation in test :)</technical_language>

Target:
public void singFirstVerse() { assertEquals("99 bottles of beer on the wall, 99 bottles of beer.\n" + "Take one down and pass it around, 98 bottles of beer on the wall.\n\n", beerSong.verse(99)); }
Source:
<code>private void addPartition(String partition) throws IOException { PartitionDescProto.Builder builder = PartitionDescProto.newBuilder(); builder.setPartitionName(partition); String[] partitionKeyPairs = partition.split("/"); for(int i = 0; i < partitionKeyPairs.length; i++) { String partitionKeyPair = partitionKeyPairs[i]; String[] split = partitionKeyPair.split("="); PartitionKeyProto.Builder keyBuilder = PartitionKeyProto.newBuilder(); keyBuilder.setColumnName(split[0]); keyBuilder.setPartitionValue(split[1]); builder.addPartitionKeys(keyBuilder.build()); <START> } <END> if (this.plan.getUri() == null) { String[] split = CatalogUtil.splitTableName(plan.getTableName()); int endIndex = storeTablePath.toString().indexOf(split[1]) + split[1].length(); String outputPath = storeTablePath.toString().substring(0, endIndex); builder.setPath(outputPath + "/" + partition); } else { builder.setPath(this.plan.getUri().toString() + "/" + partition); } context.addPartition(builder.build()); }</code><technical_language>This code added</technical_language>

Target:
private void addPartition(String partition) throws IOException { PartitionDescProto.Builder builder = PartitionDescProto.newBuilder(); builder.setPartitionName(partition); String[] partitionKeyPairs = partition.split("/"); for(int i = 0; i < partitionKeyPairs.length; i++) { String partitionKeyPair = partitionKeyPairs[i]; String[] split = partitionKeyPair.split("="); PartitionKeyProto.Builder keyBuilder = PartitionKeyProto.newBuilder(); keyBuilder.setColumnName(split[0]); keyBuilder.setPartitionValue(StringUtils.unescapePathName(split[1])); builder.addPartitionKeys(keyBuilder.build()); } if (this.plan.getUri() == null) { int endIndex = storeTablePath.toString().indexOf(FileTablespace.TMP_STAGING_DIR_PREFIX); String outputPath = storeTablePath.toString().substring(0, endIndex); builder.setPath(outputPath + partition); } else { builder.setPath(this.plan.getUri().toString() + "/" + partition); } context.addPartition(builder.build()); }
Source:
<code>public void initialize(AddAction schemaObject) { Action action = schemaObject.getAction(); for (String tag : schemaObject.getTags()) { SceneActor scene = gameLoop.getSceneView().getCurrentScene(); Array<SceneElementActor> sceneElements = scene.findByTag(tag); <START> if (sceneElements != null) { <END> for (SceneElementActor sceneElement : sceneElements) { sceneElement.addAction(action); } } } }</code><technical_language>check if schemaObject.getTags() gameLoop.getSceneView().getCurrentScene() null. I assume this is methods return null. consistent, scene.findByTag(tag) return null</technical_language>

Target:
public void initialize(AddAction schemaObject) { Action action = schemaObject.getAction(); for (String tag : schemaObject.getTags()) { SceneActor scene = gameLoop.getSceneView().getCurrentScene(); Array<SceneElementActor> sceneElements = scene.findByTag(tag); for (SceneElementActor sceneElement : sceneElements) { sceneElement.addAction(action); } } }
Source:
<code>public KeyStore loadTrustStore(String trustStorePath, String trustStoreType, String trustStorePassword) throws KeyStoreException, CertificateException, NoSuchAlgorithmException, IOException { if (isEmpty(trustStorePath)) { throw new IllegalArgumentException("Wrong TrustStore file path configuration"); } FileInputStream fin = null; try { fin = new FileInputStream(trustStorePath); final KeyStore ks = KeyStore.getInstance(isEmpty(trustStoreType) ? KeyStore.getDefaultType() : trustStoreType); ks.load(fin, trustStorePassword == null ? null : trustStorePassword.toCharArray()); return ks; } finally { try { if (fin != null) { fin.close(); } <START> } catch (Exception ignore) { <END> } } }</code><technical_language>Ignore</technical_language>

Target:
public KeyStore loadTrustStore(String trustStorePath, String trustStoreType, String trustStorePassword) throws Exception { if (isEmpty(trustStorePath)) { throw new IllegalArgumentException("Wrong TrustStore file path configuration"); } FileInputStream fin = null; try { fin = new FileInputStream(trustStorePath); final KeyStore ks = KeyStore.getInstance(isEmpty(trustStoreType) ? KeyStore.getDefaultType() : trustStoreType); ks.load(fin, trustStorePassword == null ? null : trustStorePassword.toCharArray()); return ks; } finally { if (fin != null) { fin.close(); } } }
Source:
<code><START> public static void validateHttpResponseHeaderConfig(String config) { <END> try { String[] configTokens = config.trim().split("\\s+", 2); if (configTokens.length != 2) { throw new ConfigException(String.format("Invalid format of header config \"%s\". " + "Expected: \"[ation] [header name]:[header value]\"", config)); } String method = configTokens[0].trim(); validateHeaderConfigAction(method); String header = configTokens[1]; String[] headerTokens = header.trim().split(":"); if (headerTokens.length != 2) { throw new ConfigException( String.format("Invalid format of header name and header value pair \"%s\". " + "Expected: \"[header name]:[header value]\"", header)); } String headerName = headerTokens[0].trim(); if (headerName.contains(" ")) { throw new ConfigException(String.format("Invalid header name \"%s\". " + "The \"[header name]\" cannot contain whitespace", headerName)); } } catch (ArrayIndexOutOfBoundsException e) { throw new ConfigException(String.format("Invalid header config \"%s\".", config), e); } }</code><technical_language>implement a ConfigDef.Validator implementation, similar existing AdminListenersValidator below</technical_language>

Target:
static void validateHttpResponseHeaderConfig(String config) { try { String[] configTokens = config.trim().split("\\s+", 2); if (configTokens.length != 2) { throw new ConfigException(String.format("Invalid format of header config '%s\'. " + "Expected: '[ation] [header name]:[header value]'", config)); } String method = configTokens[0].trim(); validateHeaderConfigAction(method); String header = configTokens[1]; String[] headerTokens = header.trim().split(":"); if (headerTokens.length != 2) { throw new ConfigException( String.format("Invalid format of header name and header value pair '%s'. " + "Expected: '[header name]:[header value]'", header)); } String headerName = headerTokens[0].trim(); if (headerName.isEmpty() || headerName.matches(".*\\s+.*")) { throw new ConfigException(String.format("Invalid header name '%s'. " + "The '[header name]' cannot contain whitespace", headerName)); } } catch (ArrayIndexOutOfBoundsException e) { throw new ConfigException(String.format("Invalid header config '%s'.", config), e); } }
Source:
<code><START> public InputStream getLogs(boolean follow, String container) { <END> this.follow = follow; this.container = container; start(); SequenceInputStream is = new SequenceInputStream(getProcess().getInputStream(), getProcess().getErrorStream()); return is; }</code><technical_language>this method called concurrently, call changing state while call requested build args</technical_language>

Target:
public InputStream getLogs(boolean follow, String container) { container = StringUtils.defaultIfBlank(container, ""); synchronized (cache) { if(cache.containsKey(container)) { return cache.get(container).getLogs(); } PodLogs logs = null; try { logs = new PodLogs(client, follow, container); return logs.getLogs(); }catch(Exception e) { throw e; }finally { if(logs != null) { cache.put(container, logs); } } } }
Source:
<code>private static void addThirdpartyPaths(List<String> result) { File thirdpartyRoot = new File(jmDir + File.separator + "lib" + File.separator + "3rdparty"); File[] thirdpartyDirs = thirdpartyRoot.listFiles(new FileFilter() { @Override public boolean accept(File pathname) { return pathname.isDirectory(); } }); if (thirdpartyDirs != null) { for (File libDir : thirdpartyDirs) { File[] libJars = libDir.listFiles(new FilenameFilter() { @Override public boolean accept(File dir, String name) { return name.endsWith(".jar"); } }); <START> for (File libJar : libJars) { <END> result.add(libJar.getPath()); } } } }</code><technical_language>libJars throw NPE. Please check for listFiles != null</technical_language>

Target:
private static void addThirdpartyPaths(List<String> result) { File thirdpartyRoot = new File(jmDir + File.separator + "lib" + File.separator + "3rdparty"); File[] thirdpartyDirs = thirdpartyRoot.listFiles(new FileFilter() { @Override public boolean accept(File pathname) { return pathname.isDirectory(); } }); if (thirdpartyDirs != null) { for (File libDir : thirdpartyDirs) { File[] libJars = libDir.listFiles(new FilenameFilter() { @Override public boolean accept(File dir, String name) { return name.endsWith(".jar"); } }); if (libJars != null) { for (File libJar : libJars) { result.add(libJar.getPath()); } } } } }
Source:
<code>public void testJoinFnInitAndClose() throws Exception { TestJoinFunction joinFn = new TestJoinFunction(); StreamOperatorTask sot = createStreamOperatorTask(new SystemClock(), new TestJoinStreamApplication(joinFn)); List<Integer> output = new ArrayList<>(); <START> MessageCollector messageCollector = envelope -> output.add((Integer) envelope.getMessage()); <END> numbers.forEach(n -> sot.process(new FirstStreamIME(n, n), messageCollector, taskCoordinator)); assertEquals(joinFn.getNumCloseCalls(), 0); sot.close(); assertEquals(joinFn.getNumInitCalls(), 1); assertEquals(joinFn.getNumCloseCalls(), 1); }</code><technical_language>remove this + line 81 (unnecessary for this test). move init count assert line 77</technical_language>

Target:
public void testJoinFnInitAndClose() throws Exception { TestJoinFunction joinFn = new TestJoinFunction(); StreamOperatorTask sot = createStreamOperatorTask(new SystemClock(), new TestJoinStreamApplication(joinFn)); assertEquals(joinFn.getNumInitCalls(), 1); MessageCollector messageCollector = mock(MessageCollector.class); numbers.forEach(n -> sot.process(new FirstStreamIME(n, n), messageCollector, taskCoordinator)); assertEquals(joinFn.getNumCloseCalls(), 0); sot.close(); assertEquals(joinFn.getNumCloseCalls(), 1); }
Source:
<code>private File compressSource(File sourceFolder) throws IOException { <START> File compressFile = File.createTempFile("java_package", "tar.gz"); <END> try (TarArchiveOutputStream tarArchiveOutputStream = new TarArchiveOutputStream( new GZIPOutputStream(new FileOutputStream(compressFile)))) { tarArchiveOutputStream.setLongFileMode(TarArchiveOutputStream.LONGFILE_GNU); for (Path sourceFile : Files.walk(sourceFolder.toPath()).collect(Collectors.toList())) { String relativePath = sourceFolder.toPath().relativize(sourceFile).toString(); TarArchiveEntry entry = new TarArchiveEntry(sourceFile.toFile(), relativePath); if (sourceFile.toFile().isFile()) { try (InputStream inputStream = new FileInputStream(sourceFile.toFile())) { tarArchiveOutputStream.putArchiveEntry(entry); IOUtils.copy(inputStream, tarArchiveOutputStream); tarArchiveOutputStream.closeArchiveEntry(); } } else { tarArchiveOutputStream.putArchiveEntry(entry); tarArchiveOutputStream.closeArchiveEntry(); } } } return compressFile; }</code><technical_language>Check File.deleteOnExit</technical_language>

Target:
private File compressSource(File sourceFolder) throws IOException { File compressFile = File.createTempFile("java_package", "tar.gz"); compressFile.deleteOnExit(); try (TarArchiveOutputStream tarArchiveOutputStream = new TarArchiveOutputStream( new GZIPOutputStream(new FileOutputStream(compressFile)))) { tarArchiveOutputStream.setLongFileMode(TarArchiveOutputStream.LONGFILE_GNU); for (Path sourceFile : Files.walk(sourceFolder.toPath()).collect(Collectors.toList())) { String relativePath = sourceFolder.toPath().relativize(sourceFile).toString(); TarArchiveEntry entry = new TarArchiveEntry(sourceFile.toFile(), relativePath); if (sourceFile.toFile().isFile()) { try (InputStream inputStream = new FileInputStream(sourceFile.toFile())) { tarArchiveOutputStream.putArchiveEntry(entry); IOUtils.copy(inputStream, tarArchiveOutputStream); tarArchiveOutputStream.closeArchiveEntry(); } } else { tarArchiveOutputStream.putArchiveEntry(entry); tarArchiveOutputStream.closeArchiveEntry(); } } } return compressFile; }
Source:
<code>public void onScrollChanged(int oldScrollY, int scrollY, boolean isHumanScroll) { if (webView == null) { return; } int animMargin = 0; int scrollDelta = scrollY - oldScrollY; if (gravity == Gravity.BOTTOM) { if (oldScrollY < scrollY) { animMargin = Math.min(hideableView.getHeight(), (int) hideableView.getTranslationY() + scrollDelta); } else { animMargin = Math.max(0, (int) hideableView.getTranslationY() + scrollDelta); } } else if (gravity == Gravity.TOP) { if (oldScrollY > scrollY) { animMargin = Math.min(0, (int) hideableView.getTranslationY() - scrollDelta); } else { animMargin = Math.max(-hideableView.getHeight(), (int) hideableView.getTranslationY() - scrollDelta); } } hideableView.setTranslationY(animMargin); if (anchoredView != null) { anchoredView.setTranslationY(animMargin); } <START> hideableView.setElevation(scrollY > 0 ? DimenUtil.dpToPx(DimenUtil.getDimension(R.dimen.toolbar_default_elevation)) : 0); <END> }</code><technical_language>This is a lot of operations perform scroll. set elevation scrollY _reaches_ 0, _leaves_ 0</technical_language>

Target:
public void onScrollChanged(int oldScrollY, int scrollY, boolean isHumanScroll) { if (webView == null) { return; } int animMargin = 0; int scrollDelta = scrollY - oldScrollY; if (gravity == Gravity.BOTTOM) { if (oldScrollY < scrollY) { animMargin = Math.min(hideableView.getHeight(), (int) hideableView.getTranslationY() + scrollDelta); } else { animMargin = Math.max(0, (int) hideableView.getTranslationY() + scrollDelta); } } else if (gravity == Gravity.TOP) { if (oldScrollY > scrollY) { animMargin = Math.min(0, (int) hideableView.getTranslationY() - scrollDelta); } else { animMargin = Math.max(-hideableView.getHeight(), (int) hideableView.getTranslationY() - scrollDelta); } } hideableView.setTranslationY(animMargin); if (anchoredView != null) { anchoredView.setTranslationY(animMargin); } float elevation = scrollY == 0 && oldScrollY != 0 ? 0 : DimenUtil.dpToPx(DimenUtil.getDimension(R.dimen.toolbar_default_elevation)); if (elevation != hideableView.getElevation()) { hideableView.setElevation(elevation); } }