auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public ClientResponseImpl shouldAccept(AuthUser user, StoredProcedureInvocation invocation, Procedure sysProc) { if (!invocation.getProcName().equals("@UpdateClasses")) { return null; } ParameterSet params = invocation.getParams(); <START> Object paramsArray = params.toArray(); <END> if (paramsArray.length != 2) { return new ClientResponseImpl(ClientResponseImpl.UNEXPECTED_FAILURE, new VoltTable[0], "UpdateClasses system procedure requires exactly " + "two parameters, the bytes of the jarfile containing new class files " + "and the string containing class names to be deleted " + "(either of which may be null).", invocation.clientHandle); } if (paramsArray[0] != null) { boolean isHex = false; if (paramsArray[0] instanceof String) { isHex = Encoder.isHexEncodedString((String) paramsArray[0]); } if (!isHex && !(paramsArray[0] instanceof byte[])) { return new ClientResponseImpl(ClientResponseImpl.UNEXPECTED_FAILURE, new VoltTable[0], "UpdateClasses system procedure takes the " + "jarfile bytes as a byte array. The received parameter " + "is of type " + paramsArray[0].getClass() + ".", invocation.clientHandle); } } if (paramsArray[1] != null && !(paramsArray[1] instanceof String)) { return new ClientResponseImpl(ClientResponseImpl.UNEXPECTED_FAILURE, new VoltTable[0], "UpdateClasses system procedure takes the list of classes to be " + "deleted as a string. The received parameter " + "is of type " + paramsArray[0].getClass() + ".", invocation.clientHandle); } return null; }</code><technical_language>final</technical_language>

Target:
public ClientResponseImpl shouldAccept(AuthUser user, StoredProcedureInvocation invocation, Procedure sysProc) { if (!invocation.getProcName().equals("@UpdateClasses")) { return null; } ParameterSet params = invocation.getParams(); final Object paramsArray = params.toArray(); if (paramsArray.length != 2) { return new ClientResponseImpl(ClientResponseImpl.UNEXPECTED_FAILURE, new VoltTable[0], "UpdateClasses system procedure requires exactly " + "two parameters, the bytes of the jarfile containing new class files " + "and the string containing class names to be deleted " + "(either of which may be null).", invocation.clientHandle); } if (paramsArray[0] != null) { boolean isHex = false; if (paramsArray[0] instanceof String) { isHex = Encoder.isHexEncodedString((String) paramsArray[0]); } if (!isHex && !(paramsArray[0] instanceof byte[])) { return new ClientResponseImpl(ClientResponseImpl.UNEXPECTED_FAILURE, new VoltTable[0], "UpdateClasses system procedure takes the " + "jarfile bytes as a byte array. The received parameter " + "is of type " + paramsArray[0].getClass() + ".", invocation.clientHandle); } } if (paramsArray[1] != null && !(paramsArray[1] instanceof String)) { return new ClientResponseImpl(ClientResponseImpl.UNEXPECTED_FAILURE, new VoltTable[0], "UpdateClasses system procedure takes the list of classes to be " + "deleted as a string. The received parameter " + "is of type " + paramsArray[0].getClass() + ".", invocation.clientHandle); } return null; }
Source:
<code>public void testEncodeByMD5() { String encodeStr = "This is the content to be encoded"; try { String encodedByMD5 = DigestUtil.encodeByMD5(encodeStr.getBytes("utf-8")); assertNotNull(encodedByMD5); assertEquals(32, encodedByMD5.length()); } catch (UnsupportedEncodingException e) { <START> e.printStackTrace(); <END> } }</code><technical_language>Log instead of printStackTrace() is better</technical_language>

Target:
public void testEncodeByMD5() { String encodeStr = "This is the content to be encoded"; try { String encodedByMD5 = DigestUtil.encodeByMD5(encodeStr.getBytes("utf-8")); assertNotNull(encodedByMD5); assertEquals(32, encodedByMD5.length()); } catch (UnsupportedEncodingException e) { log.error(e.getMessage(), e); } }
Source:
<code><START> public void setGroupMembers_shouldSetGroupMembers () throws Exception { <END> executeDataSet("obsWithGroupMembers.xml"); ObsResource1_8 resource = getResource(); Obs groupMemberParent = resource.getByUniqueId("47f18998-96cc-11e0-8d6b-9b9415a91423"); ArrayList<String> membersAfterUuidlist = new ArrayList<String>(); Set<Obs> groupMembersBefore = groupMemberParent.getGroupMembers(); Set<Obs> groupMembersAfter = (Set<Obs>) ObsResource1_8.getGroupMembers(resource.getByUniqueId("5117f5d4-96cc-11e0-8d6b-9b9415a91433")); for (Obs memberAfter : groupMembersAfter) { membersAfterUuidlist.add(memberAfter.getUuid()); } ObsResource1_8.setGroupMembers(groupMemberParent, membersAfterUuidlist); assertNotEquals(groupMembersBefore, groupMemberParent.getGroupMembers()); assertEquals(groupMembersAfter, groupMemberParent.getGroupMembers()); }</code><technical_language>a controller test in ObsController1_8Test similar createObs_shouldCreateANewObsWithNumericConcept</technical_language>

Target:
public void setGroupMembers_shouldSetGroupMembers () throws Exception { executeDataSet("obsWithGroupMembers.xml"); ObsResource1_8 resource = getResource(); Obs groupMemberParent = resource.getByUniqueId("47f18998-96cc-11e0-8d6b-9b9415a91423"); Set<Obs> groupMembersBefore = groupMemberParent.getGroupMembers(); Set<Obs> groupMembersAfter = (Set<Obs>) ObsResource1_8.getGroupMembers(resource.getByUniqueId("5117f5d4-96cc-11e0-8d6b-9b9415a91433")); ObsResource1_8.setGroupMembers(groupMemberParent, groupMembersAfter); assertNotEquals(groupMembersBefore, groupMemberParent.getGroupMembers()); assertEquals(groupMembersAfter, groupMemberParent.getGroupMembers()); }
Source:
<code>private boolean plugNic() { PlugUnplugVmNicParameters plugParameters = createPlugUnPlugParameters(); plugParameters.setVmId(getParameters().getVmId()); VdcReturnValueBase plugVmNicReturnValue = Backend.getInstance().runInternalAction(VdcActionType.PlugUnplugVmNic, plugParameters, ExecutionHandler.createDefaultContexForTasks(getExecutionContext())); if (!plugVmNicReturnValue.getSucceeded()) { getReturnValue().getExecuteFailedMessages().add("Failed hot-plugging nic to VM"); getReturnValue().getCanDoActionMessages().addAll(plugVmNicReturnValue.getCanDoActionMessages()); getReturnValue().getCanDoActionMessages().remove(VdcBllMessages.VAR__ACTION__ADD); <START> getReturnValue().setCanDoAction(false); <END> } return plugVmNicReturnValue.getSucceeded(); }</code><technical_language>Please perform this change in patch pushed call command</technical_language>

