auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testInvokeCommandStaggeredToNonMember() throws Exception { UUID randomUuid = UUID.randomUUID(); Address randomAddress = JGroupsAddressCache.fromJGroupsAddress(randomUuid); JGroupsTransport transport = (JGroupsTransport) manager(0).getTransport(); ReplicableCommand command = new ClusteredGetCommand("key", ByteString.fromString("cache"), TestingUtil.getSegmentForKey("key", cache(0)), 0); CompletionStage<Map<Address, Response>> future = transport.invokeCommandStaggered(Collections.singletonList(randomAddress), command, MapResponseCollector.ignoreLeavers(), DeliverOrder.NONE, 5, TimeUnit.SECONDS); assertEquals(Collections.singletonMap(randomAddress, CacheNotFoundResponse.INSTANCE), future.toCompletableFuture().get()); CompletionStage<Map<Address, Response>> future2 = transport.invokeCommandStaggered(Arrays.asList(address(1), randomAddress), command, MapResponseCollector.ignoreLeavers(), DeliverOrder.NONE, 5, TimeUnit.SECONDS); Map<Object, Object> expected = TestingUtil.mapOf(address(1), CacheNotFoundResponse.INSTANCE, randomAddress, CacheNotFoundResponse.INSTANCE); assertEquals(expected, future2.toCompletableFuture().get()); CompletableFuture<Void> blocker = blockRemoteGets(); try { CompletionStage<Map<Address, Response>> future3 = transport.invokeCommandStaggered(Arrays.asList(address(1), randomAddress), command, MapResponseCollector.ignoreLeavers(), DeliverOrder.NONE, 5, TimeUnit.SECONDS); Thread.sleep(500); blocker.complete(null); assertEquals(expected, future3.toCompletableFuture().get()); } finally { blocker.complete(null); } }

Target:
public void testInvokeCommandStaggeredToNonMember() throws Exception { UUID randomUuid = UUID.randomUUID(); Address randomAddress = JGroupsAddressCache.fromJGroupsAddress(randomUuid); JGroupsTransport transport = (JGroupsTransport) manager(0).getTransport(); ReplicableCommand command = new ClusteredGetCommand("key", CACHE_NAME, 0, 0); CompletionStage<Map<Address, Response>> future = transport.invokeCommandStaggered(Collections.singletonList(randomAddress), command, MapResponseCollector.ignoreLeavers(), DeliverOrder.NONE, 5, TimeUnit.SECONDS); assertEquals(Collections.singletonMap(randomAddress, CacheNotFoundResponse.INSTANCE), future.toCompletableFuture().get()); CompletionStage<Map<Address, Response>> future2 = transport.invokeCommandStaggered(Arrays.asList(address(1), randomAddress), command, MapResponseCollector.ignoreLeavers(), DeliverOrder.NONE, 5, TimeUnit.SECONDS); Map<Object, Object> expected = TestingUtil.mapOf(address(1), CacheNotFoundResponse.INSTANCE, randomAddress, CacheNotFoundResponse.INSTANCE); assertEquals(expected, future2.toCompletableFuture().get()); CompletableFuture<Void> blocker = blockRemoteGets(); try { CompletionStage<Map<Address, Response>> future3 = transport.invokeCommandStaggered(Arrays.asList(address(1), randomAddress), command, MapResponseCollector.ignoreLeavers(), DeliverOrder.NONE, 5, TimeUnit.SECONDS); Thread.sleep(500); blocker.complete(null); assertEquals(expected, future3.toCompletableFuture().get()); } finally { blocker.complete(null); } }
Source:
public HostAddress searchByStartName(Protocol secondaryProtocol, List<HostAddress> loopAddress) { if (!isSecondaryHostFail()) { int checkWriterAttempts = 3; HostAddress currentWriter = null; do { try { currentWriter = searchForMasterHostAddress(secondaryProtocol, loopAddress); } catch (QueryException qe) { if (proxy.hasToHandleFailover(qe) && setSecondaryHostFail()) { addToBlacklist(secondaryProtocol.getHostAddress()); return null; } } checkWriterAttempts--; } while (currentWriter == null && checkWriterAttempts > 0); if (currentWriter == null && getClusterHostAddress() != null) { AuroraProtocol tempProtocol = AuroraProtocol.getNewProtocol(getProxy(), getUrlParser()); tempProtocol.setHostAddress(getClusterHostAddress()); try { tempProtocol.connect(); return searchForMasterHostAddress(tempProtocol, loopAddress); } catch (QueryException qe) { if (proxy.hasToHandleFailover(qe)) { addToBlacklist(tempProtocol.getHostAddress()); } } finally { tempProtocol.close(); } } return currentWriter; } return null; }

Target:
public HostAddress searchByStartName(Protocol secondaryProtocol, List<HostAddress> loopAddress) { if (!isSecondaryHostFail()) { int checkWriterAttempts = 3; HostAddress currentWriter = null; do { try { currentWriter = searchForMasterHostAddress(secondaryProtocol, loopAddress); } catch (QueryException qe) { if (proxy.hasToHandleFailover(qe) && setSecondaryHostFail()) { addToBlacklist(secondaryProtocol.getHostAddress()); return null; } } checkWriterAttempts--; } while (currentWriter == null && checkWriterAttempts > 0); if (currentWriter == null && getClusterHostAddress() != null) { AuroraProtocol possibleMasterProtocol = AuroraProtocol.getNewProtocol(getProxy(), getUrlParser()); possibleMasterProtocol.setHostAddress(getClusterHostAddress()); try { possibleMasterProtocol.connect(); possibleMasterProtocol.setMustBeMasterConnection(true); foundActiveMaster(possibleMasterProtocol); } catch (QueryException qe) { if (proxy.hasToHandleFailover(qe)) { addToBlacklist(possibleMasterProtocol.getHostAddress()); } } } return currentWriter; } return null; }
Source:
private Map<URI, KafkaStreamImporterConfig> createKafkaImporterConfigFromProperties(KafkaExternalLoaderCLIArguments properties) throws Exception { List<HostAndPort> brokerList; String brokerListString; if (!properties.zookeeper.trim().isEmpty()) { brokerList = getBrokersFromZookeeper(properties.zookeeper); brokerListString = StringUtils.join(brokerList.stream().map(s -> s.getHost() + ":" + s.getPort()).collect(Collectors.toList()), ","); } else { brokerListString = properties.brokers.trim(); brokerList = Arrays.stream(brokerListString.split(",")).map(s -> HostAndPort.fromString(s)).collect(Collectors.toList()); } String brokerKey = KafkaStreamImporterConfig.getBrokerKey(brokerListString); FormatterBuilder fb = createFormatterBuilder(properties); return KafkaStreamImporterConfig.getConfigsForPartitions(brokerKey, brokerList, properties.topic, properties.groupid, properties.procedure, properties.timeout, properties.buffersize, properties.commitPolicy, fb); }

