auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public Relationship byTypeValue(final String typeValue){ if(typeValue==null) { return null; } Relationship rel = null; List<Map<String, Object>> results = new ArrayList<Map<String, Object>>(); try { final DotConnect dc = new DotConnect(); dc.setSQL(sql.FIND_BY_TYPE_VALUE); dc.addParam(typeValue.toLowerCase()); results = dc.loadObjectResults(); if (results.size() == 0) { return rel; } <START> rel = new DbRelationshipTransformer(results).from(); <END> if(rel!= null && InodeUtils.isSet(rel.getInode())){ cache.putRelationshipByInode(rel); } } catch (DotDataException e) { Logger.error(this,"Error getting relationships with typeValue: " + typeValue.toLowerCase(),e); } return rel; }</code><technical_language>rename relationship</technical_language>

Target:
public Relationship byTypeValue(final String typeValue){ if(typeValue==null) { return null; } Relationship relationship = null; List<Map<String, Object>> results = new ArrayList<Map<String, Object>>(); try { final DotConnect dc = new DotConnect(); dc.setSQL(sql.FIND_BY_TYPE_VALUE); dc.addParam(typeValue.toLowerCase()); results = dc.loadObjectResults(); if (results.size() == 0) { return relationship; } relationship = new DbRelationshipTransformer(results).from(); if(relationship!= null && InodeUtils.isSet(relationship.getInode())){ cache.putRelationshipByInode(relationship); } } catch (DotDataException e) { Logger.error(this,"Error getting relationships with typeValue: " + typeValue.toLowerCase(),e); } return relationship; }
Source:
<code>void close() throws StoreException { long startTimeInMs = time.milliseconds(); try { persistor.write(); <START> if (persistorTask != null) { <END> persistorTask.cancel(false); } if (hardDeleter != null) { try { hardDeleter.shutdown(); } catch (Exception e) { logger.error("Index : " + dataDir + " error while persisting cleanup token ", e); } } try { cleanShutdownFile.createNewFile(); } catch (IOException e) { logger.error("Index : " + dataDir + " error while creating clean shutdown file ", e); } } finally { metrics.indexShutdownTimeInMs.update(time.milliseconds() - startTimeInMs); } }</code><technical_language>Move cancel persistor.write(). persistor.write() is synchronized, this ensure , if a background persist is in progress, completed close() method is completed</technical_language>

Target:
void close() throws StoreException { long startTimeInMs = time.milliseconds(); try { if (persistorTask != null) { persistorTask.cancel(false); } persistor.write(); if (hardDeleter != null) { try { hardDeleter.shutdown(); } catch (Exception e) { logger.error("Index : " + dataDir + " error while persisting cleanup token ", e); } } try { cleanShutdownFile.createNewFile(); } catch (IOException e) { logger.error("Index : " + dataDir + " error while creating clean shutdown file ", e); } } finally { metrics.indexShutdownTimeInMs.update(time.milliseconds() - startTimeInMs); } }
Source:
<code>private void readWitness() <START> { <END> witnesses = new ArrayList<TransactionWitness>(inputs.size()); for(int i = 0 ; i < inputs.size(); i++) { long pushCount = readVarInt(); TransactionWitness witness = new TransactionWitness((int)pushCount); witnesses.add(witness); optimalEncodingMessageSize += VarInt.sizeOf(pushCount); for(int y = 0; y < pushCount; y++) { long pushSize = readVarInt(); optimalEncodingMessageSize += VarInt.sizeOf(pushSize) + pushSize; byte[] push = readBytes((int)pushSize); witness.setPush(y, push); } } }</code><technical_language>'{' end of line</technical_language>

Target:
private void readWitness() { witnesses = new ArrayList<TransactionWitness>(inputs.size()); for (int i = 0; i < inputs.size(); i++) { long pushCount = readVarInt(); TransactionWitness witness = new TransactionWitness((int) pushCount); setWitness(i, witness); optimalEncodingMessageSize += VarInt.sizeOf(pushCount); for (int y = 0; y < pushCount; y++) { long pushSize = readVarInt(); optimalEncodingMessageSize += VarInt.sizeOf(pushSize) + pushSize; byte[] push = readBytes((int) pushSize); witness.setPush(y, push); } } }
Source:
<code>private int readAllNulls(int[] positions, int positionCount) throws IOException { presentStream.skip(positions[positionCount - 1]); if (nonDeterministicFilter) { outputPositionCount = 0; for (int i = 0; i < positionCount; i++) { <START> if (filter.testNull()) { <END> outputPositionCount++; } } } else if (nullsAllowed) { outputPositionCount = positionCount; allNulls = true; } else { outputPositionCount = 0; } return positions[positionCount - 1] + 1; }</code><technical_language>@bhhari @sayhar Sahar this is buggy. fixes in #13208</technical_language>

Target:
private int readAllNulls(int[] positions, int positionCount) throws IOException { presentStream.skip(positions[positionCount - 1]); if (nonDeterministicFilter) { outputPositionCount = 0; for (int i = 0; i < positionCount; i++) { if (filter.testNull()) { outputPositionCount++; } else { outputPositionCount -= filter.getPrecedingPositionsToFail(); i += filter.getSucceedingPositionsToFail(); } } } else if (nullsAllowed) { outputPositionCount = positionCount; } else { outputPositionCount = 0; } allNulls = true; return positions[positionCount - 1] + 1; }
Source:
<code><START> boolean isListForRepeatedAnnotation(AnnotationMirror a) { <END> if (!isListForRepeatedAnnotationCache.containsKey(a)) { isListForRepeatedAnnotationCache.put(a, isListForRepeatedAnnotationImplementation(a)); } return isListForRepeatedAnnotationCache.get(a); }</code><technical_language>this method private protected</technical_language>

Target:
private boolean isListForRepeatedAnnotation(AnnotationMirror a) { DeclaredType annotationType = a.getAnnotationType(); Boolean resultObject = isListForRepeatedAnnotationCache.get(annotationType); if (resultObject != null) { return resultObject; } boolean result = isListForRepeatedAnnotationImplementation(annotationType); isListForRepeatedAnnotationCache.put(annotationType, result); return result; }
Source:
<code>private Processor getProcessor(Workspace workspace) { Properties beanProperties = new BeanProperties(); beanProperties.put("project", project); beanProperties.put("settings", session.getSettings()); <START> Properties mavenProperties = new Properties(beanProperties); <END> mavenProperties.putAll(project.getProperties()); return processor = new Processor(workspace, mavenProperties, false); }</code><technical_language>I this solves problem, removing processor field this object? If dangerous reuse it, stored necessarily elsewhere, surely store for access</technical_language>

