auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private static OMElement loadConfigXML() throws EventBrokerConfigurationException { String carbonConfigHome = System.getProperty(ServerConstants.CARBON_CONFIG_DIR_PATH); String path = carbonConfigHome + File.separator + EventBrokerConstants.EB_CONF; BufferedInputStream inputStream = null; try { inputStream = new BufferedInputStream(new FileInputStream(new File(path))); XMLStreamReader parser = XMLInputFactory.newInstance(). createXMLStreamReader(inputStream); StAXOMBuilder builder = new StAXOMBuilder(parser); OMElement omElement = builder.getDocumentElement(); omElement.build(); return omElement; } catch (FileNotFoundException e) { throw new EventBrokerConfigurationException(EventBrokerConstants.EB_CONF + "cannot be found in the path : " + path, e); } catch (XMLStreamException e) { throw new EventBrokerConfigurationException("Invalid XML for " + EventBrokerConstants.EB_CONF + " located in the path : " + path, e); } finally { try { if (inputStream != null) { inputStream.close(); } } catch (IOException ingored) { throw new EventBrokerConfigurationException("Can not close the input stream"); } } }

Target:
private static OMElement loadConfigXML() throws EventBrokerConfigurationException { String carbonConfigHome = CarbonBaseUtils.getCarbonConfigDirPath(); String path = Paths.get(carbonConfigHome, EventBrokerConstants.EB_CONF).toString(); BufferedInputStream inputStream = null; try { inputStream = new BufferedInputStream(new FileInputStream(new File(path))); XMLStreamReader parser = XMLInputFactory.newInstance(). createXMLStreamReader(inputStream); StAXOMBuilder builder = new StAXOMBuilder(parser); OMElement omElement = builder.getDocumentElement(); omElement.build(); return omElement; } catch (FileNotFoundException e) { throw new EventBrokerConfigurationException(EventBrokerConstants.EB_CONF + "cannot be found in the path : " + path, e); } catch (XMLStreamException e) { throw new EventBrokerConfigurationException("Invalid XML for " + EventBrokerConstants.EB_CONF + " located in the path : " + path, e); } finally { try { if (inputStream != null) { inputStream.close(); } } catch (IOException ingored) { throw new EventBrokerConfigurationException("Can not close the input stream"); } } }
Source:
protected OWLOntology loadModelABox(IRI modelId) throws OWLOntologyCreationException { LOG.info("Load model abox: " + modelId + " from database"); try { BigdataSailRepositoryConnection connection = repo.getReadOnlyConnection(); try { RepositoryResult<Resource> graphs = connection.getContextIDs(); if (!Iterations.asSet(graphs).contains(new URIImpl(modelId.toString()))) { throw new OWLOntologyCreationException("No such model in datastore: " + modelId); } graphs.close(); RepositoryResult<Statement> statements = connection.getStatements(null, null, null, false, new URIImpl(modelId.toString())); boolean minimal = false; OWLOntology abox = loadOntologyDocumentSource(new RioMemoryTripleSource(statements), minimal); statements.close(); abox = postLoadFileFilter(abox); return abox; } finally { connection.close(); } } catch (RepositoryException e) { throw new OWLOntologyCreationException(e); } }

Target:
protected OWLOntology loadModelABox(IRI modelId) throws OWLOntologyCreationException { LOG.info("Load model abox: " + modelId + " from database"); try { BigdataSailRepositoryConnection connection = repo.getReadOnlyConnection(); try { RepositoryResult<Resource> graphs = connection.getContextIDs(); if (!Iterations.asSet(graphs).contains(new URIImpl(modelId.toString()))) { throw new OWLOntologyCreationException("No such model in datastore: " + modelId); } graphs.close(); RepositoryResult<Statement> statements = connection.getStatements(null, null, null, false, new URIImpl(modelId.toString())); boolean minimal = true; OWLOntology abox = loadOntologyDocumentSource(new RioMemoryTripleSource(statements), minimal); statements.close(); abox = postLoadFileFilter(abox); return abox; } finally { connection.close(); } } catch (RepositoryException e) { throw new OWLOntologyCreationException(e); } }
Source:
private CreateTableAsSelect(Optional<NodeLocation> location, QualifiedName name, Query query, boolean notExists, List<Property> properties, boolean withData, Optional<List<Identifier>> columnAliases, Optional<String> comment) { super(location); this.name = requireNonNull(name, "name is null"); this.query = requireNonNull(query, "query is null"); this.notExists = notExists; this.properties = requireNonNull(properties, "properties is null"); this.withData = withData; this.columnAliases = columnAliases; this.comment = requireNonNull(comment, "comment is null"); }

Target:
private CreateTableAsSelect(Optional<NodeLocation> location, QualifiedName name, Query query, boolean notExists, List<Property> properties, boolean withData, Optional<List<Identifier>> columnAliases, Optional<String> comment) { super(location); this.name = requireNonNull(name, "name is null"); this.query = requireNonNull(query, "query is null"); this.notExists = notExists; this.properties = ImmutableList.copyOf(requireNonNull(properties, "properties is null")); this.withData = withData; this.columnAliases = columnAliases; this.comment = requireNonNull(comment, "comment is null"); }
Source:
protected void emitRecordsWithTimestamps( Queue<T> records, KafkaTopicPartitionState<T, KPH> partitionState, long offset, long kafkaEventTimestamp) { synchronized (checkpointLock) { T record; while ((record = records.poll()) != null) { long timestamp; synchronized (partitionState) { timestamp = partitionState.extractTimestamp(record, kafkaEventTimestamp); partitionState.onEvent(record, timestamp); } sourceContext.collectWithTimestamp(record, timestamp); synchronized (partitionState) { partitionState.onEvent(record, timestamp); } } partitionState.setOffset(offset); } }

Target:
protected void emitRecordsWithTimestamps( Queue<T> records, KafkaTopicPartitionState<T, KPH> partitionState, long offset, long kafkaEventTimestamp) { synchronized (checkpointLock) { T record; while ((record = records.poll()) != null) { long timestamp = partitionState.extractTimestamp(record, kafkaEventTimestamp); sourceContext.collectWithTimestamp(record, timestamp); partitionState.onEvent(record, timestamp); } partitionState.setOffset(offset); } }
Source:
public boolean isApplicable(String requestPath) { List<String> applicablePaths = ImmutableList.of("druid/coordinator/v1/security/"); for (String path : applicablePaths) { if (requestPath.startsWith(path) && !requestPath.equals(path)) { return true; } } return false; }

