idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
1,624,382
public boolean canPartition(int[] nums) {<NEW_LINE>int sum = 0;<NEW_LINE>for (int num : nums) {<NEW_LINE>sum += num;<NEW_LINE>}<NEW_LINE>if (sum % 2 != 0)<NEW_LINE>return false;<NEW_LINE>int target = sum / 2;<NEW_LINE>boolean[][] dp = new boolean[nums.length + 1][target + 1];<NEW_LINE>int n = nums.length;<NEW_LINE>for (int i = 0; i <= n; i++) {<NEW_LINE>for (int j = 0; j <= target; j++) {<NEW_LINE>if (i == 0 || j == 0) {<NEW_LINE>if (i == 0)<NEW_LINE>dp[i][j] = false;<NEW_LINE>else if (j == 0)<NEW_LINE>dp[i][j] = true;<NEW_LINE>} else if (j >= nums[i - 1]) {<NEW_LINE>dp[i][j] = dp[i - 1][j] || dp[i - 1][j <MASK><NEW_LINE>} else {<NEW_LINE>dp[i][j] = dp[i - 1][j];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return dp[n][target];<NEW_LINE>}
- nums[i - 1]];
1,569,313
// rb_execarg_init<NEW_LINE>private static RubyString execargInit(ThreadContext context, IRubyObject[] argv, boolean accept_shell, ExecArg eargp, boolean allow_exc_opt) {<NEW_LINE>RubyString prog, ret;<NEW_LINE>IRubyObject[] env_opt = { context.nil, context.nil };<NEW_LINE>IRubyObject[][] argv_p = { argv };<NEW_LINE>IRubyObject exception = context.nil;<NEW_LINE>prog = execGetargs(context, argv_p, accept_shell, env_opt);<NEW_LINE>IRubyObject opt = env_opt[1];<NEW_LINE>RubyHash optHash;<NEW_LINE>RubySymbol exceptionSym = context.runtime.newSymbol("exception");<NEW_LINE>if (allow_exc_opt && !opt.isNil() && (optHash = ((RubyHash) opt)).has_key_p(context, exceptionSym).isTrue()) {<NEW_LINE>optHash = optHash.dupFast(context);<NEW_LINE>exception = optHash.delete(context, exceptionSym);<NEW_LINE>}<NEW_LINE>execFillarg(context, prog, argv_p[0], env_opt[0], env_opt[1], eargp);<NEW_LINE>if (exception.isTrue()) {<NEW_LINE>eargp.exception = true;<NEW_LINE>}<NEW_LINE>ret = eargp.use_shell <MASK><NEW_LINE>return ret;<NEW_LINE>}
? eargp.command_name : eargp.command_name;
1,714,608
public ListImagePipelinesResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListImagePipelinesResult listImagePipelinesResult = new ListImagePipelinesResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return listImagePipelinesResult;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("requestId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listImagePipelinesResult.setRequestId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("imagePipelineList", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listImagePipelinesResult.setImagePipelineList(new ListUnmarshaller<ImagePipeline>(ImagePipelineJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("nextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listImagePipelinesResult.setNextToken(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return listImagePipelinesResult;<NEW_LINE>}
JsonToken token = context.getCurrentToken();
457,683
public List<ValidateError> validate() {<NEW_LINE>List<ValidateError> errors = new ArrayList<>();<NEW_LINE>Validator validator;<NEW_LINE>ValidateError error;<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.REQUIRED);<NEW_LINE>error = validator.validate(this.stockName, convLabelName("Stock Name"));<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.MAX_LENGTH);<NEW_LINE>error = validator.validate(this.stockName, convLabelName("Stock Name"), 256);<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.REQUIRED);<NEW_LINE>error = validator.validate(this<MASK><NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.INTEGER);<NEW_LINE>error = validator.validate(this.stockType, convLabelName("Stock Type"));<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.MAX_LENGTH);<NEW_LINE>error = validator.validate(this.description, convLabelName("Description"), 1024);<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.INTEGER);<NEW_LINE>error = validator.validate(this.insertUser, convLabelName("Insert User"));<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.INTEGER);<NEW_LINE>error = validator.validate(this.updateUser, convLabelName("Update User"));<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.INTEGER);<NEW_LINE>error = validator.validate(this.deleteFlag, convLabelName("Delete Flag"));<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>return errors;<NEW_LINE>}
.stockType, convLabelName("Stock Type"));
1,654,171
private okhttp3.Call deleteClusterCustomObjectValidateBeforeCall(String group, String version, String plural, String name, Integer gracePeriodSeconds, Boolean orphanDependents, String propagationPolicy, String dryRun, V1DeleteOptions body, final ApiCallback _callback) throws ApiException {<NEW_LINE>// verify the required parameter 'group' is set<NEW_LINE>if (group == null) {<NEW_LINE>throw new ApiException("Missing the required parameter 'group' when calling deleteClusterCustomObject(Async)");<NEW_LINE>}<NEW_LINE>// verify the required parameter 'version' is set<NEW_LINE>if (version == null) {<NEW_LINE>throw new ApiException("Missing the required parameter 'version' when calling deleteClusterCustomObject(Async)");<NEW_LINE>}<NEW_LINE>// verify the required parameter 'plural' is set<NEW_LINE>if (plural == null) {<NEW_LINE>throw new ApiException("Missing the required parameter 'plural' when calling deleteClusterCustomObject(Async)");<NEW_LINE>}<NEW_LINE>// verify the required parameter 'name' is set<NEW_LINE>if (name == null) {<NEW_LINE>throw new ApiException("Missing the required parameter 'name' when calling deleteClusterCustomObject(Async)");<NEW_LINE>}<NEW_LINE>okhttp3.Call localVarCall = deleteClusterCustomObjectCall(group, version, plural, name, gracePeriodSeconds, orphanDependents, <MASK><NEW_LINE>return localVarCall;<NEW_LINE>}
propagationPolicy, dryRun, body, _callback);
1,799,310
void sendDeployEvents(DeployBean oldDeployBean, DeployBean newDeployBean, EnvironBean environBean) {<NEW_LINE>DeployState newState = newDeployBean.getState();<NEW_LINE>DeployState oldState = oldDeployBean.getState();<NEW_LINE>if (newState == oldState) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (newState == DeployState.SUCCEEDING && oldDeployBean.getSuc_date() == null) {<NEW_LINE>try {<NEW_LINE>String build_id = oldDeployBean.getBuild_id();<NEW_LINE>BuildBean buildBean = buildDAO.getById(build_id);<NEW_LINE><MASK><NEW_LINE>String envName = environBean.getEnv_name();<NEW_LINE>String stageName = environBean.getStage_name();<NEW_LINE>String what = String.format("%s/%s deploy initiated.", envName, stageName);<NEW_LINE>String tags = String.format("%s/%s", envName, stageName);<NEW_LINE>sender.sendDeployEvent(what, tags, commit);<NEW_LINE>LOG.info("Successfully sent deploy events to graphite server. what: {}, commit: {}", what, commit);<NEW_LINE>} catch (Exception ex) {<NEW_LINE>LOG.error("Failed to send deploy events.", ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
String commit = buildBean.getScm_commit_7();
1,595,677
private void loadLessThan16IntoXMMOrdered(CompilationResultBuilder crb, AMD64MacroAssembler asm, Register arr, Register lengthTail, Register tmp, Register vecArray, Register vecTmp1, Register vecTmp2) {<NEW_LINE>// array is between 8 and 15 bytes long, load it into a YMM register via two QWORD loads<NEW_LINE>asm.movdq(vecArray, new AMD64Address(arr));<NEW_LINE>asm.movdq(vecTmp1, new AMD64Address(arr, <MASK><NEW_LINE>asm.leaq(tmp, getMaskOnce(crb, createXMMTailShuffleMask(8), XMM.getBytes() * 2));<NEW_LINE>asm.negq(lengthTail);<NEW_LINE>movdqu(asm, XMM, vecTmp2, new AMD64Address(tmp, lengthTail, scale, XMM.getBytes()));<NEW_LINE>pshufb(asm, XMM, vecTmp1, vecTmp2);<NEW_LINE>movlhps(asm, vecArray, vecTmp1);<NEW_LINE>}
lengthTail, scale, -8));
493,822
private static void initInputModes() {<NEW_LINE>if (inputModes == null) {<NEW_LINE>firstUppercaseInputMode.addElement("Abc");<NEW_LINE>inputModes = new Hashtable();<NEW_LINE>Hashtable upcase = new Hashtable();<NEW_LINE>int dlen = DEFAULT_KEY_CODES.length;<NEW_LINE>for (int iter = 0; iter < dlen; iter++) {<NEW_LINE>upcase.put(new Integer('0' + iter), DEFAULT_KEY_CODES[iter]);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>Hashtable lowcase = new Hashtable();<NEW_LINE>for (int iter = 0; iter < dlen; iter++) {<NEW_LINE>lowcase.put(new Integer('0' + iter), DEFAULT_KEY_CODES[iter].toLowerCase());<NEW_LINE>}<NEW_LINE>inputModes.put("abc", lowcase);<NEW_LINE>Hashtable numbers = new Hashtable();<NEW_LINE>for (int iter = 0; iter < 10; iter++) {<NEW_LINE>numbers.put(new Integer('0' + iter), "" + iter);<NEW_LINE>}<NEW_LINE>inputModes.put("123", numbers);<NEW_LINE>}<NEW_LINE>}
inputModes.put("ABC", upcase);
1,565,425
public okhttp3.Call apiCategoriesApiCategoryIdDeleteCall(String apiCategoryId, String ifMatch, String ifUnmodifiedSince, final ApiCallback _callback) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/api-categories/{apiCategoryId}".replaceAll("\\{" + "apiCategoryId" + "\\}", localVarApiClient.escapeString(apiCategoryId.toString()));<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>if (ifMatch != null) {<NEW_LINE>localVarHeaderParams.put("If-Match", localVarApiClient.parameterToString(ifMatch));<NEW_LINE>}<NEW_LINE>if (ifUnmodifiedSince != null) {<NEW_LINE>localVarHeaderParams.put("If-Unmodified-Since", localVarApiClient.parameterToString(ifUnmodifiedSince));<NEW_LINE>}<NEW_LINE>Map<String, String> localVarCookieParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new <MASK><NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null) {<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>}<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>String[] localVarAuthNames = new String[] { "OAuth2Security" };<NEW_LINE>return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);<NEW_LINE>}
HashMap<String, Object>();
1,203,838
public void onShowCustomView(final View view, final CustomViewCallback callback) {<NEW_LINE>if (view instanceof FrameLayout) {<NEW_LINE>// A video wants to be shown<NEW_LINE>final FrameLayout frameLayout = (FrameLayout) view;<NEW_LINE>final <MASK><NEW_LINE>// Save video related variables<NEW_LINE>this.isVideoFullscreen = true;<NEW_LINE>this.videoViewContainer = frameLayout;<NEW_LINE>this.videoViewCallback = callback;<NEW_LINE>// Hide the non-video view, add the video view, and show it<NEW_LINE>activityNonVideoView.setVisibility(View.INVISIBLE);<NEW_LINE>activityVideoView.addView(videoViewContainer, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));<NEW_LINE>activityVideoView.setVisibility(View.VISIBLE);<NEW_LINE>if (focusedChild instanceof android.widget.VideoView) {<NEW_LINE>// android.widget.VideoView (typically API level <11)<NEW_LINE>final android.widget.VideoView videoView = (android.widget.VideoView) focusedChild;<NEW_LINE>// Handle all the required events<NEW_LINE>videoView.setOnPreparedListener(this);<NEW_LINE>videoView.setOnCompletionListener(this);<NEW_LINE>videoView.setOnErrorListener(this);<NEW_LINE>} else {<NEW_LINE>// Other classes, including:<NEW_LINE>// - android.webkit.HTML5VideoFullScreen$VideoSurfaceView, which inherits<NEW_LINE>// from android.view.SurfaceView (typically API level 11-18)<NEW_LINE>// - android.webkit.HTML5VideoFullScreen$VideoTextureView, which inherits<NEW_LINE>// from android.view.TextureView (typically API level 11-18)<NEW_LINE>// - com.android.org.chromium.content.browser.ContentVideoView$VideoSurfaceView,<NEW_LINE>// which inherits from android.view.SurfaceView (typically API level 19+)<NEW_LINE>// Handle HTML5 video ended event only if the class is a SurfaceView<NEW_LINE>// Test case: TextureView of Sony Xperia T API level 16 doesn't work fullscreen<NEW_LINE>// when loading the javascript below<NEW_LINE>if (webView != null && webView.getSettings().getJavaScriptEnabled() && focusedChild instanceof SurfaceView) {<NEW_LINE>// Run javascript code that detects the video end and notifies the<NEW_LINE>// Javascript interface<NEW_LINE>String js = "javascript:";<NEW_LINE>js += "var _ytrp_html5_video_last;";<NEW_LINE>js += "var _ytrp_html5_video = document.getElementsByTagName('video')[0];";<NEW_LINE>js += "if (_ytrp_html5_video != undefined && _ytrp_html5_video " + "!= _ytrp_html5_video_last) {";<NEW_LINE>{<NEW_LINE>js += "_ytrp_html5_video_last = _ytrp_html5_video;";<NEW_LINE>js += "function _ytrp_html5_video_ended() {";<NEW_LINE>{<NEW_LINE>// Must match Javascript interface name and method of VideoEnableWebView<NEW_LINE>js += "_WebViewFixed.notifyVideoEnd();";<NEW_LINE>}<NEW_LINE>js += "}";<NEW_LINE>js += "_ytrp_html5_video.addEventListener(" + "'ended', _ytrp_html5_video_ended);";<NEW_LINE>}<NEW_LINE>js += "}";<NEW_LINE>webView.loadUrl(js);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Notify full-screen change<NEW_LINE>if (toggledFullscreenCallback != null) {<NEW_LINE>toggledFullscreenCallback.toggledFullscreen(true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
View focusedChild = frameLayout.getFocusedChild();
700,527
public synchronized void initRef() {<NEW_LINE>if (initialized.get()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>interfaceClass = (Class) Class.forName(interfaceClass.getName(), true, Thread.currentThread().getContextClassLoader());<NEW_LINE>} catch (ClassNotFoundException e) {<NEW_LINE>throw new MotanFrameworkException("ReferereConfig initRef Error: Class not found " + interfaceClass.getName(), e, MotanErrorMsgConstant.FRAMEWORK_INIT_ERROR);<NEW_LINE>}<NEW_LINE>if (CollectionUtil.isEmpty(protocols)) {<NEW_LINE>throw new MotanFrameworkException(String.format("%s RefererConfig is malformed, for protocol not set correctly!", interfaceClass.getName()));<NEW_LINE>}<NEW_LINE>checkInterfaceAndMethods(interfaceClass, methods);<NEW_LINE>clusterSupports = new ArrayList<>(protocols.size());<NEW_LINE>List<Cluster<T>> clusters = new ArrayList<>(protocols.size());<NEW_LINE>String proxy = null;<NEW_LINE>ConfigHandler configHandler = ExtensionLoader.getExtensionLoader(ConfigHandler.class).getExtension(MotanConstants.DEFAULT_VALUE);<NEW_LINE>loadRegistryUrls();<NEW_LINE>String localIp = getLocalHostAddress();<NEW_LINE>for (ProtocolConfig protocol : protocols) {<NEW_LINE>Map<String, String> params = new HashMap<>();<NEW_LINE>params.put(URLParamType.nodeType.getName(), MotanConstants.NODE_TYPE_REFERER);<NEW_LINE>params.put(URLParamType.version.getName(), URLParamType.version.getValue());<NEW_LINE>params.put(URLParamType.refreshTimestamp.getName(), String.valueOf(System.currentTimeMillis()));<NEW_LINE>collectConfigParams(params, <MASK><NEW_LINE>collectMethodConfigParams(params, this.getMethods());<NEW_LINE>String path = StringUtils.isBlank(serviceInterface) ? interfaceClass.getName() : serviceInterface;<NEW_LINE>URL refUrl = new URL(protocol.getName(), localIp, MotanConstants.DEFAULT_INT_VALUE, path, params);<NEW_LINE>ClusterSupport<T> clusterSupport = createClusterSupport(refUrl, configHandler);<NEW_LINE>clusterSupports.add(clusterSupport);<NEW_LINE>clusters.add(clusterSupport.getCluster());<NEW_LINE>if (proxy == null) {<NEW_LINE>String defaultValue = StringUtils.isBlank(serviceInterface) ? URLParamType.proxy.getValue() : MotanConstants.PROXY_COMMON;<NEW_LINE>proxy = refUrl.getParameter(URLParamType.proxy.getName(), defaultValue);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ref = configHandler.refer(interfaceClass, clusters, proxy);<NEW_LINE>initialized.set(true);<NEW_LINE>}
protocol, basicReferer, extConfig, this);
1,560,713
protected String generateSyntaxIncorrectAST() {<NEW_LINE>// create some dummy source to generate an ast node<NEW_LINE>StringBuffer buff = new StringBuffer();<NEW_LINE>IType type = getType();<NEW_LINE>String lineSeparator = org.eclipse.jdt.internal.core.util.Util.getLineSeparator(this.source, type == null ? null : type.getJavaProject());<NEW_LINE>// $NON-NLS-1$<NEW_LINE>buff.append(lineSeparator + " public class A {" + lineSeparator);<NEW_LINE>buff.append(this.source);<NEW_LINE>buff.append(lineSeparator).append('}');<NEW_LINE>ASTParser parser = ASTParser.newParser(getLatestASTLevel());<NEW_LINE>parser.setSource(buff.toString().toCharArray());<NEW_LINE>CompilationUnit compilationUnit = (CompilationUnit) parser.createAST(null);<NEW_LINE>TypeDeclaration typeDeclaration = (TypeDeclaration) compilationUnit.types().iterator().next();<NEW_LINE><MASK><NEW_LINE>if (bodyDeclarations.size() != 0)<NEW_LINE>this.createdNode = (ASTNode) bodyDeclarations.iterator().next();<NEW_LINE>return buff.toString();<NEW_LINE>}
List bodyDeclarations = typeDeclaration.bodyDeclarations();
394,512
public Plot scrapePlot() {<NEW_LINE>Element plotElement = document.select("div.gen12 p:contains(Story:)").first();<NEW_LINE>if (plotElement != null)<NEW_LINE>return new Plot(plotElement.ownText());<NEW_LINE>else // maybe if this is a scene, there is a link to the full movie where we can grab the plot from there<NEW_LINE>{<NEW_LINE>Element relatedMovieTextElement = document.select("div p:containsOwn(Related Movie:)").first();<NEW_LINE>// the actual related movie is the text's parent's previous element, if it is there<NEW_LINE>if (relatedMovieTextElement != null && relatedMovieTextElement.parent() != null && relatedMovieTextElement.parent().previousElementSibling() != null) {<NEW_LINE>Element relatedMovieElement = relatedMovieTextElement.parent().previousElementSibling().<MASK><NEW_LINE>if (relatedMovieElement != null) {<NEW_LINE>// Using the full movie's plot since this is a single scene and it does not have its own plot<NEW_LINE>String urlOfMovie = relatedMovieElement.attr("href");<NEW_LINE>if (urlOfMovie != null && urlOfMovie.length() > 0) {<NEW_LINE>Data18MovieParsingProfile parser = new Data18MovieParsingProfile();<NEW_LINE>parser.setOverridenSearchResult(urlOfMovie);<NEW_LINE>try {<NEW_LINE>Document doc = Jsoup.connect(urlOfMovie).userAgent(getRandomUserAgent()).referrer("http://www.google.com").ignoreHttpErrors(true).timeout(SiteParsingProfile.CONNECTION_TIMEOUT_VALUE).get();<NEW_LINE>parser.setDocument(doc);<NEW_LINE>Plot data18FullMoviePlot = parser.scrapePlot();<NEW_LINE>System.out.println("Using full movie's plot instead of scene's plot (which wasn't found): " + data18FullMoviePlot.getPlot());<NEW_LINE>return data18FullMoviePlot;<NEW_LINE>} catch (IOException e) {<NEW_LINE>return Plot.BLANK_PLOT;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Plot.BLANK_PLOT;<NEW_LINE>}
select("a[href*=/movies/]").first();
949,636
public boolean apply(Game game, Ability source) {<NEW_LINE>Player player = game.getPlayer(source.getControllerId());<NEW_LINE>MageObject sourceOject = source.getSourceObject(game);<NEW_LINE>if (player != null && sourceOject != null) {<NEW_LINE>Cards cards = new CardsImpl(player.getLibrary().getTopCards(game, 3));<NEW_LINE>if (!cards.isEmpty()) {<NEW_LINE>Cards cardsToHand = new CardsImpl();<NEW_LINE>player.lookAtCards(sourceOject.getIdName(), cards, game);<NEW_LINE>TargetCard target = new TargetCard(Math.min(2, cards.size()), Zone.LIBRARY, new FilterCard("two cards to put in your hand"));<NEW_LINE>if (player.choose(Outcome.DrawCard, cards, target, game)) {<NEW_LINE>for (UUID targetId : target.getTargets()) {<NEW_LINE>Card card = cards.get(targetId, game);<NEW_LINE>if (card != null) {<NEW_LINE>cardsToHand.add(card);<NEW_LINE>cards.remove(card);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>player.moveCards(cardsToHand, <MASK><NEW_LINE>player.moveCards(cards, Zone.GRAVEYARD, source, game);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
Zone.HAND, source, game);
163,571
public static void renderWires(TilePipeHolder pipe, double x, double y, double z, BufferBuilder bb) {<NEW_LINE>int combinedLight = pipe.getWorld().getCombinedLight(pipe.getPipePos(), 0);<NEW_LINE>int skyLight = combinedLight >> 16 & 0xFFFF;<NEW_LINE>int blockLight = combinedLight & 0xFFFF;<NEW_LINE>RenderHelper.disableStandardItemLighting();<NEW_LINE>GlStateManager.pushMatrix();<NEW_LINE>GlStateManager.translate(x, y, z);<NEW_LINE>for (Map.Entry<EnumWirePart, EnumDyeColor> partColor : pipe.getWireManager().parts.entrySet()) {<NEW_LINE>EnumWirePart part = partColor.getKey();<NEW_LINE>EnumDyeColor color = partColor.getValue();<NEW_LINE>boolean isOn = pipe.wireManager.isPowered(part);<NEW_LINE>int idx = getIndex(part, color, isOn);<NEW_LINE>if (wireRenderingCache[idx] == -1) {<NEW_LINE>wireRenderingCache[idx] = compileWire(part, color, isOn);<NEW_LINE>}<NEW_LINE>OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, isOn ? 240 : blockLight, skyLight);<NEW_LINE>GlStateManager.callList(wireRenderingCache[idx]);<NEW_LINE>}<NEW_LINE>for (Map.Entry<EnumWireBetween, EnumDyeColor> betweenColor : pipe.getWireManager().betweens.entrySet()) {<NEW_LINE><MASK><NEW_LINE>EnumDyeColor color = betweenColor.getValue();<NEW_LINE>boolean isOn = pipe.wireManager.isPowered(between.parts[0]);<NEW_LINE>int idx = getIndex(between, color, isOn);<NEW_LINE>if (wireRenderingCache[idx] == -1) {<NEW_LINE>wireRenderingCache[idx] = compileWire(between, color, isOn);<NEW_LINE>}<NEW_LINE>OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, isOn ? 240 : blockLight, skyLight);<NEW_LINE>GlStateManager.callList(wireRenderingCache[idx]);<NEW_LINE>}<NEW_LINE>GlStateManager.popMatrix();<NEW_LINE>GlStateManager.enableLighting();<NEW_LINE>GL11.glColor3f(1, 1, 1);<NEW_LINE>GlStateManager.color(1, 1, 1, 1);<NEW_LINE>}
EnumWireBetween between = betweenColor.getKey();
366,064
@Consumes(MediaType.APPLICATION_JSON)<NEW_LINE>@ApiOperation(value = "Deletes a group", code = 204)<NEW_LINE>@ApiResponses(value = { @ApiResponse(code = 401, message = "Unauthorized"), @ApiResponse(code = 404, message = "The group could not be found") })<NEW_LINE>@PermissionRequired(Permissions.Constants.ACCESS_MANAGEMENT)<NEW_LINE>public Response deleteGroup(@ApiParam(value = "The UUID of the group to delete", required = true) @PathParam("uuid") final String uuid) {<NEW_LINE>try (QueryManager qm = new QueryManager()) {<NEW_LINE>final OidcGroup group = qm.getObjectByUuid(OidcGroup.class, uuid);<NEW_LINE>if (group != null) {<NEW_LINE>qm.delete(qm.getMappedOidcGroups(group));<NEW_LINE>qm.delete(group);<NEW_LINE>super.logSecurityEvent(LOGGER, SecurityMarkers.SECURITY_AUDIT, "Group deleted: " + group.getName());<NEW_LINE>return Response.status(Response.<MASK><NEW_LINE>} else {<NEW_LINE>return Response.status(Response.Status.NOT_FOUND).entity("An OpenID Connect group with the specified UUID could not be found.").build();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
Status.NO_CONTENT).build();
1,565,240
public void run() {<NEW_LINE>if (isActive) {<NEW_LINE>setActive();<NEW_LINE>} else {<NEW_LINE>setInactive();<NEW_LINE>}<NEW_LINE>long now = TimeUtil.getCurrentTime(serverId);<NEW_LINE>xyGraph.primaryXAxis.setRange(now - DateUtil.MILLIS_PER_MINUTE * 5, now + 1);<NEW_LINE>double maxv = 0;<NEW_LINE>if (value.size() > 0) {<NEW_LINE>Value v = value.pop();<NEW_LINE>if (v instanceof ListValue) {<NEW_LINE>ListValue list = (ListValue) v;<NEW_LINE>for (int j = 0, max = list.size(); j < max; j++) {<NEW_LINE>getDataProvider("data-" + j).addSample(new Sample(now, list.getDouble(j)));<NEW_LINE>maxv = Math.max(ChartUtil.getMax(getDataProvider("data-" + j).iterator()), maxv);<NEW_LINE>}<NEW_LINE>} else if (v.getValueType() != ValueEnum.NULL) {<NEW_LINE>getDataProvider("data").addSample(new Sample(now, CastUtil.cdouble(v)));<NEW_LINE>maxv = ChartUtil.getMax(getDataProvider("data").iterator());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (CounterUtil.isPercentValue(objType, counter)) {<NEW_LINE>xyGraph.primaryYAxis.setRange(0, 100);<NEW_LINE>} else {<NEW_LINE>xyGraph.<MASK><NEW_LINE>}<NEW_LINE>canvas.redraw();<NEW_LINE>xyGraph.repaint();<NEW_LINE>}
primaryYAxis.setRange(0, maxv);
1,682,335
public static void checkForDirectoryAndTryToDownloadToTmpDirAndUnzip(String directoryName) {<NEW_LINE>String outputDirectoryPath = tmpDirPath + "/" + directoryName;<NEW_LINE>File directory = new File(outputDirectoryPath);<NEW_LINE>if (!directory.exists() || directoryIsEmpty(directory)) {<NEW_LINE><MASK><NEW_LINE>String zipFileName = lastName + ".zip";<NEW_LINE>String urlPath = "http://truthsite.org/music/" + zipFileName;<NEW_LINE>String outputZipFilePath = tmpDirPath + "/" + zipFileName;<NEW_LINE>try {<NEW_LINE>PlayMelodyStrings.copyURLContentsToFile(new URL(urlPath), new File(outputZipFilePath));<NEW_LINE>} catch (Exception e) {<NEW_LINE>System.err.println("Unable to download zip file from " + urlPath + " into " + tmpDirPath);<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>// It may already exist but be empty.<NEW_LINE>directory.mkdir();<NEW_LINE>if (!directory.exists()) {<NEW_LINE>System.err.println("Could not create " + directory);<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>ArchiveUtils.unzipFileTo(outputZipFilePath, outputDirectoryPath);<NEW_LINE>} catch (IOException e) {<NEW_LINE>directory.delete();<NEW_LINE>System.err.println("Unable to unzip file from " + outputZipFilePath + " into " + tmpDirPath + " due to " + e.getMessage());<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
String lastName = directory.getName();
1,261,008
private void createConsumerGroupOpt(String masterUrl, String topicName, String consumerGroup, String token, String operator) {<NEW_LINE>LOGGER.info(String.format("begin to create consumer group %s for topic %s in master %s"<MASK><NEW_LINE>String url = masterUrl + ADD_CONSUMER_PATH + TOPIC_NAME + topicName + GROUP_NAME + consumerGroup + CREATE_USER + operator + CONF_MOD_AUTH_TOKEN + token;<NEW_LINE>try {<NEW_LINE>TubeHttpResponse response = HttpUtils.request(restTemplate, url, HttpMethod.GET, null, new HttpHeaders(), TubeHttpResponse.class);<NEW_LINE>if (response.getErrCode() != SUCCESS_CODE) {<NEW_LINE>String msg = String.format("failed to create tubemq consumer group %s for topic %s, error: %s", consumerGroup, topicName, response.getErrMsg());<NEW_LINE>LOGGER.error(msg + ", url {}", url);<NEW_LINE>throw new BusinessException(msg);<NEW_LINE>}<NEW_LINE>LOGGER.info("success to create tubemq topic {} in {}", topicName, url);<NEW_LINE>} catch (Exception e) {<NEW_LINE>String msg = String.format("failed to create tubemq topic %s in %s", topicName, masterUrl);<NEW_LINE>LOGGER.error(msg, e);<NEW_LINE>throw new BusinessException(msg + ", error: " + e.getMessage());<NEW_LINE>}<NEW_LINE>}
, consumerGroup, topicName, masterUrl));
1,485,256
// @see SWTSkinObjectBasic#paintControl(org.eclipse.swt.graphics.GC)<NEW_LINE>@Override<NEW_LINE>public void paintControl(GC gc) {<NEW_LINE>super.paintControl(gc);<NEW_LINE>int fullWidth = maxSize.x == 0 || imageFGbounds == null ? canvas.getClientArea().width : imageFGbounds.width;<NEW_LINE>if (percent > 0 && imageFG != null) {<NEW_LINE>int xDrawTo = (int) (fullWidth * percent);<NEW_LINE>int xDrawToSrc = xDrawTo > imageFGbounds.width ? imageFGbounds.width : xDrawTo;<NEW_LINE>int y = (maxSize.y - imageFGbounds.height) / 2;<NEW_LINE>gc.drawImage(imageFG, 0, 0, xDrawToSrc, imageFGbounds.height, 0, <MASK><NEW_LINE>}<NEW_LINE>if (percent < 100 && imageBG != null && imageFGbounds != null) {<NEW_LINE>int xDrawFrom = (int) (imageBGbounds.width * percent);<NEW_LINE>int xDrawWidth = imageBGbounds.width - xDrawFrom;<NEW_LINE>gc.drawImage(imageBG, xDrawFrom, 0, xDrawWidth, imageFGbounds.height, xDrawFrom, 0, xDrawWidth, imageFGbounds.height);<NEW_LINE>}<NEW_LINE>int drawWidth = fullWidth - imageThumbBounds.width;<NEW_LINE>int xThumbPos = (int) ((mouseDown && !mouseMoveAdjusts ? draggingPercent : percent) * drawWidth);<NEW_LINE>gc.drawImage(imageThumb, xThumbPos, 0);<NEW_LINE>}
y, xDrawTo, imageFGbounds.height);
1,547,252
private boolean canDropNode(ProgramNode destinationNode, ProgramNode dropNode, int dropAction, int relativeMousePosition) {<NEW_LINE>Group dragGroup = dropNode.getGroup();<NEW_LINE>if (dragGroup.equals(destinationNode.getGroup())) {<NEW_LINE>// can't drop a group onto itself<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (relativeMousePosition != 0) {<NEW_LINE>return reorderDDMgr.isDropSiteOk(destinationNode, dropNode, dropAction, relativeMousePosition);<NEW_LINE>}<NEW_LINE>// this is for a normal drop on the node<NEW_LINE>if (destinationNode.isFragment()) {<NEW_LINE>return checkDestFragment(destinationNode, dropNode, dropAction);<NEW_LINE>}<NEW_LINE>// check for destination module already containing drop Module or Fragment<NEW_LINE>ProgramModule destModule = destinationNode.getModule();<NEW_LINE>if (dropNode.isFragment() && destModule.contains(dropNode.getFragment())) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (dropNode.isModule()) {<NEW_LINE><MASK><NEW_LINE>if (destModule.contains(dropNode.getModule())) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (dropModule.isDescendant(destModule)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
ProgramModule dropModule = dropNode.getModule();
322,235
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {<NEW_LINE>super.onViewCreated(view, savedInstanceState);<NEW_LINE>mWebView = view.findViewById(getWebViewResId());<NEW_LINE>mProgress = view.findViewById(R.id.progress);<NEW_LINE>mWebView.setWebViewClient(new WebViewClient() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onPageFinished(WebView view, String url) {<NEW_LINE>UiUtils.show(mWebView);<NEW_LINE>UiUtils.hide(mProgress);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean shouldOverrideUrlLoading(WebView view, String url) {<NEW_LINE>if (!TextUtils.isEmpty(url) && url.contains(REDIRECT_URL + "/?code=")) {<NEW_LINE>Intent returnIntent = new Intent();<NEW_LINE>returnIntent.putExtra(Constants.EXTRA_PHONE_AUTH_TOKEN, url.substring((REDIRECT_URL + "/?code=").length()));<NEW_LINE>getActivity().setResult(Activity.RESULT_OK, returnIntent);<NEW_LINE>getActivity().finish();<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return super.shouldOverrideUrlLoading(view, url);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>mWebView.<MASK><NEW_LINE>mWebView.getSettings().setUserAgentString(Framework.nativeGetUserAgent());<NEW_LINE>mWebView.loadUrl(Framework.nativeGetPhoneAuthUrl(REDIRECT_URL), Framework.getDefaultAuthHeaders());<NEW_LINE>}
getSettings().setJavaScriptEnabled(true);
227,470
public void bindData(GlideUrl target, ViewHolder<RecyNineBinding> bindView, int position) {<NEW_LINE>ViewGroup.LayoutParams params = bindView.baseBind.illustImage.getLayoutParams();<NEW_LINE>if (illust.getPage_count() == 1) {<NEW_LINE>int imageSize = mContext.getResources().getDisplayMetrics().widthPixels - DensityUtil.dp2px(32.0f);<NEW_LINE>params.width = imageSize;<NEW_LINE>params.height = imageSize * illust.getHeight() / illust.getWidth();<NEW_LINE>} else if (illust.getPage_count() == 2 || illust.getPage_count() == 4) {<NEW_LINE>int imageSize = (mContext.getResources().getDisplayMetrics().widthPixels - DensityUtil.dp2px(20.0f)) / 2;<NEW_LINE>params.width = imageSize;<NEW_LINE>params.height = imageSize;<NEW_LINE>} else {<NEW_LINE>int imageSize = (mContext.getResources().getDisplayMetrics().widthPixels - DensityUtil.dp2px(32.0f)) / 3;<NEW_LINE>params.width = imageSize;<NEW_LINE>params.height = imageSize;<NEW_LINE>}<NEW_LINE>bindView.<MASK><NEW_LINE>bindView.baseBind.illustImage.setNestedScrollingEnabled(true);<NEW_LINE>Glide.with(mContext).load(target).placeholder(R.color.light_bg).into(bindView.baseBind.illustImage);<NEW_LINE>}
baseBind.illustImage.setLayoutParams(params);
699,062
private void chartInit() {<NEW_LINE>previewChart.setTouchEnabled(true);<NEW_LINE>previewChart.setHighlightPerDragEnabled(true);<NEW_LINE>previewChart.setDragEnabled(true);<NEW_LINE>previewChart.setScaleEnabled(true);<NEW_LINE>previewChart.setDrawGridBackground(false);<NEW_LINE>previewChart.setPinchZoom(true);<NEW_LINE>previewChart.setScaleYEnabled(false);<NEW_LINE>previewChart.setBackgroundColor(Color.BLACK);<NEW_LINE>previewChart.getDescription().setEnabled(false);<NEW_LINE>previewChart.getXAxis().setAxisMaximum(5000);<NEW_LINE>previewChart.getXAxis().setAxisMinimum(0);<NEW_LINE>previewChart.getXAxis().setTextColor(Color.WHITE);<NEW_LINE>previewChart.getAxisLeft().setAxisMaximum(10);<NEW_LINE>previewChart.getAxisLeft().setAxisMinimum(-10);<NEW_LINE>previewChart.getAxisRight().setAxisMaximum(10);<NEW_LINE>previewChart.getAxisRight().setAxisMinimum(-10);<NEW_LINE>previewChart.fitScreen();<NEW_LINE>previewChart.invalidate();<NEW_LINE>Legend l = previewChart.getLegend();<NEW_LINE>l.setForm(Legend.LegendForm.LINE);<NEW_LINE><MASK><NEW_LINE>}
l.setTextColor(Color.WHITE);
1,426,510
private void handleManagedVolumesAfterFailedMigration(Map<VolumeInfo, DataStore> volumeToPool, Host destHost) {<NEW_LINE>for (Map.Entry<VolumeInfo, DataStore> entry : volumeToPool.entrySet()) {<NEW_LINE>VolumeInfo volumeInfo = entry.getKey();<NEW_LINE>StoragePool storagePool = storagePoolDao.findById(volumeInfo.getPoolId());<NEW_LINE>if (storagePool.isManaged()) {<NEW_LINE>final Map<String, String> details = new HashMap<>();<NEW_LINE>details.put(DeleteStoragePoolCommand.DATASTORE_NAME, getBasicIqn(volumeInfo.getId()));<NEW_LINE>final DeleteStoragePoolCommand cmd = new DeleteStoragePoolCommand();<NEW_LINE>cmd.setDetails(details);<NEW_LINE>cmd.setRemoveDatastore(true);<NEW_LINE>final Answer answer = agentMgr.easySend(destHost.getId(), cmd);<NEW_LINE>if (answer == null || !answer.getResult()) {<NEW_LINE>String errMsg = "Error interacting with host (related to handleManagedVolumesAfterFailedMigration)" + (StringUtils.isNotBlank(answer.getDetails()) ? ": " + answer.getDetails() : "");<NEW_LINE>s_logger.error(errMsg);<NEW_LINE>// no need to throw an exception here as the calling code is responsible for doing so<NEW_LINE>// regardless of the success or lack thereof concerning this method<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final PrimaryDataStoreDriver pdsd = (PrimaryDataStoreDriver) volumeInfo.getDataStore().getDriver();<NEW_LINE>VolumeDetailVO volumeDetailVo = new VolumeDetailVO(volumeInfo.getId(), PrimaryDataStoreDriver.BASIC_REVOKE_ACCESS, Boolean.TRUE.toString(), false);<NEW_LINE>volumeDetailsDao.persist(volumeDetailVo);<NEW_LINE>pdsd.revokeAccess(volumeInfo, destHost, volumeInfo.getDataStore());<NEW_LINE>volumeDetailVo = new VolumeDetailVO(volumeInfo.getId(), PrimaryDataStoreDriver.BASIC_DELETE_FAILURE, Boolean.<MASK><NEW_LINE>volumeDetailsDao.persist(volumeDetailVo);<NEW_LINE>pdsd.deleteAsync(volumeInfo.getDataStore(), volumeInfo, null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
TRUE.toString(), false);
813,895
public UpdateStreamingDistributionResult unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>UpdateStreamingDistributionResult updateStreamingDistributionResult = new UpdateStreamingDistributionResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument()) {<NEW_LINE>context.setCurrentHeader("ETag");<NEW_LINE>updateStreamingDistributionResult.setETag(StringStaxUnmarshaller.getInstance<MASK><NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>XMLEvent xmlEvent = context.nextEvent();<NEW_LINE>if (xmlEvent.isEndDocument())<NEW_LINE>return updateStreamingDistributionResult;<NEW_LINE>if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {<NEW_LINE>if (context.testExpression("StreamingDistribution", targetDepth)) {<NEW_LINE>updateStreamingDistributionResult.setStreamingDistribution(StreamingDistributionStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent.isEndElement()) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return updateStreamingDistributionResult;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
().unmarshall(context));
588,950
final DeprovisionByoipCidrResult executeDeprovisionByoipCidr(DeprovisionByoipCidrRequest deprovisionByoipCidrRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deprovisionByoipCidrRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeprovisionByoipCidrRequest> request = null;<NEW_LINE>Response<DeprovisionByoipCidrResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeprovisionByoipCidrRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deprovisionByoipCidrRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Global Accelerator");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeprovisionByoipCidr");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeprovisionByoipCidrResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeprovisionByoipCidrResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
1,640,577
// Main sort method.<NEW_LINE>static <T> int[] sort(final T array, final int from, final int to, final Comparator<? super T> comparator) {<NEW_LINE>rangeCheck(from, to);<NEW_LINE>final int length = to - from;<NEW_LINE>final int[] <MASK><NEW_LINE>if (length > 1) {<NEW_LINE>final Comparator<? super T> cmp = from > 0 ? (a, i, j) -> comparator.compare(a, i + from, j + from) : comparator;<NEW_LINE>// Sorting the sub-arrays with binary insertion sort.<NEW_LINE>for (int i = 0; i < length; i += RUN) {<NEW_LINE>BinaryInsertionSort.sort(array, i, min(i + RUN, length), proxy, cmp);<NEW_LINE>}<NEW_LINE>// Merging sub-arrays.<NEW_LINE>for (int size = RUN; size < length; size = 2 * size) {<NEW_LINE>for (int left = 0; left < length; left += 2 * size) {<NEW_LINE>final int mid = min(left + size - 1, length - 1);<NEW_LINE>final int right = min(left + 2 * size - 1, length - 1);<NEW_LINE>merge(array, proxy, left, mid, right, cmp);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return from > 0 ? add(proxy, from) : proxy;<NEW_LINE>}
proxy = ProxySorter.indexes(length);
1,575,071
public int executeUpdate(final String sql, final int[] columnIndexes) throws SQLException {<NEW_LINE>returnGeneratedKeys = true;<NEW_LINE>try {<NEW_LINE>LogicSQL logicSQL = createLogicSQL(sql);<NEW_LINE>trafficContext = getTrafficContext(logicSQL);<NEW_LINE>if (trafficContext.isMatchTraffic()) {<NEW_LINE>JDBCExecutionUnit executionUnit = createTrafficExecutionUnit(trafficContext, logicSQL);<NEW_LINE>return executor.getTrafficExecutor().execute(executionUnit, (statement, actualSQL) -> statement.executeUpdate(actualSQL, columnIndexes));<NEW_LINE>}<NEW_LINE>executionContext = createExecutionContext(logicSQL);<NEW_LINE>if (metaDataContexts.getMetaData(connection.getSchema()).getRuleMetaData().getRules().stream().anyMatch(each -> each instanceof RawExecutionRule)) {<NEW_LINE>return accumulate(executor.getRawExecutor().execute(createRawExecutionContext(), executionContext.getLogicSQL(), new RawSQLExecutorCallback()));<NEW_LINE>}<NEW_LINE>ExecutionGroupContext<MASK><NEW_LINE>cacheStatements(executionGroups.getInputGroups());<NEW_LINE>return executeUpdate(executionGroups, (actualSQL, statement) -> statement.executeUpdate(actualSQL, columnIndexes), executionContext.getSqlStatementContext(), executionContext.getRouteContext().getRouteUnits());<NEW_LINE>} catch (SQLException ex) {<NEW_LINE>handleExceptionInTransaction(connection, metaDataContexts);<NEW_LINE>throw ex;<NEW_LINE>} finally {<NEW_LINE>currentResultSet = null;<NEW_LINE>}<NEW_LINE>}
<JDBCExecutionUnit> executionGroups = createExecutionContext();
1,143,988
public void testXmlOverrideValidServiceRefWithInvalidPortAddress() throws Exception {<NEW_LINE>TestUtils.publishFileToServer(server, "WsBndServiceRefOverrideTest", "ibm-ws-bnd_testXmlOverrideValidServiceRefWithInvalidPortAddress.xml", "dropins/wsBndServiceRefOverride.war/WEB-INF/", "ibm-ws-bnd.xml");<NEW_LINE>TestUtils.replaceServerFileString(server, "dropins/wsBndServiceRefOverride.war/WEB-INF/ibm-ws-bnd.xml", "#ENDPOINT_ADDRESS#", getDefaultEndpointAddr());<NEW_LINE>server.startServer();<NEW_LINE>server.waitForStringInLog("CWWKZ0001I.*wsBndServiceRefOverride");<NEW_LINE>String result = getServletResponse(getServletAddr());<NEW_LINE>assertFalse("The returned result is not expected: " + getDefaultEndpointAddr() + "," + result<MASK><NEW_LINE>}
, "Hello".equals(result));
1,320,688
final GetServiceQuotaIncreaseRequestFromTemplateResult executeGetServiceQuotaIncreaseRequestFromTemplate(GetServiceQuotaIncreaseRequestFromTemplateRequest getServiceQuotaIncreaseRequestFromTemplateRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getServiceQuotaIncreaseRequestFromTemplateRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetServiceQuotaIncreaseRequestFromTemplateRequest> request = null;<NEW_LINE>Response<GetServiceQuotaIncreaseRequestFromTemplateResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetServiceQuotaIncreaseRequestFromTemplateRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getServiceQuotaIncreaseRequestFromTemplateRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Service Quotas");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetServiceQuotaIncreaseRequestFromTemplate");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetServiceQuotaIncreaseRequestFromTemplateResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetServiceQuotaIncreaseRequestFromTemplateResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
971,346
final AssociateServiceQuotaTemplateResult executeAssociateServiceQuotaTemplate(AssociateServiceQuotaTemplateRequest associateServiceQuotaTemplateRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(associateServiceQuotaTemplateRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<AssociateServiceQuotaTemplateRequest> request = null;<NEW_LINE>Response<AssociateServiceQuotaTemplateResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new AssociateServiceQuotaTemplateRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(associateServiceQuotaTemplateRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Service Quotas");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AssociateServiceQuotaTemplate");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<AssociateServiceQuotaTemplateResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new AssociateServiceQuotaTemplateResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
1,601,546
public byte[] decodeMessage() {<NEW_LINE>byte[] data = new byte[17];<NEW_LINE>data[0] = 0x10;<NEW_LINE>data[1] = PacketType.WIND.toByte();<NEW_LINE>data[2] = subType.toByte();<NEW_LINE>data[3] = seqNbr;<NEW_LINE>data[4] = (byte) ((sensorId & 0xFF00) >> 8);<NEW_LINE>data[5] = (byte) (sensorId & 0x00FF);<NEW_LINE>short WindD = (short) Math.abs(windDirection);<NEW_LINE>data[6] = (byte) ((WindD >> 8) & 0xFF);<NEW_LINE>data[7] = (byte) (WindD & 0xFF);<NEW_LINE>int WindAS = (short) Math.abs(windAvSpeed) * 10;<NEW_LINE>data[8] = (byte) ((WindAS >> 8) & 0xFF);<NEW_LINE>data[9] = (byte) (WindAS & 0xFF);<NEW_LINE>int WindS = (short) Math.abs(windSpeed) * 10;<NEW_LINE>data[10] = (byte) ((WindS >> 8) & 0xFF);<NEW_LINE>data[11] = (byte) (WindS & 0xFF);<NEW_LINE>if (subType == SubType.TFA) {<NEW_LINE>short temp = (short) Math.abs(temperature * 10);<NEW_LINE>data[12] = (byte) ((temp >> 8) & 0xFF);<NEW_LINE>data[13] = <MASK><NEW_LINE>if (temperature < 0) {<NEW_LINE>data[12] |= 0x80;<NEW_LINE>}<NEW_LINE>short chill = (short) Math.abs(chillFactor * 10);<NEW_LINE>data[14] = (byte) ((chill >> 8) & 0xFF);<NEW_LINE>data[15] = (byte) (chill & 0xFF);<NEW_LINE>if (chillFactor < 0) {<NEW_LINE>data[14] |= 0x80;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>data[16] = (byte) (((signalLevel & 0x0F) << 4) | (batteryLevel & 0x0F));<NEW_LINE>return data;<NEW_LINE>}
(byte) (temp & 0xFF);
1,638,681
public static void attestSgxEnclaveAsync1() {<NEW_LINE>BinaryData runtimeData = BinaryData.fromBytes(SampleCollateral.getRunTimeData());<NEW_LINE>BinaryData inittimeData = null;<NEW_LINE>BinaryData openEnclaveReport = BinaryData.fromBytes(SampleCollateral.getOpenEnclaveReport());<NEW_LINE>BinaryData sgxQuote = BinaryData.fromBytes(SampleCollateral.getSgxEnclaveQuote());<NEW_LINE>AttestationAsyncClient client = new AttestationClientBuilder().endpoint("https://sharedcus.cus.attest.azure.net").buildAsyncClient();<NEW_LINE>// BEGIN: com.azure.security.attestation.AttestationAsyncClient.attestSgxEnclaveWithReport<NEW_LINE>Mono<AttestationResult> resultWithReport = client.attestSgxEnclave(sgxQuote);<NEW_LINE>// END: com.azure.security.attestation.AttestationAsyncClient.attestSgxEnclaveWithReport<NEW_LINE>// BEGIN: com.azure.security.attestation.AttestationAsyncClient.attestSgxEnclave<NEW_LINE>Mono<AttestationResult> result = client.attestSgxEnclave(new AttestationOptions(sgxQuote).setRunTimeData(new AttestationData(<MASK><NEW_LINE>// END: com.azure.security.attestation.AttestationAsyncClient.attestSgxEnclave<NEW_LINE>// BEGIN: com.azure.security.attestation.AttestationAsyncClient.attestSgxEnclaveWithResponse<NEW_LINE>Mono<AttestationResponse<AttestationResult>> openEnclaveResponse = client.attestSgxEnclaveWithResponse(new AttestationOptions(sgxQuote).setRunTimeData(new AttestationData(runtimeData, AttestationDataInterpretation.JSON)), Context.NONE);<NEW_LINE>// END: com.azure.security.attestation.AttestationAsyncClient.attestSgxEnclaveWithResponse<NEW_LINE>}
runtimeData, AttestationDataInterpretation.BINARY)));
1,135,749
public static DescribeGatherStatsResultResponse unmarshall(DescribeGatherStatsResultResponse describeGatherStatsResultResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeGatherStatsResultResponse.setRequestId(_ctx.stringValue("DescribeGatherStatsResultResponse.RequestId"));<NEW_LINE>describeGatherStatsResultResponse.setCode(_ctx.stringValue("DescribeGatherStatsResultResponse.Code"));<NEW_LINE>describeGatherStatsResultResponse.setMessage(_ctx.stringValue("DescribeGatherStatsResultResponse.Message"));<NEW_LINE>GatherStatsResult gatherStatsResult = new GatherStatsResult();<NEW_LINE>Change change = new Change();<NEW_LINE>change.setChangeId(_ctx.stringValue("DescribeGatherStatsResultResponse.GatherStatsResult.Change.ChangeId"));<NEW_LINE>change.setEnvId(_ctx.stringValue("DescribeGatherStatsResultResponse.GatherStatsResult.Change.EnvId"));<NEW_LINE>change.setChangeName(_ctx.stringValue("DescribeGatherStatsResultResponse.GatherStatsResult.Change.ChangeName"));<NEW_LINE>change.setChangeDescription(_ctx.stringValue("DescribeGatherStatsResultResponse.GatherStatsResult.Change.ChangeDescription"));<NEW_LINE>change.setChangeFinished(_ctx.booleanValue("DescribeGatherStatsResultResponse.GatherStatsResult.Change.ChangeFinished"));<NEW_LINE>change.setChangeSucceeded(_ctx.booleanValue("DescribeGatherStatsResultResponse.GatherStatsResult.Change.ChangeSucceeded"));<NEW_LINE>change.setChangeAborted(_ctx.booleanValue("DescribeGatherStatsResultResponse.GatherStatsResult.Change.ChangeAborted"));<NEW_LINE>change.setChangePaused(_ctx.booleanValue("DescribeGatherStatsResultResponse.GatherStatsResult.Change.ChangePaused"));<NEW_LINE>change.setChangeTimedout(_ctx.booleanValue("DescribeGatherStatsResultResponse.GatherStatsResult.Change.ChangeTimedout"));<NEW_LINE>change.setCreateTime(_ctx.longValue("DescribeGatherStatsResultResponse.GatherStatsResult.Change.CreateTime"));<NEW_LINE>change.setUpdateTime<MASK><NEW_LINE>change.setFinishTime(_ctx.longValue("DescribeGatherStatsResultResponse.GatherStatsResult.Change.FinishTime"));<NEW_LINE>change.setActionName(_ctx.stringValue("DescribeGatherStatsResultResponse.GatherStatsResult.Change.ActionName"));<NEW_LINE>change.setCreateUsername(_ctx.stringValue("DescribeGatherStatsResultResponse.GatherStatsResult.Change.CreateUsername"));<NEW_LINE>change.setChangeMessage(_ctx.stringValue("DescribeGatherStatsResultResponse.GatherStatsResult.Change.ChangeMessage"));<NEW_LINE>gatherStatsResult.setChange(change);<NEW_LINE>List<InstanceResult> instanceResults = new ArrayList<InstanceResult>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeGatherStatsResultResponse.GatherStatsResult.InstanceResults.Length"); i++) {<NEW_LINE>InstanceResult instanceResult = new InstanceResult();<NEW_LINE>instanceResult.setInstanceId(_ctx.stringValue("DescribeGatherStatsResultResponse.GatherStatsResult.InstanceResults[" + i + "].InstanceId"));<NEW_LINE>instanceResult.setStorageKey(_ctx.stringValue("DescribeGatherStatsResultResponse.GatherStatsResult.InstanceResults[" + i + "].StorageKey"));<NEW_LINE>instanceResult.setTaskSucceeded(_ctx.booleanValue("DescribeGatherStatsResultResponse.GatherStatsResult.InstanceResults[" + i + "].TaskSucceeded"));<NEW_LINE>instanceResult.setTaskMessage(_ctx.stringValue("DescribeGatherStatsResultResponse.GatherStatsResult.InstanceResults[" + i + "].TaskMessage"));<NEW_LINE>instanceResults.add(instanceResult);<NEW_LINE>}<NEW_LINE>gatherStatsResult.setInstanceResults(instanceResults);<NEW_LINE>describeGatherStatsResultResponse.setGatherStatsResult(gatherStatsResult);<NEW_LINE>return describeGatherStatsResultResponse;<NEW_LINE>}
(_ctx.longValue("DescribeGatherStatsResultResponse.GatherStatsResult.Change.UpdateTime"));
1,245,043
protected Rectangle calculateClientArea() {<NEW_LINE>calculateRouting();<NEW_LINE>int controlPointShapeRadius = controlPointShape.getRadius();<NEW_LINE>int controlPointShapeRadius2 = controlPointShapeRadius + controlPointShapeRadius;<NEW_LINE>int endPointShapeRadius = endPointShape.getRadius();<NEW_LINE>Rectangle rect = null;<NEW_LINE>for (Point point : controlPoints) {<NEW_LINE>Rectangle addRect = new Rectangle(point.x - controlPointShapeRadius, point.y - controlPointShapeRadius, controlPointShapeRadius2, controlPointShapeRadius2);<NEW_LINE>if (rect == null)<NEW_LINE>rect = addRect;<NEW_LINE>else<NEW_LINE>rect.add(addRect);<NEW_LINE>}<NEW_LINE>Point firstPoint = getFirstControlPoint();<NEW_LINE>if (firstPoint != null) {<NEW_LINE>int radius = Math.max(sourceAnchorShape.getRadius(), endPointShapeRadius);<NEW_LINE>int radius2 = radius + radius;<NEW_LINE>if (rect == null)<NEW_LINE>rect = new Rectangle(firstPoint.x - radius, firstPoint.<MASK><NEW_LINE>else<NEW_LINE>rect.add(new Rectangle(firstPoint.x - radius, firstPoint.y - radius, radius2, radius2));<NEW_LINE>}<NEW_LINE>Point lastPoint = getLastControlPoint();<NEW_LINE>if (lastPoint != null) {<NEW_LINE>int radius = Math.max(targetAnchorShape.getRadius(), endPointShapeRadius);<NEW_LINE>int radius2 = radius + radius;<NEW_LINE>if (rect == null)<NEW_LINE>rect = new Rectangle(lastPoint.x - radius, lastPoint.y - radius, radius2, radius2);<NEW_LINE>else<NEW_LINE>rect.add(new Rectangle(lastPoint.x - radius, lastPoint.y - radius, radius2, radius2));<NEW_LINE>}<NEW_LINE>if (rect != null)<NEW_LINE>// TODO - improve line width calculation<NEW_LINE>rect.grow(2, 2);<NEW_LINE>return rect != null ? rect : new Rectangle();<NEW_LINE>}
y - radius, radius2, radius2);
167,054
public int deleteJobsPermanently(StateName state, Instant updatedBefore) {<NEW_LINE>int amount = 0;<NEW_LINE>try (final StatefulRedisConnection<String, String> connection = getConnection()) {<NEW_LINE>RedisCommands<String, String> commands = connection.sync();<NEW_LINE>List<String> zrangeToInspect = commands.zrange(jobQueueForStateKey(keyPrefix, state), 0, 1000);<NEW_LINE>outerloop: while (!zrangeToInspect.isEmpty()) {<NEW_LINE>for (String id : zrangeToInspect) {<NEW_LINE>final Job job = getJobById(UUID.fromString(id));<NEW_LINE>if (job.getUpdatedAt().isAfter(updatedBefore))<NEW_LINE>break outerloop;<NEW_LINE>commands.multi();<NEW_LINE>commands.del(jobKey(keyPrefix, job));<NEW_LINE>commands.del(jobVersionKey(keyPrefix, job));<NEW_LINE>deleteJobMetadata(commands, job);<NEW_LINE>final TransactionResult exec = commands.exec();<NEW_LINE>if (exec != null && !exec.isEmpty())<NEW_LINE>amount++;<NEW_LINE>}<NEW_LINE>zrangeToInspect = commands.zrange(jobQueueForStateKey(keyPrefix<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>notifyJobStatsOnChangeListenersIf(amount > 0);<NEW_LINE>return amount;<NEW_LINE>}
, state), 0, 1000);
1,596,121
private void writeMagicComments(DefaultTextOutput out, LinkerContext context, int fragmentId, String strongName) {<NEW_LINE>String sourceMapUrl = getSourceMapUrl(context, strongName, fragmentId);<NEW_LINE>if (sourceMapUrl != null) {<NEW_LINE>// This magic comment determines where a browser debugger looks for a sourcemap,<NEW_LINE>// except that it may be overridden by a "SourceMap" header in the HTTP response when<NEW_LINE>// loading the JavaScript.<NEW_LINE>// (Note: even if you're using the HTTP header, you still have to set this to an arbitrary<NEW_LINE>// value, or Chrome won't enable sourcemaps.)<NEW_LINE>out.print("\n//# sourceMappingURL=" + sourceMapUrl + " ");<NEW_LINE>}<NEW_LINE>// This magic comment determines the name of the JavaScript fragment in a browser debugger.<NEW_LINE>// (In Chrome it typically shows up under "(no domain)".)<NEW_LINE>// We need to set it explicitly because the JavaScript code may be installed via an "eval"<NEW_LINE>// statement and even if we're not using an eval, the filename contains the strongname which<NEW_LINE>// isn't stable across recompiles.<NEW_LINE>out.print("\n//# sourceURL=" + context.getModuleName(<MASK><NEW_LINE>}
) + "-" + fragmentId + ".js\n");
444,557
private void detectAndUpgrade(long streamType) {<NEW_LINE>if (streamType == ControlStreamConnection.STREAM_TYPE) {<NEW_LINE><MASK><NEW_LINE>ControlStreamConnection newConnection = new ControlStreamConnection(getEndPoint(), getExecutor(), byteBufferPool, parser);<NEW_LINE>newConnection.setInputBufferSize(getInputBufferSize());<NEW_LINE>newConnection.setUseInputDirectByteBuffers(isUseInputDirectByteBuffers());<NEW_LINE>if (LOG.isDebugEnabled())<NEW_LINE>LOG.debug("upgrading to {}", newConnection);<NEW_LINE>getEndPoint().upgrade(newConnection);<NEW_LINE>} else if (streamType == EncoderStreamConnection.STREAM_TYPE) {<NEW_LINE>EncoderStreamConnection newConnection = new EncoderStreamConnection(getEndPoint(), getExecutor(), byteBufferPool, decoder);<NEW_LINE>newConnection.setInputBufferSize(getInputBufferSize());<NEW_LINE>newConnection.setUseInputDirectByteBuffers(isUseInputDirectByteBuffers());<NEW_LINE>if (LOG.isDebugEnabled())<NEW_LINE>LOG.debug("upgrading to {}", newConnection);<NEW_LINE>getEndPoint().upgrade(newConnection);<NEW_LINE>} else if (streamType == DecoderStreamConnection.STREAM_TYPE) {<NEW_LINE>DecoderStreamConnection newConnection = new DecoderStreamConnection(getEndPoint(), getExecutor(), byteBufferPool, encoder);<NEW_LINE>newConnection.setInputBufferSize(getInputBufferSize());<NEW_LINE>newConnection.setUseInputDirectByteBuffers(isUseInputDirectByteBuffers());<NEW_LINE>if (LOG.isDebugEnabled())<NEW_LINE>LOG.debug("upgrading to {}", newConnection);<NEW_LINE>getEndPoint().upgrade(newConnection);<NEW_LINE>} else {<NEW_LINE>if (StreamType.isReserved(streamType)) {<NEW_LINE>if (LOG.isDebugEnabled())<NEW_LINE>LOG.debug("reserved stream type {}, closing {}", Long.toHexString(streamType), this);<NEW_LINE>getEndPoint().close(HTTP3ErrorCode.randomReservedCode(), null);<NEW_LINE>} else {<NEW_LINE>if (LOG.isDebugEnabled())<NEW_LINE>LOG.debug("unsupported stream type {}, closing {}", Long.toHexString(streamType), this);<NEW_LINE>getEndPoint().close(HTTP3ErrorCode.STREAM_CREATION_ERROR.code(), null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
ControlParser parser = new ControlParser(listener);
1,766,803
public void onBindViewHolder(EditorsChoiceItemAdapter.ViewHolder vh, int position) {<NEW_LINE>int type = getItemViewType(position);<NEW_LINE>EditorsChoiceItem item = items.get(position);<NEW_LINE>vh.headerView.setVisibility(type == VIEW_TYPE_HEADER ? View.VISIBLE : View.GONE);<NEW_LINE>vh.cardView.setVisibility(type == VIEW_TYPE_CONTENT ? View.VISIBLE : View.GONE);<NEW_LINE>vh.headerView.setText(item.getTitle());<NEW_LINE>vh.titleView.setText(item.getTitle());<NEW_LINE>vh.descriptionView.<MASK><NEW_LINE>if (!Helper.isNullOrEmpty(item.getThumbnailUrl())) {<NEW_LINE>Glide.with(context.getApplicationContext()).asBitmap().load(item.getThumbnailUrl()).centerCrop().placeholder(R.drawable.bg_thumbnail_placeholder).into(vh.thumbnailView);<NEW_LINE>}<NEW_LINE>vh.cardView.setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View view) {<NEW_LINE>if (listener != null) {<NEW_LINE>listener.onEditorsChoiceItemClicked(item);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
setText(item.getDescription());
1,575,004
private void appendIntegers(StringBuffer result, ThousandBlock... blocks) {<NEW_LINE>boolean hasStarted = false;<NEW_LINE>for (int i = 0; i < blocks.length; i++) {<NEW_LINE>ThousandBlock thousandBlock = blocks[i];<NEW_LINE>if (!(hasStarted && thousandBlock.isZero())) {<NEW_LINE>int thousandPower = (blocks.length - i - 1);<NEW_LINE>if (hasStarted) {<NEW_LINE>if (thousandBlock.isUnitary()) {<NEW_LINE>result.append(getAndSeparator());<NEW_LINE>} else {<NEW_LINE>if (thousandPower < 1) {<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>result.append(getThousandSeparator());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>result.append(thousandBlock.toWords());<NEW_LINE>if (thousandPower > 0) {<NEW_LINE>result.append(" ");<NEW_LINE>result.append(this.getString("1e" + 3 * thousandPower + "." + (thousandBlock.isUnitary() ? "singular" : "plural")));<NEW_LINE>}<NEW_LINE>hasStarted = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
result.append(getAndSeparator());
209,670
public void registerUnknownSourceRoots(final ClassPath owner, final Iterable<? extends URL> roots) {<NEW_LINE>assert owner != null;<NEW_LINE>assert roots != null;<NEW_LINE>synchronized (this) {<NEW_LINE>for (URL root : roots) {<NEW_LINE>unknownRoots.put(root, <MASK><NEW_LINE>}<NEW_LINE>unknownSourcePath = new HashSet<>(unknownRoots.keySet());<NEW_LINE>changes.add(new PathRegistryEvent.Change(EventKind.PATHS_ADDED, PathKind.UNKNOWN_SOURCE, null, Collections.singleton(owner)));<NEW_LINE>}<NEW_LINE>if (LOGGER.isLoggable(Level.FINE)) {<NEW_LINE>List<URL> l = new LinkedList<>();<NEW_LINE>for (URL r : roots) {<NEW_LINE>l.add(r);<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>LOGGER.log(Level.FINE, "registerUnknownSourceRoots: {0}", l);<NEW_LINE>}<NEW_LINE>scheduleFirer(roots);<NEW_LINE>}
new WeakValue(owner, root));
269,091
public static HostColumnVector fromDecimals(BigDecimal... values) {<NEW_LINE>// 1. Fetch the element with max precision (maxDec). Fill with ZERO if inputs is empty.<NEW_LINE>// 2. Fetch the max scale. Fill with ZERO if inputs is empty.<NEW_LINE>// 3. Rescale the maxDec with the max scale, so to come out the max precision capacity we need.<NEW_LINE>BigDecimal maxDec = Arrays.stream(values).filter(Objects::nonNull).max(Comparator.comparingInt(BigDecimal::precision)<MASK><NEW_LINE>int maxScale = Arrays.stream(values).filter(Objects::nonNull).map(decimal -> decimal.scale()).max(Comparator.naturalOrder()).orElse(0);<NEW_LINE>maxDec = maxDec.setScale(maxScale, RoundingMode.UNNECESSARY);<NEW_LINE>return build(DType.fromJavaBigDecimal(maxDec), values.length, (b) -> b.appendBoxed(values));<NEW_LINE>}
).orElse(BigDecimal.ZERO);
1,481,090
public static QueryCrackEventResponse unmarshall(QueryCrackEventResponse queryCrackEventResponse, UnmarshallerContext context) {<NEW_LINE>queryCrackEventResponse.setRequestId(context.stringValue("QueryCrackEventResponse.requestId"));<NEW_LINE>queryCrackEventResponse.setCode(context.stringValue("QueryCrackEventResponse.Code"));<NEW_LINE>queryCrackEventResponse.setSuccess(context.booleanValue("QueryCrackEventResponse.Success"));<NEW_LINE>queryCrackEventResponse.setMessage(context.stringValue("QueryCrackEventResponse.Message"));<NEW_LINE>Data data = new Data();<NEW_LINE>PageInfo pageInfo = new PageInfo();<NEW_LINE>pageInfo.setCurrentPage(context.integerValue("QueryCrackEventResponse.Data.PageInfo.CurrentPage"));<NEW_LINE>pageInfo.setPageSize(context.integerValue("QueryCrackEventResponse.Data.PageInfo.PageSize"));<NEW_LINE>pageInfo.setTotalCount(context.integerValue("QueryCrackEventResponse.Data.PageInfo.TotalCount"));<NEW_LINE>pageInfo.setCount(context.integerValue("QueryCrackEventResponse.Data.PageInfo.Count"));<NEW_LINE>data.setPageInfo(pageInfo);<NEW_LINE>List<Entity> list = new ArrayList<Entity>();<NEW_LINE>for (int i = 0; i < context.lengthValue("QueryCrackEventResponse.Data.List.Length"); i++) {<NEW_LINE>Entity entity = new Entity();<NEW_LINE>entity.setUuid(context.stringValue<MASK><NEW_LINE>entity.setAttackTime(context.stringValue("QueryCrackEventResponse.Data.List[" + i + "].AttackTime"));<NEW_LINE>entity.setAttackType(context.integerValue("QueryCrackEventResponse.Data.List[" + i + "].AttackType"));<NEW_LINE>entity.setAttackTypeName(context.stringValue("QueryCrackEventResponse.Data.List[" + i + "].AttackTypeName"));<NEW_LINE>entity.setBuyVersion(context.stringValue("QueryCrackEventResponse.Data.List[" + i + "].BuyVersion"));<NEW_LINE>entity.setCrackSourceIp(context.stringValue("QueryCrackEventResponse.Data.List[" + i + "].CrackSourceIp"));<NEW_LINE>entity.setCrackTimes(context.integerValue("QueryCrackEventResponse.Data.List[" + i + "].CrackTimes"));<NEW_LINE>entity.setGroupId(context.integerValue("QueryCrackEventResponse.Data.List[" + i + "].GroupId"));<NEW_LINE>entity.setInstanceName(context.stringValue("QueryCrackEventResponse.Data.List[" + i + "].InstanceName"));<NEW_LINE>entity.setInstanceId(context.stringValue("QueryCrackEventResponse.Data.List[" + i + "].InstanceId"));<NEW_LINE>entity.setIp(context.stringValue("QueryCrackEventResponse.Data.List[" + i + "].Ip"));<NEW_LINE>entity.setRegion(context.stringValue("QueryCrackEventResponse.Data.List[" + i + "].Region"));<NEW_LINE>entity.setStatus(context.integerValue("QueryCrackEventResponse.Data.List[" + i + "].Status"));<NEW_LINE>entity.setStatusName(context.stringValue("QueryCrackEventResponse.Data.List[" + i + "].StatusName"));<NEW_LINE>entity.setLocation(context.stringValue("QueryCrackEventResponse.Data.List[" + i + "].Location"));<NEW_LINE>entity.setInWhite(context.integerValue("QueryCrackEventResponse.Data.List[" + i + "].InWhite"));<NEW_LINE>entity.setUserName(context.stringValue("QueryCrackEventResponse.Data.List[" + i + "].UserName"));<NEW_LINE>list.add(entity);<NEW_LINE>}<NEW_LINE>data.setList(list);<NEW_LINE>queryCrackEventResponse.setData(data);<NEW_LINE>return queryCrackEventResponse;<NEW_LINE>}
("QueryCrackEventResponse.Data.List[" + i + "].Uuid"));
1,771,998
public void rip() throws IOException {<NEW_LINE>int page = 0;<NEW_LINE>String baseURL = "https://vine.co/api/timelines/users/" + getGID(this.url);<NEW_LINE>JSONObject json = null;<NEW_LINE>while (true) {<NEW_LINE>page++;<NEW_LINE>String theURL = baseURL;<NEW_LINE>if (page > 1) {<NEW_LINE>theURL += "?page=" + page;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>logger.info(" Retrieving " + theURL);<NEW_LINE>sendUpdate(STATUS.LOADING_RESOURCE, theURL);<NEW_LINE>json = Http.<MASK><NEW_LINE>} catch (HttpStatusException e) {<NEW_LINE>logger.debug("Hit end of pages at page " + page, e);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>JSONArray records = json.getJSONObject("data").getJSONArray("records");<NEW_LINE>for (int i = 0; i < records.length(); i++) {<NEW_LINE>String videoURL = records.getJSONObject(i).getString("videoUrl");<NEW_LINE>addURLToDownload(new URL(videoURL));<NEW_LINE>if (isThisATest()) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (isThisATest()) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (records.length() == 0) {<NEW_LINE>logger.info("Zero records returned");<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Thread.sleep(2000);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>logger.error("[!] Interrupted while waiting to load next page", e);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>waitForThreads();<NEW_LINE>}
url(theURL).getJSON();
380,823
public void writeToParcel(Parcel dest, int flags) {<NEW_LINE>dest.writeLong(this.id);<NEW_LINE>dest.writeString(this.url);<NEW_LINE>dest.writeString(this.body);<NEW_LINE>dest.writeString(this.title);<NEW_LINE>dest.writeInt(this.comments);<NEW_LINE>dest.writeInt(this.number);<NEW_LINE>dest.writeByte(this.locked ? (byte) 1 : (byte) 0);<NEW_LINE>dest.writeByte(this.mergable ? (byte) 1 : (byte) 0);<NEW_LINE>dest.writeByte(this.merged ? (byte) 1 : (byte) 0);<NEW_LINE>dest.writeByte(this.mergeable ? (byte<MASK><NEW_LINE>dest.writeInt(this.commits);<NEW_LINE>dest.writeInt(this.additions);<NEW_LINE>dest.writeInt(this.deletions);<NEW_LINE>dest.writeInt(this.state == null ? -1 : this.state.ordinal());<NEW_LINE>dest.writeString(this.bodyHtml);<NEW_LINE>dest.writeString(this.htmlUrl);<NEW_LINE>dest.writeLong(this.closedAt != null ? this.closedAt.getTime() : -1);<NEW_LINE>dest.writeLong(this.createdAt != null ? this.createdAt.getTime() : -1);<NEW_LINE>dest.writeLong(this.updatedAt != null ? this.updatedAt.getTime() : -1);<NEW_LINE>dest.writeInt(this.changedFiles);<NEW_LINE>dest.writeString(this.diffUrl);<NEW_LINE>dest.writeString(this.patchUrl);<NEW_LINE>dest.writeString(this.mergeCommitSha);<NEW_LINE>dest.writeLong(this.mergedAt != null ? this.mergedAt.getTime() : -1);<NEW_LINE>dest.writeString(this.mergeState);<NEW_LINE>dest.writeInt(this.reviewComments);<NEW_LINE>dest.writeString(this.repoId);<NEW_LINE>dest.writeString(this.login);<NEW_LINE>dest.writeString(this.mergeableState);<NEW_LINE>dest.writeList(this.assignees);<NEW_LINE>dest.writeParcelable(this.mergedBy, flags);<NEW_LINE>dest.writeParcelable(this.closedBy, flags);<NEW_LINE>dest.writeParcelable(this.user, flags);<NEW_LINE>dest.writeParcelable(this.assignee, flags);<NEW_LINE>dest.writeList(this.labels);<NEW_LINE>dest.writeParcelable(this.milestone, flags);<NEW_LINE>dest.writeParcelable(this.base, flags);<NEW_LINE>dest.writeParcelable(this.head, flags);<NEW_LINE>dest.writeParcelable(this.pullRequest, flags);<NEW_LINE>dest.writeParcelable(this.reactions, flags);<NEW_LINE>}
) 1 : (byte) 0);
73,681
public void handleAutoOpenElementEnd(final char[] buffer, final int nameOffset, final int nameLen, final int line, final int col) throws ParseException {<NEW_LINE>final String elementCompleteName = new String(buffer, nameOffset, nameLen);<NEW_LINE>final ElementDefinition elementDefinition = this.elementDefinitions.forName(this.templateMode, elementCompleteName);<NEW_LINE>final Attributes attributes;<NEW_LINE>if (this.currentElementAttributes.isEmpty() && this.currentElementInnerWhiteSpaces.isEmpty()) {<NEW_LINE>attributes = null;<NEW_LINE>} else {<NEW_LINE>final Attribute[] attributesArr = (this.currentElementAttributes.isEmpty() ? Attributes.EMPTY_ATTRIBUTE_ARRAY : this.currentElementAttributes.toArray(new Attribute[this.currentElementAttributes.size()]));<NEW_LINE>final String[] innerWhiteSpaces = this.currentElementInnerWhiteSpaces.toArray(new String[this.currentElementInnerWhiteSpaces.size()]);<NEW_LINE>attributes = new Attributes(attributesArr, innerWhiteSpaces);<NEW_LINE>}<NEW_LINE>this.templateHandler.handleOpenElement(new // synthetic = true<NEW_LINE>OpenElementTag(// synthetic = true<NEW_LINE>this.templateMode, // synthetic = true<NEW_LINE>elementDefinition, // synthetic = true<NEW_LINE>elementCompleteName, // synthetic = true<NEW_LINE>attributes, true, this.templateName, this.lineOffset + this.currentElementLine, (this.currentElementLine == 1 ? this.colOffset : <MASK><NEW_LINE>}
0) + this.currentElementCol));
1,136,689
private static CharSequence fullQueryOrMatrix(CharSequence string, char delimiter, String spaceReplace, boolean encode) throws IllegalArgumentException {<NEW_LINE>final int l = string.length();<NEW_LINE>final StringBuilder stb = new StringBuilder(l + 6);<NEW_LINE>for (int i = 0; i < l; i++) {<NEW_LINE>final char c = string.charAt(i);<NEW_LINE>if (c == '{') {<NEW_LINE>i = processTemplVarname(string, i, stb);<NEW_LINE>} else if ((c == delimiter) || (c == '=')) {<NEW_LINE>stb.append(c);<NEW_LINE>} else if (c == ' ') {<NEW_LINE>if (encode) {<NEW_LINE>stb.append(spaceReplace);<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("A space is not allowed. Switch encode to on to auto encode it.");<NEW_LINE>}<NEW_LINE>} else if (Reference.isUnreserved(c)) {<NEW_LINE>stb.append(c);<NEW_LINE>} else if (c == '}') {<NEW_LINE>throw new IllegalArgumentException("'}' is only allowed as " + "end of a variable name in \"" + string + "\"");<NEW_LINE>} else if (c == '%') {<NEW_LINE>processPercent(<MASK><NEW_LINE>} else {<NEW_LINE>toHexOrReject(c, stb, encode);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return stb;<NEW_LINE>}
i, encode, string, stb);
1,402,567
private final ThrowingFunction<List<List<Param<?>>>, PreparedStatement, SQLException> prepareAndBind(String sql, ThrowingFunction<String, PreparedStatement, SQLException> prepare) {<NEW_LINE>return p -> {<NEW_LINE><MASK><NEW_LINE>Rendered rendered = size == 0 ? translate(configuration, sql) : translate(configuration, sql, p.get(0).toArray(EMPTY_PARAM));<NEW_LINE>PreparedStatement s = prepare.apply(rendered.sql);<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>// TODO: Can we avoid re-parsing and re-generating the SQL and mapping bind values only?<NEW_LINE>if (i > 0)<NEW_LINE>rendered = translate(configuration, sql, p.get(i).toArray(EMPTY_PARAM));<NEW_LINE>new DefaultBindContext(configuration, s).visit(rendered.bindValues);<NEW_LINE>// TODO: Find a less hacky way to signal that we're batching. Currently:<NEW_LINE>// - ArrayList<Arraylist<Param<?>>> = batching<NEW_LINE>// - SingletonList<ArrayList<Param<?>>> = not batching<NEW_LINE>if (size > 1 || p instanceof ArrayList)<NEW_LINE>s.addBatch();<NEW_LINE>}<NEW_LINE>return s;<NEW_LINE>};<NEW_LINE>}
int size = p.size();
1,659,893
private void printReply(Reply reply) {<NEW_LINE>Trace trace = reply.getTrace();<NEW_LINE>if (!trace.getRoot().isEmpty()) {<NEW_LINE>System.out.println(trace);<NEW_LINE>}<NEW_LINE>if (reply.hasErrors()) {<NEW_LINE>System.err.print("Request failed: ");<NEW_LINE>for (int i = 0; i < reply.getNumErrors(); i++) {<NEW_LINE>System.err.printf("\n %s", reply.getError(i));<NEW_LINE>}<NEW_LINE>System.err.println();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!(reply instanceof GetDocumentReply)) {<NEW_LINE>System.err.printf("Unexpected reply %s: '%s'\n", reply.getType(), reply.toString());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>GetDocumentReply documentReply = (GetDocumentReply) reply;<NEW_LINE>Document document = documentReply.getDocument();<NEW_LINE>if (document == null) {<NEW_LINE>System.out.println("Document not found.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (params.showDocSize) {<NEW_LINE>System.out.printf("Document size: %d bytes.\n", document.getSerializedSize());<NEW_LINE>}<NEW_LINE>if (params.printIdsOnly) {<NEW_LINE>System.out.println(document.getId());<NEW_LINE>} else {<NEW_LINE>if (params.jsonOutput) {<NEW_LINE>System.out.print(Utf8.toString(<MASK><NEW_LINE>} else {<NEW_LINE>System.out.print(document.toXML(" "));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
JsonWriter.toByteArray(document)));
1,652,558
public void annotate(Annotation annotation) {<NEW_LINE>if (verbose) {<NEW_LINE>log.info("Adding RegexNER annotations ... ");<NEW_LINE>}<NEW_LINE>if (!annotation.containsKey(CoreAnnotations.SentencesAnnotation.class))<NEW_LINE>throw new RuntimeException("Unable to find sentences in " + annotation);<NEW_LINE>List<CoreMap> sentences = annotation.get(CoreAnnotations.SentencesAnnotation.class);<NEW_LINE>for (CoreMap sentence : sentences) {<NEW_LINE>List<CoreLabel> tokens = sentence.get(CoreAnnotations.TokensAnnotation.class);<NEW_LINE>classifier.classify(tokens);<NEW_LINE>for (CoreLabel token : tokens) {<NEW_LINE>if (token.get(CoreAnnotations.NamedEntityTagAnnotation.class) == null)<NEW_LINE>token.set(CoreAnnotations.NamedEntityTagAnnotation.<MASK><NEW_LINE>}<NEW_LINE>for (int start = 0; start < tokens.size(); start++) {<NEW_LINE>CoreLabel token = tokens.get(start);<NEW_LINE>String answerType = token.get(CoreAnnotations.AnswerAnnotation.class);<NEW_LINE>if (answerType == null)<NEW_LINE>continue;<NEW_LINE>String NERType = token.get(CoreAnnotations.NamedEntityTagAnnotation.class);<NEW_LINE>int answerEnd = findEndOfAnswerAnnotation(tokens, start);<NEW_LINE>int NERStart = findStartOfNERAnnotation(tokens, start);<NEW_LINE>int NEREnd = findEndOfNERAnnotation(tokens, start);<NEW_LINE>// check that the spans are the same, specially handling the case of<NEW_LINE>// tokens with background named entity tags ("other")<NEW_LINE>if ((NERStart == start || NERType.equals(classifier.flags.backgroundSymbol)) && (answerEnd == NEREnd || (NERType.equals(classifier.flags.backgroundSymbol) && NEREnd >= answerEnd))) {<NEW_LINE>// annotate each token in the span<NEW_LINE>for (int i = start; i < answerEnd; i++) tokens.get(i).set(CoreAnnotations.NamedEntityTagAnnotation.class, answerType);<NEW_LINE>}<NEW_LINE>start = answerEnd - 1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (verbose)<NEW_LINE>log.info("done.");<NEW_LINE>}
class, classifier.flags.backgroundSymbol);
24,267
public ThreeState deepEqual(@Nonnull final ASTNode oldNode, @Nonnull final LighterASTNode newNode) {<NEW_LINE>ProgressIndicatorProvider.checkCanceled();<NEW_LINE>boolean oldIsErrorElement = oldNode instanceof PsiErrorElement;<NEW_LINE>boolean newIsErrorElement = newNode.getTokenType() == TokenType.ERROR_ELEMENT;<NEW_LINE>if (oldIsErrorElement != newIsErrorElement)<NEW_LINE>return ThreeState.NO;<NEW_LINE>if (oldIsErrorElement) {<NEW_LINE>final PsiErrorElement e1 = (PsiErrorElement) oldNode;<NEW_LINE>return Objects.equals(e1.getErrorDescriptionValue(), getErrorMessage(newNode)) ? ThreeState.UNSURE : ThreeState.NO;<NEW_LINE>}<NEW_LINE>if (custom != null) {<NEW_LINE>ThreeState customResult = custom.fun(oldNode, newNode, myTreeStructure);<NEW_LINE>if (customResult != ThreeState.UNSURE) {<NEW_LINE>return customResult;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (newNode instanceof Token) {<NEW_LINE>final IElementType type = newNode.getTokenType();<NEW_LINE>final Token token = (Token) newNode;<NEW_LINE>if (oldNode instanceof ForeignLeafPsiElement) {<NEW_LINE>return type instanceof ForeignLeafType && StringUtil.equals(((ForeignLeafType) type).getValue(), oldNode.getText()) ? ThreeState.YES : ThreeState.NO;<NEW_LINE>}<NEW_LINE>if (oldNode instanceof LeafElement) {<NEW_LINE>if (type instanceof ForeignLeafType)<NEW_LINE>return ThreeState.NO;<NEW_LINE>return ((LeafElement) oldNode).textMatches(token.getText()) ? ThreeState.YES : ThreeState.NO;<NEW_LINE>}<NEW_LINE>if (type instanceof ILightLazyParseableElementType) {<NEW_LINE>return // do not dive into collapsed nodes<NEW_LINE>((TreeElement) oldNode).textMatches(token.getText()) ? // do not dive into collapsed nodes<NEW_LINE>ThreeState.YES : // do not dive into collapsed nodes<NEW_LINE>TreeUtil.isCollapsedChameleon(oldNode) ? ThreeState.NO : ThreeState.UNSURE;<NEW_LINE>}<NEW_LINE>if (oldNode.getElementType() instanceof ILazyParseableElementType && type instanceof ILazyParseableElementType || oldNode.getElementType() instanceof ICustomParsingType && type instanceof ICustomParsingType) {<NEW_LINE>return ((TreeElement) oldNode).textMatches(token.getText()) <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return ThreeState.UNSURE;<NEW_LINE>}
? ThreeState.YES : ThreeState.NO;
962,389
public void marshall(ScalingActivity scalingActivity, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (scalingActivity == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(scalingActivity.getActivityId(), ACTIVITYID_BINDING);<NEW_LINE>protocolMarshaller.marshall(scalingActivity.getServiceNamespace(), SERVICENAMESPACE_BINDING);<NEW_LINE>protocolMarshaller.marshall(scalingActivity.getResourceId(), RESOURCEID_BINDING);<NEW_LINE>protocolMarshaller.marshall(scalingActivity.getScalableDimension(), SCALABLEDIMENSION_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(scalingActivity.getCause(), CAUSE_BINDING);<NEW_LINE>protocolMarshaller.marshall(scalingActivity.getStartTime(), STARTTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(scalingActivity.getEndTime(), ENDTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(scalingActivity.getStatusCode(), STATUSCODE_BINDING);<NEW_LINE>protocolMarshaller.marshall(scalingActivity.getStatusMessage(), STATUSMESSAGE_BINDING);<NEW_LINE>protocolMarshaller.marshall(scalingActivity.getDetails(), DETAILS_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
scalingActivity.getDescription(), DESCRIPTION_BINDING);
1,674,936
private Map<String, String> parseSqlServerUrl(String jdbcUrl) {<NEW_LINE>HashMap<String, String> map = new HashMap<String, String>();<NEW_LINE>if (jdbcUrl == null || !StringUtils.startsWithIgnoreCase(jdbcUrl, "jdbc:sqlserver://")) {<NEW_LINE>return map;<NEW_LINE>}<NEW_LINE>int pos1 = jdbcUrl.indexOf(':', 5);<NEW_LINE>if (pos1 == -1) {<NEW_LINE>return map;<NEW_LINE>}<NEW_LINE>String type = jdbcUrl.substring(5, pos1);<NEW_LINE>map.put("type", type);<NEW_LINE>int pos2 = jdbcUrl.indexOf('?', pos1);<NEW_LINE>if (pos2 == -1) {<NEW_LINE>pos2 = jdbcUrl.length();<NEW_LINE>} else {<NEW_LINE>String paramString = jdbcUrl.substring(pos2 + 1);<NEW_LINE>parseParam(paramString, map);<NEW_LINE>}<NEW_LINE>int pos3 = jdbcUrl.indexOf(";", pos1);<NEW_LINE>String connUri = jdbcUrl.<MASK><NEW_LINE>int pos4 = connUri.indexOf(":");<NEW_LINE>if (pos4 != -1) {<NEW_LINE>String host = connUri.substring(2, pos4);<NEW_LINE>String port = connUri.substring(pos4 + 1);<NEW_LINE>map.put("host", host);<NEW_LINE>map.put("port", port);<NEW_LINE>} else {<NEW_LINE>String host = connUri.substring(2);<NEW_LINE>map.put("host", host);<NEW_LINE>map.put("port", DEFAULT_SQLSERVRE_PORT);<NEW_LINE>}<NEW_LINE>String urlWithoutParams = jdbcUrl.substring(0, pos2);<NEW_LINE>map.put("urlWithoutParams", urlWithoutParams);<NEW_LINE>return map;<NEW_LINE>}
substring(pos1 + 1, pos3);
867,216
public InputDeviceRequest unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>InputDeviceRequest inputDeviceRequest = new InputDeviceRequest();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("id", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>inputDeviceRequest.setId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return inputDeviceRequest;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
1,272,200
boolean isHashJoinCondition(EqualTo equalTo) {<NEW_LINE>Set<Slot> equalLeft = equalTo.left().collect(Slot.class::isInstance);<NEW_LINE>if (equalLeft.isEmpty()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Set<Slot> equalRight = equalTo.right().<MASK><NEW_LINE>if (equalRight.isEmpty()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>List<ExprId> equalLeftExprIds = equalLeft.stream().map(Slot::getExprId).collect(Collectors.toList());<NEW_LINE>List<ExprId> equalRightExprIds = equalRight.stream().map(Slot::getExprId).collect(Collectors.toList());<NEW_LINE>return leftExprIds.containsAll(equalLeftExprIds) && rightExprIds.containsAll(equalRightExprIds) || leftExprIds.containsAll(equalRightExprIds) && rightExprIds.containsAll(equalLeftExprIds);<NEW_LINE>}
collect(Slot.class::isInstance);
24,845
public AmazonS3ClientBuilder createBuilder(S3Options s3Options) {<NEW_LINE>AmazonS3ClientBuilder builder = AmazonS3ClientBuilder.standard().withCredentials(s3Options.getAwsCredentialsProvider());<NEW_LINE>if (s3Options.getClientConfiguration() != null) {<NEW_LINE>builder = builder.<MASK><NEW_LINE>}<NEW_LINE>if (!Strings.isNullOrEmpty(s3Options.getAwsServiceEndpoint())) {<NEW_LINE>builder = builder.withEndpointConfiguration(new AwsClientBuilder.EndpointConfiguration(s3Options.getAwsServiceEndpoint(), s3Options.getAwsRegion()));<NEW_LINE>} else if (!Strings.isNullOrEmpty(s3Options.getAwsRegion())) {<NEW_LINE>builder = builder.withRegion(s3Options.getAwsRegion());<NEW_LINE>} else {<NEW_LINE>LOG.info("The AWS S3 Beam extension was included in this build, but the awsRegion flag " + "was not specified. If you don't plan to use S3, then ignore this message.");<NEW_LINE>}<NEW_LINE>return builder;<NEW_LINE>}
withClientConfiguration(s3Options.getClientConfiguration());
1,291,311
private void completeUDPWrite(InetSocketAddress srcAddr, InetSocketAddress dstAddr, ByteBuf udpBuf, ByteBufAllocator byteBufAllocator, ChannelHandlerContext ctx) {<NEW_LINE>ByteBuf ipBuf = byteBufAllocator.buffer();<NEW_LINE>ByteBuf ethernetBuf = byteBufAllocator.buffer();<NEW_LINE>ByteBuf pcap = byteBufAllocator.buffer();<NEW_LINE>try {<NEW_LINE>if (srcAddr.getAddress() instanceof Inet4Address && dstAddr.getAddress() instanceof Inet4Address) {<NEW_LINE>IPPacket.writeUDPv4(ipBuf, udpBuf, NetUtil.ipv4AddressToInt((Inet4Address) srcAddr.getAddress()), NetUtil.ipv4AddressToInt((Inet4Address) dstAddr.getAddress()));<NEW_LINE>EthernetPacket.writeIPv4(ethernetBuf, ipBuf);<NEW_LINE>} else if (srcAddr.getAddress() instanceof Inet6Address && dstAddr.getAddress() instanceof Inet6Address) {<NEW_LINE>IPPacket.writeUDPv6(ipBuf, udpBuf, srcAddr.getAddress().getAddress(), dstAddr.getAddress().getAddress());<NEW_LINE>EthernetPacket.writeIPv6(ethernetBuf, ipBuf);<NEW_LINE>} else {<NEW_LINE>logger.error("Source and Destination IP Address versions are not same. Source Address: {}, " + "Destination Address: {}", srcAddr.getAddress(), dstAddr.getAddress());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Write Packet into Pcap<NEW_LINE><MASK><NEW_LINE>} catch (IOException ex) {<NEW_LINE>logger.error("Caught Exception While Writing Packet into Pcap", ex);<NEW_LINE>ctx.fireExceptionCaught(ex);<NEW_LINE>} finally {<NEW_LINE>ipBuf.release();<NEW_LINE>ethernetBuf.release();<NEW_LINE>pcap.release();<NEW_LINE>}<NEW_LINE>}
pCapWriter.writePacket(pcap, ethernetBuf);
1,380,022
public UploadChangesResponse uploadSubscriptionChanges(List<String> added, List<String> removed) throws GpodnetServiceException {<NEW_LINE>requireLoggedIn();<NEW_LINE>try {<NEW_LINE>URL url = new URI(baseScheme, null, baseHost, basePort, String.format("/api/2/subscriptions/%s/%s.json", username, deviceId), null, null).toURL();<NEW_LINE>final JSONObject requestObject = new JSONObject();<NEW_LINE>requestObject.put(<MASK><NEW_LINE>requestObject.put("remove", new JSONArray(removed));<NEW_LINE>RequestBody body = RequestBody.create(JSON, requestObject.toString());<NEW_LINE>Request.Builder request = new Request.Builder().post(body).url(url);<NEW_LINE>final String response = executeRequest(request);<NEW_LINE>return GpodnetUploadChangesResponse.fromJSONObject(response);<NEW_LINE>} catch (JSONException | MalformedURLException | URISyntaxException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>throw new GpodnetServiceException(e);<NEW_LINE>}<NEW_LINE>}
"add", new JSONArray(added));
253,869
private // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents<NEW_LINE>void initComponents() {<NEW_LINE>selectWsdlLbl = <MASK><NEW_LINE>innerPanel = new javax.swing.JPanel();<NEW_LINE>// NOI18N<NEW_LINE>org.openide.awt.Mnemonics.setLocalizedText(selectWsdlLbl, org.openide.util.NbBundle.getMessage(SaasExplorerPanel.class, "LBL_SelectWSDL"));<NEW_LINE>innerPanel.setBorder(javax.swing.BorderFactory.createEtchedBorder());<NEW_LINE>javax.swing.GroupLayout innerPanelLayout = new javax.swing.GroupLayout(innerPanel);<NEW_LINE>innerPanel.setLayout(innerPanelLayout);<NEW_LINE>innerPanelLayout.setHorizontalGroup(innerPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 376, Short.MAX_VALUE));<NEW_LINE>innerPanelLayout.setVerticalGroup(innerPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 254, Short.MAX_VALUE));<NEW_LINE>javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);<NEW_LINE>this.setLayout(layout);<NEW_LINE>layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup().addContainerGap().addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(innerPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE).addComponent(selectWsdlLbl)).addContainerGap()));<NEW_LINE>layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup().addContainerGap().addComponent(selectWsdlLbl).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(innerPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE).addContainerGap()));<NEW_LINE>}
new javax.swing.JLabel();
1,511,872
public static InstallAgentResponse unmarshall(InstallAgentResponse installAgentResponse, UnmarshallerContext _ctx) {<NEW_LINE>installAgentResponse.setRequestId(_ctx.stringValue("InstallAgentResponse.RequestId"));<NEW_LINE>installAgentResponse.setCode(_ctx.integerValue("InstallAgentResponse.Code"));<NEW_LINE>installAgentResponse.setMessage(_ctx.stringValue("InstallAgentResponse.Message"));<NEW_LINE>List<ExecutionResult> executionResultList = new ArrayList<ExecutionResult>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("InstallAgentResponse.ExecutionResultList.Length"); i++) {<NEW_LINE>ExecutionResult executionResult = new ExecutionResult();<NEW_LINE>executionResult.setInstanceId(_ctx.stringValue("InstallAgentResponse.ExecutionResultList[" + i + "].InstanceId"));<NEW_LINE>executionResult.setStatus(_ctx.stringValue("InstallAgentResponse.ExecutionResultList[" + i + "].Status"));<NEW_LINE>executionResult.setFinishedTime(_ctx.stringValue("InstallAgentResponse.ExecutionResultList[" + i + "].FinishedTime"));<NEW_LINE>executionResult.setInvokeRecordStatus(_ctx.stringValue<MASK><NEW_LINE>executionResult.setSuccess(_ctx.booleanValue("InstallAgentResponse.ExecutionResultList[" + i + "].Success"));<NEW_LINE>executionResultList.add(executionResult);<NEW_LINE>}<NEW_LINE>installAgentResponse.setExecutionResultList(executionResultList);<NEW_LINE>return installAgentResponse;<NEW_LINE>}
("InstallAgentResponse.ExecutionResultList[" + i + "].InvokeRecordStatus"));
759,656
final DeleteLocationResult executeDeleteLocation(DeleteLocationRequest deleteLocationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteLocationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteLocationRequest> request = null;<NEW_LINE>Response<DeleteLocationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteLocationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteLocationRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "DataSync");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteLocation");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteLocationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteLocationResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
1,344,665
public static Map<String, String> parseMetadata(String metadata) throws NacosException {<NEW_LINE>Map<String, String> metadataMap = new HashMap<>(16);<NEW_LINE>if (StringUtils.isBlank(metadata)) {<NEW_LINE>return metadataMap;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>metadataMap = JacksonUtils.toObj(metadata, new TypeReference<Map<String, String>>() {<NEW_LINE>});<NEW_LINE>} catch (Exception e) {<NEW_LINE>String[] datas = metadata.split(",");<NEW_LINE>if (datas.length > 0) {<NEW_LINE>for (String data : datas) {<NEW_LINE>String[] kv = data.split("=");<NEW_LINE>if (kv.length != 2) {<NEW_LINE>throw new NacosException(NacosException.INVALID_PARAM, "metadata format incorrect:" + metadata);<NEW_LINE>}<NEW_LINE>metadataMap.put(kv[<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return metadataMap;<NEW_LINE>}
0], kv[1]);
1,748,086
public void sendEventGridEventsAsync() {<NEW_LINE>// BEGIN: com.azure.messaging.eventgrid.EventGridPublisherAsyncClient#CreateEventGridEventClient<NEW_LINE>// Create a client to send events of EventGridEvent schema<NEW_LINE>EventGridPublisherAsyncClient<EventGridEvent> eventGridEventPublisherClient = // make sure it accepts EventGridEvent<NEW_LINE>new EventGridPublisherClientBuilder().// make sure it accepts EventGridEvent<NEW_LINE>endpoint(System.getenv("AZURE_EVENTGRID_EVENT_ENDPOINT")).credential(new AzureKeyCredential(System.getenv("AZURE_EVENTGRID_EVENT_KEY"))).buildEventGridEventPublisherAsyncClient();<NEW_LINE>// END: com.azure.messaging.eventgrid.EventGridPublisherAsyncClient#CreateEventGridEventClient<NEW_LINE>// BEGIN: com.azure.messaging.eventgrid.EventGridPublisherAsyncClient#SendEventGridEvent<NEW_LINE>// Create an EventGridEvent<NEW_LINE>User user = new User("John", "James");<NEW_LINE>EventGridEvent eventGridEvent = new EventGridEvent("/EventGridEvents/example/source", "Example.EventType", BinaryData.fromObject(user), "0.1");<NEW_LINE>// Send a single EventGridEvent<NEW_LINE>eventGridEventPublisherClient.<MASK><NEW_LINE>// Send a list of EventGridEvents to the EventGrid service altogether.<NEW_LINE>// This has better performance than sending one by one.<NEW_LINE>eventGridEventPublisherClient.sendEvents(Arrays.asList(eventGridEvent)).block();<NEW_LINE>// END: com.azure.messaging.eventgrid.EventGridPublisherAsyncClient#SendEventGridEvent<NEW_LINE>}
sendEvent(eventGridEvent).block();
834,706
static byte[] decode_base64(String s, int maxolen) throws IllegalArgumentException {<NEW_LINE>StringBuilder rs = new StringBuilder();<NEW_LINE>int off = 0, slen = s.length(), olen = 0;<NEW_LINE>byte[] ret;<NEW_LINE>byte c1, c2, c3, c4, o;<NEW_LINE>if (maxolen <= 0)<NEW_LINE>throw new IllegalArgumentException("Invalid maxolen");<NEW_LINE>while (off < slen - 1 && olen < maxolen) {<NEW_LINE>c1 = char64(s.charAt(off++));<NEW_LINE>c2 = char64(s.charAt(off++));<NEW_LINE>if (c1 == -1 || c2 == -1)<NEW_LINE>break;<NEW_LINE>o = (byte) (c1 << 2);<NEW_LINE>o |= (c2 & 0x30) >> 4;<NEW_LINE>rs.append((char) o);<NEW_LINE>if (++olen >= maxolen || off >= slen)<NEW_LINE>break;<NEW_LINE>c3 = char64(<MASK><NEW_LINE>if (c3 == -1)<NEW_LINE>break;<NEW_LINE>o = (byte) ((c2 & 0x0f) << 4);<NEW_LINE>o |= (c3 & 0x3c) >> 2;<NEW_LINE>rs.append((char) o);<NEW_LINE>if (++olen >= maxolen || off >= slen)<NEW_LINE>break;<NEW_LINE>c4 = char64(s.charAt(off++));<NEW_LINE>o = (byte) ((c3 & 0x03) << 6);<NEW_LINE>o |= c4;<NEW_LINE>rs.append((char) o);<NEW_LINE>++olen;<NEW_LINE>}<NEW_LINE>ret = new byte[olen];<NEW_LINE>for (off = 0; off < olen; off++) ret[off] = (byte) rs.charAt(off);<NEW_LINE>return ret;<NEW_LINE>}
s.charAt(off++));
1,170,062
private synchronized int _add(String key, int value, MODE m) {<NEW_LINE>if (key == null)<NEW_LINE>return NONE;<NEW_LINE>StringIntLinkedEntry[] tab = table;<NEW_LINE>int index = hash(key) % tab.length;<NEW_LINE>for (StringIntLinkedEntry e = tab[index]; e != null; e = e.next) {<NEW_LINE>if (CompareUtil.equals(e.key, key)) {<NEW_LINE>int old = e.value;<NEW_LINE>e.value += value;<NEW_LINE>switch(m) {<NEW_LINE>case FORCE_FIRST:<NEW_LINE>if (header.link_next != e) {<NEW_LINE>unchain(e);<NEW_LINE>chain(header, header.link_next, e);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case FORCE_LAST:<NEW_LINE>if (header.link_prev != e) {<NEW_LINE>unchain(e);<NEW_LINE>chain(<MASK><NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>return old;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (max > 0) {<NEW_LINE>switch(m) {<NEW_LINE>case FORCE_FIRST:<NEW_LINE>case FIRST:<NEW_LINE>while (count >= max) {<NEW_LINE>// removeLast();<NEW_LINE>String k = header.link_prev.key;<NEW_LINE>long v = remove(k);<NEW_LINE>overflowed(k, v);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case FORCE_LAST:<NEW_LINE>case LAST:<NEW_LINE>while (count >= max) {<NEW_LINE>// removeFirst();<NEW_LINE>String k = header.link_next.key;<NEW_LINE>long v = remove(k);<NEW_LINE>overflowed(k, v);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (count >= threshold) {<NEW_LINE>rehash();<NEW_LINE>tab = table;<NEW_LINE>index = hash(key) % tab.length;<NEW_LINE>}<NEW_LINE>StringIntLinkedEntry e = new StringIntLinkedEntry(key, value, tab[index]);<NEW_LINE>tab[index] = e;<NEW_LINE>switch(m) {<NEW_LINE>case FORCE_FIRST:<NEW_LINE>case FIRST:<NEW_LINE>chain(header, header.link_next, e);<NEW_LINE>break;<NEW_LINE>case FORCE_LAST:<NEW_LINE>case LAST:<NEW_LINE>chain(header.link_prev, header, e);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>count++;<NEW_LINE>return NONE;<NEW_LINE>}
header.link_prev, header, e);
160,119
private void createServerSettingsClass() {<NEW_LINE>schema.createEAttribute(serverSettings, "sendConfirmationEmailAfterRegistration", ecorePackage.<MASK><NEW_LINE>schema.createEAttribute(serverSettings, "allowSelfRegistration", ecorePackage.getEBooleanObject(), Multiplicity.SINGLE);<NEW_LINE>schema.createEAttribute(serverSettings, "allowUsersToCreateTopLevelProjects", ecorePackage.getEBoolean(), Multiplicity.SINGLE);<NEW_LINE>schema.createEAttribute(serverSettings, "checkinMergingEnabled", ecorePackage.getEBooleanObject(), Multiplicity.SINGLE);<NEW_LINE>schema.createEAttribute(serverSettings, "smtpServer", ecorePackage.getEString(), Multiplicity.SINGLE);<NEW_LINE>schema.createEAttribute(serverSettings, "emailSenderAddress", ecorePackage.getEString(), Multiplicity.SINGLE);<NEW_LINE>schema.createEAttribute(serverSettings, "emailSenderName", ecorePackage.getEString(), Multiplicity.SINGLE);<NEW_LINE>schema.createEAttribute(serverSettings, "siteAddress", ecorePackage.getEString(), Multiplicity.SINGLE);<NEW_LINE>schema.createEAttribute(serverSettings, "generateGeometryOnCheckin", ecorePackage.getEBoolean(), Multiplicity.SINGLE);<NEW_LINE>schema.createEAttribute(serverSettings, "allowOnlyWhitelisted", ecorePackage.getEBoolean(), Multiplicity.SINGLE);<NEW_LINE>schema.createEAttribute(serverSettings, "whitelistedDomains", ecorePackage.getEString(), Multiplicity.MANY);<NEW_LINE>schema.createEAttribute(serverSettings, "hideUserListForNonAdmin", ecorePackage.getEBooleanObject(), Multiplicity.SINGLE);<NEW_LINE>schema.createEAttribute(serverSettings, "protocolBuffersPort", ecorePackage.getEIntegerObject(), Multiplicity.SINGLE);<NEW_LINE>}
getEBoolean(), Multiplicity.SINGLE);
595,025
public void marshall(QuantumTaskSummary quantumTaskSummary, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (quantumTaskSummary == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(quantumTaskSummary.getCreatedAt(), CREATEDAT_BINDING);<NEW_LINE>protocolMarshaller.marshall(quantumTaskSummary.getDeviceArn(), DEVICEARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(quantumTaskSummary.getOutputS3Bucket(), OUTPUTS3BUCKET_BINDING);<NEW_LINE>protocolMarshaller.marshall(quantumTaskSummary.getOutputS3Directory(), OUTPUTS3DIRECTORY_BINDING);<NEW_LINE>protocolMarshaller.marshall(quantumTaskSummary.getQuantumTaskArn(), QUANTUMTASKARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(quantumTaskSummary.getShots(), SHOTS_BINDING);<NEW_LINE>protocolMarshaller.marshall(quantumTaskSummary.getStatus(), STATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(quantumTaskSummary.getTags(), TAGS_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
quantumTaskSummary.getEndedAt(), ENDEDAT_BINDING);
957,830
private boolean processUnsafeLoad(RawLoadNode load, PEReadEliminationBlockState state, GraphEffectList effects) {<NEW_LINE>if (load.ordersMemoryAccesses()) {<NEW_LINE>state.killReadCache();<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (load.offset().isConstant()) {<NEW_LINE>ResolvedJavaType type = StampTool.typeOrNull(load.object());<NEW_LINE>if (type != null && type.isArray()) {<NEW_LINE>JavaKind accessKind = load.accessKind();<NEW_LINE>JavaKind componentKind = type.getComponentType().getJavaKind();<NEW_LINE>long offset = load.offset().asJavaConstant().asLong();<NEW_LINE>int index = VirtualArrayNode.entryIndexForOffset(tool.getMetaAccess(), offset, accessKind, type.getComponentType(), Integer.MAX_VALUE);<NEW_LINE>if (index >= 0) {<NEW_LINE>ValueNode object = GraphUtil.unproxify(load.object());<NEW_LINE>LocationIdentity <MASK><NEW_LINE>ValueNode cachedValue = state.getReadCache(object, location, index, accessKind, this);<NEW_LINE>assert cachedValue == null || load.stamp(NodeView.DEFAULT).isCompatible(cachedValue.stamp(NodeView.DEFAULT)) : "The RawLoadNode's stamp is not compatible with the cached value.";<NEW_LINE>if (cachedValue != null) {<NEW_LINE>effects.replaceAtUsages(load, cachedValue, load);<NEW_LINE>addScalarAlias(load, cachedValue);<NEW_LINE>return true;<NEW_LINE>} else {<NEW_LINE>state.addReadCache(object, location, index, accessKind, isOverflowAccess(accessKind, componentKind), load, this);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
location = NamedLocationIdentity.getArrayLocation(componentKind);
1,850,092
// Suppress high Cognitive Complexity warning<NEW_LINE>@SuppressWarnings("squid:S3776")<NEW_LINE>@Override<NEW_LINE>public RowRecord nextWithoutConstraint() throws IOException {<NEW_LINE>long minTime = timeHeap.pollFirst();<NEW_LINE>RowRecord record = new RowRecord(minTime);<NEW_LINE>int seriesNumber = seriesReaderList.size();<NEW_LINE>for (int seriesIndex = 0; seriesIndex < seriesNumber; seriesIndex++) {<NEW_LINE>if (cachedBatchDataArray[seriesIndex] == null || !cachedBatchDataArray[seriesIndex].hasCurrent() || cachedBatchDataArray[seriesIndex].currentTime() != minTime) {<NEW_LINE>if (paths.get(seriesIndex) instanceof AlignedPath) {<NEW_LINE>for (int i = 0; i < ((AlignedPath) paths.get(seriesIndex)).getMeasurementList().size(); i++) {<NEW_LINE>record.addField(null);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>record.addField(null);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>TSDataType <MASK><NEW_LINE>if (dataType == TSDataType.VECTOR) {<NEW_LINE>for (TsPrimitiveType primitiveVal : cachedBatchDataArray[seriesIndex].getVector()) {<NEW_LINE>if (primitiveVal == null) {<NEW_LINE>record.addField(null);<NEW_LINE>} else {<NEW_LINE>record.addField(primitiveVal.getValue(), primitiveVal.getDataType());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>record.addField(cachedBatchDataArray[seriesIndex].currentValue(), dataType);<NEW_LINE>}<NEW_LINE>cacheNext(seriesIndex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return record;<NEW_LINE>}
dataType = dataTypes.get(seriesIndex);
348,781
private static List<Object> accessBufferPoolMXBeans(final Class<?> bufferPoolMXBeanClass) {<NEW_LINE>try {<NEW_LINE>final Method getPlatformMXBeansMethod = ManagementFactory.class.<MASK><NEW_LINE>final Object listOfBufferPoolMXBeanInstances = getPlatformMXBeansMethod.invoke(null, bufferPoolMXBeanClass);<NEW_LINE>return (List<Object>) listOfBufferPoolMXBeanInstances;<NEW_LINE>} catch (NoSuchMethodException e) {<NEW_LINE>LOGGER.fine("ManagementFactory.getPlatformMXBeans not available, no metrics for buffer pools will be exported");<NEW_LINE>return Collections.emptyList();<NEW_LINE>} catch (IllegalAccessException e) {<NEW_LINE>LOGGER.fine("ManagementFactory.getPlatformMXBeans not accessible, no metrics for buffer pools will be exported");<NEW_LINE>return Collections.emptyList();<NEW_LINE>} catch (InvocationTargetException e) {<NEW_LINE>LOGGER.warning("ManagementFactory.getPlatformMXBeans could not be invoked, no metrics for buffer pools will be exported");<NEW_LINE>return Collections.emptyList();<NEW_LINE>}<NEW_LINE>}
getMethod("getPlatformMXBeans", Class.class);
95,395
private void validate() {<NEW_LINE>if (this.claims.get(OidcClientMetadataClaimNames.CLIENT_ID_ISSUED_AT) != null || this.claims.get(OidcClientMetadataClaimNames.CLIENT_SECRET) != null) {<NEW_LINE>Assert.notNull(this.claims.get(OidcClientMetadataClaimNames.CLIENT_ID), "client_id cannot be null");<NEW_LINE>}<NEW_LINE>if (this.claims.get(OidcClientMetadataClaimNames.CLIENT_ID_ISSUED_AT) != null) {<NEW_LINE>Assert.isInstanceOf(Instant.class, this.claims.get(OidcClientMetadataClaimNames.CLIENT_ID_ISSUED_AT), "client_id_issued_at must be of type Instant");<NEW_LINE>}<NEW_LINE>if (this.claims.get(OidcClientMetadataClaimNames.CLIENT_SECRET_EXPIRES_AT) != null) {<NEW_LINE>Assert.notNull(this.claims.get(OidcClientMetadataClaimNames.CLIENT_SECRET), "client_secret cannot be null");<NEW_LINE>Assert.isInstanceOf(Instant.class, this.claims.get(OidcClientMetadataClaimNames.CLIENT_SECRET_EXPIRES_AT), "client_secret_expires_at must be of type Instant");<NEW_LINE>}<NEW_LINE>Assert.notNull(this.claims.get<MASK><NEW_LINE>Assert.isInstanceOf(List.class, this.claims.get(OidcClientMetadataClaimNames.REDIRECT_URIS), "redirect_uris must be of type List");<NEW_LINE>Assert.notEmpty((List<?>) this.claims.get(OidcClientMetadataClaimNames.REDIRECT_URIS), "redirect_uris cannot be empty");<NEW_LINE>if (this.claims.get(OidcClientMetadataClaimNames.GRANT_TYPES) != null) {<NEW_LINE>Assert.isInstanceOf(List.class, this.claims.get(OidcClientMetadataClaimNames.GRANT_TYPES), "grant_types must be of type List");<NEW_LINE>Assert.notEmpty((List<?>) this.claims.get(OidcClientMetadataClaimNames.GRANT_TYPES), "grant_types cannot be empty");<NEW_LINE>}<NEW_LINE>if (this.claims.get(OidcClientMetadataClaimNames.RESPONSE_TYPES) != null) {<NEW_LINE>Assert.isInstanceOf(List.class, this.claims.get(OidcClientMetadataClaimNames.RESPONSE_TYPES), "response_types must be of type List");<NEW_LINE>Assert.notEmpty((List<?>) this.claims.get(OidcClientMetadataClaimNames.RESPONSE_TYPES), "response_types cannot be empty");<NEW_LINE>}<NEW_LINE>if (this.claims.get(OidcClientMetadataClaimNames.SCOPE) != null) {<NEW_LINE>Assert.isInstanceOf(List.class, this.claims.get(OidcClientMetadataClaimNames.SCOPE), "scope must be of type List");<NEW_LINE>Assert.notEmpty((List<?>) this.claims.get(OidcClientMetadataClaimNames.SCOPE), "scope cannot be empty");<NEW_LINE>}<NEW_LINE>if (this.claims.get(OidcClientMetadataClaimNames.JWKS_URI) != null) {<NEW_LINE>validateURL(this.claims.get(OidcClientMetadataClaimNames.JWKS_URI), "jwksUri must be a valid URL");<NEW_LINE>}<NEW_LINE>}
(OidcClientMetadataClaimNames.REDIRECT_URIS), "redirect_uris cannot be null");
788,635
private void populateHandlers() {<NEW_LINE>ListIterator<String> listIterator = handlerClasses.listIterator();<NEW_LINE>final int[] handlerType = new int[] { WSHandlerDialog.JAXWS_LOGICAL_HANDLER };<NEW_LINE>boolean firstIteration = true;<NEW_LINE>while (listIterator.hasNext()) {<NEW_LINE>String handlerClass = listIterator.next();<NEW_LINE>final CancellableTask<CompilationController> task = new CancellableTask<CompilationController>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run(CompilationController controller) throws IOException {<NEW_LINE>controller.toPhase(Phase.ELEMENTS_RESOLVED);<NEW_LINE>handlerType[0] = WSHandlerDialog.getHandlerType(controller, isJaxWS);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void cancel() {<NEW_LINE>}<NEW_LINE>};<NEW_LINE>final FileObject classFO = getFileObjectOfClass(handlerClass);<NEW_LINE>if (classFO != null) {<NEW_LINE>JavaSource <MASK><NEW_LINE>WSHandlerDialog.runTask(firstIteration, javaSource, task);<NEW_LINE>if (firstIteration) {<NEW_LINE>firstIteration = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (handlerType[0] == WSHandlerDialog.JAXWS_LOGICAL_HANDLER) {<NEW_LINE>protocolIndex++;<NEW_LINE>}<NEW_LINE>handlerTableModel.addRow(new Object[] { handlerClass, handlerType[0] });<NEW_LINE>}<NEW_LINE>if (handlerTableModel.getRowCount() > 0) {<NEW_LINE>((ListSelectionModel) handlerTable.getSelectionModel()).setSelectionInterval(0, 0);<NEW_LINE>}<NEW_LINE>}
javaSource = JavaSource.forFileObject(classFO);
491,352
private org.neo4j.driver.Config.TrustStrategy toInternalTrustStrategy() {<NEW_LINE>org.<MASK><NEW_LINE>switch(trustStrategy) {<NEW_LINE>case TRUST_ALL_CERTIFICATES:<NEW_LINE>internalRepresentation = org.neo4j.driver.Config.TrustStrategy.trustAllCertificates();<NEW_LINE>break;<NEW_LINE>case TRUST_SYSTEM_CA_SIGNED_CERTIFICATES:<NEW_LINE>internalRepresentation = org.neo4j.driver.Config.TrustStrategy.trustSystemCertificates();<NEW_LINE>break;<NEW_LINE>case TRUST_CUSTOM_CA_SIGNED_CERTIFICATES:<NEW_LINE>if (certFile == null) {<NEW_LINE>throw new Neo4jException("Configured trust trustStrategy " + trustStrategy.name() + " requires a certificate file, " + "configured through builder, or using trustsettings.certificate " + "configuration property.");<NEW_LINE>}<NEW_LINE>if (Files.isRegularFile(certFile)) {<NEW_LINE>internalRepresentation = org.neo4j.driver.Config.TrustStrategy.trustCustomCertificateSignedBy(certFile.toFile());<NEW_LINE>} else {<NEW_LINE>throw new Neo4jException("Configured trust trustStrategy requires a certificate file, but got: " + certFile.toAbsolutePath());<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new Neo4jException("Unknown trust trustStrategy: " + this.trustStrategy.name());<NEW_LINE>}<NEW_LINE>if (hostnameVerificationEnabled) {<NEW_LINE>internalRepresentation.withHostnameVerification();<NEW_LINE>} else {<NEW_LINE>internalRepresentation.withoutHostnameVerification();<NEW_LINE>}<NEW_LINE>return internalRepresentation;<NEW_LINE>}
neo4j.driver.Config.TrustStrategy internalRepresentation;
1,416,452
public Prel visitExchange(ExchangePrel prel, MajorFragmentStat parent) throws RuntimeException {<NEW_LINE>parent.add(prel);<NEW_LINE>MajorFragmentStat newFrag = new MajorFragmentStat();<NEW_LINE>newFrag.<MASK><NEW_LINE>if (prel instanceof SingleMergeExchangePrel) {<NEW_LINE>newFrag.isSimpleRel = true;<NEW_LINE>}<NEW_LINE>Prel newChild = ((Prel) prel.getInput()).accept(this, newFrag);<NEW_LINE>if (parent.isSimpleRel && prel instanceof HashToMergeExchangePrel) {<NEW_LINE>return newChild;<NEW_LINE>}<NEW_LINE>if (canRemoveExchange(parent, newFrag)) {<NEW_LINE>return newChild;<NEW_LINE>} else if (newChild != prel.getInput()) {<NEW_LINE>return (Prel) prel.copy(prel.getTraitSet(), Collections.singletonList(newChild));<NEW_LINE>} else {<NEW_LINE>return prel;<NEW_LINE>}<NEW_LINE>}
setRightSideOfLateral(parent.isRightSideOfLateral());
1,726,172
public void readOnPlacement(@Nullable LivingEntity placer, ItemStack stack) {<NEW_LINE>if (stack.hasTag()) {<NEW_LINE>CompoundTag tag = stack.getOrCreateTag();<NEW_LINE>if (tag.contains("owner", NBT.TAG_STRING))<NEW_LINE>this.owner = tag.getString("owner");<NEW_LINE>else if (placer != null)<NEW_LINE>this.owner = placer<MASK><NEW_LINE>if (tag.contains("targetList", NBT.TAG_LIST)) {<NEW_LINE>ListTag list = tag.getList("targetList", 8);<NEW_LINE>targetList.clear();<NEW_LINE>for (int i = 0; i < list.size(); i++) targetList.add(list.getString(i));<NEW_LINE>} else if (owner != null)<NEW_LINE>targetList.add(owner);<NEW_LINE>if (tag.contains("whitelist", NBT.TAG_BYTE))<NEW_LINE>whitelist = tag.getBoolean("whitelist");<NEW_LINE>if (tag.contains("attackAnimals", NBT.TAG_BYTE))<NEW_LINE>attackAnimals = tag.getBoolean("attackAnimals");<NEW_LINE>if (tag.contains("attackPlayers", NBT.TAG_BYTE))<NEW_LINE>attackPlayers = tag.getBoolean("attackPlayers");<NEW_LINE>if (tag.contains("attackNeutrals", NBT.TAG_BYTE))<NEW_LINE>attackNeutrals = tag.getBoolean("attackNeutrals");<NEW_LINE>if (tag.contains("redstoneControlInverted", NBT.TAG_BYTE))<NEW_LINE>redstoneControlInverted = tag.getBoolean("redstoneControlInverted");<NEW_LINE>} else if (placer != null) {<NEW_LINE>this.owner = placer.getName().getString();<NEW_LINE>targetList.add(owner);<NEW_LINE>}<NEW_LINE>}
.getName().getString();
1,038,456
public static synchronized void writeToOneWire(String pvDevicePropertyPath, String pvValue) {<NEW_LINE>int lvAttempt = 1;<NEW_LINE>while (lvAttempt <= cvRetry) {<NEW_LINE>try {<NEW_LINE>logger.debug("Trying to write '{}' to '{}', write attempt={}", pvValue, pvDevicePropertyPath, lvAttempt);<NEW_LINE>if (checkIfDeviceExists(pvDevicePropertyPath)) {<NEW_LINE>OneWireConnection.getConnection().write(pvDevicePropertyPath, pvValue);<NEW_LINE>// Success, exit<NEW_LINE>return;<NEW_LINE>} else {<NEW_LINE>logger.info("There is no device for path {}, write attempt={}", pvDevicePropertyPath, lvAttempt);<NEW_LINE>}<NEW_LINE>} catch (OwfsException oe) {<NEW_LINE>logger.error("Writing {} to path {} attempt {} threw an exception", pvValue, pvDevicePropertyPath, lvAttempt, oe);<NEW_LINE>reconnect();<NEW_LINE>} catch (IOException ioe) {<NEW_LINE>logger.error("Couldn't establish network connection while write attempt {} to '{}' ip:port={}:{}", lvAttempt, <MASK><NEW_LINE>reconnect();<NEW_LINE>} finally {<NEW_LINE>lvAttempt++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
pvDevicePropertyPath, cvIp, cvPort, ioe);
1,837,575
public DescribeContinuousBackupsResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DescribeContinuousBackupsResult describeContinuousBackupsResult = new DescribeContinuousBackupsResult();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return describeContinuousBackupsResult;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("ContinuousBackupsDescription", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>describeContinuousBackupsResult.setContinuousBackupsDescription(ContinuousBackupsDescriptionJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return describeContinuousBackupsResult;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
267,221
public WebResponse invokeProtectedResource(String testcase, WebConversation wc, String accessToken, String where, TestSettings settings, List<validationData> expectations, String currentAction) throws Exception {<NEW_LINE>String thisMethod = "invokeProtectedResource";<NEW_LINE>msgUtils.printMethodName(thisMethod);<NEW_LINE>WebResponse response = null;<NEW_LINE>WebRequest request = null;<NEW_LINE>try {<NEW_LINE>setMarkToEndOfAllServersLogs();<NEW_LINE>// Invoke protected resource<NEW_LINE>request = new GetMethodWebRequest(settings.getProtectedResource());<NEW_LINE>if (accessToken != null && where != null) {<NEW_LINE>if (where.equals(Constants.PARM)) {<NEW_LINE>request.setParameter(Constants.ACCESS_TOKEN_KEY, accessToken);<NEW_LINE>// throw new<NEW_LINE>// Exception("A valid access token was not passed into invokeProtectedResource")<NEW_LINE>// ;<NEW_LINE>} else {<NEW_LINE>request.setHeaderField(Constants.AUTHORIZATION, Constants.BEARER + " " + accessToken);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>msgUtils.printRequestParts(request, thisMethod, "Request for " + currentAction);<NEW_LINE>response = wc.getResponse(request);<NEW_LINE>msgUtils.<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>validationTools.validateException(expectations, currentAction, e);<NEW_LINE>}<NEW_LINE>validationTools.validateResult(response, currentAction, expectations, settings);<NEW_LINE>return response;<NEW_LINE>}
printResponseParts(response, thisMethod, "Response from protected app: ");
557,964
public Object invoke(ObjectName objectName, String operationName, Object[] params, String[] signature) throws JmxException {<NEW_LINE>if (LOG.isLoggable(Level.INFO)) {<NEW_LINE>LOG.info("Invoking an MBean operation");<NEW_LINE>PropertyMap args = new PropertyMap();<NEW_LINE>args.put("Object Name", objectName);<NEW_LINE>args.put("Operation Name", operationName);<NEW_LINE>args.put("Param", params);<NEW_LINE><MASK><NEW_LINE>args.log(Level.INFO, " ", false);<NEW_LINE>}<NEW_LINE>Object result;<NEW_LINE>try {<NEW_LINE>MBeanServerConnection conn = this.getMBeanServerConnection();<NEW_LINE>// String handback = "Operation: " + operationName;<NEW_LINE>// ApplicationMBeanListener listener = new ApplicationMBeanListener();<NEW_LINE>// conn.addNotificationListener(name, listener, null, handback);<NEW_LINE>result = conn.invoke(objectName, operationName, params, signature);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new JmxException("Failed to invoke the \"" + operationName + "\" operation on " + objectName, e);<NEW_LINE>}<NEW_LINE>if (LOG.isLoggable(Level.INFO)) {<NEW_LINE>LOG.info("MBean operation completed. Result: " + result);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
args.put("Signature", signature);
713,271
public TAlterTabletReq toThrift() {<NEW_LINE>TAlterTabletReq tAlterTabletReq = new TAlterTabletReq();<NEW_LINE>tAlterTabletReq.setBase_tablet_id(baseTabletId);<NEW_LINE>tAlterTabletReq.setBase_schema_hash(baseSchemaHash);<NEW_LINE>// make 1 TCreateTableReq<NEW_LINE>TCreateTabletReq createTabletReq = new TCreateTabletReq();<NEW_LINE>createTabletReq.setTablet_id(tabletId);<NEW_LINE>// no need to set version<NEW_LINE>// schema<NEW_LINE>TTabletSchema tSchema = new TTabletSchema();<NEW_LINE>tSchema.setShort_key_column_count(shortKeyColumnCount);<NEW_LINE>tSchema.setSchema_hash(rollupSchemaHash);<NEW_LINE>tSchema.setStorage_type(storageType);<NEW_LINE>tSchema.setKeys_type(keysType);<NEW_LINE>List<TColumn> tColumns <MASK><NEW_LINE>for (Column column : rollupColumns) {<NEW_LINE>TColumn tColumn = column.toThrift();<NEW_LINE>// is bloom filter column<NEW_LINE>if (bfColumns != null && bfColumns.contains(column.getName())) {<NEW_LINE>tColumn.setIs_bloom_filter_column(true);<NEW_LINE>}<NEW_LINE>tColumns.add(tColumn);<NEW_LINE>}<NEW_LINE>tSchema.setColumns(tColumns);<NEW_LINE>if (bfColumns != null) {<NEW_LINE>tSchema.setBloom_filter_fpp(bfFpp);<NEW_LINE>}<NEW_LINE>createTabletReq.setTablet_schema(tSchema);<NEW_LINE>createTabletReq.setTable_id(tableId);<NEW_LINE>createTabletReq.setPartition_id(partitionId);<NEW_LINE>tAlterTabletReq.setNew_tablet_req(createTabletReq);<NEW_LINE>return tAlterTabletReq;<NEW_LINE>}
= new ArrayList<TColumn>();
555,742
public URL toURL() {<NEW_LINE>if (url == null) {<NEW_LINE>if (file != null) {<NEW_LINE>try {<NEW_LINE>url = file.toURI().toURL();<NEW_LINE>} catch (MalformedURLException e) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>logger.log(Level.FINE, "Exception thrown when constructing URL from file name " + file.getAbsolutePath());<NEW_LINE>}<NEW_LINE>} else if (parent != null && parent.getName().endsWith(FILE_EXT_JAR)) {<NEW_LINE>String jarPath = parent<MASK><NEW_LINE>try {<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>url = new URL("jar:file:" + jarPath + "!/" + name);<NEW_LINE>} catch (MalformedURLException e) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>logger.// $NON-NLS-1$<NEW_LINE>log(// $NON-NLS-1$<NEW_LINE>Level.FINE, // $NON-NLS-1$<NEW_LINE>"Exception thrown when constructing URL from jar file name " + jarPath + " and class file name " + name);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return url;<NEW_LINE>}
.getFile().getAbsolutePath();
790,716
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {<NEW_LINE>int topOffset = 0;<NEW_LINE>// TODO - other option is to let the painting of the dark border to the inner component and make this border's insets smaller.<NEW_LINE>if (c instanceof JComponent) {<NEW_LINE>JComponent jc = (JComponent) c;<NEW_LINE>Integer in = (Integer) jc.getClientProperty("MultiViewBorderHack.topOffset");<NEW_LINE>topOffset = in == null ? topOffset : in.intValue();<NEW_LINE>}<NEW_LINE>g.translate(x, y);<NEW_LINE>// NOI18N<NEW_LINE>g.setColor(UIManager.getColor("InternalFrame.borderShadow"));<NEW_LINE>g.drawLine(0, 0, 0, height - 1);<NEW_LINE>if (topOffset != 0) {<NEW_LINE>g.drawLine(1, topOffset - 1, 1, topOffset);<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>g.setColor(UIManager.getColor("InternalFrame.borderDarkShadow"));<NEW_LINE>g.drawLine(1, topOffset, 1, height - 2);<NEW_LINE>// NOI18N<NEW_LINE>g.setColor(UIManager.getColor("InternalFrame.borderHighlight"));<NEW_LINE>g.drawLine(1, height - 1, width - 1, height - 1);<NEW_LINE>g.drawLine(width - 1, height - 2, width - 1, 0);<NEW_LINE>// NOI18N<NEW_LINE>g.setColor(UIManager.getColor("InternalFrame.borderLight"));<NEW_LINE>g.drawLine(2, height - 2, width - 2, height - 2);<NEW_LINE>g.drawLine(width - 2, height - <MASK><NEW_LINE>g.translate(-x, -y);<NEW_LINE>}
3, width - 2, 0);
18,354
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {<NEW_LINE><MASK><NEW_LINE>if (mname.equals("toString")) {<NEW_LINE>return "SpunPhadhailListener<" + l + ">";<NEW_LINE>} else if (mname.equals("equals")) {<NEW_LINE>return args[0] == l ? Boolean.TRUE : Boolean.FALSE;<NEW_LINE>} else if (mname.equals("hashCode")) {<NEW_LINE>return new Integer(l.hashCode());<NEW_LINE>} else {<NEW_LINE>assert mname.endsWith("Changed") : mname;<NEW_LINE>assert EventQueue.isDispatchThread() : mname;<NEW_LINE>assert args != null;<NEW_LINE>assert args.length == 1;<NEW_LINE>Object arg2;<NEW_LINE>// Need to translate the original Phadhail event source to the proxy.<NEW_LINE>if (mname.equals("childrenChanged")) {<NEW_LINE>arg2 = PhadhailEvent.create(ph);<NEW_LINE>} else {<NEW_LINE>assert mname.equals("nameChanged");<NEW_LINE>PhadhailNameEvent orig = (PhadhailNameEvent) args[0];<NEW_LINE>arg2 = PhadhailNameEvent.create(ph, orig.getOldName(), orig.getNewName());<NEW_LINE>}<NEW_LINE>return super.invoke(proxy, method, new Object[] { arg2 });<NEW_LINE>}<NEW_LINE>}
String mname = method.getName();
1,830,257
private void reset(long key0, long key1, long key2, long key3) {<NEW_LINE>mul0[0] = 0xdbe6d5d5fe4cce2fL;<NEW_LINE>mul0[1] = 0xa4093822299f31d0L;<NEW_LINE>mul0[2] = 0x13198a2e03707344L;<NEW_LINE>mul0[3] = 0x243f6a8885a308d3L;<NEW_LINE>mul1[0] = 0x3bd39e10cb0ef593L;<NEW_LINE>mul1[1] = 0xc0acf169b5f18a8cL;<NEW_LINE>mul1[2] = 0xbe5466cf34e90c6cL;<NEW_LINE>mul1[3] = 0x452821e638d01377L;<NEW_LINE>v0[0] = mul0[0] ^ key0;<NEW_LINE>v0[1] = mul0[1] ^ key1;<NEW_LINE>v0[2] = mul0[2] ^ key2;<NEW_LINE>v0[3] = mul0[3] ^ key3;<NEW_LINE>v1[0] = mul1[0] ^ ((key0 >>> 32) | (key0 << 32));<NEW_LINE>v1[1] = mul1[1] ^ ((key1 >>> 32) | (key1 << 32));<NEW_LINE>v1[2] = mul1[2] ^ ((key2 >>> 32) | (key2 << 32));<NEW_LINE>v1[3] = mul1[3] ^ ((key3 >>> 32<MASK><NEW_LINE>}
) | (key3 << 32));
122,587
protected Node shallowClone(Node node) {<NEW_LINE>Node clone = node.cloneNode(false);<NEW_LINE>if (needsDebugData) {<NEW_LINE>Nodes.setFilePositionFor(clone<MASK><NEW_LINE>}<NEW_LINE>switch(node.getNodeType()) {<NEW_LINE>case Node.ATTRIBUTE_NODE:<NEW_LINE>if (needsDebugData) {<NEW_LINE>Nodes.setFilePositionForValue((Attr) clone, Nodes.getFilePositionForValue((Attr) node));<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case Node.ELEMENT_NODE:<NEW_LINE>Element el = (Element) node;<NEW_LINE>Element cloneEl = (Element) clone;<NEW_LINE>NamedNodeMap attrs = el.getAttributes();<NEW_LINE>for (int i = 0, n = attrs.getLength(); i < n; ++i) {<NEW_LINE>Attr a = (Attr) attrs.item(i);<NEW_LINE>Attr cloneA = cloneEl.getAttributeNodeNS(a.getNamespaceURI(), a.getLocalName());<NEW_LINE>if (needsDebugData) {<NEW_LINE>Nodes.setFilePositionFor(cloneA, Nodes.getFilePositionFor(a));<NEW_LINE>Nodes.setFilePositionForValue(cloneA, Nodes.getFilePositionForValue(a));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case Node.TEXT_NODE:<NEW_LINE>case Node.CDATA_SECTION_NODE:<NEW_LINE>if (needsDebugData) {<NEW_LINE>Text t = (Text) node;<NEW_LINE>Nodes.setRawText(t, Nodes.getRawText(t));<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>return clone;<NEW_LINE>}
, Nodes.getFilePositionFor(node));
284,866
private List<Token> translateFormattedTokens(int startPosition, List<Token> formattedTokens, int[] positionMapping, HashMap<Token, Token> translationMap) {<NEW_LINE>int previousLineBreaks = 0;<NEW_LINE>List<Token> result = new ArrayList<>();<NEW_LINE>for (Token token : formattedTokens) {<NEW_LINE>int newStart = Arrays.<MASK><NEW_LINE>while (newStart > 0 && positionMapping[newStart - 1] == token.originalStart) newStart--;<NEW_LINE>int newEnd = Arrays.binarySearch(positionMapping, token.originalEnd);<NEW_LINE>while (newEnd + 1 < positionMapping.length && positionMapping[newEnd + 1] == token.originalEnd) newEnd++;<NEW_LINE>Token translated = new Token(token, newStart + startPosition, newEnd + startPosition, token.tokenType);<NEW_LINE>if (translated.getWrapPolicy() == null)<NEW_LINE>translated.setWrapPolicy(WrapPolicy.DISABLE_WRAP);<NEW_LINE>if (token.hasNLSTag()) {<NEW_LINE>if (translationMap == null)<NEW_LINE>translationMap = new HashMap<>();<NEW_LINE>Token translatedNLS = translationMap.get(token.getNLSTag());<NEW_LINE>if (translatedNLS != null) {<NEW_LINE>translatedNLS.setNLSTag(translated);<NEW_LINE>translated.setNLSTag(translatedNLS);<NEW_LINE>} else {<NEW_LINE>translationMap.put(token, translated);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int lineBreaks = Math.max(previousLineBreaks, token.getLineBreaksBefore());<NEW_LINE>List<Token> structure = token.getInternalStructure();<NEW_LINE>if (structure != null && !structure.isEmpty()) {<NEW_LINE>translated.setInternalStructure(translateFormattedTokens(startPosition, structure, positionMapping, translationMap));<NEW_LINE>}<NEW_LINE>translated.putLineBreaksBefore(lineBreaks);<NEW_LINE>result.add(translated);<NEW_LINE>previousLineBreaks = token.getLineBreaksAfter();<NEW_LINE>}<NEW_LINE>result.get(result.size() - 1).putLineBreaksAfter(previousLineBreaks);<NEW_LINE>return result;<NEW_LINE>}
binarySearch(positionMapping, token.originalStart);
1,673,654
private void handlePotentialClipboardGeocode() {<NEW_LINE>binding.geocodeInputLayout.postDelayed(() -> {<NEW_LINE>final <MASK><NEW_LINE>String geocode = "";<NEW_LINE>if (ConnectorFactory.getConnector(clipboardText) instanceof ISearchByGeocode) {<NEW_LINE>geocode = clipboardText;<NEW_LINE>} else {<NEW_LINE>geocode = ConnectorFactory.getGeocodeFromText(clipboardText);<NEW_LINE>}<NEW_LINE>if (!StringUtils.isEmpty(geocode)) {<NEW_LINE>binding.geocode.setText(geocode);<NEW_LINE>binding.geocodeInputLayout.setHelperText(getString(R.string.search_geocode_from_clipboard));<NEW_LINE>// clear hint if text input get changed<NEW_LINE>binding.geocode.addTextChangedListener(new TextWatcher() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void beforeTextChanged(final CharSequence s, final int start, final int count, final int after) {<NEW_LINE>// nothing<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onTextChanged(final CharSequence s, final int start, final int before, final int count) {<NEW_LINE>// nothing<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void afterTextChanged(final Editable s) {<NEW_LINE>binding.geocodeInputLayout.setHelperText(null);<NEW_LINE>binding.geocode.removeTextChangedListener(this);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}, 500);<NEW_LINE>}
String clipboardText = ClipboardUtils.getText();
1,530,722
public static APIGetCandidatePrimaryStoragesForCreatingVmReply __example__() {<NEW_LINE>APIGetCandidatePrimaryStoragesForCreatingVmReply reply = new APIGetCandidatePrimaryStoragesForCreatingVmReply();<NEW_LINE>PrimaryStorageInventory lsInv = new PrimaryStorageInventory();<NEW_LINE>lsInv.setName("example");<NEW_LINE>lsInv.setDescription("example");<NEW_LINE>lsInv.setUuid(uuid());<NEW_LINE>lsInv.setAttachedClusterUuids(asList(uuid()));<NEW_LINE>lsInv.setAvailableCapacity(SizeUnit.GIGABYTE.toByte(200L));<NEW_LINE>lsInv.setAvailablePhysicalCapacity(SizeUnit.GIGABYTE.toByte(200L));<NEW_LINE>lsInv.setTotalCapacity(SizeUnit.GIGABYTE.toByte(300L));<NEW_LINE>lsInv.setTotalPhysicalCapacity(SizeUnit.GIGABYTE.toByte(300L));<NEW_LINE>lsInv.setState(PrimaryStorageState.Enabled.toString());<NEW_LINE>lsInv.setStatus(PrimaryStorageStatus.Connected.toString());<NEW_LINE>lsInv.setType("LocalStorage");<NEW_LINE>lsInv.setCreateDate(new Timestamp(org.zstack.header.message.DocUtils.date));<NEW_LINE>lsInv.setLastOpDate(new Timestamp(org.zstack.header.message.DocUtils.date));<NEW_LINE>lsInv.setUrl("/zstack_ps");<NEW_LINE>PrimaryStorageInventory nfsInv = new PrimaryStorageInventory();<NEW_LINE>String uuid = uuid();<NEW_LINE>nfsInv.setName("example");<NEW_LINE>nfsInv.setDescription("example");<NEW_LINE>nfsInv.setUuid(uuid);<NEW_LINE>nfsInv.setAttachedClusterUuids(asList(uuid()));<NEW_LINE>nfsInv.setAvailableCapacity(SizeUnit.GIGABYTE.toByte(200L));<NEW_LINE>nfsInv.setAvailablePhysicalCapacity(SizeUnit.GIGABYTE.toByte(200L));<NEW_LINE>nfsInv.setTotalCapacity(SizeUnit.GIGABYTE.toByte(300L));<NEW_LINE>nfsInv.setTotalPhysicalCapacity(SizeUnit.GIGABYTE.toByte(300L));<NEW_LINE>nfsInv.setState(PrimaryStorageState.Enabled.toString());<NEW_LINE>nfsInv.setStatus(PrimaryStorageStatus.Connected.toString());<NEW_LINE>nfsInv.setType("NFS");<NEW_LINE>nfsInv.setCreateDate(new Timestamp(org.zstack.header.message.DocUtils.date));<NEW_LINE>nfsInv.setLastOpDate(new Timestamp(org.zstack.header.message.DocUtils.date));<NEW_LINE>nfsInv.setUrl("/opt/zstack/nfsprimarystorage/prim-" + uuid);<NEW_LINE>reply.getDataVolumePrimaryStorages().put(uuid<MASK><NEW_LINE>reply.setRootVolumePrimaryStorages(asList(lsInv));<NEW_LINE>return reply;<NEW_LINE>}
(), asList(nfsInv));
1,717,583
public void actionPerformed(ActionEvent e) {<NEW_LINE>if (e.getSource() instanceof JComponent) {<NEW_LINE>String name = ((JComponent) e.getSource()).getName();<NEW_LINE>if (name.startsWith("MSG_DONT_SHOW_AGAIN")) {<NEW_LINE>Config.getInstance().setShowDownloadCompleteWindow(!chkDontShow.isSelected());<NEW_LINE>} else if (name.equals("CLOSE")) {<NEW_LINE>dispose();<NEW_LINE>} else if (name.equals("CTX_OPEN_FILE")) {<NEW_LINE>try {<NEW_LINE>XDMUtils.openFile(txtFile.getText(), txtFolder.getText());<NEW_LINE>dispose();<NEW_LINE>} catch (Exception e1) {<NEW_LINE>Logger.log(e1);<NEW_LINE>}<NEW_LINE>} else if (name.equals("CTX_OPEN_FOLDER")) {<NEW_LINE>try {<NEW_LINE>XDMUtils.openFolder(txtFile.getText(<MASK><NEW_LINE>dispose();<NEW_LINE>} catch (Exception e1) {<NEW_LINE>Logger.log(e1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
), txtFolder.getText());
188,877
public Request<DescribeConversionTasksRequest> marshall(DescribeConversionTasksRequest describeConversionTasksRequest) {<NEW_LINE>if (describeConversionTasksRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<DescribeConversionTasksRequest> request = new DefaultRequest<DescribeConversionTasksRequest>(describeConversionTasksRequest, "AmazonEC2");<NEW_LINE>request.addParameter("Action", "DescribeConversionTasks");<NEW_LINE>request.addParameter("Version", "2016-11-15");<NEW_LINE><MASK><NEW_LINE>com.amazonaws.internal.SdkInternalList<String> describeConversionTasksRequestConversionTaskIdsList = (com.amazonaws.internal.SdkInternalList<String>) describeConversionTasksRequest.getConversionTaskIds();<NEW_LINE>if (!describeConversionTasksRequestConversionTaskIdsList.isEmpty() || !describeConversionTasksRequestConversionTaskIdsList.isAutoConstruct()) {<NEW_LINE>int conversionTaskIdsListIndex = 1;<NEW_LINE>for (String describeConversionTasksRequestConversionTaskIdsListValue : describeConversionTasksRequestConversionTaskIdsList) {<NEW_LINE>if (describeConversionTasksRequestConversionTaskIdsListValue != null) {<NEW_LINE>request.addParameter("ConversionTaskId." + conversionTaskIdsListIndex, StringUtils.fromString(describeConversionTasksRequestConversionTaskIdsListValue));<NEW_LINE>}<NEW_LINE>conversionTaskIdsListIndex++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
request.setHttpMethod(HttpMethodName.POST);
202,285
public void handleMessage(int group, byte cmd1, Msg msg, DeviceFeature f, String fromPort) {<NEW_LINE>InsteonDevice dev = f.getDevice();<NEW_LINE>if (!msg.isExtended()) {<NEW_LINE>logger.trace("{} device {} ignoring non-extended msg {}", nm(), dev.getAddress(), msg);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>int cmd2 = msg.getByte("command2") & 0xff;<NEW_LINE>switch(cmd2) {<NEW_LINE>case // this is a product data response message<NEW_LINE>0x00:<NEW_LINE>int batteryLevel = <MASK><NEW_LINE>int batteryWatermark = msg.getByte("userData7") & 0xff;<NEW_LINE>logger.debug("{}: {} got light level: {}, battery level: {}", nm(), dev.getAddress(), batteryWatermark, batteryLevel);<NEW_LINE>m_feature.publish(new DecimalType(batteryWatermark), StateChangeType.CHANGED, "field", "battery_watermark_level");<NEW_LINE>m_feature.publish(new DecimalType(batteryLevel), StateChangeType.CHANGED, "field", "battery_level");<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>logger.warn("unknown cmd2 = {} in info reply message {}", cmd2, msg);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} catch (FieldException e) {<NEW_LINE>logger.error("error parsing {}: ", msg, e);<NEW_LINE>}<NEW_LINE>}
msg.getByte("userData4") & 0xff;
1,657,762
public Publisher<Collection<ServiceDiscovererEvent<R>>> discover(final U ignoredAddress) {<NEW_LINE>return newGroup.filter(new Predicate<PSDE>() {<NEW_LINE><NEW_LINE>// Use a mutable Count to avoid boxing-unboxing and put on each call.<NEW_LINE>private final Map<R, MutableInt> <MASK><NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean test(PSDE evt) {<NEW_LINE>if (EXPIRED.equals(evt.status())) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>MutableInt counter = addressCount.computeIfAbsent(evt.address(), __ -> new MutableInt());<NEW_LINE>boolean acceptEvent;<NEW_LINE>if (UNAVAILABLE.equals(evt.status())) {<NEW_LINE>acceptEvent = --counter.value == 0;<NEW_LINE>if (acceptEvent) {<NEW_LINE>// If address is unavailable and no more add events are pending stop tracking and<NEW_LINE>// close partition.<NEW_LINE>addressCount.remove(evt.address());<NEW_LINE>if (addressCount.isEmpty()) {<NEW_LINE>// closeNow will subscribe to closeAsync() so we do not have to here.<NEW_LINE>partition.closeNow();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>acceptEvent = ++counter.value == 1;<NEW_LINE>}<NEW_LINE>return acceptEvent;<NEW_LINE>}<NEW_LINE>}).beforeFinally(partition::closeNow).map(Collections::singletonList);<NEW_LINE>}
addressCount = new HashMap<>();
1,423,265
public ServerAuthorConfigurationResponse updateAuditLogDestination(String userId, String serverName, String serverToBeConfiguredName, String auditLogDestinationName, Connection auditLogDestination) {<NEW_LINE>final String methodName = "updateAuditLogDestination";<NEW_LINE>RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);<NEW_LINE>ServerAuthorConfigurationResponse response = new ServerAuthorConfigurationResponse();<NEW_LINE>AuditLog auditLog = null;<NEW_LINE>try {<NEW_LINE>auditLog = instanceHandler.getAuditLog(userId, serverName, methodName);<NEW_LINE>ServerAuthorViewHandler serverAuthorViewHandler = instanceHandler.getServerAuthorViewHandler(userId, serverName, methodName);<NEW_LINE>serverAuthorViewHandler.updateAuditLogDestination(className, methodName, serverToBeConfiguredName, auditLogDestinationName, auditLogDestination);<NEW_LINE>response = getStoredConfiguration(userId, serverName, serverToBeConfiguredName);<NEW_LINE>} catch (ServerAuthorViewServiceException error) {<NEW_LINE>ServerAuthorExceptionHandler.captureCheckedException(response, error, className);<NEW_LINE>} catch (Exception exception) {<NEW_LINE>restExceptionHandler.captureExceptions(response, exception, methodName, auditLog);<NEW_LINE>}<NEW_LINE>restCallLogger.logRESTCallReturn(<MASK><NEW_LINE>return response;<NEW_LINE>}
token, response.toString());
903,511
public String dumpTopology() {<NEW_LINE>Map<String, String> rack = getSwitchMap();<NEW_LINE>StringBuilder builder = new StringBuilder();<NEW_LINE>builder.append("Mapping: ").append(toString()).append("\n");<NEW_LINE>if (rack != null) {<NEW_LINE>builder.append("Map:\n");<NEW_LINE>Set<String> switches = new HashSet<String>();<NEW_LINE>for (Map.Entry<String, String> entry : rack.entrySet()) {<NEW_LINE>builder.append(" ").append(entry.getKey()).append(" -> ").append(entry.getValue()).append("\n");<NEW_LINE>switches.<MASK><NEW_LINE>}<NEW_LINE>builder.append("Nodes: ").append(rack.size()).append("\n");<NEW_LINE>builder.append("Switches: ").append(switches.size()).append("\n");<NEW_LINE>} else {<NEW_LINE>builder.append("No topology information");<NEW_LINE>}<NEW_LINE>return builder.toString();<NEW_LINE>}
add(entry.getValue());
221,792
public void operationComplete(final Future<PooledConnection> connectResult) {<NEW_LINE>// MUST run this within bindingcontext to support ThreadVariables.<NEW_LINE>try {<NEW_LINE>methodBinding.bind(() -> {<NEW_LINE>DiscoveryResult server = chosenServer.get();<NEW_LINE>if (server != DiscoveryResult.EMPTY) {<NEW_LINE>if (currentRequestStat != null) {<NEW_LINE>currentRequestStat.server(server);<NEW_LINE>}<NEW_LINE>origin.onRequestStartWithServer(zuulRequest, server, attemptNum);<NEW_LINE>}<NEW_LINE>// Handle the connection establishment result.<NEW_LINE>if (connectResult.isSuccess()) {<NEW_LINE>onOriginConnectSucceeded(connectResult.getNow(), timeLeftForAttempt);<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (Throwable ex) {<NEW_LINE>LOG.error("Uncaught error in operationComplete(). Closing the server channel now. {}", ChannelUtils.channelInfoForLogging(channelCtx.channel()), ex);<NEW_LINE>unlinkFromOrigin();<NEW_LINE>// Fire exception here to ensure that server channel gets closed, so clients don't hang.<NEW_LINE>channelCtx.fireExceptionCaught(ex);<NEW_LINE>}<NEW_LINE>}
onOriginConnectFailed(connectResult.cause());
806,234
private IMeasurementMNode constructTemplateTree(String path, IMeasurementSchema schema) throws IllegalPathException {<NEW_LINE>if (getPathNodeInTemplate(path) != null) {<NEW_LINE>throw new IllegalPathException("Path duplicated: " + path);<NEW_LINE>}<NEW_LINE>String[] pathNode = MetaUtils.splitPathToDetachedPath(path);<NEW_LINE>IMNode cur = constructEntityPath(path);<NEW_LINE>synchronized (this) {<NEW_LINE>IMeasurementMNode leafNode = MeasurementMNode.getMeasurementMNode((IEntityMNode) cur, pathNode[pathNode.length <MASK><NEW_LINE>if (cur == null) {<NEW_LINE>directNodes.put(leafNode.getName(), leafNode);<NEW_LINE>} else {<NEW_LINE>cur.addChild(leafNode);<NEW_LINE>}<NEW_LINE>schemaMap.put(getFullPathWithoutTemplateName(leafNode), schema);<NEW_LINE>measurementsCount++;<NEW_LINE>return leafNode;<NEW_LINE>}<NEW_LINE>}
- 1], schema, null);
1,097,514
public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException {<NEW_LINE>BulkRequest bulkRequest = Requests.bulkRequest();<NEW_LINE>String defaultIndex = request.param("index");<NEW_LINE>String defaultRouting = request.param("routing");<NEW_LINE>String defaultPipeline = request.param("pipeline");<NEW_LINE>Boolean defaultRequireAlias = <MASK><NEW_LINE>String waitForActiveShards = request.param("wait_for_active_shards");<NEW_LINE>if (waitForActiveShards != null) {<NEW_LINE>bulkRequest.waitForActiveShards(ActiveShardCount.parseString(waitForActiveShards));<NEW_LINE>}<NEW_LINE>bulkRequest.timeout(request.paramAsTime("timeout", BulkShardRequest.DEFAULT_TIMEOUT));<NEW_LINE>bulkRequest.setRefreshPolicy(request.param("refresh"));<NEW_LINE>bulkRequest.add(request.requiredContent(), defaultIndex, defaultRouting, null, defaultPipeline, defaultRequireAlias, true, request.getXContentType(), request.getRestApiVersion());<NEW_LINE>// short circuit the call to the transport layer<NEW_LINE>return channel -> {<NEW_LINE>BulkRestBuilderListener listener = new BulkRestBuilderListener(channel, request);<NEW_LINE>listener.onResponse(bulkRequest);<NEW_LINE>};<NEW_LINE>}
request.paramAsBoolean("require_alias", null);
1,061,184
private static void addBufferPoolMemoryInfo(Map<String, List<MemoryEntryVO>> memoryInfoMap) {<NEW_LINE>try {<NEW_LINE>List<MemoryEntryVO> bufferPoolMemEntries = new ArrayList<MemoryEntryVO>();<NEW_LINE>@SuppressWarnings("rawtypes")<NEW_LINE>Class bufferPoolMXBeanClass = Class.forName("java.lang.management.BufferPoolMXBean");<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>List<BufferPoolMXBean> bufferPoolMXBeans = ManagementFactory.getPlatformMXBeans(bufferPoolMXBeanClass);<NEW_LINE>for (BufferPoolMXBean mbean : bufferPoolMXBeans) {<NEW_LINE>long used = mbean.getMemoryUsed();<NEW_LINE>long total = mbean.getTotalCapacity();<NEW_LINE>bufferPoolMemEntries.add(new MemoryEntryVO(TYPE_BUFFER_POOL, mbean.getName(), used<MASK><NEW_LINE>}<NEW_LINE>memoryInfoMap.put(TYPE_BUFFER_POOL, bufferPoolMemEntries);<NEW_LINE>} catch (ClassNotFoundException e) {<NEW_LINE>// ignore<NEW_LINE>}<NEW_LINE>}
, total, Long.MIN_VALUE));
1,382,341
private org.nzbhydra.github.mavenreleaseplugin.Release createRelease(org.nzbhydra.github.mavenreleaseplugin.ReleaseRequest releaseRequest) throws IOException, MojoExecutionException {<NEW_LINE>getLog(<MASK><NEW_LINE>String requestBody = objectMapper.writeValueAsString(releaseRequest);<NEW_LINE>getLog().info("Sending body to create release: " + requestBody);<NEW_LINE>Builder callBuilder = new Builder().url(githubReleasesUrl).post(RequestBody.create(MediaType.parse("application/json"), requestBody));<NEW_LINE>callBuilder.header("Authorization", "token " + githubToken);<NEW_LINE>Call call = client.newCall(callBuilder.build());<NEW_LINE>Response response = call.execute();<NEW_LINE>if (!response.isSuccessful() || response.body() == null) {<NEW_LINE>throw new MojoExecutionException("When trying to create release with URL " + githubReleasesUrl + " Github returned code " + response.code() + " and message: " + response.message());<NEW_LINE>}<NEW_LINE>String body = response.body().string();<NEW_LINE>response.body().close();<NEW_LINE>try {<NEW_LINE>return objectMapper.readValue(body, org.nzbhydra.github.mavenreleaseplugin.Release.class);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new MojoExecutionException("Unable to parse GitHub's release response: " + body, e);<NEW_LINE>} finally {<NEW_LINE>getLog().info("Successfully created release");<NEW_LINE>}<NEW_LINE>}
).info("Creating release in draft mode using base URL " + githubReleasesUrl);