idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
1,023,953
public static CreateInstanceExResponse unmarshall(CreateInstanceExResponse createInstanceExResponse, UnmarshallerContext context) {<NEW_LINE>createInstanceExResponse.setRequestId(context.stringValue("CreateInstanceExResponse.RequestId"));<NEW_LINE>createInstanceExResponse.setSuccess(context.booleanValue("CreateInstanceExResponse.Success"));<NEW_LINE>createInstanceExResponse.setCode(context.stringValue("CreateInstanceExResponse.Code"));<NEW_LINE>createInstanceExResponse.setMessage(context.stringValue("CreateInstanceExResponse.Message"));<NEW_LINE>createInstanceExResponse.setHttpStatusCode(context.integerValue("CreateInstanceExResponse.HttpStatusCode"));<NEW_LINE>Instance instance = new Instance();<NEW_LINE>instance.setInstanceId(context.stringValue("CreateInstanceExResponse.Instance.InstanceId"));<NEW_LINE>instance.setInstanceName<MASK><NEW_LINE>instance.setInstanceDescription(context.stringValue("CreateInstanceExResponse.Instance.InstanceDescription"));<NEW_LINE>instance.setDomainName(context.stringValue("CreateInstanceExResponse.Instance.DomainName"));<NEW_LINE>instance.setConsoleUrl(context.stringValue("CreateInstanceExResponse.Instance.ConsoleUrl"));<NEW_LINE>instance.setStorageBucket(context.stringValue("CreateInstanceExResponse.Instance.StorageBucket"));<NEW_LINE>instance.setStorageMaxDays(context.integerValue("CreateInstanceExResponse.Instance.StorageMaxDays"));<NEW_LINE>instance.setStorageMaxSize(context.integerValue("CreateInstanceExResponse.Instance.StorageMaxSize"));<NEW_LINE>instance.setMaxOnlineAgents(context.integerValue("CreateInstanceExResponse.Instance.MaxOnlineAgents"));<NEW_LINE>instance.setTenantId(context.stringValue("CreateInstanceExResponse.Instance.TenantId"));<NEW_LINE>instance.setDirectoryId(context.stringValue("CreateInstanceExResponse.Instance.DirectoryId"));<NEW_LINE>instance.setStatus(context.stringValue("CreateInstanceExResponse.Instance.Status"));<NEW_LINE>instance.setCreatedTime(context.longValue("CreateInstanceExResponse.Instance.CreatedTime"));<NEW_LINE>instance.setOwner(context.stringValue("CreateInstanceExResponse.Instance.Owner"));<NEW_LINE>List<User> admin = new ArrayList<User>();<NEW_LINE>for (int i = 0; i < context.lengthValue("CreateInstanceExResponse.Instance.Admin.Length"); i++) {<NEW_LINE>User user = new User();<NEW_LINE>user.setUserId(context.stringValue("CreateInstanceExResponse.Instance.Admin[" + i + "].UserId"));<NEW_LINE>user.setRamId(context.stringValue("CreateInstanceExResponse.Instance.Admin[" + i + "].RamId"));<NEW_LINE>user.setInstanceId(context.stringValue("CreateInstanceExResponse.Instance.Admin[" + i + "].InstanceId"));<NEW_LINE>Detail detail = new Detail();<NEW_LINE>detail.setLoginName(context.stringValue("CreateInstanceExResponse.Instance.Admin[" + i + "].Detail.LoginName"));<NEW_LINE>detail.setDisplayName(context.stringValue("CreateInstanceExResponse.Instance.Admin[" + i + "].Detail.DisplayName"));<NEW_LINE>detail.setPhone(context.stringValue("CreateInstanceExResponse.Instance.Admin[" + i + "].Detail.Phone"));<NEW_LINE>detail.setEmail(context.stringValue("CreateInstanceExResponse.Instance.Admin[" + i + "].Detail.Email"));<NEW_LINE>detail.setDepartment(context.stringValue("CreateInstanceExResponse.Instance.Admin[" + i + "].Detail.Department"));<NEW_LINE>user.setDetail(detail);<NEW_LINE>admin.add(user);<NEW_LINE>}<NEW_LINE>instance.setAdmin(admin);<NEW_LINE>List<PhoneNumber> phoneNumbers = new ArrayList<PhoneNumber>();<NEW_LINE>for (int i = 0; i < context.lengthValue("CreateInstanceExResponse.Instance.PhoneNumbers.Length"); i++) {<NEW_LINE>PhoneNumber phoneNumber = new PhoneNumber();<NEW_LINE>phoneNumber.setPhoneNumberId(context.stringValue("CreateInstanceExResponse.Instance.PhoneNumbers[" + i + "].PhoneNumberId"));<NEW_LINE>phoneNumber.setInstanceId(context.stringValue("CreateInstanceExResponse.Instance.PhoneNumbers[" + i + "].InstanceId"));<NEW_LINE>phoneNumber.setNumber(context.stringValue("CreateInstanceExResponse.Instance.PhoneNumbers[" + i + "].Number"));<NEW_LINE>phoneNumber.setPhoneNumberDescription(context.stringValue("CreateInstanceExResponse.Instance.PhoneNumbers[" + i + "].PhoneNumberDescription"));<NEW_LINE>phoneNumber.setTestOnly(context.booleanValue("CreateInstanceExResponse.Instance.PhoneNumbers[" + i + "].TestOnly"));<NEW_LINE>phoneNumber.setRemainingTime(context.integerValue("CreateInstanceExResponse.Instance.PhoneNumbers[" + i + "].RemainingTime"));<NEW_LINE>phoneNumber.setAllowOutbound(context.booleanValue("CreateInstanceExResponse.Instance.PhoneNumbers[" + i + "].AllowOutbound"));<NEW_LINE>phoneNumber.setUsage(context.stringValue("CreateInstanceExResponse.Instance.PhoneNumbers[" + i + "].Usage"));<NEW_LINE>phoneNumber.setTrunks(context.integerValue("CreateInstanceExResponse.Instance.PhoneNumbers[" + i + "].Trunks"));<NEW_LINE>phoneNumbers.add(phoneNumber);<NEW_LINE>}<NEW_LINE>instance.setPhoneNumbers(phoneNumbers);<NEW_LINE>createInstanceExResponse.setInstance(instance);<NEW_LINE>return createInstanceExResponse;<NEW_LINE>}
(context.stringValue("CreateInstanceExResponse.Instance.InstanceName"));
479,638
final DeleteDatasetResult executeDeleteDataset(DeleteDatasetRequest deleteDatasetRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteDatasetRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteDatasetRequest> request = null;<NEW_LINE>Response<DeleteDatasetResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteDatasetRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteDatasetRequest));<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, "Rekognition");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteDataset");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteDatasetResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteDatasetResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
982,265
public RulesFacts putAssetState(AssetState<?> assetState) {<NEW_LINE>if (LOG.isLoggable(Level.FINEST)) {<NEW_LINE>LOG.finest("Fact change (UPDATE): " + assetState + " - on: " + loggingContext);<NEW_LINE>}<NEW_LINE>getAssetStates().remove(assetState);<NEW_LINE>getAssetStates().add(assetState);<NEW_LINE>// Maintain index of all asset states for this asset by ID<NEW_LINE>assetIdIndex.putIfAbsent(assetState.getId(), new ArrayDeque<>());<NEW_LINE>assetIdIndex.get(assetState.getId()).remove(assetState);<NEW_LINE>assetIdIndex.get(assetState.getId<MASK><NEW_LINE>// Maintain index of all asset states for this asset by type<NEW_LINE>assetTypeIndex.putIfAbsent(assetState.getAssetType(), new ArrayDeque<>());<NEW_LINE>assetTypeIndex.get(assetState.getAssetType()).remove(assetState);<NEW_LINE>assetTypeIndex.get(assetState.getAssetType()).add(assetState);<NEW_LINE>return this;<NEW_LINE>}
()).add(assetState);
120,246
public void writePraatPitchTier(String fileName) throws IOException {<NEW_LINE>// initialize times and values:<NEW_LINE>ArrayList<Double> times = new ArrayList<Double>();<NEW_LINE>ArrayList<Double> values = new ArrayList<Double>();<NEW_LINE>// cumulative time pointer:<NEW_LINE>double time = 0;<NEW_LINE>// iterate over phones, skipping the initial silence:<NEW_LINE>ListIterator<Phone> phoneIterator = phones.listIterator(1);<NEW_LINE>while (phoneIterator.hasNext()) {<NEW_LINE><MASK><NEW_LINE>double[] frameTimes = phone.getRealizedFrameDurations();<NEW_LINE>double[] frameF0s = phone.getUnitFrameF0s();<NEW_LINE>for (int f = 0; f < frameF0s.length; f++) {<NEW_LINE>time += frameTimes[f];<NEW_LINE>times.add(time);<NEW_LINE>values.add(frameF0s[f]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// open file for writing:<NEW_LINE>File durationTierFile = new File(fileName);<NEW_LINE>PrintWriter out = new PrintWriter(durationTierFile);<NEW_LINE>// print header:<NEW_LINE>out.println("\"ooTextFile\"");<NEW_LINE>out.println("\"PitchTier\"");<NEW_LINE>out.println(String.format("0 %f %d", time, times.size()));<NEW_LINE>// print points (times and values):<NEW_LINE>for (int i = 0; i < times.size(); i++) {<NEW_LINE>out.println(String.format("%.16f %f", times.get(i), values.get(i)));<NEW_LINE>}<NEW_LINE>// flush and close:<NEW_LINE>out.close();<NEW_LINE>}
Phone phone = phoneIterator.next();
1,839,518
private void computeAndSetBackground(List<javafx.scene.paint.Stop> stops) {<NEW_LINE>if (stops.size() == 1) {<NEW_LINE>javafx.scene.paint.Color color = stops.<MASK><NEW_LINE>platformWindow.setBackground((float) color.getRed(), (float) color.getGreen(), (float) color.getBlue());<NEW_LINE>} else if (stops.size() > 1) {<NEW_LINE>// A simple attempt to find a reasonable average color that is<NEW_LINE>// within the stops arrange.<NEW_LINE>javafx.scene.paint.Color color = stops.get(0).getColor();<NEW_LINE>javafx.scene.paint.Color color2 = stops.get(stops.size() - 1).getColor();<NEW_LINE>platformWindow.setBackground((float) ((color.getRed() + color2.getRed()) / 2.0), (float) ((color.getGreen() + color2.getGreen()) / 2.0), (float) ((color.getBlue() + color2.getBlue()) / 2.0));<NEW_LINE>}<NEW_LINE>}
get(0).getColor();
68,289
// </editor-fold>//GEN-END:initComponents<NEW_LINE>private void btnAddActionPerformed(java.awt.event.ActionEvent evt) {<NEW_LINE>// GEN-FIRST:event_btnAddActionPerformed<NEW_LINE>NewConfigurationPanel pnl = new NewConfigurationPanel();<NEW_LINE>pnl.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(ConfigurationsPanel.class, "ACSD_Add_Config"));<NEW_LINE>DialogDescriptor dd = new DialogDescriptor(pnl, NbBundle.getMessage(ConfigurationsPanel.class, "TIT_Add_Config"));<NEW_LINE>pnl.attachDescriptor(dd);<NEW_LINE>Object ret = DialogDisplayer.getDefault().notify(dd);<NEW_LINE>if (ret == DialogDescriptor.OK_OPTION) {<NEW_LINE>ModelHandle2.Configuration conf = ModelHandle2.createCustomConfiguration(pnl.getConfigurationId());<NEW_LINE>conf.<MASK><NEW_LINE>conf.setActivatedProfiles(pnl.getProfiles());<NEW_LINE>conf.setProperties(ActionMappings.convertStringToActionProperties(pnl.getProperties()));<NEW_LINE>handle.addConfiguration(conf);<NEW_LINE>handle.markConfigurationsAsModified();<NEW_LINE>createListModel();<NEW_LINE>lstConfigurations.setSelectedValue(conf, true);<NEW_LINE>}<NEW_LINE>}
setShared(pnl.isShared());
706,641
public Optional<ExpressionProjectionSegment> convertToSQLSegment(final SqlNode sqlNode) {<NEW_LINE>if (sqlNode instanceof SqlBasicCall) {<NEW_LINE>SqlBasicCall sqlBasicCall = (SqlBasicCall) sqlNode;<NEW_LINE>if (SqlKind.AS == sqlBasicCall.getOperator().getKind() && sqlBasicCall.getOperandList().get(0) instanceof SqlNumericLiteral) {<NEW_LINE>SqlNode exprSqlNode = sqlBasicCall.getOperandList().get(0);<NEW_LINE>SqlNode aliasSqlNode = sqlBasicCall.getOperandList().get(1);<NEW_LINE>ExpressionSegment expressionSegment = new ExpressionConverter().convertToSQLSegment(exprSqlNode).orElse(null);<NEW_LINE>ExpressionProjectionSegment expressionProjectionSegment = new ExpressionProjectionSegment(getStartIndex(sqlBasicCall), getStopIndex(sqlBasicCall), exprSqlNode.toString(), expressionSegment);<NEW_LINE>expressionProjectionSegment.setAlias(new AliasSegment(getStartIndex(aliasSqlNode), getStopIndex(aliasSqlNode), new IdentifierValue(aliasSqlNode.toString())));<NEW_LINE>return Optional.of(expressionProjectionSegment);<NEW_LINE>}<NEW_LINE>ExpressionSegment expressionSegment = new ExpressionConverter().convertToSQLSegment(sqlNode).orElse(null);<NEW_LINE>String text = expressionSegment instanceof FunctionSegment ? ((FunctionSegment) expressionSegment).getText<MASK><NEW_LINE>return Optional.of(new ExpressionProjectionSegment(getStartIndex(sqlNode), getStopIndex(sqlNode), text, expressionSegment));<NEW_LINE>}<NEW_LINE>return Optional.empty();<NEW_LINE>}
() : sqlNode.toString();
102,734
private MethodDependency createMethodDep(MethodReference methodRef, MethodHolder method) {<NEW_LINE>ValueType[<MASK><NEW_LINE>int paramCount = arguments.length + 1;<NEW_LINE>DependencyNode[] parameterNodes = new DependencyNode[arguments.length + 1];<NEW_LINE>parameterNodes[0] = createParameterNode(methodRef, ValueType.object(methodRef.getClassName()), 0);<NEW_LINE>for (int i = 0; i < arguments.length; ++i) {<NEW_LINE>parameterNodes[i + 1] = createParameterNode(methodRef, arguments[i], i + 1);<NEW_LINE>}<NEW_LINE>DependencyNode resultNode;<NEW_LINE>if (methodRef.getDescriptor().getResultType() == ValueType.VOID) {<NEW_LINE>resultNode = null;<NEW_LINE>} else {<NEW_LINE>resultNode = createResultNode(methodRef);<NEW_LINE>}<NEW_LINE>DependencyNode thrown = createThrownNode(methodRef);<NEW_LINE>MethodDependency dep = new MethodDependency(this, parameterNodes, paramCount, resultNode, thrown, method, methodRef);<NEW_LINE>if (method != null) {<NEW_LINE>deferredTasks.add(() -> linkClass(dep.getMethod().getOwnerName()).initClass(new CallLocation(dep.getMethod().getReference())));<NEW_LINE>}<NEW_LINE>return dep;<NEW_LINE>}
] arguments = methodRef.getParameterTypes();
1,284,524
public static File normalizeFile(File file) {<NEW_LINE>Runnable off = Log.internalLog();<NEW_LINE>try {<NEW_LINE>// taken from org.openide.util.FileUtil<NEW_LINE>if (System.getProperty("os.name").startsWith("Windows")) {<NEW_LINE>// NOI18N<NEW_LINE>// On Windows, best to canonicalize.<NEW_LINE>try {<NEW_LINE>file = file.getCanonicalFile();<NEW_LINE>} catch (IOException e) {<NEW_LINE>Logger.getLogger(Manager.class.getName()).warning("getCanonicalFile() on file " + file + " failed: " + e);<NEW_LINE>// OK, so at least try to absolutize the path<NEW_LINE>file = file.getAbsoluteFile();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// On Unix, do not want to traverse symlinks.<NEW_LINE>@SuppressWarnings("URI.normalize")<NEW_LINE>URI normalized = file.toURI().normalize();<NEW_LINE>file = new <MASK><NEW_LINE>}<NEW_LINE>return file;<NEW_LINE>} finally {<NEW_LINE>off.run();<NEW_LINE>}<NEW_LINE>}
File(normalized).getAbsoluteFile();
122,967
public static OutputConditionPolledFactoryForge createConditionFactory(OutputLimitSpec outputLimitSpec, StatementRawInfo statementRawInfo, StatementCompileTimeServices compileTimeServices) throws ExprValidationException {<NEW_LINE>if (outputLimitSpec == null) {<NEW_LINE>throw new NullPointerException("Output condition requires a non-null callback");<NEW_LINE>}<NEW_LINE>// check variable use<NEW_LINE>VariableMetaData variableMetaData = null;<NEW_LINE>if (outputLimitSpec.getVariableName() != null) {<NEW_LINE>variableMetaData = compileTimeServices.getVariableCompileTimeResolver().resolve(outputLimitSpec.getVariableName());<NEW_LINE>if (variableMetaData == null) {<NEW_LINE>throw new IllegalArgumentException("Variable named '" + outputLimitSpec.getVariableName() + "' has not been declared");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (outputLimitSpec.getRateType() == OutputLimitRateType.CRONTAB) {<NEW_LINE>return new OutputConditionPolledCrontabFactoryForge(outputLimitSpec.getCrontabAtSchedule(), statementRawInfo, compileTimeServices);<NEW_LINE>} else if (outputLimitSpec.getRateType() == OutputLimitRateType.WHEN_EXPRESSION) {<NEW_LINE>return new OutputConditionPolledExpressionFactoryForge(outputLimitSpec.getWhenExpressionNode(), outputLimitSpec.getThenExpressions(), statementRawInfo.getStatementName(), compileTimeServices);<NEW_LINE>} else if (outputLimitSpec.getRateType() == OutputLimitRateType.EVENTS) {<NEW_LINE>int rate = -1;<NEW_LINE>if (outputLimitSpec.getRate() != null) {<NEW_LINE>rate = outputLimitSpec<MASK><NEW_LINE>}<NEW_LINE>return new OutputConditionPolledCountFactoryForge(rate, variableMetaData);<NEW_LINE>} else {<NEW_LINE>if (variableMetaData != null && (!JavaClassHelper.isNumeric(variableMetaData.getType()))) {<NEW_LINE>throw new IllegalArgumentException("Variable named '" + outputLimitSpec.getVariableName() + "' must be of numeric type");<NEW_LINE>}<NEW_LINE>return new OutputConditionPolledTimeFactoryForge(outputLimitSpec.getTimePeriodExpr());<NEW_LINE>}<NEW_LINE>}
.getRate().intValue();
1,270,480
public static Suggestions create(final String command, final Collection<Suggestion> suggestions) {<NEW_LINE>if (suggestions.isEmpty()) {<NEW_LINE>return EMPTY;<NEW_LINE>}<NEW_LINE>int start = Integer.MAX_VALUE;<NEW_LINE>int end = Integer.MIN_VALUE;<NEW_LINE>for (final Suggestion suggestion : suggestions) {<NEW_LINE>start = Math.min(suggestion.getRange().getStart(), start);<NEW_LINE>end = Math.max(suggestion.getRange().getEnd(), end);<NEW_LINE>}<NEW_LINE>final StringRange range = new StringRange(start, end);<NEW_LINE>final Set<Suggestion> texts = new HashSet<>();<NEW_LINE>for (final Suggestion suggestion : suggestions) {<NEW_LINE>texts.add(suggestion.expand(command, range));<NEW_LINE>}<NEW_LINE>final List<Suggestion> sorted <MASK><NEW_LINE>sorted.sort((a, b) -> a.compareToIgnoreCase(b));<NEW_LINE>return new Suggestions(range, sorted);<NEW_LINE>}
= new ArrayList<>(texts);
1,366,150
private static SqlIntervalQualifier convertIntervalDatepartToSqlIntervalQualifier(String datePart) {<NEW_LINE>switch(datePart) {<NEW_LINE>case "YEAR":<NEW_LINE>return new SqlIntervalQualifier(TimeUnit.YEAR, null, SqlParserPos.ZERO);<NEW_LINE>case "MONTH":<NEW_LINE>return new SqlIntervalQualifier(TimeUnit.MONTH, null, SqlParserPos.ZERO);<NEW_LINE>case "DAY":<NEW_LINE>return new SqlIntervalQualifier(TimeUnit.DAY, null, SqlParserPos.ZERO);<NEW_LINE>case "HOUR":<NEW_LINE>return new SqlIntervalQualifier(TimeUnit.<MASK><NEW_LINE>case "MINUTE":<NEW_LINE>return new SqlIntervalQualifier(TimeUnit.MINUTE, null, SqlParserPos.ZERO);<NEW_LINE>case "SECOND":<NEW_LINE>return new SqlIntervalQualifier(TimeUnit.SECOND, null, SqlParserPos.ZERO);<NEW_LINE>case "WEEK":<NEW_LINE>return new SqlIntervalQualifier(TimeUnit.WEEK, null, SqlParserPos.ZERO);<NEW_LINE>case "QUARTER":<NEW_LINE>return new SqlIntervalQualifier(TimeUnit.QUARTER, null, SqlParserPos.ZERO);<NEW_LINE>case "MILLISECOND":<NEW_LINE>return new SqlIntervalQualifier(TimeUnit.MILLISECOND, null, SqlParserPos.ZERO);<NEW_LINE>default:<NEW_LINE>throw new ZetaSqlException(String.format("Received an undefined INTERVAL unit: %s. Please specify unit from the following" + " list: %s.", datePart, INTERVAL_DATE_PART_MSG));<NEW_LINE>}<NEW_LINE>}
HOUR, null, SqlParserPos.ZERO);
1,191,206
private void createDataSourceProxy(ConfigurableListableBeanFactory beanFactory, String beanName, BeanDefinition originDataSource, String jdbcUrl) {<NEW_LINE>// re-register origin datasource bean<NEW_LINE>BeanDefinitionRegistry beanDefinitionRegistry = (BeanDefinitionRegistry) beanFactory;<NEW_LINE>beanDefinitionRegistry.removeBeanDefinition(beanName);<NEW_LINE>boolean isPrimary = originDataSource.isPrimary();<NEW_LINE>originDataSource.setPrimary(false);<NEW_LINE>beanDefinitionRegistry.registerBeanDefinition(transformDatasourceBeanName(beanName), originDataSource);<NEW_LINE>// register proxied datasource<NEW_LINE>RootBeanDefinition proxiedBeanDefinition = new RootBeanDefinition(SmartDataSource.class);<NEW_LINE>proxiedBeanDefinition.setRole(BeanDefinition.ROLE_APPLICATION);<NEW_LINE>proxiedBeanDefinition.setPrimary(isPrimary);<NEW_LINE>proxiedBeanDefinition.setInitMethodName("init");<NEW_LINE>proxiedBeanDefinition.setDependsOn(transformDatasourceBeanName(beanName));<NEW_LINE>MutablePropertyValues originValues = originDataSource.getPropertyValues();<NEW_LINE>MutablePropertyValues values = new MutablePropertyValues();<NEW_LINE>String appName = environment.getProperty(TRACER_APPNAME_KEY);<NEW_LINE>Assert.isTrue(!StringUtils.isBlank(appName), TRACER_APPNAME_KEY + " must be configured!");<NEW_LINE>values.add("appName", appName);<NEW_LINE>values.add("delegate", new RuntimeBeanReference(transformDatasourceBeanName(beanName)));<NEW_LINE>values.add("dbType", DataSourceUtils.resolveDbTypeFromUrl(unwrapPropertyValue(originValues.get(jdbcUrl))));<NEW_LINE>values.add("database", DataSourceUtils.resolveDatabaseFromUrl(unwrapPropertyValue(originValues.get(jdbcUrl))));<NEW_LINE>proxiedBeanDefinition.setPropertyValues(values);<NEW_LINE><MASK><NEW_LINE>}
beanDefinitionRegistry.registerBeanDefinition(beanName, proxiedBeanDefinition);
102,061
public void membersMoved(final Set<BaseType> affectedTypes) {<NEW_LINE>// Note: we need to queue modifications to the model in the dispatcher thread, otherwise we<NEW_LINE>// interfere with the not yet completed drag and drop operation.<NEW_LINE>SwingUtilities.invokeLater(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>// Perform the actual member movement.<NEW_LINE>for (final BaseType baseType : affectedTypes) {<NEW_LINE>if (!filter.includeType(baseType)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// 1) Determine nodes that need to be re-created due to the member move and remove them.<NEW_LINE>final List<DefaultMutableTreeNode> oldNodes = collectSubtreeNodes(getBaseTypeTreeNode(baseType).getNode());<NEW_LINE>removeNodes(oldNodes);<NEW_LINE>// 2) Re-create the base type node and all child nodes.<NEW_LINE>nodeStructureChanged(insertBaseType<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
(baseType).getNode());
1,477,611
private IResource loadAndAddConfDstu2(HttpServletRequest theServletRequest, final HomeRequest theRequest, final ModelMap theModel) {<NEW_LINE>CaptureInterceptor interceptor = new CaptureInterceptor();<NEW_LINE>GenericClient client = theRequest.newClient(theServletRequest, getContext(theRequest), myConfig, interceptor);<NEW_LINE>ca.uhn.fhir.model.dstu2.resource.Conformance conformance;<NEW_LINE>try {<NEW_LINE>conformance = client.fetchConformance().ofType(Conformance.class).execute();<NEW_LINE>} catch (Exception e) {<NEW_LINE>ourLog.warn("Failed to load conformance statement, error was: {}", e.toString());<NEW_LINE>theModel.put("errorMsg", toDisplayError("Failed to load conformance statement, error was: " + e.toString(), e));<NEW_LINE>conformance = new ca.uhn.fhir.model.dstu2.resource.Conformance();<NEW_LINE>}<NEW_LINE>theModel.put("jsonEncodedConf", getContext(theRequest).newJsonParser().encodeResourceToString(conformance));<NEW_LINE>Map<String, Number> <MASK><NEW_LINE>long total = 0;<NEW_LINE>for (ca.uhn.fhir.model.dstu2.resource.Conformance.Rest nextRest : conformance.getRest()) {<NEW_LINE>for (ca.uhn.fhir.model.dstu2.resource.Conformance.RestResource nextResource : nextRest.getResource()) {<NEW_LINE>List<ExtensionDt> exts = nextResource.getUndeclaredExtensionsByUrl(RESOURCE_COUNT_EXT_URL);<NEW_LINE>if (exts != null && exts.size() > 0) {<NEW_LINE>Number nextCount = ((DecimalDt) (exts.get(0).getValue())).getValueAsNumber();<NEW_LINE>resourceCounts.put(nextResource.getTypeElement().getValue(), nextCount);<NEW_LINE>total += nextCount.longValue();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>theModel.put("resourceCounts", resourceCounts);<NEW_LINE>if (total > 0) {<NEW_LINE>for (ca.uhn.fhir.model.dstu2.resource.Conformance.Rest nextRest : conformance.getRest()) {<NEW_LINE>Collections.sort(nextRest.getResource(), new Comparator<ca.uhn.fhir.model.dstu2.resource.Conformance.RestResource>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int compare(ca.uhn.fhir.model.dstu2.resource.Conformance.RestResource theO1, ca.uhn.fhir.model.dstu2.resource.Conformance.RestResource theO2) {<NEW_LINE>DecimalDt count1 = new DecimalDt();<NEW_LINE>List<ExtensionDt> count1exts = theO1.getUndeclaredExtensionsByUrl(RESOURCE_COUNT_EXT_URL);<NEW_LINE>if (count1exts != null && count1exts.size() > 0) {<NEW_LINE>count1 = (DecimalDt) count1exts.get(0).getValue();<NEW_LINE>}<NEW_LINE>DecimalDt count2 = new DecimalDt();<NEW_LINE>List<ExtensionDt> count2exts = theO2.getUndeclaredExtensionsByUrl(RESOURCE_COUNT_EXT_URL);<NEW_LINE>if (count2exts != null && count2exts.size() > 0) {<NEW_LINE>count2 = (DecimalDt) count2exts.get(0).getValue();<NEW_LINE>}<NEW_LINE>int retVal = count2.compareTo(count1);<NEW_LINE>if (retVal == 0) {<NEW_LINE>retVal = theO1.getTypeElement().getValue().compareTo(theO2.getTypeElement().getValue());<NEW_LINE>}<NEW_LINE>return retVal;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}<NEW_LINE>theModel.put("conf", conformance);<NEW_LINE>theModel.put("requiredParamExtension", ExtensionConstants.PARAM_IS_REQUIRED);<NEW_LINE>return conformance;<NEW_LINE>}
resourceCounts = new HashMap<>();
1,388,380
public void executeFix(final String endpointId) throws DotDataException, DotSecurityException {<NEW_LINE>// remove from the index all the content under each conflicted host<NEW_LINE>final DotConnect dc = new DotConnect().setSQL("SELECT remote_working_inode, local_working_inode, remote_live_inode, local_live_inode," + " remote_identifier, local_identifier, language_id, host" + " FROM " + getIntegrityType().getResultsTableName() + " WHERE endpoint_id = ?").addParam(endpointId);<NEW_LINE>final List<Map<String, Object>> results = dc.loadObjectResults();<NEW_LINE>final Map<String, Integer> versionCount = new HashMap<>();<NEW_LINE>results.forEach(result -> {<NEW_LINE>final String oldIdentifier = (String) result.get("local_identifier");<NEW_LINE>final Integer existent = versionCount.get(oldIdentifier);<NEW_LINE>final Integer counter = existent == null ? 1 : existent + 1;<NEW_LINE>versionCount.put(oldIdentifier, counter);<NEW_LINE>});<NEW_LINE>for (final Map<String, Object> result : results) {<NEW_LINE>final String oldHostIdentifier = (<MASK><NEW_LINE>final int counter = versionCount.get(oldHostIdentifier);<NEW_LINE>boolean isLastConflict = counter == 1;<NEW_LINE>fixHostConflicts(result, isLastConflict);<NEW_LINE>if (!isLastConflict) {<NEW_LINE>// Decrease version counter if greater than 1<NEW_LINE>versionCount.put(oldHostIdentifier, counter - 1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
String) result.get("local_identifier");
117,844
public static LimitOrder adaptUserTradesToOrderStatus(String orderId, PoloniexUserTrade[] poloniexUserTrades) {<NEW_LINE>if (poloniexUserTrades.length == 0)<NEW_LINE>return null;<NEW_LINE>OrderType orderType = null;<NEW_LINE>CurrencyPair currencyPair = null;<NEW_LINE>BigDecimal amount = new BigDecimal(0);<NEW_LINE>List<BigDecimal> <MASK><NEW_LINE>for (PoloniexUserTrade poloniexUserTrade : poloniexUserTrades) {<NEW_LINE>orderType = // what about others?<NEW_LINE>poloniexUserTrade.getType().equals("buy") ? // what about others?<NEW_LINE>OrderType.BID : OrderType.ASK;<NEW_LINE>amount = amount.add(poloniexUserTrade.getAmount());<NEW_LINE>weightedPrices.add(poloniexUserTrade.getRate().multiply(poloniexUserTrade.getAmount()));<NEW_LINE>}<NEW_LINE>BigDecimal weightedAveragePrice = weightedPrices.stream().reduce(new BigDecimal(0), BigDecimal::add).divide(amount, RoundingMode.HALF_UP);<NEW_LINE>return new LimitOrder(orderType, null, currencyPair, orderId, null, null, weightedAveragePrice, amount, null, Order.OrderStatus.UNKNOWN);<NEW_LINE>}
weightedPrices = new ArrayList<>();
1,723,387
public void buildStages(Stage primaryStage, ResourceBundle resourceBundle) throws Exception {<NEW_LINE>int width = 800, height = 459;<NEW_LINE>window = primaryStage;<NEW_LINE>Parent root = FXMLLoader.load(getClass().getResource("/main.fxml"), resourceBundle);<NEW_LINE>window.setTitle("LibRec V2.0");<NEW_LINE>mainScene = new Scene(root, width, height);<NEW_LINE>window.setScene(mainScene);<NEW_LINE>window.show();<NEW_LINE>root = FXMLLoader.load(getClass().getResource("/dataModel.fxml"), resourceBundle);<NEW_LINE>dataModelScene = new Scene(root, width, height);<NEW_LINE>root = FXMLLoader.load(getClass().getResource("/evaluator.fxml"), resourceBundle);<NEW_LINE>evaluatorScene = new Scene(root, width, height);<NEW_LINE>root = FXMLLoader.load(getClass().getResource("/filter.fxml"), resourceBundle);<NEW_LINE>filterScene = new Scene(root, width, height);<NEW_LINE>root = FXMLLoader.load(getClass().getResource("/output_1.fxml"), resourceBundle);<NEW_LINE>outputScene = new Scene(root, width, height);<NEW_LINE>root = FXMLLoader.load(getClass().getResource("/recommender.fxml"), resourceBundle);<NEW_LINE>recommenderScene = new <MASK><NEW_LINE>root = FXMLLoader.load(getClass().getResource("/similarity.fxml"), resourceBundle);<NEW_LINE>similarityScene = new Scene(root, width, height);<NEW_LINE>conf = new Configuration();<NEW_LINE>}
Scene(root, width, height);
411,690
private Mono<Response<EventSourceListResponseInner>> listByEnvironmentWithResponseAsync(String resourceGroupName, String environmentName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (environmentName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter environmentName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.listByEnvironment(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, environmentName, this.client.getApiVersion(), accept, context);<NEW_LINE>}
error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));
615,034
public MultiLayerNetwork clone() {<NEW_LINE>if (!initCalled)<NEW_LINE>init();<NEW_LINE>MultiLayerConfiguration conf <MASK><NEW_LINE>MultiLayerNetwork ret = new MultiLayerNetwork(conf);<NEW_LINE>ret.init(this.params().dup(), false);<NEW_LINE>if (solver != null) {<NEW_LINE>// If solver is null: updater hasn't been initialized -> getUpdater call will force initialization, however<NEW_LINE>Updater u = this.getUpdater();<NEW_LINE>INDArray updaterState = u.getStateViewArray();<NEW_LINE>if (updaterState != null) {<NEW_LINE>ret.getUpdater().setStateViewArray(ret, updaterState.dup(), false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (hasAFrozenLayer()) {<NEW_LINE>// correct layers to frozen layers<NEW_LINE>Layer[] clonedLayers = ret.getLayers();<NEW_LINE>for (int i = 0; i < layers.length; i++) {<NEW_LINE>if (layers[i] instanceof FrozenLayer) {<NEW_LINE>clonedLayers[i] = new FrozenLayer(ret.getLayer(i));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ret.setLayers(clonedLayers);<NEW_LINE>}<NEW_LINE>return ret;<NEW_LINE>}
= this.layerWiseConfigurations.clone();
1,444,786
static List<SpecModelValidationError> validateMountSpecModel(MountSpecModel specModel) {<NEW_LINE>List<SpecModelValidationError> validationErrors = new ArrayList<>();<NEW_LINE>validationErrors.addAll(validateMethods(specModel, DelegateMethodDescriptions.MOUNT_SPEC_DELEGATE_METHODS_MAP, DelegateMethodDescriptions.INTER_STAGE_INPUTS_MAP));<NEW_LINE>final SpecMethodModel<DelegateMethod, Void> onCreateMountContentModel = SpecModelUtils.<MASK><NEW_LINE>if (onCreateMountContentModel == null) {<NEW_LINE>validationErrors.add(new SpecModelValidationError(specModel.getRepresentedObject(), "All MountSpecs need to have a method annotated with @OnCreateMountContent."));<NEW_LINE>} else {<NEW_LINE>final TypeName mountType = onCreateMountContentModel.returnType;<NEW_LINE>ImmutableList<Class<? extends Annotation>> methodsAcceptingMountTypeAsSecondParam = ImmutableList.of(OnMount.class, OnBind.class, OnUnbind.class, OnUnmount.class);<NEW_LINE>for (Class<? extends Annotation> annotation : methodsAcceptingMountTypeAsSecondParam) {<NEW_LINE>final SpecMethodModel<DelegateMethod, Void> method = SpecModelUtils.getMethodModelWithAnnotation(specModel, annotation);<NEW_LINE>if (method != null && (method.methodParams.size() < 2 || !method.methodParams.get(1).getTypeName().equals(mountType))) {<NEW_LINE>validationErrors.add(new SpecModelValidationError(method.representedObject, "The second parameter of a method annotated with " + annotation + " must " + "have the same type as the return type of the method annotated with " + "@OnCreateMountContent (i.e. " + mountType + ")."));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return validationErrors;<NEW_LINE>}
getMethodModelWithAnnotation(specModel, OnCreateMountContent.class);
1,538,621
public static Object fetch(String id) {<NEW_LINE>try {<NEW_LINE>checkCapabilities();<NEW_LINE>Logger.D(TAG, "fetch(id)");<NEW_LINE>ContentResolver r = getContentResolver();<NEW_LINE>Uri uri = ContentUris.withAppendedId(EVENTS_URI, Long.parseLong(id));<NEW_LINE>final Cursor eventCursor = r.query(uri, new String[] { EVENTS_ID, EVENTS_TITLE, EVENTS_START_DATE, EVENTS_END_DATE, EVENTS_LOCATION, EVENTS_NOTES, EVENTS_PRIVACY, EVENTS_RRULE }, null, null, null);<NEW_LINE>if (eventCursor == null)<NEW_LINE>throw new RuntimeException("Calendar provider not found");<NEW_LINE>try {<NEW_LINE>if (!eventCursor.moveToFirst()) {<NEW_LINE>Logger.D(TAG, "fetch(id): result set is empty");<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Event event = fetchEvent(eventCursor, false);<NEW_LINE>return event;<NEW_LINE>} finally {<NEW_LINE>eventCursor.close();<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE><MASK><NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}
Logger.E(TAG, e);
245,543
public GetServiceTemplateResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>GetServiceTemplateResult getServiceTemplateResult = new GetServiceTemplateResult();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return getServiceTemplateResult;<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("serviceTemplate", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getServiceTemplateResult.setServiceTemplate(ServiceTemplateJsonUnmarshaller.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 getServiceTemplateResult;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
1,581,884
public static void drawNumbers(Graphics2D g2, List<PointIndex2D_F64> foundTarget, @Nullable Point2Transform2_F32 transform, double scale) {<NEW_LINE>Font regular = new Font("Serif", Font.PLAIN, 16);<NEW_LINE>g2.setFont(regular);<NEW_LINE>g2.setStroke(new BasicStroke(2));<NEW_LINE>FontRenderContext frc = g2.getFontRenderContext();<NEW_LINE>Point2D_F32 adj = new Point2D_F32();<NEW_LINE>AffineTransform at = new AffineTransform();<NEW_LINE>AffineTransform origTran = g2.getTransform();<NEW_LINE>for (int i = 0; i < foundTarget.size(); i++) {<NEW_LINE>PointIndex2D_F64 p = foundTarget.get(i);<NEW_LINE>if (transform != null) {<NEW_LINE>transform.compute((float) p.p.x, (float) p.p.y, adj);<NEW_LINE>} else {<NEW_LINE>adj.setTo((float) p.p.x, (float) p.p.y);<NEW_LINE>}<NEW_LINE>String text = String.format("%2d", i);<NEW_LINE>GlyphVector gv = regular.createGlyphVector(frc, text);<NEW_LINE>at.setToTranslation(adj.x * scale, adj.y * scale);<NEW_LINE>at.concatenate(origTran);<NEW_LINE>g2.setTransform(at);<NEW_LINE>for (int j = 0; j < gv.getNumGlyphs(); j++) {<NEW_LINE><MASK><NEW_LINE>g2.draw(gv.getGlyphOutline(j));<NEW_LINE>g2.setColor(Color.GREEN);<NEW_LINE>g2.fill(gv.getGlyphOutline(j));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>g2.setTransform(origTran);<NEW_LINE>}
g2.setColor(Color.BLACK);
1,226,370
public Request<ListSnapshotsInRecycleBinRequest> marshall(ListSnapshotsInRecycleBinRequest listSnapshotsInRecycleBinRequest) {<NEW_LINE>if (listSnapshotsInRecycleBinRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<ListSnapshotsInRecycleBinRequest> request = new DefaultRequest<ListSnapshotsInRecycleBinRequest>(listSnapshotsInRecycleBinRequest, "AmazonEC2");<NEW_LINE><MASK><NEW_LINE>request.addParameter("Version", "2016-11-15");<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>if (listSnapshotsInRecycleBinRequest.getMaxResults() != null) {<NEW_LINE>request.addParameter("MaxResults", StringUtils.fromInteger(listSnapshotsInRecycleBinRequest.getMaxResults()));<NEW_LINE>}<NEW_LINE>if (listSnapshotsInRecycleBinRequest.getNextToken() != null) {<NEW_LINE>request.addParameter("NextToken", StringUtils.fromString(listSnapshotsInRecycleBinRequest.getNextToken()));<NEW_LINE>}<NEW_LINE>com.amazonaws.internal.SdkInternalList<String> listSnapshotsInRecycleBinRequestSnapshotIdsList = (com.amazonaws.internal.SdkInternalList<String>) listSnapshotsInRecycleBinRequest.getSnapshotIds();<NEW_LINE>if (!listSnapshotsInRecycleBinRequestSnapshotIdsList.isEmpty() || !listSnapshotsInRecycleBinRequestSnapshotIdsList.isAutoConstruct()) {<NEW_LINE>int snapshotIdsListIndex = 1;<NEW_LINE>for (String listSnapshotsInRecycleBinRequestSnapshotIdsListValue : listSnapshotsInRecycleBinRequestSnapshotIdsList) {<NEW_LINE>if (listSnapshotsInRecycleBinRequestSnapshotIdsListValue != null) {<NEW_LINE>request.addParameter("SnapshotId." + snapshotIdsListIndex, StringUtils.fromString(listSnapshotsInRecycleBinRequestSnapshotIdsListValue));<NEW_LINE>}<NEW_LINE>snapshotIdsListIndex++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
request.addParameter("Action", "ListSnapshotsInRecycleBin");
1,025,938
public int compareAngularDirection(HalfEdge e) {<NEW_LINE>double dx = directionX();<NEW_LINE>double dy = directionY();<NEW_LINE>double dx2 = e.directionX();<NEW_LINE>double dy2 = e.directionY();<NEW_LINE>// same vector<NEW_LINE>if (dx == dx2 && dy == dy2)<NEW_LINE>return 0;<NEW_LINE>int quadrant = Quadrant.quadrant(dx, dy);<NEW_LINE>int quadrant2 = Quadrant.quadrant(dx2, dy2);<NEW_LINE>if (quadrant > quadrant2)<NEW_LINE>return 1;<NEW_LINE>if (quadrant < quadrant2)<NEW_LINE>return -1;<NEW_LINE>// --- vectors are in the same quadrant<NEW_LINE>// Check relative orientation of direction vectors<NEW_LINE>// this is > e if it is CCW of e<NEW_LINE>Coordinate dir1 = directionPt();<NEW_LINE>Coordinate dir2 = e.directionPt();<NEW_LINE>return Orientation.index(<MASK><NEW_LINE>}
e.orig, dir2, dir1);
252,782
protected void masterOperation(Task task, XPackUsageRequest request, ClusterState state, ActionListener<XPackUsageFeatureResponse> listener) {<NEW_LINE>EqlStatsRequest eqlRequest = new EqlStatsRequest();<NEW_LINE>eqlRequest.includeStats(true);<NEW_LINE>eqlRequest.setParentTask(clusterService.localNode().getId(), task.getId());<NEW_LINE>client.execute(EqlStatsAction.INSTANCE, eqlRequest, ActionListener.wrap(r -> {<NEW_LINE>List<Counters> countersPerNode = r.getNodes().stream().map(EqlStatsResponse.NodeStatsResponse::getStats).filter(Objects::nonNull).<MASK><NEW_LINE>Counters mergedCounters = Counters.merge(countersPerNode);<NEW_LINE>EqlFeatureSetUsage usage = new EqlFeatureSetUsage(mergedCounters.toNestedMap());<NEW_LINE>listener.onResponse(new XPackUsageFeatureResponse(usage));<NEW_LINE>}, listener::onFailure));<NEW_LINE>}
collect(Collectors.toList());
1,825,333
public Optional<BibEntry> performSearchById(String identifier) throws FetcherException {<NEW_LINE>if (StringUtil.isBlank(identifier)) {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>// remove any newlines and spaces.<NEW_LINE>identifier = NEWLINE_SPACE_PATTERN.matcher(identifier).replaceAll("");<NEW_LINE>IsbnViaEbookDeFetcher isbnViaEbookDeFetcher = new IsbnViaEbookDeFetcher(importFormatPreferences);<NEW_LINE>Optional<BibEntry> bibEntry = isbnViaEbookDeFetcher.performSearchById(identifier);<NEW_LINE>// nothing found at ebook.de: try ottobib<NEW_LINE>if (!bibEntry.isPresent()) {<NEW_LINE>LOGGER.debug("No entry found at ebook.de; trying ottobib");<NEW_LINE><MASK><NEW_LINE>bibEntry = isbnViaOttoBibFetcher.performSearchById(identifier);<NEW_LINE>}<NEW_LINE>return bibEntry;<NEW_LINE>}
IsbnViaOttoBibFetcher isbnViaOttoBibFetcher = new IsbnViaOttoBibFetcher(importFormatPreferences);
1,643,251
private JSONObject copy(JSONObject params) throws ServletException {<NEW_LINE>try {<NEW_LINE>JSONArray paths = ((JSONArray) params.get("items"));<NEW_LINE>Path newpath = Paths.get(REPOSITORY_BASE_PATH, params.getAsString("newPath"));<NEW_LINE>String newFileName = params.getAsString("singleFilename");<NEW_LINE>for (Object obj : paths) {<NEW_LINE>Path path = newFileName == null ? Paths.get(REPOSITORY_BASE_PATH, obj.toString()) : Paths.get(".", newFileName);<NEW_LINE>Path mpath = newpath.resolve(path.getFileName());<NEW_LINE>LOG.debug("mv {} to {} exists? {}", path, mpath, Files.exists(mpath));<NEW_LINE>if (Files.exists(mpath)) {<NEW_LINE>return error(mpath.toString() + " already exits!");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (Object obj : paths) {<NEW_LINE>Path path = Paths.get(REPOSITORY_BASE_PATH, obj.toString());<NEW_LINE>Path mpath = newpath.resolve(newFileName == null ? path.getFileName() : Paths.get(".", newFileName).getFileName());<NEW_LINE>Files.copy(path, mpath, StandardCopyOption.REPLACE_EXISTING);<NEW_LINE>}<NEW_LINE>return success(params);<NEW_LINE>} catch (IOException e) {<NEW_LINE>LOG.error("copy:" + <MASK><NEW_LINE>return error(e.getMessage());<NEW_LINE>}<NEW_LINE>}
e.getMessage(), e);
195,758
static void BuildLexStatesTable() {<NEW_LINE>Iterator<TokenProduction> it = rexprlist.iterator();<NEW_LINE>TokenProduction tp;<NEW_LINE>int i;<NEW_LINE>String[] tmpLexStateName = new String[lexstate_I2S.size()];<NEW_LINE>while (it.hasNext()) {<NEW_LINE>tp = it.next();<NEW_LINE>List<RegExprSpec> respecs = tp.respecs;<NEW_LINE>List<TokenProduction> tps;<NEW_LINE>for (i = 0; i < tp.lexStates.length; i++) {<NEW_LINE>if ((tps = (List) allTpsForState.get(tp.lexStates[i])) == null) {<NEW_LINE>tmpLexStateName[maxLexStates++<MASK><NEW_LINE>allTpsForState.put(tp.lexStates[i], tps = new ArrayList());<NEW_LINE>}<NEW_LINE>tps.add(tp);<NEW_LINE>}<NEW_LINE>if (respecs == null || respecs.size() == 0)<NEW_LINE>continue;<NEW_LINE>RegularExpression re;<NEW_LINE>for (i = 0; i < respecs.size(); i++) if (maxOrdinal <= (re = ((RegExprSpec) respecs.get(i)).rexp).ordinal)<NEW_LINE>maxOrdinal = re.ordinal + 1;<NEW_LINE>}<NEW_LINE>kinds = new int[maxOrdinal];<NEW_LINE>toSkip = new long[maxOrdinal / 64 + 1];<NEW_LINE>toSpecial = new long[maxOrdinal / 64 + 1];<NEW_LINE>toMore = new long[maxOrdinal / 64 + 1];<NEW_LINE>toToken = new long[maxOrdinal / 64 + 1];<NEW_LINE>toToken[0] = 1L;<NEW_LINE>actions = new Action[maxOrdinal];<NEW_LINE>actions[0] = actForEof;<NEW_LINE>hasTokenActions = actForEof != null;<NEW_LINE>initStates = new Hashtable();<NEW_LINE>canMatchAnyChar = new int[maxLexStates];<NEW_LINE>canLoop = new boolean[maxLexStates];<NEW_LINE>stateHasActions = new boolean[maxLexStates];<NEW_LINE>lexStateName = new String[maxLexStates];<NEW_LINE>singlesToSkip = new NfaState[maxLexStates];<NEW_LINE>System.arraycopy(tmpLexStateName, 0, lexStateName, 0, maxLexStates);<NEW_LINE>for (i = 0; i < maxLexStates; i++) canMatchAnyChar[i] = -1;<NEW_LINE>hasNfa = new boolean[maxLexStates];<NEW_LINE>mixed = new boolean[maxLexStates];<NEW_LINE>maxLongsReqd = new int[maxLexStates];<NEW_LINE>initMatch = new int[maxLexStates];<NEW_LINE>newLexState = new String[maxOrdinal];<NEW_LINE>newLexState[0] = nextStateForEof;<NEW_LINE>hasEmptyMatch = false;<NEW_LINE>lexStates = new int[maxOrdinal];<NEW_LINE>ignoreCase = new boolean[maxOrdinal];<NEW_LINE>rexprs = new RegularExpression[maxOrdinal];<NEW_LINE>RStringLiteral.allImages = new String[maxOrdinal];<NEW_LINE>canReachOnMore = new boolean[maxLexStates];<NEW_LINE>}
] = tp.lexStates[i];
343,031
public static CanaryDistributionStrategy toProperties(D2CanaryDistributionStrategy config) {<NEW_LINE>Map<String, Object> percentageStrategyProperties = new HashMap<>();<NEW_LINE>Map<String, Object> targetHostsStrategyProperties = new HashMap<>();<NEW_LINE>Map<String, Object> targetApplicationsStrategyProperties = new HashMap<>();<NEW_LINE>String strategyName;<NEW_LINE>switch(config.getStrategy()) {<NEW_LINE>case PERCENTAGE:<NEW_LINE>strategyName = STRATEGY_NAME_PERCENTAGE;<NEW_LINE>if (config.hasPercentageStrategyProperties()) {<NEW_LINE>percentageStrategyProperties.put(PropertyKeys.PERCENTAGE_SCOPE, config.getPercentageStrategyProperties().getScope());<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case TARGET_HOSTS:<NEW_LINE>strategyName = STRATEGY_NAME_TARGET_HOSTS;<NEW_LINE>if (config.hasTargetHostsStrategyProperties()) {<NEW_LINE>targetHostsStrategyProperties.put(PropertyKeys.TARGET_HOSTS, config.getTargetHostsStrategyProperties().getTargetHosts());<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case TARGET_APPLICATIONS:<NEW_LINE>strategyName = STRATEGY_NAME_TARGET_APPLICATIONS;<NEW_LINE>if (config.hasTargetApplicationsStrategyProperties()) {<NEW_LINE><MASK><NEW_LINE>targetApplicationsStrategyProperties.put(PropertyKeys.TARGET_APPLICATIONS, configTargetApplicationProperties.getTargetApplications());<NEW_LINE>targetApplicationsStrategyProperties.put(PropertyKeys.PERCENTAGE_SCOPE, configTargetApplicationProperties.getScope());<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case DISABLED:<NEW_LINE>strategyName = STRATEGY_NAME_DISABLED;<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new IllegalStateException("Unexpected value: " + config.getStrategy());<NEW_LINE>}<NEW_LINE>return new CanaryDistributionStrategy(strategyName, percentageStrategyProperties, targetHostsStrategyProperties, targetApplicationsStrategyProperties);<NEW_LINE>}
TargetApplicationsStrategyProperties configTargetApplicationProperties = config.getTargetApplicationsStrategyProperties();
432,895
public String importDate(String inputDate) {<NEW_LINE>String patDate = "(" + dt + "|TODAY)(\\[(" + String.format(pat, 4, "y") + "?" + String.format(pat, 2, "M") + "?" + String.format(pat, 2, "d") + "?" + ")\\])?";<NEW_LINE>try {<NEW_LINE>if (!Strings.isNullOrEmpty(inputDate) && inputDate.matches(patDate)) {<NEW_LINE>List<String> dates = Arrays.asList(inputDate.split("\\["));<NEW_LINE>inputDate = dates.get(0).equals("TODAY") ? Beans.get(AppBaseService.class).getTodayDate(Optional.ofNullable(AuthUtils.getUser()).map(User::getActiveCompany).orElse(null)).toString() : dates.get(0);<NEW_LINE>if (dates.size() > 1) {<NEW_LINE>LocalDateTime localDate = LocalDate.parse(inputDate, DateTimeFormatter.ISO_DATE).atStartOfDay();<NEW_LINE>Matcher matcher = Pattern.compile(String.format(pat, 4, "y")).matcher(dates.get(1));<NEW_LINE>if (matcher.find())<NEW_LINE>localDate = updateYear(localDate, matcher.group());<NEW_LINE>matcher = Pattern.compile(String.format(pat, 2, "M")).matcher(dates.get(1));<NEW_LINE>if (matcher.find())<NEW_LINE>localDate = updateMonth(localDate, matcher.group());<NEW_LINE>matcher = Pattern.compile(String.format(pat, 2, "d")).matcher(dates.get(1));<NEW_LINE>if (matcher.find())<NEW_LINE>localDate = updateDay(<MASK><NEW_LINE>return localDate.toString();<NEW_LINE>} else<NEW_LINE>return inputDate;<NEW_LINE>} else<NEW_LINE>return null;<NEW_LINE>} catch (Exception e) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}
localDate, matcher.group());
55,522
private PreviewPreset readXML(Document document) {<NEW_LINE>// For retrieving property class if it is not in the xml (old serialization)<NEW_LINE>DefaultPreset // For retrieving property class if it is not in the xml (old serialization)<NEW_LINE>defaultPreset = new DefaultPreset();<NEW_LINE>Element presetE = document.getDocumentElement();<NEW_LINE>Map<String, Object> propertiesMap = new HashMap<>();<NEW_LINE>String presetName = presetE.getAttribute("name");<NEW_LINE>NodeList propertyList = presetE.getElementsByTagName("previewproperty");<NEW_LINE>for (int i = 0; i < propertyList.getLength(); i++) {<NEW_LINE>Node n = propertyList.item(i);<NEW_LINE>if (n.getNodeType() == Node.ELEMENT_NODE) {<NEW_LINE>Element propertyE = (Element) n;<NEW_LINE>String name = propertyE.getAttribute("name");<NEW_LINE>String valueClassName = propertyE.hasAttribute(name) ? propertyE.getAttribute("class") : null;<NEW_LINE>String stringValue = propertyE.getTextContent();<NEW_LINE>Class valueClass = null;<NEW_LINE>if (valueClassName != null) {<NEW_LINE>try {<NEW_LINE>valueClass = Class.forName(valueClassName);<NEW_LINE>} catch (ClassNotFoundException ex) {<NEW_LINE>Exceptions.printStackTrace(ex);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>Object defaultValue = defaultPreset.getProperties().get(name);<NEW_LINE>if (defaultValue != null) {<NEW_LINE>valueClass = defaultValue.getClass();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (valueClass != null) {<NEW_LINE>Object value = PreviewProperties.readValueFromText(stringValue, valueClass);<NEW_LINE>if (value != null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new PreviewPreset(presetName, propertiesMap);<NEW_LINE>}
propertiesMap.put(name, value);
713,086
public Tuple3<Params, Iterable<String>, Iterable<Row>> serializeModel(BaseVectorSummary modelData) {<NEW_LINE>double[] maxData;<NEW_LINE>double[] minData;<NEW_LINE>if (modelData.max() instanceof DenseVector) {<NEW_LINE>maxData = ((DenseVector) modelData.max()).getData();<NEW_LINE>} else {<NEW_LINE>maxData = ((SparseVector) modelData.max()).toDenseVector().getData();<NEW_LINE>}<NEW_LINE>if (modelData.min() instanceof DenseVector) {<NEW_LINE>minData = ((DenseVector) modelData.min()).getData();<NEW_LINE>} else {<NEW_LINE>minData = ((SparseVector) modelData.min()).toDenseVector().getData();<NEW_LINE>}<NEW_LINE>double[] maxAbs = new double[maxData.length];<NEW_LINE>for (int i = 0; i < maxAbs.length; i++) {<NEW_LINE>maxAbs[i] = Math.max(Math.abs(minData[i]), Math.abs(maxData[i]));<NEW_LINE>}<NEW_LINE>List<String> data = new ArrayList<>();<NEW_LINE>data.add(JsonConverter.toJson(maxAbs));<NEW_LINE>return Tuple3.of(new Params(), data<MASK><NEW_LINE>}
, new ArrayList<>());
1,506,883
private Mono<Response<JobStreamListResultInner>> listByJobWithResponseAsync(String resourceGroupName, String automationAccountName, UUID jobId, 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 (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (automationAccountName == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (jobId == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter jobId is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String apiVersion = "2019-06-01";<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.listByJob(this.client.getEndpoint(), resourceGroupName, automationAccountName, jobId, this.client.getSubscriptionId(), apiVersion, accept, context);<NEW_LINE>}
error(new IllegalArgumentException("Parameter automationAccountName is required and cannot be null."));
1,090,821
private void rewriteMethodBody(MutableClass mutableClass, MethodNode callingMethod) {<NEW_LINE>ListIterator<AbstractInsnNode> instructions = callingMethod.instructions.iterator();<NEW_LINE>while (instructions.hasNext()) {<NEW_LINE>AbstractInsnNode node = instructions.next();<NEW_LINE>switch(node.getOpcode()) {<NEW_LINE>case Opcodes.NEW:<NEW_LINE>TypeInsnNode newInsnNode = (TypeInsnNode) node;<NEW_LINE>newInsnNode.desc = mutableClass.config.mappedTypeName(newInsnNode.desc);<NEW_LINE>break;<NEW_LINE>case Opcodes.GETFIELD:<NEW_LINE>case Opcodes.GETSTATIC:<NEW_LINE>case Opcodes.INVOKEINTERFACE:<NEW_LINE>case Opcodes.INVOKEVIRTUAL:<NEW_LINE>MethodInsnNode targetMethod = (MethodInsnNode) node;<NEW_LINE>targetMethod.desc = mutableClass.config.remapParams(targetMethod.desc);<NEW_LINE>if (isGregorianCalendarBooleanConstructor(targetMethod)) {<NEW_LINE>replaceGregorianCalendarBooleanConstructor(instructions, targetMethod);<NEW_LINE>} else if (mutableClass.config.shouldIntercept(targetMethod)) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case Opcodes.INVOKEDYNAMIC:
interceptInvokeVirtualMethod(mutableClass, instructions, targetMethod);
695,155
public MigrationPlanDto generateMigrationPlan(MigrationPlanGenerationDto generationDto) {<NEW_LINE>RuntimeService runtimeService = processEngine.getRuntimeService();<NEW_LINE>String sourceProcessDefinitionId = generationDto.getSourceProcessDefinitionId();<NEW_LINE>String targetProcessDefinitionId = generationDto.getTargetProcessDefinitionId();<NEW_LINE>try {<NEW_LINE>MigrationInstructionsBuilder instructionsBuilder = runtimeService.createMigrationPlan(sourceProcessDefinitionId, targetProcessDefinitionId).mapEqualActivities();<NEW_LINE>if (generationDto.isUpdateEventTriggers()) {<NEW_LINE>instructionsBuilder = instructionsBuilder.updateEventTriggers();<NEW_LINE>}<NEW_LINE>Map<String, VariableValueDto<MASK><NEW_LINE>if (variableDtos != null) {<NEW_LINE>instructionsBuilder.setVariables(toMap(variableDtos, processEngine, objectMapper));<NEW_LINE>}<NEW_LINE>MigrationPlan migrationPlan = instructionsBuilder.build();<NEW_LINE>return MigrationPlanDto.from(migrationPlan);<NEW_LINE>} catch (BadUserRequestException e) {<NEW_LINE>throw new InvalidRequestException(Status.BAD_REQUEST, e, e.getMessage());<NEW_LINE>}<NEW_LINE>}
> variableDtos = generationDto.getVariables();
1,669,196
private void compareField(IBaseParameters theDiff, EncodeContextPath theSourceEncodePath, String theSourcePath, String theTargetPath, IBase theOldField, IBase theNewField, BaseRuntimeChildDefinition theChildDef) {<NEW_LINE>String elementName = theChildDef.getElementName();<NEW_LINE>boolean repeatable = theChildDef.getMax() != 1;<NEW_LINE>theSourceEncodePath.pushPath(elementName, false);<NEW_LINE>if (pathIsIgnored(theSourceEncodePath)) {<NEW_LINE>theSourceEncodePath.popPath();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<? extends IBase> sourceValues = theChildDef.getAccessor().getValues(theOldField);<NEW_LINE>List<? extends IBase> targetValues = theChildDef.getAccessor().getValues(theNewField);<NEW_LINE>int sourceIndex = 0;<NEW_LINE>int targetIndex = 0;<NEW_LINE>while (sourceIndex < sourceValues.size() && targetIndex < targetValues.size()) {<NEW_LINE>IBase sourceChildField = sourceValues.get(sourceIndex);<NEW_LINE>// not expected to happen, but just in case<NEW_LINE>Validate.notNull(sourceChildField);<NEW_LINE>BaseRuntimeElementDefinition<?> def = myContext.getElementDefinition(sourceChildField.getClass());<NEW_LINE>IBase targetChildField = targetValues.get(targetIndex);<NEW_LINE>// not expected to happen, but just in case<NEW_LINE>Validate.notNull(targetChildField);<NEW_LINE>String sourcePath = theSourcePath + "." + elementName + (repeatable ? "[" + sourceIndex + "]" : "");<NEW_LINE>String targetPath = theSourcePath + "." + elementName + (repeatable ? "[" + targetIndex + "]" : "");<NEW_LINE>compare(theDiff, theSourceEncodePath, def, sourcePath, targetPath, sourceChildField, targetChildField);<NEW_LINE>sourceIndex++;<NEW_LINE>targetIndex++;<NEW_LINE>}<NEW_LINE>// Find newly inserted items<NEW_LINE>while (targetIndex < targetValues.size()) {<NEW_LINE>String path = theTargetPath + "." + elementName;<NEW_LINE>addInsertItems(theDiff, <MASK><NEW_LINE>targetIndex++;<NEW_LINE>}<NEW_LINE>// Find deleted items<NEW_LINE>while (sourceIndex < sourceValues.size()) {<NEW_LINE>IBase operation = ParametersUtil.addParameterToParameters(myContext, theDiff, "operation");<NEW_LINE>ParametersUtil.addPartCode(myContext, operation, "type", "delete");<NEW_LINE>ParametersUtil.addPartString(myContext, operation, "path", theTargetPath + "." + elementName + (repeatable ? "[" + targetIndex + "]" : ""));<NEW_LINE>sourceIndex++;<NEW_LINE>targetIndex++;<NEW_LINE>}<NEW_LINE>theSourceEncodePath.popPath();<NEW_LINE>}
targetValues, targetIndex, path, theChildDef);
909,279
public final int sendSSL(ContentFactory request, EbicsBank bank) throws AxelorException, IOException {<NEW_LINE>String url = bank.getUrl();<NEW_LINE>X509Certificate certificate = EbicsCertificateService.getBankCertificate(bank, EbicsCertificateRepository.TYPE_SSL);<NEW_LINE>DefaultHttpClient client = getSecuredHttpClient(certificate, url);<NEW_LINE>String proxyConfiguration = AppSettings.get().get("http.proxy.host");<NEW_LINE>if (proxyConfiguration != null && !proxyConfiguration.equals("")) {<NEW_LINE>setProxy(client);<NEW_LINE>}<NEW_LINE>InputStream input = request.getContent();<NEW_LINE>int retCode = -1;<NEW_LINE>log.debug("Bank url: {}", url);<NEW_LINE>HttpPost post = new HttpPost(url);<NEW_LINE>ContentType type = ContentType.TEXT_XML;<NEW_LINE>HttpEntity entity = new InputStreamEntity(input, retCode, type);<NEW_LINE>post.setEntity(entity);<NEW_LINE>try {<NEW_LINE>HttpResponse responseHttp = client.execute(post);<NEW_LINE>retCode = responseHttp.getStatusLine().getStatusCode();<NEW_LINE>log.debug("Http reason phrase: {}", responseHttp.getStatusLine().getReasonPhrase());<NEW_LINE>response = new InputStreamContentFactory(responseHttp.<MASK><NEW_LINE>} catch (IOException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>throw new AxelorException(e.getCause(), TraceBackRepository.CATEGORY_MISSING_FIELD, I18n.get("Connection error: %s"), e.getMessage());<NEW_LINE>}<NEW_LINE>return retCode;<NEW_LINE>}
getEntity().getContent());
34,356
private byte[] asBytes(Object arg) {<NEW_LINE>// bytes like object -> use directly<NEW_LINE>if (arg instanceof PBytesLike) {<NEW_LINE>return toBytes((PBytesLike) arg);<NEW_LINE>}<NEW_LINE>// try calling __bytes__<NEW_LINE>Object attribute = lookupAttribute(arg, __BYTES__);<NEW_LINE>if (attribute != PNone.NO_VALUE) {<NEW_LINE>Object bytesResult = call(attribute, arg);<NEW_LINE>if (!(bytesResult instanceof PBytes)) {<NEW_LINE>throw raiseNode.raise(TypeError, ErrorMessages.RETURNED_NONBYTES, __BYTES__, arg);<NEW_LINE>}<NEW_LINE>return toBytes((PBytes) bytesResult);<NEW_LINE>}<NEW_LINE>// otherwise: use the buffer protocol<NEW_LINE>byte<MASK><NEW_LINE>if (result == null) {<NEW_LINE>throw raiseNode.raise(TypeError, ErrorMessages.B_REQUIRES_BYTES_OR_OBJ_THAT_IMPLEMENTS_S_NOT_P, __BYTES__, arg);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
[] result = byteBufferAsBytesOrNull(arg);
777,852
private BinaryEntry readBinary(IndexInput meta) throws IOException {<NEW_LINE>final BinaryEntry entry = new BinaryEntry();<NEW_LINE>entry.dataOffset = meta.readLong();<NEW_LINE>entry<MASK><NEW_LINE>entry.docsWithFieldOffset = meta.readLong();<NEW_LINE>entry.docsWithFieldLength = meta.readLong();<NEW_LINE>entry.jumpTableEntryCount = meta.readShort();<NEW_LINE>entry.denseRankPower = meta.readByte();<NEW_LINE>entry.numDocsWithField = meta.readInt();<NEW_LINE>entry.minLength = meta.readInt();<NEW_LINE>entry.maxLength = meta.readInt();<NEW_LINE>if (entry.minLength < entry.maxLength) {<NEW_LINE>entry.addressesOffset = meta.readLong();<NEW_LINE>// Old count of uncompressed addresses<NEW_LINE>long numAddresses = entry.numDocsWithField + 1L;<NEW_LINE>final int blockShift = meta.readVInt();<NEW_LINE>entry.addressesMeta = DirectMonotonicReader.loadMeta(meta, numAddresses, blockShift);<NEW_LINE>entry.addressesLength = meta.readLong();<NEW_LINE>}<NEW_LINE>return entry;<NEW_LINE>}
.dataLength = meta.readLong();
551,494
private void decodeQrCodeImage(Uri inputFile) {<NEW_LINE>Bitmap bitmap;<NEW_LINE>try {<NEW_LINE>BitmapFactory.Options bmOptions = new BitmapFactory.Options();<NEW_LINE>try (InputStream inputStream = getContentResolver().openInputStream(inputFile)) {<NEW_LINE>bitmap = BitmapFactory.decodeStream(inputStream, null, bmOptions);<NEW_LINE>bitmap = BitmapHelper.resize(bitmap, QrCodeAnalyzer.RESOLUTION.getWidth(), QrCodeAnalyzer.RESOLUTION.getHeight());<NEW_LINE>}<NEW_LINE>int[] intArray = new int[bitmap.getWidth() * bitmap.getHeight()];<NEW_LINE>bitmap.getPixels(intArray, 0, bitmap.getWidth(), 0, 0, bitmap.getWidth(), bitmap.getHeight());<NEW_LINE>LuminanceSource source = new RGBLuminanceSource(bitmap.getWidth(), bitmap.getHeight(), intArray);<NEW_LINE>BinaryBitmap binaryBitmap = new BinaryBitmap(new HybridBinarizer(source));<NEW_LINE>Reader reader = new QRCodeReader();<NEW_LINE>Result result = reader.decode(binaryBitmap);<NEW_LINE>GoogleAuthInfo info = GoogleAuthInfo.<MASK><NEW_LINE>VaultEntry entry = new VaultEntry(info);<NEW_LINE>startEditEntryActivityForNew(CODE_ADD_ENTRY, entry);<NEW_LINE>} catch (NotFoundException | IOException | ChecksumException | FormatException | GoogleAuthInfoException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>Dialogs.showErrorDialog(this, R.string.unable_to_read_qrcode, e);<NEW_LINE>}<NEW_LINE>}
parseUri(result.getText());
1,706,324
private static void mul(float[] mata, float[] matb) {<NEW_LINE>float v00 = mata[M00] * matb[M00] + mata[M01] * matb[M10] + mata[M02] * matb[M20];<NEW_LINE>float v01 = mata[M00] * matb[M01] + mata[M01] * matb[M11] + mata[M02] * matb[M21];<NEW_LINE>float v02 = mata[M00] * matb[M02] + mata[M01] * matb[M12] + mata<MASK><NEW_LINE>float v10 = mata[M10] * matb[M00] + mata[M11] * matb[M10] + mata[M12] * matb[M20];<NEW_LINE>float v11 = mata[M10] * matb[M01] + mata[M11] * matb[M11] + mata[M12] * matb[M21];<NEW_LINE>float v12 = mata[M10] * matb[M02] + mata[M11] * matb[M12] + mata[M12] * matb[M22];<NEW_LINE>float v20 = mata[M20] * matb[M00] + mata[M21] * matb[M10] + mata[M22] * matb[M20];<NEW_LINE>float v21 = mata[M20] * matb[M01] + mata[M21] * matb[M11] + mata[M22] * matb[M21];<NEW_LINE>float v22 = mata[M20] * matb[M02] + mata[M21] * matb[M12] + mata[M22] * matb[M22];<NEW_LINE>mata[M00] = v00;<NEW_LINE>mata[M10] = v10;<NEW_LINE>mata[M20] = v20;<NEW_LINE>mata[M01] = v01;<NEW_LINE>mata[M11] = v11;<NEW_LINE>mata[M21] = v21;<NEW_LINE>mata[M02] = v02;<NEW_LINE>mata[M12] = v12;<NEW_LINE>mata[M22] = v22;<NEW_LINE>}
[M02] * matb[M22];
484,995
private DataGeneratorSpec buildDataGeneratorSpec(Schema schema, List<String> columns, HashMap<String, DataType> dataTypes, HashMap<String, FieldType> fieldTypes, HashMap<String, TimeUnit> timeUnits, HashMap<String, Integer> cardinality, HashMap<String, IntRange> range, HashMap<String, Map<String, Object>> pattern, Map<String, Double> mvCountMap, Map<String, Integer> lengthMap) {<NEW_LINE>for (final FieldSpec fs : schema.getAllFieldSpecs()) {<NEW_LINE>String col = fs.getName();<NEW_LINE>columns.add(col);<NEW_LINE>dataTypes.put(col, fs.getDataType());<NEW_LINE>fieldTypes.put(col, fs.getFieldType());<NEW_LINE>switch(fs.getFieldType()) {<NEW_LINE>case DIMENSION:<NEW_LINE>if (cardinality.get(col) == null) {<NEW_LINE>cardinality.put(col, 1000);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case METRIC:<NEW_LINE>if (!range.containsKey(col)) {<NEW_LINE>range.put(col, new IntRange(1, 1000));<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case TIME:<NEW_LINE>if (!range.containsKey(col)) {<NEW_LINE>range.put(col, new IntRange(1, 1000));<NEW_LINE>}<NEW_LINE>TimeFieldSpec tfs = (TimeFieldSpec) fs;<NEW_LINE>timeUnits.put(col, tfs.getIncomingGranularitySpec().getTimeType());<NEW_LINE>break;<NEW_LINE>// forward compatibility with pattern generator<NEW_LINE>case DATE_TIME:<NEW_LINE>case COMPLEX:<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new RuntimeException("Invalid field type.");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new DataGeneratorSpec(columns, cardinality, range, pattern, mvCountMap, lengthMap, dataTypes, fieldTypes, timeUnits, <MASK><NEW_LINE>}
FileFormat.AVRO, _outDir, _overwrite);
1,334,223
public boolean isEnabled() {<NEW_LINE>Log.info(thisClass, "isEnabled", "testRunMode: " + testRunMode);<NEW_LINE>Log.info(thisClass, "isEnabled", "complexId: " + complexId);<NEW_LINE>Log.info(thisClass, <MASK><NEW_LINE>// allow if mode matches or mode not set<NEW_LINE>if (testRunMode != null && (TestModeFilter.FRAMEWORK_TEST_MODE != testRunMode)) {<NEW_LINE>Log.info(thisClass, "isEnabled", "Skipping action '" + toString() + "' because the test mode " + testRunMode + " is not valid for current mode " + TestModeFilter.FRAMEWORK_TEST_MODE);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>OperatingSystem currentOS = null;<NEW_LINE>try {<NEW_LINE>currentOS = Machine.getLocalMachine().getOperatingSystem();<NEW_LINE>} catch (Exception e) {<NEW_LINE>Log.info(thisClass, "isEnabled", "Encountered and exception trying to determine OS type - assume we'll need to run: " + e.getMessage());<NEW_LINE>}<NEW_LINE>Log.info(thisClass, "isEnabled", "OS: " + currentOS.toString());<NEW_LINE>if (OperatingSystem.WINDOWS == currentOS && notAllowedOnWindows) {<NEW_LINE>Log.info(thisClass, "isEnabled", "Skipping action '" + toString() + "' because the tests are disabled on Windows");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
"isEnabled", "Overall test mode: " + TestModeFilter.FRAMEWORK_TEST_MODE);
224,921
private void tunnelSucceeded(EndPoint endPoint) {<NEW_LINE>try {<NEW_LINE>HttpDestination destination = (HttpDestination) context.get(HttpClientTransport.HTTP_DESTINATION_CONTEXT_KEY);<NEW_LINE>ClientConnectionFactory connectionFactory = this.connectionFactory;<NEW_LINE>if (destination.isSecure()) {<NEW_LINE>// Don't want to do DNS resolution here.<NEW_LINE>InetSocketAddress address = InetSocketAddress.createUnresolved(destination.getHost(<MASK><NEW_LINE>context.put(ClientConnector.REMOTE_SOCKET_ADDRESS_CONTEXT_KEY, address);<NEW_LINE>connectionFactory = destination.newSslClientConnectionFactory(null, connectionFactory);<NEW_LINE>}<NEW_LINE>var oldConnection = endPoint.getConnection();<NEW_LINE>var newConnection = connectionFactory.newConnection(endPoint, context);<NEW_LINE>endPoint.upgrade(newConnection);<NEW_LINE>if (LOG.isDebugEnabled())<NEW_LINE>LOG.debug("HTTP tunnel established: {} over {}", oldConnection, newConnection);<NEW_LINE>} catch (Throwable x) {<NEW_LINE>tunnelFailed(endPoint, x);<NEW_LINE>}<NEW_LINE>}
), destination.getPort());
439,153
public void parseLayoutFileDirect(final String fileName) {<NEW_LINE>handleAndroidResourceFiles(fileName, /* classes, */<NEW_LINE>null, new IResourceHandler() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void handleResourceFile(final String fileName, Set<String> fileNameFilter, InputStream stream) {<NEW_LINE>// We only process valid layout XML files<NEW_LINE>if (!fileName.startsWith("res/layout") && !fileName.startsWith("res/navigation"))<NEW_LINE>return;<NEW_LINE>if (!fileName.endsWith(".xml")) {<NEW_LINE>logger.warn(String<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Initialize the Soot classes<NEW_LINE>scViewGroup = Scene.v().getSootClassUnsafe("android.view.ViewGroup");<NEW_LINE>scView = Scene.v().getSootClassUnsafe("android.view.View");<NEW_LINE>scWebView = Scene.v().getSootClassUnsafe("android.webkit.WebView");<NEW_LINE>// Get the fully-qualified class name<NEW_LINE>String entryClass = fileName.substring(0, fileName.lastIndexOf("."));<NEW_LINE>if (!packageName.isEmpty())<NEW_LINE>entryClass = packageName + "." + entryClass;<NEW_LINE>// We are dealing with resource files<NEW_LINE>if (fileNameFilter != null) {<NEW_LINE>boolean found = false;<NEW_LINE>for (String s : fileNameFilter) if (s.equalsIgnoreCase(entryClass)) {<NEW_LINE>found = true;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (!found)<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>AXmlHandler handler = new AXmlHandler(stream, new AXML20Parser());<NEW_LINE>parseLayoutNode(fileName, handler.getDocument().getRootNode());<NEW_LINE>} catch (Exception ex) {<NEW_LINE>logger.error("Could not read binary XML file: " + ex.getMessage(), ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
.format("Skipping file %s in layout folder...", fileName));
356,289
private void appendLocationText(boolean selected, Color bgColor, boolean isProblemFile, String containerText) {<NEW_LINE>SimpleTextAttributes locationAttrs = SimpleTextAttributes.GRAYED_ATTRIBUTES;<NEW_LINE>if (isProblemFile) {<NEW_LINE>SimpleTextAttributes wavedAttributes = SimpleTextAttributes.merge(new SimpleTextAttributes(SimpleTextAttributes.STYLE_WAVED, UIUtil.getInactiveTextColor(), JBColor.RED), locationAttrs);<NEW_LINE>java.util.regex.Matcher <MASK><NEW_LINE>if (matcher.matches()) {<NEW_LINE>String prefix = matcher.group(1);<NEW_LINE>SpeedSearchUtil.appendColoredFragmentForMatcher(" " + ObjectUtils.notNull(prefix, ""), this, locationAttrs, myMatchers.locationMatcher, bgColor, selected);<NEW_LINE>String strippedContainerText = matcher.group(2);<NEW_LINE>SpeedSearchUtil.appendColoredFragmentForMatcher(ObjectUtils.notNull(strippedContainerText, ""), this, wavedAttributes, myMatchers.locationMatcher, bgColor, selected);<NEW_LINE>String suffix = matcher.group(3);<NEW_LINE>if (suffix != null) {<NEW_LINE>SpeedSearchUtil.appendColoredFragmentForMatcher(suffix, this, locationAttrs, myMatchers.locationMatcher, bgColor, selected);<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>locationAttrs = wavedAttributes;<NEW_LINE>}<NEW_LINE>SpeedSearchUtil.appendColoredFragmentForMatcher(" " + containerText, this, locationAttrs, myMatchers.locationMatcher, bgColor, selected);<NEW_LINE>}
matcher = CONTAINER_PATTERN.matcher(containerText);
1,616,880
public Object generateCell(com.vaadin.v7.ui.Table source, Object itemId, Object columnId) {<NEW_LINE>Property property = source.getItem(itemId).getItemProperty(columnId);<NEW_LINE><MASK><NEW_LINE>if (value == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>String stringValue = value.toString();<NEW_LINE>if (columnId instanceof MetaPropertyPath) {<NEW_LINE>MetaProperty metaProperty = ((MetaPropertyPath) columnId).getMetaProperty();<NEW_LINE>if (DynamicAttributesUtils.isDynamicAttribute(metaProperty)) {<NEW_LINE>stringValue = dynamicAttributesTools.getDynamicAttributeValueAsString(metaProperty, value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String cellValue = stringValue;<NEW_LINE>boolean isMultiLineCell = StringUtils.contains(stringValue, "\n");<NEW_LINE>if (isMultiLineCell) {<NEW_LINE>cellValue = StringUtils.replaceChars(cellValue, '\n', ' ');<NEW_LINE>}<NEW_LINE>int maxTextLength = column.getMaxTextLength();<NEW_LINE>if (stringValue.length() > maxTextLength + MAX_TEXT_LENGTH_GAP || isMultiLineCell) {<NEW_LINE>return StringUtils.abbreviate(cellValue, maxTextLength);<NEW_LINE>} else {<NEW_LINE>return cellValue;<NEW_LINE>}<NEW_LINE>}
Object value = property.getValue();
1,448,418
public void preprocessOpenAPI(OpenAPI openAPI) {<NEW_LINE>if (additionalProperties.containsKey(NPM_NAME)) {<NEW_LINE>// If no npmVersion is provided in additional properties, version from API specification is used.<NEW_LINE>// If none of them is provided then fallbacks to default version<NEW_LINE>if (additionalProperties.containsKey(NPM_VERSION)) {<NEW_LINE>this.setNpmVersion(additionalProperties.get<MASK><NEW_LINE>} else if (openAPI.getInfo() != null && openAPI.getInfo().getVersion() != null) {<NEW_LINE>this.setNpmVersion(openAPI.getInfo().getVersion());<NEW_LINE>}<NEW_LINE>if (additionalProperties.containsKey(SNAPSHOT) && Boolean.parseBoolean(additionalProperties.get(SNAPSHOT).toString())) {<NEW_LINE>if (npmVersion.toUpperCase(Locale.ROOT).matches("^.*-SNAPSHOT$")) {<NEW_LINE>this.setNpmVersion(npmVersion + "." + SNAPSHOT_SUFFIX_FORMAT.get().format(new Date()));<NEW_LINE>} else {<NEW_LINE>this.setNpmVersion(npmVersion + "-SNAPSHOT." + SNAPSHOT_SUFFIX_FORMAT.get().format(new Date()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>additionalProperties.put(NPM_VERSION, npmVersion);<NEW_LINE>}<NEW_LINE>}
(NPM_VERSION).toString());
1,487,275
public <A, B> double dependence(NumberArrayAdapter<?, A> adapter1, A data1, NumberArrayAdapter<?, B> adapter2, B data2) {<NEW_LINE>final int n = Utils.size(<MASK><NEW_LINE>assert (n > 4) : "Hoeffdings D needs at least 5 elements!";<NEW_LINE>if (n <= 4) {<NEW_LINE>return Double.NaN;<NEW_LINE>}<NEW_LINE>double[] r = Utils.ranks(adapter1, data1, n);<NEW_LINE>double[] s = Utils.ranks(adapter2, data2, n);<NEW_LINE>// TODO: is it possible to exploit sorting to accelerate computing q?<NEW_LINE>double[] q = computeBivariateRanks(adapter1, data1, adapter2, data2, n);<NEW_LINE>double d1 = 0, d2 = 0, d3 = 0;<NEW_LINE>for (int i = 0; i < n; i++) {<NEW_LINE>// Note: our q is 0-indexed.<NEW_LINE>d1 += q[i] * (q[i] - 1);<NEW_LINE>d2 += (r[i] - 1) * (r[i] - 2) * (s[i] - 1) * (s[i] - 2);<NEW_LINE>d3 += (r[i] - 2) * (s[i] - 2) * q[i];<NEW_LINE>}<NEW_LINE>// Factor n-2 was moved for better numerical behavior.<NEW_LINE>double nom = (n - 3.) * d1 + d2 / (n - 2) - 2. * d3;<NEW_LINE>double div = n * (n - 1.) * (n - 3.) * (n - 4.);<NEW_LINE>double d = 30 * nom / div;<NEW_LINE>return d < 1. ? d : 1.;<NEW_LINE>}
adapter1, data1, adapter2, data2);
753,317
final DescribeBudgetActionHistoriesResult executeDescribeBudgetActionHistories(DescribeBudgetActionHistoriesRequest describeBudgetActionHistoriesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeBudgetActionHistoriesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeBudgetActionHistoriesRequest> request = null;<NEW_LINE>Response<DescribeBudgetActionHistoriesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeBudgetActionHistoriesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeBudgetActionHistoriesRequest));<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, "Budgets");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeBudgetActionHistories");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeBudgetActionHistoriesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeBudgetActionHistoriesResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
343,561
protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>binding = DataBindingUtil.setContentView(<MASK><NEW_LINE>// create dummy item<NEW_LINE>NewsItem item = new NewsItem();<NEW_LINE>item.setHtml("<p>Interdum et malesuada <b>some bold text in here</b> fames ac ante ipsum primis in faucibus.</p>");<NEW_LINE>// in XML we declared a variable newsItem, data binding generated the set method<NEW_LINE>// once set, all fields/values/views are updated accordingly<NEW_LINE>binding.setNewsItem(item);<NEW_LINE>// if you have set an android:id in XML, data binding do the 'findViewById()'<NEW_LINE>DrawTableLinkSpan drawTableLinkSpan = new DrawTableLinkSpan();<NEW_LINE>drawTableLinkSpan.setTableLinkText("[tap for table]");<NEW_LINE>binding.htmlText.setDrawTableLinkSpan(drawTableLinkSpan);<NEW_LINE>}
this, R.layout.activity_data_binding_example);
846,823
private <T> Optional<T> internalGet(byte[] key, Function<byte[], T> trieRetriever, Function<byte[], T> cacheTransformer) {<NEW_LINE>ByteArrayWrapper wrapper = new ByteArrayWrapper(key);<NEW_LINE>ByteArrayWrapper accountWrapper = getAccountWrapper(wrapper);<NEW_LINE>Map<ByteArrayWrapper, byte[]> accountItems = cache.get(accountWrapper);<NEW_LINE>boolean isDeletedAccount = deleteRecursiveLog.contains(accountWrapper);<NEW_LINE>if (accountItems == null || !accountItems.containsKey(wrapper)) {<NEW_LINE>if (isDeletedAccount) {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>// uncached account<NEW_LINE>return Optional.ofNullable<MASK><NEW_LINE>}<NEW_LINE>byte[] cacheItem = accountItems.get(wrapper);<NEW_LINE>if (cacheItem == null) {<NEW_LINE>// deleted account key<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>// cached account key<NEW_LINE>return Optional.ofNullable(cacheTransformer.apply(cacheItem));<NEW_LINE>}
(trieRetriever.apply(key));
957,197
public static Integer[] sequence(final Integer from, final Integer to, final Integer step) {<NEW_LINE>Validate.notNull(from, "Value to start the sequence from cannot be null");<NEW_LINE>Validate.notNull(to, "Value to generate the sequence up to cannot be null");<NEW_LINE>Validate.notNull(step, "Step to generate the sequence cannot be null");<NEW_LINE>final int iFrom = from.intValue();<NEW_LINE>final int iTo = to.intValue();<NEW_LINE>final int iStep = step.intValue();<NEW_LINE>if (iFrom == iTo) {<NEW_LINE>return new Integer[] { Integer.valueOf(iFrom) };<NEW_LINE>}<NEW_LINE>if (iStep == 0) {<NEW_LINE>// with iStep == 0, this would only be valid if iFrom == iTo, which it isn't - the rest are impossible<NEW_LINE>throw new IllegalArgumentException("Cannot create sequence from " + iFrom + " to " + iTo + " with step " + iStep);<NEW_LINE>}<NEW_LINE>final List<Integer> values = new ArrayList<Integer>(10);<NEW_LINE>if (iFrom < iTo && iStep > 0) {<NEW_LINE>int i = iFrom;<NEW_LINE>while (i <= iTo) {<NEW_LINE>values.add(Integer.valueOf(i));<NEW_LINE>i += iStep;<NEW_LINE>}<NEW_LINE>} else if (iFrom > iTo && iStep < 0) {<NEW_LINE>// iFrom > iTo<NEW_LINE>int i = iFrom;<NEW_LINE>while (i >= iTo) {<NEW_LINE>values.add<MASK><NEW_LINE>i += iStep;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return values.toArray(new Integer[values.size()]);<NEW_LINE>}
(Integer.valueOf(i));
1,352,110
final ListPlatformApplicationsResult executeListPlatformApplications(ListPlatformApplicationsRequest listPlatformApplicationsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listPlatformApplicationsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListPlatformApplicationsRequest> request = null;<NEW_LINE>Response<ListPlatformApplicationsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListPlatformApplicationsRequestMarshaller().marshall(super.beforeMarshalling(listPlatformApplicationsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "SNS");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListPlatformApplications");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<ListPlatformApplicationsResult> responseHandler = new StaxResponseHandler<ListPlatformApplicationsResult>(new ListPlatformApplicationsResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
244,205
private void adjustHeight(Vector3f loc, float radius, float height) {<NEW_LINE>// offset it by radius because in the loop we iterate through 2 radii<NEW_LINE>int radiusStepsX = (int) (radius / terrain.getLocalScale().x);<NEW_LINE>int radiusStepsZ = (int) (radius / terrain.getLocalScale().z);<NEW_LINE>float xStepAmount = terrain.getLocalScale().x;<NEW_LINE>float zStepAmount = terrain.getLocalScale().z;<NEW_LINE>long start = System.currentTimeMillis();<NEW_LINE>List<Vector2f> locs = new ArrayList<>();<NEW_LINE>List<Float> heights = new ArrayList<>();<NEW_LINE>for (int z = -radiusStepsZ; z < radiusStepsZ; z++) {<NEW_LINE>for (int x = -radiusStepsX; x < radiusStepsX; x++) {<NEW_LINE>float locX = loc.x + (x * xStepAmount);<NEW_LINE>float locZ = loc.z + (z * zStepAmount);<NEW_LINE>if (isInRadius(locX - loc.x, locZ - loc.z, radius)) {<NEW_LINE>// see if it is in the radius of the tool<NEW_LINE>float h = calculateHeight(radius, height, locX - loc.x, locZ - loc.z);<NEW_LINE>locs.add(<MASK><NEW_LINE>heights.add(h);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>terrain.adjustHeight(locs, heights);<NEW_LINE>// System.out.println("Modified "+locs.size()+" points, took: " + (System.currentTimeMillis() - start)+" ms");<NEW_LINE>terrain.updateModelBound();<NEW_LINE>}
new Vector2f(locX, locZ));
1,564,340
public ExecutableDdlJob toDdlJob(ExecutionContext ec) {<NEW_LINE>TableGroupConfig broadcastTg = OptimizerContext.getContext(schema).getTableGroupInfoManager().getBroadcastTableGroupConfig();<NEW_LINE>if (broadcastTg == null || CollectionUtils.isEmpty(broadcastTg.getPartitionGroupRecords())) {<NEW_LINE>return new TransientDdlJob();<NEW_LINE>}<NEW_LINE>// get partition-groups<NEW_LINE>List<String> <MASK><NEW_LINE>Map<String, GroupDetailInfoRecord> groupMap = PolicyUtils.getGroupDetails(schema);<NEW_LINE>for (PartitionGroupRecord pg : GeneralUtil.emptyIfNull(broadcastTg.getPartitionGroupRecords())) {<NEW_LINE>String groupName = GroupInfoUtil.buildGroupNameFromPhysicalDb(pg.getPhy_db());<NEW_LINE>GroupDetailInfoRecord group = groupMap.get(groupName);<NEW_LINE>if (storageInstList.contains(group.getStorageInstId())) {<NEW_LINE>removedPgList.add(pg.getPartition_name());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (CollectionUtils.isEmpty(removedPgList)) {<NEW_LINE>return new TransientDdlJob();<NEW_LINE>}<NEW_LINE>// drop partition-groups<NEW_LINE>String tgName = TStringUtil.backQuote(broadcastTg.getTableGroupRecord().getTg_name());<NEW_LINE>String partitions = removedPgList.stream().map(TStringUtil::backQuote).collect(Collectors.joining(","));<NEW_LINE>String sqlDropPartition = String.format("ALTER TABLEGROUP %s DROP PARTITION %s", tgName, partitions);<NEW_LINE>ExecutableDdlJob job = ActionUtils.convertToDDLJob(ec, schema, sqlDropPartition);<NEW_LINE>return job;<NEW_LINE>}
removedPgList = new ArrayList<>();
274,298
public boolean onCreateOptionsMenu(final Menu menu) {<NEW_LINE>final RedditAccount user = RedditAccountManager.getInstance(this).getDefaultAccount();<NEW_LINE>final SubredditSubscriptionState subredditSubscriptionState;<NEW_LINE>final RedditSubredditSubscriptionManager subredditSubscriptionManager = <MASK><NEW_LINE>if (fragment != null && controller.isRandomSubreddit() && fragment.getSubreddit() != null) {<NEW_LINE>SubredditPostListURL url = SubredditPostListURL.parse(controller.getUri());<NEW_LINE>if (url != null && url.type == SubredditPostListURL.Type.RANDOM) {<NEW_LINE>try {<NEW_LINE>final String newSubreddit = RedditSubreddit.stripRPrefix(fragment.getSubreddit().url);<NEW_LINE>url = url.changeSubreddit(newSubreddit);<NEW_LINE>controller = new PostListingController(url, this);<NEW_LINE>} catch (final InvalidSubredditNameException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!user.isAnonymous() && (controller.isSubreddit() || controller.isRandomSubreddit()) && subredditSubscriptionManager.areSubscriptionsReady() && fragment != null && fragment.getSubreddit() != null) {<NEW_LINE>subredditSubscriptionState = subredditSubscriptionManager.getSubscriptionState(controller.subredditCanonicalName());<NEW_LINE>} else {<NEW_LINE>subredditSubscriptionState = null;<NEW_LINE>}<NEW_LINE>final String subredditDescription = fragment != null && fragment.getSubreddit() != null ? fragment.getSubreddit().description_html : null;<NEW_LINE>Boolean subredditPinState = null;<NEW_LINE>Boolean subredditBlockedState = null;<NEW_LINE>if ((controller.isSubreddit() || controller.isRandomSubreddit()) && fragment != null && fragment.getSubreddit() != null) {<NEW_LINE>try {<NEW_LINE>subredditPinState = PrefsUtility.pref_pinned_subreddits_check(fragment.getSubreddit().getCanonicalId());<NEW_LINE>subredditBlockedState = PrefsUtility.pref_blocked_subreddits_check(fragment.getSubreddit().getCanonicalId());<NEW_LINE>} catch (final InvalidSubredditNameException e) {<NEW_LINE>subredditPinState = null;<NEW_LINE>subredditBlockedState = null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>OptionsMenuUtility.prepare(this, menu, false, true, false, controller.isSearchResults(), controller.isUserPostListing(), false, controller.isSortable(), true, controller.isFrontPage(), subredditSubscriptionState, subredditDescription != null && !subredditDescription.isEmpty(), false, subredditPinState, subredditBlockedState);<NEW_LINE>return true;<NEW_LINE>}
RedditSubredditSubscriptionManager.getSingleton(this, user);
12,043
private void runAssertionInsertConsume(RegressionEnvironment env) {<NEW_LINE>RegressionPath path = new RegressionPath();<NEW_LINE>env.compileDeploy("@public create window MyVDW.test:vdw() as SupportBean", path);<NEW_LINE>SupportVirtualDW window = (SupportVirtualDW) getFromContext(env, "/virtualdw/MyVDW");<NEW_LINE>SupportBean supportBean = new SupportBean("S1", 100);<NEW_LINE>window.setData(Collections.singleton(supportBean));<NEW_LINE>env.compileDeploy("insert into MyVDW select * from SupportBean", path);<NEW_LINE>// test straight consume<NEW_LINE>env.compileDeploy("@name('s0') select irstream * from MyVDW", path).addListener("s0");<NEW_LINE>env.sendEventBean(new SupportBean("E1", 200));<NEW_LINE>env.assertListener("s0", listener -> {<NEW_LINE>assertNull(listener.getLastOldData());<NEW_LINE>String[] fieldsOne = "theString,intPrimitive".split(",");<NEW_LINE>EPAssertionUtil.assertProps(listener.getAndResetLastNewData()[0], fieldsOne, new Object[] { "E1", 200 });<NEW_LINE>});<NEW_LINE>env.undeployModuleContaining("s0");<NEW_LINE>// test aggregated consumer - wherein the virtual data window does not return an iterator that prefills the aggregation state<NEW_LINE>String[] <MASK><NEW_LINE>env.compileDeploy("@name('s0') select sum(intPrimitive) as val0 from MyVDW", path).addListener("s0");<NEW_LINE>env.sendEventBean(new SupportBean("E1", 100));<NEW_LINE>env.assertPropsNew("s0", fieldsTwo, new Object[] { 200 });<NEW_LINE>env.sendEventBean(new SupportBean("E1", 50));<NEW_LINE>env.assertPropsNew("s0", fieldsTwo, new Object[] { 250 });<NEW_LINE>env.undeployAll();<NEW_LINE>}
fieldsTwo = "val0".split(",");
1,162,364
private String createTopComponentPersistentID(TopComponent tc, String preferredID) throws IOException {<NEW_LINE>String compName = preferredID != null ? preferredID : null;<NEW_LINE>// be prepared for null names, empty names and convert to filesystem friendly name<NEW_LINE>if ((compName == null) || (compName.length() == 0)) {<NEW_LINE>compName = DEFAULT_TC_NAME;<NEW_LINE>}<NEW_LINE>// Check if component id is not already present in cache of invalid ids<NEW_LINE>boolean isUsed = true;<NEW_LINE>String origName = compName;<NEW_LINE>compName = escape(compName);<NEW_LINE>String srcName = compName;<NEW_LINE>int i = 1;<NEW_LINE>synchronized (LOCK_IDS) {<NEW_LINE>while (isUsed) {<NEW_LINE>isUsed = false;<NEW_LINE>String uniqueName = // NOI18N<NEW_LINE>FileUtil.// NOI18N<NEW_LINE>findFreeFileName(// NOI18N<NEW_LINE>getComponentsLocalFolder(), // NOI18N<NEW_LINE>srcName, "settings");<NEW_LINE>if (!srcName.equals(uniqueName) || globalIDSet.contains(uniqueName.toUpperCase(Locale.ENGLISH))) {<NEW_LINE>isUsed = true;<NEW_LINE>// #44293 - proper escaping to keep name synced with InstanceDataObject naming<NEW_LINE>srcName = <MASK><NEW_LINE>i++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>topComponent2IDMap.put(tc, srcName);<NEW_LINE>id2TopComponentMap.put(srcName, new PersistenceManager.TopComponentReference(tc, srcName));<NEW_LINE>globalIDSet.add(srcName.toUpperCase(Locale.ENGLISH));<NEW_LINE>if (persistenceType(tc) == TopComponent.PERSISTENCE_ONLY_OPENED) {<NEW_LINE>topComponentPersistentOnlyOpenedID.add(srcName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return srcName;<NEW_LINE>}
escape(origName + "_" + i);
602,766
private void handle(final GetVmConsoleAddressFromHostMsg msg) {<NEW_LINE>final GetVmConsoleAddressFromHostReply reply = new GetVmConsoleAddressFromHostReply();<NEW_LINE>GetVncPortCmd cmd = new GetVncPortCmd();<NEW_LINE>cmd.setVmUuid(msg.getVmInstanceUuid());<NEW_LINE>new Http<>(getConsolePortPath, cmd, GetVncPortResponse.class).call(new ReturnValueCompletion<GetVncPortResponse>(msg) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void success(GetVncPortResponse ret) {<NEW_LINE>if (!ret.isSuccess()) {<NEW_LINE>reply.setError(operr("operation error, because:%s", ret.getError()));<NEW_LINE>} else {<NEW_LINE>reply.setHostIp(self.getManagementIp());<NEW_LINE>reply.setProtocol(ret.getProtocol());<NEW_LINE>reply.<MASK><NEW_LINE>VdiPortInfo vdiPortInfo = new VdiPortInfo();<NEW_LINE>if (ret.getVncPort() != null) {<NEW_LINE>vdiPortInfo.setVncPort(ret.getVncPort());<NEW_LINE>}<NEW_LINE>if (ret.getSpicePort() != null) {<NEW_LINE>vdiPortInfo.setSpicePort(ret.getSpicePort());<NEW_LINE>}<NEW_LINE>if (ret.getSpiceTlsPort() != null) {<NEW_LINE>vdiPortInfo.setSpiceTlsPort(ret.getSpiceTlsPort());<NEW_LINE>}<NEW_LINE>reply.setVdiPortInfo(vdiPortInfo);<NEW_LINE>}<NEW_LINE>bus.reply(msg, reply);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void fail(ErrorCode errorCode) {<NEW_LINE>reply.setError(errorCode);<NEW_LINE>bus.reply(msg, reply);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
setPort(ret.getPort());
782,249
private static void showUsage() {<NEW_LINE>StringBuilder builder = new StringBuilder();<NEW_LINE>String SEPARATOR = "---------------------------------------------------------------------------------------------------";<NEW_LINE>builder.append("JarScan [flags] --mode=<mode> [options] [params] <jars and class folders>").append(S_NEWLINE);<NEW_LINE>builder.append(SEPARATOR).append(S_NEWLINE);<NEW_LINE>builder.append("Flags:").append(S_NEWLINE);<NEW_LINE>builder.append(" --verbose Log progress information to stderr").append(S_NEWLINE);<NEW_LINE>builder.append(SEPARATOR).append(S_NEWLINE);<NEW_LINE>builder.append("Options:").append(S_NEWLINE);<NEW_LINE>builder.append(" --packages=a,b,c Only include methods from named packages. E.g. --packages=java.util.*").append(S_NEWLINE);<NEW_LINE>builder.append(SEPARATOR).append(S_NEWLINE);<NEW_LINE>builder.append("Modes:").append(S_NEWLINE);<NEW_LINE>builder.append(SEPARATOR).append(S_NEWLINE);<NEW_LINE>builder.append(" maxMethodSize List every method with bytecode larger than specified limit.").append(S_NEWLINE);<NEW_LINE>builder.append(" --limit=n Report methods larger than n bytes.").append(S_NEWLINE);<NEW_LINE>builder.append(SEPARATOR).append(S_NEWLINE);<NEW_LINE>builder.append(" sequenceCount Count instruction sequences.").append(S_NEWLINE);<NEW_LINE>builder.append(" --length=n Report sequences of length n.").append(S_NEWLINE);<NEW_LINE>builder.append(SEPARATOR).append(S_NEWLINE);<NEW_LINE>builder.append(" invokeCount Count the most called methods for each invoke instruction.").append(S_NEWLINE);<NEW_LINE>builder.append(" [--limit=n] Limit to top n results per invoke type.").append(S_NEWLINE);<NEW_LINE>builder.append(SEPARATOR).append(S_NEWLINE);<NEW_LINE>builder.append(" nextInstructionFreq List the most popular next instruction for each bytecode instruction.").append(S_NEWLINE);<NEW_LINE>builder.append(" [--limit=n] Limit to top n results per instruction.").append(S_NEWLINE);<NEW_LINE>builder.append(SEPARATOR).append(S_NEWLINE);<NEW_LINE>builder.append(" allocationCount Count the most allocated types.").append(S_NEWLINE);<NEW_LINE>builder.append(" [--limit=n] Limit to top n results.").append(S_NEWLINE);<NEW_LINE>builder.append(SEPARATOR).append(S_NEWLINE);<NEW_LINE>builder.append(" instructionCount Count occurences of each bytecode instruction.").append(S_NEWLINE);<NEW_LINE>builder.append<MASK><NEW_LINE>builder.append(SEPARATOR).append(S_NEWLINE);<NEW_LINE>builder.append(" sequenceSearch List methods containing the specified bytecode sequence.").append(S_NEWLINE);<NEW_LINE>builder.append(" --sequence=a,b,c,... Comma separated sequence of bytecode instructions.").append(S_NEWLINE);<NEW_LINE>builder.append(SEPARATOR).append(S_NEWLINE);<NEW_LINE>builder.append(" methodSizeHisto List frequencies of method bytecode sizes.").append(S_NEWLINE);<NEW_LINE>builder.append(SEPARATOR).append(S_NEWLINE);<NEW_LINE>builder.append(" methodLength List methods of the given bytecode size.").append(S_NEWLINE);<NEW_LINE>builder.append(" --length=n Size of methods to find.").append(S_NEWLINE);<NEW_LINE>builder.append(SEPARATOR).append(S_NEWLINE);<NEW_LINE>System.err.println(builder.toString());<NEW_LINE>}
(" [--limit=n] Limit to top n results.").append(S_NEWLINE);
1,814,685
// invalidateIt<NEW_LINE>@Override<NEW_LINE>public String prepareIt() {<NEW_LINE>ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_PREPARE);<NEW_LINE>MPeriod.testPeriodOpen(getCtx(), getDateAcct(), getC_DocTypeTarget_ID(), getAD_Org_ID());<NEW_LINE>// Lines<NEW_LINE>final MInvoiceLine[] lines = getLines(true);<NEW_LINE>if (lines.length == 0) {<NEW_LINE>throw new AdempiereException("@NoLines@");<NEW_LINE>}<NEW_LINE>// No Cash Book<NEW_LINE>final PaymentRule paymentRule = <MASK><NEW_LINE>if (paymentRule.isCash() && MCashBook.get(getCtx(), getAD_Org_ID(), getC_Currency_ID()) == null) {<NEW_LINE>throw new AdempiereException("@NoCashBook@");<NEW_LINE>}<NEW_LINE>// Convert/Check DocType<NEW_LINE>if (getC_DocType_ID() != getC_DocTypeTarget_ID()) {<NEW_LINE>setC_DocType_ID(getC_DocTypeTarget_ID());<NEW_LINE>}<NEW_LINE>if (getC_DocType_ID() <= 0) {<NEW_LINE>throw new AdempiereException("No Document Type");<NEW_LINE>}<NEW_LINE>// explodeBOM(); // task 09030: we don't really want to explode the BOM, least of all this uncontrolled way after invoice-candidates-way.<NEW_LINE>if (// setTotals<NEW_LINE>!calculateTaxTotal()) {<NEW_LINE>throw new AdempiereException("Error calculating Tax");<NEW_LINE>}<NEW_LINE>createPaySchedule();<NEW_LINE>// Credit Status<NEW_LINE>if (isSOTrx() && !isReversal()) {<NEW_LINE>// task FRESH-152<NEW_LINE>final IBPartnerStatsDAO bpartnerStatsDAO = Services.get(IBPartnerStatsDAO.class);<NEW_LINE>final BPartnerStats stats = bpartnerStatsDAO.getCreateBPartnerStats(getC_BPartner_ID());<NEW_LINE>if (!X_C_BPartner_Stats.SOCREDITSTATUS_NoCreditCheck.equals(stats.getSOCreditStatus())) {<NEW_LINE>final BPartnerCreditLimitRepository creditLimitRepo = Adempiere.getBean(BPartnerCreditLimitRepository.class);<NEW_LINE>final BigDecimal creditLimit = creditLimitRepo.retrieveCreditLimitByBPartnerId(getC_BPartner_ID(), getDateInvoiced());<NEW_LINE>if (Services.get(IBPartnerStatsBL.class).isCreditStopSales(stats, getGrandTotal(true), getDateInvoiced())) {<NEW_LINE>throw new AdempiereException("@BPartnerCreditStop@ - @SO_CreditUsed@=" + stats.getSOCreditUsed() + ", @SO_CreditLimit@=" + creditLimit);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Landed Costs<NEW_LINE>if (!isSOTrx()) {<NEW_LINE>for (final MInvoiceLine line : lines) {<NEW_LINE>final String error = line.allocateLandedCosts();<NEW_LINE>if (error != null && error.length() > 0) {<NEW_LINE>throw new AdempiereException(error);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_PREPARE);<NEW_LINE>// Add up Amounts<NEW_LINE>m_justPrepared = true;<NEW_LINE>if (!DOCACTION_Complete.equals(getDocAction())) {<NEW_LINE>setDocAction(DOCACTION_Complete);<NEW_LINE>}<NEW_LINE>return IDocument.STATUS_InProgress;<NEW_LINE>}
PaymentRule.ofCode(getPaymentRule());
547,998
public void onFailure(okhttp3.Call call, final IOException e) {<NEW_LINE>String exceptionClass = e != null ? e.getClass().getCanonicalName() : "null";<NEW_LINE>String exceptionMessage = e != null ? e.getMessage() : "null";<NEW_LINE>AppLog.w(AppLog.T.API, "Network call failure trying to upload Gravatar!" + exceptionMessage);<NEW_LINE>// Don't track exceptions caused by poor internet connectivity<NEW_LINE>if (!(e instanceof java.net.UnknownHostException)) {<NEW_LINE>Map<String, Object> properties = new HashMap<>();<NEW_LINE><MASK><NEW_LINE>properties.put("network_exception_message", exceptionMessage);<NEW_LINE>AnalyticsTracker.track(AnalyticsTracker.Stat.ME_GRAVATAR_UPLOAD_EXCEPTION, properties);<NEW_LINE>}<NEW_LINE>new Handler(Looper.getMainLooper()).post(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>gravatarUploadListener.onError();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
properties.put("network_exception_class", exceptionClass);
1,625,548
public boolean validate(Connection connection, int validateAction) {<NEW_LINE>long startTime = System.currentTimeMillis();<NEW_LINE>boolean isValid = false;<NEW_LINE>String transactionName = "";<NEW_LINE>try {<NEW_LINE>PoolConfiguration poolConfig = getPoolProperties();<NEW_LINE>DataSourceIdentity dataSourceId = poolConfig instanceof DalExtendedPoolConfiguration ? ((DalExtendedPoolConfiguration) poolConfig).getDataSourceId() : null;<NEW_LINE>String connUrl = ConnectionUtils.getConnectionUrl(connection, poolConfig.getUrl());<NEW_LINE>transactionName = String.format(CONNECTION_VALIDATE_CONNECTION_FORMAT, connUrl);<NEW_LINE>tryValidateClusterConnection(connection, validateAction);<NEW_LINE>isValid = validateConnection(connection, validateAction);<NEW_LINE>LOGGER.logTransaction(DalLogTypes.DAL_DATASOURCE, transactionName, String.format(IS_VALID_FORMAT, isValid) + " Connection url: " + poolConfig.getUrl(), LogUtils<MASK><NEW_LINE>if (!isValid) {<NEW_LINE>LOGGER.warn(IS_VALID_RETURN_INFO);<NEW_LINE>}<NEW_LINE>} catch (InvalidConnectionException e) {<NEW_LINE>handleException(isValid, e, transactionName, startTime);<NEW_LINE>throw e;<NEW_LINE>} catch (Throwable t) {<NEW_LINE>handleException(isValid, t, transactionName, startTime);<NEW_LINE>}<NEW_LINE>return isValid;<NEW_LINE>}
.buildPropertiesFromDataSourceId(dataSourceId), startTime);
1,039,507
private void init() {<NEW_LINE>exceptionUnmarshallers.add(new InvalidRequestExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers<MASK><NEW_LINE>exceptionUnmarshallers.add(new JobStatusExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new NoSuchPublicAccessBlockConfigurationExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new InternalServiceExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new BucketAlreadyExistsExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new NotFoundExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new TooManyTagsExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new IdempotencyExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new BucketAlreadyOwnedByYouExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new TooManyRequestsExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new BadRequestExceptionUnmarshaller());<NEW_LINE>exceptionUnmarshallers.add(new StandardErrorUnmarshaller(com.amazonaws.services.s3control.model.AWSS3ControlException.class));<NEW_LINE>setServiceNameIntern(DEFAULT_SIGNING_NAME);<NEW_LINE>setEndpointPrefix(ENDPOINT_PREFIX);<NEW_LINE>// calling this.setEndPoint(...) will also modify the signer accordingly<NEW_LINE>this.setEndpoint("s3-control.us-east-1.amazonaws.com");<NEW_LINE>HandlerChainFactory chainFactory = new HandlerChainFactory();<NEW_LINE>requestHandler2s.addAll(chainFactory.newRequestHandlerChain("/com/amazonaws/services/s3control/request.handlers"));<NEW_LINE>requestHandler2s.addAll(chainFactory.newRequestHandler2Chain("/com/amazonaws/services/s3control/request.handler2s"));<NEW_LINE>requestHandler2s.addAll(chainFactory.getGlobalHandlers());<NEW_LINE>}
.add(new InvalidNextTokenExceptionUnmarshaller());
1,403,940
public static Map<String, Port> combinePorts(List<KubernetesPortBuildItem> ports, PlatformConfiguration config) {<NEW_LINE>Map<String, Port> allPorts = new HashMap<>();<NEW_LINE>allPorts.putAll(verifyPorts(ports).entrySet().stream().map(e -> new PortBuilder().withName(e.getKey()).withContainerPort(e.getValue()).build()).collect(Collectors.toMap(Port::<MASK><NEW_LINE>config.getPorts().entrySet().forEach(e -> {<NEW_LINE>String name = e.getKey();<NEW_LINE>Port configuredPort = PortConverter.convert(e);<NEW_LINE>Port buildItemPort = allPorts.get(name);<NEW_LINE>Port combinedPort = buildItemPort == null ? configuredPort : new PortBuilder().withName(name).withHostPort(configuredPort.getHostPort() != null && configuredPort.getHostPort() != 0 ? configuredPort.getHostPort() : buildItemPort.getHostPort()).withContainerPort(configuredPort.getContainerPort() != null && configuredPort.getContainerPort() != 0 ? configuredPort.getContainerPort() : buildItemPort.getContainerPort()).withPath(Strings.isNotNullOrEmpty(configuredPort.getPath()) ? configuredPort.getPath() : buildItemPort.getPath()).build();<NEW_LINE>allPorts.put(name, combinedPort);<NEW_LINE>});<NEW_LINE>return allPorts;<NEW_LINE>}
getName, p -> p)));
1,189,472
public PrimitiveVS<Machine> allocateMachine(Guard pc, Class<? extends Machine> machineType, Function<Integer, ? extends Machine> constructor) {<NEW_LINE>if (!machineCounters.containsKey(machineType)) {<NEW_LINE>machineCounters.put(machineType, new PrimitiveVS<>(0));<NEW_LINE>}<NEW_LINE>PrimitiveVS<Integer> guardedCount = machineCounters.get(machineType).restrict(pc);<NEW_LINE>PrimitiveVS<Machine> allocated;<NEW_LINE>if (schedule.hasMachine(machineType, guardedCount, pc)) {<NEW_LINE>assert (iter != 0);<NEW_LINE>allocated = schedule.getMachine(machineType, guardedCount).restrict(pc);<NEW_LINE>assert (allocated.getValues().size() == 1);<NEW_LINE>TraceLogger.onCreateMachine(pc, allocated.getValues().iterator().next());<NEW_LINE>allocated.getValues().iterator().next().setScheduler(this);<NEW_LINE>machines.add(allocated.getValues().iterator().next());<NEW_LINE>} else {<NEW_LINE>Machine newMachine;<NEW_LINE>newMachine = constructor.apply(IntegerVS.maxValue(guardedCount));<NEW_LINE>if (!machines.contains(newMachine)) {<NEW_LINE>machines.add(newMachine);<NEW_LINE>}<NEW_LINE>TraceLogger.onCreateMachine(pc, newMachine);<NEW_LINE>newMachine.setScheduler(this);<NEW_LINE>if (useBagSemantics()) {<NEW_LINE>newMachine.setSemantics(EventBufferSemantics.bag);<NEW_LINE>}<NEW_LINE>if (useReceiverSemantics()) {<NEW_LINE>newMachine.setSemantics(EventBufferSemantics.receiver);<NEW_LINE>}<NEW_LINE>schedule.makeMachine(newMachine, pc);<NEW_LINE>getVcManager().addMachine(pc, newMachine);<NEW_LINE>allocated = new PrimitiveVS<>(newMachine).restrict(pc);<NEW_LINE>}<NEW_LINE>guardedCount = <MASK><NEW_LINE>PrimitiveVS<Integer> mergedCount = machineCounters.get(machineType).updateUnderGuard(pc, guardedCount);<NEW_LINE>machineCounters.put(machineType, mergedCount);<NEW_LINE>return allocated;<NEW_LINE>}
IntegerVS.add(guardedCount, 1);
1,562,796
public MapIterationEventDetails unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>MapIterationEventDetails mapIterationEventDetails = new MapIterationEventDetails();<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("name", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>mapIterationEventDetails.setName(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("index", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>mapIterationEventDetails.setIndex(context.getUnmarshaller(Integer.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 mapIterationEventDetails;<NEW_LINE>}
class).unmarshall(context));
479,352
protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>setTheme(UserPreferences.getTheme());<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>getSupportActionBar().setDisplayShowHomeEnabled(true);<NEW_LINE>setContentView(R.layout.bug_report);<NEW_LINE>String stacktrace = "No crash report recorded";<NEW_LINE>try {<NEW_LINE>File crashFile = CrashReportWriter.getFile();<NEW_LINE>if (crashFile.exists()) {<NEW_LINE>stacktrace = IOUtils.toString(new FileInputStream(crashFile), Charset.forName("UTF-8"));<NEW_LINE>} else {<NEW_LINE>Log.d(TAG, stacktrace);<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>TextView crashDetailsTextView = findViewById(R.id.crash_report_logs);<NEW_LINE>crashDetailsTextView.setText(CrashReportWriter.getSystemInfo() + "\n\n" + stacktrace);<NEW_LINE>findViewById(R.id.btn_open_bug_tracker).setOnClickListener(v -> IntentUtils.openInBrowser(BugReportActivity.this, "https://github.com/AntennaPod/AntennaPod/issues"));<NEW_LINE>findViewById(R.id.btn_copy_log).setOnClickListener(v -> {<NEW_LINE>ClipboardManager clipboard = (<MASK><NEW_LINE>ClipData clip = ClipData.newPlainText(getString(R.string.bug_report_title), crashDetailsTextView.getText());<NEW_LINE>clipboard.setPrimaryClip(clip);<NEW_LINE>Snackbar.make(findViewById(android.R.id.content), R.string.copied_to_clipboard, Snackbar.LENGTH_SHORT).show();<NEW_LINE>});<NEW_LINE>}
ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);
761,628
private void buildPerformanceTestTab(Tab tab, boolean customCell) {<NEW_LINE>GridPane grid = new GridPane();<NEW_LINE>grid.setPadding(new Insets(5, 5, 5, 5));<NEW_LINE>grid.setHgap(5);<NEW_LINE>grid.setVgap(5);<NEW_LINE>final ObservableList<List<Double>> bigData = FXCollections.observableArrayList();<NEW_LINE>TableView<List<Double>> tableView = new TableView<List<Double>>();<NEW_LINE>tableView.setItems(bigData);<NEW_LINE>tableView.getColumns().addAll(getColumns(customCell));<NEW_LINE>tableView.setLayoutX(30);<NEW_LINE>tableView.setLayoutY(150);<NEW_LINE>tableView.setPrefSize(1100, 300);<NEW_LINE>tableView.setTableMenuButtonVisible(true);<NEW_LINE>getLines(bigData);<NEW_LINE>tableView.setOnMouseReleased(t -> {<NEW_LINE>if (t.getClickCount() == 3) {<NEW_LINE>System.out.println("resetting data...");<NEW_LINE>bigData.clear();<NEW_LINE>getLines(bigData);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>int row = 0;<NEW_LINE>if (customCell) {<NEW_LINE>grid.add(new Label("Note: the CheckBox cells do not persist their state in this demo!" + "\n(This means that if you select checkboxes and scroll, they may not be in the same " + "state once you scroll back."), 0, row++);<NEW_LINE>}<NEW_LINE>grid.getChildren().addAll(tableView);<NEW_LINE>GridPane.setConstraints(tableView, 0, row++);<NEW_LINE>GridPane.setVgrow(tableView, Priority.ALWAYS);<NEW_LINE>GridPane.setHgrow(tableView, Priority.ALWAYS);<NEW_LINE>tab.setContent(grid);<NEW_LINE>}
System.out.println("Done");
1,674,571
public void renderSidesBatched(@Nonnull ItemStack stack, EnergyCubeTier tier, @Nonnull PoseStack matrix, @Nonnull MultiBufferSource renderer, int light, int overlayLight, boolean hasEffect) {<NEW_LINE>Set<RelativeSide> enabledSides;<NEW_LINE>Set<RelativeSide> outputSides;<NEW_LINE>CompoundTag configData = ItemDataUtils.getDataMapIfPresent(stack);<NEW_LINE>if (configData != null && configData.contains(NBTConstants.COMPONENT_CONFIG, Tag.TAG_COMPOUND)) {<NEW_LINE>enabledSides = <MASK><NEW_LINE>outputSides = EnumSet.noneOf(RelativeSide.class);<NEW_LINE>CompoundTag sideConfig = configData.getCompound(NBTConstants.COMPONENT_CONFIG).getCompound(NBTConstants.CONFIG + TransmissionType.ENERGY.ordinal());<NEW_LINE>// TODO: Maybe improve on this, but for now this is a decent way of making it not have disabled sides show<NEW_LINE>for (RelativeSide side : EnumUtils.SIDES) {<NEW_LINE>DataType dataType = DataType.byIndexStatic(sideConfig.getInt(NBTConstants.SIDE + side.ordinal()));<NEW_LINE>if (dataType == DataType.INPUT) {<NEW_LINE>enabledSides.add(side);<NEW_LINE>} else if (dataType == DataType.OUTPUT) {<NEW_LINE>enabledSides.add(side);<NEW_LINE>outputSides.add(side);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>enabledSides = EnumSet.allOf(RelativeSide.class);<NEW_LINE>if (tier == EnergyCubeTier.CREATIVE) {<NEW_LINE>outputSides = EnumSet.allOf(RelativeSide.class);<NEW_LINE>} else {<NEW_LINE>outputSides = Collections.singleton(RelativeSide.FRONT);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>renderSidesBatched(matrix, renderer, light, overlayLight, enabledSides, outputSides, hasEffect);<NEW_LINE>}
EnumSet.noneOf(RelativeSide.class);
1,573,806
public void handleRequest(HttpServerExchange exchange) throws Exception {<NEW_LINE>var registry = PluginsRegistryImpl.getInstance();<NEW_LINE>var path = exchange.getRequestPath();<NEW_LINE>var pi = registry.getPipelineInfo(path);<NEW_LINE>var srv = registry.getServices().stream().filter(s -> s.getName().equals(pi.getName<MASK><NEW_LINE>if (srv.isPresent()) {<NEW_LINE>try {<NEW_LINE>srv.get().getInstance().requestInitializer().accept(exchange);<NEW_LINE>srv.get().getInstance().responseInitializer().accept(exchange);<NEW_LINE>} catch (BadRequestException bre) {<NEW_LINE>LOGGER.debug("Error handling the request: {}", bre.getMessage(), bre);<NEW_LINE>exchange.setStatusCode(bre.getStatusCode());<NEW_LINE>exchange.getResponseHeaders().put(Headers.CONTENT_TYPE, Exchange.JSON_MEDIA_TYPE);<NEW_LINE>exchange.getResponseSender().send(BsonUtils.toJson(getErrorDocument(bre.getStatusCode(), bre.getMessage())));<NEW_LINE>return;<NEW_LINE>} catch (Throwable t) {<NEW_LINE>exchange.setStatusCode(HttpStatus.SC_INTERNAL_SERVER_ERROR);<NEW_LINE>throw t;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>next(exchange);<NEW_LINE>}
())).findAny();
1,287,171
void updateCounters() {<NEW_LINE>String counterPrifix = schema.toUpperCase() + "_";<NEW_LINE>long readBytes = 0;<NEW_LINE>long writeBytes = 0;<NEW_LINE>long readOps = 0;<NEW_LINE>long largeReadOps = 0;<NEW_LINE>long writeOps = 0;<NEW_LINE>for (FileSystem.Statistics stat : stats) {<NEW_LINE>readBytes = readBytes + stat.getBytesRead();<NEW_LINE>writeBytes = writeBytes + stat.getBytesWritten();<NEW_LINE>readOps = readOps + stat.getReadOps();<NEW_LINE>largeReadOps = largeReadOps + stat.getLargeReadOps();<NEW_LINE>writeOps = writeOps + stat.getWriteOps();<NEW_LINE>}<NEW_LINE>PSAgentContext.get().getMetrics().put(counterPrifix + AngelCounter.BYTES_READ, Long.toString(readBytes));<NEW_LINE>PSAgentContext.get().getMetrics().put(counterPrifix.toString() + AngelCounter.BYTES_WRITTEN<MASK><NEW_LINE>PSAgentContext.get().getMetrics().put(counterPrifix + AngelCounter.READ_OPS, Long.toString(readOps));<NEW_LINE>PSAgentContext.get().getMetrics().put(counterPrifix + AngelCounter.LARGE_READ_OPS, Long.toString(largeReadOps));<NEW_LINE>PSAgentContext.get().getMetrics().put(counterPrifix + AngelCounter.WRITE_OPS, Long.toString(writeOps));<NEW_LINE>}
, Long.toString(writeBytes));
1,346,112
void processBasicInfo() {<NEW_LINE>prj.name = (String) info.get("project_name");<NEW_LINE>prj.path = (<MASK><NEW_LINE>prj.status = (String) info.get("project_status");<NEW_LINE>prj.parentName = (String) info.get("project_parent_name");<NEW_LINE>prj.displayName = (String) info.get("project_display_name");<NEW_LINE>prj.description = (String) info.get("project_description");<NEW_LINE>prj.group = (String) info.get("project_group");<NEW_LINE>prj.buildDir = (File) info.get("project_buildDir");<NEW_LINE>prj.projectDir = (File) info.get("project_projectDir");<NEW_LINE>prj.rootDir = (File) info.get("project_rootDir");<NEW_LINE>prj.version = (String) info.get("project_version");<NEW_LINE>prj.license = (String) info.get("license");<NEW_LINE>prj.plugins = new TreeSet<>(createSet((Set<String>) info.get("plugins")));<NEW_LINE>Map<String, File> rawSubprojects = (Map<String, File>) info.get("project_subProjects");<NEW_LINE>Map<String, File> refinedSubprojects = (Map<String, File>) info.get("project_subProjects");<NEW_LINE>for (Map.Entry<String, File> entry : rawSubprojects.entrySet()) {<NEW_LINE>refinedSubprojects.put(entry.getKey(), entry.getValue().isAbsolute() ? entry.getValue() : new File(prj.rootDir, entry.getValue().toString()));<NEW_LINE>}<NEW_LINE>prj.subProjects = Collections.unmodifiableMap(refinedSubprojects);<NEW_LINE>prj.includedBuilds = (Map<String, File>) info.get("project_includedBuilds");<NEW_LINE>if (info.containsKey("buildClassPath")) {<NEW_LINE>prj.buildClassPath = (Set<File>) info.get("buildClassPath");<NEW_LINE>}<NEW_LINE>if (info.containsKey("nbprops")) {<NEW_LINE>Map<String, String> props = new HashMap<>((Map<String, String>) info.get("nbprops"));<NEW_LINE>prj.netBeansProperties = Collections.unmodifiableMap(props);<NEW_LINE>}<NEW_LINE>}
String) info.get("project_path");
28,105
private static void validateHaving(ExprNodePropOrStreamSet propertiesGroupedBy, ExprNode havingNode) throws ExprValidationException {<NEW_LINE>List<ExprAggregateNode> aggregateNodesHaving = new LinkedList<ExprAggregateNode>();<NEW_LINE>ExprAggregateNodeUtil.getAggregatesBottomUp(havingNode, aggregateNodesHaving);<NEW_LINE>// Any non-aggregated properties must occur in the group-by clause (if there is one)<NEW_LINE>if (!propertiesGroupedBy.isEmpty()) {<NEW_LINE><MASK><NEW_LINE>havingNode.accept(visitor);<NEW_LINE>List<ExprNodePropOrStreamDesc> allPropertiesHaving = visitor.getRefs();<NEW_LINE>ExprNodePropOrStreamSet aggPropertiesHaving = ExprNodeUtilityAggregation.getAggregatedProperties(aggregateNodesHaving);<NEW_LINE>aggPropertiesHaving.removeFromList(allPropertiesHaving);<NEW_LINE>propertiesGroupedBy.removeFromList(allPropertiesHaving);<NEW_LINE>if (!allPropertiesHaving.isEmpty()) {<NEW_LINE>ExprNodePropOrStreamDesc desc = allPropertiesHaving.iterator().next();<NEW_LINE>throw new ExprValidationException("Non-aggregated " + desc.getTextual() + " in the HAVING clause must occur in the group-by clause");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
ExprNodeIdentifierAndStreamRefVisitor visitor = new ExprNodeIdentifierAndStreamRefVisitor(true);
57,684
public void invoke(@NotNull Project project, @NotNull PsiFile file, @Nullable("is null when called from inspection") Editor editor, @NotNull PsiElement startElement, @NotNull PsiElement endElement) {<NEW_LINE>if (editor == null) {<NEW_LINE>LOG.error("Cannot run quick fix without editor: " + getClass().getSimpleName(), AttachmentFactory.createAttachment(file.getVirtualFile()));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>PsiElement reference = PsiTreeUtil.getNonStrictParentOfType(startElement, GoReferenceExpressionBase.class);<NEW_LINE>PsiElement anchor = reference != null ? findAnchor(reference) : null;<NEW_LINE>if (anchor == null) {<NEW_LINE>LOG.error("Cannot find anchor for " + myWhat + " (GoUnresolvedFixBase), offset: " + editor.getCaretModel().getOffset(), AttachmentFactory.createAttachment(file.getVirtualFile()));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Template template = TemplateSettings.<MASK><NEW_LINE>if (template == null) {<NEW_LINE>LOG.error("Cannot find anchor for " + myWhat + " (GoUnresolvedFixBase), offset: " + editor.getCaretModel().getOffset(), AttachmentFactory.createAttachment(file.getVirtualFile()));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int start = anchor.getTextRange().getStartOffset();<NEW_LINE>editor.getCaretModel().moveToOffset(start);<NEW_LINE>template.setToReformat(true);<NEW_LINE>TemplateManager.getInstance(project).startTemplate(editor, template, true, ContainerUtil.stringMap("NAME", myName), null);<NEW_LINE>}
getInstance().getTemplateById(myTemplateId);
931,912
private void openMessageStartEventSubscriptions(final ProcessMetadata processRecord, final StateWriter stateWriter) {<NEW_LINE>final long processDefinitionKey = processRecord.getKey();<NEW_LINE>final DeployedProcess <MASK><NEW_LINE>final ExecutableProcess process = processDefinition.getProcess();<NEW_LINE>final List<ExecutableStartEvent> startEvents = process.getStartEvents();<NEW_LINE>// if startEvents contain message events<NEW_LINE>for (final ExecutableCatchEventElement startEvent : startEvents) {<NEW_LINE>if (startEvent.isMessage()) {<NEW_LINE>final ExecutableMessage message = startEvent.getMessage();<NEW_LINE>message.getMessageName().map(BufferUtil::wrapString).ifPresent(messageNameBuffer -> {<NEW_LINE>subscriptionRecord.reset();<NEW_LINE>subscriptionRecord.setMessageName(messageNameBuffer).setProcessDefinitionKey(processDefinitionKey).setBpmnProcessId(process.getId()).setStartEventId(startEvent.getId());<NEW_LINE>final var subscriptionKey = keyGenerator.nextKey();<NEW_LINE>stateWriter.appendFollowUpEvent(subscriptionKey, MessageStartEventSubscriptionIntent.CREATED, subscriptionRecord);<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
processDefinition = processState.getProcessByKey(processDefinitionKey);
1,115,394
public ListDetectMitigationActionsExecutionsResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListDetectMitigationActionsExecutionsResult listDetectMitigationActionsExecutionsResult = new ListDetectMitigationActionsExecutionsResult();<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 listDetectMitigationActionsExecutionsResult;<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("actionsExecutions", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listDetectMitigationActionsExecutionsResult.setActionsExecutions(new ListUnmarshaller<DetectMitigationActionExecution>(DetectMitigationActionExecutionJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("nextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listDetectMitigationActionsExecutionsResult.setNextToken(context.getUnmarshaller(String.<MASK><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 listDetectMitigationActionsExecutionsResult;<NEW_LINE>}
class).unmarshall(context));
968,014
final GetLensReviewResult executeGetLensReview(GetLensReviewRequest getLensReviewRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getLensReviewRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<GetLensReviewRequest> request = null;<NEW_LINE>Response<GetLensReviewResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetLensReviewRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getLensReviewRequest));<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, "WellArchitected");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetLensReview");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetLensReviewResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetLensReviewResultJsonUnmarshaller());<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);
621,635
protected JComponent createCenterPanel() {<NEW_LINE>JPanel panel = new JPanel(new GridBagLayout());<NEW_LINE>// First stroke<NEW_LINE>myFirstStrokePanel = new StrokePanel<MASK><NEW_LINE>panel.add(myFirstStrokePanel, new GridBagConstraints(0, 0, 2, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));<NEW_LINE>// Second stroke panel<NEW_LINE>panel.add(myEnableSecondKeystroke, new GridBagConstraints(0, 1, 1, 1, 0, 0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));<NEW_LINE>mySecondStrokePanel = new StrokePanel(KeyMapBundle.message("second.stroke.panel.title"));<NEW_LINE>panel.add(mySecondStrokePanel, new GridBagConstraints(1, 1, 1, 1, 1, 0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));<NEW_LINE>// Shortcut preview<NEW_LINE>JPanel previewPanel = new JPanel(new BorderLayout());<NEW_LINE>previewPanel.setBorder(IdeBorderFactory.createTitledBorder(KeyMapBundle.message("shortcut.preview.ide.border.factory.title"), true));<NEW_LINE>previewPanel.add(myKeystrokePreview);<NEW_LINE>panel.add(previewPanel, new GridBagConstraints(0, 2, 2, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));<NEW_LINE>// Conflicts<NEW_LINE>JPanel conflictsPanel = new JPanel(new BorderLayout());<NEW_LINE>conflictsPanel.setBorder(IdeBorderFactory.createTitledBorder(KeyMapBundle.message("conflicts.ide.border.factory.title"), true));<NEW_LINE>myConflictInfoArea.setEditable(false);<NEW_LINE>myConflictInfoArea.setBackground(panel.getBackground());<NEW_LINE>myConflictInfoArea.setLineWrap(true);<NEW_LINE>myConflictInfoArea.setWrapStyleWord(true);<NEW_LINE>final JScrollPane conflictInfoScroll = ScrollPaneFactory.createScrollPane(myConflictInfoArea);<NEW_LINE>conflictInfoScroll.setPreferredSize(new Dimension(260, 60));<NEW_LINE>conflictInfoScroll.setBorder(null);<NEW_LINE>conflictsPanel.add(conflictInfoScroll);<NEW_LINE>panel.add(conflictsPanel, new GridBagConstraints(0, 3, 2, 1, 1, 1, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));<NEW_LINE>myEnableSecondKeystroke.addActionListener(new ActionListener() {<NEW_LINE><NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>handleSecondKey();<NEW_LINE>updateCurrentKeyStrokeInfo();<NEW_LINE>if (myEnableSecondKeystroke.isSelected()) {<NEW_LINE>IdeFocusManager.getGlobalInstance().doForceFocusWhenFocusSettlesDown(mySecondStrokePanel.getShortcutTextField());<NEW_LINE>} else {<NEW_LINE>IdeFocusManager.getGlobalInstance().doForceFocusWhenFocusSettlesDown(myFirstStrokePanel.getShortcutTextField());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return panel;<NEW_LINE>}
(KeyMapBundle.message("first.stroke.panel.title"));
1,450,878
protected void inject(Target target, InjectionNode node) {<NEW_LINE>if (!this.preInject(node)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (node.isReplaced()) {<NEW_LINE>throw new UnsupportedOperationException("Redirector target failure for " + this.info);<NEW_LINE>}<NEW_LINE>if (node.getCurrentTarget() instanceof MethodInsnNode) {<NEW_LINE>this.checkTargetForNode(target, node, RestrictTargetLevel.ALLOW_ALL);<NEW_LINE>this.injectAtInvoke(target, node);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (node.getCurrentTarget() instanceof FieldInsnNode) {<NEW_LINE>this.checkTargetForNode(target, node, RestrictTargetLevel.ALLOW_ALL);<NEW_LINE>this.injectAtFieldAccess(target, node);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (node.getCurrentTarget() instanceof TypeInsnNode) {<NEW_LINE>int opcode = node.getCurrentTarget().getOpcode();<NEW_LINE>if (opcode == Opcodes.NEW) {<NEW_LINE>if (!this.isStatic && target.isStatic) {<NEW_LINE>throw new InvalidInjectionException(this.info, String.format("non-static callback method %s has a static target which is not supported", this));<NEW_LINE>}<NEW_LINE>this.injectAtConstructor(target, node);<NEW_LINE>return;<NEW_LINE>} else if (opcode == Opcodes.INSTANCEOF) {<NEW_LINE>this.checkTargetModifiers(target, false);<NEW_LINE><MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw new InvalidInjectionException(this.info, String.format("%s annotation on is targetting an invalid insn in %s in %s", this.annotationType, target, this));<NEW_LINE>}
this.injectAtInstanceOf(target, node);
1,576,632
public void onBindViewHolder(@NonNull final GroupsViewHolder holder, int position) {<NEW_LINE>if (position == items.size()) {<NEW_LINE>holder.groupButton.setOnClickListener(view -> {<NEW_LINE>FragmentManager fragmentManager = getFragmentManager();<NEW_LINE>DialogFragment dialogFragment = createAddCategoryDialog();<NEW_LINE>if (fragmentManager != null && dialogFragment != null) {<NEW_LINE>dialogFragment.show(fragmentManager, AddNewFavoriteCategoryBottomSheet.TAG);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} else {<NEW_LINE>holder.groupButton.setOnClickListener(view -> {<NEW_LINE>int previousSelectedPosition = getItemPosition(selectedItemName);<NEW_LINE>selectedItemName = items.get(holder.getAdapterPosition());<NEW_LINE>updateColorSelector(getCategoryColor(selectedItemName));<NEW_LINE>AndroidUiHelper.updateVisibility(addToHiddenGroupInfo, !isCategoryVisible(selectedItemName));<NEW_LINE>notifyItemChanged(holder.getAdapterPosition());<NEW_LINE>notifyItemChanged(previousSelectedPosition);<NEW_LINE>});<NEW_LINE>final String group = items.get(position);<NEW_LINE>holder.groupName.setText(group);<NEW_LINE>holder.pointsCounter.setText(String.valueOf(getCategoryPointsCount(group)));<NEW_LINE>int strokeColor;<NEW_LINE>int strokeWidth;<NEW_LINE>if (selectedItemName != null && selectedItemName.equals(items.get(position))) {<NEW_LINE>strokeColor = ColorUtilities.getActiveColor(app, nightMode);<NEW_LINE>strokeWidth = 2;<NEW_LINE>} else {<NEW_LINE>strokeColor = ContextCompat.getColor(app, nightMode ? R.color.stroked_buttons_and_links_outline_dark : R.color.stroked_buttons_and_links_outline_light);<NEW_LINE>strokeWidth = 1;<NEW_LINE>}<NEW_LINE>GradientDrawable rectContourDrawable = (GradientDrawable) AppCompatResources.getDrawable(app, R.drawable.bg_select_group_button_outline);<NEW_LINE>if (rectContourDrawable != null) {<NEW_LINE>rectContourDrawable.setStroke(AndroidUtils.dpToPx(app, strokeWidth), strokeColor);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>int color;<NEW_LINE>int iconID;<NEW_LINE>if (isCategoryVisible(group)) {<NEW_LINE>int categoryColor = getCategoryColor(group);<NEW_LINE>color = categoryColor == 0 ? getDefaultColor() : categoryColor;<NEW_LINE>iconID = R.drawable.ic_action_folder;<NEW_LINE>holder.groupName.setTypeface(null, Typeface.NORMAL);<NEW_LINE>} else {<NEW_LINE>color = ContextCompat.getColor(app, R.color.text_color_secondary_light);<NEW_LINE>iconID = R.drawable.ic_action_hide;<NEW_LINE>holder.groupName.setTypeface(null, Typeface.ITALIC);<NEW_LINE>}<NEW_LINE>holder.groupIcon.setImageDrawable(UiUtilities.tintDrawable(AppCompatResources.getDrawable(app, iconID), color));<NEW_LINE>}<NEW_LINE>AndroidUtils.setBackground(app, holder.groupButton, nightMode, R.drawable.ripple_solid_light_6dp, R.drawable.ripple_solid_dark_6dp);<NEW_LINE>}
holder.groupButton.setImageDrawable(rectContourDrawable);
1,022,594
private static TaskAction createLinkAction(Context context, long id, String url, String text, PackageManager pm) {<NEW_LINE>Intent itemIntent = new Intent(Intent.ACTION_VIEW);<NEW_LINE>itemIntent.setData(Uri.parse(url));<NEW_LINE>List<ResolveInfo> resolveInfoList = pm.queryIntentActivities(itemIntent, 0);<NEW_LINE>Intent actionIntent;<NEW_LINE>// if options > 1, display open with...<NEW_LINE>if (resolveInfoList.size() > 1) {<NEW_LINE>actionIntent = Intent.createChooser(itemIntent, text);<NEW_LINE>} else // else show app that gets opened<NEW_LINE>if (resolveInfoList.size() == 1) {<NEW_LINE>actionIntent = itemIntent;<NEW_LINE>} else<NEW_LINE>// no intents -> no item<NEW_LINE>return null;<NEW_LINE>Resources r = context.getResources();<NEW_LINE>Drawable icon;<NEW_LINE>if (url.startsWith("mailto")) {<NEW_LINE>icon = getBitmapDrawable(R.drawable.action_mail, r);<NEW_LINE>} else if (url.startsWith("tel")) {<NEW_LINE>icon = getBitmapDrawable(<MASK><NEW_LINE>} else {<NEW_LINE>icon = getBitmapDrawable(R.drawable.action_web, r);<NEW_LINE>}<NEW_LINE>if (text.length() > 15)<NEW_LINE>// $NON-NLS-1$<NEW_LINE>text = text.substring(0, 12) + "...";<NEW_LINE>TaskAction action = new TaskAction(text, PendingIntent.getActivity(context, (int) id, actionIntent, 0), (BitmapDrawable) icon);<NEW_LINE>return action;<NEW_LINE>}
R.drawable.action_tel, r);
888,579
private Mono<Response<Flux<ByteBuffer>>> deleteWithResponseAsync(String resourceGroupName, String configStoreName, String keyValueName, 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 (configStoreName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter configStoreName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (keyValueName == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, configStoreName, this.client.getApiVersion(), keyValueName, accept, context);<NEW_LINE>}
error(new IllegalArgumentException("Parameter keyValueName is required and cannot be null."));
1,120,205
public void writeProperties(java.util.Properties p) {<NEW_LINE>// better to version settings since initial version as advocated at<NEW_LINE>// http://wiki.apidesign.org/wiki/PropertyFiles<NEW_LINE>p.setProperty("version", "1.0");<NEW_LINE>ProbeSettings ps = new ProbeSettings();<NEW_LINE>ps.xyzXDistance = getDouble(this.xyzXDistanceModel);<NEW_LINE>ps.xyzYDistance = getDouble(xyzYDistanceModel);<NEW_LINE>ps.xyzZDistance = getDouble(xyzZDistanceModel);<NEW_LINE>ps.xyzXOffset = getDouble(xyzXOffsetModel);<NEW_LINE>ps.xyzYOffset = getDouble(xyzYOffsetModel);<NEW_LINE>ps.xyzZOffset = getDouble(xyzZOffsetModel);<NEW_LINE>ps.outsideXDistance = getDouble(this.outsideXDistanceModel);<NEW_LINE>ps.outsideYDistance = getDouble(outsideYDistanceModel);<NEW_LINE>ps.outsideXOffset = getDouble(outsideXOffsetModel);<NEW_LINE>ps.outsideYOffset = getDouble(outsideYOffsetModel);<NEW_LINE><MASK><NEW_LINE>ps.zOffset = getDouble(zProbeOffset);<NEW_LINE>ps.insideXDistance = getDouble(this.insideXDistanceModel);<NEW_LINE>ps.insideYDistance = getDouble(insideYDistanceModel);<NEW_LINE>ps.insideXOffset = getDouble(insideXOffsetModel);<NEW_LINE>ps.insideYOffset = getDouble(insideYOffsetModel);<NEW_LINE>ps.settingsWorkCoordinateIdx = settingsWorkCoordinate.getSelectedIndex();<NEW_LINE>ps.settingsUnitsIdx = settingsUnits.getSelectedIndex();<NEW_LINE>ps.settingsProbeDiameter = getDouble(settingsProbeDiameter);<NEW_LINE>ps.settingsFastFindRate = getDouble(settingsFastFindRate);<NEW_LINE>ps.settingsSlowMeasureRate = getDouble(settingsSlowMeasureRate);<NEW_LINE>ps.settingsRetractAmount = getDouble(settingsRetractAmount);<NEW_LINE>ps.selectedTabIdx = this.jtp.getSelectedIndex();<NEW_LINE>p.setProperty("json_data", new Gson().toJson(ps));<NEW_LINE>}
ps.zDistance = getDouble(zProbeDistance);
926,909
public static void main(String[] args) throws IOException {<NEW_LINE>int argIdx = 0;<NEW_LINE>Webpath inputPath = Webpath.get(args[argIdx++]);<NEW_LINE>outputPath = Webpath.get(args[argIdx++]);<NEW_LINE>Webpath jsPath = Webpath.<MASK><NEW_LINE>Path output = Paths.get(args[argIdx++]);<NEW_LINE>Path jsOutput = Paths.get(args[argIdx++]);<NEW_LINE>while (argIdx < args.length) {<NEW_LINE>final String arg = args[argIdx++];<NEW_LINE>if (!arg.endsWith(".pbtxt")) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Webfiles manifest = loadWebfilesPbtxt(Paths.get(arg));<NEW_LINE>for (WebfilesSource src : manifest.getSrcList()) {<NEW_LINE>webfiles.put(Webpath.get(src.getWebpath()), Paths.get(src.getPath()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>stack.add(inputPath);<NEW_LINE>Document document = parse(Files.readAllBytes(webfiles.get(inputPath)));<NEW_LINE>transform(document);<NEW_LINE>if (firstScript != null) {<NEW_LINE>firstScript.before(new Element(Tag.valueOf("script"), firstScript.baseUri()).appendChild(new DataNode("var CLOSURE_NO_DEPS = true;", firstScript.baseUri())));<NEW_LINE>}<NEW_LINE>if (licenseComment != null) {<NEW_LINE>licenseComment.attr("comment", String.format("\n%s\n", Joiner.on("\n\n").join(licenses)));<NEW_LINE>}<NEW_LINE>boolean shouldExtractJs = !jsPath.isEmpty();<NEW_LINE>// Write an empty file for shasum when all scripts are extracted out.<NEW_LINE>createFile(jsOutput, shouldExtractJs ? extractAndTransformJavaScript(document, jsPath) : "");<NEW_LINE>Document normalizedDocument = getFlattenedHTML5Document(document);<NEW_LINE>// Prevent from correcting the DOM structure and messing up the whitespace<NEW_LINE>// in the template.<NEW_LINE>normalizedDocument.outputSettings().prettyPrint(false);<NEW_LINE>createFile(output, normalizedDocument.toString());<NEW_LINE>}
get(args[argIdx++]);
991,523
private DefinitionProtos.Body writeBody(ExpressionSerialization defSerializer, @NotNull Body body) {<NEW_LINE>DefinitionProtos.Body.Builder bodyBuilder = DefinitionProtos.Body.newBuilder();<NEW_LINE>if (body instanceof IntervalElim) {<NEW_LINE>IntervalElim intervalElim = (IntervalElim) body;<NEW_LINE>DefinitionProtos.Body.IntervalElim.Builder intervalBuilder = DefinitionProtos<MASK><NEW_LINE>for (Pair<Expression, Expression> pair : intervalElim.getCases()) {<NEW_LINE>DefinitionProtos.Body.ExpressionPair.Builder pairBuilder = DefinitionProtos.Body.ExpressionPair.newBuilder();<NEW_LINE>if (pair.proj1 != null) {<NEW_LINE>pairBuilder.setLeft(defSerializer.writeExpr(pair.proj1));<NEW_LINE>}<NEW_LINE>if (pair.proj2 != null) {<NEW_LINE>pairBuilder.setRight(defSerializer.writeExpr(pair.proj2));<NEW_LINE>}<NEW_LINE>intervalBuilder.addCase(pairBuilder);<NEW_LINE>}<NEW_LINE>if (intervalElim.getOtherwise() != null) {<NEW_LINE>intervalBuilder.setOtherwise(defSerializer.writeElimBody(intervalElim.getOtherwise()));<NEW_LINE>}<NEW_LINE>bodyBuilder.setIntervalElim(intervalBuilder);<NEW_LINE>} else if (body instanceof ElimBody) {<NEW_LINE>bodyBuilder.setElimBody(defSerializer.writeElimBody((ElimBody) body));<NEW_LINE>} else if (body instanceof Expression) {<NEW_LINE>bodyBuilder.setExpression(defSerializer.writeExpr((Expression) body));<NEW_LINE>} else {<NEW_LINE>throw new IllegalStateException();<NEW_LINE>}<NEW_LINE>return bodyBuilder.build();<NEW_LINE>}
.Body.IntervalElim.newBuilder();
1,627,338
public static DescribeScheduledTasksResponse unmarshall(DescribeScheduledTasksResponse describeScheduledTasksResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeScheduledTasksResponse.setRequestId(_ctx.stringValue("DescribeScheduledTasksResponse.RequestId"));<NEW_LINE>describeScheduledTasksResponse.setTotalCount(_ctx.integerValue("DescribeScheduledTasksResponse.TotalCount"));<NEW_LINE>describeScheduledTasksResponse.setPageNumber(_ctx.integerValue("DescribeScheduledTasksResponse.PageNumber"));<NEW_LINE>describeScheduledTasksResponse.setPageSize(_ctx.integerValue("DescribeScheduledTasksResponse.PageSize"));<NEW_LINE>List<ScheduledTask> scheduledTasks = new ArrayList<ScheduledTask>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeScheduledTasksResponse.ScheduledTasks.Length"); i++) {<NEW_LINE>ScheduledTask scheduledTask = new ScheduledTask();<NEW_LINE>scheduledTask.setScheduledTaskId(_ctx.stringValue("DescribeScheduledTasksResponse.ScheduledTasks[" + i + "].ScheduledTaskId"));<NEW_LINE>scheduledTask.setScheduledTaskName(_ctx.stringValue("DescribeScheduledTasksResponse.ScheduledTasks[" + i + "].ScheduledTaskName"));<NEW_LINE>scheduledTask.setDescription(_ctx.stringValue("DescribeScheduledTasksResponse.ScheduledTasks[" + i + "].Description"));<NEW_LINE>scheduledTask.setScheduledAction(_ctx.stringValue("DescribeScheduledTasksResponse.ScheduledTasks[" + i + "].ScheduledAction"));<NEW_LINE>scheduledTask.setRecurrenceEndTime(_ctx.stringValue("DescribeScheduledTasksResponse.ScheduledTasks[" + i + "].RecurrenceEndTime"));<NEW_LINE>scheduledTask.setLaunchTime(_ctx.stringValue("DescribeScheduledTasksResponse.ScheduledTasks[" + i + "].LaunchTime"));<NEW_LINE>scheduledTask.setRecurrenceType(_ctx.stringValue("DescribeScheduledTasksResponse.ScheduledTasks[" + i + "].RecurrenceType"));<NEW_LINE>scheduledTask.setRecurrenceValue(_ctx.stringValue("DescribeScheduledTasksResponse.ScheduledTasks[" + i + "].RecurrenceValue"));<NEW_LINE>scheduledTask.setLaunchExpirationTime(_ctx.integerValue("DescribeScheduledTasksResponse.ScheduledTasks[" + i + "].LaunchExpirationTime"));<NEW_LINE>scheduledTask.setTaskEnabled(_ctx.booleanValue<MASK><NEW_LINE>scheduledTask.setMaxValue(_ctx.integerValue("DescribeScheduledTasksResponse.ScheduledTasks[" + i + "].MaxValue"));<NEW_LINE>scheduledTask.setMinValue(_ctx.integerValue("DescribeScheduledTasksResponse.ScheduledTasks[" + i + "].MinValue"));<NEW_LINE>scheduledTask.setDesiredCapacity(_ctx.integerValue("DescribeScheduledTasksResponse.ScheduledTasks[" + i + "].DesiredCapacity"));<NEW_LINE>scheduledTask.setScalingGroupId(_ctx.stringValue("DescribeScheduledTasksResponse.ScheduledTasks[" + i + "].ScalingGroupId"));<NEW_LINE>scheduledTasks.add(scheduledTask);<NEW_LINE>}<NEW_LINE>describeScheduledTasksResponse.setScheduledTasks(scheduledTasks);<NEW_LINE>return describeScheduledTasksResponse;<NEW_LINE>}
("DescribeScheduledTasksResponse.ScheduledTasks[" + i + "].TaskEnabled"));
642,025
private SpanEntry parseSpan(EnumConstantSource enumConstant, JavaEnumImpl myEnum) {<NEW_LINE>List<MemberSource<EnumConstantSource.Body, ?>> members = enumConstant.getBody().getMembers();<NEW_LINE>if (members.isEmpty()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>String name = "";<NEW_LINE>String description = enumConstant.getJavaDoc().getText();<NEW_LINE>String prefix = "";<NEW_LINE>Collection<KeyValueEntry> tags = new TreeSet<>();<NEW_LINE>Collection<KeyValueEntry> <MASK><NEW_LINE>for (MemberSource<EnumConstantSource.Body, ?> member : members) {<NEW_LINE>Object internal = member.getInternal();<NEW_LINE>if (!(internal instanceof MethodDeclaration)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>MethodDeclaration methodDeclaration = (MethodDeclaration) internal;<NEW_LINE>String methodName = methodDeclaration.getName().getIdentifier();<NEW_LINE>if ("getName".equals(methodName)) {<NEW_LINE>name = readStringReturnValue(methodDeclaration);<NEW_LINE>} else if ("getTagKeys".equals(methodName)) {<NEW_LINE>tags.addAll(keyValueEntries(myEnum, methodDeclaration, TagKey.class));<NEW_LINE>} else if ("getEvents".equals(methodName)) {<NEW_LINE>events.addAll(keyValueEntries(myEnum, methodDeclaration, EventValue.class));<NEW_LINE>} else if ("prefix".equals(methodName)) {<NEW_LINE>prefix = readStringReturnValue(methodDeclaration);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new SpanEntry(name, myEnum.getCanonicalName(), enumConstant.getName(), description, prefix, tags, events);<NEW_LINE>}
events = new TreeSet<>();
378,040
protected void doStart() throws Exception {<NEW_LINE>if (!client.isStarted()) {<NEW_LINE>HttpClient httpClient = getHttpClient();<NEW_LINE>ClientConnector clientConnector = this.client.getClientConnector();<NEW_LINE>clientConnector.setExecutor(httpClient.getExecutor());<NEW_LINE>clientConnector.setScheduler(httpClient.getScheduler());<NEW_LINE>clientConnector.<MASK><NEW_LINE>clientConnector.setConnectTimeout(Duration.ofMillis(httpClient.getConnectTimeout()));<NEW_LINE>clientConnector.setConnectBlocking(httpClient.isConnectBlocking());<NEW_LINE>clientConnector.setBindAddress(httpClient.getBindAddress());<NEW_LINE>clientConnector.setIdleTimeout(Duration.ofMillis(httpClient.getIdleTimeout()));<NEW_LINE>HTTP3Configuration configuration = client.getHTTP3Configuration();<NEW_LINE>configuration.setInputBufferSize(httpClient.getResponseBufferSize());<NEW_LINE>configuration.setUseInputDirectByteBuffers(httpClient.isUseInputDirectByteBuffers());<NEW_LINE>configuration.setUseOutputDirectByteBuffers(httpClient.isUseOutputDirectByteBuffers());<NEW_LINE>}<NEW_LINE>super.doStart();<NEW_LINE>}
setByteBufferPool(httpClient.getByteBufferPool());
789,539
public static void addResolverRequest(String host, HostNameToIPResolverListener l) {<NEW_LINE>byte[] bytes = textToNumericFormat(host);<NEW_LINE>if (bytes != null) {<NEW_LINE>try {<NEW_LINE>l.hostNameResolutionComplete(InetAddress.getByAddress(host, bytes));<NEW_LINE>return;<NEW_LINE>} catch (UnknownHostException e) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>request_queue_mon.enter();<NEW_LINE>request_queue.add(new request(host, l));<NEW_LINE>request_semaphore.release();<NEW_LINE>if (resolver_thread == null) {<NEW_LINE>resolver_thread = new AEThread2("HostNameToIPResolver", true) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>while (true) {<NEW_LINE>try {<NEW_LINE>request_semaphore.reserve(30000);<NEW_LINE>request req;<NEW_LINE>try {<NEW_LINE>request_queue_mon.enter();<NEW_LINE>if (request_queue.isEmpty()) {<NEW_LINE>resolver_thread = null;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>req = (request) request_queue.remove(0);<NEW_LINE>} finally {<NEW_LINE>request_queue_mon.exit();<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>InetAddress addr = syncResolve(req.getHost());<NEW_LINE>req.<MASK><NEW_LINE>} catch (Throwable e) {<NEW_LINE>req.getListener().hostNameResolutionComplete(null);<NEW_LINE>}<NEW_LINE>} catch (Throwable e) {<NEW_LINE>Debug.printStackTrace(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>resolver_thread.start();<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>request_queue_mon.exit();<NEW_LINE>}<NEW_LINE>}
getListener().hostNameResolutionComplete(addr);
487,169
public void run(RegressionEnvironment env) {<NEW_LINE>String stmtText = "@name('s0') select " + ALL_FIELDS + " from " <MASK><NEW_LINE>env.compileDeploy(stmtText).addListener("s0");<NEW_LINE>env.assertStatement("s0", statement -> {<NEW_LINE>EventType eventType = statement.getEventType();<NEW_LINE>assertEquals(Long.class, eventType.getPropertyType("mybigint"));<NEW_LINE>assertEquals(Integer.class, eventType.getPropertyType("myint"));<NEW_LINE>assertEquals(String.class, eventType.getPropertyType("myvarchar"));<NEW_LINE>assertEquals(String.class, eventType.getPropertyType("mychar"));<NEW_LINE>assertEquals(Boolean.class, eventType.getPropertyType("mybool"));<NEW_LINE>assertEquals(BigDecimal.class, eventType.getPropertyType("mynumeric"));<NEW_LINE>assertEquals(BigDecimal.class, eventType.getPropertyType("mydecimal"));<NEW_LINE>assertEquals(Double.class, eventType.getPropertyType("mydouble"));<NEW_LINE>assertEquals(Double.class, eventType.getPropertyType("myreal"));<NEW_LINE>});<NEW_LINE>sendEventS0(env, 1);<NEW_LINE>assertReceived(env, 1, 10, "A", "Z", true, new BigDecimal(5000), new BigDecimal(100), 1.2, 1.3);<NEW_LINE>env.undeployAll();<NEW_LINE>}
+ " sql:MyDBWithRetain ['select " + ALL_FIELDS + " from mytesttable where ${id} = mytesttable.mybigint'] as s0," + "SupportBean_S0 as s1";
557,287
private FileObject generateMavenTester(File testdir, String baseURL) throws IOException {<NEW_LINE>String[] replaceKeys1 = { "TTL_TEST_RESBEANS", "MSG_TEST_RESBEANS_INFO" };<NEW_LINE>String[] replaceKeys2 = { "MSG_TEST_RESBEANS_wadlErr", "MSG_TEST_RESBEANS_No_AJAX", "MSG_TEST_RESBEANS_Resource", "MSG_TEST_RESBEANS_See", "MSG_TEST_RESBEANS_No_Container", "MSG_TEST_RESBEANS_Content", "MSG_TEST_RESBEANS_TabularView", "MSG_TEST_RESBEANS_RawView", "MSG_TEST_RESBEANS_ResponseHeaders", "MSG_TEST_RESBEANS_Help", "MSG_TEST_RESBEANS_TestButton", "MSG_TEST_RESBEANS_Loading", "MSG_TEST_RESBEANS_Status", "MSG_TEST_RESBEANS_Headers", "MSG_TEST_RESBEANS_HeaderName", "MSG_TEST_RESBEANS_HeaderValue", "MSG_TEST_RESBEANS_Insert", "MSG_TEST_RESBEANS_NoContents", "MSG_TEST_RESBEANS_AddParamButton", "MSG_TEST_RESBEANS_Monitor", "MSG_TEST_RESBEANS_No_SubResources", "MSG_TEST_RESBEANS_SubResources", "MSG_TEST_RESBEANS_ChooseMethod", "MSG_TEST_RESBEANS_ChooseMime", "MSG_TEST_RESBEANS_Continue", "MSG_TEST_RESBEANS_AdditionalParams", "MSG_TEST_RESBEANS_INFO", "MSG_TEST_RESBEANS_Request", "MSG_TEST_RESBEANS_Sent", "MSG_TEST_RESBEANS_Received", "MSG_TEST_RESBEANS_TimeStamp", "MSG_TEST_RESBEANS_Response", "MSG_TEST_RESBEANS_CurrentSelection", "MSG_TEST_RESBEANS_DebugWindow", "MSG_TEST_RESBEANS_Wadl", "MSG_TEST_RESBEANS_RequestFailed" };<NEW_LINE>FileObject testFO = copyFileAndReplaceBaseUrl(testdir, TEST_SERVICES_HTML, replaceKeys1, baseURL);<NEW_LINE>MiscUtilities.copyFile(testdir, RestSupport.TEST_RESBEANS_JS, replaceKeys2, false);<NEW_LINE>MiscUtilities.copyFile(testdir, RestSupport.TEST_RESBEANS_CSS);<NEW_LINE>MiscUtilities.copyFile(testdir, RestSupport.TEST_RESBEANS_CSS2);<NEW_LINE>MiscUtilities.copyFile(testdir, "expand.gif");<NEW_LINE><MASK><NEW_LINE>MiscUtilities.copyFile(testdir, "item.gif");<NEW_LINE>MiscUtilities.copyFile(testdir, "cc.gif");<NEW_LINE>MiscUtilities.copyFile(testdir, "og.gif");<NEW_LINE>MiscUtilities.copyFile(testdir, "cg.gif");<NEW_LINE>MiscUtilities.copyFile(testdir, "app.gif");<NEW_LINE>File testdir2 = new File(testdir, "images");<NEW_LINE>testdir2.mkdir();<NEW_LINE>MiscUtilities.copyFile(testdir, "images/background_border_bottom.gif");<NEW_LINE>MiscUtilities.copyFile(testdir, "images/pbsel.png");<NEW_LINE>MiscUtilities.copyFile(testdir, "images/bg_gradient.gif");<NEW_LINE>MiscUtilities.copyFile(testdir, "images/pname.png");<NEW_LINE>MiscUtilities.copyFile(testdir, "images/level1_selected-1lvl.jpg");<NEW_LINE>MiscUtilities.copyFile(testdir, "images/primary-enabled.gif");<NEW_LINE>MiscUtilities.copyFile(testdir, "images/masthead.png");<NEW_LINE>MiscUtilities.copyFile(testdir, "images/primary-roll.gif");<NEW_LINE>MiscUtilities.copyFile(testdir, "images/pbdis.png");<NEW_LINE>MiscUtilities.copyFile(testdir, "images/secondary-enabled.gif");<NEW_LINE>MiscUtilities.copyFile(testdir, "images/pbena.png");<NEW_LINE>MiscUtilities.copyFile(testdir, "images/tbsel.png");<NEW_LINE>MiscUtilities.copyFile(testdir, "images/pbmou.png");<NEW_LINE>MiscUtilities.copyFile(testdir, "images/tbuns.png");<NEW_LINE>return testFO;<NEW_LINE>}
MiscUtilities.copyFile(testdir, "collapse.gif");
1,103,798
private static void putBlock4x4(byte[] plane, int stride, int[] patch, int x, int y, int field, int step) {<NEW_LINE>stride >>= 1;<NEW_LINE>int dstride = step * stride;<NEW_LINE>int off = field * stride + (y >> 1) * dstride + (x >> 1);<NEW_LINE>for (int i = 0; i < 16; i += 4) {<NEW_LINE>plane[off] = (byte) (MathUtil.clip(patch[i], 0, 255) - 128);<NEW_LINE>plane[off + 1] = (byte) (MathUtil.clip(patch[i + 1]<MASK><NEW_LINE>plane[off + 2] = (byte) (MathUtil.clip(patch[i + 2], 0, 255) - 128);<NEW_LINE>plane[off + 3] = (byte) (MathUtil.clip(patch[i + 3], 0, 255) - 128);<NEW_LINE>off += dstride;<NEW_LINE>}<NEW_LINE>}
, 0, 255) - 128);
1,130,149
public String deserialize(String topic, byte[] buffer, boolean isKey) {<NEW_LINE>AvroTopicsMapping matchingConfig = findMatchingConfig(topic);<NEW_LINE>if (matchingConfig == null) {<NEW_LINE>log.debug("Avro deserialization config is not found for topic [{}]", topic);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (matchingConfig.getKeySchemaFile() == null && matchingConfig.getValueSchemaFile() == null) {<NEW_LINE>throw new SerializationException(String.format<MASK><NEW_LINE>}<NEW_LINE>Schema schema;<NEW_LINE>if (isKey) {<NEW_LINE>schema = keySchemas.get(matchingConfig.getTopicRegex());<NEW_LINE>} else {<NEW_LINE>schema = valueSchemas.get(matchingConfig.getTopicRegex());<NEW_LINE>}<NEW_LINE>if (schema == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>String result;<NEW_LINE>try {<NEW_LINE>result = tryToDeserializeWithSchemaFile(buffer, schema);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SerializationException(String.format("Cannot deserialize message with Avro deserializer " + "for topic [%s] and schema [%s]", topic, schema.getFullName()), e);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
("Avro deserialization is configured for topic [%s], " + "but schema is not specified neither for a key, nor for a value.", topic));
1,028,909
public void cancelFlow(ExecutableFlow exFlow, String userId) throws ExecutorManagerException {<NEW_LINE>synchronized (exFlow) {<NEW_LINE>final Map<Integer, Pair<ExecutionReference, ExecutableFlow>> unfinishedFlows = this.executorLoader.fetchUnfinishedFlows();<NEW_LINE>if (unfinishedFlows.containsKey(exFlow.getExecutionId())) {<NEW_LINE>final Pair<ExecutionReference, ExecutableFlow> pair = unfinishedFlows.get(exFlow.getExecutionId());<NEW_LINE>handleCancelFlow(pair.getFirst(), exFlow, userId);<NEW_LINE>// Emit FLOW_FINISHED event<NEW_LINE>this.fireEventListeners(Event.create(exFlow, EventType.FLOW_FINISHED, new EventData(exFlow)));<NEW_LINE>} else {<NEW_LINE>final ExecutorManagerException eme = new ExecutorManagerException("Execution " + exFlow.getExecutionId() + " of flow " + exFlow.getFlowId() + " isn't running.");<NEW_LINE><MASK><NEW_LINE>throw eme;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
logger.error("Exception while cancelling flow. ", eme);
1,543,266
private void initView() {<NEW_LINE>final TitleBar mTitleBar = findViewById(R.id.title_bar);<NEW_LINE>mTitleBar.setOnTitleBarClickListener(new TitleBar.OnTitleBarClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onLeftClick() {<NEW_LINE>getActivity().onBackPressed();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onRightClick() {<NEW_LINE>}<NEW_LINE>});<NEW_LINE>mViewPager = findViewById(R.id.vp_show);<NEW_LINE>mSummaryView = new NetWorkSummaryView(getContext());<NEW_LINE>mNetworkListView = new NetworkListView(getContext());<NEW_LINE>mNetworkListView.registerNetworkListener();<NEW_LINE>List<View> views = new ArrayList<>();<NEW_LINE>views.add(mSummaryView);<NEW_LINE>views.add(mNetworkListView);<NEW_LINE>mViewPager.setAdapter(new NetWorkMainPagerAdapter(getContext(), views));<NEW_LINE>final View tabSummary = <MASK><NEW_LINE>((TextView) tabSummary.findViewById(R.id.tab_text)).setText(R.string.dk_net_monitor_title_summary);<NEW_LINE>((ImageView) tabSummary.findViewById(R.id.tab_icon)).setImageResource(R.drawable.dk_net_work_monitor_summary_selector);<NEW_LINE>tabSummary.setSelected(true);<NEW_LINE>tabSummary.setOnClickListener(this);<NEW_LINE>final View tabList = findViewById(R.id.tab_list);<NEW_LINE>((TextView) tabList.findViewById(R.id.tab_text)).setText(R.string.dk_net_monitor_list);<NEW_LINE>((ImageView) tabList.findViewById(R.id.tab_icon)).setImageResource(R.drawable.dk_net_work_monitor_list_selector);<NEW_LINE>tabList.setOnClickListener(this);<NEW_LINE>mViewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {<NEW_LINE>if (position == 0) {<NEW_LINE>tabSummary.setSelected(true);<NEW_LINE>tabList.setSelected(false);<NEW_LINE>} else {<NEW_LINE>tabList.setSelected(true);<NEW_LINE>tabSummary.setSelected(false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onPageSelected(int position) {<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onPageScrollStateChanged(int state) {<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
findViewById(R.id.tab_summary);
1,782,753
public static DescribeRisksResponse unmarshall(DescribeRisksResponse describeRisksResponse, UnmarshallerContext context) {<NEW_LINE>describeRisksResponse.setRequestId(context.stringValue("DescribeRisksResponse.RequestId"));<NEW_LINE>describeRisksResponse.setTotalCount(context.integerValue("DescribeRisksResponse.TotalCount"));<NEW_LINE>List<Risk> risks = new ArrayList<Risk>();<NEW_LINE>for (int i = 0; i < context.lengthValue("DescribeRisksResponse.Risks.Length"); i++) {<NEW_LINE>Risk risk = new Risk();<NEW_LINE>risk.setRiskId(context.longValue("DescribeRisksResponse.Risks[" + i + "].RiskId"));<NEW_LINE>risk.setRiskName(context.stringValue<MASK><NEW_LINE>risk.setRiskDetail(context.stringValue("DescribeRisksResponse.Risks[" + i + "].RiskDetail"));<NEW_LINE>risk.setRiskType(context.stringValue("DescribeRisksResponse.Risks[" + i + "].RiskType"));<NEW_LINE>risk.setTypeAlias(context.stringValue("DescribeRisksResponse.Risks[" + i + "].TypeAlias"));<NEW_LINE>risk.setSubRiskType(context.stringValue("DescribeRisksResponse.Risks[" + i + "].SubRiskType"));<NEW_LINE>risk.setSubTypeAlias(context.stringValue("DescribeRisksResponse.Risks[" + i + "].SubTypeAlias"));<NEW_LINE>risks.add(risk);<NEW_LINE>}<NEW_LINE>describeRisksResponse.setRisks(risks);<NEW_LINE>return describeRisksResponse;<NEW_LINE>}
("DescribeRisksResponse.Risks[" + i + "].RiskName"));