idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
1,338,474
private static void createMultiTimeseries() throws IoTDBConnectionException, StatementExecutionException {<NEW_LINE>if (!session.checkTimeseriesExists("root.sg1.d2.s1") && !session.checkTimeseriesExists("root.sg1.d2.s2")) {<NEW_LINE>List<String> paths = new ArrayList<>();<NEW_LINE>paths.add("root.sg1.d2.s1");<NEW_LINE>paths.add("root.sg1.d2.s2");<NEW_LINE>List<TSDataType> tsDataTypes = new ArrayList<>();<NEW_LINE>tsDataTypes.add(TSDataType.INT64);<NEW_LINE>tsDataTypes.add(TSDataType.INT64);<NEW_LINE>List<TSEncoding> tsEncodings = new ArrayList<>();<NEW_LINE>tsEncodings.add(TSEncoding.RLE);<NEW_LINE>tsEncodings.add(TSEncoding.RLE);<NEW_LINE>List<CompressionType> compressionTypes = new ArrayList<>();<NEW_LINE>compressionTypes.add(CompressionType.SNAPPY);<NEW_LINE>compressionTypes.add(CompressionType.SNAPPY);<NEW_LINE>List<Map<String, String>> tagsList = new ArrayList<>();<NEW_LINE>Map<String, String> tags = new HashMap<>();<NEW_LINE>tags.put("unit", "kg");<NEW_LINE>tagsList.add(tags);<NEW_LINE>tagsList.add(tags);<NEW_LINE>List<Map<String, String>> attributesList = new ArrayList<>();<NEW_LINE>Map<String, String> attributes = new HashMap<>();<NEW_LINE>attributes.put("minValue", "1");<NEW_LINE><MASK><NEW_LINE>attributesList.add(attributes);<NEW_LINE>attributesList.add(attributes);<NEW_LINE>List<String> alias = new ArrayList<>();<NEW_LINE>alias.add("weight1");<NEW_LINE>alias.add("weight2");<NEW_LINE>session.createMultiTimeseries(paths, tsDataTypes, tsEncodings, compressionTypes, null, tagsList, attributesList, alias);<NEW_LINE>}<NEW_LINE>}
attributes.put("maxValue", "100");
624,103
public void delete(final FileLock lock, ProvidedExtensions.DeleteHandler deleteHandler) throws IOException {<NEW_LINE>final File f = getFileName().getFile();<NEW_LINE>final FolderObj existingParent = getExistingParent();<NEW_LINE>final ChildrenCache childrenCache = (existingParent != null) ? existingParent.getChildrenCache() : null;<NEW_LINE>final Mutex.Privileged mutexPrivileged = (childrenCache != null) ? childrenCache.getMutexPrivileged() : null;<NEW_LINE>if (mutexPrivileged != null) {<NEW_LINE>mutexPrivileged.enterWriteAccess();<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (!checkLock(lock)) {<NEW_LINE>// NOI18N<NEW_LINE>FSException.io("EXC_InvalidLock", lock, getPath());<NEW_LINE>}<NEW_LINE>boolean deleteStatus = (deleteHandler != null) ? deleteHandler.delete(f) : deleteFile(f);<NEW_LINE>if (!deleteStatus) {<NEW_LINE>FileObject parent = getExistingParent();<NEW_LINE>String parentPath = (parent != null) ? parent.getPath() : f.getParentFile().getAbsolutePath();<NEW_LINE>// NOI18N<NEW_LINE>FSException.io("EXC_CannotDelete", f.getName(), parentPath);<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>BaseFileObj.attribs.deleteAttributes(f.getAbsolutePath().replace('\\', '/'));<NEW_LINE>if (childrenCache != null) {<NEW_LINE>if (deleteHandler != null) {<NEW_LINE>childrenCache.removeChild(getFileName());<NEW_LINE>} else {<NEW_LINE>childrenCache.getChild(BaseFileObj<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>if (mutexPrivileged != null) {<NEW_LINE>mutexPrivileged.exitWriteAccess();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>setValid(false);<NEW_LINE>fireFileDeletedEvent(false);<NEW_LINE>}
.getNameExt(f), true);
1,370,370
public boolean visit(ClassInstanceCreation node) {<NEW_LINE>ASTNode expression = getChildNode(node, ClassInstanceCreation.EXPRESSION_PROPERTY);<NEW_LINE>if (expression != null) {<NEW_LINE>expression.accept(this);<NEW_LINE>this.result.append('.');<NEW_LINE>}<NEW_LINE>// $NON-NLS-1$<NEW_LINE>this.result.append("new ");<NEW_LINE>if (node.getAST().apiLevel() == JLS2_INTERNAL) {<NEW_LINE>getChildNode(node, INTERNAL_CIC_NAME_PROPERTY).accept(this);<NEW_LINE>} else {<NEW_LINE>visitList(node, ClassInstanceCreation.TYPE_ARGUMENTS_PROPERTY, String.valueOf(','), String.valueOf('<'), String.valueOf('>'));<NEW_LINE>getChildNode(node, ClassInstanceCreation.TYPE_PROPERTY).accept(this);<NEW_LINE>}<NEW_LINE>this.result.append('(');<NEW_LINE>visitList(node, ClassInstanceCreation.ARGUMENTS_PROPERTY, String.valueOf(','));<NEW_LINE><MASK><NEW_LINE>ASTNode decl = getChildNode(node, ClassInstanceCreation.ANONYMOUS_CLASS_DECLARATION_PROPERTY);<NEW_LINE>if (decl != null) {<NEW_LINE>decl.accept(this);<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
this.result.append(')');
1,265,500
public Dialog onCreateDialog(Bundle savedInstanceState) {<NEW_LINE>if (mBottomSheetDialog == null) {<NEW_LINE>mBottomSheetDialog = (BottomSheetDialog) super.onCreateDialog(savedInstanceState);<NEW_LINE>View inflate = View.inflate(getActivity(), R.layout.livepusher_fragment_setting, null);<NEW_LINE>initViews(inflate);<NEW_LINE>mBottomSheetDialog.setContentView(inflate);<NEW_LINE>mBottomSheetDialog.getWindow().findViewById(R.id.design_bottom_sheet).setBackgroundResource(android.R.color.transparent);<NEW_LINE>mBehavior = BottomSheetBehavior.from((View) inflate.getParent());<NEW_LINE>View parent = (View) inflate.getParent();<NEW_LINE>BottomSheetBehavior behavior = BottomSheetBehavior.from(parent);<NEW_LINE>inflate.measure(0, 0);<NEW_LINE>behavior.setPeekHeight(inflate.getMeasuredHeight());<NEW_LINE>CoordinatorLayout.LayoutParams params = (CoordinatorLayout<MASK><NEW_LINE>params.gravity = Gravity.TOP | Gravity.CENTER_HORIZONTAL;<NEW_LINE>parent.setLayoutParams(params);<NEW_LINE>mBottomSheetDialog.show();<NEW_LINE>}<NEW_LINE>return mBottomSheetDialog;<NEW_LINE>}
.LayoutParams) parent.getLayoutParams();
1,209,347
public Result doMerge() {<NEW_LINE>com.feth.play.module.pa.controllers.Authenticate.noCache(response());<NEW_LINE>// this is the currently logged in user<NEW_LINE>final AuthUser aUser = this.<MASK><NEW_LINE>// this is the user that was selected for a login<NEW_LINE>final AuthUser bUser = this.auth.getMergeUser(session());<NEW_LINE>if (bUser == null) {<NEW_LINE>// user to merge with could not be found, silently redirect to login<NEW_LINE>return redirect(routes.Application.index());<NEW_LINE>}<NEW_LINE>final Form<Accept> filledForm = ACCEPT_FORM.bindFromRequest();<NEW_LINE>if (filledForm.hasErrors()) {<NEW_LINE>// User did not select whether to merge or not merge<NEW_LINE>return badRequest(ask_merge.render(this.userProvider, filledForm, aUser, bUser));<NEW_LINE>} else {<NEW_LINE>// User made a choice :)<NEW_LINE>final boolean merge = filledForm.get().accept;<NEW_LINE>if (merge) {<NEW_LINE>flash(Application.FLASH_MESSAGE_KEY, this.msg.preferred(request()).at("playauthenticate.accounts.merge.success"));<NEW_LINE>}<NEW_LINE>return this.auth.merge(ctx(), merge);<NEW_LINE>}<NEW_LINE>}
auth.getUser(session());
1,468,966
private static JsonObject createJsonObject(Media media) {<NEW_LINE>JsonObject jsonObject = new JsonObject();<NEW_LINE>if (media.hasBitrate) {<NEW_LINE>jsonObject.addProperty("bitrate", media.bitrate);<NEW_LINE>}<NEW_LINE>jsonObject.addProperty("copyright", media.copyright);<NEW_LINE>jsonObject.addProperty("duration", media.duration);<NEW_LINE>jsonObject.addProperty("format", media.format);<NEW_LINE>jsonObject.addProperty("height", media.height);<NEW_LINE>int size = media.persons.size();<NEW_LINE>JsonArray personsJsonArray = new JsonArray();<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>personsJsonArray.add(new JsonPrimitive(media.persons.get(i)));<NEW_LINE>}<NEW_LINE>jsonObject.add("persons", personsJsonArray);<NEW_LINE>jsonObject.addProperty("player", media.player.name());<NEW_LINE>jsonObject.addProperty("size", media.size);<NEW_LINE>jsonObject.addProperty("title", media.title);<NEW_LINE>jsonObject.<MASK><NEW_LINE>jsonObject.addProperty("width", media.width);<NEW_LINE>return jsonObject;<NEW_LINE>}
addProperty("uri", media.uri);
89,541
public void begin(InterpretationContext ec, String localName, Attributes attributes) throws ActionException {<NEW_LINE>// reset variables<NEW_LINE>scopeStr = null;<NEW_LINE>scope = null;<NEW_LINE>propertyName = null;<NEW_LINE>definer = null;<NEW_LINE>inError = false;<NEW_LINE>// read future property name<NEW_LINE>propertyName = attributes.getValue(NAME_ATTRIBUTE);<NEW_LINE>scopeStr = attributes.getValue(SCOPE_ATTRIBUTE);<NEW_LINE>scope = ActionUtil.stringToScope(scopeStr);<NEW_LINE>if (OptionHelper.isEmpty(propertyName)) {<NEW_LINE>addError("Missing property name for property definer. Near [" + localName + "] line " + getLineNumber(ec));<NEW_LINE>inError = true;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// read property definer class name<NEW_LINE>String className = attributes.getValue(CLASS_ATTRIBUTE);<NEW_LINE>if (OptionHelper.isEmpty(className)) {<NEW_LINE>addError("Missing class name for property definer. Near [" + localName <MASK><NEW_LINE>inError = true;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// try to instantiate property definer<NEW_LINE>try {<NEW_LINE>addInfo("About to instantiate property definer of type [" + className + "]");<NEW_LINE>definer = (PropertyDefiner) OptionHelper.instantiateByClassName(className, PropertyDefiner.class, context);<NEW_LINE>definer.setContext(context);<NEW_LINE>if (definer instanceof LifeCycle) {<NEW_LINE>((LifeCycle) definer).start();<NEW_LINE>}<NEW_LINE>ec.pushObject(definer);<NEW_LINE>} catch (Exception oops) {<NEW_LINE>inError = true;<NEW_LINE>addError("Could not create an PropertyDefiner of type [" + className + "].", oops);<NEW_LINE>throw new ActionException(oops);<NEW_LINE>}<NEW_LINE>}
+ "] line " + getLineNumber(ec));
1,109,382
protected void actionPerformed(FrontEndProjectTreeContext context) {<NEW_LINE>DomainFolder domainFolder = context.getSelectedFolders().get(0);<NEW_LINE><MASK><NEW_LINE>RepositoryAdapter repository = projectData.getRepository();<NEW_LINE>if (repository != null && !repository.isConnected()) {<NEW_LINE>if (OptionDialog.OPTION_ONE != OptionDialog.showOptionDialogWithCancelAsDefaultButton(null, "Find Checkouts...", "Action requires connection to repository.\nWould you like to connect now?", "Connect", OptionDialog.QUESTION_MESSAGE)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>repository.connect();<NEW_LINE>} catch (NotConnectedException e) {<NEW_LINE>// ignore - likely caused by cancellation<NEW_LINE>return;<NEW_LINE>} catch (IOException e) {<NEW_LINE>ClientUtil.handleException(repository, e, "Find Checkouts", null);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>findCheckouts(domainFolder, context.getTree());<NEW_LINE>}
ProjectData projectData = domainFolder.getProjectData();
1,263,372
protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>setContentView(R.layout.activity_fade_text_view);<NEW_LINE>textView = (FadeTextView) findViewById(R.id.textview);<NEW_LINE>textView.setOnClickListener(new ClickListener());<NEW_LINE>textView.setAnimationListener(new SimpleAnimationListener(this));<NEW_LINE>textview2 = (FadeTextView) findViewById(R.id.textview2);<NEW_LINE>textview2.setOnClickListener(new ClickListener());<NEW_LINE>textview2.setAnimationListener(new SimpleAnimationListener(this));<NEW_LINE>textView.animateText(getString(R.string.initStr));<NEW_LINE>seekBar = (SeekBar) findViewById(R.id.seekbar);<NEW_LINE>seekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {<NEW_LINE><MASK><NEW_LINE>textview2.setProgress(progress / 100f);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onStartTrackingTouch(SeekBar seekBar) {<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onStopTrackingTouch(SeekBar seekBar) {<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
textView.setProgress(progress / 100f);
1,715,821
public OAuth1Parameters readRequest(OAuth1Request request) {<NEW_LINE>// read supported parameters from query string or request body (lowest preference)<NEW_LINE>for (String param : request.getParameterNames()) {<NEW_LINE>if (!param.startsWith("oauth_")) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>List<String> values = request.getParameterValues(param);<NEW_LINE>if (values == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Iterator<String> i = values.iterator();<NEW_LINE>if (!i.hasNext()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>put(<MASK><NEW_LINE>}<NEW_LINE>// read all parameters from authorization header (highest preference)<NEW_LINE>List<String> headers = request.getHeaderValues(AUTHORIZATION_HEADER);<NEW_LINE>if (headers == null) {<NEW_LINE>return this;<NEW_LINE>}<NEW_LINE>for (String header : headers) {<NEW_LINE>if (!header.regionMatches(true, 0, SCHEME_SPACE, 0, SCHEME_SPACE.length())) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>for (String param : header.substring(SCHEME_SPACE.length()).trim().split(",(?=(?:[^\"]*\"[^\"]*\")+$)")) {<NEW_LINE>String[] nv = param.split("=", 2);<NEW_LINE>if (nv.length != 2) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>put(UriComponent.decode(nv[0].trim(), UriComponent.Type.UNRESERVED), UriComponent.decode(dequote(nv[1].trim()), UriComponent.Type.UNRESERVED));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return this;<NEW_LINE>}
param, i.next());
449,323
public void run(ITextSelection currentSelection) {<NEW_LINE>if (currentSelection != null && editor != null) {<NEW_LINE>GroovyCompilationUnit unit = editor.getGroovyCompilationUnit();<NEW_LINE>if (unit != null) {<NEW_LINE>ModuleNode node = unit.getModuleNode();<NEW_LINE>if (node != null) {<NEW_LINE>FindSurroundingNode finder = new FindSurroundingNode(new Region(currentSelection.getOffset(), currentSelection.getLength()));<NEW_LINE>IASTFragment result = finder.doVisitSurroundingNode(node);<NEW_LINE>if (result != null) {<NEW_LINE>TextSelection newSelection = new TextSelection(result.getStart(<MASK><NEW_LINE>if (!newSelection.equals(currentSelection)) {<NEW_LINE>history.remember(new SourceRange(currentSelection.getOffset(), currentSelection.getLength()));<NEW_LINE>try {<NEW_LINE>history.ignoreSelectionChanges();<NEW_LINE>editor.selectAndReveal(result.getStart(), result.getLength());<NEW_LINE>} finally {<NEW_LINE>history.listenToSelectionChanges();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>editor.getSelectionProvider().setSelection(newSelection);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
), result.getLength());
1,249,452
private Object enhanceCompositeKey(Object key, PartialSearchMode partialSearchMode) {<NEW_LINE>if (!(key instanceof OCompositeKey))<NEW_LINE>return key;<NEW_LINE>final OCompositeKey compositeKey = (OCompositeKey) key;<NEW_LINE>final int keySize <MASK><NEW_LINE>if (!(keySize == 1 || compositeKey.getKeys().size() == keySize || partialSearchMode.equals(PartialSearchMode.NONE))) {<NEW_LINE>final OCompositeKey fullKey = new OCompositeKey(compositeKey);<NEW_LINE>int itemsToAdd = keySize - fullKey.getKeys().size();<NEW_LINE>final Comparable<?> keyItem;<NEW_LINE>if (partialSearchMode.equals(PartialSearchMode.HIGHEST_BOUNDARY))<NEW_LINE>keyItem = ALWAYS_GREATER_KEY;<NEW_LINE>else<NEW_LINE>keyItem = ALWAYS_LESS_KEY;<NEW_LINE>for (int i = 0; i < itemsToAdd; i++) fullKey.addKey(keyItem);<NEW_LINE>return fullKey;<NEW_LINE>}<NEW_LINE>return key;<NEW_LINE>}
= getDefinition().getParamCount();
554,762
private <T> T createForField(FieldInfo<T> info) throws IOException {<NEW_LINE>Optional<CustomFieldSerializationTag> serializerTag = CustomBehaviorUtils.get(CustomFieldSerializationTag.class, info.getCustomBehavior());<NEW_LINE>if (serializerTag.isPresent()) {<NEW_LINE>if (serializerTag.get() instanceof DefaultFieldSerialization) {<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>ValueTypeInfo<T> typeInfo = (ValueTypeInfo<T>) ValueTypeInfoFactory.forTypeToken(TypeToken.of(info.getField().getGenericType()));<NEW_LINE>return typeInfo.create(this);<NEW_LINE>}<NEW_LINE>Verify.verify(serializerTag.get() instanceof CustomFieldSerialization, "Unrecognized serialization behavior %s.", serializerTag.get().getClass().getName());<NEW_LINE>if (serializerTag.get() instanceof CustomFieldSerialization) {<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>CustomFieldSerialization<T> customSerializer = (CustomFieldSerialization<<MASK><NEW_LINE>return customSerializer.deserialize(this);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return info.getValueTypeInfo().create(this);<NEW_LINE>}
T>) serializerTag.get();
1,474,372
final PostCommentForPullRequestResult executePostCommentForPullRequest(PostCommentForPullRequestRequest postCommentForPullRequestRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(postCommentForPullRequestRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<PostCommentForPullRequestRequest> request = null;<NEW_LINE>Response<PostCommentForPullRequestResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new PostCommentForPullRequestRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(postCommentForPullRequestRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CodeCommit");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "PostCommentForPullRequest");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<PostCommentForPullRequestResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new PostCommentForPullRequestResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
208,200
public JSDynamicObject with(Object thisObj, Object temporalDateLike, Object optParam, @Cached("createKeys(getContext())") EnumerableOwnPropertyNamesNode nameNode, @Cached("create(getContext())") TemporalCalendarFieldsNode calendarFieldsNode) {<NEW_LINE>JSTemporalPlainDateObject temporalDate = requireTemporalDate(thisObj);<NEW_LINE>if (!isObject(temporalDateLike)) {<NEW_LINE>errorBranch.enter();<NEW_LINE>throw Errors.createTypeError("Object expected");<NEW_LINE>}<NEW_LINE>TemporalUtil.rejectTemporalCalendarType((JSDynamicObject) temporalDateLike, errorBranch);<NEW_LINE>Object calendarProperty = JSObject.get((JSDynamicObject) temporalDateLike, CALENDAR);<NEW_LINE>if (calendarProperty != Undefined.instance) {<NEW_LINE>errorBranch.enter();<NEW_LINE>throw TemporalErrors.createTypeErrorUnexpectedCalendar();<NEW_LINE>}<NEW_LINE>Object timeZoneProperty = JSObject.get((JSDynamicObject) temporalDateLike, TIME_ZONE);<NEW_LINE>if (timeZoneProperty != Undefined.instance) {<NEW_LINE>errorBranch.enter();<NEW_LINE>throw TemporalErrors.createTypeErrorUnexpectedTimeZone();<NEW_LINE>}<NEW_LINE>JSDynamicObject calendar = temporalDate.getCalendar();<NEW_LINE>List<TruffleString> fieldNames = calendarFieldsNode.execute(calendar, TemporalUtil.listDMMCY);<NEW_LINE>JSDynamicObject partialDate = TemporalUtil.preparePartialTemporalFields(getContext(), (JSDynamicObject) temporalDateLike, fieldNames);<NEW_LINE>JSDynamicObject options = getOptionsObject(optParam);<NEW_LINE>JSDynamicObject fields = TemporalUtil.prepareTemporalFields(getContext(), <MASK><NEW_LINE>fields = TemporalUtil.calendarMergeFields(getContext(), nameNode, calendar, fields, partialDate);<NEW_LINE>fields = TemporalUtil.prepareTemporalFields(getContext(), fields, fieldNames, TemporalUtil.listEmpty);<NEW_LINE>return TemporalUtil.dateFromFields(calendar, fields, options);<NEW_LINE>}
temporalDate, fieldNames, TemporalUtil.listEmpty);
76,700
// Driver function<NEW_LINE>public static void main(String[] args) {<NEW_LINE>int[] wt = { 6, 10, 3, 5, 1, 2 };<NEW_LINE>int[] val = { 12, 30, <MASK><NEW_LINE>// storing number of items<NEW_LINE>int nItems = wt.length;<NEW_LINE>Item[] arr = new Item[nItems];<NEW_LINE>for (int i = 0; i < nItems; i++) arr[i] = new Item(val[i], wt[i]);<NEW_LINE>// Knapsack Capacity<NEW_LINE>int Capacity = 12;<NEW_LINE>// Call to Knapsack function<NEW_LINE>FractionalKnapsack obj = new FractionalKnapsack();<NEW_LINE>double value = obj.fractionalKnapsackProblem(arr, nItems, Capacity);<NEW_LINE>System.out.println("The maximum profit that can be obtained is :" + value);<NEW_LINE>}
15, 20, 5, 12 };
1,766,354
private void invoke_lambda(final JSONObject action, final JSONObject data, final JSONObject options, final Context context) {<NEW_LINE>try {<NEW_LINE>// construct lambda<NEW_LINE>JSONObject lambda = new JSONObject();<NEW_LINE>lambda.put("type", "$lambda");<NEW_LINE>JSONObject args = new JSONObject();<NEW_LINE>args.put("name"<MASK><NEW_LINE>if (options != null) {<NEW_LINE>args.put("options", options);<NEW_LINE>}<NEW_LINE>lambda.put("options", args);<NEW_LINE>if (action.has("success")) {<NEW_LINE>lambda.put("success", action.get("success"));<NEW_LINE>}<NEW_LINE>if (action.has("error")) {<NEW_LINE>lambda.put("error", action.get("error"));<NEW_LINE>}<NEW_LINE>call(lambda.toString(), data.toString(), "{}", context);<NEW_LINE>} catch (Exception e) {<NEW_LINE>Log.d("Warning", e.getStackTrace()[0].getMethodName() + " : " + e.toString());<NEW_LINE>}<NEW_LINE>}
, action.getString("trigger"));
67,903
private void initPersistedHosts() {<NEW_LINE>if (HostsSupport.storageDirectoryExists()) {<NEW_LINE>File storageDir = HostsSupport.getStorageDirectory();<NEW_LINE>File[] files = storageDir.listFiles(new FilenameFilter() {<NEW_LINE><NEW_LINE>public boolean accept(File dir, String name) {<NEW_LINE>return name.endsWith(Storage.DEFAULT_PROPERTIES_EXT);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>Set<File> unresolvedHostsF = new HashSet();<NEW_LINE>Set<String> unresolvedHostsS = new HashSet();<NEW_LINE>Set<RemoteHostImpl> hosts = new HashSet();<NEW_LINE>for (File file : files) {<NEW_LINE>if (HostsSupportImpl.LOCALHOST_PROPERTIES_FILENAME.equals(file.getName()))<NEW_LINE>continue;<NEW_LINE>Storage storage = new Storage(storageDir, file.getName());<NEW_LINE>String hostName = storage.getCustomProperty(PROPERTY_HOSTNAME);<NEW_LINE>RemoteHostImpl persistedHost = null;<NEW_LINE>try {<NEW_LINE>persistedHost = new RemoteHostImpl(hostName, storage);<NEW_LINE>} catch (Exception e) {<NEW_LINE>// NOI18N<NEW_LINE>LOGGER.throwing(HostProvider.class.getName(), "initPersistedHosts", e);<NEW_LINE>unresolvedHostsF.add(file);<NEW_LINE>unresolvedHostsS.add(hostName);<NEW_LINE>}<NEW_LINE>if (persistedHost != null)<NEW_LINE>hosts.add(persistedHost);<NEW_LINE>}<NEW_LINE>if (!unresolvedHostsF.isEmpty())<NEW_LINE>notifyUnresolvedHosts(unresolvedHostsF, unresolvedHostsS);<NEW_LINE>RemoteHostsContainer.sharedInstance().<MASK><NEW_LINE>}<NEW_LINE>}
getRepository().addDataSources(hosts);
940,915
public static DescribeInstanceSpecificationsResponse unmarshall(DescribeInstanceSpecificationsResponse describeInstanceSpecificationsResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeInstanceSpecificationsResponse.setRequestId<MASK><NEW_LINE>describeInstanceSpecificationsResponse.setCode(_ctx.stringValue("DescribeInstanceSpecificationsResponse.Code"));<NEW_LINE>describeInstanceSpecificationsResponse.setMessage(_ctx.stringValue("DescribeInstanceSpecificationsResponse.Message"));<NEW_LINE>describeInstanceSpecificationsResponse.setSuccess(_ctx.booleanValue("DescribeInstanceSpecificationsResponse.Success"));<NEW_LINE>describeInstanceSpecificationsResponse.setErrorCode(_ctx.stringValue("DescribeInstanceSpecificationsResponse.ErrorCode"));<NEW_LINE>describeInstanceSpecificationsResponse.setTraceId(_ctx.stringValue("DescribeInstanceSpecificationsResponse.TraceId"));<NEW_LINE>List<DataItem> data = new ArrayList<DataItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeInstanceSpecificationsResponse.Data.Length"); i++) {<NEW_LINE>DataItem dataItem = new DataItem();<NEW_LINE>dataItem.setCpu(_ctx.integerValue("DescribeInstanceSpecificationsResponse.Data[" + i + "].Cpu"));<NEW_LINE>dataItem.setEnable(_ctx.booleanValue("DescribeInstanceSpecificationsResponse.Data[" + i + "].Enable"));<NEW_LINE>dataItem.setId(_ctx.integerValue("DescribeInstanceSpecificationsResponse.Data[" + i + "].Id"));<NEW_LINE>dataItem.setMemory(_ctx.integerValue("DescribeInstanceSpecificationsResponse.Data[" + i + "].Memory"));<NEW_LINE>dataItem.setSpecInfo(_ctx.stringValue("DescribeInstanceSpecificationsResponse.Data[" + i + "].SpecInfo"));<NEW_LINE>dataItem.setVersion(_ctx.integerValue("DescribeInstanceSpecificationsResponse.Data[" + i + "].Version"));<NEW_LINE>data.add(dataItem);<NEW_LINE>}<NEW_LINE>describeInstanceSpecificationsResponse.setData(data);<NEW_LINE>return describeInstanceSpecificationsResponse;<NEW_LINE>}
(_ctx.stringValue("DescribeInstanceSpecificationsResponse.RequestId"));
639,789
public ApiResponse handleApiAction(String name, JSONObject params) throws ApiException {<NEW_LINE>RuleConfig rc;<NEW_LINE>switch(name) {<NEW_LINE>case ACTION_SET_RULE_CONFIG_VALUE:<NEW_LINE>rc = extension.getRuleConfig(params.getString(PARAM_KEY));<NEW_LINE>if (rc != null) {<NEW_LINE>if (params.containsKey(PARAM_VALUE)) {<NEW_LINE>extension.setRuleConfigValue(rc.getKey(), params.getString(PARAM_VALUE));<NEW_LINE>} else {<NEW_LINE>extension.setRuleConfigValue(rc.getKey(), "");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new ApiException(ApiException.Type.DOES_NOT_EXIST, PARAM_KEY);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case ACTION_RESET_RULE_CONFIG_VALUE:<NEW_LINE>rc = extension.getRuleConfig(params.getString(PARAM_KEY));<NEW_LINE>if (rc != null) {<NEW_LINE>extension.<MASK><NEW_LINE>} else {<NEW_LINE>throw new ApiException(ApiException.Type.DOES_NOT_EXIST, PARAM_KEY);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case ACTION_RESET_ALL_RULE_CONFIG_VALUES:<NEW_LINE>extension.resetAllRuleConfigValues();<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new ApiException(ApiException.Type.BAD_ACTION);<NEW_LINE>}<NEW_LINE>return ApiResponseElement.OK;<NEW_LINE>}
resetRuleConfigValue(rc.getKey());
683,040
protected void initChannel(NioSocketChannel ch) throws Exception {<NEW_LINE>if (_sslContext != null) {<NEW_LINE>ch.pipeline().addLast(SessionResumptionSslHandler.PIPELINE_SESSION_RESUMPTION_HANDLER, new SessionResumptionSslHandler(_sslContext, _sslParameters, _enableSSLSessionResumption, _sslSessionTimeout));<NEW_LINE>}<NEW_LINE>ch.pipeline().addLast("codec", new HttpClientCodec(4096, _maxHeaderSize, _maxChunkSize));<NEW_LINE>ch.pipeline().addLast("dechunker", new HttpObjectAggregator(_maxResponseSize));<NEW_LINE>ch.pipeline().addLast<MASK><NEW_LINE>// the response handler catches the exceptions thrown by other layers. By consequence no handlers that throw exceptions<NEW_LINE>// should be after this one, otherwise the exception won't be caught and managed by R2<NEW_LINE>ch.pipeline().addLast("responseHandler", _responseHandler);<NEW_LINE>ch.pipeline().addLast("channelManager", _handler);<NEW_LINE>}
("rapiCodec", new RAPClientCodec());
435,804
static <T> Supplier<Future<T>> decorateFuture(CircuitBreaker circuitBreaker, Supplier<Future<T>> supplier) {<NEW_LINE>return () -> {<NEW_LINE>final Future<T> future = Future.future();<NEW_LINE>if (!circuitBreaker.tryAcquirePermission()) {<NEW_LINE>future.fail(createCallNotPermittedException(circuitBreaker));<NEW_LINE>} else {<NEW_LINE>long start = System.nanoTime();<NEW_LINE>try {<NEW_LINE>supplier.get().setHandler(result -> {<NEW_LINE>long durationInNanos = System.nanoTime() - start;<NEW_LINE>if (result.failed()) {<NEW_LINE>circuitBreaker.onError(durationInNanos, TimeUnit.NANOSECONDS, result.cause());<NEW_LINE>future.<MASK><NEW_LINE>} else {<NEW_LINE>circuitBreaker.onResult(durationInNanos, TimeUnit.NANOSECONDS, result);<NEW_LINE>future.complete(result.result());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (Exception exception) {<NEW_LINE>long durationInNanos = System.nanoTime() - start;<NEW_LINE>circuitBreaker.onError(durationInNanos, TimeUnit.NANOSECONDS, exception);<NEW_LINE>future.fail(exception);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return future;<NEW_LINE>};<NEW_LINE>}
fail(result.cause());
1,333,034
public void delete(@PathParam("envName") String envName, @PathParam("stageName") String stageName, @Context SecurityContext sc) throws Exception {<NEW_LINE>EnvironBean envBean = Utils.getEnvStage(environDAO, envName, stageName);<NEW_LINE>authorizer.authorize(sc, new Resource(envBean.getEnv_name(), Resource.Type.ENV), Role.OPERATOR);<NEW_LINE>String operator = sc.getUserPrincipal().getName();<NEW_LINE><MASK><NEW_LINE>if (constraintId == null) {<NEW_LINE>LOG.warn("Environment {} does not have deploy constraint set up.", envBean);<NEW_LINE>} else {<NEW_LINE>envBean.setDeploy_constraint_id(null);<NEW_LINE>// remove the link between environ and deploy_constraint<NEW_LINE>environDAO.deleteConstraint(envName, stageName);<NEW_LINE>// remove the deploy_constraint<NEW_LINE>deployConstraintDAO.delete(constraintId);<NEW_LINE>LOG.info("Successfully deleted deploy constraint {} for env {}/{} by {}.", constraintId, envName, stageName, operator);<NEW_LINE>}<NEW_LINE>}
String constraintId = envBean.getDeploy_constraint_id();
318,183
protected void parse(final ProtocolFactory protocols, final Local file) throws AccessDeniedException {<NEW_LINE>NSDictionary serialized = NSDictionary.dictionaryWithContentsOfFile(file.getAbsolute());<NEW_LINE>if (null == serialized) {<NEW_LINE>throw new LocalAccessDeniedException(String.format("Invalid bookmark file %s", file));<NEW_LINE>}<NEW_LINE>NSDictionary dict = new PlistDeserializer(serialized).objectForKey("Shortcuts v2");<NEW_LINE>if (null == dict) {<NEW_LINE>throw new LocalAccessDeniedException(String.format("Invalid bookmark file %s", file));<NEW_LINE>}<NEW_LINE>dict = new PlistDeserializer(dict).objectForKey("Shortcuts");<NEW_LINE>if (null == dict) {<NEW_LINE>throw new LocalAccessDeniedException(String.format("Invalid bookmark file %s", file));<NEW_LINE>}<NEW_LINE>List<NSDictionary> shortcuts = new PlistDeserializer(dict).listForKey("Shortcuts");<NEW_LINE>for (NSDictionary shortcut : shortcuts) {<NEW_LINE>PlistDeserializer reader = new PlistDeserializer(shortcut);<NEW_LINE>NSDictionary remote = reader.objectForKey("Remote Item");<NEW_LINE>if (null == remote) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>NSDictionary location = new PlistDeserializer<MASK><NEW_LINE>if (null == location) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>String url = new PlistDeserializer(location).stringForKey("URL");<NEW_LINE>if (null == url) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>final Host host;<NEW_LINE>try {<NEW_LINE>host = new HostParser(protocols).get(url);<NEW_LINE>} catch (HostParserException e) {<NEW_LINE>log.warn(e);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>host.setNickname(reader.stringForKey("Name"));<NEW_LINE>this.add(host);<NEW_LINE>}<NEW_LINE>}
(remote).objectForKey("Location");
742,842
public void run(WorkingCopy workingCopy) throws Exception {<NEW_LINE>workingCopy.toPhase(JavaSource.Phase.RESOLVED);<NEW_LINE>TypeElement clazz = classHandle.resolve(workingCopy);<NEW_LINE>if (clazz != null) {<NEW_LINE>GenerationUtils genUtils = GenerationUtils.newInstance(workingCopy);<NEW_LINE>AnnotationTree annTree = genUtils.createAnnotation(annotationClass);<NEW_LINE>Tree elemTree = workingCopy.getTrees().getTree(elemHandle.resolve(workingCopy));<NEW_LINE>Tree newElemTree = null;<NEW_LINE>switch(elemTree.getKind()) {<NEW_LINE>case ANNOTATION_TYPE:<NEW_LINE>case CLASS:<NEW_LINE>case ENUM:<NEW_LINE>case INTERFACE:<NEW_LINE>newElemTree = genUtils.addAnnotation((ClassTree) elemTree, annTree);<NEW_LINE>break;<NEW_LINE>case METHOD:<NEW_LINE>newElemTree = genUtils.addAnnotation<MASK><NEW_LINE>break;<NEW_LINE>case VARIABLE:<NEW_LINE>newElemTree = genUtils.addAnnotation((VariableTree) elemTree, annTree);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (newElemTree != null) {<NEW_LINE>workingCopy.rewrite(elemTree, newElemTree);<NEW_LINE>} else {<NEW_LINE>throw new IllegalStateException("Unsupported element type");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
((MethodTree) elemTree, annTree);
826,454
public void createWithByForField(AccessLevel level, EclipseNode fieldNode, EclipseNode sourceNode, boolean whineIfExists, List<Annotation> onMethod) {<NEW_LINE>ASTNode source = sourceNode.get();<NEW_LINE>if (fieldNode.getKind() != Kind.FIELD) {<NEW_LINE>sourceNode.addError("@WithBy is only supported on a class or a field.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>EclipseNode typeNode = fieldNode.up();<NEW_LINE>boolean makeAbstract = typeNode != null && typeNode.getKind() == Kind.TYPE && (((TypeDeclaration) typeNode.get()).modifiers & ClassFileConstants.AccAbstract) != 0;<NEW_LINE>FieldDeclaration field = (FieldDeclaration) fieldNode.get();<NEW_LINE>TypeReference fieldType = copyType(field.type, source);<NEW_LINE>boolean isBoolean = isBoolean(fieldType);<NEW_LINE>AnnotationValues<Accessors> accessors = getAccessorsForField(fieldNode);<NEW_LINE>String withName = <MASK><NEW_LINE>if (withName == null) {<NEW_LINE>fieldNode.addWarning("Not generating a withXBy method for this field: It does not fit your @Accessors prefix list.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if ((field.modifiers & ClassFileConstants.AccStatic) != 0) {<NEW_LINE>fieldNode.addWarning("Not generating " + withName + " for this field: With methods cannot be generated for static fields.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if ((field.modifiers & ClassFileConstants.AccFinal) != 0 && field.initialization != null) {<NEW_LINE>fieldNode.addWarning("Not generating " + withName + " for this field: With methods cannot be generated for final, initialized fields.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (field.name != null && field.name.length > 0 && field.name[0] == '$') {<NEW_LINE>fieldNode.addWarning("Not generating " + withName + " for this field: With methods cannot be generated for fields starting with $.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (String altName : toAllWithByNames(fieldNode, isBoolean, accessors)) {<NEW_LINE>switch(methodExists(altName, fieldNode, false, 1)) {<NEW_LINE>case EXISTS_BY_LOMBOK:<NEW_LINE>return;<NEW_LINE>case EXISTS_BY_USER:<NEW_LINE>if (whineIfExists) {<NEW_LINE>String altNameExpl = "";<NEW_LINE>if (!altName.equals(withName))<NEW_LINE>altNameExpl = String.format(" (%s)", altName);<NEW_LINE>fieldNode.addWarning(String.format("Not generating %s(): A method with that name already exists%s", withName, altNameExpl));<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>default:<NEW_LINE>case NOT_EXISTS:<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int modifier = toEclipseModifier(level);<NEW_LINE>MethodDeclaration method = createWithBy((TypeDeclaration) fieldNode.up().get(), fieldNode, withName, modifier, sourceNode, onMethod, makeAbstract);<NEW_LINE>injectMethod(fieldNode.up(), method);<NEW_LINE>}
toWithByName(fieldNode, isBoolean, accessors);
1,729,557
private static byte[] readJ2EENameBytes(byte[] bytes) throws CSIException {<NEW_LINE>int j2eeNameLength = 0;<NEW_LINE>int j2eeNameIndex = HEADER_LEN + BEAN_TYPE_LEN;<NEW_LINE>// LIDB2775-23.0 Begins<NEW_LINE>if (EJSPlatformHelper.isZOS()) {<NEW_LINE>j2eeNameLength = ((bytes[j2eeNameIndex + 0] & 0xff) << 24) | ((bytes[j2eeNameIndex + 1] & 0xff) << 16) | ((bytes[j2eeNameIndex + 2] & 0xff) << 8) | ((bytes[j2eeNameIndex + 3] & 0xff));<NEW_LINE>} else {<NEW_LINE>j2eeNameLength = ((bytes[j2eeNameIndex + 0] & 0xff)) | ((bytes[j2eeNameIndex + 1] & 0xff) << 8) | ((bytes[j2eeNameIndex + 2] & 0xff) << 16) | ((bytes[j2eeNameIndex + 3] & 0xff) << 24);<NEW_LINE>}<NEW_LINE>// LIDB2775-23.0 Ends<NEW_LINE>j2eeNameIndex += J2EE_NAME_LEN;<NEW_LINE>if (// d716926<NEW_LINE>j2eeNameIndex + j2eeNameLength > bytes.length) {<NEW_LINE>String message = "Invalid J2EEName length: " + j2eeNameLength + " + " + j2eeNameIndex + " > " + bytes.length;<NEW_LINE>if (j2eeNameLength >= (1 << 24)) {<NEW_LINE>int <MASK><NEW_LINE>if (j2eeNameIndex + j2eeNameLengthReversed < (1 << 24)) {<NEW_LINE>message += " (length " + j2eeNameLengthReversed + " written in a different byte order?)";<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw new CSIException(message);<NEW_LINE>}<NEW_LINE>byte[] temp = new byte[j2eeNameLength];<NEW_LINE>System.arraycopy(bytes, j2eeNameIndex, temp, 0, j2eeNameLength);<NEW_LINE>return temp;<NEW_LINE>}
j2eeNameLengthReversed = Integer.reverseBytes(j2eeNameLength);
855,069
protected void initColumns(LinkedList idxs) {<NEW_LINE>List<String> <MASK><NEW_LINE>String name, info;<NEW_LINE>int start, end;<NEW_LINE>try {<NEW_LINE>for (int i = 0; i < idxs.size(); i++) {<NEW_LINE>info = idxs.get(i).toString();<NEW_LINE>start = info.indexOf('.');<NEW_LINE>end = info.lastIndexOf('.');<NEW_LINE>name = info.substring(0, start);<NEW_LINE>if (name.equals(this.getName().getName()))<NEW_LINE>columnsList.add(info.substring(start + 1, end));<NEW_LINE>}<NEW_LINE>for (int i = 0; i < columnsList.size(); i++) {<NEW_LINE>ColumnElement c = ((IndexElement) element).getDeclaringTable().getColumn(DBIdentifier.create(columnsList.get(i).toString()));<NEW_LINE>if (c != null)<NEW_LINE>changeColumns(new ColumnElement[] { c }, DBElement.Impl.ADD);<NEW_LINE>}<NEW_LINE>} catch (Exception exc) {<NEW_LINE>exc.printStackTrace();<NEW_LINE>}<NEW_LINE>}
columnsList = new LinkedList<>();
556,159
BulkData updateBulkData(int endBulk) throws IOException {<NEW_LINE>BulkData last = null;<NEW_LINE>for (int i = 1; i <= endBulk; i++) {<NEW_LINE>BulkData bulk = null;<NEW_LINE>long bulkOffset = -1;<NEW_LINE>int bulkLength = -1;<NEW_LINE>synchronized (fragments) {<NEW_LINE>if (i < fragments.size()) {<NEW_LINE>bulk = (<MASK><NEW_LINE>bulkOffset = bulk.offset();<NEW_LINE>bulkLength = bulk.length();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (bulkOffset == -1) {<NEW_LINE>long testOffset = last.offset() + (0xFFFFFFFFl & last.length());<NEW_LINE>bulk = readBulkAt(testOffset, i);<NEW_LINE>} else if (bulkLength == -1) {<NEW_LINE>bulk = readBulkAt(bulkOffset - 8, i);<NEW_LINE>}<NEW_LINE>if (bulk == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>last = bulk;<NEW_LINE>}<NEW_LINE>return last;<NEW_LINE>}
BulkData) fragments.get(i);
321,749
public void depose(NutConfig config) {<NEW_LINE>if (log.isInfoEnabled())<NEW_LINE>log.infof(<MASK><NEW_LINE>Stopwatch sw = Stopwatch.begin();<NEW_LINE>// Firstly, upload the user customized desctroy<NEW_LINE>try {<NEW_LINE>Setup setup = config.getAttributeAs(Setup.class, Setup.class.getName());<NEW_LINE>if (null != setup)<NEW_LINE>setup.destroy(config);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new LoadingException(e);<NEW_LINE>} finally {<NEW_LINE>SessionProvider sp = config.getSessionProvider();<NEW_LINE>if (sp != null)<NEW_LINE>sp.notifyStop();<NEW_LINE>// If the application has Ioc, depose it<NEW_LINE>Ioc ioc = config.getIoc();<NEW_LINE>if (null != ioc)<NEW_LINE>ioc.depose();<NEW_LINE>}<NEW_LINE>// Done, print info<NEW_LINE>sw.stop();<NEW_LINE>if (log.isInfoEnabled())<NEW_LINE>log.infof("Nutz.Mvc[%s] is down in %sms", config.getAppName(), sw.getDuration());<NEW_LINE>}
"Nutz.Mvc[%s] is deposing ...", config.getAppName());
567,168
public View onCreateView(LayoutInflater inflater, final ViewGroup container, Bundle savedInstanceState) {<NEW_LINE>logDebug("onCreateView");<NEW_LINE>display = ((Activity) context).getWindowManager().getDefaultDisplay();<NEW_LINE>outMetrics = new DisplayMetrics();<NEW_LINE>display.getMetrics(outMetrics);<NEW_LINE>density = getResources().getDisplayMetrics().density;<NEW_LINE>View v = inflater.inflate(R.<MASK><NEW_LINE>listView = (RecyclerView) v.findViewById(R.id.notifications_list_view);<NEW_LINE>listView.setClipToPadding(false);<NEW_LINE>mLayoutManager = new LinearLayoutManager(context);<NEW_LINE>listView.setHasFixedSize(true);<NEW_LINE>listView.setItemAnimator(new DefaultItemAnimator());<NEW_LINE>listView.addOnScrollListener(new RecyclerView.OnScrollListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onScrolled(RecyclerView recyclerView, int dx, int dy) {<NEW_LINE>super.onScrolled(recyclerView, dx, dy);<NEW_LINE>if (context instanceof ManagerActivity) {<NEW_LINE>checkScroll();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>listView.setLayoutManager(mLayoutManager);<NEW_LINE>emptyLayout = (RelativeLayout) v.findViewById(R.id.empty_layout_notifications);<NEW_LINE>emptyTextView = (TextView) v.findViewById(R.id.empty_text_notifications);<NEW_LINE>emptyImageView = (ImageView) v.findViewById(R.id.empty_image_view_notifications);<NEW_LINE>mainRelativeLayout = (RelativeLayout) v.findViewById(R.id.main_relative_layout_notifications);<NEW_LINE>setNotifications();<NEW_LINE>return v;<NEW_LINE>}
layout.notifications_fragment, container, false);
1,260,375
public XChartPanel<XYChart> buildPanel() throws IOException {<NEW_LINE>System.out.println("fetching data...");<NEW_LINE>updateData();<NEW_LINE>// create chart<NEW_LINE>chart = new XYChartBuilder().width(800).height(400).title("Real-time Bitcoinium Order Book - BITSTAMP_BTC_USD").xAxisTitle("BTC").yAxisTitle("USD").build();<NEW_LINE>// Customize Chart<NEW_LINE>chart.getStyler().setLegendPosition(LegendPosition.InsideNE);<NEW_LINE>chart.getStyler().setDefaultSeriesRenderStyle(XYSeriesRenderStyle.Area);<NEW_LINE>// add series<NEW_LINE>XYSeries series = chart.<MASK><NEW_LINE>series.setMarker(SeriesMarkers.NONE);<NEW_LINE>series = chart.addSeries(ASKS_SERIES_NAME, xAxisAskData, yAxisAskData);<NEW_LINE>series.setMarker(SeriesMarkers.NONE);<NEW_LINE>return new XChartPanel<>(chart);<NEW_LINE>}
addSeries(BIDS_SERIES_NAME, xAxisBidData, yAxisBidData);
1,274,604
public CommonDialogLoading init(Context context, final Runnable onCancelListener) {<NEW_LINE>super.init(context, new DialogLayoutCallback() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int bindTheme() {<NEW_LINE>return R.style.CommonLoadingDialogStyle;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int bindLayout() {<NEW_LINE>return R.layout.common_dialog_loading;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void initView(BaseDialogFragment dialog, View contentView) {<NEW_LINE>if (onCancelListener == null) {<NEW_LINE>setCancelable(false);<NEW_LINE>} else {<NEW_LINE>setCancelable(true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void setWindowStyle(final Window window) {<NEW_LINE>window.setLayout(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT);<NEW_LINE>BarUtils.<MASK><NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onCancel(BaseDialogFragment dialog) {<NEW_LINE>if (onCancelListener != null) {<NEW_LINE>onCancelListener.run();<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onDismiss(BaseDialogFragment dialog) {<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return this;<NEW_LINE>}
setStatusBarColor(window, Color.TRANSPARENT);
946,790
protected void handleUrlLoad(Uri uri) {<NEW_LINE>if (!uri.getScheme().equals("comment")) {<NEW_LINE>super.handleUrlLoad(uri);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int line = Integer.parseInt(uri.getQueryParameter("position"));<NEW_LINE>int leftLine = Integer.parseInt(uri.getQueryParameter("l"));<NEW_LINE>int rightLine = Integer.parseInt(uri.getQueryParameter("r"));<NEW_LINE>boolean isRightLine = Boolean.parseBoolean<MASK><NEW_LINE>String lineText = mDiffLines[line];<NEW_LINE>String idParam = uri.getQueryParameter("id");<NEW_LINE>long id = idParam != null ? Long.parseLong(idParam) : 0L;<NEW_LINE>CommentActionPopup p = new CommentActionPopup(id, line, lineText, leftLine, rightLine, mLastTouchDown.x, mLastTouchDown.y, isRightLine);<NEW_LINE>p.show();<NEW_LINE>}
(uri.getQueryParameter("isRightLine"));
649,930
public void generate(TypeElement e) throws IOException {<NEW_LINE>Map<String, HashSet<ExecutableElement>> methodsPerAttribute = methodsPerAttributeMapping(e);<NEW_LINE>String className = e.getQualifiedName().toString();<NEW_LINE>String packageName = null;<NEW_LINE>int lastDot = className.lastIndexOf('.');<NEW_LINE>if (lastDot > 0) {<NEW_LINE>packageName = <MASK><NEW_LINE>}<NEW_LINE>String simpleClassName = className.substring(lastDot + 1);<NEW_LINE>String mapFieldsClassName = className + "Fields";<NEW_LINE>String mapSimpleFieldsClassName = simpleClassName + "Fields";<NEW_LINE>JavaFileObject file = processingEnv.getFiler().createSourceFile(mapFieldsClassName);<NEW_LINE>try (PrintWriter pw = new PrintWriterNoJavaLang(file.openWriter())) {<NEW_LINE>if (packageName != null) {<NEW_LINE>pw.println("package " + packageName + ";");<NEW_LINE>}<NEW_LINE>pw.println("public enum " + mapSimpleFieldsClassName + " implements " + FQN_ENTITY_FIELD + "<" + className + "> {");<NEW_LINE>methodsPerAttribute.keySet().stream().sorted(NameFirstComparator.ID_INSTANCE).forEach(key -> {<NEW_LINE>pw.println(" " + toEnumConstant(key) + " {");<NEW_LINE>printEntityFieldMethods(pw, className, key, methodsPerAttribute.get(key));<NEW_LINE>pw.println(" },");<NEW_LINE>});<NEW_LINE>pw.println("}");<NEW_LINE>}<NEW_LINE>}
className.substring(0, lastDot);
126,328
public void addInitState(ITool tool, TLCState state, long stateFP) {<NEW_LINE>for (int soln = 0; soln < solutions.length; soln++) {<NEW_LINE>OrderOfSolution os = solutions[soln];<NEW_LINE>BEGraph bgraph = bgraphs[soln];<NEW_LINE>int slen = os.getCheckState().length;<NEW_LINE>int alen = os.getCheckAction().length;<NEW_LINE>boolean[] checkStateRes = os.checkState(tool, state);<NEW_LINE>boolean[] checkActionRes = os.checkAction(tool, state, state);<NEW_LINE>// Adding nodes and transitions:<NEW_LINE>if (!os.hasTableau()) {<NEW_LINE>// if there is no tableau ...<NEW_LINE>BEGraphNode node = new BEGraphNode(stateFP);<NEW_LINE>node.setCheckState(checkStateRes);<NEW_LINE>bgraph.addInitNode(node);<NEW_LINE>node.addTransition(node, slen, alen, checkActionRes);<NEW_LINE>bgraph.allNodes.putBENode(node);<NEW_LINE>} else {<NEW_LINE>// if there is tableau ...<NEW_LINE>// Add edges induced by root --> state:<NEW_LINE>int initCnt = os.getTableau().getInitCnt();<NEW_LINE>for (int i = 0; i < initCnt; i++) {<NEW_LINE>TBGraphNode tnode = os.getTableau().getNode(i);<NEW_LINE>if (tnode.isConsistent(state, myTool)) {<NEW_LINE>BTGraphNode destNode = new BTGraphNode(stateFP, tnode.getIndex());<NEW_LINE>destNode.setCheckState(checkStateRes);<NEW_LINE>bgraph.addInitNode(destNode);<NEW_LINE><MASK><NEW_LINE>// Add edges induced by state --> state:<NEW_LINE>addNodesForStut(state, stateFP, destNode, checkStateRes, checkActionRes, os, bgraph);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// we are done with this state:<NEW_LINE>bgraph.allNodes.setDone(stateFP);<NEW_LINE>}<NEW_LINE>}
bgraph.allNodes.putBTNode(destNode);
60,426
public ListDevicesResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListDevicesResult listDevicesResult = new ListDevicesResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return listDevicesResult;<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("Devices", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listDevicesResult.setDevices(new ListUnmarshaller<DeviceSummary>(DeviceSummaryJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("NextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listDevicesResult.setNextToken(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return listDevicesResult;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
367,289
private long parsePositiveLongAscii(final int index, final int length, final int startIndex, final int end) {<NEW_LINE>final byte[] src = byteArray;<NEW_LINE>int i = startIndex;<NEW_LINE>long tally = 0, octet;<NEW_LINE>while ((end - i) >= 8 && isEightDigitAsciiEncodedNumber(octet = UNSAFE.getLong(src, ARRAY_BASE_OFFSET + i))) {<NEW_LINE>if (NATIVE_BYTE_ORDER != LITTLE_ENDIAN) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>tally = (tally * 100_000_000L) + parseEightDigitsLittleEndian(octet);<NEW_LINE>i += 8;<NEW_LINE>}<NEW_LINE>int quartet;<NEW_LINE>while ((end - i) >= 4 && isFourDigitsAsciiEncodedNumber(quartet = UNSAFE.getInt(src, ARRAY_BASE_OFFSET + i))) {<NEW_LINE>if (NATIVE_BYTE_ORDER != LITTLE_ENDIAN) {<NEW_LINE>quartet = Integer.reverseBytes(quartet);<NEW_LINE>}<NEW_LINE>tally = (tally * 10_000L) + parseFourDigitsLittleEndian(quartet);<NEW_LINE>i += 4;<NEW_LINE>}<NEW_LINE>byte digit;<NEW_LINE>while (i < end && isDigit(digit = UNSAFE.getByte(src, ARRAY_BASE_OFFSET + i))) {<NEW_LINE>tally = (tally * 10L) + (digit - 0x30);<NEW_LINE>i++;<NEW_LINE>}<NEW_LINE>if (i != end) {<NEW_LINE>throwParseLongError(index, length);<NEW_LINE>}<NEW_LINE>return tally;<NEW_LINE>}
octet = Long.reverseBytes(octet);
444,140
public void process(BufferedImage image) {<NEW_LINE>input.reshape(image.getWidth(), image.getHeight());<NEW_LINE>noisy.reshape(input.width, input.height);<NEW_LINE>output.reshape(input.width, input.height);<NEW_LINE>deriv.reshape(input.width, input.height);<NEW_LINE>ConvertBufferedImage.convertFromSingle(image, input, imageType);<NEW_LINE>// add noise to the image<NEW_LINE>noisy.setTo(input);<NEW_LINE>GImageMiscOps.addGaussian(noisy, rand, noiseSigma, 0, 255);<NEW_LINE>GPixelMath.boundImage(noisy, 0, 255);<NEW_LINE>// compute edge image for weighted error<NEW_LINE>GImageDerivativeOps.laplace(input, deriv, BorderType.EXTENDED);<NEW_LINE>GPixelMath.abs(deriv, deriv);<NEW_LINE>SwingUtilities.invokeLater(() -> {<NEW_LINE>images.clear();<NEW_LINE>images.add(ConvertBufferedImage.convertTo(output, null, true));<NEW_LINE>images.add(ConvertBufferedImage.convertTo(noisy, null, true));<NEW_LINE>images.add(ConvertBufferedImage.convertTo<MASK><NEW_LINE>info.reset();<NEW_LINE>doRefreshAll();<NEW_LINE>});<NEW_LINE>}
(input, null, true));
172,602
public com.squareup.okhttp.Call leaderboardGetNameCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/leaderboard/name";<NEW_LINE>List<Pair> localVarQueryParams <MASK><NEW_LINE>List<Pair> localVarCollectionQueryParams = 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>final String[] localVarAccepts = { "application/json", "application/xml", "text/xml", "application/javascript", "text/javascript" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null)<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>final String[] localVarContentTypes = { "application/json", "application/x-www-form-urlencoded" };<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>if (progressListener != null) {<NEW_LINE>apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {<NEW_LINE>com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());<NEW_LINE>return originalResponse.newBuilder().body(new ProgressResponseBody(originalResponse.body(), progressListener)).build();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>String[] localVarAuthNames = new String[] { "apiExpires", "apiKey", "apiSignature" };<NEW_LINE>return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);<NEW_LINE>}
= new ArrayList<Pair>();
1,831,588
public static DescribeProjectAttachmentsResponse unmarshall(DescribeProjectAttachmentsResponse describeProjectAttachmentsResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeProjectAttachmentsResponse.setRequestId<MASK><NEW_LINE>describeProjectAttachmentsResponse.setSuccess(_ctx.booleanValue("DescribeProjectAttachmentsResponse.Success"));<NEW_LINE>List<ProjectAttachment> result = new ArrayList<ProjectAttachment>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeProjectAttachmentsResponse.Result.Length"); i++) {<NEW_LINE>ProjectAttachment projectAttachment = new ProjectAttachment();<NEW_LINE>projectAttachment.setFileLinkGmtExpired(_ctx.longValue("DescribeProjectAttachmentsResponse.Result[" + i + "].FileLinkGmtExpired"));<NEW_LINE>projectAttachment.setStepNo(_ctx.integerValue("DescribeProjectAttachmentsResponse.Result[" + i + "].StepNo"));<NEW_LINE>projectAttachment.setAttachmentToken(_ctx.stringValue("DescribeProjectAttachmentsResponse.Result[" + i + "].AttachmentToken"));<NEW_LINE>projectAttachment.setFileName(_ctx.stringValue("DescribeProjectAttachmentsResponse.Result[" + i + "].FileName"));<NEW_LINE>projectAttachment.setOperatorRole(_ctx.stringValue("DescribeProjectAttachmentsResponse.Result[" + i + "].OperatorRole"));<NEW_LINE>projectAttachment.setNodeName(_ctx.stringValue("DescribeProjectAttachmentsResponse.Result[" + i + "].NodeName"));<NEW_LINE>projectAttachment.setOperatorName(_ctx.stringValue("DescribeProjectAttachmentsResponse.Result[" + i + "].OperatorName"));<NEW_LINE>projectAttachment.setFileLink(_ctx.stringValue("DescribeProjectAttachmentsResponse.Result[" + i + "].FileLink"));<NEW_LINE>projectAttachment.setGmtCreate(_ctx.longValue("DescribeProjectAttachmentsResponse.Result[" + i + "].GmtCreate"));<NEW_LINE>projectAttachment.setFileSuffix(_ctx.stringValue("DescribeProjectAttachmentsResponse.Result[" + i + "].FileSuffix"));<NEW_LINE>projectAttachment.setOperator(_ctx.longValue("DescribeProjectAttachmentsResponse.Result[" + i + "].Operator"));<NEW_LINE>projectAttachment.setContent(_ctx.stringValue("DescribeProjectAttachmentsResponse.Result[" + i + "].Content"));<NEW_LINE>projectAttachment.setNodeId(_ctx.longValue("DescribeProjectAttachmentsResponse.Result[" + i + "].NodeId"));<NEW_LINE>projectAttachment.setAttachmentType(_ctx.stringValue("DescribeProjectAttachmentsResponse.Result[" + i + "].AttachmentType"));<NEW_LINE>projectAttachment.setFileSize(_ctx.longValue("DescribeProjectAttachmentsResponse.Result[" + i + "].FileSize"));<NEW_LINE>result.add(projectAttachment);<NEW_LINE>}<NEW_LINE>describeProjectAttachmentsResponse.setResult(result);<NEW_LINE>return describeProjectAttachmentsResponse;<NEW_LINE>}
(_ctx.stringValue("DescribeProjectAttachmentsResponse.RequestId"));
119,386
public static Map<String, List<NetworkAcl>> fetchNetworkACL(BasicSessionCredentials temporaryCredentials, String skipRegions, String accountId, String accountName) {<NEW_LINE>Map<String, List<NetworkAcl>> networkAclMap = new LinkedHashMap<>();<NEW_LINE>AmazonEC2 ec2Client;<NEW_LINE>String expPrefix = InventoryConstants.ERROR_PREFIX_CODE + accountId + InventoryConstants.ERROR_PREFIX_EC2;<NEW_LINE>for (Region region : RegionUtils.getRegions()) {<NEW_LINE>try {<NEW_LINE>if (!skipRegions.contains(region.getName())) {<NEW_LINE>ec2Client = AmazonEC2ClientBuilder.standard().withCredentials(new AWSStaticCredentialsProvider(temporaryCredentials)).withRegion(region.getName()).build();<NEW_LINE>List<NetworkAcl> networkAclList = ec2Client<MASK><NEW_LINE>if (!networkAclList.isEmpty()) {<NEW_LINE>log.debug(InventoryConstants.ACCOUNT + accountId + " Type : EC2 Network Acl " + region.getName() + " >> " + networkAclList.size());<NEW_LINE>networkAclMap.put(accountId + delimiter + accountName + delimiter + region.getName(), networkAclList);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.warn(expPrefix + region.getName() + InventoryConstants.ERROR_CAUSE + e.getMessage() + "\"}");<NEW_LINE>ErrorManageUtil.uploadError(accountId, region.getName(), "networkacl", e.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return networkAclMap;<NEW_LINE>}
.describeNetworkAcls().getNetworkAcls();
126,880
// Change visibility so others can see it<NEW_LINE>@Override<NEW_LINE>public void addURL(URL url) {<NEW_LINE>// if we have such embedded jar within a jar, we copy it to temp file and use the<NEW_LINE>// the temp file with the super URLClassLoader<NEW_LINE>if (url.toString().contains("!/") || !(url.getProtocol().equals("file") || url.getProtocol().equals("http") || url.getProtocol().equals("https"))) {<NEW_LINE>try {<NEW_LINE>File f = File.createTempFile("jruby", new File(url.getFile()).<MASK><NEW_LINE>try (FileOutputStream fileOut = new FileOutputStream(f);<NEW_LINE>InputStream urlIn = url.openStream()) {<NEW_LINE>OutputStream out = new BufferedOutputStream(fileOut);<NEW_LINE>InputStream in = new BufferedInputStream(urlIn);<NEW_LINE>int i = in.read();<NEW_LINE>while (i != -1) {<NEW_LINE>out.write(i);<NEW_LINE>i = in.read();<NEW_LINE>}<NEW_LINE>out.flush();<NEW_LINE>url = f.toURI().toURL();<NEW_LINE>cachedJarPaths.put(URLUtil.getPath(url), url);<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new RuntimeException("BUG: we can not copy embedded jar to temp directory", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>super.addURL(url);<NEW_LINE>}
getName(), getTempDir());
589,712
final SelectAggregateResourceConfigResult executeSelectAggregateResourceConfig(SelectAggregateResourceConfigRequest selectAggregateResourceConfigRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(selectAggregateResourceConfigRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<SelectAggregateResourceConfigRequest> request = null;<NEW_LINE>Response<SelectAggregateResourceConfigResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new SelectAggregateResourceConfigRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(selectAggregateResourceConfigRequest));<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, "Config Service");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "SelectAggregateResourceConfig");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<SelectAggregateResourceConfigResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new SelectAggregateResourceConfigResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
endClientExecution(awsRequestMetrics, request, response);
1,573,574
private void readFromInput(HollowBlobInput in, boolean isDelta) throws IOException {<NEW_LINE>maxOrdinal = VarInt.readVInt(in);<NEW_LINE>if (isDelta) {<NEW_LINE>encodedRemovals = GapEncodedVariableLengthIntegerReader.readEncodedDeltaOrdinals(in, memoryRecycler);<NEW_LINE>encodedAdditions = GapEncodedVariableLengthIntegerReader.readEncodedDeltaOrdinals(in, memoryRecycler);<NEW_LINE>}<NEW_LINE>bitsPerMapPointer = VarInt.readVInt(in);<NEW_LINE>bitsPerMapSizeValue = VarInt.readVInt(in);<NEW_LINE>bitsPerKeyElement = VarInt.readVInt(in);<NEW_LINE>bitsPerValueElement = VarInt.readVInt(in);<NEW_LINE>bitsPerFixedLengthMapPortion = bitsPerMapPointer + bitsPerMapSizeValue;<NEW_LINE>bitsPerMapEntry = bitsPerKeyElement + bitsPerValueElement;<NEW_LINE>emptyBucketKeyValue = (1 << bitsPerKeyElement) - 1;<NEW_LINE>totalNumberOfBuckets = VarInt.readVLong(in);<NEW_LINE>mapPointerAndSizeData = FixedLengthDataFactory.<MASK><NEW_LINE>entryData = FixedLengthDataFactory.get(in, memoryMode, memoryRecycler);<NEW_LINE>}
get(in, memoryMode, memoryRecycler);
1,206,974
private void addDeprecationHeaders(SparkSpringController controller) {<NEW_LINE>boolean isDeprecated = controller.getClass().isAnnotationPresent(DeprecatedAPI.class);<NEW_LINE>if (!isDeprecated) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>DeprecatedAPI deprecated = controller.getClass().getAnnotation(DeprecatedAPI.class);<NEW_LINE>String controllerBasePath, mimeType;<NEW_LINE>try {<NEW_LINE>controllerBasePath = (String) controller.getClass().getMethod("controllerBasePath").invoke(controller);<NEW_LINE>Field field = controller.getClass().<MASK><NEW_LINE>field.setAccessible(true);<NEW_LINE>mimeType = (String) field.get(controller);<NEW_LINE>} catch (NoSuchFieldException | IllegalAccessException | NoSuchMethodException | InvocationTargetException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>path(controllerBasePath, () -> {<NEW_LINE>before("", mimeType, (req, res) -> setDeprecationHeaders(req, res, deprecated));<NEW_LINE>before("/*", mimeType, (req, res) -> setDeprecationHeaders(req, res, deprecated));<NEW_LINE>});<NEW_LINE>}
getSuperclass().getDeclaredField("mimeType");
1,133,860
private String frequencyCounter(String[] words, int minLength) {<NEW_LINE>String title = "BST costs using put() in FrequencyCounter";<NEW_LINE>String xAxisLabel = "operations";<NEW_LINE>String yAxisLabel = "cost";<NEW_LINE>double maxNumberOfOperations = 18000;<NEW_LINE>double maxCost = 50;<NEW_LINE>int originValue = 0;<NEW_LINE>VisualAccumulator visualAccumulator = new VisualAccumulator(originValue, maxNumberOfOperations, maxCost, title, xAxisLabel, yAxisLabel);<NEW_LINE>BinarySearchTreeCostPlots<String, Integer> binarySearchTree = new BinarySearchTreeCostPlots<>();<NEW_LINE>for (String word : words) {<NEW_LINE>if (word.length() < minLength) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>int cost;<NEW_LINE>if (!binarySearchTree.contains(word)) {<NEW_LINE>cost = binarySearchTree.putAndComputeCost(word, 1);<NEW_LINE>} else {<NEW_LINE>cost = binarySearchTree.putAndComputeCost(word, binarySearchTree.get(word) + 1);<NEW_LINE>}<NEW_LINE>visualAccumulator.addDataValue(cost, true);<NEW_LINE>}<NEW_LINE>String max = "";<NEW_LINE>int cost = <MASK><NEW_LINE>visualAccumulator.addDataValue(cost, true);<NEW_LINE>for (String word : binarySearchTree.keys()) {<NEW_LINE>if (binarySearchTree.get(word) > binarySearchTree.get(max)) {<NEW_LINE>max = word;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>visualAccumulator.writeFinalMean();<NEW_LINE>return max + " " + binarySearchTree.get(max);<NEW_LINE>}
binarySearchTree.putAndComputeCost(max, 0);
1,563,636
private I_SEPA_Export createExportHeader(@NonNull final I_C_PaySelection paySelectionHeader) {<NEW_LINE>final PaySelectionTrxType paySelectionTrxType = PaySelectionTrxType.ofNullableCode(paySelectionHeader.getPaySelectionTrxType());<NEW_LINE>if (paySelectionTrxType == null) {<NEW_LINE>throw new FillMandatoryException(false, I_C_PaySelection.COLUMNNAME_PaySelectionTrxType);<NEW_LINE>}<NEW_LINE>final I_SEPA_Export header = newInstance(I_SEPA_Export.class, paySelectionHeader);<NEW_LINE>final SEPAProtocol sepaProtocol = SEPAProtocol.ofPaySelectionTrxType(paySelectionTrxType);<NEW_LINE>header.setSEPA_Protocol(sepaProtocol.getCode());<NEW_LINE>//<NEW_LINE>// We need the source org BP.<NEW_LINE>final I_C_BPartner orgBP = partnerOrgBL.retrieveLinkedBPartner(paySelectionHeader.getAD_Org_ID());<NEW_LINE>final org.compiere.model.I_C_BP_BankAccount bankAccountSource = paySelectionHeader.getC_BP_BankAccount();<NEW_LINE>// mandatory column<NEW_LINE>Check.assumeNotNull(bankAccountSource, "bankAccountSource not null");<NEW_LINE>final I_C_BP_BankAccount bpBankAccount = create(bankAccountSource, I_C_BP_BankAccount.class);<NEW_LINE>// task 09923: In case the bp bank account does not have a bank set, it cannot be used in a SEPA Export<NEW_LINE>final BankId bankId = BankId.ofRepoIdOrNull(bpBankAccount.getC_Bank_ID());<NEW_LINE>if (bankId == null) {<NEW_LINE>throw new AdempiereException(ERR_C_BP_BankAccount_BankNotSet, new Object[] { bpBankAccount.toString() });<NEW_LINE>}<NEW_LINE>// Set corresponding data<NEW_LINE>header.setAD_Org_ID(paySelectionHeader.getAD_Org_ID());<NEW_LINE>final String iban = bpBankAccount.getIBAN();<NEW_LINE>if (Check.isNotBlank(iban)) {<NEW_LINE>header.setIBAN(iban.replaceAll(" ", ""));<NEW_LINE>}<NEW_LINE>header.<MASK><NEW_LINE>header.setProcessed(false);<NEW_LINE>header.setSEPA_CreditorName(orgBP.getName());<NEW_LINE>if (SEPAProtocol.DIRECT_DEBIT_PAIN_008_003_02.equals(sepaProtocol) && Check.isBlank(bpBankAccount.getSEPA_CreditorIdentifier())) {<NEW_LINE>throw new AdempiereException(ERR_C_BP_BankAccount_SEPA_CreditorIdentifierNotSet, new Object[] { bpBankAccount.toString() });<NEW_LINE>}<NEW_LINE>header.setSEPA_CreditorIdentifier(bpBankAccount.getSEPA_CreditorIdentifier());<NEW_LINE>final Bank bank = bankRepo.getById(bankId);<NEW_LINE>if (Check.isBlank(bank.getSwiftCode())) {<NEW_LINE>throw new AdempiereException(ERR_C_Bank_SwiftCodeNotSet, new Object[] { bank.getBankName() });<NEW_LINE>}<NEW_LINE>header.setSwiftCode(bank.getSwiftCode());<NEW_LINE>final int paySelectionTableID = getTableId(I_C_PaySelection.class);<NEW_LINE>header.setAD_Table_ID(paySelectionTableID);<NEW_LINE>header.setRecord_ID(paySelectionHeader.getC_PaySelection_ID());<NEW_LINE>header.setDescription(paySelectionHeader.getDescription());<NEW_LINE>header.setIsExportBatchBookings(paySelectionHeader.isExportBatchBookings());<NEW_LINE>save(header);<NEW_LINE>return header;<NEW_LINE>}
setPaymentDate(paySelectionHeader.getPayDate());
342,904
public void replaceWith(DataType dataType) {<NEW_LINE>if (!(dataType instanceof Enum)) {<NEW_LINE>throw new IllegalArgumentException();<NEW_LINE>}<NEW_LINE>Enum enumm = (Enum) dataType;<NEW_LINE>lock.acquire();<NEW_LINE>try {<NEW_LINE>checkDeleted();<NEW_LINE>bitGroups = null;<NEW_LINE>nameMap = new HashMap<>();<NEW_LINE>valueMap = new TreeMap<>();<NEW_LINE>commentMap = new HashMap<>();<NEW_LINE>Field[] ids = valueAdapter.getValueIdsInEnum(key);<NEW_LINE>for (Field id : ids) {<NEW_LINE>valueAdapter.removeRecord(id.getLongValue());<NEW_LINE>}<NEW_LINE>int oldLength = getLength();<NEW_LINE>int newLength = enumm.getLength();<NEW_LINE>if (oldLength != newLength) {<NEW_LINE>record.setByteValue(EnumDBAdapter.ENUM_SIZE_COL, (byte) newLength);<NEW_LINE>adapter.updateRecord(record, true);<NEW_LINE>}<NEW_LINE>String[] names = enumm.getNames();<NEW_LINE>for (String valueName : names) {<NEW_LINE>long value = enumm.getValue(valueName);<NEW_LINE>String comment = enumm.getComment(valueName);<NEW_LINE>if (StringUtils.isBlank(comment)) {<NEW_LINE>// use null values in the db to save space<NEW_LINE>comment = null;<NEW_LINE>}<NEW_LINE>valueAdapter.createRecord(key, valueName, value, comment);<NEW_LINE>adapter.updateRecord(record, true);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (oldLength != newLength) {<NEW_LINE>notifySizeChanged(false);<NEW_LINE>} else {<NEW_LINE>dataMgr.dataTypeChanged(this, false);<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>dataMgr.dbError(e);<NEW_LINE>} finally {<NEW_LINE>lock.release();<NEW_LINE>}<NEW_LINE>}
addToCache(valueName, value, comment);
450,960
public boolean flushable() throws SIResourceException {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.entry(tc, "flushable");<NEW_LINE>// Short circuit if we've never created a stream<NEW_LINE>if (streamSet == null) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.exit(tc, "flushable", Boolean.TRUE);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>StreamSet streamSet = getStreamSet();<NEW_LINE>// iterate over the non-null streams<NEW_LINE><MASK><NEW_LINE>while (itr.hasNext()) {<NEW_LINE>SourceStream stream = (SourceStream) itr.next();<NEW_LINE>if (!stream.flushable()) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.exit(tc, "flushable", Boolean.FALSE);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.exit(tc, "flushable", Boolean.TRUE);<NEW_LINE>return true;<NEW_LINE>}
Iterator itr = streamSet.iterator();
67,462
private void createBeanSymbol(DOMNode node, IJavaProject project, String docURI, long lastModified, TextDocument document, List<CachedSymbol> generatedSymbols) throws Exception {<NEW_LINE>String beanID = null;<NEW_LINE>int symbolStart = 0;<NEW_LINE>int symbolEnd = 0;<NEW_LINE>String beanClass = null;<NEW_LINE>List<DOMAttr> attributes = node.getAttributeNodes();<NEW_LINE>for (DOMAttr attribute : attributes) {<NEW_LINE>String name = attribute.getName();<NEW_LINE>if (name != null && name.equals("id")) {<NEW_LINE>beanID = attribute.getValue();<NEW_LINE>symbolStart = attribute.getStart();<NEW_LINE>symbolEnd = attribute.getEnd();<NEW_LINE>} else if (name != null && name.equals("class")) {<NEW_LINE>String value = attribute.getValue();<NEW_LINE>beanClass = value.substring(value.lastIndexOf(".") + 1);<NEW_LINE>if (symbolStart == 0 && symbolEnd == 0) {<NEW_LINE>symbolStart = attribute.getStart();<NEW_LINE>symbolEnd = attribute.getEnd();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (beanClass != null) {<NEW_LINE>int lineStart = document.getLineOfOffset(symbolStart);<NEW_LINE>int lineEnd = document.getLineOfOffset(symbolEnd);<NEW_LINE>int startInLine = symbolStart - document.getLineOffset(lineStart);<NEW_LINE>int endInLine = symbolEnd - document.getLineOffset(lineEnd);<NEW_LINE>Range range = new Range();<NEW_LINE>range.setStart(new Position(lineStart, startInLine));<NEW_LINE>range.setEnd(<MASK><NEW_LINE>Location location = new Location();<NEW_LINE>location.setUri(docURI);<NEW_LINE>location.setRange(range);<NEW_LINE>if (beanID == null) {<NEW_LINE>beanID = deriveBeanIDFromClass(beanClass);<NEW_LINE>}<NEW_LINE>SymbolInformation symbol = new SymbolInformation("@+ '" + beanID + "' " + beanClass, SymbolKind.Interface, new Location(docURI, range));<NEW_LINE>SymbolAddOnInformation[] addon = new SymbolAddOnInformation[] { new BeansSymbolAddOnInformation(beanID) };<NEW_LINE>EnhancedSymbolInformation fullSymbol = new EnhancedSymbolInformation(symbol, addon);<NEW_LINE>CachedSymbol cachedSymbol = new CachedSymbol(docURI, lastModified, fullSymbol);<NEW_LINE>generatedSymbols.add(cachedSymbol);<NEW_LINE>}<NEW_LINE>}
new Position(lineEnd, endInLine));
978,114
public static boolean containsTypeAnnotation(AnnotatedType type, Class<? extends Annotation> annotation) {<NEW_LINE>if (type.isAnnotationPresent(annotation)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (type instanceof AnnotatedParameterizedType) {<NEW_LINE>AnnotatedParameterizedType parameterizedType = ((AnnotatedParameterizedType) type);<NEW_LINE>return Arrays.stream(parameterizedType.getAnnotatedActualTypeArguments()).anyMatch(param <MASK><NEW_LINE>}<NEW_LINE>if (type instanceof AnnotatedTypeVariable) {<NEW_LINE>AnnotatedTypeVariable variable = ((AnnotatedTypeVariable) type);<NEW_LINE>return Arrays.stream(variable.getAnnotatedBounds()).anyMatch(bound -> containsTypeAnnotation(bound, annotation));<NEW_LINE>}<NEW_LINE>if (type instanceof AnnotatedWildcardType) {<NEW_LINE>AnnotatedWildcardType wildcard = ((AnnotatedWildcardType) type);<NEW_LINE>return Stream.concat(Arrays.stream(wildcard.getAnnotatedLowerBounds()), Arrays.stream(wildcard.getAnnotatedUpperBounds())).anyMatch(param -> containsTypeAnnotation(param, annotation));<NEW_LINE>}<NEW_LINE>return type instanceof AnnotatedArrayType && containsTypeAnnotation(((AnnotatedArrayType) type).getAnnotatedGenericComponentType(), annotation);<NEW_LINE>}
-> containsTypeAnnotation(param, annotation));
630,630
public JsonArray uniqueDatasetDownloads(String yyyymm, Dataverse d) {<NEW_LINE>// select distinct count(distinct email),dataset_id, date_trunc('month', responsetime) from guestbookresponse group by dataset_id, date_trunc('month',responsetime) order by dataset_id,date_trunc('month',responsetime);<NEW_LINE>Query query = em.createNativeQuery("select ob.protocol || ':' || ob.authority || '/' || ob.identifier as pid, count(distinct email) " + " FROM guestbookresponse gb, DvObject ob" + " where ob.id = gb.dataset_id " + ((d == null) ? "" : " and ob.owner_id in (" + getCommaSeparatedIdStringForSubtree(d, "Dataverse") + ")\n") + " and date_trunc('month', responsetime) <= to_date('" + yyyymm + "','YYYY-MM')\n" + "group by gb.dataset_id, ob.protocol, ob.authority, ob.identifier order by count(distinct email) desc;");<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>List<Object[]> results = query.getResultList();<NEW_LINE>for (Object[] result : results) {<NEW_LINE>JsonObjectBuilder job = Json.createObjectBuilder();<NEW_LINE>job.add(MetricsUtil.PID, (String) result[0]);<NEW_LINE>job.add(MetricsUtil.COUNT, (long) result[1]);<NEW_LINE>jab.add(job);<NEW_LINE>}<NEW_LINE>} catch (javax.persistence.NoResultException nr) {<NEW_LINE>// do nothing<NEW_LINE>}<NEW_LINE>return jab.build();<NEW_LINE>}
JsonArrayBuilder jab = Json.createArrayBuilder();
1,139,110
protected void executeImpl() throws MojoExecutionException, MojoFailureException {<NEW_LINE>File commonDir = getCN1ProjectDir();<NEW_LINE>if (commonDir == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>File rootMavenProjectDir = commonDir.getParentFile();<NEW_LINE>File javaSEDir = new File(rootMavenProjectDir, "javase");<NEW_LINE>if (!javaSEDir.exists()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>InvocationRequest request = new DefaultInvocationRequest();<NEW_LINE>// request.setPomFile( new File( "/path/to/pom.xml" ) );<NEW_LINE>request.setGoals(Arrays.asList("verify"));<NEW_LINE>request.setProfiles(Arrays.asList("debug-simulator"));<NEW_LINE>Properties props = new Properties();<NEW_LINE>props.setProperty("codename1.platform", "javase");<NEW_LINE>props.setProperty("jpda.address", System.getProperty("jpda.address"));<NEW_LINE>request.setProperties(props);<NEW_LINE>request.setBaseDirectory(rootMavenProjectDir);<NEW_LINE>Invoker invoker = new DefaultInvoker();<NEW_LINE>try {<NEW_LINE>invoker.execute(request);<NEW_LINE>} catch (MavenInvocationException ex) {<NEW_LINE>throw new MojoExecutionException(<MASK><NEW_LINE>}<NEW_LINE>}
ex.getMessage(), ex);
1,831,436
public static DescribeCasterConfigResponse unmarshall(DescribeCasterConfigResponse describeCasterConfigResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeCasterConfigResponse.setRequestId<MASK><NEW_LINE>describeCasterConfigResponse.setDelay(_ctx.floatValue("DescribeCasterConfigResponse.Delay"));<NEW_LINE>describeCasterConfigResponse.setCallbackUrl(_ctx.stringValue("DescribeCasterConfigResponse.CallbackUrl"));<NEW_LINE>describeCasterConfigResponse.setUrgentMaterialId(_ctx.stringValue("DescribeCasterConfigResponse.UrgentMaterialId"));<NEW_LINE>describeCasterConfigResponse.setProgramName(_ctx.stringValue("DescribeCasterConfigResponse.ProgramName"));<NEW_LINE>describeCasterConfigResponse.setSideOutputUrl(_ctx.stringValue("DescribeCasterConfigResponse.SideOutputUrl"));<NEW_LINE>describeCasterConfigResponse.setCasterName(_ctx.stringValue("DescribeCasterConfigResponse.CasterName"));<NEW_LINE>describeCasterConfigResponse.setProgramEffect(_ctx.integerValue("DescribeCasterConfigResponse.ProgramEffect"));<NEW_LINE>describeCasterConfigResponse.setCasterId(_ctx.stringValue("DescribeCasterConfigResponse.CasterId"));<NEW_LINE>describeCasterConfigResponse.setChannelEnable(_ctx.integerValue("DescribeCasterConfigResponse.ChannelEnable"));<NEW_LINE>describeCasterConfigResponse.setDomainName(_ctx.stringValue("DescribeCasterConfigResponse.DomainName"));<NEW_LINE>TranscodeConfig transcodeConfig = new TranscodeConfig();<NEW_LINE>transcodeConfig.setCasterTemplate(_ctx.stringValue("DescribeCasterConfigResponse.TranscodeConfig.CasterTemplate"));<NEW_LINE>List<String> liveTemplateIds = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeCasterConfigResponse.TranscodeConfig.LiveTemplateIds.Length"); i++) {<NEW_LINE>liveTemplateIds.add(_ctx.stringValue("DescribeCasterConfigResponse.TranscodeConfig.LiveTemplateIds[" + i + "]"));<NEW_LINE>}<NEW_LINE>transcodeConfig.setLiveTemplateIds(liveTemplateIds);<NEW_LINE>describeCasterConfigResponse.setTranscodeConfig(transcodeConfig);<NEW_LINE>RecordConfig recordConfig = new RecordConfig();<NEW_LINE>recordConfig.setOssEndpoint(_ctx.stringValue("DescribeCasterConfigResponse.RecordConfig.OssEndpoint"));<NEW_LINE>recordConfig.setOssBucket(_ctx.stringValue("DescribeCasterConfigResponse.RecordConfig.OssBucket"));<NEW_LINE>List<RecordFormatItem> recordFormat = new ArrayList<RecordFormatItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeCasterConfigResponse.RecordConfig.RecordFormat.Length"); i++) {<NEW_LINE>RecordFormatItem recordFormatItem = new RecordFormatItem();<NEW_LINE>recordFormatItem.setCycleDuration(_ctx.integerValue("DescribeCasterConfigResponse.RecordConfig.RecordFormat[" + i + "].CycleDuration"));<NEW_LINE>recordFormatItem.setSliceOssObjectPrefix(_ctx.stringValue("DescribeCasterConfigResponse.RecordConfig.RecordFormat[" + i + "].SliceOssObjectPrefix"));<NEW_LINE>recordFormatItem.setOssObjectPrefix(_ctx.stringValue("DescribeCasterConfigResponse.RecordConfig.RecordFormat[" + i + "].OssObjectPrefix"));<NEW_LINE>recordFormatItem.setFormat(_ctx.stringValue("DescribeCasterConfigResponse.RecordConfig.RecordFormat[" + i + "].Format"));<NEW_LINE>recordFormat.add(recordFormatItem);<NEW_LINE>}<NEW_LINE>recordConfig.setRecordFormat(recordFormat);<NEW_LINE>describeCasterConfigResponse.setRecordConfig(recordConfig);<NEW_LINE>List<SyncGroup> syncGroupsConfig = new ArrayList<SyncGroup>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeCasterConfigResponse.SyncGroupsConfig.Length"); i++) {<NEW_LINE>SyncGroup syncGroup = new SyncGroup();<NEW_LINE>syncGroup.setHostResourceId(_ctx.stringValue("DescribeCasterConfigResponse.SyncGroupsConfig[" + i + "].HostResourceId"));<NEW_LINE>syncGroup.setMode(_ctx.integerValue("DescribeCasterConfigResponse.SyncGroupsConfig[" + i + "].Mode"));<NEW_LINE>List<String> resourceIds = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeCasterConfigResponse.SyncGroupsConfig[" + i + "].ResourceIds.Length"); j++) {<NEW_LINE>resourceIds.add(_ctx.stringValue("DescribeCasterConfigResponse.SyncGroupsConfig[" + i + "].ResourceIds[" + j + "]"));<NEW_LINE>}<NEW_LINE>syncGroup.setResourceIds(resourceIds);<NEW_LINE>syncGroupsConfig.add(syncGroup);<NEW_LINE>}<NEW_LINE>describeCasterConfigResponse.setSyncGroupsConfig(syncGroupsConfig);<NEW_LINE>return describeCasterConfigResponse;<NEW_LINE>}
(_ctx.stringValue("DescribeCasterConfigResponse.RequestId"));
577,998
final ListStreamingSessionsResult executeListStreamingSessions(ListStreamingSessionsRequest listStreamingSessionsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listStreamingSessionsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListStreamingSessionsRequest> request = null;<NEW_LINE>Response<ListStreamingSessionsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListStreamingSessionsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listStreamingSessionsRequest));<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, "nimble");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListStreamingSessions");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListStreamingSessionsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListStreamingSessionsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
endClientExecution(awsRequestMetrics, request, response);
1,718,873
public static DescribeRenewalPriceResponse unmarshall(DescribeRenewalPriceResponse describeRenewalPriceResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeRenewalPriceResponse.setRequestId(_ctx.stringValue("DescribeRenewalPriceResponse.RequestId"));<NEW_LINE>Order order = new Order();<NEW_LINE>order.setOriginalAmount(_ctx.floatValue("DescribeRenewalPriceResponse.Order.OriginalAmount"));<NEW_LINE>order.setDiscountAmount(_ctx.floatValue("DescribeRenewalPriceResponse.Order.DiscountAmount"));<NEW_LINE>order.setTradeAmount(_ctx.floatValue("DescribeRenewalPriceResponse.Order.TradeAmount"));<NEW_LINE>order.setCurrency(_ctx.stringValue("DescribeRenewalPriceResponse.Order.Currency"));<NEW_LINE>List<String> ruleIds1 = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeRenewalPriceResponse.Order.RuleIds.Length"); i++) {<NEW_LINE>ruleIds1.add(_ctx.stringValue("DescribeRenewalPriceResponse.Order.RuleIds[" + i + "]"));<NEW_LINE>}<NEW_LINE>order.setRuleIds1(ruleIds1);<NEW_LINE>List<Coupon> coupons = new ArrayList<Coupon>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeRenewalPriceResponse.Order.Coupons.Length"); i++) {<NEW_LINE>Coupon coupon = new Coupon();<NEW_LINE>coupon.setDescription(_ctx.stringValue("DescribeRenewalPriceResponse.Order.Coupons[" + i + "].Description"));<NEW_LINE>coupon.setIsSelected(_ctx.stringValue("DescribeRenewalPriceResponse.Order.Coupons[" + i + "].IsSelected"));<NEW_LINE>coupon.setCouponNo(_ctx.stringValue("DescribeRenewalPriceResponse.Order.Coupons[" + i + "].CouponNo"));<NEW_LINE>coupon.setName(_ctx.stringValue("DescribeRenewalPriceResponse.Order.Coupons[" + i + "].Name"));<NEW_LINE>coupons.add(coupon);<NEW_LINE>}<NEW_LINE>order.setCoupons(coupons);<NEW_LINE>describeRenewalPriceResponse.setOrder(order);<NEW_LINE>List<SubOrder> subOrders = new ArrayList<SubOrder>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeRenewalPriceResponse.SubOrders.Length"); i++) {<NEW_LINE>SubOrder subOrder = new SubOrder();<NEW_LINE>subOrder.setOriginalAmount(_ctx.floatValue("DescribeRenewalPriceResponse.SubOrders[" + i + "].OriginalAmount"));<NEW_LINE>subOrder.setDiscountAmount(_ctx.floatValue<MASK><NEW_LINE>subOrder.setTradeAmount(_ctx.floatValue("DescribeRenewalPriceResponse.SubOrders[" + i + "].TradeAmount"));<NEW_LINE>subOrder.setInstanceId(_ctx.stringValue("DescribeRenewalPriceResponse.SubOrders[" + i + "].InstanceId"));<NEW_LINE>List<String> ruleIds = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeRenewalPriceResponse.SubOrders[" + i + "].RuleIds.Length"); j++) {<NEW_LINE>ruleIds.add(_ctx.stringValue("DescribeRenewalPriceResponse.SubOrders[" + i + "].RuleIds[" + j + "]"));<NEW_LINE>}<NEW_LINE>subOrder.setRuleIds(ruleIds);<NEW_LINE>subOrders.add(subOrder);<NEW_LINE>}<NEW_LINE>describeRenewalPriceResponse.setSubOrders(subOrders);<NEW_LINE>List<Rule> rules = new ArrayList<Rule>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeRenewalPriceResponse.Rules.Length"); i++) {<NEW_LINE>Rule rule = new Rule();<NEW_LINE>rule.setRuleDescId(_ctx.longValue("DescribeRenewalPriceResponse.Rules[" + i + "].RuleDescId"));<NEW_LINE>rule.setTitle(_ctx.stringValue("DescribeRenewalPriceResponse.Rules[" + i + "].Title"));<NEW_LINE>rule.setName(_ctx.stringValue("DescribeRenewalPriceResponse.Rules[" + i + "].Name"));<NEW_LINE>rules.add(rule);<NEW_LINE>}<NEW_LINE>describeRenewalPriceResponse.setRules(rules);<NEW_LINE>return describeRenewalPriceResponse;<NEW_LINE>}
("DescribeRenewalPriceResponse.SubOrders[" + i + "].DiscountAmount"));
1,443,904
final CreateEventBusResult executeCreateEventBus(CreateEventBusRequest createEventBusRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createEventBusRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateEventBusRequest> request = null;<NEW_LINE>Response<CreateEventBusResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateEventBusRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createEventBusRequest));<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, "CloudWatch Events");<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<CreateEventBusResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateEventBusResultJsonUnmarshaller());<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, "CreateEventBus");
831,096
private Float convertToDegree(String stringDMS) {<NEW_LINE>Float result = null;<NEW_LINE>String[] DMS = stringDMS.split(",", 3);<NEW_LINE>String[] stringD = DMS[0].split("/", 2);<NEW_LINE>Double D0 = Double.valueOf(stringD[0]);<NEW_LINE>Double D1 = Double.valueOf(stringD[1]);<NEW_LINE>double FloatD = D0 / D1;<NEW_LINE>String[] stringM = DMS[1<MASK><NEW_LINE>Double M0 = Double.valueOf(stringM[0]);<NEW_LINE>Double M1 = Double.valueOf(stringM[1]);<NEW_LINE>double FloatM = M0 / M1;<NEW_LINE>String[] stringS = DMS[2].split("/", 2);<NEW_LINE>Double S0 = Double.valueOf(stringS[0]);<NEW_LINE>Double S1 = Double.valueOf(stringS[1]);<NEW_LINE>double FloatS = S0 / S1;<NEW_LINE>result = (float) (FloatD + (FloatM / 60) + (FloatS / 3600));<NEW_LINE>return result;<NEW_LINE>}
].split("/", 2);
1,095,067
static void vp8_dequant_idct_add_core(final int imax, final int jmax, PositionableIntArrPointer eobs, FullAccessIntArrPointer q, ReadOnlyIntArrPointer dq, FullAccessIntArrPointer dst, int stride) {<NEW_LINE>final int dstinc = (stride - jmax) << 2;<NEW_LINE>for (int i = 0; i < imax; ++i) {<NEW_LINE>for (int j = 0; j < jmax; ++j) {<NEW_LINE>if (eobs.get() > 1) {<NEW_LINE>Dequantize.vp8_dequant_idct_add(q, dq, dst, stride);<NEW_LINE>} else {<NEW_LINE>IDCTllm.vp8_dc_only_idct_add(q.get() * dq.get(), <MASK><NEW_LINE>q.memset(0, (short) 0, 2);<NEW_LINE>}<NEW_LINE>eobs.inc();<NEW_LINE>q.incBy(16);<NEW_LINE>dst.incBy(4);<NEW_LINE>}<NEW_LINE>dst.incBy(dstinc);<NEW_LINE>}<NEW_LINE>}
dst, stride, dst, stride);
947,623
public void refreshToken(String refreshToken) throws LoginFailedException, InvalidCredentialsException {<NEW_LINE>HttpUrl url = HttpUrl.parse(OAUTH_TOKEN_ENDPOINT).newBuilder().addQueryParameter("client_id", CLIENT_ID).addQueryParameter("client_secret", SECRET).addQueryParameter("refresh_token", refreshToken).addQueryParameter("grant_type", "refresh_token").build();<NEW_LINE>// Empty request body<NEW_LINE>RequestBody reqBody = RequestBody.create(null, new byte[0]);<NEW_LINE>Request request = new Request.Builder().url(url).method("POST", reqBody).build();<NEW_LINE>Response response = null;<NEW_LINE>try {<NEW_LINE>response = client.newCall(request).execute();<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new LoginFailedException("Network Request failed to fetch refreshed tokenId", e);<NEW_LINE>}<NEW_LINE>Moshi moshi = new Moshi<MASK><NEW_LINE>GoogleAuthTokenJson googleAuthTokenJson = null;<NEW_LINE>try {<NEW_LINE>googleAuthTokenJson = moshi.adapter(GoogleAuthTokenJson.class).fromJson(response.body().string());<NEW_LINE>Log.d(TAG, "" + googleAuthTokenJson.expiresIn);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new LoginFailedException("Failed to unmarshal the Json response to fetch refreshed tokenId", e);<NEW_LINE>}<NEW_LINE>if (googleAuthTokenJson.error != null) {<NEW_LINE>throw new InvalidCredentialsException(googleAuthTokenJson.error);<NEW_LINE>} else {<NEW_LINE>Log.d(TAG, "Refreshed Token " + googleAuthTokenJson.idToken);<NEW_LINE>expiresTimestamp = System.currentTimeMillis() + (googleAuthTokenJson.expiresIn * 1000 - REFRESH_TOKEN_BUFFER_TIME);<NEW_LINE>tokenId = googleAuthTokenJson.idToken;<NEW_LINE>}<NEW_LINE>}
.Builder().build();
1,592,953
public int crypto_kem_dec(byte[] k, byte[] c, byte[] sk) {<NEW_LINE>int i, fail;<NEW_LINE>byte[] cmp = new byte[SABER_BYTES_CCA_DEC];<NEW_LINE>byte[] buf = new byte[64];<NEW_LINE>// Will contain key, coins<NEW_LINE>byte[] kr = new byte[64];<NEW_LINE>byte[] pk = Arrays.copyOfRange(sk, SABER_INDCPA_SECRETKEYBYTES, sk.length);<NEW_LINE>// buf[0:31] <-- message<NEW_LINE>indcpa_kem_dec(sk, c, buf);<NEW_LINE>// Multitarget countermeasure for coins + contributory KEM<NEW_LINE>for (// Save hash by storing h(pk) in sk<NEW_LINE>// Save hash by storing h(pk) in sk<NEW_LINE>i = 0; // Save hash by storing h(pk) in sk<NEW_LINE>i < 32; i++) buf[32 + i] = sk[SABER_SECRETKEYBYTES - 64 + i];<NEW_LINE>SHA3Digest digest_256 = new SHA3Digest(256);<NEW_LINE><MASK><NEW_LINE>digest_512.update(buf, 0, 64);<NEW_LINE>digest_512.doFinal(kr, 0);<NEW_LINE>indcpa_kem_enc(buf, Arrays.copyOfRange(kr, 32, kr.length), pk, cmp);<NEW_LINE>fail = verify(c, cmp, SABER_BYTES_CCA_DEC);<NEW_LINE>// overwrite coins in kr with h(c)<NEW_LINE>digest_256.update(c, 0, SABER_BYTES_CCA_DEC);<NEW_LINE>digest_256.doFinal(kr, 32);<NEW_LINE>cmov(kr, sk, SABER_SECRETKEYBYTES - SABER_KEYBYTES, SABER_KEYBYTES, (byte) fail);<NEW_LINE>// hash concatenation of pre-k and h(c) to k<NEW_LINE>// todo support 128 and 192 bit keys<NEW_LINE>byte[] temp_k = new byte[32];<NEW_LINE>digest_256.update(kr, 0, 64);<NEW_LINE>digest_256.doFinal(temp_k, 0);<NEW_LINE>System.arraycopy(temp_k, 0, k, 0, defaultKeySize / 8);<NEW_LINE>return 0;<NEW_LINE>}
SHA3Digest digest_512 = new SHA3Digest(512);
334,079
public io.kubernetes.client.proto.V1beta1Extensions.FSGroupStrategyOptions buildPartial() {<NEW_LINE>io.kubernetes.client.proto.V1beta1Extensions.FSGroupStrategyOptions result = new io.kubernetes.client.proto.V1beta1Extensions.FSGroupStrategyOptions(this);<NEW_LINE>int from_bitField0_ = bitField0_;<NEW_LINE>int to_bitField0_ = 0;<NEW_LINE>if (((from_bitField0_ & 0x00000001) == 0x00000001)) {<NEW_LINE>to_bitField0_ |= 0x00000001;<NEW_LINE>}<NEW_LINE>result.rule_ = rule_;<NEW_LINE>if (rangesBuilder_ == null) {<NEW_LINE>if (((bitField0_ & 0x00000002) == 0x00000002)) {<NEW_LINE>ranges_ = java.util.Collections.unmodifiableList(ranges_);<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000002);<NEW_LINE>}<NEW_LINE>result.ranges_ = ranges_;<NEW_LINE>} else {<NEW_LINE>result<MASK><NEW_LINE>}<NEW_LINE>result.bitField0_ = to_bitField0_;<NEW_LINE>onBuilt();<NEW_LINE>return result;<NEW_LINE>}
.ranges_ = rangesBuilder_.build();
232,899
private static void applyAdditionalInfoImpl(final Project project, @javax.annotation.Nullable ThrowableComputable<Map<String, Map<String, CharSequence>>, PatchSyntaxException> additionalInfo, CommitContext commitContext, final Consumer<InfoGroup> worker) {<NEW_LINE>final PatchEP[] extensions = Extensions.getExtensions(PatchEP.EP_NAME, project);<NEW_LINE>if (extensions.length == 0)<NEW_LINE>return;<NEW_LINE>if (additionalInfo != null) {<NEW_LINE>try {<NEW_LINE>for (Map.Entry<String, Map<String, CharSequence>> entry : additionalInfo.compute().entrySet()) {<NEW_LINE>final String path = entry.getKey();<NEW_LINE>final Map<String, CharSequence> innerMap = entry.getValue();<NEW_LINE>for (PatchEP extension : extensions) {<NEW_LINE>final CharSequence charSequence = innerMap.<MASK><NEW_LINE>if (charSequence != null) {<NEW_LINE>worker.consume(new InfoGroup(extension, path, charSequence, commitContext));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (PatchSyntaxException e) {<NEW_LINE>VcsBalloonProblemNotifier.showOverChangesView(project, "Can not apply additional patch info: " + e.getMessage(), MessageType.ERROR);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
get(extension.getName());
1,556,271
public static ParticleEmitter newImplosionEmitter() {<NEW_LINE>ParticleEmitter emitter = new ParticleEmitter();<NEW_LINE>emitter.setNumParticles(100);<NEW_LINE>emitter.setEmissionRate(0.0166);<NEW_LINE>emitter.setSize(5, 20);<NEW_LINE>emitter.setSpawnPointFunction(i -> {<NEW_LINE>Point2D vector = new Point2D(Math.cos(i), Math.sin(i));<NEW_LINE>return new Point2D(0, 0).add(vector.multiply(25));<NEW_LINE>});<NEW_LINE>emitter.setVelocityFunction(i -> {<NEW_LINE>Point2D vector = new Point2D(Math.cos(i), Math.sin(i));<NEW_LINE>Point2D newPos = new Point2D(0, 0).add(vector.multiply(25));<NEW_LINE>return newPos.subtract(Point2D.ZERO).multiply(-0.05 * 60);<NEW_LINE>});<NEW_LINE>emitter.setScaleFunction(i -> new Point2D(FXGLMath.randomDouble() * -0.1, FXGLMath.randomDouble() * -0.1));<NEW_LINE>emitter.setExpireFunction(i -> Duration.seconds(0.5));<NEW_LINE>emitter.setColor(Color.rgb((int) random(200, <MASK><NEW_LINE>emitter.setBlendMode(BlendMode.ADD);<NEW_LINE>return emitter;<NEW_LINE>}
255), 30, 20));
1,410,999
@Produces(MediaType.APPLICATION_JSON)<NEW_LINE>@ApiOperation(value = "Adds a mapping", response = MappedOidcGroup.class)<NEW_LINE>@ApiResponses(value = { @ApiResponse(code = 401, message = "Unauthorized"), @ApiResponse(code = 404, message = "The UUID of the team or group could not be found"), @ApiResponse(code = 409, message = "A mapping with the same team and group name already exists") })<NEW_LINE>@PermissionRequired(Permissions.Constants.ACCESS_MANAGEMENT)<NEW_LINE>public Response addMapping(final MappedOidcGroupRequest request) {<NEW_LINE>final Validator validator = super.getValidator();<NEW_LINE>failOnValidationError(validator.validateProperty(request, "team"), validator.validateProperty(request, "group"));<NEW_LINE>try (QueryManager qm = new QueryManager()) {<NEW_LINE>final Team team = qm.getObjectByUuid(Team.class, request.getTeam());<NEW_LINE>if (team == null) {<NEW_LINE>return Response.status(Response.Status.NOT_FOUND).entity("A team with the specified UUID could not be found.").build();<NEW_LINE>}<NEW_LINE>final OidcGroup group = qm.getObjectByUuid(OidcGroup.class, request.getGroup());<NEW_LINE>if (group == null) {<NEW_LINE>return Response.status(Response.Status.NOT_FOUND).entity("A group with the specified UUID could not be found.").build();<NEW_LINE>}<NEW_LINE>if (!qm.isOidcGroupMapped(team, group)) {<NEW_LINE>final MappedOidcGroup mappedOidcGroup = qm.createMappedOidcGroup(team, group);<NEW_LINE>super.logSecurityEvent(LOGGER, SecurityMarkers.SECURITY_AUDIT, "Mapping created for group " + group.getName() + <MASK><NEW_LINE>return Response.ok(mappedOidcGroup).build();<NEW_LINE>} else {<NEW_LINE>return Response.status(Response.Status.CONFLICT).entity("A mapping for the same team and group already exists.").build();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
" and team " + team.getName());
752,789
protected PreDeConModel computeLocalModel(DBIDRef id, DoubleDBIDList neighbors, Relation<? extends NumberVector> relation) {<NEW_LINE>final int referenceSetSize = neighbors.size();<NEW_LINE>mvSize.put(referenceSetSize);<NEW_LINE>// Shouldn't happen:<NEW_LINE>if (referenceSetSize < 0) {<NEW_LINE>LOG.warning("Empty reference set - should at least include the query point!");<NEW_LINE>return new PreDeConModel(Integer.MAX_VALUE, DBIDUtil.EMPTYDBIDS);<NEW_LINE>}<NEW_LINE>NumberVector obj = relation.get(id);<NEW_LINE>final int dim = obj.getDimensionality();<NEW_LINE>// Per-dimension variances:<NEW_LINE>double[] s = new double[dim];<NEW_LINE>for (DBIDIter neighbor = neighbors.iter(); neighbor.valid(); neighbor.advance()) {<NEW_LINE>NumberVector o = relation.get(neighbor);<NEW_LINE>for (int d = 0; d < dim; d++) {<NEW_LINE>final double diff = obj.doubleValue(d) - o.doubleValue(d);<NEW_LINE>s[d] += diff * diff;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Adjust for sample size<NEW_LINE>for (int d = 0; d < dim; d++) {<NEW_LINE>s[d] /= referenceSetSize;<NEW_LINE>mvVar<MASK><NEW_LINE>}<NEW_LINE>// Preference weight vector<NEW_LINE>double[] weights = new double[dim];<NEW_LINE>int pdim = 0;<NEW_LINE>for (int d = 0; d < dim; d++) {<NEW_LINE>if (s[d] <= settings.delta) {<NEW_LINE>weights[d] = settings.kappa;<NEW_LINE>pdim++;<NEW_LINE>} else {<NEW_LINE>weights[d] = 1.;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Check which neighbors survive<NEW_LINE>HashSetModifiableDBIDs survivors = DBIDUtil.newHashSet(referenceSetSize);<NEW_LINE>for (DBIDIter neighbor = neighbors.iter(); neighbor.valid(); neighbor.advance()) {<NEW_LINE>NumberVector o = relation.get(neighbor);<NEW_LINE>// Weighted Euclidean distance:<NEW_LINE>double dev = 0.;<NEW_LINE>for (int d = 0; d < dim; d++) {<NEW_LINE>final double diff = obj.doubleValue(d) - o.doubleValue(d);<NEW_LINE>dev += weights[d] * diff * diff;<NEW_LINE>}<NEW_LINE>// Note: epsilon was squared - this saves us the sqrt here:<NEW_LINE>if (dev <= epsilon) {<NEW_LINE>survivors.add(neighbor);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new PreDeConModel(pdim, survivors);<NEW_LINE>}
.put(s[d]);
557,191
public RenderingError unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>RenderingError renderingError = new RenderingError();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("Code", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>renderingError.setCode(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Message", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>renderingError.setMessage(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return renderingError;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
881,260
public CreateTrafficPolicyInstanceResult unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>CreateTrafficPolicyInstanceResult createTrafficPolicyInstanceResult = new CreateTrafficPolicyInstanceResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 1;<NEW_LINE>if (context.isStartOfDocument()) {<NEW_LINE>context.setCurrentHeader("Location");<NEW_LINE>createTrafficPolicyInstanceResult.setLocation(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE><MASK><NEW_LINE>if (xmlEvent.isEndDocument())<NEW_LINE>return createTrafficPolicyInstanceResult;<NEW_LINE>if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {<NEW_LINE>if (context.testExpression("TrafficPolicyInstance", targetDepth)) {<NEW_LINE>createTrafficPolicyInstanceResult.setTrafficPolicyInstance(TrafficPolicyInstanceStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent.isEndElement()) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return createTrafficPolicyInstanceResult;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
XMLEvent xmlEvent = context.nextEvent();
1,520,559
public static RedisURI sentinelConfigurationToRedisURI(RedisSentinelConfiguration sentinelConfiguration) {<NEW_LINE>Assert.notNull(sentinelConfiguration, "RedisSentinelConfiguration is required");<NEW_LINE>Set<RedisNode> sentinels = sentinelConfiguration.getSentinels();<NEW_LINE>RedisPassword sentinelPassword = sentinelConfiguration.getSentinelPassword();<NEW_LINE>RedisURI.Builder builder = RedisURI.builder();<NEW_LINE>for (RedisNode sentinel : sentinels) {<NEW_LINE>RedisURI.Builder sentinelBuilder = RedisURI.Builder.redis(sentinel.getHost(), sentinel.getPort());<NEW_LINE>String sentinelUsername = sentinelConfiguration.getSentinelUsername();<NEW_LINE>if (StringUtils.hasText(sentinelUsername) && sentinelPassword.isPresent()) {<NEW_LINE>// See https://github.com/lettuce-io/lettuce-core/issues/1404<NEW_LINE>sentinelBuilder.withAuthentication(sentinelUsername, sentinelPassword.get());<NEW_LINE>} else {<NEW_LINE>sentinelPassword.toOptional(<MASK><NEW_LINE>}<NEW_LINE>builder.withSentinel(sentinelBuilder.build());<NEW_LINE>}<NEW_LINE>String username = sentinelConfiguration.getUsername();<NEW_LINE>RedisPassword password = sentinelConfiguration.getPassword();<NEW_LINE>if (StringUtils.hasText(username) && password.isPresent()) {<NEW_LINE>// See https://github.com/lettuce-io/lettuce-core/issues/1404<NEW_LINE>builder.withAuthentication(username, password.get());<NEW_LINE>} else {<NEW_LINE>password.toOptional().ifPresent(builder::withPassword);<NEW_LINE>}<NEW_LINE>builder.withSentinelMasterId(sentinelConfiguration.getMaster().getName());<NEW_LINE>return builder.build();<NEW_LINE>}
).ifPresent(sentinelBuilder::withPassword);
1,703,736
private void completeTask(ExecutionTask task) {<NEW_LINE>switch(task.type()) {<NEW_LINE>case INTER_BROKER_REPLICA_ACTION:<NEW_LINE>_inProgressPartitionsForInterBrokerMovement.remove(task.<MASK><NEW_LINE>int oldLeader = task.proposal().oldLeader().brokerId();<NEW_LINE>_inProgressInterBrokerReplicaMovementsByBrokerId.put(oldLeader, _inProgressInterBrokerReplicaMovementsByBrokerId.get(oldLeader) - 1);<NEW_LINE>task.proposal().replicasToAdd().forEach(r -> _inProgressInterBrokerReplicaMovementsByBrokerId.put(r.brokerId(), _inProgressInterBrokerReplicaMovementsByBrokerId.get(r.brokerId()) - 1));<NEW_LINE>break;<NEW_LINE>case INTRA_BROKER_REPLICA_ACTION:<NEW_LINE>_inProgressIntraBrokerReplicaMovementsByBrokerId.put(task.brokerId(), _inProgressIntraBrokerReplicaMovementsByBrokerId.get(task.brokerId()) - 1);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>// No-op for other type of task, i.e LEADER_ACTION.<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}
proposal().topicPartition());
1,078,817
public static void vertical11(Kernel1D_F32 kernel, GrayF32 src, GrayF32 dst) {<NEW_LINE>final float[] dataSrc = src.data;<NEW_LINE>final float[] dataDst = dst.data;<NEW_LINE>final float k1 = kernel.data[0];<NEW_LINE>final float k2 = kernel.data[1];<NEW_LINE>final float k3 = kernel.data[2];<NEW_LINE>final float k4 = kernel.data[3];<NEW_LINE>final float k5 = kernel.data[4];<NEW_LINE>final float k6 = kernel.data[5];<NEW_LINE>final float k7 = kernel.data[6];<NEW_LINE>final float k8 = kernel.data[7];<NEW_LINE>final float k9 = kernel.data[8];<NEW_LINE>final float k10 = kernel.data[9];<NEW_LINE>final float k11 = kernel.data[10];<NEW_LINE>final int radius = kernel.getRadius();<NEW_LINE>final int imgWidth = dst.getWidth();<NEW_LINE>final <MASK><NEW_LINE>final int yEnd = imgHeight - radius;<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(radius, yEnd, y -> {<NEW_LINE>for (int y = radius; y < yEnd; y++) {<NEW_LINE>int indexDst = dst.startIndex + y * dst.stride;<NEW_LINE>int i = src.startIndex + (y - radius) * src.stride;<NEW_LINE>final int iEnd = i + imgWidth;<NEW_LINE>for (; i < iEnd; i++) {<NEW_LINE>int indexSrc = i;<NEW_LINE>float total = (dataSrc[indexSrc]) * k1;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc]) * k2;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc]) * k3;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc]) * k4;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc]) * k5;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc]) * k6;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc]) * k7;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc]) * k8;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc]) * k9;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc]) * k10;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc]) * k11;<NEW_LINE>dataDst[indexDst++] = total;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>}
int imgHeight = dst.getHeight();
1,392,004
public ServiceStatus update(String userId, String json) {<NEW_LINE>JSONObject jsonObject = JSONObject.parseObject(json);<NEW_LINE>DashboardJob job = new DashboardJob();<NEW_LINE>job.setId(jsonObject.getLong("id"));<NEW_LINE>job.setName(jsonObject.getString("name"));<NEW_LINE>job.setConfig(jsonObject.getString("config"));<NEW_LINE>job.setCronExp<MASK><NEW_LINE>SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");<NEW_LINE>format.setTimeZone(TimeZone.getTimeZone("UTC"));<NEW_LINE>try {<NEW_LINE>job.setStartDate(format.parse(jsonObject.getJSONObject("daterange").getString("startDate")));<NEW_LINE>job.setEndDate(format.parse(jsonObject.getJSONObject("daterange").getString("endDate")));<NEW_LINE>} catch (ParseException e) {<NEW_LINE>LOG.error("", e);<NEW_LINE>}<NEW_LINE>job.setJobType(jsonObject.getString("jobType"));<NEW_LINE>jobDao.update(job);<NEW_LINE>configScheduler();<NEW_LINE>return new ServiceStatus(ServiceStatus.Status.Success, "success");<NEW_LINE>}
(jsonObject.getString("cronExp"));
1,236,598
final RecognizeTextResult executeRecognizeText(RecognizeTextRequest recognizeTextRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(recognizeTextRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<RecognizeTextRequest> request = null;<NEW_LINE>Response<RecognizeTextResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new RecognizeTextRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(recognizeTextRequest));<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, "Lex Runtime V2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "RecognizeText");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<RecognizeTextResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new RecognizeTextResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
1,249,773
final DeleteConferenceProviderResult executeDeleteConferenceProvider(DeleteConferenceProviderRequest deleteConferenceProviderRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteConferenceProviderRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteConferenceProviderRequest> request = null;<NEW_LINE>Response<DeleteConferenceProviderResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteConferenceProviderRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteConferenceProviderRequest));<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, "Alexa For Business");<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<DeleteConferenceProviderResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteConferenceProviderResultJsonUnmarshaller());<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, "DeleteConferenceProvider");
1,553,267
private final BigDecimal toNumber(final Object value) {<NEW_LINE>Check.assumeNotNull(value, "value not null");<NEW_LINE>final BigDecimal valueBD;<NEW_LINE>if (value instanceof BigDecimal) {<NEW_LINE>valueBD = (BigDecimal) value;<NEW_LINE>} else if (value instanceof Integer) {<NEW_LINE>final int i = (Integer) value;<NEW_LINE><MASK><NEW_LINE>} else if (value instanceof String) {<NEW_LINE>try {<NEW_LINE>valueBD = new BigDecimal(value.toString());<NEW_LINE>} catch (final Exception e) {<NEW_LINE>throw new InvalidAttributeValueException("Cannot convert value '" + value + "' (" + value.getClass() + ") to " + BigDecimal.class, e);<NEW_LINE>}<NEW_LINE>} else if (value instanceof KeyNamePair) {<NEW_LINE>final int key = ((KeyNamePair) value).getKey();<NEW_LINE>return BigDecimal.valueOf(key);<NEW_LINE>} else if (value instanceof Map) {<NEW_LINE>// Usually this happens when a JSON deserialized value is passed.<NEW_LINE>// In this case we consider the Map has one entry: key=value.<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>final Map<String, String> keyNamePairAsMap = (Map<String, String>) value;<NEW_LINE>final String key = extractKey(keyNamePairAsMap, attribute);<NEW_LINE>try {<NEW_LINE>valueBD = new BigDecimal(key);<NEW_LINE>} catch (final Exception e) {<NEW_LINE>throw new InvalidAttributeValueException("Cannot convert value '" + value + "' (" + value.getClass() + ") to " + BigDecimal.class, e);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new InvalidAttributeValueException("Cannot convert value '" + value + "' (" + value.getClass() + ") to " + BigDecimal.class);<NEW_LINE>}<NEW_LINE>final MathContext mc = Services.get(IAttributesBL.class).getMathContext(attribute);<NEW_LINE>return valueBD.setScale(mc.getPrecision(), mc.getRoundingMode());<NEW_LINE>}
valueBD = BigDecimal.valueOf(i);
1,740,959
final DescribeAnomalyDetectorsResult executeDescribeAnomalyDetectors(DescribeAnomalyDetectorsRequest describeAnomalyDetectorsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeAnomalyDetectorsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeAnomalyDetectorsRequest> request = null;<NEW_LINE>Response<DescribeAnomalyDetectorsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeAnomalyDetectorsRequestMarshaller().marshall(super.beforeMarshalling(describeAnomalyDetectorsRequest));<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(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudWatch");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeAnomalyDetectors");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DescribeAnomalyDetectorsResult> responseHandler = new StaxResponseHandler<DescribeAnomalyDetectorsResult>(new DescribeAnomalyDetectorsResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
HandlerContextKey.SIGNING_REGION, getSigningRegion());
199,429
private HttpPipeline createHttpPipeline() {<NEW_LINE>Configuration buildConfiguration = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration;<NEW_LINE>if (httpLogOptions == null) {<NEW_LINE>httpLogOptions = new HttpLogOptions();<NEW_LINE>}<NEW_LINE>if (clientOptions == null) {<NEW_LINE>clientOptions = new ClientOptions();<NEW_LINE>}<NEW_LINE>List<HttpPipelinePolicy> policies = new ArrayList<>();<NEW_LINE>String clientName = properties.getOrDefault(SDK_NAME, "UnknownName");<NEW_LINE>String clientVersion = properties.getOrDefault(SDK_VERSION, "UnknownVersion");<NEW_LINE>String applicationId = CoreUtils.getApplicationId(clientOptions, httpLogOptions);<NEW_LINE>policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration));<NEW_LINE>HttpHeaders headers = new HttpHeaders();<NEW_LINE>clientOptions.getHeaders().forEach(header -> headers.set(header.getName(), header.getValue()));<NEW_LINE>if (headers.getSize() > 0) {<NEW_LINE>policies.add(new AddHeadersPolicy(headers));<NEW_LINE>}<NEW_LINE>HttpPolicyProviders.addBeforeRetryPolicies(policies);<NEW_LINE>policies.add(retryPolicy == null ? new RetryPolicy() : retryPolicy);<NEW_LINE>policies<MASK><NEW_LINE>policies.addAll(this.pipelinePolicies);<NEW_LINE>HttpPolicyProviders.addAfterRetryPolicies(policies);<NEW_LINE>policies.add(new HttpLoggingPolicy(httpLogOptions));<NEW_LINE>HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])).httpClient(httpClient).build();<NEW_LINE>return httpPipeline;<NEW_LINE>}
.add(new CookiePolicy());
1,665,245
private List<CheckCapsResponse> checkCaps(CapsCheckRequest.CheckType checkType) {<NEW_LINE>Predicate<IndexerConfig> isToBeCheckedPredicate = x -> x.getState() == IndexerConfig.State.ENABLED && (x.getSearchModuleType() == SearchModuleType.NEWZNAB || x.getSearchModuleType() == SearchModuleType.TORZNAB) && x.isConfigComplete() && (checkType == CheckType.ALL || !x.isAllCapsChecked());<NEW_LINE>List<IndexerConfig> configsToCheck = configProvider.getBaseConfig().getIndexers().stream().filter(isToBeCheckedPredicate).collect(Collectors.toList());<NEW_LINE>if (configsToCheck.isEmpty()) {<NEW_LINE>logger.info("No indexers to check");<NEW_LINE>return Collections.emptyList();<NEW_LINE>}<NEW_LINE>logger.info("Calling caps check for indexers {}", configsToCheck.stream().map(IndexerConfig::getName).collect(Collectors.joining(", ")));<NEW_LINE>ExecutorService executor = Executors.newFixedThreadPool(configsToCheck.size());<NEW_LINE>List<CheckCapsResponse> responses = new ArrayList<>();<NEW_LINE>try {<NEW_LINE>List<Future<CheckCapsResponse>> futures = executor.invokeAll(configsToCheck.stream().map(x -> (Callable<CheckCapsResponse>) () -> checkCaps(x)).collect(Collectors.toList()));<NEW_LINE>for (Future<CheckCapsResponse> future : futures) {<NEW_LINE>try {<NEW_LINE>responses.add(future.get());<NEW_LINE>} catch (ExecutionException e) {<NEW_LINE>logger.error("Error while calling caps check", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE><MASK><NEW_LINE>} finally {<NEW_LINE>executor.shutdown();<NEW_LINE>}<NEW_LINE>return responses;<NEW_LINE>}
logger.error("Error while calling caps check for all indexers", e);
1,413,992
public static ManagedChannel newChannel(@Nullable Executor executor, String target, String proxy, AuthAndTLSOptions options, @Nullable List<ClientInterceptor> interceptors) throws IOException {<NEW_LINE>Preconditions.checkNotNull(target);<NEW_LINE>Preconditions.checkNotNull(options);<NEW_LINE>SslContext sslContext = isTlsEnabled(target) ? createSSlContext(options.tlsCertificate, options.tlsClientCertificate, options.tlsClientKey) : null;<NEW_LINE>String targetUrl = convertTargetScheme(target);<NEW_LINE>try {<NEW_LINE>NettyChannelBuilder builder = newNettyChannelBuilder(targetUrl, proxy).executor(executor).negotiationType(isTlsEnabled(target) ? <MASK><NEW_LINE>if (options.grpcKeepaliveTime != null) {<NEW_LINE>builder.keepAliveTime(options.grpcKeepaliveTime.getSeconds(), TimeUnit.SECONDS);<NEW_LINE>builder.keepAliveTimeout(options.grpcKeepaliveTimeout.getSeconds(), TimeUnit.SECONDS);<NEW_LINE>}<NEW_LINE>if (interceptors != null) {<NEW_LINE>builder.intercept(interceptors);<NEW_LINE>}<NEW_LINE>if (sslContext != null) {<NEW_LINE>builder.sslContext(sslContext);<NEW_LINE>if (options.tlsAuthorityOverride != null) {<NEW_LINE>builder.overrideAuthority(options.tlsAuthorityOverride);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return builder.build();<NEW_LINE>} catch (RuntimeException e) {<NEW_LINE>// gRPC might throw all kinds of RuntimeExceptions: StatusRuntimeException,<NEW_LINE>// IllegalStateException, NullPointerException, ...<NEW_LINE>String message = "Failed to connect to '%s': %s";<NEW_LINE>throw new IOException(String.format(message, targetUrl, e.getMessage()));<NEW_LINE>}<NEW_LINE>}
NegotiationType.TLS : NegotiationType.PLAINTEXT);
510,502
public void play() {<NEW_LINE>showIntro();<NEW_LINE>loadPlayers();<NEW_LINE>console.print("%s'S ADVANTAGE IS %d AND VULNERABILITY IS SECRET.\n", session.getOpponent().getName(), session.getOpponent().getBestPunch().getCode());<NEW_LINE>for (int roundNro = 1; roundNro <= 3; roundNro++) {<NEW_LINE>if (session.isOver())<NEW_LINE>break;<NEW_LINE>session.resetPoints();<NEW_LINE><MASK><NEW_LINE>for (int majorPunches = 1; majorPunches <= 7; majorPunches++) {<NEW_LINE>long i = Basic.randomOf(10);<NEW_LINE>if (i > 5) {<NEW_LINE>boolean stopPunches = opponentPunch();<NEW_LINE>if (stopPunches)<NEW_LINE>break;<NEW_LINE>} else {<NEW_LINE>playerPunch();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>showRoundWinner(roundNro);<NEW_LINE>}<NEW_LINE>showWinner();<NEW_LINE>}
console.print("\nROUND %d BEGINS...%n", roundNro);
656,114
private void handleAttributeCompatibility(MutableModuleComponentResolveMetadata metaDataFromResource) {<NEW_LINE>// This code path will always be a no-op following the changes in DefaultImmutableAttributesFactory<NEW_LINE>// However this code will have to remain forever while the other one should be removed at some point (Gradle 7.0?)<NEW_LINE>for (MutableComponentVariant variant : metaDataFromResource.getMutableVariants()) {<NEW_LINE><MASK><NEW_LINE>ImmutableAttributes updatedAttributes = ImmutableAttributes.EMPTY;<NEW_LINE>if (attributes.contains(USAGE_STRING_ATTRIBUTE)) {<NEW_LINE>String attributeValue = attributes.getAttribute(USAGE_STRING_ATTRIBUTE);<NEW_LINE>if (attributeValue.endsWith("-jars")) {<NEW_LINE>updatedAttributes = attributesFactory.concat(updatedAttributes, USAGE_STRING_ATTRIBUTE, new CoercingStringValueSnapshot(attributeValue.replace("-jars", ""), instantiator));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!updatedAttributes.isEmpty() && !attributes.contains(LIBRARY_ELEMENTS_STRING_ATTRIBUTE)) {<NEW_LINE>updatedAttributes = attributesFactory.concat(updatedAttributes, LIBRARY_ELEMENTS_STRING_ATTRIBUTE, new CoercingStringValueSnapshot(LibraryElements.JAR, instantiator));<NEW_LINE>}<NEW_LINE>if (!updatedAttributes.isEmpty()) {<NEW_LINE>updatedAttributes = attributesFactory.concat(attributes, updatedAttributes);<NEW_LINE>variant.setAttributes(updatedAttributes);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
ImmutableAttributes attributes = variant.getAttributes();
145,252
// for each pattern, it calculates positive, negative, and unlabeled words<NEW_LINE>private void calculateSufficientStats(Map<String, DataInstance> sents, PatternsForEachToken patternsForEachToken, String label, TwoDimensionalCounter<E, CandidatePhrase> patternsandWords4Label, TwoDimensionalCounter<E, CandidatePhrase> negPatternsandWords4Label, TwoDimensionalCounter<E, CandidatePhrase> unLabeledPatternsandWords4Label, Set<String> allCandidatePhrases) {<NEW_LINE>Redwood.log(Redwood.DBG, "calculating sufficient stats");<NEW_LINE>patternsForEachToken.setupSearch();<NEW_LINE>// calculating the sufficient statistics<NEW_LINE>Class answerClass4Label = constVars.getAnswerClass().get(label);<NEW_LINE>int sampleSize = constVars.sampleSentencesForSufficientStats == 1.0 ? sents.size() : (int) Math.round(constVars.sampleSentencesForSufficientStats * sents.size());<NEW_LINE>List<List<String>> sampledSentIds = splitIntoNumThreadsWithSampling(CollectionUtils.toList(sents.keySet()), sampleSize, constVars.numThreads);<NEW_LINE>Redwood.log(Redwood.DBG, "sampled " + sampleSize + " sentences (" + constVars.sampleSentencesForSufficientStats * 100 + "%)");<NEW_LINE>ExecutorService executor = Executors.newFixedThreadPool(constVars.numThreads);<NEW_LINE>List<Future<Triple<List<Pair<E, CandidatePhrase>>, List<Pair<E, CandidatePhrase>>, List<Pair<E, CandidatePhrase>>>>> list = new ArrayList<>();<NEW_LINE>for (List<String> sampledSents : sampledSentIds) {<NEW_LINE>Callable<Triple<List<Pair<E, CandidatePhrase>>, List<Pair<E, CandidatePhrase>>, List<Pair<E, CandidatePhrase>>>> task = new CalculateSufficientStatsThreads(patternsForEachToken, sampledSents, sents, label, answerClass4Label);<NEW_LINE>Future<Triple<List<Pair<E, CandidatePhrase>>, List<Pair<E, CandidatePhrase>>, List<Pair<E, CandidatePhrase>>>> submit = executor.submit(task);<NEW_LINE>list.add(submit);<NEW_LINE>}<NEW_LINE>// Now retrieve the result<NEW_LINE>for (Future<Triple<List<Pair<E, CandidatePhrase>>, List<Pair<E, CandidatePhrase>>, List<Pair<E, CandidatePhrase>>>> future : list) {<NEW_LINE>try {<NEW_LINE>Triple<List<Pair<E, CandidatePhrase>>, List<Pair<E, CandidatePhrase>>, List<Pair<E, CandidatePhrase>><MASK><NEW_LINE>addStats(patternsandWords4Label, stats.first());<NEW_LINE>addStats(negPatternsandWords4Label, stats.second());<NEW_LINE>addStats(unLabeledPatternsandWords4Label, stats.third());<NEW_LINE>} catch (Exception e) {<NEW_LINE>executor.shutdownNow();<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>executor.shutdown();<NEW_LINE>}
> stats = future.get();
1,077,955
public static // compare the ack set next bit index is bigger than another one.<NEW_LINE>int compareToWithAckSet(PositionImpl currentPosition, PositionImpl otherPosition) {<NEW_LINE>if (currentPosition == null || otherPosition == null) {<NEW_LINE>throw new IllegalArgumentException("Two positions can't be null! " + "current position : [" + currentPosition + "] other position : [" + otherPosition + "]");<NEW_LINE>}<NEW_LINE>int result = currentPosition.compareTo(otherPosition);<NEW_LINE>if (result == 0) {<NEW_LINE>BitSetRecyclable otherAckSet;<NEW_LINE>BitSetRecyclable currentAckSet;<NEW_LINE>if (otherPosition.getAckSet() == null) {<NEW_LINE>otherAckSet = BitSetRecyclable.create();<NEW_LINE>} else {<NEW_LINE>otherAckSet = BitSetRecyclable.valueOf(otherPosition.getAckSet());<NEW_LINE>}<NEW_LINE>if (currentPosition.getAckSet() == null) {<NEW_LINE>currentAckSet = BitSetRecyclable.create();<NEW_LINE>} else {<NEW_LINE>currentAckSet = BitSetRecyclable.valueOf(currentPosition.getAckSet());<NEW_LINE>}<NEW_LINE>if (currentAckSet.isEmpty() || otherAckSet.isEmpty()) {<NEW_LINE>// when ack set is empty, the nextSetBit will return -1, so we should return the inverse value.<NEW_LINE>result = -(currentAckSet.nextSetBit(0) - otherAckSet.nextSetBit(0));<NEW_LINE>} else {<NEW_LINE>result = currentAckSet.nextSetBit(0<MASK><NEW_LINE>}<NEW_LINE>currentAckSet.recycle();<NEW_LINE>otherAckSet.recycle();<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
) - otherAckSet.nextSetBit(0);
1,639,785
public RsaSsaPkcs1PrivateKey createKey(RsaSsaPkcs1KeyFormat format) throws GeneralSecurityException {<NEW_LINE>RsaSsaPkcs1Params params = format.getParams();<NEW_LINE>KeyPairGenerator keyGen = EngineFactory.KEY_PAIR_GENERATOR.getInstance("RSA");<NEW_LINE>RSAKeyGenParameterSpec spec = new RSAKeyGenParameterSpec(format.getModulusSizeInBits(), new BigInteger(1, format.getPublicExponent().toByteArray()));<NEW_LINE>keyGen.initialize(spec);<NEW_LINE>KeyPair keyPair = keyGen.generateKeyPair();<NEW_LINE>RSAPublicKey pubKey = (RSAPublicKey) keyPair.getPublic();<NEW_LINE>RSAPrivateCrtKey privKey = (RSAPrivateCrtKey) keyPair.getPrivate();<NEW_LINE>// Creates RsaSsaPkcs1PublicKey.<NEW_LINE>RsaSsaPkcs1PublicKey pkcs1PubKey = RsaSsaPkcs1PublicKey.newBuilder().setVersion(getVersion()).setParams(params).setE(ByteString.copyFrom(pubKey.getPublicExponent().toByteArray())).setN(ByteString.copyFrom(pubKey.getModulus().toByteArray())).build();<NEW_LINE>// Creates RsaSsaPkcs1PrivateKey.<NEW_LINE>return RsaSsaPkcs1PrivateKey.newBuilder().setVersion(getVersion()).setPublicKey(pkcs1PubKey).setD(ByteString.copyFrom(privKey.getPrivateExponent().toByteArray())).setP(ByteString.copyFrom(privKey.getPrimeP().toByteArray())).setQ(ByteString.copyFrom(privKey.getPrimeQ().toByteArray())).setDp(ByteString.copyFrom(privKey.getPrimeExponentP().toByteArray())).setDq(ByteString.copyFrom(privKey.getPrimeExponentQ().toByteArray())).setCrt(ByteString.copyFrom(privKey.getCrtCoefficient().toByteArray<MASK><NEW_LINE>}
())).build();
1,242,390
final AttachVolumeResult executeAttachVolume(AttachVolumeRequest attachVolumeRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(attachVolumeRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<AttachVolumeRequest> request = null;<NEW_LINE>Response<AttachVolumeResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new AttachVolumeRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(attachVolumeRequest));<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, "Storage Gateway");<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<AttachVolumeResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new AttachVolumeResultJsonUnmarshaller());<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, "AttachVolume");
977,730
public final void addAllInfluencers() {<NEW_LINE>// add all software systems with incoming or outgoing dependencies<NEW_LINE>getModel().getSoftwareSystems().stream().filter(softwareSystem -> softwareSystem.hasEfferentRelationshipWith(getSoftwareSystem()) || getSoftwareSystem().hasEfferentRelationshipWith(softwareSystem)).forEach(this::add);<NEW_LINE>// then add all people with incoming or outgoing dependencies<NEW_LINE>getModel().getPeople().stream().filter(person -> person.hasEfferentRelationshipWith(getSoftwareSystem()) || getSoftwareSystem().hasEfferentRelationshipWith(person)).forEach(this::add);<NEW_LINE>// then remove all relationships of external elements to keep the container view clean<NEW_LINE>getRelationships().stream().map(view -> view.getRelationship()).filter(relationship -> !isPartOf(relationship.getDestination(), getSoftwareSystem()) && !isPartOf(relationship.getSource(), getSoftwareSystem())<MASK><NEW_LINE>}
).forEach(this::remove);
1,386,714
private void mapBestPartialMatches(List<String> names, Map<String, View> sharedElements) {<NEW_LINE>List<Pair<View, String>> allTransitionViews = new ArrayList<>();<NEW_LINE>ViewUtils.findTransitionViews(getDecorView(), allTransitionViews);<NEW_LINE>List<View> <MASK><NEW_LINE>for (String name : names) {<NEW_LINE>if (sharedElements.containsKey(name)) {<NEW_LINE>// Exact match<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>TransitionName tn = TransitionName.parse(name);<NEW_LINE>findAllPartialMatches(tn, allTransitionViews, partialMatches);<NEW_LINE>if (!partialMatches.isEmpty()) {<NEW_LINE>View mostVisibleView = ViewUtils.getMostVisibleView(partialMatches);<NEW_LINE>sharedElements.put(name, mostVisibleView);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (delegate != null) {<NEW_LINE>delegate.onPostMapSharedElements(names, sharedElements);<NEW_LINE>}<NEW_LINE>}
partialMatches = new ArrayList<>();
1,328,515
private long pointCount(PointValues.PointTree pointTree, BiFunction<byte[], byte[], Relation> nodeComparator, Predicate<byte[]> leafComparator) throws IOException {<NEW_LINE>final <MASK><NEW_LINE>// create a custom IntersectVisitor that records the number of leafNodes that matched<NEW_LINE>final IntersectVisitor visitor = new IntersectVisitor() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void visit(int docID) {<NEW_LINE>// this branch should be unreachable<NEW_LINE>throw new UnsupportedOperationException("This IntersectVisitor does not perform any actions on a " + "docID=" + docID + " node being visited");<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void visit(int docID, byte[] packedValue) {<NEW_LINE>if (leafComparator.test(packedValue)) {<NEW_LINE>matchingNodeCount[0]++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Relation compare(byte[] minPackedValue, byte[] maxPackedValue) {<NEW_LINE>return nodeComparator.apply(minPackedValue, maxPackedValue);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>pointCount(visitor, pointTree, matchingNodeCount);<NEW_LINE>return matchingNodeCount[0];<NEW_LINE>}
int[] matchingNodeCount = { 0 };
1,734,911
public static GetCategoriesResponse unmarshall(GetCategoriesResponse getCategoriesResponse, UnmarshallerContext _ctx) {<NEW_LINE>getCategoriesResponse.setRequestId(_ctx.stringValue("GetCategoriesResponse.RequestId"));<NEW_LINE>getCategoriesResponse.setSubTotal(_ctx.longValue("GetCategoriesResponse.SubTotal"));<NEW_LINE>Category1 category1 = new Category1();<NEW_LINE>category1.setCateId(_ctx.longValue("GetCategoriesResponse.Category.CateId"));<NEW_LINE>category1.setCateName(_ctx.stringValue("GetCategoriesResponse.Category.CateName"));<NEW_LINE>category1.setLevel<MASK><NEW_LINE>category1.setParentId(_ctx.longValue("GetCategoriesResponse.Category.ParentId"));<NEW_LINE>category1.setType(_ctx.stringValue("GetCategoriesResponse.Category.Type"));<NEW_LINE>getCategoriesResponse.setCategory1(category1);<NEW_LINE>List<Category> subCategories = new ArrayList<Category>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("GetCategoriesResponse.SubCategories.Length"); i++) {<NEW_LINE>Category category = new Category();<NEW_LINE>category.setCateId(_ctx.longValue("GetCategoriesResponse.SubCategories[" + i + "].CateId"));<NEW_LINE>category.setCateName(_ctx.stringValue("GetCategoriesResponse.SubCategories[" + i + "].CateName"));<NEW_LINE>category.setLevel(_ctx.longValue("GetCategoriesResponse.SubCategories[" + i + "].Level"));<NEW_LINE>category.setParentId(_ctx.longValue("GetCategoriesResponse.SubCategories[" + i + "].ParentId"));<NEW_LINE>category.setSubTotal(_ctx.longValue("GetCategoriesResponse.SubCategories[" + i + "].SubTotal"));<NEW_LINE>category.setType(_ctx.stringValue("GetCategoriesResponse.SubCategories[" + i + "].Type"));<NEW_LINE>subCategories.add(category);<NEW_LINE>}<NEW_LINE>getCategoriesResponse.setSubCategories(subCategories);<NEW_LINE>return getCategoriesResponse;<NEW_LINE>}
(_ctx.longValue("GetCategoriesResponse.Category.Level"));
339,456
public void visitNewArray(ENewArray userNewArrayNode, SemanticScope semanticScope) {<NEW_LINE>if (semanticScope.getCondition(userNewArrayNode, Write.class)) {<NEW_LINE>throw userNewArrayNode.createError(new IllegalArgumentException("invalid assignment: cannot assign a value to new array"));<NEW_LINE>}<NEW_LINE>if (semanticScope.getCondition(userNewArrayNode, Read.class) == false) {<NEW_LINE>throw userNewArrayNode.createError(new IllegalArgumentException("not a statement: result not used from new array"));<NEW_LINE>}<NEW_LINE>String canonicalTypeName = userNewArrayNode.getCanonicalTypeName();<NEW_LINE>Class<?> valueType = semanticScope.getScriptScope().getPainlessLookup().canonicalTypeNameToType(canonicalTypeName);<NEW_LINE>if (valueType == null) {<NEW_LINE>throw userNewArrayNode.createError(new IllegalArgumentException("Not a type [" + canonicalTypeName + "]."));<NEW_LINE>}<NEW_LINE>for (AExpression userValueNode : userNewArrayNode.getValueNodes()) {<NEW_LINE>semanticScope.<MASK><NEW_LINE>semanticScope.putDecoration(userValueNode, new TargetType(userNewArrayNode.isInitializer() ? valueType.getComponentType() : int.class));<NEW_LINE>semanticScope.setCondition(userValueNode, Internal.class);<NEW_LINE>checkedVisit(userValueNode, semanticScope);<NEW_LINE>decorateWithCast(userValueNode, semanticScope);<NEW_LINE>}<NEW_LINE>semanticScope.putDecoration(userNewArrayNode, new ValueType(valueType));<NEW_LINE>}
setCondition(userValueNode, Read.class);
1,360,643
public void RemoveDirectory(FileScope scope, String directoryName, final boolean recursive, final Continuation<Boolean> continuation) {<NEW_LINE>if (scope == FileScope.Asset) {<NEW_LINE>form.dispatchErrorOccurredEvent(this, "RemoveDirectory", ErrorMessages.ERROR_CANNOT_REMOVE_DIRECTORY, directoryName);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// TODO(ewpatton): Restructure this when we have full continuation passing style.<NEW_LINE>final Synchronizer<Boolean> <MASK><NEW_LINE>new FileOperation.Builder(form, this, "RemoveDirectory").addFile(scope, directoryName, FileAccessMode.WRITE).addCommand(new FileOperation.FileInvocation() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void call(ScopedFile[] files) {<NEW_LINE>try {<NEW_LINE>ScopedFile file = files[0];<NEW_LINE>result.wakeup(FileUtil.removeDirectory(file.resolve(form), recursive));<NEW_LINE>} catch (Exception e) {<NEW_LINE>result.caught(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}).build().run();<NEW_LINE>AsynchUtil.finish(result, continuation);<NEW_LINE>}
result = new Synchronizer<>();
378,438
private void initialize(CompareConfiguration configuration) {<NEW_LINE>Control tree = getControl();<NEW_LINE>INavigatable nav = new INavigatable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean selectChange(int flag) {<NEW_LINE>if (flag == INavigatable.FIRST_CHANGE) {<NEW_LINE>setSelection(StructuredSelection.EMPTY);<NEW_LINE>flag = INavigatable.NEXT_CHANGE;<NEW_LINE>} else if (flag == INavigatable.LAST_CHANGE) {<NEW_LINE>setSelection(StructuredSelection.EMPTY);<NEW_LINE>flag = INavigatable.PREVIOUS_CHANGE;<NEW_LINE>}<NEW_LINE>// Fix for https://dev.eclipse.org/bugs/show_bug.cgi?id=20106<NEW_LINE>return internalNavigate(flag == INavigatable.NEXT_CHANGE, true);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Object getInput() {<NEW_LINE>return CheckboxDiffTreeViewer.this.getInput();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean openSelectedChange() {<NEW_LINE>return internalOpen();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean hasChange(int changeFlag) {<NEW_LINE>return getNextItem(changeFlag == INavigatable.NEXT_CHANGE, false) != null;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>tree.setData(INavigatable.NAVIGATOR_PROPERTY, nav);<NEW_LINE>tree.setData(CompareUI.COMPARE_VIEWER_TITLE, getTitle());<NEW_LINE><MASK><NEW_LINE>// $NON-NLS-1$<NEW_LINE>fBundle = ResourceBundle.getBundle("org.eclipse.compare.structuremergeviewer.DiffTreeViewerResources");<NEW_LINE>// Register for notification with the CompareConfiguration.<NEW_LINE>fCompareConfiguration = configuration;<NEW_LINE>if (fCompareConfiguration != null) {<NEW_LINE>fPropertyChangeListener = this::propertyChange;<NEW_LINE>fCompareConfiguration.addPropertyChangeListener(fPropertyChangeListener);<NEW_LINE>}<NEW_LINE>setContentProvider(new DiffViewerContentProvider());<NEW_LINE>setLabelProvider(diffViewerLabelProvider = new DiffViewerLabelProvider());<NEW_LINE>addSelectionChangedListener(event -> updateActions());<NEW_LINE>setComparator(new DiffViewerComparator());<NEW_LINE>ToolBarManager tbm = CompareViewerPane.getToolBarManager(parent);<NEW_LINE>if (tbm != null) {<NEW_LINE>tbm.removeAll();<NEW_LINE>// $NON-NLS-1$<NEW_LINE>tbm.add(new Separator("merge"));<NEW_LINE>// $NON-NLS-1$<NEW_LINE>tbm.add(new Separator("modes"));<NEW_LINE>// $NON-NLS-1$<NEW_LINE>tbm.add(new Separator("navigation"));<NEW_LINE>createToolItems(tbm);<NEW_LINE>updateActions();<NEW_LINE>tbm.update(true);<NEW_LINE>}<NEW_LINE>MenuManager mm = new MenuManager();<NEW_LINE>mm.setRemoveAllWhenShown(true);<NEW_LINE>mm.addMenuListener(mm2 -> {<NEW_LINE>fillContextMenu(mm2);<NEW_LINE>if (mm2.isEmpty()) {<NEW_LINE>if (fEmptyMenuAction == null) {<NEW_LINE>fEmptyMenuAction = new // $NON-NLS-1$<NEW_LINE>// $NON-NLS-1$<NEW_LINE>Action(Utilities.getString(fBundle, "emptyMenuItem")) {<NEW_LINE>};<NEW_LINE>fEmptyMenuAction.setEnabled(false);<NEW_LINE>}<NEW_LINE>mm2.add(fEmptyMenuAction);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>tree.setMenu(mm.createContextMenu(tree));<NEW_LINE>}
Composite parent = tree.getParent();
1,751,758
protected void handlePost(final HttpServletRequest req, final HttpServletResponse resp, final Session session) throws ServletException, IOException {<NEW_LINE>final User user = session.getUser();<NEW_LINE>if (!hasParam(req, "action")) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final HashMap<String, String> results = new HashMap<>();<NEW_LINE>final String action = getParam(req, "action");<NEW_LINE>if (action.equals("changeProxyUser")) {<NEW_LINE>if (hasParam(req, "proxyname")) {<NEW_LINE>final String newProxyname = getParam(req, "proxyname");<NEW_LINE>if (user.getUserId().equals(newProxyname) || user.isInGroup(newProxyname) || user.getRoles().contains("admin")) {<NEW_LINE>session.setSessionData(PROXY_USER_SESSION_KEY, newProxyname);<NEW_LINE>} else {<NEW_LINE>results.put("error", "User '" + user.getUserId(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>results.put("error", "action param is not set");<NEW_LINE>}<NEW_LINE>this.writeJSON(resp, results);<NEW_LINE>}
) + "' cannot proxy as '" + newProxyname + "'");
1,835,248
private Object[] obtainValues(EventBean[] eventsPerStream, InternalEventRouterEntry entry, ExprEvaluatorContext exprEvaluatorContext, InstrumentationCommon instrumentation) {<NEW_LINE>instrumentation.qUpdateIStreamApplyAssignments(entry);<NEW_LINE>Object[] values = new Object[<MASK><NEW_LINE>for (int i = 0; i < entry.getAssignments().length; i++) {<NEW_LINE>instrumentation.qUpdateIStreamApplyAssignmentItem(i);<NEW_LINE>Object value = entry.getAssignments()[i].evaluate(eventsPerStream, true, exprEvaluatorContext);<NEW_LINE>if ((value != null) && (entry.getWideners()[i] != null)) {<NEW_LINE>value = entry.getWideners()[i].widen(value);<NEW_LINE>}<NEW_LINE>values[i] = value;<NEW_LINE>instrumentation.aUpdateIStreamApplyAssignmentItem(value);<NEW_LINE>}<NEW_LINE>instrumentation.aUpdateIStreamApplyAssignments(values);<NEW_LINE>return values;<NEW_LINE>}
entry.getAssignments().length];
375,724
public ResourceOptionsDto availableOperations(UriInfo context) {<NEW_LINE>final IdentityService identityService = getIdentityService();<NEW_LINE>UriBuilder baseUriBuilder = context.getBaseUriBuilder().path(relativeRootResourcePath).path(UserRestService.PATH);<NEW_LINE>ResourceOptionsDto resourceOptionsDto = new ResourceOptionsDto();<NEW_LINE>// GET /<NEW_LINE>URI baseUri = baseUriBuilder.build();<NEW_LINE>resourceOptionsDto.addReflexiveLink(baseUri, HttpMethod.GET, "list");<NEW_LINE>// GET /count<NEW_LINE>URI countUri = baseUriBuilder.clone().path("/count").build();<NEW_LINE>resourceOptionsDto.addReflexiveLink(countUri, HttpMethod.GET, "count");<NEW_LINE>// POST /create<NEW_LINE>if (!identityService.isReadOnly() && isAuthorized(CREATE)) {<NEW_LINE>URI createUri = baseUriBuilder.clone().<MASK><NEW_LINE>resourceOptionsDto.addReflexiveLink(createUri, HttpMethod.POST, "create");<NEW_LINE>}<NEW_LINE>return resourceOptionsDto;<NEW_LINE>}
path("/create").build();
1,562,429
final CreateBotVersionResult executeCreateBotVersion(CreateBotVersionRequest createBotVersionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createBotVersionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateBotVersionRequest> request = null;<NEW_LINE>Response<CreateBotVersionResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new CreateBotVersionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createBotVersionRequest));<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, "Lex Models V2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateBotVersion");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateBotVersionResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateBotVersionResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
1,165,725
private void proxy(HttpServletRequest req, HttpServletResponse resp, String path) throws IOException {<NEW_LINE>AsyncContext async = req.startAsync();<NEW_LINE>String relPath = path.substring(proxyPath.length());<NEW_LINE>StringBuilder sb = new StringBuilder(proxyUrl);<NEW_LINE>if (!relPath.isEmpty() && !proxyUrl.endsWith("/")) {<NEW_LINE>sb.append("/");<NEW_LINE>}<NEW_LINE>sb.append(relPath);<NEW_LINE>if (req.getQueryString() != null) {<NEW_LINE>sb.append("?").append(req.getQueryString());<NEW_LINE>}<NEW_LINE>log.debug("Trying to serve '" + relPath + "' from '" + sb + "'");<NEW_LINE>Request proxyReq = httpClient.newRequest(sb.toString());<NEW_LINE>proxyReq.method(req.getMethod());<NEW_LINE><MASK><NEW_LINE>proxyReq.content(new InputStreamContentProvider(req.getInputStream()));<NEW_LINE>HeaderSender headerSender = new HeaderSender(resp);<NEW_LINE>proxyReq.onResponseContent((response, responseContent) -> {<NEW_LINE>headerSender.send(response);<NEW_LINE>try {<NEW_LINE>WritableByteChannel channel = Channels.newChannel(resp.getOutputStream());<NEW_LINE>while (responseContent.remaining() > 0) {<NEW_LINE>channel.write(responseContent);<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>proxyReq.send(result -> {<NEW_LINE>headerSender.send(result.getResponse());<NEW_LINE>async.complete();<NEW_LINE>});<NEW_LINE>}
copyRequestHeaders(req, proxyReq::header);
488,837
private static boolean updateBuildProperties(EditableProperties ep) {<NEW_LINE>boolean changed = false;<NEW_LINE>// NOI18N<NEW_LINE>JavaPlatform[] installedPlatforms = JavaPlatformManager.getDefault().getPlatforms(null, new Specification("j2se", null));<NEW_LINE>for (int i = 0; i < installedPlatforms.length; i++) {<NEW_LINE>// Handle only platforms created by this module<NEW_LINE>if (!installedPlatforms[i].equals(JavaPlatformManager.getDefault().getDefaultPlatform()) && installedPlatforms[i] instanceof J2SEPlatformImpl) {<NEW_LINE>String systemName = ((J2SEPlatformImpl) installedPlatforms[i]).getAntName();<NEW_LINE>// NOI18N<NEW_LINE>String key = PlatformConvertor.createName(systemName, "home");<NEW_LINE>if (!ep.containsKey(key)) {<NEW_LINE>try {<NEW_LINE>PlatformConvertor.generatePlatformProperties(installedPlatforms<MASK><NEW_LINE>changed = true;<NEW_LINE>} catch (PlatformConvertor.BrokenPlatformException b) {<NEW_LINE>Logger.getLogger(J2SEPlatformModule.class.getName()).info("Platform: " + installedPlatforms[i].getDisplayName() + " is missing: " + b.getMissingTool());<NEW_LINE>} catch (IOException ioe) {<NEW_LINE>Exceptions.printStackTrace(ioe);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return changed;<NEW_LINE>}
[i], systemName, ep);
693,062
private final void createToolBar() {<NEW_LINE>// New, Save, Copy<NEW_LINE>{<NEW_LINE>toolBar.add(aNew.getButton());<NEW_LINE>toolBar.<MASK><NEW_LINE>toolBar.add(aCopy.getButton());<NEW_LINE>if (CopyRecordFactory.isEnabled()) {<NEW_LINE>// metas: c.ghita@metas.ro<NEW_LINE>toolBar.add(aCopyDetails.getButton());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Ignore, Delete<NEW_LINE>{<NEW_LINE>addToolbarSeparator();<NEW_LINE>// ESC<NEW_LINE>toolBar.add(aIgnore.getButton());<NEW_LINE>toolBar.add(aDelete.getButton());<NEW_LINE>toolBar.add(aDeleteSelection.getButton());<NEW_LINE>}<NEW_LINE>// Switch single/grid, Find, History, ZoomAccross, Refresh<NEW_LINE>{<NEW_LINE>addToolbarSeparator();<NEW_LINE>if (// metas-2009_0021_AP1_CR059<NEW_LINE>m_curGC == null || !m_curGC.getMTab().isGridModeOnly()) {<NEW_LINE>toolBar.add(aMulti.getButton());<NEW_LINE>}<NEW_LINE>if (// metas: Suche ausblenden?<NEW_LINE>m_curGC == null || m_curGC.getMTab().isSearchActive()) {<NEW_LINE>toolBar.add(aFind.getButton());<NEW_LINE>}<NEW_LINE>if (!isTabIncluded) {<NEW_LINE>// F9<NEW_LINE>toolBar.add(aHistory.getButton());<NEW_LINE>}<NEW_LINE>toolBar.add(aZoomAcross.getButton());<NEW_LINE>// F5<NEW_LINE>toolBar.add(aRefresh.getButton());<NEW_LINE>}<NEW_LINE>// Process, Attachment, EMail, Chat<NEW_LINE>{<NEW_LINE>addToolbarSeparator();<NEW_LINE>// metas: us1247<NEW_LINE>toolBar.add(AProcess.createAppsAction(this, isTabIncluded).getButton());<NEW_LINE>toolBar.add(aAttachment.getButton());<NEW_LINE>// metas-2009_0017_AP1_G41<NEW_LINE>toolBar.add(AEMailLetter.createAppsAction(this, isTabIncluded).getButton());<NEW_LINE>toolBar.add(aChat.getButton());<NEW_LINE>}<NEW_LINE>// Reporting and printing<NEW_LINE>{<NEW_LINE>addToolbarSeparator();<NEW_LINE>toolBar.add(aPrintPreview.getButton());<NEW_LINE>toolBar.add(aPrint.getButton());<NEW_LINE>}<NEW_LINE>// Archive / Request<NEW_LINE>{<NEW_LINE>addToolbarSeparator();<NEW_LINE>toolBar.add(aArchive.getButton());<NEW_LINE>toolBar.add(aRequest.getButton());<NEW_LINE>}<NEW_LINE>// Navigation (First, Previous, Next etc)<NEW_LINE>{<NEW_LINE>addToolbarSeparator();<NEW_LINE>toolBar.add(aFirst.getButton());<NEW_LINE>toolBar.add(aPrevious.getButton());<NEW_LINE>toolBar.add(aNext.getButton());<NEW_LINE>toolBar.add(aLast.getButton());<NEW_LINE>if (!isTabIncluded) {<NEW_LINE>toolBar.add(aParent.getButton());<NEW_LINE>toolBar.add(aDetail.getButton());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Customize grid columns, Help<NEW_LINE>{<NEW_LINE>addToolbarSeparator();<NEW_LINE>{<NEW_LINE>aToggleGridColumns = AGridColumnsToggle.createAppsAction(this, isTabIncluded);<NEW_LINE>aToggleGridColumns.setEnabled(false);<NEW_LINE>toolBar.add(aToggleGridColumns.getButton());<NEW_LINE>}<NEW_LINE>// F1<NEW_LINE>toolBar.add(aHelp.getButton());<NEW_LINE>}<NEW_LINE>}
add(aSave.getButton());