auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void parseTestTools(PendingCertifiedProductEntity product, PendingCertificationResultEntity cert, int toolColumnBegin) { for(CSVRecord row : getRecord()) { String testToolName = row.get(toolColumnBegin).trim(); String testToolVersion = row.get(toolColumnBegin+1).trim(); if(!StringUtils.isEmpty(testToolName)) { PendingCertificationResultTestToolEntity ttEntity = new PendingCertificationResultTestToolEntity(); ttEntity.setTestToolName(testToolName); ttEntity.setTestToolVersion(testToolVersion); TestToolDTO testTool = testToolDao.getByName(testToolName); if(testTool != null) { if(testTool.isRetired() && product.getIcs().equals("false")) { product.getErrorMessages().add("Test tool '" + testToolName + "' has been retired for a product with Ics=false. Please remove it from the upload file and add a different test tool if necessary."); } ttEntity.setTestToolId(testTool.getId()); } cert.getTestTools().add(ttEntity); } } }

Target:
private void parseTestTools(PendingCertifiedProductEntity product, PendingCertificationResultEntity cert, int toolColumnBegin) { for(CSVRecord row : getRecord()) { String testToolName = row.get(toolColumnBegin).trim(); String testToolVersion = row.get(toolColumnBegin+1).trim(); if(!StringUtils.isEmpty(testToolName)) { PendingCertificationResultTestToolEntity ttEntity = new PendingCertificationResultTestToolEntity(); ttEntity.setTestToolName(testToolName); ttEntity.setTestToolVersion(testToolVersion); TestToolDTO testTool = testToolDao.getByName(testToolName); if(testTool != null) { if(testTool.isRetired() && product.getIcs().equals("false")) { product.getErrorMessages().add("Test tool '" + testToolName + "' has been retired for a product with ICS=false. Please remove it from the upload file and add a different test tool if necessary."); } ttEntity.setTestToolId(testTool.getId()); } cert.getTestTools().add(ttEntity); } } }
Source:
public static Object[][] sampleQueries() { return new Object[][] { { selectFrom("foo").all().whereColumn("k").isEqualTo(bindMarker()), new Object[] {1}, "SELECT * FROM foo WHERE k=?", true }, { deleteFrom("foo").whereColumn("k").isEqualTo(bindMarker()), new Object[] {1}, "DELETE FROM foo WHERE k=?", true }, { deleteFrom("foo").whereColumn("k").isEqualTo(bindMarker()).ifExists(), new Object[] {1}, "DELETE FROM foo WHERE k=? IF EXISTS", false }, { insertInto("foo").value("a", bindMarker()).value("b", bindMarker()), new Object[] {1, "a"}, "INSERT INTO foo (a,b) VALUES (?,?)", true }, { insertInto("foo").value("k", tuple(bindMarker(), function("generate_id"))), new Object[] {1}, "INSERT INTO foo (k) VALUES ((?,generate_id()))", false }, { update("foo").setColumn("v", bindMarker()).whereColumn("k").isEqualTo(bindMarker()), new Object[] {3, 1}, "UPDATE foo SET v=? WHERE k=?", true }, { update("foo") .setColumn("v", function("non_idempotent_func")) .whereColumn("k") .isEqualTo(bindMarker()), new Object[] {1}, "UPDATE foo SET v=non_idempotent_func() WHERE k=?", false }, }; }

Target:
public static Object[][] sampleQueries() { return new Object[][] { { selectFrom("foo").all().whereColumn("k").isEqualTo(bindMarker("k")), ImmutableMap.of("k", 1), "SELECT * FROM foo WHERE k=:k", true }, { deleteFrom("foo").whereColumn("k").isEqualTo(bindMarker("k")), ImmutableMap.of("k", 1), "DELETE FROM foo WHERE k=:k", true }, { deleteFrom("foo").whereColumn("k").isEqualTo(bindMarker("k")).ifExists(), ImmutableMap.of("k", 1), "DELETE FROM foo WHERE k=:k IF EXISTS", false }, { insertInto("foo").value("a", bindMarker("a")).value("b", bindMarker("b")), ImmutableMap.of("a", 1, "b", "b"), "INSERT INTO foo (a,b) VALUES (:a,:b)", true }, { insertInto("foo").value("k", tuple(bindMarker("field1"), function("generate_id"))), ImmutableMap.of("field1", 1), "INSERT INTO foo (k) VALUES ((:field1,generate_id()))", false }, { update("foo").setColumn("v", bindMarker("v")).whereColumn("k").isEqualTo(bindMarker("k")), ImmutableMap.of("v", 3, "k", 1), "UPDATE foo SET v=:v WHERE k=:k", true }, { update("foo") .setColumn("v", function("non_idempotent_func")) .whereColumn("k") .isEqualTo(bindMarker("k")), ImmutableMap.of("k", 1), "UPDATE foo SET v=non_idempotent_func() WHERE k=:k", false }, }; }
Source:
public FunctionImplementationType getFunctionImplementationType() { switch (routineCharacteristics.getLanguage()) { case SQL: return FunctionImplementationType.SQL; case JAVA: return FunctionImplementationType.THRIFT; default: throw new UnsupportedOperationException(format("Unsupported language %s", routineCharacteristics.getLanguage())); } }

Target:
public FunctionImplementationType getFunctionImplementationType() { if (routineCharacteristics.getLanguage().equals(SQL)) { return FunctionImplementationType.SQL; } return FunctionImplementationType.THRIFT; }
Source:
public void theGetMBusEncryptionKeyStatusByChannelResponseIsReturned(final Map<String, String> settings) throws Throwable { final GetMbusEncryptionKeyStatusByChannelAsyncRequest asyncRequest = GetMbusEncryptionKeyStatusByChannelRequestFactory .fromScenarioContext(); final GetMbusEncryptionKeyStatusByChannelResponse response = this.smartMeterConfigurationClient .retrieveGetMbusEncryptionKeyStatusByChannelResponse(asyncRequest); assertNotNull(OPERATION + ": Result should not be null", response.getResult()); assertEquals(OPERATION + ": Result should be OK", OsgpResultType.OK, response.getResult()); assertEquals(OPERATION + "Encryptionkeystatus should be ENCRYPTION_KEY_IN_USE ", EncryptionKeyStatus.ENCRYPTION_KEY_IN_USE, response.getEncryptionKeyStatus()); }

