auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testTieredStore() throws Exception { CacheConfiguration<Long, String> tieredCacheConfiguration = newCacheConfigurationBuilder() .persistenceMode(CacheConfiguration.PersistenceMode.SWAP) .withResourcePools(newResourcePoolsBuilder().with("heap").with("disk").build()) .addServiceConfig(new OnHeapStoreServiceConfig().storeByValue(true)) .addServiceConfig(new DiskStoreServiceConfig()) .buildConfig(Long.class, String.class); CacheManager cacheManager = newCacheManagerBuilder().withCache("tieredCache", tieredCacheConfiguration).build(); Cache<Long, String> tieredCache = cacheManager.getCache("tieredCache", Long.class, String.class); tieredCache.put(1L, "one"); assertThat(tieredCache.get(1L), equalTo("one")); assertThat(tieredCache.get(1L), equalTo("one")); cacheManager.close(); }

Target:
public void testTieredStore() throws Exception { CacheConfiguration<Long, String> tieredCacheConfiguration = newCacheConfigurationBuilder() .persistenceMode(CacheConfiguration.PersistenceMode.SWAP) .withResourcePools(newResourcePoolsBuilder().heap(10, EntryUnit.ENTRIES).disk(100, EntryUnit.ENTRIES).build()) .buildConfig(Long.class, String.class); CacheManager cacheManager = newCacheManagerBuilder().withCache("tieredCache", tieredCacheConfiguration).build(); Cache<Long, String> tieredCache = cacheManager.getCache("tieredCache", Long.class, String.class); tieredCache.put(1L, "one"); assertThat(tieredCache.get(1L), equalTo("one")); assertThat(tieredCache.get(1L), equalTo("one")); cacheManager.close(); }
Source:
public Response sendStreamingRequest(Request request) throws IOException, AppException { OkHttpClient client = getStreamClient(); okhttp3.Request okRequest = makeRequest(request.getMethod(), request.getUrl(), request.getHeaders(), request.getBody()); Call call = client.newCall(okRequest); okhttp3.Response response = call.execute(); if((response.code() >= 300) || ((response.code() < 200) && (response.code() != 0))) { throw new AppException(ErrorCode.fromNativeError(ErrorCode.Type.HTTP, response.code()), "http error code considered fatal"); } return OkHttpResponse.httpResponse(response.code(), parseHeaders(response.headers()), response.body().source()); }

Target:
public OsJavaNetworkTransport.Response sendStreamingRequest(Request request) throws IOException, AppException { OkHttpClient client = getStreamClient(); okhttp3.Request okRequest = makeRequest(request.getMethod(), request.getUrl(), request.getHeaders(), request.getBody()); Call call = client.newCall(okRequest); okhttp3.Response response = call.execute(); if((response.code() >= 300) || ((response.code() < 200) && (response.code() != 0))) { throw new AppException(ErrorCode.fromNativeError(ErrorCode.Type.HTTP, response.code()), response.message()); } return Response.httpResponse(response.code(), parseHeaders(response.headers()), response.body().source()); }
Source:
public void checkAttributeSemantics(PerunSessionImpl sess, Group group, Attribute attribute) throws WrongAttributeAssignmentException, InternalErrorException, WrongReferenceAttributeValueException { try { Attribute foundAttribute = sess.getPerunBl().getAttributesManagerBl().getAttribute(sess, group, GroupsManager.GROUPSYNCHROINTERVAL_ATTRNAME); if(foundAttribute.getValue() != null) { throw new WrongReferenceAttributeValueException(attribute, foundAttribute, group, null, group, null, "Attribute " + attribute.getName() + " cannot be set because attribute " + GroupsManager.GROUPSYNCHROINTERVAL_ATTRNAME + " is already set."); } } catch (AttributeNotExistsException exc) { throw new ConsistencyErrorException("Attribute " + GroupsManager.GROUPSYNCHROINTERVAL_ATTRNAME + " is supposed to exist", exc); } }

Target:
public void checkAttributeSemantics(PerunSessionImpl sess, Group group, Attribute attribute) throws WrongAttributeAssignmentException, InternalErrorException, WrongReferenceAttributeValueException { if (attribute.getValue() == null) return; try { Attribute foundAttribute = sess.getPerunBl().getAttributesManagerBl().getAttribute(sess, group, GroupsManager.GROUPSYNCHROINTERVAL_ATTRNAME); if(foundAttribute.getValue() != null) { throw new WrongReferenceAttributeValueException(attribute, foundAttribute, group, null, group, null, "Attribute " + attribute.getName() + " cannot be set because attribute " + GroupsManager.GROUPSYNCHROINTERVAL_ATTRNAME + " is already set."); } } catch (AttributeNotExistsException exc) { throw new ConsistencyErrorException("Attribute " + GroupsManager.GROUPSYNCHROINTERVAL_ATTRNAME + " is supposed to exist", exc); } }
Source:
public void testBuildMessageNumberSetsWithStartEnd() throws ImapAsyncClientException { final String msgSetStr = "1:100"; final MessageNumberSet[] messageNumberSets = MessageNumberSet.buildMessageNumberSets(msgSetStr); Assert.assertNotNull(messageNumberSets, "Result mismatched."); Assert.assertEquals(messageNumberSets.length, 1, "Result mismatched."); Assert.assertEquals(MessageNumberSet.buildString(messageNumberSets), msgSetStr, "Result mismatched"); }

Target:
public void testBuildMessageNumberSetsWithStartEnd() throws ImapAsyncClientException { final MessageNumberSet[] expectedMsgSets = { new MessageNumberSet(1, 100) }; final String msgSetStr = MessageNumberSet.buildString(expectedMsgSets); final MessageNumberSet[] actualMsgSets = MessageNumberSet.buildMessageNumberSets(msgSetStr); Assert.assertNotNull(actualMsgSets, "buildMessageNumberSets() should not return null."); Assert.assertEquals(actualMsgSets.length, 1, "buildMessageNumberSets() size mismatched."); Assert.assertEquals(actualMsgSets[0], expectedMsgSets[0], "buildMessageNumberSets() mismatched."); }
Source:
protected void doParse(BeanDefinitionBuilder builder, Element element, BeanMetadataElement processor, ParserContext parserContext){ this.injectPropertyWithAdapter(CORRELATION_STRATEGY_REF_ATTRIBUTE, CORRELATION_STRATEGY_METHOD_ATTRIBUTE, CORRELATION_STRATEGY_EXPRESSION_ATTRIBUTE, CORRELATION_STRATEGY_PROPERTY, "CorrelationStrategy", element, builder, processor, parserContext); String messageStore = element.getAttribute(MESSAGE_STORE_ATTRIBUTE); if (!StringUtils.hasText(messageStore)) { messageStore = BeanDefinitionReaderUtils.registerWithGeneratedName(new RootBeanDefinition(SimpleMessageStore.class), parserContext.getRegistry()); element.setAttribute(MESSAGE_STORE_ATTRIBUTE, messageStore); } builder.addPropertyReference("messageStore", messageStore); this.injectPropertyWithAdapter(RELEASE_STRATEGY_REF_ATTRIBUTE, RELEASE_STRATEGY_METHOD_ATTRIBUTE, RELEASE_STRATEGY_EXPRESSION_ATTRIBUTE, RELEASE_STRATEGY_PROPERTY, "ReleaseStrategy", element, builder, processor, parserContext); IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, element, DISCARD_CHANNEL_ATTRIBUTE); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, SEND_TIMEOUT_ATTRIBUTE); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, SEND_PARTIAL_RESULT_ON_EXPIRY_ATTRIBUTE); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "empty-group-min-timeout", "minimumTimeoutForEmptyGroups"); }

