idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
1,804,584 | public static List<Types.Field> applyAddChange2Fields(List<Types.Field> fields, ArrayList<Types.Field> adds, ArrayList<TableChange.ColumnPositionChange> pchanges) {<NEW_LINE>if (adds == null && pchanges == null) {<NEW_LINE>return fields;<NEW_LINE>}<NEW_LINE>LinkedList<Types.Field> result = new LinkedList<>(fields);<NEW_LINE>// apply add columns<NEW_LINE>if (adds != null && !adds.isEmpty()) {<NEW_LINE>result.addAll(adds);<NEW_LINE>}<NEW_LINE>// apply position change<NEW_LINE>if (pchanges != null && !pchanges.isEmpty()) {<NEW_LINE>for (TableChange.ColumnPositionChange pchange : pchanges) {<NEW_LINE>Types.Field srcField = result.stream().filter(f -> f.fieldId() == pchange.getSrcId()).findFirst().get();<NEW_LINE>Types.Field dsrField = result.stream().filter(f -> f.fieldId() == pchange.getDsrId()).findFirst().orElse(null);<NEW_LINE>// we remove srcField first<NEW_LINE>result.remove(srcField);<NEW_LINE>switch(pchange.type()) {<NEW_LINE>case AFTER:<NEW_LINE>// add srcField after dsrField<NEW_LINE>result.add(result.indexOf(dsrField) + 1, srcField);<NEW_LINE>break;<NEW_LINE>case BEFORE:<NEW_LINE>// add srcField before dsrField<NEW_LINE>result.add(result<MASK><NEW_LINE>break;<NEW_LINE>case FIRST:<NEW_LINE>result.addFirst(srcField);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | .indexOf(dsrField), srcField); |
342,652 | final PutJobFailureResultResult executePutJobFailureResult(PutJobFailureResultRequest putJobFailureResultRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(putJobFailureResultRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<PutJobFailureResultRequest> request = null;<NEW_LINE>Response<PutJobFailureResultResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new PutJobFailureResultRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(putJobFailureResultRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CodePipeline");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "PutJobFailureResult");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<PutJobFailureResultResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new PutJobFailureResultResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint); |
386,679 | public void signDataVerifyData() throws NoSuchAlgorithmException {<NEW_LINE>CryptographyClient cryptographyClient = createClient();<NEW_LINE>// BEGIN: com.azure.security.keyvault.keys.cryptography.CryptographyClient.signData#SignatureAlgorithm-byte<NEW_LINE>byte[] data = new byte[100];<NEW_LINE>new Random(0x1234567L).nextBytes(data);<NEW_LINE>SignResult signResult = cryptographyClient.sign(SignatureAlgorithm.ES256, data);<NEW_LINE>System.out.printf("Received signature of length: %d, with algorithm: %s.%n", signResult.getSignature().length, signResult.getAlgorithm());<NEW_LINE>// END: com.azure.security.keyvault.keys.cryptography.CryptographyClient.signData#SignatureAlgorithm-byte<NEW_LINE>// BEGIN: com.azure.security.keyvault.keys.cryptography.CryptographyClient.signData#SignatureAlgorithm-byte-Context<NEW_LINE>byte[] plainTextData = new byte[100];<NEW_LINE>new Random(0x1234567L).nextBytes(plainTextData);<NEW_LINE>SignResult signingResult = cryptographyClient.sign(SignatureAlgorithm.ES256, plainTextData);<NEW_LINE>System.out.printf("Received signature of length: %d, with algorithm: %s.%n", signingResult.getSignature().length, new Context("key1", "value1"));<NEW_LINE>// END: com.azure.security.keyvault.keys.cryptography.CryptographyClient.signData#SignatureAlgorithm-byte-Context<NEW_LINE>byte[] signature = new byte[100];<NEW_LINE>// BEGIN: com.azure.security.keyvault.keys.cryptography.CryptographyClient.verifyData#SignatureAlgorithm-byte-byte<NEW_LINE>byte[] myData = new byte[100];<NEW_LINE>new Random(0x1234567L).nextBytes(myData);<NEW_LINE>// A signature can be obtained from the SignResult returned by the CryptographyClient.sign() operation.<NEW_LINE>VerifyResult verifyResult = cryptographyClient.verify(SignatureAlgorithm.ES256, myData, signature);<NEW_LINE>System.out.printf("Verification status: %s.%n", verifyResult.isValid());<NEW_LINE>// END: com.azure.security.keyvault.keys.cryptography.CryptographyClient.verifyData#SignatureAlgorithm-byte-byte<NEW_LINE>byte[] mySignature = new byte[100];<NEW_LINE>// BEGIN: com.azure.security.keyvault.keys.cryptography.CryptographyClient.verifyData#SignatureAlgorithm-byte-byte-Context<NEW_LINE>byte[] dataToVerify = new byte[100];<NEW_LINE>new Random(0x1234567L).nextBytes(dataToVerify);<NEW_LINE>// A signature can be obtained from the SignResult returned by the CryptographyClient.sign() operation.<NEW_LINE>VerifyResult verificationResult = cryptographyClient.verify(SignatureAlgorithm.ES256, dataToVerify, mySignature, new Context("key1", "value1"));<NEW_LINE>System.out.printf(<MASK><NEW_LINE>// END: com.azure.security.keyvault.keys.cryptography.CryptographyClient.verifyData#SignatureAlgorithm-byte-byte-Context<NEW_LINE>} | "Verification status: %s.%n", verificationResult.isValid()); |
1,785,278 | public static void main(String[] args) {<NEW_LINE>String url;<NEW_LINE>if (args.length == 0)<NEW_LINE>url = "jdbc:virtuoso://localhost:1111";<NEW_LINE>else<NEW_LINE>url = args[0];<NEW_LINE>Node foo1 = Node.createURI("http://example.org/#foo1");<NEW_LINE>Node bar1 = Node.createURI("http://example.org/#bar1");<NEW_LINE>Node baz1 = Node.createURI("http://example.org/#baz1");<NEW_LINE>Node foo2 = Node.createURI("http://example.org/#foo2");<NEW_LINE>Node bar2 = Node.createURI("http://example.org/#bar2");<NEW_LINE>Node baz2 = Node.createURI("http://example.org/#baz2");<NEW_LINE>Node foo3 = Node.createURI("http://example.org/#foo3");<NEW_LINE>Node bar3 = Node.createURI("http://example.org/#bar3");<NEW_LINE>Node <MASK><NEW_LINE>VirtGraph graph = new VirtGraph("Example6", url, "dba", "dba");<NEW_LINE>graph.clear();<NEW_LINE>System.out.println("graph.isEmpty() = " + graph.isEmpty());<NEW_LINE>System.out.println("test Transaction Commit.");<NEW_LINE>graph.getTransactionHandler().begin();<NEW_LINE>System.out.println("begin Transaction.");<NEW_LINE>System.out.println("Add 3 triples to graph <Example6>.");<NEW_LINE>graph.add(new Triple(foo1, bar1, baz1));<NEW_LINE>graph.add(new Triple(foo2, bar2, baz2));<NEW_LINE>graph.add(new Triple(foo3, bar3, baz3));<NEW_LINE>graph.getTransactionHandler().commit();<NEW_LINE>System.out.println("commit Transaction.");<NEW_LINE>System.out.println("graph.isEmpty() = " + graph.isEmpty());<NEW_LINE>System.out.println("graph.getCount() = " + graph.getCount());<NEW_LINE>ExtendedIterator iter = graph.find(Node.ANY, Node.ANY, Node.ANY);<NEW_LINE>System.out.println("\ngraph.find(Node.ANY, Node.ANY, Node.ANY) \nResult:");<NEW_LINE>for (; iter.hasNext(); ) System.out.println((Triple) iter.next());<NEW_LINE>graph.clear();<NEW_LINE>System.out.println("\nCLEAR graph <Example6>");<NEW_LINE>System.out.println("graph.isEmpty() = " + graph.isEmpty());<NEW_LINE>System.out.println("Add 1 triples to graph <Example6>.");<NEW_LINE>graph.add(new Triple(foo1, bar1, baz1));<NEW_LINE>System.out.println("\nStart test Transaction Abort.");<NEW_LINE>graph.getTransactionHandler().begin();<NEW_LINE>System.out.println("begin Transaction.");<NEW_LINE>System.out.println("Add 2 triples to graph <Example6>.");<NEW_LINE>graph.add(new Triple(foo2, bar2, baz2));<NEW_LINE>graph.add(new Triple(foo3, bar3, baz3));<NEW_LINE>graph.getTransactionHandler().abort();<NEW_LINE>System.out.println("abort Transaction.");<NEW_LINE>System.out.println("End test Transaction Abort.\n");<NEW_LINE>System.out.println("graph.isEmpty() = " + graph.isEmpty());<NEW_LINE>System.out.println("graph.getCount() = " + graph.getCount());<NEW_LINE>iter = graph.find(Node.ANY, Node.ANY, Node.ANY);<NEW_LINE>System.out.println("\ngraph.find(Node.ANY, Node.ANY, Node.ANY) \nResult:");<NEW_LINE>for (; iter.hasNext(); ) System.out.println((Triple) iter.next());<NEW_LINE>graph.clear();<NEW_LINE>System.out.println("\nCLEAR graph <Example6>");<NEW_LINE>} | baz3 = Node.createURI("http://example.org/#baz3"); |
1,642,460 | public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {<NEW_LINE><MASK><NEW_LINE>LinearLayout layout = new LinearLayout(context);<NEW_LINE>layout.setOrientation(LinearLayout.HORIZONTAL);<NEW_LINE>layout.setGravity(Gravity.CENTER_VERTICAL);<NEW_LINE>layout.setLayoutParams(new ViewGroup.LayoutParams(wrapContent, wrapContent));<NEW_LINE>TextView textView = new TextView(context);<NEW_LINE>LinearLayout.LayoutParams tvParams = new LinearLayout.LayoutParams(wrapContent, wrapContent);<NEW_LINE>textView.setLayoutParams(tvParams);<NEW_LINE>textView.setGravity(Gravity.START | Gravity.CENTER_VERTICAL);<NEW_LINE>int padding = (int) (5 * context.getResources().getDisplayMetrics().density);<NEW_LINE>textView.setPadding(padding, 0, padding, 0);<NEW_LINE>layout.addView(textView);<NEW_LINE>ImageView imageView = new ImageView(context);<NEW_LINE>int size = (int) (15 * context.getResources().getDisplayMetrics().density);<NEW_LINE>imageView.setLayoutParams(new LinearLayout.LayoutParams(size, size));<NEW_LINE>imageView.setScaleType(ImageView.ScaleType.FIT_XY);<NEW_LINE>layout.addView(imageView);<NEW_LINE>ViewHolder viewHolder = new ViewHolder(layout);<NEW_LINE>viewHolder.textView = textView;<NEW_LINE>viewHolder.imageView = imageView;<NEW_LINE>return viewHolder;<NEW_LINE>} | int wrapContent = ViewGroup.LayoutParams.WRAP_CONTENT; |
359,700 | public void send(Configurable configurable, String fromName, String to, List<String> cc, String subject, String text, Optional<String> html, Attachment... attachments) {<NEW_LINE>var conf = configurationManager.getFor(Set.of(SMTP_FROM_EMAIL, MAIL_REPLY_TO, SMTP_HOST, SMTP_PORT, SMTP_PROTOCOL, SMTP_USERNAME, SMTP_PASSWORD, SMTP_PROPERTIES), configurable.getConfigurationLevel());<NEW_LINE>MimeMessagePreparator preparator = mimeMessage -> {<NEW_LINE>MimeMessageHelper message = html.isPresent() || !ArrayUtils.isEmpty(attachments) ? new MimeMessageHelper(mimeMessage, true, "UTF-8") : new MimeMessageHelper(mimeMessage, "UTF-8");<NEW_LINE>message.setSubject(subject);<NEW_LINE>message.setFrom(conf.get(SMTP_FROM_EMAIL).getRequiredValue(), fromName);<NEW_LINE>String replyTo = conf.get(MAIL_REPLY_TO).getValueOrDefault("");<NEW_LINE>if (StringUtils.isNotBlank(replyTo)) {<NEW_LINE>message.setReplyTo(replyTo);<NEW_LINE>}<NEW_LINE>message.setTo(to);<NEW_LINE>if (cc != null && !cc.isEmpty()) {<NEW_LINE>message.setCc(cc.toArray(new String[0]));<NEW_LINE>}<NEW_LINE>if (html.isPresent()) {<NEW_LINE>message.setText(text, html.get());<NEW_LINE>} else {<NEW_LINE>message.setText(text, false);<NEW_LINE>}<NEW_LINE>if (attachments != null) {<NEW_LINE>for (Attachment a : attachments) {<NEW_LINE>message.addAttachment(a.getFilename(), new ByteArrayResource(a.getSource()<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>message.getMimeMessage().saveChanges();<NEW_LINE>message.getMimeMessage().removeHeader("Message-ID");<NEW_LINE>};<NEW_LINE>toMailSender(conf).send(preparator);<NEW_LINE>} | ), a.getContentType()); |
972,376 | public void deleteById(String id) {<NEW_LINE>String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));<NEW_LINE>}<NEW_LINE>String serviceName = <MASK><NEW_LINE>if (serviceName == null) {<NEW_LINE>throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id)));<NEW_LINE>}<NEW_LINE>String apiId = Utils.getValueFromIdByName(id, "apis");<NEW_LINE>if (apiId == null) {<NEW_LINE>throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'apis'.", id)));<NEW_LINE>}<NEW_LINE>String releaseId = Utils.getValueFromIdByName(id, "releases");<NEW_LINE>if (releaseId == null) {<NEW_LINE>throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'releases'.", id)));<NEW_LINE>}<NEW_LINE>String localIfMatch = null;<NEW_LINE>this.deleteWithResponse(resourceGroupName, serviceName, apiId, releaseId, localIfMatch, Context.NONE);<NEW_LINE>} | Utils.getValueFromIdByName(id, "service"); |
511,677 | public void addInvitedSignaling(MethodCall methodCall, final MethodChannel.Result result) {<NEW_LINE>HashMap<String, Object> info = CommonUtil.getParam(methodCall, result, "info");<NEW_LINE>V2TIMSignalingInfo param = new V2TIMSignalingInfo();<NEW_LINE>if (info.get("inviteID") != null) {<NEW_LINE>param.setInviteID((String) info.get("inviteID"));<NEW_LINE>}<NEW_LINE>if (info.get("groupID") != null) {<NEW_LINE>param.setGroupID((String) info.get("groupID"));<NEW_LINE>}<NEW_LINE>if (info.get("inviter") != null) {<NEW_LINE>param.setInviter((String) info.get("inviter"));<NEW_LINE>}<NEW_LINE>if (info.get("inviteeList") != null) {<NEW_LINE>param.setInviteeList((List<String>) info.get("inviteeList"));<NEW_LINE>}<NEW_LINE>if (info.get("data") != null) {<NEW_LINE>param.setData((String) info.get("data"));<NEW_LINE>}<NEW_LINE>if (info.get("timeout") != null) {<NEW_LINE>param.setTimeout((Integer) info.get("timeout"));<NEW_LINE>}<NEW_LINE>if (info.get("actionType") != null) {<NEW_LINE>param.setActionType((Integer) info.get("actionType"));<NEW_LINE>}<NEW_LINE>if (info.get("businessID") != null) {<NEW_LINE>param.setBusinessID((Integer<MASK><NEW_LINE>}<NEW_LINE>V2TIMManager.getSignalingManager().addInvitedSignaling(param, new V2TIMCallback() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onSuccess() {<NEW_LINE>CommonUtil.returnSuccess(result, null);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onError(int code, String desc) {<NEW_LINE>CommonUtil.returnError(result, code, desc);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | ) info.get("businessID")); |
1,409,500 | public void waitFor(Point point) throws InterruptedException, OptimizationException {<NEW_LINE>if (isOutsideRange(point)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (functionCache.containsKey(point)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Future<Double> future = futureMap.get(point);<NEW_LINE>if (future == null) {<NEW_LINE>throw new IllegalStateException("waitFor called for " + point + " but it is not being computed");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>double value = future.get();<NEW_LINE><MASK><NEW_LINE>} catch (ExecutionException e) {<NEW_LINE>Throwable cause = e.getCause();<NEW_LINE>if (cause instanceof InterruptedException) {<NEW_LINE>throw (InterruptedException) cause;<NEW_LINE>}<NEW_LINE>if (cause instanceof OptimizationException) {<NEW_LINE>throw (OptimizationException) cause;<NEW_LINE>}<NEW_LINE>if (cause instanceof RuntimeException) {<NEW_LINE>throw (RuntimeException) cause;<NEW_LINE>}<NEW_LINE>throw new BugException("Function threw unknown exception while processing", e);<NEW_LINE>}<NEW_LINE>} | functionCache.put(point, value); |
765,776 | public Future<Result> resolve() {<NEW_LINE>FutureTask<Result> task = new FutureTask<Result>(new Callable<Result>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Result call() throws Exception {<NEW_LINE>final Result[] res = new Result[1];<NEW_LINE>try {<NEW_LINE>SwingUtilities.invokeAndWait(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>Object retval = PluginManager.install(Collections.singleton(codenamebase));<NEW_LINE>res[0] = retval == null ? Result.create(Status.RESOLVED) : <MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (InterruptedException ex) {<NEW_LINE>res[0] = Result.create(Status.UNRESOLVED);<NEW_LINE>} catch (InvocationTargetException ex) {<NEW_LINE>res[0] = Result.create(Status.UNRESOLVED);<NEW_LINE>}<NEW_LINE>return res[0];<NEW_LINE>}<NEW_LINE>});<NEW_LINE>RP.execute(task);<NEW_LINE>return task;<NEW_LINE>} | Result.create(Status.UNRESOLVED); |
1,470,706 | public void authenticate(Context context, ActionListener<AuthenticationResult<Authentication>> listener) {<NEW_LINE>final AuthenticationToken authenticationToken = context.getMostRecentAuthenticationToken();<NEW_LINE>if (false == authenticationToken instanceof ApiKeyCredentials) {<NEW_LINE>listener.onResponse(AuthenticationResult.notHandled());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ApiKeyCredentials apiKeyCredentials = (ApiKeyCredentials) authenticationToken;<NEW_LINE>apiKeyService.tryAuthenticate(context.getThreadContext(), apiKeyCredentials, ActionListener.wrap(authResult -> {<NEW_LINE>if (authResult.isAuthenticated()) {<NEW_LINE>final Authentication authentication = <MASK><NEW_LINE>listener.onResponse(AuthenticationResult.success(authentication));<NEW_LINE>} else if (authResult.getStatus() == AuthenticationResult.Status.TERMINATE) {<NEW_LINE>Exception e = (authResult.getException() != null) ? authResult.getException() : Exceptions.authenticationError(authResult.getMessage());<NEW_LINE>logger.debug(new ParameterizedMessage("API key service terminated authentication for request [{}]", context.getRequest()), e);<NEW_LINE>listener.onFailure(e);<NEW_LINE>} else {<NEW_LINE>if (authResult.getMessage() != null) {<NEW_LINE>if (authResult.getException() != null) {<NEW_LINE>logger.warn(new ParameterizedMessage("Authentication using apikey failed - {}", authResult.getMessage()), authResult.getException());<NEW_LINE>} else {<NEW_LINE>logger.warn("Authentication using apikey failed - {}", authResult.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>listener.onResponse(AuthenticationResult.unsuccessful(authResult.getMessage(), authResult.getException()));<NEW_LINE>}<NEW_LINE>}, e -> listener.onFailure(context.getRequest().exceptionProcessingRequest(e, null))));<NEW_LINE>} | Authentication.newApiKeyAuthentication(authResult, nodeName); |
517,373 | public static void main(String[] args) {<NEW_LINE>try {<NEW_LINE>// 1) Creation options ODT 2 PDF to select well converter form the<NEW_LINE>// registry<NEW_LINE>Options options = Options.getFrom(DocumentKind.ODT).to(ConverterTypeTo.PDF);<NEW_LINE>// 2) Get the converter from the registry<NEW_LINE>IConverter converter = ConverterRegistry.getRegistry().getConverter(options);<NEW_LINE>// 3) Convert ODT 2 PDF<NEW_LINE>File out = new File("out");<NEW_LINE>if (!out.exists()) {<NEW_LINE>out.mkdir();<NEW_LINE>}<NEW_LINE>File file <MASK><NEW_LINE>converter.convert(ODTHelloWordWithFreemarker.class.getResourceAsStream("ODTHelloWordWithFreemarker.odt"), new FileOutputStream(file), options);<NEW_LINE>} catch (XDocConverterException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>} catch (FileNotFoundException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>} | = new File(out, "ODTHelloWord2PDF.pdf"); |
691,066 | public CodegenExpression evaluateGetCollEventsCodegen(CodegenMethodScope parent, ExprSubselectEvalMatchSymbol symbols, CodegenClassScope classScope) {<NEW_LINE>CodegenExpression aggService = classScope.getPackageScope().addOrGetFieldWellKnown(new CodegenFieldNameSubqueryAgg(subselect.getSubselectNumber()), AggregationResultFuture.EPTYPE);<NEW_LINE>CodegenExpressionField factory = classScope.addOrGetFieldSharable(EventBeanTypedEventFactoryCodegenField.INSTANCE);<NEW_LINE>CodegenExpressionField subselectMultirowType = classScope.addFieldUnshared(false, EventType.EPTYPE, EventTypeUtility.resolveTypeCodegen(subselect.subselectMultirowType, EPStatementInitServices.REF));<NEW_LINE>CodegenMethod method = parent.makeChild(EPTypePremade.COLLECTION.getEPType(), this.getClass(), classScope);<NEW_LINE>CodegenExpressionRef evalCtx = symbols.getAddExprEvalCtx(method);<NEW_LINE>method.getBlock().declareVar(EPTypePremade.INTEGERPRIMITIVE.getEPType(), "cpid", exprDotMethod(evalCtx, "getAgentInstanceId")).declareVar(AggregationService.EPTYPE, "aggregationService", exprDotMethod(aggService, "getContextPartitionAggregationService", ref("cpid"))).declareVar(EPTypePremade.COLLECTION.getEPType(), "groupKeys", exprDotMethod(ref("aggregationService"), "getGroupKeys", evalCtx)).ifCondition(exprDotMethod(ref("groupKeys"), "isEmpty")).blockReturn(constantNull()).applyTri(DECLARE_EVENTS_SHIFTED, method, symbols).declareVar(EPTypePremade.COLLECTION.getEPType(), "result", newInstance(EPTypePremade.ARRAYDEQUE.getEPType(), exprDotMethod(ref<MASK><NEW_LINE>CodegenBlock forEach = method.getBlock().forEach(EPTypePremade.OBJECT.getEPType(), "groupKey", ref("groupKeys"));<NEW_LINE>{<NEW_LINE>CodegenMethod havingExpr = CodegenLegoMethodExpression.codegenExpression(subselect.havingExpr, method, classScope);<NEW_LINE>CodegenExpression havingCall = localMethod(havingExpr, REF_EVENTS_SHIFTED, symbols.getAddIsNewData(method), evalCtx);<NEW_LINE>forEach.exprDotMethod(ref("aggregationService"), "setCurrentAccess", ref("groupKey"), ref("cpid"), constantNull()).declareVar(EPTypePremade.BOOLEANBOXED.getEPType(), "pass", cast(EPTypePremade.BOOLEANBOXED.getEPType(), havingCall)).ifCondition(and(notEqualsNull(ref("pass")), ref("pass"))).declareVar(EPTypePremade.MAP.getEPType(), "row", localMethod(subselect.evaluateRowCodegen(method, classScope), REF_EVENTS_SHIFTED, constantTrue(), symbols.getAddExprEvalCtx(method))).declareVar(EventBean.EPTYPE, "event", exprDotMethod(factory, "adapterForTypedMap", ref("row"), subselectMultirowType)).exprDotMethod(ref("result"), "add", ref("event"));<NEW_LINE>}<NEW_LINE>method.getBlock().methodReturn(ref("result"));<NEW_LINE>return localMethod(method);<NEW_LINE>} | ("groupKeys"), "size"))); |
1,391,458 | public static void startURL(Activity activity, Uri uri) {<NEW_LINE>CustomTabsIntent.Builder customTabsIntent = new CustomTabsIntent.Builder();<NEW_LINE>customTabsIntent.setShowTitle(true);<NEW_LINE>CustomTabColorSchemeParams params = new CustomTabColorSchemeParams.Builder().setToolbarColor(ResourceUtils.resolveColor(activity.getTheme(), android.R.attr.colorBackground)).setNavigationBarColor(ResourceUtils.resolveColor(activity.getTheme(), android.R.attr.navigationBarColor)).setNavigationBarDividerColor(0).build();<NEW_LINE>customTabsIntent.setDefaultColorSchemeParams(params);<NEW_LINE>boolean night = ResourceUtils.isNightMode(activity.getResources().getConfiguration());<NEW_LINE>customTabsIntent.setColorScheme(night ? CustomTabsIntent.COLOR_SCHEME_DARK : CustomTabsIntent.COLOR_SCHEME_LIGHT);<NEW_LINE>try {<NEW_LINE>customTabsIntent.build().launchUrl(activity, uri);<NEW_LINE>} catch (ActivityNotFoundException ignored) {<NEW_LINE>Toast.makeText(activity, uri.toString(), <MASK><NEW_LINE>}<NEW_LINE>} | Toast.LENGTH_SHORT).show(); |
164,883 | private void findBits(Set<CheerEmoticon> emotes, String text, Map<Integer, Integer> ranges, Map<Integer, MutableAttributeSet> rangesStyle, User user) {<NEW_LINE>for (CheerEmoticon emote : emotes) {<NEW_LINE>if (!emote.matchesUser(user, null)) {<NEW_LINE>// CONTINUE<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Matcher m = emote.getMatcher(text);<NEW_LINE>while (m.find()) {<NEW_LINE>int start = m.start();<NEW_LINE>int end = m.end() - 1;<NEW_LINE>try {<NEW_LINE>int bits = Integer.parseInt(m.group(1));<NEW_LINE>int bitsLength = m.group(1).length();<NEW_LINE>if (bits < emote.min_bits) {<NEW_LINE>// CONTINUE<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>boolean ignored = main.emoticons.isEmoteIgnored(emote);<NEW_LINE>if (!ignored && addEmoticon(emote, start, end - bitsLength, ranges, rangesStyle)) {<NEW_LINE>// Add emote<NEW_LINE>addFormattedText(emote.color, end - bitsLength + 1, end, ranges, rangesStyle);<NEW_LINE>} else {<NEW_LINE>// Add just text<NEW_LINE>addFormattedText(emote.color, start, end, ranges, rangesStyle);<NEW_LINE>}<NEW_LINE>} catch (NumberFormatException ex) {<NEW_LINE>System.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | out.println("Error parsing cheer: " + ex); |
610,933 | public DescribeClusterOperationResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DescribeClusterOperationResult describeClusterOperationResult = new DescribeClusterOperationResult();<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 describeClusterOperationResult;<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("clusterOperationInfo", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>describeClusterOperationResult.setClusterOperationInfo(ClusterOperationInfoJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return describeClusterOperationResult;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
106,372 | public void start() {<NEW_LINE>if (current != null) {<NEW_LINE>current.show();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Form hi = new Form("Hi World", new BorderLayout());<NEW_LINE>Picker picker = new Picker();<NEW_LINE>picker.setStrings("No cycle", "Repeat", "Reflect");<NEW_LINE>picker.addActionListener(e -> {<NEW_LINE>if ("No cycle".equals(picker.getValue())) {<NEW_LINE>cycleMethod = NO_CYCLE;<NEW_LINE>} else if ("Repeat".equals(picker.getValue())) {<NEW_LINE>cycleMethod = REPEAT;<NEW_LINE>} else if ("Reflect".equals(picker.getValue())) {<NEW_LINE>cycleMethod = REFLECT;<NEW_LINE>}<NEW_LINE>hi.repaint();<NEW_LINE>});<NEW_LINE>hi.add(BorderLayout.NORTH, BoxLayout.encloseY(new SpanLabel("Drag pointer below to generate gradients"), new Label("Gradient Cycle Type:"), picker));<NEW_LINE>hi.add(BorderLayout<MASK><NEW_LINE>hi.show();<NEW_LINE>} | .CENTER, new MyComponent()); |
1,741,793 | public void renderParticle(@Nonnull BufferBuilder worldRendererIn, @Nonnull Entity entityIn, float partialTicks, float rotationX, float rotationZ, float rotationYZ, float rotationXY, float rotationXZ) {<NEW_LINE>GlStateManager.pushMatrix();<NEW_LINE>GlStateManager.enableLighting();<NEW_LINE>GlStateManager.disableLighting();<NEW_LINE>GlStateManager.disableCull();<NEW_LINE>GlStateManager.enableBlend();<NEW_LINE>GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);<NEW_LINE>OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240, 240);<NEW_LINE>RenderUtil.bindBlockTexture();<NEW_LINE>GlStateManager.depthMask(false);<NEW_LINE>float scale = Math.min((age + partialTicks) / INIT_TIME, 1);<NEW_LINE>// Vanilla bug? Particle.interpPosX/Y/Z variables are always one frame behind<NEW_LINE>double x = entityIn.lastTickPosX + (entityIn.posX - entityIn.lastTickPosX) * partialTicks;<NEW_LINE>double y = entityIn.lastTickPosY + (entityIn.<MASK><NEW_LINE>double z = entityIn.lastTickPosZ + (entityIn.posZ - entityIn.lastTickPosZ) * partialTicks;<NEW_LINE>GlStateManager.translate(-x, -y, -z);<NEW_LINE>GlStateManager.color(color.x, color.y, color.z, color.w);<NEW_LINE>RenderUtil.renderBoundingBox(scale(owner.getPos(), getBounds(), scale).expand(0.01, 0.01, 0.01), IconUtil.instance.whiteTexture);<NEW_LINE>GlStateManager.depthMask(true);<NEW_LINE>GlStateManager.disableBlend();<NEW_LINE>GlStateManager.enableCull();<NEW_LINE>GlStateManager.enableLighting();<NEW_LINE>GlStateManager.popMatrix();<NEW_LINE>} | posY - entityIn.lastTickPosY) * partialTicks; |
1,025,151 | public ImportDataSource unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ImportDataSource importDataSource = new ImportDataSource();<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("dataSourceConfig", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>importDataSource.setDataSourceConfig(ImportDataSourceConfigJsonUnmarshaller.getInstance<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 importDataSource;<NEW_LINE>} | ().unmarshall(context)); |
1,795,484 | public void loadLibraries(ClassLoader cl) throws IOException {<NEW_LINE>assert cl != null;<NEW_LINE>Enumeration<URL> en = cl.getResources(LibIndex.DEFAULT_RESOURCE);<NEW_LINE>while (en.hasMoreElements()) {<NEW_LINE>URL url = en.nextElement();<NEW_LINE>LibIndex index = new <MASK><NEW_LINE>long created = index.getCreated();<NEW_LINE>for (LibIndex.Entry entry : index.getEntries()) {<NEW_LINE>String name = entry.getName();<NEW_LINE>File file = new File(parent, name);<NEW_LINE>logger.info("Loading native library: %s", file.getAbsolutePath());<NEW_LINE>if (file.exists() && file.lastModified() > created) {<NEW_LINE>// library is up to date<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>FileOutputStream out = null;<NEW_LINE>try {<NEW_LINE>out = new FileOutputStream(file);<NEW_LINE>Streams.tie(entry.openStream(cl), out);<NEW_LINE>loadedLibs.add(file);<NEW_LINE>} finally {<NEW_LINE>if (out != null) {<NEW_LINE>try {<NEW_LINE>out.close();<NEW_LINE>} catch (IOException e) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | LibIndex(url.openStream()); |
1,056,523 | static final FeatureDescriptor findFeatureDescriptor(PropertyDisplayer pd) {<NEW_LINE>if (pd instanceof EditorPropertyDisplayer) {<NEW_LINE>// Issue 38004, more gunk to ensure we get the right feature<NEW_LINE>// descriptor<NEW_LINE>EditorPropertyDisplayer epd = (EditorPropertyDisplayer) pd;<NEW_LINE>if (epd.modelRef != null) {<NEW_LINE>PropertyModel pm <MASK><NEW_LINE>if (pm instanceof ExPropertyModel) {<NEW_LINE>FeatureDescriptor fd = ((ExPropertyModel) pm).getFeatureDescriptor();<NEW_LINE>if (fd != null) {<NEW_LINE>return fd;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Property p = pd.getProperty();<NEW_LINE>if (p instanceof ModelProperty) {<NEW_LINE>return ((ModelProperty) p).getFeatureDescriptor();<NEW_LINE>} else if (p instanceof ModelProperty.DPMWrapper) {<NEW_LINE>return ((ModelProperty.DPMWrapper) p).getFeatureDescriptor();<NEW_LINE>} else {<NEW_LINE>return p;<NEW_LINE>}<NEW_LINE>} | = epd.modelRef.get(); |
1,004,001 | protected void consumeConstructorHeader() {<NEW_LINE>// ConstructorHeader ::= ConstructorHeaderName MethodHeaderParameters MethodHeaderThrowsClauseopt<NEW_LINE>AbstractMethodDeclaration method = (AbstractMethodDeclaration) this.astStack[this.astPtr];<NEW_LINE>if (this.currentToken == TokenNameLBRACE) {<NEW_LINE>method<MASK><NEW_LINE>}<NEW_LINE>// recovery<NEW_LINE>if (this.currentElement != null) {<NEW_LINE>if (this.currentToken == TokenNameSEMICOLON) {<NEW_LINE>// for invalid constructors<NEW_LINE>method.modifiers |= ExtraCompilerModifiers.AccSemicolonBody;<NEW_LINE>method.declarationSourceEnd = this.scanner.currentPosition - 1;<NEW_LINE>method.bodyEnd = this.scanner.currentPosition - 1;<NEW_LINE>if (this.currentElement.parseTree() == method && this.currentElement.parent != null) {<NEW_LINE>this.currentElement = this.currentElement.parent;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// used to avoid branching back into the regular automaton<NEW_LINE>this.restartRecovery = true;<NEW_LINE>}<NEW_LINE>} | .bodyStart = this.scanner.currentPosition; |
1,013,908 | private int path2(String beginWord, String endWord, List<String> wordList) {<NEW_LINE>// abc -> *bc, a*c, ab*<NEW_LINE>Map<String, List<String>> map1 = new HashMap<>(wordList.size());<NEW_LINE>// *bc -> abc, bbc, cbc<NEW_LINE>Map<String, List<String>> map2 = new HashMap<>(wordList.size() * 3);<NEW_LINE>for (String word : wordList) {<NEW_LINE>fillMap(map1, map2, word);<NEW_LINE>}<NEW_LINE>fillMap(map1, map2, beginWord);<NEW_LINE>if (map1.get(endWord) == null) {<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>// endWord -> *bc, a*c, ab*<NEW_LINE>Set<String> checkSet = new HashSet<>(map1.remove(endWord));<NEW_LINE>LinkedList<String> queue = new LinkedList<>();<NEW_LINE>queue.add(beginWord);<NEW_LINE>int step = 1;<NEW_LINE>while (!queue.isEmpty() && !map1.isEmpty()) {<NEW_LINE>step++;<NEW_LINE>int batch = queue.size();<NEW_LINE>for (int i = 0; i < batch; i++) {<NEW_LINE>String crt = queue.poll();<NEW_LINE>List<String> <MASK><NEW_LINE>if (paths == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>for (String path : paths) {<NEW_LINE>if (checkSet.contains(path)) {<NEW_LINE>return step;<NEW_LINE>}<NEW_LINE>for (String next : map2.get(path)) {<NEW_LINE>if (map1.containsKey(next)) {<NEW_LINE>queue.add(next);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return 0;<NEW_LINE>} | paths = map1.remove(crt); |
1,108,269 | public static boolean validateSignature(Transaction transaction, byte[] hash, AccountStore accountStore, DynamicPropertiesStore dynamicPropertiesStore) throws PermissionException, SignatureException, SignatureFormatException {<NEW_LINE>Transaction.Contract contract = transaction.getRawData().getContractList().get(0);<NEW_LINE>int permissionId = contract.getPermissionId();<NEW_LINE>byte[] owner = getOwner(contract);<NEW_LINE>AccountCapsule account = accountStore.get(owner);<NEW_LINE>Permission permission = null;<NEW_LINE>if (account == null) {<NEW_LINE>if (permissionId == 0) {<NEW_LINE>permission = AccountCapsule.getDefaultPermission<MASK><NEW_LINE>}<NEW_LINE>if (permissionId == 2) {<NEW_LINE>permission = AccountCapsule.createDefaultActivePermission(ByteString.copyFrom(owner), dynamicPropertiesStore);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>permission = account.getPermissionById(permissionId);<NEW_LINE>}<NEW_LINE>if (permission == null) {<NEW_LINE>throw new PermissionException("permission isn't exit");<NEW_LINE>}<NEW_LINE>checkPermission(permissionId, permission, contract);<NEW_LINE>long weight = checkWeight(permission, transaction.getSignatureList(), hash, null);<NEW_LINE>if (weight >= permission.getThreshold()) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | (ByteString.copyFrom(owner)); |
1,462,153 | private // F61004.1<NEW_LINE>void simulateCommitBean(BeanO beanO, ContainerTx containerTx) {<NEW_LINE>final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();<NEW_LINE>if (isTraceOn && tc.isEntryEnabled())<NEW_LINE>Tr.entry(tc, "simulateCommitBean");<NEW_LINE>// React to exceptions the same as afterCompletion, insure<NEW_LINE>// both commit and commitBean are called. F743-22462.CR<NEW_LINE>try {<NEW_LINE>beanO.commit(containerTx);<NEW_LINE>} catch (Throwable ex) {<NEW_LINE>FFDCFilter.processException(ex, CLASS_NAME + ".simulateCommitBean", "5300", new Object[] { this, beanO });<NEW_LINE>if (isTraceOn && tc.isEventEnabled())<NEW_LINE>Tr.event(tc, "Exception thrown from BeanO.commit()", new Object[] { beanO, ex });<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>activator.commitBean(containerTx, beanO);<NEW_LINE>} catch (Throwable ex) {<NEW_LINE>FFDCFilter.processException(ex, CLASS_NAME + ".simulateCommitBean", "5313", new Object<MASK><NEW_LINE>if (isTraceOn && tc.isEventEnabled())<NEW_LINE>Tr.event(tc, "Exception thrown from commitBean()", new Object[] { beanO, ex });<NEW_LINE>}<NEW_LINE>if (isTraceOn && tc.isEntryEnabled())<NEW_LINE>Tr.exit(tc, "simulateCommitBean");<NEW_LINE>} | [] { this, beanO }); |
850,908 | public float noise(float x, float y) {<NEW_LINE>float xMod = TeraMath.modulus(x, sampleRate);<NEW_LINE>float yMod = TeraMath.modulus(y, sampleRate);<NEW_LINE>float x0 = x - xMod;<NEW_LINE>float x1 = x0 + sampleRate;<NEW_LINE>float y0 = y - yMod;<NEW_LINE>float y1 = y0 + sampleRate;<NEW_LINE>float q00 = source.noise(x0 * zoom.<MASK><NEW_LINE>float q10 = source.noise(x1 * zoom.x, y0 * zoom.y);<NEW_LINE>float q01 = source.noise(x0 * zoom.x, y1 * zoom.y);<NEW_LINE>float q11 = source.noise(x1 * zoom.x, y1 * zoom.y);<NEW_LINE>return TeraMath.biLerp(q00, q10, q01, q11, xMod / sampleRate, yMod / sampleRate);<NEW_LINE>} | x, y0 * zoom.y); |
127,954 | public void execute(final LanguageSourceSet languageSourceSet) {<NEW_LINE>final DependentSourceSet dependentSourceSet = (DependentSourceSet) languageSourceSet;<NEW_LINE>if (dependentSourceSet.getPreCompiledHeader() != null) {<NEW_LINE>nativeBinarySpec.addPreCompiledHeaderFor(dependentSourceSet);<NEW_LINE>final SourceTransformTaskConfig pchTransformTaskConfig = transform.getPchTransformTask();<NEW_LINE>String pchTaskName = pchTransformTaskConfig.getTaskPrefix() + StringUtils.capitalize(nativeBinarySpec.getProjectScopedName()) + StringUtils.capitalize(dependentSourceSet.getName()) + "PreCompiledHeader";<NEW_LINE>Task pchTask = tasks.create(pchTaskName, pchTransformTaskConfig.getTaskType(), new Action<DefaultTask>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void execute(DefaultTask task) {<NEW_LINE>pchTransformTaskConfig.configureTask(task, nativeBinarySpec, dependentSourceSet, serviceRegistry);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>nativeBinarySpec.<MASK><NEW_LINE>}<NEW_LINE>} | getTasks().add(pchTask); |
442,330 | public void assignValue(JBlock targetBlock, IJAssignmentTarget fieldRef, EComponentWithViewSupportHolder holder, Element element, Element param) {<NEW_LINE>TypeMirror elementType = param.asType();<NEW_LINE>String typeQualifiedName = elementType.toString();<NEW_LINE>TypeElement nativeFragmentElement = <MASK><NEW_LINE>boolean isNativeFragment = nativeFragmentElement != null && annotationHelper.isSubtype(elementType, nativeFragmentElement.asType());<NEW_LINE>String fieldName = element.getSimpleName().toString();<NEW_LINE>if (holder instanceof EFragmentHolder) {<NEW_LINE>boolean childFragment = annotationHelper.extractAnnotationParameter(element, "childFragment");<NEW_LINE>String fragmentManagerGetter = childFragment ? "getChildFragmentManager" : "getFragmentManager";<NEW_LINE>targetBlock.add(fieldRef.assign(cast(getJClass(typeQualifiedName), invoke(fragmentManagerGetter).invoke(findFragmentMethodName).arg(getFragmentId(element, fieldName)))));<NEW_LINE>} else {<NEW_LINE>JMethod findFragmentMethod = getFindFragmentMethod(isNativeFragment, holder);<NEW_LINE>targetBlock.add(fieldRef.assign(cast(getJClass(typeQualifiedName), invoke(findFragmentMethod).arg(getFragmentId(element, fieldName)))));<NEW_LINE>}<NEW_LINE>} | annotationHelper.typeElementFromQualifiedName(CanonicalNameConstants.FRAGMENT); |
1,364,664 | protected void registerDefaultRecipes() {<NEW_LINE>registerRecipe(12, new ItemStack[] { SlimefunItems.TIN_CAN, new ItemStack(Material.WHEAT) }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.WHEAT_ORGANIC_FOOD, OrganicFood.OUTPUT) });<NEW_LINE>registerRecipe(12, new ItemStack[] { SlimefunItems.TIN_CAN, new ItemStack(Material.CARROT) }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.CARROT_ORGANIC_FOOD, OrganicFood.OUTPUT) });<NEW_LINE>registerRecipe(12, new ItemStack[] { SlimefunItems.TIN_CAN, new ItemStack(Material.POTATO) }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.POTATO_ORGANIC_FOOD, OrganicFood.OUTPUT) });<NEW_LINE>registerRecipe(12, new ItemStack[] { SlimefunItems.TIN_CAN, new ItemStack(Material.WHEAT_SEEDS) }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.SEEDS_ORGANIC_FOOD, OrganicFood.OUTPUT) });<NEW_LINE>registerRecipe(12, new ItemStack[] { SlimefunItems.TIN_CAN, new ItemStack(Material.BEETROOT) }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.BEETROOT_ORGANIC_FOOD, OrganicFood.OUTPUT) });<NEW_LINE>registerRecipe(12, new ItemStack[] { SlimefunItems.TIN_CAN, new ItemStack(Material.MELON_SLICE) }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.MELON_ORGANIC_FOOD, OrganicFood.OUTPUT) });<NEW_LINE>registerRecipe(12, new ItemStack[] { SlimefunItems.TIN_CAN, new ItemStack(Material.APPLE) }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.APPLE_ORGANIC_FOOD, OrganicFood.OUTPUT) });<NEW_LINE>registerRecipe(12, new ItemStack[] { SlimefunItems.TIN_CAN, new ItemStack(Material.DRIED_KELP) }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.KELP_ORGANIC_FOOD, OrganicFood.OUTPUT) });<NEW_LINE>registerRecipe(12, new ItemStack[] { SlimefunItems.TIN_CAN, new ItemStack(Material.COCOA_BEANS) }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.COCOA_ORGANIC_FOOD, OrganicFood.OUTPUT) });<NEW_LINE>registerRecipe(12, new ItemStack[] { SlimefunItems.TIN_CAN, new ItemStack(Material.SWEET_BERRIES) }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.<MASK><NEW_LINE>} | SWEET_BERRIES_ORGANIC_FOOD, OrganicFood.OUTPUT) }); |
1,058,787 | public void marshall(CreateLocationFsxWindowsRequest createLocationFsxWindowsRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (createLocationFsxWindowsRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(createLocationFsxWindowsRequest.getSubdirectory(), SUBDIRECTORY_BINDING);<NEW_LINE>protocolMarshaller.marshall(createLocationFsxWindowsRequest.getFsxFilesystemArn(), FSXFILESYSTEMARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(createLocationFsxWindowsRequest.getTags(), TAGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createLocationFsxWindowsRequest.getUser(), USER_BINDING);<NEW_LINE>protocolMarshaller.marshall(createLocationFsxWindowsRequest.getDomain(), DOMAIN_BINDING);<NEW_LINE>protocolMarshaller.marshall(createLocationFsxWindowsRequest.getPassword(), PASSWORD_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | createLocationFsxWindowsRequest.getSecurityGroupArns(), SECURITYGROUPARNS_BINDING); |
470,578 | public static ListFlowRulesOfAppResponse unmarshall(ListFlowRulesOfAppResponse listFlowRulesOfAppResponse, UnmarshallerContext _ctx) {<NEW_LINE>listFlowRulesOfAppResponse.setRequestId(_ctx.stringValue("ListFlowRulesOfAppResponse.RequestId"));<NEW_LINE>listFlowRulesOfAppResponse.setCode(_ctx.stringValue("ListFlowRulesOfAppResponse.Code"));<NEW_LINE>listFlowRulesOfAppResponse.setMessage(_ctx.stringValue("ListFlowRulesOfAppResponse.Message"));<NEW_LINE>listFlowRulesOfAppResponse.setSuccess(_ctx.booleanValue("ListFlowRulesOfAppResponse.Success"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setPageIndex(_ctx.integerValue("ListFlowRulesOfAppResponse.Data.PageIndex"));<NEW_LINE>data.setPageSize(_ctx.integerValue("ListFlowRulesOfAppResponse.Data.PageSize"));<NEW_LINE>data.setTotalCount(_ctx.integerValue("ListFlowRulesOfAppResponse.Data.TotalCount"));<NEW_LINE>data.setTotalPage(_ctx.integerValue("ListFlowRulesOfAppResponse.Data.TotalPage"));<NEW_LINE>List<DatasItem> datas = new ArrayList<DatasItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListFlowRulesOfAppResponse.Data.Datas.Length"); i++) {<NEW_LINE>DatasItem datasItem = new DatasItem();<NEW_LINE>datasItem.setRuleId(_ctx.longValue("ListFlowRulesOfAppResponse.Data.Datas[" + i + "].RuleId"));<NEW_LINE>datasItem.setAppName(_ctx.stringValue("ListFlowRulesOfAppResponse.Data.Datas[" + i + "].AppName"));<NEW_LINE>datasItem.setNamespace(_ctx.stringValue("ListFlowRulesOfAppResponse.Data.Datas[" + i + "].Namespace"));<NEW_LINE>datasItem.setRefResource(_ctx.stringValue<MASK><NEW_LINE>datasItem.setResource(_ctx.stringValue("ListFlowRulesOfAppResponse.Data.Datas[" + i + "].Resource"));<NEW_LINE>datasItem.setLimitOrigin(_ctx.stringValue("ListFlowRulesOfAppResponse.Data.Datas[" + i + "].LimitOrigin"));<NEW_LINE>datasItem.setControlBehavior(_ctx.integerValue("ListFlowRulesOfAppResponse.Data.Datas[" + i + "].ControlBehavior"));<NEW_LINE>datasItem.setRelationStrategy(_ctx.integerValue("ListFlowRulesOfAppResponse.Data.Datas[" + i + "].RelationStrategy"));<NEW_LINE>datasItem.setThreshold(_ctx.floatValue("ListFlowRulesOfAppResponse.Data.Datas[" + i + "].Threshold"));<NEW_LINE>datasItem.setEnable(_ctx.booleanValue("ListFlowRulesOfAppResponse.Data.Datas[" + i + "].Enable"));<NEW_LINE>datasItem.setMaxQueueingTimeMs(_ctx.integerValue("ListFlowRulesOfAppResponse.Data.Datas[" + i + "].MaxQueueingTimeMs"));<NEW_LINE>datasItem.setWarmUpPeriodSec(_ctx.integerValue("ListFlowRulesOfAppResponse.Data.Datas[" + i + "].WarmUpPeriodSec"));<NEW_LINE>datasItem.setClusterMode(_ctx.booleanValue("ListFlowRulesOfAppResponse.Data.Datas[" + i + "].ClusterMode"));<NEW_LINE>datasItem.setClusterThresholdType(_ctx.integerValue("ListFlowRulesOfAppResponse.Data.Datas[" + i + "].ClusterThresholdType"));<NEW_LINE>datasItem.setClusterFallbackStrategy(_ctx.integerValue("ListFlowRulesOfAppResponse.Data.Datas[" + i + "].ClusterFallbackStrategy"));<NEW_LINE>datasItem.setClusterFallbackThreshold(_ctx.integerValue("ListFlowRulesOfAppResponse.Data.Datas[" + i + "].ClusterFallbackThreshold"));<NEW_LINE>datasItem.setStatDurationMs(_ctx.integerValue("ListFlowRulesOfAppResponse.Data.Datas[" + i + "].StatDurationMs"));<NEW_LINE>datasItem.setClusterEstimatedMaxQps(_ctx.floatValue("ListFlowRulesOfAppResponse.Data.Datas[" + i + "].ClusterEstimatedMaxQps"));<NEW_LINE>datas.add(datasItem);<NEW_LINE>}<NEW_LINE>data.setDatas(datas);<NEW_LINE>listFlowRulesOfAppResponse.setData(data);<NEW_LINE>return listFlowRulesOfAppResponse;<NEW_LINE>} | ("ListFlowRulesOfAppResponse.Data.Datas[" + i + "].RefResource")); |
1,819,851 | private void addMethods(RpcConnector connector) {<NEW_LINE>// Add/replace this method first to increase likelihood of getting extra metrics and global dimensions<NEW_LINE>connector.addMethod(new Method("setExtraMetrics", "s", "", this::setExtraMetrics).methodDesc("Set extra metrics that will be added to output from getMetricsForYamas.").paramDesc<MASK><NEW_LINE>connector.addMethod(new Method("purgeExtraMetrics", "", "", this::purgeExtraMetrics).methodDesc("Purge metrics and dimensions populated by setExtraMetrics"));<NEW_LINE>connector.addMethod(new Method("getMetricsById", "s", "s", this::getMetricsById).methodDesc("Get Vespa metrics for the service with the given Id").paramDesc(0, "id", "The id of the service").returnDesc(0, "ret", "Vespa metrics"));<NEW_LINE>connector.addMethod(new Method("getServices", "", "s", this::getServices).methodDesc("Get Vespa services monitored by this metrics proxy").returnDesc(0, "ret", "Vespa metrics"));<NEW_LINE>connector.addMethod(new Method("getMetricsForYamas", "s", "s", this::getMetricsForYamas).methodDesc("Get JSON formatted Vespa metrics for a given service name or 'all'").paramDesc(0, "service", "The vespa service name, or 'all'").returnDesc(0, "ret", "Vespa metrics"));<NEW_LINE>connector.addMethod(new Method("getHealthMetricsForYamas", "s", "s", this::getHealthMetricsForYamas).methodDesc("Get JSON formatted Health check for a given service name or 'all'").paramDesc(0, "service", "The vespa service name").returnDesc(0, "ret", "Vespa metrics"));<NEW_LINE>connector.addMethod(new Method("getAllMetricNamesForService", "ss", "s", this::getAllMetricNamesForService).methodDesc("Get metric names known for service ").paramDesc(0, "service", "The vespa service name'").paramDesc(1, "consumer", "The consumer'").returnDesc(0, "ret", "Metric names, one metric name per line"));<NEW_LINE>} | (0, "metricsJson", "The metrics in json format")); |
210,709 | public void generateExport(final CsvWriter csvWriter) throws ExporterException {<NEW_LINE>try {<NEW_LINE>List<String> names = Arrays.asList(mContext.getResources().getStringArray(R.array.csv_account_headers));<NEW_LINE>List<Account> accounts = mAccountsDbAdapter.getAllRecords();<NEW_LINE>for (int i = 0; i < names.size(); i++) {<NEW_LINE>csvWriter.writeToken(names.get(i));<NEW_LINE>}<NEW_LINE>csvWriter.newLine();<NEW_LINE>for (Account account : accounts) {<NEW_LINE>csvWriter.writeToken(account.getAccountType().toString());<NEW_LINE>csvWriter.writeToken(account.getFullName());<NEW_LINE>csvWriter.writeToken(account.getName());<NEW_LINE>// Account code<NEW_LINE>csvWriter.writeToken(null);<NEW_LINE>csvWriter.writeToken(account.getDescription());<NEW_LINE>csvWriter.<MASK><NEW_LINE>// Account notes<NEW_LINE>csvWriter.writeToken(null);<NEW_LINE>csvWriter.writeToken(account.getCommodity().getCurrencyCode());<NEW_LINE>csvWriter.writeToken("CURRENCY");<NEW_LINE>csvWriter.writeToken(account.isHidden() ? "T" : "F");<NEW_LINE>// Tax<NEW_LINE>csvWriter.writeToken("F");<NEW_LINE>csvWriter.writeEndToken(account.isPlaceholderAccount() ? "T" : "F");<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>Crashlytics.logException(e);<NEW_LINE>throw new ExporterException(mExportParams, e);<NEW_LINE>}<NEW_LINE>} | writeToken(account.getColorHexString()); |
692,829 | // Inject a new submission<NEW_LINE>public String injestNewSubmission(WorkItem item) {<NEW_LINE>Connection c = null;<NEW_LINE>int rowCount = 0;<NEW_LINE>try {<NEW_LINE>// Create a Connection object<NEW_LINE>c = ConnectionHelper.getConnection();<NEW_LINE>// Use a prepared statement<NEW_LINE>PreparedStatement ps = null;<NEW_LINE>// Convert rev to int<NEW_LINE>String name = item.getName();<NEW_LINE>String guide = item.getGuide();<NEW_LINE>String description = item.getDescription();<NEW_LINE>String status = item.getStatus();<NEW_LINE>// generate the work item ID<NEW_LINE>UUID uuid = UUID.randomUUID();<NEW_LINE>String workId = uuid.toString();<NEW_LINE>// Date conversion<NEW_LINE>SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");<NEW_LINE>DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss");<NEW_LINE>LocalDateTime now = LocalDateTime.now();<NEW_LINE>String sDate1 = dtf.format(now);<NEW_LINE>Date date1 = new SimpleDateFormat("yyyy/MM/dd").parse(sDate1);<NEW_LINE>java.sql.Date sqlDate = new java.sql.Date(date1.getTime());<NEW_LINE>// Inject an item into the system<NEW_LINE>String insert = "INSERT INTO work (idwork, username,date,description, guide, status, archive) VALUES(?,?, ?,?,?,?,?);";<NEW_LINE>ps = c.prepareStatement(insert);<NEW_LINE>ps.setString(1, workId);<NEW_LINE>ps.setString(2, name);<NEW_LINE>ps.setDate(3, sqlDate);<NEW_LINE>ps.setString(4, description);<NEW_LINE>ps.setString(5, guide);<NEW_LINE><MASK><NEW_LINE>ps.setBoolean(7, false);<NEW_LINE>ps.execute();<NEW_LINE>return workId;<NEW_LINE>} catch (SQLException | ParseException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>} finally {<NEW_LINE>ConnectionHelper.close(c);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | ps.setString(6, status); |
100,046 | public Cursor handle(RelNode logicalPlan, ExecutionContext executionContext) {<NEW_LINE>String appName = executionContext.getAppName();<NEW_LINE>RecycleBin bin = <MASK><NEW_LINE>if (bin == null) {<NEW_LINE>throw new TddlRuntimeException(ErrorCode.ERR_RECYCLEBIN_EXECUTE, "can't find recycle bin");<NEW_LINE>}<NEW_LINE>ArrayResultCursor result = new ArrayResultCursor("RECYCLEBIN");<NEW_LINE>result.addColumn("Id", DataTypes.IntegerType);<NEW_LINE>result.addColumn("NAME", DataTypes.StringType);<NEW_LINE>result.addColumn("ORIGINAL_NAME", DataTypes.StringType);<NEW_LINE>result.addColumn("CREATED", DataTypes.DatetimeType);<NEW_LINE>result.initMeta();<NEW_LINE>int index = 0;<NEW_LINE>for (RecycleBinParam param : bin.getAll(false)) {<NEW_LINE>result.addRow(new Object[] { index++, param.name, param.originalName, param.created });<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | RecycleBinManager.instance.getByAppName(appName); |
23,351 | private static void parseObjectGotoArray(HippyArray array, Object obj) throws JSONException {<NEW_LINE>if (obj == null || obj == JSONObject.NULL) {<NEW_LINE>array.pushNull();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Class<?> cls = obj.getClass();<NEW_LINE>if (obj instanceof String) {<NEW_LINE>array.pushString((String) obj);<NEW_LINE>} else if (cls == int.class || cls == Integer.class) {<NEW_LINE>array.pushInt((Integer) obj);<NEW_LINE>} else if (cls == double.class || cls == Double.class) {<NEW_LINE>array.pushDouble((Double) obj);<NEW_LINE>} else if (cls == long.class || cls == Long.class) {<NEW_LINE>array.pushLong((Long) obj);<NEW_LINE>} else if (cls == boolean.class || cls == Boolean.class) {<NEW_LINE>array.pushBoolean((Boolean) obj);<NEW_LINE>} else if (cls == HippyArray.class) {<NEW_LINE>array.pushArray((HippyArray) obj);<NEW_LINE>} else if (cls == HippyMap.class) {<NEW_LINE>array.pushMap((HippyMap) obj);<NEW_LINE>} else if (cls == JSONArray.class) {<NEW_LINE>HippyArray arr = new HippyArray();<NEW_LINE>JSONArray jsonArr = (JSONArray) obj;<NEW_LINE>int length = jsonArr.length();<NEW_LINE>for (int i = 0; i < length; i++) {<NEW_LINE>parseObjectGotoArray(arr, jsonArr.get(i));<NEW_LINE>}<NEW_LINE>array.pushArray(arr);<NEW_LINE>} else if (cls == JSONObject.class) {<NEW_LINE>HippyMap map = new HippyMap();<NEW_LINE>JSONObject jsonObj = (JSONObject) obj;<NEW_LINE>Iterator<String<MASK><NEW_LINE>while (keys.hasNext()) {<NEW_LINE>String key = keys.next();<NEW_LINE>parseObjectGotoMap(map, key, jsonObj.get(key));<NEW_LINE>}<NEW_LINE>array.pushMap(map);<NEW_LINE>}<NEW_LINE>} | > keys = jsonObj.keys(); |
1,451,057 | private void doSwitchStatementsIndentation(ASTNode switchNode, List<Statement> statements) {<NEW_LINE>if (this.options.indent_switchstatements_compare_to_cases) {<NEW_LINE>int nonBreakStatementEnd = -1;<NEW_LINE>for (Statement statement : statements) {<NEW_LINE>boolean isBreaking = isSwitchBreakingStatement(statement);<NEW_LINE>if (isBreaking && !(statement instanceof Block))<NEW_LINE>adjustEmptyLineAfter(this.tm.lastIndexIn(statement, -1), -1);<NEW_LINE>if (statement instanceof SwitchCase) {<NEW_LINE>if (nonBreakStatementEnd >= 0) {<NEW_LINE>// indent only comments between previous and current statement<NEW_LINE>this.tm.get(nonBreakStatementEnd + 1).indent();<NEW_LINE>this.tm.firstTokenIn(statement, -1).unindent();<NEW_LINE>}<NEW_LINE>} else if (!(statement instanceof BreakStatement || statement instanceof YieldStatement || statement instanceof Block)) {<NEW_LINE>indent(statement);<NEW_LINE>}<NEW_LINE>nonBreakStatementEnd = isBreaking ? -1 : this.tm<MASK><NEW_LINE>}<NEW_LINE>if (nonBreakStatementEnd >= 0) {<NEW_LINE>// indent comments between last statement and closing brace<NEW_LINE>this.tm.get(nonBreakStatementEnd + 1).indent();<NEW_LINE>this.tm.lastTokenIn(switchNode, TokenNameRBRACE).unindent();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (this.options.indent_breaks_compare_to_cases) {<NEW_LINE>for (Statement statement : statements) {<NEW_LINE>if (statement instanceof BreakStatement || statement instanceof YieldStatement)<NEW_LINE>indent(statement);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .lastIndexIn(statement, -1); |
1,547,252 | private boolean canDropNode(ProgramNode destinationNode, ProgramNode dropNode, int dropAction, int relativeMousePosition) {<NEW_LINE><MASK><NEW_LINE>if (dragGroup.equals(destinationNode.getGroup())) {<NEW_LINE>// can't drop a group onto itself<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (relativeMousePosition != 0) {<NEW_LINE>return reorderDDMgr.isDropSiteOk(destinationNode, dropNode, dropAction, relativeMousePosition);<NEW_LINE>}<NEW_LINE>// this is for a normal drop on the node<NEW_LINE>if (destinationNode.isFragment()) {<NEW_LINE>return checkDestFragment(destinationNode, dropNode, dropAction);<NEW_LINE>}<NEW_LINE>// check for destination module already containing drop Module or Fragment<NEW_LINE>ProgramModule destModule = destinationNode.getModule();<NEW_LINE>if (dropNode.isFragment() && destModule.contains(dropNode.getFragment())) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (dropNode.isModule()) {<NEW_LINE>ProgramModule dropModule = dropNode.getModule();<NEW_LINE>if (destModule.contains(dropNode.getModule())) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (dropModule.isDescendant(destModule)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | Group dragGroup = dropNode.getGroup(); |
457,346 | public void recordValues(final GATKRead read, final SAMFileHeader header, final ReadCovariates values, final boolean recordIndelValues) {<NEW_LINE>final int originalReadLength = read.getLength();<NEW_LINE>// store the original bases and then write Ns over low quality ones<NEW_LINE>// Note: this makes a copy of the read<NEW_LINE>final byte[] strandedClippedBases = getStrandedClippedBytes(read, lowQualTail);<NEW_LINE>// Note: we're using a non-standard library here because boxing came up on profiling as taking 20% of time in applyBQSR.<NEW_LINE>// IntList avoids boxing<NEW_LINE>final IntList mismatchKeys = contextWith(strandedClippedBases, mismatchesContextSize, mismatchesKeyMask);<NEW_LINE>final int readLengthAfterClipping = strandedClippedBases.length;<NEW_LINE>// this is necessary to ensure that we don't keep historical data in the ReadCovariates values<NEW_LINE>// since the context covariate may not span the entire set of values in read covariates<NEW_LINE>// due to the clipping of the low quality bases<NEW_LINE>if (readLengthAfterClipping != originalReadLength) {<NEW_LINE>// don't bother zeroing out if we are going to overwrite the whole array<NEW_LINE>for (int i = 0; i < originalReadLength; i++) {<NEW_LINE>// this base has been clipped off, so zero out the covariate values here<NEW_LINE>values.addCovariate(0, 0, 0, i);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final boolean negativeStrand = read.isReverseStrand();<NEW_LINE>// Note: duplicated the loop to avoid checking recordIndelValues on each iteration<NEW_LINE>if (recordIndelValues) {<NEW_LINE>final IntList indelKeys = contextWith(strandedClippedBases, indelsContextSize, indelsKeyMask);<NEW_LINE>for (int i = 0; i < readLengthAfterClipping; i++) {<NEW_LINE>final int readOffset = getStrandedOffset(negativeStrand, i, readLengthAfterClipping);<NEW_LINE>final int indelKey = indelKeys.getInt(i);<NEW_LINE>values.addCovariate(mismatchKeys.getInt(i), indelKey, indelKey, readOffset);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>for (int i = 0; i < readLengthAfterClipping; i++) {<NEW_LINE>final int readOffset = <MASK><NEW_LINE>values.addCovariate(mismatchKeys.getInt(i), 0, 0, readOffset);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | getStrandedOffset(negativeStrand, i, readLengthAfterClipping); |
161,874 | private void dealWithSwitchNode(ASTSwitchNode node) {<NEW_LINE>// System.out.println("dealing with SwitchNode");<NEW_LINE>// do a depthfirst on elements of the switchNode<NEW_LINE>List<Object<MASK><NEW_LINE>Map<Object, List<Object>> index2BodyList = node.getIndex2BodyList();<NEW_LINE>Iterator<Object> it = indexList.iterator();<NEW_LINE>while (it.hasNext()) {<NEW_LINE>// going through all the cases of the switch statement<NEW_LINE>Object currentIndex = it.next();<NEW_LINE>List body = index2BodyList.get(currentIndex);<NEW_LINE>if (body == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// this body is a list of ASTNodes<NEW_LINE>List<ASTNode> toReturn = new ArrayList<ASTNode>();<NEW_LINE>Iterator itBody = body.iterator();<NEW_LINE>// go over the ASTNodes and apply<NEW_LINE>while (itBody.hasNext()) {<NEW_LINE>ASTNode temp = (ASTNode) itBody.next();<NEW_LINE>// System.out.println("Checking whether child of type "+temp.getClass()+" is reachable");<NEW_LINE>if (!codeFinder.isConstructReachable(temp)) {<NEW_LINE>// System.out.println(">>>>>>>>>>>>>>>>>-------------------------A child of node of type "+node.getClass()+" whose<NEW_LINE>// type is<NEW_LINE>// "+temp.getClass()+" is unreachable");<NEW_LINE>toReturn.add(temp);<NEW_LINE>} else {<NEW_LINE>// System.out.println("child of type "+temp.getClass()+" is reachable");<NEW_LINE>// only apply on reachable nodes<NEW_LINE>temp.apply(this);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Iterator<ASTNode> newit = toReturn.iterator();<NEW_LINE>while (newit.hasNext()) {<NEW_LINE>// System.out.println("Removed");<NEW_LINE>body.remove(newit.next());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | > indexList = node.getIndexList(); |
88,205 | public void onSectionIncreased(long incDuration, long totalDuration, int sectionCount) {<NEW_LINE>long totalRecordDurationMs = incDuration + (mDurationRecordStack.isEmpty() ? <MASK><NEW_LINE>double totalVideoDurationMs = incDuration + (mDurationVideoStack.isEmpty() ? 0 : mDurationVideoStack.peek());<NEW_LINE>if (totalVideoDurationMs >= mRecordSetting.getMaxRecordDuration()) {<NEW_LINE>totalVideoDurationMs = mRecordSetting.getMaxRecordDuration();<NEW_LINE>}<NEW_LINE>mDurationRecordStack.push(totalRecordDurationMs);<NEW_LINE>mDurationVideoStack.push(totalVideoDurationMs);<NEW_LINE>if (mRecordSetting.IsRecordSpeedVariable()) {<NEW_LINE>mSectionProgressBar.addBreakPointTime((long) totalVideoDurationMs);<NEW_LINE>} else {<NEW_LINE>mSectionProgressBar.addBreakPointTime(totalRecordDurationMs);<NEW_LINE>}<NEW_LINE>mSectionProgressBar.setCurrentState(SectionProgressBar.State.PAUSE);<NEW_LINE>onSectionCountChanged(sectionCount, (long) totalVideoDurationMs);<NEW_LINE>} | 0 : mDurationRecordStack.peek()); |
469,982 | private List<Symbol> findVftablesFromVtables() throws Exception {<NEW_LINE>List<Symbol> vftableSymbols = new ArrayList<Symbol>();<NEW_LINE>// find all vtable symbols<NEW_LINE>List<Symbol> listOfVtableSymbols = extendedFlatAPI.getListOfSymbolsInAddressSet(program.getAddressFactory().getAddressSet(), VTABLE_LABEL, true);<NEW_LINE>Iterator<Symbol> vtableIterator = listOfVtableSymbols.iterator();<NEW_LINE>while (vtableIterator.hasNext()) {<NEW_LINE>monitor.checkCanceled();<NEW_LINE>Symbol vtableSymbol = vtableIterator.next();<NEW_LINE>Namespace vtableNamespace = vtableSymbol.getParentNamespace();<NEW_LINE>Address vtableAddress = vtableSymbol.getAddress();<NEW_LINE>// skip the special tables<NEW_LINE>if (vtableAddress.equals(class_type_info_vtable) || vtableAddress.equals(si_class_type_info_vtable) || vtableAddress.equals(vmi_class_type_info_vtable)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Data vtableData = api.getDataAt(vtableAddress);<NEW_LINE>if (vtableData == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// find the special type info ref<NEW_LINE>Address typeinfoAddress = findNextTypeinfoRef(vtableAddress);<NEW_LINE>if (typeinfoAddress == null) {<NEW_LINE>if (DEBUG) {<NEW_LINE>Msg.debug(this, vtableAddress.toString() + " " + vtableNamespace.getName() + " vtable has no typeinfo ref");<NEW_LINE>}<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Address vftableAddress = extendedFlatAPI.getAddress(typeinfoAddress, defaultPointerSize);<NEW_LINE>// no valid address here so continue<NEW_LINE>if (vftableAddress == null) {<NEW_LINE>// createNewClass(vtableNamespace, false);<NEW_LINE>// if so should also add to no vftable class<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Symbol <MASK><NEW_LINE>if (vftableSymbol == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (vftableSymbol.getName().equals(VFTABLE_LABEL)) {<NEW_LINE>vftableSymbols.add(vftableSymbol);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return vftableSymbols;<NEW_LINE>} | vftableSymbol = symbolTable.getPrimarySymbol(vftableAddress); |
1,289,264 | final ListAssistantAssociationsResult executeListAssistantAssociations(ListAssistantAssociationsRequest listAssistantAssociationsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listAssistantAssociationsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListAssistantAssociationsRequest> request = null;<NEW_LINE>Response<ListAssistantAssociationsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListAssistantAssociationsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listAssistantAssociationsRequest));<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, "Wisdom");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListAssistantAssociations");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListAssistantAssociationsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListAssistantAssociationsResultJsonUnmarshaller());<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); |
901,612 | public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {<NEW_LINE>builder.startObject();<NEW_LINE>builder.field(Job.ID.getPreferredName(), jobId);<NEW_LINE>builder.field(MIN_VERSION.getPreferredName(), minVersion);<NEW_LINE>if (timestamp != null) {<NEW_LINE>builder.timeField(TIMESTAMP.getPreferredName(), TIMESTAMP.getPreferredName() + "_string", timestamp.getTime());<NEW_LINE>}<NEW_LINE>if (description != null) {<NEW_LINE>builder.field(DESCRIPTION.getPreferredName(), description);<NEW_LINE>}<NEW_LINE>if (snapshotId != null) {<NEW_LINE>builder.field(ModelSnapshotField.SNAPSHOT_ID.getPreferredName(), snapshotId);<NEW_LINE>}<NEW_LINE>builder.field(<MASK><NEW_LINE>if (modelSizeStats != null) {<NEW_LINE>builder.field(ModelSizeStats.RESULT_TYPE_FIELD.getPreferredName(), modelSizeStats);<NEW_LINE>}<NEW_LINE>if (latestRecordTimeStamp != null) {<NEW_LINE>builder.timeField(LATEST_RECORD_TIME.getPreferredName(), LATEST_RECORD_TIME.getPreferredName() + "_string", latestRecordTimeStamp.getTime());<NEW_LINE>}<NEW_LINE>if (latestResultTimeStamp != null) {<NEW_LINE>builder.timeField(LATEST_RESULT_TIME.getPreferredName(), LATEST_RESULT_TIME.getPreferredName() + "_string", latestResultTimeStamp.getTime());<NEW_LINE>}<NEW_LINE>if (quantiles != null) {<NEW_LINE>builder.field(QUANTILES.getPreferredName(), quantiles);<NEW_LINE>}<NEW_LINE>builder.field(RETAIN.getPreferredName(), retain);<NEW_LINE>builder.endObject();<NEW_LINE>return builder;<NEW_LINE>} | SNAPSHOT_DOC_COUNT.getPreferredName(), snapshotDocCount); |
1,201,227 | public void cleanupTemplateSR(final Connection conn) {<NEW_LINE>Set<PBD> pbds = null;<NEW_LINE>try {<NEW_LINE>final Host host = Host.getByUuid(conn, _host.getUuid());<NEW_LINE>pbds = host.getPBDs(conn);<NEW_LINE>} catch (final XenAPIException e) {<NEW_LINE>s_logger.warn("Unable to get the SRs " + e.toString(), e);<NEW_LINE>throw new CloudRuntimeException("Unable to get SRs " + e.toString(), e);<NEW_LINE>} catch (final Exception e) {<NEW_LINE>throw new CloudRuntimeException("Unable to get SRs " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>for (final PBD pbd : pbds) {<NEW_LINE>SR sr = null;<NEW_LINE>SR.Record srRec = null;<NEW_LINE>try {<NEW_LINE>sr = pbd.getSR(conn);<NEW_LINE><MASK><NEW_LINE>} catch (final Exception e) {<NEW_LINE>s_logger.warn("pbd.getSR get Exception due to ", e);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>final String type = srRec.type;<NEW_LINE>if (srRec.shared) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (SRType.NFS.equals(type) || SRType.ISO.equals(type) && srRec.nameDescription.contains("template")) {<NEW_LINE>try {<NEW_LINE>pbd.unplug(conn);<NEW_LINE>pbd.destroy(conn);<NEW_LINE>sr.forget(conn);<NEW_LINE>} catch (final Exception e) {<NEW_LINE>s_logger.warn("forget SR catch Exception due to ", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | srRec = sr.getRecord(conn); |
338,110 | public static <T> byte[] write(Writer<T> writer, T value) {<NEW_LINE>byte[] result = new byte[writer.sizeInBytes(value)];<NEW_LINE>WriteBuffer b = WriteBuffer.wrap(result);<NEW_LINE>try {<NEW_LINE>writer.write(value, b);<NEW_LINE>} catch (RuntimeException e) {<NEW_LINE>int lengthWritten = result.length;<NEW_LINE>for (int i = 0; i < result.length; i++) {<NEW_LINE>if (result[i] == 0) {<NEW_LINE>lengthWritten = i;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Don't use value directly in the message, as its toString might be implemented using this<NEW_LINE>// method. If that's the case, we'd stack overflow. Instead, emit what we've written so far.<NEW_LINE>String message = format("Bug found using %s to write %s as json. Wrote %s/%s bytes: %s", writer.getClass().getSimpleName(), value.getClass().getSimpleName(), lengthWritten, result.length, new String(result<MASK><NEW_LINE>throw Platform.get().assertionError(message, e);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | , 0, lengthWritten, UTF_8)); |
1,308,847 | public Mono<PagedResponse<Object>> listRelationshipsNextSinglePageAsync(String nextLink, DigitalTwinsListRelationshipsOptions digitalTwinsListRelationshipsOptions, Context context) {<NEW_LINE>if (nextLink == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getHost() == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (digitalTwinsListRelationshipsOptions != null) {<NEW_LINE>digitalTwinsListRelationshipsOptions.validate();<NEW_LINE>}<NEW_LINE>String traceparentInternal = null;<NEW_LINE>if (digitalTwinsListRelationshipsOptions != null) {<NEW_LINE>traceparentInternal = digitalTwinsListRelationshipsOptions.getTraceparent();<NEW_LINE>}<NEW_LINE>String traceparent = traceparentInternal;<NEW_LINE>String tracestateInternal = null;<NEW_LINE>if (digitalTwinsListRelationshipsOptions != null) {<NEW_LINE>tracestateInternal = digitalTwinsListRelationshipsOptions.getTracestate();<NEW_LINE>}<NEW_LINE>String tracestate = tracestateInternal;<NEW_LINE>return service.listRelationshipsNext(nextLink, this.client.getHost(), traceparent, tracestate, context).map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().getValue(), res.getValue().getNextLink(), null));<NEW_LINE>} | error(new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); |
506,482 | private void alignScopeOutline(PanmirrorEditingOutlineLocation location) {<NEW_LINE>// Get all of the chunks from the document (code view)<NEW_LINE>ArrayList<Scope> chunkScopes = new ArrayList<>();<NEW_LINE><MASK><NEW_LINE>chunks.selectAll(ScopeList.CHUNK);<NEW_LINE>for (Scope chunk : chunks) {<NEW_LINE>chunkScopes.add(chunk);<NEW_LINE>}<NEW_LINE>// Get all of the chunks from the outline emitted by visual mode<NEW_LINE>ArrayList<PanmirrorEditingOutlineLocationItem> chunkItems = new ArrayList<>();<NEW_LINE>for (int j = 0; j < location.items.length; j++) {<NEW_LINE>if (StringUtil.equals(location.items[j].type, PanmirrorOutlineItemType.RmdChunk)) {<NEW_LINE>chunkItems.add(location.items[j]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Refuse to proceed if cardinality doesn't match (consider: does this<NEW_LINE>// need to account for deeply nested chunks that might appear in one<NEW_LINE>// outline but not the other?)<NEW_LINE>if (chunkScopes.size() != chunkItems.size()) {<NEW_LINE>Debug.logWarning(chunkScopes.size() + " chunks in scope tree, but " + chunkItems.size() + " chunks in visual editor.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (int k = 0; k < chunkItems.size(); k++) {<NEW_LINE>PanmirrorEditingOutlineLocationItem visualItem = Js.uncheckedCast(chunkItems.get(k));<NEW_LINE>VisualModeChunk chunk = visualModeChunks_.getChunkAtVisualPosition(visualItem.position);<NEW_LINE>if (chunk == null) {<NEW_LINE>// This is normal; it is possible that we haven't created a chunk<NEW_LINE>// editor at this position yet.<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>chunk.setScope(chunkScopes.get(k));<NEW_LINE>}<NEW_LINE>} | ScopeList chunks = new ScopeList(docDisplay_); |
1,675,745 | public boolean action(Request request, Response response) {<NEW_LINE>if (request.getNettyRequest() instanceof FullHttpRequest) {<NEW_LINE>InputUpdateAlias input = getRequestBody(request.<MASK><NEW_LINE>if (!StringUtil.isNullOrEmpty(input.getOperator()) && !StringUtil.isNullOrEmpty(input.getTargetId())) {<NEW_LINE>WFCMessage.AddFriendRequest addFriendRequest = WFCMessage.AddFriendRequest.newBuilder().setTargetUid(input.getTargetId()).setReason(input.getAlias() == null ? "" : input.getAlias()).build();<NEW_LINE>sendApiMessage(response, input.getOperator(), IMTopic.SetFriendAliasTopic, addFriendRequest.toByteArray(), result -> {<NEW_LINE>ByteBuf byteBuf = Unpooled.buffer();<NEW_LINE>byteBuf.writeBytes(result);<NEW_LINE>ErrorCode errorCode = ErrorCode.fromCode(byteBuf.readByte());<NEW_LINE>if (errorCode == ErrorCode.ERROR_CODE_SUCCESS) {<NEW_LINE>byte[] data = new byte[byteBuf.readableBytes()];<NEW_LINE>byteBuf.readBytes(data);<NEW_LINE>String channelId = new String(data);<NEW_LINE>return new Result(ErrorCode.ERROR_CODE_SUCCESS, new OutputCreateChannel(channelId));<NEW_LINE>} else {<NEW_LINE>return new Result(errorCode);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return false;<NEW_LINE>} else {<NEW_LINE>ErrorCode errorCode = messagesStore.setFriendAliasRequest(input.getOperator(), input.getTargetId(), input.getAlias(), new long[1]);<NEW_LINE>setResponseContent(RestResult.resultOf(errorCode), response);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | getNettyRequest(), InputUpdateAlias.class); |
291,732 | private void populateDependencies(Set<? extends UsageContext> usageContexts, PublicationWarningsCollector publicationWarningsCollector) {<NEW_LINE>for (UsageContext usageContext : usageContexts) {<NEW_LINE>publicationWarningsCollector.newContext(usageContext.getName());<NEW_LINE>for (ModuleDependency dependency : usageContext.getDependencies()) {<NEW_LINE>String confMapping = confMappingFor(usageContext, dependency);<NEW_LINE>if (!dependency.getAttributes().isEmpty()) {<NEW_LINE>publicationWarningsCollector.addUnsupported(String.format("%s:%s:%s declared with Gradle attributes", dependency.getGroup(), dependency.getName()<MASK><NEW_LINE>}<NEW_LINE>if (dependency instanceof ProjectDependency) {<NEW_LINE>addProjectDependency((ProjectDependency) dependency, confMapping);<NEW_LINE>} else {<NEW_LINE>ExternalDependency externalDependency = (ExternalDependency) dependency;<NEW_LINE>if (platformSupport.isTargetingPlatform(dependency)) {<NEW_LINE>publicationWarningsCollector.addUnsupported(String.format("%s:%s:%s declared as platform", dependency.getGroup(), dependency.getName(), dependency.getVersion()));<NEW_LINE>}<NEW_LINE>if (!versionMappingInUse && externalDependency.getVersion() == null) {<NEW_LINE>publicationWarningsCollector.addUnsupported(String.format("%s:%s declared without version", externalDependency.getGroup(), externalDependency.getName()));<NEW_LINE>}<NEW_LINE>addExternalDependency(externalDependency, confMapping, ((AttributeContainerInternal) usageContext.getAttributes()).asImmutable());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!usageContext.getDependencyConstraints().isEmpty()) {<NEW_LINE>for (DependencyConstraint constraint : usageContext.getDependencyConstraints()) {<NEW_LINE>publicationWarningsCollector.addUnsupported(String.format("%s:%s:%s declared as a dependency constraint", constraint.getGroup(), constraint.getName(), constraint.getVersion()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!usageContext.getCapabilities().isEmpty()) {<NEW_LINE>for (Capability capability : usageContext.getCapabilities()) {<NEW_LINE>publicationWarningsCollector.addVariantUnsupported(String.format("Declares capability %s:%s:%s which cannot be mapped to Ivy", capability.getGroup(), capability.getName(), capability.getVersion()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | , dependency.getVersion())); |
607,320 | public void reload() {<NEW_LINE>long start = System.currentTimeMillis();<NEW_LINE>File currentProjectPluginsDir;<NEW_LINE>File currentGlobalPluginsDir;<NEW_LINE>List<GrailsPlugin> currentLocalPlugins;<NEW_LINE>synchronized (this) {<NEW_LINE>File newProjectRoot = FileUtil.<MASK><NEW_LINE>assert newProjectRoot != null;<NEW_LINE>if (!newProjectRoot.equals(projectRoot)) {<NEW_LINE>projectRoot = newProjectRoot;<NEW_LINE>}<NEW_LINE>buildSettingsInstance = loadBuildSettings();<NEW_LINE>LOGGER.log(Level.FINE, "Took {0} ms to load BuildSettings for {1}", new Object[] { (System.currentTimeMillis() - start), project.getProjectDirectory().getNameExt() });<NEW_LINE>currentLocalPlugins = loadLocalPlugins();<NEW_LINE>currentProjectPluginsDir = loadProjectPluginsDir();<NEW_LINE>currentGlobalPluginsDir = loadGlobalPluginsDir();<NEW_LINE>}<NEW_LINE>if (GrailsPlatform.Version.VERSION_1_1.compareTo(GrailsProjectConfig.forProject(project).getGrailsPlatform().getVersion()) <= 0) {<NEW_LINE>GrailsProjectConfig config = project.getLookup().lookup(GrailsProjectConfig.class);<NEW_LINE>if (config != null) {<NEW_LINE>ProjectConfigListener listener = new ProjectConfigListener();<NEW_LINE>config.addPropertyChangeListener(listener);<NEW_LINE>try {<NEW_LINE>config.setProjectPluginsDir(FileUtil.normalizeFile(currentProjectPluginsDir));<NEW_LINE>config.setGlobalPluginsDir(FileUtil.normalizeFile(currentGlobalPluginsDir));<NEW_LINE>Map<String, File> prepared = new HashMap<>();<NEW_LINE>for (GrailsPlugin plugin : currentLocalPlugins) {<NEW_LINE>prepared.put(plugin.getName(), plugin.getPath());<NEW_LINE>}<NEW_LINE>config.setLocalPlugins(prepared);<NEW_LINE>} finally {<NEW_LINE>config.removePropertyChangeListener(listener);<NEW_LINE>}<NEW_LINE>if (listener.isChanged()) {<NEW_LINE>propertySupport.firePropertyChange(BUILD_CONFIG_PLUGINS, null, null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | toFile(project.getProjectDirectory()); |
1,854,948 | private void initNewPreferences() {<NEW_LINE>prefPayload = new PreferencesPayload();<NEW_LINE>prefPayload.setUserLanguage(GlobalSettings.getLocale().getLanguage());<NEW_LINE>prefPayload.setUserCountry(CountryUtil.getDefaultCountry());<NEW_LINE>GlobalSettings.setLocale(new Locale(prefPayload.getUserLanguage(), prefPayload.getUserCountry().code));<NEW_LINE>// default fallback option<NEW_LINE>TradeCurrency preferredTradeCurrency = CurrencyUtil.getCurrencyByCountryCode("US");<NEW_LINE>try {<NEW_LINE>preferredTradeCurrency = CurrencyUtil.getCurrencyByCountryCode(prefPayload.getUserCountry().code);<NEW_LINE>} catch (IllegalArgumentException ia) {<NEW_LINE>log.warn("Could not determine currency for country {} [{}]", prefPayload.getUserCountry().<MASK><NEW_LINE>}<NEW_LINE>prefPayload.setPreferredTradeCurrency(preferredTradeCurrency);<NEW_LINE>setFiatCurrencies(CurrencyUtil.getMainFiatCurrencies());<NEW_LINE>setCryptoCurrencies(CurrencyUtil.getMainCryptoCurrencies());<NEW_LINE>BaseCurrencyNetwork baseCurrencyNetwork = Config.baseCurrencyNetwork();<NEW_LINE>if ("BTC".equals(baseCurrencyNetwork.getCurrencyCode())) {<NEW_LINE>setBlockChainExplorerMainNet(BTC_MAIN_NET_EXPLORERS.get(0));<NEW_LINE>setBlockChainExplorerTestNet(BTC_TEST_NET_EXPLORERS.get(0));<NEW_LINE>} else {<NEW_LINE>throw new RuntimeException("BaseCurrencyNetwork not defined. BaseCurrencyNetwork=" + baseCurrencyNetwork);<NEW_LINE>}<NEW_LINE>prefPayload.setDirectoryChooserPath(Utilities.getSystemHomeDirectory());<NEW_LINE>prefPayload.setOfferBookChartScreenCurrencyCode(preferredTradeCurrency.getCode());<NEW_LINE>prefPayload.setTradeChartsScreenCurrencyCode(preferredTradeCurrency.getCode());<NEW_LINE>prefPayload.setBuyScreenCurrencyCode(preferredTradeCurrency.getCode());<NEW_LINE>prefPayload.setSellScreenCurrencyCode(preferredTradeCurrency.getCode());<NEW_LINE>GlobalSettings.setDefaultTradeCurrency(preferredTradeCurrency);<NEW_LINE>setupPreferences();<NEW_LINE>} | code, ia.toString()); |
1,642,572 | public static void exportCDIFaultToleranceAppToServer(LibertyServer server) throws Exception {<NEW_LINE>String APP_NAME = "CDIFaultTolerance";<NEW_LINE>JavaArchive faulttolerance_jar = ShrinkWrap.create(JavaArchive.class, "faulttolerance.jar").addPackages(true, "com.ibm.ws.microprofile.faulttolerance_fat.util");<NEW_LINE>WebArchive CDIFaultTolerance_war = ShrinkWrap.create(WebArchive.class, APP_NAME + ".war").addPackages(true, "com.ibm.ws.microprofile.faulttolerance_fat.cdi").addAsLibraries(faulttolerance_jar).addAsManifestResource(new File("test-applications/" + APP_NAME + ".war/resources/META-INF/permissions.xml"), "permissions.xml").addAsManifestResource(new File("test-applications/" + APP_NAME + ".war/resources/META-INF/microprofile-config.properties"));<NEW_LINE>ShrinkHelper.exportDropinAppToServer(<MASK><NEW_LINE>} | server, CDIFaultTolerance_war, DeployOptions.SERVER_ONLY); |
1,707,989 | public Request<UpdateAccessKeyRequest> marshall(UpdateAccessKeyRequest updateAccessKeyRequest) {<NEW_LINE>if (updateAccessKeyRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<UpdateAccessKeyRequest> request = new DefaultRequest<MASK><NEW_LINE>request.addParameter("Action", "UpdateAccessKey");<NEW_LINE>request.addParameter("Version", "2010-05-08");<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>if (updateAccessKeyRequest.getUserName() != null) {<NEW_LINE>request.addParameter("UserName", StringUtils.fromString(updateAccessKeyRequest.getUserName()));<NEW_LINE>}<NEW_LINE>if (updateAccessKeyRequest.getAccessKeyId() != null) {<NEW_LINE>request.addParameter("AccessKeyId", StringUtils.fromString(updateAccessKeyRequest.getAccessKeyId()));<NEW_LINE>}<NEW_LINE>if (updateAccessKeyRequest.getStatus() != null) {<NEW_LINE>request.addParameter("Status", StringUtils.fromString(updateAccessKeyRequest.getStatus()));<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>} | <UpdateAccessKeyRequest>(updateAccessKeyRequest, "AmazonIdentityManagement"); |
644,051 | public CreateGroupMembershipResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>CreateGroupMembershipResult createGroupMembershipResult = new CreateGroupMembershipResult();<NEW_LINE>createGroupMembershipResult.setStatus(context.getHttpResponse().getStatusCode());<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 createGroupMembershipResult;<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("GroupMember", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>createGroupMembershipResult.setGroupMember(GroupMemberJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("RequestId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>createGroupMembershipResult.setRequestId(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 createGroupMembershipResult;<NEW_LINE>} | String currentParentElement = context.getCurrentParentElement(); |
388,650 | public void activate(Map<String, Object> properties) {<NEW_LINE>Object cid = properties.get("component.id");<NEW_LINE>name = (String) properties.get("id");<NEW_LINE>if (name == null)<NEW_LINE>name = "sipEndpoint-" + cid;<NEW_LINE>if (isNeedToActivateSipEndpoint(name)) {<NEW_LINE>if (c_logger.isEventEnabled()) {<NEW_LINE>c_logger.event("GEP activate: " + this + " properties=" + properties);<NEW_LINE>}<NEW_LINE>if (channelProvider == null) {<NEW_LINE>try {<NEW_LINE>channelProvider = new GenericChannelProvider(SipContainerComponent.getContext().getBundleContext());<NEW_LINE>} catch (Exception e) {<NEW_LINE>if (c_logger.isEventEnabled()) {<NEW_LINE>c_logger.event("Failed to create ChannelProvider: " + this);<NEW_LINE>}<NEW_LINE>e.printStackTrace();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (c_logger.isEventEnabled()) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (udpOptions != null) {<NEW_LINE>_genericUDPChain.init(name, cid, m_chfw, "InboundUDPChain");<NEW_LINE>}<NEW_LINE>if (tcpOptions != null) {<NEW_LINE>_genericTCPChain.init(name, cid, m_chfw, "InboundTCPChain");<NEW_LINE>}<NEW_LINE>if (sslOptions != null) {<NEW_LINE>_genericTLSChain.init(name, cid, m_chfw, "InboundTLSChain");<NEW_LINE>}<NEW_LINE>startChains(properties);<NEW_LINE>try {<NEW_LINE>SipVirtualHostAdapter.addSipEndpointHostAliasesToVH(properties, isSslEnabled(), configAdminRef);<NEW_LINE>} catch (Exception e) {<NEW_LINE>handleSipVirtualHostException("Adding SIP endpoint to virtual host failed.", Situation.SITUATION_CREATE, e);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>isForcedDefaultEndpointIdDeactivate = true;<NEW_LINE>if (c_logger.isTraceDebugEnabled()) {<NEW_LINE>c_logger.traceDebug("defaultSipEndpoint endpoint wasn't activated since was configured other sipendpoint");<NEW_LINE>}<NEW_LINE>removeDefaultSipEndpointIdFromConfiguration();<NEW_LINE>}<NEW_LINE>} | c_logger.event("activate sipEndpoint " + this); |
1,386,371 | public void updateSubstitutabilityMap() {<NEW_LINE>ElementDecl parent = this;<NEW_LINE>XSType type = this.getType();<NEW_LINE>boolean rused = false;<NEW_LINE>boolean eused = false;<NEW_LINE>while ((parent = (ElementDecl) parent.getSubstAffiliation()) != null) {<NEW_LINE>if (parent.isSubstitutionDisallowed(XSType.SUBSTITUTION))<NEW_LINE>continue;<NEW_LINE>boolean rd = parent.isSubstitutionDisallowed(XSType.RESTRICTION);<NEW_LINE>boolean ed = parent.isSubstitutionDisallowed(XSType.EXTENSION);<NEW_LINE>if ((rd && rused) || (ed && eused))<NEW_LINE>continue;<NEW_LINE>XSType parentType = parent.getType();<NEW_LINE>while (type != parentType) {<NEW_LINE>if (type.getDerivationMethod() == XSType.RESTRICTION)<NEW_LINE>rused = true;<NEW_LINE>else<NEW_LINE>eused = true;<NEW_LINE>type = type.getBaseType();<NEW_LINE>if (// parentType and type doesn't share the common base type. a bug in the schema.<NEW_LINE>type == null)<NEW_LINE>break;<NEW_LINE>if (type.isComplexType()) {<NEW_LINE>rd |= type.asComplexType().isSubstitutionProhibited(XSType.RESTRICTION);<NEW_LINE>ed |= type.asComplexType(<MASK><NEW_LINE>}<NEW_LINE>if (getRoot().getAnyType().equals(type))<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if ((rd && rused) || (ed && eused))<NEW_LINE>continue;<NEW_LINE>// this element can substitute "parent"<NEW_LINE>parent.addSubstitutable(this);<NEW_LINE>}<NEW_LINE>} | ).isSubstitutionProhibited(XSType.EXTENSION); |
877,714 | private void processProps(Map<String, Object> props) {<NEW_LINE>// warn users on the ignored attributes<NEW_LINE>Tr.warning(tc, "SAML_CONFIG_IGNORE_ATTRIBUTES", new Object[] { "true", ignoreAttributes, providerId });<NEW_LINE>// milliseconds<NEW_LINE>clockSkewMilliSeconds = (Long) props.get(KEY_clockSkew);<NEW_LINE>signatureMethodAlgorithm = trim((String) props.get(KEY_signatureMethodAlgorithm));<NEW_LINE>userIdentifier = trim((String) props.get(KEY_userIdentifier));<NEW_LINE>groupIdentifier = trim((String) props.get(KEY_groupIdentifier));<NEW_LINE>userUniqueIdentifier = trim((String) props.get(KEY_userUniqueIdentifier));<NEW_LINE>if (userUniqueIdentifier == null || userUniqueIdentifier.isEmpty()) {<NEW_LINE>userUniqueIdentifier = userIdentifier;<NEW_LINE>}<NEW_LINE>realmIdentifier = trim((String) props.get(KEY_realmIdentifier));<NEW_LINE>mapToUserRegistry = Constants.MapToUserRegistry.valueOf((String) props.get(KEY_mapToUserRegistry));<NEW_LINE>disableLtpaCookie = (Boolean) props.get(KEY_disableLtpaCookie);<NEW_LINE>wantAssertionsSigned = (Boolean) props.get(KEY_wantAssertionsSigned);<NEW_LINE>includeX509InSPMetadata = (Boolean) props.get(KEY_includeX509InSPMetadata);<NEW_LINE>realmName = trim((String) props.get(KEY_realmName));<NEW_LINE>arrayHeaderNames = trim((String[]) props.get(KEY_headerName));<NEW_LINE>if (arrayHeaderNames == null || arrayHeaderNames.length == 0) {<NEW_LINE>// 204127<NEW_LINE>arrayHeaderNames = new String[] { "Saml", "saml", "SAML" };<NEW_LINE>}<NEW_LINE>headerName = Array2String(arrayHeaderNames);<NEW_LINE>audiences = trim((String[]<MASK><NEW_LINE>keyStoreRef = trim((String) props.get(KEY_keyStoreRef));<NEW_LINE>keyAlias = trim((String) props.get(KEY_keyAlias));<NEW_LINE>keyPassword = getPassword((SerializableProtectedString) props.get(KEY_keyPassword));<NEW_LINE>enabled = (Boolean) props.get(KEY_enabled);<NEW_LINE>servletRequestLogoutPerformsSamlLogout = (Boolean) props.get(KEY_servletRequestLogoutPerformsSamlLogout);<NEW_LINE>// Handle the tc debug<NEW_LINE>processPkixTrustEngine(props);<NEW_LINE>if (trustedIssuers == null || trustedIssuers.length < 1) {<NEW_LINE>// we have to set it as TRUST_ALL_ISSUERS in case it's empty<NEW_LINE>// otherwise, it will fail later when validateIssuer<NEW_LINE>// since rsSaml does not have idp-metadata.xml<NEW_LINE>trustedIssuers = new String[] { Constants.TRUST_ALL_ISSUERS };<NEW_LINE>}<NEW_LINE>} | ) props.get(KEY_audiences)); |
143,115 | private List<PathElement> parse(String path) {<NEW_LINE>if (path == null) {<NEW_LINE>throw new NullPointerException("path");<NEW_LINE>}<NEW_LINE>final String[] split = path.split(Pattern.quote("."));<NEW_LINE>final List<PathElement> elements = new ArrayList<PathElement>();<NEW_LINE>for (String element : split) {<NEW_LINE>int index = element.indexOf('[');<NEW_LINE>if (index == -1) {<NEW_LINE>elements.add(new NamedElement(element));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (index == 0) {<NEW_LINE>throw new IllegalArgumentException("Bogus path: " + path);<NEW_LINE>}<NEW_LINE>elements.add(new NamedElement(element.substring(0, index)));<NEW_LINE>do {<NEW_LINE>element = element.substring(index + 1);<NEW_LINE>index = element.indexOf(']');<NEW_LINE>if (index == -1) {<NEW_LINE>throw new IllegalArgumentException("Bogus path: " + path);<NEW_LINE>}<NEW_LINE>int arrayIndex = Integer.parseInt(element.substring(0, index));<NEW_LINE>elements.add(new ArrayIndexElement(arrayIndex));<NEW_LINE>element = element.substring(index + 1);<NEW_LINE><MASK><NEW_LINE>if (index > 0)<NEW_LINE>throw new IllegalArgumentException("Bogus path: " + path);<NEW_LINE>} while (index != -1);<NEW_LINE>if (!element.isEmpty()) {<NEW_LINE>throw new IllegalArgumentException("Bogus path: " + path);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return elements;<NEW_LINE>} | index = element.indexOf('['); |
1,801,572 | protected void addSupportingElement(Element el) {<NEW_LINE>el = (<MASK><NEW_LINE>if (lastSupportingTokenElement != null) {<NEW_LINE>insertAfter(el, lastSupportingTokenElement);<NEW_LINE>} else if (lastDerivedKeyElement != null) {<NEW_LINE>insertAfter(el, lastDerivedKeyElement);<NEW_LINE>} else if (lastEncryptedKeyElement != null) {<NEW_LINE>LOG.log(Level.FINEST, "element = " + el + " topDownElement = " + topDownElement);<NEW_LINE>insertAfter(el, lastEncryptedKeyElement);<NEW_LINE>} else if (topDownElement != null) {<NEW_LINE>insertAfter(el, topDownElement);<NEW_LINE>} else if (bottomUpElement != null) {<NEW_LINE>el = (Element) DOMUtils.getDomElement(el);<NEW_LINE>secHeader.getSecurityHeader().insertBefore(el, bottomUpElement);<NEW_LINE>} else {<NEW_LINE>el = (Element) DOMUtils.getDomElement(el);<NEW_LINE>secHeader.getSecurityHeader().appendChild(el);<NEW_LINE>}<NEW_LINE>lastSupportingTokenElement = el;<NEW_LINE>} | Element) DOMUtils.getDomElement(el); |
35,523 | public Target resolve(TypeDescription instrumentedType, MethodDescription instrumentedMethod, Assigner assigner, ArgumentHandler argumentHandler, Sort sort) {<NEW_LINE>StackManipulation readAssignment = assigner.assign(TypeDescription.THROWABLE.asGenericType(), target, typing);<NEW_LINE>if (!readAssignment.isValid()) {<NEW_LINE><MASK><NEW_LINE>} else if (readOnly) {<NEW_LINE>return new Target.ForVariable.ReadOnly(TypeDescription.THROWABLE, argumentHandler.thrown(), readAssignment);<NEW_LINE>} else {<NEW_LINE>StackManipulation writeAssignment = assigner.assign(target, TypeDescription.THROWABLE.asGenericType(), typing);<NEW_LINE>if (!writeAssignment.isValid()) {<NEW_LINE>throw new IllegalStateException("Cannot assign " + target + " to Throwable");<NEW_LINE>}<NEW_LINE>return new Target.ForVariable.ReadWrite(TypeDescription.THROWABLE, argumentHandler.thrown(), readAssignment, writeAssignment);<NEW_LINE>}<NEW_LINE>} | throw new IllegalStateException("Cannot assign Throwable to " + target); |
1,571,976 | public void onCreate() {<NEW_LINE>super.onCreate();<NEW_LINE>final String[] abiList;<NEW_LINE>if (VMRuntime.getRuntime().is64Bit()) {<NEW_LINE>abiList = SUPPORTED_64_BIT_ABIS;<NEW_LINE>} else {<NEW_LINE>abiList = SUPPORTED_32_BIT_ABIS;<NEW_LINE>}<NEW_LINE>CPU_ABI = abiList[0];<NEW_LINE>if (abiList.length > 1) {<NEW_LINE>CPU_ABI2 = abiList[1];<NEW_LINE>} else {<NEW_LINE>CPU_ABI2 = "";<NEW_LINE>}<NEW_LINE>final ApplicationInfo appInfo = getApplicationInfo();<NEW_LINE>mInstance = this;<NEW_LINE>mUiThread = Thread.currentThread();<NEW_LINE>mMainHandler = new Handler();<NEW_LINE>mPref = PreferenceManager.getDefaultSharedPreferences(this);<NEW_LINE>createDirectories();<NEW_LINE>delete(new File(Environment.getExternalStorageDirectory() + "/Download/EdXposedManager/.temp"));<NEW_LINE>NotificationUtil.init();<NEW_LINE>registerReceivers();<NEW_LINE>registerActivityLifecycleCallbacks(this);<NEW_LINE>DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy", Locale.getDefault());<NEW_LINE>Date date = new Date();<NEW_LINE>if (!Objects.requireNonNull(mPref.getString("date", "")).equals(dateFormat.format(date))) {<NEW_LINE>mPref.edit().putString("date", dateFormat.format(date)).apply();<NEW_LINE>try {<NEW_LINE>Log.i(TAG, String.format("EdXposedManager - %s - %s", BuildConfig.VERSION_CODE, getPackageManager().getPackageInfo(getPackageName(), 0).versionName));<NEW_LINE>} catch (PackageManager.NameNotFoundException ignored) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (mPref.getBoolean("force_english", false)) {<NEW_LINE>Resources res = getResources();<NEW_LINE><MASK><NEW_LINE>android.content.res.Configuration conf = res.getConfiguration();<NEW_LINE>conf.setLocale(Locale.ENGLISH);<NEW_LINE>res.updateConfiguration(conf, dm);<NEW_LINE>}<NEW_LINE>} | DisplayMetrics dm = res.getDisplayMetrics(); |
404,538 | private NativeEntity<InputWithExtractors> decode(EntityV1 entity, Map<String, ValueReference> parameters, String username) {<NEW_LINE>final InputEntity inputEntity = objectMapper.convertValue(entity.data(), InputEntity.class);<NEW_LINE>final Map<String, ValueReference> staticFields = inputEntity.staticFields();<NEW_LINE>final MessageInput messageInput;<NEW_LINE>try {<NEW_LINE>messageInput = createMessageInput(inputEntity.title().asString(parameters), inputEntity.type().asString(parameters), inputEntity.global().asBoolean(parameters), toValueMap(inputEntity.configuration<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new RuntimeException("Couldn't create input", e);<NEW_LINE>}<NEW_LINE>final Input input;<NEW_LINE>try {<NEW_LINE>input = inputService.find(messageInput.getPersistId());<NEW_LINE>} catch (NotFoundException e) {<NEW_LINE>throw new RuntimeException("Couldn't find persisted input", e);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>addStaticFields(input, messageInput, staticFields, parameters);<NEW_LINE>} catch (ValidationException e) {<NEW_LINE>throw new RuntimeException("Couldn't add static fields to input", e);<NEW_LINE>}<NEW_LINE>final List<Extractor> extractors;<NEW_LINE>try {<NEW_LINE>extractors = createExtractors(input, inputEntity.extractors(), username, parameters);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new RuntimeException("Couldn't create extractors", e);<NEW_LINE>}<NEW_LINE>return NativeEntity.create(entity.id(), input.getId(), TYPE_V1, input.getTitle(), InputWithExtractors.create(input, extractors));<NEW_LINE>} | (), parameters), username); |
755,454 | protected synchronized void processInitHeaders(List<BlockHeader> received) {<NEW_LINE>final BlockHeader blockHeader = received.get(0);<NEW_LINE>final long blockNumber = blockHeader.getNumber();<NEW_LINE>if (ethState == EthState.STATUS_SENT) {<NEW_LINE>updateBestBlock(blockHeader);<NEW_LINE>logger.trace("Peer {}: init request succeeded, best known block {}", channel.getPeerIdShort(), bestKnownBlock);<NEW_LINE>// checking if the peer has expected block hashes<NEW_LINE>ethState = EthState.HASH_CONSTRAINTS_CHECK;<NEW_LINE>validatorMap = Collections.synchronizedMap(new HashMap<Long, BlockHeaderValidator>());<NEW_LINE>List<Pair<Long, BlockHeaderValidator>> validators = config.getBlockchainConfig().getConfigForBlock(blockNumber).headerValidators();<NEW_LINE>for (Pair<Long, BlockHeaderValidator> validator : validators) {<NEW_LINE>if (validator.getLeft() <= getBestKnownBlock().getNumber()) {<NEW_LINE>validatorMap.put(validator.getLeft(), validator.getRight());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>logger.trace("Peer " + channel.getPeerIdShort() + ": Requested " + validatorMap.size() + " headers for hash check: " + validatorMap.keySet());<NEW_LINE>requestNextHashCheck();<NEW_LINE>} else {<NEW_LINE>BlockHeaderValidator validator = validatorMap.get(blockNumber);<NEW_LINE>if (validator != null) {<NEW_LINE>BlockHeaderRule.ValidationResult result = validator.validate(blockHeader);<NEW_LINE>if (result.success) {<NEW_LINE>validatorMap.remove(blockNumber);<NEW_LINE>requestNextHashCheck();<NEW_LINE>} else {<NEW_LINE>logger.debug("Peer {}: wrong fork ({}). Drop the peer and reduce reputation.", channel.getPeerIdShort(), result.error);<NEW_LINE>channel.getNodeStatistics().wrongFork = true;<NEW_LINE>dropConnection();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (validatorMap.isEmpty()) {<NEW_LINE>ethState = EthState.STATUS_SUCCEEDED;<NEW_LINE>logger.trace(<MASK><NEW_LINE>}<NEW_LINE>} | "Peer {}: all validations passed", channel.getPeerIdShort()); |
1,409,521 | static // tvalue = (sep alphanum{3,8})+ ;<NEW_LINE>void parseTransformedExtensions(CharSequence inLocaleId, LocaleIdTokenizer localeIdTokenizer, ParsedLocaleIdentifier parsedLocaleIdentifier) throws JSRangeErrorException, LocaleIdTokenizer.LocaleIdSubtagIterationFailed {<NEW_LINE>if (!localeIdTokenizer.hasMoreSubtags())<NEW_LINE>throw new JSRangeErrorException("Extension sequence expected.");<NEW_LINE>LocaleIdTokenizer.LocaleIdSubtag nextSubtag = localeIdTokenizer.nextSubtag();<NEW_LINE>if (nextSubtag.isUnicodeLanguageSubtag()) {<NEW_LINE>parseLanguageId(inLocaleId, <MASK><NEW_LINE>// nextSubtag = localeIdTokenizer.currentSubtag();<NEW_LINE>} else if (nextSubtag.isTranformedExtensionTKey()) {<NEW_LINE>parseTransformedExtensionFields(inLocaleId, localeIdTokenizer, nextSubtag, parsedLocaleIdentifier);<NEW_LINE>} else {<NEW_LINE>throw new JSRangeErrorException(String.format("Unexpected token [%s] in transformed extension sequence [%s]", nextSubtag.toString(), inLocaleId));<NEW_LINE>}<NEW_LINE>} | localeIdTokenizer, nextSubtag, true, parsedLocaleIdentifier); |
1,206,988 | // Implement AdEvent.AdEventListener.<NEW_LINE>@MainThread<NEW_LINE>@Override<NEW_LINE>public void onAdEvent(AdEvent event) {<NEW_LINE>AdPlaybackState newAdPlaybackState = adPlaybackState;<NEW_LINE>switch(event.getType()) {<NEW_LINE>case CUEPOINTS_CHANGED:<NEW_LINE>// CUEPOINTS_CHANGED event is firing multiple times with the same queue points.<NEW_LINE>if (!isLiveStream && newAdPlaybackState.equals(AdPlaybackState.NONE)) {<NEW_LINE>newAdPlaybackState = setVodAdGroupPlaceholders(checkNotNull(streamManager).getCuePoints(), new AdPlaybackState(adsId));<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case LOADED:<NEW_LINE>if (isLiveStream) {<NEW_LINE>Timeline timeline = player.getCurrentTimeline();<NEW_LINE>Timeline.Window window = timeline.getWindow(player.getCurrentMediaItemIndex(), new Timeline.Window());<NEW_LINE>if (window.lastPeriodIndex > window.firstPeriodIndex) {<NEW_LINE>// multi-period live not integrated<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>long positionInWindowUs = timeline.getPeriod(player.getCurrentPeriodIndex(), new Timeline.Period()).positionInWindowUs;<NEW_LINE>long currentPeriodPosition = msToUs(player.getContentPosition()) - positionInWindowUs;<NEW_LINE>newAdPlaybackState = addLiveAdBreak(event.getAd(), currentPeriodPosition, newAdPlaybackState.equals(AdPlaybackState.NONE) ? new AdPlaybackState(adsId) : newAdPlaybackState);<NEW_LINE>} else {<NEW_LINE>newAdPlaybackState = setVodAdInPlaceholder(event.getAd(), newAdPlaybackState);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case SKIPPED:<NEW_LINE>if (!isLiveStream) {<NEW_LINE>newAdPlaybackState = skipAd(<MASK><NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>// Do nothing.<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>setAdPlaybackState(newAdPlaybackState);<NEW_LINE>} | event.getAd(), newAdPlaybackState); |
1,338,653 | static public KrollDict placeFromAddress(Address address) {<NEW_LINE>final KrollDict place = new KrollDict();<NEW_LINE>// Create place entry data.<NEW_LINE>place.put(TiC.PROPERTY_STREET1, address.getThoroughfare());<NEW_LINE>place.put(TiC.PROPERTY_STREET, address.getThoroughfare());<NEW_LINE>place.put(TiC.PROPERTY_CITY, address.getLocality());<NEW_LINE>place.put(TiC.PROPERTY_REGION1, address.getAdminArea());<NEW_LINE>place.put(TiC.<MASK><NEW_LINE>place.put(TiC.PROPERTY_POSTAL_CODE, address.getPostalCode());<NEW_LINE>place.put(TiC.PROPERTY_COUNTRY, address.getCountryName());<NEW_LINE>place.put(TiC.PROPERTY_STATE, address.getAdminArea());<NEW_LINE>place.put(TiC.PROPERTY_COUNTRY_CODE, address.getCountryCode());<NEW_LINE>place.put(TiC.PROPERTY_LONGITUDE, address.getLongitude());<NEW_LINE>place.put(TiC.PROPERTY_LATITUDE, address.getLatitude());<NEW_LINE>// Construct full address.<NEW_LINE>final StringBuilder addressBuilder = new StringBuilder();<NEW_LINE>for (int i = 0; i <= address.getMaxAddressLineIndex(); i++) {<NEW_LINE>if (i > 0) {<NEW_LINE>addressBuilder.append(System.lineSeparator());<NEW_LINE>}<NEW_LINE>addressBuilder.append(address.getAddressLine(i));<NEW_LINE>}<NEW_LINE>place.put(TiC.PROPERTY_ADDRESS, addressBuilder.toString());<NEW_LINE>// Replace `null` with empty string like previous behaviour.<NEW_LINE>// Only non-strings are PROPERTY_LATITUDE and PROPERTY_LONGITUDE.<NEW_LINE>// Which would have thrown an exception if unavailable (cant be null).<NEW_LINE>for (final String key : place.keySet()) {<NEW_LINE>if (place.get(key) == null) {<NEW_LINE>place.put(key, "");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return place;<NEW_LINE>} | PROPERTY_REGION2, address.getSubAdminArea()); |
637,789 | public String makeHtml(FitNesseContext context, WikiPage page) {<NEW_LINE>PageData pageData = page.getData();<NEW_LINE>HtmlPage html = context.pageFactory.newPage();<NEW_LINE>WikiPagePath fullPath = page.getFullPath();<NEW_LINE>String fullPathName = PathParser.render(fullPath);<NEW_LINE>PageTitle pt = new PageTitle(fullPath);<NEW_LINE>String tags = pageData.getAttribute(PageData.PropertySUITES);<NEW_LINE>pt.setPageTags(tags);<NEW_LINE>html.setTitle(fullPathName);<NEW_LINE>html.setPageTitle(pt.notLinked());<NEW_LINE>html.setNavTemplate("wikiNav.vm");<NEW_LINE>html.put("actions", new WikiPageActions(page));<NEW_LINE>html.put("helpText", pageData.getProperties().get(PageData.PropertyHELP));<NEW_LINE>if (WikiPageUtil.isTestPage(page)) {<NEW_LINE>// Add test url inputs to context's variableSource.<NEW_LINE>WikiTestPage testPage = new TestPageWithSuiteSetUpAndTearDown(page);<NEW_LINE>html.put("content", new WikiTestPageRenderer(testPage));<NEW_LINE>} else {<NEW_LINE>html.put(<MASK><NEW_LINE>}<NEW_LINE>html.setMainTemplate("wikiPage");<NEW_LINE>html.setFooterTemplate("wikiFooter");<NEW_LINE>html.put("footerContent", new WikiPageFooterRenderer(page));<NEW_LINE>handleSpecialProperties(html, page);<NEW_LINE>return html.html(request);<NEW_LINE>} | "content", new WikiPageRenderer(page)); |
1,720,969 | protected static void appendNavUrlQueryParams(final StringBuilder sb, final QueryParams theQuery, final boolean authenticatedFeatures) {<NEW_LINE>sb.append("&maximumRecords=");<NEW_LINE>sb.append(theQuery.itemsPerPage());<NEW_LINE>sb.append("&resource=");<NEW_LINE>sb.append((theQuery.isLocal()) ? "local" : "global");<NEW_LINE>sb.append("&verify=");<NEW_LINE>sb.append(theQuery.snippetCacheStrategy == null ? "false" : theQuery.snippetCacheStrategy.toName());<NEW_LINE>sb.append("&prefermaskfilter=");<NEW_LINE>sb.append(theQuery.prefer);<NEW_LINE>sb.append("&cat=href");<NEW_LINE>sb.append("&constraint=");<NEW_LINE>sb.append((theQuery.constraint == null) ? "" : theQuery.constraint.exportB64());<NEW_LINE>sb.append("&contentdom=");<NEW_LINE>sb.append(theQuery.contentdom.toString());<NEW_LINE>sb.append("&strictContentDom=");<NEW_LINE>sb.append(String.valueOf(theQuery.isStrictContentDom()));<NEW_LINE>sb.append("&meanCount=");<NEW_LINE>sb.append(theQuery.getMaxSuggestions());<NEW_LINE>sb.append("&former=");<NEW_LINE>sb.append(theQuery.getQueryGoal<MASK><NEW_LINE>if (authenticatedFeatures) {<NEW_LINE>sb.append("&auth");<NEW_LINE>}<NEW_LINE>} | ().getQueryString(true)); |
1,437,345 | private static void verifyEdgesConditionQuery(ConditionQuery query) {<NEW_LINE>assert query.resultType().isEdge();<NEW_LINE>int total = query.conditionsSize();<NEW_LINE>if (total == 1) {<NEW_LINE>if (query.containsCondition(HugeKeys.LABEL) || query.containsCondition(HugeKeys.PROPERTIES) || query.containsScanRelation()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int matched = 0;<NEW_LINE>for (HugeKeys key : EdgeId.KEYS) {<NEW_LINE>Object <MASK><NEW_LINE>if (value == null) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>matched++;<NEW_LINE>}<NEW_LINE>int count = matched;<NEW_LINE>if (query.containsCondition(HugeKeys.PROPERTIES)) {<NEW_LINE>matched++;<NEW_LINE>if (count < 3 && query.containsCondition(HugeKeys.LABEL)) {<NEW_LINE>matched++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (matched != total) {<NEW_LINE>throw new HugeException("Not supported querying edges by %s, expect %s", query.conditions(), EdgeId.KEYS[count]);<NEW_LINE>}<NEW_LINE>} | value = query.condition(key); |
768,054 | public void refresh() throws Exception {<NEW_LINE>InstanceStatus serverStatuses = clientManager.getServerDataApiClient().getServerStatuses();<NEW_LINE>List<RemoteProxy> proxys = new ArrayList<>(serverStatuses.server2WorkerInfo.size());<NEW_LINE>Set<WorkerInfo> workerInfoSet = new TreeSet<>(serverStatuses.getWorkInfo(RoleType.EXECUTOR));<NEW_LINE>for (WorkerInfo v : workerInfoSet) {<NEW_LINE>if (serverStatuses.assignments.containsKey(v.id)) {<NEW_LINE>ServerAssignment serverAssignment = serverStatuses.readServerAssignment(v.id);<NEW_LINE>serverAssignment.getPartitions().forEach(p -> partitionDistri.put<MASK><NEW_LINE>proxys.add(new RemoteProxy(v.endpoint.getIp(), v.endpoint.getPort(), 120L, schemaFetcher, this));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<Endpoint> endpointList = workerInfoSet.stream().map(workerInfo -> workerInfo.endpoint).collect(toList());<NEW_LINE>LOG.info("proxys: {}", JSON.toJson(endpointList));<NEW_LINE>List<RemoteProxy> prevProxyList = this.proxys;<NEW_LINE>this.proxys = proxys;<NEW_LINE>try {<NEW_LINE>for (RemoteProxy remoteProxy : prevProxyList) {<NEW_LINE>remoteProxy.close();<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>LOG.info("Close all previous remote proxy");<NEW_LINE>}<NEW_LINE>// TODO : dynamic configuration of different Graph Partitioner;<NEW_LINE>this.partitioner = new DefaultGraphPartitioner(schemaFetcher.getPartitionNum());<NEW_LINE>} | (p, v.id)); |
1,174,646 | public ORawBuffer readRecordIfVersionIsNotLatest(final long clusterPosition, final int recordVersion) throws IOException, ORecordNotFoundException {<NEW_LINE>atomicOperationsManager.acquireReadLock(this);<NEW_LINE>try {<NEW_LINE>acquireSharedLock();<NEW_LINE>try {<NEW_LINE>final OAtomicOperation atomicOperation = atomicOperationsManager.getCurrentOperation();<NEW_LINE>final OClusterPositionMapBucket.PositionEntry positionEntry = clusterPositionMap.<MASK><NEW_LINE>if (positionEntry == null) {<NEW_LINE>throw new ORecordNotFoundException(new ORecordId(id, clusterPosition), "Record for cluster with id " + id + " and position " + clusterPosition + " is absent.");<NEW_LINE>}<NEW_LINE>final int recordPosition = positionEntry.getRecordPosition();<NEW_LINE>final long pageIndex = positionEntry.getPageIndex();<NEW_LINE>int loadedRecordVersion;<NEW_LINE>final OCacheEntry cacheEntry = loadPageForRead(atomicOperation, fileId, pageIndex, false);<NEW_LINE>try {<NEW_LINE>final OClusterPage localPage = new OClusterPage(cacheEntry);<NEW_LINE>if (localPage.isDeleted(recordPosition)) {<NEW_LINE>throw new ORecordNotFoundException(new ORecordId(id, clusterPosition), "Record for cluster with id " + id + " and position " + clusterPosition + " is absent.");<NEW_LINE>}<NEW_LINE>loadedRecordVersion = localPage.getRecordVersion(recordPosition);<NEW_LINE>} finally {<NEW_LINE>releasePageFromRead(atomicOperation, cacheEntry);<NEW_LINE>}<NEW_LINE>if (loadedRecordVersion > recordVersion) {<NEW_LINE>return readRecord(clusterPosition, false);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} finally {<NEW_LINE>releaseSharedLock();<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>atomicOperationsManager.releaseReadLock(this);<NEW_LINE>}<NEW_LINE>} | get(clusterPosition, 1, atomicOperation); |
278,749 | public void actionPerformed(ActionEvent e) {<NEW_LINE>X509Metadata metadata = new X509Metadata("whocares", "whocares");<NEW_LINE>File certificatesConfigFile = new File(folder, X509Utils.CA_CONFIG);<NEW_LINE>FileBasedConfig config = new FileBasedConfig(certificatesConfigFile, FS.detect());<NEW_LINE>NewCertificateConfig certificateConfig = null;<NEW_LINE>if (certificatesConfigFile.exists()) {<NEW_LINE>try {<NEW_LINE>config.load();<NEW_LINE>} catch (Exception x) {<NEW_LINE>Utils.showException(GitblitAuthority.this, x);<NEW_LINE>}<NEW_LINE>certificateConfig = NewCertificateConfig.KEY.parse(config);<NEW_LINE>certificateConfig.update(metadata);<NEW_LINE>}<NEW_LINE>InputVerifier verifier = new InputVerifier() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean verify(JComponent comp) {<NEW_LINE>boolean returnValue;<NEW_LINE>JTextField textField = (JTextField) comp;<NEW_LINE>try {<NEW_LINE>Integer.parseInt(textField.getText());<NEW_LINE>returnValue = true;<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>returnValue = false;<NEW_LINE>}<NEW_LINE>return returnValue;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>JTextField siteNameTF = new JTextField(20);<NEW_LINE>siteNameTF.setText(gitblitSettings.getString(Keys.web.siteName, "Gitblit"));<NEW_LINE>JPanel siteNamePanel = Utils.newFieldPanel(Translation.get("gb.siteName"), siteNameTF, Translation.get("gb.siteNameDescription"));<NEW_LINE>JTextField validityTF = new JTextField(4);<NEW_LINE>validityTF.setInputVerifier(verifier);<NEW_LINE>validityTF.setVerifyInputWhenFocusTarget(true);<NEW_LINE>validityTF.<MASK><NEW_LINE>JPanel validityPanel = Utils.newFieldPanel(Translation.get("gb.validity"), validityTF, Translation.get("gb.duration.days").replace("{0}", "").trim());<NEW_LINE>JPanel p1 = new JPanel(new GridLayout(0, 1, 5, 2));<NEW_LINE>p1.add(siteNamePanel);<NEW_LINE>p1.add(validityPanel);<NEW_LINE>DefaultOidsPanel oids = new DefaultOidsPanel(metadata);<NEW_LINE>JPanel panel = new JPanel(new BorderLayout());<NEW_LINE>panel.add(p1, BorderLayout.NORTH);<NEW_LINE>panel.add(oids, BorderLayout.CENTER);<NEW_LINE>int result = JOptionPane.showConfirmDialog(GitblitAuthority.this, panel, Translation.get("gb.newCertificateDefaults"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, new ImageIcon(getClass().getResource("/settings_32x32.png")));<NEW_LINE>if (result == JOptionPane.OK_OPTION) {<NEW_LINE>try {<NEW_LINE>oids.update(metadata);<NEW_LINE>certificateConfig.duration = Integer.parseInt(validityTF.getText());<NEW_LINE>certificateConfig.store(config, metadata);<NEW_LINE>config.save();<NEW_LINE>Map<String, String> updates = new HashMap<String, String>();<NEW_LINE>updates.put(Keys.web.siteName, siteNameTF.getText());<NEW_LINE>gitblitSettings.saveSettings(updates);<NEW_LINE>} catch (Exception e1) {<NEW_LINE>Utils.showException(GitblitAuthority.this, e1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | setText("" + certificateConfig.duration); |
1,652,153 | public void execute(ComplexEventChunk streamEventChunk) {<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("Event Chunk received by the Aggregation " + aggregatorName + " for duration " + this.duration + " will be dropped since persisted aggregation has been scheduled ");<NEW_LINE>}<NEW_LINE>streamEventChunk.reset();<NEW_LINE>while (streamEventChunk.hasNext()) {<NEW_LINE>StreamEvent streamEvent = <MASK><NEW_LINE>streamEventChunk.remove();<NEW_LINE>ExecutorState executorState = stateHolder.getState();<NEW_LINE>try {<NEW_LINE>long timestamp = getTimestamp(streamEvent);<NEW_LINE>if (timestamp >= executorState.nextEmitTime) {<NEW_LINE>log.debug("Next EmitTime: " + executorState.nextEmitTime + ", Current Time: " + timestamp);<NEW_LINE>long emittedTime = executorState.nextEmitTime;<NEW_LINE>long startedTime = executorState.startTimeOfAggregates;<NEW_LINE>executorState.startTimeOfAggregates = IncrementalTimeConverterUtil.getStartTimeOfAggregates(timestamp, duration, timeZone);<NEW_LINE>executorState.nextEmitTime = IncrementalTimeConverterUtil.getNextEmitTime(timestamp, duration, timeZone);<NEW_LINE>dispatchAggregateEvents(startedTime, emittedTime, timeZone);<NEW_LINE>sendTimerEvent(executorState);<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>stateHolder.returnState(executorState);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | (StreamEvent) streamEventChunk.next(); |
27,616 | public RelDataType deriveType(SqlValidator validator, SqlValidatorScope scope, SqlCall call) {<NEW_LINE>// Validate type of the inner aggregate call<NEW_LINE>validateOperands(validator, scope, call);<NEW_LINE>// Assume the first operand is an aggregate call and derive its type.<NEW_LINE>SqlNode agg = call.operand(0);<NEW_LINE>if (!(agg instanceof SqlCall)) {<NEW_LINE>throw new IllegalStateException("Argument to SqlOverOperator" + " should be SqlCall, got " + agg.getClass() + ": " + agg);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>// Pretend that group-count is 0. This tells the aggregate function that it<NEW_LINE>// might be invoked with 0 rows in a group. Most aggregate functions will<NEW_LINE>// return NULL in this case.<NEW_LINE>SqlCallBinding opBinding = new SqlCallBinding(validator, scope, aggCall) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int getGroupCount() {<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>RelDataType ret = aggCall.getOperator().inferReturnType(opBinding);<NEW_LINE>// Copied from validateOperands<NEW_LINE>((SqlValidatorImpl) validator).setValidatedNodeType(call, ret);<NEW_LINE>((SqlValidatorImpl) validator).setValidatedNodeType(agg, ret);<NEW_LINE>return ret;<NEW_LINE>} | final SqlCall aggCall = (SqlCall) agg; |
524,599 | protected void calculateStatistics(List<RouteSegmentResult> result) {<NEW_LINE>InputStream is = RenderingRulesStorage.class.getResourceAsStream("default.render.xml");<NEW_LINE>final Map<String, String> renderingConstants = new LinkedHashMap<String, String>();<NEW_LINE>try {<NEW_LINE>InputStream pis = RenderingRulesStorage.class.getResourceAsStream("default.render.xml");<NEW_LINE>try {<NEW_LINE>XmlPullParser parser = PlatformUtil.newXMLPullParser();<NEW_LINE>parser.setInput(pis, "UTF-8");<NEW_LINE>int tok;<NEW_LINE>while ((tok = parser.next()) != XmlPullParser.END_DOCUMENT) {<NEW_LINE>if (tok == XmlPullParser.START_TAG) {<NEW_LINE>String tagName = parser.getName();<NEW_LINE>if (tagName.equals("renderingConstant")) {<NEW_LINE>if (!renderingConstants.containsKey(parser.getAttributeValue("", "name"))) {<NEW_LINE>renderingConstants.put(parser.getAttributeValue("", "name"), parser.getAttributeValue("", "value"));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>pis.close();<NEW_LINE>}<NEW_LINE>RenderingRulesStorage rrs <MASK><NEW_LINE>rrs.parseRulesFromXmlInputStream(is, new RenderingRulesStorageResolver() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public RenderingRulesStorage resolve(String name, RenderingRulesStorageResolver ref) throws XmlPullParserException, IOException {<NEW_LINE>throw new UnsupportedOperationException();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>RenderingRuleSearchRequest req = new RenderingRuleSearchRequest(rrs);<NEW_LINE>List<RouteStatistics> rsr = RouteStatisticsHelper.calculateRouteStatistic(result, null, rrs, null, req);<NEW_LINE>for (RouteStatistics r : rsr) {<NEW_LINE>System.out.println(r);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new IllegalStateException(e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | = new RenderingRulesStorage("default", renderingConstants); |
864,425 | /*<NEW_LINE>* @see com.sitewhere.grpc.service.DeviceEventManagementGrpc.<NEW_LINE>* DeviceEventManagementImplBase#listAlertsForIndex(com.sitewhere.grpc.service.<NEW_LINE>* GListAlertsForIndexRequest, io.grpc.stub.StreamObserver)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public void listAlertsForIndex(GListAlertsForIndexRequest request, StreamObserver<GListAlertsForIndexResponse> responseObserver) {<NEW_LINE>try {<NEW_LINE>GrpcUtils.handleServerMethodEntry(this, DeviceEventManagementGrpc.getListAlertsForIndexMethod());<NEW_LINE>ISearchResults<IDeviceAlert> apiResult = getDeviceEventManagement().listDeviceAlertsForIndex(EventModelConverter.asApiDeviceEventIndex(request.getIndex()), CommonModelConverter.asApiUuids(request.getEntityIdsList()), CommonModelConverter.asDateRangeSearchCriteria(request.getCriteria()));<NEW_LINE>GListAlertsForIndexResponse.Builder response = GListAlertsForIndexResponse.newBuilder();<NEW_LINE>GDeviceAlertSearchResults.<MASK><NEW_LINE>for (IDeviceAlert api : apiResult.getResults()) {<NEW_LINE>results.addAlerts(EventModelConverter.asGrpcDeviceAlert(api));<NEW_LINE>}<NEW_LINE>results.setCount(apiResult.getNumResults());<NEW_LINE>response.setResults(results.build());<NEW_LINE>responseObserver.onNext(response.build());<NEW_LINE>responseObserver.onCompleted();<NEW_LINE>} catch (Throwable e) {<NEW_LINE>GrpcUtils.handleServerMethodException(DeviceEventManagementGrpc.getListAlertsForIndexMethod(), e, responseObserver);<NEW_LINE>} finally {<NEW_LINE>GrpcUtils.handleServerMethodExit(DeviceEventManagementGrpc.getListAlertsForIndexMethod());<NEW_LINE>}<NEW_LINE>} | Builder results = GDeviceAlertSearchResults.newBuilder(); |
681,460 | public static byte[] resizeKey(byte[] in, int inOffset, int cbIn, int cbOut) {<NEW_LINE>if (cbOut == 0)<NEW_LINE>return new byte[0];<NEW_LINE>byte[] hash;<NEW_LINE>if (cbOut <= 32) {<NEW_LINE>hash = hashSha256(in, inOffset, cbIn);<NEW_LINE>} else {<NEW_LINE>hash = hashSha512(in, inOffset, cbIn);<NEW_LINE>}<NEW_LINE>if (cbOut == hash.length) {<NEW_LINE>return hash;<NEW_LINE>}<NEW_LINE>byte[] ret = new byte[cbOut];<NEW_LINE>if (cbOut < hash.length) {<NEW_LINE>System.arraycopy(hash, 0, ret, 0, cbOut);<NEW_LINE>} else {<NEW_LINE>int pos = 0;<NEW_LINE>long r = 0;<NEW_LINE>while (pos < cbOut) {<NEW_LINE>Mac hmac;<NEW_LINE>try {<NEW_LINE>hmac = Mac.getInstance("HmacSHA256");<NEW_LINE>} catch (NoSuchAlgorithmException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>byte[] pbR = LEDataOutputStream.writeLongBuf(r);<NEW_LINE>byte[] <MASK><NEW_LINE>int copy = Math.min(cbOut - pos, part.length);<NEW_LINE>assert (copy > 0);<NEW_LINE>System.arraycopy(part, 0, ret, pos, copy);<NEW_LINE>pos += copy;<NEW_LINE>r++;<NEW_LINE>Arrays.fill(part, (byte) 0);<NEW_LINE>}<NEW_LINE>assert (pos == cbOut);<NEW_LINE>}<NEW_LINE>Arrays.fill(hash, (byte) 0);<NEW_LINE>return ret;<NEW_LINE>} | part = hmac.doFinal(pbR); |
1,024,823 | public static GetSubscriptionItemDetailResponse unmarshall(GetSubscriptionItemDetailResponse getSubscriptionItemDetailResponse, UnmarshallerContext _ctx) {<NEW_LINE>getSubscriptionItemDetailResponse.setRequestId(_ctx.stringValue("GetSubscriptionItemDetailResponse.RequestId"));<NEW_LINE>getSubscriptionItemDetailResponse.setMessage(_ctx.stringValue("GetSubscriptionItemDetailResponse.Message"));<NEW_LINE>getSubscriptionItemDetailResponse.setCode(_ctx.stringValue("GetSubscriptionItemDetailResponse.Code"));<NEW_LINE>getSubscriptionItemDetailResponse.setSuccess(_ctx.booleanValue("GetSubscriptionItemDetailResponse.Success"));<NEW_LINE>SubscriptionItemDetail subscriptionItemDetail = new SubscriptionItemDetail();<NEW_LINE>subscriptionItemDetail.setPmsgStatus(_ctx.integerValue("GetSubscriptionItemDetailResponse.SubscriptionItemDetail.PmsgStatus"));<NEW_LINE>subscriptionItemDetail.setWebhookStatus(_ctx.integerValue("GetSubscriptionItemDetailResponse.SubscriptionItemDetail.WebhookStatus"));<NEW_LINE>subscriptionItemDetail.setDescription(_ctx.stringValue("GetSubscriptionItemDetailResponse.SubscriptionItemDetail.Description"));<NEW_LINE>subscriptionItemDetail.setSmsStatus(_ctx.integerValue("GetSubscriptionItemDetailResponse.SubscriptionItemDetail.SmsStatus"));<NEW_LINE>subscriptionItemDetail.setChannel<MASK><NEW_LINE>subscriptionItemDetail.setEmailStatus(_ctx.integerValue("GetSubscriptionItemDetailResponse.SubscriptionItemDetail.EmailStatus"));<NEW_LINE>subscriptionItemDetail.setTtsStatus(_ctx.integerValue("GetSubscriptionItemDetailResponse.SubscriptionItemDetail.TtsStatus"));<NEW_LINE>subscriptionItemDetail.setItemName(_ctx.stringValue("GetSubscriptionItemDetailResponse.SubscriptionItemDetail.ItemName"));<NEW_LINE>subscriptionItemDetail.setRegionId(_ctx.stringValue("GetSubscriptionItemDetailResponse.SubscriptionItemDetail.RegionId"));<NEW_LINE>subscriptionItemDetail.setItemId(_ctx.integerValue("GetSubscriptionItemDetailResponse.SubscriptionItemDetail.ItemId"));<NEW_LINE>List<Contact> contacts = new ArrayList<Contact>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("GetSubscriptionItemDetailResponse.SubscriptionItemDetail.Contacts.Length"); i++) {<NEW_LINE>Contact contact = new Contact();<NEW_LINE>contact.setEmail(_ctx.stringValue("GetSubscriptionItemDetailResponse.SubscriptionItemDetail.Contacts[" + i + "].Email"));<NEW_LINE>contact.setIsAccount(_ctx.booleanValue("GetSubscriptionItemDetailResponse.SubscriptionItemDetail.Contacts[" + i + "].IsAccount"));<NEW_LINE>contact.setPosition(_ctx.stringValue("GetSubscriptionItemDetailResponse.SubscriptionItemDetail.Contacts[" + i + "].Position"));<NEW_LINE>contact.setIsVerifiedEmail(_ctx.booleanValue("GetSubscriptionItemDetailResponse.SubscriptionItemDetail.Contacts[" + i + "].IsVerifiedEmail"));<NEW_LINE>contact.setLastMobileVerificationTimeStamp(_ctx.longValue("GetSubscriptionItemDetailResponse.SubscriptionItemDetail.Contacts[" + i + "].LastMobileVerificationTimeStamp"));<NEW_LINE>contact.setIsObsolete(_ctx.booleanValue("GetSubscriptionItemDetailResponse.SubscriptionItemDetail.Contacts[" + i + "].IsObsolete"));<NEW_LINE>contact.setIsVerifiedMobile(_ctx.booleanValue("GetSubscriptionItemDetailResponse.SubscriptionItemDetail.Contacts[" + i + "].IsVerifiedMobile"));<NEW_LINE>contact.setContactId(_ctx.longValue("GetSubscriptionItemDetailResponse.SubscriptionItemDetail.Contacts[" + i + "].ContactId"));<NEW_LINE>contact.setAccountUID(_ctx.longValue("GetSubscriptionItemDetailResponse.SubscriptionItemDetail.Contacts[" + i + "].AccountUID"));<NEW_LINE>contact.setMobile(_ctx.stringValue("GetSubscriptionItemDetailResponse.SubscriptionItemDetail.Contacts[" + i + "].Mobile"));<NEW_LINE>contact.setLastEmailVerificationTimeStamp(_ctx.longValue("GetSubscriptionItemDetailResponse.SubscriptionItemDetail.Contacts[" + i + "].LastEmailVerificationTimeStamp"));<NEW_LINE>contact.setName(_ctx.stringValue("GetSubscriptionItemDetailResponse.SubscriptionItemDetail.Contacts[" + i + "].Name"));<NEW_LINE>contacts.add(contact);<NEW_LINE>}<NEW_LINE>subscriptionItemDetail.setContacts(contacts);<NEW_LINE>List<Webhook> webhooks = new ArrayList<Webhook>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("GetSubscriptionItemDetailResponse.SubscriptionItemDetail.Webhooks.Length"); i++) {<NEW_LINE>Webhook webhook = new Webhook();<NEW_LINE>webhook.setServerUrl(_ctx.stringValue("GetSubscriptionItemDetailResponse.SubscriptionItemDetail.Webhooks[" + i + "].ServerUrl"));<NEW_LINE>webhook.setWebhookId(_ctx.longValue("GetSubscriptionItemDetailResponse.SubscriptionItemDetail.Webhooks[" + i + "].WebhookId"));<NEW_LINE>webhook.setName(_ctx.stringValue("GetSubscriptionItemDetailResponse.SubscriptionItemDetail.Webhooks[" + i + "].Name"));<NEW_LINE>webhooks.add(webhook);<NEW_LINE>}<NEW_LINE>subscriptionItemDetail.setWebhooks(webhooks);<NEW_LINE>getSubscriptionItemDetailResponse.setSubscriptionItemDetail(subscriptionItemDetail);<NEW_LINE>return getSubscriptionItemDetailResponse;<NEW_LINE>} | (_ctx.stringValue("GetSubscriptionItemDetailResponse.SubscriptionItemDetail.Channel")); |
1,107,367 | public static void main(String[] args) {<NEW_LINE>Exercise9 exercise9 = new Exercise9();<NEW_LINE>SeparateChainingHashTableWithDelete<Integer, Integer> separateChainingHashTableWithDelete = exercise9.new SeparateChainingHashTableWithDelete<>();<NEW_LINE>separateChainingHashTableWithDelete.put(1, 1);<NEW_LINE>separateChainingHashTableWithDelete.put(2, 2);<NEW_LINE>separateChainingHashTableWithDelete.put(3, 3);<NEW_LINE>separateChainingHashTableWithDelete.put(4, 4);<NEW_LINE>separateChainingHashTableWithDelete.put(5, 5);<NEW_LINE>separateChainingHashTableWithDelete.put(6, 6);<NEW_LINE>separateChainingHashTableWithDelete.put(7, 7);<NEW_LINE>StdOut.println("Keys");<NEW_LINE>for (Integer key : separateChainingHashTableWithDelete.keys()) {<NEW_LINE>StdOut.print(key + " ");<NEW_LINE>}<NEW_LINE>int[] keysToDelete = { -1, 1, 2, 7, 6, 4, 5, 3 };<NEW_LINE>for (int k : keysToDelete) {<NEW_LINE><MASK><NEW_LINE>separateChainingHashTableWithDelete.delete(k);<NEW_LINE>for (Integer key : separateChainingHashTableWithDelete.keys()) {<NEW_LINE>StdOut.print(key + " ");<NEW_LINE>}<NEW_LINE>StdOut.println("\nSize: " + separateChainingHashTableWithDelete.size());<NEW_LINE>}<NEW_LINE>} | StdOut.println("\nDelete key " + k); |
1,382,272 | /* public void operate(SimFunctionContext<String> context) {<NEW_LINE>String first = context.getFirstOperand();<NEW_LINE><MASK><NEW_LINE>double score1 = 0.0;<NEW_LINE>double score2 = 0.0;<NEW_LINE>double score = 0.0;<NEW_LINE>try {<NEW_LINE>if (!(first == null || first.trim().equals(""))) {<NEW_LINE>score1 = 1.0d;<NEW_LINE>}<NEW_LINE>if (!(second == null || second.trim().equals(""))) {<NEW_LINE>score2 = 1.0d;<NEW_LINE>}<NEW_LINE>if (score1 == 1.0d && score2 == 1.0d) {<NEW_LINE>SAffineGap gap = new SAffineGap();<NEW_LINE>SJaroWinkler gap1 = new SJaroWinkler();<NEW_LINE>String f = first.split("\\s+")[0];<NEW_LINE>String s = second.split("\\s+")[0];<NEW_LINE>if (!(f == null || f.trim().equals("")) && !(s == null || s.trim().equals(""))) {<NEW_LINE>score = gap.score(f.trim(), s.trim());<NEW_LINE>score1 = gap1.score(f.trim(), s.trim());<NEW_LINE><NEW_LINE>//LOG.debug(gap.explainScore(first, second));<NEW_LINE>gap = null;<NEW_LINE>}<NEW_LINE>LOG.debug("gap bw " + f + " and " + s + " is " +<NEW_LINE>score1 + "," + score2 + ", " + score);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.warn("Error processing differences for " + first + "," + second);<NEW_LINE>} finally {<NEW_LINE>context.addToResult(score1);<NEW_LINE>//context.addToResult(score2);<NEW_LINE>context.addToResult(score);<NEW_LINE>LOG.debug("Same first word gap bw " + first + " and " + second + " is " +<NEW_LINE>score1 + "," + score2 + ", " + score + ", " + score1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public Double call(String first, String second) {<NEW_LINE>if (first == null || first.trim().length() == 0)<NEW_LINE>return 1d;<NEW_LINE>if (second == null || second.trim().length() == 0)<NEW_LINE>return 1d;<NEW_LINE>String f = first.split("-")[0];<NEW_LINE>String s = second.split("-")[0];<NEW_LINE>double score = super.call(f, s);<NEW_LINE>// LOG.info(" score " + f + " " + s + " " + score);<NEW_LINE>return score;<NEW_LINE>} | String second = context.getSecondOperand(); |
1,128,922 | public void probeMemory() {<NEW_LINE>long freeMemoryBytes = Runtime.getRuntime().freeMemory();<NEW_LINE>long totalMemoryBytes = Runtime.getRuntime().totalMemory();<NEW_LINE>long maxMemoryBytes = Runtime.getRuntime().maxMemory();<NEW_LINE>long totalGcTimeMs = 0;<NEW_LINE>for (GarbageCollectorMXBean gcMxBean : ManagementFactory.getGarbageCollectorMXBeans()) {<NEW_LINE>long collectionTimeMs = gcMxBean.getCollectionTime();<NEW_LINE>if (collectionTimeMs == -1) {<NEW_LINE>// Gc collection time is not supported on this JVM.<NEW_LINE>totalGcTimeMs = -1;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>totalGcTimeMs += collectionTimeMs;<NEW_LINE>}<NEW_LINE>ImmutableMap.Builder<String, Long> currentMemoryBytesUsageByPool = ImmutableMap.builder();<NEW_LINE>for (MemoryPoolMXBean memoryPoolBean : ManagementFactory.getMemoryPoolMXBeans()) {<NEW_LINE><MASK><NEW_LINE>MemoryType type = memoryPoolBean.getType();<NEW_LINE>long currentlyUsedBytes = memoryPoolBean.getUsage().getUsed();<NEW_LINE>currentMemoryBytesUsageByPool.put(name + "(" + type + ")", currentlyUsedBytes);<NEW_LINE>}<NEW_LINE>eventBus.post(new MemoryPerfStatsEvent(freeMemoryBytes, totalMemoryBytes, maxMemoryBytes, totalGcTimeMs, currentMemoryBytesUsageByPool.build()));<NEW_LINE>} | String name = memoryPoolBean.getName(); |
1,458,314 | public static boolean fillFluidContainer(IFluidHandler handler, int slotIn, int slotOut, IntFunction<ItemStack> invGet, BiConsumer<Integer, ItemStack> invSet) {<NEW_LINE>ItemStack filledContainer = fillFluidContainer(handler, invGet.apply(slotIn), invGet.apply(slotOut), null);<NEW_LINE>if (!filledContainer.isEmpty()) {<NEW_LINE>if (invGet.apply(slotIn).getCount() == 1 && !isFluidContainerFull(filledContainer))<NEW_LINE>invSet.accept(<MASK><NEW_LINE>else {<NEW_LINE>if (!invGet.apply(slotOut).isEmpty() && ItemHandlerHelper.canItemStacksStack(filledContainer, invGet.apply(slotOut)))<NEW_LINE>invGet.apply(slotOut).grow(filledContainer.getCount());<NEW_LINE>else<NEW_LINE>invSet.accept(slotOut, filledContainer);<NEW_LINE>invGet.apply(slotIn).shrink(1);<NEW_LINE>if (invGet.apply(slotIn).getCount() <= 0)<NEW_LINE>invSet.accept(slotIn, ItemStack.EMPTY);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | slotIn, filledContainer.copy()); |
933,227 | public void apply() {<NEW_LINE><MASK><NEW_LINE>codeInsightSettings.COMPLETION_CASE_SENSITIVE = getCaseSensitiveValue();<NEW_LINE>codeInsightSettings.SELECT_AUTOPOPUP_SUGGESTIONS_BY_CHARS = myCbSelectByChars2.getValue();<NEW_LINE>codeInsightSettings.AUTOCOMPLETE_ON_CODE_COMPLETION = myCbOnCodeCompletion2.getValue();<NEW_LINE>codeInsightSettings.AUTOCOMPLETE_ON_SMART_TYPE_COMPLETION = myCbOnSmartTypeCompletion2.getValue();<NEW_LINE>codeInsightSettings.SHOW_FULL_SIGNATURES_IN_PARAMETER_INFO = myCbShowFullParameterSignatures2.getValue();<NEW_LINE>codeInsightSettings.AUTO_POPUP_PARAMETER_INFO = myCbParameterInfoPopup2.getValue();<NEW_LINE>codeInsightSettings.AUTO_POPUP_COMPLETION_LOOKUP = myCbAutocompletion2.getValue();<NEW_LINE>codeInsightSettings.AUTO_POPUP_JAVADOC_INFO = myCbAutopopupJavaDoc2.getValue();<NEW_LINE>codeInsightSettings.PARAMETER_INFO_DELAY = myParameterInfoDelayField2.getValueOrError();<NEW_LINE>codeInsightSettings.JAVADOC_INFO_DELAY = myAutopopupJavaDocField2.getValueOrError();<NEW_LINE>UISettings.getInstance().SORT_LOOKUP_ELEMENTS_LEXICOGRAPHICALLY = myCbSorting2.getValue();<NEW_LINE>Project project = DataManager.getInstance().getDataContext(myLayout).getData(CommonDataKeys.PROJECT);<NEW_LINE>if (project != null) {<NEW_LINE>DaemonCodeAnalyzer.getInstance(project).settingsChanged();<NEW_LINE>}<NEW_LINE>} | CodeInsightSettings codeInsightSettings = CodeInsightSettings.getInstance(); |
834,275 | public DataSet data() {<NEW_LINE>DataSet result = newDataSet();<NEW_LINE>StargateLocalInfo info = StargateSystemKeyspace.instance.getLocal().copy();<NEW_LINE>DataSet.RowBuilder rowBuilder = // + "bootstrapped text,"<NEW_LINE>result.newRowBuilder().addColumn("bootstrapped", // + "broadcast_address inet,"<NEW_LINE>() -> safeToString(BootstrapState.COMPLETED)).addColumn("broadcast_address", // + "cluster_name text,"<NEW_LINE>info::getBroadcastAddress).addColumn("cluster_name", // + "cql_version text,"<NEW_LINE>info::getClusterName).addColumn("cql_version", // + "gossip_generation int,"<NEW_LINE>() -> safeToString(info.getCqlVersion())).addColumn("gossip_generation", // + "listen_address inet,"<NEW_LINE>() -> null).addColumn("listen_address", // + "native_protocol_version text,"<NEW_LINE>info::getListenAddress).addColumn("native_protocol_version", // + "partitioner text,"<NEW_LINE>info::getNativeProtocolVersion).addColumn("partitioner", // + "truncated_at map<uuid, blob>,"<NEW_LINE>info::getPartitioner).addColumn("truncated_at", () -> null).addColumn<MASK><NEW_LINE>result.addRow(LocalNodeSystemView.KEY, completeRow(rowBuilder, info));<NEW_LINE>return result;<NEW_LINE>} | ("last_nodesync_checkpoint_time", () -> null); |
148,545 | private void assignExportedMethodsKeys(String moduleName, List<Map<String, Object>> exportedMethodsInfos) {<NEW_LINE>if (mExportedMethodsKeys.get(moduleName) == null) {<NEW_LINE>mExportedMethodsKeys.put(moduleName, new HashMap<String, Integer>());<NEW_LINE>}<NEW_LINE>if (mExportedMethodsReverseKeys.get(moduleName) == null) {<NEW_LINE>mExportedMethodsReverseKeys.put(moduleName, new SparseArray<String>());<NEW_LINE>}<NEW_LINE>for (int i = 0; i < exportedMethodsInfos.size(); i++) {<NEW_LINE>Map<String, Object> methodInfo = exportedMethodsInfos.get(i);<NEW_LINE>if (methodInfo.get(METHOD_INFO_NAME) == null || !(methodInfo.get(METHOD_INFO_NAME) instanceof String)) {<NEW_LINE>throw new RuntimeException("No method name in MethodInfo - " + methodInfo.toString());<NEW_LINE>}<NEW_LINE>String methodName = (<MASK><NEW_LINE>Integer maybePreviousIndex = mExportedMethodsKeys.get(moduleName).get(methodName);<NEW_LINE>if (maybePreviousIndex == null) {<NEW_LINE>int key = mExportedMethodsKeys.get(moduleName).values().size();<NEW_LINE>methodInfo.put(METHOD_INFO_KEY, key);<NEW_LINE>mExportedMethodsKeys.get(moduleName).put(methodName, key);<NEW_LINE>mExportedMethodsReverseKeys.get(moduleName).put(key, methodName);<NEW_LINE>} else {<NEW_LINE>int key = maybePreviousIndex;<NEW_LINE>methodInfo.put(METHOD_INFO_KEY, key);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | String) methodInfo.get(METHOD_INFO_NAME); |
1,675,805 | public InstanceMetadata unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>InstanceMetadata instanceMetadata = new InstanceMetadata();<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("InstanceArn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>instanceMetadata.setInstanceArn(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("IdentityStoreId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>instanceMetadata.setIdentityStoreId(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 instanceMetadata;<NEW_LINE>} | class).unmarshall(context)); |
1,668,113 | void processBuilds(TeletraanServiceContext workerContext) throws Exception {<NEW_LINE>BuildDAO buildDAO = workerContext.getBuildDAO();<NEW_LINE>UtilDAO utilDAO = workerContext.getUtilDAO();<NEW_LINE>long timeToKeep = (long) workerContext.getMaxDaysToKeep() * MILLIS_PER_DAY;<NEW_LINE>long maxToKeep = (long) workerContext.getMaxBuildsToKeep();<NEW_LINE>long timeThreshold = System.currentTimeMillis() - timeToKeep;<NEW_LINE>List<String<MASK><NEW_LINE>Collections.shuffle(buildNames);<NEW_LINE>for (String buildName : buildNames) {<NEW_LINE>long numToDelete = buildDAO.countBuildsByName(buildName) - maxToKeep;<NEW_LINE>if (numToDelete > 0) {<NEW_LINE>String buildLockName = String.format("BUILDJANITOR-%s", buildName);<NEW_LINE>Connection connection = utilDAO.getLock(buildLockName);<NEW_LINE>if (connection != null) {<NEW_LINE>LOG.info(String.format("DB lock operation is successful: get lock %s", buildLockName));<NEW_LINE>try {<NEW_LINE>buildDAO.deleteUnusedBuilds(buildName, timeThreshold, numToDelete);<NEW_LINE>LOG.info(String.format("Successfully removed builds: %s before %d milliseconds has %d.", buildName, timeThreshold, numToDelete));<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.error("Failed to delete builds from tables.", e);<NEW_LINE>} finally {<NEW_LINE>utilDAO.releaseLock(buildLockName, connection);<NEW_LINE>LOG.info(String.format("DB lock operation is successful: release lock %s", buildLockName));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>LOG.warn(String.format("DB lock operation fails: failed to get lock %s", buildLockName));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | > buildNames = buildDAO.getAllBuildNames(); |
571,048 | private void writeActivationOS(ActivationOS activationOS, String tagName, XmlSerializer serializer) throws java.io.IOException {<NEW_LINE>serializer.startTag(NAMESPACE, tagName);<NEW_LINE>flush(serializer);<NEW_LINE>StringBuffer b = b(serializer);<NEW_LINE>int start = b.length();<NEW_LINE>if (activationOS.getName() != null) {<NEW_LINE>writeValue(serializer, "name", <MASK><NEW_LINE>}<NEW_LINE>if (activationOS.getFamily() != null) {<NEW_LINE>writeValue(serializer, "family", activationOS.getFamily(), activationOS);<NEW_LINE>}<NEW_LINE>if (activationOS.getArch() != null) {<NEW_LINE>writeValue(serializer, "arch", activationOS.getArch(), activationOS);<NEW_LINE>}<NEW_LINE>if (activationOS.getVersion() != null) {<NEW_LINE>writeValue(serializer, "version", activationOS.getVersion(), activationOS);<NEW_LINE>}<NEW_LINE>serializer.endTag(NAMESPACE, tagName).flush();<NEW_LINE>logLocation(activationOS, "", start, b.length());<NEW_LINE>} | activationOS.getName(), activationOS); |
1,475,919 | public NaiveBayesTextModelData deserializeModel(Params meta, Iterable<String> data, Iterable<Object> distinctLabels) {<NEW_LINE>NaiveBayesTextModelData modelData = new NaiveBayesTextModelData();<NEW_LINE>String json = data.iterator().next();<NEW_LINE>NaiveBayesTextProbInfo dataInfo = JsonConverter.fromJson(json, NaiveBayesTextProbInfo.class);<NEW_LINE>modelData.pi = dataInfo.piArray;<NEW_LINE>modelData.theta = dataInfo.theta;<NEW_LINE>modelData.vectorSize = dataInfo.vectorSize;<NEW_LINE>modelData.labels = Iterables.toArray(distinctLabels, Object.class);<NEW_LINE>modelData.vectorColName = meta.get(NaiveBayesTextTrainParams.VECTOR_COL);<NEW_LINE>modelData.modelType = meta.get(NaiveBayesTextTrainParams.MODEL_TYPE);<NEW_LINE>int featLen = modelData.theta.numCols();<NEW_LINE>modelData.featureCols = meta.get(HasFeatureCols.FEATURE_COLS);<NEW_LINE>int rowSize <MASK><NEW_LINE>modelData.phi = new double[rowSize];<NEW_LINE>modelData.minMat = new DenseMatrix(rowSize, featLen);<NEW_LINE>// construct special model data for the bernoulli model.<NEW_LINE>if (ModelType.Bernoulli.equals(modelData.modelType)) {<NEW_LINE>for (int i = 0; i < rowSize; ++i) {<NEW_LINE>for (int j = 0; j < featLen; ++j) {<NEW_LINE>double tmp = Math.log(1 - Math.exp(modelData.theta.get(i, j)));<NEW_LINE>modelData.phi[i] += tmp;<NEW_LINE>modelData.minMat.set(i, j, modelData.theta.get(i, j) - tmp);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return modelData;<NEW_LINE>} | = modelData.theta.numRows(); |
308,072 | private ListenableFuture<?> rollupOneFromRows(int rollupLevel, String agentRollupId, String syntheticMonitorId, long to, int adjustedTTL, Iterable<Row> rows) throws Exception {<NEW_LINE>double totalDurationNanos = 0;<NEW_LINE>long executionCount = 0;<NEW_LINE>ErrorIntervalCollector errorIntervalCollector = new ErrorIntervalCollector();<NEW_LINE>for (Row row : rows) {<NEW_LINE>int i = 0;<NEW_LINE>totalDurationNanos += row.getDouble(i++);<NEW_LINE>executionCount += row.getLong(i++);<NEW_LINE>ByteBuffer errorIntervalsBytes = row.getBytes(i++);<NEW_LINE>if (errorIntervalsBytes == null) {<NEW_LINE>errorIntervalCollector.addGap();<NEW_LINE>} else {<NEW_LINE>List<Stored.ErrorInterval> errorIntervals = Messages.parseDelimitedFrom(errorIntervalsBytes, Stored.ErrorInterval.parser());<NEW_LINE>errorIntervalCollector.addErrorIntervals(fromProto(errorIntervals));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>BoundStatement boundStatement = insertResultPS.get(rollupLevel).bind();<NEW_LINE>int i = 0;<NEW_LINE>boundStatement.setString(i++, agentRollupId);<NEW_LINE>boundStatement.setString(i++, syntheticMonitorId);<NEW_LINE>boundStatement.setTimestamp(i++, new Date(to));<NEW_LINE>boundStatement<MASK><NEW_LINE>boundStatement.setLong(i++, executionCount);<NEW_LINE>List<ErrorInterval> mergedErrorIntervals = errorIntervalCollector.getMergedErrorIntervals();<NEW_LINE>if (mergedErrorIntervals.isEmpty()) {<NEW_LINE>boundStatement.setToNull(i++);<NEW_LINE>} else {<NEW_LINE>boundStatement.setBytes(i++, Messages.toByteBuffer(toProto(mergedErrorIntervals)));<NEW_LINE>}<NEW_LINE>boundStatement.setInt(i++, adjustedTTL);<NEW_LINE>return session.writeAsync(boundStatement);<NEW_LINE>} | .setDouble(i++, totalDurationNanos); |
415,277 | UnresolvedModule build() {<NEW_LINE>List<Export> localExports = new ArrayList<>();<NEW_LINE>ImmutableList.Builder<Export> indirectExportsBuilder = <MASK><NEW_LINE>ImmutableList.Builder<Export> starExportsBuilder = new ImmutableList.Builder<>();<NEW_LINE>for (Export ee : exports) {<NEW_LINE>if (ee.moduleRequest() == null) {<NEW_LINE>if (importsByLocalName.containsKey(ee.localName())) {<NEW_LINE>// import A from '';<NEW_LINE>// export { A };<NEW_LINE>// import * as ns from '';<NEW_LINE>// export { ns };<NEW_LINE>indirectExportsBuilder.add(ee);<NEW_LINE>} else {<NEW_LINE>// var y;<NEW_LINE>// export { y };<NEW_LINE>// export var x;<NEW_LINE>localExports.add(ee);<NEW_LINE>}<NEW_LINE>} else if ("*".equals(ee.importName())) {<NEW_LINE>// export * from '';<NEW_LINE>starExportsBuilder.add(ee);<NEW_LINE>} else {<NEW_LINE>// export { A } from '';<NEW_LINE>indirectExportsBuilder.add(ee);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>NodeTraversal.traverse(compiler, root, new FindMutableExports(localExports));<NEW_LINE>return new UnresolvedEsModule(metadata, path, ImmutableMap.copyOf(importsByLocalName), ImmutableList.copyOf(localExports), indirectExportsBuilder.build(), starExportsBuilder.build());<NEW_LINE>} | new ImmutableList.Builder<>(); |
144,731 | public void run(RegressionEnvironment env) {<NEW_LINE>String eventNameOne = SupportBeanSimple.class.getSimpleName();<NEW_LINE>String eventNameTwo = SupportMarketDataBean.class.getSimpleName();<NEW_LINE>String text = "@name('s0') select *, myString||myString as concat " + "from " + eventNameOne + "#length(5) as eventOne, " + eventNameTwo + "#length(5) as eventTwo";<NEW_LINE>env.compileDeploy<MASK><NEW_LINE>assertNoCommonProperties(env);<NEW_LINE>env.undeployAll();<NEW_LINE>text = "@name('s0') select *, myString||myString as concat " + "from " + eventNameOne + "#length(5) as eventOne, " + eventNameTwo + "#length(5) as eventTwo " + "where eventOne.myString = eventTwo.symbol";<NEW_LINE>env.compileDeploy(text).addListener("s0");<NEW_LINE>assertNoCommonProperties(env);<NEW_LINE>env.undeployAll();<NEW_LINE>} | (text).addListener("s0"); |
921,964 | public void trainModel(String[] lingFactors, String featuresFile, int numFeatures, double percentToTrain, SoP sop) throws Exception {<NEW_LINE>// desired size of the solution<NEW_LINE>int d = solutionSize;<NEW_LINE>// maximum deviation allowed with respect to d<NEW_LINE>int D = 0;<NEW_LINE>int cols = lingFactors.length;<NEW_LINE>// the last column is the independent variable<NEW_LINE>int indVariable = cols;<NEW_LINE>int rows = numFeatures;<NEW_LINE>int rowIniTrain = 0;<NEW_LINE>int percentVal = (int) (Math.floor((numFeatures * percentToTrain)));<NEW_LINE>int rowEndTrain = percentVal - 1;<NEW_LINE>int rowIniTest = percentVal;<NEW_LINE>int rowEndTest = percentVal + (numFeatures - percentVal - 1) - 1;<NEW_LINE>System.out.println("Number of points: " + rows + "\nNumber of points used for training from " + rowIniTrain + " to " + rowEndTrain + "(Total train=" + (rowEndTrain - rowIniTrain) + ")\nNumber of points used for testing from " + rowIniTest + " to " + rowEndTest + "(Total test=" + (rowEndTest - rowIniTest) + ")");<NEW_LINE>System.out.println("Number of linguistic factors: " + cols);<NEW_LINE>System.out.println("Max number of selected features in SFFS: " + (d + D));<NEW_LINE>if (interceptTerm)<NEW_LINE>System.out.println("Using intercept Term for regression");<NEW_LINE>else<NEW_LINE>System.out.println("No intercept Term for regression");<NEW_LINE>if (logSolution)<NEW_LINE>System.out.println("Using log(val) as independent variable" + "\n");<NEW_LINE>else<NEW_LINE>System.<MASK><NEW_LINE>// copy indexes of column features<NEW_LINE>int[] Y = new int[lingFactors.length];<NEW_LINE>int[] X = {};<NEW_LINE>for (int j = 0; j < lingFactors.length; j++) Y[j] = j;<NEW_LINE>// we need to remove from Y the column features that have mean 0.0<NEW_LINE>System.out.println("Checking and removing columns with mean=0.0");<NEW_LINE>Y = checkMeanColumns(featuresFile, Y, lingFactors);<NEW_LINE>int[] selectedCols = sequentialForwardFloatingSelection(featuresFile, indVariable, lingFactors, X, Y, d, D, rowIniTrain, rowEndTrain, sop);<NEW_LINE>sop.printCoefficients();<NEW_LINE>System.out.println("Correlation original val / predicted val = " + sop.getCorrelation() + "\nRMSE (root mean square error) = " + sop.getRMSE());<NEW_LINE>Regression reg = new Regression();<NEW_LINE>reg.setCoeffs(sop.getCoeffs());<NEW_LINE>System.out.println("\nNumber points used for training=" + (rowEndTrain - rowIniTrain));<NEW_LINE>reg.predictValues(featuresFile, cols, selectedCols, interceptTerm, rowIniTrain, rowEndTrain);<NEW_LINE>System.out.println("\nNumber points used for testing=" + (rowEndTest - rowIniTest));<NEW_LINE>reg.predictValues(featuresFile, cols, selectedCols, interceptTerm, rowIniTest, rowEndTest);<NEW_LINE>} | out.println("Using independent variable without log()" + "\n"); |
1,643,051 | Mono<Response<QueueProperties>> createQueueWithResponse(String queueName, CreateQueueOptions createQueueOptions, Context context) {<NEW_LINE>if (queueName == null) {<NEW_LINE>return monoError(LOGGER, new NullPointerException("'queueName' cannot be null."));<NEW_LINE>} else if (queueName.isEmpty()) {<NEW_LINE>return monoError(LOGGER, new IllegalArgumentException("'queueName' cannot be empty."));<NEW_LINE>}<NEW_LINE>if (createQueueOptions == null) {<NEW_LINE>return monoError(LOGGER, new NullPointerException("'createQueueOptions' cannot be null."));<NEW_LINE>} else if (context == null) {<NEW_LINE>return monoError(LOGGER, new NullPointerException("'context' cannot be null."));<NEW_LINE>}<NEW_LINE>final Context contextWithHeaders = context.addData(AZ_TRACING_NAMESPACE_KEY, AZ_TRACING_NAMESPACE_VALUE).addData(AZURE_REQUEST_HTTP_HEADERS_KEY, new HttpHeaders());<NEW_LINE>final String forwardToEntity = createQueueOptions.getForwardTo();<NEW_LINE>if (!CoreUtils.isNullOrEmpty(forwardToEntity)) {<NEW_LINE>addSupplementaryAuthHeader(SERVICE_BUS_SUPPLEMENTARY_AUTHORIZATION_HEADER_NAME, forwardToEntity, contextWithHeaders);<NEW_LINE>createQueueOptions.setForwardTo(getAbsoluteUrlFromEntity(forwardToEntity));<NEW_LINE>}<NEW_LINE>final String forwardDlqToEntity = createQueueOptions.getForwardDeadLetteredMessagesTo();<NEW_LINE>if (!CoreUtils.isNullOrEmpty(forwardDlqToEntity)) {<NEW_LINE>addSupplementaryAuthHeader(SERVICE_BUS_DLQ_SUPPLEMENTARY_AUTHORIZATION_HEADER_NAME, forwardDlqToEntity, contextWithHeaders);<NEW_LINE>createQueueOptions.setForwardDeadLetteredMessagesTo(getAbsoluteUrlFromEntity(forwardDlqToEntity));<NEW_LINE>}<NEW_LINE>final QueueDescription description = EntityHelper.getQueueDescription(createQueueOptions);<NEW_LINE>final CreateQueueBodyContent content = new CreateQueueBodyContent().setType<MASK><NEW_LINE>final CreateQueueBody createEntity = new CreateQueueBody().setContent(content);<NEW_LINE>try {<NEW_LINE>return entityClient.putWithResponseAsync(queueName, createEntity, null, contextWithHeaders).onErrorMap(ServiceBusAdministrationAsyncClient::mapException).map(this::deserializeQueue);<NEW_LINE>} catch (RuntimeException ex) {<NEW_LINE>return monoError(LOGGER, ex);<NEW_LINE>}<NEW_LINE>} | (CONTENT_TYPE).setQueueDescription(description); |
804,420 | private Mono<Response<ClusterConfigurationsInner>> listWithResponseAsync(String resourceGroupName, String clusterName) {<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 (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.<MASK><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 (clusterName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>return FluxUtil.withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, clusterName, this.client.getApiVersion(), accept, context)).contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));<NEW_LINE>} | error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); |
864,001 | private MyNavigationGutterIconRenderer createGutterIconRenderer(@Nonnull Project project) {<NEW_LINE>checkBuilt();<NEW_LINE>final SmartPointerManager manager = SmartPointerManager.getInstance(project);<NEW_LINE>NotNullLazyValue<List<SmartPsiElementPointer>> pointers = new NotNullLazyValue<List<SmartPsiElementPointer>>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>@Nonnull<NEW_LINE>public List<SmartPsiElementPointer> compute() {<NEW_LINE>Set<PsiElement> elements = new HashSet<PsiElement>();<NEW_LINE>Collection<? extends T> targets = myTargets.getValue();<NEW_LINE>final List<SmartPsiElementPointer> list = new ArrayList<SmartPsiElementPointer>(targets.size());<NEW_LINE>for (final T target : targets) {<NEW_LINE>for (final PsiElement psiElement : myConverter.fun(target)) {<NEW_LINE>if (elements.add(psiElement) && psiElement.isValid()) {<NEW_LINE>list.add<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return list;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>final boolean empty = isEmpty();<NEW_LINE>if (myTooltipText == null && !myLazy) {<NEW_LINE>final SortedSet<String> names = new TreeSet<String>();<NEW_LINE>for (T t : myTargets.getValue()) {<NEW_LINE>final String text = myNamer.fun(t);<NEW_LINE>if (text != null) {<NEW_LINE>names.add(MessageFormat.format(PATTERN, text));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>@NonNls<NEW_LINE>StringBuilder sb = new StringBuilder("<html><body>");<NEW_LINE>if (myTooltipTitle != null) {<NEW_LINE>sb.append(myTooltipTitle).append("<br>");<NEW_LINE>}<NEW_LINE>for (String name : names) {<NEW_LINE>sb.append(name).append("<br>");<NEW_LINE>}<NEW_LINE>sb.append("</body></html>");<NEW_LINE>myTooltipText = sb.toString();<NEW_LINE>}<NEW_LINE>Computable<PsiElementListCellRenderer> renderer = myCellRenderer == null ? DefaultPsiElementCellRenderer::new : myCellRenderer;<NEW_LINE>return new MyNavigationGutterIconRenderer(this, myAlignment, myIcon, myTooltipText, pointers, renderer, empty);<NEW_LINE>} | (manager.createSmartPsiElementPointer(psiElement)); |
839,430 | private static String generateXRefTitle(ProgramLocation location) {<NEW_LINE>// note: we likely need to improve this title generation as we find more specific needs<NEW_LINE>Program program = location.getProgram();<NEW_LINE>FunctionManager functionManager = program.getFunctionManager();<NEW_LINE>Address address = location.getAddress();<NEW_LINE>if (location instanceof VariableLocation) {<NEW_LINE>VariableLocation vl = (VariableLocation) location;<NEW_LINE>String name = vl.getVariable().getName();<NEW_LINE>Function f = functionManager.<MASK><NEW_LINE>return X_REFS_TO + name + (f == null ? "" : " in " + f.getName());<NEW_LINE>} else if (location instanceof FunctionLocation) {<NEW_LINE>FunctionLocation fl = (FunctionLocation) location;<NEW_LINE>Function f = functionManager.getFunctionContaining(fl.getFunctionAddress());<NEW_LINE>if (f != null) {<NEW_LINE>return X_REFS_TO + f.getName();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>Function f = functionManager.getFunctionAt(address);<NEW_LINE>if (f != null) {<NEW_LINE>return X_REFS_TO + f.getName();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return X_REFS_TO + location.getAddress();<NEW_LINE>} | getFunctionContaining(vl.getFunctionAddress()); |
1,179,572 | final RetryDataReplicationResult executeRetryDataReplication(RetryDataReplicationRequest retryDataReplicationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(retryDataReplicationRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<RetryDataReplicationRequest> request = null;<NEW_LINE>Response<RetryDataReplicationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new RetryDataReplicationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(retryDataReplicationRequest));<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, "drs");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "RetryDataReplication");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<RetryDataReplicationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new RetryDataReplicationResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); |
1,166,101 | private static <T> void createADTableInstanceIfNeccesary(final Properties ctx, final Class<T> cl) {<NEW_LINE>if (!Adempiere.isUnitTestMode()) {<NEW_LINE>// we are not in unit test mode. Don't create in-memory objects on the fly.<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final String tableName = InterfaceWrapperHelper.getTableNameOrNull(cl);<NEW_LINE>if (Check.isEmpty(tableName) || Objects.equals(I_AD_Table.Table_Name, tableName)) {<NEW_LINE>// the given class has no table name.<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final int tableId = Services.get(IADTableDAO.class).retrieveTableId(tableName);<NEW_LINE>final I_AD_Table existingInstance = create(ctx, I_AD_Table.Table_Name, tableId, I_AD_Table.class, ITrx.TRXNAME_None);<NEW_LINE>if (existingInstance != null) {<NEW_LINE>// there is already an I_AD_Table instance.<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final ITrxConstraintsBL trxConstraintsBL = <MASK><NEW_LINE>trxConstraintsBL.saveConstraints();<NEW_LINE>try {<NEW_LINE>trxConstraintsBL.getConstraints().addAllowedTrxNamePrefix(ITrx.TRXNAME_PREFIX_LOCAL);<NEW_LINE>final I_AD_Table newInstance = create(ctx, I_AD_Table.class, ITrx.TRXNAME_None);<NEW_LINE>newInstance.setName(tableName);<NEW_LINE>newInstance.setTableName(tableName);<NEW_LINE>newInstance.setAD_Table_ID(tableId);<NEW_LINE>save(newInstance);<NEW_LINE>} finally {<NEW_LINE>trxConstraintsBL.restoreConstraints();<NEW_LINE>}<NEW_LINE>} | Services.get(ITrxConstraintsBL.class); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.