Target:
private Processor getProcessor(Workspace workspace) { Properties beanProperties = new BeanProperties(); beanProperties.put("project", project); beanProperties.put("settings", session.getSettings()); Properties mavenProperties = new Properties(beanProperties); mavenProperties.putAll(project.getProperties()); return new Processor(workspace, mavenProperties, false); }
Source:
<code>private SingleResultCallback<List<RawBsonDocument>> convertResultsCallback(final SingleResultCallback<List<T>> callback) { return errorHandlingCallback(new SingleResultCallback<List<RawBsonDocument>>() { @Override public void onResult(final List<RawBsonDocument> rawDocuments, final Throwable t) { if (t != null) { callback.onResult(null, t); } else if (rawDocuments != null) { List<T> results = new ArrayList<T>(); for (RawBsonDocument rawDocument : rawDocuments) { if (!rawDocument.containsKey("_id")) { callback.onResult( null, new MongoChangeStreamException( "Cannot provide resume functionality when the resume token is missing." ) ); return; } <START> results.add(rawDocument.decode(changeStreamOperation.getDecoder())); <END> } try { resumeToken = rawDocuments.get(rawDocuments.size() - 1).getDocument("_id"); callback.onResult(results, null); } catch (Exception e) { callback.onResult(null, e); } } else { callback.onResult(null, null); } } }, LOGGER); }</code><technical_language>I this decode method needs in try / catch</technical_language>

Target:
private SingleResultCallback<List<RawBsonDocument>> convertResultsCallback(final SingleResultCallback<List<T>> callback) { return errorHandlingCallback(new SingleResultCallback<List<RawBsonDocument>>() { @Override public void onResult(final List<RawBsonDocument> rawDocuments, final Throwable t) { if (t != null) { callback.onResult(null, t); } else if (rawDocuments != null) { List<T> results = new ArrayList<T>(); try { for (RawBsonDocument rawDocument : rawDocuments) { if (!rawDocument.containsKey("_id")) { callback.onResult( null, new MongoChangeStreamException( "Cannot provide resume functionality when the resume token is missing." ) ); return; } results.add(rawDocument.decode(changeStreamOperation.getDecoder())); } resumeToken = rawDocuments.get(rawDocuments.size() - 1).getDocument("_id"); callback.onResult(results, null); } catch (Exception e) { callback.onResult(null, e); } } else { callback.onResult(null, null); } } }, LOGGER); }
Source:
<code>public boolean isHighPriority() { <START> if (getFirstHeader(highPriorityTag)!=null && getFirstHeader(highPriorityTag).equals(xPriorityContent)) { <END> return true; } return false; }</code><technical_language>check if xPriorityContent.equals(tag), return false if header is null</technical_language>

Target:
public boolean isHighPriority() { return X_PRIORITY_CONTENT.equals(getFirstHeader(MimeHeader.HEADER_HIGH_PRIORITY)); }
Source:
<code>public int getCount() { <START> return known ? count : Integer.MAX_VALUE; <END> }</code><technical_language>this easily lead overflow if is done this number. fatal (better), return 1M here</technical_language>

Target:
public int getCount() { if (known) { return count; } else { throw new IllegalStateException( "Can't get superstep count when it's unknown"); } }
Source:
<code>private void refreshGeoRepDataInCluster(VDSGroup cluster) { if (!supportsGlusterGeoRepFeature(cluster)) { return; } List<GlusterGeoRepSession> sessions = getSessionsForCluster(cluster); <START> for (GlusterGeoRepSession session: sessions) { <END> session.setMasterVolumeId(getVolumeId(cluster, session.getMasterVolumeName())); updateGeoRepStatus(session); if (getGeoRepDao().getById(session.getId()) == null) { getGeoRepDao().save(session); } else { getGeoRepDao().updateSession(session); } getGeoRepDao().saveOrUpdateDetailsInBatch(session.getSessionDetails()); } }</code><technical_language>NPE if getSessionsForCluster() returns null</technical_language>

Target:
private void refreshGeoRepDataInCluster(VDSGroup cluster) { if (!supportsGlusterGeoRepFeature(cluster)) { return; } List<GlusterGeoRepSession> sessions = getSessionsForCluster(cluster); if (sessions == null) { log.debugFormat("No sessions returned for cluster {0} from CLI, nothing to do", cluster.getName()); return; } for (GlusterGeoRepSession session: sessions) { session.setMasterVolumeId(getVolumeId(cluster, session.getMasterVolumeName())); updateGeoRepStatus(session); if (getGeoRepDao().getById(session.getId()) == null) { getGeoRepDao().save(session); } else { getGeoRepDao().updateSession(session); } getGeoRepDao().saveOrUpdateDetailsInBatch(session.getSessionDetails()); } }
Source:
<code>public AttributeDefinition getAttributeDefinition() { AttributeDefinition attr = new AttributeDefinition(); attr.setNamespace(AttributesManager.NS_RESOURCE_ATTR_DEF); attr.setFriendlyName("projectsBasePath"); <START> attr.setDisplayName("projectsBasePath"); <END> attr.setType(String.class.getName()); attr.setDescription("Path to base directory of projects."); return attr; }</code><technical_language>Please, text "Projects base path" (Name fixed sending this pool request) thank you</technical_language>

Target:
public AttributeDefinition getAttributeDefinition() { AttributeDefinition attr = new AttributeDefinition(); attr.setNamespace(AttributesManager.NS_RESOURCE_ATTR_DEF); attr.setFriendlyName("projectsBasePath"); attr.setDisplayName("Projects base path"); attr.setType(String.class.getName()); attr.setDescription("Path to base directory of projects."); return attr; }
Source:
<code>private Duration(long amount, TimeUnit timeUnit, boolean forever) { if (!forever) { if (amount <= 0) { throw new IllegalArgumentException("amount must be greater than zero: " + amount); } if (timeUnit == null) { throw new NullPointerException("TimeUnit must not be null"); } switch (timeUnit) { case MICROSECONDS: <START> case NANOSECONDS: { <END> throw new IllegalArgumentException("TimeUnit must be equal or lower granularity than " + TimeUnit.MILLISECONDS.name() + ". Specified value was " + timeUnit.name()); } default: { break; } } } this.amount = amount; this.timeUnit = timeUnit; }</code><technical_language>I a fan of restriction (and in 107 neither), 1,000,000 TimeUnit.NANOSECONDS acceptable represented in TimeUnit.MILLISECONDS ? Long story short, do limit this here. Store 's concern decide deals small values</technical_language>

