idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
1,133,697 | public static MethodBinding checkForContradictions(MethodBinding method, Object location, Scope scope) {<NEW_LINE>int start = 0, end = 0;<NEW_LINE>if (location instanceof InvocationSite) {<NEW_LINE>start = ((InvocationSite) location).sourceStart();<NEW_LINE>end = ((InvocationSite) location).sourceEnd();<NEW_LINE>} else if (location instanceof ASTNode) {<NEW_LINE>start = ((ASTNode) location).sourceStart;<NEW_LINE>end = ((ASTNode) location).sourceEnd;<NEW_LINE>}<NEW_LINE>SearchContradictions searchContradiction = new SearchContradictions();<NEW_LINE>TypeBindingVisitor.visit(searchContradiction, method.returnType);<NEW_LINE>if (searchContradiction.typeWithContradiction != null) {<NEW_LINE>if (scope == null)<NEW_LINE>return new ProblemMethodBinding(method, method.selector, method.parameters, ProblemReasons.ContradictoryNullAnnotations);<NEW_LINE>scope.problemReporter().contradictoryNullAnnotationsInferred(method, start, end, location instanceof FunctionalExpression);<NEW_LINE>// note: if needed, we might want to update the method by removing the contradictory annotations??<NEW_LINE>return method;<NEW_LINE>}<NEW_LINE>Expression[] arguments = null;<NEW_LINE>if (location instanceof Invocation)<NEW_LINE>arguments = ((Invocation) location).arguments();<NEW_LINE>for (int i = 0; i < method.parameters.length; i++) {<NEW_LINE>TypeBindingVisitor.visit(searchContradiction, method.parameters[i]);<NEW_LINE>if (searchContradiction.typeWithContradiction != null) {<NEW_LINE>if (scope == null)<NEW_LINE>return new ProblemMethodBinding(method, method.selector, method.parameters, ProblemReasons.ContradictoryNullAnnotations);<NEW_LINE>if (arguments != null && i < arguments.length)<NEW_LINE>scope.problemReporter().contradictoryNullAnnotationsInferred<MASK><NEW_LINE>else<NEW_LINE>scope.problemReporter().contradictoryNullAnnotationsInferred(method, start, end, location instanceof FunctionalExpression);<NEW_LINE>return method;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return method;<NEW_LINE>} | (method, arguments[i]); |
1,273,444 | private Mono<Response<Void>> startWithResponseAsync(String resourceGroupName, String name, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (name == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.start(this.client.getEndpoint(), resourceGroupName, name, this.client.getSubscriptionId(), this.client.<MASK><NEW_LINE>} | getApiVersion(), accept, context); |
290,278 | public QueryIterator execute(OpQuadPattern opQuadPattern, QueryIterator input) {<NEW_LINE>Node gn = opQuadPattern.getGraphNode();<NEW_LINE>gn = decideGraphNode(gn, execCxt);<NEW_LINE>if (execCxt.getDataset() instanceof DatasetGraphTDB) {<NEW_LINE>DatasetGraphTDB ds = (DatasetGraphTDB) execCxt.getDataset();<NEW_LINE>Explain.explain("Execute", opQuadPattern.getPattern(), execCxt.getContext());<NEW_LINE>BasicPattern bgp = opQuadPattern.getBasicPattern();<NEW_LINE>return PatternMatchTDB1.execute(ds, gn, bgp, input, filter, execCxt);<NEW_LINE>}<NEW_LINE>// Maybe a TDB named graph inside a non-TDB dataset.<NEW_LINE>Graph g = execCxt.getActiveGraph();<NEW_LINE>if (g instanceof GraphTDB) {<NEW_LINE>// Triples graph from TDB (which is the default graph of the dataset),<NEW_LINE>// used a named graph in a composite dataset.<NEW_LINE>BasicPattern bgp = opQuadPattern.getBasicPattern();<NEW_LINE>Explain.explain("Execute", <MASK><NEW_LINE>// Don't pass in G -- gn may be different.<NEW_LINE>return PatternMatchTDB1.execute(((GraphTDB) g).getDatasetGraphTDB(), gn, bgp, input, filter, execCxt);<NEW_LINE>}<NEW_LINE>Log.warn(this, "Non-DatasetGraphTDB passed to OpExecutorPlainTDB");<NEW_LINE>return super.execute(opQuadPattern, input);<NEW_LINE>} | bgp, execCxt.getContext()); |
211,324 | public static void main(String[] args) {<NEW_LINE>Scanner sc = new Scanner(System.in);<NEW_LINE>Queue_LL q = new Queue_LL();<NEW_LINE>boolean flag = true;<NEW_LINE>int val = 0;<NEW_LINE>while (flag) {<NEW_LINE>System.out.println("1. Enqueue()");<NEW_LINE>System.out.println("2. Dequeue()");<NEW_LINE>System.out.println("3. Current Size of Queue");<NEW_LINE>System.out.println("4. Peek()");<NEW_LINE><MASK><NEW_LINE>System.out.println("6. Exit");<NEW_LINE>System.out.println("Enter Choice");<NEW_LINE>int choice = sc.nextInt();<NEW_LINE>switch(choice) {<NEW_LINE>case 1:<NEW_LINE>System.out.println("Enter value");<NEW_LINE>val = sc.nextInt();<NEW_LINE>q.enqueue(val);<NEW_LINE>break;<NEW_LINE>case 2:<NEW_LINE>System.out.println(q.dequeue());<NEW_LINE>break;<NEW_LINE>case 3:<NEW_LINE>System.out.println(q.count());<NEW_LINE>break;<NEW_LINE>case 4:<NEW_LINE>System.out.println(q.peek());<NEW_LINE>break;<NEW_LINE>case 5:<NEW_LINE>q.viewQ();<NEW_LINE>break;<NEW_LINE>case 6:<NEW_LINE>flag = false;<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>System.out.println("invalid choice");<NEW_LINE>}<NEW_LINE>// switch<NEW_LINE>System.out.println();<NEW_LINE>}<NEW_LINE>// while<NEW_LINE>} | System.out.println("5. View Queue"); |
860,217 | void addAll(String[] unmatched) {<NEW_LINE>if (setter != null) {<NEW_LINE>try {<NEW_LINE>setter.set(unmatched);<NEW_LINE>} catch (Exception ex) {<NEW_LINE>throw new PicocliException(String.format("Could not invoke setter (%s) with unmatched argument array '%s': %s", setter, Arrays.toString(unmatched), ex), ex);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>Collection<String> collection = getter.get();<NEW_LINE>if (collection == null) {<NEW_LINE>collection = new ArrayList<String>();<NEW_LINE>((ISetter) getter).set(collection);<NEW_LINE>}<NEW_LINE>collection.addAll(Arrays.asList(unmatched));<NEW_LINE>} catch (Exception ex) {<NEW_LINE>throw new PicocliException(String.format("Could not add unmatched argument array '%s' to collection returned by getter (%s): %s", Arrays.toString(unmatched)<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | , getter, ex), ex); |
1,352,110 | final ListPlatformApplicationsResult executeListPlatformApplications(ListPlatformApplicationsRequest listPlatformApplicationsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listPlatformApplicationsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListPlatformApplicationsRequest> request = null;<NEW_LINE>Response<ListPlatformApplicationsResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new ListPlatformApplicationsRequestMarshaller().marshall(super.beforeMarshalling(listPlatformApplicationsRequest));<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, "SNS");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListPlatformApplications");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<ListPlatformApplicationsResult> responseHandler = new StaxResponseHandler<ListPlatformApplicationsResult>(new ListPlatformApplicationsResultStaxUnmarshaller());<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); |
1,091,864 | void draw(Canvas canvas, GeometryWayContext context) {<NEW_LINE>if (style != null && style.getPointBitmap() != null) {<NEW_LINE>Bitmap bitmap = style.getPointBitmap();<NEW_LINE>Integer pointColor = style.getPointColor();<NEW_LINE>float paintH2 = bitmap.getHeight() / 2f;<NEW_LINE>float paintW2 = bitmap.getWidth() / 2f;<NEW_LINE>matrix.reset();<NEW_LINE>float styleWidth = style.getWidth(0);<NEW_LINE>if (styleWidth > 0) {<NEW_LINE>float scaleCoef = (styleWidth / 2) / bitmap.getWidth();<NEW_LINE>if (scaleCoef < 1) {<NEW_LINE>matrix.setScale(scaleCoef, scaleCoef, paintW2, paintH2);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>matrix.postRotate((float) angle, paintW2, paintH2);<NEW_LINE>matrix.postTranslate(x - paintW2, y - paintH2);<NEW_LINE>if (pointColor != null) {<NEW_LINE>Paint paint = context.getPaintIconCustom();<NEW_LINE>paint.setColorFilter(new PorterDuffColorFilter(pointColor, PorterDuff.Mode.SRC_IN));<NEW_LINE>canvas.drawBitmap(bitmap, matrix, paint);<NEW_LINE>} else {<NEW_LINE>if (style.hasPaintedPointBitmap()) {<NEW_LINE>Paint paint = context.getPaintIconCustom();<NEW_LINE>paint.setColorFilter(null);<NEW_LINE>canvas.drawBitmap(bitmap, matrix, paint);<NEW_LINE>} else {<NEW_LINE>canvas.drawBitmap(bitmap, <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | matrix, context.getPaintIcon()); |
1,323,567 | private void init(Context context, AttributeSet attrs) {<NEW_LINE>if (attrs != null) {<NEW_LINE>TypedArray a = context.obtainStyledAttributes(<MASK><NEW_LINE>final int count = a.getIndexCount();<NEW_LINE>for (int i = 0; i < count; i++) {<NEW_LINE>int attr = a.getIndex(i);<NEW_LINE>if (attr == R.styleable.MockView_mock_label) {<NEW_LINE>mText = a.getString(attr);<NEW_LINE>} else if (attr == R.styleable.MockView_mock_showDiagonals) {<NEW_LINE>mDrawDiagonals = a.getBoolean(attr, mDrawDiagonals);<NEW_LINE>} else if (attr == R.styleable.MockView_mock_diagonalsColor) {<NEW_LINE>mDiagonalsColor = a.getColor(attr, mDiagonalsColor);<NEW_LINE>} else if (attr == R.styleable.MockView_mock_labelBackgroundColor) {<NEW_LINE>mTextBackgroundColor = a.getColor(attr, mTextBackgroundColor);<NEW_LINE>} else if (attr == R.styleable.MockView_mock_labelColor) {<NEW_LINE>mTextColor = a.getColor(attr, mTextColor);<NEW_LINE>} else if (attr == R.styleable.MockView_mock_showLabel) {<NEW_LINE>mDrawLabel = a.getBoolean(attr, mDrawLabel);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>a.recycle();<NEW_LINE>}<NEW_LINE>if (mText == null) {<NEW_LINE>try {<NEW_LINE>mText = context.getResources().getResourceEntryName(getId());<NEW_LINE>} catch (Exception ex) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>mPaintDiagonals.setColor(mDiagonalsColor);<NEW_LINE>mPaintDiagonals.setAntiAlias(true);<NEW_LINE>mPaintText.setColor(mTextColor);<NEW_LINE>mPaintText.setAntiAlias(true);<NEW_LINE>mPaintTextBackground.setColor(mTextBackgroundColor);<NEW_LINE>mMargin = Math.round(mMargin * (getResources().getDisplayMetrics().xdpi / DisplayMetrics.DENSITY_DEFAULT));<NEW_LINE>} | attrs, R.styleable.MockView); |
1,040,130 | private void fillParams(AcsRequest request) {<NEW_LINE><MASK><NEW_LINE>if (version != null) {<NEW_LINE>request.setSysVersion(version);<NEW_LINE>}<NEW_LINE>if (action != null) {<NEW_LINE>request.setSysActionName(action);<NEW_LINE>}<NEW_LINE>if (regionId != null) {<NEW_LINE>request.setSysRegionId(regionId);<NEW_LINE>}<NEW_LINE>if (locationProduct != null) {<NEW_LINE>request.setSysLocationProduct(locationProduct);<NEW_LINE>}<NEW_LINE>if (endpointType != null) {<NEW_LINE>request.setSysEndpointType(endpointType);<NEW_LINE>}<NEW_LINE>if (connectTimeout != null) {<NEW_LINE>request.setSysConnectTimeout(connectTimeout);<NEW_LINE>}<NEW_LINE>if (readTimeout != null) {<NEW_LINE>request.setSysReadTimeout(readTimeout);<NEW_LINE>}<NEW_LINE>if (method != null) {<NEW_LINE>request.setSysMethod(method);<NEW_LINE>}<NEW_LINE>if (protocol != null) {<NEW_LINE>request.setSysProtocol(protocol);<NEW_LINE>}<NEW_LINE>request.setSysAcceptFormat(accept);<NEW_LINE>if (domain != null) {<NEW_LINE>ProductDomain productDomain = new ProductDomain(product, domain);<NEW_LINE>request.setSysProductDomain(productDomain);<NEW_LINE>}<NEW_LINE>if (bodyParameters.size() > 0 && httpContentType != null) {<NEW_LINE>request.setHttpContentType(httpContentType);<NEW_LINE>}<NEW_LINE>if (httpContent != null) {<NEW_LINE>request.setHttpContent(httpContent, encoding, httpContentType);<NEW_LINE>}<NEW_LINE>for (String queryParamKey : queryParameters.keySet()) {<NEW_LINE>request.putQueryParameter(queryParamKey, queryParameters.get(queryParamKey));<NEW_LINE>}<NEW_LINE>for (String bodyParamKey : bodyParameters.keySet()) {<NEW_LINE>request.putBodyParameter(bodyParamKey, bodyParameters.get(bodyParamKey));<NEW_LINE>}<NEW_LINE>for (String headParamKey : headParameters.keySet()) {<NEW_LINE>request.putHeaderParameter(headParamKey, headParameters.get(headParamKey));<NEW_LINE>}<NEW_LINE>} | request.putHeaderParameter("x-sdk-invoke-type", "common"); |
1,761,359 | private void showRewardedVideo() {<NEW_LINE>if (rewardedAd == null) {<NEW_LINE>Log.d("TAG", "The rewarded ad wasn't ready yet.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>showVideoButton.setVisibility(View.INVISIBLE);<NEW_LINE>rewardedAd.setFullScreenContentCallback(new FullScreenContentCallback() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onAdShowedFullScreenContent() {<NEW_LINE>// Called when ad is shown.<NEW_LINE>Log.d(TAG, "onAdShowedFullScreenContent");<NEW_LINE>Toast.makeText(MainActivity.this, "onAdShowedFullScreenContent", Toast.LENGTH_SHORT).show();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onAdFailedToShowFullScreenContent(AdError adError) {<NEW_LINE>// Called when ad fails to show.<NEW_LINE>Log.d(TAG, "onAdFailedToShowFullScreenContent");<NEW_LINE>// Don't forget to set the ad reference to null so you<NEW_LINE>// don't show the ad a second time.<NEW_LINE>rewardedAd = null;<NEW_LINE>Toast.makeText(MainActivity.this, "onAdFailedToShowFullScreenContent", Toast.LENGTH_SHORT).show();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onAdDismissedFullScreenContent() {<NEW_LINE>// Called when ad is dismissed.<NEW_LINE>Log.d(TAG, "onAdDismissedFullScreenContent");<NEW_LINE>// Don't forget to set the ad reference to null so you<NEW_LINE>// don't show the ad a second time.<NEW_LINE>rewardedAd = null;<NEW_LINE>Toast.makeText(MainActivity.this, "onAdDismissedFullScreenContent", <MASK><NEW_LINE>// Preload the next rewarded ad.<NEW_LINE>MainActivity.this.loadRewardedAd();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>Activity activityContext = MainActivity.this;<NEW_LINE>rewardedAd.show(activityContext, new OnUserEarnedRewardListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onUserEarnedReward(@NonNull RewardItem rewardItem) {<NEW_LINE>// Handle the reward.<NEW_LINE>Log.d("TAG", "The user earned the reward.");<NEW_LINE>int rewardAmount = rewardItem.getAmount();<NEW_LINE>String rewardType = rewardItem.getType();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | Toast.LENGTH_SHORT).show(); |
257,301 | void decode(Decoder decoder, Instruction instruction) {<NEW_LINE>int gpr;<NEW_LINE>if ((decoder.state_zs_flags & StateFlags.W) != 0) {<NEW_LINE>instruction.setCode(code64);<NEW_LINE>gpr = Register.RAX;<NEW_LINE>} else {<NEW_LINE>instruction.setCode(code32);<NEW_LINE>gpr = Register.EAX;<NEW_LINE>}<NEW_LINE>instruction.setOp0Register(decoder.state_reg + <MASK><NEW_LINE>if (decoder.state_mod == 3) {<NEW_LINE>instruction.setOp1Register(decoder.state_rm + decoder.state_zs_extraBaseRegisterBase + gpr);<NEW_LINE>} else {<NEW_LINE>instruction.setOp1Kind(OpKind.MEMORY);<NEW_LINE>decoder.readOpMem(instruction);<NEW_LINE>}<NEW_LINE>instruction.setOp2Kind(OpKind.IMMEDIATE8);<NEW_LINE>instruction.setImmediate8((byte) decoder.readByte());<NEW_LINE>} | decoder.state_zs_extraRegisterBase + Register.XMM0); |
682,820 | //<NEW_LINE>@Override<NEW_LINE>public void log(TraceComponent logger) {<NEW_LINE>Tr.debug(logger, MessageFormat.format("Method [ {0} ]", getHashText()));<NEW_LINE>Tr.debug(logger, MessageFormat.format(" Name [ {0} ]", getName()));<NEW_LINE>for (ClassInfoImpl nextParameterType : getParameterTypes()) {<NEW_LINE>Tr.debug(logger, MessageFormat.format(" Parameter Type [ {0} ]", nextParameterType.getHashText()));<NEW_LINE>}<NEW_LINE>Tr.debug(logger, MessageFormat.format(" Return Type [ {0} ]", getReturnType<MASK><NEW_LINE>for (ClassInfoImpl nextExceptionType : getExceptionTypes()) {<NEW_LINE>Tr.debug(logger, MessageFormat.format(" Exception Type [ {0} ]", nextExceptionType.getHashText()));<NEW_LINE>}<NEW_LINE>Tr.debug(logger, MessageFormat.format(" Declaring Class [ {0} ]", getDeclaringClass().getHashText()));<NEW_LINE>Tr.debug(logger, MessageFormat.format(" Default Value [ {0} ]", getAnnotationDefaultValue()));<NEW_LINE>} | ().getHashText())); |
590,017 | public static SelectInContext createContext(AnActionEvent event) {<NEW_LINE><MASK><NEW_LINE>SelectInContext result = createEditorContext(dataContext);<NEW_LINE>if (result != null) {<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>JComponent sourceComponent = getEventComponent(event);<NEW_LINE>if (sourceComponent == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>SelectInContext selectInContext = dataContext.getData(SelectInContext.DATA_KEY);<NEW_LINE>if (selectInContext == null) {<NEW_LINE>selectInContext = createPsiContext(event);<NEW_LINE>}<NEW_LINE>if (selectInContext == null) {<NEW_LINE>Navigatable descriptor = dataContext.getData(PlatformDataKeys.NAVIGATABLE);<NEW_LINE>if (descriptor instanceof OpenFileDescriptor) {<NEW_LINE>final VirtualFile file = ((OpenFileDescriptor) descriptor).getFile();<NEW_LINE>if (file.isValid()) {<NEW_LINE>Project project = dataContext.getData(CommonDataKeys.PROJECT);<NEW_LINE>selectInContext = OpenFileDescriptorContext.create(project, file);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (selectInContext == null) {<NEW_LINE>VirtualFile virtualFile = dataContext.getData(PlatformDataKeys.VIRTUAL_FILE);<NEW_LINE>Project project = dataContext.getData(CommonDataKeys.PROJECT);<NEW_LINE>if (virtualFile != null && project != null) {<NEW_LINE>return new VirtualFileSelectInContext(project, virtualFile);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return selectInContext;<NEW_LINE>} | DataContext dataContext = event.getDataContext(); |
196,676 | private static // can't find a good import tool framework, may ref mysqlimport<NEW_LINE>void insertImportByRange(int X, List<CSVRecord> rows, SqlExecutor router, String dbName, String tableName) {<NEW_LINE>int quotient = rows.size() / X;<NEW_LINE>int remainder <MASK><NEW_LINE>// range is [left, right)<NEW_LINE>List<Pair<Integer, Integer>> ranges = new ArrayList<>();<NEW_LINE>int start = 0;<NEW_LINE>for (int i = 0; i < remainder; ++i) {<NEW_LINE>int rangeEnd = Math.min(start + quotient + 1, rows.size());<NEW_LINE>ranges.add(Pair.of(start, rangeEnd));<NEW_LINE>start = rangeEnd;<NEW_LINE>}<NEW_LINE>for (int i = remainder; i < X; ++i) {<NEW_LINE>int rangeEnd = Math.min(start + quotient, rows.size());<NEW_LINE>ranges.add(Pair.of(start, rangeEnd));<NEW_LINE>start = rangeEnd;<NEW_LINE>}<NEW_LINE>List<Thread> threads = new ArrayList<>();<NEW_LINE>for (Pair<Integer, Integer> range : ranges) {<NEW_LINE>threads.add(new Thread(new InsertImporter(router, dbName, tableName, rows, range)));<NEW_LINE>}<NEW_LINE>threads.forEach(Thread::start);<NEW_LINE>threads.forEach(thread -> {<NEW_LINE>try {<NEW_LINE>thread.join();<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>logger.error(e.getMessage());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | = rows.size() % X; |
641,752 | public void readFields(Object object, JsonValue jsonMap) {<NEW_LINE>Class type = object.getClass();<NEW_LINE>OrderedMap<String, FieldMetadata> fields = getFields(type);<NEW_LINE>for (JsonValue child = jsonMap.child; child != null; child = child.next) {<NEW_LINE>FieldMetadata metadata = fields.get(child.name().replace(" ", "_"));<NEW_LINE>if (metadata == null) {<NEW_LINE>if (child.name.equals(typeName))<NEW_LINE>continue;<NEW_LINE>if (ignoreUnknownFields || ignoreUnknownField(type, child.name)) {<NEW_LINE>if (debug)<NEW_LINE>System.out.println("Ignoring unknown field: " + child.name + " (" + <MASK><NEW_LINE>continue;<NEW_LINE>} else {<NEW_LINE>SerializationException ex = new SerializationException("Field not found: " + child.name + " (" + type.getName() + ")");<NEW_LINE>ex.addTrace(child.trace());<NEW_LINE>throw ex;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (ignoreDeprecated && !readDeprecated && metadata.deprecated)<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Field field = metadata.field;<NEW_LINE>try {<NEW_LINE>field.set(object, readValue(field.getType(), metadata.elementType, child));<NEW_LINE>} catch (ReflectionException ex) {<NEW_LINE>throw new SerializationException("Error accessing field: " + field.getName() + " (" + type.getName() + ")", ex);<NEW_LINE>} catch (SerializationException ex) {<NEW_LINE>ex.addTrace(field.getName() + " (" + type.getName() + ")");<NEW_LINE>throw ex;<NEW_LINE>} catch (RuntimeException runtimeEx) {<NEW_LINE>SerializationException ex = new SerializationException(runtimeEx);<NEW_LINE>ex.addTrace(child.trace());<NEW_LINE>ex.addTrace(field.getName() + " (" + type.getName() + ")");<NEW_LINE>throw ex;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | type.getName() + ")"); |
1,261,178 | public void store(DomRepresentation mailRep) throws IOException {<NEW_LINE>// Configure the XML Schema used for validation<NEW_LINE>Representation mailXsd = new ClientResource(LocalReference.createClapReference(getClass().getPackage()) + "/Mail.xsd").get();<NEW_LINE>mailRep.setSchema(mailXsd);<NEW_LINE>mailRep.setErrorHandler(new ErrorHandler() {<NEW_LINE><NEW_LINE>public void error(SAXParseException exception) throws SAXException {<NEW_LINE>throw new ResourceException(exception);<NEW_LINE>}<NEW_LINE><NEW_LINE>public void fatalError(SAXParseException exception) throws SAXException {<NEW_LINE>throw new ResourceException(exception);<NEW_LINE>}<NEW_LINE><NEW_LINE>public void warning(SAXParseException exception) throws SAXException {<NEW_LINE>throw new ResourceException(exception);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// XML namespace configuration<NEW_LINE>String rmepNs = "http://www.rmep.org/namespaces/1.0";<NEW_LINE>mailRep.setNamespaceAware(true);<NEW_LINE>mailRep.getNamespaces().put("", rmepNs);<NEW_LINE>mailRep.getNamespaces().put("rmep", rmepNs);<NEW_LINE>// Retrieve the XML element using XPath expressions<NEW_LINE>String status = mailRep.getText("/:mail/:status");<NEW_LINE>String subject = mailRep.getText("/rmep:mail/:subject");<NEW_LINE>String content = mailRep.getText("/rmep:mail/rmep:content");<NEW_LINE>String <MASK><NEW_LINE>// Output the XML element values<NEW_LINE>System.out.println("Status: " + status);<NEW_LINE>System.out.println("Subject: " + subject);<NEW_LINE>System.out.println("Content: " + content);<NEW_LINE>System.out.println("Account URI: " + accountRef);<NEW_LINE>} | accountRef = mailRep.getText("/:mail/rmep:accountRef"); |
726,650 | void uninstallFix(Collection<String> fixNames) throws InstallException {<NEW_LINE>fireProgressEvent(InstallProgressEvent.CHECK, 1, Messages.INSTALL_KERNEL_MESSAGES.getLogMessage("STATE_CHECKING_FIXES"));<NEW_LINE>Set<IFixInfo> fixInfoSet = FixAdaptor.getInstalledIFixes(product.getInstallDir());<NEW_LINE>uninstallAssets <MASK><NEW_LINE>for (String fix : fixNames) {<NEW_LINE>IFixInfo targetFix = null;<NEW_LINE>for (IFixInfo fixInfo : fixInfoSet) {<NEW_LINE>if (fixInfo.getId().equals(fix)) {<NEW_LINE>targetFix = fixInfo;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (targetFix == null) {<NEW_LINE>throw ExceptionUtils.createByKey("ERROR_IFIX_NOT_INSTALLED", fix);<NEW_LINE>}<NEW_LINE>uninstallAssets.add(new UninstallAsset(targetFix));<NEW_LINE>}<NEW_LINE>fixDependencyChecker = new FixDependencyChecker();<NEW_LINE>for (UninstallAsset uninstallAsset : uninstallAssets) {<NEW_LINE>// Determine if there is still another fix that is not being uninstalled that requires the uninstallAsset<NEW_LINE>if (!fixDependencyChecker.isUninstallable(uninstallAsset, fixInfoSet, uninstallAssets)) {<NEW_LINE>throw ExceptionUtils.createByKey("ERROR_IFIX_UNINSTALLABLE", uninstallAsset.getIFixInfo().getId());<NEW_LINE>}<NEW_LINE>for (Problem problem : uninstallAsset.getIFixInfo().getResolves().getProblems()) {<NEW_LINE>ArrayList<String> dependency = FixDependencyChecker.fixRequiredByFeature(problem.getDisplayId(), product.getFeatureDefinitions());<NEW_LINE>if (dependency != null) {<NEW_LINE>log(Level.FINE, "Dependent features:");<NEW_LINE>for (String f : dependency) log(Level.FINE, f);<NEW_LINE>throw ExceptionUtils.createByKey("ERROR_IFIX_UNINSTALLABLE_REQUIRED_BY_FEATURE", uninstallAsset.getIFixInfo().getId(), dependency.get(0));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Determine the uninstall order<NEW_LINE>uninstallAssets = fixDependencyChecker.determineOrder(uninstallAssets);<NEW_LINE>} | = new ArrayList<UninstallAsset>(); |
1,662,834 | public void clickDrawerItem(DrawerItem item) {<NEW_LINE>logDebug("Item: " + item);<NEW_LINE>Menu bNVMenu = bNV.getMenu();<NEW_LINE>if (item == null) {<NEW_LINE>drawerMenuItem = bNVMenu.findItem(R.id.bottom_navigation_item_cloud_drive);<NEW_LINE>onNavigationItemSelected(drawerMenuItem);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>switch(item) {<NEW_LINE>case CLOUD_DRIVE:<NEW_LINE>{<NEW_LINE>setBottomNavigationMenuItemChecked(CLOUD_DRIVE_BNV);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case HOMEPAGE:<NEW_LINE>{<NEW_LINE>setBottomNavigationMenuItemChecked(HOME_BNV);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case PHOTOS:<NEW_LINE>{<NEW_LINE>setBottomNavigationMenuItemChecked(PHOTOS_BNV);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case SHARED_ITEMS:<NEW_LINE>{<NEW_LINE>setBottomNavigationMenuItemChecked(SHARED_ITEMS_BNV);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case CHAT:<NEW_LINE>{<NEW_LINE>setBottomNavigationMenuItemChecked(CHAT_BNV);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case SETTINGS:<NEW_LINE>if (SettingsFragmentRefactorToggle.INSTANCE.getEnabled() == true) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case SEARCH:<NEW_LINE>case TRANSFERS:<NEW_LINE>case NOTIFICATIONS:<NEW_LINE>case INBOX:<NEW_LINE>{<NEW_LINE>setBottomNavigationMenuItemChecked(NO_BNV);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | drawerLayout.closeDrawer(Gravity.LEFT); |
138,788 | public RxNormConcept unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>RxNormConcept rxNormConcept = new RxNormConcept();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return 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("Description", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>rxNormConcept.setDescription(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Code", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>rxNormConcept.setCode(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Score", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>rxNormConcept.setScore(context.getUnmarshaller(Float.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 rxNormConcept;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
102,302 | public void handleLabelsFileUpload(FileUploadEvent event) {<NEW_LINE>logger.fine("entering handleUpload method.");<NEW_LINE>UploadedFile file = event.getFile();<NEW_LINE>if (file != null) {<NEW_LINE>InputStream uploadStream = null;<NEW_LINE>try {<NEW_LINE>uploadStream = file.getInputStream();<NEW_LINE>} catch (IOException ioex) {<NEW_LINE>logger.log(Level.WARNING, ioex, () -> "the file " + file.getFileName() + " failed to upload!");<NEW_LINE>List<String> args = Arrays.asList(file.getFileName());<NEW_LINE>String msg = BundleUtil.getStringFromBundle("dataset.file.uploadFailure.detailmsg", args);<NEW_LINE>FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_WARN, BundleUtil.getStringFromBundle("dataset.file.uploadFailure"), msg);<NEW_LINE>FacesContext.getCurrentInstance(<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>savedLabelsTempFile = saveTempFile(uploadStream);<NEW_LINE>logger.fine(() -> file.getFileName() + " is successfully uploaded.");<NEW_LINE>List<String> args = Arrays.asList(file.getFileName());<NEW_LINE>FacesMessage message = new FacesMessage(BundleUtil.getStringFromBundle("dataset.file.upload", args));<NEW_LINE>FacesContext.getCurrentInstance().addMessage(null, message);<NEW_LINE>}<NEW_LINE>// process file (i.e., just save it in a temp location; for now):<NEW_LINE>} | ).addMessage(null, message); |
707,190 | public static DescribeSagHaResponse unmarshall(DescribeSagHaResponse describeSagHaResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeSagHaResponse.setRequestId(_ctx.stringValue("DescribeSagHaResponse.RequestId"));<NEW_LINE>describeSagHaResponse.setMode(_ctx.stringValue("DescribeSagHaResponse.Mode"));<NEW_LINE>List<Port> ports = new ArrayList<Port>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeSagHaResponse.Ports.Length"); i++) {<NEW_LINE>Port port = new Port();<NEW_LINE>port.setPortName(_ctx.stringValue("DescribeSagHaResponse.Ports[" + i + "].PortName"));<NEW_LINE>port.setVirtualIp(_ctx.stringValue("DescribeSagHaResponse.Ports[" + i + "].VirtualIp"));<NEW_LINE>ports.add(port);<NEW_LINE>}<NEW_LINE>describeSagHaResponse.setPorts(ports);<NEW_LINE>List<TaskState> taskStates = new ArrayList<TaskState>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeSagHaResponse.TaskStates.Length"); i++) {<NEW_LINE>TaskState taskState = new TaskState();<NEW_LINE>taskState.setErrorMessage(_ctx.stringValue("DescribeSagHaResponse.TaskStates[" + i + "].ErrorMessage"));<NEW_LINE>taskState.setState(_ctx.stringValue("DescribeSagHaResponse.TaskStates[" + i + "].State"));<NEW_LINE>taskState.setErrorCode(_ctx.stringValue("DescribeSagHaResponse.TaskStates[" + i + "].ErrorCode"));<NEW_LINE>taskState.setCreateTime(_ctx.stringValue<MASK><NEW_LINE>taskStates.add(taskState);<NEW_LINE>}<NEW_LINE>describeSagHaResponse.setTaskStates(taskStates);<NEW_LINE>return describeSagHaResponse;<NEW_LINE>} | ("DescribeSagHaResponse.TaskStates[" + i + "].CreateTime")); |
1,723,075 | private void loadNode0() {<NEW_LINE>UaMethodNode node = new UaMethodNode(this.context, Identifiers.TrustListType_OpenWithMasks, new QualifiedName(0, "OpenWithMasks"), new LocalizedText("en", "OpenWithMasks"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf<MASK><NEW_LINE>node.addReference(new Reference(Identifiers.TrustListType_OpenWithMasks, Identifiers.HasProperty, Identifiers.TrustListType_OpenWithMasks_InputArguments.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.TrustListType_OpenWithMasks, Identifiers.HasProperty, Identifiers.TrustListType_OpenWithMasks_OutputArguments.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.TrustListType_OpenWithMasks, Identifiers.HasModellingRule, Identifiers.ModellingRule_Mandatory.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.TrustListType_OpenWithMasks, Identifiers.HasComponent, Identifiers.TrustListType.expanded(), false));<NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>} | (0), true, true); |
1,309,089 | public static String simpleTypeName(TypeMirror type) {<NEW_LINE>switch(type.getKind()) {<NEW_LINE>case ARRAY:<NEW_LINE>return simpleTypeName(((ArrayType) type).getComponentType()) + "[]";<NEW_LINE>case TYPEVAR:<NEW_LINE>return ((TypeVariable) type).asElement().getSimpleName().toString();<NEW_LINE>case DECLARED:<NEW_LINE>return ((DeclaredType) type).asElement().getSimpleName().toString();<NEW_LINE>case NULL:<NEW_LINE>return "<nulltype>";<NEW_LINE>case VOID:<NEW_LINE>return "void";<NEW_LINE>case WILDCARD:<NEW_LINE>WildcardType wildcard = (WildcardType) type;<NEW_LINE>TypeMirror extendsBound = wildcard.getExtendsBound();<NEW_LINE>TypeMirror superBound = wildcard.getSuperBound();<NEW_LINE>return "?" + (extendsBound != null ? " extends " + simpleTypeName(extendsBound) : "") + (superBound != null ? " super " + simpleTypeName(superBound) : "");<NEW_LINE>case UNION:<NEW_LINE>StringJoiner sj = new StringJoiner(" | ");<NEW_LINE>for (TypeMirror alternative : ((UnionType) type).getAlternatives()) {<NEW_LINE>sj.add(simpleTypeName(alternative));<NEW_LINE>}<NEW_LINE>return sj.toString();<NEW_LINE>default:<NEW_LINE>if (type.getKind().isPrimitive()) {<NEW_LINE>return TypeAnnotationUtils.unannotatedType(type).toString();<NEW_LINE>} else {<NEW_LINE>throw new BugInCF("simpleTypeName: unhandled type kind: %s, type: %s", <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | type.getKind(), type); |
528,241 | public void nextError() {<NEW_LINE>SingleDocument document = getCurrentDocument();<NEW_LINE>if (document == null || docType != DocumentType.WRITER || !documents.isEnoughHeapSpace()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>XComponent xComponent = document.getXComponent();<NEW_LINE>DocumentCursorTools docCursor = new DocumentCursorTools(xComponent);<NEW_LINE>if (docCache == null || docCache.size() <= 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>int yFlat = getCurrentFlatParagraphNumber(viewCursor, docCache);<NEW_LINE>if (yFlat < 0) {<NEW_LINE>MessageHandler.showClosingInformationDialog(messages.getString("loNextErrorUnsupported"));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int x = viewCursor.getViewCursorCharacter();<NEW_LINE>while (yFlat < docCache.size()) {<NEW_LINE>CheckError nextError = getNextErrorInParagraph(x, yFlat, document, docCursor);<NEW_LINE>if (nextError != null && setFlatViewCursor(nextError.error.nErrorStart + 1, yFlat, viewCursor, docCache)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>x = 0;<NEW_LINE>yFlat++;<NEW_LINE>}<NEW_LINE>MessageHandler.showClosingInformationDialog(messages.getString("guiCheckComplete"));<NEW_LINE>} | ViewCursorTools viewCursor = new ViewCursorTools(xComponent); |
1,105,166 | public void updateWindow() throws Http2Exception {<NEW_LINE>if (!autoTuneFlowControlOn) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>pingReturn++;<NEW_LINE>long elapsedTime = (System.nanoTime() - lastPingTime);<NEW_LINE>if (elapsedTime == 0) {<NEW_LINE>elapsedTime = 1;<NEW_LINE>}<NEW_LINE>long bandwidth = (getDataSincePing() * TimeUnit.SECONDS<MASK><NEW_LINE>Http2LocalFlowController fc = decoder().flowController();<NEW_LINE>// Calculate new window size by doubling the observed BDP, but cap at max window<NEW_LINE>int targetWindow = Math.min(getDataSincePing() * 2, MAX_WINDOW_SIZE);<NEW_LINE>setPinging(false);<NEW_LINE>int currentWindow = fc.initialWindowSize(connection().connectionStream());<NEW_LINE>if (targetWindow > currentWindow && bandwidth > lastBandwidth) {<NEW_LINE>lastBandwidth = bandwidth;<NEW_LINE>int increase = targetWindow - currentWindow;<NEW_LINE>fc.incrementWindowSize(connection().connectionStream(), increase);<NEW_LINE>fc.initialWindowSize(targetWindow);<NEW_LINE>Http2Settings settings = new Http2Settings();<NEW_LINE>settings.initialWindowSize(targetWindow);<NEW_LINE>frameWriter().writeSettings(ctx(), settings, ctx().newPromise());<NEW_LINE>}<NEW_LINE>} | .toNanos(1)) / elapsedTime; |
962,375 | private void animate(double targetSeconds) {<NEW_LINE>if (!preDraw()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final List<CodeCacheEvent> events = codeCacheData.getEvents();<NEW_LINE>final int eventCount = events.size();<NEW_LINE>double framesPerSecond = 60;<NEW_LINE>double frameCount = targetSeconds * framesPerSecond;<NEW_LINE>final double eventsPerFrame = eventCount / frameCount;<NEW_LINE>final double secondsPerEvent = targetSeconds / eventCount;<NEW_LINE>final double nanoSecondsPerEvent = 1_000_000_000 * secondsPerEvent;<NEW_LINE>AnimationTimer timer = new AnimationTimer() {<NEW_LINE><NEW_LINE>private int currentEvent;<NEW_LINE><NEW_LINE>private long lastHandledAt = 0;<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void handle(long now) {<NEW_LINE>double realEventsPerFrame = eventsPerFrame;<NEW_LINE>if (eventsPerFrame < 1.0) {<NEW_LINE>realEventsPerFrame = 1;<NEW_LINE>if (now - lastHandledAt < nanoSecondsPerEvent) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>lastHandledAt = now;<NEW_LINE>}<NEW_LINE>for (int i = 0; i < realEventsPerFrame; i++) {<NEW_LINE>if (currentEvent >= eventCount) {<NEW_LINE>stop();<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>CodeCacheEvent event = events.get(currentEvent++);<NEW_LINE>if (!showEvent(event)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>final Compilation eventCompilation = event.getCompilation();<NEW_LINE>final IMetaMember compilationMember = eventCompilation.getMember();<NEW_LINE>if (eventCompilation != null) {<NEW_LINE>long addressOffset = event.getNativeAddress() - lowAddress;<NEW_LINE>double scaledAddress = (<MASK><NEW_LINE>double scaledSize = (double) event.getNativeCodeSize() / (double) addressRange;<NEW_LINE>int latestCompilationIndex = compilationMember.getCompilations().size() - 1;<NEW_LINE>Color fillColour;<NEW_LINE>if (eventCompilation.getIndex() == latestCompilationIndex) {<NEW_LINE>fillColour = LATEST_COMPILATION;<NEW_LINE>} else {<NEW_LINE>fillColour = NOT_LATEST_COMPILATION;<NEW_LINE>}<NEW_LINE>double x = scaledAddress * width;<NEW_LINE>double y = 0;<NEW_LINE>double w = scaledSize * width;<NEW_LINE>double h = height;<NEW_LINE>plotCompilation(x, y, w, h, fillColour, eventCompilation, false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void start() {<NEW_LINE>super.start();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void stop() {<NEW_LINE>super.stop();<NEW_LINE>btnAnimate.setDisable(false);<NEW_LINE>redraw();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>btnAnimate.setDisable(true);<NEW_LINE>timer.start();<NEW_LINE>} | double) addressOffset / (double) addressRange; |
1,098,813 | final UntagResourceResult executeUntagResource(UntagResourceRequest untagResourceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(untagResourceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UntagResourceRequest> request = null;<NEW_LINE>Response<UntagResourceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UntagResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(untagResourceRequest));<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, "resiliencehub");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UntagResource");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UntagResourceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UntagResourceResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | endClientExecution(awsRequestMetrics, request, response); |
298,028 | final public void shapeRef() throws ParseException {<NEW_LINE>Token t;<NEW_LINE>Node ref;<NEW_LINE>switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {<NEW_LINE>case ATPNAME_LN:<NEW_LINE>{<NEW_LINE>t = jj_consume_token(ATPNAME_LN);<NEW_LINE>ref = resolve_AT_PName(t.image, <MASK><NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case ATPNAME_NS:<NEW_LINE>{<NEW_LINE>t = jj_consume_token(ATPNAME_NS);<NEW_LINE>ref = resolve_AT_PName(t.image, t.beginLine, t.beginColumn);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case AT:<NEW_LINE>{<NEW_LINE>jj_consume_token(AT);<NEW_LINE>ref = shapeExprLabel();<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>default:<NEW_LINE>jj_la1[24] = jj_gen;<NEW_LINE>jj_consume_token(-1);<NEW_LINE>throw new ParseException();<NEW_LINE>}<NEW_LINE>shapeReference(ref);<NEW_LINE>} | t.beginLine, t.beginColumn); |
986,285 | public DescribeSnapshotsResult unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>DescribeSnapshotsResult describeSnapshotsResult = new DescribeSnapshotsResult();<NEW_LINE><MASK><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 describeSnapshotsResult;<NEW_LINE>if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {<NEW_LINE>if (context.testExpression("snapshotSet", targetDepth)) {<NEW_LINE>describeSnapshotsResult.withSnapshots(new ArrayList<Snapshot>());<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("snapshotSet/item", targetDepth)) {<NEW_LINE>describeSnapshotsResult.withSnapshots(SnapshotStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("nextToken", targetDepth)) {<NEW_LINE>describeSnapshotsResult.setNextToken(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent.isEndElement()) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return describeSnapshotsResult;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
1,346,492 | public void marshall(ListWirelessDevicesRequest listWirelessDevicesRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (listWirelessDevicesRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(listWirelessDevicesRequest.getMaxResults(), MAXRESULTS_BINDING);<NEW_LINE>protocolMarshaller.marshall(listWirelessDevicesRequest.getNextToken(), NEXTTOKEN_BINDING);<NEW_LINE>protocolMarshaller.marshall(listWirelessDevicesRequest.getDestinationName(), DESTINATIONNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(listWirelessDevicesRequest.getDeviceProfileId(), DEVICEPROFILEID_BINDING);<NEW_LINE>protocolMarshaller.marshall(listWirelessDevicesRequest.getServiceProfileId(), SERVICEPROFILEID_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(listWirelessDevicesRequest.getFuotaTaskId(), FUOTATASKID_BINDING);<NEW_LINE>protocolMarshaller.marshall(listWirelessDevicesRequest.getMulticastGroupId(), MULTICASTGROUPID_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | listWirelessDevicesRequest.getWirelessDeviceType(), WIRELESSDEVICETYPE_BINDING); |
215,080 | private void showErrorDialog(String errorMsg, String details) {<NEW_LINE>if (!isFinishing() && !isPaused) {<NEW_LINE>AlertDialog.Builder builder = new AlertDialog.Builder(this);<NEW_LINE>builder.setTitle(R.string.error_label);<NEW_LINE>if (errorMsg != null) {<NEW_LINE>String total = errorMsg + "\n\n" + details;<NEW_LINE><MASK><NEW_LINE>errorMessage.setSpan(new ForegroundColorSpan(0x88888888), errorMsg.length(), total.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);<NEW_LINE>builder.setMessage(errorMessage);<NEW_LINE>} else {<NEW_LINE>builder.setMessage(R.string.download_error_error_unknown);<NEW_LINE>}<NEW_LINE>builder.setPositiveButton(android.R.string.ok, (dialog, which) -> dialog.cancel());<NEW_LINE>builder.setOnDismissListener(dialog -> {<NEW_LINE>setResult(RESULT_ERROR);<NEW_LINE>finish();<NEW_LINE>});<NEW_LINE>if (dialog != null && dialog.isShowing()) {<NEW_LINE>dialog.dismiss();<NEW_LINE>}<NEW_LINE>dialog = builder.show();<NEW_LINE>}<NEW_LINE>} | SpannableString errorMessage = new SpannableString(total); |
203,183 | public void testCriteriaQuery_Short(TestExecutionContext testExecCtx, TestExecutionResources testExecResources, Object managedComponentObject) throws Throwable {<NEW_LINE>final String testName = getTestName();<NEW_LINE>// Verify parameters<NEW_LINE>if (testExecCtx == null || testExecResources == null) {<NEW_LINE>Assert.fail(testName + ": Missing context and/or resources. Cannot execute the test.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final JPAResource jpaResource = testExecResources.getJpaResourceMap().get("test-jpa-resource");<NEW_LINE>if (jpaResource == null) {<NEW_LINE>Assert.fail("Missing JPAResource 'test-jpa-resource'). Cannot execute the test.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Process Test Properties<NEW_LINE>final Map<String, Serializable> testProps = testExecCtx.getProperties();<NEW_LINE>if (testProps != null) {<NEW_LINE>for (String key : testProps.keySet()) {<NEW_LINE>System.out.println("Test Property: " + key + " = " + testProps.get(key));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>EntityManager em = jpaResource.getEm();<NEW_LINE>TransactionJacket tx = jpaResource.getTj();<NEW_LINE>// Execute Test Case<NEW_LINE>try {<NEW_LINE>tx.beginTransaction();<NEW_LINE>if (jpaResource.getPcCtxInfo().getPcType() == PersistenceContextType.APPLICATION_MANAGED_JTA)<NEW_LINE>em.joinTransaction();<NEW_LINE>CriteriaBuilder cb = em.getCriteriaBuilder();<NEW_LINE>CriteriaQuery<Entity0015> cq = cb.createQuery(Entity0015.class);<NEW_LINE>Root<Entity0015> root = cq.from(Entity0015.class);<NEW_LINE>cq.select(root);<NEW_LINE>TypedQuery<Entity0015> tq = em.createQuery(cq);<NEW_LINE>Entity0015 findEntity = tq.getSingleResult();<NEW_LINE>System.out.println("Object returned by query: " + findEntity);<NEW_LINE>assertNotNull("Did not find entity in criteria query", findEntity);<NEW_LINE>assertTrue("Entity returned by find was not contained in the persistence context."<MASK><NEW_LINE>assertEquals(new Short((short) 15), findEntity.getEntity0015_id());<NEW_LINE>assertEquals("Entity0015_STRING01", findEntity.getEntity0015_string01());<NEW_LINE>assertEquals("Entity0015_STRING02", findEntity.getEntity0015_string02());<NEW_LINE>assertEquals("Entity0015_STRING03", findEntity.getEntity0015_string03());<NEW_LINE>tx.commitTransaction();<NEW_LINE>} finally {<NEW_LINE>System.out.println(testName + ": End");<NEW_LINE>}<NEW_LINE>} | , em.contains(findEntity)); |
1,015,102 | protected void translateAndSendBatch(ConsumerRecords<?, ?> records, Instant readTime) throws Exception {<NEW_LINE>// iterate through each topic partition one at a time, for better isolation<NEW_LINE>for (TopicPartition topicPartition : records.partitions()) {<NEW_LINE>for (ConsumerRecord<?, ?> record : records.records(topicPartition)) {<NEW_LINE>try {<NEW_LINE>boolean partitionPaused;<NEW_LINE>boolean sendFailure;<NEW_LINE>synchronized (_sendFailureTopicPartitionExceptionMap) {<NEW_LINE>partitionPaused = _autoPausedSourcePartitions.containsKey(topicPartition);<NEW_LINE>sendFailure = _sendFailureTopicPartitionExceptionMap.containsKey(topicPartition);<NEW_LINE>}<NEW_LINE>if (partitionPaused || sendFailure) {<NEW_LINE>_logger.warn("Abort sending for {}, auto-paused: {}, send failure: {}, rewind offset", topicPartition, partitionPaused, sendFailure);<NEW_LINE>seekToLastCheckpoint<MASK><NEW_LINE>break;<NEW_LINE>} else {<NEW_LINE>DatastreamProducerRecord datastreamProducerRecord = translate(record, readTime);<NEW_LINE>int numBytes = record.serializedKeySize() + record.serializedValueSize();<NEW_LINE>sendDatastreamProducerRecord(datastreamProducerRecord, topicPartition, numBytes, null);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>_logger.warn(String.format("Got exception while sending record %s, exception: ", record), e);<NEW_LINE>if (_shutdown && !(e instanceof WakeupException)) {<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>rewindAndPausePartitionOnException(topicPartition, e);<NEW_LINE>// skip other messages for this partition, but can continue processing other partitions<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | (Collections.singleton(topicPartition)); |
1,612,152 | static String incorporateConstAnnotation(String annotations, int constValueIndex, boolean constValue) {<NEW_LINE>int start = annotations.indexOf("@Const");<NEW_LINE>int end = annotations.indexOf("@", start + 1);<NEW_LINE>if (end == -1) {<NEW_LINE>end = annotations.length();<NEW_LINE>}<NEW_LINE>String prefix = annotations.substring(0, start);<NEW_LINE>String constAnnotation = annotations.substring(start, end);<NEW_LINE>String suffix = " " + annotations.substring(end, annotations.length());<NEW_LINE>String boolPatternStr = "(true|false)";<NEW_LINE>Pattern <MASK><NEW_LINE>Matcher matcher = boolPattern.matcher(constAnnotation);<NEW_LINE>boolean[] constArray = { true, false, false };<NEW_LINE>int index = 0;<NEW_LINE>while (matcher.find()) {<NEW_LINE>constArray[index++] = Boolean.parseBoolean(matcher.group(1));<NEW_LINE>}<NEW_LINE>constArray[constValueIndex] = constValue;<NEW_LINE>String incorporatedConstAnnotation = "@Const({" + constArray[0] + ", " + constArray[1] + ", " + constArray[2] + "})";<NEW_LINE>return prefix + incorporatedConstAnnotation + suffix;<NEW_LINE>} | boolPattern = Pattern.compile(boolPatternStr); |
662,569 | protected void afterAttachNic(VmNicInventory nicInventory, boolean applyToBackend, Completion completion) {<NEW_LINE>VmNicVO vo = Q.New(VmNicVO.class).eq(VmNicVO_.uuid, nicInventory.getUuid()).find();<NEW_LINE>L3NetworkVO l3NetworkVO = Q.New(L3NetworkVO.class).eq(L3NetworkVO_.uuid, vo.getL3NetworkUuid()).find();<NEW_LINE>if (l3NetworkVO.getCategory().equals(L3NetworkCategory.Private)) {<NEW_LINE>vo.setMetaData(GUEST_NIC_MASK.toString());<NEW_LINE>UsedIpVO usedIpVO = Q.New(UsedIpVO.class).eq(UsedIpVO_.uuid, nicInventory.getUsedIpUuid()).find();<NEW_LINE>usedIpVO.setMetaData(GUEST_NIC_MASK.toString());<NEW_LINE>dbf.updateAndRefresh(usedIpVO);<NEW_LINE>} else {<NEW_LINE>vo.setMetaData(ADDITIONAL_PUBLIC_NIC_MASK.toString());<NEW_LINE>}<NEW_LINE>vo = dbf.updateAndRefresh(vo);<NEW_LINE>logger.debug(String.format("updated metadata of vmnic[uuid: %s]", vo.getUuid()));<NEW_LINE>VirtualRouterVmVO vrVo = dbf.findByUuid(self.<MASK><NEW_LINE>Map<String, Object> data = new HashMap<String, Object>();<NEW_LINE>data.put(Param.VR_NIC.toString(), VmNicInventory.valueOf(vo));<NEW_LINE>data.put(Param.SNAT.toString(), Boolean.FALSE);<NEW_LINE>data.put(Param.VR.toString(), VirtualRouterVmInventory.valueOf(vrVo));<NEW_LINE>data.put(Param.APPLY_TO_VIRTUALROUTER.toString(), applyToBackend);<NEW_LINE>FlowChain chain = FlowChainBuilder.newSimpleFlowChain();<NEW_LINE>chain.setName(String.format("apply-services-after-attach-nic-%s-from-virtualrouter-%s", nicInventory.getUuid(), nicInventory.getVmInstanceUuid()));<NEW_LINE>chain.setData(data);<NEW_LINE>chain.then(new virtualRouterAfterAttachNicFlow());<NEW_LINE>chain.then(new VirtualRouterCreatePublicVipFlow());<NEW_LINE>chain.then(new virtualRouterApplyServicesAfterAttachNicFlow());<NEW_LINE>chain.then(haBackend.getAttachL3NetworkFlow());<NEW_LINE>chain.done(new FlowDoneHandler(completion) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void handle(Map data) {<NEW_LINE>completion.success();<NEW_LINE>}<NEW_LINE>}).error(new FlowErrorHandler(completion) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void handle(ErrorCode errCode, Map data) {<NEW_LINE>completion.fail(errCode);<NEW_LINE>}<NEW_LINE>}).start();<NEW_LINE>} | getUuid(), VirtualRouterVmVO.class); |
913,293 | private JPanel parallelTab(final ComponentAssembly boosters) {<NEW_LINE>JPanel motherPanel = new JPanel(new MigLayout("fill"));<NEW_LINE>// radial distance method<NEW_LINE>JLabel radiusMethodLabel = new JLabel(trans.get("RocketComponent.Position.Method.Radius.Label"));<NEW_LINE>motherPanel.add(radiusMethodLabel, "align left");<NEW_LINE>final EnumModel<RadiusMethod> radiusMethodModel = new EnumModel<RadiusMethod>(boosters, "RadiusMethod", RadiusMethod.choices());<NEW_LINE>final JComboBox<RadiusMethod> radiusMethodCombo = new JComboBox<RadiusMethod>(radiusMethodModel);<NEW_LINE>motherPanel.add(radiusMethodCombo, "align left, wrap");<NEW_LINE>// set radial distance<NEW_LINE>JLabel radiusLabel = new JLabel<MASK><NEW_LINE>motherPanel.add(radiusLabel, "align left");<NEW_LINE>// radiusMethodModel.addEnableComponent(radiusLabel, false);<NEW_LINE>DoubleModel radiusModel = new DoubleModel(boosters, "RadiusOffset", UnitGroup.UNITS_LENGTH, 0);<NEW_LINE>JSpinner radiusSpinner = new JSpinner(radiusModel.getSpinnerModel());<NEW_LINE>radiusSpinner.setEditor(new SpinnerEditor(radiusSpinner));<NEW_LINE>motherPanel.add(radiusSpinner, "growx 1, align right");<NEW_LINE>// autoRadOffsModel.addEnableComponent(radiusSpinner, false);<NEW_LINE>UnitSelector radiusUnitSelector = new UnitSelector(radiusModel);<NEW_LINE>motherPanel.add(radiusUnitSelector, "growx 1, wrap");<NEW_LINE>// autoRadOffsModel.addEnableComponent(radiusUnitSelector, false);<NEW_LINE>// // set location angle around the primary stage<NEW_LINE>// JLabel angleMethodLabel = new JLabel(trans.get("RocketComponent.Position.Method.Angle.Label"));<NEW_LINE>// motherPanel.add( angleMethodLabel, "align left");<NEW_LINE>// EnumModel<AngleMethod> angleMethodModel = new EnumModel<AngleMethod>( boosters, "AngleMethod", AngleMethod.choices() );<NEW_LINE>// final JComboBox<AngleMethod> angleMethodCombo = new JComboBox<AngleMethod>( angleMethodModel );<NEW_LINE>// motherPanel.add( angleMethodCombo, "align left, wrap");<NEW_LINE>JLabel angleLabel = new JLabel(trans.get("StageConfig.parallel.angle"));<NEW_LINE>motherPanel.add(angleLabel, "align left");<NEW_LINE>DoubleModel angleModel = new DoubleModel(boosters, "AngleOffset", 1.0, UnitGroup.UNITS_ANGLE, 0.0, Math.PI * 2);<NEW_LINE>JSpinner angleSpinner = new JSpinner(angleModel.getSpinnerModel());<NEW_LINE>angleSpinner.setEditor(new SpinnerEditor(angleSpinner));<NEW_LINE>motherPanel.add(angleSpinner, "growx 1");<NEW_LINE>UnitSelector angleUnitSelector = new UnitSelector(angleModel);<NEW_LINE>motherPanel.add(angleUnitSelector, "growx 1, wrap");<NEW_LINE>// set multiplicity<NEW_LINE>JLabel countLabel = new JLabel(trans.get("StageConfig.parallel.count"));<NEW_LINE>motherPanel.add(countLabel, "align left");<NEW_LINE>IntegerModel countModel = new IntegerModel(boosters, "InstanceCount", 1);<NEW_LINE>JSpinner countSpinner = new JSpinner(countModel.getSpinnerModel());<NEW_LINE>countSpinner.setEditor(new SpinnerEditor(countSpinner));<NEW_LINE>motherPanel.add(countSpinner, "growx 1, wrap");<NEW_LINE>// setPositions relative to parent component<NEW_LINE>JLabel positionLabel = new JLabel(trans.get("LaunchLugCfg.lbl.Posrelativeto"));<NEW_LINE>motherPanel.add(positionLabel);<NEW_LINE>ComboBoxModel<AxialMethod> axialPositionMethodModel = new EnumModel<AxialMethod>(component, "AxialMethod", AxialMethod.axialOffsetMethods);<NEW_LINE>JComboBox<?> positionMethodCombo = new JComboBox<AxialMethod>(axialPositionMethodModel);<NEW_LINE>motherPanel.add(positionMethodCombo, "spanx 2, growx, wrap");<NEW_LINE>// relative offset labels<NEW_LINE>JLabel positionPlusLabel = new JLabel(trans.get("StageConfig.parallel.offset"));<NEW_LINE>motherPanel.add(positionPlusLabel);<NEW_LINE>DoubleModel axialOffsetModel = new DoubleModel(boosters, "AxialOffset", UnitGroup.UNITS_LENGTH);<NEW_LINE>JSpinner axPosSpin = new JSpinner(axialOffsetModel.getSpinnerModel());<NEW_LINE>axPosSpin.setEditor(new SpinnerEditor(axPosSpin));<NEW_LINE>motherPanel.add(axPosSpin, "growx");<NEW_LINE>UnitSelector axialOffsetUnitSelector = new UnitSelector(axialOffsetModel);<NEW_LINE>motherPanel.add(axialOffsetUnitSelector, "growx 1, wrap");<NEW_LINE>// For DEBUG purposes<NEW_LINE>// System.err.println(assembly.getRocket().toDebugTree());<NEW_LINE>return motherPanel;<NEW_LINE>} | (trans.get("StageConfig.parallel.radius")); |
633,418 | protected void checkChannelConstraints(final Element eChannel) throws FeedException {<NEW_LINE>checkNotNullAndLength(eChannel, "title", 1, 100);<NEW_LINE>checkNotNullAndLength(eChannel, "description", 1, 500);<NEW_LINE>checkNotNullAndLength(eChannel, "link", 1, 500);<NEW_LINE>checkNotNullAndLength(eChannel, "language", 2, 5);<NEW_LINE>checkLength(eChannel, "rating", 20, 500);<NEW_LINE>checkLength(<MASK><NEW_LINE>checkLength(eChannel, "pubDate", 1, 100);<NEW_LINE>checkLength(eChannel, "lastBuildDate", 1, 100);<NEW_LINE>checkLength(eChannel, "docs", 1, 500);<NEW_LINE>checkLength(eChannel, "managingEditor", 1, 100);<NEW_LINE>checkLength(eChannel, "webMaster", 1, 100);<NEW_LINE>final Element skipHours = eChannel.getChild("skipHours");<NEW_LINE>if (skipHours != null) {<NEW_LINE>final List<Element> hours = skipHours.getChildren();<NEW_LINE>for (final Element hour : hours) {<NEW_LINE>final int value = Integer.parseInt(hour.getText().trim());<NEW_LINE>if (isHourFormat24()) {<NEW_LINE>if (value < 1 || value > 24) {<NEW_LINE>throw new FeedException("Invalid hour value " + value + ", it must be between 1 and 24");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (value < 0 || value > 23) {<NEW_LINE>throw new FeedException("Invalid hour value " + value + ", it must be between 0 and 23");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | eChannel, "copyright", 1, 100); |
1,374,435 | final GetGroupResult executeGetGroup(GetGroupRequest getGroupRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getGroupRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetGroupRequest> request = null;<NEW_LINE>Response<GetGroupResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetGroupRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getGroupRequest));<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, "XRay");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetGroup");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetGroupResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetGroupResultJsonUnmarshaller());<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.endEvent(Field.RequestMarshallTime); |
498,122 | public static Pair<Boolean, Object> doInboundValueProcessing(String assetId, Attribute<?> attribute, AgentLink<?> agentLink, Object value) {<NEW_LINE>Pair<Boolean, Object> ignoreAndConvertedValue;<NEW_LINE>final AtomicReference<Object> valRef = new AtomicReference<>(value);<NEW_LINE>// value filtering<NEW_LINE>agentLink.getValueFilters().ifPresent(valueFilters -> {<NEW_LINE>Protocol.LOG.finer("Applying attribute value filters to attribute: assetId=" + assetId + ", attribute=" + attribute.getName());<NEW_LINE>Object o = ValueUtil.applyValueFilters(value, valueFilters);<NEW_LINE>if (o == null) {<NEW_LINE>Protocol.LOG.info("Value filters generated a null value for attribute: assetId=" + assetId + ", attribute=" + attribute.getName());<NEW_LINE>}<NEW_LINE>valRef.set(o);<NEW_LINE>});<NEW_LINE>// value conversion<NEW_LINE>ignoreAndConvertedValue = agentLink.getValueConverter().map(converter -> {<NEW_LINE>Protocol.LOG.finer("Applying attribute value converter to attribute: assetId=" + assetId + ", attribute=" + attribute.getName());<NEW_LINE>return applyValueConverter(valRef.get(), converter);<NEW_LINE>}).orElse(new Pair<>(false, valRef.get()));<NEW_LINE>if (ignoreAndConvertedValue.key) {<NEW_LINE>return ignoreAndConvertedValue;<NEW_LINE>}<NEW_LINE>valRef.set(ignoreAndConvertedValue.value);<NEW_LINE>if (valRef.get() == null) {<NEW_LINE>return new Pair<>(false, null);<NEW_LINE>}<NEW_LINE>// built in value conversion<NEW_LINE>Class<?> toType = attribute.getType().getType();<NEW_LINE>Class<?> fromType = valRef.get().getClass();<NEW_LINE>if (toType != fromType) {<NEW_LINE>Protocol.LOG.finer("Applying built in attribute value conversion: " + fromType + " -> " + toType);<NEW_LINE>valRef.set(ValueUtil.getValueCoerced(valRef.get(), toType).orElse(null));<NEW_LINE>if (valRef.get() == null) {<NEW_LINE>Protocol.LOG.warning(<MASK><NEW_LINE>Protocol.LOG.warning("Cannot send linked attribute update");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new Pair<>(false, valRef.get());<NEW_LINE>} | "Failed to convert value: " + fromType + " -> " + toType); |
1,152,891 | public static SuggestedEntityIdValue build(String id, String siteIRI, String label) {<NEW_LINE>String <MASK><NEW_LINE>if (DatatypeIdValue.DT_ITEM.equals(entityType)) {<NEW_LINE>return new SuggestedItemIdValue(id, siteIRI, label);<NEW_LINE>} else if (DatatypeIdValue.DT_PROPERTY.equals(entityType)) {<NEW_LINE>return new SuggestedPropertyIdValue(id, siteIRI, label);<NEW_LINE>} else if (DatatypeIdValue.DT_MEDIA_INFO.equals(entityType)) {<NEW_LINE>return new SuggestedMediaInfoIdValue(id, siteIRI, label);<NEW_LINE>} else if (DatatypeIdValue.DT_LEXEME.equals(entityType)) {<NEW_LINE>return new SuggestedLexemeIdValue(id, siteIRI, label);<NEW_LINE>} else if (DatatypeIdValue.DT_FORM.equals(entityType)) {<NEW_LINE>return new SuggestedFormIdValue(id, siteIRI, label);<NEW_LINE>} else if (DatatypeIdValue.DT_SENSE.equals(entityType)) {<NEW_LINE>return new SuggestedSenseIdValue(id, siteIRI, label);<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException(String.format("Unsupported datatype for suggested entity values: %s", entityType));<NEW_LINE>}<NEW_LINE>} | entityType = EntityIdValueImpl.guessEntityTypeFromId(id); |
1,554,110 | public boolean matches() throws Exception {<NEW_LINE>Pattern p = Pattern.compile("\\s*_?\\s*(<|>|<=|>=)\\s*([-+]?[\\d]*\\.?[\\d]+)");<NEW_LINE>Matcher m = p.matcher(expression);<NEW_LINE>if (m.matches()) {<NEW_LINE>String op = m.group(1);<NEW_LINE>String <MASK><NEW_LINE>double operand = Double.parseDouble(operandString);<NEW_LINE>double n = ((Number) parameter).doubleValue();<NEW_LINE>if (op.equals("<"))<NEW_LINE>return (n < operand);<NEW_LINE>if (op.equals(">"))<NEW_LINE>return (n > operand);<NEW_LINE>if (op.equals("<="))<NEW_LINE>return (n <= operand);<NEW_LINE>if (op.equals(">="))<NEW_LINE>return (n >= operand);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>p = Pattern.compile("\\s*([-+]?[\\d]*\\.?[\\d]+)\\s*(<|>|<=|>=)\\s*_\\s*(<|>|<=|>=)\\s*([-+]?[\\d]*\\.?[\\d]+)");<NEW_LINE>m = p.matcher(expression);<NEW_LINE>if (m.matches()) {<NEW_LINE>double a = Double.parseDouble(m.group(1));<NEW_LINE>String aop = m.group(2);<NEW_LINE>String bop = m.group(3);<NEW_LINE>double b = Double.parseDouble(m.group(4));<NEW_LINE>double n = ((Number) parameter).doubleValue();<NEW_LINE>boolean an = false;<NEW_LINE>if (aop.equals("<"))<NEW_LINE>an = a < n;<NEW_LINE>if (aop.equals("<="))<NEW_LINE>an = a <= n;<NEW_LINE>if (aop.equals(">"))<NEW_LINE>an = a > n;<NEW_LINE>if (aop.equals(">="))<NEW_LINE>an = a >= n;<NEW_LINE>boolean nb = false;<NEW_LINE>if (bop.equals("<"))<NEW_LINE>nb = n < b;<NEW_LINE>if (bop.equals("<="))<NEW_LINE>nb = n <= b;<NEW_LINE>if (bop.equals(">"))<NEW_LINE>nb = n > b;<NEW_LINE>if (bop.equals(">="))<NEW_LINE>nb = n >= b;<NEW_LINE>return an && nb;<NEW_LINE>}<NEW_LINE>throw new FitMatcherException("Invalid FitMatcher Expression");<NEW_LINE>} | operandString = m.group(2); |
324,365 | @Path("backfill-memberships/{cursor_start}/{max_rows}")<NEW_LINE>@POST<NEW_LINE>@Consumes(APPLICATION_JSON)<NEW_LINE>@Produces(APPLICATION_JSON)<NEW_LINE>public void backfillMembershipsRowHmac(@PathParam("cursor_start") Long cursorStart, @PathParam("max_rows") Long maxRows) {<NEW_LINE>logger.info("backfill-memberships: processing memberships");<NEW_LINE>long cursor;<NEW_LINE>if (cursorStart != 0) {<NEW_LINE>cursor = cursorStart;<NEW_LINE>} else {<NEW_LINE>cursor = jooq.select(min(MEMBERSHIPS.ID)).from(MEMBERSHIPS).fetch().get(<MASK><NEW_LINE>}<NEW_LINE>long processedRows = 0;<NEW_LINE>while (processedRows < maxRows) {<NEW_LINE>Result<MembershipsRecord> rows = jooq.selectFrom(MEMBERSHIPS).where(MEMBERSHIPS.ID.greaterThan(cursor)).orderBy(MEMBERSHIPS.ID).limit(1000).fetchInto(MEMBERSHIPS);<NEW_LINE>if (rows.isEmpty()) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>for (var row : rows) {<NEW_LINE>cursor = row.getId();<NEW_LINE>String rowHmac = rowHmacGenerator.computeRowHmac(MEMBERSHIPS.getName(), List.of(row.getClientid(), row.getGroupid()));<NEW_LINE>jooq.update(MEMBERSHIPS).set(MEMBERSHIPS.ROW_HMAC, rowHmac).where(MEMBERSHIPS.ID.eq(row.getId())).execute();<NEW_LINE>processedRows += 1;<NEW_LINE>}<NEW_LINE>logger.info("backfill-memberships: updating from {} with {} rows processed", cursor, processedRows);<NEW_LINE>}<NEW_LINE>} | 0).value1() - 1; |
1,604,151 | public StaticColumn unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>StaticColumn staticColumn = new StaticColumn();<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("name", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>staticColumn.setName(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 staticColumn;<NEW_LINE>} | class).unmarshall(context)); |
620,509 | private static String updateSignature(String originalSignature, String annotatedSignature, int updatePosition, MergeStrategy mergeStrategy) {<NEW_LINE>StringBuffer buf = new StringBuffer();<NEW_LINE>String signatureToReplace;<NEW_LINE>String postfix = null;<NEW_LINE>if (updatePosition <= POSITION_TYPE_PARAMETER) {<NEW_LINE>// '<' [Annot] Identifier ClassBound {InterfaceBound} ... '>'<NEW_LINE>// $NON-NLS-1$<NEW_LINE>assert originalSignature.charAt(0) == '<' : "generic signature must start with '<'";<NEW_LINE>// may already contain annotations<NEW_LINE>SignatureWrapper wrapper = new SignatureWrapper(originalSignature.toCharArray(), true, true);<NEW_LINE>// skip '<'<NEW_LINE>wrapper.start = 1;<NEW_LINE>// skip preceding type parameters:<NEW_LINE>for (int i = 0; i < (-updatePosition + POSITION_TYPE_PARAMETER); i++) {<NEW_LINE>wrapper.skipTypeParameter();<NEW_LINE>}<NEW_LINE>int start = wrapper.start;<NEW_LINE>// copy entire prefix:<NEW_LINE>buf.append(originalSignature, 0, start);<NEW_LINE>// process selected type parameter:<NEW_LINE>int end = wrapper.skipTypeParameter();<NEW_LINE>signatureToReplace = originalSignature.substring(start, end);<NEW_LINE>updateTypeParameter(buf, signatureToReplace.toCharArray(), annotatedSignature.toCharArray(), mergeStrategy);<NEW_LINE>// extract postfix:<NEW_LINE>postfix = originalSignature.substring(end, originalSignature.length());<NEW_LINE>} else {<NEW_LINE>switch(updatePosition) {<NEW_LINE>case POSITION_FULL_SIGNATURE:<NEW_LINE>signatureToReplace = originalSignature;<NEW_LINE>break;<NEW_LINE>case POSITION_RETURN_TYPE:<NEW_LINE>// $NON-NLS-1$<NEW_LINE>assert originalSignature.charAt(0) == '(' || originalSignature.charAt(0) == '<' : "signature must start with '(' or '<'";<NEW_LINE>int close = originalSignature.indexOf(')');<NEW_LINE>buf.append(originalSignature, 0, close + 1);<NEW_LINE>signatureToReplace = originalSignature.substring(close + 1);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>// parameter<NEW_LINE>// may already contain annotations<NEW_LINE>SignatureWrapper wrapper = new SignatureWrapper(originalSignature.toCharArray(), true, true);<NEW_LINE>// possibly skipping type parameters<NEW_LINE>wrapper.start = CharOperation.indexOf('(', wrapper.signature) + 1;<NEW_LINE>for (int i = 0; i < updatePosition; i++) wrapper.start = wrapper.skipAngleContents(<MASK><NEW_LINE>int start = wrapper.start;<NEW_LINE>int end = wrapper.skipAngleContents(wrapper.computeEnd());<NEW_LINE>buf.append(originalSignature, 0, start);<NEW_LINE>signatureToReplace = originalSignature.substring(start, end + 1);<NEW_LINE>postfix = originalSignature.substring(end + 1, originalSignature.length());<NEW_LINE>}<NEW_LINE>updateType(buf, signatureToReplace.toCharArray(), annotatedSignature.toCharArray(), mergeStrategy);<NEW_LINE>}<NEW_LINE>if (postfix != null)<NEW_LINE>buf.append(postfix);<NEW_LINE>return buf.toString();<NEW_LINE>} | wrapper.computeEnd()) + 1; |
1,507,473 | private String parseDN(String subject, String dNAttributeName) {<NEW_LINE>String temp = subject;<NEW_LINE>int begin = temp.toLowerCase().indexOf(dNAttributeName.toLowerCase() + "=");<NEW_LINE>if (begin == -1) {<NEW_LINE>return "";<NEW_LINE>}<NEW_LINE>temp = temp.substring(begin + dNAttributeName.length());<NEW_LINE>int end = temp.indexOf(',');<NEW_LINE>if (end == -1) {<NEW_LINE>end = temp.length();<NEW_LINE>}<NEW_LINE>while (temp.charAt(end - 1) == '\\') {<NEW_LINE>end = temp.indexOf(',', end + 1);<NEW_LINE>if (end == -1) {<NEW_LINE>end = temp.length();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>temp = temp.substring(0, end);<NEW_LINE>begin = temp.indexOf('=');<NEW_LINE>temp = temp.substring(begin + 1);<NEW_LINE>if (temp.charAt(0) == ' ') {<NEW_LINE>temp = temp.substring(1);<NEW_LINE>}<NEW_LINE>if (temp.startsWith("\"")) {<NEW_LINE>temp = temp.substring(1);<NEW_LINE>}<NEW_LINE>if (temp.endsWith("\"")) {<NEW_LINE>temp = temp.substring(0, <MASK><NEW_LINE>}<NEW_LINE>return temp;<NEW_LINE>} | temp.length() - 1); |
447,664 | private void showAlertDialog(final PreviewVideoError previewVideoError) {<NEW_LINE>new AlertDialog.Builder(requireActivity()).setMessage(previewVideoError.getErrorMessage()).setPositiveButton(android.R.string.VideoView_error_button, (dialog, whichButton) -> {<NEW_LINE>if (previewVideoError.isFileSyncNeeded() && mContainerActivity != null) {<NEW_LINE>// Initialize the file download<NEW_LINE>mContainerActivity.getFileOperationsHelper(<MASK><NEW_LINE>}<NEW_LINE>// This solution is not the best one but is an easy way to handle<NEW_LINE>// expiration error from here, without modifying so much code<NEW_LINE>// or involving other parts<NEW_LINE>if (previewVideoError.isParentFolderSyncNeeded()) {<NEW_LINE>// Start to sync the parent file folder<NEW_LINE>OCFile folder = new OCFile(getFile().getParentRemotePath());<NEW_LINE>((FileDisplayActivity) requireActivity()).startSyncFolderOperation(folder, false);<NEW_LINE>}<NEW_LINE>}).setCancelable(false).show();<NEW_LINE>} | ).syncFile(getFile()); |
1,273,449 | private void pollingConsumer(MessageChannel channel) {<NEW_LINE>PollingConsumer pollingConsumer = new PollingConsumer((PollableChannel) channel, this.handler);<NEW_LINE>if (this.pollerMetadata == null) {<NEW_LINE>this.pollerMetadata = PollerMetadata.getDefaultPollerMetadata(this.beanFactory);<NEW_LINE>Assert.notNull(this.pollerMetadata, () -> "No poller has been defined for endpoint '" + this.beanName + "', and no default poller is available within the context.");<NEW_LINE>}<NEW_LINE>pollingConsumer.setTaskExecutor(this.pollerMetadata.getTaskExecutor());<NEW_LINE>pollingConsumer.setTrigger(this.pollerMetadata.getTrigger());<NEW_LINE>pollingConsumer.setAdviceChain(this.pollerMetadata.getAdviceChain());<NEW_LINE>pollingConsumer.setMaxMessagesPerPoll(<MASK><NEW_LINE>pollingConsumer.setErrorHandler(this.pollerMetadata.getErrorHandler());<NEW_LINE>pollingConsumer.setReceiveTimeout(this.pollerMetadata.getReceiveTimeout());<NEW_LINE>pollingConsumer.setTransactionSynchronizationFactory(this.pollerMetadata.getTransactionSynchronizationFactory());<NEW_LINE>pollingConsumer.setBeanClassLoader(this.beanClassLoader);<NEW_LINE>pollingConsumer.setBeanFactory(this.beanFactory);<NEW_LINE>this.endpoint = pollingConsumer;<NEW_LINE>} | this.pollerMetadata.getMaxMessagesPerPoll()); |
1,510,453 | public void run(RegressionEnvironment env) {<NEW_LINE>String epl = "@name('create') create window MyWindow#keepall as SupportEventWithManyArray;\n" + "insert into MyWindow select * from SupportEventWithManyArray;\n" + "on SupportEventWithIntArray as sewia " + "update MyWindow as mw set value = sewia.value " + "where mw.id = sewia.id and mw.intOne = sewia.array;\n";<NEW_LINE>env.compileDeploy(epl);<NEW_LINE>env.sendEventBean(new SupportEventWithManyArray("ID1").withIntOne(new int[] { 1, 2 }));<NEW_LINE>env.sendEventBean(new SupportEventWithManyArray("ID2").withIntOne(new int[] { 3, 4 }));<NEW_LINE>env.sendEventBean(new SupportEventWithManyArray("ID3").withIntOne(new int[] { 1 }));<NEW_LINE>env.milestone(0);<NEW_LINE>env.sendEventBean(new SupportEventWithIntArray("ID2", new int[] { 3, 4 }, 10));<NEW_LINE>env.sendEventBean(new SupportEventWithIntArray("ID3", new int[] { 1 }, 11));<NEW_LINE>env.sendEventBean(new SupportEventWithIntArray("ID1", new int[] { 1, 2 }, 12));<NEW_LINE>env.sendEventBean(new SupportEventWithIntArray("IDX", new int[] { 1 }, 14));<NEW_LINE>env.sendEventBean(new SupportEventWithIntArray("ID1", new int[] { 1, 2, 3 }, 15));<NEW_LINE>env.assertPropsPerRowIteratorAnyOrder("create", "id,value".split(","), new Object[][] { { "ID1", 12 }, { "ID2", 10 }<MASK><NEW_LINE>env.undeployAll();<NEW_LINE>} | , { "ID3", 11 } }); |
1,689,214 | public ScheduledWindowExecution unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ScheduledWindowExecution scheduledWindowExecution = new ScheduledWindowExecution();<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("WindowId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>scheduledWindowExecution.setWindowId(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("Name", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>scheduledWindowExecution.setName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("ExecutionTime", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>scheduledWindowExecution.setExecutionTime(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 scheduledWindowExecution;<NEW_LINE>} | class).unmarshall(context)); |
1,415,422 | public void onRun() throws IOException {<NEW_LINE>if (!SignalStore.account().isRegistered()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int count = 0;<NEW_LINE>List<ReportSpamData> reportSpamData = SignalDatabase.mmsSms().getReportSpamMessageServerData(threadId, timestamp, MAX_MESSAGE_COUNT);<NEW_LINE>SignalServiceAccountManager signalServiceAccountManager = ApplicationDependencies.getSignalServiceAccountManager();<NEW_LINE>for (ReportSpamData data : reportSpamData) {<NEW_LINE>Optional<String> e164 = Recipient.resolved(data.getRecipientId()).getE164();<NEW_LINE>if (e164.isPresent()) {<NEW_LINE>signalServiceAccountManager.reportSpam(e164.get(), data.getServerGuid());<NEW_LINE>count++;<NEW_LINE>} else {<NEW_LINE>Log.w(TAG, "Unable to report spam without an e164 for " + data.getRecipientId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Log.i(TAG, "Reported " + count + " out of " + reportSpamData.size(<MASK><NEW_LINE>} | ) + " messages in thread " + threadId + " as spam"); |
472,490 | public IHarvestResult harvestBlock(@Nonnull final IFarmer farm, @Nonnull final BlockPos pos, @Nonnull IBlockState state) {<NEW_LINE>boolean hasHoe = farm.hasTool(FarmingTool.HOE);<NEW_LINE>if (!hasHoe || !farm.checkAction(FarmingAction.HARVEST, FarmingTool.HOE)) {<NEW_LINE>return new HarvestResult();<NEW_LINE>}<NEW_LINE>final World world = farm.getWorld();<NEW_LINE>final EntityPlayerMP joe = farm.startUsingItem(FarmingTool.HOE);<NEW_LINE>final int fortune = <MASK><NEW_LINE>final IHarvestResult result = new HarvestResult();<NEW_LINE>BlockPos harvestCoord = pos;<NEW_LINE>boolean done = false;<NEW_LINE>do {<NEW_LINE>harvestCoord = harvestCoord.offset(EnumFacing.UP);<NEW_LINE>final IBlockState harvestState = farm.getBlockState(harvestCoord);<NEW_LINE>if (hasHoe && plantedBlock == harvestState.getBlock()) {<NEW_LINE>result.getHarvestedBlocks().add(harvestCoord);<NEW_LINE>NNList<ItemStack> drops = new NNList<>();<NEW_LINE>plantedBlock.getDrops(drops, world, harvestCoord, state, fortune);<NEW_LINE>float chance = ForgeEventFactory.fireBlockHarvesting(drops, joe.world, harvestCoord, state, fortune, 1.0F, false, joe);<NEW_LINE>for (ItemStack drop : drops) {<NEW_LINE>if (world.rand.nextFloat() <= chance) {<NEW_LINE>result.addDrop(pos, drop.copy());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>farm.registerAction(FarmingAction.HARVEST, FarmingTool.HOE, harvestState, harvestCoord);<NEW_LINE>hasHoe = farm.hasTool(FarmingTool.HOE);<NEW_LINE>} else {<NEW_LINE>if (!hasHoe) {<NEW_LINE>farm.setNotification(FarmNotification.NO_HOE);<NEW_LINE>}<NEW_LINE>done = true;<NEW_LINE>}<NEW_LINE>} while (!done);<NEW_LINE>NNList.wrap(farm.endUsingItem(FarmingTool.HOE)).apply(new Callback<ItemStack>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void apply(@Nonnull ItemStack drop) {<NEW_LINE>result.addDrop(pos, drop.copy());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>NNList<BlockPos> toClear = new NNList<BlockPos>(result.getHarvestedBlocks());<NEW_LINE>Collections.sort(toClear, COMP);<NEW_LINE>toClear.apply(new Callback<BlockPos>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void apply(@Nonnull BlockPos coord) {<NEW_LINE>farm.getWorld().setBlockToAir(coord);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return result;<NEW_LINE>} | farm.getLootingValue(FarmingTool.HOE); |
217,208 | public synchronized IndexLocation computeIndexLocation(IPath containerPath, final URL newIndexURL) {<NEW_LINE>IndexLocation indexLocation = (IndexLocation) this.indexLocations.get(containerPath);<NEW_LINE>if (indexLocation == null) {<NEW_LINE>if (newIndexURL != null) {<NEW_LINE>indexLocation = IndexLocation.createIndexLocation(newIndexURL);<NEW_LINE>// update caches<NEW_LINE>indexLocation = (IndexLocation) <MASK><NEW_LINE>this.indexLocations.put(containerPath, indexLocation);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// an existing index location exists - make sure it has not changed (i.e. the URL has not changed)<NEW_LINE>URL existingURL = indexLocation.getUrl();<NEW_LINE>if (newIndexURL != null) {<NEW_LINE>// if either URL is different then the index location has been updated so rebuild.<NEW_LINE>if (!newIndexURL.equals(existingURL)) {<NEW_LINE>// URL has changed so remove the old index and create a new one<NEW_LINE>this.removeIndex(containerPath);<NEW_LINE>// create a new one<NEW_LINE>indexLocation = IndexLocation.createIndexLocation(newIndexURL);<NEW_LINE>// update caches<NEW_LINE>indexLocation = (IndexLocation) getIndexStates().getKey(indexLocation);<NEW_LINE>this.indexLocations.put(containerPath, indexLocation);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return indexLocation;<NEW_LINE>} | getIndexStates().getKey(indexLocation); |
370,398 | public void run() {<NEW_LINE>while (running) {<NEW_LINE>Set<Integer> serverSet = ServerManager.getInstance().getOpenServerList();<NEW_LINE>for (final int serverId : serverSet) {<NEW_LINE>TcpProxy tcp = TcpProxy.getTcpProxy(serverId);<NEW_LINE>try {<NEW_LINE>MapPack param = paramMap.get(serverId);<NEW_LINE>if (param == null) {<NEW_LINE>param = new MapPack();<NEW_LINE>paramMap.put(serverId, param);<NEW_LINE>param.put("first", new BooleanValue(true));<NEW_LINE>}<NEW_LINE>tcp.process(RequestCmd.ALERT_REAL_TIME, param, new INetReader() {<NEW_LINE><NEW_LINE>public void process(DataInputX in) throws IOException {<NEW_LINE>Pack packet = in.readPack();<NEW_LINE>if (packet instanceof MapPack) {<NEW_LINE>MapPack param = (MapPack) packet;<NEW_LINE>paramMap.put(serverId, param);<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>for (IAlertListener listener : listeners) {<NEW_LINE>listener.ariseAlert(serverId, alert);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (Throwable th) {<NEW_LINE>ConsoleProxy.errorSafe("AlertProxyThread : " + th.toString());<NEW_LINE>} finally {<NEW_LINE>TcpProxy.putTcpProxy(tcp);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ThreadUtil.sleep(2000);<NEW_LINE>}<NEW_LINE>} | final AlertPack alert = (AlertPack) packet; |
857,797 | protected void freeEntryCheckGeneric(GCHeapLinkedFreeHeader freeListEntry) throws CorruptDataException, CorruptFreeEntryException {<NEW_LINE>MM_HeapLinkedFreeHeaderPointer freeListEntryAddress = freeListEntry.getHeader();<NEW_LINE>UDATA size = freeListEntry.getSize();<NEW_LINE>GCHeapRegionDescriptor region = getRegion();<NEW_LINE>U8Pointer entryEndingAddressInclusive = U8Pointer.cast(freeListEntry.getHeader()).add(size.sub(1));<NEW_LINE>if (freeListEntry.getHeader().isNull()) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (!region.isAddressInRegion(VoidPointer.cast(freeListEntryAddress))) {<NEW_LINE>throw new CorruptFreeEntryException("freeEntryCorrupt", freeListEntryAddress);<NEW_LINE>}<NEW_LINE>if (!region.isAddressInRegion(VoidPointer.cast(entryEndingAddressInclusive))) {<NEW_LINE>throw new CorruptFreeEntryException("sizeFieldInvalid", freeListEntryAddress);<NEW_LINE>}<NEW_LINE>} | throw new CorruptFreeEntryException("freeEntryCorrupt", freeListEntryAddress); |
720,098 | private String generateCurlCommand(String url, CurlLoggedRequestParameters requestParameters) {<NEW_LINE>StringBuilder builder = new StringBuilder("curl ");<NEW_LINE>// HTTP method<NEW_LINE>builder.append("-X ").append(requestParameters.getHttpMethod()).append(" ");<NEW_LINE>// Request headers<NEW_LINE>for (Map.Entry<String, String> header : requestParameters.getHeaders().entrySet()) {<NEW_LINE>builder.append("--header \"").append(header.getKey()).append(": ");<NEW_LINE>if (!mLogAuthTokensInCurlCommands && ("Authorization".equals(header.getKey()) || "Cookie".equals(header.getKey()))) {<NEW_LINE>builder.append("[REDACTED]");<NEW_LINE>} else {<NEW_LINE>builder.<MASK><NEW_LINE>}<NEW_LINE>builder.append("\" ");<NEW_LINE>}<NEW_LINE>// URL<NEW_LINE>builder.append("\"").append(url).append("\"");<NEW_LINE>// Request body (if any)<NEW_LINE>if (requestParameters.getBody() != null) {<NEW_LINE>if (requestParameters.getBody().length >= 1024) {<NEW_LINE>builder.append(" [REQUEST BODY TOO LARGE TO INCLUDE]");<NEW_LINE>} else if (isBinaryContentForLogging(requestParameters)) {<NEW_LINE>String base64 = Base64.encodeToString(requestParameters.getBody(), Base64.NO_WRAP);<NEW_LINE>builder.insert(0, "echo '" + base64 + "' | base64 -d > /tmp/$$.bin; ").append(" --data-binary @/tmp/$$.bin");<NEW_LINE>} else {<NEW_LINE>// Just assume the request body is UTF-8 since this is for debugging.<NEW_LINE>try {<NEW_LINE>builder.append(" --data-ascii \"").append(new String(requestParameters.getBody(), "UTF-8")).append("\"");<NEW_LINE>} catch (UnsupportedEncodingException e) {<NEW_LINE>throw new RuntimeException("Could not encode to UTF-8", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return builder.toString();<NEW_LINE>} | append(header.getValue()); |
1,484,379 | public void defineStream(StreamDefinition streamDefinition) {<NEW_LINE>DefinitionParserHelper.validateDefinition(streamDefinition, streamDefinitionMap, tableDefinitionMap, windowDefinitionMap, aggregationDefinitionMap);<NEW_LINE>AbstractDefinition currentDefinition = streamDefinitionMap.putIfAbsent(streamDefinition.getId(), streamDefinition);<NEW_LINE>if (currentDefinition != null) {<NEW_LINE>streamDefinition = (StreamDefinition) currentDefinition;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>DefinitionParserHelper.addStreamJunction(streamDefinition, streamJunctionMap, siddhiAppContext);<NEW_LINE>} catch (Throwable t) {<NEW_LINE>ExceptionUtil.populateQueryContext(t, streamDefinition, siddhiAppContext);<NEW_LINE>throw t;<NEW_LINE>}<NEW_LINE>DefinitionParserHelper.<MASK><NEW_LINE>StreamJunction streamJunction = streamJunctionMap.get(streamDefinition.getId());<NEW_LINE>DefinitionParserHelper.addEventSink(streamDefinition, streamJunction, sinkMap, siddhiAppContext);<NEW_LINE>} | addEventSource(streamDefinition, sourceMap, siddhiAppContext); |
1,385,171 | public String format(ValidationEvent event) {<NEW_LINE>StringWriter writer = new StringWriter();<NEW_LINE>Formatter formatter = new Formatter(writer);<NEW_LINE>formatter.format("%s: %s (%s)%n", event.getSeverity(), event.getShapeId().map(ShapeId::toString).orElse("-"), event.getId());<NEW_LINE>if (event.getSourceLocation() != SourceLocation.NONE) {<NEW_LINE>String humanReadableFilename = <MASK><NEW_LINE>String contextualLine = null;<NEW_LINE>try {<NEW_LINE>contextualLine = loadContextualLine(event.getSourceLocation());<NEW_LINE>} catch (IOException e) {<NEW_LINE>// Do nothing.<NEW_LINE>}<NEW_LINE>if (contextualLine == null) {<NEW_LINE>formatter.format(" @ %s%n", event.getSourceLocation());<NEW_LINE>} else {<NEW_LINE>// Show the filename.<NEW_LINE>formatter.format(" @ %s%n", humanReadableFilename);<NEW_LINE>formatter.format(" |%n");<NEW_LINE>// Show the line number and source code line.<NEW_LINE>formatter.format("%4d | %s%n", event.getSourceLocation().getLine(), contextualLine);<NEW_LINE>// Add a carat to point to the column of the error.<NEW_LINE>formatter.format(" | %" + event.getSourceLocation().getColumn() + "s%n", "^");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Add the message and indent each line.<NEW_LINE>formatter.format(" = %s%n", event.getMessage().replace("\n", " \n"));<NEW_LINE>// Close up the formatter.<NEW_LINE>formatter.flush();<NEW_LINE>return writer.toString();<NEW_LINE>} | getHumanReadableFilename(event.getSourceLocation()); |
480,120 | public void run(RegressionEnvironment env) {<NEW_LINE>EPCompiled base = env.compile("@name('basevar') @public create constant variable int basevar = 1");<NEW_LINE>EPCompiled child0 = env.compile("@name('s0') select basevar from SupportBean", new RegressionPath<MASK><NEW_LINE>EPCompiled child1 = env.compile("@name('child1var') @public create constant variable int child1var = 2;\n" + "@name('s1') select basevar, child1var from SupportBean;\n", new RegressionPath().add(base));<NEW_LINE>EPCompiled child11 = env.compile("@name('s2') select basevar, child1var from SupportBean;\n", new RegressionPath().add(base).add(child1));<NEW_LINE>env.rollout(Arrays.asList(toRolloutItems(base, child0, child1, child11)), null);<NEW_LINE>env.addListener("s0").addListener("s1").addListener("s2");<NEW_LINE>sendAssert(env, "s1,s2");<NEW_LINE>env.milestone(0);<NEW_LINE>sendAssert(env, "s1,s2");<NEW_LINE>assertStatementIds(env, "basevar,s0,child1var,s1,s2", 1, 2, 3, 4, 5);<NEW_LINE>EPDeploymentRolloutCompiled item = new EPDeploymentRolloutCompiled(env.compile("@name('s3') select basevar, child1var from SupportBean", new RegressionPath().add(base).add(child1)), null);<NEW_LINE>env.rollout(Collections.singletonList(item), null).addListener("s3");<NEW_LINE>EPDeployment deploymentChild11 = env.deployment().getDeployment(env.deploymentId("s2"));<NEW_LINE>EPAssertionUtil.assertEqualsAnyOrder(new String[] { env.deploymentId("basevar"), env.deploymentId("child1var") }, deploymentChild11.getDeploymentIdDependencies());<NEW_LINE>env.milestone(1);<NEW_LINE>sendAssert(env, "s1,s2,s3");<NEW_LINE>assertStatementIds(env, "basevar,s0,child1var,s1,s2,s3", 1, 2, 3, 4, 5, 6);<NEW_LINE>env.undeployAll();<NEW_LINE>env.milestone(2);<NEW_LINE>env.compileDeploy("@name('s1') select * from SupportBean");<NEW_LINE>tryInvalidRollout(env, "A precondition is not satisfied: Required dependency variable 'basevar' cannot be found", 0, EPDeployPreconditionException.class, child0);<NEW_LINE>assertStatementIds(env, "s1", 7);<NEW_LINE>env.undeployAll();<NEW_LINE>} | ().add(base)); |
1,305,277 | public PartitionGroup[] coalesce(int maxPartitions, RDD<?> parent) {<NEW_LINE>if (maxPartitions != parent.getNumPartitions()) {<NEW_LINE>throw new IllegalArgumentException("Cannot use " + getClass().getSimpleName() + " with a different number of partitions to the parent RDD.");<NEW_LINE>}<NEW_LINE>List<Partition> partitions = Arrays.asList(parent.getPartitions());<NEW_LINE>PartitionGroup[] groups = new PartitionGroup[partitions.size()];<NEW_LINE>for (int i = 0; i < partitions.size(); i++) {<NEW_LINE>Seq<String> preferredLocations = parent.getPreferredLocations<MASK><NEW_LINE>scala.Option<String> preferredLocation = scala.Option.apply(preferredLocations.isEmpty() ? null : preferredLocations.apply(0));<NEW_LINE>PartitionGroup group = new PartitionGroup(preferredLocation);<NEW_LINE>List<Partition> partitionsInGroup = partitions.subList(i, maxEndPartitionIndexes.get(i) + 1);<NEW_LINE>group.partitions().append(JavaConversions.asScalaBuffer(partitionsInGroup));<NEW_LINE>groups[i] = group;<NEW_LINE>}<NEW_LINE>return groups;<NEW_LINE>} | (partitions.get(i)); |
109,648 | final GetGroupResult executeGetGroup(GetGroupRequest getGroupRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getGroupRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetGroupRequest> request = null;<NEW_LINE>Response<GetGroupResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetGroupRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getGroupRequest));<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, "Cognito Identity Provider");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetGroup");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetGroupResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetGroupResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | endClientExecution(awsRequestMetrics, request, response); |
222,869 | private static void addDependenciesToMap(String referrer, InputStream data, Map<String, Set<String>> depsMap, Set<String> siblings, File jar) throws IOException {<NEW_LINE>int shell = referrer.indexOf('$', referrer<MASK><NEW_LINE>String referrerTopLevel = shell == -1 ? referrer : referrer.substring(0, shell);<NEW_LINE>for (String referee : dependencies(data, jar)) {<NEW_LINE>if (referrer.equals(referee)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (siblings.contains(referee)) {<NEW_LINE>// in same JAR, not interesting<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (JDK_CLASS_TEST.test(referee)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Set<String> referees = depsMap.get(referrerTopLevel);<NEW_LINE>if (referees == null) {<NEW_LINE>referees = new HashSet<>();<NEW_LINE>depsMap.put(referrerTopLevel, referees);<NEW_LINE>}<NEW_LINE>referees.add(referee);<NEW_LINE>}<NEW_LINE>} | .lastIndexOf('/') + 1); |
1,176,233 | public void handleFollowReturnsPastSeeds(Abstraction d1, Unit u, Abstraction d2) {<NEW_LINE>SootMethod sm = manager.getICFG().getMethodOf(u);<NEW_LINE>Set<AccessPathPropagator> <MASK><NEW_LINE>if (propagators != null) {<NEW_LINE>for (AccessPathPropagator propagator : propagators) {<NEW_LINE>// Propagate these taints up. We leave the current gap<NEW_LINE>AccessPathPropagator parent = safePopParent(propagator);<NEW_LINE>GapDefinition parentGap = propagator.getParent() == null ? null : propagator.getParent().getGap();<NEW_LINE>// Create taints from the abstractions<NEW_LINE>Set<Taint> returnTaints = createTaintFromAccessPathOnReturn(d2.getAccessPath(), (Stmt) u, propagator.getGap());<NEW_LINE>if (returnTaints == null)<NEW_LINE>continue;<NEW_LINE>// Get the correct set of flows to apply<NEW_LINE>MethodSummaries flowsInTarget = parentGap == null ? getFlowsInOriginalCallee(propagator) : getFlowSummariesForGap(parentGap);<NEW_LINE>// Create the new propagator, one for every taint<NEW_LINE>Set<AccessPathPropagator> workSet = new HashSet<>();<NEW_LINE>for (Taint returnTaint : returnTaints) {<NEW_LINE>AccessPathPropagator newPropagator = new AccessPathPropagator(returnTaint, parentGap, parent, propagator.getParent() == null ? null : propagator.getParent().getStmt(), propagator.getParent() == null ? null : propagator.getParent().getD1(), propagator.getParent() == null ? null : propagator.getParent().getD2());<NEW_LINE>workSet.add(newPropagator);<NEW_LINE>}<NEW_LINE>// Apply the aggregated propagators<NEW_LINE>Set<AccessPath> resultAPs = applyFlowsIterative(flowsInTarget, new ArrayList<>(workSet));<NEW_LINE>// Propagate the access paths<NEW_LINE>if (resultAPs != null && !resultAPs.isEmpty()) {<NEW_LINE>AccessPathPropagator rootPropagator = getOriginalCallSite(propagator);<NEW_LINE>for (AccessPath ap : resultAPs) {<NEW_LINE>Abstraction newAbs = rootPropagator.getD2().deriveNewAbstraction(ap, rootPropagator.getStmt());<NEW_LINE>for (Unit succUnit : manager.getICFG().getSuccsOf(rootPropagator.getStmt())) manager.getForwardSolver().processEdge(new PathEdge<Unit, Abstraction>(rootPropagator.getD1(), succUnit, newAbs));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | propagators = getUserCodeTaints(d1, sm); |
922,352 | public void marshall(Integration integration, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (integration == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(integration.getType(), TYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(integration.getHttpMethod(), HTTPMETHOD_BINDING);<NEW_LINE>protocolMarshaller.marshall(integration.getUri(), URI_BINDING);<NEW_LINE>protocolMarshaller.marshall(integration.getConnectionType(), CONNECTIONTYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(integration.getConnectionId(), CONNECTIONID_BINDING);<NEW_LINE>protocolMarshaller.marshall(integration.getCredentials(), CREDENTIALS_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(integration.getRequestTemplates(), REQUESTTEMPLATES_BINDING);<NEW_LINE>protocolMarshaller.marshall(integration.getPassthroughBehavior(), PASSTHROUGHBEHAVIOR_BINDING);<NEW_LINE>protocolMarshaller.marshall(integration.getContentHandling(), CONTENTHANDLING_BINDING);<NEW_LINE>protocolMarshaller.marshall(integration.getTimeoutInMillis(), TIMEOUTINMILLIS_BINDING);<NEW_LINE>protocolMarshaller.marshall(integration.getCacheNamespace(), CACHENAMESPACE_BINDING);<NEW_LINE>protocolMarshaller.marshall(integration.getCacheKeyParameters(), CACHEKEYPARAMETERS_BINDING);<NEW_LINE>protocolMarshaller.marshall(integration.getIntegrationResponses(), INTEGRATIONRESPONSES_BINDING);<NEW_LINE>protocolMarshaller.marshall(integration.getTlsConfig(), TLSCONFIG_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | integration.getRequestParameters(), REQUESTPARAMETERS_BINDING); |
1,500,419 | public void onMerge(OnMergeContext c) throws Exception {<NEW_LINE>// NOTE that the ReduceFnRunner will delete all end-of-window timers for the<NEW_LINE>// merged-away windows.<NEW_LINE>ExecutableTriggerStateMachine earlySubtrigger = c.<MASK><NEW_LINE>// We check the early trigger to determine if we are still processing it or<NEW_LINE>// if the end of window has transitioned us to the late trigger<NEW_LINE>OnMergeContext earlyContext = c.forTrigger(earlySubtrigger);<NEW_LINE>// If the early trigger is still active in any merging window then it is still active in<NEW_LINE>// the new merged window, because even if the merged window is "done" some pending elements<NEW_LINE>// haven't had a chance to fire.<NEW_LINE>if (!earlyContext.trigger().finishedInAllMergingWindows() || !endOfWindowReached(c)) {<NEW_LINE>earlySubtrigger.invokeOnMerge(earlyContext);<NEW_LINE>earlyContext.trigger().setFinished(false);<NEW_LINE>if (lateTrigger != null) {<NEW_LINE>ExecutableTriggerStateMachine lateSubtrigger = c.trigger().subTrigger(LATE_INDEX);<NEW_LINE>OnMergeContext lateContext = c.forTrigger(lateSubtrigger);<NEW_LINE>// It is necessary to merge before clearing. Clearing with this context just clears the<NEW_LINE>// target window state not the source windows state.<NEW_LINE>lateSubtrigger.invokeOnMerge(lateContext);<NEW_LINE>lateContext.trigger().setFinished(false);<NEW_LINE>lateSubtrigger.invokeClear(lateContext);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// Otherwise the early trigger and end-of-window bit is done for good.<NEW_LINE>earlyContext.trigger().setFinished(true);<NEW_LINE>if (lateTrigger != null) {<NEW_LINE>ExecutableTriggerStateMachine lateSubtrigger = c.trigger().subTrigger(LATE_INDEX);<NEW_LINE>OnMergeContext lateContext = c.forTrigger(lateSubtrigger);<NEW_LINE>lateSubtrigger.invokeOnMerge(lateContext);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | trigger().subTrigger(EARLY_INDEX); |
1,786,018 | public static short floatToHalf(float fVal) {<NEW_LINE>int bits = Float.floatToIntBits(fVal);<NEW_LINE>int sign = bits >>> 16 & 0x8000;<NEW_LINE>int val = (bits & 0x7fffffff) + 0x1000;<NEW_LINE>if (val >= 0x47800000) {<NEW_LINE>if ((bits & 0x7fffffff) >= 0x47800000) {<NEW_LINE>if (val < 0x7f800000) {<NEW_LINE>return (short) (sign | 0x7c00);<NEW_LINE>}<NEW_LINE>return (short) (sign | 0x7c00 | (bits <MASK><NEW_LINE>}<NEW_LINE>return (short) (sign | 0x7bff);<NEW_LINE>}<NEW_LINE>if (val >= 0x38800000) {<NEW_LINE>return (short) (sign | val - 0x38000000 >>> 13);<NEW_LINE>}<NEW_LINE>if (val < 0x33000000) {<NEW_LINE>return (short) sign;<NEW_LINE>}<NEW_LINE>val = (bits & 0x7fffffff) >>> 23;<NEW_LINE>return (short) (sign | ((bits & 0x7fffff | 0x800000) + (0x800000 >>> val - 102) >>> 126 - val));<NEW_LINE>} | & 0x007fffff) >>> 13); |
272,209 | private void cleanProjects(Session session) {<NEW_LINE>LOGGER.trace("Project cleaning");<NEW_LINE>var alias = "pr";<NEW_LINE>var deleteProjectsQueryString = new StringBuilder("FROM ").append(ProjectEntity.class.getSimpleName()).append(" ").append(alias).append(" WHERE ").append(alias).append(".").append(ModelDBConstants.CREATED).append(" = :created ").append(" AND ").append(alias).append(".").append(ModelDBConstants.DATE_CREATED).append(" < :created_date ").toString();<NEW_LINE>// Time less then a minute because possible to have create project request running when cron job<NEW_LINE>// running<NEW_LINE>// 5 minute lesser time<NEW_LINE>long time = Calendar.getInstance<MASK><NEW_LINE>var projectDeleteQuery = session.createQuery(deleteProjectsQueryString);<NEW_LINE>projectDeleteQuery.setParameter("created", false);<NEW_LINE>projectDeleteQuery.setParameter("created_date", time);<NEW_LINE>projectDeleteQuery.setMaxResults(this.recordUpdateLimit);<NEW_LINE>List<ProjectEntity> projectEntities = projectDeleteQuery.list();<NEW_LINE>List<String> projectIds = new ArrayList<>();<NEW_LINE>if (!projectEntities.isEmpty()) {<NEW_LINE>for (ProjectEntity projectEntity : projectEntities) {<NEW_LINE>projectIds.add(projectEntity.getId());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>mdbRoleService.deleteEntityResourcesWithServiceUser(projectIds, ModelDBResourceEnum.ModelDBServiceResourceTypes.PROJECT);<NEW_LINE>for (ProjectEntity projectEntity : projectEntities) {<NEW_LINE>try {<NEW_LINE>var transaction = session.beginTransaction();<NEW_LINE>session.delete(projectEntity);<NEW_LINE>transaction.commit();<NEW_LINE>} catch (OptimisticLockException ex) {<NEW_LINE>LOGGER.info("CleanUpEntitiesCron : cleanProjects : Exception: {}", ex.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (OptimisticLockException ex) {<NEW_LINE>LOGGER.info("CleanUpEntitiesCron : cleanProjects : Exception: {}", ex.getMessage());<NEW_LINE>} catch (Exception ex) {<NEW_LINE>LOGGER.warn("CleanUpEntitiesCron : cleanProjects : Exception: ", ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>LOGGER.debug("Project cleaned successfully : Cleaned projects count {}", projectIds.size());<NEW_LINE>} | ().getTimeInMillis() - 300000; |
740,702 | private void findExpressionNames(Node nullCompareVariable, List<String> results) {<NEW_LINE>for (int i = 0; i < nullCompareVariable.getNumChildren(); i++) {<NEW_LINE>Node child = nullCompareVariable.getChild(i);<NEW_LINE>if (child instanceof ASTName) {<NEW_LINE>// Variable names and some method calls<NEW_LINE>results.add(((ASTName<MASK><NEW_LINE>} else if (child instanceof ASTLiteral) {<NEW_LINE>// Array arguments<NEW_LINE>String literalImage = ((ASTLiteral) child).getImage();<NEW_LINE>// Skip other null checks<NEW_LINE>if (literalImage != null) {<NEW_LINE>results.add(literalImage);<NEW_LINE>}<NEW_LINE>} else if (child instanceof ASTPrimarySuffix) {<NEW_LINE>// More method calls<NEW_LINE>String name = ((ASTPrimarySuffix) child).getImage();<NEW_LINE>if (StringUtils.isNotBlank(name)) {<NEW_LINE>results.add(name);<NEW_LINE>}<NEW_LINE>} else if (child instanceof ASTClassOrInterfaceType) {<NEW_LINE>// A class can be an argument too<NEW_LINE>String name = ((ASTClassOrInterfaceType) child).getImage();<NEW_LINE>results.add(name);<NEW_LINE>}<NEW_LINE>if (child.getNumChildren() > 0) {<NEW_LINE>findExpressionNames(child, results);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ) child).getImage()); |
1,586,815 | public List<VolumeVO> returnAttachableVolumes(VmInstanceInventory vm, List<VolumeVO> candidates) {<NEW_LINE>// find instantiated volumes<NEW_LINE>List<String> volUuids = CollectionUtils.transformToList(candidates, new Function<String, VolumeVO>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String call(VolumeVO arg) {<NEW_LINE>return VolumeStatus.Ready == arg.getStatus() ? arg.getUuid() : null;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>if (volUuids.isEmpty()) {<NEW_LINE>return candidates;<NEW_LINE>}<NEW_LINE>List<String> vmAllVolumeUuids = CollectionUtils.transformToList(vm.getAllVolumes(), VolumeInventory::getUuid);<NEW_LINE>// root volume could be located at a shared storage<NEW_LINE>String sql = "select ref.hostUuid" + " from LocalStorageResourceRefVO ref" + " where ref.resourceUuid in (:volUuids)" + " and ref.resourceType = :rtype";<NEW_LINE>TypedQuery<String> q = dbf.getEntityManager().createQuery(sql, String.class);<NEW_LINE>q.setParameter("volUuids", vmAllVolumeUuids);<NEW_LINE>q.setParameter("rtype", VolumeVO.class.getSimpleName());<NEW_LINE>List<String> ret = q.getResultList();<NEW_LINE>String hostUuid = vm.getHostUuid();<NEW_LINE>if (!ret.isEmpty()) {<NEW_LINE>hostUuid = ret.get(0);<NEW_LINE>}<NEW_LINE>sql = "select ref.resourceUuid" + " from LocalStorageResourceRefVO ref" + " where ref.resourceUuid in (:uuids)" + " and ref.resourceType = :rtype" + " and ref.hostUuid != :huuid";<NEW_LINE>q = dbf.getEntityManager().<MASK><NEW_LINE>q.setParameter("uuids", volUuids);<NEW_LINE>q.setParameter("huuid", hostUuid);<NEW_LINE>q.setParameter("rtype", VolumeVO.class.getSimpleName());<NEW_LINE>final List<String> toExclude = q.getResultList();<NEW_LINE>candidates = CollectionUtils.transformToList(candidates, new Function<VolumeVO, VolumeVO>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public VolumeVO call(VolumeVO arg) {<NEW_LINE>return toExclude.contains(arg.getUuid()) ? null : arg;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return candidates;<NEW_LINE>} | createQuery(sql, String.class); |
106,240 | protected void update() throws BuildException {<NEW_LINE>Collection<String> files = reportFilesMap.keySet();<NEW_LINE>if (files != null && files.size() > 0) {<NEW_LINE>boolean isError = false;<NEW_LINE>System.out.println("Updating " + <MASK><NEW_LINE>String srcFileName = null;<NEW_LINE>String destFileName = null;<NEW_LINE>File destFileParent = null;<NEW_LINE>for (Iterator<String> it = files.iterator(); it.hasNext(); ) {<NEW_LINE>srcFileName = it.next();<NEW_LINE>destFileName = reportFilesMap.get(srcFileName);<NEW_LINE>destFileParent = new File(destFileName).getParentFile();<NEW_LINE>if (!destFileParent.exists()) {<NEW_LINE>destFileParent.mkdirs();<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>System.out.print("File : " + srcFileName + " ... ");<NEW_LINE>JasperDesign jasperDesign = JRXmlLoader.load(srcFileName);<NEW_LINE>if (updaters != null) {<NEW_LINE>for (int i = 0; i < updaters.size(); i++) {<NEW_LINE>ReportUpdater updater = updaters.get(i).getUpdater();<NEW_LINE>if (updater != null) {<NEW_LINE>jasperDesign = updater.update(jasperDesign);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>new JRXmlWriter(jasperReportsContext).write(jasperDesign, destFileName, "UTF-8");<NEW_LINE>System.out.println("OK.");<NEW_LINE>} catch (JRException e) {<NEW_LINE>System.out.println("FAILED.");<NEW_LINE>System.out.println("Error updating report design : " + srcFileName);<NEW_LINE>e.printStackTrace(System.out);<NEW_LINE>isError = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (isError) {<NEW_LINE>throw new BuildException("Errors were encountered when updating report designs.");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | files.size() + " report design files."); |
900,902 | private void handleAJAXAction(final HttpServletRequest req, final HttpServletResponse resp, final Session session) throws ServletException, IOException {<NEW_LINE>final HashMap<String, Object> <MASK><NEW_LINE>final String ajaxName = getParam(req, "ajax");<NEW_LINE>if (API_FETCH_TRIGGER.equals(ajaxName)) {<NEW_LINE>if (checkProjectIdAndFlowId(req)) {<NEW_LINE>final int projectId = getIntParam(req, "projectId");<NEW_LINE>final String flowId = getParam(req, "flowId");<NEW_LINE>ajaxFetchTrigger(projectId, flowId, session, ret);<NEW_LINE>}<NEW_LINE>} else if (API_PAUSE_TRIGGER.equals(ajaxName) || API_RESUME_TRIGGER.equals(ajaxName)) {<NEW_LINE>if (checkProjectIdAndFlowId(req)) {<NEW_LINE>final int projectId = getIntParam(req, "projectId");<NEW_LINE>final String flowId = getParam(req, "flowId");<NEW_LINE>final Project project = this.projectManager.getProject(projectId);<NEW_LINE>if (project == null) {<NEW_LINE>ret.put("error", "please specify a valid project id");<NEW_LINE>} else if (!hasPermission(project, session.getUser(), Type.ADMIN)) {<NEW_LINE>ret.put("error", "Permission denied. Need ADMIN access.");<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>if (API_PAUSE_TRIGGER.equals(ajaxName)) {<NEW_LINE>if (this.scheduler.pauseFlowTriggerIfPresent(projectId, flowId)) {<NEW_LINE>logger.info("Flow trigger for flow {}.{} is paused", project.getName(), flowId);<NEW_LINE>} else {<NEW_LINE>logger.warn("Flow trigger for flow {}.{} doesn't exist", project.getName(), flowId);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (this.scheduler.resumeFlowTriggerIfPresent(projectId, flowId)) {<NEW_LINE>logger.info("Flow trigger for flow {}.{} is resumed", project.getName(), flowId);<NEW_LINE>} else {<NEW_LINE>logger.warn("Flow trigger for flow {}.{} doesn't exist", project.getName(), flowId);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ret.put("status", "success");<NEW_LINE>} catch (final SchedulerException ex) {<NEW_LINE>ret.put("error", ex.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (ret != null) {<NEW_LINE>this.writeJSON(resp, ret);<NEW_LINE>}<NEW_LINE>} | ret = new HashMap<>(); |
786,620 | private void loadNode42() {<NEW_LINE>DataTypeEncodingTypeNode node = new DataTypeEncodingTypeNode(this.context, Identifiers.AddNodesItem_Encoding_DefaultBinary, new QualifiedName(0, "Default Binary"), new LocalizedText("en", "Default Binary"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), UByte.valueOf(0));<NEW_LINE>node.addReference(new Reference(Identifiers.AddNodesItem_Encoding_DefaultBinary, Identifiers.HasEncoding, Identifiers.AddNodesItem<MASK><NEW_LINE>node.addReference(new Reference(Identifiers.AddNodesItem_Encoding_DefaultBinary, Identifiers.HasDescription, Identifiers.OpcUa_BinarySchema_AddNodesItem.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.AddNodesItem_Encoding_DefaultBinary, Identifiers.HasTypeDefinition, Identifiers.DataTypeEncodingType.expanded(), true));<NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>} | .expanded(), false)); |
1,822,006 | public void onBindViewHolder(ViewHolderReferralBonuses holder, int position) {<NEW_LINE>logDebug("onBindViewHolderList");<NEW_LINE>((ViewHolderReferralBonusesList) holder).imageView.setImageBitmap(null);<NEW_LINE>ReferralBonus referralBonus = (ReferralBonus) getItem(position);<NEW_LINE>holder.contactMail = referralBonus.getEmails().get(0);<NEW_LINE>MegaUser contact = megaApi.getContact(holder.contactMail);<NEW_LINE>if (contact != null) {<NEW_LINE>long handle = contact.getHandle();<NEW_LINE>String fullName = getContactNameDB(handle);<NEW_LINE>if (fullName == null)<NEW_LINE>fullName = holder.contactMail;<NEW_LINE>holder.textViewContactName.setText(fullName);<NEW_LINE>holder.itemLayout.setBackgroundColor(Color.WHITE);<NEW_LINE>Bitmap defaultAvatar = getDefaultAvatar(getColorAvatar(contact), fullName, AVATAR_SIZE, true);<NEW_LINE>((ViewHolderReferralBonusesList) holder).imageView.setImageBitmap(defaultAvatar);<NEW_LINE>UserAvatarListenerList listener = new UserAvatarListenerList(context, ((ViewHolderReferralBonusesList) holder), this);<NEW_LINE>File avatar = buildAvatarFile(context, holder.contactMail + ".jpg");<NEW_LINE>Bitmap bitmap = null;<NEW_LINE>if (isFileAvailable(avatar)) {<NEW_LINE>if (avatar.length() > 0) {<NEW_LINE>BitmapFactory.Options bOpts = new BitmapFactory.Options();<NEW_LINE>bOpts.inPurgeable = true;<NEW_LINE>bOpts.inInputShareable = true;<NEW_LINE>bitmap = BitmapFactory.decodeFile(avatar.getAbsolutePath(), bOpts);<NEW_LINE>if (bitmap == null) {<NEW_LINE>avatar.delete();<NEW_LINE>megaApi.getUserAvatar(holder.contactMail, buildAvatarFile(context, holder.contactMail + ".jpg").getAbsolutePath(), listener);<NEW_LINE>} else {<NEW_LINE>((ViewHolderReferralBonusesList) holder).imageView.setImageBitmap(bitmap);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>megaApi.getUserAvatar(holder.contactMail, buildAvatarFile(context, holder.contactMail + ".jpg").getAbsolutePath(), listener);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>megaApi.getUserAvatar(holder.contactMail, buildAvatarFile(context, holder.contactMail + ".jpg"<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>holder.textViewStorage.setText(getSizeString(referralBonus.getStorage()));<NEW_LINE>holder.textViewTransfer.setText(getSizeString(referralBonus.getTransfer()));<NEW_LINE>if (referralBonus.getDaysLeft() <= 15) {<NEW_LINE>holderList.textViewDaysLeft.setTextColor(ContextCompat.getColor(context, R.color.red_800));<NEW_LINE>}<NEW_LINE>if (referralBonus.getDaysLeft() > 0) {<NEW_LINE>holderList.textViewDaysLeft.setText(context.getResources().getString(R.string.general_num_days_left, (int) referralBonus.getDaysLeft()));<NEW_LINE>} else {<NEW_LINE>holderList.textViewDaysLeft.setText(context.getResources().getString(R.string.expired_label));<NEW_LINE>}<NEW_LINE>// holder.imageButtonThreeDots.setTag(holder);<NEW_LINE>} | ).getAbsolutePath(), listener); |
417,324 | public boolean nextFold() {<NEW_LINE>if (assignMatrixList == null) {<NEW_LINE>assignMatrixList = new LinkedList<>();<NEW_LINE>return true;<NEW_LINE>} else {<NEW_LINE>if (assignMatrixList.size() > 0) {<NEW_LINE>SequentialAccessSparseMatrix assign = assignMatrixList.poll();<NEW_LINE>trainMatrix = preferenceMatrix.clone();<NEW_LINE>testMatrix = preferenceMatrix.clone();<NEW_LINE>for (MatrixEntry matrixEntry : preferenceMatrix) {<NEW_LINE>if (assign.get(matrixEntry.row(), matrixEntry.column()) == 1) {<NEW_LINE>trainMatrix.setAtColumnPosition(matrixEntry.row(), <MASK><NEW_LINE>} else {<NEW_LINE>testMatrix.setAtColumnPosition(matrixEntry.row(), matrixEntry.columnPosition(), 0.0D);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>trainMatrix.reshape();<NEW_LINE>testMatrix.reshape();<NEW_LINE>return true;<NEW_LINE>} else {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | matrixEntry.columnPosition(), 0.0D); |
1,236,296 | public void onInitBaseChatPie(@NonNull ViewGroup aioRootView, @NonNull Parcelable session, @NonNull Context ctx, @NonNull AppRuntime rt) {<NEW_LINE>int inputTextId = ctx.getResources().getIdentifier("input", <MASK><NEW_LINE>EditText input = aioRootView.findViewById(inputTextId);<NEW_LINE>Objects.requireNonNull(input, "onInitBaseChatPie: findViewById R.id.input is null");<NEW_LINE>if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {<NEW_LINE>input.setOnReceiveContentListener(new String[] { MIME_IMAGE }, (view, payload) -> {<NEW_LINE>ClipData clipData = payload.getClip();<NEW_LINE>Pair<ClipDescription, Item> item = getClipDataItem0(clipData);<NEW_LINE>if (item != null && item.getFirst().hasMimeType(MIME_IMAGE)) {<NEW_LINE>Uri uri = item.getSecond().getUri();<NEW_LINE>if (uri != null && "content".equals(uri.getScheme())) {<NEW_LINE>handleSendUriPicture(ctx, session, uri, aioRootView, rt);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return payload;<NEW_LINE>});<NEW_LINE>} else {<NEW_LINE>input.setTag(R.id.XEditTextEx_onTextContextMenuItemInterceptor, (IOnContextMenuItemCallback) (editText, i) -> {<NEW_LINE>if (i == android.R.id.paste) {<NEW_LINE>Pair<ClipDescription, Item> item = getClipDataItem0(getPrimaryClip(ctx));<NEW_LINE>if (item != null && item.getFirst().hasMimeType(MIME_IMAGE)) {<NEW_LINE>Uri uri = item.getSecond().getUri();<NEW_LINE>if (uri != null && "content".equals(uri.getScheme())) {<NEW_LINE>handleSendUriPicture(ctx, session, uri, aioRootView, rt);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} | "id", ctx.getPackageName()); |
326,765 | public static void commitCriticalExceptionRT(@Nullable final String instanceId, @Nullable final WXErrorCode errCode, @Nullable final String function, @Nullable final String exception, @Nullable final Map<String, String> extParams) {<NEW_LINE>try {<NEW_LINE>WXLogUtils.e("weex", "commitCriticalExceptionRT :" + errCode + "exception" + exception);<NEW_LINE>WXStateRecord.getInstance().recordException(instanceId, exception);<NEW_LINE>IWXConfigAdapter configAdapter = WXSDKManager.getInstance().getWxConfigAdapter();<NEW_LINE>boolean doCheck = true;<NEW_LINE>if (null != configAdapter) {<NEW_LINE>String value = configAdapter.getConfig("wxapm", "check_repeat_report", "true");<NEW_LINE>doCheck = "true".equalsIgnoreCase(value);<NEW_LINE>}<NEW_LINE>boolean doReport = true;<NEW_LINE>if (doCheck) {<NEW_LINE>doReport = <MASK><NEW_LINE>}<NEW_LINE>if (!doReport) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} catch (Throwable e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>commitCriticalExceptionWithDefaultUrl("BundleUrlDefault", instanceId, errCode, function, exception, extParams);<NEW_LINE>} | checkNeedReportCauseRepeat(instanceId, errCode, exception); |
566,107 | public void eventOccurred(PeerManagerEvent event) {<NEW_LINE>final Peer peer = event.getPeer();<NEW_LINE>if (event.getType() == PeerManagerEvent.ET_PEER_ADDED) {<NEW_LINE>peer.addListener(new PeerListener2() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void eventOccurred(PeerEvent event) {<NEW_LINE>if (event.getType() == PeerEvent.ET_STATE_CHANGED) {<NEW_LINE>int new_state = <MASK><NEW_LINE>if (new_state == Peer.TRANSFERING) {<NEW_LINE>// the peer handshake has completed<NEW_LINE>if (peer.supportsMessaging()) {<NEW_LINE>// if it supports advanced messaging<NEW_LINE>// see if it supports any registered message types<NEW_LINE>Message[] messages = peer.getSupportedMessages();<NEW_LINE>for (int i = 0; i < messages.length; i++) {<NEW_LINE>Message msg = messages[i];<NEW_LINE>for (Iterator it = compat_checks.entrySet().iterator(); it.hasNext(); ) {<NEW_LINE>Map.Entry entry = (Map.Entry) it.next();<NEW_LINE>Message message = (Message) entry.getKey();<NEW_LINE>if (msg.getID().equals(message.getID())) {<NEW_LINE>// it does !<NEW_LINE>MessageManagerListener listener = (MessageManagerListener) entry.getValue();<NEW_LINE>listener.compatiblePeerFound(download, peer, message);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} else if (event.getType() == PeerManagerEvent.ET_PEER_REMOVED) {<NEW_LINE>for (Iterator i = compat_checks.values().iterator(); i.hasNext(); ) {<NEW_LINE>MessageManagerListener listener = (MessageManagerListener) i.next();<NEW_LINE>listener.peerRemoved(download, peer);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | (Integer) event.getData(); |
1,772,877 | public static DescribeParentPlatformsResponse unmarshall(DescribeParentPlatformsResponse describeParentPlatformsResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeParentPlatformsResponse.setRequestId(_ctx.stringValue("DescribeParentPlatformsResponse.RequestId"));<NEW_LINE>describeParentPlatformsResponse.setPageSize(_ctx.longValue("DescribeParentPlatformsResponse.PageSize"));<NEW_LINE>describeParentPlatformsResponse.setPageNum(_ctx.longValue("DescribeParentPlatformsResponse.PageNum"));<NEW_LINE>describeParentPlatformsResponse.setPageCount(_ctx.longValue("DescribeParentPlatformsResponse.PageCount"));<NEW_LINE>describeParentPlatformsResponse.setTotalCount(_ctx.longValue("DescribeParentPlatformsResponse.TotalCount"));<NEW_LINE>List<Platform> platforms = new ArrayList<Platform>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeParentPlatformsResponse.Platforms.Length"); i++) {<NEW_LINE>Platform platform = new Platform();<NEW_LINE>platform.setId(_ctx.stringValue("DescribeParentPlatformsResponse.Platforms[" + i + "].Id"));<NEW_LINE>platform.setName(_ctx.stringValue("DescribeParentPlatformsResponse.Platforms[" + i + "].Name"));<NEW_LINE>platform.setDescription(_ctx.stringValue("DescribeParentPlatformsResponse.Platforms[" + i + "].Description"));<NEW_LINE>platform.setBizProtocol(_ctx.stringValue("DescribeParentPlatformsResponse.Platforms[" + i + "].Protocol"));<NEW_LINE>platform.setStatus(_ctx.stringValue<MASK><NEW_LINE>platform.setGbId(_ctx.stringValue("DescribeParentPlatformsResponse.Platforms[" + i + "].GbId"));<NEW_LINE>platform.setIp(_ctx.stringValue("DescribeParentPlatformsResponse.Platforms[" + i + "].Ip"));<NEW_LINE>platform.setPort(_ctx.longValue("DescribeParentPlatformsResponse.Platforms[" + i + "].Port"));<NEW_LINE>platform.setClientGbId(_ctx.stringValue("DescribeParentPlatformsResponse.Platforms[" + i + "].ClientGbId"));<NEW_LINE>platform.setClientAuth(_ctx.booleanValue("DescribeParentPlatformsResponse.Platforms[" + i + "].ClientAuth"));<NEW_LINE>platform.setClientUsername(_ctx.stringValue("DescribeParentPlatformsResponse.Platforms[" + i + "].ClientUsername"));<NEW_LINE>platform.setClientPassword(_ctx.stringValue("DescribeParentPlatformsResponse.Platforms[" + i + "].ClientPassword"));<NEW_LINE>platform.setClientIp(_ctx.stringValue("DescribeParentPlatformsResponse.Platforms[" + i + "].ClientIp"));<NEW_LINE>platform.setClientPort(_ctx.longValue("DescribeParentPlatformsResponse.Platforms[" + i + "].ClientPort"));<NEW_LINE>platform.setAutoStart(_ctx.booleanValue("DescribeParentPlatformsResponse.Platforms[" + i + "].AutoStart"));<NEW_LINE>platform.setCreatedTime(_ctx.stringValue("DescribeParentPlatformsResponse.Platforms[" + i + "].CreatedTime"));<NEW_LINE>platforms.add(platform);<NEW_LINE>}<NEW_LINE>describeParentPlatformsResponse.setPlatforms(platforms);<NEW_LINE>return describeParentPlatformsResponse;<NEW_LINE>} | ("DescribeParentPlatformsResponse.Platforms[" + i + "].Status")); |
389,779 | public DdlContext copy() {<NEW_LINE>DdlContext res = new DdlContext();<NEW_LINE>res.setJobId(getJobId());<NEW_LINE>res.setDdlType(getDdlType());<NEW_LINE>res.setSchemaName(getSchemaName());<NEW_LINE>res.setObjectName(getObjectName());<NEW_LINE>res.setTraceId(getTraceId());<NEW_LINE><MASK><NEW_LINE>GeneralUtil.addAllIfNotEmpty(getResources(), res.resources);<NEW_LINE>GeneralUtil.addAllIfNotEmpty(physicalDdlInjectionFlag, res.physicalDdlInjectionFlag);<NEW_LINE>res.state.set(getState());<NEW_LINE>res.interrupted.set(isInterrupted());<NEW_LINE>res.setEnableTrace(isEnableTrace());<NEW_LINE>res.setResponseNode(getResponseNode());<NEW_LINE>res.setAsyncMode(isAsyncMode());<NEW_LINE>res.setUsingWarning(isUsingWarning());<NEW_LINE>GeneralUtil.addAllIfNotEmpty(getDataPassed(), res.dataPassed);<NEW_LINE>GeneralUtil.addAllIfNotEmpty(getServerVariables(), res.serverVariables);<NEW_LINE>GeneralUtil.addAllIfNotEmpty(getUserDefVariables(), res.userDefVariables);<NEW_LINE>GeneralUtil.addAllIfNotEmpty(getExtraServerVariables(), res.extraServerVariables);<NEW_LINE>GeneralUtil.addAllIfNotEmpty(getExtraCmds(), res.extraCmds);<NEW_LINE>res.setEncoding(getEncoding());<NEW_LINE>res.setTimeZone(getTimeZone());<NEW_LINE>return res;<NEW_LINE>} | res.setDdlStmt(getDdlStmt()); |
1,044,551 | public Mono<Void> disposeLater(Duration quietPeriod, Duration timeout) {<NEW_LINE>return Mono.defer(() -> {<NEW_LINE>long quietPeriodMillis = quietPeriod.toMillis();<NEW_LINE>long timeoutMillis = timeout.toMillis();<NEW_LINE>EventLoopGroup serverLoopsGroup = serverLoops.get();<NEW_LINE>EventLoopGroup clientLoopsGroup = clientLoops.get();<NEW_LINE>EventLoopGroup serverSelectLoopsGroup = serverSelectLoops.get();<NEW_LINE>EventLoopGroup cacheNativeClientGroup = cacheNativeClientLoops.get();<NEW_LINE>EventLoopGroup cacheNativeSelectGroup = cacheNativeSelectLoops.get();<NEW_LINE><MASK><NEW_LINE>Mono<?> clMono = Mono.empty();<NEW_LINE>Mono<?> sslMono = Mono.empty();<NEW_LINE>Mono<?> slMono = Mono.empty();<NEW_LINE>Mono<?> cnclMono = Mono.empty();<NEW_LINE>Mono<?> cnslMono = Mono.empty();<NEW_LINE>Mono<?> cnsrvlMono = Mono.empty();<NEW_LINE>if (running.compareAndSet(true, false)) {<NEW_LINE>if (clientLoopsGroup != null) {<NEW_LINE>clMono = FutureMono.from((Future) clientLoopsGroup.shutdownGracefully(quietPeriodMillis, timeoutMillis, TimeUnit.MILLISECONDS));<NEW_LINE>}<NEW_LINE>if (serverSelectLoopsGroup != null) {<NEW_LINE>sslMono = FutureMono.from((Future) serverSelectLoopsGroup.shutdownGracefully(quietPeriodMillis, timeoutMillis, TimeUnit.MILLISECONDS));<NEW_LINE>}<NEW_LINE>if (serverLoopsGroup != null) {<NEW_LINE>slMono = FutureMono.from((Future) serverLoopsGroup.shutdownGracefully(quietPeriodMillis, timeoutMillis, TimeUnit.MILLISECONDS));<NEW_LINE>}<NEW_LINE>if (cacheNativeClientGroup != null) {<NEW_LINE>cnclMono = FutureMono.from((Future) cacheNativeClientGroup.shutdownGracefully(quietPeriodMillis, timeoutMillis, TimeUnit.MILLISECONDS));<NEW_LINE>}<NEW_LINE>if (cacheNativeSelectGroup != null) {<NEW_LINE>cnslMono = FutureMono.from((Future) cacheNativeSelectGroup.shutdownGracefully(quietPeriodMillis, timeoutMillis, TimeUnit.MILLISECONDS));<NEW_LINE>}<NEW_LINE>if (cacheNativeServerGroup != null) {<NEW_LINE>cnsrvlMono = FutureMono.from((Future) cacheNativeServerGroup.shutdownGracefully(quietPeriodMillis, timeoutMillis, TimeUnit.MILLISECONDS));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Mono.when(clMono, sslMono, slMono, cnclMono, cnslMono, cnsrvlMono);<NEW_LINE>});<NEW_LINE>} | EventLoopGroup cacheNativeServerGroup = cacheNativeServerLoops.get(); |
247,634 | public void run(RegressionEnvironment env) {<NEW_LINE>String[] fields = "symbol".split(",");<NEW_LINE>String text = "@name('s0') select irstream * from SupportMarketDataBean#length_batch(3)";<NEW_LINE>env.compileDeployAddListenerMileZero(text, "s0");<NEW_LINE>env<MASK><NEW_LINE>env.milestone(1);<NEW_LINE>env.sendEventBean(makeMarketDataEvent("E2"));<NEW_LINE>env.milestone(2);<NEW_LINE>env.sendEventBean(makeMarketDataEvent("E3"));<NEW_LINE>env.assertPropsPerRowIRPair("s0", fields, new Object[][] { { "E1" }, { "E2" }, { "E3" } }, null);<NEW_LINE>env.milestone(3);<NEW_LINE>env.sendEventBean(makeMarketDataEvent("E4"));<NEW_LINE>env.milestone(4);<NEW_LINE>env.sendEventBean(makeMarketDataEvent("E5"));<NEW_LINE>env.milestone(5);<NEW_LINE>// test iterator<NEW_LINE>env.assertPropsPerRowIterator("s0", new String[] { "symbol" }, new Object[][] { { "E4" }, { "E5" } });<NEW_LINE>env.sendEventBean(makeMarketDataEvent("E6"));<NEW_LINE>env.assertPropsPerRowIRPair("s0", fields, new Object[][] { { "E4" }, { "E5" }, { "E6" } }, new Object[][] { { "E1" }, { "E2" }, { "E3" } });<NEW_LINE>env.milestone(6);<NEW_LINE>env.sendEventBean(makeMarketDataEvent("E7"));<NEW_LINE>env.milestone(7);<NEW_LINE>env.sendEventBean(makeMarketDataEvent("E8"));<NEW_LINE>env.milestone(8);<NEW_LINE>env.sendEventBean(makeMarketDataEvent("E9"));<NEW_LINE>env.assertPropsPerRowIRPair("s0", fields, new Object[][] { { "E7" }, { "E8" }, { "E9" } }, new Object[][] { { "E4" }, { "E5" }, { "E6" } });<NEW_LINE>env.milestone(9);<NEW_LINE>env.sendEventBean(makeMarketDataEvent("E10"));<NEW_LINE>env.milestone(10);<NEW_LINE>env.undeployAll();<NEW_LINE>} | .sendEventBean(makeMarketDataEvent("E1")); |
674,571 | public com.amazonaws.services.dax.model.SubnetGroupNotFoundException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.dax.model.SubnetGroupNotFoundException subnetGroupNotFoundException = new com.amazonaws.services.dax.model.SubnetGroupNotFoundException(null);<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 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>} 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 subnetGroupNotFoundException;<NEW_LINE>} | String currentParentElement = context.getCurrentParentElement(); |
1,798,391 | // create publish version task for transaction<NEW_LINE>public List<PublishVersionTask> createPublishVersionTask() {<NEW_LINE>List<PublishVersionTask> <MASK><NEW_LINE>if (this.hasSendTask()) {<NEW_LINE>return tasks;<NEW_LINE>}<NEW_LINE>Set<Long> publishBackends = this.getPublishVersionTasks().keySet();<NEW_LINE>// public version tasks are not persisted in catalog, so publishBackends may be empty.<NEW_LINE>// We have to send publish version task to all backends<NEW_LINE>if (publishBackends.isEmpty()) {<NEW_LINE>// note: tasks are sended to all backends including dead ones, or else<NEW_LINE>// transaction manager will treat it as success<NEW_LINE>List<Long> allBackends = Catalog.getCurrentSystemInfo().getBackendIds(false);<NEW_LINE>if (!allBackends.isEmpty()) {<NEW_LINE>publishBackends = Sets.newHashSet();<NEW_LINE>publishBackends.addAll(allBackends);<NEW_LINE>} else {<NEW_LINE>// all backends may be dropped, no need to create task<NEW_LINE>LOG.warn("transaction {} want to publish, but no backend exists", this.getTransactionId());<NEW_LINE>return tasks;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<PartitionCommitInfo> partitionCommitInfos = new ArrayList<>();<NEW_LINE>for (TableCommitInfo tableCommitInfo : this.getIdToTableCommitInfos().values()) {<NEW_LINE>partitionCommitInfos.addAll(tableCommitInfo.getIdToPartitionCommitInfo().values());<NEW_LINE>}<NEW_LINE>List<TPartitionVersionInfo> partitionVersions = new ArrayList<>(partitionCommitInfos.size());<NEW_LINE>for (PartitionCommitInfo commitInfo : partitionCommitInfos) {<NEW_LINE>TPartitionVersionInfo version = new TPartitionVersionInfo(commitInfo.getPartitionId(), commitInfo.getVersion(), 0);<NEW_LINE>partitionVersions.add(version);<NEW_LINE>}<NEW_LINE>long createTime = System.currentTimeMillis();<NEW_LINE>for (long backendId : publishBackends) {<NEW_LINE>PublishVersionTask task = new PublishVersionTask(backendId, this.getTransactionId(), this.getDbId(), partitionVersions, createTime);<NEW_LINE>this.addPublishVersionTask(backendId, task);<NEW_LINE>tasks.add(task);<NEW_LINE>}<NEW_LINE>return tasks;<NEW_LINE>} | tasks = new ArrayList<>(); |
1,055,479 | protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>// Mapbox access token is configured here. This needs to be called either in your application<NEW_LINE>// object or in the same activity which contains the mapview.<NEW_LINE>Mapbox.getInstance(this, getString(R.string.access_token));<NEW_LINE>// This contains the MapView in XML and needs to be called after the access token is configured.<NEW_LINE>setContentView(R.layout.activity_extrusion_rotation);<NEW_LINE>mapView = <MASK><NEW_LINE>mapView.onCreate(savedInstanceState);<NEW_LINE>mapView.getMapAsync(new OnMapReadyCallback() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onMapReady(@NonNull final MapboxMap map) {<NEW_LINE>mapboxMap = map;<NEW_LINE>mapboxMap.setStyle(Style.DARK, new Style.OnStyleLoaded() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onStyleLoaded(@NonNull Style style) {<NEW_LINE>setupBuildingExtrusionPlugin(style);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | findViewById(R.id.mapView); |
1,192,685 | private Mono<Response<Void>> breakPairingWithResponseAsync(String resourceGroupName, String namespaceName, String alias, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (namespaceName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (alias == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter alias is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>final String apiVersion = "2017-04-01";<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.breakPairing(this.client.getEndpoint(), resourceGroupName, namespaceName, alias, apiVersion, this.client.getSubscriptionId(), accept, context);<NEW_LINE>} | error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); |
144,989 | public static RubyClass createThreadClass(Ruby runtime) {<NEW_LINE>// FIXME: In order for Thread to play well with the standard 'new' behavior,<NEW_LINE>// it must provide an allocator that can create empty object instances which<NEW_LINE>// initialize then fills with appropriate data.<NEW_LINE>RubyClass threadClass = runtime.defineClass("Thread", runtime.getObject(), ObjectAllocator.NOT_ALLOCATABLE_ALLOCATOR);<NEW_LINE>threadClass.setClassIndex(ClassIndex.THREAD);<NEW_LINE>threadClass.setReifiedClass(RubyThread.class);<NEW_LINE>threadClass.defineAnnotatedMethods(RubyThread.class);<NEW_LINE>// main thread is considered adopted, since it is initiated by the JVM<NEW_LINE>RubyThread rubyThread = new RubyThread(runtime, threadClass, true);<NEW_LINE>// TODO: need to isolate the "current" thread from class creation<NEW_LINE>rubyThread.threadImpl = new AdoptedNativeThread(<MASK><NEW_LINE>runtime.getThreadService().setMainThread(Thread.currentThread(), rubyThread);<NEW_LINE>// set to default thread group<NEW_LINE>runtime.getDefaultThreadGroup().addDirectly(rubyThread);<NEW_LINE>threadClass.setMarshal(ObjectMarshal.NOT_MARSHALABLE_MARSHAL);<NEW_LINE>// set up Thread::Backtrace::Location class<NEW_LINE>RubyClass backtrace = threadClass.defineClassUnder("Backtrace", runtime.getObject(), ObjectAllocator.NOT_ALLOCATABLE_ALLOCATOR);<NEW_LINE>RubyClass location = backtrace.defineClassUnder("Location", runtime.getObject(), ObjectAllocator.NOT_ALLOCATABLE_ALLOCATOR);<NEW_LINE>location.defineAnnotatedMethods(Location.class);<NEW_LINE>runtime.setLocation(location);<NEW_LINE>return threadClass;<NEW_LINE>} | rubyThread, Thread.currentThread()); |
867,381 | public static GetProjectTaskInfoResponse unmarshall(GetProjectTaskInfoResponse getProjectTaskInfoResponse, UnmarshallerContext _ctx) {<NEW_LINE>getProjectTaskInfoResponse.setRequestId(_ctx.stringValue("GetProjectTaskInfoResponse.RequestId"));<NEW_LINE>getProjectTaskInfoResponse.setSuccessful(_ctx.booleanValue("GetProjectTaskInfoResponse.Successful"));<NEW_LINE>getProjectTaskInfoResponse.setErrorCode(_ctx.stringValue("GetProjectTaskInfoResponse.ErrorCode"));<NEW_LINE>getProjectTaskInfoResponse.setErrorMsg(_ctx.stringValue("GetProjectTaskInfoResponse.ErrorMsg"));<NEW_LINE>Object object = new Object();<NEW_LINE>object.setTasklistId(_ctx.stringValue("GetProjectTaskInfoResponse.Object.TasklistId"));<NEW_LINE>object.setTaskflowstatusId(_ctx.stringValue("GetProjectTaskInfoResponse.Object.TaskflowstatusId"));<NEW_LINE>object.setTaskType(_ctx.stringValue("GetProjectTaskInfoResponse.Object.TaskType"));<NEW_LINE>object.setIsDeleted(_ctx.booleanValue("GetProjectTaskInfoResponse.Object.IsDeleted"));<NEW_LINE>object.setCreatorId(_ctx.stringValue("GetProjectTaskInfoResponse.Object.CreatorId"));<NEW_LINE>object.setIsTopInProject(_ctx.booleanValue("GetProjectTaskInfoResponse.Object.IsTopInProject"));<NEW_LINE>object.setExecutorId(_ctx.stringValue("GetProjectTaskInfoResponse.Object.ExecutorId"));<NEW_LINE>object.setStoryPoint(_ctx.stringValue("GetProjectTaskInfoResponse.Object.StoryPoint"));<NEW_LINE>object.setCreated(_ctx.stringValue("GetProjectTaskInfoResponse.Object.Created"));<NEW_LINE>object.setOrganizationId(_ctx.stringValue("GetProjectTaskInfoResponse.Object.OrganizationId"));<NEW_LINE>object.setIsDone(_ctx.booleanValue("GetProjectTaskInfoResponse.Object.IsDone"));<NEW_LINE>object.setId(_ctx.stringValue("GetProjectTaskInfoResponse.Object.Id"));<NEW_LINE>object.setUpdated(_ctx.stringValue("GetProjectTaskInfoResponse.Object.Updated"));<NEW_LINE>object.setSprintId(_ctx.stringValue("GetProjectTaskInfoResponse.Object.SprintId"));<NEW_LINE>object.setProjectId(_ctx.stringValue("GetProjectTaskInfoResponse.Object.ProjectId"));<NEW_LINE>object.setContent(_ctx.stringValue("GetProjectTaskInfoResponse.Object.Content"));<NEW_LINE>object.setNote(_ctx.stringValue("GetProjectTaskInfoResponse.Object.Note"));<NEW_LINE>object.setDueDate(_ctx.stringValue("GetProjectTaskInfoResponse.Object.DueDate"));<NEW_LINE>object.setStartDate<MASK><NEW_LINE>object.setVisible(_ctx.stringValue("GetProjectTaskInfoResponse.Object.Visible"));<NEW_LINE>object.setPriority(_ctx.stringValue("GetProjectTaskInfoResponse.Object.Priority"));<NEW_LINE>List<String> involveMembers = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("GetProjectTaskInfoResponse.Object.InvolveMembers.Length"); i++) {<NEW_LINE>involveMembers.add(_ctx.stringValue("GetProjectTaskInfoResponse.Object.InvolveMembers[" + i + "]"));<NEW_LINE>}<NEW_LINE>object.setInvolveMembers(involveMembers);<NEW_LINE>getProjectTaskInfoResponse.setObject(object);<NEW_LINE>return getProjectTaskInfoResponse;<NEW_LINE>} | (_ctx.stringValue("GetProjectTaskInfoResponse.Object.StartDate")); |
1,776,320 | private void analyzeCall(RexCall call, Constancy callConstancy) {<NEW_LINE>parentCallTypeStack.push(call.getOperator());<NEW_LINE>// visit operands, pushing their states onto stack<NEW_LINE>super.visitCall(call);<NEW_LINE>// look for NON_CONSTANT operands<NEW_LINE>int operandCount = call.getOperands().size();<NEW_LINE>List<Constancy> operandStack = <MASK><NEW_LINE>for (Constancy operandConstancy : operandStack) {<NEW_LINE>if (operandConstancy == Constancy.NON_CONSTANT) {<NEW_LINE>callConstancy = Constancy.NON_CONSTANT;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Even if all operands are constant, the call itself may<NEW_LINE>// be non-deterministic.<NEW_LINE>if (!call.getOperator().isDeterministic()) {<NEW_LINE>callConstancy = Constancy.NON_CONSTANT;<NEW_LINE>} else if (call.getOperator().isDynamicFunction()) {<NEW_LINE>// We can reduce the call to a constant, but we can't<NEW_LINE>// cache the plan if the function is dynamic.<NEW_LINE>// For now, treat it same as non-deterministic.<NEW_LINE>callConstancy = Constancy.NON_CONSTANT;<NEW_LINE>}<NEW_LINE>// Row operator itself can't be reduced to a literal, but if<NEW_LINE>// the operands are constants, we still want to reduce those<NEW_LINE>if ((callConstancy == Constancy.REDUCIBLE_CONSTANT) && (call.getOperator() instanceof SqlRowOperator)) {<NEW_LINE>callConstancy = Constancy.NON_CONSTANT;<NEW_LINE>}<NEW_LINE>if (callConstancy == Constancy.NON_CONSTANT) {<NEW_LINE>// any REDUCIBLE_CONSTANT children are now known to be maximal<NEW_LINE>// reducible subtrees, so they can be added to the result<NEW_LINE>// list<NEW_LINE>for (int iOperand = 0; iOperand < operandCount; ++iOperand) {<NEW_LINE>Constancy constancy = operandStack.get(iOperand);<NEW_LINE>if (constancy == Constancy.REDUCIBLE_CONSTANT) {<NEW_LINE>addResult(call.getOperands().get(iOperand));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// pop operands off of the stack<NEW_LINE>operandStack.clear();<NEW_LINE>// pop this parent call operator off the stack<NEW_LINE>parentCallTypeStack.pop();<NEW_LINE>// push constancy result for this call onto stack<NEW_LINE>stack.add(callConstancy);<NEW_LINE>} | Util.last(stack, operandCount); |
1,670,534 | public ApplicationStubs execute(EntityManagerContainer emc) throws Exception {<NEW_LINE>Business business = new Business(emc);<NEW_LINE><MASK><NEW_LINE>Set<String> ids = new HashSet<>();<NEW_LINE>ids.addAll(this.listApplicationFromTask(business, dateRange));<NEW_LINE>ids.addAll(this.listApplicationFromTaskCompleted(business, dateRange));<NEW_LINE>List<ApplicationStub> list = new ArrayList<>();<NEW_LINE>for (String str : ids) {<NEW_LINE>String name = this.getApplicationName(business, dateRange, str);<NEW_LINE>ApplicationStub stub = new ApplicationStub();<NEW_LINE>stub.setName(name);<NEW_LINE>stub.setValue(str);<NEW_LINE>stub.setProcessStubs(this.concreteProcessStubs(business, dateRange, stub));<NEW_LINE>list.add(stub);<NEW_LINE>}<NEW_LINE>list = list.stream().sorted(Comparator.comparing(ApplicationStub::getName, Comparator.nullsLast(String::compareTo))).collect(Collectors.toList());<NEW_LINE>ApplicationStubs stubs = new ApplicationStubs();<NEW_LINE>stubs.addAll(list);<NEW_LINE>return stubs;<NEW_LINE>} | DateRange dateRange = this.getDateRange(); |
337,217 | public boolean addRunningEffects(BlockState state, Level world, BlockPos pos, Entity entity) {<NEW_LINE>if (state.getValue(FACING) == Direction.UP) {<NEW_LINE>Vec3 Vector3d = entity.getDeltaMovement();<NEW_LINE>world.addParticle(new BlockParticleOption(ParticleTypes.BLOCK, Blocks.SLIME_BLOCK.defaultBlockState()).setPos(pos), entity.getX() + ((double) world.random.nextFloat() - 0.5D) * (double) entity.getBbWidth(), entity.getY() + 0.1D, entity.getZ() + ((double) world.random.nextFloat() - 0.5D) * (double) entity.getBbWidth(), Vector3d.x * -4.0D, 1.5D<MASK><NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return super.addRunningEffects(state, world, pos, entity);<NEW_LINE>} | , Vector3d.z * -4.0D); |
416,824 | static int lastByteIndexOfString(AbstractTruffleString a, AbstractTruffleString b, int fromIndexB, int toIndexB, byte[] mask, Encoding expectedEncoding, @Cached ToIndexableNode toIndexableNodeA, @Cached ToIndexableNode toIndexableNodeB, @Cached TStringInternalNodes.GetCodeRangeNode getCodeRangeANode, @Cached TStringInternalNodes.GetCodeRangeNode getCodeRangeBNode, @Cached TStringInternalNodes.LastIndexOfStringRawNode indexOfStringNode) {<NEW_LINE>final int codeRangeA = getCodeRangeANode.execute(a);<NEW_LINE>final int codeRangeB = getCodeRangeBNode.execute(b);<NEW_LINE>a.looseCheckEncoding(expectedEncoding, codeRangeA);<NEW_LINE>b.looseCheckEncoding(expectedEncoding, codeRangeB);<NEW_LINE>if (mask != null && isUnsupportedEncoding(expectedEncoding) && !isFixedWidth(codeRangeA)) {<NEW_LINE>throw InternalErrors.unsupportedOperation();<NEW_LINE>}<NEW_LINE>if (b.isEmpty()) {<NEW_LINE>return fromIndexB;<NEW_LINE>}<NEW_LINE>if (a.isEmpty()) {<NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>final int fromIndex = rawIndex(fromIndexB, expectedEncoding);<NEW_LINE>final int <MASK><NEW_LINE>a.boundsCheckRaw(toIndex, fromIndex);<NEW_LINE>Object arrayA = toIndexableNodeA.execute(a, a.data());<NEW_LINE>Object arrayB = toIndexableNodeB.execute(b, b.data());<NEW_LINE>if (indexOfCannotMatch(codeRangeA, b, codeRangeB, mask, fromIndex - toIndex)) {<NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>return byteIndex(indexOfStringNode.execute(a, arrayA, codeRangeA, b, arrayB, codeRangeB, fromIndex, toIndex, mask), expectedEncoding);<NEW_LINE>} | toIndex = rawIndex(toIndexB, expectedEncoding); |
204,554 | protected Job createJob() {<NEW_LINE>final Collection<BootDashElement> selecteds = getSelectedElements();<NEW_LINE>if (!selecteds.isEmpty()) {<NEW_LINE>boolean riskAccepted = ui().confirmWithToggle("ngrok.tunnel.warning.state", "Really Expose local service on public internet?", "The ngrok tunnel uses a third-party server to pass all data between your local app and its clients over a public internet connection.\n\n" + "Do you really want to do this?", null);<NEW_LINE>if (riskAccepted) {<NEW_LINE>String ngrokInstall = this.ngrokManager.getDefaultInstall();<NEW_LINE>if (ngrokInstall == null) {<NEW_LINE>ngrokInstall = ui().chooseFile("ngrok installation", null);<NEW_LINE>if (ngrokInstall != null) {<NEW_LINE>this.ngrokManager.addInstall(ngrokInstall);<NEW_LINE>this.ngrokManager.setDefaultInstall(ngrokInstall);<NEW_LINE>this.ngrokManager.save();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (ngrokInstall != null) {<NEW_LINE>final NGROKClient ngrokClient = new NGROKClient(ngrokInstall);<NEW_LINE>final String eurekaInstance = getEurekaInstance();<NEW_LINE>if (eurekaInstance != null) {<NEW_LINE>return new Job("Restarting and Exposing " + selecteds.size() + " Dash Elements") {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public IStatus run(IProgressMonitor monitor) {<NEW_LINE>monitor.beginTask("Restart and Expose Boot Dash Elements", selecteds.size());<NEW_LINE>try {<NEW_LINE>for (BootDashElement el : selecteds) {<NEW_LINE>if (el instanceof AbstractLaunchConfigurationsDashElement<?>) {<NEW_LINE>monitor.subTask(<MASK><NEW_LINE>try {<NEW_LINE>AbstractLaunchConfigurationsDashElement<?> localDashProject = (AbstractLaunchConfigurationsDashElement<?>) el;<NEW_LINE>localDashProject.restartAndExpose(getGoalState(), ngrokClient, eurekaInstance, ui());<NEW_LINE>} catch (Exception e) {<NEW_LINE>return BootActivator.createErrorStatus(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>monitor.worked(1);<NEW_LINE>}<NEW_LINE>return Status.OK_STATUS;<NEW_LINE>} finally {<NEW_LINE>monitor.done();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | "Restarting: " + el.getName()); |
1,783,914 | private void deleteDestLocalizations(JsBus bus) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {<NEW_LINE>SibTr.entry(tc, "deleteDestLocalizations", this);<NEW_LINE>}<NEW_LINE>Iterator i = alterDestinations.iterator();<NEW_LINE>while (i.hasNext()) {<NEW_LINE>String key = (String) i.next();<NEW_LINE>try {<NEW_LINE>// Get it from the old cache as it is no longer in the new cache.<NEW_LINE>DestinationDefinition dd = (DestinationDefinition) _me.getSIBDestination(bus.getName(), key);<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {<NEW_LINE>SibTr.debug(tc, "deleteDestLocalizations: deleting DestinationLocalization, name =" + key + " Name=");<NEW_LINE>}<NEW_LINE>if (!isInZOSServentRegion() && _mpAdmin != null) {<NEW_LINE>LocalizationEntry dldEntry = (LocalizationEntry) lpMap.get(dd.getName() + "@" + _me.getName());<NEW_LINE>LocalizationDefinition dld = (LocalizationDefinition) dldEntry.getLocalizationDefinition();<NEW_LINE>// Venu Liberty change: passing Destination UUID as String.<NEW_LINE>// Destination Definition is passed as NULL as entire destination has to be deleted<NEW_LINE>_mpAdmin.deleteDestinationLocalization(dd.getUUID().toString(), null);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>com.ibm.ws.ffdc.FFDCFilter.processException(e, <MASK><NEW_LINE>SibTr.exception(tc, e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {<NEW_LINE>SibTr.exit(tc, "deleteDestLocalizations");<NEW_LINE>}<NEW_LINE>} | CLASS_NAME + ".deleteDestLocalizations", "1", this); |
1,823,246 | public void handle(SimulationEvent event) {<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>Map<String, ResourceEntity> resources = (Map<String, ResourceEntity>) event.getProperty(resourcesKey);<NEW_LINE>List<InputStream> inputStreams = new ArrayList<>();<NEW_LINE>try {<NEW_LINE>DeploymentBuilder deploymentBuilder = SimulationRunContext<MASK><NEW_LINE>for (ResourceEntity resource : resources.values()) {<NEW_LINE>LOGGER.debug("adding resource [{}] to deployment", resource.getName());<NEW_LINE>InputStream is = new ByteArrayInputStream(resource.getBytes());<NEW_LINE>deploymentBuilder.addInputStream(resource.getName(), is);<NEW_LINE>inputStreams.add(is);<NEW_LINE>}<NEW_LINE>deploymentBuilder.deploy();<NEW_LINE>} finally {<NEW_LINE>for (InputStream is : inputStreams) {<NEW_LINE>try {<NEW_LINE>is.close();<NEW_LINE>} catch (IOException e) {<NEW_LINE>LOGGER.error("Unable to close resource input stream {}", is);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .getRepositoryService().createDeployment(); |
194,893 | final DeleteRegistrationCodeResult executeDeleteRegistrationCode(DeleteRegistrationCodeRequest deleteRegistrationCodeRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteRegistrationCodeRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteRegistrationCodeRequest> request = null;<NEW_LINE>Response<DeleteRegistrationCodeResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteRegistrationCodeRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteRegistrationCodeRequest));<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, "IoT");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteRegistrationCode");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteRegistrationCodeResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteRegistrationCodeResultJsonUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | invoke(request, responseHandler, executionContext); |
1,407,874 | protected void updateProfileButton() {<NEW_LINE>View view = getView();<NEW_LINE>if (view == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>View profileButton = view.<MASK><NEW_LINE>if (profileButton != null && currentScreenType != null) {<NEW_LINE>int toolbarRes = currentScreenType.toolbarResId;<NEW_LINE>int iconColor = getActiveProfileColor();<NEW_LINE>int bgColor = ColorUtilities.getColorWithAlpha(iconColor, 0.1f);<NEW_LINE>int selectedColor = ColorUtilities.getColorWithAlpha(iconColor, 0.3f);<NEW_LINE>if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP) {<NEW_LINE>int bgResId = 0;<NEW_LINE>int selectableResId = 0;<NEW_LINE>if (toolbarRes == R.layout.profile_preference_toolbar || toolbarRes == R.layout.profile_preference_toolbar_with_switch) {<NEW_LINE>bgResId = R.drawable.circle_background_light;<NEW_LINE>selectableResId = R.drawable.ripple_circle;<NEW_LINE>} else if (toolbarRes == R.layout.profile_preference_toolbar_big) {<NEW_LINE>bgResId = R.drawable.rectangle_rounded;<NEW_LINE>selectableResId = R.drawable.ripple_rectangle_rounded;<NEW_LINE>}<NEW_LINE>Drawable bgDrawable = getPaintedIcon(bgResId, bgColor);<NEW_LINE>Drawable selectable = getPaintedIcon(selectableResId, selectedColor);<NEW_LINE>Drawable[] layers = { bgDrawable, selectable };<NEW_LINE>AndroidUtils.setBackground(profileButton, new LayerDrawable(layers));<NEW_LINE>} else {<NEW_LINE>int bgResId = 0;<NEW_LINE>if (toolbarRes == R.layout.profile_preference_toolbar || toolbarRes == R.layout.profile_preference_toolbar_with_switch) {<NEW_LINE>bgResId = R.drawable.circle_background_light;<NEW_LINE>} else if (toolbarRes == R.layout.profile_preference_toolbar_big) {<NEW_LINE>bgResId = R.drawable.rectangle_rounded;<NEW_LINE>}<NEW_LINE>Drawable bgDrawable = getPaintedIcon(bgResId, bgColor);<NEW_LINE>AndroidUtils.setBackground(profileButton, bgDrawable);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | findViewById(R.id.profile_button); |
1,422,438 | public void marshall(CreateProfileJobRequest createProfileJobRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (createProfileJobRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(createProfileJobRequest.getDatasetName(), DATASETNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(createProfileJobRequest.getEncryptionKeyArn(), ENCRYPTIONKEYARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(createProfileJobRequest.getEncryptionMode(), ENCRYPTIONMODE_BINDING);<NEW_LINE>protocolMarshaller.marshall(createProfileJobRequest.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(createProfileJobRequest.getLogSubscription(), LOGSUBSCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(createProfileJobRequest.getMaxCapacity(), MAXCAPACITY_BINDING);<NEW_LINE>protocolMarshaller.marshall(createProfileJobRequest.getMaxRetries(), MAXRETRIES_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(createProfileJobRequest.getConfiguration(), CONFIGURATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(createProfileJobRequest.getValidationConfigurations(), VALIDATIONCONFIGURATIONS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createProfileJobRequest.getRoleArn(), ROLEARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(createProfileJobRequest.getTags(), TAGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createProfileJobRequest.getTimeout(), TIMEOUT_BINDING);<NEW_LINE>protocolMarshaller.marshall(createProfileJobRequest.getJobSample(), JOBSAMPLE_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | createProfileJobRequest.getOutputLocation(), OUTPUTLOCATION_BINDING); |
438,620 | public List<PartitionUpdateParam> split() {<NEW_LINE>// split updates<NEW_LINE>Map<PartitionKey, List<RowUpdateSplit>> partToSplits = new HashMap<>(getPartsNum(matrixId));<NEW_LINE>for (int i = 0; i < updates.length; i++) {<NEW_LINE>if (updates[i] != null) {<NEW_LINE>mergeRowUpdateSplits(RowUpdateSplitUtils.split(updates[i], getParts(matrixId, updates[i].getRowId())), partToSplits);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// shuffle update splits<NEW_LINE>shuffleSplits(partToSplits);<NEW_LINE>// generate part update splits<NEW_LINE>List<PartitionUpdateParam> partParams = new ArrayList<>(partToSplits.size());<NEW_LINE>for (Map.Entry<PartitionKey, List<RowUpdateSplit>> partEntry : partToSplits.entrySet()) {<NEW_LINE>// set split context: partition key, use int key for long key vector or net<NEW_LINE>adapt(partEntry.getKey(<MASK><NEW_LINE>partParams.add(new PartAsyncOptimParam(matrixId, partEntry.getKey(), partEntry.getValue(), doubles, ints));<NEW_LINE>}<NEW_LINE>return partParams;<NEW_LINE>} | ), partEntry.getValue()); |
1,163,616 | public static PageImpl<UKDataBean> dissearch(String orgi, FormFilter formFilter, List<FormFilterItem> itemList, MetadataTable metadataTable, int p, int ps) {<NEW_LINE>BoolQueryBuilder queryBuilder = new BoolQueryBuilder();<NEW_LINE>queryBuilder.must(termQuery("orgi", orgi));<NEW_LINE>queryBuilder.must(QueryBuilders.termQuery("status", MainContext.NamesDisStatusType<MASK><NEW_LINE>queryBuilder.must(termQuery("validresult", "valid"));<NEW_LINE>BoolQueryBuilder orBuilder = new BoolQueryBuilder();<NEW_LINE>int orNums = 0;<NEW_LINE>for (FormFilterItem formFilterItem : itemList) {<NEW_LINE>QueryBuilder tempQueryBuilder = null;<NEW_LINE>if (formFilterItem.getField().equals("q")) {<NEW_LINE>tempQueryBuilder = new QueryStringQueryBuilder(formFilterItem.getValue()).defaultOperator(Operator.AND);<NEW_LINE>} else {<NEW_LINE>switch(formFilterItem.getCond()) {<NEW_LINE>case "01":<NEW_LINE>tempQueryBuilder = rangeQuery(formFilterItem.getField()).from(formFilterItem.getValue()).includeLower(false);<NEW_LINE>break;<NEW_LINE>case "02":<NEW_LINE>tempQueryBuilder = rangeQuery(formFilterItem.getField()).from(formFilterItem.getValue()).includeLower(true);<NEW_LINE>break;<NEW_LINE>case "03":<NEW_LINE>tempQueryBuilder = rangeQuery(formFilterItem.getField()).to(formFilterItem.getValue()).includeUpper(false);<NEW_LINE>break;<NEW_LINE>case "04":<NEW_LINE>tempQueryBuilder = rangeQuery(formFilterItem.getField()).to(formFilterItem.getValue()).includeUpper(true);<NEW_LINE>break;<NEW_LINE>case "05":<NEW_LINE>tempQueryBuilder = termQuery(formFilterItem.getField(), formFilterItem.getValue());<NEW_LINE>break;<NEW_LINE>case "06":<NEW_LINE>tempQueryBuilder = termQuery(formFilterItem.getField(), formFilterItem.getValue());<NEW_LINE>break;<NEW_LINE>case "07":<NEW_LINE>tempQueryBuilder = new QueryStringQueryBuilder(formFilterItem.getValue()).field(formFilterItem.getField()).defaultOperator(Operator.AND);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if ("AND".equalsIgnoreCase(formFilterItem.getComp())) {<NEW_LINE>if ("06".equals(formFilterItem.getCond())) {<NEW_LINE>queryBuilder.mustNot(tempQueryBuilder);<NEW_LINE>} else {<NEW_LINE>queryBuilder.must(tempQueryBuilder);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>orNums++;<NEW_LINE>if ("06".equals(formFilterItem.getCond())) {<NEW_LINE>orBuilder.mustNot(tempQueryBuilder);<NEW_LINE>} else {<NEW_LINE>orBuilder.should(tempQueryBuilder);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (orNums > 0) {<NEW_LINE>queryBuilder.must(orBuilder);<NEW_LINE>}<NEW_LINE>return search(queryBuilder, metadataTable, false, p, ps);<NEW_LINE>} | .NOT.toString())); |
764,701 | public Set<? extends TCReferable> update(TCReferable definition) {<NEW_LINE>if (definition instanceof TCDefReferable && ((TCDefReferable) definition).getTypechecked() == null) {<NEW_LINE>return Collections.emptySet();<NEW_LINE>}<NEW_LINE>Set<TCReferable> updated = new HashSet<>();<NEW_LINE>Stack<TCReferable> stack = new Stack<>();<NEW_LINE>stack.push(definition);<NEW_LINE>while (!stack.isEmpty()) {<NEW_LINE>TCReferable toUpdate = stack.pop();<NEW_LINE>if (!updated.add(toUpdate)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Set<TCReferable> dependencies;<NEW_LINE>if (toUpdate instanceof MetaReferable) {<NEW_LINE>MetaDefinition metaDef = ((MetaReferable) toUpdate).getDefinition();<NEW_LINE>if (metaDef instanceof DefinableMetaDefinition) {<NEW_LINE>dependencies = new HashSet<>();<NEW_LINE>((DefinableMetaDefinition) metaDef).accept(new CollectDefCallsVisitor(dependencies, true), null);<NEW_LINE>} else {<NEW_LINE>dependencies = null;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>dependencies = myDependencies.remove(toUpdate);<NEW_LINE>}<NEW_LINE>if (dependencies != null) {<NEW_LINE>for (TCReferable dependency : dependencies) {<NEW_LINE>Set<TCReferable> definitions = myReverseDependencies.get(dependency);<NEW_LINE>if (definitions != null) {<NEW_LINE>definitions.remove(definition);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Set<TCReferable> reverseDependencies = myReverseDependencies.remove(toUpdate);<NEW_LINE>if (reverseDependencies != null) {<NEW_LINE>stack.addAll(reverseDependencies);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Set<TCReferable> additional = new HashSet<>();<NEW_LINE>for (TCReferable updatedDef : updated) {<NEW_LINE>if (!(updatedDef instanceof TCDefReferable)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Definition def = ((TCDefReferable) updatedDef).getTypechecked();<NEW_LINE>((TCDefReferable) updatedDef).dropAndCancelTypechecking();<NEW_LINE>if (def instanceof ClassDefinition) {<NEW_LINE>for (ClassField field : ((ClassDefinition) def).getPersonalFields()) {<NEW_LINE>field.getReferable().dropAndCancelTypechecking();<NEW_LINE>additional.<MASK><NEW_LINE>}<NEW_LINE>} else if (def instanceof DataDefinition) {<NEW_LINE>for (Constructor constructor : ((DataDefinition) def).getConstructors()) {<NEW_LINE>constructor.getReferable().dropAndCancelTypechecking();<NEW_LINE>additional.add(constructor.getReferable());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>updated.addAll(additional);<NEW_LINE>return updated;<NEW_LINE>} | add(field.getReferable()); |
601,471 | private void checkKafkaReplicationConfig(List<Condition> warnings) {<NEW_LINE>String defaultReplicationFactor = kafkaCluster.getConfiguration().getConfigOption(KafkaConfiguration.DEFAULT_REPLICATION_FACTOR);<NEW_LINE>String minInsyncReplicas = kafkaCluster.getConfiguration(<MASK><NEW_LINE>if (defaultReplicationFactor == null && kafkaCluster.getReplicas() > 1) {<NEW_LINE>warnings.add(StatusUtils.buildWarningCondition("KafkaDefaultReplicationFactor", "default.replication.factor option is not configured. " + "It defaults to 1 which does not guarantee reliability and availability. " + "You should configure this option in .spec.kafka.config."));<NEW_LINE>}<NEW_LINE>if (minInsyncReplicas == null && kafkaCluster.getReplicas() > 1) {<NEW_LINE>warnings.add(StatusUtils.buildWarningCondition("KafkaMinInsyncReplicas", "min.insync.replicas option is not configured. " + "It defaults to 1 which does not guarantee reliability and availability. " + "You should configure this option in .spec.kafka.config."));<NEW_LINE>}<NEW_LINE>} | ).getConfigOption(KafkaConfiguration.MIN_INSYNC_REPLICAS); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.