Target:
protected void doParse(BeanDefinitionBuilder builder, Element element, BeanMetadataElement processor, ParserContext parserContext){ this.injectPropertyWithAdapter(CORRELATION_STRATEGY_REF_ATTRIBUTE, CORRELATION_STRATEGY_METHOD_ATTRIBUTE, CORRELATION_STRATEGY_EXPRESSION_ATTRIBUTE, CORRELATION_STRATEGY_PROPERTY, "CorrelationStrategy", element, builder, processor, parserContext); this.injectPropertyWithAdapter(RELEASE_STRATEGY_REF_ATTRIBUTE, RELEASE_STRATEGY_METHOD_ATTRIBUTE, RELEASE_STRATEGY_EXPRESSION_ATTRIBUTE, RELEASE_STRATEGY_PROPERTY, "ReleaseStrategy", element, builder, processor, parserContext); IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, element, MESSAGE_STORE_ATTRIBUTE); IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, element, "scheduler", "taskScheduler"); IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, element, DISCARD_CHANNEL_ATTRIBUTE); IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, element, "lock-registry"); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, SEND_TIMEOUT_ATTRIBUTE); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, SEND_PARTIAL_RESULT_ON_EXPIRY_ATTRIBUTE); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "empty-group-min-timeout", "minimumTimeoutForEmptyGroups"); BeanDefinition expressionDef = IntegrationNamespaceUtils.createExpressionDefinitionFromValueOrExpression("group-timeout", "group-timeout-expression", parserContext, element, false); builder.addPropertyValue("groupTimeoutExpression", expressionDef); }
Source:
private void waitTillCertainPercentageOfProcessHasStarted(OozieClient oozieClient, String bundleId, int percentage) throws Exception { CoordinatorJob defaultCoordinator = getDefaultOozieCoordinator(oozieClient, bundleId); for (int i=0; null == defaultCoordinator && i < 10; i++) { TimeUnit.SECONDS.sleep(10); defaultCoordinator = getDefaultOozieCoordinator(oozieClient, bundleId); } Assert.assertNotNull(defaultCoordinator, "default coordinator is null"); for (int i = 0; i < 120 && defaultCoordinator.getStatus() == CoordinatorJob.Status.PREP; ++i) { TimeUnit.SECONDS.sleep(10); defaultCoordinator = getDefaultOozieCoordinator(oozieClient, bundleId); } Assert.assertNotEquals(defaultCoordinator.getStatus(), CoordinatorJob.Status.PREP, "Unexpected state for coordinator job: " + defaultCoordinator.getId()); int totalCount = defaultCoordinator.getActions().size(); int percentageConversion = (percentage * totalCount) / 100; while (percentageConversion > 0) { int doneBynow = 0; for (CoordinatorAction action : defaultCoordinator.getActions()) { CoordinatorAction actionInfo = oozieClient.getCoordActionInfo(action.getId()); if (actionInfo.getStatus() == CoordinatorAction.Status.RUNNING) { doneBynow++; } } if (doneBynow >= percentageConversion) { break; } TimeUnit.SECONDS.sleep(10); } }

Target:
private void waitTillCertainPercentageOfProcessHasStarted(OozieClient oozieClient, String bundleId, int percentage) throws Exception { CoordinatorJob defaultCoordinator = getDefaultOozieCoordinator(oozieClient, bundleId); for (int i = 0; i < 120 && (defaultCoordinator == null || defaultCoordinator.getStatus() == CoordinatorJob.Status.PREP); ++i) { TimeUnit.SECONDS.sleep(10); defaultCoordinator = getDefaultOozieCoordinator(oozieClient, bundleId); } Assert.assertNotNull(defaultCoordinator, "default coordinator is null"); Assert.assertNotEquals(defaultCoordinator.getStatus(), CoordinatorJob.Status.PREP, "Unexpected state for coordinator job: " + defaultCoordinator.getId()); int totalCount = defaultCoordinator.getActions().size(); int percentageConversion = (percentage * totalCount) / 100; while (percentageConversion > 0) { int doneBynow = 0; for (CoordinatorAction action : defaultCoordinator.getActions()) { CoordinatorAction actionInfo = oozieClient.getCoordActionInfo(action.getId()); if (actionInfo.getStatus() == CoordinatorAction.Status.RUNNING) { doneBynow++; } } if (doneBynow >= percentageConversion) { break; } TimeUnit.SECONDS.sleep(10); } }
Source:
public void addDDF(DDF ddf) throws DDFException { if(ddf.getUUID() == null) { throw new DDFException("uuid is null"); } Lock lock = uuidLocks.get(ddf.getUUID()); try { if(lock.tryLock(120, TimeUnit.SECONDS)) { try { if (ddf.getName() == null) { mDDFCache.put(ddf.getUUID(), ddf); } else { mDDFwithNameCache.put(ddf.getUUID(), ddf); } } finally { lock.unlock(); } } else { throw new DDFException("Timeout getting DDF"); } } catch (InterruptedException e) { } }

Target:
public void addDDF(DDF ddf) throws DDFException { if (ddf.getUUID() == null) { throw new DDFException("uuid is null"); } Lock lock = uuidLocks.get(ddf.getUUID()); try { if (lock.tryLock(120, TimeUnit.SECONDS)) { try { if (ddf.getName() == null) { mDDFCache.put(ddf.getUUID(), ddf); } else { mDDFwithNameCache.put(ddf.getUUID(), ddf); } } finally { lock.unlock(); } } else { throw new DDFException("Timeout getting DDF"); } } catch (InterruptedException e) { throw new DDFException(e); } }
Source:
private DiskPlanStore(@Parameter(PlanStorePath.class) final String planStorePath) { this.planStorePath = planStorePath; this.datumWriter = new SpecificDatumWriter<LogicalPlan>(LogicalPlan.class); this.datumReader = new SpecificDatumReader<LogicalPlan>(LogicalPlan.class); final File planFolder = new File(planStorePath); if (!planFolder.exists()) { planFolder.mkdir(); } }