Target:
private Duration(long amount, TimeUnit timeUnit, boolean forever) { if (!forever) { if (amount < 0) { throw new IllegalArgumentException("amount must be greater than or equal to zero: " + amount); } if (timeUnit == null) { throw new NullPointerException("TimeUnit must not be null"); } } this.amount = amount; this.timeUnit = timeUnit; }
Source:
<code>private void showContent() { contentRootLayoutHiding.setVisibility(View.VISIBLE); <START> showDescriptionOnLoad = PreferenceManager.getDefaultSharedPreferences(activity) <END> .getBoolean(getString(R.string.always_expand_description_key), false); if (showDescriptionOnLoad) { toggleTitleAndDescription(); } }</code><technical_language>this variable here, a local field suggestion final boolean showDescriptionOnLoad = PreferenceManager.getDefaultSharedPreferences(activity)</technical_language>

Target:
private void showContent() { contentRootLayoutHiding.setVisibility(View.VISIBLE); final boolean showDescriptionOnLoad = PreferenceManager.getDefaultSharedPreferences(activity) .getBoolean(getString(R.string.always_expand_description_key), false); if (showDescriptionOnLoad) { toggleTitleAndDescription(); } }
Source:
<code>public Position getPosition(IDocument document) { JsonLocation location = getStart() != null ? getStart() : getLocation(); if (location != null) { int startLine = location.getLineNr() - 1; int offset = 0; try { offset = document.getLineOffset(startLine) + location.getColumnNr() + Strings.nullToEmpty(getProperty()).length(); } catch (BadLocationException e) { return new Position(0); } <START> return new Position(Math.max(0, offset), 0); <END> } return new Position(0); }</code><technical_language>length (the parameter) is null navigation work Quick Outline basically useless. I provided a simple fix in commit d90ea00390076f38d982d68df1adb37623698b2e selects entire line of element: <img width="680" alt="screen shot 2016-08-11 4 21 53 pm" src="<LINK_0>"> @ghillairet please review update fix update if needed</technical_language>

Target:
public Position getPosition(IDocument document) { JsonLocation location = getStart() != null ? getStart() : getLocation(); if (location != null) { int startLine = location.getLineNr() - 1; int offset = 0; int length = 0; try { offset = document.getLineOffset(startLine); length = document.getLineOffset(startLine + 1) - offset; } catch (BadLocationException e) { return new Position(0); } return new Position(Math.max(0, offset), length); } return new Position(0); }
Source:
<code>public static <K extends Comparable<? super K>, V> TreeMap<K, V> of(K key, V value) { return of((Comparator<? super K> & Serializable) K::compareTo, Tuple.of(key, value)); <START> } <END></code><technical_language>Hi, please move this method next method (of(Comparator, Tuple2)) add additional method java public static <K, V> TreeMap<K, V> of(Comparator<? super K> keyComparator, key, V value) { ... }</technical_language>

Target:
public static <K extends Comparable<? super K>, V> TreeMap<K, V> of(K key, V value) { return of((Comparator<? super K> & Serializable) K::compareTo, key, value); }
Source:
<code>void disconnect() { if (subscriberStreamObserver != null) { subscriberStreamObserver.onCompleted(); } commandExecutor.shutdown(); try { if (!commandExecutor.awaitTermination(5, TimeUnit.SECONDS)) { logger.warn("Awaited Command Bus termination for 5 seconds. Wait period extended by 30 seconds."); } if (!commandExecutor.awaitTermination(20, TimeUnit.SECONDS)) { <START> logger.warn("Awaited Command Bus termination for 35 seconds. Will shutdown forcefully."); <END> commandExecutor.shutdownNow(); } } catch (InterruptedException e) { logger.warn("Awaiting termination of Command Bus got interrupted. Will shutdown immediately", e); commandExecutor.shutdownNow(); Thread.currentThread().interrupt(); } running = false; }</code><technical_language>math skills, 5 + 20 != 35 ;-)</technical_language>

Target:
void disconnect() { if (subscriberStreamObserver != null) { subscriberStreamObserver.onCompleted(); } commandExecutor.shutdown(); try { if (!commandExecutor.awaitTermination(5, TimeUnit.SECONDS)) { logger.warn("Awaited Command Bus termination for 5 seconds. Wait period extended by 30 seconds."); } if (!commandExecutor.awaitTermination(30, TimeUnit.SECONDS)) { logger.warn("Awaited Command Bus termination for 35 seconds. Will shutdown forcefully."); commandExecutor.shutdownNow(); } } catch (InterruptedException e) { logger.warn("Awaiting termination of Command Bus got interrupted. Will shutdown immediately", e); commandExecutor.shutdownNow(); Thread.currentThread().interrupt(); } running = false; }
Source:
<code>public static Timeline createTimeline( final String eventType, final int order, final Storage storage, final String topic, final Date createdAt) { final Timeline timeline = new Timeline(eventType, order, storage, topic, createdAt); <START> timeline.setId(UUID.randomUUID()); <END> return timeline; }</code><technical_language>uuidService</technical_language>

Target:
public static Timeline createTimeline( final String eventType, final int order, final Storage storage, final String topic, final Date createdAt) { final Timeline timeline = new Timeline(eventType, order, storage, topic, createdAt); timeline.setId(new UUIDGenerator().randomUUID()); return timeline; }
Source:
<code>private String getRelatedContentESQuery(Contentlet contentlet, Relationship rel) { <START> boolean isSameStructRelationship = FactoryLocator.getRelationshipFactory().sameParentAndChild(rel); <END> String q = ""; if(isSameStructRelationship) { q = "+type:content +(" + rel.getRelationTypeValue() + "-parent:" + contentlet.getIdentifier() + " " + rel.getRelationTypeValue() + "-child:" + contentlet.getIdentifier() + ") "; if(!InodeUtils.isSet(contentlet.getIdentifier())){ q = "+type:content +(" + rel.getRelationTypeValue() + "-parent:" + "0 " + rel.getRelationTypeValue() + "-child:" + "0 ) "; } } else { q = "+type:content +" + rel.getRelationTypeValue() + ":" + contentlet.getIdentifier(); if(!InodeUtils.isSet(contentlet.getIdentifier())){ q = "+type:content +" + rel.getRelationTypeValue() + ":" + "0"; } } return q; }</code><technical_language>set final</technical_language>

