idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
1,595,392
public String toSql() {<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append("SHOW PARTITIONS FROM ");<NEW_LINE>if (!Strings.isNullOrEmpty(dbName)) {<NEW_LINE>sb.append("`").append(dbName).append("`");<NEW_LINE>}<NEW_LINE>if (!Strings.isNullOrEmpty(tableName)) {<NEW_LINE>sb.append(".`").append<MASK><NEW_LINE>}<NEW_LINE>if (whereClause != null) {<NEW_LINE>sb.append(" WHERE ").append(whereClause.toSql());<NEW_LINE>}<NEW_LINE>// Order By clause<NEW_LINE>if (orderByElements != null) {<NEW_LINE>sb.append(" ORDER BY ");<NEW_LINE>for (int i = 0; i < orderByElements.size(); ++i) {<NEW_LINE>sb.append(orderByElements.get(i).toSql());<NEW_LINE>sb.append((i + 1 != orderByElements.size()) ? ", " : "");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (limitElement != null) {<NEW_LINE>sb.append(limitElement.toSql());<NEW_LINE>}<NEW_LINE>return sb.toString();<NEW_LINE>}
(tableName).append("`");
1,825,130
public static boolean addNode(Properties ctx, String treeType, int Record_ID, String trxName) {<NEW_LINE>// TODO: Check & refactor this<NEW_LINE>// Get Tree<NEW_LINE>int AD_Tree_ID = 0;<NEW_LINE>MClient client = MClient.get(ctx);<NEW_LINE>I_AD_ClientInfo ci = client.getInfo();<NEW_LINE>if (TREETYPE_Activity.equals(treeType))<NEW_LINE>AD_Tree_ID = ci.getAD_Tree_Activity_ID();<NEW_LINE>else if (TREETYPE_BoM.equals(treeType))<NEW_LINE>throw new IllegalArgumentException("BoM Trees not supported");<NEW_LINE>else if (TREETYPE_BPartner.equals(treeType))<NEW_LINE>AD_Tree_ID = ci.getAD_Tree_BPartner_ID();<NEW_LINE>else if (TREETYPE_Campaign.equals(treeType))<NEW_LINE>AD_Tree_ID = ci.getAD_Tree_Campaign_ID();<NEW_LINE>else if (TREETYPE_ElementValue.equals(treeType))<NEW_LINE>throw new IllegalArgumentException("ElementValue cannot use this API");<NEW_LINE>else if (TREETYPE_Menu.equals(treeType))<NEW_LINE>AD_Tree_ID = ci.getAD_Tree_Menu_ID();<NEW_LINE>else if (TREETYPE_Organization.equals(treeType))<NEW_LINE>AD_Tree_ID = ci.getAD_Tree_Org_ID();<NEW_LINE>else if (TREETYPE_Product.equals(treeType))<NEW_LINE>AD_Tree_ID = ci.getAD_Tree_Product_ID();<NEW_LINE>else if (TREETYPE_ProductCategory.equals(treeType))<NEW_LINE>throw new IllegalArgumentException("Product Category Trees not supported");<NEW_LINE>else if (TREETYPE_Project.equals(treeType))<NEW_LINE>AD_Tree_ID = ci.getAD_Tree_Project_ID();<NEW_LINE>else if (TREETYPE_SalesRegion.equals(treeType))<NEW_LINE>AD_Tree_ID = ci.getAD_Tree_SalesRegion_ID();<NEW_LINE>if (AD_Tree_ID == 0)<NEW_LINE>throw new IllegalArgumentException("No Tree found");<NEW_LINE>MTree_Base tree = MTree_Base.get(ctx, AD_Tree_ID, trxName);<NEW_LINE>if (tree.get_ID() != AD_Tree_ID)<NEW_LINE>throw new IllegalArgumentException("Tree found AD_Tree_ID=" + AD_Tree_ID);<NEW_LINE>// Insert Tree in correct tree<NEW_LINE>boolean saved = false;<NEW_LINE>if (TREETYPE_Menu.equals(treeType)) {<NEW_LINE>MTree_NodeMM node = new MTree_NodeMM(tree, Record_ID);<NEW_LINE>saved = node.save();<NEW_LINE>} else if (TREETYPE_BPartner.equals(treeType)) {<NEW_LINE>MTree_NodeBP node = new MTree_NodeBP(tree, Record_ID);<NEW_LINE>saved = node.save();<NEW_LINE>} else if (TREETYPE_Product.equals(treeType)) {<NEW_LINE>MTree_NodePR node <MASK><NEW_LINE>saved = node.save();<NEW_LINE>} else {<NEW_LINE>MTree_Node node = new MTree_Node(tree, Record_ID);<NEW_LINE>saved = node.save();<NEW_LINE>}<NEW_LINE>return saved;<NEW_LINE>}
= new MTree_NodePR(tree, Record_ID);
1,769,495
public Protos.TaskInfo constructMesosTaskInfo(Config heronConfig, Config heronRuntime) {<NEW_LINE>// String taskIdStr, BaseContainer task, Offer offer<NEW_LINE>String taskIdStr = this.taskId;<NEW_LINE>Protos.TaskID mesosTaskID = Protos.TaskID.newBuilder().setValue(taskIdStr).build();<NEW_LINE>Protos.TaskInfo.Builder taskInfo = Protos.TaskInfo.newBuilder().setName(baseContainer.name).setTaskId(mesosTaskID);<NEW_LINE>Protos.Environment.Builder environment = Protos.Environment.newBuilder();<NEW_LINE>// If the job defines custom environment variables, add them to the builder<NEW_LINE>// Don't add them if they already exist to prevent overwriting the defaults<NEW_LINE>Set<String> builtinEnvNames = new HashSet<>();<NEW_LINE>for (Protos.Environment.Variable variable : environment.getVariablesList()) {<NEW_LINE>builtinEnvNames.add(variable.getName());<NEW_LINE>}<NEW_LINE>for (BaseContainer.EnvironmentVariable ev : baseContainer.environmentVariables) {<NEW_LINE>environment.addVariables(Protos.Environment.Variable.newBuilder().setName(ev.name).setValue(ev.value));<NEW_LINE>}<NEW_LINE>taskInfo.addResources(scalarResource(TaskResources.CPUS_RESOURCE_NAME, baseContainer.cpu)).addResources(scalarResource(TaskResources.MEM_RESOURCE_NAME, baseContainer.memInMB)).addResources(scalarResource(TaskResources.DISK_RESOURCE_NAME, baseContainer.diskInMB)).addResources(rangeResource(TaskResources.PORT_RESOURCE_NAME, this.freePorts.get(0), this.freePorts.get(this.freePorts.size() - 1))).setSlaveId(this.offer.getSlaveId());<NEW_LINE>int containerIndex = TaskUtils.getContainerIndexForTaskId(taskIdStr);<NEW_LINE>String commandStr = <MASK><NEW_LINE>Protos.CommandInfo.Builder command = Protos.CommandInfo.newBuilder();<NEW_LINE>List<Protos.CommandInfo.URI> uriProtos = new ArrayList<>();<NEW_LINE>for (String uri : baseContainer.dependencies) {<NEW_LINE>uriProtos.add(Protos.CommandInfo.URI.newBuilder().setValue(uri).setExtract(true).build());<NEW_LINE>}<NEW_LINE>command.setValue(commandStr).setShell(baseContainer.shell).setEnvironment(environment).addAllUris(uriProtos);<NEW_LINE>if (!baseContainer.runAsUser.isEmpty()) {<NEW_LINE>command.setUser(baseContainer.runAsUser);<NEW_LINE>}<NEW_LINE>taskInfo.setCommand(command);<NEW_LINE>return taskInfo.build();<NEW_LINE>}
executorCommand(heronConfig, heronRuntime, containerIndex);
27,521
private static void registerBuiltinsHelpers(final HelperRegistry registry) {<NEW_LINE>registry.registerHelper(WithHelper.NAME, WithHelper.INSTANCE);<NEW_LINE>registry.registerHelper(IfHelper.NAME, IfHelper.INSTANCE);<NEW_LINE>registry.registerHelper(UnlessHelper.NAME, UnlessHelper.INSTANCE);<NEW_LINE>registry.registerHelper(EachHelper.NAME, EachHelper.INSTANCE);<NEW_LINE>registry.registerHelper(<MASK><NEW_LINE>registry.registerHelper(BlockHelper.NAME, BlockHelper.INSTANCE);<NEW_LINE>registry.registerHelper(PartialHelper.NAME, PartialHelper.INSTANCE);<NEW_LINE>registry.registerHelper(PrecompileHelper.NAME, PrecompileHelper.INSTANCE);<NEW_LINE>registry.registerHelper("i18n", I18nHelper.i18n);<NEW_LINE>registry.registerHelper("i18nJs", I18nHelper.i18nJs);<NEW_LINE>registry.registerHelper(LookupHelper.NAME, LookupHelper.INSTANCE);<NEW_LINE>registry.registerHelper(LogHelper.NAME, LogHelper.INSTANCE);<NEW_LINE>// decorator<NEW_LINE>registry.registerDecorator("inline", InlineDecorator.INSTANCE);<NEW_LINE>}
EmbeddedHelper.NAME, EmbeddedHelper.INSTANCE);
1,505,583
public static QueryMediaWorkflowListResponse unmarshall(QueryMediaWorkflowListResponse queryMediaWorkflowListResponse, UnmarshallerContext _ctx) {<NEW_LINE>queryMediaWorkflowListResponse.setRequestId<MASK><NEW_LINE>List<String> nonExistMediaWorkflowIds = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("QueryMediaWorkflowListResponse.NonExistMediaWorkflowIds.Length"); i++) {<NEW_LINE>nonExistMediaWorkflowIds.add(_ctx.stringValue("QueryMediaWorkflowListResponse.NonExistMediaWorkflowIds[" + i + "]"));<NEW_LINE>}<NEW_LINE>queryMediaWorkflowListResponse.setNonExistMediaWorkflowIds(nonExistMediaWorkflowIds);<NEW_LINE>List<MediaWorkflow> mediaWorkflowList = new ArrayList<MediaWorkflow>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("QueryMediaWorkflowListResponse.MediaWorkflowList.Length"); i++) {<NEW_LINE>MediaWorkflow mediaWorkflow = new MediaWorkflow();<NEW_LINE>mediaWorkflow.setCreationTime(_ctx.stringValue("QueryMediaWorkflowListResponse.MediaWorkflowList[" + i + "].CreationTime"));<NEW_LINE>mediaWorkflow.setMediaWorkflowId(_ctx.stringValue("QueryMediaWorkflowListResponse.MediaWorkflowList[" + i + "].MediaWorkflowId"));<NEW_LINE>mediaWorkflow.setState(_ctx.stringValue("QueryMediaWorkflowListResponse.MediaWorkflowList[" + i + "].State"));<NEW_LINE>mediaWorkflow.setTriggerMode(_ctx.stringValue("QueryMediaWorkflowListResponse.MediaWorkflowList[" + i + "].TriggerMode"));<NEW_LINE>mediaWorkflow.setName(_ctx.stringValue("QueryMediaWorkflowListResponse.MediaWorkflowList[" + i + "].Name"));<NEW_LINE>mediaWorkflow.setTopology(_ctx.stringValue("QueryMediaWorkflowListResponse.MediaWorkflowList[" + i + "].Topology"));<NEW_LINE>mediaWorkflowList.add(mediaWorkflow);<NEW_LINE>}<NEW_LINE>queryMediaWorkflowListResponse.setMediaWorkflowList(mediaWorkflowList);<NEW_LINE>return queryMediaWorkflowListResponse;<NEW_LINE>}
(_ctx.stringValue("QueryMediaWorkflowListResponse.RequestId"));
386,689
public Map<String, Object> handleJsonRequest(Map<String, ?> input) {<NEW_LINE>if (input == null) {<NEW_LINE>throw new BadRequestException("Malformed JSON");<NEW_LINE>}<NEW_LINE>String registrarId = (String) input.get(ID_PARAM);<NEW_LINE>if (Strings.isNullOrEmpty(registrarId)) {<NEW_LINE>throw new BadRequestException(String.format("Missing key for resource ID: %s", ID_PARAM));<NEW_LINE>}<NEW_LINE>// Process the operation. Though originally derived from a CRUD<NEW_LINE>// handler, registrar-settings really only supports read and update.<NEW_LINE>String op = Optional.ofNullable((String) input.get(OP_PARAM)).orElse("read");<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>Map<String, ?> args = (Map<String, Object>) Optional.<Object>ofNullable(input.get(ARGS_PARAM)).orElse(ImmutableMap.of());<NEW_LINE>logger.atInfo().log("Received request '%s' on registrar '%s' with args %s", op, registrarId, args);<NEW_LINE>String status = "SUCCESS";<NEW_LINE>try {<NEW_LINE>switch(op) {<NEW_LINE>case "update":<NEW_LINE>return update(<MASK><NEW_LINE>case "read":<NEW_LINE>return read(registrarId).toJsonResponse();<NEW_LINE>default:<NEW_LINE>throw new IllegalArgumentException("Unknown or unsupported operation: " + op);<NEW_LINE>}<NEW_LINE>} catch (Throwable e) {<NEW_LINE>logger.atWarning().withCause(e).log("Failed to perform operation '%s' on registrar '%s' for args %s", op, registrarId, args);<NEW_LINE>status = "ERROR: " + e.getClass().getSimpleName();<NEW_LINE>if (e instanceof FormFieldException) {<NEW_LINE>FormFieldException formFieldException = (FormFieldException) e;<NEW_LINE>return JsonResponseHelper.createFormFieldError(formFieldException.getMessage(), formFieldException.getFieldName());<NEW_LINE>}<NEW_LINE>return JsonResponseHelper.create(ERROR, Optional.ofNullable(e.getMessage()).orElse("Unspecified error"));<NEW_LINE>} finally {<NEW_LINE>registrarConsoleMetrics.registerSettingsRequest(registrarId, op, registrarAccessor.getRolesForRegistrar(registrarId), status);<NEW_LINE>}<NEW_LINE>}
args, registrarId).toJsonResponse();
1,256,506
private static List<String> convert(File snippetDirectory) {<NEW_LINE>List<String> snippets = new ArrayList<String>();<NEW_LINE>File[] plistFiles = findSnippetFiles(snippetDirectory);<NEW_LINE>if (plistFiles == null)<NEW_LINE>return snippets;<NEW_LINE>for (File plistFile : plistFiles) {<NEW_LINE>try {<NEW_LINE>Map<String, Object> properties = BundleConverter.parse(plistFile);<NEW_LINE>if (properties == null)<NEW_LINE>continue;<NEW_LINE>String name = BundleConverter.sanitize(properties, "name");<NEW_LINE>StringBuilder buffer = new StringBuilder();<NEW_LINE>buffer.append("snippet '").append(name).append("' do |s|\n");<NEW_LINE>String trigger = BundleConverter.sanitize(properties, "tabTrigger");<NEW_LINE>if (trigger != null) {<NEW_LINE>buffer.append(" s.trigger = '").append(trigger).append("'\n");<NEW_LINE>} else {<NEW_LINE>buffer.append(" # FIXME No tab trigger, probably needs to become command\n");<NEW_LINE>}<NEW_LINE>String keyBinding = BundleConverter.sanitize(properties, "keyEquivalent");<NEW_LINE>if (keyBinding != null) {<NEW_LINE>keyBinding = BundleConverter.convertKeyBinding(keyBinding);<NEW_LINE>buffer.append(" s.key_binding = '").append<MASK><NEW_LINE>}<NEW_LINE>String scope = BundleConverter.sanitize(properties, "scope");<NEW_LINE>if (scope != null) {<NEW_LINE>buffer.append(" s.scope = '").append(scope).append("'\n");<NEW_LINE>}<NEW_LINE>String content = BundleConverter.sanitize(properties, "content");<NEW_LINE>buffer.append(" s.expansion = '").append(content).append("'\n");<NEW_LINE>buffer.append("end\n\n");<NEW_LINE>snippets.add(buffer.toString());<NEW_LINE>} catch (Exception e) {<NEW_LINE>// TODO Auto-generated catch block<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return snippets;<NEW_LINE>}
(keyBinding).append("'\n");
225,587
protected SdkFileEntry generateEventStreamHandlerSourceFile(ServiceModel serviceModel, Map.Entry<String, Shape> shapeEntry) throws Exception {<NEW_LINE>Shape shape = shapeEntry.getValue();<NEW_LINE>if (shape.isRequest()) {<NEW_LINE>Template template = velocityEngine.getTemplate("/com/amazonaws/util/awsclientgenerator/velocity/cpp/xml/XmlRequestEventStreamHandlerSource.vm", StandardCharsets.UTF_8.name());<NEW_LINE>VelocityContext context = createContext(serviceModel);<NEW_LINE>for (Map.Entry<String, Operation> opEntry : serviceModel.getOperations().entrySet()) {<NEW_LINE>String key = opEntry.getKey();<NEW_LINE><MASK><NEW_LINE>if (op.getRequest() != null && op.getRequest().getShape().getName() == shape.getName() && op.getResult() != null) {<NEW_LINE>if (op.getResult().getShape().hasEventStreamMembers()) {<NEW_LINE>for (Map.Entry<String, ShapeMember> shapeMemberEntry : op.getResult().getShape().getMembers().entrySet()) {<NEW_LINE>if (shapeMemberEntry.getValue().getShape().isEventStream()) {<NEW_LINE>context.put("eventStreamShape", shapeMemberEntry.getValue().getShape());<NEW_LINE>context.put("operation", op);<NEW_LINE>context.put("shape", shape);<NEW_LINE>context.put("typeInfo", new CppShapeInformation(shape, serviceModel));<NEW_LINE>context.put("CppViewHelper", CppViewHelper.class);<NEW_LINE>String fileName = String.format("source/model/%sHandler.cpp", key);<NEW_LINE>return makeFile(template, context, fileName, true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
Operation op = opEntry.getValue();
1,490,030
private void createRedisTable() throws Exception {<NEW_LINE>// Get the master addresses.<NEW_LINE>Universe universe = Universe.getOrBadRequest(taskParams().universeUUID);<NEW_LINE>String masterAddresses = universe.getMasterAddresses();<NEW_LINE>log.info("Running {}: universe = {}, masterAddress = {}", getName(), taskParams().universeUUID, masterAddresses);<NEW_LINE>if (masterAddresses == null || masterAddresses.isEmpty()) {<NEW_LINE>throw new IllegalStateException("No master host/ports for a table creation op in " + taskParams().universeUUID);<NEW_LINE>}<NEW_LINE>String certificate = universe.getCertificateNodetoNode();<NEW_LINE>YBClient client = null;<NEW_LINE>try {<NEW_LINE>client = ybService.getClient(masterAddresses, certificate);<NEW_LINE>if (StringUtils.isEmpty(taskParams().tableName)) {<NEW_LINE>taskParams().tableName = YBClient.REDIS_DEFAULT_TABLE_NAME;<NEW_LINE>}<NEW_LINE>YBTable table = client.createRedisTable(taskParams().tableName);<NEW_LINE>log.info("Created table '{}' of type {}.", table.getName(), table.getTableType());<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
ybService.closeClient(client, masterAddresses);
1,039,598
private static String resolveType(String elementTypeName, RefactoringStatus status, IType declaringType, IProgressMonitor pm) throws CoreException {<NEW_LINE>String[][] fqns = declaringType.resolveType(elementTypeName);<NEW_LINE>if (fqns != null) {<NEW_LINE>if (fqns.length == 1) {<NEW_LINE>return JavaModelUtil.concatenateName(fqns[0][0], fqns[0][1]);<NEW_LINE>} else if (fqns.length > 1) {<NEW_LINE>String[] keys = { BasicElementLabels.getJavaElementName(elementTypeName), String.valueOf(fqns.length) };<NEW_LINE>String msg = Messages.format(RefactoringCoreMessages.TypeContextChecker_ambiguous, keys);<NEW_LINE>status.addError(msg);<NEW_LINE>return elementTypeName;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<TypeNameMatch> typeRefsFound = findTypeInfos(elementTypeName, declaringType, pm);<NEW_LINE>if (typeRefsFound.isEmpty()) {<NEW_LINE>String msg = Messages.format(RefactoringCoreMessages.TypeContextChecker_not_unique<MASK><NEW_LINE>status.addError(msg);<NEW_LINE>return elementTypeName;<NEW_LINE>} else if (typeRefsFound.size() == 1) {<NEW_LINE>TypeNameMatch typeInfo = typeRefsFound.get(0);<NEW_LINE>return typeInfo.getFullyQualifiedName();<NEW_LINE>} else {<NEW_LINE>Assert.isTrue(typeRefsFound.size() > 1);<NEW_LINE>String[] keys = { BasicElementLabels.getJavaElementName(elementTypeName), String.valueOf(typeRefsFound.size()) };<NEW_LINE>String msg = Messages.format(RefactoringCoreMessages.TypeContextChecker_ambiguous, keys);<NEW_LINE>status.addError(msg);<NEW_LINE>return elementTypeName;<NEW_LINE>}<NEW_LINE>}
, BasicElementLabels.getJavaElementName(elementTypeName));
263,383
public Map<Path, Path> normalize(final Map<Path, Path> files) {<NEW_LINE>final Map<Path, Path> normalized = new HashMap<Path, Path>();<NEW_LINE>Iterator<Path> sourcesIter = files.keySet().iterator();<NEW_LINE>Iterator<Path> destinationsIter = files.values().iterator();<NEW_LINE>while (sourcesIter.hasNext()) {<NEW_LINE><MASK><NEW_LINE>Path destination = destinationsIter.next();<NEW_LINE>boolean duplicate = false;<NEW_LINE>for (Iterator<Path> normalizedIter = normalized.keySet().iterator(); normalizedIter.hasNext(); ) {<NEW_LINE>Path n = normalizedIter.next();<NEW_LINE>if (source.isChild(n)) {<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug(String.format("Remove path %s already included by directory", source.getAbsolute()));<NEW_LINE>}<NEW_LINE>// The selected file is a child of a directory already included<NEW_LINE>duplicate = true;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (n.isChild(source)) {<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug(String.format("Remove path %s already included by directory", n.getAbsolute()));<NEW_LINE>}<NEW_LINE>// Remove the previously added file as it is a child<NEW_LINE>// of the currently evaluated file<NEW_LINE>normalizedIter.remove();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!duplicate) {<NEW_LINE>normalized.put(source, destination);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return normalized;<NEW_LINE>}
Path source = sourcesIter.next();
1,509,190
private void handleProperty(EntityType entityType, Class<?> cl, Attribute<?, ?> p) throws NoSuchMethodException, ClassNotFoundException {<NEW_LINE>Class<?> clazz = Object.class;<NEW_LINE>try {<NEW_LINE>clazz = p.getJavaType();<NEW_LINE>} catch (MappingException e) {<NEW_LINE>// ignore<NEW_LINE>}<NEW_LINE>Type propertyType = getType(cl, clazz, p.getName());<NEW_LINE>AnnotatedElement annotated = getAnnotatedElement(cl, p.getName());<NEW_LINE>propertyType = getTypeOverride(propertyType, annotated);<NEW_LINE>if (propertyType == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (p.isCollection()) {<NEW_LINE>if (p instanceof MapAttribute) {<NEW_LINE>MapAttribute<?, ?, ?> map = (MapAttribute<?, ?, ?>) p;<NEW_LINE>Type keyType = typeFactory.get(map.getKeyJavaType());<NEW_LINE>Type valueType = typeFactory.get(map.getElementType().getJavaType());<NEW_LINE>valueType = getPropertyType(p, valueType);<NEW_LINE>propertyType = new SimpleType(propertyType, normalize(propertyType.getParameters().get(0), keyType), normalize(propertyType.getParameters().get(1), valueType));<NEW_LINE>} else {<NEW_LINE>Type valueType = typeFactory.get(((PluralAttribute<?, ?, ?>) p).getElementType().getJavaType());<NEW_LINE>valueType = getPropertyType(p, valueType);<NEW_LINE>propertyType = new SimpleType(propertyType, normalize(propertyType.getParameters().<MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>propertyType = getPropertyType(p, propertyType);<NEW_LINE>}<NEW_LINE>Property property = createProperty(entityType, p.getName(), propertyType, annotated);<NEW_LINE>entityType.addProperty(property);<NEW_LINE>}
get(0), valueType));
1,677,011
private final ExprNode processSetOfAll(TreeNode treeNode, TreeNode[] children, ModuleNode cm) throws AbortException {<NEW_LINE>ExprNode[] ops = new ExprNode[1];<NEW_LINE>int length = (children.length - 3) / 2;<NEW_LINE>FormalParamNode[][] odna = new FormalParamNode[length][0];<NEW_LINE>boolean[] tuples = new boolean[length];<NEW_LINE>ExprNode[<MASK><NEW_LINE>symbolTable.pushContext(new Context(moduleTable, errors));<NEW_LINE>processQuantBoundArgs(children, 3, odna, tuples, exprs, cm);<NEW_LINE>pushFormalParams(flattenParams(odna));<NEW_LINE>ops[0] = generateExpression(children[1], cm);<NEW_LINE>popFormalParams();<NEW_LINE>symbolTable.popContext();<NEW_LINE>return new OpApplNode(OP_soa, null, ops, odna, tuples, exprs, treeNode, cm);<NEW_LINE>}
] exprs = new ExprNode[length];
1,847,595
void paint(@Nonnull Graphics2D g) {<NEW_LINE>Rectangle clip = g.getClipBounds();<NEW_LINE>if (clip == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>BufferedImage buffer = Registry.is("editor.dumb.mode.available") ? getUserData(BUFFER) : null;<NEW_LINE>if (buffer != null) {<NEW_LINE>Rectangle rect = getContentComponent().getVisibleRect();<NEW_LINE>UIUtil.drawImage(g, buffer, null, <MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (isReleased) {<NEW_LINE>g.setColor(getDisposedBackground());<NEW_LINE>g.fillRect(clip.x, clip.y, clip.width, clip.height);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (myUpdateCursor) {<NEW_LINE>setCursorPosition();<NEW_LINE>myUpdateCursor = false;<NEW_LINE>}<NEW_LINE>if (myProject != null && myProject.isDisposed())<NEW_LINE>return;<NEW_LINE>myView.paint(g);<NEW_LINE>// boolean isBackgroundImageSet = IdeBackgroundUtil.isEditorBackgroundImageSet(myProject);<NEW_LINE>// if (myBackgroundImageSet != isBackgroundImageSet) {<NEW_LINE>// myBackgroundImageSet = isBackgroundImageSet;<NEW_LINE>// updateOpaque(myScrollPane.getHorizontalScrollBar());<NEW_LINE>// updateOpaque(myScrollPane.getVerticalScrollBar());<NEW_LINE>// }<NEW_LINE>}
rect.x, rect.y);
1,409,182
static void run_till_stable(int num_threads, int num_trials, int impl) {<NEW_LINE>Counter C = make_ctr(impl);<NEW_LINE>System.out.printf("=== %10.10s %3d cnts/sec=", C.name(), num_threads);<NEW_LINE>// Number of trials<NEW_LINE>long[] trials = new long[num_trials];<NEW_LINE>// Total ops altogether<NEW_LINE>long total_ops = 0;<NEW_LINE>// Sum of ops/sec for each run<NEW_LINE>long total_ops_sec = 0;<NEW_LINE>// Run some trials<NEW_LINE>for (int j = 0; j < trials.length; j++) {<NEW_LINE>long[] ops = new long[num_threads];<NEW_LINE>long millis = run_once(num_threads, C, ops);<NEW_LINE>long sum = 0;<NEW_LINE>for (int i = 0; i < num_threads; i++) sum += ops[i];<NEW_LINE>total_ops += sum;<NEW_LINE>sum = sum * 1000L / millis;<NEW_LINE>trials[j] = sum;<NEW_LINE>total_ops_sec += sum;<NEW_LINE>System.out.printf(" %10d", sum);<NEW_LINE>}<NEW_LINE>// Compute nice trial results<NEW_LINE>if (trials.length > 2) {<NEW_LINE>// Toss out low & high<NEW_LINE>int lo = 0;<NEW_LINE>int hi = 0;<NEW_LINE>for (int j = 1; j < trials.length; j++) {<NEW_LINE>if (trials[lo] > trials[j])<NEW_LINE>lo = j;<NEW_LINE>if (trials[hi] < trials[j])<NEW_LINE>hi = j;<NEW_LINE>}<NEW_LINE>long total2 = total_ops_sec - (trials[lo] + trials[hi]);<NEW_LINE>trials[lo] = trials[trials.length - 1];<NEW_LINE>trials[hi] = trials[trials.length - 2];<NEW_LINE>// Print avg,stddev<NEW_LINE>long avg = total2 / (trials.length - 2);<NEW_LINE>long stddev = compute_stddev(trials, trials.length - 2);<NEW_LINE>// std-dev as a percent<NEW_LINE>long p = stddev * 100 / avg;<NEW_LINE>System.out.printf(" %10d", avg);<NEW_LINE>System.out.printf(" (+/-%2d%%)", p);<NEW_LINE>}<NEW_LINE>long loss = total_ops - C.get();<NEW_LINE>if (loss != 0) {<NEW_LINE><MASK><NEW_LINE>int loss_per = (int) (loss * 100 / total_ops);<NEW_LINE>System.out.print(loss_per == 0 ? ("" + loss) : ("" + loss_per + "%"));<NEW_LINE>}<NEW_LINE>if (C instanceof CATCounter) {<NEW_LINE>CATCounter cat = (CATCounter) C;<NEW_LINE>System.out.print(" autotable=" + cat.internal_size());<NEW_LINE>if (loss != 0)<NEW_LINE>cat.print();<NEW_LINE>}<NEW_LINE>System.out.println();<NEW_LINE>}
System.out.print(" Lossage=");
179,188
// this method is called by its superclass during a read loop<NEW_LINE>@Override<NEW_LINE>protected void readField(long recordsToReadInThisPass) {<NEW_LINE>recordsReadInThisIteration = Math.min(pageReader.pageValueCount - pageReader.valuesRead, recordsToReadInThisPass - valuesReadInCurrentPass);<NEW_LINE>if (recordsRequireDecoding()) {<NEW_LINE>ValuesReader valReader = usingDictionary ? pageReader.getDictionaryValueReader<MASK><NEW_LINE>VarBinaryVector.Mutator mutator = valueVec.getMutator();<NEW_LINE>Binary currDictValToWrite = null;<NEW_LINE>for (int i = 0; i < recordsReadInThisIteration; i++) {<NEW_LINE>currDictValToWrite = valReader.readBytes();<NEW_LINE>mutator.setSafe(valuesReadInCurrentPass + i, currDictValToWrite.toByteBuffer().slice(), 0, currDictValToWrite.length());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>super.readField(recordsToReadInThisPass);<NEW_LINE>}<NEW_LINE>// TODO - replace this with fixed binary type in drill<NEW_LINE>// now we need to write the lengths of each value<NEW_LINE>int byteLength = dataTypeLengthInBits / 8;<NEW_LINE>for (int i = 0; i < recordsToReadInThisPass; i++) {<NEW_LINE>valueVec.getMutator().setValueLengthSafe(valuesReadInCurrentPass + i, byteLength);<NEW_LINE>}<NEW_LINE>}
() : pageReader.getValueReader();
1,049,136
final ListPipelineParametersForExecutionResult executeListPipelineParametersForExecution(ListPipelineParametersForExecutionRequest listPipelineParametersForExecutionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listPipelineParametersForExecutionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListPipelineParametersForExecutionRequest> request = null;<NEW_LINE>Response<ListPipelineParametersForExecutionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListPipelineParametersForExecutionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listPipelineParametersForExecutionRequest));<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, "SageMaker");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListPipelineParametersForExecution");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListPipelineParametersForExecutionResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListPipelineParametersForExecutionResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
endClientExecution(awsRequestMetrics, request, response);
1,256,726
public List<ConsumerGroup> findByName(String clusterId, List<String> groups) throws ExecutionException, InterruptedException {<NEW_LINE>Optional<List<String>> consumerGroupRegex = getConsumerGroupFilterRegex();<NEW_LINE>List<String> filteredConsumerGroups = groups.stream().filter(t -> isMatchRegex(consumerGroupRegex, t)).collect(Collectors.toList());<NEW_LINE>Map<String, ConsumerGroupDescription> consumerDescriptions = kafkaWrapper.describeConsumerGroups(clusterId, filteredConsumerGroups);<NEW_LINE>Map<String, Map<TopicPartition, OffsetAndMetadata>> groupGroupsOffsets = consumerDescriptions.keySet().stream().map(group -> {<NEW_LINE>try {<NEW_LINE>return new AbstractMap.SimpleEntry<>(group, kafkaWrapper.consumerGroupsOffsets(clusterId, group));<NEW_LINE>} catch (ExecutionException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>}).collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));<NEW_LINE>List<String> topics = groupGroupsOffsets.values().stream().map(Map::keySet).flatMap(Set::stream).map(TopicPartition::topic).distinct().collect(Collectors.toList());<NEW_LINE>Map<String, List<Partition.Offsets>> topicTopicsOffsets = <MASK><NEW_LINE>return consumerDescriptions.values().stream().map(consumerGroupDescription -> new ConsumerGroup(consumerGroupDescription, groupGroupsOffsets.get(consumerGroupDescription.groupId()), groupGroupsOffsets.get(consumerGroupDescription.groupId()).keySet().stream().map(TopicPartition::topic).distinct().collect(Collectors.toMap(Function.identity(), topicTopicsOffsets::get)))).sorted(Comparator.comparing(ConsumerGroup::getId)).collect(Collectors.toList());<NEW_LINE>}
kafkaWrapper.describeTopicsOffsets(clusterId, topics);
1,622,284
public okhttp3.Call updatePetCall(Pet pet, final ApiCallback _callback) throws ApiException {<NEW_LINE>String basePath = null;<NEW_LINE>// Operation Servers<NEW_LINE>String[] localBasePaths = new String[] { "http://petstore.swagger.io/v2", "http://path-server-test.petstore.local/v2" };<NEW_LINE>// Determine Base Path to Use<NEW_LINE>if (localCustomBaseUrl != null) {<NEW_LINE>basePath = localCustomBaseUrl;<NEW_LINE>} else if (localBasePaths.length > 0) {<NEW_LINE>basePath = localBasePaths[localHostIndex];<NEW_LINE>} else {<NEW_LINE>basePath = null;<NEW_LINE>}<NEW_LINE>Object localVarPostBody = pet;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/pet";<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, String> localVarCookieParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE><MASK><NEW_LINE>final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null) {<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>}<NEW_LINE>final String[] localVarContentTypes = { "application/json", "application/xml" };<NEW_LINE>final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>if (localVarContentType != null) {<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>}<NEW_LINE>String[] localVarAuthNames = new String[] { "http_signature_test", "petstore_auth" };<NEW_LINE>return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);<NEW_LINE>}
final String[] localVarAccepts = {};
690,585
private void parseFromBtcLockSender(BtcLockSender btcLockSender) {<NEW_LINE>this.protocolVersion = 0;<NEW_LINE>this.rskDestinationAddress = btcLockSender.getRskAddress();<NEW_LINE>this.btcRefundAddress = btcLockSender.getBTCAddress();<NEW_LINE>this.senderBtcAddress = btcLockSender.getBTCAddress();<NEW_LINE>this.senderBtcAddressType = btcLockSender.getTxSenderAddressType();<NEW_LINE>logger.trace("[parseFromBtcLockSender] Protocol version: {}", this.protocolVersion);<NEW_LINE>logger.trace("[parseFromBtcLockSender] RSK destination address: {}", btcLockSender.getRskAddress());<NEW_LINE>logger.trace("[parseFromBtcLockSender] BTC refund address: {}", btcLockSender.getBTCAddress());<NEW_LINE>logger.trace("[parseFromBtcLockSender] Sender BTC address: {}", btcLockSender.getBTCAddress());<NEW_LINE>logger.trace(<MASK><NEW_LINE>}
"[parseFromBtcLockSender] Sender BTC address type: {}", btcLockSender.getTxSenderAddressType());
1,219,955
static public void apply(@NotNull String methodName, @NotNull MethodReference reference, @NotNull ProblemsHolder holder) {<NEW_LINE>if (methodName.equals("will")) {<NEW_LINE>final PsiElement[] arguments = reference.getParameters();<NEW_LINE>if (arguments.length == 1 && arguments[0] instanceof MethodReference) {<NEW_LINE>final MethodReference innerReference <MASK><NEW_LINE>final String innerMethodName = innerReference.getName();<NEW_LINE>if (innerMethodName != null && methodsMapping.containsKey(innerMethodName)) {<NEW_LINE>final PsiElement[] innerArguments = innerReference.getParameters();<NEW_LINE>if (innerArguments.length == 1) {<NEW_LINE>final String suggestedAssertion = methodsMapping.get(innerMethodName);<NEW_LINE>holder.registerProblem(reference, String.format(MessagesPresentationUtil.prefixWithEa(messagePattern), suggestedAssertion), new PhpUnitAssertFixer(suggestedAssertion, new String[] { innerArguments[0].getText() }));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
= (MethodReference) arguments[0];
687,507
protected int countByC_U(String companyId, String userId) throws SystemException {<NEW_LINE>Session session = null;<NEW_LINE>try {<NEW_LINE>session = openSession();<NEW_LINE>StringBuffer query = new StringBuffer();<NEW_LINE>query.append("SELECT COUNT(*) ");<NEW_LINE>query.append("FROM User_ IN CLASS com.liferay.portal.ejb.UserHBM WHERE ");<NEW_LINE>query.append("companyId = ?");<NEW_LINE>query.append(" AND ");<NEW_LINE>query.append("userId = ?");<NEW_LINE>query.append(" AND delete_in_progress = ");<NEW_LINE>query.append(DbConnectionFactory.getDBFalse());<NEW_LINE>Query q = session.createQuery(query.toString());<NEW_LINE>int queryPos = 0;<NEW_LINE>q.setString(queryPos++, companyId);<NEW_LINE>q<MASK><NEW_LINE>Iterator itr = q.list().iterator();<NEW_LINE>if (itr.hasNext()) {<NEW_LINE>Integer count = (Integer) itr.next();<NEW_LINE>if (count != null) {<NEW_LINE>return count.intValue();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return 0;<NEW_LINE>} catch (HibernateException he) {<NEW_LINE>throw new SystemException(he);<NEW_LINE>}<NEW_LINE>}
.setString(queryPos++, userId);
1,208,686
public static TrainEA constructNEATTrainer(final NEATPopulation population, final CalculateScore calculateScore) {<NEW_LINE>final TrainEA result = new TrainEA(population, calculateScore);<NEW_LINE>result.setSpeciation(new OriginalNEATSpeciation());<NEW_LINE>result.setSelection(new TruncationSelection(result, 0.3));<NEW_LINE>final CompoundOperator weightMutation = new CompoundOperator();<NEW_LINE>weightMutation.getComponents().add(0.1125, new NEATMutateWeights(new SelectFixed(1), new MutatePerturbLinkWeight(0.02)));<NEW_LINE>weightMutation.getComponents().add(0.1125, new NEATMutateWeights(new SelectFixed(2), new MutatePerturbLinkWeight(0.02)));<NEW_LINE>weightMutation.getComponents().add(0.1125, new NEATMutateWeights(new SelectFixed(3), new MutatePerturbLinkWeight(0.02)));<NEW_LINE>weightMutation.getComponents().add(0.1125, new NEATMutateWeights(new SelectProportion(0.02), new MutatePerturbLinkWeight(0.02)));<NEW_LINE>weightMutation.getComponents().add(0.1125, new NEATMutateWeights(new SelectFixed(1), new MutatePerturbLinkWeight(1)));<NEW_LINE>weightMutation.getComponents().add(0.1125, new NEATMutateWeights(new SelectFixed(2)<MASK><NEW_LINE>weightMutation.getComponents().add(0.1125, new NEATMutateWeights(new SelectFixed(3), new MutatePerturbLinkWeight(1)));<NEW_LINE>weightMutation.getComponents().add(0.1125, new NEATMutateWeights(new SelectProportion(0.02), new MutatePerturbLinkWeight(1)));<NEW_LINE>weightMutation.getComponents().add(0.03, new NEATMutateWeights(new SelectFixed(1), new MutateResetLinkWeight()));<NEW_LINE>weightMutation.getComponents().add(0.03, new NEATMutateWeights(new SelectFixed(2), new MutateResetLinkWeight()));<NEW_LINE>weightMutation.getComponents().add(0.03, new NEATMutateWeights(new SelectFixed(3), new MutateResetLinkWeight()));<NEW_LINE>weightMutation.getComponents().add(0.01, new NEATMutateWeights(new SelectProportion(0.02), new MutateResetLinkWeight()));<NEW_LINE>weightMutation.getComponents().finalizeStructure();<NEW_LINE>result.setChampMutation(weightMutation);<NEW_LINE>result.addOperation(0.5, new NEATCrossover());<NEW_LINE>result.addOperation(0.494, weightMutation);<NEW_LINE>result.addOperation(0.0005, new NEATMutateAddNode());<NEW_LINE>result.addOperation(0.005, new NEATMutateAddLink());<NEW_LINE>result.addOperation(0.0005, new NEATMutateRemoveLink());<NEW_LINE>result.getOperators().finalizeStructure();<NEW_LINE>if (population.isHyperNEAT()) {<NEW_LINE>result.setCODEC(new HyperNEATCODEC());<NEW_LINE>} else {<NEW_LINE>result.setCODEC(new NEATCODEC());<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
, new MutatePerturbLinkWeight(1)));
1,557,324
protected Handlers createHandlers(Config config) {<NEW_LINE>LoggingOptions loggingOptions = new LoggingOptions(config);<NEW_LINE>Tracer tracer = loggingOptions.getTracer();<NEW_LINE>NetworkOptions networkOptions = new NetworkOptions(config);<NEW_LINE>HttpClient.Factory clientFactory = networkOptions.getHttpClientFactory(tracer);<NEW_LINE>BaseServerOptions serverOptions = new BaseServerOptions(config);<NEW_LINE>SecretOptions secretOptions = new SecretOptions(config);<NEW_LINE>Secret secret = secretOptions.getRegistrationSecret();<NEW_LINE>SessionMapOptions sessionsOptions = new SessionMapOptions(config);<NEW_LINE>SessionMap sessions = sessionsOptions.getSessionMap();<NEW_LINE>NewSessionQueueOptions newSessionQueueOptions = new NewSessionQueueOptions(config);<NEW_LINE>URL sessionQueueUrl = fromUri(newSessionQueueOptions.getSessionQueueUri());<NEW_LINE>Duration sessionRequestTimeout = newSessionQueueOptions.getSessionRequestTimeout();<NEW_LINE>ClientConfig httpClientConfig = ClientConfig.defaultConfig().baseUrl(sessionQueueUrl).readTimeout(sessionRequestTimeout);<NEW_LINE>NewSessionQueue queue = new RemoteNewSessionQueue(tracer, clientFactory.createClient(httpClientConfig), secret);<NEW_LINE>DistributorOptions distributorOptions = new DistributorOptions(config);<NEW_LINE>URL distributorUrl = fromUri(distributorOptions.getDistributorUri());<NEW_LINE>Distributor distributor = new RemoteDistributor(tracer, clientFactory, distributorUrl, secret);<NEW_LINE>GraphqlHandler graphqlHandler = new GraphqlHandler(tracer, distributor, queue, serverOptions.getExternalUri(), getServerVersion());<NEW_LINE>Routable ui = new GridUiRoute();<NEW_LINE>Router router = new Router(tracer, clientFactory, sessions, queue, distributor);<NEW_LINE>Routable routerWithSpecChecks = router.with(networkOptions.getSpecComplianceChecks());<NEW_LINE>Routable route = Route.combine(ui, routerWithSpecChecks, Route.prefix("/wd/hub").to(combine(routerWithSpecChecks)), Route.options("/graphql").to(() -> graphqlHandler), Route.post("/graphql").to(() -> graphqlHandler));<NEW_LINE><MASK><NEW_LINE>if (uap != null) {<NEW_LINE>LOG.info("Requiring authentication to connect");<NEW_LINE>route = route.with(new BasicAuthenticationFilter(uap.username(), uap.password()));<NEW_LINE>}<NEW_LINE>HttpHandler readinessCheck = req -> {<NEW_LINE>boolean ready = router.isReady();<NEW_LINE>return new HttpResponse().setStatus(ready ? HTTP_OK : HTTP_UNAVAILABLE).setContent(Contents.utf8String("Router is " + ready));<NEW_LINE>};<NEW_LINE>// Since k8s doesn't make it easy to do an authenticated liveness probe, allow unauthenticated access to it.<NEW_LINE>Routable routeWithLiveness = Route.combine(route, get("/readyz").to(() -> readinessCheck));<NEW_LINE>return new Handlers(routeWithLiveness, new ProxyWebsocketsIntoGrid(clientFactory, sessions));<NEW_LINE>}
UsernameAndPassword uap = secretOptions.getServerAuthentication();
1,173,977
public static void main(String[] args) throws IOException {<NEW_LINE>DataSource video_file = new FileDataSourceImpl("c:/dev/mp4parser2/source_video.h264");<NEW_LINE>DataSource audio_file = new FileDataSourceImpl("c:/dev/mp4parser2/source_audio.aac");<NEW_LINE>int duration = 30472;<NEW_LINE>// supplied duration for the attached file was<NEW_LINE>H264TrackImpl h264Track = new H264TrackImpl(<MASK><NEW_LINE>AACTrackImpl aacTrack = new AACTrackImpl(audio_file);<NEW_LINE>Movie movie = new Movie();<NEW_LINE>movie.addTrack(h264Track);<NEW_LINE>// movie.addTrack(aacTrack);<NEW_LINE>Container out = new DefaultMp4Builder().build(movie);<NEW_LINE>FileOutputStream fos = new FileOutputStream(new File("c:/dev/mp4parser2/checkme.mp4"));<NEW_LINE>out.writeContainer(fos.getChannel());<NEW_LINE>fos.close();<NEW_LINE>}
video_file, "eng", 15000, 1001);
773,362
public void printTo(PrintStream out) {<NEW_LINE>if (benchmarkTitle != null) {<NEW_LINE>out.println("Title: " + benchmarkTitle);<NEW_LINE>}<NEW_LINE>out.println("Project dir: " + getProjectDir());<NEW_LINE>out.println("Output dir: " + getOutputDir());<NEW_LINE>out.println("Profiler: " + getProfiler());<NEW_LINE>out.println("Benchmark: " + isBenchmark());<NEW_LINE>out.<MASK><NEW_LINE>out.println("Gradle User Home: " + getGradleUserHome());<NEW_LINE>out.println("Targets: " + getTargets());<NEW_LINE>if (warmupCount != null) {<NEW_LINE>out.println("Warm-ups: " + warmupCount);<NEW_LINE>}<NEW_LINE>if (iterations != null) {<NEW_LINE>out.println("Builds: " + iterations);<NEW_LINE>}<NEW_LINE>if (!getSystemProperties().isEmpty()) {<NEW_LINE>out.println("System properties:");<NEW_LINE>for (Map.Entry<String, String> entry : getSystemProperties().entrySet()) {<NEW_LINE>out.println(" " + entry.getKey() + "=" + entry.getValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
println("Versions: " + getVersions());
126,378
public Request<ComposeEnvironmentsRequest> marshall(ComposeEnvironmentsRequest composeEnvironmentsRequest) {<NEW_LINE>if (composeEnvironmentsRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<ComposeEnvironmentsRequest> request = new DefaultRequest<ComposeEnvironmentsRequest>(composeEnvironmentsRequest, "AWSElasticBeanstalk");<NEW_LINE><MASK><NEW_LINE>request.addParameter("Version", "2010-12-01");<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>if (composeEnvironmentsRequest.getApplicationName() != null) {<NEW_LINE>request.addParameter("ApplicationName", StringUtils.fromString(composeEnvironmentsRequest.getApplicationName()));<NEW_LINE>}<NEW_LINE>if (composeEnvironmentsRequest.getGroupName() != null) {<NEW_LINE>request.addParameter("GroupName", StringUtils.fromString(composeEnvironmentsRequest.getGroupName()));<NEW_LINE>}<NEW_LINE>if (!composeEnvironmentsRequest.getVersionLabels().isEmpty() || !((com.amazonaws.internal.SdkInternalList<String>) composeEnvironmentsRequest.getVersionLabels()).isAutoConstruct()) {<NEW_LINE>com.amazonaws.internal.SdkInternalList<String> versionLabelsList = (com.amazonaws.internal.SdkInternalList<String>) composeEnvironmentsRequest.getVersionLabels();<NEW_LINE>int versionLabelsListIndex = 1;<NEW_LINE>for (String versionLabelsListValue : versionLabelsList) {<NEW_LINE>if (versionLabelsListValue != null) {<NEW_LINE>request.addParameter("VersionLabels.member." + versionLabelsListIndex, StringUtils.fromString(versionLabelsListValue));<NEW_LINE>}<NEW_LINE>versionLabelsListIndex++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
request.addParameter("Action", "ComposeEnvironments");
267,042
private static String createIdFieldInitialization(String idPropertyType, String valueVar) {<NEW_LINE>String idField;<NEW_LINE>// PENDING cannot assume that key type is Integer, Long, String, int or long<NEW_LINE>if ("char".equals(idPropertyType)) {<NEW_LINE>idField = valueVar + ".charAt(0);";<NEW_LINE>} else if (PRIMITIVE_TYPES.containsKey(idPropertyType)) {<NEW_LINE>String objectType = PRIMITIVE_TYPES.get(idPropertyType);<NEW_LINE>String methodName = "parse" + idPropertyType.substring(0, 1).toUpperCase() + idPropertyType.substring(1);<NEW_LINE>idField = objectType + "." + methodName + "(" + valueVar + ")";<NEW_LINE>} else if (idPropertyType.equals("java.math.BigInteger") || "BigInteger".equals(idPropertyType)) {<NEW_LINE>idField = "new java.math.BigInteger(" + valueVar + ")";<NEW_LINE>} else if (idPropertyType.equals("java.math.BigDecimal") || "BigDecimal".equals(idPropertyType)) {<NEW_LINE>idField = "new java.math.BigDecimal(" + valueVar + ")";<NEW_LINE>} else if (idPropertyType.equals("java.lang.String") || "String".equals(idPropertyType)) {<NEW_LINE>idField = valueVar;<NEW_LINE>} else if (idPropertyType.equals("java.lang.Character") || "Character".equals(idPropertyType)) {<NEW_LINE>idField = "new Character(" + valueVar + ".charAt(0))";<NEW_LINE>} else if (idPropertyType.startsWith("java.lang.")) {<NEW_LINE>String shortName = idPropertyType.substring(10);<NEW_LINE>idField = "new " + shortName + "(" + valueVar + ")";<NEW_LINE>} else if (CONVERTED_TYPES.contains(idPropertyType)) {<NEW_LINE>idField = "new " + idPropertyType + "(" + valueVar + ")";<NEW_LINE>} else {<NEW_LINE>idField = "(" + idPropertyType + ") javax.faces.context.FacesContext.getCurrentInstance().getApplication().\n" + "createConverter(" + idPropertyType <MASK><NEW_LINE>}<NEW_LINE>return idField;<NEW_LINE>}
+ ".class).getAsObject(FacesContext.\n" + "getCurrentInstance(), null, " + valueVar + ")";
1,769,920
private static ExpressionBracket extractExprWithinParenthesis(String workingExpr) {<NEW_LINE>char[<MASK><NEW_LINE>int offsetOpenBracket = workingExpr.indexOf(OPEN_BRACKET);<NEW_LINE>int offsetEnd = offsetOpenBracket + 1;<NEW_LINE>int bracketLevel = 0;<NEW_LINE>boolean closeBrackFound = false;<NEW_LINE>while (!closeBrackFound) {<NEW_LINE>if (caracteres[offsetEnd] == OPEN_BRACKET) {<NEW_LINE>bracketLevel++;<NEW_LINE>}<NEW_LINE>if (caracteres[offsetEnd] == CLOSE_BRACKET) {<NEW_LINE>if (bracketLevel == 0) {<NEW_LINE>closeBrackFound = true;<NEW_LINE>}<NEW_LINE>bracketLevel--;<NEW_LINE>}<NEW_LINE>offsetEnd++;<NEW_LINE>}<NEW_LINE>// Expression Within parenthesis<NEW_LINE>String withinBracketExpr = workingExpr.substring(offsetOpenBracket + 1, offsetEnd - 1);<NEW_LINE>return new ExpressionBracket(withinBracketExpr, offsetEnd);<NEW_LINE>}
] caracteres = workingExpr.toCharArray();
1,402,152
protected void updateLocales() {<NEW_LINE>final List<Locale> data;<NEW_LINE>if (CollectionUtils.notEmpty(locales)) {<NEW_LINE>// If locales are limited we use all supported ones from the limitation list<NEW_LINE>data = LanguageManager.getSupportedLocales(locales);<NEW_LINE>} else {<NEW_LINE>// If locales are not explicitly limited we use all supported ones<NEW_LINE>data = new ArrayList<Locale>(LanguageManager.getSupportedLocales());<NEW_LINE>// We also try to add default system locale into the list if it is not there yet<NEW_LINE>// This will help us to avoid confusion of supported system local being initially selected while not in the options list<NEW_LINE>final Locale systemLocale = LanguageUtils.getSystemLocale();<NEW_LINE>if (LanguageManager.isSuportedLocale(systemLocale) && !data.contains(systemLocale)) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>setAll(data);<NEW_LINE>// Selected locale will always be selected in LanguageChooser as well<NEW_LINE>// Even if it is not included into limitation list or it is not even supported<NEW_LINE>// That is why you have to handle initialy selected language properly within your application<NEW_LINE>setSelectedItem(LanguageManager.getLocale());<NEW_LINE>}
data.add(0, systemLocale);
661,930
public Object visit(Object context1, DeleteOpExpression expr, boolean strict) {<NEW_LINE>ExecutionContext context = (ExecutionContext) context1;<NEW_LINE>Object result = expr.getExpr().accept(context, this, strict);<NEW_LINE>if (!(result instanceof Reference)) {<NEW_LINE>return (true);<NEW_LINE>}<NEW_LINE>Reference ref = (Reference) result;<NEW_LINE>if (ref.isUnresolvableReference()) {<NEW_LINE>if (strict) {<NEW_LINE>throw new ThrowException(context, context.createSyntaxError("cannot delete unresolvable reference"));<NEW_LINE>} else {<NEW_LINE>return (true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (ref.isPropertyReference()) {<NEW_LINE>return (Types.toObject(context, ref.getBase()).delete(context, ref.getReferencedName(), ref.isStrictReference()));<NEW_LINE>}<NEW_LINE>if (ref.isStrictReference()) {<NEW_LINE>throw new ThrowException(context, context.createSyntaxError("cannot delete from environment record binding"));<NEW_LINE>}<NEW_LINE>EnvironmentRecord bindings = <MASK><NEW_LINE>return (bindings.deleteBinding(context, ref.getReferencedName()));<NEW_LINE>}
(EnvironmentRecord) ref.getBase();
4,961
private void apply(ClassWriter writer, String moduleInternalName, String lambdaName, NameGenerator registry) throws Exception {<NEW_LINE>Type owner = getController().toJvmType();<NEW_LINE>String methodName = executable.getSimpleName().toString();<NEW_LINE>String methodDescriptor = methodDescriptor();<NEW_LINE>MethodVisitor apply = writer.visitMethod(ACC_PRIVATE | ACC_STATIC | ACC_SYNTHETIC, lambdaName, "(Ljavax/inject/Provider;Lio/jooby/Context;)Ljava/lang/Object;", null, new String[] { "java/lang/Exception" });<NEW_LINE>apply.visitParameter("provider", ACC_FINAL | ACC_SYNTHETIC);<NEW_LINE>apply.visitParameter("ctx", ACC_SYNTHETIC);<NEW_LINE>apply.visitCode();<NEW_LINE>Label sourceStart = new Label();<NEW_LINE>apply.visitLabel(sourceStart);<NEW_LINE>apply.visitVarInsn(ALOAD, 0);<NEW_LINE>apply.visitMethodInsn(INVOKEINTERFACE, PROVIDER.getInternalName(), "get", PROVIDER_DESCRIPTOR, true);<NEW_LINE>apply.visitTypeInsn(CHECKCAST, owner.getInternalName());<NEW_LINE>apply.visitVarInsn(ASTORE, 2);<NEW_LINE>apply.visitVarInsn(ALOAD, 2);<NEW_LINE>processArguments(writer, <MASK><NEW_LINE>setDefaultResponseType(apply);<NEW_LINE>apply.visitMethodInsn(INVOKEVIRTUAL, owner.getInternalName(), methodName, methodDescriptor, false);<NEW_LINE>processReturnType(apply);<NEW_LINE>apply.visitEnd();<NEW_LINE>}
apply, owner, moduleInternalName, registry);
665,168
final void executeRegisterActivityType(RegisterActivityTypeRequest registerActivityTypeRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(registerActivityTypeRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<RegisterActivityTypeRequest> request = null;<NEW_LINE>Response<Void> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new RegisterActivityTypeRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(registerActivityTypeRequest));<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, "SWF");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "RegisterActivityType");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<Void>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), null);<NEW_LINE>invoke(request, responseHandler, executionContext);<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
162,713
public //<NEW_LINE>void onDrawFrame(GL10 glUnused) {<NEW_LINE>// Set the viewport<NEW_LINE>GLES30.glViewport(0, 0, mWidth, mHeight);<NEW_LINE>// Clear the color buffer<NEW_LINE>GLES30.glClear(GLES30.GL_COLOR_BUFFER_BIT);<NEW_LINE>// Use the program object<NEW_LINE>GLES30.glUseProgram(mProgramObject);<NEW_LINE>// Load the vertex position<NEW_LINE>mVertices.position(0);<NEW_LINE>GLES30.glVertexAttribPointer(0, 4, GLES30.GL_FLOAT, false, 6 * 4, mVertices);<NEW_LINE>// Load the texture coordinate<NEW_LINE>mVertices.position(4);<NEW_LINE>GLES30.glVertexAttribPointer(1, 2, GLES30.GL_FLOAT, false, 6 * 4, mVertices);<NEW_LINE>GLES30.glEnableVertexAttribArray(0);<NEW_LINE>GLES30.glEnableVertexAttribArray(1);<NEW_LINE>// Bind the texture<NEW_LINE>GLES30.glActiveTexture(GLES30.GL_TEXTURE0);<NEW_LINE>GLES30.glBindTexture(GLES30.GL_TEXTURE_2D, mTextureId);<NEW_LINE>// Set the sampler texture unit to 0<NEW_LINE>GLES30.glUniform1i(mSamplerLoc, 0);<NEW_LINE>// Draw quad with repeat wrap mode<NEW_LINE>GLES30.glTexParameteri(GLES30.GL_TEXTURE_2D, <MASK><NEW_LINE>GLES30.glTexParameteri(GLES30.GL_TEXTURE_2D, GLES30.GL_TEXTURE_WRAP_T, GLES30.GL_REPEAT);<NEW_LINE>GLES30.glUniform1f(mOffsetLoc, -0.7f);<NEW_LINE>GLES30.glDrawElements(GLES30.GL_TRIANGLES, 6, GLES30.GL_UNSIGNED_SHORT, mIndices);<NEW_LINE>// Draw quad with clamp to edge wrap mode<NEW_LINE>GLES30.glTexParameteri(GLES30.GL_TEXTURE_2D, GLES30.GL_TEXTURE_WRAP_S, GLES30.GL_CLAMP_TO_EDGE);<NEW_LINE>GLES30.glTexParameteri(GLES30.GL_TEXTURE_2D, GLES30.GL_TEXTURE_WRAP_T, GLES30.GL_CLAMP_TO_EDGE);<NEW_LINE>GLES30.glUniform1f(mOffsetLoc, 0.0f);<NEW_LINE>GLES30.glDrawElements(GLES30.GL_TRIANGLES, 6, GLES30.GL_UNSIGNED_SHORT, mIndices);<NEW_LINE>// Draw quad with mirrored repeat<NEW_LINE>GLES30.glTexParameteri(GLES30.GL_TEXTURE_2D, GLES30.GL_TEXTURE_WRAP_S, GLES30.GL_MIRRORED_REPEAT);<NEW_LINE>GLES30.glTexParameteri(GLES30.GL_TEXTURE_2D, GLES30.GL_TEXTURE_WRAP_T, GLES30.GL_MIRRORED_REPEAT);<NEW_LINE>GLES30.glUniform1f(mOffsetLoc, 0.7f);<NEW_LINE>GLES30.glDrawElements(GLES30.GL_TRIANGLES, 6, GLES30.GL_UNSIGNED_SHORT, mIndices);<NEW_LINE>}
GLES30.GL_TEXTURE_WRAP_S, GLES30.GL_REPEAT);
123,160
public boolean apply(Game game, Ability source) {<NEW_LINE>Player controller = game.getPlayer(source.getControllerId());<NEW_LINE>Permanent sourcePermanent = game.getPermanent(source.getSourceId());<NEW_LINE>if (controller != null && sourcePermanent != null) {<NEW_LINE>Choice abilityChoice = new ChoiceImpl(true);<NEW_LINE>Set<String> abilityChoices <MASK><NEW_LINE>abilityChoice.setMessage("Choose ability for your creatures");<NEW_LINE>abilityChoices.add("First strike");<NEW_LINE>abilityChoices.add("Vigilance");<NEW_LINE>abilityChoices.add("Lifelink");<NEW_LINE>abilityChoice.setChoices(abilityChoices);<NEW_LINE>if (controller.choose(outcome, abilityChoice, game)) {<NEW_LINE>Ability ability = null;<NEW_LINE>switch(abilityChoice.getChoice()) {<NEW_LINE>case "First strike":<NEW_LINE>ability = FirstStrikeAbility.getInstance();<NEW_LINE>break;<NEW_LINE>case "Vigilance":<NEW_LINE>ability = VigilanceAbility.getInstance();<NEW_LINE>break;<NEW_LINE>case "Lifelink":<NEW_LINE>ability = LifelinkAbility.getInstance();<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (ability != null) {<NEW_LINE>GainAbilityControlledEffect effect = new GainAbilityControlledEffect(ability, Duration.EndOfTurn, new FilterControlledCreaturePermanent());<NEW_LINE>game.addEffect(effect, source);<NEW_LINE>game.informPlayers(sourcePermanent.getName() + ": " + controller.getLogName() + " has chosen " + abilityChoice.getChoice().toLowerCase(Locale.ENGLISH));<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
= new HashSet<>(3);
1,445,732
public static ListTaskDetailResponse unmarshall(ListTaskDetailResponse listTaskDetailResponse, UnmarshallerContext _ctx) {<NEW_LINE>listTaskDetailResponse.setRequestId(_ctx.stringValue("ListTaskDetailResponse.RequestId"));<NEW_LINE>listTaskDetailResponse.setCode(_ctx.stringValue("ListTaskDetailResponse.Code"));<NEW_LINE>listTaskDetailResponse.setMessage(_ctx.stringValue("ListTaskDetailResponse.Message"));<NEW_LINE>listTaskDetailResponse.setSuccess<MASK><NEW_LINE>Data data = new Data();<NEW_LINE>data.setPageNo(_ctx.longValue("ListTaskDetailResponse.Data.PageNo"));<NEW_LINE>data.setPageSize(_ctx.longValue("ListTaskDetailResponse.Data.PageSize"));<NEW_LINE>data.setTotal(_ctx.longValue("ListTaskDetailResponse.Data.Total"));<NEW_LINE>List<RecordItem> record = new ArrayList<RecordItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListTaskDetailResponse.Data.Record.Length"); i++) {<NEW_LINE>RecordItem recordItem = new RecordItem();<NEW_LINE>recordItem.setStatus(_ctx.stringValue("ListTaskDetailResponse.Data.Record[" + i + "].Status"));<NEW_LINE>recordItem.setRetryCurTimes(_ctx.integerValue("ListTaskDetailResponse.Data.Record[" + i + "].RetryCurTimes"));<NEW_LINE>recordItem.setCalled(_ctx.stringValue("ListTaskDetailResponse.Data.Record[" + i + "].Called"));<NEW_LINE>recordItem.setCaller(_ctx.stringValue("ListTaskDetailResponse.Data.Record[" + i + "].Caller"));<NEW_LINE>recordItem.setDuration(_ctx.integerValue("ListTaskDetailResponse.Data.Record[" + i + "].Duration"));<NEW_LINE>recordItem.setId(_ctx.longValue("ListTaskDetailResponse.Data.Record[" + i + "].Id"));<NEW_LINE>recordItem.setStatusCode(_ctx.stringValue("ListTaskDetailResponse.Data.Record[" + i + "].StatusCode"));<NEW_LINE>recordItem.setStatusCodeDesc(_ctx.stringValue("ListTaskDetailResponse.Data.Record[" + i + "].StatusCodeDesc"));<NEW_LINE>recordItem.setRetryTimes(_ctx.integerValue("ListTaskDetailResponse.Data.Record[" + i + "].RetryTimes"));<NEW_LINE>recordItem.setStartTime(_ctx.stringValue("ListTaskDetailResponse.Data.Record[" + i + "].StartTime"));<NEW_LINE>recordItem.setEndTime(_ctx.stringValue("ListTaskDetailResponse.Data.Record[" + i + "].EndTime"));<NEW_LINE>recordItem.setDirection(_ctx.stringValue("ListTaskDetailResponse.Data.Record[" + i + "].Direction"));<NEW_LINE>recordItem.setTags(_ctx.stringValue("ListTaskDetailResponse.Data.Record[" + i + "].Tags"));<NEW_LINE>record.add(recordItem);<NEW_LINE>}<NEW_LINE>data.setRecord(record);<NEW_LINE>listTaskDetailResponse.setData(data);<NEW_LINE>return listTaskDetailResponse;<NEW_LINE>}
(_ctx.booleanValue("ListTaskDetailResponse.Success"));
1,287,821
public void parse(XMLStreamReader parser) throws XMLStreamException {<NEW_LINE>for (int i = 0; i < parser.getAttributeCount(); i++) {<NEW_LINE>QName attr = parser.getAttributeName(i);<NEW_LINE>if (attr.getLocalPart().equals("texcoord")) {<NEW_LINE><MASK><NEW_LINE>} else if (attr.getLocalPart().equals("texture")) {<NEW_LINE>texture = parser.getAttributeValue(i);<NEW_LINE>} else {<NEW_LINE>JAGTLog.exception("Unsupported ", this.getClass().getSimpleName(), " Attr tag: ", attr.getLocalPart());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {<NEW_LINE>switch(event) {<NEW_LINE>case XMLStreamConstants.END_ELEMENT:<NEW_LINE>{<NEW_LINE>if (parser.getLocalName().equals("texture"))<NEW_LINE>return;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
texcoord = parser.getAttributeValue(i);
1,618,188
public boolean occluded(TraceCodeUnit cu, AddressRange range, Range<Long> span) {<NEW_LINE>if (cu == null) {<NEW_LINE>return RangeQueryOcclusion.super.<MASK><NEW_LINE>}<NEW_LINE>AddressSetView known = memSpace.getAddressesWithState(span, s -> s == TraceMemoryState.KNOWN);<NEW_LINE>if (!known.intersects(range.getMinAddress(), range.getMaxAddress())) {<NEW_LINE>return RangeQueryOcclusion.super.occluded(cu, range, span);<NEW_LINE>}<NEW_LINE>byte[] memBytes = new byte[cu.getLength()];<NEW_LINE>memSpace.getBytes(span.upperEndpoint(), cu.getMinAddress(), ByteBuffer.wrap(memBytes));<NEW_LINE>byte[] cuBytes;<NEW_LINE>try {<NEW_LINE>cuBytes = cu.getBytes();<NEW_LINE>} catch (MemoryAccessException e) {<NEW_LINE>throw new AssertionError(e);<NEW_LINE>}<NEW_LINE>AddressSetView intersectKnown = new IntersectionAddressSetView(new AddressSet(range), known);<NEW_LINE>if (bytesDifferForSet(memBytes, cuBytes, intersectKnown)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return RangeQueryOcclusion.super.occluded(cu, range, span);<NEW_LINE>}
occluded(cu, range, span);
951,221
protected Set<Sdk> configuredSdks(Config config, UsesSdk usesSdk) {<NEW_LINE>int appMinSdk = Math.max(usesSdk.getMinSdkVersion(), minKnownSdk.getApiLevel());<NEW_LINE>int appTargetSdk = Math.max(usesSdk.getTargetSdkVersion(), minKnownSdk.getApiLevel());<NEW_LINE>Integer appMaxSdk = usesSdk.getMaxSdkVersion();<NEW_LINE>if (appMaxSdk == null) {<NEW_LINE>appMaxSdk = maxKnownSdk.getApiLevel();<NEW_LINE>}<NEW_LINE>// For min/max SDK ranges...<NEW_LINE>int minSdk = config.minSdk();<NEW_LINE>int maxSdk = config.maxSdk();<NEW_LINE>if (minSdk != -1 || maxSdk != -1) {<NEW_LINE>int rangeMin = decodeSdk(minSdk, appMinSdk, appMinSdk, appTargetSdk, appMaxSdk);<NEW_LINE>int rangeMax = decodeSdk(maxSdk, appMaxSdk, appMinSdk, appTargetSdk, appMaxSdk);<NEW_LINE>if (rangeMin > rangeMax && (minSdk == -1 || maxSdk == -1)) {<NEW_LINE>return Collections.emptySet();<NEW_LINE>}<NEW_LINE>return sdkRange(rangeMin, rangeMax);<NEW_LINE>}<NEW_LINE>// For explicitly-enumerated SDKs...<NEW_LINE>if (config.sdk().length == 0) {<NEW_LINE>if (appTargetSdk < appMinSdk) {<NEW_LINE>throw new IllegalArgumentException("Package targetSdkVersion=" + appTargetSdk + " < minSdkVersion=" + appMinSdk);<NEW_LINE>} else if (appMaxSdk != 0 && appTargetSdk > appMaxSdk) {<NEW_LINE>throw new IllegalArgumentException("Package targetSdkVersion=" + appTargetSdk + " > maxSdkVersion=" + appMaxSdk);<NEW_LINE>}<NEW_LINE>return Collections.singleton<MASK><NEW_LINE>}<NEW_LINE>if (config.sdk().length == 1 && config.sdk()[0] == Config.ALL_SDKS) {<NEW_LINE>return sdkRange(appMinSdk, appMaxSdk);<NEW_LINE>}<NEW_LINE>Set<Sdk> sdks = new HashSet<>();<NEW_LINE>for (int sdk : config.sdk()) {<NEW_LINE>int decodedApiLevel = decodeSdk(sdk, appTargetSdk, appMinSdk, appTargetSdk, appMaxSdk);<NEW_LINE>sdks.add(sdkCollection.getSdk(decodedApiLevel));<NEW_LINE>}<NEW_LINE>return sdks;<NEW_LINE>}
(sdkCollection.getSdk(appTargetSdk));
1,592,636
@SuppressWarnings("unused")<NEW_LINE>public static int onLoad(JNIJavaVM vm, CCharPointer options, @SuppressWarnings("unused") PointerBase reserved) {<NEW_LINE>AgentIsolate.setGlobalIsolate(CurrentIsolate.getIsolate());<NEW_LINE>String optionsString = options.isNonNull() ? fromCString(options) : "";<NEW_LINE>WordPointer jvmtiPtr = StackValue.get(WordPointer.class);<NEW_LINE>checkJni(vm.getFunctions().getGetEnv().invoke(vm, jvmtiPtr, singleton().getRequiredJvmtiVersion()));<NEW_LINE>JvmtiEnv jvmti = jvmtiPtr.read();<NEW_LINE>JvmtiEventCallbacks callbacks = UnmanagedMemory.calloc(SizeOf.get(JvmtiEventCallbacks.class));<NEW_LINE>callbacks.setVMStart(onVMStartLiteral.getFunctionPointer());<NEW_LINE>callbacks.setVMInit(onVMInitLiteral.getFunctionPointer());<NEW_LINE>callbacks.setVMDeath(onVMDeathLiteral.getFunctionPointer());<NEW_LINE>callbacks.setThreadEnd(onThreadEndLiteral.getFunctionPointer());<NEW_LINE>int ret = singleton().onLoadCallback(vm, jvmti, callbacks, optionsString);<NEW_LINE>if (ret != 0) {<NEW_LINE>return ret;<NEW_LINE>}<NEW_LINE>check(jvmti.getFunctions().SetEventCallbacks().invoke(jvmti, callbacks, SizeOf.get(JvmtiEventCallbacks.class)));<NEW_LINE>UnmanagedMemory.free(callbacks);<NEW_LINE>check(jvmti.getFunctions().SetEventNotificationMode().invoke(jvmti, JVMTI_ENABLE, JVMTI_EVENT_VM_START, nullHandle()));<NEW_LINE>check(jvmti.getFunctions().SetEventNotificationMode().invoke(jvmti, JVMTI_ENABLE, JVMTI_EVENT_VM_INIT, nullHandle()));<NEW_LINE>check(jvmti.getFunctions().SetEventNotificationMode().invoke(jvmti, JVMTI_ENABLE<MASK><NEW_LINE>check(jvmti.getFunctions().SetEventNotificationMode().invoke(jvmti, JVMTI_ENABLE, JVMTI_EVENT_THREAD_END, nullHandle()));<NEW_LINE>return 0;<NEW_LINE>}
, JVMTI_EVENT_VM_DEATH, nullHandle()));
176,168
public void onSuccess(Integer timeOfDay, Integer relayStatus, Integer localTemperature, Integer humidityInPercentage, Integer setpoint, Integer unreadEntries) {<NEW_LINE>Map<CommandResponseInfo, Object> responseValues = new LinkedHashMap<>();<NEW_LINE>CommandResponseInfo timeOfDayResponseValue = new CommandResponseInfo("timeOfDay", "Integer");<NEW_LINE>responseValues.put(timeOfDayResponseValue, timeOfDay);<NEW_LINE>CommandResponseInfo relayStatusResponseValue = new CommandResponseInfo("relayStatus", "Integer");<NEW_LINE>responseValues.put(relayStatusResponseValue, relayStatus);<NEW_LINE>CommandResponseInfo localTemperatureResponseValue = new CommandResponseInfo("localTemperature", "Integer");<NEW_LINE>responseValues.put(localTemperatureResponseValue, localTemperature);<NEW_LINE>CommandResponseInfo humidityInPercentageResponseValue = new CommandResponseInfo("humidityInPercentage", "Integer");<NEW_LINE>responseValues.put(humidityInPercentageResponseValue, humidityInPercentage);<NEW_LINE>CommandResponseInfo setpointResponseValue = new CommandResponseInfo("setpoint", "Integer");<NEW_LINE><MASK><NEW_LINE>CommandResponseInfo unreadEntriesResponseValue = new CommandResponseInfo("unreadEntries", "Integer");<NEW_LINE>responseValues.put(unreadEntriesResponseValue, unreadEntries);<NEW_LINE>callback.onSuccess(responseValues);<NEW_LINE>}
responseValues.put(setpointResponseValue, setpoint);
905,358
public CoreLabel relationHead() {<NEW_LINE>if (relation.size() == 1) {<NEW_LINE>return relation.get(0);<NEW_LINE>}<NEW_LINE>CoreLabel guess = null;<NEW_LINE><MASK><NEW_LINE>// make sure we don't infinite loop...<NEW_LINE>int iters = 0;<NEW_LINE>while (guess != newGuess && iters < 100) {<NEW_LINE>guess = newGuess;<NEW_LINE>iters += 1;<NEW_LINE>for (SemanticGraphEdge edge : sourceTree.incomingEdgeIterable(new IndexedWord(guess))) {<NEW_LINE>// find a node in the relation list which is a governor of the candidate root<NEW_LINE>Optional<CoreLabel> governor = relation.stream().filter(x -> x.index() == edge.getGovernor().index()).findFirst();<NEW_LINE>// if we found one, this is the new root. The for loop continues<NEW_LINE>if (governor.isPresent()) {<NEW_LINE>newGuess = governor.get();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Return<NEW_LINE>if (iters >= 100) {<NEW_LINE>err("Likely cycle in relation tree");<NEW_LINE>}<NEW_LINE>return guess;<NEW_LINE>}
CoreLabel newGuess = super.relationHead();
1,672,036
private Stage createStage() {<NEW_LINE>logger.trace("Creating stage for input display");<NEW_LINE>double keyPaneWidth = 225.0;<NEW_LINE>double mousePaneWidth = 100;<NEW_LINE>double spacing = 5;<NEW_LINE>var pane = new AnchorPane();<NEW_LINE>pane.setStyle("-fx-background-color: rgba(0, 0, 0, 0.75); -fx-background-radius: 10;");<NEW_LINE>// Add to main pane<NEW_LINE>var paneKeys = createKeyPane(keyPaneWidth);<NEW_LINE>pane.getChildren().add(paneKeys);<NEW_LINE>AnchorPane.setTopAnchor(paneKeys, 0.0);<NEW_LINE>AnchorPane.setLeftAnchor(paneKeys, 0.0);<NEW_LINE>// Create the mouse pane<NEW_LINE>var paneMouse = createMousePane(mousePaneWidth);<NEW_LINE>pane.getChildren().add(paneMouse);<NEW_LINE>AnchorPane.setTopAnchor(paneMouse, 0.0);<NEW_LINE>AnchorPane.setLeftAnchor(paneMouse, keyPaneWidth + 5);<NEW_LINE>// // Add small node to close<NEW_LINE>// var closeCircle = new Circle(4)<NEW_LINE>// // var closeCircle = new Text("x")<NEW_LINE>// closeCircle.setStrokeWidth(1.5)<NEW_LINE>// closeCircle.setStroke(new Color(1, 1, 1, 0.4))<NEW_LINE>// closeCircle.setFill(null)<NEW_LINE>// // closeCircle.setOnMouseEntered { e -> closeCircle.setStroke(colorActive) }<NEW_LINE>// // closeCircle.setOnMouseExited() { e -> closeCircle.setStroke(new Color(1, 1, 1, 0.4)) }<NEW_LINE>// // var tooltipClose = new Tooltip("Close")<NEW_LINE>// // Tooltip.install(closeCircle, tooltipClose)<NEW_LINE>// pane.getChildren().add(closeCircle)<NEW_LINE>// AnchorPane.setTopAnchor(closeCircle, 5)<NEW_LINE>// AnchorPane.setLeftAnchor(closeCircle, 5)<NEW_LINE>// Set default location as the bottom left corner of the primary screen<NEW_LINE>var screenBounds = Screen.getPrimary().getVisualBounds();<NEW_LINE>double xPad = 10;<NEW_LINE>double yPad = 10;<NEW_LINE>// Create primary stage for display<NEW_LINE>stage = new Stage();<NEW_LINE>stage.initStyle(StageStyle.TRANSPARENT);<NEW_LINE>var scene = new Scene(pane, keyPaneWidth + mousePaneWidth + spacing, 160, Color.TRANSPARENT);<NEW_LINE>stage.setScene(scene);<NEW_LINE>new MoveablePaneHandler(stage);<NEW_LINE><MASK><NEW_LINE>Tooltip.install(pane, tooltipClose);<NEW_LINE>// Locate at bottom left of the screen<NEW_LINE>stage.setX(screenBounds.getMinX() + xPad);<NEW_LINE>stage.setY(screenBounds.getMaxY() - scene.getHeight() - yPad);<NEW_LINE>stage.getScene().setOnMouseClicked(e -> {<NEW_LINE>if (e.getClickCount() == 2) {<NEW_LINE>stage.fireEvent(new WindowEvent(stage, WindowEvent.WINDOW_CLOSE_REQUEST));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return stage;<NEW_LINE>}
var tooltipClose = new Tooltip("Display input - double-click to close");
1,007,796
public DescribeImagePermissionsResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DescribeImagePermissionsResult describeImagePermissionsResult = new DescribeImagePermissionsResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return describeImagePermissionsResult;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("Name", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>describeImagePermissionsResult.setName(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("SharedImagePermissionsList", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>describeImagePermissionsResult.setSharedImagePermissionsList(new ListUnmarshaller<SharedImagePermissions>(SharedImagePermissionsJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("NextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>describeImagePermissionsResult.setNextToken(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return describeImagePermissionsResult;<NEW_LINE>}
class).unmarshall(context));
1,622,956
ActionResult<List<Wo>> execute(EffectivePerson effectivePerson, String application, String infoId) throws Exception {<NEW_LINE>ActionResult<List<Wo>> result = new ActionResult<>();<NEW_LINE>List<Wo> wraps = null;<NEW_LINE>List<HotPictureInfo> hotPictureInfos = null;<NEW_LINE>Cache.CacheCategory cacheCategory = new Cache.CacheCategory(HotPictureInfo.class);<NEW_LINE>HotPictureInfoServiceAdv hotPictureInfoService = new HotPictureInfoServiceAdv();<NEW_LINE>if (application == null || application.isEmpty() || "(0)".equals(application)) {<NEW_LINE>throw new InfoApplicationEmptyException();<NEW_LINE>}<NEW_LINE>if (infoId == null || infoId.isEmpty() || "(0)".equals(infoId)) {<NEW_LINE>throw new InfoIdEmptyException();<NEW_LINE>}<NEW_LINE>String cacheKey <MASK><NEW_LINE>CacheKey cacheKeyObj = new Cache.CacheKey(cacheKey);<NEW_LINE>Optional<?> element = CacheManager.get(cacheCategory, cacheKeyObj);<NEW_LINE>if (null != element) {<NEW_LINE>if (element.isPresent()) {<NEW_LINE>wraps = (List<Wo>) element.get();<NEW_LINE>result.setData(wraps);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>hotPictureInfos = hotPictureInfoService.listByApplicationInfoId(application, infoId);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new InfoListByApplicationException(e, application, infoId);<NEW_LINE>}<NEW_LINE>if (hotPictureInfos != null && !hotPictureInfos.isEmpty()) {<NEW_LINE>try {<NEW_LINE>wraps = Wo.copier.copy(hotPictureInfos);<NEW_LINE>CacheManager.put(cacheCategory, cacheKeyObj, wraps);<NEW_LINE>result.setData(wraps);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new InfoWrapOutException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
= "list#" + application + "#" + infoId;
1,052,328
private static BaseComponent wander_chances(BlockPos pos, ServerLevel worldIn) {<NEW_LINE>PathfinderMob creature = new ZombifiedPiglin(EntityType.ZOMBIFIED_PIGLIN, worldIn);<NEW_LINE>creature.finalizeSpawn(worldIn, worldIn.getCurrentDifficultyAt(pos), MobSpawnType.NATURAL, null, null);<NEW_LINE>creature.moveTo(pos, 0.0F, 0.0F);<NEW_LINE>RandomStrollGoal wander = new RandomStrollGoal(creature, 0.8D);<NEW_LINE>int success = 0;<NEW_LINE>for (int i = 0; i < 1000; i++) {<NEW_LINE>// TargetFinder.findTarget(creature, 10, 7);<NEW_LINE>Vec3 vec = DefaultRandomPos.getPos(creature, 10, 7);<NEW_LINE>if (vec == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>success++;<NEW_LINE>}<NEW_LINE>long total_ticks = 0;<NEW_LINE>for (int trie = 0; trie < 1000; trie++) {<NEW_LINE>int i;<NEW_LINE>for (// *60 used to be 5 hours, limited to 30 mins<NEW_LINE>// *60 used to be 5 hours, limited to 30 mins<NEW_LINE>i = 1; // *60 used to be 5 hours, limited to 30 mins<NEW_LINE>i < 30 * 20 * 60; i++) {<NEW_LINE>if (wander.canUse()) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>total_ticks += 3 * i;<NEW_LINE>}<NEW_LINE>// discarded // remove(Entity.RemovalReason.field_26999); // 2nd option - DISCARDED<NEW_LINE>creature.discard();<NEW_LINE>long total_time <MASK><NEW_LINE>return Messenger.s(String.format(" - Wander chance above: %.1f%%\n - Average standby above: %s", (100.0F * success) / 1000, ((total_time > 5000) ? "INFINITY" : (total_time + " s"))));<NEW_LINE>}
= (total_ticks) / 1000 / 20;
410,602
public static Set<Class<? extends Relation>> suggestedRelationsBetween(Inter source, Inter target) {<NEW_LINE>// Check inputs<NEW_LINE>Objects.requireNonNull(source, "Source is null");<NEW_LINE>Objects.requireNonNull(target, "Target is null");<NEW_LINE><MASK><NEW_LINE>Objects.requireNonNull(sig, "Source has no sig");<NEW_LINE>if (target.getSig() != sig) {<NEW_LINE>logger.info("Source and Target do not share the same sig");<NEW_LINE>return Collections.emptySet();<NEW_LINE>}<NEW_LINE>// Suggestions<NEW_LINE>Set<Class<? extends Relation>> suggestions = new LinkedHashSet<>(definedRelationsBetween(source.getClass(), target.getClass()));<NEW_LINE>// Let's not remove existing relation, to allow cleaning of relations<NEW_LINE>// // NO (Skip existing relation, if any, between source & target) NO<NEW_LINE>// Relation edge = sig.getEdge(source, target);<NEW_LINE>//<NEW_LINE>// if (edge != null) {<NEW_LINE>// suggestions.remove(edge.getClass());<NEW_LINE>// }<NEW_LINE>//<NEW_LINE>// Return what we got<NEW_LINE>if (suggestions.isEmpty()) {<NEW_LINE>return Collections.emptySet();<NEW_LINE>} else {<NEW_LINE>return suggestions;<NEW_LINE>}<NEW_LINE>}
SIGraph sig = source.getSig();
1,106,043
private void enqueue(String storageId, String taskToken) {<NEW_LINE>BackupStorage storage = mBackupManager.getBackupStorageProvider(storageId).getStorage();<NEW_LINE>BackupTaskConfig config = storage.getTaskConfig(taskToken);<NEW_LINE>if (config == null)<NEW_LINE>return;<NEW_LINE>if (config instanceof SingleBackupTaskConfig) {<NEW_LINE>SingleBackupTaskConfig taskConfig = (SingleBackupTaskConfig) config;<NEW_LINE>mTasks.put(taskToken, new BackupTaskInfo(config.getBackupStorageId(), taskConfig.packageMeta<MASK><NEW_LINE>} else if (config instanceof BatchBackupTaskConfig) {<NEW_LINE>mBatchTasks.put(taskToken, new BatchBackupTaskInfo(config.getBackupStorageId(), taskToken, taskToken));<NEW_LINE>} else {<NEW_LINE>Log.w(TAG, String.format("Got unsupported task config class - %s, task token - %s, ignoring", config.getClass().getCanonicalName(), taskToken));<NEW_LINE>}<NEW_LINE>addStorageDependency(storageId);<NEW_LINE>updateStatus();<NEW_LINE>storage.startBackupTask(taskToken);<NEW_LINE>}
(), taskToken, taskToken));
1,402,229
public static long[] decimal2Long(DecimalStructure from) {<NEW_LINE>int bufPos = 0;<NEW_LINE>long x = 0L;<NEW_LINE>int intg, frac;<NEW_LINE>long to;<NEW_LINE>for (intg = from.getIntegers(); intg > 0; intg -= DIG_PER_DEC1) {<NEW_LINE>long y = x;<NEW_LINE>x = x * DIG_BASE - from.getBuffValAt(bufPos++);<NEW_LINE>if (y < (Long.MIN_VALUE / DIG_BASE) || x > y) {<NEW_LINE>to = from.isNeg() ? Long.MIN_VALUE : Long.MAX_VALUE;<NEW_LINE>return new long[] { to, E_DEC_OVERFLOW };<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!from.isNeg() && x == Long.MIN_VALUE) {<NEW_LINE>to = Long.MAX_VALUE;<NEW_LINE>return new <MASK><NEW_LINE>}<NEW_LINE>to = from.isNeg() ? x : -x;<NEW_LINE>for (frac = from.getFractions(); frac > 0; frac -= DIG_PER_DEC1) {<NEW_LINE>if (from.getBuffValAt(bufPos++) != 0) {<NEW_LINE>return new long[] { to, E_DEC_TRUNCATED };<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new long[] { to, E_DEC_OK };<NEW_LINE>}
long[] { to, E_DEC_OVERFLOW };
353,518
public InsightHealth unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>InsightHealth insightHealth = new InsightHealth();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("OpenProactiveInsights", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>insightHealth.setOpenProactiveInsights(context.getUnmarshaller(Integer.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("OpenReactiveInsights", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>insightHealth.setOpenReactiveInsights(context.getUnmarshaller(Integer.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("MeanTimeToRecoverInMilliseconds", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>insightHealth.setMeanTimeToRecoverInMilliseconds(context.getUnmarshaller(Long.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 insightHealth;<NEW_LINE>}
class).unmarshall(context));
874,110
private static void runAssertion(RegressionEnvironment env, String epl) {<NEW_LINE>env.compileDeploy<MASK><NEW_LINE>sendManyArray(env, "E1", new double[] { 3, 4 }, new int[] { 30, 40 }, 50);<NEW_LINE>assertReceived(env, "E1", "DA2");<NEW_LINE>env.milestone(0);<NEW_LINE>sendManyArray(env, "E2", new double[] { 1, 2 }, new int[] { 10, 20 }, 60);<NEW_LINE>assertReceived(env, "E2", "DA1");<NEW_LINE>sendManyArray(env, "E3", new double[] { 3, 4 }, new int[] { 30, 40 }, 70);<NEW_LINE>assertReceived(env, "E3", "DA2");<NEW_LINE>sendManyArray(env, "E4", new double[] { 1 }, new int[] { 30, 40 }, 80);<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>}
(epl).addListener("s0");
609,867
Type named() {<NEW_LINE>List<String> <MASK><NEW_LINE>for (; ; ) {<NEW_LINE>if (terms.peek().isWordOrNumber()) {<NEW_LINE>segments.add(terms.poll().toString());<NEW_LINE>} else if (terms.peek().is("@")) {<NEW_LINE>terms.poll();<NEW_LINE>// just consume type annotation<NEW_LINE>consumeAnnotation();<NEW_LINE>continue;<NEW_LINE>} else {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (!terms.isEmpty() && terms.peek().is(".")) {<NEW_LINE>if (terms.size() >= 2) {<NEW_LINE>// case when varargs may be so more than one dot<NEW_LINE>// but we handle rest of it elsewhere<NEW_LINE>Iterator<Term> it = terms.iterator();<NEW_LINE>if (it.next().is(".") && it.next().is(".")) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>terms.poll();<NEW_LINE>} else {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return forName(JOINER.join(segments));<NEW_LINE>}
segments = new ArrayList<>();
1,823,549
void deleteStreams(Transaction t, final Set<Long> streamIds) {<NEW_LINE>if (streamIds.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Set<UserPhotosStreamMetadataTable.UserPhotosStreamMetadataRow> smRows = new HashSet<>();<NEW_LINE>Multimap<UserPhotosStreamHashAidxTable.UserPhotosStreamHashAidxRow, UserPhotosStreamHashAidxTable.UserPhotosStreamHashAidxColumn> shToDelete = HashMultimap.create();<NEW_LINE>for (Long streamId : streamIds) {<NEW_LINE>smRows.add(UserPhotosStreamMetadataTable<MASK><NEW_LINE>}<NEW_LINE>UserPhotosStreamMetadataTable table = tables.getUserPhotosStreamMetadataTable(t);<NEW_LINE>Map<UserPhotosStreamMetadataTable.UserPhotosStreamMetadataRow, StreamMetadata> metadatas = table.getMetadatas(smRows);<NEW_LINE>Set<UserPhotosStreamValueTable.UserPhotosStreamValueRow> streamValueToDelete = new HashSet<>();<NEW_LINE>for (Entry<UserPhotosStreamMetadataTable.UserPhotosStreamMetadataRow, StreamMetadata> e : metadatas.entrySet()) {<NEW_LINE>Long streamId = e.getKey().getId();<NEW_LINE>long blocks = getNumberOfBlocksFromMetadata(e.getValue());<NEW_LINE>for (long i = 0; i < blocks; i++) {<NEW_LINE>streamValueToDelete.add(UserPhotosStreamValueTable.UserPhotosStreamValueRow.of(streamId, i));<NEW_LINE>}<NEW_LINE>ByteString streamHash = e.getValue().getHash();<NEW_LINE>Sha256Hash hash = Sha256Hash.EMPTY;<NEW_LINE>if (!ByteString.EMPTY.equals(streamHash)) {<NEW_LINE>hash = new Sha256Hash(streamHash.toByteArray());<NEW_LINE>} else {<NEW_LINE>log.error("Empty hash for stream {}", SafeArg.of("id", streamId));<NEW_LINE>}<NEW_LINE>UserPhotosStreamHashAidxTable.UserPhotosStreamHashAidxRow hashRow = UserPhotosStreamHashAidxTable.UserPhotosStreamHashAidxRow.of(hash);<NEW_LINE>UserPhotosStreamHashAidxTable.UserPhotosStreamHashAidxColumn column = UserPhotosStreamHashAidxTable.UserPhotosStreamHashAidxColumn.of(streamId);<NEW_LINE>shToDelete.put(hashRow, column);<NEW_LINE>}<NEW_LINE>tables.getUserPhotosStreamHashAidxTable(t).delete(shToDelete);<NEW_LINE>tables.getUserPhotosStreamValueTable(t).delete(streamValueToDelete);<NEW_LINE>table.delete(smRows);<NEW_LINE>}
.UserPhotosStreamMetadataRow.of(streamId));
834,213
public static ZonedDateTime ofStrict(LocalDateTime localDateTime, ZoneOffset offset, ZoneId zone) {<NEW_LINE>Objects.requireNonNull(localDateTime, "localDateTime");<NEW_LINE>Objects.requireNonNull(offset, "offset");<NEW_LINE>Objects.requireNonNull(zone, "zone");<NEW_LINE>ZoneRules rules = zone.getRules();<NEW_LINE>if (!rules.isValidOffset(localDateTime, offset)) {<NEW_LINE>ZoneOffsetTransition <MASK><NEW_LINE>if (trans != null && trans.isGap()) {<NEW_LINE>// error message says daylight savings for simplicity<NEW_LINE>// even though there are other kinds of gaps<NEW_LINE>throw new DateTimeException("LocalDateTime '" + localDateTime + "' does not exist in zone '" + zone + "' due to a gap in the local time-line, typically caused by daylight savings");<NEW_LINE>}<NEW_LINE>throw new DateTimeException("ZoneOffset '" + offset + "' is not valid for LocalDateTime '" + localDateTime + "' in zone '" + zone + "'");<NEW_LINE>}<NEW_LINE>return new ZonedDateTime(localDateTime, offset, zone);<NEW_LINE>}
trans = rules.getTransition(localDateTime);
1,170,846
public TransformInput computeNonIncrementalInputFromFolder() {<NEW_LINE>final List<JarInput> jarInputs = Lists.newArrayList();<NEW_LINE>final List<DirectoryInput> directoryInputs = Lists.newArrayList();<NEW_LINE>for (SubStream subStream : subStreams) {<NEW_LINE>if (subStream.getFormat() == Format.DIRECTORY) {<NEW_LINE>directoryInputs.add(new ImmutableDirectoryInput(subStream.getName(), new File(rootFolder, subStream.getName() + "-" + subStream.getFilename()), subStream.getTypes()<MASK><NEW_LINE>} else {<NEW_LINE>jarInputs.add(new ImmutableJarInput(subStream.getName(), new File(rootFolder, subStream.getName() + "-" + subStream.getFilename()), Status.NOTCHANGED, subStream.getTypes(), subStream.getScopes()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new ImmutableTransformInput(jarInputs, directoryInputs, rootFolder);<NEW_LINE>}
, subStream.getScopes()));
617,359
public void initialize() {<NEW_LINE>setLayout(new GridLayout(5, false));<NEW_LINE>Label ipPrototypeLabel = new Label(this, SWT.NONE);<NEW_LINE>ipPrototypeText = new Text(this, SWT.BORDER);<NEW_LINE>Label ipMaskLabel = new Label(this, SWT.NONE);<NEW_LINE>ipMaskCombo = new Combo(this, SWT.NONE);<NEW_LINE>Label hostnameLabel = new Label(this, SWT.NONE);<NEW_LINE>Text hostnameText = new Text(this, SWT.BORDER);<NEW_LINE>Button ipUpButton = new Button(this, SWT.NONE);<NEW_LINE>Label countLabel = new Label(this, SWT.NONE);<NEW_LINE>countSpinner = new Spinner(this, SWT.BORDER);<NEW_LINE>// the longest possible IP<NEW_LINE>ipPrototypeText.setText("255.255.255.255xx");<NEW_LINE>int textWidth = ipPrototypeText.computeSize(SWT.DEFAULT, SWT.DEFAULT).x;<NEW_LINE>ipPrototypeText.setText("");<NEW_LINE>ipPrototypeText.setLayoutData(new GridData(textWidth, -1));<NEW_LINE>ipPrototypeLabel.setText<MASK><NEW_LINE>ipPrototypeLabel.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));<NEW_LINE>ipMaskLabel.setText(getLabel("feeder.random.mask") + ":");<NEW_LINE>ipMaskCombo.setVisibleItemCount(10);<NEW_LINE>// Warning: IPv4 specific netmasks<NEW_LINE>ipMaskCombo.add("255...128");<NEW_LINE>ipMaskCombo.add("255...0");<NEW_LINE>ipMaskCombo.add("255..0.0");<NEW_LINE>ipMaskCombo.add("255.0.0.0");<NEW_LINE>ipMaskCombo.add("0.0.0.0");<NEW_LINE>ipMaskCombo.add("255..0.255");<NEW_LINE>ipMaskCombo.add("255.0.0.255");<NEW_LINE>ipMaskCombo.select(3);<NEW_LINE>ipMaskCombo.setLayoutData(new GridData());<NEW_LINE>((GridData) ipMaskCombo.getLayoutData()).horizontalSpan = 2;<NEW_LINE>hostnameLabel.setText(getLabel("feeder.random.hostname") + ":");<NEW_LINE>ipMaskLabel.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));<NEW_LINE>FeederActions.HostnameButton hostnameSelectionListener = new FeederActions.HostnameButton(hostnameText, ipPrototypeText, ipMaskCombo);<NEW_LINE>hostnameText.addTraverseListener(hostnameSelectionListener);<NEW_LINE>hostnameText.setLayoutData(new GridData(textWidth, -1));<NEW_LINE>ipUpButton.setText(getLabel("button.ipUp"));<NEW_LINE>ipUpButton.addSelectionListener(hostnameSelectionListener);<NEW_LINE>countLabel.setText(getLabel("feeder.random.count"));<NEW_LINE>countSpinner.setSelection(100);<NEW_LINE>countSpinner.setMaximum(100000000);<NEW_LINE>countSpinner.setMinimum(1);<NEW_LINE>countSpinner.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));<NEW_LINE>countSpinner.addTraverseListener(e -> {<NEW_LINE>// this due to a bug either in SWT or GTK:<NEW_LINE>// spinner getText() returns the new value only if<NEW_LINE>// it has lost the focus first<NEW_LINE>ipPrototypeText.forceFocus();<NEW_LINE>countSpinner.forceFocus();<NEW_LINE>});<NEW_LINE>pack();<NEW_LINE>// do this stuff asynchronously (to show GUI faster)<NEW_LINE>asyncFillLocalHostInfo(hostnameText, ipPrototypeText);<NEW_LINE>}
(getLabel("feeder.random.prototype") + ":");
921,038
public void processElement(@Element KV<BigQueryTable, BigQueryTablePartition> input, PipelineOptions options) {<NEW_LINE>BigQueryTable t = input.getKey();<NEW_LINE>BigQueryTablePartition p = input.getValue();<NEW_LINE>if (t.isPartitioned() && p == null) {<NEW_LINE>throw new IllegalStateException(String.format("No partition to delete provided for a partitioned table %s.", t.getTableName()));<NEW_LINE>}<NEW_LINE>if (!t.isPartitioned() && p != null) {<NEW_LINE>throw new IllegalStateException(String.format("Got unexpected partition %s to delete for a non-partitioned table %s.", p.getPartitionName(), t.getTableName()));<NEW_LINE>}<NEW_LINE>if (!options.as(Options.class).getDeleteSourceData()) {<NEW_LINE>if (t.isPartitioned()) {<NEW_LINE>LOG.info("Skipping source BigQuery data deletion for partition {}${}.", t.getTableName(<MASK><NEW_LINE>} else {<NEW_LINE>LOG.info("Skipping source BigQuery data deletion for table {}.", t.getTableName());<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (t.isPartitioned()) {<NEW_LINE>deletePartition(t, p);<NEW_LINE>} else {<NEW_LINE>deleteTable(t);<NEW_LINE>}<NEW_LINE>}
), p.getPartitionName());
333,702
private void updateOLCands(final I_C_BPartner_Location oldLocation, final I_C_BPartner_Location newLocation) {<NEW_LINE>final BPartnerLocationId oldBPLocationId = BPartnerLocationId.ofRepoId(oldLocation.getC_BPartner_ID(), oldLocation.getC_BPartner_Location_ID());<NEW_LINE>final BPartnerLocationId newBPLocationId = BPartnerLocationId.ofRepoId(newLocation.getC_BPartner_ID(), newLocation.getC_BPartner_Location_ID());<NEW_LINE>final LocationId oldLocationId = LocationId.ofRepoId(oldLocation.getC_Location_ID());<NEW_LINE>final LocationId newLocationId = LocationId.ofRepoId(newLocation.getC_Location_ID());<NEW_LINE>updateOLCandColumn(<MASK><NEW_LINE>updateOLCandColumn(I_C_OLCand.COLUMNNAME_C_BPartner_Location_Value_ID, oldLocationId, newLocationId);<NEW_LINE>updateOLCandColumn(I_C_OLCand.COLUMNNAME_Bill_Location_ID, oldBPLocationId, newBPLocationId);<NEW_LINE>updateOLCandColumn(I_C_OLCand.COLUMNNAME_Bill_Location_Value_ID, oldLocationId, newLocationId);<NEW_LINE>updateOLCandColumn(I_C_OLCand.COLUMNNAME_DropShip_Location_ID, oldBPLocationId, newBPLocationId);<NEW_LINE>updateOLCandColumn(I_C_OLCand.COLUMNNAME_DropShip_Location_Value_ID, oldLocationId, newLocationId);<NEW_LINE>updateOLCandColumn(I_C_OLCand.COLUMNNAME_DropShip_Location_Override_ID, oldBPLocationId, newBPLocationId);<NEW_LINE>updateOLCandColumn(I_C_OLCand.COLUMNNAME_DropShip_Location_Override_Value_ID, oldLocationId, newLocationId);<NEW_LINE>updateOLCandColumn(I_C_OLCand.COLUMNNAME_HandOver_Location_ID, oldBPLocationId, newBPLocationId);<NEW_LINE>updateOLCandColumn(I_C_OLCand.COLUMNNAME_HandOver_Location_Value_ID, oldLocationId, newLocationId);<NEW_LINE>updateOLCandColumn(I_C_OLCand.COLUMNNAME_HandOver_Location_Override_ID, oldBPLocationId, newBPLocationId);<NEW_LINE>updateOLCandColumn(I_C_OLCand.COLUMNNAME_HandOver_Location_Override_Value_ID, oldLocationId, newLocationId);<NEW_LINE>updateOLCandColumn(I_C_OLCand.COLUMNNAME_C_BP_Location_Override_ID, oldBPLocationId, newBPLocationId);<NEW_LINE>updateOLCandColumn(I_C_OLCand.COLUMNNAME_C_BP_Location_Override_Value_ID, oldLocationId, newLocationId);<NEW_LINE>}
I_C_OLCand.COLUMNNAME_C_BPartner_Location_ID, oldBPLocationId, newBPLocationId);
920,701
public Result delete(UUID customerUUID) {<NEW_LINE>Customer customer = Customer.getOrBadRequest(customerUUID);<NEW_LINE>// TODO(API): Let's get rid of raw Json.<NEW_LINE>// Create DeleteBackupReq in form package and bind to that<NEW_LINE>ObjectNode formData = (ObjectNode) request().body().asJson();<NEW_LINE>List<YBPTask> taskList = new ArrayList<>();<NEW_LINE>for (JsonNode backupUUID : formData.get("backupUUID")) {<NEW_LINE>UUID uuid = UUID.fromString(backupUUID.asText());<NEW_LINE>Backup backup = Backup.get(customerUUID, uuid);<NEW_LINE>if (backup == null) {<NEW_LINE>LOG.info(<MASK><NEW_LINE>} else {<NEW_LINE>if (backup.state != Backup.BackupState.Completed && backup.state != Backup.BackupState.Failed) {<NEW_LINE>LOG.info("Can not delete {} backup as it is still in progress", uuid);<NEW_LINE>} else {<NEW_LINE>if (taskManager.isDuplicateDeleteBackupTask(customerUUID, uuid)) {<NEW_LINE>throw new PlatformServiceException(BAD_REQUEST, "Task to delete same backup already exists.");<NEW_LINE>}<NEW_LINE>DeleteBackup.Params taskParams = new DeleteBackup.Params();<NEW_LINE>taskParams.customerUUID = customerUUID;<NEW_LINE>taskParams.backupUUID = uuid;<NEW_LINE>UUID taskUUID = commissioner.submit(TaskType.DeleteBackup, taskParams);<NEW_LINE>LOG.info("Saved task uuid {} in customer tasks for backup {}.", taskUUID, uuid);<NEW_LINE>CustomerTask.create(customer, backup.getBackupInfo().universeUUID, taskUUID, CustomerTask.TargetType.Backup, CustomerTask.TaskType.Delete, "Backup");<NEW_LINE>taskList.add(new YBPTask(taskUUID, taskParams.backupUUID));<NEW_LINE>auditService().createAuditEntryWithReqBody(ctx(), Audit.TargetType.Backup, Objects.toString(backup.backupUUID, null), Audit.ActionType.Delete, Json.toJson(formData), taskUUID);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new YBPTasks(taskList).asResult();<NEW_LINE>}
"Can not delete {} backup as it is not present in the database.", backupUUID.asText());
130,571
public synchronized XGBoostModel<Label> train(Dataset<Label> examples, Map<String, Provenance> runProvenance, int invocationCount) {<NEW_LINE>if (examples.getOutputInfo().getUnknownCount() > 0) {<NEW_LINE>throw new IllegalArgumentException("The supplied Dataset contained unknown Outputs, and this Trainer is supervised.");<NEW_LINE>}<NEW_LINE>ImmutableFeatureMap featureMap = examples.getFeatureIDMap();<NEW_LINE>ImmutableOutputInfo<Label> outputInfo = examples.getOutputIDInfo();<NEW_LINE>if (invocationCount != INCREMENT_INVOCATION_COUNT) {<NEW_LINE>setInvocationCount(invocationCount);<NEW_LINE>}<NEW_LINE>TrainerProvenance trainerProvenance = getProvenance();<NEW_LINE>trainInvocationCounter++;<NEW_LINE>parameters.put("num_class", outputInfo.size());<NEW_LINE>Booster model;<NEW_LINE>Function<Label, Float> responseExtractor = (Label l) -> (<MASK><NEW_LINE>try {<NEW_LINE>DMatrixTuple<Label> trainingData = convertExamples(examples, featureMap, responseExtractor);<NEW_LINE>model = XGBoost.train(trainingData.data, parameters, numTrees, Collections.emptyMap(), null, null);<NEW_LINE>} catch (XGBoostError e) {<NEW_LINE>logger.log(Level.SEVERE, "XGBoost threw an error", e);<NEW_LINE>throw new IllegalStateException(e);<NEW_LINE>}<NEW_LINE>ModelProvenance provenance = new ModelProvenance(XGBoostModel.class.getName(), OffsetDateTime.now(), examples.getProvenance(), trainerProvenance, runProvenance);<NEW_LINE>XGBoostModel<Label> xgModel = createModel("xgboost-classification-model", provenance, featureMap, outputInfo, Collections.singletonList(model), new XGBoostClassificationConverter());<NEW_LINE>return xgModel;<NEW_LINE>}
float) outputInfo.getID(l);
371,529
public final FunctionEx<ExpressionEvalContext, SlidingWindowPolicy> windowPolicyProvider() {<NEW_LINE>QueryParameterMetadata parameterMetadata = ((HazelcastRelOptCluster) getCluster()).getParameterMetadata();<NEW_LINE>RexToExpressionVisitor visitor = new RexToExpressionVisitor(FAILING_FIELD_TYPE_PROVIDER, parameterMetadata);<NEW_LINE>if (operator() == HazelcastSqlOperatorTable.TUMBLE) {<NEW_LINE>Expression<?> windowSizeExpression = operand(2).accept(visitor);<NEW_LINE>return context -> tumblingWinPolicy(WindowUtils.extractMillis(windowSizeExpression, context));<NEW_LINE>} else if (operator() == HazelcastSqlOperatorTable.HOP) {<NEW_LINE>Expression<?> windowSizeExpression = operand(2).accept(visitor);<NEW_LINE>Expression<?> slideSizeExpression = operand<MASK><NEW_LINE>return context -> slidingWinPolicy(WindowUtils.extractMillis(windowSizeExpression, context), WindowUtils.extractMillis(slideSizeExpression, context));<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException();<NEW_LINE>}<NEW_LINE>}
(3).accept(visitor);
410,731
public Entry<Collection<DSMRMeterDescriptor>, List<CosemObject>> detectMeters(P1Telegram telegram) {<NEW_LINE>final Map<DSMRMeterKind, DSMRMeterDescriptor> detectedMeters = new HashMap<>();<NEW_LINE>final List<CosemObject> availableCosemObjects = List.copyOf(telegram.getCosemObjects());<NEW_LINE>final List<CosemObject> undetectedCosemObjects = new ArrayList<>(telegram.getCosemObjects());<NEW_LINE>// Find compatible meters<NEW_LINE>for (DSMRMeterType meterType : DSMRMeterType.values()) {<NEW_LINE>logger.trace("Trying if meter type {} is compatible", meterType);<NEW_LINE>final DSMRMeterDescriptor meterDescriptor = meterType.findCompatible(availableCosemObjects);<NEW_LINE>if (meterDescriptor == null) {<NEW_LINE>logger.trace("Meter type {} is not compatible", meterType);<NEW_LINE>} else {<NEW_LINE>logger.debug("Meter type {} is compatible", meterType);<NEW_LINE>final DSMRMeterDescriptor prevDetectedMeter = <MASK><NEW_LINE>if (// First meter of this kind, add it<NEW_LINE>prevDetectedMeter == null || (prevDetectedMeter.getChannel() == meterDescriptor.getChannel()) && meterType.requiredCosemObjects.length > prevDetectedMeter.getMeterType().requiredCosemObjects.length) {<NEW_LINE>logger.debug("New compatible meter: {}", meterDescriptor);<NEW_LINE>detectedMeters.put(meterType.meterKind, meterDescriptor);<NEW_LINE>for (CosemObjectType cot : meterDescriptor.getMeterType().supportedCosemObjects) {<NEW_LINE>List<CosemObject> collect = undetectedCosemObjects.stream().filter(u -> cot == u.getType()).collect(Collectors.toList());<NEW_LINE>collect.forEach(undetectedCosemObjects::remove);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>logger.trace("Telegram as received from the device:\n{}\n", telegram.getRawTelegram());<NEW_LINE>return new SimpleEntry<>(detectedMeters.values(), undetectedCosemObjects);<NEW_LINE>}
detectedMeters.get(meterType.meterKind);
1,565,227
/*<NEW_LINE>* @see com.sitewhere.microservice.api.event.IDeviceEventManagement#<NEW_LINE>* addDeviceLocations(com.sitewhere.spi.device.event.IDeviceEventContext,<NEW_LINE>* com.sitewhere.spi.device.event.request.IDeviceLocationCreateRequest[])<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public List<IDeviceLocation> addDeviceLocations(IDeviceEventContext context, IDeviceLocationCreateRequest... requests) throws SiteWhereException {<NEW_LINE>List<IDeviceLocation> result = new ArrayList<>();<NEW_LINE>for (IDeviceLocationCreateRequest request : requests) {<NEW_LINE>DeviceLocation location = <MASK><NEW_LINE>Point.Builder builder = InfluxDbDeviceEvent.createBuilder();<NEW_LINE>InfluxDbDeviceLocation.saveToBuilder(location, builder);<NEW_LINE>addUserDefinedTags(context, builder);<NEW_LINE>getClient().getInflux().write(getClient().getConfiguration().getDatabase(), getAssignmentSpecificRetentionPolicy(context), builder.build());<NEW_LINE>result.add(location);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
DeviceEventManagementPersistence.deviceLocationCreateLogic(context, request);
725,238
private RepositoryData safeRepositoryData(long repositoryStateId, Map<String, BlobMetadata> rootBlobs) {<NEW_LINE>final long generation = <MASK><NEW_LINE>final long genToLoad;<NEW_LINE>final RepositoryData cached;<NEW_LINE>if (bestEffortConsistency) {<NEW_LINE>genToLoad = latestKnownRepoGen.updateAndGet(known -> Math.max(known, repositoryStateId));<NEW_LINE>cached = null;<NEW_LINE>} else {<NEW_LINE>genToLoad = latestKnownRepoGen.get();<NEW_LINE>cached = latestKnownRepositoryData.get();<NEW_LINE>}<NEW_LINE>if (genToLoad > generation) {<NEW_LINE>// It's always a possibility to not see the latest index-N in the listing here on an eventually consistent blob store, just<NEW_LINE>// debug log it. Any blobs leaked as a result of an inconsistent listing here will be cleaned up in a subsequent cleanup or<NEW_LINE>// snapshot delete run anyway.<NEW_LINE>logger.debug("Determined repository's generation from its contents to [" + generation + "] but " + "current generation is at least [" + genToLoad + "]");<NEW_LINE>}<NEW_LINE>if (genToLoad != repositoryStateId) {<NEW_LINE>throw new RepositoryException(metadata.name(), "concurrent modification of the index-N file, expected current generation [" + repositoryStateId + "], actual current generation [" + genToLoad + "]");<NEW_LINE>}<NEW_LINE>if (cached != null && cached.getGenId() == genToLoad) {<NEW_LINE>return cached;<NEW_LINE>}<NEW_LINE>return getRepositoryData(genToLoad);<NEW_LINE>}
latestGeneration(rootBlobs.keySet());
1,377,577
private static List<LintJob> parseInputs(List<File> inputs, Map<InputSource, CharSequence> contents, MessageContext mc, MessageQueue mq) throws IOException {<NEW_LINE>List<LintJob> compUnits = Lists.newArrayList();<NEW_LINE>// Parse each input, and find annotations.<NEW_LINE>for (File inp : inputs) {<NEW_LINE>CharProducer cp = CharProducer.Factory.fromFile(inp, "UTF-8");<NEW_LINE>if (cp.isEmpty()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>InputSource src = cp.getCurrentPosition().source();<NEW_LINE>mc.addInputSource(src);<NEW_LINE>contents.put(<MASK><NEW_LINE>JsTokenQueue tq = new JsTokenQueue(new JsLexer(cp), src);<NEW_LINE>try {<NEW_LINE>if (tq.isEmpty()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Parser p = new Parser(tq, mq);<NEW_LINE>compUnits.add(makeLintJob(p.parse(), mq));<NEW_LINE>} catch (ParseException ex) {<NEW_LINE>ex.toMessageQueue(mq);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return compUnits;<NEW_LINE>}
src, new FileContent(cp));
1,660,211
public void selectLiquidKeyboard(final int tabIndex) {<NEW_LINE>final LinearLayout symbolInputView = inputRootBinding != null <MASK><NEW_LINE>final LinearLayout mainInputView = inputRootBinding != null ? inputRootBinding.main.mainInput : null;<NEW_LINE>if (symbolInputView != null) {<NEW_LINE>if (tabIndex >= 0) {<NEW_LINE>final LinearLayout.LayoutParams param = (LinearLayout.LayoutParams) symbolInputView.getLayoutParams();<NEW_LINE>param.height = mainInputView.getHeight();<NEW_LINE>symbolInputView.setVisibility(View.VISIBLE);<NEW_LINE>final int orientation = getResources().getConfiguration().orientation;<NEW_LINE>liquidKeyboard.setLand(orientation == Configuration.ORIENTATION_LANDSCAPE);<NEW_LINE>liquidKeyboard.calcPadding(mainInputView.getWidth());<NEW_LINE>liquidKeyboard.select(tabIndex);<NEW_LINE>tabView.updateTabWidth();<NEW_LINE>if (inputRootBinding != null) {<NEW_LINE>mTabRoot.setBackground(mCandidateRoot.getBackground());<NEW_LINE>mTabRoot.move(tabView.getHightlightLeft(), tabView.getHightlightRight());<NEW_LINE>}<NEW_LINE>} else<NEW_LINE>symbolInputView.setVisibility(View.GONE);<NEW_LINE>}<NEW_LINE>if (mainInputView != null)<NEW_LINE>mainInputView.setVisibility(tabIndex >= 0 ? View.GONE : View.VISIBLE);<NEW_LINE>}
? inputRootBinding.symbol.symbolInput : null;
276,017
private static BundleEntryComponent observation(RandomNumberGenerator rand, BundleEntryComponent personEntry, Bundle bundle, BundleEntryComponent encounterEntry, Observation observation) {<NEW_LINE>org.hl7.fhir.dstu3.model.Observation observationResource = new org.hl7.fhir.dstu3.model.Observation();<NEW_LINE>observationResource.setSubject(new Reference(personEntry.getFullUrl()));<NEW_LINE>observationResource.setContext(new Reference(encounterEntry.getFullUrl()));<NEW_LINE>observationResource.setStatus(ObservationStatus.FINAL);<NEW_LINE>Code code = <MASK><NEW_LINE>observationResource.setCode(mapCodeToCodeableConcept(code, LOINC_URI));<NEW_LINE>observationResource.addCategory().addCoding().setCode(observation.category).setSystem("http://hl7.org/fhir/observation-category").setDisplay(observation.category);<NEW_LINE>if (observation.value != null) {<NEW_LINE>Type value = mapValueToFHIRType(observation.value, observation.unit);<NEW_LINE>observationResource.setValue(value);<NEW_LINE>} else if (observation.observations != null && !observation.observations.isEmpty()) {<NEW_LINE>// multi-observation (ex blood pressure)<NEW_LINE>for (Observation subObs : observation.observations) {<NEW_LINE>ObservationComponentComponent comp = new ObservationComponentComponent();<NEW_LINE>comp.setCode(mapCodeToCodeableConcept(subObs.codes.get(0), LOINC_URI));<NEW_LINE>Type value = mapValueToFHIRType(subObs.value, subObs.unit);<NEW_LINE>comp.setValue(value);<NEW_LINE>observationResource.addComponent(comp);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>observationResource.setEffective(convertFhirDateTime(observation.start, true));<NEW_LINE>observationResource.setIssued(new Date(observation.start));<NEW_LINE>if (USE_SHR_EXTENSIONS) {<NEW_LINE>Meta meta = new Meta();<NEW_LINE>// all Observations are Observations<NEW_LINE>meta.addProfile(SHR_EXT + "shr-finding-Observation");<NEW_LINE>if ("vital-signs".equals(observation.category)) {<NEW_LINE>meta.addProfile(SHR_EXT + "shr-vital-VitalSign");<NEW_LINE>}<NEW_LINE>// add the specific profile based on code<NEW_LINE>String codeMappingUri = SHR_MAPPING.get(LOINC_URI, code.code);<NEW_LINE>if (codeMappingUri != null) {<NEW_LINE>meta.addProfile(codeMappingUri);<NEW_LINE>}<NEW_LINE>observationResource.setMeta(meta);<NEW_LINE>}<NEW_LINE>BundleEntryComponent entry = newEntry(rand, bundle, observationResource);<NEW_LINE>observation.fullUrl = entry.getFullUrl();<NEW_LINE>return entry;<NEW_LINE>}
observation.codes.get(0);
353,706
static public Class<?> loadClass(String classNameOrURI, Class<?> requiredClass) {<NEW_LINE>if (classNameOrURI == null)<NEW_LINE>throw new ARQInternalErrorException("Null classNameorIRI");<NEW_LINE>if (classNameOrURI.startsWith("http:"))<NEW_LINE>return null;<NEW_LINE>if (classNameOrURI.startsWith("urn:"))<NEW_LINE>return null;<NEW_LINE>String className = classNameOrURI;<NEW_LINE>if (classNameOrURI.startsWith(ARQConstants.javaClassURIScheme))<NEW_LINE>className = classNameOrURI.substring(ARQConstants.javaClassURIScheme.length());<NEW_LINE>Class<?> classObj = null;<NEW_LINE>try {<NEW_LINE>classObj = Class.forName(className);<NEW_LINE>} catch (ClassNotFoundException ex) {<NEW_LINE>// It is possible that when coming from a URI we might have<NEW_LINE>// characters which aren't valid as Java identifiers<NEW_LINE>// We should see if we can load the class with the escaped class<NEW_LINE>// name instead<NEW_LINE>String baseUri = className.substring(0, className.lastIndexOf('.') + 1);<NEW_LINE>String escapedClassName = escape(className.substring(className.lastIndexOf('.') + 1));<NEW_LINE>try {<NEW_LINE>classObj = Class.forName(baseUri + escapedClassName);<NEW_LINE>} catch (ClassNotFoundException innerEx) {<NEW_LINE>// Ignore, handled in the outer catch<NEW_LINE>}<NEW_LINE>if (classObj == null) {<NEW_LINE>Log.warn(<MASK><NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (requiredClass != null && !requiredClass.isAssignableFrom(classObj)) {<NEW_LINE>Log.warn(ClsLoader.class, "Class '" + className + "' found but not a " + Lib.classShortName(requiredClass));<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return classObj;<NEW_LINE>}
ClsLoader.class, "Class not found: " + className);
928,568
public boolean apply(Game game, Ability source) {<NEW_LINE>Player controller = game.<MASK><NEW_LINE>if (controller != null) {<NEW_LINE>Choice choice = new ChoiceImpl(true);<NEW_LINE>choice.setMessage("Choose mode");<NEW_LINE>choice.setChoices(choices);<NEW_LINE>if (!controller.choose(outcome, choice, game)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Card sourceCard = game.getCard(source.getSourceId());<NEW_LINE>if (sourceCard != null) {<NEW_LINE>for (Object cost : source.getCosts()) {<NEW_LINE>if (cost instanceof SacrificeTargetCost) {<NEW_LINE>Permanent p = (Permanent) game.getLastKnownInformation(((SacrificeTargetCost) cost).getPermanents().get(0).getId(), Zone.BATTLEFIELD);<NEW_LINE>if (p != null) {<NEW_LINE>String chosen = choice.getChoice();<NEW_LINE>switch(chosen) {<NEW_LINE>case "Gain life equal to creature's power":<NEW_LINE>new GainLifeEffect(p.getPower().getValue()).apply(game, source);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>// "Gain life equal to creature's toughness"<NEW_LINE>new GainLifeEffect(p.getToughness().getValue()).apply(game, source);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
getPlayer(source.getControllerId());
285,658
private static long longByResolvingRawKey(String rawText, String key) {<NEW_LINE>long value = 0;<NEW_LINE>int index = rawText.indexOf(key);<NEW_LINE>while ((index > 0) && (!Character.isWhitespace(rawText.charAt(index - 1)))) {<NEW_LINE>index = rawText.indexOf(key, index + 1);<NEW_LINE>}<NEW_LINE>if (index >= 0) {<NEW_LINE>int equalSign = rawText.indexOf("=", index);<NEW_LINE>if (equalSign > index) {<NEW_LINE>int exclusiveEnd = equalSign + 1;<NEW_LINE>while ((exclusiveEnd < rawText.length()) && (!Character.isWhitespace(rawText.charAt(exclusiveEnd)))) {<NEW_LINE>exclusiveEnd++;<NEW_LINE>}<NEW_LINE>// the value on the right of the equal sign is always supposed to be hexadecimal<NEW_LINE>String number = "0x" + rawText.<MASK><NEW_LINE>value = longFromString(number, 0);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return value;<NEW_LINE>}
substring(equalSign + 1, exclusiveEnd);
255,831
public void marshall(GroupType groupType, AwsJsonWriter jsonWriter) throws Exception {<NEW_LINE>jsonWriter.beginObject();<NEW_LINE>if (groupType.getGroupName() != null) {<NEW_LINE>String groupName = groupType.getGroupName();<NEW_LINE>jsonWriter.name("GroupName");<NEW_LINE>jsonWriter.value(groupName);<NEW_LINE>}<NEW_LINE>if (groupType.getUserPoolId() != null) {<NEW_LINE>String userPoolId = groupType.getUserPoolId();<NEW_LINE>jsonWriter.name("UserPoolId");<NEW_LINE>jsonWriter.value(userPoolId);<NEW_LINE>}<NEW_LINE>if (groupType.getDescription() != null) {<NEW_LINE><MASK><NEW_LINE>jsonWriter.name("Description");<NEW_LINE>jsonWriter.value(description);<NEW_LINE>}<NEW_LINE>if (groupType.getRoleArn() != null) {<NEW_LINE>String roleArn = groupType.getRoleArn();<NEW_LINE>jsonWriter.name("RoleArn");<NEW_LINE>jsonWriter.value(roleArn);<NEW_LINE>}<NEW_LINE>if (groupType.getPrecedence() != null) {<NEW_LINE>Integer precedence = groupType.getPrecedence();<NEW_LINE>jsonWriter.name("Precedence");<NEW_LINE>jsonWriter.value(precedence);<NEW_LINE>}<NEW_LINE>if (groupType.getLastModifiedDate() != null) {<NEW_LINE>java.util.Date lastModifiedDate = groupType.getLastModifiedDate();<NEW_LINE>jsonWriter.name("LastModifiedDate");<NEW_LINE>jsonWriter.value(lastModifiedDate);<NEW_LINE>}<NEW_LINE>if (groupType.getCreationDate() != null) {<NEW_LINE>java.util.Date creationDate = groupType.getCreationDate();<NEW_LINE>jsonWriter.name("CreationDate");<NEW_LINE>jsonWriter.value(creationDate);<NEW_LINE>}<NEW_LINE>jsonWriter.endObject();<NEW_LINE>}
String description = groupType.getDescription();
448,194
static List<Advice> mergeInstrumentationAnnotations(List<Advice> advisors, byte[] classBytes, @Nullable ClassLoader loader, String className) {<NEW_LINE>byte[] <MASK><NEW_LINE>if (Bytes.indexOf(classBytes, marker) == -1) {<NEW_LINE>return advisors;<NEW_LINE>}<NEW_LINE>InstrumentationSeekerClassVisitor cv = new InstrumentationSeekerClassVisitor();<NEW_LINE>ClassReader cr = new ClassReader(classBytes);<NEW_LINE>cr.accept(cv, ClassReader.SKIP_CODE);<NEW_LINE>List<InstrumentationConfig> instrumentationConfigs = cv.getInstrumentationConfigs();<NEW_LINE>if (instrumentationConfigs.isEmpty()) {<NEW_LINE>return advisors;<NEW_LINE>}<NEW_LINE>if (loader == null) {<NEW_LINE>logger.warn("@Instrumentation annotations not currently supported in bootstrap class" + " loader: {}", className);<NEW_LINE>return advisors;<NEW_LINE>}<NEW_LINE>for (InstrumentationConfig instrumentationConfig : instrumentationConfigs) {<NEW_LINE>instrumentationConfig.logValidationErrorsIfAny();<NEW_LINE>}<NEW_LINE>ImmutableMap<Advice, LazyDefinedClass> newAdvisors = AdviceGenerator.createAdvisors(instrumentationConfigs, null, false, false);<NEW_LINE>try {<NEW_LINE>ClassLoaders.defineClasses(newAdvisors.values(), loader);<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error(e.getMessage(), e);<NEW_LINE>}<NEW_LINE>List<Advice> mergedAdvisors = Lists.newArrayList(advisors);<NEW_LINE>mergedAdvisors.addAll(newAdvisors.keySet());<NEW_LINE>return mergedAdvisors;<NEW_LINE>}
marker = "Lorg/glowroot/agent/api/Instrumentation$".getBytes(UTF_8);
1,484,804
public Flux<ReactiveRedisConnection.CommandResponse<PendingRecordsCommand, PendingMessagesSummary>> xPendingSummary(Publisher<PendingRecordsCommand> publisher) {<NEW_LINE>return execute(publisher, command -> {<NEW_LINE>Assert.notNull(command.getKey(), "Key must not be null!");<NEW_LINE>Assert.notNull(command.getGroupName(), "Group name must not be null!");<NEW_LINE>byte[] k = toByteArray(command.getKey());<NEW_LINE>Mono<PendingResult> m = write(k, StringCodec.INSTANCE, RedisCommands.XPENDING, <MASK><NEW_LINE>return m.map(v -> {<NEW_LINE>Range<String> range = Range.open(v.getLowestId().toString(), v.getHighestId().toString());<NEW_LINE>PendingMessagesSummary s = new PendingMessagesSummary(command.getGroupName(), v.getTotal(), range, v.getConsumerNames());<NEW_LINE>return new ReactiveRedisConnection.CommandResponse<>(command, s);<NEW_LINE>});<NEW_LINE>});<NEW_LINE>}
k, command.getGroupName());
523,597
private static Entry medicationAdministration(RandomNumberGenerator rand, Entry personEntry, Bundle bundle, Entry encounterEntry, Medication medication) {<NEW_LINE>MedicationAdministration medicationResource = new MedicationAdministration();<NEW_LINE>medicationResource.setPatient(new ResourceReferenceDt(personEntry.getFullUrl()));<NEW_LINE>medicationResource.setEncounter(new ResourceReferenceDt<MASK><NEW_LINE>Code code = medication.codes.get(0);<NEW_LINE>String system = code.system.equals("SNOMED-CT") ? SNOMED_URI : RXNORM_URI;<NEW_LINE>medicationResource.setMedication(mapCodeToCodeableConcept(code, system));<NEW_LINE>medicationResource.setEffectiveTime(new DateTimeDt(new Date(medication.start)));<NEW_LINE>medicationResource.setStatus(MedicationAdministrationStatusEnum.COMPLETED);<NEW_LINE>if (medication.prescriptionDetails != null) {<NEW_LINE>JsonObject rxInfo = medication.prescriptionDetails;<NEW_LINE>MedicationAdministration.Dosage dosage = new MedicationAdministration.Dosage();<NEW_LINE>// as_needed is true if present<NEW_LINE>if ((rxInfo.has("dosage")) && (!rxInfo.has("as_needed"))) {<NEW_LINE>SimpleQuantityDt dose = new SimpleQuantityDt();<NEW_LINE>dose.setValue(rxInfo.get("dosage").getAsJsonObject().get("amount").getAsDouble());<NEW_LINE>dosage.setQuantity(dose);<NEW_LINE>if (rxInfo.has("instructions")) {<NEW_LINE>for (JsonElement instructionElement : rxInfo.get("instructions").getAsJsonArray()) {<NEW_LINE>JsonObject instruction = instructionElement.getAsJsonObject();<NEW_LINE>dosage.setText(instruction.get("display").getAsString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>medicationResource.setDosage(dosage);<NEW_LINE>}<NEW_LINE>if (!medication.reasons.isEmpty()) {<NEW_LINE>// Only one element in list<NEW_LINE>Code reason = medication.reasons.get(0);<NEW_LINE>for (Entry entry : bundle.getEntry()) {<NEW_LINE>if (entry.getResource().getResourceName().equals("Condition")) {<NEW_LINE>Condition condition = (Condition) entry.getResource();<NEW_LINE>// Only one element in list<NEW_LINE>CodeableConceptDt coding = condition.getCode();<NEW_LINE>if (reason.code.equals(coding.getCodingFirstRep().getCode())) {<NEW_LINE>medicationResource.addReasonGiven(coding);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Entry medicationAdminEntry = newEntry(rand, bundle, medicationResource);<NEW_LINE>return medicationAdminEntry;<NEW_LINE>}
(encounterEntry.getFullUrl()));
1,846,877
/*<NEW_LINE>* Posts proper lost/gain focus events to the event queue.<NEW_LINE>*/<NEW_LINE>@SuppressWarnings("deprecation")<NEW_LINE>public static // provided by the descendant peers<NEW_LINE>boolean // provided by the descendant peers<NEW_LINE>deliverFocus(// provided by the descendant peers<NEW_LINE>Component lightweightChild, // provided by the descendant peers<NEW_LINE>Component target, // provided by the descendant peers<NEW_LINE>boolean temporary, // provided by the descendant peers<NEW_LINE>boolean focusedWindowChangeAllowed, // provided by the descendant peers<NEW_LINE>long time, // provided by the descendant peers<NEW_LINE>CausedFocusEvent.Cause cause, Component currentFocusOwner) {<NEW_LINE>if (lightweightChild == null) {<NEW_LINE>lightweightChild = target;<NEW_LINE>}<NEW_LINE>Component currentOwner = currentFocusOwner;<NEW_LINE>if (currentOwner != null && currentOwner.getPeer() == null) {<NEW_LINE>currentOwner = null;<NEW_LINE>}<NEW_LINE>if (currentOwner != null) {<NEW_LINE>FocusEvent fl = new CausedFocusEvent(currentOwner, FocusEvent.<MASK><NEW_LINE>if (focusLog.isLoggable(PlatformLogger.Level.FINER)) {<NEW_LINE>focusLog.finer("Posting focus event: " + fl);<NEW_LINE>}<NEW_LINE>SunToolkit.postEvent(SunToolkit.targetToAppContext(currentOwner), fl);<NEW_LINE>}<NEW_LINE>FocusEvent fg = new CausedFocusEvent(lightweightChild, FocusEvent.FOCUS_GAINED, false, currentOwner, cause);<NEW_LINE>if (focusLog.isLoggable(PlatformLogger.Level.FINER)) {<NEW_LINE>focusLog.finer("Posting focus event: " + fg);<NEW_LINE>}<NEW_LINE>SunToolkit.postEvent(SunToolkit.targetToAppContext(lightweightChild), fg);<NEW_LINE>return true;<NEW_LINE>}
FOCUS_LOST, false, lightweightChild, cause);
800,110
public void exportFieldRadio(JRPrintElement element) throws IOException {<NEW_LINE>String fieldName = element.<MASK><NEW_LINE>fieldName = fieldName == null || fieldName.trim().length() == 0 ? "FIELD_" + element.getUUID() : fieldName;<NEW_LINE>PdfRadioCheck radioField = pdfProducer.getRadioField(element.getX() + exporterContext.getOffsetX(), jasperPrint.getPageHeight() - element.getY() - exporterContext.getOffsetY(), element.getX() + exporterContext.getOffsetX() + element.getWidth(), jasperPrint.getPageHeight() - element.getY() - exporterContext.getOffsetY() - element.getHeight(), fieldName, "FIELD_" + element.getUUID());<NEW_LINE>PdfFieldCheckTypeEnum checkType = PdfFieldCheckTypeEnum.getByName(element.getPropertiesMap().getProperty(PDF_FIELD_CHECK_TYPE));<NEW_LINE>if (checkType != null) {<NEW_LINE>radioField.setCheckType(checkType);<NEW_LINE>}<NEW_LINE>if (ModeEnum.OPAQUE == element.getModeValue()) {<NEW_LINE>radioField.setBackgroundColor(element.getBackcolor());<NEW_LINE>}<NEW_LINE>radioField.setTextColor(element.getForecolor());<NEW_LINE>JRPen pen = getFieldPen(element);<NEW_LINE>if (pen != null) {<NEW_LINE>float borderWidth = Math.round(pen.getLineWidth());<NEW_LINE>if (borderWidth > 0) {<NEW_LINE>radioField.setBorderColor(pen.getLineColor());<NEW_LINE>radioField.setBorderWidth(borderWidth);<NEW_LINE>String strBorderStyle = propertiesUtil.getProperty(PDF_FIELD_BORDER_STYLE, element, jasperPrint);<NEW_LINE>PdfFieldBorderStyleEnum borderStyle = PdfFieldBorderStyleEnum.getByName(strBorderStyle);<NEW_LINE>if (borderStyle == null) {<NEW_LINE>borderStyle = pen.getLineStyleValue() == LineStyleEnum.DASHED ? PdfFieldBorderStyleEnum.DASHED : PdfFieldBorderStyleEnum.SOLID;<NEW_LINE>}<NEW_LINE>radioField.setBorderStyle(borderStyle);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>radioField.setOnValue("FIELD_" + element.getUUID());<NEW_LINE>String checked = element.getPropertiesMap().getProperty(PDF_FIELD_CHECKED);<NEW_LINE>// need to set to false if previous button was checked<NEW_LINE>radioField.setChecked(Boolean.valueOf(checked));<NEW_LINE>// setting the read-only option has to occur before the getRadioGroup() call<NEW_LINE>String readOnly = element.getPropertiesMap().getProperty(PDF_FIELD_READ_ONLY);<NEW_LINE>if (readOnly != null) {<NEW_LINE>if (Boolean.valueOf(readOnly)) {<NEW_LINE>radioField.setReadOnly();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>radioField.addToGroup();<NEW_LINE>}
getPropertiesMap().getProperty(PDF_FIELD_NAME);
279,342
protected String formatCommand(Command command, String format, ValueFormatter valueFormatter, String... keys) {<NEW_LINE>Object[] values = new String[keys.length];<NEW_LINE>for (int i = 0; i < keys.length; i++) {<NEW_LINE>String value = null;<NEW_LINE>if (keys[i].equals(Command.KEY_UNIQUE_ID)) {<NEW_LINE>value = getUniqueId(command.getDeviceId());<NEW_LINE>} else {<NEW_LINE>Object object = command.getAttributes().get(keys[i]);<NEW_LINE>if (valueFormatter != null) {<NEW_LINE>value = valueFormatter.formatValue(keys[i], object);<NEW_LINE>}<NEW_LINE>if (value == null && object != null) {<NEW_LINE>value = object.toString();<NEW_LINE>}<NEW_LINE>if (value == null) {<NEW_LINE>value = "";<NEW_LINE>}<NEW_LINE>}<NEW_LINE>values[i] = value;<NEW_LINE>}<NEW_LINE>return <MASK><NEW_LINE>}
String.format(format, values);
614,702
public static SessionRecord initializeAliceSession(IdentityKeyPair identityKey, ECKeyPair baseKey, IdentityKey theirIdentityKey, ECPublicKey theirSignedPreKey, ECPublicKey theirRatchetKey) {<NEW_LINE>try (NativeHandleGuard identityPrivateGuard = new NativeHandleGuard(identityKey.getPrivateKey());<NEW_LINE>NativeHandleGuard identityPublicGuard = new NativeHandleGuard(identityKey.<MASK><NEW_LINE>NativeHandleGuard basePrivateGuard = new NativeHandleGuard(baseKey.getPrivateKey());<NEW_LINE>NativeHandleGuard basePublicGuard = new NativeHandleGuard(baseKey.getPublicKey());<NEW_LINE>NativeHandleGuard theirIdentityGuard = new NativeHandleGuard(theirIdentityKey.getPublicKey());<NEW_LINE>NativeHandleGuard theirSignedPreKeyGuard = new NativeHandleGuard(theirSignedPreKey);<NEW_LINE>NativeHandleGuard theirRatchetKeyGuard = new NativeHandleGuard(theirRatchetKey)) {<NEW_LINE>return new SessionRecord(Native.SessionRecord_InitializeAliceSession(identityPrivateGuard.nativeHandle(), identityPublicGuard.nativeHandle(), basePrivateGuard.nativeHandle(), basePublicGuard.nativeHandle(), theirIdentityGuard.nativeHandle(), theirSignedPreKeyGuard.nativeHandle(), theirRatchetKeyGuard.nativeHandle()));<NEW_LINE>}<NEW_LINE>}
getPublicKey().getPublicKey());
671,238
private static boolean registerServerInstanceFO(FileObject serverInstanceDir, String url, String displayName, String serverRoot, String domainRoot, String domainName, String port, String username, String password, String javaOpts, Version version) {<NEW_LINE>// NOI18N<NEW_LINE>String name = FileUtil.findFreeFileName(serverInstanceDir, "weblogic_autoregistered_instance", null);<NEW_LINE>FileObject instanceFO;<NEW_LINE>try {<NEW_LINE>instanceFO = serverInstanceDir.createData(name);<NEW_LINE>instanceFO.setAttribute(InstanceProperties.URL_ATTR, url);<NEW_LINE>instanceFO.setAttribute(InstanceProperties.USERNAME_ATTR, username);<NEW_LINE>instanceFO.setAttribute(InstanceProperties.PASSWORD_ATTR, password);<NEW_LINE>instanceFO.setAttribute(InstanceProperties.DISPLAY_NAME_ATTR, displayName);<NEW_LINE>instanceFO.setAttribute(InstanceProperties.HTTP_PORT_NUMBER, port);<NEW_LINE>instanceFO.setAttribute(WLPluginProperties.SERVER_ROOT_ATTR, serverRoot);<NEW_LINE>instanceFO.<MASK><NEW_LINE>instanceFO.setAttribute(WLPluginProperties.DEBUGGER_PORT_ATTR, WLInstantiatingIterator.DEFAULT_DEBUGGER_PORT);<NEW_LINE>instanceFO.setAttribute(WLPluginProperties.PROXY_ENABLED, WLInstantiatingIterator.DEFAULT_PROXY_ENABLED);<NEW_LINE>instanceFO.setAttribute(WLPluginProperties.DOMAIN_NAME, domainName);<NEW_LINE>instanceFO.setAttribute(WLPluginProperties.PORT_ATTR, port);<NEW_LINE>if (javaOpts != null) {<NEW_LINE>instanceFO.setAttribute(WLPluginProperties.JAVA_OPTS, javaOpts);<NEW_LINE>}<NEW_LINE>if (Utilities.isMac()) {<NEW_LINE>StringBuilder memOpts = new StringBuilder(WLInstantiatingIterator.DEFAULT_MAC_MEM_OPTS_HEAP);<NEW_LINE>if (version != null && !JDK8_ONLY_SERVER_VERSION.isBelowOrEqual(version)) {<NEW_LINE>// NOI18N<NEW_LINE>memOpts.append(' ');<NEW_LINE>memOpts.append(WLInstantiatingIterator.DEFAULT_MAC_MEM_OPTS_PERM);<NEW_LINE>}<NEW_LINE>instanceFO.setAttribute(WLPluginProperties.MEM_OPTS, memOpts.toString());<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} catch (IOException e) {<NEW_LINE>// NOI18N<NEW_LINE>LOGGER.log(Level.INFO, "Cannot register the default WebLogic server.");<NEW_LINE>LOGGER.log(Level.INFO, null, e);<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
setAttribute(WLPluginProperties.DOMAIN_ROOT_ATTR, domainRoot);
1,236,104
final AllocateTransitVirtualInterfaceResult executeAllocateTransitVirtualInterface(AllocateTransitVirtualInterfaceRequest allocateTransitVirtualInterfaceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(allocateTransitVirtualInterfaceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<AllocateTransitVirtualInterfaceRequest> request = null;<NEW_LINE>Response<AllocateTransitVirtualInterfaceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new AllocateTransitVirtualInterfaceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(allocateTransitVirtualInterfaceRequest));<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(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Direct Connect");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AllocateTransitVirtualInterface");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<AllocateTransitVirtualInterfaceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new AllocateTransitVirtualInterfaceResultJsonUnmarshaller());<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.SIGNING_REGION, getSigningRegion());
1,497,962
public void cleanupSessionTempBlocks(long sessionId, List<Long> tempBlockIds) {<NEW_LINE>Set<Long> sessionTempBlocks = mSessionIdToTempBlockIdsMap.get(sessionId);<NEW_LINE>// The session's temporary blocks have already been removed.<NEW_LINE>if (sessionTempBlocks == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (Long tempBlockId : tempBlockIds) {<NEW_LINE>if (!mBlockIdToTempBlockMap.containsKey(tempBlockId)) {<NEW_LINE>// This temp block does not exist in this dir, this is expected for some blocks since the<NEW_LINE>// input list is across all dirs<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>sessionTempBlocks.remove(tempBlockId);<NEW_LINE>TempBlockMeta tempBlockMeta = mBlockIdToTempBlockMap.remove(tempBlockId);<NEW_LINE>if (tempBlockMeta != null) {<NEW_LINE>reclaimSpace(tempBlockMeta.getBlockSize(), false);<NEW_LINE>} else {<NEW_LINE>LOG.error("Cannot find blockId {} when cleanup sessionId {}", tempBlockId, sessionId);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (sessionTempBlocks.isEmpty()) {<NEW_LINE>mSessionIdToTempBlockIdsMap.remove(sessionId);<NEW_LINE>} else {<NEW_LINE>// This may happen if the client comes back during clean up and creates more blocks or some<NEW_LINE>// temporary blocks failed to be deleted<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
LOG.warn("Blocks still owned by session {} after cleanup.", sessionId);
1,592,739
public void onCompletion(Void result, Exception exception) {<NEW_LINE>long latencyPerBlob = SystemTime.getInstance().milliseconds() - startTimeGetBlobInMs;<NEW_LINE>metricsCollector.updateLatency(latencyPerBlob);<NEW_LINE>logger.trace(" Time taken to delete blob {} in ms {}", blobId, latencyPerBlob);<NEW_LINE>final AtomicReference<Exception> exceptionToReturn = new AtomicReference<>();<NEW_LINE>if (exception == null) {<NEW_LINE>logger.trace("Deletion of {} succeeded. Issuing Get to confirm the deletion ", blobId);<NEW_LINE>getBlobAndValidate(blobId, null, RouterErrorCode.BlobDeleted, new Callback<GetBlobResult>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onCompletion(GetBlobResult getBlobResult, Exception exception) {<NEW_LINE>if (getBlobResult != null) {<NEW_LINE>exceptionToReturn.set(new IllegalStateException("Get of a deleted blob " + blobId + " should have failed with " + RouterErrorCode.BlobDeleted));<NEW_LINE>} else {<NEW_LINE>if (exception != null) {<NEW_LINE>exceptionToReturn.set(exception);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}, null);<NEW_LINE>} else {<NEW_LINE>if (exception instanceof RouterException) {<NEW_LINE>RouterException routerException = (RouterException) exception;<NEW_LINE>if (expectedErrorCode != null) {<NEW_LINE>if (!expectedErrorCode.equals(routerException.getErrorCode())) {<NEW_LINE>exceptionToReturn.set(routerException);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>exceptionToReturn.set(routerException);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>exceptionToReturn.set(new IllegalStateException<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>futureResult.done(null, exceptionToReturn.get());<NEW_LINE>if (callback != null) {<NEW_LINE>callback.onCompletion(null, exceptionToReturn.get());<NEW_LINE>}<NEW_LINE>}
("UnknownException thrown for deletion of " + blobId, exception));
746,134
public // / <param name="level"></param><NEW_LINE>void IncrementCounter(String level) {<NEW_LINE>int otherLevelInt;<NEW_LINE>String otherLevelStr;<NEW_LINE>if (!this.levels.get(level).getCounter().isEncounteredAlready()) {<NEW_LINE>// We haven't encountered this level before,<NEW_LINE>// so check that the lower levels have been initialised<NEW_LINE>otherLevelInt = Integer.parseInt(level) - 1;<NEW_LINE>otherLevelStr = Integer.toString(otherLevelInt);<NEW_LINE>while (// will fail once negative<NEW_LINE>this.levels.containsKey(otherLevelStr) && !this.levels.get(otherLevelStr).getCounter().isEncounteredAlready()) {<NEW_LINE>log.debug("Increment lower level " + otherLevelStr);<NEW_LINE>this.levels.get(otherLevelStr).IncrementCounter();<NEW_LINE>otherLevelInt--;<NEW_LINE>otherLevelStr = Integer.toString(otherLevelInt);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>log.debug("Increment level " + level);<NEW_LINE>this.levels.<MASK><NEW_LINE>// Now set all higher levels back to 1.<NEW_LINE>// here's a bit where the decision to use Strings as level IDs was bad<NEW_LINE>// - I need to loop through the derived levels and reset their counters<NEW_LINE>otherLevelInt = Integer.parseInt(level) + 1;<NEW_LINE>otherLevelStr = Integer.toString(otherLevelInt);<NEW_LINE>while (this.levels.containsKey(otherLevelStr)) {<NEW_LINE>log.debug("Reset level " + otherLevelInt);<NEW_LINE>this.levels.get(otherLevelStr).ResetCounter();<NEW_LINE>otherLevelInt++;<NEW_LINE>otherLevelStr = Integer.toString(otherLevelInt);<NEW_LINE>}<NEW_LINE>}
get(level).IncrementCounter();
717,139
public Object decode(Response response, Type type) throws IOException {<NEW_LINE>if (response.status() == 404)<NEW_LINE>return Util.emptyValueOf(type);<NEW_LINE>if (response.body() == null)<NEW_LINE>return null;<NEW_LINE>while (type instanceof ParameterizedType) {<NEW_LINE>ParameterizedType ptype = (ParameterizedType) type;<NEW_LINE>type = ptype.getRawType();<NEW_LINE>}<NEW_LINE>if (!(type instanceof Class)) {<NEW_LINE>throw new UnsupportedOperationException("SOAP only supports decoding raw types. Found " + type);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>SOAPMessage message = MessageFactory.newInstance(soapProtocol).createMessage(null, response.<MASK><NEW_LINE>if (message.getSOAPBody() != null) {<NEW_LINE>if (message.getSOAPBody().hasFault()) {<NEW_LINE>throw new SOAPFaultException(message.getSOAPBody().getFault());<NEW_LINE>}<NEW_LINE>Unmarshaller unmarshaller = jaxbContextFactory.createUnmarshaller((Class<?>) type);<NEW_LINE>if (this.useFirstChild) {<NEW_LINE>return unmarshaller.unmarshal(message.getSOAPBody().getFirstChild());<NEW_LINE>} else {<NEW_LINE>return unmarshaller.unmarshal(message.getSOAPBody().extractContentAsDocument());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (SOAPException | JAXBException e) {<NEW_LINE>throw new DecodeException(response.status(), e.toString(), response.request(), e);<NEW_LINE>} finally {<NEW_LINE>if (response.body() != null) {<NEW_LINE>response.body().close();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Util.emptyValueOf(type);<NEW_LINE>}
body().asInputStream());
892,307
public static GetSecretParametersResponse unmarshall(GetSecretParametersResponse getSecretParametersResponse, UnmarshallerContext _ctx) {<NEW_LINE>getSecretParametersResponse.setRequestId(_ctx.stringValue("GetSecretParametersResponse.RequestId"));<NEW_LINE>List<String> invalidParameters = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("GetSecretParametersResponse.InvalidParameters.Length"); i++) {<NEW_LINE>invalidParameters.add(_ctx.stringValue("GetSecretParametersResponse.InvalidParameters[" + i + "]"));<NEW_LINE>}<NEW_LINE>getSecretParametersResponse.setInvalidParameters(invalidParameters);<NEW_LINE>List<Parameter> parameters = new ArrayList<Parameter>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("GetSecretParametersResponse.Parameters.Length"); i++) {<NEW_LINE>Parameter parameter = new Parameter();<NEW_LINE>parameter.setId(_ctx.stringValue<MASK><NEW_LINE>parameter.setName(_ctx.stringValue("GetSecretParametersResponse.Parameters[" + i + "].Name"));<NEW_LINE>parameter.setCreatedDate(_ctx.stringValue("GetSecretParametersResponse.Parameters[" + i + "].CreatedDate"));<NEW_LINE>parameter.setCreatedBy(_ctx.stringValue("GetSecretParametersResponse.Parameters[" + i + "].CreatedBy"));<NEW_LINE>parameter.setUpdatedDate(_ctx.stringValue("GetSecretParametersResponse.Parameters[" + i + "].UpdatedDate"));<NEW_LINE>parameter.setUpdatedBy(_ctx.stringValue("GetSecretParametersResponse.Parameters[" + i + "].UpdatedBy"));<NEW_LINE>parameter.setDescription(_ctx.stringValue("GetSecretParametersResponse.Parameters[" + i + "].Description"));<NEW_LINE>parameter.setShareType(_ctx.stringValue("GetSecretParametersResponse.Parameters[" + i + "].ShareType"));<NEW_LINE>parameter.setParameterVersion(_ctx.integerValue("GetSecretParametersResponse.Parameters[" + i + "].ParameterVersion"));<NEW_LINE>parameter.setType(_ctx.stringValue("GetSecretParametersResponse.Parameters[" + i + "].Type"));<NEW_LINE>parameter.setValue(_ctx.stringValue("GetSecretParametersResponse.Parameters[" + i + "].Value"));<NEW_LINE>parameter.setConstraints(_ctx.stringValue("GetSecretParametersResponse.Parameters[" + i + "].Constraints"));<NEW_LINE>parameter.setKeyId(_ctx.stringValue("GetSecretParametersResponse.Parameters[" + i + "].KeyId"));<NEW_LINE>parameter.setTags(_ctx.mapValue("GetSecretParametersResponse.Parameters[" + i + "].Tags"));<NEW_LINE>parameter.setResourceGroupId(_ctx.stringValue("GetSecretParametersResponse.Parameters[" + i + "].ResourceGroupId"));<NEW_LINE>parameters.add(parameter);<NEW_LINE>}<NEW_LINE>getSecretParametersResponse.setParameters(parameters);<NEW_LINE>return getSecretParametersResponse;<NEW_LINE>}
("GetSecretParametersResponse.Parameters[" + i + "].Id"));
569,883
public LastAdminGroupRoomList requestLastAdminRoomsGroups(Long groupId, String xSdsAuthToken) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// verify the required parameter 'groupId' is set<NEW_LINE>if (groupId == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'groupId' when calling requestLastAdminRoomsGroups");<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/v4/groups/{group_id}/last_admin_rooms".replaceAll("\\{" + "group_id" + "\\}", apiClient.escapeString(groupId.toString()));<NEW_LINE>// query params<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>if (xSdsAuthToken != null)<NEW_LINE>localVarHeaderParams.put("X-Sds-Auth-Token", apiClient.parameterToString(xSdsAuthToken));<NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE><MASK><NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] localVarAuthNames = new String[] { "oauth2" };<NEW_LINE>GenericType<LastAdminGroupRoomList> localVarReturnType = new GenericType<LastAdminGroupRoomList>() {<NEW_LINE>};<NEW_LINE>return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);<NEW_LINE>}
final String[] localVarContentTypes = {};
597,011
protected void savePreferences(DBPPreferenceStore store) {<NEW_LINE>try {<NEW_LINE>store.setValue(SQLPreferenceConstants.STATEMENT_INVALIDATE_BEFORE_EXECUTE, invalidateBeforeExecuteCheck.getSelection());<NEW_LINE>store.setValue(SQLPreferenceConstants.STATEMENT_TIMEOUT, executeTimeoutText.getSelection());<NEW_LINE>store.setValue(SQLPreferenceConstants.BEEP_ON_QUERY_END, soundOnQueryEnd.getSelection());<NEW_LINE>store.setValue(SQLPreferenceConstants.REFRESH_DEFAULTS_AFTER_EXECUTE, updateDefaultAfterExecute.getSelection());<NEW_LINE>store.setValue(SQLPreferenceConstants.CLEAR_OUTPUT_BEFORE_EXECUTE, clearOutputBeforeExecute.getSelection());<NEW_LINE>store.setValue(SQLPreferenceConstants.SCRIPT_COMMIT_TYPE, CommonUtils.fromOrdinal(SQLScriptCommitType.class, commitTypeCombo.getSelectionIndex()).name());<NEW_LINE>store.setValue(SQLPreferenceConstants.SCRIPT_COMMIT_LINES, commitLinesText.getSelection());<NEW_LINE>store.setValue(SQLPreferenceConstants.SCRIPT_ERROR_HANDLING, CommonUtils.fromOrdinal(SQLScriptErrorHandling.class, errorHandlingCombo.getSelectionIndex()).name());<NEW_LINE>store.setValue(SQLPreferenceConstants.SCRIPT_FETCH_RESULT_SETS, fetchResultSetsCheck.getSelection());<NEW_LINE>store.setValue(SQLPreferenceConstants.RESET_CURSOR_ON_EXECUTE, resetCursorCheck.getSelection());<NEW_LINE>store.setValue(SQLPreferenceConstants.MAXIMIZE_EDITOR_ON_SCRIPT_EXECUTE, maxEditorCheck.getSelection());<NEW_LINE>store.setValue(ModelPreferences.SCRIPT_STATEMENT_DELIMITER, statementDelimiterText.getText());<NEW_LINE>store.setValue(ModelPreferences.SCRIPT_IGNORE_NATIVE_DELIMITER, ignoreNativeDelimiter.getSelection());<NEW_LINE>store.setValue(ModelPreferences.SCRIPT_STATEMENT_DELIMITER_BLANK, blankLineDelimiter.getSelection());<NEW_LINE>store.setValue(ModelPreferences.<MASK><NEW_LINE>store.setValue(ModelPreferences.SQL_PARAMETERS_ENABLED, enableSQLParameters.getSelection());<NEW_LINE>store.setValue(ModelPreferences.SQL_ANONYMOUS_PARAMETERS_ENABLED, enableSQLAnonymousParameters.getSelection());<NEW_LINE>store.setValue(ModelPreferences.SQL_ANONYMOUS_PARAMETERS_MARK, anonymousParameterMarkText.getText());<NEW_LINE>store.setValue(ModelPreferences.SQL_NAMED_PARAMETERS_PREFIX, namedParameterPrefixText.getText());<NEW_LINE>store.setValue(ModelPreferences.SQL_CONTROL_COMMAND_PREFIX, controlCommandPrefixText.getText());<NEW_LINE>store.setValue(ModelPreferences.SQL_PARAMETERS_IN_EMBEDDED_CODE_ENABLED, enableParametersInEmbeddedCode.getSelection());<NEW_LINE>store.setValue(ModelPreferences.SQL_VARIABLES_ENABLED, enableVariables.getSelection());<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.warn(e);<NEW_LINE>}<NEW_LINE>PrefUtils.savePreferenceStore(store);<NEW_LINE>}
QUERY_REMOVE_TRAILING_DELIMITER, removeTrailingDelimiter.getSelection());
1,382,428
protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>setContentView(R.layout.activity_set_group_manager);<NEW_LINE>titleBarLayout = <MASK><NEW_LINE>managerCountLabel = findViewById(R.id.set_group_manager_manager_label);<NEW_LINE>managerList = findViewById(R.id.set_group_manager_manager_list);<NEW_LINE>ownerFace = findViewById(R.id.set_group_manager_owner_face);<NEW_LINE>ownerName = findViewById(R.id.set_group_manager_owner_name);<NEW_LINE>setManagerView = findViewById(R.id.set_group_manager_add_manager);<NEW_LINE>titleBarLayout.setTitle(getString(R.string.group_set_manager), ITitleBarLayout.Position.MIDDLE);<NEW_LINE>managerList.setLayoutManager(new CustomLinearLayoutManager(this));<NEW_LINE>managerAdapter = new ManagerAdapter();<NEW_LINE>managerList.setAdapter(managerAdapter);<NEW_LINE>groupInfo = (GroupInfo) getIntent().getSerializableExtra(TUIGroupConstants.Group.GROUP_INFO);<NEW_LINE>presenter = new GroupManagerPresenter();<NEW_LINE>setClickListener();<NEW_LINE>loadGroupManager();<NEW_LINE>loadGroupOwner();<NEW_LINE>}
findViewById(R.id.set_group_manager_title_bar);
1,107,571
public synchronized int fetchPartitionCount(long timeoutMillis) {<NEW_LINE>int unknownTopicReplyCount = 0;<NEW_LINE>final int maxUnknownTopicReplyCount = 10;<NEW_LINE>int kafkaErrorCount = 0;<NEW_LINE>final int maxKafkaErrorCount = 10;<NEW_LINE>final long endTime = System.currentTimeMillis() + timeoutMillis;<NEW_LINE>while (System.currentTimeMillis() < endTime) {<NEW_LINE>// Try to get into a state where we're connected to Kafka<NEW_LINE>while (!_currentState.isConnectedToKafkaBroker() && System.currentTimeMillis() < endTime) {<NEW_LINE>_currentState.process();<NEW_LINE>}<NEW_LINE>if (endTime <= System.currentTimeMillis() && !_currentState.isConnectedToKafkaBroker()) {<NEW_LINE>throw new TimeoutException("Failed to get the partition count for topic " + _topic + " within " + timeoutMillis + " ms");<NEW_LINE>}<NEW_LINE>// Send the metadata request to Kafka<NEW_LINE>TopicMetadataResponse topicMetadataResponse = null;<NEW_LINE>try {<NEW_LINE>topicMetadataResponse = _simpleConsumer.send(new TopicMetadataRequest(Collections.singletonList(_topic)));<NEW_LINE>} catch (Exception e) {<NEW_LINE>_currentState.handleConsumerException(e);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>final TopicMetadata topicMetadata = topicMetadataResponse.topicsMetadata().get(0);<NEW_LINE>final short errorCode = topicMetadata.errorCode();<NEW_LINE>if (errorCode == Errors.NONE.code()) {<NEW_LINE>return topicMetadata.partitionsMetadata().size();<NEW_LINE>} else if (errorCode == Errors.LEADER_NOT_AVAILABLE.code()) {<NEW_LINE>// If there is no leader, it'll take some time for a new leader to be elected, wait 100 ms before retrying<NEW_LINE>Uninterruptibles.sleepUninterruptibly(100, TimeUnit.MILLISECONDS);<NEW_LINE>} else if (errorCode == Errors.INVALID_TOPIC_EXCEPTION.code()) {<NEW_LINE><MASK><NEW_LINE>} else if (errorCode == Errors.UNKNOWN_TOPIC_OR_PARTITION.code()) {<NEW_LINE>if (maxUnknownTopicReplyCount < unknownTopicReplyCount) {<NEW_LINE>throw new RuntimeException("Topic " + _topic + " does not exist");<NEW_LINE>} else {<NEW_LINE>// Kafka topic creation can sometimes take some time, so we'll retry after a little bit<NEW_LINE>unknownTopicReplyCount++;<NEW_LINE>Uninterruptibles.sleepUninterruptibly(100, TimeUnit.MILLISECONDS);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// Retry after a short delay<NEW_LINE>kafkaErrorCount++;<NEW_LINE>if (maxKafkaErrorCount < kafkaErrorCount) {<NEW_LINE>throw exceptionForKafkaErrorCode(errorCode);<NEW_LINE>}<NEW_LINE>Uninterruptibles.sleepUninterruptibly(100, TimeUnit.MILLISECONDS);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw new TimeoutException();<NEW_LINE>}
throw new RuntimeException("Invalid topic name " + _topic);
1,479,149
public Object calculate(Context ctx) {<NEW_LINE>if (param == null || param.isLeaf()) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("swap" + mm.getMessage("function.missingParam"));<NEW_LINE>}<NEW_LINE>if (param.getSubSize() != 2) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("swap" + mm.getMessage("function.invalidParam"));<NEW_LINE>}<NEW_LINE>IParam sub0 = param.getSub(0);<NEW_LINE>IParam sub1 = param.getSub(1);<NEW_LINE>if (sub0 == null || sub1 == null) {<NEW_LINE><MASK><NEW_LINE>throw new RQException("swap" + mm.getMessage("function.invalidParam"));<NEW_LINE>}<NEW_LINE>Object param1 = sub0.getLeafExpression().calculate(ctx);<NEW_LINE>if (!(param1 instanceof Sequence)) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("swap" + mm.getMessage("function.paramTypeError"));<NEW_LINE>}<NEW_LINE>Object param2 = sub1.getLeafExpression().calculate(ctx);<NEW_LINE>if (!(param2 instanceof Sequence)) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("swap" + mm.getMessage("function.paramTypeError"));<NEW_LINE>}<NEW_LINE>return srcSequence.swap((Sequence) param1, (Sequence) param2);<NEW_LINE>}
MessageManager mm = EngineMessage.get();
935,313
private static void tryAssertionMinMax(RegressionEnvironment env, boolean soda, AtomicInteger milestone) {<NEW_LINE>String[] fields = "maxb,maxu,minb,minu".split(",");<NEW_LINE>RegressionPath path = new RegressionPath();<NEW_LINE>String eplDeclare = "@public create table varagg (" + "maxb max(int), maxu maxever(int), minb min(int), minu minever(int))";<NEW_LINE>env.compileDeploy(soda, eplDeclare, path);<NEW_LINE>String eplIterate = "@name('iterate') select varagg from SupportBean_S0#lastevent";<NEW_LINE>env.compileDeploy(soda, eplIterate, path);<NEW_LINE>env.sendEventBean(new SupportBean_S0(0));<NEW_LINE>String eplBoundInto = "into table varagg select " + "max(intPrimitive) as maxb, min(intPrimitive) as minb " + "from SupportBean#length(2)";<NEW_LINE>env.compileDeploy(soda, eplBoundInto, path);<NEW_LINE>String eplUnboundInto = "into table varagg select " + "maxever(intPrimitive) as maxu, minever(intPrimitive) as minu " + "from SupportBean";<NEW_LINE>env.compileDeploy(soda, eplUnboundInto, path);<NEW_LINE>env.sendEventBean(new SupportBean("E1", 20));<NEW_LINE>env.sendEventBean(new SupportBean("E2", 15));<NEW_LINE>env.milestoneInc(milestone);<NEW_LINE>env.sendEventBean(new SupportBean("E3", 10));<NEW_LINE>env.assertIterator("iterate", iterator -> assertResults(iterator, fields, new Object[] { 15, 20, 10, 10 }));<NEW_LINE>env.sendEventBean(<MASK><NEW_LINE>env.assertIterator("iterate", iterator -> assertResults(iterator, fields, new Object[] { 10, 20, 5, 5 }));<NEW_LINE>env.milestoneInc(milestone);<NEW_LINE>env.sendEventBean(new SupportBean("E5", 25));<NEW_LINE>env.assertIterator("iterate", iterator -> assertResults(iterator, fields, new Object[] { 25, 25, 5, 5 }));<NEW_LINE>// invalid: unbound aggregation into bound max<NEW_LINE>env.tryInvalidCompile(path, "into table varagg select max(intPrimitive) as maxb from SupportBean", "Incompatible aggregation function for table 'varagg' column 'maxb', expecting 'max(int)' and received 'max(intPrimitive)': The table declares use with data windows and provided is unbound [");<NEW_LINE>// valid: bound with unbound variable<NEW_LINE>String eplBoundIntoUnbound = "into table varagg select " + "maxever(intPrimitive) as maxu, minever(intPrimitive) as minu " + "from SupportBean#length(2)";<NEW_LINE>env.compileDeploy(soda, eplBoundIntoUnbound, path);<NEW_LINE>env.undeployAll();<NEW_LINE>}
new SupportBean("E4", 5));
1,379,287
private void handleAlbertaInfo(@NonNull final OrgId orgId, @NonNull final SyncAdvise syncAdvise, @NonNull final JsonRequestBPartnerUpsertItem requestItem, @NonNull final JsonResponseBPartnerCompositeUpsertItem result) {<NEW_LINE>final <MASK><NEW_LINE>final JsonCompositeAlbertaBPartner compositeAlbertaBPartner = requestBPartnerComposite.getCompositeAlbertaBPartner();<NEW_LINE>if (compositeAlbertaBPartner != null) {<NEW_LINE>final BPartnerId bPartnerId = BPartnerId.ofRepoId(result.getResponseBPartnerItem().getMetasfreshId().getValue());<NEW_LINE>albertaBPartnerCompositeService.upsertAlbertaCompositeInfo(orgId, bPartnerId, compositeAlbertaBPartner, syncAdvise);<NEW_LINE>}<NEW_LINE>if (!requestBPartnerComposite.getContactsNotNull().getRequestItems().isEmpty() && !Check.isEmpty(result.getResponseContactItems())) {<NEW_LINE>final Map<String, JsonMetasfreshId> contactIdentifierToMetasfreshId = result.getResponseContactItems().stream().collect(ImmutableMap.toImmutableMap(JsonResponseUpsertItem::getIdentifier, JsonResponseUpsertItem::getMetasfreshId));<NEW_LINE>final SyncAdvise effectiveSyncAdvise = CoalesceUtil.coalesceNotNull(requestBPartnerComposite.getContactsNotNull().getSyncAdvise(), syncAdvise);<NEW_LINE>requestItem.getBpartnerComposite().getContactsNotNull().getRequestItems().stream().filter(contactRequestItem -> contactRequestItem.getJsonAlbertaContact() != null).forEach(contactRequestItem -> {<NEW_LINE>final JsonMetasfreshId contactMetasfreshId = contactIdentifierToMetasfreshId.get(contactRequestItem.getContactIdentifier());<NEW_LINE>if (contactMetasfreshId == null) {<NEW_LINE>throw MissingResourceException.builder().resourceName("BPartnerContact").resourceIdentifier(contactRequestItem.getContactIdentifier()).parentResource(requestBPartnerComposite).build();<NEW_LINE>}<NEW_LINE>albertaBPartnerCompositeService.upsertAlbertaContact(UserId.ofRepoId(contactMetasfreshId.getValue()), contactRequestItem.getJsonAlbertaContact(), effectiveSyncAdvise);<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}
JsonRequestComposite requestBPartnerComposite = requestItem.getBpartnerComposite();
224,069
private JCCompilationUnit doCompile(JavaFileObject input, Iterable<JavaFileObject> files, Context context) throws IOException {<NEW_LINE>JavacTool tool = JavacTool.create();<NEW_LINE>DiagnosticCollector<JavaFileObject> diagnosticsCollector = new DiagnosticCollector<>();<NEW_LINE>ErrorProneOptions errorProneOptions;<NEW_LINE>try {<NEW_LINE>errorProneOptions = ErrorProneOptions.processArgs(options);<NEW_LINE>} catch (InvalidCommandLineOptionException e) {<NEW_LINE>throw new IllegalArgumentException("Exception during argument processing: " + e);<NEW_LINE>}<NEW_LINE>context.put(ErrorProneOptions.class, errorProneOptions);<NEW_LINE>StringWriter out = new StringWriter();<NEW_LINE>JavacTaskImpl task = (JavacTaskImpl) tool.getTask(new PrintWriter(out, true), FileManagers.testFileManager(), diagnosticsCollector, ImmutableList.copyOf(errorProneOptions.getRemainingArgs()), /*classes=*/<NEW_LINE>null, files, context);<NEW_LINE>Iterable<? extends CompilationUnitTree<MASK><NEW_LINE>task.analyze();<NEW_LINE>ImmutableMap<URI, ? extends CompilationUnitTree> byURI = stream(trees).collect(toImmutableMap(t -> t.getSourceFile().toUri(), t -> t));<NEW_LINE>URI inputURI = input.toUri();<NEW_LINE>assertWithMessage(out + Joiner.on('\n').join(diagnosticsCollector.getDiagnostics())).that(byURI).containsKey(inputURI);<NEW_LINE>JCCompilationUnit tree = (JCCompilationUnit) byURI.get(inputURI);<NEW_LINE>Iterable<Diagnostic<? extends JavaFileObject>> errorDiagnostics = Iterables.filter(diagnosticsCollector.getDiagnostics(), d -> d.getKind() == Diagnostic.Kind.ERROR);<NEW_LINE>if (!Iterables.isEmpty(errorDiagnostics)) {<NEW_LINE>fail("compilation failed unexpectedly: " + errorDiagnostics);<NEW_LINE>}<NEW_LINE>return tree;<NEW_LINE>}
> trees = task.parse();
1,064,899
private void append4Update(ESMapping mapping, Object pkVal, Map<String, Object> esFieldData) {<NEW_LINE>if (mapping.get_id() != null) {<NEW_LINE>String parentVal = (String) esFieldData.remove("$parent_routing");<NEW_LINE>if (mapping.isUpsert()) {<NEW_LINE>ESUpdateRequest esUpdateRequest = this.esConnection.new ES7xUpdateRequest(mapping.get_index(), pkVal.toString()).setDoc<MASK><NEW_LINE>if (StringUtils.isNotEmpty(parentVal)) {<NEW_LINE>esUpdateRequest.setRouting(parentVal);<NEW_LINE>}<NEW_LINE>getBulk().add(esUpdateRequest);<NEW_LINE>} else {<NEW_LINE>ESUpdateRequest esUpdateRequest = this.esConnection.new ES7xUpdateRequest(mapping.get_index(), pkVal.toString()).setDoc(esFieldData);<NEW_LINE>if (StringUtils.isNotEmpty(parentVal)) {<NEW_LINE>esUpdateRequest.setRouting(parentVal);<NEW_LINE>}<NEW_LINE>getBulk().add(esUpdateRequest);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>ESSearchRequest esSearchRequest = this.esConnection.new ESSearchRequest(mapping.get_index()).setQuery(QueryBuilders.termQuery(mapping.getPk(), pkVal)).size(10000);<NEW_LINE>SearchResponse response = esSearchRequest.getResponse();<NEW_LINE>for (SearchHit hit : response.getHits()) {<NEW_LINE>ESUpdateRequest esUpdateRequest = this.esConnection.new ES7xUpdateRequest(mapping.get_index(), hit.getId()).setDoc(esFieldData);<NEW_LINE>getBulk().add(esUpdateRequest);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(esFieldData).setDocAsUpsert(true);
1,012,357
public final AndExprContext andExpr() throws RecognitionException {<NEW_LINE>AndExprContext _localctx = new AndExprContext(_ctx, getState());<NEW_LINE>enterRule(_localctx, 24, RULE_andExpr);<NEW_LINE>int _la;<NEW_LINE>try {<NEW_LINE>enterOuterAlt(_localctx, 1);<NEW_LINE>{<NEW_LINE>{<NEW_LINE>setState(234);<NEW_LINE>_localctx.eqExpr = eqExpr();<NEW_LINE>_localctx<MASK><NEW_LINE>}<NEW_LINE>setState(243);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>_la = _input.LA(1);<NEW_LINE>while (_la == AND) {<NEW_LINE>{<NEW_LINE>{<NEW_LINE>setState(237);<NEW_LINE>match(AND);<NEW_LINE>setState(238);<NEW_LINE>_localctx.eqExpr = eqExpr();<NEW_LINE>_localctx.p = NF.createArithmeticOp(ArithmeticOperation.AND, _localctx.p, _localctx.eqExpr.p);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>setState(245);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>_la = _input.LA(1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (RecognitionException re) {<NEW_LINE>_localctx.exception = re;<NEW_LINE>_errHandler.reportError(this, re);<NEW_LINE>_errHandler.recover(this, re);<NEW_LINE>} finally {<NEW_LINE>exitRule();<NEW_LINE>}<NEW_LINE>return _localctx;<NEW_LINE>}
.p = _localctx.eqExpr.p;
579,409
private void copySubIntervals(LayoutInterval sourceInterval, LayoutInterval targetInterval, Map /*<String,String>*/<NEW_LINE>sourceToTargetIds) {<NEW_LINE><MASK><NEW_LINE>while (iter.hasNext()) {<NEW_LINE>LayoutInterval sourceSub = (LayoutInterval) iter.next();<NEW_LINE>LayoutInterval clone = null;<NEW_LINE>if (sourceSub.isComponent()) {<NEW_LINE>String compId = (String) sourceToTargetIds.get(sourceSub.getComponent().getId());<NEW_LINE>LayoutComponent comp = getLayoutComponent(compId);<NEW_LINE>int dimension = (sourceSub == sourceSub.getComponent().getLayoutInterval(HORIZONTAL)) ? HORIZONTAL : VERTICAL;<NEW_LINE>clone = comp.getLayoutInterval(dimension);<NEW_LINE>}<NEW_LINE>LayoutInterval targetSub = LayoutInterval.cloneInterval(sourceSub, clone);<NEW_LINE>if (sourceSub.isGroup()) {<NEW_LINE>copySubIntervals(sourceSub, targetSub, sourceToTargetIds);<NEW_LINE>}<NEW_LINE>addInterval(targetSub, targetInterval, -1);<NEW_LINE>}<NEW_LINE>}
Iterator iter = sourceInterval.getSubIntervals();
135,108
final DeleteSuppressedDestinationResult executeDeleteSuppressedDestination(DeleteSuppressedDestinationRequest deleteSuppressedDestinationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteSuppressedDestinationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteSuppressedDestinationRequest> request = null;<NEW_LINE>Response<DeleteSuppressedDestinationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteSuppressedDestinationRequestProtocolMarshaller(protocolFactory).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, "SESv2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteSuppressedDestination");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteSuppressedDestinationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteSuppressedDestinationResultJsonUnmarshaller());<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(deleteSuppressedDestinationRequest));
59,447
private void doDisplayRun() {<NEW_LINE>// don't add anything to mapView if just one point should be displayed<NEW_LINE>if (mapOptions.coords != null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>showProgressHandler.sendEmptyMessage(SHOW_PROGRESS);<NEW_LINE>// display caches<NEW_LINE>final List<Geocache> cachesToDisplay = caches.getAsList();<NEW_LINE>final List<Waypoint> waypointsToDisplay <MASK><NEW_LINE>final Set<CachesOverlayItemImpl> itemsToDisplay = new HashSet<>();<NEW_LINE>if (!cachesToDisplay.isEmpty()) {<NEW_LINE>// Only show waypoints for single view or setting<NEW_LINE>// when less than showWaypointsthreshold Caches shown<NEW_LINE>countVisibleCaches();<NEW_LINE>final boolean forceCompactIconMode = CompactIconModeUtils.forceCompactIconMode(cachesCnt);<NEW_LINE>if (mapOptions.mapMode == MapMode.SINGLE || cachesCnt < Settings.getWayPointsThreshold()) {<NEW_LINE>for (final Waypoint waypoint : waypointsToDisplay) {<NEW_LINE>if (waypoint != null && waypoint.getCoords() != null && waypoint.getCoords().isValid()) {<NEW_LINE>itemsToDisplay.add(getWaypointItem(waypoint, forceCompactIconMode));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (final Geocache cache : cachesToDisplay) {<NEW_LINE>if (cache != null && cache.getCoords() != null && cache.getCoords().isValid()) {<NEW_LINE>itemsToDisplay.add(getCacheItem(cache, forceCompactIconMode));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// don't add other waypoints to overlayCaches if just one point should be displayed<NEW_LINE>if (mapOptions.coords == null) {<NEW_LINE>mapView.updateItems(itemsToDisplay);<NEW_LINE>}<NEW_LINE>displayHandler.sendEmptyMessage(INVALIDATE_MAP);<NEW_LINE>updateMapTitle();<NEW_LINE>} finally {<NEW_LINE>showProgressHandler.sendEmptyMessage(HIDE_PROGRESS);<NEW_LINE>}<NEW_LINE>}
= new ArrayList<>(waypoints);
222,557
private void readStateSyncLocked() throws IllegalStateException {<NEW_LINE>FileInputStream in;<NEW_LINE>AtomicFile file = new AtomicFile(mStatePersistFile);<NEW_LINE>try {<NEW_LINE>in = file.openRead();<NEW_LINE>} catch (FileNotFoundException fnfe) {<NEW_LINE>Log.w(LOG_TAG, "No settings state " + mStatePersistFile);<NEW_LINE>logSettingsDirectoryInformation(mStatePersistFile);<NEW_LINE>addHistoricalOperationLocked(HISTORICAL_OPERATION_INITIALIZE, null);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (parseStateFromXmlStreamLocked(in)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Settings file exists but is corrupted. Retry with the fallback file<NEW_LINE>final File statePersistFallbackFile = new File(mStatePersistFile.getAbsolutePath() + FALLBACK_FILE_SUFFIX);<NEW_LINE>Log.i(LOG_TAG, "Failed parsing settings file: " + mStatePersistFile + ", retrying with fallback file: " + statePersistFallbackFile);<NEW_LINE>try {<NEW_LINE>in = new <MASK><NEW_LINE>} catch (FileNotFoundException fnfe) {<NEW_LINE>final String message = "No fallback file found for: " + mStatePersistFile;<NEW_LINE>Log.wtf(LOG_TAG, message);<NEW_LINE>throw new IllegalStateException(message);<NEW_LINE>}<NEW_LINE>if (parseStateFromXmlStreamLocked(in)) {<NEW_LINE>// Parsed state from fallback file. Restore original file with fallback file<NEW_LINE>try {<NEW_LINE>IoUtils.copy(statePersistFallbackFile, mStatePersistFile);<NEW_LINE>} catch (IOException | RemoteException ignored) {<NEW_LINE>// Failed to copy, but it's okay because we already parsed states from fallback file<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>final String message = "Failed parsing settings file: " + mStatePersistFile;<NEW_LINE>Log.wtf(LOG_TAG, message);<NEW_LINE>throw new IllegalStateException(message);<NEW_LINE>}<NEW_LINE>}
AtomicFile(statePersistFallbackFile).openRead();
879,767
private void _softDeleteDataMetadata(final String userId, @Nullable final List<String> uris) {<NEW_LINE>if (uris != null && !uris.isEmpty()) {<NEW_LINE>final List<String> paramVariables = uris.stream().map(s -> "?").collect(Collectors.toList());<NEW_LINE>final String[] aUris = uris.toArray(new String[0]);<NEW_LINE>final String paramString = Joiner.on(",").skipNulls().join(paramVariables);<NEW_LINE>final List<Long> ids = jdbcTemplate.query(String.format(SQL.GET_DATA_METADATA_IDS, paramString), aUris, (rs, rowNum) -> rs.getLong("id"));<NEW_LINE>if (!ids.isEmpty()) {<NEW_LINE>final List<String> idParamVariables = ids.stream().map(s -> "?").collect(Collectors.toList());<NEW_LINE>final Long[] aIds = ids.toArray(new Long[0]);<NEW_LINE>final String idParamString = Joiner.on(",").skipNulls().join(idParamVariables);<NEW_LINE>final List<Long> dupIds = jdbcTemplate.query(String.format(SQL.GET_DATA_METADATA_DELETE_BY_IDS, idParamString), aIds, (rs, rowNum) -> rs.getLong("id"));<NEW_LINE>if (!dupIds.isEmpty()) {<NEW_LINE>ids.removeAll(dupIds);<NEW_LINE>}<NEW_LINE>final List<Object[]> deleteDataMetadatas = Lists.newArrayList();<NEW_LINE>ids.forEach(id -> deleteDataMetadatas.add(new Object[] { id, userId }));<NEW_LINE>final int[] colTypes = { Types.BIGINT, Types.VARCHAR };<NEW_LINE>jdbcTemplate.batchUpdate(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
SQL.SOFT_DELETE_DATA_METADATA, deleteDataMetadatas, colTypes);