Target:
private Map<URI, KafkaStreamImporterConfig> createKafkaImporterConfigFromProperties(KafkaExternalLoaderCLIArguments properties) throws Exception { List<HostAndPort> brokerList; String brokerListString; if (!properties.zookeeper.trim().isEmpty()) { brokerList = getBrokersFromZookeeper(properties.zookeeper, properties.zookeeperSessionTimeoutMillis); brokerListString = StringUtils.join(brokerList.stream().map(s -> s.getHost() + ":" + s.getPort()).collect(Collectors.toList()), ","); } else { brokerListString = properties.brokers.trim(); brokerList = Arrays.stream(brokerListString.split(",")).map(s -> HostAndPort.fromString(s)).collect(Collectors.toList()); } String brokerKey = KafkaStreamImporterConfig.getBrokerKey(brokerListString); FormatterBuilder builder = createFormatterBuilder(properties); return KafkaStreamImporterConfig.getConfigsForPartitions(brokerKey, brokerList, properties.topic, properties.groupid, properties.procedure, properties.timeout, properties.buffersize, properties.commitPolicy, builder); }
Source:
List<StartIdentifiedAtlasDbTransactionResponse> startIdentifiedAtlasDbTransactionBatch(int count) { return autobatcher.applyBatch( IntStream.range(0, count).mapToObj($ -> (Void) null).collect(Collectors.toList())) .stream() .map(result -> { try { return result.get(); } catch (ExecutionException e) { throw Throwables.throwUncheckedException(e.getCause()); } catch (Throwable t) { throw Throwables.throwUncheckedException(t); } }).collect(Collectors.toList()); }

Target:
List<StartIdentifiedAtlasDbTransactionResponse> startIdentifiedAtlasDbTransactionBatch(int count) { List<StartIdentifiedAtlasDbTransactionResponse> responses = new ArrayList<>(); try { autobatcher.applyBatch( IntStream.range(0, count).mapToObj($ -> (Void) null).collect(Collectors.toList())) .forEach(result -> { try { responses.add(result.get()); } catch (Throwable t) { throw new RuntimeException(t); } }); return responses; } catch (RuntimeException e) { responses.forEach(response -> unlock(ImmutableSet.of(response.immutableTimestamp().getLock()))); throw e; } }
Source:
public static boolean isInvalidCard(String cardNumber) { return (ERROR_CARDS.containsKey(cardNumber)); }

Target:
public static boolean isInvalidCard(String cardNumber) { return ERROR_CARDS.containsKey(cardNumber); }
Source:
public void assetsDone() { cAquariumConfig = new Configuration(); cStartScreen = new StartScreen(); setScreen(cStartScreen); }

Target:
public void assetsDone() { cAquariumConfig = new Configuration(); setScreen(new StartScreen()); }
Source:
public Substr() { super(new Column[] { new Column("org/apache/tajo/storage/text", TajoDataTypes.Type.TEXT), new Column("from", TajoDataTypes.Type.INT4), new Column("length", TajoDataTypes.Type.INT4) }); }

Target:
public Substr() { super(new Column[] { new Column("text", TajoDataTypes.Type.TEXT), new Column("from", TajoDataTypes.Type.INT4), new Column("length", TajoDataTypes.Type.INT4) }); }
Source:
private void sendProcessingMessages(SurveyInstance domain) { QueueFactory.getQueue("dataSummarization").add( TaskOptions.Builder.withUrl("/app_worker/datasummarization") .param("objectKey", domain.getKey().getId() + "") .param("type", "SurveyInstance")); QueueFactory.getDefaultQueue().add( TaskOptions.Builder .withUrl("/app_worker/surveyalservlet") .param(SurveyalRestRequest.ACTION_PARAM, SurveyalRestRequest.INGEST_INSTANCE_ACTION) .param(SurveyalRestRequest.SURVEY_INSTANCE_PARAM, domain.getKey().getId() + "")); }

Target:
private void sendProcessingMessages(SurveyInstance domain) { QueueFactory.getQueue(DATA_SUMMARIZATION_QUEUE).add( TaskOptions.Builder.withUrl(DATA_SUMMARIZATION_URL) .param(OBJECT_KEY_PARAM, domain.getKey().getId() + "") .param(TYPE_PARAM, SI_TYPE)); QueueFactory.getDefaultQueue().add( TaskOptions.Builder.withUrl(SURVEYAL_URL) .param(SurveyalRestRequest.ACTION_PARAM, SurveyalRestRequest.INGEST_INSTANCE_ACTION) .param(SurveyalRestRequest.SURVEY_INSTANCE_PARAM, domain.getKey().getId() + "")); }
Source:
public void initialise() { playerCamera = worldRenderer.getActiveCamera(); addDesiredStateChange(new LookThrough(playerCamera)); lightGeometryMaterial = getMaterial(LIGHT_GEOMETRY_MATERIAL); addDesiredStateChange(new EnableMaterial(LIGHT_GEOMETRY_MATERIAL.toString())); addDesiredStateChange(new EnableFaceCulling()); addDesiredStateChange(new SetFacesToCull(GL_FRONT)); addDesiredStateChange(new EnableBlending()); addDesiredStateChange(new SetBlendFunction(GL_ONE, GL_ONE_MINUS_SRC_COLOR)); addDesiredStateChange(new DisableDepthTest()); addDesiredStateChange(new BindFBO(READONLY_GBUFFER, displayResolutionDependentFBOs)); update(); initLightSphereDisplayList(); displayResolutionDependentFBOs.subscribe(this); }

Target:
public void initialise() { playerCamera = worldRenderer.getActiveCamera(); addDesiredStateChange(new LookThrough(playerCamera)); lightGeometryMaterial = getMaterial(LIGHT_GEOMETRY_MATERIAL); addDesiredStateChange(new EnableMaterial(LIGHT_GEOMETRY_MATERIAL.toString())); addDesiredStateChange(new EnableFaceCulling()); addDesiredStateChange(new SetFacesToCull(GL_FRONT)); addDesiredStateChange(new EnableBlending()); addDesiredStateChange(new SetBlendFunction(GL_ONE, GL_ONE_MINUS_SRC_COLOR)); addDesiredStateChange(new DisableDepthTest()); addDesiredStateChange(new BindFBO(READONLY_GBUFFER, displayResolutionDependentFBOs)); update(); displayResolutionDependentFBOs.subscribe(this); initLightSphereDisplayList(); }
Source:
public void before() { daoConfig.addTreatReferencesAsLogical("<LINK_1>*"); daoConfig.addTreatReferencesAsLogical("<LINK_0>*"); }