Target:
public void theGetMBusEncryptionKeyStatusByChannelResponseIsReturned(final Map<String, String> settings) throws Throwable { final GetMbusEncryptionKeyStatusByChannelAsyncRequest asyncRequest = GetMbusEncryptionKeyStatusByChannelRequestFactory .fromScenarioContext(); final GetMbusEncryptionKeyStatusByChannelResponse response = this.smartMeterConfigurationClient .retrieveGetMbusEncryptionKeyStatusByChannelResponse(asyncRequest); assertEquals(OPERATION + ", Checking result:", OsgpResultType.OK, response.getResult()); assertEquals(OPERATION + ", Checking EncryptionKeyStatus:", EncryptionKeyStatus.ENCRYPTION_KEY_IN_USE, response.getEncryptionKeyStatus()); }
Source:
public Collection<T> getIntersectingElements(long position) { fLock.readLock().lock(); try { Iterable<T> matchStarts = Iterables.concat(fStartTimesIndex.asMap().headMap(position, true).values()); Iterable<T> matchEnds = Iterables.concat(fEndTimesIndex.asMap().tailMap(position, true).values()); final SetView<T> checkNotNull = checkNotNull(Sets.intersection(Sets.newHashSet(matchStarts), Sets.newHashSet(matchEnds))); return checkNotNull; } finally { fLock.readLock().unlock(); } }

Target:
public Collection<T> getIntersectingElements(long position) { fLock.readLock().lock(); try { Iterable<T> matchStarts = Iterables.concat(fStartTimesIndex.asMap().headMap(position, true).values()); Iterable<T> matchEnds = Iterables.concat(fEndTimesIndex.asMap().tailMap(position, true).values()); return checkNotNull(Sets.intersection(Sets.newHashSet(matchStarts), Sets.newHashSet(matchEnds))); } finally { fLock.readLock().unlock(); } }
Source:
public int hashCode() { return new HashCodeBuilder(3,17) .append(fTreeChar) .append(fPos) .toHashCode(); }

Target:
public int hashCode() { return new HashCodeBuilder() .append(fTreeChar) .append(fPos) .toHashCode(); }
Source:
private int codepointAt(final int idx) { if (idx < 0 || idx >= text.length) { return 0; } return text[idx]; }

Target:
private int codepointAt(final int idx) { if (idx < 0) { return -1; } return text[idx]; }
Source:
public Bean<I, T> findBean(I id) { InfinispanEjbLogger.ROOT_LOGGER.tracef("Locating bean %s", id); BeanEntry<I> entry = this.beanFactory.findValue(id); Bean<I, T> bean = (entry != null) ? this.beanFactory.createBean(id, entry) : null; if (bean == null) { InfinispanEjbLogger.ROOT_LOGGER.debugf("Could not find bean %s", id); return null; } return new SchedulableBean(bean); }

Target:
public Bean<I, T> findBean(I id) { InfinispanEjbLogger.ROOT_LOGGER.tracef("Locating bean %s", id); BeanEntry<I> entry = this.beanFactory.findValue(id); Bean<I, T> bean = (entry != null) ? this.beanFactory.createBean(id, entry) : null; if (bean == null) { InfinispanEjbLogger.ROOT_LOGGER.debugf("Could not find bean %s", id); return null; } this.prepareRescheduling(id); return new SchedulableBean(bean, entry); }
Source:
public RepositoryFileAttributes getAttributes(String storageId, String repositoryId, String artifactPath) throws IOException, NoSuchAlgorithmException, ArtifactTransportException, ProviderImplementationException { logger.debug("******"); artifactOperationsValidator.validate(storageId, repositoryId, artifactPath); final Repository repository = getStorage(storageId).getRepository(repositoryId); LayoutProvider<?> layoutProvider = layoutProviderRegistry.getProvider(repository.getLayout()); RepositoryProvider repositoryProvider = repositoryProviderRegistry.getProvider(repository.getType()); logger.debug("REpository TYpe = "+repositoryProvider.getAlias()); RepositoryPath path = null; try { if(!repositoryProvider.getAlias().equals("group")) path = layoutProvider.resolve(repository).resolve(artifactPath); else path = ((GroupRepositoryProvider)repositoryProvider).getPath(storageId,repositoryId,artifactPath); } catch (Exception e) { e.printStackTrace(); } logger.debug("PATH == "+path.toString()); RepositoryFileAttributes fileAttributes = (RepositoryFileAttributes) Files.readAttributes(path, RepositoryFileAttributes.class); if (fileAttributes == null) { throw new ArtifactResolutionException("Artifact " + artifactPath + " not found."); } return fileAttributes; }

Target:
public RepositoryFileAttributes getAttributes(String storageId, String repositoryId, String artifactPath) throws IOException, NoSuchAlgorithmException, ArtifactTransportException, ProviderImplementationException { artifactOperationsValidator.validate(storageId, repositoryId, artifactPath); final Repository repository = getStorage(storageId).getRepository(repositoryId); RepositoryProvider repositoryProvider = repositoryProviderRegistry.getProvider(repository.getType()); logger.debug("Requested Repository Type = "+repositoryProvider.getAlias()); RepositoryPath path = null; path = (RepositoryPath)repositoryProvider.getPath(storageId, repositoryId, artifactPath); if(path == null) { logger.error("Failed to resolve path for requested artifact"); return null; } RepositoryFileAttributes fileAttributes = (RepositoryFileAttributes) Files.readAttributes(path, RepositoryFileAttributes.class); if (fileAttributes == null) { throw new ArtifactResolutionException("Artifact " + artifactPath + " not found."); } return fileAttributes; }
Source:
protected void updateData(double[] x, @NonNull AnalysisBaseQueryFilter filters, IProgressMonitor monitor) { if (fXYDataProvider == null) { LOGGER.log(Level.WARNING, "Data provider for this viewer is not available"); return; } long currentEnd = 0; while (currentEnd < filters.getQueryInterval().getEndTime().toNanos()) { ICommonXAxisResponse response = fXYDataProvider.fetch(x, filters, monitor); ICommonXAxisModel model = response.getModel(); if (model != null) { updateDisplay(model); } ICommonXAxisResponse.Status status = response.getStatus(); if (status == ICommonXAxisResponse.Status.COMPLETED) { return; } else if (status == ICommonXAxisResponse.Status.FAILED || status == ICommonXAxisResponse.Status.CANCELLED) { LOGGER.log(Level.WARNING, response.getStatusMessage()); return; } else { try { finishedLatch.await(BUILD_UPDATE_TIMEOUT, TimeUnit.MILLISECONDS); } catch (InterruptedException e) { LOGGER.log(Level.INFO, e.getMessage()); return; } } } }