Target:
private boolean plugNic() { PlugUnplugVmNicParameters plugParameters = createPlugUnPlugParameters(); VdcReturnValueBase plugVmNicReturnValue = Backend.getInstance().runInternalAction(VdcActionType.PlugUnplugVmNic, plugParameters, ExecutionHandler.createDefaultContexForTasks(getExecutionContext())); if (!plugVmNicReturnValue.getSucceeded()) { getReturnValue().getExecuteFailedMessages().add("Failed hot-plugging nic to VM"); getReturnValue().getCanDoActionMessages().addAll(plugVmNicReturnValue.getCanDoActionMessages()); getReturnValue().getCanDoActionMessages().remove(VdcBllMessages.VAR__ACTION__ADD.toString()); getReturnValue().setCanDoAction(false); } return plugVmNicReturnValue.getSucceeded(); }
Source:
<code>private String getDataNeededByAllEntries(Vector<Entry> entries) { <START> String needDatum = null; <END> String neededDatumId = null; for (Entry e : entries) { SessionDatum datumNeededForThisEntry = getFirstMissingDatum(collectedDatums, e.getSessionDataReqs()); if (datumNeededForThisEntry != null) { if (neededDatumId == null) { neededDatumId = datumNeededForThisEntry.getDataId(); if (datumNeededForThisEntry.getNodeset() != null) { needDatum = SessionFrame.STATE_DATUM_VAL; } else { needDatum = SessionFrame.STATE_DATUM_COMPUTED; } } else if (!neededDatumId.equals(datumNeededForThisEntry.getDataId())) { return null; } } else { return null; } } return needDatum; }</code><technical_language>I renaming datumNeededByAllEntriesSoFar (and idOfDatumNeededByAllEntriesSoFar) increase readability of this a lot</technical_language>

Target:
private String getDataNeededByAllEntries(Vector<Entry> entries) { String datumNeededByAllEntriesSoFar = null; String neededDatumId = null; for (Entry e : entries) { SessionDatum datumNeededForThisEntry = getFirstMissingDatum(collectedDatums, e.getSessionDataReqs()); if (datumNeededForThisEntry != null) { if (neededDatumId == null) { neededDatumId = datumNeededForThisEntry.getDataId(); if (datumNeededForThisEntry.getNodeset() != null) { datumNeededByAllEntriesSoFar = SessionFrame.STATE_DATUM_VAL; } else { datumNeededByAllEntriesSoFar = SessionFrame.STATE_DATUM_COMPUTED; } } else if (!neededDatumId.equals(datumNeededForThisEntry.getDataId())) { return null; } } else { return null; } } return datumNeededByAllEntriesSoFar; }
Source:
<code>void closeSockSync() { try { if (sock != null) { long startTime = Time.currentElapsedTime(); sock.close(); ServerMetrics.getMetrics().SOCKET_CLOSING_TIME.add(Time.currentElapsedTime() - startTime); } } catch (IOException e) { <START> LOG.warn("Ignoring error closing connection to learner", e); <END> } }</code><technical_language>please add id, this.sid</technical_language>

Target:
void closeSockSync() { try { if (sock != null) { long startTime = Time.currentElapsedTime(); sock.close(); ServerMetrics.getMetrics().SOCKET_CLOSING_TIME.add(Time.currentElapsedTime() - startTime); } } catch (IOException e) { LOG.warn("Ignoring error closing connection to learner {}", getSid(), e); } }
Source:
<code>private void generateHelper(Service service) { initVariables(service); <START> <END> serviceMethods.forEach(x -> generateHelperCode(x)); try { javaBuffer.write(outDir); } catch (IOException exception) { exception.printStackTrace(); } }</code><technical_language>Remember remove trailing white space</technical_language>

Target:
private void generateHelper(Service service) { initVariables(service); serviceMethods.forEach(x -> generateHelperCode(x)); javaBuffer.addLine("}"); try { javaBuffer.write(outDir); } catch (IOException exception) { exception.printStackTrace(); } }
Source:
<code>public void testForExisting() { String url = "/v2/identifiers/rs199692280?species=mmusculus&assembly=grcm38"; ResponseEntity<List<Variant>> response = restTemplate.exchange(url, HttpMethod.GET, null, new ParameterizedTypeReference<List<Variant>>() { }); assertEquals(HttpStatus.OK, response.getStatusCode()); <START> assertTrue(response.getBody().size() > 0); <END> }</code><technical_language>checking important fields chromosome position alleles nice. in case returning object fields null. Applies other test class too</technical_language>

Target:
public void testForExisting() { String url = "/v2/identifiers/rs199692280?species=mmusculus&assembly=grcm38"; ResponseEntity<List<Variant>> response = restTemplate.exchange(url, HttpMethod.GET, null, new ParameterizedTypeReference<List<Variant>>() { }); assertEquals(HttpStatus.OK, response.getStatusCode()); List<Variant> variantList = response.getBody(); assertTrue(variantList.size() > 0); assertEquals("20", variantList.get(0).getChromosome()); assertEquals("T", variantList.get(0).getAlternate()); assertEquals("A", variantList.get(0).getReference()); assertEquals(60100L, variantList.get(0).getStart()); assertEquals(60100L, variantList.get(0).getEnd()); }
Source:
<code>public static QualifiedFunctionName of(String dottedName) { String[] parts = dottedName.split("\\."); if (parts.length != 3) { throw new PrestoException( INVALID_FUNCTION_ARGUMENT, <START> format("Non-builtin functions must be reference by three parts: catalog.schema.function_name, found: %s", dottedName)); <END> } return of(new CatalogSchemaName(parts[0], parts[1]), parts[2]); }</code><technical_language>@viczhang861 This class possibly is describe a non-builtin function. give example of a query is failing</technical_language>