Target:
public boolean isApplicable(String requestPath) { for (String path : applicablePaths) { if (requestPath.startsWith(path) && !requestPath.equals(path)) { return true; } } return false; }
Source:
private void markTimelineDeleted(final Timeline timeline) { try { timeline.setDeleted(true); timelineDbRepository.updateTimelime(timeline); eventTypeCache.updated(timeline.getEventType()); } catch (final InconsistentStateException e) { LOG.error("Failed to serialize timeline to DB when marking timeline as deleted", e); } catch (final RepositoryProblemException e) { LOG.error("DB failure when marking timeline as deleted", e); } catch (Exception e) { LOG.error("ZK error occurred when updating ET cache", e); } }

Target:
private void markTimelineDeleted(final Timeline timeline) { boolean timelineUpdatedInDB = false; boolean cacheUpdated = false; try { timeline.setDeleted(true); timelineDbRepository.updateTimelime(timeline); timelineUpdatedInDB = true; eventTypeCache.updated(timeline.getEventType()); cacheUpdated = true; } catch (final InconsistentStateException e) { LOG.error("Failed to serialize timeline to DB when marking timeline as deleted", e); } catch (final RepositoryProblemException e) { LOG.error("DB failure when marking timeline as deleted", e); } catch (Exception e) { LOG.error("ZK error occurred when updating ET cache", e); } finally { if (timelineUpdatedInDB && !cacheUpdated) { try { timeline.setDeleted(false); timelineDbRepository.updateTimelime(timeline); } catch (final Exception e) { LOG.error("Failed to revert timeline state", e); } } } }
Source:
private EventData setSpanContext(EventData event, Context parentContext) { Optional<Object> eventContextData = event.context().getData(SPAN_CONTEXT); if (eventContextData.isPresent()) { tracerProvider.addSpanLinks((Context) eventContextData.get()); return event; } else { Context eventSpanContext = tracerProvider.startSpan(parentContext, ProcessKind.MESSAGE); if (eventSpanContext != null && eventSpanContext.getData(DIAGNOSTIC_ID_KEY).isPresent()) { event.addProperty(DIAGNOSTIC_ID_KEY, eventSpanContext.getData(DIAGNOSTIC_ID_KEY).get().toString()); tracerProvider.endSpan(eventSpanContext, null); event.addContext(SPAN_CONTEXT, eventSpanContext); } } return event; }

Target:
private EventData setSpanContext(EventData event, Context parentContext) { Optional<Object> eventContextData = event.context().getData(SPAN_CONTEXT); if (eventContextData.isPresent()) { Object spanContextObject = eventContextData.get(); if (spanContextObject instanceof Context) { tracerProvider.addSpanLinks((Context) eventContextData.get()); } else { logger.warning(String.format(Locale.US, "Event Data context type is not of type Context, but type: %s. Not adding span links.", spanContextObject != null ? spanContextObject.getClass() : "null")); } return event; } else { Context eventSpanContext = tracerProvider.startSpan(parentContext, ProcessKind.RECEIVE); if (eventSpanContext != null) { Optional<Object> eventDiagnosticIdOptional = eventSpanContext.getData(DIAGNOSTIC_ID_KEY); if (eventDiagnosticIdOptional.isPresent()) { event.addProperty(DIAGNOSTIC_ID_KEY, eventDiagnosticIdOptional.get().toString()); tracerProvider.endSpan(eventSpanContext, Signal.complete()); event.addContext(SPAN_CONTEXT, eventSpanContext); } } } return event; }
Source:
private void setVdsmId(String eventName, String eventUrl) { if (!eventName.equals(AnsibleConstants.TASK_VDSM_ID)) { return; } String vdsmid = runnerClient.getVdsmId(eventUrl); log.info( "Host reports unique id {}", getVds().getHostName(), vdsmid ); final List<VDS> list = vdsDao.getAllWithUniqueId(vdsmid).stream().filter( vds -> !vds.getId().equals(getVds().getId())).collect(Collectors.toList() ); if (!list.isEmpty()) { final StringBuilder hosts = new StringBuilder(1024); for (VDS v : list) { if (hosts.length() > 0) { hosts.append(", "); } hosts.append(v.getName()); } log.error( "Host reports duplicate unique id of following hosts {}", getVds().getHostName(), vdsmid, hosts ); throw new SoftError( String.format( "Host %1$s reports unique id which already registered for %2$s", getVds().getHostName(), hosts ) ); } log.info("Assigning unique id to Host {}", vdsmid, getVds().getHostName()); getVds().setUniqueId(vdsmid); TransactionSupport.executeInNewTransaction(() -> { vdsStaticDao.update(getVds().getStaticData()); return null; }); }

Target:
private void setVdsmId(String eventName, String eventUrl) { if (!eventName.equals(AnsibleConstants.TASK_VDSM_ID)) { return; } String vdsmid = runnerClient.getVdsmId(eventUrl); log.info( "Host reports unique id {}", getVds().getHostName(), vdsmid ); final List<String> hosts = vdsDao.getAllWithUniqueId(vdsmid) .stream() .filter(vds -> !vds.getId().equals(getVds().getId())) .map(VDS::getName) .collect(Collectors.toList()); if (!hosts.isEmpty()) { log.error( "Host reports duplicate unique id of following hosts {}", getVds().getHostName(), vdsmid, hosts ); throw new SoftError( String.format( "Host %1$s reports unique id which already registered for %2$s", getVds().getHostName(), hosts ) ); } log.info("Assigning unique id to Host {}", vdsmid, getVds().getHostName()); getVds().setUniqueId(vdsmid); TransactionSupport.executeInNewTransaction(() -> { vdsStaticDao.update(getVds().getStaticData()); return null; }); }
Source:
protected void handleComparison(IFile oldData, IFile newData) { String title = MessageFormat.format(Messages.ContentDescription_0, new Object[] { oldData.getName(), newData.getName() }); IPath oldDatum = oldData.getLocation(); IPath newDatum = newData.getLocation(); System.out.println(oldDatum); System.out.println(newDatum); ReportComparisonData diffData = new ReportComparisonData(title, oldDatum, newDatum, newData.getProject()); diffData.parse(); PerfPlugin.getDefault().setReportDiffData(diffData); ReportComparisonView.refreshView(); }

