idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
77,157
public static GlassFishVersion toValue(@NonNull final String versionStr) {<NEW_LINE>Parameters.notNull("versionStr", versionStr);<NEW_LINE>GlassFishVersion version = stringValuesMap.get(versionStr.toUpperCase(Locale.ENGLISH));<NEW_LINE>if (version == null) {<NEW_LINE>List<Integer> versionNumbers = new ArrayList<>(4);<NEW_LINE>String[] versionParts = versionStr.split("[^0-9.]", 2);<NEW_LINE>String[] versionNumberStrings = versionParts[0].split("\\.");<NEW_LINE>for (int i = 0; i < Math.min(4, versionNumberStrings.length); i++) {<NEW_LINE>try {<NEW_LINE>int value = Integer.parseInt(versionNumberStrings[i]);<NEW_LINE>versionNumbers.add(value);<NEW_LINE>} catch (NumberFormatException ex) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int i = versionNumbers.size(); i < 4; i++) {<NEW_LINE>versionNumbers.add(0);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>for (int i = candidates.length - 1; i >= 0; i--) {<NEW_LINE>if (gfvSmallerOrEqual(candidates[i], versionNumbers)) {<NEW_LINE>version = candidates[i];<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return version;<NEW_LINE>}
GlassFishVersion[] candidates = values();
1,373,511
private void processNestedGenerics(DetailAST ast, int[] line, int after) {<NEW_LINE>// In a nested Generic type, so can only be a '>' or ',' or '&'<NEW_LINE>// In case of several extends definitions:<NEW_LINE>//<NEW_LINE>// class IntEnumValueType<E extends Enum<E> & IntEnum><NEW_LINE>// ^<NEW_LINE>// should be whitespace if followed by & -+<NEW_LINE>//<NEW_LINE>final int indexOfAmp = IntStream.range(after, line.length).filter(index -> line[index] == '&').findFirst().orElse(-1);<NEW_LINE>if (indexOfAmp >= 1 && containsWhitespaceBetween(after, indexOfAmp, line)) {<NEW_LINE>if (indexOfAmp - after == 0) {<NEW_LINE><MASK><NEW_LINE>} else if (indexOfAmp - after != 1) {<NEW_LINE>log(ast, MSG_WS_FOLLOWED, CLOSE_ANGLE_BRACKET);<NEW_LINE>}<NEW_LINE>} else if (line[after] == ' ') {<NEW_LINE>log(ast, MSG_WS_FOLLOWED, CLOSE_ANGLE_BRACKET);<NEW_LINE>}<NEW_LINE>}
log(ast, MSG_WS_NOT_PRECEDED, "&");
916,559
public Object calculate(Context ctx) {<NEW_LINE>Object fo = null;<NEW_LINE>String distribute = null;<NEW_LINE>if (param == null) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("create" + mm.getMessage("function.missingParam"));<NEW_LINE>} else if (param.isLeaf()) {<NEW_LINE>fo = param.getLeafExpression().calculate(ctx);<NEW_LINE>} else {<NEW_LINE>if (param.getType() != IParam.Semicolon) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("create" + mm.getMessage("function.invalidParam"));<NEW_LINE>}<NEW_LINE>int size = param.getSubSize();<NEW_LINE>if (size != 2) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("create" + mm.getMessage("function.invalidParam"));<NEW_LINE>}<NEW_LINE>IParam sub0 = param.getSub(0);<NEW_LINE>if (sub0 != null) {<NEW_LINE>fo = sub0.getLeafExpression().calculate(ctx);<NEW_LINE>} else {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("create" <MASK><NEW_LINE>}<NEW_LINE>IParam expParam = param.getSub(1);<NEW_LINE>if (expParam != null) {<NEW_LINE>distribute = expParam.getLeafExpression().toString();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (fo instanceof FileObject) {<NEW_LINE>File file = ((FileObject) fo).getLocalFile().file();<NEW_LINE>((TableMetaData) table).getGroupTable().reset(file, "n", ctx, distribute);<NEW_LINE>TableMetaData table = GroupTable.openBaseTable(file, ctx);<NEW_LINE>Integer partition = ((FileObject) fo).getPartition();<NEW_LINE>if (partition != null && partition.intValue() > 0) {<NEW_LINE>table.getGroupTable().setPartition(partition);<NEW_LINE>}<NEW_LINE>return table;<NEW_LINE>} else if (fo instanceof FileGroup) {<NEW_LINE>if (distribute == null) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("create" + mm.getMessage("function.paramTypeError"));<NEW_LINE>}<NEW_LINE>FileGroup fg = (FileGroup) fo;<NEW_LINE>int[] partitions = fg.getPartitions();<NEW_LINE>int pcount = fg.getPartitions().length;<NEW_LINE>String fileName = fg.getFileName();<NEW_LINE>for (int i = 0; i < pcount; ++i) {<NEW_LINE>File newFile = Env.getPartitionFile(partitions[i], fileName);<NEW_LINE>((TableMetaData) table).getGroupTable().reset(newFile, "n", ctx, distribute);<NEW_LINE>}<NEW_LINE>return fg.open(null, ctx);<NEW_LINE>} else {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("create" + mm.getMessage("function.paramTypeError"));<NEW_LINE>}<NEW_LINE>}
+ mm.getMessage("function.paramTypeError"));
1,814,710
public void writeMetrics(MetricQueryResults metricQueryResults) throws Exception {<NEW_LINE>final long metricTimestamp = System.currentTimeMillis() / 1000L;<NEW_LINE>Socket socket = new Socket(InetAddress<MASK><NEW_LINE>BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(socket.getOutputStream(), charset));<NEW_LINE>StringBuilder messagePayload = new StringBuilder();<NEW_LINE>Iterable<MetricResult<Long>> counters = metricQueryResults.getCounters();<NEW_LINE>Iterable<MetricResult<GaugeResult>> gauges = metricQueryResults.getGauges();<NEW_LINE>Iterable<MetricResult<DistributionResult>> distributions = metricQueryResults.getDistributions();<NEW_LINE>for (MetricResult<Long> counter : counters) {<NEW_LINE>messagePayload.append(new CounterMetricMessage(counter, "value", metricTimestamp).toString());<NEW_LINE>}<NEW_LINE>for (MetricResult<GaugeResult> gauge : gauges) {<NEW_LINE>messagePayload.append(new GaugeMetricMessage(gauge, "value").toString());<NEW_LINE>}<NEW_LINE>for (MetricResult<DistributionResult> distribution : distributions) {<NEW_LINE>messagePayload.append(new DistributionMetricMessage(distribution, "min", metricTimestamp).toString());<NEW_LINE>messagePayload.append(new DistributionMetricMessage(distribution, "max", metricTimestamp).toString());<NEW_LINE>messagePayload.append(new DistributionMetricMessage(distribution, "count", metricTimestamp).toString());<NEW_LINE>messagePayload.append(new DistributionMetricMessage(distribution, "sum", metricTimestamp).toString());<NEW_LINE>messagePayload.append(new DistributionMetricMessage(distribution, "mean", metricTimestamp).toString());<NEW_LINE>}<NEW_LINE>writer.write(messagePayload.toString());<NEW_LINE>writer.flush();<NEW_LINE>writer.close();<NEW_LINE>socket.close();<NEW_LINE>}
.getByName(address), port);
104,945
private void loadOptionsConfig() throws TemplateModelException {<NEW_LINE>final <MASK><NEW_LINE>final String context = optionService.isEnabledAbsolutePath() ? blogBaseUrl + "/" : "/";<NEW_LINE>configuration.setSharedVariable("options", optionService.listOptions());<NEW_LINE>configuration.setSharedVariable("context", context);<NEW_LINE>configuration.setSharedVariable("version", HaloConst.HALO_VERSION);<NEW_LINE>configuration.setSharedVariable("globalAbsolutePathEnabled", optionService.isEnabledAbsolutePath());<NEW_LINE>configuration.setSharedVariable("blog_title", optionService.getBlogTitle());<NEW_LINE>configuration.setSharedVariable("blog_url", blogBaseUrl);<NEW_LINE>configuration.setSharedVariable("blog_logo", optionService.getByPropertyOrDefault(BlogProperties.BLOG_LOGO, String.class, BlogProperties.BLOG_LOGO.defaultValue()));<NEW_LINE>configuration.setSharedVariable("seo_keywords", optionService.getByPropertyOrDefault(SeoProperties.KEYWORDS, String.class, SeoProperties.KEYWORDS.defaultValue()));<NEW_LINE>configuration.setSharedVariable("seo_description", optionService.getByPropertyOrDefault(SeoProperties.DESCRIPTION, String.class, SeoProperties.DESCRIPTION.defaultValue()));<NEW_LINE>configuration.setSharedVariable("rss_url", blogBaseUrl + "/rss.xml");<NEW_LINE>configuration.setSharedVariable("atom_url", blogBaseUrl + "/atom.xml");<NEW_LINE>configuration.setSharedVariable("sitemap_xml_url", blogBaseUrl + "/sitemap.xml");<NEW_LINE>configuration.setSharedVariable("sitemap_html_url", blogBaseUrl + "/sitemap.html");<NEW_LINE>configuration.setSharedVariable("links_url", context + optionService.getLinksPrefix());<NEW_LINE>configuration.setSharedVariable("photos_url", context + optionService.getPhotosPrefix());<NEW_LINE>configuration.setSharedVariable("journals_url", context + optionService.getJournalsPrefix());<NEW_LINE>configuration.setSharedVariable("archives_url", context + optionService.getArchivesPrefix());<NEW_LINE>configuration.setSharedVariable("categories_url", context + optionService.getCategoriesPrefix());<NEW_LINE>configuration.setSharedVariable("tags_url", context + optionService.getTagsPrefix());<NEW_LINE>log.debug("Loaded options");<NEW_LINE>}
String blogBaseUrl = optionService.getBlogBaseUrl();
730,086
/*<NEW_LINE>* Recursively builds each of the intermediate BDD nodes in the<NEW_LINE>* graphviz DOT format.<NEW_LINE>*/<NEW_LINE>private void dotRec(StringBuilder sb, BDD bdd, Set<BDD> visited) {<NEW_LINE>if (bdd.isOne() || bdd.isZero() || visited.contains(bdd)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int val = dotId(bdd);<NEW_LINE>int valLow = dotId(bdd.low());<NEW_LINE>int valHigh = dotId(bdd.high());<NEW_LINE>String name = _bitNames.get(bdd.var());<NEW_LINE>sb.append(val).append(" [label=\"").append(name).append("\"]\n");<NEW_LINE>sb.append(val).append(" -> ").append<MASK><NEW_LINE>sb.append(val).append(" -> ").append(valHigh).append("[style=filled]\n");<NEW_LINE>visited.add(bdd);<NEW_LINE>dotRec(sb, bdd.low(), visited);<NEW_LINE>dotRec(sb, bdd.high(), visited);<NEW_LINE>}
(valLow).append("[style=dotted]\n");
526,637
public static int BoyerMooreHorspoolSearch(char[] pattern, char[] text) {<NEW_LINE>int[] shift = new int[256];<NEW_LINE>for (int k = 0; k < 256; k++) {<NEW_LINE>shift[k] = pattern.length;<NEW_LINE>}<NEW_LINE>for (int k = 0; k < pattern.length - 1; k++) {<NEW_LINE>shift[pattern[k]] = pattern.length - 1 - k;<NEW_LINE>}<NEW_LINE>int i = 0, j = 0;<NEW_LINE>while ((i + pattern.length) <= text.length) {<NEW_LINE>j = pattern.length - 1;<NEW_LINE>while (text[i + j] == pattern[j]) {<NEW_LINE>j -= 1;<NEW_LINE>if (j < 0)<NEW_LINE>return i;<NEW_LINE>}<NEW_LINE>i = i + shift[text[i <MASK><NEW_LINE>}<NEW_LINE>return -1;<NEW_LINE>}
+ pattern.length - 1]];
1,352,477
public void onEvent(FlowableEvent event) {<NEW_LINE>if (isValidEvent(event)) {<NEW_LINE>Object delegate = DelegateExpressionUtil.resolveDelegateExpression<MASK><NEW_LINE>if (delegate instanceof FlowableEventListener) {<NEW_LINE>// Cache result of isFailOnException() from delegate-instance until next<NEW_LINE>// event is received. This prevents us from having to resolve the expression twice when<NEW_LINE>// an error occurs.<NEW_LINE>failOnException = ((FlowableEventListener) delegate).isFailOnException();<NEW_LINE>// Call the delegate<NEW_LINE>((FlowableEventListener) delegate).onEvent(event);<NEW_LINE>} else {<NEW_LINE>// Force failing, since the exception we're about to throw cannot be ignored, because it<NEW_LINE>// did not originate from the listener itself<NEW_LINE>failOnException = true;<NEW_LINE>throw new ActivitiIllegalArgumentException("Delegate expression " + expression + " did not resolve to an implementation of " + FlowableEventListener.class.getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(expression, new NoExecutionVariableScope());
1,747,101
private void migrateFieldValue(Helper helper) {<NEW_LINE>final String type = helper.parameters().getString("type");<NEW_LINE>final String field = helper.parameters().getString("field");<NEW_LINE>final String seriesId = helper.newSeriesId();<NEW_LINE>final AggregationSeries.Builder aggregationSeriesBuilder = AggregationSeries.builder().id(seriesId).field(field);<NEW_LINE>switch(type.toUpperCase(Locale.US)) {<NEW_LINE>case "MEAN":<NEW_LINE>aggregationSeriesBuilder.function(AggregationFunction.AVG);<NEW_LINE>break;<NEW_LINE>case "MIN":<NEW_LINE>aggregationSeriesBuilder.function(AggregationFunction.MIN);<NEW_LINE>break;<NEW_LINE>case "MAX":<NEW_LINE>aggregationSeriesBuilder.function(AggregationFunction.MAX);<NEW_LINE>break;<NEW_LINE>case "SUM":<NEW_LINE>aggregationSeriesBuilder.function(AggregationFunction.SUM);<NEW_LINE>break;<NEW_LINE>case "STDDEV":<NEW_LINE><MASK><NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>LOG.warn("Couldn't migrate field value alert condition with unknown type: {}", type);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final AggregationSeries aggregationSeries = aggregationSeriesBuilder.build();<NEW_LINE>final Expression<Boolean> expression = helper.createExpression(seriesId, "HIGHER");<NEW_LINE>final EventProcessorConfig config = helper.createAggregationProcessorConfig(aggregationSeries, expression, executeEveryMs);<NEW_LINE>final EventDefinitionDto definitionDto = helper.createEventDefinition(config);<NEW_LINE>LOG.info("Migrate legacy field value alert condition <{}>", definitionDto.title());<NEW_LINE>eventDefinitionHandler.create(definitionDto, userService.getRootUser());<NEW_LINE>}
aggregationSeriesBuilder.function(AggregationFunction.STDDEV);
130,780
protected void validateFieldDeclarationsForDmn(org.flowable.bpmn.model.Process process, TaskWithFieldExtensions task, List<FieldExtension> fieldExtensions, List<ValidationError> errors) {<NEW_LINE>boolean keyDefined = false;<NEW_LINE>for (FieldExtension fieldExtension : fieldExtensions) {<NEW_LINE>String fieldName = fieldExtension.getFieldName();<NEW_LINE><MASK><NEW_LINE>if ("decisionTableReferenceKey".equals(fieldName) && fieldValue != null && fieldValue.length() > 0) {<NEW_LINE>keyDefined = true;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if ("decisionServiceReferenceKey".equals(fieldName) && fieldValue != null && fieldValue.length() > 0) {<NEW_LINE>keyDefined = true;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!keyDefined) {<NEW_LINE>addError(errors, Problems.DMN_TASK_NO_KEY, process, task, "No decision table or decision service reference key is defined on the dmn activity");<NEW_LINE>}<NEW_LINE>}
String fieldValue = fieldExtension.getStringValue();
960,939
public void serialize(final ProcessTask value, final JsonGenerator jsonGenerator, final SerializerProvider provider) throws IOException {<NEW_LINE>final ObjectNode object = OBJECT_MAPPER.createObjectNode();<NEW_LINE>object.put("inputType", this.model.writeObjectAsObjectNode(value.getInputPluginType()));<NEW_LINE>object.put("outputType", this.model.writeObjectAsObjectNode(value.getOutputPluginType()));<NEW_LINE>object.put("filterTypes", this.model.writeObjectAsObjectNode<MASK><NEW_LINE>object.put("inputTask", this.model.writeObjectAsObjectNode(value.getInputTaskSource()));<NEW_LINE>object.put("outputTask", this.model.writeObjectAsObjectNode(value.getOutputTaskSource()));<NEW_LINE>object.put("filterTasks", this.model.writeObjectAsObjectNode(value.getFilterTaskSources()));<NEW_LINE>object.put("schemas", this.model.writeObjectAsObjectNode(value.getFilterSchemas()));<NEW_LINE>object.put("executorSchema", this.model.writeObjectAsObjectNode(value.getExecutorSchema()));<NEW_LINE>object.put("executorTask", this.model.writeObjectAsObjectNode(value.getExecutorTaskSource()));<NEW_LINE>jsonGenerator.writeTree(object);<NEW_LINE>}
(value.getFilterPluginTypes()));
468,641
public static JSONObject channelSign(JSONObject commentBody, String channelId, String channelName) throws ApiCallException, JSONException {<NEW_LINE>byte[] commentBodyBytes = commentBody.getString("comment").getBytes(StandardCharsets.UTF_8);<NEW_LINE>String encodedCommentBody;<NEW_LINE>if (Build.VERSION.SDK_INT > Build.VERSION_CODES.O_MR1)<NEW_LINE>encodedCommentBody = Hex.encodeHexString(commentBodyBytes, false);<NEW_LINE>else<NEW_LINE>encodedCommentBody = new String(Hex.encodeHex(commentBodyBytes));<NEW_LINE>Map<String, Object> signingParams <MASK><NEW_LINE>signingParams.put("hexdata", encodedCommentBody);<NEW_LINE>signingParams.put("channel_id", channelId);<NEW_LINE>signingParams.put("channel_name", channelName);<NEW_LINE>return (JSONObject) Lbry.genericApiCall("channel_sign", signingParams);<NEW_LINE>}
= new HashMap<>(3);
18,094
public void write(OutputStream out) throws IOException {<NEW_LINE>try {<NEW_LINE>CMSSignedDataStreamGenerator gen = getGenerator();<NEW_LINE>OutputStream signingStream = <MASK><NEW_LINE>if (content != null) {<NEW_LINE>if (!encapsulate) {<NEW_LINE>writeBodyPart(signingStream, content);<NEW_LINE>} else {<NEW_LINE>CommandMap commandMap = CommandMap.getDefaultCommandMap();<NEW_LINE>if (commandMap instanceof MailcapCommandMap) {<NEW_LINE>content.getDataHandler().setCommandMap(MailcapUtil.addCommands((MailcapCommandMap) commandMap));<NEW_LINE>}<NEW_LINE>content.writeTo(signingStream);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>signingStream.close();<NEW_LINE>_digests = gen.getGeneratedDigests();<NEW_LINE>} catch (MessagingException e) {<NEW_LINE>throw new IOException(e.toString());<NEW_LINE>} catch (CMSException e) {<NEW_LINE>throw new IOException(e.toString());<NEW_LINE>}<NEW_LINE>}
gen.open(out, encapsulate);
224,978
private void readPrefixedNameOrKeyword(Token token) {<NEW_LINE>long posn = reader.getPosition();<NEW_LINE>// Prefix part or keyword<NEW_LINE>String prefixPart = readPrefixPart();<NEW_LINE>token.setImage(prefixPart);<NEW_LINE>token.setType(TokenType.KEYWORD);<NEW_LINE>int ch = reader.peekChar();<NEW_LINE>if (ch == CH_COLON) {<NEW_LINE>reader.readChar();<NEW_LINE><MASK><NEW_LINE>// Local part<NEW_LINE>String ln = readLocalPart();<NEW_LINE>token.setImage2(ln);<NEW_LINE>if (Checking)<NEW_LINE>checkPrefixedName(token.getImage(), token.getImage2());<NEW_LINE>}<NEW_LINE>// If we made no progress, nothing found, not even a keyword -- it's an<NEW_LINE>// error.<NEW_LINE>if (posn == reader.getPosition())<NEW_LINE>fatal("Failed to find a prefix name or keyword: %c(%d;0x%04X)", ch, ch, ch);<NEW_LINE>if (Checking)<NEW_LINE>checkKeyword(token.getImage());<NEW_LINE>}
token.setType(TokenType.PREFIXED_NAME);
1,486,960
public JSONObject toJSONObject() {<NEW_LINE>final Map<String, String> clientMap = new HashMap<String, String>();<NEW_LINE>clientMap.put("app_package_name", appPackageName);<NEW_LINE>clientMap.put("app_title", appTitle);<NEW_LINE>clientMap.put("app_version_name", appVersionName);<NEW_LINE>clientMap.put("app_version_code", appVersionCode);<NEW_LINE>clientMap.put("client_id", uniqueId);<NEW_LINE>final Map<String, String> envMap = new HashMap<String, String>();<NEW_LINE>envMap.put("model", model);<NEW_LINE>envMap.put("make", make);<NEW_LINE>envMap.put("platform", platform);<NEW_LINE>envMap.put("platform_version", platformVersion);<NEW_LINE>envMap.put("locale", locale);<NEW_LINE>envMap.put("carrier", carrier);<NEW_LINE>envMap.put("networkType", networkType);<NEW_LINE>// services section<NEW_LINE>final Map<String, JSONObject> servicesMap = new HashMap<String, JSONObject>();<NEW_LINE>final Map<String, String> analyticsServiceMap = new HashMap<String, String>();<NEW_LINE>analyticsServiceMap.put(APP_ID_KEY, appId);<NEW_LINE>final JSONObject mobileAnalytics = new JSONObject(analyticsServiceMap);<NEW_LINE>servicesMap.put(MOBILE_ANALYTICS_KEY, mobileAnalytics);<NEW_LINE>final <MASK><NEW_LINE>final JSONObject envObj = new JSONObject(envMap);<NEW_LINE>final JSONObject customObj = new JSONObject(custom);<NEW_LINE>final JSONObject servicesObj = new JSONObject(servicesMap);<NEW_LINE>final JSONObject clientContextJSON = new JSONObject();<NEW_LINE>try {<NEW_LINE>clientContextJSON.put(CLIENT_OBJECT_KEY, clientObj);<NEW_LINE>clientContextJSON.put(ENVIRONMENT_OBJECT_KEY, envObj);<NEW_LINE>clientContextJSON.put(CUSTOM_OBJECT_KEY, customObj);<NEW_LINE>clientContextJSON.put(SERVICES_OBJECT_KEY, servicesObj);<NEW_LINE>} catch (final JSONException e) {<NEW_LINE>// Do not log clientContextJSON/exception due to potential sensitive information.<NEW_LINE>log.error("Error creating clientContextJSON.");<NEW_LINE>return clientContextJSON;<NEW_LINE>}<NEW_LINE>return clientContextJSON;<NEW_LINE>}
JSONObject clientObj = new JSONObject(clientMap);
416,506
public void filterWsdlRequest(SubmitContext context, WsdlRequest wsdlRequest) {<NEW_LINE>HttpRequest postMethod = (HttpRequest) context.getProperty(BaseHttpRequestTransport.HTTP_METHOD);<NEW_LINE>WsdlInterface wsdlInterface = (WsdlInterface) wsdlRequest<MASK><NEW_LINE>// init content-type and encoding<NEW_LINE>String encoding = System.getProperty("soapui.request.encoding", wsdlRequest.getEncoding());<NEW_LINE>SoapVersion soapVersion = wsdlInterface.getSoapVersion();<NEW_LINE>String soapAction = wsdlRequest.isSkipSoapAction() ? null : wsdlRequest.getAction();<NEW_LINE>postMethod.setHeader("Content-Type", soapVersion.getContentTypeHttpHeader(encoding, soapAction));<NEW_LINE>if (!wsdlRequest.isSkipSoapAction()) {<NEW_LINE>String soapActionHeader = soapVersion.getSoapActionHeader(soapAction);<NEW_LINE>if (soapActionHeader != null) {<NEW_LINE>postMethod.setHeader("SOAPAction", soapActionHeader);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.getOperation().getInterface();
327,322
public static BigDecimal avg(final Iterable<? extends Number> target) {<NEW_LINE>Validate.notNull(target, "Cannot aggregate on null");<NEW_LINE>Validate.containsNoNulls(target, "Cannot aggregate on array containing nulls");<NEW_LINE>BigDecimal total = BigDecimal.ZERO;<NEW_LINE>int size = 0;<NEW_LINE>for (final Number element : target) {<NEW_LINE>total = total.add(toBigDecimal(element));<NEW_LINE>size++;<NEW_LINE>}<NEW_LINE>if (size == 0) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final BigDecimal <MASK><NEW_LINE>try {<NEW_LINE>return total.divide(divisor);<NEW_LINE>} catch (final ArithmeticException e) {<NEW_LINE>// We will get an arithmetic exception if: 1. Divisor is zero, which is impossible; or 2. Division<NEW_LINE>// returns a number with a non-terminating decimal expansion. In the latter case, we will set the<NEW_LINE>// scale manually.<NEW_LINE>return total.divide(divisor, Math.max(total.scale(), 10), RoundingMode.HALF_UP);<NEW_LINE>}<NEW_LINE>}
divisor = BigDecimal.valueOf(size);
110,331
public <T extends AcceptingVisitor> void visit(String key, AttrObject<T> attr) {<NEW_LINE>if (map.containsKey(key)) {<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>Map<String, Object> submap = safeCast(this.map.remove(key), key, Map.class);<NEW_LINE>if (submap == null) {<NEW_LINE>attr.set(null);<NEW_LINE>} else {<NEW_LINE>submap <MASK><NEW_LINE>T value;<NEW_LINE>if (submap.containsKey(KEY_TYPE)) {<NEW_LINE>String valueType = safeCast(submap.remove(KEY_TYPE), KEY_TYPE, String.class);<NEW_LINE>value = safeCast(classToInstance.apply(valueType), key, attr.getInterfaceClass());<NEW_LINE>} else {<NEW_LINE>value = notNull(key, attr.newDefaultValue());<NEW_LINE>}<NEW_LINE>FromMapVisitor visitor = new FromMapVisitor(submap, classToInstance);<NEW_LINE>value.accept(visitor);<NEW_LINE>visitor.ensureKeysConsumed();<NEW_LINE>attr.set(value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
= new LinkedHashMap<>(submap);
1,550,491
private void constructCommandLineOptions() {<NEW_LINE>Option helpOption = OptionBuilder.withLongOpt(HELP_OPT_LONG_NAME).withDescription("Prints command-line options info").create(HELP_OPT_CHAR);<NEW_LINE>Option schemaRegistryLocation = OptionBuilder.withLongOpt(SCHEMA_REGISTRY_LOCATION_LONG_STR).withDescription("Absolute path to the Schema Registry directory").hasArg().create(SCHEMA_REGISTRY_LOCATION_OPT_CHAR);<NEW_LINE>Option schemaNameOption = OptionBuilder.withLongOpt(SCHEMA_NAME_LONG_STR).withDescription("DB Schema (Database) name in which the tables/views to be databusified is present").hasArg().create(SCHEMA_NAME_OPT_CHAR);<NEW_LINE>Option dbUriOption = OptionBuilder.withLongOpt(DB_URI_LONG_STR).withDescription("The URI for Oracle (Format : jdbc:oracle:thin:<user>/<password>@<dbhost>:1521:<SID>) or GG trail file location (Format : gg:///mnt/gg/extract/dbext<num>:x<num>)").<MASK><NEW_LINE>Option srcNamesOption = OptionBuilder.withLongOpt(SRC_NAMES_LONG_STR).withDescription("Comma seperated list of source names (e.g : com.linkedin.events.liar.jobrelay.LiarJobRelay,com.linkedin.events.liar.memberrelay.LiarMemberRelay)").hasArg().create(SRC_NAMES_OPT_CHAR);<NEW_LINE>Option outputDirectoryOption = OptionBuilder.withLongOpt(OUTPUT_DIRECTORY_LONG_STR).withDescription("Output Directory to generate the relay configs").hasArg().create(OUTPUT_DIRECTORY_OPT_CHAR);<NEW_LINE>_cliOptions.addOption(helpOption);<NEW_LINE>_cliOptions.addOption(schemaRegistryLocation);<NEW_LINE>_cliOptions.addOption(schemaNameOption);<NEW_LINE>_cliOptions.addOption(dbUriOption);<NEW_LINE>_cliOptions.addOption(srcNamesOption);<NEW_LINE>_cliOptions.addOption(outputDirectoryOption);<NEW_LINE>}
hasArg().create(DB_URI_OPT_CHAR);
1,684,909
public String createDocument(final String repositoryId, final Properties properties, final String folderId, final ContentStream contentStream, final VersioningState versioningState, final List<String> policies, final Acl addAces, final Acl removeAces, final ExtensionsData extension) {<NEW_LINE>final App app = StructrApp.getInstance(securityContext);<NEW_LINE>File newFile = null;<NEW_LINE>String uuid = null;<NEW_LINE>try (final Tx tx = app.tx()) {<NEW_LINE>final String objectTypeId = getStringValue(properties, PropertyIds.OBJECT_TYPE_ID);<NEW_LINE>final String fileName = getStringValue(properties, PropertyIds.NAME);<NEW_LINE>final Class type = typeFromObjectTypeId(objectTypeId, <MASK><NEW_LINE>// check if type exists<NEW_LINE>if (type != null) {<NEW_LINE>// check that base type is cmis:folder<NEW_LINE>final BaseTypeId baseTypeId = getBaseTypeId(type);<NEW_LINE>if (baseTypeId != null && BaseTypeId.CMIS_DOCUMENT.equals(baseTypeId)) {<NEW_LINE>final String mimeType = contentStream != null ? contentStream.getMimeType() : null;<NEW_LINE>// create file<NEW_LINE>newFile = FileHelper.createFile(securityContext, new byte[0], mimeType, type, fileName, false);<NEW_LINE>if (newFile != null) {<NEW_LINE>// find and set parent if it exists<NEW_LINE>if (!CMISInfo.ROOT_FOLDER_ID.equals(folderId)) {<NEW_LINE>final Folder parent = app.get(Folder.class, folderId);<NEW_LINE>if (parent != null) {<NEW_LINE>newFile.setParent(parent);<NEW_LINE>} else {<NEW_LINE>throw new CmisObjectNotFoundException("Folder with ID " + folderId + " does not exist");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>uuid = newFile.getUuid();<NEW_LINE>if (contentStream != null) {<NEW_LINE>final InputStream inputStream = contentStream.getStream();<NEW_LINE>if (inputStream != null) {<NEW_LINE>// copy file and update metadata<NEW_LINE>try (final OutputStream outputStream = newFile.getOutputStream(false, false)) {<NEW_LINE>IOUtils.copy(inputStream, outputStream);<NEW_LINE>}<NEW_LINE>inputStream.close();<NEW_LINE>FileHelper.updateMetadata(newFile);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new CmisConstraintException("Cannot create cmis:document of type " + objectTypeId);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new CmisObjectNotFoundException("Type with ID " + objectTypeId + " does not exist");<NEW_LINE>}<NEW_LINE>tx.success();<NEW_LINE>} catch (Throwable t) {<NEW_LINE>throw new CmisRuntimeException("New document could not be created: " + t.getMessage());<NEW_LINE>}<NEW_LINE>// start indexing after transaction is finished<NEW_LINE>if (newFile != null) {<NEW_LINE>newFile.notifyUploadCompletion();<NEW_LINE>}<NEW_LINE>return uuid;<NEW_LINE>}
BaseTypeId.CMIS_DOCUMENT, File.class);
1,078,321
final DeleteAddonResult executeDeleteAddon(DeleteAddonRequest deleteAddonRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteAddonRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteAddonRequest> request = null;<NEW_LINE>Response<DeleteAddonResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteAddonRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteAddonRequest));<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, "EKS");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteAddon");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteAddonResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteAddonResultJsonUnmarshaller());<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());
1,145,013
public static GetQualityResultResponse unmarshall(GetQualityResultResponse getQualityResultResponse, UnmarshallerContext _ctx) {<NEW_LINE>getQualityResultResponse.setRequestId(_ctx.stringValue("GetQualityResultResponse.RequestId"));<NEW_LINE>getQualityResultResponse.setMessage(_ctx.stringValue("GetQualityResultResponse.Message"));<NEW_LINE>getQualityResultResponse.setCode(_ctx.stringValue("GetQualityResultResponse.Code"));<NEW_LINE>getQualityResultResponse.setChannelTypeName(_ctx.stringValue("GetQualityResultResponse.ChannelTypeName"));<NEW_LINE>getQualityResultResponse.setSuccess(_ctx.booleanValue("GetQualityResultResponse.Success"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setPageNo(_ctx.integerValue("GetQualityResultResponse.Data.PageNo"));<NEW_LINE>data.setPageSize(_ctx.integerValue("GetQualityResultResponse.Data.PageSize"));<NEW_LINE>data.setTotalNum(_ctx.integerValue("GetQualityResultResponse.Data.TotalNum"));<NEW_LINE>List<QualityResultResponseListItem> qualityResultResponseList = new ArrayList<QualityResultResponseListItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("GetQualityResultResponse.Data.QualityResultResponseList.Length"); i++) {<NEW_LINE>QualityResultResponseListItem qualityResultResponseListItem = new QualityResultResponseListItem();<NEW_LINE>qualityResultResponseListItem.setTouchId(_ctx.stringValue("GetQualityResultResponse.Data.QualityResultResponseList[" + i + "].TouchId"));<NEW_LINE>qualityResultResponseListItem.setServicerName(_ctx.stringValue("GetQualityResultResponse.Data.QualityResultResponseList[" + i + "].ServicerName"));<NEW_LINE>qualityResultResponseListItem.setMemberName(_ctx.stringValue("GetQualityResultResponse.Data.QualityResultResponseList[" + i + "].MemberName"));<NEW_LINE>qualityResultResponseListItem.setProjectName(_ctx.stringValue("GetQualityResultResponse.Data.QualityResultResponseList[" + i + "].ProjectName"));<NEW_LINE>qualityResultResponseListItem.setProjectId(_ctx.stringValue("GetQualityResultResponse.Data.QualityResultResponseList[" + i + "].ProjectId"));<NEW_LINE>qualityResultResponseListItem.setChannelType(_ctx.stringValue("GetQualityResultResponse.Data.QualityResultResponseList[" + i + "].ChannelType"));<NEW_LINE>qualityResultResponseListItem.setChannelTypeName(_ctx.stringValue("GetQualityResultResponse.Data.QualityResultResponseList[" + i + "].ChannelTypeName"));<NEW_LINE>qualityResultResponseListItem.setTouchStartTime(_ctx.stringValue("GetQualityResultResponse.Data.QualityResultResponseList[" + i + "].TouchStartTime"));<NEW_LINE>qualityResultResponseListItem.setServicerId(_ctx.stringValue("GetQualityResultResponse.Data.QualityResultResponseList[" + i + "].ServicerId"));<NEW_LINE>qualityResultResponseListItem.setRuleName(_ctx.stringValue("GetQualityResultResponse.Data.QualityResultResponseList[" + i + "].RuleName"));<NEW_LINE>qualityResultResponseListItem.setRuleId(_ctx.stringValue<MASK><NEW_LINE>qualityResultResponseListItem.setGroupName(_ctx.stringValue("GetQualityResultResponse.Data.QualityResultResponseList[" + i + "].GroupName"));<NEW_LINE>qualityResultResponseListItem.setGroupId(_ctx.stringValue("GetQualityResultResponse.Data.QualityResultResponseList[" + i + "].GroupId"));<NEW_LINE>qualityResultResponseListItem.setInstanceName(_ctx.stringValue("GetQualityResultResponse.Data.QualityResultResponseList[" + i + "].InstanceName"));<NEW_LINE>qualityResultResponseListItem.setHitStatus(_ctx.booleanValue("GetQualityResultResponse.Data.QualityResultResponseList[" + i + "].HitStatus"));<NEW_LINE>qualityResultResponseListItem.setHitDetail(_ctx.stringValue("GetQualityResultResponse.Data.QualityResultResponseList[" + i + "].HitDetail"));<NEW_LINE>qualityResultResponseList.add(qualityResultResponseListItem);<NEW_LINE>}<NEW_LINE>data.setQualityResultResponseList(qualityResultResponseList);<NEW_LINE>getQualityResultResponse.setData(data);<NEW_LINE>return getQualityResultResponse;<NEW_LINE>}
("GetQualityResultResponse.Data.QualityResultResponseList[" + i + "].RuleId"));
1,785,843
public void considerBest(final SAMRecord firstEnd, final SAMRecord secondEnd) {<NEW_LINE>final int thisPairMapq = SAMUtils.combineMapqs(firstEnd.getMappingQuality(<MASK><NEW_LINE>final int thisDistance = CoordMath.getLength(Math.min(firstEnd.getAlignmentStart(), secondEnd.getAlignmentStart()), Math.max(firstEnd.getAlignmentEnd(), secondEnd.getAlignmentEnd()));<NEW_LINE>if (thisDistance > bestDistance || (thisDistance == bestDistance && thisPairMapq > bestPairMapq)) {<NEW_LINE>bestDistance = thisDistance;<NEW_LINE>bestPairMapq = thisPairMapq;<NEW_LINE>bestAlignmentPairs.clear();<NEW_LINE>bestAlignmentPairs.add(new AbstractMap.SimpleEntry<>(firstEnd, secondEnd));<NEW_LINE>} else if (thisDistance == bestDistance && thisPairMapq == bestPairMapq) {<NEW_LINE>bestAlignmentPairs.add(new AbstractMap.SimpleEntry<>(firstEnd, secondEnd));<NEW_LINE>}<NEW_LINE>}
), secondEnd.getMappingQuality());
441,915
public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {<NEW_LINE>if (System.getProperty(WebKeys.OSGI_ENABLED) == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String cmd = request.getParameter("cmd");<NEW_LINE>java.lang.reflect.Method meth = null;<NEW_LINE>Class[] partypes = new Class[] { HttpServletRequest.class, HttpServletResponse.class };<NEW_LINE>Object[] arglist = new Object[] { request, response };<NEW_LINE>try {<NEW_LINE>if (getUser() == null || !APILocator.getLayoutAPI().doesUserHaveAccessToPortlet("dynamic-plugins", getUser())) {<NEW_LINE>response.sendError(401);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>meth = this.getClass().getMethod(cmd, partypes);<NEW_LINE>} catch (Exception e) {<NEW_LINE>try {<NEW_LINE>cmd = "action";<NEW_LINE>meth = this.getClass().getMethod(cmd, partypes);<NEW_LINE>} catch (Exception ex) {<NEW_LINE>Logger.error(this.getClass(), "Trying to run method:" + cmd);<NEW_LINE>Logger.error(this.getClass(), e.getMessage(), e.getCause());<NEW_LINE>writeError(response, e.<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>meth.invoke(this, arglist);<NEW_LINE>} catch (Exception e) {<NEW_LINE>Logger.error(this, "Trying to run method:" + cmd);<NEW_LINE>Logger.error(this, e.getMessage(), e.getCause());<NEW_LINE>writeError(response, e.getCause().getMessage());<NEW_LINE>}<NEW_LINE>}
getCause().getMessage());
1,753,369
static // }<NEW_LINE>boolean ExtractResourceName(String str, Ref<String> out_package, Ref<String> out_type, final Ref<String> out_entry) {<NEW_LINE>out_package.set("");<NEW_LINE>out_type.set("");<NEW_LINE>boolean has_package_separator = false;<NEW_LINE>boolean has_type_separator = false;<NEW_LINE>int start = 0;<NEW_LINE>int end = start + str.length();<NEW_LINE>int current = start;<NEW_LINE>while (current != end) {<NEW_LINE>if (out_type.get().length() == 0 && str.charAt(current) == '/') {<NEW_LINE>has_type_separator = true;<NEW_LINE>out_type.set(str<MASK><NEW_LINE>start = current + 1;<NEW_LINE>} else if (out_package.get().length() == 0 && str.charAt(current) == ':') {<NEW_LINE>has_package_separator = true;<NEW_LINE>out_package.set(str.substring(start, current));<NEW_LINE>start = current + 1;<NEW_LINE>}<NEW_LINE>current++;<NEW_LINE>}<NEW_LINE>out_entry.set(str.substring(start, end));<NEW_LINE>return !(has_package_separator && out_package.get().isEmpty()) && !(has_type_separator && out_type.get().isEmpty());<NEW_LINE>}
.substring(start, current));
319,591
private int componentSize(BytesStreamOutput scratchBuffer) throws IOException {<NEW_LINE>scratchBuffer.reset();<NEW_LINE>if (component.type == ShapeField.DecodedTriangle.TYPE.POINT) {<NEW_LINE>scratchBuffer.writeVLong((long) maxX - component.aX);<NEW_LINE>scratchBuffer.writeVLong((long) maxY - component.aY);<NEW_LINE>} else if (component.type == ShapeField.DecodedTriangle.TYPE.LINE) {<NEW_LINE>scratchBuffer.writeVLong((long) maxX - component.aX);<NEW_LINE>scratchBuffer.writeVLong((long) maxY - component.aY);<NEW_LINE>scratchBuffer.writeVLong((long) maxX - component.bX);<NEW_LINE>scratchBuffer.writeVLong((<MASK><NEW_LINE>} else {<NEW_LINE>scratchBuffer.writeVLong((long) maxX - component.aX);<NEW_LINE>scratchBuffer.writeVLong((long) maxY - component.aY);<NEW_LINE>scratchBuffer.writeVLong((long) maxX - component.bX);<NEW_LINE>scratchBuffer.writeVLong((long) maxY - component.bY);<NEW_LINE>scratchBuffer.writeVLong((long) maxX - component.cX);<NEW_LINE>scratchBuffer.writeVLong((long) maxY - component.cY);<NEW_LINE>}<NEW_LINE>return Math.toIntExact(scratchBuffer.size());<NEW_LINE>}
long) maxY - component.bY);
1,543,906
void assembleMessageParameters() {<NEW_LINE>final ByteBuffer paramsBuffer;<NEW_LINE>LOG.info("Element address: " + MeshAddress.formatAddress(elementAddress, true));<NEW_LINE>LOG.info("Model: " + CompositionDataParser.formatModelIdentifier(modelIdentifier, false));<NEW_LINE>// We check if the model identifier value is within the range of a 16-bit value here. If it is then it is a sigmodel<NEW_LINE>if (modelIdentifier >= Short.MIN_VALUE && modelIdentifier <= Short.MAX_VALUE) {<NEW_LINE>paramsBuffer = ByteBuffer.allocate(SIG_MODEL_PUBLISH_GET_PARAMS_LENGTH).order(ByteOrder.LITTLE_ENDIAN);<NEW_LINE>paramsBuffer.putShort((short) elementAddress);<NEW_LINE>paramsBuffer.putShort((short) modelIdentifier);<NEW_LINE>mParameters = paramsBuffer.array();<NEW_LINE>} else {<NEW_LINE>paramsBuffer = ByteBuffer.allocate(VENDOR_MODEL_PUBLISH_GET_PARAMS_LENGTH).order(ByteOrder.LITTLE_ENDIAN);<NEW_LINE>paramsBuffer.putShort((short) elementAddress);<NEW_LINE>final byte[] modelIdentifier = new byte[] { (byte) ((this.modelIdentifier >> 24) & 0xFF), (byte) ((this.modelIdentifier >> 16) & 0xFF), (byte) ((this.modelIdentifier >> 8) & 0xFF), (byte) (this.modelIdentifier & 0xFF) };<NEW_LINE>paramsBuffer.put(modelIdentifier[1]);<NEW_LINE>paramsBuffer<MASK><NEW_LINE>paramsBuffer.put(modelIdentifier[3]);<NEW_LINE>paramsBuffer.put(modelIdentifier[2]);<NEW_LINE>mParameters = paramsBuffer.array();<NEW_LINE>}<NEW_LINE>}
.put(modelIdentifier[0]);
1,186,858
public void confirmOfflinePayment(Event event, String reservationId, String username) {<NEW_LINE>TicketReservation ticketReservation = findById(reservationId).orElseThrow(IllegalArgumentException::new);<NEW_LINE>ticketReservationRepository.lockReservationForUpdate(reservationId);<NEW_LINE>Validate.isTrue(ticketReservation.getPaymentMethod() == PaymentProxy.OFFLINE, "invalid payment method");<NEW_LINE>Validate.isTrue(ticketReservation.isPendingOfflinePayment(), "invalid status");<NEW_LINE>ticketReservationRepository.confirmOfflinePayment(reservationId, TicketReservationStatus.COMPLETE.name(), event.now(clockProvider));<NEW_LINE>registerAlfioTransaction(event, reservationId, PaymentProxy.OFFLINE);<NEW_LINE>auditingRepository.insert(reservationId, userRepository.findIdByUserName(username).orElse(null), event.getId(), Audit.EventType.RESERVATION_OFFLINE_PAYMENT_CONFIRMED, new Date(), Audit.EntityType.<MASK><NEW_LINE>CustomerName customerName = new CustomerName(ticketReservation.getFullName(), ticketReservation.getFirstName(), ticketReservation.getLastName(), event.mustUseFirstAndLastName());<NEW_LINE>acquireItems(PaymentProxy.OFFLINE, reservationId, ticketReservation.getEmail(), customerName, ticketReservation.getUserLanguage(), ticketReservation.getBillingAddress(), ticketReservation.getCustomerReference(), event, true);<NEW_LINE>Locale language = findReservationLanguage(reservationId);<NEW_LINE>final TicketReservation finalReservation = ticketReservationRepository.findReservationById(reservationId);<NEW_LINE>billingDocumentManager.createBillingDocument(event, finalReservation, username, orderSummaryForReservation(finalReservation, event));<NEW_LINE>var configuration = configurationManager.getFor(EnumSet.of(DEFERRED_BANK_TRANSFER_ENABLED, DEFERRED_BANK_TRANSFER_SEND_CONFIRMATION_EMAIL), ConfigurationLevel.event(event));<NEW_LINE>if (!configuration.get(DEFERRED_BANK_TRANSFER_ENABLED).getValueAsBooleanOrDefault() || configuration.get(DEFERRED_BANK_TRANSFER_SEND_CONFIRMATION_EMAIL).getValueAsBooleanOrDefault()) {<NEW_LINE>sendConfirmationEmail(event, findById(reservationId).orElseThrow(IllegalArgumentException::new), language, username);<NEW_LINE>}<NEW_LINE>extensionManager.handleReservationConfirmation(finalReservation, ticketReservationRepository.getBillingDetailsForReservation(reservationId), event);<NEW_LINE>}
RESERVATION, ticketReservation.getId());
126,346
private boolean processUninstalledInstallerBundle(long installerBundleId) {<NEW_LINE>// find out if the uninstalled bundle ID was an installer bundle and remove its installees as well<NEW_LINE>Set<Long> bundleIdsToUninstall;<NEW_LINE>boolean tracked;<NEW_LINE>synchronized (bundleOrigins) {<NEW_LINE><MASK><NEW_LINE>// use snapshot to avoid concurrent modification while iterating below<NEW_LINE>if (bundleIdsToUninstall != null) {<NEW_LINE>bundleIdsToUninstall = new HashSet<>(bundleIdsToUninstall);<NEW_LINE>}<NEW_LINE>tracked = allTracked.remove(installerBundleId);<NEW_LINE>}<NEW_LINE>boolean uninstalledTracked = bundleIdsToUninstall != null;<NEW_LINE>if (uninstalledTracked) {<NEW_LINE>debug("Installer bundle {0} had installees that need to be uninstalled", installerBundleId);<NEW_LINE>// we recognized the bundle being uninstalled as an installer, try to remove its installees<NEW_LINE>Set<Long> unsuccessfulUninstallLocations = uninstallInstalleeBundles(bundleIdsToUninstall);<NEW_LINE>// check if we successfully uninstalled everything<NEW_LINE>if (!unsuccessfulUninstallLocations.isEmpty()) {<NEW_LINE>// we weren't able to uninstall every installee<NEW_LINE>// we should update the map with the set of remaining bundle locations<NEW_LINE>// that way we will try to uninstall them again another time when it might work<NEW_LINE>bundleOrigins.put(installerBundleId, unsuccessfulUninstallLocations);<NEW_LINE>debug("Not all installees were removed", unsuccessfulUninstallLocations);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (tracked) {<NEW_LINE>// may need to clean up the bundle from the sets<NEW_LINE>synchronized (bundleOrigins) {<NEW_LINE>for (Map.Entry<Long, Set<Long>> entry : bundleOrigins.entrySet()) {<NEW_LINE>uninstalledTracked |= entry.getValue().remove(installerBundleId);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return uninstalledTracked;<NEW_LINE>}
bundleIdsToUninstall = bundleOrigins.remove(installerBundleId);
547,506
public void onDataChange(DataSnapshot snapshot) {<NEW_LINE>if (snapshot.exists()) {<NEW_LINE>try {<NEW_LINE>// Replace the URL with the url of your own listener app.<NEW_LINE>URL dest = new URL("http://gae-firebase-listener-python.appspot.com/log");<NEW_LINE>HttpURLConnection connection = (HttpURLConnection) dest.openConnection();<NEW_LINE>connection.setRequestMethod("POST");<NEW_LINE>connection.setDoOutput(true);<NEW_LINE>// Rely on X-Appengine-Inbound-Appid to authenticate. Turning off redirects is<NEW_LINE>// required to enable.<NEW_LINE>connection.setInstanceFollowRedirects(false);<NEW_LINE>// Fill out header if in dev environment<NEW_LINE>if (SystemProperty.environment.value() != SystemProperty.Environment.Value.Production) {<NEW_LINE>connection.setRequestProperty("X-Appengine-Inbound-Appid", "dev-instance");<NEW_LINE>}<NEW_LINE>// Convert value to JSON using Jackson<NEW_LINE>String json = new ObjectMapper().writeValueAsString(snapshot.getValue(false));<NEW_LINE>// Put Firebase data into http request<NEW_LINE>StringBuilder stringBuilder = new StringBuilder();<NEW_LINE>stringBuilder.append("&fbSnapshot=");<NEW_LINE>stringBuilder.append(URLEncoder.encode(json, "UTF-8"));<NEW_LINE>connection.getOutputStream().write(stringBuilder.toString().getBytes());<NEW_LINE>if (connection.getResponseCode() != 200) {<NEW_LINE>log.severe("Forwarding failed");<NEW_LINE>} else {<NEW_LINE>log.info("Sent: " + json);<NEW_LINE>}<NEW_LINE>} catch (JsonProcessingException e) {<NEW_LINE>log.severe(<MASK><NEW_LINE>} catch (IOException e) {<NEW_LINE>log.severe("Error in connecting to app engine: " + e.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
"Unable to convert Firebase response to JSON: " + e.getMessage());
1,378,960
final DisassociateEnvironmentOperationsRoleResult executeDisassociateEnvironmentOperationsRole(DisassociateEnvironmentOperationsRoleRequest disassociateEnvironmentOperationsRoleRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(disassociateEnvironmentOperationsRoleRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DisassociateEnvironmentOperationsRoleRequest> request = null;<NEW_LINE>Response<DisassociateEnvironmentOperationsRoleResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DisassociateEnvironmentOperationsRoleRequestMarshaller().marshall<MASK><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, "Elastic Beanstalk");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DisassociateEnvironmentOperationsRole");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DisassociateEnvironmentOperationsRoleResult> responseHandler = new StaxResponseHandler<DisassociateEnvironmentOperationsRoleResult>(new DisassociateEnvironmentOperationsRoleResultStaxUnmarshaller());<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>}
(super.beforeMarshalling(disassociateEnvironmentOperationsRoleRequest));
1,823,755
public com.squareup.okhttp.Call apisApiIdGetCall(String apiId, String tenantDomain, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/apis/{apiId}".replaceAll("\\{" + "apiId" + "\\}", apiClient.escapeString(apiId.toString()));<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();<NEW_LINE>if (tenantDomain != null)<NEW_LINE>localVarQueryParams.addAll(apiClient.parameterToPair("tenantDomain", tenantDomain));<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null)<NEW_LINE><MASK><NEW_LINE>final String[] localVarContentTypes = { "application/json" };<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>if (progressListener != null) {<NEW_LINE>apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {<NEW_LINE>com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());<NEW_LINE>return originalResponse.newBuilder().body(new ProgressResponseBody(originalResponse.body(), progressListener)).build();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>String[] localVarAuthNames = new String[] {};<NEW_LINE>return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);<NEW_LINE>}
localVarHeaderParams.put("Accept", localVarAccept);
130,880
public CreateAppInstanceUserResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>CreateAppInstanceUserResult createAppInstanceUserResult = new CreateAppInstanceUserResult();<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 createAppInstanceUserResult;<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("AppInstanceUserArn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>createAppInstanceUserResult.setAppInstanceUserArn(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 createAppInstanceUserResult;<NEW_LINE>}
JsonToken token = context.getCurrentToken();
1,096,441
public Void visitDeclared(DeclaredType type, Void p) {<NEW_LINE>TypeElement element = (TypeElement) type.asElement();<NEW_LINE>String name = element.getQualifiedName().toString();<NEW_LINE>ElementKind kind = element.getEnclosingElement().getKind();<NEW_LINE>if (kind.isClass() || kind.isInterface() || kind == ElementKind.PACKAGE) {<NEW_LINE>try {<NEW_LINE>String s = SourceUtils.<MASK><NEW_LINE>int idx = s.indexOf('.');<NEW_LINE>if (idx < 0) {<NEW_LINE>importedTypes.add(name);<NEW_LINE>} else {<NEW_LINE>importedTypes.add(name.substring(0, name.length() - s.length() + idx));<NEW_LINE>}<NEW_LINE>name = s;<NEW_LINE>} catch (Exception e) {<NEW_LINE>// NOI18N<NEW_LINE>Logger.getLogger("global").log(Level.INFO, null, e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>builder.append(name);<NEW_LINE>Iterator<? extends TypeMirror> it = type.getTypeArguments().iterator();<NEW_LINE>if (it.hasNext()) {<NEW_LINE>// NOI18N<NEW_LINE>builder.append('<');<NEW_LINE>while (it.hasNext()) {<NEW_LINE>visit(it.next());<NEW_LINE>if (it.hasNext())<NEW_LINE>// NOI18N<NEW_LINE>builder.append(", ");<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>builder.append('>');<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
resolveImport(info, path, name);
155,657
public static void threadDump(final Appendable w) {<NEW_LINE>try {<NEW_LINE>final DateFormat df = DateFormat.getDateTimeInstance();<NEW_LINE>final Date date = new Date(System.currentTimeMillis());<NEW_LINE>w.append(Banner.getBanner());<NEW_LINE>w.append("Thread dump. Date:" + df.format(date));<NEW_LINE>w.append("\n\n");<NEW_LINE>// Setup an ordered map.<NEW_LINE>final Map<Thread, StackTraceElement[]> dump = new TreeMap<Thread, StackTraceElement[]>(new Comparator<Thread>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int compare(Thread o1, Thread o2) {<NEW_LINE>return Long.compare(o1.getId(), o2.getId());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// Add the stack trace for each thread.<NEW_LINE>dump.<MASK><NEW_LINE>for (Map.Entry<Thread, StackTraceElement[]> threadEntry : dump.entrySet()) {<NEW_LINE>final Thread thread = threadEntry.getKey();<NEW_LINE>w.append("THREAD#" + thread.getId() + ", name=" + thread.getName() + ", state=" + thread.getState() + ", priority=" + thread.getPriority() + ", daemon=" + thread.isDaemon() + "\n");<NEW_LINE>for (StackTraceElement elem : threadEntry.getValue()) {<NEW_LINE>w.append("\t" + elem.toString() + "\n");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (IOException ex) {<NEW_LINE>throw new RuntimeException(ex);<NEW_LINE>}<NEW_LINE>}
putAll(Thread.getAllStackTraces());
244,716
private CollectionEventInfo<Document> removeAndCreateEvent(Document document, WriteResultImpl writeResult) {<NEW_LINE>NitriteId nitriteId = document.getId();<NEW_LINE>document = nitriteMap.remove(nitriteId);<NEW_LINE>if (document != null) {<NEW_LINE>long time = System.currentTimeMillis();<NEW_LINE>documentIndexWriter.removeIndexEntry(document);<NEW_LINE>writeResult.addToList(nitriteId);<NEW_LINE>int rev = document.getRevision();<NEW_LINE>document.put(DOC_REVISION, rev + 1);<NEW_LINE><MASK><NEW_LINE>log.debug("Document removed {} from {}", document, nitriteMap.getName());<NEW_LINE>CollectionEventInfo<Document> eventInfo = new CollectionEventInfo<>();<NEW_LINE>Document eventDoc = document.clone();<NEW_LINE>eventInfo.setItem(eventDoc);<NEW_LINE>eventInfo.setEventType(EventType.Remove);<NEW_LINE>eventInfo.setTimestamp(time);<NEW_LINE>return eventInfo;<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
document.put(DOC_MODIFIED, time);
258,419
protected void initAppFrameUI() {<NEW_LINE>Dimension preferredSize = new Dimension(SwingUtils.getScreenSize());<NEW_LINE>setMinimumSize(new Dimension(300, 300));<NEW_LINE>setPreferredSize(SwingUtils.getScreenSize());<NEW_LINE>topPanel = new JTabbedPane();<NEW_LINE>topPanel.setName("topPanel");<NEW_LINE>leftPanel = new JTabbedPane();<NEW_LINE>leftPanel.setName("leftPanel");<NEW_LINE>centerPanel = new JTabbedPane();<NEW_LINE>centerPanel.setName("centerPanel");<NEW_LINE>rightPanel = new JTabbedPane();<NEW_LINE>rightPanel.setName("rightPanel");<NEW_LINE>bottomPanel = new JTabbedPane();<NEW_LINE>bottomPanel.setName("bottomPanel");<NEW_LINE>initPanels(topPanel, leftPanel, centerPanel, rightPanel, bottomPanel);<NEW_LINE>innerSplit <MASK><NEW_LINE>JavaSEPort.instance.registerSplitPaneWithBlit(innerSplit);<NEW_LINE>innerSplit.setName("innerSplit");<NEW_LINE>setDividerLocationIfChanged(innerSplit, 600);<NEW_LINE>outerSplit = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);<NEW_LINE>JavaSEPort.instance.registerSplitPaneWithBlit(outerSplit);<NEW_LINE>outerSplit.setName("outerSplit");<NEW_LINE>setDividerLocationIfChanged(outerSplit, 0);<NEW_LINE>centerSplit = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);<NEW_LINE>JavaSEPort.instance.registerSplitPaneWithBlit(centerSplit);<NEW_LINE>centerSplit.setName("centerSplit");<NEW_LINE>setDividerLocationIfChanged(centerSplit, 600);<NEW_LINE>outerSplit.setLeftComponent(leftPanel);<NEW_LINE>outerSplit.setRightComponent(innerSplit);<NEW_LINE>innerSplit.setTopComponent(centerSplit);<NEW_LINE>innerSplit.setBottomComponent(bottomPanel);<NEW_LINE>centerSplit.setLeftComponent(centerPanel);<NEW_LINE>centerSplit.setRightComponent(rightPanel);<NEW_LINE>applyPreferences();<NEW_LINE>addComponentListener(frameListener);<NEW_LINE>outerSplit.addPropertyChangeListener(frameListener);<NEW_LINE>innerSplit.addPropertyChangeListener(frameListener);<NEW_LINE>centerSplit.addPropertyChangeListener(frameListener);<NEW_LINE>add(outerSplit, BorderLayout.CENTER);<NEW_LINE>updateAppFrameUI();<NEW_LINE>initialized = true;<NEW_LINE>}
= new JSplitPane(JSplitPane.VERTICAL_SPLIT);
1,024,980
private static void purchaseReservedNodeOffer() throws IOException {<NEW_LINE>if (matchingNodes.size() == 0) {<NEW_LINE>return;<NEW_LINE>} else {<NEW_LINE>System.out.println("\nPurchasing nodes.");<NEW_LINE>for (ReservedNodeOffering offering : matchingNodes) {<NEW_LINE>printOfferingDetails(offering);<NEW_LINE>System.out.println("WARNING: purchasing this offering will incur costs.");<NEW_LINE><MASK><NEW_LINE>DataInput in = new DataInputStream(System.in);<NEW_LINE>String purchaseOpt = in.readLine();<NEW_LINE>if (purchaseOpt.equalsIgnoreCase("y")) {<NEW_LINE>try {<NEW_LINE>PurchaseReservedNodeOfferingRequest request = new PurchaseReservedNodeOfferingRequest().withReservedNodeOfferingId(offering.getReservedNodeOfferingId());<NEW_LINE>ReservedNode reservedNode = client.purchaseReservedNodeOffering(request);<NEW_LINE>printReservedNodeDetails(reservedNode);<NEW_LINE>} catch (ReservedNodeAlreadyExistsException ex1) {<NEW_LINE>} catch (ReservedNodeOfferingNotFoundException ex2) {<NEW_LINE>} catch (ReservedNodeQuotaExceededException ex3) {<NEW_LINE>} catch (Exception ex4) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>System.out.println("Finished.");<NEW_LINE>}<NEW_LINE>}
System.out.println("Purchase this offering [Y or N]?");
1,152,331
/*<NEW_LINE>* testBMTNoCommit()<NEW_LINE>*<NEW_LINE>* send a message to MDB BMTBeanNoCommit<NEW_LINE>*/<NEW_LINE>public void testAnnBMTNoCommit() throws Exception {<NEW_LINE><MASK><NEW_LINE>FATMDBHelper.putQueueMessage("Request test results", qcfName, bmtNoCommitRequestQueueName);<NEW_LINE>svLogger.info("Message sent to MDB BMTBeanNoCommit.");<NEW_LINE>String results = (String) FATMDBHelper.getQueueMessage(qcfName, testResultQueueName);<NEW_LINE>if (results == null) {<NEW_LINE>fail("Reply is an empty vector. No test results are collected.");<NEW_LINE>}<NEW_LINE>if (results.equals("")) {<NEW_LINE>fail("No worthwhile results were returned.");<NEW_LINE>}<NEW_LINE>if (results.contains("FAIL")) {<NEW_LINE>svLogger.info(results);<NEW_LINE>fail("Reply contained FAIL keyword. Look at client log for full result text.");<NEW_LINE>}<NEW_LINE>FATMDBHelper.emptyQueue(qcfName, bmtNoCommitRequestQueueName);<NEW_LINE>svLogger.info("checking data for BMTTxNoCommit ...");<NEW_LINE>svLogger.info("Test Point: BMTTxNoCommit getIntValue: " + BMTBeanNoCommit.noCommitBean.getIntValue());<NEW_LINE>assertTrue("BMTTxNoCommit", (BMTBeanNoCommit.noCommitBean.getIntValue() == 0));<NEW_LINE>svLogger.info("done");<NEW_LINE>}
FATMDBHelper.emptyQueue(qcfName, testResultQueueName);
13,610
final RestoreVolumeFromSnapshotResult executeRestoreVolumeFromSnapshot(RestoreVolumeFromSnapshotRequest restoreVolumeFromSnapshotRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(restoreVolumeFromSnapshotRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<RestoreVolumeFromSnapshotRequest> request = null;<NEW_LINE>Response<RestoreVolumeFromSnapshotResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new RestoreVolumeFromSnapshotRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(restoreVolumeFromSnapshotRequest));<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, "FSx");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "RestoreVolumeFromSnapshot");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<RestoreVolumeFromSnapshotResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new RestoreVolumeFromSnapshotResultJsonUnmarshaller());<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());
1,217,051
public void addBindValues(SpiExpressionRequest request) {<NEW_LINE>if (empty) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (Object value : bindValues) {<NEW_LINE>if (value == null) {<NEW_LINE>throw new NullPointerException("null values in 'in(...)' queries must be handled separately!");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ElPropertyValue prop = getElProp(request);<NEW_LINE>if (prop != null && !prop.isAssocId()) {<NEW_LINE>prop = null;<NEW_LINE>}<NEW_LINE>if (prop == null) {<NEW_LINE>if (bindValues.size() > 0) {<NEW_LINE>// if we have no property, we wrap them in a multi value wrapper.<NEW_LINE>// later the binder will decide, which bind strategy to use.<NEW_LINE>request.<MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>List<Object> idList = new ArrayList<>();<NEW_LINE>for (Object bindValue : bindValues) {<NEW_LINE>// extract the id values from the bean<NEW_LINE>Object[] ids = prop.assocIdValues((EntityBean) bindValue);<NEW_LINE>if (ids != null) {<NEW_LINE>Collections.addAll(idList, ids);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!idList.isEmpty()) {<NEW_LINE>request.addBindValue(new MultiValueWrapper(idList));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
addBindValue(new MultiValueWrapper(bindValues));
1,562,875
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {<NEW_LINE>builder.startObject();<NEW_LINE>builder.field(DataStream.NAME_FIELD.getPreferredName(), dataStream.getName());<NEW_LINE>builder.field(DataStream.TIMESTAMP_FIELD_FIELD.getPreferredName(<MASK><NEW_LINE>builder.xContentList(DataStream.INDICES_FIELD.getPreferredName(), dataStream.getIndices());<NEW_LINE>builder.field(DataStream.GENERATION_FIELD.getPreferredName(), dataStream.getGeneration());<NEW_LINE>if (dataStream.getMetadata() != null) {<NEW_LINE>builder.field(DataStream.METADATA_FIELD.getPreferredName(), dataStream.getMetadata());<NEW_LINE>}<NEW_LINE>builder.field(STATUS_FIELD.getPreferredName(), dataStreamStatus);<NEW_LINE>if (indexTemplate != null) {<NEW_LINE>builder.field(INDEX_TEMPLATE_FIELD.getPreferredName(), indexTemplate);<NEW_LINE>}<NEW_LINE>if (ilmPolicyName != null) {<NEW_LINE>builder.field(ILM_POLICY_FIELD.getPreferredName(), ilmPolicyName);<NEW_LINE>}<NEW_LINE>builder.field(HIDDEN_FIELD.getPreferredName(), dataStream.isHidden());<NEW_LINE>builder.field(SYSTEM_FIELD.getPreferredName(), dataStream.isSystem());<NEW_LINE>builder.field(ALLOW_CUSTOM_ROUTING.getPreferredName(), dataStream.isAllowCustomRouting());<NEW_LINE>builder.field(REPLICATED.getPreferredName(), dataStream.isReplicated());<NEW_LINE>builder.endObject();<NEW_LINE>return builder;<NEW_LINE>}
), dataStream.getTimeStampField());
1,584,081
public void serialize(DataOutput out) throws IOException {<NEW_LINE>int startOffset = 0;<NEW_LINE>boolean hasrun = hasRunContainer();<NEW_LINE>if (hasrun) {<NEW_LINE>out.writeInt(Integer.reverseBytes(SERIAL_COOKIE | ((size - 1) << 16)));<NEW_LINE>byte[] bitmapOfRunContainers = new byte[(size + 7) / 8];<NEW_LINE>for (int i = 0; i < size; ++i) {<NEW_LINE>if (this.values[i] instanceof RunContainer) {<NEW_LINE>bitmapOfRunContainers[i / 8] |= (1 << (i % 8));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>out.write(bitmapOfRunContainers);<NEW_LINE>if (this.size < NO_OFFSET_THRESHOLD) {<NEW_LINE>startOffset = 4 + 4 * this.size + bitmapOfRunContainers.length;<NEW_LINE>} else {<NEW_LINE>startOffset = 4 + 8 * this.size + bitmapOfRunContainers.length;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// backwards compatibility<NEW_LINE>out.writeInt<MASK><NEW_LINE>out.writeInt(Integer.reverseBytes(size));<NEW_LINE>startOffset = 4 + 4 + 4 * this.size + 4 * this.size;<NEW_LINE>}<NEW_LINE>for (int k = 0; k < size; ++k) {<NEW_LINE>out.writeShort(Character.reverseBytes(this.keys[k]));<NEW_LINE>out.writeShort(Character.reverseBytes((char) (this.values[k].getCardinality() - 1)));<NEW_LINE>}<NEW_LINE>if ((!hasrun) || (this.size >= NO_OFFSET_THRESHOLD)) {<NEW_LINE>// writing the containers offsets<NEW_LINE>for (int k = 0; k < this.size; k++) {<NEW_LINE>out.writeInt(Integer.reverseBytes(startOffset));<NEW_LINE>startOffset = startOffset + this.values[k].getArraySizeInBytes();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int k = 0; k < size; ++k) {<NEW_LINE>values[k].writeArray(out);<NEW_LINE>}<NEW_LINE>}
(Integer.reverseBytes(SERIAL_COOKIE_NO_RUNCONTAINER));
634,450
protected void dealNestField(Matcher matcher, AbstractTableInfo tableInfo) {<NEW_LINE>String <MASK><NEW_LINE>Preconditions.checkArgument(!physicalFieldFunPattern.matcher(physicalField).find(), "No need to add data types when using functions, The correct way is : strLen(name) as nameSize, ");<NEW_LINE>String fieldType = matcher.group(3);<NEW_LINE>String mappingField = matcher.group(4);<NEW_LINE>Class fieldClass = dbTypeConvertToJavaType(fieldType);<NEW_LINE>boolean notNull = matcher.group(5) != null;<NEW_LINE>AbstractTableInfo.FieldExtraInfo fieldExtraInfo = new AbstractTableInfo.FieldExtraInfo();<NEW_LINE>fieldExtraInfo.setNotNull(notNull);<NEW_LINE>tableInfo.addPhysicalMappings(mappingField, physicalField);<NEW_LINE>tableInfo.addField(mappingField);<NEW_LINE>tableInfo.addFieldClass(fieldClass);<NEW_LINE>tableInfo.addFieldType(fieldType);<NEW_LINE>tableInfo.addFieldExtraInfo(fieldExtraInfo);<NEW_LINE>}
physicalField = matcher.group(1);
783,007
public void showCustomizer(String preselectedCategory, final String preselectedSubCategory) {<NEW_LINE>if (dialog != null) {<NEW_LINE>dialog.setVisible(true);<NEW_LINE>} else {<NEW_LINE>final String category = (<MASK><NEW_LINE>final AtomicReference<Lookup> context = new AtomicReference<Lookup>();<NEW_LINE>ProgressUtils.runOffEventDispatchThread(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>context.set(new ProxyLookup(prepareData(), Lookups.fixed(new SubCategoryProvider(category, preselectedSubCategory))));<NEW_LINE>}<NEW_LINE>}, PROGRESS_loading_data(), /* currently unused */<NEW_LINE>new AtomicBoolean(), false);<NEW_LINE>if (context.get() == null) {<NEW_LINE>// canceled<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>OptionListener listener = new OptionListener();<NEW_LINE>dialog = ProjectCustomizer.createCustomizerDialog(layerPath, context.get(), category, listener, null);<NEW_LINE>dialog.addWindowListener(listener);<NEW_LINE>dialog.setTitle(LBL_CustomizerTitle(ProjectUtils.getInformation(getProject()).getDisplayName()));<NEW_LINE>dialog.setVisible(true);<NEW_LINE>}<NEW_LINE>}
preselectedCategory != null) ? preselectedCategory : lastSelectedCategory;
24,691
public void showIssue(final Issue issue) {<NEW_LINE>setToolbarTitle(getString(R.string.issue).concat(" #").concat(String.valueOf(issue.getNumber())));<NEW_LINE>GlideApp.with(getActivity()).load(issue.getUser().getAvatarUrl()).onlyRetrieveFromCache(!PrefUtils.isLoadImageEnable()).into(userImageView);<NEW_LINE>issueTitle.setText(issue.getTitle());<NEW_LINE>commentBn.setVisibility(issue.isLocked() ? View.GONE : View.VISIBLE);<NEW_LINE>String commentStr = String.valueOf(issue.getCommentNum()).concat(" ").concat(getString(R.string.comments).toLowerCase());<NEW_LINE>if (Issue.IssueState.open.equals(issue.getState())) {<NEW_LINE>issueStateImg.setImageResource(R.drawable.ic_issues);<NEW_LINE>issueStateText.setText(getString(R.string.open).concat(" ").concat(commentStr));<NEW_LINE>} else {<NEW_LINE>issueStateImg.setImageResource(R.drawable.ic_issues_closed);<NEW_LINE>issueStateText.setText(getString(R.string.closed).concat(" ").concat(commentStr));<NEW_LINE>}<NEW_LINE>invalidateOptionsMenu();<NEW_LINE>if (issueTimelineFragment == null) {<NEW_LINE>issueTimelineFragment = IssueTimelineFragment.create(issue);<NEW_LINE>new Handler().postDelayed(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>if (!isAlive)<NEW_LINE>return;<NEW_LINE>getSupportFragmentManager().beginTransaction().add(R.id.<MASK><NEW_LINE>}<NEW_LINE>}, 500);<NEW_LINE>issueTimelineFragment.setListScrollListener(this);<NEW_LINE>}<NEW_LINE>String loggedUser = AppData.INSTANCE.getLoggedUser().getLogin();<NEW_LINE>boolean editAble = loggedUser.equals(issue.getUser().getLogin()) || loggedUser.equals(issue.getRepoAuthorName());<NEW_LINE>editBn.setVisibility(editAble ? View.VISIBLE : View.GONE);<NEW_LINE>commentBn.setVisibility(View.VISIBLE);<NEW_LINE>}
container, issueTimelineFragment).commitAllowingStateLoss();
537,273
private void findCategoryChange(Map<IJavaElement, String[]> oldCategoriesMap, Map<IJavaElement, String[]> newCategoriesMap) {<NEW_LINE>if (oldCategoriesMap != null) {<NEW_LINE>// take the union of old and new categories elements (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=125675)<NEW_LINE>Set elements;<NEW_LINE>if (newCategoriesMap != null) {<NEW_LINE>elements = new HashSet(oldCategoriesMap.keySet());<NEW_LINE>elements.addAll(newCategoriesMap.keySet());<NEW_LINE>} else<NEW_LINE>elements = oldCategoriesMap.keySet();<NEW_LINE>Iterator iterator = elements.iterator();<NEW_LINE>while (iterator.hasNext()) {<NEW_LINE>IJavaElement element = (IJavaElement) iterator.next();<NEW_LINE>String[] oldCategories = oldCategoriesMap.get(element);<NEW_LINE>String[] newCategories = newCategoriesMap == null ? null : (String[]) newCategoriesMap.get(element);<NEW_LINE>if (!Util.equalArraysOrNull(oldCategories, newCategories)) {<NEW_LINE>this.delta.changed(element, IJavaElementDelta.F_CATEGORIES);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (newCategoriesMap != null) {<NEW_LINE>Iterator elements = newCategoriesMap.keySet().iterator();<NEW_LINE>while (elements.hasNext()) {<NEW_LINE>IJavaElement element = (IJavaElement) elements.next();<NEW_LINE>// all categories for this element were removed<NEW_LINE>this.delta.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
changed(element, IJavaElementDelta.F_CATEGORIES);
739,956
public void generate(NodeLIRBuilderTool nodeLIRBuilderTool) {<NEW_LINE>Logger.traceBuildLIR(Logger.BACKEND.PTX, "emitCast: convertOp=%s, value=%s", op, value);<NEW_LINE>PTXLIRGenerator gen = (PTXLIRGenerator) nodeLIRBuilderTool.getLIRGeneratorTool();<NEW_LINE>LIRKind lirKind = gen.getLIRKind(stamp);<NEW_LINE>final Variable result = gen.newVariable(lirKind);<NEW_LINE>Value value = nodeLIRBuilderTool.operand(this.value);<NEW_LINE>PTXKind valueKind = <MASK><NEW_LINE>PTXKind resultKind = (PTXKind) result.getPlatformKind();<NEW_LINE>PTXAssembler.PTXUnaryOp opcode;<NEW_LINE>if (!resultKind.isFloating() && (valueKind.isFloating() || valueKind.getElementKind().isFloating())) {<NEW_LINE>opcode = PTXAssembler.PTXUnaryOp.CVT_INT_RTZ;<NEW_LINE>Variable nanPred = gen.newVariable(LIRKind.value(PTXKind.PRED));<NEW_LINE>gen.append(new PTXLIRStmt.AssignStmt(nanPred, new PTXUnary.Expr(PTXAssembler.PTXUnaryOp.TESTP_NORMAL, LIRKind.value(valueKind), value)));<NEW_LINE>gen.append(new PTXLIRStmt.ConditionalStatement(new PTXLIRStmt.AssignStmt(result, new PTXUnary.Expr(opcode, lirKind, value)), nanPred, false));<NEW_LINE>gen.append(new PTXLIRStmt.ConditionalStatement(new PTXLIRStmt.AssignStmt(result, new ConstantValue(LIRKind.value(resultKind), PrimitiveConstant.INT_0)), nanPred, true));<NEW_LINE>} else {<NEW_LINE>if (resultKind.isF64() && valueKind.isF32()) {<NEW_LINE>opcode = PTXAssembler.PTXUnaryOp.CVT_FLOAT;<NEW_LINE>} else {<NEW_LINE>opcode = PTXAssembler.PTXUnaryOp.CVT_FLOAT_RNE;<NEW_LINE>}<NEW_LINE>gen.append(new PTXLIRStmt.AssignStmt(result, new PTXUnary.Expr(opcode, lirKind, value)));<NEW_LINE>}<NEW_LINE>nodeLIRBuilderTool.setResult(this, result);<NEW_LINE>}
(PTXKind) value.getPlatformKind();
1,338,762
final DeleteRetentionPolicyResult executeDeleteRetentionPolicy(DeleteRetentionPolicyRequest deleteRetentionPolicyRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteRetentionPolicyRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteRetentionPolicyRequest> request = null;<NEW_LINE>Response<DeleteRetentionPolicyResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteRetentionPolicyRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteRetentionPolicyRequest));<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, "WorkMail");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteRetentionPolicy");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteRetentionPolicyResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteRetentionPolicyResultJsonUnmarshaller());<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());
355,165
private static String parseStringValue(Properties properties, String value, String current, Set<String> visitedPlaceholders) {<NEW_LINE>StringBuilder buf = new StringBuilder(current);<NEW_LINE>int startIndex = current.indexOf(PLACEHOLDER_PREFIX);<NEW_LINE>while (startIndex != -1) {<NEW_LINE>int endIndex = findPlaceholderEndIndex(buf, startIndex);<NEW_LINE>if (endIndex != -1) {<NEW_LINE>String placeholder = buf.substring(startIndex + PLACEHOLDER_PREFIX.length(), endIndex);<NEW_LINE>String originalPlaceholder = placeholder;<NEW_LINE>if (!visitedPlaceholders.add(originalPlaceholder)) {<NEW_LINE>throw new IllegalArgumentException("Circular placeholder reference '" + originalPlaceholder + "' in property definitions");<NEW_LINE>}<NEW_LINE>// Recursive invocation, parsing placeholders contained in the<NEW_LINE>// placeholder<NEW_LINE>// key.<NEW_LINE>placeholder = parseStringValue(<MASK><NEW_LINE>// Now obtain the value for the fully resolved key...<NEW_LINE>String propVal = resolvePlaceholder(properties, value, placeholder);<NEW_LINE>if (propVal == null) {<NEW_LINE>int separatorIndex = placeholder.indexOf(VALUE_SEPARATOR);<NEW_LINE>if (separatorIndex != -1) {<NEW_LINE>String actualPlaceholder = placeholder.substring(0, separatorIndex);<NEW_LINE>String defaultValue = placeholder.substring(separatorIndex + VALUE_SEPARATOR.length());<NEW_LINE>propVal = resolvePlaceholder(properties, value, actualPlaceholder);<NEW_LINE>if (propVal == null) {<NEW_LINE>propVal = defaultValue;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (propVal != null) {<NEW_LINE>// Recursive invocation, parsing placeholders contained in the<NEW_LINE>// previously resolved placeholder value.<NEW_LINE>propVal = parseStringValue(properties, value, propVal, visitedPlaceholders);<NEW_LINE>buf.replace(startIndex, endIndex + PLACEHOLDER_SUFFIX.length(), propVal);<NEW_LINE>startIndex = buf.indexOf(PLACEHOLDER_PREFIX, startIndex + propVal.length());<NEW_LINE>} else {<NEW_LINE>// Proceed with unprocessed value.<NEW_LINE>startIndex = buf.indexOf(PLACEHOLDER_PREFIX, endIndex + PLACEHOLDER_SUFFIX.length());<NEW_LINE>}<NEW_LINE>visitedPlaceholders.remove(originalPlaceholder);<NEW_LINE>} else {<NEW_LINE>startIndex = -1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return buf.toString();<NEW_LINE>}
properties, value, placeholder, visitedPlaceholders);
540,206
void logTrailer(long seqId, String serviceName, String methodName, Status status, Metadata metadata, int maxHeaderBytes, GrpcLogRecord.EventLogger eventLogger, String rpcId, @Nullable SocketAddress peerAddress) {<NEW_LINE>checkNotNull(serviceName, "serviceName");<NEW_LINE>checkNotNull(methodName, "methodName");<NEW_LINE>checkNotNull(status, "status");<NEW_LINE>checkNotNull(rpcId, "rpcId");<NEW_LINE>checkArgument(peerAddress == null || eventLogger == GrpcLogRecord.EventLogger.LOGGER_CLIENT, "peerAddress can only be specified for client");<NEW_LINE>PayloadBuilder<GrpcLogRecord.Metadata.Builder> pair = createMetadataProto(metadata, maxHeaderBytes);<NEW_LINE>GrpcLogRecord.Builder logEntryBuilder = createTimestamp().setSequenceId(seqId).setServiceName(serviceName).setMethodName(methodName).setEventType(EventType.GRPC_CALL_TRAILER).setEventLogger(eventLogger).setLogLevel(LogLevel.LOG_LEVEL_DEBUG).setMetadata(pair.payload).setPayloadSize(pair.size).setPayloadTruncated(pair.truncated).setStatusCode(status.getCode().value()).setRpcId(rpcId);<NEW_LINE>String statusDescription = status.getDescription();<NEW_LINE>if (statusDescription != null) {<NEW_LINE>logEntryBuilder.setStatusMessage(statusDescription);<NEW_LINE>}<NEW_LINE>byte[] <MASK><NEW_LINE>if (statusDetailBytes != null) {<NEW_LINE>logEntryBuilder.setStatusDetails(ByteString.copyFrom(statusDetailBytes));<NEW_LINE>}<NEW_LINE>if (peerAddress != null) {<NEW_LINE>logEntryBuilder.setPeerAddress(socketAddressToProto(peerAddress));<NEW_LINE>}<NEW_LINE>sink.write(logEntryBuilder.build());<NEW_LINE>}
statusDetailBytes = metadata.get(STATUS_DETAILS_KEY);
544,147
// GEN-LAST:event_btnAddMimeActionPerformed<NEW_LINE>private void btnRemoveMimeActionPerformed(java.awt.event.ActionEvent evt) {<NEW_LINE>// GEN-FIRST:event_btnRemoveMimeActionPerformed<NEW_LINE><MASK><NEW_LINE>if (selected == 0 || selected == mimeIdentifiers.size() + 1) {<NEW_LINE>return;<NEW_LINE>} else if (selected < mimeIdentifiers.size() + 1) {<NEW_LINE>mimeIdentifiers.remove(selected - 1);<NEW_LINE>} else {<NEW_LINE>extensionIdentifiers.remove(selected - mimeIdentifiers.size() - 2);<NEW_LINE>}<NEW_LINE>int totalSize = mimeIdentifiers.size() + extensionIdentifiers.size() + 2;<NEW_LINE>updateListModel(selected < totalSize ? selected : totalSize - 1);<NEW_LINE>boolean oldChanged = changed;<NEW_LINE>firePropertyChange(OptionsPanelController.PROP_CHANGED, oldChanged, true);<NEW_LINE>firePropertyChange(OptionsPanelController.PROP_VALID, null, null);<NEW_LINE>}
int selected = listIdentifiers.getSelectedIndex();
288,857
protected void listKeys(PrintStream out, PrintStream err, List<String> args) throws Exception {<NEW_LINE>final String[] usage = { "list-keys - ", "Usage: list-keys ", /* [-t mode-table] [-T key-table] */<NEW_LINE>" -? --help Show help" };<NEW_LINE>Options opt = Options.compile(usage).parse(args);<NEW_LINE>if (opt.isSet("help")) {<NEW_LINE>throw new HelpException(opt.usage());<NEW_LINE>}<NEW_LINE>String prefix = serverOptions.get(OPT_PREFIX);<NEW_LINE>keyMap.getBoundKeys().entrySet().stream().filter(e -> e.getValue() instanceof String).map(e -> {<NEW_LINE>String key = e.getKey();<NEW_LINE>String val = (String) e.getValue();<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append("bind-key -T ");<NEW_LINE>if (key.startsWith(prefix)) {<NEW_LINE>sb.append("prefix ");<NEW_LINE>key = key.<MASK><NEW_LINE>} else {<NEW_LINE>sb.append("root ");<NEW_LINE>}<NEW_LINE>sb.append(display(key));<NEW_LINE>while (sb.length() < 32) {<NEW_LINE>sb.append(" ");<NEW_LINE>}<NEW_LINE>sb.append(val);<NEW_LINE>return sb.toString();<NEW_LINE>}).sorted().forEach(out::println);<NEW_LINE>}
substring(prefix.length());
1,798,577
private void addEditor(File filename) {<NEW_LINE>final <MASK><NEW_LINE>if (filename != null) {<NEW_LINE>pane.loadSource(filename);<NEW_LINE>}<NEW_LINE>final Tab tab = new Tab();<NEW_LINE>tab.setContent(pane);<NEW_LINE>tab.setText(pane.getName());<NEW_LINE>EventHandler<Event> closeHandler = new EventHandler<Event>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void handle(Event e) {<NEW_LINE>if (pane.isModified()) {<NEW_LINE>pane.promptSave();<NEW_LINE>}<NEW_LINE>tabPane.getTabs().remove(tab);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>// JavaFX 2.2 (from Java 7) has no onCloseRequestProperty<NEW_LINE>if (JITWatchUI.IS_JAVA_FX2) {<NEW_LINE>tab.setOnClosed(closeHandler);<NEW_LINE>} else {<NEW_LINE>// Use reflection to call setOnCloseRequestProperty for Java 8<NEW_LINE>try {<NEW_LINE>MethodType mt = MethodType.methodType(void.class, EventHandler.class);<NEW_LINE>MethodHandle mh = MethodHandles.lookup().findVirtual(Tab.class, "setOnCloseRequest", mt);<NEW_LINE>// fails with invokeExact due to generic type erasure?<NEW_LINE>mh.invoke(tab, closeHandler);<NEW_LINE>} catch (Throwable t) {<NEW_LINE>logger.error("Exception: {}", t.getMessage(), t);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>tabPane.getTabs().add(tab);<NEW_LINE>pane.requestFocus();<NEW_LINE>setVMLanguage(pane);<NEW_LINE>saveEditorPaneConfig();<NEW_LINE>}
EditorPane pane = new EditorPane(this);
989,488
private T tranResultSet(final ResultSet rs, final T targetObject) throws SQLException {<NEW_LINE>ResultSetMetaData rsmd = rs.getMetaData();<NEW_LINE>int nrOfColumns = rsmd.getColumnCount();<NEW_LINE>List<String> <MASK><NEW_LINE>Map<String, Integer> resultColumnIndexMap = this.tableMapping.getCaseSensitivity() == CaseSensitivityType.Fuzzy ? new LinkedCaseInsensitiveMap<>() : new LinkedHashMap<>();<NEW_LINE>for (int i = 1; i <= nrOfColumns; i++) {<NEW_LINE>String colName = rsmd.getColumnName(i);<NEW_LINE>if (!resultColumnIndexMap.containsKey(colName)) {<NEW_LINE>resultColumnIndexMap.put(colName, i);<NEW_LINE>resultColumns.add(colName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>//<NEW_LINE>for (String columnName : this.columnNames) {<NEW_LINE>if (!resultColumnIndexMap.containsKey(columnName)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>int realIndex = resultColumnIndexMap.get(columnName);<NEW_LINE>List<String> propertyNames = this.columnPropertyMapping.get(columnName);<NEW_LINE>for (String propertyName : propertyNames) {<NEW_LINE>ColumnMapping mapping = this.tableMapping.getMapping(propertyName);<NEW_LINE>TypeHandler<?> realHandler = mapping.getTypeHandler();<NEW_LINE>Object result = realHandler.getResult(rs, realIndex);<NEW_LINE>//<NEW_LINE>Class<?> propertyType = BeanUtils.getPropertyOrFieldType(this.mapperClass, propertyName);<NEW_LINE>Object convert = ConverterUtils.convert(propertyType, result);<NEW_LINE>BeanUtils.writePropertyOrField(targetObject, propertyName, convert);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return targetObject;<NEW_LINE>}
resultColumns = new ArrayList<>();
1,306,865
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {<NEW_LINE>Context context = unlockTorIpsFragment.getContext();<NEW_LINE>if (context == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int position = getAbsoluteAdapterPosition();<NEW_LINE>if (position < 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>DomainIpEntity domainIp = getItem(position);<NEW_LINE>setActive(position, isChecked);<NEW_LINE>llHostIP.setEnabled(isChecked);<NEW_LINE>setItemIpText(domainIp);<NEW_LINE>if (domainIp instanceof IpEntity) {<NEW_LINE>unlockTorIpsFragment.viewModel.saveIpActiveInPreferences(((IpEntity) domainIp<MASK><NEW_LINE>} else if (domainIp instanceof DomainEntity) {<NEW_LINE>unlockTorIpsFragment.viewModel.saveDomainActiveInPreferences(((DomainEntity) domainIp).getDomain(), isChecked);<NEW_LINE>}<NEW_LINE>unlockTorIpsFragment.viewModel.addDomainIp(domainIp);<NEW_LINE>}
).getIp(), isChecked);
1,835,948
public MethodVisitor visitMethod(int access, String methodName, String desc, String signature, String[] exceptions) {<NEW_LINE>JvmGraph.Type.MethodType methodType = JvmGraph.Type.rawMethodType(desc);<NEW_LINE>VName methodVName = jvmGraph.emitMethodNode(corpusPath, classType, methodName, methodType);<NEW_LINE>entrySets.emitEdge(methodVName, EdgeKind.CHILDOF, classVName);<NEW_LINE>return new MethodVisitor(ASM_API_LEVEL) {<NEW_LINE><NEW_LINE>private int parameterIndex = 0;<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void visitParameter(String parameterName, int access) {<NEW_LINE>VName parameterVName = jvmGraph.emitParameterNode(corpusPath, classType, methodName, methodType, parameterIndex);<NEW_LINE>entrySets.emitEdge(parameterVName, EdgeKind.CHILDOF, methodVName);<NEW_LINE>entrySets.emitEdge(methodVName, EdgeKind.PARAM, parameterVName, parameterIndex);<NEW_LINE>parameterIndex++;<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
super.visitParameter(parameterName, access);
308,823
public void run(RegressionEnvironment env) {<NEW_LINE>String epl = "@name('s0') select * from SupportBean#expr_batch(udf(theString, view_reference, expired_count))";<NEW_LINE>env.compileDeployAddListenerMileZero(epl, "s0");<NEW_LINE>ViewExpressionWindow.LocalUDF.setResult(true);<NEW_LINE>env.sendEventBean(new SupportBean("E1", 0));<NEW_LINE>env.assertThat(() -> {<NEW_LINE>assertEquals("E1", ViewExpressionWindow.LocalUDF.getKey());<NEW_LINE>assertEquals(0, (int) ViewExpressionWindow.LocalUDF.getExpiryCount());<NEW_LINE>assertNotNull(ViewExpressionWindow.LocalUDF.getViewref());<NEW_LINE>});<NEW_LINE>env.sendEventBean(new SupportBean("E2", 0));<NEW_LINE>ViewExpressionWindow.LocalUDF.setResult(false);<NEW_LINE>env.sendEventBean(new SupportBean("E3", 0));<NEW_LINE>env.assertThat(() -> {<NEW_LINE>assertEquals("E3", ViewExpressionWindow.LocalUDF.getKey());<NEW_LINE>assertEquals(0, (int) ViewExpressionWindow.LocalUDF.getExpiryCount());<NEW_LINE>assertNotNull(<MASK><NEW_LINE>});<NEW_LINE>env.undeployAll();<NEW_LINE>}
ViewExpressionWindow.LocalUDF.getViewref());
1,521,947
private PageChangeHolder createPageChangeHolder(JFieldRef idRef, TypeMirror viewParameterType, boolean hasAddOnPageChangeListenerMethod) {<NEW_LINE>AbstractJClass viewClass;<NEW_LINE>JDefinedClass onPageChangeListenerClass;<NEW_LINE>if (getProcessingEnvironment().getElementUtils().getTypeElement(CanonicalNameConstants.ANDROIDX_VIEW_PAGER) == null) {<NEW_LINE>viewClass = getClasses().VIEW_PAGER;<NEW_LINE>onPageChangeListenerClass = getCodeModel().anonymousClass(getClasses().PAGE_CHANGE_LISTENER);<NEW_LINE>} else {<NEW_LINE>viewClass = getClasses().ANDROIDX_VIEW_PAGER;<NEW_LINE>onPageChangeListenerClass = getCodeModel().anonymousClass(getClasses().ANDROIDX_PAGE_CHANGE_LISTENER);<NEW_LINE>}<NEW_LINE>if (viewParameterType != null) {<NEW_LINE>viewClass = getJClass(viewParameterType.toString());<NEW_LINE>}<NEW_LINE>JBlock onViewChangedBody = getOnViewChangedBodyInjectionBlock().blockSimple();<NEW_LINE>JVar viewVariable = onViewChangedBody.decl(FINAL, viewClass, "view", cast(viewClass, findViewById(idRef)));<NEW_LINE>JBlock block = onViewChangedBody._if(viewVariable.ne(JExpr._null()))._then();<NEW_LINE>if (hasAddOnPageChangeListenerMethod) {<NEW_LINE>block.invoke(viewVariable, "addOnPageChangeListener").arg(_new(onPageChangeListenerClass));<NEW_LINE>} else {<NEW_LINE>block.invoke(viewVariable, "setOnPageChangeListener").arg(_new(onPageChangeListenerClass));<NEW_LINE>}<NEW_LINE>return new <MASK><NEW_LINE>}
PageChangeHolder(this, viewVariable, onPageChangeListenerClass);
838,653
private Map<UUID, BigDecimal> extractIdsWithAmountFromProperties(final Iterable<PluginProperty> properties) {<NEW_LINE>final PluginProperty prop = getPluginProperty(properties, PROP_IPCD_REFUND_IDS_WITH_AMOUNT_KEY);<NEW_LINE>if (prop == null) {<NEW_LINE>return ImmutableMap.<UUID, BigDecimal>of();<NEW_LINE>}<NEW_LINE>// The deserialization may not recreate the map we expect, i.e Map<UUID, BigDecimal>, so we convert each key/value by hand<NEW_LINE>// See https://github.com/killbill/killbill/issues/1453<NEW_LINE>final Map<UUID, BigDecimal> res = new HashMap<>();<NEW_LINE>final Map m = (Map) prop.getValue();<NEW_LINE>for (final Object k : m.keySet()) {<NEW_LINE>UUID uuid;<NEW_LINE>if (k instanceof String) {<NEW_LINE>uuid = UUID.fromString((String) k);<NEW_LINE>} else if (k instanceof UUID) {<NEW_LINE>uuid = (UUID) k;<NEW_LINE>} else {<NEW_LINE>throw new IllegalStateException(String.format("Failed to deserialize plugin property map for adjustments: Invalid format for UUID, type=%s", k.getClass().getName()));<NEW_LINE>}<NEW_LINE>final Object <MASK><NEW_LINE>BigDecimal val;<NEW_LINE>if (v instanceof BigDecimal) {<NEW_LINE>val = (BigDecimal) v;<NEW_LINE>} else if (v instanceof String) {<NEW_LINE>val = new BigDecimal((String) v);<NEW_LINE>} else if (v instanceof Integer) {<NEW_LINE>val = new BigDecimal(((Integer) v).toString());<NEW_LINE>} else if (v == null) {<NEW_LINE>// Null is allowed to default ot item#amount<NEW_LINE>val = null;<NEW_LINE>} else {<NEW_LINE>throw new IllegalStateException(String.format("Failed to deserialize plugin property map for adjustments: Invalid format for BigDecimal, type=%s", v.getClass().getName()));<NEW_LINE>}<NEW_LINE>res.put(uuid, val);<NEW_LINE>}<NEW_LINE>return res;<NEW_LINE>}
v = m.get(k);
1,233,589
private static List<DomainAlwaysInScopeMatcher> convertOldDomainsInScopeOption(String oldDomainsInScope) {<NEW_LINE>if (oldDomainsInScope == null || oldDomainsInScope.isEmpty()) {<NEW_LINE>return Collections.emptyList();<NEW_LINE>}<NEW_LINE>ArrayList<DomainAlwaysInScopeMatcher> domainsInScope = new ArrayList<>();<NEW_LINE>String[] <MASK><NEW_LINE>for (String name : names) {<NEW_LINE>String domain = name.trim();<NEW_LINE>if (!domain.isEmpty()) {<NEW_LINE>if (domain.contains("*")) {<NEW_LINE>domain = domain.replace(".", "\\.").replace("+", "\\+").replace("*", ".*?");<NEW_LINE>try {<NEW_LINE>Pattern pattern = Pattern.compile(domain, Pattern.CASE_INSENSITIVE);<NEW_LINE>domainsInScope.add(new DomainAlwaysInScopeMatcher(pattern));<NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>log.error("Failed to migrate a domain always in scope, name: " + name, e);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>domainsInScope.add(new DomainAlwaysInScopeMatcher(domain));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>domainsInScope.trimToSize();<NEW_LINE>return domainsInScope;<NEW_LINE>}
names = oldDomainsInScope.split(";");
387,234
public static <T> ToDouble<T> floatPowInt(ToFloat<T> expression, int power) {<NEW_LINE>switch(power) {<NEW_LINE>case 0:<NEW_LINE>return ToDouble.constant(1);<NEW_LINE>case 1:<NEW_LINE>return expression.asDouble();<NEW_LINE>case 2:<NEW_LINE>return new IntPower<T, ToFloat<T>>(expression, 2) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public double applyAsDouble(T object) {<NEW_LINE>final float value = inner.applyAsFloat(object);<NEW_LINE>return value * value;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>case 3:<NEW_LINE>return new IntPower<T, ToFloat<T>>(expression, 3) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public double applyAsDouble(T object) {<NEW_LINE>final float <MASK><NEW_LINE>return value * value * value;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>case -1:<NEW_LINE>return new IntPower<T, ToFloat<T>>(expression, -1) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public double applyAsDouble(T object) {<NEW_LINE>return 1 / inner.applyAsFloat(object);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>default:<NEW_LINE>return new IntPower<T, ToFloat<T>>(expression, power) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public double applyAsDouble(T object) {<NEW_LINE>return Math.pow(inner.applyAsFloat(object), this.power);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}<NEW_LINE>}
value = inner.applyAsFloat(object);
1,179,791
public void enterBcl_expanded(Bcl_expandedContext ctx) {<NEW_LINE>String name = toString(ctx.name);<NEW_LINE>if (Strings.isNullOrEmpty(name)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String regex = ctx.quoted != null ? ctx.quoted.text != null ? ctx.quoted.text.getText() : "" : ctx.regex.getText();<NEW_LINE>BgpCommunityList communityList = _frr.getBgpCommunityLists().computeIfAbsent(name, BgpCommunityListExpanded::new);<NEW_LINE>if (!(communityList instanceof BgpCommunityListExpanded)) {<NEW_LINE>warn(ctx, String.format<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>BgpCommunityListExpanded communityListExpanded = (BgpCommunityListExpanded) communityList;<NEW_LINE>communityListExpanded.getLines().add(new BgpCommunityListExpandedLine(toLineAction(ctx.action), regex));<NEW_LINE>_vc.defineStructure(BGP_COMMUNITY_LIST_EXPANDED, name, ctx);<NEW_LINE>}
("Cannot define expanded community-list '%s' because another community-list with that" + " name but a different type already exists.", name));
459,649
public static double[] makeApproximateDiploidLog10LikelihoodsFromGQ(Genotype g, int nAlleles) {<NEW_LINE>Utils.validate(g.getPloidy() == 2, "This method can only be used to approximate likelihoods for diploid genotypes");<NEW_LINE>Utils.validate(g.hasGQ(), "Genotype must have GQ in order to approximate PLs");<NEW_LINE>final int[] perSampleIndexesOfRelevantAlleles = new int[nAlleles];<NEW_LINE>Arrays.fill(perSampleIndexesOfRelevantAlleles, 1);<NEW_LINE>// ref still maps to ref<NEW_LINE>perSampleIndexesOfRelevantAlleles[0] = 0;<NEW_LINE>// use these values for diploid ref/ref, ref/alt, alt/alt likelihoods<NEW_LINE>final int gq = g.getGQ();<NEW_LINE>final int ploidy = g.getPloidy();<NEW_LINE>// here we supply likelihoods for ref/ref, ref/alt, and alt/alt and then generalize to multiallic PLs if necessary<NEW_LINE>final int[] approxLikelihoods = { <MASK><NEW_LINE>// map likelihoods for any other alts to biallelic ref/alt likelihoods above<NEW_LINE>// probably horribly slow<NEW_LINE>final int[] genotypeIndexMapByPloidy = GL_CALCS.getInstance(ploidy, nAlleles).genotypeIndexMap(perSampleIndexesOfRelevantAlleles, GL_CALCS);<NEW_LINE>final int[] PLs = new int[genotypeIndexMapByPloidy.length];<NEW_LINE>for (int i = 0; i < PLs.length; i++) {<NEW_LINE>PLs[i] = approxLikelihoods[genotypeIndexMapByPloidy[i]];<NEW_LINE>}<NEW_LINE>// fromPLs converts from Phred-space back to log10-space<NEW_LINE>return GenotypeLikelihoods.fromPLs(PLs).getAsVector();<NEW_LINE>}
0, gq, PLOIDY_2_HOM_VAR_SCALE_FACTOR * gq };
1,031,780
public static GridFieldVO createParameter(final Properties ctx, final int WindowNo, final int tabNo, final ResultSet rs) {<NEW_LINE>final AdWindowId adWindowId = null;<NEW_LINE>final int adTabId = 0;<NEW_LINE>final boolean tabReadOnly = false;<NEW_LINE>// because it's used only in Swing UI<NEW_LINE>final boolean applyRolePermissions = true;<NEW_LINE>final GridFieldVO vo = new GridFieldVO(ctx, WindowNo, tabNo, adWindowId, adTabId, tabReadOnly, applyRolePermissions);<NEW_LINE>vo.isProcess = true;<NEW_LINE>vo.isProcessParameterTo = false;<NEW_LINE>vo.IsDisplayed = true;<NEW_LINE>vo.isDisplayedGrid = false;<NEW_LINE>vo.IsReadOnly = false;<NEW_LINE>vo.IsUpdateable = true;<NEW_LINE>try {<NEW_LINE>vo.AD_Table_ID = 0;<NEW_LINE>// metas<NEW_LINE>vo.AD_Field_ID = 0;<NEW_LINE>// metas-tsa: we cannot use the AD_Column_ID to store the AD_Process_Para_ID because we get inconsistencies elsewhere // rs.getInt("AD_Process_Para_ID");<NEW_LINE>vo.AD_Column_ID = 0;<NEW_LINE>vo.ColumnName = rs.getString("ColumnName");<NEW_LINE>vo.header = rs.getString("Name");<NEW_LINE>vo.description = rs.getString("Description");<NEW_LINE>vo.help = rs.getString("Help");<NEW_LINE>vo.displayType = rs.getInt("AD_Reference_ID");<NEW_LINE>vo.IsMandatory = "Y".equals<MASK><NEW_LINE>vo.IsMandatoryDB = vo.IsMandatory;<NEW_LINE>vo.fieldLength = rs.getInt("FieldLength");<NEW_LINE>vo.layoutConstraints = GridFieldLayoutConstraints.builder().setDisplayLength(vo.fieldLength).build();<NEW_LINE>vo.DefaultValue = rs.getString("DefaultValue");<NEW_LINE>vo.DefaultValue2 = rs.getString("DefaultValue2");<NEW_LINE>vo.VFormat = rs.getString("VFormat");<NEW_LINE>vo.formatPattern = "";<NEW_LINE>vo.ValueMin = rs.getString("ValueMin");<NEW_LINE>vo.ValueMax = rs.getString("ValueMax");<NEW_LINE>vo.isRange = rs.getString("IsRange").equals("Y");<NEW_LINE>// metas: tsa: US745<NEW_LINE>vo.IsEncryptedField = "Y".equals(rs.getString("IsEncrypted"));<NEW_LINE>//<NEW_LINE>vo.AD_Reference_Value_ID = rs.getInt("AD_Reference_Value_ID");<NEW_LINE>vo.autocomplete = "Y".equals(rs.getString("IsAutoComplete"));<NEW_LINE>// metas: 03271<NEW_LINE>vo.AD_Val_Rule_ID = rs.getInt("AD_Val_Rule_ID");<NEW_LINE>vo.ReadOnlyLogic = rs.getString("ReadOnlyLogic");<NEW_LINE>vo.DisplayLogic = rs.getString("DisplayLogic");<NEW_LINE>vo.fieldEntityType = rs.getString("FieldEntityType");<NEW_LINE>} catch (SQLException e) {<NEW_LINE>logger.error("createParameter", e);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>vo.initFinish();<NEW_LINE>if (vo.DefaultValue2 == null) {<NEW_LINE>vo.DefaultValue2 = "";<NEW_LINE>}<NEW_LINE>return vo;<NEW_LINE>}
(rs.getString("IsMandatory"));
701,868
public List<DataFileColumn> prepareData(final DataFileDto readedData, final FileParserMessage msg, final Boolean readFirstColumnAsColumnName) {<NEW_LINE>final List<DataValueType> columnTypes = getRowAsDataValueTypeList(msg, readedData.getRowTypes());<NEW_LINE>final List<DataFileColumn> dataFileColumns = new ArrayList<>();<NEW_LINE>final List<RowDto> rows = readedData.getRows();<NEW_LINE>for (int i = 0; i < columnTypes.size(); i++) {<NEW_LINE>String name = null;<NEW_LINE>if (readFirstColumnAsColumnName) {<NEW_LINE>name = rows.get(0).getColumns().get(i).getValue();<NEW_LINE>}<NEW_LINE>final List<DataValue> dataValues = new ArrayList<>();<NEW_LINE>int startIndexColumn = readFirstColumnAsColumnName ? 1 : 0;<NEW_LINE>for (int j = startIndexColumn; j < rows.size(); j++) {<NEW_LINE>final RowDto rowDto = rows.get(j);<NEW_LINE>dataValues.add(parseAs(columnTypes.get(i), rowDto.getColumns().get(i).getValue().trim()));<NEW_LINE>}<NEW_LINE>dataFileColumns.add((DataFileColumn) DataFileColumn.builder().dataValueType(columnTypes.get(i)).values(dataValues).name(name).position<MASK><NEW_LINE>}<NEW_LINE>return dataFileColumns;<NEW_LINE>}
(i).build());
1,395,782
private void assertConsistency(boolean caseSensitive, @Nonnull Object details) {<NEW_LINE>if (!CHECK || ApplicationInfoImpl.isInPerformanceTest())<NEW_LINE>return;<NEW_LINE><MASK><NEW_LINE>if (childrenIds.length == 0)<NEW_LINE>return;<NEW_LINE>CharSequence prevName = mySegment.vfsData.getNameByFileId(childrenIds[0]);<NEW_LINE>for (int i = 1; i < childrenIds.length; i++) {<NEW_LINE>int id = childrenIds[i];<NEW_LINE>int prev = childrenIds[i - 1];<NEW_LINE>CharSequence name = mySegment.vfsData.getNameByFileId(id);<NEW_LINE>int cmp = compareNames(name, prevName, caseSensitive);<NEW_LINE>prevName = name;<NEW_LINE>if (cmp <= 0) {<NEW_LINE>error(verboseToString(mySegment.vfsData.getFileById(prev, this)) + " is wrongly placed before " + verboseToString(mySegment.vfsData.getFileById(id, this)), getArraySafely(), details);<NEW_LINE>}<NEW_LINE>synchronized (myData) {<NEW_LINE>if (myData.isAdoptedName(name)) {<NEW_LINE>try {<NEW_LINE>error("In " + verboseToString(this) + " file '" + name + "' is both child and adopted", getArraySafely(), "Adopted: " + myData.getAdoptedNames() + ";\n " + details);<NEW_LINE>} finally {<NEW_LINE>myData.removeAdoptedName(name);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
int[] childrenIds = myData.myChildrenIds;
700,772
public void testCustomValueExtractorOnValidator() throws Exception {<NEW_LINE>StringWrapperValueExtractor.counter = 0;<NEW_LINE>//<NEW_LINE>Validator //<NEW_LINE>validator = //<NEW_LINE>atResourceVF.usingContext().//<NEW_LINE>addValueExtractor(//<NEW_LINE>new StringWrapperValueExtractor()).//<NEW_LINE>addValueExtractor(new <MASK><NEW_LINE>// Test with valid data.<NEW_LINE>valExtractBean.intWrapper = new IntWrapper(1);<NEW_LINE>valExtractBean.stringWrapper = new StringWrapper("abc");<NEW_LINE>Set<ConstraintViolation<ValueExtractorBean>> violations = validator.validate(valExtractBean);<NEW_LINE>Assert.assertNotNull(violations);<NEW_LINE>StringBuffer msg = new StringBuffer();<NEW_LINE>for (ConstraintViolation<ValueExtractorBean> cv : violations) {<NEW_LINE>msg.append("\n\t" + cv.toString());<NEW_LINE>}<NEW_LINE>Assert.assertEquals(0, violations.size());<NEW_LINE>Assert.assertEquals(1, StringWrapperValueExtractor.counter);<NEW_LINE>// Test with invalid data.<NEW_LINE>valExtractBean.stringWrapper = new StringWrapper(null);<NEW_LINE>violations = validator.validate(valExtractBean);<NEW_LINE>Assert.assertNotNull(violations);<NEW_LINE>msg = new StringBuffer();<NEW_LINE>for (ConstraintViolation<ValueExtractorBean> cv : violations) {<NEW_LINE>msg.append("\n\t" + cv.toString());<NEW_LINE>}<NEW_LINE>Assert.assertEquals(1, violations.size());<NEW_LINE>Assert.assertEquals(2, StringWrapperValueExtractor.counter);<NEW_LINE>}
IntWrapperValueExtractor()).getValidator();
950,306
private static OpcPackage load(PackageIdentifier pkgIdentifier, final InputStream inputStream, String password) throws Docx4JException {<NEW_LINE>// try to detect the type of file using a bufferedinputstream<NEW_LINE>final BufferedInputStream bis = new BufferedInputStream(inputStream);<NEW_LINE>bis.mark(0);<NEW_LINE>final byte[] firstTwobytes = new byte[2];<NEW_LINE>int read = 0;<NEW_LINE>try {<NEW_LINE>read = bis.read(firstTwobytes);<NEW_LINE>bis.reset();<NEW_LINE>} catch (final IOException e) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (read != 2) {<NEW_LINE>throw new Docx4JException("Error reading from the stream (no bytes available)");<NEW_LINE>}<NEW_LINE>if (firstTwobytes[0] == 'P' && firstTwobytes[1] == 'K') {<NEW_LINE>// 50 4B<NEW_LINE>return OpcPackage.load(pkgIdentifier, bis, Filetype.ZippedPackage, null);<NEW_LINE>} else if (firstTwobytes[0] == (byte) 0xD0 && firstTwobytes[1] == (byte) 0xCF) {<NEW_LINE>// password protected docx is a compound file, with signature D0 CF 11 E0 A1 B1 1A E1<NEW_LINE>log.info("Detected compound file");<NEW_LINE>return OpcPackage.load(pkgIdentifier, bis, Filetype.Compound, password);<NEW_LINE>} else {<NEW_LINE>// Assume..<NEW_LINE>log.info("Assuming Flat OPC XML");<NEW_LINE>return OpcPackage.load(pkgIdentifier, bis, Filetype.FlatOPC, null);<NEW_LINE>}<NEW_LINE>}
throw new Docx4JException("Error reading from the stream", e);
949,382
public static CTFramePr apply(CTFramePr source, CTFramePr destination) {<NEW_LINE>if (!isEmpty(source)) {<NEW_LINE>if (destination == null)<NEW_LINE>destination = Context<MASK><NEW_LINE>destination.setDropCap(source.getDropCap());<NEW_LINE>destination.setLines(apply(source.getLines(), destination.getLines()));<NEW_LINE>destination.setW(apply(source.getW(), destination.getW()));<NEW_LINE>destination.setH(apply(source.getH(), destination.getH()));<NEW_LINE>destination.setVSpace(apply(source.getVSpace(), destination.getVSpace()));<NEW_LINE>destination.setHSpace(apply(source.getHSpace(), destination.getHSpace()));<NEW_LINE>destination.setWrap(source.getWrap());<NEW_LINE>destination.setHAnchor(source.getHAnchor());<NEW_LINE>destination.setVAnchor(source.getVAnchor());<NEW_LINE>destination.setX(apply(source.getX(), destination.getX()));<NEW_LINE>destination.setXAlign(source.getXAlign());<NEW_LINE>destination.setY(apply(source.getY(), destination.getY()));<NEW_LINE>destination.setYAlign(source.getYAlign());<NEW_LINE>destination.setHRule(source.getHRule());<NEW_LINE>destination.setAnchorLock(source.isAnchorLock());<NEW_LINE>}<NEW_LINE>return destination;<NEW_LINE>}
.getWmlObjectFactory().createCTFramePr();
292,716
public void write(JmeExporter ex) throws IOException {<NEW_LINE>super.write(ex);<NEW_LINE>OutputCapsule oc = ex.getCapsule(this);<NEW_LINE>oc.<MASK><NEW_LINE>oc.write(eventDispatchImpulseThreshold, "eventDispatchImpulseThreshold", 0f);<NEW_LINE>int count = countLinkedBones();<NEW_LINE>String[] linkedBoneNames = new String[count];<NEW_LINE>RangeOfMotion[] roms = new RangeOfMotion[count];<NEW_LINE>float[] blConfigs = new float[count];<NEW_LINE>int i = 0;<NEW_LINE>for (Map.Entry<String, Float> entry : blConfigMap.entrySet()) {<NEW_LINE>linkedBoneNames[i] = entry.getKey();<NEW_LINE>roms[i] = jointMap.get(entry.getKey());<NEW_LINE>blConfigs[i] = entry.getValue();<NEW_LINE>++i;<NEW_LINE>}<NEW_LINE>oc.write(linkedBoneNames, "linkedBoneNames", null);<NEW_LINE>oc.write(roms, "linkedBoneJoints", null);<NEW_LINE>oc.write(blConfigs, "blConfigs", null);<NEW_LINE>oc.write(torsoMass, "torsoMass", 1f);<NEW_LINE>oc.write(gravityVector, "gravity", null);<NEW_LINE>}
write(damping, "damping", 0.6f);
594,198
public OpenApi after(Context<? extends Trait> context, OpenApi openapi) {<NEW_LINE>// Find each known request validator on operation shapes.<NEW_LINE>Set<String> validators = context.getModel().shapes(OperationShape.class).flatMap(shape -> OptionalUtils.stream(shape.getTrait(RequestValidatorTrait.class))).map(RequestValidatorTrait::getValue).filter(KNOWN_VALIDATORS::containsKey).<MASK><NEW_LINE>// Check if the service has a request validator.<NEW_LINE>String serviceValidator = null;<NEW_LINE>if (context.getService().getTrait(RequestValidatorTrait.class).isPresent()) {<NEW_LINE>serviceValidator = context.getService().getTrait(RequestValidatorTrait.class).get().getValue();<NEW_LINE>validators.add(serviceValidator);<NEW_LINE>}<NEW_LINE>if (validators.isEmpty()) {<NEW_LINE>return openapi;<NEW_LINE>}<NEW_LINE>OpenApi.Builder builder = openapi.toBuilder();<NEW_LINE>if (serviceValidator != null) {<NEW_LINE>builder.putExtension(REQUEST_VALIDATOR, serviceValidator);<NEW_LINE>}<NEW_LINE>// Add the known request validators to the OpenAPI model.<NEW_LINE>ObjectNode.Builder objectBuilder = Node.objectNodeBuilder();<NEW_LINE>for (String validator : validators) {<NEW_LINE>objectBuilder.withMember(validator, KNOWN_VALIDATORS.get(validator));<NEW_LINE>}<NEW_LINE>builder.putExtension(REQUEST_VALIDATORS, objectBuilder.build());<NEW_LINE>return builder.build();<NEW_LINE>}
collect(Collectors.toSet());
593,430
protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>setContentView(R.layout.activity_main);<NEW_LINE>// authentication with an API key or named user is required to access basemaps and other<NEW_LINE>// location services<NEW_LINE>ArcGISRuntimeEnvironment.setApiKey(BuildConfig.API_KEY);<NEW_LINE>// inflate MapView from layout<NEW_LINE>mMapView = findViewById(R.id.mapView);<NEW_LINE>// initialize map with basemap<NEW_LINE>ArcGISMap map = new ArcGISMap(BasemapStyle.ARCGIS_OCEANS);<NEW_LINE>// assign map to the map view<NEW_LINE>mMapView.setMap(map);<NEW_LINE>// initialize service feature table to be queried<NEW_LINE>FeatureTable featureTable = new ServiceFeatureTable(getResources().getString(R.string.wildfire_feature_server));<NEW_LINE>// create query parameters<NEW_LINE>QueryParameters queryParams = new QueryParameters();<NEW_LINE>// 1=1 will give all the features from the table<NEW_LINE>queryParams.setWhereClause("1=1");<NEW_LINE>// query feature from the table<NEW_LINE>final ListenableFuture<FeatureQueryResult> queryResult = featureTable.queryFeaturesAsync(queryParams);<NEW_LINE>queryResult.addDoneListener(() -> {<NEW_LINE>try {<NEW_LINE>// create a feature collection table from the query results<NEW_LINE>FeatureCollectionTable featureCollectionTable = new FeatureCollectionTable(queryResult.get());<NEW_LINE>// create a feature collection from the above feature collection table<NEW_LINE>FeatureCollection featureCollection = new FeatureCollection();<NEW_LINE>featureCollection.getTables().add(featureCollectionTable);<NEW_LINE>// create a feature collection layer<NEW_LINE><MASK><NEW_LINE>// add the layer to the operational layers array<NEW_LINE>mMapView.getMap().getOperationalLayers().add(featureCollectionLayer);<NEW_LINE>} catch (InterruptedException | ExecutionException e) {<NEW_LINE>Log.e(TAG, "Error in FeatureQueryResult: " + e.getMessage());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
FeatureCollectionLayer featureCollectionLayer = new FeatureCollectionLayer(featureCollection);
907,733
private Mono<Response<Flux<ByteBuffer>>> deleteWithResponseAsync(String resourceGroupName, String privateEndpointName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (privateEndpointName == null) {<NEW_LINE>return Mono.<MASK><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 = "2021-05-01";<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.delete(this.client.getEndpoint(), resourceGroupName, privateEndpointName, apiVersion, this.client.getSubscriptionId(), accept, context);<NEW_LINE>}
error(new IllegalArgumentException("Parameter privateEndpointName is required and cannot be null."));
1,135,380
private HttpRequest.Builder findPetsByTagsRequestBuilder(Set<String> tags) throws ApiException {<NEW_LINE>// verify the required parameter 'tags' is set<NEW_LINE>if (tags == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'tags' when calling findPetsByTags");<NEW_LINE>}<NEW_LINE>HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();<NEW_LINE>String localVarPath = "/pet/findByTags";<NEW_LINE>List<Pair> <MASK><NEW_LINE>localVarQueryParams.addAll(ApiClient.parameterToPairs("csv", "tags", tags));<NEW_LINE>if (!localVarQueryParams.isEmpty()) {<NEW_LINE>StringJoiner queryJoiner = new StringJoiner("&");<NEW_LINE>localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue()));<NEW_LINE>localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString()));<NEW_LINE>} else {<NEW_LINE>localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));<NEW_LINE>}<NEW_LINE>localVarRequestBuilder.header("Accept", "application/xml, application/json");<NEW_LINE>localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());<NEW_LINE>if (memberVarReadTimeout != null) {<NEW_LINE>localVarRequestBuilder.timeout(memberVarReadTimeout);<NEW_LINE>}<NEW_LINE>if (memberVarInterceptor != null) {<NEW_LINE>memberVarInterceptor.accept(localVarRequestBuilder);<NEW_LINE>}<NEW_LINE>return localVarRequestBuilder;<NEW_LINE>}
localVarQueryParams = new ArrayList<>();
1,541,484
private FieldMember searchType(ReloadableType rtype, String fieldname) {<NEW_LINE>if (rtype != null) {<NEW_LINE>TypeDescriptor td = rtype.getLatestTypeDescriptor();<NEW_LINE>FieldMember field = td.getField(fieldname);<NEW_LINE>if (field != null) {<NEW_LINE>return field;<NEW_LINE>}<NEW_LINE>String[] interfaces = td.getSuperinterfacesName();<NEW_LINE>if (interfaces != null) {<NEW_LINE>for (String intface : interfaces) {<NEW_LINE>ReloadableType itype = typeRegistry.getReloadableType(intface);<NEW_LINE>if (intface != null) {<NEW_LINE><MASK><NEW_LINE>if (field != null) {<NEW_LINE>return field;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ReloadableType stype = typeRegistry.getReloadableType(td.getSupertypeName());<NEW_LINE>if (stype != null) {<NEW_LINE>return searchType(stype, fieldname);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
field = searchType(itype, fieldname);
1,797,826
final DescribeExplainabilityResult executeDescribeExplainability(DescribeExplainabilityRequest describeExplainabilityRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeExplainabilityRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeExplainabilityRequest> request = null;<NEW_LINE>Response<DescribeExplainabilityResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeExplainabilityRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeExplainabilityRequest));<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, "forecast");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeExplainability");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeExplainabilityResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeExplainabilityResultJsonUnmarshaller());<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);
198,290
public void accept(CodeVisitor visitor) {<NEW_LINE>if (null != method_owner_) {<NEW_LINE>method_owner_.accept(visitor);<NEW_LINE>}<NEW_LINE>String uniqueMethodName = visitor.visitMethodDefinition(methodName_, parameters_.size(), (null != asterisk_parameter_), default_parameters_.size(), (null != method_owner_));<NEW_LINE>for (String p : parameters_) {<NEW_LINE>visitor.visitMethodDefinitionParameter(p);<NEW_LINE>}<NEW_LINE>if (null != asterisk_parameter_) {<NEW_LINE>visitor.visitMethodDefinitionAsteriskParameter(asterisk_parameter_, parameters_.size());<NEW_LINE>}<NEW_LINE>if (null != block_parameter_) {<NEW_LINE>visitor.visitMethodDefinitionBlockParameter(block_parameter_);<NEW_LINE>}<NEW_LINE>int i = parameters_.size() - default_parameters_.size();<NEW_LINE>if (!default_parameters_.isEmpty()) {<NEW_LINE>visitor.visitMethodDefinitionDefaultParameters(default_parameters_.size());<NEW_LINE>for (Expression e : default_parameters_) {<NEW_LINE>Object next_label = visitor.visitMethodDefinitionDefaultParameterBegin(i);<NEW_LINE>e.accept(visitor);<NEW_LINE>visitor.visitMethodDefinitionDefaultParameterEnd(next_label);<NEW_LINE>++i;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (null != bodyStatement_) {<NEW_LINE>bodyStatement_.accept(visitor);<NEW_LINE>}<NEW_LINE>visitor.visitMethodDefinitionEnd((null != bodyStatement_) ? <MASK><NEW_LINE>int firstLine = this.getPosition();<NEW_LINE>int lastLine = firstLine;<NEW_LINE>if (bodyStatement_ != null) {<NEW_LINE>lastLine = bodyStatement_.getLastLine();<NEW_LINE>}<NEW_LINE>String scriptName = extractScriptName(uniqueMethodName);<NEW_LINE>BlockFarm.markMethod(scriptName, uniqueMethodName, new int[] { firstLine, lastLine });<NEW_LINE>}
bodyStatement_.lastStatementHasReturnValue() : false);
1,645,005
private void updateSliderPosition(int change, JStorageSlider source) {<NEW_LINE>int remaining = change;<NEW_LINE>while (remaining != 0) {<NEW_LINE>// Get the currently indexed slider<NEW_LINE>JStorageSlider slider = storageSliders.get(sliderIndex);<NEW_LINE>// If it's not the slider that fired the event<NEW_LINE>if (slider != source) {<NEW_LINE>// Check we don't go over the upper and lower bounds<NEW_LINE>if (remaining < 0 || (remaining > 0 && slider.getValue() > 0)) {<NEW_LINE>// Adjust the currently selected slider by +/- 1<NEW_LINE>int adjustment = Integer.signum(remaining);<NEW_LINE>slider.setValue(<MASK><NEW_LINE>remaining -= adjustment;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Select the next slider in the list of sliders<NEW_LINE>sliderIndex = (sliderIndex + 1) % storageSliders.size();<NEW_LINE>}<NEW_LINE>for (JStorageSlider slider : storageSliders) {<NEW_LINE>slider.setPreviousValue(slider.getValue());<NEW_LINE>}<NEW_LINE>}
slider.getValue() - adjustment);
1,136,396
public static void copyRecursive(File src, File dst) {<NEW_LINE>try {<NEW_LINE>if (src.isDirectory()) {<NEW_LINE>if (!dst.exists() && !dst.mkdirs()) {<NEW_LINE>throw new IOException("Cannot create dir " + dst.getAbsolutePath());<NEW_LINE>}<NEW_LINE>String[] children = src.list();<NEW_LINE>for (int i = 0; i < children.length; i++) {<NEW_LINE>copyRecursive(new File(src, children[i]), new File(dst, children[i]));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// make sure the directory we plan to store the recording in exists<NEW_LINE>File directory = dst.getParentFile();<NEW_LINE>if (directory != null && !directory.exists() && !directory.mkdirs()) {<NEW_LINE>throw new IOException("Cannot create dir " + directory.getAbsolutePath());<NEW_LINE>}<NEW_LINE>InputStream in = new FileInputStream(src);<NEW_LINE><MASK><NEW_LINE>// Copy the file in chunks<NEW_LINE>byte[] buf = new byte[1024];<NEW_LINE>int len;<NEW_LINE>while ((len = in.read(buf)) > 0) {<NEW_LINE>out.write(buf, 0, len);<NEW_LINE>}<NEW_LINE>in.close();<NEW_LINE>out.close();<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new UncheckedIOException(e);<NEW_LINE>}<NEW_LINE>}
OutputStream out = new FileOutputStream(dst);
1,713,308
private void find(char[][] board, boolean[][] visited, int i, int j, int m, int n, Set<String> result, TrieNode212 node) {<NEW_LINE>if (i < 0 || i >= m || j < 0 || j >= n || visited[i][j]) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>node = node.child[board[i][j] - 'a'];<NEW_LINE>visited[i][j] = true;<NEW_LINE>if (node == null) {<NEW_LINE>visited[i][j] = false;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (node.isEnd) {<NEW_LINE>result.add(node.val);<NEW_LINE>}<NEW_LINE>find(board, visited, i + 1, j, m, n, result, node);<NEW_LINE>find(board, visited, i, j + 1, m, n, result, node);<NEW_LINE>find(board, visited, i, j - 1, <MASK><NEW_LINE>find(board, visited, i - 1, j, m, n, result, node);<NEW_LINE>visited[i][j] = false;<NEW_LINE>}
m, n, result, node);
1,812,565
private void createAndAddFacts(@NonNull final ImmutableList<CommissionShare> shares, @NonNull final Instant timestamp, @NonNull final CommissionPoints initialForecastedBase, @NonNull final CommissionPoints initialToInvoiceBase, @NonNull final CommissionPoints initialInvoicedBase) {<NEW_LINE>CommissionPoints currentForecastedBase = initialForecastedBase;<NEW_LINE>CommissionPoints currentToInvoiceBase = initialToInvoiceBase;<NEW_LINE>CommissionPoints currentInvoicedBase = initialInvoicedBase;<NEW_LINE>for (final CommissionShare share : shares) {<NEW_LINE>try (final MDCCloseable shareMDC = TableRecordMDC.putTableRecordReference(I_C_Commission_Share.Table_Name, share.getId())) {<NEW_LINE>if (!HierarchyConfig.isInstance(share.getConfig())) {<NEW_LINE>logger.debug("Skipping commissionConfig because it is not a HierarchyConfig; config={}", share.getConfig());<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>final HierarchyConfig hierarchyConfig = HierarchyConfig.cast(share.getConfig());<NEW_LINE>try (final MDCCloseable ignore = TableRecordMDC.putTableRecordReference(I_C_HierarchyCommissionSettings.Table_Name, hierarchyConfig.getId())) {<NEW_LINE>logger.debug("Create commission shares and facts");<NEW_LINE>final HierarchyContract contract = HierarchyContract.cast(share.getContract());<NEW_LINE>final CommissionPoints salesRepForecastCP = calculateSalesRepCommissionPoints(contract, currentForecastedBase);<NEW_LINE>final CommissionPoints salesRepToInvoiceCP = calculateSalesRepCommissionPoints(contract, currentToInvoiceBase);<NEW_LINE>final CommissionPoints salesRepInvoiced = calculateSalesRepCommissionPoints(contract, currentInvoicedBase);<NEW_LINE>final Optional<CommissionFact> forecastedFact = CommissionFact.createFact(timestamp, CommissionState.FORECASTED, salesRepForecastCP, share.getForecastedPointsSum());<NEW_LINE>final Optional<CommissionFact> toInvoiceFact = CommissionFact.createFact(timestamp, CommissionState.INVOICEABLE, salesRepToInvoiceCP, share.getInvoiceablePointsSum());<NEW_LINE>final Optional<CommissionFact> invoicedFact = CommissionFact.createFact(timestamp, CommissionState.INVOICED, salesRepInvoiced, share.getInvoicedPointsSum());<NEW_LINE>forecastedFact.ifPresent(share::addFact);<NEW_LINE>toInvoiceFact.ifPresent(share::addFact);<NEW_LINE>invoicedFact.ifPresent(share::addFact);<NEW_LINE>if (hierarchyConfig.isSubtractLowerLevelCommissionFromBase()) {<NEW_LINE>currentForecastedBase = currentForecastedBase.subtract(salesRepForecastCP);<NEW_LINE>currentToInvoiceBase = currentToInvoiceBase.subtract(salesRepToInvoiceCP);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
currentInvoicedBase = currentInvoicedBase.subtract(salesRepInvoiced);
1,569,946
final ListVoiceConnectorTerminationCredentialsResult executeListVoiceConnectorTerminationCredentials(ListVoiceConnectorTerminationCredentialsRequest listVoiceConnectorTerminationCredentialsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listVoiceConnectorTerminationCredentialsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListVoiceConnectorTerminationCredentialsRequest> request = null;<NEW_LINE>Response<ListVoiceConnectorTerminationCredentialsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListVoiceConnectorTerminationCredentialsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listVoiceConnectorTerminationCredentialsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Chime");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListVoiceConnectorTerminationCredentials");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListVoiceConnectorTerminationCredentialsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListVoiceConnectorTerminationCredentialsResultJsonUnmarshaller());<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.endEvent(Field.RequestMarshallTime);
457,754
public void marshall(Session session, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (session == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(session.getId(), ID_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(session.getStackName(), STACKNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(session.getFleetName(), FLEETNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(session.getState(), STATE_BINDING);<NEW_LINE>protocolMarshaller.marshall(session.getConnectionState(), CONNECTIONSTATE_BINDING);<NEW_LINE>protocolMarshaller.marshall(session.getStartTime(), STARTTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(session.getMaxExpirationTime(), MAXEXPIRATIONTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(session.getAuthenticationType(), AUTHENTICATIONTYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(session.getNetworkAccessConfiguration(), NETWORKACCESSCONFIGURATION_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
session.getUserId(), USERID_BINDING);
172,159
public static void main(String[] args) {<NEW_LINE>CommandSpec spec = CommandSpec.create();<NEW_LINE>spec.addOption(OptionSpec.builder("-V", "--verbose").build());<NEW_LINE>spec.addOption(// so, this option is of type List<File><NEW_LINE>OptionSpec.builder("-f", "--file").paramLabel("FILES").type(List.class).// so, this option is of type List<File><NEW_LINE>auxiliaryTypes(File.class).description("The files to process").build());<NEW_LINE>spec.addOption(OptionSpec.builder("-n", "--num").paramLabel("COUNT").type(int[].class).splitRegex(",").description("Comma-separated list of integers").build());<NEW_LINE>CommandLine commandLine = new CommandLine(spec);<NEW_LINE>args = new String[] { "--verbose", <MASK><NEW_LINE>ParseResult pr = commandLine.parseArgs(args);<NEW_LINE>// Querying for options<NEW_LINE>// lists all command line args<NEW_LINE>List<String> originalArgs = pr.originalArgs();<NEW_LINE>assert Arrays.asList(args).equals(originalArgs);<NEW_LINE>// as specified on command line<NEW_LINE>assert pr.hasMatchedOption("--verbose");<NEW_LINE>// other aliases work also<NEW_LINE>assert pr.hasMatchedOption("-V");<NEW_LINE>// single-character alias works too<NEW_LINE>assert pr.hasMatchedOption('V');<NEW_LINE>// and, command name without hyphens<NEW_LINE>assert pr.hasMatchedOption("verbose");<NEW_LINE>// Matched Option Values<NEW_LINE>List<File> defaultValue = Collections.emptyList();<NEW_LINE>List<File> expected = Arrays.asList(new File("file1"), new File("file2"));<NEW_LINE>assert expected.equals(pr.matchedOptionValue('f', defaultValue));<NEW_LINE>assert expected.equals(pr.matchedOptionValue("--file", defaultValue));<NEW_LINE>assert Arrays.equals(new int[] { 1, 2, 3 }, pr.matchedOptionValue('n', new int[0]));<NEW_LINE>// Command line arguments after splitting but before type conversion<NEW_LINE>assert "1".equals(pr.matchedOption('n').stringValues().get(0));<NEW_LINE>assert "2".equals(pr.matchedOption('n').stringValues().get(1));<NEW_LINE>assert "3".equals(pr.matchedOption('n').stringValues().get(2));<NEW_LINE>// Command line arguments as found on the command line<NEW_LINE>assert "1,2,3".equals(pr.matchedOption("--num").originalStringValues().get(0));<NEW_LINE>}
"-f", "file1", "--file=file2", "-n1,2,3" };
1,712,362
public void read(DataReader in) throws IOException {<NEW_LINE>revision = new UnityVersion(in.readStringNull(255));<NEW_LINE>attributes = in.readInt();<NEW_LINE>embedded = in.readBoolean();<NEW_LINE><MASK><NEW_LINE>for (int i = 0; i < numBaseClasses; i++) {<NEW_LINE>int classID = in.readInt();<NEW_LINE>TypeRoot typeRoot = new TypeRoot();<NEW_LINE>typeRoot.classID(classID);<NEW_LINE>if (classID < 0) {<NEW_LINE>UnityHash128 scriptID = new UnityHash128();<NEW_LINE>in.readStruct(scriptID);<NEW_LINE>typeRoot.scriptID(scriptID);<NEW_LINE>}<NEW_LINE>UnityHash128 oldTypeHash = new UnityHash128();<NEW_LINE>in.readStruct(oldTypeHash);<NEW_LINE>typeRoot.oldTypeHash(oldTypeHash);<NEW_LINE>if (embedded) {<NEW_LINE>Node<T> node = new Node<>();<NEW_LINE>readNode(in, node);<NEW_LINE>typeRoot.nodes(node);<NEW_LINE>}<NEW_LINE>typeMap.put(classID, typeRoot);<NEW_LINE>}<NEW_LINE>}
int numBaseClasses = in.readInt();
1,651,924
public static BufferedImage extrudeBorders(BufferedImage src, int extrudeBorders) {<NEW_LINE>if (extrudeBorders > 0) {<NEW_LINE>src = depalettiseImage(src);<NEW_LINE>int origWidth = src.getWidth();<NEW_LINE>int origHeight = src.getHeight();<NEW_LINE>int newWidth = origWidth + extrudeBorders * 2;<NEW_LINE><MASK><NEW_LINE>int type = getImageType(src);<NEW_LINE>BufferedImage tgt = new BufferedImage(newWidth, newHeight, type);<NEW_LINE>int numComponents = src.getColorModel().getNumComponents();<NEW_LINE>int[] srcPixels = new int[origWidth * origHeight * numComponents];<NEW_LINE>src.getRaster().getPixels(0, 0, origWidth, origHeight, srcPixels);<NEW_LINE>int[] tgtPixels = new int[newWidth * newHeight * numComponents];<NEW_LINE>for (int y = 0; y < newHeight; ++y) {<NEW_LINE>for (int x = 0; x < newWidth; ++x) {<NEW_LINE>int index = (x + y * newWidth) * numComponents;<NEW_LINE>int sx = Math.min(Math.max(x - extrudeBorders, 0), origWidth - 1);<NEW_LINE>int sy = Math.min(Math.max(y - extrudeBorders, 0), origHeight - 1);<NEW_LINE>int sindex = (sx + sy * origWidth) * numComponents;<NEW_LINE>for (int i = 0; i < numComponents; ++i) {<NEW_LINE>tgtPixels[index + i] = srcPixels[sindex + i];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>tgt.getRaster().setPixels(0, 0, newWidth, newHeight, tgtPixels);<NEW_LINE>return tgt;<NEW_LINE>} else {<NEW_LINE>return src;<NEW_LINE>}<NEW_LINE>}
int newHeight = origHeight + extrudeBorders * 2;
1,260,995
static Geobject[] generate(int offset, String[] types, int count, long seed) {<NEW_LINE>Random r = new Random(seed);<NEW_LINE>Geobject[] arr = new Geobject[count];<NEW_LINE>for (int i = 0; i < arr.length; i++) {<NEW_LINE>String t = types[offset + i % (types.length - offset)];<NEW_LINE>Geobject s;<NEW_LINE>switch(t) {<NEW_LINE>case "circle":<NEW_LINE>s = Geobject.circle(r.nextDouble());<NEW_LINE>break;<NEW_LINE>case "rectangle":<NEW_LINE>s = Geobject.rectangle(r.nextDouble(), r.nextDouble());<NEW_LINE>break;<NEW_LINE>case "square":<NEW_LINE>s = Geobject.<MASK><NEW_LINE>break;<NEW_LINE>case "triangle":<NEW_LINE>s = Geobject.triangle(r.nextDouble(), r.nextDouble());<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new IllegalStateException("" + t);<NEW_LINE>}<NEW_LINE>arr[i] = s;<NEW_LINE>}<NEW_LINE>return arr;<NEW_LINE>}
square(r.nextDouble());
868,038
public static Home find() {<NEW_LINE>// Check if ROBOVM_DEV_ROOT has been set. If set it should be<NEW_LINE>// pointing at the root of a complete RoboVM source tree.<NEW_LINE>if (System.getenv("ROBOVM_DEV_ROOT") != null) {<NEW_LINE>File dir = new File(System.getenv("ROBOVM_DEV_ROOT"));<NEW_LINE>return validateDevRootDir(dir);<NEW_LINE>}<NEW_LINE>if (System.getProperty("ROBOVM_DEV_ROOT") != null) {<NEW_LINE>File dir = new File(System.getProperty("ROBOVM_DEV_ROOT"));<NEW_LINE>return validateDevRootDir(dir);<NEW_LINE>}<NEW_LINE>if (System.getenv("ROBOVM_HOME") != null) {<NEW_LINE>File dir = new File(System.getenv("ROBOVM_HOME"));<NEW_LINE>return new Home(dir);<NEW_LINE>}<NEW_LINE>List<File> candidates = new ArrayList<File>();<NEW_LINE>File userHome = new File(System.getProperty("user.home"));<NEW_LINE>candidates.add(new File(userHome, "Applications/robovm"));<NEW_LINE>candidates.add(<MASK><NEW_LINE>candidates.add(new File("/usr/local/lib/robovm"));<NEW_LINE>candidates.add(new File("/opt/robovm"));<NEW_LINE>candidates.add(new File("/usr/lib/robovm"));<NEW_LINE>for (File dir : candidates) {<NEW_LINE>if (dir.exists()) {<NEW_LINE>return new Home(dir);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw new IllegalArgumentException("ROBOVM_HOME not set and no RoboVM " + "installation found in " + candidates);<NEW_LINE>}
new File(userHome, ".robovm/home"));
254,707
public void performOperationStep(DeploymentOperation operationContext) {<NEW_LINE>final PlatformServiceContainer serviceContainer = operationContext.getServiceContainer();<NEW_LINE>final AbstractProcessApplication processApplication = operationContext.getAttachment(Attachments.PROCESS_APPLICATION);<NEW_LINE>final JmxManagedProcessApplication deployedProcessApplication = serviceContainer.getService(ServiceTypes.PROCESS_APPLICATION, processApplication.getName());<NEW_LINE>ensureNotNull("Cannot find process application with name " + processApplication.getName(), "deployedProcessApplication", deployedProcessApplication);<NEW_LINE>Map<String, DeployedProcessArchive<MASK><NEW_LINE>if (deploymentMap != null) {<NEW_LINE>List<ProcessesXml> processesXmls = deployedProcessApplication.getProcessesXmls();<NEW_LINE>for (ProcessesXml processesXml : processesXmls) {<NEW_LINE>for (ProcessArchiveXml parsedProcessArchive : processesXml.getProcessArchives()) {<NEW_LINE>DeployedProcessArchive deployedProcessArchive = deploymentMap.get(parsedProcessArchive.getName());<NEW_LINE>if (deployedProcessArchive != null) {<NEW_LINE>operationContext.addStep(new UndeployProcessArchiveStep(deployedProcessApplication, parsedProcessArchive, deployedProcessArchive.getProcessEngineName()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
> deploymentMap = deployedProcessApplication.getProcessArchiveDeploymentMap();
1,385,921
public void testAsyncInvoker_postReceiveTimeout(Map<String, String> param, StringBuilder ret) {<NEW_LINE>String serverIP = param.get("serverIP");<NEW_LINE>String serverPort = param.get("serverPort");<NEW_LINE><MASK><NEW_LINE>cb.property("com.ibm.ws.jaxrs.client.receive.timeout", TIMEOUT);<NEW_LINE>Client c = cb.build();<NEW_LINE>WebTarget t = c.target("http://" + serverIP + ":" + serverPort + "/bookstore/bookstore2/post/" + SLEEP);<NEW_LINE>Builder builder = t.request();<NEW_LINE>AsyncInvoker asyncInvoker = builder.async();<NEW_LINE>Future<Response> future = asyncInvoker.post(Entity.xml(Long.toString(SLEEP)));<NEW_LINE>long startTime = System.currentTimeMillis();<NEW_LINE>try {<NEW_LINE>Response response = future.get();<NEW_LINE>// Did not time out as expected<NEW_LINE>ret.append(response.readEntity(String.class));<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>ret.append("InterruptedException");<NEW_LINE>e.printStackTrace();<NEW_LINE>} catch (ExecutionException e) {<NEW_LINE>if (e.getCause().toString().contains("ProcessingException")) {<NEW_LINE>ret.append("Timeout as expected");<NEW_LINE>} else {<NEW_LINE>ret.append("ExecutionException");<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>long elapsed = System.currentTimeMillis() - startTime;<NEW_LINE>System.out.println("testAsyncInvoker_postReceiveTimeout with TIMEOUT " + TIMEOUT + " future.get elapsed time " + elapsed);<NEW_LINE>c.close();<NEW_LINE>}
ClientBuilder cb = ClientBuilder.newBuilder();
1,713,897
@Operation(summary = "Delete subject compatibility level", description = "Deletes the specified subject-level compatibility level config and " + "reverts to the global default.", responses = { @ApiResponse(responseCode = "200", description = "Operation succeeded. " + "Returns old compatibility level", content = @Content(schema = @Schema(implementation = CompatibilityLevel.class))), @ApiResponse(responseCode = "404", description = "Error code 40401 -- Subject not found"), @ApiResponse(responseCode = "500", description = "Error code 50001 -- Error in the backend " + "datastore") })<NEW_LINE>public void deleteSubjectConfig(@Suspended final AsyncResponse asyncResponse, @Context HttpHeaders headers, @Parameter(description = "Name of the subject", required = true) @PathParam("subject") String subject) {<NEW_LINE>log.info("Deleting compatibility setting for subject {}", subject);<NEW_LINE>subject = QualifiedSubject.normalize(schemaRegistry.tenant(), subject);<NEW_LINE>Config deletedConfig;<NEW_LINE>try {<NEW_LINE>CompatibilityLevel currentCompatibility = schemaRegistry.getCompatibilityLevel(subject);<NEW_LINE>if (currentCompatibility == null) {<NEW_LINE>throw Errors.subjectNotFoundException(subject);<NEW_LINE>}<NEW_LINE>Map<String, String> headerProperties = requestHeaderBuilder.buildRequestHeaders(headers, schemaRegistry.config().whitelistHeaders());<NEW_LINE>schemaRegistry.deleteCompatibilityConfigOrForward(subject, headerProperties);<NEW_LINE>deletedConfig = new Config(currentCompatibility.name);<NEW_LINE>} catch (OperationNotPermittedException e) {<NEW_LINE>throw Errors.operationNotPermittedException(e.getMessage());<NEW_LINE>} catch (SchemaRegistryStoreException e) {<NEW_LINE>throw <MASK><NEW_LINE>} catch (UnknownLeaderException e) {<NEW_LINE>throw Errors.unknownLeaderException("Failed to delete compatibility level", e);<NEW_LINE>} catch (SchemaRegistryRequestForwardingException e) {<NEW_LINE>throw Errors.requestForwardingFailedException("Error while forwarding delete config request" + " to the leader", e);<NEW_LINE>}<NEW_LINE>asyncResponse.resume(deletedConfig);<NEW_LINE>}
Errors.storeException("Failed to delete compatibility level", e);
1,205,309
public HistoricDetailVariableInstanceUpdateEntity copyAndInsertHistoricDetailVariableInstanceUpdateEntity(VariableInstanceEntity variableInstance) {<NEW_LINE>HistoricDetailVariableInstanceUpdateEntity historicVariableUpdate = historicDetailDataManager.createHistoricDetailVariableInstanceUpdate();<NEW_LINE>historicVariableUpdate.setProcessInstanceId(variableInstance.getProcessInstanceId());<NEW_LINE>historicVariableUpdate.<MASK><NEW_LINE>historicVariableUpdate.setTaskId(variableInstance.getTaskId());<NEW_LINE>historicVariableUpdate.setTime(getClock().getCurrentTime());<NEW_LINE>historicVariableUpdate.setRevision(variableInstance.getRevision());<NEW_LINE>historicVariableUpdate.setName(variableInstance.getName());<NEW_LINE>historicVariableUpdate.setVariableType(variableInstance.getType());<NEW_LINE>historicVariableUpdate.setTextValue(variableInstance.getTextValue());<NEW_LINE>historicVariableUpdate.setTextValue2(variableInstance.getTextValue2());<NEW_LINE>historicVariableUpdate.setDoubleValue(variableInstance.getDoubleValue());<NEW_LINE>historicVariableUpdate.setLongValue(variableInstance.getLongValue());<NEW_LINE>if (variableInstance.getBytes() != null) {<NEW_LINE>historicVariableUpdate.setBytes(variableInstance.getBytes());<NEW_LINE>}<NEW_LINE>insert(historicVariableUpdate);<NEW_LINE>return historicVariableUpdate;<NEW_LINE>}
setExecutionId(variableInstance.getExecutionId());
1,731,653
private Object invoke(HashMap<String, Object> event, Context context) throws Exception {<NEW_LINE>Method method = findHandlerMethod(this.clazz, this.handlerName);<NEW_LINE>Class<?> requestClass = method.getParameterTypes()[0];<NEW_LINE>Mapper <MASK><NEW_LINE>Object request = mapper.read(event);<NEW_LINE>if (method.getParameterCount() == 1) {<NEW_LINE>return method.invoke(this.instance, request);<NEW_LINE>} else if (method.getParameterCount() == 2) {<NEW_LINE>return method.invoke(this.instance, request, context);<NEW_LINE>} else if (method.getParameterCount() == 3 && requestClass.isAssignableFrom(InputStream.class)) {<NEW_LINE>ByteArrayOutputStream outputStream = new ByteArrayOutputStream();<NEW_LINE>method.invoke(this.instance, request, outputStream, context);<NEW_LINE>return outputStream;<NEW_LINE>} else {<NEW_LINE>throw new NoSuchMethodException("Handler should take 1, 2, or 3 (com.amazonaws.services.lambda.runtime.RequestStreamHandler compatible handlers) arguments: " + method);<NEW_LINE>}<NEW_LINE>}
mapper = MapperFactory.getMapper(requestClass);
1,160,993
protected void createSpecificButtons(final Container container) {<NEW_LINE>final AbstractAction runAllAction = new AbstractAction(TextUtils.getText("reminder.Run_All")) {<NEW_LINE><NEW_LINE>private static final long serialVersionUID = 1L;<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(final ActionEvent arg0) {<NEW_LINE>runScripts(false);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>final <MASK><NEW_LINE>final AbstractAction runSelectedAction = new AbstractAction(TextUtils.getText("reminder.Run_Selected")) {<NEW_LINE><NEW_LINE>private static final long serialVersionUID = 1L;<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(final ActionEvent arg0) {<NEW_LINE>runScripts(true);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>final JButton runSelectedButton = new JButton(runSelectedAction);<NEW_LINE>runSelectedAction.setEnabled(false);<NEW_LINE>final AbstractAction removeAllAction = new AbstractAction(TextUtils.getText("reminder.Remove_All")) {<NEW_LINE><NEW_LINE>private static final long serialVersionUID = 1L;<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(final ActionEvent arg0) {<NEW_LINE>removeReminders(false);<NEW_LINE>disposeDialog();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>final JButton removeAllButton = new JButton(removeAllAction);<NEW_LINE>final AbstractAction removeSelectedAction = new AbstractAction(TextUtils.getText("reminder.Remove_Selected")) {<NEW_LINE><NEW_LINE>private static final long serialVersionUID = 1L;<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(final ActionEvent arg0) {<NEW_LINE>removeReminders(true);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>final JButton removeSelectedButton = new JButton(removeSelectedAction);<NEW_LINE>removeSelectedAction.setEnabled(false);<NEW_LINE>final ListSelectionModel rowSM1 = tableView.getSelectionModel();<NEW_LINE>rowSM1.addListSelectionListener(new ListSelectionListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void valueChanged(final ListSelectionEvent e) {<NEW_LINE>if (e.getValueIsAdjusting()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final ListSelectionModel lsm = (ListSelectionModel) e.getSource();<NEW_LINE>final boolean enable = !(lsm.isSelectionEmpty());<NEW_LINE>runSelectedAction.setEnabled(enable);<NEW_LINE>removeSelectedAction.setEnabled(enable);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>Component[] components = new Component[] { runAllButton, runSelectedButton, removeAllButton, removeSelectedButton };<NEW_LINE>for (Component c : components) container.add(c);<NEW_LINE>}
JButton runAllButton = new JButton(runAllAction);
182,001
public void reload() {<NEW_LINE>try {<NEW_LINE>SortTaskConfig newSortTaskConfig = SortClusterConfigHolder.getTaskConfig(taskName);<NEW_LINE>LOG.info("start to get SortTaskConfig:taskName:{}:config:{}", taskName, new ObjectMapper().writeValueAsString(newSortTaskConfig));<NEW_LINE>if (this.sortTaskConfig != null && this.sortTaskConfig.equals(newSortTaskConfig)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// parse the config of id and topic<NEW_LINE>Map<String, ClickHouseIdConfig> newIdConfigMap = new ConcurrentHashMap<>();<NEW_LINE>List<Map<String, String>> idList = newSortTaskConfig.getIdParams();<NEW_LINE>ObjectMapper objectMapper = new ObjectMapper();<NEW_LINE>for (Map<String, String> idParam : idList) {<NEW_LINE>String inlongGroupId = idParam.get(Constants.INLONG_GROUP_ID);<NEW_LINE>String inlongStreamId = idParam.get(Constants.INLONG_STREAM_ID);<NEW_LINE>String uid = InlongId.generateUid(inlongGroupId, inlongStreamId);<NEW_LINE>String jsonIdConfig = objectMapper.writeValueAsString(idParam);<NEW_LINE>ClickHouseIdConfig idConfig = objectMapper.readValue(jsonIdConfig, ClickHouseIdConfig.class);<NEW_LINE>newIdConfigMap.put(uid, idConfig);<NEW_LINE>}<NEW_LINE>// jdbc config<NEW_LINE>Context currentContext = new Context(this.parentContext.getParameters());<NEW_LINE>currentContext.putAll(newSortTaskConfig.getSinkParams());<NEW_LINE>this.jdbcDriver = currentContext.getString(KEY_JDBC_DRIVER, DEFAULT_JDBC_DRIVER);<NEW_LINE>this.jdbcUrl = currentContext.getString(KEY_JDBC_URL);<NEW_LINE>this.jdbcUsername = currentContext.getString(KEY_JDBC_USERNAME);<NEW_LINE>this.jdbcPassword = currentContext.getString(KEY_JDBC_PASSWORD);<NEW_LINE><MASK><NEW_LINE>// load DB field<NEW_LINE>this.initIdConfig(newIdConfigMap);<NEW_LINE>// change current config<NEW_LINE>this.sortTaskConfig = newSortTaskConfig;<NEW_LINE>this.idConfigMap = newIdConfigMap;<NEW_LINE>LOG.info("end to get SortTaskConfig,taskName:{},newIdConfigMap:{},currentContext:{}", taskName, new ObjectMapper().writeValueAsString(newIdConfigMap), currentContext);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>LOG.error(e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
Class.forName(this.jdbcDriver);
1,050,193
protected void deploy(DeploymentInfo deploymentInfo) {<NEW_LINE><MASK><NEW_LINE>DeploymentManager manager = Servlets.defaultContainer().addDeployment(deploymentInfo);<NEW_LINE>manager.deploy();<NEW_LINE>HttpHandler httpHandler;<NEW_LINE>// Get realm from owning agent asset<NEW_LINE>String agentRealm = agent.getRealm();<NEW_LINE>if (TextUtil.isNullOrEmpty(agentRealm)) {<NEW_LINE>throw new IllegalStateException("Cannot determine the realm that this agent belongs to");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>httpHandler = manager.start();<NEW_LINE>// Wrap the handler to inject the realm<NEW_LINE>HttpHandler handlerWrapper = exchange -> {<NEW_LINE>exchange.getRequestHeaders().put(HttpString.tryFromString(Constants.REALM_PARAM_NAME), agentRealm);<NEW_LINE>httpHandler.handleRequest(exchange);<NEW_LINE>};<NEW_LINE>WebService.RequestHandler requestHandler = pathStartsWithHandler(deploymentInfo.getDeploymentName(), deploymentInfo.getContextPath(), handlerWrapper);<NEW_LINE>LOG.info("Registering HTTP Server Protocol request handler '" + this.getClass().getSimpleName() + "' for request path: " + deploymentInfo.getContextPath());<NEW_LINE>// Add the handler before the greedy deployment handler<NEW_LINE>webService.getRequestHandlers().add(0, requestHandler);<NEW_LINE>deployment = new DeploymentInstance(deploymentInfo, requestHandler);<NEW_LINE>} catch (ServletException e) {<NEW_LINE>LOG.severe("Failed to deploy deployment: " + deploymentInfo.getDeploymentName());<NEW_LINE>}<NEW_LINE>}
LOG.info("Deploying JAX-RS deployment for protocol instance : " + this);
1,028,860
public byte[] marshall(BucketQosInfo bucketQosInfo) {<NEW_LINE>StringBuffer xmlBody = new StringBuffer();<NEW_LINE>xmlBody.append("<QoSConfiguration>");<NEW_LINE>if (bucketQosInfo.getTotalUploadBw() != null) {<NEW_LINE>xmlBody.append("<TotalUploadBandwidth>" + bucketQosInfo.getTotalUploadBw() + "</TotalUploadBandwidth>");<NEW_LINE>}<NEW_LINE>if (bucketQosInfo.getIntranetUploadBw() != null) {<NEW_LINE>xmlBody.append("<IntranetUploadBandwidth>" + bucketQosInfo.getIntranetUploadBw() + "</IntranetUploadBandwidth>");<NEW_LINE>}<NEW_LINE>if (bucketQosInfo.getExtranetUploadBw() != null) {<NEW_LINE>xmlBody.append("<ExtranetUploadBandwidth>" + bucketQosInfo.getExtranetUploadBw() + "</ExtranetUploadBandwidth>");<NEW_LINE>}<NEW_LINE>if (bucketQosInfo.getTotalDownloadBw() != null) {<NEW_LINE>xmlBody.append("<TotalDownloadBandwidth>" + bucketQosInfo.getTotalDownloadBw() + "</TotalDownloadBandwidth>");<NEW_LINE>}<NEW_LINE>if (bucketQosInfo.getIntranetDownloadBw() != null) {<NEW_LINE>xmlBody.append("<IntranetDownloadBandwidth>" + bucketQosInfo.getIntranetDownloadBw() + "</IntranetDownloadBandwidth>");<NEW_LINE>}<NEW_LINE>if (bucketQosInfo.getExtranetDownloadBw() != null) {<NEW_LINE>xmlBody.append("<ExtranetDownloadBandwidth>" + bucketQosInfo.getExtranetDownloadBw() + "</ExtranetDownloadBandwidth>");<NEW_LINE>}<NEW_LINE>if (bucketQosInfo.getTotalQps() != null) {<NEW_LINE>xmlBody.append("<TotalQps>" + bucketQosInfo.getTotalQps() + "</TotalQps>");<NEW_LINE>}<NEW_LINE>if (bucketQosInfo.getIntranetQps() != null) {<NEW_LINE>xmlBody.append("<IntranetQps>" + <MASK><NEW_LINE>}<NEW_LINE>if (bucketQosInfo.getExtranetQps() != null) {<NEW_LINE>xmlBody.append("<ExtranetQps>" + bucketQosInfo.getExtranetQps() + "</ExtranetQps>");<NEW_LINE>}<NEW_LINE>xmlBody.append("</QoSConfiguration>");<NEW_LINE>byte[] rawData = null;<NEW_LINE>try {<NEW_LINE>rawData = xmlBody.toString().getBytes(DEFAULT_CHARSET_NAME);<NEW_LINE>} catch (UnsupportedEncodingException e) {<NEW_LINE>throw new ClientException("Unsupported encoding " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>return rawData;<NEW_LINE>}
bucketQosInfo.getIntranetQps() + "</IntranetQps>");
1,169,918
public byte[] toByteArray() {<NEW_LINE>if (this._bufferList.peekFirst() == null) {<NEW_LINE>// Return an empty array if the output stream is empty<NEW_LINE>return new byte[0];<NEW_LINE>} else {<NEW_LINE>int totalSize = size();<NEW_LINE>byte[] targetBuffer = new byte[totalSize];<NEW_LINE>int pos = 0;<NEW_LINE>Iterator<byte[]> iter = this._bufferList.iterator();<NEW_LINE>while (iter.hasNext()) {<NEW_LINE>byte[] buffer = iter.next();<NEW_LINE>if (iter.hasNext()) {<NEW_LINE>// If it has next buffer, we know this buffer is full and<NEW_LINE>// we copy the whole buffer to the new buffer.<NEW_LINE>System.arraycopy(buffer, 0, <MASK><NEW_LINE>pos += buffer.length;<NEW_LINE>} else {<NEW_LINE>// If this is the last buffer, we only copy valid content based on _index<NEW_LINE>System.arraycopy(buffer, 0, targetBuffer, pos, this._index);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return targetBuffer;<NEW_LINE>}<NEW_LINE>}
targetBuffer, pos, buffer.length);
793,134
private static void initByFallback(Context ctx) {<NEW_LINE>if (skin_list_item_normal == null) {<NEW_LINE>skin_list_item_normal = loadDrawableFromAsset("skin_list_item_normal.9.png", ctx);<NEW_LINE>}<NEW_LINE>if (skin_list_item_pressed == null) {<NEW_LINE>skin_list_item_pressed = loadDrawableFromAsset("skin_list_item_pressed.9.png", ctx);<NEW_LINE>}<NEW_LINE>if (list_checkbox_selected_nopress == null) {<NEW_LINE>list_checkbox_selected_nopress = loadDrawableFromAsset("list_checkbox_selected_nopress.png", ctx);<NEW_LINE>}<NEW_LINE>if (list_checkbox_selected == null) {<NEW_LINE>list_checkbox_selected = loadDrawableFromAsset("list_checkbox_selected.png", ctx);<NEW_LINE>}<NEW_LINE>if (list_checkbox_multi == null) {<NEW_LINE>list_checkbox_multi = loadDrawableFromAsset("list_checkbox_multi.png", ctx);<NEW_LINE>}<NEW_LINE>if (list_checkbox == null) {<NEW_LINE>list_checkbox = loadDrawableFromAsset("list_checkbox.png", ctx);<NEW_LINE>}<NEW_LINE>if (skin_icon_arrow_right_normal == null) {<NEW_LINE>skin_icon_arrow_right_normal = loadDrawableFromAsset("skin_icon_arrow_right_normal.png", ctx);<NEW_LINE>}<NEW_LINE>if (skin_black == null) {<NEW_LINE>skin_black = ColorStateList.valueOf(0xFF000000);<NEW_LINE>}<NEW_LINE>if (skin_tips == null) {<NEW_LINE>skin_tips = ColorStateList.valueOf(0xFFFFFFFF);<NEW_LINE>}<NEW_LINE>if (skin_red == null) {<NEW_LINE>skin_red = ColorStateList.valueOf(Color.argb(255, 255, 70, 41));<NEW_LINE>}<NEW_LINE>if (skin_gray3 == null) {<NEW_LINE>skin_gray3 = ColorStateList.valueOf(Color.argb(255, 128, 128, 128));<NEW_LINE>}<NEW_LINE>if (skin_blue == null) {<NEW_LINE>skin_blue = ColorStateList.valueOf(Color.argb(255<MASK><NEW_LINE>}<NEW_LINE>if (skin_background == null) {<NEW_LINE>skin_background = new ColorDrawable(Color.argb(255, 240, 240, 240));<NEW_LINE>}<NEW_LINE>if (skin_common_btn_blue_unpressed == null || skin_common_btn_blue_pressed == null || skin_color_button_blue == null) {<NEW_LINE>skin_common_btn_blue_pressed = new ColorDrawable(Color.argb(255, 16, 80, 210));<NEW_LINE>skin_common_btn_blue_unpressed = new ColorDrawable(Color.argb(255, 20, 100, 255));<NEW_LINE>skin_color_button_blue = ColorStateList.valueOf(Color.argb(255, 255, 255, 255));<NEW_LINE>}<NEW_LINE>}
, 0, 182, 249));