Target:
public static QualifiedFunctionName of(String dottedName) { String[] parts = dottedName.split("\\."); if (parts.length != 3) { throw new IllegalArgumentException("QualifiedFunctionName should have exactly 3 parts"); } return of(new CatalogSchemaName(parts[0], parts[1]), parts[2]); }
Source:
<code><START> List<E> getValues(@NotNull GrStatementOwner closure) { <END> List<E> result = Lists.newArrayList(); for (PsiElement element : closure.getChildren()) { List<E> values = getValues(element); if (values != null && !values.isEmpty()) { result.addAll(values); } } return result; }</code><technical_language>add protected modified this other package protected methods match is done for setValue</technical_language>

Target:
public List<E> getValues(@NotNull GrStatementOwner closure) { List<E> result = Lists.newArrayList(); for (PsiElement element : closure.getChildren()) { List<E> values = getValues(element); if (values != null && !values.isEmpty()) { result.addAll(values); } } return result; }
Source:
<code>public static List<BrooklinMetricInfo> getMetricInfos() { List<BrooklinMetricInfo> metrics = new ArrayList<>(); String className = EventProducer.class.getSimpleName(); metrics.add(new BrooklinCounterInfo(METRICS_PREFIX + EVENTS_PRODUCED_WITHIN_SLA)); metrics.add(new BrooklinCounterInfo(METRICS_PREFIX + EVENTS_PRODUCED_WITHIN_ALTERNATE_SLA)); metrics.add(new BrooklinCounterInfo(METRICS_PREFIX + TOTAL_EVENTS_PRODUCED)); metrics.add(new BrooklinMeterInfo(METRICS_PREFIX + EVENT_PRODUCE_RATE)); <START> metrics.add(new BrooklinCounterInfo(METRICS_PREFIX + SKIPPED_BAD_MESSAGES_RATE)); <END> metrics.add(new BrooklinCounterInfo(METRICS_PREFIX + EVENTS_PRODUCED_OUTSIDE_SLA)); metrics.add(new BrooklinCounterInfo(METRICS_PREFIX + EVENTS_PRODUCED_OUTSIDE_ALTERNATE_SLA)); metrics.add(new BrooklinHistogramInfo(METRICS_PREFIX + EVENTS_LATENCY_MS_STRING, Optional.of( Arrays.asList(BrooklinHistogramInfo.MEAN, BrooklinHistogramInfo.MAX, BrooklinHistogramInfo.PERCENTILE_50, BrooklinHistogramInfo.PERCENTILE_99, BrooklinHistogramInfo.PERCENTILE_999)))); metrics.add(new BrooklinHistogramInfo(METRICS_PREFIX + EVENTS_SEND_LATENCY_MS_STRING)); metrics.add(new BrooklinHistogramInfo(METRICS_PREFIX + FLUSH_LATENCY_MS_STRING)); return Collections.unmodifiableList(metrics); }</code><technical_language>change String constant name exclude "rate" here? a big confusing, metric is a Counter a Meter</technical_language>

Target:
public static List<BrooklinMetricInfo> getMetricInfos() { List<BrooklinMetricInfo> metrics = new ArrayList<>(); String className = EventProducer.class.getSimpleName(); metrics.add(new BrooklinCounterInfo(METRICS_PREFIX + EVENTS_PRODUCED_WITHIN_SLA)); metrics.add(new BrooklinCounterInfo(METRICS_PREFIX + EVENTS_PRODUCED_WITHIN_ALTERNATE_SLA)); metrics.add(new BrooklinCounterInfo(METRICS_PREFIX + TOTAL_EVENTS_PRODUCED)); metrics.add(new BrooklinMeterInfo(METRICS_PREFIX + EVENT_PRODUCE_RATE)); metrics.add(new BrooklinCounterInfo(METRICS_PREFIX + SKIPPED_BAD_MESSAGES_COUNTER)); metrics.add(new BrooklinCounterInfo(METRICS_PREFIX + EVENTS_PRODUCED_OUTSIDE_SLA)); metrics.add(new BrooklinCounterInfo(METRICS_PREFIX + EVENTS_PRODUCED_OUTSIDE_ALTERNATE_SLA)); metrics.add(new BrooklinHistogramInfo(METRICS_PREFIX + EVENTS_LATENCY_MS_STRING, Optional.of( Arrays.asList(BrooklinHistogramInfo.MEAN, BrooklinHistogramInfo.MAX, BrooklinHistogramInfo.PERCENTILE_50, BrooklinHistogramInfo.PERCENTILE_99, BrooklinHistogramInfo.PERCENTILE_999)))); metrics.add(new BrooklinHistogramInfo(METRICS_PREFIX + EVENTS_SEND_LATENCY_MS_STRING)); metrics.add(new BrooklinHistogramInfo(METRICS_PREFIX + FLUSH_LATENCY_MS_STRING)); return Collections.unmodifiableList(metrics); }
Source:
<code>public void onOpen(SQLiteDatabase db) { SQLiteDatabaseAdapter adapter = new SQLiteDatabaseAdapter(db); <START> delegate.onOpen(adapter); <END> if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) { delegate.onConfigure(adapter); } }</code><technical_language>onConfigure() onOpen() in AOSP, ordering move this call down</technical_language>

Target:
public void onOpen(SQLiteDatabase db) { SQLiteDatabaseAdapter adapter = new SQLiteDatabaseAdapter(db); if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) { delegate.onConfigure(adapter); } delegate.onOpen(adapter); }
Source:
<code>public static void serialize( ObjectDataOutput out, Email object ) throws IOException { serializeMailAddresses( out, object.getFrom() ); serializeMailAddresses( out, object.getTo() ); serializeMailAddresses( out, object.getCc() ); serializeMailAddresses( out, object.getBcc() ); serializeMailAddresses( out, object.getReplyTo() ); out.writeUTF( object.getSubject() ); out.writeUTF( object.getSubjectEncoding() ); out.writeInt( object.getPriority() ); <START> out.writeLong( object.getSentDate().getTime() ); <END> serializeEmailMessages( out, object.getAllMessages() ); }</code><technical_language>this throw a NullPointerException if getSentDate() returns null. suggested fix: if (object.getSentDate() != null) { out.writeLong( object.getSentDate().getTime() ); } else { out.writeLong(-1); } ... deserialize: if (sentTime != -1) { email.setSentDate( new Date( sentTime ) ); }</technical_language>

