idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
243,897 | public static boolean isDesired(int currentFeature, int desiredFeatures, int maxFeatureStringLen) {<NEW_LINE>boolean bRet;<NEW_LINE>String str1 = Integer.toBinaryString(desiredFeatures);<NEW_LINE>String <MASK><NEW_LINE>if (maxFeatureStringLen < str1.length())<NEW_LINE>maxFeatureStringLen = str1.length();<NEW_LINE>if (maxFeatureStringLen < str2.length())<NEW_LINE>maxFeatureStringLen = str2.length();<NEW_LINE>while (str1.length() < maxFeatureStringLen) str1 = "0" + str1;<NEW_LINE>while (str2.length() < maxFeatureStringLen) str2 = "0" + str2;<NEW_LINE>bRet = false;<NEW_LINE>for (int i = 0; i < str1.length(); i++) {<NEW_LINE>if (Integer.valueOf(String.valueOf(str1.charAt(i))) == 1 && Integer.valueOf(String.valueOf(str2.charAt(i))) == 1) {<NEW_LINE>bRet = true;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return bRet;<NEW_LINE>} | str2 = Integer.toBinaryString(currentFeature); |
66,094 | final TerminateJobResult executeTerminateJob(TerminateJobRequest terminateJobRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(terminateJobRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<TerminateJobRequest> request = null;<NEW_LINE>Response<TerminateJobResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new TerminateJobRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(terminateJobRequest));<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(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Batch");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "TerminateJob");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<TerminateJobResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new TerminateJobResultJsonUnmarshaller());<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.SIGNING_REGION, getSigningRegion()); |
1,797,852 | public boolean onMenuItemClick(MenuItem item) {<NEW_LINE>switch(item.getItemId()) {<NEW_LINE>case R.id.play_with_vlc:<NEW_LINE>systemPreferences.getValue().set(SystemPreferences.Companion.getChosenPlayer(), PreferredVideoPlayer.VLC);<NEW_LINE>play(mBaseItem, 0, false);<NEW_LINE>return true;<NEW_LINE>case R.id.play_with_exo:<NEW_LINE>systemPreferences.getValue().set(SystemPreferences.Companion.getChosenPlayer(), PreferredVideoPlayer.EXOPLAYER);<NEW_LINE>play(mBaseItem, 0, false);<NEW_LINE>return true;<NEW_LINE>case R.id.play_with_external:<NEW_LINE>systemPreferences.getValue().set(SystemPreferences.Companion.getChosenPlayer(), PreferredVideoPlayer.EXTERNAL);<NEW_LINE>PlaybackHelper.getItemsToPlay(mBaseItem, false, false, new Response<List<BaseItemDto>>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onResponse(List<BaseItemDto> response) {<NEW_LINE>if (mBaseItem.getBaseItemType() == BaseItemType.MusicArtist) {<NEW_LINE>mediaManager.getValue().playNow(FullDetailsActivity.this, response, false);<NEW_LINE>} else {<NEW_LINE>Intent intent = new Intent(FullDetailsActivity.this, ExternalPlayerActivity.class);<NEW_LINE>mediaManager.<MASK><NEW_LINE>intent.putExtra("Position", 0);<NEW_LINE>startActivity(intent);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | getValue().setCurrentVideoQueue(response); |
1,359,795 | public RefactoringPlugin createInstance(AbstractRefactoring refactoring) {<NEW_LINE>if (!(refactoring instanceof WhereUsedQuery)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>TreePathHandle handle = refactoring.getRefactoringSource().lookup(TreePathHandle.class);<NEW_LINE>if (handle == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Tree.Kind kind = handle.getKind();<NEW_LINE>if (TreeUtilities.CLASS_TREE_KINDS.contains(kind) || kind == Tree.Kind.IDENTIFIER || kind == Tree.Kind.MEMBER_SELECT) {<NEW_LINE>FileObject fo = handle.getFileObject();<NEW_LINE>Project p = FileOwnerQuery.getOwner(fo);<NEW_LINE>if (p == null) {<NEW_LINE>FileObject root = FileUtil.getArchiveFile(fo);<NEW_LINE>if (root != null && root.getNameExt().endsWith("-sources.jar")) {<NEW_LINE>LOG.log(Level.FINE, "considering usages from {0} in a Maven binary artifact", fo.toURI());<NEW_LINE>return new MavenRefactoringPlugin((WhereUsedQuery) refactoring, handle);<NEW_LINE>} else {<NEW_LINE>LOG.log(Level.FINE, "binary file of no particular interest: {0}", fo.toURI());<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} else if (p.getLookup().lookup(NbMavenProject.class) != null) {<NEW_LINE>LOG.log(Level.FINE, "considering usages from {0} in a Maven project", fo.toURI());<NEW_LINE>return new MavenRefactoringPlugin((WhereUsedQuery) refactoring, handle);<NEW_LINE>} else {<NEW_LINE>LOG.log(Level.FINE, "not in a Maven project: {0}", fo.toURI());<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>LOG.log(Level.FINE, "ignoring {0} of kind {1}", new Object<MASK><NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} | [] { handle, kind }); |
1,132,472 | protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>setContentView(R.layout.activity_loadmore);<NEW_LINE>toolbar = (Toolbar) findViewById(R.id.tool_bar);<NEW_LINE>setSupportActionBar(toolbar);<NEW_LINE>getSupportActionBar().setDisplayShowTitleEnabled(false);<NEW_LINE>ultimateRecyclerView = (UltimateRecyclerView) <MASK><NEW_LINE>ultimateRecyclerView.setHasFixedSize(false);<NEW_LINE>List<String> stringList = new ArrayList<>();<NEW_LINE>stringList.add("111");<NEW_LINE>stringList.add("aaa");<NEW_LINE>stringList.add("222");<NEW_LINE>stringList.add("33");<NEW_LINE>stringList.add("44");<NEW_LINE>stringList.add("55");<NEW_LINE>simpleRecyclerViewAdapter = new MultiViewTypesRecyclerViewAdapter(stringList);<NEW_LINE>simpleRecyclerViewAdapter.setCustomLoadMoreView(LayoutInflater.from(this).inflate(R.layout.custom_bottom_progressbar, null));<NEW_LINE>// stringList.add("66");<NEW_LINE>// stringList.add("11771");<NEW_LINE>linearLayoutManager = new LinearLayoutManager(this);<NEW_LINE>ultimateRecyclerView.setLayoutManager(linearLayoutManager);<NEW_LINE>// ultimateRecyclerView.setAdapter(simpleRecyclerViewAdapter);<NEW_LINE>ultimateRecyclerView.setAdapter(simpleRecyclerViewAdapter);<NEW_LINE>ultimateRecyclerView.setDefaultOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onRefresh() {<NEW_LINE>new Handler().postDelayed(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>simpleRecyclerViewAdapter.insert("Refresh things", 0);<NEW_LINE>ultimateRecyclerView.setRefreshing(false);<NEW_LINE>// ultimateRecyclerView.scrollBy(0, -50);<NEW_LINE>linearLayoutManager.scrollToPosition(0);<NEW_LINE>}<NEW_LINE>}, 1000);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>Paint paint = new Paint();<NEW_LINE>paint.setStrokeWidth(5);<NEW_LINE>paint.setColor(Color.BLUE);<NEW_LINE>paint.setAntiAlias(true);<NEW_LINE>paint.setPathEffect(new DashPathEffect(new float[] { 25.0f, 25.0f }, 0));<NEW_LINE>if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) {<NEW_LINE>ultimateRecyclerView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);<NEW_LINE>}<NEW_LINE>ultimateRecyclerView.addItemDecoration(new HorizontalDividerItemDecoration.Builder(this).paint(paint).build());<NEW_LINE>// simpleRecyclerViewAdapter.ad<NEW_LINE>} | findViewById(R.id.ultimate_recycler_view); |
1,254,560 | public DashboardSearchFilter unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DashboardSearchFilter dashboardSearchFilter = new DashboardSearchFilter();<NEW_LINE>int originalDepth = context.getCurrentDepth();<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("Operator", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>dashboardSearchFilter.setOperator(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Name", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>dashboardSearchFilter.setName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Value", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>dashboardSearchFilter.setValue(context.getUnmarshaller(String.<MASK><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 dashboardSearchFilter;<NEW_LINE>} | class).unmarshall(context)); |
999,018 | private TranslationResults buildResults() {<NEW_LINE>TranslationResults results = new TranslationResults();<NEW_LINE>if (hasTotalClassLevelOrdering) {<NEW_LINE>for (String next : totalClassLevelOrdering) {<NEW_LINE>EjbInterceptor interceptor = ejbBundle.getInterceptorByClassName(next);<NEW_LINE>results.allInterceptorClasses.add(interceptor);<NEW_LINE>results.classInterceptorChain.add(interceptor);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>for (String next : defaultInterceptorChain) {<NEW_LINE>EjbInterceptor <MASK><NEW_LINE>results.allInterceptorClasses.add(interceptor);<NEW_LINE>results.classInterceptorChain.add(interceptor);<NEW_LINE>}<NEW_LINE>for (String next : classInterceptorChain) {<NEW_LINE>EjbInterceptor interceptor = ejbBundle.getInterceptorByClassName(next);<NEW_LINE>results.allInterceptorClasses.add(interceptor);<NEW_LINE>results.classInterceptorChain.add(interceptor);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (Entry<MethodDescriptor, LinkedList<String>> entry : methodInterceptorsMap.entrySet()) {<NEW_LINE>MethodDescriptor nextMethod = entry.getKey();<NEW_LINE>List<String> interceptorClassChain = (List<String>) entry.getValue();<NEW_LINE>List<EjbInterceptor> interceptorChain = new LinkedList<EjbInterceptor>();<NEW_LINE>for (String nextClass : interceptorClassChain) {<NEW_LINE>EjbInterceptor interceptor = ejbBundle.getInterceptorByClassName(nextClass);<NEW_LINE>results.allInterceptorClasses.add(interceptor);<NEW_LINE>interceptorChain.add(interceptor);<NEW_LINE>}<NEW_LINE>results.methodInterceptorsMap.put(nextMethod, interceptorChain);<NEW_LINE>}<NEW_LINE>return results;<NEW_LINE>} | interceptor = ejbBundle.getInterceptorByClassName(next); |
25,273 | public void bool(BoolCall<BadWordCQ> boolLambda, ConditionOptionCall<BoolQueryBuilder> opLambda) {<NEW_LINE>BadWordCQ mustQuery = new BadWordCQ();<NEW_LINE>BadWordCQ shouldQuery = new BadWordCQ();<NEW_LINE>BadWordCQ mustNotQuery = new BadWordCQ();<NEW_LINE>BadWordCQ filterQuery = new BadWordCQ();<NEW_LINE>boolLambda.callback(<MASK><NEW_LINE>if (mustQuery.hasQueries() || shouldQuery.hasQueries() || mustNotQuery.hasQueries() || filterQuery.hasQueries()) {<NEW_LINE>BoolQueryBuilder builder = regBoolCQ(mustQuery.getQueryBuilderList(), shouldQuery.getQueryBuilderList(), mustNotQuery.getQueryBuilderList(), filterQuery.getQueryBuilderList());<NEW_LINE>if (opLambda != null) {<NEW_LINE>opLambda.callback(builder);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | mustQuery, shouldQuery, mustNotQuery, filterQuery); |
1,128,574 | public Authentication convert(HttpServletRequest request) {<NEW_LINE>// grant_type (REQUIRED)<NEW_LINE>String grantType = request.getParameter(OAuth2ParameterNames.GRANT_TYPE);<NEW_LINE>if (!AuthorizationGrantType.REFRESH_TOKEN.getValue().equals(grantType)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Authentication clientPrincipal = SecurityContextHolder.getContext().getAuthentication();<NEW_LINE>MultiValueMap<String, String> parameters = OAuth2EndpointUtils.getParameters(request);<NEW_LINE>// refresh_token (REQUIRED)<NEW_LINE>String refreshToken = parameters.getFirst(OAuth2ParameterNames.REFRESH_TOKEN);<NEW_LINE>if (!StringUtils.hasText(refreshToken) || parameters.get(OAuth2ParameterNames.REFRESH_TOKEN).size() != 1) {<NEW_LINE>OAuth2EndpointUtils.throwError(OAuth2ErrorCodes.INVALID_REQUEST, OAuth2ParameterNames.REFRESH_TOKEN, OAuth2EndpointUtils.ACCESS_TOKEN_REQUEST_ERROR_URI);<NEW_LINE>}<NEW_LINE>// scope (OPTIONAL)<NEW_LINE>String scope = parameters.getFirst(OAuth2ParameterNames.SCOPE);<NEW_LINE>if (StringUtils.hasText(scope) && parameters.get(OAuth2ParameterNames.SCOPE).size() != 1) {<NEW_LINE>OAuth2EndpointUtils.throwError(OAuth2ErrorCodes.INVALID_REQUEST, OAuth2ParameterNames.SCOPE, OAuth2EndpointUtils.ACCESS_TOKEN_REQUEST_ERROR_URI);<NEW_LINE>}<NEW_LINE>Set<String> requestedScopes = null;<NEW_LINE>if (StringUtils.hasText(scope)) {<NEW_LINE>requestedScopes = new HashSet<>(Arrays.asList(StringUtils.<MASK><NEW_LINE>}<NEW_LINE>Map<String, Object> additionalParameters = new HashMap<>();<NEW_LINE>parameters.forEach((key, value) -> {<NEW_LINE>if (!key.equals(OAuth2ParameterNames.GRANT_TYPE) && !key.equals(OAuth2ParameterNames.REFRESH_TOKEN) && !key.equals(OAuth2ParameterNames.SCOPE)) {<NEW_LINE>additionalParameters.put(key, value.get(0));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return new OAuth2RefreshTokenAuthenticationToken(refreshToken, clientPrincipal, requestedScopes, additionalParameters);<NEW_LINE>} | delimitedListToStringArray(scope, " "))); |
1,571,654 | public void removeAttachment(@NonNull PermissionAttachment attachment) {<NEW_LINE><MASK><NEW_LINE>LuckPermsPermissionAttachment luckPermsAttachment;<NEW_LINE>if (!(attachment instanceof LuckPermsPermissionAttachment)) {<NEW_LINE>// try to find a match<NEW_LINE>LuckPermsPermissionAttachment match = this.hookedAttachments.stream().filter(at -> at.getSource() == attachment).findFirst().orElse(null);<NEW_LINE>if (match != null) {<NEW_LINE>luckPermsAttachment = match;<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("Given attachment is not a LPPermissionAttachment.");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>luckPermsAttachment = (LuckPermsPermissionAttachment) attachment;<NEW_LINE>}<NEW_LINE>if (luckPermsAttachment.getPermissible() != this) {<NEW_LINE>throw new IllegalArgumentException("Attachment does not belong to this permissible.");<NEW_LINE>}<NEW_LINE>luckPermsAttachment.remove();<NEW_LINE>} | Objects.requireNonNull(attachment, "attachment"); |
976,243 | public void dispose() {<NEW_LINE>channel.setMethodCallHandler(null);<NEW_LINE>activityResultListeners.clear();<NEW_LINE>if (methodCallDelegate != null) {<NEW_LINE>methodCallDelegate.dispose();<NEW_LINE>methodCallDelegate = null;<NEW_LINE>}<NEW_LINE>if (webView != null) {<NEW_LINE>if (manager.plugin.activityPluginBinding != null) {<NEW_LINE>manager.plugin.activityPluginBinding.removeActivityResultListener(webView.inAppWebViewChromeClient);<NEW_LINE>}<NEW_LINE>ViewGroup vg = (ViewGroup) (webView.getParent());<NEW_LINE>if (vg != null) {<NEW_LINE>vg.removeView(webView);<NEW_LINE>}<NEW_LINE>webView<MASK><NEW_LINE>webView.setWebViewClient(new WebViewClient() {<NEW_LINE><NEW_LINE>public void onPageFinished(WebView view, String url) {<NEW_LINE>webView.dispose();<NEW_LINE>webView.destroy();<NEW_LINE>webView = null;<NEW_LINE>manager = null;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>webView.loadUrl("about:blank");<NEW_LINE>finish();<NEW_LINE>}<NEW_LINE>} | .setWebChromeClient(new WebChromeClient()); |
373,334 | public static QueryFpDBDeleteJobListResponse unmarshall(QueryFpDBDeleteJobListResponse queryFpDBDeleteJobListResponse, UnmarshallerContext _ctx) {<NEW_LINE>queryFpDBDeleteJobListResponse.setRequestId(_ctx.stringValue("QueryFpDBDeleteJobListResponse.RequestId"));<NEW_LINE>List<String> nonExistIds = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("QueryFpDBDeleteJobListResponse.NonExistIds.Length"); i++) {<NEW_LINE>nonExistIds.add(_ctx.stringValue("QueryFpDBDeleteJobListResponse.NonExistIds[" + i + "]"));<NEW_LINE>}<NEW_LINE>queryFpDBDeleteJobListResponse.setNonExistIds(nonExistIds);<NEW_LINE>List<FpDBDeleteJob> fpDBDeleteJobList = new ArrayList<FpDBDeleteJob>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("QueryFpDBDeleteJobListResponse.FpDBDeleteJobList.Length"); i++) {<NEW_LINE>FpDBDeleteJob fpDBDeleteJob = new FpDBDeleteJob();<NEW_LINE>fpDBDeleteJob.setCreationTime(_ctx.stringValue("QueryFpDBDeleteJobListResponse.FpDBDeleteJobList[" + i + "].CreationTime"));<NEW_LINE>fpDBDeleteJob.setStatus(_ctx.stringValue("QueryFpDBDeleteJobListResponse.FpDBDeleteJobList[" + i + "].Status"));<NEW_LINE>fpDBDeleteJob.setFinishTime(_ctx.stringValue("QueryFpDBDeleteJobListResponse.FpDBDeleteJobList[" + i + "].FinishTime"));<NEW_LINE>fpDBDeleteJob.setDelType(_ctx.stringValue("QueryFpDBDeleteJobListResponse.FpDBDeleteJobList[" + i + "].DelType"));<NEW_LINE>fpDBDeleteJob.setUserData(_ctx.stringValue("QueryFpDBDeleteJobListResponse.FpDBDeleteJobList[" + i + "].UserData"));<NEW_LINE>fpDBDeleteJob.setCode(_ctx.stringValue("QueryFpDBDeleteJobListResponse.FpDBDeleteJobList[" + i + "].Code"));<NEW_LINE>fpDBDeleteJob.setMessage(_ctx.stringValue("QueryFpDBDeleteJobListResponse.FpDBDeleteJobList[" + i + "].Message"));<NEW_LINE>fpDBDeleteJob.setPipelineId(_ctx.stringValue("QueryFpDBDeleteJobListResponse.FpDBDeleteJobList[" + i + "].PipelineId"));<NEW_LINE>fpDBDeleteJob.setFpDBId(_ctx.stringValue("QueryFpDBDeleteJobListResponse.FpDBDeleteJobList[" + i + "].FpDBId"));<NEW_LINE>fpDBDeleteJob.setId(_ctx.stringValue<MASK><NEW_LINE>fpDBDeleteJobList.add(fpDBDeleteJob);<NEW_LINE>}<NEW_LINE>queryFpDBDeleteJobListResponse.setFpDBDeleteJobList(fpDBDeleteJobList);<NEW_LINE>return queryFpDBDeleteJobListResponse;<NEW_LINE>} | ("QueryFpDBDeleteJobListResponse.FpDBDeleteJobList[" + i + "].Id")); |
403,479 | public Object invoke(final MethodInvocation invocation) throws Throwable {<NEW_LINE>String name;<NEW_LINE>if (StringUtils.hasText(this.label)) {<NEW_LINE>name = this.label;<NEW_LINE>} else {<NEW_LINE>name = invocation.getMethod().toGenericString();<NEW_LINE>}<NEW_LINE>final String label = name;<NEW_LINE>RetryCallback<Object, Throwable> retryCallback = new MethodInvocationRetryCallback<Object, Throwable>(invocation, label) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Object doWithRetry(RetryContext context) throws Exception {<NEW_LINE>context.setAttribute(RetryContext.NAME, this.label);<NEW_LINE>if (this.invocation instanceof ProxyMethodInvocation) {<NEW_LINE>context.setAttribute("___proxy___", ((ProxyMethodInvocation) this.invocation).getProxy());<NEW_LINE>try {<NEW_LINE>return ((ProxyMethodInvocation) this.invocation).invocableClone().proceed();<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw e;<NEW_LINE>} catch (Error e) {<NEW_LINE>throw e;<NEW_LINE>} catch (Throwable e) {<NEW_LINE>throw new IllegalStateException(e);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new IllegalStateException("MethodInvocation of the wrong type detected - this should not happen with Spring AOP, " + "so please raise an issue if you see this exception");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>if (this.recoverer != null) {<NEW_LINE>ItemRecovererCallback recoveryCallback = new ItemRecovererCallback(invocation.getArguments(), this.recoverer);<NEW_LINE>try {<NEW_LINE>Object recovered = this.retryOperations.execute(retryCallback, recoveryCallback);<NEW_LINE>return recovered;<NEW_LINE>} finally {<NEW_LINE>RetryContext context = RetrySynchronizationManager.getContext();<NEW_LINE>if (context != null) {<NEW_LINE>context.removeAttribute("__proxy__");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return <MASK><NEW_LINE>} | this.retryOperations.execute(retryCallback); |
1,585,449 | public void deleteAllExcept(final com.abixen.platform.core.domain.model.Page page, final List<Long> ids) {<NEW_LINE>log.debug("deleteAllExcept() - page: {}, {}", page, ids);<NEW_LINE>if (ids.isEmpty()) {<NEW_LINE>deleteAll(page);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final List<Module> modules = moduleRepository.findAllExcept(page, ids);<NEW_LINE>final List<Long> moduleIds = modules.stream().map(module -> module.getId()).collect(Collectors.toList());<NEW_LINE>if (!moduleIds.isEmpty()) {<NEW_LINE>commentService.deleteAllByModuleIds(moduleIds);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>modules.forEach(module -> {<NEW_LINE>DeleteModuleCommand deleteModuleCommand = new DeleteModuleCommand(module.getId(), module.getModuleType().getName());<NEW_LINE>deleteModuleService.delete(module.getModuleType().getServiceId(), deleteModuleCommand);<NEW_LINE>});<NEW_LINE>} | moduleRepository.removeAllExcept(page, ids); |
316,998 | public static long calcPhyModifyViewScanMemCost(String groupName, List<List<String>> phyTableListArr, Map<Integer, ParameterContext> paramsOfPhySql) {<NEW_LINE>long phyOpMem = 0;<NEW_LINE>int lengthOfPhyTbOfOneShard = 0;<NEW_LINE>// for all tableNames<NEW_LINE>if (phyTableListArr != null && phyTableListArr.size() > 0) {<NEW_LINE>List<String> phyTbListOfOneShard = phyTableListArr.get(0);<NEW_LINE>for (int i = 0; i < phyTbListOfOneShard.size(); i++) {<NEW_LINE>String phyTb = phyTbListOfOneShard.get(i);<NEW_LINE>lengthOfPhyTbOfOneShard += phyTb.length();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>phyOpMem += ObjectSizeUtils.SIZE_CHAR * lengthOfPhyTbOfOneShard * phyTableListArr.size();<NEW_LINE>// for groupName<NEW_LINE>phyOpMem += ObjectSizeUtils.SIZE_CHAR * groupName.length();<NEW_LINE>// for all refs of PhyTableOperation<NEW_LINE>phyOpMem += PhyTableOperation.INSTANCE_MEM_SIZE;<NEW_LINE>phyOpMem += paramsOfPhySql.size() * (ObjectSizeUtils.HASH_ENTRY_SIZE + ObjectSizeUtils.SIZE_OBJ_REF * 2 + <MASK><NEW_LINE>return phyOpMem;<NEW_LINE>} | ObjectSizeUtils.SIZE_INTEGER + ParameterContext.INSTANCE_MEM_SIZE); |
536,821 | public void drawTo(Graphic graphic, Style highLight) {<NEW_LINE>if (graphic.isFlagSet(Graphic.Flag.smallIO)) {<NEW_LINE>Vector center = new Vector(LATEX_RAD.x, 0);<NEW_LINE>graphic.drawCircle(center.sub(LATEX_RAD), center.add(LATEX_RAD), Style.NORMAL);<NEW_LINE>Vector textPos = new Vector(SIZE2 + LATEX_RAD.x, 0);<NEW_LINE>graphic.drawText(textPos, label, <MASK><NEW_LINE>} else {<NEW_LINE>int outSize = getOutSize(small);<NEW_LINE>Style style = getOutStyle(small);<NEW_LINE>if (value != null) {<NEW_LINE>style = Style.getWireStyle(value);<NEW_LINE>if (value.getBits() > 1) {<NEW_LINE>Vector textPos = new Vector(1 + outSize, -4 - outSize);<NEW_LINE>graphic.drawText(textPos, formatter.formatToView(value), Orientation.CENTERBOTTOM, Style.NORMAL);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Vector radl = new Vector(outSize, outSize);<NEW_LINE>Vector rad = getOutRad(small);<NEW_LINE>Vector center = new Vector(1 + outSize, 0);<NEW_LINE>graphic.drawCircle(center.sub(rad), center.add(rad), style);<NEW_LINE>graphic.drawCircle(center.sub(radl), center.add(radl), Style.NORMAL);<NEW_LINE>Vector textPos = new Vector(outSize * 3, 0);<NEW_LINE>graphic.drawText(textPos, label, Orientation.LEFTCENTER, Style.INOUT);<NEW_LINE>}<NEW_LINE>} | Orientation.LEFTCENTER, Style.INOUT); |
1,051,333 | public void configureJobConf(TableDesc tableDesc, JobConf jobConf) {<NEW_LINE>if (tableDesc != null && tableDesc.getProperties() != null && tableDesc.getProperties().get(WRITE_KEY) != null) {<NEW_LINE>String tableName = tableDesc.getTableName();<NEW_LINE>Preconditions.checkArgument(!tableName.contains(TABLE_NAME_SEPARATOR), "Can not handle table " + tableName + ". Its name contains '" + TABLE_NAME_SEPARATOR + "'");<NEW_LINE>String tables = <MASK><NEW_LINE>tables = tables == null ? tableName : tables + TABLE_NAME_SEPARATOR + tableName;<NEW_LINE>jobConf.set("mapred.output.committer.class", HiveIcebergOutputCommitter.class.getName());<NEW_LINE>jobConf.set(InputFormatConfig.OUTPUT_TABLES, tables);<NEW_LINE>String catalogName = tableDesc.getProperties().getProperty(InputFormatConfig.CATALOG_NAME);<NEW_LINE>if (catalogName != null) {<NEW_LINE>jobConf.set(InputFormatConfig.TABLE_CATALOG_PREFIX + tableName, catalogName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | jobConf.get(InputFormatConfig.OUTPUT_TABLES); |
1,034,982 | public void stateChanged(Download download, int old_state, int new_state) {<NEW_LINE>DefaultRankCalculator <MASK><NEW_LINE>if (dlData != null) {<NEW_LINE>// force a SR recalc, so that it gets position properly next process()<NEW_LINE>requestProcessCycle(dlData);<NEW_LINE>if ((new_state == Download.ST_READY || new_state == Download.ST_WAITING)) {<NEW_LINE>if (immediateProcessingScheduled) {<NEW_LINE>requestProcessCycle(dlData);<NEW_LINE>} else {<NEW_LINE>immediateProcessingScheduled = true;<NEW_LINE>new AEThread2("processReady", true) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>process();<NEW_LINE>}<NEW_LINE>}.start();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (bDebugLog)<NEW_LINE>log.log(dlData.getRelatedTo(), LoggerChannel.LT_INFORMATION, "somethingChanged: stateChange from " + sStates.charAt(old_state) + " (" + old_state + ") to " + sStates.charAt(new_state) + " (" + new_state + ")");<NEW_LINE>}<NEW_LINE>} | dlData = rankCalculatorMap.get(download); |
998,954 | public View onCreateView(String name, Context context, AttributeSet attrs) {<NEW_LINE>// Allow super to try and create a view first<NEW_LINE>final View result = super.onCreateView(name, context, attrs);<NEW_LINE>if (result != null) {<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {<NEW_LINE>// If we're running pre-L, we need to 'inject' our tint aware Views in place of the<NEW_LINE>// standard framework versions<NEW_LINE>switch(name) {<NEW_LINE>case "EditText":<NEW_LINE>return new AppCompatEditText(this, attrs);<NEW_LINE>case "Spinner":<NEW_LINE>return new AppCompatSpinner(this, attrs);<NEW_LINE>case "CheckBox":<NEW_LINE>return new AppCompatCheckBox(this, attrs);<NEW_LINE>case "RadioButton":<NEW_LINE>return new AppCompatRadioButton(this, attrs);<NEW_LINE>case "CheckedTextView":<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>Api.fixFolderPermissionsAsync(context);<NEW_LINE>return null;<NEW_LINE>} | return new AppCompatCheckedTextView(this, attrs); |
1,810,720 | public void updateBackground(MotionModel homeToCurrent, T frame) {<NEW_LINE>worldToHome.concat(homeToCurrent, worldToCurrent);<NEW_LINE>worldToCurrent.invert(currentToWorld);<NEW_LINE>// find the distorted polygon of the current image in the "home" background reference frame<NEW_LINE>_transform.setModel(currentToWorld);<NEW_LINE>_transform.compute(0, 0, corners[0]);<NEW_LINE>_transform.compute(frame.width - 1, 0, corners[1]);<NEW_LINE>_transform.compute(frame.width - 1, frame.height - 1, corners[2]);<NEW_LINE>_transform.compute(0, frame.height - 1, corners[3]);<NEW_LINE>// find the bounding box<NEW_LINE>int x0 = Integer.MAX_VALUE;<NEW_LINE>int y0 = Integer.MAX_VALUE;<NEW_LINE>int x1 = -Integer.MAX_VALUE;<NEW_LINE>int y1 = -Integer.MAX_VALUE;<NEW_LINE>for (int i = 0; i < 4; i++) {<NEW_LINE>Point2D_F32 p = corners[i];<NEW_LINE>int x = (int) p.x;<NEW_LINE>int <MASK><NEW_LINE>if (x0 > x)<NEW_LINE>x0 = x;<NEW_LINE>if (y0 > y)<NEW_LINE>y0 = y;<NEW_LINE>if (x1 < x)<NEW_LINE>x1 = x;<NEW_LINE>if (y1 < y)<NEW_LINE>y1 = y;<NEW_LINE>}<NEW_LINE>x1++;<NEW_LINE>y1++;<NEW_LINE>if (x0 < 0)<NEW_LINE>x0 = 0;<NEW_LINE>if (x1 > backgroundWidth)<NEW_LINE>x1 = backgroundWidth;<NEW_LINE>if (y0 < 0)<NEW_LINE>y0 = 0;<NEW_LINE>if (y1 > backgroundHeight)<NEW_LINE>y1 = backgroundHeight;<NEW_LINE>updateBackground(x0, y0, x1, y1, frame);<NEW_LINE>} | y = (int) p.y; |
1,487,763 | final DeleteApplicationResult executeDeleteApplication(DeleteApplicationRequest deleteApplicationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteApplicationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteApplicationRequest> request = null;<NEW_LINE>Response<DeleteApplicationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteApplicationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteApplicationRequest));<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, "Kinesis Analytics");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteApplication");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteApplicationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteApplicationResultJsonUnmarshaller());<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,109,630 | final DescribeNetworkInterfacesResult executeDescribeNetworkInterfaces(DescribeNetworkInterfacesRequest describeNetworkInterfacesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeNetworkInterfacesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<DescribeNetworkInterfacesRequest> request = null;<NEW_LINE>Response<DescribeNetworkInterfacesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeNetworkInterfacesRequestMarshaller().marshall(super.beforeMarshalling(describeNetworkInterfacesRequest));<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, "EC2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeNetworkInterfaces");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DescribeNetworkInterfacesResult> responseHandler = new StaxResponseHandler<DescribeNetworkInterfacesResult>(new DescribeNetworkInterfacesResultStaxUnmarshaller());<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.startEvent(Field.ClientExecuteTime); |
1,478,529 | // snippet-start:[s3.java2.delete_many_objects.main]<NEW_LINE>public static void deleteBucketObjects(S3Client s3, String bucketName) {<NEW_LINE>// Upload three sample objects to the specfied Amazon S3 bucket.<NEW_LINE>ArrayList<ObjectIdentifier> keys = new ArrayList<>();<NEW_LINE>PutObjectRequest putOb = null;<NEW_LINE>ObjectIdentifier objectId = null;<NEW_LINE>for (int i = 0; i < 3; i++) {<NEW_LINE>String keyName = "delete object example " + i;<NEW_LINE>objectId = ObjectIdentifier.builder().<MASK><NEW_LINE>putOb = PutObjectRequest.builder().bucket(bucketName).key(keyName).build();<NEW_LINE>s3.putObject(putOb, RequestBody.fromString(keyName));<NEW_LINE>keys.add(objectId);<NEW_LINE>}<NEW_LINE>System.out.println(keys.size() + " objects successfully created.");<NEW_LINE>// Delete multiple objects in one request.<NEW_LINE>Delete del = Delete.builder().objects(keys).build();<NEW_LINE>try {<NEW_LINE>DeleteObjectsRequest multiObjectDeleteRequest = DeleteObjectsRequest.builder().bucket(bucketName).delete(del).build();<NEW_LINE>s3.deleteObjects(multiObjectDeleteRequest);<NEW_LINE>System.out.println("Multiple objects are deleted!");<NEW_LINE>} catch (S3Exception e) {<NEW_LINE>System.err.println(e.awsErrorDetails().errorMessage());<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>} | key(keyName).build(); |
116,434 | public SLongCheckinActionState convertToSObject(LongCheckinActionState input) {<NEW_LINE>if (input == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>SLongCheckinActionState result = new SLongCheckinActionState();<NEW_LINE>result.setOid(input.getOid());<NEW_LINE>result.setUuid(input.getUuid());<NEW_LINE>result.setRid(input.getRid());<NEW_LINE>result.setStart(input.getStart());<NEW_LINE>result.setEnd(input.getEnd());<NEW_LINE>result.setProgress(input.getProgress());<NEW_LINE>result.setState(SActionState.values()[input.getState().ordinal()]);<NEW_LINE>result.setTitle(input.getTitle());<NEW_LINE>result.setStage(input.getStage());<NEW_LINE>result.getErrors().addAll(input.getErrors());<NEW_LINE>result.getWarnings().addAll(input.getWarnings());<NEW_LINE>result.getInfos().addAll(input.getInfos());<NEW_LINE>result.setTopicId(input.getTopicId());<NEW_LINE>result.<MASK><NEW_LINE>result.setDeserializeErrorCode(input.getDeserializeErrorCode());<NEW_LINE>return result;<NEW_LINE>} | setRoid(input.getRoid()); |
208,368 | private File[] chooseAndOpenProjects(File workingDir, boolean open) {<NEW_LINE>if (workingDir != null) {<NEW_LINE>ProjectChooser.setProjectsFolder(workingDir);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (workingDir != null) {<NEW_LINE>chooser.setCurrentDirectory(workingDir);<NEW_LINE>}<NEW_LINE>chooser.setMultiSelectionEnabled(true);<NEW_LINE>File[] projectDirs;<NEW_LINE>int option = chooser.showOpenDialog(WindowManager.getDefault().getMainWindow());<NEW_LINE>if (option == JFileChooser.APPROVE_OPTION) {<NEW_LINE>if (chooser.isMultiSelectionEnabled()) {<NEW_LINE>projectDirs = chooser.getSelectedFiles();<NEW_LINE>} else {<NEW_LINE>projectDirs = new File[] { chooser.getSelectedFile() };<NEW_LINE>}<NEW_LINE>if (open) {<NEW_LINE>ArrayList<Project> projects = new ArrayList<Project>(projectDirs.length);<NEW_LINE>for (File d : projectDirs) {<NEW_LINE>try {<NEW_LINE>Project p = ProjectManager.getDefault().findProject(FileUtil.toFileObject(d));<NEW_LINE>if (p != null) {<NEW_LINE>projects.add(p);<NEW_LINE>}<NEW_LINE>} catch (IOException ex) {<NEW_LINE>Exceptions.printStackTrace(ex);<NEW_LINE>} catch (IllegalArgumentException ex) {<NEW_LINE>Exceptions.printStackTrace(ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!projects.isEmpty()) {<NEW_LINE>OpenProjects.getDefault().open(projects.toArray(new Project[projects.size()]), false);<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>WindowManager.getDefault().findTopComponent("projectTabLogical_tc").requestActive();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>projectDirs = new File[0];<NEW_LINE>}<NEW_LINE>return projectDirs;<NEW_LINE>} | JFileChooser chooser = ProjectChooser.projectChooser(); |
587,746 | private RouteTypeExpr toRouteType(Rp_route_typeContext ctx) {<NEW_LINE>if (ctx.INTERAREA() != null) {<NEW_LINE>return new LiteralRouteType(RouteType.INTERAREA);<NEW_LINE>} else if (ctx.INTERNAL() != null) {<NEW_LINE>return new LiteralRouteType(RouteType.INTERNAL);<NEW_LINE>} else if (ctx.LEVEL_1() != null) {<NEW_LINE>return new LiteralRouteType(RouteType.LEVEL_1);<NEW_LINE>} else if (ctx.LEVEL_1_2() != null) {<NEW_LINE>// not a typo<NEW_LINE>return new LiteralRouteType(RouteType.INTERAREA);<NEW_LINE>} else if (ctx.LEVEL_2() != null) {<NEW_LINE>return new LiteralRouteType(RouteType.LEVEL_2);<NEW_LINE>} else if (ctx.LOCAL() != null) {<NEW_LINE>return new LiteralRouteType(RouteType.LOCAL);<NEW_LINE>} else if (ctx.OSPF_EXTERNAL_TYPE_1() != null) {<NEW_LINE>return new LiteralRouteType(RouteType.OSPF_EXTERNAL_TYPE_1);<NEW_LINE>} else if (ctx.OSPF_EXTERNAL_TYPE_2() != null) {<NEW_LINE>return new LiteralRouteType(RouteType.OSPF_EXTERNAL_TYPE_2);<NEW_LINE>} else if (ctx.OSPF_INTER_AREA() != null) {<NEW_LINE>return new LiteralRouteType(RouteType.OSPF_INTER_AREA);<NEW_LINE>} else if (ctx.OSPF_INTRA_AREA() != null) {<NEW_LINE>return new LiteralRouteType(RouteType.OSPF_INTRA_AREA);<NEW_LINE>} else if (ctx.OSPF_NSSA_TYPE_1() != null) {<NEW_LINE>return new LiteralRouteType(RouteType.OSPF_NSSA_TYPE_1);<NEW_LINE>} else if (ctx.OSPF_NSSA_TYPE_2() != null) {<NEW_LINE>return new LiteralRouteType(RouteType.OSPF_NSSA_TYPE_2);<NEW_LINE>} else if (ctx.RP_VARIABLE() != null) {<NEW_LINE>return new VarRouteType(ctx.RP_VARIABLE().getText());<NEW_LINE>} else if (ctx.TYPE_1() != null) {<NEW_LINE><MASK><NEW_LINE>} else if (ctx.TYPE_2() != null) {<NEW_LINE>return new LiteralRouteType(RouteType.TYPE_2);<NEW_LINE>} else {<NEW_LINE>throw convError(RouteTypeExpr.class, ctx);<NEW_LINE>}<NEW_LINE>} | return new LiteralRouteType(RouteType.TYPE_1); |
1,159,874 | private static void validateClientOptions(SdkClientConfiguration c) {<NEW_LINE>require("endpoint", c.option(SdkClientOption.ENDPOINT));<NEW_LINE>require("overrideConfiguration.additionalHttpHeaders", c.option(SdkClientOption.ADDITIONAL_HTTP_HEADERS));<NEW_LINE>require("overrideConfiguration.executionInterceptors", c.option(SdkClientOption.EXECUTION_INTERCEPTORS));<NEW_LINE>require("overrideConfiguration.retryPolicy", c<MASK><NEW_LINE>require("overrideConfiguration.advancedOption[SIGNER]", c.option(SdkAdvancedClientOption.SIGNER));<NEW_LINE>require("overrideConfiguration.advancedOption[USER_AGENT_PREFIX]", c.option(SdkAdvancedClientOption.USER_AGENT_PREFIX));<NEW_LINE>require("overrideConfiguration.advancedOption[USER_AGENT_SUFFIX]", c.option(SdkAdvancedClientOption.USER_AGENT_SUFFIX));<NEW_LINE>require("overrideConfiguration.advancedOption[CRC32_FROM_COMPRESSED_DATA_ENABLED]", c.option(SdkClientOption.CRC32_FROM_COMPRESSED_DATA_ENABLED));<NEW_LINE>} | .option(SdkClientOption.RETRY_POLICY)); |
584,381 | private static // payment schedule<NEW_LINE>PaymentSchedule parsePaymentSchedule(CsvRow row, String leg, Frequency accrualFrequency) {<NEW_LINE>PaymentSchedule.Builder builder = PaymentSchedule.builder();<NEW_LINE>// basics<NEW_LINE>builder.paymentFrequency(findValue(row, leg, PAYMENT_FREQUENCY_FIELD).map(s -> Frequency.parse(s<MASK><NEW_LINE>Optional<DaysAdjustment> offsetOpt = parseDaysAdjustment(row, leg, PAYMENT_OFFSET_DAYS_FIELD, PAYMENT_OFFSET_CAL_FIELD, PAYMENT_OFFSET_ADJ_CNV_FIELD, PAYMENT_OFFSET_ADJ_CAL_FIELD);<NEW_LINE>builder.paymentDateOffset(offsetOpt.orElse(DaysAdjustment.NONE));<NEW_LINE>// optionals<NEW_LINE>findValue(row, leg, PAYMENT_RELATIVE_TO_FIELD).map(s -> PaymentRelativeTo.of(s)).ifPresent(v -> builder.paymentRelativeTo(v));<NEW_LINE>findValue(row, leg, COMPOUNDING_METHOD_FIELD).map(s -> CompoundingMethod.of(s)).ifPresent(v -> builder.compoundingMethod(v));<NEW_LINE>findValue(row, leg, PAYMENT_FIRST_REGULAR_START_DATE_FIELD).map(s -> LoaderUtils.parseDate(s)).ifPresent(v -> builder.firstRegularStartDate(v));<NEW_LINE>findValue(row, leg, PAYMENT_LAST_REGULAR_END_DATE_FIELD).map(s -> LoaderUtils.parseDate(s)).ifPresent(v -> builder.lastRegularEndDate(v));<NEW_LINE>return builder.build();<NEW_LINE>} | )).orElse(accrualFrequency)); |
1,196,752 | public static DescribeFabricConsortiumsResponse unmarshall(DescribeFabricConsortiumsResponse describeFabricConsortiumsResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeFabricConsortiumsResponse.setRequestId(_ctx.stringValue("DescribeFabricConsortiumsResponse.RequestId"));<NEW_LINE>describeFabricConsortiumsResponse.setErrorCode(_ctx.integerValue("DescribeFabricConsortiumsResponse.ErrorCode"));<NEW_LINE>describeFabricConsortiumsResponse.setSuccess(_ctx.booleanValue("DescribeFabricConsortiumsResponse.Success"));<NEW_LINE>List<ResultItem> result = new ArrayList<ResultItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeFabricConsortiumsResponse.Result.Length"); i++) {<NEW_LINE>ResultItem resultItem = new ResultItem();<NEW_LINE>resultItem.setChannelCount(_ctx.integerValue("DescribeFabricConsortiumsResponse.Result[" + i + "].ChannelCount"));<NEW_LINE>resultItem.setDomain(_ctx.stringValue("DescribeFabricConsortiumsResponse.Result[" + i + "].Domain"));<NEW_LINE>resultItem.setState(_ctx.stringValue("DescribeFabricConsortiumsResponse.Result[" + i + "].State"));<NEW_LINE>resultItem.setCreateTime(_ctx.stringValue("DescribeFabricConsortiumsResponse.Result[" + i + "].CreateTime"));<NEW_LINE>resultItem.setSpecName(_ctx.stringValue("DescribeFabricConsortiumsResponse.Result[" + i + "].SpecName"));<NEW_LINE>resultItem.setSupportChannelConfig(_ctx.booleanValue("DescribeFabricConsortiumsResponse.Result[" + i + "].SupportChannelConfig"));<NEW_LINE>resultItem.setOwnerName(_ctx.stringValue("DescribeFabricConsortiumsResponse.Result[" + i + "].OwnerName"));<NEW_LINE>resultItem.setOwnerUid(_ctx.longValue("DescribeFabricConsortiumsResponse.Result[" + i + "].OwnerUid"));<NEW_LINE>resultItem.setOwnerBid(_ctx.stringValue("DescribeFabricConsortiumsResponse.Result[" + i + "].OwnerBid"));<NEW_LINE>resultItem.setCodeName(_ctx.stringValue("DescribeFabricConsortiumsResponse.Result[" + i + "].CodeName"));<NEW_LINE>resultItem.setRegionId(_ctx.stringValue("DescribeFabricConsortiumsResponse.Result[" + i + "].RegionId"));<NEW_LINE>resultItem.setChannelPolicy(_ctx.stringValue("DescribeFabricConsortiumsResponse.Result[" + i + "].ChannelPolicy"));<NEW_LINE>resultItem.setRequestId(_ctx.stringValue("DescribeFabricConsortiumsResponse.Result[" + i + "].RequestId"));<NEW_LINE>resultItem.setConsortiumId(_ctx.stringValue("DescribeFabricConsortiumsResponse.Result[" + i + "].ConsortiumId"));<NEW_LINE>resultItem.setExpiredTime(_ctx.stringValue("DescribeFabricConsortiumsResponse.Result[" + i + "].ExpiredTime"));<NEW_LINE>resultItem.setOrganizationCount(_ctx.integerValue("DescribeFabricConsortiumsResponse.Result[" + i + "].OrganizationCount"));<NEW_LINE>resultItem.setConsortiumName(_ctx.stringValue("DescribeFabricConsortiumsResponse.Result[" + i + "].ConsortiumName"));<NEW_LINE>List<TagsItem> tags = new ArrayList<TagsItem>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeFabricConsortiumsResponse.Result[" + i + "].Tags.Length"); j++) {<NEW_LINE>TagsItem tagsItem = new TagsItem();<NEW_LINE>tagsItem.setKey(_ctx.stringValue("DescribeFabricConsortiumsResponse.Result[" + i <MASK><NEW_LINE>tagsItem.setValue(_ctx.stringValue("DescribeFabricConsortiumsResponse.Result[" + i + "].Tags[" + j + "].Value"));<NEW_LINE>tags.add(tagsItem);<NEW_LINE>}<NEW_LINE>resultItem.setTags(tags);<NEW_LINE>result.add(resultItem);<NEW_LINE>}<NEW_LINE>describeFabricConsortiumsResponse.setResult(result);<NEW_LINE>return describeFabricConsortiumsResponse;<NEW_LINE>} | + "].Tags[" + j + "].Key")); |
1,634,512 | public void subscribeActual(Observer<? super T> observer) {<NEW_LINE>ObservableSource<? extends T>[] sources = this.sources;<NEW_LINE>int count = 0;<NEW_LINE>if (sources == null) {<NEW_LINE>sources = new ObservableSource[8];<NEW_LINE>try {<NEW_LINE>for (ObservableSource<? extends T> p : sourcesIterable) {<NEW_LINE>if (p == null) {<NEW_LINE>EmptyDisposable.error(new NullPointerException("One of the sources is null"), observer);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (count == sources.length) {<NEW_LINE>ObservableSource<? extends T>[] b = new ObservableSource[count <MASK><NEW_LINE>System.arraycopy(sources, 0, b, 0, count);<NEW_LINE>sources = b;<NEW_LINE>}<NEW_LINE>sources[count++] = p;<NEW_LINE>}<NEW_LINE>} catch (Throwable e) {<NEW_LINE>Exceptions.throwIfFatal(e);<NEW_LINE>EmptyDisposable.error(e, observer);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>count = sources.length;<NEW_LINE>}<NEW_LINE>if (count == 0) {<NEW_LINE>EmptyDisposable.complete(observer);<NEW_LINE>return;<NEW_LINE>} else if (count == 1) {<NEW_LINE>sources[0].subscribe(observer);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>AmbCoordinator<T> ac = new AmbCoordinator<>(observer, count);<NEW_LINE>ac.subscribe(sources);<NEW_LINE>} | + (count >> 2)]; |
1,180,406 | public static boolean playClip(String strUri, Integer cycleCount, Double volume, boolean preloadOnly) throws ParserException {<NEW_LINE>final SoundManager manager = userSounds.get(strUri);<NEW_LINE>// Verify the uri and return an error if uri is incorrect<NEW_LINE>if (manager == null) {<NEW_LINE>try {<NEW_LINE>if (!SoundFunctions.uriExists(strUri)) {<NEW_LINE>// leave without error message if uri ok but no file<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>String key = "macro.function.sound.illegalargument";<NEW_LINE>throw new ParserException(I18N.getText(key, "playClip", strUri, e.getMessage()));<NEW_LINE>}<NEW_LINE>new Thread(() -> {<NEW_LINE>// Creates a SoundManager on another thread, as it can be slow.<NEW_LINE>SoundManager newManager = new <MASK><NEW_LINE>userSounds.put(strUri, newManager);<NEW_LINE>if (!preloadOnly) {<NEW_LINE>Platform.runLater(newManager::playClip);<NEW_LINE>}<NEW_LINE>}).start();<NEW_LINE>} else {<NEW_LINE>manager.editClip(cycleCount, volume);<NEW_LINE>if (!preloadOnly) {<NEW_LINE>Platform.runLater(manager::playClip);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | SoundManager(strUri, cycleCount, volume); |
1,253,417 | public void activateIndex(final String indexName) throws DotDataException {<NEW_LINE>final IndiciesInfo info = APILocator<MASK><NEW_LINE>final IndiciesInfo.Builder builder = IndiciesInfo.Builder.copy(info);<NEW_LINE>if (indexName == null) {<NEW_LINE>throw new DotRuntimeException("Index cannot be null");<NEW_LINE>}<NEW_LINE>if (IndexType.WORKING.is(indexName)) {<NEW_LINE>builder.setWorking(esIndexApi.getNameWithClusterIDPrefix(indexName));<NEW_LINE>if (esIndexApi.getNameWithClusterIDPrefix(indexName).equals(info.getReindexWorking())) {<NEW_LINE>builder.setReindexWorking(null);<NEW_LINE>}<NEW_LINE>} else if (IndexType.LIVE.is(indexName)) {<NEW_LINE>builder.setLive(esIndexApi.getNameWithClusterIDPrefix(indexName));<NEW_LINE>if (esIndexApi.getNameWithClusterIDPrefix(indexName).equals(info.getReindexLive())) {<NEW_LINE>builder.setReindexLive(null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>APILocator.getIndiciesAPI().point(builder.build());<NEW_LINE>} | .getIndiciesAPI().loadIndicies(); |
1,223,752 | private void handleError(BitIdResponse response) {<NEW_LINE>String message = Strings.nullToEmpty(response.message);<NEW_LINE>int code = response.code;<NEW_LINE>String userInfo;<NEW_LINE>if (code >= 400 && code < 500) {<NEW_LINE>// Display the error message if its short enough. Most probably the nonce has timed out.<NEW_LINE>if (message.contains("NONCE has expired") || message.contains("NONCE is illegal")) {<NEW_LINE>userInfo = getString(R.string.bitid_expired);<NEW_LINE>} else if (message.length() > 500) {<NEW_LINE>userInfo = getString(R.string.bitid_error);<NEW_LINE>} else {<NEW_LINE>userInfo = getString(<MASK><NEW_LINE>if (!Strings.isNullOrEmpty(response.message)) {<NEW_LINE>userInfo += ": " + response.message;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (code >= 500 && code < 600) {<NEW_LINE>// server-side error<NEW_LINE>userInfo = getString(R.string.bitid_error);<NEW_LINE>} else {<NEW_LINE>// redirect or strange status code<NEW_LINE>// return same error, maybe refine later<NEW_LINE>userInfo = getString(R.string.bitid_error);<NEW_LINE>}<NEW_LINE>errorView.setText(userInfo);<NEW_LINE>errorView.setVisibility(View.VISIBLE);<NEW_LINE>} | R.string.bitid_errorheader) + code; |
913,305 | private static void visitGetPropertySwitch(PersistentEntity<?, ?> entity, List<PersistentProperty<?>> persistentProperties, String internalClassName, MethodVisitor mv) {<NEW_LINE>Map<String, PropertyStackAddress> propertyStackMap = createPropertyStackMap(persistentProperties);<NEW_LINE>int[] hashes = new int[propertyStackMap.size()];<NEW_LINE>Label[] switchJumpLabels = new Label[propertyStackMap.size()];<NEW_LINE>List<PropertyStackAddress> stackmap = new ArrayList<<MASK><NEW_LINE>Collections.sort(stackmap);<NEW_LINE>for (int i = 0; i < stackmap.size(); i++) {<NEW_LINE>PropertyStackAddress propertyStackAddress = stackmap.get(i);<NEW_LINE>hashes[i] = propertyStackAddress.hash;<NEW_LINE>switchJumpLabels[i] = propertyStackAddress.label;<NEW_LINE>}<NEW_LINE>Label dfltLabel = new Label();<NEW_LINE>mv.visitVarInsn(ALOAD, 1);<NEW_LINE>mv.visitMethodInsn(INVOKEINTERFACE, PERSISTENT_PROPERTY, "getName", String.format("()%s", referenceName(JAVA_LANG_STRING)), true);<NEW_LINE>mv.visitMethodInsn(INVOKEVIRTUAL, JAVA_LANG_STRING, "hashCode", "()I", false);<NEW_LINE>mv.visitLookupSwitchInsn(dfltLabel, hashes, switchJumpLabels);<NEW_LINE>for (PersistentProperty<?> property : persistentProperties) {<NEW_LINE>mv.visitLabel(propertyStackMap.get(property.getName()).label);<NEW_LINE>mv.visitFrame(Opcodes.F_SAME, 0, null, 0, null);<NEW_LINE>if (property.getGetter() != null || property.getField() != null) {<NEW_LINE>visitGetProperty0(entity, property, mv, internalClassName);<NEW_LINE>} else {<NEW_LINE>mv.visitJumpInsn(GOTO, dfltLabel);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>mv.visitLabel(dfltLabel);<NEW_LINE>mv.visitFrame(Opcodes.F_SAME, 0, null, 0, null);<NEW_LINE>} | >(propertyStackMap.values()); |
873,801 | public static void main(String[] args) {<NEW_LINE>final String USAGE = "\n" + "Usage: " + " <botName> <intentName> <intentVersion> \n\n" + "Where:\n" + " botName - the name of bot (for example, BookHotel).\n\n" + " intentName - the name of an existing intent (for example, BookHotel).\n\n" + " intentVersion - the version of the intent (for example, 1).\n\n";<NEW_LINE>if (args.length != 2) {<NEW_LINE><MASK><NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>String botName = args[0];<NEW_LINE>String intentName = args[1];<NEW_LINE>String intentVersion = args[2];<NEW_LINE>Region region = Region.US_WEST_2;<NEW_LINE>LexModelBuildingClient lexClient = LexModelBuildingClient.builder().region(region).build();<NEW_LINE>createBot(lexClient, botName, intentName, intentVersion);<NEW_LINE>lexClient.close();<NEW_LINE>} | System.out.println(USAGE); |
1,486,036 | private int sortValue(Operation op1, Operation op2) {<NEW_LINE>if (StorageConstants.COUNT.equals(m_type)) {<NEW_LINE>long count1 = op1.getCount();<NEW_LINE>long count2 = op2.getCount();<NEW_LINE>return count2 > count1 ? 1 : (count2 < count1 ? -1 : 0);<NEW_LINE>} else if (StorageConstants.LONG.equals(m_type)) {<NEW_LINE>long long1 = op1.getLongCount();<NEW_LINE>long long2 = op2.getLongCount();<NEW_LINE>return long2 > long1 ? 1 : (long2 < long1 ? -1 : 0);<NEW_LINE>} else if (StorageConstants.AVG.equals(m_type)) {<NEW_LINE>double avg1 = op1.getAvg();<NEW_LINE><MASK><NEW_LINE>return avg2 > avg1 ? 1 : (avg2 < avg1 ? -1 : 0);<NEW_LINE>} else if (StorageConstants.ERROR.equals(m_type)) {<NEW_LINE>long error1 = op1.getError();<NEW_LINE>long error2 = op2.getError();<NEW_LINE>return error2 > error1 ? 1 : (error2 < error1 ? -1 : 0);<NEW_LINE>} else {<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>} | double avg2 = op2.getAvg(); |
1,365,390 | public static void replaceFieldValue(Object object, Field field, String oldVal, String newVal) throws Exception {<NEW_LINE>try {<NEW_LINE>if (field.getType().isAssignableFrom(String.class)) {<NEW_LINE>Object o = FieldUtils.readField(field, object, true);<NEW_LINE>if (null != o) {<NEW_LINE>String str = o.toString();<NEW_LINE>if (StringUtils.equals(str, oldVal)) {<NEW_LINE>FieldUtils.writeField(field, object, newVal, true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>} else if (field.getType().isAssignableFrom(List.class)) {<NEW_LINE>Object o = FieldUtils.<MASK><NEW_LINE>// Object o = field.get(object);<NEW_LINE>if (null != o) {<NEW_LINE>List<String> list = (List<String>) o;<NEW_LINE>Collections.replaceAll(list, oldVal, newVal);<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new Exception("can not replaceFieldValue, class: " + object.getClass().getName() + ", field: " + field.getName() + ", oldVal: " + oldVal + ", newVal: " + newVal + ", error: " + e.getMessage() + ".");<NEW_LINE>}<NEW_LINE>throw new Exception("only support string or string list, " + object.getClass().getName() + ", field: " + field.getName() + ", oldVal: " + oldVal + ", newVal: " + newVal + ".");<NEW_LINE>} | readField(field, object, true); |
1,422,782 | Optional<AbstractOAuth2AuthenticationProvider> parseStateFromRequest(@NotNull String state) {<NEW_LINE>if (state == null || state.trim().equals("")) {<NEW_LINE>logger.log(Level.INFO, "No state present in request");<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>String[] topFields = state.split("~", 2);<NEW_LINE>if (topFields.length != 2) {<NEW_LINE>logger.log(Level.INFO, "Wrong number of fields in state string", state);<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>AbstractOAuth2AuthenticationProvider idp = authenticationSvc<MASK><NEW_LINE>if (idp == null) {<NEW_LINE>logger.log(Level.INFO, "Can''t find IDP ''{0}''", topFields[0]);<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>// Verify the response by decrypting values and check for state valid timeout<NEW_LINE>String raw = StringUtil.decrypt(topFields[1], idp.clientSecret);<NEW_LINE>String[] stateFields = raw.split("~", -1);<NEW_LINE>if (idp.getId().equals(stateFields[0])) {<NEW_LINE>long timeOrigin = Long.parseLong(stateFields[1]);<NEW_LINE>long timeDifference = this.clock.millis() - timeOrigin;<NEW_LINE>if (timeDifference > 0 && timeDifference < STATE_TIMEOUT) {<NEW_LINE>if (stateFields.length > 3) {<NEW_LINE>this.redirectPage = Optional.ofNullable(stateFields[3]);<NEW_LINE>}<NEW_LINE>return Optional.of(idp);<NEW_LINE>} else {<NEW_LINE>logger.info("State timeout");<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>logger.log(Level.INFO, "Invalid id field: ''{0}''", stateFields[0]);<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>} | .getOAuth2Provider(topFields[0]); |
1,284,780 | public void removeSection(NodeSectionPanel section) {<NEW_LINE>int panelIndex = section.getIndex();<NEW_LINE>contentPanel.remove((JPanel) section);<NEW_LINE>// the rest components have to be moved up<NEW_LINE>java.awt.Component[] components = contentPanel.getComponents();<NEW_LINE>java.util.List<NodeSectionPanel> removedPanels = new java.util.ArrayList<>();<NEW_LINE>for (int i = 0; i < components.length; i++) {<NEW_LINE>if (components[i] instanceof NodeSectionPanel) {<NEW_LINE>NodeSectionPanel pan = (NodeSectionPanel) components[i];<NEW_LINE>int index = pan.getIndex();<NEW_LINE>if (index > panelIndex) {<NEW_LINE>contentPanel.remove((JPanel) pan);<NEW_LINE>pan.setIndex(index - 1);<NEW_LINE>removedPanels.add(pan);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int i = 0; i < removedPanels.size(); i++) {<NEW_LINE>NodeSectionPanel pan = removedPanels.get(i);<NEW_LINE>java.awt.GridBagConstraints gridBagConstraints = <MASK><NEW_LINE>gridBagConstraints.gridx = 0;<NEW_LINE>gridBagConstraints.gridy = pan.getIndex();<NEW_LINE>gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;<NEW_LINE>gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;<NEW_LINE>gridBagConstraints.weightx = 1.0;<NEW_LINE>// gridBagConstraints.insets = new java.awt.Insets(6, 0, 0, 6);<NEW_LINE>contentPanel.add((JPanel) pan, gridBagConstraints);<NEW_LINE>}<NEW_LINE>deleteSection(section.getNode());<NEW_LINE>sectionCount--;<NEW_LINE>} | new java.awt.GridBagConstraints(); |
1,741,967 | public void execute(MacroContext context, String macro, MapToolMacroContext executionContext) {<NEW_LINE>// Was the token states file passed?<NEW_LINE>File aliasFile = null;<NEW_LINE>if (macro.length() > 0) {<NEW_LINE>aliasFile = new File(macro);<NEW_LINE>} else {<NEW_LINE>// Ask the user for the token states file<NEW_LINE>JFileChooser chooser = MapTool.getFrame().getLoadFileChooser();<NEW_LINE>chooser.setDialogTitle(I18N.getText("loadtokenstates.dialogTitle"));<NEW_LINE>chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);<NEW_LINE>if (chooser.showOpenDialog(MapTool.getFrame()) != JFileChooser.APPROVE_OPTION)<NEW_LINE>return;<NEW_LINE>aliasFile = chooser.getSelectedFile();<NEW_LINE>}<NEW_LINE>// endif<NEW_LINE>// Make it an XML file if type isn't set, check for existance<NEW_LINE>if (!aliasFile.getName().contains("."))<NEW_LINE>aliasFile = new File(aliasFile.getAbsolutePath() + "-tokenStates.xml");<NEW_LINE>if (!aliasFile.exists()) {<NEW_LINE>MapTool.addLocalMessage(I18N.getText("loadtokenstates.cantFindFile", aliasFile));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// endif<NEW_LINE>// Read the serialized set of states<NEW_LINE>try {<NEW_LINE>XMLDecoder decoder = new XMLDecoder(new BufferedInputStream<MASK><NEW_LINE>List<BooleanTokenOverlay> overlays = (List<BooleanTokenOverlay>) decoder.readObject();<NEW_LINE>decoder.close();<NEW_LINE>for (BooleanTokenOverlay overlay : overlays) {<NEW_LINE>MapTool.getCampaign().getTokenStatesMap().put(overlay.getName(), overlay);<NEW_LINE>}<NEW_LINE>// endfor<NEW_LINE>MapTool.addLocalMessage(I18N.getText("loadtokenstates.loaded", overlays.size()));<NEW_LINE>} catch (FileNotFoundException e) {<NEW_LINE>MapTool.addLocalMessage(I18N.getText("loadtokenstates.cantFindFile", I18N.getText("msg.error.fileNotFound")));<NEW_LINE>}<NEW_LINE>// endtry<NEW_LINE>} | (new FileInputStream(aliasFile))); |
915,700 | public Object calculate(Context ctx) {<NEW_LINE>if (param == null) {<NEW_LINE>long n = cursor.skip();<NEW_LINE>if (n < Integer.MAX_VALUE) {<NEW_LINE>return <MASK><NEW_LINE>} else {<NEW_LINE>return new Long(n);<NEW_LINE>}<NEW_LINE>} else if (param.isLeaf()) {<NEW_LINE>Object obj = param.getLeafExpression().calculate(ctx);<NEW_LINE>if (!(obj instanceof Number)) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("skip" + mm.getMessage("function.paramTypeError"));<NEW_LINE>}<NEW_LINE>long n = ((Number) obj).longValue();<NEW_LINE>n = cursor.skip(n);<NEW_LINE>if (n < Integer.MAX_VALUE) {<NEW_LINE>return new Integer((int) n);<NEW_LINE>} else {<NEW_LINE>return new Long(n);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (param.getType() != IParam.Semicolon || param.getSubSize() != 2) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("skip" + mm.getMessage("function.invalidParam"));<NEW_LINE>}<NEW_LINE>Expression[] exps;<NEW_LINE>IParam sub = param.getSub(1);<NEW_LINE>if (sub == null) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("skip" + mm.getMessage("function.invalidParam"));<NEW_LINE>} else if (sub.isLeaf()) {<NEW_LINE>exps = new Expression[] { sub.getLeafExpression() };<NEW_LINE>} else {<NEW_LINE>int count = sub.getSubSize();<NEW_LINE>exps = new Expression[count];<NEW_LINE>for (int i = 0; i < count; ++i) {<NEW_LINE>IParam p = sub.getSub(i);<NEW_LINE>if (p == null || !p.isLeaf()) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("skip" + mm.getMessage("function.invalidParam"));<NEW_LINE>}<NEW_LINE>exps[i] = p.getLeafExpression();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int n = cursor.skipGroup(exps, ctx);<NEW_LINE>return new Integer(n);<NEW_LINE>}<NEW_LINE>} | new Integer((int) n); |
1,137,771 | private Triad<LogicalWindow, WorkbenchTabPanel, MinimizedModuleTabLayoutPanel> createTabSet(String persisterName, ArrayList<Tab> tabs) {<NEW_LINE>final WindowFrame frame <MASK><NEW_LINE>final MinimizedModuleTabLayoutPanel minimized = new MinimizedModuleTabLayoutPanel(persisterName);<NEW_LINE>final LogicalWindow logicalWindow = new LogicalWindow(frame, minimized);<NEW_LINE>final WorkbenchTabPanel tabPanel = new WorkbenchTabPanel(frame, logicalWindow, persisterName);<NEW_LINE>if (StringUtil.equals(persisterName, "TabSet1"))<NEW_LINE>tabs1_ = tabs;<NEW_LINE>else if (StringUtil.equals(persisterName, "TabSet2"))<NEW_LINE>tabs2_ = tabs;<NEW_LINE>else if (StringUtil.equals(persisterName, "HiddenTabSet"))<NEW_LINE>hiddenTabs_ = tabs;<NEW_LINE>populateTabPanel(tabs, tabPanel, minimized);<NEW_LINE>frame.setFillWidget(tabPanel);<NEW_LINE>minimized.addSelectionHandler(integerSelectionEvent -> {<NEW_LINE>int tab = integerSelectionEvent.getSelectedItem();<NEW_LINE>tabPanel.selectTab(tab);<NEW_LINE>});<NEW_LINE>tabPanel.addSelectionHandler(integerSelectionEvent -> {<NEW_LINE>int index = integerSelectionEvent.getSelectedItem();<NEW_LINE>WorkbenchTab selected = tabPanel.getTab(index);<NEW_LINE>lastSelectedTab_ = workbenchTabToTab(selected);<NEW_LINE>session_.persistClientState();<NEW_LINE>});<NEW_LINE>if (!StringUtil.equals(persisterName, "HiddenTabSet"))<NEW_LINE>new SelectedTabStateValue(persisterName, tabPanel);<NEW_LINE>return new Triad<>(logicalWindow, tabPanel, minimized);<NEW_LINE>} | = new WindowFrame(persisterName, persisterName); |
1,391,709 | private void doGetJsonResponse(HttpServletRequest req, HttpServletResponse resp) throws IOException {<NEW_LINE>resp.setContentType(MIME_JSON);<NEW_LINE>final Writer w = new OutputStreamWriter(resp.getOutputStream(), UTF8);<NEW_LINE>final Set<UUID> requestedQueryIds = getRequestedQueryIds(req);<NEW_LINE>// Map from IRunningQuery.queryId => RunningQuery (for SPARQL QUERY<NEW_LINE>// requests).<NEW_LINE>final Map<UUID, RunningQuery> /* IRunningQuery.queryId */<NEW_LINE>crosswalkMap = getQueryCrosswalkMap();<NEW_LINE>final List<com.bigdata.rdf.sail.model.RunningQuery> modelRunningQueries = new ArrayList<com.bigdata.rdf.sail.model.RunningQuery>();<NEW_LINE>final QueryEngine queryEngine = (QueryEngine) QueryEngineFactory.getInstance().getQueryController(getIndexManager());<NEW_LINE>final UUID[] queryIds = queryEngine.getRunningQueries();<NEW_LINE>final TreeMap<Long, IRunningQuery> runningQueryAge = orderRunningQueries(queryIds, crosswalkMap, queryEngine);<NEW_LINE>{<NEW_LINE>Iterator<RunningQuery> rSparqlQueries = getRunningSparqlQueries(requestedQueryIds, runningQueryAge, crosswalkMap).iterator();<NEW_LINE>while (rSparqlQueries.hasNext()) {<NEW_LINE>final RunningQuery r = rSparqlQueries.next();<NEW_LINE>modelRunningQueries.add(r.getModelRunningQuery());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>{<NEW_LINE>Iterator<RunningQuery> rUpdateQueries = getPendingUpdates(requestedQueryIds).iterator();<NEW_LINE>while (rUpdateQueries.hasNext()) {<NEW_LINE>final RunningQuery r = rUpdateQueries.next();<NEW_LINE>modelRunningQueries.add(r.getModelRunningQuery());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Build and send the JSON Response<NEW_LINE><MASK><NEW_LINE>} | JsonHelper.writeRunningQueryList(w, modelRunningQueries); |
1,173,828 | static ASelectableCondition load(final XMLElement element) {<NEW_LINE>final String item = element.getAttribute(NodeTextCompareCondition.ITEM, TextController.FILTER_NODE);<NEW_LINE>final String valueString = element.getAttribute(NodeTextCompareCondition.VALUE, null);<NEW_LINE>final Object value;<NEW_LINE>if (valueString != null)<NEW_LINE>value = valueString;<NEW_LINE>else {<NEW_LINE>final String object = element.getAttribute(NodeTextCompareCondition.OBJECT, null);<NEW_LINE>value = TypeReference.create(object);<NEW_LINE>}<NEW_LINE>final boolean matchCase = TreeXmlReader.xmlToBoolean(element.getAttribute(CompareConditionAdapter.MATCH_CASE, null));<NEW_LINE>final int compResult = Integer.parseInt(element.getAttribute(NodeTextCompareCondition.COMPARATION_RESULT, null));<NEW_LINE>final boolean succeed = TreeXmlReader.xmlToBoolean(element.getAttribute(NodeTextCompareCondition.SUCCEED, null));<NEW_LINE>final boolean matchApproximately = TreeXmlReader.xmlToBoolean(element.getAttribute(NodeTextCompareCondition.MATCH_APPROXIMATELY, null));<NEW_LINE>return new NodeTextCompareCondition(item, value, matchCase, compResult, succeed, matchApproximately, Boolean.valueOf(element.<MASK><NEW_LINE>} | getAttribute(IGNORE_DIACRITICS, null))); |
1,491,982 | protected JComponent createContent() {<NEW_LINE>myMouseMotionListener = new MyMouseMotionListener();<NEW_LINE>myMouseListener = new MyMouseListener();<NEW_LINE>ListPopupStep<Object> step = getListStep();<NEW_LINE>myListModel = new ListPopupModel(this, getSpeedSearch(), step);<NEW_LINE>myList = new MyList();<NEW_LINE>if (myStep.getTitle() != null) {<NEW_LINE>myList.getAccessibleContext().setAccessibleName(myStep.getTitle());<NEW_LINE>}<NEW_LINE>if (step instanceof ListPopupStepEx) {<NEW_LINE>((ListPopupStepEx) step).setEmptyText(myList.getEmptyText());<NEW_LINE>}<NEW_LINE>myList.setSelectionModel(new MyListSelectionModel());<NEW_LINE>selectFirstSelectableItem();<NEW_LINE>Insets padding = UIUtil.getListViewportPadding();<NEW_LINE>myList.setBorder(new EmptyBorder(padding));<NEW_LINE>ScrollingUtil.installActions(myList);<NEW_LINE><MASK><NEW_LINE>registerAction("handleSelection1", KeyEvent.VK_ENTER, 0, new AbstractAction() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>handleSelect(true);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>myList.getActionMap().put(ListActions.Right.ID, new AbstractAction() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>handleSelect(false);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>myList.getActionMap().put(ListActions.Left.ID, new AbstractAction() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>if (isClosableByLeftArrow()) {<NEW_LINE>goBack();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>myList.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));<NEW_LINE>return myList;<NEW_LINE>} | myList.setCellRenderer(getListElementRenderer()); |
798,629 | private NamedAttributeWriter createJspAttributeWriter(Element attributeElement, boolean isAttrFragment) throws JspCoreException {<NEW_LINE>int methodNesting = ((Integer) persistentData.get("methodNesting")).intValue();<NEW_LINE>String name = attributeElement.getAttribute("name");<NEW_LINE>if (name.indexOf(':') != -1) {<NEW_LINE>name = name.substring(name.indexOf(':') + 1);<NEW_LINE>}<NEW_LINE>NamedAttributeWriter attributeWriter = new NamedAttributeWriter(name, GeneratorUtils.nextTemporaryVariableName(persistentData));<NEW_LINE>if (isAttrFragment) {<NEW_LINE>attributeWriter.print("javax.servlet.jsp.tagext.JspFragment " + attributeWriter.getVarName() + " = ");<NEW_LINE>// PK65013<NEW_LINE>FragmentHelperClassWriter.FragmentWriter fragment = fragmentHelperClassWriter.openFragment(element, tagHandlerVar, methodNesting, pageContextVar);<NEW_LINE>attributeWriter.print("new " + fragmentHelperClassWriter.getClassName() + "( ");<NEW_LINE>if (jspOptions.isUsePageTagPool() || jspOptions.isUseThreadTagPool()) {<NEW_LINE>attributeWriter.print("_jspx_TagLookup, ");<NEW_LINE>}<NEW_LINE>String pushBodyCountVar = (String) persistentData.get("pushBodyCountVar");<NEW_LINE>// PK65013<NEW_LINE>attributeWriter.print(fragment.getId() + ", " + pageContextVar + ", " + tagHandlerVar + ", " + pushBodyCountVar + ")");<NEW_LINE>attributeWriter.println(";");<NEW_LINE>attributeWriterMap.put(attributeElement, fragment);<NEW_LINE>generateSetterCall(name, attributeWriter.getVarName(), attributeElement.<MASK><NEW_LINE>} else {<NEW_LINE>attributeWriterMap.put(attributeElement, attributeWriter);<NEW_LINE>}<NEW_LINE>return (attributeWriter);<NEW_LINE>} | getNamespaceURI(), attributeWriter, false); |
117,773 | public NetworkAclAssociation unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>NetworkAclAssociation networkAclAssociation = new NetworkAclAssociation();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 1;<NEW_LINE>while (true) {<NEW_LINE>XMLEvent xmlEvent = context.nextEvent();<NEW_LINE>if (xmlEvent.isEndDocument())<NEW_LINE>return networkAclAssociation;<NEW_LINE>if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {<NEW_LINE>if (context.testExpression("networkAclAssociationId", targetDepth)) {<NEW_LINE>networkAclAssociation.setNetworkAclAssociationId(StringStaxUnmarshaller.getInstance<MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("networkAclId", targetDepth)) {<NEW_LINE>networkAclAssociation.setNetworkAclId(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("subnetId", targetDepth)) {<NEW_LINE>networkAclAssociation.setSubnetId(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent.isEndElement()) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return networkAclAssociation;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ().unmarshall(context)); |
10,286 | private void copyTrns_rgb(byte[] line, byte[] image, int pos, int step) {<NEW_LINE>byte tR = (byte) trnsR, tG = (byte) trnsG, tB = (byte) trnsB;<NEW_LINE>int l = line.length / 3;<NEW_LINE>for (int i = 0, oPos = pos; i < l; oPos += step * 4, ++i) {<NEW_LINE>byte r = line[i * 3], g = line[i * 3 + 1], b = line[i * 3 + 2];<NEW_LINE>image[oPos + 0] = r;<NEW_LINE><MASK><NEW_LINE>image[oPos + 2] = b;<NEW_LINE>image[oPos + 3] = (r == tR && g == tG && b == tB) ? 0 : (byte) 255;<NEW_LINE>}<NEW_LINE>} | image[oPos + 1] = g; |
1,633,483 | public SortDefinition unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>SortDefinition sortDefinition = new SortDefinition();<NEW_LINE>int originalDepth = context.getCurrentDepth();<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("Key", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>sortDefinition.setKey(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("SortOrder", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>sortDefinition.setSortOrder(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 sortDefinition;<NEW_LINE>} | class).unmarshall(context)); |
252,752 | public void create(final int theInputCount, final int theIdealCount) {<NEW_LINE>try {<NEW_LINE>this.inputCount = theInputCount;<NEW_LINE>this.idealCount = theIdealCount;<NEW_LINE>final double[] input = new double[inputCount];<NEW_LINE>final double[] ideal = new double[idealCount];<NEW_LINE>this.file.delete();<NEW_LINE>this.raf = new RandomAccessFile(this.file, "rw");<NEW_LINE>this.raf.setLength(0);<NEW_LINE>this.fc = this.raf.getChannel();<NEW_LINE>this.headerBuffer.clear();<NEW_LINE>this.headerBuffer.order(ByteOrder.LITTLE_ENDIAN);<NEW_LINE>this.headerBuffer<MASK><NEW_LINE>this.headerBuffer.put((byte) 'N');<NEW_LINE>this.headerBuffer.put((byte) 'C');<NEW_LINE>this.headerBuffer.put((byte) 'O');<NEW_LINE>this.headerBuffer.put((byte) 'G');<NEW_LINE>this.headerBuffer.put((byte) '-');<NEW_LINE>this.headerBuffer.put((byte) '0');<NEW_LINE>this.headerBuffer.put((byte) '0');<NEW_LINE>this.headerBuffer.putDouble(input.length);<NEW_LINE>this.headerBuffer.putDouble(ideal.length);<NEW_LINE>this.numberOfRecords = 0;<NEW_LINE>this.recordCount = this.inputCount + this.idealCount + 1;<NEW_LINE>this.recordSize = this.recordCount * EncogEGBFile.DOUBLE_SIZE;<NEW_LINE>this.recordBuffer = ByteBuffer.allocate(this.recordSize);<NEW_LINE>this.headerBuffer.flip();<NEW_LINE>this.fc.write(this.headerBuffer);<NEW_LINE>} catch (final IOException ex) {<NEW_LINE>throw new BufferedDataError(ex);<NEW_LINE>}<NEW_LINE>} | .put((byte) 'E'); |
1,654,475 | void monitor() {<NEW_LINE>if (LOG.isDebugEnabled()) {<NEW_LINE>LOG.debug("Starting health monitor check");<NEW_LINE>}<NEW_LINE>List<Publisher<HealthResult>> healthResults = healthIndicators.stream().map(HealthIndicator::getResult).<MASK><NEW_LINE>Flux<HealthResult> reactiveSequence = Flux.merge(healthResults).filter(healthResult -> {<NEW_LINE>HealthStatus status = healthResult.getStatus();<NEW_LINE>return status.equals(HealthStatus.DOWN) || !status.getOperational().orElse(true);<NEW_LINE>});<NEW_LINE>reactiveSequence.next().subscribe(new Subscriber<HealthResult>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onSubscribe(Subscription s) {<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onNext(HealthResult healthResult) {<NEW_LINE>HealthStatus status = healthResult.getStatus();<NEW_LINE>if (LOG.isDebugEnabled()) {<NEW_LINE>LOG.debug("Health monitor check failed with status {}", status);<NEW_LINE>}<NEW_LINE>currentHealthStatus.update(status);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onError(Throwable e) {<NEW_LINE>if (LOG.isErrorEnabled()) {<NEW_LINE>LOG.error("Health monitor check failed with exception: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>currentHealthStatus.update(HealthStatus.DOWN.describe("Error occurred running health check: " + e.getMessage()));<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onComplete() {<NEW_LINE>if (LOG.isDebugEnabled()) {<NEW_LINE>LOG.debug("Health monitor check passed.");<NEW_LINE>}<NEW_LINE>currentHealthStatus.update(HealthStatus.UP);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | collect(Collectors.toList()); |
1,197,644 | public List<GroupByResult>[] trimFinalResults(Map<String, Comparable>[] finalResultMaps) {<NEW_LINE>int numAggregationFunctions = _aggregationFunctions.length;<NEW_LINE>List<GroupByResult>[] trimmedResults = new List[numAggregationFunctions];<NEW_LINE>for (int i = 0; i < numAggregationFunctions; i++) {<NEW_LINE>LinkedList<GroupByResult> <MASK><NEW_LINE>trimmedResults[i] = groupByResults;<NEW_LINE>Map<String, Comparable> finalResultMap = finalResultMaps[i];<NEW_LINE>if (finalResultMap.isEmpty()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// Final result is always comparable<NEW_LINE>Sorter sorter = getSorter(_limit, _aggregationFunctions[i], true);<NEW_LINE>// Add results into sorter<NEW_LINE>for (Map.Entry<String, Comparable> entry : finalResultMap.entrySet()) {<NEW_LINE>sorter.add(entry.getKey(), entry.getValue());<NEW_LINE>}<NEW_LINE>// Dump trimmed results into list<NEW_LINE>sorter.dumpToGroupByResults(groupByResults, _numGroupByExpressions);<NEW_LINE>}<NEW_LINE>return trimmedResults;<NEW_LINE>} | groupByResults = new LinkedList<>(); |
1,326,744 | public Address creatingFunction(ElfLoadHelper elfLoadHelper, Address functionAddress) {<NEW_LINE>Program program = elfLoadHelper.getProgram();<NEW_LINE>if ((functionAddress.getOffset() & 1) != 0) {<NEW_LINE>Register <MASK><NEW_LINE>if (tmodeRegister == null) {<NEW_LINE>elfLoadHelper.log("TMode mode not supported, unable to mark address as Thumb: " + functionAddress);<NEW_LINE>return functionAddress;<NEW_LINE>}<NEW_LINE>// align address<NEW_LINE>functionAddress = functionAddress.previous();<NEW_LINE>try {<NEW_LINE>program.getProgramContext().setValue(tmodeRegister, functionAddress, functionAddress, BigInteger.ONE);<NEW_LINE>} catch (ContextChangeException e) {<NEW_LINE>// ignore since should not be instructions at time of import<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if ((functionAddress.getOffset() % 4) == 2) {<NEW_LINE>// The combination bit[1:0] = 0b10 is reserved.<NEW_LINE>elfLoadHelper.log("Function address is two bit aligned (reserved per ARM manual): " + functionAddress);<NEW_LINE>}<NEW_LINE>return functionAddress;<NEW_LINE>} | tmodeRegister = program.getRegister("TMode"); |
176,071 | public void engineExplorationV1(KernelPackage kernelPackage) {<NEW_LINE>for (int i = 0; i < MAX_DEVICES; i++) {<NEW_LINE>for (int j = 0; j < MAX_DEVICES; j++) {<NEW_LINE>// We play with 2 devices<NEW_LINE>TaskSchedule s0 = new TaskSchedule("x" + i);<NEW_LINE>TornadoRuntime.setProperty("x" + i + ".t" + j + ".device", "0:" + DEVICE_INDEXES[i]);<NEW_LINE>System.out.println("x" + i + ".t" + j + ".device" <MASK><NEW_LINE>s0.task("t" + j, Hybrid::saxpy, kernelPackage.alpha, kernelPackage.x, kernelPackage.y);<NEW_LINE>s0.streamOut(kernelPackage.z);<NEW_LINE>s0.execute();<NEW_LINE>TaskSchedule s1 = new TaskSchedule("v" + i);<NEW_LINE>TornadoRuntime.setProperty("v" + i + ".t" + j + ".device", "0:" + DEVICE_INDEXES[j]);<NEW_LINE>System.out.println("v" + i + ".t" + j + ".device" + "0:" + DEVICE_INDEXES[j]);<NEW_LINE>s1.task("t" + j, Hybrid::vectorAddition, kernelPackage.x, kernelPackage.y, kernelPackage.z);<NEW_LINE>s1.streamOut(kernelPackage.z);<NEW_LINE>s1.execute();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>System.out.println(Arrays.toString(kernelPackage.z));<NEW_LINE>} | + "0:" + DEVICE_INDEXES[i]); |
1,803,136 | public void registerServerAliases() {<NEW_LINE>Map<String, List<String>> values = this.server.getCommandAliases();<NEW_LINE>for (Map.Entry<String, List<String>> entry : values.entrySet()) {<NEW_LINE>String alias = entry.getKey();<NEW_LINE>List<String<MASK><NEW_LINE>if (alias.contains(" ") || alias.contains(":")) {<NEW_LINE>this.server.getLogger().warning(this.server.getLanguage().translateString("nukkit.command.alias.illegal", alias));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>List<String> targets = new ArrayList<>();<NEW_LINE>String bad = "";<NEW_LINE>for (String commandString : commandStrings) {<NEW_LINE>String[] args = commandString.split(" ");<NEW_LINE>Command command = this.getCommand(args[0]);<NEW_LINE>if (command == null) {<NEW_LINE>if (bad.length() > 0) {<NEW_LINE>bad += ", ";<NEW_LINE>}<NEW_LINE>bad += commandString;<NEW_LINE>} else {<NEW_LINE>targets.add(commandString);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (bad.length() > 0) {<NEW_LINE>this.server.getLogger().warning(this.server.getLanguage().translateString("nukkit.command.alias.notFound", new String[] { alias, bad }));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (!targets.isEmpty()) {<NEW_LINE>this.knownCommands.put(alias.toLowerCase(), new FormattedCommandAlias(alias.toLowerCase(), targets));<NEW_LINE>} else {<NEW_LINE>this.knownCommands.remove(alias.toLowerCase());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | > commandStrings = entry.getValue(); |
1,600,975 | private static void drawStaticNewRevision(final AbstractSunburstGUI pGUI, final PGraphics pGraphic) {<NEW_LINE>assert pGraphic != null;<NEW_LINE>if (pGUI.mDepthMax > pGUI.mOldDepthMax + 1) {<NEW_LINE>pGraphic.pushMatrix();<NEW_LINE>pGraphic.textAlign(PConstants.LEFT, PConstants.CENTER);<NEW_LINE>float arcRadius = calculateNewRadius(pGUI, pGraphic);<NEW_LINE>if (pGUI.mParent.recorder != null) {<NEW_LINE>drawRevision(pGUI, pGUI.mParent.recorder, arcRadius);<NEW_LINE>}<NEW_LINE>drawRevision(pGUI, pGraphic, arcRadius);<NEW_LINE>final String text = new StringBuilder("changed nodes in revision ").append(pGUI.mSelectedRev).append(" from revision ").append(pGUI.mOldSelectedRev).toString();<NEW_LINE>arcRadius = pGUI.calcEqualAreaRadius(pGUI.mDepthMax - 1, pGUI.mDepthMax);<NEW_LINE>arcRadius += (pGUI.calcEqualAreaRadius(pGUI.mDepthMax, pGUI.mDepthMax) - arcRadius) / 2;<NEW_LINE>pGraphic.stroke(0f);<NEW_LINE>pGraphic.fill(400f);<NEW_LINE>final float arc = draw(pGraphic, text, arcRadius, 0, EDisplay.NO, EReverseDirection.NO);<NEW_LINE>final float theta = PConstants.PI + 0.5f * PConstants.PI - 0.5f * arc;<NEW_LINE>if (pGUI.mParent.recorder != null) {<NEW_LINE>draw(pGUI.mParent.recorder, text, arcRadius, theta, EDisplay.YES, EReverseDirection.NO);<NEW_LINE>}<NEW_LINE>draw(pGraphic, text, arcRadius, theta, <MASK><NEW_LINE>pGraphic.popMatrix();<NEW_LINE>}<NEW_LINE>} | EDisplay.YES, EReverseDirection.NO); |
472,421 | private PhysicalPropertySet enforceProperty(PhysicalPropertySet outputProperty, PhysicalPropertySet requiredProperty) {<NEW_LINE>boolean satisfyOrderProperty = outputProperty.getSortProperty().<MASK><NEW_LINE>boolean satisfyDistributionProperty = outputProperty.getDistributionProperty().isSatisfy(requiredProperty.getDistributionProperty());<NEW_LINE>PhysicalPropertySet enforcedProperty = null;<NEW_LINE>if (!satisfyDistributionProperty && satisfyOrderProperty) {<NEW_LINE>if (requiredProperty.getSortProperty().isEmpty()) {<NEW_LINE>enforcedProperty = enforceDistribute(outputProperty);<NEW_LINE>} else {<NEW_LINE>PhysicalPropertySet newProperty = new PhysicalPropertySet(DistributionProperty.EMPTY, SortProperty.EMPTY);<NEW_LINE>groupExpression.getGroup().replaceBestExpressionProperty(outputProperty, newProperty, groupExpression.getCost(outputProperty));<NEW_LINE>enforcedProperty = enforceSortAndDistribute(newProperty, requiredProperty);<NEW_LINE>}<NEW_LINE>} else if (satisfyDistributionProperty && !satisfyOrderProperty) {<NEW_LINE>enforcedProperty = enforceSort(outputProperty);<NEW_LINE>} else if (!satisfyDistributionProperty) {<NEW_LINE>enforcedProperty = enforceSortAndDistribute(outputProperty, requiredProperty);<NEW_LINE>}<NEW_LINE>return enforcedProperty;<NEW_LINE>} | isSatisfy(requiredProperty.getSortProperty()); |
1,774,937 | public ListJobsResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListJobsResult listJobsResult = new ListJobsResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><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 listJobsResult;<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("JobNames", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listJobsResult.setJobNames(new ListUnmarshaller<String>(context.getUnmarshaller(String.class)).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("NextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listJobsResult.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 listJobsResult;<NEW_LINE>} | String currentParentElement = context.getCurrentParentElement(); |
548,998 | protected void addField(MetaClass metaClass, MetaProperty metaProperty, Entity item, FieldGroup fieldGroup, boolean required, boolean custom, boolean readOnly, Collection<FieldGroup.FieldConfig> customFields) {<NEW_LINE>if (!attrViewPermitted(metaClass, metaProperty))<NEW_LINE>return;<NEW_LINE>if ((metaProperty.getType() == MetaProperty.Type.COMPOSITION || metaProperty.getType() == MetaProperty.Type.ASSOCIATION) && !entityOpPermitted(metaProperty.getRange().asClass(), EntityOp.READ))<NEW_LINE>return;<NEW_LINE>FieldGroup.FieldConfig field = fieldGroup.createField(metaProperty.getName());<NEW_LINE>field.setProperty(metaProperty.getName());<NEW_LINE>field.setCaption(getPropertyCaption(metaClass, metaProperty));<NEW_LINE>field.setCustom(custom);<NEW_LINE>field.setRequired(required);<NEW_LINE>if (metaProperty.getRange().isClass() && !metadata.getTools().isEmbedded(metaProperty)) {<NEW_LINE>field.setEditable(metadata.getTools().isOwningSide(metaProperty) && !readOnly);<NEW_LINE>} else {<NEW_LINE>field.setEditable(!readOnly);<NEW_LINE>}<NEW_LINE>field.setWidth("400px");<NEW_LINE>if (requireTextArea(metaProperty, item)) {<NEW_LINE>Element <MASK><NEW_LINE>root.addAttribute("rows", "3");<NEW_LINE>field.setXmlDescriptor(root);<NEW_LINE>}<NEW_LINE>if (focusFieldId == null && !readOnly) {<NEW_LINE>focusFieldId = field.getId();<NEW_LINE>focusFieldGroup = fieldGroup;<NEW_LINE>}<NEW_LINE>if (required) {<NEW_LINE>field.setRequiredMessage(messageTools.getDefaultRequiredMessage(metaClass, metaProperty.getName()));<NEW_LINE>}<NEW_LINE>fieldGroup.addField(field);<NEW_LINE>if (custom)<NEW_LINE>customFields.add(field);<NEW_LINE>} | root = DocumentHelper.createElement("textArea"); |
1,590,368 | public void putAndUnlock(ByteArray key, KeyLockHandle<byte[]> handle) {<NEW_LINE>long startTimeNs = -1;<NEW_LINE>if (logger.isTraceEnabled())<NEW_LINE>startTimeNs = System.nanoTime();<NEW_LINE>StoreUtils.assertValidKey(key);<NEW_LINE>DatabaseEntry keyEntry = new DatabaseEntry(key.get());<NEW_LINE>DatabaseEntry valueEntry = new DatabaseEntry();<NEW_LINE>boolean succeeded = false;<NEW_LINE>Transaction transaction = null;<NEW_LINE>try {<NEW_LINE>transaction = <MASK><NEW_LINE>valueEntry.setData(StoreBinaryFormat.toByteArray(handle.getValues()));<NEW_LINE>OperationStatus status = getBdbDatabase().put(transaction, keyEntry, valueEntry);<NEW_LINE>if (status != OperationStatus.SUCCESS)<NEW_LINE>throw new PersistenceFailureException("putAndUnlock operation failed with status: " + status);<NEW_LINE>succeeded = true;<NEW_LINE>} catch (DatabaseException e) {<NEW_LINE>this.bdbEnvironmentStats.reportException(e);<NEW_LINE>logger.error("Error in putAndUnlock for store " + this.getName(), e);<NEW_LINE>throw new PersistenceFailureException(e);<NEW_LINE>} finally {<NEW_LINE>if (succeeded)<NEW_LINE>attemptCommit(transaction);<NEW_LINE>else<NEW_LINE>attemptAbort(transaction);<NEW_LINE>if (logger.isTraceEnabled()) {<NEW_LINE>logger.trace("Completed PUTANDUNLOCK (" + getName() + ") to key " + key + " (keyRef: " + System.identityHashCode(key) + " in " + (System.nanoTime() - startTimeNs) + " ns at " + System.currentTimeMillis());<NEW_LINE>}<NEW_LINE>handle.close();<NEW_LINE>}<NEW_LINE>} | (Transaction) handle.getKeyLock(); |
1,216,953 | public Object copy(Map<Object, Object> refs) {<NEW_LINE>if (isFrozen()) {<NEW_LINE>return this;<NEW_LINE>}<NEW_LINE>QName elemName = new QName(this.name.getNamespaceURI(), this.name.getLocalPart(), this.name.getPrefix());<NEW_LINE>XmlItem xmlItem = new XmlItem(elemName, (XmlSequence<MASK><NEW_LINE>MapValue<BString, BString> attributesMap = xmlItem.getAttributesMap();<NEW_LINE>MapValue<BString, BString> copy = (MapValue<BString, BString>) this.getAttributesMap().copy(refs);<NEW_LINE>if (attributesMap instanceof MapValueImpl) {<NEW_LINE>MapValueImpl<BString, BString> map = (MapValueImpl<BString, BString>) attributesMap;<NEW_LINE>map.putAll((Map<BString, BString>) copy);<NEW_LINE>} else {<NEW_LINE>for (Map.Entry<BString, BString> entry : copy.entrySet()) {<NEW_LINE>attributesMap.put(entry.getKey(), entry.getValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (getAttributesMap().isFrozen()) {<NEW_LINE>attributesMap.freezeDirect();<NEW_LINE>}<NEW_LINE>return xmlItem;<NEW_LINE>} | ) children.copy(refs)); |
1,218,785 | public static XAResourceFactory lookupXAResourceFactory(String filter) {<NEW_LINE>if (tc.isEntryEnabled())<NEW_LINE>Tr.entry(tc, "lookupXAResourceFactory", filter);<NEW_LINE>final BundleContext bundleContext = TxTMHelper.getBundleContext();<NEW_LINE>if (bundleContext == null) {<NEW_LINE>if (tc.isEntryEnabled())<NEW_LINE>Tr.<MASK><NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>ServiceReference[] results = null;<NEW_LINE>try {<NEW_LINE>results = bundleContext.getServiceReferences(XAResourceFactory.class.getCanonicalName(), filter);<NEW_LINE>} catch (InvalidSyntaxException e) {<NEW_LINE>// Wasn't a filter<NEW_LINE>if (tc.isEntryEnabled())<NEW_LINE>Tr.exit(tc, "lookupXAResourceFactory", "not a filter");<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (results == null || results.length <= 0) {<NEW_LINE>if (results == null) {<NEW_LINE>if (tc.isDebugEnabled())<NEW_LINE>Tr.debug(tc, "Results returned from registry are null");<NEW_LINE>} else {<NEW_LINE>if (tc.isDebugEnabled())<NEW_LINE>Tr.debug(tc, "Results of length " + results.length + " returned from registry");<NEW_LINE>}<NEW_LINE>if (tc.isEntryEnabled())<NEW_LINE>Tr.exit(tc, "lookupXAResourceFactory", null);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (tc.isDebugEnabled())<NEW_LINE>Tr.debug(tc, "Found " + results.length + " service references in the registry");<NEW_LINE>final XAResourceFactory xaresFactory = (XAResourceFactory) bundleContext.getService(results[0]);<NEW_LINE>if (tc.isEntryEnabled())<NEW_LINE>Tr.exit(tc, "lookupXAResourceFactory", xaresFactory);<NEW_LINE>return xaresFactory;<NEW_LINE>} | exit(tc, "lookupXAResourceFactory", null); |
700,182 | public ListAccountAssignmentsResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListAccountAssignmentsResult listAccountAssignmentsResult = new ListAccountAssignmentsResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><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 listAccountAssignmentsResult;<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("AccountAssignments", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listAccountAssignmentsResult.setAccountAssignments(new ListUnmarshaller<AccountAssignment>(AccountAssignmentJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("NextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listAccountAssignmentsResult.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 listAccountAssignmentsResult;<NEW_LINE>} | String currentParentElement = context.getCurrentParentElement(); |
1,776,832 | public // re-sampling on all data<NEW_LINE>void inferenceAll(int maxIteration) {<NEW_LINE>// initialize test<NEW_LINE>this.test = new ArrayList<Topication>();<NEW_LINE>// initial sampling on testdata<NEW_LINE>ArrayList<LabelSequence> topicSequences = new ArrayList<LabelSequence>();<NEW_LINE>for (Instance instance : testing) {<NEW_LINE>LabelSequence topicSequence = new LabelSequence(topicAlphabet, new int[instanceLength(instance)]);<NEW_LINE>if (false) {<NEW_LINE>// This method not yet obeying its last "false" argument, and must be for this to work<NEW_LINE>// sampleTopicsForOneDoc((FeatureSequence)instance.getData(), topicSequence, false, false);<NEW_LINE>} else {<NEW_LINE>Randoms r = new Randoms();<NEW_LINE>FeatureSequence fs = (FeatureSequence) instance.getData();<NEW_LINE>int[] topics = topicSequence.getFeatures();<NEW_LINE>for (int i = 0; i < topics.length; i++) {<NEW_LINE>int type = fs.getIndexAtPosition(i);<NEW_LINE>topics[i] = r.nextInt(numTopics);<NEW_LINE>typeTopicCounts[type].putOrAdd(topics[i], 1, 1);<NEW_LINE>tokensPerTopic[topics[i]]++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>topicSequences.add(topicSequence);<NEW_LINE>}<NEW_LINE>// construct test<NEW_LINE>assert (testing.size() == topicSequences.size());<NEW_LINE>for (int i = 0; i < testing.size(); i++) {<NEW_LINE>Topication t = new Topication(testing.get(i), this, topicSequences.get(i));<NEW_LINE>test.add(t);<NEW_LINE>}<NEW_LINE>long startTime = System.currentTimeMillis();<NEW_LINE>// loop<NEW_LINE>int iter = 0;<NEW_LINE>for (; iter <= maxIteration; iter++) {<NEW_LINE>if (iter % 100 == 0) {<NEW_LINE>System.out.print("Iteration: " + iter);<NEW_LINE>System.out.println();<NEW_LINE>}<NEW_LINE>// TODO<NEW_LINE>int numDocs = test.size();<NEW_LINE>for (int di = 0; di < numDocs; di++) {<NEW_LINE>FeatureSequence tokenSequence = (FeatureSequence) test.get(di).instance.getData();<NEW_LINE>LabelSequence topicSequence = test.get(di).topicSequence;<NEW_LINE>sampleTopicsForOneTestDocAll(tokenSequence, topicSequence);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>long seconds = Math.round((System.currentTimeMillis() - startTime) / 1000.0);<NEW_LINE>long minutes = seconds / 60;<NEW_LINE>seconds %= 60;<NEW_LINE>long hours = minutes / 60;<NEW_LINE>minutes %= 60;<NEW_LINE>long days = hours / 24;<NEW_LINE>hours %= 24;<NEW_LINE>System.out.print("\nTotal inferencing time: ");<NEW_LINE>if (days != 0) {<NEW_LINE><MASK><NEW_LINE>System.out.print(" days ");<NEW_LINE>}<NEW_LINE>if (hours != 0) {<NEW_LINE>System.out.print(hours);<NEW_LINE>System.out.print(" hours ");<NEW_LINE>}<NEW_LINE>if (minutes != 0) {<NEW_LINE>System.out.print(minutes);<NEW_LINE>System.out.print(" minutes ");<NEW_LINE>}<NEW_LINE>System.out.print(seconds);<NEW_LINE>System.out.println(" seconds");<NEW_LINE>} | System.out.print(days); |
679,903 | protected void doMakeVisible(final int masterIndex, int[] startLines, int[] endLines, final boolean animate) {<NEW_LINE>final List<? extends Editor> editors = getEditors();<NEW_LINE>final List<? extends ScrollHelper> helpers = getScrollHelpers();<NEW_LINE>final int count = editors.size();<NEW_LINE>assert startLines.length == count;<NEW_LINE>assert endLines.length == count;<NEW_LINE>final int[] offsets = getTargetOffsets(editors.toArray(new Editor[count]), startLines, endLines, -1);<NEW_LINE>final int[] startOffsets = new int[count];<NEW_LINE>for (int i = 0; i < count; i++) {<NEW_LINE>startOffsets[i] = editors.get(i).getScrollingModel().getVisibleArea().y;<NEW_LINE>}<NEW_LINE>final Editor <MASK><NEW_LINE>final int masterOffset = offsets[masterIndex];<NEW_LINE>final int masterStartOffset = startOffsets[masterIndex];<NEW_LINE>for (ScrollHelper helper : helpers) {<NEW_LINE>helper.setAnchor(startOffsets[helper.getMasterIndex()], offsets[helper.getMasterIndex()], startOffsets[helper.getSlaveIndex()], offsets[helper.getSlaveIndex()]);<NEW_LINE>}<NEW_LINE>// animation will be canceled by "scroll vertically" anyway<NEW_LINE>doScrollHorizontally(masterEditor, 0, false);<NEW_LINE>doScrollVertically(masterEditor, masterOffset, animate);<NEW_LINE>masterEditor.getScrollingModel().runActionOnScrollingFinished(() -> {<NEW_LINE>for (ScrollHelper helper : helpers) {<NEW_LINE>helper.removeAnchor();<NEW_LINE>}<NEW_LINE>int masterFinalOffset = masterEditor.getScrollingModel().getVisibleArea().y;<NEW_LINE>boolean animateSlaves = animate && masterFinalOffset == masterStartOffset;<NEW_LINE>for (int i = 0; i < count; i++) {<NEW_LINE>if (i == masterIndex)<NEW_LINE>continue;<NEW_LINE>Editor editor = editors.get(i);<NEW_LINE>int finalOffset = editor.getScrollingModel().getVisibleArea().y;<NEW_LINE>if (finalOffset != offsets[i]) {<NEW_LINE>enterDisableScrollSection();<NEW_LINE>doScrollVertically(editor, offsets[i], animateSlaves);<NEW_LINE>editor.getScrollingModel().runActionOnScrollingFinished(this::exitDisableScrollSection);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | masterEditor = editors.get(masterIndex); |
1,520,345 | public void visitMethodCallExpression(MethodCallExpression call) {<NEW_LINE>Space fmt = whitespace();<NEW_LINE>ImplicitDot implicitDot = null;<NEW_LINE>JRightPadded<Expression> select = null;<NEW_LINE>if (!call.isImplicitThis()) {<NEW_LINE>Expression selectExpr = visit(call.getObjectExpression());<NEW_LINE>int saveCursor = cursor;<NEW_LINE>Space afterSelect = whitespace();<NEW_LINE>if (source.charAt(cursor) == '.' || source.charAt(cursor) == '?' || source.charAt(cursor) == '*') {<NEW_LINE>cursor = saveCursor;<NEW_LINE>afterSelect = sourceBefore(call.isSpreadSafe() ? "*." : call.<MASK><NEW_LINE>} else {<NEW_LINE>implicitDot = new ImplicitDot(randomId());<NEW_LINE>}<NEW_LINE>select = JRightPadded.build(selectExpr).withAfter(afterSelect);<NEW_LINE>}<NEW_LINE>J.Identifier name = new J.Identifier(randomId(), sourceBefore(call.getMethodAsString()), Markers.EMPTY, call.getMethodAsString(), null, null);<NEW_LINE>if (call.isSpreadSafe()) {<NEW_LINE>name = name.withMarkers(name.getMarkers().add(new StarDot(randomId())));<NEW_LINE>}<NEW_LINE>if (call.isSafe()) {<NEW_LINE>name = name.withMarkers(name.getMarkers().add(new NullSafe(randomId())));<NEW_LINE>}<NEW_LINE>if (implicitDot != null) {<NEW_LINE>name = name.withMarkers(name.getMarkers().add(implicitDot));<NEW_LINE>}<NEW_LINE>JContainer<Expression> args = visit(call.getArguments());<NEW_LINE>MethodNode methodNode = (MethodNode) call.getNodeMetaData().get(StaticTypesMarker.DIRECT_METHOD_CALL_TARGET);<NEW_LINE>JavaType.Method methodType = typeMapping.methodType(methodNode);<NEW_LINE>queue.add(new J.MethodInvocation(randomId(), fmt, Markers.EMPTY, select, null, name, args, methodType));<NEW_LINE>} | isSafe() ? "?." : "."); |
1,814,501 | public void xor(final RoaringBitmap x2) {<NEW_LINE>int pos1 = 0, pos2 = 0;<NEW_LINE><MASK><NEW_LINE>final int length2 = x2.highLowContainer.size();<NEW_LINE>main: if (pos1 < length1 && pos2 < length2) {<NEW_LINE>char s1 = highLowContainer.getKeyAtIndex(pos1);<NEW_LINE>char s2 = x2.highLowContainer.getKeyAtIndex(pos2);<NEW_LINE>while (true) {<NEW_LINE>if (s1 == s2) {<NEW_LINE>final Container c = highLowContainer.getContainerAtIndex(pos1).ixor(x2.highLowContainer.getContainerAtIndex(pos2));<NEW_LINE>if (!c.isEmpty()) {<NEW_LINE>this.highLowContainer.setContainerAtIndex(pos1, c);<NEW_LINE>pos1++;<NEW_LINE>} else {<NEW_LINE>highLowContainer.removeAtIndex(pos1);<NEW_LINE>--length1;<NEW_LINE>}<NEW_LINE>pos2++;<NEW_LINE>if ((pos1 == length1) || (pos2 == length2)) {<NEW_LINE>break main;<NEW_LINE>}<NEW_LINE>s1 = highLowContainer.getKeyAtIndex(pos1);<NEW_LINE>s2 = x2.highLowContainer.getKeyAtIndex(pos2);<NEW_LINE>} else if (s1 < s2) {<NEW_LINE>pos1++;<NEW_LINE>if (pos1 == length1) {<NEW_LINE>break main;<NEW_LINE>}<NEW_LINE>s1 = highLowContainer.getKeyAtIndex(pos1);<NEW_LINE>} else {<NEW_LINE>highLowContainer.insertNewKeyValueAt(pos1, s2, x2.highLowContainer.getContainerAtIndex(pos2).clone());<NEW_LINE>pos1++;<NEW_LINE>length1++;<NEW_LINE>pos2++;<NEW_LINE>if (pos2 == length2) {<NEW_LINE>break main;<NEW_LINE>}<NEW_LINE>s2 = x2.highLowContainer.getKeyAtIndex(pos2);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (pos1 == length1) {<NEW_LINE>highLowContainer.appendCopy(x2.highLowContainer, pos2, length2);<NEW_LINE>}<NEW_LINE>} | int length1 = highLowContainer.size(); |
1,266,866 | private void writeNode(NodeVisitor parentNodeVisitor, AXmlNode node) {<NEW_LINE>NodeVisitor childNodeVisitor = parentNodeVisitor.child(node.getNamespace(), node.getTag());<NEW_LINE>// do not add excluded nodes<NEW_LINE>if (!node.isIncluded()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Write the attributes<NEW_LINE>for (AXmlAttribute<?> attr : node.getAttributes().values()) {<NEW_LINE>String namespace = attr.getNamespace();<NEW_LINE>if (namespace != null && namespace.isEmpty())<NEW_LINE>namespace = null;<NEW_LINE>int resourceId = attr.getResourceId();<NEW_LINE>if (resourceId < 0 && !node.getTag().equals("manifest"))<NEW_LINE>resourceId = <MASK><NEW_LINE>int attrType = attr.getAttributeType();<NEW_LINE>if (attrType < 0)<NEW_LINE>attrType = attr.getType();<NEW_LINE>childNodeVisitor.attr(namespace, attr.getName(), resourceId, attrType, attr.getValue());<NEW_LINE>}<NEW_LINE>// Write the child nodes<NEW_LINE>for (AXmlNode child : node.getChildren()) writeNode(childNodeVisitor, child);<NEW_LINE>childNodeVisitor.end();<NEW_LINE>} | getAttributeResourceId(attr.getName()); |
90,743 | /*<NEW_LINE>* (non-Javadoc)<NEW_LINE>*<NEW_LINE>* @see edu.umd.cs.findbugs.bcel.OpcodeStackDetector#sawOpcode(int)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public void sawOpcode(int seen) {<NEW_LINE>if (seen == INVOKEVIRTUAL) {<NEW_LINE>if ("equals".equals(getNameConstantOperand()) && "(Ljava/lang/Object;)Z".equals(getSigConstantOperand())) {<NEW_LINE>OpcodeStack.Item item = stack.getStackItem(1);<NEW_LINE>ClassDescriptor c = DescriptorFactory.createClassDescriptorFromSignature(item.getSignature());<NEW_LINE>check(c);<NEW_LINE>} else if ("java/lang/Class".equals(getClassConstantOperand()) && ("isInstance".equals(getNameConstantOperand()) || "cast".equals(getNameConstantOperand()))) {<NEW_LINE>OpcodeStack.Item <MASK><NEW_LINE>if ("Ljava/lang/Class;".equals(item.getSignature())) {<NEW_LINE>Object value = item.getConstant();<NEW_LINE>if (value instanceof String) {<NEW_LINE>ClassDescriptor c = DescriptorFactory.createClassDescriptor((String) value);<NEW_LINE>check(c);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (seen == INSTANCEOF || seen == CHECKCAST) {<NEW_LINE>check(getClassDescriptorOperand());<NEW_LINE>}<NEW_LINE>} | item = stack.getStackItem(1); |
1,223,885 | private void insertRegionTypes() throws SQLException {<NEW_LINE>Closer closer = Closer.create();<NEW_LINE>try {<NEW_LINE>PreparedStatement stmt = closer.register(conn.prepareStatement("INSERT INTO " + config.getTablePrefix() + "region " + "(id, world_id, type, priority, parent) " + "VALUES " + "(?, ?, ?, ?, NULL)"));<NEW_LINE>for (List<ProtectedRegion> partition : Lists.partition(all, StatementBatch.MAX_BATCH_SIZE)) {<NEW_LINE>for (ProtectedRegion region : partition) {<NEW_LINE>stmt.setString(1, region.getId());<NEW_LINE><MASK><NEW_LINE>stmt.setString(3, SQLRegionDatabase.getRegionTypeName(region));<NEW_LINE>stmt.setInt(4, region.getPriority());<NEW_LINE>stmt.addBatch();<NEW_LINE>}<NEW_LINE>stmt.executeBatch();<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>closer.closeQuietly();<NEW_LINE>}<NEW_LINE>} | stmt.setInt(2, worldId); |
1,006,763 | public static void merge(String serverVariableName, ServerVariable from, Map<String, ServerVariable> to, boolean override) {<NEW_LINE>if (from == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>org.eclipse.microprofile.openapi.models.servers.ServerVariable variable = new ServerVariableImpl();<NEW_LINE>variable.setDefaultValue(mergeProperty(variable.getDefaultValue(), from<MASK><NEW_LINE>variable.setDescription(mergeProperty(variable.getDescription(), from.getDescription(), override));<NEW_LINE>if (from.getEnumeration() != null && !from.getEnumeration().isEmpty()) {<NEW_LINE>if (variable.getEnumeration() == null) {<NEW_LINE>variable.setEnumeration(createList());<NEW_LINE>}<NEW_LINE>for (String value : from.getEnumeration()) {<NEW_LINE>variable.addEnumeration(value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if ((to.containsKey(serverVariableName) && override) || !to.containsKey(serverVariableName)) {<NEW_LINE>to.put(serverVariableName, variable);<NEW_LINE>}<NEW_LINE>} | .getDefaultValue(), override)); |
1,837,028 | private void checkValidity() {<NEW_LINE>if (booleanReleaseCalled.get()) {<NEW_LINE>String id = "none";<NEW_LINE>if ((wsBBRoot != null) && (wsBBRoot.pool != null)) {<NEW_LINE>id = Integer.toString(wsBBRoot.getID());<NEW_LINE>}<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(tc, "Attempt to access WsByteBuffer that was already released." + "\nWsByteBuffer: ID: " + id + " Sub ID: " + this.oByteBuffer);<NEW_LINE>}<NEW_LINE>RuntimeException iae = new RuntimeException("Invalid call to WsByteBuffer method. Buffer has already been released." + "\nWsByteBuffer: ID: " + <MASK><NEW_LINE>FFDCFilter.processException(iae, getClass().getName() + ".checkValidity", "1", this);<NEW_LINE>throw iae;<NEW_LINE>}<NEW_LINE>if (ownerID != null) {<NEW_LINE>// if there is a ownerID, then leak detection is on, so record<NEW_LINE>// that the buffer has been accessed.<NEW_LINE>this.lastAccessTime = System.currentTimeMillis();<NEW_LINE>}<NEW_LINE>} | id + "\nBuffer: " + this.oByteBuffer); |
994,201 | private void initAttributes() {<NEW_LINE>globalAlpha = 1.0f;<NEW_LINE>blendmode = Mode.SRC_OVER;<NEW_LINE>fillPaint = Color.BLACK;<NEW_LINE>strokePaint = Color.BLACK;<NEW_LINE>linewidth = 1.0f;<NEW_LINE>linecap = BasicStroke.CAP_SQUARE;<NEW_LINE>linejoin = BasicStroke.JOIN_MITER;<NEW_LINE>miterlimit = 10f;<NEW_LINE>dashes = null;<NEW_LINE>dashOffset = 0.0f;<NEW_LINE>stroke = null;<NEW_LINE><MASK><NEW_LINE>// ngtext stores no state between render operations<NEW_LINE>// textLayout stores no state between render operations<NEW_LINE>pgfont = (PGFont) FontHelper.getNativeFont(Font.getDefault());<NEW_LINE>smoothing = SMOOTH_GRAY;<NEW_LINE>imageSmoothing = true;<NEW_LINE>align = ALIGN_LEFT;<NEW_LINE>baseline = VPos.BASELINE.ordinal();<NEW_LINE>transform.setToScale(highestPixelScale, highestPixelScale);<NEW_LINE>clipStack.clear();<NEW_LINE>resetClip(false);<NEW_LINE>} | path.setWindingRule(Path2D.WIND_NON_ZERO); |
1,549,508 | public void execute(final Editor editor, final DataContext dataContext, @Nullable final Producer<Transferable> producer) {<NEW_LINE>final Transferable transferable = EditorModificationUtil.getContentsToPasteToEditor(producer);<NEW_LINE>if (transferable == null)<NEW_LINE>return;<NEW_LINE>if (!CodeInsightUtilBase.prepareEditorForWrite(editor))<NEW_LINE>return;<NEW_LINE>final Document document = editor.getDocument();<NEW_LINE>if (!FileDocumentManager.getInstance().requestWriting(document, dataContext.getData(CommonDataKeys.PROJECT))) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>DataContext context = new DataContext() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Object getData(@NonNls Key dataId) {<NEW_LINE>return PasteAction.TRANSFERABLE_PROVIDER == dataId ? new Producer<Transferable>() {<NEW_LINE><NEW_LINE>@Nullable<NEW_LINE>@Override<NEW_LINE>public Transferable produce() {<NEW_LINE>return transferable;<NEW_LINE>}<NEW_LINE>} : dataContext.getData(dataId);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>final Project project = editor.getProject();<NEW_LINE>if (project == null || editor.isColumnMode() || editor.getCaretModel().getCaretCount() > 1) {<NEW_LINE>if (myOriginalHandler != null) {<NEW_LINE>myOriginalHandler.<MASK><NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final PsiFile file = PsiDocumentManager.getInstance(project).getPsiFile(document);<NEW_LINE>if (file == null) {<NEW_LINE>if (myOriginalHandler != null) {<NEW_LINE>myOriginalHandler.execute(editor, null, context);<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>DumbService.getInstance(project).setAlternativeResolveEnabled(true);<NEW_LINE>document.startGuardedBlockChecking();<NEW_LINE>try {<NEW_LINE>for (PasteProvider provider : Extensions.getExtensions(EP_NAME)) {<NEW_LINE>if (provider.isPasteEnabled(context)) {<NEW_LINE>provider.performPaste(context);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>doPaste(editor, project, file, document, transferable);<NEW_LINE>} catch (ReadOnlyFragmentModificationException e) {<NEW_LINE>EditorActionManager.getInstance().getReadonlyFragmentModificationHandler(document).handle(e);<NEW_LINE>} finally {<NEW_LINE>document.stopGuardedBlockChecking();<NEW_LINE>DumbService.getInstance(project).setAlternativeResolveEnabled(false);<NEW_LINE>}<NEW_LINE>} | execute(editor, null, context); |
1,009,818 | public static ShaderCaseBuzzsaw registerShader_Buzzsaw(ResourceLocation name, String overlayType, Rarity rarity, int colour0, int colour1, int colour2, String additionalTexture, int colourAddtional) {<NEW_LINE>List<ShaderLayer> list = new ArrayList<>();<NEW_LINE>list.add(new ShaderLayer(new ResourceLocation("immersiveengineering:item/shaders/buzzsaw_diesel_0"), colour0));<NEW_LINE>list.add(new ShaderLayer(new ResourceLocation("immersiveengineering:item/shaders/buzzsaw_diesel_0"), colour1));<NEW_LINE>list.add(new ShaderLayer(new ResourceLocation("immersiveengineering:item/shaders/buzzsaw_diesel_1_" + overlayType), colour2));<NEW_LINE>if (additionalTexture != null) {<NEW_LINE>ResourceLocation rl = additionalTexture.indexOf(58) >= 0 ? new ResourceLocation(additionalTexture) : new ResourceLocation("immersiveengineering:item/shaders/buzzsaw_diesel_" + additionalTexture);<NEW_LINE>list.add(new ShaderLayer(rl, colourAddtional));<NEW_LINE>}<NEW_LINE>list.add(new ShaderLayer(new ResourceLocation("immersiveengineering:item/shaders/buzzsaw_diesel_uncoloured"), 0xffffffff));<NEW_LINE>// final pass is for drill head and augers<NEW_LINE>list.add(<MASK><NEW_LINE>ShaderCaseBuzzsaw shader = new ShaderCaseBuzzsaw(list);<NEW_LINE>return registerShaderCase(name, shader, rarity);<NEW_LINE>} | new ShaderLayer(null, 0xffffffff)); |
146,399 | public void execute(String[] args, Console console) {<NEW_LINE>if (args.length > 0) {<NEW_LINE>String itemName = args[0];<NEW_LINE>try {<NEW_LINE>Item item = this.itemRegistry.getItemByPattern(itemName);<NEW_LINE>if (args.length > 1) {<NEW_LINE>String stateName = args[1];<NEW_LINE>State state = TypeParser.parseState(<MASK><NEW_LINE>if (state != null) {<NEW_LINE>eventPublisher.post(ItemEventFactory.createStateEvent(item.getName(), state));<NEW_LINE>console.println("Update has been sent successfully.");<NEW_LINE>} else {<NEW_LINE>console.println("Error: State '" + stateName + "' is not valid for item '" + itemName + "'");<NEW_LINE>console.print("Valid data types are: ( ");<NEW_LINE>for (Class<? extends State> acceptedType : item.getAcceptedDataTypes()) {<NEW_LINE>console.print(acceptedType.getSimpleName() + " ");<NEW_LINE>}<NEW_LINE>console.println(")");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>printUsage(console);<NEW_LINE>}<NEW_LINE>} catch (ItemNotFoundException e) {<NEW_LINE>console.println("Error: Item '" + itemName + "' does not exist.");<NEW_LINE>} catch (ItemNotUniqueException e) {<NEW_LINE>console.print("Error: Multiple items match this pattern: ");<NEW_LINE>for (Item item : e.getMatchingItems()) {<NEW_LINE>console.print(item.getName() + " ");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>printUsage(console);<NEW_LINE>}<NEW_LINE>} | item.getAcceptedDataTypes(), stateName); |
811,257 | private static String generateTeamsUserAadToken() throws MalformedURLException, ExecutionException, InterruptedException {<NEW_LINE>String teamsUserAadToken = "";<NEW_LINE>try {<NEW_LINE>IPublicClientApplication publicClientApplication = PublicClientApplication.builder("<M365_APP_ID>").authority("<M365_AAD_AUTHORITY>" + "/" + "<M365_AAD_TENANT>").build();<NEW_LINE>// M365 scopes<NEW_LINE>Set<String> scopes = Collections.singleton("https://auth.msft.communication.azure.com/VoIP");<NEW_LINE>char[<MASK><NEW_LINE>UserNamePasswordParameters userNamePasswordParameters = UserNamePasswordParameters.builder(scopes, "<MSAL_USERNAME>", password).build();<NEW_LINE>Arrays.fill(password, '0');<NEW_LINE>IAuthenticationResult result = publicClientApplication.acquireToken(userNamePasswordParameters).get();<NEW_LINE>teamsUserAadToken = result.accessToken();<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>return teamsUserAadToken;<NEW_LINE>} | ] password = "<MSAL_PASSWORD>".toCharArray(); |
1,305,022 | private void processData(ImageAddressSpace space) {<NEW_LINE>// JavaRuntime metaRuntime = null;<NEW_LINE>// if (metaImageProcess != null) {<NEW_LINE>// Iterator i2 = metaImageProcess.getRuntimes();<NEW_LINE>// if (i2.hasNext()) {<NEW_LINE>// Object o2 = i2.next();<NEW_LINE>// if (!(o2 instanceof CorruptData) && o2 instanceof JavaRuntime) {<NEW_LINE>// metaRuntime = (JavaRuntime)o2;<NEW_LINE>// }<NEW_LINE>// }<NEW_LINE>// }<NEW_LINE>if (metaImageProcess != null) {<NEW_LINE>try {<NEW_LINE>for (Iterator it = metaImageProcess.getLibraries(); it.hasNext(); ) {<NEW_LINE><MASK><NEW_LINE>if (next instanceof CorruptData) {<NEW_LINE>modules.add(new PHDCorruptImageModule(space, (CorruptData) next));<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>ImageModule mod = (ImageModule) next;<NEW_LINE>modules.add(new PHDImageModule(mod.getName()));<NEW_LINE>} catch (CorruptDataException e) {<NEW_LINE>modules.add(new PHDCorruptImageModule(space, e));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (CorruptDataException e) {<NEW_LINE>modules_cd = new PHDCorruptData(space, e);<NEW_LINE>} catch (DataUnavailable e) {<NEW_LINE>// Ignore<NEW_LINE>}<NEW_LINE>ImageThread current;<NEW_LINE>try {<NEW_LINE>current = metaImageProcess.getCurrentThread();<NEW_LINE>} catch (CorruptDataException e) {<NEW_LINE>currentThread = new PHDCorruptImageThread(space, e.getCorruptData());<NEW_LINE>current = null;<NEW_LINE>}<NEW_LINE>for (Iterator it = metaImageProcess.getThreads(); it.hasNext(); ) {<NEW_LINE>Object next = it.next();<NEW_LINE>if (next instanceof CorruptData) {<NEW_LINE>threads.put(next, new PHDCorruptImageThread(space, (CorruptData) next));<NEW_LINE>} else {<NEW_LINE>ImageThread thrd = (ImageThread) next;<NEW_LINE>ImageThread imageThread = getThread(space, thrd);<NEW_LINE>if (thrd.equals(current)) {<NEW_LINE>currentThread = imageThread;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// pid = getPID(file);<NEW_LINE>// runtimes = new ArrayList<JavaRuntime>();<NEW_LINE>// runtimes.add(new PHDJavaRuntime(file, parentImage, space,this,metaRuntime));<NEW_LINE>} | Object next = it.next(); |
1,427,243 | public static long[] encodeBlocks(int[] blocks, int bitsPerEntry) {<NEW_LINE>final long maxEntryValue <MASK><NEW_LINE>final char valuesPerLong = (char) (64 / bitsPerEntry);<NEW_LINE>final int magicIndex = 3 * (valuesPerLong - 1);<NEW_LINE>final long divideMul = Integer.toUnsignedLong(MAGIC[magicIndex]);<NEW_LINE>final long divideAdd = Integer.toUnsignedLong(MAGIC[magicIndex + 1]);<NEW_LINE>final int divideShift = MAGIC[magicIndex + 2];<NEW_LINE>final int size = (blocks.length + valuesPerLong - 1) / valuesPerLong;<NEW_LINE>long[] data = new long[size];<NEW_LINE>for (int i = 0; i < blocks.length; i++) {<NEW_LINE>final long value = blocks[i];<NEW_LINE>final int cellIndex = (int) (i * divideMul + divideAdd >> 32L >> divideShift);<NEW_LINE>final int bitIndex = (i - cellIndex * valuesPerLong) * bitsPerEntry;<NEW_LINE>data[cellIndex] = data[cellIndex] & ~(maxEntryValue << bitIndex) | (value & maxEntryValue) << bitIndex;<NEW_LINE>}<NEW_LINE>return data;<NEW_LINE>} | = (1L << bitsPerEntry) - 1; |
1,721,683 | public void registerForPush(final String regid) {<NEW_LINE>if (TextUtils.isEmpty(regid) || registeringForPush || getUserConfig().getClientUserId() == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (getUserConfig().registeredForPush && regid.equals(SharedConfig.pushString)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>registeringForPush = true;<NEW_LINE>lastPushRegisterSendTime = SystemClock.elapsedRealtime();<NEW_LINE>if (SharedConfig.pushAuthKey == null) {<NEW_LINE>SharedConfig.pushAuthKey = new byte[256];<NEW_LINE>Utilities.random.nextBytes(SharedConfig.pushAuthKey);<NEW_LINE>SharedConfig.saveConfig();<NEW_LINE>}<NEW_LINE>TLRPC.TL_account_registerDevice req = new TLRPC.TL_account_registerDevice();<NEW_LINE>req.token_type = 2;<NEW_LINE>req.token = regid;<NEW_LINE>req.no_muted = false;<NEW_LINE>req.secret = SharedConfig.pushAuthKey;<NEW_LINE>for (int a : SharedConfig.activeAccounts) {<NEW_LINE>UserConfig <MASK><NEW_LINE>if (a != currentAccount && userConfig.isClientActivated()) {<NEW_LINE>long uid = userConfig.getClientUserId();<NEW_LINE>req.other_uids.add(uid);<NEW_LINE>if (BuildVars.LOGS_ENABLED) {<NEW_LINE>FileLog.d("add other uid = " + uid + " for account " + currentAccount);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>getConnectionsManager().sendRequest(req, (response, error) -> {<NEW_LINE>if (response instanceof TLRPC.TL_boolTrue) {<NEW_LINE>if (BuildVars.LOGS_ENABLED) {<NEW_LINE>FileLog.d("account " + currentAccount + " registered for push");<NEW_LINE>}<NEW_LINE>getUserConfig().registeredForPush = true;<NEW_LINE>SharedConfig.pushString = regid;<NEW_LINE>getUserConfig().saveConfig(false);<NEW_LINE>}<NEW_LINE>AndroidUtilities.runOnUIThread(() -> registeringForPush = false);<NEW_LINE>});<NEW_LINE>} | userConfig = UserConfig.getInstance(a); |
1,023,618 | public void addNewSubgroup(GroupNodeViewModel parent, GroupDialogHeader groupDialogHeader) {<NEW_LINE>currentDatabase.ifPresent(database -> {<NEW_LINE>Optional<AbstractGroup> newGroup = dialogService.showCustomDialogAndWait(new GroupDialogView(dialogService, database<MASK><NEW_LINE>newGroup.ifPresent(group -> {<NEW_LINE>parent.addSubgroup(group);<NEW_LINE>// TODO: Add undo<NEW_LINE>// UndoableAddOrRemoveGroup undo = new UndoableAddOrRemoveGroup(parent, new GroupTreeNodeViewModel(newGroupNode), UndoableAddOrRemoveGroup.ADD_NODE);<NEW_LINE>// panel.getUndoManager().addEdit(undo);<NEW_LINE>// TODO: Expand parent to make new group visible<NEW_LINE>// parent.expand();<NEW_LINE>dialogService.notify(Localization.lang("Added group \"%0\".", group.getName()));<NEW_LINE>writeGroupChangesToMetaData();<NEW_LINE>});<NEW_LINE>});<NEW_LINE>} | , preferences, null, groupDialogHeader)); |
383,206 | public void sendEmail(AlarmChecker<?> checker, int sequenceCount, StepExecution stepExecution) {<NEW_LINE>List<String> receivers = userGroupService.selectEmailOfMember(checker.getUserGroupId());<NEW_LINE>if (receivers.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>AlarmMailTemplate mailTemplate = new AlarmMailTemplate(checker, pinpointUrl, batchEnv, sequenceCount);<NEW_LINE>MimeMessage message = springMailSender.createMimeMessage();<NEW_LINE>message.setFrom(senderEmailAddress);<NEW_LINE>message.setRecipients(Message.RecipientType<MASK><NEW_LINE>final String subject = mailTemplate.createSubject();<NEW_LINE>message.setSubject(subject);<NEW_LINE>message.setContent(mailTemplate.createBody(), "text/html");<NEW_LINE>springMailSender.send(message);<NEW_LINE>logger.info("send email : {}", subject);<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error("can't send alarm email. {}", checker.getRule(), e);<NEW_LINE>}<NEW_LINE>} | .TO, getReceivers(receivers)); |
315,169 | final DeleteLogPatternResult executeDeleteLogPattern(DeleteLogPatternRequest deleteLogPatternRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteLogPatternRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteLogPatternRequest> request = null;<NEW_LINE>Response<DeleteLogPatternResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new DeleteLogPatternRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteLogPatternRequest));<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, "Application Insights");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteLogPattern");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteLogPatternResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteLogPatternResultJsonUnmarshaller());<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.startEvent(Field.RequestMarshallTime); |
261,136 | public MarkupDocBuilder apply(MarkupDocBuilder markupDocBuilder, OverviewDocument.Parameters params) {<NEW_LINE>Swagger swagger = params.swagger;<NEW_LINE>Info info = swagger.getInfo();<NEW_LINE>buildDocumentTitle(markupDocBuilder, info.getTitle());<NEW_LINE>applyOverviewDocumentExtension(new Context(Position.DOCUMENT_BEFORE, markupDocBuilder));<NEW_LINE>buildOverviewTitle(markupDocBuilder, labels.getLabel(SwaggerLabels.OVERVIEW));<NEW_LINE>applyOverviewDocumentExtension(new Context(Position.DOCUMENT_BEGIN, markupDocBuilder));<NEW_LINE>buildDescriptionParagraph(markupDocBuilder, info.getDescription());<NEW_LINE>buildVersionInfoSection(markupDocBuilder, info);<NEW_LINE>buildContactInfoSection(markupDocBuilder, info.getContact());<NEW_LINE>buildLicenseInfoSection(markupDocBuilder, info);<NEW_LINE>buildUriSchemeSection(markupDocBuilder, swagger);<NEW_LINE>buildTagsSection(markupDocBuilder, swagger.getTags());<NEW_LINE>buildConsumesSection(markupDocBuilder, swagger.getConsumes());<NEW_LINE>buildProducesSection(markupDocBuilder, swagger.getProduces());<NEW_LINE>buildExternalDocsSection(markupDocBuilder, swagger.getExternalDocs());<NEW_LINE>applyOverviewDocumentExtension(new Context(Position.DOCUMENT_END, markupDocBuilder));<NEW_LINE>applyOverviewDocumentExtension(new Context<MASK><NEW_LINE>return markupDocBuilder;<NEW_LINE>} | (Position.DOCUMENT_AFTER, markupDocBuilder)); |
1,122,868 | private List<Result> findStaticModels(SmallRyeOpenApiConfig openApiConfig, List<Pattern> ignorePatterns, Path target) {<NEW_LINE>List<Result> results = new ArrayList<>();<NEW_LINE>// First check for the file in both META-INF and WEB-INF/classes/META-INF<NEW_LINE>addStaticModelIfExist(results, ignorePatterns, Format.YAML, META_INF_OPENAPI_YAML);<NEW_LINE>addStaticModelIfExist(results, <MASK><NEW_LINE>addStaticModelIfExist(results, ignorePatterns, Format.YAML, META_INF_OPENAPI_YML);<NEW_LINE>addStaticModelIfExist(results, ignorePatterns, Format.YAML, WEB_INF_CLASSES_META_INF_OPENAPI_YML);<NEW_LINE>addStaticModelIfExist(results, ignorePatterns, Format.JSON, META_INF_OPENAPI_JSON);<NEW_LINE>addStaticModelIfExist(results, ignorePatterns, Format.JSON, WEB_INF_CLASSES_META_INF_OPENAPI_JSON);<NEW_LINE>// Add any aditional directories if configured<NEW_LINE>if (openApiConfig.additionalDocsDirectory.isPresent()) {<NEW_LINE>List<Path> additionalStaticDocuments = openApiConfig.additionalDocsDirectory.get();<NEW_LINE>for (Path path : additionalStaticDocuments) {<NEW_LINE>// Scan all yaml and json files<NEW_LINE>try {<NEW_LINE>List<String> filesInDir = getResourceFiles(path, target);<NEW_LINE>for (String possibleModelFile : filesInDir) {<NEW_LINE>addStaticModelIfExist(results, ignorePatterns, possibleModelFile);<NEW_LINE>}<NEW_LINE>} catch (IOException ioe) {<NEW_LINE>ioe.printStackTrace();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return results;<NEW_LINE>} | ignorePatterns, Format.YAML, WEB_INF_CLASSES_META_INF_OPENAPI_YAML); |
1,744,176 | ActionResult<Wo> execute(String applicationId, String processId) throws Exception {<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>ActionResult<Wo> result = new ActionResult<>();<NEW_LINE>Business business = new Business(emc);<NEW_LINE>List<DateRange<MASK><NEW_LINE>Wo wo = new Wo();<NEW_LINE>for (DateRange o : os) {<NEW_LINE>String str = DateTools.format(o.getStart(), DateTools.format_yyyyMM);<NEW_LINE>List<WoUnit> list = new ArrayList<>();<NEW_LINE>wo.put(str, list);<NEW_LINE>for (UnitStub stub : ThisApplication.period.getCompletedWorkUnitStubs()) {<NEW_LINE>WoUnit w = new WoUnit();<NEW_LINE>w.setName(stub.getName());<NEW_LINE>w.setValue(stub.getValue());<NEW_LINE>w.setLevel(stub.getLevel());<NEW_LINE>Long count = this.countCompletedWork(business, o, applicationId, processId, StandardJaxrsAction.EMPTY_SYMBOL, StandardJaxrsAction.EMPTY_SYMBOL);<NEW_LINE>w.setCount(count);<NEW_LINE>Long duration = this.durationCompletedWork(business, o, applicationId, processId, StandardJaxrsAction.EMPTY_SYMBOL, StandardJaxrsAction.EMPTY_SYMBOL);<NEW_LINE>w.setDuration(duration);<NEW_LINE>Long times = this.timesCompletedWork(business, o, applicationId, processId, StandardJaxrsAction.EMPTY_SYMBOL, StandardJaxrsAction.EMPTY_SYMBOL);<NEW_LINE>w.setTimes(times);<NEW_LINE>list.add(w);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>result.setData(wo);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>} | > os = this.listDateRange(); |
1,225,034 | public Object call(Job<Object> job, Map<String, Object> parameters) {<NEW_LINE>this.checkAndCollectParameters(parameters);<NEW_LINE>// Read configuration<NEW_LINE>try {<NEW_LINE>this.initializeConfig((ComputerJob) job);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new HugeException("Failed to initialize computer config file", e);<NEW_LINE>}<NEW_LINE>// Set current computer job's specified parameters<NEW_LINE>Map<String, Object> configs = new HashMap<>();<NEW_LINE>configs.putAll(this.commonConfig);<NEW_LINE>configs.putAll(this.checkAndCollectParameters(parameters));<NEW_LINE>// Construct shell command for computer job<NEW_LINE>String[] command = this.constructShellCommands(configs);<NEW_LINE>LOG.info("Execute computer job: {}", String.join(SPACE, command));<NEW_LINE>// Execute current computer<NEW_LINE>try {<NEW_LINE>ProcessBuilder builder = new ProcessBuilder(command);<NEW_LINE>builder.redirectErrorStream(true);<NEW_LINE>builder.directory(new File(executeDir()));<NEW_LINE>Process process = builder.start();<NEW_LINE>StringBuilder output = new StringBuilder();<NEW_LINE>try (LineNumberReader reader = new LineNumberReader(new InputStreamReader(process.getInputStream()))) {<NEW_LINE>String line;<NEW_LINE>while ((line = reader.readLine()) != null) {<NEW_LINE>output.append<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>int exitCode = process.waitFor();<NEW_LINE>if (exitCode == 0) {<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>throw new HugeException("The computer job exit with code %s: %s", exitCode, output);<NEW_LINE>} catch (HugeException e) {<NEW_LINE>throw e;<NEW_LINE>} catch (Throwable e) {<NEW_LINE>throw new HugeException("Failed to execute computer job", e);<NEW_LINE>}<NEW_LINE>} | (line).append("\n"); |
802,046 | public void marshall(CreateApplicationRequest createApplicationRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (createApplicationRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(createApplicationRequest.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(createApplicationRequest.getDisplayName(), DISPLAYNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(createApplicationRequest.getDescription(), DESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(createApplicationRequest.getIconS3Location(), ICONS3LOCATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(createApplicationRequest.getLaunchPath(), LAUNCHPATH_BINDING);<NEW_LINE>protocolMarshaller.marshall(createApplicationRequest.getWorkingDirectory(), WORKINGDIRECTORY_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(createApplicationRequest.getPlatforms(), PLATFORMS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createApplicationRequest.getInstanceFamilies(), INSTANCEFAMILIES_BINDING);<NEW_LINE>protocolMarshaller.marshall(createApplicationRequest.getAppBlockArn(), APPBLOCKARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(createApplicationRequest.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>} | createApplicationRequest.getLaunchParameters(), LAUNCHPARAMETERS_BINDING); |
324,408 | private DownloadInfo deserialiseDI(Map<String, Object> info_map, ContentCache cc) {<NEW_LINE>try {<NEW_LINE>int version = (int) MapUtils.importLong(info_map, "v", RelatedContent.VERSION_INITIAL);<NEW_LINE>byte[] hash = (byte[]) info_map.get("h");<NEW_LINE>String title = MapUtils.getMapString(info_map, "d", null);<NEW_LINE>int rand = MapUtils.importInt(info_map, "r", 0);<NEW_LINE>String tracker = MapUtils.getMapString(info_map, "t", null);<NEW_LINE>long size = MapUtils.importLong(info_map, "z", 0);<NEW_LINE>int date = MapUtils.importInt(info_map, "p", 0);<NEW_LINE>int seeds_leechers = MapUtils.importInt(info_map, "q", -1);<NEW_LINE>byte[] tracker_keys = (byte[]) info_map.get("k");<NEW_LINE>byte[] ws_keys = (byte[]) info_map.get("w");<NEW_LINE>long lastChangedLocally = MapUtils.importLong(info_map, "cl", 0);<NEW_LINE>if (tracker_keys != null && tracker_keys.length % 4 != 0) {<NEW_LINE>tracker_keys = null;<NEW_LINE>}<NEW_LINE>if (ws_keys != null && ws_keys.length % 4 != 0) {<NEW_LINE>ws_keys = null;<NEW_LINE>}<NEW_LINE>byte[] _tags = (byte[]) info_map.get("g");<NEW_LINE>String[] tags = decodeTags(_tags);<NEW_LINE>Long _nets = (Long) info_map.get("o");<NEW_LINE>byte nets = _nets == null ? NET_PUBLIC : _nets.byteValue();<NEW_LINE>int first_seen = MapUtils.importInt(info_map, "f", 0);<NEW_LINE>if (cc == null) {<NEW_LINE>DownloadInfo info = new DownloadInfo(version, hash, hash, title, rand, tracker, tracker_keys, ws_keys, tags, nets, first_seen, 0, false, size, date, seeds_leechers);<NEW_LINE>info.setChangedLocallyOn(lastChangedLocally);<NEW_LINE>return (info);<NEW_LINE>} else {<NEW_LINE>boolean unread = MapUtils.getMapBoolean(info_map, "u", false);<NEW_LINE>int[] rand_list = MapUtils.importIntArray(info_map, "l");<NEW_LINE>int last_seen = MapUtils.importInt(info_map, "s", 0);<NEW_LINE>int level = MapUtils.<MASK><NEW_LINE>DownloadInfo info = new DownloadInfo(version, hash, title, rand, tracker, tracker_keys, ws_keys, tags, nets, unread, rand_list, first_seen, last_seen, level, size, date, seeds_leechers, cc);<NEW_LINE>info.setChangedLocallyOn(lastChangedLocally);<NEW_LINE>return (info);<NEW_LINE>}<NEW_LINE>} catch (Throwable e) {<NEW_LINE>Debug.out(e);<NEW_LINE>return (null);<NEW_LINE>}<NEW_LINE>} | importInt(info_map, "e", 0); |
880,671 | public ServerAuthorConfigurationResponse configureAllAccessServices(String userId, String serverName, String serverToBeConfiguredName, Map<String, Object> accessServiceOptions) {<NEW_LINE>final String methodName = "configureAllAccessServices";<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.<MASK><NEW_LINE>ServerAuthorViewHandler serverAuthorViewHandler = instanceHandler.getServerAuthorViewHandler(userId, serverName, methodName);<NEW_LINE>serverAuthorViewHandler.configureAllAccessServices(className, methodName, serverToBeConfiguredName, accessServiceOptions);<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(token, response.toString());<NEW_LINE>return response;<NEW_LINE>} | getAuditLog(userId, serverName, methodName); |
654,305 | private void convertRegionsToJSON(List<TileRegion> tileRegions, Promise promise) {<NEW_LINE>CountDownLatch countDownLatch = new CountDownLatch(tileRegions.size());<NEW_LINE>ArrayList<TileRegionError> errors = new ArrayList<>();<NEW_LINE>ArrayList<Geometry> geometries = new ArrayList<>();<NEW_LINE>try {<NEW_LINE>for (TileRegion region : tileRegions) {<NEW_LINE>getTileStore().getTileRegionGeometry(region.getId(), new TileRegionGeometryCallback() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run(@NonNull Expected<TileRegionError, Geometry> result) {<NEW_LINE>if (result.isValue()) {<NEW_LINE>geometries.add(result.getValue());<NEW_LINE>} else {<NEW_LINE>errors.add(result.getError());<NEW_LINE>}<NEW_LINE>countDownLatch.countDown();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} catch (Error error) {<NEW_LINE>Logger.e("OS", "a");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>countDownLatch.await();<NEW_LINE>WritableArray result = Arguments.createArray();<NEW_LINE>for (Geometry geometry : geometries) {<NEW_LINE>result.pushMap(fromOfflineRegion(geometry));<NEW_LINE>}<NEW_LINE>for (TileRegionError error : errors) {<NEW_LINE>WritableMap errorMap = Arguments.createMap();<NEW_LINE>errorMap.putString("type", "error");<NEW_LINE>errorMap.putString("message", error.getMessage());<NEW_LINE>errorMap.putString("errorType", error.<MASK><NEW_LINE>result.pushMap(errorMap);<NEW_LINE>}<NEW_LINE>promise.resolve(result);<NEW_LINE>} catch (InterruptedException interruptedException) {<NEW_LINE>promise.reject(interruptedException);<NEW_LINE>}<NEW_LINE>} | getType().toString()); |
942,733 | public final DecoratorContext decorator() throws RecognitionException {<NEW_LINE>DecoratorContext _localctx = new DecoratorContext(_ctx, getState());<NEW_LINE>enterRule(_localctx, 8, RULE_decorator);<NEW_LINE>int _la;<NEW_LINE>try {<NEW_LINE>enterOuterAlt(_localctx, 1);<NEW_LINE>{<NEW_LINE>ArgListBuilder args = null;<NEW_LINE>setState(234);<NEW_LINE>match(AT);<NEW_LINE>setState(235);<NEW_LINE>_localctx.dotted_name = dotted_name();<NEW_LINE>setState(241);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>_la = _input.LA(1);<NEW_LINE>if (_la == OPEN_PAREN) {<NEW_LINE>{<NEW_LINE>setState(236);<NEW_LINE>match(OPEN_PAREN);<NEW_LINE>setState(237);<NEW_LINE>_localctx.arglist = arglist();<NEW_LINE>setState(238);<NEW_LINE>match(CLOSE_PAREN);<NEW_LINE>args = _localctx.arglist.result;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>setState(243);<NEW_LINE>match(NEWLINE);<NEW_LINE>String dottedName = _localctx.dotted_name.result;<NEW_LINE>if (dottedName.contains(".")) {<NEW_LINE>factory.getScopeEnvironment().addSeenVar(dottedName.<MASK><NEW_LINE>} else {<NEW_LINE>factory.getScopeEnvironment().addSeenVar(dottedName);<NEW_LINE>}<NEW_LINE>push(factory.createDecorator(dottedName, args, getStartIndex(_localctx), getLastIndex(_localctx)));<NEW_LINE>}<NEW_LINE>} catch (RecognitionException re) {<NEW_LINE>_localctx.exception = re;<NEW_LINE>_errHandler.reportError(this, re);<NEW_LINE>_errHandler.recover(this, re);<NEW_LINE>} finally {<NEW_LINE>exitRule();<NEW_LINE>}<NEW_LINE>return _localctx;<NEW_LINE>} | split("\\.")[0]); |
1,451,959 | public DescribeEndpointsResult describeEndpoints(DescribeEndpointsRequest describeEndpointsRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeEndpointsRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeEndpointsRequest> request = null;<NEW_LINE>Response<DescribeEndpointsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeEndpointsRequestMarshaller().marshall(describeEndpointsRequest);<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>Unmarshaller<DescribeEndpointsResult, JsonUnmarshallerContext> unmarshaller = new DescribeEndpointsResultJsonUnmarshaller();<NEW_LINE>JsonResponseHandler<DescribeEndpointsResult> responseHandler = new JsonResponseHandler<DescribeEndpointsResult>(unmarshaller);<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.ClientExecuteTime);<NEW_LINE>endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);<NEW_LINE>}<NEW_LINE>} | AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); |
1,220,123 | private void initTableHeader() {<NEW_LINE>JTableHeader header = itemTable.getTableHeader();<NEW_LINE>header.setPreferredSize(new Dimension(itemTable.getColumnModel().getTotalColumnWidth(), Math.max(20, itemTable.getFont().getSize() + 5)));<NEW_LINE>header.setReorderingAllowed(false);<NEW_LINE>// columns<NEW_LINE>TableColumn infoColumn = header.getColumnModel().getColumn(0);<NEW_LINE>infoColumn.setHeaderRenderer(new HeaderRenderer(Bundle.SyncPanel_table_header_info_toolTip()));<NEW_LINE>infoColumn.setHeaderValue(ImageUtilities.loadImageIcon(HEADER_INFO_ICON_PATH, false));<NEW_LINE>TableColumn operationColumn = header.getColumnModel().getColumn(2);<NEW_LINE>operationColumn.setHeaderRenderer(new HeaderRenderer(Bundle.SyncPanel_table_header_operation_toolTip()));<NEW_LINE>operationColumn.setHeaderValue(ImageUtilities.loadImageIcon(HORIZONTAL_ICON_PATH, false));<NEW_LINE>TableColumn remotePathColumn = header.getColumnModel().getColumn(remotePathFirst ? 1 : 3);<NEW_LINE>remotePathColumn.setHeaderRenderer(new HeaderRenderer(Bundle.SyncPanel_table_header_remotePath_toolTip()));<NEW_LINE>TableColumn localPathColumn = header.getColumnModel().<MASK><NEW_LINE>localPathColumn.setHeaderRenderer(new HeaderRenderer(Bundle.SyncPanel_table_header_localPath_toolTip()));<NEW_LINE>// listener<NEW_LINE>itemTable.getTableHeader().addMouseListener(new MouseAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void mouseClicked(MouseEvent e) {<NEW_LINE>if (itemTable.columnAtPoint(e.getPoint()) == 2) {<NEW_LINE>swapPaths();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | getColumn(remotePathFirst ? 3 : 1); |
1,095,251 | public void success(GetFactsRsp rsp) {<NEW_LINE>if (!rsp.isSuccess()) {<NEW_LINE>errors.add(operr("operation error, because:%s", rsp.getError()));<NEW_LINE>} else {<NEW_LINE>String fsid = rsp.fsid;<NEW_LINE>if (!getSelf().getFsid().equals(fsid)) {<NEW_LINE>errors.add(operr("the mon[ip:%s] returns a fsid[%s] different from the current fsid[%s] of the cep cluster," + "are you adding a mon not belonging to current cluster mistakenly?", base.getSelf().getHostname(), fsid, getSelf().getFsid()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>monVO.setMonAddr(rsp.monAddr == null ? monVO.getHostname() : rsp.monAddr);<NEW_LINE>dbf.update(monVO);<NEW_LINE>latch.ack();<NEW_LINE>} | CephBackupStorageMonVO monVO = base.getSelf(); |
658,090 | public static void fcBiRepulsor(Node N1, Node N2, double c) {<NEW_LINE>// distance en x entre les deux noeuds<NEW_LINE>double xDist = N1.x() - N2.x();<NEW_LINE>double yDist = N1.y() - N2.y();<NEW_LINE>// distance tout court<NEW_LINE>double dist = (float) Math.sqrt(xDist * xDist + yDist * yDist);<NEW_LINE>if (dist > 0) {<NEW_LINE>double f = repulsion(c, dist);<NEW_LINE>ForceVectorNodeLayoutData N1L = N1.getLayoutData();<NEW_LINE><MASK><NEW_LINE>N1L.dx += xDist / dist * f;<NEW_LINE>N1L.dy += yDist / dist * f;<NEW_LINE>N2L.dx -= xDist / dist * f;<NEW_LINE>N2L.dy -= yDist / dist * f;<NEW_LINE>}<NEW_LINE>} | ForceVectorNodeLayoutData N2L = N2.getLayoutData(); |
874,439 | private void initializeFabClickListener(boolean isActionMode) {<NEW_LINE>Intent intent = new Intent(getActivity(), NewConversationActivity.class);<NEW_LINE>if (isRelayingMessageContent(getActivity())) {<NEW_LINE>if (isActionMode) {<NEW_LINE>fab.setOnClickListener(v -> {<NEW_LINE>final Set<Long> selectedChats = getListAdapter().getBatchSelections();<NEW_LINE>ArrayList<Uri> uris = getSharedUris(getActivity());<NEW_LINE>String message;<NEW_LINE>if (isForwarding(getActivity())) {<NEW_LINE>message = String.format(Locale.getDefault(), getString(R.string.ask_forward_multiple), selectedChats.size());<NEW_LINE>} else if (uris.size() > 0) {<NEW_LINE>message = String.format(Locale.getDefault(), getString(R.string.share_multiple_attachments_multiple_chats), uris.size(), selectedChats.size());<NEW_LINE>} else {<NEW_LINE>message = String.format(Locale.getDefault(), getString(R.string.share_text_multiple_chats), selectedChats.size(), getSharedText(getActivity()));<NEW_LINE>}<NEW_LINE>Context context = getContext();<NEW_LINE>if (context != null) {<NEW_LINE>new AlertDialog.Builder(context).setMessage(message).setCancelable(false).setNegativeButton(android.R.string.cancel, ((dialog, which) -> {<NEW_LINE>})).setPositiveButton(R.string.menu_send, (dialog, which) -> {<NEW_LINE>SendRelayedMessageUtil.immediatelyRelay(getActivity(), selectedChats.toArray(new Long[selectedChats.size()]));<NEW_LINE>actionMode.finish();<NEW_LINE>actionMode = null;<NEW_LINE>getActivity().finish();<NEW_LINE>}).show();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} else {<NEW_LINE>acquireRelayMessageContent(getActivity(), intent);<NEW_LINE>fab.setOnClickListener(v -> getActivity()<MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>fab.setOnClickListener(v -> startActivity(intent));<NEW_LINE>}<NEW_LINE>} | .startActivityForResult(intent, REQUEST_RELAY)); |
338,222 | public <T> CreateTableRequest generateCreateTableRequest(Class<T> clazz, DynamoDBMapperConfig config) {<NEW_LINE>config = mergeConfig(config);<NEW_LINE>final DynamoDBMapperTableModel<T> model = getTableModel(clazz, config);<NEW_LINE>final CreateTableRequest request = new CreateTableRequest();<NEW_LINE>request.setTableName(getTableName(clazz, config));<NEW_LINE>request.withKeySchema(new KeySchemaElement(model.hashKey().name(), HASH));<NEW_LINE>if (model.rangeKeyIfExists() != null) {<NEW_LINE>request.withKeySchema(new KeySchemaElement(model.rangeKey()<MASK><NEW_LINE>}<NEW_LINE>request.setGlobalSecondaryIndexes(model.globalSecondaryIndexes());<NEW_LINE>request.setLocalSecondaryIndexes(model.localSecondaryIndexes());<NEW_LINE>for (final DynamoDBMapperFieldModel<T, Object> field : model.fields()) {<NEW_LINE>if (field.keyType() != null || field.indexed()) {<NEW_LINE>request.withAttributeDefinitions(new AttributeDefinition().withAttributeType(ScalarAttributeType.valueOf(field.attributeType().name())).withAttributeName(field.name()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>} | .name(), RANGE)); |
448,724 | public static void test() throws Exception {<NEW_LINE>int spout_Parallelism_hint = JStormUtils.parseInt(conf.get(TOPOLOGY_SPOUT_PARALLELISM_HINT), 1);<NEW_LINE>int count_Parallelism_hint = JStormUtils.parseInt(conf.get(TOPOLOGY_COUNT_PARALLELISM_HINT), 1);<NEW_LINE>TopologyBuilder builder = new TopologyBuilder();<NEW_LINE>builder.setSpout("spout"<MASK><NEW_LINE>WordCount wordCountBolt = new WordCount();<NEW_LINE>builder.setBolt("count", wordCountBolt.eventTimeWindow(Time.milliseconds(3L)).withTimestampExtractor(wordCountBolt).withWatermarkGenerator(new PeriodicWatermarkGenerator(Time.milliseconds(1L), Time.milliseconds(10L))), count_Parallelism_hint).fieldsGrouping("spout", new Fields("word", "ts"));<NEW_LINE>String[] className = Thread.currentThread().getStackTrace()[1].getClassName().split("\\.");<NEW_LINE>String topologyName = className[className.length - 1];<NEW_LINE>JStormHelper.runTopology(builder.createTopology(), topologyName, conf, 60, new JStormHelper.CheckAckedFail(conf), true);<NEW_LINE>} | , new FastRandomSentenceSpout(), spout_Parallelism_hint); |
1,762,843 | static public LambdaRoute resolve(ControllerMethod controllerMethod) {<NEW_LINE>try {<NEW_LINE>Lambdas.LambdaInfo lambdaInfo = Lambdas.reflect(controllerMethod);<NEW_LINE>switch(lambdaInfo.getKind()) {<NEW_LINE>case ANY_INSTANCE_METHOD_REFERENCE:<NEW_LINE>case STATIC_METHOD_REFERENCE:<NEW_LINE>// call impl method just like before Java 8<NEW_LINE>return new LambdaRoute(lambdaInfo.getImplementationMethod(), null, null);<NEW_LINE>case SPECIFIC_INSTANCE_METHOD_REFERENCE:<NEW_LINE>case ANONYMOUS_METHOD_REFERENCE:<NEW_LINE>// only safe to use the impl method for argument types if<NEW_LINE>// the number of arguments matches between the methods<NEW_LINE>if (lambdaInfo.areMethodParameterCountsEqual()) {<NEW_LINE>return new LambdaRoute(lambdaInfo.getFunctionalMethod(), <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>// unable to detect lambda (e.g. such as anonymous/concrete class)<NEW_LINE>}<NEW_LINE>// fallback to simple call the "apply" method on the supplied method instance<NEW_LINE>try {<NEW_LINE>Method functionalMethod = Lambdas.getMethod(controllerMethod.getClass(), "apply");<NEW_LINE>functionalMethod.setAccessible(true);<NEW_LINE>return new LambdaRoute(functionalMethod, null, controllerMethod);<NEW_LINE>} catch (NoSuchMethodException | ClassNotFoundException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>} | lambdaInfo.getImplementationMethod(), controllerMethod); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.