idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
156,210
public boolean apply(Game game, Ability source) {<NEW_LINE>Permanent targetedPermanent = game.getPermanent(source.getFirstTarget());<NEW_LINE>// store the permanent that was targeted<NEW_LINE>game.getState().setValue("MysticReflection" + source.getSourceId().toString(), targetedPermanent);<NEW_LINE>MysticReflectionWatcher watcher = game.getState().getWatcher(MysticReflectionWatcher.class);<NEW_LINE>// The sourceId must be sent to the next class, otherwise it gets lost. Thus, the identifier parameter.<NEW_LINE>// Otherwise, the state of the permanent that was targeted gets lost if it leaves the battlefield, etc.<NEW_LINE>// The zone is ALL because if the targeted permanent leaves the battlefield, the replacement effect still applies.<NEW_LINE>SimpleStaticAbility staticAbilityOnCard = new SimpleStaticAbility(Zone.ALL, new MysticReflectionReplacementEffect(watcher.getEnteredThisTurn(), source.getSourceId().toString()));<NEW_LINE>MysticReflectionGainAbilityEffect gainAbilityEffect = new MysticReflectionGainAbilityEffect(staticAbilityOnCard);<NEW_LINE>gainAbilityEffect.setTargetPointer(new FixedTarget(targetedPermanent.getMainCard().getId(), game));<NEW_LINE><MASK><NEW_LINE>return true;<NEW_LINE>}
game.addEffect(gainAbilityEffect, source);
462,235
public DeletePipelineResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DeletePipelineResult deletePipelineResult = new DeletePipelineResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return deletePipelineResult;<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("PipelineArn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>deletePipelineResult.setPipelineArn(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 deletePipelineResult;<NEW_LINE>}
JsonToken token = context.getCurrentToken();
579,586
public StringBuilder appendTo(final StringBuilder builder) {<NEW_LINE>if (null == buffer) {<NEW_LINE>return builder;<NEW_LINE>}<NEW_LINE>final int originalLimit = limit();<NEW_LINE>limit(initialOffset + actingBlockLength);<NEW_LINE>builder.append("[FrameCodec](sbeTemplateId=");<NEW_LINE>builder.append(TEMPLATE_ID);<NEW_LINE>builder.append("|sbeSchemaId=");<NEW_LINE>builder.append(SCHEMA_ID);<NEW_LINE>builder.append("|sbeSchemaVersion=");<NEW_LINE>if (parentMessage.actingVersion != SCHEMA_VERSION) {<NEW_LINE>builder.append(parentMessage.actingVersion);<NEW_LINE>builder.append('/');<NEW_LINE>}<NEW_LINE>builder.append(SCHEMA_VERSION);<NEW_LINE>builder.append("|sbeBlockLength=");<NEW_LINE>if (actingBlockLength != BLOCK_LENGTH) {<NEW_LINE>builder.append(actingBlockLength);<NEW_LINE>builder.append('/');<NEW_LINE>}<NEW_LINE>builder.append(BLOCK_LENGTH);<NEW_LINE>builder.append("):");<NEW_LINE>builder.append("irId=");<NEW_LINE>builder.append(irId());<NEW_LINE>builder.append('|');<NEW_LINE>builder.append("irVersion=");<NEW_LINE><MASK><NEW_LINE>builder.append('|');<NEW_LINE>builder.append("schemaVersion=");<NEW_LINE>builder.append(schemaVersion());<NEW_LINE>builder.append('|');<NEW_LINE>builder.append("packageName=");<NEW_LINE>builder.append('\'').append(packageName()).append('\'');<NEW_LINE>builder.append('|');<NEW_LINE>builder.append("namespaceName=");<NEW_LINE>builder.append('\'').append(namespaceName()).append('\'');<NEW_LINE>builder.append('|');<NEW_LINE>builder.append("semanticVersion=");<NEW_LINE>builder.append('\'').append(semanticVersion()).append('\'');<NEW_LINE>limit(originalLimit);<NEW_LINE>return builder;<NEW_LINE>}
builder.append(irVersion());
1,551,985
public List<Move> generateCutOffMoves(StockMove stockMove, LocalDate moveDate, LocalDate reverseMoveDate, int accountingCutOffTypeSelect, boolean recoveredTax, boolean ati, String moveDescription, boolean includeNotStockManagedProduct) throws AxelorException {<NEW_LINE>List<Move> moveList = new ArrayList<>();<NEW_LINE>List<StockMoveLine> stockMoveLineSortedList = stockMove.getStockMoveLineList();<NEW_LINE>Collections.sort(stockMoveLineSortedList, Comparator.comparing(StockMoveLine::getSequence));<NEW_LINE>Move move = generateCutOffMove(stockMove, stockMoveLineSortedList, moveDate, moveDate, accountingCutOffTypeSelect == SupplychainBatchRepository.ACCOUNTING_CUT_OFF_TYPE_SUPPLIER_INVOICES, recoveredTax, ati, moveDescription, includeNotStockManagedProduct, false);<NEW_LINE>if (move == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>moveList.add(move);<NEW_LINE>Move reverseMove = generateCutOffMove(stockMove, stockMoveLineSortedList, reverseMoveDate, moveDate, accountingCutOffTypeSelect == SupplychainBatchRepository.ACCOUNTING_CUT_OFF_TYPE_SUPPLIER_INVOICES, recoveredTax, <MASK><NEW_LINE>if (reverseMove == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>moveList.add(reverseMove);<NEW_LINE>reconcile(move, reverseMove);<NEW_LINE>return moveList;<NEW_LINE>}
ati, moveDescription, includeNotStockManagedProduct, true);
239,379
<T> Iterable<Class<? extends T>> load(Class<T> pluginType) {<NEW_LINE>return PerfStatsCollector.getInstance().measure("loadPlugins", () -> {<NEW_LINE>ClassLoader serviceClassLoader = classLoader;<NEW_LINE>if (serviceClassLoader == null) {<NEW_LINE>serviceClassLoader = Thread.currentThread().getContextClassLoader();<NEW_LINE>}<NEW_LINE>HashSet<Class<? extends T>> result = new HashSet<>();<NEW_LINE>try {<NEW_LINE>Enumeration<URL> urls = serviceClassLoader.getResources("META-INF/services/" + pluginType.getName());<NEW_LINE>while (urls.hasMoreElements()) {<NEW_LINE>URL url = urls.nextElement();<NEW_LINE>BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream()));<NEW_LINE>while (reader.ready()) {<NEW_LINE><MASK><NEW_LINE>result.add(Class.forName(s, false, serviceClassLoader).asSubclass(pluginType));<NEW_LINE>}<NEW_LINE>reader.close();<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} catch (IOException | ClassNotFoundException e) {<NEW_LINE>throw new AssertionError(e);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
String s = reader.readLine();
335,062
private void addAnchorUrls(Document html, HTTPSampleResult result, HTTPSamplerBase config, List<HTTPSamplerBase> potentialLinks) {<NEW_LINE>String base = "";<NEW_LINE>// $NON-NLS-1$<NEW_LINE>NodeList baseList = html.getElementsByTagName("base");<NEW_LINE>if (baseList.getLength() > 0) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>base = baseList.item(0).getAttributes().getNamedItem("href").getNodeValue();<NEW_LINE>}<NEW_LINE>// $NON-NLS-1$<NEW_LINE>NodeList nodeList = html.getElementsByTagName("a");<NEW_LINE>for (int i = 0; i < nodeList.getLength(); i++) {<NEW_LINE>Node tempNode = nodeList.item(i);<NEW_LINE>NamedNodeMap nnm = tempNode.getAttributes();<NEW_LINE>// $NON-NLS-1$<NEW_LINE>Node <MASK><NEW_LINE>if (namedItem == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>String hrefStr = namedItem.getNodeValue();<NEW_LINE>if (hrefStr.startsWith("javascript:")) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>// No point trying these<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>HTTPSamplerBase newUrl = HtmlParsingUtils.createUrlFromAnchor(hrefStr, ConversionUtils.makeRelativeURL(result.getURL(), base));<NEW_LINE>newUrl.setMethod(HTTPConstants.GET);<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("Potential <a href> match: " + newUrl);<NEW_LINE>}<NEW_LINE>if (HtmlParsingUtils.isAnchorMatched(newUrl, config)) {<NEW_LINE>log.debug("Matched!");<NEW_LINE>potentialLinks.add(newUrl);<NEW_LINE>}<NEW_LINE>} catch (MalformedURLException e) {<NEW_LINE>log.warn("Bad URL " + e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
namedItem = nnm.getNamedItem("href");
791,167
protected BootJavaHoverProvider createHoverHandler(JavaProjectFinder javaProjectFinder, SourceLinks sourceLinks, SpringProcessLiveDataProvider liveDataProvider) {<NEW_LINE>AnnotationHierarchyAwareLookup<HoverProvider> providers = new AnnotationHierarchyAwareLookup<>();<NEW_LINE>ValueHoverProvider valueHoverProvider = new ValueHoverProvider();<NEW_LINE>RequestMappingHoverProvider requestMappingHoverProvider = new RequestMappingHoverProvider();<NEW_LINE>AutowiredHoverProvider autowiredHoverProvider = new AutowiredHoverProvider(sourceLinks);<NEW_LINE><MASK><NEW_LINE>BeanInjectedIntoHoverProvider beanInjectedIntoHoverProvider = new BeanInjectedIntoHoverProvider(sourceLinks);<NEW_LINE>ConditionalsLiveHoverProvider conditionalsLiveHoverProvider = new ConditionalsLiveHoverProvider();<NEW_LINE>providers.put(org.springframework.ide.vscode.boot.java.value.Constants.SPRING_VALUE, valueHoverProvider);<NEW_LINE>providers.put(Annotations.SPRING_REQUEST_MAPPING, requestMappingHoverProvider);<NEW_LINE>providers.put(Annotations.SPRING_GET_MAPPING, requestMappingHoverProvider);<NEW_LINE>providers.put(Annotations.SPRING_POST_MAPPING, requestMappingHoverProvider);<NEW_LINE>providers.put(Annotations.SPRING_PUT_MAPPING, requestMappingHoverProvider);<NEW_LINE>providers.put(Annotations.SPRING_DELETE_MAPPING, requestMappingHoverProvider);<NEW_LINE>providers.put(Annotations.SPRING_PATCH_MAPPING, requestMappingHoverProvider);<NEW_LINE>providers.put(Annotations.PROFILE, new ActiveProfilesProvider());<NEW_LINE>providers.put(Annotations.AUTOWIRED, autowiredHoverProvider);<NEW_LINE>providers.put(Annotations.INJECT, autowiredHoverProvider);<NEW_LINE>providers.put(Annotations.COMPONENT, componentInjectionsHoverProvider);<NEW_LINE>providers.put(Annotations.BEAN, beanInjectedIntoHoverProvider);<NEW_LINE>providers.put(Annotations.CONDITIONAL, conditionalsLiveHoverProvider);<NEW_LINE>providers.put(Annotations.CONDITIONAL_ON_BEAN, conditionalsLiveHoverProvider);<NEW_LINE>providers.put(Annotations.CONDITIONAL_ON_MISSING_BEAN, conditionalsLiveHoverProvider);<NEW_LINE>providers.put(Annotations.CONDITIONAL_ON_PROPERTY, conditionalsLiveHoverProvider);<NEW_LINE>providers.put(Annotations.CONDITIONAL_ON_RESOURCE, conditionalsLiveHoverProvider);<NEW_LINE>providers.put(Annotations.CONDITIONAL_ON_CLASS, conditionalsLiveHoverProvider);<NEW_LINE>providers.put(Annotations.CONDITIONAL_ON_MISSING_CLASS, conditionalsLiveHoverProvider);<NEW_LINE>providers.put(Annotations.CONDITIONAL_ON_CLOUD_PLATFORM, conditionalsLiveHoverProvider);<NEW_LINE>providers.put(Annotations.CONDITIONAL_ON_WEB_APPLICATION, conditionalsLiveHoverProvider);<NEW_LINE>providers.put(Annotations.CONDITIONAL_ON_NOT_WEB_APPLICATION, conditionalsLiveHoverProvider);<NEW_LINE>providers.put(Annotations.CONDITIONAL_ON_ENABLED_INFO_CONTRIBUTOR, conditionalsLiveHoverProvider);<NEW_LINE>providers.put(Annotations.CONDITIONAL_ON_ENABLED_RESOURCE_CHAIN, conditionalsLiveHoverProvider);<NEW_LINE>providers.put(Annotations.CONDITIONAL_ON_ENABLED_ENDPOINT, conditionalsLiveHoverProvider);<NEW_LINE>providers.put(Annotations.CONDITIONAL_ON_ENABLED_HEALTH_INDICATOR, conditionalsLiveHoverProvider);<NEW_LINE>providers.put(Annotations.CONDITIONAL_ON_EXPRESSION, conditionalsLiveHoverProvider);<NEW_LINE>providers.put(Annotations.CONDITIONAL_ON_JAVA, conditionalsLiveHoverProvider);<NEW_LINE>providers.put(Annotations.CONDITIONAL_ON_JNDI, conditionalsLiveHoverProvider);<NEW_LINE>providers.put(Annotations.CONDITIONAL_ON_SINGLE_CANDIDATE, conditionalsLiveHoverProvider);<NEW_LINE>return new BootJavaHoverProvider(this, javaProjectFinder, providers, liveDataProvider);<NEW_LINE>}
ComponentInjectionsHoverProvider componentInjectionsHoverProvider = new ComponentInjectionsHoverProvider(sourceLinks);
1,484,753
public Double pay(@QueryParam("acct") String acctNumber, Payment payment) throws UnknownAccountException, InsufficientFundsException {<NEW_LINE>int myTimeout = AsyncTestServlet.TIMEOUT;<NEW_LINE>if (isAIX()) {<NEW_LINE>myTimeout = AsyncTestServlet.TIMEOUT * 2;<NEW_LINE>}<NEW_LINE>if (isZOS()) {<NEW_LINE>myTimeout = AsyncTestServlet.TIMEOUT * 3;<NEW_LINE>}<NEW_LINE>Double <MASK><NEW_LINE>if (balance == null) {<NEW_LINE>throw new UnknownAccountException();<NEW_LINE>}<NEW_LINE>Double paymentAmt = payment.getAmount();<NEW_LINE>try {<NEW_LINE>Double remainingBalanceInAccount = bankAccountClient.withdraw(paymentAmt).toCompletableFuture().get(myTimeout, TimeUnit.SECONDS);<NEW_LINE>_log.info("balance remaining in bank after withdrawal: " + remainingBalanceInAccount);<NEW_LINE>} catch (ExecutionException | InterruptedException | TimeoutException ex) {<NEW_LINE>Throwable t = ex.getCause();<NEW_LINE>if (t != null && t instanceof InsufficientFundsException) {<NEW_LINE>throw (InsufficientFundsException) t;<NEW_LINE>}<NEW_LINE>_log.log(Level.WARNING, "Caught unexpected exception: " + ex + " with cause " + t);<NEW_LINE>_log.info(crunchifyGenerateThreadDump());<NEW_LINE>}<NEW_LINE>Double remainingBalance = balance - paymentAmt;<NEW_LINE>accountBalances.put(acctNumber, remainingBalance);<NEW_LINE>_log.info("pay " + acctNumber + " " + remainingBalance);<NEW_LINE>return remainingBalance;<NEW_LINE>}
balance = accountBalances.get(acctNumber);
458,370
private void emitBind(TypeSpec.Builder builder) {<NEW_LINE>MethodSpec.Builder bindBuilder = MethodSpec.methodBuilder("bind").addModifiers(Modifier.PUBLIC, Modifier.STATIC).addParameter(get(Dart.Finder.class), "finder").addParameter(bestGuess(target.getFQN()), "target");<NEW_LINE>bindBuilder.addStatement("target.$L = new $T()", target.navigationModelFieldName, get(target.navigationModelPackage, target.navigationModelClass));<NEW_LINE>bindBuilder.addStatement("$T.bind(finder, target.$L, target)", get(target.navigationModelPackage, target.navigationModelClass + Dart.EXTRA_BINDER_SUFFIX), target.navigationModelFieldName);<NEW_LINE>if (target.parentPackage != null) {<NEW_LINE>// Emit a call to the superclass binder, if any.<NEW_LINE>bindBuilder.addStatement("$T.assign(target, target.$L)", bestGuess(target.getParentFQN() + NAVIGATION_MODEL_BINDER_SUFFIX), target.navigationModelFieldName);<NEW_LINE>}<NEW_LINE>builder.<MASK><NEW_LINE>}
addMethod(bindBuilder.build());
1,026,878
public CreateSafetyRuleResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>CreateSafetyRuleResult createSafetyRuleResult = new CreateSafetyRuleResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return createSafetyRuleResult;<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("AssertionRule", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>createSafetyRuleResult.setAssertionRule(AssertionRuleJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("GatingRule", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>createSafetyRuleResult.setGatingRule(GatingRuleJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return createSafetyRuleResult;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
1,650,684
public static CompilationUnitDeclaration parse(org.eclipse.jdt.internal.compiler.env.ICompilationUnit sourceUnit, NodeSearcher nodeSearcher, Map settings, int flags) {<NEW_LINE>if (sourceUnit == null) {<NEW_LINE>throw new IllegalStateException();<NEW_LINE>}<NEW_LINE>CompilerOptions compilerOptions = new CompilerOptions(settings);<NEW_LINE>boolean statementsRecovery = (flags & ICompilationUnit.ENABLE_STATEMENTS_RECOVERY) != 0;<NEW_LINE>compilerOptions.performMethodsFullRecovery = statementsRecovery;<NEW_LINE>compilerOptions.performStatementsRecovery = statementsRecovery;<NEW_LINE>compilerOptions.ignoreMethodBodies = (flags & ICompilationUnit.IGNORE_METHOD_BODIES) != 0;<NEW_LINE>Parser parser = LanguageSupportFactory.getParser(null, compilerOptions, new ProblemReporter(DefaultErrorHandlingPolicies.proceedWithAllProblems(), compilerOptions, new DefaultProblemFactory()), false, LanguageSupportFactory.CommentRecorderParserVariant);<NEW_LINE>// GROOVY end<NEW_LINE>CompilationResult compilationResult = new CompilationResult(sourceUnit, 0, 0, compilerOptions.maxProblemsPerUnit);<NEW_LINE>CompilationUnitDeclaration compilationUnitDeclaration = parser.dietParse(sourceUnit, compilationResult);<NEW_LINE>if (compilationUnitDeclaration.ignoreMethodBodies) {<NEW_LINE>compilationUnitDeclaration.ignoreFurtherInvestigation = true;<NEW_LINE>// if initial diet parse did not work, no need to dig into method bodies.<NEW_LINE>return compilationUnitDeclaration;<NEW_LINE>}<NEW_LINE>if (nodeSearcher != null) {<NEW_LINE>char[] source = parser.scanner.getSource();<NEW_LINE>int searchPosition = nodeSearcher.position;<NEW_LINE>if (searchPosition < 0 || searchPosition > source.length) {<NEW_LINE>// the position is out of range. There is no need to search for a node.<NEW_LINE>return compilationUnitDeclaration;<NEW_LINE>}<NEW_LINE>compilationUnitDeclaration.traverse(nodeSearcher, compilationUnitDeclaration.scope);<NEW_LINE>org.eclipse.jdt.internal.compiler.ast.ASTNode node = nodeSearcher.found;<NEW_LINE>if (node == null) {<NEW_LINE>return compilationUnitDeclaration;<NEW_LINE>}<NEW_LINE>org.eclipse.jdt.internal.compiler.ast.TypeDeclaration enclosingTypeDeclaration = nodeSearcher.enclosingType;<NEW_LINE>if (node instanceof AbstractMethodDeclaration) {<NEW_LINE>((AbstractMethodDeclaration) node).parseStatements(parser, compilationUnitDeclaration);<NEW_LINE>} else if (enclosingTypeDeclaration != null) {<NEW_LINE>if (node instanceof org.eclipse.jdt.internal.compiler.ast.Initializer) {<NEW_LINE>((org.eclipse.jdt.internal.compiler.ast.Initializer) node).parseStatements(parser, enclosingTypeDeclaration, compilationUnitDeclaration);<NEW_LINE>} else if (node instanceof org.eclipse.jdt.internal.compiler.ast.TypeDeclaration) {<NEW_LINE>((org.eclipse.jdt.internal.compiler.ast.TypeDeclaration) node).parseMethods(parser, compilationUnitDeclaration);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// fill the methods bodies in order for the code to be generated<NEW_LINE>// real parse of the method....<NEW_LINE>org.eclipse.jdt.internal.compiler.ast.<MASK><NEW_LINE>if (types != null) {<NEW_LINE>for (int j = 0, typeLength = types.length; j < typeLength; j++) {<NEW_LINE>types[j].parseMethods(parser, compilationUnitDeclaration);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return compilationUnitDeclaration;<NEW_LINE>}
TypeDeclaration[] types = compilationUnitDeclaration.types;
1,430,084
protected Object filterObject(Object result, GroovyDSLDContext context, String firstArgAsString) {<NEW_LINE>if (firstArgAsString == null) {<NEW_LINE>return reify(result);<NEW_LINE>}<NEW_LINE>String toCompare;<NEW_LINE>if (result instanceof ClassNode) {<NEW_LINE>toCompare = ((<MASK><NEW_LINE>} else if (result instanceof FieldNode) {<NEW_LINE>toCompare = ((FieldNode) result).getName();<NEW_LINE>} else if (result instanceof MethodNode) {<NEW_LINE>toCompare = ((MethodNode) result).getName();<NEW_LINE>} else if (result instanceof PropertyNode) {<NEW_LINE>toCompare = ((PropertyNode) result).getName();<NEW_LINE>} else if (result instanceof Expression) {<NEW_LINE>toCompare = ((Expression) result).getText();<NEW_LINE>} else {<NEW_LINE>toCompare = String.valueOf(result.toString());<NEW_LINE>}<NEW_LINE>return toCompare.equals(firstArgAsString) ? reify(result) : null;<NEW_LINE>}
ClassNode) result).getName();
410,259
public void onClick(DialogInterface dialog, int _which) {<NEW_LINE>String ourVersion = Util.getSelfVersionName(context);<NEW_LINE>StringBuilder sb = new StringBuilder(text);<NEW_LINE>sb.insert(0, "\r\n");<NEW_LINE>sb.insert(0, String.format("Id: %s\r\n", Build.ID));<NEW_LINE>sb.insert(0, String.format("Display: %s\r\n", Build.DISPLAY));<NEW_LINE>sb.insert(0, String.format("Host: %s\r\n", Build.HOST));<NEW_LINE>sb.insert(0, String.format("Device: %s\r\n", Build.DEVICE));<NEW_LINE>sb.insert(0, String.format("Product: %s\r\n", Build.PRODUCT));<NEW_LINE>sb.insert(0, String.format("Model: %s\r\n", Build.MODEL));<NEW_LINE>sb.insert(0, String.format("Manufacturer: %s\r\n", Build.MANUFACTURER));<NEW_LINE>sb.insert(0, String.format("Brand: %s\r\n", Build.BRAND));<NEW_LINE>sb.insert(0, "\r\n");<NEW_LINE>sb.insert(0, String.format("Android: %s (SDK %d)\r\n", Build.VERSION.RELEASE, Build.VERSION.SDK_INT));<NEW_LINE>sb.insert(0, String.format("XPrivacy: %s\r\n", ourVersion));<NEW_LINE>Intent sendEmail = new Intent(Intent.ACTION_SEND);<NEW_LINE>sendEmail.setType("message/rfc822");<NEW_LINE>sendEmail.putExtra(Intent.EXTRA_EMAIL, new String[] { "marcel+support@faircode.eu" });<NEW_LINE>sendEmail.putExtra(Intent.EXTRA_SUBJECT, "XPrivacy " + ourVersion + "/" + Build.VERSION.RELEASE + " support info");<NEW_LINE>sendEmail.putExtra(Intent.<MASK><NEW_LINE>try {<NEW_LINE>context.startActivity(sendEmail);<NEW_LINE>} catch (Throwable ex) {<NEW_LINE>Util.bug(null, ex);<NEW_LINE>}<NEW_LINE>}
EXTRA_TEXT, sb.toString());
1,487,178
public static void updateTopologyTaskTimeout(NimbusData data, String topologyId) {<NEW_LINE>Map topologyConf = null;<NEW_LINE>try {<NEW_LINE>topologyConf = StormConfig.read_nimbus_topology_conf(<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.warn("Failed to read configuration of {}, {}", topologyId, e.getMessage());<NEW_LINE>}<NEW_LINE>Integer timeout = null;<NEW_LINE>if (topologyConf != null) {<NEW_LINE>timeout = JStormUtils.parseInt(topologyConf.get(Config.NIMBUS_TASK_TIMEOUT_SECS));<NEW_LINE>}<NEW_LINE>if (timeout == null) {<NEW_LINE>timeout = JStormUtils.parseInt(data.getConf().get(Config.NIMBUS_TASK_TIMEOUT_SECS));<NEW_LINE>}<NEW_LINE>LOG.info("Setting taskTimeout:" + timeout + " for " + topologyId);<NEW_LINE>data.getTopologyTaskTimeout().put(topologyId, timeout);<NEW_LINE>}
topologyId, data.getBlobStore());
1,079,841
public void curve(float x1, float y1, float cx1, float cy1, float cx2, float cy2, float x2, float y2, int segments) {<NEW_LINE>check(ShapeType.Line, null, segments * 2 + 2);<NEW_LINE>float colorBits = color.toFloatBits();<NEW_LINE>// Algorithm from: http://www.antigrain.com/research/bezier_interpolation/index.html#PAGE_BEZIER_INTERPOLATION<NEW_LINE>float subdiv_step = 1f / segments;<NEW_LINE>float subdiv_step2 = subdiv_step * subdiv_step;<NEW_LINE>float subdiv_step3 = subdiv_step * subdiv_step * subdiv_step;<NEW_LINE>float pre1 = 3 * subdiv_step;<NEW_LINE>float pre2 = 3 * subdiv_step2;<NEW_LINE>float pre4 = 6 * subdiv_step2;<NEW_LINE>float pre5 = 6 * subdiv_step3;<NEW_LINE>float tmp1x = x1 - cx1 * 2 + cx2;<NEW_LINE>float tmp1y = y1 - cy1 * 2 + cy2;<NEW_LINE>float tmp2x = (cx1 - cx2) * 3 - x1 + x2;<NEW_LINE>float tmp2y = (cy1 - cy2) * 3 - y1 + y2;<NEW_LINE>float fx = x1;<NEW_LINE>float fy = y1;<NEW_LINE>float dfx = (cx1 - x1) * pre1 + tmp1x * pre2 + tmp2x * subdiv_step3;<NEW_LINE>float dfy = (cy1 - y1) * pre1 + tmp1y * pre2 + tmp2y * subdiv_step3;<NEW_LINE>float ddfx = tmp1x * pre4 + tmp2x * pre5;<NEW_LINE>float ddfy = tmp1y * pre4 + tmp2y * pre5;<NEW_LINE>float dddfx = tmp2x * pre5;<NEW_LINE>float dddfy = tmp2y * pre5;<NEW_LINE>while (segments-- > 0) {<NEW_LINE>renderer.color(colorBits);<NEW_LINE>renderer.<MASK><NEW_LINE>fx += dfx;<NEW_LINE>fy += dfy;<NEW_LINE>dfx += ddfx;<NEW_LINE>dfy += ddfy;<NEW_LINE>ddfx += dddfx;<NEW_LINE>ddfy += dddfy;<NEW_LINE>renderer.color(colorBits);<NEW_LINE>renderer.vertex(fx, fy, 0);<NEW_LINE>}<NEW_LINE>renderer.color(colorBits);<NEW_LINE>renderer.vertex(fx, fy, 0);<NEW_LINE>renderer.color(colorBits);<NEW_LINE>renderer.vertex(x2, y2, 0);<NEW_LINE>}
vertex(fx, fy, 0);
1,093,630
public ListenableFuture<?> processFor(long maxRuntime, long start) {<NEW_LINE>checkLockNotHeld("Can not process for a duration while holding the driver lock");<NEW_LINE>try (DriverLockResult lockResult = tryLockAndProcessPendingStateChanges(100, TimeUnit.MILLISECONDS)) {<NEW_LINE>if (lockResult.wasAcquired()) {<NEW_LINE>driverContext.startProcessTimer();<NEW_LINE>driverContext.getYieldSignal().setWithDelay(maxRuntime, driverContext.getPipelineContext().getTaskContext().getYieldExecutor());<NEW_LINE>try {<NEW_LINE>do {<NEW_LINE>ListenableFuture<?> future = processInternal();<NEW_LINE>if (!future.isDone()) {<NEW_LINE>return future;<NEW_LINE>}<NEW_LINE>} while (System.currentTimeMillis() - start < maxRuntime && !isFinishedInternal());<NEW_LINE>} finally {<NEW_LINE>driverContext<MASK><NEW_LINE>driverContext.recordProcessed();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return NOT_BLOCKED;<NEW_LINE>}
.getYieldSignal().reset();
244,153
final GetResourcePolicyResult executeGetResourcePolicy(GetResourcePolicyRequest getResourcePolicyRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getResourcePolicyRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<GetResourcePolicyRequest> request = null;<NEW_LINE>Response<GetResourcePolicyResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetResourcePolicyRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getResourcePolicyRequest));<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, "CodeBuild");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetResourcePolicy");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetResourcePolicyResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetResourcePolicyResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
1,174,447
private AuthnRequest createAuthnRequest(Saml2AuthenticationRequestContext context) {<NEW_LINE>String issuer = context.getIssuer();<NEW_LINE>String destination = context.getDestination();<NEW_LINE>String assertionConsumerServiceUrl = context.getAssertionConsumerServiceUrl();<NEW_LINE>String protocolBinding = context.getRelyingPartyRegistration().getAssertionConsumerServiceBinding().getUrn();<NEW_LINE>AuthnRequest auth = this.authnRequestBuilder.buildObject();<NEW_LINE>if (auth.getID() == null) {<NEW_LINE>auth.setID("ARQ" + UUID.randomUUID().toString().substring(1));<NEW_LINE>}<NEW_LINE>if (auth.getIssueInstant() == null) {<NEW_LINE>auth.setIssueInstant(Instant.now(this.clock));<NEW_LINE>}<NEW_LINE>if (auth.isForceAuthn() == null) {<NEW_LINE>auth.setForceAuthn(Boolean.FALSE);<NEW_LINE>}<NEW_LINE>if (auth.isPassive() == null) {<NEW_LINE>auth.setIsPassive(Boolean.FALSE);<NEW_LINE>}<NEW_LINE>if (auth.getProtocolBinding() == null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>auth.setProtocolBinding(protocolBinding);<NEW_LINE>if (auth.getNameIDPolicy() == null) {<NEW_LINE>setNameIdPolicy(auth, context.getRelyingPartyRegistration());<NEW_LINE>}<NEW_LINE>Issuer iss = this.issuerBuilder.buildObject();<NEW_LINE>iss.setValue(issuer);<NEW_LINE>auth.setIssuer(iss);<NEW_LINE>auth.setDestination(destination);<NEW_LINE>auth.setAssertionConsumerServiceURL(assertionConsumerServiceUrl);<NEW_LINE>return auth;<NEW_LINE>}
auth.setProtocolBinding(SAMLConstants.SAML2_POST_BINDING_URI);
1,424,159
// generates the equivalent of IOUtils.toByteArray<NEW_LINE>private static MethodNode generateDecryptionMethod(ClassNode decryptorClass) {<NEW_LINE>LabelNode start = new LabelNode();<NEW_LINE>LabelNode end = new LabelNode();<NEW_LINE>MethodNode decryptorNode = new MethodNode(Opcodes.ACC_PUBLIC | Opcodes.ACC_STATIC, "Decrypt", "(Ljava/io/InputStream;)[B", null, null);<NEW_LINE>decryptorNode.instructions.add(new TypeInsnNode(NEW, "java/io/ByteArrayOutputStream"));<NEW_LINE>decryptorNode.instructions.add(new InsnNode(DUP));<NEW_LINE>decryptorNode.instructions.add(new MethodInsnNode(INVOKESPECIAL, "java/io/ByteArrayOutputStream", "<init>", "()V", false));<NEW_LINE>decryptorNode.instructions.add(new VarInsnNode(ASTORE, 1));<NEW_LINE>decryptorNode.instructions.add(new LdcInsnNode(4096));<NEW_LINE>decryptorNode.instructions.add(new IntInsnNode(NEWARRAY, Opcodes.T_BYTE));<NEW_LINE>decryptorNode.instructions.add(new VarInsnNode(ASTORE, 2));<NEW_LINE>decryptorNode.instructions.add(start);<NEW_LINE>decryptorNode.instructions.add(new VarInsnNode(ALOAD, 0));<NEW_LINE>decryptorNode.instructions.add(new VarInsnNode(ALOAD, 2));<NEW_LINE>decryptorNode.instructions.add(new MethodInsnNode(INVOKEVIRTUAL, "java/io/InputStream", "read", "([B)I", false));<NEW_LINE>decryptorNode.instructions.add(new VarInsnNode(ISTORE, 3));<NEW_LINE>decryptorNode.instructions.add(new VarInsnNode(ILOAD, 3));<NEW_LINE>decryptorNode.instructions.add(new InsnNode(ICONST_M1));<NEW_LINE>decryptorNode.instructions.add(<MASK><NEW_LINE>decryptorNode.instructions.add(new VarInsnNode(ALOAD, 1));<NEW_LINE>decryptorNode.instructions.add(new VarInsnNode(ALOAD, 2));<NEW_LINE>decryptorNode.instructions.add(new InsnNode(ICONST_0));<NEW_LINE>decryptorNode.instructions.add(new VarInsnNode(ILOAD, 3));<NEW_LINE>decryptorNode.instructions.add(new MethodInsnNode(INVOKEVIRTUAL, "java/io/OutputStream", "write", "([BII)V", false));<NEW_LINE>decryptorNode.instructions.add(new JumpInsnNode(GOTO, start));<NEW_LINE>decryptorNode.instructions.add(end);<NEW_LINE>decryptorNode.instructions.add(new VarInsnNode(ALOAD, 1));<NEW_LINE>decryptorNode.instructions.add(new MethodInsnNode(INVOKEVIRTUAL, "java/io/ByteArrayInputStream", "toByteArray", "()[B", false));<NEW_LINE>decryptorNode.instructions.add(new InsnNode(ARETURN));<NEW_LINE>decryptorClass.methods.add(decryptorNode);<NEW_LINE>return decryptorNode;<NEW_LINE>}
new JumpInsnNode(IF_ICMPEQ, end));
1,173,307
public MLFeature apply(@Nonnull final EntityResponse entityResponse) {<NEW_LINE>final MLFeature result = new MLFeature();<NEW_LINE>result.setUrn(entityResponse.getUrn().toString());<NEW_LINE>result.setType(EntityType.MLFEATURE);<NEW_LINE>EnvelopedAspectMap aspectMap = entityResponse.getAspects();<NEW_LINE>MappingHelper<MLFeature> mappingHelper = new MappingHelper<>(aspectMap, result);<NEW_LINE>mappingHelper.mapToResult(ML_FEATURE_KEY_ASPECT_NAME, this::mapMLFeatureKey);<NEW_LINE>mappingHelper.mapToResult(OWNERSHIP_ASPECT_NAME, (mlFeature, dataMap) -> mlFeature.setOwnership(OwnershipMapper.map(new Ownership(dataMap))));<NEW_LINE>mappingHelper.mapToResult(ML_FEATURE_PROPERTIES_ASPECT_NAME, this::mapMLFeatureProperties);<NEW_LINE>mappingHelper.mapToResult(INSTITUTIONAL_MEMORY_ASPECT_NAME, (mlFeature, dataMap) -> mlFeature.setInstitutionalMemory(InstitutionalMemoryMapper.map(new InstitutionalMemory(dataMap))));<NEW_LINE>mappingHelper.mapToResult(STATUS_ASPECT_NAME, (mlFeature, dataMap) -> mlFeature.setStatus(StatusMapper.map(new Status(dataMap))));<NEW_LINE>mappingHelper.mapToResult(DEPRECATION_ASPECT_NAME, (mlFeature, dataMap) -> mlFeature.setDeprecation(DeprecationMapper.map(<MASK><NEW_LINE>return mappingHelper.getResult();<NEW_LINE>}
new Deprecation(dataMap))));
1,473,589
protected void performContextAction(final Node[] nodes) {<NEW_LINE>if (!Subversion.getInstance().checkClientAvailable()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final Context ctx = getContext(nodes);<NEW_LINE>File[<MASK><NEW_LINE>// filter managed roots<NEW_LINE>List<File> l = new ArrayList<>();<NEW_LINE>for (File file : roots) {<NEW_LINE>if (SvnUtils.isManaged(file)) {<NEW_LINE>l.add(file);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>roots = l.toArray(new File[l.size()]);<NEW_LINE>if (roots == null || roots.length == 0)<NEW_LINE>return;<NEW_LINE>File interestingFile;<NEW_LINE>if (roots.length == 1) {<NEW_LINE>interestingFile = roots[0];<NEW_LINE>} else {<NEW_LINE>interestingFile = SvnUtils.getPrimaryFile(roots[0]);<NEW_LINE>}<NEW_LINE>final SVNUrl rootUrl;<NEW_LINE>final SVNUrl url;<NEW_LINE>try {<NEW_LINE>rootUrl = SvnUtils.getRepositoryRootUrl(interestingFile);<NEW_LINE>url = SvnUtils.getRepositoryUrl(interestingFile);<NEW_LINE>} catch (SVNClientException ex) {<NEW_LINE>SvnClientExceptionHandler.notifyException(ex, true, true);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final RepositoryFile repositoryFile = new RepositoryFile(rootUrl, url, SVNRevision.HEAD);<NEW_LINE>final RevertModifications revertModifications = new RevertModifications(repositoryFile);<NEW_LINE>if (!revertModifications.showDialog()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ContextAction.ProgressSupport support = new ContextAction.ProgressSupport(this, nodes, ctx) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void perform() {<NEW_LINE>performRevert(revertModifications.getRevisionInterval(), revertModifications.revertNewFiles(), !revertModifications.revertRecursively(), ctx, this);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>support.start(createRequestProcessor(ctx));<NEW_LINE>}
] roots = ctx.getRootFiles();
1,610,405
public void addRecord(IndexSegment segment, RecordInfo recordInfo) {<NEW_LINE>ThreadSafeMutableRoaringBitmap validDocIds = Objects.requireNonNull(segment.getValidDocIds());<NEW_LINE>_primaryKeyToRecordLocationMap.compute(hashPrimaryKey(recordInfo._primaryKey, _hashFunction), (primaryKey, currentRecordLocation) -> {<NEW_LINE>if (currentRecordLocation != null) {<NEW_LINE>// Existing primary key<NEW_LINE>// Update the record location when the new comparison value is greater than or equal to the current value.<NEW_LINE>// Update the record location when there is a tie to keep the newer record.<NEW_LINE>if (recordInfo._comparisonValue.compareTo(currentRecordLocation.getComparisonValue()) >= 0) {<NEW_LINE>IndexSegment currentSegment = currentRecordLocation.getSegment();<NEW_LINE>int currentDocId = currentRecordLocation.getDocId();<NEW_LINE>if (segment == currentSegment) {<NEW_LINE>validDocIds.replace(currentDocId, recordInfo._docId);<NEW_LINE>} else {<NEW_LINE>Objects.requireNonNull(currentSegment.getValidDocIds()).remove(currentDocId);<NEW_LINE>validDocIds.add(recordInfo._docId);<NEW_LINE>}<NEW_LINE>return new RecordLocation(segment, <MASK><NEW_LINE>} else {<NEW_LINE>return currentRecordLocation;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// New primary key<NEW_LINE>validDocIds.add(recordInfo._docId);<NEW_LINE>return new RecordLocation(segment, recordInfo._docId, recordInfo._comparisonValue);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// Update metrics<NEW_LINE>_serverMetrics.setValueOfPartitionGauge(_tableNameWithType, _partitionId, ServerGauge.UPSERT_PRIMARY_KEYS_COUNT, _primaryKeyToRecordLocationMap.size());<NEW_LINE>}
recordInfo._docId, recordInfo._comparisonValue);
626,614
RedisProperties redisProperties(AzureRedisProperties azureRedisProperties, AzureResourceManager azureResourceManager) {<NEW_LINE>String cacheName = azureRedisProperties.getName();<NEW_LINE>String resourceGroup = azureRedisProperties<MASK><NEW_LINE>RedisCache redisCache = azureResourceManager.redisCaches().getByResourceGroup(resourceGroup, cacheName);<NEW_LINE>RedisProperties redisProperties = new RedisProperties();<NEW_LINE>boolean useSsl = !redisCache.nonSslPort();<NEW_LINE>int port = useSsl ? redisCache.sslPort() : redisCache.port();<NEW_LINE>boolean isCluster = redisCache.shardCount() > 0;<NEW_LINE>if (isCluster) {<NEW_LINE>RedisProperties.Cluster cluster = new RedisProperties.Cluster();<NEW_LINE>cluster.setNodes(Arrays.asList(redisCache.hostname() + ":" + port));<NEW_LINE>redisProperties.setCluster(cluster);<NEW_LINE>} else {<NEW_LINE>redisProperties.setHost(redisCache.hostname());<NEW_LINE>redisProperties.setPort(port);<NEW_LINE>}<NEW_LINE>redisProperties.setPassword(redisCache.keys().primaryKey());<NEW_LINE>redisProperties.setSsl(useSsl);<NEW_LINE>return redisProperties;<NEW_LINE>}
.getResource().getResourceGroup();
1,202,666
private BType checkErrCtrTargetTypeAndSetSymbol(BLangNamedArgsExpression namedArgsExpression, BType expectedType) {<NEW_LINE>BType type = Types.getReferredType(expectedType);<NEW_LINE>if (type == symTable.semanticError) {<NEW_LINE>return symTable.semanticError;<NEW_LINE>}<NEW_LINE>if (type.tag == TypeTags.MAP) {<NEW_LINE>return ((BMapType) type).constraint;<NEW_LINE>}<NEW_LINE>if (type.tag != TypeTags.RECORD) {<NEW_LINE>return symTable.semanticError;<NEW_LINE>}<NEW_LINE>BRecordType recordType = (BRecordType) type;<NEW_LINE>BField targetField = recordType.fields.<MASK><NEW_LINE>if (targetField != null) {<NEW_LINE>// Set the symbol of the namedArgsExpression, with the matching record field symbol.<NEW_LINE>namedArgsExpression.varSymbol = targetField.symbol;<NEW_LINE>return targetField.type;<NEW_LINE>}<NEW_LINE>if (!recordType.sealed && !recordType.fields.isEmpty()) {<NEW_LINE>dlog.error(namedArgsExpression.pos, DiagnosticErrorCode.INVALID_REST_DETAIL_ARG, namedArgsExpression.name, recordType);<NEW_LINE>}<NEW_LINE>return recordType.sealed ? symTable.noType : recordType.restFieldType;<NEW_LINE>}
get(namedArgsExpression.name.value);
1,692,154
private void updateLabels() {<NEW_LINE>String src = getFirstNotNullTrimmed(sourceText.getText(), "");<NEW_LINE>boolean validSource = isFileAccesible(src);<NEW_LINE>IPath path = Path.fromOSString(src);<NEW_LINE>String filename = (src.isEmpty() || path.isEmpty()) ? "Invalid" : path.segment(path.segmentCount() - 1);<NEW_LINE>String extension = (src.isEmpty() || path.isEmpty()) ? null : path.getFileExtension();<NEW_LINE>String noext = (extension == null) ? filename : filename.substring(0, filename.indexOf(extension) - 1);<NEW_LINE>String basename = (validSource) ? generator.getModelName() : noext;<NEW_LINE>idlLabel.setEnabled(validSource);<NEW_LINE>hLabel.setEnabled(validSource);<NEW_LINE>cppLabel.setEnabled(validSource);<NEW_LINE>trhLabel.setEnabled(validSource);<NEW_LINE>trcLabel.setEnabled(validSource);<NEW_LINE>mpcLabel.setEnabled(validSource);<NEW_LINE>mpbLabel.setEnabled(validSource);<NEW_LINE>pathMpbLabel.setEnabled(validSource);<NEW_LINE>idlBtn.setEnabled(validSource);<NEW_LINE>hBtn.setEnabled(validSource);<NEW_LINE>cppBtn.setEnabled(validSource);<NEW_LINE>trhBtn.setEnabled(validSource);<NEW_LINE>trcBtn.setEnabled(validSource);<NEW_LINE>mpcBtn.setEnabled(validSource);<NEW_LINE>mpbBtn.setEnabled(validSource);<NEW_LINE>pathMpbBtn.setEnabled(validSource);<NEW_LINE>idlLabel.setText(basename + SdkTransformer.TransformType.IDL.getSuffix());<NEW_LINE>idlLabel.setSize(idlLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, true));<NEW_LINE>hLabel.setText(basename + SdkTransformer.TransformType.H.getSuffix());<NEW_LINE>hLabel.setSize(hLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, true));<NEW_LINE>cppLabel.setText(basename + SdkTransformer.<MASK><NEW_LINE>cppLabel.setSize(cppLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, true));<NEW_LINE>trhLabel.setText(basename + SdkTransformer.TransformType.TRH.getSuffix());<NEW_LINE>trhLabel.setSize(trhLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, true));<NEW_LINE>trcLabel.setText(basename + SdkTransformer.TransformType.TRC.getSuffix());<NEW_LINE>trcLabel.setSize(trcLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, true));<NEW_LINE>mpcLabel.setText(basename + SdkTransformer.TransformType.MPC.getSuffix());<NEW_LINE>mpcLabel.setSize(mpcLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, true));<NEW_LINE>mpbLabel.setText(basename + SdkTransformer.TransformType.MPB.getSuffix());<NEW_LINE>mpbLabel.setSize(mpbLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, true));<NEW_LINE>pathMpbLabel.setText(basename + SdkTransformer.TransformType.PATH_MPB.getSuffix());<NEW_LINE>pathMpbLabel.setSize(pathMpbLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, true));<NEW_LINE>String tgt = getFirstNotNullTrimmed(targetDir.getText(), "");<NEW_LINE>boolean validTarget = isFolderUsable(tgt);<NEW_LINE>genAllBtn.setEnabled(validSource && validTarget);<NEW_LINE>IStatusLineManager statusLineManager = editor.getActionBars().getStatusLineManager();<NEW_LINE>statusLineManager.setErrorMessage(validSource & validTarget ? null : "Unable to generate into " + targetDir.getText());<NEW_LINE>}
TransformType.CPP.getSuffix());
1,243,994
static private boolean anyAlpha(int[] pixels) {<NEW_LINE>// The upper-left corner is a good bet to test first, but not sufficient.<NEW_LINE>if ((pixels[0] & 0xFF000000) != 0xFF000000) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>// Otherwise, take a random sample for our best guess. This is much<NEW_LINE>// faster (and hopefully reliable enough) to avoid exhaustively rewriting<NEW_LINE>// all pixel alpha values, which would be dreadful for performance.<NEW_LINE>int count = (int) <MASK><NEW_LINE>for (int i = 0; i < count; i++) {<NEW_LINE>// select a random pixel<NEW_LINE>int index = (int) (Math.random() * pixels.length);<NEW_LINE>// if it has alpha, return true<NEW_LINE>if ((pixels[index] & 0xFF000000) != 0xFF000000) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
Math.sqrt(pixels.length);
123,044
private SchemaElementPrinter<GraphQLInterfaceType> interfacePrinter() {<NEW_LINE>return (out, type, visibility) -> {<NEW_LINE>if (isIntrospectionType(type)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (shouldPrintAsAst(type.getDefinition())) {<NEW_LINE>printAsAst(out, type.getDefinition(), type.getExtensionDefinitions());<NEW_LINE>} else {<NEW_LINE>printComments(out, type, "");<NEW_LINE>if (type.getInterfaces().isEmpty()) {<NEW_LINE>out.format("interface %s%s", type.getName(), directivesString(GraphQLInterfaceType.class, type));<NEW_LINE>} else {<NEW_LINE>Comparator<? super GraphQLSchemaElement> implementsComparator = getComparator(GraphQLInterfaceType.class, GraphQLOutputType.class);<NEW_LINE>Stream<String> interfaceNames = type.getInterfaces().stream().sorted(implementsComparator).map(GraphQLNamedType::getName);<NEW_LINE>out.format("interface %s implements %s%s", type.getName(), interfaceNames.collect(joining(" & ")), directivesString(GraphQLInterfaceType.class, type));<NEW_LINE>}<NEW_LINE>Comparator<? super GraphQLSchemaElement> comparator = getComparator(<MASK><NEW_LINE>printFieldDefinitions(out, comparator, visibility.getFieldDefinitions(type));<NEW_LINE>out.format("\n\n");<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
GraphQLInterfaceType.class, GraphQLFieldDefinition.class);
302,489
private static void changeStorageTypeObject2(OSS ossClient) throws InterruptedException, IOException {<NEW_LINE>// This example requires a bucket containing an object of the Archive storage class.<NEW_LINE>String objectName = "*** Provide object name ***";<NEW_LINE>// Obtain the object metadata.<NEW_LINE>ObjectMetadata objectMetadata = ossClient.getObjectMetadata(bucketName, objectName);<NEW_LINE>// Check whether the storage class of the source object is Archive. If the storage class of the source object is Archive, you must restore the object before you can modify the storage class.<NEW_LINE>StorageClass storageClass = objectMetadata.getObjectStorageClass();<NEW_LINE>System.<MASK><NEW_LINE>if (storageClass == StorageClass.Archive) {<NEW_LINE>// Restore the object.<NEW_LINE>ossClient.restoreObject(bucketName, objectName);<NEW_LINE>// Wait until the object is restored.<NEW_LINE>do {<NEW_LINE>Thread.sleep(1000);<NEW_LINE>objectMetadata = ossClient.getObjectMetadata(bucketName, objectName);<NEW_LINE>} while (!objectMetadata.isRestoreCompleted());<NEW_LINE>}<NEW_LINE>// Create CopyObjectRequest.<NEW_LINE>CopyObjectRequest request = new CopyObjectRequest(bucketName, objectName, bucketName, objectName);<NEW_LINE>// Create ObjectMetadata.<NEW_LINE>objectMetadata = new ObjectMetadata();<NEW_LINE>// Encapsulate the header. Set the storage class to IA.<NEW_LINE>objectMetadata.setHeader("x-oss-storage-class", StorageClass.IA);<NEW_LINE>request.setNewObjectMetadata(objectMetadata);<NEW_LINE>// Modify the storage class of the object.<NEW_LINE>CopyObjectResult result = ossClient.copyObject(request);<NEW_LINE>}
out.println("storage type:" + storageClass);
1,522,807
private void crossover(final MSeq<G> that, final MSeq<G> other, final int i) {<NEW_LINE>final <MASK><NEW_LINE>final double u = random.nextDouble();<NEW_LINE>final double beta;<NEW_LINE>if (u < 0.5) {<NEW_LINE>// If u is smaller than 0.5 perform a contracting crossover.<NEW_LINE>beta = pow(2 * u, 1.0 / (_contiguity + 1));<NEW_LINE>} else if (u > 0.5) {<NEW_LINE>// Otherwise, perform an expanding crossover.<NEW_LINE>beta = pow(0.5 / (1.0 - u), 1.0 / (_contiguity + 1));<NEW_LINE>} else {<NEW_LINE>beta = 1;<NEW_LINE>}<NEW_LINE>final double v1 = that.get(i).doubleValue();<NEW_LINE>final double v2 = other.get(i).doubleValue();<NEW_LINE>final double v = random.nextBoolean() ? ((v1 - v2) * 0.5) - beta * 0.5 * abs(v1 - v2) : ((v1 - v2) * 0.5) + beta * 0.5 * abs(v1 - v2);<NEW_LINE>final double min = that.get(i).min().doubleValue();<NEW_LINE>final double max = that.get(i).max().doubleValue();<NEW_LINE>that.set(i, that.get(i).newInstance(clamp(v, min, max)));<NEW_LINE>}
var random = RandomRegistry.random();
229,353
public static void updateGridOrListIcon(ImageView gridList, int libraryMode) {<NEW_LINE>if (gridList == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int stringId = R.string.list;<NEW_LINE>if (libraryMode == AppState.MODE_LIST) {<NEW_LINE>gridList.<MASK><NEW_LINE>stringId = R.string.list;<NEW_LINE>} else if (libraryMode == AppState.MODE_LIST_COMPACT) {<NEW_LINE>gridList.setImageResource(R.drawable.glyphicons_114_justify_compact);<NEW_LINE>stringId = R.string.compact;<NEW_LINE>} else if (libraryMode == AppState.MODE_GRID) {<NEW_LINE>gridList.setImageResource(R.drawable.glyphicons_156_show_big_thumbnails);<NEW_LINE>stringId = R.string.grid;<NEW_LINE>} else if (libraryMode == AppState.MODE_COVERS) {<NEW_LINE>gridList.setImageResource(R.drawable.glyphicons_157_show_thumbnails);<NEW_LINE>stringId = R.string.cover;<NEW_LINE>} else if (libraryMode == AppState.MODE_AUTHORS) {<NEW_LINE>gridList.setImageResource(R.drawable.glyphicons_4_user);<NEW_LINE>stringId = R.string.author;<NEW_LINE>} else if (libraryMode == AppState.MODE_SERIES) {<NEW_LINE>gridList.setImageResource(R.drawable.glyphicons_710_list_numbered);<NEW_LINE>stringId = R.string.serie;<NEW_LINE>} else if (libraryMode == AppState.MODE_GENRE) {<NEW_LINE>gridList.setImageResource(R.drawable.glyphicons_66_tag);<NEW_LINE>stringId = R.string.keywords;<NEW_LINE>} else if (libraryMode == AppState.MODE_USER_TAGS) {<NEW_LINE>gridList.setImageResource(R.drawable.glyphicons_67_tags);<NEW_LINE>stringId = R.string.my_tags;<NEW_LINE>} else if (libraryMode == AppState.MODE_KEYWORDS) {<NEW_LINE>gridList.setImageResource(R.drawable.glyphicons_67_keywords);<NEW_LINE>stringId = R.string.keywords;<NEW_LINE>} else if (libraryMode == AppState.MODE_PUBLISHER) {<NEW_LINE>gridList.setImageResource(R.drawable.glyphicons_4_thumbs_up);<NEW_LINE>stringId = R.string.publisher;<NEW_LINE>} else if (libraryMode == AppState.MODE_PUBLICATION_DATE) {<NEW_LINE>gridList.setImageResource(R.drawable.glyphicons_2_book_open);<NEW_LINE>stringId = R.string.publication_date;<NEW_LINE>}<NEW_LINE>gridList.setContentDescription(gridList.getContext().getString(R.string.cd_view_menu) + " " + gridList.getContext().getString(stringId));<NEW_LINE>}
setImageResource(R.drawable.glyphicons_114_justify);
987,504
final CreateSqlInjectionMatchSetResult executeCreateSqlInjectionMatchSet(CreateSqlInjectionMatchSetRequest createSqlInjectionMatchSetRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createSqlInjectionMatchSetRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateSqlInjectionMatchSetRequest> request = null;<NEW_LINE>Response<CreateSqlInjectionMatchSetResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new CreateSqlInjectionMatchSetRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createSqlInjectionMatchSetRequest));<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, "WAF Regional");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateSqlInjectionMatchSet");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateSqlInjectionMatchSetResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateSqlInjectionMatchSetResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
1,530,879
public void run(ITextSelection selection) {<NEW_LINE>if (!(getSite() instanceof IEditorSite)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>IWorkbenchPart part = ((IEditorSite) getSite()).getPart();<NEW_LINE>if (!(part instanceof GroovyEditor)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>GroovyEditor groovyEditor = (GroovyEditor) part;<NEW_LINE>GroovyCompilationUnit unit = groovyEditor.getGroovyCompilationUnit();<NEW_LINE>IDocument doc = groovyEditor.getDocumentProvider().getDocument(groovyEditor.getEditorInput());<NEW_LINE>if (doc != null && unit != null) {<NEW_LINE>boolean isIndentOnly = (kind == FormatKind.INDENT_ONLY);<NEW_LINE><MASK><NEW_LINE>DefaultGroovyFormatter formatter = new DefaultGroovyFormatter(selection, doc, preferences, isIndentOnly);<NEW_LINE>TextEdit edit = formatter.format();<NEW_LINE>try {<NEW_LINE>unit.applyTextEdit(edit, new NullProgressMonitor());<NEW_LINE>} catch (MalformedTreeException e) {<NEW_LINE>GroovyCore.logException("Exception when formatting", e);<NEW_LINE>} catch (JavaModelException e) {<NEW_LINE>GroovyCore.logException("Exception when formatting", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
FormatterPreferences preferences = new FormatterPreferences(unit);
959,168
public static QueryLoginEventResponse unmarshall(QueryLoginEventResponse queryLoginEventResponse, UnmarshallerContext context) {<NEW_LINE>queryLoginEventResponse.setRequestId(context.stringValue("QueryLoginEventResponse.requestId"));<NEW_LINE>queryLoginEventResponse.setCode(context.stringValue("QueryLoginEventResponse.Code"));<NEW_LINE>queryLoginEventResponse.setSuccess(context.booleanValue("QueryLoginEventResponse.Success"));<NEW_LINE>queryLoginEventResponse.setMessage(context.stringValue("QueryLoginEventResponse.Message"));<NEW_LINE>Data data = new Data();<NEW_LINE>PageInfo pageInfo = new PageInfo();<NEW_LINE>pageInfo.setCurrentPage(context.integerValue("QueryLoginEventResponse.Data.PageInfo.CurrentPage"));<NEW_LINE>pageInfo.setPageSize(context.integerValue("QueryLoginEventResponse.Data.PageInfo.PageSize"));<NEW_LINE>pageInfo.setTotalCount(context.integerValue("QueryLoginEventResponse.Data.PageInfo.TotalCount"));<NEW_LINE>pageInfo.setCount(context.integerValue("QueryLoginEventResponse.Data.PageInfo.Count"));<NEW_LINE>data.setPageInfo(pageInfo);<NEW_LINE>List<Entity> list = new ArrayList<Entity>();<NEW_LINE>for (int i = 0; i < context.lengthValue("QueryLoginEventResponse.Data.List.Length"); i++) {<NEW_LINE>Entity entity = new Entity();<NEW_LINE>entity.setUuid(context.stringValue("QueryLoginEventResponse.Data.List[" + i + "].Uuid"));<NEW_LINE>entity.setLoginTime(context.stringValue("QueryLoginEventResponse.Data.List[" + i + "].LoginTime"));<NEW_LINE>entity.setLoginType(context.integerValue("QueryLoginEventResponse.Data.List[" + i + "].LoginType"));<NEW_LINE>entity.setLoginTypeName(context.stringValue("QueryLoginEventResponse.Data.List[" + i + "].LoginTypeName"));<NEW_LINE>entity.setBuyVersion(context.stringValue("QueryLoginEventResponse.Data.List[" + i + "].BuyVersion"));<NEW_LINE>entity.setLoginSourceIp(context.stringValue("QueryLoginEventResponse.Data.List[" + i + "].LoginSourceIp"));<NEW_LINE>entity.setGroupId(context.integerValue("QueryLoginEventResponse.Data.List[" + i + "].GroupId"));<NEW_LINE>entity.setInstanceName(context.stringValue("QueryLoginEventResponse.Data.List[" + i + "].InstanceName"));<NEW_LINE>entity.setInstanceId(context.stringValue("QueryLoginEventResponse.Data.List[" + i + "].InstanceId"));<NEW_LINE>entity.setIp(context.stringValue("QueryLoginEventResponse.Data.List[" + i + "].Ip"));<NEW_LINE>entity.setRegion(context.stringValue("QueryLoginEventResponse.Data.List[" + i + "].Region"));<NEW_LINE>entity.setStatus(context.integerValue<MASK><NEW_LINE>entity.setStatusName(context.stringValue("QueryLoginEventResponse.Data.List[" + i + "].StatusName"));<NEW_LINE>entity.setLocation(context.stringValue("QueryLoginEventResponse.Data.List[" + i + "].Location"));<NEW_LINE>entity.setUserName(context.stringValue("QueryLoginEventResponse.Data.List[" + i + "].UserName"));<NEW_LINE>list.add(entity);<NEW_LINE>}<NEW_LINE>data.setList(list);<NEW_LINE>queryLoginEventResponse.setData(data);<NEW_LINE>return queryLoginEventResponse;<NEW_LINE>}
("QueryLoginEventResponse.Data.List[" + i + "].Status"));
900,835
public co.elastic.clients.elasticsearch.indices.PutTemplateRequest indicesPutTemplateRequest(PutTemplateRequest putTemplateRequest) {<NEW_LINE>Assert.notNull(putTemplateRequest, "putTemplateRequest must not be null");<NEW_LINE>co.elastic.clients.elasticsearch.indices.PutTemplateRequest.Builder builder = new co.elastic.clients.elasticsearch.indices.PutTemplateRequest.Builder();<NEW_LINE>builder.name(putTemplateRequest.getName()).indexPatterns(Arrays.asList(putTemplateRequest.getIndexPatterns())).order(putTemplateRequest.getOrder());<NEW_LINE>if (putTemplateRequest.getSettings() != null) {<NEW_LINE>Function<Map.Entry<String, Object>, String> keyMapper = Map.Entry::getKey;<NEW_LINE>Function<Map.Entry<String, Object>, JsonData> valueMapper = entry -> JsonData.of(entry.getValue(), jsonpMapper);<NEW_LINE>Map<String, JsonData> settings = putTemplateRequest.getSettings().entrySet().stream().collect(Collectors.toMap(keyMapper, valueMapper));<NEW_LINE>builder.settings(settings);<NEW_LINE>}<NEW_LINE>if (putTemplateRequest.getMappings() != null) {<NEW_LINE>builder.mappings(fromJson(putTemplateRequest.getMappings().toJson(), TypeMapping._DESERIALIZER));<NEW_LINE>}<NEW_LINE>if (putTemplateRequest.getVersion() != null) {<NEW_LINE>builder.version(Long.valueOf(putTemplateRequest.getVersion()));<NEW_LINE>}<NEW_LINE>AliasActions aliasActions = putTemplateRequest.getAliasActions();<NEW_LINE>if (aliasActions != null) {<NEW_LINE>aliasActions.getActions().forEach(aliasAction -> {<NEW_LINE>AliasActionParameters parameters = aliasAction.getParameters();<NEW_LINE>String[] parametersAliases = parameters.getAliases();<NEW_LINE>if (parametersAliases != null) {<NEW_LINE>for (String aliasName : parametersAliases) {<NEW_LINE>builder.aliases(aliasName, aliasBuilder -> {<NEW_LINE>// noinspection DuplicatedCode<NEW_LINE>if (parameters.getRouting() != null) {<NEW_LINE>aliasBuilder.routing(parameters.getRouting());<NEW_LINE>}<NEW_LINE>if (parameters.getIndexRouting() != null) {<NEW_LINE>aliasBuilder.indexRouting(parameters.getIndexRouting());<NEW_LINE>}<NEW_LINE>if (parameters.getSearchRouting() != null) {<NEW_LINE>aliasBuilder.<MASK><NEW_LINE>}<NEW_LINE>if (parameters.getHidden() != null) {<NEW_LINE>aliasBuilder.isHidden(parameters.getHidden());<NEW_LINE>}<NEW_LINE>if (parameters.getWriteIndex() != null) {<NEW_LINE>aliasBuilder.isWriteIndex(parameters.getWriteIndex());<NEW_LINE>}<NEW_LINE>Query filterQuery = parameters.getFilterQuery();<NEW_LINE>if (filterQuery != null) {<NEW_LINE>co.elastic.clients.elasticsearch._types.query_dsl.Query esQuery = getFilter(filterQuery);<NEW_LINE>if (esQuery != null) {<NEW_LINE>aliasBuilder.filter(esQuery);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return aliasBuilder;<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>return builder.build();<NEW_LINE>}
searchRouting(parameters.getSearchRouting());
597,685
private static TreePath visitModel(@Nonnull TreeModel model, @Nonnull TreeVisitor visitor) {<NEW_LINE><MASK><NEW_LINE>if (root == null)<NEW_LINE>return null;<NEW_LINE>TreePath path = new TreePath(root);<NEW_LINE>switch(visitor.visit(path)) {<NEW_LINE>case INTERRUPT:<NEW_LINE>// root path is found<NEW_LINE>return path;<NEW_LINE>case CONTINUE:<NEW_LINE>// visit children<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>// skip children<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Deque<Deque<TreePath>> stack = new ArrayDeque<>();<NEW_LINE>stack.push(children(model, path));<NEW_LINE>while (path != null) {<NEW_LINE>Deque<TreePath> siblings = stack.peek();<NEW_LINE>// nothing to process<NEW_LINE>if (siblings == null)<NEW_LINE>return null;<NEW_LINE>TreePath next = siblings.poll();<NEW_LINE>if (next == null) {<NEW_LINE>LOG.assertTrue(siblings == stack.poll());<NEW_LINE>path = path.getParentPath();<NEW_LINE>} else {<NEW_LINE>switch(visitor.visit(next)) {<NEW_LINE>case INTERRUPT:<NEW_LINE>// path is found<NEW_LINE>return next;<NEW_LINE>case CONTINUE:<NEW_LINE>path = next;<NEW_LINE>stack.push(children(model, path));<NEW_LINE>break;<NEW_LINE>case SKIP_SIBLINGS:<NEW_LINE>siblings.clear();<NEW_LINE>break;<NEW_LINE>case SKIP_CHILDREN:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>LOG.assertTrue(stack.isEmpty());<NEW_LINE>return null;<NEW_LINE>}
Object root = model.getRoot();
689,938
private JPanel buttonTab(final RailButton rbc) {<NEW_LINE>JPanel primary = new JPanel(new MigLayout("fill"));<NEW_LINE>JPanel panel = new JPanel(new MigLayout());<NEW_LINE>{<NEW_LINE>// // Outer Diameter<NEW_LINE>panel.add(new JLabel(trans.get("RailBtnCfg.lbl.OuterDiam")));<NEW_LINE>DoubleModel ODModel = new DoubleModel(component, "OuterDiameter", UnitGroup.UNITS_LENGTH, 0);<NEW_LINE>JSpinner ODSpinner = new JSpinner(ODModel.getSpinnerModel());<NEW_LINE>ODSpinner.setEditor(new SpinnerEditor(ODSpinner));<NEW_LINE>panel.add(ODSpinner, "growx");<NEW_LINE>panel.add(new UnitSelector(ODModel), "growx");<NEW_LINE>panel.add(new BasicSlider(ODModel.getSliderModel(0, 0.001, 0.02)), "w 100lp, wrap");<NEW_LINE>}<NEW_LINE>{<NEW_LINE>// // Height<NEW_LINE>panel.add(new JLabel(trans.get("RailBtnCfg.lbl.TotalHeight")));<NEW_LINE>DoubleModel heightModel = new DoubleModel(component, "TotalHeight", UnitGroup.UNITS_LENGTH, 0);<NEW_LINE>JSpinner heightSpinner = new JSpinner(heightModel.getSpinnerModel());<NEW_LINE>heightSpinner.setEditor(new SpinnerEditor(heightSpinner));<NEW_LINE><MASK><NEW_LINE>panel.add(new UnitSelector(heightModel), "growx");<NEW_LINE>panel.add(new BasicSlider(heightModel.getSliderModel(0, 0.001, 0.02)), "w 100lp, wrap");<NEW_LINE>}<NEW_LINE>{<NEW_LINE>// // Angular Position:<NEW_LINE>panel.add(new JLabel(trans.get("RailBtnCfg.lbl.Angle")));<NEW_LINE>DoubleModel angleModel = new DoubleModel(component, "AngleOffset", UnitGroup.UNITS_ANGLE, -180, +180);<NEW_LINE>JSpinner angleSpinner = new JSpinner(angleModel.getSpinnerModel());<NEW_LINE>angleSpinner.setEditor(new SpinnerEditor(angleSpinner));<NEW_LINE>panel.add(angleSpinner, "growx");<NEW_LINE>panel.add(new UnitSelector(angleModel), "growx");<NEW_LINE>panel.add(new BasicSlider(angleModel.getSliderModel(-Math.PI, Math.PI)), "w 100lp, wrap");<NEW_LINE>}<NEW_LINE>{<NEW_LINE>// // Position relative to:<NEW_LINE>panel.add(new JLabel(trans.get("RailBtnCfg.lbl.PosRelativeTo")));<NEW_LINE>final EnumModel<AxialMethod> methodModel = new EnumModel<AxialMethod>(component, "AxialMethod", AxialMethod.axialOffsetMethods);<NEW_LINE>JComboBox<AxialMethod> relToCombo = new JComboBox<AxialMethod>(methodModel);<NEW_LINE>panel.add(relToCombo, "spanx, growx, wrap");<NEW_LINE>}<NEW_LINE>{<NEW_LINE>// // plus<NEW_LINE>panel.add(new JLabel(trans.get("RailBtnCfg.lbl.Plus")), "right");<NEW_LINE>DoubleModel offsetModel = new DoubleModel(component, "AxialOffset", UnitGroup.UNITS_LENGTH);<NEW_LINE>JSpinner offsetSpinner = new JSpinner(offsetModel.getSpinnerModel());<NEW_LINE>offsetSpinner.setEditor(new SpinnerEditor(offsetSpinner));<NEW_LINE>panel.add(offsetSpinner, "growx");<NEW_LINE>panel.add(new UnitSelector(offsetModel), "growx");<NEW_LINE>panel.add(new BasicSlider(offsetModel.getSliderModel(new DoubleModel(component.getParent(), "Length", -1.0, UnitGroup.UNITS_NONE), new DoubleModel(component.getParent(), "Length"))), "w 100lp, wrap para");<NEW_LINE>}<NEW_LINE>primary.add(panel, "grow, gapright 201p");<NEW_LINE>panel = new JPanel(new MigLayout("gap rel unrel", "[][65lp::][30lp::][]", ""));<NEW_LINE>// // Instance count<NEW_LINE>panel.add(instanceablePanel(rbc), "span, wrap");<NEW_LINE>// // Material<NEW_LINE>panel.add(materialPanel(Material.Type.BULK), "span, wrap");<NEW_LINE>primary.add(panel, "grow");<NEW_LINE>return primary;<NEW_LINE>}
panel.add(heightSpinner, "growx");
1,852,033
void delete(Iterator<Triple> it, List<Triple> list) {<NEW_LINE>String del_start = "sparql define output:format '_JAVA_' DELETE FROM <";<NEW_LINE><MASK><NEW_LINE>int count = 0;<NEW_LINE>StringBuilder data = new StringBuilder(256);<NEW_LINE>data.append(del_start);<NEW_LINE>data.append(this.graphName);<NEW_LINE>data.append("> { ");<NEW_LINE>try {<NEW_LINE>stmt = createStatement();<NEW_LINE>while (it.hasNext()) {<NEW_LINE>Triple t = (Triple) it.next();<NEW_LINE>if (list != null)<NEW_LINE>list.add(t);<NEW_LINE>StringBuilder row = new StringBuilder(256);<NEW_LINE>row.append(Node2Str(t.getSubject()));<NEW_LINE>row.append(' ');<NEW_LINE>row.append(Node2Str(t.getPredicate()));<NEW_LINE>row.append(' ');<NEW_LINE>row.append(Node2Str(t.getObject()));<NEW_LINE>row.append(" .\n");<NEW_LINE>if (count > 0 && data.length() + row.length() > MAX_CMD_SIZE) {<NEW_LINE>data.append(" }");<NEW_LINE>stmt.execute(data.toString());<NEW_LINE>data.setLength(0);<NEW_LINE>data.append(del_start);<NEW_LINE>data.append(this.graphName);<NEW_LINE>data.append("> { ");<NEW_LINE>count = 0;<NEW_LINE>}<NEW_LINE>data.append(row);<NEW_LINE>count++;<NEW_LINE>}<NEW_LINE>if (count > 0) {<NEW_LINE>data.append(" }");<NEW_LINE>stmt.execute(data.toString());<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new JenaException(e);<NEW_LINE>} finally {<NEW_LINE>try {<NEW_LINE>stmt.close();<NEW_LINE>} catch (Exception e) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
java.sql.Statement stmt = null;
1,776,185
private static void serializeKeyToByteBuffer(final ByteBuffer buffer, final OType type, final Object key) {<NEW_LINE>switch(type) {<NEW_LINE>case BINARY:<NEW_LINE>final byte[] array = (byte[]) key;<NEW_LINE>buffer.putInt(array.length);<NEW_LINE>buffer.put(array);<NEW_LINE>return;<NEW_LINE>case BOOLEAN:<NEW_LINE>buffer.put((Boolean) key ? (byte) 1 : 0);<NEW_LINE>return;<NEW_LINE>case BYTE:<NEW_LINE>buffer.put((Byte) key);<NEW_LINE>return;<NEW_LINE>case DATE:<NEW_LINE>case DATETIME:<NEW_LINE>buffer.putLong(((Date) key).getTime());<NEW_LINE>return;<NEW_LINE>case DECIMAL:<NEW_LINE>final BigDecimal decimal = (BigDecimal) key;<NEW_LINE>buffer.putInt(decimal.scale());<NEW_LINE>final byte[] unscaledValue = decimal.unscaledValue().toByteArray();<NEW_LINE>buffer.putInt(unscaledValue.length);<NEW_LINE>buffer.put(unscaledValue);<NEW_LINE>return;<NEW_LINE>case DOUBLE:<NEW_LINE>buffer.putLong(Double.doubleToLongBits((Double) key));<NEW_LINE>return;<NEW_LINE>case FLOAT:<NEW_LINE>buffer.putInt(Float.floatToIntBits((Float) key));<NEW_LINE>return;<NEW_LINE>case INTEGER:<NEW_LINE>buffer<MASK><NEW_LINE>return;<NEW_LINE>case LINK:<NEW_LINE>OCompactedLinkSerializer.INSTANCE.serializeInByteBufferObject((ORID) key, buffer);<NEW_LINE>return;<NEW_LINE>case LONG:<NEW_LINE>buffer.putLong((Long) key);<NEW_LINE>return;<NEW_LINE>case SHORT:<NEW_LINE>buffer.putShort((Short) key);<NEW_LINE>return;<NEW_LINE>case STRING:<NEW_LINE>OUTF8Serializer.INSTANCE.serializeInByteBufferObject((String) key, buffer);<NEW_LINE>return;<NEW_LINE>default:<NEW_LINE>throw new OIndexException("Unsupported index type " + type);<NEW_LINE>}<NEW_LINE>}
.putInt((Integer) key);
1,695,423
public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException {<NEW_LINE>CreateIndexRequest createIndexRequest = new CreateIndexRequest(request.param("index"));<NEW_LINE>boolean includeTypeName = <MASK><NEW_LINE>if (request.hasContent()) {<NEW_LINE>Map<String, Object> sourceAsMap = XContentHelper.convertToMap(request.content(), false, request.getXContentType()).v2();<NEW_LINE>if (request.hasParam(INCLUDE_TYPE_NAME_PARAMETER) == false && sourceAsMap.containsKey("mappings")) {<NEW_LINE>deprecationLogger.deprecatedAndMaybeLog("create_index_with_types", TYPES_DEPRECATION_MESSAGE);<NEW_LINE>}<NEW_LINE>sourceAsMap = prepareMappings(sourceAsMap, includeTypeName);<NEW_LINE>createIndexRequest.source(sourceAsMap, LoggingDeprecationHandler.INSTANCE);<NEW_LINE>}<NEW_LINE>if (request.hasParam("update_all_types")) {<NEW_LINE>deprecationLogger.deprecated("[update_all_types] is deprecated since indices may not have more than one type anymore");<NEW_LINE>}<NEW_LINE>createIndexRequest.updateAllTypes(request.paramAsBoolean("update_all_types", false));<NEW_LINE>createIndexRequest.timeout(request.paramAsTime("timeout", createIndexRequest.timeout()));<NEW_LINE>createIndexRequest.masterNodeTimeout(request.paramAsTime("master_timeout", createIndexRequest.masterNodeTimeout()));<NEW_LINE>createIndexRequest.waitForActiveShards(ActiveShardCount.parseString(request.param("wait_for_active_shards")));<NEW_LINE>return channel -> client.admin().indices().create(createIndexRequest, new RestToXContentListener<>(channel));<NEW_LINE>}
request.paramAsBoolean(INCLUDE_TYPE_NAME_PARAMETER, DEFAULT_INCLUDE_TYPE_NAME_POLICY);
1,196,752
public static DescribeFabricConsortiumsResponse unmarshall(DescribeFabricConsortiumsResponse describeFabricConsortiumsResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeFabricConsortiumsResponse.setRequestId(_ctx.stringValue("DescribeFabricConsortiumsResponse.RequestId"));<NEW_LINE>describeFabricConsortiumsResponse.setErrorCode(_ctx.integerValue("DescribeFabricConsortiumsResponse.ErrorCode"));<NEW_LINE>describeFabricConsortiumsResponse.setSuccess(_ctx.booleanValue("DescribeFabricConsortiumsResponse.Success"));<NEW_LINE>List<ResultItem> result = new ArrayList<ResultItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeFabricConsortiumsResponse.Result.Length"); i++) {<NEW_LINE>ResultItem resultItem = new ResultItem();<NEW_LINE>resultItem.setChannelCount(_ctx.integerValue("DescribeFabricConsortiumsResponse.Result[" + i + "].ChannelCount"));<NEW_LINE>resultItem.setDomain(_ctx.stringValue("DescribeFabricConsortiumsResponse.Result[" + i + "].Domain"));<NEW_LINE>resultItem.setState(_ctx.stringValue("DescribeFabricConsortiumsResponse.Result[" + i + "].State"));<NEW_LINE>resultItem.setCreateTime(_ctx.stringValue("DescribeFabricConsortiumsResponse.Result[" + i + "].CreateTime"));<NEW_LINE>resultItem.setSpecName(_ctx.stringValue("DescribeFabricConsortiumsResponse.Result[" + i + "].SpecName"));<NEW_LINE>resultItem.setSupportChannelConfig(_ctx.booleanValue("DescribeFabricConsortiumsResponse.Result[" + i + "].SupportChannelConfig"));<NEW_LINE>resultItem.setOwnerName(_ctx.stringValue("DescribeFabricConsortiumsResponse.Result[" + i + "].OwnerName"));<NEW_LINE>resultItem.setOwnerUid(_ctx.longValue("DescribeFabricConsortiumsResponse.Result[" + i + "].OwnerUid"));<NEW_LINE>resultItem.setOwnerBid(_ctx.stringValue("DescribeFabricConsortiumsResponse.Result[" + i + "].OwnerBid"));<NEW_LINE>resultItem.setCodeName(_ctx.stringValue("DescribeFabricConsortiumsResponse.Result[" + i + "].CodeName"));<NEW_LINE>resultItem.setRegionId(_ctx.stringValue("DescribeFabricConsortiumsResponse.Result[" + i + "].RegionId"));<NEW_LINE>resultItem.setChannelPolicy(_ctx.stringValue("DescribeFabricConsortiumsResponse.Result[" + i + "].ChannelPolicy"));<NEW_LINE>resultItem.setRequestId(_ctx.stringValue("DescribeFabricConsortiumsResponse.Result[" + i + "].RequestId"));<NEW_LINE>resultItem.setConsortiumId(_ctx.stringValue("DescribeFabricConsortiumsResponse.Result[" + i + "].ConsortiumId"));<NEW_LINE>resultItem.setExpiredTime(_ctx.stringValue("DescribeFabricConsortiumsResponse.Result[" + i + "].ExpiredTime"));<NEW_LINE>resultItem.setOrganizationCount(_ctx.integerValue("DescribeFabricConsortiumsResponse.Result[" + i + "].OrganizationCount"));<NEW_LINE>resultItem.setConsortiumName(_ctx.stringValue("DescribeFabricConsortiumsResponse.Result[" + i + "].ConsortiumName"));<NEW_LINE>List<TagsItem> tags = new ArrayList<TagsItem>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeFabricConsortiumsResponse.Result[" + i + "].Tags.Length"); j++) {<NEW_LINE>TagsItem tagsItem = new TagsItem();<NEW_LINE>tagsItem.setKey(_ctx.stringValue("DescribeFabricConsortiumsResponse.Result[" + i + "].Tags[" + j + "].Key"));<NEW_LINE>tagsItem.setValue(_ctx.stringValue("DescribeFabricConsortiumsResponse.Result[" + i <MASK><NEW_LINE>tags.add(tagsItem);<NEW_LINE>}<NEW_LINE>resultItem.setTags(tags);<NEW_LINE>result.add(resultItem);<NEW_LINE>}<NEW_LINE>describeFabricConsortiumsResponse.setResult(result);<NEW_LINE>return describeFabricConsortiumsResponse;<NEW_LINE>}
+ "].Tags[" + j + "].Value"));
425,073
private static EngineInfo initIdmEngineFromResource(URL resourceUrl) {<NEW_LINE>EngineInfo idmEngineInfo = idmEngineInfosByResourceUrl.get(resourceUrl.toString());<NEW_LINE>// if there is an existing idm engine info<NEW_LINE>if (idmEngineInfo != null) {<NEW_LINE>// remove that idm engine from the member fields<NEW_LINE>idmEngineInfos.remove(idmEngineInfo);<NEW_LINE>if (idmEngineInfo.getException() == null) {<NEW_LINE>String idmEngineName = idmEngineInfo.getName();<NEW_LINE>idmEngines.remove(idmEngineName);<NEW_LINE>idmEngineInfosByName.remove(idmEngineName);<NEW_LINE>}<NEW_LINE>idmEngineInfosByResourceUrl.remove(idmEngineInfo.getResourceUrl());<NEW_LINE>}<NEW_LINE>String resourceUrlString = resourceUrl.toString();<NEW_LINE>try {<NEW_LINE>LOGGER.info("initializing idm engine for resource {}", resourceUrl);<NEW_LINE>IdmEngine idmEngine = buildIdmEngine(resourceUrl);<NEW_LINE>String idmEngineName = idmEngine.getName();<NEW_LINE>LOGGER.info("initialised idm engine {}", idmEngineName);<NEW_LINE>idmEngineInfo = new EngineInfo(idmEngineName, resourceUrlString, null);<NEW_LINE>idmEngines.put(idmEngineName, idmEngine);<NEW_LINE><MASK><NEW_LINE>} catch (Throwable e) {<NEW_LINE>LOGGER.error("Exception while initializing idm engine: {}", e.getMessage(), e);<NEW_LINE>idmEngineInfo = new EngineInfo(null, resourceUrlString, ExceptionUtils.getStackTrace(e));<NEW_LINE>}<NEW_LINE>idmEngineInfosByResourceUrl.put(resourceUrlString, idmEngineInfo);<NEW_LINE>idmEngineInfos.add(idmEngineInfo);<NEW_LINE>return idmEngineInfo;<NEW_LINE>}
idmEngineInfosByName.put(idmEngineName, idmEngineInfo);
712,992
public static void dump(ServletContext ctx) {<NEW_LINE>log.config("ServletContext " + ctx.getServletContextName());<NEW_LINE>log.config(<MASK><NEW_LINE>if (!CLogMgt.isLevelFiner())<NEW_LINE>return;<NEW_LINE>boolean first = true;<NEW_LINE>Enumeration e = ctx.getInitParameterNames();<NEW_LINE>while (e.hasMoreElements()) {<NEW_LINE>if (first)<NEW_LINE>log.finer("InitParameter:");<NEW_LINE>first = false;<NEW_LINE>String key = (String) e.nextElement();<NEW_LINE>Object value = ctx.getInitParameter(key);<NEW_LINE>log.finer("- " + key + " = " + value);<NEW_LINE>}<NEW_LINE>first = true;<NEW_LINE>e = ctx.getAttributeNames();<NEW_LINE>while (e.hasMoreElements()) {<NEW_LINE>if (first)<NEW_LINE>log.finer("Attributes:");<NEW_LINE>first = false;<NEW_LINE>String key = (String) e.nextElement();<NEW_LINE>Object value = ctx.getAttribute(key);<NEW_LINE>log.finer("- " + key + " = " + value);<NEW_LINE>}<NEW_LINE>}
"- ServerInfo=" + ctx.getServerInfo());
437,409
public void parseArguments(String[] args) throws GCViewerArgsParserException {<NEW_LINE>List<String> argsList = new ArrayList<String><MASK><NEW_LINE>int typeIdx = argsList.indexOf("-t");<NEW_LINE>// If there is a -t and there is a string after, set the type<NEW_LINE>if (typeIdx != -1 && argsList.size() > (typeIdx + 1)) {<NEW_LINE>type = parseType(argsList.get(typeIdx + 1));<NEW_LINE>// Chomp these two from the array to prevent any order issues<NEW_LINE>argsList.remove(typeIdx);<NEW_LINE>argsList.remove(typeIdx);<NEW_LINE>} else if (typeIdx != -1) {<NEW_LINE>// No specific type set, just keep the default<NEW_LINE>argsList.remove(typeIdx);<NEW_LINE>}<NEW_LINE>argumentCount = argsList.size();<NEW_LINE>gcFile = safeGetArgument(argsList, ARG_POS_GCFILE);<NEW_LINE>summaryFilePath = safeGetArgument(argsList, ARG_POS_SUMMARY_FILE);<NEW_LINE>chartFilePath = safeGetArgument(argsList, ARG_POS_CHART_FILE);<NEW_LINE>}
(Arrays.asList(args));
451,339
public void actionPerformed(java.awt.event.ActionEvent p_evt) {<NEW_LINE>int[] selected_rows = table.getSelectedRows();<NEW_LINE>if (selected_rows.length <= 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>app.freerouting.interactive.BoardHandling board_handling = board_frame.board_panel.board_handling;<NEW_LINE>app.freerouting.rules.BoardRules board_rules = board_handling.get_routing_board().rules;<NEW_LINE>NetClass[] selected_class_arr = new NetClass[selected_rows.length];<NEW_LINE>for (int i = 0; i < selected_class_arr.length; ++i) {<NEW_LINE>selected_class_arr[i] = board_rules.net_classes.get((String) table.getValueAt(selected_rows[i], ColumnName.NAME.ordinal()));<NEW_LINE>}<NEW_LINE>int max_net_no = board_rules.nets.max_net_no();<NEW_LINE>for (int i = 1; i <= max_net_no; ++i) {<NEW_LINE>board_handling.set_incompletes_filter(i, true);<NEW_LINE>NetClass curr_net_class = board_rules.nets.<MASK><NEW_LINE>for (int j = 0; j < selected_class_arr.length; ++j) {<NEW_LINE>if (curr_net_class == selected_class_arr[j]) {<NEW_LINE>board_handling.set_incompletes_filter(i, false);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>board_frame.board_panel.repaint();<NEW_LINE>}
get(i).get_class();
279,930
public Expr apply(final List<Expr> args) {<NEW_LINE>if (args.size() < 2 || args.size() > 3) {<NEW_LINE>throw new IAE("Function[%s] must have 2 or 3 arguments", name());<NEW_LINE>}<NEW_LINE>final Expr arg = args.get(0);<NEW_LINE>final Expr patternExpr = args.get(1);<NEW_LINE>final Expr escapeExpr = args.size() > 2 ? args.get(2) : null;<NEW_LINE>if (!patternExpr.isLiteral() || (escapeExpr != null && !escapeExpr.isLiteral())) {<NEW_LINE>throw new IAE("pattern and escape must be literals");<NEW_LINE>}<NEW_LINE>final String escape = escapeExpr == null ? null : (String) escapeExpr.getLiteralValue();<NEW_LINE>final Character escapeChar;<NEW_LINE>if (escape != null && escape.length() != 1) {<NEW_LINE>throw new IllegalArgumentException("Escape must be null or a single character");<NEW_LINE>} else {<NEW_LINE>escapeChar = escape == null ? null : escape.charAt(0);<NEW_LINE>}<NEW_LINE>final LikeDimFilter.LikeMatcher likeMatcher = LikeDimFilter.LikeMatcher.from(NullHandling.nullToEmptyIfNeeded((String) patternExpr.getLiteralValue()), escapeChar);<NEW_LINE>class LikeExtractExpr extends ExprMacroTable.BaseScalarUnivariateMacroFunctionExpr {<NEW_LINE><NEW_LINE>private LikeExtractExpr(Expr arg) {<NEW_LINE>super(FN_NAME, arg);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Nonnull<NEW_LINE>@Override<NEW_LINE>public ExprEval eval(final ObjectBinding bindings) {<NEW_LINE>return ExprEval.ofLongBoolean(likeMatcher.matches(arg.eval(bindings).asString()));<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Expr visit(Shuttle shuttle) {<NEW_LINE>return shuttle.visit(apply(shuttle.visitAll(args)));<NEW_LINE>}<NEW_LINE><NEW_LINE>@Nullable<NEW_LINE>@Override<NEW_LINE>public ExpressionType getOutputType(InputBindingInspector inspector) {<NEW_LINE>return ExpressionType.LONG;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String stringify() {<NEW_LINE>if (escapeExpr != null) {<NEW_LINE>return StringUtils.format("%s(%s, %s, %s)", FN_NAME, arg.stringify(), patternExpr.stringify(), escapeExpr.stringify());<NEW_LINE>}<NEW_LINE>return StringUtils.format("%s(%s, %s)", FN_NAME, arg.stringify(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new LikeExtractExpr(arg);<NEW_LINE>}
), patternExpr.stringify());
1,041,822
public HeroicConfig.Builder build(final ExtraParameters params) throws Exception {<NEW_LINE>final BigtableMetricModule.Builder module = BigtableMetricModule.builder();<NEW_LINE>params.get("project").map(module::project);<NEW_LINE>params.get("instance").map(module::instance);<NEW_LINE>params.get("profile").map(module::profile);<NEW_LINE>final String credentials = params.get("credential").orElse(DEFAULT_CREDENTIALS);<NEW_LINE>switch(credentials) {<NEW_LINE>case "json":<NEW_LINE>final JsonCredentialsBuilder.Builder j = JsonCredentialsBuilder.builder();<NEW_LINE>params.get("json").map(Paths::get).ifPresent(j::path);<NEW_LINE>module.credentials(j.build());<NEW_LINE>break;<NEW_LINE>case "service-account":<NEW_LINE>final ServiceAccountCredentialsBuilder.Builder sa = ServiceAccountCredentialsBuilder.builder();<NEW_LINE>params.get("serviceAccount"<MASK><NEW_LINE>params.get("keyFile").ifPresent(sa::keyFile);<NEW_LINE>module.credentials(sa.build());<NEW_LINE>break;<NEW_LINE>case "compute-engine":<NEW_LINE>module.credentials(new ComputeEngineCredentialsBuilder());<NEW_LINE>break;<NEW_LINE>case "default":<NEW_LINE>module.credentials(new DefaultCredentialsBuilder());<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new IllegalArgumentException("credentials: invalid value: " + credentials);<NEW_LINE>}<NEW_LINE>// @formatter:off<NEW_LINE>return HeroicConfig.builder().metrics(MetricManagerModule.builder().backends(ImmutableList.<MetricModule>of(module.build())));<NEW_LINE>// @formatter:on<NEW_LINE>}
).ifPresent(sa::serviceAccount);
1,841,819
private boolean noDuplicateValues(LogicalInsertIgnore insertIgnore, ExecutionContext insertEc) {<NEW_LINE>final List<List<ColumnMeta>> ukColumnMetas = insertIgnore.getUkColumnMetas();<NEW_LINE>final List<List<Integer>> ukColumnsListAfterUkMapping = insertIgnore.getAfterUkMapping();<NEW_LINE>final LogicalDynamicValues input = RelUtils.getRelInput(insertIgnore);<NEW_LINE>final ImmutableList<RexNode> rexRow = input.getTuples().get(0);<NEW_LINE>final List<Map<Integer, ParameterContext>> parameters = insertEc.getParams().getBatchParameters();<NEW_LINE>final List<Set<GroupKey>> checkers = new ArrayList<>(ukColumnMetas.size());<NEW_LINE>IntStream.range(0, ukColumnMetas.size()).forEach(i -> checkers.add(<MASK><NEW_LINE>for (Map<Integer, ParameterContext> paramRow : parameters) {<NEW_LINE>final List<GroupKey> insertRow = ExecUtils.buildGroupKeys(ukColumnsListAfterUkMapping, ukColumnMetas, (i) -> RexUtils.getValueFromRexNode(rexRow.get(i), insertEc, paramRow));<NEW_LINE>final boolean duplicateExists = IntStream.range(0, ukColumnMetas.size()).anyMatch(i -> {<NEW_LINE>if (checkers.get(i).contains(insertRow.get(i))) {<NEW_LINE>return true;<NEW_LINE>} else {<NEW_LINE>checkers.get(i).add(insertRow.get(i));<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>if (duplicateExists) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
new TreeSet<>()));
1,009,684
private CommandSpec buildCommand(boolean reuseExisting, Element element, final Context context, final RoundEnvironment roundEnv) {<NEW_LINE>debugElement(element, "@Command");<NEW_LINE>CommandSpec result = null;<NEW_LINE>if (reuseExisting) {<NEW_LINE>// #1440 subcommands should create separate instances<NEW_LINE>result = <MASK><NEW_LINE>if (result != null) {<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>result = CommandSpec.wrapWithoutInspection(element);<NEW_LINE>result.interpolateVariables(false);<NEW_LINE>context.commands.put(element, result);<NEW_LINE>element.accept(new SimpleElementVisitor6<Void, CommandSpec>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Void visitType(TypeElement e, CommandSpec commandSpec) {<NEW_LINE>updateCommandSpecFromTypeElement(e, context, commandSpec, roundEnv);<NEW_LINE>List<? extends Element> enclosedElements = e.getEnclosedElements();<NEW_LINE>processEnclosedElements(context, roundEnv, enclosedElements);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Void visitExecutable(ExecutableElement e, CommandSpec commandSpec) {<NEW_LINE>updateCommandFromMethodElement(e, context, commandSpec, roundEnv);<NEW_LINE>List<? extends Element> enclosedElements = e.getEnclosedElements();<NEW_LINE>processEnclosedElements(context, roundEnv, enclosedElements);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}, result);<NEW_LINE>logger.fine(String.format("CommandSpec[name=%s] built for %s", result.name(), element));<NEW_LINE>return result;<NEW_LINE>}
context.commands.get(element);
1,202,782
private void internalDelete(Persistable persistable) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.entry(tc, "internalDelete", "Persistable=" + persistable);<NEW_LINE>PersistableImpl thePersistable = (PersistableImpl) persistable;<NEW_LINE>// Deletion of an item<NEW_LINE>try {<NEW_LINE>_startTransaction();<NEW_LINE>thePersistable.removeFromStore(_tran);<NEW_LINE>} catch (LogFileFullException lffe) {<NEW_LINE>com.ibm.ws.ffdc.FFDCFilter.processException(lffe, "com.ibm.ws.sib.msgstore.persistence.objectManager.BatchingContextImpl.internalDelete", "1:557:1.18", this);<NEW_LINE>SibTr.error(tc, "FILE_STORE_LOG_FULL_SIMS1573E");<NEW_LINE>_deferredException = new PersistenceFullException("FILE_STORE_LOG_FULL_SIMS1573E", lffe);<NEW_LINE>} catch (ObjectStoreFullException osfe) {<NEW_LINE>com.ibm.ws.ffdc.FFDCFilter.processException(osfe, "com.ibm.ws.sib.msgstore.persistence.objectManager.BatchingContextImpl.internalDelete", "1:563:1.18", this);<NEW_LINE>if (_objectStore.getStoreStrategy() == ObjectStore.STRATEGY_KEEP_ALWAYS) {<NEW_LINE>SibTr.error(tc, "FILE_STORE_PERMANENT_STORE_FULL_SIMS1574E");<NEW_LINE>_deferredException = new PersistenceFullException("FILE_STORE_PERMANENT_STORE_FULL_SIMS1574E", osfe);<NEW_LINE>} else {<NEW_LINE>SibTr.error(tc, "FILE_STORE_TEMPORARY_STORE_FULL_SIMS1575E");<NEW_LINE>_deferredException = new PersistenceFullException("FILE_STORE_TEMPORARY_STORE_FULL_SIMS1575E", osfe);<NEW_LINE>}<NEW_LINE>} catch (ObjectManagerException ome) {<NEW_LINE>com.ibm.ws.ffdc.FFDCFilter.processException(<MASK><NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())<NEW_LINE>SibTr.event(tc, "Exception caught deleting from object store!", ome);<NEW_LINE>_deferredException = new PersistenceException("Exception caught deleting from object store: " + ome.getMessage(), ome);<NEW_LINE>} catch (PersistenceException pe) {<NEW_LINE>com.ibm.ws.ffdc.FFDCFilter.processException(pe, "com.ibm.ws.sib.msgstore.persistence.objectManager.BatchingContextImpl.internalDelete", "1:583:1.18", this);<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())<NEW_LINE>SibTr.event(tc, "Persistence exception caught deleting from object store!", pe);<NEW_LINE>_deferredException = pe;<NEW_LINE>}<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.exit(tc, "internalDelete");<NEW_LINE>}
ome, "com.ibm.ws.sib.msgstore.persistence.objectManager.BatchingContextImpl.internalDelete", "1:577:1.18", this);
1,105,756
protected boolean addRoots(URL[] classPathRoots, SourceGroup sourceGroup, String type) throws IOException, UnsupportedOperationException {<NEW_LINE>if (sourceGroup.getRootFolder() != project.getSourceDirectory()) {<NEW_LINE>throw new UnsupportedOperationException("cannot add raw JARs to test roots");<NEW_LINE>}<NEW_LINE>ProjectXMLManager pxm = new ProjectXMLManager(project);<NEW_LINE>Map<String, String> origCpexts = pxm.getClassPathExtensions();<NEW_LINE>Map<String, String> cpexts = new LinkedHashMap<MASK><NEW_LINE>boolean cpChanged = false;<NEW_LINE>for (URL root : classPathRoots) {<NEW_LINE>File jar = FileUtil.archiveOrDirForURL(root);<NEW_LINE>if (jar == null || !jar.isFile()) {<NEW_LINE>throw new UnsupportedOperationException("cannot add: " + root);<NEW_LINE>}<NEW_LINE>String relativePath = ApisupportAntUtils.CPEXT_RUNTIME_RELATIVE_PATH + jar.getName();<NEW_LINE>String binaryOrigin = ApisupportAntUtils.CPEXT_BINARY_PATH + jar.getName();<NEW_LINE>File target = project.getHelper().resolveFile(binaryOrigin);<NEW_LINE>if (jar.equals(target)) {<NEW_LINE>// already in place<NEW_LINE>cpexts.put(relativePath, binaryOrigin);<NEW_LINE>} else {<NEW_LINE>if (!target.isFile() || target.length() != jar.length()) {<NEW_LINE>// probably fresh JAR; XXX check contents<NEW_LINE>cpChanged = true;<NEW_LINE>}<NEW_LINE>String[] result = ApisupportAntUtils.copyClassPathExtensionJar(FileUtil.toFile(project.getProjectDirectory()), jar);<NEW_LINE>assert result != null : jar;<NEW_LINE>assert result[0].equals(relativePath) : result[0];<NEW_LINE>assert result[1].equals(binaryOrigin) : result[1];<NEW_LINE>cpexts.put(relativePath, binaryOrigin);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!cpexts.equals(origCpexts)) {<NEW_LINE>pxm.replaceClassPathExtensions(cpexts);<NEW_LINE>ProjectManager.getDefault().saveProject(project);<NEW_LINE>cpChanged = true;<NEW_LINE>}<NEW_LINE>return cpChanged;<NEW_LINE>}
<String, String>(origCpexts);
1,371,521
private static OutputEventArguments convertToOutputEventArguments(String message, String category, DebugAdapterContext context) {<NEW_LINE>Matcher matcher = STACKTRACE_PATTERN.matcher(message);<NEW_LINE>if (matcher.find()) {<NEW_LINE>String methodField = matcher.group(1);<NEW_LINE>String locationField = matcher.group(matcher.groupCount());<NEW_LINE>String fullyQualifiedName = methodField.substring(0, methodField.lastIndexOf("."));<NEW_LINE>String packageName = fullyQualifiedName.lastIndexOf(".") > -1 ? fullyQualifiedName.substring(0, fullyQualifiedName.lastIndexOf(".")) : "";<NEW_LINE>String[] <MASK><NEW_LINE>String sourceName = locations[0];<NEW_LINE>int lineNumber = Integer.parseInt(locations[1]);<NEW_LINE>String sourcePath = StringUtils.isBlank(packageName) ? sourceName : packageName.replace('.', File.separatorChar) + File.separatorChar + sourceName;<NEW_LINE>Source source = null;<NEW_LINE>try {<NEW_LINE>source = NbSourceProvider.convertDebuggerSourceToClient(fullyQualifiedName, sourceName, sourcePath, context);<NEW_LINE>} catch (URISyntaxException e) {<NEW_LINE>// do nothing.<NEW_LINE>}<NEW_LINE>OutputEventArguments args = new OutputEventArguments();<NEW_LINE>args.setCategory(category);<NEW_LINE>args.setOutput(message);<NEW_LINE>args.setSource(source);<NEW_LINE>args.setLine(lineNumber);<NEW_LINE>return args;<NEW_LINE>}<NEW_LINE>OutputEventArguments args = new OutputEventArguments();<NEW_LINE>args.setCategory(category);<NEW_LINE>args.setOutput(message);<NEW_LINE>return args;<NEW_LINE>}
locations = locationField.split(":");
200,073
private boolean injectTouch(int action, long pointerId, Position position, float pressure, int buttons) {<NEW_LINE><MASK><NEW_LINE>Point point = device.getPhysicalPoint(position);<NEW_LINE>if (point == null) {<NEW_LINE>Ln.w("Ignore touch event, it was generated for a different device size");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>int pointerIndex = pointersState.getPointerIndex(pointerId);<NEW_LINE>if (pointerIndex == -1) {<NEW_LINE>Ln.w("Too many pointers for touch event");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Pointer pointer = pointersState.get(pointerIndex);<NEW_LINE>pointer.setPoint(point);<NEW_LINE>pointer.setPressure(pressure);<NEW_LINE>pointer.setUp(action == MotionEvent.ACTION_UP);<NEW_LINE>int pointerCount = pointersState.update(pointerProperties, pointerCoords);<NEW_LINE>if (pointerCount == 1) {<NEW_LINE>if (action == MotionEvent.ACTION_DOWN) {<NEW_LINE>lastTouchDown = now;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// secondary pointers must use ACTION_POINTER_* ORed with the pointerIndex<NEW_LINE>if (action == MotionEvent.ACTION_UP) {<NEW_LINE>action = MotionEvent.ACTION_POINTER_UP | (pointerIndex << MotionEvent.ACTION_POINTER_INDEX_SHIFT);<NEW_LINE>} else if (action == MotionEvent.ACTION_DOWN) {<NEW_LINE>action = MotionEvent.ACTION_POINTER_DOWN | (pointerIndex << MotionEvent.ACTION_POINTER_INDEX_SHIFT);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Right-click and middle-click only work if the source is a mouse<NEW_LINE>boolean nonPrimaryButtonPressed = (buttons & ~MotionEvent.BUTTON_PRIMARY) != 0;<NEW_LINE>int source = nonPrimaryButtonPressed ? InputDevice.SOURCE_MOUSE : InputDevice.SOURCE_TOUCHSCREEN;<NEW_LINE>if (source != InputDevice.SOURCE_MOUSE) {<NEW_LINE>// Buttons must not be set for touch events<NEW_LINE>buttons = 0;<NEW_LINE>}<NEW_LINE>MotionEvent event = MotionEvent.obtain(lastTouchDown, now, action, pointerCount, pointerProperties, pointerCoords, 0, buttons, 1f, 1f, DEFAULT_DEVICE_ID, 0, source, 0);<NEW_LINE>return device.injectEvent(event, Device.INJECT_MODE_ASYNC);<NEW_LINE>}
long now = SystemClock.uptimeMillis();
390,660
public boolean validateMethodRequest(MethodConfig methodConfig) {<NEW_LINE>if (methodConfig.getSpreadsheetId() == null || methodConfig.getSpreadsheetId().isBlank()) {<NEW_LINE>throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_EXECUTE_ARGUMENT_ERROR, "Missing required field Spreadsheet Url");<NEW_LINE>}<NEW_LINE>if (methodConfig.getSheetName() == null || methodConfig.getSheetName().isBlank()) {<NEW_LINE>throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_EXECUTE_ARGUMENT_ERROR, "Missing required field Sheet name");<NEW_LINE>}<NEW_LINE>if (methodConfig.getTableHeaderIndex() != null && !methodConfig.getTableHeaderIndex().isBlank()) {<NEW_LINE>try {<NEW_LINE>if (Integer.parseInt(methodConfig.getTableHeaderIndex()) <= 0) {<NEW_LINE>throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_EXECUTE_ARGUMENT_ERROR, "Unexpected value for table header index. Please use a number starting from 1");<NEW_LINE>}<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_EXECUTE_ARGUMENT_ERROR, "Unexpected format for table header index. Please use a number starting from 1");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final String body = methodConfig.getRowObject();<NEW_LINE>try {<NEW_LINE>this.getRowObjectFromBody(this<MASK><NEW_LINE>} catch (JsonProcessingException e) {<NEW_LINE>throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_JSON_PARSE_ERROR, methodConfig.getRowObject(), "Unable to parse request body. Expected a row object.");<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
.objectMapper.readTree(body));
1,283,050
public void testSLLocalEnvEntry_Integer_InvalidValue() throws Exception {<NEW_LINE>SLLa ejb1 = fhome1.create();<NEW_LINE>try {<NEW_LINE>// The test case looks for a environment variable named "envIntegerInvalid".<NEW_LINE>Integer <MASK><NEW_LINE>fail("Get environment invalid int object should have failed, instead got: " + tempInt);<NEW_LINE>} catch (NamingException ne) {<NEW_LINE>svLogger.info("Caught expected " + ne.getClass().getName());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>// The test case looks for a environment variable named "envIntegerInvalid".<NEW_LINE>Integer tempInt = ejb1.getIntegerEnvVar("envIntegerInvalid");<NEW_LINE>fail("Get environment invalid int object should have failed, instead got: " + tempInt);<NEW_LINE>} catch (NamingException ne) {<NEW_LINE>svLogger.info("Caught expected " + ne.getClass().getName());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>// The test case looks for a environment variable named "envIntegerInvalid".<NEW_LINE>Integer tempInt = ejb1.getIntegerEnvVar("envIntegerGT32bit");<NEW_LINE>fail("Get environment invalid int object should have failed, instead got: " + tempInt);<NEW_LINE>} catch (NamingException ne) {<NEW_LINE>svLogger.info("Caught expected " + ne.getClass().getName());<NEW_LINE>}<NEW_LINE>}
tempInt = ejb1.getIntegerEnvVar("envIntegerBlankValue");
432,010
public VoidResult createDirectory(CreateDirectoryRequest createDirectoryRequest) throws OSSException, ClientException {<NEW_LINE>assertParameterNotNull(createDirectoryRequest, "createDirectoryRequest");<NEW_LINE>String bucketName = createDirectoryRequest.getBucketName();<NEW_LINE>String directory = createDirectoryRequest.getDirectoryName();<NEW_LINE>assertParameterNotNull(bucketName, "bucketName");<NEW_LINE>ensureBucketNameValid(bucketName);<NEW_LINE>assertParameterNotNull(directory, "directory");<NEW_LINE>ensureObjectKeyValid(directory);<NEW_LINE>Map<String, String> params = new HashMap<String, String>();<NEW_LINE>params.put(SUBRESOURCE_DIR, null);<NEW_LINE>Map<String, String> headers = new <MASK><NEW_LINE>populateRequestPayerHeader(headers, createDirectoryRequest.getRequestPayer());<NEW_LINE>RequestMessage request = new OSSRequestMessageBuilder(getInnerClient()).setEndpoint(getEndpoint(createDirectoryRequest)).setMethod(HttpMethod.POST).setBucket(bucketName).setKey(directory).setParameters(params).setHeaders(headers).setInputStream(new ByteArrayInputStream(new byte[0])).setInputSize(0).setOriginalRequest(createDirectoryRequest).build();<NEW_LINE>return doOperation(request, requestIdResponseParser, bucketName, directory);<NEW_LINE>}
HashMap<String, String>();
118,366
public static GetDrdsDbRdsRelationInfoResponse unmarshall(GetDrdsDbRdsRelationInfoResponse getDrdsDbRdsRelationInfoResponse, UnmarshallerContext _ctx) {<NEW_LINE>getDrdsDbRdsRelationInfoResponse.setRequestId(_ctx.stringValue("GetDrdsDbRdsRelationInfoResponse.RequestId"));<NEW_LINE>getDrdsDbRdsRelationInfoResponse.setSuccess(_ctx.booleanValue("GetDrdsDbRdsRelationInfoResponse.Success"));<NEW_LINE>List<DataItem> data = new ArrayList<DataItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("GetDrdsDbRdsRelationInfoResponse.Data.Length"); i++) {<NEW_LINE>DataItem dataItem = new DataItem();<NEW_LINE>dataItem.setRdsInstanceId(_ctx.stringValue<MASK><NEW_LINE>dataItem.setUsedInstanceId(_ctx.stringValue("GetDrdsDbRdsRelationInfoResponse.Data[" + i + "].UsedInstanceId"));<NEW_LINE>dataItem.setUsedInstanceType(_ctx.stringValue("GetDrdsDbRdsRelationInfoResponse.Data[" + i + "].UsedInstanceType"));<NEW_LINE>List<String> readOnlyInstanceInfo = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("GetDrdsDbRdsRelationInfoResponse.Data[" + i + "].ReadOnlyInstanceInfo.Length"); j++) {<NEW_LINE>readOnlyInstanceInfo.add(_ctx.stringValue("GetDrdsDbRdsRelationInfoResponse.Data[" + i + "].ReadOnlyInstanceInfo[" + j + "]"));<NEW_LINE>}<NEW_LINE>dataItem.setReadOnlyInstanceInfo(readOnlyInstanceInfo);<NEW_LINE>data.add(dataItem);<NEW_LINE>}<NEW_LINE>getDrdsDbRdsRelationInfoResponse.setData(data);<NEW_LINE>return getDrdsDbRdsRelationInfoResponse;<NEW_LINE>}
("GetDrdsDbRdsRelationInfoResponse.Data[" + i + "].RdsInstanceId"));
904,133
final UpdateSiteResult executeUpdateSite(UpdateSiteRequest updateSiteRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateSiteRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateSiteRequest> request = null;<NEW_LINE>Response<UpdateSiteResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateSiteRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateSiteRequest));<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, "Outposts");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateSite");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateSiteResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateSiteResultJsonUnmarshaller());<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());
655,406
private void validate() {<NEW_LINE>int size = deliveryBasket.size();<NEW_LINE>ArgChecker.isTrue(size == conversionFactors.size(), "The delivery basket size should be the same as the conversion factor size");<NEW_LINE>ArgChecker.inOrderOrEqual(firstNoticeDate, lastNoticeDate, "firstNoticeDate", "lastNoticeDate");<NEW_LINE>if (firstDeliveryDate != null && lastDeliveryDate != null) {<NEW_LINE>ArgChecker.inOrderOrEqual(firstDeliveryDate, lastDeliveryDate, "firstDeliveryDate", "lastDeliveryDate");<NEW_LINE>ArgChecker.inOrderOrEqual(firstNoticeDate, firstDeliveryDate, "firstNoticeDate", "firstDeliveryDate");<NEW_LINE>ArgChecker.inOrderOrEqual(lastNoticeDate, lastDeliveryDate, "lastNoticeDate", "lastDeliveryDate");<NEW_LINE>}<NEW_LINE>if (size > 1) {<NEW_LINE>ImmutableList<MASK><NEW_LINE>double notional = getNotional();<NEW_LINE>Currency currency = getCurrency();<NEW_LINE>for (int i = 1; i < size; ++i) {<NEW_LINE>ArgChecker.isTrue(bondsList.get(i).getNotional() == notional, "Notional must be same for all bonds");<NEW_LINE>ArgChecker.isTrue(bondsList.get(i).getCurrency().equals(currency), "Currency must be same for all bonds");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
<FixedCouponBond> bondsList = getDeliveryBasket();
1,288,710
public Long count(List<String> searchFields, String keywords, String where) {<NEW_LINE>String q = "select count(*) from " + this.clazz.getName() + " e";<NEW_LINE>if (keywords != null && !keywords.equals("")) {<NEW_LINE>String searchQuery = getSearchQuery(searchFields);<NEW_LINE>if (!searchQuery.equals("")) {<NEW_LINE>q += " where (" + searchQuery + ")";<NEW_LINE>}<NEW_LINE>q += (where != null ? " and " + where : "");<NEW_LINE>} else {<NEW_LINE>q += (where != <MASK><NEW_LINE>}<NEW_LINE>Query query = JPA.em(this.dbName).createQuery(q);<NEW_LINE>if (keywords != null && !keywords.equals("") && q.indexOf("?1") != -1) {<NEW_LINE>query.setParameter(1, "%" + keywords.toLowerCase() + "%");<NEW_LINE>}<NEW_LINE>return Long.decode(query.getSingleResult().toString());<NEW_LINE>}
null ? " where " + where : "");
308,110
public void propertyChange(PropertyChangeEvent evt) {<NEW_LINE>String[] newOptions = (String[]) evt.getNewValue();<NEW_LINE>String[] oldOptions = (String[]) evt.getOldValue();<NEW_LINE>// added<NEW_LINE>if (newOptions.length > oldOptions.length) {<NEW_LINE>// new element is always added to the end<NEW_LINE>String[] newValue = (String<MASK><NEW_LINE>String itemToAdd = newValue[newValue.length - 1];<NEW_LINE>cssConfig.addParameterExposureStrings(itemToAdd);<NEW_LINE>}<NEW_LINE>// removed<NEW_LINE>if (newOptions.length < oldOptions.length) {<NEW_LINE>for (int cnt = 0; cnt < oldOptions.length; cnt++) {<NEW_LINE>if (cnt < newOptions.length) {<NEW_LINE>if (newOptions[cnt] != oldOptions[cnt]) {<NEW_LINE>cssConfig.removeParameterExposureStrings(cnt);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// this is border case, last lement in array is removed.<NEW_LINE>cssConfig.removeParameterExposureStrings(oldOptions.length - 1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
[]) evt.getNewValue();
1,161,626
public static Relation<String> guessObjectLabelRepresentation(Database database) {<NEW_LINE>try {<NEW_LINE>Relation<? extends LabelList> labelsrep = <MASK><NEW_LINE>if (labelsrep != null) {<NEW_LINE>return new ConvertToStringView(labelsrep);<NEW_LINE>}<NEW_LINE>} catch (NoSupportedDataTypeException e) {<NEW_LINE>// retry.<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Relation<String> stringrep = database.getRelation(TypeUtil.STRING);<NEW_LINE>if (stringrep != null) {<NEW_LINE>return stringrep;<NEW_LINE>}<NEW_LINE>} catch (NoSupportedDataTypeException e) {<NEW_LINE>// retry.<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Relation<? extends ClassLabel> classrep = database.getRelation(TypeUtil.CLASSLABEL);<NEW_LINE>if (classrep != null) {<NEW_LINE>return new ConvertToStringView(classrep);<NEW_LINE>}<NEW_LINE>} catch (NoSupportedDataTypeException e) {<NEW_LINE>// retry.<NEW_LINE>}<NEW_LINE>throw new NoSupportedDataTypeException("No label-like representation was found.");<NEW_LINE>}
database.getRelation(TypeUtil.LABELLIST);
143,680
public void runSupport() {<NEW_LINE>List<Object[]> to_process;<NEW_LINE>synchronized (share_requests) {<NEW_LINE>to_process = new ArrayList<>(share_requests);<NEW_LINE>}<NEW_LINE>for (Object[] entry : to_process) {<NEW_LINE>try {<NEW_LINE>String key = (String) entry[0];<NEW_LINE>File file = (File) entry[1];<NEW_LINE>String name = (String) entry[2];<NEW_LINE>Tag tag = (Tag) entry[3];<NEW_LINE>log("Auto sharing " + name + " (" + file + ") to tag " + tag.getTagName(true));<NEW_LINE>Map<String, String> properties = new HashMap<>();<NEW_LINE>properties.put(ShareManager.PR_USER_DATA, "device:autoshare");<NEW_LINE>// currently no way for user to explicitly specify the networks to use so use defaults<NEW_LINE>String[] networks = AENetworkClassifier.getDefaultNetworks();<NEW_LINE>String networks_str = "";<NEW_LINE>for (String net : networks) {<NEW_LINE>networks_str += (networks_str.length() == 0 ? "" : ",") + net;<NEW_LINE>}<NEW_LINE>properties.put(ShareManager.PR_NETWORKS, networks_str);<NEW_LINE>properties.put(ShareManager.PR_TAGS, String.valueOf(tag.getTagUID()));<NEW_LINE>PluginInterface pi = PluginInitializer.getDefaultInterface();<NEW_LINE>ShareResourceFile srf = pi.getShareManager().addFile(file, properties);<NEW_LINE>Torrent torrent = srf.getItem().getTorrent();<NEW_LINE>final Download download = pi.getPluginManager().getDefaultPluginInterface().getShortCuts().getDownload(torrent.getHash());<NEW_LINE>if (download == null) {<NEW_LINE>throw (new Exception("Download no longer exists"));<NEW_LINE>}<NEW_LINE>DownloadManager dm = PluginCoreUtils.unwrap(download);<NEW_LINE>dm.getDownloadState().setDisplayName(name);<NEW_LINE><MASK><NEW_LINE>} catch (Throwable e) {<NEW_LINE>log("Auto sharing failed", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>synchronized (share_requests) {<NEW_LINE>share_requests.removeAll(to_process);<NEW_LINE>}<NEW_LINE>}
download.setAttribute(share_ta, key);
689,520
protected Status writeToStorage(String tableName, String key, Map<String, ByteIterator> values) {<NEW_LINE>try {<NEW_LINE>byte[] jsonData = toJson(values<MASK><NEW_LINE>long now = System.currentTimeMillis() / 1000L;<NEW_LINE>FilerProto.Entry.Builder entry = FilerProto.Entry.newBuilder().setName(key).setIsDirectory(false).setAttributes(FilerProto.FuseAttributes.newBuilder().setCrtime(now).setMtime(now).setFileMode(0755));<NEW_LINE>SeaweedWrite.writeData(entry, "000", this.filerGrpcClient, 0, jsonData, 0, jsonData.length);<NEW_LINE>SeaweedWrite.writeMeta(this.filerGrpcClient, this.folder + "/" + tableName, entry);<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.error("Not possible to write the object {}", key, e);<NEW_LINE>return Status.ERROR;<NEW_LINE>}<NEW_LINE>return Status.OK;<NEW_LINE>}
).getBytes(StandardCharsets.UTF_8);
1,623,352
protected void addCommonActivityInstanceFields(ActivityInstance activityInstance, ObjectNode data) {<NEW_LINE>putIfNotNull(data, HistoryJsonConstants.RUNTIME_ACTIVITY_INSTANCE_ID, activityInstance.getId());<NEW_LINE>putIfNotNull(data, HistoryJsonConstants.PROCESS_DEFINITION_ID, activityInstance.getProcessDefinitionId());<NEW_LINE>putIfNotNull(data, HistoryJsonConstants.PROCESS_INSTANCE_ID, activityInstance.getProcessInstanceId());<NEW_LINE>putIfNotNull(data, HistoryJsonConstants.EXECUTION_ID, activityInstance.getExecutionId());<NEW_LINE>putIfNotNull(data, HistoryJsonConstants.ACTIVITY_ID, activityInstance.getActivityId());<NEW_LINE>putIfNotNull(data, HistoryJsonConstants.ACTIVITY_NAME, activityInstance.getActivityName());<NEW_LINE>putIfNotNull(data, HistoryJsonConstants.ACTIVITY_TYPE, activityInstance.getActivityType());<NEW_LINE>if (activityInstance.getTransactionOrder() != null) {<NEW_LINE>putIfNotNull(data, HistoryJsonConstants.TRANSACTION_ORDER, activityInstance.getTransactionOrder());<NEW_LINE>}<NEW_LINE>putIfNotNull(data, HistoryJsonConstants.<MASK><NEW_LINE>}
TENANT_ID, activityInstance.getTenantId());
1,060,607
private RefactoringStatus initialize(JavaRefactoringArguments extended) {<NEW_LINE>final String handle = extended.getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT);<NEW_LINE>if (handle != null) {<NEW_LINE>final IJavaElement element = JavaRefactoringDescriptorUtil.handleToElement(extended.getProject(), handle, false);<NEW_LINE>if (element == null || !element.exists() || element.getElementType() != IJavaElement.FIELD) {<NEW_LINE>return JavaRefactoringDescriptorUtil.createInputFatalStatus(element, getProcessorName(), IJavaRefactorings.RENAME_ENUM_CONSTANT);<NEW_LINE>} else {<NEW_LINE>fField = (IField) element;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages<MASK><NEW_LINE>}<NEW_LINE>final String name = extended.getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_NAME);<NEW_LINE>if (name != null && !"".equals(name)) {<NEW_LINE>setNewElementName(name);<NEW_LINE>} else {<NEW_LINE>return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_NAME));<NEW_LINE>}<NEW_LINE>final String references = extended.getAttribute(JavaRefactoringDescriptorUtil.ATTRIBUTE_REFERENCES);<NEW_LINE>if (references != null) {<NEW_LINE>setUpdateReferences(Boolean.valueOf(references).booleanValue());<NEW_LINE>} else {<NEW_LINE>return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_REFERENCES));<NEW_LINE>}<NEW_LINE>final String matches = extended.getAttribute(ATTRIBUTE_TEXTUAL_MATCHES);<NEW_LINE>if (matches != null) {<NEW_LINE>setUpdateTextualMatches(Boolean.valueOf(matches).booleanValue());<NEW_LINE>} else {<NEW_LINE>return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, ATTRIBUTE_TEXTUAL_MATCHES));<NEW_LINE>}<NEW_LINE>return new RefactoringStatus();<NEW_LINE>}
.InitializableRefactoring_argument_not_exist, JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT));
118,899
public void writeTo(T obj, Class<?> cls, Type genericType, Annotation[] anns, MediaType m, MultivaluedMap<String, Object> headers, OutputStream os) throws IOException {<NEW_LINE>try {<NEW_LINE>String encoding = HttpUtils.getSetEncoding(m, headers, StandardCharsets.UTF_8.name());<NEW_LINE>if (InjectionUtils.isSupportedCollectionOrArray(cls)) {<NEW_LINE>marshalCollection(cls, obj, genericType, encoding, os, m, anns);<NEW_LINE>} else {<NEW_LINE>Object actualObject = checkAdapter(obj, cls, anns, true);<NEW_LINE>Class<?> actualClass = obj != actualObject || cls.isInterface() ? actualObject.getClass() : cls;<NEW_LINE>marshal(actualObject, actualClass, genericType, encoding, os, m, anns);<NEW_LINE>}<NEW_LINE>} catch (JAXBException e) {<NEW_LINE>handleJAXBException(e, false);<NEW_LINE>} catch (WebApplicationException e) {<NEW_LINE>throw e;<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.warning<MASK><NEW_LINE>throw ExceptionUtils.toInternalServerErrorException(e, null);<NEW_LINE>}<NEW_LINE>}
(ExceptionUtils.getStackTrace(e));
724,029
public void run(final FlowTrigger trigger, Map data) {<NEW_LINE>DownloadDataVolumeToPrimaryStorageMsg dmsg = originVolumeUuid != null ? new DownloadTemporaryDataVolumeToPrimaryStorageMsg<MASK><NEW_LINE>dmsg.setPrimaryStorageUuid(targetPrimaryStorage.getUuid());<NEW_LINE>dmsg.setVolumeUuid(vol.getUuid());<NEW_LINE>dmsg.setBackupStorageRef(ImageBackupStorageRefInventory.valueOf(targetBackupStorageRef));<NEW_LINE>dmsg.setImage(ImageInventory.valueOf(template));<NEW_LINE>dmsg.setHostUuid(msg.getHostUuid());<NEW_LINE>bus.makeTargetServiceIdByResourceUuid(dmsg, PrimaryStorageConstant.SERVICE_ID, targetPrimaryStorage.getUuid());<NEW_LINE>bus.send(dmsg, new CloudBusCallBack(trigger) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run(MessageReply reply) {<NEW_LINE>if (!reply.isSuccess()) {<NEW_LINE>trigger.fail(reply.getError());<NEW_LINE>} else {<NEW_LINE>DownloadDataVolumeToPrimaryStorageReply r = reply.castReply();<NEW_LINE>primaryStorageInstallPath = r.getInstallPath();<NEW_LINE>volumeFormat = r.getFormat();<NEW_LINE>trigger.next();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
(originVolumeUuid) : new DownloadDataVolumeToPrimaryStorageMsg();
54,693
private void updateInternal() {<NEW_LINE>currentViewList.clear();<NEW_LINE>viewMap.clear();<NEW_LINE>// Plan to show all of the views in order to keep the order<NEW_LINE>for (TokenFilter filter : filterList) {<NEW_LINE>try {<NEW_LINE>if (filter.view.isAdmin && !MapTool.getPlayer().isGM()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} catch (NullPointerException e) {<NEW_LINE>// This seems to happen when there was a problem creating the initial window. Lets just<NEW_LINE>// ignore this filter for now.<NEW_LINE><MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>currentViewList.add(filter.view);<NEW_LINE>}<NEW_LINE>// Add in the appropriate views<NEW_LINE>List<Token> tokenList = new ArrayList<Token>();<NEW_LINE>if (zone != null) {<NEW_LINE>tokenList = zone.getAllTokens();<NEW_LINE>}<NEW_LINE>for (Token token : tokenList) {<NEW_LINE>for (TokenFilter filter : filterList) {<NEW_LINE>filter.filter(token);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Clear out any view without any tokens<NEW_LINE>currentViewList.removeIf(view -> !view.isRequired() && (viewMap.get(view) == null || viewMap.get(view).size() == 0));<NEW_LINE>// Sort<NEW_LINE>for (List<Token> tokens : viewMap.values()) {<NEW_LINE>tokens.sort(NAME_AND_STATE_COMPARATOR);<NEW_LINE>}<NEW_LINE>// Keep the expanded branches consistent<NEW_LINE>Enumeration<TreePath> expandedPaths = tree.getExpandedDescendants(new TreePath(root));<NEW_LINE>// @formatter:off<NEW_LINE>fireStructureChangedEvent(new TreeModelEvent(this, new Object[] { getRoot() }, new int[] { currentViewList.size() - 1 }, new Object[] { View.TOKENS }));<NEW_LINE>// @formatter:on<NEW_LINE>while (expandedPaths != null && expandedPaths.hasMoreElements()) {<NEW_LINE>tree.expandPath(expandedPaths.nextElement());<NEW_LINE>}<NEW_LINE>}
log.warn("NullPointerException encountered while trying to update TokenPanelTreeModel", e);
500,150
public void encrypt() {<NEW_LINE>CryptographyClient cryptographyClient = createClient();<NEW_LINE>// BEGIN: com.azure.security.keyvault.keys.cryptography.CryptographyClient.encrypt#EncryptionAlgorithm-byte<NEW_LINE>byte[] plaintext = new byte[100];<NEW_LINE>new Random(0x1234567L).nextBytes(plaintext);<NEW_LINE>EncryptResult encryptResult = cryptographyClient.encrypt(EncryptionAlgorithm.RSA_OAEP, plaintext);<NEW_LINE>System.out.printf("Received encrypted content of length: %d, with algorithm: %s.%n", encryptResult.getCipherText().length, encryptResult.getAlgorithm());<NEW_LINE>// END: com.azure.security.keyvault.keys.cryptography.CryptographyClient.encrypt#EncryptionAlgorithm-byte<NEW_LINE>// BEGIN: com.azure.security.keyvault.keys.cryptography.CryptographyClient.encrypt#EncryptionAlgorithm-byte-Context<NEW_LINE>byte[] plaintextToEncrypt = new byte[100];<NEW_LINE>new Random(0x1234567L).nextBytes(plaintextToEncrypt);<NEW_LINE>EncryptResult encryptionResult = cryptographyClient.encrypt(EncryptionAlgorithm.RSA_OAEP, plaintextToEncrypt, new Context("key1", "value1"));<NEW_LINE>System.out.printf("Received encrypted content of length: %d, with algorithm: %s.%n", encryptionResult.getCipherText().length, encryptionResult.getAlgorithm());<NEW_LINE>// END: com.azure.security.keyvault.keys.cryptography.CryptographyClient.encrypt#EncryptionAlgorithm-byte-Context<NEW_LINE>// BEGIN: com.azure.security.keyvault.keys.cryptography.CryptographyClient.encrypt#EncryptParameters-Context<NEW_LINE>byte[<MASK><NEW_LINE>new Random(0x1234567L).nextBytes(myPlaintext);<NEW_LINE>byte[] iv = { (byte) 0x1a, (byte) 0xf3, (byte) 0x8c, (byte) 0x2d, (byte) 0xc2, (byte) 0xb9, (byte) 0x6f, (byte) 0xfd, (byte) 0xd8, (byte) 0x66, (byte) 0x94, (byte) 0x09, (byte) 0x23, (byte) 0x41, (byte) 0xbc, (byte) 0x04 };<NEW_LINE>EncryptParameters encryptParameters = EncryptParameters.createA128CbcParameters(myPlaintext, iv);<NEW_LINE>EncryptResult encryptedResult = cryptographyClient.encrypt(encryptParameters, new Context("key1", "value1"));<NEW_LINE>System.out.printf("Received encrypted content of length: %d, with algorithm: %s.%n", encryptedResult.getCipherText().length, encryptedResult.getAlgorithm());<NEW_LINE>// END: com.azure.security.keyvault.keys.cryptography.CryptographyClient.encrypt#EncryptParameters-Context<NEW_LINE>}
] myPlaintext = new byte[100];
683,460
public static DescribeFrontVulPatchListResponse unmarshall(DescribeFrontVulPatchListResponse describeFrontVulPatchListResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeFrontVulPatchListResponse.setRequestId(_ctx.stringValue("DescribeFrontVulPatchListResponse.RequestId"));<NEW_LINE>List<FrontPatchItem> frontPatchList = new ArrayList<FrontPatchItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeFrontVulPatchListResponse.FrontPatchList.Length"); i++) {<NEW_LINE>FrontPatchItem frontPatchItem = new FrontPatchItem();<NEW_LINE>frontPatchItem.setDesktopId(_ctx.stringValue("DescribeFrontVulPatchListResponse.FrontPatchList[" + i + "].DesktopId"));<NEW_LINE>List<PatchItem> patchList = new ArrayList<PatchItem>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeFrontVulPatchListResponse.FrontPatchList[" + i + "].PatchList.Length"); j++) {<NEW_LINE>PatchItem patchItem = new PatchItem();<NEW_LINE>patchItem.setName(_ctx.stringValue("DescribeFrontVulPatchListResponse.FrontPatchList[" + i + "].PatchList[" + j + "].Name"));<NEW_LINE>patchItem.setAliasName(_ctx.stringValue("DescribeFrontVulPatchListResponse.FrontPatchList[" + i <MASK><NEW_LINE>patchList.add(patchItem);<NEW_LINE>}<NEW_LINE>frontPatchItem.setPatchList(patchList);<NEW_LINE>frontPatchList.add(frontPatchItem);<NEW_LINE>}<NEW_LINE>describeFrontVulPatchListResponse.setFrontPatchList(frontPatchList);<NEW_LINE>return describeFrontVulPatchListResponse;<NEW_LINE>}
+ "].PatchList[" + j + "].AliasName"));
450,543
final GetTraceGraphResult executeGetTraceGraph(GetTraceGraphRequest getTraceGraphRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getTraceGraphRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<GetTraceGraphRequest> request = null;<NEW_LINE>Response<GetTraceGraphResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetTraceGraphRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getTraceGraphRequest));<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, "XRay");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetTraceGraph");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetTraceGraphResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetTraceGraphResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
38,057
/* (non-Javadoc)<NEW_LINE>* @see com.linkedin.databus.client.netty.HttpResponseProcessorDecorator#addTrailer(org.jboss.netty.handler.codec.http.HttpChunkTrailer)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public void addTrailer(HttpChunkTrailer trailer) throws Exception {<NEW_LINE>// check for errors in the middle of the response<NEW_LINE>if (null == _serverErrorClass) {<NEW_LINE>_serverErrorClass = trailer.getHeader(DatabusHttpHeaders.DATABUS_ERROR_CAUSE_CLASS_HEADER);<NEW_LINE>_serverErrorMessage = trailer.getHeader(DatabusHttpHeaders.DATABUS_ERROR_CAUSE_MESSAGE_HEADER);<NEW_LINE>if (null == _serverErrorClass) {<NEW_LINE>_serverErrorClass = trailer.getHeader(DatabusHttpHeaders.DATABUS_ERROR_CLASS_HEADER);<NEW_LINE>_serverErrorMessage = trailer.getHeader(DatabusHttpHeaders.DATABUS_ERROR_MESSAGE_HEADER);<NEW_LINE>}<NEW_LINE>if (null != _serverErrorClass) {<NEW_LINE>if (null != _parent) {<NEW_LINE>_parent.getLog().error(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>super.addTrailer(trailer);<NEW_LINE>}
"server error detected class=" + _serverErrorClass + " message=" + _serverErrorMessage);
1,624,956
public void toJSON(JsonGenerator json) {<NEW_LINE>try {<NEW_LINE>// object name for this should be 'user'<NEW_LINE>json.writeStartObject();<NEW_LINE>json.writeObjectField(field_screen_name, getScreenName());<NEW_LINE>json.writeObjectField(field_user_id, getUserId());<NEW_LINE>json.writeObjectField(field_name, getName());<NEW_LINE>if (this.map.containsKey(field_profile_image_url_http))<NEW_LINE>json.writeObjectField(field_profile_image_url_http, this.map.get(field_profile_image_url_http));<NEW_LINE>if (this.map.containsKey(field_profile_image_url_https))<NEW_LINE>json.writeObjectField(field_profile_image_url_https, this.map.get(field_profile_image_url_https));<NEW_LINE>writeDate(json, field_appearance_first, <MASK><NEW_LINE>writeDate(json, field_appearance_latest, getAppearanceLatest().getTime());<NEW_LINE>if (this.map.containsKey(field_profile_image))<NEW_LINE>json.writeObjectField(field_profile_image, this.map.get(field_profile_image));<NEW_LINE>json.writeEndObject();<NEW_LINE>} catch (IOException e) {<NEW_LINE>}<NEW_LINE>}
getAppearanceFirst().getTime());
85,210
public byte[] marshall(SetBucketEncryptionRequest setBucketEncryptionRequest) {<NEW_LINE>StringBuffer xmlBody = new StringBuffer();<NEW_LINE>ServerSideEncryptionConfiguration sseConfig = setBucketEncryptionRequest.getServerSideEncryptionConfiguration();<NEW_LINE>ServerSideEncryptionByDefault sseByDefault = sseConfig.getApplyServerSideEncryptionByDefault();<NEW_LINE>xmlBody.append("<ServerSideEncryptionRule>");<NEW_LINE>xmlBody.append("<ApplyServerSideEncryptionByDefault>");<NEW_LINE>xmlBody.append("<SSEAlgorithm>" + sseByDefault.getSSEAlgorithm() + "</SSEAlgorithm>");<NEW_LINE>if (sseByDefault.getKMSMasterKeyID() != null) {<NEW_LINE>xmlBody.append("<KMSMasterKeyID>" + <MASK><NEW_LINE>} else {<NEW_LINE>xmlBody.append("<KMSMasterKeyID></KMSMasterKeyID>");<NEW_LINE>}<NEW_LINE>if (sseByDefault.getKMSDataEncryption() != null) {<NEW_LINE>xmlBody.append("<KMSDataEncryption>" + sseByDefault.getKMSDataEncryption() + "</KMSDataEncryption>");<NEW_LINE>}<NEW_LINE>xmlBody.append("</ApplyServerSideEncryptionByDefault>");<NEW_LINE>xmlBody.append("</ServerSideEncryptionRule>");<NEW_LINE>byte[] rawData = null;<NEW_LINE>try {<NEW_LINE>rawData = xmlBody.toString().getBytes(DEFAULT_CHARSET_NAME);<NEW_LINE>} catch (UnsupportedEncodingException e) {<NEW_LINE>throw new ClientException("Unsupported encoding " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>return rawData;<NEW_LINE>}
sseByDefault.getKMSMasterKeyID() + "</KMSMasterKeyID>");
1,172,414
public float[] computeLowerBarycenters(int upperLayerIndex) {<NEW_LINE>boolean[][] matrix = computeAdjacencyMatrix(upperLayerIndex);<NEW_LINE>List<Vertex<N>> upperLayer = layers.get(upperLayerIndex);<NEW_LINE>List<Vertex<N>> lowerLayer = layers.get(upperLayerIndex + 1);<NEW_LINE><MASK><NEW_LINE>int lowerLayerSize = lowerLayer.size();<NEW_LINE>float[] lowerBarycenters = new float[lowerLayerSize];<NEW_LINE>float[] barycenters = new float[lowerLayerSize];<NEW_LINE>for (int k = 0; k < lowerLayerSize; k++) {<NEW_LINE>float sum = 0;<NEW_LINE>float count = 0;<NEW_LINE>for (int j = 0; j < upperLayerSize; j++) {<NEW_LINE>if (matrix[j][k]) {<NEW_LINE>Vertex<N> jv = upperLayer.get(j);<NEW_LINE>sum += jv.getX();<NEW_LINE>count++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Vertex<N> kv = lowerLayer.get(k);<NEW_LINE>lowerBarycenters[k] = sum / count;<NEW_LINE>// System.out.println("kv = " + kv + " barycenter = " + lowerBarycenters[k]);<NEW_LINE>}<NEW_LINE>return lowerBarycenters;<NEW_LINE>}
int upperLayerSize = upperLayer.size();
993,039
protected String constructCommandUrl() throws CommandException {<NEW_LINE>String host = server.getHost();<NEW_LINE>boolean useAdminPort = !"false".equals(System.getProperty("payara.useadminport"));<NEW_LINE>int port = useAdminPort ? server.getAdminPort() : server.getPort();<NEW_LINE>String protocol = "http";<NEW_LINE>String url = server.getUrl();<NEW_LINE>String domainsDir = server.getDomainsFolder();<NEW_LINE>if (null == url) {<NEW_LINE>protocol = getHttpListenerProtocol(host, port, ":::" + command.getCommand() + "?" + query);<NEW_LINE>} else if (!(url.contains("ee6wc"))) {<NEW_LINE>protocol = getHttpListenerProtocol(host, port, url + ":::" + command.<MASK><NEW_LINE>} else if (url.contains("ee6wc") && (null == domainsDir || "".equals(domainsDir))) {<NEW_LINE>protocol = "https";<NEW_LINE>}<NEW_LINE>URI uri;<NEW_LINE>try {<NEW_LINE>uri = new URI(protocol, null, host, port, path + command.getCommand(), query, null);<NEW_LINE>} catch (URISyntaxException use) {<NEW_LINE>throw new CommandException(CommandException.RUNNER_HTTP_URL, use);<NEW_LINE>}<NEW_LINE>// These characters don't get handled by GF correctly. Best I can tell.<NEW_LINE>return uri.toASCIIString().replace("+", "%2b");<NEW_LINE>}
getCommand() + "?" + query);
725,839
public String encode() throws IOException {<NEW_LINE>try (FastStringWriter fsw = new FastStringWriter()) {<NEW_LINE>fsw.write("{");<NEW_LINE>fsw.write(super.encode());<NEW_LINE>ChartUtils.writeDataValue(fsw, "beginAtZero", this.beginAtZero, true);<NEW_LINE>ChartUtils.writeDataValue(fsw, "backdropColor", this.backdropColor, true);<NEW_LINE>ChartUtils.writeDataValue(fsw, "backdropPaddingX", this.backdropPaddingX, true);<NEW_LINE>ChartUtils.writeDataValue(fsw, "backdropPaddingY", this.backdropPaddingY, true);<NEW_LINE>ChartUtils.writeDataValue(fsw, "min", this.min, true);<NEW_LINE>ChartUtils.writeDataValue(fsw, "max", this.max, true);<NEW_LINE>ChartUtils.writeDataValue(fsw, <MASK><NEW_LINE>ChartUtils.writeDataValue(fsw, "stepSize", this.stepSize, true);<NEW_LINE>ChartUtils.writeDataValue(fsw, "showLabelBackdrop", this.showLabelBackdrop, true);<NEW_LINE>fsw.write("}");<NEW_LINE>return fsw.toString();<NEW_LINE>}<NEW_LINE>}
"maxTicksLimit", this.maxTicksLimit, true);
1,665,469
public static List<ChordDegree> createList(String str, ChordDegree dominant) {<NEW_LINE>List<ChordDegree> degrees = new ArrayList<>();<NEW_LINE>if ((str == null) || str.isEmpty()) {<NEW_LINE>return degrees;<NEW_LINE>}<NEW_LINE>// Loop on occurrences of the one-degree pattern<NEW_LINE>Matcher matcher = degPattern.matcher(str);<NEW_LINE>while (matcher.find()) {<NEW_LINE>// Deg value<NEW_LINE>String degStr = getGroup(matcher, DEG_VALUE);<NEW_LINE>final int deg = Integer.decode(degStr);<NEW_LINE>// Deg type: 'add' or 'alter'<NEW_LINE>// TODO: handle 'subtract' as well<NEW_LINE>final DegreeType type;<NEW_LINE>if ((dominant != null) && (dominant.value > deg)) {<NEW_LINE>type = DegreeType.ALTER;<NEW_LINE>} else if (deg <= 5) {<NEW_LINE>type = DegreeType.ALTER;<NEW_LINE>} else {<NEW_LINE>type = DegreeType.ADD;<NEW_LINE>}<NEW_LINE>// Deg alter<NEW_LINE>final String altStr = getGroup(matcher, DEG_ALTER);<NEW_LINE>final Integer <MASK><NEW_LINE>degrees.add(new ChordDegree(deg, alter, type, ""));<NEW_LINE>}<NEW_LINE>return degrees;<NEW_LINE>}
alter = Alter.toAlter(altStr);
33,467
public String ensureUser(String userName, String password, String firstName, String lastName, String email, Set<String> expectedRoles) {<NEW_LINE>User previousUser = null;<NEW_LINE>try {<NEW_LINE>previousUser = userService.load(userName);<NEW_LINE>if (previousUser == null || !previousUser.getRoleIds().containsAll(expectedRoles)) {<NEW_LINE>final String msg = "Invalid user '" + userName + "', fixing it.";<NEW_LINE>LOG.error(msg);<NEW_LINE>throw new IllegalArgumentException(msg);<NEW_LINE>}<NEW_LINE>} catch (IllegalArgumentException ignored) {<NEW_LINE>LOG.info("{} user is missing or invalid, re-adding it as a built-in user.", userName);<NEW_LINE>final User fixedUser;<NEW_LINE>if (previousUser != null) {<NEW_LINE>fixedUser = previousUser;<NEW_LINE>fixedUser.setRoleIds(expectedRoles);<NEW_LINE>} else {<NEW_LINE>fixedUser = userService.create();<NEW_LINE>fixedUser.setName(userName);<NEW_LINE>fixedUser.setFirstLastFullNames(firstName, lastName);<NEW_LINE>fixedUser.setPassword(password);<NEW_LINE>fixedUser.setEmail(email);<NEW_LINE>fixedUser.setPermissions(Collections.emptyList());<NEW_LINE>fixedUser.setRoleIds(expectedRoles);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>try {<NEW_LINE>return userService.save(fixedUser);<NEW_LINE>} catch (ValidationException e) {<NEW_LINE>LOG.error("Unable to save fixed '" + userName + "' user, please restart Graylog to fix this.", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (previousUser == null) {<NEW_LINE>LOG.error("Unable to access fixed '" + userName + "' user, please restart Graylog to fix this.");<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return previousUser.getId();<NEW_LINE>}
fixedUser.setTimeZone(DateTimeZone.UTC);
1,793,220
static long vp8_temporal_filter_find_matching_mb(Compressor cpi, YV12buffer arf_frame, YV12buffer frame_ptr, int mb_offset, int error_thresh) {<NEW_LINE>Macroblock x = cpi.mb;<NEW_LINE>long bestsme = Long.MAX_VALUE;<NEW_LINE>Block b = x.block.get();<NEW_LINE>BlockD d = x.e_mbd.block.get();<NEW_LINE>MV best_ref_mv1 = new MV();<NEW_LINE>MV best_ref_mv1_full = new MV();<NEW_LINE>FullAccessIntArrPointer base_src = b.base_src;<NEW_LINE>int src = b.src;<NEW_LINE>int src_stride = b.src_stride;<NEW_LINE>FullAccessIntArrPointer base_pre = x.e_mbd.pre.y_buffer.shallowCopy();<NEW_LINE><MASK><NEW_LINE>int pre_stride = x.e_mbd.pre.y_stride;<NEW_LINE>bestsme = x.hex.apply(x, false, cpi.fn_ptr.get(BlockEnum.BLOCK_16X16), best_ref_mv1_full, best_ref_mv1, d.bmi.mv);<NEW_LINE>bestsme = cpi.find_fractional_mv_step.call(x, b, d, d.bmi.mv, best_ref_mv1, x.errorperbit, cpi.fn_ptr.get(BlockEnum.BLOCK_16X16), null, res);<NEW_LINE>}
int pre = d.getOffset();
951,592
public MultipartPart call() throws BackgroundException {<NEW_LINE>overall.validate();<NEW_LINE>final TransferStatus status = new TransferStatus().withLength(length).withOffset(offset);<NEW_LINE>final Map<String, String> requestParameters = new HashMap<>();<NEW_LINE>requestParameters.put("uploadId", multipart.getUploadId());<NEW_LINE>requestParameters.put("partNumber", String.valueOf(partNumber));<NEW_LINE>status.setParameters(requestParameters);<NEW_LINE>status.setPart(partNumber);<NEW_LINE>status.<MASK><NEW_LINE>switch(session.getSignatureVersion()) {<NEW_LINE>case AWS4HMACSHA256:<NEW_LINE>status.setChecksum(writer.checksum(file, status).compute(local.getInputStream(), status));<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>status.setSegment(true);<NEW_LINE>final StorageObject part = S3MultipartUploadService.super.upload(file, local, throttle, counter, status, overall, status, callback);<NEW_LINE>if (log.isInfoEnabled()) {<NEW_LINE>log.info(String.format("Received response %s for part number %d", part, partNumber));<NEW_LINE>}<NEW_LINE>// Populate part with response data that is accessible via the object's metadata<NEW_LINE>return new MultipartPart(partNumber, null == part.getLastModifiedDate() ? new Date(System.currentTimeMillis()) : part.getLastModifiedDate(), null == part.getETag() ? StringUtils.EMPTY : part.getETag(), part.getContentLength());<NEW_LINE>}
setHeader(overall.getHeader());
966,036
protected void changeEquate(ProgramDB program, String address, int opIndex, long value, String newName) {<NEW_LINE>EquateTable equateTab = program.getEquateTable();<NEW_LINE>Address addr = addr(program, address);<NEW_LINE>Equate oldEquate = equateTab.getEquate(addr, opIndex, value);<NEW_LINE>if (oldEquate.getName().equals(newName)) {<NEW_LINE>Assert.fail("Equate '" + oldEquate.getName() + "' already exists with value=" + value + ".");<NEW_LINE>}<NEW_LINE>oldEquate.removeReference(addr, opIndex);<NEW_LINE>try {<NEW_LINE>Equate newEquate = equateTab.getEquate(newName);<NEW_LINE>if (newEquate == null) {<NEW_LINE>newEquate = equateTab.createEquate(newName, value);<NEW_LINE>}<NEW_LINE>if (newEquate.getValue() != value) {<NEW_LINE>Assert.fail("Can't create equate '" + newEquate.getName() + "' with value=" + value + ". It already exists with value=" + newEquate.getValue() + ".");<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>Assert.fail(e.getMessage());<NEW_LINE>}<NEW_LINE>}
newEquate.addReference(addr, opIndex);
602,946
public void add(URI uri, HttpCookie cookie) {<NEW_LINE>String name = getCookieToken(uri, cookie);<NEW_LINE>// Save cookie into local store, or remove if expired<NEW_LINE>if (!cookie.hasExpired()) {<NEW_LINE>if (!cookies.containsKey(uri.getHost()))<NEW_LINE>cookies.put(uri.getHost(), new ConcurrentHashMap<String, HttpCookie>());<NEW_LINE>cookies.get(uri.getHost()).put(name, cookie);<NEW_LINE>} else {<NEW_LINE>if (cookies.containsKey(uri.toString()))<NEW_LINE>cookies.get(uri.getHost()).remove(name);<NEW_LINE>}<NEW_LINE>// Save cookie into persistent store<NEW_LINE>SharedPreferences.Editor prefsWriter = cookiePrefs.edit();<NEW_LINE>prefsWriter.putString(uri.getHost(), TextUtils.join(",", cookies.get(uri.getHost(<MASK><NEW_LINE>prefsWriter.putString(COOKIE_NAME_PREFIX + name, encodeCookie(new SerializableHttpCookie(cookie)));<NEW_LINE>prefsWriter.apply();<NEW_LINE>}
)).keySet()));
692,628
public Object execute(CommandContext commandContext) {<NEW_LINE>ProcessDefinition processDefinition = CommandContextUtil.getProcessEngineConfiguration(commandContext).getDeploymentManager().findDeployedProcessDefinitionById(processDefinitionId);<NEW_LINE>if (processDefinition == null) {<NEW_LINE>throw new FlowableObjectNotFoundException("Process Definition '" + <MASK><NEW_LINE>}<NEW_LINE>if (Flowable5Util.isFlowable5ProcessDefinition(processDefinition, commandContext)) {<NEW_LINE>return Flowable5Util.getFlowable5CompatibilityHandler().getRenderedStartForm(processDefinitionId, formEngineName);<NEW_LINE>}<NEW_LINE>FormHandlerHelper formHandlerHelper = CommandContextUtil.getProcessEngineConfiguration(commandContext).getFormHandlerHelper();<NEW_LINE>StartFormHandler startFormHandler = formHandlerHelper.getStartFormHandler(commandContext, processDefinition);<NEW_LINE>if (startFormHandler == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>FormEngine formEngine = CommandContextUtil.getProcessEngineConfiguration(commandContext).getFormEngines().get(formEngineName);<NEW_LINE>if (formEngine == null) {<NEW_LINE>throw new FlowableException("No formEngine '" + formEngineName + "' defined process engine configuration");<NEW_LINE>}<NEW_LINE>StartFormData startForm = startFormHandler.createStartFormData(processDefinition);<NEW_LINE>return formEngine.renderStartForm(startForm);<NEW_LINE>}
processDefinitionId + "' not found", ProcessDefinition.class);
721,921
protected com.liferay.portal.model.PasswordTracker update(com.liferay.portal.model.PasswordTracker passwordTracker) throws SystemException {<NEW_LINE>Session session = null;<NEW_LINE>try {<NEW_LINE>if (passwordTracker.isNew() || passwordTracker.isModified()) {<NEW_LINE>session = openSession();<NEW_LINE>if (passwordTracker.isNew()) {<NEW_LINE>PasswordTrackerHBM passwordTrackerHBM = new PasswordTrackerHBM(passwordTracker.getPasswordTrackerId(), passwordTracker.getUserId(), passwordTracker.getCreateDate(), passwordTracker.getPassword());<NEW_LINE>session.save(passwordTrackerHBM);<NEW_LINE>session.flush();<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>PasswordTrackerHBM passwordTrackerHBM = (PasswordTrackerHBM) session.load(PasswordTrackerHBM.class, passwordTracker.getPrimaryKey());<NEW_LINE>passwordTrackerHBM.setUserId(passwordTracker.getUserId());<NEW_LINE>passwordTrackerHBM.<MASK><NEW_LINE>passwordTrackerHBM.setPassword(passwordTracker.getPassword());<NEW_LINE>session.flush();<NEW_LINE>} catch (ObjectNotFoundException onfe) {<NEW_LINE>PasswordTrackerHBM passwordTrackerHBM = new PasswordTrackerHBM(passwordTracker.getPasswordTrackerId(), passwordTracker.getUserId(), passwordTracker.getCreateDate(), passwordTracker.getPassword());<NEW_LINE>session.save(passwordTrackerHBM);<NEW_LINE>session.flush();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>passwordTracker.setNew(false);<NEW_LINE>passwordTracker.setModified(false);<NEW_LINE>passwordTracker.protect();<NEW_LINE>PasswordTrackerPool.remove(passwordTracker.getPrimaryKey());<NEW_LINE>PasswordTrackerPool.put(passwordTracker.getPrimaryKey(), passwordTracker);<NEW_LINE>}<NEW_LINE>return passwordTracker;<NEW_LINE>} catch (HibernateException he) {<NEW_LINE>throw new SystemException(he);<NEW_LINE>} finally {<NEW_LINE>HibernateUtil.closeSession(session);<NEW_LINE>}<NEW_LINE>}
setCreateDate(passwordTracker.getCreateDate());
1,497,567
private boolean notificationIsValidForUI(StatusBarNotification sbn) {<NEW_LINE>Notification notification = sbn.getNotification();<NEW_LINE>updateGroupKeyIfNecessary(sbn);<NEW_LINE>getCurrentRanking().getRanking(sbn.getKey(), mTempRanking);<NEW_LINE>if (!mTempRanking.canShowBadge()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (mTempRanking.getChannel().getId().equals(NotificationChannel.DEFAULT_CHANNEL_ID)) {<NEW_LINE>// Special filtering for the default, legacy "Miscellaneous" channel.<NEW_LINE>if ((notification.flags & Notification.FLAG_ONGOING_EVENT) != 0) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>CharSequence title = notification.<MASK><NEW_LINE>CharSequence text = notification.extras.getCharSequence(Notification.EXTRA_TEXT);<NEW_LINE>boolean missingTitleAndText = TextUtils.isEmpty(title) && TextUtils.isEmpty(text);<NEW_LINE>boolean isGroupHeader = (notification.flags & Notification.FLAG_GROUP_SUMMARY) != 0;<NEW_LINE>return !isGroupHeader && !missingTitleAndText;<NEW_LINE>}
extras.getCharSequence(Notification.EXTRA_TITLE);
559,065
default void emitEmpty(Sinks.EmitFailureHandler failureHandler) {<NEW_LINE>for (; ; ) {<NEW_LINE><MASK><NEW_LINE>if (emitResult.isSuccess()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>boolean shouldRetry = failureHandler.onEmitFailure(SignalType.ON_COMPLETE, emitResult);<NEW_LINE>if (shouldRetry) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>switch(emitResult) {<NEW_LINE>case FAIL_ZERO_SUBSCRIBER:<NEW_LINE>case FAIL_OVERFLOW:<NEW_LINE>case FAIL_CANCELLED:<NEW_LINE>case FAIL_TERMINATED:<NEW_LINE>return;<NEW_LINE>case FAIL_NON_SERIALIZED:<NEW_LINE>throw new EmissionException(emitResult, "Spec. Rule 1.3 - onSubscribe, onNext, onError and onComplete signaled to a Subscriber MUST be signaled serially.");<NEW_LINE>default:<NEW_LINE>throw new EmissionException(emitResult, "Unknown emitResult value");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
Sinks.EmitResult emitResult = tryEmitEmpty();
1,419,056
public void generateCode() throws FileNotFoundException {<NEW_LINE>printPreamble();<NEW_LINE>printAllOps(AutoTypeImage.F32, AutoTypeImage.F32, false);<NEW_LINE>// printAllOps(AutoTypeImage.F32, AutoTypeImage.F32, false, true);<NEW_LINE>printAllOps(AutoTypeImage.F64, AutoTypeImage.F64, false);<NEW_LINE>printAllOps(AutoTypeImage.<MASK><NEW_LINE>printAllOps(AutoTypeImage.U8, AutoTypeImage.S32, false);<NEW_LINE>printAllOps(AutoTypeImage.U16, AutoTypeImage.I8, true, true);<NEW_LINE>printAllOps(AutoTypeImage.S16, AutoTypeImage.I16, false);<NEW_LINE>printAllOps(AutoTypeImage.U8, AutoTypeImage.I8, true);<NEW_LINE>// printAllOps(AutoTypeImage.U8,AutoTypeImage.I8,false, true);<NEW_LINE>printAllOps(AutoTypeImage.S16, AutoTypeImage.I16, true);<NEW_LINE>printAllOps(AutoTypeImage.U16, AutoTypeImage.I16, false);<NEW_LINE>printAllOps(AutoTypeImage.U16, AutoTypeImage.I16, true);<NEW_LINE>printAllOps(AutoTypeImage.S32, AutoTypeImage.I16, true, true);<NEW_LINE>printAllOps(AutoTypeImage.S32, AutoTypeImage.S32, false);<NEW_LINE>printAllOps(AutoTypeImage.S32, AutoTypeImage.S32, true);<NEW_LINE>out.println("}");<NEW_LINE>}
U8, AutoTypeImage.I16, false);
708,349
public Request createKeetpaliveMessageRequest(ParentPlatform parentPlatform, String content, String viaTag, String fromTag, String toTag, CallIdHeader callIdHeader) throws ParseException, InvalidArgumentException, PeerUnavailableException {<NEW_LINE>Request request = null;<NEW_LINE>// sipuri<NEW_LINE>SipURI requestURI = sipFactory.createAddressFactory().createSipURI(parentPlatform.getServerGBId(), parentPlatform.getServerIP() + ":" + parentPlatform.getServerPort());<NEW_LINE>// via<NEW_LINE>ArrayList<ViaHeader> viaHeaders = new ArrayList<ViaHeader>();<NEW_LINE>ViaHeader viaHeader = sipFactory.createHeaderFactory().createViaHeader(sipConfig.getIp(), sipConfig.getPort(), parentPlatform.getTransport(), viaTag);<NEW_LINE>viaHeader.setRPort();<NEW_LINE>viaHeaders.add(viaHeader);<NEW_LINE>// from<NEW_LINE>SipURI fromSipURI = sipFactory.createAddressFactory().createSipURI(parentPlatform.getDeviceGBId(), sipConfig.getIp() + ":" + sipConfig.getPort());<NEW_LINE>Address fromAddress = sipFactory.createAddressFactory().createAddress(fromSipURI);<NEW_LINE>FromHeader fromHeader = sipFactory.createHeaderFactory().createFromHeader(fromAddress, fromTag);<NEW_LINE>// to<NEW_LINE>SipURI toSipURI = sipFactory.createAddressFactory().createSipURI(parentPlatform.getServerGBId(), parentPlatform.getServerIP() + ":" + parentPlatform.getServerPort());<NEW_LINE>Address toAddress = sipFactory.createAddressFactory().createAddress(toSipURI);<NEW_LINE>ToHeader toHeader = sipFactory.createHeaderFactory().createToHeader(toAddress, toTag);<NEW_LINE>// Forwards<NEW_LINE>MaxForwardsHeader maxForwards = sipFactory.createHeaderFactory().createMaxForwardsHeader(70);<NEW_LINE>// ceq<NEW_LINE>CSeqHeader cSeqHeader = sipFactory.createHeaderFactory().createCSeqHeader(redisCatchStorage.getCSEQ(Request.MESSAGE), Request.MESSAGE);<NEW_LINE>request = sipFactory.createMessageFactory().createRequest(requestURI, Request.MESSAGE, callIdHeader, cSeqHeader, fromHeader, toHeader, viaHeaders, maxForwards);<NEW_LINE>List<String> agentParam = new ArrayList<>();<NEW_LINE>agentParam.add("wvp-pro");<NEW_LINE>UserAgentHeader userAgentHeader = sipFactory.<MASK><NEW_LINE>request.addHeader(userAgentHeader);<NEW_LINE>ContentTypeHeader contentTypeHeader = sipFactory.createHeaderFactory().createContentTypeHeader("Application", "MANSCDP+xml");<NEW_LINE>request.setContent(content, contentTypeHeader);<NEW_LINE>return request;<NEW_LINE>}
createHeaderFactory().createUserAgentHeader(agentParam);
299,732
public static void main(String[] args) throws Exception {<NEW_LINE>if (args.length != 1) {<NEW_LINE>throw new RuntimeException("Please specify the name of the topology");<NEW_LINE>}<NEW_LINE>TopologyBuilder builder = new TopologyBuilder();<NEW_LINE>int parallelism = 2;<NEW_LINE>builder.setSpout("word", new AckingTestWordSpout(), parallelism);<NEW_LINE>builder.setBolt("exclaim1", new ExclamationBolt(true), parallelism).shuffleGrouping("word");<NEW_LINE>builder.setBolt("exclaim2", new ExclamationBolt(false), parallelism).shuffleGrouping("exclaim1");<NEW_LINE>Config conf = new Config();<NEW_LINE>conf.setDebug(true);<NEW_LINE>// Put an arbitrary large number here if you don't want to slow the topology down<NEW_LINE>conf.setMaxSpoutPending(1000 * 1000 * 1000);<NEW_LINE>// To enable acking, we need to setEnableAcking true<NEW_LINE>conf.setNumAckers(1);<NEW_LINE>conf.<MASK><NEW_LINE>conf.setNumWorkers(parallelism);<NEW_LINE>StormSubmitter.submitTopology(args[0], conf, builder.createTopology());<NEW_LINE>}
put(Config.TOPOLOGY_WORKER_CHILDOPTS, "-XX:+HeapDumpOnOutOfMemoryError");
158,120
public int compare(final Change o1, final Change o2) {<NEW_LINE>final FilePath filePath1 = ChangesUtil.getFilePath(o1);<NEW_LINE>final FilePath filePath2 = ChangesUtil.getFilePath(o2);<NEW_LINE>if (myTreeCompare) {<NEW_LINE>final String path1 = FileUtilRt.toSystemIndependentName(filePath1.getPath());<NEW_LINE>final String path2 = FileUtilRt.toSystemIndependentName(filePath2.getPath());<NEW_LINE>final int lastSlash1 = path1.lastIndexOf('/');<NEW_LINE>final String parentPath1 = lastSlash1 >= 0 && !filePath1.isDirectory() ? path1.substring(0, lastSlash1) : path1;<NEW_LINE>final int <MASK><NEW_LINE>final String parentPath2 = lastSlash2 >= 0 && !filePath2.isDirectory() ? path2.substring(0, lastSlash2) : path2;<NEW_LINE>// subdirs precede files<NEW_LINE>if (FileUtil.isAncestor(parentPath2, parentPath1, true)) {<NEW_LINE>return -1;<NEW_LINE>} else if (FileUtil.isAncestor(parentPath1, parentPath2, true)) {<NEW_LINE>return 1;<NEW_LINE>}<NEW_LINE>final int compare = StringUtil.compare(parentPath1, parentPath2, !SystemInfo.isFileSystemCaseSensitive);<NEW_LINE>if (compare != 0) {<NEW_LINE>return compare;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return filePath1.getName().compareToIgnoreCase(filePath2.getName());<NEW_LINE>}
lastSlash2 = path2.lastIndexOf('/');
1,547,138
public static TextView createItemTextView(Context context) {<NEW_LINE><MASK><NEW_LINE>TypedArray a = context.obtainStyledAttributes(null, R.styleable.QMUIDialogMenuTextStyleDef, R.attr.qmui_dialog_menu_item_style, 0);<NEW_LINE>int count = a.getIndexCount();<NEW_LINE>for (int i = 0; i < count; i++) {<NEW_LINE>int attr = a.getIndex(i);<NEW_LINE>if (attr == R.styleable.QMUIDialogMenuTextStyleDef_android_gravity) {<NEW_LINE>tv.setGravity(a.getInt(attr, -1));<NEW_LINE>} else if (attr == R.styleable.QMUIDialogMenuTextStyleDef_android_textColor) {<NEW_LINE>tv.setTextColor(a.getColorStateList(attr));<NEW_LINE>} else if (attr == R.styleable.QMUIDialogMenuTextStyleDef_android_textSize) {<NEW_LINE>tv.setTextSize(TypedValue.COMPLEX_UNIT_PX, a.getDimensionPixelSize(attr, 0));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>a.recycle();<NEW_LINE>tv.setId(View.generateViewId());<NEW_LINE>tv.setSingleLine(true);<NEW_LINE>tv.setEllipsize(TextUtils.TruncateAt.MIDDLE);<NEW_LINE>tv.setDuplicateParentStateEnabled(false);<NEW_LINE>QMUISkinValueBuilder builder = QMUISkinValueBuilder.acquire();<NEW_LINE>builder.textColor(R.attr.qmui_skin_support_dialog_menu_item_text_color);<NEW_LINE>QMUISkinHelper.setSkinValue(tv, builder);<NEW_LINE>QMUISkinValueBuilder.release(builder);<NEW_LINE>return tv;<NEW_LINE>}
TextView tv = new QMUISpanTouchFixTextView(context);
1,409,108
public Object apply(ActionContext ctx, Object caller, Object[] sources) throws FrameworkException {<NEW_LINE>assertArrayHasMinLengthAndAllElementsNotNull(sources, 1);<NEW_LINE>String baseUrl = null;<NEW_LINE>String userParameter = null;<NEW_LINE>Boolean runWithXserver = false;<NEW_LINE>String xServerSettings = null;<NEW_LINE>final String page = sources[0].toString();<NEW_LINE>if (sources.length >= 2) {<NEW_LINE>userParameter = sources[1].toString();<NEW_LINE>}<NEW_LINE>if (sources.length >= 3) {<NEW_LINE>baseUrl = sources[2].toString();<NEW_LINE>}<NEW_LINE>if (sources.length >= 4) {<NEW_LINE>runWithXserver = (Boolean) sources[3];<NEW_LINE>}<NEW_LINE>if (sources.length >= 5) {<NEW_LINE>xServerSettings = sources[4].toString();<NEW_LINE>}<NEW_LINE>if (baseUrl == null || baseUrl.length() == 0) {<NEW_LINE>baseUrl = ActionContext.getBaseUrl(ctx.getSecurityContext().getRequest()) + "/";<NEW_LINE>}<NEW_LINE>Principal currentUser = ctx.getSecurityContext().getUser(false);<NEW_LINE>List<Param> parameterList = new ArrayList<Param>();<NEW_LINE>if (currentUser instanceof SuperUser) {<NEW_LINE>parameterList.add(new Param("--custom-header X-User superadmin --custom-header X-Password " + Settings.SuperUserPassword.getValue()));<NEW_LINE>parameterList.add(new Param("--custom-header-propagation"));<NEW_LINE>} else {<NEW_LINE>final HttpSession session = ctx<MASK><NEW_LINE>final String sessionId = (session instanceof Session) ? ((Session) session).getExtendedId() : session.getId();<NEW_LINE>parameterList.add(new Param("--cookie JSESSIONID " + sessionId));<NEW_LINE>}<NEW_LINE>if (userParameter != null) {<NEW_LINE>parameterList.add(new Param(userParameter));<NEW_LINE>}<NEW_LINE>final ByteArrayOutputStream baos = new ByteArrayOutputStream();<NEW_LINE>try {<NEW_LINE>if (!runWithXserver) {<NEW_LINE>return convertPageToPdfWithoutXServer(baseUrl, page, parameterList, baos);<NEW_LINE>} else {<NEW_LINE>return convertPageToPdfWithXServer(baseUrl, page, parameterList, baos, xServerSettings);<NEW_LINE>}<NEW_LINE>} catch (final Throwable t) {<NEW_LINE>logger.warn("Could not convert page {}{} to pdf... retrying with xvfb...", baseUrl, page);<NEW_LINE>return convertPageToPdfWithXServer(baseUrl, page, parameterList, baos, xServerSettings);<NEW_LINE>}<NEW_LINE>}
.getSecurityContext().getSession();
1,693,361
public void bindView(View v, Context c, final Cursor cur) {<NEW_LINE>String listName = cur.getString(listNameColumn);<NEW_LINE>CheckableItem item = (CheckableItem) v.getTag();<NEW_LINE>String accountName = cur.getString(accountNameColumn);<NEW_LINE>String accountType = cur.getString(accountTypeColumn);<NEW_LINE>Model model = mSources.getModel(accountType);<NEW_LINE>if (model.hasEditActivity()) {<NEW_LINE>item.btnSettings.setVisibility(View.VISIBLE);<NEW_LINE>item.btnSettings.setTag(cur.getPosition());<NEW_LINE>item.btnSettings.setOnClickListener(this);<NEW_LINE>} else {<NEW_LINE>item.btnSettings.setVisibility(View.GONE);<NEW_LINE>item.btnSettings.setOnClickListener(null);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>item.text2.setText(accountName);<NEW_LINE>int listColor = cur.getInt(listColorColumn);<NEW_LINE>item.coloredCheckBox.setColor(listColor);<NEW_LINE>if (!cur.isNull(compareColumn)) {<NEW_LINE>long id = cur.getLong(0);<NEW_LINE>boolean checkValue;<NEW_LINE>if (savedPositions.containsKey(id)) {<NEW_LINE>checkValue = savedPositions.get(id);<NEW_LINE>} else {<NEW_LINE>checkValue = cur.getInt(compareColumn) == 1;<NEW_LINE>}<NEW_LINE>item.coloredCheckBox.setChecked(checkValue);<NEW_LINE>}<NEW_LINE>}
item.text1.setText(listName);
1,112,919
private boolean createVTT(Namespace classNamespace, Address address) throws Exception {<NEW_LINE>// get pointer at address<NEW_LINE>Address pointer = getPointerToDefinedMemory(address);<NEW_LINE>if (pointer == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// check if pointer is to the class vftable or to a class internal vtable or to itself<NEW_LINE>// if not one of those things it isn't a VTT<NEW_LINE>Symbol symbol = symbolTable.getPrimarySymbol(pointer);<NEW_LINE>if ((!symbol.getName().equals(VFTABLE_LABEL) || !symbol.getName().contains("internal_vtable")) && !symbol.getParentNamespace().equals(classNamespace) && !pointer.equals(address)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// if it is then create the VTT symbol and create pointer there<NEW_LINE>symbolTable.createLabel(address, "VTT", classNamespace, SourceType.ANALYSIS);<NEW_LINE>DataType nullPointer = dataTypeManager.getPointer(null);<NEW_LINE>try {<NEW_LINE>api.createData(pointer, nullPointer);<NEW_LINE>} catch (Exception e) {<NEW_LINE>// already data there so don't try and overwrite it<NEW_LINE>}<NEW_LINE>api.setPlateComment(address, "VTT for " <MASK><NEW_LINE>return true;<NEW_LINE>}
+ classNamespace.getName(true));
248,949
private void buildPreliminaryGraphs(Program program, MethodDependencyInfo thisMethodDep) {<NEW_LINE>GraphBuildingVisitor visitor = new GraphBuildingVisitor(program.variableCount(), dependencyInfo);<NEW_LINE>visitor.thisMethodDep = thisMethodDep;<NEW_LINE>for (BasicBlock block : program.getBasicBlocks()) {<NEW_LINE>visitor.currentBlock = block;<NEW_LINE>for (Phi phi : block.getPhis()) {<NEW_LINE>visitor.visit(phi);<NEW_LINE>}<NEW_LINE>for (Instruction insn : block) {<NEW_LINE>insn.acceptVisitor(visitor);<NEW_LINE>}<NEW_LINE>if (block.getExceptionVariable() != null) {<NEW_LINE>getNodeTypes(packNodeAndDegree(block.getExceptionVariable().getIndex(), 0));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>assignmentGraph = visitor.assignmentGraphBuilder.build();<NEW_LINE>cloneGraph = visitor.cloneGraphBuilder.build();<NEW_LINE>arrayGraph <MASK><NEW_LINE>itemGraph = visitor.itemGraphBuilder.build();<NEW_LINE>casts = visitor.casts.toArray(new ValueCast[0]);<NEW_LINE>exceptions = visitor.exceptions.getAll();<NEW_LINE>virtualCallSites = visitor.virtualCallSites.toArray(new VirtualCallSite[0]);<NEW_LINE>GraphBuilder arrayAssignmentGraphBuilder = new GraphBuilder(assignmentGraph.size());<NEW_LINE>for (int i = 0; i < assignmentGraph.size(); ++i) {<NEW_LINE>for (int j : assignmentGraph.outgoingEdges(i)) {<NEW_LINE>arrayAssignmentGraphBuilder.addEdge(i, j);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (ValueCast cast : casts) {<NEW_LINE>arrayAssignmentGraphBuilder.addEdge(cast.fromVariable, cast.toVariable);<NEW_LINE>}<NEW_LINE>arrayDataAssignmentGraph = arrayAssignmentGraphBuilder.build();<NEW_LINE>}
= visitor.arrayGraphBuilder.build();
1,282,732
static void appendNumericEntity(int codepoint, Appendable output) throws IOException {<NEW_LINE>output.append("&#");<NEW_LINE>if (codepoint < 100) {<NEW_LINE>// TODO: is this dead code due to REPLACEMENTS above.<NEW_LINE>if (codepoint < 10) {<NEW_LINE>output.append((char) ('0' + codepoint));<NEW_LINE>} else {<NEW_LINE>output.append((char) ('0' + (codepoint / 10)));<NEW_LINE>output.append((char) ('0' + (codepoint % 10)));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>int nDigits = (codepoint < 0x1000 ? codepoint < 0x100 ? 2 : 3 : (codepoint < 0x10000 ? 4 : codepoint < 0x100000 ? 5 : 6));<NEW_LINE>output.append('x');<NEW_LINE>for (int digit = nDigits; --digit >= 0; ) {<NEW_LINE>int hexDigit = (codepoint >>> (digit << 2)) & 0xf;<NEW_LINE>output<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>output.append(";");<NEW_LINE>}
.append(HEX_NUMERAL[hexDigit]);
502,671
/*<NEW_LINE>* (non-Javadoc)<NEW_LINE>* @see freeplane.io.INodeWriter#saveContent(freeplane.io.ITreeWriter,<NEW_LINE>* java.lang.Object, java.lang.String)<NEW_LINE>*/<NEW_LINE>public void writeContent(final ITreeWriter writer, final Object node, final IExtension extension) throws IOException {<NEW_LINE>DetailModel details = (DetailModel) extension;<NEW_LINE>final XMLElement element = new XMLElement();<NEW_LINE>element.setName(NodeTextBuilder.XML_NODE_RICHCONTENT_TAG);<NEW_LINE>String transformedXhtml = "";<NEW_LINE>final boolean forceFormatting = Boolean.TRUE.equals(writer.getHint(MapWriter.WriterHint.FORCE_FORMATTING));<NEW_LINE>if (forceFormatting) {<NEW_LINE><MASK><NEW_LINE>if (data != null) {<NEW_LINE>final Object transformed = TextController.getController().getTransformedObjectNoFormattingNoThrow((NodeModel) node, details, data);<NEW_LINE>if (!transformed.equals(data)) {<NEW_LINE>String transformedHtml = HtmlUtils.objectToHtml(transformed);<NEW_LINE>transformedXhtml = HtmlUtils.toXhtml(transformedHtml);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>boolean containsXml = transformedXhtml.isEmpty() && details.getXml() != null;<NEW_LINE>String contentType = details.getContentType();<NEW_LINE>ContentSyntax contentSyntax = containsXml ? ContentSyntax.XML : ContentSyntax.PLAIN;<NEW_LINE>element.setAttribute(NodeTextBuilder.XML_RICHCONTENT_CONTENT_TYPE_ATTRIBUTE, contentSyntax.with(contentType));<NEW_LINE>element.setAttribute(NodeTextBuilder.XML_RICHCONTENT_TYPE_ATTRIBUTE, NodeTextBuilder.XML_RICHCONTENT_TYPE_DETAILS);<NEW_LINE>if (details.isHidden()) {<NEW_LINE>element.setAttribute("HIDDEN", "true");<NEW_LINE>}<NEW_LINE>if (containsXml) {<NEW_LINE>final String content = details.getXml().replace('\0', ' ');<NEW_LINE>writer.addElement(content, element);<NEW_LINE>} else {<NEW_LINE>String text = details.getText();<NEW_LINE>if (text != null) {<NEW_LINE>XMLElement textElement = element.createElement(TEXT_ELEMENT);<NEW_LINE>textElement.setContent(HtmlUtils.htmlToPlain(text));<NEW_LINE>element.addChild(textElement);<NEW_LINE>}<NEW_LINE>writer.addElement(transformedXhtml, element);<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}
String data = details.getText();
815,930
private Optional<ByteBuf> decode(ByteBuf buffer) {<NEW_LINE>if (bytesToDiscard > 0) {<NEW_LINE>discardTooLongFrame(buffer);<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>int initialReaderIndex = buffer.readerIndex();<NEW_LINE>if (buffer.readableBytes() < Integer.BYTES) {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>long frameSizeInBytes = buffer.readUnsignedInt();<NEW_LINE>if (frameSizeInBytes > maxFrameSizeInBytes) {<NEW_LINE>// this invocation doesn't move the readerIndex<NEW_LINE>Optional<FrameInfo> frameInfo = frameInfoDecoder.tryDecodeFrameInfo(buffer);<NEW_LINE>if (frameInfo.isPresent()) {<NEW_LINE>tooLongFrameInfo = frameInfo;<NEW_LINE>tooLongFrameSizeInBytes = frameSizeInBytes;<NEW_LINE>bytesToDiscard = frameSizeInBytes;<NEW_LINE>discardTooLongFrame(buffer);<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>// Basic frame info cannot be decoded and the max frame size is already exceeded.<NEW_LINE>// Instead of waiting forever, fail without providing the sequence ID.<NEW_LINE>if (buffer.readableBytes() >= maxFrameSizeInBytes) {<NEW_LINE>tooLongFrameInfo = Optional.empty();<NEW_LINE>tooLongFrameSizeInBytes = frameSizeInBytes;<NEW_LINE>bytesToDiscard = frameSizeInBytes;<NEW_LINE>discardTooLongFrame(buffer);<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>buffer.readerIndex(initialReaderIndex);<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>if (buffer.readableBytes() >= frameSizeInBytes) {<NEW_LINE>// toIntExact must be safe, as frameSizeInBytes <= maxFrameSize<NEW_LINE>ByteBuf frame = buffer.retainedSlice(buffer.readerIndex<MASK><NEW_LINE>buffer.readerIndex(buffer.readerIndex() + toIntExact(frameSizeInBytes));<NEW_LINE>return Optional.of(frame);<NEW_LINE>}<NEW_LINE>buffer.readerIndex(initialReaderIndex);<NEW_LINE>return Optional.empty();<NEW_LINE>}
(), toIntExact(frameSizeInBytes));
1,013,228
private boolean placeAnchor(BlockPos pos) {<NEW_LINE>Vec3d eyesPos = RotationUtils.getEyesPos();<NEW_LINE>double rangeSq = Math.pow(range.getValue(), 2);<NEW_LINE>Vec3d <MASK><NEW_LINE>double distanceSqPosVec = eyesPos.squaredDistanceTo(posVec);<NEW_LINE>for (Direction side : Direction.values()) {<NEW_LINE>BlockPos neighbor = pos.offset(side);<NEW_LINE>// check if neighbor can be right clicked<NEW_LINE>if (!isClickableNeighbor(neighbor))<NEW_LINE>continue;<NEW_LINE>Vec3d dirVec = Vec3d.of(side.getVector());<NEW_LINE>Vec3d hitVec = posVec.add(dirVec.multiply(0.5));<NEW_LINE>// check if hitVec is within range<NEW_LINE>if (eyesPos.squaredDistanceTo(hitVec) > rangeSq)<NEW_LINE>continue;<NEW_LINE>// check if side is visible (facing away from player)<NEW_LINE>if (distanceSqPosVec > eyesPos.squaredDistanceTo(posVec.add(dirVec)))<NEW_LINE>continue;<NEW_LINE>if (checkLOS.isChecked() && MC.world.raycast(new RaycastContext(eyesPos, hitVec, RaycastContext.ShapeType.COLLIDER, RaycastContext.FluidHandling.NONE, MC.player)).getType() != HitResult.Type.MISS)<NEW_LINE>continue;<NEW_LINE>if (!selectItem(item -> item == Items.RESPAWN_ANCHOR))<NEW_LINE>return false;<NEW_LINE>faceBlocks.getSelected().face(hitVec);<NEW_LINE>// place block<NEW_LINE>IMC.getInteractionManager().rightClickBlock(neighbor, side.getOpposite(), hitVec);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
posVec = Vec3d.ofCenter(pos);