idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
1,018,639 | public void onUnsubscribe(int iLiveToken) {<NEW_LINE>boolean sendFail = true;<NEW_LINE>do {<NEW_LINE>List<OClientConnection> connections = session.getConnections();<NEW_LINE>if (connections.size() == 0) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>ONetworkProtocolBinary protocol = (ONetworkProtocolBinary) connections.get(0).getProtocol();<NEW_LINE>OChannelBinary channel = protocol.getChannel();<NEW_LINE>try {<NEW_LINE>channel.acquireWriteLock();<NEW_LINE>try {<NEW_LINE>ByteArrayOutputStream content = new ByteArrayOutputStream();<NEW_LINE>DataOutputStream out = new DataOutputStream(content);<NEW_LINE>out.writeByte('u');<NEW_LINE>out.writeInt(iLiveToken);<NEW_LINE>channel.writeByte(OChannelBinaryProtocol.PUSH_DATA);<NEW_LINE><MASK><NEW_LINE>channel.writeByte(OChannelBinaryProtocol.REQUEST_PUSH_LIVE_QUERY);<NEW_LINE>channel.writeBytes(content.toByteArray());<NEW_LINE>channel.flush();<NEW_LINE>} finally {<NEW_LINE>channel.releaseWriteLock();<NEW_LINE>}<NEW_LINE>sendFail = false;<NEW_LINE>} catch (IOException e) {<NEW_LINE>connections = session.getConnections();<NEW_LINE>if (connections.isEmpty()) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>OLogManager.instance().warn(this, "Cannot push cluster configuration to the client %s", e, protocol.getRemoteAddress());<NEW_LINE>protocol.getServer().getClientConnectionManager().disconnect(connection);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} while (sendFail);<NEW_LINE>} | channel.writeInt(Integer.MIN_VALUE); |
1,222,293 | final ListTagsForResourceResult executeListTagsForResource(ListTagsForResourceRequest listTagsForResourceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listTagsForResourceRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListTagsForResourceRequest> request = null;<NEW_LINE>Response<ListTagsForResourceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListTagsForResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listTagsForResourceRequest));<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, "CodeStar connections");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListTagsForResource");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListTagsForResourceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListTagsForResourceResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); |
1,399,734 | public void rewriteVarArgsArg(OverloadMethodSet overloadMethodSet, MethodPrototype methodPrototype, List<Expression> args, GenericTypeBinder gtb) {<NEW_LINE>if (!methodPrototype.isVarArgs())<NEW_LINE>return;<NEW_LINE>if (args.size() != methodPrototype.getArgs().size() || args.isEmpty()) {<NEW_LINE>// This shouldn't be possible. Someone's decorated a method varargs<NEW_LINE>// when it isn't really. Obfuscator?<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int last = args.size() - 1;<NEW_LINE>Expression lastArg = args.get(args.size() - 1);<NEW_LINE>if (!(lastArg instanceof NewAnonymousArray))<NEW_LINE>return;<NEW_LINE>List<Expression> args2 = ListFactory.newList(args);<NEW_LINE>args2.remove(last);<NEW_LINE>NewAnonymousArray newAnonymousArray = (NewAnonymousArray) lastArg;<NEW_LINE>List<Expression<MASK><NEW_LINE>if (anonVals.size() == 1) {<NEW_LINE>Literal nullLit = new Literal(TypedLiteral.getNull());<NEW_LINE>Expression argument = anonVals.get(0);<NEW_LINE>if (argument.equals(nullLit))<NEW_LINE>return;<NEW_LINE>if (argument.getInferredJavaType().getJavaTypeInstance() instanceof JavaArrayTypeInstance)<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>args2.addAll(newAnonymousArray.getValues());<NEW_LINE>boolean correct = overloadMethodSet.callsCorrectEntireMethod(args2, gtb);<NEW_LINE>if (correct) {<NEW_LINE>args.clear();<NEW_LINE>args.addAll(args2);<NEW_LINE>}<NEW_LINE>} | > anonVals = newAnonymousArray.getValues(); |
1,256,258 | public okhttp3.Call exportTenantConfigCall(final ApiCallback _callback) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/tenant-config";<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, String> localVarCookieParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final <MASK><NEW_LINE>final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null) {<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>}<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>String[] localVarAuthNames = new String[] { "OAuth2Security" };<NEW_LINE>return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);<NEW_LINE>} | String[] localVarAccepts = { "application/json" }; |
582,403 | public static QueryMqSofamqConsumerConnectionResponse unmarshall(QueryMqSofamqConsumerConnectionResponse queryMqSofamqConsumerConnectionResponse, UnmarshallerContext _ctx) {<NEW_LINE>queryMqSofamqConsumerConnectionResponse.setRequestId(_ctx.stringValue("QueryMqSofamqConsumerConnectionResponse.RequestId"));<NEW_LINE>queryMqSofamqConsumerConnectionResponse.setResultCode<MASK><NEW_LINE>queryMqSofamqConsumerConnectionResponse.setResultMessage(_ctx.stringValue("QueryMqSofamqConsumerConnectionResponse.ResultMessage"));<NEW_LINE>Data data = new Data();<NEW_LINE>List<ConnectionListItem> connectionList = new ArrayList<ConnectionListItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("QueryMqSofamqConsumerConnectionResponse.Data.ConnectionList.Length"); i++) {<NEW_LINE>ConnectionListItem connectionListItem = new ConnectionListItem();<NEW_LINE>connectionListItem.setClientAddr(_ctx.stringValue("QueryMqSofamqConsumerConnectionResponse.Data.ConnectionList[" + i + "].ClientAddr"));<NEW_LINE>connectionListItem.setClientId(_ctx.stringValue("QueryMqSofamqConsumerConnectionResponse.Data.ConnectionList[" + i + "].ClientId"));<NEW_LINE>connectionListItem.setLanguage(_ctx.stringValue("QueryMqSofamqConsumerConnectionResponse.Data.ConnectionList[" + i + "].Language"));<NEW_LINE>connectionListItem.setRemoteIp(_ctx.stringValue("QueryMqSofamqConsumerConnectionResponse.Data.ConnectionList[" + i + "].RemoteIp"));<NEW_LINE>connectionListItem.setVersion(_ctx.stringValue("QueryMqSofamqConsumerConnectionResponse.Data.ConnectionList[" + i + "].Version"));<NEW_LINE>connectionList.add(connectionListItem);<NEW_LINE>}<NEW_LINE>data.setConnectionList(connectionList);<NEW_LINE>queryMqSofamqConsumerConnectionResponse.setData(data);<NEW_LINE>return queryMqSofamqConsumerConnectionResponse;<NEW_LINE>} | (_ctx.stringValue("QueryMqSofamqConsumerConnectionResponse.ResultCode")); |
1,213,130 | public Position destination(EditorAdaptor editorAdaptor, int count, Position fromPosition) throws CommandExecutionException {<NEW_LINE>TextContent viewContent = editorAdaptor.getViewContent();<NEW_LINE>if (viewContent.getTextLength() == 0)<NEW_LINE>return null;<NEW_LINE>ViewportService viewport = editorAdaptor.getViewportService();<NEW_LINE>ViewPortInformation view = viewport.getViewPortInformation();<NEW_LINE>Configuration config = editorAdaptor.getConfiguration();<NEW_LINE>if (type.updateScrollOption() && count != NO_COUNT_GIVEN) {<NEW_LINE>config.set(Options.SCROLL, count);<NEW_LINE>}<NEW_LINE>int scroll = config.get(Options.SCROLL);<NEW_LINE>if (scroll == 0) {<NEW_LINE>scroll = view.getNumberOfLines() / 2;<NEW_LINE>}<NEW_LINE>if (count == NO_COUNT_GIVEN) {<NEW_LINE>count = 1;<NEW_LINE>}<NEW_LINE>Position pos = editorAdaptor.getCursorService().getPosition();<NEW_LINE>int lastChar = viewContent.getTextLength() - 1;<NEW_LINE>int lastLineNumber = viewContent.getLineInformationOfOffset(lastChar).getNumber();<NEW_LINE>LineInformation line = viewContent.getLineInformationOfOffset(pos.getViewOffset());<NEW_LINE>int currenCursorLine = line.getNumber();<NEW_LINE>int scrolloff = config.get(Options.SCROLL_OFFSET);<NEW_LINE>int topline = type.calculateTopLine(view, count, scroll);<NEW_LINE>int newModelLine;<NEW_LINE>if (topline >= lastLineNumber) {<NEW_LINE>newModelLine = viewport.viewLine2ModelLine(lastLineNumber) + 1;<NEW_LINE>} else {<NEW_LINE>editorAdaptor.getViewportService().setTopLine(Math.max(0, topline));<NEW_LINE>view = editorAdaptor.getViewportService().getViewPortInformation();<NEW_LINE>int cursorViewLine = type.calculateCursorLine(<MASK><NEW_LINE>int newCursorViewLine = Math.min(lastLineNumber + 1, Math.max(0, cursorViewLine));<NEW_LINE>newModelLine = viewport.viewLine2ModelLine(newCursorViewLine);<NEW_LINE>}<NEW_LINE>Position newpos = editorAdaptor.getCursorService().stickyColumnAtModelLine(newModelLine);<NEW_LINE>return newpos;<NEW_LINE>} | view, currenCursorLine, scrolloff, scroll); |
1,570,919 | private void prepareType(Expression type, Scope scope) {<NEW_LINE>Expression namespaceName = type;<NEW_LINE>if (namespaceName instanceof NullableType) {<NEW_LINE>NullableType nullableType = (NullableType) namespaceName;<NEW_LINE>if (nullableType.getType() instanceof NamespaceName) {<NEW_LINE>namespaceName = (NamespaceName) nullableType.getType();<NEW_LINE>}<NEW_LINE>} else if (namespaceName instanceof UnionType) {<NEW_LINE>// NETBEANS-4443 PHP 8.0<NEW_LINE>UnionType unionType = (UnionType) namespaceName;<NEW_LINE>unionType.getTypes().forEach(t -> prepareType(t, scope));<NEW_LINE>} else if (namespaceName instanceof IntersectionType) {<NEW_LINE>// NETBEANS-5599 PHP 8.1<NEW_LINE>IntersectionType intersectionType = (IntersectionType) namespaceName;<NEW_LINE>intersectionType.getTypes().forEach(t -> prepareType(t, scope));<NEW_LINE>}<NEW_LINE>if (namespaceName instanceof NamespaceName) {<NEW_LINE>Kind[] kinds = { Kind.CLASS, Kind.IFACE };<NEW_LINE>occurencesBuilder.prepare(kinds<MASK><NEW_LINE>}<NEW_LINE>} | , (NamespaceName) namespaceName, scope); |
1,157,300 | public Item addAdjustment(final InvoiceItem item) {<NEW_LINE>final UUID targetId = item.getLinkedItemId();<NEW_LINE>final NodeInterval node = findNode(new SearchCallback() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean isMatch(final NodeInterval curNode) {<NEW_LINE>return ((ItemsNodeInterval) curNode).getItemsInterval(<MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>Preconditions.checkNotNull(node, "Unable to find item interval for id='%s', tree=%s", targetId, this);<NEW_LINE>final ItemsInterval targetItemsInterval = ((ItemsNodeInterval) node).getItemsInterval();<NEW_LINE>final Item targetItem = targetItemsInterval.findItem(targetId);<NEW_LINE>Preconditions.checkNotNull(targetItem, "Unable to find item with id='%s', itemsInterval=%s", targetId, targetItemsInterval);<NEW_LINE>final BigDecimal adjustmentAmount = item.getAmount().negate();<NEW_LINE>targetItem.incrementAdjustedAmount(adjustmentAmount);<NEW_LINE>return null;<NEW_LINE>} | ).findItem(targetId) != null; |
1,310,766 | private synchronized boolean addBanInfoNow(ModeratorActionData data) {<NEW_LINE>String command = ModLogInfo.makeCommand(data);<NEW_LINE>for (int i = lines.size() - 1; i >= 0; i--) {<NEW_LINE>Message m = lines.get(i);<NEW_LINE>// Too old, abort (associated message might not be here yet)<NEW_LINE>if (System.currentTimeMillis() - m.getTime() > BAN_INFO_WAIT) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (m instanceof BanMessage) {<NEW_LINE>BanMessage bm = (BanMessage) m;<NEW_LINE>if (bm.by == null && command.equals(Helper.makeBanCommand(this, bm.duration, bm.id))) {<NEW_LINE>lines.set(i, bm.addModLogInfo(data.created_by, ModLogInfo.getReason(data)));<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>} else if (m instanceof MsgDeleted) {<NEW_LINE>MsgDeleted md = (MsgDeleted) m;<NEW_LINE>if (md.by == null && command.equals(Helper.makeBanCommand(this, -2, md.targetMsgId))) {<NEW_LINE>lines.set(i, md<MASK><NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | .addModLogInfo(data.created_by)); |
431,514 | public void onFilter(Filters filters) {<NEW_LINE>// Construct query basic query<NEW_LINE>Query query = mFirestore.collection("restaurants");<NEW_LINE>// Category (equality filter)<NEW_LINE>if (filters.hasCategory()) {<NEW_LINE>query = query.whereEqualTo(Restaurant.FIELD_CATEGORY, filters.getCategory());<NEW_LINE>}<NEW_LINE>// City (equality filter)<NEW_LINE>if (filters.hasCity()) {<NEW_LINE>query = query.whereEqualTo(Restaurant.FIELD_CITY, filters.getCity());<NEW_LINE>}<NEW_LINE>// Price (equality filter)<NEW_LINE>if (filters.hasPrice()) {<NEW_LINE>query = query.whereEqualTo(Restaurant.<MASK><NEW_LINE>}<NEW_LINE>// Sort by (orderBy with direction)<NEW_LINE>if (filters.hasSortBy()) {<NEW_LINE>query = query.orderBy(filters.getSortBy(), filters.getSortDirection());<NEW_LINE>}<NEW_LINE>// Limit items<NEW_LINE>query = query.limit(LIMIT);<NEW_LINE>// Update the query<NEW_LINE>mAdapter.setQuery(query);<NEW_LINE>// Set header<NEW_LINE>mBinding.textCurrentSearch.setText(HtmlCompat.fromHtml(filters.getSearchDescription(requireContext()), HtmlCompat.FROM_HTML_MODE_LEGACY));<NEW_LINE>mBinding.textCurrentSortBy.setText(filters.getOrderDescription(requireContext()));<NEW_LINE>// Save filters<NEW_LINE>mViewModel.setFilters(filters);<NEW_LINE>} | FIELD_PRICE, filters.getPrice()); |
465,628 | public DruidStatement createStatement(SqlLifecycleFactory sqlLifecycleFactory) {<NEW_LINE>final <MASK><NEW_LINE>synchronized (connectionLock) {<NEW_LINE>if (statements.containsKey(statementId)) {<NEW_LINE>// Will only happen if statementCounter rolls over before old statements are cleaned up. If this<NEW_LINE>// ever happens then something fishy is going on, because we shouldn't have billions of statements.<NEW_LINE>throw DruidMeta.logFailure(new ISE("Uh oh, too many statements"));<NEW_LINE>}<NEW_LINE>if (statements.size() >= maxStatements) {<NEW_LINE>throw DruidMeta.logFailure(new ISE("Too many open statements, limit is[%,d]", maxStatements));<NEW_LINE>}<NEW_LINE>// remove sensitive fields from the context, only the connection's context needs to have authentication<NEW_LINE>// credentials<NEW_LINE>Map<String, Object> sanitizedContext = Maps.filterEntries(context, e -> !SENSITIVE_CONTEXT_FIELDS.contains(e.getKey()));<NEW_LINE>@SuppressWarnings("GuardedBy")<NEW_LINE>final DruidStatement statement = new DruidStatement(connectionId, statementId, ImmutableSortedMap.copyOf(sanitizedContext), sqlLifecycleFactory.factorize(), () -> {<NEW_LINE>// onClose function for the statement<NEW_LINE>LOG.debug("Connection[%s] closed statement[%s].", connectionId, statementId);<NEW_LINE>// statements will be accessed unsynchronized to avoid deadlock<NEW_LINE>statements.remove(statementId);<NEW_LINE>});<NEW_LINE>statements.put(statementId, statement);<NEW_LINE>LOG.debug("Connection[%s] opened statement[%s].", connectionId, statementId);<NEW_LINE>return statement;<NEW_LINE>}<NEW_LINE>} | int statementId = statementCounter.incrementAndGet(); |
1,137,304 | private static void spawnMob(final IEssentials ess, final Server server, final CommandSource sender, final User target, final Location sloc, final List<String> parts, final List<String> data) throws Exception {<NEW_LINE>Mob mob;<NEW_LINE>Entity spawnedMob = null;<NEW_LINE>Entity spawnedMount;<NEW_LINE>for (int i = 0; i < parts.size(); i++) {<NEW_LINE>if (i == 0) {<NEW_LINE>mob = Mob.fromName(parts.get(i));<NEW_LINE>spawnedMob = mob.spawn(sloc.getWorld(), server, sloc);<NEW_LINE>defaultMobData(mob.getType(), spawnedMob);<NEW_LINE>if (data.get(i) != null) {<NEW_LINE>changeMobData(sender, mob.getType(), spawnedMob, data.get(i).toLowerCase(Locale.ENGLISH), target);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final int next = i + 1;<NEW_LINE>// If it's the last mob in the list, don't set the mount<NEW_LINE>if (next < parts.size()) {<NEW_LINE>final Mob mMob = Mob.fromName(parts.get(next));<NEW_LINE>spawnedMount = mMob.spawn(sloc.getWorld(), server, sloc);<NEW_LINE>defaultMobData(mMob.getType(), spawnedMount);<NEW_LINE>if (data.get(next) != null) {<NEW_LINE>changeMobData(sender, mMob.getType(), spawnedMount, data.get(next).toLowerCase<MASK><NEW_LINE>}<NEW_LINE>spawnedMob.setPassenger(spawnedMount);<NEW_LINE>spawnedMob = spawnedMount;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | (Locale.ENGLISH), target); |
348,640 | private String format(JSError error, boolean warning) {<NEW_LINE>SourceExcerptProvider source = getSource();<NEW_LINE>String sourceName = error.getSourceName();<NEW_LINE>int lineNumber = error.getLineNumber();<NEW_LINE>int charno = error.getCharno();<NEW_LINE>// Format the non-reverse-mapped position.<NEW_LINE>StringBuilder b = new StringBuilder();<NEW_LINE>StringBuilder boldLine = new StringBuilder();<NEW_LINE>OriginalMapping mapping = source == null ? null : source.getSourceMapping(error.getSourceName(), error.getLineNumber(), error.getCharno());<NEW_LINE>// Check if we can reverse-map the source.<NEW_LINE>if (includeLocation) {<NEW_LINE>if (mapping != null) {<NEW_LINE>appendPosition(b, sourceName, lineNumber, charno);<NEW_LINE>sourceName = mapping.getOriginalFile();<NEW_LINE>lineNumber = mapping.getLineNumber();<NEW_LINE>charno = mapping.getColumnPosition();<NEW_LINE>b.append("\nOriginally at:\n");<NEW_LINE>}<NEW_LINE>appendPosition(boldLine, sourceName, lineNumber, charno);<NEW_LINE>}<NEW_LINE>if (includeLevel) {<NEW_LINE>boldLine.append(getLevelName(warning ? CheckLevel.WARNING : CheckLevel.ERROR));<NEW_LINE>boldLine.append(" - [");<NEW_LINE>boldLine.append(<MASK><NEW_LINE>boldLine.append("] ");<NEW_LINE>}<NEW_LINE>boldLine.append(error.getDescription());<NEW_LINE>b.append(maybeEmbolden(boldLine.toString()));<NEW_LINE>b.append('\n');<NEW_LINE>// For reverse-mapped sources, fall back to a single line excerpt because the excerpt length<NEW_LINE>// cannot be reliably mapped.<NEW_LINE>String sourceExcerptWithPosition = getExcerptWithPosition(error, sourceName, lineNumber, charno, mapping != null ? LINE : defaultFormat);<NEW_LINE>if (sourceExcerptWithPosition != null) {<NEW_LINE>b.append(sourceExcerptWithPosition);<NEW_LINE>}<NEW_LINE>return b.toString();<NEW_LINE>} | error.getType().key); |
724,847 | public int compareTo(checkTableClass_args other) {<NEW_LINE>if (!getClass().equals(other.getClass())) {<NEW_LINE>return getClass().getName().compareTo(other.getClass().getName());<NEW_LINE>}<NEW_LINE>int lastComparison = 0;<NEW_LINE>lastComparison = java.lang.Boolean.compare(isSetTinfo(), other.isSetTinfo());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetTinfo()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tinfo, other.tinfo);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lastComparison = java.lang.Boolean.compare(isSetCredentials(), other.isSetCredentials());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetCredentials()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.credentials, other.credentials);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lastComparison = java.lang.Boolean.compare(isSetTableId(), other.isSetTableId());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetTableId()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tableId, other.tableId);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lastComparison = java.lang.Boolean.compare(isSetClassName(<MASK><NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetClassName()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.className, other.className);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lastComparison = java.lang.Boolean.compare(isSetInterfaceMatch(), other.isSetInterfaceMatch());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetInterfaceMatch()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.interfaceMatch, other.interfaceMatch);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return 0;<NEW_LINE>} | ), other.isSetClassName()); |
867,882 | private <V> List<Map.Entry<ByteString, V>> tagPrefixPageTagValues(Windmill.TagValuePrefixResponse tagValuePrefixResponse, Coder<V> valueCoder) {<NEW_LINE>if (tagValuePrefixResponse.getTagValuesCount() == 0) {<NEW_LINE>return new WeightedList<>(Collections.emptyList());<NEW_LINE>}<NEW_LINE>WeightedList<Map.Entry<ByteString, V>> entryList = new WeightedList<Map.Entry<ByteString, V>>(new ArrayList<><MASK><NEW_LINE>for (TagValue entry : tagValuePrefixResponse.getTagValuesList()) {<NEW_LINE>try {<NEW_LINE>V value = valueCoder.decode(entry.getValue().getData().newInput(), Context.OUTER);<NEW_LINE>entryList.addWeighted(new AbstractMap.SimpleEntry<>(entry.getTag(), value), entry.getTag().size() + entry.getValue().getData().size());<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new IllegalStateException("Unable to decode tag value " + e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return entryList;<NEW_LINE>} | (tagValuePrefixResponse.getTagValuesCount())); |
977,095 | public void marshall(GcpMySQLSettings gcpMySQLSettings, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (gcpMySQLSettings == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(gcpMySQLSettings.getAfterConnectScript(), AFTERCONNECTSCRIPT_BINDING);<NEW_LINE>protocolMarshaller.marshall(gcpMySQLSettings.getCleanSourceMetadataOnMismatch(), CLEANSOURCEMETADATAONMISMATCH_BINDING);<NEW_LINE>protocolMarshaller.marshall(gcpMySQLSettings.getDatabaseName(), DATABASENAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(gcpMySQLSettings.getEventsPollInterval(), EVENTSPOLLINTERVAL_BINDING);<NEW_LINE>protocolMarshaller.marshall(gcpMySQLSettings.getTargetDbType(), TARGETDBTYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(gcpMySQLSettings.getMaxFileSize(), MAXFILESIZE_BINDING);<NEW_LINE>protocolMarshaller.marshall(gcpMySQLSettings.getParallelLoadThreads(), PARALLELLOADTHREADS_BINDING);<NEW_LINE>protocolMarshaller.marshall(gcpMySQLSettings.getPassword(), PASSWORD_BINDING);<NEW_LINE>protocolMarshaller.marshall(gcpMySQLSettings.getPort(), PORT_BINDING);<NEW_LINE>protocolMarshaller.marshall(gcpMySQLSettings.getServerName(), SERVERNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(gcpMySQLSettings.getServerTimezone(), SERVERTIMEZONE_BINDING);<NEW_LINE>protocolMarshaller.marshall(gcpMySQLSettings.getUsername(), USERNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(gcpMySQLSettings.getSecretsManagerSecretId(), SECRETSMANAGERSECRETID_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | gcpMySQLSettings.getSecretsManagerAccessRoleArn(), SECRETSMANAGERACCESSROLEARN_BINDING); |
1,724,870 | public void generateSolution() {<NEW_LINE>if (this.population.isEmpty()) {<NEW_LINE>this.initializePopulation();<NEW_LINE>assert !this<MASK><NEW_LINE>}<NEW_LINE>if (Properties.ENABLE_SECONDARY_OBJECTIVE_AFTER > 0 || Properties.ENABLE_SECONDARY_OBJECTIVE_STARVATION) {<NEW_LINE>this.disableFirstSecondaryCriterion();<NEW_LINE>}<NEW_LINE>logger.debug("Starting evolution");<NEW_LINE>while (!this.isFinished()) {<NEW_LINE>this.evolve();<NEW_LINE>if (this.shouldApplyLocalSearch()) {<NEW_LINE>TestSuiteChromosome testSuite = new TestSuiteChromosome();<NEW_LINE>// local search process only take into account the population of the GA, and not the<NEW_LINE>// solutions in the archive<NEW_LINE>if (Archive.getArchiveInstance().hasBeenUpdated()) {<NEW_LINE>Set<TestChromosome> testsInArchive = Archive.getArchiveInstance().getSolutions();<NEW_LINE>if (!testsInArchive.isEmpty()) {<NEW_LINE>for (TestChromosome test : testsInArchive) {<NEW_LINE>testSuite.addTest(test.getTestCase().clone());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.applyLocalSearch(testSuite);<NEW_LINE>}<NEW_LINE>logger.info("Updating fitness values");<NEW_LINE>this.updateFitnessFunctionsAndValues();<NEW_LINE>logger.info("Current iteration: " + currentIteration);<NEW_LINE>this.notifyIteration();<NEW_LINE>}<NEW_LINE>TimeController.execute(this::updateBestIndividualFromArchive, "Update from archive", 5_000);<NEW_LINE>this.notifySearchFinished();<NEW_LINE>} | .population.isEmpty() : "Initial population is empty, i.e., EvoSuite could not create any test!"; |
1,070,667 | public SegmentProcessorConfig build() {<NEW_LINE>Preconditions.checkState(_tableConfig != null, "Must provide table config in SegmentProcessorConfig");<NEW_LINE>Preconditions.checkState(_schema != null, "Must provide schema in SegmentProcessorConfig");<NEW_LINE>if (_timeHandlerConfig == null) {<NEW_LINE>_timeHandlerConfig = new TimeHandlerConfig.Builder(TimeHandler.<MASK><NEW_LINE>}<NEW_LINE>if (_partitionerConfigs == null) {<NEW_LINE>_partitionerConfigs = Collections.emptyList();<NEW_LINE>}<NEW_LINE>if (_mergeType == null) {<NEW_LINE>_mergeType = DEFAULT_MERGE_TYPE;<NEW_LINE>}<NEW_LINE>if (_aggregationTypes == null) {<NEW_LINE>_aggregationTypes = Collections.emptyMap();<NEW_LINE>}<NEW_LINE>if (_segmentConfig == null) {<NEW_LINE>_segmentConfig = new SegmentConfig.Builder().build();<NEW_LINE>}<NEW_LINE>return new SegmentProcessorConfig(_tableConfig, _schema, _timeHandlerConfig, _partitionerConfigs, _mergeType, _aggregationTypes, _segmentConfig);<NEW_LINE>} | Type.NO_OP).build(); |
961,998 | private static void introduceFirstPointAndLastPoint(List<Location> locations, List<RouteDirectionInfo> directions, List<RouteSegmentResult> segs, Location start, LatLon end, OsmandApplication ctx) {<NEW_LINE>boolean firstPointIntroduced = introduceFirstPoint(locations, directions, segs, start);<NEW_LINE>boolean lastPointIntroduced = introduceLastPoint(locations, directions, segs, end);<NEW_LINE>if (firstPointIntroduced || lastPointIntroduced) {<NEW_LINE>checkForDuplicatePoints(locations, directions);<NEW_LINE>}<NEW_LINE>RouteDirectionInfo lastDirInf = directions.size() > 0 ? directions.get(directions.size() - 1) : null;<NEW_LINE>if ((lastDirInf == null || lastDirInf.routePointOffset < locations.size() - 1) && locations.size() - 1 > 0) {<NEW_LINE>int type = TurnType.C;<NEW_LINE>Location prevLast = locations.get(<MASK><NEW_LINE>float lastBearing = prevLast.bearingTo(locations.get(locations.size() - 1));<NEW_LINE>float[] compute = new float[2];<NEW_LINE>Location.distanceBetween(prevLast.getLatitude(), prevLast.getLongitude(), end.getLatitude(), end.getLongitude(), compute);<NEW_LINE>float bearingToEnd = compute[1];<NEW_LINE>double diff = MapUtils.degreesDiff(lastBearing, bearingToEnd);<NEW_LINE>if (Math.abs(diff) > 10) {<NEW_LINE>type = diff > 0 ? TurnType.KL : TurnType.KR;<NEW_LINE>}<NEW_LINE>// Wrong AvgSpeed for the last turn can cause significantly wrong total travel time if calculated route ends on a GPX route segment (then last turn is where GPX is joined again)<NEW_LINE>RouteDirectionInfo info = new RouteDirectionInfo(lastDirInf != null ? lastDirInf.getAverageSpeed() : 1, TurnType.valueOf(type, false));<NEW_LINE>if (segs != null) {<NEW_LINE>RouteSegmentResult lastSegmentResult = segs.get(segs.size() - 1);<NEW_LINE>RouteDataObject routeDataObject = lastSegmentResult.getObject();<NEW_LINE>info.setRouteDataObject(routeDataObject);<NEW_LINE>info.setRef(routeDataObject.getRef(ctx.getSettings().MAP_PREFERRED_LOCALE.get(), ctx.getSettings().MAP_TRANSLITERATE_NAMES.get(), lastSegmentResult.isForwardDirection()));<NEW_LINE>info.setStreetName(routeDataObject.getName(ctx.getSettings().MAP_PREFERRED_LOCALE.get(), ctx.getSettings().MAP_TRANSLITERATE_NAMES.get()));<NEW_LINE>info.setDestinationName(routeDataObject.getDestinationName(ctx.getSettings().MAP_PREFERRED_LOCALE.get(), ctx.getSettings().MAP_TRANSLITERATE_NAMES.get(), lastSegmentResult.isForwardDirection()));<NEW_LINE>}<NEW_LINE>info.distance = 0;<NEW_LINE>info.afterLeftTime = 0;<NEW_LINE>info.routePointOffset = locations.size() - 1;<NEW_LINE>directions.add(info);<NEW_LINE>}<NEW_LINE>} | locations.size() - 2); |
1,395,160 | private void restoreInflightMessages() {<NEW_LINE>final String methodName = "restoreInflightMessages";<NEW_LINE>pendingMessages = new Vector(this.maxInflight);<NEW_LINE>pendingFlows = new Vector();<NEW_LINE>Enumeration keys = outboundQoS2.keys();<NEW_LINE>while (keys.hasMoreElements()) {<NEW_LINE>Object key = keys.nextElement();<NEW_LINE>MqttWireMessage msg = (MqttWireMessage) outboundQoS2.get(key);<NEW_LINE>if (msg instanceof MqttPublish) {<NEW_LINE>// @TRACE 610=QoS 2 publish key={0}<NEW_LINE>log.fine(CLASS_NAME, methodName, "610", new Object[] { key });<NEW_LINE>// set DUP flag only for PUBLISH, but NOT for PUBREL (spec 3.1.1)<NEW_LINE>msg.setDuplicate(true);<NEW_LINE>insertInOrder(pendingMessages, (MqttPublish) msg);<NEW_LINE>} else if (msg instanceof MqttPubRel) {<NEW_LINE>// @TRACE 611=QoS 2 pubrel key={0}<NEW_LINE>log.fine(CLASS_NAME, methodName, "611", new Object[] { key });<NEW_LINE>insertInOrder(pendingFlows, (MqttPubRel) msg);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>keys = outboundQoS1.keys();<NEW_LINE>while (keys.hasMoreElements()) {<NEW_LINE>Object key = keys.nextElement();<NEW_LINE>MqttPublish msg = (MqttPublish) outboundQoS1.get(key);<NEW_LINE>msg.setDuplicate(true);<NEW_LINE>// @TRACE 612=QoS 1 publish key={0}<NEW_LINE>log.fine(CLASS_NAME, methodName, "612", new Object[] { key });<NEW_LINE>insertInOrder(pendingMessages, msg);<NEW_LINE>}<NEW_LINE>keys = outboundQoS0.keys();<NEW_LINE>while (keys.hasMoreElements()) {<NEW_LINE>Object key = keys.nextElement();<NEW_LINE>MqttPublish msg = (MqttPublish) outboundQoS0.get(key);<NEW_LINE>// @TRACE 512=QoS 0 publish key={0}<NEW_LINE>log.fine(CLASS_NAME, methodName, "512", new Object[] { key });<NEW_LINE>insertInOrder(pendingMessages, msg);<NEW_LINE>}<NEW_LINE>this.pendingFlows = reOrder(pendingFlows);<NEW_LINE><MASK><NEW_LINE>} | this.pendingMessages = reOrder(pendingMessages); |
707,019 | /* }}} queryAttributeRecursive */<NEW_LINE>private Object queryAttributeRecursive(TabularData parent, /* {{{ */<NEW_LINE>List<String> attrName) {<NEW_LINE>String key;<NEW_LINE>Object value = null;<NEW_LINE>key = attrName.remove(0);<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>Collection<CompositeData> table = (Collection<CompositeData>) parent.values();<NEW_LINE>for (CompositeData compositeData : table) {<NEW_LINE>if (key.equals(compositeData.get("key"))) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (null == value) {<NEW_LINE>return (null);<NEW_LINE>}<NEW_LINE>if (attrName.size() == 0) {<NEW_LINE>return (value);<NEW_LINE>} else {<NEW_LINE>if (value instanceof CompositeData)<NEW_LINE>return (queryAttributeRecursive((CompositeData) value, attrName));<NEW_LINE>else if (value instanceof TabularData)<NEW_LINE>return (queryAttributeRecursive((TabularData) value, attrName));<NEW_LINE>else<NEW_LINE>return (null);<NEW_LINE>}<NEW_LINE>} | value = compositeData.get("value"); |
279,808 | public GetStreamKeyResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>GetStreamKeyResult getStreamKeyResult = new GetStreamKeyResult();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return getStreamKeyResult;<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("streamKey", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getStreamKeyResult.setStreamKey(StreamKeyJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return getStreamKeyResult;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
1,568,712 | public void visit(BLangWhile astWhileStmt) {<NEW_LINE>BIRBasicBlock currentEnclLoopBB = this.env.enclLoopBB;<NEW_LINE>BIRBasicBlock currentEnclLoopEndBB = this.env.enclLoopEndBB;<NEW_LINE>// Create a basic block for the while expression.<NEW_LINE>BIRBasicBlock whileExprBB = new BIRBasicBlock(this.env.nextBBId(names));<NEW_LINE>addToTrapStack(whileExprBB);<NEW_LINE>this.env.enclBasicBlocks.add(whileExprBB);<NEW_LINE>// Insert a GOTO instruction as the terminal instruction into current basic block.<NEW_LINE>this.env.enclBB.terminator = new BIRTerminator.GOTO(null, whileExprBB, this.currentScope);<NEW_LINE>// Visit condition expression<NEW_LINE>this.env.enclBB = whileExprBB;<NEW_LINE><MASK><NEW_LINE>BIROperand whileExprResult = this.env.targetOperand;<NEW_LINE>// Create the basic block for the while-body block.<NEW_LINE>BIRBasicBlock whileBodyBB = new BIRBasicBlock(this.env.nextBBId(names));<NEW_LINE>addToTrapStack(whileBodyBB);<NEW_LINE>this.env.enclBasicBlocks.add(whileBodyBB);<NEW_LINE>// Create the basic block for the statements that comes after the while statement.<NEW_LINE>BIRBasicBlock whileEndBB = new BIRBasicBlock(this.env.nextBBId(names));<NEW_LINE>addToTrapStack(whileEndBB);<NEW_LINE>// Add the branch instruction to the while expression basic block.<NEW_LINE>this.env.enclBB.terminator = new BIRTerminator.Branch(astWhileStmt.pos, whileExprResult, whileBodyBB, whileEndBB, this.currentScope);<NEW_LINE>// Visit while body<NEW_LINE>this.env.enclBB = whileBodyBB;<NEW_LINE>this.env.enclLoopBB = whileExprBB;<NEW_LINE>this.env.enclLoopEndBB = whileEndBB;<NEW_LINE>this.env.unlockVars.push(new BIRLockDetailsHolder());<NEW_LINE>astWhileStmt.body.accept(this);<NEW_LINE>this.env.unlockVars.pop();<NEW_LINE>if (this.env.enclBB.terminator == null) {<NEW_LINE>this.env.enclBB.terminator = new BIRTerminator.GOTO(null, whileExprBB, this.currentScope);<NEW_LINE>}<NEW_LINE>this.env.enclBasicBlocks.add(whileEndBB);<NEW_LINE>this.env.enclBB = whileEndBB;<NEW_LINE>this.env.enclLoopBB = currentEnclLoopBB;<NEW_LINE>this.env.enclLoopEndBB = currentEnclLoopEndBB;<NEW_LINE>} | astWhileStmt.expr.accept(this); |
1,421,923 | ArgumentSorterNode.MappedArguments doExecute(FunctionSchema preApplicationSchema, ArgumentMapping mapping, InvokeCallableNode.ArgumentsExecutionMode argumentsExecutionMode, Function function, Object state, Object[] arguments, @Cached ThunkExecutorNode thunkExecutorNode) {<NEW_LINE>FunctionSchema postApplicationSchema = mapping.getPostApplicationSchema();<NEW_LINE>if (argumentsExecutionMode.shouldExecute()) {<NEW_LINE>state = executeArguments(mapping, arguments, state, thunkExecutorNode);<NEW_LINE>}<NEW_LINE>Object[] mappedAppliedArguments = prepareArguments(preApplicationSchema, postApplicationSchema, mapping, function, arguments);<NEW_LINE>Object[] oversaturatedArguments = null;<NEW_LINE>if (postApplicationSchema.hasOversaturatedArgs()) {<NEW_LINE>oversaturatedArguments = generateOversaturatedArguments(preApplicationSchema, postApplicationSchema, mapping, function, arguments);<NEW_LINE>}<NEW_LINE>return new ArgumentSorterNode.<MASK><NEW_LINE>} | MappedArguments(state, mappedAppliedArguments, oversaturatedArguments); |
1,397,751 | protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>setContentView(R.layout.activity_flexiblespacewithimagelistview);<NEW_LINE>mFlexibleSpaceImageHeight = getResources().getDimensionPixelSize(R.dimen.flexible_space_image_height);<NEW_LINE>mFlexibleSpaceShowFabOffset = getResources().getDimensionPixelSize(R.dimen.flexible_space_show_fab_offset);<NEW_LINE>mActionBarSize = getActionBarSize();<NEW_LINE>mImageView = findViewById(R.id.image);<NEW_LINE>mOverlayView = findViewById(R.id.overlay);<NEW_LINE>ObservableListView listView = (ObservableListView) findViewById(R.id.list);<NEW_LINE>listView.setScrollViewCallbacks(this);<NEW_LINE>// Set padding view for ListView. This is the flexible space.<NEW_LINE><MASK><NEW_LINE>AbsListView.LayoutParams lp = new AbsListView.LayoutParams(AbsListView.LayoutParams.MATCH_PARENT, mFlexibleSpaceImageHeight);<NEW_LINE>paddingView.setLayoutParams(lp);<NEW_LINE>// This is required to disable header's list selector effect<NEW_LINE>paddingView.setClickable(true);<NEW_LINE>listView.addHeaderView(paddingView);<NEW_LINE>setDummyData(listView);<NEW_LINE>mTitleView = (TextView) findViewById(R.id.title);<NEW_LINE>mTitleView.setText(getTitle());<NEW_LINE>setTitle(null);<NEW_LINE>mFab = findViewById(R.id.fab);<NEW_LINE>mFab.setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>Toast.makeText(FlexibleSpaceWithImageListViewActivity.this, "FAB is clicked", Toast.LENGTH_SHORT).show();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>mFabMargin = getResources().getDimensionPixelSize(R.dimen.margin_standard);<NEW_LINE>ViewHelper.setScaleX(mFab, 0);<NEW_LINE>ViewHelper.setScaleY(mFab, 0);<NEW_LINE>// mListBackgroundView makes ListView's background except header view.<NEW_LINE>mListBackgroundView = findViewById(R.id.list_background);<NEW_LINE>} | View paddingView = new View(this); |
1,842,533 | private static void clearPreloadTypedArrayIssue(Resources resources) {<NEW_LINE>// Perform this trick not only in Miui system since we can't predict if any other<NEW_LINE>// manufacturer would do the same modification to Android.<NEW_LINE>// if (!isMiuiSystem) {<NEW_LINE>// return;<NEW_LINE>// }<NEW_LINE>ShareTinkerLog.w(TAG, "try to clear typedArray cache!");<NEW_LINE>// Clear typedArray cache.<NEW_LINE>try {<NEW_LINE>final Field typedArrayPoolField = <MASK><NEW_LINE>final Object origTypedArrayPool = typedArrayPoolField.get(resources);<NEW_LINE>final Method acquireMethod = findMethod(origTypedArrayPool, "acquire");<NEW_LINE>while (true) {<NEW_LINE>if (acquireMethod.invoke(origTypedArrayPool) == null) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Throwable ignored) {<NEW_LINE>ShareTinkerLog.e(TAG, "clearPreloadTypedArrayIssue failed, ignore error: " + ignored);<NEW_LINE>}<NEW_LINE>} | findField(Resources.class, "mTypedArrayPool"); |
1,307,608 | void positionCartAttributes(FloatRect start, FloatRect end, float x, float y, String[] attribute, float[] value) {<NEW_LINE>float startCenterX = start.centerX();<NEW_LINE>float startCenterY = start.centerY();<NEW_LINE>float endCenterX = end.centerX();<NEW_LINE>float endCenterY = end.centerY();<NEW_LINE>float pathVectorX = endCenterX - startCenterX;<NEW_LINE>float pathVectorY = endCenterY - startCenterY;<NEW_LINE>if (attribute[0] != null) {<NEW_LINE>// they are saying what to use<NEW_LINE>if (PositionType.S_PERCENT_X.equals(attribute[0])) {<NEW_LINE>value[0] = (x - startCenterX) / pathVectorX;<NEW_LINE>value[1] = (y - startCenterY) / pathVectorY;<NEW_LINE>} else {<NEW_LINE>value[1] <MASK><NEW_LINE>value[0] = (y - startCenterY) / pathVectorY;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// we will use what we want to<NEW_LINE>attribute[0] = PositionType.S_PERCENT_X;<NEW_LINE>value[0] = (x - startCenterX) / pathVectorX;<NEW_LINE>attribute[1] = PositionType.S_PERCENT_Y;<NEW_LINE>value[1] = (y - startCenterY) / pathVectorY;<NEW_LINE>}<NEW_LINE>} | = (x - startCenterX) / pathVectorX; |
483,222 | public Object finish(Object val) {<NEW_LINE>if (val == null)<NEW_LINE>return null;<NEW_LINE>if (isSame) {<NEW_LINE>if (getExp != null && val instanceof Sequence) {<NEW_LINE>Sequence seq = (Sequence) val;<NEW_LINE>ListBase1 mems = seq.getMems();<NEW_LINE>for (int i = 1, size = mems.size(); i <= size; ++i) {<NEW_LINE>Object[] tmp = (Object[<MASK><NEW_LINE>mems.set(i, tmp[1]);<NEW_LINE>}<NEW_LINE>return seq;<NEW_LINE>}<NEW_LINE>return val;<NEW_LINE>} else if (exp != null) {<NEW_LINE>MinHeap heap = (MinHeap) val;<NEW_LINE>int size = heap.size();<NEW_LINE>if (size == 0)<NEW_LINE>return null;<NEW_LINE>if (count == 1 && isOne) {<NEW_LINE>Object obj = heap.getTop();<NEW_LINE>if (getExp == null) {<NEW_LINE>return obj;<NEW_LINE>} else {<NEW_LINE>Object[] tmp = (Object[]) obj;<NEW_LINE>return tmp[1];<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>Object[] objs = heap.toArray();<NEW_LINE>Arrays.sort(objs, comparator);<NEW_LINE>if (getExp == null) {<NEW_LINE>return new Sequence(objs);<NEW_LINE>} else {<NEW_LINE>Sequence seq = new Sequence(size);<NEW_LINE>for (int i = 0; i < size; ++i) {<NEW_LINE>Object[] tmp = (Object[]) objs[i];<NEW_LINE>seq.add(tmp[1]);<NEW_LINE>}<NEW_LINE>return seq;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>List<Object> list = (List<Object>) val;<NEW_LINE>if (list.size() == 0)<NEW_LINE>return null;<NEW_LINE>if (count == 1 && isOne) {<NEW_LINE>return list.get(0);<NEW_LINE>} else {<NEW_LINE>return new Sequence(list.toArray());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ]) mems.get(i); |
808,457 | public void sendKeypadTextMessage(String displayLocation, String text) {<NEW_LINE>if (text.length() != 8) {<NEW_LINE>logger.debug("Text to be displayed on the keypad has not the correct length");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String cmd = CaddxBindingConstants.KEYPAD_SEND_KEYPAD_TEXT_MESSAGE;<NEW_LINE>String data = String.format("%d,0,%d,%d,%d,%d,%d,%d,%d,%d,%d", getKeypadAddress(), displayLocation, text.charAt(0), text.charAt(1), text.charAt(2), text.charAt(3), text.charAt(4), text.charAt(5), text.charAt(6)<MASK><NEW_LINE>CaddxBridgeHandler bridgeHandler = getCaddxBridgeHandler();<NEW_LINE>if (bridgeHandler == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>bridgeHandler.sendCommand(CaddxMessageContext.COMMAND, cmd, data);<NEW_LINE>} | , text.charAt(7)); |
661,784 | public ListSnapshotsResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListSnapshotsResult listSnapshotsResult = new ListSnapshotsResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return listSnapshotsResult;<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("NextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listSnapshotsResult.setNextToken(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Snapshots", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listSnapshotsResult.setSnapshots(new ListUnmarshaller<SnapshotSummary>(SnapshotSummaryJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return listSnapshotsResult;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
1,469,430 | private void doRemoveServer(ServerSetChangeMessage serverSetChangeMsg) {<NEW_LINE>ServerInfo newServer = serverSetChangeMsg.getServer();<NEW_LINE>_log.info("About to remove Server (" + newServer + ") from Server set. Current Server set is :" + _servers);<NEW_LINE>if (null == newServer) {<NEW_LINE>_log.error("No Server to remove");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!_servers.contains(newServer)) {<NEW_LINE>_log.warn("Trying to remove a Server that does not exist:" + newServer.toString());<NEW_LINE>} else {<NEW_LINE>_log.info("Removing Server: " + newServer.toString());<NEW_LINE>Iterator<ServerInfo<MASK><NEW_LINE>int index = 0;<NEW_LINE>for (; iter.hasNext(); ++index) {<NEW_LINE>if (newServer.equals(iter.next()))<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (index < _curServerIdx) {<NEW_LINE>_curServerIdx--;<NEW_LINE>} else if (index == _curServerIdx) {<NEW_LINE>_log.info("Trying to remove the active Server !!");<NEW_LINE>handleServerSwitch();<NEW_LINE>_curServerIdx = -1;<NEW_LINE>_curServer = null;<NEW_LINE>}<NEW_LINE>_servers.remove(newServer);<NEW_LINE>}<NEW_LINE>} | > iter = _servers.iterator(); |
1,679,290 | private void resolveDict(ResolvedTuple outputTuple, RequestedColumn requestedCol, ColumnMetadata column, int sourceIndex) {<NEW_LINE>// If the actual column isn't a dict, then the request is invalid.<NEW_LINE>if (!column.isDict()) {<NEW_LINE>throw UserException.validationError().message("Project list implies a dict column, but actual column is not a dict").addContext("Projected column:", requestedCol.fullName()).addContext("Table column:", column.name()).addContext("Type:", column.type().name()).addContext(scanProj.context()).build(logger);<NEW_LINE>}<NEW_LINE>ResolvedDictColumn dictColumn = new ResolvedDictColumn(outputTuple, column.schema(), sourceIndex);<NEW_LINE>resolveDictTuple(dictColumn.members(), requestedCol.tuple(), column.tupleSchema());<NEW_LINE>// The same as for Map<NEW_LINE>if (dictColumn.members().isSimpleProjection()) {<NEW_LINE>outputTuple.<MASK><NEW_LINE>projectTableColumn(outputTuple, requestedCol, column, sourceIndex);<NEW_LINE>} else {<NEW_LINE>outputTuple.add(dictColumn);<NEW_LINE>}<NEW_LINE>} | removeChild(dictColumn.members()); |
1,814,066 | void init(Context context, AttributeSet attrs, int defStyleAttr) {<NEW_LINE>TypedArray array = getContext().obtainStyledAttributes(attrs, R.styleable.QMUITopBar, defStyleAttr, 0);<NEW_LINE>mLeftBackDrawableRes = array.getResourceId(R.styleable.QMUITopBar_qmui_topbar_left_back_drawable_id, R.drawable.qmui_icon_topbar_back);<NEW_LINE>mLeftBackViewWidth = array.getDimensionPixelSize(R.styleable.QMUITopBar_qmui_topbar_left_back_width, -1);<NEW_LINE>mClearLeftPaddingWhenAddLeftBackView = array.getBoolean(<MASK><NEW_LINE>mTitleGravity = array.getInt(R.styleable.QMUITopBar_qmui_topbar_title_gravity, Gravity.CENTER);<NEW_LINE>mTitleTextSize = array.getDimensionPixelSize(R.styleable.QMUITopBar_qmui_topbar_title_text_size, QMUIDisplayHelper.sp2px(context, 17));<NEW_LINE>mTitleTextSizeWithSubTitle = array.getDimensionPixelSize(R.styleable.QMUITopBar_qmui_topbar_title_text_size_with_subtitle, QMUIDisplayHelper.sp2px(context, 16));<NEW_LINE>mSubTitleTextSize = array.getDimensionPixelSize(R.styleable.QMUITopBar_qmui_topbar_subtitle_text_size, QMUIDisplayHelper.sp2px(context, 11));<NEW_LINE>mTitleTextColor = array.getColor(R.styleable.QMUITopBar_qmui_topbar_title_color, QMUIResHelper.getAttrColor(context, R.attr.qmui_config_color_gray_1));<NEW_LINE>mSubTitleTextColor = array.getColor(R.styleable.QMUITopBar_qmui_topbar_subtitle_color, QMUIResHelper.getAttrColor(context, R.attr.qmui_config_color_gray_4));<NEW_LINE>mTitleMarginHorWhenNoBtnAside = array.getDimensionPixelSize(R.styleable.QMUITopBar_qmui_topbar_title_margin_horizontal_when_no_btn_aside, 0);<NEW_LINE>mTitleContainerPaddingHor = array.getDimensionPixelSize(R.styleable.QMUITopBar_qmui_topbar_title_container_padding_horizontal, 0);<NEW_LINE>mTopBarImageBtnWidth = array.getDimensionPixelSize(R.styleable.QMUITopBar_qmui_topbar_image_btn_width, QMUIDisplayHelper.dp2px(context, 48));<NEW_LINE>mTopBarImageBtnHeight = array.getDimensionPixelSize(R.styleable.QMUITopBar_qmui_topbar_image_btn_height, QMUIDisplayHelper.dp2px(context, 48));<NEW_LINE>mTopBarTextBtnPaddingHor = array.getDimensionPixelSize(R.styleable.QMUITopBar_qmui_topbar_text_btn_padding_horizontal, QMUIDisplayHelper.dp2px(context, 12));<NEW_LINE>mTopBarTextBtnTextColor = array.getColorStateList(R.styleable.QMUITopBar_qmui_topbar_text_btn_color_state_list);<NEW_LINE>mTopBarTextBtnTextSize = array.getDimensionPixelSize(R.styleable.QMUITopBar_qmui_topbar_text_btn_text_size, QMUIDisplayHelper.sp2px(context, 16));<NEW_LINE>mTitleTypeface = array.getBoolean(R.styleable.QMUITopBar_qmui_topbar_title_bold, false) ? Typeface.DEFAULT_BOLD : null;<NEW_LINE>mSubTitleTypeface = array.getBoolean(R.styleable.QMUITopBar_qmui_topbar_subtitle_bold, false) ? Typeface.DEFAULT_BOLD : null;<NEW_LINE>mTopBarTextBtnTypeface = array.getBoolean(R.styleable.QMUITopBar_qmui_topbar_text_btn_bold, false) ? Typeface.DEFAULT_BOLD : null;<NEW_LINE>int ellipsize = array.getInt(R.styleable.QMUITopBar_android_ellipsize, -1);<NEW_LINE>switch(ellipsize) {<NEW_LINE>case 1:<NEW_LINE>mEllipsize = TextUtils.TruncateAt.START;<NEW_LINE>break;<NEW_LINE>case 2:<NEW_LINE>mEllipsize = TextUtils.TruncateAt.MIDDLE;<NEW_LINE>break;<NEW_LINE>case 3:<NEW_LINE>mEllipsize = TextUtils.TruncateAt.END;<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>mEllipsize = null;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>array.recycle();<NEW_LINE>} | R.styleable.QMUITopBar_qmui_topbar_clear_left_padding_when_add_left_back_view, false); |
1,124,716 | public void run() throws Exception {<NEW_LINE>startTimeNanos = Timer.nanos();<NEW_LINE>MultiMapContainer container = getOrCreateContainer();<NEW_LINE>MultiMapValue multiMapValue = container.getOrCreateMultiMapValue(dataKey);<NEW_LINE>for (Long recordId : recordIds) {<NEW_LINE>if (!multiMapValue.containsRecordId(recordId)) {<NEW_LINE>response = false;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>response = true;<NEW_LINE>container.update();<NEW_LINE>Collection<MultiMapRecord> <MASK><NEW_LINE>removed = new LinkedList<MultiMapRecord>();<NEW_LINE>for (Long recordId : recordIds) {<NEW_LINE>Iterator<MultiMapRecord> iter = coll.iterator();<NEW_LINE>while (iter.hasNext()) {<NEW_LINE>MultiMapRecord record = iter.next();<NEW_LINE>if (record.getRecordId() == recordId) {<NEW_LINE>iter.remove();<NEW_LINE>removed.add(record);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (coll.isEmpty()) {<NEW_LINE>container.delete(dataKey);<NEW_LINE>}<NEW_LINE>} | coll = multiMapValue.getCollection(false); |
252,723 | private double adjustTransform() {<NEW_LINE>double xMin = Double.POSITIVE_INFINITY;<NEW_LINE>double xMax = Double.NEGATIVE_INFINITY;<NEW_LINE>double yMin = Double.POSITIVE_INFINITY;<NEW_LINE>double yMax = Double.NEGATIVE_INFINITY;<NEW_LINE>if (csp != null)<NEW_LINE>for (VAR var : csp.getVariables()) {<NEW_LINE>Point2D point = getPosition(var);<NEW_LINE>xMin = Math.min(xMin, point.getX());<NEW_LINE>xMax = Math.max(xMax, point.getX());<NEW_LINE>yMin = Math.min(yMin, point.getY());<NEW_LINE>yMax = Math.max(yMax, point.getY());<NEW_LINE>}<NEW_LINE>double scale = Math.min(pane.getWidth() / (xMax - xMin + 300), pane.getHeight() / (yMax - yMin + 150));<NEW_LINE>pane.setTranslateX((scale * (pane.getWidth() - xMin - xMax) / 2.0));<NEW_LINE>pane.setTranslateY((scale * (pane.getHeight() - <MASK><NEW_LINE>pane.setScaleX(scale);<NEW_LINE>pane.setScaleY(scale);<NEW_LINE>return scale;<NEW_LINE>} | yMin - yMax) / 2.0)); |
570,811 | public AuthConfig createAuthConfig() {<NEW_LINE>try {<NEW_LINE>Class<?> credentialsProviderChainClass = Class.forName("com.amazonaws.auth.DefaultAWSCredentialsProviderChain");<NEW_LINE>Object credentialsProviderChain = credentialsProviderChainClass.getDeclaredConstructor().newInstance();<NEW_LINE>Object credentials = credentialsProviderChainClass.getMethod("getCredentials").invoke(credentialsProviderChain);<NEW_LINE>if (credentials == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Class<?> sessionCredentialsClass = Class.forName("com.amazonaws.auth.AWSSessionCredentials");<NEW_LINE>String sessionToken = sessionCredentialsClass.isInstance(credentials) ? (String) sessionCredentialsClass.getMethod("getSessionToken").invoke(credentials) : null;<NEW_LINE>Class<?> credentialsClass = Class.forName("com.amazonaws.auth.AWSCredentials");<NEW_LINE>return new AuthConfig((String) credentialsClass.getMethod("getAWSAccessKeyId").invoke(credentials), (String) credentialsClass.getMethod("getAWSSecretKey").invoke(credentials), "none", sessionToken);<NEW_LINE>} catch (Throwable t) {<NEW_LINE>String issueTitle = null;<NEW_LINE>try {<NEW_LINE>issueTitle = URLEncoder.encode("Failed calling AWS SDK: " + t.getMessage(), UTF_8.name());<NEW_LINE>} catch (UnsupportedEncodingException ignore) {<NEW_LINE>}<NEW_LINE>log.warn("Failed to fetch AWS credentials: %s", t.getMessage());<NEW_LINE>if (t.getCause() != null) {<NEW_LINE>log.warn("Caused by: %s", t.getCause().getMessage());<NEW_LINE>}<NEW_LINE>log.warn("Please report a bug at https://github.com/fabric8io/docker-maven-plugin/issues/new?%s", issueTitle == <MASK><NEW_LINE>log.warn("%s", t);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} | null ? "" : "title=?" + issueTitle); |
564,204 | public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {<NEW_LINE>super.onViewCreated(view, savedInstanceState);<NEW_LINE>// noinspection ConstantConditions<NEW_LINE>mRecyclerView = getView().findViewById(R.id.recycler_view);<NEW_LINE>mLayoutManager = new LinearLayoutManager(requireContext());<NEW_LINE>final Parcelable eimSavedState = (savedInstanceState != null) ? <MASK><NEW_LINE>mRecyclerViewExpandableItemManager = new RecyclerViewExpandableItemManager(eimSavedState);<NEW_LINE>mRecyclerViewExpandableItemManager.setOnGroupExpandListener(this);<NEW_LINE>mRecyclerViewExpandableItemManager.setOnGroupCollapseListener(this);<NEW_LINE>// drag & drop manager<NEW_LINE>mRecyclerViewDragDropManager = new RecyclerViewDragDropManager();<NEW_LINE>mRecyclerViewDragDropManager.setDraggingItemShadowDrawable((NinePatchDrawable) ContextCompat.getDrawable(requireContext(), R.drawable.material_shadow_z3));<NEW_LINE>// adapter<NEW_LINE>final ExpandableDraggableWithSectionExampleAdapter myItemAdapter = new ExpandableDraggableWithSectionExampleAdapter(getDataProvider());<NEW_LINE>mAdapter = myItemAdapter;<NEW_LINE>// wrap for expanding<NEW_LINE>mWrappedAdapter = mRecyclerViewExpandableItemManager.createWrappedAdapter(myItemAdapter);<NEW_LINE>// wrap for dragging<NEW_LINE>mWrappedAdapter = mRecyclerViewDragDropManager.createWrappedAdapter(mWrappedAdapter);<NEW_LINE>mRecyclerViewDragDropManager.setCheckCanDropEnabled(ALLOW_ITEMS_MOVE_ACROSS_SECTIONS);<NEW_LINE>myItemAdapter.setAllowItemsMoveAcrossSections(ALLOW_ITEMS_MOVE_ACROSS_SECTIONS);<NEW_LINE>final GeneralItemAnimator animator = new DraggableItemAnimator();<NEW_LINE>// Change animations are enabled by default since support-v7-recyclerview v22.<NEW_LINE>// Need to disable them when using animation indicator.<NEW_LINE>animator.setSupportsChangeAnimations(false);<NEW_LINE>mRecyclerView.setLayoutManager(mLayoutManager);<NEW_LINE>// requires *wrapped* adapter<NEW_LINE>mRecyclerView.setAdapter(mWrappedAdapter);<NEW_LINE>mRecyclerView.setItemAnimator(animator);<NEW_LINE>mRecyclerView.setHasFixedSize(false);<NEW_LINE>// additional decorations<NEW_LINE>// noinspection StatementWithEmptyBody<NEW_LINE>if (supportsViewElevation()) {<NEW_LINE>// Lollipop or later has native drop shadow feature. ItemShadowDecorator is not required.<NEW_LINE>} else {<NEW_LINE>mRecyclerView.addItemDecoration(new ItemShadowDecorator((NinePatchDrawable) ContextCompat.getDrawable(requireContext(), R.drawable.material_shadow_z1)));<NEW_LINE>}<NEW_LINE>mRecyclerView.addItemDecoration(new SimpleListDividerDecorator(ContextCompat.getDrawable(requireContext(), R.drawable.list_divider_h), true));<NEW_LINE>// NOTE:<NEW_LINE>// The initialization order is very important! This order determines the priority of touch event handling.<NEW_LINE>//<NEW_LINE>// priority: DragAndDrop > ExpandableItem<NEW_LINE>mRecyclerViewDragDropManager.attachRecyclerView(mRecyclerView);<NEW_LINE>mRecyclerViewExpandableItemManager.attachRecyclerView(mRecyclerView);<NEW_LINE>} | savedInstanceState.getParcelable(SAVED_STATE_EXPANDABLE_ITEM_MANAGER) : null; |
256,925 | public void deleteById(String id) {<NEW_LINE>String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));<NEW_LINE>}<NEW_LINE>String serviceTopologyName = Utils.getValueFromIdByName(id, "serviceTopologies");<NEW_LINE>if (serviceTopologyName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'serviceTopologies'.", id)));<NEW_LINE>}<NEW_LINE>String serviceName = Utils.getValueFromIdByName(id, "services");<NEW_LINE>if (serviceName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'services'.", id)));<NEW_LINE>}<NEW_LINE>String serviceUnitName = Utils.getValueFromIdByName(id, "serviceUnits");<NEW_LINE>if (serviceUnitName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.<MASK><NEW_LINE>}<NEW_LINE>this.deleteWithResponse(resourceGroupName, serviceTopologyName, serviceName, serviceUnitName, Context.NONE).getValue();<NEW_LINE>} | format("The resource ID '%s' is not valid. Missing path segment 'serviceUnits'.", id))); |
1,403,879 | public void addTextRect(ObjectInfo[] objectstatus) {<NEW_LINE>point_lines_list.clear();<NEW_LINE>labels.clear();<NEW_LINE>if (objectstatus != null && objectstatus.length != 0) {<NEW_LINE>for (int i = 0; i < objectstatus.length; i++) {<NEW_LINE>float[] point_lines = new float[4 * 4];<NEW_LINE>point_lines[0] = objectstatus[i].key_points[0][0];<NEW_LINE>point_lines[1] = objectstatus[i].key_points[0][1];<NEW_LINE>point_lines[2] = objectstatus[i].key_points[1][0];<NEW_LINE>point_lines[3] = objectstatus[i].key_points[1][1];<NEW_LINE>point_lines[4] = objectstatus[i]<MASK><NEW_LINE>point_lines[5] = objectstatus[i].key_points[1][1];<NEW_LINE>point_lines[6] = objectstatus[i].key_points[2][0];<NEW_LINE>point_lines[7] = objectstatus[i].key_points[2][1];<NEW_LINE>point_lines[8] = objectstatus[i].key_points[2][0];<NEW_LINE>point_lines[9] = objectstatus[i].key_points[2][1];<NEW_LINE>point_lines[10] = objectstatus[i].key_points[3][0];<NEW_LINE>point_lines[11] = objectstatus[i].key_points[3][1];<NEW_LINE>point_lines[12] = objectstatus[i].key_points[3][0];<NEW_LINE>point_lines[13] = objectstatus[i].key_points[3][1];<NEW_LINE>point_lines[14] = objectstatus[i].key_points[0][0];<NEW_LINE>point_lines[15] = objectstatus[i].key_points[0][1];<NEW_LINE>point_lines_list.add(point_lines);<NEW_LINE>labels.add(String.format("%s", objectstatus[i].label));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>postInvalidate();<NEW_LINE>} | .key_points[1][0]; |
790,809 | public void stop() throws Exception {<NEW_LINE>mStopped = true;<NEW_LINE>if (mServerSocket != null) {<NEW_LINE>try {<NEW_LINE>mServerSocket.close();<NEW_LINE>} catch (IOException e) {<NEW_LINE>LOG.warn("Exception in closing server socket: {}", e.toString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>mThreadPool.shutdownNow();<NEW_LINE>// Close all client sockets so that their serving threads can stop. We shut down the threadpool<NEW_LINE>// before closing the sockets so that no new socket threads will be created after we try to<NEW_LINE>// close them all.<NEW_LINE>synchronized (mClientSockets) {<NEW_LINE>for (Socket socket : mClientSockets) {<NEW_LINE>try {<NEW_LINE>socket.close();<NEW_LINE>} catch (IOException e) {<NEW_LINE>LOG.warn("Exception in closing client socket: {}", e.toString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>boolean ret = mThreadPool.<MASK><NEW_LINE>if (ret) {<NEW_LINE>LOG.info("All worker threads have terminated.");<NEW_LINE>} else {<NEW_LINE>LOG.warn("Log server has timed out waiting for worker threads to terminate.");<NEW_LINE>}<NEW_LINE>} | awaitTermination(THREAD_KEEP_ALIVE_TIME_MS, TimeUnit.MILLISECONDS); |
1,783,674 | public void dragStart(DragSourceEvent event) {<NEW_LINE>TableRowCore[] rows = tv.getSelectedRows();<NEW_LINE>if (rows.length != 0) {<NEW_LINE>event.doit = true;<NEW_LINE>// System.out.println("DragStart");<NEW_LINE>drag_drop_location_start = getRowLocation(rows[0]);<NEW_LINE>drag_drop_rows = rows;<NEW_LINE>} else {<NEW_LINE>event.doit = false;<NEW_LINE>drag_drop_location_start = -1;<NEW_LINE>drag_drop_rows = null;<NEW_LINE>}<NEW_LINE>// Build eventData here because on OSX, selection gets cleared<NEW_LINE>// by the time dragSetData occurs<NEW_LINE>boolean onlyDMs = true;<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>Object[] <MASK><NEW_LINE>for (Object ds : selectedDataSources) {<NEW_LINE>if (ds instanceof DownloadManager) {<NEW_LINE>DownloadManager dm = (DownloadManager) ds;<NEW_LINE>TOTorrent torrent = dm.getTorrent();<NEW_LINE>if (torrent != null) {<NEW_LINE>try {<NEW_LINE>sb.append(torrent.getHashWrapper().toBase32String());<NEW_LINE>sb.append('\n');<NEW_LINE>} catch (TOTorrentException e) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (ds instanceof DiskManagerFileInfo) {<NEW_LINE>DiskManagerFileInfo fileInfo = (DiskManagerFileInfo) ds;<NEW_LINE>DownloadManager dm = fileInfo.getDownloadManager();<NEW_LINE>TOTorrent torrent = dm.getTorrent();<NEW_LINE>if (torrent != null) {<NEW_LINE>try {<NEW_LINE>sb.append(torrent.getHashWrapper().toBase32String());<NEW_LINE>sb.append(';');<NEW_LINE>sb.append(fileInfo.getIndex());<NEW_LINE>sb.append('\n');<NEW_LINE>onlyDMs = false;<NEW_LINE>} catch (TOTorrentException e) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>eventData = (onlyDMs ? "DownloadManager\n" : "DiskManagerFileInfo\n") + sb.toString();<NEW_LINE>} | selectedDataSources = tv.getSelectedDataSources(true); |
1,066,874 | public ArmatureDebugger addArmatureFrom(Armature armature, Spatial forSpatial) {<NEW_LINE>ArmatureDebugger ad = armatures.get(armature);<NEW_LINE>if (ad != null) {<NEW_LINE>return ad;<NEW_LINE>}<NEW_LINE>JointInfoVisitor visitor = new JointInfoVisitor(armature);<NEW_LINE>forSpatial.depthFirstTraversal(visitor);<NEW_LINE>ad = new ArmatureDebugger(forSpatial.getName() + <MASK><NEW_LINE>ad.setLocalTransform(forSpatial.getWorldTransform());<NEW_LINE>if (forSpatial instanceof Node) {<NEW_LINE>List<Geometry> geoms = new ArrayList<>();<NEW_LINE>findGeoms((Node) forSpatial, geoms);<NEW_LINE>if (geoms.size() == 1) {<NEW_LINE>ad.setLocalTransform(geoms.get(0).getWorldTransform());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>armatures.put(armature, ad);<NEW_LINE>debugNode.attachChild(ad);<NEW_LINE>if (isInitialized()) {<NEW_LINE>ad.initialize(app.getAssetManager(), app.getCamera());<NEW_LINE>}<NEW_LINE>return ad;<NEW_LINE>} | "_Armature", armature, visitor.deformingJoints); |
1,066,454 | public final void fileType() throws RecognitionException, TokenStreamException {<NEW_LINE>returnAST = null;<NEW_LINE>ASTPair currentAST = new ASTPair();<NEW_LINE>PascalAST fileType_AST = null;<NEW_LINE>if ((LA(1) == FILE) && (LA(2) == OF)) {<NEW_LINE>PascalAST tmp69_AST = null;<NEW_LINE>tmp69_AST = (PascalAST) astFactory.create(LT(1));<NEW_LINE>astFactory.makeASTRoot(currentAST, tmp69_AST);<NEW_LINE>match(FILE);<NEW_LINE>match(OF);<NEW_LINE>type();<NEW_LINE>astFactory.addASTChild(currentAST, returnAST);<NEW_LINE>fileType_AST = (PascalAST) currentAST.root;<NEW_LINE>} else if ((LA(1) == FILE) && (_tokenSet_4.member(LA(2)))) {<NEW_LINE>PascalAST tmp71_AST = null;<NEW_LINE>tmp71_AST = (PascalAST) astFactory.create(LT(1));<NEW_LINE>astFactory.addASTChild(currentAST, tmp71_AST);<NEW_LINE>match(FILE);<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>throw new NoViableAltException(LT(1), getFilename());<NEW_LINE>}<NEW_LINE>returnAST = fileType_AST;<NEW_LINE>} | fileType_AST = (PascalAST) currentAST.root; |
607,182 | // --------- Tick Handling<NEW_LINE>@Override<NEW_LINE>public void tickEnd(@Nullable Profiler profiler) {<NEW_LINE>Prof.start(profiler, "EnergyTransmitting");<NEW_LINE>transmitEnergy();<NEW_LINE>if (energyStored != prevEnergyStored) {<NEW_LINE>Prof.next(profiler, "EnergyBalancing");<NEW_LINE>distributeEnergyToBanks();<NEW_LINE>}<NEW_LINE>Prof.next(profiler, "EnergyTracking");<NEW_LINE>powerTrackerIn.tick(energyReceived);<NEW_LINE>powerTrackerOut.tick(energySend);<NEW_LINE>prevEnergyStored = energyStored;<NEW_LINE>energyReceived = 0;<NEW_LINE>energySend = 0;<NEW_LINE>Prof.stop(profiler);<NEW_LINE>if (firstUpate) {<NEW_LINE>if (!capBanks.isEmpty()) {<NEW_LINE>PacketHandler.sendToAllAround(new PacketNetworkStateResponse(this)<MASK><NEW_LINE>PacketHandler.sendToAllAround(new PacketNetworkEnergyResponse(this), capBanks.get(0));<NEW_LINE>}<NEW_LINE>firstUpate = false;<NEW_LINE>}<NEW_LINE>} | , capBanks.get(0)); |
212,126 | public DataType toDataType() throws DuplicateNameException, IOException {<NEW_LINE>String name = "objc_category";<NEW_LINE>StructureDataType struct = new StructureDataType(name, 0);<NEW_LINE>struct.setCategoryPath(ObjectiveC1_Constants.CATEGORY_PATH);<NEW_LINE>struct.add(PointerDataType.getPointer(ASCII, _state<MASK><NEW_LINE>struct.add(PointerDataType.getPointer(ASCII, _state.pointerSize), "class_name", null);<NEW_LINE>struct.add(PointerDataType.getPointer(ObjectiveC1_MethodList.toGenericDataType(_state), _state.pointerSize), "instance_methods", null);<NEW_LINE>struct.add(PointerDataType.getPointer(ObjectiveC1_MethodList.toGenericDataType(_state), _state.pointerSize), "class_methods", null);<NEW_LINE>struct.add(PointerDataType.getPointer(ObjectiveC1_ProtocolList.toGenericDataType(_state), _state.pointerSize), "protocols", null);<NEW_LINE>if (_state.isARM) {<NEW_LINE>struct.add(DWORD, "unknown0", null);<NEW_LINE>struct.add(DWORD, "unknown1", null);<NEW_LINE>}<NEW_LINE>return struct;<NEW_LINE>} | .pointerSize), "category_name", null); |
1,046,785 | public void updateUiElements() {<NEW_LINE>super.updateUiElements();<NEW_LINE>toolbar.setBackgroundColor(getPrimaryColor());<NEW_LINE>setStatusBarColor();<NEW_LINE>setNavBarColor();<NEW_LINE>setRecentApp(getString(org.horaapps.leafpic.R.string.donate));<NEW_LINE>themeSeekBar(bar);<NEW_LINE>themeButton(btnDonateIap);<NEW_LINE>themeButton(btnDonatePP);<NEW_LINE>((TextView) findViewById(org.horaapps.leafpic.R.id.team_name)).setTextColor(getAccentColor());<NEW_LINE>((TextView) findViewById(org.horaapps.leafpic.R.id.donate_googleplay_item_title)).setTextColor(getAccentColor());<NEW_LINE>((TextView) findViewById(org.horaapps.leafpic.R.id.donate_paypal_item_title)).setTextColor(getAccentColor());<NEW_LINE>((TextView) findViewById(org.horaapps.leafpic.R.id.donate_bitcoin_item_title)).setTextColor(getAccentColor());<NEW_LINE>findViewById(org.horaapps.leafpic.R.id.donate_background).setBackgroundColor(getBackgroundColor());<NEW_LINE>int color = getCardBackgroundColor();<NEW_LINE>((CardView) findViewById(org.horaapps.leafpic.R.id.donate_googleplay_card)).setCardBackgroundColor(color);<NEW_LINE>((CardView) findViewById(org.horaapps.leafpic.R.id.donate_paypal_card)).setCardBackgroundColor(color);<NEW_LINE>((CardView) findViewById(org.horaapps.leafpic.R.id.donate_bitcoin_card)).setCardBackgroundColor(color);<NEW_LINE>((CardView) findViewById(org.horaapps.leafpic.R.id.donate_header_card)).setCardBackgroundColor(color);<NEW_LINE>color = getIconColor();<NEW_LINE>((ThemedIcon) findViewById(org.horaapps.leafpic.R.id.donate_googleplay_icon_title)).setColor(color);<NEW_LINE>((ThemedIcon) findViewById(org.horaapps.leafpic.R.id.<MASK><NEW_LINE>((ThemedIcon) findViewById(org.horaapps.leafpic.R.id.donate_bitcoin_icon_title)).setColor(color);<NEW_LINE>((ThemedIcon) findViewById(org.horaapps.leafpic.R.id.donate_header_icon)).setColor(color);<NEW_LINE>color = getTextColor();<NEW_LINE>((TextView) findViewById(org.horaapps.leafpic.R.id.donate_googleplay_item)).setTextColor(color);<NEW_LINE>((TextView) findViewById(org.horaapps.leafpic.R.id.donate_paypal_item)).setTextColor(color);<NEW_LINE>((TextView) findViewById(org.horaapps.leafpic.R.id.donate_bitcoin_item)).setTextColor(color);<NEW_LINE>((TextView) findViewById(org.horaapps.leafpic.R.id.donate_header_item)).setTextColor(color);<NEW_LINE>setScrollViewColor(scr);<NEW_LINE>} | donate_paypal_icon_title)).setColor(color); |
621,749 | public int smallestFactorization(int a) {<NEW_LINE>// case 1: a < 10<NEW_LINE>if (a < 10) {<NEW_LINE>return a;<NEW_LINE>}<NEW_LINE>// case 2: start with 9 and try every possible digit<NEW_LINE>List<Integer> <MASK><NEW_LINE>for (int i = 9; i > 1; i--) {<NEW_LINE>// if current digit divides a, then store all occurences of current digit in res<NEW_LINE>while (a % i == 0) {<NEW_LINE>a = a / i;<NEW_LINE>resultArray.add(i);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// if a could not be broken in form of digits, return 0<NEW_LINE>if (a != 0) {<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>// get the result from the result array in reverse order<NEW_LINE>long result = 0;<NEW_LINE>for (int i = resultArray.size() - 1; i >= 0; i--) {<NEW_LINE>result = result * 10 + resultArray.get(i);<NEW_LINE>if (result > Integer.MAX_VALUE) {<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return (int) result;<NEW_LINE>} | resultArray = new ArrayList<>(); |
1,529,054 | final EnableResult executeEnable(EnableRequest enableRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(enableRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<EnableRequest> request = null;<NEW_LINE>Response<EnableResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new EnableRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(enableRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Inspector2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "Enable");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<EnableResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new EnableResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint); |
1,598,423 | public Table melt(List<String> idVariables, List<NumericColumn<?>> measuredVariables, Boolean dropMissing) {<NEW_LINE>Table result = Table.create(name);<NEW_LINE>for (String idColName : idVariables) {<NEW_LINE>result.addColumns(column(idColName).type().create(idColName));<NEW_LINE>}<NEW_LINE>result.addColumns(StringColumn.create(MELT_VARIABLE_COLUMN_NAME)<MASK><NEW_LINE>List<String> measureColumnNames = measuredVariables.stream().map(Column::name).collect(Collectors.toList());<NEW_LINE>TableSliceGroup slices = splitOn(idVariables.toArray(new String[0]));<NEW_LINE>for (TableSlice slice : slices) {<NEW_LINE>for (Row row : slice) {<NEW_LINE>for (String colName : measureColumnNames) {<NEW_LINE>if (!dropMissing || !row.isMissing(colName)) {<NEW_LINE>writeIdVariables(idVariables, result, row);<NEW_LINE>result.stringColumn(MELT_VARIABLE_COLUMN_NAME).append(colName);<NEW_LINE>double value = row.getNumber(colName);<NEW_LINE>result.doubleColumn(MELT_VALUE_COLUMN_NAME).append(value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | , DoubleColumn.create(MELT_VALUE_COLUMN_NAME)); |
579,538 | private Value convertToRow(TypeInfo targetType, CastDataProvider provider, int conversionMode, Object column) {<NEW_LINE>ValueRow v;<NEW_LINE>if (getValueType() == ROW) {<NEW_LINE>v = (ValueRow) this;<NEW_LINE>} else {<NEW_LINE>v = ValueRow.get(new Value[] { this });<NEW_LINE>}<NEW_LINE>ExtTypeInfoRow ext = (ExtTypeInfoRow) targetType.getExtTypeInfo();<NEW_LINE>if (ext != null) {<NEW_LINE>Value[] values = v.getList();<NEW_LINE>int length = values.length;<NEW_LINE>Set<Map.Entry<String, TypeInfo>> fields = ext.getFields();<NEW_LINE>if (length != fields.size()) {<NEW_LINE>throw getDataConversionError(targetType);<NEW_LINE>}<NEW_LINE>Iterator<Map.Entry<String, TypeInfo>> iter = fields.iterator();<NEW_LINE>loop: for (int i = 0; i < length; i++) {<NEW_LINE>Value v1 = values[i];<NEW_LINE>TypeInfo componentType = iter.next().getValue();<NEW_LINE>Value v2 = v1.convertTo(componentType, provider, conversionMode, column);<NEW_LINE>if (v1 != v2) {<NEW_LINE>Value[<MASK><NEW_LINE>System.arraycopy(values, 0, newValues, 0, i);<NEW_LINE>newValues[i] = v2;<NEW_LINE>while (++i < length) {<NEW_LINE>newValues[i] = values[i].convertTo(componentType, provider, conversionMode, column);<NEW_LINE>}<NEW_LINE>v = ValueRow.get(targetType, newValues);<NEW_LINE>break loop;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return v;<NEW_LINE>} | ] newValues = new Value[length]; |
1,314,242 | public BExpressionValue evaluate() throws EvaluationException {<NEW_LINE>// The result of a range-expr is a new object belonging to the object type Iterable<int,()> that will iterate<NEW_LINE>// over a sequence of integers in increasing order, where the sequence includes all integers<NEW_LINE>// that are less than / less than or equal to the value of the second expression.<NEW_LINE>try {<NEW_LINE>BExpressionValue lhsResult = lhsEvaluator.evaluate();<NEW_LINE>BExpressionValue rhsResult = rhsEvaluator.evaluate();<NEW_LINE>BVariable lVar = VariableFactory.getVariable(context, lhsResult.getJdiValue());<NEW_LINE>BVariable rVar = VariableFactory.getVariable(<MASK><NEW_LINE>SyntaxKind operatorType = syntaxNode.operator().kind();<NEW_LINE>// Determines the range (whether the end value should be exclusive), based on the operator type.<NEW_LINE>boolean excludeEndValue = operatorType == SyntaxKind.DOUBLE_DOT_LT_TOKEN;<NEW_LINE>Value excludeEndValueMirror = VMUtils.make(context, excludeEndValue).getJdiValue();<NEW_LINE>List<Value> argList = new ArrayList<>();<NEW_LINE>argList.add(getValueAsObject(context, lVar));<NEW_LINE>argList.add(getValueAsObject(context, rVar));<NEW_LINE>argList.add(getValueAsObject(context, excludeEndValueMirror));<NEW_LINE>GeneratedStaticMethod createIntRangeMethod = getGeneratedMethod(context, B_RANGE_EXPR_HELPER_CLASS, CREATE_INT_RANGE_METHOD);<NEW_LINE>createIntRangeMethod.setArgValues(argList);<NEW_LINE>return new BExpressionValue(context, createIntRangeMethod.invokeSafely());<NEW_LINE>} catch (EvaluationException e) {<NEW_LINE>throw e;<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw createEvaluationException(INTERNAL_ERROR, syntaxNode.toSourceCode().trim());<NEW_LINE>}<NEW_LINE>} | context, rhsResult.getJdiValue()); |
1,638,806 | void toHtml() throws IOException {<NEW_LINE>writeJCaches(jcacheInformationsList);<NEW_LINE>write("<div align='right' class='noPrint'>");<NEW_LINE>if (!hitsRatioEnabled) {<NEW_LINE>writeln("#jcaches_statistics_enable#<br/>");<NEW_LINE>}<NEW_LINE>if (clearEnabled && systemActionsEnabled) {<NEW_LINE>writeln("<a href='?action=clear_jcaches" + getCsrfTokenUrlPart() + "' class='confirm' data-confirm='" + htmlEncodeButNotSpaceAndNewLine(<MASK><NEW_LINE>writeln("<img src='?resource=user-trash.png' width='18' height='18' alt=\"#Purge_caches#\" /> #Purge_caches#</a>");<NEW_LINE>writeln(" ");<NEW_LINE>}<NEW_LINE>writeln("</div>");<NEW_LINE>} | getString("confirm_purge_caches")) + "'>"); |
1,725,019 | public void addPersistentProperty(ElasticsearchPersistentProperty property) {<NEW_LINE>super.addPersistentProperty(property);<NEW_LINE>if (property.isSeqNoPrimaryTermProperty()) {<NEW_LINE>ElasticsearchPersistentProperty seqNoPrimaryTermProperty = this.seqNoPrimaryTermProperty;<NEW_LINE>if (seqNoPrimaryTermProperty != null) {<NEW_LINE>throw new MappingException(String.format("Attempt to add SeqNoPrimaryTerm property %s but already have property %s registered " + "as SeqNoPrimaryTerm property. Check your entity configuration!", property.getField(), seqNoPrimaryTermProperty.getField()));<NEW_LINE>}<NEW_LINE>this.seqNoPrimaryTermProperty = property;<NEW_LINE>if (hasVersionProperty()) {<NEW_LINE>warnAboutBothSeqNoPrimaryTermAndVersionProperties();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (property.isVersionProperty()) {<NEW_LINE>if (hasSeqNoPrimaryTermProperty()) {<NEW_LINE>warnAboutBothSeqNoPrimaryTermAndVersionProperties();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Class<?<MASK><NEW_LINE>if (actualType == JoinField.class) {<NEW_LINE>ElasticsearchPersistentProperty joinProperty = this.joinFieldProperty;<NEW_LINE>if (joinProperty != null) {<NEW_LINE>throw new MappingException(String.format("Attempt to add Join property %s but already have property %s registered " + "as Join property. Check your entity configuration!", property.getField(), joinProperty.getField()));<NEW_LINE>}<NEW_LINE>this.joinFieldProperty = property;<NEW_LINE>}<NEW_LINE>} | > actualType = property.getActualTypeOrNull(); |
153,325 | private SecurityConfiguration createSecurityConfiguration(EndpointDescription endpoint, ByteString clientCertificateBytes) throws UaException {<NEW_LINE>SecurityPolicy securityPolicy = SecurityPolicy.fromUri(endpoint.getSecurityPolicyUri());<NEW_LINE>MessageSecurityMode securityMode = endpoint.getSecurityMode();<NEW_LINE>X509Certificate clientCertificate = null;<NEW_LINE>List<X509Certificate> clientCertificateChain = null;<NEW_LINE>KeyPair keyPair = null;<NEW_LINE>X509Certificate serverCertificate = null;<NEW_LINE>List<X509Certificate> serverCertificateChain = null;<NEW_LINE>if (securityPolicy != SecurityPolicy.None) {<NEW_LINE>clientCertificate = CertificateUtil.decodeCertificate(clientCertificateBytes.bytes());<NEW_LINE>clientCertificateChain = CertificateUtil.decodeCertificates(clientCertificateBytes.bytes());<NEW_LINE>ByteString thumbprint = ByteString.of(sha1(endpoint.getServerCertificate().bytesOrEmpty()));<NEW_LINE>keyPair = server.getConfig().getCertificateManager().getKeyPair(thumbprint).orElseThrow(() -> new UaException(StatusCodes.Bad_ConfigurationError));<NEW_LINE>serverCertificate = server.getConfig().getCertificateManager().getCertificate(thumbprint).orElseThrow(() -> <MASK><NEW_LINE>serverCertificateChain = server.getConfig().getCertificateManager().getCertificateChain(thumbprint).map(Lists::newArrayList).orElseThrow(() -> new UaException(StatusCodes.Bad_ConfigurationError));<NEW_LINE>}<NEW_LINE>return new SecurityConfiguration(securityPolicy, securityMode, keyPair, serverCertificate, serverCertificateChain, clientCertificate, clientCertificateChain);<NEW_LINE>} | new UaException(StatusCodes.Bad_ConfigurationError)); |
1,835,902 | private IV<BigdataURI, ?> createInlineURIIV(final URI value) {<NEW_LINE>// deprecated in favor of the extensible InlineURIFactory mechanism<NEW_LINE>// try {<NEW_LINE>//<NEW_LINE>// final String s = value.stringValue();<NEW_LINE>//<NEW_LINE>// if (s.startsWith("ip:")) {<NEW_LINE>// return new IPAddrIV(s.substring(3));<NEW_LINE>// }<NEW_LINE>//<NEW_LINE>// } catch (UnknownHostException ex) {<NEW_LINE>//<NEW_LINE>// log.warn("unknown host exception, will not inline: " + value);<NEW_LINE>//<NEW_LINE>// }<NEW_LINE>@SuppressWarnings("rawtypes")<NEW_LINE>final URIExtensionIV inline = uriFactory.createInlineURIIV(value);<NEW_LINE>if (inline != null) {<NEW_LINE>return inline;<NEW_LINE>}<NEW_LINE>if (maxInlineTextLength == 0) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (value.stringValue().length() <= maxInlineTextLength) {<NEW_LINE>return new FullyInlineURIIV<BigdataURI>(value);<NEW_LINE>}<NEW_LINE>final String localName = ((URI) value).getLocalName();<NEW_LINE>if (localName.length() < maxInlineTextLength) {<NEW_LINE>final String namespace = ((URI) value).getNamespace();<NEW_LINE>final IV<BigdataURI, ?> namespaceIV = vocab.get(new URIImpl(namespace));<NEW_LINE>if (namespaceIV != null) {<NEW_LINE>final FullyInlineTypedLiteralIV<BigdataLiteral> localNameIV = new FullyInlineTypedLiteralIV<BigdataLiteral>(localName);<NEW_LINE>return new URIExtensionIV<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>// URI was not inlined.<NEW_LINE>return null;<NEW_LINE>} | <BigdataURI>(localNameIV, namespaceIV); |
1,399,559 | private void generateSettings(String mvnProjectName, Set<MavenProject> projects) {<NEW_LINE>BuildScriptBuilder scriptBuilder = scriptBuilderFactory.scriptForMavenConversion(dsl, "settings", useIncubatingAPIs, insecureProtocolOption);<NEW_LINE>scriptBuilder.<MASK><NEW_LINE>Set<MavenProject> modules = modules(projects, true);<NEW_LINE>List<String> moduleNames = new ArrayList<>();<NEW_LINE>Map<String, String> artifactIdToDir = new LinkedHashMap<>();<NEW_LINE>for (MavenProject project : modules) {<NEW_LINE>String fqn = fqn(project, projects);<NEW_LINE>File projectDirectory = projectDir(project);<NEW_LINE>// don't add project if it's the rootproject<NEW_LINE>if (!workingDir.getAsFile().equals(projectDirectory)) {<NEW_LINE>moduleNames.add(fqn);<NEW_LINE>// Calculate the path to the project, ignore this path if it's the default value<NEW_LINE>String relativePath = RelativePathUtil.relativePath(workingDir.getAsFile(), projectDirectory);<NEW_LINE>if (!fqn.equals(":" + relativePath)) {<NEW_LINE>artifactIdToDir.put(fqn, relativePath);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (String name : moduleNames) {<NEW_LINE>scriptBuilder.methodInvocation(null, "include", name);<NEW_LINE>}<NEW_LINE>for (Map.Entry<String, String> entry : artifactIdToDir.entrySet()) {<NEW_LINE>BuildScriptBuilder.Expression dirExpression = scriptBuilder.methodInvocationExpression("file", entry.getValue());<NEW_LINE>scriptBuilder.propertyAssignment(null, "project(\"" + entry.getKey() + "\").projectDir", dirExpression);<NEW_LINE>}<NEW_LINE>scriptBuilder.create(workingDir).generate();<NEW_LINE>} | propertyAssignment(null, "rootProject.name", mvnProjectName); |
945,848 | public void makeSortKey(byte[] result, int len) {<NEW_LINE>if (getCharsetHandler().getName() == CharsetName.BINARY) {<NEW_LINE>// Store length last in high-byte order to sort longer strings first<NEW_LINE>if (startPos() == 1) {<NEW_LINE>result[len <MASK><NEW_LINE>} else {<NEW_LINE>result[len - 2] = (byte) (varLength >> 8);<NEW_LINE>result[len - 1] = (byte) varLength;<NEW_LINE>}<NEW_LINE>len -= startPos();<NEW_LINE>}<NEW_LINE>// get slice to cal sort key.<NEW_LINE>Slice original = Slices.wrappedBuffer(packedBinary, startPos(), varLength);<NEW_LINE>CollationHandler collationHandler = getCollationHandler();<NEW_LINE>SortKey sortKey = collationHandler.getSortKey(original, len);<NEW_LINE>// copy from sort key bytes<NEW_LINE>System.arraycopy(sortKey.keys, 0, result, 0, Math.min(len, sortKey.keys.length));<NEW_LINE>} | - 1] = (byte) varLength; |
822,698 | public Object visitPlus(Object context1, AdditiveExpression expr, boolean strict) {<NEW_LINE>ExecutionContext context = (ExecutionContext) context1;<NEW_LINE>Object lhs = Types.toPrimitive(context, getValue(context, expr.getLhs().accept(context, this, strict)));<NEW_LINE>Object rhs = Types.toPrimitive(context, getValue(context, expr.getRhs().accept(context, this, strict)));<NEW_LINE>if (lhs instanceof String || rhs instanceof String) {<NEW_LINE>return (Types.toString(context, lhs) + Types.toString(context, rhs));<NEW_LINE>}<NEW_LINE>Number lhsNum = Types.toNumber(context, lhs);<NEW_LINE>Number rhsNum = <MASK><NEW_LINE>if (Double.isNaN(lhsNum.doubleValue()) || Double.isNaN(rhsNum.doubleValue())) {<NEW_LINE>return (Double.NaN);<NEW_LINE>}<NEW_LINE>if (lhsNum instanceof Double || rhsNum instanceof Double) {<NEW_LINE>if (lhsNum.doubleValue() == 0.0 && rhsNum.doubleValue() == 0.0) {<NEW_LINE>if (Double.compare(lhsNum.doubleValue(), 0.0) < 0 && Double.compare(rhsNum.doubleValue(), 0.0) < 0) {<NEW_LINE>return (-0.0);<NEW_LINE>} else {<NEW_LINE>return (0.0);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return (lhsNum.doubleValue() + rhsNum.doubleValue());<NEW_LINE>}<NEW_LINE>return (lhsNum.longValue() + rhsNum.longValue());<NEW_LINE>} | Types.toNumber(context, rhs); |
1,583,494 | public static ValidatePattern fromPattern(String pattern) {<NEW_LINE>if (pattern == null) {<NEW_LINE>throw new FlywayException("Null pattern not allowed.");<NEW_LINE>}<NEW_LINE>String[] patternParts = pattern.split(":");<NEW_LINE>if (patternParts.length != 2) {<NEW_LINE>throw new FlywayException("Invalid pattern '" + pattern + "'. Pattern must be of the form <migration_type>:<migration_state> " + "See " + FlywayDbWebsiteLinks.IGNORE_MIGRATION_PATTERNS + " for full details");<NEW_LINE>}<NEW_LINE>String migrationType = patternParts[0].trim().toLowerCase();<NEW_LINE>String migrationState = patternParts[1].trim().toLowerCase();<NEW_LINE>if (migrationType.equals("repeatable") || migrationType.equals("versioned")) {<NEW_LINE>throw new FlywayTeamsUpgradeRequiredException("ignoreMigrationPattern with type '" + migrationType + "'");<NEW_LINE>}<NEW_LINE>if (!validMigrationTypes.contains(migrationType)) {<NEW_LINE>throw new FlywayException("Invalid migration type '" + patternParts[0] + "'. Valid types are: " + validMigrationTypes);<NEW_LINE>}<NEW_LINE>if (!validMigrationStates.contains(migrationState)) {<NEW_LINE>throw new FlywayException("Invalid migration state '" + patternParts[1] + "'. Valid states are: " + validMigrationStates);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>} | return new ValidatePattern(migrationType, migrationState); |
1,079,964 | public long tensorsAlongDimension(int... dimension) {<NEW_LINE>if (dimension == null || dimension.length == 0)<NEW_LINE>throw new IllegalArgumentException("Invalid input: dimensions not specified (null or length 0)");<NEW_LINE>if (dimension.length >= rank() || dimension.length == 1 && dimension[0] == Integer.MAX_VALUE)<NEW_LINE>return 1;<NEW_LINE>for (int i = 0; i < dimension.length; i++) if (dimension[i] < 0)<NEW_LINE>dimension[i] += rank();<NEW_LINE>long[] tensorShape = ArrayUtil.keep(shape(), dimension);<NEW_LINE>long <MASK><NEW_LINE>if (len == 0)<NEW_LINE>throw new IllegalStateException("Illegal length found after removing index");<NEW_LINE>long length = length();<NEW_LINE>if (length / len >= Integer.MAX_VALUE)<NEW_LINE>throw new IllegalArgumentException("Tensors along dimension can not be >= Integer.MAX_VALUE");<NEW_LINE>return length / len;<NEW_LINE>} | len = ArrayUtil.prodLong(tensorShape); |
1,307,820 | private CurrencyParameterSensitivity parameterSensitivity(FxOptionSensitivity point) {<NEW_LINE>double expiryTime = point.getExpiry();<NEW_LINE>double strike = currencyPair.isInverse(point.getCurrencyPair()) ? 1d / point.getStrike() : point.getStrike();<NEW_LINE>double forward = currencyPair.isInverse(point.getCurrencyPair()) ? 1d / point.getForward() : point.getForward();<NEW_LINE><MASK><NEW_LINE>DoubleMatrix bucketedSensi = smile.volatilityAndSensitivities(expiryTime, strike, forward).getSensitivities();<NEW_LINE>DoubleArray smileExpiries = smile.getExpiries();<NEW_LINE>List<Optional<Tenor>> smileExpiryTenors = smile.getExpiryTenors();<NEW_LINE>int nTimes = smileExpiries.size();<NEW_LINE>List<Double> sensiList = new ArrayList<>();<NEW_LINE>List<ParameterMetadata> paramList = new ArrayList<>();<NEW_LINE>DoubleArray deltas = smile.getDelta();<NEW_LINE>int nDeltas = deltas.size();<NEW_LINE>// convert sensitivity<NEW_LINE>for (int i = 0; i < nTimes; ++i) {<NEW_LINE>double smileExpiry = smileExpiries.get(i);<NEW_LINE>Optional<Tenor> tenorOpt = smileExpiryTenors.get(i);<NEW_LINE>// calculate absolute delta<NEW_LINE>int nDeltasTotal = 2 * nDeltas + 1;<NEW_LINE>double[] deltasTotal = new double[nDeltasTotal];<NEW_LINE>deltasTotal[nDeltas] = 0.5d;<NEW_LINE>for (int j = 0; j < nDeltas; ++j) {<NEW_LINE>deltasTotal[j] = 1d - deltas.get(j);<NEW_LINE>deltasTotal[2 * nDeltas - j] = deltas.get(j);<NEW_LINE>}<NEW_LINE>// convert sensitivities<NEW_LINE>for (int j = 0; j < nDeltasTotal; ++j) {<NEW_LINE>sensiList.add(bucketedSensi.get(i, j) * pointValue);<NEW_LINE>DeltaStrike absoluteDelta = DeltaStrike.of(deltasTotal[j]);<NEW_LINE>ParameterMetadata parameterMetadata = tenorOpt.map(tenor -> FxVolatilitySurfaceYearFractionParameterMetadata.of(smileExpiry, tenor, absoluteDelta, currencyPair)).orElseGet(() -> FxVolatilitySurfaceYearFractionParameterMetadata.of(smileExpiry, absoluteDelta, currencyPair));<NEW_LINE>paramList.add(parameterMetadata);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return CurrencyParameterSensitivity.of(name, paramList, point.getCurrency(), DoubleArray.copyOf(sensiList));<NEW_LINE>} | double pointValue = point.getSensitivity(); |
789,139 | public void actionPerformed(ActionEvent e) {<NEW_LINE>if (noproxy.isSelected()) {<NEW_LINE><MASK><NEW_LINE>} else if (systemProxy.isSelected()) {<NEW_LINE>pref.putInt("proxySel", 2);<NEW_LINE>} else if (manual.isSelected()) {<NEW_LINE>pref.putInt("proxySel", 3);<NEW_LINE>pref.put("proxySel-http", http.getText());<NEW_LINE>pref.put("proxySel-port", port.getText());<NEW_LINE>}<NEW_LINE>proxy.dispose();<NEW_LINE>if (netMonitor != null) {<NEW_LINE>netMonitor.dispose();<NEW_LINE>netMonitor = null;<NEW_LINE>}<NEW_LINE>if (perfMonitor != null) {<NEW_LINE>perfMonitor.dispose();<NEW_LINE>perfMonitor = null;<NEW_LINE>}<NEW_LINE>String mainClass = System.getProperty("MainClass");<NEW_LINE>if (mainClass != null) {<NEW_LINE>Preferences pref = Preferences.userNodeForPackage(JavaSEPort.class);<NEW_LINE>deinitializeSync();<NEW_LINE>frm.dispose();<NEW_LINE>System.setProperty("reload.simulator", "true");<NEW_LINE>} else {<NEW_LINE>refreshSkin(frm);<NEW_LINE>}<NEW_LINE>} | pref.putInt("proxySel", 1); |
878,486 | private static void encodeType(Class<?> type, StringBuilder buf) {<NEW_LINE>String desc;<NEW_LINE>if (type == boolean.class) {<NEW_LINE>desc = "Z";<NEW_LINE>} else if (type == byte.class) {<NEW_LINE>desc = "B";<NEW_LINE>} else if (type == char.class) {<NEW_LINE>desc = "C";<NEW_LINE>} else if (type == short.class) {<NEW_LINE>desc = "S";<NEW_LINE>} else if (type == int.class) {<NEW_LINE>desc = "I";<NEW_LINE>} else if (type == long.class) {<NEW_LINE>desc = "J";<NEW_LINE>} else if (type == float.class) {<NEW_LINE>desc = "F";<NEW_LINE>} else if (type == double.class) {<NEW_LINE>desc = "D";<NEW_LINE>} else if (type == void.class) {<NEW_LINE>desc = "V";<NEW_LINE>} else if (type.isArray()) {<NEW_LINE>buf.append('[');<NEW_LINE>encodeType(<MASK><NEW_LINE>return;<NEW_LINE>} else {<NEW_LINE>desc = "L" + type.getName().replace('.', '/') + ";";<NEW_LINE>}<NEW_LINE>buf.append(desc);<NEW_LINE>} | type.getComponentType(), buf); |
1,826,379 | // Basic test using JAX-RS client submit with an invocation callback, which checks that the<NEW_LINE>// callback runs without access to the java:comp namespace of the servlet because it is<NEW_LINE>// running on a plain Liberty executor thread (as opposed to a ManagedExecutorService thread).<NEW_LINE>@Test<NEW_LINE>public void testClientBuilderSubmitInvocationCallback(HttpServletRequest request, HttpServletResponse response) throws Exception {<NEW_LINE>String uri = "http://" + request.getServerName() + ":" + request.getServerPort() + "/jaxrsapp/testapp/test/info";<NEW_LINE>assertNotNull(new InitialContext().lookup("java:comp/env/concurrent/scheduledExecutorRef"));<NEW_LINE>ClientBuilder clientBuilder = ClientBuilder.newBuilder();<NEW_LINE>Client client = clientBuilder.build();<NEW_LINE>final ConcurrentLinkedQueue<Object> result = new ConcurrentLinkedQueue<Object>();<NEW_LINE>Future<String> f = client.target(uri).request("text/plain").buildGet().submit(new InvocationCallback<String>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void completed(String response) {<NEW_LINE>result.add(response);<NEW_LINE>result.add(Thread.currentThread().getName());<NEW_LINE>try {<NEW_LINE>result.add(new InitialContext().lookup("java:comp/env/concurrent/scheduledExecutorRef"));<NEW_LINE>} catch (NamingException x) {<NEW_LINE>// expected because java:comp should be unavailable on callback thread<NEW_LINE>result.add(x);<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void failed(Throwable x) {<NEW_LINE>result.add(x);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>assertEquals("test123", f.get(TIMEOUT_NS, TimeUnit.NANOSECONDS));<NEW_LINE>client.close();<NEW_LINE>Object r = result.poll();<NEW_LINE>assertNotNull(r);<NEW_LINE>if (r instanceof Throwable)<NEW_LINE>throw new Exception("InvocationCallback received failure. See cause.", (Throwable) r);<NEW_LINE>assertEquals("test123", r);<NEW_LINE>assertNotNull(r = result.poll());<NEW_LINE>String callbackThreadName = (String) r;<NEW_LINE>assertTrue(callbackThreadName, callbackThreadName.startsWith("Default Executor-thread-"));<NEW_LINE>assertNotNull(<MASK><NEW_LINE>if (r instanceof NamingException)<NEW_LINE>// test passes, servlet's java:comp should be unavailable to callback thread<NEW_LINE>;<NEW_LINE>else if (r instanceof Throwable)<NEW_LINE>throw new Exception("Unxpected failure for InvocationCallback lookup attempt. See cause.", (Throwable) r);<NEW_LINE>else<NEW_LINE>fail("Should not be able to look up servlet's java:comp from InvocationCallback thread: " + r);<NEW_LINE>} | r = result.poll()); |
598,390 | private SrcType makeSrcType(SrcLinkedClass owner, Type type, boolean typeParam, boolean isParameter) {<NEW_LINE>SrcType srcType;<NEW_LINE>if (type instanceof ListType) {<NEW_LINE>srcType = new SrcType(isParameter ? "List" : "IListBacked");<NEW_LINE>srcType.addTypeParam(makeSrcType(owner, ((ListType) type).getType(), true, isParameter));<NEW_LINE>} else if (type instanceof TypeName) {<NEW_LINE>String typeName = getJavaClassName(owner, (TypeName) type, typeParam);<NEW_LINE>srcType = new SrcType(typeName);<NEW_LINE>if (!typeParam) {<NEW_LINE>Class<?> javaClass = getJavaClass((TypeName) type, false);<NEW_LINE>srcType.setPrimitive(javaClass != null && javaClass.isPrimitive());<NEW_LINE>}<NEW_LINE>} else if (type instanceof NonNullType) {<NEW_LINE>Type theType = ((NonNullType) type).getType();<NEW_LINE>srcType = makeSrcType(owner, theType, typeParam, isParameter);<NEW_LINE>if (!typeParam && !srcType.isPrimitive()) {<NEW_LINE>srcType.addAnnotation(new SrcAnnotationExpression(NotNull.class.getSimpleName()));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new IllegalStateException("Unhandled type: " + type.<MASK><NEW_LINE>}<NEW_LINE>return srcType;<NEW_LINE>} | getClass().getTypeName()); |
407,398 | public S3Config createS3Config(S3ConfigCreateRequest body, String xSdsAuthToken) throws ApiException {<NEW_LINE>Object localVarPostBody = body;<NEW_LINE>// verify the required parameter 'body' is set<NEW_LINE>if (body == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'body' when calling createS3Config");<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/v4/system/config/storage/s3";<NEW_LINE>// query params<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>if (xSdsAuthToken != null)<NEW_LINE>localVarHeaderParams.put("X-Sds-Auth-Token", apiClient.parameterToString(xSdsAuthToken));<NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = { "application/json" };<NEW_LINE>final String <MASK><NEW_LINE>String[] localVarAuthNames = new String[] { "oauth2" };<NEW_LINE>GenericType<S3Config> localVarReturnType = new GenericType<S3Config>() {<NEW_LINE>};<NEW_LINE>return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);<NEW_LINE>} | localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); |
1,647,930 | public void marshall(UpdateFlowOutputRequest updateFlowOutputRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (updateFlowOutputRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(updateFlowOutputRequest.getCidrAllowList(), CIDRALLOWLIST_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateFlowOutputRequest.getDescription(), DESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateFlowOutputRequest.getDestination(), DESTINATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateFlowOutputRequest.getEncryption(), ENCRYPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateFlowOutputRequest.getFlowArn(), FLOWARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateFlowOutputRequest.getMaxLatency(), MAXLATENCY_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(updateFlowOutputRequest.getMinLatency(), MINLATENCY_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateFlowOutputRequest.getOutputArn(), OUTPUTARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateFlowOutputRequest.getPort(), PORT_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateFlowOutputRequest.getProtocol(), PROTOCOL_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateFlowOutputRequest.getRemoteId(), REMOTEID_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateFlowOutputRequest.getSenderControlPort(), SENDERCONTROLPORT_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateFlowOutputRequest.getSenderIpAddress(), SENDERIPADDRESS_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateFlowOutputRequest.getSmoothingLatency(), SMOOTHINGLATENCY_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateFlowOutputRequest.getStreamId(), STREAMID_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateFlowOutputRequest.getVpcInterfaceAttachment(), VPCINTERFACEATTACHMENT_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | updateFlowOutputRequest.getMediaStreamOutputConfigurations(), MEDIASTREAMOUTPUTCONFIGURATIONS_BINDING); |
578,019 | protected BeanDefinitionBuilder parseHandler(Element element, ParserContext parserContext) {<NEW_LINE>BeanDefinitionBuilder builder = BeanDefinitionBuilder.genericBeanDefinition(RedisOutboundGateway.class);<NEW_LINE>String redisTemplate = element.getAttribute("redis-template");<NEW_LINE>String connectionFactory = element.getAttribute("connection-factory");<NEW_LINE>if (StringUtils.hasText(redisTemplate) && StringUtils.hasText(connectionFactory)) {<NEW_LINE>parserContext.getReaderContext().error("Only one of '" + redisTemplate + "' or '" + connectionFactory + "' is allowed.", element);<NEW_LINE>}<NEW_LINE>if (StringUtils.hasText(redisTemplate)) {<NEW_LINE>builder.addConstructorArgReference(redisTemplate);<NEW_LINE>} else {<NEW_LINE>if (!StringUtils.hasText(connectionFactory)) {<NEW_LINE>connectionFactory = "redisConnectionFactory";<NEW_LINE>}<NEW_LINE>builder.addConstructorArgReference(connectionFactory);<NEW_LINE>}<NEW_LINE>String argumentExpressions = element.getAttribute("argument-expressions");<NEW_LINE>boolean hasArgumentExpressions = StringUtils.hasText(argumentExpressions);<NEW_LINE>String argumentsStrategy = element.getAttribute("arguments-strategy");<NEW_LINE>boolean hasArgumentStrategy = element.hasAttribute("arguments-strategy");<NEW_LINE>if (hasArgumentExpressions & hasArgumentStrategy) {<NEW_LINE>parserContext.getReaderContext(<MASK><NEW_LINE>}<NEW_LINE>if (hasArgumentExpressions) {<NEW_LINE>BeanDefinitionBuilder argumentsBuilder = BeanDefinitionBuilder.genericBeanDefinition(ExpressionArgumentsStrategy.class).addConstructorArgValue(argumentExpressions).addConstructorArgValue(element.getAttribute("use-command-variable"));<NEW_LINE>builder.addPropertyValue("argumentsStrategy", argumentsBuilder.getBeanDefinition());<NEW_LINE>} else if (StringUtils.hasLength(argumentsStrategy)) {<NEW_LINE>builder.addPropertyReference("argumentsStrategy", argumentsStrategy);<NEW_LINE>} else if (hasArgumentStrategy) {<NEW_LINE>builder.addPropertyValue("argumentsStrategy", null);<NEW_LINE>}<NEW_LINE>IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, element, "reply-channel", "outputChannel");<NEW_LINE>IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "requires-reply");<NEW_LINE>IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "reply-timeout", "sendTimeout");<NEW_LINE>BeanDefinition expressionDef = IntegrationNamespaceUtils.createExpressionDefIfAttributeDefined("command-expression", element);<NEW_LINE>if (expressionDef != null) {<NEW_LINE>builder.addPropertyValue("commandExpression", expressionDef);<NEW_LINE>}<NEW_LINE>IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, element, "arguments-serializer");<NEW_LINE>return builder;<NEW_LINE>} | ).error("'argument-expressions' and 'arguments-strategy' are mutually exclusive.", element); |
626,431 | public List<GenTaskBySqlBuilder> updateAndGetTasks(int projectId) throws SQLException {<NEW_LINE>FreeSelectSqlBuilder<List<GenTaskBySqlBuilder>> builder = new FreeSelectSqlBuilder<>(dbCategory);<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append("SELECT id, project_id, db_name,table_name,class_name,method_name,sql_style,crud_type,fields,where_condition,sql_content,`generated`,version,update_user_no,update_time,comment,scalarType,pagination,orderby,approved,approveMsg,hints ");<NEW_LINE>sb.append("FROM task_auto WHERE project_id=? AND `generated`=FALSE");<NEW_LINE>builder.setTemplate(sb.toString());<NEW_LINE>StatementParameters parameters = new StatementParameters();<NEW_LINE>int i = 1;<NEW_LINE>parameters.set(i++, "project_id", Types.INTEGER, projectId);<NEW_LINE>builder.mapWith(genTaskBySqlBuilderRowMapper);<NEW_LINE>DalHints hints = DalHints.<MASK><NEW_LINE>List<GenTaskBySqlBuilder> list = queryDao.query(builder, parameters, hints);<NEW_LINE>List<GenTaskBySqlBuilder> result = new ArrayList<>();<NEW_LINE>if (list == null || list.size() == 0)<NEW_LINE>return result;<NEW_LINE>processList(list);<NEW_LINE>for (GenTaskBySqlBuilder entity : list) {<NEW_LINE>entity.setGenerated(true);<NEW_LINE>if (updateTask(entity) > 0) {<NEW_LINE>result.add(entity);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | createIfAbsent(null).allowPartial(); |
482,584 | // /CLOVER:OFF<NEW_LINE>public static boolean validatePKCS7Signature(String data, String signature, PublicKey publicKey) {<NEW_LINE>try {<NEW_LINE>SignerInformationStore signerStore;<NEW_LINE>try (InputStream sigIs = new ByteArrayInputStream(Base64.decode(signature.getBytes(StandardCharsets.UTF_8)))) {<NEW_LINE>CMSProcessable content = new CMSProcessableByteArray(data.getBytes(StandardCharsets.UTF_8));<NEW_LINE>CMSSignedData signedData = new CMSSignedData(content, sigIs);<NEW_LINE>signerStore = signedData.getSignerInfos();<NEW_LINE>}<NEW_LINE>Collection<SignerInformation<MASK><NEW_LINE>Iterator<SignerInformation> it = signers.iterator();<NEW_LINE>SignerInformationVerifier infoVerifier = new JcaSimpleSignerInfoVerifierBuilder().setProvider(BC_PROVIDER).build(publicKey);<NEW_LINE>while (it.hasNext()) {<NEW_LINE>SignerInformation signerInfo = it.next();<NEW_LINE>if (signerInfo.verify(infoVerifier)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (CMSException ex) {<NEW_LINE>LOG.error("validatePKCS7Signature: unable to initialize CMSSignedData object: {}", ex.getMessage());<NEW_LINE>throw new CryptoException(ex);<NEW_LINE>} catch (OperatorCreationException ex) {<NEW_LINE>LOG.error("validatePKCS7Signature: Caught OperatorCreationException when creating JcaSimpleSignerInfoVerifierBuilder: {}", ex.getMessage());<NEW_LINE>throw new CryptoException(ex);<NEW_LINE>} catch (IOException ex) {<NEW_LINE>LOG.error("validatePKCS7Signature: Caught IOException when closing InputStream: {}", ex.getMessage());<NEW_LINE>throw new CryptoException(ex);<NEW_LINE>} catch (Exception ex) {<NEW_LINE>LOG.error("validatePKCS7Signature: unable to validate signature: {}", ex.getMessage());<NEW_LINE>throw new CryptoException(ex.getMessage());<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | > signers = signerStore.getSigners(); |
1,503,906 | public ActionRequestValidationException validate() {<NEW_LINE>ActionRequestValidationException validationException = targetIndexRequest == null ? null : targetIndexRequest.validate();<NEW_LINE>if (sourceIndex == null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (targetIndexRequest == null) {<NEW_LINE>validationException = addValidationError("target index request is missing", validationException);<NEW_LINE>}<NEW_LINE>if (targetIndexRequest.settings().getByPrefix("index.sort.").isEmpty() == false) {<NEW_LINE>validationException = addValidationError("can't override index sort when resizing an index", validationException);<NEW_LINE>}<NEW_LINE>if (type == ResizeType.SPLIT && IndexMetadata.INDEX_NUMBER_OF_SHARDS_SETTING.exists(targetIndexRequest.settings()) == false) {<NEW_LINE>validationException = addValidationError("index.number_of_shards is required for split operations", validationException);<NEW_LINE>}<NEW_LINE>assert copySettings == null || copySettings;<NEW_LINE>return validationException;<NEW_LINE>} | validationException = addValidationError("source index is missing", validationException); |
738,426 | public Path parsePath(String path) {<NEW_LINE>LOGGER.trace(String.format("parsePath(%s)", path));<NEW_LINE>if ("".equals(path)) {<NEW_LINE>return new File(cwd).toPath();<NEW_LINE>}<NEW_LINE>File file;<NEW_LINE>try {<NEW_LINE>URI resolved = mapper.resolve(path);<NEW_LINE>LOGGER.trace(String.format("import-map.resolve(%s) : %s", path, resolved));<NEW_LINE>switch(resolved.getScheme()) {<NEW_LINE>case "file":<NEW_LINE>file = vertx.<MASK><NEW_LINE>break;<NEW_LINE>case "http":<NEW_LINE>case "https":<NEW_LINE>try {<NEW_LINE>return parsePath(resolved.toURL());<NEW_LINE>} catch (MalformedURLException e) {<NEW_LINE>throw new InvalidPathException(path, e.getMessage());<NEW_LINE>}<NEW_LINE>default:<NEW_LINE>throw new IllegalArgumentException("unsupported scheme: " + resolved.getScheme());<NEW_LINE>}<NEW_LINE>} catch (UnmappedBareSpecifierException e) {<NEW_LINE>LOGGER.debug("Failed to resolve module", e);<NEW_LINE>// bare specifier<NEW_LINE>file = new File(baseDir, path);<NEW_LINE>} catch (URISyntaxException e) {<NEW_LINE>throw new InvalidPathException(path, e.getMessage());<NEW_LINE>}<NEW_LINE>// if it's a download, get the file to the download dir<NEW_LINE>// if not, continue the processing...<NEW_LINE>if (!fetchIfNeeded(file, path)) {<NEW_LINE>// force resolve through vertx, this allows fixing paths from cache back to the right location<NEW_LINE>file = vertx.resolveFile(file.getPath());<NEW_LINE>}<NEW_LINE>return file.toPath();<NEW_LINE>} | resolveFile(resolved.getPath()); |
1,749,257 | public void run(IAction action) {<NEW_LINE>if (navigator == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Set<BugPattern> filtered = FindbugsPlugin.getFilteredPatterns();<NEW_LINE>Set<BugCode> filteredTypes = FindbugsPlugin.getFilteredPatternTypes();<NEW_LINE>FilterBugsDialog dialog = new FilterBugsDialog(navigator.getSite().getShell(), filtered, filteredTypes);<NEW_LINE>dialog.setTitle("Bug Filter Configuration");<NEW_LINE>int result = dialog.open();<NEW_LINE>if (result != Window.OK) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String selectedIds = dialog.getSelectedIds();<NEW_LINE>FindbugsPlugin.getDefault().getPreferenceStore().setValue(FindBugsConstants.LAST_USED_EXPORT_FILTER, selectedIds);<NEW_LINE>BugContentProvider provider = BugContentProvider.getProvider(navigator.getNavigatorContentService());<NEW_LINE>provider.refreshFilters();<NEW_LINE>CommonViewer viewer = navigator.getCommonViewer();<NEW_LINE>Object[<MASK><NEW_LINE>viewer.refresh(true);<NEW_LINE>viewer.setExpandedElements(expandedElements);<NEW_LINE>} | ] expandedElements = viewer.getExpandedElements(); |
963,508 | protected void renderLast(PonderWorld world, MultiBufferSource buffer, PoseStack ms, float fade, float pt) {<NEW_LINE>redraw = false;<NEW_LINE>if (selectedBlock == null)<NEW_LINE>return;<NEW_LINE>BlockState blockState = world.getBlockState(selectedBlock);<NEW_LINE>if (blockState.isAir())<NEW_LINE>return;<NEW_LINE>VoxelShape shape = blockState.getShape(world, selectedBlock, CollisionContext.of(Minecraft.getInstance().player));<NEW_LINE>if (shape.isEmpty())<NEW_LINE>return;<NEW_LINE>ms.pushPose();<NEW_LINE>transformMS(ms, pt);<NEW_LINE>ms.translate(selectedBlock.getX(), selectedBlock.getY(), selectedBlock.getZ());<NEW_LINE>AABBOutline aabbOutline = new AABBOutline(shape.bounds());<NEW_LINE>aabbOutline.getParams().lineWidth(1 / 64f).<MASK><NEW_LINE>aabbOutline.render(ms, (SuperRenderTypeBuffer) buffer, pt);<NEW_LINE>ms.popPose();<NEW_LINE>} | colored(0xefefef).disableNormals(); |
888,094 | public Response addEvent(String content) throws IOException {<NEW_LINE>ObjectMapper mapper = new ObjectMapper();<NEW_LINE>LOGGER.info(String.format("JSON content: '%s'", content));<NEW_LINE>JsonNode input = mapper.readTree(content);<NEW_LINE>String eventType = getStringField(input, "eventType");<NEW_LINE>String groupType = getStringField(input, "groupType");<NEW_LINE>String groupName = getStringField(input, "groupName");<NEW_LINE>String chaosTypeName = getStringField(input, "chaosType");<NEW_LINE>ChaosType chaosType;<NEW_LINE>if (!Strings.isNullOrEmpty(chaosTypeName)) {<NEW_LINE>chaosType = ChaosType.parse(this.monkey.getChaosTypes(), chaosTypeName);<NEW_LINE>} else {<NEW_LINE>chaosType = new ShutdownInstanceChaosType(monkey.context().configuration());<NEW_LINE>}<NEW_LINE>Response.Status responseStatus;<NEW_LINE>ByteArrayOutputStream baos = new ByteArrayOutputStream();<NEW_LINE>JsonGenerator gen = JSON_FACTORY.<MASK><NEW_LINE>gen.writeStartObject();<NEW_LINE>gen.writeStringField("eventType", eventType);<NEW_LINE>gen.writeStringField("groupType", groupType);<NEW_LINE>gen.writeStringField("groupName", groupName);<NEW_LINE>gen.writeStringField("chaosType", chaosType.getKey());<NEW_LINE>if (StringUtils.isEmpty(eventType) || StringUtils.isEmpty(groupType) || StringUtils.isEmpty(groupName)) {<NEW_LINE>responseStatus = Response.Status.BAD_REQUEST;<NEW_LINE>gen.writeStringField("message", "eventType, groupType, and groupName parameters are all required");<NEW_LINE>} else {<NEW_LINE>if (eventType.equals("CHAOS_TERMINATION")) {<NEW_LINE>responseStatus = addTerminationEvent(groupType, groupName, chaosType, gen);<NEW_LINE>} else {<NEW_LINE>responseStatus = Response.Status.BAD_REQUEST;<NEW_LINE>gen.writeStringField("message", String.format("Unrecognized event type: %s", eventType));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>gen.writeEndObject();<NEW_LINE>gen.close();<NEW_LINE>LOGGER.info("entity content is '{}'", baos.toString("UTF-8"));<NEW_LINE>return Response.status(responseStatus).entity(baos.toString("UTF-8")).build();<NEW_LINE>} | createJsonGenerator(baos, JsonEncoding.UTF8); |
1,309,762 | public static MethodParameter[] customize(String[] pNames, MethodParameter[] parameters, Optional<DelegatingMethodParameterCustomizer> optionalDelegatingMethodParameterCustomizer) {<NEW_LINE>List<MethodParameter> explodedParameters = new ArrayList<>();<NEW_LINE>for (int i = 0; i < parameters.length; ++i) {<NEW_LINE>MethodParameter p = parameters[i];<NEW_LINE>Class<?> paramClass = AdditionalModelsConverter.getParameterObjectReplacement(p.getParameterType());<NEW_LINE>if (!MethodParameterPojoExtractor.isSimpleType(paramClass) && (p.hasParameterAnnotation(ParameterObject.class) || AnnotatedElementUtils.isAnnotated(paramClass, ParameterObject.class))) {<NEW_LINE>MethodParameterPojoExtractor.extractFrom(paramClass).forEach(methodParameter -> {<NEW_LINE>optionalDelegatingMethodParameterCustomizer.ifPresent(customizer -> customizer<MASK><NEW_LINE>explodedParameters.add(methodParameter);<NEW_LINE>});<NEW_LINE>} else {<NEW_LINE>String name = pNames != null ? pNames[i] : p.getParameterName();<NEW_LINE>explodedParameters.add(new DelegatingMethodParameter(p, name, null, false, false));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return explodedParameters.toArray(new MethodParameter[0]);<NEW_LINE>} | .customize(p, methodParameter)); |
124,382 | Map<String, String> kafkaPodAnnotations(int brokerId, boolean storageAnnotation) {<NEW_LINE>Map<String, String> podAnnotations = new LinkedHashMap<>(9);<NEW_LINE>podAnnotations.put(Ca.ANNO_STRIMZI_IO_CLUSTER_CA_CERT_GENERATION, String.valueOf(ModelUtils.caCertGeneration(this.clusterCa)));<NEW_LINE>podAnnotations.put(Ca.ANNO_STRIMZI_IO_CLIENTS_CA_CERT_GENERATION, String.valueOf(ModelUtils.caCertGeneration(this.clientsCa)));<NEW_LINE>podAnnotations.put(Annotations.ANNO_STRIMZI_LOGGING_APPENDERS_HASH, kafkaLoggingAppendersHash);<NEW_LINE>podAnnotations.put(KafkaCluster.ANNO_STRIMZI_BROKER_CONFIGURATION_HASH, kafkaBrokerConfigurationHash.get(brokerId));<NEW_LINE>podAnnotations.put(ANNO_STRIMZI_IO_KAFKA_VERSION, kafkaCluster.getKafkaVersion().version());<NEW_LINE>podAnnotations.put(KafkaCluster.ANNO_STRIMZI_IO_LOG_MESSAGE_FORMAT_VERSION, kafkaCluster.getLogMessageFormatVersion());<NEW_LINE>podAnnotations.put(KafkaCluster.ANNO_STRIMZI_IO_INTER_BROKER_PROTOCOL_VERSION, kafkaCluster.getInterBrokerProtocolVersion());<NEW_LINE>// Annotations with custom cert thumbprints to help with rolling updates when they change<NEW_LINE>if (!customListenerCertificateThumbprints.isEmpty()) {<NEW_LINE>podAnnotations.put(KafkaCluster.<MASK><NEW_LINE>}<NEW_LINE>// Storage annotation on Pods is used only for StatefulSets<NEW_LINE>if (storageAnnotation) {<NEW_LINE>podAnnotations.put(ANNO_STRIMZI_IO_STORAGE, ModelUtils.encodeStorageToJson(kafkaCluster.getStorage()));<NEW_LINE>}<NEW_LINE>return podAnnotations;<NEW_LINE>} | ANNO_STRIMZI_CUSTOM_LISTENER_CERT_THUMBPRINTS, customListenerCertificateThumbprints.toString()); |
1,599,045 | public void close(CTabFolderEvent event) {<NEW_LINE>TabbedEntry entry = (TabbedEntry) <MASK><NEW_LINE>UISWTViewBuilderCore builder = entry == null ? null : entry.getEventListenerBuilder();<NEW_LINE>if (entry != null) {<NEW_LINE>entry.setUserInitiatedClose();<NEW_LINE>}<NEW_LINE>TabbedEntry prev = getPrevious(entry);<NEW_LINE>if (prev != null) {<NEW_LINE>showEntry(prev);<NEW_LINE>}<NEW_LINE>// since showEntry is slightly delayed, we must slightly delay<NEW_LINE>// the closing of the entry the user clicked. Otherwise, it would close<NEW_LINE>// first, and the first tab would auto-select (on windows), and then<NEW_LINE>// the "next" tab would select.<NEW_LINE>if (props_prefix != null) {<NEW_LINE>Utils.execSWTThreadLater(0, () -> {<NEW_LINE>String view_id = entry.getViewID();<NEW_LINE>String key = props_prefix + ".closedtabs";<NEW_LINE>Map closedtabs = COConfigurationManager.getMapParameter(key, new HashMap());<NEW_LINE>if (closedtabs.containsKey(view_id)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>closedtabs.put(view_id, entry.getTitle());<NEW_LINE>// Set location if there is none.<NEW_LINE>if (builder != null && builder.getPreferredAfterID() == null) {<NEW_LINE>MdiEntrySWT[] entries = getEntries();<NEW_LINE>if (entries.length > 1 && entries[0] == entry) {<NEW_LINE>builder.setPreferredAfterID("~" + entries[1].getViewID());<NEW_LINE>} else {<NEW_LINE>for (int i = 1; i < entries.length; i++) {<NEW_LINE>MdiEntrySWT e = entries[i];<NEW_LINE>if (e == entry) {<NEW_LINE>builder.setPreferredAfterID(entries[i - 1].getViewID());<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// this will trigger listener which will remove the tab<NEW_LINE>COConfigurationManager.setParameter(key, closedtabs);<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} | event.item.getData("TabbedEntry"); |
1,229,932 | public static DescribeMasterSlaveServerGroupAttributeResponse unmarshall(DescribeMasterSlaveServerGroupAttributeResponse describeMasterSlaveServerGroupAttributeResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeMasterSlaveServerGroupAttributeResponse.setRequestId(_ctx.stringValue("DescribeMasterSlaveServerGroupAttributeResponse.RequestId"));<NEW_LINE>describeMasterSlaveServerGroupAttributeResponse.setServiceManagedMode(_ctx.stringValue("DescribeMasterSlaveServerGroupAttributeResponse.ServiceManagedMode"));<NEW_LINE>describeMasterSlaveServerGroupAttributeResponse.setLoadBalancerId(_ctx.stringValue("DescribeMasterSlaveServerGroupAttributeResponse.LoadBalancerId"));<NEW_LINE>describeMasterSlaveServerGroupAttributeResponse.setMasterSlaveServerGroupName<MASK><NEW_LINE>describeMasterSlaveServerGroupAttributeResponse.setMasterSlaveServerGroupId(_ctx.stringValue("DescribeMasterSlaveServerGroupAttributeResponse.MasterSlaveServerGroupId"));<NEW_LINE>List<MasterSlaveBackendServer> masterSlaveBackendServers = new ArrayList<MasterSlaveBackendServer>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeMasterSlaveServerGroupAttributeResponse.MasterSlaveBackendServers.Length"); i++) {<NEW_LINE>MasterSlaveBackendServer masterSlaveBackendServer = new MasterSlaveBackendServer();<NEW_LINE>masterSlaveBackendServer.setVpcId(_ctx.stringValue("DescribeMasterSlaveServerGroupAttributeResponse.MasterSlaveBackendServers[" + i + "].VpcId"));<NEW_LINE>masterSlaveBackendServer.setType(_ctx.stringValue("DescribeMasterSlaveServerGroupAttributeResponse.MasterSlaveBackendServers[" + i + "].Type"));<NEW_LINE>masterSlaveBackendServer.setWeight(_ctx.integerValue("DescribeMasterSlaveServerGroupAttributeResponse.MasterSlaveBackendServers[" + i + "].Weight"));<NEW_LINE>masterSlaveBackendServer.setDescription(_ctx.stringValue("DescribeMasterSlaveServerGroupAttributeResponse.MasterSlaveBackendServers[" + i + "].Description"));<NEW_LINE>masterSlaveBackendServer.setServerIp(_ctx.stringValue("DescribeMasterSlaveServerGroupAttributeResponse.MasterSlaveBackendServers[" + i + "].ServerIp"));<NEW_LINE>masterSlaveBackendServer.setPort(_ctx.integerValue("DescribeMasterSlaveServerGroupAttributeResponse.MasterSlaveBackendServers[" + i + "].Port"));<NEW_LINE>masterSlaveBackendServer.setServerId(_ctx.stringValue("DescribeMasterSlaveServerGroupAttributeResponse.MasterSlaveBackendServers[" + i + "].ServerId"));<NEW_LINE>masterSlaveBackendServer.setServerType(_ctx.stringValue("DescribeMasterSlaveServerGroupAttributeResponse.MasterSlaveBackendServers[" + i + "].ServerType"));<NEW_LINE>masterSlaveBackendServers.add(masterSlaveBackendServer);<NEW_LINE>}<NEW_LINE>describeMasterSlaveServerGroupAttributeResponse.setMasterSlaveBackendServers(masterSlaveBackendServers);<NEW_LINE>return describeMasterSlaveServerGroupAttributeResponse;<NEW_LINE>} | (_ctx.stringValue("DescribeMasterSlaveServerGroupAttributeResponse.MasterSlaveServerGroupName")); |
1,534,488 | public void start() throws LifecycleException {<NEW_LINE>if (!initialized)<NEW_LINE>init();<NEW_LINE>// Validate and update our current component state<NEW_LINE>if (started) {<NEW_LINE>if (log.isLoggable(Level.INFO)) {<NEW_LINE>log.log(Level.INFO, LogFacade.MANAGER_STARTED_INFO);<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>lifecycle.fireLifecycleEvent(START_EVENT, null);<NEW_LINE>started = true;<NEW_LINE>// Force initialization of the random number generator<NEW_LINE>if (log.isLoggable(Level.FINEST))<NEW_LINE>log.<MASK><NEW_LINE>generateSessionId();<NEW_LINE>if (log.isLoggable(Level.FINEST))<NEW_LINE>log.log(Level.FINEST, "Force random number initialization completed");<NEW_LINE>// Load unloaded sessions, if any<NEW_LINE>try {<NEW_LINE>load();<NEW_LINE>} catch (Throwable t) {<NEW_LINE>log.log(Level.SEVERE, LogFacade.LOADING_SESSIONS_EXCEPTION, t);<NEW_LINE>}<NEW_LINE>} | log(Level.FINEST, "Force random number initialization starting"); |
465,378 | protected void processFingerprintVerification(XmppUri uri) {<NEW_LINE>if (mConversation != null && mAccount != null && uri.hasFingerprints() && mAccount.getAxolotlService().getCryptoTargets(mConversation).contains(uri.getJid())) {<NEW_LINE>boolean performedVerification = xmppConnectionService.verifyFingerprints(mAccount.getRoster().getContact(uri.getJid()), uri.getFingerprints());<NEW_LINE>boolean keys = reloadFingerprints();<NEW_LINE>if (performedVerification && !keys && !hasNoOtherTrustedKeys() && !hasPendingKeyFetches()) {<NEW_LINE>Toast.makeText(this, R.string.all_omemo_keys_have_been_verified, <MASK><NEW_LINE>finishOk(false);<NEW_LINE>return;<NEW_LINE>} else if (performedVerification) {<NEW_LINE>Toast.makeText(this, R.string.verified_fingerprints, Toast.LENGTH_SHORT).show();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>reloadFingerprints();<NEW_LINE>Log.d(Config.LOGTAG, "xmpp uri was: " + uri.getJid() + " has Fingerprints: " + uri.hasFingerprints());<NEW_LINE>Toast.makeText(this, R.string.barcode_does_not_contain_fingerprints_for_this_conversation, Toast.LENGTH_SHORT).show();<NEW_LINE>}<NEW_LINE>populateView();<NEW_LINE>} | Toast.LENGTH_SHORT).show(); |
1,418,637 | private void drawStabilityInfo() {<NEW_LINE>String at;<NEW_LINE>// // at M=<NEW_LINE>at = trans.get("RocketInfo.at") + UnitGroup.UNITS_COEFFICIENT.getDefaultUnit().toStringUnit(Application.getPreferences().getDefaultMach());<NEW_LINE>if (!Double.isNaN(aoa)) {<NEW_LINE>at += " " + ALPHA + "=" + UnitGroup.UNITS_ANGLE.getDefaultUnit().toStringUnit(aoa);<NEW_LINE>}<NEW_LINE>if (!Double.isNaN(theta)) {<NEW_LINE>at += " " + THETA + "=" + UnitGroup.UNITS_ANGLE.getDefaultUnit().toStringUnit(theta);<NEW_LINE>}<NEW_LINE>GlyphVector cgValue = createText(getCg());<NEW_LINE>GlyphVector cpValue = createText(getCp());<NEW_LINE>GlyphVector stabValue = createText(getStability());<NEW_LINE>// // CG:<NEW_LINE>GlyphVector cgText = createText(trans.get("RocketInfo.cgText"));<NEW_LINE>// // CP:<NEW_LINE>GlyphVector cpText = createText(trans.get("RocketInfo.cpText"));<NEW_LINE>// // Stability:<NEW_LINE>GlyphVector stabText = createText(trans.get("RocketInfo.stabText"));<NEW_LINE>GlyphVector atText = createSmallText(at);<NEW_LINE>// GlyphVector visual bounds drops the spaces, so we'll add them<NEW_LINE>FontMetrics fontMetrics = g2.getFontMetrics(cgText.getFont());<NEW_LINE>int <MASK><NEW_LINE>Rectangle2D cgRect = cgValue.getVisualBounds();<NEW_LINE>Rectangle2D cpRect = cpValue.getVisualBounds();<NEW_LINE>Rectangle2D cgTextRect = cgText.getVisualBounds();<NEW_LINE>Rectangle2D cpTextRect = cpText.getVisualBounds();<NEW_LINE>Rectangle2D stabRect = stabValue.getVisualBounds();<NEW_LINE>Rectangle2D stabTextRect = stabText.getVisualBounds();<NEW_LINE>Rectangle2D atTextRect = atText.getVisualBounds();<NEW_LINE>double unitWidth = MathUtil.max(cpRect.getWidth(), cgRect.getWidth(), stabRect.getWidth());<NEW_LINE>double textWidth = Math.max(cpTextRect.getWidth(), cgTextRect.getWidth());<NEW_LINE>// Add an extra space worth of width so the text doesn't run into the values<NEW_LINE>unitWidth = unitWidth + spaceWidth;<NEW_LINE>g2.setColor(Color.BLACK);<NEW_LINE>g2.drawGlyphVector(stabValue, (float) (x2 - stabRect.getWidth()), y1);<NEW_LINE>g2.drawGlyphVector(cgValue, (float) (x2 - cgRect.getWidth()), y1 + line);<NEW_LINE>g2.drawGlyphVector(cpValue, (float) (x2 - cpRect.getWidth()), y1 + 2 * line);<NEW_LINE>g2.drawGlyphVector(stabText, (float) (x2 - unitWidth - stabTextRect.getWidth()), y1);<NEW_LINE>g2.drawGlyphVector(cgText, (float) (x2 - unitWidth - cgTextRect.getWidth()), y1 + line);<NEW_LINE>g2.drawGlyphVector(cpText, (float) (x2 - unitWidth - cpTextRect.getWidth()), y1 + 2 * line);<NEW_LINE>cgCaret.setPosition(x2 - unitWidth - textWidth - 10, y1 + line - 0.3 * line);<NEW_LINE>cgCaret.paint(g2, 1.7);<NEW_LINE>cpCaret.setPosition(x2 - unitWidth - textWidth - 10, y1 + 2 * line - 0.3 * line);<NEW_LINE>cpCaret.paint(g2, 1.7);<NEW_LINE>float atPos;<NEW_LINE>if (unitWidth + textWidth + 10 > atTextRect.getWidth()) {<NEW_LINE>atPos = (float) (x2 - (unitWidth + textWidth + 10 + atTextRect.getWidth()) / 2);<NEW_LINE>} else {<NEW_LINE>atPos = (float) (x2 - atTextRect.getWidth());<NEW_LINE>}<NEW_LINE>g2.setColor(Color.GRAY);<NEW_LINE>g2.drawGlyphVector(atText, atPos, y1 + 3 * line);<NEW_LINE>} | spaceWidth = fontMetrics.stringWidth(" "); |
1,634,294 | final GetParametersByPathResult executeGetParametersByPath(GetParametersByPathRequest getParametersByPathRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getParametersByPathRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetParametersByPathRequest> request = null;<NEW_LINE>Response<GetParametersByPathResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetParametersByPathRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getParametersByPathRequest));<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, "SSM");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetParametersByPathResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetParametersByPathResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetParametersByPath"); |
37,770 | // /////////////////////////////////////////////////////////////////////////////////////////<NEW_LINE>// TradeProtocol implementation<NEW_LINE>// /////////////////////////////////////////////////////////////////////////////////////////<NEW_LINE>@Override<NEW_LINE>protected void onAckMessage(AckMessage ackMessage, NodeAddress peer) {<NEW_LINE>// We handle the ack for CounterCurrencyTransferStartedMessage and DepositTxAndDelayedPayoutTxMessage<NEW_LINE>// as we support automatic re-send of the msg in case it was not ACKed after a certain time<NEW_LINE>if (ackMessage.getSourceMsgClassName().equals(CounterCurrencyTransferStartedMessage.class.getSimpleName())) {<NEW_LINE>processModel.setPaymentStartedAckMessage(ackMessage);<NEW_LINE>} else if (ackMessage.getSourceMsgClassName().equals(DepositTxAndDelayedPayoutTxMessage.class.getSimpleName())) {<NEW_LINE>processModel.setDepositTxSentAckMessage(ackMessage);<NEW_LINE>}<NEW_LINE>if (ackMessage.isSuccess()) {<NEW_LINE>log.info("Received AckMessage for {} from {} with tradeId {} and uid {}", ackMessage.getSourceMsgClassName(), peer, tradeModel.getId(<MASK><NEW_LINE>} else {<NEW_LINE>log.warn("Received AckMessage with error state for {} from {} with tradeId {} and errorMessage={}", ackMessage.getSourceMsgClassName(), peer, tradeModel.getId(), ackMessage.getErrorMessage());<NEW_LINE>}<NEW_LINE>} | ), ackMessage.getSourceUid()); |
754,920 | private <T extends org.eclipse.microprofile.metrics.Metric, U extends Annotation> T produceMetric(MetricRegistry registry, InjectionPoint ip, Class<U> annotationClass, Supplier<Map<MetricID, T>> getTypedMetricsFn, BiFunction<Metadata, Tag[], T> registerFn, Class<T> clazz) {<NEW_LINE>final Metric metricAnno = ip.getAnnotated().getAnnotation(Metric.class);<NEW_LINE>final Tag[] tags = tags(metricAnno);<NEW_LINE>final MetricID metricID = new MetricID(getName<MASK><NEW_LINE>T result = getTypedMetricsFn.get().get(metricID);<NEW_LINE>if (result != null) {<NEW_LINE>final Annotation specificMetricAnno = annotationClass == null ? null : ip.getAnnotated().getAnnotation(annotationClass);<NEW_LINE>if (specificMetricAnno == null) {<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>final Metadata newMetadata = newMetadata(ip, metricAnno, MetricType.from(clazz));<NEW_LINE>result = registerFn.apply(newMetadata, tags);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | (metricAnno, ip), tags); |
931,016 | private void initAttrs(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {<NEW_LINE>float density = context.getResources().getDisplayMetrics().density;<NEW_LINE>float scaledDensity = context.getResources().getDisplayMetrics().scaledDensity;<NEW_LINE>TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.BaseWheelLayout, defStyleAttr, defStyleRes);<NEW_LINE>setVisibleItemCount(typedArray.getInt(R.styleable.BaseWheelLayout_wheel_visibleItemCount, 5));<NEW_LINE>setSameWidthEnabled(typedArray.getBoolean(R.styleable.BaseWheelLayout_wheel_sameWidthEnabled, false));<NEW_LINE>setMaxWidthText(typedArray.getString(R.styleable.BaseWheelLayout_wheel_maxWidthText));<NEW_LINE>setTextColor(typedArray.getColor(R.styleable.BaseWheelLayout_wheel_itemTextColor, 0xFF888888));<NEW_LINE>setSelectedTextColor(typedArray.getColor(R.styleable.BaseWheelLayout_wheel_itemTextColorSelected, 0xFF000000));<NEW_LINE>setTextSize(typedArray.getDimension(R.styleable.BaseWheelLayout_wheel_itemTextSize, 15 * scaledDensity));<NEW_LINE>setSelectedTextSize(typedArray.getDimension(R.styleable.BaseWheelLayout_wheel_itemTextSizeSelected, 15 * scaledDensity));<NEW_LINE>setSelectedTextBold(typedArray.getBoolean(R.styleable.BaseWheelLayout_wheel_itemTextBoldSelected, false));<NEW_LINE>setTextAlign(typedArray.getInt(R.styleable.BaseWheelLayout_wheel_itemTextAlign, ItemTextAlign.CENTER));<NEW_LINE>setItemSpace(typedArray.getDimensionPixelSize(R.styleable.BaseWheelLayout_wheel_itemSpace, (int) (20 * density)));<NEW_LINE>setCyclicEnabled(typedArray.getBoolean(R.styleable.BaseWheelLayout_wheel_cyclicEnabled, false));<NEW_LINE>setIndicatorEnabled(typedArray.getBoolean(R.styleable.BaseWheelLayout_wheel_indicatorEnabled, false));<NEW_LINE>setIndicatorColor(typedArray.getColor(R.styleable.BaseWheelLayout_wheel_indicatorColor, 0xFFC9C9C9));<NEW_LINE>setIndicatorSize(typedArray.getDimension(R.styleable.BaseWheelLayout_wheel_indicatorSize, 1 * density));<NEW_LINE>setCurvedIndicatorSpace(typedArray.getDimensionPixelSize(R.styleable.BaseWheelLayout_wheel_curvedIndicatorSpace, (int<MASK><NEW_LINE>setCurtainEnabled(typedArray.getBoolean(R.styleable.BaseWheelLayout_wheel_curtainEnabled, false));<NEW_LINE>setCurtainColor(typedArray.getColor(R.styleable.BaseWheelLayout_wheel_curtainColor, 0x88FFFFFF));<NEW_LINE>setCurtainCorner(typedArray.getInt(R.styleable.BaseWheelLayout_wheel_curtainCorner, CurtainCorner.NONE));<NEW_LINE>setCurtainRadius(typedArray.getDimension(R.styleable.BaseWheelLayout_wheel_curtainRadius, 0));<NEW_LINE>setAtmosphericEnabled(typedArray.getBoolean(R.styleable.BaseWheelLayout_wheel_atmosphericEnabled, false));<NEW_LINE>setCurvedEnabled(typedArray.getBoolean(R.styleable.BaseWheelLayout_wheel_curvedEnabled, false));<NEW_LINE>setCurvedMaxAngle(typedArray.getInteger(R.styleable.BaseWheelLayout_wheel_curvedMaxAngle, 90));<NEW_LINE>typedArray.recycle();<NEW_LINE>onAttributeSet(context, attrs);<NEW_LINE>} | ) (1 * density))); |
14,937 | private boolean checkConvergence(Collection<Individuum> pop) {<NEW_LINE>if (pop.isEmpty()) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>// Gene occurrence counter<NEW_LINE>int[][] occur = new int[dim][phi + 1];<NEW_LINE>// Count gene occurrences<NEW_LINE>for (Individuum ind : pop) {<NEW_LINE>short[] gene = ind.getGene();<NEW_LINE>for (int d = 0; d < dim; d++) {<NEW_LINE>if (gene[d] == DONT_CARE) {<NEW_LINE>occur[d][0] += 1;<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>int <MASK><NEW_LINE>if (val < 0 || val >= phi) {<NEW_LINE>LOG.warning("Invalid gene value encountered: " + val + " in " + ind.toString());<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>occur[d][val + 1] += 1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int conv = (int) Math.floor(pop.size() * CONVERGENCE);<NEW_LINE>if (LOG.isDebuggingFine()) {<NEW_LINE>LOG.debugFine("Convergence at " + conv + " of " + pop.size() + " individuums.");<NEW_LINE>}<NEW_LINE>for (int d = 0; d < dim; d++) {<NEW_LINE>boolean converged = false;<NEW_LINE>for (int val = 0; val <= phi; val++) {<NEW_LINE>if (occur[d][val] >= conv) {<NEW_LINE>converged = true;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// A single failure to converge is sufficient to continue.<NEW_LINE>if (!converged) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | val = gene[d] - GENE_OFFSET; |
1,033,267 | public void onRender(MatrixStack matrixStack, float partialTicks) {<NEW_LINE>if (currentBlock == null)<NEW_LINE>return;<NEW_LINE>// GL settings<NEW_LINE>GL11.glEnable(GL11.GL_BLEND);<NEW_LINE>GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);<NEW_LINE>GL11.glEnable(GL11.GL_LINE_SMOOTH);<NEW_LINE><MASK><NEW_LINE>GL11.glDisable(GL11.GL_DEPTH_TEST);<NEW_LINE>matrixStack.push();<NEW_LINE>RenderUtils.applyRegionalRenderOffset(matrixStack);<NEW_LINE>BlockPos camPos = RenderUtils.getCameraBlockPos();<NEW_LINE>int regionX = (camPos.getX() >> 9) * 512;<NEW_LINE>int regionZ = (camPos.getZ() >> 9) * 512;<NEW_LINE>Box box = new Box(BlockPos.ORIGIN);<NEW_LINE>float p = prevProgress + (progress - prevProgress) * partialTicks;<NEW_LINE>float red = p * 2F;<NEW_LINE>float green = 2 - red;<NEW_LINE>matrixStack.translate(currentBlock.getX() - regionX, currentBlock.getY(), currentBlock.getZ() - regionZ);<NEW_LINE>if (p < 1) {<NEW_LINE>matrixStack.translate(0.5, 0.5, 0.5);<NEW_LINE>matrixStack.scale(p, p, p);<NEW_LINE>matrixStack.translate(-0.5, -0.5, -0.5);<NEW_LINE>}<NEW_LINE>RenderSystem.setShader(GameRenderer::getPositionShader);<NEW_LINE>RenderSystem.setShaderColor(red, green, 0, 0.25F);<NEW_LINE>RenderUtils.drawSolidBox(box, matrixStack);<NEW_LINE>RenderSystem.setShaderColor(red, green, 0, 0.5F);<NEW_LINE>RenderUtils.drawOutlinedBox(box, matrixStack);<NEW_LINE>matrixStack.pop();<NEW_LINE>// GL resets<NEW_LINE>RenderSystem.setShaderColor(1, 1, 1, 1);<NEW_LINE>GL11.glEnable(GL11.GL_DEPTH_TEST);<NEW_LINE>GL11.glDisable(GL11.GL_BLEND);<NEW_LINE>GL11.glDisable(GL11.GL_LINE_SMOOTH);<NEW_LINE>} | GL11.glEnable(GL11.GL_CULL_FACE); |
1,334,922 | public void run() {<NEW_LINE>id2Bean.clear();<NEW_LINE>name2Bean.clear();<NEW_LINE>beans.clear();<NEW_LINE>alias2Name.clear();<NEW_LINE>Node rootNode = SpringXMLConfigEditorUtils.getDocumentRoot(document);<NEW_LINE>if (rootNode == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>NodeList childNodes = rootNode.getChildNodes();<NEW_LINE>// prefixesMap caches the prefixes for tag nemes<NEW_LINE>// see the issue 154518<NEW_LINE>Map<String, String> prefixesMap = new HashMap<String, String>();<NEW_LINE>for (int i = 0; i < childNodes.getLength(); i++) {<NEW_LINE>Node node = childNodes.item(i);<NEW_LINE>String nodeName = node.getNodeName();<NEW_LINE>if (BeansElements.ALIAS.equals(nodeName)) {<NEW_LINE>parseAlias(node);<NEW_LINE>} else if (BeansElements.BEAN.equals(nodeName)) {<NEW_LINE>parseBean(node, prefixesMap);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | support = XMLSyntaxSupport.getSyntaxSupport(document); |
1,288,030 | public static GetDesktopGroupDetailResponse unmarshall(GetDesktopGroupDetailResponse getDesktopGroupDetailResponse, UnmarshallerContext _ctx) {<NEW_LINE>getDesktopGroupDetailResponse.setRequestId(_ctx.stringValue("GetDesktopGroupDetailResponse.RequestId"));<NEW_LINE>List<Desktop> desktops = new ArrayList<Desktop>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("GetDesktopGroupDetailResponse.Desktops.Length"); i++) {<NEW_LINE>Desktop desktop = new Desktop();<NEW_LINE>desktop.setCreationTime(_ctx.stringValue("GetDesktopGroupDetailResponse.Desktops[" + i + "].CreationTime"));<NEW_LINE>desktop.setPayType(_ctx.stringValue("GetDesktopGroupDetailResponse.Desktops[" + i + "].PayType"));<NEW_LINE>desktop.setPolicyGroupName(_ctx.stringValue("GetDesktopGroupDetailResponse.Desktops[" + i + "].PolicyGroupName"));<NEW_LINE>desktop.setCreator(_ctx.stringValue("GetDesktopGroupDetailResponse.Desktops[" + i + "].Creator"));<NEW_LINE>desktop.setMaxDesktopsCount(_ctx.integerValue("GetDesktopGroupDetailResponse.Desktops[" + i + "].MaxDesktopsCount"));<NEW_LINE>desktop.setAllowAutoSetup(_ctx.integerValue("GetDesktopGroupDetailResponse.Desktops[" + i + "].AllowAutoSetup"));<NEW_LINE>desktop.setResType(_ctx.integerValue("GetDesktopGroupDetailResponse.Desktops[" + i + "].ResType"));<NEW_LINE>desktop.setSystemDiskSize(_ctx.integerValue("GetDesktopGroupDetailResponse.Desktops[" + i + "].SystemDiskSize"));<NEW_LINE>desktop.setPolicyGroupId(_ctx.stringValue("GetDesktopGroupDetailResponse.Desktops[" + i + "].PolicyGroupId"));<NEW_LINE>desktop.setOwnBundleId(_ctx.stringValue("GetDesktopGroupDetailResponse.Desktops[" + i + "].OwnBundleId"));<NEW_LINE>desktop.setGpuCount(_ctx.floatValue("GetDesktopGroupDetailResponse.Desktops[" + i + "].GpuCount"));<NEW_LINE>desktop.setAllowBufferCount(_ctx.integerValue("GetDesktopGroupDetailResponse.Desktops[" + i + "].AllowBufferCount"));<NEW_LINE>desktop.setMemory(_ctx.longValue("GetDesktopGroupDetailResponse.Desktops[" + i + "].Memory"));<NEW_LINE>desktop.setGpuSpec(_ctx.stringValue("GetDesktopGroupDetailResponse.Desktops[" + i + "].GpuSpec"));<NEW_LINE>desktop.setDirectoryId(_ctx.stringValue("GetDesktopGroupDetailResponse.Desktops[" + i + "].DirectoryId"));<NEW_LINE>desktop.setOwnBundleName(_ctx.stringValue("GetDesktopGroupDetailResponse.Desktops[" + i + "].OwnBundleName"));<NEW_LINE>desktop.setDataDiskCategory(_ctx.stringValue("GetDesktopGroupDetailResponse.Desktops[" + i + "].DataDiskCategory"));<NEW_LINE>desktop.setDesktopGroupName(_ctx.stringValue("GetDesktopGroupDetailResponse.Desktops[" + i + "].DesktopGroupName"));<NEW_LINE>desktop.setSystemDiskCategory(_ctx.stringValue("GetDesktopGroupDetailResponse.Desktops[" + i + "].SystemDiskCategory"));<NEW_LINE>desktop.setOfficeSiteId(_ctx.stringValue("GetDesktopGroupDetailResponse.Desktops[" + i + "].OfficeSiteId"));<NEW_LINE>desktop.setKeepDuration(_ctx.longValue("GetDesktopGroupDetailResponse.Desktops[" + i + "].KeepDuration"));<NEW_LINE>desktop.setMinDesktopsCount(_ctx.integerValue("GetDesktopGroupDetailResponse.Desktops[" + i + "].MinDesktopsCount"));<NEW_LINE>desktop.setDataDiskSize(_ctx.stringValue("GetDesktopGroupDetailResponse.Desktops[" + i + "].DataDiskSize"));<NEW_LINE>desktop.setDesktopGroupId(_ctx.stringValue("GetDesktopGroupDetailResponse.Desktops[" + i + "].DesktopGroupId"));<NEW_LINE>desktop.setOfficeSiteName(_ctx.stringValue<MASK><NEW_LINE>desktop.setDirectoryType(_ctx.stringValue("GetDesktopGroupDetailResponse.Desktops[" + i + "].DirectoryType"));<NEW_LINE>desktop.setCpu(_ctx.integerValue("GetDesktopGroupDetailResponse.Desktops[" + i + "].Cpu"));<NEW_LINE>desktop.setExpiredTime(_ctx.stringValue("GetDesktopGroupDetailResponse.Desktops[" + i + "].ExpiredTime"));<NEW_LINE>desktop.setComments(_ctx.stringValue("GetDesktopGroupDetailResponse.Desktops[" + i + "].Comments"));<NEW_LINE>desktop.setOfficeSiteType(_ctx.stringValue("GetDesktopGroupDetailResponse.Desktops[" + i + "].OfficeSiteType"));<NEW_LINE>desktop.setStatus(_ctx.integerValue("GetDesktopGroupDetailResponse.Desktops[" + i + "].Status"));<NEW_LINE>desktop.setResetType(_ctx.longValue("GetDesktopGroupDetailResponse.Desktops[" + i + "].ResetType"));<NEW_LINE>desktops.add(desktop);<NEW_LINE>}<NEW_LINE>getDesktopGroupDetailResponse.setDesktops(desktops);<NEW_LINE>return getDesktopGroupDetailResponse;<NEW_LINE>} | ("GetDesktopGroupDetailResponse.Desktops[" + i + "].OfficeSiteName")); |
1,701,304 | public AssociateFileSystemAliasesResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>AssociateFileSystemAliasesResult associateFileSystemAliasesResult = new AssociateFileSystemAliasesResult();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return associateFileSystemAliasesResult;<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("Aliases", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>associateFileSystemAliasesResult.setAliases(new ListUnmarshaller<Alias>(AliasJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return associateFileSystemAliasesResult;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
286,585 | protected final void register(Element el, Class<? extends Annotation> annotation, TypeMirror type, String path, int position, String... supersedes) {<NEW_LINE>if (el.getKind() != ElementKind.CLASS) {<NEW_LINE>processingEnv.getMessager().printMessage(Kind.ERROR, annotation.getName() + " is not applicable to a " + el.getKind(), el);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (el.getEnclosingElement().getKind() == ElementKind.CLASS && !el.getModifiers().contains(Modifier.STATIC)) {<NEW_LINE>processingEnv.getMessager().printMessage(Kind.ERROR, "Inner class needs to be static to be annotated with @ServiceProvider", el);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>TypeElement clazz = (TypeElement) el;<NEW_LINE>String impl = processingEnv.getElementUtils().getBinaryName(clazz).toString();<NEW_LINE>String xface = processingEnv.getElementUtils().getBinaryName((TypeElement) processingEnv.getTypeUtils().asElement(type)).toString();<NEW_LINE>if (!processingEnv.getTypeUtils().isAssignable(clazz.asType(), type)) {<NEW_LINE>AnnotationMirror ann = findAnnotationMirror(clazz, annotation);<NEW_LINE>processingEnv.getMessager().printMessage(Kind.ERROR, impl + " is not assignable to " + xface, clazz, ann<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String rsrc = (path.length() > 0 ? "META-INF/namedservices/" + path + "/" : "META-INF/services/") + xface;<NEW_LINE>Boolean verify = verifiedClasses.get(clazz);<NEW_LINE>if (verify == null) {<NEW_LINE>verify = verifyServiceProviderSignature(clazz, annotation);<NEW_LINE>verifiedClasses.put(clazz, verify);<NEW_LINE>}<NEW_LINE>if (!verify) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>registerImpl(clazz, impl, rsrc, position, supersedes);<NEW_LINE>} | , findAnnotationValue(ann, "service")); |
1,629,436 | public boolean apply(Game game, Ability source) {<NEW_LINE>Player controller = game.getPlayer(source.getControllerId());<NEW_LINE>if (controller != null) {<NEW_LINE>List<UUID> players = new ArrayList<>();<NEW_LINE>Permanent gomazoa = game.getPermanent(source.getSourceId());<NEW_LINE>if (gomazoa != null) {<NEW_LINE>controller.moveCardToLibraryWithInfo(gomazoa, source, game, Zone.BATTLEFIELD, true, true);<NEW_LINE>players.add(gomazoa.getOwnerId());<NEW_LINE>}<NEW_LINE>BlockedByWatcher watcher = game.getState().getWatcher(BlockedByWatcher.class, source.getSourceId());<NEW_LINE>for (UUID blockedById : watcher.getBlockedByWatcher()) {<NEW_LINE>Permanent blockedByGomazoa = game.getPermanent(blockedById);<NEW_LINE>if (blockedByGomazoa != null && blockedByGomazoa.isAttacking()) {<NEW_LINE>players.add(blockedByGomazoa.getOwnerId());<NEW_LINE>Player owner = game.<MASK><NEW_LINE>if (owner != null) {<NEW_LINE>owner.moveCardToLibraryWithInfo(blockedByGomazoa, source, game, Zone.BATTLEFIELD, true, true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (UUID player : players) {<NEW_LINE>Player owner = game.getPlayer(player);<NEW_LINE>if (owner != null) {<NEW_LINE>owner.shuffleLibrary(source, game);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | getPlayer(blockedByGomazoa.getOwnerId()); |
675,997 | public static ListExchangesResponse unmarshall(ListExchangesResponse listExchangesResponse, UnmarshallerContext _ctx) {<NEW_LINE>listExchangesResponse.setRequestId(_ctx.stringValue("ListExchangesResponse.RequestId"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setNextToken(_ctx.stringValue("ListExchangesResponse.Data.NextToken"));<NEW_LINE>data.setMaxResults(_ctx.integerValue("ListExchangesResponse.Data.MaxResults"));<NEW_LINE>List<ExchangeVO> exchanges <MASK><NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListExchangesResponse.Data.Exchanges.Length"); i++) {<NEW_LINE>ExchangeVO exchangeVO = new ExchangeVO();<NEW_LINE>exchangeVO.setName(_ctx.stringValue("ListExchangesResponse.Data.Exchanges[" + i + "].Name"));<NEW_LINE>exchangeVO.setVHostName(_ctx.stringValue("ListExchangesResponse.Data.Exchanges[" + i + "].VHostName"));<NEW_LINE>exchangeVO.setExchangeType(_ctx.stringValue("ListExchangesResponse.Data.Exchanges[" + i + "].ExchangeType"));<NEW_LINE>exchangeVO.setAutoDeleteState(_ctx.booleanValue("ListExchangesResponse.Data.Exchanges[" + i + "].AutoDeleteState"));<NEW_LINE>exchangeVO.setAttributes(_ctx.mapValue("ListExchangesResponse.Data.Exchanges[" + i + "].Attributes"));<NEW_LINE>exchangeVO.setCreateTime(_ctx.longValue("ListExchangesResponse.Data.Exchanges[" + i + "].CreateTime"));<NEW_LINE>exchanges.add(exchangeVO);<NEW_LINE>}<NEW_LINE>data.setExchanges(exchanges);<NEW_LINE>listExchangesResponse.setData(data);<NEW_LINE>return listExchangesResponse;<NEW_LINE>} | = new ArrayList<ExchangeVO>(); |
772,054 | List<RowLock> acquireRowlocks(Map<KeyExtent, List<ServerConditionalMutation>> updates, Map<KeyExtent, List<ServerConditionalMutation>> deferred) {<NEW_LINE>ArrayList<RowLock> locks = new ArrayList<>();<NEW_LINE>for (List<ServerConditionalMutation> scml : updates.values()) {<NEW_LINE>for (ServerConditionalMutation scm : scml) {<NEW_LINE>locks.add(getRowLock(new ArrayByteSequence(scm.getRow())));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>HashSet<ByteSequence> rowsNotLocked = null;<NEW_LINE>if (locks.size() > 1) {<NEW_LINE>// Assuming mutations are in sorted order which avoids deadlock. Acquire as many locks as<NEW_LINE>// possible, not blocking on rows that are already locked.<NEW_LINE>for (RowLock rowLock : locks) {<NEW_LINE>if (!rowLock.tryLock()) {<NEW_LINE>if (rowsNotLocked == null)<NEW_LINE>rowsNotLocked = new HashSet<>();<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// if there is only one lock, then wait for it<NEW_LINE>locks.get(0).lock();<NEW_LINE>}<NEW_LINE>if (rowsNotLocked != null) {<NEW_LINE>final HashSet<ByteSequence> rnlf = rowsNotLocked;<NEW_LINE>// assume will get locks needed, do something expensive otherwise<NEW_LINE>ConditionalMutationSet.defer(updates, deferred, new DeferFilter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void defer(List<ServerConditionalMutation> scml, List<ServerConditionalMutation> okMutations, List<ServerConditionalMutation> deferred) {<NEW_LINE>for (ServerConditionalMutation scm : scml) {<NEW_LINE>if (rnlf.contains(new ArrayByteSequence(scm.getRow())))<NEW_LINE>deferred.add(scm);<NEW_LINE>else<NEW_LINE>okMutations.add(scm);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>ArrayList<RowLock> filteredLocks = new ArrayList<>();<NEW_LINE>ArrayList<RowLock> locksToReturn = new ArrayList<>();<NEW_LINE>for (RowLock rowLock : locks) {<NEW_LINE>if (rowsNotLocked.contains(rowLock.rowSeq)) {<NEW_LINE>locksToReturn.add(rowLock);<NEW_LINE>} else {<NEW_LINE>filteredLocks.add(rowLock);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (RowLock rowLock : locksToReturn) {<NEW_LINE>returnRowLock(rowLock);<NEW_LINE>}<NEW_LINE>locks = filteredLocks;<NEW_LINE>}<NEW_LINE>return locks;<NEW_LINE>} | rowsNotLocked.add(rowLock.rowSeq); |
1,738,390 | public void validateCertificateChain(List<X509Certificate> certificateChain) throws UaException {<NEW_LINE>PKIXCertPathBuilderResult certPathResult;<NEW_LINE>try {<NEW_LINE>certPathResult = buildTrustedCertPath(certificateChain, trustListManager.getTrustedCertificates(), trustListManager.getIssuerCertificates());<NEW_LINE>} catch (UaException e) {<NEW_LINE><MASK><NEW_LINE>long statusCode = e.getStatusCode().getValue();<NEW_LINE>if (statusCode == StatusCodes.Bad_CertificateUntrusted) {<NEW_LINE>// servers need to report a less informative StatusCode if the<NEW_LINE>// certificate was not trusted, either explicitly or because it<NEW_LINE>// or one if its issuers was revoked.<NEW_LINE>throw new UaException(StatusCodes.Bad_SecurityChecksFailed, e.getMessage(), e);<NEW_LINE>} else {<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>List<X509CRL> crls = new ArrayList<>();<NEW_LINE>crls.addAll(trustListManager.getTrustedCrls());<NEW_LINE>crls.addAll(trustListManager.getIssuerCrls());<NEW_LINE>validateTrustedCertPath(certPathResult.getCertPath(), certPathResult.getTrustAnchor(), crls, validationChecks, true);<NEW_LINE>} catch (UaException e) {<NEW_LINE>long statusCode = e.getStatusCode().getValue();<NEW_LINE>if (statusCode == StatusCodes.Bad_CertificateRevoked || statusCode == StatusCodes.Bad_CertificateIssuerRevoked) {<NEW_LINE>// servers need to report a less informative StatusCode if the<NEW_LINE>// certificate was not trusted, either explicitly or because it<NEW_LINE>// or one if its issuers was revoked.<NEW_LINE>throw new UaException(StatusCodes.Bad_SecurityChecksFailed, e.getMessage(), e);<NEW_LINE>} else {<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | certificateChain.forEach(trustListManager::addRejectedCertificate); |
676,125 | public SDVariable tensorMmul(SDVariable x, SDVariable y, int[] dimensionsX, int[] dimensionsY, boolean transposeX, boolean transposeY, boolean transposeZ) {<NEW_LINE>SDValidation.validateNumerical("tensorMmul", "x", x);<NEW_LINE>SDValidation.validateNumerical("tensorMmul", "y", y);<NEW_LINE>Preconditions.checkArgument(dimensionsX.length >= 1, "dimensionsX has incorrect size/length. Expected: dimensionsX.length >= 1, got %s", dimensionsX.length);<NEW_LINE>Preconditions.checkArgument(dimensionsY.length >= 1, "dimensionsY has incorrect size/length. Expected: dimensionsY.length >= 1, got %s", dimensionsY.length);<NEW_LINE>return new org.nd4j.linalg.api.ops.impl.reduce.TensorMmul(sd, x, y, dimensionsX, dimensionsY, transposeX, <MASK><NEW_LINE>} | transposeY, transposeZ).outputVariable(); |
314,829 | void modelConverterTest(Context ctx) throws TestFailedException {<NEW_LINE>System.out.println("ModelConverterTest");<NEW_LINE>Expr<RealSort> xr = ctx.mkConst(ctx.mkSymbol("x"), ctx.mkRealSort());<NEW_LINE>Expr<RealSort> yr = ctx.mkConst(ctx.mkSymbol("y"), ctx.mkRealSort());<NEW_LINE>Goal g4 = ctx.mkGoal(true, false, false);<NEW_LINE>g4.add(ctx.mkGt(xr, ctx.mkReal(10, 1)));<NEW_LINE>g4.add(ctx.mkEq(yr, ctx.mkAdd(xr, ctx.mkReal(1, 1))));<NEW_LINE>g4.add(ctx.mkGt(yr, ctx.<MASK><NEW_LINE>ApplyResult ar = applyTactic(ctx, ctx.mkTactic("simplify"), g4);<NEW_LINE>if (ar.getNumSubgoals() == 1 && (ar.getSubgoals()[0].isDecidedSat() || ar.getSubgoals()[0].isDecidedUnsat()))<NEW_LINE>throw new TestFailedException();<NEW_LINE>ar = applyTactic(ctx, ctx.andThen(ctx.mkTactic("simplify"), ctx.mkTactic("solve-eqs")), g4);<NEW_LINE>if (ar.getNumSubgoals() == 1 && (ar.getSubgoals()[0].isDecidedSat() || ar.getSubgoals()[0].isDecidedUnsat()))<NEW_LINE>throw new TestFailedException();<NEW_LINE>Solver s = ctx.mkSolver();<NEW_LINE>for (BoolExpr e : ar.getSubgoals()[0].getFormulas()) s.add(e);<NEW_LINE>Status q = s.check();<NEW_LINE>System.out.printf("Solver says: %s%n", q);<NEW_LINE>System.out.printf("Model: %n%s%n", s.getModel());<NEW_LINE>if (q != Status.SATISFIABLE)<NEW_LINE>throw new TestFailedException();<NEW_LINE>} | mkReal(1, 1))); |
1,525,071 | @Produces(APPLICATION_JSON)<NEW_LINE>@ApiOperation(value = "Invalidates Caches per tenant level")<NEW_LINE>@ApiResponses(value = { @ApiResponse(code = 204, message = "Successful operation") })<NEW_LINE>public Response invalidatesCacheByTenant(@javax.ws.rs.core.Context final HttpServletRequest request) throws TenantApiException {<NEW_LINE>// creating Tenant Context from Request<NEW_LINE>final TenantContext tenantContext = context.createTenantContextNoAccountId(request);<NEW_LINE>final Tenant currentTenant = tenantApi.getTenantById(tenantContext.getTenantId());<NEW_LINE>// getting Tenant Record Id<NEW_LINE>final Long tenantRecordId = recordIdApi.getRecordId(tenantContext.getTenantId(), ObjectType.TENANT, tenantContext);<NEW_LINE>final Function<String, Boolean> tenantKeysMatcher = new Function<String, Boolean>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Boolean apply(@Nullable final String key) {<NEW_LINE>return key != null && key.endsWith("::" + tenantRecordId);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>// clear tenant-record-id cache by tenantId<NEW_LINE>final CacheController<String, Long> tenantRecordIdCacheController = cacheControllerDispatcher.getCacheController(CacheType.TENANT_RECORD_ID);<NEW_LINE>tenantRecordIdCacheController.remove(currentTenant.getId().toString());<NEW_LINE>// clear tenant-payment-state-machine-config cache by tenantRecordId<NEW_LINE>final CacheController<String, Object> tenantPaymentStateMachineConfigCacheController = cacheControllerDispatcher.getCacheController(CacheType.TENANT_PAYMENT_STATE_MACHINE_CONFIG);<NEW_LINE>tenantPaymentStateMachineConfigCacheController.remove(tenantKeysMatcher);<NEW_LINE>// clear tenant cache by tenantApiKey<NEW_LINE>final CacheController<String, Tenant> tenantCacheController = <MASK><NEW_LINE>tenantCacheController.remove(currentTenant.getApiKey());<NEW_LINE>// clear tenant-kv cache by tenantRecordId<NEW_LINE>final CacheController<String, String> tenantKVCacheController = cacheControllerDispatcher.getCacheController(CacheType.TENANT_KV);<NEW_LINE>tenantKVCacheController.remove(tenantKeysMatcher);<NEW_LINE>// clear tenant-config cache by tenantRecordId<NEW_LINE>final CacheController<Long, PerTenantConfig> tenantConfigCacheController = cacheControllerDispatcher.getCacheController(CacheType.TENANT_CONFIG);<NEW_LINE>tenantConfigCacheController.remove(tenantRecordId);<NEW_LINE>// clear tenant-overdue-config cache by tenantRecordId<NEW_LINE>final CacheController<Long, Object> tenantOverdueConfigCacheController = cacheControllerDispatcher.getCacheController(CacheType.TENANT_OVERDUE_CONFIG);<NEW_LINE>tenantOverdueConfigCacheController.remove(tenantRecordId);<NEW_LINE>// clear tenant-catalog cache by tenantRecordId<NEW_LINE>final CacheController<Long, VersionedCatalog> tenantCatalogCacheController = cacheControllerDispatcher.getCacheController(CacheType.TENANT_CATALOG);<NEW_LINE>tenantCatalogCacheController.remove(tenantRecordId);<NEW_LINE>return Response.status(Status.NO_CONTENT).build();<NEW_LINE>} | cacheControllerDispatcher.getCacheController(CacheType.TENANT); |
376,220 | public static void zoom(int AD_Table_ID, int Record_ID) {<NEW_LINE>String TableName = null;<NEW_LINE>int AD_Window_ID = 0;<NEW_LINE>int PO_Window_ID = 0;<NEW_LINE>String sql = "SELECT TableName, AD_Window_ID, PO_Window_ID FROM AD_Table WHERE AD_Table_ID=?";<NEW_LINE>try {<NEW_LINE>PreparedStatement pstmt = DB.prepareStatement(sql, null);<NEW_LINE>pstmt.setInt(1, AD_Table_ID);<NEW_LINE>ResultSet rs = pstmt.executeQuery();<NEW_LINE>if (rs.next()) {<NEW_LINE>TableName = rs.getString(1);<NEW_LINE>AD_Window_ID = rs.getInt(2);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>rs.close();<NEW_LINE>pstmt.close();<NEW_LINE>} catch (SQLException e) {<NEW_LINE>log.log(Level.SEVERE, sql, e);<NEW_LINE>}<NEW_LINE>// Nothing to Zoom to<NEW_LINE>if (TableName == null || AD_Window_ID == 0)<NEW_LINE>return;<NEW_LINE>// PO Zoom ?<NEW_LINE>boolean isSOTrx = true;<NEW_LINE>if (PO_Window_ID != 0) {<NEW_LINE>String whereClause = TableName + "_ID=" + Record_ID;<NEW_LINE>isSOTrx = DB.isSOTrx(TableName, whereClause);<NEW_LINE>if (!isSOTrx)<NEW_LINE>AD_Window_ID = PO_Window_ID;<NEW_LINE>}<NEW_LINE>log.config(TableName + " - Record_ID=" + Record_ID + " (IsSOTrx=" + isSOTrx + ")");<NEW_LINE>zoom(AD_Window_ID, MQuery.getEqualQuery(TableName + "_ID", Record_ID));<NEW_LINE>} | PO_Window_ID = rs.getInt(3); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.