idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
923,296 | private <T> CurrencyParameterSensitivities sensitivityDiscountCurve(ImmutableCreditRatesProvider provider, Function<ImmutableCreditRatesProvider, CurrencyAmount> valueFn, MetaProperty<ImmutableMap<T, CreditDiscountFactors>> metaProperty, CurrencyAmount valueInit) {<NEW_LINE>ImmutableMap<T, CreditDiscountFactors> baseCurves = metaProperty.get(provider);<NEW_LINE>CurrencyParameterSensitivities result = CurrencyParameterSensitivities.empty();<NEW_LINE>for (T key : baseCurves.keySet()) {<NEW_LINE>CreditDiscountFactors creditDiscountFactors = baseCurves.get(key);<NEW_LINE><MASK><NEW_LINE>Curve curve = checkDiscountFactors(discountFactors);<NEW_LINE>int paramCount = curve.getParameterCount();<NEW_LINE>double[] sensitivity = new double[paramCount];<NEW_LINE>for (int i = 0; i < paramCount; i++) {<NEW_LINE>Curve dscBumped = curve.withParameter(i, curve.getParameter(i) + shift);<NEW_LINE>Map<T, CreditDiscountFactors> mapBumped = new HashMap<>(baseCurves);<NEW_LINE>mapBumped.put(key, createCreditDiscountFactors(creditDiscountFactors, dscBumped));<NEW_LINE>ImmutableCreditRatesProvider providerDscBumped = provider.toBuilder().set(metaProperty, mapBumped).build();<NEW_LINE>sensitivity[i] = (valueFn.apply(providerDscBumped).getAmount() - valueInit.getAmount()) / shift;<NEW_LINE>}<NEW_LINE>result = result.combinedWith(curve.createParameterSensitivity(valueInit.getCurrency(), DoubleArray.copyOf(sensitivity)));<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | DiscountFactors discountFactors = creditDiscountFactors.toDiscountFactors(); |
1,738,145 | public void marshall(DefaultMessage defaultMessage, AwsJsonWriter jsonWriter) throws Exception {<NEW_LINE>jsonWriter.beginObject();<NEW_LINE>if (defaultMessage.getBody() != null) {<NEW_LINE>String body = defaultMessage.getBody();<NEW_LINE>jsonWriter.name("Body");<NEW_LINE>jsonWriter.value(body);<NEW_LINE>}<NEW_LINE>if (defaultMessage.getSubstitutions() != null) {<NEW_LINE>java.util.Map<String, java.util.List<String>> substitutions = defaultMessage.getSubstitutions();<NEW_LINE>jsonWriter.name("Substitutions");<NEW_LINE>jsonWriter.beginObject();<NEW_LINE>for (java.util.Map.Entry<String, java.util.List<String>> substitutionsEntry : substitutions.entrySet()) {<NEW_LINE>java.util.List<String> substitutionsValue = substitutionsEntry.getValue();<NEW_LINE>if (substitutionsValue != null) {<NEW_LINE>jsonWriter.<MASK><NEW_LINE>jsonWriter.beginArray();<NEW_LINE>for (String substitutionsValueItem : substitutionsValue) {<NEW_LINE>if (substitutionsValueItem != null) {<NEW_LINE>jsonWriter.value(substitutionsValueItem);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>jsonWriter.endArray();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>jsonWriter.endObject();<NEW_LINE>}<NEW_LINE>jsonWriter.endObject();<NEW_LINE>} | name(substitutionsEntry.getKey()); |
1,842,675 | final GetCellReadinessSummaryResult executeGetCellReadinessSummary(GetCellReadinessSummaryRequest getCellReadinessSummaryRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getCellReadinessSummaryRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetCellReadinessSummaryRequest> request = null;<NEW_LINE>Response<GetCellReadinessSummaryResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetCellReadinessSummaryRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getCellReadinessSummaryRequest));<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, "Route53 Recovery Readiness");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetCellReadinessSummary");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetCellReadinessSummaryResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetCellReadinessSummaryResultJsonUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | invoke(request, responseHandler, executionContext); |
1,241,134 | public Uni<SecurityIdentity> authenticate(TokenAuthenticationRequest request, AuthenticationRequestContext context) {<NEW_LINE>return context.runBlocking(new Supplier<SecurityIdentity>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public SecurityIdentity get() {<NEW_LINE>org.wildfly.security.auth.server.SecurityIdentity result;<NEW_LINE>try {<NEW_LINE>result = domain.authenticate(new BearerTokenEvidence(request.getToken<MASK><NEW_LINE>if (result == null) {<NEW_LINE>throw new AuthenticationFailedException();<NEW_LINE>}<NEW_LINE>QuarkusSecurityIdentity.Builder builder = QuarkusSecurityIdentity.builder();<NEW_LINE>builder.setPrincipal(result.getPrincipal());<NEW_LINE>for (String i : result.getRoles()) {<NEW_LINE>builder.addRole(i);<NEW_LINE>}<NEW_LINE>builder.addCredential(request.getToken());<NEW_LINE>return builder.build();<NEW_LINE>} catch (RealmUnavailableException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>} catch (SecurityException e) {<NEW_LINE>log.debug("Authentication failed", e);<NEW_LINE>throw new AuthenticationFailedException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | ().getToken())); |
1,047,908 | private static EncryptedKeyset encrypt(Keyset keyset, Aead masterKey, byte[] associatedData) throws GeneralSecurityException {<NEW_LINE>byte[] encryptedKeyset = masterKey.encrypt(keyset.toByteArray(), associatedData);<NEW_LINE>// Check if we can decrypt, to detect errors<NEW_LINE>try {<NEW_LINE>final Keyset keyset2 = Keyset.parseFrom(masterKey.decrypt(encryptedKeyset, associatedData), ExtensionRegistryLite.getEmptyRegistry());<NEW_LINE>if (!keyset2.equals(keyset)) {<NEW_LINE>throw new GeneralSecurityException("cannot encrypt keyset");<NEW_LINE>}<NEW_LINE>} catch (@SuppressWarnings("UnusedException") InvalidProtocolBufferException e) {<NEW_LINE>// Do not propagate InvalidProtocolBufferException to guarantee no key material is leaked<NEW_LINE>throw new GeneralSecurityException("invalid keyset, corrupted key material");<NEW_LINE>}<NEW_LINE>return EncryptedKeyset.newBuilder().setEncryptedKeyset(ByteString.copyFrom(encryptedKeyset)).setKeysetInfo(Util.getKeysetInfo<MASK><NEW_LINE>} | (keyset)).build(); |
781,075 | ActionResult<Wo> execute(EffectivePerson effectivePerson) throws Exception {<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>Business business = new Business(emc);<NEW_LINE>ActionResult<Wo> result = new ActionResult<>();<NEW_LINE>List<String> ids = new ArrayList<>();<NEW_LINE>if (business.isPortalManager(effectivePerson)) {<NEW_LINE>ids = business.templatePage().list();<NEW_LINE>} else {<NEW_LINE>ids = business.templatePage().listEditable(effectivePerson);<NEW_LINE>}<NEW_LINE>List<WoTemplatePage> list = WoTemplatePage.copier.copy(emc.list(TemplatePage.class, ids));<NEW_LINE>Map<String, List<WoTemplatePage>> group = list.stream().collect(Collectors.groupingBy(o -> Objects.toString(o.getCategory(), "")));<NEW_LINE>Map<String, List<WoTemplatePage>> sort = group.entrySet().stream().sorted((e1, e2) -> ObjectUtils.compare(e1.getKey(), e2.getKey())).collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (e1, e2) <MASK><NEW_LINE>Wo wo = new Wo();<NEW_LINE>for (Entry<String, List<WoTemplatePage>> en : sort.entrySet()) {<NEW_LINE>wo.put(en.getKey(), en.getValue().stream().sorted(Comparator.comparing(WoTemplatePage::getName, Comparator.nullsLast(String::compareTo))).collect(Collectors.toList()));<NEW_LINE>}<NEW_LINE>result.setData(wo);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>} | -> e1, LinkedHashMap::new)); |
1,428,772 | public void run(RegressionEnvironment env) {<NEW_LINE>String[] fields = "mycontextvar".split(",");<NEW_LINE>RegressionPath path = new RegressionPath();<NEW_LINE>env.compileDeploy("@public create context MyCtx as " + "partition by theString from SupportBean, p00 from SupportBean_S0", path);<NEW_LINE>env.compileDeploy("@public context MyCtx create variable int mycontextvar = 0", path);<NEW_LINE>env.compileDeploy("context MyCtx on SupportBean(intPrimitive > 0) set mycontextvar = intPrimitive", path);<NEW_LINE>env.compileDeploy("@name('s0') context MyCtx select mycontextvar from SupportBean_S0", path).addListener("s0");<NEW_LINE>// allocate partition P1<NEW_LINE>env.sendEventBean(new SupportBean("P1", 0));<NEW_LINE>// set variable<NEW_LINE>env.sendEventBean(new SupportBean("P1", 10));<NEW_LINE>env.sendEventBean(new SupportBean_S0(1, "P1"));<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { 10 });<NEW_LINE>env.milestone(0);<NEW_LINE>// allocate and set variable partition E2<NEW_LINE>env.sendEventBean(new SupportBean("P2", 11));<NEW_LINE>env.sendEventBean(new SupportBean_S0(2, "P2"));<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { 11 });<NEW_LINE>env.milestone(1);<NEW_LINE>env.sendEventBean(new SupportBean_S0(3, "P1"));<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { 10 });<NEW_LINE>env.sendEventBean(new SupportBean_S0(4, "P2"));<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { 11 });<NEW_LINE>env.milestone(2);<NEW_LINE>env.sendEventBean(new SupportBean_S0(5, "P3"));<NEW_LINE>env.assertPropsNew("s0", fields, <MASK><NEW_LINE>env.sendEventBean(new SupportBean("P3", 12));<NEW_LINE>env.sendEventBean(new SupportBean_S0(6, "P3"));<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { 12 });<NEW_LINE>env.undeployAll();<NEW_LINE>} | new Object[] { 0 }); |
828,793 | public View newView(Context context, ViewGroup parent) {<NEW_LINE>LayoutInflater inflater = LayoutInflater.from(context);<NEW_LINE>View view = inflater.inflate(R.layout.repo_listitem, parent, false);<NEW_LINE>RepoListItemHolder holder = new RepoListItemHolder();<NEW_LINE>holder.repoTitle = (TextView) view.findViewById(R.id.repoTitle);<NEW_LINE>holder.repoRemote = (TextView) view.findViewById(R.id.repoRemote);<NEW_LINE>holder.commitAuthor = (TextView) view.findViewById(R.id.commitAuthor);<NEW_LINE>holder.commitMsg = (TextView) view.findViewById(R.id.commitMsg);<NEW_LINE>holder.commitTime = (TextView) view.findViewById(R.id.commitTime);<NEW_LINE>holder.authorIcon = (ImageView) view.findViewById(R.id.authorIcon);<NEW_LINE>holder.progressContainer = view.findViewById(R.id.progressContainer);<NEW_LINE>holder.commitMsgContainer = view.<MASK><NEW_LINE>holder.progressMsg = (TextView) view.findViewById(R.id.progressMsg);<NEW_LINE>holder.cancelBtn = (ImageView) view.findViewById(R.id.cancelBtn);<NEW_LINE>view.setTag(holder);<NEW_LINE>return view;<NEW_LINE>} | findViewById(R.id.commitMsgContainer); |
65,793 | public SOAPMessage invoke(SOAPMessage request) {<NEW_LINE>SOAPMessage response = null;<NEW_LINE>try {<NEW_LINE>System.out.println("Incoming Client Request as a SOAPMessage:");<NEW_LINE>request.writeTo(System.out);<NEW_LINE>String hdrText = request.getSOAPHeader().getTextContent();<NEW_LINE>System.out.println("Incoming SOAP Header:" + hdrText);<NEW_LINE>String returnMsg = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\"><soapenv:Body xmlns=\"http://wssec.pwdigest.cxf.fats/types\"><provider>This is WSSECFVT CXF Web Service with SSL (Password Digest Created) for: " + hdrText + ".</provider></soapenv:Body></soapenv:Envelope>";<NEW_LINE>StringReader respMsg = new StringReader(returnMsg);<NEW_LINE>// SOAPBody sb = request.getSOAPBody();<NEW_LINE>// System.out.println("Incoming SOAPBody: " + sb.getValue() );<NEW_LINE>Source src = new StreamSource(respMsg);<NEW_LINE><MASK><NEW_LINE>response = factory.createMessage();<NEW_LINE>response.getSOAPPart().setContent(src);<NEW_LINE>response.saveChanges();<NEW_LINE>} catch (Exception ex) {<NEW_LINE>ex.printStackTrace();<NEW_LINE>}<NEW_LINE>return response;<NEW_LINE>} | MessageFactory factory = MessageFactory.newInstance(); |
1,498,968 | private boolean isDefault(String eventType, String actionType) {<NEW_LINE>List<String> eventTypes = configService.getPropertyNamesByPrefix(NOTIFICATIONS_PREFIX, true);<NEW_LINE>for (String eventTypeRootPropName : eventTypes) {<NEW_LINE>String eType = configService.getString(eventTypeRootPropName);<NEW_LINE>if (!eType.equals(eventType))<NEW_LINE>continue;<NEW_LINE>List<String> actions = configService.getPropertyNamesByPrefix(eventTypeRootPropName + ".actions", true);<NEW_LINE>for (String actionPropName : actions) {<NEW_LINE>String aType = configService.getString(actionPropName);<NEW_LINE>if (!aType.equals(actionType))<NEW_LINE>continue;<NEW_LINE>Object isDefaultdObj = configService.getProperty(actionPropName + ".default");<NEW_LINE>// if setting is missing we accept it is true<NEW_LINE>// this way we override old saved settings<NEW_LINE>if (isDefaultdObj == null)<NEW_LINE>return true;<NEW_LINE>else<NEW_LINE>return Boolean<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | .parseBoolean((String) isDefaultdObj); |
850,916 | final GetColumnStatisticsForTableResult executeGetColumnStatisticsForTable(GetColumnStatisticsForTableRequest getColumnStatisticsForTableRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getColumnStatisticsForTableRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetColumnStatisticsForTableRequest> request = null;<NEW_LINE>Response<GetColumnStatisticsForTableResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetColumnStatisticsForTableRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getColumnStatisticsForTableRequest));<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.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetColumnStatisticsForTable");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetColumnStatisticsForTableResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetColumnStatisticsForTableResultJsonUnmarshaller());<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.SERVICE_ID, "Glue"); |
173,646 | public Path run(final Session<?> session) throws BackgroundException {<NEW_LINE>final Directory feature = session.getFeature(Directory.class);<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug(String.format("Run with feature %s", feature));<NEW_LINE>}<NEW_LINE>final TransferStatus status = new TransferStatus();<NEW_LINE>final Encryption encryption = session.getFeature(Encryption.class);<NEW_LINE>if (encryption != null) {<NEW_LINE>status.setEncryption(encryption.getDefault(folder));<NEW_LINE>}<NEW_LINE>status.setTimestamp(System.currentTimeMillis());<NEW_LINE>if (PreferencesFactory.get().getBoolean("touch.permissions.change")) {<NEW_LINE>final UnixPermission permission = session.getFeature(UnixPermission.class);<NEW_LINE>if (permission != null) {<NEW_LINE>status.setPermission(permission.getDefault(EnumSet.of(Path.Type.directory)));<NEW_LINE>}<NEW_LINE>final AclPermission acl = session.getFeature(AclPermission.class);<NEW_LINE>if (acl != null) {<NEW_LINE>status.setAcl(acl.getDefault(EnumSet.of(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>status.setRegion(region);<NEW_LINE>return feature.mkdir(folder, status);<NEW_LINE>} | Path.Type.directory))); |
671,479 | private void fillRwSplitUser(UserConfig userConfig, RwSplitUser rwSplitUser, Map<String, WallProvider> blackListMap, ProblemReporter problemReporter) {<NEW_LINE>String tenant = rwSplitUser.getTenant();<NEW_LINE>String dbGroup = rwSplitUser.getDbGroup();<NEW_LINE>String blacklistStr = rwSplitUser.getBlacklist();<NEW_LINE>UserName userName = new UserName(userConfig.getName(), tenant);<NEW_LINE>if (this.userConfigMap.containsKey(userName)) {<NEW_LINE>throw new ConfigException("User [" + userName + "] has already existed");<NEW_LINE>}<NEW_LINE>if (StringUtil.isEmpty(dbGroup)) {<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>WallProvider wallProvider = getWallProvider(blackListMap, problemReporter, blacklistStr, userName);<NEW_LINE>RwSplitUserConfig rwSplitUserConfig = new RwSplitUserConfig(userConfig, userName.getTenant(), wallProvider, dbGroup);<NEW_LINE>rwSplitUserConfig.setId(this.userId.incrementAndGet());<NEW_LINE>this.userConfigMap.put(userName, rwSplitUserConfig);<NEW_LINE>} | ConfigException("User [" + userName + "]'s dbGroup is empty"); |
599,943 | private void refreshMapLater(final MapModel map) {<NEW_LINE>final Integer count = mapsToRefresh.get(map);<NEW_LINE>if (count == null) {<NEW_LINE>mapsToRefresh.put(map, 0);<NEW_LINE>} else {<NEW_LINE>mapsToRefresh.<MASK><NEW_LINE>}<NEW_LINE>Controller.getCurrentController().getViewController().invokeLater(new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>final Integer count = mapsToRefresh.get(map);<NEW_LINE>if (count > 0) {<NEW_LINE>mapsToRefresh.put(map, count - 1);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>mapsToRefresh.remove(map);<NEW_LINE>final MapStyleModel extension = MapStyleModel.getExtension(map);<NEW_LINE>extension.refreshStyles();<NEW_LINE>final MapController mapController = Controller.getCurrentModeController().getMapController();<NEW_LINE>mapController.fireMapChanged(new MapChangeEvent(this, map, MapStyle.MAP_STYLES, null, null));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | put(map, count + 1); |
1,618,998 | private static void spreadGraph(AnalysedChunk chunk, int x, int y, int z) {<NEW_LINE>Set<BlockPos> openSet = new HashSet<>();<NEW_LINE>Set<BlockPos> <MASK><NEW_LINE>MiniGraph graph = new MiniGraph();<NEW_LINE>openSet.add(new BlockPos(x, y, z));<NEW_LINE>while (!openSet.isEmpty()) {<NEW_LINE>BlockPos toTest = openSet.iterator().next();<NEW_LINE>int x_ = toTest.getX();<NEW_LINE>int y_ = toTest.getY();<NEW_LINE>int z_ = toTest.getZ();<NEW_LINE>EnumTraversalExpense expense = chunk.expenses[x_][y_][z_];<NEW_LINE>if (expense != EnumTraversalExpense.SOLID) {<NEW_LINE>graph.blockCount++;<NEW_LINE>graph.totalExpense += expense.expense;<NEW_LINE>chunk.graphs[x_][y_][z_] = graph;<NEW_LINE>for (EnumFacing face : EnumFacing.VALUES) {<NEW_LINE>BlockPos offset = toTest.offset(face);<NEW_LINE>if (!isValid(offset))<NEW_LINE>continue;<NEW_LINE>if (closedSet.contains(offset))<NEW_LINE>continue;<NEW_LINE>openSet.add(offset);<NEW_LINE>}<NEW_LINE>openSet.remove(toTest);<NEW_LINE>closedSet.add(toTest);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | closedSet = new HashSet<>(); |
1,398,341 | public Object apply(final ActionContext ctx, final Object caller, final Object[] sources) throws FrameworkException {<NEW_LINE>// use String here because the actual type of the query is not known yet<NEW_LINE>String sortKey = "name";<NEW_LINE>boolean sortDescending = false;<NEW_LINE>try {<NEW_LINE>assertArrayHasMinLengthAndAllElementsNotNull(sources, 1);<NEW_LINE>switch(sources.length) {<NEW_LINE>// no break here<NEW_LINE>case 2:<NEW_LINE>sortDescending = "true".equals(sources[1].toString().toLowerCase());<NEW_LINE>case 1:<NEW_LINE>sortKey = <MASK><NEW_LINE>}<NEW_LINE>if (sortKey.contains(".")) {<NEW_LINE>return new SortPathPredicate(sortKey, sortDescending);<NEW_LINE>}<NEW_LINE>return new SortPredicate(sortKey, sortDescending);<NEW_LINE>} catch (final IllegalArgumentException e) {<NEW_LINE>logParameterError(caller, sources, ctx.isJavaScriptContext());<NEW_LINE>return usage(ctx.isJavaScriptContext());<NEW_LINE>}<NEW_LINE>} | sources[0].toString(); |
1,327,173 | static Point processPointIntersectOrDiff_(Point point, Geometry intersector, double tolerance, boolean bClipIn) {<NEW_LINE>if (point.isEmpty())<NEW_LINE>return ((Point) point.createInstance());<NEW_LINE>if (intersector.isEmpty()) {<NEW_LINE>return bClipIn ? ((Point) point.createInstance()) : null;<NEW_LINE>}<NEW_LINE>Point2D[] input_points = new Point2D[1];<NEW_LINE>PolygonUtils.PiPResult[] test_results = new PolygonUtils.PiPResult[1];<NEW_LINE>boolean bArea = intersector.getDimension() == 2;<NEW_LINE>if (intersector.getDimension() != 1 && intersector.getDimension() != 2)<NEW_LINE>throw GeometryException.GeometryInternalError();<NEW_LINE>input_points[0] = point.getXY();<NEW_LINE>if (bArea)<NEW_LINE>PolygonUtils.testPointsInArea2D(intersector, input_points, 1, tolerance, test_results);<NEW_LINE>else<NEW_LINE>PolygonUtils.testPointsOnLine2D(intersector, <MASK><NEW_LINE>boolean bTest = test_results[0] == PolygonUtils.PiPResult.PiPOutside;<NEW_LINE>if (!bClipIn)<NEW_LINE>bTest = !bTest;<NEW_LINE>if (!bTest)<NEW_LINE>return point;<NEW_LINE>else<NEW_LINE>return ((Point) point.createInstance());<NEW_LINE>} | input_points, 1, tolerance, test_results); |
37,275 | final AssociateAssessmentReportEvidenceFolderResult executeAssociateAssessmentReportEvidenceFolder(AssociateAssessmentReportEvidenceFolderRequest associateAssessmentReportEvidenceFolderRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(associateAssessmentReportEvidenceFolderRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<AssociateAssessmentReportEvidenceFolderRequest> request = null;<NEW_LINE>Response<AssociateAssessmentReportEvidenceFolderResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new AssociateAssessmentReportEvidenceFolderRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(associateAssessmentReportEvidenceFolderRequest));<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, "AuditManager");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AssociateAssessmentReportEvidenceFolder");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<AssociateAssessmentReportEvidenceFolderResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new AssociateAssessmentReportEvidenceFolderResultJsonUnmarshaller());<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.ADVANCED_CONFIG, advancedConfig); |
609,102 | public MantisKafkaConsumer<?> build() {<NEW_LINE>Preconditions.checkNotNull(context, "context");<NEW_LINE>Preconditions.checkNotNull(kafkaSourceConfig, "kafkaSourceConfig");<NEW_LINE>Preconditions.checkNotNull(registry, "registry");<NEW_LINE>Preconditions.checkArg(consumerIndex >= 0, "consumerIndex must be greater than or equal to 0");<NEW_LINE>Preconditions.checkArg(totalNumConsumersForJob > 0, "total number of consumers for job must be greater than 0");<NEW_LINE>final int kafkaConsumerId = consumerId.incrementAndGet();<NEW_LINE>Map<String, Object> consumerProps = kafkaSourceConfig.getConsumerConfig().getConsumerProperties();<NEW_LINE>final String clientId = String.format("%s-%d-%d", context.getJobId(), context.getWorkerInfo().getWorkerNumber(), kafkaConsumerId);<NEW_LINE>consumerProps.put(ConsumerConfig.CLIENT_ID_CONFIG, clientId);<NEW_LINE>// hard-coding key to String type and value to byte[]<NEW_LINE>final KafkaConsumer<String, byte[]> consumer = new KafkaConsumer<>(consumerProps);<NEW_LINE>final TopicPartitionStateManager partitionStateManager = new TopicPartitionStateManager(registry, clientId, kafkaSourceConfig.getRetryCheckpointCheckDelayMs());<NEW_LINE>final ConsumerMetrics metrics = new ConsumerMetrics(registry, kafkaConsumerId, context);<NEW_LINE>final CheckpointStrategy<?> strategy = CheckpointStrategyFactory.getNewInstance(context, consumer, <MASK><NEW_LINE>if (kafkaSourceConfig.getStaticPartitionAssignmentEnabled()) {<NEW_LINE>final KafkaConsumerRebalanceListener kafkaConsumerRebalanceListener = new KafkaConsumerRebalanceListener(consumer, partitionStateManager, strategy);<NEW_LINE>kafkaSourceConfig.getTopicPartitionCounts().ifPresent(topicPartitionCounts -> {<NEW_LINE>doStaticPartitionAssignment(consumer, kafkaConsumerRebalanceListener, consumerIndex, totalNumConsumersForJob, topicPartitionCounts, registry);<NEW_LINE>});<NEW_LINE>} else {<NEW_LINE>if (kafkaSourceConfig.getCheckpointStrategy() != CheckpointStrategyOptions.NONE) {<NEW_LINE>consumer.subscribe(kafkaSourceConfig.getTopics(), new KafkaConsumerRebalanceListener(consumer, partitionStateManager, strategy));<NEW_LINE>} else {<NEW_LINE>consumer.subscribe(kafkaSourceConfig.getTopics());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final CheckpointTrigger trigger = CheckpointTriggerFactory.getNewInstance(kafkaSourceConfig);<NEW_LINE>return new MantisKafkaConsumer<>(kafkaConsumerId, consumer, partitionStateManager, strategy, trigger, metrics);<NEW_LINE>} | kafkaSourceConfig.getCheckpointStrategy(), metrics); |
1,741,057 | public static void createLoadsBasedOnDescriptor(MethodVisitor mv, String descriptor, int startindex) {<NEW_LINE>int slot = startindex;<NEW_LINE>// start after the '('<NEW_LINE>int descriptorpos = 1;<NEW_LINE>char ch;<NEW_LINE>while ((ch = descriptor.charAt(descriptorpos)) != ')') {<NEW_LINE>switch(ch) {<NEW_LINE>case '[':<NEW_LINE>mv.visitVarInsn(ALOAD, slot);<NEW_LINE>slot++;<NEW_LINE>// jump to end of array, could be [[[[I<NEW_LINE>while (descriptor.charAt(++descriptorpos) == '[') {<NEW_LINE>}<NEW_LINE>if (descriptor.charAt(descriptorpos) == 'L') {<NEW_LINE>descriptorpos = descriptor.indexOf(';', descriptorpos) + 1;<NEW_LINE>} else {<NEW_LINE>// Just a primitive array<NEW_LINE>descriptorpos++;<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case 'L':<NEW_LINE>mv.visitVarInsn(ALOAD, slot);<NEW_LINE>slot++;<NEW_LINE>// jump to end of 'L' signature<NEW_LINE>descriptorpos = descriptor.indexOf(';', descriptorpos) + 1;<NEW_LINE>break;<NEW_LINE>case 'J':<NEW_LINE>mv.visitVarInsn(LLOAD, slot);<NEW_LINE>// double slotter<NEW_LINE>slot += 2;<NEW_LINE>descriptorpos++;<NEW_LINE>break;<NEW_LINE>case 'D':<NEW_LINE>mv.visitVarInsn(DLOAD, slot);<NEW_LINE>// double slotter<NEW_LINE>slot += 2;<NEW_LINE>descriptorpos++;<NEW_LINE>break;<NEW_LINE>case 'F':<NEW_LINE><MASK><NEW_LINE>descriptorpos++;<NEW_LINE>slot++;<NEW_LINE>break;<NEW_LINE>case 'I':<NEW_LINE>case 'Z':<NEW_LINE>case 'B':<NEW_LINE>case 'C':<NEW_LINE>case 'S':<NEW_LINE>mv.visitVarInsn(ILOAD, slot);<NEW_LINE>descriptorpos++;<NEW_LINE>slot++;<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new IllegalStateException("Unexpected type in descriptor: " + ch);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | mv.visitVarInsn(FLOAD, slot); |
1,284,092 | public ListEngineVersionsResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListEngineVersionsResult listEngineVersionsResult = new ListEngineVersionsResult();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return listEngineVersionsResult;<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("EngineVersions", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listEngineVersionsResult.setEngineVersions(new ListUnmarshaller<EngineVersion>(EngineVersionJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("NextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listEngineVersionsResult.setNextToken(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return listEngineVersionsResult;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
1,639,185 | final DescribeRulesetResult executeDescribeRuleset(DescribeRulesetRequest describeRulesetRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeRulesetRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeRulesetRequest> request = null;<NEW_LINE>Response<DescribeRulesetResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeRulesetRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeRulesetRequest));<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, "DataBrew");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeRulesetResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeRulesetResultJsonUnmarshaller());<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.OPERATION_NAME, "DescribeRuleset"); |
1,554,381 | public static void formatSource(Formatter formatter, Object source, ElementSource elementSource) {<NEW_LINE>String modules = moduleSourceString(elementSource);<NEW_LINE>if (source instanceof Dependency) {<NEW_LINE>Dependency<?> dependency = (Dependency<?>) source;<NEW_LINE>InjectionPoint injectionPoint = dependency.getInjectionPoint();<NEW_LINE>if (injectionPoint != null) {<NEW_LINE>formatInjectionPoint(formatter, dependency, injectionPoint, elementSource);<NEW_LINE>} else {<NEW_LINE>formatSource(formatter, <MASK><NEW_LINE>}<NEW_LINE>} else if (source instanceof InjectionPoint) {<NEW_LINE>formatInjectionPoint(formatter, null, (InjectionPoint) source, elementSource);<NEW_LINE>} else if (source instanceof Class) {<NEW_LINE>formatter.format(" at %s%s%n", StackTraceElements.forType((Class<?>) source), modules);<NEW_LINE>} else if (source instanceof Member) {<NEW_LINE>formatter.format(" at %s%s%n", StackTraceElements.forMember((Member) source), modules);<NEW_LINE>} else if (source instanceof TypeLiteral) {<NEW_LINE>formatter.format(" while locating %s%s%n", source, modules);<NEW_LINE>} else if (source instanceof Key) {<NEW_LINE>Key<?> key = (Key<?>) source;<NEW_LINE>formatter.format(" while locating %s%n", convert(key, elementSource));<NEW_LINE>} else {<NEW_LINE>formatter.format(" at %s%s%n", source, modules);<NEW_LINE>}<NEW_LINE>} | dependency.getKey(), elementSource); |
1,249,711 | public emu.grasscutter.net.proto.AbilitySyncStateInfoOuterClass.AbilitySyncStateInfo buildPartial() {<NEW_LINE>emu.grasscutter.net.proto.AbilitySyncStateInfoOuterClass.AbilitySyncStateInfo result = new emu.grasscutter.net.proto.AbilitySyncStateInfoOuterClass.AbilitySyncStateInfo(this);<NEW_LINE>int from_bitField0_ = bitField0_;<NEW_LINE>result.isInited_ = isInited_;<NEW_LINE>if (dynamicValueMapBuilder_ == null) {<NEW_LINE>if (((bitField0_ & 0x00000001) != 0)) {<NEW_LINE>dynamicValueMap_ = java.util.Collections.unmodifiableList(dynamicValueMap_);<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000001);<NEW_LINE>}<NEW_LINE>result.dynamicValueMap_ = dynamicValueMap_;<NEW_LINE>} else {<NEW_LINE>result.dynamicValueMap_ = dynamicValueMapBuilder_.build();<NEW_LINE>}<NEW_LINE>if (appliedAbilitiesBuilder_ == null) {<NEW_LINE>if (((bitField0_ & 0x00000002) != 0)) {<NEW_LINE>appliedAbilities_ = java.util.Collections.unmodifiableList(appliedAbilities_);<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000002);<NEW_LINE>}<NEW_LINE>result.appliedAbilities_ = appliedAbilities_;<NEW_LINE>} else {<NEW_LINE>result<MASK><NEW_LINE>}<NEW_LINE>if (appliedModifiersBuilder_ == null) {<NEW_LINE>if (((bitField0_ & 0x00000004) != 0)) {<NEW_LINE>appliedModifiers_ = java.util.Collections.unmodifiableList(appliedModifiers_);<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000004);<NEW_LINE>}<NEW_LINE>result.appliedModifiers_ = appliedModifiers_;<NEW_LINE>} else {<NEW_LINE>result.appliedModifiers_ = appliedModifiersBuilder_.build();<NEW_LINE>}<NEW_LINE>if (mixinRecoverInfosBuilder_ == null) {<NEW_LINE>if (((bitField0_ & 0x00000008) != 0)) {<NEW_LINE>mixinRecoverInfos_ = java.util.Collections.unmodifiableList(mixinRecoverInfos_);<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000008);<NEW_LINE>}<NEW_LINE>result.mixinRecoverInfos_ = mixinRecoverInfos_;<NEW_LINE>} else {<NEW_LINE>result.mixinRecoverInfos_ = mixinRecoverInfosBuilder_.build();<NEW_LINE>}<NEW_LINE>onBuilt();<NEW_LINE>return result;<NEW_LINE>} | .appliedAbilities_ = appliedAbilitiesBuilder_.build(); |
1,201,558 | protected AuthChallenge checkStateCookie() {<NEW_LINE>OIDCHttpFacade.Cookie stateCookie = getCookie(deployment.getStateCookieName());<NEW_LINE>if (stateCookie == null) {<NEW_LINE>log.warn("No state cookie");<NEW_LINE>return challenge(400, OIDCAuthenticationError.Reason.INVALID_STATE_COOKIE, null);<NEW_LINE>}<NEW_LINE>// reset the cookie<NEW_LINE>log.debug("** reseting application state cookie");<NEW_LINE>facade.getResponse().resetCookie(deployment.getStateCookieName(), stateCookie.getPath());<NEW_LINE>String stateCookieValue = getCookieValue(deployment.getStateCookieName());<NEW_LINE>String state = getQueryParamValue(OAuth2Constants.STATE);<NEW_LINE>if (state == null) {<NEW_LINE>log.warn("state parameter was null");<NEW_LINE>return challenge(400, OIDCAuthenticationError.Reason.INVALID_STATE_COOKIE, null);<NEW_LINE>}<NEW_LINE>if (!state.equals(stateCookieValue)) {<NEW_LINE>log.warn("state parameter invalid");<NEW_LINE>log.warn("cookie: " + stateCookieValue);<NEW_LINE><MASK><NEW_LINE>return challenge(400, OIDCAuthenticationError.Reason.INVALID_STATE_COOKIE, null);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | log.warn("queryParam: " + state); |
167,595 | private static JsonObject normalizeSourceClause(JsonObject queryObject) {<NEW_LINE>JsonObject sourceObject;<NEW_LINE>if (queryObject.has("_source")) {<NEW_LINE>JsonElement <MASK><NEW_LINE>if (sourceElement.isJsonObject()) {<NEW_LINE>sourceObject = sourceElement.getAsJsonObject();<NEW_LINE>} else if (sourceElement.isJsonArray()) {<NEW_LINE>// in this case, the values of the array are includes<NEW_LINE>sourceObject = new JsonObject();<NEW_LINE>queryObject.add("_source", sourceObject);<NEW_LINE>sourceObject.add("includes", sourceElement.getAsJsonArray());<NEW_LINE>} else if (sourceElement.isJsonPrimitive() && sourceElement.getAsJsonPrimitive().isBoolean()) {<NEW_LINE>// if _source is a boolean, we override the configuration with include/exclude<NEW_LINE>sourceObject = new JsonObject();<NEW_LINE>} else {<NEW_LINE>throw new JsonSyntaxException("_source must be an object, an array or a boolean");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>sourceObject = new JsonObject();<NEW_LINE>}<NEW_LINE>queryObject.add("_source", sourceObject);<NEW_LINE>return sourceObject;<NEW_LINE>} | sourceElement = queryObject.get("_source"); |
397,188 | public final UserVariablesContext userVariables() throws RecognitionException {<NEW_LINE>UserVariablesContext _localctx = new UserVariablesContext(_ctx, getState());<NEW_LINE>enterRule(_localctx, 570, RULE_userVariables);<NEW_LINE>int _la;<NEW_LINE>try {<NEW_LINE>enterOuterAlt(_localctx, 1);<NEW_LINE>{<NEW_LINE>setState(5760);<NEW_LINE>match(LOCAL_ID);<NEW_LINE>setState(5765);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>_la = _input.LA(1);<NEW_LINE>while (_la == COMMA) {<NEW_LINE>{<NEW_LINE>{<NEW_LINE>setState(5761);<NEW_LINE>match(COMMA);<NEW_LINE>setState(5762);<NEW_LINE>match(LOCAL_ID);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>setState(5767);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>_la = _input.LA(1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (RecognitionException re) {<NEW_LINE>_localctx.exception = re;<NEW_LINE><MASK><NEW_LINE>_errHandler.recover(this, re);<NEW_LINE>} finally {<NEW_LINE>exitRule();<NEW_LINE>}<NEW_LINE>return _localctx;<NEW_LINE>} | _errHandler.reportError(this, re); |
973,220 | public okhttp3.Call createBranchProtectionRuleCall(String repository, BranchProtectionRule branchProtectionRule, final ApiCallback _callback) throws ApiException {<NEW_LINE>Object localVarPostBody = branchProtectionRule;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/repositories/{repository}/branch_protection".replaceAll("\\{" + "repository" + "\\}", localVarApiClient.escapeString(repository.toString()));<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, String> localVarCookieParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null) {<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>}<NEW_LINE>final <MASK><NEW_LINE>final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "jwt_token" };<NEW_LINE>return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);<NEW_LINE>} | String[] localVarContentTypes = { "application/json" }; |
969,318 | public boolean onCallApi(int page, @Nullable String parameter) {<NEW_LINE>if (page == 1) {<NEW_LINE>lastPage = Integer.MAX_VALUE;<NEW_LINE>sendToView(view -> view.getLoadMore().reset());<NEW_LINE>}<NEW_LINE>if (page > lastPage || lastPage == 0) {<NEW_LINE><MASK><NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (page == 1) {<NEW_LINE>manageObservable(RestProvider.getRepoService(isEnterprise()).isCollaborator(login, repoId, Login.getUser().getLogin()).doOnNext(booleanResponse -> isCollaborator = booleanResponse.code() == 204));<NEW_LINE>}<NEW_LINE>setCurrentPage(page);<NEW_LINE>makeRestCall(RestProvider.getRepoService(isEnterprise()).getCommitComments(login, repoId, sha, page).flatMap(listResponse -> {<NEW_LINE>lastPage = listResponse.getLast();<NEW_LINE>return TimelineModel.construct(listResponse.getItems());<NEW_LINE>}).doOnComplete(() -> {<NEW_LINE>if (lastPage <= 1) {<NEW_LINE>sendToView(CommitCommentsMvp.View::showReload);<NEW_LINE>}<NEW_LINE>}), listResponse -> sendToView(view -> view.onNotifyAdapter(listResponse, page)));<NEW_LINE>return true;<NEW_LINE>} | sendToView(CommitCommentsMvp.View::hideProgress); |
547,916 | public void doReportStat(SofaTracerSpan sofaTracerSpan) {<NEW_LINE>Map<String, String> tagsWithStr = sofaTracerSpan.getTagsWithStr();<NEW_LINE>StatKey statKey = new StatKey();<NEW_LINE>String localApp = tagsWithStr.get(CommonSpanTags.LOCAL_APP);<NEW_LINE>String operationName = sofaTracerSpan.getOperationName();<NEW_LINE>String channelName = tagsWithStr.get(CommonSpanTags.MSG_CHANNEL);<NEW_LINE>// method name<NEW_LINE>statKey.setKey(buildString(new String[] { localApp, operationName, channelName }));<NEW_LINE>// success<NEW_LINE>String resultCode = tagsWithStr.get(CommonSpanTags.RESULT_CODE);<NEW_LINE>boolean success = isWebHttpClientSuccess(resultCode);<NEW_LINE>statKey.setResult(success ? SofaTracerConstant.STAT_FLAG_SUCCESS : SofaTracerConstant.STAT_FLAG_FAILS);<NEW_LINE>statKey.setEnd(buildString(new String[] { TracerUtils.getLoadTestMark(sofaTracerSpan) }));<NEW_LINE>// pressure mark<NEW_LINE>statKey.setLoadTest<MASK><NEW_LINE>// value the count and duration<NEW_LINE>long duration = sofaTracerSpan.getEndTime() - sofaTracerSpan.getStartTime();<NEW_LINE>long[] values = new long[] { 1, duration };<NEW_LINE>// reserve<NEW_LINE>this.addStat(statKey, values);<NEW_LINE>} | (TracerUtils.isLoadTest(sofaTracerSpan)); |
423,664 | /*<NEW_LINE>* (non-Javadoc)<NEW_LINE>*<NEW_LINE>* @see<NEW_LINE>* com.tweetlanes.android.core.view.ComposeBaseFragment#onSendClick(java.lang<NEW_LINE>* .String)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>protected void onSendClick(String status) {<NEW_LINE>if (status != null) {<NEW_LINE>String otherUserScreenName = getOtherUserScreenName();<NEW_LINE>int statusLength = mStatusValidator.getTweetLength(status);<NEW_LINE>if (otherUserScreenName == null) {<NEW_LINE>showSimpleAlert(R.string.alert_direct_message_no_recipient);<NEW_LINE>} else if (statusLength == 0) {<NEW_LINE><MASK><NEW_LINE>} else if (!mStatusValidator.isValidTweet(status)) {<NEW_LINE>showSimpleAlert(mStatusValidator.getTweetLength(status) <= getMaxPostLength() ? R.string.alert_direct_message_invalid : R.string.alert_direct_message_too_long);<NEW_LINE>} else if (statusLength > 0) {<NEW_LINE>AccountDescriptor account = getApp().getCurrentAccount();<NEW_LINE>if (account != null) {<NEW_LINE>mUpdatingStatus = true;<NEW_LINE>mEditText.setHint(null);<NEW_LINE>mEditText.setEnabled(false);<NEW_LINE>mSendToEditText.setEnabled(false);<NEW_LINE>mSendButton.setEnabled(false);<NEW_LINE>TwitterContentHandleBase contentBase = new TwitterContentHandleBase(TwitterConstant.ContentType.DIRECT_MESSAGES, TwitterConstant.DirectMessagesType.SENT_MESSAGE);<NEW_LINE>TwitterContentHandle contentHandle = new TwitterContentHandle(contentBase, account.getScreenName(), null, account.getAccountKey());<NEW_LINE>TwitterManager.get().sendDirectMessage(account.getId(), otherUserScreenName.trim(), status, contentHandle, mOnSetStatusCallback);<NEW_LINE>showToast(getString(R.string.posting_direct_message_ongoing));<NEW_LINE>updateStatusHint();<NEW_LINE>// mSendingNotification =<NEW_LINE>// NotificationHelper.get().notify(getActivity(), builder);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | showSimpleAlert(R.string.alert_direct_message_empty); |
1,527,056 | private String formatComments(String raw) {<NEW_LINE>Document doc = new Document(raw);<NEW_LINE>IDocumentPartitioner commentPartitioner = new FastPartitioner(new FastJavaPartitionScanner(), COMMENT_TYPES);<NEW_LINE>doc.setDocumentPartitioner(IJavaScriptPartitions.JAVA_PARTITIONING, commentPartitioner);<NEW_LINE>commentPartitioner.connect(doc);<NEW_LINE>CommentFormattingStrategy commentFormatter = new CommentFormattingStrategy();<NEW_LINE>IFormattingContext context = new CommentFormattingContext();<NEW_LINE>context.setProperty(FormattingContextProperties.CONTEXT_PREFERENCES, options);<NEW_LINE>context.setProperty(FormattingContextProperties.CONTEXT_DOCUMENT, Boolean.TRUE);<NEW_LINE>context.setProperty(FormattingContextProperties.CONTEXT_MEDIUM, doc);<NEW_LINE>try {<NEW_LINE>ITypedRegion[] regions = TextUtilities.computePartitioning(doc, IJavaScriptPartitions.JAVA_PARTITIONING, 0, doc.getLength(), false);<NEW_LINE>MultiTextEdit resultEdit = new MultiTextEdit();<NEW_LINE>Arrays.asList(regions).stream().filter(reg -> commentTypesToBeFormatted.contains(reg.getType())).forEach(region -> {<NEW_LINE>TypedPosition typedPosition = new TypedPosition(region.getOffset(), region.getLength(<MASK><NEW_LINE>context.setProperty(FormattingContextProperties.CONTEXT_PARTITION, typedPosition);<NEW_LINE>commentFormatter.formatterStarts(context);<NEW_LINE>TextEdit edit = commentFormatter.calculateTextEdit();<NEW_LINE>commentFormatter.formatterStops();<NEW_LINE>if (null != edit && edit.hasChildren()) {<NEW_LINE>resultEdit.addChild(edit);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>resultEdit.apply(doc);<NEW_LINE>return doc.get();<NEW_LINE>} catch (BadLocationException e) {<NEW_LINE>// Silently ignore comment formatting exceptions and return the original string<NEW_LINE>return raw;<NEW_LINE>}<NEW_LINE>} | ), region.getType()); |
106,805 | public void debugServerState() {<NEW_LINE>logger.debug("--- Server state ----------------------------------------------");<NEW_LINE>Collection<User> users = managerFactory.userManager().getUsers();<NEW_LINE>logger.debug("--------User: " + users.size() + " [userId | since | lock | name -----------------------");<NEW_LINE>for (User user : users) {<NEW_LINE>Optional<Session> session = managerFactory.sessionManager().getSession(user.getSessionId());<NEW_LINE>String sessionState = "N";<NEW_LINE>if (session.isPresent()) {<NEW_LINE>if (session.get().isLocked()) {<NEW_LINE>sessionState = "L";<NEW_LINE>} else {<NEW_LINE>sessionState = "+";<NEW_LINE>}<NEW_LINE>}<NEW_LINE>logger.debug(user.getId() + " | " + formatter.format(user.getConnectionTime()) + " | " + sessionState + " | " + user.getName() + " (" + user.getUserState().toString() + " - " + <MASK><NEW_LINE>}<NEW_LINE>List<ChatSession> chatSessions = managerFactory.chatManager().getChatSessions();<NEW_LINE>logger.debug("------- ChatSessions: " + chatSessions.size() + " ----------------------------------");<NEW_LINE>for (ChatSession chatSession : chatSessions) {<NEW_LINE>logger.debug(chatSession.getChatId() + " " + formatter.format(chatSession.getCreateTime()) + ' ' + chatSession.getInfo() + ' ' + chatSession.getClients().values().toString());<NEW_LINE>}<NEW_LINE>logger.debug("------- Games: " + managerFactory.gameManager().getNumberActiveGames() + " --------------------------------------------");<NEW_LINE>logger.debug(" Active Game Worker: " + managerFactory.threadExecutor().getActiveThreads(managerFactory.threadExecutor().getGameExecutor()));<NEW_LINE>for (Entry<UUID, GameController> entry : managerFactory.gameManager().getGameController().entrySet()) {<NEW_LINE>logger.debug(entry.getKey() + entry.getValue().getPlayerNameList());<NEW_LINE>}<NEW_LINE>logger.debug("--- Server state END ------------------------------------------");<NEW_LINE>} | user.getPingInfo() + ')'); |
635,366 | public static Platform detectPlatform(String engine) {<NEW_LINE>String nativeProp = "native/lib/" + engine + ".properties";<NEW_LINE>Enumeration<URL> urls;<NEW_LINE>try {<NEW_LINE>urls = ClassLoaderUtils.getContextClassLoader().getResources(nativeProp);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new AssertionError("Failed to list property files.", e);<NEW_LINE>}<NEW_LINE>Platform systemPlatform = Platform.fromSystem(engine);<NEW_LINE>Platform placeholder = null;<NEW_LINE>while (urls.hasMoreElements()) {<NEW_LINE>URL url = urls.nextElement();<NEW_LINE>Platform <MASK><NEW_LINE>platform.apiVersion = systemPlatform.apiVersion;<NEW_LINE>if (platform.isPlaceholder()) {<NEW_LINE>placeholder = platform;<NEW_LINE>} else if (platform.matches(systemPlatform)) {<NEW_LINE>return platform;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (placeholder != null) {<NEW_LINE>return placeholder;<NEW_LINE>}<NEW_LINE>if (systemPlatform.version == null) {<NEW_LINE>throw new AssertionError("No " + engine + " version found in property file.");<NEW_LINE>}<NEW_LINE>if (systemPlatform.apiVersion == null) {<NEW_LINE>throw new AssertionError("No " + engine + " djl_version found in property file.");<NEW_LINE>}<NEW_LINE>return systemPlatform;<NEW_LINE>} | platform = Platform.fromUrl(url); |
650,482 | public long handle(Emulator<?> emulator) {<NEW_LINE>RegisterContext context = emulator.getContext();<NEW_LINE>int addr = context.getIntArg(0);<NEW_LINE>Pointer info = context.getPointerArg(1);<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("dladdr addr=0x" + Long.toHexString(addr) + ", info=" + info + ", LR=" + context.getLRPointer());<NEW_LINE>}<NEW_LINE>Module module = emulator.getMemory().findModuleByAddress(addr);<NEW_LINE>if (module == null) {<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>Symbol symbol = module.findClosestSymbolByAddress(addr, true);<NEW_LINE><MASK><NEW_LINE>dlInfo.dli_fname = (int) UnidbgPointer.nativeValue(module.createPathMemory(svcMemory));<NEW_LINE>dlInfo.dli_fbase = (int) module.base;<NEW_LINE>if (symbol != null) {<NEW_LINE>dlInfo.dli_sname = (int) UnidbgPointer.nativeValue(symbol.createNameMemory(svcMemory));<NEW_LINE>dlInfo.dli_saddr = (int) symbol.getAddress();<NEW_LINE>}<NEW_LINE>dlInfo.pack();<NEW_LINE>return 1;<NEW_LINE>} | DlInfo32 dlInfo = new DlInfo32(info); |
1,542,670 | /*<NEW_LINE>* (non-Javadoc)<NEW_LINE>*<NEW_LINE>* @see<NEW_LINE>* org.apache.bcel.util.Repository#storeClass(org.apache.bcel.classfile.<NEW_LINE>* JavaClass)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public void storeClass(JavaClass javaClass) {<NEW_LINE>if (DEBUG) {<NEW_LINE>System.out.println("Storing class " + javaClass.getClassName() + " in repository");<NEW_LINE>}<NEW_LINE>JavaClass previous = nameToClassMap.put(<MASK><NEW_LINE>if (DEBUG && previous != null) {<NEW_LINE>System.out.println("\t==> A previous class was evicted!");<NEW_LINE>dumpStack();<NEW_LINE>}<NEW_LINE>Repository tmp = org.apache.bcel.Repository.getRepository();<NEW_LINE>if (tmp != null && tmp != this) {<NEW_LINE>throw new IllegalStateException("Wrong/multiple BCEL repository");<NEW_LINE>}<NEW_LINE>if (tmp == null) {<NEW_LINE>org.apache.bcel.Repository.setRepository(this);<NEW_LINE>}<NEW_LINE>} | javaClass.getClassName(), javaClass); |
1,424,360 | public boolean accept(final Path source, final Local local, final TransferStatus parent) throws BackgroundException {<NEW_LINE>final Path target = files.get(source);<NEW_LINE>if (source.isFile()) {<NEW_LINE>if (parent.isExists()) {<NEW_LINE>if (find.find(target)) {<NEW_LINE>if (Checksum.NONE != source.attributes().getChecksum()) {<NEW_LINE>final PathAttributes <MASK><NEW_LINE>if (Checksum.NONE != targetAttributes.getChecksum()) {<NEW_LINE>if (Objects.equals(source.attributes().getChecksum(), targetAttributes.getChecksum())) {<NEW_LINE>if (log.isInfoEnabled()) {<NEW_LINE>log.info(String.format("Skip file %s with checksum %s", source, targetAttributes.getChecksum()));<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>log.warn(String.format("Checksum mismatch for %s and %s", source, target));<NEW_LINE>} else {<NEW_LINE>if (log.isInfoEnabled()) {<NEW_LINE>log.info(String.format("Skip file %s with remote size %d", source, targetAttributes.getSize()));<NEW_LINE>}<NEW_LINE>// No need to resume completed transfers<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | targetAttributes = attribute.find(target); |
231,030 | public byte[] bytesValue() {<NEW_LINE>if (token == JSONToken.HEX) {<NEW_LINE>int start = np + 1, len = sp;<NEW_LINE>if (len % 2 != 0) {<NEW_LINE>throw new JSONException("illegal state. " + len);<NEW_LINE>}<NEW_LINE>byte[] bytes = new byte[len / 2];<NEW_LINE>for (int i = 0; i < bytes.length; ++i) {<NEW_LINE>char c0 = text.charAt(start + i * 2);<NEW_LINE>char c1 = text.charAt(start + i * 2 + 1);<NEW_LINE>int b0 = c0 - (c0 <= 57 ? 48 : 55);<NEW_LINE>int b1 = c1 - (c1 <= 57 ? 48 : 55);<NEW_LINE>bytes[i] = (byte) ((b0 << 4) | b1);<NEW_LINE>}<NEW_LINE>return bytes;<NEW_LINE>}<NEW_LINE>if (!hasSpecial) {<NEW_LINE>return IOUtils.decodeBase64(<MASK><NEW_LINE>} else {<NEW_LINE>String escapedText = new String(sbuf, 0, sp);<NEW_LINE>return IOUtils.decodeBase64(escapedText);<NEW_LINE>}<NEW_LINE>} | text, np + 1, sp); |
500,089 | public boolean verify(final CertificateTrustCallback prompt, final String hostname, final List<X509Certificate> certificates) throws CertificateException {<NEW_LINE>if (certificates.isEmpty()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>int err;<NEW_LINE>// Specify true on the client side to return a policy for SSL server certificates<NEW_LINE>final SecPolicyRef policyRef = SecurityFunctions.library.SecPolicyCreateSSL(true, hostname);<NEW_LINE>final PointerByReference reference = new PointerByReference();<NEW_LINE>err = SecurityFunctions.library.SecTrustCreateWithCertificates(toDEREncodedCertificates(certificates), policyRef, reference);<NEW_LINE>if (0 != err) {<NEW_LINE>log.error(String.format("SecTrustCreateWithCertificates returning error %d", err));<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>final SecTrustRef trustRef = new SecTrustRef(reference.getValue());<NEW_LINE>final SecTrustResultType trustResultType = new SecTrustResultType();<NEW_LINE>err = SecurityFunctions.library.SecTrustEvaluate(trustRef, trustResultType);<NEW_LINE>if (0 != err) {<NEW_LINE>log.error(String.format("SecTrustEvaluate returning error %d", err));<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>FoundationKitFunctions.library.CFRelease(policyRef);<NEW_LINE>switch(trustResultType.getValue()) {<NEW_LINE>// Implicitly trusted<NEW_LINE>case SecTrustResultType.kSecTrustResultUnspecified:<NEW_LINE>case // Accepted by user keychain setting explicitly<NEW_LINE>SecTrustResultType.kSecTrustResultProceed:<NEW_LINE>return true;<NEW_LINE>default:<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("Evaluated recoverable trust result failure " + trustResultType.getValue());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>prompt.prompt(hostname, certificates);<NEW_LINE>return true;<NEW_LINE>} catch (ConnectionCanceledException e) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | FoundationKitFunctions.library.CFRelease(trustRef); |
1,199,248 | public void run() {<NEW_LINE>final long millisBeforeWarning = this.conf.getTimeInMillis(Property.TSERV_ASSIGNMENT_DURATION_WARNING);<NEW_LINE>try {<NEW_LINE>long now = System.currentTimeMillis();<NEW_LINE>KeyExtent extent;<NEW_LINE>RunnableStartedAt runnable;<NEW_LINE>long warnings = 0;<NEW_LINE>for (Entry<KeyExtent, RunnableStartedAt> entry : activeAssignments.entrySet()) {<NEW_LINE>extent = entry.getKey();<NEW_LINE>runnable = entry.getValue();<NEW_LINE>final long duration <MASK><NEW_LINE>// Print a warning if an assignment has been running for over the configured time length<NEW_LINE>if (duration > millisBeforeWarning) {<NEW_LINE>warnings++;<NEW_LINE>log.warn("Assignment for {} has been running for at least {}ms", extent, duration, runnable.getTask().getException());<NEW_LINE>} else if (log.isTraceEnabled()) {<NEW_LINE>log.trace("Assignment for {} only running for {}ms", extent, duration);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>longAssignments = warnings;<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.warn("Caught exception checking active assignments", e);<NEW_LINE>} finally {<NEW_LINE>// Don't run more often than every 5s<NEW_LINE>long delay = Math.max((long) (millisBeforeWarning * 0.5), 5000L);<NEW_LINE>if (log.isTraceEnabled()) {<NEW_LINE>log.trace("Rescheduling assignment watcher to run in {}ms", delay);<NEW_LINE>}<NEW_LINE>ThreadPools.watchCriticalScheduledTask(context.getScheduledExecutor().schedule(this, delay, TimeUnit.MILLISECONDS));<NEW_LINE>}<NEW_LINE>} | = now - runnable.getStartTime(); |
191,013 | protected void handleSmsReceived(Intent intent) {<NEW_LINE>String body;<NEW_LINE>Bundle bundle = intent.getExtras();<NEW_LINE>Message msg = new Message();<NEW_LINE>log("handleSmsReceived() bundle " + bundle);<NEW_LINE>if (bundle != null) {<NEW_LINE>SmsMessage[] messages = getMessagesFromIntent(intent);<NEW_LINE>if (messages != null) {<NEW_LINE>SmsMessage sms = messages[0];<NEW_LINE>// extract message details. phone number and the message body<NEW_LINE>msg.setMessageFrom(sms.getOriginatingAddress());<NEW_LINE>msg.setMessageDate(new Date(sms.getTimestampMillis()));<NEW_LINE>if (messages.length == 1 || sms.isReplace()) {<NEW_LINE>body = sms.getDisplayMessageBody();<NEW_LINE>} else {<NEW_LINE>StringBuilder bodyText = new StringBuilder();<NEW_LINE>for (int i = 0; i < messages.length; i++) {<NEW_LINE>bodyText.append(messages[i].getMessageBody());<NEW_LINE>}<NEW_LINE>body = bodyText.toString();<NEW_LINE>}<NEW_LINE>msg.setMessageBody(body);<NEW_LINE>msg.setMessageUuid(new ProcessSms(mContext).getUuid());<NEW_LINE>msg.setMessageType(Message.Type.PENDING);<NEW_LINE>msg.<MASK><NEW_LINE>}<NEW_LINE>// Log received SMS<NEW_LINE>mFileManager.append(getString(R.string.received_msg, msg.getMessageBody(), msg.getMessageFrom()));<NEW_LINE>// Route the SMS<NEW_LINE>if (App.getTwitterInstance().getSessionManager().getActiveSession() != null) {<NEW_LINE>boolean status = mTweetMessage.routeSms(msg);<NEW_LINE>showNotification(status);<NEW_LINE>}<NEW_LINE>boolean status = mPostMessage.routeSms(msg);<NEW_LINE>showNotification(status);<NEW_LINE>}<NEW_LINE>} | setStatus(Message.Status.UNCONFIRMED); |
1,824,794 | private static QueryOptimizer initStaticOptimizer() {<NEW_LINE>if (OPTIMIZER != null) {<NEW_LINE>return OPTIMIZER;<NEW_LINE>}<NEW_LINE>String opt = System.getenv("elki.optimizer");<NEW_LINE>if (opt != null) {<NEW_LINE>if (opt.isEmpty()) {<NEW_LINE>// Disable<NEW_LINE>LOG.warning("Optimizer disabled.");<NEW_LINE>return DisableQueryOptimizer.STATIC;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Class<? extends QueryOptimizer> clz = ELKIServiceRegistry.findImplementation(QueryOptimizer.class, opt);<NEW_LINE>if (clz == null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>return ClassGenericsUtil.tryInstantiate(QueryOptimizer.class, clz, new EmptyParameterization());<NEW_LINE>} catch (ClassInstantiationException e) {<NEW_LINE>throw new AbortException("Failed to initialize query optimizer: " + opt, e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Default optimizer<NEW_LINE>return new EmpiricalQueryOptimizer();<NEW_LINE>} | throw new AbortException("Could not find query optimizer: " + opt); |
674,993 | public Map<String, Map<String, AttributeAdapter>> attributeAdaptersForFunction() {<NEW_LINE>Map<String, Map<String, AttributeAdapter>> <MASK><NEW_LINE>Map<String, AttributeAdapter> tfMappings = new LinkedHashMap<>();<NEW_LINE>val fields = DifferentialFunctionClassHolder.getInstance().getFieldsForFunction(this);<NEW_LINE>// TF uses [kH, kW, inC, outC] always for weights<NEW_LINE>tfMappings.put("kH", new NDArrayShapeAdapter(0));<NEW_LINE>tfMappings.put("kW", new NDArrayShapeAdapter(1));<NEW_LINE>tfMappings.put("sH", new ConditionalFieldValueIntIndexArrayAdapter("NCHW", 2, 1, fields.get("dataFormat")));<NEW_LINE>tfMappings.put("sW", new ConditionalFieldValueIntIndexArrayAdapter("NCHW", 3, 2, fields.get("dataFormat")));<NEW_LINE>tfMappings.put("dH", new ConditionalFieldValueIntIndexArrayAdapter("NCHW", 2, 1, fields.get("dataFormat")));<NEW_LINE>tfMappings.put("dW", new ConditionalFieldValueIntIndexArrayAdapter("NCHW", 3, 2, fields.get("dataFormat")));<NEW_LINE>tfMappings.put("isSameMode", new StringEqualsAdapter("SAME"));<NEW_LINE>Map<String, AttributeAdapter> onnxMappings = new HashMap<>();<NEW_LINE>onnxMappings.put("kH", new SizeThresholdIntArrayIntIndexAdapter(0, 2, 0));<NEW_LINE>onnxMappings.put("kW", new SizeThresholdIntArrayIntIndexAdapter(1, 2, 0));<NEW_LINE>onnxMappings.put("dH", new SizeThresholdIntArrayIntIndexAdapter(0, 2, 0));<NEW_LINE>onnxMappings.put("dW", new SizeThresholdIntArrayIntIndexAdapter(1, 2, 0));<NEW_LINE>onnxMappings.put("sH", new SizeThresholdIntArrayIntIndexAdapter(0, 2, 0));<NEW_LINE>onnxMappings.put("sW", new SizeThresholdIntArrayIntIndexAdapter(1, 2, 0));<NEW_LINE>onnxMappings.put("isSameMode", new StringEqualsAdapter("SAME"));<NEW_LINE>ret.put(tensorflowName(), tfMappings);<NEW_LINE>ret.put(onnxName(), onnxMappings);<NEW_LINE>return ret;<NEW_LINE>} | ret = new HashMap<>(); |
818,423 | public static GetPayAsYouGoPriceResponse unmarshall(GetPayAsYouGoPriceResponse getPayAsYouGoPriceResponse, UnmarshallerContext _ctx) {<NEW_LINE>getPayAsYouGoPriceResponse.setRequestId(_ctx.stringValue("GetPayAsYouGoPriceResponse.RequestId"));<NEW_LINE>getPayAsYouGoPriceResponse.setCode<MASK><NEW_LINE>getPayAsYouGoPriceResponse.setMessage(_ctx.stringValue("GetPayAsYouGoPriceResponse.Message"));<NEW_LINE>getPayAsYouGoPriceResponse.setSuccess(_ctx.booleanValue("GetPayAsYouGoPriceResponse.Success"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setCurrency(_ctx.stringValue("GetPayAsYouGoPriceResponse.Data.Currency"));<NEW_LINE>List<ModuleDetail> moduleDetails = new ArrayList<ModuleDetail>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("GetPayAsYouGoPriceResponse.Data.ModuleDetails.Length"); i++) {<NEW_LINE>ModuleDetail moduleDetail = new ModuleDetail();<NEW_LINE>moduleDetail.setCostAfterDiscount(_ctx.floatValue("GetPayAsYouGoPriceResponse.Data.ModuleDetails[" + i + "].CostAfterDiscount"));<NEW_LINE>moduleDetail.setInvoiceDiscount(_ctx.floatValue("GetPayAsYouGoPriceResponse.Data.ModuleDetails[" + i + "].InvoiceDiscount"));<NEW_LINE>moduleDetail.setUnitPrice(_ctx.floatValue("GetPayAsYouGoPriceResponse.Data.ModuleDetails[" + i + "].UnitPrice"));<NEW_LINE>moduleDetail.setOriginalCost(_ctx.floatValue("GetPayAsYouGoPriceResponse.Data.ModuleDetails[" + i + "].OriginalCost"));<NEW_LINE>moduleDetail.setModuleCode(_ctx.stringValue("GetPayAsYouGoPriceResponse.Data.ModuleDetails[" + i + "].ModuleCode"));<NEW_LINE>moduleDetails.add(moduleDetail);<NEW_LINE>}<NEW_LINE>data.setModuleDetails(moduleDetails);<NEW_LINE>List<PromotionDetail> promotionDetails = new ArrayList<PromotionDetail>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("GetPayAsYouGoPriceResponse.Data.PromotionDetails.Length"); i++) {<NEW_LINE>PromotionDetail promotionDetail = new PromotionDetail();<NEW_LINE>promotionDetail.setPromotionDesc(_ctx.stringValue("GetPayAsYouGoPriceResponse.Data.PromotionDetails[" + i + "].PromotionDesc"));<NEW_LINE>promotionDetail.setPromotionId(_ctx.longValue("GetPayAsYouGoPriceResponse.Data.PromotionDetails[" + i + "].PromotionId"));<NEW_LINE>promotionDetail.setPromotionName(_ctx.stringValue("GetPayAsYouGoPriceResponse.Data.PromotionDetails[" + i + "].PromotionName"));<NEW_LINE>promotionDetails.add(promotionDetail);<NEW_LINE>}<NEW_LINE>data.setPromotionDetails(promotionDetails);<NEW_LINE>getPayAsYouGoPriceResponse.setData(data);<NEW_LINE>return getPayAsYouGoPriceResponse;<NEW_LINE>} | (_ctx.stringValue("GetPayAsYouGoPriceResponse.Code")); |
1,326,211 | protected JMenu createMenu() {<NEW_LINE>JMenu menu = new JMenu(this);<NEW_LINE>JMenuItem item;<NEW_LINE>if (dest.equals(ActionDestination.MainMenu)) {<NEW_LINE>item = new JMenuItem();<NEW_LINE>Action action = (Action) SystemAction.get(CheckoutRevisionAction.class);<NEW_LINE>Utils.setAcceleratorBindings(Annotator.ACTIONS_PATH_PREFIX, action);<NEW_LINE>Actions.<MASK><NEW_LINE>menu.add(item);<NEW_LINE>item = new JMenuItem();<NEW_LINE>action = (Action) SystemAction.get(CheckoutPathsAction.class);<NEW_LINE>Utils.setAcceleratorBindings(Annotator.ACTIONS_PATH_PREFIX, action);<NEW_LINE>Actions.connect(item, action, false);<NEW_LINE>menu.add(item);<NEW_LINE>} else {<NEW_LINE>// NOI18N<NEW_LINE>item = menu.add(SystemActionBridge.createAction(SystemAction.get(CheckoutRevisionAction.class), NbBundle.getMessage(CheckoutRevisionAction.class, "LBL_CheckoutRevisionAction_PopupName"), lkp));<NEW_LINE>org.openide.awt.Mnemonics.setLocalizedText(item, item.getText());<NEW_LINE>item = menu.add(SystemActionBridge.createAction(SystemAction.get(CheckoutPathsAction.class), NbBundle.getMessage(CheckoutPathsAction.class, "LBL_CheckoutPathsAction_PopupName"), lkp));<NEW_LINE>org.openide.awt.Mnemonics.setLocalizedText(item, item.getText());<NEW_LINE>}<NEW_LINE>return menu;<NEW_LINE>} | connect(item, action, false); |
528,515 | public List<T> applyFuzzy(List<T> target, int maxFuzz) throws PatchFailedException {<NEW_LINE>PatchApplyingContext<T> ctx = new PatchApplyingContext<>(new ArrayList<>(target), maxFuzz);<NEW_LINE>// the difference between patch's position and actually applied position<NEW_LINE>int lastPatchDelta = 0;<NEW_LINE>for (AbstractDelta<T> delta : getDeltas()) {<NEW_LINE>ctx.defaultPosition = delta.getSource().getPosition() + lastPatchDelta;<NEW_LINE>int <MASK><NEW_LINE>if (0 <= patchPosition) {<NEW_LINE>delta.applyFuzzyToAt(ctx.result, ctx.currentFuzz, patchPosition);<NEW_LINE>lastPatchDelta = patchPosition - delta.getSource().getPosition();<NEW_LINE>ctx.lastPatchEnd = delta.getSource().last() + lastPatchDelta;<NEW_LINE>} else {<NEW_LINE>conflictOutput.processConflict(VerifyChunk.CONTENT_DOES_NOT_MATCH_TARGET, delta, ctx.result);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return ctx.result;<NEW_LINE>} | patchPosition = findPositionFuzzy(ctx, delta); |
756,654 | public void marshall(CreateMeetingWithAttendeesRequest createMeetingWithAttendeesRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (createMeetingWithAttendeesRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(createMeetingWithAttendeesRequest.getClientRequestToken(), CLIENTREQUESTTOKEN_BINDING);<NEW_LINE>protocolMarshaller.marshall(createMeetingWithAttendeesRequest.getExternalMeetingId(), EXTERNALMEETINGID_BINDING);<NEW_LINE>protocolMarshaller.marshall(createMeetingWithAttendeesRequest.getMeetingHostId(), MEETINGHOSTID_BINDING);<NEW_LINE>protocolMarshaller.marshall(createMeetingWithAttendeesRequest.getMediaRegion(), MEDIAREGION_BINDING);<NEW_LINE>protocolMarshaller.marshall(createMeetingWithAttendeesRequest.getTags(), TAGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createMeetingWithAttendeesRequest.getNotificationsConfiguration(), NOTIFICATIONSCONFIGURATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | createMeetingWithAttendeesRequest.getAttendees(), ATTENDEES_BINDING); |
1,321,751 | public void marshall(DataSourceParameters dataSourceParameters, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (dataSourceParameters == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(dataSourceParameters.getAmazonElasticsearchParameters(), AMAZONELASTICSEARCHPARAMETERS_BINDING);<NEW_LINE>protocolMarshaller.marshall(dataSourceParameters.getAthenaParameters(), ATHENAPARAMETERS_BINDING);<NEW_LINE>protocolMarshaller.marshall(dataSourceParameters.getAuroraParameters(), AURORAPARAMETERS_BINDING);<NEW_LINE>protocolMarshaller.marshall(dataSourceParameters.getAuroraPostgreSqlParameters(), AURORAPOSTGRESQLPARAMETERS_BINDING);<NEW_LINE>protocolMarshaller.marshall(dataSourceParameters.getAwsIotAnalyticsParameters(), AWSIOTANALYTICSPARAMETERS_BINDING);<NEW_LINE>protocolMarshaller.marshall(dataSourceParameters.getJiraParameters(), JIRAPARAMETERS_BINDING);<NEW_LINE>protocolMarshaller.marshall(dataSourceParameters.getMariaDbParameters(), MARIADBPARAMETERS_BINDING);<NEW_LINE>protocolMarshaller.marshall(dataSourceParameters.getMySqlParameters(), MYSQLPARAMETERS_BINDING);<NEW_LINE>protocolMarshaller.marshall(dataSourceParameters.getOracleParameters(), ORACLEPARAMETERS_BINDING);<NEW_LINE>protocolMarshaller.marshall(dataSourceParameters.getPostgreSqlParameters(), POSTGRESQLPARAMETERS_BINDING);<NEW_LINE>protocolMarshaller.marshall(dataSourceParameters.getPrestoParameters(), PRESTOPARAMETERS_BINDING);<NEW_LINE>protocolMarshaller.marshall(dataSourceParameters.getRdsParameters(), RDSPARAMETERS_BINDING);<NEW_LINE>protocolMarshaller.marshall(dataSourceParameters.getRedshiftParameters(), REDSHIFTPARAMETERS_BINDING);<NEW_LINE>protocolMarshaller.marshall(dataSourceParameters.getS3Parameters(), S3PARAMETERS_BINDING);<NEW_LINE>protocolMarshaller.marshall(dataSourceParameters.getServiceNowParameters(), SERVICENOWPARAMETERS_BINDING);<NEW_LINE>protocolMarshaller.marshall(dataSourceParameters.getSnowflakeParameters(), SNOWFLAKEPARAMETERS_BINDING);<NEW_LINE>protocolMarshaller.marshall(dataSourceParameters.getSparkParameters(), SPARKPARAMETERS_BINDING);<NEW_LINE>protocolMarshaller.marshall(dataSourceParameters.getSqlServerParameters(), SQLSERVERPARAMETERS_BINDING);<NEW_LINE>protocolMarshaller.marshall(dataSourceParameters.getTeradataParameters(), TERADATAPARAMETERS_BINDING);<NEW_LINE>protocolMarshaller.marshall(dataSourceParameters.getTwitterParameters(), TWITTERPARAMETERS_BINDING);<NEW_LINE>protocolMarshaller.marshall(dataSourceParameters.getAmazonOpenSearchParameters(), AMAZONOPENSEARCHPARAMETERS_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | dataSourceParameters.getExasolParameters(), EXASOLPARAMETERS_BINDING); |
1,175,737 | private void generateJournalBatch(String trxName, String documentNo, int glCategoryId, int documentTypeId, int currencyId, int conversionTypeId, int calendarId, int budgetId) {<NEW_LINE>MJournalBatch journalBatch = new MJournalBatch(getCtx(), 0, trxName);<NEW_LINE>journalBatch.setDocumentNo(documentNo);<NEW_LINE>journalBatch.setDescription(getBatchDescription());<NEW_LINE>journalBatch.setPostingType(MJournalBatch.POSTINGTYPE_Budget);<NEW_LINE><MASK><NEW_LINE>journalBatch.setDateDoc(getAccountDate());<NEW_LINE>journalBatch.setGL_Category_ID(glCategoryId);<NEW_LINE>journalBatch.setC_Currency_ID(currencyId);<NEW_LINE>journalBatch.setC_DocType_ID(documentTypeId);<NEW_LINE>journalBatch.setAD_Org_ID(getOrganizationId());<NEW_LINE>// Current Period<NEW_LINE>int periodId = MPeriod.getC_Period_ID(getCtx(), getAccountDate(), Env.getAD_Org_ID(getCtx()));<NEW_LINE>journalBatch.setC_Period_ID(periodId);<NEW_LINE>journalBatch.saveEx();<NEW_LINE>// Create Journal<NEW_LINE>createJournal(journalBatch, conversionTypeId, calendarId, budgetId);<NEW_LINE>} | journalBatch.setDateAcct(getAccountDate()); |
268,793 | public void run(RegressionEnvironment env) {<NEW_LINE>String expression = "@name('s0') select symbol from SupportMarketDataBean#length(2) output when count_remove >= 2";<NEW_LINE>env.compileDeploy(expression).setSubscriber("s0");<NEW_LINE>sendEvent(env, "S1", 0);<NEW_LINE>sendEvent(env, "S2", 0);<NEW_LINE><MASK><NEW_LINE>env.assertSubscriber("s0", subscriber -> assertFalse(subscriber.isInvoked()));<NEW_LINE>sendEvent(env, "S4", 0);<NEW_LINE>env.assertSubscriber("s0", subscriber -> EPAssertionUtil.assertEqualsExactOrder(new Object[] { "S1", "S2", "S3", "S4" }, subscriber.getAndResetLastNewData()));<NEW_LINE>sendEvent(env, "S5", 0);<NEW_LINE>env.assertSubscriber("s0", subscriber -> assertFalse(subscriber.isInvoked()));<NEW_LINE>sendEvent(env, "S6", 0);<NEW_LINE>env.assertSubscriber("s0", subscriber -> EPAssertionUtil.assertEqualsExactOrder(new Object[] { "S5", "S6" }, subscriber.getAndResetLastNewData()));<NEW_LINE>sendEvent(env, "S7", 0);<NEW_LINE>env.assertSubscriber("s0", subscriber -> assertFalse(subscriber.isInvoked()));<NEW_LINE>env.undeployAll();<NEW_LINE>} | sendEvent(env, "S3", 0); |
303,857 | private void postActivate(InvocationContext inv) {<NEW_LINE>try {<NEW_LINE>Object results = getResultsObject(inv);<NEW_LINE>addPostActivate(results, CLASS_NAME, "postActivate");<NEW_LINE>// Validate and update context data.<NEW_LINE>Map<String, Object> map = inv.getContextData();<NEW_LINE>String data;<NEW_LINE>if (map.containsKey("PostActivate")) {<NEW_LINE>data = (String) map.get("PostActivate");<NEW_LINE>data = data + ":" + CLASS_NAME;<NEW_LINE>} else {<NEW_LINE>data = CLASS_NAME;<NEW_LINE>}<NEW_LINE>map.put("PostActivate", data);<NEW_LINE>setPostActivateContextData(results, data);<NEW_LINE>// Verify around invoke does not see any context data from lifecycle<NEW_LINE>// callback events.<NEW_LINE>if (map.containsKey("PostConstruct")) {<NEW_LINE>throw new IllegalStateException("PostConstruct context data shared with PostActivate interceptor");<NEW_LINE>} else if (map.containsKey("AroundInvoke")) {<NEW_LINE>throw new IllegalStateException("AroundInvoke context data shared with PostActivate interceptor");<NEW_LINE>} else if (map.containsKey("PrePassivate")) {<NEW_LINE>throw new IllegalStateException("PrePassivate context data shared with PostActivate interceptor");<NEW_LINE>} else if (map.containsKey("PreDestroy")) {<NEW_LINE>throw new IllegalStateException("PreDestroy context data shared with PostActivate interceptor");<NEW_LINE>}<NEW_LINE>// Verify same InvocationContext passed to each PostActivate<NEW_LINE>// interceptor method.<NEW_LINE>InvocationContext ctxData;<NEW_LINE>if (map.containsKey("InvocationContext")) {<NEW_LINE>ctxData = (InvocationContext) map.get("InvocationContext");<NEW_LINE>if (inv != ctxData) {<NEW_LINE>throw new IllegalStateException("Same InvocationContext not passed to each PostActivate interceptor");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>map.put("InvocationContext", inv);<NEW_LINE>}<NEW_LINE>inv.proceed();<NEW_LINE>} catch (Exception e) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | throw new EJBException("unexpected Throwable", e); |
1,574,163 | public CodegenParameter fromParameter(Parameter parameter, Set<String> imports) {<NEW_LINE>CodegenParameter cp = super.fromParameter(parameter, imports);<NEW_LINE>if (parameter.getStyle() != null) {<NEW_LINE>switch(parameter.getStyle()) {<NEW_LINE>case MATRIX:<NEW_LINE>cp.style = "MATRIX";<NEW_LINE>break;<NEW_LINE>case LABEL:<NEW_LINE>cp.style = "LABEL";<NEW_LINE>break;<NEW_LINE>case FORM:<NEW_LINE>cp.style = "FORM";<NEW_LINE>break;<NEW_LINE>case SIMPLE:<NEW_LINE>cp.style = "SIMPLE";<NEW_LINE>break;<NEW_LINE>case SPACEDELIMITED:<NEW_LINE>cp.style = "SPACE_DELIMITED";<NEW_LINE>break;<NEW_LINE>case PIPEDELIMITED:<NEW_LINE>cp.style = "PIPE_DELIMITED";<NEW_LINE>break;<NEW_LINE>case DEEPOBJECT:<NEW_LINE>cp.style = "DEEP_OBJECT";<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// clone this so we can change some properties on it<NEW_LINE>CodegenProperty schemaProp = cp<MASK><NEW_LINE>// parameters may have valid python names like some_val or invalid ones like Content-Type<NEW_LINE>// we always set nameInSnakeCase to null so special handling will not be done for these names<NEW_LINE>// invalid python names will be handled in python by using a TypedDict which will allow us to have a type hint<NEW_LINE>// for keys that cannot be variable names to the schema baseName<NEW_LINE>if (schemaProp != null) {<NEW_LINE>schemaProp.nameInSnakeCase = null;<NEW_LINE>schemaProp.baseName = toModelName(cp.baseName) + "Schema";<NEW_LINE>cp.setSchema(schemaProp);<NEW_LINE>}<NEW_LINE>return cp;<NEW_LINE>} | .getSchema().clone(); |
468,285 | static TxType evaluateTxTypeFromOpReturnType(TempTx tempTx, OpReturnType opReturnType) {<NEW_LINE>switch(opReturnType) {<NEW_LINE>case PROPOSAL:<NEW_LINE>return TxType.PROPOSAL;<NEW_LINE>case COMPENSATION_REQUEST:<NEW_LINE>case REIMBURSEMENT_REQUEST:<NEW_LINE>boolean hasCorrectNumOutputs = tempTx.getTempTxOutputs().size() >= 3;<NEW_LINE>if (!hasCorrectNumOutputs) {<NEW_LINE>log.warn("Compensation/reimbursement request tx need to have at least 3 outputs");<NEW_LINE>// Such a transaction cannot be created by the Bisq client and is considered invalid.<NEW_LINE>return TxType.INVALID;<NEW_LINE>}<NEW_LINE>TempTxOutput issuanceTxOutput = tempTx.getTempTxOutputs().get(1);<NEW_LINE>boolean hasIssuanceOutput = issuanceTxOutput.getTxOutputType() == TxOutputType.ISSUANCE_CANDIDATE_OUTPUT;<NEW_LINE>if (!hasIssuanceOutput) {<NEW_LINE>log.warn("Compensation/reimbursement request txOutput type of output at index 1 need to be ISSUANCE_CANDIDATE_OUTPUT. " + <MASK><NEW_LINE>// Such a transaction cannot be created by the Bisq client and is considered invalid.<NEW_LINE>return TxType.INVALID;<NEW_LINE>}<NEW_LINE>return opReturnType == OpReturnType.COMPENSATION_REQUEST ? TxType.COMPENSATION_REQUEST : TxType.REIMBURSEMENT_REQUEST;<NEW_LINE>case BLIND_VOTE:<NEW_LINE>return TxType.BLIND_VOTE;<NEW_LINE>case VOTE_REVEAL:<NEW_LINE>return TxType.VOTE_REVEAL;<NEW_LINE>case LOCKUP:<NEW_LINE>return TxType.LOCKUP;<NEW_LINE>case ASSET_LISTING_FEE:<NEW_LINE>return TxType.ASSET_LISTING_FEE;<NEW_LINE>case PROOF_OF_BURN:<NEW_LINE>return TxType.PROOF_OF_BURN;<NEW_LINE>default:<NEW_LINE>log.warn("We got a BSQ tx with an unknown OP_RETURN. tx={}, opReturnType={}", tempTx, opReturnType);<NEW_LINE>// We tolerate such an incorrect tx and do not burn the BSQ. We might need that in case we add new<NEW_LINE>// opReturn types in future.<NEW_LINE>return TxType.IRREGULAR;<NEW_LINE>}<NEW_LINE>} | "TxOutputType={}", issuanceTxOutput.getTxOutputType()); |
1,509,243 | private Composite createBasicInfoGroup(Composite parent, IFileStore fileStore, IFileInfo fileInfo) {<NEW_LINE>Composite container = new Composite(parent, SWT.NULL);<NEW_LINE>container.setLayout(GridLayoutFactory.swtDefaults().numColumns(2).margins(0, 0).create());<NEW_LINE>Label label = new Label(container, SWT.NONE);<NEW_LINE>label.setText(IDEWorkbenchMessages.ResourceInfo_path);<NEW_LINE>label.setLayoutData(GridDataFactory.swtDefaults().align(SWT.BEGINNING, SWT.TOP).create());<NEW_LINE>Text pathText = new Text(container, SWT.WRAP | SWT.READ_ONLY);<NEW_LINE>pathText.setText(fileStore.toURI().getPath());<NEW_LINE>pathText.setBackground(pathText.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));<NEW_LINE>pathText.setLayoutData(GridDataFactory.swtDefaults().grab(true, false).align(SWT.FILL, SWT.CENTER).hint(convertWidthInCharsToPixels(MAX_VALUE_WIDTH), SWT.DEFAULT).create());<NEW_LINE>label = new Label(container, SWT.LEFT);<NEW_LINE>label.setText(IDEWorkbenchMessages.ResourceInfo_type);<NEW_LINE>label.setLayoutData(GridDataFactory.swtDefaults().align(SWT.BEGINNING, SWT.TOP).create());<NEW_LINE>Text typeText = new Text(container, SWT.LEFT | SWT.READ_ONLY);<NEW_LINE>typeText.setText(fileInfo.isDirectory() ? Messages.FileInfoPropertyPage_Folder : Messages.FileInfoPropertyPage_File);<NEW_LINE>typeText.setBackground(typeText.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));<NEW_LINE>typeText.setLayoutData(GridDataFactory.swtDefaults().create());<NEW_LINE>label = new Label(container, SWT.LEFT);<NEW_LINE><MASK><NEW_LINE>label.setLayoutData(GridDataFactory.swtDefaults().align(SWT.BEGINNING, SWT.TOP).create());<NEW_LINE>Text locationText = new Text(container, SWT.WRAP | SWT.READ_ONLY);<NEW_LINE>locationText.setText(fileStore.toString());<NEW_LINE>locationText.setBackground(locationText.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));<NEW_LINE>locationText.setLayoutData(GridDataFactory.swtDefaults().grab(true, false).align(SWT.FILL, SWT.CENTER).hint(convertWidthInCharsToPixels(MAX_VALUE_WIDTH), SWT.DEFAULT).create());<NEW_LINE>if (!fileInfo.isDirectory()) {<NEW_LINE>label = new Label(container, SWT.LEFT);<NEW_LINE>label.setText(IDEWorkbenchMessages.ResourceInfo_size);<NEW_LINE>label.setLayoutData(GridDataFactory.swtDefaults().create());<NEW_LINE>Text sizeText = new Text(container, SWT.LEFT | SWT.READ_ONLY);<NEW_LINE>sizeText.setText(MessageFormat.format(Messages.FileInfoPropertyPage_Bytes, Long.toString(fileInfo.getLength())));<NEW_LINE>sizeText.setBackground(sizeText.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));<NEW_LINE>sizeText.setLayoutData(GridDataFactory.swtDefaults().grab(true, false).align(SWT.FILL, SWT.CENTER).hint(convertWidthInCharsToPixels(MAX_VALUE_WIDTH), SWT.DEFAULT).create());<NEW_LINE>}<NEW_LINE>return container;<NEW_LINE>} | label.setText(IDEWorkbenchMessages.ResourceInfo_location); |
809,210 | public void write(Node node, EntityMetadata entityMetadata, String persistenceUnit, ConsistencyLevel consistencyLevel, CassandraDataHandler cdHandler) {<NEW_LINE>// Index in Inverted Index table if applicable<NEW_LINE>boolean invertedIndexingApplicable = CassandraIndexHelper.isInvertedIndexingApplicable(entityMetadata, useSecondryIndex);<NEW_LINE>if (invertedIndexingApplicable) {<NEW_LINE>String indexColumnFamily = CassandraIndexHelper.getInvertedIndexTableName(entityMetadata.getTableName());<NEW_LINE>Mutator mutator = pelopsClient.getMutator();<NEW_LINE>List<ThriftRow> indexThriftyRows = ((PelopsDataHandler) cdHandler).toIndexThriftRow(node.<MASK><NEW_LINE>for (ThriftRow thriftRow : indexThriftyRows) {<NEW_LINE>List<Column> thriftColumns = thriftRow.getColumns();<NEW_LINE>List<SuperColumn> thriftSuperColumns = thriftRow.getSuperColumns();<NEW_LINE>if (thriftColumns != null && !thriftColumns.isEmpty()) {<NEW_LINE>// Bytes.fromL<NEW_LINE>mutator.writeColumns(thriftRow.getColumnFamilyName(), Bytes.fromByteBuffer(CassandraUtilities.toBytes(thriftRow.getId(), thriftRow.getId().getClass())), Arrays.asList(thriftRow.getColumns().toArray(new Column[0])));<NEW_LINE>}<NEW_LINE>if (thriftSuperColumns != null && !thriftSuperColumns.isEmpty()) {<NEW_LINE>for (SuperColumn sc : thriftSuperColumns) {<NEW_LINE>mutator.writeSubColumns(thriftRow.getColumnFamilyName(), Bytes.fromByteBuffer(CassandraUtilities.toBytes(thriftRow.getId(), thriftRow.getId().getClass())), Bytes.fromByteArray(sc.getName()), sc.getColumns());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>mutator.execute(consistencyLevel);<NEW_LINE>indexThriftyRows = null;<NEW_LINE>}<NEW_LINE>} | getData(), entityMetadata, indexColumnFamily); |
1,491,828 | public ModulesCompilerData compile(String entry, Map<String, String> sources, BundleType bundleType, Map<String, String> namespaceMapping, List<OutputConfig> configs) throws Exception {<NEW_LINE>if (bundleType == null) {<NEW_LINE>bundleType = BundleType.internal;<NEW_LINE>}<NEW_LINE>if (namespaceMapping == null) {<NEW_LINE>namespaceMapping = new HashMap<>();<NEW_LINE>}<NEW_LINE>if (configs == null || configs.size() == 0) {<NEW_LINE>configs = new ArrayList<>();<NEW_LINE>configs.add<MASK><NEW_LINE>configs.add(ModulesCompilerUtil.createProdOutputConfig(bundleType));<NEW_LINE>configs.add(ModulesCompilerUtil.createProdCompatOutputConfig(bundleType));<NEW_LINE>configs.add(ModulesCompilerUtil.createCompatOutputConfig(bundleType));<NEW_LINE>if (bundleType == BundleType.internal) {<NEW_LINE>configs.add(ModulesCompilerUtil.createProdDebugOutputConfig(bundleType));<NEW_LINE>configs.add(ModulesCompilerUtil.createProdDebugCompatOutputConfig(bundleType));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// The compiler is created lazily to avoid the core modularity enforcer<NEW_LINE>compiler = getCompiler();<NEW_LINE>long startNanos = System.nanoTime();<NEW_LINE>ModulesCompilerData data = compiler.compile(entry, sources, bundleType, namespaceMapping, configs);<NEW_LINE>long elapsedMillis = (System.nanoTime() - startNanos) / 1000000;<NEW_LINE>// Keep the log bc it is consumed in Splunk.<NEW_LINE>String logLine = getCompilationLogLine(entry, sources, bundleType, configs, elapsedMillis, nodeServiceFactory);<NEW_LINE>loggingService.info(logLine);<NEW_LINE>return data;<NEW_LINE>} | (ModulesCompilerUtil.createDevOutputConfig(bundleType)); |
34,011 | final DescribeEntityResult executeDescribeEntity(DescribeEntityRequest describeEntityRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeEntityRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeEntityRequest> request = null;<NEW_LINE>Response<DescribeEntityResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeEntityRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeEntityRequest));<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, "Marketplace Catalog");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeEntity");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeEntityResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeEntityResultJsonUnmarshaller());<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.ADVANCED_CONFIG, advancedConfig); |
65,119 | public void onTabSelect(Session aTab) {<NEW_LINE>if (mFocusedWindow.getSession() != aTab) {<NEW_LINE>GleanMetricsService.Tabs.activatedEvent();<NEW_LINE>}<NEW_LINE>WindowWidget targetWindow = mFocusedWindow;<NEW_LINE>WindowWidget windowToMove = getWindowWithSession(aTab);<NEW_LINE>if (windowToMove != null && windowToMove != targetWindow) {<NEW_LINE>// Move session between windows<NEW_LINE><MASK><NEW_LINE>Session moveTo = targetWindow.getSession();<NEW_LINE>moveFrom.surfaceDestroyed();<NEW_LINE>moveTo.surfaceDestroyed();<NEW_LINE>windowToMove.setSession(moveTo, WindowWidget.SESSION_DO_NOT_RELEASE_DISPLAY, WindowWidget.LEAVE_CURRENT_SESSION_ACTIVE);<NEW_LINE>targetWindow.setSession(moveFrom, WindowWidget.SESSION_DO_NOT_RELEASE_DISPLAY, WindowWidget.LEAVE_CURRENT_SESSION_ACTIVE);<NEW_LINE>windowToMove.setActiveWindow(false);<NEW_LINE>targetWindow.setActiveWindow(true);<NEW_LINE>} else {<NEW_LINE>setFirstPaint(targetWindow, aTab);<NEW_LINE>// The Web Extensions require an active target session so we need to make sure we always keep the<NEW_LINE>// Web Extension target session active when switching tabs.<NEW_LINE>Session currentWindowSession = targetWindow.getSession();<NEW_LINE>Session popUpSession = ComponentsAdapter.get().getStore().getState().getExtensions().values().stream().filter(extensionState -> extensionState.getPopupSession() != null).map(extensionState -> ((GeckoEngineSession) extensionState.getPopupSession()).getSession()).findFirst().orElse(null);<NEW_LINE>Session parentPopupSession = null;<NEW_LINE>if (popUpSession != null) {<NEW_LINE>parentPopupSession = SessionStore.get().getSession(popUpSession.getSessionState().mParentId);<NEW_LINE>}<NEW_LINE>targetWindow.setSession(aTab, (popUpSession == null && aTab.isWebExtensionSession()) || parentPopupSession == currentWindowSession ? WindowWidget.LEAVE_CURRENT_SESSION_ACTIVE : WindowWidget.DEACTIVATE_CURRENT_SESSION);<NEW_LINE>}<NEW_LINE>} | Session moveFrom = windowToMove.getSession(); |
84,171 | public void encodeHeaders(DynamicBytes bytes) {<NEW_LINE>final int total = size * 2;<NEW_LINE>for (int i = 0; i < total; i += 2) {<NEW_LINE>String k = (String) arrays[i];<NEW_LINE>Object <MASK><NEW_LINE>// omit invalid headers and prevent possible exceptions (e.g., NullPointerException)<NEW_LINE>if (k == null || v == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// ring spec says it could be a seq<NEW_LINE>if (v instanceof Seqable) {<NEW_LINE>ISeq seq = ((Seqable) v).seq();<NEW_LINE>while (seq != null) {<NEW_LINE>bytes.append(k);<NEW_LINE>bytes.append(COLON, SP);<NEW_LINE>bytes.append(seq.first().toString(), HttpUtils.UTF_8);<NEW_LINE>bytes.append(CR, LF);<NEW_LINE>seq = seq.next();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>bytes.append(k);<NEW_LINE>bytes.append(COLON, SP);<NEW_LINE>// supposed to be ISO-8859-1, but utf-8 is compatible.<NEW_LINE>// filename in Content-Disposition can be utf8<NEW_LINE>bytes.append(v.toString(), HttpUtils.UTF_8);<NEW_LINE>bytes.append(CR, LF);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>bytes.append(CR, LF);<NEW_LINE>} | v = arrays[i + 1]; |
1,104,620 | private void convert(Path srcFilePath, Path destFilePath) throws Exception {<NEW_LINE>FileContentType fileContentType1 = fileContentType != null ? fileContentType : FileContentType.valueOf(srcFilePath);<NEW_LINE><MASK><NEW_LINE>File destFile = destFilePath.toFile();<NEW_LINE>Attributes fileMetadata = createMetadata(fileContentType1, srcFile);<NEW_LINE>long fileLength = srcFile.length();<NEW_LINE>if (fileLength > MAX_FILE_SIZE)<NEW_LINE>throw new IllegalArgumentException(MessageFormat.format(rb.getString("file-too-large"), srcFile));<NEW_LINE>try (DicomOutputStream dos = new DicomOutputStream(destFile)) {<NEW_LINE>dos.writeDataset(fileMetadata.createFileMetaInformation(UID.ExplicitVRLittleEndian), fileMetadata);<NEW_LINE>dos.writeAttribute(Tag.EncapsulatedDocument, VR.OB, Files.readAllBytes(srcFile.toPath()));<NEW_LINE>}<NEW_LINE>System.out.println(MessageFormat.format(rb.getString("converted"), srcFile, destFile));<NEW_LINE>} | File srcFile = srcFilePath.toFile(); |
65,840 | public Request<GetOrganizationsAccessReportRequest> marshall(GetOrganizationsAccessReportRequest getOrganizationsAccessReportRequest) {<NEW_LINE>if (getOrganizationsAccessReportRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<GetOrganizationsAccessReportRequest> request = new DefaultRequest<GetOrganizationsAccessReportRequest>(getOrganizationsAccessReportRequest, "AmazonIdentityManagement");<NEW_LINE>request.addParameter("Action", "GetOrganizationsAccessReport");<NEW_LINE>request.addParameter("Version", "2010-05-08");<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>if (getOrganizationsAccessReportRequest.getJobId() != null) {<NEW_LINE>request.addParameter("JobId", StringUtils.fromString<MASK><NEW_LINE>}<NEW_LINE>if (getOrganizationsAccessReportRequest.getMaxItems() != null) {<NEW_LINE>request.addParameter("MaxItems", StringUtils.fromInteger(getOrganizationsAccessReportRequest.getMaxItems()));<NEW_LINE>}<NEW_LINE>if (getOrganizationsAccessReportRequest.getMarker() != null) {<NEW_LINE>request.addParameter("Marker", StringUtils.fromString(getOrganizationsAccessReportRequest.getMarker()));<NEW_LINE>}<NEW_LINE>if (getOrganizationsAccessReportRequest.getSortKey() != null) {<NEW_LINE>request.addParameter("SortKey", StringUtils.fromString(getOrganizationsAccessReportRequest.getSortKey()));<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>} | (getOrganizationsAccessReportRequest.getJobId())); |
1,057,128 | protected Mono<Predicate> createReactiveJoinFilter(QueryMetadata metadata) {<NEW_LINE>MultiValueMap<Expression<?>, Mono<Predicate>> predicates = new LinkedMultiValueMap<>();<NEW_LINE>List<JoinExpression> joins = metadata.getJoins();<NEW_LINE>for (int i = joins.size() - 1; i >= 0; i--) {<NEW_LINE>JoinExpression join = joins.get(i);<NEW_LINE>Path<?> source = (Path) ((Operation<?>) join.getTarget<MASK><NEW_LINE>Path<?> target = (Path) ((Operation<?>) join.getTarget()).getArg(1);<NEW_LINE>Collection<Mono<Predicate>> extraFilters = predicates.get(target.getRoot());<NEW_LINE>Mono<Predicate> filter = allOf(extraFilters).map(it -> ExpressionUtils.allOf(join.getCondition(), it)).switchIfEmpty(Mono.justOrEmpty(join.getCondition()));<NEW_LINE>//<NEW_LINE>Mono<Predicate> //<NEW_LINE>predicate = //<NEW_LINE>getIds(target.getType(), filter).collectList().handle((it, sink) -> {<NEW_LINE>if (it.isEmpty()) {<NEW_LINE>sink.error(new NoMatchException(source));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Path<?> path = ExpressionUtils.path(String.class, source, "$id");<NEW_LINE>sink.next(ExpressionUtils.in((Path<Object>) path, it));<NEW_LINE>});<NEW_LINE>predicates.add(source.getRoot(), predicate);<NEW_LINE>}<NEW_LINE>Path<?> source = (Path) ((Operation) joins.get(0).getTarget()).getArg(0);<NEW_LINE>return allOf(predicates.get(source.getRoot())).onErrorResume(NoMatchException.class, e -> Mono.just(ExpressionUtils.predicate(MongodbOps.NO_MATCH, e.source)));<NEW_LINE>} | ()).getArg(0); |
1,648,759 | private void logInternal(SocketAddress local, SocketAddress remote, String prefix, byte[] data) {<NEW_LINE>if (getPacketLoggingService() == null || !(local instanceof InetSocketAddress && remote instanceof InetSocketAddress)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>InetSocketAddress localAddress = (InetSocketAddress) local;<NEW_LINE>InetSocketAddress remoteAddress = (InetSocketAddress) remote;<NEW_LINE>PacketLoggingService.TransportName transportName = PacketLoggingService.TransportName.UDP;<NEW_LINE>if (prefix.contains("TCP"))<NEW_LINE>transportName = PacketLoggingService.TransportName.TCP;<NEW_LINE>boolean isSender = true;<NEW_LINE>if (prefix.contains("read"))<NEW_LINE>isSender = false;<NEW_LINE>byte[] srcAddr;<NEW_LINE>int srcPort;<NEW_LINE>byte[] dstAddr;<NEW_LINE>int dstPort;<NEW_LINE>if (isSender) {<NEW_LINE>srcAddr = localAddress.getAddress().getAddress();<NEW_LINE>srcPort = localAddress.getPort();<NEW_LINE>dstAddr = remoteAddress.getAddress().getAddress();<NEW_LINE>dstPort = remoteAddress.getPort();<NEW_LINE>} else {<NEW_LINE>dstAddr = localAddress.getAddress().getAddress();<NEW_LINE>dstPort = localAddress.getPort();<NEW_LINE>srcAddr = remoteAddress.getAddress().getAddress();<NEW_LINE>srcPort = remoteAddress.getPort();<NEW_LINE>}<NEW_LINE>getPacketLoggingService().logPacket(PacketLoggingService.ProtocolName.DNS, srcAddr, srcPort, dstAddr, dstPort, transportName, isSender, <MASK><NEW_LINE>} | data, 0, data.length); |
1,265,068 | public void run(RegressionEnvironment env) {<NEW_LINE>String epl = "@name('s0') select longPrimitive as c0, sum(intPrimitive) as c1 " + "from SupportBean group by rollup(case when longPrimitive > 0 then 1 else 0 end)";<NEW_LINE>env.compileDeploy(epl).addListener("s0");<NEW_LINE>env.assertStatement("s0", statement -> assertEquals(Long.class, statement.getEventType().getPropertyType("c0")));<NEW_LINE>String[] fields = "c0,c1".split(",");<NEW_LINE>env.sendEventBean(makeEvent("E1", 1, 10));<NEW_LINE>env.assertPropsPerRowLastNew("s0", fields, new Object[][] { { 10L, 1 }, { null, 1 } });<NEW_LINE>env.sendEventBean(makeEvent("E2", 2, 11));<NEW_LINE>env.assertPropsPerRowLastNew("s0", fields, new Object[][] { { 11L, 3 }, { null, 3 } });<NEW_LINE>env.sendEventBean(makeEvent("E3", 5, -10));<NEW_LINE>env.assertPropsPerRowLastNew("s0", fields, new Object[][] { { -10L, 5 }, { null, 8 } });<NEW_LINE>env.sendEventBean(makeEvent(<MASK><NEW_LINE>env.assertPropsPerRowLastNew("s0", fields, new Object[][] { { -11L, 11 }, { null, 14 } });<NEW_LINE>env.sendEventBean(makeEvent("E5", 3, 12));<NEW_LINE>env.assertPropsPerRowLastNew("s0", fields, new Object[][] { { 12L, 6 }, { null, 17 } });<NEW_LINE>env.undeployAll();<NEW_LINE>} | "E4", 6, -11)); |
1,536,700 | protected void executeParse(BpmnParse bpmnParse, EndEvent endEvent) {<NEW_LINE>ActivityImpl endEventActivity = createActivityOnCurrentScope(bpmnParse, endEvent, BpmnXMLConstants.ELEMENT_EVENT_END);<NEW_LINE>EventDefinition eventDefinition = null;<NEW_LINE>if (!endEvent.getEventDefinitions().isEmpty()) {<NEW_LINE>eventDefinition = endEvent.getEventDefinitions().get(0);<NEW_LINE>}<NEW_LINE>// Error end event<NEW_LINE>if (eventDefinition instanceof org.flowable.bpmn.model.ErrorEventDefinition) {<NEW_LINE>org.flowable.bpmn.model.ErrorEventDefinition errorDefinition = (org.flowable.bpmn.model.ErrorEventDefinition) eventDefinition;<NEW_LINE>if (bpmnParse.getBpmnModel().containsErrorRef(errorDefinition.getErrorCode())) {<NEW_LINE>String errorCode = bpmnParse.getBpmnModel().getErrors().<MASK><NEW_LINE>if (StringUtils.isEmpty(errorCode)) {<NEW_LINE>LOGGER.warn("errorCode is required for an error event {}", endEvent.getId());<NEW_LINE>}<NEW_LINE>endEventActivity.setProperty("type", "errorEndEvent");<NEW_LINE>errorDefinition.setErrorCode(errorCode);<NEW_LINE>}<NEW_LINE>endEventActivity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createErrorEndEventActivityBehavior(endEvent, errorDefinition));<NEW_LINE>// Cancel end event<NEW_LINE>} else if (eventDefinition instanceof CancelEventDefinition) {<NEW_LINE>ScopeImpl scope = bpmnParse.getCurrentScope();<NEW_LINE>if (scope.getProperty("type") == null || !scope.getProperty("type").equals("transaction")) {<NEW_LINE>LOGGER.warn("end event with cancelEventDefinition only supported inside transaction subprocess (id={})", endEvent.getId());<NEW_LINE>} else {<NEW_LINE>endEventActivity.setProperty("type", "cancelEndEvent");<NEW_LINE>endEventActivity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createCancelEndEventActivityBehavior(endEvent));<NEW_LINE>}<NEW_LINE>// Terminate end event<NEW_LINE>} else if (eventDefinition instanceof TerminateEventDefinition) {<NEW_LINE>endEventActivity.setAsync(endEvent.isAsynchronous());<NEW_LINE>endEventActivity.setExclusive(!endEvent.isNotExclusive());<NEW_LINE>endEventActivity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createTerminateEndEventActivityBehavior(endEvent));<NEW_LINE>// None end event<NEW_LINE>} else if (eventDefinition == null) {<NEW_LINE>endEventActivity.setAsync(endEvent.isAsynchronous());<NEW_LINE>endEventActivity.setExclusive(!endEvent.isNotExclusive());<NEW_LINE>endEventActivity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createNoneEndEventActivityBehavior(endEvent));<NEW_LINE>}<NEW_LINE>} | get(errorDefinition.getErrorCode()); |
144,184 | private void generateSubcolumnsData() {<NEW_LINE>int numSubcolumns = 4;<NEW_LINE>int numColumns = 4;<NEW_LINE>// Column can have many subcolumns, here I use 4 subcolumn in each of 8 columns.<NEW_LINE>List<Column> columns = new ArrayList<Column>();<NEW_LINE>List<SubcolumnValue> values;<NEW_LINE>for (int i = 0; i < numColumns; ++i) {<NEW_LINE>values = new ArrayList<SubcolumnValue>();<NEW_LINE>for (int j = 0; j < numSubcolumns; ++j) {<NEW_LINE>values.add(new SubcolumnValue((float) Math.random() * 50f + 5, ChartUtils.pickColor()));<NEW_LINE>}<NEW_LINE>Column column = new Column(values);<NEW_LINE>column.setHasLabels(hasLabels);<NEW_LINE>column.setHasLabelsOnlyForSelected(hasLabelForSelected);<NEW_LINE>columns.add(column);<NEW_LINE>}<NEW_LINE>data = new ColumnChartData(columns);<NEW_LINE>if (hasAxes) {<NEW_LINE>Axis axisX = new Axis();<NEW_LINE>Axis axisY = new <MASK><NEW_LINE>if (hasAxesNames) {<NEW_LINE>axisX.setName("Axis X");<NEW_LINE>axisY.setName("Axis Y");<NEW_LINE>}<NEW_LINE>data.setAxisXBottom(axisX);<NEW_LINE>data.setAxisYLeft(axisY);<NEW_LINE>} else {<NEW_LINE>data.setAxisXBottom(null);<NEW_LINE>data.setAxisYLeft(null);<NEW_LINE>}<NEW_LINE>chart.setColumnChartData(data);<NEW_LINE>} | Axis().setHasLines(true); |
705,669 | private StringConverter createDecimalConverter(DecimalType decimalType) {<NEW_LINE>final int precision = decimalType.getPrecision();<NEW_LINE>final int scale = decimalType.getScale();<NEW_LINE>return new StringConverter() {<NEW_LINE><NEW_LINE>private static final long serialVersionUID = 1L;<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String convert(Object dbzObj, Schema schema) throws Exception {<NEW_LINE>BigDecimal bigDecimal;<NEW_LINE>if (dbzObj instanceof byte[]) {<NEW_LINE>// decimal.handling.mode=precise<NEW_LINE>bigDecimal = Decimal.toLogical(schema, (byte[]) dbzObj);<NEW_LINE>} else if (dbzObj instanceof String) {<NEW_LINE>// decimal.handling.mode=string<NEW_LINE>bigDecimal = new BigDecimal((String) dbzObj);<NEW_LINE>} else if (dbzObj instanceof Double) {<NEW_LINE>// decimal.handling.mode=double<NEW_LINE>bigDecimal = BigDecimal.valueOf((Double) dbzObj);<NEW_LINE>} else {<NEW_LINE>if (VariableScaleDecimal.LOGICAL_NAME.equals(schema.name())) {<NEW_LINE>SpecialValueDecimal decimal = VariableScaleDecimal.toLogical((Struct) dbzObj);<NEW_LINE>bigDecimal = decimal.getDecimalValue().orElse(BigDecimal.ZERO);<NEW_LINE>} else {<NEW_LINE>// fallback to string<NEW_LINE>bigDecimal = new <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return DecimalData.fromBigDecimal(bigDecimal, precision, scale).toBigDecimal().toString();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>} | BigDecimal(dbzObj.toString()); |
566,152 | public boolean eIsSet(int featureID) {<NEW_LINE>switch(featureID) {<NEW_LINE>case ModelPackage.MBRICKLET_INDUSTRIAL_DIGITAL_OUT4__LOGGER:<NEW_LINE>return LOGGER_EDEFAULT == null ? logger != null : !LOGGER_EDEFAULT.equals(logger);<NEW_LINE>case ModelPackage.MBRICKLET_INDUSTRIAL_DIGITAL_OUT4__UID:<NEW_LINE>return UID_EDEFAULT == null ? uid != null : !UID_EDEFAULT.equals(uid);<NEW_LINE>case ModelPackage.MBRICKLET_INDUSTRIAL_DIGITAL_OUT4__POLL:<NEW_LINE>return poll != POLL_EDEFAULT;<NEW_LINE>case ModelPackage.MBRICKLET_INDUSTRIAL_DIGITAL_OUT4__ENABLED_A:<NEW_LINE>return ENABLED_A_EDEFAULT == null ? enabledA != null : !ENABLED_A_EDEFAULT.equals(enabledA);<NEW_LINE>case ModelPackage.MBRICKLET_INDUSTRIAL_DIGITAL_OUT4__TINKERFORGE_DEVICE:<NEW_LINE>return tinkerforgeDevice != null;<NEW_LINE>case ModelPackage.MBRICKLET_INDUSTRIAL_DIGITAL_OUT4__IP_CONNECTION:<NEW_LINE>return IP_CONNECTION_EDEFAULT == null ? ipConnection != null : !IP_CONNECTION_EDEFAULT.equals(ipConnection);<NEW_LINE>case ModelPackage.MBRICKLET_INDUSTRIAL_DIGITAL_OUT4__CONNECTED_UID:<NEW_LINE>return CONNECTED_UID_EDEFAULT == null ? connectedUid != null : !CONNECTED_UID_EDEFAULT.equals(connectedUid);<NEW_LINE>case ModelPackage.MBRICKLET_INDUSTRIAL_DIGITAL_OUT4__POSITION:<NEW_LINE>return position != POSITION_EDEFAULT;<NEW_LINE>case ModelPackage.MBRICKLET_INDUSTRIAL_DIGITAL_OUT4__DEVICE_IDENTIFIER:<NEW_LINE>return deviceIdentifier != DEVICE_IDENTIFIER_EDEFAULT;<NEW_LINE>case ModelPackage.MBRICKLET_INDUSTRIAL_DIGITAL_OUT4__NAME:<NEW_LINE>return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);<NEW_LINE>case ModelPackage.MBRICKLET_INDUSTRIAL_DIGITAL_OUT4__BRICKD:<NEW_LINE>return basicGetBrickd() != null;<NEW_LINE>case ModelPackage.MBRICKLET_INDUSTRIAL_DIGITAL_OUT4__MSUBDEVICES:<NEW_LINE>return msubdevices != null && !msubdevices.isEmpty();<NEW_LINE>case ModelPackage.MBRICKLET_INDUSTRIAL_DIGITAL_OUT4__DEVICE_TYPE:<NEW_LINE>return DEVICE_TYPE_EDEFAULT == null ? deviceType != null <MASK><NEW_LINE>}<NEW_LINE>return super.eIsSet(featureID);<NEW_LINE>} | : !DEVICE_TYPE_EDEFAULT.equals(deviceType); |
1,493,021 | public void swapUnresolved(UnresolvedReferenceBinding unresolvedType, ReferenceBinding resolvedType, LookupEnvironment env) {<NEW_LINE>boolean update = false;<NEW_LINE>if (this.type == unresolvedType) {<NEW_LINE>// $IDENTITY-COMPARISON$<NEW_LINE>// cannot be raw since being parameterized below<NEW_LINE>this.type = resolvedType;<NEW_LINE>update = true;<NEW_LINE><MASK><NEW_LINE>if (enclosing != null) {<NEW_LINE>// needed when binding unresolved member type<NEW_LINE>this.enclosingType = resolvedType.isStatic() ? enclosing : (ReferenceBinding) env.convertUnresolvedBinaryToRawType(enclosing);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (this.arguments != null) {<NEW_LINE>for (int i = 0, l = this.arguments.length; i < l; i++) {<NEW_LINE>if (this.arguments[i] == unresolvedType) {<NEW_LINE>// $IDENTITY-COMPARISON$<NEW_LINE>this.arguments[i] = env.convertUnresolvedBinaryToRawType(resolvedType);<NEW_LINE>update = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (update)<NEW_LINE>initialize(this.type, this.arguments);<NEW_LINE>} | ReferenceBinding enclosing = resolvedType.enclosingType(); |
470,342 | public static Element svgCircleSegment(SVGPlot svgp, double centerx, double centery, double angleStart, double angleDelta, double innerRadius, double outerRadius) {<NEW_LINE>// To return cosine<NEW_LINE>final DoubleWrapper tmp = new DoubleWrapper();<NEW_LINE>double sin1st = FastMath.sinAndCos(angleStart, tmp);<NEW_LINE>double cos1st = tmp.value;<NEW_LINE>double sin2nd = FastMath.sinAndCos(angleStart + angleDelta, tmp);<NEW_LINE>// Note: tmp is modified!<NEW_LINE>double cos2nd = tmp.value;<NEW_LINE>double inner1stx = centerx + (innerRadius * sin1st);<NEW_LINE>double inner1sty = centery - (innerRadius * cos1st);<NEW_LINE>double outer1stx = centerx + (outerRadius * sin1st);<NEW_LINE>double outer1sty = centery - (outerRadius * cos1st);<NEW_LINE>double inner2ndx = centerx + (innerRadius * sin2nd);<NEW_LINE>double inner2ndy <MASK><NEW_LINE>double outer2ndx = centerx + (outerRadius * sin2nd);<NEW_LINE>double outer2ndy = centery - (outerRadius * cos2nd);<NEW_LINE>double largeArc = angleDelta >= Math.PI ? 1 : 0;<NEW_LINE>//<NEW_LINE>SVGPath //<NEW_LINE>path = //<NEW_LINE>new SVGPath(inner1stx, inner1sty).lineTo(outer1stx, outer1sty).//<NEW_LINE>ellipticalArc(//<NEW_LINE>outerRadius, //<NEW_LINE>outerRadius, //<NEW_LINE>0, //<NEW_LINE>largeArc, //<NEW_LINE>1, //<NEW_LINE>outer2ndx, outer2ndy).lineTo(inner2ndx, inner2ndy);<NEW_LINE>if (innerRadius > 0) {<NEW_LINE>path.ellipticalArc(innerRadius, innerRadius, 0, largeArc, 0, inner1stx, inner1sty);<NEW_LINE>}<NEW_LINE>return path.makeElement(svgp);<NEW_LINE>} | = centery - (innerRadius * cos2nd); |
1,336,908 | public static RecognizeQrCodeResponse unmarshall(RecognizeQrCodeResponse recognizeQrCodeResponse, UnmarshallerContext _ctx) {<NEW_LINE>recognizeQrCodeResponse.setRequestId(_ctx.stringValue("RecognizeQrCodeResponse.RequestId"));<NEW_LINE>Data data = new Data();<NEW_LINE>List<Element> elements = new ArrayList<Element>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("RecognizeQrCodeResponse.Data.Elements.Length"); i++) {<NEW_LINE>Element element = new Element();<NEW_LINE>element.setImageURL(_ctx.stringValue("RecognizeQrCodeResponse.Data.Elements[" + i + "].ImageURL"));<NEW_LINE>element.setTaskId(_ctx.stringValue("RecognizeQrCodeResponse.Data.Elements[" + i + "].TaskId"));<NEW_LINE>List<Result> results = new ArrayList<Result>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("RecognizeQrCodeResponse.Data.Elements[" + i + "].Results.Length"); j++) {<NEW_LINE>Result result = new Result();<NEW_LINE>result.setSuggestion(_ctx.stringValue("RecognizeQrCodeResponse.Data.Elements[" + i + "].Results[" + j + "].Suggestion"));<NEW_LINE>result.setLabel(_ctx.stringValue("RecognizeQrCodeResponse.Data.Elements[" + i + "].Results[" + j + "].Label"));<NEW_LINE>result.setRate(_ctx.floatValue("RecognizeQrCodeResponse.Data.Elements[" + i <MASK><NEW_LINE>List<String> qrCodesData = new ArrayList<String>();<NEW_LINE>for (int k = 0; k < _ctx.lengthValue("RecognizeQrCodeResponse.Data.Elements[" + i + "].Results[" + j + "].QrCodesData.Length"); k++) {<NEW_LINE>qrCodesData.add(_ctx.stringValue("RecognizeQrCodeResponse.Data.Elements[" + i + "].Results[" + j + "].QrCodesData[" + k + "]"));<NEW_LINE>}<NEW_LINE>result.setQrCodesData(qrCodesData);<NEW_LINE>results.add(result);<NEW_LINE>}<NEW_LINE>element.setResults(results);<NEW_LINE>elements.add(element);<NEW_LINE>}<NEW_LINE>data.setElements(elements);<NEW_LINE>recognizeQrCodeResponse.setData(data);<NEW_LINE>return recognizeQrCodeResponse;<NEW_LINE>} | + "].Results[" + j + "].Rate")); |
1,625,825 | public void modifyState(@FeatureFlags int key, boolean enabled) {<NEW_LINE>switch(key) {<NEW_LINE>case FEAT_INSTALLER:<NEW_LINE>modifyState(key, PackageInstallerActivity.class, enabled);<NEW_LINE>break;<NEW_LINE>case FEAT_INTERCEPTOR:<NEW_LINE>modifyState(key, ActivityInterceptor.class, enabled);<NEW_LINE>break;<NEW_LINE>case FEAT_MANIFEST:<NEW_LINE>modifyState(key, ManifestViewerActivity.class, enabled);<NEW_LINE>break;<NEW_LINE>case FEAT_SCANNER:<NEW_LINE>modifyState(<MASK><NEW_LINE>break;<NEW_LINE>case FEAT_USAGE_ACCESS:<NEW_LINE>case FEAT_INTERNET:<NEW_LINE>// Only depends on flag<NEW_LINE>break;<NEW_LINE>case FEAT_LOG_VIEWER:<NEW_LINE>modifyState(key, LogViewerActivity.class, enabled);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>// Modify flags<NEW_LINE>flags = enabled ? (flags | key) : (flags & ~key);<NEW_LINE>// Save to pref<NEW_LINE>AppPref.set(AppPref.PrefKey.PREF_ENABLED_FEATURES_INT, flags);<NEW_LINE>} | key, ScannerActivity.class, enabled); |
1,572,974 | public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception {<NEW_LINE>if (args.length > 0 && args[0].contains("lock") && user.isAuthorized("essentials.jump.lock")) {<NEW_LINE>if (user.isFlyClickJump()) {<NEW_LINE>user.setRightClickJump(false);<NEW_LINE>user.sendMessage(tl("jumpEasterDisable"));<NEW_LINE>} else {<NEW_LINE>user.setRightClickJump(true);<NEW_LINE>user.sendMessage(tl("jumpEasterEnable"));<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final Location loc;<NEW_LINE>final Location cloc = user.getLocation();<NEW_LINE>try {<NEW_LINE>loc = LocationUtil.getTarget(user.getBase());<NEW_LINE>loc.<MASK><NEW_LINE>loc.setPitch(cloc.getPitch());<NEW_LINE>loc.setY(loc.getY() + 1);<NEW_LINE>} catch (final NullPointerException ex) {<NEW_LINE>throw new Exception(tl("jumpError"), ex);<NEW_LINE>}<NEW_LINE>final Trade charge = new Trade(this.getName(), ess);<NEW_LINE>charge.isAffordableFor(user);<NEW_LINE>user.getAsyncTeleport().teleport(loc, charge, TeleportCause.COMMAND, getNewExceptionFuture(user.getSource(), commandLabel));<NEW_LINE>throw new NoChargeException();<NEW_LINE>} | setYaw(cloc.getYaw()); |
768,680 | private ClassLoader buildClassLoader(List<String> classPathEntries, boolean incremental) {<NEW_LINE>System.out.println("Classpath: " + classPathEntries);<NEW_LINE>Function<String, URL> mapper = entry -> {<NEW_LINE>try {<NEW_LINE>return new File(entry).toURI().toURL();<NEW_LINE>} catch (MalformedURLException e) {<NEW_LINE>throw new RuntimeException(entry);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>List<String> jarEntries = classPathEntries.stream().filter(entry -> entry.endsWith(".jar")).<MASK><NEW_LINE>ClassLoader jarClassLoader = null;<NEW_LINE>if (incremental) {<NEW_LINE>if (jarEntries.equals(lastJarClassPath) && lastJarClassLoader != null) {<NEW_LINE>jarClassLoader = lastJarClassLoader;<NEW_LINE>System.out.println("Reusing previous class path");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>lastJarClassLoader = null;<NEW_LINE>lastJarClassPath = null;<NEW_LINE>}<NEW_LINE>if (jarClassLoader == null) {<NEW_LINE>URL[] jarUrls = jarEntries.stream().map(mapper).toArray(URL[]::new);<NEW_LINE>jarClassLoader = new URLClassLoader(jarUrls);<NEW_LINE>}<NEW_LINE>if (incremental) {<NEW_LINE>lastJarClassPath = jarEntries;<NEW_LINE>lastJarClassLoader = jarClassLoader;<NEW_LINE>}<NEW_LINE>URL[] urls = classPathEntries.stream().filter(entry -> !entry.endsWith(".jar")).map(mapper).toArray(URL[]::new);<NEW_LINE>return new URLClassLoader(urls, jarClassLoader);<NEW_LINE>} | collect(Collectors.toList()); |
1,479,134 | public void resetAppearanceStream(double dx, double dy, AffineTransform pageSpace) {<NEW_LINE>// setup clean shapes<NEW_LINE>Appearance appearance = appearances.get(currentAppearance);<NEW_LINE>AppearanceState appearanceState = appearance.getSelectedAppearanceState();<NEW_LINE>appearanceState.setMatrix(new AffineTransform());<NEW_LINE>appearanceState.setShapes(new Shapes());<NEW_LINE>// update the circle for any dx/dy moves.<NEW_LINE>AffineTransform af = new AffineTransform();<NEW_LINE>af.setToTranslation(dx * pageSpace.getScaleX(), -dy * pageSpace.getScaleY());<NEW_LINE>inkPath = af.createTransformedShape(inkPath);<NEW_LINE>entries.put(INK_LIST_KEY, convertPathToArray(inkPath));<NEW_LINE>Rectangle2D bbox = appearanceState.getBbox();<NEW_LINE>bbox.setRect(userSpaceRectangle.x, userSpaceRectangle.y, userSpaceRectangle.width, userSpaceRectangle.height);<NEW_LINE>setUserSpaceRectangle(userSpaceRectangle);<NEW_LINE>// setup the AP stream.<NEW_LINE>setModifiedDate(PDate.formatDateTime(new Date()));<NEW_LINE>// save the stroke.<NEW_LINE>if (borderStyle.getStrokeWidth() == 0) {<NEW_LINE>borderStyle.setStrokeWidth(1);<NEW_LINE>}<NEW_LINE>Stroke stroke = getBorderStyleStroke();<NEW_LINE>Shapes shapes = appearanceState.getShapes();<NEW_LINE>// setup the space for the AP content stream.<NEW_LINE>shapes.add(new GraphicsStateCmd(EXT_GSTATE_NAME));<NEW_LINE>shapes.add(new AlphaDrawCmd(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, opacity)));<NEW_LINE>shapes.add(new StrokeDrawCmd(stroke));<NEW_LINE>shapes.add(new ColorDrawCmd(color));<NEW_LINE>shapes.add(new ShapeDrawCmd(inkPath));<NEW_LINE>shapes.add(new DrawDrawCmd());<NEW_LINE>shapes.add(new AlphaDrawCmd(AlphaComposite.getInstance(<MASK><NEW_LINE>// remove appearance stream if it exists on an existing edit.<NEW_LINE>entries.remove(APPEARANCE_STREAM_KEY);<NEW_LINE>// we don't write out an appearance stream for ink annotation, we just regenerate it from properties<NEW_LINE>// mark the change.<NEW_LINE>StateManager stateManager = library.getStateManager();<NEW_LINE>stateManager.addChange(new PObject(this, this.getPObjectReference()));<NEW_LINE>} | AlphaComposite.SRC_OVER, 1.0f))); |
1,655,822 | protected OrderedTensorType lazyGetType() {<NEW_LINE>if (!allInputTypesPresent(2))<NEW_LINE>return null;<NEW_LINE>OrderedTensorType typeA = inputs.get(0).type().get();<NEW_LINE>OrderedTensorType typeB = inputs.get(1).type().get();<NEW_LINE>if (typeA.type().rank() < 1 || typeB.type().rank() < 1)<NEW_LINE>throw new IllegalArgumentException("Tensors in matmul must have rank of at least 1");<NEW_LINE>OrderedTensorType.Builder typeBuilder = new OrderedTensorType.Builder(resultValueType());<NEW_LINE>OrderedTensorType largestRankType = typeA.rank() >= typeB.rank() ? typeA : typeB;<NEW_LINE>OrderedTensorType smallestRankType = typeA.rank() >= typeB.rank() ? typeB : typeA;<NEW_LINE>for (int i = 0; i < largestRankType.rank() - 2; ++i) {<NEW_LINE>TensorType.Dimension dim = largestRankType.dimensions().get(i);<NEW_LINE>// broadcasting<NEW_LINE>int j = smallestRankType.rank() - largestRankType.rank() + i;<NEW_LINE>if (j >= 0 && smallestRankType.dimensions().get(j).size().get() > dim.size().get()) {<NEW_LINE>dim = smallestRankType.dimensions().get(j);<NEW_LINE>}<NEW_LINE>typeBuilder.add(dim);<NEW_LINE>}<NEW_LINE>if (typeA.rank() >= 2) {<NEW_LINE>typeBuilder.add(typeA.dimensions().get(typeA.rank() - 2));<NEW_LINE>}<NEW_LINE>if (typeB.rank() >= 2) {<NEW_LINE>typeBuilder.add(typeB.dimensions().get(typeB<MASK><NEW_LINE>}<NEW_LINE>return typeBuilder.build();<NEW_LINE>} | .rank() - 1)); |
948,047 | public Repo<Manager> call(long tid, Manager manager) throws Exception {<NEW_LINE>String fmtTid = FateTxId.formatTid(tid);<NEW_LINE>log.debug(" {} sourceDir {}", fmtTid, sourceDir);<NEW_LINE>Utils.getReadLock(manager, <MASK><NEW_LINE>// check that the error directory exists and is empty<NEW_LINE>VolumeManager fs = manager.getVolumeManager();<NEW_LINE>Path errorPath = new Path(errorDir);<NEW_LINE>FileStatus errorStatus = null;<NEW_LINE>try {<NEW_LINE>errorStatus = fs.getFileStatus(errorPath);<NEW_LINE>} catch (FileNotFoundException ex) {<NEW_LINE>// ignored<NEW_LINE>}<NEW_LINE>if (errorStatus == null)<NEW_LINE>throw new AcceptableThriftTableOperationException(tableId.canonical(), null, TableOperation.BULK_IMPORT, TableOperationExceptionType.BULK_BAD_ERROR_DIRECTORY, errorDir + " does not exist");<NEW_LINE>if (!errorStatus.isDirectory())<NEW_LINE>throw new AcceptableThriftTableOperationException(tableId.canonical(), null, TableOperation.BULK_IMPORT, TableOperationExceptionType.BULK_BAD_ERROR_DIRECTORY, errorDir + " is not a directory");<NEW_LINE>if (fs.listStatus(errorPath).length != 0)<NEW_LINE>throw new AcceptableThriftTableOperationException(tableId.canonical(), null, TableOperation.BULK_IMPORT, TableOperationExceptionType.BULK_BAD_ERROR_DIRECTORY, errorDir + " is not empty");<NEW_LINE>ZooArbitrator.start(manager.getContext(), Constants.BULK_ARBITRATOR_TYPE, tid);<NEW_LINE>manager.updateBulkImportStatus(sourceDir, BulkImportState.MOVING);<NEW_LINE>// move the files into the directory<NEW_LINE>try {<NEW_LINE>String bulkDir = prepareBulkImport(manager.getContext(), fs, sourceDir, tableId, tid);<NEW_LINE>log.debug(" {} bulkDir {}", tid, bulkDir);<NEW_LINE>return new LoadFiles(tableId, sourceDir, bulkDir, errorDir, setTime);<NEW_LINE>} catch (IOException ex) {<NEW_LINE>log.error("error preparing the bulk import directory", ex);<NEW_LINE>throw new AcceptableThriftTableOperationException(tableId.canonical(), null, TableOperation.BULK_IMPORT, TableOperationExceptionType.BULK_BAD_INPUT_DIRECTORY, sourceDir + ": " + ex);<NEW_LINE>}<NEW_LINE>} | tableId, tid).lock(); |
693,031 | private Object decorateResult(Object toDecorate) {<NEW_LINE>if (toDecorate instanceof WebDriver) {<NEW_LINE>return createProxy(getDecoratedDriver(), WebDriver.class);<NEW_LINE>}<NEW_LINE>if (toDecorate instanceof WebElement) {<NEW_LINE>return createProxy(createDecorated((WebElement) toDecorate), WebElement.class);<NEW_LINE>}<NEW_LINE>if (toDecorate instanceof Alert) {<NEW_LINE>return createProxy(createDecorated((Alert) toDecorate), Alert.class);<NEW_LINE>}<NEW_LINE>if (toDecorate instanceof VirtualAuthenticator) {<NEW_LINE>return createProxy(createDecorated((VirtualAuthenticator) toDecorate), VirtualAuthenticator.class);<NEW_LINE>}<NEW_LINE>if (toDecorate instanceof WebDriver.Navigation) {<NEW_LINE>return createProxy(createDecorated((WebDriver.Navigation) toDecorate), WebDriver.Navigation.class);<NEW_LINE>}<NEW_LINE>if (toDecorate instanceof WebDriver.Options) {<NEW_LINE>return createProxy(createDecorated((WebDriver.Options) toDecorate), WebDriver.Options.class);<NEW_LINE>}<NEW_LINE>if (toDecorate instanceof WebDriver.TargetLocator) {<NEW_LINE>return createProxy(createDecorated((WebDriver.TargetLocator) toDecorate), WebDriver.TargetLocator.class);<NEW_LINE>}<NEW_LINE>if (toDecorate instanceof WebDriver.Timeouts) {<NEW_LINE>return createProxy(createDecorated((WebDriver.Timeouts) toDecorate), WebDriver.Timeouts.class);<NEW_LINE>}<NEW_LINE>if (toDecorate instanceof WebDriver.Window) {<NEW_LINE>return createProxy(createDecorated((WebDriver.Window) toDecorate<MASK><NEW_LINE>}<NEW_LINE>if (toDecorate instanceof List) {<NEW_LINE>return ((List<?>) toDecorate).stream().map(this::decorateResult).collect(Collectors.toList());<NEW_LINE>}<NEW_LINE>return toDecorate;<NEW_LINE>} | ), WebDriver.Window.class); |
618,411 | MetadataTime computeRootTabletTime(ServerContext context, Collection<String> goodPaths) {<NEW_LINE>try {<NEW_LINE>context.setupCrypto();<NEW_LINE>long rtime = Long.MIN_VALUE;<NEW_LINE>for (String good : goodPaths) {<NEW_LINE>Path path = new Path(good);<NEW_LINE>FileSystem ns = context.getVolumeManager().getFileSystemByPath(path);<NEW_LINE>long maxTime = -1;<NEW_LINE>try (FileSKVIterator reader = FileOperations.getInstance().newReaderBuilder().forFile(path.toString(), ns, ns.getConf(), context.getCryptoService()).withTableConfiguration(context.getTableConfiguration(RootTable.ID)).seekToBeginning().build()) {<NEW_LINE>while (reader.hasTop()) {<NEW_LINE>maxTime = Math.max(maxTime, reader.getTopKey().getTimestamp());<NEW_LINE>reader.next();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (maxTime > rtime) {<NEW_LINE>rtime = maxTime;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (rtime < 0) {<NEW_LINE>throw new IllegalStateException("Unexpected root tablet logical time " + rtime);<NEW_LINE>}<NEW_LINE>return new <MASK><NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new UncheckedIOException(e);<NEW_LINE>}<NEW_LINE>} | MetadataTime(rtime, TimeType.LOGICAL); |
1,275,095 | public FeedOperation read() throws Exception {<NEW_LINE>int read = readExact(in, prefix);<NEW_LINE>if (read != prefix.length) {<NEW_LINE>return FeedOperation.INVALID;<NEW_LINE>}<NEW_LINE>ByteBuffer header = ByteBuffer.wrap(prefix);<NEW_LINE>int sz = header.getInt();<NEW_LINE>int type = header.getInt();<NEW_LINE>long hash = header.getLong();<NEW_LINE>byte[] blob = new byte[sz];<NEW_LINE>read = readExact(in, blob);<NEW_LINE>if (read != blob.length) {<NEW_LINE>throw new IllegalArgumentException("Underflow, failed reading " + blob.length + "bytes. Got " + read);<NEW_LINE>}<NEW_LINE>long computedHash = VespaV1Destination.hash(blob, blob.length);<NEW_LINE>if (computedHash != hash) {<NEW_LINE>throw new IllegalArgumentException("Hash mismatch, expected " + hash + ", got " + computedHash);<NEW_LINE>}<NEW_LINE>GrowableByteBuffer buf = GrowableByteBuffer.wrap(blob);<NEW_LINE>String condition = buf.getUtf8String();<NEW_LINE>DocumentDeserializer deser = DocumentDeserializerFactory.createHead(mgr, buf);<NEW_LINE>TestAndSetCondition testAndSetCondition = condition.isEmpty() ? TestAndSetCondition.NOT_PRESENT_CONDITION : new TestAndSetCondition(condition);<NEW_LINE>if (type == DOCUMENT) {<NEW_LINE><MASK><NEW_LINE>} else if (type == UPDATE) {<NEW_LINE>return new LazyUpdateOperation(deser, testAndSetCondition);<NEW_LINE>} else if (type == REMOVE) {<NEW_LINE>return new RemoveFeedOperation(new DocumentId(deser), testAndSetCondition);<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("Unknown operation " + type);<NEW_LINE>}<NEW_LINE>} | return new LazyDocumentOperation(deser, testAndSetCondition); |
1,323,692 | void initSelFields() {<NEW_LINE>selMinX = Integer.MAX_VALUE;<NEW_LINE>selMaxX = 0;<NEW_LINE>selMinY = Integer.MAX_VALUE;<NEW_LINE>selMaxY = 0;<NEW_LINE>selMinWidth = Integer.MAX_VALUE;<NEW_LINE>selMinHeight = Integer.MAX_VALUE;<NEW_LINE>for (Component selComp : selection) {<NEW_LINE>int gridX = gridInfo.getGridX(selComp);<NEW_LINE>int gridY = gridInfo.getGridY(selComp);<NEW_LINE>int gridWidth = gridInfo.getGridWidth(selComp);<NEW_LINE>int gridHeight = gridInfo.getGridHeight(selComp);<NEW_LINE>selMinX = Math.min(selMinX, gridX);<NEW_LINE>selMaxX = Math.max(selMaxX, gridX + gridWidth - 1);<NEW_LINE>selMinY = <MASK><NEW_LINE>selMaxY = Math.max(selMaxY, gridY + gridHeight - 1);<NEW_LINE>selMinWidth = Math.min(selMinWidth, gridWidth);<NEW_LINE>selMinHeight = Math.min(selMinHeight, gridHeight);<NEW_LINE>}<NEW_LINE>} | Math.min(selMinY, gridY); |
906,601 | public Request<RevokeClusterSecurityGroupIngressRequest> marshall(RevokeClusterSecurityGroupIngressRequest revokeClusterSecurityGroupIngressRequest) {<NEW_LINE>if (revokeClusterSecurityGroupIngressRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<RevokeClusterSecurityGroupIngressRequest> request = new DefaultRequest<RevokeClusterSecurityGroupIngressRequest>(revokeClusterSecurityGroupIngressRequest, "AmazonRedshift");<NEW_LINE>request.addParameter("Action", "RevokeClusterSecurityGroupIngress");<NEW_LINE><MASK><NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>if (revokeClusterSecurityGroupIngressRequest.getClusterSecurityGroupName() != null) {<NEW_LINE>request.addParameter("ClusterSecurityGroupName", StringUtils.fromString(revokeClusterSecurityGroupIngressRequest.getClusterSecurityGroupName()));<NEW_LINE>}<NEW_LINE>if (revokeClusterSecurityGroupIngressRequest.getCIDRIP() != null) {<NEW_LINE>request.addParameter("CIDRIP", StringUtils.fromString(revokeClusterSecurityGroupIngressRequest.getCIDRIP()));<NEW_LINE>}<NEW_LINE>if (revokeClusterSecurityGroupIngressRequest.getEC2SecurityGroupName() != null) {<NEW_LINE>request.addParameter("EC2SecurityGroupName", StringUtils.fromString(revokeClusterSecurityGroupIngressRequest.getEC2SecurityGroupName()));<NEW_LINE>}<NEW_LINE>if (revokeClusterSecurityGroupIngressRequest.getEC2SecurityGroupOwnerId() != null) {<NEW_LINE>request.addParameter("EC2SecurityGroupOwnerId", StringUtils.fromString(revokeClusterSecurityGroupIngressRequest.getEC2SecurityGroupOwnerId()));<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>} | request.addParameter("Version", "2012-12-01"); |
428,097 | private void loadNode224() throws IOException, SAXException {<NEW_LINE>PropertyTypeNode node = new PropertyTypeNode(this.context, Identifiers.ConditionType_ConditionRefresh2_InputArguments, new QualifiedName(0, "InputArguments"), new LocalizedText("en", "InputArguments"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.Argument, 1, new UInteger[] { org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UInteger.valueOf(0) }, UByte.valueOf(1), UByte.valueOf(1), 0.0, false);<NEW_LINE>node.addReference(new Reference(Identifiers.ConditionType_ConditionRefresh2_InputArguments, Identifiers.HasTypeDefinition, Identifiers.PropertyType.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ConditionType_ConditionRefresh2_InputArguments, Identifiers.HasModellingRule, Identifiers.ModellingRule_Mandatory.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ConditionType_ConditionRefresh2_InputArguments, Identifiers.HasProperty, Identifiers.ConditionType_ConditionRefresh2.expanded(), false));<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append("<ListOfExtensionObject xmlns=\"http://opcfoundation.org/UA/2008/02/Types.xsd\"><ExtensionObject><TypeId><Identifier>i=297</Identifier> </TypeId><Body><Argument><Name>SubscriptionId</Name><DataType><Identifier>i=288</Identifier> </DataType><ValueRank>-1</ValueRank><ArrayDimensions/><Description><Locale> </Locale><Text>The identifier for the suscription to refresh.</Text> </Description> </Argument> </Body> </ExtensionObject><ExtensionObject><TypeId><Identifier>i=297</Identifier> </TypeId><Body><Argument><Name>MonitoredItemId</Name><DataType><Identifier>i=288</Identifier> </DataType><ValueRank>-1</ValueRank><ArrayDimensions/><Description><Locale> </Locale><Text>The identifier for the monitored item to refresh.</Text> </Description> </Argument> </Body> </ExtensionObject> </ListOfExtensionObject>");<NEW_LINE>String xml = sb.toString();<NEW_LINE>OpcUaXmlStreamDecoder decoder = new OpcUaXmlStreamDecoder(context.getServer().getSerializationContext()).setInput(new StringReader(xml));<NEW_LINE><MASK><NEW_LINE>DataValue value = new DataValue(new Variant(o));<NEW_LINE>node.setValue(value);<NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>} | Object o = decoder.readVariantValue(); |
1,495,039 | public ISpringBootProject project(IProject project) throws CoreException {<NEW_LINE>for (Entry<String, Supplier<Class<? extends ISpringBootProject>>> e : registry.get().entrySet()) {<NEW_LINE>if (project.hasNature(e.getKey())) {<NEW_LINE>Class<? extends ISpringBootProject> clazz = e.getValue().get();<NEW_LINE>if (clazz != null) {<NEW_LINE>try {<NEW_LINE>Constructor<? extends ISpringBootProject> constructor = clazz.getConstructor(IProject.class, InitializrService.class);<NEW_LINE>return constructor.newInstance(project, initializr);<NEW_LINE>} catch (NoSuchMethodException | SecurityException | InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e1) {<NEW_LINE>try {<NEW_LINE>Constructor<? extends ISpringBootProject> constructor = <MASK><NEW_LINE>return constructor.newInstance(project);<NEW_LINE>} catch (NoSuchMethodException | SecurityException | InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e2) {<NEW_LINE>Log.log(e2);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | clazz.getConstructor(IProject.class); |
266,254 | final ListQuickConnectsResult executeListQuickConnects(ListQuickConnectsRequest listQuickConnectsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listQuickConnectsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListQuickConnectsRequest> request = null;<NEW_LINE>Response<ListQuickConnectsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListQuickConnectsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listQuickConnectsRequest));<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, "Connect");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListQuickConnectsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListQuickConnectsResultJsonUnmarshaller());<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.OPERATION_NAME, "ListQuickConnects"); |
1,259,242 | public void run(RegressionEnvironment env) {<NEW_LINE>ConditionHandlerFactoryContext conditionHandlerFactoryContext = SupportConditionHandlerFactory.getFactoryContexts().get(0);<NEW_LINE>assertEquals(conditionHandlerFactoryContext.getRuntimeURI(), env.runtimeURI());<NEW_LINE>handler = SupportConditionHandlerFactory.getLastHandler();<NEW_LINE>String[] fields = "c0".split(",");<NEW_LINE>String epl = "@name('s0') select * from SupportBean " + "match_recognize (" + " partition by theString " + " measures P1.theString as c0" + " pattern (P1 P2) " + " define " + " P1 as P1.intPrimitive = 1," + " P2 as P2.intPrimitive = 2" + ")";<NEW_LINE>env.compileDeploy(epl).addListener("s0");<NEW_LINE>env.sendEventBean(new SupportBean("A", 1));<NEW_LINE>env.sendEventBean(new SupportBean("B", 1));<NEW_LINE>env.sendEventBean(new SupportBean("C", 1));<NEW_LINE>assertTrue(handler.<MASK><NEW_LINE>// overflow<NEW_LINE>env.sendEventBean(new SupportBean("D", 1));<NEW_LINE>RowRecogMaxStatesEngineWide3Instance.assertContextEnginePool(env, "s0", handler.getAndResetContexts(), 3, RowRecogMaxStatesEngineWide3Instance.getExpectedCountMap(env, "s0", 3));<NEW_LINE>env.sendEventBean(new SupportBean("E", 1));<NEW_LINE>RowRecogMaxStatesEngineWide3Instance.assertContextEnginePool(env, "s0", handler.getAndResetContexts(), 3, RowRecogMaxStatesEngineWide3Instance.getExpectedCountMap(env, "s0", 4));<NEW_LINE>// D gone<NEW_LINE>env.sendEventBean(new SupportBean("D", 2));<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { "D" });<NEW_LINE>// A gone<NEW_LINE>env.sendEventBean(new SupportBean("A", 2));<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { "A" });<NEW_LINE>// C gone<NEW_LINE>env.sendEventBean(new SupportBean("C", 2));<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { "C" });<NEW_LINE>env.sendEventBean(new SupportBean("F", 1));<NEW_LINE>assertTrue(handler.getContexts().isEmpty());<NEW_LINE>env.sendEventBean(new SupportBean("G", 1));<NEW_LINE>RowRecogMaxStatesEngineWide3Instance.assertContextEnginePool(env, "s0", handler.getAndResetContexts(), 3, RowRecogMaxStatesEngineWide3Instance.getExpectedCountMap(env, "s0", 3));<NEW_LINE>env.undeployAll();<NEW_LINE>} | getContexts().isEmpty()); |
338,833 | public static DescribeHeatMapResponse unmarshall(DescribeHeatMapResponse describeHeatMapResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeHeatMapResponse.setRequestId(_ctx.stringValue("DescribeHeatMapResponse.RequestId"));<NEW_LINE>describeHeatMapResponse.setErrorCode(_ctx.stringValue("DescribeHeatMapResponse.ErrorCode"));<NEW_LINE>describeHeatMapResponse.setErrorMessage(_ctx.stringValue("DescribeHeatMapResponse.ErrorMessage"));<NEW_LINE>describeHeatMapResponse.setSuccess(_ctx.booleanValue("DescribeHeatMapResponse.Success"));<NEW_LINE>List<HeatMapPoint> heatMapPoints = new ArrayList<HeatMapPoint>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeHeatMapResponse.HeatMapPoints.Length"); i++) {<NEW_LINE>HeatMapPoint heatMapPoint = new HeatMapPoint();<NEW_LINE>heatMapPoint.setY(_ctx.floatValue("DescribeHeatMapResponse.HeatMapPoints[" + i + "].Y"));<NEW_LINE>heatMapPoint.setWeight(_ctx.integerValue<MASK><NEW_LINE>heatMapPoint.setX(_ctx.floatValue("DescribeHeatMapResponse.HeatMapPoints[" + i + "].X"));<NEW_LINE>heatMapPoints.add(heatMapPoint);<NEW_LINE>}<NEW_LINE>describeHeatMapResponse.setHeatMapPoints(heatMapPoints);<NEW_LINE>return describeHeatMapResponse;<NEW_LINE>} | ("DescribeHeatMapResponse.HeatMapPoints[" + i + "].Weight")); |
1,004,149 | protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>setContentView(R.layout.activity_microphone_configure);<NEW_LINE>mPrefManager = new PreferenceManager(this.getApplicationContext());<NEW_LINE>Toolbar toolbar = findViewById(R.id.toolbar);<NEW_LINE>setSupportActionBar(toolbar);<NEW_LINE>setTitle("");<NEW_LINE>getSupportActionBar().setDisplayHomeAsUpEnabled(true);<NEW_LINE>mTextLevel = findViewById(R.id.text_display_level);<NEW_LINE>mNumberTrigger = findViewById(R.id.number_trigger_level);<NEW_LINE>mWaveform = <MASK><NEW_LINE>mWaveform.setMaxVal(100);<NEW_LINE>mNumberTrigger.setMinValue(0);<NEW_LINE>mNumberTrigger.setMaxValue(MAX_SLIDER_VALUE);<NEW_LINE>if (!mPrefManager.getMicrophoneSensitivity().equals(PreferenceManager.MEDIUM))<NEW_LINE>mNumberTrigger.setValue(Integer.parseInt(mPrefManager.getMicrophoneSensitivity()));<NEW_LINE>else<NEW_LINE>mNumberTrigger.setValue(60);<NEW_LINE>mNumberTrigger.setListener((oldValue, newValue) -> {<NEW_LINE>mWaveform.setThreshold(newValue);<NEW_LINE>mPrefManager.setMicrophoneSensitivity(newValue + "");<NEW_LINE>});<NEW_LINE>initWave();<NEW_LINE>startMic();<NEW_LINE>} | findViewById(R.id.simplewaveform); |
896,993 | public Map<Extractor.Type, Long> totalExtractorCountByType() {<NEW_LINE>final DBObject query = new BasicDBObject(InputImpl.EMBEDDED_EXTRACTORS, new BasicDBObject("$exists", true));<NEW_LINE>try (DBCursor inputs = dbCollection.find(query, new BasicDBObject(InputImpl.EMBEDDED_EXTRACTORS, 1))) {<NEW_LINE>final Map<Extractor.Type, Long> extractorsCountByType = new HashMap<>();<NEW_LINE>for (DBObject input : inputs) {<NEW_LINE>final BasicDBList extractors = (BasicDBList) <MASK><NEW_LINE>for (Object dbObject : extractors) {<NEW_LINE>final DBObject extractor = (DBObject) dbObject;<NEW_LINE>final Extractor.Type type = Extractor.Type.fuzzyValueOf(((String) extractor.get(Extractor.FIELD_TYPE)));<NEW_LINE>if (type != null) {<NEW_LINE>final Long oldValue = extractorsCountByType.get(type);<NEW_LINE>final Long newValue = (oldValue == null) ? 1 : oldValue + 1;<NEW_LINE>extractorsCountByType.put(type, newValue);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return extractorsCountByType;<NEW_LINE>}<NEW_LINE>} | input.get(InputImpl.EMBEDDED_EXTRACTORS); |
1,566,931 | public <T> FixedSizeSet<T> with(T one, T two, T three, T four) {<NEW_LINE>if (Objects.equals(one, two)) {<NEW_LINE>return this.of(one, three, four);<NEW_LINE>}<NEW_LINE>if (Objects.equals(one, three)) {<NEW_LINE>return this.of(one, two, four);<NEW_LINE>}<NEW_LINE>if (Objects.equals(one, four)) {<NEW_LINE>return this.of(one, two, three);<NEW_LINE>}<NEW_LINE>if (Objects.equals(two, three)) {<NEW_LINE>return this.of(one, two, four);<NEW_LINE>}<NEW_LINE>if (Objects.equals(two, four)) {<NEW_LINE>return this.of(one, two, three);<NEW_LINE>}<NEW_LINE>if (Objects.equals(three, four)) {<NEW_LINE>return this.of(one, two, three);<NEW_LINE>}<NEW_LINE>return new QuadrupletonSet<>(<MASK><NEW_LINE>} | one, two, three, four); |
730,026 | public ErrorCode loadActiveSession(String username, String clientID) {<NEW_LINE>LOG.debug("createNewSession for client <{}>", clientID);<NEW_LINE>Session session = sessions.get(clientID);<NEW_LINE>if (session != null && session.getDeleted() == 0) {<NEW_LINE>LOG.error("already exists a session for client <{}>, bad condition", clientID);<NEW_LINE>return ErrorCode.ERROR_CODE_SUCCESS;<NEW_LINE>}<NEW_LINE>if (session != null && session.getDeleted() > 0) {<NEW_LINE>if (clientSupportKickoff) {<NEW_LINE>return ErrorCode.ERROR_CODE_KICKED_OFF;<NEW_LINE>} else {<NEW_LINE>return ErrorCode.ERROR_CODE_SECRECT_KEY_MISMATCH;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ClientSession clientSession = new ClientSession(clientID, this);<NEW_LINE>session = databaseStore.getSession(username, clientID, clientSession);<NEW_LINE>if (session == null) {<NEW_LINE>return ErrorCode.ERROR_CODE_SECRECT_KEY_MISMATCH;<NEW_LINE>}<NEW_LINE>if (session.getDeleted() > 0) {<NEW_LINE>if (clientSupportKickoff) {<NEW_LINE>return ErrorCode.ERROR_CODE_KICKED_OFF;<NEW_LINE>} else {<NEW_LINE>return ErrorCode.ERROR_CODE_SECRECT_KEY_MISMATCH;<NEW_LINE>}<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>ConcurrentSkipListSet<String> sessionSet = getUserSessionSet(username);<NEW_LINE>sessionSet.add(clientID);<NEW_LINE>return ErrorCode.ERROR_CODE_SUCCESS;<NEW_LINE>} | sessions.put(clientID, session); |
1,134,177 | public PendingResource unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>PendingResource pendingResource = new PendingResource();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("ResourceArn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>pendingResource.setResourceArn(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 pendingResource;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
941,528 | private Mono<Response<Flux<ByteBuffer>>> deleteWithResponseAsync(String resourceGroupName, String resourceName, String agentPoolName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (agentPoolName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter agentPoolName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String apiVersion = "2022-03-01";<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, <MASK><NEW_LINE>} | resourceName, agentPoolName, accept, context); |
1,038,089 | protected void aggregateVariablesForChildExecution(DelegateExecution childExecution, DelegateExecution miRootExecution) {<NEW_LINE>if (hasVariableAggregationDefinitions(childExecution) && miRootExecution != null) {<NEW_LINE>ProcessEngineConfigurationImpl processEngineConfiguration = CommandContextUtil.getProcessEngineConfiguration();<NEW_LINE>VariableServiceConfiguration variableServiceConfiguration = processEngineConfiguration.getVariableServiceConfiguration();<NEW_LINE>VariableService variableService = variableServiceConfiguration.getVariableService();<NEW_LINE>for (VariableAggregationDefinition aggregation : aggregations.getAggregations()) {<NEW_LINE>VariableInstanceEntity aggregatedVarInstance = aggregateComplete(<MASK><NEW_LINE>if (aggregatedVarInstance != null) {<NEW_LINE>variableService.insertVariableInstance(aggregatedVarInstance);<NEW_LINE>String targetVarName = aggregatedVarInstance.getName();<NEW_LINE>Integer elementIndexValue = getLoopVariable(childExecution, getCollectionElementIndexVariable());<NEW_LINE>String counterValue = aggregatedVarInstance.getId() + COUNTER_VAR_VALUE_SEPARATOR + elementIndexValue;<NEW_LINE>VariableInstanceEntity counterVarInstance = createScopedVariableAggregationVariableInstance(COUNTER_VAR_PREFIX + targetVarName, aggregatedVarInstance.getScopeId(), aggregatedVarInstance.getSubScopeId(), counterValue, variableServiceConfiguration);<NEW_LINE>variableService.insertVariableInstance(counterVarInstance);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | childExecution, miRootExecution, aggregation, processEngineConfiguration); |
1,293,773 | protected void updateAlgGUI(I frame1, final BufferedImage buffImage1, final double fps) {<NEW_LINE>if (!noFault) {<NEW_LINE>numFaults++;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>showTracks = guiInfo.isShowAll();<NEW_LINE>showInliers = guiInfo.isShowInliers();<NEW_LINE>if (alg instanceof AccessPointTracks3D)<NEW_LINE>drawFeatures((AccessPointTracks3D) alg, buffImage1);<NEW_LINE>final Se3_F64 leftToWorld = alg.getCameraToWorld().copy();<NEW_LINE>SwingUtilities.invokeLater(() -> {<NEW_LINE>guiLeft.setImage(buffImage1);<NEW_LINE>guiLeft.autoSetPreferredSize();<NEW_LINE>guiLeft.repaint();<NEW_LINE>guiInfo.setCameraToWorld(leftToWorld);<NEW_LINE>guiInfo.setNumFaults(numFaults);<NEW_LINE>guiInfo.setNumTracks(numTracks);<NEW_LINE>guiInfo.setNumInliers(numInliers);<NEW_LINE>guiInfo.setFps(fps);<NEW_LINE>});<NEW_LINE>double r = 0.15;<NEW_LINE>Point3D_F64 p1 = new Point3D_F64(-r, -r, 0);<NEW_LINE>Point3D_F64 p2 = new Point3D_F64(r, -r, 0);<NEW_LINE>Point3D_F64 p3 = new Point3D_F64(r, r, 0);<NEW_LINE>Point3D_F64 p4 = new Point3D_F64(-r, r, 0);<NEW_LINE>SePointOps_F64.<MASK><NEW_LINE>SePointOps_F64.transform(leftToWorld, p2, p2);<NEW_LINE>SePointOps_F64.transform(leftToWorld, p3, p3);<NEW_LINE>SePointOps_F64.transform(leftToWorld, p4, p4);<NEW_LINE>guiCam3D.add(p1, p2, p3, p4);<NEW_LINE>guiCam3D.repaint();<NEW_LINE>gui2D.addPoint(leftToWorld.T.x, leftToWorld.T.z);<NEW_LINE>gui2D.repaint();<NEW_LINE>hasProcessedImage = true;<NEW_LINE>} | transform(leftToWorld, p1, p1); |
862,288 | public void run(WorkingCopy workingCopy) throws java.io.IOException {<NEW_LINE>workingCopy.toPhase(Phase.ELEMENTS_RESOLVED);<NEW_LINE>ClassTree javaClass = SourceUtils.getPublicTopLevelTree(workingCopy);<NEW_LINE>TypeElement classElement = SourceUtils.getPublicTopLevelElement(workingCopy);<NEW_LINE>List<? extends AnnotationMirror<MASK><NEW_LINE>String pathValue = javaClass.getSimpleName().toString().toLowerCase();<NEW_LINE>AnnotationMirror pathAnn = JavaSourceHelper.findAnnotation(anns, RestConstants.PATH + "(\"" + pathValue + "\")");<NEW_LINE>if (pathAnn == null) {<NEW_LINE>addPathAnnotation(workingCopy, new String[] { javaClass.getSimpleName().toString().toLowerCase() });<NEW_LINE>}<NEW_LINE>if (!returnType.equals("void") && getPrimitiveType(returnType) == null) {<NEW_LINE>addQNameImport(workingCopy);<NEW_LINE>}<NEW_LINE>ClassTree finalJavaClass = addHttpMethod(returnType, workingCopy, javaClass);<NEW_LINE>workingCopy.rewrite(javaClass, finalJavaClass);<NEW_LINE>} | > anns = classElement.getAnnotationMirrors(); |
1,368,674 | private CompletableFuture<Suggestions> provideSuggestions(final StringReader reader, final CommandContextBuilder<S> context) {<NEW_LINE>lock.lock();<NEW_LINE>try {<NEW_LINE>final StringRange <MASK><NEW_LINE>final String alias = aliasRange.get(reader).toLowerCase(Locale.ENGLISH);<NEW_LINE>final LiteralCommandNode<S> literal = (LiteralCommandNode<S>) context.getRootNode().getChild(alias);<NEW_LINE>final boolean hasArguments = reader.canRead();<NEW_LINE>if (hasArguments) {<NEW_LINE>if (literal == null) {<NEW_LINE>// Input has arguments for non-registered alias<NEW_LINE>return Suggestions.empty();<NEW_LINE>}<NEW_LINE>context.withNode(literal, aliasRange);<NEW_LINE>// separator<NEW_LINE>reader.skip();<NEW_LINE>return this.provideArgumentsSuggestions(literal, reader, context);<NEW_LINE>} else {<NEW_LINE>return this.provideAliasSuggestions(reader, context);<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>lock.unlock();<NEW_LINE>}<NEW_LINE>} | aliasRange = this.consumeAlias(reader); |
1,726,448 | private static IPConnection queryIPConnection(int pid, int fd) {<NEW_LINE>SocketFdInfo si = new SocketFdInfo();<NEW_LINE>int ret = SystemB.INSTANCE.proc_pidfdinfo(pid, fd, PROC_PIDFDSOCKETINFO, si, si.size());<NEW_LINE>if (si.size() == ret && si.psi.soi_family == AF_INET || si.psi.soi_family == AF_INET6) {<NEW_LINE>InSockInfo ini;<NEW_LINE>String type;<NEW_LINE>TcpState state;<NEW_LINE>if (si.psi.soi_kind == SOCKINFO_TCP) {<NEW_LINE>si.psi.soi_proto.setType("pri_tcp");<NEW_LINE>si.psi.soi_proto.read();<NEW_LINE>ini = si.psi.soi_proto.pri_tcp.tcpsi_ini;<NEW_LINE>state = stateLookup(si.psi.soi_proto.pri_tcp.tcpsi_state);<NEW_LINE>type = "tcp";<NEW_LINE>} else if (si.psi.soi_kind == SOCKINFO_IN) {<NEW_LINE>si.psi.soi_proto.setType("pri_in");<NEW_LINE>si.psi.soi_proto.read();<NEW_LINE>ini = si.psi.soi_proto.pri_in;<NEW_LINE>state = NONE;<NEW_LINE>type = "udp";<NEW_LINE>} else {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>byte[] laddr;<NEW_LINE>byte[] faddr;<NEW_LINE>if (ini.insi_vflag == 1) {<NEW_LINE>laddr = ParseUtil.parseIntToIP(ini.insi_laddr[3]);<NEW_LINE>faddr = ParseUtil.parseIntToIP(ini.insi_faddr[3]);<NEW_LINE>type += "4";<NEW_LINE>} else if (ini.insi_vflag == 2) {<NEW_LINE>laddr = ParseUtil.parseIntArrayToIP(ini.insi_laddr);<NEW_LINE>faddr = <MASK><NEW_LINE>type += "6";<NEW_LINE>} else {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>int lport = ParseUtil.bigEndian16ToLittleEndian(ini.insi_lport);<NEW_LINE>int fport = ParseUtil.bigEndian16ToLittleEndian(ini.insi_fport);<NEW_LINE>return new IPConnection(type, laddr, lport, faddr, fport, state, si.psi.soi_qlen, si.psi.soi_incqlen, pid);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | ParseUtil.parseIntArrayToIP(ini.insi_faddr); |
1,145,741 | public static String requestWTSSWithSSOPost(String url, Map<String, String> params, AppIntegrationService<SSORequestService> service, Workspace workspace) throws Exception {<NEW_LINE>try {<NEW_LINE>FlowScheduleAction flowScheduleAction = new FlowScheduleAction();<NEW_LINE>flowScheduleAction.<MASK><NEW_LINE>SSOUrlBuilderOperation ssoUrlBuilderOperation = workspace.getSSOUrlBuilderOperation().copy();<NEW_LINE>ssoUrlBuilderOperation.setAppName(SCHEDULIS_APPCONN_NAME);<NEW_LINE>ssoUrlBuilderOperation.setReqUrl(url);<NEW_LINE>ssoUrlBuilderOperation.setWorkspace(workspace.getWorkspaceName());<NEW_LINE>flowScheduleAction.setURL(ssoUrlBuilderOperation.getBuiltUrl());<NEW_LINE>SSORequestOperation<HttpAction, HttpResult> ssoRequestOperation = service.getSSORequestService().createSSORequestOperation(SCHEDULIS_APPCONN_NAME);<NEW_LINE>HttpResult previewResult = ssoRequestOperation.requestWithSSO(ssoUrlBuilderOperation, flowScheduleAction);<NEW_LINE>if (previewResult.getStatusCode() == 200 || previewResult.getStatusCode() == 0) {<NEW_LINE>String response = previewResult.getResponseBody();<NEW_LINE>return response;<NEW_LINE>} else {<NEW_LINE>throw new ExternalOperationFailedException(50063, "User sso request failed:" + url);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error("requestWTSSPostError-->", e);<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>} | getFormParams().putAll(params); |
918,179 | private CompletableFuture<Void> excludeObsolete(IndexedCompactionArgs args, Map<UUID, TableBucket> buckets, TimeoutTimer timer) {<NEW_LINE>// Exclude all those Table Entries whose buckets altogether do not exist.<NEW_LINE>val deletedBuckets = args.candidatesByHash.keySet().stream().filter(k -> {<NEW_LINE>val bucket = buckets.get(k);<NEW_LINE>return bucket == null || !bucket.exists();<NEW_LINE>}).<MASK><NEW_LINE>// Do this in a separate loop since we are modifying args.candidatesByHash with removeBucket().<NEW_LINE>for (val bucket : deletedBuckets) {<NEW_LINE>args.removeBucket(bucket);<NEW_LINE>}<NEW_LINE>// For every Bucket that still exists, find all its Keys and match with our candidates and figure out if our<NEW_LINE>// candidates are still eligible for compaction.<NEW_LINE>val br = TableBucketReader.key(this.segment, this.indexReader::getBackpointerOffset, this.executor);<NEW_LINE>val candidateBuckets = args.candidatesByHash.keySet().iterator();<NEW_LINE>return Futures.loop(candidateBuckets::hasNext, () -> {<NEW_LINE>val bucketId = candidateBuckets.next();<NEW_LINE>long bucketOffset = buckets.get(bucketId).getSegmentOffset();<NEW_LINE>return br.findAll(bucketOffset, args::handleExistingKey, timer);<NEW_LINE>}, this.executor);<NEW_LINE>} | collect(Collectors.toList()); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.