Target:
public static void serialize( ObjectDataOutput out, Email object ) throws IOException { serializeMailAddresses( out, object.getFrom() ); serializeMailAddresses( out, object.getTo() ); serializeMailAddresses( out, object.getCc() ); serializeMailAddresses( out, object.getBcc() ); serializeMailAddresses( out, object.getReplyTo() ); out.writeUTF( object.getSubject() ); out.writeUTF( object.getSubjectEncoding() ); out.writeInt( object.getPriority() ); Date sentDate = object.getSentDate(); boolean hasSentDate = ( sentDate != null ); out.writeBoolean( hasSentDate ); if ( hasSentDate ) { out.writeLong( object.getSentDate().getTime() ); } serializeEmailMessages( out, object.getAllMessages() ); }
Source:
<code>public void shouldThrowExceptionIfNoTypeMappingWasFoundWithoutAffectingContentProviderAsSingle() { final StorIOContentResolver storIOContentResolver = mock(StorIOContentResolver.class); final StorIOContentResolver.Internal internal = mock(StorIOContentResolver.Internal.class); when(storIOContentResolver.internal()).thenReturn(internal); when(storIOContentResolver.delete()).thenReturn(new PreparedDelete.Builder(storIOContentResolver)); final List<TestItem> items = asList(TestItem.newInstance(), TestItem.newInstance()); final TestSubscriber<DeleteResults<TestItem>> testSubscriber = new TestSubscriber<DeleteResults<TestItem>>(); storIOContentResolver .delete() .objects(items) .prepare() .asRxSingle() .subscribe(testSubscriber); testSubscriber.awaitTerminalEvent(); testSubscriber.assertNoValues(); assertThat(testSubscriber.getOnErrorEvents().get(0)) .isInstanceOf(StorIOException.class) <START> .hasCauseInstanceOf(IllegalStateException.class); <END> verify(storIOContentResolver).delete(); verify(storIOContentResolver).internal(); verify(internal).typeMapping(TestItem.class); verify(internal, never()).delete(any(DeleteQuery.class)); verifyNoMoreInteractions(storIOContentResolver, internal); }</code><technical_language>Please check exception message</technical_language>

Target:
public void shouldThrowExceptionIfNoTypeMappingWasFoundWithoutAffectingContentProviderAsSingle() { final StorIOContentResolver storIOContentResolver = mock(StorIOContentResolver.class); final StorIOContentResolver.Internal internal = mock(StorIOContentResolver.Internal.class); when(storIOContentResolver.internal()).thenReturn(internal); when(storIOContentResolver.delete()).thenReturn(new PreparedDelete.Builder(storIOContentResolver)); final TestItem testItem = TestItem.newInstance(); final List<TestItem> items = asList(testItem, TestItem.newInstance()); final TestSubscriber<DeleteResults<TestItem>> testSubscriber = new TestSubscriber<DeleteResults<TestItem>>(); storIOContentResolver .delete() .objects(items) .prepare() .asRxSingle() .subscribe(testSubscriber); testSubscriber.awaitTerminalEvent(); testSubscriber.assertNoValues(); assertThat(testSubscriber.getOnErrorEvents().get(0)) .isInstanceOf(StorIOException.class) .hasCauseInstanceOf(IllegalStateException.class) .hasMessage(IllegalStateException.class.getName() + ": One of the objects from the collection does not have type mapping: object = " + testItem.toString() + ", object.class = " + TestItem.class + ",ContentProvider was not affected by this operation, please add type mapping for this type"); verify(storIOContentResolver).delete(); verify(storIOContentResolver).internal(); verify(internal).typeMapping(TestItem.class); verify(internal, never()).delete(any(DeleteQuery.class)); verifyNoMoreInteractions(storIOContentResolver, internal); }
Source:
<code>void setCurrentControllerInfo() { if (Build.VERSION.SDK_INT >= 28) { return; } MediaSessionImpl sessionImpl = mSessionImpl != null ? mSessionImpl.get() : null; if (sessionImpl == null) { return; } String packageName; if (Build.VERSION.SDK_INT >= 24) { packageName = <START> sessionImpl.getCallingPackage(); <END> if (TextUtils.isEmpty(packageName)) { packageName = LEGACY_CONTROLLER; } } else { packageName = LEGACY_CONTROLLER; } sessionImpl.setCurrentControllerInfo(new RemoteUserInfo( packageName, UNKNOWN_PID, UNKNOWN_UID)); }</code><technical_language>call this in API 21-23, return null</technical_language>

Target:
void setCurrentControllerInfo() { if (Build.VERSION.SDK_INT >= 28) { return; } MediaSessionImpl sessionImpl = mSessionImpl != null ? mSessionImpl.get() : null; if (sessionImpl == null) { return; } String packageName = sessionImpl.getCallingPackage(); if (TextUtils.isEmpty(packageName)) { packageName = LEGACY_CONTROLLER; } sessionImpl.setCurrentControllerInfo(new RemoteUserInfo( packageName, UNKNOWN_PID, UNKNOWN_UID)); }
Source:
<code>synchronized boolean requestRetryIfTimeout() { switch (state) { case INIT_STATE: state = NEED_RETRY_STATE; return false; case NEED_RETRY_STATE: <START> LOG.log(Level.INFO, "Pull request time out for key: {0}, requestIdCounter: {1}, retryCount: {2}", <END> new Object[]{encodedKey.getKey(), requestId, retryCount}); state = RETRY_REQUESTED_STATE; workerThread.enqueueRetryPulls(this); return true; case RETRY_REQUESTED_STATE: return false; default: throw new RuntimeException("Unknown state of pull request"); } }</code><technical_language>requestIdCounter -> requestId</technical_language>

Target:
synchronized boolean requestRetryIfTimeout() { switch (state) { case INIT_STATE: state = NEED_RETRY_STATE; return false; case NEED_RETRY_STATE: LOG.log(Level.INFO, "Pull request time out for key: {0}, requestId: {1}, retryCount: {2}", new Object[]{encodedKey.getKey(), requestId, retryCount}); state = RETRY_REQUESTED_STATE; workerThread.enqueueRetryPull(this); return true; case RETRY_REQUESTED_STATE: return false; default: throw new RuntimeException("Unknown state of pull request"); } }
Source:
<code>protected MetadataResolver initServiceProviderMetadataResolver(final WebContext context) { String finalCallbackUrl = computeFinalCallbackUrl(context); this.spMetadataResolver = new SAML2ServiceProviderMetadataResolver(this.configuration.getServiceProviderMetadataPath(), this.configuration.getServiceProviderMetadataResource(), finalCallbackUrl, <START> (this.configuration.getServiceProviderEntityId().equals("CALLBACK_URL") ? finalCallbackUrl <END> : this.configuration.getServiceProviderEntityId()), this.configuration.isForceServiceProviderMetadataGeneration(), this.credentialProvider); return this.spMetadataResolver.resolve(); }</code><technical_language>is this test for</technical_language>