Target:
private DiskPlanStore(@Parameter(PlanStorePath.class) final String planStorePath) { this.planStorePath = planStorePath; this.datumWriter = new SpecificDatumWriter<LogicalPlan>(LogicalPlan.class); this.datumReader = new SpecificDatumReader<LogicalPlan>(LogicalPlan.class); final File planFolder = new File(planStorePath); if (!planFolder.exists()) { planFolder.mkdir(); } else { final File[] destroy = planFolder.listFiles(); for (final File des : destroy) { des.delete(); } } }
Source:
public void sendNotification(MentionNotificationParameters mentionNotificationParameters) { String extractedQuote; if (this.configuration.isQuoteActivated()) { extractedQuote = this.quote.extract(mentionNotificationParameters.getXdom(), mentionNotificationParameters.getAnchorId()).orElse(null); } else { extractedQuote = null; } MentionEventParams params = new MentionEventParams() .setUserReference(mentionNotificationParameters.getAuthorReference().toString()) .setDocumentReference( mentionNotificationParameters.getDocumentReference().toString()) .setLocation(mentionNotificationParameters.getLocation()) .setAnchor(mentionNotificationParameters.getAnchorId()) .setQuote(extractedQuote); MentionEvent event = new MentionEvent(singleton(this.serializer.serialize(mentionNotificationParameters.getMentionedIdentity())), params); this.observationManager.notify(event, "org.xwiki.contrib:mentions-notifications", MentionEvent.EVENT_TYPE); }

Target:
public void sendNotification(MentionNotificationParameters mentionNotificationParameters) { String extractedQuote; if (this.configuration.isQuoteActivated()) { extractedQuote = this.quote.extract(mentionNotificationParameters.getXdom(), mentionNotificationParameters.getAnchorId()).orElse(null); } else { extractedQuote = null; } MentionEventParams params = new MentionEventParams() .setUserReference(this.serializer.serialize( mentionNotificationParameters.getAuthorReference())) .setDocumentReference(this.serializer.serialize( mentionNotificationParameters.getDocumentReference())) .setLocation(mentionNotificationParameters.getLocation()) .setAnchor(mentionNotificationParameters.getAnchorId()) .setQuote(extractedQuote); MentionEvent event = new MentionEvent( Collections.singleton(this.serializer.serialize(mentionNotificationParameters.getMentionedIdentity())), params); this.observationManager.notify(event, "org.xwiki.contrib:mentions-notifications", MentionEvent.EVENT_TYPE); }
Source:
protected AbstractFolderActionCommand(@Nonnull final String op, @Nonnull final String folderName) { this.op = op; this.folderName = folderName; this.qResyncParameter = null; }

Target:
protected AbstractFolderActionCommand(@Nonnull final String op, @Nonnull final String folderName) { this.op = op; this.folderName = folderName; }
Source:
public boolean extractQuestionDetails( Map<String, String[]> requestParameters, FeedbackQuestionType questionType) { String recommendedLengthString = HttpRequestHelper.getValueFromParamMap(requestParameters, Const.ParamsNames.FEEDBACK_QUESTION_TEXT_RECOMMENDEDLENGTH); this.recommendedLength = recommendedLengthString == null || recommendedLengthString.isEmpty() ? 0 : Integer.parseInt(recommendedLengthString); return true; }

Target:
public boolean extractQuestionDetails( Map<String, String[]> requestParameters, FeedbackQuestionType questionType) { String recommendedLengthString = HttpRequestHelper.getValueFromParamMap(requestParameters, Const.ParamsNames.FEEDBACK_QUESTION_TEXT_RECOMMENDEDLENGTH); recommendedLength = recommendedLengthString == null || recommendedLengthString.isEmpty() ? 0 : Integer.parseInt(recommendedLengthString); return true; }
Source:
public void sendAsync(RowMap r, AbstractAsyncProducer.CallbackCompleter cc) throws Exception { ProducerRecord<String, String> record = makeProducerRecord(r); String value = KafkaCallback.LOGGER.isDebugEnabled() ? record.value() : null; KafkaCallback callback = new KafkaCallback(cc, r.getNextPosition(), r.getRowIdentity(), value, this.succeededMessageCount, this.failedMessageCount, this.succeededMessageMeter, this.failedMessageMeter, this.context.getConfig().deadLetterTopic, this.context, this); sendAsync(record, callback); }

Target:
public void sendAsync(RowMap r, AbstractAsyncProducer.CallbackCompleter cc) throws Exception { ProducerRecord<String, String> record = makeProducerRecord(r); String value = KafkaCallback.LOGGER.isDebugEnabled() ? record.value() : null; KafkaCallback callback = new KafkaCallback(cc, r.getNextPosition(), r.getRowIdentity(), value, this.succeededMessageCount, this.failedMessageCount, this.succeededMessageMeter, this.failedMessageMeter, this.deadLetterTopic, this.context, this); sendAsync(record, callback); }
Source:
public boolean onGenericMotionEvent(MotionEvent event) { if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.HONEYCOMB) return false; if ((MotionEventCompat.getSource(event) & InputDevice.SOURCE_CLASS_POINTER) != 0) { switch (event.getAction()) { case MotionEvent.ACTION_SCROLL: float yDistance = MotionEventCompat.getAxisValue(event, MotionEvent.AXIS_VSCROLL); boolean mouseReport = ((vt320) bridge.buffer).isMouseReportEnabled(); if (mouseReport) { int row = (int) Math.floor(event.getY() / bridge.charHeight); int col = (int) Math.floor(event.getX() / bridge.charWidth); ((vt320) bridge.buffer).mouseWheel( yDistance > 0, col, row, (event.getMetaState() & KeyEvent.META_CTRL_ON) != 0, (event.getMetaState() & KeyEvent.META_SHIFT_ON) != 0, (event.getMetaState() & KeyEvent.META_META_ON) != 0); return true; } else if (yDistance != 0) { int base = bridge.buffer.getWindowBase(); bridge.buffer.setWindowBase(base - Math.round(yDistance)); return true; } } } return super.onGenericMotionEvent(event); }