Target:
protected void handleComparison(IFile oldData, IFile newData) { String title = MessageFormat.format(Messages.ContentDescription_0, new Object[] { oldData.getName(), newData.getName() }); IPath oldDatum = oldData.getLocation(); IPath newDatum = newData.getLocation(); ReportComparisonData diffData = new ReportComparisonData(title, oldDatum, newDatum, newData.getProject()); diffData.parse(); PerfPlugin.getDefault().setReportDiffData(diffData); ReportComparisonView.refreshView(); }
Source:
private ContactDataBuilder extractContactData(ContactDataBuilder builder, long contactId, Cursor cursor) { final ColumnProcessors processors = new ColumnProcessors(); builder.setContactId(contactId); builder.setName(processors.forString().extract(cursor, Column.display_name)); builder.setPhotoId(processors.forInteger().extract(cursor, Column.photo_id)); String mimeType = processors.forString().extract(cursor, Column.mimetype); String data = processors.forString().extract(cursor, Column.data1); int isPrimary = processors.forInteger().extract(cursor, Column.is_primary); if (mimeType.equals(Email.CONTENT_ITEM_TYPE)) { builder.addEmailId(data); } else if (mimeType.equals(Phone.CONTENT_ITEM_TYPE)) { builder.addPhoneNumber(new ContactNumber(data, isPrimary > 0 ? true : false)); } return builder; }

Target:
private ContactDataBuilder extractContactData(ContactDataBuilder builder, long contactId, Cursor cursor) { final ColumnProcessors processors = new ColumnProcessors(); builder.setContactId(contactId); builder.setName(processors.forString().extract(cursor, Column.DISPLAY_NAME)); builder.setPhotoId(processors.forInteger().extract(cursor, Column.PHOTO_ID)); String mimeType = processors.forString().extract(cursor, Column.MIMETYPE); String data = processors.forString().extract(cursor, Column.DATA1); int isPrimary = processors.forInteger().extract(cursor, Column.IS_PRIMARY); if (mimeType.equals(Email.CONTENT_ITEM_TYPE)) { builder.addEmailId(data); } else if (mimeType.equals(Phone.CONTENT_ITEM_TYPE)) { builder.addPhoneNumber(new ContactNumber(data, isPrimary > 0 ? true : false)); } return builder; }
Source:
private void init(ITestNGMethod method, ITestContext ctx, Throwable t, long start, long end) { m_throwable = t; m_instanceName = method.getTestClass().getName(); if (null == m_throwable) { m_status = ITestResult.SUCCESS; } m_startMillis = start; m_endMillis = end; m_method = method; m_context = ctx; Object instance = method.getInstance(); if (instance == null) { m_name = m_method.getMethodName(); return; } if (instance instanceof ITest) { m_name = ((ITest) instance).getTestName(); if (m_name == null) { String msg = String.format( "Warning: [%s] implementation on class [%s] returned null. Defaulting to method name", ITest.class.getName(), instance.getClass().getName()); if (TestRunner.getVerbose() > 1) { System.err.println(msg); } } } else if (method.getTestClass().getTestName() != null) { m_name = method.getTestClass().getTestName(); } else { String string = instance.toString(); m_name = getMethod().getMethodName(); try { if (!Object.class .getMethod("toString") .equals(instance.getClass().getMethod("toString"))) { m_instanceName = string.startsWith("class ") ? string.substring("class ".length()) : string; m_name = m_name + " on " + m_instanceName; } } catch (NoSuchMethodException ignore) { } } }

Target:
private void init(ITestNGMethod method, ITestContext ctx, Throwable t, long start, long end) { m_throwable = t; m_instanceName = method.getTestClass().getName(); if (null == m_throwable) { m_status = ITestResult.SUCCESS; } m_startMillis = start; m_endMillis = end; m_method = method; m_context = ctx; Object instance = method.getInstance(); if (instance == null) { m_name = m_method.getMethodName(); return; } if (instance instanceof ITest) { m_name = ((ITest) instance).getTestName(); if (m_name != null) { return; } m_name = m_method.getMethodName(); if (TestRunner.getVerbose() > 1) { String msg = String.format( "Warning: [%s] implementation on class [%s] returned null. Defaulting to method name", ITest.class.getName(), instance.getClass().getName()); System.err.println(msg); } return; } if (method.getTestClass().getTestName() != null) { m_name = method.getTestClass().getTestName(); return; } String string = instance.toString(); m_name = getMethod().getMethodName(); try { if (!Object.class .getMethod("toString") .equals(instance.getClass().getMethod("toString"))) { m_instanceName = string.startsWith("class ") ? string.substring("class ".length()) : string; m_name = m_name + " on " + m_instanceName; } } catch (NoSuchMethodException ignore) { } }
Source:
public PollerFlux<CreateSearchResponse, PhoneNumberSearch> beginCreateSearch( CreateSearchOptions options, Duration lroDuration) { final Duration interval = lroDuration != null ? lroDuration : DEFAULT_POLL_DURATION; return new PollerFlux<CreateSearchResponse, PhoneNumberSearch>(interval, activationOperation(options), createPollOperation(), (activationResponse, pollingContext) -> Mono.error(new RuntimeException("Cancellation is not supported")), fetchResultOperation()); }

Target:
public PollerFlux<PhoneNumberSearch, PhoneNumberSearch> beginCreateSearch( CreateSearchOptions options, Duration lroDuration) { final Duration interval = lroDuration != null ? lroDuration : DEFAULT_POLL_DURATION; return new PollerFlux<PhoneNumberSearch, PhoneNumberSearch>(interval, createSearchActivationOperation(options), createSearchPollOperation(), (activationResponse, pollingContext) -> Mono.error(new RuntimeException("Cancellation is not supported")), createSearchFetchResultOperation()); }
Source:
public InputStream getStream() throws IOException { Response<ResponseBody> response = generator.simpleGet(uri); if (response.isSuccessful()) { return response.body().byteStream(); } else { throw new RuntimeException(Localization.get("install.fail.error", Integer.toString(response.code()))); } }

Target:
public InputStream getStream() throws IOException { Response<ResponseBody> response = generator.simpleGet(uri); if (response.isSuccessful()) { return response.body().byteStream(); } else { throw new IOException(Localization.get("install.fail.error", Integer.toString(response.code()))); } }
Source:
public MessageHandler createHandler(Message message, NotificationContext context) { if (message.getResourceName()!="testStaledMessageResource") { return new TestStateTransitionMessageHandler(message, context); } else { CurrentState currentStateDelta = new CurrentState(message.getResourceName()); currentStateDelta.setSessionId(message.getTgtSessionId()); currentStateDelta.setStateModelDefRef(message.getStateModelDef()); currentStateDelta.setStateModelFactoryName(message.getStateModelFactoryName()); currentStateDelta.setBucketSize(message.getBucketSize()); currentStateDelta.setState(message.getPartitionName(), "MASTER"); return new TestStateTransitionMessageHandler(message, context, currentStateDelta); } }

