auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void testRemoveLocalStorage() throws Exception { setUpGetConnection(2); setUpGetEntityExpectations(GUIDS[0], 2, getEntity(0, StorageType.LOCALFS)); setUriInfo(setUpActionExpectations(VdcActionType.RemoveStorageDomain, RemoveStorageDomainParameters.class, new String[] { "StorageDomainId"}, new Object[] { GUIDS[0] }, true, true)); <START> collection.remove(GUIDS[0].toString()); <END> }</code><technical_language>please verify response remove()</technical_language>

Target:
public void testRemoveLocalStorage() throws Exception { setUpGetConnection(2); setUpGetEntityExpectations(GUIDS[0], 2, getEntity(0, StorageType.LOCALFS)); setUriInfo(setUpActionExpectations(VdcActionType.RemoveStorageDomain, RemoveStorageDomainParameters.class, new String[] { "StorageDomainId"}, new Object[] { GUIDS[0] }, true, true)); verifyRemove(collection.remove(GUIDS[0].toString())); }
Source:
<code>public void abort(String reason, Throwable cause) { if (isAborted()) { <START> LOG.info("Abort called but server already aborted; by-passing; abort invoked because {}", <END> reason, cause); return; } String msg = "***** ABORTING region server " + this + ": " + reason + " *****"; if (cause != null) { LOG.error(HBaseMarkers.FATAL, msg, cause); } else { LOG.error(HBaseMarkers.FATAL, msg); } setAbortRequested(); LOG.error(HBaseMarkers.FATAL, "RegionServer abort: loaded coprocessors are: " + CoprocessorHost.getLoadedCoprocessors()); try { LOG.info("Dump of metrics as JSON on abort: " + DumpRegionServerMetrics.dumpMetrics()); } catch (MalformedObjectNameException | IOException e) { LOG.warn("Failed dumping metrics", e); } try { if (cause != null) { msg += "\nCause:\n" + Throwables.getStackTraceAsString(cause); } RegionServerStatusService.BlockingInterface rss = rssStub; if (rss != null && this.serverName != null) { ReportRSFatalErrorRequest.Builder builder = ReportRSFatalErrorRequest.newBuilder(); builder.setServer(ProtobufUtil.toServerName(this.serverName)); builder.setErrorMessage(msg); rss.reportRSFatalError(null, builder.build()); } } catch (Throwable t) { LOG.warn("Unable to report fatal error to master", t); } scheduleAbortTimer(); stop(reason, true, null); }</code><technical_language>nit: simplify message. abort logged, operator case. java LOG.info("Redundant abort requested. Reason: {}", reason, cause);</technical_language>

Target:
public void abort(String reason, Throwable cause) { String msg = "***** ABORTING region server " + this + ": " + reason + " *****"; if (cause != null) { LOG.error(HBaseMarkers.FATAL, msg, cause); } else { LOG.error(HBaseMarkers.FATAL, msg); } setAbortRequested(); LOG.error(HBaseMarkers.FATAL, "RegionServer abort: loaded coprocessors are: " + CoprocessorHost.getLoadedCoprocessors()); try { LOG.info("Dump of metrics as JSON on abort: " + DumpRegionServerMetrics.dumpMetrics()); } catch (MalformedObjectNameException | IOException e) { LOG.warn("Failed dumping metrics", e); } try { if (cause != null) { msg += "\nCause:\n" + Throwables.getStackTraceAsString(cause); } RegionServerStatusService.BlockingInterface rss = rssStub; if (rss != null && this.serverName != null) { ReportRSFatalErrorRequest.Builder builder = ReportRSFatalErrorRequest.newBuilder(); builder.setServer(ProtobufUtil.toServerName(this.serverName)); builder.setErrorMessage(msg); rss.reportRSFatalError(null, builder.build()); } } catch (Throwable t) { LOG.warn("Unable to report fatal error to master", t); } scheduleAbortTimer(); stop(reason, true, null); }
Source:
<code>private void electLeaders() { try { <START> LOG.debug("Started leader election: " + System.currentTimeMillis()); <END> List<KinesisClientLease> leases = leaseManager.listLeases(); List<String> uniqueHosts = leases.stream().map(KinesisClientLease::getLeaseOwner) .filter(owner -> owner != null).distinct().sorted().collect(Collectors.toList()); Collections.shuffle(uniqueHosts, new Random(DETERMINISTIC_SHUFFLE_SEED)); int numShardSyncWorkers = Math.min(uniqueHosts.size(), numPeriodicShardSyncWorkers); readWriteLock.writeLock().lock(); leaders = new HashSet<>(uniqueHosts.subList(0, numShardSyncWorkers)); LOG.debug("Elected leaders: " + String.join(", ", leaders)); LOG.debug("Completed leader election: " + System.currentTimeMillis()); } catch (DependencyException | InvalidStateException | ProvisionedThroughputException e) { LOG.error("Exception occurred while trying to fetch all leases for leader election", e); } catch (Throwable t) { LOG.error("Unknown exception during leader election.", t); } finally { readWriteLock.writeLock().unlock(); } }</code><technical_language>generally 'Instant' capture time in KCL</technical_language>

Target:
private void electLeaders() { try { LOG.debug("Started leader election at: " + Instant.now()); List<KinesisClientLease> leases = leaseManager.listLeases(); List<String> uniqueHosts = leases.stream().map(KinesisClientLease::getLeaseOwner) .filter(owner -> owner != null).distinct().sorted().collect(Collectors.toList()); Collections.shuffle(uniqueHosts, new Random(DETERMINISTIC_SHUFFLE_SEED)); int numShardSyncWorkers = Math.min(uniqueHosts.size(), numPeriodicShardSyncWorkers); readWriteLock.writeLock().lock(); leaders = new HashSet<>(uniqueHosts.subList(0, numShardSyncWorkers)); LOG.info("Elected leaders: " + String.join(", ", leaders)); LOG.debug("Completed leader election at: " + System.currentTimeMillis()); } catch (DependencyException | InvalidStateException | ProvisionedThroughputException e) { LOG.error("Exception occurred while trying to fetch all leases for leader election", e); } catch (Throwable t) { LOG.error("Unknown exception during leader election.", t); } finally { readWriteLock.writeLock().unlock(); } }
Source:
<code>public static void waitForFxEvents(int attemptsCount, int pulses) { if (Platform.isFxApplicationThread()) { throw new RuntimeException("Waiting for FxEvents on the Fx-Thread is just not possible. " + <START> "Call the root on the test Thread!"); <END> } FxConditionWaiter waiter = new FxConditionWaiter( new FxEventCounter(attemptsCount), new FxRenderCounter(pulses)); waiter.waitFor(); }</code><technical_language>is "root" referring here? a bit more clear? in case encounters this error in TestFX, I explicit (erring side of pedantic)</technical_language>