Target:
public boolean onGenericMotionEvent(MotionEvent event) { if ((MotionEventCompat.getSource(event) & InputDevice.SOURCE_CLASS_POINTER) != 0) { switch (event.getAction()) { case MotionEvent.ACTION_SCROLL: float yDistance = MotionEventCompat.getAxisValue(event, MotionEvent.AXIS_VSCROLL); boolean mouseReport = ((vt320) bridge.buffer).isMouseReportEnabled(); if (mouseReport) { int row = (int) Math.floor(event.getY() / bridge.charHeight); int col = (int) Math.floor(event.getX() / bridge.charWidth); ((vt320) bridge.buffer).mouseWheel( yDistance > 0, col, row, (event.getMetaState() & KeyEvent.META_CTRL_ON) != 0, (event.getMetaState() & KeyEvent.META_SHIFT_ON) != 0, (event.getMetaState() & KeyEvent.META_META_ON) != 0); return true; } else if (yDistance != 0) { int base = bridge.buffer.getWindowBase(); bridge.buffer.setWindowBase(base - Math.round(yDistance)); return true; } } } return super.onGenericMotionEvent(event); }
Source:
private void setStatements() { setServer = "insert into BetterShardsBungeeConnection (uuid, server) values (?, ?) " + "on duplicate key update server = values(server);"; getServer = "select server from BetterShardsBungeeConnection where uuid = ?;"; getAllPriority = "select name, cap from priorityServers;"; }

Target:
private void setStatements() { setServer = "insert into BetterShardsBungeeConnection (uuid, server) values (?, ?) " + "on duplicate key update server = VALUES(server);"; getServer = "select server from BetterShardsBungeeConnection where uuid = ?;"; getAllPriority = "select name, cap from priorityServers;"; }
Source:
private boolean shouldRedraw(Repository db, AnyObjectId headId, List<String> paths) { boolean pathChange = pathChange(pathFilters, paths); boolean headChange = !headId.equals(currentHeadId); boolean repoChange = false; boolean allBrancheChange = currentShowAllBranches != store .getBoolean(UIPreferences.RESOURCEHISTORY_SHOW_ALL_BRANCHES); currentShowAllBranches = store .getBoolean(UIPreferences.RESOURCEHISTORY_SHOW_ALL_BRANCHES); if (!db.equals(currentRepo)) { repoChange = true; currentRepo = db; } return pathChange || currentWalk == null || headChange || repoChange || allBrancheChange; }

Target:
private boolean shouldRedraw(Repository db, AnyObjectId headId, List<String> paths) { boolean pathChanged = pathChanged(pathFilters, paths); boolean headChanged = !headId.equals(currentHeadId); boolean repoChanged = false; boolean allBranchesChanged = currentShowAllBranches != store .getBoolean(UIPreferences.RESOURCEHISTORY_SHOW_ALL_BRANCHES); currentShowAllBranches = store .getBoolean(UIPreferences.RESOURCEHISTORY_SHOW_ALL_BRANCHES); if (!db.equals(currentRepo)) { repoChanged = true; currentRepo = db; } return pathChanged || currentWalk == null || headChanged || repoChanged || allBranchesChanged; }
Source:
public void validateParameters() { SetupNetworksParameters params = new SetupNetworksParameters(); VdsNetworkInterface nic = new VdsNetworkInterface(); params.setInterfaces(Arrays.asList(nic)); Validator validator = ValidationUtils.getValidator(); nic.setNetworkName("netName"); nic.setGateway(""); nic.setBootProtocol(STATIC_IP); nic.setAddress("1.1.1.1"); assertTrue(validator.validate(params).isEmpty()); params.setConectivityTimeout(-1); assertTrue(validator.validate(params).size() == 1); }

Target:
public void validateParameters() { SetupNetworksParameters params = new SetupNetworksParameters(); VdsNetworkInterface nic = new VdsNetworkInterface(); params.setInterfaces(Arrays.asList(nic)); nic.setNetworkName("otherThenMgmtNetwork"); nic.setGateway("1.1.1.1"); Validator validator = ValidationUtils.getValidator(); assertTrue(validator.validate(params).isEmpty()); nic.setGateway(""); nic.setBootProtocol(STATIC_IP); nic.setAddress("1.1.1.1"); assertTrue(validator.validate(params).isEmpty()); params.setConectivityTimeout(-1); assertTrue(validator.validate(params).size() == 1); }
Source:
public void testBasic() throws InterruptedException { basic_war.as(ZipExporter.class).exportTo(new File("/tmp/" + basic_war.getName()), true); String url = generateURL("/logger", WAR_BASIC_TRACING_FILE); WebTarget base = client.target(url); try { Response response = base.request().get(); Assert.assertEquals(HttpResponseCodes.SC_OK, response.getStatus()); boolean hasTracing = false; for (Map.Entry entry : response.getStringHeaders().entrySet()) { if (entry.getKey().toString().startsWith(RESTEasyTracing.HEADER_TRACING_PREFIX)) { hasTracing = true; break; } } assertTrue(hasTracing); response.close(); } catch (Exception e) { throw new RuntimeException(e); } }

Target:
public void testBasic() throws InterruptedException { String url = generateURL("/logger", WAR_BASIC_TRACING_FILE); WebTarget base = client.target(url); try { Response response = base.request().get(); Assert.assertEquals(HttpResponseCodes.SC_OK, response.getStatus()); boolean hasTracing = false; for (Map.Entry entry : response.getStringHeaders().entrySet()) { if (entry.getKey().toString().startsWith(RESTEasyTracing.HEADER_TRACING_PREFIX)) { LOG.info("<K, V> ->" + entry); hasTracing = true; break; } } assertTrue(hasTracing); response.close(); } catch (Exception e) { throw new RuntimeException(e); } }
Source:
public synchronized void setLocation(ITmfLocation location) { if (location != null) { CtfIterator iterator = getIterator(); iterator.seek(((CtfLocation) location).getLocationInfo()); fCurLocation = iterator.getLocation(); } else { fCurLocation = null; } }

Target:
public synchronized void setLocation(ITmfLocation location) { if (location instanceof CtfLocation) { CtfIterator iterator = getIterator(); iterator.seek(((CtfLocation) location).getLocationInfo()); fCurLocation = iterator.getLocation(); } else { fCurLocation = null; } }
Source:
public Options getOptions() { final Options opts = super.getOptions(); numThreadsOpt = new Option("nt", "num-threads", true, "number of threads to use"); negateOpt = new Option("v", "negate", false, "only include rows without search term"); profileNameOpt = new Option("pn", "profile-name", true, "only include rows from that iterator profile"); opts.addOption(numThreadsOpt); opts.addOption(negateOpt); opts.addOption(profileNameOpt); return opts; }

