idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
359,486
private String constructImportStatement(Map.Entry<String, BImport> importEntry) {<NEW_LINE>String orgName = importEntry.getValue().getResolvedSymbol().id().orgName();<NEW_LINE>// If the import belongs to a module inside the current package, replace the original org name name with<NEW_LINE>// temporary evaluation project org name.<NEW_LINE>if (context.getPackageOrg().isPresent() && orgName.equals(context.getPackageOrg().get())) {<NEW_LINE>orgName = EVALUATION_PACKAGE_ORG;<NEW_LINE>}<NEW_LINE>String moduleName = getModuleName(importEntry.getValue().getResolvedSymbol().id());<NEW_LINE>String[] moduleNameParts = moduleName.split(MODULE_NAME_SEPARATOR_REGEX);<NEW_LINE>// If the import belongs to a module inside the current package, replace the original package name with<NEW_LINE>// temporary evaluation project package name.<NEW_LINE>if (context.getPackageName().isPresent() && moduleNameParts[0].equals(context.getPackageName().get())) {<NEW_LINE>StringJoiner newModuleName = new StringJoiner(MODULE_NAME_SEPARATOR);<NEW_LINE>newModuleName.add(EVALUATION_PACKAGE_NAME);<NEW_LINE>for (int i = 1, copyOfRangeLength = moduleNameParts.length; i < copyOfRangeLength; i++) {<NEW_LINE>newModuleName<MASK><NEW_LINE>}<NEW_LINE>moduleName = newModuleName.toString();<NEW_LINE>}<NEW_LINE>String alias = importEntry.getKey();<NEW_LINE>return String.format(EVALUATION_IMPORT_TEMPLATE, orgName, moduleName, alias);<NEW_LINE>}
.add(moduleNameParts[i]);
1,759,758
public static void copyProcessorPropertiesIfNotNull(ProcessorProperties source, ProcessorProperties target) {<NEW_LINE>PropertyMapper propertyMapper = new PropertyMapper();<NEW_LINE>propertyMapper.from(source.getDomainName()).to(target::setDomainName);<NEW_LINE>propertyMapper.from(source.getNamespace()).to(target::setNamespace);<NEW_LINE>propertyMapper.from(source.getEventHubName()).to(target::setEventHubName);<NEW_LINE>propertyMapper.from(source.getConnectionString()).to(target::setConnectionString);<NEW_LINE>propertyMapper.from(source.getCustomEndpointAddress()).to(target::setCustomEndpointAddress);<NEW_LINE>propertyMapper.from(source.getPrefetchCount()).to(target::setPrefetchCount);<NEW_LINE>propertyMapper.from(source.getConsumerGroup()).to(target::setConsumerGroup);<NEW_LINE>propertyMapper.from(source.getTrackLastEnqueuedEventProperties()).to(target::setTrackLastEnqueuedEventProperties);<NEW_LINE>propertyMapper.from(source.getInitialPartitionEventPosition()).to(m -> target.getInitialPartitionEventPosition().putAll(m));<NEW_LINE>propertyMapper.from(source.getBatch().getMaxSize()).to(target.getBatch()::setMaxSize);<NEW_LINE>propertyMapper.from(source.getBatch().getMaxWaitTime()).to(<MASK><NEW_LINE>propertyMapper.from(source.getLoadBalancing().getPartitionOwnershipExpirationInterval()).to(target.getLoadBalancing()::setPartitionOwnershipExpirationInterval);<NEW_LINE>propertyMapper.from(source.getLoadBalancing().getStrategy()).to(target.getLoadBalancing()::setStrategy);<NEW_LINE>propertyMapper.from(source.getLoadBalancing().getUpdateInterval()).to(target.getLoadBalancing()::setUpdateInterval);<NEW_LINE>}
target.getBatch()::setMaxWaitTime);
97,732
public void run() {<NEW_LINE>JThemePreferenceStore store = getStore();<NEW_LINE>IJTPresetManager presetManager = JThemesCore.getDefault().getPresetManager();<NEW_LINE>Properties properties = PropertiesUtil.merge(presetManager.getDefaultPreset().getProperties(), preset.getProperties());<NEW_LINE>for (Object keyObj : properties.keySet()) {<NEW_LINE>String key = (String) keyObj;<NEW_LINE>String value = properties.getProperty(key);<NEW_LINE>if (key.equals(JTPConstants.Layout.TAB_HEIGHT)) {<NEW_LINE>int intValue = Integer.parseInt(value);<NEW_LINE>store.setValue(key, Math.max(intValue, SWTExtensions.INSTANCE.getMinimumToolBarHeight()));<NEW_LINE>} else {<NEW_LINE>store.setValue(key, value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>new RewriteCustomTheme(true).rewrite();<NEW_LINE>IThemeEngine engine = getThemeEngine();<NEW_LINE>if (engine.getActiveTheme() == null || !engine.getActiveTheme().getId().equals(JThemesCore.CUSTOM_THEME_ID)) {<NEW_LINE>engine.<MASK><NEW_LINE>}<NEW_LINE>store.setValue(JTPConstants.Memento.LAST_CHOOSED_PRESET, preset.getId());<NEW_LINE>}
setTheme(JThemesCore.CUSTOM_THEME_ID, true);
1,349,417
public double f(DenseMatrix coef) {<NEW_LINE>if (coef.numRows() != p + q) {<NEW_LINE>throw new RuntimeException("Error!coef is not comparable with the model");<NEW_LINE>}<NEW_LINE>double[] arCoef = new double[p];<NEW_LINE>double[<MASK><NEW_LINE>for (int i = 0; i < this.p; i++) {<NEW_LINE>arCoef[i] = coef.get(i, 0);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < this.q; i++) {<NEW_LINE>maCoef[i] = coef.get(i + this.p, 0);<NEW_LINE>}<NEW_LINE>// compute estimated residual<NEW_LINE>double css = this.multiComputeRSS(this.seasonMatrix, this.cResidual, arCoef, maCoef);<NEW_LINE>super.setResidual(TsMethod.seasonMatrix2Array(this.iterResidualMatrix));<NEW_LINE>return css;<NEW_LINE>}
] maCoef = new double[q];
916,923
public Builder mergeFrom(com.didiglobal.booster.aapt2.Resources.Array other) {<NEW_LINE>if (other == com.didiglobal.booster.aapt2.Resources.Array.getDefaultInstance())<NEW_LINE>return this;<NEW_LINE>if (elementBuilder_ == null) {<NEW_LINE>if (!other.element_.isEmpty()) {<NEW_LINE>if (element_.isEmpty()) {<NEW_LINE>element_ = other.element_;<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000001);<NEW_LINE>} else {<NEW_LINE>ensureElementIsMutable();<NEW_LINE>element_.addAll(other.element_);<NEW_LINE>}<NEW_LINE>onChanged();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (!other.element_.isEmpty()) {<NEW_LINE>if (elementBuilder_.isEmpty()) {<NEW_LINE>elementBuilder_.dispose();<NEW_LINE>elementBuilder_ = null;<NEW_LINE>element_ = other.element_;<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000001);<NEW_LINE>elementBuilder_ = com.google.protobuf.GeneratedMessageV3<MASK><NEW_LINE>} else {<NEW_LINE>elementBuilder_.addAllMessages(other.element_);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.mergeUnknownFields(other.unknownFields);<NEW_LINE>onChanged();<NEW_LINE>return this;<NEW_LINE>}
.alwaysUseFieldBuilders ? getElementFieldBuilder() : null;
1,448,975
private void buildMoreTryStatementCompletionContext(TypeReference exceptionRef) {<NEW_LINE>if (this.astLengthPtr > 0 && this.astPtr > 2 && this.astStack[this.astPtr - 1] instanceof Block && this.astStack[this.astPtr - 2] instanceof Argument) {<NEW_LINE>TryStatement tryStatement = new TryStatement();<NEW_LINE>int newAstPtr = this.astPtr - 1;<NEW_LINE>int length = this.<MASK><NEW_LINE>Block[] bks = (tryStatement.catchBlocks = new Block[length + 1]);<NEW_LINE>Argument[] args = (tryStatement.catchArguments = new Argument[length + 1]);<NEW_LINE>if (length != 0) {<NEW_LINE>while (length-- > 0) {<NEW_LINE>bks[length] = (Block) this.astStack[newAstPtr--];<NEW_LINE>// statements of catch block won't be used<NEW_LINE>bks[length].statements = null;<NEW_LINE>args[length] = (Argument) this.astStack[newAstPtr--];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>bks[bks.length - 1] = new Block(0);<NEW_LINE>if (this.astStack[this.astPtr] instanceof UnionTypeReference) {<NEW_LINE>UnionTypeReference unionTypeReference = (UnionTypeReference) this.astStack[this.astPtr];<NEW_LINE>args[args.length - 1] = new Argument(FAKE_ARGUMENT_NAME, 0, unionTypeReference, 0);<NEW_LINE>} else {<NEW_LINE>args[args.length - 1] = new Argument(FAKE_ARGUMENT_NAME, 0, exceptionRef, 0);<NEW_LINE>}<NEW_LINE>tryStatement.tryBlock = (Block) this.astStack[newAstPtr--];<NEW_LINE>this.assistNodeParent = tryStatement;<NEW_LINE>this.currentElement.add(tryStatement, 0);<NEW_LINE>} else if (this.astLengthPtr > -1 && this.astPtr > 0 && this.astStack[this.astPtr - 1] instanceof Block) {<NEW_LINE>TryStatement tryStatement = new TryStatement();<NEW_LINE>int newAstPtr = this.astPtr - 1;<NEW_LINE>Block[] bks = (tryStatement.catchBlocks = new Block[1]);<NEW_LINE>Argument[] args = (tryStatement.catchArguments = new Argument[1]);<NEW_LINE>bks[0] = new Block(0);<NEW_LINE>if (this.astStack[this.astPtr] instanceof UnionTypeReference) {<NEW_LINE>UnionTypeReference unionTypeReference = (UnionTypeReference) this.astStack[this.astPtr];<NEW_LINE>args[0] = new Argument(FAKE_ARGUMENT_NAME, 0, unionTypeReference, 0);<NEW_LINE>} else {<NEW_LINE>args[0] = new Argument(FAKE_ARGUMENT_NAME, 0, exceptionRef, 0);<NEW_LINE>}<NEW_LINE>tryStatement.tryBlock = (Block) this.astStack[newAstPtr--];<NEW_LINE>this.assistNodeParent = tryStatement;<NEW_LINE>this.currentElement.add(tryStatement, 0);<NEW_LINE>} else {<NEW_LINE>this.currentElement = this.currentElement.add(exceptionRef, 0);<NEW_LINE>}<NEW_LINE>}
astLengthStack[this.astLengthPtr - 1];
571,497
public static List<CAddressSpace> loadAddressSpaces(final AbstractSQLProvider provider, final INaviProject project, final DebuggerTemplateManager debuggerManager, final List<INaviModule> list) throws CouldntLoadDataException {<NEW_LINE>checkArguments(provider, project);<NEW_LINE>Preconditions.checkNotNull(debuggerManager, "IE01543: Debugger provider argument can not be null");<NEW_LINE>Preconditions.checkNotNull(list, "IE01545: Modules argument can not be null");<NEW_LINE>NaviLogger.info("Loading address spaces of project %s", project.getConfiguration().getName());<NEW_LINE>final CConnection connection = provider.getConnection();<NEW_LINE>final List<CAddressSpace> addressSpaces = new ArrayList<CAddressSpace>();<NEW_LINE>final String query = "SELECT id, name, description, creation_date, modification_date, debugger_id " + " FROM " + CTableNames.ADDRESS_SPACES_TABLE + " WHERE project_id = " + project.getConfiguration().getId();<NEW_LINE>try {<NEW_LINE>final ResultSet resultSet = connection.executeQuery(query, true);<NEW_LINE>try {<NEW_LINE>while (resultSet.next()) {<NEW_LINE>final int addressSpaceId = resultSet.getInt("id");<NEW_LINE>final Map<INaviModule, IAddress> imageBases = loadImageBases(connection, addressSpaceId, list);<NEW_LINE>final String name = PostgreSQLHelpers.readString(resultSet, "name");<NEW_LINE>final String description = <MASK><NEW_LINE>final Timestamp creationDate = resultSet.getTimestamp("creation_date");<NEW_LINE>final Timestamp modificationDate = resultSet.getTimestamp("modification_date");<NEW_LINE>final DebuggerTemplate debuggerDescription = debuggerManager.findDebugger(resultSet.getInt("debugger_id"));<NEW_LINE>addressSpaces.add(new CAddressSpace(addressSpaceId, name, description, creationDate, modificationDate, imageBases, debuggerDescription, provider, project));<NEW_LINE>}<NEW_LINE>return addressSpaces;<NEW_LINE>} finally {<NEW_LINE>resultSet.close();<NEW_LINE>}<NEW_LINE>} catch (final SQLException e) {<NEW_LINE>throw new CouldntLoadDataException(e);<NEW_LINE>}<NEW_LINE>}
PostgreSQLHelpers.readString(resultSet, "description");
470,828
static void doIndent(final int endIndex, final int startIndex, final Document document, final Project project, final Editor editor, final int blockIndent) {<NEW_LINE>final int[] caretOffset = { editor.getCaretModel().getOffset() };<NEW_LINE>boolean bulkMode = endIndex - startIndex > 50;<NEW_LINE>DocumentUtil.executeInBulk(document, bulkMode, () -> {<NEW_LINE>List<Integer> nonModifiableLines = new ArrayList<>();<NEW_LINE>if (project != null) {<NEW_LINE>PsiFile file = PsiDocumentManager.getInstance<MASK><NEW_LINE>IndentStrategy indentStrategy = LanguageIndentStrategy.getIndentStrategy(file);<NEW_LINE>if (!LanguageIndentStrategy.isDefault(indentStrategy)) {<NEW_LINE>for (int i = startIndex; i <= endIndex; i++) {<NEW_LINE>if (!canIndent(document, file, i, indentStrategy)) {<NEW_LINE>nonModifiableLines.add(i);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int i = startIndex; i <= endIndex; i++) {<NEW_LINE>if (!nonModifiableLines.contains(i)) {<NEW_LINE>caretOffset[0] = EditorActionUtil.indentLine(project, editor, i, blockIndent, caretOffset[0]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>editor.getCaretModel().moveToOffset(caretOffset[0]);<NEW_LINE>}
(project).getPsiFile(document);
1,063,449
public static List<Header> createRequestHeaders(Metadata headers, String defaultPath, String authority, String userAgent, boolean useGet, boolean usePlaintext) {<NEW_LINE>Preconditions.checkNotNull(headers, "headers");<NEW_LINE>Preconditions.checkNotNull(defaultPath, "defaultPath");<NEW_LINE>Preconditions.checkNotNull(authority, "authority");<NEW_LINE>// Discard any application supplied duplicates of the reserved headers<NEW_LINE>headers.discardAll(GrpcUtil.CONTENT_TYPE_KEY);<NEW_LINE>headers.discardAll(GrpcUtil.TE_HEADER);<NEW_LINE>headers.discardAll(GrpcUtil.USER_AGENT_KEY);<NEW_LINE>// 7 is the number of explicit add calls below.<NEW_LINE>List<Header> okhttpHeaders = new ArrayList<>(7 + InternalMetadata.headerCount(headers));<NEW_LINE>// Set GRPC-specific headers.<NEW_LINE>if (usePlaintext) {<NEW_LINE>okhttpHeaders.add(HTTP_SCHEME_HEADER);<NEW_LINE>} else {<NEW_LINE>okhttpHeaders.add(HTTPS_SCHEME_HEADER);<NEW_LINE>}<NEW_LINE>if (useGet) {<NEW_LINE>okhttpHeaders.add(METHOD_GET_HEADER);<NEW_LINE>} else {<NEW_LINE>okhttpHeaders.add(METHOD_HEADER);<NEW_LINE>}<NEW_LINE>okhttpHeaders.add(new Header(Header.TARGET_AUTHORITY, authority));<NEW_LINE>String path = defaultPath;<NEW_LINE>okhttpHeaders.add(new Header(Header.TARGET_PATH, path));<NEW_LINE>okhttpHeaders.add(new Header(GrpcUtil.USER_AGENT_KEY.name(), userAgent));<NEW_LINE>// All non-pseudo headers must come after pseudo headers.<NEW_LINE>okhttpHeaders.add(CONTENT_TYPE_HEADER);<NEW_LINE>okhttpHeaders.add(TE_HEADER);<NEW_LINE>// Now add any application-provided headers.<NEW_LINE>byte[][] serializedHeaders = TransportFrameUtil.toHttp2Headers(headers);<NEW_LINE>for (int i = 0; i < serializedHeaders.length; i += 2) {<NEW_LINE>ByteString key = ByteString<MASK><NEW_LINE>String keyString = key.utf8();<NEW_LINE>if (isApplicationHeader(keyString)) {<NEW_LINE>ByteString value = ByteString.of(serializedHeaders[i + 1]);<NEW_LINE>okhttpHeaders.add(new Header(key, value));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return okhttpHeaders;<NEW_LINE>}
.of(serializedHeaders[i]);
601,862
private void invocation(RESTRequest request, RESTResponse response) {<NEW_LINE>RESTHelper.ensureConsumesJson(request);<NEW_LINE>String objectName = RESTHelper.getRequiredParam(request, APIConstants.PARAM_OBJECT_NAME);<NEW_LINE>String operation = RESTHelper.getRequiredParam(request, APIConstants.PARAM_OPERATION);<NEW_LINE>InputStream is = RESTHelper.getInputStream(request);<NEW_LINE>// Get the converter<NEW_LINE>JSONConverter converter = JSONConverter.getConverter();<NEW_LINE>// Read the input<NEW_LINE>Invocation invocation = null;<NEW_LINE>try {<NEW_LINE>invocation = converter.readInvocation(is);<NEW_LINE>} catch (ConversionException e) {<NEW_LINE>throw ErrorHelper.createRESTHandlerJsonException(<MASK><NEW_LINE>} catch (IOException e) {<NEW_LINE>throw ErrorHelper.createRESTHandlerJsonException(e, converter, APIConstants.STATUS_BAD_REQUEST);<NEW_LINE>} catch (ClassNotFoundException e) {<NEW_LINE>throw ErrorHelper.createRESTHandlerJsonException(e, converter, APIConstants.STATUS_BAD_REQUEST);<NEW_LINE>}<NEW_LINE>// Get the converted ObjectName<NEW_LINE>ObjectName objectNameObj = RESTHelper.objectNameConverter(objectName, true, converter);<NEW_LINE>// Make the invocation<NEW_LINE>final Object pojo = MBeanServerHelper.invoke(objectNameObj, operation, invocation.params, invocation.signature, converter);<NEW_LINE>OutputHelper.writePOJOOutput(response, pojo, converter);<NEW_LINE>}
e, converter, APIConstants.STATUS_BAD_REQUEST);
227,932
public Object invoke(final MethodInvocation invocation) throws Throwable {<NEW_LINE>final ResultHolder result = new ResultHolder();<NEW_LINE>// Cache void return value if intercepted method returns void<NEW_LINE>final boolean voidReturnType = Void.TYPE.equals(invocation.getMethod().getReturnType());<NEW_LINE>if (voidReturnType) {<NEW_LINE>// This will be ignored anyway, but we want it to be non-null for<NEW_LINE>// convenience of checking that there is a result.<NEW_LINE>result.setValue(new Object());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>repeatOperations.iterate(new RepeatCallback() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public RepeatStatus doInIteration(RepeatContext context) throws Exception {<NEW_LINE>try {<NEW_LINE>MethodInvocation clone = invocation;<NEW_LINE>if (invocation instanceof ProxyMethodInvocation) {<NEW_LINE>clone = ((ProxyMethodInvocation) invocation).invocableClone();<NEW_LINE>} else {<NEW_LINE>throw new IllegalStateException("MethodInvocation of the wrong type detected - this should not happen with Spring AOP, so please raise an issue if you see this exception");<NEW_LINE>}<NEW_LINE>Object value = clone.proceed();<NEW_LINE>if (voidReturnType) {<NEW_LINE>return RepeatStatus.CONTINUABLE;<NEW_LINE>}<NEW_LINE>if (!isComplete(value)) {<NEW_LINE>// Save the last result<NEW_LINE>result.setValue(value);<NEW_LINE>return RepeatStatus.CONTINUABLE;<NEW_LINE>} else {<NEW_LINE>result.setFinalValue(value);<NEW_LINE>return RepeatStatus.FINISHED;<NEW_LINE>}<NEW_LINE>} catch (Throwable e) {<NEW_LINE>if (e instanceof Exception) {<NEW_LINE>throw (Exception) e;<NEW_LINE>} else {<NEW_LINE>throw new RepeatOperationsInterceptorException("Unexpected error in batch interceptor", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (Throwable t) {<NEW_LINE>// The repeat exception should be unwrapped by the template<NEW_LINE>throw t;<NEW_LINE>}<NEW_LINE>if (result.isReady()) {<NEW_LINE>return result.getValue();<NEW_LINE>}<NEW_LINE>// No result means something weird happened<NEW_LINE>throw new <MASK><NEW_LINE>}
IllegalStateException("No result available for attempted repeat call to " + invocation + ". The invocation was never called, so maybe there is a problem with the completion policy?");
249,964
public static DescribeVsUpPeakPublishStreamDataResponse unmarshall(DescribeVsUpPeakPublishStreamDataResponse describeVsUpPeakPublishStreamDataResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeVsUpPeakPublishStreamDataResponse.setRequestId(_ctx.stringValue("DescribeVsUpPeakPublishStreamDataResponse.RequestId"));<NEW_LINE>List<DescribeVsUpPeakPublishStreamData> describeVsUpPeakPublishStreamDatas = new ArrayList<DescribeVsUpPeakPublishStreamData>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeVsUpPeakPublishStreamDataResponse.DescribeVsUpPeakPublishStreamDatas.Length"); i++) {<NEW_LINE>DescribeVsUpPeakPublishStreamData describeVsUpPeakPublishStreamData = new DescribeVsUpPeakPublishStreamData();<NEW_LINE>describeVsUpPeakPublishStreamData.setPublishStreamNum(_ctx.integerValue("DescribeVsUpPeakPublishStreamDataResponse.DescribeVsUpPeakPublishStreamDatas[" + i + "].PublishStreamNum"));<NEW_LINE>describeVsUpPeakPublishStreamData.setPeakTime(_ctx.stringValue("DescribeVsUpPeakPublishStreamDataResponse.DescribeVsUpPeakPublishStreamDatas[" + i + "].PeakTime"));<NEW_LINE>describeVsUpPeakPublishStreamData.setQueryTime(_ctx.stringValue<MASK><NEW_LINE>describeVsUpPeakPublishStreamData.setStatName(_ctx.stringValue("DescribeVsUpPeakPublishStreamDataResponse.DescribeVsUpPeakPublishStreamDatas[" + i + "].StatName"));<NEW_LINE>describeVsUpPeakPublishStreamData.setBandWidth(_ctx.stringValue("DescribeVsUpPeakPublishStreamDataResponse.DescribeVsUpPeakPublishStreamDatas[" + i + "].BandWidth"));<NEW_LINE>describeVsUpPeakPublishStreamDatas.add(describeVsUpPeakPublishStreamData);<NEW_LINE>}<NEW_LINE>describeVsUpPeakPublishStreamDataResponse.setDescribeVsUpPeakPublishStreamDatas(describeVsUpPeakPublishStreamDatas);<NEW_LINE>return describeVsUpPeakPublishStreamDataResponse;<NEW_LINE>}
("DescribeVsUpPeakPublishStreamDataResponse.DescribeVsUpPeakPublishStreamDatas[" + i + "].QueryTime"));
1,246,338
final UpdateResponseHeadersPolicyResult executeUpdateResponseHeadersPolicy(UpdateResponseHeadersPolicyRequest updateResponseHeadersPolicyRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateResponseHeadersPolicyRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateResponseHeadersPolicyRequest> request = null;<NEW_LINE>Response<UpdateResponseHeadersPolicyResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateResponseHeadersPolicyRequestMarshaller().marshall(super.beforeMarshalling(updateResponseHeadersPolicyRequest));<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, "CloudFront");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateResponseHeadersPolicy");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<UpdateResponseHeadersPolicyResult> responseHandler = new StaxResponseHandler<UpdateResponseHeadersPolicyResult>(new UpdateResponseHeadersPolicyResultStaxUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
invoke(request, responseHandler, executionContext);
1,664,172
public Mono<Response<FunctionSecretsInner>> listSyncFunctionTriggersWithResponseAsync(String resourceGroupName, String name) {<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.<MASK><NEW_LINE>}<NEW_LINE>if (name == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>return FluxUtil.withContext(context -> service.listSyncFunctionTriggers(this.client.getEndpoint(), resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)).contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));<NEW_LINE>}
error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
706,308
public static void translateCxxPlatformFlags(CxxPlatform.Builder cxxPlatformBuilder, CxxPlatform cxxPlatform, ImmutableMap<String, Arg> flagMacros) {<NEW_LINE>Function<Arg, Arg> translateFunction = new CxxFlags.TranslateMacrosArgsFunction(ImmutableSortedMap.copyOf(flagMacros));<NEW_LINE>Function<ImmutableList<Arg>, ImmutableList<Arg>> expandMacros = flags -> flags.stream().map(translateFunction).collect(ImmutableList.toImmutableList());<NEW_LINE>cxxPlatformBuilder.setAsflags(expandMacros.apply(cxxPlatform.getAsflags()));<NEW_LINE>cxxPlatformBuilder.setAsppflags(expandMacros.apply(cxxPlatform.getAsppflags()));<NEW_LINE>cxxPlatformBuilder.setCflags(expandMacros.apply(cxxPlatform.getCflags()));<NEW_LINE>cxxPlatformBuilder.setCxxflags(expandMacros.apply<MASK><NEW_LINE>cxxPlatformBuilder.setCppflags(expandMacros.apply(cxxPlatform.getCppflags()));<NEW_LINE>cxxPlatformBuilder.setCxxppflags(expandMacros.apply(cxxPlatform.getCxxppflags()));<NEW_LINE>cxxPlatformBuilder.setCudappflags(expandMacros.apply(cxxPlatform.getCudappflags()));<NEW_LINE>cxxPlatformBuilder.setCudaflags(expandMacros.apply(cxxPlatform.getCudaflags()));<NEW_LINE>cxxPlatformBuilder.setHipppflags(expandMacros.apply(cxxPlatform.getHipppflags()));<NEW_LINE>cxxPlatformBuilder.setHipflags(expandMacros.apply(cxxPlatform.getHipflags()));<NEW_LINE>cxxPlatformBuilder.setAsmppflags(expandMacros.apply(cxxPlatform.getAsmppflags()));<NEW_LINE>cxxPlatformBuilder.setAsmflags(expandMacros.apply(cxxPlatform.getAsmflags()));<NEW_LINE>cxxPlatformBuilder.setLdflags(expandMacros.apply(cxxPlatform.getLdflags()));<NEW_LINE>cxxPlatformBuilder.setStripFlags(expandMacros.apply(cxxPlatform.getStripFlags()));<NEW_LINE>cxxPlatformBuilder.setArflags(expandMacros.apply(cxxPlatform.getArflags()));<NEW_LINE>cxxPlatformBuilder.setRanlibflags(expandMacros.apply(cxxPlatform.getRanlibflags()));<NEW_LINE>}
(cxxPlatform.getCxxflags()));
780,989
private boolean pushItems(GlowBlock block, HopperEntity hopper) {<NEW_LINE>if (hopper.getInventory() == null || hopper.getInventory().getContents().length == 0) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>GlowBlock target = block.getRelative(((Hopper) block.getState().getData()).getFacing());<NEW_LINE>if (target.getType() != null && target.getBlockEntity() instanceof ContainerEntity) {<NEW_LINE>if (target.getState() instanceof GlowHopper) {<NEW_LINE>if (((Hopper) block.getState().getData()).getFacing() == BlockFace.DOWN) {<NEW_LINE>// If the hopper is facing downwards, the target hopper can do the pulling task<NEW_LINE>// itself<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ItemStack item = getFirstItem(hopper);<NEW_LINE>if (item == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>ItemStack clone = item.clone();<NEW_LINE>clone.setAmount(1);<NEW_LINE>if (((ContainerEntity) target.getBlockEntity()).getInventory().addItem(clone).size() > 0) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (item.getAmount() - 1 == 0) {<NEW_LINE>hopper.<MASK><NEW_LINE>} else {<NEW_LINE>item.setAmount(item.getAmount() - 1);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
getInventory().remove(item);
271,901
private void removeFromStereotypes(String annotationType, Map<String, Map<CharSequence, Object>> declaredAnnotations) {<NEW_LINE>if (annotationsByStereotype != null) {<NEW_LINE>final Iterator<Map.Entry<String, List<String>>> i = annotationsByStereotype.entrySet().iterator();<NEW_LINE>Set<String> toBeRemoved = CollectionUtils.setOf(annotationType);<NEW_LINE>while (i.hasNext()) {<NEW_LINE>final Map.Entry<String, List<String>> entry = i.next();<NEW_LINE>final String stereotypeName = entry.getKey();<NEW_LINE>final List<String> value = entry.getValue();<NEW_LINE>if (value.removeAll(toBeRemoved)) {<NEW_LINE>if (value.isEmpty()) {<NEW_LINE>toBeRemoved.add(stereotypeName);<NEW_LINE>i.remove();<NEW_LINE>if (allStereotypes != null) {<NEW_LINE>this.allStereotypes.remove(stereotypeName);<NEW_LINE>}<NEW_LINE>if (declaredStereotypes != null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (annotationDefaultValues != null) {<NEW_LINE>annotationDefaultValues.remove(stereotypeName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (AnnotationUtil.ANN_AROUND.equals(stereotypeName) || AnnotationUtil.ANN_INTRODUCTION.equals(stereotypeName) || AnnotationUtil.ANN_AROUND_CONSTRUCT.equals(stereotypeName)) {<NEW_LINE>// purge from interceptor binding<NEW_LINE>purgeInterceptorBindings(declaredAnnotations, toBeRemoved);<NEW_LINE>purgeInterceptorBindings(this.allAnnotations, toBeRemoved);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
this.declaredStereotypes.remove(stereotypeName);
1,075,398
protected void init(double[] x, double[] y) {<NEW_LINE>if (x.length != y.length) {<NEW_LINE>// Arrays must have the same length<NEW_LINE>// TODO log something<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (x.length < 2) {<NEW_LINE>// Spline edges must have at least two points<NEW_LINE>// TODO log something<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>t = new double[x.length];<NEW_LINE>// start point is always 0.0<NEW_LINE>t[0] = 0.0;<NEW_LINE>length = 0.0;<NEW_LINE>// Calculate the partial proportions of each section between each set<NEW_LINE>// of points and the total length of sum of all sections<NEW_LINE>for (int i = 1; i < t.length; i++) {<NEW_LINE>double lx = x[i] - x[i - 1];<NEW_LINE>double ly = y[i] - y[i - 1];<NEW_LINE>// If either diff is zero there is no point performing the square root<NEW_LINE>if (0.0 == lx) {<NEW_LINE>t[i] = Math.abs(ly);<NEW_LINE>} else if (0.0 == ly) {<NEW_LINE>t[i] = Math.abs(lx);<NEW_LINE>} else {<NEW_LINE>t[i] = Math.sqrt(lx * lx + ly * ly);<NEW_LINE>}<NEW_LINE>length += t[i];<NEW_LINE>t[i] += t[i - 1];<NEW_LINE>}<NEW_LINE>for (int j = 1; j < (t.length) - 1; j++) {<NEW_LINE>t[j] = t[j] / length;<NEW_LINE>}<NEW_LINE>// end point is always 1.0<NEW_LINE>t[(t<MASK><NEW_LINE>splineX = new mxSpline1D(t, x);<NEW_LINE>splineY = new mxSpline1D(t, y);<NEW_LINE>}
.length) - 1] = 1.0;
1,233,525
private void checkProperties(Map<String, String> properties) throws AnalysisException {<NEW_LINE>this.columnSeparator = PropertyAnalyzer.analyzeColumnSeparator(properties, ExportStmt.DEFAULT_COLUMN_SEPARATOR);<NEW_LINE>this.columnSeparator = <MASK><NEW_LINE>this.rowDelimiter = PropertyAnalyzer.analyzeRowDelimiter(properties, ExportStmt.DEFAULT_LINE_DELIMITER);<NEW_LINE>this.rowDelimiter = Delimiter.convertDelimiter(this.rowDelimiter);<NEW_LINE>// exec_mem_limit<NEW_LINE>if (properties.containsKey(LoadStmt.LOAD_MEM_LIMIT)) {<NEW_LINE>try {<NEW_LINE>Long.parseLong(properties.get(LoadStmt.LOAD_MEM_LIMIT));<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>throw new AnalysisException("Invalid exec_mem_limit value: " + e.getMessage());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// use session variables<NEW_LINE>properties.put(LoadStmt.LOAD_MEM_LIMIT, String.valueOf(ConnectContext.get().getSessionVariable().getMaxExecMemByte()));<NEW_LINE>}<NEW_LINE>// timeout<NEW_LINE>if (properties.containsKey(LoadStmt.TIMEOUT_PROPERTY)) {<NEW_LINE>try {<NEW_LINE>Long.parseLong(properties.get(LoadStmt.TIMEOUT_PROPERTY));<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>throw new AnalysisException("Invalid timeout value: " + e.getMessage());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// use session variables<NEW_LINE>properties.put(LoadStmt.TIMEOUT_PROPERTY, String.valueOf(Config.export_task_default_timeout_second));<NEW_LINE>}<NEW_LINE>// include query id<NEW_LINE>if (properties.containsKey(INCLUDE_QUERY_ID_PROP)) {<NEW_LINE>String includeQueryIdStr = properties.get(INCLUDE_QUERY_ID_PROP);<NEW_LINE>if (!includeQueryIdStr.equalsIgnoreCase("true") && !includeQueryIdStr.equalsIgnoreCase("false")) {<NEW_LINE>throw new AnalysisException("Invalid include query id value: " + includeQueryIdStr);<NEW_LINE>}<NEW_LINE>includeQueryId = Boolean.parseBoolean(properties.get(INCLUDE_QUERY_ID_PROP));<NEW_LINE>}<NEW_LINE>}
Delimiter.convertDelimiter(this.columnSeparator);
297,096
public void testSecurityContextPropagatesWSSubjectCreatedByApp() throws Exception {<NEW_LINE>Subject subject = new Subject();<NEW_LINE>subject.setReadOnly();<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>CompletableFuture<Subject> cf = (//<NEW_LINE>CompletableFuture<Subject>) //<NEW_LINE>WSSubject.doAs(subject, (PrivilegedExceptionAction<CompletableFuture<Subject>>) () -> {<NEW_LINE>// verify that it works before we try propagating it<NEW_LINE>assertSame(subject, WSSubject.getRunAsSubject());<NEW_LINE>assertSame(subject, WSSubject.getCallerSubject());<NEW_LINE>Subject s = Subject.getSubject(AccessController.getContext());<NEW_LINE>assertTrue(s.isReadOnly());<NEW_LINE>assertSame(subject, s);<NEW_LINE>return securityContextExecutor.supplyAsync(() -> {<NEW_LINE>try {<NEW_LINE>assertSame(subject, WSSubject.getRunAsSubject());<NEW_LINE>assertSame(subject, WSSubject.getCallerSubject());<NEW_LINE>} catch (WSSecurityException x) {<NEW_LINE>throw new CompletionException(x);<NEW_LINE>}<NEW_LINE>Subject sub = Subject.<MASK><NEW_LINE>// assertTrue(sub.isReadOnly()); // TODO fails - Subject from AccessControlContext is null<NEW_LINE>return sub;<NEW_LINE>});<NEW_LINE>}, // also set caller subject<NEW_LINE>true);<NEW_LINE>Subject subjectFromAsyncThread = cf.get(TIMEOUT_NS, TimeUnit.NANOSECONDS);<NEW_LINE>// TODO assertSame(subject, subjectFromAsyncThread);<NEW_LINE>}
getSubject(AccessController.getContext());
715,808
protected void assertSnapshotIsolationAllowed(final JsonNode config, final JdbcDatabase database) throws SQLException {<NEW_LINE>final List<JsonNode> queryResponse = database.unsafeQuery(connection -> {<NEW_LINE>final String sql = "SELECT name, snapshot_isolation_state FROM sys.databases WHERE name = ?";<NEW_LINE>final PreparedStatement <MASK><NEW_LINE>ps.setString(1, config.get("database").asText());<NEW_LINE>LOGGER.info(String.format("Checking that snapshot isolation is enabled on database '%s' using the query: '%s'", config.get("database").asText(), sql));<NEW_LINE>return ps;<NEW_LINE>}, sourceOperations::rowToJson).collect(toList());<NEW_LINE>if (queryResponse.size() < 1) {<NEW_LINE>throw new RuntimeException(String.format("Couldn't find '%s' in sys.databases table. Please check the spelling and that the user has relevant permissions (see docs).", config.get("database").asText()));<NEW_LINE>}<NEW_LINE>if (queryResponse.get(0).get("snapshot_isolation_state").asInt() != 1) {<NEW_LINE>throw new RuntimeException(String.format("Detected that snapshot isolation is not enabled for database '%s'. MSSQL CDC relies on snapshot isolation. " + "Please check the documentation on how to enable snapshot isolation on MS SQL Server.", config.get("database").asText()));<NEW_LINE>}<NEW_LINE>}
ps = connection.prepareStatement(sql);
603,613
private void parseTypeNode(CanInclude include, int i, JsonNode typeNode) throws QueryException {<NEW_LINE>String identifier = i == -1 ? "type" : "\\types\"[" + i + "]";<NEW_LINE>if (typeNode.isTextual()) {<NEW_LINE>EClass eClass = packageMetaData.getEClassIncludingDependencies(typeNode.asText());<NEW_LINE>if (eClass == null) {<NEW_LINE>throw new QueryException("Type " + typeNode.asText() + " not found");<NEW_LINE>}<NEW_LINE>include.addType(eClass, false);<NEW_LINE>} else if (typeNode.isObject()) {<NEW_LINE>if (!typeNode.has("name")) {<NEW_LINE>throw new QueryException(identifier + " object must have a \"name\" property");<NEW_LINE>}<NEW_LINE>EClass eClass = packageMetaData.getEClassIncludingDependencies(typeNode.get("name").asText());<NEW_LINE>Set<EClass> excludes = null;<NEW_LINE>if (typeNode.has("exclude")) {<NEW_LINE>if (!typeNode.get("exclude").isArray()) {<NEW_LINE>throw new QueryException("\"exclude\" must be an array");<NEW_LINE>}<NEW_LINE>excludes = new LinkedHashSet<>();<NEW_LINE>ArrayNode excludeNodes = (ArrayNode) typeNode.get("exclude");<NEW_LINE>for (JsonNode excludeNode : excludeNodes) {<NEW_LINE>excludes.add(packageMetaData.getEClassIncludingDependencies<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>include.addType(eClass, typeNode.has("includeAllSubTypes") ? typeNode.get("includeAllSubTypes").asBoolean() : false, excludes);<NEW_LINE>Iterator<String> fieldNames = typeNode.fieldNames();<NEW_LINE>while (fieldNames.hasNext()) {<NEW_LINE>String fieldName = fieldNames.next();<NEW_LINE>if (!fieldName.equals("name") && !fieldName.equals("includeAllSubTypes") && !fieldName.equals("exclude")) {<NEW_LINE>throw new QueryException(identifier + " object cannot contain \"" + fieldName + "\" field");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new QueryException(identifier + " field must be of type string or of type object, is " + typeNode.toString());<NEW_LINE>}<NEW_LINE>}
(excludeNode.asText()));
15,839
private void saveFilter() {<NEW_LINE>final OsmandApplication app = getMyApplication();<NEW_LINE>AlertDialog.Builder builder = new AlertDialog.Builder(getContext());<NEW_LINE>builder.setTitle(R.string.access_hint_enter_name);<NEW_LINE>final EditText editText = new EditText(getContext());<NEW_LINE>editText.setHint(R.string.new_filter);<NEW_LINE>editText.setText(filter.getName());<NEW_LINE>final TextView textView = new TextView(getContext());<NEW_LINE>textView.setText(app.getString(R.string.new_filter_desc));<NEW_LINE>textView.setTextAppearance(getContext(), R.style.TextAppearance_ContextMenuSubtitle);<NEW_LINE>LinearLayout ll <MASK><NEW_LINE>ll.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT));<NEW_LINE>ll.setOrientation(LinearLayout.VERTICAL);<NEW_LINE>ll.setPadding(AndroidUtils.dpToPx(getContext(), 20f), AndroidUtils.dpToPx(getContext(), 12f), AndroidUtils.dpToPx(getContext(), 20f), AndroidUtils.dpToPx(getContext(), 12f));<NEW_LINE>ll.addView(editText, new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT));<NEW_LINE>textView.setPadding(AndroidUtils.dpToPx(getContext(), 4f), AndroidUtils.dpToPx(getContext(), 6f), AndroidUtils.dpToPx(getContext(), 4f), AndroidUtils.dpToPx(getContext(), 4f));<NEW_LINE>ll.addView(textView, new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT));<NEW_LINE>builder.setView(ll);<NEW_LINE>builder.setNegativeButton(R.string.shared_string_cancel, null);<NEW_LINE>builder.setPositiveButton(R.string.shared_string_save, new DialogInterface.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(DialogInterface dialog, int which) {<NEW_LINE>String filterName = editText.getText().toString();<NEW_LINE>PoiUIFilter nFilter = new PoiUIFilter(filterName, null, filter.getAcceptedTypes(), app);<NEW_LINE>applyFilterFields();<NEW_LINE>if (!Algorithms.isEmpty(filter.getFilterByName())) {<NEW_LINE>nFilter.setSavedFilterByName(filter.getFilterByName());<NEW_LINE>}<NEW_LINE>if (app.getPoiFilters().createPoiFilter(nFilter, false)) {<NEW_LINE>Toast.makeText(getContext(), getContext().getString(R.string.edit_filter_create_message, filterName), Toast.LENGTH_SHORT).show();<NEW_LINE>app.getSearchUICore().refreshCustomPoiFilters();<NEW_LINE>((QuickSearchDialogFragment) getParentFragment()).replaceQueryWithUiFilter(nFilter, "");<NEW_LINE>((QuickSearchDialogFragment) getParentFragment()).reloadCategories();<NEW_LINE>QuickSearchPoiFilterFragment.this.dismiss();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>builder.create().show();<NEW_LINE>}
= new LinearLayout(getContext());
1,783,601
public static WSStackVersion parseVersion(String version) {<NEW_LINE>int major = 0;<NEW_LINE>int minor = 0;<NEW_LINE>int micro = 0;<NEW_LINE>int update = 0;<NEW_LINE>int tokenPosition = 0;<NEW_LINE>// NOI18N<NEW_LINE>StringTokenizer versionTokens = new StringTokenizer(version, ".");<NEW_LINE>List<Integer> versionNumbers = new ArrayList<Integer>();<NEW_LINE>while (versionTokens.hasMoreTokens()) {<NEW_LINE>versionNumbers.add(valueOf(versionTokens.nextToken().trim()));<NEW_LINE>}<NEW_LINE>switch(versionNumbers.size()) {<NEW_LINE>case 0:<NEW_LINE>{<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case 1:<NEW_LINE>{<NEW_LINE>major = versionNumbers.get(0);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case 2:<NEW_LINE>{<NEW_LINE>major = versionNumbers.get(0);<NEW_LINE>minor = versionNumbers.get(1);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case 3:<NEW_LINE>{<NEW_LINE>major = versionNumbers.get(0);<NEW_LINE><MASK><NEW_LINE>micro = versionNumbers.get(2);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>default:<NEW_LINE>{<NEW_LINE>major = versionNumbers.get(0);<NEW_LINE>minor = versionNumbers.get(1);<NEW_LINE>micro = versionNumbers.get(2);<NEW_LINE>update = versionNumbers.get(3);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return WSStackVersion.valueOf(major, minor, micro, update);<NEW_LINE>}
minor = versionNumbers.get(1);
442,430
private void pushMessageInternel(PushMessage pushMessage, String deviceId, String pushContent) {<NEW_LINE>if (pushMessage.pushMessageType == PushMessageType.PUSH_MESSAGE_TYPE_NORMAL && StringUtil.isNullOrEmpty(pushContent)) {<NEW_LINE>LOG.info("push content empty, deviceId {}", deviceId);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>MemorySessionStore.Session session = sessionsStore.getSession(deviceId);<NEW_LINE>int badge = session.getUnReceivedMsgs();<NEW_LINE>if (badge <= 0) {<NEW_LINE>badge = 1;<NEW_LINE>}<NEW_LINE>if (StringUtil.isNullOrEmpty(session.getDeviceToken())) {<NEW_LINE><MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>pushMessage.packageName = session.getAppName();<NEW_LINE>pushMessage.pushType = session.getPushType();<NEW_LINE>pushMessage.pushContent = pushContent;<NEW_LINE>pushMessage.deviceToken = session.getDeviceToken();<NEW_LINE>pushMessage.unReceivedMsg = badge;<NEW_LINE>pushMessage.userId = session.getUsername();<NEW_LINE>if (session.getPlatform() == ProtoConstants.Platform.Platform_iOS || session.getPlatform() == ProtoConstants.Platform.Platform_Android) {<NEW_LINE>String url = androidPushServerUrl;<NEW_LINE>if (session.getPlatform() == ProtoConstants.Platform.Platform_iOS) {<NEW_LINE>url = iOSPushServerUrl;<NEW_LINE>pushMessage.voipDeviceToken = session.getVoipDeviceToken();<NEW_LINE>}<NEW_LINE>HttpUtils.httpJsonPost(url, new Gson().toJson(pushMessage, pushMessage.getClass()), POST_TYPE_Push);<NEW_LINE>} else {<NEW_LINE>LOG.info("Not mobile platform {}", session.getPlatform());<NEW_LINE>}<NEW_LINE>}
LOG.warn("Device token is empty for device {}", deviceId);
1,080,502
public void apply(final Project project) {<NEW_LINE>final TaskContainer tasks = project.getTasks();<NEW_LINE>// static classes are used for the actions to avoid implicitly dragging project/tasks into the model registry<NEW_LINE>String projectName = project.toString();<NEW_LINE>tasks.register(ProjectInternal.HELP_TASK, Help.class, new HelpAction());<NEW_LINE>tasks.register(ProjectInternal.PROJECTS_TASK, ProjectReportTask.class, new ProjectReportTaskAction(projectName));<NEW_LINE>tasks.register(ProjectInternal.TASKS_TASK, TaskReportTask.class, new TaskReportTaskAction(projectName, project.getChildProjects().isEmpty()));<NEW_LINE>tasks.register(PROPERTIES_TASK, PropertyReportTask.class, new PropertyReportTaskAction(projectName));<NEW_LINE>tasks.register(DEPENDENCY_INSIGHT_TASK, DependencyInsightReportTask.class, new DependencyInsightReportTaskAction(projectName));<NEW_LINE>tasks.register(DEPENDENCIES_TASK, DependencyReportTask.<MASK><NEW_LINE>tasks.register(BuildEnvironmentReportTask.TASK_NAME, BuildEnvironmentReportTask.class, new BuildEnvironmentReportTaskAction(projectName));<NEW_LINE>registerDeprecatedTasks(tasks, projectName);<NEW_LINE>tasks.register(OUTGOING_VARIANTS_TASK, OutgoingVariantsReportTask.class, task -> {<NEW_LINE>task.setDescription("Displays the outgoing variants of " + projectName + ".");<NEW_LINE>task.setGroup(HELP_GROUP);<NEW_LINE>task.setImpliesSubProjects(true);<NEW_LINE>task.getShowAll().convention(false);<NEW_LINE>});<NEW_LINE>tasks.register(RESOLVABLE_CONFIGURATIONS_TASK, ResolvableConfigurationsReportTask.class, task -> {<NEW_LINE>task.setDescription("Displays the configurations that can be resolved in " + projectName + ".");<NEW_LINE>task.setGroup(HELP_GROUP);<NEW_LINE>task.setImpliesSubProjects(true);<NEW_LINE>task.getShowAll().convention(false);<NEW_LINE>task.getRecursive().convention(false);<NEW_LINE>});<NEW_LINE>tasks.withType(TaskReportTask.class).configureEach(task -> {<NEW_LINE>task.getShowTypes().convention(false);<NEW_LINE>});<NEW_LINE>}
class, new DependencyReportTaskAction(projectName));
903,870
public Result implement(EnumerableRelImplementor implementor, Prefer pref) {<NEW_LINE>final BlockBuilder builder = new BlockBuilder();<NEW_LINE>final Result leftResult = implementor.visitChild(this, 0<MASK><NEW_LINE>Expression leftExpression = builder.append("left", leftResult.block);<NEW_LINE>final BlockBuilder corrBlock = new BlockBuilder();<NEW_LINE>Type corrVarType = leftResult.physType.getJavaRowType();<NEW_LINE>// correlate to be used in inner loop<NEW_LINE>ParameterExpression corrRef;<NEW_LINE>// argument to correlate lambda (must be boxed)<NEW_LINE>ParameterExpression corrArg;<NEW_LINE>if (!Primitive.is(corrVarType)) {<NEW_LINE>corrArg = Expressions.parameter(Modifier.FINAL, corrVarType, getCorrelVariable());<NEW_LINE>corrRef = corrArg;<NEW_LINE>} else {<NEW_LINE>corrArg = Expressions.parameter(Modifier.FINAL, Primitive.box(corrVarType), "$box" + getCorrelVariable());<NEW_LINE>corrRef = (ParameterExpression) corrBlock.append(getCorrelVariable(), Expressions.unbox(corrArg));<NEW_LINE>}<NEW_LINE>implementor.registerCorrelVariable(getCorrelVariable(), corrRef, corrBlock, leftResult.physType);<NEW_LINE>final Result rightResult = implementor.visitChild(this, 1, (EnumerableRel) right, pref);<NEW_LINE>implementor.clearCorrelVariable(getCorrelVariable());<NEW_LINE>corrBlock.add(rightResult.block);<NEW_LINE>final PhysType physType = PhysTypeImpl.of(implementor.getTypeFactory(), getRowType(), pref.prefer(JavaRowFormat.CUSTOM));<NEW_LINE>Expression selector = EnumUtils.joinSelector(joinType, physType, ImmutableList.of(leftResult.physType, rightResult.physType));<NEW_LINE>builder.append(Expressions.call(leftExpression, BuiltInMethod.CORRELATE_JOIN.method, Expressions.constant(EnumUtils.toLinq4jJoinType(joinType)), Expressions.lambda(corrBlock.toBlock(), corrArg), selector));<NEW_LINE>return implementor.result(physType, builder.toBlock());<NEW_LINE>}
, (EnumerableRel) left, pref);
932,827
public static void systemShare(Context context, File file) {<NEW_LINE>if (file == null || !file.exists()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Intent intent = new Intent(Intent.ACTION_SEND);<NEW_LINE>intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);<NEW_LINE>intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);<NEW_LINE>Uri uri;<NEW_LINE>try {<NEW_LINE>uri = FileProvider.getUriForFile(context, context.getPackageName() + ".debugfileprovider", file);<NEW_LINE>String type = context.getContentResolver().getType(uri);<NEW_LINE>intent.setDataAndType(uri, type);<NEW_LINE>intent.putExtra(Intent.EXTRA_STREAM, uri);<NEW_LINE>if (intent.resolveActivity(context.getPackageManager()) == null) {<NEW_LINE>intent.setDataAndType(uri, "*/*");<NEW_LINE>}<NEW_LINE>context.startActivity(intent);<NEW_LINE>} catch (Exception e) {<NEW_LINE>LogHelper.e(TAG, <MASK><NEW_LINE>}<NEW_LINE>}
"The selected file can't be shared: " + file.toString());
1,359,200
/* (non-Javadoc)<NEW_LINE>* @see javax.servlet.http.HttpServlet#service(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {<NEW_LINE>// NOSONAR<NEW_LINE>String method = request.getMethod().toUpperCase();<NEW_LINE>String path = request.getServletPath() + request.getPathInfo();<NEW_LINE>if (path == null || path.endsWith("/")) {<NEW_LINE>// serve folder listing<NEW_LINE>response.setStatus(HttpServletResponse.SC_OK);<NEW_LINE>response.getWriter().close();<NEW_LINE>} else {<NEW_LINE>// lookup the resource<NEW_LINE>URL url = this.findResource(path);<NEW_LINE>if (url != null && method.matches("GET|HEAD")) {<NEW_LINE>InputStream is = null;<NEW_LINE>try {<NEW_LINE>URLConnection conn = url.openConnection();<NEW_LINE>conn.connect();<NEW_LINE>is = conn.getInputStream();<NEW_LINE><MASK><NEW_LINE>if ("GET".equals(method)) {<NEW_LINE>OutputStream os = response.getOutputStream();<NEW_LINE>IOUtils.copyLarge(is, os);<NEW_LINE>os.flush();<NEW_LINE>os.close();<NEW_LINE>}<NEW_LINE>response.setStatus(HttpServletResponse.SC_OK);<NEW_LINE>this.log("[200] " + request.getRequestURI());<NEW_LINE>} finally {<NEW_LINE>IOUtils.closeQuietly(is);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>response.setStatus(HttpServletResponse.SC_NOT_FOUND);<NEW_LINE>this.log("[404] " + request.getRequestURI());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
this.prepareResponse(response, conn);
1,484,560
public void run(RegressionEnvironment env) {<NEW_LINE>String[] fields = new String[] { "theString" };<NEW_LINE><MASK><NEW_LINE>env.compileDeploy(epl).addListener("s0");<NEW_LINE>env.sendEventBean(new SupportBean("E1", 1));<NEW_LINE>env.assertPropsPerRowIRPairFlattened("s0", fields, new Object[][] { { "E1" } }, null);<NEW_LINE>env.sendEventBean(new SupportBean("E2", 8));<NEW_LINE>env.assertPropsPerRowIRPairFlattened("s0", fields, new Object[][] { { "E2" } }, null);<NEW_LINE>env.milestone(0);<NEW_LINE>env.sendEventBean(new SupportBean_A("E2"));<NEW_LINE>env.assertPropsPerRowIRPairFlattened("s0", fields, null, new Object[][] { { "E2" } });<NEW_LINE>env.sendEventBean(new SupportBean("E3", 7));<NEW_LINE>env.assertPropsPerRowIRPairFlattened("s0", fields, new Object[][] { { "E3" } }, null);<NEW_LINE>env.sendEventBean(new SupportBean("E4", 2));<NEW_LINE>env.assertPropsPerRowIRPairFlattened("s0", fields, new Object[][] { { "E4" } }, new Object[][] { { "E1" } });<NEW_LINE>env.undeployAll();<NEW_LINE>}
String epl = "@name('s0') create window NW#expr(sum(intPrimitive) < 10) as SupportBean;\n" + "insert into NW select * from SupportBean;\n" + "on SupportBean_A delete from NW where theString = id;\n";
1,019,247
public static String parseKeyStroke(KeyStroke keyStroke) {<NEW_LINE>if (keyStroke == null) {<NEW_LINE>return "";<NEW_LINE>}<NEW_LINE>final String keyPressSuffix = "-P";<NEW_LINE>String keyString = keyStroke.toString();<NEW_LINE>int type = keyStroke.getKeyEventType();<NEW_LINE>if (type == KeyEvent.KEY_TYPED) {<NEW_LINE>return String.valueOf(keyStroke.getKeyChar());<NEW_LINE>}<NEW_LINE>// get the character used in the key stroke<NEW_LINE>int firstIndex = keyString.lastIndexOf(' ') + 1;<NEW_LINE>int ctrlIndex = indexOf(keyString, CTRL, firstIndex);<NEW_LINE>if (ctrlIndex >= 0) {<NEW_LINE>firstIndex = ctrlIndex + CTRL.length();<NEW_LINE>}<NEW_LINE>int altIndex = indexOf(keyString, ALT, firstIndex);<NEW_LINE>if (altIndex >= 0) {<NEW_LINE>firstIndex = altIndex + ALT.length();<NEW_LINE>}<NEW_LINE>int shiftIndex = indexOf(keyString, SHIFT, firstIndex);<NEW_LINE>if (shiftIndex >= 0) {<NEW_LINE>firstIndex = shiftIndex + SHIFT.length();<NEW_LINE>}<NEW_LINE>int metaIndex = indexOf(keyString, META, firstIndex);<NEW_LINE>if (metaIndex >= 0) {<NEW_LINE>firstIndex = metaIndex + META.length();<NEW_LINE>}<NEW_LINE>int lastIndex = keyString.length();<NEW_LINE>if (keyString.endsWith(keyPressSuffix)) {<NEW_LINE>lastIndex -= keyPressSuffix.length();<NEW_LINE>}<NEW_LINE>if (lastIndex >= 0) {<NEW_LINE>keyString = keyString.substring(firstIndex, lastIndex);<NEW_LINE>}<NEW_LINE>int modifiers = keyStroke.getModifiers();<NEW_LINE>StringBuilder buffy = new StringBuilder();<NEW_LINE>if (isShift(modifiers)) {<NEW_LINE>buffy.insert(0, SHIFT + MODIFIER_SEPARATOR);<NEW_LINE>keyString = removeIgnoreCase(keyString, SHIFT);<NEW_LINE>}<NEW_LINE>if (isAlt(modifiers)) {<NEW_LINE>buffy.<MASK><NEW_LINE>keyString = removeIgnoreCase(keyString, ALT);<NEW_LINE>}<NEW_LINE>if (isControl(modifiers)) {<NEW_LINE>buffy.insert(0, CTRL + MODIFIER_SEPARATOR);<NEW_LINE>keyString = removeIgnoreCase(keyString, CONTROL);<NEW_LINE>}<NEW_LINE>if (isMeta(modifiers)) {<NEW_LINE>buffy.insert(0, META + MODIFIER_SEPARATOR);<NEW_LINE>keyString = removeIgnoreCase(keyString, META);<NEW_LINE>}<NEW_LINE>buffy.append(keyString);<NEW_LINE>String text = buffy.toString().trim();<NEW_LINE>if (text.endsWith(MODIFIER_SEPARATOR)) {<NEW_LINE>text = text.substring(0, text.length() - 1);<NEW_LINE>}<NEW_LINE>return text;<NEW_LINE>}
insert(0, ALT + MODIFIER_SEPARATOR);
1,636,442
public static Pair<GutterIconRenderer, Object> findSelectedBreakpoint(@Nonnull final Project project, @Nonnull final Editor editor) {<NEW_LINE>int offset = editor.getCaretModel().getOffset();<NEW_LINE>Document editorDocument = editor.getDocument();<NEW_LINE>List<DebuggerSupport<MASK><NEW_LINE>for (DebuggerSupport debuggerSupport : debuggerSupports) {<NEW_LINE>final BreakpointPanelProvider<?> provider = debuggerSupport.getBreakpointPanelProvider();<NEW_LINE>final int textLength = editor.getDocument().getTextLength();<NEW_LINE>if (offset > textLength) {<NEW_LINE>offset = textLength;<NEW_LINE>}<NEW_LINE>Object breakpoint = provider.findBreakpoint(project, editorDocument, offset);<NEW_LINE>if (breakpoint != null) {<NEW_LINE>final GutterIconRenderer iconRenderer = provider.getBreakpointGutterIconRenderer(breakpoint);<NEW_LINE>return Pair.create(iconRenderer, breakpoint);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Pair.create(null, null);<NEW_LINE>}
> debuggerSupports = DebuggerSupport.getDebuggerSupports();
1,487,340
protected void consumeLambdaExpression() {<NEW_LINE>// LambdaExpression ::= LambdaHeader LambdaBody<NEW_LINE>this.nestedType--;<NEW_LINE>// pop length for LambdaBody (always 1)<NEW_LINE>this.astLengthPtr--;<NEW_LINE>Statement body = (Statement) this.astStack[this.astPtr--];<NEW_LINE>if (body instanceof Block) {<NEW_LINE>if (this.options.ignoreMethodBodies) {<NEW_LINE>Statement oldBody = body;<NEW_LINE>body = new Block(0);<NEW_LINE>body.sourceStart = oldBody.sourceStart;<NEW_LINE>body.sourceEnd = oldBody.sourceEnd;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>LambdaExpression lexp = (LambdaExpression) this.astStack[this.astPtr--];<NEW_LINE>this.astLengthPtr--;<NEW_LINE>lexp.setBody(body);<NEW_LINE>lexp.sourceEnd = body.sourceEnd;<NEW_LINE>if (body instanceof Expression && ((Expression) body).isTrulyExpression()) {<NEW_LINE>Expression expression = (Expression) body;<NEW_LINE>expression.statementEnd = body.sourceEnd;<NEW_LINE>}<NEW_LINE>if (!this.parsingJava8Plus) {<NEW_LINE>problemReporter().lambdaExpressionsNotBelow18(lexp);<NEW_LINE>}<NEW_LINE>setArgumentsTypeVar(lexp);<NEW_LINE>pushOnExpressionStack(lexp);<NEW_LINE>if (this.currentElement != null) {<NEW_LINE>this.lastCheckPoint = body.sourceEnd + 1;<NEW_LINE>this.currentElement.lambdaNestLevel--;<NEW_LINE>}<NEW_LINE>this.referenceContext.compilationResult().hasFunctionalTypes = true;<NEW_LINE>markEnclosingMemberWithLocalOrFunctionalType(LocalTypeKind.LAMBDA);<NEW_LINE>if (lexp.compilationResult.getCompilationUnit() == null) {<NEW_LINE>// unit built out of model. Stash a textual representation of lambda to enable LE.copy().<NEW_LINE>int length = lexp.sourceEnd - lexp.sourceStart + 1;<NEW_LINE>System.arraycopy(this.scanner.getSource(), lexp.sourceStart, lexp.text = new char<MASK><NEW_LINE>}<NEW_LINE>}
[length], 0, length);
203,375
public void runChecks() {<NEW_LINE>if (!ocf.hasEntry(path)) {<NEW_LINE>report.message(MessageId.RSC_001, EPUBLocation.create(this.ocf.getName()), path);<NEW_LINE>} else if (!ocf.canDecrypt(path)) {<NEW_LINE>report.message(MessageId.RSC_004, EPUBLocation.create(this.ocf.getName()), path);<NEW_LINE>} else {<NEW_LINE>InputStream in = null;<NEW_LINE>try {<NEW_LINE>in = ocf.getInputStream(path);<NEW_LINE>if (in == null) {<NEW_LINE>report.message(MessageId.RSC_001, EPUBLocation.create(this.ocf<MASK><NEW_LINE>}<NEW_LINE>byte[] header = new byte[4];<NEW_LINE>int rd = CheckUtil.readBytes(in, header, 0, 4);<NEW_LINE>if (rd < 4) {<NEW_LINE>report.message(MessageId.MED_004, EPUBLocation.create(path));<NEW_LINE>} else {<NEW_LINE>checkHeader(header);<NEW_LINE>}<NEW_LINE>checkImageDimensions(path);<NEW_LINE>} catch (IOException e) {<NEW_LINE>report.message(MessageId.PKG_021, EPUBLocation.create(path, path));<NEW_LINE>} finally {<NEW_LINE>try {<NEW_LINE>if (in != null) {<NEW_LINE>in.close();<NEW_LINE>}<NEW_LINE>} catch (IOException ignored) {<NEW_LINE>// eat it<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.getName()), path);
1,401,027
public Answer execute(final UpgradeSnapshotCommand command, final CitrixResourceBase citrixResourceBase) {<NEW_LINE>final String secondaryStorageUrl = command.getSecondaryStorageUrl();<NEW_LINE>final String backedUpSnapshotUuid = command.getSnapshotUuid();<NEW_LINE>final Long volumeId = command.getVolumeId();<NEW_LINE>final Long accountId = command.getAccountId();<NEW_LINE>final Long templateId = command.getTemplateId();<NEW_LINE>final Long tmpltAcountId = command.getTmpltAccountId();<NEW_LINE>final String version = command.getVersion();<NEW_LINE>if (!version.equals("2.1")) {<NEW_LINE>return new Answer(command, true, "success");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>final Connection conn = citrixResourceBase.getConnection();<NEW_LINE>final URI uri = new URI(secondaryStorageUrl);<NEW_LINE>final String secondaryStorageMountPath = uri.getHost() <MASK><NEW_LINE>final String snapshotPath = secondaryStorageMountPath + "/snapshots/" + accountId + "/" + volumeId + "/" + backedUpSnapshotUuid + ".vhd";<NEW_LINE>final String templatePath = secondaryStorageMountPath + "/template/tmpl/" + tmpltAcountId + "/" + templateId;<NEW_LINE>citrixResourceBase.upgradeSnapshot(conn, templatePath, snapshotPath);<NEW_LINE>return new Answer(command, true, "success");<NEW_LINE>} catch (final Exception e) {<NEW_LINE>final String details = "upgrading snapshot " + backedUpSnapshotUuid + " failed due to " + e.toString();<NEW_LINE>s_logger.error(details, e);<NEW_LINE>}<NEW_LINE>return new Answer(command, false, "failure");<NEW_LINE>}
+ ":" + uri.getPath();
233,541
public static boolean evaluateLogic(Evaluatee source, String logic) {<NEW_LINE>// Conditional<NEW_LINE>StringTokenizer st = new StringTokenizer(logic.trim(), "&|", true);<NEW_LINE>int it = st.countTokens();<NEW_LINE>if (// only uneven arguments<NEW_LINE>((it / 2) - ((it + 1) / 2)) == 0) {<NEW_LINE>s_log.severe("Logic does not comply with format " + "'<expression> [<logic> <expression>]' => " + logic);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>String exprStrand = st.nextToken().trim();<NEW_LINE>if (exprStrand.matches("^@\\d+$")) {<NEW_LINE>exprStrand = exprStrand.concat(st.nextToken());<NEW_LINE>exprStrand = exprStrand.concat(st.nextToken());<NEW_LINE>}<NEW_LINE>// boolean retValue = evaluateLogicTuple(source, st.nextToken());<NEW_LINE>boolean retValue = evaluateLogicTuple(source, exprStrand);<NEW_LINE>while (st.hasMoreTokens()) {<NEW_LINE>String logOp = st.nextToken().trim();<NEW_LINE>// boolean temp = evaluateLogicTuple(source, st.nextToken());<NEW_LINE>exprStrand = st<MASK><NEW_LINE>if (exprStrand.matches("^@\\d+$")) {<NEW_LINE>exprStrand = exprStrand.concat(st.nextToken());<NEW_LINE>exprStrand = exprStrand.concat(st.nextToken());<NEW_LINE>}<NEW_LINE>boolean temp = evaluateLogicTuple(source, exprStrand);<NEW_LINE>if (logOp.equals("&"))<NEW_LINE>retValue = retValue & temp;<NEW_LINE>else if (logOp.equals("|"))<NEW_LINE>retValue = retValue | temp;<NEW_LINE>else {<NEW_LINE>s_log.log(Level.SEVERE, "Logic operant '|' or '&' expected => " + logic);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// hasMoreTokens<NEW_LINE>return retValue;<NEW_LINE>}
.nextToken().trim();
745,744
public void onOpen(Session session, EndpointConfig arg1) {<NEW_LINE>final Session sess = session;<NEW_LINE>session.addMessageHandler(String.class, new MessageHandler.Whole<String>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onMessage(String text) {<NEW_LINE>_wtr.addMessage(text);<NEW_LINE>if (_wtr.limitReached()) {<NEW_LINE>_wtr.terminateClient();<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>String s = _data[_counter++];<NEW_LINE>sess.<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>_wtr.addExceptionAndTerminate("Error publishing msg", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>try {<NEW_LINE>sess.getBasicRemote().sendText(_data[0]);<NEW_LINE>} catch (Exception e) {<NEW_LINE>_wtr.addExceptionAndTerminate("Error publishing initial message", e);<NEW_LINE>}<NEW_LINE>}
getBasicRemote().sendText(s);
167,586
protected STATUS postAbstractInit(final PwmApplication pwmApplication, final DomainID domainID) throws PwmException {<NEW_LINE>try {<NEW_LINE>userCacheService = new ReportRecordLocalDBStorageService();<NEW_LINE>userCacheService.init(this.getPwmApplication(), domainID);<NEW_LINE>} catch (final Exception e) {<NEW_LINE>LOGGER.error(getSessionLabel(), () -> "unable to init cache service");<NEW_LINE>return STATUS.CLOSED;<NEW_LINE>}<NEW_LINE>settings = ReportSettings.readSettingsFromConfig(this.getPwmApplication().getConfig());<NEW_LINE>summaryData = ReportSummaryData.newSummaryData(settings.getTrackDays());<NEW_LINE>dnQueue = LocalDBStoredQueue.createLocalDBStoredQueue(pwmApplication, getPwmApplication().getLocalDB(), LocalDB.DB.REPORT_QUEUE);<NEW_LINE>executorService = PwmScheduler.makeBackgroundExecutor(pwmApplication, this.getClass());<NEW_LINE>if (!pwmApplication.getPwmEnvironment().isInternalRuntimeInstance()) {<NEW_LINE>executorService<MASK><NEW_LINE>}<NEW_LINE>return STATUS.OPEN;<NEW_LINE>}
.submit(new InitializationTask());
1,086,841
public okhttp3.Call connectOptionsNodeProxyWithPathCall(String name, String path, String path2, final ApiCallback _callback) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/api/v1/nodes/{name}/proxy/{path}".replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString())).replaceAll("\\{" + "path" + "\\}", localVarApiClient.escapeString(path.toString()));<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();<NEW_LINE>if (path2 != null) {<NEW_LINE>localVarQueryParams.addAll(localVarApiClient.parameterToPair("path", path2));<NEW_LINE>}<NEW_LINE>Map<String, String> localVarHeaderParams = new <MASK><NEW_LINE>Map<String, String> localVarCookieParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "*/*" };<NEW_LINE>final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null) {<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>}<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>String[] localVarAuthNames = new String[] { "BearerToken" };<NEW_LINE>return localVarApiClient.buildCall(localVarPath, "OPTIONS", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);<NEW_LINE>}
HashMap<String, String>();
1,618,678
private void analyzeField(SootField sf) {<NEW_LINE>// from all bodies get all use boxes and eliminate used fields<NEW_LINE>Iterator classesIt = Scene.v().getApplicationClasses().iterator();<NEW_LINE>while (classesIt.hasNext()) {<NEW_LINE>SootClass appClass = (SootClass) classesIt.next();<NEW_LINE>Iterator mIt = appClass.getMethods().iterator();<NEW_LINE>while (mIt.hasNext()) {<NEW_LINE>SootMethod sm = (SootMethod) mIt.next();<NEW_LINE>if (!sm.hasActiveBody()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (!Scene.v().getReachableMethods().contains(sm)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Body b = sm.getActiveBody();<NEW_LINE>Iterator usesIt = b<MASK><NEW_LINE>while (usesIt.hasNext()) {<NEW_LINE>ValueBox vBox = (ValueBox) usesIt.next();<NEW_LINE>Value v = vBox.getValue();<NEW_LINE>if (v instanceof FieldRef) {<NEW_LINE>FieldRef fieldRef = (FieldRef) v;<NEW_LINE>SootField f = fieldRef.getField();<NEW_LINE>if (f.equals(sf)) {<NEW_LINE>if (Modifier.isPublic(sf.getModifiers())) {<NEW_LINE>if (analyzePublicField(sf, appClass)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} else if (Modifier.isProtected(sf.getModifiers())) {<NEW_LINE>analyzeProtectedField(sf, appClass);<NEW_LINE>} else if (Modifier.isPrivate(sf.getModifiers())) {<NEW_LINE>} else {<NEW_LINE>analyzePackageField(sf, appClass);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.getUseBoxes().iterator();
143,731
public static ZonedDateTime asDateTime(String dateFormat) {<NEW_LINE>// Find the first `-` date separator<NEW_LINE>int <MASK><NEW_LINE>if (separatorIdx == 0) {<NEW_LINE>// first char = `-` denotes a negative year<NEW_LINE>// Find the first `-` date separator past the negative year<NEW_LINE>separatorIdx = dateFormat.indexOf('-', 1);<NEW_LINE>}<NEW_LINE>// Find the second `-` date separator and move 3 places past the dayOfYear to find the time separator<NEW_LINE>// e.g. 2020-06-01T10:20:30....<NEW_LINE>// ^<NEW_LINE>// +3 = ^<NEW_LINE>separatorIdx = dateFormat.indexOf('-', separatorIdx + 1) + 3;<NEW_LINE>// Avoid index out of bounds - it will lead to DateTimeParseException anyways<NEW_LINE>if (separatorIdx >= dateFormat.length() || dateFormat.charAt(separatorIdx) == 'T') {<NEW_LINE>return DateFormatters.from(DATE_OPTIONAL_TIME_FORMATTER_T_LITERAL.parse(dateFormat)).withZoneSameInstant(UTC);<NEW_LINE>} else {<NEW_LINE>return DateFormatters.from(DATE_OPTIONAL_TIME_FORMATTER_WHITESPACE.parse(dateFormat)).withZoneSameInstant(UTC);<NEW_LINE>}<NEW_LINE>}
separatorIdx = dateFormat.indexOf('-');
156,150
public DescribeConnectionsOnInterconnectResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DescribeConnectionsOnInterconnectResult describeConnectionsOnInterconnectResult = new DescribeConnectionsOnInterconnectResult();<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 describeConnectionsOnInterconnectResult;<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("connections", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>describeConnectionsOnInterconnectResult.setConnections(new ListUnmarshaller<Connection>(ConnectionJsonUnmarshaller.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 describeConnectionsOnInterconnectResult;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
659,727
public boolean analyze(Program program, AddressSetView set, TaskMonitor monitor, MessageLog log) throws Exception {<NEW_LINE>OatHeader header = null;<NEW_LINE>try {<NEW_LINE>BinaryReader reader = OatUtilities.getBinaryReader(program);<NEW_LINE>header = OatHeaderFactory.newOatHeader(reader);<NEW_LINE>OatHeaderFactory.parseOatHeader(header, program, reader, monitor, log);<NEW_LINE>} catch (UnsupportedOatVersionException e) {<NEW_LINE>log.appendMsg(e.getMessage());<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>monitor.setMessage("OAT Version: " + header.getVersion());<NEW_LINE>Symbol oatExecSymbol = OatUtilities.getOatExecSymbol(program);<NEW_LINE>if (oatExecSymbol == null) {<NEW_LINE>log.appendMsg("Unable to locate " + OatConstants.SYMBOL_OAT_EXEC + " symbol, skipping...");<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>Address address = oatExecSymbol.getAddress();<NEW_LINE>Symbol oatLastWordSymbol = OatUtilities.getOatLastWordSymbol(program);<NEW_LINE>program.getListing().clearCodeUnits(oatLastWordSymbol.getAddress(), oatLastWordSymbol.getAddress(), true);<NEW_LINE>// TODO adjust start position based on OatHeader values being set, such as "interpreter_to_interpreter_bridge_offset_"<NEW_LINE>monitor.setProgress(0);<NEW_LINE>monitor.setMaximum(oatLastWordSymbol.getAddress().subtract(address));<NEW_LINE>try {<NEW_LINE>while (true) {<NEW_LINE>monitor.checkCanceled();<NEW_LINE>monitor.setProgress(address.subtract(oatExecSymbol.getAddress()));<NEW_LINE>if (oatLastWordSymbol.getAddress().compareTo(address) <= 0) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>ByteProvider provider = new MemoryByteProvider(program.getMemory(), address);<NEW_LINE>BinaryReader reader = new BinaryReader(provider, !program.<MASK><NEW_LINE>OatQuickMethodHeader quickMethodHeader = OatQuickMethodHeaderFactory.getOatQuickMethodHeader(reader, header.getVersion());<NEW_LINE>DataType dataType = quickMethodHeader.toDataType();<NEW_LINE>createData(program, address, dataType);<NEW_LINE>address = address.add(dataType.getLength());<NEW_LINE>// TODO disassemble, restricted to, the CODESIZE amount of bytes.<NEW_LINE>// DisassembleCommand cmd = new DisassembleCommand( address, null, true );<NEW_LINE>// cmd.applyTo( program );<NEW_LINE>// createFunction( program, address );<NEW_LINE>address = address.add(quickMethodHeader.getCodeSize());<NEW_LINE>address = align(address);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.appendMsg(e.getMessage());<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
getLanguage().isBigEndian());
233,369
private void waitOnAllTransitionNames(@NonNull final View to, @NonNull final OnTransitionPreparedListener onTransitionPreparedListener) {<NEW_LINE>OnPreDrawListener onPreDrawListener = new OnPreDrawListener() {<NEW_LINE><NEW_LINE>boolean addedSubviewListeners;<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean onPreDraw() {<NEW_LINE>List<View> foundViews = new ArrayList<>();<NEW_LINE>boolean allViewsFound = true;<NEW_LINE>for (String transitionName : waitForTransitionNames) {<NEW_LINE>View namedView = TransitionUtils.findNamedView(to, transitionName);<NEW_LINE>if (namedView != null) {<NEW_LINE>foundViews.add(TransitionUtils.findNamedView(to, transitionName));<NEW_LINE>} else {<NEW_LINE>allViewsFound = false;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (allViewsFound && !addedSubviewListeners) {<NEW_LINE>addedSubviewListeners = true;<NEW_LINE>waitOnChildTransitionNames(<MASK><NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>to.getViewTreeObserver().addOnPreDrawListener(onPreDrawListener);<NEW_LINE>}
to, foundViews, this, onTransitionPreparedListener);
1,204,828
public void onError(Throwable t) {<NEW_LINE>if (this.done) {<NEW_LINE>logger.debug("Dropped error", t);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final Subscription currentSubscription = this.s;<NEW_LINE>if (currentSubscription == Operators.cancelledSubscription() || !S.compareAndSet(this, currentSubscription, Operators.cancelledSubscription())) {<NEW_LINE>logger.debug("Dropped error", t);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>this.done = true;<NEW_LINE>final int streamId = this.streamId;<NEW_LINE>this.requesterResponderSupport.remove(streamId, this);<NEW_LINE>final ByteBuf errorFrame = ErrorFrameCodec.encode(this.allocator, streamId, t);<NEW_LINE>this.connection.sendFrame(streamId, errorFrame);<NEW_LINE>final RequestInterceptor requestInterceptor = this.requestInterceptor;<NEW_LINE>if (requestInterceptor != null) {<NEW_LINE>requestInterceptor.onTerminate(<MASK><NEW_LINE>}<NEW_LINE>}
streamId, FrameType.REQUEST_RESPONSE, t);
1,485,256
// @see SWTSkinObjectBasic#paintControl(org.eclipse.swt.graphics.GC)<NEW_LINE>@Override<NEW_LINE>public void paintControl(GC gc) {<NEW_LINE>super.paintControl(gc);<NEW_LINE>int fullWidth = maxSize.x == 0 || imageFGbounds == null ? canvas.getClientArea<MASK><NEW_LINE>if (percent > 0 && imageFG != null) {<NEW_LINE>int xDrawTo = (int) (fullWidth * percent);<NEW_LINE>int xDrawToSrc = xDrawTo > imageFGbounds.width ? imageFGbounds.width : xDrawTo;<NEW_LINE>int y = (maxSize.y - imageFGbounds.height) / 2;<NEW_LINE>gc.drawImage(imageFG, 0, 0, xDrawToSrc, imageFGbounds.height, 0, y, xDrawTo, imageFGbounds.height);<NEW_LINE>}<NEW_LINE>if (percent < 100 && imageBG != null && imageFGbounds != null) {<NEW_LINE>int xDrawFrom = (int) (imageBGbounds.width * percent);<NEW_LINE>int xDrawWidth = imageBGbounds.width - xDrawFrom;<NEW_LINE>gc.drawImage(imageBG, xDrawFrom, 0, xDrawWidth, imageFGbounds.height, xDrawFrom, 0, xDrawWidth, imageFGbounds.height);<NEW_LINE>}<NEW_LINE>int drawWidth = fullWidth - imageThumbBounds.width;<NEW_LINE>int xThumbPos = (int) ((mouseDown && !mouseMoveAdjusts ? draggingPercent : percent) * drawWidth);<NEW_LINE>gc.drawImage(imageThumb, xThumbPos, 0);<NEW_LINE>}
().width : imageFGbounds.width;
1,601,457
public void build() {<NEW_LINE>// final String[] messTexts =<NEW_LINE>// { "ConfigView.section.mode.beginner.wiki.definitions",<NEW_LINE>// "ConfigView.section.mode.intermediate.wiki.host",<NEW_LINE>// "ConfigView.section.mode.advanced.wiki.main",<NEW_LINE>// };<NEW_LINE>final String[] links = { Wiki.MODE_BEGINNER, <MASK><NEW_LINE>int userMode = COConfigurationManager.getIntParameter(ICFG_USER_MODE);<NEW_LINE>int[] values = { Parameter.MODE_BEGINNER, Parameter.MODE_INTERMEDIATE, Parameter.MODE_ADVANCED };<NEW_LINE>String[] labels = { MessageText.getString("ConfigView.section.mode.beginner"), MessageText.getString("ConfigView.section.mode.intermediate"), MessageText.getString("ConfigView.section.mode.advanced") };<NEW_LINE>Map<Integer, String> mapInfos = new HashMap<>();<NEW_LINE>mapInfos.put(Parameter.MODE_BEGINNER, "ConfigView.section.mode.beginner.text");<NEW_LINE>mapInfos.put(Parameter.MODE_INTERMEDIATE, "ConfigView.section.mode.intermediate.text");<NEW_LINE>mapInfos.put(Parameter.MODE_ADVANCED, "ConfigView.section.mode.advanced.text");<NEW_LINE>IntListParameterImpl paramUserMode = new IntListParameterImpl(ICFG_USER_MODE, null, values, labels);<NEW_LINE>paramUserMode.setListType(IntListParameter.TYPE_RADIO_COMPACT);<NEW_LINE>add(paramUserMode);<NEW_LINE>LabelParameterImpl paramInfo = new LabelParameterImpl("");<NEW_LINE>add("mode.info", paramInfo);<NEW_LINE>HyperlinkParameterImpl paramInfoLink = new HyperlinkParameterImpl("ConfigView.label.please.visit.here", links[userMode]);<NEW_LINE>add(paramInfoLink);<NEW_LINE>paramUserMode.addListener(param -> {<NEW_LINE>int newUserMode = ((IntListParameter) param).getValue();<NEW_LINE>paramInfoLink.setHyperlink(links[newUserMode]);<NEW_LINE>String key = mapInfos.get(newUserMode);<NEW_LINE>if (MessageText.keyExists(key + "1")) {<NEW_LINE>key = key + "1";<NEW_LINE>}<NEW_LINE>paramInfo.setLabelText("-> " + MessageText.getString(key));<NEW_LINE>});<NEW_LINE>paramUserMode.fireParameterChanged();<NEW_LINE>ParameterGroupImpl pgRadio = new ParameterGroupImpl("ConfigView.section.mode.title", paramUserMode, paramInfo, paramInfoLink);<NEW_LINE>add("pgRadio", pgRadio);<NEW_LINE>add("gap1", new LabelParameterImpl(""));<NEW_LINE>add("gap2", new LabelParameterImpl(""));<NEW_LINE>add("gap3", new LabelParameterImpl(""));<NEW_LINE>// reset to defaults<NEW_LINE>ActionParameterImpl reset_button = new ActionParameterImpl("ConfigView.section.mode.resetdefaults", "Button.reset");<NEW_LINE>add(reset_button);<NEW_LINE>reset_button.addListener(param -> {<NEW_LINE>UIFunctions uiFunctions = UIFunctionsManager.getUIFunctions();<NEW_LINE>if (uiFunctions == null) {<NEW_LINE>resetAll();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>UIFunctionsUserPrompter prompter = uiFunctions.getUserPrompter(MessageText.getString("resetconfig.warn.title"), MessageText.getString("resetconfig.warn"), new String[] { MessageText.getString("Button.ok"), MessageText.getString("Button.cancel") }, 1);<NEW_LINE>if (prompter == null) {<NEW_LINE>resetAll();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>prompter.open(result -> {<NEW_LINE>if (result != 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>resetAll();<NEW_LINE>});<NEW_LINE>});<NEW_LINE>}
Wiki.MODE_INTERMEDIATE, Wiki.MODE_ADVANCED };
867,007
private RSVP createMessage() {<NEW_LINE>String eventId = Math.abs(ThreadLocalRandom.current().nextLong()) + "";<NEW_LINE><MASK><NEW_LINE>json.put("venue_name", "venue_name" + ThreadLocalRandom.current().nextInt());<NEW_LINE>json.put("event_name", "event_name" + ThreadLocalRandom.current().nextInt());<NEW_LINE>json.put("event_id", eventId);<NEW_LINE>json.put("event_time", DATE_TIME_FORMATTER.format(LocalDateTime.now().plusDays(10)));<NEW_LINE>json.put("group_city", "group_city" + ThreadLocalRandom.current().nextInt());<NEW_LINE>json.put("group_country", "group_country" + ThreadLocalRandom.current().nextInt());<NEW_LINE>json.put("group_id", Math.abs(ThreadLocalRandom.current().nextLong()));<NEW_LINE>json.put("group_name", "group_name" + ThreadLocalRandom.current().nextInt());<NEW_LINE>json.put("group_lat", ThreadLocalRandom.current().nextFloat());<NEW_LINE>json.put("group_lon", ThreadLocalRandom.current().nextFloat());<NEW_LINE>json.put("mtime", DATE_TIME_FORMATTER.format(LocalDateTime.now()));<NEW_LINE>json.put("rsvp_count", 1);<NEW_LINE>return new RSVP(eventId, eventId, json);<NEW_LINE>}
ObjectNode json = JsonUtils.newObjectNode();
672,438
public void blur(Node node, int duration, double brightness, boolean removeNode, double blurRadius) {<NEW_LINE>if (removeEffectTimeLine != null)<NEW_LINE>removeEffectTimeLine.stop();<NEW_LINE>node.setMouseTransparent(true);<NEW_LINE>GaussianBlur blur = new GaussianBlur(0.0);<NEW_LINE>Timeline timeline = new Timeline();<NEW_LINE>KeyValue kv1 = new KeyValue(blur.radiusProperty(), blurRadius);<NEW_LINE>KeyFrame kf1 = new KeyFrame(Duration.millis(getDuration(duration)), kv1);<NEW_LINE>ColorAdjust darken = new ColorAdjust();<NEW_LINE>darken.setBrightness(0.0);<NEW_LINE>blur.setInput(darken);<NEW_LINE>KeyValue kv2 = new KeyValue(<MASK><NEW_LINE>KeyFrame kf2 = new KeyFrame(Duration.millis(getDuration(duration)), kv2);<NEW_LINE>timeline.getKeyFrames().addAll(kf1, kf2);<NEW_LINE>node.setEffect(blur);<NEW_LINE>if (removeNode)<NEW_LINE>timeline.setOnFinished(actionEvent -> UserThread.execute(() -> ((Pane) (node.getParent())).getChildren().remove(node)));<NEW_LINE>timeline.play();<NEW_LINE>}
darken.brightnessProperty(), brightness);
1,333,996
public List<Feature> bind(StructType schema) {<NEW_LINE>List<Feature> features = new ArrayList<>();<NEW_LINE>for (Feature feature : x.bind(schema)) {<NEW_LINE>StructField xfield = feature.field();<NEW_LINE>DataType type = xfield.type;<NEW_LINE>if (!(type.isDouble() || type.isFloat() || type.isInt() || type.isLong() || type.isShort() || type.isByte())) {<NEW_LINE>throw new IllegalStateException(String.format("Invalid expression: %s(%s)", name, type));<NEW_LINE>}<NEW_LINE>features.add(new Feature() {<NEW_LINE><NEW_LINE>final StructField field = new StructField(String.format("%s(%s)", name, xfield.name), type.id() == DataType.ID.Object ? DataTypes.DoubleObjectType : DataTypes.DoubleType, xfield.measure);<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public StructField field() {<NEW_LINE>return field;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Double apply(Tuple o) {<NEW_LINE>Object <MASK><NEW_LINE>if (y == null)<NEW_LINE>return null;<NEW_LINE>else<NEW_LINE>return lambda.apply(((Number) y).doubleValue());<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public double applyAsDouble(Tuple o) {<NEW_LINE>return lambda.apply(feature.applyAsDouble(o));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>return features;<NEW_LINE>}
y = feature.apply(o);
1,414,587
private void handleVkOptions(int id) {<NEW_LINE>if (id == R.id.action_layout_edit_mode) {<NEW_LINE>keyboard.setLayoutEditMode(VirtualKeyboard.LAYOUT_KEYS);<NEW_LINE>Toast.makeText(this, R.string.layout_edit_mode, <MASK><NEW_LINE>} else if (id == R.id.action_layout_scale_mode) {<NEW_LINE>keyboard.setLayoutEditMode(VirtualKeyboard.LAYOUT_SCALES);<NEW_LINE>Toast.makeText(this, R.string.layout_scale_mode, Toast.LENGTH_SHORT).show();<NEW_LINE>} else if (id == R.id.action_layout_edit_finish) {<NEW_LINE>keyboard.setLayoutEditMode(VirtualKeyboard.LAYOUT_EOF);<NEW_LINE>Toast.makeText(this, R.string.layout_edit_finished, Toast.LENGTH_SHORT).show();<NEW_LINE>} else if (id == R.id.action_layout_switch) {<NEW_LINE>showSetLayoutDialog();<NEW_LINE>} else if (id == R.id.action_hide_buttons) {<NEW_LINE>showHideButtonDialog();<NEW_LINE>}<NEW_LINE>}
Toast.LENGTH_SHORT).show();
1,471,734
public void processNewResult(Object result) {<NEW_LINE>SetDBIDs positiveids = DBIDUtil.ensureSet(DatabaseUtil.getObjectsByLabelMatch(ResultUtil.findDatabase(result), positiveClassName));<NEW_LINE>if (positiveids.size() == 0) {<NEW_LINE>LOG.warning("Computing a P/R curve failed - no objects matched.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<OutlierResult> oresults = OutlierResult.getOutlierResults(result);<NEW_LINE>List<OrderingResult> orderings = ResultUtil.getOrderingResults(result);<NEW_LINE>// Outlier results are the main use case.<NEW_LINE>for (OutlierResult o : oresults) {<NEW_LINE>PRCurve curve = AUPRCEvaluation.materializePRC(new OutlierScoreAdapter(positiveids, o));<NEW_LINE>Metadata.hierarchyOf(o).addChild(curve);<NEW_LINE>//<NEW_LINE>MeasurementGroup //<NEW_LINE>g = EvaluationResult.findOrCreate(o, EvaluationResult.RANKING).findOrCreateGroup("Evaluation measures");<NEW_LINE>if (!g.hasMeasure(PRAUC_LABEL)) {<NEW_LINE>g.addMeasure(PRAUC_LABEL, curve.getAUC(), 0., 1., false);<NEW_LINE>}<NEW_LINE>// Process them only once.<NEW_LINE>orderings.<MASK><NEW_LINE>}<NEW_LINE>// FIXME: find appropriate place to add the derived result<NEW_LINE>// otherwise apply an ordering to the database IDs.<NEW_LINE>for (OrderingResult or : orderings) {<NEW_LINE>DBIDs sorted = or.order(or.getDBIDs());<NEW_LINE>PRCurve curve = AUPRCEvaluation.materializePRC(new SimpleAdapter(positiveids, sorted.iter(), sorted.size()));<NEW_LINE>Metadata.hierarchyOf(or).addChild(curve);<NEW_LINE>//<NEW_LINE>MeasurementGroup //<NEW_LINE>g = EvaluationResult.findOrCreate(or, EvaluationResult.RANKING).findOrCreateGroup("Evaluation measures");<NEW_LINE>if (!g.hasMeasure(PRAUC_LABEL)) {<NEW_LINE>g.addMeasure(PRAUC_LABEL, curve.getAUC(), 0., 1., false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
remove(o.getOrdering());
934,660
public void beforeTemplateFinished(final TemplateState templateState, Template template) {<NEW_LINE>try {<NEW_LINE>final TextResult value = templateState.getVariableValue(PRIMARY_VARIABLE_NAME);<NEW_LINE>myInsertedName = value != null ? value.toString() : null;<NEW_LINE>TextRange range = templateState.getCurrentVariableRange();<NEW_LINE>final int currentOffset = myEditor.getCaretModel().getOffset();<NEW_LINE>if (range == null && myRenameOffset != null) {<NEW_LINE>range = new TextRange(myRenameOffset.getStartOffset(<MASK><NEW_LINE>}<NEW_LINE>myBeforeRevert = range != null && range.getEndOffset() >= currentOffset && range.getStartOffset() <= currentOffset ? myEditor.getDocument().createRangeMarker(range.getStartOffset(), currentOffset) : null;<NEW_LINE>if (myBeforeRevert != null) {<NEW_LINE>myBeforeRevert.setGreedyToRight(true);<NEW_LINE>}<NEW_LINE>finish(true);<NEW_LINE>} finally {<NEW_LINE>restoreDaemonUpdateState();<NEW_LINE>}<NEW_LINE>}
), myRenameOffset.getEndOffset());
821,530
// Method 1<NEW_LINE>private String longestCommonSubstringMethod1(String fileName1, String fileName2) {<NEW_LINE>String fileContent1 = getStringTextFromFile(fileName1);<NEW_LINE>String fileContent2 = getStringTextFromFile(fileName2);<NEW_LINE>char inexistentCharacter = getInexistentCharacter(fileContent1, fileContent2);<NEW_LINE>String mergedTexts = fileContent1 + inexistentCharacter + fileContent2;<NEW_LINE><MASK><NEW_LINE>SuffixArrayLinearTime suffixArray = new SuffixArrayLinearTime(mergedTexts);<NEW_LINE>int[] suffixes = suffixArray.getSuffixes();<NEW_LINE>int[] lcpArray = KasaiAlgorithm.buildLCPArray(suffixes, mergedTexts);<NEW_LINE>int highestLCPLength = 0;<NEW_LINE>int targetSuffixIndex = 0;<NEW_LINE>for (int i = 0; i < mergedTexts.length() - 1; i++) {<NEW_LINE>// Both suffixes are from text 1<NEW_LINE>if (suffixArray.index(i) < text1Length && suffixArray.index(i + 1) < text1Length) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// Both suffixes are from text 2<NEW_LINE>if (suffixArray.index(i) > text1Length && suffixArray.index(i + 1) > text1Length) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// Suffixes are from different texts<NEW_LINE>int longestCommonPrefixLength = lcpArray[i];<NEW_LINE>if (longestCommonPrefixLength > highestLCPLength) {<NEW_LINE>highestLCPLength = longestCommonPrefixLength;<NEW_LINE>targetSuffixIndex = i;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return mergedTexts.substring(suffixArray.index(targetSuffixIndex), suffixArray.index(targetSuffixIndex) + highestLCPLength);<NEW_LINE>}
int text1Length = fileContent1.length();
1,019,964
protected void deleteAllEncryptionKeys() {<NEW_LINE>Context appContext = ApplicationProvider.getApplicationContext();<NEW_LINE>appContext.getSharedPreferences("com.amazonaws.android.auth.encryptionkey", Context.MODE_PRIVATE).edit().clear().apply();<NEW_LINE>appContext.getSharedPreferences("CognitoIdentityProviderCache.encryptionkey", Context.MODE_PRIVATE).edit().clear().apply();<NEW_LINE>appContext.getSharedPreferences("com.amazonaws.mobile.client.encryptionkey", Context.MODE_PRIVATE).edit().clear().apply();<NEW_LINE>if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {<NEW_LINE>try {<NEW_LINE>KeyStore keyStore = KeyStore.getInstance("AndroidKeyStore");<NEW_LINE>keyStore.load(null);<NEW_LINE>Enumeration<String<MASK><NEW_LINE>while (keyAliases.hasMoreElements()) {<NEW_LINE>final String keyAlias = keyAliases.nextElement();<NEW_LINE>junit.framework.Assert.assertTrue(keyStore.containsAlias(keyAlias));<NEW_LINE>keyStore.deleteEntry(keyAlias);<NEW_LINE>assertFalse(keyStore.containsAlias(keyAlias));<NEW_LINE>}<NEW_LINE>} catch (Exception ex) {<NEW_LINE>ex.printStackTrace();<NEW_LINE>fail("Error in deleting encryption keys from the Android KeyStore.");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
> keyAliases = keyStore.aliases();
1,649,452
public void show(Node ownerNode, double anchorX, double anchorY) {<NEW_LINE>// if tooltip hide animation still running, then hide method is not called yet<NEW_LINE>// thus only reverse the animation to show the tooltip again<NEW_LINE>hiding = false;<NEW_LINE>final Bounds sceneBounds = ownerNode.localToScene(ownerNode.getBoundsInLocal());<NEW_LINE>if (isShowing()) {<NEW_LINE>animation.setOnFinished(null);<NEW_LINE>animation.reverseAndContinue();<NEW_LINE>anchorX = ownerX(ownerNode, sceneBounds) + getHPosForNode(sceneBounds);<NEW_LINE>anchorY = ownerY(ownerNode, sceneBounds) + getVPosForNode(sceneBounds);<NEW_LINE>setAnchorY(getUpdatedAnchorY(anchorY));<NEW_LINE>setAnchorX(getUpdatedAnchorX(anchorX));<NEW_LINE>} else {<NEW_LINE>// tooltip was not showing compute its anchors and show it<NEW_LINE>anchorX = ownerX(ownerNode, sceneBounds) + getHPosForNode(sceneBounds);<NEW_LINE>anchorY = ownerY(ownerNode, sceneBounds) + getVPosForNode(sceneBounds);<NEW_LINE>super.<MASK><NEW_LINE>}<NEW_LINE>}
show(ownerNode, anchorX, anchorY);
955,908
private Map<String, Object> toMap(Xpp3Dom node) {<NEW_LINE>Map<String, Object> map = new LinkedHashMap<>();<NEW_LINE>int n = node.getChildCount();<NEW_LINE>for (int i = 0; i < n; i++) {<NEW_LINE>Xpp3Dom child = node.getChild(i);<NEW_LINE>String childName = child.getName();<NEW_LINE>String singularName = null;<NEW_LINE>int childNameLength = childName.length();<NEW_LINE>if ("reportPlugins".equals(childName)) {<NEW_LINE>singularName = "plugin";<NEW_LINE>} else if (childNameLength > 3 && childName.endsWith("ies")) {<NEW_LINE>singularName = childName.substring(0, childNameLength - 3);<NEW_LINE>} else if (childNameLength > 1 && childName.endsWith("s")) {<NEW_LINE>singularName = childName.substring(0, childNameLength - 1);<NEW_LINE>}<NEW_LINE>Object childValue = child.getValue();<NEW_LINE>if (childValue == null) {<NEW_LINE>boolean isList = singularName != null;<NEW_LINE>if (isList) {<NEW_LINE>// check for eventual list construction<NEW_LINE>for (int j = 0, grandChildCount = child.getChildCount(); j < grandChildCount; j++) {<NEW_LINE>String grandChildName = child.<MASK><NEW_LINE>isList &= grandChildName.equals(singularName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (isList) {<NEW_LINE>childValue = toList(child, singularName);<NEW_LINE>} else {<NEW_LINE>childValue = toMap(child);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>map.put(childName, childValue);<NEW_LINE>}<NEW_LINE>for (String attrName : node.getAttributeNames()) {<NEW_LINE>map.put(ATTRIBUTE_PREFIX + attrName, node.getAttribute(attrName));<NEW_LINE>}<NEW_LINE>return map;<NEW_LINE>}
getChild(j).getName();
1,728,568
protected void showThisTabWindow(Screen screen) {<NEW_LINE>WebAppWorkArea workArea = getConfiguredWorkArea();<NEW_LINE>workArea.switchTo(AppWorkArea.State.WINDOW_CONTAINER);<NEW_LINE>TabWindowContainer windowContainer;<NEW_LINE>if (workArea.getMode() == Mode.TABBED) {<NEW_LINE>TabSheetBehaviour tabSheet = workArea.getTabbedWindowContainer().getTabSheetBehaviour();<NEW_LINE>windowContainer = (TabWindowContainer) tabSheet.getSelectedTab();<NEW_LINE>} else {<NEW_LINE>windowContainer = (TabWindowContainer) workArea.getSingleWindowContainer().getWindowContainer();<NEW_LINE>}<NEW_LINE>if (windowContainer == null || windowContainer.getBreadCrumbs() == null) {<NEW_LINE>throw new IllegalStateException("BreadCrumbs not found");<NEW_LINE>}<NEW_LINE>WindowBreadCrumbs breadCrumbs = windowContainer.getBreadCrumbs();<NEW_LINE>Window currentWindow = breadCrumbs.getCurrentWindow();<NEW_LINE>windowContainer.removeComponent(currentWindow.unwrapComposition(Layout.class));<NEW_LINE>Window newWindow = screen.getWindow();<NEW_LINE>com.vaadin.ui.Component newWindowComposition = newWindow.unwrapComposition(com.vaadin.ui.Component.class);<NEW_LINE>windowContainer.addComponent(newWindowComposition);<NEW_LINE>breadCrumbs.addWindow(newWindow);<NEW_LINE>WebWindow webWindow = <MASK><NEW_LINE>webWindow.setResolvedState(createOrUpdateState(webWindow.getResolvedState(), getConfiguredWorkArea().generateUrlStateMark()));<NEW_LINE>if (workArea.getMode() == Mode.TABBED) {<NEW_LINE>TabSheetBehaviour tabSheet = workArea.getTabbedWindowContainer().getTabSheetBehaviour();<NEW_LINE>String tabId = tabSheet.getTab(windowContainer);<NEW_LINE>TabWindow tabWindow = (TabWindow) newWindow;<NEW_LINE>String formattedCaption = tabWindow.formatTabCaption();<NEW_LINE>String formattedDescription = tabWindow.formatTabDescription();<NEW_LINE>tabSheet.setTabCaption(tabId, formattedCaption);<NEW_LINE>if (!Objects.equals(formattedCaption, formattedDescription)) {<NEW_LINE>tabSheet.setTabDescription(tabId, formattedDescription);<NEW_LINE>} else {<NEW_LINE>tabSheet.setTabDescription(tabId, null);<NEW_LINE>}<NEW_LINE>tabSheet.setTabIcon(tabId, iconResolver.getIconResource(newWindow.getIcon()));<NEW_LINE>tabSheet.setTabClosable(tabId, newWindow.isCloseable());<NEW_LINE>ContentSwitchMode contentSwitchMode = ContentSwitchMode.valueOf(tabWindow.getContentSwitchMode().name());<NEW_LINE>tabSheet.setContentSwitchMode(tabId, contentSwitchMode);<NEW_LINE>} else {<NEW_LINE>windowContainer.markAsDirtyRecursive();<NEW_LINE>}<NEW_LINE>}
(WebWindow) screen.getWindow();
966,582
public Webhook createTenantWebhook(CreateWebhookRequest body, String xSdsDateFormat, String xSdsServiceToken) throws ApiException {<NEW_LINE>Object localVarPostBody = body;<NEW_LINE>// verify the required parameter 'body' is set<NEW_LINE>if (body == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'body' when calling createTenantWebhook");<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/v4/provisioning/webhooks";<NEW_LINE>// query params<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>if (xSdsDateFormat != null)<NEW_LINE>localVarHeaderParams.put("X-Sds-Date-Format", apiClient.parameterToString(xSdsDateFormat));<NEW_LINE>if (xSdsServiceToken != null)<NEW_LINE>localVarHeaderParams.put("X-Sds-Service-Token", apiClient.parameterToString(xSdsServiceToken));<NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = { "application/json" };<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] <MASK><NEW_LINE>GenericType<Webhook> localVarReturnType = new GenericType<Webhook>() {<NEW_LINE>};<NEW_LINE>return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);<NEW_LINE>}
localVarAuthNames = new String[] {};
1,722,442
private void updateZoneState(boolean forceUpdate) {<NEW_LINE>TadoHomeHandler home = getHomeHandler();<NEW_LINE>if (home != null) {<NEW_LINE>home.updateHomeState();<NEW_LINE>}<NEW_LINE>// No update during HVAC change debounce<NEW_LINE>if (!forceUpdate && scheduledHvacChange != null && !scheduledHvacChange.isDone()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>ZoneState zoneState = getZoneState();<NEW_LINE>if (zoneState == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>logger.debug("Updating state of home {} and zone {}", getHomeId(), getZoneId());<NEW_LINE>TadoZoneStateAdapter state = new TadoZoneStateAdapter(zoneState, getTemperatureUnit());<NEW_LINE>updateStateIfNotNull(TadoBindingConstants.CHANNEL_ZONE_CURRENT_TEMPERATURE, state.getInsideTemperature());<NEW_LINE>updateStateIfNotNull(TadoBindingConstants.CHANNEL_ZONE_HUMIDITY, state.getHumidity());<NEW_LINE>updateStateIfNotNull(TadoBindingConstants.CHANNEL_ZONE_HEATING_POWER, state.getHeatingPower());<NEW_LINE>updateStateIfNotNull(TadoBindingConstants.CHANNEL_ZONE_AC_POWER, state.getAcPower());<NEW_LINE>updateState(TadoBindingConstants.CHANNEL_ZONE_OPERATION_MODE, state.getOperationMode());<NEW_LINE>updateState(TadoBindingConstants.CHANNEL_ZONE_HVAC_MODE, state.getMode());<NEW_LINE>updateState(TadoBindingConstants.CHANNEL_ZONE_TARGET_TEMPERATURE, state.getTargetTemperature());<NEW_LINE>updateState(TadoBindingConstants.CHANNEL_ZONE_FAN_SPEED, state.getFanSpeed());<NEW_LINE>updateState(TadoBindingConstants.CHANNEL_ZONE_SWING, state.getSwing());<NEW_LINE>updateState(TadoBindingConstants.CHANNEL_ZONE_LIGHT, state.getLight());<NEW_LINE>updateState(TadoBindingConstants.CHANNEL_ZONE_FAN_LEVEL, state.getFanLevel());<NEW_LINE>updateState(TadoBindingConstants.<MASK><NEW_LINE>updateState(TadoBindingConstants.CHANNEL_ZONE_VERTICAL_SWING, state.getVerticalSwing());<NEW_LINE>updateState(TadoBindingConstants.CHANNEL_ZONE_TIMER_DURATION, state.getRemainingTimerDuration());<NEW_LINE>updateState(TadoBindingConstants.CHANNEL_ZONE_OVERLAY_EXPIRY, state.getOverlayExpiration());<NEW_LINE>updateState(TadoBindingConstants.CHANNEL_ZONE_OPEN_WINDOW_DETECTED, state.getOpenWindowDetected());<NEW_LINE>updateDynamicStateDescriptions(zoneState);<NEW_LINE>onSuccessfulOperation();<NEW_LINE>} catch (IOException | ApiException e) {<NEW_LINE>updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, "Could not connect to server due to " + e.getMessage());<NEW_LINE>}<NEW_LINE>if (home != null) {<NEW_LINE>updateState(TadoBindingConstants.CHANNEL_ZONE_BATTERY_LOW_ALARM, home.getBatteryLowAlarm(getZoneId()));<NEW_LINE>}<NEW_LINE>}
CHANNEL_ZONE_HORIZONTAL_SWING, state.getHorizontalSwing());
1,547,211
public void collectExpressions(Component component, JRExpressionCollector collector) {<NEW_LINE>TableComponent table = (TableComponent) component;<NEW_LINE>JRDatasetRun datasetRun = table.getDatasetRun();<NEW_LINE>collector.collect(datasetRun);<NEW_LINE>JRExpressionCollector datasetCollector = collector.getDatasetCollector(datasetRun.getDatasetName());<NEW_LINE>ColumnExpressionCollector columnCollector = new ColumnExpressionCollector(collector, datasetCollector);<NEW_LINE>columnCollector.collectColumns(table.getColumns());<NEW_LINE>RowExpressionCollector rowCollector = new RowExpressionCollector(datasetCollector);<NEW_LINE>rowCollector.collectRow(table.getTableHeader());<NEW_LINE>rowCollector.collectRow(table.getTableFooter());<NEW_LINE>rowCollector.collectGroupRows(table.getGroupHeaders());<NEW_LINE>rowCollector.collectGroupRows(table.getGroupFooters());<NEW_LINE>rowCollector.collectRow(table.getColumnHeader());<NEW_LINE>rowCollector.<MASK><NEW_LINE>rowCollector.collectRow(table.getDetail());<NEW_LINE>columnCollector.collectCell(table.getNoData());<NEW_LINE>}
collectRow(table.getColumnFooter());
1,561,340
private static DiskStats queryReadWriteStats(String index) {<NEW_LINE>// Create object to hold and return results<NEW_LINE>DiskStats stats = new DiskStats();<NEW_LINE>Pair<List<String>, Map<PhysicalDiskProperty, List<Long>>> instanceValuePair = PhysicalDisk.queryDiskCounters();<NEW_LINE>List<String> instances = instanceValuePair.getA();<NEW_LINE>Map<PhysicalDiskProperty, List<Long>> valueMap = instanceValuePair.getB();<NEW_LINE>stats.timeStamp = System.currentTimeMillis();<NEW_LINE>List<Long> readList = valueMap.get(PhysicalDiskProperty.DISKREADSPERSEC);<NEW_LINE>List<Long> readByteList = valueMap.get(PhysicalDiskProperty.DISKREADBYTESPERSEC);<NEW_LINE>List<Long> writeList = valueMap.get(PhysicalDiskProperty.DISKWRITESPERSEC);<NEW_LINE>List<Long> writeByteList = valueMap.get(PhysicalDiskProperty.DISKWRITEBYTESPERSEC);<NEW_LINE>List<Long> queueLengthList = valueMap.get(PhysicalDiskProperty.CURRENTDISKQUEUELENGTH);<NEW_LINE>List<Long> diskTimeList = valueMap.get(PhysicalDiskProperty.PERCENTDISKTIME);<NEW_LINE>if (instances.isEmpty() || readList == null || readByteList == null || writeList == null || writeByteList == null || queueLengthList == null || diskTimeList == null) {<NEW_LINE>return stats;<NEW_LINE>}<NEW_LINE>for (int i = 0; i < instances.size(); i++) {<NEW_LINE>String name = getIndexFromName<MASK><NEW_LINE>// If index arg passed, only update passed arg<NEW_LINE>if (index != null && !index.equals(name)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>stats.readMap.put(name, readList.get(i));<NEW_LINE>stats.readByteMap.put(name, readByteList.get(i));<NEW_LINE>stats.writeMap.put(name, writeList.get(i));<NEW_LINE>stats.writeByteMap.put(name, writeByteList.get(i));<NEW_LINE>stats.queueLengthMap.put(name, queueLengthList.get(i));<NEW_LINE>stats.diskTimeMap.put(name, diskTimeList.get(i) / 10_000L);<NEW_LINE>}<NEW_LINE>return stats;<NEW_LINE>}
(instances.get(i));
1,430,194
private void rehash(final int newCapacity) {<NEW_LINE>final int mask = newCapacity - 1;<NEW_LINE>resizeThreshold = (int) (newCapacity * loadFactor);<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>final K[] tempKeys = (K[]) new Object[newCapacity];<NEW_LINE>final long[] tempValues = new long[newCapacity];<NEW_LINE>Arrays.fill(tempValues, missingValue);<NEW_LINE>for (int i = 0, size = values.length; i < size; i++) {<NEW_LINE><MASK><NEW_LINE>if (missingValue != value) {<NEW_LINE>final K key = keys[i];<NEW_LINE>int index = Hashing.hash(key, mask);<NEW_LINE>while (missingValue != tempValues[index]) {<NEW_LINE>index = ++index & mask;<NEW_LINE>}<NEW_LINE>tempKeys[index] = key;<NEW_LINE>tempValues[index] = value;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>keys = tempKeys;<NEW_LINE>values = tempValues;<NEW_LINE>}
final long value = values[i];
1,614,419
public void show(DigestModel model, long stime, long etime, int serverId) {<NEW_LINE>this.model = model;<NEW_LINE>this.date = DateUtil.yyyymmdd(stime);<NEW_LINE>this.stime = stime;<NEW_LINE>this.etime = etime;<NEW_LINE>this.serverId = serverId;<NEW_LINE>final Shell dialog = new Shell(Display.getDefault(), SWT.APPLICATION_MODAL | SWT.DIALOG_TRIM | SWT.RESIZE);<NEW_LINE>UIUtil.setDialogDefaultFunctions(dialog);<NEW_LINE>dialog.setText("Digest Detail");<NEW_LINE>dialog.setLayout(new GridLayout(1, true));<NEW_LINE>tabFolder = new TabFolder(dialog, SWT.BORDER);<NEW_LINE>tabFolder.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));<NEW_LINE>queryDetailItem = new TabItem(tabFolder, SWT.NULL);<NEW_LINE>queryDetailItem.setText("Query Detail");<NEW_LINE>queryDetailItem.setControl(getQueryDetailControl(tabFolder));<NEW_LINE>exampleQueryItem = new TabItem(tabFolder, SWT.NULL);<NEW_LINE>exampleQueryItem.setText("Example Query");<NEW_LINE>exampleQueryItem.setControl(getSpinnerControl(tabFolder));<NEW_LINE>graphsItem = new TabItem(tabFolder, SWT.NULL);<NEW_LINE>graphsItem.setText("Graphs");<NEW_LINE>graphsItem<MASK><NEW_LINE>Button closeBtn = new Button(dialog, SWT.PUSH);<NEW_LINE>GridData gr = new GridData(SWT.RIGHT, SWT.FILL, false, false);<NEW_LINE>gr.widthHint = 100;<NEW_LINE>closeBtn.setLayoutData(gr);<NEW_LINE>closeBtn.setText("&Close");<NEW_LINE>closeBtn.addSelectionListener(new SelectionAdapter() {<NEW_LINE><NEW_LINE>public void widgetSelected(SelectionEvent e) {<NEW_LINE>for (Resource r : resources) {<NEW_LINE>if (r.isDisposed() == false) {<NEW_LINE>r.dispose();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>dialog.close();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>dialog.addDisposeListener(new DisposeListener() {<NEW_LINE><NEW_LINE>public void widgetDisposed(DisposeEvent e) {<NEW_LINE>for (Resource r : resources) {<NEW_LINE>if (r.isDisposed() == false) {<NEW_LINE>r.dispose();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>loadExampleQuery();<NEW_LINE>loadGraphsData();<NEW_LINE>dialog.pack();<NEW_LINE>dialog.open();<NEW_LINE>}
.setControl(getSpinnerControl(tabFolder));
1,258,908
public static File replaceTokensInScript(final String script, final Map<String, Map<String, String>> dataContext, final Framework framework, final ScriptfileUtils.LineEndingStyle style, final File destination) throws IOException {<NEW_LINE>if (null == script) {<NEW_LINE>throw new NullPointerException("script cannot be null");<NEW_LINE>}<NEW_LINE>// use ReplaceTokens to replace tokens within the content<NEW_LINE>final Reader read = new StringReader(script);<NEW_LINE>final Map<String, String> toks = flattenDataContext(dataContext);<NEW_LINE>final ReplaceTokenReader replaceTokens = new ReplaceTokenReader(read, toks::get, true, '@', '@');<NEW_LINE>final File temp;<NEW_LINE>if (null != destination) {<NEW_LINE>ScriptfileUtils.writeScriptFile(null, null, replaceTokens, style, destination);<NEW_LINE>temp = destination;<NEW_LINE>} else {<NEW_LINE>if (null == framework) {<NEW_LINE>throw new NullPointerException("framework cannot be null");<NEW_LINE>}<NEW_LINE>temp = ScriptfileUtils.<MASK><NEW_LINE>}<NEW_LINE>ScriptfileUtils.setExecutePermissions(temp);<NEW_LINE>return temp;<NEW_LINE>}
writeScriptTempfile(framework, replaceTokens, style);
87,282
public void complete(ResponseInfo responseInfo, ArrayList<UploadSingleRequestMetrics> requestMetricsList, JSONObject response) {<NEW_LINE>requestMetrics.addMetricsList(requestMetricsList);<NEW_LINE>boolean hijackedAndNeedRetry = false;<NEW_LINE>if (requestMetricsList != null && requestMetricsList.size() > 0) {<NEW_LINE>UploadSingleRequestMetrics metrics = requestMetricsList.get(requestMetricsList.size() - 1);<NEW_LINE>boolean isSafeDnsSource = DnsSource.isCustom(metrics.getSyncDnsSource()) || DnsSource.isDoh(metrics.getSyncDnsSource()) || DnsSource.isDnspod(metrics.getSyncDnsSource());<NEW_LINE>if ((metrics.isForsureHijacked() || metrics.isMaybeHijacked() && isSafeDnsSource)) {<NEW_LINE>hijackedAndNeedRetry = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (hijackedAndNeedRetry) {<NEW_LINE>region.<MASK><NEW_LINE>}<NEW_LINE>if ((shouldRetryHandler.shouldRetry(responseInfo, response) && config.allowBackupHost && responseInfo.couldRegionRetry()) || hijackedAndNeedRetry) {<NEW_LINE>IUploadServer newServer = getNextServer(responseInfo);<NEW_LINE>if (newServer != null) {<NEW_LINE>performRequest(newServer, action, isAsync, request.httpBody, header, method, shouldRetryHandler, progressHandler, completeHandler);<NEW_LINE>request.httpBody = null;<NEW_LINE>} else {<NEW_LINE>request.httpBody = null;<NEW_LINE>completeAction(responseInfo, response, completeHandler);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>request.httpBody = null;<NEW_LINE>completeAction(responseInfo, response, completeHandler);<NEW_LINE>}<NEW_LINE>}
updateIpListFormHost(server.getHost());
939,558
public ElasticsearchSink genStreamSink(AbstractTargetTableInfo targetTableInfo) {<NEW_LINE>ElasticsearchTableInfo elasticsearchTableInfo = (ElasticsearchTableInfo) targetTableInfo;<NEW_LINE>esTableInfo = elasticsearchTableInfo;<NEW_LINE>clusterName = elasticsearchTableInfo.getClusterName();<NEW_LINE>String address = elasticsearchTableInfo.getAddress();<NEW_LINE>String[] addr = StringUtils.split(address, ",");<NEW_LINE>esAddressList = Arrays.asList(addr);<NEW_LINE>index = elasticsearchTableInfo.getIndex();<NEW_LINE>type = elasticsearchTableInfo.getEsType();<NEW_LINE>String id = elasticsearchTableInfo.getId();<NEW_LINE>String[] idField = StringUtils.split(id, ",");<NEW_LINE>idIndexList = new ArrayList<>();<NEW_LINE>registerTableName = elasticsearchTableInfo.getName();<NEW_LINE>parallelism = Objects.isNull(elasticsearchTableInfo.getParallelism()) <MASK><NEW_LINE>// kerberos<NEW_LINE>principal = elasticsearchTableInfo.getPrincipal();<NEW_LINE>keytab = elasticsearchTableInfo.getKeytab();<NEW_LINE>krb5conf = elasticsearchTableInfo.getKrb5conf();<NEW_LINE>enableKrb = elasticsearchTableInfo.isEnableKrb();<NEW_LINE>for (int i = 0; i < idField.length; ++i) {<NEW_LINE>idIndexList.add(Integer.valueOf(idField[i]));<NEW_LINE>}<NEW_LINE>columnTypes = elasticsearchTableInfo.getFieldTypes();<NEW_LINE>return this;<NEW_LINE>}
? parallelism : elasticsearchTableInfo.getParallelism();
1,415,808
public ImmutableAttributes mapAttributesFor(ImmutableAttributes attributes, Iterable<? extends ComponentArtifactMetadata> artifacts) {<NEW_LINE>// Add attributes to be applied given the extension<NEW_LINE>if (artifactTypeDefinitions != null) {<NEW_LINE>String extension = null;<NEW_LINE>for (ComponentArtifactMetadata artifact : artifacts) {<NEW_LINE>String candidateExtension = artifact.getName().getExtension();<NEW_LINE>if (extension == null) {<NEW_LINE>extension = candidateExtension;<NEW_LINE>} else if (!extension.equals(candidateExtension)) {<NEW_LINE>extension = null;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (extension != null) {<NEW_LINE>attributes = applyForExtension(attributes, extension);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Add artifact format as an implicit attribute when all artifacts have the same format<NEW_LINE>if (!attributes.contains(ARTIFACT_TYPE_ATTRIBUTE)) {<NEW_LINE>String format = null;<NEW_LINE>for (ComponentArtifactMetadata artifact : artifacts) {<NEW_LINE>String candidateFormat = artifact.getName().getType();<NEW_LINE>if (format == null) {<NEW_LINE>format = candidateFormat;<NEW_LINE>} else if (!format.equals(candidateFormat)) {<NEW_LINE>format = null;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (format != null) {<NEW_LINE>attributes = attributesFactory.concat(attributes.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return attributes;<NEW_LINE>}
asImmutable(), ARTIFACT_TYPE_ATTRIBUTE, format);
685,257
protected void initAppManager() {<NEW_LINE>if (Setup.appSettings().getAppFirstLaunch()) {<NEW_LINE>Setup.appSettings().setAppFirstLaunch(false);<NEW_LINE>Setup.appSettings().setAppShowIntro(false);<NEW_LINE>Item appDrawerBtnItem = Item.newActionItem(8);<NEW_LINE>appDrawerBtnItem._x = 2;<NEW_LINE>_db.saveItem(appDrawerBtnItem, 0, ItemPosition.Dock);<NEW_LINE>}<NEW_LINE>Setup.appLoader().addUpdateListener(new AppUpdateListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean onAppUpdated(List<App> it) {<NEW_LINE>getDesktop().initDesktop();<NEW_LINE>getDock().initDock();<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>Setup.appLoader().addDeleteListener(new AppDeleteListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean onAppDeleted(List<App> apps) {<NEW_LINE>getDesktop().initDesktop();<NEW_LINE>getDock().initDock();<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>AppManager.<MASK><NEW_LINE>}
getInstance(this).init();
420,213
private static Expression optimizeCurrent(Expression expression) {<NEW_LINE>Function function = expression.getFunctionCall();<NEW_LINE><MASK><NEW_LINE>List<Expression> operands = function.getOperands();<NEW_LINE>if (operator.equals(FilterKind.AND.name())) {<NEW_LINE>// If any of the literal operands are FALSE, then replace AND function with FALSE.<NEW_LINE>for (Expression operand : operands) {<NEW_LINE>if (operand.equals(FALSE)) {<NEW_LINE>return FALSE;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Remove all Literal operands that are TRUE.<NEW_LINE>operands.removeIf(x -> x.equals(TRUE));<NEW_LINE>if (operands.isEmpty()) {<NEW_LINE>return TRUE;<NEW_LINE>}<NEW_LINE>} else if (operator.equals(FilterKind.OR.name())) {<NEW_LINE>// If any of the literal operands are TRUE, then replace OR function with TRUE<NEW_LINE>for (Expression operand : operands) {<NEW_LINE>if (operand.equals(TRUE)) {<NEW_LINE>return TRUE;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Remove all Literal operands that are FALSE.<NEW_LINE>operands.removeIf(x -> x.equals(FALSE));<NEW_LINE>if (operands.isEmpty()) {<NEW_LINE>return FALSE;<NEW_LINE>}<NEW_LINE>} else if (operator.equals(FilterKind.NOT.name())) {<NEW_LINE>assert operands.size() == 1;<NEW_LINE>Expression operand = operands.get(0);<NEW_LINE>if (operand.equals(TRUE)) {<NEW_LINE>return FALSE;<NEW_LINE>}<NEW_LINE>if (operand.equals(FALSE)) {<NEW_LINE>return TRUE;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return expression;<NEW_LINE>}
String operator = function.getOperator();
438,888
public static DescribeLiveStreamBitRateDataResponse unmarshall(DescribeLiveStreamBitRateDataResponse describeLiveStreamBitRateDataResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeLiveStreamBitRateDataResponse.setRequestId(_ctx.stringValue("DescribeLiveStreamBitRateDataResponse.RequestId"));<NEW_LINE>List<FrameRateAndBitRateInfo> frameRateAndBitRateInfos = new ArrayList<FrameRateAndBitRateInfo>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeLiveStreamBitRateDataResponse.FrameRateAndBitRateInfos.Length"); i++) {<NEW_LINE>FrameRateAndBitRateInfo frameRateAndBitRateInfo = new FrameRateAndBitRateInfo();<NEW_LINE>frameRateAndBitRateInfo.setTime(_ctx.stringValue("DescribeLiveStreamBitRateDataResponse.FrameRateAndBitRateInfos[" + i + "].Time"));<NEW_LINE>frameRateAndBitRateInfo.setVideoFrameRate(_ctx.floatValue<MASK><NEW_LINE>frameRateAndBitRateInfo.setAudioFrameRate(_ctx.floatValue("DescribeLiveStreamBitRateDataResponse.FrameRateAndBitRateInfos[" + i + "].AudioFrameRate"));<NEW_LINE>frameRateAndBitRateInfo.setStreamUrl(_ctx.stringValue("DescribeLiveStreamBitRateDataResponse.FrameRateAndBitRateInfos[" + i + "].StreamUrl"));<NEW_LINE>frameRateAndBitRateInfo.setBitRate(_ctx.floatValue("DescribeLiveStreamBitRateDataResponse.FrameRateAndBitRateInfos[" + i + "].BitRate"));<NEW_LINE>frameRateAndBitRateInfos.add(frameRateAndBitRateInfo);<NEW_LINE>}<NEW_LINE>describeLiveStreamBitRateDataResponse.setFrameRateAndBitRateInfos(frameRateAndBitRateInfos);<NEW_LINE>return describeLiveStreamBitRateDataResponse;<NEW_LINE>}
("DescribeLiveStreamBitRateDataResponse.FrameRateAndBitRateInfos[" + i + "].VideoFrameRate"));
440,092
private Block createRawBlock(String defaultName, SectionDefinitionData def) {<NEW_LINE>Block block = new Block();<NEW_LINE>block.setLiquid(def.isLiquid());<NEW_LINE>block.setWater(def.isWater());<NEW_LINE>block.setGrass(def.isGrass());<NEW_LINE>block.setIce(def.isIce());<NEW_LINE>block.setHardness(def.getHardness());<NEW_LINE>block.setAttachmentAllowed(def.isAttachmentAllowed());<NEW_LINE>block.setReplacementAllowed(def.isReplacementAllowed());<NEW_LINE>block.setSupportRequired(def.isSupportRequired());<NEW_LINE>block.setPenetrable(def.isPenetrable());<NEW_LINE>block.setTargetable(def.isTargetable());<NEW_LINE>block.setClimbable(def.isClimbable());<NEW_LINE>block.setTranslucent(def.isTranslucent());<NEW_LINE>block.setDoubleSided(def.isDoubleSided());<NEW_LINE>block.setShadowCasting(def.isShadowCasting());<NEW_LINE>block.setWaving(def.isWaving());<NEW_LINE>block.setLuminance(def.getLuminance());<NEW_LINE>block.setTint(def.getTint());<NEW_LINE>if (Strings.isNullOrEmpty(def.getDisplayName())) {<NEW_LINE>block.setDisplayName(properCase(defaultName));<NEW_LINE>} else {<NEW_LINE>block.setDisplayName(def.getDisplayName());<NEW_LINE>}<NEW_LINE>block.setSounds(def.getSounds());<NEW_LINE>block.<MASK><NEW_LINE>block.setDebrisOnDestroy(def.isDebrisOnDestroy());<NEW_LINE>block.setFriction(def.getFriction());<NEW_LINE>block.setRestitution(def.getRestitution());<NEW_LINE>if (def.getEntity() != null) {<NEW_LINE>block.setPrefab(def.getEntity().getPrefab());<NEW_LINE>block.setKeepActive(def.getEntity().isKeepActive());<NEW_LINE>}<NEW_LINE>if (def.getInventory() != null) {<NEW_LINE>block.setStackable(def.getInventory().isStackable());<NEW_LINE>block.setDirectPickup(def.getInventory().isDirectPickup());<NEW_LINE>}<NEW_LINE>return block;<NEW_LINE>}
setMass(def.getMass());
1,762,997
final CreateLayerResult executeCreateLayer(CreateLayerRequest createLayerRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createLayerRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<CreateLayerRequest> request = null;<NEW_LINE>Response<CreateLayerResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateLayerRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createLayerRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "OpsWorks");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateLayer");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateLayerResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateLayerResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
1,506,797
protected JFreeChart createLineChart() throws JRException {<NEW_LINE>JFreeChart jfreeChart = super.createLineChart();<NEW_LINE>CategoryPlot categoryPlot = (CategoryPlot) jfreeChart.getPlot();<NEW_LINE>LineAndShapeRenderer lineRenderer = <MASK><NEW_LINE>lineRenderer.setBaseStroke(new BasicStroke(2f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND));<NEW_LINE>// Stroke stroke = new BasicStroke(2f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND);<NEW_LINE>for (int i = 0; i < lineRenderer.getRowCount(); i++) {<NEW_LINE>lineRenderer.setSeriesOutlinePaint(i, ChartThemesConstants.TRANSPARENT_PAINT);<NEW_LINE>lineRenderer.setSeriesFillPaint(i, ChartThemesConstants.EYE_CANDY_SIXTIES_GRADIENT_PAINTS.get(i));<NEW_LINE>lineRenderer.setSeriesPaint(i, ChartThemesConstants.EYE_CANDY_SIXTIES_GRADIENT_PAINTS.get(i));<NEW_LINE>lineRenderer.setSeriesShapesVisible(i, true);<NEW_LINE>// it isn't applied at the moment<NEW_LINE>// lineRenderer.setSeriesStroke(i,stroke);<NEW_LINE>// line3DRenderer.setSeriesLinesVisible(i,lineRenderer.getSeriesVisible(i));<NEW_LINE>}<NEW_LINE>// configureChart(jfreeChart, getPlot());<NEW_LINE>return jfreeChart;<NEW_LINE>}
(LineAndShapeRenderer) categoryPlot.getRenderer();
657,542
private void openDb() {<NEW_LINE>try {<NEW_LINE>File countryFile = new File(mContext.getCacheDir() + "/dbip_country_lite.mmdb");<NEW_LINE>res_to_file(R.raw.dbip_country_lite, countryFile);<NEW_LINE>mCountryReader = new Reader(countryFile);<NEW_LINE>Log.d(TAG, "Country DB loaded: " + mCountryReader.getMetadata());<NEW_LINE>File asnFile = new File(mContext.getCacheDir() + "/dbip_asn_lite.mmdb");<NEW_LINE>res_to_file(R.raw.dbip_asn_lite, asnFile);<NEW_LINE>mAsnReader = new Reader(asnFile);<NEW_LINE>Log.d(TAG, <MASK><NEW_LINE>} catch (IOException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>throw new IllegalStateException();<NEW_LINE>}<NEW_LINE>}
"ASN DB loaded: " + mAsnReader.getMetadata());
1,664,895
protected void insertMessageEvent(MessageEventDefinition messageEventDefinition, StartEvent startEvent, ProcessDefinitionEntity processDefinition, BpmnModel bpmnModel) {<NEW_LINE>CommandContext commandContext = Context.getCommandContext();<NEW_LINE>if (bpmnModel.containsMessageId(messageEventDefinition.getMessageRef())) {<NEW_LINE>Message message = bpmnModel.getMessage(messageEventDefinition.getMessageRef());<NEW_LINE>messageEventDefinition.setMessageRef(message.getName());<NEW_LINE>}<NEW_LINE>// look for subscriptions for the same name in db:<NEW_LINE>List<EventSubscriptionEntity> subscriptionsForSameMessageName = commandContext.getEventSubscriptionEntityManager().findEventSubscriptionsByName(MessageEventHandler.EVENT_HANDLER_TYPE, messageEventDefinition.getMessageRef(), processDefinition.getTenantId());<NEW_LINE>for (EventSubscriptionEntity eventSubscriptionEntity : subscriptionsForSameMessageName) {<NEW_LINE>// throw exception only if there's already a subscription as start event<NEW_LINE>if (eventSubscriptionEntity.getProcessInstanceId() == null || eventSubscriptionEntity.getProcessInstanceId().isEmpty()) {<NEW_LINE>// processInstanceId != null or not empty -> it's a message related to an execution<NEW_LINE>// the event subscription has no instance-id, so it's a message start event<NEW_LINE>throw new ActivitiException("Cannot deploy process definition '" + processDefinition.getResourceName() + "': there already is a message event subscription for the message with name '" + messageEventDefinition.getMessageRef() + "'.");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>MessageEventSubscriptionEntity newSubscription = commandContext.getEventSubscriptionEntityManager().createMessageEventSubscription();<NEW_LINE>newSubscription.setEventName(messageEventDefinition.getMessageRef());<NEW_LINE>newSubscription.setActivityId(startEvent.getId());<NEW_LINE>newSubscription.<MASK><NEW_LINE>newSubscription.setProcessDefinitionId(processDefinition.getId());<NEW_LINE>if (processDefinition.getTenantId() != null) {<NEW_LINE>newSubscription.setTenantId(processDefinition.getTenantId());<NEW_LINE>}<NEW_LINE>commandContext.getEventSubscriptionEntityManager().insert(newSubscription);<NEW_LINE>}
setConfiguration(processDefinition.getId());
1,128,964
protected VirtualizerStore store(JRVirtualizationContext context, boolean create) {<NEW_LINE>VirtualizerStore store;<NEW_LINE>synchronized (contextStores) {<NEW_LINE>store = contextStores.get(context);<NEW_LINE>}<NEW_LINE>if (store != null || !create) {<NEW_LINE>if (log.isTraceEnabled()) {<NEW_LINE>log.trace("found " + store + " for " + context);<NEW_LINE>}<NEW_LINE>return store;<NEW_LINE>}<NEW_LINE>// the context should be locked at this moment<NEW_LINE><MASK><NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("created " + store + " for " + context);<NEW_LINE>}<NEW_LINE>// TODO lucianc<NEW_LINE>// do we need to keep a weak reference to the context, and dispose the store when the reference is cleared?<NEW_LINE>// not doing that for now, assuming that store objects are disposed when garbage collected.<NEW_LINE>synchronized (contextStores) {<NEW_LINE>contextStores.put(context, store);<NEW_LINE>}<NEW_LINE>return store;<NEW_LINE>}
store = storeFactory.createStore(context);
489,617
final AddInstanceGroupsResult executeAddInstanceGroups(AddInstanceGroupsRequest addInstanceGroupsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(addInstanceGroupsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<AddInstanceGroupsRequest> request = null;<NEW_LINE>Response<AddInstanceGroupsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new AddInstanceGroupsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(addInstanceGroupsRequest));<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, "EMR");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<AddInstanceGroupsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new AddInstanceGroupsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.OPERATION_NAME, "AddInstanceGroups");
1,086,393
private Optional<RequestConfig> addJerseyRequestConfig(ClientRequest clientRequest) {<NEW_LINE>final Integer timeout = clientRequest.resolveProperty(ClientProperties.READ_TIMEOUT, Integer.class);<NEW_LINE>final Integer connectTimeout = clientRequest.resolveProperty(ClientProperties.CONNECT_TIMEOUT, Integer.class);<NEW_LINE>final Boolean followRedirects = clientRequest.resolveProperty(ClientProperties.FOLLOW_REDIRECTS, Boolean.class);<NEW_LINE>if (timeout != null || connectTimeout != null || followRedirects != null) {<NEW_LINE>final RequestConfig.Builder <MASK><NEW_LINE>if (timeout != null) {<NEW_LINE>requestConfig.setSocketTimeout(timeout);<NEW_LINE>}<NEW_LINE>if (connectTimeout != null) {<NEW_LINE>requestConfig.setConnectTimeout(connectTimeout);<NEW_LINE>}<NEW_LINE>if (followRedirects != null) {<NEW_LINE>requestConfig.setRedirectsEnabled(followRedirects);<NEW_LINE>}<NEW_LINE>return Optional.of(requestConfig.build());<NEW_LINE>}<NEW_LINE>return Optional.empty();<NEW_LINE>}
requestConfig = RequestConfig.copy(defaultRequestConfig);
888,474
public void valueChanged(ListSelectionEvent e) {<NEW_LINE>final int lastIndex = e.getLastIndex();<NEW_LINE>final int firstIndex = e.getFirstIndex();<NEW_LINE>final DirDiffElementImpl last = myModel.getElementAt(lastIndex);<NEW_LINE>final DirDiffElementImpl first = myModel.getElementAt(firstIndex);<NEW_LINE>if (last == null || first == null) {<NEW_LINE>update(false);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (last.isSeparator()) {<NEW_LINE>final int ind = lastIndex + ((lastIndex < firstIndex) ? 1 : -1);<NEW_LINE>myTable.getSelectionModel().addSelectionInterval(ind, ind);<NEW_LINE>} else if (first.isSeparator()) {<NEW_LINE>final int ind = firstIndex + ((firstIndex < <MASK><NEW_LINE>myTable.getSelectionModel().addSelectionInterval(ind, ind);<NEW_LINE>} else {<NEW_LINE>update(false);<NEW_LINE>}<NEW_LINE>myDiffWindow.setTitle(myModel.getTitle());<NEW_LINE>}
lastIndex) ? 1 : -1);
22,795
public boolean action(Request request, Response response) {<NEW_LINE>if (request.getNettyRequest() instanceof FullHttpRequest) {<NEW_LINE>InputModifyChannelInfo input = getRequestBody(request.getNettyRequest(), InputModifyChannelInfo.class);<NEW_LINE>if (input != null) {<NEW_LINE>WFCMessage.ModifyChannelInfo modifyChannelInfo = WFCMessage.ModifyChannelInfo.newBuilder().setChannelId(channelInfo.getTargetId()).setType(input.getType()).setValue(input.<MASK><NEW_LINE>sendApiMessage(response, IMTopic.ModifyChannelInfoTopic, modifyChannelInfo.toByteArray(), result -> {<NEW_LINE>ByteBuf byteBuf = Unpooled.buffer();<NEW_LINE>byteBuf.writeBytes(result);<NEW_LINE>ErrorCode errorCode = ErrorCode.fromCode(byteBuf.readByte());<NEW_LINE>if (errorCode == ErrorCode.ERROR_CODE_SUCCESS) {<NEW_LINE>sendResponse(response, null, null);<NEW_LINE>} else {<NEW_LINE>sendResponse(response, errorCode, null);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return false;<NEW_LINE>} else {<NEW_LINE>setResponseContent(RestResult.resultOf(ErrorCode.INVALID_PARAMETER), response);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
getValue()).build();
1,682,727
Builder addDeps(List<? extends TransitiveInfoCollection> deps) {<NEW_LINE>ImmutableList.Builder<ObjcProvider> objcProviders = ImmutableList.builder();<NEW_LINE>ImmutableList.Builder<CcInfo> ccInfos = ImmutableList.builder();<NEW_LINE>ImmutableList.Builder<CcLinkingContext> ccLinkingContexts = ImmutableList.builder();<NEW_LINE>ImmutableList.Builder<CcLinkingContext> ccLinkStampContexts = ImmutableList.builder();<NEW_LINE>for (TransitiveInfoCollection dep : deps) {<NEW_LINE>if (dep.get(ObjcProvider.STARLARK_CONSTRUCTOR) != null) {<NEW_LINE>addAnyProviders(objcProviders, dep, ObjcProvider.STARLARK_CONSTRUCTOR);<NEW_LINE>} else {<NEW_LINE>// We only use CcInfo's linking info if there is no ObjcProvider. This is required so<NEW_LINE>// that objc_library archives do not get treated as if they are from cc targets.<NEW_LINE>addAnyContexts(ccLinkingContexts, dep, CcInfo.PROVIDER, CcInfo::getCcLinkingContext);<NEW_LINE>}<NEW_LINE>addAnyProviders(ccInfos, dep, CcInfo.PROVIDER);<NEW_LINE>// Temporary solution to specially handle LinkStamps, so that they don't get dropped. When<NEW_LINE>// linking info has been fully migrated to CcInfo, we can drop this.<NEW_LINE>addAnyContexts(ccLinkStampContexts, dep, CcInfo.PROVIDER, CcInfo::getCcLinkingContext);<NEW_LINE>}<NEW_LINE>addObjcProviders(objcProviders.build());<NEW_LINE>addCcCompilationContexts(ccInfos.build());<NEW_LINE>this.ccLinkingContexts = Iterables.concat(this.<MASK><NEW_LINE>this.ccLinkStampContexts = Iterables.concat(this.ccLinkStampContexts, ccLinkStampContexts.build());<NEW_LINE>return this;<NEW_LINE>}
ccLinkingContexts, ccLinkingContexts.build());
1,195,970
final DescribeEndpointsResult executeDescribeEndpoints(DescribeEndpointsRequest describeEndpointsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeEndpointsRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeEndpointsRequest> request = null;<NEW_LINE>Response<DescribeEndpointsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeEndpointsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeEndpointsRequest));<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, "Timestream Query");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeEndpoints");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeEndpointsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeEndpointsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
1,214,640
private Map<String, String> globalTagsExpressionToMap(Config globalTagExpression) {<NEW_LINE>String pairs = globalTagExpression.asString().get();<NEW_LINE>Map<String, String> result = new HashMap<>();<NEW_LINE>List<String> errorPairs = new ArrayList<>();<NEW_LINE>String[] assignments = pairs.split(",");<NEW_LINE>for (String assignment : assignments) {<NEW_LINE>int equalsSlot = assignment.indexOf("=");<NEW_LINE>if (equalsSlot == -1) {<NEW_LINE><MASK><NEW_LINE>} else if (equalsSlot == 0) {<NEW_LINE>errorPairs.add("Missing tag name: " + assignment);<NEW_LINE>} else if (equalsSlot == assignment.length() - 1) {<NEW_LINE>errorPairs.add("Missing tag value: " + assignment);<NEW_LINE>} else {<NEW_LINE>result.put(assignment.substring(0, equalsSlot), assignment.substring(equalsSlot + 1));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!errorPairs.isEmpty()) {<NEW_LINE>throw new IllegalArgumentException("Error(s) in global tag expression: " + errorPairs);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
errorPairs.add("Missing '=': " + assignment);
1,599,194
public void onReceiveRegisterResult(Context context, MiPushCommandMessage miPushCommandMessage) {<NEW_LINE>DemoLog.d(TAG, "onReceiveRegisterResult is called. " + miPushCommandMessage.toString());<NEW_LINE>String command = miPushCommandMessage.getCommand();<NEW_LINE>List<String> arguments = miPushCommandMessage.getCommandArguments();<NEW_LINE>String cmdArg1 = ((arguments != null && arguments.size() > 0) ? arguments.get(0) : null);<NEW_LINE>DemoLog.d(TAG, "cmd: " + command + " | arg: " + cmdArg1 + " | result: " + miPushCommandMessage.getResultCode() + " | reason: " + miPushCommandMessage.getReason());<NEW_LINE>if (MiPushClient.COMMAND_REGISTER.equals(command)) {<NEW_LINE>if (miPushCommandMessage.getResultCode() == ErrorCode.SUCCESS) {<NEW_LINE>mRegId = cmdArg1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>DemoLog.<MASK><NEW_LINE>if (PushSetting.isTPNSChannel) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ThirdPushTokenMgr.getInstance().setThirdPushToken(mRegId);<NEW_LINE>ThirdPushTokenMgr.getInstance().setPushTokenToTIM();<NEW_LINE>}
d(TAG, "regId: " + mRegId);
203,798
// POST /api/admin/searchlist/doc<NEW_LINE>@Execute<NEW_LINE>public JsonResponse<ApiResult> post$doc(final EditBody body) {<NEW_LINE>validateApi(body, messages -> {<NEW_LINE>});<NEW_LINE>if (body.doc == null) {<NEW_LINE>throwValidationErrorApi(messages -> messages.addErrorsCrudFailedToCreateCrudTable(GLOBAL, "doc is required"));<NEW_LINE>}<NEW_LINE>validateFields(body, this::throwValidationErrorApi);<NEW_LINE>body.crudMode = CrudMode.EDIT;<NEW_LINE>final Map<String, Object> doc = getDoc(body).map(entity -> {<NEW_LINE>final <MASK><NEW_LINE>try {<NEW_LINE>entity.putAll(fessConfig.convertToStorableDoc(body.doc));<NEW_LINE>final String newId = ComponentUtil.getCrawlingInfoHelper().generateId(entity);<NEW_LINE>final String oldId = (String) entity.get(fessConfig.getIndexFieldId());<NEW_LINE>if (!newId.equals(oldId)) {<NEW_LINE>entity.put(fessConfig.getIndexFieldId(), newId);<NEW_LINE>entity.remove(fessConfig.getIndexFieldVersion());<NEW_LINE>final Number seqNo = (Number) entity.remove(fessConfig.getIndexFieldSeqNo());<NEW_LINE>final Number primaryTerm = (Number) entity.remove(fessConfig.getIndexFieldPrimaryTerm());<NEW_LINE>if (seqNo != null && primaryTerm != null && oldId != null) {<NEW_LINE>searchEngineClient.delete(index, oldId, seqNo, primaryTerm);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>searchEngineClient.store(index, entity);<NEW_LINE>saveInfo(messages -> messages.addSuccessCrudUpdateCrudTable(GLOBAL));<NEW_LINE>} catch (final Exception e) {<NEW_LINE>logger.error("Failed to update {}", entity, e);<NEW_LINE>throwValidationErrorApi(messages -> messages.addErrorsCrudFailedToUpdateCrudTable(GLOBAL, buildThrowableMessage(e)));<NEW_LINE>}<NEW_LINE>return entity;<NEW_LINE>}).orElseGet(() -> {<NEW_LINE>throwValidationErrorApi(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, body.doc.toString()));<NEW_LINE>return null;<NEW_LINE>});<NEW_LINE>return asJson(new ApiUpdateResponse().id(doc.get(fessConfig.getIndexFieldDocId()).toString()).created(false).status(Status.OK).result());<NEW_LINE>}
String index = fessConfig.getIndexDocumentUpdateIndex();
171,923
public static IFilledList<TraceList> loadTraces(final AbstractSQLProvider provider, final String tableName, final String columnName, final int containerId, final List<? extends INaviModule> modules) throws CouldntLoadDataException {<NEW_LINE>Preconditions.checkNotNull(provider, "IE00590: Provider argument can not be null");<NEW_LINE>Preconditions.checkNotNull(tableName, "IE00591: Table name argument can not be null");<NEW_LINE>Preconditions.checkNotNull(columnName, "IE00592: Column name argument can not be null");<NEW_LINE>final String query = "select id, name, description from " + CTableNames.TRACES_TABLE + " join " + tableName + " on " + tableName + ".trace_id = " + CTableNames.TRACES_TABLE + ".id where " + tableName + "." + columnName + " = " + containerId;<NEW_LINE>final CConnection connection = provider.getConnection();<NEW_LINE>final IFilledList<TraceList> traces = new FilledList<TraceList>();<NEW_LINE>try {<NEW_LINE>final ResultSet resultSet = connection.executeQuery(query, true);<NEW_LINE>try {<NEW_LINE>while (resultSet.next()) {<NEW_LINE>final int traceId = resultSet.getInt("id");<NEW_LINE>final String name = PostgreSQLHelpers.readString(resultSet, "name");<NEW_LINE>final String description = <MASK><NEW_LINE>final TraceList traceList = new TraceList(traceId, name, description, provider);<NEW_LINE>loadTraceEvents(connection, traceList, modules);<NEW_LINE>traces.add(traceList);<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>resultSet.close();<NEW_LINE>}<NEW_LINE>} catch (final SQLException exception) {<NEW_LINE>throw new CouldntLoadDataException(exception);<NEW_LINE>}<NEW_LINE>return traces;<NEW_LINE>}
PostgreSQLHelpers.readString(resultSet, "description");
175,581
static String resolveValue(String value, Function<String, String> propertiesGetter) {<NEW_LINE>value = value.trim();<NEW_LINE>String value0 = value;<NEW_LINE>if (value.startsWith(PROPERTY_PREFIX))<NEW_LINE>value = value.substring(PROPERTY_PREFIX.length());<NEW_LINE>else if (!value.startsWith(VARIABLE_PREFIX))<NEW_LINE>return value;<NEW_LINE>boolean optional = false;<NEW_LINE>if (value.startsWith(OPTIONAL_PREFIX)) {<NEW_LINE>value = value.substring(OPTIONAL_PREFIX.length());<NEW_LINE>optional = true;<NEW_LINE>}<NEW_LINE>String <MASK><NEW_LINE>if (newValue == null) {<NEW_LINE>if (optional)<NEW_LINE>return "null";<NEW_LINE>throw new IllegalArgumentException("variable or property '" + value + "' not found");<NEW_LINE>}<NEW_LINE>if (newValue.equals(value0))<NEW_LINE>throw new IllegalArgumentException("endless recursion in variable or property '" + value + "'");<NEW_LINE>return resolveValue(newValue, propertiesGetter);<NEW_LINE>}
newValue = propertiesGetter.apply(value);
1,275,987
ArrayList<Object> new25() /* reduce AAfilebody1FileBody */<NEW_LINE>{<NEW_LINE>@SuppressWarnings("hiding")<NEW_LINE>ArrayList<Object> nodeList = new ArrayList<Object>();<NEW_LINE>@SuppressWarnings("unused")<NEW_LINE>ArrayList<MASK><NEW_LINE>@SuppressWarnings("unused")<NEW_LINE>ArrayList<Object> nodeArrayList1 = pop();<NEW_LINE>PFileBody pfilebodyNode1;<NEW_LINE>{<NEW_LINE>// Block<NEW_LINE>TLBrace tlbraceNode2;<NEW_LINE>LinkedList<Object> listNode3 = new LinkedList<Object>();<NEW_LINE>TRBrace trbraceNode4;<NEW_LINE>tlbraceNode2 = (TLBrace) nodeArrayList1.get(0);<NEW_LINE>{<NEW_LINE>// Block<NEW_LINE>}<NEW_LINE>trbraceNode4 = (TRBrace) nodeArrayList2.get(0);<NEW_LINE>pfilebodyNode1 = new AFileBody(tlbraceNode2, listNode3, trbraceNode4);<NEW_LINE>}<NEW_LINE>nodeList.add(pfilebodyNode1);<NEW_LINE>return nodeList;<NEW_LINE>}
<Object> nodeArrayList2 = pop();
1,792,396
public void run(RegressionEnvironment env) {<NEW_LINE>String epl = "@name('s0') select symbol as currSymbol, " + " prior(3, symbol) as priorSymbol, " + " prior(2, price) as priorPrice " + "from SupportMarketDataBean";<NEW_LINE>env.compileDeploy(epl).addListener("s0");<NEW_LINE>// assert select result type<NEW_LINE>env.assertStatement("s0", statement -> {<NEW_LINE>assertEquals(String.class, statement.getEventType().getPropertyType("priorSymbol"));<NEW_LINE>assertEquals(Double.class, statement.getEventType().getPropertyType("priorPrice"));<NEW_LINE>});<NEW_LINE>sendMarketEvent(env, "A", 1);<NEW_LINE>assertNewEvents(env, "A", null, null);<NEW_LINE>env.milestone(1);<NEW_LINE>sendMarketEvent(env, "B", 2);<NEW_LINE>assertNewEvents(env, "B", null, null);<NEW_LINE>env.milestone(2);<NEW_LINE>sendMarketEvent(env, "C", 3);<NEW_LINE>assertNewEvents(env, "C", null, 1d);<NEW_LINE>env.milestone(3);<NEW_LINE>sendMarketEvent(env, "D", 4);<NEW_LINE>assertNewEvents(env, "D", "A", 2d);<NEW_LINE>env.milestone(4);<NEW_LINE>sendMarketEvent(env, "E", 5);<NEW_LINE>assertNewEvents(<MASK><NEW_LINE>env.undeployAll();<NEW_LINE>}
env, "E", "B", 3d);
1,706,059
private void resolveOrFail(final ClassNode type, final String msg, final ASTNode node, final boolean preferImports) {<NEW_LINE>if (preferImports) {<NEW_LINE>resolveGenericsTypes(type.getGenericsTypes());<NEW_LINE>if (resolveAliasFromModule(type))<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (resolve(type))<NEW_LINE>return;<NEW_LINE>ClassNode temp = type;<NEW_LINE>while (// GROOVY-8715<NEW_LINE>temp.isArray()<MASK><NEW_LINE>final String name = temp.getName();<NEW_LINE>String nameAsType = name.replace('.', '$');<NEW_LINE>ModuleNode module = currentClass.getModule();<NEW_LINE>if (!name.equals(nameAsType) && module.hasPackageName()) {<NEW_LINE>// check qualified reference for a same-package type<NEW_LINE>temp.setName(module.getPackageName() + nameAsType);<NEW_LINE>if (resolve(temp, false, false, false))<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// check reference for an on-demand imported type<NEW_LINE>for (ImportNode star : module.getStarImports()) {<NEW_LINE>String cName = star.getClassName();<NEW_LINE>if (cName != null) {<NEW_LINE>temp.setName(cName + '$' + nameAsType);<NEW_LINE>if (resolve(temp, false, false, false))<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// check qualified reference<NEW_LINE>if (!name.equals(nameAsType)) {<NEW_LINE>// ... resolved by default imports<NEW_LINE>for (String pack : DEFAULT_IMPORTS) {<NEW_LINE>temp.setName(pack + nameAsType);<NEW_LINE>if (resolve(temp, false, false, false))<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>temp.setName(name);<NEW_LINE>addError("unable to resolve class " + name + msg, temp.getEnd() > 0 ? temp : node);<NEW_LINE>// GRECLIPSE end<NEW_LINE>}
) temp = temp.getComponentType();
1,708,761
public EntityRecognizerMetadataEntityTypesListItem unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>AwsJsonReader reader = context.getReader();<NEW_LINE>if (!reader.isContainer()) {<NEW_LINE>reader.skipValue();<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>EntityRecognizerMetadataEntityTypesListItem entityRecognizerMetadataEntityTypesListItem = new EntityRecognizerMetadataEntityTypesListItem();<NEW_LINE>reader.beginObject();<NEW_LINE>while (reader.hasNext()) {<NEW_LINE>String name = reader.nextName();<NEW_LINE>if (name.equals("Type")) {<NEW_LINE>entityRecognizerMetadataEntityTypesListItem.setType(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("EvaluationMetrics")) {<NEW_LINE>entityRecognizerMetadataEntityTypesListItem.setEvaluationMetrics(EntityTypesEvaluationMetricsJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("NumberOfTrainMentions")) {<NEW_LINE>entityRecognizerMetadataEntityTypesListItem.setNumberOfTrainMentions(IntegerJsonUnmarshaller.getInstance<MASK><NEW_LINE>} else {<NEW_LINE>reader.skipValue();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>reader.endObject();<NEW_LINE>return entityRecognizerMetadataEntityTypesListItem;<NEW_LINE>}
().unmarshall(context));
15,839
private void saveFilter() {<NEW_LINE>final OsmandApplication app = getMyApplication();<NEW_LINE>AlertDialog.Builder builder = new AlertDialog.Builder(getContext());<NEW_LINE>builder.setTitle(R.string.access_hint_enter_name);<NEW_LINE>final EditText editText = new EditText(getContext());<NEW_LINE>editText.setHint(R.string.new_filter);<NEW_LINE>editText.<MASK><NEW_LINE>final TextView textView = new TextView(getContext());<NEW_LINE>textView.setText(app.getString(R.string.new_filter_desc));<NEW_LINE>textView.setTextAppearance(getContext(), R.style.TextAppearance_ContextMenuSubtitle);<NEW_LINE>LinearLayout ll = new LinearLayout(getContext());<NEW_LINE>ll.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT));<NEW_LINE>ll.setOrientation(LinearLayout.VERTICAL);<NEW_LINE>ll.setPadding(AndroidUtils.dpToPx(getContext(), 20f), AndroidUtils.dpToPx(getContext(), 12f), AndroidUtils.dpToPx(getContext(), 20f), AndroidUtils.dpToPx(getContext(), 12f));<NEW_LINE>ll.addView(editText, new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT));<NEW_LINE>textView.setPadding(AndroidUtils.dpToPx(getContext(), 4f), AndroidUtils.dpToPx(getContext(), 6f), AndroidUtils.dpToPx(getContext(), 4f), AndroidUtils.dpToPx(getContext(), 4f));<NEW_LINE>ll.addView(textView, new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT));<NEW_LINE>builder.setView(ll);<NEW_LINE>builder.setNegativeButton(R.string.shared_string_cancel, null);<NEW_LINE>builder.setPositiveButton(R.string.shared_string_save, new DialogInterface.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(DialogInterface dialog, int which) {<NEW_LINE>String filterName = editText.getText().toString();<NEW_LINE>PoiUIFilter nFilter = new PoiUIFilter(filterName, null, filter.getAcceptedTypes(), app);<NEW_LINE>applyFilterFields();<NEW_LINE>if (!Algorithms.isEmpty(filter.getFilterByName())) {<NEW_LINE>nFilter.setSavedFilterByName(filter.getFilterByName());<NEW_LINE>}<NEW_LINE>if (app.getPoiFilters().createPoiFilter(nFilter, false)) {<NEW_LINE>Toast.makeText(getContext(), getContext().getString(R.string.edit_filter_create_message, filterName), Toast.LENGTH_SHORT).show();<NEW_LINE>app.getSearchUICore().refreshCustomPoiFilters();<NEW_LINE>((QuickSearchDialogFragment) getParentFragment()).replaceQueryWithUiFilter(nFilter, "");<NEW_LINE>((QuickSearchDialogFragment) getParentFragment()).reloadCategories();<NEW_LINE>QuickSearchPoiFilterFragment.this.dismiss();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>builder.create().show();<NEW_LINE>}
setText(filter.getName());
290,889
private boolean unlink(Entry<K, V> entry) {<NEW_LINE>assert lruLock.isHeldByCurrentThread();<NEW_LINE>if (entry.state == State.EXISTING) {<NEW_LINE>final Entry<K, V> before = entry.before;<NEW_LINE>final Entry<K, V> after = entry.after;<NEW_LINE>if (before == null) {<NEW_LINE>// removing the head<NEW_LINE>assert head == entry;<NEW_LINE>head = after;<NEW_LINE>if (head != null) {<NEW_LINE>head.before = null;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// removing inner element<NEW_LINE>before.after = after;<NEW_LINE>entry.before = null;<NEW_LINE>}<NEW_LINE>if (after == null) {<NEW_LINE>// removing tail<NEW_LINE>assert tail == entry;<NEW_LINE>tail = before;<NEW_LINE>if (tail != null) {<NEW_LINE>tail.after = null;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// removing inner element<NEW_LINE>after.before = before;<NEW_LINE>entry.after = null;<NEW_LINE>}<NEW_LINE>count--;<NEW_LINE>weight -= weigher.applyAsLong(<MASK><NEW_LINE>entry.state = State.DELETED;<NEW_LINE>return true;<NEW_LINE>} else {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}
entry.key, entry.value);
1,709,289
public static void showAbout(Shell shell, Analytics analytics, Widgets widgets) {<NEW_LINE>analytics.postInteraction(View.About, ClientAction.Show);<NEW_LINE>new DialogBase(shell, widgets.theme) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String getTitle() {<NEW_LINE>return Messages.ABOUT_TITLE;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected Control createDialogArea(Composite parent) {<NEW_LINE>Composite area = (Composite) super.createDialogArea(parent);<NEW_LINE>Composite container = createComposite(area, withMargin(new GridLayout(2, false), 20, 5));<NEW_LINE>container.setLayoutData(new GridData(SWT.CENTER, SWT.FILL, true, false));<NEW_LINE>Label logo = createLabel(container, "", theme.dialogLogo());<NEW_LINE>logo.setLayoutData(new GridData(SWT.CENTER, SWT.FILL, true, false, 2, 1));<NEW_LINE>StyledText title = createSelectableLabel(container, Messages.WINDOW_TITLE);<NEW_LINE>title.setFont(theme.bigBoldFont());<NEW_LINE>title.setLayoutData(new GridData(SWT.CENTER, SWT.FILL, true, false, 2, 1));<NEW_LINE>createLabel(container, "").setLayoutData(new GridData(SWT.CENTER, SWT.FILL, true, true, 2, 1));<NEW_LINE>Button clipboard = Widgets.createButton(container, "", e -> {<NEW_LINE>String textData = "Version " + GAPID_VERSION.toStringWithYear(true);<NEW_LINE>widgets.copypaste.setContents(textData);<NEW_LINE>});<NEW_LINE>clipboard.setImage(theme.clipboard());<NEW_LINE>clipboard.setLayoutData(new GridData(SWT.CENTER, SWT.BEGINNING, true, true, 1, 3));<NEW_LINE>createSelectableLabel(container, "Version " + GAPID_VERSION.toStringWithYear(true));<NEW_LINE>createSelectableLabel(container, "Server: " + Info.getServerName() + ", Version: " + Info.getServerVersion());<NEW_LINE>createSelectableLabel(container, Messages.ABOUT_COPY);<NEW_LINE>return area;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void createButtonsForButtonBar(Composite parent) {<NEW_LINE>createButton(parent, IDialogConstants.<MASK><NEW_LINE>}<NEW_LINE>}.open();<NEW_LINE>}
OK_ID, IDialogConstants.OK_LABEL, true);
185,383
private DatagramPacket decode(DatagramPacket packet) {<NEW_LINE>try {<NEW_LINE>byte[] data = packet.getData();<NEW_LINE>int offset = packet.getOffset();<NEW_LINE><MASK><NEW_LINE>int addressLength = data[offset + CLUSTER_ADDRESS_LENGTH_OFFSET] & 0xff;<NEW_LINE>int port = (data[offset + CLUSTER_PORT_OFFSET] & 0xff) | ((data[offset + CLUSTER_PORT_OFFSET + 1] & 0xff) << 8);<NEW_LINE>byte[] address = Arrays.copyOfRange(data, offset + CLUSTER_ADDRESS_OFFSET, offset + CLUSTER_ADDRESS_OFFSET + addressLength);<NEW_LINE>int headerLength = CLUSTER_ADDRESS_OFFSET + addressLength + getClusterMacLength();<NEW_LINE>InetAddress iaddr = InetAddress.getByAddress(address);<NEW_LINE>packet.setAddress(iaddr);<NEW_LINE>packet.setPort(port);<NEW_LINE>packet.setData(data, offset + headerLength, length - headerLength);<NEW_LINE>return packet;<NEW_LINE>} catch (UnknownHostException e) {<NEW_LINE>return null;<NEW_LINE>} catch (RuntimeException e) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}
int length = packet.getLength();
1,333,996
public List<Feature> bind(StructType schema) {<NEW_LINE>List<Feature> features = new ArrayList<>();<NEW_LINE>for (Feature feature : x.bind(schema)) {<NEW_LINE>StructField xfield = feature.field();<NEW_LINE>DataType type = xfield.type;<NEW_LINE>if (!(type.isDouble() || type.isFloat() || type.isInt() || type.isLong() || type.isShort() || type.isByte())) {<NEW_LINE>throw new IllegalStateException(String.format<MASK><NEW_LINE>}<NEW_LINE>features.add(new Feature() {<NEW_LINE><NEW_LINE>final StructField field = new StructField(String.format("%s(%s)", name, xfield.name), type.id() == DataType.ID.Object ? DataTypes.DoubleObjectType : DataTypes.DoubleType, xfield.measure);<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public StructField field() {<NEW_LINE>return field;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Double apply(Tuple o) {<NEW_LINE>Object y = feature.apply(o);<NEW_LINE>if (y == null)<NEW_LINE>return null;<NEW_LINE>else<NEW_LINE>return lambda.apply(((Number) y).doubleValue());<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public double applyAsDouble(Tuple o) {<NEW_LINE>return lambda.apply(feature.applyAsDouble(o));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>return features;<NEW_LINE>}
("Invalid expression: %s(%s)", name, type));
1,187,790
protected JSDynamicObject doSetIterator(VirtualFrame frame, JSDynamicObject iterator) {<NEW_LINE>Object set = getIteratedObjectNode.getValue(iterator);<NEW_LINE>if (detachedProf.profile(set == Undefined.instance)) {<NEW_LINE>return createIterResultObjectNode.execute(frame, Undefined.instance, true);<NEW_LINE>}<NEW_LINE>JSHashMap.Cursor mapCursor = (JSHashMap.Cursor) getNextIndexNode.getValue(iterator);<NEW_LINE>int itemKind = getIterationKind(iterator);<NEW_LINE>if (doneProf.profile(!mapCursor.advance())) {<NEW_LINE>setIteratedObjectNode.setValue(iterator, Undefined.instance);<NEW_LINE>return createIterResultObjectNode.execute(frame, Undefined.instance, true);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>Object result;<NEW_LINE>if (iterKindProf.profile(itemKind == JSRuntime.ITERATION_KIND_VALUE)) {<NEW_LINE>result = elementValue;<NEW_LINE>} else {<NEW_LINE>assert itemKind == JSRuntime.ITERATION_KIND_KEY_PLUS_VALUE;<NEW_LINE>result = JSArray.createConstantObjectArray(getContext(), getRealm(), new Object[] { elementValue, elementValue });<NEW_LINE>}<NEW_LINE>return createIterResultObjectNode.execute(frame, result, false);<NEW_LINE>}
Object elementValue = mapCursor.getKey();
1,077,501
private void attribute(ClassWriter classWriter, ParamDefinition parameter, String methodName) throws NoSuchMethodException {<NEW_LINE>MethodVisitor methodVisitor = classWriter.visitMethod(ACC_PRIVATE | ACC_STATIC, methodName, "(Lio/jooby/Context;Ljava/lang/String;)Ljava/lang/Object;", "<T:Ljava/lang/Object;>(Lio/jooby/Context;Ljava/lang/String;)TT;", null);<NEW_LINE><MASK><NEW_LINE>methodVisitor.visitParameter("name", 0);<NEW_LINE>methodVisitor.visitCode();<NEW_LINE>methodVisitor.visitVarInsn(ALOAD, 0);<NEW_LINE>methodVisitor.visitVarInsn(ALOAD, 1);<NEW_LINE>Method attribute = parameter.getSingleValue();<NEW_LINE>methodVisitor.visitMethodInsn(INVOKEINTERFACE, getInternalName(attribute.getDeclaringClass()), attribute.getName(), getMethodDescriptor(attribute), true);<NEW_LINE>// if (attribute == null)<NEW_LINE>if (parameter.is(Map.class, String.class, Object.class)) {<NEW_LINE>// return ctx.getAttributes();<NEW_LINE>methodVisitor.visitVarInsn(ASTORE, 2);<NEW_LINE>Label label1 = new Label();<NEW_LINE>methodVisitor.visitLabel(label1);<NEW_LINE>methodVisitor.visitVarInsn(ALOAD, 2);<NEW_LINE>Label label2 = new Label();<NEW_LINE>methodVisitor.visitJumpInsn(IFNONNULL, label2);<NEW_LINE>Label label3 = new Label();<NEW_LINE>methodVisitor.visitLabel(label3);<NEW_LINE>methodVisitor.visitVarInsn(ALOAD, 0);<NEW_LINE>Method attributes = parameter.getObjectValue();<NEW_LINE>methodVisitor.visitMethodInsn(INVOKEINTERFACE, getInternalName(attributes.getDeclaringClass()), attributes.getName(), getMethodDescriptor(attributes), true);<NEW_LINE>methodVisitor.visitInsn(ARETURN);<NEW_LINE>methodVisitor.visitLabel(label2);<NEW_LINE>methodVisitor.visitFrame(Opcodes.F_APPEND, 1, new Object[] { "java/lang/Object" }, 0, null);<NEW_LINE>methodVisitor.visitVarInsn(ALOAD, 2);<NEW_LINE>}<NEW_LINE>methodVisitor.visitInsn(ARETURN);<NEW_LINE>methodVisitor.visitMaxs(0, 0);<NEW_LINE>methodVisitor.visitEnd();<NEW_LINE>}
methodVisitor.visitParameter("ctx", 0);
191,599
public String createConnectorId(ClientConnector connector) {<NEW_LINE>if (connector instanceof Component) {<NEW_LINE>Component component = (Component) connector;<NEW_LINE>String id = component.getId() == null ? super.createConnectorId(connector) : component.getId();<NEW_LINE>UserSession session = getAttribute(UserSession.class);<NEW_LINE>String login = null;<NEW_LINE>String locale = null;<NEW_LINE>if (session != null) {<NEW_LINE>login = session.getCurrentOrSubstitutedUser().getLogin();<NEW_LINE>if (session.getLocale() != null) {<NEW_LINE>locale = session.getLocale().toLanguageTag();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>StringBuilder idParts = new StringBuilder();<NEW_LINE>if (login != null) {<NEW_LINE>idParts.append(login);<NEW_LINE>}<NEW_LINE>if (locale != null) {<NEW_LINE>idParts.append(locale);<NEW_LINE>}<NEW_LINE>idParts.append(id);<NEW_LINE>return <MASK><NEW_LINE>}<NEW_LINE>return super.createConnectorId(connector);<NEW_LINE>}
toLongNumberString(idParts.toString());