idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
1,408,086 | final DescribeAppsResult executeDescribeApps(DescribeAppsRequest describeAppsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeAppsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeAppsRequest> request = null;<NEW_LINE>Response<DescribeAppsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeAppsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeAppsRequest));<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, "OpsWorks");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeApps");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeAppsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeAppsResultJsonUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | invoke(request, responseHandler, executionContext); |
698,445 | public String transformMarkdown(String source) {<NEW_LINE>List<String> output = new ArrayList<>();<NEW_LINE>String state = "root";<NEW_LINE>boolean prevLineIsEmpty = true;<NEW_LINE>for (String line : source.split("\n")) {<NEW_LINE>switch(state) {<NEW_LINE>case "root":<NEW_LINE>if (match(fourspacesOrTab, line) && prevLineIsEmpty) {<NEW_LINE>output.add(line);<NEW_LINE>state = "tab";<NEW_LINE>} else if (match(javacodeblock, line)) {<NEW_LINE>output.add("");<NEW_LINE>state = "java";<NEW_LINE>} else if (match(othercodeblock, line)) {<NEW_LINE>output.add("");<NEW_LINE>state = "other";<NEW_LINE>} else {<NEW_LINE>prevLineIsEmpty = line.isEmpty();<NEW_LINE>output.add("// " + line);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case "tab":<NEW_LINE>if (match(spaceOrTab, line)) {<NEW_LINE>output.add(line);<NEW_LINE>} else if (line.isEmpty()) {<NEW_LINE>output.add("");<NEW_LINE>} else {<NEW_LINE>output.add("// " + line);<NEW_LINE>state = "root";<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case "java":<NEW_LINE>if (match(endcodeblock, line)) {<NEW_LINE>output.add("");<NEW_LINE>state = "root";<NEW_LINE>} else {<NEW_LINE>output.add(line);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case "other":<NEW_LINE>if (match(endcodeblock, line)) {<NEW_LINE>output.add("");<NEW_LINE>state = "root";<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return String.join("\n", output);<NEW_LINE>} | output.add("// " + line); |
566,759 | protected List<IntelHexRecord> dumpMemory(Program program, Memory memory, AddressSetView addrSetView, TaskMonitor monitor) throws MemoryAccessException {<NEW_LINE>int size = (int) recordSizeOption.getValue();<NEW_LINE><MASK><NEW_LINE>IntelHexRecordWriter writer = new IntelHexRecordWriter(size, dropBytes);<NEW_LINE>AddressSet set = new AddressSet(addrSetView);<NEW_LINE>MemoryBlock[] blocks = memory.getBlocks();<NEW_LINE>for (MemoryBlock block : blocks) {<NEW_LINE>if (!block.isInitialized() || block.getStart().getAddressSpace() != addressSpaceOption.getValue()) {<NEW_LINE>set.delete(new AddressRangeImpl(block.getStart(), block.getEnd()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>AddressIterator addresses = set.getAddresses(true);<NEW_LINE>while (addresses.hasNext()) {<NEW_LINE>Address address = addresses.next();<NEW_LINE>byte b = memory.getByte(address);<NEW_LINE>writer.addByte(address, b);<NEW_LINE>}<NEW_LINE>Address entryPoint = null;<NEW_LINE>AddressIterator entryPointIterator = program.getSymbolTable().getExternalEntryPointIterator();<NEW_LINE>while (entryPoint == null && entryPointIterator.hasNext()) {<NEW_LINE>Address address = entryPointIterator.next();<NEW_LINE>if (set.contains(address)) {<NEW_LINE>entryPoint = address;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return writer.finish(entryPoint);<NEW_LINE>} | boolean dropBytes = recordSizeOption.dropExtraBytes(); |
1,517,407 | public void check() throws SQLException {<NEW_LINE>super.check();<NEW_LINE>String originalQueryString = CockroachDBVisitor.asString(select);<NEW_LINE>List<String> resultSet = ComparatorHelper.getResultSetFirstColumnAsString(originalQueryString, errors, state);<NEW_LINE>boolean allowOrderBy = Randomly.getBoolean();<NEW_LINE>if (allowOrderBy) {<NEW_LINE>select.<MASK><NEW_LINE>}<NEW_LINE>CockroachDBExpression predicate = gen.generateExpression(CockroachDBDataType.BOOL.get());<NEW_LINE>select.setWhereClause(predicate);<NEW_LINE>String firstQueryString = CockroachDBVisitor.asString(select);<NEW_LINE>select.setWhereClause(new CockroachDBNotOperation(predicate));<NEW_LINE>String secondQueryString = CockroachDBVisitor.asString(select);<NEW_LINE>select.setWhereClause(new CockroachDBUnaryPostfixOperation(predicate, CockroachDBUnaryPostfixOperator.IS_NULL));<NEW_LINE>String thirdQueryString = CockroachDBVisitor.asString(select);<NEW_LINE>List<String> combinedString = new ArrayList<>();<NEW_LINE>List<String> secondResultSet = ComparatorHelper.getCombinedResultSet(firstQueryString, secondQueryString, thirdQueryString, combinedString, !allowOrderBy, state, errors);<NEW_LINE>ComparatorHelper.assumeResultSetsAreEqual(resultSet, secondResultSet, originalQueryString, combinedString, state);<NEW_LINE>} | setOrderByExpressions(gen.getOrderingTerms()); |
1,610,440 | public static void testFunc() {<NEW_LINE>String[][] table = new String[][] { { "id", "First Name", "Last Name", "Age", "Profile" }, { "1", "John", "Johnson", "45", "My name is John Johnson. My id is 1. My age is 45." }, { "2", "Tom", "", "35", "My name is Tom. My id is 2. My age is 35." }, { "3", "Rose", "Johnson Johnson Johnson Johnson Johnson Johnson Johnson Johnson Johnson Johnson", "22", "My name is Rose Johnson. My id is 3. My age is 22." }, { "4", "Jimmy", "Kimmel"<MASK><NEW_LINE>// Input<NEW_LINE>ArrayList<String[]> tableList = new ArrayList<>(Arrays.asList(table));<NEW_LINE>formatIntoTable(tableList);<NEW_LINE>} | , "", "My name is Jimmy Kimmel. My id is 4. My age is not specified. " + "I am the host of the late night show. I am not fan of Matt Damon. " } }; |
754,699 | protected String doTccActionLogStore(Method method, Parameter[] parameters, Object[] arguments, TwoPhaseBusinessAction businessAction, BusinessActionContext actionContext) {<NEW_LINE>String actionName = actionContext.getActionName();<NEW_LINE>String xid = actionContext.getXid();<NEW_LINE>//<NEW_LINE>Map<String, Object> context = fetchActionRequestContext(method, arguments, parameters);<NEW_LINE>context.put(Constants.ACTION_START_TIME, System.currentTimeMillis());<NEW_LINE>// init business context<NEW_LINE>initBusinessContext(context, method, businessAction);<NEW_LINE>// Init running environment context<NEW_LINE>initFrameworkContext(context);<NEW_LINE>actionContext.setActionContext(context);<NEW_LINE>// init applicationData<NEW_LINE>Map<String, Object> applicationContext = new HashMap<>(4);<NEW_LINE>applicationContext.put(Constants.TCC_ACTION_CONTEXT, context);<NEW_LINE>String applicationContextStr = JSON.toJSONString(applicationContext);<NEW_LINE>try {<NEW_LINE>// registry branch record<NEW_LINE>Long branchId = DefaultResourceManager.get().branchRegister(BranchType.TCC, actionName, <MASK><NEW_LINE>return String.valueOf(branchId);<NEW_LINE>} catch (Throwable t) {<NEW_LINE>String msg = String.format("TCC branch Register error, xid: %s", xid);<NEW_LINE>LOGGER.error(msg, t);<NEW_LINE>throw new FrameworkException(t, msg);<NEW_LINE>}<NEW_LINE>} | null, xid, applicationContextStr, null); |
200,848 | public void testJMSProducerSendByteMessage_TCP_SecOff(HttpServletRequest request, HttpServletResponse response) throws Throwable {<NEW_LINE><MASK><NEW_LINE>emptyQueue(qcfTCP, queue1);<NEW_LINE>JMSConsumer jmsConsumer = jmsContextQCFTCP.createConsumer(queue1);<NEW_LINE>JMSProducer producer = jmsContextQCFTCP.createProducer();<NEW_LINE>byte[] content = new byte[] { 127, 0 };<NEW_LINE>producer.setJMSCorrelationID("TestCorrelID").setJMSType("NewTestType").setJMSReplyTo(queue2).send(queue1, content);<NEW_LINE>QueueBrowser qb = jmsContextQCFTCP.createBrowser(queue1);<NEW_LINE>int numMsgs = getMessageCount(qb);<NEW_LINE>String recvdByteBody = Arrays.toString(jmsConsumer.receiveBodyNoWait(byte[].class));<NEW_LINE>boolean testFailed = false;<NEW_LINE>if ((numMsgs != 1) || !recvdByteBody.equals("[127, 0]") || !producer.getJMSCorrelationID().equals("TestCorrelID") || !producer.getJMSType().equals("NewTestType") || (producer.getJMSReplyTo() != queue2)) {<NEW_LINE>testFailed = true;<NEW_LINE>}<NEW_LINE>jmsConsumer.close();<NEW_LINE>jmsContextQCFTCP.close();<NEW_LINE>if (testFailed) {<NEW_LINE>throw new Exception("testJMSProducerSendByteMessage_TCP_SecOff failed");<NEW_LINE>}<NEW_LINE>} | JMSContext jmsContextQCFTCP = qcfTCP.createContext(); |
860,653 | private static Map<String, String> cacheFromOpenSsl(String openSslCipherSuite) {<NEW_LINE>Map<String, String> converted = o2jTls13.get(openSslCipherSuite);<NEW_LINE>if (converted != null) {<NEW_LINE>return converted;<NEW_LINE>}<NEW_LINE>String javaCipherSuiteSuffix = toJavaUncached0(openSslCipherSuite, false);<NEW_LINE>if (javaCipherSuiteSuffix == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final String javaCipherSuiteSsl = "SSL_" + javaCipherSuiteSuffix;<NEW_LINE>final String javaCipherSuiteTls = "TLS_" + javaCipherSuiteSuffix;<NEW_LINE>// Cache the mapping.<NEW_LINE>final Map<String, String> p2j = new HashMap<String, String>(4);<NEW_LINE>p2j.put("", javaCipherSuiteSuffix);<NEW_LINE>p2j.put("SSL", javaCipherSuiteSsl);<NEW_LINE>p2j.put("TLS", javaCipherSuiteTls);<NEW_LINE>o2j.putIfAbsent(openSslCipherSuite, p2j);<NEW_LINE>// Cache the reverse mapping after adding the protocol prefix (TLS_ or SSL_)<NEW_LINE>j2o.putIfAbsent(javaCipherSuiteTls, openSslCipherSuite);<NEW_LINE>j2o.putIfAbsent(javaCipherSuiteSsl, openSslCipherSuite);<NEW_LINE>logger.debug("Cipher suite mapping: {} => {}", javaCipherSuiteTls, openSslCipherSuite);<NEW_LINE>logger.<MASK><NEW_LINE>return p2j;<NEW_LINE>} | debug("Cipher suite mapping: {} => {}", javaCipherSuiteSsl, openSslCipherSuite); |
1,624,697 | private void loadNode252() throws IOException, SAXException {<NEW_LINE>DataTypeDescriptionTypeNode node = new DataTypeDescriptionTypeNode(this.context, Identifiers.OpcUa_BinarySchema_TimeZoneDataType, new QualifiedName(0, "TimeZoneDataType"), new LocalizedText("en", "TimeZoneDataType"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.String, -1, new UInteger[] {}, UByte.valueOf(1), UByte.valueOf(1), 0.0, false);<NEW_LINE>node.addReference(new Reference(Identifiers.OpcUa_BinarySchema_TimeZoneDataType, Identifiers.HasTypeDefinition, Identifiers.DataTypeDescriptionType.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.OpcUa_BinarySchema_TimeZoneDataType, Identifiers.HasComponent, Identifiers.OpcUa_BinarySchema.expanded(), false));<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append("<String xmlns=\"http://opcfoundation.org/UA/2008/02/Types.xsd\">TimeZoneDataType</String>");<NEW_LINE>String xml = sb.toString();<NEW_LINE>OpcUaXmlStreamDecoder decoder = new OpcUaXmlStreamDecoder(context.getServer().getSerializationContext()).setInput(new StringReader(xml));<NEW_LINE>Object o = decoder.readVariantValue();<NEW_LINE>DataValue value = new DataValue(new Variant(o));<NEW_LINE>node.setValue(value);<NEW_LINE><MASK><NEW_LINE>} | this.nodeManager.addNode(node); |
302,995 | // final entry of dropping backend<NEW_LINE>public void dropBackend(String host, int heartbeatPort, boolean needCheckUnforce) throws DdlException {<NEW_LINE>if (getBackendWithHeartbeatPort(host, heartbeatPort) == null) {<NEW_LINE>throw new DdlException("backend does not exists[" + host + ":" + heartbeatPort + "]");<NEW_LINE>}<NEW_LINE>Backend droppedBackend = getBackendWithHeartbeatPort(host, heartbeatPort);<NEW_LINE>if (needCheckUnforce) {<NEW_LINE>try {<NEW_LINE>checkUnforce(droppedBackend);<NEW_LINE>} catch (RuntimeException e) {<NEW_LINE>throw new DdlException(e.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// update idToBackend<NEW_LINE>Map<Long, Backend> <MASK><NEW_LINE>copiedBackends.remove(droppedBackend.getId());<NEW_LINE>idToBackendRef = ImmutableMap.copyOf(copiedBackends);<NEW_LINE>// update idToReportVersion<NEW_LINE>Map<Long, AtomicLong> copiedReportVerions = Maps.newHashMap(idToReportVersionRef);<NEW_LINE>copiedReportVerions.remove(droppedBackend.getId());<NEW_LINE>idToReportVersionRef = ImmutableMap.copyOf(copiedReportVerions);<NEW_LINE>// update cluster<NEW_LINE>final Cluster cluster = Catalog.getCurrentCatalog().getCluster(droppedBackend.getOwnerClusterName());<NEW_LINE>if (null != cluster) {<NEW_LINE>cluster.removeBackend(droppedBackend.getId());<NEW_LINE>} else {<NEW_LINE>LOG.error("Cluster " + droppedBackend.getOwnerClusterName() + " no exist.");<NEW_LINE>}<NEW_LINE>// log<NEW_LINE>Catalog.getCurrentCatalog().getEditLog().logDropBackend(droppedBackend);<NEW_LINE>LOG.info("finished to drop {}", droppedBackend);<NEW_LINE>// backends is changed, regenerated tablet number metrics<NEW_LINE>MetricRepo.generateBackendsTabletMetrics();<NEW_LINE>} | copiedBackends = Maps.newHashMap(idToBackendRef); |
297,219 | public void createConditionRoute(ConditionRouteDTO conditionRoute) {<NEW_LINE>String id = ConvertUtil.getIdFromDTO(conditionRoute);<NEW_LINE>String path = <MASK><NEW_LINE>String existConfig = dynamicConfiguration.getConfig(path);<NEW_LINE>RoutingRule existRule = null;<NEW_LINE>if (existConfig != null) {<NEW_LINE>existRule = YamlParser.loadObject(existConfig, RoutingRule.class);<NEW_LINE>}<NEW_LINE>existRule = RouteUtils.insertConditionRule(existRule, conditionRoute);<NEW_LINE>// register2.7<NEW_LINE>dynamicConfiguration.setConfig(path, YamlParser.dumpObject(existRule));<NEW_LINE>// register2.6<NEW_LINE>if (StringUtils.isNotEmpty(conditionRoute.getService())) {<NEW_LINE>for (Route old : convertRouteToOldRoute(conditionRoute)) {<NEW_LINE>registry.register(old.toUrl().addParameter(Constants.COMPATIBLE_CONFIG, true));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | getPath(id, Constants.CONDITION_ROUTE); |
622,619 | public boolean doesOperationExistForCeilingEntity(PermissionType permissionType, String ceilingEntityFullyQualifiedName) {<NEW_LINE>// the ceiling may be an impl, which will fail because entity permission is normally specified for the interface<NEW_LINE>// try the passed in ceiling first, but also try an interfaces implemented<NEW_LINE>List<String> testClasses = new ArrayList<String>();<NEW_LINE>testClasses.add(ceilingEntityFullyQualifiedName);<NEW_LINE>try {<NEW_LINE>for (Object interfaze : ClassUtils.getAllInterfaces(Class.forName(ceilingEntityFullyQualifiedName))) {<NEW_LINE>testClasses.add(((Class<?>) interfaze).getName());<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>for (String testClass : testClasses) {<NEW_LINE>Query <MASK><NEW_LINE>query.setParameter("type", permissionType.getType());<NEW_LINE>query.setParameter("ceilingEntity", testClass);<NEW_LINE>query.setHint(QueryHints.HINT_CACHEABLE, true);<NEW_LINE>query.setHint(QueryHints.HINT_CACHE_REGION, "blAdminSecurityQuery");<NEW_LINE>Long count = (Long) query.getSingleResult();<NEW_LINE>if (count > 0) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | query = em.createNamedQuery("BC_COUNT_PERMISSIONS_BY_TYPE_AND_CEILING_ENTITY"); |
1,248,264 | public Secret createSecret(String namespace, String name, String keyKey, String certKey, byte[] key, byte[] cert, String storeKey, String storePasswordKey, byte[] store, byte[] storePassword, Map<String, String> labels, Map<String, String> annotations, OwnerReference ownerReference) {<NEW_LINE>Map<String, String> data <MASK><NEW_LINE>Base64.Encoder encoder = Base64.getEncoder();<NEW_LINE>data.put(keyKey, encoder.encodeToString(key));<NEW_LINE>data.put(certKey, encoder.encodeToString(cert));<NEW_LINE>if (store != null) {<NEW_LINE>data.put(storeKey, encoder.encodeToString(store));<NEW_LINE>}<NEW_LINE>if (storePassword != null) {<NEW_LINE>data.put(storePasswordKey, encoder.encodeToString(storePassword));<NEW_LINE>}<NEW_LINE>return createSecret(namespace, name, data, labels, annotations, ownerReference);<NEW_LINE>} | = new HashMap<>(4); |
1,801,936 | public void read(org.apache.thrift.protocol.TProtocol iprot, grantNamespacePermission_result struct) throws org.apache.thrift.TException {<NEW_LINE>org.<MASK><NEW_LINE>iprot.readStructBegin();<NEW_LINE>while (true) {<NEW_LINE>schemeField = iprot.readFieldBegin();<NEW_LINE>if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>switch(schemeField.id) {<NEW_LINE>case // SEC<NEW_LINE>1:<NEW_LINE>if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {<NEW_LINE>struct.sec = new ThriftSecurityException();<NEW_LINE>struct.sec.read(iprot);<NEW_LINE>struct.setSecIsSet(true);<NEW_LINE>} else {<NEW_LINE>org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case // TOPE<NEW_LINE>2:<NEW_LINE>if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {<NEW_LINE>struct.tope = new ThriftTableOperationException();<NEW_LINE>struct.tope.read(iprot);<NEW_LINE>struct.setTopeIsSet(true);<NEW_LINE>} else {<NEW_LINE>org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);<NEW_LINE>}<NEW_LINE>iprot.readFieldEnd();<NEW_LINE>}<NEW_LINE>iprot.readStructEnd();<NEW_LINE>// check for required fields of primitive type, which can't be checked in the validate method<NEW_LINE>struct.validate();<NEW_LINE>} | apache.thrift.protocol.TField schemeField; |
1,083,649 | protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>App.getInstance().getDaggerComponent().inject(this);<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>setContentView(R.layout.activity_help);<NEW_LINE>if (getSupportActionBar() != null) {<NEW_LINE>getSupportActionBar().setDisplayHomeAsUpEnabled(true);<NEW_LINE>}<NEW_LINE>tvLogsPath = findViewById(R.id.tvLogsPath);<NEW_LINE>etLogsPath = findViewById(R.id.etLogsPath);<NEW_LINE>etLogsPath.setOnClickListener(this);<NEW_LINE>hideSelectionEditTextIfRequired();<NEW_LINE>Button btnSaveLogs = findViewById(R.id.btnSaveLogs);<NEW_LINE>btnSaveLogs.setOnClickListener(this);<NEW_LINE>btnSaveLogs.requestFocus();<NEW_LINE>View dividerSaveLogs = findViewById(R.id.dividerSaveLogs);<NEW_LINE>SwitchCompat swRootCommandsLog = <MASK><NEW_LINE>if (ModulesStatus.getInstance().isRootAvailable()) {<NEW_LINE>swRootCommandsLog.setChecked(preferenceRepository.get().getBoolPreference(SAVE_ROOT_LOGS));<NEW_LINE>swRootCommandsLog.setOnCheckedChangeListener(this);<NEW_LINE>} else {<NEW_LINE>swRootCommandsLog.setVisibility(View.GONE);<NEW_LINE>dividerSaveLogs.setVisibility(View.GONE);<NEW_LINE>}<NEW_LINE>Handler mHandler = null;<NEW_LINE>Looper looper = Looper.getMainLooper();<NEW_LINE>if (looper != null) {<NEW_LINE>mHandler = new Handler(looper);<NEW_LINE>}<NEW_LINE>PathVars pathVars = pathVarsLazy.get();<NEW_LINE>appDataDir = pathVars.getAppDataDir();<NEW_LINE>busyboxPath = pathVars.getBusyboxPath();<NEW_LINE>pathToSaveLogs = pathVars.getDefaultBackupPath();<NEW_LINE>iptables = pathVars.getIptablesPath();<NEW_LINE>appUID = pathVars.getAppUidStr();<NEW_LINE>cacheDir = pathVars.getCacheDirPath(this);<NEW_LINE>br = new HelpActivityReceiver(mHandler, appDataDir, cacheDir, pathToSaveLogs);<NEW_LINE>modulesStatus = ModulesStatus.getInstance();<NEW_LINE>if (modulesStatus.isRootAvailable()) {<NEW_LINE>IntentFilter intentFilter = new IntentFilter(RootExecService.COMMAND_RESULT);<NEW_LINE>LocalBroadcastManager.getInstance(this).registerReceiver(br, intentFilter);<NEW_LINE>} else {<NEW_LINE>swRootCommandsLog.setVisibility(View.GONE);<NEW_LINE>}<NEW_LINE>} | findViewById(R.id.swRootCommandsLog); |
1,270,303 | private boolean addChecksFromExplicitAccessRequiredAnnos(final AdminCommand command, final List<AccessCheckWork> accessChecks, final boolean isTaggable) throws NoSuchFieldException, IllegalArgumentException, IllegalAccessException {<NEW_LINE>boolean isAnnotated = false;<NEW_LINE>for (ClassLineageIterator cIt = new ClassLineageIterator(command.getClass()); cIt.hasNext(); ) {<NEW_LINE>final Class<?> c = cIt.next();<NEW_LINE>final AccessRequired ar = c.getAnnotation(AccessRequired.class);<NEW_LINE>if (ar != null) {<NEW_LINE>isAnnotated = true;<NEW_LINE>addAccessChecksFromAnno(ar, command, accessChecks, c, isTaggable);<NEW_LINE>}<NEW_LINE>final AccessRequired.List arList = c.<MASK><NEW_LINE>if (arList != null) {<NEW_LINE>isAnnotated = true;<NEW_LINE>for (final AccessRequired repeatedAR : arList.value()) {<NEW_LINE>addAccessChecksFromAnno(repeatedAR, command, accessChecks, c, isTaggable);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>isAnnotated |= addAccessChecksFromFields(c, command, accessChecks, isTaggable);<NEW_LINE>}<NEW_LINE>return isAnnotated;<NEW_LINE>} | getAnnotation(AccessRequired.List.class); |
413,906 | public static GetUserResponse unmarshall(GetUserResponse getUserResponse, UnmarshallerContext _ctx) {<NEW_LINE>getUserResponse.setRequestId(_ctx.stringValue("GetUserResponse.RequestId"));<NEW_LINE>getUserResponse.setCode(_ctx.stringValue("GetUserResponse.Code"));<NEW_LINE>getUserResponse.setMessage(_ctx.stringValue("GetUserResponse.Message"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setCreatedAt(_ctx.stringValue("GetUserResponse.Data.CreatedAt"));<NEW_LINE>data.setEmail(_ctx.stringValue("GetUserResponse.Data.Email"));<NEW_LINE>data.setId(_ctx.stringValue("GetUserResponse.Data.Id"));<NEW_LINE>data.setName(_ctx.stringValue("GetUserResponse.Data.Name"));<NEW_LINE>data.setPhoneNumber(_ctx.stringValue("GetUserResponse.Data.PhoneNumber"));<NEW_LINE>data.setRole(_ctx.stringValue("GetUserResponse.Data.Role"));<NEW_LINE>data.setSource(_ctx.stringValue("GetUserResponse.Data.Source"));<NEW_LINE>data.setUpdatedAt(_ctx.stringValue("GetUserResponse.Data.UpdatedAt"));<NEW_LINE>data.setUsername(_ctx.stringValue("GetUserResponse.Data.Username"));<NEW_LINE>List<DepartmentsItem> departments = new ArrayList<DepartmentsItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("GetUserResponse.Data.Departments.Length"); i++) {<NEW_LINE>DepartmentsItem departmentsItem = new DepartmentsItem();<NEW_LINE>departmentsItem.setDescription(_ctx.stringValue("GetUserResponse.Data.Departments[" + i + "].Description"));<NEW_LINE>departmentsItem.setGmtCreate(_ctx.stringValue<MASK><NEW_LINE>departmentsItem.setGmtModified(_ctx.stringValue("GetUserResponse.Data.Departments[" + i + "].GmtModified"));<NEW_LINE>departmentsItem.setId(_ctx.stringValue("GetUserResponse.Data.Departments[" + i + "].Id"));<NEW_LINE>departmentsItem.setName(_ctx.stringValue("GetUserResponse.Data.Departments[" + i + "].Name"));<NEW_LINE>departments.add(departmentsItem);<NEW_LINE>}<NEW_LINE>data.setDepartments(departments);<NEW_LINE>getUserResponse.setData(data);<NEW_LINE>return getUserResponse;<NEW_LINE>} | ("GetUserResponse.Data.Departments[" + i + "].GmtCreate")); |
1,763,423 | public static void initialize(Path logFileFolder) {<NEW_LINE>TerasologyVersion terasologyVersion = TerasologyVersion.getInstance();<NEW_LINE>String logFileDir = TIMESTAMP_FORMAT.format(new Date());<NEW_LINE>if (!terasologyVersion.getengineVersion().equals("")) {<NEW_LINE>logFileDir += "_" + terasologyVersion.getengineVersion();<NEW_LINE>}<NEW_LINE>if (!terasologyVersion.getBuildNumber().equals("")) {<NEW_LINE>logFileDir += "_" + terasologyVersion.getBuildNumber();<NEW_LINE>}<NEW_LINE>loggingPath = logFileFolder.<MASK><NEW_LINE>String pathString = loggingPath.toString();<NEW_LINE>System.setProperty(LOG_FILE_FOLDER, pathString);<NEW_LINE>try {<NEW_LINE>deleteLogFiles(logFileFolder, Duration.ofDays(5).getSeconds());<NEW_LINE>} catch (IOException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>// Unfortunately, setting context-based variables works only after initialization<NEW_LINE>// has completed. Manual initialization will work but is overriden by the first<NEW_LINE>// (static) access to slf4j's StaticLoggerBinder.<NEW_LINE>// This default initialization will attempt to create a folder "logFileFolder_IS_UNDEFINED" though.<NEW_LINE>// TODO: file a report at logback/slf4j<NEW_LINE>// LoggerContext context = new LoggerContext();<NEW_LINE>// context.setName(CoreConstants.DEFAULT_CONTEXT_NAME);<NEW_LINE>// context.putProperty("targetFolder", pathString);<NEW_LINE>// JoranConfigurator configurator = new JoranConfigurator();<NEW_LINE>// configurator.setContext(context);<NEW_LINE>//<NEW_LINE>// try {<NEW_LINE>// ContextInitializer ci = new ContextInitializer(context);<NEW_LINE>// ci.autoConfig();<NEW_LINE>// } catch (JoranException e) {<NEW_LINE>// e.printStackTrace();<NEW_LINE>// }<NEW_LINE>} | resolve(logFileDir).normalize(); |
428,535 | protected final void handleReceiptScheduleEvent(@NonNull final AbstractReceiptScheduleEvent event) {<NEW_LINE>final Candidate existingSupplyCandidate = retrieveExistingSupplyCandidateOrNull(event);<NEW_LINE>final CandidateBuilder supplyCandidateBuilder = existingSupplyCandidate != null ? existingSupplyCandidate.toBuilder() : prepareInitialSupplyCandidate(event);<NEW_LINE><MASK><NEW_LINE>// for the "effective quantity" we need to subtract "UNEXPECTED_INSCREASES" (different AttributesKeys/Dates) that are related to the receipt schedule in question<NEW_LINE>final List<Candidate> receiptScheduleRecordsWithDifferentAttributes = candidateRepositoryRetrieval.retrieveOrderedByDateAndSeqNo(// get all purchaseDetail-candidates that are *not* the *actual* receipt schedule's candidate that we are updating in here<NEW_LINE>CandidatesQuery.builder().// get all purchaseDetail-candidates that are *not* the *actual* receipt schedule's candidate that we are updating in here<NEW_LINE>type(CandidateType.UNEXPECTED_INCREASE).purchaseDetailsQuery(PurchaseDetailsQuery.ofPurchaseDetailOrNull(purchaseDetail)).build());<NEW_LINE>final BigDecimal qtySumWithDifferentAttributes = receiptScheduleRecordsWithDifferentAttributes.stream().map(Candidate::getQuantity).reduce(ZERO, BigDecimal::add);<NEW_LINE>final Candidate supplyCandidate = supplyCandidateBuilder.businessCaseDetail(purchaseDetail).quantity(event.getMaterialDescriptor().getQuantity().subtract(qtySumWithDifferentAttributes)).build();<NEW_LINE>candidateChangeHandler.onCandidateNewOrChange(supplyCandidate);<NEW_LINE>} | final PurchaseDetail purchaseDetail = createPurchaseDetail(event); |
1,628,445 | public OutlierResult run(Relation<O> relation) {<NEW_LINE>KNNSearcher<DBIDRef> knnQuery = new QueryBuilder<>(relation, distance).kNNByDBID(kplus);<NEW_LINE>FiniteProgress prog = LOG.isVerbose() ? new FiniteProgress("kNN distance for objects", relation.size(), LOG) : null;<NEW_LINE>WritableDoubleDataStore knnDist = DataStoreUtil.makeDoubleStorage(relation.getDBIDs(), DataStoreFactory.HINT_HOT | DataStoreFactory.HINT_TEMP);<NEW_LINE>WritableDBIDDataStore neighbor = DataStoreUtil.makeDBIDStorage(relation.getDBIDs(), DataStoreFactory.HINT_HOT | DataStoreFactory.HINT_TEMP);<NEW_LINE>DBIDVar var = DBIDUtil.newVar();<NEW_LINE>// Find nearest neighbors, and store the distances.<NEW_LINE>for (DBIDIter it = relation.iterDBIDs(); it.valid(); it.advance()) {<NEW_LINE>final KNNList knn = knnQuery.getKNN(it, kplus);<NEW_LINE>knnDist.putDouble(it, knn.getKNNDistance());<NEW_LINE>neighbor.put(it, knn.assignVar(knn.size() - 1, var));<NEW_LINE>LOG.incrementProcessed(prog);<NEW_LINE>}<NEW_LINE>LOG.ensureCompleted(prog);<NEW_LINE>prog = LOG.isVerbose() ? new FiniteProgress("kNN distance descriptor", relation.size(), LOG) : null;<NEW_LINE>WritableDoubleDataStore scores = DataStoreUtil.makeDoubleStorage(relation.getDBIDs(), DataStoreFactory.HINT_DB);<NEW_LINE>DoubleMinMax minmax = new DoubleMinMax();<NEW_LINE>for (DBIDIter it = relation.iterDBIDs(); it.valid(); it.advance()) {<NEW_LINE>// Distance<NEW_LINE>double d = knnDist.doubleValue(it);<NEW_LINE>// Distance of neighbor<NEW_LINE>double nd = knnDist.doubleValue(neighbor.assignVar(it, var));<NEW_LINE>double knndd = nd > 0 ? d / nd : d > 0 ? Double.POSITIVE_INFINITY : 1.;<NEW_LINE><MASK><NEW_LINE>minmax.put(knndd);<NEW_LINE>LOG.incrementProcessed(prog);<NEW_LINE>}<NEW_LINE>LOG.ensureCompleted(prog);<NEW_LINE>DoubleRelation scoreres = new MaterializedDoubleRelation("kNN Data Descriptor", relation.getDBIDs(), scores);<NEW_LINE>OutlierScoreMeta meta = new BasicOutlierScoreMeta(minmax.getMin(), minmax.getMax(), 0., Double.POSITIVE_INFINITY, 1.);<NEW_LINE>return new OutlierResult(meta, scoreres);<NEW_LINE>} | scores.put(it, knndd); |
756,310 | private List<Future> sendBatch(Map<Integer, List<Data>> batch, boolean replaceExistingValues, Semaphore nodeWideLoadedKeyLimiter) {<NEW_LINE>Set<Entry<Integer, List<Data>>> entries = batch.entrySet();<NEW_LINE>List<Future> futures = new ArrayList<>(entries.size());<NEW_LINE>Iterator<Entry<Integer, List<Data>>> iterator = entries.iterator();<NEW_LINE>while (iterator.hasNext()) {<NEW_LINE>Entry<Integer, List<Data>> e = iterator.next();<NEW_LINE><MASK><NEW_LINE>List<Data> keys = e.getValue();<NEW_LINE>int numberOfLoadedKeys = keys.size();<NEW_LINE>try {<NEW_LINE>MapOperation op = operationProvider.createLoadAllOperation(mapName, keys, replaceExistingValues);<NEW_LINE>InternalCompletableFuture<Object> future = opService.invokeOnPartition(SERVICE_NAME, op, partitionId);<NEW_LINE>futures.add(future);<NEW_LINE>} finally {<NEW_LINE>nodeWideLoadedKeyLimiter.release(numberOfLoadedKeys);<NEW_LINE>}<NEW_LINE>iterator.remove();<NEW_LINE>}<NEW_LINE>return futures;<NEW_LINE>} | int partitionId = e.getKey(); |
1,005,639 | public void executeStep(PluginStepContext context, Map<String, Object> configuration) throws StepException {<NEW_LINE>if (null == jobUUID && null == jobName) {<NEW_LINE>throw new StepException("Configuration invalid: jobUUID or jobName is required", StepFailureReason.ConfigurationFailure);<NEW_LINE>}<NEW_LINE>if (null == executionState && null == running) {<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>JobService jobService = context.getExecutionContext().getJobService();<NEW_LINE>final JobState jobState;<NEW_LINE>final JobReference jobReference;<NEW_LINE>try {<NEW_LINE>String project = context.getFrameworkProject();<NEW_LINE>if (null != jobProject) {<NEW_LINE>project = jobProject;<NEW_LINE>}<NEW_LINE>if (null != jobUUID) {<NEW_LINE>jobReference = jobService.jobForID(jobUUID, project);<NEW_LINE>} else {<NEW_LINE>jobReference = jobService.jobForName(jobName, project);<NEW_LINE>}<NEW_LINE>jobState = jobService.getJobState(jobReference);<NEW_LINE>} catch (JobNotFound jobNotFound) {<NEW_LINE>throw new StepException("Job was not found: " + jobNotFound.getMessage(), StepFailureReason.ConfigurationFailure);<NEW_LINE>}<NEW_LINE>// evaluate job state<NEW_LINE>boolean result = false;<NEW_LINE>boolean equality = null == condition || !CON_NOTEQUALS.equalsIgnoreCase(condition);<NEW_LINE>String message = renderOutcome(jobState, jobReference, equality).toString();<NEW_LINE>if (null != running) {<NEW_LINE>result = checkRunning(jobState);<NEW_LINE>finishConditional(context, result, equality, message);<NEW_LINE>}<NEW_LINE>if (null != executionState) {<NEW_LINE>result = checkExecutionState(jobState.getPreviousExecutionState(), jobState.getPreviousExecutionStatusString());<NEW_LINE>finishConditional(context, result, equality, message);<NEW_LINE>}<NEW_LINE>} | StepException("Configuration invalid: executionState or running is required", StepFailureReason.ConfigurationFailure); |
1,260,641 | private void calculatePoly() {<NEW_LINE>// common denominator<NEW_LINE>double denom = pow2(1 - 3.4641 * ar);<NEW_LINE>poly[5] = (-1.58025 * (-0.728769 + ar) * (-0.192105 + ar)) / denom;<NEW_LINE>poly[4] = (12.8395 * (-0.725688 + ar) * (-0.19292 + ar)) / denom;<NEW_LINE>poly[3] = (-39.5062 * (-0.72074 + ar) * (<MASK><NEW_LINE>poly[2] = (55.3086 * (-0.711482 + ar) * (-0.196772 + ar)) / denom;<NEW_LINE>poly[1] = (-31.6049 * (-0.705375 + ar) * (-0.198476 + ar)) / denom;<NEW_LINE>poly[0] = (9.16049 * (-0.588838 + ar) * (-0.20624 + ar)) / denom;<NEW_LINE>} | -0.194245 + ar)) / denom; |
1,455,057 | static void addDirectAndExportedDeps(TargetGraph targetGraph, TargetNode<?> targetNode, ImmutableSortedSet.Builder<TargetNode<?>> directDepsBuilder, ImmutableSortedSet.Builder<TargetNode<?>> exportedDepsBuilder, Optional<AppleCxxPlatform> appleCxxPlatform) {<NEW_LINE>directDepsBuilder.addAll(targetGraph.getAll(targetNode.getBuildDeps()));<NEW_LINE>if (targetNode.getDescription() instanceof AppleLibraryDescription || targetNode.getDescription() instanceof CxxLibraryDescription) {<NEW_LINE>CxxLibraryDescription.CommonArg arg = (CxxLibraryDescription.CommonArg) targetNode.getConstructorArg();<NEW_LINE>LOG.verbose("Exported deps of node %s: %s", <MASK><NEW_LINE>Iterable<TargetNode<?>> exportedNodes = targetGraph.getAll(arg.getExportedDeps());<NEW_LINE>directDepsBuilder.addAll(exportedNodes);<NEW_LINE>exportedDepsBuilder.addAll(exportedNodes);<NEW_LINE>}<NEW_LINE>// apple bundle targets have target only dependencies on binary/platform_binary one of which<NEW_LINE>// will end up being a build time dependency. Since at target graph construction time it's not<NEW_LINE>// clear which one will end up being a build dependency, include both.<NEW_LINE>if (targetNode.getDescription() instanceof AppleBundleDescription) {<NEW_LINE>AppleBundleDescriptionArg arg = (AppleBundleDescriptionArg) targetNode.getConstructorArg();<NEW_LINE>directDepsBuilder.addAll(targetGraph.getAll(arg.getBinaryTargets()));<NEW_LINE>}<NEW_LINE>// if target platform is known, we should discover targets that match it to make sure that<NEW_LINE>// all resources are properly discovered and added to the final apple_bundle<NEW_LINE>if (appleCxxPlatform.isPresent() && targetNode.getDescription() instanceof AppleLibraryDescription) {<NEW_LINE>AppleLibraryDescriptionArg arg = (AppleLibraryDescriptionArg) targetNode.getConstructorArg();<NEW_LINE>for (ImmutableSortedSet<BuildTarget> deps : arg.getPlatformDeps().getMatchingValues(appleCxxPlatform.get().getFlavor().toString())) {<NEW_LINE>directDepsBuilder.addAll(targetGraph.getAll(deps));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | targetNode, arg.getExportedDeps()); |
640,452 | public ConnectorPageSource pageSource(ConnectorTransactionHandle transactionHandle, ConnectorSession session, TupleDomain<Integer> constraint) {<NEW_LINE>checkState(ruleStatsRecorder.isPresent(), "Rule stats system table can return results only on coordinator");<NEW_LINE>Map<Class<?>, RuleStats> ruleStats = ruleStatsRecorder<MASK><NEW_LINE>int positionCount = ruleStats.size();<NEW_LINE>Map<String, BlockBuilder> blockBuilders = ruleStatsTable.getColumns().stream().collect(toImmutableMap(ColumnMetadata::getName, column -> column.getType().createBlockBuilder(null, positionCount)));<NEW_LINE>for (Map.Entry<Class<?>, RuleStats> entry : ruleStats.entrySet()) {<NEW_LINE>RuleStats stats = entry.getValue();<NEW_LINE>VARCHAR.writeString(blockBuilders.get("rule_name"), entry.getKey().getSimpleName());<NEW_LINE>BIGINT.writeLong(blockBuilders.get("invocations"), stats.getInvocations());<NEW_LINE>BIGINT.writeLong(blockBuilders.get("matches"), stats.getHits());<NEW_LINE>BIGINT.writeLong(blockBuilders.get("failures"), stats.getFailures());<NEW_LINE>DOUBLE.writeDouble(blockBuilders.get("average_time"), stats.getTime().getAvg());<NEW_LINE>BlockBuilder mapWriter = blockBuilders.get("time_distribution_percentiles").beginBlockEntry();<NEW_LINE>for (Map.Entry<Double, Double> percentile : stats.getTime().getPercentiles().entrySet()) {<NEW_LINE>DOUBLE.writeDouble(mapWriter, percentile.getKey());<NEW_LINE>DOUBLE.writeDouble(mapWriter, percentile.getValue());<NEW_LINE>}<NEW_LINE>blockBuilders.get("time_distribution_percentiles").closeEntry();<NEW_LINE>}<NEW_LINE>Block[] blocks = ruleStatsTable.getColumns().stream().map(column -> blockBuilders.get(column.getName()).build()).toArray(Block[]::new);<NEW_LINE>return new FixedPageSource(ImmutableList.of(new Page(positionCount, blocks)));<NEW_LINE>} | .get().getStats(); |
592,446 | public JExpression buildReadMethod(JVar inputParcelParam, JDefinedClass parcelableClass, ASTType type, ASTType converter, ReadWriteGenerator overrideGenerator, JExpression readIdentityMap) {<NEW_LINE>JType <MASK><NEW_LINE>// write method<NEW_LINE>JClass typeRef = generationUtil.ref(type);<NEW_LINE>JMethod readMethod = parcelableClass.method(JMod.PUBLIC | JMod.STATIC, typeRef, READ_METHOD);<NEW_LINE>JBlock readMethodBody = readMethod.body();<NEW_LINE>JVar parcelParam = readMethod.param(parcelType, variableNamer.generateName(parcelType));<NEW_LINE>JVar identityParam = readMethod.param(codeModel.ref(IdentityCollection.class), variableNamer.generateName("identityMap"));<NEW_LINE>JVar identity = readMethodBody.decl(codeModel.INT, variableNamer.generateName("identity"), parcelParam.invoke("readInt"));<NEW_LINE>JConditional containsKeyConditional = readMethodBody._if(identityParam.invoke("containsKey").arg(identity));<NEW_LINE>JBlock containsBlock = containsKeyConditional._then();<NEW_LINE>containsBlock._if(identityParam.invoke("isReserved").arg(identity))._then()._throw(JExpr._new(generationUtil.ref(ParcelerRuntimeException.class)).arg("An instance loop was detected whild building Parcelable and deseralization cannot continue. This error is most likely due to using @ParcelConstructor or @ParcelFactory."));<NEW_LINE>containsBlock._return(identityParam.invoke("get").arg(identity));<NEW_LINE>JBlock doesntContainBlock = containsKeyConditional._else();<NEW_LINE>JVar expressionVariable = doesntContainBlock.decl(typeRef, variableNamer.generateName(typeRef), buildReadFromParcelExpression(doesntContainBlock, parcelParam, parcelableClass, type, converter, overrideGenerator, identity, identityParam).getExpression());<NEW_LINE>doesntContainBlock.invoke(identityParam, "put").arg(identity).arg(expressionVariable);<NEW_LINE>doesntContainBlock._return(expressionVariable);<NEW_LINE>return JExpr.invoke(readMethod).arg(inputParcelParam).arg(readIdentityMap);<NEW_LINE>} | parcelType = generationUtil.ref(ANDROID_PARCEL); |
1,241,170 | /*<NEW_LINE>*<NEW_LINE>*/<NEW_LINE>void configureActionBarView() {<NEW_LINE>if (mScreenName != null) {<NEW_LINE>final ActionBar actionBar = getActionBar();<NEW_LINE>actionBar.setDisplayUseLogoEnabled(true);<NEW_LINE>actionBar.setDisplayHomeAsUpEnabled(true);<NEW_LINE>actionBar.setDisplayShowTitleEnabled(true);<NEW_LINE>actionBar.setTitle("@" + mScreenName);<NEW_LINE>final LayoutInflater inflator = (<MASK><NEW_LINE>final int layout = R.layout.profile_title_thin;<NEW_LINE>final View abView = inflator.inflate(layout, null);<NEW_LINE>final ImageView verified = (ImageView) abView.findViewById(R.id.verifiedImage);<NEW_LINE>verified.setVisibility(mUser != null && mUser.getVerified() ? View.VISIBLE : View.GONE);<NEW_LINE>actionBar.setDisplayShowCustomEnabled(true);<NEW_LINE>actionBar.setCustomView(abView);<NEW_LINE>}<NEW_LINE>} | LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE); |
436,001 | public void add(String lookupKey, OAuth20Token entry, int lifetime) {<NEW_LINE>String hash = lookupKey;<NEW_LINE>boolean isAppPasswordOrAppTokenGT = (OAuth20Constants.GRANT_TYPE_APP_PASSWORD.equals(entry.getGrantType())) || (OAuth20Constants.GRANT_TYPE_APP_TOKEN.equals(entry.getGrantType()));<NEW_LINE>boolean isAuthorizationGrantTypeAndCodeSubType = (OAuth20Constants.TOKENTYPE_AUTHORIZATION_GRANT.equals(entry.getType()) && OAuth20Constants.GRANT_TYPE_AUTHORIZATION_CODE.equals(entry.getSubType()));<NEW_LINE>if (!isAuthorizationGrantTypeAndCodeSubType && (!OAuth20Constants.PLAIN_ENCODING.equals(this.accessTokenEncoding) || isAppPasswordOrAppTokenGT)) {<NEW_LINE>if (OAuth20Constants.PLAIN_ENCODING.equals(this.accessTokenEncoding)) {<NEW_LINE>// must be app-password or app-token<NEW_LINE>hash = EndpointUtils.computeTokenHash(lookupKey);<NEW_LINE>} else {<NEW_LINE>hash = EndpointUtils.computeTokenHash(lookupKey, this.accessTokenEncoding);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>hash = MessageDigestUtil.getDigest(lookupKey);<NEW_LINE>}<NEW_LINE>// TODO : see if hash is valid before adding<NEW_LINE>synchronized (_lock) {<NEW_LINE>CacheEntry ce = new CacheEntry(entry, lifetime);<NEW_LINE>_cache.put(hash, ce);<NEW_LINE>List<CacheEntry> entries = null;<NEW_LINE><MASK><NEW_LINE>entries = _indexOnUsername.get(username);<NEW_LINE>if (entries == null) {<NEW_LINE>entries = new ArrayList<CacheEntry>();<NEW_LINE>_indexOnUsername.put(username, entries);<NEW_LINE>}<NEW_LINE>entries.add(ce);<NEW_LINE>}<NEW_LINE>} | String username = entry.getUsername(); |
332,921 | private void drawLabels(Graphics2D g, Number next, double xOffset, double yOffset, double zeroOffset, double barWidth, boolean showStackSum, boolean isTotalAnnotations, Color seriesColor) {<NEW_LINE>String numberAsString = chart.getYAxisFormat().format(next);<NEW_LINE>TextLayout textLayout = new TextLayout(numberAsString, stylerCategory.getLabelsFont(), new FontRenderContext<MASK><NEW_LINE>AffineTransform rot = AffineTransform.getRotateInstance(-1 * Math.toRadians(stylerCategory.getLabelsRotation()), 0, 0);<NEW_LINE>Shape shape = textLayout.getOutline(rot);<NEW_LINE>Rectangle2D labelRectangle = textLayout.getBounds();<NEW_LINE>double labelX;<NEW_LINE>if (stylerCategory.getLabelsRotation() > 0) {<NEW_LINE>double labelXDelta = labelRectangle.getHeight() / 2 + labelRectangle.getWidth() / 2;<NEW_LINE>double rotationOffset = labelXDelta * stylerCategory.getLabelsRotation() / 90;<NEW_LINE>labelX = xOffset + barWidth / 2 - labelRectangle.getWidth() / 2 + rotationOffset - 1;<NEW_LINE>} else {<NEW_LINE>labelX = xOffset + barWidth / 2 - labelRectangle.getWidth() / 2 - 1;<NEW_LINE>}<NEW_LINE>double labelY;<NEW_LINE>if (showStackSum) {<NEW_LINE>labelY = yOffset - 4;<NEW_LINE>} else {<NEW_LINE>if (next.doubleValue() >= 0.0) {<NEW_LINE>labelY = yOffset + (zeroOffset - yOffset) * (1 - stylerCategory.getLabelsPosition()) + labelRectangle.getHeight() * stylerCategory.getLabelsPosition();<NEW_LINE>} else {<NEW_LINE>labelY = zeroOffset - (zeroOffset - yOffset) * (1 - stylerCategory.getLabelsPosition()) + labelRectangle.getHeight() * (1 - stylerCategory.getLabelsPosition());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (stylerCategory.isLabelsFontColorAutomaticEnabled()) {<NEW_LINE>g.setColor(stylerCategory.getLabelsFontColor(seriesColor));<NEW_LINE>} else {<NEW_LINE>g.setColor(stylerCategory.getLabelsFontColor());<NEW_LINE>}<NEW_LINE>g.setFont(stylerCategory.getLabelsFont());<NEW_LINE>AffineTransform orig = g.getTransform();<NEW_LINE>AffineTransform at = new AffineTransform();<NEW_LINE>at.translate(labelX, labelY);<NEW_LINE>g.transform(at);<NEW_LINE>g.fill(shape);<NEW_LINE>g.setTransform(orig);<NEW_LINE>} | (null, true, false)); |
509,605 | private Promise<Void> followPath(String[] path, int index, Promise<Map<String, Variable>> scope) {<NEW_LINE>String elem = path[index];<NEW_LINE>return scope.thenAsync(map -> {<NEW_LINE>Variable var = map.get(elem);<NEW_LINE>if (var != null) {<NEW_LINE>if (index == path.length - 1) {<NEW_LINE>return variableToString(var).thenVoid(str -> System.out.println(str)).thenAsync(v -> var.getValue().getType().thenAsync(type -> type.startsWith("@") ? printJsScope(var.getValue().getOriginalValue().getProperties()) : printScope(var.getValue().getProperties())));<NEW_LINE>} else {<NEW_LINE>return var.getValue().getType().thenAsync(type -> type.startsWith("@") ? followJsPath(path, index + 1, var.getValue().getOriginalValue().getProperties()) : followPath(path, index + 1, var.getValue<MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>System.out.println("Invalid path specified");<NEW_LINE>return Promise.VOID;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | ().getProperties())); |
1,134,350 | public void onCreate(final Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>equations = new ArrayList<>();<NEW_LINE>freeVariables = new ArrayList<>();<NEW_LINE>variableBank = new ArrayList<>();<NEW_LINE>gp = getArguments().getParcelable(GEOPOINT_ARG);<NEW_LINE>if (gp == null) {<NEW_LINE>if (savedState != null) {<NEW_LINE>try {<NEW_LINE>gp = new Geopoint(savedState.plainLat, savedState.plainLon);<NEW_LINE>} catch (final Geopoint.ParseException ignored) {<NEW_LINE>// gathering from one of the other formats?<NEW_LINE>gp = Sensors.getInstance().currentGeo().getCoords();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>gp = Sensors.getInstance().currentGeo().getCoords();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (savedInstanceState != null) {<NEW_LINE>if (savedInstanceState.getParcelable(GEOPOINT_ARG) != null) {<NEW_LINE>gp = savedInstanceState.getParcelable(GEOPOINT_ARG);<NEW_LINE>}<NEW_LINE>final byte[] <MASK><NEW_LINE>setSavedState(bytes != null ? (CalcState) SerializationUtils.deserialize(bytes) : null);<NEW_LINE>}<NEW_LINE>} | bytes = savedInstanceState.getByteArray(CALC_STATE); |
1,071,710 | public void testUnexplode() throws IOException {<NEW_LINE>File file = File.createTempFile("tempFile", null);<NEW_LINE>File tmpDir = file.getParentFile();<NEW_LINE>unexplodeWithException(file, "shouldn't be able to unexplode file that is not a directory");<NEW_LINE>assertTrue("Should be able to delete tmp file", file.delete());<NEW_LINE>unexplodeWithException(file, "shouldn't be able to unexplode file that doesn't exist");<NEW_LINE>// create empty tmp dir with the same name as deleted file<NEW_LINE>File dir = new File(tmpDir, file.getName());<NEW_LINE>dir.deleteOnExit();<NEW_LINE>assertTrue("Should be able to create directory with the same name as there was tmp file", dir.mkdir());<NEW_LINE>unexplodeWithException(dir, "shouldn't be able to unexplode dir that doesn't contain any files");<NEW_LINE>// unexplode should succeed with at least one file in directory<NEW_LINE>File.createTempFile("temp", null, dir);<NEW_LINE>ZipUtil.unexplode(dir);<NEW_LINE>assertTrue("zip file should exist with the same name as the directory that was unexploded", dir.exists());<NEW_LINE>assertTrue("unexploding input directory should have produced zip file with the same name", !dir.isDirectory());<NEW_LINE>assertTrue(<MASK><NEW_LINE>} | "Should be able to delete zip that was created from directory", dir.delete()); |
220,203 | private HttpServer httpsServer(InetSocketAddress address) throws IOException, GeneralSecurityException {<NEW_LINE>// Initialize the keystore<NEW_LINE>char[] password = "umsums".toCharArray();<NEW_LINE>keyStore = KeyStore.getInstance("JKS");<NEW_LINE>try (FileInputStream fis = new FileInputStream(FileUtil.appendPathSeparator(CONFIGURATION.getProfileDirectory()) + "UMS.jks")) {<NEW_LINE>keyStore.load(fis, password);<NEW_LINE>}<NEW_LINE>// Setup the key manager factory<NEW_LINE>keyManagerFactory = KeyManagerFactory.getInstance("SunX509");<NEW_LINE>keyManagerFactory.init(keyStore, password);<NEW_LINE>// Setup the trust manager factory<NEW_LINE>trustManagerFactory = TrustManagerFactory.getInstance("SunX509");<NEW_LINE>trustManagerFactory.init(keyStore);<NEW_LINE>HttpsServer httpsServer = HttpsServer.create(address, 0);<NEW_LINE>sslContext = SSLContext.getInstance("TLS");<NEW_LINE>sslContext.init(keyManagerFactory.getKeyManagers(), trustManagerFactory.getTrustManagers(), null);<NEW_LINE>httpsServer.setHttpsConfigurator(new HttpsConfigurator(sslContext) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void configure(HttpsParameters params) {<NEW_LINE>try {<NEW_LINE>// initialise the SSL context<NEW_LINE>SSLContext c = SSLContext.getDefault();<NEW_LINE>SSLEngine engine = c.createSSLEngine();<NEW_LINE>params.setNeedClientAuth(true);<NEW_LINE>params.setCipherSuites(engine.getEnabledCipherSuites());<NEW_LINE>params.<MASK><NEW_LINE>// get the default parameters<NEW_LINE>SSLParameters defaultSSLParameters = c.getDefaultSSLParameters();<NEW_LINE>params.setSSLParameters(defaultSSLParameters);<NEW_LINE>} catch (NoSuchAlgorithmException e) {<NEW_LINE>LOGGER.debug("https configure error " + e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return httpsServer;<NEW_LINE>} | setProtocols(engine.getEnabledProtocols()); |
1,751,556 | private static void emulateEnter(@Nonnull final Editor editor, @Nonnull Project project, int[] shifts) {<NEW_LINE>final DataContext dataContext = prepareContext(<MASK><NEW_LINE>int caretOffset = editor.getCaretModel().getOffset();<NEW_LINE>Document document = editor.getDocument();<NEW_LINE>SelectionModel selectionModel = editor.getSelectionModel();<NEW_LINE>int startSelectionOffset = 0;<NEW_LINE>int endSelectionOffset = 0;<NEW_LINE>boolean restoreSelection = selectionModel.hasSelection();<NEW_LINE>if (restoreSelection) {<NEW_LINE>startSelectionOffset = selectionModel.getSelectionStart();<NEW_LINE>endSelectionOffset = selectionModel.getSelectionEnd();<NEW_LINE>selectionModel.removeSelection();<NEW_LINE>}<NEW_LINE>int textLengthBeforeWrap = document.getTextLength();<NEW_LINE>int lineCountBeforeWrap = document.getLineCount();<NEW_LINE>DataManager.getInstance().saveInDataContext(dataContext, WRAP_LONG_LINE_DURING_FORMATTING_IN_PROGRESS_KEY, true);<NEW_LINE>CommandProcessor commandProcessor = CommandProcessor.getInstance();<NEW_LINE>try {<NEW_LINE>Runnable command = () -> EditorActionManager.getInstance().getActionHandler(IdeActions.ACTION_EDITOR_ENTER).execute(editor, dataContext);<NEW_LINE>if (commandProcessor.getCurrentCommand() == null) {<NEW_LINE>commandProcessor.executeCommand(editor.getProject(), command, WRAP_LINE_COMMAND_NAME, null);<NEW_LINE>} else {<NEW_LINE>command.run();<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>DataManager.getInstance().saveInDataContext(dataContext, WRAP_LONG_LINE_DURING_FORMATTING_IN_PROGRESS_KEY, null);<NEW_LINE>}<NEW_LINE>int symbolsDiff = document.getTextLength() - textLengthBeforeWrap;<NEW_LINE>if (restoreSelection) {<NEW_LINE>int newSelectionStart = startSelectionOffset;<NEW_LINE>int newSelectionEnd = endSelectionOffset;<NEW_LINE>if (startSelectionOffset >= caretOffset) {<NEW_LINE>newSelectionStart += symbolsDiff;<NEW_LINE>}<NEW_LINE>if (endSelectionOffset >= caretOffset) {<NEW_LINE>newSelectionEnd += symbolsDiff;<NEW_LINE>}<NEW_LINE>selectionModel.setSelection(newSelectionStart, newSelectionEnd);<NEW_LINE>}<NEW_LINE>shifts[0] = document.getLineCount() - lineCountBeforeWrap;<NEW_LINE>shifts[1] = symbolsDiff;<NEW_LINE>} | editor.getComponent(), project); |
1,399,671 | public void run(MessageReply reply) {<NEW_LINE>if (!reply.isSuccess()) {<NEW_LINE>completion.fail(reply.getError());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>VirtualRouterAsyncHttpCallReply re = reply.castReply();<NEW_LINE>VirtualRouterCommands.SyncSNATRsp ret = re.toResponse(VirtualRouterCommands.SyncSNATRsp.class);<NEW_LINE>if (!ret.isSuccess()) {<NEW_LINE>ErrorCode err = operr("virtual router[name: %s, uuid: %s] failed to sync snat%s, %s", vr.getName(), vr.getUuid(), JSONObjectUtil.toJsonString(snatInfo<MASK><NEW_LINE>completion.fail(err);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Vip vip = getVipWithSnatService(vr, nic);<NEW_LINE>if (vip == null) {<NEW_LINE>completion.success();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>vip.acquire(new Completion(completion) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void success() {<NEW_LINE>completion.success();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void fail(ErrorCode errorCode) {<NEW_LINE>completion.fail(errorCode);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | ), ret.getError()); |
1,071,466 | public Map<String, Object> toMap() {<NEW_LINE>Map<String, Object> map = new HashMap<>();<NEW_LINE>map.put("timestamp", new Long(timestamp));<NEW_LINE>if (assetHash != null) {<NEW_LINE>map.put("assetHash", assetHash);<NEW_LINE>}<NEW_LINE>map.put("icon", getIconID());<NEW_LINE>map.put("id", id);<NEW_LINE>map.put("text", getText());<NEW_LINE>map.put("typeID", getTypeID());<NEW_LINE>map.put("assetImageURL", assetImageURL);<NEW_LINE>map.put("showThumb", new Long(getShowThumb() ? 1 : 0));<NEW_LINE>if (imageBytes != null) {<NEW_LINE>map.put("imageBytes", imageBytes);<NEW_LINE>} else if (dm != null) {<NEW_LINE>byte[] thumbnail = PlatformTorrentUtils.getContentThumbnail(dm.getTorrent());<NEW_LINE>if (thumbnail != null) {<NEW_LINE>map.put("imageBytes", thumbnail);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (torrent != null && (dm == null || assetHash == null)) {<NEW_LINE>try {<NEW_LINE>// make a copy of the torrent<NEW_LINE>Map torrent_map = torrent.serialiseToMap();<NEW_LINE>TOTorrent torrent_to_send = TOTorrentFactory.deserialiseFromMap(torrent_map);<NEW_LINE>Map<?, ?> vuze_map = (Map<?, ?<MASK><NEW_LINE>// remove any non-standard stuff (e.g. resume data)<NEW_LINE>torrent_to_send.removeAdditionalProperties();<NEW_LINE>torrent_map = torrent_to_send.serialiseToMap();<NEW_LINE>if (vuze_map != null) {<NEW_LINE>torrent_map.put("vuze", vuze_map);<NEW_LINE>}<NEW_LINE>map.put("torrent", torrent_map);<NEW_LINE>} catch (TOTorrentException e) {<NEW_LINE>Debug.outNoStack("VuzeActivityEntry.toMap: " + e.toString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (torrentName != null) {<NEW_LINE>map.put("torrent-name", torrentName);<NEW_LINE>}<NEW_LINE>if (playable) {<NEW_LINE>map.put("playable", new Long(playable ? 1 : 0));<NEW_LINE>}<NEW_LINE>map.put("readOn", new Long(readOn));<NEW_LINE>if (actions != null && actions.length > 0) {<NEW_LINE>List<String> list = Arrays.asList(actions);<NEW_LINE>map.put("actions", list);<NEW_LINE>}<NEW_LINE>if (callback_class != null) {<NEW_LINE>map.put("cb_class", callback_class);<NEW_LINE>}<NEW_LINE>if (callback_data != null) {<NEW_LINE>map.put("cb_data", callback_data);<NEW_LINE>}<NEW_LINE>map.put("viewed", viewed ? 1 : 0);<NEW_LINE>return map;<NEW_LINE>} | >) torrent_map.get("vuze"); |
1,033,383 | public void read(org.apache.thrift.protocol.TProtocol iprot, NimbusStat struct) throws org.apache.thrift.TException {<NEW_LINE>org.apache.thrift.protocol.TField schemeField;<NEW_LINE>iprot.readStructBegin();<NEW_LINE>while (true) {<NEW_LINE>schemeField = iprot.readFieldBegin();<NEW_LINE>if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>switch(schemeField.id) {<NEW_LINE>case // HOST<NEW_LINE>1:<NEW_LINE>if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {<NEW_LINE>struct.host = iprot.readString();<NEW_LINE>struct.set_host_isSet(true);<NEW_LINE>} else {<NEW_LINE>org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case // UPTIME_SECS<NEW_LINE>2:<NEW_LINE>if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {<NEW_LINE>struct<MASK><NEW_LINE>struct.set_uptimeSecs_isSet(true);<NEW_LINE>} else {<NEW_LINE>org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);<NEW_LINE>}<NEW_LINE>iprot.readFieldEnd();<NEW_LINE>}<NEW_LINE>iprot.readStructEnd();<NEW_LINE>struct.validate();<NEW_LINE>} | .uptimeSecs = iprot.readString(); |
288,721 | public static DescribeDomainsResponse unmarshall(DescribeDomainsResponse describeDomainsResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeDomainsResponse.setRequestId(_ctx.stringValue("DescribeDomainsResponse.RequestId"));<NEW_LINE>describeDomainsResponse.setTotalCount(_ctx.longValue("DescribeDomainsResponse.TotalCount"));<NEW_LINE>describeDomainsResponse.setPageNumber(_ctx.longValue("DescribeDomainsResponse.PageNumber"));<NEW_LINE>describeDomainsResponse.setPageSize(_ctx.longValue("DescribeDomainsResponse.PageSize"));<NEW_LINE>List<Domain> domains <MASK><NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeDomainsResponse.Domains.Length"); i++) {<NEW_LINE>Domain domain = new Domain();<NEW_LINE>domain.setDomainId(_ctx.stringValue("DescribeDomainsResponse.Domains[" + i + "].DomainId"));<NEW_LINE>domain.setDomainName(_ctx.stringValue("DescribeDomainsResponse.Domains[" + i + "].DomainName"));<NEW_LINE>domain.setPunyCode(_ctx.stringValue("DescribeDomainsResponse.Domains[" + i + "].PunyCode"));<NEW_LINE>domain.setAliDomain(_ctx.booleanValue("DescribeDomainsResponse.Domains[" + i + "].AliDomain"));<NEW_LINE>domain.setRecordCount(_ctx.longValue("DescribeDomainsResponse.Domains[" + i + "].RecordCount"));<NEW_LINE>domain.setRegistrantEmail(_ctx.stringValue("DescribeDomainsResponse.Domains[" + i + "].RegistrantEmail"));<NEW_LINE>domain.setRemark(_ctx.stringValue("DescribeDomainsResponse.Domains[" + i + "].Remark"));<NEW_LINE>domain.setGroupId(_ctx.stringValue("DescribeDomainsResponse.Domains[" + i + "].GroupId"));<NEW_LINE>domain.setGroupName(_ctx.stringValue("DescribeDomainsResponse.Domains[" + i + "].GroupName"));<NEW_LINE>domain.setInstanceId(_ctx.stringValue("DescribeDomainsResponse.Domains[" + i + "].InstanceId"));<NEW_LINE>domain.setVersionCode(_ctx.stringValue("DescribeDomainsResponse.Domains[" + i + "].VersionCode"));<NEW_LINE>domain.setVersionName(_ctx.stringValue("DescribeDomainsResponse.Domains[" + i + "].VersionName"));<NEW_LINE>domain.setInstanceEndTime(_ctx.stringValue("DescribeDomainsResponse.Domains[" + i + "].InstanceEndTime"));<NEW_LINE>domain.setInstanceExpired(_ctx.booleanValue("DescribeDomainsResponse.Domains[" + i + "].InstanceExpired"));<NEW_LINE>domain.setStarmark(_ctx.booleanValue("DescribeDomainsResponse.Domains[" + i + "].Starmark"));<NEW_LINE>domain.setCreateTime(_ctx.stringValue("DescribeDomainsResponse.Domains[" + i + "].CreateTime"));<NEW_LINE>domain.setCreateTimestamp(_ctx.longValue("DescribeDomainsResponse.Domains[" + i + "].CreateTimestamp"));<NEW_LINE>domain.setResourceGroupId(_ctx.stringValue("DescribeDomainsResponse.Domains[" + i + "].ResourceGroupId"));<NEW_LINE>List<String> dnsServers = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeDomainsResponse.Domains[" + i + "].DnsServers.Length"); j++) {<NEW_LINE>dnsServers.add(_ctx.stringValue("DescribeDomainsResponse.Domains[" + i + "].DnsServers[" + j + "]"));<NEW_LINE>}<NEW_LINE>domain.setDnsServers(dnsServers);<NEW_LINE>List<Tag> tags = new ArrayList<Tag>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeDomainsResponse.Domains[" + i + "].Tags.Length"); j++) {<NEW_LINE>Tag tag = new Tag();<NEW_LINE>tag.setKey(_ctx.stringValue("DescribeDomainsResponse.Domains[" + i + "].Tags[" + j + "].Key"));<NEW_LINE>tag.setValue(_ctx.stringValue("DescribeDomainsResponse.Domains[" + i + "].Tags[" + j + "].Value"));<NEW_LINE>tags.add(tag);<NEW_LINE>}<NEW_LINE>domain.setTags(tags);<NEW_LINE>domains.add(domain);<NEW_LINE>}<NEW_LINE>describeDomainsResponse.setDomains(domains);<NEW_LINE>return describeDomainsResponse;<NEW_LINE>} | = new ArrayList<Domain>(); |
759,701 | public Object doAround(ProceedingJoinPoint proceedingJoinPoint) throws Throwable {<NEW_LINE>MethodSignature sign = <MASK><NEW_LINE>Method method = sign.getMethod();<NEW_LINE>Object target = proceedingJoinPoint.getTarget();<NEW_LINE>Object[] args = proceedingJoinPoint.getArgs();<NEW_LINE>Object result = proceedingJoinPoint.proceed();<NEW_LINE>CacheConfig cacheConfig = method.getDeclaringClass().getAnnotation(CacheConfig.class);<NEW_LINE>CacheEvict cacheEvict = method.getAnnotation(CacheEvict.class);<NEW_LINE>CacheType cacheType = getCacheType(cacheConfig, cacheEvict);<NEW_LINE>if (cacheType != null) {<NEW_LINE>String cacheKey;<NEW_LINE>if (cacheEvict.key().isEmpty()) {<NEW_LINE>cacheKey = (String) cacheKeyGenerator.generate(target, method, args);<NEW_LINE>} else {<NEW_LINE>cacheKey = cacheEvict.key();<NEW_LINE>if (cacheEvict.key().contains(EL_SYMBOL)) {<NEW_LINE>cacheKey = parseKey(cacheEvict.key(), Arrays.asList(args));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (StringUtils.isNotEmpty(cacheKey)) {<NEW_LINE>cacheNotifyService.notifyMaster(new CacheExpireCommand(cacheType, cacheKey).convert2Command());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | (MethodSignature) proceedingJoinPoint.getSignature(); |
329,147 | protected void fillData(boolean trimList) {<NEW_LINE>super.fillData(trimList);<NEW_LINE>ViewGroup group = (ViewGroup) findViewById(R.id.extra_strings);<NEW_LINE>if (trimList) {<NEW_LINE>group.removeAllViews();<NEW_LINE>}<NEW_LINE>PwEntryV4 entry = (PwEntryV4) mEntry;<NEW_LINE>PwDatabase pm = App.getDB().pm;<NEW_LINE>SprEngine spr = SprEngineV4.getInstance(pm);<NEW_LINE>// Display custom strings<NEW_LINE>if (entry.strings.size() > 0) {<NEW_LINE>for (Map.Entry<String, ProtectedString> pair : entry.strings.entrySet()) {<NEW_LINE>String key = pair.getKey();<NEW_LINE>if (!PwEntryV4.IsStandardString(key)) {<NEW_LINE>String text = pair<MASK><NEW_LINE>View view = new EntrySection(this, null, key, spr.compile(text, entry, pm));<NEW_LINE>group.addView(view);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .getValue().toString(); |
754,944 | public void enable() {<NEW_LINE>if (tfConfig != null) {<NEW_LINE>if (tfConfig.eIsSet(tfConfig.eClass().getEStructuralFeature("threshold"))) {<NEW_LINE>setThreshold(tfConfig.getThreshold());<NEW_LINE>}<NEW_LINE>if (tfConfig.eIsSet(tfConfig.eClass().getEStructuralFeature("callbackPeriod"))) {<NEW_LINE>setCallbackPeriod(tfConfig.getCallbackPeriod());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>tinkerforgeDevice = new BrickletSoundIntensity(getUid(), getIpConnection());<NEW_LINE><MASK><NEW_LINE>listener = new SoundIntensityListener();<NEW_LINE>tinkerforgeDevice.addIntensityListener(listener);<NEW_LINE>fetchSensorValue();<NEW_LINE>} catch (TimeoutException e) {<NEW_LINE>TinkerforgeErrorHandler.handleError(this, TinkerforgeErrorHandler.TF_TIMEOUT_EXCEPTION, e);<NEW_LINE>} catch (NotConnectedException e) {<NEW_LINE>TinkerforgeErrorHandler.handleError(this, TinkerforgeErrorHandler.TF_NOT_CONNECTION_EXCEPTION, e);<NEW_LINE>}<NEW_LINE>} | tinkerforgeDevice.setIntensityCallbackPeriod(getCallbackPeriod()); |
1,664,563 | private BType readBType(DataInputStream dataInStream) throws IOException {<NEW_LINE><MASK><NEW_LINE>CPEntry cpEntry = this.env.constantPool[typeCpIndex];<NEW_LINE>BType type = null;<NEW_LINE>if (cpEntry != null) {<NEW_LINE>type = ((CPEntry.ShapeCPEntry) cpEntry).shape;<NEW_LINE>if (type.tag != TypeTags.INVOKABLE) {<NEW_LINE>return type;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (type == null) {<NEW_LINE>byte[] e = env.unparsedBTypeCPs.get(typeCpIndex);<NEW_LINE>type = new BIRTypeReader(new DataInputStream(new ByteArrayInputStream(e))).readType(typeCpIndex);<NEW_LINE>addShapeCP(type, typeCpIndex);<NEW_LINE>}<NEW_LINE>if (type.tag == TypeTags.INVOKABLE) {<NEW_LINE>return createClonedInvokableTypeWithTsymbol((BInvokableType) type);<NEW_LINE>}<NEW_LINE>return type;<NEW_LINE>} | int typeCpIndex = dataInStream.readInt(); |
1,731,246 | final ExecuteStatementResult executeExecuteStatement(ExecuteStatementRequest executeStatementRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(executeStatementRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ExecuteStatementRequest> request = null;<NEW_LINE>Response<ExecuteStatementResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ExecuteStatementRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(executeStatementRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "DynamoDB");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ExecuteStatement");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ExecuteStatementResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ExecuteStatementResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); |
49,917 | public void run(RegressionEnvironment env) {<NEW_LINE>String epl = "@name('s0') " + "inlined_class \"\"\"\n" + " public class MyUtil { public static boolean compareIt(String one, String two) { return one.equals(two); } }\n" + "\"\"\" \n" + "select * from SupportBean_S0('abc' = (select p11 from SupportBean_S1#keepall where MyUtil.compareIt(s0.p00,p10))) as s0;\n";<NEW_LINE>env.compileDeploy<MASK><NEW_LINE>sendS0Assert(env, 1, "a", false);<NEW_LINE>env.sendEventBean(new SupportBean_S1(10, "x", "abc"));<NEW_LINE>sendS0Assert(env, 1, "a", false);<NEW_LINE>env.sendEventBean(new SupportBean_S1(11, "a", "abc"));<NEW_LINE>sendS0Assert(env, 3, "a", true);<NEW_LINE>sendS0Assert(env, 4, "x", true);<NEW_LINE>sendS0Assert(env, 5, "y", false);<NEW_LINE>env.undeployAll();<NEW_LINE>} | (epl).addListener("s0"); |
946,632 | final UpdateVpcLinkResult executeUpdateVpcLink(UpdateVpcLinkRequest updateVpcLinkRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateVpcLinkRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateVpcLinkRequest> request = null;<NEW_LINE>Response<UpdateVpcLinkResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateVpcLinkRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateVpcLinkRequest));<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, "API Gateway");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateVpcLink");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateVpcLinkResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateVpcLinkResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); |
969,646 | public static String tinyfd_inputBox(@Nullable @NativeType("char const *") CharSequence aTitle, @Nullable @NativeType("char const *") CharSequence aMessage, @Nullable @NativeType("char const *") CharSequence aDefaultInput) {<NEW_LINE>MemoryStack stack = stackGet();<NEW_LINE>int stackPointer = stack.getPointer();<NEW_LINE>try {<NEW_LINE>stack.nUTF8Safe(aTitle, true);<NEW_LINE>long aTitleEncoded = aTitle == null ? NULL : stack.getPointerAddress();<NEW_LINE>stack.nUTF8Safe(aMessage, true);<NEW_LINE>long aMessageEncoded = aMessage == null ? NULL : stack.getPointerAddress();<NEW_LINE>stack.nUTF8Safe(aDefaultInput, true);<NEW_LINE>long aDefaultInputEncoded = aDefaultInput == null ? NULL : stack.getPointerAddress();<NEW_LINE>long __result = <MASK><NEW_LINE>return memUTF8Safe(__result);<NEW_LINE>} finally {<NEW_LINE>stack.setPointer(stackPointer);<NEW_LINE>}<NEW_LINE>} | ntinyfd_inputBox(aTitleEncoded, aMessageEncoded, aDefaultInputEncoded); |
1,555,643 | public Page<EntCustomer> findByCreaterAndSharesAndOrgi(String creater, String shares, String orgi, Date begin, Date end, boolean includeDeleteData, String q, Pageable page) {<NEW_LINE><MASK><NEW_LINE>BoolQueryBuilder boolQueryBuilder1 = new BoolQueryBuilder();<NEW_LINE>boolQueryBuilder1.should(termQuery("creater", creater));<NEW_LINE>boolQueryBuilder1.should(termQuery("shares", creater));<NEW_LINE>boolQueryBuilder1.should(termQuery("shares", "all"));<NEW_LINE>boolQueryBuilder.must(boolQueryBuilder1);<NEW_LINE>boolQueryBuilder.must(termQuery("orgi", orgi));<NEW_LINE>if (includeDeleteData) {<NEW_LINE>boolQueryBuilder.must(termQuery("datastatus", true));<NEW_LINE>} else {<NEW_LINE>boolQueryBuilder.must(termQuery("datastatus", false));<NEW_LINE>}<NEW_LINE>RangeQueryBuilder rangeQuery = QueryBuilders.rangeQuery("createtime");<NEW_LINE>if (begin != null) {<NEW_LINE>rangeQuery.from(dateFromate.format(begin));<NEW_LINE>}<NEW_LINE>if (end != null) {<NEW_LINE>rangeQuery.to(dateFromate.format(end));<NEW_LINE>} else {<NEW_LINE>rangeQuery.to(dateFromate.format(new Date()));<NEW_LINE>}<NEW_LINE>if (begin != null || end != null) {<NEW_LINE>boolQueryBuilder.must(rangeQuery);<NEW_LINE>}<NEW_LINE>if (!StringUtils.isBlank(q)) {<NEW_LINE>boolQueryBuilder.must(new QueryStringQueryBuilder(q).defaultOperator(Operator.AND));<NEW_LINE>}<NEW_LINE>return processQuery(boolQueryBuilder, page);<NEW_LINE>} | BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery(); |
175,538 | public void testPubSubDurable_B_SecOff(HttpServletRequest request, HttpServletResponse response) throws Exception {<NEW_LINE>Topic jmsTopic = jmsContextTopic.createTopic("Topic1");<NEW_LINE>JMSConsumer jmsConsumer = jmsContextTopic.createDurableConsumer(jmsTopic, "sub1");<NEW_LINE>String msgOutText = "testPubSubDurable_B_SecOff";<NEW_LINE>TextMessage <MASK><NEW_LINE>jmsContextTopic.createProducer().send(jmsTopic, msgOut);<NEW_LINE>TextMessage msgIn = (TextMessage) jmsConsumer.receive(500);<NEW_LINE>jmsConsumer.close();<NEW_LINE>if (msgIn == null) {<NEW_LINE>throw new Exception("testPubSubDurable_B_SecOff failed: Null received message");<NEW_LINE>} else {<NEW_LINE>String msgInText = msgIn.getText();<NEW_LINE>if (!msgInText.equals(msgOutText)) {<NEW_LINE>throw new Exception("testPubSubDurable_B_SecOff failed: Sent [ " + msgOutText + " ] but received [ " + msgInText + " ]");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | msgOut = jmsContextTopic.createTextMessage(msgOutText); |
523,783 | private void encodeDisabledMenuItem(FacesContext context, MenuItem menuItem) throws IOException {<NEW_LINE><MASK><NEW_LINE>String style = menuItem.getStyle();<NEW_LINE>String styleClass = getStyleClassBuilder(context).add(BreadCrumb.MENUITEM_LINK_CLASS).add(menuItem.getStyleClass()).add("ui-state-disabled").build();<NEW_LINE>// outer span<NEW_LINE>writer.startElement("span", null);<NEW_LINE>writer.writeAttribute("class", styleClass, null);<NEW_LINE>if (style != null) {<NEW_LINE>writer.writeAttribute("style", style, null);<NEW_LINE>}<NEW_LINE>String icon = menuItem.getIcon();<NEW_LINE>Object value = menuItem.getValue();<NEW_LINE>if (icon != null) {<NEW_LINE>writer.startElement("span", null);<NEW_LINE>writer.writeAttribute("class", BreadCrumb.MENUITEM_ICON_CLASS + " " + icon, null);<NEW_LINE>writer.writeAttribute(HTML.ARIA_HIDDEN, "true", null);<NEW_LINE>writer.endElement("span");<NEW_LINE>}<NEW_LINE>writer.startElement("span", null);<NEW_LINE>writer.writeAttribute("class", BreadCrumb.MENUITEM_TEXT_CLASS, null);<NEW_LINE>if (value != null) {<NEW_LINE>if (menuItem.isEscape()) {<NEW_LINE>writer.writeText(value, "value");<NEW_LINE>} else {<NEW_LINE>writer.write(value.toString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// text span<NEW_LINE>writer.endElement("span");<NEW_LINE>// outer span<NEW_LINE>writer.endElement("span");<NEW_LINE>} | ResponseWriter writer = context.getResponseWriter(); |
1,469,992 | public void updateAnomalyAlertConfiguration() {<NEW_LINE>// BEGIN: com.azure.ai.metricsadvisor.administration.MetricsAdvisorAdministrationAsyncClient.updateAlertConfig#AnomalyAlertConfiguration<NEW_LINE>String alertConfigId = "1p0f8er30-6e6e-4391-b78f-bpfdfee1e6f5";<NEW_LINE>String additionalHookId = "2gh8er30-6e6e-4391-b78f-bpfdfee1e6f5";<NEW_LINE>metricsAdvisorAdminAsyncClient.getAlertConfig(alertConfigId).flatMap(existingAnomalyConfig -> {<NEW_LINE>List<String> hookIds = new ArrayList<>(existingAnomalyConfig.getHookIdsToAlert());<NEW_LINE>hookIds.add(additionalHookId);<NEW_LINE>return metricsAdvisorAdminAsyncClient.updateAlertConfig(existingAnomalyConfig.setHookIdsToAlert(hookIds).setDescription("updated to add more hook ids"));<NEW_LINE>}).subscribe(updateAnomalyAlertConfiguration -> {<NEW_LINE>System.out.printf("Updated anomaly alert configuration Id: %s%n", updateAnomalyAlertConfiguration.getId());<NEW_LINE>System.out.printf(<MASK><NEW_LINE>System.out.printf("Updated anomaly alert configuration hook ids: %s%n", updateAnomalyAlertConfiguration.getHookIdsToAlert());<NEW_LINE>});<NEW_LINE>// END: com.azure.ai.metricsadvisor.administration.MetricsAdvisorAdministrationAsyncClient.updateAlertConfig#AnomalyAlertConfiguration<NEW_LINE>} | "Updated anomaly alert configuration description: %s%n", updateAnomalyAlertConfiguration.getDescription()); |
1,827,799 | static void printTracerHistogram(PrintStream out, CPUTracer tracer) {<NEW_LINE>List<CPUTracer.Payload> payloads = new ArrayList<>(tracer.getPayloads());<NEW_LINE>payloads.sort(new Comparator<CPUTracer.Payload>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int compare(CPUTracer.Payload o1, CPUTracer.Payload o2) {<NEW_LINE>return Long.compare(o2.getCount(), o1.getCount());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>int length = computeNameLength(payloads, 50);<NEW_LINE>String format = " %-" + length + "s | %20s | %20s | %20s | %s";<NEW_LINE>String title = String.format(format, "Name", <MASK><NEW_LINE>String sep = repeat("-", title.length());<NEW_LINE>long totalCount = 0;<NEW_LINE>for (CPUTracer.Payload payload : payloads) {<NEW_LINE>totalCount += payload.getCount();<NEW_LINE>}<NEW_LINE>out.println(sep);<NEW_LINE>out.println(String.format("Tracing Histogram. Counted a total of %d element executions.", totalCount));<NEW_LINE>out.println(" Total Count: Number of times the element was executed and percentage of total executions.");<NEW_LINE>out.println(" Interpreted Count: Number of times the element was interpreted and percentage of total executions of this element.");<NEW_LINE>out.println(" Compiled Count: Number of times the compiled element was executed and percentage of total executions of this element.");<NEW_LINE>out.println(sep);<NEW_LINE>out.println(title);<NEW_LINE>out.println(sep);<NEW_LINE>for (CPUTracer.Payload payload : payloads) {<NEW_LINE>String total = String.format("%d %5.1f%%", payload.getCount(), (double) payload.getCount() * 100 / totalCount);<NEW_LINE>String interpreted = String.format("%d %5.1f%%", payload.getCountInterpreted(), (double) payload.getCountInterpreted() * 100 / payload.getCount());<NEW_LINE>String compiled = String.format("%d %5.1f%%", payload.getCountCompiled(), (double) payload.getCountCompiled() * 100 / payload.getCount());<NEW_LINE>out.println(String.format(format, payload.getRootName(), total, interpreted, compiled, getShortDescription(payload.getSourceSection())));<NEW_LINE>}<NEW_LINE>out.println(sep);<NEW_LINE>} | "Total Count", "Interpreted Count", "Compiled Count", "Location"); |
1,453,869 | private boolean cancelScheduledTrip(String feedId, String tripId, final ServiceDate serviceDate) {<NEW_LINE>boolean success = false;<NEW_LINE>final TripPattern pattern = getPatternForTripId(feedId, tripId);<NEW_LINE>if (pattern != null) {<NEW_LINE>// Cancel scheduled trip times for this trip in this pattern<NEW_LINE>final Timetable timetable = pattern.getScheduledTimetable();<NEW_LINE>final int tripIndex = timetable.getTripIndex(tripId);<NEW_LINE>if (tripIndex == -1) {<NEW_LINE>LOG.warn("Could not cancel scheduled trip {}", tripId);<NEW_LINE>} else {<NEW_LINE>final TripTimes newTripTimes = new TripTimes(timetable.getTripTimes(tripIndex));<NEW_LINE>newTripTimes.cancelTrip();<NEW_LINE>buffer.<MASK><NEW_LINE>success = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return success;<NEW_LINE>} | update(pattern, newTripTimes, serviceDate); |
1,566,781 | protected void internalRemoveOffloadPolicies(AsyncResponse asyncResponse) {<NEW_LINE>validateNamespacePolicyOperation(namespaceName, PolicyName.OFFLOAD, PolicyOperation.WRITE);<NEW_LINE>validatePoliciesReadOnlyAccess();<NEW_LINE>try {<NEW_LINE>namespaceResources().setPoliciesAsync(namespaceName, (policies) -> {<NEW_LINE>policies.offload_policies = null;<NEW_LINE>return policies;<NEW_LINE>}).thenApply(r -> {<NEW_LINE>log.info("[{}] Successfully remove offload configuration: namespace={}", clientAppId(), namespaceName);<NEW_LINE>asyncResponse.resume(Response.noContent().build());<NEW_LINE>return null;<NEW_LINE>}).exceptionally(e -> {<NEW_LINE>log.error("[{}] Failed to remove offload configuration for namespace {}", <MASK><NEW_LINE>asyncResponse.resume(e.getCause() instanceof NotFoundException ? new RestException(Status.CONFLICT, "Concurrent modification") : new RestException(e));<NEW_LINE>return null;<NEW_LINE>});<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.error("[{}] Failed to remove offload configuration for namespace {}", clientAppId(), namespaceName, e);<NEW_LINE>asyncResponse.resume(new RestException(e));<NEW_LINE>}<NEW_LINE>} | clientAppId(), namespaceName, e); |
1,706,089 | public Object interpret(ExecutionContext context, boolean debug) {<NEW_LINE>Object ref = getMemberExpression().interpret(context, debug);<NEW_LINE>Object function = getValue(this.functionGet, context, ref);<NEW_LINE>List<Expression> argExprs = getArgumentExpressions();<NEW_LINE>Object[] args = new Object[argExprs.size()];<NEW_LINE>int numArgs = argExprs.size();<NEW_LINE>for (int i = 0; i < numArgs; ++i) {<NEW_LINE>Expression each = this.argExprs.get(i);<NEW_LINE>CallSite eachGet = this.argGets.get(i);<NEW_LINE>Object value = getValue(eachGet, context, each.interpret(context, debug));<NEW_LINE>// System.err.println( "ARG: " + i + " -> " + each + " // " + value );<NEW_LINE>args[i] = value;<NEW_LINE>}<NEW_LINE>Object thisValue = null;<NEW_LINE>if (ref instanceof Reference) {<NEW_LINE>if (((Reference) ref).isPropertyReference()) {<NEW_LINE>thisValue = ((Reference) ref).getBase();<NEW_LINE>} else {<NEW_LINE>thisValue = ((EnvironmentRecord) ((Reference) ref).getBase()).implicitThisValue();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (thisValue == null) {<NEW_LINE>thisValue = Types.UNDEFINED;<NEW_LINE>}<NEW_LINE>if (ref instanceof Reference) {<NEW_LINE>function = new DereferencedReference((Reference) ref, function);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>// System.err.println( "CALL: "+ function + " // " + thisValue + " :: " + Arrays.asList( args ) );<NEW_LINE>return this.functionCall.getTarget().invoke(function, context, thisValue, args);<NEW_LINE>} catch (ThrowException e) {<NEW_LINE>throw e;<NEW_LINE>} catch (NoSuchMethodError e) {<NEW_LINE>throw new ThrowException((ExecutionContext) context, ((ExecutionContext) context).createTypeError("not callable: " <MASK><NEW_LINE>} catch (Throwable e) {<NEW_LINE>throw new ThrowException((ExecutionContext) context, e);<NEW_LINE>}<NEW_LINE>} | + function.toString())); |
1,844,585 | public DescribeScheduledAuditResult describeScheduledAudit(DescribeScheduledAuditRequest describeScheduledAuditRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeScheduledAuditRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeScheduledAuditRequest> request = null;<NEW_LINE>Response<DescribeScheduledAuditResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeScheduledAuditRequestMarshaller().marshall(describeScheduledAuditRequest);<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>Unmarshaller<DescribeScheduledAuditResult, JsonUnmarshallerContext> unmarshaller = new DescribeScheduledAuditResultJsonUnmarshaller();<NEW_LINE>JsonResponseHandler<DescribeScheduledAuditResult> responseHandler = new JsonResponseHandler<DescribeScheduledAuditResult>(unmarshaller);<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.ClientExecuteTime);<NEW_LINE>endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.endEvent(Field.RequestMarshallTime); |
223,478 | private FourNode generate4Node(ThreeNode parentNode, TwoNode newNode) {<NEW_LINE>boolean isLeftNode = parentNode.leftKey.compareTo(newNode.key) > 0;<NEW_LINE>boolean isRightNode = parentNode.rightKey.<MASK><NEW_LINE>// Create temporary 4-node<NEW_LINE>FourNode newFourNode;<NEW_LINE>int newSize = parentNode.size;<NEW_LINE>if (isLeftNode) {<NEW_LINE>newFourNode = new FourNode(newNode.key, newNode.value, parentNode.leftKey, parentNode.leftValue, parentNode.rightKey, parentNode.rightValue, newSize);<NEW_LINE>newFourNode.left = newNode.left;<NEW_LINE>newFourNode.middle1 = newNode.right;<NEW_LINE>newFourNode.middle2 = parentNode.middle;<NEW_LINE>newFourNode.right = parentNode.right;<NEW_LINE>} else if (isRightNode) {<NEW_LINE>newFourNode = new FourNode(parentNode.leftKey, parentNode.leftValue, parentNode.rightKey, parentNode.rightValue, newNode.key, newNode.value, newSize);<NEW_LINE>newFourNode.left = parentNode.left;<NEW_LINE>newFourNode.middle1 = parentNode.middle;<NEW_LINE>newFourNode.middle2 = newNode.left;<NEW_LINE>newFourNode.right = newNode.right;<NEW_LINE>} else {<NEW_LINE>newFourNode = new FourNode(parentNode.leftKey, parentNode.leftValue, newNode.key, newNode.value, parentNode.rightKey, parentNode.rightValue, newSize);<NEW_LINE>newFourNode.left = parentNode.left;<NEW_LINE>newFourNode.middle1 = newNode.left;<NEW_LINE>newFourNode.middle2 = newNode.right;<NEW_LINE>newFourNode.right = parentNode.right;<NEW_LINE>}<NEW_LINE>return newFourNode;<NEW_LINE>} | compareTo(newNode.key) < 0; |
920,248 | public void add(DLNAResource resource) {<NEW_LINE>DLNAResource res1;<NEW_LINE>LOGGER.debug("Adding \"{}\" to playlist \"{}\"", resource.getDisplayName(), getName());<NEW_LINE>if (resource instanceof VirtualVideoAction) {<NEW_LINE>// don't add these<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (resource.getParent() == this) {<NEW_LINE>// best guess<NEW_LINE>res1 = resource;<NEW_LINE>for (DLNAResource r : list) {<NEW_LINE>if (r.getName().equals(resource.getName()) && r.getSystemName().equals(resource.getSystemName())) {<NEW_LINE>res1 = r;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>String data = resource.write();<NEW_LINE>if (!StringUtils.isEmpty(data) && resource.getMasterParent() != null) {<NEW_LINE>res1 = IOList.resolveCreateMethod(resource.getMasterParent(), data);<NEW_LINE>res1.setMasterParent(resource.getMasterParent());<NEW_LINE>res1.setMediaAudio(resource.getMediaAudio());<NEW_LINE>res1.setMediaSubtitle(resource.getMediaSubtitle());<NEW_LINE>res1.<MASK><NEW_LINE>} else {<NEW_LINE>res1 = resource.clone();<NEW_LINE>res1.setResume(resource.getResume());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>list.remove(res1);<NEW_LINE>if (maxSize > 0 && list.size() == maxSize) {<NEW_LINE>list.remove(maxSize - 1);<NEW_LINE>}<NEW_LINE>list.add(0, res1);<NEW_LINE>update();<NEW_LINE>} | setResume(resource.getResume()); |
35,002 | public void endVisit(InfixExpression node) {<NEW_LINE>InfixExpression.<MASK><NEW_LINE>if (typeUtil.isString(node.getTypeMirror()) && op == InfixExpression.Operator.PLUS) {<NEW_LINE>rewriteStringConcat(node);<NEW_LINE>} else if (op == InfixExpression.Operator.CONDITIONAL_AND) {<NEW_LINE>// Avoid logical-op-parentheses compiler warnings.<NEW_LINE>if (node.getParent() instanceof InfixExpression) {<NEW_LINE>InfixExpression parent = (InfixExpression) node.getParent();<NEW_LINE>if (parent.getOperator() == InfixExpression.Operator.CONDITIONAL_OR) {<NEW_LINE>ParenthesizedExpression.parenthesizeAndReplace(node);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (op == InfixExpression.Operator.AND) {<NEW_LINE>// Avoid bitwise-op-parentheses compiler warnings.<NEW_LINE>if (node.getParent() instanceof InfixExpression) {<NEW_LINE>InfixExpression.Operator otherOp = ((InfixExpression) node.getParent()).getOperator();<NEW_LINE>if (otherOp == InfixExpression.Operator.OR || otherOp == InfixExpression.Operator.XOR) {<NEW_LINE>ParenthesizedExpression.parenthesizeAndReplace(node);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Avoid lower precedence compiler warnings.<NEW_LINE>if (op == InfixExpression.Operator.AND || op == InfixExpression.Operator.OR) {<NEW_LINE>for (Expression operand : node.getOperands()) {<NEW_LINE>if (operand instanceof InfixExpression) {<NEW_LINE>ParenthesizedExpression.parenthesizeAndReplace(operand);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | Operator op = node.getOperator(); |
1,537,901 | public InternalFuture<Void> commitMultipartArtifact(CommitMultipartArtifact request) {<NEW_LINE>return getArtifactId(request.getId(), request.getKey()).thenAccept(maybeId -> {<NEW_LINE>final var id = maybeId.orElseThrow(() -> new InvalidArgumentException(String.format(KEY_S_NOT_LOGGED_ERROR, request.getKey())));<NEW_LINE>try (var session = modelDBHibernateUtil.getSessionFactory().openSession()) {<NEW_LINE>final var artifactEntity = session.get(ArtifactEntity.class, id, LockMode.PESSIMISTIC_WRITE);<NEW_LINE>if (artifactEntity.getUploadId() == null) {<NEW_LINE>var message = "Multipart wasn't initialized OR Multipart artifact already committed";<NEW_LINE>throw new InvalidArgumentException(message);<NEW_LINE>}<NEW_LINE>Set<ArtifactPartEntity> artifactPartEntities = VersioningUtils.getArtifactPartEntities(session, String.valueOf(artifactEntity.getId<MASK><NEW_LINE>final var partETags = artifactPartEntities.stream().map(ArtifactPartEntity::toPartETag).collect(Collectors.toList());<NEW_LINE>artifactStoreDAO.commitMultipart(artifactEntity.getPath(), artifactEntity.getUploadId(), partETags);<NEW_LINE>session.beginTransaction();<NEW_LINE>artifactEntity.setUploadCompleted(true);<NEW_LINE>artifactEntity.setUploadId(null);<NEW_LINE>session.getTransaction().commit();<NEW_LINE>}<NEW_LINE>}, executor);<NEW_LINE>} | ()), this.artifactEntityType); |
1,713,857 | private Mono<PagedResponse<AvailabilityStatusInner>> listBySubscriptionIdSinglePageAsync(String filter, String expand, 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>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.listBySubscriptionId(this.client.getEndpoint(), this.client.getApiVersion(), filter, this.client.getSubscriptionId(), expand, accept, context).map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue()<MASK><NEW_LINE>} | .nextLink(), null)); |
1,521,219 | private void ensureType(String shortName, ExportType etype) {<NEW_LINE>boolean hasType = typeMap.containsKey(shortName);<NEW_LINE>if (!hasType) {<NEW_LINE>Integer prior = typeMap.putIfAbsent(shortName, etype.value());<NEW_LINE>if (prior == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// some other thread got there first<NEW_LINE>}<NEW_LINE>Integer bitmask = ExportType.NONE.value();<NEW_LINE>boolean done;<NEW_LINE>Integer newValue;<NEW_LINE>int tries = 0;<NEW_LINE>do {<NEW_LINE>bitmask = typeMap.get(shortName);<NEW_LINE>newValue = bitmask | etype.value();<NEW_LINE>if (bitmask == newValue) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>done = typeMap.<MASK><NEW_LINE>tries++;<NEW_LINE>} while (!done);<NEW_LINE>if (logger.isTraceEnabled()) {<NEW_LINE>logger.trace("Updated type for " + shortName + ", added " + etype + ", was " + bitmask + ", now " + newValue + " (after " + tries + " tries)");<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>} | replace(shortName, bitmask, newValue); |
396,151 | protected ProfilingPoint loadProfilingPoint(Lookup.Provider project, Properties properties, int index) {<NEW_LINE>// NOI18N<NEW_LINE>String name = properties.getProperty(index + "_" + ProfilingPoint.PROPERTY_NAME, null);<NEW_LINE>// NOI18N<NEW_LINE>String enabledStr = properties.getProperty(index + "_" + ProfilingPoint.PROPERTY_ENABLED, null);<NEW_LINE>CodeProfilingPoint.Location location = CodeProfilingPoint.Location.load(project, index, properties);<NEW_LINE>if ((name == null) || (enabledStr == null) || (location == null)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>ResetResultsProfilingPoint profilingPoint = null;<NEW_LINE>try {<NEW_LINE>profilingPoint = new ResetResultsProfilingPoint(<MASK><NEW_LINE>profilingPoint.setEnabled(Boolean.parseBoolean(enabledStr));<NEW_LINE>} catch (Exception e) {<NEW_LINE>ErrorManager.getDefault().log(ErrorManager.ERROR, e.getMessage());<NEW_LINE>}<NEW_LINE>return profilingPoint;<NEW_LINE>} | name, location, project, this); |
1,510,906 | public void handle(Map data) {<NEW_LINE>markSnapshotTreeCompleted(snapshot);<NEW_LINE>if (volumeNewInstallPath != null) {<NEW_LINE>vol.setInstallPath(volumeNewInstallPath);<NEW_LINE>dbf.update(vol);<NEW_LINE>}<NEW_LINE>VolumeSnapshotVO svo = dbf.findByUuid(snapshot.getUuid(), VolumeSnapshotVO.class);<NEW_LINE>svo.setType(snapshot.getType());<NEW_LINE>svo.setPrimaryStorageUuid(snapshot.getPrimaryStorageUuid());<NEW_LINE>svo.setPrimaryStorageInstallPath(snapshot.getPrimaryStorageInstallPath());<NEW_LINE>svo.setStatus(VolumeSnapshotStatus.Ready);<NEW_LINE>svo.<MASK><NEW_LINE>if (snapshot.getFormat() != null) {<NEW_LINE>svo.setFormat(snapshot.getFormat());<NEW_LINE>}<NEW_LINE>svo = dbf.updateAndRefresh(svo);<NEW_LINE>new FireSnapShotCanonicalEvent().fireSnapShotStatusChangedEvent(VolumeSnapshotStatus.valueOf(snapshot.getStatus()), VolumeSnapshotInventory.valueOf(svo));<NEW_LINE>ret.setInventory(VolumeSnapshotInventory.valueOf(svo));<NEW_LINE>bus.reply(msg, ret);<NEW_LINE>} | setSize(snapshot.getSize()); |
429,239 | void serialize(XmlSerializer serializer, String elementNamespaceUri, String elementLocalName) throws IOException {<NEW_LINE>boolean errorOnUnknown = this.errorOnUnknown;<NEW_LINE>if (elementLocalName == null) {<NEW_LINE>if (errorOnUnknown) {<NEW_LINE>throw new IllegalArgumentException("XML name not specified");<NEW_LINE>}<NEW_LINE>elementLocalName = "unknownName";<NEW_LINE>}<NEW_LINE>serializer.startTag(elementNamespaceUri, elementLocalName);<NEW_LINE>// attributes<NEW_LINE>int num = attributeNames.size();<NEW_LINE>for (int i = 0; i < num; i++) {<NEW_LINE>String attributeName = attributeNames.get(i);<NEW_LINE>int colon = attributeName.indexOf(':');<NEW_LINE>String attributeLocalName = attributeName.substring(colon + 1);<NEW_LINE>String attributeNamespaceUri = colon == -1 ? null : getNamespaceUriForAliasHandlingUnknown(errorOnUnknown, attributeName.substring(0, colon));<NEW_LINE>serializer.attribute(attributeNamespaceUri, attributeLocalName, toSerializedValue(<MASK><NEW_LINE>}<NEW_LINE>// text<NEW_LINE>if (textValue != null) {<NEW_LINE>serializer.text(toSerializedValue(textValue));<NEW_LINE>}<NEW_LINE>// elements<NEW_LINE>num = subElementNames.size();<NEW_LINE>for (int i = 0; i < num; i++) {<NEW_LINE>Object subElementValue = subElementValues.get(i);<NEW_LINE>String subElementName = subElementNames.get(i);<NEW_LINE>Class<? extends Object> valueClass = subElementValue.getClass();<NEW_LINE>if (subElementValue instanceof Iterable<?> || valueClass.isArray()) {<NEW_LINE>for (Object subElement : Types.iterableOf(subElementValue)) {<NEW_LINE>if (subElement != null && !Data.isNull(subElement)) {<NEW_LINE>new ElementSerializer(subElement, errorOnUnknown).serialize(serializer, subElementName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>new ElementSerializer(subElementValue, errorOnUnknown).serialize(serializer, subElementName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>serializer.endTag(elementNamespaceUri, elementLocalName);<NEW_LINE>} | attributeValues.get(i))); |
1,548,410 | private Mono<Response<Flux<ByteBuffer>>> deleteWithResponseAsync(String resourceGroupName, String registryName, String replicationName, 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.<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 (registryName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (replicationName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter replicationName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String apiVersion = "2021-09-01";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, registryName, replicationName, context);<NEW_LINE>} | error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); |
1,162,001 | public Set<ConfigDocGeneratedOutput> scanExtensionsConfigurationItems(Properties javaDocProperties) throws IOException {<NEW_LINE>Set<ConfigDocGeneratedOutput> configDocGeneratedOutputs = new HashSet<>();<NEW_LINE>final ConfigDoItemFinder configDoItemFinder = new ConfigDoItemFinder(configRoots, configGroupsToTypeElement, javaDocProperties, allConfigGroupGeneratedDocs, allExtensionGeneratedDocs);<NEW_LINE>final ScannedConfigDocsItemHolder inMemoryScannedItemsHolder = configDoItemFinder.findInMemoryConfigurationItems();<NEW_LINE>if (!inMemoryScannedItemsHolder.isEmpty()) {<NEW_LINE>updateScannedExtensionArtifactFiles(inMemoryScannedItemsHolder);<NEW_LINE>}<NEW_LINE>Set<<MASK><NEW_LINE>Set<ConfigDocGeneratedOutput> configGroupConfigItems = generateAllConfigGroupOutputs(inMemoryScannedItemsHolder);<NEW_LINE>Set<ConfigDocGeneratedOutput> configRootConfigItems = generateAllConfigRootOutputs(inMemoryScannedItemsHolder);<NEW_LINE>configDocGeneratedOutputs.addAll(configGroupConfigItems);<NEW_LINE>configDocGeneratedOutputs.addAll(allConfigItemsPerExtension);<NEW_LINE>configDocGeneratedOutputs.addAll(configRootConfigItems);<NEW_LINE>return configDocGeneratedOutputs;<NEW_LINE>} | ConfigDocGeneratedOutput> allConfigItemsPerExtension = generateAllConfigItemsOutputs(inMemoryScannedItemsHolder); |
1,066,183 | final GetCloudFormationStackRecordsResult executeGetCloudFormationStackRecords(GetCloudFormationStackRecordsRequest getCloudFormationStackRecordsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getCloudFormationStackRecordsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetCloudFormationStackRecordsRequest> request = null;<NEW_LINE>Response<GetCloudFormationStackRecordsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetCloudFormationStackRecordsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getCloudFormationStackRecordsRequest));<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, "Lightsail");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetCloudFormationStackRecords");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetCloudFormationStackRecordsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetCloudFormationStackRecordsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.endEvent(Field.RequestMarshallTime); |
549,138 | public void applyChanges() {<NEW_LINE>ShaderPackSelectionList.BaseEntry base = this.shaderPackList.getSelected();<NEW_LINE>if (!(base instanceof ShaderPackSelectionList.ShaderPackEntry)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ShaderPackSelectionList.ShaderPackEntry entry = (ShaderPackSelectionList.ShaderPackEntry) base;<NEW_LINE>this.shaderPackList.setApplied(entry);<NEW_LINE><MASK><NEW_LINE>// If the pack is being changed, clear pending options from the previous pack to<NEW_LINE>// avoid possible undefined behavior from applying one pack's options to another pack<NEW_LINE>if (!name.equals(Iris.getCurrentPackName())) {<NEW_LINE>Iris.clearShaderPackOptionQueue();<NEW_LINE>}<NEW_LINE>Iris.getIrisConfig().setShaderPackName(name);<NEW_LINE>boolean enabled = this.shaderPackList.getTopButtonRow().shadersEnabled;<NEW_LINE>IrisApi.getInstance().getConfig().setShadersEnabledAndApply(enabled);<NEW_LINE>refreshForChangedPack();<NEW_LINE>} | String name = entry.getPackName(); |
1,128,900 | protected boolean readNodeChild(org.w3c.dom.Node childNode, String childNodeName, String childNodeValue, java.util.Map namespacePrefixes) {<NEW_LINE>// assert childNodeName == childNodeName.intern()<NEW_LINE>if ("meta-element".equals(childNodeName)) {<NEW_LINE>MetaElement aMetaElement = newMetaElement();<NEW_LINE>aMetaElement.readNode(childNode, namespacePrefixes);<NEW_LINE>_MetaElement.add(aMetaElement);<NEW_LINE>} else if ("implements".equals(childNodeName)) {<NEW_LINE>_Implements = childNodeValue;<NEW_LINE>} else if ("extends".equals(childNodeName)) {<NEW_LINE>_Extends = childNodeValue;<NEW_LINE>} else if ("import".equals(childNodeName)) {<NEW_LINE>String aImport;<NEW_LINE>aImport = childNodeValue;<NEW_LINE>_Import.add(aImport);<NEW_LINE>} else if ("vetoable".equals(childNodeName)) {<NEW_LINE>if (childNode.getFirstChild() == null)<NEW_LINE>_Vetoable = true;<NEW_LINE>else<NEW_LINE>_Vetoable = ("true".equalsIgnoreCase(childNodeValue) <MASK><NEW_LINE>_isSet_Vetoable = true;<NEW_LINE>} else if ("throw-exceptions".equals(childNodeName)) {<NEW_LINE>if (childNode.getFirstChild() == null)<NEW_LINE>_ThrowExceptions = true;<NEW_LINE>else<NEW_LINE>_ThrowExceptions = ("true".equalsIgnoreCase(childNodeValue) || "1".equals(childNodeValue));<NEW_LINE>_isSet_ThrowExceptions = true;<NEW_LINE>} else if ("schemaLocation".equals(childNodeName)) {<NEW_LINE>_SchemaLocation = childNodeValue;<NEW_LINE>} else if ("finder".equals(childNodeName)) {<NEW_LINE>String aFinder;<NEW_LINE>aFinder = childNodeValue;<NEW_LINE>_Finder.add(aFinder);<NEW_LINE>} else {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | || "1".equals(childNodeValue)); |
516,785 | void build() {<NEW_LINE>if (taskBuilder == null) {<NEW_LINE>throw new IllegalStateException("You must specify the task which will contribute classes from this source directory");<NEW_LINE>}<NEW_LINE>SourceDirectorySet langSrcDir = project.getObjects().sourceDirectorySet(name, description == null ? "Sources for " + name : description);<NEW_LINE>langSrcDir.srcDir("src/" + sourceSet.getName() + "/" + name);<NEW_LINE>DefaultCompileTaskDetails details = createTaskDetails(langSrcDir);<NEW_LINE>JvmPluginsHelper.configureOutputDirectoryForSourceSet(sourceSet, langSrcDir, project, details.task, details.task.map(task -> {<NEW_LINE>if (task instanceof HasCompileOptions) {<NEW_LINE>return ((HasCompileOptions) task).getOptions();<NEW_LINE>}<NEW_LINE>throw new UnsupportedOperationException("Unsupported compile task " + task.getClass().getName());<NEW_LINE>}), Cast.uncheckedCast(details.mapping));<NEW_LINE>if (includeInAllJava) {<NEW_LINE>sourceSet.getAllJava().source(langSrcDir);<NEW_LINE>}<NEW_LINE>sourceSet.<MASK><NEW_LINE>project.getTasks().named(JavaPlugin.CLASSES_TASK_NAME).configure(classes -> classes.dependsOn(details.task));<NEW_LINE>} | getAllSource().source(langSrcDir); |
738,665 | public <K, V> ImmutableMap<K, V> with(K key1, V value1, K key2, V value2, K key3, V value3, K key4, V value4) {<NEW_LINE>if (Comparators.nullSafeEquals(key1, key2)) {<NEW_LINE>return this.of(key1, value2, key3, value3, key4, value4);<NEW_LINE>}<NEW_LINE>if (Comparators.nullSafeEquals(key1, key3)) {<NEW_LINE>return this.of(key2, value2, key1, value3, key4, value4);<NEW_LINE>}<NEW_LINE>if (Comparators.nullSafeEquals(key1, key4)) {<NEW_LINE>return this.of(key2, value2, key3, value3, key1, value4);<NEW_LINE>}<NEW_LINE>if (Comparators.nullSafeEquals(key2, key3)) {<NEW_LINE>return this.of(key1, value1, key2, value3, key4, value4);<NEW_LINE>}<NEW_LINE>if (Comparators.nullSafeEquals(key2, key4)) {<NEW_LINE>return this.of(key1, value1, key3, value3, key2, value4);<NEW_LINE>}<NEW_LINE>if (Comparators.nullSafeEquals(key3, key4)) {<NEW_LINE>return this.of(key1, value1, <MASK><NEW_LINE>}<NEW_LINE>return new ImmutableQuadrupletonMap<K, V>(key1, value1, key2, value2, key3, value3, key4, value4);<NEW_LINE>} | key2, value2, key3, value4); |
852,424 | public void run(RegressionEnvironment env) {<NEW_LINE>String stmtText = "@name('s0') select * from SupportBean#lastevent sb" + " inner join " + " SupportBeanTwo#lastevent sbt" + " on sb.theString = sbt.stringTwo " + " inner join " + " sql:MyDBWithRetain ['select myint from mytesttable'] as s1 " + " on s1.myint = sbt.intPrimitiveTwo";<NEW_LINE>env.compileDeploy(stmtText).addListener("s0");<NEW_LINE>env.sendEventBean(<MASK><NEW_LINE>env.sendEventBean(new SupportBean("T1", -1));<NEW_LINE>env.sendEventBean(new SupportBeanTwo("T2", 30));<NEW_LINE>env.sendEventBean(new SupportBean("T2", -1));<NEW_LINE>env.assertPropsNew("s0", "sb.theString,sbt.stringTwo,s1.myint".split(","), new Object[] { "T2", "T2", 30 });<NEW_LINE>env.sendEventBean(new SupportBean("T3", -1));<NEW_LINE>env.sendEventBean(new SupportBeanTwo("T3", 40));<NEW_LINE>env.assertPropsNew("s0", "sb.theString,sbt.stringTwo,s1.myint".split(","), new Object[] { "T3", "T3", 40 });<NEW_LINE>env.undeployAll();<NEW_LINE>} | new SupportBeanTwo("T1", 2)); |
1,778,978 | public boolean bodyCall(Node[] args, int length, RuleContext context) {<NEW_LINE>checkArgs(length, context);<NEW_LINE><MASK><NEW_LINE>Node n1 = getArg(0, args, context);<NEW_LINE>Node n2 = getArg(1, args, context);<NEW_LINE>if (n1.isLiteral() && n2.isLiteral()) {<NEW_LINE>Object v1 = n1.getLiteralValue();<NEW_LINE>Object v2 = n2.getLiteralValue();<NEW_LINE>Node sum = null;<NEW_LINE>if (v1 instanceof Number && v2 instanceof Number) {<NEW_LINE>Number nv1 = (Number) v1;<NEW_LINE>Number nv2 = (Number) v2;<NEW_LINE>if (v1 instanceof Float || v1 instanceof Double || v2 instanceof Float || v2 instanceof Double) {<NEW_LINE>sum = Util.makeDoubleNode(nv1.doubleValue() - nv2.doubleValue());<NEW_LINE>} else {<NEW_LINE>sum = Util.makeLongNode(nv1.longValue() - nv2.longValue());<NEW_LINE>}<NEW_LINE>return env.bind(args[2], sum);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Doesn't (yet) handle partially bound cases<NEW_LINE>return false;<NEW_LINE>} | BindingEnvironment env = context.getEnv(); |
1,280,625 | public static Map<String, Long> queryDbGroupDataSize(String schema, List<GroupDetailInfoExRecord> groupRecords) {<NEW_LINE>Map<String, Long> groupDataSizeMap = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);<NEW_LINE>groupRecords.stream().collect(Collectors.groupingBy(x -> x.storageInstId)).forEach((storageInstId, groups) -> {<NEW_LINE>Map<String, String> phyDbToGroup = groups.stream().map(x -> Pair.of(x.getPhyDbName().toLowerCase(), x.groupName)).collect(Collectors.toMap(Pair::getKey, Pair::getValue));<NEW_LINE>List<String> phyDbList = groups.stream().map(x -> x.getPhyDbName()).collect(Collectors.toList());<NEW_LINE>String anchorPhyDb = phyDbList.get(0);<NEW_LINE>String sql = genDbGroupSQL(phyDbList);<NEW_LINE>// PhyDbName, DataSizeKB<NEW_LINE>List<List<Object>> rows = queryGroupByPhyDb(schema, anchorPhyDb, sql);<NEW_LINE>for (List<Object> row : rows) {<NEW_LINE>String phyDbName = (String) row.get(0);<NEW_LINE>long dataSizeKB = ((BigDecimal) row.get(1)).longValue();<NEW_LINE>String <MASK><NEW_LINE>groupDataSizeMap.merge(groupName, dataSizeKB * 1024, Long::sum);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return groupDataSizeMap;<NEW_LINE>} | groupName = phyDbToGroup.get(phyDbName); |
1,398,961 | ActionResult<Wo> execute(EffectivePerson effectivePerson, String portalFlag, JsonElement jsonElement) throws Exception {<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>ActionResult<Wo> result = new ActionResult<>();<NEW_LINE>Wi wi = this.<MASK><NEW_LINE>Business business = new Business(emc);<NEW_LINE>Portal portal = emc.flag(portalFlag, Portal.class);<NEW_LINE>if (null == portal) {<NEW_LINE>throw new ExceptionPortalNotExist(portalFlag);<NEW_LINE>}<NEW_LINE>if (!business.editable(effectivePerson, portal)) {<NEW_LINE>throw new ExceptionPortalAccessDenied(effectivePerson.getDistinguishedName(), portal.getName(), portal.getId());<NEW_LINE>}<NEW_LINE>WrapPortal wrapPortal = this.get(business, portal, wi);<NEW_LINE>CacheObject cacheObject = new CacheObject();<NEW_LINE>cacheObject.setName(portal.getName());<NEW_LINE>cacheObject.setPortal(wrapPortal);<NEW_LINE>String flag = StringTools.uniqueToken();<NEW_LINE>CacheKey cacheKey = new CacheKey(this.getClass(), flag);<NEW_LINE>CacheManager.put(this.cache, cacheKey, cacheObject);<NEW_LINE>Wo wo = XGsonBuilder.convert(wrapPortal, Wo.class);<NEW_LINE>wo.setFlag(flag);<NEW_LINE>result.setData(wo);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>} | convertToWrapIn(jsonElement, Wi.class); |
382,249 | private List<CertificateInventory> certificateFromAction(CascadeAction action) {<NEW_LINE>if (!AccountVO.class.getSimpleName().equals(action.getParentIssuer())) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final List<String> auuids = CollectionUtils.transformToList((List<AccountInventory>) action.getParentIssuerContext(), new Function<String, AccountInventory>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String call(AccountInventory arg) {<NEW_LINE>return arg.getUuid();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>List<CertificateVO> vos = new Callable<List<CertificateVO>>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>@Transactional(readOnly = true)<NEW_LINE>public List<CertificateVO> call() {<NEW_LINE>String sql = "select d from CertificateVO d, AccountResourceRefVO r where d.uuid = r.resourceUuid and" + " r.resourceType = :rtype and r.accountUuid in (:auuids)";<NEW_LINE>TypedQuery<CertificateVO> q = dbf.getEntityManager().<MASK><NEW_LINE>q.setParameter("auuids", auuids);<NEW_LINE>q.setParameter("rtype", CertificateVO.class.getSimpleName());<NEW_LINE>return q.getResultList();<NEW_LINE>}<NEW_LINE>}.call();<NEW_LINE>if (!vos.isEmpty()) {<NEW_LINE>return CertificateInventory.valueOf(vos);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | createQuery(sql, CertificateVO.class); |
646,974 | private SqlQuerySpec createReadManyQuerySpec(List<CosmosItemIdentity> itemIdentities, String partitionKeySelector) {<NEW_LINE>StringBuilder queryStringBuilder = new StringBuilder();<NEW_LINE>List<SqlParameter> parameters = new ArrayList<>();<NEW_LINE>queryStringBuilder.append("SELECT * FROM c WHERE ( ");<NEW_LINE>for (int i = 0; i < itemIdentities.size(); i++) {<NEW_LINE>CosmosItemIdentity <MASK><NEW_LINE>PartitionKey pkValueAsPartitionKey = itemIdentity.getPartitionKey();<NEW_LINE>Object pkValue = ModelBridgeInternal.getPartitionKeyObject(pkValueAsPartitionKey);<NEW_LINE>String pkParamName = "@param" + (2 * i);<NEW_LINE>parameters.add(new SqlParameter(pkParamName, pkValue));<NEW_LINE>String idValue = itemIdentity.getId();<NEW_LINE>String idParamName = "@param" + (2 * i + 1);<NEW_LINE>parameters.add(new SqlParameter(idParamName, idValue));<NEW_LINE>queryStringBuilder.append("(");<NEW_LINE>queryStringBuilder.append("c.id = ");<NEW_LINE>queryStringBuilder.append(idParamName);<NEW_LINE>queryStringBuilder.append(" AND ");<NEW_LINE>queryStringBuilder.append(" c");<NEW_LINE>// partition key def<NEW_LINE>queryStringBuilder.append(partitionKeySelector);<NEW_LINE>queryStringBuilder.append((" = "));<NEW_LINE>queryStringBuilder.append(pkParamName);<NEW_LINE>queryStringBuilder.append(" )");<NEW_LINE>if (i < itemIdentities.size() - 1) {<NEW_LINE>queryStringBuilder.append(" OR ");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>queryStringBuilder.append(" )");<NEW_LINE>return new SqlQuerySpec(queryStringBuilder.toString(), parameters);<NEW_LINE>} | itemIdentity = itemIdentities.get(i); |
1,117,692 | public void storeFirebaseMessage(RemoteMessage remoteMessage) {<NEW_LINE>try {<NEW_LINE>String remoteMessageString = reactToJSON(remoteMessageToWritableMap(remoteMessage)).toString();<NEW_LINE>// Log.d("storeFirebaseMessage", remoteMessageString);<NEW_LINE>UniversalFirebasePreferences preferences = UniversalFirebasePreferences.getSharedInstance();<NEW_LINE>preferences.setStringValue(remoteMessage.getMessageId(), remoteMessageString);<NEW_LINE>// save new notification id<NEW_LINE>String notifications = preferences.getStringValue(S_KEY_ALL_NOTIFICATION_IDS, "");<NEW_LINE>// append to last<NEW_LINE>notifications += remoteMessage.getMessageId() + DELIMITER;<NEW_LINE>// check and remove old notifications message<NEW_LINE>List<String> allNotificationList = convertToArray(notifications);<NEW_LINE>if (allNotificationList.size() > MAX_SIZE_NOTIFICATIONS) {<NEW_LINE>String firstRemoteMessageId = allNotificationList.get(0);<NEW_LINE>preferences.remove(firstRemoteMessageId);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>preferences.setStringValue(S_KEY_ALL_NOTIFICATION_IDS, notifications);<NEW_LINE>} catch (JSONException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>} | notifications = removeRemoteMessage(firstRemoteMessageId, notifications); |
1,546,601 | private void receivedServerInfo(ChannelHandlerContext channelHandlerContext, NetData.ServerInfoMessage message) {<NEW_LINE>logger.info("Received server info");<NEW_LINE>((EngineTime) CoreRegistry.get(Time.class)).setGameTime(message.getTime());<NEW_LINE>this.server = new ServerImpl(networkSystem, channelHandlerContext.channel());<NEW_LINE>server.setServerInfo(message);<NEW_LINE>// Request missing modules<NEW_LINE>for (NetData.ModuleInfo info : message.getModuleList()) {<NEW_LINE>if (null == moduleManager.getRegistry().getModule(new Name(info.getModuleId()), new Version(info.getModuleVersion()))) {<NEW_LINE>missingModules.add(info.getModuleId().toLowerCase(Locale.ENGLISH));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (missingModules.isEmpty()) {<NEW_LINE>joinStatus.setCurrentActivity("Finalizing join");<NEW_LINE>sendJoin(channelHandlerContext);<NEW_LINE>} else {<NEW_LINE>joinStatus.setCurrentActivity("Requesting missing modules");<NEW_LINE>NetData.NetMessage.Builder builder = NetData.NetMessage.newBuilder();<NEW_LINE>for (String module : missingModules) {<NEW_LINE>builder.addModuleRequest(NetData.ModuleRequest.newBuilder().setModuleId(module));<NEW_LINE>}<NEW_LINE>channelHandlerContext.channel().<MASK><NEW_LINE>}<NEW_LINE>} | writeAndFlush(builder.build()); |
1,839,126 | public void LAPACK_dtgsyl(BytePointer arg0, int[] arg1, int[] arg2, int[] arg3, double[] arg4, int[] arg5, double[] arg6, int[] arg7, double[] arg8, int[] arg9, double[] arg10, int[] arg11, double[] arg12, int[] arg13, double[] arg14, int[] arg15, double[] arg16, double[] arg17, double[] arg18, int[] arg19, int[] arg20, int[] arg21) {<NEW_LINE>LAPACK_dtgsyl(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, <MASK><NEW_LINE>} | arg18, arg19, arg20, arg21); |
640,770 | public MapFilter unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>MapFilter mapFilter = new MapFilter();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("comparison", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>mapFilter.setComparison(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("key", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>mapFilter.setKey(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("value", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>mapFilter.setValue(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 mapFilter;<NEW_LINE>} | class).unmarshall(context)); |
1,845,576 | public Set<String> referencedFiles(String tableName) throws TableNotFoundException {<NEW_LINE>log.debug("Collecting referenced files for replication of table {}", tableName);<NEW_LINE>TableId tableId = context.getTableId(tableName);<NEW_LINE>log.debug("Found id of {} for name {}", tableId, tableName);<NEW_LINE>// Get the WALs currently referenced by the table<NEW_LINE>BatchScanner metaBs = context.createBatchScanner(MetadataTable.NAME, Authorizations.EMPTY, 4);<NEW_LINE>metaBs.setRanges(Collections.singleton(TabletsSection.getRange(tableId)));<NEW_LINE>metaBs.fetchColumnFamily(LogColumnFamily.NAME);<NEW_LINE>Set<String> wals = new HashSet<>();<NEW_LINE>try {<NEW_LINE>for (Entry<Key, Value> entry : metaBs) {<NEW_LINE>LogEntry <MASK><NEW_LINE>wals.add(new Path(logEntry.filename).toString());<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>metaBs.close();<NEW_LINE>}<NEW_LINE>// And the WALs that need to be replicated for this table<NEW_LINE>metaBs = context.createBatchScanner(MetadataTable.NAME, Authorizations.EMPTY, 4);<NEW_LINE>metaBs.setRanges(Collections.singleton(ReplicationSection.getRange()));<NEW_LINE>metaBs.fetchColumnFamily(ReplicationSection.COLF);<NEW_LINE>try {<NEW_LINE>Text buffer = new Text();<NEW_LINE>for (Entry<Key, Value> entry : metaBs) {<NEW_LINE>if (tableId.equals(ReplicationSection.getTableId(entry.getKey()))) {<NEW_LINE>ReplicationSection.getFile(entry.getKey(), buffer);<NEW_LINE>wals.add(buffer.toString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>metaBs.close();<NEW_LINE>}<NEW_LINE>return wals;<NEW_LINE>} | logEntry = LogEntry.fromMetaWalEntry(entry); |
327,792 | static AnalyzerComponents createComponents(String name, Settings analyzerSettings, final Map<String, TokenizerFactory> tokenizers, final Map<String, CharFilterFactory> charFilters, final Map<String, TokenFilterFactory> tokenFilters) {<NEW_LINE>String tokenizerName = analyzerSettings.get("tokenizer");<NEW_LINE>if (tokenizerName == null) {<NEW_LINE>throw new IllegalArgumentException("Custom Analyzer [" + name + "] must be configured with a tokenizer");<NEW_LINE>}<NEW_LINE>TokenizerFactory tokenizer = tokenizers.get(tokenizerName);<NEW_LINE>if (tokenizer == null) {<NEW_LINE>throw new IllegalArgumentException("Custom Analyzer [" + name + "] failed to find tokenizer under name " + "[" + tokenizerName + "]");<NEW_LINE>}<NEW_LINE>List<String> charFilterNames = analyzerSettings.getAsList("char_filter");<NEW_LINE>List<CharFilterFactory> charFiltersList = new ArrayList<>(charFilterNames.size());<NEW_LINE>for (String charFilterName : charFilterNames) {<NEW_LINE>CharFilterFactory charFilter = charFilters.get(charFilterName);<NEW_LINE>if (charFilter == null) {<NEW_LINE>throw new IllegalArgumentException("Custom Analyzer [" + name + "] failed to find char_filter under name " + "[" + charFilterName + "]");<NEW_LINE>}<NEW_LINE>charFiltersList.add(charFilter);<NEW_LINE>}<NEW_LINE>List<String> tokenFilterNames = analyzerSettings.getAsList("filter");<NEW_LINE>List<TokenFilterFactory> tokenFilterList = new ArrayList<<MASK><NEW_LINE>for (String tokenFilterName : tokenFilterNames) {<NEW_LINE>TokenFilterFactory tokenFilter = tokenFilters.get(tokenFilterName);<NEW_LINE>if (tokenFilter == null) {<NEW_LINE>throw new IllegalArgumentException("Custom Analyzer [" + name + "] failed to find filter under name " + "[" + tokenFilterName + "]");<NEW_LINE>}<NEW_LINE>tokenFilter = tokenFilter.getChainAwareTokenFilterFactory(tokenizer, charFiltersList, tokenFilterList, tokenFilters::get);<NEW_LINE>tokenFilterList.add(tokenFilter);<NEW_LINE>}<NEW_LINE>return new AnalyzerComponents(tokenizer, charFiltersList.toArray(new CharFilterFactory[charFiltersList.size()]), tokenFilterList.toArray(new TokenFilterFactory[tokenFilterList.size()]));<NEW_LINE>} | >(tokenFilterNames.size()); |
1,573,743 | final List<JsonTag> computeTags(@NonNull final Document document) {<NEW_LINE>final ImmutableList.Builder<JsonTag> tags = ImmutableList.builder();<NEW_LINE>tags.add(JsonTag.of(GetAttachmentRouteConstants.ALBERTA_DOCUMENT_ID, document.getId()));<NEW_LINE>if (document.isArchived() != null) {<NEW_LINE>tags.add(JsonTag.of(GetAttachmentRouteConstants.ALBERTA_DOCUMENT_ARCHIVED, String.valueOf(document.isArchived())));<NEW_LINE>}<NEW_LINE>final BigDecimal therapyId = document.getTherapyId();<NEW_LINE>if (therapyId != null) {<NEW_LINE>tags.add(JsonTag.of(GetAttachmentRouteConstants.ALBERTA_DOCUMENT_THERAPYID, String.valueOf(therapyId)));<NEW_LINE>}<NEW_LINE>final BigDecimal therapyTypeId = document.getTherapyTypeId();<NEW_LINE>if (therapyTypeId != null) {<NEW_LINE>tags.add(JsonTag.of(GetAttachmentRouteConstants.ALBERTA_DOCUMENT_THERAPYTYPEID, String.valueOf(therapyTypeId)));<NEW_LINE>}<NEW_LINE>final OffsetDateTime createdAt = document.getCreatedAt();<NEW_LINE>if (createdAt != null) {<NEW_LINE>final Instant createdAtInstant = AlbertaUtil.asInstant(createdAt);<NEW_LINE>tags.add(JsonTag.of(GetAttachmentRouteConstants.ALBERTA_DOCUMENT_CREATEDAT, <MASK><NEW_LINE>}<NEW_LINE>final OffsetDateTime updatedAt = document.getUpdatedAt();<NEW_LINE>if (updatedAt != null) {<NEW_LINE>final Instant updatedAtInstant = AlbertaUtil.asInstant(updatedAt);<NEW_LINE>tags.add(JsonTag.of(GetAttachmentRouteConstants.ALBERTA_DOCUMENT_UPDATEDAT, String.valueOf(updatedAtInstant)));<NEW_LINE>}<NEW_LINE>tags.add(JsonTag.of(GetAttachmentRouteConstants.ALBERTA_DOCUMENT_ENDPOINT, GetAttachmentRouteConstants.ALBERTA_DOCUMENT_ENDPOINT_VALUE));<NEW_LINE>return tags.build();<NEW_LINE>} | String.valueOf(createdAtInstant))); |
1,152,889 | protected void paintDropShadow(RenderContext<FGVertex, FGEdge> rc, GraphicsDecorator g, Shape shape, FGVertex vertex) {<NEW_LINE>Rectangle bounds = shape.getBounds();<NEW_LINE>if (vertex instanceof GroupedFunctionGraphVertex) {<NEW_LINE>// paint depth images offset from main vertex<NEW_LINE>Rectangle originalBounds = bounds;<NEW_LINE>Rectangle paintBounds = (Rectangle) originalBounds.clone();<NEW_LINE>Set<FGVertex> vertices = ((GroupedFunctionGraphVertex) vertex).getVertices();<NEW_LINE>int offset = 15;<NEW_LINE>int size = vertices.size();<NEW_LINE>if (size > 3) {<NEW_LINE>// don't paint one-for-one, that's a bit much<NEW_LINE>size = size / 3;<NEW_LINE>size = Math.max(size, 2);<NEW_LINE>}<NEW_LINE>int currentOffset = offset * size;<NEW_LINE>for (int i = size - 1; i >= 0; i--) {<NEW_LINE>paintBounds.x = originalBounds.x + currentOffset;<NEW_LINE>paintBounds.y = originalBounds.y + currentOffset;<NEW_LINE>currentOffset -= offset;<NEW_LINE>super.paintDropShadow(rc, g, paintBounds);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>super.<MASK><NEW_LINE>} | paintDropShadow(rc, g, bounds); |
401,200 | public void visitEnd() {<NEW_LINE>if (!interfacesToStub.isEmpty()) {<NEW_LINE>// Inherited methods take precedence over default methods, so visit all superclasses and<NEW_LINE>// figure out what methods they declare before stubbing in any missing default methods.<NEW_LINE>recordInheritedMethods();<NEW_LINE>stubMissingDefaultAndBridgeMethods();<NEW_LINE>// Check whether there are interfaces with default methods and <clinit>. If yes, the following<NEW_LINE>// method call will return a list of interface fields to access in the <clinit> to trigger<NEW_LINE>// the initialization of these interfaces.<NEW_LINE>ImmutableList<String> companionsToTriggerInterfaceClinit = collectOrderedCompanionsToTriggerInterfaceClinit(directInterfaces);<NEW_LINE>if (!companionsToTriggerInterfaceClinit.isEmpty()) {<NEW_LINE>if (clInitMethodNode == null) {<NEW_LINE>clInitMethodNode = new MethodNode(Opcodes.ACC_STATIC, <MASK><NEW_LINE>}<NEW_LINE>desugarClinitToTriggerInterfaceInitializers(companionsToTriggerInterfaceClinit);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (clInitMethodNode != null && super.cv != null) {<NEW_LINE>// Write <clinit> to the chained visitor.<NEW_LINE>clInitMethodNode.accept(super.cv);<NEW_LINE>}<NEW_LINE>super.visitEnd();<NEW_LINE>} | "<clinit>", "()V", null, null); |
1,844,229 | private Optional<RemoveSearchResult> findBucketForRemove(final K key, final OAtomicOperation atomicOperation) throws IOException {<NEW_LINE>final ArrayList<RemovalPathItem> path = new ArrayList<>(8);<NEW_LINE>long pageIndex = ROOT_INDEX;<NEW_LINE>int depth = 0;<NEW_LINE>while (true) {<NEW_LINE>depth++;<NEW_LINE>if (depth > MAX_PATH_LENGTH) {<NEW_LINE>throw new CellBTreeSingleValueV3Exception("We reached max level of depth of BTree but still found nothing, seems like tree is in corrupted state. You should rebuild index related to given query.", this);<NEW_LINE>}<NEW_LINE>final OCacheEntry bucketEntry = loadPageForRead(atomicOperation, fileId, pageIndex, false);<NEW_LINE>try {<NEW_LINE>@SuppressWarnings("ObjectAllocationInLoop")<NEW_LINE>final CellBTreeSingleValueBucketV3<K> bucket <MASK><NEW_LINE>final int index = bucket.find(key, keySerializer);<NEW_LINE>if (bucket.isLeaf()) {<NEW_LINE>if (index < 0) {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>return Optional.of(new RemoveSearchResult(pageIndex, index, path));<NEW_LINE>}<NEW_LINE>if (index >= 0) {<NEW_LINE>path.add(new RemovalPathItem(pageIndex, index, false));<NEW_LINE>pageIndex = bucket.getRight(index);<NEW_LINE>} else {<NEW_LINE>final int insertionIndex = -index - 1;<NEW_LINE>if (insertionIndex >= bucket.size()) {<NEW_LINE>path.add(new RemovalPathItem(pageIndex, insertionIndex - 1, false));<NEW_LINE>pageIndex = bucket.getRight(insertionIndex - 1);<NEW_LINE>} else {<NEW_LINE>path.add(new RemovalPathItem(pageIndex, insertionIndex, true));<NEW_LINE>pageIndex = bucket.getLeft(insertionIndex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>releasePageFromRead(atomicOperation, bucketEntry);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | = new CellBTreeSingleValueBucketV3<>(bucketEntry); |
393,421 | public List<AspectRowSummary> findByParams(Map<String, String> systemMetaParams, boolean includeSoftDeleted) {<NEW_LINE>SearchResponse searchResponse = _esDAO.findByParams(systemMetaParams, includeSoftDeleted);<NEW_LINE>if (searchResponse != null) {<NEW_LINE>SearchHits hits = searchResponse.getHits();<NEW_LINE>List<AspectRowSummary> summaries = Arrays.stream(hits.getHits()).map(hit -> {<NEW_LINE>Map<String, Object> values = hit.getSourceAsMap();<NEW_LINE>AspectRowSummary summary = new AspectRowSummary();<NEW_LINE>summary.setRunId((String<MASK><NEW_LINE>summary.setAspectName((String) values.get(FIELD_ASPECT));<NEW_LINE>summary.setUrn((String) values.get(FIELD_URN));<NEW_LINE>Object timestamp = values.get(FIELD_LAST_UPDATED);<NEW_LINE>if (timestamp instanceof Long) {<NEW_LINE>summary.setTimestamp((Long) timestamp);<NEW_LINE>} else if (timestamp instanceof Integer) {<NEW_LINE>summary.setTimestamp(Long.valueOf((Integer) timestamp));<NEW_LINE>}<NEW_LINE>summary.setKeyAspect(((String) values.get(FIELD_ASPECT)).endsWith("Key"));<NEW_LINE>return summary;<NEW_LINE>}).collect(Collectors.toList());<NEW_LINE>return summaries;<NEW_LINE>} else {<NEW_LINE>return Collections.emptyList();<NEW_LINE>}<NEW_LINE>} | ) values.get(FIELD_RUNID)); |
1,646,650 | private void initHeap(ObjectHeap<CASHInterval> heap, Relation<ParameterizationFunction> relation, int dim, DBIDs ids) {<NEW_LINE>CASHIntervalSplit split = new CASHIntervalSplit(relation, minPts);<NEW_LINE>// determine minimum and maximum function value of all functions<NEW_LINE>double[] minMax = determineMinMaxDistance(relation, dim);<NEW_LINE>double d_min = minMax[0], d_max = minMax[1];<NEW_LINE>double dIntervalLength = d_max - d_min;<NEW_LINE>int numDIntervals = (int) FastMath.ceil(dIntervalLength / jitter);<NEW_LINE>double dIntervalSize = dIntervalLength / numDIntervals;<NEW_LINE>double[] d_mins = new double[numDIntervals], d_maxs = new double[numDIntervals];<NEW_LINE>if (LOG.isVerbose()) {<NEW_LINE>//<NEW_LINE>LOG.//<NEW_LINE>verbose(//<NEW_LINE>new StringBuilder().append("d_min ").append(d_min).append("\nd_max ").//<NEW_LINE>append(d_max).append(//<NEW_LINE>"\nnumDIntervals ").//<NEW_LINE>append(numDIntervals).append("\ndIntervalSize ").append(dIntervalSize).toString());<NEW_LINE>}<NEW_LINE>// alpha intervals<NEW_LINE>double[] alphaMin = new double[dim - 1], alphaMax = new double[dim - 1];<NEW_LINE>Arrays.fill(alphaMax, Math.PI);<NEW_LINE>for (int i = 0; i < numDIntervals; i++) {<NEW_LINE>d_mins[i] = (i == 0) ? d_min : d_maxs[i - 1];<NEW_LINE>d_maxs[i] = (i < numDIntervals - 1) ? d_mins[i] + dIntervalSize : d_max - d_mins[i];<NEW_LINE>HyperBoundingBox alphaInterval = new HyperBoundingBox(alphaMin, alphaMax);<NEW_LINE>ModifiableDBIDs intervalIDs = split.determineIDs(ids, alphaInterval, d_mins[<MASK><NEW_LINE>if (intervalIDs != null && intervalIDs.size() >= minPts) {<NEW_LINE>heap.add(new CASHInterval(alphaMin, alphaMax, split, intervalIDs, -1, 0, d_mins[i], d_maxs[i]));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (LOG.isDebuggingFiner()) {<NEW_LINE>LOG.debugFiner(new StringBuilder().append("heap.size: ").append(heap.size()).toString());<NEW_LINE>}<NEW_LINE>} | i], d_maxs[i]); |
702,029 | public static QueryPermissionListResponse unmarshall(QueryPermissionListResponse queryPermissionListResponse, UnmarshallerContext _ctx) {<NEW_LINE>queryPermissionListResponse.setRequestId<MASK><NEW_LINE>queryPermissionListResponse.setCode(_ctx.stringValue("QueryPermissionListResponse.Code"));<NEW_LINE>queryPermissionListResponse.setMessage(_ctx.stringValue("QueryPermissionListResponse.Message"));<NEW_LINE>queryPermissionListResponse.setSuccess(_ctx.booleanValue("QueryPermissionListResponse.Success"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setEndTime(_ctx.stringValue("QueryPermissionListResponse.Data.EndTime"));<NEW_LINE>data.setRelationType(_ctx.stringValue("QueryPermissionListResponse.Data.RelationType"));<NEW_LINE>data.setStartTime(_ctx.stringValue("QueryPermissionListResponse.Data.StartTime"));<NEW_LINE>data.setState(_ctx.stringValue("QueryPermissionListResponse.Data.State"));<NEW_LINE>data.setMasterId(_ctx.longValue("QueryPermissionListResponse.Data.MasterId"));<NEW_LINE>data.setMemberId(_ctx.longValue("QueryPermissionListResponse.Data.MemberId"));<NEW_LINE>data.setSetupTime(_ctx.stringValue("QueryPermissionListResponse.Data.SetupTime"));<NEW_LINE>List<PermissionListItem> permissionList = new ArrayList<PermissionListItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("QueryPermissionListResponse.Data.PermissionList.Length"); i++) {<NEW_LINE>PermissionListItem permissionListItem = new PermissionListItem();<NEW_LINE>permissionListItem.setEndTime(_ctx.stringValue("QueryPermissionListResponse.Data.PermissionList[" + i + "].EndTime"));<NEW_LINE>permissionListItem.setStartTime(_ctx.stringValue("QueryPermissionListResponse.Data.PermissionList[" + i + "].StartTime"));<NEW_LINE>permissionListItem.setPermissionCode(_ctx.stringValue("QueryPermissionListResponse.Data.PermissionList[" + i + "].PermissionCode"));<NEW_LINE>permissionListItem.setPermissionName(_ctx.stringValue("QueryPermissionListResponse.Data.PermissionList[" + i + "].PermissionName"));<NEW_LINE>permissionList.add(permissionListItem);<NEW_LINE>}<NEW_LINE>data.setPermissionList(permissionList);<NEW_LINE>queryPermissionListResponse.setData(data);<NEW_LINE>return queryPermissionListResponse;<NEW_LINE>} | (_ctx.stringValue("QueryPermissionListResponse.RequestId")); |
1,191,187 | final GetWirelessGatewayResult executeGetWirelessGateway(GetWirelessGatewayRequest getWirelessGatewayRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getWirelessGatewayRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetWirelessGatewayRequest> request = null;<NEW_LINE>Response<GetWirelessGatewayResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetWirelessGatewayRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getWirelessGatewayRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "IoT Wireless");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetWirelessGateway");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetWirelessGatewayResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetWirelessGatewayResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); |
578,365 | protected void visit(CharacterClass characterClass) {<NEW_LINE>if (isForward()) {<NEW_LINE>if (!characterClass.getCharSet().matchesSingleChar()) {<NEW_LINE>if (!characterClass.getCharSet().matches2CharsWith1BitDifference()) {<NEW_LINE>ast.getProperties().unsetCharClassesCanBeMatchedWithMask();<NEW_LINE>}<NEW_LINE>if (!ast.getEncoding().isFixedCodePointWidth(characterClass.getCharSet())) {<NEW_LINE>ast.getProperties().unsetFixedCodePointWidth();<NEW_LINE>}<NEW_LINE>ast.getProperties().setCharClasses();<NEW_LINE>}<NEW_LINE>if (Constants.SURROGATES.intersects(characterClass.getCharSet())) {<NEW_LINE>ast.getProperties().setLoneSurrogates();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (characterClass.hasNotUnrolledQuantifier()) {<NEW_LINE>characterClass.getParent().setHasQuantifiers();<NEW_LINE>setQuantifierIndex(characterClass);<NEW_LINE>characterClass.getParent().incMinPath(characterClass.getQuantifier().getMin());<NEW_LINE>if (characterClass.getQuantifier().isInfiniteLoop()) {<NEW_LINE>characterClass.setHasLoops();<NEW_LINE>characterClass.getParent().setHasLoops();<NEW_LINE>} else {<NEW_LINE>characterClass.getParent().incMaxPath(characterClass.getQuantifier().getMax());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>characterClass.getParent().incMinPath();<NEW_LINE>characterClass.getParent().incMaxPath();<NEW_LINE>}<NEW_LINE>characterClass.setMinPath(characterClass.getParent().getMinPath());<NEW_LINE>characterClass.setMaxPath(characterClass.<MASK><NEW_LINE>if (characterClass.getCharSet().matchesNothing()) {<NEW_LINE>characterClass.markAsDead();<NEW_LINE>characterClass.getParent().markAsDead();<NEW_LINE>}<NEW_LINE>} | getParent().getMaxPath()); |
782,546 | // beforeSave<NEW_LINE>@Override<NEW_LINE>protected boolean afterSave(final boolean newRecord, final boolean success) {<NEW_LINE>if (!success) {<NEW_LINE>return success;<NEW_LINE>}<NEW_LINE>// Purchase Order Delivered/Invoiced<NEW_LINE>// (Reserved in VMatch and MInOut.completeIt)<NEW_LINE>if (getC_OrderLine_ID() > 0) {<NEW_LINE>final I_C_OrderLine orderLine = getC_OrderLine();<NEW_LINE>if (InterfaceWrapperHelper.isValueChanged(this, COLUMNNAME_M_InOutLine_ID) || /* task 09084 => */<NEW_LINE>newRecord) {<NEW_LINE>if (getM_InOutLine_ID() > 0) {<NEW_LINE>// a new delivery line was linked to the order line => add the qty<NEW_LINE>orderLine.setQtyDelivered(orderLine.getQtyDelivered().add(getQty()));<NEW_LINE>// overwrite=last<NEW_LINE>orderLine.setDateDelivered(getDateTrx());<NEW_LINE>} else if (getM_InOutLine_ID() <= 0 && !newRecord) {<NEW_LINE>// a previously linked delivery line was unlinked from an existing matchPO (and thus from the order line) => subtract the qty<NEW_LINE>orderLine.setQtyDelivered(orderLine.getQtyDelivered().subtract(getQty()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (InterfaceWrapperHelper.isValueChanged(this, COLUMNNAME_C_InvoiceLine_ID) || /* task 09084 => */<NEW_LINE>newRecord) {<NEW_LINE>if (getC_InvoiceLine_ID() > 0) {<NEW_LINE>// a new invoice line was linked to the order line => add the qty<NEW_LINE>orderLine.setQtyInvoiced(orderLine.getQtyInvoiced().add(getQty()));<NEW_LINE>// overwrite=last<NEW_LINE><MASK><NEW_LINE>} else if (getC_InvoiceLine_ID() <= 0 && !newRecord) {<NEW_LINE>// a previously linked invoice line was unlinked from an existing matchPO (and thus from the order line) => subtract the qty<NEW_LINE>orderLine.setQtyInvoiced(orderLine.getQtyInvoiced().subtract(getQty()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Update Order ASI if full match<NEW_LINE>if (orderLine.getM_AttributeSetInstance_ID() == 0 && getM_InOutLine_ID() > 0) {<NEW_LINE>final I_M_InOutLine iol = getM_InOutLine();<NEW_LINE>if (iol.getMovementQty().compareTo(orderLine.getQtyOrdered()) == 0) {<NEW_LINE>orderLine.setM_AttributeSetInstance_ID(iol.getM_AttributeSetInstance_ID());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>InterfaceWrapperHelper.save(orderLine);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>return true;<NEW_LINE>} | orderLine.setDateInvoiced(getDateTrx()); |
1,567,604 | public double evaluate(List<List<DataPoint>> dataSets) {<NEW_LINE>List<Vec> centroids = new ArrayList<Vec>(dataSets.size());<NEW_LINE>double[] avrgCentriodDist = new double[dataSets.size()];<NEW_LINE>for (int i = 0; i < dataSets.size(); i++) {<NEW_LINE>Vec mean = MatrixStatistics.meanVector(new SimpleDataSet(dataSets.get(i)));<NEW_LINE>centroids.add(mean);<NEW_LINE>for (DataPoint dp : dataSets.get(i)) avrgCentriodDist[i] += dm.dist(<MASK><NEW_LINE>avrgCentriodDist[i] /= dataSets.get(i).size();<NEW_LINE>}<NEW_LINE>double dbIndex = 0;<NEW_LINE>for (int i = 0; i < dataSets.size(); i++) {<NEW_LINE>double maxPenalty = Double.NEGATIVE_INFINITY;<NEW_LINE>for (int j = 0; j < dataSets.size(); j++) {<NEW_LINE>if (j == i)<NEW_LINE>continue;<NEW_LINE>double penalty = (avrgCentriodDist[i] + avrgCentriodDist[j]) / dm.dist(centroids.get(i), centroids.get(j));<NEW_LINE>maxPenalty = Math.max(maxPenalty, penalty);<NEW_LINE>}<NEW_LINE>dbIndex += maxPenalty;<NEW_LINE>}<NEW_LINE>return dbIndex / dataSets.size();<NEW_LINE>} | dp.getNumericalValues(), mean); |
1,021,785 | public static Object fillInDataDefault(DataSchema schema, Object dataWithoutDefault) {<NEW_LINE>try {<NEW_LINE>switch(schema.getType()) {<NEW_LINE>case RECORD:<NEW_LINE>return fillInDefaultOnRecord((RecordDataSchema) schema, (DataMap) dataWithoutDefault);<NEW_LINE>case TYPEREF:<NEW_LINE>return fillInDefaultOnTyperef((TyperefDataSchema) schema, dataWithoutDefault);<NEW_LINE>case MAP:<NEW_LINE>return fillInDefaultOnMap((MapDataSchema) schema, (DataMap) dataWithoutDefault);<NEW_LINE>case UNION:<NEW_LINE>return fillInDefaultOnUnion((UnionDataSchema<MASK><NEW_LINE>case ARRAY:<NEW_LINE>return fillInDefaultOnArray((ArrayDataSchema) schema, (DataList) dataWithoutDefault);<NEW_LINE>default:<NEW_LINE>return dataWithoutDefault;<NEW_LINE>}<NEW_LINE>} catch (CloneNotSupportedException ex) {<NEW_LINE>throw new RestLiServiceException(HttpStatus.S_500_INTERNAL_SERVER_ERROR, ex);<NEW_LINE>}<NEW_LINE>} | ) schema, (DataMap) dataWithoutDefault); |
356,857 | private DataSet<Tuple3<Double, Object, Vector>> transform(BatchOperator<?> in, Params params, boolean isRegProc) {<NEW_LINE>String[] featureColNames = params.get(FmTrainParams.FEATURE_COLS);<NEW_LINE>String labelName = params.get(FmTrainParams.LABEL_COL);<NEW_LINE>String weightColName = params.get(FmTrainParams.WEIGHT_COL);<NEW_LINE>String vectorColName = params.get(FmTrainParams.VECTOR_COL);<NEW_LINE>TableSchema dataSchema = in.getSchema();<NEW_LINE>if (null == featureColNames && null == vectorColName) {<NEW_LINE>featureColNames = TableUtil.getNumericCols(dataSchema, new String[] { labelName });<NEW_LINE>params.set(FmTrainParams.FEATURE_COLS, featureColNames);<NEW_LINE>}<NEW_LINE>int[] featureIndices = null;<NEW_LINE>int labelIdx = TableUtil.findColIndexWithAssertAndHint(<MASK><NEW_LINE>if (featureColNames != null) {<NEW_LINE>featureIndices = new int[featureColNames.length];<NEW_LINE>for (int i = 0; i < featureColNames.length; ++i) {<NEW_LINE>int idx = TableUtil.findColIndexWithAssertAndHint(in.getColNames(), featureColNames[i]);<NEW_LINE>featureIndices[i] = idx;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int weightIdx = weightColName != null ? TableUtil.findColIndexWithAssertAndHint(in.getColNames(), weightColName) : -1;<NEW_LINE>int vecIdx = vectorColName != null ? TableUtil.findColIndexWithAssertAndHint(in.getColNames(), vectorColName) : -1;<NEW_LINE>return in.getDataSet().mapPartition(new Transform(isRegProc, weightIdx, vecIdx, featureIndices, labelIdx));<NEW_LINE>} | dataSchema.getFieldNames(), labelName); |
795,776 | public boolean isValidOnSpecifics(String inputValue) {<NEW_LINE>DateInput dateInput = Util.tryCastTo(m_baseInputElement, DateInput.class);<NEW_LINE>if (dateInput == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// if the date is not required and the date is empty, consider it as valid<NEW_LINE>if (!dateInput.GetIsRequired() && inputValue.isEmpty()) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (!RendererUtil.isValidDate(inputValue)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Date currentDate = RendererUtil.getDate(inputValue).getTime();<NEW_LINE>String minDate = dateInput.GetMin();<NEW_LINE>if (!minDate.isEmpty()) {<NEW_LINE>Date min = RendererUtil.<MASK><NEW_LINE>if (!beforeOrSame(min, currentDate)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String maxTime = dateInput.GetMax();<NEW_LINE>if (!maxTime.isEmpty()) {<NEW_LINE>Date max = RendererUtil.getDate(maxTime).getTime();<NEW_LINE>if (!beforeOrSame(currentDate, max)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | getDate(minDate).getTime(); |
863,099 | public void exitPropertyExpressionAtomic(EsperEPL2GrammarParser.PropertyExpressionAtomicContext ctx) {<NEW_LINE>// initialize if not set<NEW_LINE>if (propertyEvalSpec == null) {<NEW_LINE>propertyEvalSpec = new PropertyEvalSpec();<NEW_LINE>}<NEW_LINE>// get select clause<NEW_LINE>SelectClauseSpecRaw optionalSelectClause = new SelectClauseSpecRaw();<NEW_LINE>if (propertySelectRaw != null) {<NEW_LINE>optionalSelectClause.getSelectExprList().addAll(propertySelectRaw);<NEW_LINE>propertySelectRaw = null;<NEW_LINE>}<NEW_LINE>// get the splitter expression<NEW_LINE>ExprNode splitterExpression = ASTExprHelper.exprCollectSubNodes(ctx.expression(0), 0<MASK><NEW_LINE>// get where-clause, if any<NEW_LINE>ExprNode optionalWhereClause = ctx.where == null ? null : ASTExprHelper.exprCollectSubNodes(ctx.where, 0, astExprNodeMap).get(0);<NEW_LINE>String optionalAsName = ctx.n == null ? null : ctx.n.getText();<NEW_LINE>String splitterEventTypeName = ASTTypeExpressionAnnoHelper.expectMayTypeAnno(ctx.typeExpressionAnnotation(), tokenStream);<NEW_LINE>PropertyEvalAtom atom = new PropertyEvalAtom(splitterExpression, splitterEventTypeName, optionalAsName, optionalSelectClause, optionalWhereClause);<NEW_LINE>propertyEvalSpec.add(atom);<NEW_LINE>} | , astExprNodeMap).get(0); |
533,068 | private static JCMethodDecl createConstructor(AccessLevel level, JavacNode typeNode, boolean msgParam, boolean causeParam, JavacNode source, List<JCStatement> statements) {<NEW_LINE><MASK><NEW_LINE>boolean addConstructorProperties;<NEW_LINE>if ((!msgParam && !causeParam) || isLocalType(typeNode) || !LombokOptionsFactory.getDelombokOptions(typeNode.getContext()).getFormatPreferences().generateConstructorProperties()) {<NEW_LINE>addConstructorProperties = false;<NEW_LINE>} else {<NEW_LINE>Boolean v = typeNode.getAst().readConfiguration(ConfigurationKeys.ANY_CONSTRUCTOR_ADD_CONSTRUCTOR_PROPERTIES);<NEW_LINE>addConstructorProperties = v != null ? v.booleanValue() : Boolean.FALSE.equals(typeNode.getAst().readConfiguration(ConfigurationKeys.ANY_CONSTRUCTOR_SUPPRESS_CONSTRUCTOR_PROPERTIES));<NEW_LINE>}<NEW_LINE>ListBuffer<JCVariableDecl> params = new ListBuffer<JCVariableDecl>();<NEW_LINE>if (msgParam) {<NEW_LINE>Name fieldName = typeNode.toName("message");<NEW_LINE>long flags = JavacHandlerUtil.addFinalIfNeeded(Flags.PARAMETER, typeNode.getContext());<NEW_LINE>JCExpression pType = genJavaLangTypeRef(typeNode, "String");<NEW_LINE>JCVariableDecl param = maker.VarDef(maker.Modifiers(flags), fieldName, pType, null);<NEW_LINE>params.append(param);<NEW_LINE>}<NEW_LINE>if (causeParam) {<NEW_LINE>Name fieldName = typeNode.toName("cause");<NEW_LINE>long flags = JavacHandlerUtil.addFinalIfNeeded(Flags.PARAMETER, typeNode.getContext());<NEW_LINE>JCExpression pType = genJavaLangTypeRef(typeNode, "Throwable");<NEW_LINE>JCVariableDecl param = maker.VarDef(maker.Modifiers(flags), fieldName, pType, null);<NEW_LINE>params.append(param);<NEW_LINE>}<NEW_LINE>JCModifiers mods = maker.Modifiers(toJavacModifier(level), List.<JCAnnotation>nil());<NEW_LINE>if (addConstructorProperties)<NEW_LINE>addConstructorProperties(mods, typeNode, msgParam, causeParam);<NEW_LINE>return recursiveSetGeneratedBy(maker.MethodDef(mods, typeNode.toName("<init>"), null, List.<JCTypeParameter>nil(), params.toList(), List.<JCExpression>nil(), maker.Block(0L, statements), null), source);<NEW_LINE>} | JavacTreeMaker maker = typeNode.getTreeMaker(); |
1,785,837 | public void preview(Client client, Map<String, String> headers, SourceConfig sourceConfig, Map<String, String> fieldTypeMap, int numberOfBuckets, ActionListener<List<Map<String, Object>>> listener) {<NEW_LINE>ClientHelper.assertNoAuthorizationHeader(headers);<NEW_LINE>ClientHelper.executeWithHeadersAsync(headers, ClientHelper.TRANSFORM_ORIGIN, client, SearchAction.INSTANCE, buildSearchRequest(sourceConfig, null, numberOfBuckets), ActionListener.wrap(r -> {<NEW_LINE>try {<NEW_LINE>final Aggregations aggregations = r.getAggregations();<NEW_LINE>if (aggregations == null) {<NEW_LINE>listener.onFailure(new ElasticsearchStatusException<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final CompositeAggregation agg = aggregations.get(COMPOSITE_AGGREGATION_NAME);<NEW_LINE>TransformIndexerStats stats = new TransformIndexerStats();<NEW_LINE>TransformProgress progress = new TransformProgress();<NEW_LINE>List<Map<String, Object>> docs = extractResults(agg, fieldTypeMap, stats, progress).map(this::documentTransformationFunction).collect(Collectors.toList());<NEW_LINE>listener.onResponse(docs);<NEW_LINE>} catch (AggregationResultUtils.AggregationExtractionException extractionException) {<NEW_LINE>listener.onFailure(new ElasticsearchStatusException(extractionException.getMessage(), RestStatus.BAD_REQUEST));<NEW_LINE>}<NEW_LINE>}, listener::onFailure));<NEW_LINE>} | ("Source indices have been deleted or closed.", RestStatus.BAD_REQUEST)); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.