Target:
public Options getOptions() { final Options opts = super.getOptions(); numThreadsOpt = new Option("nt", "num-threads", true, "number of threads to use"); negateOpt = new Option("v", "negate", false, "only include rows without search term"); opts.addOption(numThreadsOpt); opts.addOption(negateOpt); return opts; }
Source:
public void proceedCommandExecution(Guid childCmdId) { ImageTransfer entity = imageTransferDao.get(getCommandId()); if (entity == null || entity.getPhase() == null) { log.error("Image transfer status entity corrupt or missing from database" + " for image transfer command '{}'", getCommandId()); setCommandStatus(CommandStatus.FAILED); return; } if (entity.getDiskId() != null) { setImageId(entity.getDiskId()); } long ts = System.currentTimeMillis() / 1000; if (pauseTransferIfNecessary(entity, ts)) { return; } executeStateHandler(entity, ts, childCmdId); }

Target:
public void proceedCommandExecution(Guid childCmdId) { ImageTransfer entity = imageTransferDao.get(getCommandId()); if (entity == null || entity.getPhase() == null) { log.error("Image transfer status entity corrupt or missing from database" + " for image transfer command '{}'", getCommandId()); setCommandStatus(CommandStatus.FAILED); return; } if (entity.getDiskId() != null) { setImageGroupId(entity.getDiskId()); } long ts = System.currentTimeMillis() / 1000; if (pauseTransferIfNecessary(entity, ts)) { return; } executeStateHandler(entity, ts, childCmdId); }
Source:
public ClientFailoverClasspathYamlConfig(ClassLoader classLoader, String resource, Properties properties) { if (classLoader == null) { throw new IllegalArgumentException("classLoader can't be null"); } if (resource == null) { throw new IllegalArgumentException("resource can't be null"); } if (properties == null) { throw new IllegalArgumentException("properties can't be null"); } LOGGER.info("Configuring Hazelcast Client Failover from '" + resource + "'."); InputStream in = classLoader.getResourceAsStream(resource); if (in == null) { throw new IllegalArgumentException("Specified resource '" + resource + "' could not be found!"); } YamlClientFailoverConfigBuilder configBuilder = new YamlClientFailoverConfigBuilder(in); configBuilder.setProperties(properties); configBuilder.build(this); }

Target:
public ClientFailoverClasspathYamlConfig(ClassLoader classLoader, String resource, Properties properties) { checkTrue(classLoader != null, "classLoader can't be null"); checkTrue(resource != null, "resource can't be null"); checkTrue(properties != null, "properties can't be null"); LOGGER.info("Configuring Hazelcast Client Failover from '" + resource + "'."); InputStream in = classLoader.getResourceAsStream(resource); checkTrue(in != null, "Specified resource '" + resource + "' could not be found!"); YamlClientFailoverConfigBuilder configBuilder = new YamlClientFailoverConfigBuilder(in); configBuilder.setProperties(properties); configBuilder.build(this); }
Source:
private LinuxStyles() { ImmutableMap.Builder<String, LinuxStyle> builder = new Builder<>(); builder.put("UNKNOWN", new LinuxStyle(new RGB(100, 100, 100), 33)); builder.put("WAIT_UNKNOWN", new LinuxStyle(new RGB(200, 200, 200), 50)); builder.put("WAIT_BLOCKED", new LinuxStyle(new RGB(200, 200, 0), 50)); builder.put("WAIT_FOR_CPU", new LinuxStyle(new RGB(200, 100, 0), 50)); builder.put("IDLE", new LinuxStyle(new RGB(200, 200, 200), 66)); builder.put("USERMODE", new LinuxStyle(new RGB(0, 200, 0), 100)); builder.put("SYSCALL", new LinuxStyle(new RGB(0, 0, 200), 100)); LinuxStyle irqStyle = new LinuxStyle(new RGB(200, 0, 100), 75); builder.put("INTERRUPTED", irqStyle); builder.put("IRQ", irqStyle); builder.put("IRQ_ACTIVE", irqStyle); builder.put("SOFT_IRQ_RAISED", new LinuxStyle(new RGB(200, 200, 0), 100)); LinuxStyle softIrqStyle = new LinuxStyle(new RGB(200, 150, 100), 100); builder.put("SOFT_IRQ", softIrqStyle); builder.put("SOFT_IRQ_ACTIVE", softIrqStyle); fRegistry = builder.build(); }

Target:
private LinuxStyles() { ImmutableMap.Builder<String, LinuxStyle> builder = new Builder<>(); builder.put("UNKNOWN", new LinuxStyle(Messages.LinuxStyles_unknown, new RGB(100, 100, 100), 33)); builder.put("WAIT_UNKNOWN", new LinuxStyle(Messages.LinuxStyles_wait, new RGB(200, 200, 200), 50)); builder.put("WAIT_BLOCKED", new LinuxStyle(Messages.LinuxStyles_waitBlocked, new RGB(200, 200, 0), 50)); builder.put("WAIT_FOR_CPU", new LinuxStyle(Messages.LinuxStyles_waitForCPU, new RGB(200, 100, 0), 50)); builder.put("IDLE", new LinuxStyle(Messages.LinuxStyles_idle, new RGB(200, 200, 200), 66)); builder.put("USERMODE", new LinuxStyle(Messages.LinuxStyles_usermode, new RGB(0, 200, 0), 100)); builder.put("SYSCALL", new LinuxStyle(Messages.LinuxStyles_systemCall, new RGB(0, 0, 200), 100)); builder.put("INTERRUPTED", new LinuxStyle(Messages.LinuxStyles_Interrupt, new RGB(200, 0, 100), 75)); builder.put("IRQ", new LinuxStyle(Messages.LinuxStyles_Interrupt, new RGB(200, 0, 100), 75)); builder.put("IRQ_ACTIVE", new LinuxStyle(Messages.LinuxStyles_Interrupt, new RGB(200, 0, 100), 75)); builder.put("SOFT_IRQ_RAISED", new LinuxStyle(Messages.LinuxStyles_softIrqRaised, new RGB(200, 200, 0), 100)); builder.put("SOFT_IRQ", new LinuxStyle(Messages.LinuxStyles_softrq, new RGB(200, 150, 100), 100)); builder.put("SOFT_IRQ_ACTIVE", new LinuxStyle(Messages.LinuxStyles_softrq, new RGB(200, 150, 100), 100)); fRegistry = builder.build(); }
Source:
public void testCreateSchema_Label_CodeReview() throws Exception { LabelType codeReview = getLabelTypes().byLabel("Code-Review"); assertNotNull(codeReview); assertEquals("Code-Review", codeReview.getName()); assertEquals("R", codeReview.getAbbreviatedName()); assertEquals("MaxWithBlock", codeReview.getFunctionName()); assertTrue(codeReview.isCopyMinScore()); assertValueRange(codeReview, 2, 1, 0, -1, -2); }