Target:
protected void updateData(double[] x, @NonNull AnalysisBaseQueryFilter filters, IProgressMonitor monitor) { if (fXYDataProvider == null) { LOGGER.log(Level.WARNING, "Data provider for this viewer is not available"); return; } long currentEnd = 0; while (currentEnd < filters.getQueryInterval().getEndTime().toNanos()) { ICommonXAxisResponse response = fXYDataProvider.fetch(x, filters, monitor); ICommonXAxisModel model = response.getModel(); if (model != null) { updateDisplay(model); } ICommonXAxisResponse.Status status = response.getStatus(); currentEnd = response.getCurrentEnd(); if (status == ICommonXAxisResponse.Status.COMPLETED) { return; } else if (status == ICommonXAxisResponse.Status.FAILED || status == ICommonXAxisResponse.Status.CANCELLED) { LOGGER.log(Level.WARNING, response.getStatusMessage()); return; } else { try { finishedLatch.await(BUILD_UPDATE_TIMEOUT, TimeUnit.MILLISECONDS); } catch (InterruptedException e) { LOGGER.log(Level.INFO, e.getMessage()); return; } } } }
Source:
private ValidationResult() { this(null); }

Target:
public ValidationResult() { message = null; }
Source:
private Collection<VDomainModelReference> getView(VView view, EObject newEntry) { final Set<VDomainModelReference> result = new LinkedHashSet<VDomainModelReference>(); final VViewModelProperties properties = ViewModelPropertiesHelper.getInhertitedPropertiesOrEmpty(view); final VView detailView = emfFormsViewService.getView(newEntry, properties); final TreeIterator<EObject> eAllContents = detailView.eAllContents(); while (eAllContents.hasNext()) { final EObject next = eAllContents.next(); if (next instanceof VDomainModelReference) { result.add((VDomainModelReference) next); } } return result; }

Target:
private Collection<VDomainModelReference> getView(VView view, EObject newEntry) { final Set<VDomainModelReference> result = new LinkedHashSet<VDomainModelReference>(); final VViewModelProperties properties = ViewModelPropertiesHelper.getInhertitedPropertiesOrEmpty(view); final VView detailView = emfFormsViewService.getView(newEntry, properties); final TreeIterator<EObject> eAllContents = detailView.eAllContents(); while (eAllContents.hasNext()) { final EObject next = eAllContents.next(); if (next instanceof VDomainModelReference && next.eContainingFeature() == VViewPackage.eINSTANCE.getControl_DomainModelReference()) { result.add((VDomainModelReference) next); } } return result; }
Source:
public void testComma() { final CsvInputFormat format = new CsvInputFormat(Collections.singletonList("a"), ",", false, 0); expectedException.expect(IllegalArgumentException.class); expectedException.expectMessage("column[a,] not in columns"); format.createReader( new TimestampSpec("timestamp", "auto", null), new DimensionsSpec(DimensionsSpec.getDefaultSchemas(Arrays.asList("a,", "b"))) ); }

Target:
public void testComma() { expectedException.expect(IllegalArgumentException.class); expectedException.expectMessage("Column[a,] has a comma, it cannot"); new CsvInputFormat(Collections.singletonList("a,"), ",", false, 0); }
Source:
public String getAsString(FacesContext context, UIComponent component, Object value) { if (null != value && null != component && null != component.getAttributes()) { Map<String, Object> attributes = component.getAttributes(); if (attributes.containsKey("pattern")) { pattern = (String) attributes.get("pattern"); } setPattern(pattern); if (attributes.containsKey("locale")) { locale = (Locale) attributes.get("locale"); } setLocale(locale); if (attributes.containsKey("timeZone")) { timeZone = (TimeZone) attributes.get("timeZone"); } setTimeZone(timeZone); if (attributes.containsKey("dateStyle")) { dateStyle = (String) attributes.get("dateStyle"); } setDateStyle(dateStyle); if (attributes.containsKey("timeStyle")) { timeStyle = (String) attributes.get("timeStyle"); } setTimeStyle(timeStyle); if (attributes.containsKey("type")) { type = (String) attributes.get("type"); } setType(type); XMLGregorianCalendar xmlGregCal = (XMLGregorianCalendar) value; Date date = xmlGregCal.toGregorianCalendar().getTime(); return super.getAsString(context, component, date); } return ""; }

Target:
public String getAsString(FacesContext context, UIComponent component, Object value) { if (null != component && null != component.getAttributes()) { Map<String, Object> attributes = component.getAttributes(); if (attributes.containsKey("pattern")) { pattern = (String) attributes.get("pattern"); } setPattern(pattern); if (attributes.containsKey("locale")) { locale = (Locale) attributes.get("locale"); } setLocale(locale); if (attributes.containsKey("timeZone")) { timeZone = (TimeZone) attributes.get("timeZone"); } setTimeZone(timeZone); if (attributes.containsKey("dateStyle")) { dateStyle = (String) attributes.get("dateStyle"); } setDateStyle(dateStyle); if (attributes.containsKey("timeStyle")) { timeStyle = (String) attributes.get("timeStyle"); } setTimeStyle(timeStyle); if (attributes.containsKey("type")) { type = (String) attributes.get("type"); } setType(type); } if (null != value) { return super.getAsString(context, component, ((XMLGregorianCalendar) value).toGregorianCalendar(). getTime()); } return ""; }
Source:
void reportHasValues() { assertThat(eitherWithA.hasA()).isTrue(); assertThat(eitherWithA.hasB()).isFalse(); assertThat(eitherWithB.hasB()).isTrue(); assertThat(eitherWithB.hasA()).isFalse(); }

Target:
void reportHasValues() { assertTrue(eitherWithA.hasA()); assertFalse(eitherWithA.hasB()); assertTrue(eitherWithB.hasB()); assertFalse(eitherWithB.hasA()); }
Source:
public Assignees assignees() { return new MkAssignees(); }

Target:
public Assignees assignees() { throw new UnsupportedOperationException(); }
Source:
public DataSet<ExecRow> getDataSet(SpliceOperation op, DataSetProcessor dsp, ExecRow execRow) throws StandardException { operationContext = dsp.createOperationContext(op); ArrayList<ExecRow> items = new ArrayList<ExecRow>(); Activation activation = op.getActivation(); LanguageConnectionContext lcc = activation.getLanguageConnectionContext(); TransactionController tc = lcc.getTransactionExecute(); DataDictionaryImpl dd = (DataDictionaryImpl)lcc.getDataDictionary(); List<SchemaDescriptor> schemas= dd.getAllSchemas(tc); for(SchemaDescriptor schema: schemas) { String schemaName = schema.getSchemaName(); StatementPermission statementPermission = new StatementSchemaPermission(schemaName, null, Authorizer.ACCESS_PRIV); if (!lcc.getAuthorizer().canSeeSchema(lcc.getLastActivation(), statementPermission)) { ValueRow valueRow = new ValueRow(1); valueRow.setColumn(1, new SQLVarchar(schemaName)); items.add(valueRow); } } return dsp.createDataSet(items.iterator()); }