Target:
public void before() throws IOException { PackageCacheManager packageCacheManager = new PackageCacheManager(true, 1); InputStream stream; stream = IgInstallerTestDstu3.class.getResourceAsStream("erroneous-ig.tar.gz"); packageCacheManager.addPackageToCache("erroneous-ig", "1.0.0", stream, "erroneous-ig"); stream = IgInstallerTestDstu3.class.getResourceAsStream("NHSD.Assets.STU3.tar.gz"); packageCacheManager.addPackageToCache("NHSD.Assets.STU3", "1.0.0", stream, "NHSD.Assets.STU3"); stream = IgInstallerTestDstu3.class.getResourceAsStream("basisprofil.de.tar.gz"); packageCacheManager.addPackageToCache("basisprofil.de", "0.2.40", stream, "basisprofil.de"); }
Source:
private void throwUnsupported(String feature) { throw new UnsupportedOperationException(feature + " is not supported on this operating system"); }

Target:
private void throwUnsupported(String feature) { throw new UnsupportedOperationException(feature + " is not supported on this file system"); }
Source:
public void shouldGetActiveConditions() { Patient patient = new Patient(2); List<Condition> active = dao.getActiveConditions(patient); assertEquals(active.size(), 2); assertEquals(active.get(0).getClinicalStatus(), ConditionClinicalStatus.INACTIVE); assertEquals(active.get(0).getVerificationStatus(), ConditionVerificationStatus.PROVISIONAL); assertEquals(active.get(1).getClinicalStatus(), ConditionClinicalStatus.ACTIVE); assertEquals(active.get(1).getVerificationStatus(), ConditionVerificationStatus.CONFIRMED); Patient secondPatient = new Patient(8); List<Condition> active2 = dao.getActiveConditions(secondPatient); assertEquals(active2.size(), 1); assertEquals(active2.get(0).getClinicalStatus(), ConditionClinicalStatus.ACTIVE); assertEquals(active2.get(0).getVerificationStatus(), ConditionVerificationStatus.CONFIRMED); }

Target:
public void shouldGetActiveConditions() { Patient patient = new Patient(2); List<Condition> active = dao.getActiveConditions(patient); assertEquals(2, active.size()); }
Source:
public DelegatingResourceDescription getRepresentationDescription(Representation representation) { if (representation instanceof DefaultRepresentation) { DelegatingResourceDescription description = new DelegatingResourceDescription(); description.addProperty("uuid"); description.addProperty("condition"); description.addProperty("clinicalStatus"); description.addProperty("verificationStatus"); description.addProperty("previousVersion"); description.addProperty("onsetDate"); description.addSelfLink(); description.addLink("full", ".?v=" + RestConstants.REPRESENTATION_FULL); return description; } else if (representation instanceof FullRepresentation) { DelegatingResourceDescription description = new DelegatingResourceDescription(); description.addProperty("uuid"); description.addProperty("condition"); description.addProperty("clinicalStatus"); description.addProperty("verificationStatus"); description.addProperty("previousVersion"); description.addProperty("onsetDate"); description.addProperty("additionalDetail"); description.addSelfLink(); return description; } return null; }

Target:
public DelegatingResourceDescription getRepresentationDescription(Representation representation) { if (representation instanceof DefaultRepresentation) { DelegatingResourceDescription description = new DelegatingResourceDescription(); description.addProperty("uuid"); description.addProperty("display"); description.addProperty("condition"); description.addProperty("patient", Representation.REF); description.addProperty("clinicalStatus"); description.addProperty("verificationStatus"); description.addProperty("previousVersion"); description.addProperty("onsetDate"); description.addProperty("voided"); description.addSelfLink(); description.addLink("full", ".?v=" + RestConstants.REPRESENTATION_FULL); return description; } else if (representation instanceof FullRepresentation) { DelegatingResourceDescription description = new DelegatingResourceDescription(); description.addProperty("uuid"); description.addProperty("display"); description.addProperty("condition"); description.addProperty("patient", Representation.REF); description.addProperty("clinicalStatus"); description.addProperty("verificationStatus"); description.addProperty("previousVersion"); description.addProperty("onsetDate"); description.addProperty("additionalDetail"); description.addProperty("voided"); description.addProperty("auditInfo"); description.addSelfLink(); return description; } return null; }
Source:
public boolean willEnter(Object request, Object target) { int modifierKeys = 0; if (request instanceof SelectionRequest) { modifierKeys = ((SelectionRequest) request).getModifiers(); } else if (request instanceof MouseEvent) { modifierKeys = ((MouseEvent) request).stateMask; } return (modifierKeys == SWT.CONTROL + SWT.SHIFT); }

Target:
public boolean willEnter(Object request, Object target) { int modifierKeys = SWT.NONE; if (request instanceof SelectionRequest) { modifierKeys = ((SelectionRequest) request).getModifiers(); } else if (request instanceof MouseEvent) { modifierKeys = ((MouseEvent) request).stateMask; } return (modifierKeys == SWT.CONTROL + SWT.SHIFT); }
Source:
protected String acquireIpAddress() { if(ipTable != null) { for(Map.Entry<String, Boolean> entry : ipTable.entrySet()) { if(! entry.getValue()) { entry.setValue(true); return entry.getKey(); } } } return null; }

Target:
protected String acquireIpAddress() { for(Map.Entry<String, Boolean> entry : ipTable.entrySet()) { if(! entry.getValue()) { entry.setValue(true); return entry.getKey(); } } return null; }
Source:
private String getExceptionResponseHtml(Throwable throwable, int statusCode, String message, String report, StringManager smClient) { if (exceptionResponseHtml != null) { return exceptionResponseHtml; } String redirectHtmlPath = null; FileInputStream fis; try { redirectHtmlPath = CarbonUtils.getCarbonHome() + File.separator + "repository" + File.separator + "resources" + File.separator + "identity" + File.separator + "pages" + File.separator + "oauth2_server_error_response.html"; fis = new FileInputStream(new File(redirectHtmlPath)); exceptionResponseHtml = new Scanner(fis, "UTF-8").useDelimiter("\\A").next(); } catch (FileNotFoundException e) { if (log.isDebugEnabled()) { log.debug("Showing default error page, " + "\'" + redirectHtmlPath + "\' not found"); } exceptionResponseHtml = buildDefaultErrorResponse(throwable, statusCode, message, report, smClient); } return exceptionResponseHtml; }