Target:
public void testCreateSchema_Label_CodeReview() throws Exception { LabelType codeReview = getLabelTypes().byLabel("Code-Review"); assertNotNull(codeReview); assertEquals("Code-Review", codeReview.getName()); assertEquals("CR", codeReview.getAbbreviatedName()); assertEquals("MaxWithBlock", codeReview.getFunctionName()); assertTrue(codeReview.isCopyMinScore()); assertValueRange(codeReview, 2, 1, 0, -1, -2); }
Source:
default VoltDBPRel getInputNode(RelNode node, int childOrdinal) { RelNode inputNode = node.getInput(childOrdinal); if (inputNode != null) { if (inputNode instanceof RelSubset) { inputNode = ((RelSubset) inputNode).getBest(); assert (inputNode != null); } assert (inputNode instanceof VoltDBPRel); } return (VoltDBPRel) inputNode; }

Target:
default VoltDBPRel getInputNode(RelNode node, int childOrdinal) { RelNode inputNode = node.getInput(childOrdinal); if (inputNode != null) { if (inputNode instanceof RelSubset) { inputNode = ((RelSubset) inputNode).getBest(); Objects.requireNonNull(inputNode); } Preconditions.checkArgument(inputNode instanceof VoltDBPRel); } return (VoltDBPRel) inputNode; }
Source:
public void onInitialize(MatchingFrame frame, ISearchContext context) { Iterable<? extends Object> values = context.getRuntimeContext().enumerateValues(type, null); it = Iterables.filter(values, Object.class).iterator(); }

Target:
public void onInitialize(MatchingFrame frame, ISearchContext context) { Iterable<? extends Object> values = context.getRuntimeContext().enumerateValues(type, null); it = (Iterator<Object>) values.iterator(); }
Source:
public void testPANBroadcastSerialDataReceiveSubscribedRx64() throws Exception { Mockito.when(rx64Packet.getReceiveOptions()).thenReturn(RECEIVE_OPTIONS_BROADCAST_PAN); dataReader.addSerialDatatReceiveListener(receiveSerialDataListener); Whitebox.invokeMethod(dataReader, PACKET_RECEIVED_METHOD, rx64Packet); PowerMockito.verifyPrivate(dataReader, Mockito.times(1)).invoke(NOTIFY_SERIAL_DATA_RECEIVED_METHOD, XBEE_64BIT_ADDRESS.toString(), RECEIVED_DATA_BYTES, IS_BROADCAST_DATA); Mockito.verify(receiveSerialDataListener, Mockito.times(1)).broadcastSerialDataReceived(XBEE_64BIT_ADDRESS.toString(), RECEIVED_DATA_BYTES); assertEquals(XBEE_64BIT_ADDRESS.toString(), receiveSerialDataListener.getAddress()); assertArrayEquals(RECEIVED_DATA_BYTES, receiveSerialDataListener.getSerialData()); }

Target:
public void testPANBroadcastSerialDataReceiveSubscribedRx64() throws Exception { Mockito.when(rx64Packet.getReceiveOptions()).thenReturn(RECEIVE_OPTIONS_BROADCAST_PAN); dataReader.addSerialDatatReceiveListener(receiveSerialDataListener); Whitebox.invokeMethod(dataReader, PACKET_RECEIVED_METHOD, rx64Packet); PowerMockito.verifyPrivate(dataReader, Mockito.times(1)).invoke(NOTIFY_SERIAL_DATA_RECEIVED_METHOD, XBEE_64BIT_ADDRESS.toString(), RECEIVED_DATA_BYTES, IS_BROADCAST_DATA); Mockito.verify(receiveSerialDataListener, Mockito.times(1)).broadcastSerialDataReceived(XBEE_64BIT_ADDRESS.toString(), RECEIVED_DATA_BYTES); Mockito.verify(receiveSerialDataListener, Mockito.never()).serialDataReceived(Mockito.anyString(), (byte[])Mockito.any()); assertEquals(XBEE_64BIT_ADDRESS.toString(), receiveSerialDataListener.getAddress()); assertArrayEquals(RECEIVED_DATA_BYTES, receiveSerialDataListener.getSerialData()); }
Source:
public Integer getMaxLength() { if (maxLength == null && getDataType().isArrayType() && PDataType.arrayBaseType(getDataType()).getByteSize() == null) { Object value = getValue(); if (value instanceof PhoenixArray) { return ((PhoenixArray) value).getMaxLength(); } } return maxLength; }

Target:
public Integer getMaxLength() { if (maxLength == null && getDataType() != null && getDataType().isArrayType() && PDataType.arrayBaseType(getDataType()).getByteSize() == null) { Object value = getValue(); if (value instanceof PhoenixArray) { return ((PhoenixArray) value).getMaxLength(); } } return maxLength; }
Source:
protected Map<String, List<Object>> extractPersonAttributes(final X509Certificate certificate) { val attributes = new LinkedHashMap<String, List<Object>>(); if (certificate != null) { if (StringUtils.isNotBlank(certificate.getSigAlgOID())) { attributes.put("sigAlgOid", CollectionUtils.wrapList(certificate.getSigAlgOID())); } val subjectDn = certificate.getSubjectDN(); if (subjectDn != null) { attributes.put("subjectDn", CollectionUtils.wrapList(subjectDn.getName())); } val subjectPrincipal = certificate.getSubjectX500Principal(); if (subjectPrincipal != null) { attributes.put("subjectX500Principal", CollectionUtils.wrapList(subjectPrincipal.getName())); } try { val rfc822Email = getRFC822EmailAddress(certificate.getSubjectAlternativeNames()); if (rfc822Email != null) { attributes.put("x509Rfc822Email", CollectionUtils.wrapList(rfc822Email)); } } catch (final CertificateParsingException e) { LOGGER.warn("Error parsing subject alternative names to get rfc822 email [{}]", e.getMessage()); } try { val x509subjectUPN = X509UPNExtractor.extractUPNString(certificate); if (x509subjectUPN != null) { attributes.put("x509subjectUPN", CollectionUtils.wrapList(x509subjectUPN)); } } catch (final CertificateParsingException e) { LOGGER.warn("Error parsing subject alternative names to get User Principal Name as an attribute [{}]", e.getMessage()); } } return attributes; }