Target:
public DataSet<ExecRow> getDataSet(SpliceOperation op, DataSetProcessor dsp, ExecRow execRow) throws StandardException { operationContext = dsp.createOperationContext(op); ArrayList<ExecRow> items = new ArrayList<ExecRow>(); Activation activation = op.getActivation(); LanguageConnectionContext lcc = activation.getLanguageConnectionContext(); TransactionController tc = lcc.getTransactionExecute(); DataDictionaryImpl dd = (DataDictionaryImpl)lcc.getDataDictionary(); List<SchemaDescriptor> schemas= dd.getAllSchemas(tc); for(SchemaDescriptor schema: schemas) { String schemaName = schema.getSchemaName(); if (lcc.getAuthorizer().canSeeSchema(activation, schemaName, schema.getAuthorizationId())) { ValueRow valueRow = new ValueRow(1); valueRow.setColumn(1, new SQLVarchar(schemaName)); items.add(valueRow); } } return dsp.createDataSet(items.iterator()); }
Source:
public void testLockUseAfterPartitionWithoutMajority() throws Throwable { ClusteredLockManager clm0 = EmbeddedClusteredLockManagerFactory.from(getCacheManagers().get(0)); ClusteredLockManager clm1 = EmbeddedClusteredLockManagerFactory.from(getCacheManagers().get(1)); ClusteredLockManager clm2 = EmbeddedClusteredLockManagerFactory.from(getCacheManagers().get(2)); ClusteredLockManager clm3 = EmbeddedClusteredLockManagerFactory.from(getCacheManagers().get(3)); ClusteredLockManager clm4 = EmbeddedClusteredLockManagerFactory.from(getCacheManagers().get(4)); ClusteredLockManager clm5 = EmbeddedClusteredLockManagerFactory.from(getCacheManagers().get(5)); clm0.defineLock(LOCK_NAME); assertTrue(clm0.isDefined(LOCK_NAME)); ClusteredLock lock0 = clm0.get(LOCK_NAME); ClusteredLock lock1 = clm1.get(LOCK_NAME); ClusteredLock lock2 = clm2.get(LOCK_NAME); ClusteredLock lock3 = clm3.get(LOCK_NAME); ClusteredLock lock4 = clm4.get(LOCK_NAME); ClusteredLock lock5 = clm5.get(LOCK_NAME); splitCluster(new int[]{0, 1, 2}, new int[]{3, 4, 5}); asList(lock0, lock1, lock2, lock3, lock4, lock5).forEach(lock -> { assertNotNull(lock); assertFalse(await(lock.tryLock(100, TimeUnit.MILLISECONDS).exceptionally(ex -> { assertException(ClusteredLockException.class, ex); assertException(AvailabilityException.class, ex.getCause()); return Boolean.FALSE; }))); }); }

Target:
public void testLockUseAfterPartitionWithoutMajority() throws Throwable { ClusteredLockManager clm0 = EmbeddedClusteredLockManagerFactory.from(getCacheManagers().get(0)); ClusteredLockManager clm1 = EmbeddedClusteredLockManagerFactory.from(getCacheManagers().get(1)); ClusteredLockManager clm2 = EmbeddedClusteredLockManagerFactory.from(getCacheManagers().get(2)); ClusteredLockManager clm3 = EmbeddedClusteredLockManagerFactory.from(getCacheManagers().get(3)); ClusteredLockManager clm4 = EmbeddedClusteredLockManagerFactory.from(getCacheManagers().get(4)); ClusteredLockManager clm5 = EmbeddedClusteredLockManagerFactory.from(getCacheManagers().get(5)); clm0.defineLock(LOCK_NAME); assertTrue(clm0.isDefined(LOCK_NAME)); ClusteredLock lock0 = clm0.get(LOCK_NAME); ClusteredLock lock1 = clm1.get(LOCK_NAME); ClusteredLock lock2 = clm2.get(LOCK_NAME); ClusteredLock lock3 = clm3.get(LOCK_NAME); ClusteredLock lock4 = clm4.get(LOCK_NAME); ClusteredLock lock5 = clm5.get(LOCK_NAME); splitCluster(new int[]{0, 1, 2}, new int[]{3, 4, 5}); asList(lock0, lock1, lock2, lock3, lock4, lock5).forEach(lock -> { assertNotNull(lock); assertFalse(await(lock.tryLock(100, TimeUnit.MILLISECONDS).exceptionally(ex -> { assertException(ClusteredLockException.class, AvailabilityException.class, ex); return Boolean.FALSE; }))); }); }
Source:
protected Class<?> checkForBoundClass() { if (boundClass == null) { throw new IndexOperationsException("IndexOperations are not bound"); } return boundClass; }

Target:
protected Class<?> checkForBoundClass() { if (boundClass == null) { throw new InvalidDataAccessApiUsageException("IndexOperations are not bound"); } return boundClass; }
Source:
private void updateAndClearDocuments(List<Document> documentsToUpdate) { if (documentsToUpdate.isEmpty()) { return; } print("Batch updating " + documentsToUpdate.size() + " documents..."); if (!isPreview) { try { SearchManager.putDocuments(Const.SearchIndex.FEEDBACK_RESPONSE_COMMENT, documentsToUpdate); } catch (Exception e) { throw new RuntimeException("Failed to update one or more documents. Please rerun this script.", e); } } println(" done."); documentsToUpdate.clear(); }

Target:
private void updateAndClearDocuments(List<Document> documentsToUpdate) { if (documentsToUpdate.isEmpty()) { return; } println("Batch updating " + documentsToUpdate.size() + " documents..."); if (!isPreview) { try { invokePutDocumentsWithRetry(Const.SearchIndex.FEEDBACK_RESPONSE_COMMENT, documentsToUpdate); println("Batch update succeeded."); } catch (PutException e) { println("Batch update failed with non-transient errors."); } catch (MaximumRetriesExceededException e) { println("Batch update failed after maximum retries."); } } documentsToUpdate.clear(); }
Source:
public CsvOutputFormat(String recordDelimiter, String fieldDelimiter, Class<? extends Value> ... types) { if (recordDelimiter == null) throw new IllegalArgumentException("RecordDelmiter shall not be null."); if (fieldDelimiter == null) throw new IllegalArgumentException("FieldDelimiter shall not be null."); if (types.length == 0) throw new IllegalArgumentException("No field types given."); this.fieldDelimiter = fieldDelimiter; this.recordDelimiter = recordDelimiter; this.numFields = types.length; @SuppressWarnings("unchecked") Class<Value>[] classes = new Class[types.length]; this.classes = classes; this.recordPositions = new int[types.length]; this.lenient = false; for (int i = 0; i < types.length; i++) { if (types[i] == null) throw new IllegalArgumentException("Invalid Constructor Parameter: No type class for parameter " + (2 + i)); this.classes[i] = types[i]; this.recordPositions[i] = i; } genericInstantiation = false; }