Target:
private String getRelatedContentESQuery(Contentlet contentlet, Relationship rel) { final boolean isSameStructRelationship = FactoryLocator.getRelationshipFactory() .sameParentAndChild(rel); String q; if(isSameStructRelationship) { q = "+type:content +(" + rel.getRelationTypeValue() + "-parent:" + contentlet.getIdentifier() + " " + rel.getRelationTypeValue() + "-child:" + contentlet.getIdentifier() + ") "; if(!InodeUtils.isSet(contentlet.getIdentifier())){ q = "+type:content +(" + rel.getRelationTypeValue() + "-parent:" + "0 " + rel.getRelationTypeValue() + "-child:" + "0 ) "; } } else { q = "+type:content +" + rel.getRelationTypeValue() + ":" + contentlet.getIdentifier(); if(!InodeUtils.isSet(contentlet.getIdentifier())){ q = "+type:content +" + rel.getRelationTypeValue() + ":" + "0"; } } return q; }
Source:
<code>private void init() { RStudioGinjector.INSTANCE.injectMembers(this); <START> docDisplay_.addSaveCompletedHandler((SaveFileEvent event) -> { <END> discoverPackageDependencies(); }); }</code><technical_language>Is a reason do this save open? scenario is opening a .R file packages references. helpful necessary add install prompts editing session, slow a lot save. If save, happening manual save (not autosave)</technical_language>

Target:
private void init() { RStudioGinjector.INSTANCE.injectMembers(this); docDisplay_.addSaveCompletedHandler((SaveFileEvent event) -> { if (!event.isAutosave()) discoverPackageDependencies(); }); events_.addHandler(AvailablePackagesReadyEvent.TYPE, (AvailablePackagesReadyEvent event) -> { discoverPackageDependencies(); }); }
Source:
<code>private void markDelivered(InboxMessage message) { <START> changeStatus(message, InboxMessageStatus.DELIVERED); <END> deliveredMessages.recordDelivered(message); }</code><technical_language>Please add static imports for enum constants</technical_language>

Target:
private void markDelivered(InboxMessage message) { changeStatus(message, DELIVERED); deliveredMessages.recordDelivered(message); }
Source:
<code>private void setProperties(URL url, Properties properties) { putPropertyIfAbsent(url, properties, NAMESPACE); putPropertyIfAbsent(url, properties, NACOS_NAMING_LOG_NAME); String endpoint = url.getParameter(ENDPOINT); if (StringUtils.isNotEmpty(endpoint)) { if (endpoint.contains(":")) { int index = endpoint.lastIndexOf(":"); properties.put(ENDPOINT, endpoint.substring(0, index)); <START> properties.put(ENDPOINT_PORT, endpoint.substring(index + 1)); <END> }else{ putPropertyIfAbsent(url, properties, ENDPOINT); } } putPropertyIfAbsent(url, properties, ACCESS_KEY); putPropertyIfAbsent(url, properties, SECRET_KEY); putPropertyIfAbsent(url, properties, CLUSTER_NAME); }</code><technical_language>is recommended put method of parsing host port NetUtils.java</technical_language>

Target:
private void setProperties(URL url, Properties properties) { putPropertyIfAbsent(url, properties, NAMESPACE); putPropertyIfAbsent(url, properties, NACOS_NAMING_LOG_NAME); String endpoint = url.getParameter(ENDPOINT); String[] hostAndPort = NetUtils.getHostAndPort(endpoint); if (hostAndPort[1] == null) { properties.put(ENDPOINT, hostAndPort[0]); }else{ properties.put(ENDPOINT, hostAndPort[0]); properties.put(ENDPOINT_PORT, hostAndPort[1]); } putPropertyIfAbsent(url, properties, ACCESS_KEY); putPropertyIfAbsent(url, properties, SECRET_KEY); putPropertyIfAbsent(url, properties, CLUSTER_NAME); }
Source:
<code>public PartitionedQueryQueue pickQueue() { while (true) { try { <START> final int pick = random.nextInt(queues.size()); <END> final PartitionedQueryQueue queue = queues.get(pick); return queue; } catch (final IllegalArgumentException e) { } } }</code><technical_language>I this is okay, is iteration here</technical_language>

Target:
public PartitionedQueryQueue pickQueue() { while (true) { try { final int pick = random.nextInt(queues.size()); final PartitionedQueryQueue queue = queues.get(pick); return queue; } catch (final IllegalArgumentException e) { return null; } } }
Source:
<code><START> public Map<String, AbstractDefinition> getTableDefinitionMap() { <END> return tableDefinitionMap; }</code><technical_language>this TableDefinition AbstractDefinition</technical_language>

Target:
public Map<String, TableDefinition> getTableDefinitionMap() { return tableDefinitionMap.entrySet() .stream() .collect(Collectors.toMap(Map.Entry::getKey, e -> (TableDefinition) e.getValue())); }
Source:
<code>public void testAuditLoggerWithCreateFlag() throws IOException { final Configuration conf = new HdfsConfiguration(); final MiniDFSCluster cluster = new MiniDFSCluster.Builder(conf).build(); LogCapturer auditlog = LogCapturer.captureLogs(FSNamesystem.auditLog); try { cluster.waitClusterUp(); auditlog.clearOutput(); final FileSystem fs = cluster.getFileSystem(); final Path p = new Path("/debug.log"); FSDataOutputStream stm = fs.create(p); <START> assertTrue(auditlog.getOutput().contains("create(options")); <END> auditlog.clearOutput(); stm.close(); stm = fs.append(p); assertTrue(auditlog.getOutput().contains("append(options")); stm.close(); auditlog.clearOutput(); } finally { cluster.shutdown(); } }</code><technical_language>test a more cases? e.g., flag, check content of flag is logged correctly</technical_language>