Target:
protected Map<String, List<Object>> extractPersonAttributes(final X509Certificate certificate) { val attributes = new LinkedHashMap<String, List<Object>>(); if (certificate != null) { if (StringUtils.isNotBlank(certificate.getSigAlgOID())) { attributes.put("sigAlgOid", CollectionUtils.wrapList(certificate.getSigAlgOID())); } val subjectDn = certificate.getSubjectDN(); if (subjectDn != null) { attributes.put("subjectDn", CollectionUtils.wrapList(subjectDn.getName())); } val subjectPrincipal = certificate.getSubjectX500Principal(); if (subjectPrincipal != null) { attributes.put("subjectX500Principal", CollectionUtils.wrapList(subjectPrincipal.getName())); } try { val rfc822Email = getRFC822EmailAddress(certificate.getSubjectAlternativeNames()); if (rfc822Email != null) { attributes.put("x509Rfc822Email", CollectionUtils.wrapList(rfc822Email)); } } catch (final CertificateParsingException e) { LOGGER.warn("Error parsing subject alternative names to get rfc822 email [{}]", e.getMessage(), LOGGER.isDebugEnabled() ? e : null); } try { val x509subjectUPN = X509UPNExtractorUtils.extractUPNString(certificate); if (x509subjectUPN != null) { attributes.put("x509subjectUPN", CollectionUtils.wrapList(x509subjectUPN)); } } catch (final CertificateParsingException e) { LOGGER.warn("Error parsing subject alternative names to get User Principal Name as an attribute [{}]", e.getMessage(), LOGGER.isDebugEnabled() ? e : null); } } return attributes; }
Source:
public DIR.ServiceSet.Builder getOSDs(DIR.ServiceSet.Builder allOSDs, InetAddress clientIP, GlobalTypes.VivaldiCoordinates clientCoords, XLocList currentXLoc, int numOSDs, String path) { List<DIR.Service> allServices = allOSDs.getServicesList(); List<DIR.Service> returnList = new LinkedList<DIR.Service>(); if (!this.prefixToOSDMap.isEmpty()) { int prefixLength = path.lastIndexOf("/"); String filePrefix = path.substring(0, prefixLength); for (String prefix : this.prefixToOSDMap.keySet()) { if (prefix.endsWith(filePrefix) || filePrefix.endsWith(prefix)) { for (DIR.Service osd : allServices) { String currentUUID = new ServiceUUID(osd.getUuid()).toString(); if (currentUUID.equals(this.prefixToOSDMap.get(prefix))) { returnList.add(osd); break; } } break; } } } if (returnList.isEmpty()) { returnList.addAll(allServices); } return DIR.ServiceSet.newBuilder().addAllServices(returnList); }

Target:
public DIR.ServiceSet.Builder getOSDs(DIR.ServiceSet.Builder allOSDs, InetAddress clientIP, GlobalTypes.VivaldiCoordinates clientCoords, XLocList currentXLoc, int numOSDs, String path) { if (path == null) { return allOSDs; } List<DIR.Service> allServices = allOSDs.getServicesList(); List<DIR.Service> returnList = new LinkedList<DIR.Service>(); if (!this.prefixToOSDMap.isEmpty()) { int locationLength = path.lastIndexOf("/"); String fileLocationOnVolume = path.substring(0, locationLength); for (String prefix : this.prefixToOSDMap.keySet()) { if (fileLocationOnVolume.startsWith(prefix)) { for (DIR.Service osd : allServices) { String currentUUID = new ServiceUUID(osd.getUuid()).toString(); if (currentUUID.equals(this.prefixToOSDMap.get (prefix))) { returnList.add(osd); break; } } break; } } } if (returnList.isEmpty()) { returnList.addAll(allServices); } return DIR.ServiceSet.newBuilder().addAllServices(returnList); }
Source:
public String toString() { return String.format("%30s: %s", this.getClass().getSimpleName(), getStatus()); }

Target:
public String toString() { return String.format("%30s", this.getClass().getSimpleName()); }
Source:
public void await() { try { latch.await(); } catch (InterruptedException ex) { limitListener.onIgnore(); throw new ThrottleException(ex); } }

Target:
void await() { try { latch.await(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); limitListener.onIgnore(); throw new RuntimeException("Interrupted while blocking on a throttled call", e); } }
Source:
public void generateImages(EmptyTask executingThread, Task task, boolean automatic) throws DataException { Process process = task.getProcess(); ImageGenerator generator = new ImageGenerator(new Subfolder(process, process.getProject().getGeneratorSource()), GenerationMode.ALL, SubfolderFactoryService.createAll(process, task.getContentFolders())); generator.setSupervisor(executingThread); if (automatic) { if (executingThread.getException() == null) { task.setEditType(TaskEditType.AUTOMATIC.getValue()); task.setProcessingStatus(TaskStatus.DONE.getValue()); } else { task.setEditType(TaskEditType.AUTOMATIC.getValue()); task.setProcessingStatus(TaskStatus.OPEN.getValue()); save(task); } } }

Target:
public void generateImages(EmptyTask executingThread, Task task, boolean automatic) throws DataException { try { Process process = task.getProcess(); Subfolder sourceFolder = new Subfolder(process, process.getProject().getGeneratorSource()); List<Subfolder> foldersToGenerate = SubfolderFactoryService.createAll(process, task.getContentFolders()); ImageGenerator generator = new ImageGenerator(sourceFolder, GenerationMode.ALL, foldersToGenerate); generator.setSupervisor(executingThread); generator.run(); finishOrReturnAutomaticTask(task, automatic, executingThread.getException() == null); } catch (IOException e) { Helper.setErrorMessage(e.getLocalizedMessage(), logger, e); } }
Source:
public int compareTo( PointValue other ) { int cmpCRS = this.crs.code - other.crs.code; if ( cmpCRS != 0 ) { return cmpCRS; } if ( this.coordinate.length > other.coordinate.length ) { return 1; } else if ( this.coordinate.length < other.coordinate.length ) { return -1; } for ( int i = 0; i < coordinate.length; i++ ) { int cmpVal = (int) (this.coordinate[i] - other.coordinate[i]); if ( cmpVal != 0 ) { return cmpVal; } } return 0; }