Target:
private String getExceptionResponseHtml(Throwable throwable, int statusCode, String message, String report, StringManager smClient) { if (exceptionResponseHtml != null) { return exceptionResponseHtml; } String redirectHtmlPath = null; FileInputStream fis; try { redirectHtmlPath = CarbonUtils.getCarbonHome() + File.separator + "repository" + File.separator + "resources" + File.separator + "identity" + File.separator + "pages" + File.separator + "server_error_response.html"; fis = new FileInputStream(new File(redirectHtmlPath)); exceptionResponseHtml = new Scanner(fis, "UTF-8").useDelimiter("\\A").next(); } catch (FileNotFoundException e) { if (log.isDebugEnabled()) { log.debug("Showing default error page, " + "\'" + redirectHtmlPath + "\' not found"); } exceptionResponseHtml = buildDefaultErrorResponse(throwable, statusCode, message, report, smClient); } return exceptionResponseHtml; }
Source:
private void initUnregisteredEntity(Guid entityId, Guid storageDomainId) { if (!isUnregisteredEntityExists()) { List<OvfEntityData> ovfEntityList = unregisteredOVFDataDao.getByEntityIdAndStorageDomain(entityId, storageDomainId); if (!ovfEntityList.isEmpty()) { ovfEntityData = ovfEntityList.get(0); try { setUnregisteredEntityAndImages(); } catch (OvfReaderException e) { log.error("Failed to parse a given ovf configuration: {}:\n{}", e.getMessage(), ovfEntityData.getOvfData()); log.debug("Exception: ", e); } } } }

Target:
private void initUnregisteredEntity(Guid entityId, Guid storageDomainId) { List<OvfEntityData> ovfEntityList = unregisteredOVFDataDao.getByEntityIdAndStorageDomain(entityId, storageDomainId); if (!ovfEntityList.isEmpty()) { ovfEntityData = ovfEntityList.get(0); try { setUnregisteredEntityAndImages(); } catch (OvfReaderException e) { log.error("Failed to parse a given ovf configuration: {}:\n{}", e.getMessage(), ovfEntityData.getOvfData()); log.debug("Exception: ", e); } } }
Source:
public Task assign(AssignTaskPayload assignTaskPayload) { Task task; try { task = task(assignTaskPayload.getTaskId()); } catch (IllegalStateException ex) { throw new IllegalStateException("The authenticated user cannot assign task" + assignTaskPayload.getTaskId() + " due it is not a candidate for it"); } if (task.getAssignee() != null && !task.getAssignee().isEmpty()) { taskService.unclaim(assignTaskPayload.getTaskId()); } taskService.claim(assignTaskPayload.getTaskId(), assignTaskPayload.getAssignee()); return task(assignTaskPayload.getTaskId()); }

Target:
public Task assign(AssignTaskPayload assignTaskPayload) { taskService.unclaim(assignTaskPayload.getTaskId()); taskService.claim(assignTaskPayload.getTaskId(), assignTaskPayload.getAssignee()); return task(assignTaskPayload.getTaskId()); }
Source:
public synchronized Collection<MetaAnnotation> getAnnotations() { final Annotation[] array; if (annotationsCache != null) { array = annotationsCache; } else { array = annotationsCache = constructor.getAnnotations(); } return Arrays.stream(array).map(JavaReflectionAnnotation::new).collect(Collectors.toList()); }

Target:
public Collection<MetaAnnotation> getAnnotations() { return Arrays.stream(constructor.getAnnotations()).map(JavaReflectionAnnotation::new).collect(toList()); }
Source:
private String getName(PublicizeConnection connection) { String name = connection.getExternalDisplayName(); if (name.isEmpty()) { name = connection.getExternalName(); } return name; }

Target:
private String getName(PublicizeConnection connection) { String name = connection.getExternalName(); if (name.isEmpty()) { name = connection.getExternalDisplayName(); } return name; }
Source:
public boolean equalsTypeElementWithType(ATypeElementWithType o) { return super.equals(o) && o.type.equals(type); }

Target:
public boolean equalsTypeElementWithType(ATypeElementWithType o) { return super.equals(o) && (o.type == null ? type == null : o.type.equals(type)); }
Source:
public static void setUpValidator() { ValidatorFactory factory = Validation.buildDefaultValidatorFactory(); validator = factory.getValidator(); telephoneRequestBuilder .amount(1200) .description("Some description") .reference("Some reference") .createdDate("2018-02-21T16:04:25Z") .authorisedDate("2018-02-21T16:05:33Z") .authCode("666") .processorId("1PROC") .providerId("1PROV") .lastFourDigits("1234") .firstSixDigits("123456") .cardExpiry("01/13") .cardType("visa") .nameOnCard("Jane Doe") .emailAddress("jane_doe@example.com") .telephoneNumber("+447700900796"); }

Target:
public static void setUpValidator() { ValidatorFactory factory = Validation.buildDefaultValidatorFactory(); validator = factory.getValidator(); telephoneRequestBuilder .withAmount(1200) .withDescription("Some description") .withReference("Some reference") .withCreatedDate("2018-02-21T16:04:25Z") .withAuthorisedDate("2018-02-21T16:05:33Z") .withAuthCode("666") .withProcessorId("1PROC") .withProviderId("1PROV") .withLastFourDigits("1234") .withFirstSixDigits("123456") .withCardExpiry("01/13") .withCardType("visa") .withNameOnCard("Jane Doe") .withEmailAddress("jane_doe@example.com") .withTelephoneNumber("+447700900796"); }
Source:
public Object call(ApiCaller ac, Deserializer parms) throws PerunException { return ac.getDatabaseManager().getTimeOfQueryPerformance(ac.getSession()); }