Target:
public void testAuditLoggerWithCreateFlag() throws IOException { final Configuration conf = new HdfsConfiguration(); final MiniDFSCluster cluster = new MiniDFSCluster.Builder(conf).build(); LogCapturer auditlog = LogCapturer.captureLogs(FSNamesystem.auditLog); try { cluster.waitClusterUp(); auditlog.clearOutput(); final FileSystem fs = cluster.getFileSystem(); final Path p = new Path("/debug.log"); FSDataOutputStream stm = fs.create(p, false); assertTrue(auditlog.getOutput().contains(STR_AUDIT_CREATE_NOOVERRITE)); auditlog.clearOutput(); stm.close(); stm = fs.create(p, true); assertTrue(auditlog.getOutput().contains(STR_AUDIT_CREATE_OVERRITE)); auditlog.clearOutput(); stm.close(); stm = fs.create(p); assertTrue(auditlog.getOutput().contains(STR_AUDIT_CREATE_OVERRITE)); auditlog.clearOutput(); stm.close(); stm = fs.append(p); assertTrue(auditlog.getOutput().contains(STR_AUDIT_APPEND)); stm.close(); auditlog.clearOutput(); } finally { cluster.shutdown(); } }
Source:
<code>private void lockDown() throws Exception { GlobalMatrixAuthorizationStrategy auth = new GlobalMatrixAuthorizationStrategy(); j.jenkins.setAuthorizationStrategy(auth); j.jenkins.setCrumbIssuer(null); <START> HudsonPrivateSecurityRealm realm = new HudsonPrivateSecurityRealm(false); <END> j.jenkins.setSecurityRealm(realm); User user = realm.createAccount("John Smith", "password"); user.save(); auth.add(Jenkins.ADMINISTER, user.getId()); }</code><technical_language>is a security realm mock in test harness prepared for kinds of is a bit easier/cleaner use</technical_language>

Target:
private void lockDown() throws Exception { SecurityRealm securityRealm = j.createDummySecurityRealm(); j.getInstance().setSecurityRealm(securityRealm); GlobalMatrixAuthorizationStrategy authorizationStrategy = new GlobalMatrixAuthorizationStrategy(); authorizationStrategy.add(Hudson.READ, "authenticated"); j.getInstance().setAuthorizationStrategy(authorizationStrategy); }
Source:
<code>public ChannelPipeline getPipeline() throws Exception { ChannelPipeline pipeline = pipeline(); pipeline.addLast("decoder", new HttpRequestDecoder()); <START> pipeline.addLast("aggregator", new HttpChunkAggregator(1048576)); <END> pipeline.addLast("encoder", new HttpResponseEncoder()); pipeline.addLast("deflater", new HttpContentCompressor()); pipeline.addLast("handler", new CoordinatorAdminRequestHandler(storeClientConfigs)); return pipeline; }</code><technical_language>declaring this 1048576 MAX_AGGREGATE_SIZE here</technical_language>

Target:
public ChannelPipeline getPipeline() throws Exception { ChannelPipeline pipeline = pipeline(); pipeline.addLast("decoder", new HttpRequestDecoder()); pipeline.addLast("aggregator", new HttpChunkAggregator(MAX_AGGREGATE_SIZE)); pipeline.addLast("encoder", new HttpResponseEncoder()); pipeline.addLast("deflater", new HttpContentCompressor()); pipeline.addLast("handler", new CoordinatorAdminRequestHandler(storeClientConfigs)); return pipeline; }
Source:
<code>public void visitError(Node node, String message) { <START> errors.add(String.format("[%s] - %s", node.getLocation().toString(), message)); <END> }</code><technical_language>Again, prefer String.valueOf(previousDecl.getLocation()) getLocation return null</technical_language>

Target:
public void visitError(Node node, String message) { errors.add(String.format("[%s] - %s", String.valueOf(node.getLocation()), message)); }
Source:
<code>protected boolean initializeMatchingFrame(SearchPlanExecutor nextPlan) { frame = new MatchingFrame(nextPlan.getVariableMapping().size()); parametersOfFrameView = new VolatileModifiableMaskedTuple(frame, <START> TupleMask.fromSelectedIndices(frame.getSize(), <END> nextPlan.getParameterIndices())); for (int i = 0; i < parameterSeedMask.getSize(); i++) { int index = parameterSeedMask.indices[i]; Object valueToSet = parameterValues.get(i); if (valueToSet != null) { Object oldValue = parametersOfFrameView.get(index); if (oldValue == null) { parametersOfFrameView.set(index, valueToSet); } else if (!Objects.equals(valueToSet, oldValue)) { return false; } } } return true; }</code><technical_language>this mask precomputed in plan</technical_language>

Target:
protected boolean initializeMatchingFrame(SearchPlanExecutor nextPlan) { frame = new MatchingFrame(nextPlan.getVariableMapping().size()); parametersOfFrameView = new VolatileModifiableMaskedTuple(frame, nextPlan.getParameterMask()); for (int i = 0; i < parameterSeedMask.getSize(); i++) { int index = parameterSeedMask.indices[i]; Object valueToSet = parameterValues.get(i); if (valueToSet != null) { Object oldValue = parametersOfFrameView.get(index); if (oldValue == null) { parametersOfFrameView.set(index, valueToSet); } else if (!Objects.equals(valueToSet, oldValue)) { return false; } } } return true; }
Source:
<code>public List<Marker> getMarkersByMapId(final Integer mapId) throws MiddlewareQueryException { <START> List<Marker> dataValues = new ArrayList<>(); <END> if (null == mapId) { return dataValues; } try { SQLQuery query = this.getSession().createSQLQuery(MarkerDAO.GET_MARKERS_BY_MAP_ID); query.setParameter("map_id", mapId); List results = query.list(); for (Object o : results) { Object[] result = (Object[]) o; if (result != null) { dataValues.add(this.convertToMarker(result)); } } return dataValues; } catch (HibernateException e) { this.logAndThrowException("Error with getMarkersByMapId() query from Marker: " + e.getMessage(), e); } return dataValues; }</code><technical_language>Please add final in method</technical_language>

Target:
public List<Marker> getMarkersByMapId(final Integer mapId) throws MiddlewareQueryException { List<Marker> dataValues = new ArrayList<>(); if (null == mapId) { return dataValues; } try { SQLQuery query = this.getSession().createSQLQuery(MarkerDAO.GET_MARKERS_BY_MAP_ID); query.setParameter("map_id", mapId); List results = query.list(); for (final Object o : results) { Object[] result = (Object[]) o; if (result != null) { dataValues.add(this.convertToMarker(result)); } } return dataValues; } catch (HibernateException e) { this.logAndThrowException("Error with getMarkersByMapId() query from Marker: " + e.getMessage(), e); } return dataValues; }
Source:
<code>public void testInterruptedWhileWaitingForInputTransformers() throws InterruptedException { CdmServiceWaiter serviceWaiter = mock(CdmServiceWaiter.class); doThrow(new InterruptedException()).when(serviceWaiter).waitFor(anySet()); CdmState cdmState = new CdmState(); ContentDirectoryMonitor monitor = new ContentDirectoryMonitor( camelContext, mock(AttributeRegistry.class), <START> 1, <END> 1, Runnable::run, serviceWaiter, cdmState); monitor.systemSubjectBinder = exchange -> {}; monitor.setNumThreads(1); monitor.setReadLockIntervalMilliseconds(1000); submitConfigOptions(monitor, monitoredDirectoryPath, ContentDirectoryMonitor.MOVE); assertThat( "The content directory monitor should have no route definitions", monitor.getRouteDefinitions(), hasSize(0)); assertThat(cdmState.isRoutesStarted(), is(false)); Thread.interrupted(); }</code><technical_language>I tests for conditions like: - destroy called init is done - init timing out - destroy called init starts - ... idea is tests possibilities of race conditions 3 threads involved</technical_language>