Target:
public CsvOutputFormat(String recordDelimiter, String fieldDelimiter, Class<? extends Value>... types) { if (recordDelimiter == null) { throw new IllegalArgumentException("RecordDelmiter shall not be null."); } if (fieldDelimiter == null) { throw new IllegalArgumentException("FieldDelimiter shall not be null."); } if (types.length == 0) { throw new IllegalArgumentException("No field types given."); } this.fieldDelimiter = fieldDelimiter; this.recordDelimiter = recordDelimiter; this.lenient = false; setTypes(types); }
Source:
public void testConvertProfileEntryDto() { final ProfileEntry result = this.mapper.map(this.profileEntryDto(), ProfileEntry.class); Assert.assertTrue(result != null && result instanceof ProfileEntry); }

Target:
public void testConvertProfileEntryDto() { final ProfileEntry result = this.mapper.map(this.profileEntryDto(), ProfileEntry.class); assertNotNull("mapping ProfileEntryDto should not return null", result); assertThat("mapping ProfileEntryDto should return correct type", result, instanceOf(ProfileEntry.class)); }
Source:
public void returnsProperResponseCodeOnNoContentLength() throws Exception { final Socket socket = Mockito.mock(Socket.class); final String requests = Joiner.on(BkBasicTest.CRLF).join( BkBasicTest.POST, BkBasicTest.HOST, "", "Hello World!" ); final InputStream input = new ByteArrayInputStream(requests.getBytes()); final OutputStream output = new ByteArrayOutputStream(); Mockito.when(socket.getLocalAddress()).thenReturn( InetAddress.getLocalHost() ); Mockito.when(socket.getInetAddress()).thenReturn( InetAddress.getLocalHost() ); Mockito.when(socket.getLocalPort()).thenReturn(0); Mockito.when(socket.getPort()).thenReturn(0); Mockito.when(socket.getInputStream()).thenReturn(input); Mockito.when(socket.getOutputStream()).thenReturn(output); new BkBasic(new TkText("411 Test")).accept(socket); MatcherAssert.assertThat( socket.getOutputStream().toString(), Matchers.containsString("HTTP/1.1 411 Length Required") ); }

Target:
public void returnsProperResponseCodeOnNoContentLength() throws Exception { final ByteArrayOutputStream output = new ByteArrayOutputStream(); final ServerSocket server = new ServerSocket(0); try { new Thread( new Runnable() { @Override public void run() { try { new BkBasic(new TkText("411 Test")).accept( server.accept() ); } catch (final IOException exception) { throw new IllegalStateException(exception); } } } ).start(); final Socket socket = new Socket( server.getInetAddress(), server.getLocalPort() ); try { socket.getOutputStream().write( Joiner.on(BkBasicTest.CRLF).join( BkBasicTest.POST, BkBasicTest.HOST, "", "Hello World!" ).getBytes() ); final InputStream input = socket.getInputStream(); final byte[] buffer = new byte[4096]; for (int count = input.read(buffer); count != -1; count = input.read(buffer)) { output.write(buffer, 0, count); } } finally { socket.close(); } } finally { server.close(); } MatcherAssert.assertThat( output.toString(), Matchers.containsString("HTTP/1.1 411 Length Required") ); }
Source:
public String toString() { StringBuilder sb = new StringBuilder(256) .append(StringUtil.simpleClassName(this)) .append("(protocolVersion: ").append(protocolVersion) .append(", command: ").append(command) .append(", proxiedProtocol: ").append(proxiedProtocol) .append(", sourceAddress: ").append(sourceAddress) .append(", destinationAddress: ").append(destinationAddress) .append(", sourcePort: ").append(sourcePort) .append(", destinationPort: ").append(destinationPort) .append(", tlvs: ["); for (HAProxyTLV tlv: tlvs) { sb.append(tlv).append(", "); } if (!tlvs.isEmpty()) { sb.setLength(sb.length() - 2); } sb.append("])"); return sb.toString(); }

Target:
public String toString() { StringBuilder sb = new StringBuilder(256) .append(StringUtil.simpleClassName(this)) .append("(protocolVersion: ").append(protocolVersion) .append(", command: ").append(command) .append(", proxiedProtocol: ").append(proxiedProtocol) .append(", sourceAddress: ").append(sourceAddress) .append(", destinationAddress: ").append(destinationAddress) .append(", sourcePort: ").append(sourcePort) .append(", destinationPort: ").append(destinationPort) .append(", tlvs: ["); if (!tlvs.isEmpty()) { for (HAProxyTLV tlv: tlvs) { sb.append(tlv).append(", "); } sb.setLength(sb.length() - 2); } sb.append("])"); return sb.toString(); }
Source:
public String toString() { if (scanner != null) { return "SeqScanExec:" + planInfo + "," + scanner.getClass().getName(); } else { return "SeqScanExec:" + planInfo; } }

Target:
public String toString() { if (scanner != null) { return "SeqScanExec:" + plan + "," + scanner.getClass().getName(); } else { return "SeqScanExec:" + plan; } }
Source:
private Naether createNaetherWithRepository(String repository, String libraryFolder) { Naether naether = new NaetherImpl(); naether.setLocalRepoPath(new File(libraryFolder).toPath().toAbsolutePath().toString()); try { naether.setRemoteRepositories(Sets.newHashSet( RepoBuilder.remoteRepositoryFromUrl(repository) )); } catch (MalformedURLException e) { logger.log(Level.WARNING, "Unable to resolve library dependencies. Falling back to " + "explicitly defined dependencies only.", e); return null; } return naether; }

Target:
private Naether createNaetherWithRepository(String repository, String libraryFolder) { Naether naether = new NaetherImpl(); naether.setLocalRepoPath(new File(libraryFolder).getAbsolutePath()); try { naether.setRemoteRepositories(Sets.newHashSet( RepoBuilder.remoteRepositoryFromUrl(repository) )); } catch (MalformedURLException e) { logger.log(Level.WARNING, "Unable to resolve library dependencies. Falling back to " + "explicitly defined dependencies only.", e); return null; } return naether; }
Source:
public ResponseEntity<Problem> handleFeatureTurnedOff(final FeatureNotAvailableException ex, final NativeWebRequest request) { LOG.debug(ex.getMessage(), ex); return Responses.create(Problem.valueOf(NOT_IMPLEMENTED, "Feature is disabled"), request); }