Target:
public Object call(ApiCaller ac, Deserializer parms) throws PerunException { return ac.getDatabaseManager().getCurrentDatabaseVersion(ac.getSession()); }
Source:
public void testPrepRequestProcessorMetrics() throws Exception { PrepRequestProcessor prepRequestProcessor = new PrepRequestProcessor(zks, nextProcessor); PrepRequestProcessor.skipACL = true; prepRequestProcessor.processRequest(createRequest("/foo", ZooDefs.OpCode.setData)); prepRequestProcessor.processRequest(createRequest("/foo/bar", ZooDefs.OpCode.delete)); prepRequestProcessor.processRequest(createRequest(2, ZooDefs.OpCode.closeSession)); Map<String, Object> values = ServerMetrics.getAllValues(); Assert.assertEquals(3L, values.get("prep_processor_request_queued")); prepRequestProcessor.start(); Thread.sleep(500); values = ServerMetrics.getAllValues(); Assert.assertEquals(3L, values.get("max_prep_processor_queue_size")); Assert.assertThat((long)values.get("min_prep_processor_queue_time_ms"), greaterThan(0l)); Assert.assertEquals(3L, values.get("cnt_prep_processor_queue_time_ms")); Assert.assertEquals(3L, values.get("cnt_prep_process_time")); Assert.assertThat((long)values.get("max_prep_process_time"), greaterThan(0l)); Assert.assertEquals(1L, values.get("cnt_close_session_prep_time")); Assert.assertThat((long)values.get("max_close_session_prep_time"), greaterThanOrEqualTo(0L)); Assert.assertEquals(5L, values.get("outstanding_changes_queued")); }

Target:
public void testPrepRequestProcessorMetrics() throws Exception { CountDownLatch threeRequests = new CountDownLatch(3); doAnswer(invocationOnMock -> { threeRequests.countDown(); return null;}).when(nextProcessor).processRequest(any(Request.class)); PrepRequestProcessor prepRequestProcessor = new PrepRequestProcessor(zks, nextProcessor); PrepRequestProcessor.skipACL = true; prepRequestProcessor.processRequest(createRequest("/foo", ZooDefs.OpCode.setData)); prepRequestProcessor.processRequest(createRequest("/foo/bar", ZooDefs.OpCode.delete)); prepRequestProcessor.processRequest(createRequest(2, ZooDefs.OpCode.closeSession)); Map<String, Object> values = MetricsUtils.currentServerMetrics(); Assert.assertEquals(3L, values.get("prep_processor_request_queued")); prepRequestProcessor.start(); threeRequests.await(500, TimeUnit.MILLISECONDS); values = MetricsUtils.currentServerMetrics(); Assert.assertEquals(3L, values.get("max_prep_processor_queue_size")); Assert.assertThat((long)values.get("min_prep_processor_queue_time_ms"), greaterThan(0l)); Assert.assertEquals(3L, values.get("cnt_prep_processor_queue_time_ms")); Assert.assertEquals(3L, values.get("cnt_prep_process_time")); Assert.assertThat((long)values.get("max_prep_process_time"), greaterThan(0l)); Assert.assertEquals(1L, values.get("cnt_close_session_prep_time")); Assert.assertThat((long)values.get("max_close_session_prep_time"), greaterThanOrEqualTo(0L)); Assert.assertEquals(5L, values.get("outstanding_changes_queued")); }
Source:
public DublinCoreSchemaImpl(DublinCoreSchema schema, Metadata metadata) { this.schema = schema; this.metadata = metadata; }

Target:
public DublinCoreSchemaImpl(DublinCoreSchema schema, Metadata metadata) { if (schema == null) { throw new IllegalArgumentException("DublinCore schema representation can not be null"); } if (metadata == null) { throw new IllegalArgumentException("Metadata representation can not be null"); } this.schema = schema; this.metadata = metadata; }
Source:
public void testSslHandshakeTimeoutHappenedWhenUpgradeSsl() { server.close(); client.close(); NetServerOptions serverOptions = new NetServerOptions() .setSsl(false); server = vertx.createNetServer(serverOptions); NetClientOptions clientOptions = new NetClientOptions() .setSsl(false) .setTrustAll(true) .setSslHandshakeTimeout(200) .setSslHandshakeTimeoutUnit(TimeUnit.MILLISECONDS); client = vertx.createNetClient(clientOptions); server.connectHandler(s -> { }).listen(testAddress, ar -> { assertTrue(ar.succeeded()); client.connect(testAddress, res -> { assertTrue(res.succeeded()); NetSocket socket = res.result(); assertFalse(socket.isSsl()); socket.upgradeToSsl(v -> { fail("this should never be called"); assertFalse(socket.isSsl()); }); vertx.setTimer(2000, id -> { testComplete(); }); }); }); await(); }

Target:
public void testSslHandshakeTimeoutHappenedWhenUpgradeSsl() { server.close(); client.close(); NetServerOptions serverOptions = new NetServerOptions() .setSsl(false); server = vertx.createNetServer(serverOptions); NetClientOptions clientOptions = new NetClientOptions() .setSsl(false) .setTrustAll(true) .setSslHandshakeTimeout(200) .setSslHandshakeTimeoutUnit(TimeUnit.MILLISECONDS); client = vertx.createNetClient(clientOptions); server.connectHandler(s -> { }).listen(testAddress, ar -> { assertTrue(ar.succeeded()); client.connect(testAddress, res -> { assertTrue(res.succeeded()); NetSocket socket = res.result(); assertFalse(socket.isSsl()); socket.upgradeToSsl(v -> { fail("this should never be called because of failure of handshake"); }); socket.exceptionHandler(err -> { assertTrue(err instanceof SSLException); assertEquals("handshake timed out", err.getMessage()); testComplete(); }); }); }); await(); }
Source:
public void registerKfsPvenApprovalForExistingPaymentWorksVendor(String kfsVendorDocumentNumber, VendorDetail vendorDetail) { PaymentWorksVendor pmwVendor = getPaymentWorksVendorByDocumentNumber(kfsVendorDocumentNumber); if (ObjectUtils.isNotNull(pmwVendor)) { LOG.info("registerKfsPvenApprovalForExistingPaymentWorksVendor: Approving PaymentWorks originating Vendor with table ID '" + pmwVendor.getId() + "' and kfsVendorDocumentNumber '" + kfsVendorDocumentNumber + "' and pmwVendorRequestId '" + pmwVendor.getPmwVendorRequestId() + "' and vendor number '"); getPaymentWorksVendorDao().updateExistingPaymentWorksVendorInStagingTable(pmwVendor.getId(), PaymentWorksConstants.KFSVendorProcessingStatus.VENDOR_APPROVED, vendorDetail.getVendorHeaderGeneratedIdentifier(), vendorDetail.getVendorDetailAssignedIdentifier(), PaymentWorksConstants.SupplierUploadStatus.PENDING_PAAT, getDateTimeService().getCurrentTimestamp()); } else { LOG.error("registerKfsPvenApprovalForExistingPaymentWorksVendor: PaymentWorks staging table retrieval by KFS document number '" + kfsVendorDocumentNumber + "' failed to find vendor to set KFS Approve status values."); } }

