idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
1,556,755
private Resource.Builder doCreateResourceBuilder() {<NEW_LINE>if (!disableValidation) {<NEW_LINE>checkForNonPublicMethodIssues();<NEW_LINE>}<NEW_LINE>final Class<?> annotatedResourceClass = ModelHelper.getAnnotatedResourceClass(handlerClass);<NEW_LINE>final Path rPathAnnotation = annotatedResourceClass.getAnnotation(Path.class);<NEW_LINE>final boolean keepEncodedParams = (null != annotatedResourceClass.getAnnotation(Encoded.class));<NEW_LINE>final List<MediaType> defaultConsumedTypes = extractMediaTypes(annotatedResourceClass.getAnnotation(Consumes.class));<NEW_LINE>final List<MediaType> defaultProducedTypes = extractMediaTypes(annotatedResourceClass.getAnnotation(Produces.class));<NEW_LINE>final Collection<Class<? extends Annotation>> defaultNameBindings = ReflectionHelper.getAnnotationTypes(annotatedResourceClass, NameBinding.class);<NEW_LINE>final MethodList methodList = new MethodList(handlerClass);<NEW_LINE>final List<Parameter> resourceClassParameters = new LinkedList<>();<NEW_LINE><MASK><NEW_LINE>checkResourceClassFields(keepEncodedParams, InvocableValidator.isSingleton(handlerClass), resourceClassParameters);<NEW_LINE>Resource.Builder resourceBuilder;<NEW_LINE>if (null != rPathAnnotation) {<NEW_LINE>resourceBuilder = Resource.builder(rPathAnnotation.value());<NEW_LINE>} else {<NEW_LINE>resourceBuilder = Resource.builder();<NEW_LINE>}<NEW_LINE>boolean extended = false;<NEW_LINE>if (handlerClass.isAnnotationPresent(ExtendedResource.class)) {<NEW_LINE>resourceBuilder.extended(true);<NEW_LINE>extended = true;<NEW_LINE>}<NEW_LINE>resourceBuilder.name(handlerClass.getName());<NEW_LINE>addResourceMethods(resourceBuilder, methodList, resourceClassParameters, keepEncodedParams, defaultConsumedTypes, defaultProducedTypes, defaultNameBindings, extended);<NEW_LINE>addSubResourceMethods(resourceBuilder, methodList, resourceClassParameters, keepEncodedParams, defaultConsumedTypes, defaultProducedTypes, defaultNameBindings, extended);<NEW_LINE>addSubResourceLocators(resourceBuilder, methodList, resourceClassParameters, keepEncodedParams, extended);<NEW_LINE>if (LOGGER.isLoggable(Level.FINEST)) {<NEW_LINE>LOGGER.finest(LocalizationMessages.NEW_AR_CREATED_BY_INTROSPECTION_MODELER(resourceBuilder.toString()));<NEW_LINE>}<NEW_LINE>return resourceBuilder;<NEW_LINE>}
checkResourceClassSetters(methodList, keepEncodedParams, resourceClassParameters);
739,329
public Joystick[] loadJoysticks(InputManager inputManager) {<NEW_LINE>ControllerEnvironment ce = ControllerEnvironment.getDefaultEnvironment();<NEW_LINE>Controller[<MASK><NEW_LINE>List<Joystick> list = new ArrayList<>();<NEW_LINE>for (Controller c : ce.getControllers()) {<NEW_LINE>if (c.getType() == Controller.Type.KEYBOARD || c.getType() == Controller.Type.MOUSE)<NEW_LINE>continue;<NEW_LINE>logger.log(Level.FINE, "Attempting to create joystick for: \"{0}\"", c);<NEW_LINE>// Try to create it like a joystick<NEW_LINE>JInputJoystick stick = new JInputJoystick(inputManager, this, c, list.size(), c.getName());<NEW_LINE>for (Component comp : c.getComponents()) {<NEW_LINE>stick.addComponent(comp);<NEW_LINE>}<NEW_LINE>// If it has no axes then we'll assume it's not<NEW_LINE>// a joystick<NEW_LINE>if (stick.getAxisCount() == 0) {<NEW_LINE>logger.log(Level.FINE, "Not a joystick: {0}", c);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>joystickIndex.put(c, stick);<NEW_LINE>list.add(stick);<NEW_LINE>}<NEW_LINE>joysticks = list.toArray(new JInputJoystick[list.size()]);<NEW_LINE>return joysticks;<NEW_LINE>}
] cs = ce.getControllers();
1,342,822
public void testDeliveryDelayForDifferentDelaysTopic(HttpServletRequest request, HttpServletResponse response) throws Exception {<NEW_LINE>boolean testFailed = false;<NEW_LINE>JMSContext jmsContext = jmsTCFBindings.createContext();<NEW_LINE>Topic topic = (Topic) new InitialContext().lookup("java:comp/env/eis/topic");<NEW_LINE><MASK><NEW_LINE>int delay = 14700;<NEW_LINE>jmsProducer.setDeliveryDelay(delay);<NEW_LINE>StreamMessage sm = jmsContext.createStreamMessage();<NEW_LINE>String msgText = "TopicBindingsMessage1";<NEW_LINE>sm.writeString(msgText);<NEW_LINE>sm.writeLong(Calendar.getInstance().getTimeInMillis() + delay);<NEW_LINE>jmsProducer.send(topic, sm);<NEW_LINE>delay = 10100;<NEW_LINE>jmsProducer.setDeliveryDelay(delay);<NEW_LINE>sm = jmsContext.createStreamMessage();<NEW_LINE>msgText = "TopicBindingsMessage2";<NEW_LINE>sm.writeString(msgText);<NEW_LINE>sm.writeLong(Calendar.getInstance().getTimeInMillis() + delay);<NEW_LINE>jmsProducer.send(topic, sm);<NEW_LINE>Thread.sleep(20000);<NEW_LINE>jmsContext.close();<NEW_LINE>}
JMSProducer jmsProducer = jmsContext.createProducer();
1,748,996
protected void onHandleIntent(Intent intent) {<NEW_LINE>mTodoText = intent.getStringExtra(TODOTEXT);<NEW_LINE>mTodoUUID = (UUID) intent.getSerializableExtra(TODOUUID);<NEW_LINE>Log.d("OskarSchindler", "onHandleIntent called");<NEW_LINE>NotificationManager manager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);<NEW_LINE>Intent i = new Intent(this, ReminderActivity.class);<NEW_LINE>i.<MASK><NEW_LINE>Intent deleteIntent = new Intent(this, DeleteNotificationService.class);<NEW_LINE>deleteIntent.putExtra(TODOUUID, mTodoUUID);<NEW_LINE>Notification notification = new Notification.Builder(this).setContentTitle(mTodoText).setSmallIcon(R.drawable.ic_done_white_24dp).setAutoCancel(true).setDefaults(Notification.DEFAULT_SOUND).setDeleteIntent(PendingIntent.getService(this, mTodoUUID.hashCode(), deleteIntent, PendingIntent.FLAG_UPDATE_CURRENT)).setContentIntent(PendingIntent.getActivity(this, mTodoUUID.hashCode(), i, PendingIntent.FLAG_UPDATE_CURRENT)).build();<NEW_LINE>manager.notify(100, notification);<NEW_LINE>// Uri defaultRingone = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);<NEW_LINE>// MediaPlayer mp = new MediaPlayer();<NEW_LINE>// try{<NEW_LINE>// mp.setDataSource(this, defaultRingone);<NEW_LINE>// mp.setAudioStreamType(AudioManager.STREAM_NOTIFICATION);<NEW_LINE>// mp.prepare();<NEW_LINE>// mp.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {<NEW_LINE>// @Override<NEW_LINE>// public void onCompletion(MediaPlayer mp) {<NEW_LINE>// mp.release();<NEW_LINE>// }<NEW_LINE>// });<NEW_LINE>// mp.start();<NEW_LINE>//<NEW_LINE>// }<NEW_LINE>// catch (Exception e){<NEW_LINE>// e.printStackTrace();<NEW_LINE>// }<NEW_LINE>}
putExtra(TodoNotificationService.TODOUUID, mTodoUUID);
1,132,245
public long addFile(final String fileName) throws IOException {<NEW_LINE>filesLock.acquireWriteLock();<NEW_LINE>try {<NEW_LINE>checkForClose();<NEW_LINE>Integer fileId = nameIdMap.get(fileName);<NEW_LINE>final OFile fileClassic;<NEW_LINE>if (fileId != null && fileId >= 0) {<NEW_LINE>throw new OStorageException("File with name " + fileName + " already exists in storage " + storageName);<NEW_LINE>}<NEW_LINE>if (fileId == null) {<NEW_LINE>while (true) {<NEW_LINE>final int nextId = fileIdGen.nextInt(Integer.MAX_VALUE - 1) + 1;<NEW_LINE>if (!idNameMap.containsKey(nextId) && !idNameMap.containsKey(-nextId)) {<NEW_LINE>fileId = nextId;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>idNameMap.remove(fileId);<NEW_LINE>fileId = -fileId;<NEW_LINE>}<NEW_LINE>fileClassic = createFileInstance(fileName, fileId);<NEW_LINE>createFile(fileClassic, callFsync);<NEW_LINE>final long externalId = composeFileId(id, fileId);<NEW_LINE>files.add(externalId, fileClassic);<NEW_LINE>nameIdMap.put(fileName, fileId);<NEW_LINE>idNameMap.put(fileId, fileName);<NEW_LINE>writeNameIdEntry(new NameFileIdEntry(fileName, fileId, fileClassic.getName()), true);<NEW_LINE>return externalId;<NEW_LINE>} catch (final InterruptedException e) {<NEW_LINE>throw OException.wrapException(<MASK><NEW_LINE>} finally {<NEW_LINE>filesLock.releaseWriteLock();<NEW_LINE>}<NEW_LINE>}
new OStorageException("File add was interrupted"), e);
933,865
private Map<String, RequestParameter> validateQueryParams(RoutingContext routingContext) throws ValidationException {<NEW_LINE>// Validation process validate only params that are registered in the validation -> extra params are allowed<NEW_LINE>Map<String, RequestParameter> parsedParams = new HashMap<>();<NEW_LINE>MultiMap queryParams = MultiMap.caseInsensitiveMultiMap().addAll(routingContext.queryParams());<NEW_LINE>for (ParameterValidationRule rule : queryParamsRules.values()) {<NEW_LINE><MASK><NEW_LINE>if (queryParams.contains(name)) {<NEW_LINE>List<String> p = queryParams.getAll(name);<NEW_LINE>queryParams.remove(name);<NEW_LINE>if (p.size() != 0) {<NEW_LINE>RequestParameter parsedParam = rule.validateArrayParam(p);<NEW_LINE>if (parsedParams.containsKey(parsedParam.getName()))<NEW_LINE>parsedParam = parsedParam.merge(parsedParams.get(parsedParam.getName()));<NEW_LINE>parsedParams.put(parsedParam.getName(), parsedParam);<NEW_LINE>} else {<NEW_LINE>throw ValidationException.ValidationExceptionFactory.generateNotMatchValidationException(name + " can't be empty");<NEW_LINE>}<NEW_LINE>} else if (rule.parameterTypeValidator().getDefault() != null) {<NEW_LINE>RequestParameter parsedParam = new RequestParameterImpl(name, rule.parameterTypeValidator().getDefault());<NEW_LINE>if (parsedParams.containsKey(parsedParam.getName()))<NEW_LINE>parsedParam = parsedParam.merge(parsedParams.get(parsedParam.getName()));<NEW_LINE>parsedParams.put(parsedParam.getName(), parsedParam);<NEW_LINE>} else if (!rule.isOptional())<NEW_LINE>throw ValidationException.ValidationExceptionFactory.generateNotFoundValidationException(name, ParameterLocation.QUERY);<NEW_LINE>}<NEW_LINE>if (queryAdditionalPropertiesValidator != null) {<NEW_LINE>for (Map.Entry<String, String> e : queryParams.entries()) {<NEW_LINE>try {<NEW_LINE>Map<String, RequestParameter> r = new HashMap<>();<NEW_LINE>r.put(e.getKey(), queryAdditionalPropertiesValidator.isValid(e.getValue()));<NEW_LINE>RequestParameter parsedParam = new RequestParameterImpl(queryAdditionalPropertiesObjectPropertyName, r);<NEW_LINE>if (parsedParams.containsKey(queryAdditionalPropertiesObjectPropertyName))<NEW_LINE>parsedParam = parsedParam.merge(parsedParams.get(queryAdditionalPropertiesObjectPropertyName));<NEW_LINE>parsedParams.put(parsedParam.getName(), parsedParam);<NEW_LINE>} catch (ValidationException ex) {<NEW_LINE>ex.setParameterName(queryAdditionalPropertiesObjectPropertyName);<NEW_LINE>e.setValue(e.getValue());<NEW_LINE>throw ex;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return parsedParams;<NEW_LINE>}
String name = rule.getName();
1,289,551
public S3Action unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>S3Action s3Action = new S3Action();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 1;<NEW_LINE>while (true) {<NEW_LINE>XMLEvent xmlEvent = context.nextEvent();<NEW_LINE>if (xmlEvent.isEndDocument())<NEW_LINE>return s3Action;<NEW_LINE>if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {<NEW_LINE>if (context.testExpression("TopicArn", targetDepth)) {<NEW_LINE>s3Action.setTopicArn(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("BucketName", targetDepth)) {<NEW_LINE>s3Action.setBucketName(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("ObjectKeyPrefix", targetDepth)) {<NEW_LINE>s3Action.setObjectKeyPrefix(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("KmsKeyArn", targetDepth)) {<NEW_LINE>s3Action.setKmsKeyArn(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent.isEndElement()) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return s3Action;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
822,819
protected Label createDescriptionLabel(Composite parent) {<NEW_LINE>if (isDataSourcePreferencePage()) {<NEW_LINE>Composite composite = UIUtils.createPlaceholder(parent, 2);<NEW_LINE>composite.setFont(parent.getFont());<NEW_LINE>composite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));<NEW_LINE>dataSourceSettingsButton = new Button(composite, SWT.CHECK);<NEW_LINE>dataSourceSettingsButton.addSelectionListener(new SelectionAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void widgetSelected(SelectionEvent e) {<NEW_LINE>boolean enabled = dataSourceSettingsButton.getSelection();<NEW_LINE>enableDataSourceSpecificSettings(enabled);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>String dataSourceName = dataSourceContainer.getName();<NEW_LINE>dataSourceSettingsButton.setText(NLS.bind(UINavigatorMessages.pref_page_target_button_use_datasource_settings, dataSourceName));<NEW_LINE>GridData gd = new GridData(GridData.FILL_HORIZONTAL);<NEW_LINE>dataSourceSettingsButton.setLayoutData(gd);<NEW_LINE>changeSettingsTargetLink = createLink(composite, UINavigatorMessages.pref_page_target_link_show_global_settings);<NEW_LINE>changeSettingsTargetLink.setLayoutData(new GridData(SWT.END, SWT.CENTER, false, false));<NEW_LINE>} else if (supportsDataSourceSpecificOptions()) {<NEW_LINE>changeSettingsTargetLink = createLink(parent, UINavigatorMessages.pref_page_target_link_show_datasource_settings);<NEW_LINE>changeSettingsTargetLink.setLayoutData(new GridData(SWT.END, SWT<MASK><NEW_LINE>}<NEW_LINE>Label horizontalLine = new Label(parent, SWT.SEPARATOR | SWT.HORIZONTAL);<NEW_LINE>horizontalLine.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, 2, 1));<NEW_LINE>horizontalLine.setFont(parent.getFont());<NEW_LINE>createPreferenceHeader(parent);<NEW_LINE>return super.createDescriptionLabel(parent);<NEW_LINE>}
.CENTER, true, false));
692,830
private Where addWhereClauseForRowRange(String keyAlias, Select select, RowRange<?> rowRange) {<NEW_LINE>Where where = null;<NEW_LINE>boolean keyIsPresent = false;<NEW_LINE>boolean tokenIsPresent = false;<NEW_LINE>if (rowRange.getStartKey() != null || rowRange.getEndKey() != null) {<NEW_LINE>keyIsPresent = true;<NEW_LINE>}<NEW_LINE>if (rowRange.getStartToken() != null || rowRange.getEndToken() != null) {<NEW_LINE>tokenIsPresent = true;<NEW_LINE>}<NEW_LINE>if (keyIsPresent && tokenIsPresent) {<NEW_LINE>throw new RuntimeException("Cannot provide both token and keys for range query");<NEW_LINE>}<NEW_LINE>if (keyIsPresent) {<NEW_LINE>if (rowRange.getStartKey() != null && rowRange.getEndKey() != null) {<NEW_LINE>where = select.where(gte(keyAlias, BIND_MARKER)).and<MASK><NEW_LINE>} else if (rowRange.getStartKey() != null) {<NEW_LINE>where = select.where(gte(keyAlias, BIND_MARKER));<NEW_LINE>} else if (rowRange.getEndKey() != null) {<NEW_LINE>where = select.where(lte(keyAlias, BIND_MARKER));<NEW_LINE>}<NEW_LINE>} else if (tokenIsPresent) {<NEW_LINE>String tokenOfKey = "token(" + keyAlias + ")";<NEW_LINE>if (rowRange.getStartToken() != null && rowRange.getEndToken() != null) {<NEW_LINE>where = select.where(gte(tokenOfKey, BIND_MARKER)).and(lte(tokenOfKey, BIND_MARKER));<NEW_LINE>} else if (rowRange.getStartToken() != null) {<NEW_LINE>where = select.where(gte(tokenOfKey, BIND_MARKER));<NEW_LINE>} else if (rowRange.getEndToken() != null) {<NEW_LINE>where = select.where(lte(tokenOfKey, BIND_MARKER));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>where = select.where();<NEW_LINE>}<NEW_LINE>if (rowRange.getCount() > 0) {<NEW_LINE>// TODO: fix this<NEW_LINE>// where.limit(rowRange.getCount());<NEW_LINE>}<NEW_LINE>return where;<NEW_LINE>}
(lte(keyAlias, BIND_MARKER));
704,083
private Mono<Response<Void>> deleteWithResponseAsync(String resourceGroupName, String integrationAccountName, String partnerName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (integrationAccountName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter integrationAccountName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (partnerName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter partnerName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = <MASK><NEW_LINE>return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, integrationAccountName, partnerName, this.client.getApiVersion(), accept, context);<NEW_LINE>}
this.client.mergeContext(context);
1,024,196
public void createPartControl(Composite aParent) {<NEW_LINE>super.createPartControl(aParent);<NEW_LINE>getGitRepositoryManager().addListener(this);<NEW_LINE>if (fChangedFilesFilterProjects.contains(selectedProject)) {<NEW_LINE>UIJob job = new // $NON-NLS-1$<NEW_LINE>// $NON-NLS-1$<NEW_LINE>UIJob("Turn on git filter initially") {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public IStatus runInUIThread(IProgressMonitor monitor) {<NEW_LINE>addGitChangedFilesFilter();<NEW_LINE>return Status.OK_STATUS;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>EclipseUtil.setSystemForJob(job);<NEW_LINE>job.setPriority(Job.SHORT);<NEW_LINE>job.schedule(300);<NEW_LINE>}<NEW_LINE>// Calculate the pull indicators in a recurring background job!<NEW_LINE>pullCalc = new // $NON-NLS-1$<NEW_LINE>// $NON-NLS-1$<NEW_LINE>Job("Calculating git pull indicators") {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected IStatus run(IProgressMonitor monitor) {<NEW_LINE>// Don't do any work if user has turned off calc'ing pull indicators.<NEW_LINE>boolean performFetches = Platform.getPreferencesService().getBoolean(GitPlugin.getPluginId(), IPreferenceConstants.GIT_CALCULATE_PULL_INDICATOR, false, null);<NEW_LINE>if (!performFetches) {<NEW_LINE>// FIXME Listen for change to this pref and then schedule if it gets turned on!<NEW_LINE>return Status.OK_STATUS;<NEW_LINE>}<NEW_LINE>if (monitor != null && monitor.isCanceled())<NEW_LINE>return Status.CANCEL_STATUS;<NEW_LINE>GitRepository repo = getGitRepositoryManager().getAttached(selectedProject);<NEW_LINE>if (repo == null) {<NEW_LINE>// FIXME Don't reschedule, listen for repo attachment and then start running this.<NEW_LINE>// reschedule for 5 minutes after we return!<NEW_LINE>schedule(5 * 60 * 1000);<NEW_LINE>return Status.OK_STATUS;<NEW_LINE>}<NEW_LINE>if (monitor != null && monitor.isCanceled())<NEW_LINE>return Status.CANCEL_STATUS;<NEW_LINE>synchronized (branchToPullIndicator) {<NEW_LINE>branchToPullIndicator.clear();<NEW_LINE>}<NEW_LINE>Set<String> branchesToPull = repo.getOutOfDateBranches();<NEW_LINE>for (String branch : repo.localBranches()) {<NEW_LINE>if (monitor != null && monitor.isCanceled())<NEW_LINE>return Status.CANCEL_STATUS;<NEW_LINE>synchronized (branchToPullIndicator) {<NEW_LINE>branchToPullIndicator.put(branch, branchesToPull.contains(branch));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>refreshUI(repo);<NEW_LINE>if (monitor != null && monitor.isCanceled())<NEW_LINE>return Status.CANCEL_STATUS;<NEW_LINE>// TODO Allow user to have control over how often we poll<NEW_LINE>// reschedule for 5 minutes after we return!<NEW_LINE>schedule(5 * 60 * 1000);<NEW_LINE>return Status.OK_STATUS;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>EclipseUtil.setSystemForJob(pullCalc);<NEW_LINE><MASK><NEW_LINE>pullCalc.schedule();<NEW_LINE>}
pullCalc.setPriority(Job.LONG);
1,655,174
private void doUpdateVisitedHistory(String url) {<NEW_LINE>ContentResolver cr = mContext.getContentResolver();<NEW_LINE>Cursor c = null;<NEW_LINE>try {<NEW_LINE>c = cr.query(History.CONTENT_URI, new String[] { History._ID, History.VISITS }, History.URL + "=?", new String[] { url }, null);<NEW_LINE>if (c.moveToFirst()) {<NEW_LINE>ContentValues values = new ContentValues();<NEW_LINE>values.put(History.VISITS, c.getInt(1) + 1);<NEW_LINE>values.put(History.DATE_LAST_VISITED, System.currentTimeMillis());<NEW_LINE>cr.update(ContentUris.withAppendedId(History.CONTENT_URI, c.getLong(0)), values, null, null);<NEW_LINE>} else {<NEW_LINE>// android.provider.Browser.truncateHistory(cr);<NEW_LINE>ContentValues values = new ContentValues();<NEW_LINE>values.<MASK><NEW_LINE>values.put(History.VISITS, 1);<NEW_LINE>values.put(History.DATE_LAST_VISITED, System.currentTimeMillis());<NEW_LINE>values.put(History.TITLE, url);<NEW_LINE>values.put(History.DATE_CREATED, 0);<NEW_LINE>values.put(History.USER_ENTERED, 0);<NEW_LINE>cr.insert(History.CONTENT_URI, values);<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>if (c != null)<NEW_LINE>c.close();<NEW_LINE>}<NEW_LINE>}
put(History.URL, url);
1,384,158
public RedshiftDestinationProperties unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>RedshiftDestinationProperties redshiftDestinationProperties = new RedshiftDestinationProperties();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("object", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>redshiftDestinationProperties.setObject(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("intermediateBucketName", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>redshiftDestinationProperties.setIntermediateBucketName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("bucketPrefix", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>redshiftDestinationProperties.setBucketPrefix(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("errorHandlingConfig", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>redshiftDestinationProperties.setErrorHandlingConfig(ErrorHandlingConfigJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return redshiftDestinationProperties;<NEW_LINE>}
class).unmarshall(context));
1,408,619
protected void encodeSubmenu(FacesContext context, SplitButton button, Submenu submenu) throws IOException {<NEW_LINE>if (!submenu.isRendered()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ResponseWriter writer = context.getResponseWriter();<NEW_LINE>String label = submenu.getLabel();<NEW_LINE>String style = submenu.getStyle();<NEW_LINE>String styleClass = submenu.getStyleClass();<NEW_LINE>styleClass = styleClass == null ? Menu.SUBMENU_TITLE_CLASS : Menu.SUBMENU_TITLE_CLASS + " " + styleClass;<NEW_LINE>writer.startElement("li", null);<NEW_LINE>writer.<MASK><NEW_LINE>if (style != null) {<NEW_LINE>writer.writeAttribute("style", style, null);<NEW_LINE>}<NEW_LINE>writer.startElement("h3", null);<NEW_LINE>if (label != null) {<NEW_LINE>writer.writeText(label, "value");<NEW_LINE>}<NEW_LINE>writer.endElement("h3");<NEW_LINE>writer.endElement("li");<NEW_LINE>encodeElements(context, button, submenu.getElements(), true);<NEW_LINE>}
writeAttribute("class", styleClass, null);
1,225,720
private static ResultCursor handleExplainDdl(ExecutionContext executionContext, ExecutionPlan executionPlan) {<NEW_LINE>if (executionPlan.getPlan() instanceof BaseDdlOperation) {<NEW_LINE>final BaseDdlOperation plan = (BaseDdlOperation) executionPlan.getPlan();<NEW_LINE>ArrayResultCursor result = new ArrayResultCursor("ExecutionPlan");<NEW_LINE>result.addColumn("Logical ExecutionPlan", DataTypes.StringType);<NEW_LINE>result.addColumn("DDL Sql", DataTypes.StringType);<NEW_LINE>result.addColumn("Logical_Table", DataTypes.StringType);<NEW_LINE>result.addColumn("Sharding", DataTypes.StringType);<NEW_LINE>result.<MASK><NEW_LINE>result.initMeta();<NEW_LINE>result.addRow(new Object[] { "DDL:ReturnType:" + plan.getRowType() + ",HitCache:" + executionPlan.isHitCache(), executionPlan.getAst().toString(), plan.getTableName(), "", -1 });<NEW_LINE>return result;<NEW_LINE>} else {<NEW_LINE>return handleExplain(executionContext, executionPlan, ExplainResult.ExplainMode.DETAIL);<NEW_LINE>}<NEW_LINE>}
addColumn("Count", DataTypes.IntegerType);
775,003
final DescribeDomainEndpointOptionsResult executeDescribeDomainEndpointOptions(DescribeDomainEndpointOptionsRequest describeDomainEndpointOptionsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeDomainEndpointOptionsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<DescribeDomainEndpointOptionsRequest> request = null;<NEW_LINE>Response<DescribeDomainEndpointOptionsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeDomainEndpointOptionsRequestMarshaller().marshall(super.beforeMarshalling(describeDomainEndpointOptionsRequest));<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, "CloudSearch");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeDomainEndpointOptions");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DescribeDomainEndpointOptionsResult> responseHandler = new StaxResponseHandler<DescribeDomainEndpointOptionsResult>(new DescribeDomainEndpointOptionsResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
1,338,581
public void execute(RequestMethod method) throws IOException {<NEW_LINE>switch(method) {<NEW_LINE>case GET:<NEW_LINE>{<NEW_LINE>// add parameters<NEW_LINE>String combinedParams = "";<NEW_LINE>if (!params.isEmpty()) {<NEW_LINE>combinedParams += "?";<NEW_LINE>for (NameValuePair p : params) {<NEW_LINE>String paramString = p.getName() + "=" + URLEncoder.encode(p.getValue(), "UTF-8");<NEW_LINE>if (combinedParams.length() > 1) {<NEW_LINE>combinedParams += "&" + paramString;<NEW_LINE>} else {<NEW_LINE>combinedParams += paramString;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>HttpGet request = new HttpGet(url + combinedParams);<NEW_LINE>// add headers<NEW_LINE>for (NameValuePair h : headers) {<NEW_LINE>request.addHeader(h.getName(), h.getValue());<NEW_LINE>}<NEW_LINE>executeRequest(request, url);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case POST:<NEW_LINE>{<NEW_LINE>HttpPost request = new HttpPost(url);<NEW_LINE>// add headers<NEW_LINE>for (NameValuePair h : headers) {<NEW_LINE>request.addHeader(h.getName(<MASK><NEW_LINE>}<NEW_LINE>if (!params.isEmpty()) {<NEW_LINE>request.setEntity(new UrlEncodedFormEntity(params, HTTP.UTF_8));<NEW_LINE>}<NEW_LINE>executeRequest(request, url);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
), h.getValue());
1,156,821
private List<ExcelSheetData> parseExcel2(String filename, InputStream inputStream, boolean isPreview) throws Exception {<NEW_LINE>List<ExcelSheetData> excelSheetDataList = new ArrayList<>();<NEW_LINE>String suffix = filename.substring(filename.lastIndexOf(".") + 1);<NEW_LINE>if (StringUtils.equalsIgnoreCase(suffix, "xls")) {<NEW_LINE>ExcelXlsReader excelXlsReader = new ExcelXlsReader();<NEW_LINE>excelXlsReader.process(inputStream);<NEW_LINE>excelSheetDataList = excelXlsReader.totalSheets;<NEW_LINE>}<NEW_LINE>if (StringUtils.equalsIgnoreCase(suffix, "xlsx")) {<NEW_LINE>ExcelXlsxReader excelXlsxReader = new ExcelXlsxReader();<NEW_LINE>excelXlsxReader.process(inputStream);<NEW_LINE>excelSheetDataList = excelXlsxReader.totalSheets;<NEW_LINE>}<NEW_LINE>inputStream.close();<NEW_LINE>excelSheetDataList.forEach(excelSheetData -> {<NEW_LINE>List<List<String>> data = excelSheetData.getData();<NEW_LINE>String[] fieldArray = excelSheetData.getFields().stream().map(TableField::getFieldName).<MASK><NEW_LINE>List<Map<String, Object>> jsonArray = new ArrayList<>();<NEW_LINE>if (CollectionUtils.isNotEmpty(data)) {<NEW_LINE>jsonArray = data.stream().map(ele -> {<NEW_LINE>Map<String, Object> map = new HashMap<>();<NEW_LINE>for (int i = 0; i < ele.size(); i++) {<NEW_LINE>map.put(fieldArray[i], ele.get(i));<NEW_LINE>}<NEW_LINE>return map;<NEW_LINE>}).collect(Collectors.toList());<NEW_LINE>}<NEW_LINE>excelSheetData.setFieldsMd5(Md5Utils.md5(StringUtils.join(fieldArray, ",")));<NEW_LINE>excelSheetData.setJsonArray(jsonArray);<NEW_LINE>});<NEW_LINE>return excelSheetDataList;<NEW_LINE>}
toArray(String[]::new);
1,837,155
final GetPredictiveScalingForecastResult executeGetPredictiveScalingForecast(GetPredictiveScalingForecastRequest getPredictiveScalingForecastRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getPredictiveScalingForecastRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetPredictiveScalingForecastRequest> request = null;<NEW_LINE>Response<GetPredictiveScalingForecastResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetPredictiveScalingForecastRequestMarshaller().marshall(super.beforeMarshalling(getPredictiveScalingForecastRequest));<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, "Auto Scaling");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetPredictiveScalingForecast");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<GetPredictiveScalingForecastResult> responseHandler = new StaxResponseHandler<GetPredictiveScalingForecastResult>(new GetPredictiveScalingForecastResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
1,669,825
public void actionPerformed(AnActionEvent e) {<NEW_LINE>final VirtualFile projectFile = findProjectFile(e);<NEW_LINE>if (projectFile == null) {<NEW_LINE>FlutterMessages.showError("Error Opening Android Studio", "Project not found.", e.getProject());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final int modifiers = e.getModifiers();<NEW_LINE>// From ReopenProjectAction.<NEW_LINE>final boolean forceOpenInNewFrame = BitUtil.isSet(modifiers, InputEvent.CTRL_MASK) || BitUtil.isSet(modifiers, InputEvent.SHIFT_MASK) || e.getPlace() == ActionPlaces.WELCOME_SCREEN;<NEW_LINE>VirtualFile sourceFile = <MASK><NEW_LINE>// Using:<NEW_LINE>// ProjectUtil.openOrImport(projectFile.getPath(), e.getProject(), forceOpenInNewFrame);<NEW_LINE>// presents the user with a really imposing Gradle project import dialog.<NEW_LINE>openOrImportProject(projectFile, e.getProject(), sourceFile, forceOpenInNewFrame);<NEW_LINE>}
e.getData(CommonDataKeys.VIRTUAL_FILE);
692,621
private CompletableFuture<SessionDetails> reallyJoin(String realm, List<IAuthenticator> authenticators) {<NEW_LINE>LOGGER.d("Called join() with realm=" + realm);<NEW_LINE>mRealm = realm;<NEW_LINE>mAuthenticators = authenticators;<NEW_LINE>mGoodbyeSent = false;<NEW_LINE>Map<String, Map> roles = new HashMap<>();<NEW_LINE>roles.put("publisher", new HashMap<>());<NEW_LINE>roles.put("subscriber", new HashMap<>());<NEW_LINE>roles.put("caller", new HashMap<>());<NEW_LINE>roles.put("callee", new HashMap<>());<NEW_LINE>if (mAuthenticators == null) {<NEW_LINE>send(new Hello(realm, roles));<NEW_LINE>} else {<NEW_LINE>List<String> authMethods = new ArrayList<>();<NEW_LINE>String authID = null;<NEW_LINE>String authrole = null;<NEW_LINE>Map<String, Object> authextra = null;<NEW_LINE>for (IAuthenticator authenticator : mAuthenticators) {<NEW_LINE>authMethods.add(authenticator.getAuthMethod());<NEW_LINE>if (authenticator.getAuthMethod().equals(TicketAuth.authmethod)) {<NEW_LINE>TicketAuth auth = (TicketAuth) authenticator;<NEW_LINE>authID = auth.authid;<NEW_LINE>} else if (authenticator.getAuthMethod().equals(ChallengeResponseAuth.authmethod)) {<NEW_LINE>ChallengeResponseAuth auth = (ChallengeResponseAuth) authenticator;<NEW_LINE>authID = auth.authid;<NEW_LINE>authrole = auth.authrole;<NEW_LINE>} else if (authenticator.getAuthMethod().equals(CryptosignAuth.authmethod)) {<NEW_LINE>CryptosignAuth auth = (CryptosignAuth) authenticator;<NEW_LINE>authID = auth.authid;<NEW_LINE>authrole = auth.authrole;<NEW_LINE>authextra = auth.authextra;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>send(new Hello(realm, roles, authMethods, authID, authrole, authextra));<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>mState = STATE_HELLO_SENT;<NEW_LINE>return mJoinFuture;<NEW_LINE>}
mJoinFuture = new CompletableFuture<>();
784,164
public static double rawLogProbability(double x, double lambda) {<NEW_LINE>// Extreme lambda<NEW_LINE>if (lambda == 0) {<NEW_LINE>return ((x == 0) ? 1. : Double.NEGATIVE_INFINITY);<NEW_LINE>}<NEW_LINE>// Extreme values<NEW_LINE>if (Double.isInfinite(lambda) || x < 0) {<NEW_LINE>return Double.NEGATIVE_INFINITY;<NEW_LINE>}<NEW_LINE>if (x <= lambda * Double.MIN_NORMAL) {<NEW_LINE>return -lambda;<NEW_LINE>}<NEW_LINE>if (lambda < x * Double.MIN_NORMAL) {<NEW_LINE>return -lambda + x * FastMath.log(lambda) - GammaDistribution.logGamma(x + 1);<NEW_LINE>}<NEW_LINE>final double f = MathUtil.TWOPI * x;<NEW_LINE>final double y = -stirlingError(x<MASK><NEW_LINE>return -0.5 * FastMath.log(f) + y;<NEW_LINE>}
) - devianceTerm(x, lambda);
304,822
public static byte[] nonceGeneration(byte[] partialIV, byte[] senderID, byte[] commonIV, int nonceLength) throws OSException {<NEW_LINE>if (partialIV != null) {<NEW_LINE>if (senderID != null) {<NEW_LINE>if (commonIV != null) {<NEW_LINE>if (nonceLength > 0) {<NEW_LINE>int s = senderID.length;<NEW_LINE>int zeroes = 5 - partialIV.length;<NEW_LINE>if (zeroes > 0) {<NEW_LINE>partialIV = leftPaddingZeroes(partialIV, zeroes);<NEW_LINE>}<NEW_LINE>zeroes = (nonceLength - 6) - senderID.length;<NEW_LINE>if (zeroes > 0) {<NEW_LINE>senderID = leftPaddingZeroes(senderID, zeroes);<NEW_LINE>}<NEW_LINE>zeroes = nonceLength - commonIV.length;<NEW_LINE>if (zeroes > 0) {<NEW_LINE>commonIV = leftPaddingZeroes(commonIV, zeroes);<NEW_LINE>}<NEW_LINE>byte[] tmp = new byte[1 + senderID.length + partialIV.length];<NEW_LINE>tmp[0] = (byte) s;<NEW_LINE>System.arraycopy(senderID, 0, tmp, 1, senderID.length);<NEW_LINE>System.arraycopy(partialIV, 0, tmp, senderID.length + 1, partialIV.length);<NEW_LINE>byte[] result = new byte[commonIV.length];<NEW_LINE>int i = 0;<NEW_LINE>for (byte b : tmp) {<NEW_LINE>result[i] = (byte) (b ^ commonIV[i++]);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} else {<NEW_LINE>LOGGER.error(ErrorDescriptions.NONCE_LENGTH_INVALID);<NEW_LINE>throw new IllegalArgumentException(ErrorDescriptions.NONCE_LENGTH_INVALID);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>LOGGER.error(ErrorDescriptions.COMMON_IV_NULL);<NEW_LINE>throw new NullPointerException(ErrorDescriptions.COMMON_IV_NULL);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>LOGGER.error(ErrorDescriptions.SENDER_ID_NULL);<NEW_LINE>throw new NullPointerException(ErrorDescriptions.SENDER_ID_NULL);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>LOGGER.error(ErrorDescriptions.PARTIAL_IV_NULL);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
throw new NullPointerException(ErrorDescriptions.PARTIAL_IV_NULL);
1,507,317
public edu.stanford.nlp.loglinear.model.proto.GraphicalModelProto.GraphicalModel buildPartial() {<NEW_LINE>edu.stanford.nlp.loglinear.model.proto.GraphicalModelProto.GraphicalModel result = new edu.stanford.nlp.loglinear.model.proto.GraphicalModelProto.GraphicalModel(this);<NEW_LINE>int from_bitField0_ = bitField0_;<NEW_LINE>int to_bitField0_ = 0;<NEW_LINE>if (factorBuilder_ == null) {<NEW_LINE>if (((bitField0_ & 0x00000001) != 0)) {<NEW_LINE>factor_ = java.util.Collections.unmodifiableList(factor_);<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000001);<NEW_LINE>}<NEW_LINE>result.factor_ = factor_;<NEW_LINE>} else {<NEW_LINE>result.factor_ = factorBuilder_.build();<NEW_LINE>}<NEW_LINE>if (variableMetaDataBuilder_ == null) {<NEW_LINE>if (((bitField0_ & 0x00000002) != 0)) {<NEW_LINE>variableMetaData_ = java.util.Collections.unmodifiableList(variableMetaData_);<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000002);<NEW_LINE>}<NEW_LINE>result.variableMetaData_ = variableMetaData_;<NEW_LINE>} else {<NEW_LINE>result.variableMetaData_ = variableMetaDataBuilder_.build();<NEW_LINE>}<NEW_LINE>if (((from_bitField0_ & 0x00000004) != 0)) {<NEW_LINE>if (metaDataBuilder_ == null) {<NEW_LINE>result.metaData_ = metaData_;<NEW_LINE>} else {<NEW_LINE>result<MASK><NEW_LINE>}<NEW_LINE>to_bitField0_ |= 0x00000001;<NEW_LINE>}<NEW_LINE>result.bitField0_ = to_bitField0_;<NEW_LINE>onBuilt();<NEW_LINE>return result;<NEW_LINE>}
.metaData_ = metaDataBuilder_.build();
226,718
public Weight createWeight(IndexSearcher searcher, ScoreMode scoreMode, float boost) throws IOException {<NEW_LINE>final Weight fastMatchWeight = fastMatchQuery == null ? null : searcher.createWeight(fastMatchQuery, ScoreMode.COMPLETE_NO_SCORES, 1f);<NEW_LINE>return new ConstantScoreWeight(this, boost) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Scorer scorer(LeafReaderContext context) throws IOException {<NEW_LINE>final int maxDoc = context.reader().maxDoc();<NEW_LINE>final DocIdSetIterator approximation;<NEW_LINE>if (fastMatchWeight == null) {<NEW_LINE>approximation = DocIdSetIterator.all(maxDoc);<NEW_LINE>} else {<NEW_LINE>Scorer s = fastMatchWeight.scorer(context);<NEW_LINE>if (s == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>approximation = s.iterator();<NEW_LINE>}<NEW_LINE>final LongValues values = valueSource.getValues(context, null);<NEW_LINE>final TwoPhaseIterator twoPhase = new TwoPhaseIterator(approximation) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean matches() throws IOException {<NEW_LINE>return values.advanceExact(approximation.docID()) && range.accept(values.longValue());<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public float matchCost() {<NEW_LINE>// TODO: use cost of range.accept()<NEW_LINE>return 100;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>return new ConstantScoreScorer(this, <MASK><NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean isCacheable(LeafReaderContext ctx) {<NEW_LINE>return valueSource.isCacheable(ctx);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
score(), scoreMode, twoPhase);
1,544,088
private void loadNode138() {<NEW_LINE>BaseDataVariableTypeNode node = new BaseDataVariableTypeNode(this.context, Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics_TransferredToAltClientCount, new QualifiedName(0, "TransferredToAltClientCount"), new LocalizedText("en", "TransferredToAltClientCount"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.UInt32, -1, new UInteger[] {}, UByte.valueOf(1), UByte.valueOf(1), 0.0, false);<NEW_LINE>node.addReference(new Reference(Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics_TransferredToAltClientCount, Identifiers.HasTypeDefinition, Identifiers.BaseDataVariableType.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics_TransferredToAltClientCount, Identifiers.HasModellingRule, Identifiers.ModellingRule_Mandatory.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics_TransferredToAltClientCount, Identifiers.HasComponent, Identifiers.SubscriptionDiagnosticsArrayType_SubscriptionDiagnostics.expanded(), false));<NEW_LINE><MASK><NEW_LINE>}
this.nodeManager.addNode(node);
974,277
public Pair<GeneralDataset<L, F>, GeneralDataset<L, F>> split(int start, int end) {<NEW_LINE>int devSize = end - start;<NEW_LINE>int trainSize = size() - devSize;<NEW_LINE>int[][] devData = new int[devSize][];<NEW_LINE>double[][] devValues = new double[devSize][];<NEW_LINE>int[] devLabels = new int[devSize];<NEW_LINE>int[][] trainData = new int[trainSize][];<NEW_LINE>double[][] trainValues = new double[trainSize][];<NEW_LINE>int[] trainLabels = new int[trainSize];<NEW_LINE>synchronized (System.class) {<NEW_LINE>System.arraycopy(data, start, devData, 0, devSize);<NEW_LINE>System.arraycopy(values, start, devValues, 0, devSize);<NEW_LINE>System.arraycopy(labels, start, devLabels, 0, devSize);<NEW_LINE>System.arraycopy(data, 0, trainData, 0, start);<NEW_LINE>System.arraycopy(data, end, trainData, start, size() - end);<NEW_LINE>System.arraycopy(values, 0, trainValues, 0, start);<NEW_LINE>System.arraycopy(values, end, trainValues, start, size() - end);<NEW_LINE>System.arraycopy(labels, 0, trainLabels, 0, start);<NEW_LINE>System.arraycopy(labels, end, trainLabels, start, size() - end);<NEW_LINE>}<NEW_LINE>if (this instanceof WeightedRVFDataset<?, ?>) {<NEW_LINE>float[] trainWeights = new float[trainSize];<NEW_LINE>float[] devWeights = new float[devSize];<NEW_LINE>WeightedRVFDataset<L, F> w = (WeightedRVFDataset<L, F>) this;<NEW_LINE>synchronized (System.class) {<NEW_LINE>System.arraycopy(w.weights, start, devWeights, 0, devSize);<NEW_LINE>System.arraycopy(w.weights, 0, trainWeights, 0, start);<NEW_LINE>System.arraycopy(w.weights, end, trainWeights, start, size() - end);<NEW_LINE>}<NEW_LINE>WeightedRVFDataset<L, F> dev = new WeightedRVFDataset<>(labelIndex, devLabels, featureIndex, devData, devValues, devWeights);<NEW_LINE>WeightedRVFDataset<L, F> train = new WeightedRVFDataset<>(labelIndex, trainLabels, featureIndex, trainData, trainValues, trainWeights);<NEW_LINE>return new <MASK><NEW_LINE>} else {<NEW_LINE>GeneralDataset<L, F> dev = new RVFDataset<>(labelIndex, devLabels, featureIndex, devData, devValues);<NEW_LINE>GeneralDataset<L, F> train = new RVFDataset<>(labelIndex, trainLabels, featureIndex, trainData, trainValues);<NEW_LINE>return new Pair<>(train, dev);<NEW_LINE>}<NEW_LINE>}
Pair<>(train, dev);
511,677
public void addInvitedSignaling(MethodCall methodCall, final MethodChannel.Result result) {<NEW_LINE>HashMap<String, Object> info = CommonUtil.getParam(methodCall, result, "info");<NEW_LINE>V2TIMSignalingInfo param = new V2TIMSignalingInfo();<NEW_LINE>if (info.get("inviteID") != null) {<NEW_LINE>param.setInviteID((String) info.get("inviteID"));<NEW_LINE>}<NEW_LINE>if (info.get("groupID") != null) {<NEW_LINE>param.setGroupID((String) info.get("groupID"));<NEW_LINE>}<NEW_LINE>if (info.get("inviter") != null) {<NEW_LINE>param.setInviter((String) info.get("inviter"));<NEW_LINE>}<NEW_LINE>if (info.get("inviteeList") != null) {<NEW_LINE>param.setInviteeList((List<String>) info.get("inviteeList"));<NEW_LINE>}<NEW_LINE>if (info.get("data") != null) {<NEW_LINE>param.setData((String) info.get("data"));<NEW_LINE>}<NEW_LINE>if (info.get("timeout") != null) {<NEW_LINE>param.setTimeout((Integer) info.get("timeout"));<NEW_LINE>}<NEW_LINE>if (info.get("actionType") != null) {<NEW_LINE>param.setActionType((Integer) info.get("actionType"));<NEW_LINE>}<NEW_LINE>if (info.get("businessID") != null) {<NEW_LINE>param.setBusinessID((Integer) info.get("businessID"));<NEW_LINE>}<NEW_LINE>V2TIMManager.getSignalingManager().addInvitedSignaling(param, new V2TIMCallback() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onSuccess() {<NEW_LINE>CommonUtil.returnSuccess(result, null);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onError(int code, String desc) {<NEW_LINE>CommonUtil.<MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
returnError(result, code, desc);
841,791
protected String doIt() throws Exception {<NEW_LINE>log.info("SourceAcctSchema_ID=" + p_SourceAcctSchema_ID + ", TargetAcctSchema_ID=" + p_TargetAcctSchema_ID);<NEW_LINE>if (p_SourceAcctSchema_ID == 0 || p_TargetAcctSchema_ID == 0)<NEW_LINE>throw new AdempiereSystemError("ID=0");<NEW_LINE>if (p_SourceAcctSchema_ID == p_TargetAcctSchema_ID)<NEW_LINE>throw new AdempiereUserError("Must be different");<NEW_LINE>MAcctSchema source = MAcctSchema.get(getCtx(), p_SourceAcctSchema_ID, null);<NEW_LINE>if (source.get_ID() == 0)<NEW_LINE>throw new AdempiereSystemError("NotFound Source C_AcctSchema_ID=" + p_SourceAcctSchema_ID);<NEW_LINE>MAcctSchema target = new MAcctSchema(getCtx(), p_TargetAcctSchema_ID, get_TrxName());<NEW_LINE>if (target.get_ID() == 0)<NEW_LINE>throw new AdempiereSystemError("NotFound Target C_AcctSchema_ID=" + p_TargetAcctSchema_ID);<NEW_LINE>//<NEW_LINE>MAcctSchemaElement[<MASK><NEW_LINE>if (targetElements.length == 0)<NEW_LINE>throw new AdempiereUserError("NotFound Target C_AcctSchema_Element");<NEW_LINE>// Accounting Element must be the same<NEW_LINE>MAcctSchemaElement sourceAcctElement = source.getAcctSchemaElement(MAcctSchemaElement.ELEMENTTYPE_Account);<NEW_LINE>if (sourceAcctElement == null)<NEW_LINE>throw new AdempiereUserError("NotFound Source AC C_AcctSchema_Element");<NEW_LINE>MAcctSchemaElement targetAcctElement = target.getAcctSchemaElement(MAcctSchemaElement.ELEMENTTYPE_Account);<NEW_LINE>if (targetAcctElement == null)<NEW_LINE>throw new AdempiereUserError("NotFound Target AC C_AcctSchema_Element");<NEW_LINE>if (sourceAcctElement.getC_Element_ID() != targetAcctElement.getC_Element_ID())<NEW_LINE>throw new AdempiereUserError("@C_Element_ID@ different");<NEW_LINE>if (MAcctSchemaGL.get(getCtx(), p_TargetAcctSchema_ID) == null)<NEW_LINE>copyGL(target);<NEW_LINE>if (MAcctSchemaDefault.get(getCtx(), p_TargetAcctSchema_ID) == null)<NEW_LINE>copyDefault(target);<NEW_LINE>return "@OK@";<NEW_LINE>}
] targetElements = target.getAcctSchemaElements();
149,027
final CreateHostResult executeCreateHost(CreateHostRequest createHostRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createHostRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateHostRequest> request = null;<NEW_LINE>Response<CreateHostResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateHostRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createHostRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateHost");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateHostResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateHostResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.SERVICE_ID, "CodeStar connections");
656,613
public Observable<Boolean> namedJobExists(final String jobName) {<NEW_LINE>return masterMonitor.getMasterObservable().filter(md -> md != null).switchMap((Func1<MasterDescription, Observable<Boolean>>) masterDescription -> {<NEW_LINE>String uri = API_JOB_NAME_LIST + "/" + jobName;<NEW_LINE>logger.info("Calling GET on " + uri);<NEW_LINE>return HttpUtility.getGetResponse(masterDescription.getHostname(), masterDescription.getApiPort(), uri).onErrorResumeNext(throwable -> {<NEW_LINE>logger.warn("Can't connect to master: {}", throwable.getMessage(), throwable);<NEW_LINE>return Observable.error(throwable);<NEW_LINE>}).map(response -> {<NEW_LINE>logger.debug("Job cluster response: " + response);<NEW_LINE><MASK><NEW_LINE>return jsonArray.length() > 0;<NEW_LINE>}).retryWhen(retryLogic);<NEW_LINE>}).retryWhen(retryLogic);<NEW_LINE>}
JSONArray jsonArray = new JSONArray(response);
128,226
static public String add_escapes(String str) {<NEW_LINE>String retval = "";<NEW_LINE>char ch;<NEW_LINE>for (int i = 0; i < str.length(); i++) {<NEW_LINE>ch = str.charAt(i);<NEW_LINE>if (ch == '\b') {<NEW_LINE>retval += "\\b";<NEW_LINE>} else if (ch == '\t') {<NEW_LINE>retval += "\\t";<NEW_LINE>} else if (ch == '\n') {<NEW_LINE>retval += "\\n";<NEW_LINE>} else if (ch == '\f') {<NEW_LINE>retval += "\\f";<NEW_LINE>} else if (ch == '\r') {<NEW_LINE>retval += "\\r";<NEW_LINE>} else if (ch == '\"') {<NEW_LINE>retval += "\\\"";<NEW_LINE>} else if (ch == '\'') {<NEW_LINE>retval += "\\\'";<NEW_LINE>} else if (ch == '\\') {<NEW_LINE>retval += "\\\\";<NEW_LINE>} else if (ch < 0x20 || ch > 0x7e) {<NEW_LINE>String s = "0000" + Integer.toString(ch, 16);<NEW_LINE>retval += "\\u" + s.substring(s.length() - <MASK><NEW_LINE>} else {<NEW_LINE>retval += ch;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return retval;<NEW_LINE>}
4, s.length());
160,663
// find element in unsorted collection<NEW_LINE>private static void testSearch() {<NEW_LINE>Collection<String> collection = Lists.newArrayList("2", "14", "3", "13", "43");<NEW_LINE>MutableList<String> mutableList = FastList.newListWith("2", "14", "3", "13", "43");<NEW_LINE>Iterable<String> iterable = collection;<NEW_LINE>// find element in unsorted collection<NEW_LINE>String jdk = collection.stream().filter("13"::equals).findFirst().get();<NEW_LINE>String guava = Iterables.find(iterable, "13"::equals);<NEW_LINE>String apache = CollectionUtils.<MASK><NEW_LINE>String gs = mutableList.select("13"::equals).get(0);<NEW_LINE>// print find = 13:13:13:13<NEW_LINE>System.out.println("find = " + jdk + ":" + guava + ":" + apache + ":" + gs);<NEW_LINE>}
find(iterable, "13"::equals);
1,110,150
public void visit(BIRFunction birFunction) {<NEW_LINE>for (BIRErrorEntry errorEntry : birFunction.errorTable) {<NEW_LINE>addErrorTableDependency(errorEntry);<NEW_LINE>}<NEW_LINE>// First add all the instructions within the function to a list.<NEW_LINE>// This is done since the order of bb's cannot be guaranteed.<NEW_LINE>birFunction.parameters.values(<MASK><NEW_LINE>addDependency(birFunction.basicBlocks);<NEW_LINE>// Then visit and replace any temp moves<NEW_LINE>for (List<BIRBasicBlock> paramBBs : birFunction.parameters.values()) {<NEW_LINE>paramBBs.forEach(bb -> bb.accept(this));<NEW_LINE>}<NEW_LINE>birFunction.basicBlocks.forEach(bb -> bb.accept(this));<NEW_LINE>// Remove unused temp vars<NEW_LINE>List<BIRVariableDcl> newLocalVars = new ArrayList<>();<NEW_LINE>for (BIRVariableDcl var : birFunction.localVars) {<NEW_LINE>if (var.kind != VarKind.TEMP) {<NEW_LINE>newLocalVars.add(var);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (this.removedTempVars.contains(var)) {<NEW_LINE>// do not add<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>newLocalVars.add(var);<NEW_LINE>}<NEW_LINE>this.removedTempVars.clear();<NEW_LINE>this.tempVarUpdateInstructions.clear();<NEW_LINE>this.errorEntries.clear();<NEW_LINE>birFunction.localVars = newLocalVars;<NEW_LINE>}
).forEach(this::addDependency);
844,196
public <T extends Script, M> CompiledScript<T, M> loadFromDir(ScriptSource source, HashCode sourceHashCode, ClassLoaderScope targetScope, ClassPath scriptClassPath, File metadataCacheDir, CompileOperation<M> transformer, Class<T> scriptBaseClass) {<NEW_LINE>File metadataFile = new File(metadataCacheDir, METADATA_FILE_NAME);<NEW_LINE>try (KryoBackedDecoder decoder = new KryoBackedDecoder(new FileInputStream(metadataFile))) {<NEW_LINE>byte flags = decoder.readByte();<NEW_LINE>boolean isEmpty = (flags & EMPTY_FLAG) != 0;<NEW_LINE>boolean hasMethods = (flags & HAS_METHODS_FLAG) != 0;<NEW_LINE>M data;<NEW_LINE>if (transformer != null && transformer.getDataSerializer() != null) {<NEW_LINE>data = transformer.getDataSerializer().read(decoder);<NEW_LINE>} else {<NEW_LINE>data = null;<NEW_LINE>}<NEW_LINE>return new ClassesDirCompiledScript<>(isEmpty, hasMethods, scriptBaseClass, scriptClassPath, targetScope, source, sourceHashCode, data);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new IllegalStateException(String.format("Failed to deserialize script metadata extracted for %s", source<MASK><NEW_LINE>}<NEW_LINE>}
.getDisplayName()), e);
105,789
public void write(org.apache.thrift.protocol.TProtocol prot, create_atomic_multilog_args struct) throws org.apache.thrift.TException {<NEW_LINE>org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;<NEW_LINE>java.util.BitSet optionals = new java.util.BitSet();<NEW_LINE>if (struct.isSetName()) {<NEW_LINE>optionals.set(0);<NEW_LINE>}<NEW_LINE>if (struct.isSetSchema()) {<NEW_LINE>optionals.set(1);<NEW_LINE>}<NEW_LINE>if (struct.isSetMode()) {<NEW_LINE>optionals.set(2);<NEW_LINE>}<NEW_LINE>oprot.writeBitSet(optionals, 3);<NEW_LINE>if (struct.isSetName()) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (struct.isSetSchema()) {<NEW_LINE>{<NEW_LINE>oprot.writeI32(struct.schema.size());<NEW_LINE>for (rpc_column _iter20 : struct.schema) {<NEW_LINE>_iter20.write(oprot);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (struct.isSetMode()) {<NEW_LINE>oprot.writeI32(struct.mode.getValue());<NEW_LINE>}<NEW_LINE>}
oprot.writeString(struct.name);
670,862
public void endReport() {<NEW_LINE>FileOutputStream out = null;<NEW_LINE>try {<NEW_LINE>out = new FileOutputStream(reportPath);<NEW_LINE>wb.write(out);<NEW_LINE>Case.getCurrentCaseThrows().addReport(reportPath, NbBundle.getMessage(this.getClass(), "ReportExcel.endReport.srcModuleName.text"), "");<NEW_LINE>} catch (IOException ex) {<NEW_LINE>// NON-NLS<NEW_LINE>logger.log(<MASK><NEW_LINE>} catch (TskCoreException ex) {<NEW_LINE>// NON-NLS<NEW_LINE>String errorMessage = String.format("Error adding %s to case as a report", reportPath);<NEW_LINE>logger.log(Level.SEVERE, errorMessage, ex);<NEW_LINE>} catch (NoCurrentCaseException ex) {<NEW_LINE>// NON-NLS<NEW_LINE>logger.log(Level.SEVERE, "Exception while getting open case.", ex);<NEW_LINE>} finally {<NEW_LINE>if (out != null) {<NEW_LINE>try {<NEW_LINE>out.close();<NEW_LINE>} catch (IOException ex) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
Level.SEVERE, "Failed to write Excel report.", ex);
1,050,807
public void draw(CommandProcess process, GetStaticModel result) {<NEW_LINE>if (result.getMatchedClassLoaders() != null) {<NEW_LINE>process.write("Matched classloaders: \n");<NEW_LINE>ClassLoaderView.drawClassLoaders(process, result.getMatchedClassLoaders(), false);<NEW_LINE>process.write("\n");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int expand = result.getExpand();<NEW_LINE>if (result.getField() != null) {<NEW_LINE>ObjectVO field = result.getField();<NEW_LINE>String valueStr = StringUtils.objectToString(expand >= 0 ? new ObjectView(field.getValue(), expand).draw() : field.getValue());<NEW_LINE>process.write("field: " + field.getName() + "\n" + valueStr + "\n");<NEW_LINE>} else if (result.getMatchedClasses() != null) {<NEW_LINE>Element table = ClassUtils.renderMatchedClasses(result.getMatchedClasses());<NEW_LINE>process.write(RenderUtil.render(<MASK><NEW_LINE>}<NEW_LINE>}
table)).write("\n");
725,607
public OutputFormatterCallback<Target> createPostFactoStreamCallback(OutputStream out, QueryOptions options) {<NEW_LINE>return new OutputFormatterCallback<Target>() {<NEW_LINE><NEW_LINE>private Document doc;<NEW_LINE><NEW_LINE>private Element queryElem;<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void start() {<NEW_LINE>try {<NEW_LINE>DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();<NEW_LINE>doc = factory.newDocumentBuilder().newDocument();<NEW_LINE>} catch (ParserConfigurationException e) {<NEW_LINE>// This shouldn't be possible: all the configuration is hard-coded.<NEW_LINE>throw new IllegalStateException("XML output failed", e);<NEW_LINE>}<NEW_LINE>doc.setXmlVersion("1.1");<NEW_LINE>queryElem = doc.createElement("query");<NEW_LINE>queryElem.setAttribute("version", "2");<NEW_LINE>doc.appendChild(queryElem);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void processOutput(Iterable<Target> partialResult) throws InterruptedException {<NEW_LINE>for (Target target : partialResult) {<NEW_LINE>queryElem.appendChild(createTargetElement(doc, target));<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void close(boolean failFast) {<NEW_LINE>if (!failFast) {<NEW_LINE>try {<NEW_LINE>Transformer transformer = TransformerFactory.newInstance().newTransformer();<NEW_LINE>transformer.<MASK><NEW_LINE>transformer.transform(new DOMSource(doc), new StreamResult(out));<NEW_LINE>} catch (TransformerFactoryConfigurationError | TransformerException e) {<NEW_LINE>// This shouldn't be possible: all the configuration is hard-coded.<NEW_LINE>throw new IllegalStateException("XML output failed", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
setOutputProperty(OutputKeys.INDENT, "yes");
243,405
private static long queryLatestStatisticsTimestamp(Datastore datastore, @Nullable String namespace) throws DatastoreException {<NEW_LINE>Query.Builder query = Query.newBuilder();<NEW_LINE>// Note: namespace either being null or empty represents the default namespace, in which<NEW_LINE>// case we treat it as not provided by the user.<NEW_LINE>if (Strings.isNullOrEmpty(namespace)) {<NEW_LINE>query.addKindBuilder().setName("__Stat_Total__");<NEW_LINE>} else {<NEW_LINE>query.addKindBuilder().setName("__Stat_Ns_Total__");<NEW_LINE>}<NEW_LINE>query.addOrder(makeOrder("timestamp", DESCENDING));<NEW_LINE>query.setLimit(Int32Value.newBuilder<MASK><NEW_LINE>RunQueryRequest request = makeRequest(query.build(), namespace);<NEW_LINE>RunQueryResponse response = datastore.runQuery(request);<NEW_LINE>QueryResultBatch batch = response.getBatch();<NEW_LINE>if (batch.getEntityResultsCount() == 0) {<NEW_LINE>throw new NoSuchElementException("Datastore total statistics unavailable");<NEW_LINE>}<NEW_LINE>Entity entity = batch.getEntityResults(0).getEntity();<NEW_LINE>return entity.getProperties().get("timestamp").getTimestampValue().getSeconds() * 1000000;<NEW_LINE>}
().setValue(1));
1,013,028
public static byte[] readDialogEEPROMBytes(Component parent) {<NEW_LINE>// Choose file<NEW_LINE>File file = null;<NEW_LINE>JFileChooser fileChooser = new JFileChooser();<NEW_LINE>fileChooser.setCurrentDirectory(new java.io.File("."));<NEW_LINE>fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);<NEW_LINE>fileChooser.setDialogTitle("Select binary data");<NEW_LINE>if (fileChooser.showOpenDialog(parent) == JFileChooser.APPROVE_OPTION) {<NEW_LINE>file = fileChooser.getSelectedFile();<NEW_LINE>} else {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// Read file data<NEW_LINE>long fileSize = file.length();<NEW_LINE>byte[] fileData = <MASK><NEW_LINE>FileInputStream fileIn;<NEW_LINE>DataInputStream dataIn;<NEW_LINE>int offset = 0;<NEW_LINE>int numRead = 0;<NEW_LINE>try {<NEW_LINE>fileIn = new FileInputStream(file);<NEW_LINE>dataIn = new DataInputStream(fileIn);<NEW_LINE>while (offset < fileData.length && (numRead = dataIn.read(fileData, offset, fileData.length - offset)) >= 0) {<NEW_LINE>offset += numRead;<NEW_LINE>}<NEW_LINE>dataIn.close();<NEW_LINE>fileIn.close();<NEW_LINE>} catch (Exception ex) {<NEW_LINE>logger.debug("Exception ex: " + ex);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return fileData;<NEW_LINE>}
new byte[(int) fileSize];
346,340
private void buildJoinFilters() {<NEW_LINE>nameContext.setFindInSelect(false);<NEW_LINE>nameContext.setSelectFirst(false);<NEW_LINE>if (usingFields != null) {<NEW_LINE>for (String using : usingFields) {<NEW_LINE>using = StringUtil.removeBackQuote(using);<NEW_LINE>Pair<String, String> lName = findTbNameByUsing(this.getLeftNode(), using);<NEW_LINE>Pair<String, String> rName = findTbNameByUsing(this.getRightNode(), using);<NEW_LINE>if (lName.equals(rName)) {<NEW_LINE>throw new MySQLOutPutException(ErrorCode.ER_NONUNIQ_TABLE, "42000", "Not unique table/alias: '" + lName.getValue() + "'");<NEW_LINE>}<NEW_LINE>Item filter = setUpItem(genJoinFilter(using, lName, rName));<NEW_LINE>joinFilter.add((ItemFuncEqual) filter);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>for (int index = 0; index < joinFilter.size(); index++) {<NEW_LINE>Item <MASK><NEW_LINE>bf = setUpItem(bf);<NEW_LINE>if (bf.getReferTables().size() == 1) {<NEW_LINE>if (bf.getReferTables().iterator().next().type() == PlanNodeType.TABLE) {<NEW_LINE>throw new MySQLOutPutException(ErrorCode.ER_NONUNIQ_TABLE, "42000", "Not unique table/alias: '" + this.getLeftNode().getPureName() + "'");<NEW_LINE>} else {<NEW_LINE>// todo: query node and can push<NEW_LINE>throw new MySQLOutPutException(ErrorCode.ER_PARSE_ERROR, "42000", "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '" + bf + "'");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>joinFilter.set(index, (ItemFuncEqual) bf);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
bf = joinFilter.get(index);
1,491,376
private ApiResponseSet<Object> alertToSet(Alert alert) {<NEW_LINE>Map<String, Object> map = new HashMap<>();<NEW_LINE>map.put("id", String.valueOf(alert.getAlertId()));<NEW_LINE>map.put("pluginId", String.valueOf(alert.getPluginId()));<NEW_LINE>map.put("alertRef", alert.getAlertRef());<NEW_LINE>// Deprecated in 2.5.0, maintain for compatibility with custom<NEW_LINE>map.// Deprecated in 2.5.0, maintain for compatibility with custom<NEW_LINE>put(// Deprecated in 2.5.0, maintain for compatibility with custom<NEW_LINE>"alert", alert.getName());<NEW_LINE>// code<NEW_LINE>map.put("name", alert.getName());<NEW_LINE>map.put("description", alert.getDescription());<NEW_LINE>map.put("risk", Alert.MSG_RISK[alert.getRisk()]);<NEW_LINE>map.put("confidence", Alert.MSG_CONFIDENCE[alert.getConfidence()]);<NEW_LINE>map.put("url", alert.getUri());<NEW_LINE>map.put("method", alert.getMethod());<NEW_LINE>map.put("other", alert.getOtherInfo());<NEW_LINE>map.put("param", alert.getParam());<NEW_LINE>map.put("attack", alert.getAttack());<NEW_LINE>map.put("evidence", alert.getEvidence());<NEW_LINE>map.put("reference", alert.getReference());<NEW_LINE>map.put("cweid", String.valueOf(alert.getCweId()));<NEW_LINE>map.put("wascid", String.valueOf(alert.getWascId()));<NEW_LINE>map.put("sourceid", String.valueOf(alert.getSource().getId()));<NEW_LINE>map.put("solution", alert.getSolution());<NEW_LINE>map.put("messageId", (alert.getHistoryRef() != null) ? String.valueOf(alert.getHistoryRef().getHistoryId()) : "");<NEW_LINE>map.put(<MASK><NEW_LINE>return new CustomApiResponseSet<>("alert", map);<NEW_LINE>}
"tags", alert.getTags());
72,293
private void writePart(JRPart part) throws IOException {<NEW_LINE>ComponentKey componentKey = part.getComponentKey();<NEW_LINE>PartComponentXmlWriter componentXmlWriter = PartComponentsEnvironment.getInstance(jasperReportsContext).getManager<MASK><NEW_LINE>if (componentXmlWriter.isToWrite(part, this)) {<NEW_LINE>writer.startElement(JRXmlConstants.ELEMENT_part, getNamespace());<NEW_LINE>PartEvaluationTime evaluationTime = part.getEvaluationTime();<NEW_LINE>if (evaluationTime != null) {<NEW_LINE>writer.addAttribute(JRXmlConstants.ATTRIBUTE_evaluationTime, evaluationTime.getEvaluationTimeType());<NEW_LINE>writer.addAttribute(JRXmlConstants.ATTRIBUTE_evaluationGroup, evaluationTime.getEvaluationGroup());<NEW_LINE>}<NEW_LINE>if (!isExcludeUuids()) {<NEW_LINE>writer.addAttribute(JRXmlConstants.ATTRIBUTE_uuid, part.getUUID().toString());<NEW_LINE>}<NEW_LINE>writeProperties(part);<NEW_LINE>writeExpression(JRXmlConstants.ELEMENT_printWhenExpression, part.getPrintWhenExpression(), false);<NEW_LINE>writeExpression(JRXmlConstants.ELEMENT_partNameExpression, part.getPartNameExpression(), false);<NEW_LINE>componentXmlWriter.writeToXml(part, this);<NEW_LINE>writer.closeElement();<NEW_LINE>}<NEW_LINE>}
(componentKey).getComponentXmlWriter(jasperReportsContext);
1,636,100
protected void initScene() {<NEW_LINE>PointLight pointLight = new PointLight();<NEW_LINE>pointLight.setPower(1);<NEW_LINE>pointLight.setPosition(-1, 1, 4);<NEW_LINE>getCurrentScene().addLight(pointLight);<NEW_LINE>getCurrentScene().setBackgroundColor(0xff040404);<NEW_LINE>try {<NEW_LINE>Object3D android = new Cube(2.0f);<NEW_LINE>Material material = new Material();<NEW_LINE>material.enableLighting(true);<NEW_LINE>material.setDiffuseMethod(new DiffuseMethod.Lambert());<NEW_LINE>material.setSpecularMethod(new SpecularMethod.Phong());<NEW_LINE>android.setMaterial(material);<NEW_LINE>android.setColor(0xff99C224);<NEW_LINE>// getCurrentScene().addChild(android);<NEW_LINE>} catch (NotFoundException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>mMediaPlayer = MediaPlayer.create(getContext(), R.raw.sintel_trailer_480p);<NEW_LINE>mMediaPlayer.setLooping(true);<NEW_LINE>mVideoTexture = new StreamingTexture("sintelTrailer", mMediaPlayer);<NEW_LINE>Material material = new Material();<NEW_LINE>material.setColorInfluence(0);<NEW_LINE>try {<NEW_LINE>material.addTexture(mVideoTexture);<NEW_LINE>} catch (ATexture.TextureException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>Plane screen = new Plane(3, 2, 2, 2, Vector3.Axis.Z);<NEW_LINE>screen.setMaterial(material);<NEW_LINE>screen.setX(.1f);<NEW_LINE>screen.setY(-.2f);<NEW_LINE>screen.setZ(1.5f);<NEW_LINE>getCurrentScene().addChild(screen);<NEW_LINE>getCurrentCamera().enableLookAt();<NEW_LINE>getCurrentCamera().setLookAt(0, 0, 0);<NEW_LINE>// -- animate the spot light<NEW_LINE>TranslateAnimation3D lightAnim = new // from<NEW_LINE>TranslateAnimation3D(// to<NEW_LINE>new Vector3(-3, 3, 10), new Vector3<MASK><NEW_LINE>lightAnim.setDurationMilliseconds(5000);<NEW_LINE>lightAnim.setRepeatMode(Animation.RepeatMode.REVERSE_INFINITE);<NEW_LINE>lightAnim.setTransformable3D(pointLight);<NEW_LINE>lightAnim.setInterpolator(new AccelerateDecelerateInterpolator());<NEW_LINE>getCurrentScene().registerAnimation(lightAnim);<NEW_LINE>lightAnim.play();<NEW_LINE>// -- animate the camera<NEW_LINE>EllipticalOrbitAnimation3D camAnim = new EllipticalOrbitAnimation3D(new Vector3(3, 2, 10), new Vector3(1, 0, 8), 0, 359);<NEW_LINE>camAnim.setDurationMilliseconds(20000);<NEW_LINE>camAnim.setRepeatMode(Animation.RepeatMode.INFINITE);<NEW_LINE>camAnim.setTransformable3D(getCurrentCamera());<NEW_LINE>getCurrentScene().registerAnimation(camAnim);<NEW_LINE>camAnim.play();<NEW_LINE>mMediaPlayer.start();<NEW_LINE>}
(3, 1, 3));
630,899
protected boolean playback(IFigure figure) {<NEW_LINE>Connection conn = (Connection) figure;<NEW_LINE>PointList list1 = (PointList) Animation.getInitialState(this, conn);<NEW_LINE>PointList list2 = (PointList) Animation.getFinalState(this, conn);<NEW_LINE>if (list1 == null) {<NEW_LINE>conn.setVisible(false);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>float progress = Animation.getProgress();<NEW_LINE>if (list1.size() == list2.size()) {<NEW_LINE>Point pt1 = new Point(), pt2 = new Point();<NEW_LINE>PointList points = conn.getPoints();<NEW_LINE>points.removeAllPoints();<NEW_LINE>for (int i = 0; i < list1.size(); i++) {<NEW_LINE>list1.getPoint(pt2, i);<NEW_LINE>list2.getPoint(pt1, i);<NEW_LINE>pt1.x = Math.round(pt1.x * progress + (1 - progress) * pt2.x);<NEW_LINE>pt1.y = Math.round(pt1.y * progress + (1 <MASK><NEW_LINE>points.addPoint(pt1);<NEW_LINE>}<NEW_LINE>conn.setPoints(points);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
- progress) * pt2.y);
1,756,154
private void generateVersionXMLFiles() throws IOException {<NEW_LINE>FileSet fs = new FileSet();<NEW_LINE>fs.setIncludes("**/*.jar");<NEW_LINE>for (File directory : jarDirectories) {<NEW_LINE>fs.setDir(directory);<NEW_LINE>DirectoryScanner scan = fs.getDirectoryScanner(getProject());<NEW_LINE>StringWriter writeVersionXML = new StringWriter();<NEW_LINE>writeVersionXML.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");<NEW_LINE>writeVersionXML.append("<jnlp-versions>\n");<NEW_LINE>for (String jarName : scan.getIncludedFiles()) {<NEW_LINE>File jar = new File(<MASK><NEW_LINE>JarFile jarFile = new JarFile(jar);<NEW_LINE>String version = getJarVersion(jarFile);<NEW_LINE>if (version != null) {<NEW_LINE>writeVersionXML.append(" <resource>\n <pattern>\n <name>");<NEW_LINE>writeVersionXML.append(jar.getName());<NEW_LINE>writeVersionXML.append("</name>\n <version-id>");<NEW_LINE>writeVersionXML.append(version);<NEW_LINE>writeVersionXML.append("</version-id>\n </pattern>\n <file>");<NEW_LINE>writeVersionXML.append(jar.getName());<NEW_LINE>writeVersionXML.append("</file>\n </resource>\n");<NEW_LINE>} else {<NEW_LINE>writeVersionXML.append(" <!-- No version found for ");<NEW_LINE>writeVersionXML.append(jar.getName());<NEW_LINE>writeVersionXML.append(" -->\n");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>writeVersionXML.append("</jnlp-versions>\n");<NEW_LINE>writeVersionXML.close();<NEW_LINE>File versionXML = new File(directory, "version.xml");<NEW_LINE>FileWriter w = new FileWriter(versionXML);<NEW_LINE>w.write(writeVersionXML.toString());<NEW_LINE>w.close();<NEW_LINE>}<NEW_LINE>}
scan.getBasedir(), jarName);
1,345,922
public Object convert(Class destClass, Object srcObj) {<NEW_LINE>if (null == srcObj) {<NEW_LINE>MappingUtils.throwMappingException("Cannot convert null to enum of type " + destClass);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if ((srcObj.getClass().equals(Byte.class)) || (srcObj.getClass().equals(Byte.TYPE))) {<NEW_LINE>return EnumUtils.getEnumList(destClass).get(((Byte) srcObj).intValue());<NEW_LINE>} else if ((srcObj.getClass().equals(Short.class)) || (srcObj.getClass().equals(Short.TYPE))) {<NEW_LINE>return EnumUtils.getEnumList(destClass).get(((Short) srcObj).intValue());<NEW_LINE>} else if ((srcObj.getClass().equals(Integer.class)) || (srcObj.getClass().equals(Integer.TYPE))) {<NEW_LINE>return EnumUtils.getEnumList(destClass).get((Integer) srcObj);<NEW_LINE>} else if ((srcObj.getClass().equals(Long.class)) || (srcObj.getClass().equals(Long.TYPE))) {<NEW_LINE>return EnumUtils.getEnumList(destClass).get(((Long) srcObj).intValue());<NEW_LINE>} else if (Enum.class.isAssignableFrom(srcObj.getClass())) {<NEW_LINE>return Enum.valueOf(destClass, ((Enum<MASK><NEW_LINE>} else {<NEW_LINE>return Enum.valueOf(destClass, srcObj.toString());<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>MappingUtils.throwMappingException("Cannot convert [" + srcObj + "] to enum of type " + destClass, e);<NEW_LINE>}<NEW_LINE>return srcObj;<NEW_LINE>}
) srcObj).name());
1,101,163
private static long loadRecords(int recordsPerPage, long highestRecordId, ToLongFunction<long[]> loader, GraphDatabaseAPI db) {<NEW_LINE>long total = 0L;<NEW_LINE>int batchSize = 100_000;<NEW_LINE>long[] ids = new long[batchSize];<NEW_LINE>int idx = 0;<NEW_LINE>List<Future<Long>> futures <MASK><NEW_LINE>for (long id = 0; id < highestRecordId; id += recordsPerPage) {<NEW_LINE>ids[idx++] = id;<NEW_LINE>if (idx == batchSize) {<NEW_LINE>long[] submitted = ids.clone();<NEW_LINE>idx = 0;<NEW_LINE>futures.add(inTxFuture(db, loader, submitted));<NEW_LINE>}<NEW_LINE>total += removeDone(futures, false);<NEW_LINE>}<NEW_LINE>if (idx > 0) {<NEW_LINE>long[] submitted = Arrays.copyOf(ids, idx);<NEW_LINE>futures.add(inTxFuture(db, loader, submitted));<NEW_LINE>}<NEW_LINE>total += removeDone(futures, true);<NEW_LINE>return total;<NEW_LINE>}
= new ArrayList<>(100);
564,747
protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response) throws Exception {<NEW_LINE>User user = securityService.getCurrentUser(request);<NEW_LINE>Map<String, Object> map = new HashMap<String, Object>();<NEW_LINE>int id = <MASK><NEW_LINE>MediaFile file = mediaFileService.getMediaFile(id);<NEW_LINE>mediaFileService.populateStarredDate(file, user.getUsername());<NEW_LINE>Long position = ServletRequestUtils.getLongParameter(request, "position");<NEW_LINE>if (position == null) {<NEW_LINE>Bookmark bookmark = bookmarkService.getBookmark(user.getUsername(), id);<NEW_LINE>if (bookmark != null) {<NEW_LINE>position = bookmark.getPositionMillis();<NEW_LINE>} else {<NEW_LINE>position = 0L;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>UserSettings settings = settingsService.getUserSettings(user.getUsername());<NEW_LINE>Integer playerId = playerService.getPlayer(request, response).getId();<NEW_LINE>String url = NetworkService.getBaseUrl(request);<NEW_LINE>boolean streamable = isStreamable(file);<NEW_LINE>boolean castable = isCastable(file);<NEW_LINE>Pair<String, Map<String, String>> streamUrls = getStreamUrls(file, user, url, streamable, playerId);<NEW_LINE>List<CaptionsController.CaptionInfo> captions = captionsController.listCaptions(file, NetworkService.getBaseUrl(request));<NEW_LINE>map.put("video", file);<NEW_LINE>map.put("position", position);<NEW_LINE>map.put("autoBookmark", settings.getAutoBookmark());<NEW_LINE>map.put("videoBookmarkFrequency", settings.getVideoBookmarkFrequency());<NEW_LINE>map.put("streamable", streamable);<NEW_LINE>map.put("castable", castable);<NEW_LINE>map.put("captions", captions);<NEW_LINE>map.put("streamUrls", streamUrls.getRight());<NEW_LINE>map.put("contentType", !streamable ? "application/x-mpegurl" : StringUtil.getMimeType(MoreFiles.getFileExtension(file.getRelativePath())));<NEW_LINE>map.put("remoteStreamUrl", streamUrls.getRight().get("remoteStreamUrl"));<NEW_LINE>map.put("remoteCoverArtUrl", url + jwtSecurityService.addJWTToken(user.getUsername(), "ext/coverArt.view?id=" + file.getId()));<NEW_LINE>map.put("remoteCaptionsUrl", url + jwtSecurityService.addJWTToken(user.getUsername(), "ext/captions/list?id=" + file.getId()));<NEW_LINE>// map.put("bitRates", BIT_RATES);<NEW_LINE>map.put("defaultBitRate", streamUrls.getLeft());<NEW_LINE>map.put("user", user);<NEW_LINE>return new ModelAndView("videoPlayer", "model", map);<NEW_LINE>}
ServletRequestUtils.getRequiredIntParameter(request, "id");
285,886
@Path("/{queryname}/drillacross")<NEW_LINE>public ThinQuery drillacross(@PathParam("queryname") String queryName, @FormParam("position") String position, @FormParam("drill") String returns) {<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("TRACK\t" + "\t/query/" + queryName + "/drillacross\tPOST");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>String[] positions = position.split(":");<NEW_LINE>List<Integer> cellPosition = new ArrayList<>();<NEW_LINE>for (String p : positions) {<NEW_LINE>Integer <MASK><NEW_LINE>cellPosition.add(pInt);<NEW_LINE>}<NEW_LINE>ObjectMapper mapper = new ObjectMapper();<NEW_LINE>CollectionType ct = mapper.getTypeFactory().constructCollectionType(ArrayList.class, String.class);<NEW_LINE>JavaType st = mapper.getTypeFactory().uncheckedSimpleType(String.class);<NEW_LINE>Map<String, List<String>> levels = mapper.readValue(returns, mapper.getTypeFactory().constructMapType(Map.class, st, ct));<NEW_LINE>return thinQueryService.drillacross(queryName, cellPosition, levels);<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.error("Cannot execute query (" + queryName + ")", e);<NEW_LINE>String error = ExceptionUtils.getRootCauseMessage(e);<NEW_LINE>throw new WebApplicationException(Response.serverError().entity(error).build());<NEW_LINE>}<NEW_LINE>}
pInt = Integer.parseInt(p);
1,131,539
public DataType toDataType() throws DuplicateNameException, IOException {<NEW_LINE>Structure struct = new StructureDataType(FBPT.class.getSimpleName(), 0);<NEW_LINE>struct.add(STRING, FBPK_Constants.FBPT.length(), "magic", null);<NEW_LINE>struct.add(DWORD, "unknown1", null);<NEW_LINE>struct.add(DWORD, "unknown2", null);<NEW_LINE>struct.add(DWORD, "unknown3", null);<NEW_LINE>struct.add(DWORD, "nEntries", null);<NEW_LINE>struct.add(DWORD, "unknownA", null);<NEW_LINE>struct.add(DWORD, "unknownB", null);<NEW_LINE>struct.add(DWORD, "unknownC", null);<NEW_LINE>struct.add(DWORD, "unknownD", null);<NEW_LINE>struct.<MASK><NEW_LINE>struct.add(DWORD, "unknownF", null);<NEW_LINE>struct.add(DWORD, "unknownG", null);<NEW_LINE>struct.add(DWORD, "unknownH", null);<NEW_LINE>struct.add(DWORD, "unknownI", null);<NEW_LINE>struct.add(DWORD, "unknownJ", null);<NEW_LINE>struct.add(DWORD, "unknownK", null);<NEW_LINE>struct.add(DWORD, "unknownL", null);<NEW_LINE>struct.add(DWORD, "unknownM", null);<NEW_LINE>return struct;<NEW_LINE>}
add(DWORD, "unknownE", null);
41,779
public static void bufferedToInterleaved(BufferedImage src, InterleavedU8 dst) {<NEW_LINE>final int width = src.getWidth();<NEW_LINE>final int height = src.getHeight();<NEW_LINE>if (dst.getNumBands() == 3) {<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(0, height, y -> {<NEW_LINE>for (int y = 0; y < height; y++) {<NEW_LINE>int indexDst = dst.startIndex + y * dst.stride;<NEW_LINE>for (int x = 0; x < width; x++) {<NEW_LINE>int argb = src.getRGB(x, y);<NEW_LINE>dst.data[indexDst++] = (byte<MASK><NEW_LINE>dst.data[indexDst++] = (byte) (argb >>> 8);<NEW_LINE>dst.data[indexDst++] = (byte) argb;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>} else if (dst.getNumBands() == 1) {<NEW_LINE>ImplConvertRaster.bufferedToGray(src, dst.data, dst.startIndex, dst.stride);<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("Unsupported number of input bands");<NEW_LINE>}<NEW_LINE>}
) (argb >>> 16);
799,992
private void updateColumnSelector() {<NEW_LINE>boolean showDisplayExpression = showDisplayExpression();<NEW_LINE>if (!showDisplayExpression && (columnSelector == null))<NEW_LINE>return;<NEW_LINE>TypeHelper type = getSelectedType();<NEW_LINE>if ((type != null) && Collection.class.isAssignableFrom(FormUtils.typeToClass(type))) {<NEW_LINE>TypeHelper elemType = type.typeOfElement();<NEW_LINE>if ((elemType != null) && elemType.equals(lastElemType))<NEW_LINE>return;<NEW_LINE>lastElemType = elemType;<NEW_LINE>if (columnSelector != null) {<NEW_LINE>List<BindingDescriptor> descriptors = designSupport.getAllBindingDescriptors(elemType);<NEW_LINE>columnSelector.setVisible(descriptors.size() > 0);<NEW_LINE>List<String> available = new LinkedList<String>();<NEW_LINE>columnToType = new HashMap<String, String>();<NEW_LINE>for (BindingDescriptor desc : descriptors) {<NEW_LINE>TypeHelper t = desc.getGenericValueType();<NEW_LINE><MASK><NEW_LINE>if (className == null) {<NEW_LINE>Class<?> clazz = desc.getValueType();<NEW_LINE>className = clazz.getName();<NEW_LINE>}<NEW_LINE>columnToType.put(desc.getPath(), className);<NEW_LINE>available.add(desc.getPath());<NEW_LINE>}<NEW_LINE>columnSelector.setItems(Collections.EMPTY_LIST, available);<NEW_LINE>}<NEW_LINE>displayExpressionModel.setRoot(new ExpressionNode(elemType));<NEW_LINE>} else {<NEW_LINE>lastElemType = null;<NEW_LINE>if (columnSelector != null) {<NEW_LINE>columnSelector.setVisible(false);<NEW_LINE>} else {<NEW_LINE>// NOI18N<NEW_LINE>displayExpressionCombo.setSelectedItem("null");<NEW_LINE>}<NEW_LINE>DefaultMutableTreeNode node = new DefaultMutableTreeNode(null, true);<NEW_LINE>node.add(new DefaultMutableTreeNode(null, false));<NEW_LINE>displayExpressionModel.setRoot(node);<NEW_LINE>}<NEW_LINE>}
String className = t.getName();
841,351
public void insertString(DriverState state) throws Throwable {<NEW_LINE>final int range = state.getRandomNumber();<NEW_LINE>final int rows = state.getSampleSize() + range;<NEW_LINE>final String batchId = UUID.randomUUID().toString();<NEW_LINE>SupplyValueFunction func = state.getSupplyFunction((p, v, l, i) -> p.setString(i, (String) v));<NEW_LINE>int result = executeInsert(state, "insert into system.test_insert(b, s) -- select b, v from input('b String, v String')\nvalues(?, ?)", func, new Enumeration<Object[]>() {<NEW_LINE><NEW_LINE>int counter = 0;<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean hasMoreElements() {<NEW_LINE>return counter < rows;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Object[] nextElement() {<NEW_LINE>return new Object[] { batchId, String.valueOf(range + (counter++)) };<NEW_LINE>}<NEW_LINE>});<NEW_LINE>checkResult(<MASK><NEW_LINE>}
state, batchId, rows, result);
761,160
public void run() {<NEW_LINE>final Map<PsiFile, List<Integer>> lineLengthCachesByFile = new HashMap<>();<NEW_LINE>for (final Issue event : errors) {<NEW_LINE>final PsiFile psiFile = fileNamesToPsiFiles.get(filenameFrom(event));<NEW_LINE>if (psiFile == null) {<NEW_LINE>LOG.info("Could not find mapping for file: " + event.fileName + " in " + fileNamesToPsiFiles);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<Integer> lineLengthCache = lineLengthCachesByFile.get(psiFile);<NEW_LINE>if (lineLengthCache == null) {<NEW_LINE>// we cache the offset of each line as it is created, so as to<NEW_LINE>// avoid retreating ground we've already covered.<NEW_LINE><MASK><NEW_LINE>// line 1 is offset 0<NEW_LINE>lineLengthCache.add(0);<NEW_LINE>lineLengthCachesByFile.put(psiFile, lineLengthCache);<NEW_LINE>}<NEW_LINE>processEvent(psiFile, lineLengthCache, event);<NEW_LINE>}<NEW_LINE>}
lineLengthCache = new ArrayList<>();
540,448
private void forcefulClose(final ChannelHandlerContext ctx, final ForcefulCloseCommand msg, ChannelPromise promise) throws Exception {<NEW_LINE>connection().forEachActiveStream(new Http2StreamVisitor() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean visit(Http2Stream stream) throws Http2Exception {<NEW_LINE>NettyClientStream<MASK><NEW_LINE>Tag tag = clientStream != null ? clientStream.tag() : PerfMark.createTag();<NEW_LINE>PerfMark.startTask("NettyClientHandler.forcefulClose", tag);<NEW_LINE>PerfMark.linkIn(msg.getLink());<NEW_LINE>try {<NEW_LINE>if (clientStream != null) {<NEW_LINE>clientStream.transportReportStatus(msg.getStatus(), true, new Metadata());<NEW_LINE>resetStream(ctx, stream.id(), Http2Error.CANCEL.code(), ctx.newPromise());<NEW_LINE>}<NEW_LINE>stream.close();<NEW_LINE>return true;<NEW_LINE>} finally {<NEW_LINE>PerfMark.stopTask("NettyClientHandler.forcefulClose", tag);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>close(ctx, promise);<NEW_LINE>}
.TransportState clientStream = clientStream(stream);
741,971
private void createSchedule(Properties context, String transactionName) {<NEW_LINE>// Delete before apply<NEW_LINE>new Query(context, I_AD_Scheduler.Table_Name, I_AD_Scheduler.COLUMNNAME_AD_Process_ID + " = ?", transactionName).setParameters(FlushSystemQueue.getProcessId()).setClient_ID().list().forEach(scheduler -> scheduler.delete(true));<NEW_LINE>MScheduler scheduler = new MScheduler(context, 0, transactionName);<NEW_LINE>scheduler.setAD_Org_ID(0);<NEW_LINE>scheduler.setName(FlushSystemQueue.getProcessName());<NEW_LINE>scheduler.setDescription(SETUP_DESCRIPTION);<NEW_LINE>scheduler.setAD_Process_ID(FlushSystemQueue.getProcessId());<NEW_LINE>scheduler.setSupervisor_ID(Env.getAD_User_ID(context));<NEW_LINE>scheduler.setFrequencyType(MScheduler.FREQUENCYTYPE_Minute);<NEW_LINE>scheduler.setFrequency(5);<NEW_LINE>scheduler.setKeepLogDays(7);<NEW_LINE>scheduler.setDateNextRun(TimeUtil.addMinutess(TimeUtil.getDay(System.currentTimeMillis()), scheduler.getFrequency()));<NEW_LINE>scheduler.saveEx();<NEW_LINE>// Get Process<NEW_LINE>MProcess process = MProcess.get(<MASK><NEW_LINE>// Batch Quantity<NEW_LINE>process.getParametersAsList().stream().filter(parameter -> parameter.getColumnName().equals(FlushSystemQueue.BATCHSTOPROCESS)).findFirst().ifPresent(parameter -> {<NEW_LINE>MSchedulerPara schedulerParameter = new MSchedulerPara(context, 0, transactionName);<NEW_LINE>schedulerParameter.setAD_Org_ID(0);<NEW_LINE>schedulerParameter.setAD_Scheduler_ID(scheduler.getAD_Scheduler_ID());<NEW_LINE>schedulerParameter.setAD_Process_Para_ID(parameter.getAD_Process_Para_ID());<NEW_LINE>schedulerParameter.setParameterDefault("10");<NEW_LINE>schedulerParameter.saveEx();<NEW_LINE>});<NEW_LINE>// Records Quantity<NEW_LINE>process.getParametersAsList().stream().filter(parameter -> parameter.getColumnName().equals(FlushSystemQueue.RECORDSBYBATCH)).findFirst().ifPresent(parameter -> {<NEW_LINE>MSchedulerPara schedulerParameter = new MSchedulerPara(context, 0, transactionName);<NEW_LINE>schedulerParameter.setAD_Org_ID(0);<NEW_LINE>schedulerParameter.setAD_Scheduler_ID(scheduler.getAD_Scheduler_ID());<NEW_LINE>schedulerParameter.setAD_Process_Para_ID(parameter.getAD_Process_Para_ID());<NEW_LINE>schedulerParameter.setParameterDefault("100");<NEW_LINE>schedulerParameter.saveEx();<NEW_LINE>});<NEW_LINE>// Delete records<NEW_LINE>process.getParametersAsList().stream().filter(parameter -> parameter.getColumnName().equals(FlushSystemQueue.ISDELETEAFTERPROCESS)).findFirst().ifPresent(parameter -> {<NEW_LINE>MSchedulerPara schedulerParameter = new MSchedulerPara(context, 0, transactionName);<NEW_LINE>schedulerParameter.setAD_Org_ID(0);<NEW_LINE>schedulerParameter.setAD_Scheduler_ID(scheduler.getAD_Scheduler_ID());<NEW_LINE>schedulerParameter.setAD_Process_Para_ID(parameter.getAD_Process_Para_ID());<NEW_LINE>schedulerParameter.setParameterDefault("N");<NEW_LINE>schedulerParameter.saveEx();<NEW_LINE>});<NEW_LINE>}
context, FlushSystemQueue.getProcessId());
1,048,456
final DescribeReportDefinitionsResult executeDescribeReportDefinitions(DescribeReportDefinitionsRequest describeReportDefinitionsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeReportDefinitionsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeReportDefinitionsRequest> request = null;<NEW_LINE>Response<DescribeReportDefinitionsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeReportDefinitionsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeReportDefinitionsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeReportDefinitions");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeReportDefinitionsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeReportDefinitionsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.SERVICE_ID, "Cost and Usage Report Service");
14,941
public static BlockPos readBlockPos(NBTBase base) {<NEW_LINE>if (base == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>switch(base.getId()) {<NEW_LINE>case Constants.NBT.TAG_INT_ARRAY:<NEW_LINE>{<NEW_LINE>int[] array = ((NBTTagIntArray) base).getIntArray();<NEW_LINE>if (array.length == 3) {<NEW_LINE>return new BlockPos(array[0], array[1], array[2]);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>case Constants.NBT.TAG_COMPOUND:<NEW_LINE>{<NEW_LINE>NBTTagCompound nbt = (NBTTagCompound) base;<NEW_LINE>BlockPos pos = null;<NEW_LINE>if (nbt.hasKey("i")) {<NEW_LINE>int i = nbt.getInteger("i");<NEW_LINE>int j = nbt.getInteger("j");<NEW_LINE>int k = nbt.getInteger("k");<NEW_LINE>pos = new BlockPos(i, j, k);<NEW_LINE>} else if (nbt.hasKey("x")) {<NEW_LINE>int x = nbt.getInteger("x");<NEW_LINE>int y = nbt.getInteger("y");<NEW_LINE>int <MASK><NEW_LINE>pos = new BlockPos(x, y, z);<NEW_LINE>} else if (nbt.hasKey("pos")) {<NEW_LINE>return readBlockPos(nbt.getTag("pos"));<NEW_LINE>} else {<NEW_LINE>BCLog.logger.warn("Attempted to read a block positions from a compound tag without the correct sub-tags! (" + base + ")", new Throwable());<NEW_LINE>}<NEW_LINE>return pos;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>BCLog.logger.warn("Attempted to read a block position from an invalid tag! (" + base + ")", new Throwable());<NEW_LINE>return null;<NEW_LINE>}
z = nbt.getInteger("z");
1,825,400
void update(int pollResponseStatusCode, HttpHeaders pollResponseHeaders, String pollResponseBody) {<NEW_LINE>if (pollResponseStatusCode == 202) {<NEW_LINE>try {<NEW_LINE>this.provisioningState = ProvisioningState.IN_PROGRESS;<NEW_LINE>final URL locationUrl = Util.getLocationUrl(pollResponseHeaders, logger);<NEW_LINE>if (locationUrl != null) {<NEW_LINE>this.pollUrl = locationUrl;<NEW_LINE>}<NEW_LINE>} catch (Util.MalformedUrlException mue) {<NEW_LINE>this.provisioningState = ProvisioningState.FAILED;<NEW_LINE>this.pollError = new Error("Long running operation contains a malformed Location header.", pollResponseStatusCode, pollResponseHeaders.toMap(), pollResponseBody);<NEW_LINE>}<NEW_LINE>} else if (pollResponseStatusCode == 200 || pollResponseStatusCode == 201 || pollResponseStatusCode == 204) {<NEW_LINE>this.provisioningState = ProvisioningState.SUCCEEDED;<NEW_LINE>if (pollResponseBody != null) {<NEW_LINE>this.finalResult = new FinalResult(null, pollResponseBody);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>this.provisioningState = ProvisioningState.FAILED;<NEW_LINE>this.pollError = new Error("Polling failed with status code:" + pollResponseStatusCode, pollResponseStatusCode, <MASK><NEW_LINE>}<NEW_LINE>}
pollResponseHeaders.toMap(), pollResponseBody);
445,759
public AuthenticatedUser convertBuiltInUserToRemoteUser(AuthenticatedUser builtInUserToConvert, String newProviderId, UserIdentifier newUserIdentifierInLookupTable) {<NEW_LINE>logger.info("converting user " + builtInUserToConvert.getId() + " from builtin to remote");<NEW_LINE><MASK><NEW_LINE>logger.info("builtin user identifier: " + builtInUserIdentifier);<NEW_LINE>TypedQuery<AuthenticatedUserLookup> typedQuery = em.createQuery("SELECT OBJECT(o) FROM AuthenticatedUserLookup AS o WHERE o.authenticatedUser = :auid", AuthenticatedUserLookup.class);<NEW_LINE>typedQuery.setParameter("auid", builtInUserToConvert);<NEW_LINE>AuthenticatedUserLookup authuserLookup;<NEW_LINE>try {<NEW_LINE>authuserLookup = typedQuery.getSingleResult();<NEW_LINE>} catch (NoResultException | NonUniqueResultException ex) {<NEW_LINE>logger.info("exception caught: " + ex);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (authuserLookup == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>String oldProviderId = authuserLookup.getAuthenticationProviderId();<NEW_LINE>logger.info("we expect this to be 'builtin': " + oldProviderId);<NEW_LINE>authuserLookup.setAuthenticationProviderId(newProviderId);<NEW_LINE>String oldUserLookupIdentifier = authuserLookup.getPersistentUserId();<NEW_LINE>logger.info("this should be 'pete' or whatever the old builtin username was: " + oldUserLookupIdentifier);<NEW_LINE>String perUserIdentifier = newUserIdentifierInLookupTable.getLookupStringPerAuthProvider();<NEW_LINE>authuserLookup.setPersistentUserId(perUserIdentifier);<NEW_LINE>em.persist(authuserLookup);<NEW_LINE>String builtinUsername = builtInUserIdentifier.replaceFirst(AuthenticatedUser.IDENTIFIER_PREFIX, "");<NEW_LINE>BuiltinUser builtin = builtinUserServiceBean.findByUserName(builtinUsername);<NEW_LINE>if (builtin != null) {<NEW_LINE>// These were created by AuthenticationResponse.Status.BREAKOUT in canLogInAsBuiltinUser<NEW_LINE>List<PasswordResetData> oldTokens = passwordResetServiceBean.findPasswordResetDataByDataverseUser(builtin);<NEW_LINE>for (PasswordResetData oldToken : oldTokens) {<NEW_LINE>em.remove(oldToken);<NEW_LINE>}<NEW_LINE>em.remove(builtin);<NEW_LINE>} else {<NEW_LINE>logger.info("Couldn't delete builtin user because could find it based on username " + builtinUsername);<NEW_LINE>}<NEW_LINE>AuthenticatedUser nonBuiltinUser = lookupUser(newProviderId, perUserIdentifier);<NEW_LINE>if (nonBuiltinUser != null) {<NEW_LINE>return nonBuiltinUser;<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
String builtInUserIdentifier = builtInUserToConvert.getIdentifier();
538,438
final ListDeliveryStreamsResult executeListDeliveryStreams(ListDeliveryStreamsRequest listDeliveryStreamsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listDeliveryStreamsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListDeliveryStreamsRequest> request = null;<NEW_LINE>Response<ListDeliveryStreamsResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new ListDeliveryStreamsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listDeliveryStreamsRequest));<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, "Firehose");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListDeliveryStreams");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListDeliveryStreamsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListDeliveryStreamsResultJsonUnmarshaller());<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);
447,333
public void init(ClientCapabilities clientCapabilities, ServerCapabilities severCapabilities) {<NEW_LINE>SemanticTokensCapabilities semanticTokens = clientCapabilities != null && clientCapabilities.getTextDocument() != null ? clientCapabilities.getTextDocument().getSemanticTokens() : null;<NEW_LINE>if (semanticTokens != null) {<NEW_LINE>SemanticTokensWithRegistrationOptions cap = new SemanticTokensWithRegistrationOptions();<NEW_LINE>cap.setFull(new SemanticTokensServerFull(false));<NEW_LINE>Set<String> knownTokenTypes = semanticTokens.getTokenTypes() != null ? new HashSet<>(semanticTokens.getTokenTypes()) : Collections.emptySet();<NEW_LINE>Map<String, Integer> tokenLegend = new LinkedHashMap<>();<NEW_LINE>for (Entry<ColoringAttributes, List<String>> e : COLORING_TO_TOKEN_TYPE_CANDIDATES.entrySet()) {<NEW_LINE>for (String candidate : e.getValue()) {<NEW_LINE>if (knownTokenTypes.contains(candidate)) {<NEW_LINE>coloring2TokenType[e.getKey().ordinal()] = tokenLegend.computeIfAbsent(candidate, c -> tokenLegend.size());<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Set<String> knownTokenModifiers = semanticTokens.getTokenModifiers() != null ? new HashSet<>(semanticTokens.getTokenModifiers()) : Collections.emptySet();<NEW_LINE>Map<String, Integer> <MASK><NEW_LINE>for (Entry<ColoringAttributes, List<String>> e : COLORING_TO_TOKEN_MODIFIERS_CANDIDATES.entrySet()) {<NEW_LINE>for (String candidate : e.getValue()) {<NEW_LINE>if (knownTokenModifiers.contains(candidate)) {<NEW_LINE>coloring2TokenModifier[e.getKey().ordinal()] = modifiersLegend.computeIfAbsent(candidate, c -> 1 << modifiersLegend.size());<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>SemanticTokensLegend legend = new SemanticTokensLegend(new ArrayList<>(tokenLegend.keySet()), new ArrayList<>(modifiersLegend.keySet()));<NEW_LINE>cap.setLegend(legend);<NEW_LINE>severCapabilities.setSemanticTokensProvider(cap);<NEW_LINE>}<NEW_LINE>}
modifiersLegend = new LinkedHashMap<>();
49,309
public Request<StopTrainingEntityRecognizerRequest> marshall(StopTrainingEntityRecognizerRequest stopTrainingEntityRecognizerRequest) {<NEW_LINE>if (stopTrainingEntityRecognizerRequest == null) {<NEW_LINE>throw new AmazonClientException("Invalid argument passed to marshall(StopTrainingEntityRecognizerRequest)");<NEW_LINE>}<NEW_LINE>Request<StopTrainingEntityRecognizerRequest> request = new DefaultRequest<StopTrainingEntityRecognizerRequest>(stopTrainingEntityRecognizerRequest, "AmazonComprehend");<NEW_LINE>String target = "Comprehend_20171127.StopTrainingEntityRecognizer";<NEW_LINE>request.addHeader("X-Amz-Target", target);<NEW_LINE><MASK><NEW_LINE>String uriResourcePath = "/";<NEW_LINE>request.setResourcePath(uriResourcePath);<NEW_LINE>try {<NEW_LINE>StringWriter stringWriter = new StringWriter();<NEW_LINE>AwsJsonWriter jsonWriter = JsonUtils.getJsonWriter(stringWriter);<NEW_LINE>jsonWriter.beginObject();<NEW_LINE>if (stopTrainingEntityRecognizerRequest.getEntityRecognizerArn() != null) {<NEW_LINE>String entityRecognizerArn = stopTrainingEntityRecognizerRequest.getEntityRecognizerArn();<NEW_LINE>jsonWriter.name("EntityRecognizerArn");<NEW_LINE>jsonWriter.value(entityRecognizerArn);<NEW_LINE>}<NEW_LINE>jsonWriter.endObject();<NEW_LINE>jsonWriter.close();<NEW_LINE>String snippet = stringWriter.toString();<NEW_LINE>byte[] content = snippet.getBytes(UTF8);<NEW_LINE>request.setContent(new StringInputStream(snippet));<NEW_LINE>request.addHeader("Content-Length", Integer.toString(content.length));<NEW_LINE>} catch (Throwable t) {<NEW_LINE>throw new AmazonClientException("Unable to marshall request to JSON: " + t.getMessage(), t);<NEW_LINE>}<NEW_LINE>if (!request.getHeaders().containsKey("Content-Type")) {<NEW_LINE>request.addHeader("Content-Type", "application/x-amz-json-1.1");<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
request.setHttpMethod(HttpMethodName.POST);
1,666,647
public Object calculate(Context ctx) {<NEW_LINE>if (left == null) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("\"^\"" + mm.getMessage("operator.missingLeftOperation"));<NEW_LINE>}<NEW_LINE>if (right == null) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("\"^\"" + mm.getMessage("operator.missingRightOperation"));<NEW_LINE>}<NEW_LINE>Object o1 = left.calculate(ctx);<NEW_LINE>Object o2 = right.calculate(ctx);<NEW_LINE>if (o1 == null) {<NEW_LINE>if (o2 != null && !(o2 instanceof Sequence)) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("\"^\"" + mm.getMessage("function.paramTypeError"));<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} else if (o1 instanceof Sequence) {<NEW_LINE>if (o2 == null)<NEW_LINE>return null;<NEW_LINE>if (!(o2 instanceof Sequence)) {<NEW_LINE><MASK><NEW_LINE>throw new RQException("\"^\"" + mm.getMessage("function.paramTypeError"));<NEW_LINE>}<NEW_LINE>return ((Sequence) o1).isect((Sequence) o2, false);<NEW_LINE>} else {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("\"^\"" + mm.getMessage("function.paramTypeError"));<NEW_LINE>}<NEW_LINE>}
MessageManager mm = EngineMessage.get();
610,470
final DescribeChannelMembershipForAppInstanceUserResult executeDescribeChannelMembershipForAppInstanceUser(DescribeChannelMembershipForAppInstanceUserRequest describeChannelMembershipForAppInstanceUserRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeChannelMembershipForAppInstanceUserRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeChannelMembershipForAppInstanceUserRequest> request = null;<NEW_LINE>Response<DescribeChannelMembershipForAppInstanceUserResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeChannelMembershipForAppInstanceUserRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeChannelMembershipForAppInstanceUserRequest));<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, "Chime");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeChannelMembershipForAppInstanceUser");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>URI endpointTraitHost = null;<NEW_LINE>if (!clientConfiguration.isDisableHostPrefixInjection()) {<NEW_LINE>String hostPrefix = "messaging-";<NEW_LINE>String resolvedHostPrefix = String.format("messaging-");<NEW_LINE>endpointTraitHost = UriResourcePathUtils.updateUriHost(endpoint, resolvedHostPrefix);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeChannelMembershipForAppInstanceUserResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeChannelMembershipForAppInstanceUserResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext, null, endpointTraitHost);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
1,184,563
private void peekDrawer() {<NEW_LINE>final View toCapture;<NEW_LINE>final int childLeft;<NEW_LINE>final int peekDistance = mDragger.getEdgeSize();<NEW_LINE>final boolean leftEdge = mGravity == Gravity.LEFT;<NEW_LINE>if (leftEdge) {<NEW_LINE>toCapture = findDrawerWithGravity(Gravity.LEFT);<NEW_LINE>childLeft = (toCapture != null ? -toCapture.getWidth() : 0) + peekDistance;<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>childLeft = getWidth() - peekDistance;<NEW_LINE>}<NEW_LINE>// Only peek if it would mean making the drawer more visible and the drawer isn't locked<NEW_LINE>if (toCapture != null && ((leftEdge && toCapture.getLeft() < childLeft) || (!leftEdge && toCapture.getLeft() > childLeft)) && getDrawerLockMode(toCapture) == LOCK_MODE_UNLOCKED) {<NEW_LINE>final LayoutParams lp = (LayoutParams) toCapture.getLayoutParams();<NEW_LINE>mDragger.smoothSlideViewTo(toCapture, childLeft, toCapture.getTop());<NEW_LINE>lp.isPeeking = true;<NEW_LINE>invalidate();<NEW_LINE>closeOtherDrawer();<NEW_LINE>cancelChildViewTouch();<NEW_LINE>}<NEW_LINE>}
toCapture = findDrawerWithGravity(Gravity.RIGHT);
519,113
ActionResult<Wo> execute(EffectivePerson effectivePerson, String flag, JsonElement jsonElement) throws Exception {<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>ActionResult<Wo> result = new ActionResult<>();<NEW_LINE>Business business = new Business(emc);<NEW_LINE>Wi wi = this.convertToWrapIn(jsonElement, Wi.class);<NEW_LINE>Statement statement = emc.flag(flag, Statement.class);<NEW_LINE>if (null == statement) {<NEW_LINE>throw new ExceptionEntityNotExist(flag, Statement.class);<NEW_LINE>}<NEW_LINE>Wi.copier.copy(wi, statement);<NEW_LINE>Query query = emc.flag(statement.getQuery(), Query.class);<NEW_LINE>if (null == query) {<NEW_LINE>throw new ExceptionEntityNotExist(wi.<MASK><NEW_LINE>}<NEW_LINE>statement.setQuery(query.getId());<NEW_LINE>if (!business.editable(effectivePerson, query)) {<NEW_LINE>throw new ExceptionAccessDenied(effectivePerson, query);<NEW_LINE>}<NEW_LINE>if (StringUtils.equals(statement.getEntityCategory(), Statement.ENTITYCATEGORY_DYNAMIC)) {<NEW_LINE>Table table = emc.flag(wi.getTable(), Table.class);<NEW_LINE>if (null == table) {<NEW_LINE>throw new ExceptionEntityNotExist(wi.getTable(), Table.class);<NEW_LINE>}<NEW_LINE>statement.setTable(table.getId());<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>Class.forName(statement.getEntityClassName());<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new ExceptionEntityClass(statement.getEntityClassName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (StringUtils.isEmpty(statement.getName())) {<NEW_LINE>throw new ExceptionEntityFieldEmpty(Statement.class, Statement.name_FIELDNAME);<NEW_LINE>}<NEW_LINE>if (StringUtils.isNotEmpty(emc.conflict(Statement.class, statement))) {<NEW_LINE>throw new ExceptionDuplicateFlag(Statement.class, emc.conflict(Statement.class, statement));<NEW_LINE>}<NEW_LINE>emc.beginTransaction(Statement.class);<NEW_LINE>statement.setLastUpdatePerson(effectivePerson.getDistinguishedName());<NEW_LINE>statement.setLastUpdateTime(new Date());<NEW_LINE>emc.check(statement, CheckPersistType.all);<NEW_LINE>emc.commit();<NEW_LINE>CacheManager.notify(Statement.class);<NEW_LINE>Wo wo = new Wo();<NEW_LINE>wo.setId(statement.getId());<NEW_LINE>result.setData(wo);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>}
getQuery(), Query.class);
1,756,863
public ProducerRecord<?, ?> fromMessage(Message<?> messageArg, String defaultTopic) {<NEW_LINE>Message<?> message = messageArg;<NEW_LINE>if (this.messagingConverter != null) {<NEW_LINE>Message<?> converted = this.messagingConverter.toMessage(message.getPayload(), message.getHeaders());<NEW_LINE>if (converted != null) {<NEW_LINE>message = converted;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>MessageHeaders headers = message.getHeaders();<NEW_LINE>Object topicHeader = headers.get(KafkaHeaders.TOPIC);<NEW_LINE>String topic = null;<NEW_LINE>if (topicHeader instanceof byte[]) {<NEW_LINE>topic = new String(((byte[]) topicHeader), StandardCharsets.UTF_8);<NEW_LINE>} else if (topicHeader instanceof String) {<NEW_LINE>topic = (String) topicHeader;<NEW_LINE>} else if (topicHeader == null) {<NEW_LINE>Assert.state(defaultTopic != null, "With no topic header, a defaultTopic is required");<NEW_LINE>} else {<NEW_LINE>throw new IllegalStateException(KafkaHeaders.TOPIC + <MASK><NEW_LINE>}<NEW_LINE>Integer partition = headers.get(KafkaHeaders.PARTITION_ID, Integer.class);<NEW_LINE>Object key = headers.get(KafkaHeaders.MESSAGE_KEY);<NEW_LINE>Object payload = convertPayload(message);<NEW_LINE>Long timestamp = headers.get(KafkaHeaders.TIMESTAMP, Long.class);<NEW_LINE>Headers recordHeaders = initialRecordHeaders(message);<NEW_LINE>if (this.headerMapper != null) {<NEW_LINE>this.headerMapper.fromHeaders(headers, recordHeaders);<NEW_LINE>}<NEW_LINE>return new ProducerRecord(topic == null ? defaultTopic : topic, partition, timestamp, key, payload, recordHeaders);<NEW_LINE>}
" must be a String or byte[], not " + topicHeader.getClass());
332,071
private Object readFrom(Row row, @Nullable RowMetadata metadata, RelationalPersistentProperty property, String prefix) {<NEW_LINE>String identifier = prefix + property.getColumnName().getReference();<NEW_LINE>try {<NEW_LINE>Object value = null;<NEW_LINE>if (metadata == null || RowMetadataUtils.containsColumn(metadata, identifier)) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (value == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (getConversions().hasCustomReadTarget(value.getClass(), property.getType())) {<NEW_LINE>return readValue(value, property.getTypeInformation());<NEW_LINE>}<NEW_LINE>if (property.isEntity()) {<NEW_LINE>return readEntityFrom(row, metadata, property);<NEW_LINE>}<NEW_LINE>return readValue(value, property.getTypeInformation());<NEW_LINE>} catch (Exception o_O) {<NEW_LINE>throw new MappingException(String.format("Could not read property %s from column %s!", property, identifier), o_O);<NEW_LINE>}<NEW_LINE>}
value = row.get(identifier);
510,556
public void syncAttributesToASIAware(@NonNull final IAttributeSet attributeSet, @NonNull final IAttributeSetInstanceAware asiAware) {<NEW_LINE>final AttributeSetInstanceId oldAsiId = AttributeSetInstanceId.ofRepoIdOrNone(asiAware.getM_AttributeSetInstance_ID());<NEW_LINE>final AttributeSetInstanceId asiId;<NEW_LINE>if (oldAsiId.isRegular()) {<NEW_LINE>final I_M_AttributeSetInstance asiCopy = ASICopy.newInstance(oldAsiId).copy();<NEW_LINE>asiId = AttributeSetInstanceId.ofRepoId(asiCopy.getM_AttributeSetInstance_ID());<NEW_LINE>} else {<NEW_LINE>final I_M_AttributeSetInstance asiNew = createASI(ProductId.ofRepoId(asiAware.getM_Product_ID()));<NEW_LINE>asiId = AttributeSetInstanceId.<MASK><NEW_LINE>}<NEW_LINE>for (final I_M_Attribute attributeRecord : attributeSet.getAttributes()) {<NEW_LINE>setAttributeInstanceValue(asiId, AttributeCode.ofString(attributeRecord.getValue()), attributeSet.getValue(attributeRecord));<NEW_LINE>}<NEW_LINE>asiAware.setM_AttributeSetInstance_ID(asiId.getRepoId());<NEW_LINE>}
ofRepoId(asiNew.getM_AttributeSetInstance_ID());
1,560,220
public void onClick(View v) {<NEW_LINE>if (!isOnline(context)) {<NEW_LINE>if (context instanceof ManagerActivity) {<NEW_LINE>((ManagerActivity) context).showSnackbar(SNACKBAR_TYPE, context.getString(R.<MASK><NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ViewHolderContacts holder = (ViewHolderContacts) v.getTag();<NEW_LINE>int currentPosition = holder.getAdapterPosition();<NEW_LINE>MegaContactDB c = (MegaContactDB) getItem(currentPosition);<NEW_LINE>switch(v.getId()) {<NEW_LINE>case R.id.contact_list_three_dots:<NEW_LINE>case R.id.contact_grid_three_dots:<NEW_LINE>{<NEW_LINE>logDebug("Click contact three dots!");<NEW_LINE>if (!multipleSelect) {<NEW_LINE>if ((c.getMail().equals(megaChatApi.getMyEmail()))) {<NEW_LINE>((ContactAttachmentActivity) context).showSnackbar(context.getString(R.string.contact_is_me));<NEW_LINE>} else {<NEW_LINE>((ContactAttachmentActivity) context).showOptionsPanel(c.getMail());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case R.id.contact_list_item_layout:<NEW_LINE>case R.id.contact_grid_item_layout:<NEW_LINE>{<NEW_LINE>logDebug("contact_item_layout");<NEW_LINE>((ContactAttachmentActivity) context).itemClick(currentPosition);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
string.error_server_connection_problem), -1);
280,585
private boolean verify(Attributes attributes, String entry, byte[] data, int start, int end, boolean ignoreSecondEndline, boolean ignorable) {<NEW_LINE>String algorithms = attributes.getValue("Digest-Algorithms");<NEW_LINE>if (algorithms == null) {<NEW_LINE>algorithms = "SHA SHA1";<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>while (tokens.hasMoreTokens()) {<NEW_LINE>String algorithm = tokens.nextToken();<NEW_LINE>String hash = attributes.getValue(algorithm + entry);<NEW_LINE>if (hash == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>MessageDigest md;<NEW_LINE>try {<NEW_LINE>md = MessageDigest.getInstance(algorithm);<NEW_LINE>} catch (NoSuchAlgorithmException e) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (ignoreSecondEndline && data[end - 1] == '\n' && data[end - 2] == '\n') {<NEW_LINE>md.update(data, start, end - 1 - start);<NEW_LINE>} else {<NEW_LINE>md.update(data, start, end - start);<NEW_LINE>}<NEW_LINE>byte[] b = md.digest();<NEW_LINE>byte[] hashBytes = hash.getBytes(Charsets.ISO_8859_1);<NEW_LINE>return MessageDigest.isEqual(b, Base64.decode(hashBytes, Base64.DEFAULT));<NEW_LINE>}<NEW_LINE>return ignorable;<NEW_LINE>}
StringTokenizer tokens = new StringTokenizer(algorithms);
1,094,775
protected int initialAssignToNearestCluster() {<NEW_LINE>assert k == means.length;<NEW_LINE>double[][] cdist = new double[k][k];<NEW_LINE>computeSquaredSeparation(cdist);<NEW_LINE>for (DBIDIter it = relation.iterDBIDs(); it.valid(); it.advance()) {<NEW_LINE>NumberVector <MASK><NEW_LINE>// Find closest center, and distance to two closest centers:<NEW_LINE>double min1 = distance(fv, means[0]);<NEW_LINE>double min2 = k > 1 ? distance(fv, means[1]) : min1;<NEW_LINE>int minIndex = 0;<NEW_LINE>if (min2 < min1) {<NEW_LINE>double tmp = min1;<NEW_LINE>min1 = min2;<NEW_LINE>min2 = tmp;<NEW_LINE>minIndex = 1;<NEW_LINE>}<NEW_LINE>for (int i = 2; i < k; i++) {<NEW_LINE>if (min2 > cdist[minIndex][i]) {<NEW_LINE>double dist = distance(fv, means[i]);<NEW_LINE>if (dist < min1) {<NEW_LINE>minIndex = i;<NEW_LINE>min2 = min1;<NEW_LINE>min1 = dist;<NEW_LINE>} else if (dist < min2) {<NEW_LINE>min2 = dist;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Assign to nearest cluster.<NEW_LINE>clusters.get(minIndex).add(it);<NEW_LINE>assignment.putInt(it, minIndex);<NEW_LINE>plusEquals(sums[minIndex], fv);<NEW_LINE>upper.putDouble(it, isSquared ? Math.sqrt(min1) : min1);<NEW_LINE>lower.putDouble(it, isSquared ? Math.sqrt(min2) : min2);<NEW_LINE>}<NEW_LINE>return relation.size();<NEW_LINE>}
fv = relation.get(it);
588,354
static void spawnMetricsAccounting(SpawnMetrics.Builder spawnMetrics, ExecutedActionMetadata executionMetadata) {<NEW_LINE>// Expect that a non-empty worker indicates that all fields are populated.<NEW_LINE>// If the bounded sides of these checkpoints are default timestamps, i.e. unset,<NEW_LINE>// the phase durations can be extremely large. Unset pairs, or a fully unset<NEW_LINE>// collection of timestamps, will result in zeroed durations, and no metrics<NEW_LINE>// contributions for a phase or phases.<NEW_LINE>if (!executionMetadata.getWorker().isEmpty()) {<NEW_LINE>// Accumulate queueTime from any previous attempts<NEW_LINE>Duration remoteQueueTime = spawnMetrics.build().queueTime().plus(between(executionMetadata.getQueuedTimestamp(), executionMetadata.getWorkerStartTimestamp()));<NEW_LINE>spawnMetrics.setQueueTime(remoteQueueTime);<NEW_LINE>// setup time does not include failed attempts<NEW_LINE>Duration setupTime = between(executionMetadata.getWorkerStartTimestamp(<MASK><NEW_LINE>spawnMetrics.setSetupTime(setupTime);<NEW_LINE>// execution time is unspecified for failures<NEW_LINE>Duration executionWallTime = between(executionMetadata.getExecutionStartTimestamp(), executionMetadata.getExecutionCompletedTimestamp());<NEW_LINE>spawnMetrics.setExecutionWallTime(executionWallTime);<NEW_LINE>// remoteProcessOutputs time is unspecified for failures<NEW_LINE>Duration remoteProcessOutputsTime = between(executionMetadata.getOutputUploadStartTimestamp(), executionMetadata.getOutputUploadCompletedTimestamp());<NEW_LINE>spawnMetrics.setProcessOutputsTime(remoteProcessOutputsTime);<NEW_LINE>}<NEW_LINE>}
), executionMetadata.getExecutionStartTimestamp());
30,629
public void run(RegressionEnvironment env) {<NEW_LINE>Object[][] testData;<NEW_LINE>String expression;<NEW_LINE>RegressionPath path = new RegressionPath();<NEW_LINE>expression = "fib(num);" + "function fib(n) {" + " if(n <= 1) return n; " + " return fib(n-1) + fib(n-2); " + "};";<NEW_LINE>testData = new Object[][] { { new SupportBean("E1", 20), 6765.0 } };<NEW_LINE>trySelect(env, path, "expression double js:abc(num) [ " + expression + " ]", <MASK><NEW_LINE>path.clear();<NEW_LINE>testData = new Object[][] { { new SupportBean("E1", 5), 50.0 }, { new SupportBean("E1", 6), 60.0 } };<NEW_LINE>trySelect(env, path, "expression js:abc(myint) [ myint * 10 ]", "abc(intPrimitive)", Object.class, testData);<NEW_LINE>path.clear();<NEW_LINE>}
"abc(intPrimitive)", Double.class, testData);
210,457
static String binToHex(int binary) {<NEW_LINE>// hm to store hexadecimal codes for binary numbers within the range: 0000 to 1111 i.e. for<NEW_LINE>// decimal numbers 0 to 15<NEW_LINE>HashMap<Integer, String> hm = new HashMap<>();<NEW_LINE>// String to store hexadecimal code<NEW_LINE>String hex = "";<NEW_LINE>int i;<NEW_LINE>for (i = 0; i < 10; i++) {<NEW_LINE>hm.put(i, String.valueOf(i));<NEW_LINE>}<NEW_LINE>for (i = 10; i < 16; i++) {<NEW_LINE>hm.put(i, String.valueOf((char) ('A' + i - 10)));<NEW_LINE>}<NEW_LINE>int currbit;<NEW_LINE>while (binary != 0) {<NEW_LINE>// to store decimal equivalent of number formed by 4 decimal digits<NEW_LINE>int code4 = 0;<NEW_LINE>for (i = 0; i < 4; i++) {<NEW_LINE>currbit = binary % 10;<NEW_LINE>binary = binary / 10;<NEW_LINE>code4 += currbit * Math.pow(2, i);<NEW_LINE>}<NEW_LINE>hex = <MASK><NEW_LINE>}<NEW_LINE>return hex;<NEW_LINE>}
hm.get(code4) + hex;
491,745
public void reload() {<NEW_LINE>try {<NEW_LINE>SortTaskConfig newSortTaskConfig = SortClusterConfigHolder.getTaskConfig(taskName);<NEW_LINE>LOG.info("start to get SortTaskConfig:taskName:{}:config:{}", taskName, JSON.toJSONString(newSortTaskConfig));<NEW_LINE>if (this.sortTaskConfig != null && this.sortTaskConfig.equals(newSortTaskConfig)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>this.sortTaskConfig = newSortTaskConfig;<NEW_LINE>this.parentContext = new Context(this.sortTaskConfig.getSinkParams());<NEW_LINE>// parse the config of id and topic<NEW_LINE>Map<String, HdfsIdConfig> <MASK><NEW_LINE>List<Map<String, String>> idList = this.sortTaskConfig.getIdParams();<NEW_LINE>for (Map<String, String> idParam : idList) {<NEW_LINE>String inlongGroupId = idParam.get(Constants.INLONG_GROUP_ID);<NEW_LINE>String inlongStreamId = idParam.get(Constants.INLONG_STREAM_ID);<NEW_LINE>String uid = InlongId.generateUid(inlongGroupId, inlongStreamId);<NEW_LINE>String jsonIdConfig = JSON.toJSONString(idParam);<NEW_LINE>HdfsIdConfig idConfig = JSON.parseObject(jsonIdConfig, HdfsIdConfig.class);<NEW_LINE>newIdConfigMap.put(uid, idConfig);<NEW_LINE>}<NEW_LINE>// change current config<NEW_LINE>this.idConfigMap = newIdConfigMap;<NEW_LINE>// hdfs config<NEW_LINE>this.hdfsPath = parentContext.getString(KEY_HDFS_PATH);<NEW_LINE>this.maxFileOpenDelayMinute = parentContext.getLong(KEY_MAX_FILE_OPEN_DELAY, DEFAULT_MAX_FILE_OPEN_DELAY);<NEW_LINE>this.fileArchiveDelayMinute = maxFileOpenDelayMinute + 1;<NEW_LINE>this.tokenOvertimeMinute = parentContext.getLong(KEY_TOKEN_OVERTIME, DEFAULT_TOKEN_OVERTIME);<NEW_LINE>this.maxOutputFileSizeGb = parentContext.getLong(KEY_MAX_OUTPUT_FILE_SIZE, DEFAULT_MAX_OUTPUT_FILE_SIZE);<NEW_LINE>// hive config<NEW_LINE>this.hiveJdbcUrl = parentContext.getString(KEY_HIVE_JDBC_URL);<NEW_LINE>this.hiveDatabase = parentContext.getString(KEY_HIVE_DATABASE);<NEW_LINE>this.hiveUsername = parentContext.getString(KEY_HIVE_USERNAME);<NEW_LINE>this.hivePassword = parentContext.getString(KEY_HIVE_PASSWORD);<NEW_LINE>Class.forName("org.apache.hive.jdbc.HiveDriver");<NEW_LINE>LOG.info("end to get SortTaskConfig:taskName:{}:newIdConfigMap:{}", taskName, JSON.toJSONString(newIdConfigMap));<NEW_LINE>} catch (Throwable e) {<NEW_LINE>LOG.error(e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
newIdConfigMap = new ConcurrentHashMap<>();
1,317,872
public void run() {<NEW_LINE>// in case of recursive call to run()<NEW_LINE>if (running)<NEW_LINE>return;<NEW_LINE>final <MASK><NEW_LINE>running = true;<NEW_LINE>for (; ; ) {<NEW_LINE>Finalizer f;<NEW_LINE>if (TenantGlobals.isDataIsolationEnabled() && TenantContainer.current() != null) {<NEW_LINE>TenantData td = TenantContainer.current().getTenantData();<NEW_LINE>synchronized (lock) {<NEW_LINE>f = td.getFieldValue(Finalizer.class, ID_UNFINALIZED);<NEW_LINE>if (f == null)<NEW_LINE>break;<NEW_LINE>td.setFieldValue(Finalizer.class, ID_UNFINALIZED, f.next);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>synchronized (lock) {<NEW_LINE>f = unfinalized;<NEW_LINE>if (f == null)<NEW_LINE>break;<NEW_LINE>unfinalized = f.next;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>f.runFinalizer(jla);<NEW_LINE>}<NEW_LINE>}
JavaLangAccess jla = SharedSecrets.getJavaLangAccess();
597,507
/*<NEW_LINE>* @see com.sitewhere.microservice.security.SystemUserRunnable#runAsSystemUser()<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public void runAsSystemUser() throws SiteWhereException {<NEW_LINE>List<IProcessedEventPayload> decoded = new ArrayList<>();<NEW_LINE>for (ConsumerRecord<String, byte[]> record : getRecords()) {<NEW_LINE>try {<NEW_LINE>GProcessedEventPayload grpc = EventModelMarshaler.parseProcessedEventPayloadMessage(record.value());<NEW_LINE>ProcessedEventPayload payload = EventModelConverter.asApiProcessedEventPayload(grpc);<NEW_LINE>if (getLogger().isDebugEnabled()) {<NEW_LINE>getLogger().debug("Received enriched event payload:\n\n" + MarshalUtils.marshalJsonAsPrettyString(payload));<NEW_LINE>}<NEW_LINE>decoded.add(payload);<NEW_LINE>} catch (SiteWhereException e) {<NEW_LINE>getLogger().error("Unable to parse outbound connector event payload.", e);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>getLogger().error("Unhandled exception parsing connector event payload.", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>} catch (SiteWhereException e) {<NEW_LINE>getOutboundConnector().handleFailedBatch(decoded, e);<NEW_LINE>getLogger().error("Unable to process outbound connector batch.", e);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>getOutboundConnector().handleFailedBatch(decoded, e);<NEW_LINE>getLogger().error("Unhandled exception processing connector batch.", e);<NEW_LINE>}<NEW_LINE>}
getOutboundConnector().processEventBatch(decoded);
1,470,561
private static void parseDynamicValue(final ParseContext context, ObjectMapper parentMapper, String currentFieldName, XContentParser.Token token) throws IOException {<NEW_LINE>ObjectMapper.Dynamic dynamic = dynamicOrDefault(parentMapper, context);<NEW_LINE>if (dynamic == ObjectMapper.Dynamic.STRICT) {<NEW_LINE>throw new StrictDynamicMappingException(parentMapper.fullPath(), currentFieldName);<NEW_LINE>}<NEW_LINE>if (dynamic == ObjectMapper.Dynamic.FALSE) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final String path = context.path().pathAsText(currentFieldName);<NEW_LINE>final Mapper.BuilderContext builderContext = new Mapper.BuilderContext(context.indexSettings().getSettings(), context.path());<NEW_LINE>final MappedFieldType existingFieldType = context.mapperService().fullName(path);<NEW_LINE>final Mapper.Builder builder;<NEW_LINE>if (existingFieldType != null) {<NEW_LINE>// create a builder of the same type<NEW_LINE>builder = createBuilderFromFieldType(context, existingFieldType, currentFieldName);<NEW_LINE>} else {<NEW_LINE>builder = createBuilderFromDynamicValue(context, token, currentFieldName);<NEW_LINE>}<NEW_LINE>Mapper mapper = builder.build(builderContext);<NEW_LINE>if (existingFieldType != null) {<NEW_LINE>// try to not introduce a conflict<NEW_LINE>mapper = mapper.updateFieldType(Collections<MASK><NEW_LINE>}<NEW_LINE>context.addDynamicMapper(mapper);<NEW_LINE>parseObjectOrField(context, mapper);<NEW_LINE>}
.singletonMap(path, existingFieldType));
326,781
public MediaPeriod createPeriod(MediaPeriodId id, Allocator allocator, long startPositionUs) {<NEW_LINE>Object <MASK><NEW_LINE>MediaPeriodId childMediaPeriodId = id.copyWithPeriodUid(getChildPeriodUid(id.periodUid));<NEW_LINE>@Nullable<NEW_LINE>MediaSourceHolder holder = mediaSourceByUid.get(mediaSourceHolderUid);<NEW_LINE>if (holder == null) {<NEW_LINE>// Stale event. The media source has already been removed.<NEW_LINE>holder = new MediaSourceHolder(new FakeMediaSource(), useLazyPreparation);<NEW_LINE>holder.isRemoved = true;<NEW_LINE>prepareChildSource(holder, holder.mediaSource);<NEW_LINE>}<NEW_LINE>enableMediaSource(holder);<NEW_LINE>holder.activeMediaPeriodIds.add(childMediaPeriodId);<NEW_LINE>MediaPeriod mediaPeriod = holder.mediaSource.createPeriod(childMediaPeriodId, allocator, startPositionUs);<NEW_LINE>mediaSourceByMediaPeriod.put(mediaPeriod, holder);<NEW_LINE>disableUnusedMediaSources();<NEW_LINE>return mediaPeriod;<NEW_LINE>}
mediaSourceHolderUid = getMediaSourceHolderUid(id.periodUid);
309,747
public Map<String, Object> measureUser(Recommender recommender, TestUser testUser) {<NEW_LINE>ItemRecommender irec = recommender.getItemRecommender();<NEW_LINE>if (irec == null) {<NEW_LINE>logger.debug("recommender cannot produce recommendations");<NEW_LINE>return Collections.emptyMap();<NEW_LINE>}<NEW_LINE>LongSet candidates = getCandidateSelector().selectItems(allItems, recommender, testUser);<NEW_LINE>LongSet excludes = getExcludeSelector().selectItems(allItems, recommender, testUser);<NEW_LINE>int n = getListSize();<NEW_LINE>ResultList results = null;<NEW_LINE>LongList items = null;<NEW_LINE>if (useDetails) {<NEW_LINE>logger.debug("generating {} detailed recommendations for user {}", n, testUser.getUser());<NEW_LINE>results = irec.recommendWithDetails(testUser.getUserId(<MASK><NEW_LINE>} else {<NEW_LINE>// no one needs details, save time collecting them<NEW_LINE>logger.debug("generating {} recommendations for user {}", n, testUser.getUser());<NEW_LINE>items = LongUtils.asLongList(irec.recommend(testUser.getUserId(), n, candidates, excludes));<NEW_LINE>}<NEW_LINE>// Measure the user results<NEW_LINE>Map<String, Object> row = new HashMap<>();<NEW_LINE>for (MetricContext<?> mc : predictMetricContexts) {<NEW_LINE>MetricResult res;<NEW_LINE>if (useDetails) {<NEW_LINE>res = mc.measureUser(recommender, testUser, n, results);<NEW_LINE>} else {<NEW_LINE>res = mc.measureUser(recommender, testUser, n, items);<NEW_LINE>}<NEW_LINE>row.putAll(res.withPrefix(getLabelPrefix()).getValues());<NEW_LINE>}<NEW_LINE>writeRecommendations(testUser, results);<NEW_LINE>return row;<NEW_LINE>}
), n, candidates, excludes);
1,172,096
public void onClick(View view) {<NEW_LINE>int status = Integer.parseInt(view.getTag().toString());<NEW_LINE>if (status == 0) {<NEW_LINE>status = 1;<NEW_LINE>fabActions.animate().rotation(45).setInterpolator(new AccelerateDecelerateInterpolator()).setDuration(100).start();<NEW_LINE>AnimationUtils.scaleInAnimation(fabSetColor, 50, 150, new OvershootInterpolator(), true);<NEW_LINE>AnimationUtils.scaleInAnimation(cardViewSetColor, 50, 150, new OvershootInterpolator(), true);<NEW_LINE>AnimationUtils.scaleInAnimation(fabSaveAndClose, 100, 150, new OvershootInterpolator(), true);<NEW_LINE>AnimationUtils.scaleInAnimation(cardViewSaveAndClose, 100, 150<MASK><NEW_LINE>AnimationUtils.scaleInAnimation(fabClear, 150, 150, new OvershootInterpolator(), true);<NEW_LINE>AnimationUtils.scaleInAnimation(cardViewClear, 150, 150, new OvershootInterpolator(), true);<NEW_LINE>fabSetColor.show();<NEW_LINE>cardViewSetColor.setVisibility(View.VISIBLE);<NEW_LINE>fabSaveAndClose.show();<NEW_LINE>cardViewSaveAndClose.setVisibility(View.VISIBLE);<NEW_LINE>fabClear.show();<NEW_LINE>cardViewClear.setVisibility(View.VISIBLE);<NEW_LINE>} else {<NEW_LINE>status = 0;<NEW_LINE>fabActions.animate().rotation(0).setInterpolator(new AccelerateDecelerateInterpolator()).setDuration(100).start();<NEW_LINE>fabSetColor.hide();<NEW_LINE>cardViewSetColor.setVisibility(View.INVISIBLE);<NEW_LINE>fabSaveAndClose.hide();<NEW_LINE>cardViewSaveAndClose.setVisibility(View.INVISIBLE);<NEW_LINE>fabClear.hide();<NEW_LINE>cardViewClear.setVisibility(View.INVISIBLE);<NEW_LINE>}<NEW_LINE>view.setTag(status);<NEW_LINE>}
, new OvershootInterpolator(), true);
723,196
public void execute(FlinkCommandArgs flinkCommandArgs) {<NEW_LINE>EngineType engine = flinkCommandArgs.getEngineType();<NEW_LINE>String configFile = flinkCommandArgs.getConfigFile();<NEW_LINE>Config config = new ConfigBuilder<>(configFile, engine).getConfig();<NEW_LINE>ExecutionContext<FlinkEnvironment> executionContext = new ExecutionContext<>(config, engine);<NEW_LINE>Execution<BaseSource<FlinkEnvironment>, BaseTransform<FlinkEnvironment>, BaseSink<FlinkEnvironment>, FlinkEnvironment> execution = new ExecutionFactory<>(executionContext).createExecution();<NEW_LINE>List<BaseSource<FlinkEnvironment>> sources = executionContext.getSources();<NEW_LINE>List<BaseTransform<FlinkEnvironment>> transforms = executionContext.getTransforms();<NEW_LINE>List<BaseSink<FlinkEnvironment>> sinks = executionContext.getSinks();<NEW_LINE>baseCheckConfig(sinks, transforms, sinks);<NEW_LINE>showAsciiLogo();<NEW_LINE>try {<NEW_LINE>prepare(executionContext.getEnvironment(<MASK><NEW_LINE>execution.start(sources, transforms, sinks);<NEW_LINE>close(sources, transforms, sinks);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new RuntimeException("Execute Flink task error", e);<NEW_LINE>}<NEW_LINE>}
), sources, transforms, sinks);
569,984
public InputDataConfig unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>InputDataConfig inputDataConfig = new InputDataConfig();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("S3Uri", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>inputDataConfig.setS3Uri(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("TuningDataS3Uri", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>inputDataConfig.setTuningDataS3Uri(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("DataAccessRoleArn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>inputDataConfig.setDataAccessRoleArn(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 inputDataConfig;<NEW_LINE>}
class).unmarshall(context));
1,196,864
static private Font createFont(String filename, int size) throws IOException, FontFormatException {<NEW_LINE>File fontFile = Platform.getContentFile("lib/fonts/" + filename);<NEW_LINE>if (fontFile == null || !fontFile.exists()) {<NEW_LINE>String msg = "Could not find required fonts. ";<NEW_LINE>// This gets the JAVA_HOME for the *local* copy of the JRE installed with<NEW_LINE>// Processing. If it's not using the local JRE, it may be because of this<NEW_LINE>// launch4j bug: https://github.com/processing/processing/issues/3543<NEW_LINE>if (Util.containsNonASCII(Platform.getJavaHome().getAbsolutePath())) {<NEW_LINE>msg += "Trying moving Processing\n" + "to a location with only ASCII characters in the path.";<NEW_LINE>} else {<NEW_LINE>msg += "Please reinstall Processing.";<NEW_LINE>}<NEW_LINE>Messages.showError("Font Sadness", msg, null);<NEW_LINE>}<NEW_LINE>BufferedInputStream input = new BufferedInputStream(new FileInputStream(fontFile));<NEW_LINE>Font font = Font.<MASK><NEW_LINE>input.close();<NEW_LINE>GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();<NEW_LINE>ge.registerFont(font);<NEW_LINE>return font.deriveFont((float) size);<NEW_LINE>}
createFont(Font.TRUETYPE_FONT, input);
441,488
void refresh(TruffleHeapHistogram histogram) {<NEW_LINE>if (histogram == null || isPaused())<NEW_LINE>return;<NEW_LINE>forceRefresh = false;<NEW_LINE>boolean diff = lrDeltasButton.isSelected();<NEW_LINE>if (diff) {<NEW_LINE>if (baseClasses == null) {<NEW_LINE>baseClasses = new ArrayList(classes);<NEW_LINE>baseTotalBytes = totalBytes;<NEW_LINE>baseTotalInstances = totalInstances;<NEW_LINE>baseTotalAllocBytes = totalAllocBytes;<NEW_LINE>baseTotalAllocInstances = totalAllocInstances;<NEW_LINE>}<NEW_LINE>Collection<TruffleClassInfo> newClasses = getHistogram(histogram);<NEW_LINE>classes = computeDeltaClasses(baseClasses, newClasses);<NEW_LINE>totalBytes <MASK><NEW_LINE>totalInstances = histogram.getTotalInstances() - baseTotalInstances;<NEW_LINE>totalAllocBytes = histogram.getTotalAllocBytes() - baseTotalAllocBytes;<NEW_LINE>totalAllocInstances = histogram.getTotalAllocInstances() - baseTotalAllocInstances;<NEW_LINE>long maxAbsDiffBytes = 0;<NEW_LINE>for (ClassInfo cInfo : classes) maxAbsDiffBytes = Math.max(maxAbsDiffBytes, Math.abs(cInfo.getBytes()));<NEW_LINE>} else {<NEW_LINE>if (baseClasses != null) {<NEW_LINE>baseClasses = null;<NEW_LINE>baseTotalBytes = -1;<NEW_LINE>baseTotalInstances = -1;<NEW_LINE>}<NEW_LINE>classes.clear();<NEW_LINE>classes.addAll(getHistogram(histogram));<NEW_LINE>totalBytes = histogram.getTotalBytes();<NEW_LINE>totalInstances = histogram.getTotalInstances();<NEW_LINE>totalAllocBytes = histogram.getTotalAllocBytes();<NEW_LINE>totalAllocInstances = histogram.getTotalAllocInstances();<NEW_LINE>}<NEW_LINE>renderers[0].setDiffMode(diff);<NEW_LINE>renderers[0].setMaxValue(totalBytes);<NEW_LINE>renderers[1].setDiffMode(diff);<NEW_LINE>renderers[1].setMaxValue(totalInstances);<NEW_LINE>renderers[2].setDiffMode(diff);<NEW_LINE>renderers[2].setMaxValue(totalAllocBytes);<NEW_LINE>renderers[3].setDiffMode(diff);<NEW_LINE>renderers[3].setMaxValue(totalAllocInstances);<NEW_LINE>tableModel.fireTableDataChanged();<NEW_LINE>if (pdSnapshotButton != null)<NEW_LINE>pdSnapshotButton.setEnabled(true);<NEW_LINE>}
= histogram.getTotalBytes() - baseTotalBytes;
1,847,896
@NbBundle.Messages({ "GroupTree.displayName.allGroups=All Groups" })<NEW_LINE>void initialize() {<NEW_LINE>super.initialize();<NEW_LINE><MASK><NEW_LINE>// NON-NLS<NEW_LINE>setGraphic(new ImageView("org/sleuthkit/autopsy/imagegallery/images/Folder-icon.png"));<NEW_LINE>Node placeholder = new Label(Bundle.NavPanel_placeHolder_text());<NEW_LINE>placeholder.visibleProperty().bind(Bindings.isEmpty(groupTreeRoot.getChildren()));<NEW_LINE>getBorderPane().setCenter(new StackPane(groupTree, placeholder));<NEW_LINE>// only show sorting controls if not grouping by path<NEW_LINE>BooleanBinding groupedByPath = Bindings.equal(getGroupManager().getGroupByProperty(), DrawableAttribute.PATH);<NEW_LINE>getToolBar().visibleProperty().bind(groupedByPath.not());<NEW_LINE>getToolBar().managedProperty().bind(groupedByPath.not());<NEW_LINE>GroupCellFactory groupCellFactory = new GroupCellFactory(getController(), comparatorProperty());<NEW_LINE>groupTree.setCellFactory(groupCellFactory::getTreeCell);<NEW_LINE>groupTree.setShowRoot(false);<NEW_LINE>getGroupManager().getAnalyzedGroupsForCurrentGroupBy().addListener((ListChangeListener.Change<? extends DrawableGroup> change) -> {<NEW_LINE>GroupViewState oldState = getController().getViewState();<NEW_LINE>while (change.next()) {<NEW_LINE>change.getAddedSubList().stream().forEach(this::insertGroup);<NEW_LINE>change.getRemoved().stream().forEach(this::removeFromTree);<NEW_LINE>}<NEW_LINE>Platform.runLater(() -> {<NEW_LINE>GroupTree.this.sortGroups(false);<NEW_LINE>Optional.ofNullable(oldState).flatMap(GroupViewState::getGroup).ifPresent(this::setFocusedGroup);<NEW_LINE>});<NEW_LINE>});<NEW_LINE>getGroupManager().getAnalyzedGroupsForCurrentGroupBy().forEach(this::insertGroup);<NEW_LINE>Platform.runLater(this::sortGroups);<NEW_LINE>}
setText(Bundle.GroupTree_displayName_allGroups());
1,039,423
public static GetQueryOptimizeDataTopResponse unmarshall(GetQueryOptimizeDataTopResponse getQueryOptimizeDataTopResponse, UnmarshallerContext _ctx) {<NEW_LINE>getQueryOptimizeDataTopResponse.setRequestId(_ctx.stringValue("GetQueryOptimizeDataTopResponse.RequestId"));<NEW_LINE>getQueryOptimizeDataTopResponse.setCode(_ctx.stringValue("GetQueryOptimizeDataTopResponse.Code"));<NEW_LINE>getQueryOptimizeDataTopResponse.setMessage(_ctx.stringValue("GetQueryOptimizeDataTopResponse.Message"));<NEW_LINE>getQueryOptimizeDataTopResponse.setSuccess(_ctx.stringValue("GetQueryOptimizeDataTopResponse.Success"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setTotal(_ctx.longValue("GetQueryOptimizeDataTopResponse.Data.Total"));<NEW_LINE>data.setPageNo(_ctx.integerValue("GetQueryOptimizeDataTopResponse.Data.PageNo"));<NEW_LINE>data.setPageSize(_ctx.integerValue("GetQueryOptimizeDataTopResponse.Data.PageSize"));<NEW_LINE>data.setExtra<MASK><NEW_LINE>List<QueryOptimizeDataTops> list = new ArrayList<QueryOptimizeDataTops>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("GetQueryOptimizeDataTopResponse.Data.List.Length"); i++) {<NEW_LINE>QueryOptimizeDataTops queryOptimizeDataTops = new QueryOptimizeDataTops();<NEW_LINE>queryOptimizeDataTops.setInstanceId(_ctx.stringValue("GetQueryOptimizeDataTopResponse.Data.List[" + i + "].InstanceId"));<NEW_LINE>queryOptimizeDataTops.setType(_ctx.stringValue("GetQueryOptimizeDataTopResponse.Data.List[" + i + "].Type"));<NEW_LINE>queryOptimizeDataTops.setValue(_ctx.doubleValue("GetQueryOptimizeDataTopResponse.Data.List[" + i + "].Value"));<NEW_LINE>list.add(queryOptimizeDataTops);<NEW_LINE>}<NEW_LINE>data.setList(list);<NEW_LINE>getQueryOptimizeDataTopResponse.setData(data);<NEW_LINE>return getQueryOptimizeDataTopResponse;<NEW_LINE>}
(_ctx.stringValue("GetQueryOptimizeDataTopResponse.Data.Extra"));
1,195,440
public static void vertical9(Kernel1D_S32 kernel, GrayU8 src, GrayI8 dst, int divisor, @Nullable GrowArray<DogArray_I32> workspaces) {<NEW_LINE>final byte[] dataSrc = src.data;<NEW_LINE>final byte[] dataDst = dst.data;<NEW_LINE>final int k1 = kernel.data[0];<NEW_LINE>final int k2 = kernel.data[1];<NEW_LINE>final int k3 = kernel.data[2];<NEW_LINE>final int k4 = kernel.data[3];<NEW_LINE>final int k5 = kernel.data[4];<NEW_LINE>final int k6 = kernel.data[5];<NEW_LINE>final int k7 = kernel.data[6];<NEW_LINE>final int k8 = kernel.data[7];<NEW_LINE>final int k9 = kernel.data[8];<NEW_LINE>final int radius = kernel.getRadius();<NEW_LINE>final int imgWidth = dst.getWidth();<NEW_LINE>final int imgHeight = dst.getHeight();<NEW_LINE>final int halfDivisor = divisor / 2;<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>int total = (dataSrc[indexSrc] & 0xFF) * k1;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc] & 0xFF) * k2;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc] & 0xFF) * k3;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc] & 0xFF) * k4;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc] & 0xFF) * k5;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc] & 0xFF) * k6;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc] & 0xFF) * k7;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc] & 0xFF) * k8;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc] & 0xFF) * k9;<NEW_LINE>dataDst[indexDst++] = (byte) (<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>}
(total + halfDivisor) / divisor);
1,019,370
public void example59(Vertx vertx, Router router) {<NEW_LINE>// create an OAuth2 provider, clientID and clientSecret<NEW_LINE>// should be requested to Google<NEW_LINE>OAuth2Auth authProvider = OAuth2Auth.create(vertx, new OAuth2Options().setClientId("CLIENT_ID").setClientSecret("CLIENT_SECRET").setFlow(OAuth2FlowType.AUTH_CODE).setSite("https://accounts.google.com").setTokenPath("https://www.googleapis.com/oauth2/v3/token").setAuthorizationPath("/o/oauth2/auth"));<NEW_LINE>// create a oauth2 handler on our domain: "http://localhost:8080"<NEW_LINE>OAuth2AuthHandler oauth2 = OAuth2AuthHandler.create(vertx, authProvider, "http://localhost:8080");<NEW_LINE>// these are the scopes<NEW_LINE>oauth2.withScope("profile");<NEW_LINE>// setup the callback handler for receiving the Google callback<NEW_LINE>oauth2.setupCallback<MASK><NEW_LINE>// protect everything under /protected<NEW_LINE>router.route("/protected/*").handler(oauth2);<NEW_LINE>// mount some handler under the protected zone<NEW_LINE>router.route("/protected/somepage").handler(ctx -> ctx.response().end("Welcome to the protected resource!"));<NEW_LINE>// welcome page<NEW_LINE>router.get("/").handler(ctx -> ctx.response().putHeader("content-type", "text/html").end("Hello<br><a href=\"/protected/somepage\">Protected by Google</a>"));<NEW_LINE>}
(router.get("/callback"));
820,650
public void startJob() {<NEW_LINE>String enteredPath = pathField.getText();<NEW_LINE>AbstractFile currentFolder = mainFrame.getActivePanel().getCurrentFolder();<NEW_LINE>// Resolves destination folder<NEW_LINE>PathUtils.ResolvedDestination resolvedDest = PathUtils.resolveDestination(enteredPath, currentFolder, currentFolder);<NEW_LINE>// The path entered doesn't correspond to any existing folder<NEW_LINE>if (resolvedDest == null) {<NEW_LINE>InformationDialog.showErrorDialog(mainFrame, Translator.get("invalid_path", enteredPath));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Checks if the directory already exists and reports the error if that's the case<NEW_LINE>DestinationType destinationType = resolvedDest.getDestinationType();<NEW_LINE>if (destinationType == DestinationType.EXISTING_FOLDER) {<NEW_LINE>InformationDialog.showErrorDialog(mainFrame, Translator<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Don't check for existing regular files, MkdirJob will take of it and popup a FileCollisionDialog<NEW_LINE>AbstractFile destFile = resolvedDest.getDestinationFile();<NEW_LINE>FileSet fileSet = new FileSet(destFile.getParent());<NEW_LINE>// Job's FileSet needs to contain at least one file<NEW_LINE>fileSet.add(destFile);<NEW_LINE>ProgressDialog progressDialog = new ProgressDialog(mainFrame, getTitle());<NEW_LINE>MkdirJob job;<NEW_LINE>if (mkfileMode)<NEW_LINE>job = new MkdirJob(progressDialog, mainFrame, fileSet, allocateSpaceCheckBox.isSelected() ? allocateSpaceChooser.getValue() : -1);<NEW_LINE>else<NEW_LINE>job = new MkdirJob(progressDialog, mainFrame, fileSet);<NEW_LINE>progressDialog.start(job);<NEW_LINE>}
.get("directory_already_exists", enteredPath));
1,322,888
public static List<RegressionExecution> executions() {<NEW_LINE>List<RegressionExecution> execs = new ArrayList<>();<NEW_LINE>execs.add(new ClientCompileSubstParamNamedParameter(false));<NEW_LINE>execs.add(new ClientCompileSubstParamNamedParameter(true));<NEW_LINE>execs<MASK><NEW_LINE>execs.add(new ClientCompileSubstParamUnnamedParameterWType(false));<NEW_LINE>execs.add(new ClientCompileSubstParamUnnamedParameterWType(true));<NEW_LINE>execs.add(new ClientCompileSubstParamPattern());<NEW_LINE>execs.add(new ClientCompileSubstParamSimpleOneParameterWCast());<NEW_LINE>execs.add(new ClientCompileSubstParamWInheritance());<NEW_LINE>execs.add(new ClientCompileSubstParamSimpleTwoParameterFilter());<NEW_LINE>execs.add(new ClientCompileSubstParamSimpleTwoParameterWhere());<NEW_LINE>execs.add(new ClientCompileSubstParamSimpleNoParameter());<NEW_LINE>execs.add(new ClientCompileSubstParamPrimitiveVsBoxed());<NEW_LINE>execs.add(new ClientCompileSubstParamSubselect());<NEW_LINE>execs.add(new ClientCompileSubstParamInvalidUse());<NEW_LINE>execs.add(new ClientCompileSubstParamInvalidNoCallback());<NEW_LINE>execs.add(new ClientCompileSubstParamInvalidInsufficientValues());<NEW_LINE>execs.add(new ClientCompileSubstParamInvalidParametersUntyped());<NEW_LINE>execs.add(new ClientCompileSubstParamInvalidParametersTyped());<NEW_LINE>execs.add(new ClientCompileSubstParamResolverContext());<NEW_LINE>execs.add(new ClientCompileSubstParamMultiStmt());<NEW_LINE>execs.add(new ClientCompileSubstParamArray(false));<NEW_LINE>execs.add(new ClientCompileSubstParamArray(true));<NEW_LINE>execs.add(new ClientCompileSODAInvalidConstantUseSubsParamsInstead());<NEW_LINE>execs.add(new ClientCompileSubstParamGenericType(false));<NEW_LINE>execs.add(new ClientCompileSubstParamGenericType(true));<NEW_LINE>return execs;<NEW_LINE>}
.add(new ClientCompileSubstParamMethodInvocation());
1,331,636
private static PixelClassifier createClassifier(ImageData<BufferedImage> imageData, DensityMapParameters params) {<NEW_LINE>var pixelSize = params.pixelSize;<NEW_LINE>if (pixelSize == null) {<NEW_LINE>if (imageData == null) {<NEW_LINE>throw new IllegalArgumentException("You need to specify a pixel size or provide an ImageData to generate a density map!");<NEW_LINE>}<NEW_LINE>var cal = imageData.getServer().getPixelCalibration();<NEW_LINE>double radius = params.radius;<NEW_LINE>var server = imageData.getServer();<NEW_LINE>double maxDownsample = Math.round(Math.max(server.getWidth() / (double) params.maxWidth, server.getHeight() / (double) params.maxHeight));<NEW_LINE>if (maxDownsample < 1)<NEW_LINE>maxDownsample = 1;<NEW_LINE>var minPixelSize = cal.createScaledInstance(maxDownsample, maxDownsample);<NEW_LINE>if (radius > 0) {<NEW_LINE>double radiusPixels = radius / cal.getAveragedPixelSize().doubleValue();<NEW_LINE>double radiusDownsample = Math.round(radiusPixels / 10);<NEW_LINE>pixelSize = cal.createScaledInstance(radiusDownsample, radiusDownsample);<NEW_LINE>}<NEW_LINE>if (pixelSize == null || pixelSize.getAveragedPixelSize().doubleValue() < minPixelSize.getAveragedPixelSize().doubleValue())<NEW_LINE>pixelSize = minPixelSize;<NEW_LINE>}<NEW_LINE>int radiusInt = (int) Math.round(params.radius / pixelSize.<MASK><NEW_LINE>logger.debug("Creating classifier with pixel size {}, radius = {}", pixelSize, radiusInt);<NEW_LINE>var dataOp = new DensityMapDataOp(radiusInt, params.secondaryObjectFilters, params.mainObjectFilter, params.densityType);<NEW_LINE>var metadata = new PixelClassifierMetadata.Builder().inputShape(preferredTileSize, preferredTileSize).inputResolution(pixelSize).setChannelType(ImageServerMetadata.ChannelType.DENSITY).outputChannels(dataOp.getChannels()).build();<NEW_LINE>return PixelClassifiers.createClassifier(dataOp, metadata);<NEW_LINE>}
getAveragedPixelSize().doubleValue());
144,231
public boolean finalLaunchCheck(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor) throws CoreException {<NEW_LINE>monitor.beginTask("Verifying model files", 4);<NEW_LINE>final Model model = configuration.getAdapter(Model.class);<NEW_LINE>final IFile rootModule = model.getTLAFile();<NEW_LINE>monitor.worked(1);<NEW_LINE>// parse the MC file<NEW_LINE>IParseResult parseResult = ToolboxHandle.parseModule(rootModule, SubMonitor.convert(monitor).split(1), false, false);<NEW_LINE>final Vector<TLAMarkerInformationHolder> detectedErrors = parseResult.getDetectedErrors();<NEW_LINE>boolean status = !AdapterFactory.isProblemStatus(parseResult.getStatus());<NEW_LINE>monitor.worked(1);<NEW_LINE>// remove existing markers<NEW_LINE>model.removeMarkers(Model.TLC_MODEL_ERROR_MARKER_SANY);<NEW_LINE>monitor.worked(1);<NEW_LINE>if (!detectedErrors.isEmpty()) {<NEW_LINE>TLCActivator.logDebug(<MASK><NEW_LINE>}<NEW_LINE>final Map<TLAMarkerInformationHolder, Hashtable<String, Object>> props = sany2ToolboxErrors(monitor, rootModule, detectedErrors);<NEW_LINE>props.values().forEach(marker -> model.setMarker(marker, Model.TLC_MODEL_ERROR_MARKER_SANY));<NEW_LINE>if (MODE_GENERATE.equals(mode)) {<NEW_LINE>// generation is done<NEW_LINE>// nothing to do more<NEW_LINE>return false;<NEW_LINE>} else {<NEW_LINE>return status;<NEW_LINE>}<NEW_LINE>}
"Errors in model file found " + rootModule.getLocation());
1,265,100
public ListPricingRulesResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListPricingRulesResult listPricingRulesResult = new ListPricingRulesResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return listPricingRulesResult;<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("BillingPeriod", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listPricingRulesResult.setBillingPeriod(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("PricingRules", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listPricingRulesResult.setPricingRules(new ListUnmarshaller<PricingRuleListElement>(PricingRuleListElementJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("NextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listPricingRulesResult.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 listPricingRulesResult;<NEW_LINE>}
JsonToken token = context.getCurrentToken();
321,863
public void parseAttributeClauses(IoTDBSqlParser.AttributeClausesContext ctx, CreateAlignedTimeSeriesStatement createAlignedTimeSeriesStatement) {<NEW_LINE>if (ctx.alias() != null) {<NEW_LINE>createAlignedTimeSeriesStatement.addAliasList(parseNodeName(ctx.alias().nodeNameCanInExpr<MASK><NEW_LINE>} else {<NEW_LINE>createAlignedTimeSeriesStatement.addAliasList(null);<NEW_LINE>}<NEW_LINE>String dataTypeString = ctx.dataType.getText().toUpperCase();<NEW_LINE>TSDataType dataType = TSDataType.valueOf(dataTypeString);<NEW_LINE>createAlignedTimeSeriesStatement.addDataType(dataType);<NEW_LINE>TSEncoding encoding = IoTDBDescriptor.getInstance().getDefaultEncodingByType(dataType);<NEW_LINE>if (Objects.nonNull(ctx.encoding)) {<NEW_LINE>String encodingString = ctx.encoding.getText().toUpperCase();<NEW_LINE>encoding = TSEncoding.valueOf(encodingString);<NEW_LINE>}<NEW_LINE>createAlignedTimeSeriesStatement.addEncoding(encoding);<NEW_LINE>CompressionType compressor = TSFileDescriptor.getInstance().getConfig().getCompressor();<NEW_LINE>if (ctx.compressor != null) {<NEW_LINE>String compressorString = ctx.compressor.getText().toUpperCase();<NEW_LINE>compressor = CompressionType.valueOf(compressorString);<NEW_LINE>}<NEW_LINE>createAlignedTimeSeriesStatement.addCompressor(compressor);<NEW_LINE>if (ctx.propertyClause(0) != null) {<NEW_LINE>throw new SQLParserException("create aligned timeseries: property is not supported yet.");<NEW_LINE>}<NEW_LINE>if (ctx.tagClause() != null) {<NEW_LINE>parseTagClause(ctx.tagClause(), createAlignedTimeSeriesStatement);<NEW_LINE>} else {<NEW_LINE>createAlignedTimeSeriesStatement.addTagsList(null);<NEW_LINE>}<NEW_LINE>if (ctx.attributeClause() != null) {<NEW_LINE>parseAttributeClause(ctx.attributeClause(), createAlignedTimeSeriesStatement);<NEW_LINE>} else {<NEW_LINE>createAlignedTimeSeriesStatement.addAttributesList(null);<NEW_LINE>}<NEW_LINE>}
().getText()));
570,128
/*<NEW_LINE>* may be used for issue 177341 fix later<NEW_LINE>*/<NEW_LINE>private ForeignKeyElement[] removeDuplicateFK(ForeignKeyElement[] fkeys) {<NEW_LINE>if (fkeys == null || fkeys.length == 0)<NEW_LINE>return fkeys;<NEW_LINE>HashMap<ComparableFK, ForeignKeyElement> ret = new HashMap<ComparableFK, ForeignKeyElement>();<NEW_LINE>for (int i = 0; i < fkeys.length; i++) {<NEW_LINE>ForeignKeyElement key = fkeys[i];<NEW_LINE>ComparableFK fkc = new ComparableFK(key);<NEW_LINE>if (ret.get(fkc) != null) {<NEW_LINE>// we already have the same key<NEW_LINE>// NOI18N<NEW_LINE>LOGGER.log(Level.INFO, key.getName().getFullName() + " key in " + key.getDeclaringTable().getName(<MASK><NEW_LINE>continue;<NEW_LINE>} else {<NEW_LINE>ret.put(fkc, key);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return ret.values().toArray(new ForeignKeyElement[] {});<NEW_LINE>}
).getFullName() + " is considered as a duplicate, you may need to verify your schema or database structure.");