idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
613,298 | public ProductId retrieveProductIdBy(@NonNull final ProductQuery query) {<NEW_LINE>final IQueryBuilder<I_M_Product> queryBuilder;<NEW_LINE>if (query.isOutOfTrx()) {<NEW_LINE>queryBuilder = Services.get(IQueryBL.class).createQueryBuilderOutOfTrx(I_M_Product.class).setOption(IQuery.OPTION_ReturnReadOnlyRecords, true);<NEW_LINE>} else {<NEW_LINE>queryBuilder = Services.get(IQueryBL.class).createQueryBuilder(I_M_Product.class);<NEW_LINE>}<NEW_LINE>if (query.isIncludeAnyOrg()) {<NEW_LINE>queryBuilder.addInArrayFilter(I_M_Product.COLUMNNAME_AD_Org_ID, query.getOrgId(), OrgId.ANY).orderByDescending(I_M_Product.COLUMNNAME_AD_Org_ID);<NEW_LINE>} else {<NEW_LINE>queryBuilder.addEqualsFilter(I_M_Product.<MASK><NEW_LINE>}<NEW_LINE>if (!isEmpty(query.getValue(), true)) {<NEW_LINE>queryBuilder.addEqualsFilter(I_M_Product.COLUMNNAME_Value, query.getValue().trim());<NEW_LINE>}<NEW_LINE>if (query.getExternalId() != null) {<NEW_LINE>queryBuilder.addEqualsFilter(I_M_Product.COLUMNNAME_ExternalId, query.getExternalId().getValue().trim());<NEW_LINE>}<NEW_LINE>final int productRepoId = queryBuilder.addOnlyActiveRecordsFilter().create().firstId();<NEW_LINE>return ProductId.ofRepoIdOrNull(productRepoId);<NEW_LINE>} | COLUMNNAME_AD_Org_ID, query.getOrgId()); |
204,423 | public void loadAddress(Register dst, AArch64Address address) {<NEW_LINE>assert dst.getRegisterCategory().equals(CPU);<NEW_LINE>int size = address.getBitMemoryTransferSize();<NEW_LINE>switch(address.getAddressingMode()) {<NEW_LINE>case IMMEDIATE_UNSIGNED_SCALED:<NEW_LINE>assert size != AArch64Address.ANY_SIZE;<NEW_LINE>int scaledImmediate = address.getImmediateRaw() << getLog2TransferSize(size);<NEW_LINE>add(64, dst, <MASK><NEW_LINE>break;<NEW_LINE>case IMMEDIATE_SIGNED_UNSCALED:<NEW_LINE>int immediate = address.getImmediateRaw();<NEW_LINE>add(64, dst, address.getBase(), immediate);<NEW_LINE>break;<NEW_LINE>case REGISTER_OFFSET:<NEW_LINE>assert !(address.isRegisterOffsetScaled() && size == AArch64Address.ANY_SIZE);<NEW_LINE>add(64, dst, address.getBase(), address.getOffset(), ShiftType.LSL, address.isRegisterOffsetScaled() ? getLog2TransferSize(size) : 0);<NEW_LINE>break;<NEW_LINE>case EXTENDED_REGISTER_OFFSET:<NEW_LINE>assert !(address.isRegisterOffsetScaled() && size == AArch64Address.ANY_SIZE);<NEW_LINE>add(64, dst, address.getBase(), address.getOffset(), address.getExtendType(), address.isRegisterOffsetScaled() ? getLog2TransferSize(size) : 0);<NEW_LINE>break;<NEW_LINE>case BASE_REGISTER_ONLY:<NEW_LINE>mov(64, dst, address.getBase());<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw GraalError.shouldNotReachHere();<NEW_LINE>}<NEW_LINE>} | address.getBase(), scaledImmediate); |
457,468 | private void synchronizeName(Object inst) {<NEW_LINE>java.lang.reflect.Method getter;<NEW_LINE>try {<NEW_LINE>try {<NEW_LINE>// NOI18N<NEW_LINE>getter = inst.getClass().getMethod("getDisplayName");<NEW_LINE>} catch (NoSuchMethodException me) {<NEW_LINE>// NOI18N<NEW_LINE>getter = inst.getClass().getMethod("getName");<NEW_LINE>}<NEW_LINE>} catch (Exception ex) {<NEW_LINE>// do nothing<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!getter.isAccessible())<NEW_LINE>return;<NEW_LINE>try {<NEW_LINE>String name = (<MASK><NEW_LINE>String oldName = ip.getDataObject().getName();<NEW_LINE>if (!name.equals(oldName)) {<NEW_LINE>file.setAttribute(EA_NAME, name);<NEW_LINE>} else if (file.getAttribute(EA_NAME) == null) {<NEW_LINE>file.setAttribute(EA_NAME, name);<NEW_LINE>}<NEW_LINE>} catch (Exception ex) {<NEW_LINE>Exceptions.attachLocalizedMessage(ex, file.toString());<NEW_LINE>Logger.getLogger(SaveSupport.class.getName()).log(Level.WARNING, null, ex);<NEW_LINE>}<NEW_LINE>} | String) getter.invoke(inst); |
397,113 | public Object sqlToObject(String value, Database database) {<NEW_LINE>if (database instanceof AbstractDb2Database) {<NEW_LINE>return value.replaceFirst("^\"SYSIBM\".\"DATE\"\\('", "").replaceFirst("'\\)", "");<NEW_LINE>}<NEW_LINE>if (database instanceof DerbyDatabase) {<NEW_LINE>return value.replaceFirst("^DATE\\('", "").replaceFirst("'\\)", "");<NEW_LINE>}<NEW_LINE>if (zeroTime(value)) {<NEW_LINE>return value;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>DateFormat dateFormat = getDateFormat(database);<NEW_LINE>if ((database instanceof OracleDatabase) && value.matches("to_date\\('\\d+\\-\\d+\\-\\d+', " + "'YYYY\\-MM\\-DD'\\)")) {<NEW_LINE>dateFormat = new SimpleDateFormat("yyyy-MM-dd");<NEW_LINE>value = value.replaceFirst(".*?'", "").replaceFirst("',.*", "");<NEW_LINE>}<NEW_LINE>return new java.sql.Date(dateFormat.parse(value.trim<MASK><NEW_LINE>} catch (ParseException e) {<NEW_LINE>return new DatabaseFunction(value);<NEW_LINE>}<NEW_LINE>} | ()).getTime()); |
1,596,751 | private static Collection<File> readModules(File cluster) {<NEW_LINE>if (cluster == null || !cluster.exists()) {<NEW_LINE>return Collections.emptySet();<NEW_LINE>}<NEW_LINE>Collection<File> res = new HashSet<File>();<NEW_LINE>// NOI18N<NEW_LINE>File config = new File(new File<MASK><NEW_LINE>if (config.listFiles() == null) {<NEW_LINE>return Collections.emptySet();<NEW_LINE>}<NEW_LINE>for (File cf : config.listFiles()) {<NEW_LINE>if (cf.getName().endsWith(".xml_hidden")) {<NEW_LINE>// 158204<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (cf.getName().endsWith(".xml")) {<NEW_LINE>// NOI18N<NEW_LINE>if (cf.length() > 0) {<NEW_LINE>res.add(cf);<NEW_LINE>} else {<NEW_LINE>LOG.log(Level.INFO, "Found zero-sized xml file in config/Modules, ignoring: " + cf);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>LOG.log(Level.INFO, "Found non-xml file in config/Modules, ignoring: " + cf);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return res;<NEW_LINE>} | (cluster, "config"), "Modules"); |
86,947 | private static Properties createProperties(File file, CommandSpec commandSpec) {<NEW_LINE>if (file == null) {<NEW_LINE>throw new NullPointerException("file is null");<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>Properties result = new Properties();<NEW_LINE>if (file.exists() && file.canRead()) {<NEW_LINE>InputStream in = null;<NEW_LINE>try {<NEW_LINE>String command = commandSpec == null ? "unknown command" : commandSpec.qualifiedName();<NEW_LINE>tracer.debug("Reading defaults from %s for %s", file.getAbsolutePath(), command);<NEW_LINE>in = new FileInputStream(file);<NEW_LINE>result.load(in);<NEW_LINE>result.put("__picocli_internal_location", file);<NEW_LINE>} catch (IOException ioe) {<NEW_LINE>tracer.warn("could not read defaults from %s: %s", file.getAbsolutePath(), ioe);<NEW_LINE>} finally {<NEW_LINE>close(in);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>tracer.warn("defaults configuration file %s does not exist or is not readable", file.getAbsolutePath());<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | Tracer tracer = CommandLine.tracer(); |
728,329 | private void init() {<NEW_LINE>exceptionUnmarshallers.add(new InvalidFirehoseDestinationExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new InvalidS3ConfigurationExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new InvalidDeliveryOptionsExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new InvalidSNSDestinationExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new InvalidRenderingParameterExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new MessageRejectedExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new InvalidCloudWatchDestinationExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new AccountSendingPausedExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new RuleSetDoesNotExistExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new InvalidSnsTopicExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new LimitExceededExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new ConfigurationSetSendingPausedExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new EventDestinationDoesNotExistExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new InvalidLambdaFunctionExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers<MASK><NEW_LINE>exceptionUnmarshallers.add(new MissingRenderingAttributeExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new AlreadyExistsExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new CannotDeleteExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new TrackingOptionsAlreadyExistsExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new ConfigurationSetAlreadyExistsExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new CustomVerificationEmailInvalidContentExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new InvalidTemplateExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new MailFromDomainNotVerifiedExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new ConfigurationSetDoesNotExistExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new ProductionAccessNotGrantedExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new InvalidTrackingOptionsExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new TrackingOptionsDoesNotExistExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new EventDestinationAlreadyExistsExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new FromEmailAddressNotVerifiedExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new RuleDoesNotExistExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new InvalidConfigurationSetExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new CustomVerificationEmailTemplateDoesNotExistExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new InvalidPolicyExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new CustomVerificationEmailTemplateAlreadyExistsExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new StandardErrorUnmarshaller(com.amazonaws.services.simpleemail.model.AmazonSimpleEmailServiceException.class));<NEW_LINE>setServiceNameIntern(DEFAULT_SIGNING_NAME);<NEW_LINE>setEndpointPrefix(ENDPOINT_PREFIX);<NEW_LINE>// calling this.setEndPoint(...) will also modify the signer accordingly<NEW_LINE>this.setEndpoint("https://email.us-east-1.amazonaws.com");<NEW_LINE>HandlerChainFactory chainFactory = new HandlerChainFactory();<NEW_LINE>requestHandler2s.addAll(chainFactory.newRequestHandlerChain("/com/amazonaws/services/simpleemail/request.handlers"));<NEW_LINE>requestHandler2s.addAll(chainFactory.newRequestHandler2Chain("/com/amazonaws/services/simpleemail/request.handler2s"));<NEW_LINE>requestHandler2s.addAll(chainFactory.getGlobalHandlers());<NEW_LINE>} | .add(new TemplateDoesNotExistExceptionUnmarshaller()); |
574,109 | public void valueChanged(ListSelectionEvent e) {<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>JList<State> theList = (JList<<MASK><NEW_LINE>State st = (State) theList.getSelectedValue();<NEW_LINE>if (st == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>DefaultListModel<String> stateListModel = new DefaultListModel<>();<NEW_LINE>stateListModel.addElement("weight:" + st.getWeight());<NEW_LINE>stateListModel.addElement("weightdelta:" + st.getWeightDelta());<NEW_LINE>stateListModel.addElement("rentingVehicle:" + st.isRentingVehicle());<NEW_LINE>stateListModel.addElement("vehicleParked:" + st.isVehicleParked());<NEW_LINE>stateListModel.addElement("walkDistance:" + st.getWalkDistance());<NEW_LINE>stateListModel.addElement("elapsedTime:" + st.getElapsedTimeSeconds());<NEW_LINE>outputList.setModel(stateListModel);<NEW_LINE>lastStateClicked = st;<NEW_LINE>} | State>) e.getSource(); |
762,786 | final DeleteLifecyclePolicyResult executeDeleteLifecyclePolicy(DeleteLifecyclePolicyRequest deleteLifecyclePolicyRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteLifecyclePolicyRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteLifecyclePolicyRequest> request = null;<NEW_LINE>Response<DeleteLifecyclePolicyResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteLifecyclePolicyRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteLifecyclePolicyRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "ECR");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteLifecyclePolicy");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteLifecyclePolicyResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteLifecyclePolicyResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint); |
1,474,895 | protected void select_instances() {<NEW_LINE>List<Object> selected_violations = list.getSelectedValuesList();<NEW_LINE>if (selected_violations.size() <= 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>java.util.Set<app.freerouting.board.Item> selected_items = new java.util.TreeSet<app.freerouting.board.Item>();<NEW_LINE>for (int i = 0; i < selected_violations.size(); ++i) {<NEW_LINE>ClearanceViolation curr_violation = ((ViolationInfo) selected_violations.get(i)).violation;<NEW_LINE>selected_items.add(curr_violation.first_item);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>app.freerouting.interactive.BoardHandling board_handling = board_frame.board_panel.board_handling;<NEW_LINE>board_handling.select_items(selected_items);<NEW_LINE>board_handling.toggle_selected_item_violations();<NEW_LINE>board_handling.zoom_selection();<NEW_LINE>} | selected_items.add(curr_violation.second_item); |
124,692 | public Plan visitPhysicalFilter(PhysicalFilter<? extends Plan> filter, CascadesContext context) {<NEW_LINE>Preconditions.checkArgument(filter.getPredicates() != BooleanLiteral.TRUE);<NEW_LINE>Plan child = filter.child();<NEW_LINE>// Forbidden filter-project, we must make filter-project -> project-filter.<NEW_LINE>Preconditions.checkState<MASK><NEW_LINE>// Forbidden filter-cross join, because we put all filter on cross join into its other join condition.<NEW_LINE>Preconditions.checkState(!(child instanceof PhysicalNestedLoopJoin));<NEW_LINE>// Check filter is from child output.<NEW_LINE>Set<Slot> childOutputSet = child.getOutputSet();<NEW_LINE>Set<Slot> slotsUsedByFilter = filter.getPredicates().collect(Slot.class::isInstance);<NEW_LINE>for (Slot slot : slotsUsedByFilter) {<NEW_LINE>Preconditions.checkState(childOutputSet.contains(slot));<NEW_LINE>}<NEW_LINE>child.accept(this, context);<NEW_LINE>return filter;<NEW_LINE>} | (!(child instanceof PhysicalProject)); |
1,705,975 | private void markupIMTConflictTables(Program program, TaskMonitor monitor) throws Exception {<NEW_LINE>if (get_kSectionIMTConflictTables() == UNSUPPORTED_SECTION) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ArtImageSection section = sectionList.get(get_kSectionIMTConflictTables());<NEW_LINE>monitor.setMessage("ART - markup IMT conflict tables...");<NEW_LINE>monitor.setProgress(0);<NEW_LINE>monitor.setMaximum(section.getSize());<NEW_LINE>int pointerSize = header.getPointerSize();<NEW_LINE>if (section.getSize() > 0) {<NEW_LINE>Address address = program.getMinAddress().getNewAddress(header.getImageBegin() + section.getOffset());<NEW_LINE>if (!program.getMemory().contains(address)) {<NEW_LINE>// outside of ART file<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Address endAddress = address.add(section.getSize());<NEW_LINE>while (address.compareTo(endAddress) < 0) {<NEW_LINE>monitor.checkCanceled();<NEW_LINE>monitor.incrementProgress(pointerSize);<NEW_LINE><MASK><NEW_LINE>address = address.add(pointerSize);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | createDataAt(program, address, pointerSize); |
305,125 | private void init(Hashtable toCopy) {<NEW_LINE>super.copy(toCopy);<NEW_LINE>Hashtable f = (Hashtable) toCopy.get("from");<NEW_LINE>if (f != null) {<NEW_LINE>from.copy(f);<NEW_LINE>}<NEW_LINE>description = (String) toCopy.get("description");<NEW_LINE>location = (String) toCopy.get("location");<NEW_LINE>link = (String) toCopy.get("link");<NEW_LINE>cover_photo = (String) toCopy.get("cover_photo");<NEW_LINE>privacy = (String) toCopy.get("privacy");<NEW_LINE>String countStr = (String) toCopy.get("count");<NEW_LINE>if (countStr != null) {<NEW_LINE>count = Integer.parseInt(countStr);<NEW_LINE>}<NEW_LINE>type = (String) toCopy.get("type");<NEW_LINE>created_time = (<MASK><NEW_LINE>updated_time = (String) toCopy.get("updated_time");<NEW_LINE>} | String) toCopy.get("created_time"); |
1,531,736 | private void editSelectedPolicyMapping() {<NEW_LINE>int selectedRow = jtPolicyMappings.getSelectedRow();<NEW_LINE>if (selectedRow != -1) {<NEW_LINE>PolicyMapping policyMapping = (PolicyMapping) jtPolicyMappings.getValueAt(selectedRow, 0);<NEW_LINE>Container container = getTopLevelAncestor();<NEW_LINE>DPolicyMappingChooser dPolicyMappingChooser = null;<NEW_LINE>if (container instanceof JDialog) {<NEW_LINE>dPolicyMappingChooser = new DPolicyMappingChooser((JDialog) container, title, policyMapping);<NEW_LINE>} else {<NEW_LINE>dPolicyMappingChooser = new DPolicyMappingChooser((JFrame) container, title, policyMapping);<NEW_LINE>}<NEW_LINE>dPolicyMappingChooser.setLocationRelativeTo(container);<NEW_LINE>dPolicyMappingChooser.setVisible(true);<NEW_LINE>PolicyMapping newPolicyMapping = dPolicyMappingChooser.getPolicyMapping();<NEW_LINE>if (newPolicyMapping == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>policyMappings = <MASK><NEW_LINE>policyMappings = PolicyMappingsUtil.add(newPolicyMapping, policyMappings);<NEW_LINE>populate();<NEW_LINE>selectPolicyMappingInTable(newPolicyMapping);<NEW_LINE>}<NEW_LINE>} | PolicyMappingsUtil.remove(policyMapping, policyMappings); |
237,625 | public Model<Label> train(Dataset<Label> examples, Map<String, Provenance> instanceProvenance, int invocationCount) {<NEW_LINE>if (invocationCount != INCREMENT_INVOCATION_COUNT) {<NEW_LINE>this.invocationCount = invocationCount;<NEW_LINE>}<NEW_LINE>ModelProvenance provenance = new ModelProvenance(DummyClassifierModel.class.getName(), OffsetDateTime.now(), examples.getProvenance(), getProvenance(), instanceProvenance);<NEW_LINE>ImmutableFeatureMap featureMap = examples.getFeatureIDMap();<NEW_LINE>this.invocationCount++;<NEW_LINE>switch(dummyType) {<NEW_LINE>case CONSTANT:<NEW_LINE>MutableOutputInfo<Label> labelInfo = examples.getOutputInfo().generateMutableOutputInfo();<NEW_LINE>Label constLabel = new Label(constantLabel);<NEW_LINE>labelInfo.observe(constLabel);<NEW_LINE>return new DummyClassifierModel(provenance, featureMap, <MASK><NEW_LINE>case MOST_FREQUENT:<NEW_LINE>{<NEW_LINE>ImmutableOutputInfo<Label> immutableLabelInfo = examples.getOutputIDInfo();<NEW_LINE>return new DummyClassifierModel(provenance, featureMap, immutableLabelInfo);<NEW_LINE>}<NEW_LINE>case UNIFORM:<NEW_LINE>case STRATIFIED:<NEW_LINE>{<NEW_LINE>ImmutableOutputInfo<Label> immutableLabelInfo = examples.getOutputIDInfo();<NEW_LINE>return new DummyClassifierModel(provenance, featureMap, immutableLabelInfo, dummyType, seed);<NEW_LINE>}<NEW_LINE>default:<NEW_LINE>throw new IllegalStateException("Unknown dummyType " + dummyType);<NEW_LINE>}<NEW_LINE>} | labelInfo.generateImmutableOutputInfo(), constLabel); |
1,721,618 | private Mono<Response<Flux<ByteBuffer>>> startWithResponseAsync(String resourceGroupName, String applicationGatewayName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (applicationGatewayName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String apiVersion = "2021-05-01";<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.start(this.client.getEndpoint(), resourceGroupName, applicationGatewayName, apiVersion, this.client.getSubscriptionId(), accept, context);<NEW_LINE>} | error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); |
729,334 | // DO NOT MODIFY THIS CODE, GENERATED AUTOMATICALLY<NEW_LINE>public static com.sun.jdi.FloatValue mirrorOf(com.sun.jdi.VirtualMachine a, float b) throws org.netbeans.modules.debugger.jpda.jdi.InternalExceptionWrapper, org.netbeans.modules.debugger.jpda.jdi.VMDisconnectedExceptionWrapper {<NEW_LINE>if (org.netbeans.modules.debugger.jpda.JDIExceptionReporter.isLoggable()) {<NEW_LINE>org.netbeans.modules.debugger.jpda.JDIExceptionReporter.logCallStart("com.sun.jdi.VirtualMachine", "mirrorOf", "JDI CALL: com.sun.jdi.VirtualMachine({0}).mirrorOf({1})", new Object<MASK><NEW_LINE>}<NEW_LINE>Object retValue = null;<NEW_LINE>try {<NEW_LINE>com.sun.jdi.FloatValue ret;<NEW_LINE>ret = a.mirrorOf(b);<NEW_LINE>retValue = ret;<NEW_LINE>return ret;<NEW_LINE>} catch (com.sun.jdi.InternalException ex) {<NEW_LINE>retValue = ex;<NEW_LINE>org.netbeans.modules.debugger.jpda.JDIExceptionReporter.report(ex);<NEW_LINE>throw new org.netbeans.modules.debugger.jpda.jdi.InternalExceptionWrapper(ex);<NEW_LINE>} catch (com.sun.jdi.VMDisconnectedException ex) {<NEW_LINE>retValue = ex;<NEW_LINE>if (a instanceof com.sun.jdi.Mirror) {<NEW_LINE>com.sun.jdi.VirtualMachine vm = ((com.sun.jdi.Mirror) a).virtualMachine();<NEW_LINE>try {<NEW_LINE>vm.dispose();<NEW_LINE>} catch (com.sun.jdi.VMDisconnectedException vmdex) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw new org.netbeans.modules.debugger.jpda.jdi.VMDisconnectedExceptionWrapper(ex);<NEW_LINE>} catch (Error err) {<NEW_LINE>retValue = err;<NEW_LINE>throw err;<NEW_LINE>} catch (RuntimeException rex) {<NEW_LINE>retValue = rex;<NEW_LINE>throw rex;<NEW_LINE>} finally {<NEW_LINE>if (org.netbeans.modules.debugger.jpda.JDIExceptionReporter.isLoggable()) {<NEW_LINE>org.netbeans.modules.debugger.jpda.JDIExceptionReporter.logCallEnd("com.sun.jdi.VirtualMachine", "mirrorOf", retValue);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | [] { a, b }); |
1,797,256 | public void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>((WordPress) getActivity().getApplicationContext()).component().inject(this);<NEW_LINE>if (savedInstanceState == null) {<NEW_LINE>mCurrentUserId = getArguments().getLong(ARG_CURRENT_USER_ID);<NEW_LINE>mPersonId = getArguments().getLong(ARG_PERSON_ID);<NEW_LINE>mLocalTableBlogId = getArguments().getInt(ARG_LOCAL_TABLE_BLOG_ID);<NEW_LINE>mPersonType = (Person.PersonType) getArguments().getSerializable(ARG_PERSON_TYPE);<NEW_LINE>} else {<NEW_LINE>mCurrentUserId = savedInstanceState.getLong(ARG_CURRENT_USER_ID);<NEW_LINE><MASK><NEW_LINE>mLocalTableBlogId = savedInstanceState.getInt(ARG_LOCAL_TABLE_BLOG_ID);<NEW_LINE>mPersonType = (Person.PersonType) savedInstanceState.getSerializable(ARG_PERSON_TYPE);<NEW_LINE>}<NEW_LINE>SiteModel siteModel = mSiteStore.getSiteByLocalId(mLocalTableBlogId);<NEW_LINE>mUserRoles = mSiteStore.getUserRoles(siteModel);<NEW_LINE>} | mPersonId = savedInstanceState.getLong(ARG_PERSON_ID); |
919,439 | final UpdateDomainMetadataResult executeUpdateDomainMetadata(UpdateDomainMetadataRequest updateDomainMetadataRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateDomainMetadataRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateDomainMetadataRequest> request = null;<NEW_LINE>Response<UpdateDomainMetadataResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateDomainMetadataRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateDomainMetadataRequest));<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, "UpdateDomainMetadata");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateDomainMetadataResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateDomainMetadataResultJsonUnmarshaller());<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, "WorkLink"); |
55,182 | public static void main(String[] args) {<NEW_LINE>if (args.length > 1) {<NEW_LINE>System.out.println("Test usage:\njava MNISTCUDNN [image]\nExiting...");<NEW_LINE>System.exit(EXIT_FAILURE);<NEW_LINE>}<NEW_LINE>String image_path;<NEW_LINE>network_t mnist = new network_t();<NEW_LINE>String name = MNISTCUDNN.class.getName();<NEW_LINE>if (Loader.sizeof(Pointer.class) != 8 && !Loader.getPlatform().contains("arm")) {<NEW_LINE>System.out.println("With the exception of ARM, " + name + " is only supported on 64-bit OS and the application must be built as a 64-bit target. Test is being waived.");<NEW_LINE>System.exit(EXIT_WAIVED);<NEW_LINE>}<NEW_LINE>Layer_t conv1 = new Layer_t(1, 20, 5, conv1_bin, conv1_bias_bin, name);<NEW_LINE>Layer_t conv2 = new Layer_t(20, 50, 5, conv2_bin, conv2_bias_bin, name);<NEW_LINE>Layer_t ip1 = new Layer_t(800, 500, 1, ip1_bin, ip1_bias_bin, name);<NEW_LINE>Layer_t ip2 = new Layer_t(500, 10, 1, ip2_bin, ip2_bias_bin, name);<NEW_LINE>if (args.length == 0) {<NEW_LINE>int i1, i2, i3;<NEW_LINE>image_path = get_path(first_image, name);<NEW_LINE>i1 = mnist.classify_example(image_path, conv1, conv2, ip1, ip2);<NEW_LINE>image_path = get_path(second_image, name);<NEW_LINE>i2 = mnist.classify_example(image_path, conv1, conv2, ip1, ip2);<NEW_LINE><MASK><NEW_LINE>i3 = mnist.classify_example(image_path, conv1, conv2, ip1, ip2);<NEW_LINE>System.out.println("\nResult of classification: " + i1 + " " + i2 + " " + i3);<NEW_LINE>if (i1 != 1 || i2 != 3 || i3 != 5) {<NEW_LINE>System.out.println("\nTest failed!");<NEW_LINE>FatalError("Prediction mismatch");<NEW_LINE>} else {<NEW_LINE>System.out.println("\nTest passed!");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>int i1 = mnist.classify_example(args[0], conv1, conv2, ip1, ip2);<NEW_LINE>System.out.println("\nResult of classification: " + i1);<NEW_LINE>}<NEW_LINE>cudaDeviceReset();<NEW_LINE>System.exit(EXIT_SUCCESS);<NEW_LINE>} | image_path = get_path(third_image, name); |
1,206,627 | public static void convert(InterleavedS32 input, InterleavedS64 output) {<NEW_LINE>if (input.isSubimage() || output.isSubimage()) {<NEW_LINE>final int N = input.width * input.getNumBands();<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(0, input.height, y -> {<NEW_LINE>for (int y = 0; y < input.height; y++) {<NEW_LINE>int indexSrc = input.getIndex(0, y);<NEW_LINE>int indexDst = <MASK><NEW_LINE>for (int x = 0; x < N; x++) {<NEW_LINE>output.data[indexDst++] = (input.data[indexSrc++]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>} else {<NEW_LINE>final int N = input.width * input.height * input.getNumBands();<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopBlocks(0,N,(i0,i1)->{<NEW_LINE>int i0 = 0, i1 = N;<NEW_LINE>for (int i = i0; i < i1; i++) {<NEW_LINE>output.data[i] = (input.data[i]);<NEW_LINE>}<NEW_LINE>// CONCURRENT_INLINE });<NEW_LINE>}<NEW_LINE>} | output.getIndex(0, y); |
371,645 | public static GetStackResponse unmarshall(GetStackResponse getStackResponse, UnmarshallerContext _ctx) {<NEW_LINE>getStackResponse.setRequestId(_ctx.stringValue("GetStackResponse.RequestId"));<NEW_LINE>List<StackInfoItem> stackInfo = new ArrayList<StackInfoItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("GetStackResponse.StackInfo.Length"); i++) {<NEW_LINE>StackInfoItem stackInfoItem = new StackInfoItem();<NEW_LINE>stackInfoItem.setStartTime(_ctx.longValue("GetStackResponse.StackInfo[" + i + "].StartTime"));<NEW_LINE>stackInfoItem.setException(_ctx.stringValue("GetStackResponse.StackInfo[" + i + "].Exception"));<NEW_LINE>stackInfoItem.setApi(_ctx.stringValue("GetStackResponse.StackInfo[" + i + "].Api"));<NEW_LINE>stackInfoItem.setLine(_ctx.stringValue("GetStackResponse.StackInfo[" + i + "].Line"));<NEW_LINE>stackInfoItem.setDuration(_ctx.longValue<MASK><NEW_LINE>stackInfoItem.setRpcId(_ctx.stringValue("GetStackResponse.StackInfo[" + i + "].RpcId"));<NEW_LINE>stackInfoItem.setServiceName(_ctx.stringValue("GetStackResponse.StackInfo[" + i + "].ServiceName"));<NEW_LINE>ExtInfo extInfo = new ExtInfo();<NEW_LINE>extInfo.setType(_ctx.stringValue("GetStackResponse.StackInfo[" + i + "].ExtInfo.Type"));<NEW_LINE>extInfo.setInfo(_ctx.stringValue("GetStackResponse.StackInfo[" + i + "].ExtInfo.Info"));<NEW_LINE>stackInfoItem.setExtInfo(extInfo);<NEW_LINE>stackInfo.add(stackInfoItem);<NEW_LINE>}<NEW_LINE>getStackResponse.setStackInfo(stackInfo);<NEW_LINE>return getStackResponse;<NEW_LINE>} | ("GetStackResponse.StackInfo[" + i + "].Duration")); |
679,048 | public void marshall(CreateIntegrationRequest createIntegrationRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (createIntegrationRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(createIntegrationRequest.getApiId(), APIID_BINDING);<NEW_LINE>protocolMarshaller.marshall(createIntegrationRequest.getConnectionId(), CONNECTIONID_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(createIntegrationRequest.getContentHandlingStrategy(), CONTENTHANDLINGSTRATEGY_BINDING);<NEW_LINE>protocolMarshaller.marshall(createIntegrationRequest.getCredentialsArn(), CREDENTIALSARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(createIntegrationRequest.getDescription(), DESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(createIntegrationRequest.getIntegrationMethod(), INTEGRATIONMETHOD_BINDING);<NEW_LINE>protocolMarshaller.marshall(createIntegrationRequest.getIntegrationSubtype(), INTEGRATIONSUBTYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(createIntegrationRequest.getIntegrationType(), INTEGRATIONTYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(createIntegrationRequest.getIntegrationUri(), INTEGRATIONURI_BINDING);<NEW_LINE>protocolMarshaller.marshall(createIntegrationRequest.getPassthroughBehavior(), PASSTHROUGHBEHAVIOR_BINDING);<NEW_LINE>protocolMarshaller.marshall(createIntegrationRequest.getPayloadFormatVersion(), PAYLOADFORMATVERSION_BINDING);<NEW_LINE>protocolMarshaller.marshall(createIntegrationRequest.getRequestParameters(), REQUESTPARAMETERS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createIntegrationRequest.getRequestTemplates(), REQUESTTEMPLATES_BINDING);<NEW_LINE>protocolMarshaller.marshall(createIntegrationRequest.getResponseParameters(), RESPONSEPARAMETERS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createIntegrationRequest.getTemplateSelectionExpression(), TEMPLATESELECTIONEXPRESSION_BINDING);<NEW_LINE>protocolMarshaller.marshall(createIntegrationRequest.getTimeoutInMillis(), TIMEOUTINMILLIS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createIntegrationRequest.getTlsConfig(), TLSCONFIG_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | createIntegrationRequest.getConnectionType(), CONNECTIONTYPE_BINDING); |
1,053,305 | void AddRange(char left, char right) {<NEW_LINE>onlyChar = 2;<NEW_LINE>int i;<NEW_LINE>char tempLeft1, tempLeft2, tempRight1, tempRight2;<NEW_LINE>if (left < 128) {<NEW_LINE>if (right < 128) {<NEW_LINE>for (; left <= right; left++) AddASCIIMove(left);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (; left < 128; left++) AddASCIIMove(left);<NEW_LINE>}<NEW_LINE>if (!unicodeWarningGiven && (left > 0xff || right > 0xff) && !Options.getJavaUnicodeEscape() && !Options.getUserCharStream()) {<NEW_LINE>unicodeWarningGiven = true;<NEW_LINE>JavaCCErrors.warning(Main.lg.<MASK><NEW_LINE>}<NEW_LINE>if (rangeMoves == null)<NEW_LINE>rangeMoves = new char[20];<NEW_LINE>int len = rangeMoves.length;<NEW_LINE>if (rangeMoves[len - 1] != 0) {<NEW_LINE>rangeMoves = ExpandCharArr(rangeMoves, 20);<NEW_LINE>len += 20;<NEW_LINE>}<NEW_LINE>for (i = 0; i < len; i += 2) if (rangeMoves[i] == 0 || (rangeMoves[i] > left) || ((rangeMoves[i] == left) && (rangeMoves[i + 1] > right)))<NEW_LINE>break;<NEW_LINE>tempLeft1 = rangeMoves[i];<NEW_LINE>tempRight1 = rangeMoves[i + 1];<NEW_LINE>rangeMoves[i] = left;<NEW_LINE>rangeMoves[i + 1] = right;<NEW_LINE>for (i += 2; i < len; i += 2) {<NEW_LINE>if (tempLeft1 == 0)<NEW_LINE>break;<NEW_LINE>tempLeft2 = rangeMoves[i];<NEW_LINE>tempRight2 = rangeMoves[i + 1];<NEW_LINE>rangeMoves[i] = tempLeft1;<NEW_LINE>rangeMoves[i + 1] = tempRight1;<NEW_LINE>tempLeft1 = tempLeft2;<NEW_LINE>tempRight1 = tempRight2;<NEW_LINE>}<NEW_LINE>} | curRE, "Non-ASCII characters used in regular expression.\n" + "Please make sure you use the correct Reader when you create the parser, " + "one that can handle your character set."); |
986,290 | public void readParams(AbstractSerializedData stream, boolean exception) {<NEW_LINE>flags = stream.readInt32(exception);<NEW_LINE>min = (flags & 1) != 0;<NEW_LINE>can_see_list = (flags & 4) != 0;<NEW_LINE>int magic = stream.readInt32(exception);<NEW_LINE>if (magic != 0x1cb5c415) {<NEW_LINE>if (exception) {<NEW_LINE>throw new RuntimeException(String.format("wrong Vector magic, got %x", magic));<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int <MASK><NEW_LINE>for (int a = 0; a < count; a++) {<NEW_LINE>TL_reactionCount object = TL_reactionCount.TLdeserialize(stream, stream.readInt32(exception), exception);<NEW_LINE>if (object == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>results.add(object);<NEW_LINE>}<NEW_LINE>if ((flags & 2) != 0) {<NEW_LINE>magic = stream.readInt32(exception);<NEW_LINE>if (magic != 0x1cb5c415) {<NEW_LINE>if (exception) {<NEW_LINE>throw new RuntimeException(String.format("wrong Vector magic, got %x", magic));<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>count = stream.readInt32(exception);<NEW_LINE>for (int a = 0; a < count; a++) {<NEW_LINE>TL_messagePeerReaction object = MessagePeerReaction.TLdeserialize(stream, stream.readInt32(exception), exception);<NEW_LINE>if (object == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>recent_reactions.add(object);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | count = stream.readInt32(exception); |
752,652 | final ListProcessingJobsResult executeListProcessingJobs(ListProcessingJobsRequest listProcessingJobsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listProcessingJobsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<ListProcessingJobsRequest> request = null;<NEW_LINE>Response<ListProcessingJobsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListProcessingJobsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listProcessingJobsRequest));<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, "SageMaker");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListProcessingJobs");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListProcessingJobsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListProcessingJobsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.ClientExecuteTime); |
1,754,732 | public static DescribeTraceInfoNodeListResponse unmarshall(DescribeTraceInfoNodeListResponse describeTraceInfoNodeListResponse, UnmarshallerContext context) {<NEW_LINE>describeTraceInfoNodeListResponse.setRequestId(context.stringValue("DescribeTraceInfoNodeListResponse.RequestId"));<NEW_LINE>NodeListInfo nodeListInfo = new NodeListInfo();<NEW_LINE>List<String> entityTypeList = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < context.lengthValue("DescribeTraceInfoNodeListResponse.NodeListInfo.EntityTypeList.Length"); i++) {<NEW_LINE>entityTypeList.add(context.stringValue<MASK><NEW_LINE>}<NEW_LINE>nodeListInfo.setEntityTypeList(entityTypeList);<NEW_LINE>List<Edge> edgeList = new ArrayList<Edge>();<NEW_LINE>for (int i = 0; i < context.lengthValue("DescribeTraceInfoNodeListResponse.NodeListInfo.EdgeList.Length"); i++) {<NEW_LINE>Edge edge = new Edge();<NEW_LINE>edge.setEndId(context.stringValue("DescribeTraceInfoNodeListResponse.NodeListInfo.EdgeList[" + i + "].EndId"));<NEW_LINE>edge.setStartId(context.stringValue("DescribeTraceInfoNodeListResponse.NodeListInfo.EdgeList[" + i + "].StartId"));<NEW_LINE>edge.setTime(context.stringValue("DescribeTraceInfoNodeListResponse.NodeListInfo.EdgeList[" + i + "].Time"));<NEW_LINE>edgeList.add(edge);<NEW_LINE>}<NEW_LINE>nodeListInfo.setEdgeList(edgeList);<NEW_LINE>List<Vertex> vertexList = new ArrayList<Vertex>();<NEW_LINE>for (int i = 0; i < context.lengthValue("DescribeTraceInfoNodeListResponse.NodeListInfo.VertexList.Length"); i++) {<NEW_LINE>Vertex vertex = new Vertex();<NEW_LINE>vertex.setName(context.stringValue("DescribeTraceInfoNodeListResponse.NodeListInfo.VertexList[" + i + "].Name"));<NEW_LINE>vertex.setId(context.stringValue("DescribeTraceInfoNodeListResponse.NodeListInfo.VertexList[" + i + "].Id"));<NEW_LINE>vertex.setTime(context.stringValue("DescribeTraceInfoNodeListResponse.NodeListInfo.VertexList[" + i + "].Time"));<NEW_LINE>List<String> neighborList = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < context.lengthValue("DescribeTraceInfoNodeListResponse.NodeListInfo.VertexList[" + i + "].NeighborList.Length"); j++) {<NEW_LINE>neighborList.add(context.stringValue("DescribeTraceInfoNodeListResponse.NodeListInfo.VertexList[" + i + "].NeighborList[" + j + "]"));<NEW_LINE>}<NEW_LINE>vertex.setNeighborList(neighborList);<NEW_LINE>vertexList.add(vertex);<NEW_LINE>}<NEW_LINE>nodeListInfo.setVertexList(vertexList);<NEW_LINE>describeTraceInfoNodeListResponse.setNodeListInfo(nodeListInfo);<NEW_LINE>return describeTraceInfoNodeListResponse;<NEW_LINE>} | ("DescribeTraceInfoNodeListResponse.NodeListInfo.EntityTypeList[" + i + "]")); |
981,662 | private List<IncidentInstance> doGetIncidents(String appId, String appInstanceId, String appComponentName, String appComponentInstanceId, Integer incidentTypeId, Long startTimestamp, Long endTimestamp, boolean selfHealing) {<NEW_LINE>List<CommonDefinition> definitions = getDefs(appId, appComponentName, Constant.INCIDENT);<NEW_LINE>if (CollectionUtils.isEmpty(definitions)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>List<Integer> defIds = definitions.stream().filter(definition -> incidentTypeId == null || JSONObject.parseObject(definition.getExConfig(), IncidentExConfig.class).getTypeId().equals(incidentTypeId)).map(CommonDefinition::getId).collect(Collectors.toList());<NEW_LINE>if (CollectionUtils.isEmpty(defIds)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>IncidentInstanceExample example = new IncidentInstanceExample();<NEW_LINE>IncidentInstanceExample.Criteria criteria = example.createCriteria();<NEW_LINE>if (StringUtils.isNotEmpty(appInstanceId)) {<NEW_LINE>criteria.andAppInstanceIdEqualTo(appInstanceId);<NEW_LINE>}<NEW_LINE>if (StringUtils.isNotEmpty(appComponentInstanceId)) {<NEW_LINE>criteria.andAppComponentInstanceIdEqualTo(appComponentInstanceId);<NEW_LINE>}<NEW_LINE>criteria.andDefIdIn(defIds);<NEW_LINE>if (startTimestamp != null) {<NEW_LINE>criteria.andGmtLastOccurGreaterThanOrEqualTo(new Date(startTimestamp));<NEW_LINE>}<NEW_LINE>if (endTimestamp != null) {<NEW_LINE>criteria.<MASK><NEW_LINE>}<NEW_LINE>if (selfHealing) {<NEW_LINE>criteria.andTraceIdIsNotNull();<NEW_LINE>}<NEW_LINE>return incidentInstanceMapper.selectByExampleWithBLOBs(example);<NEW_LINE>} | andGmtLastOccurLessThan(new Date(endTimestamp)); |
818,316 | private void updateObjectCtorClosureSymbols(Location pos, BLangFunction currentFunction, BSymbol resolvedSymbol, BLangClassDefinition classDef, AnalyzerData data) {<NEW_LINE>classDef.hasClosureVars = true;<NEW_LINE>resolvedSymbol.closure = true;<NEW_LINE>if (currentFunction != null) {<NEW_LINE>currentFunction.closureVarSymbols.add(<MASK><NEW_LINE>// TODO: can identify if attached here<NEW_LINE>}<NEW_LINE>OCEDynamicEnvironmentData oceEnvData = classDef.oceEnvData;<NEW_LINE>if (currentFunction != null && (currentFunction.symbol.params.contains(resolvedSymbol) || (currentFunction.symbol.restParam == resolvedSymbol))) {<NEW_LINE>oceEnvData.closureFuncSymbols.add(resolvedSymbol);<NEW_LINE>} else {<NEW_LINE>oceEnvData.closureBlockSymbols.add(resolvedSymbol);<NEW_LINE>}<NEW_LINE>updateProceedingClasses(data.env.enclEnv, oceEnvData, classDef);<NEW_LINE>} | new ClosureVarSymbol(resolvedSymbol, pos)); |
500,397 | public DescribeSignalingChannelResult describeSignalingChannel(DescribeSignalingChannelRequest describeSignalingChannelRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeSignalingChannelRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeSignalingChannelRequest> request = null;<NEW_LINE>Response<DescribeSignalingChannelResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeSignalingChannelRequestMarshaller().marshall(describeSignalingChannelRequest);<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>Unmarshaller<DescribeSignalingChannelResult, JsonUnmarshallerContext> unmarshaller = new DescribeSignalingChannelResultJsonUnmarshaller();<NEW_LINE>JsonResponseHandler<DescribeSignalingChannelResult> responseHandler = new JsonResponseHandler<DescribeSignalingChannelResult>(unmarshaller);<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.endEvent(Field.ClientExecuteTime); |
392,258 | private double calculate(SessionsMutator sessionsMutator) {<NEW_LINE>if (sessionsMutator.all().isEmpty()) {<NEW_LINE>return 0.0;<NEW_LINE>}<NEW_LINE>long week = TimeUnit.DAYS.toMillis(7L);<NEW_LINE>long weekAgo = date - week;<NEW_LINE>long twoWeeksAgo = date - 2L * week;<NEW_LINE>long threeWeeksAgo = date - 3L * week;<NEW_LINE>SessionsMutator weekOne = sessionsMutator.filterSessionsBetween(weekAgo, date);<NEW_LINE>SessionsMutator weekTwo = sessionsMutator.filterSessionsBetween(twoWeeksAgo, weekAgo);<NEW_LINE>SessionsMutator weekThree = sessionsMutator.filterSessionsBetween(threeWeeksAgo, twoWeeksAgo);<NEW_LINE>double playtime1 = weekOne.toActivePlaytime();<NEW_LINE>double playtime2 = weekTwo.toActivePlaytime();<NEW_LINE>double playtime3 = weekThree.toActivePlaytime();<NEW_LINE>double indexW1 = 1.0 / (Math.PI / 2.0 * (playtime1 / playtimeMsThreshold) + 1.0);<NEW_LINE>double indexW2 = 1.0 / (Math.PI / 2.0 * <MASK><NEW_LINE>double indexW3 = 1.0 / (Math.PI / 2.0 * (playtime3 / playtimeMsThreshold) + 1.0);<NEW_LINE>double average = (indexW1 + indexW2 + indexW3) / 3.0;<NEW_LINE>return 5.0 - (5.0 * average);<NEW_LINE>} | (playtime2 / playtimeMsThreshold) + 1.0); |
931,508 | void applyAll(int y0, int y1, GrayU8 mask) {<NEW_LINE>init();<NEW_LINE>float maxWidth = srcImg.getWidth() - 1;<NEW_LINE>float maxHeight = srcImg.getHeight() - 1;<NEW_LINE>for (int y = y0; y < y1; y++) {<NEW_LINE>int indexDst = dstImg.startIndex + dstImg.stride * y + x0;<NEW_LINE>int indexMsk = mask.startIndex + mask.stride * y + x0;<NEW_LINE>for (int x = x0; x < x1; x++, indexDst++, indexMsk++) {<NEW_LINE>Point2D_F32 s = map[indexDst];<NEW_LINE>assigner.assign(indexDst, interp.get(s.x, s.y));<NEW_LINE>if (s.x >= 0 && s.x <= maxWidth && s.y >= 0 && s.y <= maxHeight) {<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>mask.data[indexMsk] = 0;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | mask.data[indexMsk] = 1; |
37,232 | static Object createMock(Class<?> type, List<Class<?>> additionalInterfaces, @Nullable List<Object> constructorArgs, IProxyBasedMockInterceptor interceptor, ClassLoader classLoader, boolean useObjenesis) {<NEW_LINE>Enhancer enhancer = new ConstructorFriendlyEnhancer();<NEW_LINE>enhancer.setClassLoader(classLoader);<NEW_LINE>enhancer.setSuperclass(type);<NEW_LINE>List<Class<?>> interfaces = new ArrayList<>(additionalInterfaces);<NEW_LINE><MASK><NEW_LINE>enhancer.setInterfaces(interfaces.toArray(CLASSES));<NEW_LINE>enhancer.setCallbackFilter(BridgeMethodAwareCallbackFilter.INSTANCE);<NEW_LINE>MethodInterceptor cglibInterceptor = new CglibMockInterceptorAdapter(interceptor);<NEW_LINE>enhancer.setCallbackTypes(new Class[] { cglibInterceptor.getClass(), NoOp.class });<NEW_LINE>Class<?> enhancedType = enhancer.createClass();<NEW_LINE>Object proxy = MockInstantiator.instantiate(type, enhancedType, constructorArgs, useObjenesis);<NEW_LINE>((Factory) proxy).setCallbacks(new Callback[] { cglibInterceptor, NoOp.INSTANCE });<NEW_LINE>return proxy;<NEW_LINE>} | interfaces.add(ISpockMockObject.class); |
997,073 | public HttpResponse handle(HttpRequest request) {<NEW_LINE>try {<NEW_LINE>Path path = new Path(request.getUri());<NEW_LINE>String userId = userIdOrThrow(request);<NEW_LINE>switch(request.getMethod()) {<NEW_LINE>case GET:<NEW_LINE>return handleGET(request, path, userId);<NEW_LINE>case PATCH:<NEW_LINE>return handlePATCH(request, path, userId);<NEW_LINE>case DELETE:<NEW_LINE>return handleDELETE(path, userId);<NEW_LINE>case POST:<NEW_LINE>return <MASK><NEW_LINE>default:<NEW_LINE>return ErrorResponse.methodNotAllowed("Method '" + request.getMethod() + "' is not supported");<NEW_LINE>}<NEW_LINE>} catch (NotFoundException e) {<NEW_LINE>return ErrorResponse.notFoundError(Exceptions.toMessageString(e));<NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>return ErrorResponse.badRequest(Exceptions.toMessageString(e));<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.log(Level.WARNING, "Unexpected error handling '" + request.getUri() + "'", e);<NEW_LINE>// Don't expose internal billing details in error message to user<NEW_LINE>return ErrorResponse.internalServerError("Internal problem while handling billing API request");<NEW_LINE>}<NEW_LINE>} | handlePOST(path, request, userId); |
727,675 | public void run() {<NEW_LINE>List<Node> prevSnapshot = null;<NEW_LINE>boolean wasInited = hierarchy.isInitialized();<NEW_LINE>boolean wasLeaf = hierarchy == Children.LEAF;<NEW_LINE>if (wasInited && !wasLeaf) {<NEW_LINE>prevSnapshot = hierarchy.snapshot();<NEW_LINE>}<NEW_LINE>hierarchy.detachFrom();<NEW_LINE>if (prevSnapshot != null && prevSnapshot.size() > 0) {<NEW_LINE>// set children to LEAF during firing<NEW_LINE>// (cur. snapshot is empty and we should be consistent with children)<NEW_LINE>hierarchy = Children.LEAF;<NEW_LINE>int[] idxs = Children.getSnapshotIdxs(prevSnapshot);<NEW_LINE>// fire remove event<NEW_LINE>fireSubNodesChangeIdx(false, idxs, null, Collections.<<MASK><NEW_LINE>}<NEW_LINE>hierarchy = ch;<NEW_LINE>hierarchy.attachTo(Node.this);<NEW_LINE>if (wasInited && !wasLeaf && hierarchy != Children.LEAF) {<NEW_LINE>// init new children if old was inited<NEW_LINE>hierarchy.getNodesCount();<NEW_LINE>// fire add event<NEW_LINE>List<Node> snapshot = hierarchy.snapshot();<NEW_LINE>if (snapshot.size() > 0) {<NEW_LINE>int[] idxs = Children.getSnapshotIdxs(snapshot);<NEW_LINE>fireSubNodesChangeIdx(true, idxs, null, snapshot, null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (wasLeaf != (hierarchy == Children.LEAF)) {<NEW_LINE>fireOwnPropertyChange(PROP_LEAF, wasLeaf, hierarchy == Children.LEAF);<NEW_LINE>}<NEW_LINE>} | Node>emptyList(), prevSnapshot); |
1,133,702 | void processInitiativeMessage(JsonObject json) {<NEW_LINE>InitiativeList ilist = initiativeListener.initiativeList;<NEW_LINE>String currentInit = Integer.toString(ilist.getCurrent());<NEW_LINE>String currentRound = Integer.toString(ilist.getRound());<NEW_LINE>// If there is a mismatch between client and us don't perform the command. This can happen<NEW_LINE>// because multiple<NEW_LINE>// people can be updating the initiative at the same time and its possible that two people might<NEW_LINE>// update the<NEW_LINE>// initiative at the same time.<NEW_LINE>if (!currentInit.equals(json.get("currentInitiative").getAsString()) || !currentRound.equals(json.get("currentRound").getAsString())) {<NEW_LINE>// FIXME: This needs to send a "can not do" message back to client.<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String command = json.get("command").getAsString();<NEW_LINE>if ("nextInitiative".equals(command)) {<NEW_LINE>System.out.println("DEBUG: got next initiative call" + json.toString());<NEW_LINE>if (canAdvanceInitiative()) {<NEW_LINE>// Trust a web client? You gotta be joking :)<NEW_LINE>ilist.nextInitiative();<NEW_LINE>}<NEW_LINE>} else if ("previousInitiative".equals(command)) {<NEW_LINE>if (canAdvanceInitiative()) {<NEW_LINE>// Trust a web client? You gotta be joking :)<NEW_LINE>ilist.prevInitiative();<NEW_LINE>}<NEW_LINE>} else if ("sortInitiative".equals(command)) {<NEW_LINE>ilist.sort();<NEW_LINE>} else if ("toggleHoldInitiative".equals(command)) {<NEW_LINE>InitiativeList.TokenInitiative tokenInit = null;<NEW_LINE>GUID id = new GUID(json.get("token").getAsString());<NEW_LINE>int tokenIndex = json.get("tokenIndex").getAsInt();<NEW_LINE>int index = 0;<NEW_LINE>for (InitiativeList.TokenInitiative ti : ilist.getTokens()) {<NEW_LINE>if (ti.getId().equals(id) && tokenIndex == index) {<NEW_LINE>System.out.println("DEBUG: Here, index = " + index + ", id = " + ti.getId());<NEW_LINE>tokenInit = ti;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>index++;<NEW_LINE>}<NEW_LINE>if (tokenInit == null) {<NEW_LINE>// FIXME: need to log this.<NEW_LINE>} else {<NEW_LINE>System.out.println("DEBUG: Here, changing holding on " + tokenInit.<MASK><NEW_LINE>tokenInit.setHolding(!tokenInit.isHolding());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// FIXME: need to log this.<NEW_LINE>}<NEW_LINE>} | getToken().getName()); |
953,183 | public void validate() throws WizardValidationException {<NEW_LINE>// XXX this is little strange. Since this method is called first time the panel appears.<NEW_LINE>// So we have to do this null check (data are uninitialized)<NEW_LINE>String prjFolder = getData().getProjectFolder();<NEW_LINE>if (prjFolder != null) {<NEW_LINE>File prjFolderF = new File(prjFolder);<NEW_LINE>String name = getData().getProjectName();<NEW_LINE>String pattern;<NEW_LINE>String forbiddenChars;<NEW_LINE>if (Utilities.isWindows()) {<NEW_LINE>// NOI18N<NEW_LINE>pattern = ".*[\\/:*?\"<>|].*";<NEW_LINE>// NOI18N<NEW_LINE>forbiddenChars = "\\ / : * ? \" < > |";<NEW_LINE>} else {<NEW_LINE>// NOI18N<NEW_LINE>pattern = ".*[\\/].*";<NEW_LINE>// NOI18N<NEW_LINE>forbiddenChars = "\\ /";<NEW_LINE>}<NEW_LINE>// #145574: check for forbidden characters in FolderObject<NEW_LINE>if (Pattern.matches(pattern, name)) {<NEW_LINE>String message = NbBundle.getMessage(BasicInfoWizardPanel.class, "MSG_ProjectFolderInvalidCharacters");<NEW_LINE>message = String.format(message, forbiddenChars);<NEW_LINE>throw new WizardValidationException(getVisualPanel(<MASK><NEW_LINE>}<NEW_LINE>if (prjFolderF.mkdir()) {<NEW_LINE>prjFolderF.delete();<NEW_LINE>} else {<NEW_LINE>String message = NbBundle.getMessage(BasicInfoWizardPanel.class, "MSG_UnableToCreateProjectFolder");<NEW_LINE>throw new WizardValidationException(getVisualPanel().nameValue, message, message);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ).nameValue, message, message); |
1,478,050 | public static int[] karatsubaMultiply(int[] a, int[] b) {<NEW_LINE>if (a.length < b.length)<NEW_LINE>a = Arrays.copyOf(a, b.length);<NEW_LINE>if (a.length > b.length)<NEW_LINE>b = Arrays.copyOf(b, a.length);<NEW_LINE>int n = a.length;<NEW_LINE>int[] res = new int[n + n];<NEW_LINE>if (n <= 10) {<NEW_LINE>for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) res[i + j] = res[i + j] + a[i] * b[j];<NEW_LINE>} else {<NEW_LINE>int k = n >> 1;<NEW_LINE>int[] a1 = Arrays.copyOfRange(a, 0, k);<NEW_LINE>int[] a2 = Arrays.copyOfRange(a, k, n);<NEW_LINE>int[] b1 = Arrays.copyOfRange(b, 0, k);<NEW_LINE>int[] b2 = Arrays.copyOfRange(b, k, n);<NEW_LINE>int[] a1b1 = karatsubaMultiply(a1, b1);<NEW_LINE>int[] a2b2 = karatsubaMultiply(a2, b2);<NEW_LINE>for (int i = 0; i < k; i++) a2[i] = a2[i] + a1[i];<NEW_LINE>for (int i = 0; i < k; i++) b2[i] = b2[i] + b1[i];<NEW_LINE>int[] r = karatsubaMultiply(a2, b2);<NEW_LINE>for (int i = 0; i < a1b1.length; i++) r[i] = r[i] - a1b1[i];<NEW_LINE>for (int i = 0; i < a2b2.length; i++) r[i] = r[i] - a2b2[i];<NEW_LINE>System.arraycopy(r, 0, <MASK><NEW_LINE>for (int i = 0; i < a1b1.length; i++) res[i] = res[i] + a1b1[i];<NEW_LINE>for (int i = 0; i < a2b2.length; i++) res[i + n] = res[i + n] + a2b2[i];<NEW_LINE>}<NEW_LINE>return res;<NEW_LINE>} | res, k, r.length); |
1,767,065 | private Mono<Response<Flux<ByteBuffer>>> deleteWithResponseAsync(String resourceGroupName, String systemTopicName, 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.<MASK><NEW_LINE>}<NEW_LINE>if (systemTopicName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter systemTopicName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, systemTopicName, this.client.getApiVersion(), context);<NEW_LINE>} | error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); |
1,776,381 | protected void appendComponentSlot(XStringBuilder xsb, JsonStringBuilder jsb, SofaTracerSpan span) {<NEW_LINE>Map<String, String> tagWithStr = span.getTagsWithStr();<NEW_LINE>xsb.append(tagWithStr.get(CommonSpanTags.MSG_ID));<NEW_LINE>xsb.append(tagWithStr.get(CommonSpanTags.MSG_TOPIC));<NEW_LINE>xsb.append(tagWithStr.get("broker"));<NEW_LINE>xsb.append(tagWithStr.get("status"));<NEW_LINE>xsb.append(tagWithStr.get("msgType"));<NEW_LINE>xsb.append(tagWithStr.get("bornHost"));<NEW_LINE>xsb.append<MASK><NEW_LINE>xsb.append(tagWithStr.get("producerGroup"));<NEW_LINE>if (StringUtils.isNotBlank(tagWithStr.get(Tags.ERROR.getKey()))) {<NEW_LINE>xsb.append(tagWithStr.get(Tags.ERROR.getKey()));<NEW_LINE>} else {<NEW_LINE>xsb.append(StringUtils.EMPTY_STRING);<NEW_LINE>}<NEW_LINE>} | (tagWithStr.get("brokerAddr")); |
1,800,565 | public static void terminate(ILaunch l) throws DebugException, CoreException {<NEW_LINE><MASK><NEW_LINE>// try {<NEW_LINE>if (conf != null && conf.getType().getIdentifier().equals(BootLaunchConfigurationDelegate.TYPE_ID) && BootLaunchConfigurationDelegate.canUseLifeCycle(conf)) {<NEW_LINE>SpringApplicationLifeCycleClientManager clientMgr = new SpringApplicationLifeCycleClientManager(l);<NEW_LINE>try {<NEW_LINE>SpringApplicationLifecycleClient client = clientMgr.getLifeCycleClient();<NEW_LINE>if (client != null) {<NEW_LINE>client.stop();<NEW_LINE>whenTerminated(l).get(BootLaunchConfigurationDelegate.getTerminationTimeoutAsLong(l), TimeUnit.MILLISECONDS);<NEW_LINE>// Success<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>// Nice termination failed. We'll ignore the exception and allow fallback to kick in.<NEW_LINE>// BootActivator.log(e);<NEW_LINE>} finally {<NEW_LINE>clientMgr.disposeClient();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Fallback to default implementation if 'nice termination' not available.<NEW_LINE>l.terminate();<NEW_LINE>// } catch (Exception e) {<NEW_LINE>// BootActivator.log(e);<NEW_LINE>// }<NEW_LINE>} | ILaunchConfiguration conf = l.getLaunchConfiguration(); |
962,946 | protected Object doMapFromContext(DirContextOperations ctx) {<NEW_LINE>if (resultFilter != null && !resultFilter.needSelect(ctx.getNameInNamespace())) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Map<String, Object> result = new HashMap<>();<NEW_LINE>result.put(LdapConstant.LDAP_DN_KEY, ctx.getNameInNamespace());<NEW_LINE>List<Object> list = new ArrayList<>();<NEW_LINE>result.put("attributes", list);<NEW_LINE>Attributes attributes = ctx.getAttributes();<NEW_LINE>NamingEnumeration it = attributes.getAll();<NEW_LINE>try {<NEW_LINE>while (it.hasMore()) {<NEW_LINE>list.<MASK><NEW_LINE>}<NEW_LINE>} catch (javax.naming.NamingException e) {<NEW_LINE>logger.error("query ldap entry attributes fail", e.getCause());<NEW_LINE>throw new OperationFailureException(operr("query ldap entry fail, %s", e.toString()));<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | add(it.next()); |
1,306,639 | private static int createIsland(CommandContext<CommandSourceStack> ctx) throws CommandSyntaxException {<NEW_LINE>ServerPlayer player = EntityArgument.getPlayer(ctx, "player");<NEW_LINE>SkyblockSavedData data = SkyblockSavedData<MASK><NEW_LINE>UUID uuid = player.getUUID();<NEW_LINE>if (data.skyblocks.containsValue(uuid)) {<NEW_LINE>doTeleportToIsland(ctx, player, uuid, new TranslatableComponent("botaniamisc.command.skyblock.island.teleported", ctx.getSource().getDisplayName()));<NEW_LINE>return Command.SINGLE_SUCCESS;<NEW_LINE>}<NEW_LINE>SkyblockWorldEvents.spawnPlayer(player, data.create(uuid));<NEW_LINE>ctx.getSource().sendSuccess(new TranslatableComponent("botaniamisc.command.skyblock.island.success", player.getDisplayName()), true);<NEW_LINE>return Command.SINGLE_SUCCESS;<NEW_LINE>} | .get(getSkyblockWorld(ctx)); |
866,071 | private void printStartupInfo() {<NEW_LINE>boolean corsEnabled = _config.getBoolean(WebServerConfig.WEBSERVER_HTTP_CORS_ENABLED_CONFIG);<NEW_LINE>String webApiUrlPrefix = _config.getString(WebServerConfig.WEBSERVER_API_URLPREFIX_CONFIG);<NEW_LINE>String uiUrlPrefix = _config.getString(WebServerConfig.WEBSERVER_UI_URLPREFIX_CONFIG);<NEW_LINE>String webDir = <MASK><NEW_LINE>String sessionPath = _config.getString(WebServerConfig.WEBSERVER_SESSION_PATH_CONFIG);<NEW_LINE>System.out.println(">> ********************************************* <<");<NEW_LINE>System.out.println(">> Application directory : " + System.getProperty("user.dir"));<NEW_LINE>System.out.println(">> REST API available on : " + webApiUrlPrefix);<NEW_LINE>System.out.println(">> Web UI available on : " + uiUrlPrefix);<NEW_LINE>System.out.println(">> Web UI Directory : " + webDir);<NEW_LINE>System.out.println(">> Cookie prefix path : " + sessionPath);<NEW_LINE>System.out.println(">> Kafka Cruise Control started on : " + serverUrl());<NEW_LINE>System.out.println(">> CORS Enabled ? : " + corsEnabled);<NEW_LINE>System.out.println(">> ********************************************* <<");<NEW_LINE>} | _config.getString(WebServerConfig.WEBSERVER_UI_DISKPATH_CONFIG); |
1,415,709 | private void showHeader() throws InstallException {<NEW_LINE>StringBuffer sb = new StringBuffer();<NEW_LINE>String settingsPath = FeatureUtilityProperties.getRepoPropertiesFile().getPath();<NEW_LINE><MASK><NEW_LINE>sb.append(PropertiesUtils.getMessage("MSG_FEATUREUTILITY_SETTTINGS")).append(InstallUtils.NEWLINE);<NEW_LINE>sb.append(PropertiesUtils.CmdlineConstants.DASHES).append(InstallUtils.NEWLINE);<NEW_LINE>sb.append(PropertiesUtils.getMessage("FIELD_PROPS_FILE", settingsPath));<NEW_LINE>sb.append(InstallUtils.NEWLINE);<NEW_LINE>String defaultRepoUseage = FeatureUtilityProperties.isUsingDefaultRepo() ? PropertiesUtils.getMessage("MSG_TRUE") : PropertiesUtils.getMessage("MSG_FALSE");<NEW_LINE>sb.append(PropertiesUtils.getMessage("MSG_DEFAULT_REPO_NAME_LABEL") + " " + PropertiesUtils.getMessage("MSG_DEFAULT_REPO_NAME")).append(InstallUtils.NEWLINE);<NEW_LINE>sb.append(PropertiesUtils.getMessage("MSG_DEFAULT_REPO_USEAGE_LABEL") + " " + defaultRepoUseage).append(InstallUtils.NEWLINE);<NEW_LINE>System.out.println(sb.toString());<NEW_LINE>} | sb.append(InstallUtils.NEWLINE); |
592,021 | public ODocument toNetworkStream() {<NEW_LINE>ODocument result = super.toNetworkStream();<NEW_LINE>result.setProperty("query", cfg.getQuery());<NEW_LINE>result.setProperty("updatable", cfg.isUpdatable());<NEW_LINE>List<Map<String, Object>> indexes = new ArrayList<>();<NEW_LINE>for (OViewConfig.OViewIndexConfig idx : cfg.indexes) {<NEW_LINE>Map<String, Object> indexDescriptor = new HashMap<>();<NEW_LINE>indexDescriptor.put("type", idx.type);<NEW_LINE>indexDescriptor.put("engine", idx.engine);<NEW_LINE>Map<String, String> <MASK><NEW_LINE>for (OPair<String, OType> s : idx.props) {<NEW_LINE>properties.put(s.key, s.value.toString());<NEW_LINE>}<NEW_LINE>indexDescriptor.put("properties", properties);<NEW_LINE>indexes.add(indexDescriptor);<NEW_LINE>}<NEW_LINE>result.setProperty("indexes", indexes);<NEW_LINE>result.setProperty("updateIntervalSeconds", cfg.getUpdateIntervalSeconds());<NEW_LINE>result.setProperty("updateStrategy", cfg.getUpdateStrategy());<NEW_LINE>result.setProperty("watchClasses", cfg.getWatchClasses());<NEW_LINE>result.setProperty("originRidField", cfg.getOriginRidField());<NEW_LINE>result.setProperty("nodes", cfg.getNodes());<NEW_LINE>result.setProperty("activeIndexNames", activeIndexNames);<NEW_LINE>result.setProperty("inactiveIndexNames", inactiveIndexNames);<NEW_LINE>return result;<NEW_LINE>} | properties = new HashMap<>(); |
1,472,824 | // BracesMatcherFactory implementation<NEW_LINE>public BracesMatcher createMatcher(final MatcherContext context) {<NEW_LINE>final JspBracesMatching[] ret = { null };<NEW_LINE>context.getDocument().render(new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>TokenHierarchy<Document> hierarchy = TokenHierarchy.get(context.getDocument());<NEW_LINE>List<TokenSequence<?>> ets = hierarchy.embeddedTokenSequences(context.getSearchOffset(), context.isSearchingBackward());<NEW_LINE>for (TokenSequence ts : ets) {<NEW_LINE>Language language = ts.language();<NEW_LINE>if (language == JspTokenId.language()) {<NEW_LINE>ret[0] = new JspBracesMatching(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>// We might be trying to search at the end or beginning of a document. In which<NEW_LINE>// case there is nothing to find and/or search through, so don't create a matcher.<NEW_LINE>// throw new IllegalStateException("No text/x-jsp language found on the MatcherContext's search offset! This should never happen!");<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return ret[0];<NEW_LINE>} | context, ts.languagePath()); |
1,225,887 | public void scanShieldedTRC20NotesByOvk(OvkDecryptTRC20Parameters request, StreamObserver<org.tron.api.GrpcAPI.DecryptNotesTRC20> responseObserver) {<NEW_LINE>long startNum = request.getStartBlockIndex();<NEW_LINE>long endNum = request.getEndBlockIndex();<NEW_LINE>try {<NEW_LINE>checkSupportShieldedTRC20Transaction();<NEW_LINE>DecryptNotesTRC20 decryptNotes = wallet.scanShieldedTRC20NotesByOvk(startNum, endNum, request.getOvk().toByteArray(), request.getShieldedTRC20ContractAddress().toByteArray(), request.getEventsList());<NEW_LINE>responseObserver.onNext(decryptNotes);<NEW_LINE>} catch (Exception e) {<NEW_LINE>responseObserver<MASK><NEW_LINE>logger.info("scanShieldedTRC20NotesByOvk exception caught: " + e.getMessage());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>responseObserver.onCompleted();<NEW_LINE>} | .onError(getRunTimeException(e)); |
861,704 | public boolean apply(Game game, Ability source) {<NEW_LINE>Player controller = game.getPlayer(source.getControllerId());<NEW_LINE>MageObject sourceObject = game.getObject(source);<NEW_LINE>if (controller == null || controller.getHand().isEmpty() || sourceObject == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Card cardToReveal = null;<NEW_LINE>Target target = new TargetCardInHand(StaticFilters.FILTER_CARD_CREATURE);<NEW_LINE>target.setNotTarget(true);<NEW_LINE>if (controller.chooseTarget(outcome, target, source, game)) {<NEW_LINE>cardToReveal = game.<MASK><NEW_LINE>}<NEW_LINE>if (cardToReveal == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>controller.revealCards("from hand :" + sourceObject.getName(), new CardsImpl(cardToReveal), game);<NEW_LINE>String nameToSearch = CardUtil.getCardNameForSameNameSearch(cardToReveal);<NEW_LINE>FilterCard filterCard = new FilterCard("card named " + nameToSearch);<NEW_LINE>filterCard.add(new NamePredicate(nameToSearch));<NEW_LINE>return new SearchLibraryPutInHandEffect(new TargetCardInLibrary(filterCard), true, true).apply(game, source);<NEW_LINE>} | getCard(target.getFirstTarget()); |
1,496,915 | public void onEnable() {<NEW_LINE>final PluginManager pm = getServer().getPluginManager();<NEW_LINE>final IEssentials ess = (IEssentials) pm.getPlugin("Essentials");<NEW_LINE>if (!this.getDescription().getVersion().equals(ess.getDescription().getVersion())) {<NEW_LINE>getLogger().log(Level.WARNING, tl("versionMismatchAll"));<NEW_LINE>}<NEW_LINE>if (!ess.isEnabled()) {<NEW_LINE>this.setEnabled(false);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Logger.getLogger(com.fasterxml.jackson.databind.ext.Java7Support.class.getName()).setLevel(Level.SEVERE);<NEW_LINE>final EssentialsGeoIPPlayerListener playerListener = new EssentialsGeoIPPlayerListener(getDataFolder(), ess);<NEW_LINE><MASK><NEW_LINE>getLogger().log(Level.INFO, "This product includes GeoLite2 data created by MaxMind, available from http://www.maxmind.com/.");<NEW_LINE>if (metrics == null) {<NEW_LINE>metrics = new MetricsWrapper(this, 3815, false);<NEW_LINE>}<NEW_LINE>} | pm.registerEvents(playerListener, this); |
1,288,960 | public void updateASI() {<NEW_LINE>final Object sourceModel = getSourceModel();<NEW_LINE>final IAttributeSetInstanceAware asiAware = attributeSetInstanceAwareFactoryService.createOrNull(sourceModel);<NEW_LINE>if (asiAware == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (asiAware.getM_Product_ID() <= 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final IAttributeDAO attributesRepo = Services.get(IAttributeDAO.class);<NEW_LINE>final AttributeId expiredAttribute = <MASK><NEW_LINE>if (expiredAttribute == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final ProductId productId = ProductId.ofRepoId(asiAware.getM_Product_ID());<NEW_LINE>final I_M_Attribute attribute = attributesBL.getAttributeOrNull(productId, expiredAttribute);<NEW_LINE>if (attribute == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>attributeSetInstanceBL.getCreateASI(asiAware);<NEW_LINE>final AttributeSetInstanceId asiId = AttributeSetInstanceId.ofRepoId(asiAware.getM_AttributeSetInstance_ID());<NEW_LINE>final I_M_AttributeInstance ai = attributeDAO.retrieveAttributeInstance(asiId, expiredAttribute);<NEW_LINE>if (ai != null) {<NEW_LINE>// If it was set, just leave it as it is<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>attributeSetInstanceBL.getCreateAttributeInstance(asiId, expiredAttribute);<NEW_LINE>} | attributesRepo.retrieveAttributeIdByValueOrNull(HUAttributeConstants.ATTR_Expired); |
277,785 | private void analyzeShape() {<NEW_LINE>// Simple minded analysis for code assist & potential compatibility.<NEW_LINE>class ShapeComputer extends ASTVisitor {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean visit(TypeDeclaration type, BlockScope skope) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean visit(TypeDeclaration type, ClassScope skope) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean visit(LambdaExpression type, BlockScope skope) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean visit(ReturnStatement returnStatement, BlockScope skope) {<NEW_LINE>if (returnStatement.expression != null) {<NEW_LINE>LambdaExpression.this.valueCompatible = true;<NEW_LINE>LambdaExpression.this.voidCompatible = false;<NEW_LINE>LambdaExpression.this.returnsValue = true;<NEW_LINE>} else {<NEW_LINE>LambdaExpression.this.voidCompatible = true;<NEW_LINE>LambdaExpression.this.valueCompatible = false;<NEW_LINE>LambdaExpression.this.returnsVoid = true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (this.body instanceof Expression) {<NEW_LINE>// When completion is still in progress, it is not possible to ask if the expression constitutes a statement expression. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=435219<NEW_LINE>this.voidCompatible = this.assistNode ? true : ((Expression) this.body).statementExpression();<NEW_LINE>// expression could be of type void - we can't determine that as we are working with unresolved expressions, for potential compatibility it is OK.<NEW_LINE>this.valueCompatible = true;<NEW_LINE>} else {<NEW_LINE>// For code assist, we need to be a bit tolerant/fuzzy here: the code is being written "just now", if we are too pedantic, selection/completion will break;<NEW_LINE>if (this.assistNode) {<NEW_LINE>this.voidCompatible = true;<NEW_LINE>this.valueCompatible = true;<NEW_LINE>}<NEW_LINE>this.body.traverse<MASK><NEW_LINE>if (!this.returnsValue && !this.returnsVoid)<NEW_LINE>this.valueCompatible = this.body.doesNotCompleteNormally();<NEW_LINE>}<NEW_LINE>} | (new ShapeComputer(), null); |
513,468 | // Draws the bounding box around the detected faces.<NEW_LINE>public void paintComponent(Graphics g) {<NEW_LINE>float left = 0;<NEW_LINE>float top = 0;<NEW_LINE>int <MASK><NEW_LINE>int width = image.getWidth(this);<NEW_LINE>// Create a Java2D version of g.<NEW_LINE>Graphics2D g2d = (Graphics2D) g;<NEW_LINE>// Draw the image<NEW_LINE>g2d.drawImage(image, 0, 0, width / scale, height / scale, this);<NEW_LINE>g2d.setColor(new Color(0, 212, 0));<NEW_LINE>// Iterate through the faces and display bounding boxes.<NEW_LINE>List<FaceDetail> faceDetails = result.faceDetails();<NEW_LINE>for (FaceDetail face : faceDetails) {<NEW_LINE>BoundingBox box = face.boundingBox();<NEW_LINE>left = width * box.left();<NEW_LINE>top = height * box.top();<NEW_LINE>g2d.drawRect(Math.round(left / scale), Math.round(top / scale), Math.round((width * box.width()) / scale), Math.round((height * box.height())) / scale);<NEW_LINE>}<NEW_LINE>} | height = image.getHeight(this); |
1,439,858 | public String toEnumVarName(String name, String datatype) {<NEW_LINE>if (name.length() == 0) {<NEW_LINE>return "empty";<NEW_LINE>}<NEW_LINE>if (enumUnknownDefaultCase) {<NEW_LINE>if (name.equals(enumUnknownDefaultCaseName)) {<NEW_LINE>return camelize(name, true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Reserved Name<NEW_LINE>String <MASK><NEW_LINE>if (isReservedWord(nameLowercase)) {<NEW_LINE>return escapeReservedWord(nameLowercase);<NEW_LINE>}<NEW_LINE>// Prefix with underscore if name starts with number<NEW_LINE>if (name.matches("\\d.*")) {<NEW_LINE>return "_" + replaceSpecialCharacters(camelize(name, true));<NEW_LINE>}<NEW_LINE>// for symbol, e.g. $, #<NEW_LINE>if (getSymbolName(name) != null) {<NEW_LINE>return camelize(WordUtils.capitalizeFully(getSymbolName(name).toUpperCase(Locale.ROOT)), true);<NEW_LINE>}<NEW_LINE>// Camelize only when we have a structure defined below<NEW_LINE>Boolean camelized = false;<NEW_LINE>if (name.matches("[A-Z][a-z0-9]+[a-zA-Z0-9]*")) {<NEW_LINE>name = camelize(name, true);<NEW_LINE>camelized = true;<NEW_LINE>}<NEW_LINE>// Check for numerical conversions<NEW_LINE>if ("Int".equals(datatype) || "Int32".equals(datatype) || "Int64".equals(datatype) || "Float".equals(datatype) || "Double".equals(datatype)) {<NEW_LINE>String varName = "number" + camelize(name);<NEW_LINE>return replaceSpecialCharacters(varName);<NEW_LINE>}<NEW_LINE>// If we have already camelized the word, don't progress<NEW_LINE>// any further<NEW_LINE>if (camelized) {<NEW_LINE>return replaceSpecialCharacters(name);<NEW_LINE>}<NEW_LINE>char[] separators = { '-', '_', ' ', ':', '(', ')' };<NEW_LINE>return camelize(replaceSpecialCharacters(WordUtils.capitalizeFully(StringUtils.lowerCase(name), separators).replaceAll("[-_ :\\(\\)]", "")), true);<NEW_LINE>} | nameLowercase = StringUtils.lowerCase(name); |
365,900 | public GetProtocolsListResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>GetProtocolsListResult getProtocolsListResult = new GetProtocolsListResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return getProtocolsListResult;<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("ProtocolsList", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getProtocolsListResult.setProtocolsList(ProtocolsListDataJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("ProtocolsListArn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getProtocolsListResult.setProtocolsListArn(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 getProtocolsListResult;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
835,877 | public ViewHolderProvider onCreateViewHolder(ViewGroup parent, int viewType) {<NEW_LINE>logDebug("onCreateViewHolder");<NEW_LINE>Display display = ((Activity) context).getWindowManager().getDefaultDisplay();<NEW_LINE>DisplayMetrics outMetrics = new DisplayMetrics();<NEW_LINE>display.getMetrics(outMetrics);<NEW_LINE>View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_file_explorer, parent, false);<NEW_LINE>holder = new ViewHolderProvider(v);<NEW_LINE>holder.itemLayout = (RelativeLayout) v.findViewById(R.id.file_explorer_item_layout);<NEW_LINE>holder.itemLayout.setOnClickListener(this);<NEW_LINE>holder.itemLayout.setOnLongClickListener(this);<NEW_LINE>holder.imageView = (ImageView) v.findViewById(R.id.file_explorer_thumbnail);<NEW_LINE>holder.textViewFileName = (TextView) v.<MASK><NEW_LINE>holder.textViewFileName.setOnClickListener(this);<NEW_LINE>holder.textViewFileName.setOnLongClickListener(this);<NEW_LINE>holder.textViewFileName.setTag(holder);<NEW_LINE>holder.textViewFileSize = (TextView) v.findViewById(R.id.file_explorer_filesize);<NEW_LINE>holder.permissionsIcon = (ImageView) v.findViewById(R.id.file_explorer_permissions);<NEW_LINE>if (context.getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {<NEW_LINE>holder.textViewFileSize.setMaxWidth(scaleWidthPx(260, outMetrics));<NEW_LINE>} else {<NEW_LINE>holder.textViewFileSize.setMaxWidth(scaleWidthPx(200, outMetrics));<NEW_LINE>}<NEW_LINE>v.setTag(holder);<NEW_LINE>return holder;<NEW_LINE>} | findViewById(R.id.file_explorer_filename); |
1,333,669 | public void testCriteriaQuery_Character(TestExecutionContext testExecCtx, TestExecutionResources testExecResources, Object managedComponentObject) throws Throwable {<NEW_LINE>final String testName = getTestName();<NEW_LINE>// Verify parameters<NEW_LINE>if (testExecCtx == null || testExecResources == null) {<NEW_LINE>Assert.fail(testName + ": Missing context and/or resources. Cannot execute the test.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final JPAResource jpaResource = testExecResources.getJpaResourceMap().get("test-jpa-resource");<NEW_LINE>if (jpaResource == null) {<NEW_LINE>Assert.fail("Missing JPAResource 'test-jpa-resource'). Cannot execute the test.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Process Test Properties<NEW_LINE>final Map<String, Serializable> testProps = testExecCtx.getProperties();<NEW_LINE>if (testProps != null) {<NEW_LINE>for (String key : testProps.keySet()) {<NEW_LINE>System.out.println("Test Property: " + key + " = " <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>EntityManager em = jpaResource.getEm();<NEW_LINE>TransactionJacket tx = jpaResource.getTj();<NEW_LINE>// Execute Test Case<NEW_LINE>try {<NEW_LINE>tx.beginTransaction();<NEW_LINE>if (jpaResource.getPcCtxInfo().getPcType() == PersistenceContextType.APPLICATION_MANAGED_JTA)<NEW_LINE>em.joinTransaction();<NEW_LINE>CriteriaBuilder cb = em.getCriteriaBuilder();<NEW_LINE>CriteriaQuery<Entity0004> cq = cb.createQuery(Entity0004.class);<NEW_LINE>Root<Entity0004> root = cq.from(Entity0004.class);<NEW_LINE>cq.select(root);<NEW_LINE>TypedQuery<Entity0004> tq = em.createQuery(cq);<NEW_LINE>Entity0004 findEntity = tq.getSingleResult();<NEW_LINE>System.out.println("Object returned by query: " + findEntity);<NEW_LINE>assertNotNull("Did not find entity in criteria query", findEntity);<NEW_LINE>assertTrue("Entity returned by find was not contained in the persistence context.", em.contains(findEntity));<NEW_LINE>assertEquals(new Character('b'), findEntity.getEntity0004_id());<NEW_LINE>assertEquals(findEntity.getEntity0004_string01(), "Entity0004_STRING01");<NEW_LINE>assertEquals(findEntity.getEntity0004_string02(), "Entity0004_STRING02");<NEW_LINE>assertEquals(findEntity.getEntity0004_string03(), "Entity0004_STRING03");<NEW_LINE>tx.commitTransaction();<NEW_LINE>} finally {<NEW_LINE>System.out.println(testName + ": End");<NEW_LINE>}<NEW_LINE>} | + testProps.get(key)); |
1,334,286 | private List<PrimaryStorageVO> allocateAll(PrimaryStorageAllocationSpec spec) {<NEW_LINE>class Result {<NEW_LINE><NEW_LINE>List<PrimaryStorageVO> result;<NEW_LINE><NEW_LINE>ErrorCode errorCode;<NEW_LINE>}<NEW_LINE>final Result ret = new Result();<NEW_LINE><MASK><NEW_LINE>allocatorChain.setName(String.format("allocate-primary-storage-msg-%s", spec.getAllocationMessage().getId()));<NEW_LINE>allocatorChain.setData(map(e(AllocatorParams.SPEC, spec)));<NEW_LINE>allocatorChain.done(new FlowDoneHandler(null) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void handle(Map data) {<NEW_LINE>ret.result = (List<PrimaryStorageVO>) data.get(AllocatorParams.CANDIDATES);<NEW_LINE>}<NEW_LINE>}).error(new FlowErrorHandler(null) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void handle(ErrorCode errCode, Map data) {<NEW_LINE>ret.errorCode = errCode;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>tracker.trackAllocatorChain(allocatorChain);<NEW_LINE>allocatorChain.start();<NEW_LINE>if (ret.errorCode != null) {<NEW_LINE>throw new OperationFailureException(ret.errorCode);<NEW_LINE>} else {<NEW_LINE>return ret.result;<NEW_LINE>}<NEW_LINE>} | FlowChain allocatorChain = allocateBuilder.build(); |
1,604,164 | public Explanation.Code includes(final AclRule rule, final Map<String, String> resource, final String action) {<NEW_LINE>// evaluate type<NEW_LINE>if (rule.getResourceType() != null) {<NEW_LINE>String resType = resource.get("type");<NEW_LINE>if (null == resType || !rule.getResourceType().equals(resType)) {<NEW_LINE>return Explanation.Code.REJECTED;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// evaluate match:<NEW_LINE>boolean matched = true;<NEW_LINE>boolean tested = false;<NEW_LINE>if (rule.isRegexMatch()) {<NEW_LINE>tested = true;<NEW_LINE>matched &= ruleMatchesMatchSection(resource, rule);<NEW_LINE>}<NEW_LINE>if (rule.isEqualsMatch()) {<NEW_LINE>tested = true;<NEW_LINE>matched &= ruleMatchesEqualsSection(resource, rule);<NEW_LINE>}<NEW_LINE>if (rule.isContainsMatch()) {<NEW_LINE>tested = true;<NEW_LINE>matched &= ruleMatchesContainsSection(resource, rule);<NEW_LINE>}<NEW_LINE>if (rule.isSubsetMatch()) {<NEW_LINE>tested = true;<NEW_LINE>matched &= ruleMatchesSubsetSection(resource, rule);<NEW_LINE>}<NEW_LINE>if (tested) {<NEW_LINE>return matched ? allowOrDenyAction(rule, <MASK><NEW_LINE>} else {<NEW_LINE>// no resource matching defined, matches all resources of this type.<NEW_LINE>return allowOrDenyAction(rule, action);<NEW_LINE>}<NEW_LINE>} | action) : Explanation.Code.REJECTED; |
775,030 | private void checkType(Element type) {<NEW_LINE>if (type instanceof TypeElement) {<NEW_LINE>String name = type.getSimpleName().toString();<NEW_LINE>if (!names.contains(name)) {<NEW_LINE>names.add(name);<NEW_LINE>ModuleImportDescriptor moduleImport = getModuleImportDescriptor<MASK><NEW_LINE>if (moduleImport != null) {<NEW_LINE>useModule(false, moduleImport.isDirect(), moduleImport.getTargetPackage(), null, moduleImport.getImportedName(), moduleImport.getPathToImportedClass(), moduleImport.getImportedClass());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (type instanceof ExecutableElement) {<NEW_LINE>String name = type.getSimpleName().toString();<NEW_LINE>if (!names.contains(name)) {<NEW_LINE>names.add(name);<NEW_LINE>ModuleImportDescriptor moduleImport = getModuleImportDescriptor(name, (TypeElement) type.getEnclosingElement());<NEW_LINE>if (moduleImport != null) {<NEW_LINE>useModule(false, moduleImport.isDirect(), moduleImport.getTargetPackage(), null, moduleImport.getImportedName(), moduleImport.getPathToImportedClass(), moduleImport.getImportedClass());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | (name, (TypeElement) type); |
237,426 | public static DescribeBlockedRegionsResponse unmarshall(DescribeBlockedRegionsResponse describeBlockedRegionsResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeBlockedRegionsResponse.setRequestId<MASK><NEW_LINE>List<InfoItem> infoList = new ArrayList<InfoItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeBlockedRegionsResponse.InfoList.Length"); i++) {<NEW_LINE>InfoItem infoItem = new InfoItem();<NEW_LINE>infoItem.setCountriesAndRegions(_ctx.stringValue("DescribeBlockedRegionsResponse.InfoList[" + i + "].CountriesAndRegions"));<NEW_LINE>infoItem.setCountriesAndRegionsName(_ctx.stringValue("DescribeBlockedRegionsResponse.InfoList[" + i + "].CountriesAndRegionsName"));<NEW_LINE>infoItem.setContinent(_ctx.stringValue("DescribeBlockedRegionsResponse.InfoList[" + i + "].Continent"));<NEW_LINE>infoList.add(infoItem);<NEW_LINE>}<NEW_LINE>describeBlockedRegionsResponse.setInfoList(infoList);<NEW_LINE>return describeBlockedRegionsResponse;<NEW_LINE>} | (_ctx.stringValue("DescribeBlockedRegionsResponse.RequestId")); |
936,592 | private void searchServices(FileObject folder, Map<ServiceType, DataObject> services) {<NEW_LINE>FileObject[] fobjs = folder.getChildren();<NEW_LINE>for (int i = 0; i < fobjs.length; i++) {<NEW_LINE>if (!fobjs[i].isValid())<NEW_LINE>continue;<NEW_LINE>if (fobjs[i].isFolder()) {<NEW_LINE>searchServices(fobjs[i], services);<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>DataObject dobj = DataObject.find(fobjs[i]);<NEW_LINE>InstanceCookie inst = (InstanceCookie) dobj.getCookie(InstanceCookie.class);<NEW_LINE>if (inst == null)<NEW_LINE>continue;<NEW_LINE>if (instanceOf(inst, ServiceType.class)) {<NEW_LINE>ServiceType ser = <MASK><NEW_LINE>services.put(ser, dobj);<NEW_LINE>}<NEW_LINE>} catch (DataObjectNotFoundException ex) {<NEW_LINE>} catch (Exception ex) {<NEW_LINE>Logger.getLogger(Services.class.getName()).log(Level.WARNING, null, ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | (ServiceType) inst.instanceCreate(); |
903,894 | // Main program does the requisite IO gymnastics<NEW_LINE>public static void main(final String[] args) {<NEW_LINE>F<String, BufferedReader> z = fileName -> {<NEW_LINE>try {<NEW_LINE>return new BufferedReader(new FileReader(new File(fileName)));<NEW_LINE>} catch (FileNotFoundException e) {<NEW_LINE>throw new Error(e);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>final List<Stream<Character>> documents = list(args).map(z.andThen(new F<BufferedReader, Stream<Character>>() {<NEW_LINE><NEW_LINE>public Stream<Character> f(final BufferedReader reader) {<NEW_LINE>final Option<String> s;<NEW_LINE>try {<NEW_LINE>s = fromNull(reader.readLine());<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new Error(e);<NEW_LINE>}<NEW_LINE>if (s.isSome())<NEW_LINE>return fromString(s.some()).append(<MASK><NEW_LINE>else {<NEW_LINE>try {<NEW_LINE>reader.close();<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new Error(e);<NEW_LINE>}<NEW_LINE>return Stream.nil();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}));<NEW_LINE>final ExecutorService pool = newFixedThreadPool(16);<NEW_LINE>final ParModule m = parModule(Strategy.executorStrategy(pool));<NEW_LINE>System.out.println("Word Count: " + countWords(documents, m).claim());<NEW_LINE>pool.shutdown();<NEW_LINE>} | () -> f(reader)); |
537,296 | private InitiateAuthRequest initiateUserSrpAuthRequest(final Map<String, String> clientMetadata, AuthenticationDetails authenticationDetails, AuthenticationHelper authenticationHelper) {<NEW_LINE>userId = authenticationDetails.getUserId();<NEW_LINE>final InitiateAuthRequest initiateAuthRequest = new InitiateAuthRequest();<NEW_LINE>initiateAuthRequest.setAuthFlow(CognitoServiceConstants.AUTH_TYPE_INIT_USER_SRP);<NEW_LINE>initiateAuthRequest.setClientId(clientId);<NEW_LINE>initiateAuthRequest.setClientMetadata(clientMetadata);<NEW_LINE>initiateAuthRequest.addAuthParametersEntry(CognitoServiceConstants.AUTH_PARAM_SECRET_HASH, CognitoSecretHash.getSecretHash(userId, clientId, clientSecret));<NEW_LINE>initiateAuthRequest.addAuthParametersEntry(CognitoServiceConstants.AUTH_PARAM_USERNAME, authenticationDetails.getUserId());<NEW_LINE>initiateAuthRequest.addAuthParametersEntry(CognitoServiceConstants.AUTH_PARAM_SRP_A, authenticationHelper.getA().toString(SRP_RADIX));<NEW_LINE>if (deviceKey == null) {<NEW_LINE>initiateAuthRequest.addAuthParametersEntry(CognitoServiceConstants.AUTH_PARAM_DEVICE_KEY, CognitoDeviceHelper.getDeviceKey(authenticationDetails.getUserId(), pool<MASK><NEW_LINE>} else {<NEW_LINE>initiateAuthRequest.addAuthParametersEntry(CognitoServiceConstants.AUTH_PARAM_DEVICE_KEY, deviceKey);<NEW_LINE>}<NEW_LINE>if (authenticationDetails.getValidationData() != null && authenticationDetails.getValidationData().size() > 0) {<NEW_LINE>final Map<String, String> userValidationData = new HashMap<String, String>();<NEW_LINE>for (final AttributeType attribute : authenticationDetails.getValidationData()) {<NEW_LINE>userValidationData.put(attribute.getName(), attribute.getValue());<NEW_LINE>}<NEW_LINE>initiateAuthRequest.setClientMetadata(userValidationData);<NEW_LINE>}<NEW_LINE>final String pinpointEndpointId = this.pool.getPinpointEndpointId();<NEW_LINE>if (pinpointEndpointId != null) {<NEW_LINE>AnalyticsMetadataType amd = new AnalyticsMetadataType();<NEW_LINE>amd.setAnalyticsEndpointId(pinpointEndpointId);<NEW_LINE>initiateAuthRequest.setAnalyticsMetadata(amd);<NEW_LINE>}<NEW_LINE>initiateAuthRequest.setUserContextData(getUserContextData());<NEW_LINE>return initiateAuthRequest;<NEW_LINE>} | .getUserPoolId(), context)); |
337,173 | public static void addIbmClientAddressHeader(Message message, SIPConnection connection, ListeningPoint lpoint) throws IllegalArgumentException, SipParseException {<NEW_LINE>CharsBuffer ibmClientAddressBuffer = m_ibmClientAddressBuffers.get();<NEW_LINE>if (ibmClientAddressBuffer == null) {<NEW_LINE>ibmClientAddressBuffer = new CharsBuffer();<NEW_LINE>m_ibmClientAddressBuffers.set(ibmClientAddressBuffer);<NEW_LINE>}<NEW_LINE>// IBM-Client-Address: r.e.m.ote:5555;local-address=l.o.c.al:5060<NEW_LINE>if (message.getHeader(IBM_CLIENT_ADDRESS, true) != null) {<NEW_LINE>// already added by the SLSP<NEW_LINE>if (c_logger.isTraceDebugEnabled()) {<NEW_LINE>c_logger.traceDebug(<MASK><NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String localHost = lpoint.getHost();<NEW_LINE>int localPort = lpoint.getPort();<NEW_LINE>String transport = lpoint.getTransport();<NEW_LINE>String remoteHost;<NEW_LINE>int remotePort;<NEW_LINE>if (connection != null) {<NEW_LINE>remoteHost = connection.getRemoteHost();<NEW_LINE>remotePort = connection.getRemotePort();<NEW_LINE>} else {<NEW_LINE>remoteHost = localHost;<NEW_LINE>remotePort = localPort;<NEW_LINE>}<NEW_LINE>ibmClientAddressBuffer.reset();<NEW_LINE>ibmClientAddressBuffer.append(remoteHost).append(':').append(remotePort);<NEW_LINE>ibmClientAddressBuffer.append(";local-address=");<NEW_LINE>ibmClientAddressBuffer.append(localHost).append(':').append(localPort);<NEW_LINE>ibmClientAddressBuffer.append(";").append(transport);<NEW_LINE>char[] buffer = ibmClientAddressBuffer.getCharArray();<NEW_LINE>int length = ibmClientAddressBuffer.getCharCount();<NEW_LINE>CharArray array = CharArray.getFromPool(buffer, 0, length);<NEW_LINE>HeaderImpl ibmClientAddressHeader = HeaderCreator.createHeader(IBM_CLIENT_ADDRESS);<NEW_LINE>ibmClientAddressHeader.setValue(array);<NEW_LINE>// returns the CharArray back to the pool<NEW_LINE>ibmClientAddressHeader.parse();<NEW_LINE>message.addHeader(ibmClientAddressHeader, true);<NEW_LINE>if (c_logger.isTraceDebugEnabled()) {<NEW_LINE>c_logger.traceDebug(SIPStackUtil.class, "SIPStackUtil addIbmClientAddressHeader", "IBM-Client-Address: " + ibmClientAddressHeader);<NEW_LINE>}<NEW_LINE>} | SIPStackUtil.class, "SIPStackUtil addIbmClientAddressHeader", "IBM-Client-Address already added"); |
1,132,137 | public void decorateWithCastForReturn(AExpression userExpressionNode, AStatement parent, SemanticScope semanticScope, ScriptClassInfo scriptClassInfo) {<NEW_LINE>Location location = userExpressionNode.getLocation();<NEW_LINE>Class<?> valueType = semanticScope.getDecoration(userExpressionNode, Decorations.ValueType.class).getValueType();<NEW_LINE>Class<?> targetType = semanticScope.getDecoration(userExpressionNode, TargetType.class).getTargetType();<NEW_LINE>PainlessCast painlessCast;<NEW_LINE>if (valueType == def.class) {<NEW_LINE>if (scriptClassInfo.defConverter != null) {<NEW_LINE>semanticScope.putDecoration(parent, new Decorations.Converter(scriptClassInfo.defConverter));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>for (LocalFunction converter : scriptClassInfo.converters) {<NEW_LINE>try {<NEW_LINE>painlessCast = AnalyzerCaster.getLegalCast(location, valueType, converter.getTypeParameters().get<MASK><NEW_LINE>if (painlessCast != null) {<NEW_LINE>semanticScope.putDecoration(userExpressionNode, new ExpressionPainlessCast(painlessCast));<NEW_LINE>}<NEW_LINE>semanticScope.putDecoration(parent, new Decorations.Converter(converter));<NEW_LINE>return;<NEW_LINE>} catch (ClassCastException e) {<NEW_LINE>// Do nothing, we're checking all converters<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>boolean isExplicitCast = semanticScope.getCondition(userExpressionNode, Decorations.Explicit.class);<NEW_LINE>boolean isInternalCast = semanticScope.getCondition(userExpressionNode, Internal.class);<NEW_LINE>painlessCast = AnalyzerCaster.getLegalCast(location, valueType, targetType, isExplicitCast, isInternalCast);<NEW_LINE>if (painlessCast != null) {<NEW_LINE>semanticScope.putDecoration(userExpressionNode, new ExpressionPainlessCast(painlessCast));<NEW_LINE>}<NEW_LINE>} | (0), false, true); |
731,923 | private Comparator<Row> comparator(RelFieldCollation fieldCollation) {<NEW_LINE>final int nullComparison = fieldCollation.nullDirection.nullComparison;<NEW_LINE>final int x = fieldCollation.getFieldIndex();<NEW_LINE>switch(fieldCollation.direction) {<NEW_LINE>case ASCENDING:<NEW_LINE>return (o1, o2) -> {<NEW_LINE>final Comparable c1 = (Comparable) o1.getValues()[x];<NEW_LINE>final Comparable c2 = (Comparable) <MASK><NEW_LINE>return RelFieldCollation.compare(c1, c2, nullComparison);<NEW_LINE>};<NEW_LINE>default:<NEW_LINE>return (o1, o2) -> {<NEW_LINE>final Comparable c1 = (Comparable) o1.getValues()[x];<NEW_LINE>final Comparable c2 = (Comparable) o2.getValues()[x];<NEW_LINE>return RelFieldCollation.compare(c2, c1, -nullComparison);<NEW_LINE>};<NEW_LINE>}<NEW_LINE>} | o2.getValues()[x]; |
351,388 | private static void createPyMethods() {<NEW_LINE>String clazz = className.substring(className.lastIndexOf(".") + 1);<NEW_LINE>String[] docItems = null;<NEW_LINE>for (List<String> functionDoc : functionDocs) {<NEW_LINE>String function = functionDoc.get(0);<NEW_LINE>String docReturn = "";<NEW_LINE>Map<String, String> <MASK><NEW_LINE>String doc = functionDoc.get(1);<NEW_LINE>docItems = doc.split("\\n @");<NEW_LINE>if (docItems.length > 1) {<NEW_LINE>String pyDoc = docItems[0].substring(4);<NEW_LINE>for (int n = 1; n < docItems.length; n++) {<NEW_LINE>String item = docItems[n];<NEW_LINE>if (item.startsWith("return ")) {<NEW_LINE>docReturn = item.substring(7);<NEW_LINE>} else if (item.startsWith("param ")) {<NEW_LINE>String[] strings = item.substring(6).split("\\s");<NEW_LINE>docParams.put(strings[0], item.substring(6 + strings[0].length() + 1));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>p("");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | docParams = new LinkedHashMap<>(); |
1,740,163 | final ModifyFleetResult executeModifyFleet(ModifyFleetRequest modifyFleetRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(modifyFleetRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ModifyFleetRequest> request = null;<NEW_LINE>Response<ModifyFleetResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new ModifyFleetRequestMarshaller().marshall(super.beforeMarshalling(modifyFleetRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ModifyFleet");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<ModifyFleetResult> responseHandler = new StaxResponseHandler<ModifyFleetResult>(new ModifyFleetResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.RequestMarshallTime); |
931,062 | public final <K> Map<K, ?> toMap(Supplier<? extends K> keySupplier1, Supplier<? extends K> keySupplier2, Supplier<? extends K> keySupplier3, Supplier<? extends K> keySupplier4, Supplier<? extends K> keySupplier5, Supplier<? extends K> keySupplier6, Supplier<? extends K> keySupplier7, Supplier<? extends K> keySupplier8, Supplier<? extends K> keySupplier9, Supplier<? extends K> keySupplier10, Supplier<? extends K> keySupplier11) {<NEW_LINE>Map<K, Object> result = new LinkedHashMap<>();<NEW_LINE>result.put(keySupplier1.get(), v1);<NEW_LINE>result.put(keySupplier2.get(), v2);<NEW_LINE>result.put(keySupplier3.get(), v3);<NEW_LINE>result.put(<MASK><NEW_LINE>result.put(keySupplier5.get(), v5);<NEW_LINE>result.put(keySupplier6.get(), v6);<NEW_LINE>result.put(keySupplier7.get(), v7);<NEW_LINE>result.put(keySupplier8.get(), v8);<NEW_LINE>result.put(keySupplier9.get(), v9);<NEW_LINE>result.put(keySupplier10.get(), v10);<NEW_LINE>result.put(keySupplier11.get(), v11);<NEW_LINE>return result;<NEW_LINE>} | keySupplier4.get(), v4); |
1,583,498 | protected DataViewComponent createComponent() {<NEW_LINE>JFRModel model = getModel();<NEW_LINE>masterView = new SocketIOViewSupport.MasterViewSupport(model) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>void firstShown() {<NEW_LINE>changeAggregation(SocketIOViewSupport.Aggregation.ADDRESS_PORT, SocketIOViewSupport.Aggregation.NONE);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>void changeAggregation(SocketIOViewSupport.Aggregation primary, SocketIOViewSupport.Aggregation secondary) {<NEW_LINE>JFRSnapshotSocketIOView.<MASK><NEW_LINE>}<NEW_LINE>};<NEW_LINE>boolean hasEvents = model != null && model.containsEvent(JFRSnapshotSocketIOViewProvider.EventChecker.class);<NEW_LINE>dvc = new DataViewComponent(masterView.getMasterView(), new DataViewComponent.MasterViewConfiguration(!hasEvents));<NEW_LINE>if (hasEvents) {<NEW_LINE>dvc.configureDetailsArea(new DataViewComponent.DetailsAreaConfiguration("Data", false), DataViewComponent.TOP_LEFT);<NEW_LINE>dataView = new SocketIOViewSupport.DataViewSupport();<NEW_LINE>dvc.addDetailsView(dataView.getDetailsView(), DataViewComponent.TOP_LEFT);<NEW_LINE>}<NEW_LINE>return dvc;<NEW_LINE>} | this.setAggregation(primary, secondary); |
1,200,136 | protected JobResponse createJobResponse(Job job, RestUrlBuilder urlBuilder, String[] urlJobSegments) {<NEW_LINE>JobResponse response = new JobResponse();<NEW_LINE>response.setId(job.getId());<NEW_LINE>response.setCorrelationId(job.getCorrelationId());<NEW_LINE>response.setDueDate(job.getDuedate());<NEW_LINE>response.setExceptionMessage(job.getExceptionMessage());<NEW_LINE>response.setExecutionId(job.getExecutionId());<NEW_LINE>response.setProcessDefinitionId(job.getProcessDefinitionId());<NEW_LINE>response.<MASK><NEW_LINE>response.setElementId(job.getElementId());<NEW_LINE>response.setElementName(job.getElementName());<NEW_LINE>response.setRetries(job.getRetries());<NEW_LINE>response.setCreateTime(job.getCreateTime());<NEW_LINE>response.setTenantId(job.getTenantId());<NEW_LINE>response.setUrl(urlBuilder.buildUrl(urlJobSegments, job.getId()));<NEW_LINE>if (job.getProcessDefinitionId() != null) {<NEW_LINE>response.setProcessDefinitionUrl(urlBuilder.buildUrl(RestUrls.URL_PROCESS_DEFINITION, job.getProcessDefinitionId()));<NEW_LINE>}<NEW_LINE>if (job.getProcessInstanceId() != null) {<NEW_LINE>response.setProcessInstanceUrl(urlBuilder.buildUrl(RestUrls.URL_PROCESS_INSTANCE, job.getProcessInstanceId()));<NEW_LINE>}<NEW_LINE>if (job.getExecutionId() != null) {<NEW_LINE>response.setExecutionUrl(urlBuilder.buildUrl(RestUrls.URL_EXECUTION, job.getExecutionId()));<NEW_LINE>}<NEW_LINE>return response;<NEW_LINE>} | setProcessInstanceId(job.getProcessInstanceId()); |
22,695 | public void sendBrowseStatus(int status, long browseId) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.entry(tc, "sendBrowseStatus", new Object[] { Integer.valueOf(status), Long.valueOf(browseId) });<NEW_LINE>try {<NEW_LINE>ControlMessageFactory cmf;<NEW_LINE>ControlBrowseStatus msg;<NEW_LINE>// Create message<NEW_LINE>cmf = MessageProcessor.getControlMessageFactory();<NEW_LINE>msg = cmf.createNewControlBrowseStatus();<NEW_LINE>initializeControlMessage(msg, _destMEUuid, _gatheringTargetDestUuid, null);<NEW_LINE>msg.setStatus(status);<NEW_LINE>msg.setBrowseID(browseId);<NEW_LINE>// Send message to destination using RemoteMessageTransmitter<NEW_LINE><MASK><NEW_LINE>mpio.sendToMe(_destMEUuid, SIMPConstants.CONTROL_MESSAGE_PRIORITY, msg);<NEW_LINE>} catch (MessageCreateFailedException e) {<NEW_LINE>FFDCFilter.processException(e, "com.ibm.ws.sib.processor.impl.AnycastInputHandler.sendBrowseStatus", "1:2957:1.219.1.1", this);<NEW_LINE>SibTr.exception(tc, e);<NEW_LINE>}<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.exit(tc, "sendBrowseStatus");<NEW_LINE>} | MPIO mpio = _messageProcessor.getMPIO(); |
903,442 | private TypeMirror type(String typeName) {<NEW_LINE>try {<NEW_LINE>typeName = typeName.trim();<NEW_LINE>if (cInfo != null && typeName.length() > 0) {<NEW_LINE>SourcePositions[] sourcePositions = new SourcePositions[1];<NEW_LINE>TreeUtilities tu = cInfo.getTreeUtilities();<NEW_LINE>// NOI18N<NEW_LINE>StatementTree stmt = tu.parseStatement("{" + typeName + " a;}", sourcePositions);<NEW_LINE>if (!Utilities.containErrors(stmt) && stmt.getKind() == Tree.Kind.BLOCK) {<NEW_LINE>List<? extends StatementTree> stmts = ((BlockTree) stmt).getStatements();<NEW_LINE>if (!stmts.isEmpty()) {<NEW_LINE>StatementTree var = stmts.get(0);<NEW_LINE>if (var.getKind() == Tree.Kind.VARIABLE) {<NEW_LINE>tu.attributeTree(stmt, scope);<NEW_LINE>TypeMirror ret = cInfo.getTrees().getTypeMirror(new TreePath(treePath, ((VariableTree) var).getType()));<NEW_LINE>if (ret != null)<NEW_LINE>return ret;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return cInfo.getTreeUtilities(<MASK><NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | ).parseType(typeName, enclClass); |
229,593 | public <T> T invokeMethod(Class<T> returnType, DISPID dispID, Object... args) {<NEW_LINE>assert COMUtils.comIsInitialized() : "COM not initialized";<NEW_LINE>VARIANT[] vargs;<NEW_LINE>if (null == args) {<NEW_LINE>vargs = new VARIANT[0];<NEW_LINE>} else {<NEW_LINE>vargs = new VARIANT[args.length];<NEW_LINE>}<NEW_LINE>for (int i = 0; i < vargs.length; ++i) {<NEW_LINE>vargs[i] = Convert<MASK><NEW_LINE>}<NEW_LINE>Variant.VARIANT.ByReference result = new Variant.VARIANT.ByReference();<NEW_LINE>WinNT.HRESULT hr = this.oleMethod(OleAuto.DISPATCH_METHOD, result, this.getRawDispatch(), dispID, vargs);<NEW_LINE>for (int i = 0; i < vargs.length; i++) {<NEW_LINE>// Free value allocated by Convert#toVariant<NEW_LINE>Convert.free(vargs[i], args[i]);<NEW_LINE>}<NEW_LINE>COMUtils.checkRC(hr);<NEW_LINE>return (T) Convert.toJavaObject(result, returnType, factory, false, true);<NEW_LINE>} | .toVariant(args[i]); |
559,483 | /*<NEW_LINE>*<NEW_LINE>*/<NEW_LINE>public void trigger(TwitterContentHandle contentHandle, TwitterPaging paging, TwitterFetchStatusesFinishedCallback callback, ConnectionStatus connectionStatus, int priorityOffset) {<NEW_LINE>if (connectionStatus != null && !connectionStatus.isOnline()) {<NEW_LINE>if (callback != null) {<NEW_LINE>callback.finished(new TwitterFetchResult(false, connectionStatus.getErrorMessageNoConnection()), null, contentHandle);<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (mFinishedCallbackMap.containsValue(callback)) {<NEW_LINE>throw new RuntimeException("Shouldn't be");<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>new FetchStatusesTask().execute(AsyncTaskEx.PRIORITY_NOT_QUITE_HIGHEST + priorityOffset, "Fetch Statuses", new FetchStatusesTaskInput(mFetchStatusesCallbackHandle, contentHandle, paging, connectionStatus));<NEW_LINE>mFetchStatusesCallbackHandle += 1;<NEW_LINE>} | mFinishedCallbackMap.put(mFetchStatusesCallbackHandle, callback); |
1,349,678 | protected ReconcileResult reconcile(Set<AbstractMap.SimpleEntry<String, Long>> updatedMaxDateMap) {<NEW_LINE>logger.debug("Reconciling update timestamp for projects: " + updatedMaxDateMap.stream().map(AbstractMap.SimpleEntry::getKey).collect(Collectors.toList()));<NEW_LINE>return futureJdbi.useHandle(handle -> {<NEW_LINE>var updateProjectTimestampQuery = "UPDATE project SET date_updated = :updatedDate, version_number=(version_number + 1) WHERE id = :id";<NEW_LINE>final var <MASK><NEW_LINE>for (AbstractMap.SimpleEntry<String, Long> updatedRecord : updatedMaxDateMap) {<NEW_LINE>var id = updatedRecord.getKey();<NEW_LINE>long updatedDate = updatedRecord.getValue();<NEW_LINE>batch.bind("id", id).bind("updatedDate", updatedDate).add();<NEW_LINE>}<NEW_LINE>batch.execute();<NEW_LINE>}).thenApply(unused -> new ReconcileResult(), executor).get();<NEW_LINE>} | batch = handle.prepareBatch(updateProjectTimestampQuery); |
185,669 | protected ECCurve createCurve() {<NEW_LINE>BigInteger p = fromHex("BDB6F4FE3E8B1D9E0DA8C0D46F4C318CEFE4AFE3B6B8551F");<NEW_LINE>BigInteger a = fromHex("BB8E5E8FBC115E139FE6A814FE48AAA6F0ADA1AA5DF91985");<NEW_LINE>BigInteger b = fromHex("1854BEBDC31B21B7AEFC80AB0ECD10D5B1B3308E6DBF11C1");<NEW_LINE>BigInteger n = fromHex("BDB6F4FE3E8B1D9E0DA8C0D40FC962195DFAE76F56564677");<NEW_LINE>BigInteger h = BigInteger.valueOf(1);<NEW_LINE>return configureCurve(new ECCurve.Fp(p, a, b<MASK><NEW_LINE>} | , n, h, true)); |
1,002,166 | public static DescribeScdnDomainConfigsResponse unmarshall(DescribeScdnDomainConfigsResponse describeScdnDomainConfigsResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeScdnDomainConfigsResponse.setRequestId(_ctx.stringValue("DescribeScdnDomainConfigsResponse.RequestId"));<NEW_LINE>List<DomainConfig> domainConfigs = new ArrayList<DomainConfig>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeScdnDomainConfigsResponse.DomainConfigs.Length"); i++) {<NEW_LINE>DomainConfig domainConfig = new DomainConfig();<NEW_LINE>domainConfig.setFunctionName(_ctx.stringValue("DescribeScdnDomainConfigsResponse.DomainConfigs[" + i + "].FunctionName"));<NEW_LINE>domainConfig.setConfigId(_ctx.stringValue("DescribeScdnDomainConfigsResponse.DomainConfigs[" + i + "].ConfigId"));<NEW_LINE>domainConfig.setStatus(_ctx.stringValue("DescribeScdnDomainConfigsResponse.DomainConfigs[" + i + "].Status"));<NEW_LINE>List<FunctionArg> functionArgs = new ArrayList<FunctionArg>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeScdnDomainConfigsResponse.DomainConfigs[" + i + "].FunctionArgs.Length"); j++) {<NEW_LINE>FunctionArg functionArg = new FunctionArg();<NEW_LINE>functionArg.setArgName(_ctx.stringValue("DescribeScdnDomainConfigsResponse.DomainConfigs[" + i <MASK><NEW_LINE>functionArg.setArgValue(_ctx.stringValue("DescribeScdnDomainConfigsResponse.DomainConfigs[" + i + "].FunctionArgs[" + j + "].ArgValue"));<NEW_LINE>functionArgs.add(functionArg);<NEW_LINE>}<NEW_LINE>domainConfig.setFunctionArgs(functionArgs);<NEW_LINE>domainConfigs.add(domainConfig);<NEW_LINE>}<NEW_LINE>describeScdnDomainConfigsResponse.setDomainConfigs(domainConfigs);<NEW_LINE>return describeScdnDomainConfigsResponse;<NEW_LINE>} | + "].FunctionArgs[" + j + "].ArgName")); |
818,196 | public void testQueryParameterCollectionFormat(List<String> pipe, List<String> ioutil, List<String> http, List<String> url, List<String> context) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// verify the required parameter 'pipe' is set<NEW_LINE>if (pipe == null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>// verify the required parameter 'ioutil' is set<NEW_LINE>if (ioutil == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'ioutil' when calling testQueryParameterCollectionFormat");<NEW_LINE>}<NEW_LINE>// verify the required parameter 'http' is set<NEW_LINE>if (http == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'http' when calling testQueryParameterCollectionFormat");<NEW_LINE>}<NEW_LINE>// verify the required parameter 'url' is set<NEW_LINE>if (url == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'url' when calling testQueryParameterCollectionFormat");<NEW_LINE>}<NEW_LINE>// verify the required parameter 'context' is set<NEW_LINE>if (context == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'context' when calling testQueryParameterCollectionFormat");<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/fake/test-query-parameters".replaceAll("\\{format\\}", "json");<NEW_LINE>// query params<NEW_LINE>List<Pair> localVarQueryParams = 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>localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "pipe", pipe));<NEW_LINE>localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "ioutil", ioutil));<NEW_LINE>localVarQueryParams.addAll(apiClient.parameterToPairs("ssv", "http", http));<NEW_LINE>localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "url", url));<NEW_LINE>localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "context", context));<NEW_LINE>final String[] localVarAccepts = {};<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] localVarAuthNames = new String[] {};<NEW_LINE>apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);<NEW_LINE>} | throw new ApiException(400, "Missing the required parameter 'pipe' when calling testQueryParameterCollectionFormat"); |
95,810 | public void updateAdapter(List<App> apps) {<NEW_LINE>_apps = apps;<NEW_LINE>ArrayList<IconLabelItem> items = new ArrayList<>();<NEW_LINE>for (int i = 0; i < apps.size(); i++) {<NEW_LINE>App <MASK><NEW_LINE>items.add(new IconLabelItem(app.getIcon(), app.getLabel()).withIconSize(Setup.appSettings().getIconSize()).withTextColor(Color.WHITE).withTextVisibility(Setup.appSettings().getDrawerShowLabel()).withIconPadding(8).withTextGravity(Gravity.CENTER).withIconGravity(Gravity.TOP).withOnClickAnimate(false).withIsAppLauncher(true).withOnClickListener(new OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>Tool.startApp(v.getContext(), app, null);<NEW_LINE>}<NEW_LINE>}).withOnLongClickListener(DragHandler.getLongClick(Item.newAppItem(app), DragAction.Action.DRAWER, null)));<NEW_LINE>}<NEW_LINE>_gridDrawerAdapter.set(items);<NEW_LINE>} | app = apps.get(i); |
544,518 | private void doRun() {<NEW_LINE>while (true) {<NEW_LINE>DatagramPacket packet;<NEW_LINE>FileLockPacketPayload payload;<NEW_LINE>try {<NEW_LINE>packet = communicator.receive();<NEW_LINE>payload = communicator.decode(packet);<NEW_LINE>} catch (GracefullyStoppedException e) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>lock.lock();<NEW_LINE>try {<NEW_LINE>ContendedAction contendedAction = contendedActions.get(payload.getLockId());<NEW_LINE>if (contendedAction == null) {<NEW_LINE>acceptConfirmationAsLockRequester(payload, packet.getPort());<NEW_LINE>} else {<NEW_LINE>contendedAction.<MASK><NEW_LINE>if (!contendedAction.running) {<NEW_LINE>startLockReleaseAsLockHolder(contendedAction);<NEW_LINE>}<NEW_LINE>communicator.confirmUnlockRequest(packet.getSocketAddress(), payload.getLockId());<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>lock.unlock();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | addRequester(packet.getSocketAddress()); |
62,257 | private Request prepareRequest(CoapClient client, long c) {<NEW_LINE>if (!config.multipleObserveRequests && overallRequestsDownCounter.get() <= 0) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>countDown(overallRequestsDownCounter);<NEW_LINE>Request request;<NEW_LINE>int accept = TEXT_PLAIN;<NEW_LINE>byte[] payload = config.payload == null ? null : config.payload.payloadBytes;<NEW_LINE>if (config.hono) {<NEW_LINE>request = secure ? Request.newPost() : Request.newPut();<NEW_LINE>if (payload == null) {<NEW_LINE>accept = APPLICATION_JSON;<NEW_LINE>payload = "{\"temp\": %1$d }".getBytes();<NEW_LINE>}<NEW_LINE>} else if (config.observe != null) {<NEW_LINE>request = Request.newGet();<NEW_LINE>request.setObserve();<NEW_LINE>} else {<NEW_LINE>request = Request.newPost();<NEW_LINE>}<NEW_LINE>if (config.contentType != null) {<NEW_LINE>accept = config.contentType.contentType;<NEW_LINE>}<NEW_LINE>request.getOptions().setAccept(accept);<NEW_LINE>if (config.messageType != null) {<NEW_LINE>request.setConfirmable(config.messageType.con);<NEW_LINE>}<NEW_LINE>request.getOptions().setBlock2(block2);<NEW_LINE>if (request.isIntendedPayload()) {<NEW_LINE>request.<MASK><NEW_LINE>if (payload != null) {<NEW_LINE>if (config.payloadFormat) {<NEW_LINE>String text = new String(payload, CoAP.UTF8_CHARSET);<NEW_LINE>text = String.format(text, c, System.currentTimeMillis() / 1000);<NEW_LINE>request.setPayload(text);<NEW_LINE>} else {<NEW_LINE>request.setPayload(payload);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (config.proxy != null) {<NEW_LINE>request.setDestinationContext(new AddressEndpointContext(config.proxy.destination));<NEW_LINE>if (config.proxy.scheme != null) {<NEW_LINE>request.getOptions().setProxyScheme(config.proxy.scheme);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>EndpointContext destinationContext = client.getDestinationContext();<NEW_LINE>if (destinationContext != null) {<NEW_LINE>request.setDestinationContext(destinationContext);<NEW_LINE>}<NEW_LINE>request.setURI(client.getURI());<NEW_LINE>ResponseTimeout timeout = new ResponseTimeout(request, responseTimeout, executorService);<NEW_LINE>request.addMessageObserver(timeout);<NEW_LINE>request.addMessageObserver(retransmissionDetector);<NEW_LINE>return request;<NEW_LINE>} | getOptions().setContentFormat(accept); |
1,285,705 | public NavigableSet<K> tailSet(K start, boolean startInclusive) {<NEW_LINE>boolean isInRange = true;<NEW_LINE>int result;<NEW_LINE>if (map.toEnd) {<NEW_LINE>result = (null != comparator()) ? comparator().compare(start, map.hi) : toComparable(start<MASK><NEW_LINE>isInRange = (map.hiInclusive || !startInclusive) ? result <= 0 : result < 0;<NEW_LINE>}<NEW_LINE>if (map.fromStart) {<NEW_LINE>result = (null != comparator()) ? comparator().compare(start, map.lo) : toComparable(start).compareTo(map.lo);<NEW_LINE>isInRange = isInRange && ((map.loInclusive || !startInclusive) ? result >= 0 : result > 0);<NEW_LINE>}<NEW_LINE>if (isInRange) {<NEW_LINE>if (map.toEnd) {<NEW_LINE>return new AscendingSubMapKeySet<K, V>(new AscendingSubMap<K, V>(start, startInclusive, map.m, map.hi, map.hiInclusive));<NEW_LINE>} else {<NEW_LINE>return new AscendingSubMapKeySet<K, V>(new AscendingSubMap<K, V>(start, startInclusive, map.m));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw new IllegalArgumentException();<NEW_LINE>} | ).compareTo(map.hi); |
665,699 | private static void generateNewPartitionsForSplitWithPartitionSpec(ExecutionContext executionContext, PartitionInfo curPartitionInfo, List<PartitionGroupRecord> unVisiablePartitionGroups, SqlAlterTableGroupSplitPartition sqlAlterTableGroupSplitPartition, List<PartitionSpec> oldPartitions, List<PartitionSpec> newPartitions, List<Pair<String, String>> physicalTableAndGroupPairs, PartitionSpec splitSpec) {<NEW_LINE>int i = 0;<NEW_LINE>List<ColumnMeta> partColMetaList = curPartitionInfo.getPartitionBy().getPartitionFieldList();<NEW_LINE>SearchDatumComparator comparator = curPartitionInfo.getPartitionBy().getPruningSpaceComparator();<NEW_LINE>PartitionIntFunction partIntFunc = curPartitionInfo.getPartitionBy().getPartIntFunc();<NEW_LINE>List<SqlPartition> newPartitionsAst = sqlAlterTableGroupSplitPartition.getNewPartitions();<NEW_LINE>int fullPartColCnt = partColMetaList.size();<NEW_LINE>int actualPartColCnt = PartitionInfoUtil.getActualPartitionColumns(curPartitionInfo).size();<NEW_LINE>PartitionStrategy strategy = curPartitionInfo.getPartitionBy().getStrategy();<NEW_LINE>int newPrefixColCnt = PartitionInfoUtil.getNewPrefixPartColCntBySqlPartitionAst(fullPartColCnt, actualPartColCnt, strategy, newPartitionsAst);<NEW_LINE>for (SqlPartition sqlPartition : sqlAlterTableGroupSplitPartition.getNewPartitions()) {<NEW_LINE>PartitionSpec newSpec = PartitionInfoBuilder.buildPartitionSpecByPartSpecAst(executionContext, partColMetaList, partIntFunc, comparator, sqlAlterTableGroupSplitPartition.getParent().getPartRexInfoCtx(), null, sqlPartition, curPartitionInfo.getPartitionBy().getStrategy(), newPartitions.size(), newPrefixColCnt);<NEW_LINE>PartitionGroupRecord unVisiablePartitionGroup = unVisiablePartitionGroups.stream().filter(c -> c.partition_name.equalsIgnoreCase(newSpec.getName())).findFirst().orElse(null);<NEW_LINE>assert unVisiablePartitionGroup != null;<NEW_LINE>newSpec.setLocation(new PartitionLocation());<NEW_LINE>newSpec.getLocation().setPartitionGroupId(unVisiablePartitionGroup.id);<NEW_LINE>newSpec.getLocation().setPhyTableName(physicalTableAndGroupPairs.get<MASK><NEW_LINE>newSpec.getLocation().setGroupKey(physicalTableAndGroupPairs.get(i).getValue());<NEW_LINE>newSpec.getLocation().setVisiable(false);<NEW_LINE>newPartitions.add(newSpec);<NEW_LINE>i++;<NEW_LINE>}<NEW_LINE>} | (i).getKey()); |
286,882 | private void insertNode(final DefaultMutableTreeNode nodeToInsert, DefaultMutableTreeNode rootNode) {<NEW_LINE>final Enumeration enumeration = rootNode.children();<NEW_LINE>ArrayList children = Collections.list(enumeration);<NEW_LINE>final int index = Collections.binarySearch(children, nodeToInsert, new Comparator<DefaultMutableTreeNode>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int compare(DefaultMutableTreeNode node1, DefaultMutableTreeNode node2) {<NEW_LINE>final Object o1 = node1.getUserObject();<NEW_LINE>final Object o2 = node2.getUserObject();<NEW_LINE>if (o1 instanceof Module && o2 instanceof Module) {<NEW_LINE>return ((Module) o1).getName().compareToIgnoreCase(((Module) o2).getName());<NEW_LINE>}<NEW_LINE>if (o1 instanceof ModuleGroup && o2 instanceof ModuleGroup) {<NEW_LINE>return o1.toString().compareToIgnoreCase(o2.toString());<NEW_LINE>}<NEW_LINE>if (o1 instanceof ModuleGroup)<NEW_LINE>return -1;<NEW_LINE>if (o1 instanceof DirectoryChooser.ItemWrapper && o2 instanceof DirectoryChooser.ItemWrapper) {<NEW_LINE>final VirtualFile virtualFile1 = ((DirectoryChooser.ItemWrapper) o1).getDirectory().getVirtualFile();<NEW_LINE>final VirtualFile virtualFile2 = ((DirectoryChooser.ItemWrapper) o2).getDirectory().getVirtualFile();<NEW_LINE>return Comparing.compare(virtualFile1.getPath(<MASK><NEW_LINE>}<NEW_LINE>return 1;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>final int insertionPoint = -(index + 1);<NEW_LINE>if (insertionPoint < 0 || insertionPoint > rootNode.getChildCount()) {<NEW_LINE>LOG.error("insertionPoint = " + insertionPoint + "; children=" + children + "; node=" + nodeToInsert);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>rootNode.insert(nodeToInsert, insertionPoint);<NEW_LINE>((DefaultTreeModel) myTree.getModel()).nodeStructureChanged(rootNode);<NEW_LINE>} | ), virtualFile2.getPath()); |
940,756 | private boolean checkChild(ASTNode parent, ASTNode previous, ASTNode child) {<NEW_LINE>if ((parent.getFlags() & (ASTNode.RECOVERED | ASTNode.MALFORMED)) != 0 || (child.getFlags() & (ASTNode.RECOVERED | ASTNode.MALFORMED)) != 0)<NEW_LINE>return false;<NEW_LINE>int parentStart = parent.getStartPosition();<NEW_LINE>int parentEnd = parentStart + parent.getLength();<NEW_LINE>int childStart = child.getStartPosition();<NEW_LINE>int childEnd = childStart + child.getLength();<NEW_LINE>if (previous != null) {<NEW_LINE>// Turn a blind eye on a known problem ... see https://bugs.eclipse.org/391894#c4<NEW_LINE>if (child.getLocationInParent() == ArrayCreation.DIMENSIONS_PROPERTY)<NEW_LINE>return false;<NEW_LINE>int previousStart = previous.getStartPosition();<NEW_LINE>int previousEnd <MASK><NEW_LINE>if (childStart < previousEnd) {<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$<NEW_LINE>String // $NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$<NEW_LINE>bug = // $NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$<NEW_LINE>"- parent [" + parentStart + ", " + parentEnd + "] " + parent.getClass().getName() + '\n' + " previous [" + previousStart + ", " + previousEnd + "] " + previous.getClass().getName() + '\n' + " " + child.getLocationInParent().getId() + " [" + childStart + ", " + childEnd + "] " + // $NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$<NEW_LINE>child.getClass().getName() + '\n';<NEW_LINE>this.bugs.append(bug);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!(parentStart <= childStart && childEnd <= parentEnd)) {<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$<NEW_LINE>String // $NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$<NEW_LINE>bug = // $NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$<NEW_LINE>"- parent [" + parentStart + ", " + parentEnd + "] " + parent.getClass().getName() + '\n' + " " + child.getLocationInParent().getId() + " [" + childStart + ", " + childEnd + "] " + child.getClass().getName() + '\n';<NEW_LINE>this.bugs.append(bug);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | = previousStart + previous.getLength(); |
117,059 | public <K, V, C extends Configuration<K, V>> Cache<K, V> createCache(String cacheName, C configuration) {<NEW_LINE>ClassLoader old = Thread.currentThread().getContextClassLoader();<NEW_LINE>try {<NEW_LINE>if (runsAsAnOsgiBundle) {<NEW_LINE>// override the context class loader with the CachingManager's classloader<NEW_LINE>Thread.currentThread().setContextClassLoader(getClassLoader());<NEW_LINE>}<NEW_LINE>requireNotClosed();<NEW_LINE>requireNonNull(configuration);<NEW_LINE>CacheProxy<?, ?> cache = caches.compute(cacheName, (name, existing) -> {<NEW_LINE>if ((existing != null) && !existing.isClosed()) {<NEW_LINE>throw new <MASK><NEW_LINE>} else if (CacheFactory.isDefinedExternally(cacheName)) {<NEW_LINE>throw new CacheException("Cache " + cacheName + " is configured externally");<NEW_LINE>}<NEW_LINE>return CacheFactory.createCache(this, cacheName, configuration);<NEW_LINE>});<NEW_LINE>enableManagement(cache.getName(), cache.getConfiguration().isManagementEnabled());<NEW_LINE>enableStatistics(cache.getName(), cache.getConfiguration().isStatisticsEnabled());<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>Cache<K, V> castedCache = (Cache<K, V>) cache;<NEW_LINE>return castedCache;<NEW_LINE>} finally {<NEW_LINE>Thread.currentThread().setContextClassLoader(old);<NEW_LINE>}<NEW_LINE>} | CacheException("Cache " + cacheName + " already exists"); |
31,527 | public void marshall(Robot robot, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (robot == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(robot.getArn(), ARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(robot.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(robot.getFleetArn(), FLEETARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(robot.getStatus(), STATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(robot.getGreenGrassGroupId(), GREENGRASSGROUPID_BINDING);<NEW_LINE>protocolMarshaller.marshall(robot.getCreatedAt(), CREATEDAT_BINDING);<NEW_LINE>protocolMarshaller.marshall(robot.getArchitecture(), ARCHITECTURE_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(robot.getLastDeploymentTime(), LASTDEPLOYMENTTIME_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | robot.getLastDeploymentJob(), LASTDEPLOYMENTJOB_BINDING); |
1,004,750 | private ImmutableMap<String, ?> generateBootstrap(String zone, boolean supportIpv6) {<NEW_LINE>ImmutableMap.Builder<String, Object> nodeBuilder = ImmutableMap.builder();<NEW_LINE>nodeBuilder.put("id", "C2P-" + (rand.nextInt() & Integer.MAX_VALUE));<NEW_LINE>if (!zone.isEmpty()) {<NEW_LINE>nodeBuilder.put("locality", ImmutableMap.of("zone", zone));<NEW_LINE>}<NEW_LINE>if (supportIpv6) {<NEW_LINE>nodeBuilder.put("metadata", ImmutableMap.of("TRAFFICDIRECTOR_DIRECTPATH_C2P_IPV6_CAPABLE", true));<NEW_LINE>}<NEW_LINE>ImmutableMap.Builder<String, Object> serverBuilder = ImmutableMap.builder();<NEW_LINE>String serverUri = "directpath-pa.googleapis.com";<NEW_LINE>if (serverUriOverride != null && serverUriOverride.length() > 0) {<NEW_LINE>serverUri = serverUriOverride;<NEW_LINE>}<NEW_LINE>serverBuilder.put("server_uri", serverUri);<NEW_LINE>serverBuilder.put("channel_creds", ImmutableList.of(ImmutableMap.of("type", "google_default")));<NEW_LINE>serverBuilder.put("server_features"<MASK><NEW_LINE>return ImmutableMap.of("node", nodeBuilder.build(), "xds_servers", ImmutableList.of(serverBuilder.build()));<NEW_LINE>} | , ImmutableList.of("xds_v3")); |
1,318,509 | public static Map<DataKey, DataResource> readAttributes(CompiledResources resources) {<NEW_LINE>try (ZipInputStream zipStream = new ZipInputStream(Files.newInputStream(resources.getZip()))) {<NEW_LINE>Map<DataKey, DataResource> attributes = new LinkedHashMap<>();<NEW_LINE>for (ZipEntry entry = zipStream.getNextEntry(); entry != null; entry = zipStream.getNextEntry()) {<NEW_LINE>if (entry.getName().endsWith(CompiledResources.ATTRIBUTES_FILE_EXTENSION)) {<NEW_LINE>// Don't care about origin of ".attributes" values, since they don't feed into field<NEW_LINE>readAttributesFile(// initializers.<NEW_LINE>DependencyInfo.UNKNOWN, zipStream, FileSystems.getDefault(), (key, value) -> attributes.put(key, attributes.containsKey(key) ? attributes.get(key).combineWith(value) : value), (key, value) -> attributes.put(key, attributes.containsKey(key) ? attributes.get(key).<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return attributes;<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new DeserializationException(e);<NEW_LINE>}<NEW_LINE>} | overwrite(value) : value)); |
1,636,516 | public void visit(ListItem listItem) {<NEW_LINE>Node child = listItem.getFirstChild();<NEW_LINE>if (child instanceof Paragraph) {<NEW_LINE>Node node = child.getFirstChild();<NEW_LINE>if (node instanceof Text) {<NEW_LINE>Text textNode = (Text) node;<NEW_LINE>Matcher matcher = REGEX_TASK_LIST_ITEM.matcher(textNode.getLiteral());<NEW_LINE>if (matcher.matches()) {<NEW_LINE>String checked = matcher.group(1);<NEW_LINE>boolean isChecked = Objects.equals(checked, "X") || Objects.equals(checked, "x");<NEW_LINE>// Add the task list item marker node as the first child of the list item.<NEW_LINE>listItem.<MASK><NEW_LINE>// Parse the node using the input after the task marker (in other words, group 2 from the matcher).<NEW_LINE>// (Note that the String has been trimmed, so we should add a space between the<NEW_LINE>// TaskListItemMarker and the text that follows it when we come to render it).<NEW_LINE>textNode.setLiteral(matcher.group(2));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>visitChildren(listItem);<NEW_LINE>} | prependChild(new TaskListItemMarker(isChecked)); |
575,057 | public void debugLogStateOfPool() {<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>StringBuilder currentState = new StringBuilder();<NEW_LINE>currentState.append(String.format("POOL STATUS: Current blacklist = %s,%n current hosts in pool = %s%n", blacklist.describeBlacklistedHosts(), currentPools.keySet().toString()));<NEW_LINE>for (Map.Entry<CassandraServer, CassandraClientPoolingContainer> entry : currentPools.entrySet()) {<NEW_LINE>int activeCheckouts = entry.getValue().getActiveCheckouts();<NEW_LINE>int totalAllowed = entry<MASK><NEW_LINE>currentState.append(String.format("\tPOOL STATUS: Pooled host %s has %s out of %s connections checked out.%n", entry.getKey(), activeCheckouts > 0 ? Integer.toString(activeCheckouts) : "(unknown)", totalAllowed > 0 ? Integer.toString(totalAllowed) : "(not bounded)"));<NEW_LINE>}<NEW_LINE>log.debug("Current pool state: {}", UnsafeArg.of("currentState", currentState.toString()));<NEW_LINE>}<NEW_LINE>} | .getValue().getPoolSize(); |
358,808 | // save<NEW_LINE>@PUT<NEW_LINE>@Path("/actions/{actionId}")<NEW_LINE>@JSONP<NEW_LINE>@NoCache<NEW_LINE>@Produces({ MediaType.APPLICATION_JSON, "application/javascript" })<NEW_LINE>public final Response updateAction(@Context final HttpServletRequest request, @Context final HttpServletResponse response, @PathParam("actionId") final String actionId, final WorkflowActionForm workflowActionForm) {<NEW_LINE>final InitDataObject initDataObject = this.webResource.init(null, request, response, true, null);<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>Logger.debug(this, "Updating action with id: " + actionId);<NEW_LINE>final WorkflowAction workflowAction = this.workflowHelper.updateAction(actionId, workflowActionForm, initDataObject.getUser());<NEW_LINE>// 200<NEW_LINE>return Response.ok(new ResponseEntityView(workflowAction)).build();<NEW_LINE>} catch (final Exception e) {<NEW_LINE>Logger.error(this.getClass(), "Exception on updateAction, actionId: " + actionId + ", workflowActionForm: " + workflowActionForm + ", exception message: " + e.getMessage(), e);<NEW_LINE>return ResponseUtil.mapExceptionResponse(e);<NEW_LINE>}<NEW_LINE>} | DotPreconditions.notNull(workflowActionForm, "Expected Request body was empty."); |
802,683 | private void paintPageFast(RenderingContext c, PageBox page, DisplayListPageContainer pageOperations, int additionalTranslateX) {<NEW_LINE>page.paintBackground(c, 0, Layer.PAGED_MODE_PRINT);<NEW_LINE>c.setInPageMargins(true);<NEW_LINE>page.paintMarginAreas(c, 0, Layer.PAGED_MODE_PRINT);<NEW_LINE>c.setInPageMargins(false);<NEW_LINE>page.paintBorder(c, 0, Layer.PAGED_MODE_PRINT);<NEW_LINE>Rectangle content = page.getPrintClippingBounds(c);<NEW_LINE>_outputDevice.pushClip(content);<NEW_LINE>int top = -page.getPaintingTop() + page.getMarginBorderPadding(c, CalculatedStyle.TOP);<NEW_LINE>int left = page.getMarginBorderPadding(c, CalculatedStyle.LEFT);<NEW_LINE>int translateX = left + additionalTranslateX;<NEW_LINE>_outputDevice.translate(translateX, top);<NEW_LINE>DisplayListPainter painter = new DisplayListPainter();<NEW_LINE><MASK><NEW_LINE>_outputDevice.translate(-translateX, -top);<NEW_LINE>_outputDevice.popClip();<NEW_LINE>} | painter.paint(c, pageOperations); |
736,252 | public void onClick(View v) {<NEW_LINE>final Builder builder = jobDispatcher.newJobBuilder().setTag(form.tag.get()).setRecurring(form.recurring.get()).setLifetime(form.persistent.get() ? Lifetime.FOREVER : Lifetime.UNTIL_NEXT_BOOT).setService(DemoJobService.class).setReplaceCurrent(form.replaceCurrent.get()).setRetryStrategy(jobDispatcher.newRetryStrategy(form.retryStrategy.get(), form.getInitialBackoffSeconds()<MASK><NEW_LINE>if (form.constrainDeviceCharging.get()) {<NEW_LINE>builder.addConstraint(Constraint.DEVICE_CHARGING);<NEW_LINE>}<NEW_LINE>if (form.constrainOnAnyNetwork.get()) {<NEW_LINE>builder.addConstraint(Constraint.ON_ANY_NETWORK);<NEW_LINE>}<NEW_LINE>if (form.constrainOnUnmeteredNetwork.get()) {<NEW_LINE>builder.addConstraint(Constraint.ON_UNMETERED_NETWORK);<NEW_LINE>}<NEW_LINE>int selectedTriggerPosition = triggerSpinner.getSelectedItemPosition();<NEW_LINE>switch(TriggerType.getByPosition(selectedTriggerPosition)) {<NEW_LINE>case NOW_TRIGGER:<NEW_LINE>builder.setTrigger(Trigger.NOW);<NEW_LINE>break;<NEW_LINE>case TIMED_TRIGGER:<NEW_LINE>builder.setTrigger(Trigger.executionWindow(form.getWinStartSeconds(), form.getWinEndSeconds()));<NEW_LINE>break;<NEW_LINE>case CONTENT_URI_TRIGGER:<NEW_LINE>Uri uri = uris[uriSpinner.getSelectedItemPosition()];<NEW_LINE>CheckBox notifyForDescendants = (CheckBox) findViewById(R.id.notify_for_descendants);<NEW_LINE>int flags = notifyForDescendants.isChecked() ? ObservedUri.Flags.FLAG_NOTIFY_FOR_DESCENDANTS : 0;<NEW_LINE>ObservedUri observedUri = new ObservedUri(uri, flags);<NEW_LINE>builder.setTrigger(Trigger.contentUriTrigger(Arrays.asList(observedUri)));<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>Log.e(TAG, "Unknown trigger was selected.");<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>Log.i("FJD.JobForm", "scheduling new job");<NEW_LINE>jobDispatcher.mustSchedule(builder.build());<NEW_LINE>JobFormActivity.this.finish();<NEW_LINE>} | , form.getMaximumBackoffSeconds())); |
1,727,652 | static private // the ValueWithPath instance itself should not be.<NEW_LINE>ResultWithPath findInObject(AbstractConfigObject obj, ResolveContext context, Path path) throws NotPossibleToResolve {<NEW_LINE>// resolve ONLY portions of the object which are along our path<NEW_LINE>if (ConfigImpl.traceSubstitutionsEnabled())<NEW_LINE>ConfigImpl.trace("*** finding '" + path + "' in " + obj);<NEW_LINE>Path restriction = context.restrictToChild();<NEW_LINE>ResolveResult<? extends AbstractConfigValue> partiallyResolved = context.restrict(path).resolve(obj, new ResolveSource(obj));<NEW_LINE>ResolveContext newContext = partiallyResolved.context.restrict(restriction);<NEW_LINE>if (partiallyResolved.value instanceof AbstractConfigObject) {<NEW_LINE>ValueWithPath pair = findInObject((<MASK><NEW_LINE>return new ResultWithPath(ResolveResult.make(newContext, pair.value), pair.pathFromRoot);<NEW_LINE>} else {<NEW_LINE>throw new ConfigException.BugOrBroken("resolved object to non-object " + obj + " to " + partiallyResolved);<NEW_LINE>}<NEW_LINE>} | AbstractConfigObject) partiallyResolved.value, path); |
448,376 | private boolean checkClauses(IfNode root, IfNode[] clauses, boolean[] branchTaken) {<NEW_LINE>boolean result = true;<NEW_LINE>final Set<IfNode> ifNodes = new HashSet<IfNode>();<NEW_LINE>final Map<IfNode, Boolean> branches = new HashMap<IfNode, Boolean>();<NEW_LINE>for (int i = 0; i < clauses.length; i++) {<NEW_LINE>ifNodes.add(clauses[i]);<NEW_LINE>branches.put(clauses[i], branchTaken[i]);<NEW_LINE>}<NEW_LINE>IfNode current = root;<NEW_LINE>System.out.printf("check-clauses: start=%s\n", current);<NEW_LINE>for (int i = 0; i < clauses.length && result; i++) {<NEW_LINE>if (ifNodes.remove(current)) {<NEW_LINE>clauses[i] = current;<NEW_LINE>branchTaken[i] = branches.get(current);<NEW_LINE>if (current.predecessor() instanceof LoopBeginNode) {<NEW_LINE>result = false;<NEW_LINE>}<NEW_LINE>if (!ifNodes.isEmpty()) {<NEW_LINE>final AbstractBeginNode begin = getNode(current, !branchTaken[i]);<NEW_LINE>System.out.printf("check-clauses: current=%s, branch=%s -> begin=%s\n", current, !branchTaken[i], begin);<NEW_LINE>if (begin.next() instanceof IfNode) {<NEW_LINE>current = (IfNode) begin.next();<NEW_LINE>} else {<NEW_LINE>System.out.printf("check-clauses: next != ifNode (%s)\n", begin.next());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>System.<MASK><NEW_LINE>result = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | out.printf("check-clauses: ifNode=%s not in set\n", current); |
1,018,849 | // IMPORTANT : ALWAYS INIT THE CHANNEL BEFORE FIRING NOTIFICATIONS !<NEW_LINE>public static void init(@NonNull Context context) {<NEW_LINE>if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {<NEW_LINE>String name = context.getString(R.string.updates_title);<NEW_LINE>int importance = NotificationManager.IMPORTANCE_DEFAULT;<NEW_LINE>NotificationChannel channel = new <MASK><NEW_LINE>channel.setSound(null, null);<NEW_LINE>channel.setVibrationPattern(null);<NEW_LINE>NotificationManager notificationManager = context.getSystemService(NotificationManager.class);<NEW_LINE>// Mandatory; it is not possible to change the sound of an existing channel after its initial creation<NEW_LINE>Objects.requireNonNull(notificationManager, "notificationManager must not be null");<NEW_LINE>notificationManager.deleteNotificationChannel(ID_OLD);<NEW_LINE>notificationManager.deleteNotificationChannel(ID_OLD2);<NEW_LINE>notificationManager.createNotificationChannel(channel);<NEW_LINE>}<NEW_LINE>} | NotificationChannel(ID, name, importance); |
966,213 | private static Map<Option, Field> processFields(Class<?> type, Set<Option> options) {<NEW_LINE>Map<Option, Field> map = new HashMap<Option, Field>();<NEW_LINE>for (Field f : type.getFields()) {<NEW_LINE>Arg arg = f.getAnnotation(Arg.class);<NEW_LINE>if (arg == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Option o = null;<NEW_LINE>for (Option c : options) {<NEW_LINE>char shortN = (char) OptionImpl.Trampoline.DEFAULT.getShortName(c);<NEW_LINE>String longN = OptionImpl.Trampoline.DEFAULT.getLongName(c);<NEW_LINE>if (shortN == (int) arg.shortName() && equalStrings(longN, arg)) {<NEW_LINE>o = c;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>assert o != null : "No option for field " + f + " options: " + options;<NEW_LINE><MASK><NEW_LINE>if (arg.implicit()) {<NEW_LINE>map.put(defArgs, f);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>assert map.size() == options.size() : "Map " + map + " Options " + options;<NEW_LINE>return map;<NEW_LINE>} | map.put(o, f); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.