Target:
protected MetadataResolver initServiceProviderMetadataResolver(final WebContext context) { this.spMetadataResolver = new SAML2ServiceProviderMetadataResolver(this.configuration, computeFinalCallbackUrl(context), this.credentialProvider); return this.spMetadataResolver.resolve(); }
Source:
<code>public void testNodeValidationFailedEvent() throws Exception { startGrid(0); CountDownLatch evtLatch = new CountDownLatch(1); AtomicReference<Event> listenedEvt = new AtomicReference<>(); grid(0).events().localListen(evt -> { assertTrue(listenedEvt.compareAndSet(null, evt)); evtLatch.countDown(); return true; }, EVT_NODE_VALIDATION_FAILED); startGrid(1); IgniteConfiguration invalidCfg = getConfiguration(getTestIgniteInstanceName(2)) .setPluginProviders(new TestSecurityPluginProvider("login", "", ALLOW_ALL, false)); assertThrowsWithCause(() -> startGrid(optimize(invalidCfg)), IgniteSpiException.class); evtLatch.await(); <START> assertTrue(listenedEvt.get() instanceof NodeValidationFailedEvent); NodeValidationFailedEvent validationEvt = (NodeValidationFailedEvent) listenedEvt.get(); <END> assertEquals(invalidCfg.getConsistentId(), validationEvt.eventNode().attribute(ATTR_NODE_CONSISTENT_ID)); assertNotNull(validationEvt.validationResult()); String errMsg = validationEvt.validationResult().message(); assertNotNull(errMsg); assertTrue(errMsg.contains( "Local node's grid security processor class is not equal to remote node's grid security processor class")); }</code><technical_language>double get replaced single</technical_language>

Target:
public void testNodeValidationFailedEvent() throws Exception { startGrid(0); CountDownLatch evtLatch = new CountDownLatch(1); AtomicReference<Event> listenedEvtRef = new AtomicReference<>(); grid(0).events().localListen(evt -> { assertTrue(listenedEvtRef.compareAndSet(null, evt)); evtLatch.countDown(); return true; }, EVT_NODE_VALIDATION_FAILED); startGrid(1); String invalidNodeName = getTestIgniteInstanceName(2); IgniteConfiguration invalidCfg = getConfiguration(invalidNodeName) .setPluginProviders(new TestSecurityPluginProvider("login", "", ALLOW_ALL, false)); assertThrowsWithCause(() -> startGrid(optimize(invalidCfg)), IgniteSpiException.class); evtLatch.await(); Event listenedEvt = listenedEvtRef.get(); assertTrue(listenedEvt instanceof NodeValidationFailedEvent); NodeValidationFailedEvent validationEvt = (NodeValidationFailedEvent)listenedEvt; assertEquals(invalidNodeName, validationEvt.eventNode().attribute(ATTR_NODE_CONSISTENT_ID)); IgniteNodeValidationResult validationRes = validationEvt.validationResult(); assertNotNull(validationRes); String errMsg = validationRes.message(); assertNotNull(errMsg); assertTrue(errMsg.contains( "Local node's grid security processor class is not equal to remote node's grid security processor class")); }
Source:
<code>public boolean isCheckboxEnabled(String projectName) { String checkboxLocator = format(CHECKBOX_BY_PROJECT_NAME_XPATH_TEMPLATE, projectName); return seleniumWebDriverHelper <START> .waitVisibilityAndGetAttribute(By.xpath(checkboxLocator), "aria-checked") <END> .equals("true"); }</code><technical_language>"aria-checked" unclear here. Is kind of checkboxCheckedAttribute</technical_language>

Target:
public boolean isCheckboxEnabled(String projectName) { final String checkboxLocator = format(CHECKBOX_BY_PROJECT_NAME_XPATH_TEMPLATE, projectName); final String checkboxStateAttribute = "aria-checked"; return seleniumWebDriverHelper .waitVisibilityAndGetAttribute(By.xpath(checkboxLocator), checkboxStateAttribute) .equals("true"); }
Source:
<code>HistoryReference createHistoryReference(int id) throws DatabaseException, HttpMalformedHeaderException; } <START> public void injectCsrfToken(HttpMessage message, HttpRequestConfig config) { <END> List<AntiCsrfToken> tokens = getTokens(message); AntiCsrfToken antiCsrfToken = null; if (tokens.size() > 0) { antiCsrfToken = tokens.get(0); } if (antiCsrfToken != null) { regenerateAntiCsrfToken(message, antiCsrfToken, config); } }</code><technical_language>suggest "old" nameregenerateAntiCsrfToken, injecting (just replacing clear "anti"). - methods merged (and feel free clean up)</technical_language>

Target:
HistoryReference createHistoryReference(int id) throws DatabaseException, HttpMalformedHeaderException; } public void regenerateAntiCsrfToken(HttpMessage message, HttpMessageSender httpSender) { List<AntiCsrfToken> tokens = getTokens(message); AntiCsrfToken antiCsrfToken = null; if (tokens.size() > 0) { antiCsrfToken = tokens.get(0); } if (antiCsrfToken == null) { return; } String tokenValue = null; try { HttpMessage tokenMsg = antiCsrfToken.getMsg().cloneAll(); httpSender.sendAndReceive(tokenMsg); tokenValue = getTokenValue(tokenMsg, antiCsrfToken.getName()); } catch (Exception e) { log.error(e.getMessage(), e); } if (tokenValue != null) { log.debug( "regenerateAntiCsrfToken replacing " + antiCsrfToken.getValue() + " with " + encoder.getURLEncode(tokenValue)); String replaced = message.getRequestBody().toString(); replaced = replaced.replace( encoder.getURLEncode(antiCsrfToken.getValue()), encoder.getURLEncode(tokenValue)); message.setRequestBody(replaced); registerAntiCsrfToken( new AntiCsrfToken( message, antiCsrfToken.getName(), tokenValue, antiCsrfToken.getFormIndex())); } }
Source:
<code><START> public void setNumExecutors(@Nonnegative int n) throws IOException { <END> if (this.numExecutors != n) { this.numExecutors = n; updateComputerList(); save(); } }</code><technical_language>runtime effect AFAIK; matched IllegalArgumentException</technical_language>