Target:
public ResponseEntity<Problem> handleFeatureTurnedOff(final FeatureNotAvailableException ex, final NativeWebRequest request) { LOG.debug(ex.getMessage(), ex); return Responses.create(Problem.valueOf(NOT_IMPLEMENTED, ex.getMessage()), request); }
Source:
protected Result check() throws Exception { Response response; try { response = toolsExtendedApi.toolsIndexSearch(null, null, null); } catch (CustomWebApplicationException ex) { ex.printStackTrace(); return Result.unhealthy("Error contacting Elastic Search: " + ex.getResponse().getEntity()); } catch (Exception ex) { ex.printStackTrace(); return Result.unhealthy("Error contacting Elastic Search: " + ex.getMessage()); } if (response.getStatus() >= LOWER_BOUND_SUCCESS_STATUS && response.getStatus() < UPPER_BOUND_SUCCESS_STATUS) { return Result.healthy(); } else { return Result.unhealthy("Error contacting Elastic Search, got status code '" + response.getStatus() + "'."); } }

Target:
protected Result check() throws Exception { String baseMessage = "Error contacting Elastic Search"; Response response; try { response = toolsExtendedApi.toolsIndexSearch(null, null, null); } catch (CustomWebApplicationException ex) { LOG.info(baseMessage, ex); return Result.unhealthy(baseMessage + ": " + ex.getResponse().getEntity()); } catch (Exception ex) { LOG.info(baseMessage, ex); return Result.unhealthy(baseMessage + ": " + ex.getMessage()); } if (response.getStatus() >= Response.Status.OK.getStatusCode() && response.getStatus() < Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()) { return Result.healthy(); } else { return Result.unhealthy(baseMessage + ", got status code '" + response.getStatus() + "'."); } }
Source:
private static boolean validateTimeRange() { boolean isEmpty = fStartTimeRangeText.getText().isEmpty() || fEndTimeRangeText.getText().isEmpty(); return parseTimeRange() && fStartTimestamp.compareTo(fEndTimestamp) <= 0 && !isEmpty; }

Target:
private boolean validateTimeRange() { boolean isEmpty = fStartTimeRangeText.getText().isEmpty() || fEndTimeRangeText.getText().isEmpty(); return !isEmpty && parseTimeRange() && fStartTimestamp.compareTo(fEndTimestamp) <= 0; }
Source:
public AstConnectNode visitConnectNode(ConnectNodeContext ctx) { AstLocationVisitor locationVisitor = new AstLocationVisitor(elFactory, elContext); AstLocation location = locationVisitor.visit(ctx.connectURI); node = new AstConnectNode(); node.setLocation(location); node.setEnvironment(elContext); super.visitConnectNode(ctx); node.setRegionInfo(asParallelRegion(childInfos, ctx)); Token barrier = ctx.barrier; if (barrier != null) { node.setBarrier(barrier.getText()); } RobotParser.LocationContext transport = ctx.value; if (transport != null) { AstLocationVisitor transportVisitor = new AstLocationVisitor(elFactory, elContext); AstLocation transportLocation = transportVisitor.visit(ctx.value); node.getOptions().put("transport", transportLocation); } return node; }

Target:
public AstConnectNode visitConnectNode(ConnectNodeContext ctx) { AstLocationVisitor locationVisitor = new AstLocationVisitor(elFactory, elContext); AstLocation location = locationVisitor.visit(ctx.connectURI); node = new AstConnectNode(); node.setLocation(location); node.setEnvironment(elContext); super.visitConnectNode(ctx); node.setRegionInfo(asParallelRegion(childInfos, ctx)); Token barrier = ctx.barrier; if (barrier != null) { node.setBarrier(barrier.getText()); } LocationContext transport = ctx.value; if (transport != null) { AstLocationVisitor transportVisitor = new AstLocationVisitor(elFactory, elContext); AstLocation transportLocation = transportVisitor.visit(ctx.value); node.getOptions().put("transport", transportLocation); } return node; }
Source:
private void register( LuceneFulltext fulltextIndex, int side ) throws IOException { configurationLock.writeLock().lock(); try { WritableFulltext writableFulltext = new WritableFulltext( fulltextIndex ); writableFulltext.open(); if ( fulltextIndex.getType() == FulltextIndexType.NODES ) { if ( !matchesConfiguration( writableFulltext ) ) { writableFulltext.drop(); writableFulltext.open(); if ( !writableFulltext.getProperties().isEmpty() ) { applier.populateNodes( writableFulltext, db ); } } writableNodeIndices[side].put( fulltextIndex.getIdentifier(), writableFulltext ); } else { if ( !matchesConfiguration( writableFulltext ) ) { writableFulltext.drop(); writableFulltext.open(); if ( !writableFulltext.getProperties().isEmpty() ) { applier.populateRelationships( writableFulltext, db ); } } writableRelationshipIndices[side].put( fulltextIndex.getIdentifier(), writableFulltext ); } } finally { configurationLock.writeLock().unlock(); } }

Target:
private void register( LuceneFulltext fulltextIndex, int side ) throws IOException { WritableFulltext writableFulltext = new WritableFulltext( fulltextIndex ); writableFulltext.open(); if ( fulltextIndex.getType() == FulltextIndexType.NODES ) { if ( !matchesConfiguration( writableFulltext ) ) { writableFulltext.drop(); writableFulltext.open(); if ( !writableFulltext.getProperties().isEmpty() ) { applier.populateNodes( writableFulltext, db ); } } writableNodeIndices[side].put( fulltextIndex.getIdentifier(), writableFulltext ); } else { if ( !matchesConfiguration( writableFulltext ) ) { writableFulltext.drop(); writableFulltext.open(); if ( !writableFulltext.getProperties().isEmpty() ) { applier.populateRelationships( writableFulltext, db ); } } writableRelationshipIndices[side].put( fulltextIndex.getIdentifier(), writableFulltext ); } }
Source:
public void dump() { try (StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw)) { dump(pw); pw.flush(); sw.flush(); LOGGER.info(sw.toString()); } catch (IOException e) { LOGGER.log(Level.SEVERE, e.getMessage(), e); } }