Target:
public MessageHandler createHandler(Message message, NotificationContext context) { CurrentState currentStateDelta = new CurrentState(message.getResourceName()); currentStateDelta.setSessionId(message.getTgtSessionId()); currentStateDelta.setStateModelDefRef(message.getStateModelDef()); currentStateDelta.setStateModelFactoryName(message.getStateModelFactoryName()); currentStateDelta.setBucketSize(message.getBucketSize()); if (!message.getResourceName().equals("testStaledMessageResource")) { currentStateDelta.setState(message.getPartitionName(), "SLAVE"); } else { currentStateDelta.setState(message.getPartitionName(), "MASTER"); } return new TestStateTransitionMessageHandler(message, context, currentStateDelta); }
Source:
public void addScope(ScopeEvent event) { Scope scope = new Scope(); scope.setName(event.getName()); scope.setRoles(event.getRoles()); scope.setDisplayName(event.getDisplayName()); scope.setDescription(event.getDescription()); scope.setTimeStamp(event.getTimeStamp()); SubscriptionDataStore store = SubscriptionDataHolder.getInstance() .getTenantSubscriptionStore(event.getTenantDomain()); if (store == null) { if (log.isDebugEnabled()) { log.debug("Ignoring the Event due to tenant " + event.getTenantDomain() + " not loaded"); } return; } store.addOrUpdateScope(scope); }

Target:
public void addScope(ScopeEvent event) { Scope scope = new Scope(); scope.setName(event.getName()); scope.setRoles(event.getRoles()); scope.setDisplayName(event.getDisplayName()); scope.setDescription(event.getDescription()); scope.setTimeStamp(event.getTimeStamp()); SubscriptionDataStore store = SubscriptionDataHolder.getInstance() .getTenantSubscriptionStore(event.getTenantDomain()); if (store == null) { if (log.isDebugEnabled()) { log.debug("Ignoring the event as the tenant " + event.getTenantDomain() + " is not loaded"); } return; } store.addOrUpdateScope(scope); }
Source:
public static IProject getProject(String name, Connection connection) { assertNotNull(connection); if (StringUtils.isBlank(name)) { return null; } for (IResource resource : connection.getResources(ResourceKind.PROJECT)) { if (name.equals(resource.getName())) { return (IProject) resource; } } return null; }

Target:
public static IProject getProject(String name, Connection connection) { assertNotNull(connection); if (StringUtils.isBlank(name)) { return null; } return safeGetResource(ResourceKind.PROJECT, name, null, connection); }
Source:
private void createThreadToInterrupt() { new Thread(() -> { try { latch.await(1, TimeUnit.SECONDS); } catch (InterruptedException e) { e.printStackTrace(); } int size = context.getAsyncProcessorAwaitManager().size(); System.out.println("In-flight messages: " + size); assertEquals(1, size); Collection<AsyncProcessorAwaitManager.AwaitThread> threads = context.getAsyncProcessorAwaitManager().browse(); AsyncProcessorAwaitManager.AwaitThread thread = threads.iterator().next(); String id = thread.getExchange().getExchangeId(); context.getAsyncProcessorAwaitManager().interrupt(id); }).start(); }

Target:
private void createThreadToInterrupt() { new Thread(() -> { try { latch.await(1, TimeUnit.SECONDS); } catch (InterruptedException e) { e.printStackTrace(); } int size = context.getAsyncProcessorAwaitManager().size(); assertEquals(1, size); Collection<AsyncProcessorAwaitManager.AwaitThread> threads = context.getAsyncProcessorAwaitManager().browse(); AsyncProcessorAwaitManager.AwaitThread thread = threads.iterator().next(); String id = thread.getExchange().getExchangeId(); context.getAsyncProcessorAwaitManager().interrupt(id); }).start(); }
Source:
public void tagPostUploadJob() throws Exception { TestObjectContext testObjectContext = testPersistenceObjectFactory.createTestObjectContext(); EnrichmentTag scjReferenceTag = createReferencedCourtCasesTag(testObjectContext.getScJudgmentId(), testObjectContext.getNacJudgment()); EnrichmentTag scjSomeTag = createEnrichmentTag(testObjectContext.getScJudgmentId(), "SOME_TAG_TYPE", "{key:'value'}"); EnrichmentTag scjMaxRefMoneyTag = createEnrichmentTag(testObjectContext.getScJudgmentId(), EnrichmentTagTypes.MAX_REFERENCED_MONEY, JsonNormalizer.normalizeJson("{amount:12300.45, text:'123 tys zł 45 gr'}")); enrichmentTagRepository.save(Lists.newArrayList(scjReferenceTag, scjSomeTag, scjMaxRefMoneyTag)); String scJudgmentHash = getHashForTags(scjReferenceTag, scjSomeTag, scjMaxRefMoneyTag); String nacJudgmentHash = getHashForTags(scjReferenceTag); JobExecution execution = jobExecutor.forceStartNewJob(tagPostUploadJob); solrJudgmentsServer.commit(); JobExecutionAssertUtils.assertStepExecution(execution, 1, 0, 4); JobExecutionAssertUtils.assertStepExecution(execution, 2, 0, 2); assertEnrichmentHashForJudgment(testObjectContext.getScJudgmentId(), null, scJudgmentHash, true); assertEnrichmentHashForJudgment(testObjectContext.getNacJudgmentId(), null, nacJudgmentHash, true); assertEnrichmentHashForJudgment(testObjectContext.getCtJudgmentId(), null, null, true); assertEnrichmentHashForJudgment(testObjectContext.getCcJudgmentId(), null, null, true); assertMaxReferencedMoneyIndexed(testObjectContext.getScJudgmentId(), "12300.45,PLN"); }

