idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
1,709,172 | private static Collection<VariableTree> findVarsUsages(final Collection<VariableTree> vars, final List<? extends StatementTree> stms, final CompilationUnitTree cu, final Trees trees) {<NEW_LINE>final Map<Element, VariableTree> elms = new HashMap<Element, VariableTree>();<NEW_LINE>for (VariableTree var : vars) {<NEW_LINE>final Element elm = trees.getElement(trees.getPath(cu, var));<NEW_LINE>if (elm != null) {<NEW_LINE>elms.put(elm, var);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final Set<VariableTree> result = new HashSet<VariableTree>();<NEW_LINE>final ErrorAwareTreeScanner<Void, Void> scanner = new ErrorAwareTreeScanner<Void, Void>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Void visitIdentifier(IdentifierTree node, Void p) {<NEW_LINE>final Element elm = trees.getElement(trees<MASK><NEW_LINE>final VariableTree var = elms.get(elm);<NEW_LINE>if (var != null) {<NEW_LINE>result.add(var);<NEW_LINE>}<NEW_LINE>return super.visitIdentifier(node, p);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>scanner.scan(stms, null);<NEW_LINE>vars.retainAll(result);<NEW_LINE>return vars;<NEW_LINE>} | .getPath(cu, node)); |
1,493,027 | private static void findSyntacticRelationsFromDependency(List<Mention> orderedMentions) {<NEW_LINE>if (orderedMentions.size() == 0)<NEW_LINE>return;<NEW_LINE>markListMemberRelation(orderedMentions);<NEW_LINE>SemanticGraph dependency = orderedMentions.get(0).enhancedDependency;<NEW_LINE>// apposition<NEW_LINE>Set<Pair<Integer, Integer>> appos = Generics.newHashSet();<NEW_LINE>List<SemanticGraphEdge> appositions = dependency.findAllRelns(UniversalEnglishGrammaticalRelations.APPOSITIONAL_MODIFIER);<NEW_LINE>for (SemanticGraphEdge edge : appositions) {<NEW_LINE>int sIdx = edge.getSource().index() - 1;<NEW_LINE>int tIdx = edge.getTarget().index() - 1;<NEW_LINE>appos.add(Pair.makePair(sIdx, tIdx));<NEW_LINE>}<NEW_LINE>markMentionRelation(orderedMentions, appos, "APPOSITION");<NEW_LINE>// predicate nominatives<NEW_LINE>Set<Pair<Integer, Integer>> preNomi = Generics.newHashSet();<NEW_LINE>List<SemanticGraphEdge> copula = dependency.findAllRelns(UniversalEnglishGrammaticalRelations.COPULA);<NEW_LINE>for (SemanticGraphEdge edge : copula) {<NEW_LINE>IndexedWord source = edge.getSource();<NEW_LINE>IndexedWord target = dependency.getChildWithReln(source, UniversalEnglishGrammaticalRelations.NOMINAL_SUBJECT);<NEW_LINE>if (target == null)<NEW_LINE>target = dependency.getChildWithReln(source, UniversalEnglishGrammaticalRelations.CLAUSAL_SUBJECT);<NEW_LINE>// TODO<NEW_LINE>if (target == null)<NEW_LINE>continue;<NEW_LINE>// to handle relative clause: e.g., Tim who is a student,<NEW_LINE>if (target.tag().startsWith("W")) {<NEW_LINE>IndexedWord parent = dependency.getParent(source);<NEW_LINE>if (parent != null && dependency.reln(parent, source).equals(UniversalEnglishGrammaticalRelations.RELATIVE_CLAUSE_MODIFIER)) {<NEW_LINE>target = parent;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int sIdx <MASK><NEW_LINE>int tIdx = target.index() - 1;<NEW_LINE>preNomi.add(Pair.makePair(tIdx, sIdx));<NEW_LINE>}<NEW_LINE>markMentionRelation(orderedMentions, preNomi, "PREDICATE_NOMINATIVE");<NEW_LINE>// relative pronouns TODO<NEW_LINE>Set<Pair<Integer, Integer>> relativePronounPairs = Generics.newHashSet();<NEW_LINE>markMentionRelation(orderedMentions, relativePronounPairs, "RELATIVE_PRONOUN");<NEW_LINE>} | = source.index() - 1; |
51,825 | void receiveCommand(Item item, Command command, ZWaveNode node, ZWaveThermostatModeCommandClass commandClass, int endpointId, Map<String, String> arguments) {<NEW_LINE>ZWaveCommandConverter<?, ?> converter = this.getCommandConverter(command.getClass());<NEW_LINE>if (converter == null) {<NEW_LINE>logger.warn("NODE {}: No converter found for item = {}, endpoint = {}, ignoring command.", node.getNodeId(), item.getName(), endpointId);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>logger.debug("NODE {}: receiveCommand with converter {} ", node.getNodeId(), converter.getClass());<NEW_LINE>SerialMessage serialMessage = node.encapsulate(commandClass.setValueMessage((Integer) converter.convertFromCommandToValue(item, command)), commandClass, endpointId);<NEW_LINE>logger.debug("NODE {}: receiveCommand sending message {} ", node.getNodeId(), serialMessage);<NEW_LINE>if (serialMessage == null) {<NEW_LINE>logger.warn("NODE {}: Generating message failed for command class = {}, endpoint = {}", node.getNodeId(), commandClass.getCommandClass().getLabel(), endpointId);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>this.<MASK><NEW_LINE>if (command instanceof State) {<NEW_LINE>this.getEventPublisher().postUpdate(item.getName(), (State) command);<NEW_LINE>}<NEW_LINE>} | getController().sendData(serialMessage); |
768,959 | protected DatadogReporter createInstance() {<NEW_LINE>final DatadogReporter.Builder reporter = DatadogReporter.forRegistry(getMetricRegistry());<NEW_LINE>final Transport transport;<NEW_LINE>String transportName = getProperty(TRANSPORT);<NEW_LINE>if ("http".equalsIgnoreCase(transportName)) {<NEW_LINE>HttpTransport.Builder builder = new HttpTransport.Builder();<NEW_LINE>builder.withApiKey(getProperty(API_KEY));<NEW_LINE>if (hasProperty(CONNECT_TIMEOUT)) {<NEW_LINE>builder.withConnectTimeout(getProperty(CONNECT_TIMEOUT, Integer.class));<NEW_LINE>}<NEW_LINE>if (hasProperty(SOCKET_TIMEOUT)) {<NEW_LINE>builder.withSocketTimeout(getProperty(SOCKET_TIMEOUT, Integer.class));<NEW_LINE>}<NEW_LINE>transport = builder.build();<NEW_LINE>} else if ("udp".equalsIgnoreCase(transportName) || "statsd".equalsIgnoreCase(transportName)) {<NEW_LINE>UdpTransport.Builder builder = new UdpTransport.Builder();<NEW_LINE>if (hasProperty(STATSD_HOST)) {<NEW_LINE>builder.withStatsdHost(getProperty(STATSD_HOST));<NEW_LINE>}<NEW_LINE>if (hasProperty(STATSD_PORT)) {<NEW_LINE>builder.withPort(getProperty(STATSD_PORT, Integer.class));<NEW_LINE>}<NEW_LINE>if (hasProperty(STATSD_PREFIX)) {<NEW_LINE>builder<MASK><NEW_LINE>}<NEW_LINE>transport = builder.build();<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("Invalid Datadog Transport: " + transportName);<NEW_LINE>}<NEW_LINE>reporter.withTransport(transport);<NEW_LINE>if (hasProperty(TAGS)) {<NEW_LINE>reporter.withTags(asList(StringUtils.tokenizeToStringArray(getProperty(TAGS), ",", true, true)));<NEW_LINE>}<NEW_LINE>if (StringUtils.hasText(getProperty(HOST))) {<NEW_LINE>reporter.withHost(getProperty(HOST));<NEW_LINE>} else if ("true".equalsIgnoreCase(getProperty(EC2_HOST))) {<NEW_LINE>try {<NEW_LINE>reporter.withEC2Host();<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new IllegalStateException("DatadogReporter.Builder.withEC2Host threw an exception", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (hasProperty(EXPANSION)) {<NEW_LINE>String configString = getProperty(EXPANSION).trim().toUpperCase(Locale.ENGLISH);<NEW_LINE>final EnumSet<Expansion> expansions;<NEW_LINE>if ("ALL".equals(configString)) {<NEW_LINE>expansions = Expansion.ALL;<NEW_LINE>} else {<NEW_LINE>expansions = EnumSet.noneOf(Expansion.class);<NEW_LINE>for (String expandedMetricStr : StringUtils.tokenizeToStringArray(configString, ",", true, true)) {<NEW_LINE>expansions.add(Expansion.valueOf(expandedMetricStr.replace(' ', '_')));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>reporter.withExpansions(expansions);<NEW_LINE>}<NEW_LINE>if (hasProperty(DYNAMIC_TAG_CALLBACK_REF)) {<NEW_LINE>reporter.withDynamicTagCallback(getPropertyRef(DYNAMIC_TAG_CALLBACK_REF, DynamicTagsCallback.class));<NEW_LINE>}<NEW_LINE>if (hasProperty(METRIC_NAME_FORMATTER_REF)) {<NEW_LINE>reporter.withMetricNameFormatter(getPropertyRef(METRIC_NAME_FORMATTER_REF, MetricNameFormatter.class));<NEW_LINE>}<NEW_LINE>if (hasProperty(PREFIX)) {<NEW_LINE>reporter.withPrefix(getProperty(PREFIX));<NEW_LINE>}<NEW_LINE>if (hasProperty(DURATION_UNIT)) {<NEW_LINE>reporter.convertDurationsTo(getProperty(DURATION_UNIT, TimeUnit.class));<NEW_LINE>}<NEW_LINE>if (hasProperty(RATE_UNIT)) {<NEW_LINE>reporter.convertRatesTo(getProperty(RATE_UNIT, TimeUnit.class));<NEW_LINE>}<NEW_LINE>if (hasProperty(CLOCK_REF)) {<NEW_LINE>reporter.withClock(getPropertyRef(CLOCK_REF, Clock.class));<NEW_LINE>}<NEW_LINE>reporter.filter(getMetricFilter());<NEW_LINE>return reporter.build();<NEW_LINE>} | .withPrefix(getProperty(STATSD_PREFIX)); |
1,850,291 | public void walk(String path) throws IOException {<NEW_LINE>File root = new File(path);<NEW_LINE>File[] list = root.listFiles();<NEW_LINE>if (list == null)<NEW_LINE>return;<NEW_LINE>for (File f : list) {<NEW_LINE>if (f.isDirectory()) {<NEW_LINE>walk(f.getAbsolutePath());<NEW_LINE>// System.out.println( "Dir:" + f.getAbsoluteFile() );<NEW_LINE>} else {<NEW_LINE>// System.out.println( "File:" + f.getAbsoluteFile() );<NEW_LINE>if (f.getName().endsWith("docx") || f.getName().endsWith("docm")) {<NEW_LINE>try {<NEW_LINE>handle(f);<NEW_LINE>FileUtils.moveFile(f, new File(DIR_HANDLED + f.getName()));<NEW_LINE>} catch (Exception e) {<NEW_LINE>if (e.getMessage() != null && e.getMessage().startsWith("Ran out of patience")) {<NEW_LINE>FileUtils.copyFile(f, new File(DIR_OUT + DIR_GLYPH + "/" + f<MASK><NEW_LINE>} else if (e.getMessage() != null && e.getMessage().startsWith("This file seems to be a binary doc")) {<NEW_LINE>FileUtils.copyFile(f, new File(DIR_OUT + DIR_ERRORS + "/" + f.getName() + ".doc"));<NEW_LINE>// rename the original<NEW_LINE>FileUtils.moveFile(f, new File(f.getAbsolutePath() + ".doc"));<NEW_LINE>} else {<NEW_LINE>errors++;<NEW_LINE>e.printStackTrace();<NEW_LINE>FileUtils.copyFile(f, new File(DIR_OUT + DIR_ERRORS + "/" + f.getName()));<NEW_LINE>File file = new File(DIR_OUT + DIR_ERRORS + "/" + f.getName() + "err.txt");<NEW_LINE>PrintStream ps = new PrintStream(file);<NEW_LINE>e.printStackTrace(ps);<NEW_LINE>ps.close();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>docNum++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .getName() + ".docx")); |
1,596,152 | public void downloadFileViaToken(String token, String range, Boolean genericMimetype, Boolean inline) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// verify the required parameter 'token' is set<NEW_LINE>if (token == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'token' when calling downloadFileViaToken");<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/v4/downloads/{token}".replaceAll("\\{" + "token" + "\\}", apiClient.escapeString(token.toString()));<NEW_LINE>// query params<NEW_LINE>List<Pair> localVarQueryParams <MASK><NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>localVarQueryParams.addAll(apiClient.parameterToPairs("", "generic_mimetype", genericMimetype));<NEW_LINE>localVarQueryParams.addAll(apiClient.parameterToPairs("", "inline", inline));<NEW_LINE>if (range != null)<NEW_LINE>localVarHeaderParams.put("Range", apiClient.parameterToString(range));<NEW_LINE>final String[] localVarAccepts = { "application/octet-stream" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] localVarAuthNames = new String[] {};<NEW_LINE>apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);<NEW_LINE>} | = new ArrayList<Pair>(); |
1,575,232 | private void initializeClassFields() {<NEW_LINE>for (SootField field : sootMethod.getDeclaringClass().getFields()) {<NEW_LINE>if (!field.isStatic()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>for (Tag tag : field.getTags()) {<NEW_LINE>Value value = null;<NEW_LINE>if (tag instanceof DoubleConstantValueTag) {<NEW_LINE>DoubleConstantValueTag dtag = (DoubleConstantValueTag) tag;<NEW_LINE>value = new FloatingPointConstant(dtag.getDoubleValue());<NEW_LINE>} else if (tag instanceof FloatConstantValueTag) {<NEW_LINE>FloatConstantValueTag ftag = (FloatConstantValueTag) tag;<NEW_LINE>value = new FloatingPointConstant(ftag.getFloatValue());<NEW_LINE>} else if (tag instanceof IntegerConstantValueTag) {<NEW_LINE>IntegerConstantValueTag itag = (IntegerConstantValueTag) tag;<NEW_LINE>value = new IntegerConstant(itag.getIntValue());<NEW_LINE>IntegerType type = (IntegerType) getType(field.getType());<NEW_LINE>if (type.getBits() < 32) {<NEW_LINE>value = new ConstantTrunc((Constant) value, type);<NEW_LINE>}<NEW_LINE>} else if (tag instanceof LongConstantValueTag) {<NEW_LINE>LongConstantValueTag ltag = (LongConstantValueTag) tag;<NEW_LINE>value = new IntegerConstant(ltag.getLongValue());<NEW_LINE>} else if (tag instanceof StringConstantValueTag) {<NEW_LINE>String s = ((<MASK><NEW_LINE>value = call(ldcString(s), env);<NEW_LINE>}<NEW_LINE>if (value != null) {<NEW_LINE>FunctionRef fn = FunctionBuilder.setter(field).ref();<NEW_LINE>call(fn, env, value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | StringConstantValueTag) tag).getStringValue(); |
282,408 | public static void main(String[] args) {<NEW_LINE>Connection connection = null;<NEW_LINE>try {<NEW_LINE>// create a database connection<NEW_LINE>connection = DriverManager.getConnection("jdbc:sqlite:sample.db");<NEW_LINE>Statement statement = connection.createStatement();<NEW_LINE>// set timeout to 30 sec.<NEW_LINE>statement.setQueryTimeout(30);<NEW_LINE>statement.executeUpdate("drop table if exists person");<NEW_LINE>statement.executeUpdate("create table person (id integer, name string)");<NEW_LINE>statement.executeUpdate("insert into person values(1, 'leo')");<NEW_LINE>statement.executeUpdate("insert into person values(2, 'yui')");<NEW_LINE>ResultSet rs = statement.executeQuery("select * from person");<NEW_LINE>while (rs.next()) {<NEW_LINE>// read the result set<NEW_LINE>System.out.println("name = " <MASK><NEW_LINE>System.out.println("id = " + rs.getInt("id"));<NEW_LINE>}<NEW_LINE>} catch (SQLException e) {<NEW_LINE>// if the error message is "out of memory",<NEW_LINE>// it probably means no database file is found<NEW_LINE>System.err.println(e.getMessage());<NEW_LINE>} finally {<NEW_LINE>try {<NEW_LINE>if (connection != null)<NEW_LINE>connection.close();<NEW_LINE>} catch (SQLException e) {<NEW_LINE>// connection close failed.<NEW_LINE>System.err.println(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | + rs.getString("name")); |
943,132 | /* test */<NEW_LINE>static String createImpliedFileName(@NonNull String original, String extension, boolean underscore) {<NEW_LINE>if (extension == null && !underscore) {<NEW_LINE>// no change<NEW_LINE>return original;<NEW_LINE>}<NEW_LINE>if (!underscore) {<NEW_LINE>return new StringBuilder().append(original).append('.').append(extension).toString();<NEW_LINE>} else {<NEW_LINE>// imply underscore<NEW_LINE>// 1. find the last part - the filename<NEW_LINE>int separatorIndex = original.lastIndexOf('/');<NEW_LINE>if (separatorIndex == -1) {<NEW_LINE>separatorIndex = original.lastIndexOf('\\');<NEW_LINE>}<NEW_LINE>if (separatorIndex == -1) {<NEW_LINE>// just the filename, no folder<NEW_LINE>return new StringBuilder().append('_').append(original).append(extension == null ? "" : '.').append(extension == null ? "" : extension).toString();<NEW_LINE>} else {<NEW_LINE>return // including the separatorx<NEW_LINE>new StringBuilder().// including the separatorx<NEW_LINE>append(original.substring(0, separatorIndex + 1)).append(// the filename<NEW_LINE>'_').// the filename<NEW_LINE>append(original.substring(separatorIndex + 1)).append(extension == null ? "" : '.').append(extension == null ? <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | "" : extension).toString(); |
176,549 | private void createReceivers() {<NEW_LINE>List<CompletableFuture<CoreMessageReceiver>> receiverFutures = partitions.stream().map(TopicPartitionInfo::getFullTopicName).map(queue -> {<NEW_LINE>MessagingFactory factory;<NEW_LINE>try {<NEW_LINE>factory = MessagingFactory<MASK><NEW_LINE>} catch (InterruptedException | ExecutionException e) {<NEW_LINE>log.error("Failed to create factory for the queue [{}]", queue);<NEW_LINE>throw new RuntimeException("Failed to create the factory", e);<NEW_LINE>}<NEW_LINE>return CoreMessageReceiver.create(factory, queue, queue, 0, new SettleModePair(SenderSettleMode.UNSETTLED, ReceiverSettleMode.SECOND), MessagingEntityType.QUEUE);<NEW_LINE>}).collect(Collectors.toList());<NEW_LINE>try {<NEW_LINE>receivers = new HashSet<>(fromList(receiverFutures).get());<NEW_LINE>} catch (InterruptedException | ExecutionException e) {<NEW_LINE>if (stopped) {<NEW_LINE>log.info("[{}] Service Bus consumer is stopped.", getTopic());<NEW_LINE>} else {<NEW_LINE>log.error("Failed to create receivers", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .createFromConnectionStringBuilder(createConnection(queue)); |
90,515 | static boolean validateCalendarInterval(DateHistogramInterval requestInterval, DateHistogramInterval configInterval) {<NEW_LINE>if (requestInterval == null || configInterval == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// The request must be gte the config. The CALENDAR_ORDERING map values are integers representing<NEW_LINE>// relative orders between the calendar units<NEW_LINE>Rounding.DateTimeUnit requestUnit = DateHistogramAggregationBuilder.DATE_FIELD_UNITS.get(requestInterval.toString());<NEW_LINE>if (requestUnit == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Rounding.DateTimeUnit configUnit = DateHistogramAggregationBuilder.DATE_FIELD_UNITS.get(configInterval.toString());<NEW_LINE>if (configUnit == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>long requestOrder = requestUnit.getField().getBaseUnit()<MASK><NEW_LINE>long configOrder = configUnit.getField().getBaseUnit().getDuration().toMillis();<NEW_LINE>// All calendar units are multiples naturally, so we just care about gte<NEW_LINE>return requestOrder >= configOrder;<NEW_LINE>} | .getDuration().toMillis(); |
1,001,407 | final GetIdentityPoolConfigurationResult executeGetIdentityPoolConfiguration(GetIdentityPoolConfigurationRequest getIdentityPoolConfigurationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getIdentityPoolConfigurationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetIdentityPoolConfigurationRequest> request = null;<NEW_LINE>Response<GetIdentityPoolConfigurationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetIdentityPoolConfigurationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getIdentityPoolConfigurationRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Cognito Sync");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetIdentityPoolConfiguration");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetIdentityPoolConfigurationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetIdentityPoolConfigurationResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); |
659,670 | public CrossRegionCopyDeprecateRule unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>CrossRegionCopyDeprecateRule crossRegionCopyDeprecateRule = new CrossRegionCopyDeprecateRule();<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 null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("Interval", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>crossRegionCopyDeprecateRule.setInterval(context.getUnmarshaller(Integer.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("IntervalUnit", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>crossRegionCopyDeprecateRule.setIntervalUnit(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return crossRegionCopyDeprecateRule;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
891,516 | public TextFieldMapper build(MapperBuilderContext context) {<NEW_LINE>FieldType fieldType = TextParams.buildFieldType(index, store, indexOptions, norms, termVectors);<NEW_LINE>TextFieldType tft = buildFieldType(fieldType, context);<NEW_LINE>SubFieldInfo phraseFieldInfo = buildPhraseInfo(fieldType, tft);<NEW_LINE>SubFieldInfo prefixFieldInfo = <MASK><NEW_LINE>MultiFields multiFields = multiFieldsBuilder.build(this, context);<NEW_LINE>for (Mapper mapper : multiFields) {<NEW_LINE>if (mapper.name().endsWith(FAST_PHRASE_SUFFIX) || mapper.name().endsWith(FAST_PREFIX_SUFFIX)) {<NEW_LINE>throw new MapperParsingException("Cannot use reserved field name [" + mapper.name() + "]");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new TextFieldMapper(name, fieldType, tft, indexAnalyzers(tft.name(), phraseFieldInfo, prefixFieldInfo), prefixFieldInfo, phraseFieldInfo, multiFields, copyTo.build(), this);<NEW_LINE>} | buildPrefixInfo(context, fieldType, tft); |
612,509 | static String writeIpV6(byte[] ipv6) {<NEW_LINE>int pos = 0;<NEW_LINE>char[] buf = RecyclableBuffers.shortStringBuffer();<NEW_LINE>// Compress the longest string of zeros<NEW_LINE>int zeroCompressionIndex = -1;<NEW_LINE>int zeroCompressionLength = -1;<NEW_LINE>int zeroIndex = -1;<NEW_LINE>boolean allZeros = true;<NEW_LINE>for (int i = 0; i < ipv6.length; i += 2) {<NEW_LINE>if (ipv6[i] == 0 && ipv6[i + 1] == 0) {<NEW_LINE>if (zeroIndex < 0)<NEW_LINE>zeroIndex = i;<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>allZeros = false;<NEW_LINE>if (zeroIndex >= 0) {<NEW_LINE>int zeroLength = i - zeroIndex;<NEW_LINE>if (zeroLength > zeroCompressionLength) {<NEW_LINE>zeroCompressionIndex = zeroIndex;<NEW_LINE>zeroCompressionLength = zeroLength;<NEW_LINE>}<NEW_LINE>zeroIndex = -1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// handle all zeros: 0:0:0:0:0:0:0:0 -> ::<NEW_LINE>if (allZeros)<NEW_LINE>return "::";<NEW_LINE>// handle trailing zeros: 2001:0:0:4:0:0:0:0 -> 2001:0:0:4::<NEW_LINE>if (zeroCompressionIndex == -1 && zeroIndex != -1) {<NEW_LINE>zeroCompressionIndex = zeroIndex;<NEW_LINE>zeroCompressionLength = 16 - zeroIndex;<NEW_LINE>}<NEW_LINE>int i = 0;<NEW_LINE>while (i < ipv6.length) {<NEW_LINE>if (i == zeroCompressionIndex) {<NEW_LINE>buf[pos++] = ':';<NEW_LINE>i += zeroCompressionLength;<NEW_LINE>if (i == ipv6.length)<NEW_LINE>buf[pos++] = ':';<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (i != 0)<NEW_LINE>buf[pos++] = ':';<NEW_LINE>byte high = ipv6[i++];<NEW_LINE><MASK><NEW_LINE>// handle leading zeros: 2001:0:0:4:0000:0:0:8 -> 2001:0:0:4::8<NEW_LINE>boolean leadingZero;<NEW_LINE>char val = HEX_DIGITS[(high >> 4) & 0xf];<NEW_LINE>if (!(leadingZero = val == '0'))<NEW_LINE>buf[pos++] = val;<NEW_LINE>val = HEX_DIGITS[high & 0xf];<NEW_LINE>if (!(leadingZero = (leadingZero && val == '0')))<NEW_LINE>buf[pos++] = val;<NEW_LINE>val = HEX_DIGITS[(low >> 4) & 0xf];<NEW_LINE>if (!(leadingZero && val == '0'))<NEW_LINE>buf[pos++] = val;<NEW_LINE>buf[pos++] = HEX_DIGITS[low & 0xf];<NEW_LINE>}<NEW_LINE>return new String(buf, 0, pos);<NEW_LINE>} | byte low = ipv6[i++]; |
1,409,723 | // auto-generated, see spoon.generating.CloneVisitorGenerator<NEW_LINE>public <T extends java.lang.Enum<?>> void visitCtEnum(final spoon.reflect.declaration.CtEnum<T> ctEnum) {<NEW_LINE>spoon.reflect.declaration.CtEnum<T> aCtEnum = ctEnum.getFactory().Core().createEnum();<NEW_LINE>this.builder.copy(ctEnum, aCtEnum);<NEW_LINE>aCtEnum.setAnnotations(this.cloneHelper.clone(ctEnum.getAnnotations()));<NEW_LINE>aCtEnum.setSuperInterfaces(this.cloneHelper.clone<MASK><NEW_LINE>aCtEnum.setTypeMembers(this.cloneHelper.clone(ctEnum.getTypeMembers()));<NEW_LINE>aCtEnum.setEnumValues(this.cloneHelper.clone(ctEnum.getEnumValues()));<NEW_LINE>aCtEnum.setComments(this.cloneHelper.clone(ctEnum.getComments()));<NEW_LINE>this.cloneHelper.tailor(ctEnum, aCtEnum);<NEW_LINE>this.other = aCtEnum;<NEW_LINE>} | (ctEnum.getSuperInterfaces())); |
1,280,424 | public synchronized void acquireReadLock() throws ConcurrencyException {<NEW_LINE>final Thread currentThread = Thread.currentThread();<NEW_LINE>final long whileStartTimeMillis = System.currentTimeMillis();<NEW_LINE>DeferredLockManager lockManager = getDeferredLockManager(currentThread);<NEW_LINE>ReadLockManager readLockManager = getReadLockManager(currentThread);<NEW_LINE>final boolean currentThreadWillEnterTheWhileWait = (this.activeThread != null) && (this.activeThread != currentThread);<NEW_LINE>if (currentThreadWillEnterTheWhileWait) {<NEW_LINE>putThreadAsWaitingToAcquireLockForReading(currentThread, ACQUIRE_READ_LOCK_METHOD_NAME);<NEW_LINE>}<NEW_LINE>// Cannot check for starving writers as will lead to deadlocks.<NEW_LINE>while ((this.activeThread != null) && (this.activeThread != Thread.currentThread())) {<NEW_LINE>try {<NEW_LINE>wait(ConcurrencyUtil.SINGLETON.getAcquireWaitTime());<NEW_LINE>ConcurrencyUtil.SINGLETON.determineIfReleaseDeferredLockAppearsToBeDeadLocked(this, whileStartTimeMillis, lockManager, readLockManager, ConcurrencyUtil.SINGLETON.isAllowInterruptedExceptionFired());<NEW_LINE>} catch (InterruptedException exception) {<NEW_LINE>releaseAllLocksAcquiredByThread(lockManager);<NEW_LINE>if (currentThreadWillEnterTheWhileWait) {<NEW_LINE>removeThreadNoLongerWaitingToAcquireLockForReading(currentThread);<NEW_LINE>}<NEW_LINE>throw ConcurrencyException.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (currentThreadWillEnterTheWhileWait) {<NEW_LINE>removeThreadNoLongerWaitingToAcquireLockForReading(currentThread);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>addReadLockToReadLockManager();<NEW_LINE>} finally {<NEW_LINE>this.numberOfReaders.incrementAndGet();<NEW_LINE>this.totalNumberOfKeysAcquiredForReading.incrementAndGet();<NEW_LINE>}<NEW_LINE>} | waitWasInterrupted(exception.getMessage()); |
810,538 | private boolean handleWRegModification(Instruction instr) {<NEW_LINE><MASK><NEW_LINE>boolean modUnknown = false;<NEW_LINE>if ("CLRW".equals(mnemonic)) {<NEW_LINE>wContext.setValueAt(instr, 0, false);<NEW_LINE>return true;<NEW_LINE>} else if ("MOVLW".equals(mnemonic)) {<NEW_LINE>Scalar s = instr.getScalar(0);<NEW_LINE>if (s != null) {<NEW_LINE>wContext.setValueAt(instr, s.getUnsignedValue(), false);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>modUnknown = true;<NEW_LINE>} else if ("MOVFP".equals(mnemonic) || "MOVPF".equals(mnemonic)) {<NEW_LINE>Object[] objs = instr.getOpObjects(1);<NEW_LINE>if (objs.length == 0) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (wReg.equals(objs[0]) || wReg.getAddress().equals(objs[0])) {<NEW_LINE>wContext.setValueUnknown();<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>} else if (REG_S_MODIFICATION_MNEMONICS.contains(mnemonic) && instr.getNumOperands() == 2) {<NEW_LINE>List<?> repObjs = instr.getDefaultOperandRepresentationList(1);<NEW_LINE>if (repObjs.size() == 1 && S_0.equals(repObjs.get(0))) {<NEW_LINE>// Unhandled W modification<NEW_LINE>wContext.setValueUnknown();<NEW_LINE>// allow operand-0 register modiofication to be examined<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} else if (REG_MODIFICATION_MNEMONICS.contains(mnemonic) && instr.getNumOperands() == 2) {<NEW_LINE>List<?> repObjs = instr.getDefaultOperandRepresentationList(1);<NEW_LINE>if (repObjs.size() == 1 && DEST_W.equals(repObjs.get(0))) {<NEW_LINE>// Unhandled W modification<NEW_LINE>wContext.setValueUnknown();<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>} else if (WREG_MODIFICATION_MNEMONICS.contains(mnemonic)) {<NEW_LINE>modUnknown = true;<NEW_LINE>}<NEW_LINE>if (modUnknown) {<NEW_LINE>wContext.setValueUnknown();<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | String mnemonic = instr.getMnemonicString(); |
1,720,136 | private VaultoroNewOrderResponse placeOrder(String type, CurrencyPair currencyPair, OrderType orderType, BigDecimal amount, BigDecimal price) throws IOException {<NEW_LINE>String baseSymbol = currencyPair.base.getCurrencyCode().toLowerCase();<NEW_LINE>if (orderType == OrderType.BID) {<NEW_LINE>if (price == null) {<NEW_LINE>VaultoroMarketDataService ds = new VaultoroMarketDataService(exchange);<NEW_LINE>OrderBook orderBook = ds.getOrderBook(currencyPair);<NEW_LINE>List<LimitOrder> asks = orderBook.getAsks();<NEW_LINE>if (!asks.isEmpty()) {<NEW_LINE>LimitOrder lowestAsk = orderBook.getAsks().get(0);<NEW_LINE>price = lowestAsk.getLimitPrice();<NEW_LINE>} else {<NEW_LINE>price = ds.getLast(currencyPair);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>amount = price.multiply(amount, new MathContext(8, RoundingMode.HALF_DOWN));<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>return vaultoro.buy(baseSymbol, type, exchange.getNonceFactory(), <MASK><NEW_LINE>} catch (VaultoroException e) {<NEW_LINE>throw new ExchangeException(e);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>return vaultoro.sell(baseSymbol, type, exchange.getNonceFactory(), apiKey, amount, price, signatureCreator);<NEW_LINE>} catch (VaultoroException e) {<NEW_LINE>throw new ExchangeException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | apiKey, amount, price, signatureCreator); |
146,644 | public ServiceOverride mapRow(ResultSet rs, int rowNum) throws SQLException {<NEW_LINE>Service data = Service.newBuilder().setId(SqlUtil.getString(rs, "pk_show_service")).setName(SqlUtil.getString(rs, "str_name")).setThreadable(rs.getBoolean("b_threadable")).setMinCores(rs.getInt("int_cores_min")).setMaxCores(rs.getInt("int_cores_max")).setMinMemory(rs.getInt("int_mem_min")).setMinGpus(rs.getInt("int_gpus_min")).setMaxGpus(rs.getInt("int_gpus_max")).setMinGpuMemory(rs.getInt("int_gpu_mem_min")).addAllTags(Lists.newArrayList(ServiceDaoJdbc.splitTags(SqlUtil.getString(rs, "str_tags")))).setTimeout(rs.getInt("int_timeout")).setTimeoutLlu(rs.getInt<MASK><NEW_LINE>return ServiceOverride.newBuilder().setId(SqlUtil.getString(rs, "pk_show_service")).setData(data).build();<NEW_LINE>} | ("int_timeout_llu")).build(); |
1,669,927 | public void processCatch(CatchStmtToken result, ListIterator<Token> iterator) {<NEW_LINE>Token next = nextToken(iterator);<NEW_LINE>if (!isOpenedBrace(next, BraceExprToken.Kind.SIMPLE))<NEW_LINE>unexpectedToken(next, "(");<NEW_LINE>List<FulledNameToken> exceptions = new ArrayList<>();<NEW_LINE>do {<NEW_LINE>next = nextToken(iterator);<NEW_LINE>if (!(next instanceof NameToken)) {<NEW_LINE>if (exceptions.isEmpty()) {<NEW_LINE>unexpectedToken(next, TokenType.T_STRING);<NEW_LINE>} else {<NEW_LINE>iterator.previous();<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>FulledNameToken exception = analyzer<MASK><NEW_LINE>exceptions.add(exception);<NEW_LINE>next = nextToken(iterator);<NEW_LINE>if (!(next instanceof OrExprToken)) {<NEW_LINE>iterator.previous();<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} while (true);<NEW_LINE>result.setExceptions(exceptions);<NEW_LINE>next = nextToken(iterator);<NEW_LINE>if (!(next instanceof VariableExprToken))<NEW_LINE>unexpectedToken(next, TokenType.T_VARIABLE);<NEW_LINE>VariableExprToken variable = (VariableExprToken) next;<NEW_LINE>result.setVariable(variable);<NEW_LINE>if (analyzer.getFunction() != null) {<NEW_LINE>analyzer.getFunction().variable(variable).setUnstable(true);<NEW_LINE>}<NEW_LINE>analyzer.getScope().addVariable(variable);<NEW_LINE>next = nextToken(iterator);<NEW_LINE>if (!isClosedBrace(next, BraceExprToken.Kind.SIMPLE))<NEW_LINE>unexpectedToken(next, ")");<NEW_LINE>BodyStmtToken body = analyzer.generator(BodyGenerator.class).getToken(nextToken(iterator), iterator);<NEW_LINE>result.setBody(body);<NEW_LINE>} | .getRealName((NameToken) next); |
1,782,873 | public ObjectCursor<Note> queryNotes() {<NEW_LINE>if (!isAdded())<NEW_LINE>return null;<NEW_LINE>NotesActivity notesActivity = (NotesActivity) requireActivity();<NEW_LINE>Query<Note> query = notesActivity.getSelectedTag().query();<NEW_LINE>String searchString = mSearchString;<NEW_LINE>if (hasSearchQuery()) {<NEW_LINE>searchString = queryTags(query, mSearchString);<NEW_LINE>}<NEW_LINE>if (!TextUtils.isEmpty(searchString)) {<NEW_LINE>query.where(new Query.FullTextMatch(new SearchTokenizer(searchString)));<NEW_LINE>query.include(new Query.FullTextOffsets("match_offsets"));<NEW_LINE>query.include(new Query.FullTextSnippet(Note.MATCHED_TITLE_INDEX_NAME, Note.TITLE_INDEX_NAME));<NEW_LINE>query.include(new Query.FullTextSnippet(Note.MATCHED_CONTENT_INDEX_NAME, Note.CONTENT_PROPERTY));<NEW_LINE>query.include(Note.TITLE_INDEX_NAME, Note.CONTENT_PREVIEW_INDEX_NAME);<NEW_LINE>} else {<NEW_LINE>query.include(<MASK><NEW_LINE>}<NEW_LINE>query.include(Note.PINNED_INDEX_NAME);<NEW_LINE>PrefUtils.sortNoteQuery(query, requireContext(), true);<NEW_LINE>return query.execute();<NEW_LINE>} | Note.TITLE_INDEX_NAME, Note.CONTENT_PREVIEW_INDEX_NAME); |
595,306 | final ListIdentitiesResult executeListIdentities(ListIdentitiesRequest listIdentitiesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listIdentitiesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListIdentitiesRequest> request = null;<NEW_LINE>Response<ListIdentitiesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListIdentitiesRequestMarshaller().marshall(super.beforeMarshalling(listIdentitiesRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "SES");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListIdentities");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<ListIdentitiesResult> responseHandler = new StaxResponseHandler<ListIdentitiesResult>(new ListIdentitiesResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint); |
178,365 | public UpdateAliasesRequest indicesUpdateAliasesRequest(AliasActions aliasActions) {<NEW_LINE>Assert.notNull(aliasActions, "aliasActions must not be null");<NEW_LINE>UpdateAliasesRequest.Builder updateAliasRequestBuilder = new UpdateAliasesRequest.Builder();<NEW_LINE>List<Action> actions = new ArrayList<>();<NEW_LINE>aliasActions.getActions().forEach(aliasAction -> {<NEW_LINE>Action.Builder actionBuilder = new Action.Builder();<NEW_LINE>if (aliasAction instanceof AliasAction.Add) {<NEW_LINE>AliasAction.Add <MASK><NEW_LINE>AliasActionParameters parameters = add.getParameters();<NEW_LINE>actionBuilder.add(addActionBuilder -> {<NEW_LINE>//<NEW_LINE>//<NEW_LINE>addActionBuilder.//<NEW_LINE>indices(//<NEW_LINE>Arrays.asList(parameters.getIndices())).//<NEW_LINE>isHidden(//<NEW_LINE>parameters.getHidden()).//<NEW_LINE>isWriteIndex(//<NEW_LINE>parameters.getWriteIndex()).//<NEW_LINE>routing(//<NEW_LINE>parameters.getRouting()).//<NEW_LINE>indexRouting(//<NEW_LINE>parameters.getIndexRouting()).//<NEW_LINE>searchRouting(parameters.getSearchRouting());<NEW_LINE>if (parameters.getAliases() != null) {<NEW_LINE>addActionBuilder.aliases(Arrays.asList(parameters.getAliases()));<NEW_LINE>}<NEW_LINE>Query filterQuery = parameters.getFilterQuery();<NEW_LINE>if (filterQuery != null) {<NEW_LINE>elasticsearchConverter.updateQuery(filterQuery, parameters.getFilterQueryClass());<NEW_LINE>co.elastic.clients.elasticsearch._types.query_dsl.Query esQuery = getFilter(filterQuery);<NEW_LINE>if (esQuery != null) {<NEW_LINE>addActionBuilder.filter(esQuery);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return addActionBuilder;<NEW_LINE>});<NEW_LINE>}<NEW_LINE>if (aliasAction instanceof AliasAction.Remove) {<NEW_LINE>AliasAction.Remove remove = (AliasAction.Remove) aliasAction;<NEW_LINE>AliasActionParameters parameters = remove.getParameters();<NEW_LINE>actionBuilder.remove(removeActionBuilder -> {<NEW_LINE>removeActionBuilder.indices(Arrays.asList(parameters.getIndices()));<NEW_LINE>if (parameters.getAliases() != null) {<NEW_LINE>removeActionBuilder.aliases(Arrays.asList(parameters.getAliases()));<NEW_LINE>}<NEW_LINE>return removeActionBuilder;<NEW_LINE>});<NEW_LINE>}<NEW_LINE>if (aliasAction instanceof AliasAction.RemoveIndex) {<NEW_LINE>AliasAction.RemoveIndex removeIndex = (AliasAction.RemoveIndex) aliasAction;<NEW_LINE>AliasActionParameters parameters = removeIndex.getParameters();<NEW_LINE>actionBuilder.removeIndex(removeIndexActionBuilder -> removeIndexActionBuilder.indices(Arrays.asList(parameters.getIndices())));<NEW_LINE>}<NEW_LINE>actions.add(actionBuilder.build());<NEW_LINE>});<NEW_LINE>updateAliasRequestBuilder.actions(actions);<NEW_LINE>return updateAliasRequestBuilder.build();<NEW_LINE>} | add = (AliasAction.Add) aliasAction; |
679,173 | public Object toObject() {<NEW_LINE>final HashMap<String, Object> objMap = new HashMap<>();<NEW_LINE>objMap.put("id", this.id);<NEW_LINE>objMap.put("jobSource", this.jobSource);<NEW_LINE>objMap.put("propSource", this.propsSource);<NEW_LINE>objMap.put("jobType", this.type);<NEW_LINE>if (this.embeddedFlowId != null) {<NEW_LINE>objMap.put("embeddedFlowId", this.embeddedFlowId);<NEW_LINE>}<NEW_LINE>objMap.put("expectedRuntime", this.expectedRunTimeSec);<NEW_LINE>final HashMap<String, Object> layoutInfo = new HashMap<>();<NEW_LINE>if (this.position != null) {<NEW_LINE>layoutInfo.put("x", this.position.getX());<NEW_LINE>layoutInfo.put("y", this.position.getY());<NEW_LINE>}<NEW_LINE>layoutInfo.<MASK><NEW_LINE>objMap.put("layout", layoutInfo);<NEW_LINE>objMap.put("condition", this.condition);<NEW_LINE>objMap.put("conditionOnJobStatus", this.conditionOnJobStatus);<NEW_LINE>return objMap;<NEW_LINE>} | put("level", this.level); |
871,321 | private boolean executeCommand0(String itemName, Type command, final RFXComBindingProvider provider, RFXComSerialConnector connector) {<NEW_LINE>String id = provider.getId(itemName);<NEW_LINE>PacketType packetType = provider.getPacketType(itemName);<NEW_LINE>Object subType = provider.getSubType(itemName);<NEW_LINE>RFXComValueSelector <MASK><NEW_LINE>final Future<RFXComTransmitterMessage> result;<NEW_LINE>try {<NEW_LINE>RFXComMessageInterface obj = RFXComMessageFactory.getMessageInterface(packetType);<NEW_LINE>final byte seqNumber = getNextSeqNumber();<NEW_LINE>obj.convertFromState(valueSelector, id, subType, command, seqNumber);<NEW_LINE>byte[] data = obj.decodeMessage();<NEW_LINE>logger.debug("Transmitting data: {}", DatatypeConverter.printHexBinary(data));<NEW_LINE>result = resultRegistry.registerCommand(seqNumber);<NEW_LINE>connector.sendMessage(data);<NEW_LINE>} catch (IOException e) {<NEW_LINE>logger.error("Message sending to RFXCOM controller failed.", e);<NEW_LINE>return false;<NEW_LINE>} catch (RFXComException e) {<NEW_LINE>logger.error("Message sending to RFXCOM controller failed.", e);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>boolean success = false;<NEW_LINE>try {<NEW_LINE>final RFXComTransmitterMessage resp = result.get(timeout, TimeUnit.MILLISECONDS);<NEW_LINE>switch(resp.response) {<NEW_LINE>case ACK:<NEW_LINE>case ACK_DELAYED:<NEW_LINE>logger.debug("Command succesfully transmitted, '{}' received", resp.response);<NEW_LINE>success = true;<NEW_LINE>break;<NEW_LINE>case NAK:<NEW_LINE>case NAK_INVALID_AC_ADDRESS:<NEW_LINE>case UNKNOWN:<NEW_LINE>logger.error("Command transmit failed, '{}' received", resp.response);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>logger.error("No acknowledge received from RFXCOM controller, timeout {}ms due to", timeout, e);<NEW_LINE>} catch (ExecutionException e) {<NEW_LINE>logger.error("No acknowledge received from RFXCOM controller, timeout {}ms due to {}", timeout, e);<NEW_LINE>} catch (TimeoutException e) {<NEW_LINE>logger.error("No acknowledge received from RFXCOM controller, timeout {}ms due to {}", timeout, e);<NEW_LINE>}<NEW_LINE>return success;<NEW_LINE>} | valueSelector = provider.getValueSelector(itemName); |
1,750,588 | public Void isString(final EditorString editor) {<NEW_LINE>final String[] tokens = editor.value.split("=|\\s");<NEW_LINE>final ArrayList<String> components = new ArrayList<>();<NEW_LINE>for (final String token : tokens) {<NEW_LINE>if (!token.isEmpty()) {<NEW_LINE>components.add(token);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (components.size() != 4 || !components.get(0).equals(WIDTH_FIELD_STR) || !components.get(2).equals(HEIGHT_FIELD_STR)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>final int sizeWidth = Integer.parseInt<MASK><NEW_LINE>final int sizeHeight = Integer.parseInt(components.get(3));<NEW_LINE>if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {<NEW_LINE>EditorUtils.setNodeUNSAFE(f, node, new Size(sizeWidth, sizeHeight));<NEW_LINE>}<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>// No-Op if value could not be parsed into a number.<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | (components.get(1)); |
599,884 | // ===========================================================<NEW_LINE>// Methods from SuperClass/Interfaces<NEW_LINE>// ===========================================================<NEW_LINE>@Override<NEW_LINE>public void draw(Canvas c, Projection projection) {<NEW_LINE>final double zoomLevel = projection.getZoomLevel();<NEW_LINE>if (zoomLevel < minZoom) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final Rect rect = projection.getIntrinsicScreenRect();<NEW_LINE>int _screenWidth = rect.width();<NEW_LINE>int _screenHeight = rect.height();<NEW_LINE>boolean screenSizeChanged = _screenHeight != screenHeight || _screenWidth != screenWidth;<NEW_LINE>screenHeight = _screenHeight;<NEW_LINE>screenWidth = _screenWidth;<NEW_LINE>final IGeoPoint center = projection.fromPixels(screenWidth / 2, screenHeight / 2, null);<NEW_LINE>if (zoomLevel != lastZoomLevel || center.getLatitude() != lastLatitude || screenSizeChanged) {<NEW_LINE>lastZoomLevel = zoomLevel;<NEW_LINE>lastLatitude = center.getLatitude();<NEW_LINE>rebuildBarPath(projection);<NEW_LINE>}<NEW_LINE>int offsetX = xOffset;<NEW_LINE>int offsetY = yOffset;<NEW_LINE>if (alignBottom)<NEW_LINE>offsetY *= -1;<NEW_LINE>if (alignRight)<NEW_LINE>offsetX *= -1;<NEW_LINE>if (centred && latitudeBar)<NEW_LINE>offsetX += -latitudeBarRect.width() / 2;<NEW_LINE>if (centred && longitudeBar)<NEW_LINE>offsetY += -longitudeBarRect.height() / 2;<NEW_LINE>projection.save(c, false, true);<NEW_LINE><MASK><NEW_LINE>if (latitudeBar && bgPaint != null)<NEW_LINE>c.drawRect(latitudeBarRect, bgPaint);<NEW_LINE>if (longitudeBar && bgPaint != null) {<NEW_LINE>// Don't draw on top of latitude background...<NEW_LINE>int offsetTop = latitudeBar ? latitudeBarRect.height() : 0;<NEW_LINE>c.drawRect(longitudeBarRect.left, longitudeBarRect.top + offsetTop, longitudeBarRect.right, longitudeBarRect.bottom, bgPaint);<NEW_LINE>}<NEW_LINE>c.drawPath(barPath, barPaint);<NEW_LINE>if (latitudeBar) {<NEW_LINE>drawLatitudeText(c, projection);<NEW_LINE>}<NEW_LINE>if (longitudeBar) {<NEW_LINE>drawLongitudeText(c, projection);<NEW_LINE>}<NEW_LINE>projection.restore(c, true);<NEW_LINE>} | c.translate(offsetX, offsetY); |
6,959 | protected void run() throws Exception {<NEW_LINE>// Error if not running on Windows<NEW_LINE>if (Platform.CURRENT_PLATFORM.getOperatingSystem() != OperatingSystem.WINDOWS) {<NEW_LINE>popup("Aborting: This script is for use on Windows only.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Get appropriate pdb.exe file<NEW_LINE>String pdbExeLocation = Application.getOSFile("pdb.exe").getAbsolutePath();<NEW_LINE>List<String> choices = <MASK><NEW_LINE>String fileOrDir = askChoice("PDB file or directory", "Would you like to operate on a single " + ".pdb file or a directory of .pdb files?", choices, choices.get(1));<NEW_LINE>File pdbParentDir;<NEW_LINE>String pdbName;<NEW_LINE>int filesCreated = 0;<NEW_LINE>try {<NEW_LINE>if (fileOrDir.equals(choices.get(0))) {<NEW_LINE>File pdbFile = askFile("Choose a PDB file", "OK");<NEW_LINE>if (!pdbFile.exists()) {<NEW_LINE>popup(pdbFile.getAbsolutePath() + " is not a valid file.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!pdbFile.getName().endsWith(".pdb")) {<NEW_LINE>popup("Aborting: Expected input file to have extension of type .pdb (got '" + pdbFile.getName() + "').");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>pdbParentDir = pdbFile.getParentFile();<NEW_LINE>pdbName = pdbFile.getName();<NEW_LINE>println("Processing: " + pdbFile.getAbsolutePath());<NEW_LINE>runPdbExe(pdbExeLocation, pdbParentDir, pdbName, pdbFile.getAbsolutePath());<NEW_LINE>filesCreated = 1;<NEW_LINE>} else {<NEW_LINE>// Do recursive processing<NEW_LINE>File pdbDir = askDirectory("Choose PDB root folder (performs recursive search for .pdb files)", "OK");<NEW_LINE>// Get list of files to process<NEW_LINE>List<File> pdbFiles = new ArrayList<>();<NEW_LINE>getPDBFiles(pdbDir, pdbFiles);<NEW_LINE>int createdFilesCounter = 0;<NEW_LINE>for (File childPDBFile : pdbFiles) {<NEW_LINE>pdbParentDir = childPDBFile.getParentFile();<NEW_LINE>pdbName = childPDBFile.getName();<NEW_LINE>String currentFilePath = childPDBFile.getAbsolutePath();<NEW_LINE>println("Processing: " + currentFilePath);<NEW_LINE>runPdbExe(pdbExeLocation, pdbParentDir, pdbName, currentFilePath);<NEW_LINE>createdFilesCounter++;<NEW_LINE>if (monitor.isCancelled()) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>filesCreated = createdFilesCounter;<NEW_LINE>}<NEW_LINE>} catch (IOException ioe) {<NEW_LINE>popup(ioe.getMessage());<NEW_LINE>}<NEW_LINE>if (filesCreated > 0) {<NEW_LINE>popup("Created " + filesCreated + " .pdb.xml file(s).");<NEW_LINE>}<NEW_LINE>} | Arrays.asList("single file", "directory of files"); |
626,382 | /* Unused by j2objc.<NEW_LINE>public static String toASCIILowerCase(String string) {<NEW_LINE>char[<MASK><NEW_LINE>StringBuilder sb = new StringBuilder(charArray.length);<NEW_LINE>for (int index = 0; index < charArray.length; index++) {<NEW_LINE>if ('A' <= charArray[index] && charArray[index] <= 'Z') {<NEW_LINE>sb.append((char) (charArray[index] + ('a' - 'A')));<NEW_LINE>} else {<NEW_LINE>sb.append(charArray[index]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return sb.toString();<NEW_LINE>}<NEW_LINE>*/<NEW_LINE>public static String toASCIIUpperCase(String string) {<NEW_LINE>char[] charArray = string.toCharArray();<NEW_LINE>StringBuilder sb = new StringBuilder(charArray.length);<NEW_LINE>for (int index = 0; index < charArray.length; index++) {<NEW_LINE>if ('a' <= charArray[index] && charArray[index] <= 'z') {<NEW_LINE>sb.append((char) (charArray[index] - ('a' - 'A')));<NEW_LINE>} else {<NEW_LINE>sb.append(charArray[index]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return sb.toString();<NEW_LINE>} | ] charArray = string.toCharArray(); |
1,717,268 | public void render(MatrixStack matrixStack, int mouseX, int mouseY, float partialTicks) {<NEW_LINE>listGui.render(matrixStack, mouseX, mouseY, partialTicks);<NEW_LINE>drawCenteredText(matrixStack, client.textRenderer, blockList.getName() + " (" + listGui.getItemCount() + ")", width / 2, 12, 0xffffff);<NEW_LINE>matrixStack.push();<NEW_LINE>matrixStack.translate(0, 0, 300);<NEW_LINE>blockNameField.render(matrixStack, mouseX, mouseY, partialTicks);<NEW_LINE>super.render(matrixStack, mouseX, mouseY, partialTicks);<NEW_LINE>matrixStack.translate(-64 + width / 2 - 152, 0, 0);<NEW_LINE>if (blockNameField.getText().isEmpty() && !blockNameField.isFocused())<NEW_LINE>drawStringWithShadow(matrixStack, client.textRenderer, "block name or ID", 68, height - 50, 0x808080);<NEW_LINE>int border = blockNameField.isFocused() ? 0xffffffff : 0xffa0a0a0;<NEW_LINE>int black = 0xff000000;<NEW_LINE>fill(matrixStack, 48, height - 56, 64, height - 36, border);<NEW_LINE>fill(matrixStack, 49, height - 55, <MASK><NEW_LINE>fill(matrixStack, 214, height - 56, 244, height - 55, border);<NEW_LINE>fill(matrixStack, 214, height - 37, 244, height - 36, border);<NEW_LINE>fill(matrixStack, 244, height - 56, 246, height - 36, border);<NEW_LINE>fill(matrixStack, 214, height - 55, 243, height - 52, black);<NEW_LINE>fill(matrixStack, 214, height - 40, 243, height - 37, black);<NEW_LINE>fill(matrixStack, 214, height - 55, 216, height - 37, black);<NEW_LINE>fill(matrixStack, 242, height - 55, 245, height - 37, black);<NEW_LINE>matrixStack.pop();<NEW_LINE>listGui.renderIconAndGetName(matrixStack, new ItemStack(blockToAdd), width / 2 - 164, height - 52, false);<NEW_LINE>} | 64, height - 37, black); |
1,032,477 | public void addDefinition(Block block) {<NEW_LINE>String procedureName = getProcedureNameOrFail(block);<NEW_LINE>String canonicalProcName = mProcedureNameManager.makeCanonical(procedureName);<NEW_LINE>if (mProcedureDefinitions.get(canonicalProcName) == block) {<NEW_LINE>throw new IllegalStateException("Tried to add the same block definition twice");<NEW_LINE>}<NEW_LINE>if (mProcedureNameManager.contains(procedureName)) {<NEW_LINE>procedureName = mProcedureNameManager.generateUniqueName(procedureName, false);<NEW_LINE>setProcedureName(block, procedureName);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>mProcedureNameManager.addName(procedureName);<NEW_LINE>mProcedureDefinitions.put(canonicalProcName, block);<NEW_LINE>mProcedureReferences.put(canonicalProcName, new ArrayList<Block>());<NEW_LINE>int obsCount = mObservers.size();<NEW_LINE>for (int i = 0; i < obsCount; ++i) {<NEW_LINE>mObservers.get(i).onProcedureBlockAdded(procedureName, block);<NEW_LINE>}<NEW_LINE>} | canonicalProcName = mProcedureNameManager.makeCanonical(procedureName); |
928,588 | public static TargetInformation parse(final byte[] data) throws MessageParserException {<NEW_LINE>Preconditions.checkNotNull(data, "IE01300: Data argument can not be null");<NEW_LINE>final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();<NEW_LINE>int addressSize = -1;<NEW_LINE>List<RegisterDescription> registers = null;<NEW_LINE>DebuggerOptions options = null;<NEW_LINE>try {<NEW_LINE>final DocumentBuilder builder = factory.newDocumentBuilder();<NEW_LINE>final Document document = builder.parse(new ByteArrayInputStream(data, 0, data.length));<NEW_LINE>final NodeList nodes = document.getFirstChild().getChildNodes();<NEW_LINE>for (int i = 0; i < nodes.getLength(); ++i) {<NEW_LINE>final Node node = nodes.item(i);<NEW_LINE>final String nodeName = node.getNodeName();<NEW_LINE>if ("registers".equals(nodeName)) {<NEW_LINE>registers = parseRegisterInformation(node);<NEW_LINE>} else if ("size".equals(nodeName)) {<NEW_LINE>addressSize = Integer.valueOf(node.getTextContent());<NEW_LINE>} else if ("options".equals(nodeName)) {<NEW_LINE>options = parseOptionsInformation(node);<NEW_LINE>} else {<NEW_LINE>throw new MessageParserException(String.format("Found unknown node '%s' in target information string", nodeName));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (final ParserConfigurationException | SAXException | IOException exception) {<NEW_LINE>CUtilityFunctions.logException(exception);<NEW_LINE>throw new MessageParserException(exception.getLocalizedMessage());<NEW_LINE>}<NEW_LINE>if (addressSize == -1) {<NEW_LINE>throw new MessageParserException("E00070: IE01043: Received invalid target information string (missing address size information)");<NEW_LINE>}<NEW_LINE>Preconditions.checkNotNull(registers, "IE01044: Received invalid target information string (missing registers information)");<NEW_LINE><MASK><NEW_LINE>return new TargetInformation(addressSize, registers, options);<NEW_LINE>} | Preconditions.checkNotNull(options, "IE01046: Received invalid target information string (missing options information)"); |
153,134 | private Map<String, ShapeModel> addEmptyInputShapes(Map<String, OperationModel> javaOperationMap) {<NEW_LINE>final Map<String, Operation> operations = serviceModel.getOperations();<NEW_LINE>final Map<String, ShapeModel> emptyInputShapes = new HashMap<String, ShapeModel>();<NEW_LINE>for (Map.Entry<String, Operation> entry : operations.entrySet()) {<NEW_LINE>String operationName = entry.getKey();<NEW_LINE>Operation operation = entry.getValue();<NEW_LINE>Input input = operation.getInput();<NEW_LINE>if (input == null) {<NEW_LINE>final String inputShape = namingStrategy.getRequestClassName(operationName);<NEW_LINE>final OperationModel operationModel = javaOperationMap.get(operationName);<NEW_LINE>operationModel.setInput(new VariableModel(unCapitialize(inputShape), inputShape));<NEW_LINE>ShapeModel shape = new ShapeModel(inputShape).withType(ShapeType.Request.getValue());<NEW_LINE>shape.setShapeName(inputShape);<NEW_LINE>final VariableModel inputVariable = new VariableModel(namingStrategy.getVariableName(inputShape), inputShape);<NEW_LINE>shape.setVariable(inputVariable);<NEW_LINE>shape.setMarshaller(createInputShapeMarshaller(serviceModel<MASK><NEW_LINE>emptyInputShapes.put(inputShape, shape);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return emptyInputShapes;<NEW_LINE>} | .getMetadata(), operation)); |
975,853 | public DetectorResult[] detectMulti(Map<DecodeHintType, ?> hints) throws NotFoundException {<NEW_LINE>BitMatrix image = getImage();<NEW_LINE>ResultPointCallback resultPointCallback = hints == null ? null : (ResultPointCallback) hints.get(DecodeHintType.NEED_RESULT_POINT_CALLBACK);<NEW_LINE>MultiFinderPatternFinder finder = new MultiFinderPatternFinder(image, resultPointCallback);<NEW_LINE>FinderPatternInfo[] infos = finder.findMulti(hints);<NEW_LINE>if (infos.length == 0) {<NEW_LINE>throw NotFoundException.getNotFoundInstance();<NEW_LINE>}<NEW_LINE>List<DetectorResult> result = new ArrayList<>();<NEW_LINE>for (FinderPatternInfo info : infos) {<NEW_LINE>try {<NEW_LINE>result<MASK><NEW_LINE>} catch (ReaderException e) {<NEW_LINE>// ignore<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (result.isEmpty()) {<NEW_LINE>return EMPTY_DETECTOR_RESULTS;<NEW_LINE>} else {<NEW_LINE>return result.toArray(EMPTY_DETECTOR_RESULTS);<NEW_LINE>}<NEW_LINE>} | .add(processFinderPatternInfo(info)); |
322,072 | private File generateGPXForRecordings(Set<Recording> selected) {<NEW_LINE>File tmpFile = new File(getActivity(<MASK><NEW_LINE>tmpFile.getParentFile().mkdirs();<NEW_LINE>GPXFile file = new GPXFile(Version.getFullVersion(getMyApplication()));<NEW_LINE>for (Recording r : getRecordingsForGpx(selected)) {<NEW_LINE>if (r != SHARE_LOCATION_FILE) {<NEW_LINE>String desc = r.getDescriptionName(r.getFileName());<NEW_LINE>if (desc == null) {<NEW_LINE>desc = r.getFileName();<NEW_LINE>}<NEW_LINE>WptPt wpt = new WptPt();<NEW_LINE>wpt.lat = r.getLatitude();<NEW_LINE>wpt.lon = r.getLongitude();<NEW_LINE>wpt.name = desc;<NEW_LINE>wpt.link = r.getFileName();<NEW_LINE>wpt.time = r.getFile().lastModified();<NEW_LINE>wpt.category = r.getSearchHistoryType();<NEW_LINE>wpt.desc = r.getTypeWithDuration(getContext());<NEW_LINE>getMyApplication().getSelectedGpxHelper().addPoint(wpt, file);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>GPXUtilities.writeGpxFile(tmpFile, file);<NEW_LINE>return tmpFile;<NEW_LINE>} | ).getCacheDir(), "share/noteLocations.gpx"); |
1,366,267 | public void queueEvent(FacesEvent event) {<NEW_LINE>FacesContext context = getFacesContext();<NEW_LINE>Map<String, String> params = context<MASK><NEW_LINE>if (ComponentUtils.isRequestSource(this, context)) {<NEW_LINE>String eventName = params.get(Constants.RequestParams.PARTIAL_BEHAVIOR_EVENT_PARAM);<NEW_LINE>String clientId = getClientId(context);<NEW_LINE>if (DEFAULT_EVENT.equals(eventName)) {<NEW_LINE>AjaxBehaviorEvent behaviorEvent = (AjaxBehaviorEvent) event;<NEW_LINE>List<Double> panelSizes = new ArrayList<>();<NEW_LINE>String[] sizes = params.get(clientId + "_panelSizes").split("_");<NEW_LINE>for (int i = 0; i < sizes.length; i++) {<NEW_LINE>panelSizes.add(Double.valueOf(sizes[i]));<NEW_LINE>}<NEW_LINE>super.queueEvent(new SplitterResizeEvent(this, behaviorEvent.getBehavior(), panelSizes));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>super.queueEvent(event);<NEW_LINE>}<NEW_LINE>} | .getExternalContext().getRequestParameterMap(); |
867,308 | protected void doGet(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException {<NEW_LINE>// We have to do this every time since these come from the properties file and that can change...<NEW_LINE>final StringBuilder builder = new StringBuilder(256).append(configString);<NEW_LINE>// Ideally we'd figure out how to make this Servlet itself injectable but I don't have time.<NEW_LINE>final Injector injector = (Injector) getServletContext().getAttribute(StartupUtils.INJECTOR);<NEW_LINE>final String cookieDomain = injector.getInstance(Key.get(String.class, CookieDomain.class));<NEW_LINE>final Boolean globalChatEnabled = injector.getInstance(Key.get(Boolean.class, GlobalChatEnabled.class));<NEW_LINE>final Boolean gameChatEnabled = injector.getInstance(Key.get(Boolean.class, GameChatEnabled.class));<NEW_LINE>final Boolean insecureIdAllowed = injector.getInstance(Key.get(Boolean.class, InsecureIdAllowed.class));<NEW_LINE>final Boolean broadcastingUsers = injector.getInstance(Key.get(Boolean.class, BroadcastConnectsAndDisconnects.class));<NEW_LINE>builder.append(String.format("cah.COOKIE_DOMAIN = '%s';\n", cookieDomain));<NEW_LINE>builder.append(String.format("cah.GLOBAL_CHAT_ENABLED = %b;\n", globalChatEnabled));<NEW_LINE>builder.append(String.format("cah.GAME_CHAT_ENABLED = %b;\n", gameChatEnabled));<NEW_LINE>builder.append(String.format("cah.INSECURE_ID_ALLOWED = %b;\n", insecureIdAllowed));<NEW_LINE>builder.append(String.format("cah.BROADCASTING_USERS = %b;\n", broadcastingUsers));<NEW_LINE>builder.append(String.format("cah.MIN_PLAYER_LIMIT = %d;\n", injector.getInstance(Key.get(Integer.class, MinPlayerLimit.class))));<NEW_LINE>builder.append(String.format("cah.DEFAULT_PLAYER_LIMIT = %d;\n", injector.getInstance(Key.get(Integer.class, DefaultPlayerLimit.class))));<NEW_LINE>builder.append(String.format("cah.MAX_PLAYER_LIMIT = %d;\n", injector.getInstance(Key.get(Integer.class, MaxPlayerLimit.class))));<NEW_LINE>builder.append(String.format("cah.MIN_SPECTATOR_LIMIT = %d;\n", injector.getInstance(Key.get(Integer.class, MinSpectatorLimit.class))));<NEW_LINE>builder.append(String.format("cah.DEFAULT_SPECTATOR_LIMIT = %d;\n", injector.getInstance(Key.get(Integer.class, DefaultSpectatorLimit.class))));<NEW_LINE>builder.append(String.format("cah.MAX_SPECTATOR_LIMIT = %d;\n", injector.getInstance(Key.get(Integer.class, MaxSpectatorLimit.class))));<NEW_LINE>builder.append(String.format("cah.MIN_SCORE_LIMIT = %d;\n", injector.getInstance(Key.get(Integer.class, MinScoreLimit.class))));<NEW_LINE>builder.append(String.format("cah.DEFAULT_SCORE_LIMIT = %d;\n", injector.getInstance(Key.get(Integer.class, DefaultScoreLimit.class))));<NEW_LINE>builder.append(String.format("cah.MAX_SCORE_LIMIT = %d;\n", injector.getInstance(Key.get(Integer.class<MASK><NEW_LINE>builder.append(String.format("cah.MIN_BLANK_CARD_LIMIT = %d;\n", injector.getInstance(Key.get(Integer.class, MinBlankCardLimit.class))));<NEW_LINE>builder.append(String.format("cah.DEFAULT_BLANK_CARD_LIMIT = %d;\n", injector.getInstance(Key.get(Integer.class, DefaultBlankCardLimit.class))));<NEW_LINE>builder.append(String.format("cah.MAX_BLANK_CARD_LIMIT = %d;\n", injector.getInstance(Key.get(Integer.class, MaxBlankCardLimit.class))));<NEW_LINE>resp.setContentType("text/javascript");<NEW_LINE>final PrintWriter out = resp.getWriter();<NEW_LINE>out.println(builder.toString());<NEW_LINE>out.flush();<NEW_LINE>out.close();<NEW_LINE>} | , MaxScoreLimit.class)))); |
1,258,220 | public Integer[] calculateRange(String beginValue, String endValue) {<NEW_LINE>Integer[] targetPartition = null;<NEW_LINE>try {<NEW_LINE>long startTime = formatter.get().parse(beginValue).getTime();<NEW_LINE>long endTime = formatter.get().parse(endValue).getTime();<NEW_LINE>Calendar now = Calendar.getInstance();<NEW_LINE>long nowTime = now.getTimeInMillis();<NEW_LINE><MASK><NEW_LINE>long diffDays = (nowTime - startTime) / (1000 * 60 * 60 * 24) + 1;<NEW_LINE>if (diffDays - sLastTime <= 0 || diffDays < 0) {<NEW_LINE>Integer[] re = new Integer[1];<NEW_LINE>re[0] = 0;<NEW_LINE>targetPartition = re;<NEW_LINE>} else {<NEW_LINE>Integer[] re = null;<NEW_LINE>Integer begin = 0, end = 0;<NEW_LINE>end = this.calculate(StringUtil.removeBackquote(beginValue));<NEW_LINE>boolean hasLimit = false;<NEW_LINE>if (endTime - limitDate > 0) {<NEW_LINE>endTime = limitDate;<NEW_LINE>hasLimit = true;<NEW_LINE>}<NEW_LINE>begin = this.calculate(StringUtil.removeBackquote(formatter.get().format(endTime)));<NEW_LINE>if (begin == null || end == null) {<NEW_LINE>return re;<NEW_LINE>}<NEW_LINE>if (end >= begin) {<NEW_LINE>int len = end - begin + 1;<NEW_LINE>if (hasLimit) {<NEW_LINE>re = new Integer[len + 1];<NEW_LINE>re[0] = 0;<NEW_LINE>for (int i = 0; i < len; i++) {<NEW_LINE>re[i + 1] = begin + i;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>re = new Integer[len];<NEW_LINE>for (int i = 0; i < len; i++) {<NEW_LINE>re[i] = begin + i;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return re;<NEW_LINE>} else {<NEW_LINE>return re;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (ParseException e) {<NEW_LINE>throw new IllegalArgumentException(new StringBuilder().append("endValue:").append(endValue).append(" Please check if the format satisfied.").toString(), e);<NEW_LINE>}<NEW_LINE>return targetPartition;<NEW_LINE>} | long limitDate = nowTime - sLastTime * oneDay; |
154,104 | // Tests behavior when shutdownNow occurs while invokeAll is submitting and running tasks. Supply a group of 3 tasks to invokeAll.<NEW_LINE>// The first task should complete successfully. The second task waits for the third to start and then shuts down the executor.<NEW_LINE>// Relying on behavior of policy executor that runs invokeAll tasks in reverse order on the current thread if the global<NEW_LINE>// executor hasn't been able to start them, the third (last) task should start on the current thread and block until canceled<NEW_LINE>// by shutdownNow.<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>@Test<NEW_LINE>public void testShutdownNowDuringInvokeAll() throws Exception {<NEW_LINE>PolicyExecutor executor = provider.create("testShutdownNowDuringInvokeAll").maxConcurrency(2).maxPolicy(MaxPolicy.strict);<NEW_LINE>CountDownLatch blocker = new CountDownLatch(1);<NEW_LINE>CountDownLatch task3BeginLatch = new CountDownLatch(1);<NEW_LINE>CountDownLatch unused = new CountDownLatch(0);<NEW_LINE>List<Callable<Object>> tasks = new ArrayList<Callable<Object>>();<NEW_LINE>tasks.add(Callable.class.cast(new SharedIncrementTask()));<NEW_LINE>tasks.add(Callable.class.cast(new ShutdownTask(executor, true, unused, task3BeginLatch, TimeUnit.MINUTES.toNanos(5))));<NEW_LINE>tasks.add(Callable.class.cast(new CountDownTask(task3BeginLatch, blocker, TimeUnit.MINUTES<MASK><NEW_LINE>List<Future<Object>> futures = executor.invokeAll(tasks);<NEW_LINE>assertEquals(3, futures.size());<NEW_LINE>Future<Object> future = futures.get(0);<NEW_LINE>assertFalse(future.isCancelled());<NEW_LINE>assertTrue(future.isDone());<NEW_LINE>assertEquals(1, future.get(0, TimeUnit.SECONDS));<NEW_LINE>assertEquals(1, SharedIncrementTask.class.cast(tasks.get(0)).count());<NEW_LINE>future = futures.get(1);<NEW_LINE>assertTrue(future.isCancelled());<NEW_LINE>assertTrue(future.isDone());<NEW_LINE>try {<NEW_LINE>fail("ShutdownTask should have been canceled by shutdown. Instead: " + future.get(0, TimeUnit.SECONDS));<NEW_LINE>} catch (CancellationException x) {<NEW_LINE>// due to shutdown<NEW_LINE>}<NEW_LINE>future = futures.get(2);<NEW_LINE>assertTrue(future.isCancelled());<NEW_LINE>assertTrue(future.isDone());<NEW_LINE>try {<NEW_LINE>fail("CountDownTask should have been canceled by shutdown. Instead: " + future.get(0, TimeUnit.SECONDS));<NEW_LINE>} catch (CancellationException x) {<NEW_LINE>// due to shutdown<NEW_LINE>}<NEW_LINE>assertTrue(executor.awaitTermination(TIMEOUT_NS, TimeUnit.NANOSECONDS));<NEW_LINE>} | .toNanos(5)))); |
11,318 | protected void paintPlainLine(Graphics gfx, int line, int x, int y) {<NEW_LINE>paintHighlight(gfx, line, y);<NEW_LINE>// don't try to draw lines past where they exist in the document<NEW_LINE>// https://github.com/processing/processing/issues/5628<NEW_LINE>if (line < textArea.getLineCount()) {<NEW_LINE>textArea.getLineText(line, currentLine);<NEW_LINE>int x0 = x - textArea.getHorizontalOffset();<NEW_LINE>// prevent the blinking from drawing with last color used<NEW_LINE>// https://github.com/processing/processing/issues/5628<NEW_LINE>gfx.setColor(defaults.fgcolor);<NEW_LINE>gfx.setFont(plainFont);<NEW_LINE>y += fm.getHeight();<NEW_LINE>// doesn't respect fixed width like it should<NEW_LINE>// x = Utilities.drawTabbedText(currentLine, x, y, gfx, this, 0);<NEW_LINE>// int w = fm.charWidth(' ');<NEW_LINE>for (int i = 0; i < currentLine.count; i++) {<NEW_LINE>gfx.drawChars(currentLine.array, currentLine.offset + i, 1, x, y);<NEW_LINE>x = currentLine.array[currentLine.offset + i] == '\t' ? x0 + (int) nextTabStop(x - x0, i) : x + fm.charWidth(currentLine.array<MASK><NEW_LINE>// textArea.offsetToX(line, currentLine.offset + i);<NEW_LINE>}<NEW_LINE>// Draw characters via input method.<NEW_LINE>if (compositionTextPainter != null && compositionTextPainter.hasComposedTextLayout()) {<NEW_LINE>compositionTextPainter.draw(gfx, defaults.lineHighlightColor);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (defaults.eolMarkers) {<NEW_LINE>gfx.setColor(defaults.eolMarkerColor);<NEW_LINE>gfx.drawString(".", x, y);<NEW_LINE>}<NEW_LINE>} | [currentLine.offset + i]); |
668,579 | public void invoke(List<PdfObject> operands, PdfContentStreamHandler handler, PdfDictionary resources) {<NEW_LINE>PdfObject firstOperand = operands.get(0);<NEW_LINE>String tagName = firstOperand.toString().substring(1).toLowerCase(Locale.ROOT);<NEW_LINE>if ("artifact".equals(tagName) || "placedpdf".equals(tagName) || handler.contextNames.peek() == null) {<NEW_LINE>tagName = null;<NEW_LINE>} else if ("l".equals(tagName)) {<NEW_LINE>tagName = "ul";<NEW_LINE>}<NEW_LINE>PdfDictionary attrs = getBDCDictionary(operands, resources);<NEW_LINE>if (attrs != null && tagName != null) {<NEW_LINE>PdfString alternateText = attrs.getAsString(PdfName.E);<NEW_LINE>if (alternateText != null) {<NEW_LINE>handler.pushContext(tagName);<NEW_LINE>handler.textFragments.add(new FinalText<MASK><NEW_LINE>handler.popContext();<NEW_LINE>// ignore rest of the content of this element<NEW_LINE>handler.pushContext(null);<NEW_LINE>return;<NEW_LINE>} else if (attrs.get(PdfName.TYPE) != null) {<NEW_LINE>// ignore tag for non-tag marked content that sometimes<NEW_LINE>// shows up.<NEW_LINE>tagName = "";<NEW_LINE>}<NEW_LINE>}<NEW_LINE>handler.pushContext(tagName);<NEW_LINE>} | (alternateText.toString())); |
1,640,908 | private static void assignSequence(StarlarkThread.Frame fr, List<Expression> lhs, Object x) throws EvalException, InterruptedException {<NEW_LINE>// TODO(adonovan): lock/unlock rhs during iteration so that<NEW_LINE>// assignments fail when the left side aliases the right,<NEW_LINE>// which is a tricky case in Python assignment semantics.<NEW_LINE>int <MASK><NEW_LINE>int nlhs = lhs.size();<NEW_LINE>if (nrhs < 0 || x instanceof String) {<NEW_LINE>// strings are not iterable<NEW_LINE>throw Starlark.errorf("got '%s' in sequence assignment (want %d-element sequence)", Starlark.type(x), nlhs);<NEW_LINE>}<NEW_LINE>Iterable<?> rhs = Starlark.toIterable(x);<NEW_LINE>if (nlhs != nrhs) {<NEW_LINE>throw Starlark.errorf("too %s values to unpack (got %d, want %d)", nrhs < nlhs ? "few" : "many", nrhs, nlhs);<NEW_LINE>}<NEW_LINE>int i = 0;<NEW_LINE>for (Object item : rhs) {<NEW_LINE>assign(fr, lhs.get(i), item);<NEW_LINE>i++;<NEW_LINE>}<NEW_LINE>} | nrhs = Starlark.len(x); |
1,656,708 | final CreateStackInstancesResult executeCreateStackInstances(CreateStackInstancesRequest createStackInstancesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createStackInstancesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateStackInstancesRequest> request = null;<NEW_LINE>Response<CreateStackInstancesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateStackInstancesRequestMarshaller().marshall(super.beforeMarshalling(createStackInstancesRequest));<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, "CloudFormation");<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>StaxResponseHandler<CreateStackInstancesResult> responseHandler = new StaxResponseHandler<CreateStackInstancesResult>(new CreateStackInstancesResultStaxUnmarshaller());<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, "CreateStackInstances"); |
30,446 | public static PrivTable read(DataInput in) throws IOException {<NEW_LINE>String <MASK><NEW_LINE>if (className.startsWith("org.apache.doris")) {<NEW_LINE>className = className.replaceFirst("org.apache.doris", "com.starrocks");<NEW_LINE>}<NEW_LINE>PrivTable privTable = null;<NEW_LINE>try {<NEW_LINE>Class<? extends PrivTable> derivedClass = (Class<? extends PrivTable>) Class.forName(className);<NEW_LINE>privTable = derivedClass.newInstance();<NEW_LINE>Class[] paramTypes = { DataInput.class };<NEW_LINE>Method readMethod = derivedClass.getMethod("readFields", paramTypes);<NEW_LINE>Object[] params = { in };<NEW_LINE>readMethod.invoke(privTable, params);<NEW_LINE>return privTable;<NEW_LINE>} catch (ClassNotFoundException | InstantiationException | IllegalAccessException | NoSuchMethodException | SecurityException | IllegalArgumentException | InvocationTargetException e) {<NEW_LINE>throw new IOException("failed read PrivTable", e);<NEW_LINE>}<NEW_LINE>} | className = Text.readString(in); |
1,377,618 | private ClassPath[] validatePaths() {<NEW_LINE>ClassPath pmp = processorModulePath.get();<NEW_LINE>if (pmp == null) {<NEW_LINE>pmp = ClassPath.getClassPath(root, JavaClassPathConstants.MODULE_PROCESSOR_PATH);<NEW_LINE>if (pmp != null && processorModulePath.compareAndSet(null, pmp)) {<NEW_LINE>listenOnProcessorPath(pmp, this);<NEW_LINE>classLoaderCache = null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (pp == null) {<NEW_LINE>pp = ClassPath.getClassPath(root, JavaClassPathConstants.PROCESSOR_PATH);<NEW_LINE>if (pp != null && processorPath.compareAndSet(null, pp)) {<NEW_LINE>bootPath = ClassPath.getClassPath(root, ClassPath.BOOT);<NEW_LINE>compilePath = ClassPath.getClassPath(root, ClassPath.COMPILE);<NEW_LINE>listenOnProcessorPath(pp, this);<NEW_LINE>classLoaderCache = null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new ClassPath[] { pmp, pp };<NEW_LINE>} | ClassPath pp = processorPath.get(); |
332,119 | private void loadNode428() {<NEW_LINE>PropertyTypeNode node = new PropertyTypeNode(this.context, Identifiers.CertificateGroupFolderType_AdditionalGroup_Placeholder_TrustList_Size, new QualifiedName(0, "Size"), new LocalizedText("en", "Size"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.UInt64, -1, new UInteger[] {}, UByte.valueOf(1), UByte.valueOf<MASK><NEW_LINE>node.addReference(new Reference(Identifiers.CertificateGroupFolderType_AdditionalGroup_Placeholder_TrustList_Size, Identifiers.HasTypeDefinition, Identifiers.PropertyType.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.CertificateGroupFolderType_AdditionalGroup_Placeholder_TrustList_Size, Identifiers.HasModellingRule, Identifiers.ModellingRule_Mandatory.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.CertificateGroupFolderType_AdditionalGroup_Placeholder_TrustList_Size, Identifiers.HasProperty, Identifiers.CertificateGroupFolderType_AdditionalGroup_Placeholder_TrustList.expanded(), false));<NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>} | (1), 0.0, false); |
744,729 | //<NEW_LINE>// admin index<NEW_LINE>@GetMapping("/admin")<NEW_LINE>public void adminHome(Model model, @Value("${alfio.version}") String version, HttpServletRequest request, HttpServletResponse response, Principal principal) throws IOException {<NEW_LINE><MASK><NEW_LINE>model.addAttribute("username", principal.getName());<NEW_LINE>model.addAttribute("basicConfigurationNeeded", configurationManager.isBasicConfigurationNeeded());<NEW_LINE>boolean isDBAuthentication = !(principal instanceof OpenIdAlfioAuthentication);<NEW_LINE>model.addAttribute("isDBAuthentication", isDBAuthentication);<NEW_LINE>if (!isDBAuthentication) {<NEW_LINE>String idpLogoutRedirectionUrl = ((OpenIdAlfioAuthentication) SecurityContextHolder.getContext().getAuthentication()).getIdpLogoutRedirectionUrl();<NEW_LINE>model.addAttribute("idpLogoutRedirectionUrl", idpLogoutRedirectionUrl);<NEW_LINE>} else {<NEW_LINE>model.addAttribute("idpLogoutRedirectionUrl", null);<NEW_LINE>}<NEW_LINE>Collection<String> authorities = SecurityContextHolder.getContext().getAuthentication().getAuthorities().stream().map(GrantedAuthority::getAuthority).toList();<NEW_LINE>boolean isAdmin = authorities.contains(Role.ADMIN.getRoleName());<NEW_LINE>model.addAttribute("isOwner", isAdmin || authorities.contains(Role.OWNER.getRoleName()));<NEW_LINE>model.addAttribute("isAdmin", isAdmin);<NEW_LINE>//<NEW_LINE>addCommonModelAttributes(model, request, version);<NEW_LINE>model.addAttribute("displayProjectBanner", isAdmin && configurationManager.getForSystem(SHOW_PROJECT_BANNER).getValueAsBooleanOrDefault());<NEW_LINE>//<NEW_LINE>try (var os = response.getOutputStream()) {<NEW_LINE>response.setContentType(TEXT_HTML_CHARSET_UTF_8);<NEW_LINE>response.setCharacterEncoding(UTF_8);<NEW_LINE>var nonce = addCspHeader(response, false);<NEW_LINE>model.addAttribute("nonce", nonce);<NEW_LINE>templateManager.renderHtml(new ClassPathResource("alfio/web-templates/admin-index.ms"), model.asMap(), os);<NEW_LINE>}<NEW_LINE>} | model.addAttribute("alfioVersion", version); |
779,426 | public void processImage(int sourceID, long frameID, BufferedImage buffered, ImageBase input) {<NEW_LINE>original = ConvertBufferedImage.checkCopy(buffered, original);<NEW_LINE>GrayF32 gray = (GrayF32) input;<NEW_LINE>GrayF32 featureImg;<NEW_LINE>double processingTime;<NEW_LINE>synchronized (lockAlgorithm) {<NEW_LINE>long time0 = System.nanoTime();<NEW_LINE>boolean success = detector.process(gray);<NEW_LINE>long time1 = System.nanoTime();<NEW_LINE>// milliseconds<NEW_LINE>processingTime <MASK><NEW_LINE>if (controlPanel.showRawIntensity.value) {<NEW_LINE>featureImg = detector.getDetector().getDetector().getIntensityRaw();<NEW_LINE>} else {<NEW_LINE>featureImg = detector.getDetector().getDetector().getIntensity2x2();<NEW_LINE>}<NEW_LINE>if (controlPanel.logIntensity) {<NEW_LINE>PixelMath.logSign(featureImg, 1.0f, logIntensity);<NEW_LINE>VisualizeImageData.colorizeSign(logIntensity, visualized, ImageStatistics.maxAbs(logIntensity));<NEW_LINE>} else {<NEW_LINE>VisualizeImageData.colorizeSign(featureImg, visualized, ImageStatistics.maxAbs(featureImg));<NEW_LINE>}<NEW_LINE>synchronized (lockCorners) {<NEW_LINE>visualizeUtils.update(detector);<NEW_LINE>this.success = success;<NEW_LINE>if (success) {<NEW_LINE>CalibrationObservation detected = detector.getDetectedPoints();<NEW_LINE>foundChessboard.reset();<NEW_LINE>for (int i = 0; i < detected.size(); i++) {<NEW_LINE>foundChessboard.grow().setTo(detected.get(i));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>SwingUtilities.invokeLater(() -> {<NEW_LINE>controlPanel.setProcessingTimeMS(processingTime);<NEW_LINE>imagePanel.setBufferedImageNoChange(original);<NEW_LINE>imagePanel.repaint();<NEW_LINE>});<NEW_LINE>} | = (time1 - time0) * 1e-6; |
56,196 | private CompiledCondition generateExpiryCompiledCondition() {<NEW_LINE>MetaStreamEvent tableMetaStreamEvent = new MetaStreamEvent();<NEW_LINE>tableMetaStreamEvent.setEventType(MetaStreamEvent.EventType.TABLE);<NEW_LINE>TableDefinition matchingTableDefinition = TableDefinition.id(cacheTable.getTableDefinition().getId());<NEW_LINE>for (Attribute attribute : cacheTable.getTableDefinition().getAttributeList()) {<NEW_LINE>tableMetaStreamEvent.addOutputData(attribute);<NEW_LINE>matchingTableDefinition.attribute(attribute.getName(), attribute.getType());<NEW_LINE>}<NEW_LINE>tableMetaStreamEvent.addInputDefinition(matchingTableDefinition);<NEW_LINE>streamEventFactory = new StreamEventFactory(tableMetaStreamEvent);<NEW_LINE>Variable rightExpressionForSubtract = new Variable(CACHE_TABLE_TIMESTAMP_ADDED);<NEW_LINE>rightExpressionForSubtract.setStreamId(cacheTable.getTableDefinition().getId());<NEW_LINE>Expression rightExpressionForCompare = new LongConstant(retentionPeriod);<NEW_LINE>Compare.Operator greaterThanOperator = Compare.Operator.GREATER_THAN;<NEW_LINE>MetaStreamEvent currentTimeMetaStreamEvent = new MetaStreamEvent();<NEW_LINE>currentTimeMetaStreamEvent.setEventType(MetaStreamEvent.EventType.TABLE);<NEW_LINE>Attribute currentTimeAttribute = new Attribute(CACHE_EXPIRE_CURRENT_TIME, Attribute.Type.LONG);<NEW_LINE>currentTimeMetaStreamEvent.addOutputData(currentTimeAttribute);<NEW_LINE>TableDefinition currentTimeTableDefinition = TableDefinition.id("");<NEW_LINE>currentTimeTableDefinition.attribute(CACHE_EXPIRE_CURRENT_TIME, Attribute.Type.LONG);<NEW_LINE>currentTimeMetaStreamEvent.addInputDefinition(currentTimeTableDefinition);<NEW_LINE>MetaStateEvent metaStateEvent = new MetaStateEvent(2);<NEW_LINE>metaStateEvent.addEvent(currentTimeMetaStreamEvent);<NEW_LINE>metaStateEvent.addEvent(tableMetaStreamEvent);<NEW_LINE>MatchingMetaInfoHolder matchingMetaInfoHolder = MatcherParser.constructMatchingMetaStateHolder(metaStateEvent, 0, cacheTable.getTableDefinition(), 0);<NEW_LINE>List<VariableExpressionExecutor> variableExpressionExecutors = new ArrayList<>();<NEW_LINE>Expression leftExpressionForSubtract = new Variable(CACHE_EXPIRE_CURRENT_TIME);<NEW_LINE>Expression leftExpressionForCompare = new Subtract(leftExpressionForSubtract, rightExpressionForSubtract);<NEW_LINE>Expression deleteCondition = new <MASK><NEW_LINE>SiddhiQueryContext siddhiQueryContext = new SiddhiQueryContext(siddhiAppContext, "expiryDeleteQuery");<NEW_LINE>return cacheTable.compileCondition(deleteCondition, matchingMetaInfoHolder, variableExpressionExecutors, tableMap, siddhiQueryContext);<NEW_LINE>} | Compare(leftExpressionForCompare, greaterThanOperator, rightExpressionForCompare); |
778,372 | private void configure() {<NEW_LINE>final LogManager manager = LogManager.getLogManager();<NEW_LINE>final String className = this.getClass().getName();<NEW_LINE>final String level = manager.getProperty(className + ".level");<NEW_LINE>this.setLevel((level == null) ? Level.INFO : Level.parse(level));<NEW_LINE>final Level levelStdOut = this.parseLevel(manager.getProperty(className + ".levelStdOut"));<NEW_LINE>final Level levelSplit = this.parseLevel(manager.getProperty(className + ".levelSplit"));<NEW_LINE>final Level levelStdErr = this.parseLevel(manager.getProperty(className + ".levelStdErr"));<NEW_LINE>this.<MASK><NEW_LINE>final String filter = manager.getProperty(className + ".filter");<NEW_LINE>this.setFilter(this.makeFilter(filter));<NEW_LINE>final String formatter = manager.getProperty(className + ".formatter");<NEW_LINE>this.setFormatter(this.makeFormatter(formatter));<NEW_LINE>final String encoding = manager.getProperty(className + ".encoding");<NEW_LINE>try {<NEW_LINE>this.stdOutHandler.setEncoding(encoding);<NEW_LINE>this.stdErrHandler.setEncoding(encoding);<NEW_LINE>} catch (final UnsupportedEncodingException e) {<NEW_LINE>ConcurrentLog.logException(e);<NEW_LINE>}<NEW_LINE>final String ignoreCtrlChrStr = manager.getProperty(className + ".ignoreCtrlChr");<NEW_LINE>this.ignoreCtrlChr = (ignoreCtrlChrStr == null) ? false : "true".equalsIgnoreCase(ignoreCtrlChrStr);<NEW_LINE>} | setLevels(levelStdOut, levelSplit, levelStdErr); |
240,576 | private void applyConfig(@Nullable Map<String, Object> config) {<NEW_LINE>if (config == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final String providerNameString = Objects.toString(config.get("provider"), null);<NEW_LINE>if (providerNameString != null) {<NEW_LINE>providerName = providerNameString;<NEW_LINE>}<NEW_LINE>final String defaultHeightString = Objects.toString(config.get("defaultHeight"), null);<NEW_LINE>if (defaultHeightString != null) {<NEW_LINE>try {<NEW_LINE>defaultHeight = Integer.parseInt(defaultHeightString);<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>logger.warn("'{}' is not a valid integer value for the defaultHeight parameter.", defaultHeightString);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final String defaultWidthString = Objects.toString(config.get("defaultWidth"), null);<NEW_LINE>if (defaultWidthString != null) {<NEW_LINE>try {<NEW_LINE>defaultWidth = Integer.parseInt(defaultWidthString);<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>logger.warn("'{}' is not a valid integer value for the defaultWidth parameter.", defaultWidthString);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final String scaleString = Objects.toString(config.get("scale"), null);<NEW_LINE>if (scaleString != null) {<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>// Set scale to normal if the custom value is unrealistically low<NEW_LINE>if (scale < 0.1) {<NEW_LINE>scale = 1.0;<NEW_LINE>}<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>logger.warn("'{}' is not a valid number value for the scale parameter.", scaleString);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final String maxWidthString = Objects.toString(config.get("maxWidth"), null);<NEW_LINE>if (maxWidthString != null) {<NEW_LINE>try {<NEW_LINE>maxWidth = Integer.parseInt(maxWidthString);<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>logger.warn("'{}' is not a valid integer value for the maxWidth parameter.", maxWidthString);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | scale = Double.parseDouble(scaleString); |
960,149 | public //<NEW_LINE>ResponseEntity<JsonAttachment> //<NEW_LINE>importMunicipalityInvoiceXML(//<NEW_LINE>@RequestParam("file") @NonNull final MultipartFile xmlInvoiceFile, //<NEW_LINE>@ApiParam(defaultValue = "DONT_UPDATE", value = "This is applied only to the biller; the invoice recipient (municipality) is always created or updated on the fly.") @RequestParam(required = false) final SyncAdvise.IfExists ifBPartnersExist, //<NEW_LINE>@ApiParam(defaultValue = "CREATE", value = "This is applied only to the biller; the invoice recipient (municipality) is always created or updated on the fly.") @RequestParam(required = false) final SyncAdvise.IfNotExists ifBPartnersNotExist, //<NEW_LINE>@ApiParam(defaultValue = "DONT_UPDATE") @RequestParam(required = false) final SyncAdvise.IfExists ifProductsExist, @ApiParam(defaultValue = "CREATE") @RequestParam(required = false) final SyncAdvise.IfNotExists ifProductsNotExist) {<NEW_LINE>final SyncAdvise debitorSyncAdvise = SyncAdvise.builder().ifExists(IfExists.UPDATE_MERGE).ifNotExists(IfNotExists.CREATE).build();<NEW_LINE>// wrt to the biller-bpartner's org, we use the same advise as with the biller itself<NEW_LINE>final SyncAdvise billerSyncAdvise = SyncAdvise.builder().ifExists(coalesce(ifBPartnersExist, IfExists.DONT_UPDATE)).ifNotExists(coalesce(ifBPartnersNotExist, IfNotExists.CREATE)).build();<NEW_LINE>final SyncAdvise productSyncAdvise = SyncAdvise.builder().ifExists(coalesce(ifProductsExist, IfExists.DONT_UPDATE)).ifNotExists(coalesce(ifProductsNotExist, IfNotExists.CREATE)).build();<NEW_LINE>return importInvoiceXML(xmlInvoiceFile, HealthCareInvoiceDocSubType.<MASK><NEW_LINE>} | GM, billerSyncAdvise, debitorSyncAdvise, productSyncAdvise); |
986,659 | final DeleteProjectVersionResult executeDeleteProjectVersion(DeleteProjectVersionRequest deleteProjectVersionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteProjectVersionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteProjectVersionRequest> request = null;<NEW_LINE>Response<DeleteProjectVersionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteProjectVersionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteProjectVersionRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Rekognition");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteProjectVersion");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteProjectVersionResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteProjectVersionResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); |
144,655 | static Dictionary load(DataInputStream dis, Args args) throws IOException {<NEW_LINE>Dictionary dict = new Dictionary(args);<NEW_LINE>dict.size_ = dis.readInt();<NEW_LINE>dict.nwords_ = dis.readInt();<NEW_LINE>dict.nlabels_ = dis.readInt();<NEW_LINE>dict.ntokens_ = dis.readLong();<NEW_LINE>dict.pruneidx_size_ = dis.readInt();<NEW_LINE>for (int i = 0; i < dict.size_; i++) {<NEW_LINE>Entry e = new Entry();<NEW_LINE>e.word = dis.readUTF();<NEW_LINE>e.count = dis.readInt();<NEW_LINE>e.type = dis.readInt();<NEW_LINE>dict.words_.add(e);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < dict.pruneidx_size_; i++) {<NEW_LINE>int first = dis.readInt();<NEW_LINE>int second = dis.readInt();<NEW_LINE>dict.pruneidx_.put(first, second);<NEW_LINE>}<NEW_LINE>dict.init();<NEW_LINE>int word2IntSize = (int) Math.ceil(dict.size_ / 0.7);<NEW_LINE>dict.word2int_ = new int[word2IntSize];<NEW_LINE>Arrays.fill(dict.word2int_, -1);<NEW_LINE>for (int i = 0; i < dict.size_; i++) {<NEW_LINE>dict.word2int_[dict.find(dict.words_.get(<MASK><NEW_LINE>}<NEW_LINE>return dict;<NEW_LINE>} | i).word)] = i; |
1,780,182 | public static ListenableFuture<FetchedImage> load(Client client, Path.Device device, Path.ResourceData imagePath) {<NEW_LINE>return MoreFutures.transformAsync(client.get(resourceInfo(imagePath), device), value -> {<NEW_LINE>API.ResourceData data = value.getResourceData();<NEW_LINE>API.Texture texture = data.getTexture();<NEW_LINE>switch(texture.getTypeCase()) {<NEW_LINE>case TEXTURE_1D:<NEW_LINE>return load(client, device, imagePath, getFormat(texture.getTexture1D()));<NEW_LINE>case TEXTURE_1D_ARRAY:<NEW_LINE>return load(client, device, imagePath, getFormat<MASK><NEW_LINE>case TEXTURE_2D:<NEW_LINE>return load(client, device, imagePath, getFormat(texture.getTexture2D()));<NEW_LINE>case TEXTURE_2D_ARRAY:<NEW_LINE>return load(client, device, imagePath, getFormat(texture.getTexture2DArray()));<NEW_LINE>case TEXTURE_3D:<NEW_LINE>return load(client, device, imagePath, getFormat(texture.getTexture3D()));<NEW_LINE>case CUBEMAP:<NEW_LINE>return load(client, device, imagePath, getFormat(texture.getCubemap()));<NEW_LINE>case CUBEMAP_ARRAY:<NEW_LINE>return load(client, device, imagePath, getFormat(texture.getCubemapArray()));<NEW_LINE>default:<NEW_LINE>throw new UnsupportedOperationException("Unexpected resource type: " + value);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | (texture.getTexture1DArray())); |
119,671 | public Object call(Hints readOnly, Object... params) throws Throwable {<NEW_LINE>//<NEW_LINE>DataStack cloneStack = new DataStack() {<NEW_LINE><NEW_LINE>{<NEW_LINE>push(new RefLambdaCallStruts(params));<NEW_LINE>}<NEW_LINE>};<NEW_LINE>//<NEW_LINE>InstSequence instSequence = this.instSequence.clone();<NEW_LINE>OpcodesPool opcodesPool = OpcodesPool.defaultOpcodesPool();<NEW_LINE>DataHeap dataHeap <MASK><NEW_LINE>while (instSequence.hasNext()) {<NEW_LINE>//<NEW_LINE>//<NEW_LINE>opcodesPool.//<NEW_LINE>doWork(//<NEW_LINE>instSequence, //<NEW_LINE>dataHeap, //<NEW_LINE>cloneStack, //<NEW_LINE>this.envStack, this.context);<NEW_LINE>instSequence.doNext(1);<NEW_LINE>}<NEW_LINE>DataModel result = cloneStack.getResult();<NEW_LINE>if (cloneStack.getExitType() != ExitType.Throw) {<NEW_LINE>return (result != null) ? result.unwrap() : DomainHelper.nullDomain();<NEW_LINE>} else {<NEW_LINE>throw new //<NEW_LINE>//<NEW_LINE>RefLambdaCallException(//<NEW_LINE>instSequence.programLocation(), //<NEW_LINE>cloneStack.getResultCode(), cloneStack.getResult());<NEW_LINE>}<NEW_LINE>} | = new DataHeap(this.dataHeap); |
362,979 | public void checkParentLimit(long newBytesReserved, String label) throws CircuitBreakingException {<NEW_LINE>long totalUsed = parentUsed(newBytesReserved);<NEW_LINE>long parentLimit = this.parentSettings.getLimit();<NEW_LINE>if (totalUsed > parentLimit) {<NEW_LINE>long breakersTotalUsed = breakers.values().stream().mapToLong(<MASK><NEW_LINE>// if the individual breakers hardly use any memory we assume that there is a lot of heap usage by objects which can be GCd.<NEW_LINE>// We want to allow the query so that it triggers GCs<NEW_LINE>if ((breakersTotalUsed + newBytesReserved) < (parentLimit * PARENT_BREAKER_ESCAPE_HATCH_PERCENTAGE)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>this.parentTripCount.incrementAndGet();<NEW_LINE>final StringBuilder message = new StringBuilder("[parent] Data too large, data for [" + label + "]" + " would be [" + totalUsed + "/" + new ByteSizeValue(totalUsed) + "]" + ", which is larger than the limit of [" + parentLimit + "/" + new ByteSizeValue(parentLimit) + "]");<NEW_LINE>message.append(", usages [");<NEW_LINE>message.append(this.breakers.entrySet().stream().map(e -> {<NEW_LINE>final CircuitBreaker breaker = e.getValue();<NEW_LINE>final long breakerUsed = breaker.getUsed();<NEW_LINE>return e.getKey() + "=" + breakerUsed + "/" + new ByteSizeValue(breakerUsed);<NEW_LINE>}).collect(Collectors.joining(", ")));<NEW_LINE>message.append("]");<NEW_LINE>throw new CircuitBreakingException(message.toString(), totalUsed, parentLimit);<NEW_LINE>}<NEW_LINE>} | CircuitBreaker::getUsed).sum(); |
1,438,956 | public boolean visit(ClassInstanceCreation node) {<NEW_LINE>if (node.getAnonymousClassDeclaration() != null) {<NEW_LINE>// record anonymous class here instead of overriding visit(AnonymousClassDeclaration<NEW_LINE>// node) because the ClassInstanceCreation still contains the Type node.<NEW_LINE>AnonymousClassDeclaration anonymousClassDeclaration = node.getAnonymousClassDeclaration();<NEW_LINE>DeclName symbolName = DeclNameResolver.getQualifiedDeclName(anonymousClassDeclaration, m_filePath, m_compilationUnit);<NEW_LINE>Range anonymousClassScope = getRange(anonymousClassDeclaration);<NEW_LINE>m_client.recordSymbolWithLocationAndScope(symbolName.toNameHierarchy(), SymbolKind.CLASS, new Range(anonymousClassScope.begin, anonymousClassScope.begin), anonymousClassScope, <MASK><NEW_LINE>recordScope(anonymousClassScope);<NEW_LINE>m_contextStack.push(Arrays.asList(symbolName));<NEW_LINE>} else {<NEW_LINE>IMethodBinding constructorBinding = node.resolveConstructorBinding();<NEW_LINE>if (constructorBinding != null) {<NEW_LINE>constructorBinding = constructorBinding.getMethodDeclaration();<NEW_LINE>}<NEW_LINE>DeclName referencedDeclName = BindingNameResolver.getQualifiedName(constructorBinding, m_filePath, m_compilationUnit).orElse(DeclName.unsolved());<NEW_LINE>if (!referencedDeclName.getIsUnsolved()) {<NEW_LINE>m_client.recordSymbol(referencedDeclName.toNameHierarchy(), SymbolKind.METHOD, AccessKind.NONE, DefinitionKind.NONE);<NEW_LINE>}<NEW_LINE>for (SymbolName context : m_contextStack.peek()) {<NEW_LINE>m_client.recordReference(ReferenceKind.CALL, referencedDeclName.toNameHierarchy(), context.toNameHierarchy(), getRange(node.getType()));<NEW_LINE>}<NEW_LINE>recordReferenceToTypeArguments(constructorBinding, node.typeArguments());<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | AccessKind.NONE, DefinitionKind.EXPLICIT); |
918,402 | public void doTag() throws JspException {<NEW_LINE>if (items == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>JspFragment body = getJspBody();<NEW_LINE>if (body == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>PageContext pageContext = (PageContext) getJspContext();<NEW_LINE>// create an iterator status if the status attribute was set.<NEW_LINE>if (status != null) {<NEW_LINE>iteratorStatus = new IteratorStatus(this.modulus);<NEW_LINE>TagUtil.setScopeAttribute(status, iteratorStatus, scope, pageContext);<NEW_LINE>}<NEW_LINE>if (items instanceof Collection) {<NEW_LINE>iterateCollection((Collection) items, from, count, pageContext);<NEW_LINE>} else if (items.getClass().isArray()) {<NEW_LINE>iterateArray((Object[]) items, from, count, pageContext);<NEW_LINE>} else if (items instanceof String) {<NEW_LINE>iterateArray(Converter.get().toStringArray(items<MASK><NEW_LINE>} else {<NEW_LINE>throw new JspException("Provided items are not iterable");<NEW_LINE>}<NEW_LINE>// cleanup<NEW_LINE>if (status != null) {<NEW_LINE>TagUtil.removeScopeAttribute(status, scope, pageContext);<NEW_LINE>}<NEW_LINE>TagUtil.removeScopeAttribute(var, scope, pageContext);<NEW_LINE>} | ), from, count, pageContext); |
1,393,099 | private static void startAppServers() throws Exception {<NEW_LINE>server.setServerConfigurationFile("JMSContext_ssl.xml");<NEW_LINE>server1.setServerConfigurationFile("TestServer1_ssl.xml");<NEW_LINE>server.startServer("DurableUnShared_Client.log");<NEW_LINE>server1.startServer("DurableUnShared_Server.log");<NEW_LINE>// CWWKF0011I: The TestServer1 server is ready to run a smarter planet. The TestServer1 server started in 6.435 seconds.<NEW_LINE>// CWSID0108I: JMS server has started.<NEW_LINE>// CWWKS4105I: LTPA configuration is ready after 4.028 seconds.<NEW_LINE>for (String messageId : new String[] { "CWWKF0011I.*", "CWSID0108I.*", "CWWKS4105I.*" }) {<NEW_LINE>String waitFor = server.waitForStringInLog(messageId, server.getMatchingLogFile("messages.log"));<NEW_LINE>assertNotNull(<MASK><NEW_LINE>waitFor = server1.waitForStringInLog(messageId, server1.getMatchingLogFile("messages.log"));<NEW_LINE>assertNotNull("Server1 message " + messageId + " not found", waitFor);<NEW_LINE>}<NEW_LINE>// The following FFDC may be thrown at server startup because the channel framework does not become active until the CWWKF0011I message is seen, whereas MDB initialisation takes place beforehand.<NEW_LINE>// FFDC1015I: An FFDC Incident has been created: "com.ibm.wsspi.channelfw.exception.InvalidChainNameException: Chain configuration not found in framework, BootstrapSecureMessaging com.ibm.ws.sib.jfapchannel.richclient.framework.impl.RichClientTransportFactory.getOutboundNetworkConnectionFactoryByName 00280001" at ffdc_21.09.27_15.21.46.0.log<NEW_LINE>// Ignore failed connection attempts between the two servers.<NEW_LINE>// CWSIV0782W: The creation of a connection for destination RedeliveryQueue1 on bus defaultBus for endpoint activation jmsapp/jmsmdb/RDC2MessageDrivenBean failed with exception javax.resource.ResourceException:<NEW_LINE>server.addIgnoredErrors(Arrays.asList("CWSIV0782W"));<NEW_LINE>} | "Server message " + messageId + " not found", waitFor); |
345,683 | // Converts a TableLayout (two columns, label and value) to a string which can be copied<NEW_LINE>public static String table2Text(TableLayout table) {<NEW_LINE>StringBuilder builder = new StringBuilder();<NEW_LINE>for (int i = 0; i < table.getChildCount(); i++) {<NEW_LINE>View v = table.getChildAt(i);<NEW_LINE>if ((v instanceof TableRow) && (v.getVisibility() == View.VISIBLE) && (((TableRow) v).getChildCount() == 2)) {<NEW_LINE>View label = ((TableRow) v).getChildAt(0);<NEW_LINE>View value = ((TableRow<MASK><NEW_LINE>if ((label instanceof TextView) && (value instanceof TextView)) {<NEW_LINE>builder.append(((TextView) label).getText());<NEW_LINE>builder.append(": ");<NEW_LINE>builder.append(((TextView) value).getText());<NEW_LINE>builder.append("\n");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return builder.toString();<NEW_LINE>} | ) v).getChildAt(1); |
1,559,691 | public void testOneShotCallable(PrintWriter out) throws Exception {<NEW_LINE>DBIncrementTask task = new DBIncrementTask("testOneShotCallable");<NEW_LINE>task.getExecutionProperties().put(ManagedTask.TRANSACTION, ManagedTask.SUSPEND);<NEW_LINE>task.getExecutionProperties().<MASK><NEW_LINE>TaskStatus<Integer> status = scheduler.schedule((Callable<Integer>) task, 101, TimeUnit.MILLISECONDS);<NEW_LINE>try {<NEW_LINE>boolean canceled = status.isCancelled();<NEW_LINE>throw new Exception("Task should not have canceled status " + canceled + " until it ends.");<NEW_LINE>} catch (IllegalStateException x) {<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>boolean done = status.isDone();<NEW_LINE>throw new Exception("Task should not have done status " + done + " until it runs at least once.");<NEW_LINE>} catch (IllegalStateException x) {<NEW_LINE>}<NEW_LINE>if (!status.equals(status))<NEW_LINE>throw new Exception("Task status does not equal itself");<NEW_LINE>String toString = status.toString();<NEW_LINE>if (!toString.contains("DBIncrementTask-testOneShotCallable"))<NEW_LINE>throw new Exception("toString output does not contain the IDENTITY_NAME of task. Instead: " + toString);<NEW_LINE>pollForTableEntry("testOneShotCallable", 1);<NEW_LINE>// Wait for completion (and autopurge)<NEW_LINE>for (long start = System.nanoTime(); status != null && System.nanoTime() - start < TIMEOUT_NS; Thread.sleep(POLL_INTERVAL)) status = scheduler.getStatus(status.getTaskId());<NEW_LINE>if (status != null)<NEW_LINE>throw new Exception("Task did not complete and autopurge in allotted interval. " + status);<NEW_LINE>} | put(PersistentExecutor.TRANSACTION_TIMEOUT, "1010"); |
1,358,392 | public void saveConnection() {<NEW_LINE>final boolean connectionChanged = !database.getConfiguration().getPassword().equals(new String(passwordField.getPassword())) || !database.getConfiguration().getHost().equals(databaseHostField.getText()) || !database.getConfiguration().getName().equals(databaseNameField.getText()) || !database.getConfiguration().getUser().equals(databaseUserField.getText());<NEW_LINE>database.getConfiguration().setAutoConnect(autoConnectBox.isSelected());<NEW_LINE>database.getConfiguration().setDescription(databaseDescriptionField.getText());<NEW_LINE>database.getConfiguration().setPassword(new String(passwordField.getPassword()));<NEW_LINE>database.getConfiguration().setSavePassword(savePasswordBox.isSelected());<NEW_LINE>database.getConfiguration().setHost(databaseHostField.getText());<NEW_LINE>database.getConfiguration().setName(databaseNameField.getText());<NEW_LINE>database.getConfiguration().<MASK><NEW_LINE>database.getConfiguration().setIdentity(databaseIdentityField.getText());<NEW_LINE>if (database.isConnected() && connectionChanged && (CMessageBox.showYesNoQuestion(SwingUtilities.getWindowAncestor(CDatabaseSettingsPanel.this), "To adopt the changes you have to re-connect to the database. Do you want to reconnect now?") == JOptionPane.YES_OPTION)) {<NEW_LINE>if (database.close()) {<NEW_LINE>CDatabaseConnectionFunctions.openDatabase(SwingUtilities.getWindowAncestor(CDatabaseSettingsPanel.this), database);<NEW_LINE>} else {<NEW_LINE>CMessageBox.showInformation(SwingUtilities.getWindowAncestor(CDatabaseSettingsPanel.this), "Could not close the selected database because views or other elements from the database are still open.");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ConfigManager.instance().saveSettings((JFrame) SwingUtilities.getAncestorOfClass(JFrame.class, this));<NEW_LINE>} | setUser(databaseUserField.getText()); |
1,639,627 | private static void splitSegment(SplitMetric metric, SplitMetric secondaryMetric, double metricLimit, List<SplitSegment> splitSegments, TrkSegment segment, boolean joinSegments) {<NEW_LINE>double currentMetricEnd = metricLimit;<NEW_LINE>double secondaryMetricEnd = 0;<NEW_LINE>SplitSegment sp = new SplitSegment(segment, 0, 0);<NEW_LINE>double total = 0;<NEW_LINE>WptPt prev = null;<NEW_LINE>for (int k = 0; k < segment.points.size(); k++) {<NEW_LINE>WptPt point = segment.points.get(k);<NEW_LINE>if (k > 0) {<NEW_LINE>double currentSegment = 0;<NEW_LINE>if (!(segment.generalSegment && !joinSegments && point.firstPoint)) {<NEW_LINE>currentSegment = metric.metric(prev, point);<NEW_LINE>secondaryMetricEnd += <MASK><NEW_LINE>}<NEW_LINE>while (total + currentSegment > currentMetricEnd) {<NEW_LINE>double p = currentMetricEnd - total;<NEW_LINE>double cf = (p / currentSegment);<NEW_LINE>sp.setLastPoint(k - 1, cf);<NEW_LINE>sp.metricEnd = currentMetricEnd;<NEW_LINE>sp.secondaryMetricEnd = secondaryMetricEnd;<NEW_LINE>splitSegments.add(sp);<NEW_LINE>sp = new SplitSegment(segment, k - 1, cf);<NEW_LINE>currentMetricEnd += metricLimit;<NEW_LINE>}<NEW_LINE>total += currentSegment;<NEW_LINE>}<NEW_LINE>prev = point;<NEW_LINE>}<NEW_LINE>if (segment.points.size() > 0 && !(sp.endPointInd == segment.points.size() - 1 && sp.startCoeff == 1)) {<NEW_LINE>sp.metricEnd = total;<NEW_LINE>sp.secondaryMetricEnd = secondaryMetricEnd;<NEW_LINE>sp.setLastPoint(segment.points.size() - 2, 1);<NEW_LINE>splitSegments.add(sp);<NEW_LINE>}<NEW_LINE>} | secondaryMetric.metric(prev, point); |
1,151,662 | private static List<Note> extractMonophonicMelodyFromPolyphonicNoteList(List<Note> notes) {<NEW_LINE>final List<Note> result = new ArrayList<>();<NEW_LINE>// This contains the set of notes that we should skip because they overlap an earlier note<NEW_LINE>final Set<Note> notesToSkip = new HashSet<>();<NEW_LINE>Note previousNote = null;<NEW_LINE>for (int i = 0; i < notes.size(); i++) {<NEW_LINE>Note note = notes.get(i);<NEW_LINE>if (notesToSkip.contains(note)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (previousNote != null && previousNote.getEndTick() > note.getStartTick()) {<NEW_LINE>countOfNotesTruncatedDueToLooseOverlapping++;<NEW_LINE>previousNote.setEndTick(note.getStartTick());<NEW_LINE>}<NEW_LINE>result.add(note);<NEW_LINE>addOverlappedNotesToNotesToSkip(<MASK><NEW_LINE>previousNote = note;<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | note, notes, i, notesToSkip); |
711,347 | private void trySendEscToDialog() {<NEW_LINE>if (isTableUI()) {<NEW_LINE>// let the table decide, don't be preemptive<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// System.err.println("SendEscToDialog");<NEW_LINE>EventObject ev = EventQueue.getCurrentEvent();<NEW_LINE>if (ev instanceof KeyEvent && (((KeyEvent) ev).getKeyCode() == KeyEvent.VK_ESCAPE)) {<NEW_LINE>if (ev.getSource() instanceof JComboBox && ((JComboBox) ev.getSource()).isPopupVisible()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (ev.getSource() instanceof JTextComponent && ((JTextComponent) ev.getSource()).getParent() instanceof JComboBox && ((JComboBox) ((JTextComponent) ev.getSource()).getParent()).isPopupVisible()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>InputMap imp = getRootPane().getInputMap(WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);<NEW_LINE>ActionMap am <MASK><NEW_LINE>KeyStroke escape = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0, false);<NEW_LINE>Object key = imp.get(escape);<NEW_LINE>if (key != null) {<NEW_LINE>Action a = am.get(key);<NEW_LINE>if (a != null) {<NEW_LINE>if (Boolean.getBoolean("netbeans.proppanel.logDialogActions")) {<NEW_LINE>// NOI18N<NEW_LINE>// NOI18N<NEW_LINE>System.err.println("Action bound to escape key is " + a);<NEW_LINE>}<NEW_LINE>String commandKey = (String) a.getValue(Action.ACTION_COMMAND_KEY);<NEW_LINE>if (commandKey == null) {<NEW_LINE>// NOI18N<NEW_LINE>commandKey = "cancel";<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>a.actionPerformed(new ActionEvent(this, ActionEvent.ACTION_PERFORMED, commandKey));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | = getRootPane().getActionMap(); |
1,118,036 | private void tryMapping() {<NEW_LINE>int size = notMapped.size();<NEW_LINE>Iterator<DataWrap<T><MASK><NEW_LINE>while (iter.hasNext()) {<NEW_LINE>DataWrap<T> next = iter.next();<NEW_LINE>if (next.parent == null) {<NEW_LINE>Node<T> n = new Node<T>(next.data);<NEW_LINE>map.put(next.id, n);<NEW_LINE>root.getChildren().add(n);<NEW_LINE>iter.remove();<NEW_LINE>} else {<NEW_LINE>if (map.containsKey(next.parent)) {<NEW_LINE>Node<T> n = new Node<T>(next.data);<NEW_LINE>Node<T> node = map.get(next.parent);<NEW_LINE>map.put(next.id, n);<NEW_LINE>node.getChildren().add(n);<NEW_LINE>iter.remove();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (notMapped.size() < size) {<NEW_LINE>tryMapping();<NEW_LINE>}<NEW_LINE>} | > iter = notMapped.iterator(); |
127,614 | static Symbol<Type>[] parse(Types typeDescriptors, Symbol<Signature> signature, int startIndex) throws ClassFormatError {<NEW_LINE>if ((startIndex > signature.length() - 3) || signature.byteAt(startIndex) != '(') {<NEW_LINE>throw new ClassFormatError("Invalid method signature: " + signature);<NEW_LINE>}<NEW_LINE>final List<Symbol<Type>> buf = new ArrayList<>();<NEW_LINE>int i = startIndex + 1;<NEW_LINE>while (signature.byteAt(i) != ')') {<NEW_LINE>final Symbol<Type> descriptor = typeDescriptors.parse(signature, i, true);<NEW_LINE>buf.add(descriptor);<NEW_LINE>i = i + descriptor.length();<NEW_LINE>if (i >= signature.length()) {<NEW_LINE>throw new ClassFormatError("Invalid method signature: " + signature);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>i++;<NEW_LINE>final Symbol<Type> descriptor = typeDescriptors.parse(signature, i, true);<NEW_LINE>if (i + descriptor.length() != signature.length()) {<NEW_LINE>throw new ClassFormatError("Invalid method signature: " + signature);<NEW_LINE>}<NEW_LINE>final Symbol<Type>[] descriptors = buf.toArray(new Symbol[buf<MASK><NEW_LINE>descriptors[buf.size()] = descriptor;<NEW_LINE>return descriptors;<NEW_LINE>} | .size() + 1]); |
1,580,766 | protected JComponent createItemComponent() {<NEW_LINE>myTextLabel = new ErrorLabel() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void setText(String text) {<NEW_LINE>super.setText(text);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>myTextLabel.setOpaque(true);<NEW_LINE>myTextLabel.setBorder(JBUI.Borders.empty(1));<NEW_LINE>myInfoLabel = new ErrorLabel();<NEW_LINE>myInfoLabel.setOpaque(true);<NEW_LINE>myInfoLabel.setBorder(JBUI.Borders.empty(1<MASK><NEW_LINE>myInfoLabel.setFont(FontUtil.minusOne(myInfoLabel.getFont()));<NEW_LINE>JPanel compoundPanel = new OpaquePanel(new BorderLayout(), JBColor.WHITE);<NEW_LINE>myIconLabel = new IconComponent();<NEW_LINE>myInfoLabel.setHorizontalAlignment(SwingConstants.RIGHT);<NEW_LINE>JPanel compoundTextPanel = new OpaquePanel(new BorderLayout(), compoundPanel.getBackground());<NEW_LINE>JPanel textPanel = new OpaquePanel(new BorderLayout(), compoundPanel.getBackground());<NEW_LINE>compoundPanel.add(myIconLabel, BorderLayout.WEST);<NEW_LINE>textPanel.add(myTextLabel, BorderLayout.WEST);<NEW_LINE>textPanel.add(myInfoLabel, BorderLayout.CENTER);<NEW_LINE>compoundTextPanel.add(textPanel, BorderLayout.CENTER);<NEW_LINE>compoundPanel.add(compoundTextPanel, BorderLayout.CENTER);<NEW_LINE>return layoutComponent(compoundPanel);<NEW_LINE>} | , DEFAULT_HGAP, 1, 1)); |
733,191 | private static ImmutableSortedSet<MethodModel> findAllBenchmarkMethods(BenchmarkClassModel benchmarkClass, Instrument instrument) throws InvalidBenchmarkException {<NEW_LINE>ImmutableSortedSet.Builder<MethodModel> result = ImmutableSortedSet.orderedBy(Ordering.natural().onResultOf(new Function<MethodModel, String>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String apply(MethodModel method) {<NEW_LINE>return method.name();<NEW_LINE>}<NEW_LINE>}));<NEW_LINE>Set<String> benchmarkMethodNames = new HashSet<String>();<NEW_LINE>Set<String> overloadedMethodNames = new TreeSet<String>();<NEW_LINE>for (MethodModel method : benchmarkClass.methods()) {<NEW_LINE>if (instrument.isBenchmarkMethod(method)) {<NEW_LINE>result.add(method);<NEW_LINE>if (!benchmarkMethodNames.add(method.name())) {<NEW_LINE>overloadedMethodNames.add(method.name());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!overloadedMethodNames.isEmpty()) {<NEW_LINE>throw new InvalidBenchmarkException("Overloads are disallowed for benchmark methods, found overloads of %s in benchmark %s", <MASK><NEW_LINE>}<NEW_LINE>return result.build();<NEW_LINE>} | overloadedMethodNames, benchmarkClass.simpleName()); |
1,654,566 | private void emitTraps() {<NEW_LINE>Chain<Trap> traps = body.getTraps();<NEW_LINE>SootClass throwable = Scene.v().getSootClass("java.lang.Throwable");<NEW_LINE>Map<LabelNode, Iterator<UnitBox>> handlers = new LinkedHashMap<LabelNode, Iterator<UnitBox>>(tryCatchBlocks.size());<NEW_LINE>for (TryCatchBlockNode tc : tryCatchBlocks) {<NEW_LINE>UnitBox start = Jimple.v().newStmtBox(null);<NEW_LINE>UnitBox end = Jimple.v().newStmtBox(null);<NEW_LINE>Iterator<UnitBox> hitr = handlers.get(tc.handler);<NEW_LINE>if (hitr == null) {<NEW_LINE>hitr = trapHandlers.get(tc.handler).iterator();<NEW_LINE>handlers.put(tc.handler, hitr);<NEW_LINE>}<NEW_LINE>UnitBox handler = hitr.next();<NEW_LINE>SootClass cls = tc.type == null ? throwable : getClassFromScene(AsmUtil.toQualifiedName(tc.type));<NEW_LINE>Trap trap = Jimple.v().newTrap(<MASK><NEW_LINE>traps.add(trap);<NEW_LINE>labels.put(tc.start, start);<NEW_LINE>labels.put(tc.end, end);<NEW_LINE>}<NEW_LINE>} | cls, start, end, handler); |
1,353,654 | public PointSensitivityBuilder presentValueSensitivity(CmsPeriod cmsPeriod, RatesProvider provider) {<NEW_LINE>Currency ccy = cmsPeriod.getCurrency();<NEW_LINE>LocalDate valuationDate = provider.getValuationDate();<NEW_LINE>if (valuationDate.isAfter(cmsPeriod.getPaymentDate())) {<NEW_LINE>return PointSensitivityBuilder.none();<NEW_LINE>}<NEW_LINE>LocalDate fixingDate = cmsPeriod.getFixingDate();<NEW_LINE>double dfPayment = provider.discountFactor(ccy, cmsPeriod.getPaymentDate());<NEW_LINE>if (!fixingDate.isAfter(valuationDate)) {<NEW_LINE>// Using fixing<NEW_LINE>OptionalDouble fixedRate = provider.timeSeries(cmsPeriod.getIndex<MASK><NEW_LINE>if (fixedRate.isPresent()) {<NEW_LINE>double payoff = 0d;<NEW_LINE>switch(cmsPeriod.getCmsPeriodType()) {<NEW_LINE>case CAPLET:<NEW_LINE>payoff = Math.max(fixedRate.getAsDouble() - cmsPeriod.getStrike(), 0d);<NEW_LINE>break;<NEW_LINE>case FLOORLET:<NEW_LINE>payoff = Math.max(cmsPeriod.getStrike() - fixedRate.getAsDouble(), 0d);<NEW_LINE>break;<NEW_LINE>case COUPON:<NEW_LINE>payoff = fixedRate.getAsDouble();<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new IllegalArgumentException("unsupported CMS type");<NEW_LINE>}<NEW_LINE>return provider.discountFactors(ccy).zeroRatePointSensitivity(cmsPeriod.getPaymentDate()).multipliedBy(payoff * cmsPeriod.getNotional() * cmsPeriod.getYearFraction());<NEW_LINE>} else if (fixingDate.isBefore(valuationDate)) {<NEW_LINE>throw new IllegalArgumentException(Messages.format("Unable to get fixing for {} on date {}, no time-series supplied", cmsPeriod.getIndex(), fixingDate));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!cmsPeriod.getCmsPeriodType().equals(CmsPeriodType.COUPON)) {<NEW_LINE>throw new IllegalArgumentException("Unable to price cap or floor in this pricer");<NEW_LINE>}<NEW_LINE>// Using forward<NEW_LINE>ResolvedSwap swap = cmsPeriod.getUnderlyingSwap();<NEW_LINE>ZeroRateSensitivity dfPaymentdr = provider.discountFactors(ccy).zeroRatePointSensitivity(cmsPeriod.getPaymentDate());<NEW_LINE>double forward = swapPricer.parRate(swap, provider);<NEW_LINE>PointSensitivityBuilder forwardSensi = swapPricer.parRateSensitivity(swap, provider);<NEW_LINE>return forwardSensi.multipliedBy(dfPayment).combinedWith(dfPaymentdr.multipliedBy(forward)).multipliedBy(cmsPeriod.getNotional() * cmsPeriod.getYearFraction());<NEW_LINE>} | ()).get(fixingDate); |
579,355 | private void traceApiMessage(JsMessage msg, DestinationHandler dest) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.entry(tc, "traceApiMessage", new Object[] { msg, dest });<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && UserTrace.tc_mt.isDebugEnabled()) {<NEW_LINE>if (msg.isApiMessage()) {<NEW_LINE>String destName = null;<NEW_LINE>String text = "INBOUND_MESSAGE_RECEIVED_CWSJU0020";<NEW_LINE>if (dest != null) {<NEW_LINE>destName = dest.getName();<NEW_LINE>if (destName.startsWith(SIMPConstants.TEMPORARY_QUEUE_DESTINATION_PREFIX) || destName.startsWith(SIMPConstants.TEMPORARY_PUBSUB_DESTINATION_PREFIX))<NEW_LINE>text = "INBOUND_MESSAGE_RECEIVED_TEMP_CWSJU0120";<NEW_LINE>}<NEW_LINE>String apiMsgId = null;<NEW_LINE>String correlationId = null;<NEW_LINE>if (msg instanceof JsApiMessage) {<NEW_LINE>apiMsgId = ((JsApiMessage) msg).getApiMessageId();<NEW_LINE>correlationId = ((JsApiMessage) msg).getCorrelationId();<NEW_LINE>} else {<NEW_LINE>if (msg.getApiMessageIdAsBytes() != null)<NEW_LINE>apiMsgId = new <MASK><NEW_LINE>if (msg.getCorrelationIdAsBytes() != null)<NEW_LINE>correlationId = new String(msg.getCorrelationIdAsBytes());<NEW_LINE>}<NEW_LINE>SibTr.debug(UserTrace.tc_mt, nls_mt.getFormattedMessage(text, new Object[] { apiMsgId, msg.getSystemMessageId(), correlationId, msg.getSystemMessageSourceUuid(), destName }, null));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.exit(tc, "traceApiMessage");<NEW_LINE>} | String(msg.getApiMessageIdAsBytes()); |
1,580,981 | public static void writeFieldStats(StreamOutput out, ObjectObjectHashMap<String, CollectionStatistics> fieldStatistics) throws IOException {<NEW_LINE>out.writeVInt(fieldStatistics.size());<NEW_LINE>for (ObjectObjectCursor<String, CollectionStatistics> c : fieldStatistics) {<NEW_LINE>out.writeString(c.key);<NEW_LINE>CollectionStatistics statistics = c.value;<NEW_LINE>assert statistics.maxDoc() >= 0;<NEW_LINE>out.writeVLong(statistics.maxDoc());<NEW_LINE>if (out.getVersion().onOrAfter(LegacyESVersion.V_7_0_0)) {<NEW_LINE>// stats are always positive numbers<NEW_LINE>out.writeVLong(statistics.docCount());<NEW_LINE>out.writeVLong(statistics.sumTotalTermFreq());<NEW_LINE>out.writeVLong(statistics.sumDocFreq());<NEW_LINE>} else {<NEW_LINE>out.writeVLong(addOne(statistics.docCount()));<NEW_LINE>out.writeVLong(addOne(statistics.sumTotalTermFreq()));<NEW_LINE>out.writeVLong(addOne<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | (statistics.sumDocFreq())); |
1,521,812 | private void levelDataPrint(String symbName) {<NEW_LINE>// Initial room for 8 symbols with same name<NEW_LINE>Vector<SymbolNode> symbolVect = new Vector<>(8);<NEW_LINE>// Collect in Vector symbols all SymbolNodes in the semNodesTable whose name ==<NEW_LINE>// symbName<NEW_LINE>for (Enumeration<ExploreNode> Enum = semNodesTable.elements(); Enum.hasMoreElements(); ) {<NEW_LINE>ExploreNode semNode = Enum.nextElement();<NEW_LINE>if (semNode instanceof SymbolNode && ((SymbolNode) semNode).getName() == UniqueString.uniqueStringOf(symbName)) {<NEW_LINE>symbolVect.addElement((SymbolNode) semNode);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Print them all<NEW_LINE>for (int i = 0; i < symbolVect.size(); i++) {<NEW_LINE>SymbolNode sym = (SymbolNode) (symbolVect.elementAt(i));<NEW_LINE>if (sym instanceof OpDefOrDeclNode) {<NEW_LINE>if (((OpDefOrDeclNode) sym).getOriginallyDefinedInModuleNode() != null) {<NEW_LINE>System.out.print("Module: " + ((OpDefOrDeclNode) sym).getOriginallyDefinedInModuleNode().getName() + "\n");<NEW_LINE>} else {<NEW_LINE>System.out.<MASK><NEW_LINE>}<NEW_LINE>} else if (sym instanceof FormalParamNode) {<NEW_LINE>System.out.print("Module: " + ((FormalParamNode) sym).getModuleNode().getName() + "\n");<NEW_LINE>}<NEW_LINE>System.out.println(((ExploreNode) (sym)).levelDataToString());<NEW_LINE>System.out.println();<NEW_LINE>}<NEW_LINE>} | print("Module: " + "null" + "\n"); |
679,936 | private Mono<Response<Void>> deleteWithResponseAsync(String resourceGroupName, String automationAccountName) {<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 (automationAccountName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter automationAccountName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String apiVersion = "2019-06-01";<NEW_LINE>final String accept = "application/json";<NEW_LINE>return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, automationAccountName, this.client.getSubscriptionId(), apiVersion, 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.")); |
181,981 | public T visitObjectKeyValue(ObjectKeyValueContext ctx) {<NEW_LINE>TerminalNode fieldKeyTerm = ctx.STRING();<NEW_LINE>String fieldKey = fixString(fieldKeyTerm);<NEW_LINE>StringToken fieldKeyToken = code(new StringToken(fieldKey), fieldKeyTerm);<NEW_LINE>//<NEW_LINE>ObjectVariable objectVariable = (ObjectVariable) this.instStack.peek();<NEW_LINE>AnyObjectContext polymericObject = ctx.anyObject();<NEW_LINE>if (polymericObject != null) {<NEW_LINE>polymericObject.accept(this);<NEW_LINE>Variable valueExp = (Variable) this.instStack.pop();<NEW_LINE>objectVariable.addField(fieldKeyToken, valueExp);<NEW_LINE>} else {<NEW_LINE>EnterRouteVariable enterRoute = code(new EnterRouteVariable(RouteType<MASK><NEW_LINE>NameRouteVariable nameRoute = code(new NameRouteVariable(enterRoute, fieldKeyToken), fieldKeyTerm);<NEW_LINE>objectVariable.addField(fieldKeyToken, nameRoute);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | .Expr, null), fieldKeyTerm); |
1,613,643 | private void onSolution(Solver solver, XCSPParser parser) {<NEW_LINE>output.setLength(0);<NEW_LINE>output.append(parser.printSolution(!flatten));<NEW_LINE>if (solver.getObjectiveManager().isOptimization()) {<NEW_LINE>if (level.isLoggable(Level.COMPET) || level.is(Level.RESANA)) {<NEW_LINE>solver.log().printf(java.util.Locale.US, "o %d %.1f\n", solver.getObjectiveManager().getBestSolutionValue().intValue(<MASK><NEW_LINE>}<NEW_LINE>if (level.is(Level.JSON)) {<NEW_LINE>solver.log().printf(Locale.US, "%s{\"bound\":%d,\"time\":%.1f}", solver.getSolutionCount() > 1 ? "," : "", solver.getObjectiveManager().getBestSolutionValue().intValue(), solver.getTimeCount());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (level.isLoggable(Level.COMPET)) {<NEW_LINE>solver.log().println(output.toString());<NEW_LINE>}<NEW_LINE>if (level.is(Level.JSON)) {<NEW_LINE>solver.log().printf("{\"time\":%.1f},", solver.getTimeCount());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (level.isLoggable(Level.INFO)) {<NEW_LINE>solver.log().white().printf("%s %n", solver.getMeasures().toOneLineString());<NEW_LINE>}<NEW_LINE>if (cs) {<NEW_LINE>try {<NEW_LINE>new SolutionChecker(true, instance, new ByteArrayInputStream(output.toString().getBytes()));<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new RuntimeException("wrong solution found twice");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ), solver.getTimeCount()); |
921,730 | public com.amazonaws.services.opsworks.model.ValidationException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.opsworks.model.ValidationException validationException = new com.amazonaws.services.opsworks.model.ValidationException(null);<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>} 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 validationException;<NEW_LINE>} | String currentParentElement = context.getCurrentParentElement(); |
175,493 | private Collection<? extends String> considerImageCache(PrimaryStorageAllocationSpec spec, List<LocalStorageHostRefVO> candidateHosts) {<NEW_LINE>List<String> ret = new ArrayList<>();<NEW_LINE>String sql = "select i.actualSize from ImageVO i where i.uuid = :uuid";<NEW_LINE>TypedQuery<Long> sq = dbf.getEntityManager().<MASK><NEW_LINE>sq.setParameter("uuid", spec.getImageUuid());<NEW_LINE>long imageActualSize = sq.getSingleResult();<NEW_LINE>for (LocalStorageHostRefVO ref : candidateHosts) {<NEW_LINE>sql = "select count(i) from ImageCacheVO i where i.installUrl like :mark and i.primaryStorageUuid in (:psUuids)";<NEW_LINE>TypedQuery<Long> iq = dbf.getEntityManager().createQuery(sql, Long.class);<NEW_LINE>iq.setParameter("psUuids", ref.getPrimaryStorageUuid());<NEW_LINE>iq.setParameter("mark", String.format("%%hostUuid://%s%%", ref.getHostUuid()));<NEW_LINE>iq.setMaxResults(1);<NEW_LINE>long count = iq.getSingleResult();<NEW_LINE>if (count > 0) {<NEW_LINE>// the host has the image in cache<NEW_LINE>ret.add(ref.getPrimaryStorageUuid());<NEW_LINE>} else {<NEW_LINE>// the host doesn't has the image in cache<NEW_LINE>// we need to add the image size;<NEW_LINE>if (spec.isNoOverProvisioning()) {<NEW_LINE>if (ref.getAvailableCapacity() > spec.getSize() + imageActualSize) {<NEW_LINE>ret.add(ref.getPrimaryStorageUuid());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (ref.getAvailableCapacity() > ratioMgr.calculateByRatio(ref.getPrimaryStorageUuid(), spec.getSize()) + imageActualSize) {<NEW_LINE>ret.add(ref.getPrimaryStorageUuid());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return ret;<NEW_LINE>} | createQuery(sql, Long.class); |
724,986 | public com.amazonaws.services.workspaces.model.ResourceCreationFailedException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.workspaces.model.ResourceCreationFailedException resourceCreationFailedException = new com.amazonaws.services.workspaces.model.ResourceCreationFailedException(null);<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>} 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 resourceCreationFailedException;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
226,715 | public void handle(GameEvent event) {<NEW_LINE>DebugCommandEvent e = (DebugCommandEvent) event;<NEW_LINE>if (e.getName().equals("chargeShield")) {<NEW_LINE>GameObject cubot = GameServer.INSTANCE.getGameUniverse().getObject<MASK><NEW_LINE>if (cubot != null) {<NEW_LINE>if (cubot instanceof Cubot) {<NEW_LINE>String hp = ((Cubot) cubot).getHp() + "/" + ((Cubot) cubot).getMaxHp();<NEW_LINE>int oldShield = ((Cubot) cubot).getShield();<NEW_LINE>((Cubot) cubot).chargeShield(e.getInt("amount"));<NEW_LINE>e.reply("Success: " + hp + " (" + oldShield + ") -> " + hp + "(" + ((Cubot) cubot).getShield() + ")");<NEW_LINE>} else {<NEW_LINE>e.reply("Object is not a Cubot");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>e.reply("Object not found: " + e.getLong("objectId"));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | (e.getObjectId("objectId")); |
283,504 | public void onPrepareBufferImage(Canvas canvas, RotatedTileBox tileBox, DrawSettings settings) {<NEW_LINE>if (tileBox.getZoom() >= startZoom) {<NEW_LINE>OsmandApplication app = getApplication();<NEW_LINE>float textScale = getTextScale();<NEW_LINE>float iconSize = getIconSize(app);<NEW_LINE>QuadTree<QuadRect> boundIntersections = initBoundIntersections(tileBox);<NEW_LINE>DataTileManager<Recording> recs = plugin.getRecordings();<NEW_LINE>final QuadRect latlon = tileBox.getLatLonBounds();<NEW_LINE>List<Recording> objects = recs.getObjects(latlon.top, latlon.left, latlon.bottom, latlon.right);<NEW_LINE>List<Recording> fullObjects = new ArrayList<>();<NEW_LINE>List<LatLon> fullObjectsLatLon = new ArrayList<>();<NEW_LINE>List<LatLon> smallObjectsLatLon = new ArrayList<>();<NEW_LINE>for (Recording o : objects) {<NEW_LINE>if (o != contextMenuLayer.getMoveableObject()) {<NEW_LINE>float x = tileBox.getPixXFromLatLon(o.getLatitude(<MASK><NEW_LINE>float y = tileBox.getPixYFromLatLon(o.getLatitude(), o.getLongitude());<NEW_LINE>if (intersects(boundIntersections, x, y, iconSize, iconSize)) {<NEW_LINE>PointImageDrawable pointImageDrawable = PointImageDrawable.getOrCreate(ctx, ContextCompat.getColor(ctx, R.color.audio_video_icon_color), true);<NEW_LINE>pointImageDrawable.setAlpha(0.8f);<NEW_LINE>pointImageDrawable.drawSmallPoint(canvas, x, y, textScale);<NEW_LINE>smallObjectsLatLon.add(new LatLon(o.getLatitude(), o.getLongitude()));<NEW_LINE>} else {<NEW_LINE>fullObjects.add(o);<NEW_LINE>fullObjectsLatLon.add(new LatLon(o.getLatitude(), o.getLongitude()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (Recording o : fullObjects) {<NEW_LINE>float x = tileBox.getPixXFromLatLon(o.getLatitude(), o.getLongitude());<NEW_LINE>float y = tileBox.getPixYFromLatLon(o.getLatitude(), o.getLongitude());<NEW_LINE>drawRecording(canvas, o, x, y, textScale);<NEW_LINE>}<NEW_LINE>this.fullObjectsLatLon = fullObjectsLatLon;<NEW_LINE>this.smallObjectsLatLon = smallObjectsLatLon;<NEW_LINE>}<NEW_LINE>} | ), o.getLongitude()); |
1,512,117 | protected Map<String, ParameterDescription<?>> computeParameters() {<NEW_LINE>HashMap<String, ParameterDescription<?>> map = new HashMap<String, ParameterDescription<?>>();<NEW_LINE>ParameterDescription<String> address = ParameterDescription.create(String.class, "Address", true, "", "Address", "function address");<NEW_LINE>ParameterDescription<String> onEnter = ParameterDescription.create(String.class, "OnEnter", true, "", "onEnter file", "JS file with onEnter implemenation");<NEW_LINE>ParameterDescription<String> onLeave = ParameterDescription.create(String.class, "OnLeave", true, "", "onLeave file", "JS file with onLeave implemenation");<NEW_LINE>ParameterDescription<String> name = ParameterDescription.create(String.class, "Name", false, "intercept", "name", "name for future unload");<NEW_LINE>ParameterDescription<String> script = ParameterDescription.create(String.class, "Script", false, "", "script", "script to execute on result");<NEW_LINE>map.put("Address", address);<NEW_LINE>map.put("OnEnter", onEnter);<NEW_LINE>map.put("OnLeave", onLeave);<NEW_LINE><MASK><NEW_LINE>map.put("Script", script);<NEW_LINE>return map;<NEW_LINE>} | map.put("Name", name); |
277,520 | private static List<LogEntry> logEntry(ILoggingEvent event, String message, org.slf4j.event.Level level, LogEntry logEntry) {<NEW_LINE>Iterable<String> split;<NEW_LINE>if (message == null) {<NEW_LINE>return new ArrayList<>();<NEW_LINE>}<NEW_LINE>if (message.length() > MAX_MESSAGE_LENGTH) {<NEW_LINE>split = Splitter.fixedLength<MASK><NEW_LINE>} else {<NEW_LINE>split = Collections.singletonList(message);<NEW_LINE>}<NEW_LINE>List<LogEntry> result = new ArrayList<>();<NEW_LINE>long i = 0;<NEW_LINE>for (String s : split) {<NEW_LINE>result.add(LogEntry.builder().namespace(logEntry.getNamespace()).flowId(logEntry.getFlowId()).taskId(logEntry.getTaskId()).executionId(logEntry.getExecutionId()).taskRunId(logEntry.getTaskRunId()).attemptNumber(logEntry.getAttemptNumber()).triggerId(logEntry.getTriggerId()).level(level != null ? level : org.slf4j.event.Level.valueOf(event.getLevel().toString())).message(s).timestamp(Instant.ofEpochMilli(event.getTimeStamp()).plusMillis(i)).thread(event.getThreadName()).build());<NEW_LINE>i++;<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | (MAX_MESSAGE_LENGTH).split(message); |
1,585,469 | public void testInvocationContextGetConstructor() throws Exception {<NEW_LINE>svLogger.info("Default getConstructor Test");<NEW_LINE>AroundConstructInterceptor.setTestType(TestType.GETCONSTRUCT);<NEW_LINE>AroundConstructManagedBean lookupMB = (AroundConstructManagedBean) new InitialContext().lookup(managedBeanLookup);<NEW_LINE>assertEquals("lookup() AroundConstruct called wrong number of times", 1, lookupMB.getAroundConstructCount());<NEW_LINE>svLogger.info("Param getConstructor Test");<NEW_LINE>ParamAroundConstructInterceptor.setTestType(ParamTestType.GETCONSTRUCT);<NEW_LINE>ParamAroundConstructManagedBean lookupPACMB = (ParamAroundConstructManagedBean) new InitialContext().lookup(paramBeanLookup);<NEW_LINE>assertTrue("Param AroundConstruct not called", lookupPACMB.verifyAroundConstructCalled());<NEW_LINE>// test getConstructor returns null in all other interceptor methods<NEW_LINE>// @PostConstruct<NEW_LINE>svLogger.info("PostConstruct Test");<NEW_LINE>AroundConstructInterceptor.setTestType(TestType.POSTCONSTRUCT);<NEW_LINE>AroundConstructManagedBean postConstructMB = (AroundConstructManagedBean) new InitialContext().lookup(managedBeanLookup);<NEW_LINE>assertEquals("postConstruct called wrong number of times", <MASK><NEW_LINE>// @PreDestroy<NEW_LINE>svLogger.info("PreDestroy Test");<NEW_LINE>AroundConstructInterceptor.setTestType(TestType.PREDESTROY);<NEW_LINE>invokePreDestroy();<NEW_LINE>assertTrue("PreDestroy not called", AroundConstructManagedBean.verifyPreDestroyCalled());<NEW_LINE>// @AroundInvoke<NEW_LINE>svLogger.info("AroundInvoke Test");<NEW_LINE>AroundConstructInterceptor.setTestType(TestType.AROUNDINVOKE);<NEW_LINE>assertEquals("AroundInvoke called wrong number of times", 1, lookupMB.getBusinessMethodCount());<NEW_LINE>} | 1, postConstructMB.getPostConstructCount()); |
556,386 | public void prepareLocalIndexData() {<NEW_LINE>if (repartitionPrepareData == null) {<NEW_LINE>repartitionPrepareData = new RepartitionPrepareData();<NEW_LINE>}<NEW_LINE>Map<String, List<String>> localIndexes = new HashMap<>();<NEW_LINE>repartitionPrepareData.setLocalIndexes(localIndexes);<NEW_LINE>final GsiMetaManager.GsiMetaBean gsiMetaBean = OptimizerContext.getContext(schemaName).getLatestSchemaManager().getGsi(tableName, IndexStatus.ALL);<NEW_LINE>GsiMetaManager.GsiTableMetaBean tableMeta = gsiMetaBean.getTableMeta().get(tableName);<NEW_LINE>if (tableMeta == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (Map.Entry<String, GsiMetaManager.GsiIndexMetaBean> indexEntry : tableMeta.indexMap.entrySet()) {<NEW_LINE>final String indexName = indexEntry.getKey();<NEW_LINE>final GsiMetaManager.GsiIndexMetaBean indexDetail = indexEntry.getValue();<NEW_LINE>List<String> <MASK><NEW_LINE>if (indexDetail.indexStatus != IndexStatus.PUBLIC) {<NEW_LINE>throw new TddlRuntimeException(ErrorCode.ERR_REPARTITION_TABLE_WITH_GSI, "can not alter table repartition when gsi table is not public");<NEW_LINE>}<NEW_LINE>for (GsiMetaManager.GsiIndexColumnMetaBean indexColumn : indexDetail.indexColumns) {<NEW_LINE>localIndex.add(SqlIdentifier.surroundWithBacktick(indexColumn.columnName));<NEW_LINE>}<NEW_LINE>localIndexes.put(TddlConstants.AUTO_LOCAL_INDEX_PREFIX + indexName, localIndex);<NEW_LINE>}<NEW_LINE>} | localIndex = new ArrayList<>(); |
488,139 | public void paintIcon(Component c, Graphics g2, int x, int y) {<NEW_LINE>if (!(c instanceof JMenuItem)) {<NEW_LINE>fallbackIcon.paintIcon(c, g2, x, y);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Graphics2D g = (Graphics2D) g2.create();<NEW_LINE>;<NEW_LINE>g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);<NEW_LINE>g.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_DEFAULT);<NEW_LINE>g.translate(x + 2, y + 2);<NEW_LINE>final int sz = SIZE;<NEW_LINE>g.setColor(c.getForeground());<NEW_LINE>if (c == null || ((JMenuItem) c).isSelected()) {<NEW_LINE>g.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_PURE);<NEW_LINE>g.setStroke(new BasicStroke(2.0f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND));<NEW_LINE>g.drawLine(4, 7, 7, 10);<NEW_LINE>g.drawLine(<MASK><NEW_LINE>g.drawLine(4, 5, 7, 8);<NEW_LINE>g.drawLine(7, 8, sz, 0);<NEW_LINE>} else {<NEW_LINE>g.drawRoundRect(0, 0, sz, sz - 1, 4, 4);<NEW_LINE>g.drawRoundRect(0, 0, sz, sz - 1, 4, 4);<NEW_LINE>}<NEW_LINE>g.dispose();<NEW_LINE>} | 7, 10, sz, 2); |
1,640,763 | public boolean isHistoryEnabledForActivity(String processDefinitionId, String activityId) {<NEW_LINE><MASK><NEW_LINE>if (isEnableProcessDefinitionHistoryLevel() && processDefinitionId != null) {<NEW_LINE>HistoryLevel processDefinitionLevel = getProcessDefinitionHistoryLevel(processDefinitionId);<NEW_LINE>if (processDefinitionLevel != null) {<NEW_LINE>if (LOGGER.isDebugEnabled()) {<NEW_LINE>LOGGER.debug("Current history level: {}, level required: {}", processDefinitionLevel, HistoryLevel.ACTIVITY);<NEW_LINE>}<NEW_LINE>if (processDefinitionLevel.isAtLeast(HistoryLevel.ACTIVITY)) {<NEW_LINE>return true;<NEW_LINE>} else if (!HistoryLevel.NONE.equals(processDefinitionLevel) && StringUtils.isNotEmpty(activityId)) {<NEW_LINE>return includeFlowElementInHistory(processDefinitionId, activityId);<NEW_LINE>} else {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (LOGGER.isDebugEnabled()) {<NEW_LINE>LOGGER.debug("Current history level: {}, level required: {}", engineHistoryLevel, HistoryLevel.ACTIVITY);<NEW_LINE>}<NEW_LINE>return engineHistoryLevel.isAtLeast(HistoryLevel.ACTIVITY);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (LOGGER.isDebugEnabled()) {<NEW_LINE>LOGGER.debug("Current history level: {}, level required: {}", engineHistoryLevel, HistoryLevel.ACTIVITY);<NEW_LINE>}<NEW_LINE>if (engineHistoryLevel.isAtLeast(HistoryLevel.ACTIVITY)) {<NEW_LINE>return true;<NEW_LINE>} else if (!HistoryLevel.NONE.equals(engineHistoryLevel) && StringUtils.isNotEmpty(activityId)) {<NEW_LINE>return includeFlowElementInHistory(processDefinitionId, activityId);<NEW_LINE>} else {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | HistoryLevel engineHistoryLevel = processEngineConfiguration.getHistoryLevel(); |
445,859 | boolean bind() {<NEW_LINE>if (TextUtils.isEmpty(mPkgName)) {<NEW_LINE>Intent intent = new Intent(Utils.getApp(), ServerService.class);<NEW_LINE>return Utils.getApp().bindService(intent, mConn, Context.BIND_AUTO_CREATE);<NEW_LINE>}<NEW_LINE>if (UtilsBridge.isAppInstalled(mPkgName)) {<NEW_LINE>if (UtilsBridge.isAppRunning(mPkgName)) {<NEW_LINE>Intent intent <MASK><NEW_LINE>intent.setPackage(mPkgName);<NEW_LINE>return Utils.getApp().bindService(intent, mConn, Context.BIND_AUTO_CREATE);<NEW_LINE>} else {<NEW_LINE>Log.e("MessengerUtils", "bind: the app is not running -> " + mPkgName);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>Log.e("MessengerUtils", "bind: the app is not installed -> " + mPkgName);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} | = new Intent(mPkgName + ".messenger"); |
896,006 | private List<Match> findAnyCollect(List<Object> pList) {<NEW_LINE>List<Match> mList = new ArrayList<Match>();<NEW_LINE>if (pList == null) {<NEW_LINE>return mList;<NEW_LINE>}<NEW_LINE>Match[] mArray = new Match[pList.size()];<NEW_LINE>SubFindRun[] theSubs = new SubFindRun[pList.size()];<NEW_LINE>int nobj = 0;<NEW_LINE>ScreenImage base = getScreen().capture(this);<NEW_LINE>for (Object obj : pList) {<NEW_LINE>mArray[nobj] = null;<NEW_LINE>if (obj instanceof Pattern || obj instanceof String || obj instanceof Image) {<NEW_LINE>theSubs[nobj] = new SubFindRun(mArray, nobj, base, obj, this);<NEW_LINE>new Thread(theSubs<MASK><NEW_LINE>}<NEW_LINE>nobj++;<NEW_LINE>}<NEW_LINE>Debug.log(lvl, "findAnyCollect: waiting for SubFindRuns");<NEW_LINE>nobj = 0;<NEW_LINE>boolean all = false;<NEW_LINE>while (!all) {<NEW_LINE>all = true;<NEW_LINE>for (SubFindRun sub : theSubs) {<NEW_LINE>all &= sub.hasFinished();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Debug.log(lvl, "findAnyCollect: SubFindRuns finished");<NEW_LINE>nobj = 0;<NEW_LINE>for (Match match : mArray) {<NEW_LINE>if (match != null) {<NEW_LINE>match.setIndex(nobj);<NEW_LINE>mList.add(match);<NEW_LINE>} else {<NEW_LINE>}<NEW_LINE>nobj++;<NEW_LINE>}<NEW_LINE>return mList;<NEW_LINE>} | [nobj]).start(); |
1,843,805 | final ListApiDestinationsResult executeListApiDestinations(ListApiDestinationsRequest listApiDestinationsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listApiDestinationsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListApiDestinationsRequest> request = null;<NEW_LINE>Response<ListApiDestinationsResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new ListApiDestinationsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listApiDestinationsRequest));<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, "EventBridge");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListApiDestinations");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListApiDestinationsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListApiDestinationsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.RequestMarshallTime); |
185,346 | public static DescribeContactGroupsResponse unmarshall(DescribeContactGroupsResponse describeContactGroupsResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeContactGroupsResponse.setRequestId(_ctx.stringValue("DescribeContactGroupsResponse.RequestId"));<NEW_LINE>describeContactGroupsResponse.setSuccess(_ctx.booleanValue("DescribeContactGroupsResponse.Success"));<NEW_LINE>describeContactGroupsResponse.setCode(_ctx.stringValue("DescribeContactGroupsResponse.Code"));<NEW_LINE>describeContactGroupsResponse.setMessage(_ctx.stringValue("DescribeContactGroupsResponse.Message"));<NEW_LINE>describeContactGroupsResponse.setTotalCount(_ctx.integerValue("DescribeContactGroupsResponse.TotalCount"));<NEW_LINE>describeContactGroupsResponse.setPageSize(_ctx.integerValue("DescribeContactGroupsResponse.PageSize"));<NEW_LINE>describeContactGroupsResponse.setPageNumber(_ctx.integerValue("DescribeContactGroupsResponse.PageNumber"));<NEW_LINE>List<ContactGroup> contactGroups = new ArrayList<ContactGroup>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeContactGroupsResponse.ContactGroups.Length"); i++) {<NEW_LINE>ContactGroup contactGroup = new ContactGroup();<NEW_LINE>contactGroup.setContactGroupId(_ctx.stringValue("DescribeContactGroupsResponse.ContactGroups[" + i + "].ContactGroupId"));<NEW_LINE>contactGroup.setDisplayName(_ctx.stringValue("DescribeContactGroupsResponse.ContactGroups[" + i + "].DisplayName"));<NEW_LINE>List<Contact> contacts = new ArrayList<Contact>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeContactGroupsResponse.ContactGroups[" + i + "].Contacts.Length"); j++) {<NEW_LINE>Contact contact = new Contact();<NEW_LINE>contact.setContactId(_ctx.stringValue("DescribeContactGroupsResponse.ContactGroups[" + i <MASK><NEW_LINE>contact.setName(_ctx.stringValue("DescribeContactGroupsResponse.ContactGroups[" + i + "].Contacts[" + j + "].Name"));<NEW_LINE>contact.setEmail(_ctx.stringValue("DescribeContactGroupsResponse.ContactGroups[" + i + "].Contacts[" + j + "].Email"));<NEW_LINE>contact.setMobile(_ctx.stringValue("DescribeContactGroupsResponse.ContactGroups[" + i + "].Contacts[" + j + "].Mobile"));<NEW_LINE>contact.setDescription(_ctx.stringValue("DescribeContactGroupsResponse.ContactGroups[" + i + "].Contacts[" + j + "].Description"));<NEW_LINE>contacts.add(contact);<NEW_LINE>}<NEW_LINE>contactGroup.setContacts(contacts);<NEW_LINE>contactGroups.add(contactGroup);<NEW_LINE>}<NEW_LINE>describeContactGroupsResponse.setContactGroups(contactGroups);<NEW_LINE>return describeContactGroupsResponse;<NEW_LINE>} | + "].Contacts[" + j + "].ContactId")); |
830,598 | public Mono<ActionCollectionDTO> update(String id, ActionCollectionDTO actionCollectionDTO) {<NEW_LINE>if (id == null) {<NEW_LINE>return Mono.error(new AppsmithException(AppsmithError.INVALID_PARAMETER, FieldName.ID));<NEW_LINE>}<NEW_LINE>Mono<ActionCollection> actionCollectionMono = repository.findById(id, MANAGE_ACTIONS).switchIfEmpty(Mono.error(new AppsmithException(AppsmithError.ACL_NO_RESOURCE_FOUND, FieldName.ACTION_COLLECTION, <MASK><NEW_LINE>return actionCollectionMono.map(dbActionCollection -> {<NEW_LINE>copyNewFieldValuesIntoOldObject(actionCollectionDTO, dbActionCollection.getUnpublishedCollection());<NEW_LINE>return dbActionCollection;<NEW_LINE>}).flatMap(actionCollection -> this.update(id, actionCollection)).flatMap(actionCollection -> this.generateActionCollectionByViewMode(actionCollection, false).flatMap(actionCollectionDTO1 -> this.populateActionCollectionByViewMode(actionCollection.getUnpublishedCollection(), false)));<NEW_LINE>} | id))).cache(); |
973,760 | // WorkbenchPane overrides -------------------------------------------------<NEW_LINE>@Override<NEW_LINE>protected Toolbar createMainToolbar() {<NEW_LINE>Toolbar toolbar = new <MASK><NEW_LINE>toolbar.addLeftWidget(commands_.loadWorkspace().createToolbarButton());<NEW_LINE>toolbar.addLeftWidget(commands_.saveWorkspace().createToolbarButton());<NEW_LINE>toolbar.addLeftSeparator();<NEW_LINE>toolbar.addLeftWidget(createImportMenu());<NEW_LINE>toolbar.addLeftSeparator();<NEW_LINE>memUsage_ = new MemUsageWidget(session_.getSessionInfo().getMemoryUsage(), prefs_);<NEW_LINE>toolbar.addLeftWidget(memUsage_);<NEW_LINE>toolbar.addLeftSeparator();<NEW_LINE>toolbar.addLeftWidget(commands_.clearWorkspace().createToolbarButton());<NEW_LINE>ToolbarPopupMenu menu = new ToolbarPopupMenu();<NEW_LINE>menu.addItem(createViewMenuItem(EnvironmentObjects.OBJECT_LIST_VIEW));<NEW_LINE>menu.addItem(createViewMenuItem(EnvironmentObjects.OBJECT_GRID_VIEW));<NEW_LINE>viewButton_ = new ToolbarMenuButton(nameOfViewType(EnvironmentObjects.OBJECT_LIST_VIEW), ToolbarButton.NoTitle, imageOfViewType(EnvironmentObjects.OBJECT_LIST_VIEW), menu);<NEW_LINE>ElementIds.assignElementId(viewButton_, ElementIds.MB_OBJECT_LIST_VIEW);<NEW_LINE>toolbar.addRightWidget(viewButton_);<NEW_LINE>toolbar.addRightSeparator();<NEW_LINE>refreshButton_ = commands_.refreshEnvironment().createToolbarButton();<NEW_LINE>refreshButton_.addStyleName(ThemeStyles.INSTANCE.refreshToolbarButton());<NEW_LINE>toolbar.addRightWidget(refreshButton_);<NEW_LINE>ToolbarPopupMenu refreshMenu = new ToolbarPopupMenu();<NEW_LINE>refreshMenu.addItem(new EnvironmentMonitoringMenuItem(true));<NEW_LINE>refreshMenu.addItem(new EnvironmentMonitoringMenuItem(false));<NEW_LINE>refreshMenu.addSeparator();<NEW_LINE>refreshMenu.addItem(new // as HTML<NEW_LINE>MenuItem(// as HTML<NEW_LINE>AppCommand.formatMenuLabel(null, constants_.refreshNow(), null), true, () -> commands_.refreshEnvironment().execute()));<NEW_LINE>ToolbarMenuButton refreshMenuBtn = new ToolbarMenuButton(ToolbarButton.NoText, constants_.refreshOptions(), refreshMenu, false);<NEW_LINE>ElementIds.assignElementId(refreshMenuBtn, ElementIds.MB_REFRESH_OPTS);<NEW_LINE>toolbar.addRightWidget(refreshMenuBtn);<NEW_LINE>return toolbar;<NEW_LINE>} | Toolbar(constants_.environmentTab()); |
1,226,678 | void showLogcatMessages() {<NEW_LINE>CheckBox chkLocationsOnly = (CheckBox) rootView.findViewById(R.id.logview_chkLocationsOnly);<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>for (ILoggingEvent message : SessionLogcatAppender.Statuses) {<NEW_LINE>if (message.getMarker() == SessionLogcatAppender.MARKER_LOCATION) {<NEW_LINE>sb.append(getFormattedMessage(message.getMessage(), R.color.accentColorComplementary, message.getTimeStamp(), true));<NEW_LINE>} else if (!chkLocationsOnly.isChecked()) {<NEW_LINE>if (message.getLevel() == Level.ERROR) {<NEW_LINE>sb.append(getFormattedMessage(message.getMessage(), R.color.errorColor, message<MASK><NEW_LINE>} else if (message.getLevel() == Level.WARN) {<NEW_LINE>sb.append(getFormattedMessage(message.getMessage(), R.color.warningColor, message.getTimeStamp(), false));<NEW_LINE>} else {<NEW_LINE>sb.append(getFormattedMessage(message.getMessage(), R.color.secondaryColorText, message.getTimeStamp(), false));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>logTextView.setText(Html.fromHtml(sb.toString()));<NEW_LINE>if (doAutomaticScroll) {<NEW_LINE>scrollView.fullScroll(View.FOCUS_DOWN);<NEW_LINE>}<NEW_LINE>} | .getTimeStamp(), false)); |
1,175,007 | private void generateDirectMovement(final DDOrderMoveSchedule schedule) {<NEW_LINE>//<NEW_LINE>// Make sure DD Order is completed<NEW_LINE>final <MASK><NEW_LINE>if (!skipCompletingDDOrder) {<NEW_LINE>final I_DD_Order ddOrder = getDDOrderById(ddOrderId);<NEW_LINE>ddOrderService.completeDDOrderIfNeeded(ddOrder);<NEW_LINE>}<NEW_LINE>schedule.assertNotPickedFrom();<NEW_LINE>schedule.assertNotDroppedTo();<NEW_LINE>final Quantity qtyToMove = schedule.getQtyToPick();<NEW_LINE>final HuId huIdToMove = schedule.getPickFromHUId();<NEW_LINE>final MovementId directMovementId = createDirectMovement(schedule, huIdToMove);<NEW_LINE>schedule.markAsPickedFrom(null, DDOrderMoveSchedulePickedHUs.of(DDOrderMoveSchedulePickedHU.builder().actualHUIdPicked(huIdToMove).qtyPicked(qtyToMove).pickFromMovementId(directMovementId).inTransitLocatorId(null).build()));<NEW_LINE>schedule.markAsDroppedTo(directMovementId);<NEW_LINE>ddOrderMoveScheduleService.save(schedule);<NEW_LINE>} | DDOrderId ddOrderId = schedule.getDdOrderId(); |
248,014 | private void tryUpdateData(String monthUrlString, final String regionUrlString) {<NEW_LINE>GetJsonAsyncTask.OnResponseListener<Protocol.TotalChangesByMonthResponse> onResponseListener = new GetJsonAsyncTask.OnResponseListener<Protocol.TotalChangesByMonthResponse>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onResponse(Protocol.TotalChangesByMonthResponse response) {<NEW_LINE>if (response != null) {<NEW_LINE>if (contributorsTextView != null) {<NEW_LINE>contributorsTextView.setText(String.valueOf(response.users));<NEW_LINE>}<NEW_LINE>if (editsTextView != null) {<NEW_LINE>editsTextView.setText(String.valueOf(response.changes));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>disableProgress();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>GetJsonAsyncTask.OnErrorListener onErrorListener = new GetJsonAsyncTask.OnErrorListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onError(String error) {<NEW_LINE>if (contributorsTextView != null) {<NEW_LINE>contributorsTextView.setText(R.string.data_is_not_available);<NEW_LINE>}<NEW_LINE>if (editsTextView != null) {<NEW_LINE>editsTextView.setText(R.string.data_is_not_available);<NEW_LINE>}<NEW_LINE>disableProgress();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>enableProgress();<NEW_LINE>GetJsonAsyncTask<Protocol.TotalChangesByMonthResponse> totalChangesByMontAsyncTask = new GetJsonAsyncTask<>(Protocol.TotalChangesByMonthResponse.class);<NEW_LINE>totalChangesByMontAsyncTask.setOnResponseListener(onResponseListener);<NEW_LINE>totalChangesByMontAsyncTask.setOnErrorListener(onErrorListener);<NEW_LINE>String finalUrl = String.format(TOTAL_CHANGES_BY_MONTH_URL_PATTERN, monthUrlString, regionUrlString);<NEW_LINE>totalChangesByMontAsyncTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, finalUrl);<NEW_LINE>GetJsonAsyncTask<Protocol.RecipientsByMonth> recChangesByMontAsyncTask = new GetJsonAsyncTask<>(Protocol.RecipientsByMonth.class);<NEW_LINE>GetJsonAsyncTask.OnResponseListener<Protocol.RecipientsByMonth> recResponseListener = new GetJsonAsyncTask.OnResponseListener<Protocol.RecipientsByMonth>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onResponse(Protocol.RecipientsByMonth response) {<NEW_LINE>if (response != null) {<NEW_LINE>if (recipientsTextView != null) {<NEW_LINE>recipientsTextView.setText(String.valueOf(response.regionCount));<NEW_LINE>}<NEW_LINE>if (donationsTextView != null) {<NEW_LINE>donationsTextView.setText(String.format("%.3f", response<MASK><NEW_LINE>}<NEW_LINE>if (donationsTotalLayout != null && donationsTotalTextView != null) {<NEW_LINE>donationsTotalLayout.setVisibility(regionUrlString.isEmpty() ? View.VISIBLE : View.GONE);<NEW_LINE>donationsTotalTextView.setText(String.format("%.3f", response.btc * 1000f) + " mBTC");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>disableProgress();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>recChangesByMontAsyncTask.setOnResponseListener(recResponseListener);<NEW_LINE>clearTextViewResult(recipientsTextView);<NEW_LINE>clearTextViewResult(donationsTextView);<NEW_LINE>clearTextViewResult(donationsTotalTextView);<NEW_LINE>String recfinalUrl = String.format(RECIPIENTS_BY_MONTH, monthUrlString, regionUrlString);<NEW_LINE>recChangesByMontAsyncTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, recfinalUrl);<NEW_LINE>} | .regionBtc * 1000f) + " mBTC"); |
1,222,024 | public void requestPermissions(String[] permissions) {<NEW_LINE>if (component.isService()) {<NEW_LINE>// https://developer.android.com/training/articles/wear-permissions.html<NEW_LINE>// Inspired by PermissionHelper.java from Michael von Glasow:<NEW_LINE>// https://github.com/mvglasow/satstat/blob/master/src/com/vonglasow/michael/satstat/utils/PermissionHelper.java<NEW_LINE>// Example of use:<NEW_LINE>// https://github.com/mvglasow/satstat/blob/master/src/com/vonglasow/michael/satstat/PasvLocListenerService.java<NEW_LINE>final ServiceEngine eng = getEngine();<NEW_LINE>if (eng != null) {<NEW_LINE>// A valid service should have a non-null engine at this point, but just in case<NEW_LINE>ResultReceiver resultReceiver = new ResultReceiver(new Handler(Looper.getMainLooper())) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void onReceiveResult(int resultCode, Bundle resultData) {<NEW_LINE>String[] outPermissions = resultData.getStringArray(PermissionRequestor.KEY_PERMISSIONS);<NEW_LINE>int[] grantResults = resultData.getIntArray(PermissionRequestor.KEY_GRANT_RESULTS);<NEW_LINE>eng.onRequestPermissionsResult(resultCode, outPermissions, grantResults);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>final Intent permIntent = new Intent(getContext(), PermissionRequestor.class);<NEW_LINE>permIntent.<MASK><NEW_LINE>permIntent.putExtra(PermissionRequestor.KEY_PERMISSIONS, permissions);<NEW_LINE>permIntent.putExtra(PermissionRequestor.KEY_REQUEST_CODE, REQUEST_PERMISSIONS);<NEW_LINE>// Show the dialog requesting the permissions<NEW_LINE>permIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);<NEW_LINE>startActivity(permIntent);<NEW_LINE>}<NEW_LINE>} else if (activity != null) {<NEW_LINE>// Requesting permissions from user when the app resumes.<NEW_LINE>// Nice example on how to handle user response<NEW_LINE>// http://stackoverflow.com/a/35495855<NEW_LINE>// More on permission in Android 23:<NEW_LINE>// https://inthecheesefactory.com/blog/things-you-need-to-know-about-android-m-permission-developer-edition/en<NEW_LINE>ActivityCompat.requestPermissions(activity, permissions, REQUEST_PERMISSIONS);<NEW_LINE>}<NEW_LINE>} | putExtra(PermissionRequestor.KEY_RESULT_RECEIVER, resultReceiver); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.