Target:
public void setNumExecutors(@Nonnegative int n) throws IOException, IllegalArgumentException { if (n < 0) { throw new IllegalArgumentException("Incorrect field \"# of executors\": " + n +". It should be a non-negative number."); } if (this.numExecutors != n) { this.numExecutors = n; updateComputerList(); save(); } }
Source:
<code>public boolean uploadCertificateToHosts(String certificateCer, String alias, String hypervisor) { HypervisorType hypervisorType = HypervisorType.getType(hypervisor); List<HostVO> hosts = getRunningHostsToUploadCertificate(hypervisorType); String certificatePem = getPretifiedCertificate(certificateCer); certificateSanity(certificatePem); s_logger.info("Attempting to upload certificate: " + alias + " to " + hosts.size() + " hosts"); if (CollectionUtils.isNotEmpty(hosts)) { for (HostVO host : hosts) { if (!uploadCertificate(certificatePem, alias, host.getId())) { s_logger.error("Could not upload certificate on host: " + host.getName() + " (" + host.getUuid() + ")"); <START> throw new CloudRuntimeException("Uploading certificate " + alias + " failed on host: " + host.getUuid()); <END> } } } return true; }</code><technical_language>if message in log "error" method, in throw cloud runtime? I this message needs contain, information hostname, host uuid, certificate alias</technical_language>

Target:
public boolean uploadCertificateToHosts(String certificateCer, String alias, String hypervisor) { HypervisorType hypervisorType = HypervisorType.getType(hypervisor); List<HostVO> hosts = getRunningHostsToUploadCertificate(hypervisorType); String certificatePem = getPretifiedCertificate(certificateCer); certificateSanity(certificatePem); s_logger.info("Attempting to upload certificate: " + alias + " to " + hosts.size() + " hosts"); if (CollectionUtils.isNotEmpty(hosts)) { for (HostVO host : hosts) { if (!uploadCertificate(certificatePem, alias, host.getId())) { String msg = "Could not upload certificate " + alias + " on host: " + host.getName() + " (" + host.getUuid() + ")"; s_logger.error(msg); throw new CloudRuntimeException(msg); } } } return true; }
Source:
<code>public Object execute(ExecutionEvent event) throws ExecutionException { Object returnValue = Boolean.FALSE; final IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); final IWorkbenchPart activePart = activePage.getActivePart(); if (activePart instanceof IViewPart) { final IViewPart viewPart = (IViewPart) activePart; applyAction = AbstractFocusViewAction.getActionForPart(viewPart); if (applyAction != null) { applyAction.update(!applyAction.isChecked()); <START> returnValue = Boolean.TRUE; <END> } } return returnValue; }</code><technical_language>return true auto-boxing care of conversion</technical_language>

Target:
public Object execute(ExecutionEvent event) throws ExecutionException { Object returnValue = false; final IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); final IWorkbenchPart activePart = activePage.getActivePart(); if (activePart instanceof IViewPart) { final IViewPart viewPart = (IViewPart) activePart; focusAction = AbstractFocusViewAction.getActionForPart(viewPart); if (focusAction != null) { focusAction.update(!focusAction.isChecked()); returnValue = true; } } return returnValue; }
Source:
<code>protected void doExecute() throws Exception { if (skip) { return; } if (isInstall) { installServerAssembly(); } else { log.info(MessageFormat.format(messages.getString("info.install.type.preexisting"), "")); checkServerHomeExists(); checkServerDirectoryExists(); } log.info(MessageFormat.format(messages.getString("info.server.package"), serverName)); ServerTask serverTask = initializeJava(); copyConfigFiles(); serverTask.setOperation("package"); if (packageFile != null) { if (packageFile.isDirectory()) { packageFile = new File(packageFile, serverName + ".zip"); } } else { <START> packageFile = new File(projectBuildDir, serverName + ".zip"); <END> } serverTask.setArchive(packageFile); serverTask.setInclude(include); serverTask.setOs(os); log.info(MessageFormat.format(messages.getString("info.server.package.file.location"), packageFile.getCanonicalPath())); serverTask.execute(); if (attach || (project != null && "liberty-assembly".equals(project.getPackaging()))) { if (project == null) { throw new MojoFailureException(MessageFormat.format(messages.getString("error.server.package.no.project"), "")); } project.getArtifact().setFile(packageFile); } }</code><technical_language>nice if set default extension ".jar" if include parameter runnable. example xml <include>minify,runnable</include></technical_language>

Target:
protected void doExecute() throws Exception { if (skip) { return; } if (isInstall) { installServerAssembly(); } else { log.info(MessageFormat.format(messages.getString("info.install.type.preexisting"), "")); checkServerHomeExists(); checkServerDirectoryExists(); } log.info(MessageFormat.format(messages.getString("info.server.package"), serverName)); ServerTask serverTask = initializeJava(); copyConfigFiles(); serverTask.setOperation("package"); String fileType = getPackageFileType(include); String projectBuildDir = project.getBuild().getDirectory(); String projectBuildName = project.getBuild().getFinalName(); if (packageFile != null) { if (packageFile.isDirectory()) { packageFile = new File(packageFile, projectBuildName + fileType); } } else { packageFile = new File(projectBuildDir, projectBuildName + fileType); } serverTask.setArchive(packageFile); serverTask.setInclude(include); serverTask.setOs(os); log.info(MessageFormat.format(messages.getString("info.server.package.file.location"), packageFile.getCanonicalPath())); serverTask.execute(); if (attach || (project != null && "liberty-assembly".equals(project.getPackaging()))) { if (project == null) { throw new MojoFailureException(MessageFormat.format(messages.getString("error.server.package.no.project"), "")); } project.getArtifact().setFile(packageFile); } }
Source:
<code>ObjectMetadata getS3ObjectMetadata(Path path) throws IOException { String bucketName = getBucketName(uri); String key = keyFromPath(path); ObjectMetadata s3ObjectMetadata = getS3ObjectMetadata(path, bucketName, key); if (s3ObjectMetadata == null && !key.isEmpty()) { <START> verify(!key.endsWith(PATH_SEPARATOR), "Expected key to not end with %s", PATH_SEPARATOR); <END> return getS3ObjectMetadata(path, bucketName, key + PATH_SEPARATOR); } return s3ObjectMetadata; }</code><technical_language>need this check, keyFromPath() is guaranteed return a key a trailing slash. URI guarantees paths normalized (no double slashes) keyFromPath() strips trailing slash. this check is confusing reader puzzle this possible</technical_language>