Target:
public void testInterruptedWhileWaitingForInputTransformers() { Thread.currentThread().interrupt(); monitor.setInputTransformers(Collections.emptyList()); monitor.init(); assertThat( "The content directory monitor should have no route definitions", camelContext.getRouteDefinitions(), hasSize(0)); }
Source:
<code>public void createSemanticTagEntity() throws IOException, JsonParseException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { Annotation storedAnno = createTag(SEMANTICTAG_ENTITY, false); log.info(storedAnno.getBody().getInternalType()); assertTrue(storedAnno.getMotivation().equals(MotivationTypes.TAGGING.name().toLowerCase())); <START> assertEquals(storedAnno.getBody().getInternalType(), BodyInternalTypes.ENTITY.name()); <END> }</code><technical_language>BodyInternalTypes.ENTITY BodyInternalTypes.AGENT</technical_language>

Target:
public void createSemanticTagEntity() throws IOException, JsonParseException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { Annotation storedAnno = createTag(SEMANTICTAG_ENTITY, false); log.info(storedAnno.getBody().getInternalType()); assertTrue(storedAnno.getMotivation().equals(MotivationTypes.TAGGING.name().toLowerCase())); assertEquals(storedAnno.getBody().getInternalType(), BodyInternalTypes.AGENT.name()); }
Source:
<code>private boolean scheduleSinkMessageAfterDelay(SinkMessage sinkMessage) { ScheduledFuture<Boolean> future = blockingSinkMessageScheduler.schedule( () -> sendSinkMessage(sinkMessage), SINK_BLOCKING_TIMEOUT, TimeUnit.MILLISECONDS); try { boolean succeeded = future.get(); if (succeeded) { return true; } } catch (InterruptedException | ExecutionException e) { <START> LOG.error("Error while attempting to send sink message to gRPC IPC server", e); <END> } return scheduleSinkMessageAfterDelay(sinkMessage); }</code><technical_language>include module message id in log</technical_language>

Target:
private boolean scheduleSinkMessageAfterDelay(SinkMessage sinkMessage) { ScheduledFuture<Boolean> future = blockingSinkMessageScheduler.schedule( () -> sendSinkMessage(sinkMessage), SINK_BLOCKING_TIMEOUT, TimeUnit.MILLISECONDS); try { boolean succeeded = future.get(); if (succeeded) { return true; } } catch (InterruptedException | ExecutionException e) { LOG.error("Error while attempting to send sink message with id from module to gRPC IPC server", sinkMessage.getMessageId(), sinkMessage.getModuleId(), e); } return scheduleSinkMessageAfterDelay(sinkMessage); }
Source:
<code>protected boolean doExecute(ITestCase scenario) { try { if (Scenarios.isEclMode((Scenario) scenario.getNamedElement())) { IQ7NamedElement copy = scenario .getWorkingCopy(new NullProgressMonitor()); try { Scenario sc = (Scenario) copy.getNamedElement(); Scenarios.setTypeToTesla(sc, true); Scenarios.setTypeToEcl(sc); WriteAccessChecker writeAccessChecker = new WriteAccessChecker(); if (writeAccessChecker.makeResourceWritable(copy)) { copy.commitWorkingCopy(true, new NullProgressMonitor()); } } catch (CoreException e) { <START> e.printStackTrace(); <END> } finally { copy.discardWorkingCopy(); } return true; } } catch (ModelException e) { e.printStackTrace(); } return false; }</code><technical_language>handle exceptions that. If handle it, request user help, rethrow it, thel log plugin activator</technical_language>

Target:
protected boolean doExecute(ITestCase scenario) { try { if (Scenarios.isEclMode((Scenario) scenario.getNamedElement())) { IQ7NamedElement copy = scenario .getWorkingCopy(new NullProgressMonitor()); try { Scenario sc = (Scenario) copy.getNamedElement(); Scenarios.setTypeToTesla(sc, true); Scenarios.setTypeToEcl(sc); WriteAccessChecker writeAccessChecker = new WriteAccessChecker(); if (writeAccessChecker.makeResourceWritable(copy)) { copy.commitWorkingCopy(true, new NullProgressMonitor()); } } catch (CoreException e) { Q7UIPlugin.log(e); } finally { copy.discardWorkingCopy(); } return true; } } catch (ModelException e) { Q7UIPlugin.log(e); } return false; }
Source:
<code>public Map<String, Object> findQuestion(@PathVariable("id") Long id) { final Map<String, Object> response = new HashMap<String, Object>(); List<QuestionOptionDto> qoResults = new ArrayList<QuestionOptionDto>(); Question q = questionDao.getByKey(id); QuestionDto dto = null; if (q != null) { QuestionDtoMapper qdm = new QuestionDtoMapper(); dto = qdm.transform(q); <START> if (q.getType() == Question.Type.OPTION) { <END> Map<Integer, QuestionOption> qoMap = questionOptionDao.listOptionByQuestion(dto .getKeyId()); List<Long> qoList = new ArrayList<Long>(); for (QuestionOption qo : qoMap.values()) { QuestionOptionDto qoDto = new QuestionOptionDto(); BeanUtils.copyProperties(qo, qoDto, new String[] { "translationMap" }); qoDto.setKeyId(qo.getKey().getId()); qoList.add(qo.getKey().getId()); qoResults.add(qoDto); } dto.setQuestionOptions(qoList); } } response.put("questionOptions", qoResults); response.put("question", dto); return response; }</code><technical_language>In this if () block copy question options well.. replace direct of spring library QuestionOptionDtoMapper well</technical_language>