Target:
public void registerKfsPvenApprovalForExistingPaymentWorksVendor(String kfsVendorDocumentNumber, VendorDetail vendorDetail) { PaymentWorksVendor pmwVendor = getPaymentWorksVendorByDocumentNumber(kfsVendorDocumentNumber); if (ObjectUtils.isNotNull(pmwVendor)) { LOG.info("registerKfsPvenApprovalForExistingPaymentWorksVendor: Approving PaymentWorks originating Vendor with table ID '" + pmwVendor.getId() + "' and kfsVendorDocumentNumber '" + kfsVendorDocumentNumber + "' and pmwVendorRequestId '" + pmwVendor.getPmwVendorRequestId() + "' and vendor number '"); getPaymentWorksVendorDao().updateExistingPaymentWorksVendorInStagingTable(pmwVendor.getId(), PaymentWorksConstants.KFSVendorProcessingStatus.VENDOR_APPROVED, vendorDetail.getVendorHeaderGeneratedIdentifier(), vendorDetail.getVendorDetailAssignedIdentifier(), getDateTimeService().getCurrentTimestamp()); } else { LOG.error("registerKfsPvenApprovalForExistingPaymentWorksVendor: PaymentWorks staging table retrieval by KFS document number '" + kfsVendorDocumentNumber + "' failed to find vendor to set KFS Approve status values."); } }
Source:
public void testFetchAllProjects() throws ProjectManagerException { System.out.println("projectManagerTest: testFetchAllProjects"); ProjectManager manager = createProjectManager(); String projectName1 = "myTestFetchAllProjects_1"; String projectDescription1 = "This is to test fetching all projects: project_1"; User user = new User("testUser"); Project project1 = createProjectUtil(manager, projectName1, projectDescription1, user); String projectName2 = "myTestFetchAllProjects_2"; String projectDescription2 = "This is to test fetching all projects: project_2"; Project project2 = createProjectUtil(manager, projectName2, projectDescription2, user); List<Project> fetchedProjects = manager.getProjects(); Assert.assertTrue("Fetched project_1", fetchedProjects.contains(project1)); Assert.assertTrue("Fetched project_2", fetchedProjects.contains(project2)); System.out.println("Fetched all projects successfully"); }

Target:
public void testFetchAllProjects() throws Exception { System.out.println("TestFetchAllProjects"); List<Project> projects = new ArrayList<>(); Project new_project1 = manager.createProject(PROJECT_NAME, PROJECT_DESCRIPTION, user); Project project2 = new Project(PROJECT_ID_2, PROJECT_NAME_2); project2.setDescription(PROJECT_DESCRIPTION); project2.setActive(true); project2.setVersion(PROJECT_VERSION); when(loader.createNewProject(PROJECT_NAME_2, PROJECT_DESCRIPTION, user)).thenReturn(project2); Project new_project2 = manager.createProject(PROJECT_NAME_2, PROJECT_DESCRIPTION, user); projects.add(new_project1); projects.add(new_project2); when(loader.fetchAllActiveProjects()).thenReturn(projects); List<Project> fetchedProjects = manager.getProjects(); Assert.assertEquals("Fetched projects: ", projects, fetchedProjects); }
Source:
public static void main(String[] args) { LocalQueryRunner queryRunner = createLocalQueryRunner(ImmutableMap.of("reorder_joins", "false")); new SqlConsecutiveJoinBenchmark(queryRunner).runBenchmark(new SimpleLineBenchmarkResultWriter(System.out)); }

Target:
public static void main(String[] args) { LocalQueryRunner queryRunner = createLocalQueryRunner(ImmutableMap.of("reorder_joins", "false")); new SqlConsecutiveJoinBenchmark(queryRunner).runBenchmark(new SimpleLineBenchmarkResultWriter(System.out)); queryRunner.close(); }
Source:
public String getSuggestedLabel() { final Date highestValue = getHighestValue(); final Date lowestValue = getLowestValue(); if (highestValue == null || lowestValue == null) { return null; } final InputColumn column = getColumn(); if (column == null) { return null; } return getDateLabel(lowestValue) + " =< " + column.getName() + " =< " + getDateLabel(highestValue); }

Target:
public String getSuggestedLabel() { final Date highestValue = getHighestValue(); final Date lowestValue = getLowestValue(); if (highestValue == null || lowestValue == null) { return null; } final InputColumn<Date> column = getColumn(); if (column == null) { return null; } return getDateLabel(lowestValue) + " =< " + column.getName() + " =< " + getDateLabel(highestValue); }
Source:
private boolean readMessageHeader(ByteBuffer peerDataBuffer) throws IOException { int headerStartPos = peerDataBuffer.position(); messageLength = peerDataBuffer.getInt(); calcHdrVersion(messageLength); messageLength = calcMsgByteSize(messageLength); messageType = peerDataBuffer.get(); messageId = peerDataBuffer.getShort(); directAck = (messageType & DIRECT_ACK_BIT) != 0; if (directAck) { messageType &= ~DIRECT_ACK_BIT; } if (!validMsgType(messageType)) { Integer nioMessageTypeInteger = (int) messageType; logger.fatal("Unknown P2P message type: {}", nioMessageTypeInteger); readerShuttingDown = true; requestClose(String.format("Unknown P2P message type: %s", nioMessageTypeInteger)); return false; } lengthSet = true; peerDataBuffer.position(headerStartPos); return true; }

Target:
private boolean readMessageHeader(ByteBuffer peerDataBuffer) throws IOException { int headerStartPos = peerDataBuffer.position(); messageLength = peerDataBuffer.getInt(); throwExceptionIfWrongMessageVersion(messageLength); messageLength = calcMsgByteSize(messageLength); messageType = peerDataBuffer.get(); messageId = peerDataBuffer.getShort(); directAck = (messageType & DIRECT_ACK_BIT) != 0; if (directAck) { messageType &= ~DIRECT_ACK_BIT; } if (!validMsgType(messageType)) { Integer nioMessageTypeInteger = (int) messageType; logger.fatal("Unknown P2P message type: {}", nioMessageTypeInteger); readerShuttingDown = true; requestClose(String.format("Unknown P2P message type: %s", nioMessageTypeInteger)); return false; } lengthSet = true; peerDataBuffer.position(headerStartPos); return true; }
Source:
private static List<String> formatList(JSONArray array) { List<String> result = new ArrayList<String>(); if (array != null) { for (int i = 0; i < array.size(); i++) { result.add(array.getJSONObject(i).getString(SuggestConstants.LABEL)); } } return result; }