Target:
ObjectMetadata getS3ObjectMetadata(Path path) throws IOException { String bucketName = getBucketName(uri); String key = keyFromPath(path); ObjectMetadata s3ObjectMetadata = getS3ObjectMetadata(path, bucketName, key); if (s3ObjectMetadata == null && !key.isEmpty()) { return getS3ObjectMetadata(path, bucketName, key + PATH_SEPARATOR); } return s3ObjectMetadata; }
Source:
<code>public static byte[] readFileAsBytes(String filePath) throws IOException { <START> byte[] buffer; <END> try (FileInputStream fis = new FileInputStream(filePath)) { buffer = new byte[1024 * 300]; fis.read(buffer); return buffer; } }</code><technical_language>This defined try block</technical_language>

Target:
public static byte[] readFileAsBytes(String filePath) throws IOException { try (FileInputStream fis = new FileInputStream(filePath)) { byte[] buffer = new byte[1024 * 300]; fis.read(buffer); return buffer; } }
Source:
<code>private static List<ProgramState> setNotPresentConstraint(CheckerContext context, Tree syntaxNode) { <START> SymbolicValue val = context.getState().peekValue(); <END> if(syntaxNode.is(Tree.Kind.METHOD_INVOCATION) && OPTIONAL_EMPTY.matches(((MethodInvocationTree) syntaxNode))) { return val.setConstraint(context.getState(), OptionalConstraint.NOT_PRESENT); } return Lists.newArrayList(context.getState()); }</code><technical_language>val moved clause of if statement</technical_language>

Target:
private static List<ProgramState> setNotPresentConstraint(CheckerContext context, Tree syntaxNode) { if(syntaxNode.is(Tree.Kind.METHOD_INVOCATION) && OPTIONAL_EMPTY.matches(((MethodInvocationTree) syntaxNode))) { return context.getState().peekValue().setConstraint(context.getState(), OptionalConstraint.NOT_PRESENT); } return Lists.newArrayList(context.getState()); }
Source:
<code>private JobRepositoryCleanupManager() { succeededJobTime = Config.<Integer> GetValue(ConfigValues.SucceededJobCleanupTimeInMinutes).intValue() * -1; failedJobTime = Config.<Integer> GetValue(ConfigValues.FailedJobCleanupTimeInMinutes).intValue() * -1; <START> Integer cleanupFrequency = Config.<Integer> GetValue(ConfigValues.JobCleanupRateInMinutes); <END> SchedulerUtilQuartzImpl.getInstance().scheduleAFixedDelayJob(this, "completed_jobs_cleanup", new Class[] {}, new Object[] {}, cleanupFrequency, cleanupFrequency, TimeUnit.MINUTES); }</code><technical_language>this in a lot places, is ugly, class is initialized, passed some other place</technical_language>

Target:
private JobRepositoryCleanupManager() { }
Source:
<code>protected int getPrefetchCount() { try { return Integer.parseInt( variablizedStepMeta.getPrefetchCount() ); } catch ( NumberFormatException nfe ) { <START> return 100000; <END> } }</code><technical_language>defined a DEFAULT_PREFETCH_COUNT constant, sharing a constant Meta</technical_language>

Target:
protected int getPrefetchCount() { try { return Integer.parseInt( variablizedStepMeta.getPrefetchCount() ); } catch ( NumberFormatException nfe ) { return BaseStreamStepMeta.PREFETCH; } }
Source:
<code>private void initRecyclerView() { Timber.d("RecyclerList Recycler view Init."); LinearLayoutManager layoutManager; if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) { <START> layoutManager = new GridLayoutManager(getContext(), SPAN_COUNT); <END> rvContributionsList.setLayoutManager(layoutManager); } else { layoutManager = new LinearLayoutManager(getContext()); rvContributionsList.setLayoutManager(layoutManager); } rvContributionsList.setAdapter(adapter); rvContributionsList.addOnScrollListener(contributionsListPresenter.getScrollListener(layoutManager)); contributionsListPresenter.setupLiveData(); contributionsListPresenter.fetchContributions(); }</code><technical_language>a GridLayoutManager spanCount 1 is essentially analogous LinearLayoutManager, I move this condition a ternary create types of LayoutManager</technical_language>

Target:
private void initRecyclerView() { final GridLayoutManager layoutManager = new GridLayoutManager(getContext(), getSpanCount(getResources().getConfiguration().orientation)); rvContributionsList.setLayoutManager(layoutManager); contributionsListPresenter.setup(); contributionsListPresenter.contributionList.observe(this, adapter::submitList); rvContributionsList.setAdapter(adapter); }
Source:
<code>public UploadPack create(HttpServletRequest req, Repository repo) throws ServiceNotEnabledException, ServiceNotAuthorizedException { final ProjectControl pc = getProjectControl(req); final CurrentUser user = pc.getCurrentUser(); final Set<AccountGroup.Id> uploadGroup = serverCommandConfig.getUploadGroup(); <START> if (uploadGroup != null && !uploadGroup.isEmpty()) { <END> if (!CollectionsUtil.isAnyIncludedIn(user.getEffectiveGroups(), uploadGroup)) { throw new ServiceNotAuthorizedException(); } } UploadPack up = new UploadPack(repo); if (!pc.allRefsAreVisible()) { up.setRefFilter(new VisibleRefFilter(repo, pc, db.get())); } return up; }</code><technical_language>I prefer push of this logic ProjectControl class itself. add interface: public boolean canUploadPack(); public boolean canReceivePack();</technical_language>