Target:
public Map<String, Object> findQuestion(@PathVariable("id") Long id) { final Map<String, Object> response = new HashMap<String, Object>(); List<QuestionOptionDto> qoResults = new ArrayList<QuestionOptionDto>(); Question q = questionDao.getByKey(id); QuestionDto dto = null; if (q != null) { QuestionDtoMapper qdm = new QuestionDtoMapper(); dto = qdm.transform(q); qoResults = attachAnyOptions(dto); } response.put("questionOptions", qoResults); response.put("question", dto); return response; }
Source:
<code><START> public Item[] getDrops() { <END> List<Item> drops = new ArrayList<>(); if (this.lastDamageCause instanceof EntityDamageByEntityEvent) { int rottenFlesh = Drops.rand(0, 2); int goldNuggets = Drops.rand(0, 101) <= 3 ? 1 : 0; int goldSword = Drops.rand(0, 101) <= 9 ? 1 : 0; for (int i=0; i < rottenFlesh; i++) { drops.add(Item.get(Item.ROTTEN_FLESH, 0, 1)); } for (int i=0; i < goldNuggets; i++) { drops.add(Item.get(Item.GOLD_NUGGET, 0, 1)); } for (int i=0; i < goldSword; i++) { drops.add(Item.get(Item.GOLD_SWORD, 0, 1)); } } return drops.toArray(new Item[drops.size()]); }</code><technical_language><LINK_0></technical_language>

Target:
public Item[] getDrops() { List<Item> drops = new ArrayList<>(); if (this.lastDamageCause instanceof EntityDamageByEntityEvent) { int rottenFlesh = Drops.rand(0, 2); int goldNuggets = Drops.rand(0, 2); int goldSword = Drops.rand(0, 101) <= 9 ? 1 : 0; for (int i=0; i < rottenFlesh; i++) { drops.add(Item.get(Item.ROTTEN_FLESH, 0, 1)); } for (int i=0; i < goldNuggets; i++) { drops.add(Item.get(Item.GOLD_NUGGET, 0, 1)); } for (int i=0; i < goldSword; i++) { drops.add(Item.get(Item.GOLD_SWORD, 0, 1)); } } return drops.toArray(new Item[drops.size()]); }
Source:
<code><START> public List<String> getRecoveryCodes() <END> { return recoveryService.getRecoveryCodes().map(RecoveryCode::getCode).collect(toList()); }</code><technical_language>For flexibility understandable response I recommend returning: { codes: a b } instead of: ["a","b"]</technical_language>

Target:
public Map<String, List<String>> getRecoveryCodes() { return convertToRecoveryCodesMap( recoveryService.getRecoveryCodes().map(RecoveryCode::getCode).collect(toList())); }
Source:
<code>public void testAssertRegexOnNullSensor() { boolean sensorTestFail = false; <START> final String sensorValue = String.format("%s%s%s", UUID.randomUUID().toString(), System.currentTimeMillis(), UUID.randomUUID().toString()); <END> app.createAndManageChild(EntitySpec.create(TestSensor.class) .configure(TestSensor.TARGET_ENTITY, app) .configure(TestSensor.SENSOR_NAME, STRING_SENSOR.getName()) .configure(TestSensor.ASSERTIONS, ImmutableMap.of("regex", String.format(".*%s.*", UUID.randomUUID().toString())))); try { app.start(ImmutableList.of(loc)); } catch (final PropagatedRuntimeException pre) { final AssertionError assertionError = Exceptions.getFirstThrowableOfType(pre, AssertionError.class); assertThat(assertionError).isNotNull().as("An assertion error should have been thrown"); sensorTestFail = true; } finally { assertThat(sensorTestFail).isTrue().as("regex assert should have failed"); } }</code><technical_language>btw this null, removed (in this test only)</technical_language>

Target:
public void testAssertRegexOnNullSensor() { boolean sensorTestFail = false; app.createAndManageChild(EntitySpec.create(TestSensor.class) .configure(TestSensor.TARGET_ENTITY, app) .configure(TestSensor.SENSOR_NAME, STRING_SENSOR.getName()) .configure(TestSensor.ASSERTIONS, ImmutableMap.of("regex", String.format(".*%s.*", Identifiers.makeRandomId(8))))); try { app.start(ImmutableList.of(loc)); } catch (final PropagatedRuntimeException pre) { final AssertionError assertionError = Exceptions.getFirstThrowableOfType(pre, AssertionError.class); assertThat(assertionError).isNotNull().as("An assertion error should have been thrown"); sensorTestFail = true; } finally { assertThat(sensorTestFail).isTrue().as("regex assert should have failed"); } }
Source:
<code>private void fillInUnsetIpConfigs() { <START> for (NetworkAttachment networkAttachment : getParameters().getNetworkAttachments()) { <END> if (networkAttachment.getIpConfiguration() == null) { IpConfiguration ipConfiguration = NetworkUtils.createDefaultIpConfiguration(); networkAttachment.setIpConfiguration(ipConfiguration); } } }</code><technical_language>please replace java8 stream.filter.forEach()</technical_language>

Target:
private void fillInUnsetIpConfigs() { getParameters().getNetworkAttachments().stream().forEach(networkAttachment -> { if (networkAttachment.getIpConfiguration() == null) { IpConfiguration ipConfiguration = NetworkUtils.createDefaultIpConfiguration(); networkAttachment.setIpConfiguration(ipConfiguration); } }); }
Source:
<code>private void installDiscoveryService(final ServiceTarget serviceTarget, List<DiscoveryOption> discoveryOptions) { if (hostControllerInfo.getNativeManagementInterface() != null && !hostControllerInfo.getNativeManagementInterface().isEmpty() && hostControllerInfo.getNativeManagementPort() > 0) { DiscoveryService.install(serviceTarget, discoveryOptions, hostControllerInfo.getNativeManagementInterface(), hostControllerInfo.getNativeManagementPort(), REMOTE.toString(), hostControllerInfo.isMasterDomainController()); } else if (hostControllerInfo.getHttpManagementSecureInterface() != null && !hostControllerInfo.getHttpManagementSecureInterface().isEmpty() && hostControllerInfo.getHttpManagementSecurePort() > 0) { DiscoveryService.install(serviceTarget, discoveryOptions, hostControllerInfo.getHttpManagementSecureInterface(), hostControllerInfo.getHttpManagementSecurePort(), HTTPS_REMOTING.toString(), hostControllerInfo.isMasterDomainController()); } else { DiscoveryService.install(serviceTarget, discoveryOptions, hostControllerInfo.getHttpManagementInterface(), hostControllerInfo.getHttpManagementPort(), HTTP_REMOTING.toString(), hostControllerInfo.isMasterDomainController()); <START> } <END> }</code><technical_language>news this</technical_language>