Target:
private static List<String> formatList(JSONArray array) { List<String> result = new ArrayList<String>(); if (array != null) { for (int i = 0; i < array.size(); i++) { result.add(array.getJSONObject(i).getString(Select2Common.LABEL)); } } return result; }
Source:
public static void setUp() throws Exception { if (!SystemUtils.IS_OS_WINDOWS) { ExecutionPermission.setExecutePermission(script); } FileLoader.createConfigProjectsFileForCalendarHierarchyTests(); MockDatabase.startNode(); MockDatabase.insertProcessesFull(); MockDatabase.insertProcessForCalendarHierarchyTests(); MockDatabase.setUpAwaitility(); fileService.createDirectory(URI.create(""), "1"); SecurityTestUtils.addUserDataToSecurityContext(ServiceManager.getUserService().getById(1), 1); while (Objects.isNull(processService.findByTitle(firstProcess))) { Thread.sleep(256); } }

Target:
public static void setUp() throws Exception { if (!SystemUtils.IS_OS_WINDOWS) { ExecutionPermission.setExecutePermission(script); } FileLoader.createConfigProjectsFileForCalendarHierarchyTests(); MockDatabase.startNode(); MockDatabase.insertProcessesFull(); MockDatabase.insertProcessForCalendarHierarchyTests(); MockDatabase.setUpAwaitility(); fileService.createDirectory(URI.create(""), "1"); SecurityTestUtils.addUserDataToSecurityContext(ServiceManager.getUserService().getById(1), 1); Awaitility.await().untilTrue(new AtomicBoolean(Objects.nonNull(processService.findByTitle(firstProcess)))); }
Source:
public void setOnClosedByKeyboardCallback(final Consumer callback) { if (Objects.isNull(callback)) { closedByKeyboardCallback = Optional.empty(); } else { closedByKeyboardCallback = Optional.of(callback); } }

Target:
public void setOnClosedByKeyboardCallback(final Consumer callback) { closedByKeyboardCallback = Optional.ofNullable(callback); }
Source:
public void resolve_hasAnnotations_hasNoCookieParams() { HasAnnotations hasAnnotations = mock(HasAnnotations.class); String value = resolver.resolve(hasAnnotations); assertThat(value).isEqualTo(SOME_VALUE); }

Target:
public void resolve_hasAnnotations_hasNoCookieParams() { HasAnnotations hasAnnotations = mock(HasAnnotations.class); resolver.resolve(hasAnnotations); }
Source:
public void setUp() throws Exception { super.setUp(); localPhone = new ClippingDto().setContent("+919876543210") .setType(ClippingDto.ClippingType.PHONE_NUMBER) .setClippingProvider(ClippingDto.ClippingProvider.LOCAL).setCreateAt(new Date()) .setDeviceId("uniqueId"); remoteAddress = new ClippingDto(localPhone).setContent("H.No. 22/7, India") .setType(ClippingDto.ClippingType.ADDRESS) .setClippingProvider(ClippingDto.ClippingProvider.CLOUD); context = DroidOmniApplication_.getAppContext(); }

Target:
public void setUp() throws Exception { super.setUp(); context = DroidOmniApplication_.getAppContext(); }
Source:
public static BuddyDisconnectMessageDTO createInstance(UserDTO actingUser, BuddyDisconnectMessage messageEntity) { User userEntity = messageEntity.getUser(); return new BuddyDisconnectMessageDTO(messageEntity.getID(), messageEntity.getCreationTime(), UserDTO.createInstance(userEntity), messageEntity.getRelatedUserAnonymizedID(), messageEntity.getNickname(), messageEntity.getMessage(), messageEntity.getReason(), messageEntity.isProcessed()); }

Target:
public static BuddyDisconnectMessageDTO createInstance(UserDTO actingUser, BuddyDisconnectMessage messageEntity) { return new BuddyDisconnectMessageDTO(messageEntity.getID(), messageEntity.getCreationTime(), UserDTO.createInstanceIfNotNull(messageEntity.getUser()), messageEntity.getRelatedUserAnonymizedID(), messageEntity.getNickname(), messageEntity.getMessage(), messageEntity.getReason(), messageEntity.isProcessed()); }
Source:
private static synchronized Properties getProperties() { if (properties != null) { return properties; } properties = new Properties(); try (InputStream inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream(MESSAGES_PROPERTIES_PATH)) { properties.load(inputStream); } catch (IOException exception) { LOGGER.error("Error loading message properties {}", Messages.class, exception); } return properties; }

Target:
private static synchronized Properties getProperties() { if (properties != null) { return properties; } properties = new Properties(); try (InputStream inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream(MESSAGES_PROPERTIES_PATH)) { if (inputStream != null) { properties.load(inputStream); } else { LOGGER.error("Message properties not found", MESSAGES_PROPERTIES_PATH); } } catch (IOException exception) { LOGGER.error("Error loading message properties [{}]", MESSAGES_PROPERTIES_PATH, exception); } return properties; }
Source:
public Settings getState() { System.out.println(pathToProjectContainer); return this; }

Target:
public Settings getState() { return this; }
Source:
private List<String> verifyFileInDestinations(MountTable entry) throws IOException { GetDestinationRequest request = GetDestinationRequest.newInstance(entry.getSourcePath()); List<RemoteLocation> locations = entry.getDestinations(); List<String> nsId = getDestinationNameServices(request, locations); Set<String> destNs = new HashSet<>(nsId); List<String> nsWithoutFile = new ArrayList<>(); for (RemoteLocation location : locations) { String ns = location.getNameserviceId(); if (!destNs.contains(ns)) { nsWithoutFile.add(ns); } } return nsWithoutFile; }

Target:
public List<String> verifyFileInDestinations(MountTable entry) throws IOException { GetDestinationRequest request = GetDestinationRequest.newInstance(entry.getSourcePath()); List<RemoteLocation> locations = entry.getDestinations(); List<String> nsId = getDestinationNameServices(request, locations); Set<String> destNs = new HashSet<>(nsId); List<String> nsWithoutFile = new ArrayList<>(); for (RemoteLocation location : locations) { String ns = location.getNameserviceId(); if (!destNs.contains(ns)) { nsWithoutFile.add(ns); } } return nsWithoutFile; }
Source:
public void setJobToStatus(String theJobUUID, BulkJobStatusEnum theStatus) { Optional<BulkExportJobEntity> oJob = myBulkExportJobDao.findByJobId(theJobUUID); if (!oJob.isPresent()) { ourLog.error("Job doesn't exist!"); } else { ourLog.info("Setting job with UUID to {}", theJobUUID, theStatus); BulkExportJobEntity bulkExportJobEntity = oJob.get(); bulkExportJobEntity.setStatus(theStatus); myBulkExportJobDao.save(bulkExportJobEntity); } }