Target:
public UploadPack create(HttpServletRequest req, Repository repo) throws ServiceNotEnabledException, ServiceNotAuthorizedException { final ProjectControl pc = getProjectControl(req); if (!pc.canPerformPackAction(uploadGroup)) { throw new ServiceNotAuthorizedException(); } UploadPack up = new UploadPack(repo); if (!pc.allRefsAreVisible()) { up.setRefFilter(new VisibleRefFilter(repo, pc, db.get())); } return up; }
Source:
<code>public void testFromToString() { final CoordArrayConverter converter = new CoordArrayConverter(); <START> String a = "[(223380.4988791829;6758072.4280857295),(223404.67545027257;6758049.17275259),(223417.0127605943;6758038.021038004),(223450.67625251273;6757924.791645723),(223456.13332351885;6757906.359813054)]"; <END> Coord[] coords = converter.convert(a); Assert.assertEquals(coords.length, 5); Assert.assertEquals(coords[0].hasZ(), false); Assert.assertEquals(coords[0].getX(), 223380.4988791829, 0.00005); Assert.assertEquals(coords[0].getY(), 6758072.4280857295, 0.00005); Assert.assertEquals(coords[1].hasZ(), false); Assert.assertEquals(coords[1].getX(), 223404.67545027257, 0.00005); Assert.assertEquals(coords[1].getY(), 6758049.17275259, 0.00005); Assert.assertEquals(coords[2].hasZ(), false); Assert.assertEquals(coords[2].getX(), 223417.0127605943, 0.00005); Assert.assertEquals(coords[2].getY(), 6758038.021038004, 0.00005); Assert.assertEquals(coords[3].hasZ(), false); Assert.assertEquals(coords[3].getX(), 223450.67625251273, 0.00005); Assert.assertEquals(coords[3].getY(), 6757924.791645723, 0.00005); Assert.assertEquals(coords[4].hasZ(), false); Assert.assertEquals(coords[4].getX(), 223456.13332351885, 0.00005); Assert.assertEquals(coords[4].getY(), 6757906.359813054, 0.00005); String b = converter.convertToString(coords); Assert.assertEquals("[(223380,498879;6758072,428086),(223404,675450;6758049,172753),(223417,012761;6758038,021038),(223450,676253;6757924,791646),(223456,133324;6757906,359813)]", b); }</code><technical_language>numbers, point decimal separators, be</technical_language>

Target:
public void testFromToString() { final CoordArrayConverter converter = new CoordArrayConverter(); String a = "[(223380.4988791829;6758072.4280857295),(223404.67545027257;6758049.17275259),(223417.0127605943;6758038.021038004),(223450.67625251273;6757924.791645723),(223456.13332351885;6757906.359813054)]"; Coord[] coords = converter.convert(a); Assert.assertEquals(coords.length, 5); Assert.assertEquals(coords[0].hasZ(), false); Assert.assertEquals(coords[0].getX(), 223380.4988791829, 0.00005); Assert.assertEquals(coords[0].getY(), 6758072.4280857295, 0.00005); Assert.assertEquals(coords[1].hasZ(), false); Assert.assertEquals(coords[1].getX(), 223404.67545027257, 0.00005); Assert.assertEquals(coords[1].getY(), 6758049.17275259, 0.00005); Assert.assertEquals(coords[2].hasZ(), false); Assert.assertEquals(coords[2].getX(), 223417.0127605943, 0.00005); Assert.assertEquals(coords[2].getY(), 6758038.021038004, 0.00005); Assert.assertEquals(coords[3].hasZ(), false); Assert.assertEquals(coords[3].getX(), 223450.67625251273, 0.00005); Assert.assertEquals(coords[3].getY(), 6757924.791645723, 0.00005); Assert.assertEquals(coords[4].hasZ(), false); Assert.assertEquals(coords[4].getX(), 223456.13332351885, 0.00005); Assert.assertEquals(coords[4].getY(), 6757906.359813054, 0.00005); String b = converter.convertToString(coords); Assert.assertEquals(a, b); }
Source:
<code>public int getMaxActiveFiles() { <START> return getInt("secor.max.file.count", 100); <END> }</code><technical_language>set default -1, caller side if getMaxActiveFiles returns -1 forceUpload, this maintain compatible behavior for installations face memory problem</technical_language>

Target:
public int getMaxActiveFiles() { return getInt("secor.max.file.count", -1); }
Source:
<code>public boolean filterPartitionsByExpr(List<FieldSchema> partColumns, byte[] expr, String defaultPartitionName, List<String> partitionNames) throws MetaException { String partExpr = new String(expr, StandardCharsets.UTF_8); if (LOG.isDebugEnabled()) { LOG.debug("Partition expr: {}", expr); } Set<String> partValueSet = new HashSet<>(); String[] parts = partExpr.split(" AND "); for ( String part : parts){ String[] colAndValue = part.split("="); String key = FileUtils.unescapePathName(colAndValue[0]); String value = FileUtils.unescapePathName(colAndValue[1].substring(1, colAndValue[1].length()-1)); partValueSet.add(key+"="+value); } List<String> partNamesSeq = new ArrayList<>(); for (String partition : partitionNames){ boolean isMatch = true; for ( String col : partValueSet){ if (partition.indexOf(col) == -1){ isMatch = false; break; } } if (isMatch){ partNamesSeq.add(partition); } } partitionNames.clear(); partitionNames.addAll(partNamesSeq); LOG.info("The returned partition list is of size: {}", partitionNames.size()); for(String s : partitionNames){ <START> if (LOG.isDebugEnabled()) { <END> LOG.debug("Matched partition: {}", s); } } return false; }</code><technical_language>This if condition moved of iteration</technical_language>

Target:
public boolean filterPartitionsByExpr(List<FieldSchema> partColumns, byte[] expr, String defaultPartitionName, List<String> partitionNames) throws MetaException { String partExpr = new String(expr, StandardCharsets.UTF_8); if (LOG.isDebugEnabled()) { LOG.debug("Partition expr: {}", expr); } Set<String> partValueSet = new HashSet<>(); String[] parts = partExpr.split(" AND "); for ( String part : parts){ String[] colAndValue = part.split("="); String key = FileUtils.unescapePathName(colAndValue[0]); String value = FileUtils.unescapePathName(colAndValue[1].substring(1, colAndValue[1].length()-1)); partValueSet.add(key+"="+value); } List<String> partNamesSeq = new ArrayList<>(); for (String partition : partitionNames){ boolean isMatch = true; String partnames = partition.split("/"); for (String part: partnames) { if (!partValueSet.contains(FileUtils.unescapePathName(part))){ isMatch = false; break; } } if (isMatch){ partNamesSeq.add(partition); } } partitionNames.clear(); partitionNames.addAll(partNamesSeq); LOG.info("The returned partition list is of size: {}", partitionNames.size()); if (LOG.isDebugEnabled()) { for(String s : partitionNames){ LOG.debug("Matched partition: {}", s); } } return false; }