Target:
public void tagPostUploadJob() throws Exception { TestObjectContext testObjectContext = testPersistenceObjectFactory.createTestObjectContext(); EnrichmentTag scjReferenceTag = createReferencedCourtCasesTag(testObjectContext.getScJudgmentId(), testObjectContext.getNacJudgment()); EnrichmentTag scjSomeTag = createEnrichmentTag(testObjectContext.getScJudgmentId(), "SOME_TAG_TYPE", "{key:'value'}"); EnrichmentTag scjMaxRefMoneyTag = createEnrichmentTag(testObjectContext.getScJudgmentId(), EnrichmentTagTypes.MAX_REFERENCED_MONEY, JsonNormalizer.normalizeJson("{amount:12300.45, text:'123 tys zł 45 gr'}")); enrichmentTagRepository.save(Lists.newArrayList(scjReferenceTag, scjSomeTag, scjMaxRefMoneyTag)); String scJudgmentHash = getHashForTags(scjReferenceTag, scjSomeTag, scjMaxRefMoneyTag); String nacJudgmentHash = getHashForTags(scjReferenceTag); JobExecution execution = jobExecutor.forceStartNewJob(tagPostUploadJob); solrJudgmentsServer.commit(); JobExecutionAssertUtils.assertStepExecution(execution, UPDATE_ENRICHMENT_HASH_STEP, 0, 4); JobExecutionAssertUtils.assertStepExecution(execution, MARK_CHANGED_TAG_JUDGMENTS_AS_NOT_INDEXED_STEP, 0, 2); assertEnrichmentHashForJudgment(testObjectContext.getScJudgmentId(), null, scJudgmentHash, true); assertEnrichmentHashForJudgment(testObjectContext.getNacJudgmentId(), null, nacJudgmentHash, true); assertEnrichmentHashForJudgment(testObjectContext.getCtJudgmentId(), null, null, true); assertEnrichmentHashForJudgment(testObjectContext.getCcJudgmentId(), null, null, true); assertMaxReferencedMoneyIndexed(testObjectContext.getScJudgmentId(), "12300.45,PLN"); }
Source:
public static int encode( final MutableDirectBuffer mutableDirectBuffer, final int offset, final int streamId, final int flags, final FrameType type, final ByteBuffer metadata, final ByteBuffer data ) { if (type == FrameType.REQUEST_CHANNEL) { throw new AssertionError("REQUEST_CHANNEL most have initial request N"); } final int frameLength = computeFrameLength(type, metadata.remaining(), data.remaining()); int length = FrameHeaderFlyweight.encodeFrameHeader(mutableDirectBuffer, offset, frameLength, flags, type, streamId); length += FrameHeaderFlyweight.encodeMetadata(mutableDirectBuffer, offset, offset + length, metadata); length += FrameHeaderFlyweight.encodeData(mutableDirectBuffer, offset + length, data); return length; }

Target:
public static int encode( final MutableDirectBuffer mutableDirectBuffer, final int offset, final int streamId, final int flags, final FrameType type, final ByteBuffer metadata, final ByteBuffer data ) { if (type.hasInitialRequestN()) { throw new AssertionError(type + " must not be encoded without initial request N"); } final int frameLength = computeFrameLength(type, metadata.remaining(), data.remaining()); int length = FrameHeaderFlyweight.encodeFrameHeader(mutableDirectBuffer, offset, frameLength, flags, type, streamId); length += FrameHeaderFlyweight.encodeMetadata(mutableDirectBuffer, offset, offset + length, metadata); length += FrameHeaderFlyweight.encodeData(mutableDirectBuffer, offset + length, data); return length; }
Source:
protected void compose() { final Execution exec = Executions.getCurrent(); if (exec == null) throw new IllegalStateException("No execution available"); if (isInline()) { if (_inlines != null) return; _inlines = exec.createComponents(_uri != null ? _uri : getDefinition().getMacroURI(), _props); } else { if (!getChildren().isEmpty()) return; exec.createComponents(_uri != null ? _uri : getDefinition().getMacroURI(), this, _props); } this.addEventListener(-10000, "onCreate", new EventListener<Event>() { public void onEvent(Event event) throws Exception { HtmlMacroComponent.this.wireMarcoComponent(); } }); }

Target:
protected void compose() { final Execution exec = Executions.getCurrent(); if (exec == null) throw new IllegalStateException("No execution available"); if (isInline()) { if (_inlines != null) return; _inlines = exec.createComponents(_uri != null ? _uri : getDefinition().getMacroURI(), _props); } else { if (!getChildren().isEmpty()) return; exec.createComponents(_uri != null ? _uri : getDefinition().getMacroURI(), this, _props); } addEventListener(-10000, Events.ON_CREATE, new EventListener<Event>() { public void onEvent(Event event) throws Exception { HtmlMacroComponent.this.wireMarcoComponent(); } }); }
Source:
public void setUp() { IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(PROJECT); try { project.create(null); project.open(null); fResource = project.getFile(RESOURCE); final InputStream source = new ByteArrayInputStream(new byte[0]); fResource.create(source, true, null); fResource.setPersistentProperty(TmfCommonConstants.TRACE_SUPPLEMENTARY_FOLDER, fResource.getParent().getLocationURI().getPath()); } catch (CoreException e) { e.printStackTrace(); } }

Target:
public void setUp() throws CoreException { IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(PROJECT); if (!project.exists()) { project.create(null); } project.open(null); fResource = project.getFile(RESOURCE); if (!fResource.exists()) { final InputStream source = new ByteArrayInputStream(new byte[0]); fResource.create(source, true, null); } fResource.setPersistentProperty(TmfCommonConstants.TRACE_SUPPLEMENTARY_FOLDER, fResource.getParent().getLocationURI().getPath()); }
Source:
public IgniteTestResources(MBeanServer jmx) throws IgniteCheckedException { assert jmx != null; this.jmx = jmx; log = rootLog.getLogger(getClass()); ctx = new GridTestKernalContext(log); rsrcProc = new GridResourceProcessor(ctx); }

Target:
public IgniteTestResources(MBeanServer jmx) throws IgniteCheckedException { assert jmx != null; this.jmx = jmx; this.log = rootLog.getLogger(getClass()); this.ctx = new GridTestKernalContext(log); this.rsrcProc = new GridResourceProcessor(ctx); }
Source:
private void checkFileExistence(AssetFileIdentity fileIdentity, boolean expectedToExist) throws IOException { try (InputStream stream = contentRepoService.getLatestRepoObject(fileIdentity.toString())) { assertNotNull(stream); assertTrue(expectedToExist); } catch (InMemoryContentRepoService.InMemoryContentRepoServiceException me) { assertFalse(expectedToExist); } catch (NotFoundException nfe) { assertFalse(expectedToExist); } catch (ContentRepoException e) { throw e; } }