Target:
public void dump() { try (StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw)) { dump(pw); pw.flush(); sw.flush(); LOGGER.fine(sw.toString()); } catch (IOException e) { LOGGER.log(Level.SEVERE, e.getMessage(), e); } }
Source:
public Map<String, Map<String, Boolean>> getAllPartitionsHealthOnLiveInstance(RESTConfig restConfig, Map<String, String> customPayLoads) { List<String> liveInstances = getChildNames(keyBuilder().liveInstances()); List<HelixProperty> zkHealthReports = getProperty(liveInstances.stream() .map(instance -> keyBuilder().healthReport(instance, PARTITION_HEALTH_KEY)) .collect(Collectors.toList()), false); Map<String, Future<Map<String, Boolean>>> parallelTasks = new HashMap<>(); for (int i = 0; i < liveInstances.size(); i++) { String liveInstance = liveInstances.get(i); Optional<ZNRecord> maybeHealthRecord = zkHealthReports != null && zkHealthReports.size() > i ? Optional.ofNullable(zkHealthReports.get(i).getRecord()) : Optional.empty(); parallelTasks.put(liveInstance, POOL.submit(() -> maybeHealthRecord .map(record -> getPartitionsHealth(liveInstance, record, restConfig, customPayLoads)) .orElseGet(() -> getHealthStatusFromRest(liveInstance, Collections.emptyList(), restConfig, customPayLoads)))); } Map<String, Map<String, Boolean>> result = new HashMap<>(); for (Map.Entry<String, Future<Map<String, Boolean>>> instanceToFuturePartitionHealth : parallelTasks .entrySet()) { String instance = instanceToFuturePartitionHealth.getKey(); try { result.put(instance, instanceToFuturePartitionHealth.getValue().get()); } catch (InterruptedException | ExecutionException e) { LOG.error("Failed to get partition health for instance {}", instance, e); result.put(instance, Collections.emptyMap()); } } return result; }

Target:
public Map<String, Map<String, Boolean>> getAllPartitionsHealthOnLiveInstance( RESTConfig restConfig, Map<String, String> customPayLoads) { List<String> liveInstances = getChildNames(keyBuilder().liveInstances()); List<HelixProperty> zkHealthReports = getProperty(liveInstances.stream() .map(instance -> keyBuilder().healthReport(instance, PARTITION_HEALTH_KEY)) .collect(Collectors.toList()), false); Map<String, Future<Map<String, Boolean>>> parallelTasks = new HashMap<>(); for (int i = 0; i < liveInstances.size(); i++) { String liveInstance = liveInstances.get(i); Optional<ZNRecord> maybeHealthRecord = Optional.ofNullable(zkHealthReports.get(i)).map(HelixProperty::getRecord); parallelTasks.put(liveInstance, POOL.submit(() -> maybeHealthRecord .map(record -> getPartitionsHealth(liveInstance, record, restConfig, customPayLoads)) .orElseGet(() -> getHealthStatusFromRest(liveInstance, Collections.emptyList(), restConfig, customPayLoads)))); } Map<String, Map<String, Boolean>> result = new HashMap<>(); for (Map.Entry<String, Future<Map<String, Boolean>>> instanceToFuturePartitionHealth : parallelTasks .entrySet()) { String instance = instanceToFuturePartitionHealth.getKey(); try { result.put(instance, instanceToFuturePartitionHealth.getValue().get()); } catch (InterruptedException | ExecutionException e) { LOG.error("Failed to get partition health for instance {}", instance, e); result.put(instance, Collections.emptyMap()); } } return result; }
Source:
private void insert(double x, double y, T item) { if (!this.mBounds.contains(x, y)) { return; } if (this.mChildren != null) { for (PointQuadTree<T> quad : mChildren) { quad.insert(x, y, item); } return; } if (mItems == null) { mItems = new ArrayList<T>(); } mItems.add(item); if (mItems.size() > MAX_ELEMENTS && mDepth < MAX_DEPTH) { split(); } }

Target:
private boolean insert(double x, double y, T item) { if (!this.mBounds.contains(x, y)) { return false; } if (this.mChildren != null) { for (PointQuadTree<T> quad : mChildren) { if (quad.insert(x, y, item)) { return true; } } return false; } if (mItems == null) { mItems = new ArrayList<T>(); } mItems.add(item); if (mItems.size() > MAX_ELEMENTS && mDepth < MAX_DEPTH) { split(); } return true; }
Source:
public Integer deleteCategories(String contextInode) throws Exception { UserWebAPI uWebAPI = WebAPILocator.getUserWebAPI(); WebContext ctx = WebContextFactory.get(); HttpServletRequest request = ctx.getHttpServletRequest(); User user = uWebAPI.getLoggedInUser(request); AtomicInteger returnValue = new AtomicInteger(0); if (UtilMethods.isSet(contextInode)) { Category parent = categoryAPI.find(contextInode, user, false); List<Category> unableToDelete = categoryAPI.removeAllChildren(parent, user, false); if(UtilMethods.isSet(unableToDelete)) { returnValue.set(1); } } else { categoryAPI.deleteAll(user, false); } return returnValue.get(); }

Target:
public Integer deleteCategories(String contextInode) throws Exception { UserWebAPI uWebAPI = WebAPILocator.getUserWebAPI(); WebContext ctx = WebContextFactory.get(); HttpServletRequest request = ctx.getHttpServletRequest(); User user = uWebAPI.getLoggedInUser(request); int returnValue = ALL_CATEGORIES_DELETED; if (UtilMethods.isSet(contextInode)) { Category parent = categoryAPI.find(contextInode, user, false); List<Category> unableToDelete = categoryAPI.removeAllChildren(parent, user, false); if(UtilMethods.isSet(unableToDelete)) { returnValue = SOME_CATEGORIES_DELETED; } } else { categoryAPI.deleteAll(user, false); } return returnValue; }
Source:
public boolean isOpen() { return connection.isOpen(); }

Target:
public boolean isOpen() { return isOpen; }
Source:
static boolean createPluginJSONFile(String location) { InputStream in = FileProvisionUtil.class.getResourceAsStream("/" + PLUGINS_JSON_FILENAME); File targetFile = new File(location); try { FileUtils.copyInputStreamToFile(in, targetFile); return true; } catch (IOException e) { LOG.error("Could not create " + PLUGINS_JSON_FILENAME); e.printStackTrace(); } return false; }

Target:
static boolean createPluginJSONFile(String location) { InputStream in = FileProvisionUtil.class.getResourceAsStream("/" + PLUGINS_JSON_FILENAME); File targetFile = new File(location); try { FileUtils.copyInputStreamToFile(in, targetFile); return true; } catch (IOException e) { LOG.error(e.getMessage() + ". Could not create " + PLUGINS_JSON_FILENAME); } return false; }
Source:
private static SSAInstruction[] makeStatements(Context context) { ArrayList<SSAInstruction> statements = new ArrayList<>(); int nextLocal = 2; int retValue = nextLocal++; TypeReference tr = ((TypeAbstraction) context.get(ContextKey.RECEIVER)).getTypeReference(); SSAInstructionFactory insts = ((TypeAbstraction) context.get(ContextKey.RECEIVER)) .getType() .getClassLoader() .getInstructionFactory(); if (tr != null) { SSALoadMetadataInstruction l = insts.LoadMetadataInstruction( statements.size(), retValue, TypeReference.JavaLangClass, tr); statements.add(l); SSAReturnInstruction R = insts.ReturnInstruction(statements.size(), retValue, false); statements.add(R); } SSAInstruction[] result = new SSAInstruction[statements.size()]; Iterator<SSAInstruction> it = statements.iterator(); Arrays.setAll(result, i -> it.next()); return result; }