Target:
public static void waitForFxEvents(int attemptsCount, int pulses) { waitForFxEvents(attemptsCount, SEMAPHORE_SLEEP_IN_MILLIS, pulses, FX_TIMEOUT_CONDITION); }
Source:
<code>public void clickOnTool(String toolName) { jQueryClick( <START> waitForElementByCss(toolbarTool.replace(toolNameReplacement, toolName)) <END> ); PageObjectLogging.log("clickOnTool", toolName + " clicked on customized toolbar", true); }</code><technical_language>I suggest create method for computing selector instead of replacing strings string concatenation like: String.format("div.autocomplete div[title=\"%s\"]", toolName); inline here</technical_language>

Target:
public void clickOnTool(String toolName) { jQueryClick( waitForElementByCss(String.format(toolbarToolCss, toolName)) ); PageObjectLogging.log("clickOnTool", toolName + " clicked on customized toolbar", true); }
Source:
<code><START> protected PrepareStoreCopyResponse unmarshal0( ReadableChannel channel ) throws IOException, EndOfStreamException <END> { int ordinal = channel.getInt(); Status status = Status.values()[ordinal]; Long transactionId = channel.getLong(); File[] files = unmarshalFiles( channel ); SchemaIndexProvider.Descriptor[] indexDescriptors = unmarshalIndexDescriptors( channel ); return new PrepareStoreCopyResponse( files, indexDescriptors, transactionId, status ); }</code><technical_language>EndOfStreamException is thrown in this method, I see</technical_language>

Target:
protected PrepareStoreCopyResponse unmarshal0( ReadableChannel channel ) throws IOException { int ordinal = channel.getInt(); Status status = Status.values()[ordinal]; Long transactionId = channel.getLong(); File[] files = unmarshalFiles( channel ); IndexDescriptor[] indexDescriptors = unmarshalIndexProviderDescriptors( channel ); return new PrepareStoreCopyResponse( files, indexDescriptors, transactionId, status ); }
Source:
<code>protected Map<DyeColor, Boolean> calculateRedstoneOutputs() { <START> Map<DyeColor, Boolean> map = new EnumMap<>(DyeColor.class); <END> for(int slot = 0; slot < 9; slot++) if(!inventory.get(slot).isEmpty()) { DyeColor dye = redstoneColors.get(slot); Boolean ex = map.get(dye); map.put(dye, ex!=null?ex && isFilterMatched(slot): isFilterMatched(slot)); } return map; }</code><technical_language>a map boolean a Set/EnumSet</technical_language>

Target:
protected Set<DyeColor> calculateRedstoneOutputs() { Map<DyeColor, Boolean> map = new EnumMap<>(DyeColor.class); for(int slot = 0; slot < 9; slot++) if(!inventory.get(slot).isEmpty()) { DyeColor dye = redstoneColors.get(slot); Boolean ex = map.get(dye); map.put(dye, ex!=null?ex&&isFilterMatched(slot): isFilterMatched(slot)); } return map.keySet().stream().filter(map::get).collect(Collectors.toSet()); }
Source:
<code>public void stop() throws Throwable { try { <START> serverChannel.close().sync(); <END> } finally { bossGroup.shutdownGracefully(); workerGroup.shutdownGracefully(); } }</code><technical_language>I enough shutdown event loop group. Channel terminated part of event loop group termination. serverChannel field needed in this case</technical_language>

Target:
public void stop() throws Throwable { workerGroup.shutdownGracefully().sync(); }
Source:
<code>private int getEndBucketPosition(final double position) { return Math.min(model.getBucketCache().getNumberBuckets(), model <START> .getBucketCache().bucketPercentageStartPosition(position)); <END> }</code><technical_language>bucketPercentageStartPosition method name longer!@</technical_language>