Target:
private void checkFileExistence(AssetFileIdentity fileIdentity, boolean expectedToExist) throws IOException { try (InputStream stream = contentRepoService.getLatestRepoObject(fileIdentity.toString())) { assertNotNull(stream); assertTrue(expectedToExist); } catch (InMemoryContentRepoService.InMemoryContentRepoServiceException|NotFoundException nfe) { assertFalse(expectedToExist); } catch (ContentRepoException e) { throw e; } }
Source:
public Square get(Point point){ return squares[point.y][point.x]; }

Target:
public List<Entity> get(Point point){ return getSquare(point).getEntities(); }
Source:
private IncrementalIndex makeIncIndex() { return new OnheapIncrementalIndex( 0, QueryGranularity.NONE, QueryBenchmarkUtil.INGESTION_AGGS, true, false, true, MAX_ROWS ); }

Target:
private IncrementalIndex makeIncIndex() { return new OnheapIncrementalIndex( new IncrementalIndexSchema.Builder() .withQueryGranularity(QueryGranularities.NONE) .withMetrics(schemaInfo.getAggsArray()) .withDimensionsSpec(new DimensionsSpec(null, null, null)) .build(), true, false, true, rowsPerSegment ); }
Source:
public void retryWithDataProvider() { TestNG testng = create(DataProviderRetryTest.class); TestListenerAdapter tla = new TestListenerAdapter(); DataProviderRerunListener listener = new DataProviderRerunListener(); testng.addListener((ITestNGListener) tla); testng.addListener(listener); testng.run(); assertThat(tla.getFailedTests()).size().isEqualTo(1); assertThat(tla.getSkippedTests()).size().isEqualTo(2); }

Target:
public void retryWithDataProvider() { TestNG testng = create(DataProviderRetryTest.class); TestListenerAdapter tla = new TestListenerAdapter(); testng.addListener((ITestNGListener) tla); testng.run(); assertThat(tla.getFailedTests()).size().isEqualTo(1); assertThat(tla.getSkippedTests()).size().isEqualTo(2); }
Source:
public final void init(Config config, TaskContext context) throws Exception { if (this.userTask instanceof InitableTask) { ((InitableTask) this.userTask).init(config, context); } Map<SystemStreamPartition, MessageStream<IncomingSystemMessage>> messageStreams = new HashMap<>(); context.getSystemStreamPartitions().forEach(ssp -> messageStreams.put(ssp, new MessageStreamImpl<>())); this.userTask.transform(messageStreams); messageStreams.forEach((ssp, ms) -> { OperatorImpl<IncomingSystemMessage, ? extends Message> rootOperator = OperatorImpls.createOperatorImpls((MessageStreamImpl<IncomingSystemMessage>) ms, context); operatorChains.put(ssp, rootOperator); }); }

Target:
public final void init(Config config, TaskContext context) throws Exception { if (this.userTask instanceof InitableTask) { ((InitableTask) this.userTask).init(config, context); } Map<SystemStreamPartition, MessageStream<IncomingSystemMessageEnvelope>> messageStreams = new HashMap<>(); context.getSystemStreamPartitions().forEach(ssp -> messageStreams.put(ssp, new MessageStreamImpl<>())); this.userTask.transform(messageStreams); messageStreams.forEach((ssp, ms) -> operatorChains.put(ssp, OperatorImpls.createOperatorImpls((MessageStreamImpl<IncomingSystemMessageEnvelope>) ms, context))); }
Source:
public UploadPartRequest newUploadPartRequest( String destKey, String uploadId, int partNumber, int size, InputStream uploadStream, File sourceFile, Long offset) throws PathIOException { checkNotNull(uploadId); checkArgument((uploadStream != null) ^ (sourceFile != null), "Data source"); checkArgument(size >= 0, "Invalid partition size %s", size); checkArgument(partNumber > 0, "partNumber must be between 1 and %s inclusive, but is %s", UPLOAD_PART_COUNT_LIMIT, partNumber); LOG.debug("Creating part upload request for #{} size {}", uploadId, partNumber, size); if (partNumber >= InternalConstants.UPLOAD_PART_COUNT_LIMIT) { throw new PathIOException(destKey, "Number of parts in multipart upload exceeded."); } UploadPartRequest request = new UploadPartRequest() .withBucketName(bucket) .withKey(destKey) .withUploadId(uploadId) .withPartNumber(partNumber) .withPartSize(size); if (uploadStream != null) { request.setInputStream(uploadStream); } else { checkArgument(sourceFile.exists(), "Source file does not exist: %s", sourceFile); checkArgument(offset >= 0, "Invalid offset %s", offset); long length = sourceFile.length(); checkArgument(offset == 0 || offset < length, "Offset %s beyond length of file %s", offset, length); request.setFile(sourceFile); request.setFileOffset(offset); } return request; }

Target:
public UploadPartRequest newUploadPartRequest( String destKey, String uploadId, int partNumber, int size, InputStream uploadStream, File sourceFile, Long offset) throws PathIOException { checkNotNull(uploadId); checkArgument((uploadStream != null) ^ (sourceFile != null), "Data source"); checkArgument(size >= 0, "Invalid partition size %s", size); checkArgument(partNumber > 0, "partNumber must be between 1 and %s inclusive, but is %s", DEFAULT_UPLOAD_PART_COUNT_LIMIT, partNumber); LOG.debug("Creating part upload request for #{} size {}", uploadId, partNumber, size); long partCountLimit = longOption(conf, UPLOAD_PART_COUNT_LIMIT, DEFAULT_UPLOAD_PART_COUNT_LIMIT, 1); if (partCountLimit != DEFAULT_UPLOAD_PART_COUNT_LIMIT) { LOG.warn("Configuration property shouldn't be overridden by client", UPLOAD_PART_COUNT_LIMIT); } final String pathErrorMsg = "Number of parts in multipart upload exceeded." + " Current part count = %s, Part count limit = %s "; if (partNumber > partCountLimit) { throw new PathIOException(destKey, String.format(pathErrorMsg, partNumber, partCountLimit)); } UploadPartRequest request = new UploadPartRequest() .withBucketName(bucket) .withKey(destKey) .withUploadId(uploadId) .withPartNumber(partNumber) .withPartSize(size); if (uploadStream != null) { request.setInputStream(uploadStream); } else { checkArgument(sourceFile.exists(), "Source file does not exist: %s", sourceFile); checkArgument(offset >= 0, "Invalid offset %s", offset); long length = sourceFile.length(); checkArgument(offset == 0 || offset < length, "Offset %s beyond length of file %s", offset, length); request.setFile(sourceFile); request.setFileOffset(offset); } return request; }
Source:
private void assertFirstElement(ListExpressionTree tree, Kind kind, String string) { Tree element = tree.elements().get(0).get(); assertThat(((ArrayAssignmentPatternElementTree) element).variable().is(kind)).isTrue(); assertThat(expressionToString(element)).isEqualTo(string); }