Target:
public int compareTo( PointValue other ) { int cmpCRS = this.crs.getCode() - other.crs.getCode(); if ( cmpCRS != 0 ) { return cmpCRS; } if ( this.coordinate.length > other.coordinate.length ) { return 1; } else if ( this.coordinate.length < other.coordinate.length ) { return -1; } for ( int i = 0; i < coordinate.length; i++ ) { int cmpVal = (int) (this.coordinate[i] - other.coordinate[i]); if ( cmpVal != 0 ) { return cmpVal; } } return 0; }
Source:
private EhcacheEntityResponse invokeInternal(TimeoutDuration timeLimit, EhcacheEntityMessage message, boolean replicate) throws ClusteredEhcacheException, TimeoutException { try { EhcacheEntityResponse response = waitFor(timeLimit, invokeAsync(message, replicate)); if (Type.FAILURE.equals(response.getType())) { throw ((Failure)response).getCause().withClientStackTrace(); } else { return response; } } catch (EntityException e) { throw new RuntimeException(message + " error: " + e.toString(), e); } catch (MessageCodecException e) { throw new RuntimeException(message + " error: " + e.toString(), e); } catch (TimeoutException e) { String msg = "Timeout exceeded for " + getMessageOp(message) + " message; " + timeLimit; TimeoutException timeoutException = new TimeoutException(msg); timeoutException.initCause(e); LOGGER.info(msg, timeoutException); throw timeoutException; } }

Target:
private EhcacheEntityResponse invokeInternal(TimeoutDuration timeLimit, EhcacheEntityMessage message, boolean replicate) throws ClusterException, TimeoutException { try { EhcacheEntityResponse response = waitFor(timeLimit, invokeAsync(message, replicate)); if (Type.FAILURE.equals(response.getType())) { throw ((Failure)response).getCause(); } else { return response; } } catch (EntityException e) { throw new RuntimeException(message + " error: " + e.toString(), e); } catch (MessageCodecException e) { throw new RuntimeException(message + " error: " + e.toString(), e); } catch (TimeoutException e) { String msg = "Timeout exceeded for " + getMessageOp(message) + " message; " + timeLimit; TimeoutException timeoutException = new TimeoutException(msg); timeoutException.initCause(e); LOGGER.info(msg, timeoutException); throw timeoutException; } }
Source:
public void doHead(SlingHttpServletRequest request, SlingHttpServletResponse response) { try{ ResourceResolver resourceResolver = request.getResourceResolver(); String requestUri = request.getParameter( "uri" ); log.debug( "Checking access for URI {}", requestUri ); Resource requestedResource = resourceResolver.resolve( request, requestUri ); if( !ResourceUtil.isNonExistingResource( requestedResource ) ){ log.info("Current Session has access to {}", requestUri ); response.setStatus(SlingHttpServletResponse.SC_OK); } else { log.info("Current Session does not have access to {}", requestUri ); response.setStatus(SlingHttpServletResponse.SC_UNAUTHORIZED); } } catch(Exception e) { log.error("authchecker servlet exception: " + e.getMessage()); response.setStatus( SlingHttpServletResponse.SC_UNAUTHORIZED ); } }

Target:
public void doHead(SlingHttpServletRequest request, SlingHttpServletResponse response) { try{ ResourceResolver resourceResolver = request.getResourceResolver(); String requestUri = request.getParameter( "uri" ); log.debug( "Checking access for URI {}", requestUri ); if( isUriValid( requestUri ) ){ Resource requestedResource = resourceResolver.resolve( request, requestUri ); if( !ResourceUtil.isNonExistingResource( requestedResource ) ){ log.debug("Current Session has access to {}", requestUri ); response.setStatus(SlingHttpServletResponse.SC_OK); } else { log.info("Current Session does not have access to {}", requestUri ); response.setStatus(SlingHttpServletResponse.SC_UNAUTHORIZED); } } else { log.debug( "Invalid URI {}", requestUri ); response.setStatus( SlingHttpServletResponse.SC_UNAUTHORIZED ); } } catch(Exception e) { log.error("Authchecker servlet exception", e); response.setStatus( SlingHttpServletResponse.SC_UNAUTHORIZED ); } }
Source:
public Future<Long> readInto(AsyncWritableChannel asyncWritableChannel, Callback<Long> callback) { if (callbackWrapper != null) { throw new IllegalStateException("ReadableStreamChannel cannot be read more than once"); } else if (isOpen() && !readyForRead) { throw new IllegalStateException("The channel cannot be read yet"); } callbackWrapper = new ReadIntoCallbackWrapper(callback); if (!isOpen()) { nettyMetrics.multipartRequestAlreadyClosedError.inc(); callbackWrapper.invokeCallback(new ClosedChannelException()); } while (requestContents.peek() != null) { writeContent(asyncWritableChannel, callbackWrapper, requestContents.peek()); ReferenceCountUtil.release(requestContents.poll()); } return callbackWrapper.futureResult; }

Target:
public Future<Long> readInto(AsyncWritableChannel asyncWritableChannel, Callback<Long> callback) { if (callbackWrapper != null) { throw new IllegalStateException("ReadableStreamChannel cannot be read more than once"); } else if (!readyForRead) { throw new IllegalStateException("The channel cannot be read yet"); } callbackWrapper = new ReadIntoCallbackWrapper(callback); if (!isOpen()) { nettyMetrics.multipartRequestAlreadyClosedError.inc(); callbackWrapper.invokeCallback(new ClosedChannelException()); } HttpContent content = requestContents.poll(); while (content != null) { try { writeContent(asyncWritableChannel, callbackWrapper, content); } finally { ReferenceCountUtil.release(content); } content = requestContents.poll(); } return callbackWrapper.futureResult; }
Source:
public <T> T getValue(ConfigValues name, String version) { T returnValue; Map<String, Object> values = null; if ((values = _vdcOptionCache.get(name.toString())) != null && (values.containsKey(version))) { returnValue = (T) values.get(version); } else { VdcOption option = new VdcOption(); option.setoption_name(name.toString()); option.setoption_value(null); returnValue = (T) getValue(option); if (values != null) { values.put(version, returnValue); } else { Map<String, Object> defaultValues = new HashMap<String, Object>(); defaultValues.put(version, returnValue); _vdcOptionCache.put(option.getoption_name(), defaultValues); log.debug("Adding new value to configuration cache."); } log.debugFormat("Didn't find the value of {0} in DB for version {1} - using default: {2}", name, version, returnValue); } return returnValue; }

Target:
public <T> T getValue(ConfigValues name, String version) { T returnValue; Map<String, Object> values = null; if ((values = _vdcOptionCache.get(name.toString())) != null && values.containsKey(version)) { returnValue = (T) values.get(version); } else { VdcOption option = new VdcOption(); option.setoption_name(name.toString()); option.setoption_value(null); returnValue = (T) getValue(option); if (values != null) { values.put(version, returnValue); } else { Map<String, Object> defaultValues = new HashMap<String, Object>(); defaultValues.put(version, returnValue); _vdcOptionCache.put(option.getoption_name(), defaultValues); log.debug("Adding new value to configuration cache."); } log.debugFormat("Didn't find the value of {0} in DB for version {1} - using default: {2}", name, version, returnValue); } return returnValue; }