Target:
private void installDiscoveryService(final ServiceTarget serviceTarget, List<DiscoveryOption> discoveryOptions) { List<DomainControllerManagementInterface> interfaces = new ArrayList<>(); if (hostControllerInfo.getNativeManagementInterface() != null && !hostControllerInfo.getNativeManagementInterface().isEmpty() && hostControllerInfo.getNativeManagementPort() > 0) { interfaces.add(new DomainControllerManagementInterface(hostControllerInfo.getNativeManagementPort(), hostControllerInfo.getNativeManagementInterface(), REMOTE)); } if (hostControllerInfo.getHttpManagementSecureInterface() != null && !hostControllerInfo.getHttpManagementSecureInterface().isEmpty() && hostControllerInfo.getHttpManagementSecurePort() > 0) { interfaces.add(new DomainControllerManagementInterface(hostControllerInfo.getHttpManagementSecurePort(), hostControllerInfo.getHttpManagementSecureInterface(), HTTPS_REMOTING)); } if (hostControllerInfo.getHttpManagementInterface() != null && !hostControllerInfo.getHttpManagementInterface().isEmpty() && hostControllerInfo.getHttpManagementPort() > 0) { interfaces.add(new DomainControllerManagementInterface(hostControllerInfo.getHttpManagementPort(), hostControllerInfo.getHttpManagementInterface(), HTTP_REMOTING)); } DiscoveryService.install(serviceTarget, discoveryOptions, interfaces, hostControllerInfo.isMasterDomainController()); }
Source:
<code>public void testSuccessfulReadAhead() throws Exception { AbfsClient client = getMockAbfsClient(); AbfsRestOperation op = getMockRestOp(); doReturn(op) .doReturn(op) .doReturn(op) .doThrow(new TimeoutException("Internal Server error for RAH-X")) .doThrow(new TimeoutException("Internal Server error for RAH-Y")) .doThrow(new TimeoutException("Internal Server error for RAH-Z")) .when(client) .read(any(String.class), any(Long.class), any(byte[].class), any(Integer.class), any(Integer.class), any(String.class), any(String.class)); AbfsInputStream inputStream = getAbfsInputStream(client, "testSuccessfulReadAhead.txt"); int beforeReadCompletedListSize = ReadBufferManager.getBufferManager().getCompletedReadListSize(); inputStream.read(new byte[ONE_KB]); verifyReadCallCount(client, 3); int newAdditionsToCompletedRead = ReadBufferManager.getBufferManager().getCompletedReadListSize() - beforeReadCompletedListSize; <START> assertTrue( <END> "New additions to completed reads should be same or less than as number of readaheads", newAdditionsToCompletedRead <= 3); inputStream.read(ONE_KB, new byte[ONE_KB], 0, ONE_KB); verifyReadCallCount(client, 3); checkEvictedStatus(inputStream, 0, true); }</code><technical_language>Assertions.assertThat explicit isLessThanOrEqualTo(3) assertion</technical_language>

Target:
public void testSuccessfulReadAhead() throws Exception { AbfsClient client = getMockAbfsClient(); AbfsRestOperation op = getMockRestOp(); doReturn(op) .doReturn(op) .doReturn(op) .doThrow(new TimeoutException("Internal Server error for RAH-X")) .doThrow(new TimeoutException("Internal Server error for RAH-Y")) .doThrow(new TimeoutException("Internal Server error for RAH-Z")) .when(client) .read(any(String.class), any(Long.class), any(byte[].class), any(Integer.class), any(Integer.class), any(String.class), any(String.class)); AbfsInputStream inputStream = getAbfsInputStream(client, "testSuccessfulReadAhead.txt"); int beforeReadCompletedListSize = ReadBufferManager.getBufferManager().getCompletedReadListSize(); inputStream.read(new byte[ONE_KB]); verifyReadCallCount(client, 3); int newAdditionsToCompletedRead = ReadBufferManager.getBufferManager().getCompletedReadListSize() - beforeReadCompletedListSize; Assertions.assertThat(newAdditionsToCompletedRead) .describedAs( "New additions to completed reads should be same or less than as number of readaheads") .isLessThanOrEqualTo(3); inputStream.read(ONE_KB, new byte[ONE_KB], 0, ONE_KB); verifyReadCallCount(client, 3); checkEvictedStatus(inputStream, 0, true); }
Source:
<code>public void testSetClientIdAfterSetExceptionListener() throws Exception { <START> Connection conn = cf.createConnection(); <END> conn.setExceptionListener((e) -> { }); conn.setClientID("clientId"); }</code><technical_language>getExceptionListener here.. is test duplicating issue</technical_language>

Target:
public void testSetClientIdAfterSetExceptionListener() throws Exception { Connection conn = cf.createConnection(); conn.setExceptionListener((e) -> { }); conn.setClientID("clientId"); conn.close(); }
Source:
<code>public void muteTopic(Message message) { <START> mutedTopics.add(message.getStream().getId() + message.getSubject()); <END> SharedPreferences.Editor editor = settings.edit(); editor.putStringSet(MUTED_TOPIC_KEY, new HashSet<String>(mutedTopics)); editor.apply(); }</code><technical_language>prefer operation for generating 'key' for a muted topic a separate function, embed Message object. for example: mutedTopics.add(message.concatStreamAndTopic()); ... // in Message.java private String concatStreamAndTopic() { return getStream().getId() + getSubject(); }</technical_language>

Target:
public void muteTopic(Message message) { mutedTopics.add(message.concatStreamAndTopic()); SharedPreferences.Editor editor = settings.edit(); editor.putStringSet(MUTED_TOPIC_KEY, new HashSet<String>(mutedTopics)); editor.apply(); }
Source:
<code>public void deleteSnapshots(Pattern pattern) throws IOException { <START> if (pattern != null && !pattern.matcher("").matches()) { <END> for (SnapshotDescription description : listSnapshots(pattern)) { tableAdminClientWrapper.deleteBackupAsync( getClusterName().getClusterId(), description.getName()); } } }</code><technical_language>I personally this left Unimplemented. deleteSnapshots sounds atomic operation while multiple API calls - list backups N delete individual backups. This lead unexpected results</technical_language>

Target:
public void deleteSnapshots(Pattern pattern) throws IOException { throw new UnsupportedOperationException("use deleteSnapshot instead"); }