Target:
public void setJobToStatus(String theJobUUID, BulkJobStatusEnum theStatus) { Optional<BulkExportJobEntity> oJob = myBulkExportJobDao.findByJobId(theJobUUID); if (!oJob.isPresent()) { ourLog.error("Job with UUID doesn't exist!", theJobUUID); return; } ourLog.info("Setting job with UUID to {}", theJobUUID, theStatus); BulkExportJobEntity bulkExportJobEntity = oJob.get(); bulkExportJobEntity.setStatus(theStatus); myBulkExportJobDao.save(bulkExportJobEntity); }
Source:
public Map<String, Serializable> getAllVariablesWithTaskResult(TaskContext taskContext, TaskResult taskResult) { Map<String, Serializable> variables = new HashMap<>(); try { variables = extractAllVariables(taskContext, taskResult, ""); } catch (IOException | ClassNotFoundException e) { logger.error("Error reading variables from task context!"); } return resolveVariables(variables, variables); }

Target:
public Map<String, Serializable> getAllVariablesWithTaskResult(TaskContext taskContext, TaskResult taskResult) { Map<String, Serializable> variables = new HashMap<>(); try { variables = extractAllVariables(taskContext, taskResult, ""); } catch (IOException | ClassNotFoundException e) { logger.error(ERROR_READING_VARIABLES, e); } return resolveVariables(variables, variables); }
Source:
private void renderHtmlArtifact(StringBuilder output, Artifact artifact) throws Exception { String htmlContent = ""; String blankLine = "<br /><br />"; String underline = "<span style=\"text-decoration: underline;\">"; String underlineEnd = "</span>"; Collection<IAttributeType> types = artifact.getAttributeTypes(); for (IAttributeType type : types) { if (type.equals(CoreAttributeTypes.HTMLContent)) { htmlContent = artifact.getAttributesToString(type); } else if (type.equals(CoreAttributeTypes.ImageContent)) { } else { try { String attributeValue = artifact.getAttributesToString(type); if (Strings.isValid(attributeValue)) { output.append(blankLine + underline + type.getName() + underlineEnd + ": " + attributeValue); } } catch (Exception ex) { } } } output.append(blankLine + htmlContent); }

Target:
private void renderHtmlArtifact(StringBuilder output, Artifact artifact) throws Exception { String htmlContent = ""; String blankLine = "<br /><br />"; String underline = "<span style=\"text-decoration: underline;\">"; String underlineEnd = "</span>"; Collection<AttributeType> types = artifact.getAttributeTypesUsed(); for (AttributeType type : types) { if (type.equals(CoreAttributeTypes.HTMLContent)) { htmlContent = artifact.getAttributesToString(type); } else if (type.equals(CoreAttributeTypes.ImageContent)) { } else { List<Attribute<Object>> attrs = artifact.getAttributes((IAttributeType) type); for (Object o : attrs) { if ((o instanceof StringAttribute) || (o instanceof OutlineNumberAttribute)) { String attributeValue = artifact.getAttributesToString(type); if (Strings.isValid(attributeValue)) { output.append(blankLine); output.append(underline); output.append(type.getName()); output.append(underlineEnd); output.append(": "); output.append(attributeValue); } } } } } output.append(blankLine); output.append(htmlContent); }
Source:
public Map<String, Object> getPermissions(AgentPrincipals agent, PID pid) { Map<String, Object> result = getObjectPermissions(agent, pid); RepositoryObject parent = repoObjLoader.getRepositoryObject(pid); if (parent instanceof ContentContainerObject) { List<ContentObject> members = ((ContentContainerObject) parent).getMembers(); ArrayList<Map<String, Object>> memberPermissions = new ArrayList<Map<String,Object>>(); for (ContentObject member : members) { Map<String, Object> permissions = getObjectPermissions(agent, member.getPid()); memberPermissions.add(permissions); } result.put("memberPermissions", memberPermissions); } return result; }

Target:
public Map<String, Object> getPermissions(AgentPrincipals agent, PID pid) { Map<String, Object> result = getObjectPermissions(agent, pid); RepositoryObject parent = repoObjLoader.getRepositoryObject(pid); if (parent instanceof ContentContainerObject) { List<ContentObject> members = ((ContentContainerObject) parent).getMembers(); if (!members.isEmpty()) { List<Map<String, Object>> memberPermissions = new ArrayList<>(); for (ContentObject member : members) { Map<String, Object> permissions = getObjectPermissions(agent, member.getPid()); memberPermissions.add(permissions); } result.put("memberPermissions", memberPermissions); } } return result; }
Source:
public void close() throws IOException { synchronized (this) { if (!mIsOpen) { LOG.warn("close() called on an KijiTable that was already closed."); return; } mIsOpen = false; } LOG.debug(String.format("Closing KijiTable '%s'.", mTableURI)); if (null != mHTable) { mHTable.close(); } mKiji.release(); }

Target:
public void close() throws IOException { if (!mIsOpen.getAndSet(false)) { LOG.warn("close() called on resource that was already closed."); return; } LOG.debug("Closing resource '{}'.", mTableURI); if (null != mHTable) { mHTable.close(); } ResourceUtils.releaseOrLog(mKiji); LOG.debug("Resource '{}' closed.", mTableURI); }
Source:
private static int convertRawAvroType(Schema.Type type) { int sqlType = Types.NULL; switch (type) { case ENUM: case RECORD: case ARRAY: case MAP: case FIXED: case NULL: throw new UnsupportedOperationException(type + "Avro type not supported"); case STRING: sqlType = Types.VARCHAR; break; case BYTES: sqlType = Types.BINARY; break; case INT: sqlType = Types.NUMERIC; break; case LONG: sqlType = Types.NUMERIC; break; case FLOAT: sqlType = Types.FLOAT; break; case DOUBLE: sqlType = Types.DOUBLE; break; case BOOLEAN: sqlType = Types.BOOLEAN; break; } return sqlType; }

Target:
private int convertRawAvroType(Schema.Type type) { Integer sqlType = this.config.CONVERT_AVROTYPE_TO_SQLTYPE.get(type); if(sqlType != null){ return sqlType; } switch (type) { case STRING: sqlType = Types.VARCHAR; break; case BYTES: sqlType = Types.BINARY; break; case INT: sqlType = Types.NUMERIC; break; case LONG: sqlType = Types.NUMERIC; break; case FLOAT: sqlType = Types.FLOAT; break; case DOUBLE: sqlType = Types.DOUBLE; break; case BOOLEAN: sqlType = Types.BOOLEAN; break; default: throw new UnsupportedOperationException(type + "Avro type not supported"); } return sqlType; }