Target:
private int getEndBucketPosition(final double position) { return Math.min(model.getBucketCache().getNumberBuckets(), model .getBucketCache().getBucketPosition(position)); }
Source:
<code>public String toString() { if (object != null && StringUtils.isNotEmpty(object.toString())) { <START> return StringEscapeUtils.escapeHtml(object.toString().replace('\n', '_').replace('\r', '_')); <END> } return ""; }</code><technical_language>cache string representation of object processing twice? In case XML element else deeply nested? if (object == null) { return ""; } final String objStr = object.toString(); if (StringUtils.isEmpty(objStr)) { // Explicitly log empty string for null empty values coming out of toString return ""; } return StringEscapeUtils.escapeHtml(objStr.replace('\n', '_').replace('\r', '_'));</technical_language>

Target:
public String toString() { if (object == null) { return ""; } final String objStr = object.toString(); if (StringUtils.isEmpty(objStr)) { return ""; } return StringEscapeUtils.escapeHtml(objStr.replace('\n', '_').replace('\r', '_')); }
Source:
<code>protected URI getDedicatedRepResourceURI(DRepresentation representation, Resource airdResource) { int count = 0; ResourceSet resourceSet = airdResource.getResourceSet(); URI repUri = createRepURI(airdResource, representation, count++); while <START> (resourceSet.getResource(repUri, false) != <END> null) { repUri = createRepURI(airdResource, representation, count++); } return repUri; }</code><technical_language>test if file exist not. If representation is loaded, getResource return null</technical_language>

Target:
protected URI getDedicatedRepResourceURI(DRepresentation representation, Resource airdResource) { int count = 0; ResourceSet resourceSet = airdResource.getResourceSet(); URI repUri = createRepURI(airdResource, representation, count++); while (resourceSet.getResource(repUri, false) != null || existsResource(repUri, resourceSet)) { repUri = createRepURI(airdResource, representation, count++); } return repUri; }
Source:
<code>public Map<String, String> getTraceProperties() { Map<String, String> properties = new HashMap<>(); properties.putAll(fTrace.getEnvironment()); properties.put(CLOCK_OFFSET, <START> Long.toUnsignedString(fTrace.getOffset())); <END> properties.put(Messages.CtfTmfTrace_HostID, getHostId()); return properties; }</code><technical_language>This method added in java 8. fail java 7. Note compile Gerrit compile java 8</technical_language>

Target:
public Map<String, String> getTraceProperties() { Map<String, String> properties = new HashMap<>(); properties.putAll(fTrace.getEnvironment()); properties.put(CLOCK_OFFSET, Long.toString(fTrace.getOffset())); properties.put(Messages.CtfTmfTrace_HostID, getHostId()); return properties; }
Source:
<code><START> final <END> ImageReaderProxy setupImageReader(Size resolution) { if (mCaptureProcessor != null) { ProcessingImageReader processingImageReader = new ProcessingImageReader( resolution.getWidth(), resolution.getHeight(), getImageFormat(), MAX_IMAGES, mHandler, mCaptureBundle, mCaptureProcessor); mMetadataMatchingCaptureCallback = processingImageReader.getCameraCaptureCallback(); mImageReader = processingImageReader; } else { MetadataImageReader metadataImageReader = new MetadataImageReader( resolution.getWidth(), resolution.getHeight(), getImageFormat(), MAX_IMAGES, mHandler); mMetadataMatchingCaptureCallback = metadataImageReader.getCameraCaptureCallback(); mImageReader = metadataImageReader; } mImageReader.setOnImageAvailableListener( new ImageReaderProxy.OnImageAvailableListener() { @Override public void onImageAvailable(ImageReaderProxy imageReader) { ImageCaptureRequest imageCaptureRequest = mImageCaptureRequests.peek(); if (imageCaptureRequest != null) { ImageProxy image = null; try { image = imageReader.acquireLatestImage(); } catch (IllegalStateException e) { Log.e(TAG, "Failed to acquire latest image.", e); } finally { if (image != null) { mImageCaptureRequests.poll(); imageCaptureRequest.dispatchImage(image); ImageCapture.this .issueImageCaptureRequests(); } } } else { ImageProxy image = null; try { image = imageReader.acquireLatestImage(); } catch (IllegalStateException e) { Log.e(TAG, "Failed to acquire latest image.", e); } finally { if (image != null) { image.close(); } } } } }, mMainHandler); return mImageReader; }</code><technical_language>I mark this method "final"</technical_language>

Target:
ImageReaderProxy setupImageReader(Size resolution) { if (mCaptureProcessor != null) { ProcessingImageReader processingImageReader = new ProcessingImageReader( resolution.getWidth(), resolution.getHeight(), getImageFormat(), MAX_IMAGES, mHandler, mCaptureBundle, mCaptureProcessor); mMetadataMatchingCaptureCallback = processingImageReader.getCameraCaptureCallback(); mImageReader = processingImageReader; } else { MetadataImageReader metadataImageReader = new MetadataImageReader(resolution.getWidth(), resolution.getHeight(), getImageFormat(), MAX_IMAGES, mHandler); mMetadataMatchingCaptureCallback = metadataImageReader.getCameraCaptureCallback(); mImageReader = metadataImageReader; } mImageReader.setOnImageAvailableListener( new ImageReaderProxy.OnImageAvailableListener() { @Override public void onImageAvailable(ImageReaderProxy imageReader) { ImageCaptureRequest imageCaptureRequest = mImageCaptureRequests.peek(); if (imageCaptureRequest != null) { ImageProxy image = null; try { image = imageReader.acquireLatestImage(); } catch (IllegalStateException e) { Log.e(TAG, "Failed to acquire latest image.", e); } finally { if (image != null) { mImageCaptureRequests.poll(); imageCaptureRequest.dispatchImage(image); ImageCapture.this.issueImageCaptureRequests(); } } } else { ImageProxy image = null; try { image = imageReader.acquireLatestImage(); } catch (IllegalStateException e) { Log.e(TAG, "Failed to acquire latest image.", e); } finally { if (image != null) { image.close(); } } } } }, mMainHandler); return mImageReader; }
Source:
<code><START> static ShowSourceForm pull(String action) { <END> return new ShowSourceForm(action, Operation.PULL); }</code><technical_language>a huge fan of specialized factories. I neat add super useful semantics</technical_language>

Target:
static ShowSourceForm pull(String action) { return new ShowSourceForm(action, true); }
Source:
<code>public void handleEvent(ITmfEvent ev) { String eventName = ev.getName(); IKernelAnalysisEventLayout eventLayout = getProvider().getEventLayout(ev.getTrace()); if (eventName.equals(eventLayout.eventSchedSwitch())) { handleSchedSwitch(ev); } else if (eventName.equals(eventLayout.eventSoftIrqEntry())) { handleSoftirqEntry(ev); } else if (eventName.equals(TcpEventStrings.INET_SOCK_LOCAL_IN) || <START> eventLayout.eventsNetworkReceive().contains(eventName)) { <END> handleInetSockLocalIn(ev); } else if (eventName.equals(TcpEventStrings.INET_SOCK_LOCAL_OUT) || eventLayout.eventsNetworkSend().contains(eventName)) { handleInetSockLocalOut(ev); } else if (isWakeupEvent(ev)) { handleSchedWakeup(ev); } }</code><technical_language>switch this in order ifs short-circuiting traces more option</technical_language>

Target:
public void handleEvent(ITmfEvent ev) { String eventName = ev.getName(); IKernelAnalysisEventLayout eventLayout = getProvider().getEventLayout(ev.getTrace()); if (eventName.equals(eventLayout.eventSchedSwitch())) { handleSchedSwitch(ev); } else if (eventName.equals(eventLayout.eventSoftIrqEntry())) { handleSoftirqEntry(ev); } else if (eventLayout.eventsNetworkReceive().contains(eventName) || eventName.equals(TcpEventStrings.INET_SOCK_LOCAL_IN)) { handleInetSockLocalIn(ev); } else if (eventLayout.eventsNetworkSend().contains(eventName) || eventName.equals(TcpEventStrings.INET_SOCK_LOCAL_OUT)) { handleInetSockLocalOut(ev); } else if (isWakeupEvent(ev)) { handleSchedWakeup(ev); } }
Source:
<code>protected AbstractSerializationService(AbstractSerializationService prototype) { this.version = prototype.version; this.inputOutputFactory = prototype.inputOutputFactory; this.classLoader = prototype.classLoader; this.managedContext = prototype.managedContext; this.globalPartitioningStrategy = prototype.globalPartitioningStrategy; this.outputBufferSize = prototype.outputBufferSize; this.nullSerializerAdapter = prototype.nullSerializerAdapter; this.bufferPoolThreadLocal = new BufferPoolThreadLocal(this, new BufferPoolFactoryImpl(), <START> HazelcastInstanceNotActiveException::new); <END> }</code><technical_language>If expect this constructor member side, HazelcastInstanceNotActiveException::new is fine. if this constructor is Jet client-side, notActiveExceptionSupplier construct prototype service</technical_language>

Target:
protected AbstractSerializationService(AbstractSerializationService prototype) { this.inputOutputFactory = prototype.inputOutputFactory; this.version = prototype.version; this.classLoader = prototype.classLoader; this.managedContext = prototype.managedContext; this.globalPartitioningStrategy = prototype.globalPartitioningStrategy; this.outputBufferSize = prototype.outputBufferSize; this.notActiveExceptionSupplier = prototype.notActiveExceptionSupplier; this.bufferPoolThreadLocal = new BufferPoolThreadLocal(this, new BufferPoolFactoryImpl(), prototype.notActiveExceptionSupplier); this.nullSerializerAdapter = prototype.nullSerializerAdapter; }
Source:
<code>@Override public PropertyArgs parseArguments0(CommandArgIterator argIter) { String name = null; while (argIter.hasNextSubArg() && name == null) { String optName = argIter.nextArg("Expecting " + PropertyArgs.NAME); if (PropertyArgs.NAME.equals(optName)) name = argIter.nextArg("property name"); } if (name == null) { throw new IllegalArgumentException("Property name is not specified. " + <START> "Please the option: --name <property_name>"); <END> } return new PropertyArgs(name, null, PropertyArgs.Action.GET); }</code><technical_language>"Please option" <- soul strange</technical_language>

Target:
@Override public PropertyArgs parseArguments0(CommandArgIterator argIter) { String name = null; while (argIter.hasNextSubArg() && name == null) { String optName = argIter.nextArg("Expecting " + PropertyArgs.NAME); if (PropertyArgs.NAME.equals(optName)) name = argIter.nextArg("property name"); } if (name == null) { throw new IllegalArgumentException("Property name is not specified. " + "Please use the option: --name <property_name>"); } return new PropertyArgs(name, null, PropertyArgs.Action.GET); }
Source:
<code>public ModelAccessor getModelAccessor() { ModelAccessor modelAccessor = null; <START> if (Platform.isRunning()) { <END> modelAccessor = SiriusPlugin.getDefault().getModelAccessorRegistry().getModelAccessor(transactionalEditingDomain.getResourceSet()); } return modelAccessor; }</code><technical_language>remark removed log entry, SiriusPlugin EMFPlugin</technical_language>

Target:
public ModelAccessor getModelAccessor() { return SiriusPlugin.getDefault().getModelAccessorRegistry().getModelAccessor(transactionalEditingDomain.getResourceSet()); }
Source:
<code>public boolean isLeader() { HazelcastInstance hazelcastInstance = BPELServiceComponent.getHazelcastInstance(); Member leader = hazelcastInstance.getCluster().getMembers().iterator().next(); if (leader.localMember()) { <START> log.debug("ODEClusterImpl#isLeader: true"); <END> return true; } log.debug("#ODEClusterImpl#isLeader: false"); return false; }</code><technical_language>Wrap statement if (log.isDebugEnabled())</technical_language>

Target:
public boolean isLeader() { HazelcastInstance hazelcastInstance = BPELServiceComponent.getHazelcastInstance(); Member leader = hazelcastInstance.getCluster().getMembers().iterator().next(); if (leader.localMember()) { if (log.isDebugEnabled()) { log.debug("ODEClusterImpl#isLeader: true"); } return true; } if (log.isDebugEnabled()) { log.debug("#ODEClusterImpl#isLeader: false"); } return false; }
Source:
<code>public void write(final IDocument document, final OutputStream out) throws IOException { final org.eclipse.jface.text.Document doc = new org.eclipse.jface.text.Document(); docPrintln(doc, "<?xml version='1.0' encoding='UTF-8'?>"); writeNode(document, doc, ""); <START> final PrintWriter printWriter = new PrintWriter(new OutputStreamWriter(out, "UTF-8")); <END> printWriter.print(doc.get()); printWriter.flush(); }</code><technical_language>extract method</technical_language>

Target:
public void write(final IDocument document, final OutputStream out) throws IOException { final org.eclipse.jface.text.Document doc = new org.eclipse.jface.text.Document(); docPrintln(doc, "<?xml version='1.0' encoding='UTF-8'?>"); writeNode(document, doc, ""); writeToOutputStream(out, doc); }
Source:
<code>public void allBindingsChanged(BindingProvider provider) { logger.trace("allBindingsChanged() called."); <START> if (provider instanceof VeluxBindingProvider) { <END> } super.allBindingsChanged(provider); }</code><technical_language>Drop this empty block</technical_language>

Target:
public void allBindingsChanged(BindingProvider provider) { logger.trace("allBindingsChanged() called."); super.allBindingsChanged(provider); }
Source:
<code>private void configureForOrientation(Configuration newConfig) { LinearLayout mainContainer = getView().findViewById(R.id.cover_fragment); if (newConfig.orientation == Configuration.ORIENTATION_PORTRAIT) { mainContainer.setOrientation(LinearLayout.VERTICAL); if (newConfig.screenWidthDp > 0) { imgvCover.getLayoutParams().width = (int) (convertDpToPixel(newConfig.screenWidthDp) * .80); <START> imgvCover.getLayoutParams().height = imgvCover.getLayoutParams().width; <END> } } else { mainContainer.setOrientation(LinearLayout.HORIZONTAL); if (newConfig.screenHeightDp > 0) { imgvCover.getLayoutParams().height = (int) (convertDpToPixel(newConfig.screenHeightDp) * .40); imgvCover.getLayoutParams().width = imgvCover.getLayoutParams().height; } } }</code><technical_language>Setting this sets variables re-layout. I this more safe: ViewGroup.LayoutParams params = imgvCover.getLayoutParams(); params.width = (int) (convertDpToPixel(newConfig.screenWidthDp) * .80); params.height = imgvCover.getLayoutParams().width; imgvCover.setLayoutParams(params);</technical_language>

Target:
private void configureForOrientation(Configuration newConfig) { LinearLayout mainContainer = getView().findViewById(R.id.cover_fragment); ViewGroup.LayoutParams params = imgvCover.getLayoutParams(); if (newConfig.orientation == Configuration.ORIENTATION_PORTRAIT) { mainContainer.setOrientation(LinearLayout.VERTICAL); if (newConfig.screenWidthDp > 0) { params.width = (int) (convertDpToPixel(newConfig.screenWidthDp) * .80); params.height = params.width; imgvCover.setLayoutParams(params); } } else { mainContainer.setOrientation(LinearLayout.HORIZONTAL); if (newConfig.screenHeightDp > 0) { params.height = (int) (convertDpToPixel(newConfig.screenHeightDp) * .40); params.width = params.height; imgvCover.setLayoutParams(params); } } }
Source:
<code>public void testListBookiesCmdReadOnly() throws Exception { assertEquals(0, shell.run(new String[] { "listbookies", "-ro" })); verifyNew(ListBookiesCommand.class, times(1)) .withArguments(same(mockListBookiesFlags)); verify(mockListBookiesCommand, times(1)) .apply(same(shell.bkConf), same(mockListBookiesFlags)); verify(mockListBookiesFlags, times(1)).readonly(true); verify(mockListBookiesFlags, times(1)).readwrite(false); <START> verify(mockListBookiesFlags, times(1)).all(true); <END> }</code><technical_language>Is this test passing? I expect 'false'</technical_language>

Target:
public void testListBookiesCmdReadOnly() throws Exception { assertEquals(0, shell.run(new String[] { "listbookies", "-ro" })); verifyNew(ListBookiesCommand.class, times(1)) .withArguments(same(mockListBookiesFlags)); verify(mockListBookiesCommand, times(1)) .apply(same(shell.bkConf), same(mockListBookiesFlags)); verify(mockListBookiesFlags, times(1)).readonly(true); verify(mockListBookiesFlags, times(1)).readwrite(false); verify(mockListBookiesFlags, times(1)).all(false); }
Source:
<code><START> private void undeployName(CommandContext ctx, String name, <END> boolean allServerGroups, String serverGroups, boolean keepContent, ModelNode headers) throws CommandException { try { ModelNode request = buildRequest(ctx, name, allServerGroups, serverGroups, keepContent, headers); final ModelNode result = ctx. getModelControllerClient().execute(request); if (!Util.isSuccess(result)) { throw new CommandException(Util.getFailureDescription(result)); } } catch (IOException e) { throw new CommandException("Failed to deploy", e); } catch (CommandFormatException ex) { throw new CommandException(ex); } }</code><technical_language>stay static</technical_language>

Target:
static void undeployName(CommandContext ctx, String name, boolean allServerGroups, String serverGroups, boolean keepContent, ModelNode headers) throws CommandException { try { ModelNode request = buildRequest(ctx, name, allServerGroups, serverGroups, keepContent, headers); final ModelNode result = ctx. getModelControllerClient().execute(request); if (!Util.isSuccess(result)) { throw new CommandException(Util.getFailureDescription(result)); } } catch (IOException e) { throw new CommandException("Failed to deploy", e); } catch (CommandFormatException ex) { throw new CommandException(ex); } }
Source:
<code>Point getLocationInPixels(int offset, boolean trailing) { computeRuns(); int length = text.length(); if (!(0 <= offset && offset <= length)) SWT.error(SWT.ERROR_INVALID_RANGE); offset = translateOffset(offset); long ptr = OS.pango_layout_get_text(layout); int byteOffset = (int) (OS.g_utf16_offset_to_pointer(ptr, offset) - ptr); int strlen = C.strlen(ptr); byteOffset = Math.min(byteOffset, strlen); PangoRectangle pos = new PangoRectangle(); OS.pango_layout_index_to_pos(layout, byteOffset, pos); int x = trailing ? pos.x + pos.width : pos.x; int y = pos.y; x = OS.PANGO_PIXELS(x); if (OS.pango_context_get_base_dir(context) == OS.PANGO_DIRECTION_RTL) { x = width() - x; } x += Math.min (indent, wrapIndent); <START> return new Point(x, OS.PANGO_PIXELS(y + getScaledVerticalIndent())); <END> }</code><technical_language>snippet374: OS.PANGO_PIXELS(y + getScaledVerticalIndent()) returns 0, expect 20. OS.PANGO_PIXELS(y) + getScakedVerticalIndent() ? least, this works for me..</technical_language>

Target:
Point getLocationInPixels(int offset, boolean trailing) { computeRuns(); int length = text.length(); if (!(0 <= offset && offset <= length)) SWT.error(SWT.ERROR_INVALID_RANGE); offset = translateOffset(offset); long ptr = OS.pango_layout_get_text(layout); int byteOffset = (int) (OS.g_utf16_offset_to_pointer(ptr, offset) - ptr); int strlen = C.strlen(ptr); byteOffset = Math.min(byteOffset, strlen); PangoRectangle pos = new PangoRectangle(); OS.pango_layout_index_to_pos(layout, byteOffset, pos); int x = trailing ? pos.x + pos.width : pos.x; int y = pos.y; x = OS.PANGO_PIXELS(x); if (OS.pango_context_get_base_dir(context) == OS.PANGO_DIRECTION_RTL) { x = width() - x; } x += Math.min (indent, wrapIndent); return new Point(x, OS.PANGO_PIXELS(y) + getScaledVerticalIndent()); }
Source:
<code>public void verifyModal() { <START> MainPage main = (MainPage) new MainPage(driver).open(); <END> CuratedContentToolModal modal = main.clickCuratedContentToolButton(); modal.verify(); }</code><technical_language>in this case avoid casting</technical_language>

Target:
public void verifyModal() { MainPage main = new MainPage(driver).open(); CuratedContentToolModal modal = main.clickCuratedContentToolButton(); Assertion.assertTrue(modal.isModalVisible()); }
Source:
<code>@Test public void filerPassesOriginatingElements() throws IOException { ClassName name1 = ClassName.create("example", "Test1"); ClassWriter test1 = ClassWriter.forClassName(name1); Element element1 = Mockito.mock(Element.class); test1.addOriginatingElement(element1); ClassName name2 = ClassName.create("example", "Test2"); ClassWriter test2 = ClassWriter.forClassName(name2); Element element2_1 = Mockito.mock(Element.class); <START> Element element2_2 = Mockito.mock(Element.class); <END> test2.addOriginatingElement(element2_1, element2_2); javaWriter.addTypeWriter(test1).addTypeWriter(test2).writeTo(filer); Path testPath1 = fsRoot.resolve(fs.getPath("example", "Test1.java")); assertThat(filer.getOriginatingElements(testPath1)).containsExactly(element1); Path testPath2 = fsRoot.resolve(fs.getPath("example", "Test2.java")); assertThat(filer.getOriginatingElements(testPath2)).containsExactly(element2_1, element2_2); }</code><technical_language>naming patterns? (I'd expect element1_1 above)</technical_language>

Target:
@Test public void filerPassesOriginatingElements() throws IOException { ClassName name1 = ClassName.create("example", "Test1"); ClassWriter test1 = ClassWriter.forClassName(name1); Element element1_1 = Mockito.mock(Element.class); test1.addOriginatingElement(element1_1); ClassName name2 = ClassName.create("example", "Test2"); ClassWriter test2 = ClassWriter.forClassName(name2); Element element2_1 = Mockito.mock(Element.class); Element element2_2 = Mockito.mock(Element.class); test2.addOriginatingElement(element2_1, element2_2); javaWriter.addTypeWriter(test1).addTypeWriter(test2).writeTo(filer); Path testPath1 = fsRoot.resolve(fs.getPath("example", "Test1.java")); assertThat(filer.getOriginatingElements(testPath1)).containsExactly(element1_1); Path testPath2 = fsRoot.resolve(fs.getPath("example", "Test2.java")); assertThat(filer.getOriginatingElements(testPath2)).containsExactly(element2_1, element2_2); }
Source:
<code>public void testHttpHeadersProperties_multipleHeaders() { Configuration config = new Configuration(); config.set(GCS_HTTP_HEADERS.getKey() + "test-header", "test-VAL"); config.set(GCS_HTTP_HEADERS.getKey() + "key-in-header", "+G2Ap33m5NVOgmXznSGTEvG0I="); GoogleCloudStorageFileSystemOptions options = GoogleHadoopFileSystemConfiguration.getGcsFsOptionsBuilder(config).build(); <START> String encryptionAlgorithm = options.getCloudStorageOptions().getEncryptionAlgorithm(); <END> assertThat(options.getCloudStorageOptions().getHttpRequestHeaders()) .containsExactly("test-header", "test-VAL", "key-in-header", "+G2Ap33m5NVOgmXznSGTEvG0I="); }</code><technical_language>Delete this line</technical_language>

Target:
public void testHttpHeadersProperties_multipleHeaders() { Configuration config = new Configuration(); config.set(GCS_HTTP_HEADERS.getKey() + "test-header", "test-VAL"); config.set(GCS_HTTP_HEADERS.getKey() + "key-in-header", "+G2Ap33m5NVOgmXznSGTEvG0I="); GoogleCloudStorageFileSystemOptions options = GoogleHadoopFileSystemConfiguration.getGcsFsOptionsBuilder(config).build(); assertThat(options.getCloudStorageOptions().getHttpRequestHeaders()) .containsExactly("test-header", "test-VAL", "key-in-header", "+G2Ap33m5NVOgmXznSGTEvG0I="); }
Source:
<code>private int getQueryThreadPoolSize() { <START> return Runtime.getRuntime().availableProcessors() / 2; <END> }</code><technical_language>return 0, 1 least...</technical_language>

Target:
private int getQueryThreadPoolSize() { return Math.max(Runtime.getRuntime().availableProcessors() / 2, 1); }
Source:
<code>private void setCurrentLimit(String type, TimestampBoundStoreEntry newEntry) { checkLimitNotDecreasing(newEntry); currentLimit = newEntry.getTimestampOrInitialValue(); <START> log.info("{} Setting cached timestamp limit to {}.", type, currentLimit); <END> }</code><technical_language>nit: prefer ... calling this method needing bracket operations</technical_language>

Target:
private void setCurrentLimit(String type, TimestampBoundStoreEntry newEntry) { checkLimitNotDecreasing(newEntry); currentLimit = newEntry.getTimestampOrValue(null); log.info("[{}] Setting cached timestamp limit to {}.", type, currentLimit); }
Source:
<code>public void push(RowMap r) throws Exception { String key = r.pkToJson(keyFormat); String value = r.toJSON(outputConfig); if ( value == null ) { inflightMessages.addMessage(r.getPosition()); BinlogPosition newPosition = inflightMessages.completeMessage(r.getPosition()); if ( newPosition != null ) { context.setPosition(newPosition); } return; } ProducerRecord<String, String> record; if (r instanceof DDLMap) { String topic = generateTopic(this.ddlTopic, r); <START> record = new ProducerRecord<>(topic, this.ddlPartitioner.kafkaPartition(r, getNumPartitions(topic)), key, value); <END> } else { String topic = generateTopic(this.topic, r); record = new ProducerRecord<>(topic, this.partitioner.kafkaPartition(r, getNumPartitions(topic)), key, value); } if ( r.isTXCommit() ) inflightMessages.addMessage(r.getPosition()); if ( !KafkaCallback.LOGGER.isDebugEnabled() ) value = null; KafkaCallback callback = new KafkaCallback(inflightMessages, r.getPosition(), r.isTXCommit(), this.context, key, value); kafka.send(record, callback); }</code><technical_language>if gonna support this feature for DDL topic (and honestly should), need rework DDLMap#getDatabase() DDLMap#getTable() -- moment currently hard-coded some defaults, fished out of ResolvedSchemaChange object</technical_language>

Target:
public void push(RowMap r) throws Exception { String key = r.pkToJson(keyFormat); String value = r.toJSON(outputConfig); if ( value == null ) { inflightMessages.addMessage(r.getPosition()); BinlogPosition newPosition = inflightMessages.completeMessage(r.getPosition()); if ( newPosition != null ) { context.setPosition(newPosition); } return; } ProducerRecord<String, String> record; if (r instanceof DDLMap) { record = new ProducerRecord<>(this.ddlTopic, this.ddlPartitioner.kafkaPartition(r, getNumPartitions(this.ddlTopic)), key, value); } else { String topic = generateTopic(this.topic, r); record = new ProducerRecord<>(topic, this.partitioner.kafkaPartition(r, getNumPartitions(topic)), key, value); } if ( r.isTXCommit() ) inflightMessages.addMessage(r.getPosition()); if ( !KafkaCallback.LOGGER.isDebugEnabled() ) value = null; KafkaCallback callback = new KafkaCallback(inflightMessages, r.getPosition(), r.isTXCommit(), this.context, key, value); kafka.send(record, callback); }
Source:
<code>private void setupServer(IntegrationMBeanExporter exporter) { String server = this.attributes.getString("server"); if (server != null && this.environment != null) { <START> server = this.environment.resolvePlaceholders(server); <END> } if (StringUtils.hasText(server)) { exporter.setServer(this.beanFactory.getBean(server, MBeanServer.class)); } else { exporter.setServer(MBeanServerFactory.createMBeanServer()); } }</code><technical_language>xml supports SpEL too</technical_language>

Target:
private void setupServer(IntegrationMBeanExporter exporter) { String server = this.attributes.getString("server"); if (server != null && this.environment != null) { server = this.environment.resolvePlaceholders(server); } if (StringUtils.hasText(server)) { MBeanServer bean = null; if (server.startsWith("#{") && server.endsWith("}")) { bean = (MBeanServer) this.resolver.evaluate(server, this.expressionContext); } else { bean = this.beanFactory.getBean(server, MBeanServer.class); } exporter.setServer(bean); } else { exporter.setServer(MBeanServerFactory.createMBeanServer()); } }
Source:
<code>public AdaptiveMetropolisSampler(final double xInitial, final double initialStepSize, final double lowerBound, final double upperBound, final double adjustmentRate, final double timeScale) { <START> if (lowerBound > upperBound) { <END> throw new IllegalArgumentException("Maximum bound must be larger than minimum bound."); } ParamUtils.isPositive(initialStepSize, "Step size must be positive."); ParamUtils.isPositive(timeScale, "Time scale must be positive."); xCurrent = xInitial; stepSize = initialStepSize; this.lowerBound = lowerBound; this.upperBound = upperBound; this.adjustmentRate = adjustmentRate; this.timeScale = timeScale; }</code><technical_language>Utils.validateArg(lowerBound < upperBound. . .)</technical_language>

Target:
public AdaptiveMetropolisSampler(final double xInitial, final double initialStepSize, final double lowerBound, final double upperBound, final double adjustmentRate, final double timeScale) { Utils.validateArg(lowerBound <= upperBound, "Maximum bound must be greater than or equal to minimum bound."); ParamUtils.isPositive(initialStepSize, "Step size must be positive."); ParamUtils.isPositive(timeScale, "Time scale must be positive."); xCurrent = xInitial; stepSize = initialStepSize; this.lowerBound = lowerBound; this.upperBound = upperBound; this.adjustmentRate = adjustmentRate; this.timeScale = timeScale; }
Source:
<code><START> public MotorControlAccelCap(Motor motor, Controller controller, int axis, double scale, double accel_cap) { super("motorControlAccelCap", motor); <END> this.motor = motor; this.controller = controller; this.axis = axis; this.scale = scale; this.accel_cap = accel_cap; this.last_speed = 0.0; last_t = System.currentTimeMillis(); LogKitten.d("MotorControl created for " + motor.getName()); }</code><technical_language>extend Commmandbase, in a name setName(name), addRequirements(motor)</technical_language>

Target:
public MotorControlAccelCap(Motor motor, Controller controller, int axis, double scale, double accel_cap) { this("MotorControlAccelCap", motor, controller, axis, scale, accel_cap); }
Source:
<code>public void setInput(IEditorInput input) { if (input instanceof CSourceNotFoundEditorInput) { isDebugElement = false; isTranslationUnit = false; Object artifact = ((CSourceNotFoundEditorInput) input).getArtifact(); if (artifact instanceof CSourceNotFoundElement) { CSourceNotFoundElement element = (CSourceNotFoundElement) artifact; missingFile = element.getFile(); launch = element.getLaunch(); context = element.getElement(); isDebugElement = true; } else if (artifact instanceof ITranslationUnit) { isTranslationUnit = true; tunit = (ITranslationUnit) artifact; IPath tuPath = tunit.getLocation(); if (tuPath != null) missingFile = tuPath.toOSString(); } else { missingFile = ""; } } super.setInput(input); <START> if (fText != null) { <END> fText.setText(getText()); } }</code><technical_language>happened syncButtons call? Is longer needed</technical_language>

Target:
public void setInput(IEditorInput input) { if (input instanceof CSourceNotFoundEditorInput) { isDebugElement = false; isTranslationUnit = false; Object artifact = ((CSourceNotFoundEditorInput) input).getArtifact(); if (artifact instanceof CSourceNotFoundElement) { CSourceNotFoundElement element = (CSourceNotFoundElement) artifact; missingFile = element.getFile(); launch = element.getLaunch(); context = element.getElement(); isDebugElement = true; } else if (artifact instanceof ITranslationUnit) { isTranslationUnit = true; tunit = (ITranslationUnit) artifact; IPath tuPath = tunit.getLocation(); if (tuPath != null) missingFile = tuPath.toOSString(); } else { missingFile = ""; } } super.setInput(input); if (fText != null) { fText.setText(getText()); } syncButtons(); }
Source:
<code>public void g_V_repeatXin_outX_timesX3X_tailX7X_count() { final Traversal<Vertex, Long> traversal = get_g_V_repeatXin_outX_timesX3X_tailX7X_count(); printTraversalForm(traversal); <START> long count = 0L; <END> if (traversal.hasNext()) { count = traversal.next(); } assertEquals(7L, count); }</code><technical_language>This is easy as: checkResults(Collections.singleList(7L), traversal) verify hasNext() == false end</technical_language>

Target:
public void g_V_repeatXin_outX_timesX3X_tailX7X_count() { final Traversal<Vertex, Long> traversal = get_g_V_repeatXin_outX_timesX3X_tailX7X_count(); printTraversalForm(traversal); checkResults(Collections.singletonList(7L), traversal); }
Source:
<code>private void throwIfPreCommitRequirementsNotMet(@Nullable LockTokenV2 commitLocksToken) { <START> Set<LockTokenV2> expiredLocks = refreshExternalAndCommitLocks(commitLocksToken); <END> if (!expiredLocks.isEmpty()) { final String baseMsg = "Required locks are no longer valid. "; String expiredLocksErrorString = getExpiredLocksErrorString(commitLocksToken, expiredLocks); TransactionLockTimeoutException ex = new TransactionLockTimeoutException(baseMsg + expiredLocksErrorString); log.error(baseMsg + "{}", expiredLocksErrorString, ex); throw ex; } preCommitValidation.check(); }</code><technical_language>I expect this block part of preCommitValidation.check();</technical_language>

Target:
private void throwIfPreCommitRequirementsNotMet(@Nullable LockTokenV2 commitLocksToken) { throwIfImmutableTsOrCommitLocksExpired(commitLocksToken); advisoryLockCheck.throwIfLocksExpired(); }
Source:
<code>private void doRefreshData() throws Exception { if ( treeState.get() == TreeState.STARTED ) { if ( dataIsCompressed ) { if (createZkWatches) { client.getData().decompressed().usingWatcher(this).inBackground(this).forPath(path); } else { client.getData().decompressed().inBackground(this).forPath(path); <START> } <END> } else { if (createZkWatches) { client.getData().usingWatcher(this).inBackground(this).forPath(path); } else { client.getData().inBackground(this).forPath(path); } } } }</code><technical_language>feel this a cleaner a maybeWatch() helper in class, e.g. maybeWatch(client.getData().decompressed()).inBackground(this).forPath(path) throughout. put inBackground(this) helper</technical_language>

Target:
private void doRefreshData() throws Exception { if ( treeState.get() == TreeState.STARTED ) { if ( dataIsCompressed ) { maybeWatch(client.getData().decompressed()).forPath(path); } else { maybeWatch(client.getData()).forPath(path); } } }
Source:
<code>private void addAuditLogForPartialVMs() { StringBuilder missingEntities = new StringBuilder(); if (getParameters().isAllowPartialImport() && !failedDisksToImportForAuditLog.isEmpty()) { missingEntities.append("Disks: "); missingEntities.append(StringUtils.join(failedDisksToImportForAuditLog.values(), ", ") + " "); } if (!missingUsers.isEmpty()) { missingEntities.append("Users: "); missingEntities.append(StringUtils.join(missingUsers, ", ") + " "); } if (!missingRoles.isEmpty()) { missingEntities.append("Roles: "); missingEntities.append(StringUtils.join(missingRoles, ", ") + " "); } if (missingEntities.length() > 0) { addCustomValue("MissingEntities", missingEntities.toString()); auditLogDirector.log(this, <START> AuditLogType.IMPORTEXPORT_PARTIAL_VM_MISSING_ENTITIES); <END> } }</code><technical_language>this IMPORTEXPORT_PARTIAL_TEMPLATE_MISSING_ENTITIES</technical_language>

Target:
private void addAuditLogForPartialVMs() { StringBuilder missingEntities = new StringBuilder(); if (getParameters().isAllowPartialImport() && !failedDisksToImportForAuditLog.isEmpty()) { missingEntities.append("Disks: "); missingEntities.append(StringUtils.join(failedDisksToImportForAuditLog.values(), ", ") + " "); } if (!missingUsers.isEmpty()) { missingEntities.append("Users: "); missingEntities.append(StringUtils.join(missingUsers, ", ") + " "); } if (!missingRoles.isEmpty()) { missingEntities.append("Roles: "); missingEntities.append(StringUtils.join(missingRoles, ", ") + " "); } if (missingEntities.length() > 0) { addCustomValue("MissingEntities", missingEntities.toString()); auditLogDirector.log(this, AuditLogType.IMPORTEXPORT_PARTIAL_TEMPLATE_MISSING_ENTITIES); } }
Source:
<code>private void setInputTypePassword(EditText editText) { <START> editText.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD); <END> }</code><technical_language>Mega minor: for of methods, consider changing flags matter, InputType.TYPE_TEXT_VARIATION_PASSWORD InputType.TYPE_TEXT_VARIATION_VISIBLE_PASS WORD, bitmasking getInputType()</technical_language>

Target:
private void setInputTypePassword(EditText editText) { editText.setInputType((editText.getInputType() & ~InputType.TYPE_MASK_VARIATION) | InputType.TYPE_TEXT_VARIATION_PASSWORD); }
Source:
<code>private JSONArray formatEventsAndInitialize() { ConcurrentHashMap<List<StackTraceElement>, MissingClassEvent> toReport = MissingClassTelemetry.events.getEventsAndClean(); <START> if (LOGGER.isLoggable(Level.FINE)) LOGGER.fine("Cleaned events for missing classes"); <END> return formatEvents(toReport); }</code><technical_language>I tend brackets here</technical_language>

Target:
private JSONArray formatEventsAndInitialize() { ConcurrentHashMap<List<StackTraceElement>, MissingClassEvent> toReport = MissingClassTelemetry.events.getEventsAndClean(); if (LOGGER.isLoggable(Level.FINE)) { LOGGER.fine("Cleaned events for missing classes"); } return formatEvents(toReport); }
Source:
<code>private void broadcastToNoteBindedInterpreter(String interpreterGroupId, Message m) { Notebook notebook = notebook(); List<Note> notes = notebook.getAllNotes(); for (Note note : notes) { List<String> ids = notebook.getInterpreterFactory().getInterpreters(note.getId()); for (String id : ids) { if (id.equals(interpreterGroupId)) { broadcast(note.getId(), m); <START> broadcastToWatchers(note.getId(), StringUtils.EMPTY, m); <END> } } } }</code><technical_language>broadcastToWatchers() is called of broadcast(String noteId, Message m) in line already. it</technical_language>

Target:
private void broadcastToNoteBindedInterpreter(String interpreterGroupId, Message m) { Notebook notebook = notebook(); List<Note> notes = notebook.getAllNotes(); for (Note note : notes) { List<String> ids = notebook.getInterpreterFactory().getInterpreters(note.getId()); for (String id : ids) { if (id.equals(interpreterGroupId)) { broadcast(note.getId(), m); } } } }
Source:
<code>public void notifyTableChanged(TableName tableName, long updateTime) { LOG.debug("Table changed: {}, at {}", tableName.getNotEmptyDbTable(), updateTime); List<CacheEntry> entriesToInvalidate = null; rwLock.writeLock().lock(); try { <START> String key = (tableName.getNotEmptyDbTable().toLowerCase()); <END> Set<CacheEntry> entriesForTable = tableToEntryMap.get(key); if (entriesForTable != null) { entriesToInvalidate = new ArrayList<>(entriesForTable); } if (entriesToInvalidate != null) { for (CacheEntry entry : entriesToInvalidate) { if (entry.getQueryInfo().getQueryTime() <= updateTime) { removeEntry(entry); } } } } finally { rwLock.writeLock().unlock(); } }</code><technical_language>want consider remove "toLowerCase" calls;and instead a contract for tablenames; enforced time tablename is created</technical_language>

Target:
public void notifyTableChanged(TableName tableName, long updateTime) { LOG.debug("Table changed: {}, at {}", tableName, updateTime); List<CacheEntry> entriesToInvalidate = null; rwLock.writeLock().lock(); try { String key = (tableName.getNotEmptyDbTable()); Set<CacheEntry> entriesForTable = tableToEntryMap.get(key); if (entriesForTable != null) { entriesToInvalidate = new ArrayList<>(entriesForTable); } if (entriesToInvalidate != null) { for (CacheEntry entry : entriesToInvalidate) { if (entry.getQueryInfo().getQueryTime() <= updateTime) { removeEntry(entry); } } } } finally { rwLock.writeLock().unlock(); } }