Target:
private void assertFirstElement(ListExpressionTree tree, Kind kind, String string) { ArrayAssignmentPatternElementTree element = tree.elements().get(0).get(); assertThat(element.variable().is(kind)).isTrue(); assertThat(expressionToString(element)).isEqualTo(string); }
Source:
public static void setTextInputValue(WebElement input, String value) { if (StringUtils.isEmpty(getTextFromElement(input)) && StringUtils.isEmpty(value)) { return; } input.click(); input.clear(); if (!StringUtils.isEmpty(value)) { input.sendKeys(value); } else { input.sendKeys("1"); input.sendKeys(Keys.BACK_SPACE); } WebDriver driver = getCurrentDriver(); if (driver instanceof AndroidDriver) { AndroidDriver androidDriver = (AndroidDriver) driver; androidDriver.hideKeyboard(); } }

Target:
public static void setTextInputValue(WebElement input, String value) { input.click(); input.clear(); if (!StringUtils.isEmpty(value)) { input.sendKeys(value); } else { input.sendKeys("1"); input.sendKeys(Keys.BACK_SPACE); } WebDriver driver = getCurrentDriver(); if (driver instanceof AndroidDriver) { AndroidDriver androidDriver = (AndroidDriver) driver; androidDriver.hideKeyboard(); } }
Source:
protected void applyRow(Relationship component, RelationshipRow row, Collection<Relationship> componentsToAttach) { component.setId(row.getId()); if (row.getEffectiveTime() != null) { component.setEffectiveTime(row.getEffectiveTime()); component.setReleased(true); } else { component.unsetEffectiveTime(); } component.setActive(row.isActive()); component.setModule(getConceptSafe(row.getModuleId(), SnomedRf2Headers.FIELD_MODULE_ID, row.getId())); if (component.getSource() == null || !component.getSource().getId().equals(row.getSourceId())) { component.setSource(getConceptSafe(row.getSourceId(), SnomedRf2Headers.FIELD_SOURCE_ID, row.getId())); } component.setDestination(getConceptSafe(row.getDestinationId(), SnomedRf2Headers.FIELD_DESTINATION_ID, row.getId())); component.setType(getConceptSafe(row.getTypeId(), SnomedRf2Headers.FIELD_TYPE_ID, row.getId())); component.setCharacteristicType(getConceptSafe(row.getCharacteristicTypeId(), SnomedRf2Headers.FIELD_CHARACTERISTIC_TYPE_ID, row.getId())); component.setModifier(getConceptSafe(row.getModifierId(), SnomedRf2Headers.FIELD_MODIFIER_ID, row.getId())); component.setGroup(row.getRelationshipGroup()); if (Concepts.HAS_ACTIVE_INGREDIENT.equals(row.getTypeId()) && Concepts.UNIVERSAL_RESTRICTION_MODIFIER.equals(row.getModifierId()) && component.getUnionGroup() != 1) { component.setUnionGroup(1); } getImportContext().conceptVisited(row.getSourceId()); }

Target:
protected void applyRow(Relationship component, RelationshipRow row, Collection<Relationship> componentsToAttach) { if (row.getEffectiveTime() != null) { component.setEffectiveTime(row.getEffectiveTime()); component.setReleased(true); } else { component.unsetEffectiveTime(); } component.setActive(row.isActive()); component.setModule(getConceptSafe(row.getModuleId(), SnomedRf2Headers.FIELD_MODULE_ID, row.getId())); if (component.getSource() == null || !component.getSource().getId().equals(row.getSourceId())) { component.setSource(getConceptSafe(row.getSourceId(), SnomedRf2Headers.FIELD_SOURCE_ID, row.getId())); } component.setDestination(getConceptSafe(row.getDestinationId(), SnomedRf2Headers.FIELD_DESTINATION_ID, row.getId())); component.setType(getConceptSafe(row.getTypeId(), SnomedRf2Headers.FIELD_TYPE_ID, row.getId())); component.setCharacteristicType(getConceptSafe(row.getCharacteristicTypeId(), SnomedRf2Headers.FIELD_CHARACTERISTIC_TYPE_ID, row.getId())); component.setModifier(getConceptSafe(row.getModifierId(), SnomedRf2Headers.FIELD_MODIFIER_ID, row.getId())); component.setGroup(row.getRelationshipGroup()); if (Concepts.HAS_ACTIVE_INGREDIENT.equals(row.getTypeId()) && Concepts.UNIVERSAL_RESTRICTION_MODIFIER.equals(row.getModifierId()) && component.getUnionGroup() != 1) { component.setUnionGroup(1); } getImportContext().conceptVisited(row.getSourceId()); }
Source:
public boolean replaces(@Nullable LookupExtractorFactory other) { if (this == other) { return false; } if (other == null || getClass() != other.getClass()) { return true; } final KafkaLookupExtractorFactory that = (KafkaLookupExtractorFactory) other; return !(getKafkaTopic().equals(that.getKafkaTopic()) && getKafkaProperties().equals(that.getKafkaProperties())); }

Target:
public boolean replaces(@Nullable LookupExtractorFactory other) { if (this == other) { return false; } if (other == null) { return false; } if (getClass() != other.getClass()) { return true; } final KafkaLookupExtractorFactory that = (KafkaLookupExtractorFactory) other; return !(getKafkaTopic().equals(that.getKafkaTopic()) && getKafkaProperties().equals(that.getKafkaProperties()) && getConnectTimeout() == that.getConnectTimeout() && isOneToOne() == that.isOneToOne() ); }
Source:
public DefaultVersionRangeResolver setVersionRangeResultFilter( VersionRangeResultFilter versionRangeResultFilter ) { if ( versionRangeResultFilter == null ) { throw new IllegalArgumentException( "version range result filter has not been specified" ); } this.versionRangeResultFilter = versionRangeResultFilter; return this; }