Target:
private static SSAInstruction[] makeStatements(Context context) { ArrayList<SSAInstruction> statements = new ArrayList<>(); int nextLocal = 2; int retValue = nextLocal++; TypeReference tr = ((TypeAbstraction) context.get(ContextKey.RECEIVER)).getTypeReference(); SSAInstructionFactory insts = ((TypeAbstraction) context.get(ContextKey.RECEIVER)) .getType() .getClassLoader() .getInstructionFactory(); if (tr != null) { SSALoadMetadataInstruction l = insts.LoadMetadataInstruction( statements.size(), retValue, TypeReference.JavaLangClass, tr); statements.add(l); SSAReturnInstruction R = insts.ReturnInstruction(statements.size(), retValue, false); statements.add(R); } return statements.toArray(new SSAInstruction[0]); }
Source:
public T head() { int offset = 0; for (int i = 0; i < getWordsNum(); i++) { if(elements[i] != 0) { return fromInt.apply(offset + Long.numberOfTrailingZeros(elements[i])); } offset += BITS_PER_WORD; } throw new NoSuchElementException("head of empty BitSet"); }

Target:
public T head() { int offset = 0; for (int i = 0; i < getWordsNum(); i++) { if(elements[i] == 0) { offset += BITS_PER_WORD; } else { return fromInt.apply(offset + Long.numberOfTrailingZeros(elements[i])); } } throw new NoSuchElementException("head of empty BitSet"); }
Source:
public void run() { if (!mAlive) { return; } final View viewRoot = mViewRoot.get(); if (null == viewRoot || mDying) { cleanUp(); return; } try { mEdit.visit(viewRoot); } catch (ViewVisitor.LayoutUpdateException e) { cleanUp(); throw e; } mHandler.removeCallbacks(this); mHandler.postDelayed(this, 1000); }

Target:
public void run() { if (!mAlive) { return; } final View viewRoot = mViewRoot.get(); if (null == viewRoot || mDying) { cleanUp(); return; } mEdit.visit(viewRoot); mHandler.removeCallbacks(this); mHandler.postDelayed(this, 1000); }
Source:
private void setListAppearance() { mList.setDivider(null); mList.setChildDivider(null); Drawable icon = mContext.getResources().getDrawable(R.drawable.snackbar_group_indicator); mList.setGroupIndicator(icon); mList.setIndicatorBounds( 1200 - Utils.getPixelFromDips(60), 1200 - Utils.getPixelFromDips(32) ); }

Target:
private void setListAppearance() { mList.setDivider(null); mList.setChildDivider(null); }
Source:
protected void sendProxyRequest( HttpServletRequest clientRequest, HttpServletResponse proxyResponse, Request proxyRequest ) { proxyRequest.timeout(httpClientConfig.getReadTimeout().getMillis(), TimeUnit.MILLISECONDS); proxyRequest.idleTimeout(httpClientConfig.getReadTimeout().getMillis(), TimeUnit.MILLISECONDS); byte[] avaticaQuery = (byte[]) clientRequest.getAttribute(AVATICA_QUERY_ATTRIBUTE); if (avaticaQuery != null) { proxyRequest.content(new BytesContentProvider(avaticaQuery)); } final Query query = (Query) clientRequest.getAttribute(QUERY_ATTRIBUTE); if (query != null) { final ObjectMapper objectMapper = (ObjectMapper) clientRequest.getAttribute(OBJECTMAPPER_ATTRIBUTE); try { proxyRequest.content(new BytesContentProvider(objectMapper.writeValueAsBytes(query))); } catch (JsonProcessingException e) { Throwables.propagate(e); } } clientRequest.setAttribute(AuthConfig.DRUID_AUTHORIZATION_CHECKED, true); authenticatorMapper.getAuthenticatorChain() .stream() .forEach(authenticator -> authenticator.decorateProxyRequest( clientRequest, proxyResponse, proxyRequest )); super.sendProxyRequest( clientRequest, proxyResponse, proxyRequest ); }

Target:
protected void sendProxyRequest( HttpServletRequest clientRequest, HttpServletResponse proxyResponse, Request proxyRequest ) { proxyRequest.timeout(httpClientConfig.getReadTimeout().getMillis(), TimeUnit.MILLISECONDS); proxyRequest.idleTimeout(httpClientConfig.getReadTimeout().getMillis(), TimeUnit.MILLISECONDS); byte[] avaticaQuery = (byte[]) clientRequest.getAttribute(AVATICA_QUERY_ATTRIBUTE); if (avaticaQuery != null) { proxyRequest.content(new BytesContentProvider(avaticaQuery)); } final Query query = (Query) clientRequest.getAttribute(QUERY_ATTRIBUTE); if (query != null) { final ObjectMapper objectMapper = (ObjectMapper) clientRequest.getAttribute(OBJECTMAPPER_ATTRIBUTE); try { proxyRequest.content(new BytesContentProvider(objectMapper.writeValueAsBytes(query))); } catch (JsonProcessingException e) { Throwables.propagate(e); } } clientRequest.setAttribute(AuthConfig.DRUID_AUTHORIZATION_CHECKED, true); AuthenticationResult authenticationResult = (AuthenticationResult) clientRequest.getAttribute( AuthConfig.DRUID_AUTHENTICATION_RESULT); if (authenticationResult != null && authenticationResult.getAuthenticatedBy() != null) { Authenticator authenticator = authenticatorMapper.getAuthenticatorMap() .get(authenticationResult.getAuthenticatedBy()); if (authenticator != null) { authenticator.decorateProxyRequest( clientRequest, proxyResponse, proxyRequest ); } else { log.error("Can not find Authenticator with Name [%s]", authenticationResult.getAuthenticatedBy()); } } super.sendProxyRequest( clientRequest, proxyResponse, proxyRequest ); }
Source:
public boolean endTracking() { if (mAutomaticTracker != null) { mAutomaticTracker.unregister(); return true; } return false; }

Target:
public boolean endTracking() { if (mAutomaticTracker != null) { mAutomaticTracker.unregister(); mAutomaticTracker = null; return true; } return false; }
Source:
public ColumnNotFoundException(String schemaName, String tableName, String familyName, String columnName) { this(schemaName, tableName, familyName, columnName, code.getSQLState()); }

Target:
public ColumnNotFoundException(String schemaName, String tableName, String familyName, String columnName) { super(new SQLExceptionInfo.Builder(code).setSchemaName(schemaName).setTableName(tableName) .setFamilyName(familyName).setColumnName(columnName).build().toString(), code.getSQLState()); this.schemaName = schemaName; this.tableName = tableName; this.columnName = columnName; }