Target:
public DefaultVersionRangeResolver setVersionRangeResultFilter( VersionRangeResultFilter versionRangeResultFilter ) { this.versionRangeResultFilter = Validate.notNull( versionRangeResultFilter, "versionRangeResultFilter cannot be null" ); return this; }
Source:
public ConnectionResult checkConnection() { Request.Builder request = new Request.Builder() .url(this.baseUri); Response response = headImplExec(null, this.baseUri.uri().toString(), null, request); ConnectionResult connectionResult = new ConnectionResult(); int statusCode = response.code(); if(statusCode < 300) { connectionResult.setConnected(true); connectionResult.setStatusCode(statusCode); } else { connectionResult.setConnected(false); connectionResult.setStatusCode(statusCode); connectionResult.setErrorMessage(getReasonPhrase(response)); } return connectionResult; }

Target:
public ConnectionResult checkConnection() { Request.Builder request = new Request.Builder() .url(this.baseUri); Response response = headImplExec(null, this.baseUri.uri().toString(), null, request); ConnectionResultImpl connectionResultImpl = new ConnectionResultImpl(); int statusCode = response.code(); if(statusCode < 300) { connectionResultImpl.setConnected(true); } else { connectionResultImpl.setConnected(false); connectionResultImpl.setStatusCode(statusCode); connectionResultImpl.setErrorMessage(getReasonPhrase(response)); } return connectionResultImpl; }
Source:
public static ClassLoader load(final List<URL> urls) throws IOException { final ClassLoader parentClassLoader = ExtensionClassLoader.class.getClassLoader(); ClassLoader extensionClassLoader = java.security.AccessController.doPrivileged( new java.security.PrivilegedAction<ExtensionClassLoader>() { @Override public ExtensionClassLoader run() { return new ExtensionClassLoader(urls.toArray(new URL[urls.size()]), parentClassLoader); } } ); LOG.info("Created a new ExtensionClassLoader with parent = using classpath = {}", parentClassLoader.toString(), Arrays.toString(urls.toArray())); return extensionClassLoader; }

Target:
public static ClassLoader load(final List<URL> urls) throws IOException { final ClassLoader parentClassLoader = ExtensionClassLoader.class.getClassLoader(); ClassLoader extensionClassLoader = java.security.AccessController.doPrivileged( new java.security.PrivilegedAction<ExtensionClassLoader>() { @Override public ExtensionClassLoader run() { return new ExtensionClassLoader(urls.toArray(new URL[urls.size()]), parentClassLoader); } } ); LOG.info("Created a new ExtensionClassLoader using classpath = {}", Arrays.toString(urls.toArray())); return extensionClassLoader; }
Source:
public String summary() { return null; }

Target:
public String summary() { return this.postContent.getSummary(); }
Source:
public void send(DatastreamTask task, DatastreamEventRecord record) { if (_shutdownRequested) { throw new IllegalStateException("send() is not allowed on a shutdown producer"); } validateAndNormalizeEventRecord(record); try { _sendFlushLock.readLock().lock(); _partitionLocks.get(record.getPartition()).lock(); _transportProvider.send(task.getDatastreamDestination().getConnectionString(), record); _latestCheckpoints.get(task).put(record.getPartition(), record.getCheckpoint()); _pendingCheckpoint = true; } catch (TransportException e) { LOG.info(String.format("Failed send the event %s exception %s", record, e)); throw new RuntimeException("Failed to send: " + record, e); } finally { _partitionLocks.get(record.getPartition()).unlock(); _sendFlushLock.readLock().unlock(); } }

Target:
public void send(DatastreamTask task, DatastreamEventRecord record) { if (_shutdownRequested) { throw new IllegalStateException("send() is not allowed on a shutdown producer"); } validateAndNormalizeEventRecord(record); try { _sendFlushLock.readLock().lock(); _transportProvider.send(task.getDatastreamDestination().getConnectionString(), record); _latestCheckpoints.get(task).put(record.getPartition(), record.getCheckpoint()); _pendingCheckpoint = true; } catch (TransportException e) { LOG.info(String.format("Failed send the event %s exception %s", record, e)); throw new RuntimeException("Failed to send: " + record, e); } finally { _sendFlushLock.readLock().unlock(); } }
Source:
public void testNormalIndexAndFullTextSearchIndex() { SessionFactoryBuilder config = SessionFactoryBuilder.entities( NormalIndexAndFullTextSearchIndexEntity.class ); try ( SessionFactory ignored = config.build() ) { fail( "Expected exception at Hibernate factory creation time was not raised!" ); } catch (Exception e) { assertThat( e ) .isExactlyInstanceOf( HibernateException.class ) .hasMessage( "OGM001231: Unable to create index normal on collection MyDoc" ); assertThat( e.getCause() ).isExactlyInstanceOf( MongoCommandException.class ); assertThat( e.getCause().getMessage() ).contains( "already exists with different options" ); } }

Target:
public void testNormalIndexAndFullTextSearchIndex() { SessionFactoryBuilder config = SessionFactoryBuilder.entities( NormalIndexAndFullTextSearchIndexEntity.class ); this.entity = null; try ( SessionFactory ignored = config.build() ) { fail( "Should fail because we defined two indexes with conflicting configurations on field `NormalIndexAndFullTextSearchIndexEntity#email`" ); } catch (Exception e) { assertThat( e ) .isExactlyInstanceOf( HibernateException.class ) .hasMessage( "OGM001231: Unable to create index normal on collection MyDoc" ); assertThat( e.getCause() ).isExactlyInstanceOf( MongoCommandException.class ); assertThat( e.getCause().getMessage() ).contains( "already exists with different options" ); } }
Source:
void onException(SQLException e, OperationType operationType) { if (e instanceof SQLTransientConnectionException) { reset(); } if (!(e instanceof SQLIntegrityConstraintViolationException || isCredentialError(e))) { if (operationType == OperationType.Write) { metrics.writeFailureCount.inc(); } else { metrics.readFailureCount.inc(); } } }

Target:
void onException(SQLException e, OperationType operationType) { if (e instanceof SQLTransientConnectionException) { if (operationType == OperationType.Write) { metrics.writeFailureCount.inc(); } else { metrics.readFailureCount.inc(); } reset(); } }
Source:
public Object get(Object obj) { return super.get(StringUtils.toLowerCase((String) obj)); }

Target:
public Object get(Object obj) { return super.get(obj == null ? null : StringUtils.toLowerCase((String) obj)); }