idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
665
public static void main(String[] args) {<NEW_LINE>Exercise36_Neighbors neighbors = new Exercise36_Neighbors();<NEW_LINE>EdgeWeightedDigraph edgeWeightedDigraph1 = new EdgeWeightedDigraph(4);<NEW_LINE>edgeWeightedDigraph1.addEdge(new DirectedEdge(0, 1, 20));<NEW_LINE>edgeWeightedDigraph1.addEdge(new DirectedEdge(0, 2, 5));<NEW_LINE>edgeWeightedDigraph1.addEdge(new DirectedEdge(2, 1, 1));<NEW_LINE>edgeWeightedDigraph1.addEdge(new DirectedEdge(1, 3, 10));<NEW_LINE>int maxDistance1 = 20;<NEW_LINE>DijkstraSPMaxDistance dijkstraSPMaxDistance1 = neighbors.new DijkstraSPMaxDistance(edgeWeightedDigraph1, 0, maxDistance1);<NEW_LINE>StdOut.println("Vertices within distance 20 from digraph 1:");<NEW_LINE>for (int vertex : dijkstraSPMaxDistance1.verticesWithinMaxDistance().keys()) {<NEW_LINE>StdOut.print(vertex + " ");<NEW_LINE>}<NEW_LINE>StdOut.println("\nExpected: 0 1 2 3");<NEW_LINE>EdgeWeightedDigraph edgeWeightedDigraph2 = new EdgeWeightedDigraph(8);<NEW_LINE>edgeWeightedDigraph2.addEdge(new DirectedEdge(0, 1, 5));<NEW_LINE>edgeWeightedDigraph2.addEdge(new DirectedEdge(1, 3, 2));<NEW_LINE>edgeWeightedDigraph2.addEdge(new DirectedEdge(3, 5, 3));<NEW_LINE>edgeWeightedDigraph2.addEdge(new DirectedEdge<MASK><NEW_LINE>edgeWeightedDigraph2.addEdge(new DirectedEdge(0, 2, 9));<NEW_LINE>edgeWeightedDigraph2.addEdge(new DirectedEdge(2, 3, 2));<NEW_LINE>edgeWeightedDigraph2.addEdge(new DirectedEdge(2, 4, 3));<NEW_LINE>edgeWeightedDigraph2.addEdge(new DirectedEdge(4, 7, 1));<NEW_LINE>int maxDistance2 = 10;<NEW_LINE>DijkstraSPMaxDistance dijkstraSPMaxDistance2 = neighbors.new DijkstraSPMaxDistance(edgeWeightedDigraph2, 0, maxDistance2);<NEW_LINE>StdOut.println("\nVertices within distance 10 from digraph 2:");<NEW_LINE>for (int vertex : dijkstraSPMaxDistance2.verticesWithinMaxDistance().keys()) {<NEW_LINE>StdOut.print(vertex + " ");<NEW_LINE>}<NEW_LINE>StdOut.println("\nExpected: 0 1 2 3 5");<NEW_LINE>}
(5, 6, 1));
131,571
private void send(List<String> metricLines) {<NEW_LINE>String endpoint = config.uri();<NEW_LINE>if (!isValidEndpoint(endpoint)) {<NEW_LINE>logger.warn("Invalid endpoint, skipping export... ({})", endpoint);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>logger.debug("Sending {} lines to {}", metricLines.size(), endpoint);<NEW_LINE>String body = String.join("\n", metricLines);<NEW_LINE>logger.debug("Sending lines:\n{}", body);<NEW_LINE>HttpSender.Request.Builder requestBuilder = httpClient.post(endpoint);<NEW_LINE>if (!shouldIgnoreToken(config)) {<NEW_LINE>requestBuilder.withHeader("Authorization", "Api-Token " + config.apiToken());<NEW_LINE>}<NEW_LINE>requestBuilder.withHeader("User-Agent", "micrometer").withPlainText(body).send().onSuccess(response -> handleSuccess(metricLines.size(), response)).onError(response -> logger.error("Failed metric ingestion: Error Code={}, Response Body={}", response.code(), response.body()));<NEW_LINE>} catch (Throwable throwable) {<NEW_LINE>logger.error("Failed metric ingestion: " + <MASK><NEW_LINE>}<NEW_LINE>}
throwable.getMessage(), throwable);
1,620,456
private void writeRequest(CounterRequest childRequest, float executionsByRequest, boolean allChildHitsDisplayed) throws IOException, DocumentException {<NEW_LINE>final PdfPCell defaultCell = getDefaultCell();<NEW_LINE><MASK><NEW_LINE>final Paragraph paragraph = new Paragraph(defaultCell.getLeading() + cellFont.getSize());<NEW_LINE>if (executionsByRequest != -1) {<NEW_LINE>paragraph.setIndentationLeft(5);<NEW_LINE>}<NEW_LINE>final Counter parentCounter = getCounterByRequestId(childRequest);<NEW_LINE>if (parentCounter != null && parentCounter.getIconName() != null) {<NEW_LINE>paragraph.add(new Chunk(getSmallImage(parentCounter.getIconName()), 0, -1));<NEW_LINE>}<NEW_LINE>paragraph.add(new Phrase(childRequest.getName(), cellFont));<NEW_LINE>final PdfPCell requestCell = new PdfPCell();<NEW_LINE>requestCell.addElement(paragraph);<NEW_LINE>requestCell.setGrayFill(defaultCell.getGrayFill());<NEW_LINE>requestCell.setPaddingTop(defaultCell.getPaddingTop());<NEW_LINE>addCell(requestCell);<NEW_LINE>defaultCell.setHorizontalAlignment(Element.ALIGN_RIGHT);<NEW_LINE>if (executionsByRequest != -1) {<NEW_LINE>addCell(nbExecutionsFormat.format(executionsByRequest));<NEW_LINE>} else {<NEW_LINE>final boolean hasChildren = !request.getChildRequestsExecutionsByRequestId().isEmpty();<NEW_LINE>if (hasChildren) {<NEW_LINE>addCell("");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>writeRequestValues(childRequest, allChildHitsDisplayed);<NEW_LINE>}
defaultCell.setHorizontalAlignment(Element.ALIGN_LEFT);
30,578
public static Vec3 lookAt(Vec3 vec, Vec3 fwd) {<NEW_LINE>fwd = fwd.normalize();<NEW_LINE>Vec3 up = new Vec3(0, 1, 0);<NEW_LINE>double dot = fwd.dot(up);<NEW_LINE>if (Math.abs(dot) > 1 - 1.0E-3)<NEW_LINE>up = new Vec3(0, 0, dot > 0 ? 1 : -1);<NEW_LINE>Vec3 right = fwd.cross(up).normalize();<NEW_LINE>up = right.cross(fwd).normalize();<NEW_LINE>double x = vec.x * right.x + vec.y * up.x <MASK><NEW_LINE>double y = vec.x * right.y + vec.y * up.y + vec.z * fwd.y;<NEW_LINE>double z = vec.x * right.z + vec.y * up.z + vec.z * fwd.z;<NEW_LINE>return new Vec3(x, y, z);<NEW_LINE>}
+ vec.z * fwd.x;
664,543
private Map<String, Object> convertToMap(String pid) throws IOException {<NEW_LINE>Map<String, Object> map = new HashMap<String, Object>();<NEW_LINE>try {<NEW_LINE>Configuration[] configs = configAdmin.listConfigurations("(" + Constants.<MASK><NEW_LINE>if (configs != null && configs.length != 0) {<NEW_LINE>Configuration config = configAdmin.getConfiguration(pid);<NEW_LINE>Dictionary<String, Object> dictionary = config.getProperties();<NEW_LINE>if (dictionary != null) {<NEW_LINE>// convert Dictionary to Map<NEW_LINE>Enumeration<String> keys = dictionary.keys();<NEW_LINE>while (keys.hasMoreElements()) {<NEW_LINE>String strKey = keys.nextElement();<NEW_LINE>map.put(strKey, dictionary.get(strKey));<NEW_LINE>}<NEW_LINE>return map;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (InvalidSyntaxException e) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(tc, "Syntax error accesssing configuration for pid " + pid + ": " + e.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(tc, "No configuration for pid " + pid);<NEW_LINE>}<NEW_LINE>return map;<NEW_LINE>}
SERVICE_PID + "=" + pid + ")");
837,903
private boolean execNotifyApplicationReady(CallbackContext callbackContext) {<NEW_LINE>if (this.codePushPackageManager.isBinaryFirstRun()) {<NEW_LINE>// Report first run of a binary version app<NEW_LINE>this.codePushPackageManager.saveBinaryFirstRunFlag();<NEW_LINE>try {<NEW_LINE>String appVersion = Utilities.getAppVersionName(cordova.getActivity());<NEW_LINE>codePushReportingManager.reportStatus(new StatusReport(ReportingStatus.STORE_VERSION, null, appVersion, mainWebView.getPreferences().getString(DEPLOYMENT_KEY_PREFERENCE, null)), this.mainWebView);<NEW_LINE>} catch (PackageManager.NameNotFoundException e) {<NEW_LINE>// Should not happen unless the appVersion is not specified, in which case we can't report anything anyway.<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>} else if (this.codePushPackageManager.installNeedsConfirmation()) {<NEW_LINE>// Report CodePush update installation that has not been confirmed yet<NEW_LINE>CodePushPackageMetadata currentMetadata = this.codePushPackageManager.getCurrentPackageMetadata();<NEW_LINE>codePushReportingManager.reportStatus(new StatusReport(ReportingStatus.UPDATE_CONFIRMED, currentMetadata.label, currentMetadata.appVersion, currentMetadata.deploymentKey), this.mainWebView);<NEW_LINE>} else if (rollbackStatusReport != null) {<NEW_LINE>// Report a CodePush update that has been rolled back<NEW_LINE>codePushReportingManager.reportStatus(rollbackStatusReport, this.mainWebView);<NEW_LINE>rollbackStatusReport = null;<NEW_LINE>} else if (codePushReportingManager.hasFailedReport()) {<NEW_LINE>// Previous status report failed, so try it again<NEW_LINE>codePushReportingManager.reportStatus(codePushReportingManager.<MASK><NEW_LINE>}<NEW_LINE>// Mark the update as confirmed and not requiring a rollback<NEW_LINE>this.codePushPackageManager.clearInstallNeedsConfirmation();<NEW_LINE>this.cleanOldPackageSilently();<NEW_LINE>callbackContext.success();<NEW_LINE>return true;<NEW_LINE>}
getAndClearFailedReport(), this.mainWebView);
322,208
public void unlock(Object lockName, Locker locker) {<NEW_LINE>synchronized (lockTable) {<NEW_LINE>Object <MASK><NEW_LINE>if (o == null || o == locker) {<NEW_LINE>// ----------------------------------------------------------<NEW_LINE>// Fastpath: no conflicts, the given locker was only holder,<NEW_LINE>// nothing to do.<NEW_LINE>// ----------------------------------------------------------<NEW_LINE>} else {<NEW_LINE>// --------------------------------------------------<NEW_LINE>// Conflict: the lock table entry must be an actual<NEW_LINE>// lock instance or an error has occurred.<NEW_LINE>// --------------------------------------------------<NEW_LINE>Lock theLock = (Lock) o;<NEW_LINE>if (theLock.release(locker) != 0) {<NEW_LINE>lockTable.put(lockName, theLock);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(tc, "lock released", new Object[] { lockName, locker });<NEW_LINE>}<NEW_LINE>}
o = lockTable.remove(lockName);
1,327,903
public boolean safePowerOff(int shutdownWaitMs) throws Exception {<NEW_LINE>if (getResetSafePowerState() == VirtualMachinePowerState.POWERED_OFF)<NEW_LINE>return true;<NEW_LINE>if (isVMwareToolsRunning()) {<NEW_LINE>try {<NEW_LINE>String vmName = getName();<NEW_LINE>s_logger.info("Try gracefully shut down VM " + vmName);<NEW_LINE>shutdown();<NEW_LINE><MASK><NEW_LINE>while (getResetSafePowerState() != VirtualMachinePowerState.POWERED_OFF && System.currentTimeMillis() - startTick < shutdownWaitMs) {<NEW_LINE>try {<NEW_LINE>Thread.sleep(1000);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>s_logger.debug("[ignored] interrupted while powering of vm.");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (getResetSafePowerState() != VirtualMachinePowerState.POWERED_OFF) {<NEW_LINE>s_logger.info("can not gracefully shutdown VM within " + (shutdownWaitMs / 1000) + " seconds, we will perform force power off on VM " + vmName);<NEW_LINE>return powerOffNoCheck();<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} catch (Exception e) {<NEW_LINE>s_logger.warn("Failed to do guest-os graceful shutdown due to " + VmwareHelper.getExceptionMessage(e));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return powerOffNoCheck();<NEW_LINE>}
long startTick = System.currentTimeMillis();
1,530,801
public boolean contains(Object candidateObject) {<NEW_LINE>if (candidateObject == null) {<NEW_LINE>// System.out.println("NonIntern: Candidate [ " + candidateObject + " ] [ false (null) ]");<NEW_LINE>return false;<NEW_LINE>} else if (!(candidateObject instanceof String)) {<NEW_LINE>// System.out.println("NonIntern: Candidate [ " + candidateObject + " ] [ false (non-string) ]");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>String candidateString = (String) candidateObject;<NEW_LINE>String i_candidateString = internMap.<MASK><NEW_LINE>if (i_candidateString == null) {<NEW_LINE>// System.out.println("NonIntern: Candidate [ " + candidateObject + " ] [ false (not interned) ]");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>boolean result = base.contains(i_candidateString);<NEW_LINE>// System.out.println("NonIntern: Candidate [ " + candidateObject + " ] [ " + result + " (of " + base.size() + " elements) ]");<NEW_LINE>return result;<NEW_LINE>}
intern(candidateString, Util_InternMap.DO_NOT_FORCE);
81,904
public Request decodeRequest(Object packet) throws Exception {<NEW_LINE>Request request = new RpcRequest();<NEW_LINE>DubboPacket dubboPacket = (DubboPacket) packet;<NEW_LINE>request.setCorrelationId(dubboPacket.getHeader().getCorrelationId());<NEW_LINE>// check if it is heartbeat request<NEW_LINE>byte flag = dubboPacket.getHeader().getFlag();<NEW_LINE>if ((flag & DubboConstants.FLAG_EVENT) != 0) {<NEW_LINE>Object bodyObject = DubboPacket.decodeEventBody(dubboPacket.getBodyBuf());<NEW_LINE>if (bodyObject == DubboConstants.HEARTBEAT_EVENT) {<NEW_LINE>request.setHeartbeat(true);<NEW_LINE>} else {<NEW_LINE>throw new RpcException("request body not null for event");<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>DubboRequestBody dubboRequestBody = DubboRequestBody.decodeRequestBody(dubboPacket.getBodyBuf());<NEW_LINE>request.setArgs(dubboRequestBody.getArguments());<NEW_LINE>request.setMethodName(dubboRequestBody.getPath());<NEW_LINE>request.setRpcMethodInfo(dubboRequestBody.getRpcMethodInfo());<NEW_LINE>request.setTarget(dubboRequestBody.getRpcMethodInfo().getTarget());<NEW_LINE>request.setTargetMethod(dubboRequestBody.getRpcMethodInfo().getMethod());<NEW_LINE>if (dubboRequestBody.getAttachments().size() > 0) {<NEW_LINE>Map<String, Object> attachments = new HashMap<String, Object>(dubboRequestBody.getAttachments().size());<NEW_LINE>for (Map.Entry<String, String> entry : dubboRequestBody.getAttachments().entrySet()) {<NEW_LINE>attachments.put(entry.getKey(<MASK><NEW_LINE>}<NEW_LINE>request.setKvAttachment(attachments);<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.error("dubbo decodeRequest error at {} ", e.getMessage(), e);<NEW_LINE>throw new RpcException("dubbo decodeRequest error", e);<NEW_LINE>}<NEW_LINE>}
), entry.getValue());
752,331
public static int createTopicIfNotExists(String topic, short replicationFactor, double partitionToBrokerRatio, int minPartitionNum, Properties topicConfig, AdminClient adminClient) throws ExecutionException, InterruptedException {<NEW_LINE>try {<NEW_LINE>if (adminClient.listTopics().names().get().contains(topic)) {<NEW_LINE>LOG.info("AdminClient indicates that topic {} already exists in the cluster. Topic config: {}", topic, topicConfig);<NEW_LINE>return getPartitionNumForTopic(adminClient, topic);<NEW_LINE>}<NEW_LINE>int brokerCount = Utils.getBrokerCount(adminClient);<NEW_LINE>int partitionCount = Math.max((int) Math.ceil(brokerCount * partitionToBrokerRatio), minPartitionNum);<NEW_LINE>try {<NEW_LINE>NewTopic newTopic = new NewTopic(topic, partitionCount, replicationFactor);<NEW_LINE>// noinspection rawtypes<NEW_LINE>newTopic.configs((Map) topicConfig);<NEW_LINE>List<NewTopic> topics = new ArrayList<>();<NEW_LINE>topics.add(newTopic);<NEW_LINE>CreateTopicsResult result = adminClient.createTopics(topics);<NEW_LINE>// waits for this topic creation future to complete, and then returns its result.<NEW_LINE>result.values().get(topic).get();<NEW_LINE>LOG.info(<MASK><NEW_LINE>} catch (TopicExistsException e) {
"CreateTopicsResult: {}.", result.values());
1,125,627
protected static float A_safe(int x, int y, GrayF32 flow) {<NEW_LINE>float u0 = safe(x - 1, y, flow);<NEW_LINE>float u1 = safe(<MASK><NEW_LINE>float u2 = safe(x, y - 1, flow);<NEW_LINE>float u3 = safe(x, y + 1, flow);<NEW_LINE>float u4 = safe(x - 1, y - 1, flow);<NEW_LINE>float u5 = safe(x + 1, y - 1, flow);<NEW_LINE>float u6 = safe(x - 1, y + 1, flow);<NEW_LINE>float u7 = safe(x + 1, y + 1, flow);<NEW_LINE>return (1.0f / 6.0f) * (u0 + u1 + u2 + u3) + (1.0f / 12.0f) * (u4 + u5 + u6 + u7);<NEW_LINE>}
x + 1, y, flow);
1,853,072
public static String parseTranslation(final String adLanguage, final String text) {<NEW_LINE>if (text == null || text.length() == 0) {<NEW_LINE>return text;<NEW_LINE>}<NEW_LINE>String inStr = text;<NEW_LINE>String token;<NEW_LINE>final StringBuilder outStr = new StringBuilder();<NEW_LINE>int i = inStr.indexOf('@');<NEW_LINE>while (i != -1) {<NEW_LINE>// up to @<NEW_LINE>outStr.append(inStr.substring(0, i));<NEW_LINE>// from first @<NEW_LINE>inStr = inStr.substring(i + 1, inStr.length());<NEW_LINE>// next @<NEW_LINE>final int j = inStr.indexOf('@');<NEW_LINE>if (// no second tag<NEW_LINE>j < 0) {<NEW_LINE>inStr = "@" + inStr;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>token = inStr.substring(0, j);<NEW_LINE>// metas: begin: "@@" shall be interpretated as "@"<NEW_LINE>if (token.isEmpty()) {<NEW_LINE>outStr.append("@");<NEW_LINE>} else {<NEW_LINE>// metas: end<NEW_LINE>// replace context<NEW_LINE>outStr.append<MASK><NEW_LINE>}<NEW_LINE>// from second @<NEW_LINE>inStr = inStr.substring(j + 1, inStr.length());<NEW_LINE>i = inStr.indexOf('@');<NEW_LINE>}<NEW_LINE>// add remainder<NEW_LINE>outStr.append(inStr);<NEW_LINE>return outStr.toString();<NEW_LINE>}
(translate(adLanguage, token));
974,985
private void validateLayouts() {<NEW_LINE>new Thread(() -> {<NEW_LINE>int n = 0;<NEW_LINE>int total = layouts.size() * 4;<NEW_LINE>int[] results = new int[3];<NEW_LINE>long start = System.currentTimeMillis();<NEW_LINE>for (Layout layout : layouts) {<NEW_LINE>validateLayout(layout, OPTIMIZATION_STANDARD);<NEW_LINE>if (showPerformances) {<NEW_LINE>validateLayout(layout, OPTIMIZATION_CURRENT);<NEW_LINE>}<NEW_LINE>check(layout.m_m, results);<NEW_LINE>check(layout.m_w, results);<NEW_LINE>check(layout.w_m, results);<NEW_LINE>check(layout.w_w, results);<NEW_LINE>n++;<NEW_LINE>progressBar.getModel().setValue(n);<NEW_LINE>long duration = System.currentTimeMillis() - start;<NEW_LINE>SwingUtilities.invokeLater(() -> {<NEW_LINE>progressLabel.setText("success: " + results[0] + "/" + total + " passable: " + results[1] + " failures: " + results[2] + " in " + duration + " ms");<NEW_LINE>updateLayoutMeasures(layouts);<NEW_LINE>});<NEW_LINE>}<NEW_LINE>SwingUtilities.invokeLater(() -> {<NEW_LINE>updateAllBaselines.setEnabled(true);<NEW_LINE>showPerformancesButton.setEnabled(true);<NEW_LINE>});<NEW_LINE>}).start();<NEW_LINE>((TableModel) table.<MASK><NEW_LINE>}
getModel()).updateResults();
516,965
private static Element toXML(RelationTriple triple, String curNS) {<NEW_LINE>Element top = new Element("triple", curNS);<NEW_LINE>top.addAttribute(new Attribute("confidence", triple.confidenceGloss()));<NEW_LINE>// Create the subject<NEW_LINE>Element subject = new Element("subject", curNS);<NEW_LINE>subject.addAttribute(new Attribute("begin", Integer.toString(triple.subjectTokenSpan().first)));<NEW_LINE>subject.addAttribute(new Attribute("end", Integer.toString(triple.subjectTokenSpan().second)));<NEW_LINE>Element text = new Element("text", curNS);<NEW_LINE>text.appendChild(triple.subjectGloss());<NEW_LINE>Element lemma = new Element("lemma", curNS);<NEW_LINE>lemma.appendChild(triple.subjectLemmaGloss());<NEW_LINE>subject.appendChild(text);<NEW_LINE>subject.appendChild(lemma);<NEW_LINE>top.appendChild(subject);<NEW_LINE>// Create the relation<NEW_LINE>Element relation = new Element("relation", curNS);<NEW_LINE>relation.addAttribute(new Attribute("begin", Integer.toString(triple.relationTokenSpan().first)));<NEW_LINE>relation.addAttribute(new Attribute("end", Integer.toString(triple.relationTokenSpan().second)));<NEW_LINE>text = new Element("text", curNS);<NEW_LINE>text.appendChild(triple.relationGloss());<NEW_LINE>lemma = new Element("lemma", curNS);<NEW_LINE>lemma.appendChild(triple.relationLemmaGloss());<NEW_LINE>relation.appendChild(text);<NEW_LINE>relation.appendChild(lemma);<NEW_LINE>top.appendChild(relation);<NEW_LINE>// Create the object<NEW_LINE>Element object = new Element("object", curNS);<NEW_LINE>object.addAttribute(new Attribute("begin", Integer.toString(triple.<MASK><NEW_LINE>object.addAttribute(new Attribute("end", Integer.toString(triple.objectTokenSpan().second)));<NEW_LINE>text = new Element("text", curNS);<NEW_LINE>text.appendChild(triple.objectGloss());<NEW_LINE>lemma = new Element("lemma", curNS);<NEW_LINE>lemma.appendChild(triple.objectLemmaGloss());<NEW_LINE>object.appendChild(text);<NEW_LINE>object.appendChild(lemma);<NEW_LINE>top.appendChild(object);<NEW_LINE>return top;<NEW_LINE>}
objectTokenSpan().first)));
747,600
public void visit(BLangConstant constant, AnalyzerData data) {<NEW_LINE>if (constant.typeNode != null && !types.isAllowedConstantType(constant.typeNode.getBType())) {<NEW_LINE>if (types.isAssignable(constant.typeNode.getBType(), symTable.anydataType) && !types.isNeverTypeOrStructureTypeWithARequiredNeverMember(constant.typeNode.getBType())) {<NEW_LINE>dlog.error(constant.typeNode.pos, DiagnosticErrorCode.CONSTANT_DECLARATION_NOT_YET_SUPPORTED, constant.typeNode);<NEW_LINE>} else {<NEW_LINE>dlog.error(constant.typeNode.pos, DiagnosticErrorCode.INVALID_CONST_DECLARATION, constant.typeNode);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>constant.annAttachments.forEach(annotationAttachment -> {<NEW_LINE>annotationAttachment.attachPoints.add(AttachPoint.Point.CONST);<NEW_LINE><MASK><NEW_LINE>BAnnotationAttachmentSymbol annotationAttachmentSymbol = annotationAttachment.annotationAttachmentSymbol;<NEW_LINE>if (annotationAttachmentSymbol != null) {<NEW_LINE>constant.symbol.addAnnotation(annotationAttachmentSymbol);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>BLangExpression expression = constant.expr;<NEW_LINE>if (!(expression.getKind() == LITERAL || expression.getKind() == NUMERIC_LITERAL) && constant.typeNode == null) {<NEW_LINE>constant.setBType(symTable.semanticError);<NEW_LINE>dlog.error(expression.pos, DiagnosticErrorCode.TYPE_REQUIRED_FOR_CONST_WITH_EXPRESSIONS);<NEW_LINE>// This has to return, because constant.symbol.type is required for further validations.<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>typeChecker.checkExpr(expression, data.env, constant.symbol.type, data.prevEnvs);<NEW_LINE>// Check nested expressions.<NEW_LINE>constantAnalyzer.visit(constant);<NEW_LINE>}
annotationAttachment.accept(this, data);
574,719
private ResultImplementation<String> filterGroupIds(final String prefix, final ResultImpl<String> result, final List<RepositoryInfo> repos, final boolean skipUnIndexed) {<NEW_LINE>final Set<String> groups = new TreeSet<String>(result.getResults());<NEW_LINE>final List<RepositoryInfo> slowCheck = new ArrayList<RepositoryInfo>();<NEW_LINE>final SkippedAction skipAction = new SkippedAction(result);<NEW_LINE>iterate(repos, new RepoAction() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run(RepositoryInfo repo, IndexingContext context) throws IOException {<NEW_LINE>Set<String<MASK><NEW_LINE>if (all.size() > 0) {<NEW_LINE>if (prefix.length() == 0) {<NEW_LINE>groups.addAll(all);<NEW_LINE>} else {<NEW_LINE>for (String gr : all) {<NEW_LINE>if (gr.startsWith(prefix)) {<NEW_LINE>groups.add(gr);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>slowCheck.add(repo);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}, skipAction, skipUnIndexed);<NEW_LINE>// //the slow check kicking in is nowadays very rare, used to be a workaround for old versions of indexing data..<NEW_LINE>// #240150 can cause OOME as the number of grouped results (ArtifactInfo instances) in this case is huge.<NEW_LINE>//<NEW_LINE>// iterate(slowCheck, new RepoAction() {<NEW_LINE>// @Override public void run(RepositoryInfo repo, IndexingContext context) throws IOException {<NEW_LINE>// BooleanQuery bq = new BooleanQuery();<NEW_LINE>// bq.add(new BooleanClause(new PrefixQuery(new Term(ArtifactInfo.UINFO, prefix)), BooleanClause.Occur.MUST));<NEW_LINE>// GroupedSearchRequest gsr = new GroupedSearchRequest(bq, new GGrouping(), new Comparator<String>() {<NEW_LINE>// @Override public int compare(String o1, String o2) {<NEW_LINE>// return o1.compareTo(o2);<NEW_LINE>// }<NEW_LINE>// });<NEW_LINE>// GroupedSearchResponse response = searcher.searchGrouped(gsr, Collections.singletonList(context));<NEW_LINE>// groups.addAll(response.getResults().keySet());<NEW_LINE>// }<NEW_LINE>// }, skipAction, skipUnIndexed);<NEW_LINE>result.setResults(groups);<NEW_LINE>return result;<NEW_LINE>}
> all = context.getAllGroups();
1,395,622
// Search Jobs using custom rankings.<NEW_LINE>public static void searchCustomRankingJobs(String projectId, String tenantId) throws IOException {<NEW_LINE>// Initialize client that will be used to send requests. This client only needs to be created<NEW_LINE>// once, and can be reused for multiple requests. After completing all of your requests, call<NEW_LINE>// the "close" method on the client to safely clean up any remaining background resources.<NEW_LINE>try (JobServiceClient jobServiceClient = JobServiceClient.create()) {<NEW_LINE>TenantName parent = TenantName.of(projectId, tenantId);<NEW_LINE>String domain = "www.example.com";<NEW_LINE>String sessionId = "Hashed session identifier";<NEW_LINE>String userId = "Hashed user identifier";<NEW_LINE>RequestMetadata requestMetadata = RequestMetadata.newBuilder().setDomain(domain).setSessionId(sessionId).setUserId(userId).build();<NEW_LINE>SearchJobsRequest.CustomRankingInfo.ImportanceLevel importanceLevel = SearchJobsRequest.CustomRankingInfo.ImportanceLevel.EXTREME;<NEW_LINE>String rankingExpression = "(someFieldLong + 25) * 0.25";<NEW_LINE>SearchJobsRequest.CustomRankingInfo customRankingInfo = SearchJobsRequest.CustomRankingInfo.newBuilder().setImportanceLevel(importanceLevel).setRankingExpression(rankingExpression).build();<NEW_LINE>String orderBy = "custom_ranking desc";<NEW_LINE>SearchJobsRequest request = SearchJobsRequest.newBuilder().setParent(parent.toString()).setRequestMetadata(requestMetadata).setCustomRankingInfo(customRankingInfo).setOrderBy(orderBy).build();<NEW_LINE>for (SearchJobsResponse.MatchingJob responseItem : jobServiceClient.searchJobs(request).iterateAll()) {<NEW_LINE>System.out.format("Job summary: %s%n", responseItem.getJobSummary());<NEW_LINE>System.out.format("Job title snippet: %s%n", responseItem.getJobTitleSnippet());<NEW_LINE>Job job = responseItem.getJob();<NEW_LINE>System.out.format(<MASK><NEW_LINE>System.out.format("Job title: %s%n", job.getTitle());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
"Job name: %s%n", job.getName());
642,729
public void receive(DatagramSocket localSocket, T packet) {<NEW_LINE>final InetSocketAddress remoteSocketAddress = (InetSocketAddress) packet.getSocketAddress();<NEW_LINE>final InetAddress remoteAddress = remoteSocketAddress.getAddress();<NEW_LINE>if (isIgnoreAddress(remoteAddress)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final HeaderTBaseDeserializer deserializer = deserializerFactory.createDeserializer();<NEW_LINE>Message<TBase<?, ?>> message = null;<NEW_LINE>try {<NEW_LINE>message = deserializer.deserialize(packet.getData());<NEW_LINE>TBase<?, ?> data = message.getData();<NEW_LINE>if (filter.filter(localSocket, data, remoteSocketAddress) == TBaseFilter.BREAK) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ServerRequest<TBase<?, ?>> request = newServerRequest(message, remoteSocketAddress);<NEW_LINE>// dispatch signifies business logic execution<NEW_LINE>dispatchHandler.dispatchSendMessage(request);<NEW_LINE>} catch (TException e) {<NEW_LINE>if (logger.isWarnEnabled()) {<NEW_LINE>logger.warn("packet serialize error. SendSocketAddress:{} Cause:{}", remoteSocketAddress, e.getMessage(), e);<NEW_LINE>}<NEW_LINE>if (logger.isDebugEnabled()) {<NEW_LINE>logger.debug("packet dump hex:{}"<MASK><NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>// there are cases where invalid headers are received<NEW_LINE>if (logger.isWarnEnabled()) {<NEW_LINE>logger.warn("Unexpected error. SendSocketAddress:{} Cause:{} message:{}", remoteAddress, e.getMessage(), message, e);<NEW_LINE>}<NEW_LINE>if (logger.isDebugEnabled()) {<NEW_LINE>logger.debug("packet dump hex:{}", PacketUtils.dumpDatagramPacket(packet));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
, PacketUtils.dumpDatagramPacket(packet));
804,448
private Request.Builder prepareRequest() {<NEW_LINE>final Request.Builder builder = new Request.Builder();<NEW_LINE>// Uri<NEW_LINE>final String finalUri = uriBase <MASK><NEW_LINE>final HttpUrl.Builder urlBuilder = Objects.requireNonNull(HttpUrl.parse(finalUri)).newBuilder();<NEW_LINE>if (!uriParams.isEmpty()) {<NEW_LINE>urlBuilder.encodedQuery(uriParams.toString());<NEW_LINE>}<NEW_LINE>builder.url(urlBuilder.build());<NEW_LINE>// method and body<NEW_LINE>final Method m = (method != null ? method : (requestBodySupplier == null ? Method.GET : Method.POST));<NEW_LINE>final Supplier<RequestBody> rbs = requestBodySupplier != null ? requestBodySupplier : () -> new FormBody.Builder().build();<NEW_LINE>switch(m) {<NEW_LINE>case POST:<NEW_LINE>builder.post(rbs.get());<NEW_LINE>break;<NEW_LINE>case PATCH:<NEW_LINE>builder.patch(rbs.get());<NEW_LINE>break;<NEW_LINE>case GET:<NEW_LINE>default:<NEW_LINE>builder.get();<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>// header<NEW_LINE>for (final ImmutablePair<String, String> header : headers) {<NEW_LINE>builder.header(header.left, header.right);<NEW_LINE>}<NEW_LINE>return builder;<NEW_LINE>}
== null ? uri : uriBase + uri;
1,704,523
public static GetLindormInstanceResponse unmarshall(GetLindormInstanceResponse getLindormInstanceResponse, UnmarshallerContext _ctx) {<NEW_LINE>getLindormInstanceResponse.setRequestId(_ctx.stringValue("GetLindormInstanceResponse.RequestId"));<NEW_LINE>getLindormInstanceResponse.setVpcId(_ctx.stringValue("GetLindormInstanceResponse.VpcId"));<NEW_LINE>getLindormInstanceResponse.setVswitchId(_ctx.stringValue("GetLindormInstanceResponse.VswitchId"));<NEW_LINE>getLindormInstanceResponse.setCreateTime(_ctx.stringValue("GetLindormInstanceResponse.CreateTime"));<NEW_LINE>getLindormInstanceResponse.setPayType(_ctx.stringValue("GetLindormInstanceResponse.PayType"));<NEW_LINE>getLindormInstanceResponse.setNetworkType(_ctx.stringValue("GetLindormInstanceResponse.NetworkType"));<NEW_LINE>getLindormInstanceResponse.setServiceType(_ctx.stringValue("GetLindormInstanceResponse.ServiceType"));<NEW_LINE>getLindormInstanceResponse.setEnableKms(_ctx.booleanValue("GetLindormInstanceResponse.EnableKms"));<NEW_LINE>getLindormInstanceResponse.setDiskUsage(_ctx.stringValue("GetLindormInstanceResponse.DiskUsage"));<NEW_LINE>getLindormInstanceResponse.setDiskCategory(_ctx.stringValue("GetLindormInstanceResponse.DiskCategory"));<NEW_LINE>getLindormInstanceResponse.setColdStorage(_ctx.integerValue("GetLindormInstanceResponse.ColdStorage"));<NEW_LINE>getLindormInstanceResponse.setExpiredMilliseconds(_ctx.longValue("GetLindormInstanceResponse.ExpiredMilliseconds"));<NEW_LINE>getLindormInstanceResponse.setEngineType(_ctx.integerValue("GetLindormInstanceResponse.EngineType"));<NEW_LINE>getLindormInstanceResponse.setExpireTime<MASK><NEW_LINE>getLindormInstanceResponse.setAutoRenew(_ctx.booleanValue("GetLindormInstanceResponse.AutoRenew"));<NEW_LINE>getLindormInstanceResponse.setDeletionProtection(_ctx.stringValue("GetLindormInstanceResponse.DeletionProtection"));<NEW_LINE>getLindormInstanceResponse.setInstanceStorage(_ctx.stringValue("GetLindormInstanceResponse.InstanceStorage"));<NEW_LINE>getLindormInstanceResponse.setAliUid(_ctx.longValue("GetLindormInstanceResponse.AliUid"));<NEW_LINE>getLindormInstanceResponse.setInstanceId(_ctx.stringValue("GetLindormInstanceResponse.InstanceId"));<NEW_LINE>getLindormInstanceResponse.setRegionId(_ctx.stringValue("GetLindormInstanceResponse.RegionId"));<NEW_LINE>getLindormInstanceResponse.setEnableFS(_ctx.booleanValue("GetLindormInstanceResponse.EnableFS"));<NEW_LINE>getLindormInstanceResponse.setCreateMilliseconds(_ctx.longValue("GetLindormInstanceResponse.CreateMilliseconds"));<NEW_LINE>getLindormInstanceResponse.setInstanceAlias(_ctx.stringValue("GetLindormInstanceResponse.InstanceAlias"));<NEW_LINE>getLindormInstanceResponse.setEnableBDS(_ctx.booleanValue("GetLindormInstanceResponse.EnableBDS"));<NEW_LINE>getLindormInstanceResponse.setEnablePhoenix(_ctx.booleanValue("GetLindormInstanceResponse.EnablePhoenix"));<NEW_LINE>getLindormInstanceResponse.setDiskThreshold(_ctx.stringValue("GetLindormInstanceResponse.DiskThreshold"));<NEW_LINE>getLindormInstanceResponse.setZoneId(_ctx.stringValue("GetLindormInstanceResponse.ZoneId"));<NEW_LINE>getLindormInstanceResponse.setInstanceStatus(_ctx.stringValue("GetLindormInstanceResponse.InstanceStatus"));<NEW_LINE>getLindormInstanceResponse.setEnableCompute(_ctx.booleanValue("GetLindormInstanceResponse.EnableCompute"));<NEW_LINE>getLindormInstanceResponse.setEnableSSL(_ctx.booleanValue("GetLindormInstanceResponse.EnableSSL"));<NEW_LINE>getLindormInstanceResponse.setEnableCdc(_ctx.booleanValue("GetLindormInstanceResponse.EnableCdc"));<NEW_LINE>getLindormInstanceResponse.setEnableStream(_ctx.booleanValue("GetLindormInstanceResponse.EnableStream"));<NEW_LINE>List<Engine> engineList = new ArrayList<Engine>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("GetLindormInstanceResponse.EngineList.Length"); i++) {<NEW_LINE>Engine engine = new Engine();<NEW_LINE>engine.setVersion(_ctx.stringValue("GetLindormInstanceResponse.EngineList[" + i + "].Version"));<NEW_LINE>engine.setCpuCount(_ctx.stringValue("GetLindormInstanceResponse.EngineList[" + i + "].CpuCount"));<NEW_LINE>engine.setCoreCount(_ctx.stringValue("GetLindormInstanceResponse.EngineList[" + i + "].CoreCount"));<NEW_LINE>engine.setEngine(_ctx.stringValue("GetLindormInstanceResponse.EngineList[" + i + "].Engine"));<NEW_LINE>engine.setMemorySize(_ctx.stringValue("GetLindormInstanceResponse.EngineList[" + i + "].MemorySize"));<NEW_LINE>engine.setIsLastVersion(_ctx.booleanValue("GetLindormInstanceResponse.EngineList[" + i + "].IsLastVersion"));<NEW_LINE>engine.setLatestVersion(_ctx.stringValue("GetLindormInstanceResponse.EngineList[" + i + "].LatestVersion"));<NEW_LINE>engineList.add(engine);<NEW_LINE>}<NEW_LINE>getLindormInstanceResponse.setEngineList(engineList);<NEW_LINE>return getLindormInstanceResponse;<NEW_LINE>}
(_ctx.stringValue("GetLindormInstanceResponse.ExpireTime"));
1,265,499
public ProvisionedBandwidth unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>ProvisionedBandwidth provisionedBandwidth = new ProvisionedBandwidth();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 1;<NEW_LINE>while (true) {<NEW_LINE><MASK><NEW_LINE>if (xmlEvent.isEndDocument())<NEW_LINE>return provisionedBandwidth;<NEW_LINE>if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {<NEW_LINE>if (context.testExpression("provisionTime", targetDepth)) {<NEW_LINE>provisionedBandwidth.setProvisionTime(DateStaxUnmarshallerFactory.getInstance("iso8601").unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("provisioned", targetDepth)) {<NEW_LINE>provisionedBandwidth.setProvisioned(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("requestTime", targetDepth)) {<NEW_LINE>provisionedBandwidth.setRequestTime(DateStaxUnmarshallerFactory.getInstance("iso8601").unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("requested", targetDepth)) {<NEW_LINE>provisionedBandwidth.setRequested(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("status", targetDepth)) {<NEW_LINE>provisionedBandwidth.setStatus(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent.isEndElement()) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return provisionedBandwidth;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
XMLEvent xmlEvent = context.nextEvent();
488,847
protected void isMarked(String[] args, Context context, PrintStream out) throws DDRInteractiveCommandException {<NEW_LINE>try {<NEW_LINE>long address = CommandUtils.parsePointer(args[1], J9BuildFlags.env_data64);<NEW_LINE>J9ObjectPointer object = J9ObjectPointer.cast(address);<NEW_LINE>MarkedObject result = markMap.queryObject(object);<NEW_LINE>if (result != null) {<NEW_LINE>if (result.wasRelocated()) {<NEW_LINE>out.format("Object %s is marked and relocated to %s\n", result.object.getHexAddress(), <MASK><NEW_LINE>} else {<NEW_LINE>out.format("Object %s is marked\n", result.object.getHexAddress());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>out.format("Object %s is not marked\n", object.getHexAddress());<NEW_LINE>}<NEW_LINE>} catch (CorruptDataException e) {<NEW_LINE>throw new DDRInteractiveCommandException(e);<NEW_LINE>}<NEW_LINE>}
result.relocatedObject.getHexAddress());
7,491
private boolean readLog(ServerConfiguration conf, ReadLogFlags flags) throws Exception {<NEW_LINE>long logId = flags.entryLogId;<NEW_LINE>if (logId == -1 && flags.filename != null) {<NEW_LINE>File f = new File(flags.filename);<NEW_LINE><MASK><NEW_LINE>if (!name.endsWith(".log")) {<NEW_LINE>LOG.error("Invalid entry log file name " + flags.filename);<NEW_LINE>usage();<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>String idString = name.split("\\.")[0];<NEW_LINE>logId = Long.parseLong(idString, 16);<NEW_LINE>}<NEW_LINE>final long lId = flags.ledgerId;<NEW_LINE>final long eId = flags.entryId;<NEW_LINE>final long startpos = flags.startPos;<NEW_LINE>final long endpos = flags.endPos;<NEW_LINE>// scan entry log<NEW_LINE>if (startpos != -1) {<NEW_LINE>if ((endpos != -1) && (endpos < startpos)) {<NEW_LINE>System.err.println("ERROR: StartPosition of the range should be lesser than or equal to EndPosition");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>scanEntryLogForPositionRange(conf, logId, startpos, endpos, flags.msg);<NEW_LINE>} else if (lId != -1) {<NEW_LINE>scanEntryLogForSpecificEntry(conf, logId, lId, eId, flags.msg);<NEW_LINE>} else {<NEW_LINE>scanEntryLog(conf, logId, flags.msg);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
String name = f.getName();
55,064
final double calculateRMin(double lat, double lon, int paddingTiles) {<NEW_LINE>int x = indexStructureInfo.getKeyAlgo().x(lon);<NEW_LINE>int y = indexStructureInfo.<MASK><NEW_LINE>double minLat = graph.getBounds().minLat + (y - paddingTiles) * indexStructureInfo.getDeltaLat();<NEW_LINE>double maxLat = graph.getBounds().minLat + (y + paddingTiles + 1) * indexStructureInfo.getDeltaLat();<NEW_LINE>double minLon = graph.getBounds().minLon + (x - paddingTiles) * indexStructureInfo.getDeltaLon();<NEW_LINE>double maxLon = graph.getBounds().minLon + (x + paddingTiles + 1) * indexStructureInfo.getDeltaLon();<NEW_LINE>double dSouthernLat = lat - minLat;<NEW_LINE>double dNorthernLat = maxLat - lat;<NEW_LINE>double dWesternLon = lon - minLon;<NEW_LINE>double dEasternLon = maxLon - lon;<NEW_LINE>// convert degree deltas into a radius in meter<NEW_LINE>double dMinLat, dMinLon;<NEW_LINE>if (dSouthernLat < dNorthernLat) {<NEW_LINE>dMinLat = DIST_PLANE.calcDist(lat, lon, minLat, lon);<NEW_LINE>} else {<NEW_LINE>dMinLat = DIST_PLANE.calcDist(lat, lon, maxLat, lon);<NEW_LINE>}<NEW_LINE>if (dWesternLon < dEasternLon) {<NEW_LINE>dMinLon = DIST_PLANE.calcDist(lat, lon, lat, minLon);<NEW_LINE>} else {<NEW_LINE>dMinLon = DIST_PLANE.calcDist(lat, lon, lat, maxLon);<NEW_LINE>}<NEW_LINE>return Math.min(dMinLat, dMinLon);<NEW_LINE>}
getKeyAlgo().y(lat);
469,158
public ContextIDValue createContextIDValue(ContextID contextID) throws CSErrorException {<NEW_LINE>logger.info("Start to createContextIDValue of ContextID({}) ", contextID.getContextId());<NEW_LINE>if (contextMapPersistence == null) {<NEW_LINE>throw new CSErrorException(97001, "Failed to get proxy of contextMapPersistence");<NEW_LINE>}<NEW_LINE>List<ContextKeyValue> contextKeyValueList = contextMapPersistence.getAll(contextID);<NEW_LINE>ContextKeyValueContext contextKeyValueContext = getContextKeyValueContext();<NEW_LINE>contextKeyValueContext.setContextID(contextID);<NEW_LINE>contextKeyValueContext.putAll(contextKeyValueList);<NEW_LINE>try {<NEW_LINE>logger.info("For contextID({}) register contextKeyListener", contextID.getContextId());<NEW_LINE>List<ContextKeyListenerDomain> contextKeyListenerPersistenceAll = this.contextKeyListenerPersistence.getAll(contextID);<NEW_LINE>if (CollectionUtils.isNotEmpty(contextKeyListenerPersistenceAll)) {<NEW_LINE>for (ContextKeyListenerDomain contextKeyListenerDomain : contextKeyListenerPersistenceAll) {<NEW_LINE>this.contextKeyCallbackEngine.registerClient(contextKeyListenerDomain);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>logger.info("For contextID({}) register contextIDListener", contextID.getContextId());<NEW_LINE>List<ContextIDListenerDomain> contextIDListenerPersistenceAll = this.contextIDListenerPersistence.getAll(contextID);<NEW_LINE>if (CollectionUtils.isNotEmpty(contextIDListenerPersistenceAll)) {<NEW_LINE>for (ContextIDListenerDomain contextIDListenerDomain : contextIDListenerPersistenceAll) {<NEW_LINE>this.contextIDCallbackEngine.registerClient(contextIDListenerDomain);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Throwable e) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>logger.info("Finished to createContextIDValue of ContextID({}) ", contextID.getContextId());<NEW_LINE>ContextIDValueImpl contextIDValue = new ContextIDValueImpl(contextID.getContextId(), contextKeyValueContext);<NEW_LINE>listenerBus.addListener(contextIDValue);<NEW_LINE>return contextIDValue;<NEW_LINE>}
logger.error("Failed to register listener: ", e);
1,722,093
void doCommand() throws Exception {<NEW_LINE>final LocalDB localDB = this.cliEnvironment.getLocalDB();<NEW_LINE>final LocalDBStoredQueue logQueue = LocalDBStoredQueue.createLocalDBStoredQueue(null, localDB, LocalDB.DB.EVENTLOG_EVENTS);<NEW_LINE>if (logQueue.isEmpty()) {<NEW_LINE>out("no logs present");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final File outputFile = (File) cliEnvironment.getOptions().get(CliParameters.REQUIRED_NEW_OUTPUT_FILE.getName());<NEW_LINE>out("outputting " + logQueue.size() + " log events to " + outputFile.getAbsolutePath() + "....");<NEW_LINE>try (Writer outputWriter = new OutputStreamWriter(new FileOutputStream(outputFile), PwmConstants.DEFAULT_CHARSET)) {<NEW_LINE>for (final Iterator<String> iter = logQueue.descendingIterator(); iter.hasNext(); ) {<NEW_LINE>final String loopString = iter.next();<NEW_LINE>final PwmLogEvent <MASK><NEW_LINE>if (logEvent != null) {<NEW_LINE>outputWriter.write(logEvent.toLogString());<NEW_LINE>outputWriter.write("\n");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>out("output complete");<NEW_LINE>}
logEvent = PwmLogEvent.fromEncodedString(loopString);
1,664,091
public void run(RegressionEnvironment env) {<NEW_LINE>String[] fields = "c0,c1,c2,c3,c4,c5".split(",");<NEW_LINE>SupportEvalBuilder builder = new SupportEvalBuilder("SupportBean_ST0_Container");<NEW_LINE>builder.expression(fields[0], "contained.firstOf(x => p00 = 9)");<NEW_LINE>builder.expression(fields[1], "contained.lastOf(x => p00 = 9)");<NEW_LINE>builder.expression(fields[2], "contained.firstOf( (x, i) => p00 = 9 and i >= 1)");<NEW_LINE>builder.expression(fields[3], "contained.lastOf( (x, i) => p00 = 9 and i >= 1)");<NEW_LINE>builder.expression<MASK><NEW_LINE>builder.expression(fields[5], "contained.lastOf((x, i, s) => p00 = 9 and i >= 1 and s > 2)");<NEW_LINE>builder.statementConsumer(stmt -> assertTypesAllSame(stmt.getEventType(), fields, SupportBean_ST0.EPTYPE));<NEW_LINE>SupportBean_ST0_Container beanOne = SupportBean_ST0_Container.make2Value("E1,1", "E2,9", "E2,9");<NEW_LINE>builder.assertion(beanOne).expect(fields, beanOne.getContained().get(1), beanOne.getContained().get(2), beanOne.getContained().get(1), beanOne.getContained().get(2), beanOne.getContained().get(1), beanOne.getContained().get(2));<NEW_LINE>builder.assertion(SupportBean_ST0_Container.make2ValueNull()).expect(fields, null, null, null, null, null, null);<NEW_LINE>builder.assertion(SupportBean_ST0_Container.make2Value()).expect(fields, null, null, null, null, null, null);<NEW_LINE>builder.assertion(SupportBean_ST0_Container.make2Value("E1,1", "E2,1", "E2,1")).expect(fields, null, null, null, null, null, null);<NEW_LINE>SupportBean_ST0_Container beanTwo = SupportBean_ST0_Container.make2Value("E1,1", "E2,9");<NEW_LINE>builder.assertion(beanTwo).expect(fields, beanTwo.getContained().get(1), beanTwo.getContained().get(1), beanTwo.getContained().get(1), beanTwo.getContained().get(1), null, null);<NEW_LINE>SupportBean_ST0_Container beanThree = SupportBean_ST0_Container.make2Value("E2,9", "E1,1");<NEW_LINE>builder.assertion(beanThree).expect(fields, beanThree.getContained().get(0), beanThree.getContained().get(0), null, null, null, null);<NEW_LINE>builder.run(env);<NEW_LINE>}
(fields[4], "contained.firstOf( (x, i, s) => p00 = 9 and i >= 1 and s > 2)");
53,406
public void onReceiveUnlock(Context context, Intent intent) {<NEW_LINE>Log.i(TAG, String.format("%s#onReceive(%s)", getClass().getSimpleName(), intent.getAction()));<NEW_LINE>long scheduledTime = getNextScheduledExecutionTime(context);<NEW_LINE>AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);<NEW_LINE>Intent alarmIntent = new Intent(context, getClass());<NEW_LINE>PendingIntent pendingIntent = PendingIntent.getBroadcast(context, 0, alarmIntent, 0);<NEW_LINE>if (System.currentTimeMillis() >= scheduledTime) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>Log.i(TAG, getClass() + " scheduling for: " + scheduledTime + " action: " + intent.getAction());<NEW_LINE>if (pendingIntent != null) {<NEW_LINE>alarmManager.cancel(pendingIntent);<NEW_LINE>alarmManager.set(AlarmManager.RTC_WAKEUP, scheduledTime, pendingIntent);<NEW_LINE>} else {<NEW_LINE>Log.i(TAG, "PendingIntent somehow null, skipping");<NEW_LINE>}<NEW_LINE>}
scheduledTime = onAlarm(context, scheduledTime);
196,934
public Map<K, ValueHolder<V>> bulkComputeIfAbsent(Set<? extends K> keys, final Function<Iterable<? extends K>, Iterable<? extends Map.Entry<? extends K, ? extends V>>> mappingFunction) throws StoreAccessException {<NEW_LINE>Map<K, ValueHolder<V>> result = new HashMap<>(keys.size());<NEW_LINE>for (K key : keys) {<NEW_LINE>checkKey(key);<NEW_LINE>Function<K, V> function = k -> {<NEW_LINE>java.util.Iterator<? extends Map.Entry<? extends K, ? extends V>> iterator = mappingFunction.apply(Collections.singleton(k)).iterator();<NEW_LINE>Map.Entry<? extends K, ? extends V<MASK><NEW_LINE>if (result1 != null) {<NEW_LINE>checkKey(result1.getKey());<NEW_LINE>return result1.getValue();<NEW_LINE>} else {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>ValueHolder<V> computed = computeIfAbsent(key, function);<NEW_LINE>result.put(key, computed);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
> result1 = iterator.next();
311,140
public void loadData() {<NEW_LINE>if (!isAdded()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>mService = PublicizeTable.getService(mServiceId);<NEW_LINE>if (mService == null) {<NEW_LINE>ToastUtils.showToast(getActivity(<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>setTitle(mService.getLabel());<NEW_LINE>// disable the ability to add another G+ connection<NEW_LINE>if (isGooglePlus()) {<NEW_LINE>mServiceContainer.setVisibility(View.GONE);<NEW_LINE>} else {<NEW_LINE>String serviceLabel = String.format(getString(R.string.connection_service_label), mService.getLabel());<NEW_LINE>TextView txtService = mServiceContainer.findViewById(R.id.text_service);<NEW_LINE>txtService.setText(serviceLabel);<NEW_LINE>String description = String.format(getString(R.string.connection_service_description), mService.getLabel());<NEW_LINE>TextView txtDescription = mServiceContainer.findViewById(R.id.text_description);<NEW_LINE>txtDescription.setText(description);<NEW_LINE>}<NEW_LINE>long currentUserId = mAccountStore.getAccount().getUserId();<NEW_LINE>PublicizeConnectionAdapter adapter = new PublicizeConnectionAdapter(getActivity(), mSite.getSiteId(), mService, currentUserId);<NEW_LINE>adapter.setOnPublicizeActionListener(getOnPublicizeActionListener());<NEW_LINE>adapter.setOnAdapterLoadedListener(this);<NEW_LINE>mRecycler.setAdapter(adapter);<NEW_LINE>adapter.refresh();<NEW_LINE>}
), R.string.error_generic);
1,580,170
public Uni<SecurityIdentity> attemptAuthentication(RoutingContext routingContext) {<NEW_LINE>String pathSpecificMechanism = pathMatchingPolicy.isResolvable() ? pathMatchingPolicy.get().getAuthMechanismName(routingContext) : null;<NEW_LINE>Uni<HttpAuthenticationMechanism> <MASK><NEW_LINE>if (matchingMechUni == null) {<NEW_LINE>return createSecurityIdentity(routingContext);<NEW_LINE>}<NEW_LINE>return matchingMechUni.onItem().transformToUni(new Function<HttpAuthenticationMechanism, Uni<? extends SecurityIdentity>>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Uni<SecurityIdentity> apply(HttpAuthenticationMechanism mech) {<NEW_LINE>if (mech != null) {<NEW_LINE>return mech.authenticate(routingContext, identityProviderManager);<NEW_LINE>} else if (pathSpecificMechanism != null) {<NEW_LINE>return Uni.createFrom().optional(Optional.empty());<NEW_LINE>}<NEW_LINE>return createSecurityIdentity(routingContext);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
matchingMechUni = findBestCandidateMechanism(routingContext, pathSpecificMechanism);
1,410,840
private void searchForIdsWithAndOr(SearchQueryBuilder theSearchSqlBuilder, QueryStack theQueryStack, @Nonnull SearchParameterMap theParams, RequestDetails theRequest) {<NEW_LINE>myParams = theParams;<NEW_LINE>// Remove any empty parameters<NEW_LINE>theParams.clean();<NEW_LINE>// For DSTU3, pull out near-distance first so when it comes time to evaluate near, we already know the distance<NEW_LINE>if (myContext.getVersion().getVersion() == FhirVersionEnum.DSTU3) {<NEW_LINE>Dstu3DistanceHelper.setNearDistance(myResourceType, theParams);<NEW_LINE>}<NEW_LINE>// Attempt to lookup via composite unique key.<NEW_LINE>if (isCompositeUniqueSpCandidate()) {<NEW_LINE>attemptComboUniqueSpProcessing(theQueryStack, theParams, theRequest);<NEW_LINE>}<NEW_LINE>SearchContainedModeEnum searchContainedMode = theParams.getSearchContainedMode();<NEW_LINE>// Handle _id and _tag last, since they can typically be tacked onto a different parameter<NEW_LINE>List<String> paramNames = myParams.keySet().stream().filter(t -> !t.equals(IAnyResource.SP_RES_ID)).filter(t -> !t.equals(Constants.PARAM_TAG)).collect(Collectors.toList());<NEW_LINE>if (myParams.containsKey(IAnyResource.SP_RES_ID)) {<NEW_LINE>paramNames.add(IAnyResource.SP_RES_ID);<NEW_LINE>}<NEW_LINE>if (myParams.containsKey(Constants.PARAM_TAG)) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>// Handle each parameter<NEW_LINE>for (String nextParamName : paramNames) {<NEW_LINE>if (myParams.isLastN() && LastNParameterHelper.isLastNParameter(nextParamName, myContext)) {<NEW_LINE>// Skip parameters for Subject, Patient, Code and Category for LastN as these will be filtered by Elasticsearch<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>List<List<IQueryParameterType>> andOrParams = myParams.get(nextParamName);<NEW_LINE>Condition predicate = theQueryStack.searchForIdsWithAndOr(null, myResourceName, nextParamName, andOrParams, theRequest, myRequestPartitionId, searchContainedMode);<NEW_LINE>if (predicate != null) {<NEW_LINE>theSearchSqlBuilder.addPredicate(predicate);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
paramNames.add(Constants.PARAM_TAG);
1,107,784
/*<NEW_LINE>* Skill Stat Calculations<NEW_LINE>*/<NEW_LINE>public static String[] calculateLengthDisplayValues(Player player, float skillValue, PrimarySkillType skill) {<NEW_LINE>int maxLength = mcMMO.p.getSkillTools().getSuperAbilityMaxLength(mcMMO.p.getSkillTools().getSuperAbility(skill));<NEW_LINE>int abilityLengthVar = mcMMO.p.getAdvancedConfig().getAbilityLength();<NEW_LINE>int abilityLengthCap = mcMMO.p.getAdvancedConfig().getAbilityLengthCap();<NEW_LINE>int length;<NEW_LINE>if (abilityLengthCap > 0) {<NEW_LINE>length = (int) Math.min(abilityLengthCap, 2 + (skillValue / abilityLengthVar));<NEW_LINE>} else {<NEW_LINE>length = 2 + <MASK><NEW_LINE>}<NEW_LINE>int enduranceLength = PerksUtils.handleActivationPerks(player, length, maxLength);<NEW_LINE>if (maxLength != 0) {<NEW_LINE>length = Math.min(length, maxLength);<NEW_LINE>}<NEW_LINE>return new String[] { String.valueOf(length), String.valueOf(enduranceLength) };<NEW_LINE>}
(int) (skillValue / abilityLengthVar);
1,514,187
public Void visitMemberDeclaration(final MemberDeclarationContext ctx) {<NEW_LINE>ClassNode classNode = ctx.getNodeMetaData(CLASS_DECLARATION_CLASS_NODE);<NEW_LINE>Objects.requireNonNull(classNode, "classNode should not be null");<NEW_LINE>if (asBoolean(ctx.methodDeclaration())) {<NEW_LINE>ctx.methodDeclaration().putNodeMetaData(CLASS_DECLARATION_CLASS_NODE, classNode);<NEW_LINE>this.visitMethodDeclaration(ctx.methodDeclaration());<NEW_LINE>} else if (asBoolean(ctx.fieldDeclaration())) {<NEW_LINE>ctx.fieldDeclaration().putNodeMetaData(CLASS_DECLARATION_CLASS_NODE, classNode);<NEW_LINE>this.visitFieldDeclaration(ctx.fieldDeclaration());<NEW_LINE>} else if (asBoolean(ctx.classDeclaration())) {<NEW_LINE>ctx.classDeclaration().putNodeMetaData(TYPE_DECLARATION_MODIFIERS, this.visitModifiersOpt(ctx.modifiersOpt()));<NEW_LINE>ctx.classDeclaration(<MASK><NEW_LINE>this.visitClassDeclaration(ctx.classDeclaration());<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
).putNodeMetaData(CLASS_DECLARATION_CLASS_NODE, classNode);
1,179,572
final RetryDataReplicationResult executeRetryDataReplication(RetryDataReplicationRequest retryDataReplicationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(retryDataReplicationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<RetryDataReplicationRequest> request = null;<NEW_LINE>Response<RetryDataReplicationResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new RetryDataReplicationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(retryDataReplicationRequest));<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, "drs");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "RetryDataReplication");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<RetryDataReplicationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new RetryDataReplicationResultJsonUnmarshaller());<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);
712,150
public void onCreate(Bundle icicle) {<NEW_LINE>super.onCreate(icicle);<NEW_LINE>setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);<NEW_LINE>Window window = getWindow();<NEW_LINE>window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);<NEW_LINE>setContentView(RhoExtManager.getResourceId("layout", "capture"));<NEW_LINE>int camera_index = 0;<NEW_LINE>Intent intent = getIntent();<NEW_LINE>if (intent != null) {<NEW_LINE>camera_index = intent.getIntExtra(CAMERA_INDEX_EXTRA, 0);<NEW_LINE>Logger.<MASK><NEW_LINE>this.camera_index = camera_index;<NEW_LINE>rhoBarcodeId = intent.getStringExtra(RHO_BARCODE_ID);<NEW_LINE>}<NEW_LINE>CameraManager.init(getApplication());<NEW_LINE>viewfinderView = (ViewfinderView) findViewById(RhoExtManager.getResourceId("id", "viewfinder_view"));<NEW_LINE>resultView = findViewById(RhoExtManager.getResourceId("id", "result_view"));<NEW_LINE>// statusView = (TextView) findViewById(R.id.status_view);<NEW_LINE>handler = null;<NEW_LINE>lastResult = null;<NEW_LINE>hasSurface = false;<NEW_LINE>// historyManager = new HistoryManager(this);<NEW_LINE>// historyManager.trimHistory();<NEW_LINE>inactivityTimer = new InactivityTimer(this);<NEW_LINE>mCancelButton2 = (Button) findViewById(RhoExtManager.getResourceId("id", "cancel_button_a"));<NEW_LINE>mCancelButton = (Button) findViewById(RhoExtManager.getResourceId("id", "cancel_button"));<NEW_LINE>mRetakeButton = (Button) findViewById(RhoExtManager.getResourceId("id", "retake_button"));<NEW_LINE>mOKButton = (Button) findViewById(RhoExtManager.getResourceId("id", "ok_button"));<NEW_LINE>mFlashButton = (Button) findViewById(RhoExtManager.getResourceId("id", "flash_button"));<NEW_LINE>mCancelButton2.setOnClickListener(new OnClickListener() {<NEW_LINE><NEW_LINE>public void onClick(View v) {<NEW_LINE>onCancel();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>mCancelButton.setOnClickListener(new OnClickListener() {<NEW_LINE><NEW_LINE>public void onClick(View v) {<NEW_LINE>onCancel();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>mRetakeButton.setOnClickListener(new OnClickListener() {<NEW_LINE><NEW_LINE>public void onClick(View v) {<NEW_LINE>Logger.I(LOGTAG, "onRetake()");<NEW_LINE>onRetake();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>mOKButton.setOnClickListener(new OnClickListener() {<NEW_LINE><NEW_LINE>public void onClick(View v) {<NEW_LINE>Logger.I(LOGTAG, "onOK()");<NEW_LINE>onOK();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>mFlashButton.setOnClickListener(new OnClickListener() {<NEW_LINE><NEW_LINE>public void onClick(View v) {<NEW_LINE>Logger.I(LOGTAG, "CameraManager.get().setFlash()");<NEW_LINE>useFlash = !useFlash;<NEW_LINE>CameraManager.get().setFlash(useFlash);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>mCancelButton2.setVisibility(View.VISIBLE);<NEW_LINE>if (CameraManager.isFlashLightEnabled()) {<NEW_LINE>mFlashButton.setVisibility(View.VISIBLE);<NEW_LINE>} else {<NEW_LINE>mFlashButton.setVisibility(View.GONE);<NEW_LINE>}<NEW_LINE>showHelpOnFirstLaunch();<NEW_LINE>}
D(LOGTAG, "Intent Camera index: " + camera_index);
318,497
public void visit(BLangPackage pkgNode) {<NEW_LINE>if (pkgNode.completedPhases.contains(CompilerPhase.COMPILER_PLUGIN)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (CompilerPlugin compilerPlugin : pluginList) {<NEW_LINE>executePluginSafely(pkgNode, compilerPlugin, <MASK><NEW_LINE>}<NEW_LINE>for (CompilerPlugin compilerPlugin : pluginList) {<NEW_LINE>executePluginSafely(pkgNode, compilerPlugin, pkgNode, compilerPlugin::process);<NEW_LINE>}<NEW_LINE>// Then visit each top-level element sorted using the compilation unit<NEW_LINE>for (TopLevelNode topLevelNode : pkgNode.topLevelNodes) {<NEW_LINE>((BLangNode) topLevelNode).accept(this);<NEW_LINE>}<NEW_LINE>pkgNode.getTestablePkgs().forEach(testablePackage -> {<NEW_LINE>this.defaultPos = testablePackage.pos;<NEW_LINE>visit(testablePackage);<NEW_LINE>});<NEW_LINE>for (CompilerPlugin plugin : pluginList) {<NEW_LINE>executePluginSafely(pkgNode, plugin, pkgNode.packageID, plugin::pluginExecutionCompleted);<NEW_LINE>}<NEW_LINE>pkgNode.completedPhases.add(CompilerPhase.COMPILER_PLUGIN);<NEW_LINE>}
pkgNode.packageID, compilerPlugin::pluginExecutionStarted);
884,122
public void update2(final VariantContext eval, final VariantContext comp, final VariantEvalContext context) {<NEW_LINE>if (eval == null || (getEngine().getVariantEvalArgs().ignoreAC0Sites() && eval.isMonomorphicInSamples()))<NEW_LINE>return;<NEW_LINE>final Type type = getType(eval);<NEW_LINE>if (type == null)<NEW_LINE>return;<NEW_LINE>TypeSampleMap titvTable = null;<NEW_LINE>// update DP, if possible<NEW_LINE>if (eval.hasAttribute(VCFConstants.DEPTH_KEY))<NEW_LINE>depthPerSample.inc(type, ALL);<NEW_LINE>// update counts<NEW_LINE><MASK><NEW_LINE>// type specific calculations<NEW_LINE>if (type == Type.SNP && eval.isBiallelic()) {<NEW_LINE>titvTable = GATKVariantContextUtils.isTransition(eval) ? transitionsPerSample : transversionsPerSample;<NEW_LINE>titvTable.inc(type, ALL);<NEW_LINE>}<NEW_LINE>// novelty calculation<NEW_LINE>if (comp != null || (type == Type.CNV && overlapsKnownCNV(eval, context)))<NEW_LINE>knownVariantCounts.inc(type, ALL);<NEW_LINE>// per sample metrics<NEW_LINE>for (final Genotype g : eval.getGenotypes()) {<NEW_LINE>if (!g.isNoCall() && !g.isHomRef()) {<NEW_LINE>countsPerSample.inc(type, g.getSampleName());<NEW_LINE>// update transition / transversion ratio<NEW_LINE>if (titvTable != null)<NEW_LINE>titvTable.inc(type, g.getSampleName());<NEW_LINE>if (g.hasDP())<NEW_LINE>depthPerSample.inc(type, g.getSampleName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
allVariantCounts.inc(type, ALL);
297,942
final DeleteHsmResult executeDeleteHsm(DeleteHsmRequest deleteHsmRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteHsmRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteHsmRequest> request = null;<NEW_LINE>Response<DeleteHsmResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteHsmRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteHsmRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudHSM");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteHsm");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteHsmResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteHsmResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
458,092
synchronized void issue(LeasePermitHandler leasePermitHandler) {<NEW_LINE>if (this.isDisposed) {<NEW_LINE>leasePermitHandler.handlePermitError(this.t);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final int availableRequests = this.availableRequests;<NEW_LINE>final Lease l = this.currentLease;<NEW_LINE>final boolean leaseReceived = l != null;<NEW_LINE>final boolean isExpired = leaseReceived && isExpired(l);<NEW_LINE>if (leaseReceived && availableRequests > 0 && !isExpired) {<NEW_LINE>if (leasePermitHandler.handlePermit()) {<NEW_LINE>this.availableRequests = availableRequests - 1;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>final Queue<LeasePermitHandler> queue = this.awaitingPermitHandlersQueue;<NEW_LINE>if (this.maximumAllowedAwaitingPermitHandlersNumber > queue.size()) {<NEW_LINE>queue.offer(leasePermitHandler);<NEW_LINE>} else {<NEW_LINE>final String tag = this.tag;<NEW_LINE>final String message;<NEW_LINE>if (!leaseReceived) {<NEW_LINE>message = String.format("[%s] Lease was not received yet", tag);<NEW_LINE>} else if (isExpired) {<NEW_LINE>message = String.format("[%s] Missing leases. Lease is expired", tag);<NEW_LINE>} else {<NEW_LINE>message = String.format("[%s] Missing leases. Issued [%s] request allowance is used", tag, availableRequests);<NEW_LINE>}<NEW_LINE>final <MASK><NEW_LINE>leasePermitHandler.handlePermitError(t);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
Throwable t = new MissingLeaseException(message);
467,629
private void handleStart(Intent intent) {<NEW_LINE>NotificationManager notificationManager = (NotificationManager) this.getApplicationContext().getSystemService(NOTIFICATION_SERVICE);<NEW_LINE>int id = intent.getIntExtra(ConstantStrings.SESSION, 0);<NEW_LINE>String session_date;<NEW_LINE>Session session = realmRepo.getSessionSync(id);<NEW_LINE>Intent intent1 = new Intent(this.getApplicationContext(), SessionDetailActivity.class);<NEW_LINE>intent1.putExtra(ConstantStrings.SESSION, session.getTitle());<NEW_LINE>intent1.putExtra(ConstantStrings.ID, session.getId());<NEW_LINE>intent1.putExtra(ConstantStrings.TRACK, session.getTrack().getName());<NEW_LINE>PendingIntent pendingNotificationIntent = PendingIntent.getActivity(this.getApplicationContext(), 0, intent1, PendingIntent.FLAG_UPDATE_CURRENT);<NEW_LINE>Bitmap largeIcon = BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher);<NEW_LINE>int smallIcon = R.drawable.ic_bookmark_white_24dp;<NEW_LINE>if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP)<NEW_LINE>smallIcon = R.drawable.ic_noti_bookmark;<NEW_LINE>String session_timings = String.format("%s - %s", DateConverter.formatDateWithDefault(DateConverter.FORMAT_12H, session.getStartsAt()), DateConverter.formatDateWithDefault(DateConverter.FORMAT_12H, session.getEndsAt()));<NEW_LINE>session_date = DateConverter.formatDateWithDefault(DateConverter.FORMAT_DATE_COMPLETE, session.getStartsAt());<NEW_LINE>NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this).setSmallIcon(smallIcon).setLargeIcon(largeIcon).setContentTitle(session.getTitle()).setContentText(session_date + "\n" + session_timings).setAutoCancel(true).setStyle(new NotificationCompat.BigTextStyle().bigText(session_date + "\n" + session_timings)).setContentIntent(pendingNotificationIntent);<NEW_LINE>intent1.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP);<NEW_LINE>notificationBuilder.setSound(RingtoneManager<MASK><NEW_LINE>if (notificationManager != null) {<NEW_LINE>notificationManager.notify(session.getId(), notificationBuilder.build());<NEW_LINE>}<NEW_LINE>}
.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION));
1,587,780
protected void paintText(Graphics g, int tabPlacement, Font font, FontMetrics metrics, int tabIndex, String title, Rectangle textRect, boolean isSelected) {<NEW_LINE>boolean calculate = !(tabPlacement == TOP || tabPlacement == BOTTOM);<NEW_LINE>// HTML<NEW_LINE>if (getTextViewForTab(tabIndex) != null)<NEW_LINE>calculate = false;<NEW_LINE>if (!calculate) {<NEW_LINE>super.paintText(g, tabPlacement, font, metrics, tabIndex, title, textRect, isSelected);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// System.out.println("3.textRect " + textRect + " - " + title);<NEW_LINE>String firstLine = title;<NEW_LINE>String secondLine = null;<NEW_LINE>int pos = title.indexOf(' ');<NEW_LINE>if (pos != -1) {<NEW_LINE>firstLine = title.substring(0, pos);<NEW_LINE>secondLine = <MASK><NEW_LINE>}<NEW_LINE>g.setFont(font);<NEW_LINE>int mnemIndex = tabPane.getDisplayedMnemonicIndexAt(tabIndex);<NEW_LINE>if (tabPane.isEnabled() && tabPane.isEnabledAt(tabIndex)) {<NEW_LINE>Color c = tabPane.getForegroundAt(tabIndex);<NEW_LINE>if (!isSelected) {<NEW_LINE>if (c.equals(Color.black))<NEW_LINE>c = Color.darkGray;<NEW_LINE>else<NEW_LINE>c = c.brighter();<NEW_LINE>}<NEW_LINE>g.setColor(c);<NEW_LINE>// first line<NEW_LINE>BasicGraphicsUtils.drawStringUnderlineCharAt(g, firstLine, mnemIndex, textRect.x, textRect.y + metrics.getAscent());<NEW_LINE>// secondLine<NEW_LINE>if (secondLine != null)<NEW_LINE>BasicGraphicsUtils.drawStringUnderlineCharAt(g, secondLine, mnemIndex - firstLine.length(), textRect.x, textRect.y + metrics.getAscent() + metrics.getHeight());<NEW_LINE>} else {<NEW_LINE>// tab disabled<NEW_LINE>g.setColor(tabPane.getBackgroundAt(tabIndex).brighter());<NEW_LINE>BasicGraphicsUtils.drawStringUnderlineCharAt(g, firstLine, mnemIndex, textRect.x, textRect.y + metrics.getAscent());<NEW_LINE>// secondLine<NEW_LINE>if (secondLine != null)<NEW_LINE>BasicGraphicsUtils.drawStringUnderlineCharAt(g, secondLine, mnemIndex - firstLine.length(), textRect.x, textRect.y + metrics.getAscent() + metrics.getHeight());<NEW_LINE>//<NEW_LINE>g.setColor(tabPane.getBackgroundAt(tabIndex).darker());<NEW_LINE>BasicGraphicsUtils.drawStringUnderlineCharAt(g, firstLine, mnemIndex, textRect.x - 1, textRect.y + metrics.getAscent() - 1);<NEW_LINE>// secondLine<NEW_LINE>if (secondLine != null)<NEW_LINE>BasicGraphicsUtils.drawStringUnderlineCharAt(g, secondLine, mnemIndex - firstLine.length(), textRect.x - 1, textRect.y + metrics.getAscent() + metrics.getHeight() - 1);<NEW_LINE>}<NEW_LINE>}
title.substring(pos + 1);
585,792
@Produces(MediaType.APPLICATION_JSON)<NEW_LINE>public JSONArray initNetwork(@FormDataParam(CoordConsts.SVC_KEY_API_KEY) String apiKey, @FormDataParam(CoordConsts.SVC_KEY_VERSION) String clientVersion, @FormDataParam(CoordConsts.SVC_KEY_NETWORK_NAME) String networkName, @FormDataParam(CoordConsts.SVC_KEY_NETWORK_PREFIX) String networkPrefix) {<NEW_LINE>try {<NEW_LINE>_logger.infof("WMS:initNetwork %s\n", networkPrefix);<NEW_LINE>checkStringParam(apiKey, "API key");<NEW_LINE>checkStringParam(clientVersion, "Client version");<NEW_LINE>if (networkName == null || networkName.equals("")) {<NEW_LINE>checkStringParam(networkPrefix, "Network prefix");<NEW_LINE>}<NEW_LINE>checkApiKeyValidity(apiKey);<NEW_LINE>String outputNetworkName = Main.getWorkMgr().initNetwork(networkName, networkPrefix);<NEW_LINE>_logger.infof("Initialized network:%s using api-key:%s\n", outputNetworkName, apiKey);<NEW_LINE>Main.getAuthorizer(<MASK><NEW_LINE>return successResponse(new JSONObject().put(CoordConsts.SVC_KEY_NETWORK_NAME, outputNetworkName).put(CoordConsts.SVC_KEY_CONTAINER_NAME, outputNetworkName));<NEW_LINE>} catch (IllegalArgumentException | AccessControlException e) {<NEW_LINE>_logger.errorf("WMS:initNetwork exception: %s\n", e.getMessage());<NEW_LINE>return failureResponse(e.getMessage());<NEW_LINE>} catch (Exception e) {<NEW_LINE>String stackTrace = Throwables.getStackTraceAsString(e);<NEW_LINE>_logger.errorf("WMS:initNetwork exception for apikey:%s in network:%s; exception:%s", apiKey, networkName, stackTrace);<NEW_LINE>return failureResponse(e.getMessage());<NEW_LINE>}<NEW_LINE>}
).authorizeContainer(apiKey, outputNetworkName);
685,082
public void savePreset(PreviewPreset preset) {<NEW_LINE>int exist = -1;<NEW_LINE>for (int i = 0; i < presets.size(); i++) {<NEW_LINE>PreviewPreset p = presets.get(i);<NEW_LINE>if (p.getName().equals(preset.getName())) {<NEW_LINE>exist = i;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (exist == -1) {<NEW_LINE>addPreset(preset);<NEW_LINE>} else {<NEW_LINE>presets.set(exist, preset);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>// Create file if dont exist<NEW_LINE>FileObject folder = FileUtil.getConfigFile("previewpresets");<NEW_LINE>if (folder == null) {<NEW_LINE>folder = FileUtil.getConfigRoot().createFolder("previewpresets");<NEW_LINE>}<NEW_LINE>// Safe filename<NEW_LINE>String filename = DigestUtils.sha1Hex(preset.getName());<NEW_LINE>FileObject presetFile = folder.getFileObject(filename, "xml");<NEW_LINE>if (presetFile == null) {<NEW_LINE>presetFile = folder.createData(filename, "xml");<NEW_LINE>}<NEW_LINE>// Create doc<NEW_LINE>DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();<NEW_LINE>DocumentBuilder documentBuilder = factory.newDocumentBuilder();<NEW_LINE>final Document document = documentBuilder.newDocument();<NEW_LINE>document.setXmlVersion("1.0");<NEW_LINE>document.setXmlStandalone(true);<NEW_LINE>// Write doc<NEW_LINE>writeXML(document, preset);<NEW_LINE>// Write XML file<NEW_LINE>try (OutputStream outputStream = presetFile.getOutputStream()) {<NEW_LINE>Source source = new DOMSource(document);<NEW_LINE>Result result = new StreamResult(outputStream);<NEW_LINE>Transformer transformer = TransformerFactory.newInstance().newTransformer();<NEW_LINE>transformer.setOutputProperty(OutputKeys.INDENT, "yes");<NEW_LINE>transformer.<MASK><NEW_LINE>transformer.transform(source, result);<NEW_LINE>}<NEW_LINE>} catch (Exception ex) {<NEW_LINE>Exceptions.printStackTrace(ex);<NEW_LINE>}<NEW_LINE>}
setOutputProperty(OutputKeys.ENCODING, "UTF-8");
300,165
public boolean solvePositionConstraints(SolverData data) {<NEW_LINE>Vec2 cA = data.positions[m_indexA].c;<NEW_LINE>float aA = data.positions[m_indexA].a;<NEW_LINE>Vec2 cB = data.positions[m_indexB].c;<NEW_LINE>float aB = data.positions[m_indexB].a;<NEW_LINE>final Rotation qA = pool.popRot();<NEW_LINE>final Rotation qB = pool.popRot();<NEW_LINE>final Vec2 temp = pool.popVec2();<NEW_LINE>qA.set(aA);<NEW_LINE>qB.set(aB);<NEW_LINE>Rotation.mulToOut(qA, temp.set(m_localAnchorA).subLocal(m_localCenterA), rA);<NEW_LINE>Rotation.mulToOut(qB, temp.set(m_localAnchorB).subLocal(m_localCenterB), rB);<NEW_LINE>d.set(cB).subLocal(cA).addLocal(rB).subLocal(rA);<NEW_LINE>Vec2 ay = pool.popVec2();<NEW_LINE>Rotation.mulToOut(qA, m_localYAxisA, ay);<NEW_LINE>float sAy = Vec2.cross(temp.set(d).addLocal(rA), ay);<NEW_LINE>float sBy = Vec2.cross(rB, ay);<NEW_LINE>float C = Vec2.dot(d, ay);<NEW_LINE>float k = m_invMassA + m_invMassB + m_invIA * m_sAy * m_sAy + m_invIB * m_sBy * m_sBy;<NEW_LINE>float impulse;<NEW_LINE>if (k != 0.0f) {<NEW_LINE>impulse = -C / k;<NEW_LINE>} else {<NEW_LINE>impulse = 0.0f;<NEW_LINE>}<NEW_LINE>final Vec2 P = pool.popVec2();<NEW_LINE>P.x = impulse * ay.x;<NEW_LINE>P.y = impulse * ay.y;<NEW_LINE>float LA = impulse * sAy;<NEW_LINE>float LB = impulse * sBy;<NEW_LINE>cA.x -= m_invMassA * P.x;<NEW_LINE>cA.y -= m_invMassA * P.y;<NEW_LINE>aA -= m_invIA * LA;<NEW_LINE>cB.x += m_invMassB * P.x;<NEW_LINE>cB.y += m_invMassB * P.y;<NEW_LINE>aB += m_invIB * LB;<NEW_LINE>pool.pushVec2(3);<NEW_LINE>pool.pushRot(2);<NEW_LINE>// data.positions[m_indexA].c = cA;<NEW_LINE>data.positions[m_indexA].a = aA;<NEW_LINE>// data.positions[m_indexB].c = cB;<NEW_LINE>data.positions[m_indexB].a = aB;<NEW_LINE>return FXGLMath.<MASK><NEW_LINE>}
abs(C) <= JBoxSettings.linearSlop;
1,598,237
public void addAll(List<SourceSpan> other) {<NEW_LINE>if (other.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (sourceSpans == null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (sourceSpans.isEmpty()) {<NEW_LINE>sourceSpans.addAll(other);<NEW_LINE>} else {<NEW_LINE>int lastIndex = sourceSpans.size() - 1;<NEW_LINE>SourceSpan a = sourceSpans.get(lastIndex);<NEW_LINE>SourceSpan b = other.get(0);<NEW_LINE>if (a.getLineIndex() == b.getLineIndex() && a.getColumnIndex() + a.getLength() == b.getColumnIndex()) {<NEW_LINE>sourceSpans.set(lastIndex, SourceSpan.of(a.getLineIndex(), a.getColumnIndex(), a.getLength() + b.getLength()));<NEW_LINE>sourceSpans.addAll(other.subList(1, other.size()));<NEW_LINE>} else {<NEW_LINE>sourceSpans.addAll(other);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
sourceSpans = new ArrayList<>();
960,356
private Map<String, DependencyInfo> parseDepsFiles() throws IOException {<NEW_LINE>DepsFileRegexParser depsParser = createDepsFileParser();<NEW_LINE>Map<String, DependencyInfo> <MASK><NEW_LINE>for (SourceFile file : deps) {<NEW_LINE>if (!shouldSkipDepsFile(file)) {<NEW_LINE>List<DependencyInfo> depInfos = depsParser.parseFileReader(file.getName(), file.getCodeReader());<NEW_LINE>if (depInfos.isEmpty()) {<NEW_LINE>reportNoDepsInDepsFile(file.getName());<NEW_LINE>} else {<NEW_LINE>for (DependencyInfo info : depInfos) {<NEW_LINE>depsFiles.put(info.getPathRelativeToClosureBase(), removeRelativePathProvide(info));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// If a deps file also appears in srcs, our build tools will move it<NEW_LINE>// into srcs. So we need to scan all the src files for addDependency<NEW_LINE>// calls as well.<NEW_LINE>for (SourceFile src : srcs) {<NEW_LINE>if (!shouldSkipDepsFile(src)) {<NEW_LINE>List<DependencyInfo> srcInfos = depsParser.parseFileReader(src.getName(), src.getCodeReader());<NEW_LINE>for (DependencyInfo info : srcInfos) {<NEW_LINE>depsFiles.put(info.getPathRelativeToClosureBase(), removeRelativePathProvide(info));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return depsFiles;<NEW_LINE>}
depsFiles = new LinkedHashMap<>();
1,284,701
public void mergeWithRight(MeasureStack rightStack) {<NEW_LINE>// Merge the measures, part by part<NEW_LINE>for (int ip = 0; ip < rightStack.measures.size(); ip++) {<NEW_LINE>measures.get(ip).mergeWithRight(rightStack.measures.get(ip));<NEW_LINE>}<NEW_LINE>// Merge the stacks data<NEW_LINE>right = rightStack.right;<NEW_LINE>if (rightStack.actualDuration != null) {<NEW_LINE>actualDuration = (actualDuration == null) ? rightStack.actualDuration : actualDuration.plus(rightStack.actualDuration);<NEW_LINE>}<NEW_LINE>// Merge the repeat info<NEW_LINE>if (rightStack.isRepeat(RIGHT)) {<NEW_LINE>this.addRepeat(RIGHT);<NEW_LINE>}<NEW_LINE>// Beware, merged slots must have their stack & xOffset updated accordingly<NEW_LINE><MASK><NEW_LINE>for (Slot slot : slots) {<NEW_LINE>slot.setStack(this);<NEW_LINE>}<NEW_LINE>// TODO: what about the now "inside" barline (which may have a repeat sign) ???<NEW_LINE>}
slots.addAll(rightStack.slots);
576,755
public // ---------//<NEW_LINE>void process(SIGraph sig) {<NEW_LINE>final Sheet sheet = sig.getSystem().getSheet();<NEW_LINE>final int bracketGrowth = 2 * sheet.getInterline();<NEW_LINE>// Use a COPY of vertices, to reduce risks of concurrent modifications (but not all...)<NEW_LINE>Set<Inter> copy = new LinkedHashSet<>(sig.vertexSet());<NEW_LINE>for (Inter inter : copy) {<NEW_LINE>if (!inter.isRemoved()) {<NEW_LINE><MASK><NEW_LINE>if (bounds != null) {<NEW_LINE>// Dirty hack to make sure bracket serifs are fully painted<NEW_LINE>// (despite the fact that bracket serif is not included in their bounds)<NEW_LINE>if (inter.getShape() == Shape.BRACKET) {<NEW_LINE>bounds.grow(bracketGrowth, bracketGrowth);<NEW_LINE>}<NEW_LINE>if ((clip == null) || clip.intersects(bounds)) {<NEW_LINE>inter.accept(this);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
Rectangle bounds = inter.getBounds();
106,775
private boolean doFlow() {<NEW_LINE>int pushToken = getNextPushToken();<NEW_LINE>List<FlowAction> actions = new ArrayList<>();<NEW_LINE>for (int i = 0; i < Math.min(maxFlowsPerTick, getConduits().size()); i++) {<NEW_LINE>if (lastFlowIndex >= getConduits().size()) {<NEW_LINE>lastFlowIndex = 0;<NEW_LINE>}<NEW_LINE>flowFrom(getConduits().get(lastFlowIndex), actions, pushToken);<NEW_LINE>++lastFlowIndex;<NEW_LINE>}<NEW_LINE>actions.forEach(FlowAction::apply);<NEW_LINE>boolean result = !actions.isEmpty();<NEW_LINE>// Flush any tanks with a tiny bit left<NEW_LINE>List<GasConduit> <MASK><NEW_LINE>for (GasConduit con : getConduits()) {<NEW_LINE>if (con != null && con.getTank().getStored() < 10) {<NEW_LINE>toEmpty.add(con);<NEW_LINE>} else {<NEW_LINE>// some of the conduits have gas left in them so don't do the final drawGas yet<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (toEmpty.isEmpty()) {<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>List<LocatedGasHandler> externals = new ArrayList<>();<NEW_LINE>for (AbstractGasTankConduit con : getConduits()) {<NEW_LINE>Set<EnumFacing> extCons = con.getExternalConnections();<NEW_LINE>for (EnumFacing dir : extCons) {<NEW_LINE>if (con.canOutputToDir(dir)) {<NEW_LINE>IGasHandler externalTank = con.getExternalHandler(dir);<NEW_LINE>if (externalTank != null) {<NEW_LINE>externals.add(new LocatedGasHandler(externalTank, con.getBundle().getLocation().offset(dir), dir.getOpposite()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (externals.isEmpty()) {<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>toEmpty.forEach(con -> drainConduitToNearestExternal(con, externals));<NEW_LINE>return result;<NEW_LINE>}
toEmpty = new ArrayList<>();
775,953
public final EscapableStrContext escapableStr() throws RecognitionException {<NEW_LINE>EscapableStrContext _localctx = new EscapableStrContext(_ctx, getState());<NEW_LINE>enterRule(_localctx, 478, RULE_escapableStr);<NEW_LINE>try {<NEW_LINE>setState(3120);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>switch(_input.LA(1)) {<NEW_LINE>case IDENT:<NEW_LINE>enterOuterAlt(_localctx, 1);<NEW_LINE>{<NEW_LINE>setState(3117);<NEW_LINE>((EscapableStrContext) _localctx).i1 = match(IDENT);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case EVENTS:<NEW_LINE>enterOuterAlt(_localctx, 2);<NEW_LINE>{<NEW_LINE>setState(3118);<NEW_LINE>((EscapableStrContext) _localctx).i2 = match(EVENTS);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case TICKED_STRING_LITERAL:<NEW_LINE>enterOuterAlt(_localctx, 3);<NEW_LINE>{<NEW_LINE>setState(3119);<NEW_LINE>((EscapableStrContext) _localctx).i3 = match(TICKED_STRING_LITERAL);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new NoViableAltException(this);<NEW_LINE>}<NEW_LINE>} catch (RecognitionException re) {<NEW_LINE>_localctx.exception = re;<NEW_LINE>_errHandler.reportError(this, re);<NEW_LINE><MASK><NEW_LINE>} finally {<NEW_LINE>exitRule();<NEW_LINE>}<NEW_LINE>return _localctx;<NEW_LINE>}
_errHandler.recover(this, re);
1,712,900
protected void createControlsBefore(Composite group) {<NEW_LINE>copyHeaderCheck = UIUtils.createCheckbox(group, "Copy header", null, <MASK><NEW_LINE>copyRowsCheck = UIUtils.createCheckbox(group, "Copy row numbers", null, copySettings.isCopyRowNumbers(), 2);<NEW_LINE>quoteCellsCheck = UIUtils.createCheckbox(group, "Quote cell values", "Place cell value in quotes if it contains column or row delimiter", copySettings.isQuoteCells(), 2);<NEW_LINE>forceQuoteCheck = UIUtils.createCheckbox(group, "Always quote values", "Place all cell values in quotes", copySettings.isForceQuotes(), 2);<NEW_LINE>copyHtmlCheck = UIUtils.createCheckbox(group, "Copy as HTML", "Copy as HTML (in addition to plaintext format)", copySettings.isCopyHTML(), 2);<NEW_LINE>formatSelector = new ValueFormatSelector(group);<NEW_LINE>formatSelector.select(copySettings.getFormat());<NEW_LINE>}
copySettings.isCopyHeader(), 2);
1,604,308
public void applyGcodeParser(GcodeParser parser) throws Exception {<NEW_LINE>logger.log(Level.INFO, "Applying new parser filters.");<NEW_LINE>if (this.processedGcodeFile == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>File settingsDir = SettingsFactory.getSettingsDirectory();<NEW_LINE>File applyDir = new File(settingsDir, "apply_parser_files");<NEW_LINE>applyDir.mkdir();<NEW_LINE>File target = new File(applyDir, this.<MASK><NEW_LINE>java.nio.file.Files.deleteIfExists(target.toPath());<NEW_LINE>// Using a GcodeFileWriter instead of a GcodeStreamWriter so that the user can review a standard gcode file.<NEW_LINE>try (IGcodeWriter gcw = new GcodeFileWriter(target)) {<NEW_LINE>preprocessAndExportToFile(parser, this.processedGcodeFile, gcw);<NEW_LINE>}<NEW_LINE>this.setGcodeFile(target);<NEW_LINE>}
processedGcodeFile.getName() + ".apply.gcode");
705,415
final GetBucketStatisticsResult executeGetBucketStatistics(GetBucketStatisticsRequest getBucketStatisticsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getBucketStatisticsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetBucketStatisticsRequest> request = null;<NEW_LINE>Response<GetBucketStatisticsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetBucketStatisticsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getBucketStatisticsRequest));<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, "Macie2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetBucketStatistics");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetBucketStatisticsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetBucketStatisticsResultJsonUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
invoke(request, responseHandler, executionContext);
107,092
public boolean unplugNic(final Network network, final NicTO nic, final VirtualMachineTO vm, final ReservationContext context, final DeployDestination dest) throws ConcurrentOperationException, ResourceUnavailableException {<NEW_LINE>boolean result = true;<NEW_LINE>final VMInstanceVO router = _vmDao.findById(vm.getId());<NEW_LINE>if (router.getState() == State.Running) {<NEW_LINE>UserVmVO userVm = _userVmDao.findById(vm.getId());<NEW_LINE>if (userVm != null && userVm.getType() == VirtualMachine.Type.User) {<NEW_LINE>_userVmService.collectVmNetworkStatistics(userVm);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>final Commands cmds = new Commands(Command.OnError.Stop);<NEW_LINE>final UnPlugNicCommand unplugNicCmd = new UnPlugNicCommand(nic, vm.getName());<NEW_LINE>Map<String, Boolean> vlanToPersistenceMap = getVlanToPersistenceMapForVM(vm.getId());<NEW_LINE>if (MapUtils.isNotEmpty(vlanToPersistenceMap)) {<NEW_LINE>unplugNicCmd.setVlanToPersistenceMap(vlanToPersistenceMap);<NEW_LINE>}<NEW_LINE>cmds.addCommand("unplugnic", unplugNicCmd);<NEW_LINE>_agentMgr.send(dest.getHost().getId(), cmds);<NEW_LINE>final UnPlugNicAnswer unplugNicAnswer = cmds.getAnswer(UnPlugNicAnswer.class);<NEW_LINE>if (unplugNicAnswer == null || !unplugNicAnswer.getResult()) {<NEW_LINE><MASK><NEW_LINE>result = false;<NEW_LINE>}<NEW_LINE>} catch (final OperationTimedoutException e) {<NEW_LINE>throw new AgentUnavailableException("Unable to unplug nic from rotuer " + router + " from network " + network, dest.getHost().getId(), e);<NEW_LINE>}<NEW_LINE>} else if (router.getState() == State.Stopped || router.getState() == State.Stopping) {<NEW_LINE>s_logger.debug("Vm " + router.getInstanceName() + " is in " + router.getState() + ", so not sending unplug nic command to the backend");<NEW_LINE>} else {<NEW_LINE>String message = String.format("Unable to apply unplug nic, VM [%s] is not in the right state (\"Running\"). VM state [%s].", router.toString(), router.getState());<NEW_LINE>s_logger.warn(message);<NEW_LINE>throw new ResourceUnavailableException(message, DataCenter.class, router.getDataCenterId());<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
s_logger.warn("Unable to unplug nic from router " + router);
28,700
private RemotingCommand processReplyMessageRequest(final ChannelHandlerContext ctx, final RemotingCommand request, final SendMessageContext sendMessageContext, final SendMessageRequestHeader requestHeader) {<NEW_LINE>final RemotingCommand response = RemotingCommand.createResponseCommand(SendMessageResponseHeader.class);<NEW_LINE>final SendMessageResponseHeader responseHeader = (SendMessageResponseHeader) response.readCustomHeader();<NEW_LINE>response.setOpaque(request.getOpaque());<NEW_LINE>response.addExtField(MessageConst.PROPERTY_MSG_REGION, this.brokerController.getBrokerConfig().getRegionId());<NEW_LINE>response.addExtField(MessageConst.PROPERTY_TRACE_SWITCH, String.valueOf(this.brokerController.getBrokerConfig().isTraceOn()));<NEW_LINE>log.debug("receive SendReplyMessage request command, {}", request);<NEW_LINE>final long startTimstamp = this.brokerController.getBrokerConfig().getStartAcceptSendRequestTimeStamp();<NEW_LINE>if (this.brokerController.getMessageStore().now() < startTimstamp) {<NEW_LINE>response.setCode(ResponseCode.SYSTEM_ERROR);<NEW_LINE>response.setRemark(String.format("broker unable to service, until %s", UtilAll.timeMillisToHumanString2(startTimstamp)));<NEW_LINE>return response;<NEW_LINE>}<NEW_LINE>response.setCode(-1);<NEW_LINE>super.msgCheck(ctx, requestHeader, response);<NEW_LINE>if (response.getCode() != -1) {<NEW_LINE>return response;<NEW_LINE>}<NEW_LINE>final byte[] body = request.getBody();<NEW_LINE>int queueIdInt = requestHeader.getQueueId();<NEW_LINE>TopicConfig topicConfig = this.brokerController.getTopicConfigManager().selectTopicConfig(requestHeader.getTopic());<NEW_LINE>if (queueIdInt < 0) {<NEW_LINE>queueIdInt = ThreadLocalRandom.current().nextInt(99999999) % topicConfig.getWriteQueueNums();<NEW_LINE>}<NEW_LINE>MessageExtBrokerInner msgInner = new MessageExtBrokerInner();<NEW_LINE>msgInner.setTopic(requestHeader.getTopic());<NEW_LINE>msgInner.setQueueId(queueIdInt);<NEW_LINE>msgInner.setBody(body);<NEW_LINE>msgInner.setFlag(requestHeader.getFlag());<NEW_LINE>MessageAccessor.setProperties(msgInner, MessageDecoder.string2messageProperties(requestHeader.getProperties()));<NEW_LINE>msgInner.setPropertiesString(requestHeader.getProperties());<NEW_LINE>msgInner.setBornTimestamp(requestHeader.getBornTimestamp());<NEW_LINE>msgInner.setBornHost(ctx.channel().remoteAddress());<NEW_LINE>msgInner.<MASK><NEW_LINE>msgInner.setReconsumeTimes(requestHeader.getReconsumeTimes() == null ? 0 : requestHeader.getReconsumeTimes());<NEW_LINE>PushReplyResult pushReplyResult = this.pushReplyMessage(ctx, requestHeader, msgInner);<NEW_LINE>this.handlePushReplyResult(pushReplyResult, response, responseHeader, queueIdInt);<NEW_LINE>if (this.brokerController.getBrokerConfig().isStoreReplyMessageEnable()) {<NEW_LINE>PutMessageResult putMessageResult = this.brokerController.getMessageStore().putMessage(msgInner);<NEW_LINE>this.handlePutMessageResult(putMessageResult, request, msgInner, responseHeader, sendMessageContext, queueIdInt);<NEW_LINE>}<NEW_LINE>return response;<NEW_LINE>}
setStoreHost(this.getStoreHost());
597,219
public ModelAndView authsave(HttpServletRequest request, @Valid String id, @Valid String menus) {<NEW_LINE>Organ organData = organRepository.findByIdAndOrgi(<MASK><NEW_LINE>List<OrganRole> organRoleList = organRoleRes.findByOrgiAndOrgan(super.getOrgi(), organData);<NEW_LINE>organRoleRes.delete(organRoleList);<NEW_LINE>if (!StringUtils.isBlank(menus)) {<NEW_LINE>String[] menusarray = menus.split(",");<NEW_LINE>for (String menu : menusarray) {<NEW_LINE>OrganRole organRole = new OrganRole();<NEW_LINE>SysDic sysDic = Dict.getInstance().getDicItem(menu);<NEW_LINE>if (sysDic != null && !"0".equals(sysDic.getParentid())) {<NEW_LINE>organRole.setDicid(menu);<NEW_LINE>organRole.setDicvalue(sysDic.getCode());<NEW_LINE>organRole.setOrgan(organData);<NEW_LINE>organRole.setCreater(super.getUser(request).getId());<NEW_LINE>organRole.setOrgi(super.getOrgi(request));<NEW_LINE>organRole.setCreatetime(new Date());<NEW_LINE>organRoleRes.save(organRole);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return request(super.createView("redirect:/admin/organ/index.html?organ=" + organData.getId()));<NEW_LINE>}
id, super.getOrgi());
268,290
public static DeleteUserResponse unmarshall(DeleteUserResponse deleteUserResponse, UnmarshallerContext _ctx) {<NEW_LINE>deleteUserResponse.setRequestId(_ctx.stringValue("DeleteUserResponse.RequestId"));<NEW_LINE>deleteUserResponse.setCode(_ctx.stringValue("DeleteUserResponse.Code"));<NEW_LINE>deleteUserResponse.setData(_ctx.mapValue("DeleteUserResponse.Data"));<NEW_LINE>deleteUserResponse.setMessage<MASK><NEW_LINE>List<ErrorsItem> errors = new ArrayList<ErrorsItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DeleteUserResponse.Errors.Length"); i++) {<NEW_LINE>ErrorsItem errorsItem = new ErrorsItem();<NEW_LINE>errorsItem.setField(_ctx.stringValue("DeleteUserResponse.Errors[" + i + "].Field"));<NEW_LINE>errorsItem.setMessage(_ctx.stringValue("DeleteUserResponse.Errors[" + i + "].Message"));<NEW_LINE>errors.add(errorsItem);<NEW_LINE>}<NEW_LINE>deleteUserResponse.setErrors(errors);<NEW_LINE>return deleteUserResponse;<NEW_LINE>}
(_ctx.stringValue("DeleteUserResponse.Message"));
1,438,611
public SDVariable defineLayer(SameDiff sd, SDVariable layerInput, Map<String, SDVariable> paramTable, SDVariable mask) {<NEW_LINE>SDVariable weights = paramTable.get(DefaultParamInitializer.WEIGHT_KEY);<NEW_LINE>SDVariable logits = sd.tensorMmul(layerInput, weights, new int[] { 2 }, new int[] { 0 });<NEW_LINE>SDVariable reshapedLogits = sd.reshape(logits, layerInput.getShape()[0], layerInput.getShape()[1]);<NEW_LINE>SDVariable ai = sd.math().exp(reshapedLogits);<NEW_LINE>SDVariable aiSum = sd.sum(ai, 1);<NEW_LINE>SDVariable aiSumEps = sd.expandDims(aiSum.add(EPS), 1);<NEW_LINE>SDVariable attentionWeights = ai.div(aiSumEps);<NEW_LINE>SDVariable weightedInput = layerInput.mul(sd.expandDims(attentionWeights, 2));<NEW_LINE>return <MASK><NEW_LINE>}
sd.sum(weightedInput, 2);
595,044
private void createTextDrawInfo(final BinaryMapDataObject o, RenderingRuleSearchRequest render, RenderingContext rc, TagValuePair pair, final float xMid, float yMid, Path path, final PointF[] points, String name, String tagName) {<NEW_LINE>render.setInitialTagValueZoom(pair.tag, pair.value, rc.zoom, o);<NEW_LINE>render.setIntFilter(render.ALL.R_TEXT_LENGTH, name.length());<NEW_LINE>render.setStringFilter(render.ALL.R_NAME_TAG, tagName);<NEW_LINE>if (render.search(RenderingRulesStorage.TEXT_RULES)) {<NEW_LINE>if (render.getFloatPropertyValue(render.ALL.R_TEXT_SIZE) > 0) {<NEW_LINE>final TextDrawInfo text = new TextDrawInfo(name);<NEW_LINE>text.fillProperties(rc, render, xMid, yMid);<NEW_LINE>final String tagName2 = render.getStringPropertyValue(render.ALL.R_NAME_TAG2);<NEW_LINE>if (!Algorithms.isEmpty(tagName2)) {<NEW_LINE>o.getObjectNames().forEachEntry(new TIntObjectProcedure<String>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean execute(int tagid, String nname) {<NEW_LINE>String tagNameN2 = o.getMapIndex().decodeType(tagid).tag;<NEW_LINE>if (tagName2.equals(tagNameN2)) {<NEW_LINE>if (nname != null && nname.trim().length() > 0) {<NEW_LINE>text.text += " (" + nname + ")";<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>paintText.setTextSize(text.textSize);<NEW_LINE>Rect bs = new Rect();<NEW_LINE>paintText.getTextBounds(name, 0, name.length(), bs);<NEW_LINE>text.bounds = new QuadRect(bs.left, bs.top, bs.right, bs.bottom);<NEW_LINE>text.bounds.inset(-rc.getDensityValue(3), -rc.getDensityValue(10));<NEW_LINE>boolean display = true;<NEW_LINE>if (path != null) {<NEW_LINE>text.drawOnPath = path;<NEW_LINE>display = calculatePathToRotate(rc, text, points, render.getIntPropertyValue(render.ALL.R_TEXT_ON_PATH, 0) != 0);<NEW_LINE>}<NEW_LINE>if (text.drawOnPath == null) {<NEW_LINE>text.bounds.offset(text.centerX, text.centerY);<NEW_LINE>// shift to match alignment<NEW_LINE>text.bounds.offset(-text.bounds.width() / 2, 0);<NEW_LINE>} else {<NEW_LINE>text.bounds.offset(text.centerX - text.bounds.width() / 2, text.centerY - text.<MASK><NEW_LINE>}<NEW_LINE>if (display) {<NEW_LINE>rc.textToDraw.add(text);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
bounds.height() / 2);
268,941
private RelRoot replaceIsTrue(final RelDataTypeFactory typeFactory, RelRoot root) {<NEW_LINE>final RexShuttle callShuttle = new RexShuttle() {<NEW_LINE><NEW_LINE>RexBuilder builder = new RexBuilder(typeFactory);<NEW_LINE><NEW_LINE>public RexNode visitCall(RexCall call) {<NEW_LINE>call = (RexCall) super.visitCall(call);<NEW_LINE>if (call.getKind() == SqlKind.IS_TRUE) {<NEW_LINE>return builder.makeCall(SqlStdOperatorTable.AND, builder.makeCall(SqlStdOperatorTable.IS_NOT_NULL, call.getOperands().get(0)), call.getOperands().get(0));<NEW_LINE>} else if (call.getKind() == SqlKind.IS_NOT_TRUE) {<NEW_LINE>return builder.makeCall(SqlStdOperatorTable.OR, builder.makeCall(SqlStdOperatorTable.IS_NULL, call.getOperands().get(0)), builder.makeCall(SqlStdOperatorTable.NOT, call.getOperands().get(0)));<NEW_LINE>} else if (call.getKind() == SqlKind.IS_FALSE) {<NEW_LINE>return builder.makeCall(SqlStdOperatorTable.AND, builder.makeCall(SqlStdOperatorTable.IS_NOT_NULL, call.getOperands().get(0)), builder.makeCall(SqlStdOperatorTable.NOT, call.getOperands().get(0)));<NEW_LINE>} else if (call.getKind() == SqlKind.IS_NOT_FALSE) {<NEW_LINE>return builder.makeCall(SqlStdOperatorTable.OR, builder.makeCall(SqlStdOperatorTable.IS_NULL, call.getOperands().get(0)), call.getOperands().get(0));<NEW_LINE>}<NEW_LINE>return call;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>RelNode node = root.rel.accept(new RelShuttleImpl() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected RelNode visitChild(RelNode parent, int i, RelNode child) {<NEW_LINE>RelNode node = super.visitChild(parent, i, child);<NEW_LINE>return node.accept(callShuttle);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return new RelRoot(node, root.validatedRowType, root.kind, root.fields, root.<MASK><NEW_LINE>}
collation, Collections.emptyList());
528,319
public final Object invoke(Object proxy, Method method, Object[] args) throws Throwable {<NEW_LINE>String methodName = method.getName();<NEW_LINE>Class<?>[] parameterTypes = method.getParameterTypes();<NEW_LINE>boolean sslEngineVariant = (parameterTypes.length > 0) && SSLEngine.class.equals(parameterTypes[parameterTypes.length - 1]);<NEW_LINE>if ("getKey".equals(methodName)) {<NEW_LINE>if (sslEngineVariant) {<NEW_LINE>return getKey((String) args[0], (String) args[1], <MASK><NEW_LINE>} else {<NEW_LINE>return getKey((String) args[0], (String) args[1], (Socket) args[2]);<NEW_LINE>}<NEW_LINE>} else if ("chooseServerKeyIdentityHint".equals(methodName)) {<NEW_LINE>if (sslEngineVariant) {<NEW_LINE>return chooseServerKeyIdentityHint((SSLEngine) args[0]);<NEW_LINE>} else {<NEW_LINE>return chooseServerKeyIdentityHint((Socket) args[0]);<NEW_LINE>}<NEW_LINE>} else if ("chooseClientKeyIdentity".equals(methodName)) {<NEW_LINE>if (sslEngineVariant) {<NEW_LINE>return chooseClientKeyIdentity((String) args[0], (SSLEngine) args[1]);<NEW_LINE>} else {<NEW_LINE>return chooseClientKeyIdentity((String) args[0], (Socket) args[1]);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("Unexpected method: " + method);<NEW_LINE>}<NEW_LINE>}
(SSLEngine) args[2]);
1,116,032
// Loads properties from the specified resource. The properties are of<NEW_LINE>// the form <code>key=value</code>, one property per line.<NEW_LINE>@CallerSensitive<NEW_LINE>public static Hashtable loadMessages(String resourceName) throws IOException {<NEW_LINE>InputStream resourceStream;<NEW_LINE>String language, region, variant;<NEW_LINE>String resName;<NEW_LINE>Properties props = new Properties();<NEW_LINE>Locale defLocale = Locale.getDefault();<NEW_LINE>language = defLocale.getLanguage();<NEW_LINE>// $NON-NLS-1$<NEW_LINE>if (language.length() == 0)<NEW_LINE>language = "en";<NEW_LINE>region = defLocale.getCountry();<NEW_LINE>// $NON-NLS-1$<NEW_LINE>if (region.length() == 0)<NEW_LINE>region = "US";<NEW_LINE>variant = defLocale.getVariant();<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>resourceStream = loader.getResourceAsStream(resName);<NEW_LINE>resourceStream.close();<NEW_LINE>return props;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$<NEW_LINE>resName = resourceName + "_" + language + "_" + region + ".properties";<NEW_LINE>resourceStream = loader.getResourceAsStream(resName);<NEW_LINE>resourceStream = loader.getResourceAsStream(resName);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>resourceStream = <MASK>
loader.getResourceAsStream(resourceName + ".properties");
239,559
public void push(Yaml.Block block) {<NEW_LINE>if (key == null && block instanceof Yaml.Scalar) {<NEW_LINE>key = (Yaml.Scalar) block;<NEW_LINE>} else {<NEW_LINE>String keySuffix = block.getPrefix();<NEW_LINE>block = block.withPrefix(keySuffix.substring(commentAwareIndexOf(':', keySuffix) + 1));<NEW_LINE>// Begin moving whitespace from the key to the entry that contains the key<NEW_LINE>String originalKeyPrefix = key.getPrefix();<NEW_LINE>key = key.withPrefix("");<NEW_LINE>// When a dash, indicating the beginning of a sequence, is present whitespace before it will be handled by the SequenceEntry<NEW_LINE>// Similarly if the prefix includes a ':', it will be owned by the mapping that contains this mapping<NEW_LINE>// So this entry's prefix begins after any such delimiter<NEW_LINE>int entryPrefixStartIndex = Math.max(commentAwareIndexOf('-', originalKeyPrefix), commentAwareIndexOf(':', originalKeyPrefix)) + 1;<NEW_LINE>String <MASK><NEW_LINE>String beforeMappingValueIndicator = keySuffix.substring(0, Math.max(commentAwareIndexOf(':', keySuffix), 0));<NEW_LINE>entries.add(new Yaml.Mapping.Entry(randomId(), entryPrefix, Markers.EMPTY, key, beforeMappingValueIndicator, block));<NEW_LINE>key = null;<NEW_LINE>}<NEW_LINE>}
entryPrefix = originalKeyPrefix.substring(entryPrefixStartIndex);
1,659,233
private Document updateOrCreateIndexNonSuperColumnFamily(EntityMetadata metadata, final MetamodelImpl metaModel, Object entity, String parentId, Class<?> clazz, boolean isUpdate, boolean isEmbeddedId, Object rowKey) {<NEW_LINE>Document document = new Document();<NEW_LINE>// Add entity class, PK info into document<NEW_LINE>addEntityClassToDocument(metadata, entity, document, metaModel);<NEW_LINE>// Add all entity fields(columns) into document<NEW_LINE>addEntityFieldsToDocument(metadata, entity, document, metaModel);<NEW_LINE>addAssociatedEntitiesToDocument(metadata, entity, document, metaModel);<NEW_LINE>addParentKeyToDocument(parentId, document, clazz);<NEW_LINE>if (isUpdate) {<NEW_LINE>if (isEmbeddedId) {<NEW_LINE>// updating delimited composite key<NEW_LINE>String compositeId = KunderaCoreUtils.prepareCompositeKey(metadata.getIdAttribute(), metaModel, rowKey);<NEW_LINE>updateDocument(compositeId, document, null);<NEW_LINE>// updating sub parts of composite key<NEW_LINE>EmbeddableType embeddableId = metaModel.embeddable(metadata.<MASK><NEW_LINE>Set<Attribute> embeddedAttributes = embeddableId.getAttributes();<NEW_LINE>updateOrCreateIndexEmbeddedIdFields(embeddedAttributes, metaModel, document, metadata, rowKey);<NEW_LINE>} else {<NEW_LINE>updateDocument(rowKey.toString(), document, null);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>indexDocument(metadata, document);<NEW_LINE>}<NEW_LINE>return document;<NEW_LINE>}
getIdAttribute().getBindableJavaType());
1,685,281
public com.amazonaws.services.polly.model.MarksNotSupportedForFormatException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.polly.model.MarksNotSupportedForFormatException marksNotSupportedForFormatException = new com.amazonaws.services.polly.model.MarksNotSupportedForFormatException(null);<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return marksNotSupportedForFormatException;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
757,473
public void plot(Staff staff) {<NEW_LINE>final <MASK><NEW_LINE>final String frameTitle = sheet.getId() + " header staff#" + staff.getId();<NEW_LINE>final ChartPlotter plotter = new ChartPlotter(frameTitle, "Abscissae - staff interline:" + staff.getSpecificInterline(), "Counts");<NEW_LINE>// Draw time sig portion<NEW_LINE>String timeString = timeColumn.addPlot(plotter, staff);<NEW_LINE>// Draw key sig portion<NEW_LINE>String keyString = keyColumn.addPlot(plotter, staff, maxHeaderWidth);<NEW_LINE>// Get clef info<NEW_LINE>ClefInter clef = staff.getHeader().clef;<NEW_LINE>String clefString = (clef != null) ? clef.getKind().toString() : null;<NEW_LINE>{<NEW_LINE>// Draw the zero reference line<NEW_LINE>final int xMin = staff.getHeaderStart();<NEW_LINE>final int xMax = xMin + maxHeaderWidth;<NEW_LINE>// No autosort<NEW_LINE>XYSeries series = new XYSeries("Zero", false);<NEW_LINE>series.add(xMin, 0);<NEW_LINE>series.add(xMax, 0);<NEW_LINE>plotter.add(series, Colors.CHART_ZERO, true);<NEW_LINE>}<NEW_LINE>// Build chart title: clef + key + time<NEW_LINE>StringBuilder chartTitle = new StringBuilder(frameTitle);<NEW_LINE>if (clefString != null) {<NEW_LINE>chartTitle.append(" ").append(clefString);<NEW_LINE>}<NEW_LINE>if (keyString != null) {<NEW_LINE>chartTitle.append(" ").append(keyString);<NEW_LINE>}<NEW_LINE>if (timeString != null) {<NEW_LINE>chartTitle.append(" ").append(timeString);<NEW_LINE>}<NEW_LINE>plotter.setChartTitle(chartTitle.toString());<NEW_LINE>// Display frame<NEW_LINE>plotter.display(frameTitle, new Point(20 * staff.getId(), 20 * staff.getId()));<NEW_LINE>}
Sheet sheet = system.getSheet();
1,364,370
public OperationResult executeCommand(long index, long sequence, long timestamp, RaftSession session, PrimitiveOperation operation) {<NEW_LINE>// If the service has been deleted then throw an unknown service exception.<NEW_LINE>if (deleted) {<NEW_LINE><MASK><NEW_LINE>throw new RaftException.UnknownService("Service " + serviceName + " has been deleted");<NEW_LINE>}<NEW_LINE>// If the session is not open, fail the request.<NEW_LINE>if (!session.getState().active()) {<NEW_LINE>log.warn("Session not open: {}", session);<NEW_LINE>throw new RaftException.UnknownSession("Unknown session: " + session.sessionId());<NEW_LINE>}<NEW_LINE>// Update the session's timestamp to prevent it from being expired.<NEW_LINE>session.setLastUpdated(timestamp);<NEW_LINE>// Update the state machine index/timestamp.<NEW_LINE>tick(index, timestamp);<NEW_LINE>// If the command's sequence number is less than the next session sequence number then that indicates that<NEW_LINE>// we've received a command that was previously applied to the state machine. Ensure linearizability by<NEW_LINE>// returning the cached response instead of applying it to the user defined state machine.<NEW_LINE>if (sequence > 0 && sequence < session.nextCommandSequence()) {<NEW_LINE>log.trace("Returning cached result for command with sequence number {} < {}", sequence, session.nextCommandSequence());<NEW_LINE>return sequenceCommand(index, sequence, session);<NEW_LINE>} else // If we've made it this far, the command must have been applied in the proper order as sequenced by the<NEW_LINE>// session. This should be the case for most commands applied to the state machine.<NEW_LINE>{<NEW_LINE>// Execute the command in the state machine thread. Once complete, the CompletableFuture callback will be completed<NEW_LINE>// in the state machine thread. Register the result in that thread and then complete the future in the caller's thread.<NEW_LINE>return applyCommand(index, sequence, timestamp, operation, session);<NEW_LINE>}<NEW_LINE>}
log.warn("Service {} has been deleted by another process", serviceName);
1,702,595
public void marshall(CreateOpsItemRequest createOpsItemRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (createOpsItemRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(createOpsItemRequest.getDescription(), DESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(createOpsItemRequest.getOpsItemType(), OPSITEMTYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(createOpsItemRequest.getOperationalData(), OPERATIONALDATA_BINDING);<NEW_LINE>protocolMarshaller.marshall(createOpsItemRequest.getNotifications(), NOTIFICATIONS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createOpsItemRequest.getPriority(), PRIORITY_BINDING);<NEW_LINE>protocolMarshaller.marshall(createOpsItemRequest.getRelatedOpsItems(), RELATEDOPSITEMS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createOpsItemRequest.getSource(), SOURCE_BINDING);<NEW_LINE>protocolMarshaller.marshall(createOpsItemRequest.getTitle(), TITLE_BINDING);<NEW_LINE>protocolMarshaller.marshall(createOpsItemRequest.getTags(), TAGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createOpsItemRequest.getCategory(), CATEGORY_BINDING);<NEW_LINE>protocolMarshaller.marshall(createOpsItemRequest.getSeverity(), SEVERITY_BINDING);<NEW_LINE>protocolMarshaller.marshall(createOpsItemRequest.getActualStartTime(), ACTUALSTARTTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(createOpsItemRequest.getActualEndTime(), ACTUALENDTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(createOpsItemRequest.getPlannedStartTime(), PLANNEDSTARTTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(createOpsItemRequest.getPlannedEndTime(), PLANNEDENDTIME_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + <MASK><NEW_LINE>}<NEW_LINE>}
e.getMessage(), e);
1,816,053
public StatisticsTaskResult call() throws Exception {<NEW_LINE>checkStatisticsDesc();<NEW_LINE>List<TaskResult<MASK><NEW_LINE>for (StatisticsDesc statsDesc : statsDescs) {<NEW_LINE>StatsCategory category = statsDesc.getStatsCategory();<NEW_LINE>StatsGranularity granularity = statsDesc.getStatsGranularity();<NEW_LINE>TaskResult result = createNewTaskResult(category, granularity);<NEW_LINE>List<StatsType> statsTypes = statsDesc.getStatsTypes();<NEW_LINE>for (StatsType statsType : statsTypes) {<NEW_LINE>switch(statsType) {<NEW_LINE>case MAX_SIZE:<NEW_LINE>case AVG_SIZE:<NEW_LINE>getColSize(category, statsType, result);<NEW_LINE>break;<NEW_LINE>case ROW_COUNT:<NEW_LINE>getRowCount(category.getDbId(), category.getTableId(), granularity, result);<NEW_LINE>break;<NEW_LINE>case DATA_SIZE:<NEW_LINE>getDataSize(category.getDbId(), category.getTableId(), granularity, result);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new DdlException("Unsupported statistics type(" + statsType + ").");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>taskResults.add(result);<NEW_LINE>}<NEW_LINE>return new StatisticsTaskResult(taskResults);<NEW_LINE>}
> taskResults = Lists.newArrayList();
1,223,942
private static void download(String url, File saveTo, Runnable onFinish) throws Exception {<NEW_LINE>BCV.log("Downloading from: " + url);<NEW_LINE>BytecodeViewer.showMessage("Downloading the jar in the background, when it's finished you will be alerted with another message box." + nl + nl + "Expect this to take several minutes.");<NEW_LINE>try (InputStream is = new URL(url).openConnection().getInputStream();<NEW_LINE>FileOutputStream fos = new FileOutputStream(saveTo)) {<NEW_LINE>byte[] buffer = new byte[8192];<NEW_LINE>int len;<NEW_LINE>int downloaded = 0;<NEW_LINE>boolean flag = false;<NEW_LINE>while ((len = is.read(buffer)) > 0) {<NEW_LINE>fos.write(buffer, 0, len);<NEW_LINE>fos.flush();<NEW_LINE>downloaded += 8192;<NEW_LINE>int mbs = downloaded / 1048576;<NEW_LINE>if (mbs % 5 == 0 && mbs != 0) {<NEW_LINE>if (!flag)<NEW_LINE>System.out.println("Downloaded " + mbs + "MBs so far");<NEW_LINE>flag = true;<NEW_LINE>} else<NEW_LINE>flag = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>BCV.log("Download finished!");<NEW_LINE>BytecodeViewer.showMessage(<MASK><NEW_LINE>onFinish.run();<NEW_LINE>}
"Download successful! You can find the updated program at " + saveTo.getAbsolutePath());
719,745
private void onAddNext() {<NEW_LINE>if (btnAddNext.isDisabled())<NEW_LINE>return;<NEW_LINE>lblCreationWarning.setText("");<NEW_LINE>String url = txtServerUrl.getText();<NEW_LINE>nextPane.showSpinner();<NEW_LINE>addServerPane.setDisable(true);<NEW_LINE>Task.runAsync(() -> {<NEW_LINE>serverBeingAdded = AuthlibInjectorServer.locateServer(url);<NEW_LINE>}).whenComplete(Schedulers.javafx(), exception -> {<NEW_LINE>addServerPane.setDisable(false);<NEW_LINE>nextPane.hideSpinner();<NEW_LINE>if (exception == null) {<NEW_LINE>lblServerName.setText(serverBeingAdded.getName());<NEW_LINE>lblServerUrl.<MASK><NEW_LINE>lblServerWarning.setVisible("http".equals(NetworkUtils.toURL(serverBeingAdded.getUrl()).getProtocol()));<NEW_LINE>root.setContent(confirmServerPane, ContainerAnimations.SWIPE_LEFT.getAnimationProducer());<NEW_LINE>} else {<NEW_LINE>LOG.log(Level.WARNING, "Failed to resolve auth server: " + url, exception);<NEW_LINE>lblCreationWarning.setText(resolveFetchExceptionMessage(exception));<NEW_LINE>}<NEW_LINE>}).start();<NEW_LINE>}
setText(serverBeingAdded.getUrl());
1,009,005
static CompletableFuture<byte[]> sendrecv(InetSocketAddress local, InetSocketAddress remote, Message query, byte[] data, Duration timeout) {<NEW_LINE>CompletableFuture<byte[]> f = new CompletableFuture<>();<NEW_LINE>try {<NEW_LINE>final Selector selector = selector();<NEW_LINE>long endTime = System.nanoTime() + timeout.toNanos();<NEW_LINE>ChannelState channel = channelMap.computeIfAbsent(new ChannelKey(local, remote), key -> {<NEW_LINE>try {<NEW_LINE>log.trace("Opening async channel for l={}/r={}", local, remote);<NEW_LINE>SocketChannel c = SocketChannel.open();<NEW_LINE>c.configureBlocking(false);<NEW_LINE>if (local != null) {<NEW_LINE>c.bind(local);<NEW_LINE>}<NEW_LINE>c.connect(remote);<NEW_LINE>return new ChannelState(c);<NEW_LINE>} catch (IOException e) {<NEW_LINE>f.completeExceptionally(e);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>if (channel != null) {<NEW_LINE>log.trace("Creating transaction for {}/{}", query.getQuestion().getName(), Type.string(query.getQuestion().getType()));<NEW_LINE>Transaction t = new Transaction(query, data, endTime, channel.channel, f);<NEW_LINE><MASK><NEW_LINE>registrationQueue.add(channel);<NEW_LINE>selector.wakeup();<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>f.completeExceptionally(e);<NEW_LINE>}<NEW_LINE>return f;<NEW_LINE>}
channel.pendingTransactions.add(t);
929,513
public SubmissionCCLicenseUrlRest findByRightsByQuestions() {<NEW_LINE>ServletRequest servletRequest = requestService.getCurrentRequest().getServletRequest();<NEW_LINE>Map<String, String[]> requestParameterMap = servletRequest.getParameterMap();<NEW_LINE>Map<String, String> parameterMap = new HashMap<>();<NEW_LINE>String licenseId = servletRequest.getParameter("license");<NEW_LINE>if (StringUtils.isBlank(licenseId)) {<NEW_LINE>throw new DSpaceBadRequestException("A \"license\" parameter needs to be provided.");<NEW_LINE>}<NEW_LINE>// Loop through parameters to find answer parameters, adding them to the parameterMap. Zero or more answers<NEW_LINE>// may exist, as some CC licenses do not require answers<NEW_LINE>for (String parameter : requestParameterMap.keySet()) {<NEW_LINE>if (StringUtils.startsWith(parameter, "answer_")) {<NEW_LINE>String field = StringUtils.substringAfter(parameter, "answer_");<NEW_LINE>String answer = "";<NEW_LINE>if (requestParameterMap.get(parameter).length > 0) {<NEW_LINE>answer = requestParameterMap.get(parameter)[0];<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>Map<String, String> fullParamMap = creativeCommonsService.retrieveFullAnswerMap(licenseId, parameterMap);<NEW_LINE>if (fullParamMap == null) {<NEW_LINE>throw new ResourceNotFoundException("No CC License could be matched on the provided ID: " + licenseId);<NEW_LINE>}<NEW_LINE>boolean licenseContainsCorrectInfo = creativeCommonsService.verifyLicenseInformation(licenseId, fullParamMap);<NEW_LINE>if (!licenseContainsCorrectInfo) {<NEW_LINE>throw new DSpaceBadRequestException("The provided answers do not match the required fields for the provided license.");<NEW_LINE>}<NEW_LINE>String licenseUri = creativeCommonsService.retrieveLicenseUri(licenseId, fullParamMap);<NEW_LINE>SubmissionCCLicenseUrl submissionCCLicenseUrl = new SubmissionCCLicenseUrl(licenseUri, licenseUri);<NEW_LINE>if (StringUtils.isBlank(licenseUri)) {<NEW_LINE>throw new ResourceNotFoundException("No CC License URI could be found for ID: " + licenseId);<NEW_LINE>}<NEW_LINE>return converter.toRest(submissionCCLicenseUrl, utils.obtainProjection());<NEW_LINE>}
parameterMap.put(field, answer);
1,465,772
private String substBindings(String query, BindingSet bindings) {<NEW_LINE>StringBuffer buf = new StringBuffer();<NEW_LINE>String delim = " ,)(;.";<NEW_LINE>int i = 0;<NEW_LINE>char ch;<NEW_LINE>int qlen = query.length();<NEW_LINE>while (i < qlen) {<NEW_LINE>ch <MASK><NEW_LINE>if (ch == '\\') {<NEW_LINE>buf.append(ch);<NEW_LINE>if (i < qlen)<NEW_LINE>buf.append(query.charAt(i++));<NEW_LINE>} else if (ch == '"' || ch == '\'') {<NEW_LINE>char end = ch;<NEW_LINE>buf.append(ch);<NEW_LINE>while (i < qlen) {<NEW_LINE>ch = query.charAt(i++);<NEW_LINE>buf.append(ch);<NEW_LINE>if (ch == end)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} else if (ch == '?') {<NEW_LINE>// Parameter<NEW_LINE>String varData = null;<NEW_LINE>int j = i;<NEW_LINE>while (j < qlen && delim.indexOf(query.charAt(j)) < 0) j++;<NEW_LINE>if (j != i) {<NEW_LINE>String varName = query.substring(i, j);<NEW_LINE>Value val = bindings.getValue(varName);<NEW_LINE>if (val != null) {<NEW_LINE>varData = stringForValue(val);<NEW_LINE>i = j;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (varData != null)<NEW_LINE>buf.append(varData);<NEW_LINE>else<NEW_LINE>buf.append(ch);<NEW_LINE>} else {<NEW_LINE>buf.append(ch);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return buf.toString();<NEW_LINE>}
= query.charAt(i++);
608,218
public void displayErrorMessage() {<NEW_LINE>if (error == null)<NEW_LINE>return;<NEW_LINE>if (errorAnnotation == null)<NEW_LINE>errorAnnotation = new org.openide.text.Annotation() {<NEW_LINE><NEW_LINE>public String getAnnotationType() {<NEW_LINE>// NOI18N<NEW_LINE>return "xml-j2ee-annotation";<NEW_LINE>}<NEW_LINE><NEW_LINE>public String getShortDescription() {<NEW_LINE>return NbBundle.<MASK><NEW_LINE>}<NEW_LINE>};<NEW_LINE>if (inOut == null)<NEW_LINE>inOut = org.openide.windows.IOProvider.getDefault().getIO(NbBundle.getMessage(XMLJ2eeDataObject.class, "TXT_parser"), false);<NEW_LINE>inOut.setFocusTaken(false);<NEW_LINE>OutputWriter outputWriter = inOut.getOut();<NEW_LINE>int line = Math.max(0, error.getErrorLine());<NEW_LINE>LineCookie cookie = getCookie(LineCookie.class);<NEW_LINE>// getting Line object<NEW_LINE>Line xline = cookie.getLineSet().getCurrent(line == 0 ? 0 : line - 1);<NEW_LINE>// attaching Annotation<NEW_LINE>errorAnnotation.attach(xline);<NEW_LINE>try {<NEW_LINE>outputWriter.reset();<NEW_LINE>// defining of new OutputListener<NEW_LINE>IOCtl outList = new IOCtl(xline);<NEW_LINE>outputWriter.println(this.getOutputStringForInvalidDocument(error), outList);<NEW_LINE>} catch (IOException e) {<NEW_LINE>// NOI18N<NEW_LINE>Logger.getLogger("XMLJ2eeDataObject").log(Level.FINE, "ignored exception", e);<NEW_LINE>}<NEW_LINE>}
getMessage(XMLJ2eeDataObject.class, "HINT_XMLErrorDescription");
1,355,489
public static void drawNumbers(Graphics2D g2, List<PointIndex2D_F64> points, @Nullable Point2Transform2_F32 transform, double scale) {<NEW_LINE>Font regular = new Font("Serif", Font.PLAIN, 16);<NEW_LINE>g2.setFont(regular);<NEW_LINE>Point2D_F32 adj = new Point2D_F32();<NEW_LINE>AffineTransform origTran = g2.getTransform();<NEW_LINE>for (int i = 0; i < points.size(); i++) {<NEW_LINE>Point2D_F64 p = points.get(i).p;<NEW_LINE>int gridIndex = points.get(i).index;<NEW_LINE>if (transform != null) {<NEW_LINE>transform.compute((float) p.x, (float) p.y, adj);<NEW_LINE>} else {<NEW_LINE>adj.setTo((float) p.x, (float) p.y);<NEW_LINE>}<NEW_LINE>String text = String.format("%2d", gridIndex);<NEW_LINE>int x = (int) (adj.x * scale);<NEW_LINE>int y = (int) (adj.y * scale);<NEW_LINE>g2.setColor(Color.BLACK);<NEW_LINE>g2.drawString(text, x - 1, y);<NEW_LINE>g2.drawString(text, x + 1, y);<NEW_LINE>g2.drawString(text, x, y - 1);<NEW_LINE>g2.drawString(text, x, y + 1);<NEW_LINE>g2.setTransform(origTran);<NEW_LINE><MASK><NEW_LINE>g2.drawString(text, x, y);<NEW_LINE>}<NEW_LINE>}
g2.setColor(Color.GREEN);
1,031,498
public static com.hazelcast.cache.impl.CacheEventDataImpl decode(ClientMessage.ForwardFrameIterator iterator) {<NEW_LINE>// begin frame<NEW_LINE>iterator.next();<NEW_LINE>ClientMessage.Frame initialFrame = iterator.next();<NEW_LINE>int cacheEventType = decodeInt(initialFrame.content, CACHE_EVENT_TYPE_FIELD_OFFSET);<NEW_LINE>boolean oldValueAvailable = <MASK><NEW_LINE>java.lang.String name = StringCodec.decode(iterator);<NEW_LINE>com.hazelcast.internal.serialization.Data dataKey = CodecUtil.decodeNullable(iterator, DataCodec::decode);<NEW_LINE>com.hazelcast.internal.serialization.Data dataValue = CodecUtil.decodeNullable(iterator, DataCodec::decode);<NEW_LINE>com.hazelcast.internal.serialization.Data dataOldValue = CodecUtil.decodeNullable(iterator, DataCodec::decode);<NEW_LINE>fastForwardToEndFrame(iterator);<NEW_LINE>return CustomTypeFactory.createCacheEventData(name, cacheEventType, dataKey, dataValue, dataOldValue, oldValueAvailable);<NEW_LINE>}
decodeBoolean(initialFrame.content, OLD_VALUE_AVAILABLE_FIELD_OFFSET);
1,484,311
public ConfigHolder<T> call() {<NEW_LINE>if (!started) {<NEW_LINE>watchedConfigs.put(key, new ConfigHolder<T>(null, serde));<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>// Multiple of these callables can be submitted at the same time, but the callables themselves<NEW_LINE>// are executed serially, so double check that it hasn't already been populated.<NEW_LINE>if (!watchedConfigs.containsKey(key)) {<NEW_LINE>byte[] value = dbConnector.lookup(configTable, "name", "payload", key);<NEW_LINE>ConfigHolder<T> holder = new ConfigHolder<T>(value, serde);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.warn(e, "Failed loading config for key[%s]", key);<NEW_LINE>watchedConfigs.put(key, new ConfigHolder<T>(null, serde));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return watchedConfigs.get(key);<NEW_LINE>}
watchedConfigs.put(key, holder);
912,993
default Duration computeDelay(ExecutionContext<R> context) {<NEW_LINE>DelayablePolicyConfig<R> config = getConfig();<NEW_LINE>Duration computed = null;<NEW_LINE>if (context != null && config.getDelayFn() != null) {<NEW_LINE><MASK><NEW_LINE>Throwable exception = context.getLastException();<NEW_LINE>R delayResult = config.getDelayResult();<NEW_LINE>Class<? extends Throwable> delayFailure = config.getDelayException();<NEW_LINE>boolean delayResultMatched = delayResult == null || delayResult.equals(result);<NEW_LINE>boolean delayExceptionMatched = delayFailure == null || (exception != null && delayFailure.isAssignableFrom(exception.getClass()));<NEW_LINE>if (delayResultMatched && delayExceptionMatched) {<NEW_LINE>try {<NEW_LINE>computed = Durations.ofSafeNanos(config.getDelayFn().get(context));<NEW_LINE>} catch (Throwable e) {<NEW_LINE>if (e instanceof RuntimeException)<NEW_LINE>throw (RuntimeException) e;<NEW_LINE>else<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return computed != null && !computed.isNegative() ? computed : null;<NEW_LINE>}
R result = context.getLastResult();
1,198,302
final GetRestApisResult executeGetRestApis(GetRestApisRequest getRestApisRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getRestApisRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetRestApisRequest> request = null;<NEW_LINE>Response<GetRestApisResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetRestApisRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getRestApisRequest));<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, "API Gateway");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetRestApis");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetRestApisResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetRestApisResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
1,536,239
public void run() {<NEW_LINE>for (int loop = 1; loop < 3; loop++) {<NEW_LINE>try {<NEW_LINE>event = Integer.valueOf(loop);<NEW_LINE>// Add event to the buffer.<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(tc, "Adding event: " + event, this);<NEW_LINE>}<NEW_LINE>bufferMgr.add(event);<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>stopSource();<NEW_LINE>FFDCFilter.processException(e, this.getClass().getName(), "126", this);<NEW_LINE>} finally {<NEW_LINE>Tr.info(tc, "This is a info message");<NEW_LINE>Tr.warning(tc, "This is a warning message");<NEW_LINE>Tr.fatal(tc, "This is a fatal message");<NEW_LINE>Tr.error(tc, "This is an error message");<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
Tr.audit(tc, "This is an audit message");
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 = context.commands.get(element);<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><MASK><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>}
processEnclosedElements(context, roundEnv, enclosedElements);
1,705,863
public void sendJson(HttpServletRequest req, HttpServletResponse resp) {<NEW_LINE>HollowHistoricalState historicalState = ui.getHistory().getHistoricalState(Long.parseLong(<MASK><NEW_LINE>List<HistoryStateTypeChangeSummary> typeChanges = new ArrayList<HistoryStateTypeChangeSummary>();<NEW_LINE>for (Map.Entry<String, HollowHistoricalStateTypeKeyOrdinalMapping> entry : historicalState.getKeyOrdinalMapping().getTypeMappings().entrySet()) {<NEW_LINE>HistoryStateTypeChangeSummary typeChange = new HistoryStateTypeChangeSummary(historicalState.getVersion(), entry.getKey(), entry.getValue());<NEW_LINE>if (!typeChange.isEmpty())<NEW_LINE>typeChanges.add(typeChange);<NEW_LINE>}<NEW_LINE>List<HollowHeaderEntry> headerEntries = getHeaderEntries(historicalState);<NEW_LINE>Map<String, String> params = new HashMap<String, String>();<NEW_LINE>for (HollowHeaderEntry headerEntry : headerEntries) {<NEW_LINE>String key = headerEntry.getKey();<NEW_LINE>if (key.equals("VIP")) {<NEW_LINE>params.put("fromVip", headerEntry.getFromValue());<NEW_LINE>params.put("toVip", headerEntry.getToValue());<NEW_LINE>}<NEW_LINE>if (key.equals("dataVersion")) {<NEW_LINE>params.put("fromVersion", headerEntry.getFromValue());<NEW_LINE>params.put("toVersion", headerEntry.getToValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Map<String, Object> data = new HashMap<String, Object>();<NEW_LINE>data.put("params", params);<NEW_LINE>data.put("objectTypes", typeChanges);<NEW_LINE>// resp.setContentType("application/json");<NEW_LINE>try {<NEW_LINE>PrintWriter out = resp.getWriter();<NEW_LINE>Gson gson = new Gson();<NEW_LINE>String json = gson.toJson(data);<NEW_LINE>out.println(json);<NEW_LINE>} catch (IOException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}
req.getParameter("version")));
1,198,255
public void mediate() {<NEW_LINE>while (!Thread.currentThread().isInterrupted()) {<NEW_LINE>ZMQ.Poller items = ctx.createPoller(1);<NEW_LINE>items.register(socket, ZMQ.Poller.POLLIN);<NEW_LINE>if (items.poll(HEARTBEAT_INTERVAL) == -1)<NEW_LINE>// Interrupted<NEW_LINE>break;<NEW_LINE>if (items.pollin(0)) {<NEW_LINE>ZMsg <MASK><NEW_LINE>if (msg == null)<NEW_LINE>// Interrupted<NEW_LINE>break;<NEW_LINE>if (verbose) {<NEW_LINE>log.format("I: received message:\n");<NEW_LINE>msg.dump(log.out());<NEW_LINE>}<NEW_LINE>ZFrame sender = msg.pop();<NEW_LINE>ZFrame empty = msg.pop();<NEW_LINE>ZFrame header = msg.pop();<NEW_LINE>if (MDP.C_CLIENT.frameEquals(header)) {<NEW_LINE>processClient(sender, msg);<NEW_LINE>} else if (MDP.W_WORKER.frameEquals(header))<NEW_LINE>processWorker(sender, msg);<NEW_LINE>else {<NEW_LINE>log.format("E: invalid message:\n");<NEW_LINE>msg.dump(log.out());<NEW_LINE>msg.destroy();<NEW_LINE>}<NEW_LINE>sender.destroy();<NEW_LINE>empty.destroy();<NEW_LINE>header.destroy();<NEW_LINE>}<NEW_LINE>items.close();<NEW_LINE>purgeWorkers();<NEW_LINE>sendHeartbeats();<NEW_LINE>}<NEW_LINE>// interrupted<NEW_LINE>destroy();<NEW_LINE>}
msg = ZMsg.recvMsg(socket);
217,701
public void addLine(String line) {<NEW_LINE>if (styled_text.isDisposed()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>line = HTMLUtils.expand(line);<NEW_LINE>Object[] url_details = HTMLUtils.getLinks(line);<NEW_LINE>String modified_line = (String) url_details[0];<NEW_LINE>styled_text.append(modified_line + "\n");<NEW_LINE>List urls <MASK><NEW_LINE>for (int i = 0; i < urls.size(); i++) {<NEW_LINE>Object[] entry = (Object[]) urls.get(i);<NEW_LINE>String url = (String) entry[0];<NEW_LINE>int[] det = (int[]) entry[1];<NEW_LINE>if (!url.toLowerCase().startsWith("http") && relative_url_base.length() > 0) {<NEW_LINE>url = relative_url_base + url;<NEW_LINE>}<NEW_LINE>linkInfo info = new linkInfo(ofs + det[0], ofs + det[0] + det[1], url);<NEW_LINE>links.add(info);<NEW_LINE>StyleRange sr = new StyleRange();<NEW_LINE>sr.start = info.ofsStart;<NEW_LINE>sr.length = info.ofsEnd - info.ofsStart;<NEW_LINE>sr.underline = true;<NEW_LINE>sr.foreground = styled_text.getDisplay().getSystemColor(SWT.COLOR_LINK_FOREGROUND);<NEW_LINE>styled_text.setStyleRange(sr);<NEW_LINE>}<NEW_LINE>ofs += modified_line.length() + 1;<NEW_LINE>} catch (Throwable e) {<NEW_LINE>// just in case something borks<NEW_LINE>Debug.printStackTrace(e);<NEW_LINE>styled_text.append(line + "\n");<NEW_LINE>}<NEW_LINE>}
= (List) url_details[1];
40,673
public Symlinks asSymlinks() {<NEW_LINE>return new SymlinkPack(ImmutableList.<Symlinks>builder().addAll(getModules().values().stream().map(PythonComponents::asSymlinks).collect(ImmutableList.toImmutableList())).addAll(getResources().values().stream().map(PythonComponents::asSymlinks).collect(ImmutableList.toImmutableList())).addAll(getNativeLibraries().values().stream().map(PythonComponents::asSymlinks).collect(ImmutableList.toImmutableList())).build()) {<NEW_LINE><NEW_LINE>@AddToRuleKey<NEW_LINE>private final Optional<NonHashableSourcePathContainer> defaultInitPy = getDefaultInitPy().map(NonHashableSourcePathContainer::new);<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public SymlinkPaths resolveSymlinkPaths(SourcePathResolverAdapter resolver) {<NEW_LINE>return resolve(resolver).asSymlinkPaths();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void forEachSymlinkInput(Consumer<SourcePath> consumer) {<NEW_LINE>defaultInitPy.ifPresent(nsp -> consumer.accept<MASK><NEW_LINE>super.forEachSymlinkInput(consumer);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
(nsp.getSourcePath()));
1,038,675
// ------------------ Serialization<NEW_LINE>public Slime toSlime(Application application) {<NEW_LINE>Slime slime = new Slime();<NEW_LINE>Cursor root = slime.setObject();<NEW_LINE>root.setString(idField, application.id().serialized());<NEW_LINE>root.setLong(createdAtField, application.createdAt().toEpochMilli());<NEW_LINE>root.setString(deploymentSpecField, application.deploymentSpec().xmlForm());<NEW_LINE>root.setString(validationOverridesField, application.validationOverrides().xmlForm());<NEW_LINE>application.projectId().ifPresent(projectId -> root.setLong(projectIdField, projectId));<NEW_LINE>application.deploymentIssueId().ifPresent(jiraIssueId -> root.setString(deploymentIssueField<MASK><NEW_LINE>application.ownershipIssueId().ifPresent(issueId -> root.setString(ownershipIssueIdField, issueId.value()));<NEW_LINE>application.owner().ifPresent(owner -> root.setString(ownerField, owner.username()));<NEW_LINE>application.majorVersion().ifPresent(majorVersion -> root.setLong(majorVersionField, majorVersion));<NEW_LINE>root.setDouble(queryQualityField, application.metrics().queryServiceQuality());<NEW_LINE>root.setDouble(writeQualityField, application.metrics().writeServiceQuality());<NEW_LINE>deployKeysToSlime(application.deployKeys(), root.setArray(pemDeployKeysField));<NEW_LINE>application.latestVersion().ifPresent(version -> toSlime(version, root.setObject(latestVersionField)));<NEW_LINE>versionsToSlime(application, root.setArray(versionsField));<NEW_LINE>instancesToSlime(application, root.setArray(instancesField));<NEW_LINE>return slime;<NEW_LINE>}
, jiraIssueId.value()));
100,103
protected WebRtcServiceState handleOutgoingCall(@NonNull WebRtcServiceState currentState, @NonNull RemotePeer remotePeer, @NonNull OfferMessage.Type offerType) {<NEW_LINE>Log.i(TAG, "handleOutgoingCall():");<NEW_LINE>GroupCall groupCall = currentState.getCallInfoState().requireGroupCall();<NEW_LINE>currentState = WebRtcVideoUtil.reinitializeCamera(context, webRtcInteractor.getCameraEventListener(), currentState);<NEW_LINE>webRtcInteractor.setCallInProgressNotification(TYPE_OUTGOING_RINGING, currentState.getCallInfoState().getCallRecipient());<NEW_LINE>webRtcInteractor.updatePhoneState(WebRtcUtil.getInCallPhoneState(context));<NEW_LINE>webRtcInteractor.initializeAudioForCall();<NEW_LINE>try {<NEW_LINE>groupCall.setOutgoingVideoSource(currentState.getVideoState().requireLocalSink(), currentState.<MASK><NEW_LINE>groupCall.setOutgoingVideoMuted(!currentState.getLocalDeviceState().getCameraState().isEnabled());<NEW_LINE>groupCall.setOutgoingAudioMuted(!currentState.getLocalDeviceState().isMicrophoneEnabled());<NEW_LINE>groupCall.setBandwidthMode(NetworkUtil.getCallingBandwidthMode(context, groupCall.getLocalDeviceState().getNetworkRoute().getLocalAdapterType()));<NEW_LINE>groupCall.join();<NEW_LINE>} catch (CallException e) {<NEW_LINE>return groupCallFailure(currentState, "Unable to join group call", e);<NEW_LINE>}<NEW_LINE>return currentState.builder().actionProcessor(new GroupJoiningActionProcessor(webRtcInteractor)).changeCallInfoState().callState(WebRtcViewModel.State.CALL_OUTGOING).groupCallState(WebRtcViewModel.GroupCallState.CONNECTED_AND_JOINING).commit().changeLocalDeviceState().build();<NEW_LINE>}
getVideoState().requireCamera());
1,849,841
public void processOpts() {<NEW_LINE>super.processOpts();<NEW_LINE>supportingFiles.add(new SupportingFile("ApiException.mustache", toSrcPath(invokerPackage, srcBasePath), "ApiException.php"));<NEW_LINE>supportingFiles.add(new SupportingFile("Configuration.mustache", toSrcPath(invokerPackage, srcBasePath), "Configuration.php"));<NEW_LINE>supportingFiles.add(new SupportingFile("ObjectSerializer.mustache", toSrcPath(invokerPackage, srcBasePath), "ObjectSerializer.php"));<NEW_LINE>supportingFiles.add(new SupportingFile("ModelInterface.mustache", toSrcPath(modelPackage, srcBasePath), "ModelInterface.php"));<NEW_LINE>supportingFiles.add(new SupportingFile("HeaderSelector.mustache", toSrcPath(<MASK><NEW_LINE>supportingFiles.add(new SupportingFile("composer.mustache", "", "composer.json"));<NEW_LINE>supportingFiles.add(new SupportingFile("README.mustache", "", "README.md"));<NEW_LINE>supportingFiles.add(new SupportingFile("phpunit.xml.mustache", "", "phpunit.xml.dist"));<NEW_LINE>supportingFiles.add(new SupportingFile(".travis.yml", "", ".travis.yml"));<NEW_LINE>supportingFiles.add(new SupportingFile(".php_cs", "", ".php_cs"));<NEW_LINE>supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh"));<NEW_LINE>}
invokerPackage, srcBasePath), "HeaderSelector.php"));
1,297,826
protected WebRtcServiceState handleGroupJoinedMembershipChanged(@NonNull WebRtcServiceState currentState) {<NEW_LINE>Log.i(tag, "handleGroupJoinedMembershipChanged():");<NEW_LINE>GroupCall groupCall = currentState.getCallInfoState().requireGroupCall();<NEW_LINE>PeekInfo peekInfo = groupCall.getPeekInfo();<NEW_LINE>if (peekInfo == null) {<NEW_LINE>return currentState;<NEW_LINE>}<NEW_LINE>if (currentState.getCallSetupState(RemotePeer.GROUP_CALL_ID).hasSentJoinedMessage()) {<NEW_LINE>return currentState;<NEW_LINE>}<NEW_LINE>String eraId = WebRtcUtil.getGroupCallEraId(groupCall);<NEW_LINE>webRtcInteractor.sendGroupCallMessage(currentState.getCallInfoState().getCallRecipient(), eraId);<NEW_LINE>List<UUID> members = new ArrayList<>(peekInfo.getJoinedMembers());<NEW_LINE>if (!members.contains(SignalStore.account().requireAci().uuid())) {<NEW_LINE>members.add(SignalStore.account().requireAci().uuid());<NEW_LINE>}<NEW_LINE>webRtcInteractor.updateGroupCallUpdateMessage(currentState.getCallInfoState().getCallRecipient().getId(), eraId, members, WebRtcUtil.isCallFull(peekInfo));<NEW_LINE>return currentState.builder().changeCallSetupState(RemotePeer.GROUP_CALL_ID).<MASK><NEW_LINE>}
sentJoinedMessage(true).build();
1,180,290
private static <U1 extends Comparable<? super U1>, U2 extends Comparable<? super U2>, U3 extends Comparable<? super U3>> int compareTo(Tuple3<?, ?, ?> o1, Tuple3<?, ?, ?> o2) {<NEW_LINE>final Tuple3<U1, U2, U3> t1 = (Tuple3<U1, U2, U3>) o1;<NEW_LINE>final Tuple3<U1, U2, U3> t2 = (Tuple3<U1, U2, U3>) o2;<NEW_LINE>final int check1 = t1._1.compareTo(t2._1);<NEW_LINE>if (check1 != 0) {<NEW_LINE>return check1;<NEW_LINE>}<NEW_LINE>final int check2 = t1._2.compareTo(t2._2);<NEW_LINE>if (check2 != 0) {<NEW_LINE>return check2;<NEW_LINE>}<NEW_LINE>final int check3 = t1.<MASK><NEW_LINE>if (check3 != 0) {<NEW_LINE>return check3;<NEW_LINE>}<NEW_LINE>// all components are equal<NEW_LINE>return 0;<NEW_LINE>}
_3.compareTo(t2._3);
474,758
public void submitMethodEntryBreakpoint(DebuggerCommand debuggerCommand) {<NEW_LINE>// method entry breakpoints are limited per class, so we must<NEW_LINE>// install a first line breakpoint into each method in the class<NEW_LINE>KlassRef[] klasses = debuggerCommand.getRequestFilter().getKlassRefPatterns();<NEW_LINE>List<Breakpoint> breakpoints = new ArrayList<>();<NEW_LINE>for (KlassRef klass : klasses) {<NEW_LINE>for (MethodRef method : klass.getDeclaredMethodRefs()) {<NEW_LINE>int line = method.getFirstLine();<NEW_LINE>Breakpoint bp;<NEW_LINE>if (line != -1) {<NEW_LINE>bp = Breakpoint.newBuilder(method.getSource()).<MASK><NEW_LINE>} else {<NEW_LINE>bp = Breakpoint.newBuilder(method.getSource().createUnavailableSection()).build();<NEW_LINE>}<NEW_LINE>breakpoints.add(bp);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>BreakpointInfo breakpointInfo = debuggerCommand.getBreakpointInfo();<NEW_LINE>for (Breakpoint breakpoint : breakpoints) {<NEW_LINE>mapBreakpoint(breakpoint, breakpointInfo);<NEW_LINE>debuggerSession.install(breakpoint);<NEW_LINE>}<NEW_LINE>}
lineIs(line).build();
1,186,858
public void confirmOfflinePayment(Event event, String reservationId, String username) {<NEW_LINE>TicketReservation ticketReservation = findById(reservationId).orElseThrow(IllegalArgumentException::new);<NEW_LINE>ticketReservationRepository.lockReservationForUpdate(reservationId);<NEW_LINE>Validate.isTrue(ticketReservation.getPaymentMethod() == PaymentProxy.OFFLINE, "invalid payment method");<NEW_LINE>Validate.isTrue(ticketReservation.isPendingOfflinePayment(), "invalid status");<NEW_LINE>ticketReservationRepository.confirmOfflinePayment(reservationId, TicketReservationStatus.COMPLETE.name(), event.now(clockProvider));<NEW_LINE>registerAlfioTransaction(<MASK><NEW_LINE>auditingRepository.insert(reservationId, userRepository.findIdByUserName(username).orElse(null), event.getId(), Audit.EventType.RESERVATION_OFFLINE_PAYMENT_CONFIRMED, new Date(), Audit.EntityType.RESERVATION, ticketReservation.getId());<NEW_LINE>CustomerName customerName = new CustomerName(ticketReservation.getFullName(), ticketReservation.getFirstName(), ticketReservation.getLastName(), event.mustUseFirstAndLastName());<NEW_LINE>acquireItems(PaymentProxy.OFFLINE, reservationId, ticketReservation.getEmail(), customerName, ticketReservation.getUserLanguage(), ticketReservation.getBillingAddress(), ticketReservation.getCustomerReference(), event, true);<NEW_LINE>Locale language = findReservationLanguage(reservationId);<NEW_LINE>final TicketReservation finalReservation = ticketReservationRepository.findReservationById(reservationId);<NEW_LINE>billingDocumentManager.createBillingDocument(event, finalReservation, username, orderSummaryForReservation(finalReservation, event));<NEW_LINE>var configuration = configurationManager.getFor(EnumSet.of(DEFERRED_BANK_TRANSFER_ENABLED, DEFERRED_BANK_TRANSFER_SEND_CONFIRMATION_EMAIL), ConfigurationLevel.event(event));<NEW_LINE>if (!configuration.get(DEFERRED_BANK_TRANSFER_ENABLED).getValueAsBooleanOrDefault() || configuration.get(DEFERRED_BANK_TRANSFER_SEND_CONFIRMATION_EMAIL).getValueAsBooleanOrDefault()) {<NEW_LINE>sendConfirmationEmail(event, findById(reservationId).orElseThrow(IllegalArgumentException::new), language, username);<NEW_LINE>}<NEW_LINE>extensionManager.handleReservationConfirmation(finalReservation, ticketReservationRepository.getBillingDetailsForReservation(reservationId), event);<NEW_LINE>}
event, reservationId, PaymentProxy.OFFLINE);
753,965
private void testClassLevelPermitAll(final String baseUri) throws Exception {<NEW_LINE>LOG.entering(clz, "entered testClassLevelPermitAll");<NEW_LINE>String url = baseUri + "/ClassPermitAll";<NEW_LINE>// create the resource instance to interact with<NEW_LINE>LOG.info("testClassLevelPermitAll about to invoke the resource: " + url);<NEW_LINE><MASK><NEW_LINE>Client c = cb.build();<NEW_LINE>WebTarget t = c.target(url);<NEW_LINE>Response response = t.request().accept("text/plain").get();<NEW_LINE>assertEquals(200, response.getStatus());<NEW_LINE>assertEquals("remotely accessible to all through class level PermitAll", response.readEntity(String.class));<NEW_LINE>c.close();<NEW_LINE>LOG.info("testClassLevelPermitAll SUCCEEDED");<NEW_LINE>LOG.exiting(clz, "exiting testClassLevelPermitAll exiting");<NEW_LINE>}
ClientBuilder cb = ClientBuilder.newBuilder();
1,745,990
public void codeSuccess(final MessageFrame frame, final OperationTracer operationTracer) {<NEW_LINE>final Bytes contractCode = frame.getOutputData();<NEW_LINE>final Gas depositFee = gasCalculator.codeDepositGasCost(contractCode.size());<NEW_LINE>if (frame.getRemainingGas().compareTo(depositFee) < 0) {<NEW_LINE>LOG.trace("Not enough gas to pay the code deposit fee for {}: " + "remaining gas = {} < {} = deposit fee", frame.getContractAddress(), frame.getRemainingGas(), depositFee);<NEW_LINE>if (requireCodeDepositToSucceed) {<NEW_LINE>LOG.trace("Contract creation error: insufficient funds for code deposit");<NEW_LINE>frame.setExceptionalHaltReason(Optional.of(ExceptionalHaltReason.INSUFFICIENT_GAS));<NEW_LINE>frame.<MASK><NEW_LINE>operationTracer.traceAccountCreationResult(frame, Optional.of(ExceptionalHaltReason.INSUFFICIENT_GAS));<NEW_LINE>} else {<NEW_LINE>frame.setState(MessageFrame.State.COMPLETED_SUCCESS);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>final var invalidReason = contractValidationRules.stream().map(rule -> rule.validate(frame)).filter(Optional::isPresent).findFirst();<NEW_LINE>if (invalidReason.isEmpty()) {<NEW_LINE>frame.decrementRemainingGas(depositFee);<NEW_LINE>// Finalize contract creation, setting the contract code.<NEW_LINE>final MutableAccount contract = frame.getWorldUpdater().getOrCreate(frame.getContractAddress()).getMutable();<NEW_LINE>contract.setCode(contractCode);<NEW_LINE>LOG.trace("Successful creation of contract {} with code of size {} (Gas remaining: {})", frame.getContractAddress(), contractCode.size(), frame.getRemainingGas());<NEW_LINE>frame.setState(MessageFrame.State.COMPLETED_SUCCESS);<NEW_LINE>} else {<NEW_LINE>Optional<ExceptionalHaltReason> exceptionalHaltReason = invalidReason.get();<NEW_LINE>frame.setExceptionalHaltReason(exceptionalHaltReason);<NEW_LINE>frame.setState(MessageFrame.State.EXCEPTIONAL_HALT);<NEW_LINE>operationTracer.traceAccountCreationResult(frame, exceptionalHaltReason);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
setState(MessageFrame.State.EXCEPTIONAL_HALT);
276,064
ActionResult<Wo> execute(EffectivePerson effectivePerson, String flag) throws Exception {<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>ActionResult<Wo> <MASK><NEW_LINE>Business business = new Business(emc);<NEW_LINE>Statement statement = emc.flag(flag, Statement.class);<NEW_LINE>if (null == statement) {<NEW_LINE>throw new ExceptionEntityNotExist(flag, Statement.class);<NEW_LINE>}<NEW_LINE>com.x.query.core.entity.Query query = emc.flag(statement.getQuery(), com.x.query.core.entity.Query.class);<NEW_LINE>if (null == query) {<NEW_LINE>throw new ExceptionEntityNotExist(flag, Query.class);<NEW_LINE>}<NEW_LINE>if (!business.editable(effectivePerson, query)) {<NEW_LINE>throw new ExceptionAccessDenied(effectivePerson, query);<NEW_LINE>}<NEW_LINE>Wo wo = Wo.copier.copy(statement);<NEW_LINE>result.setData(wo);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>}
result = new ActionResult<>();
559,252
private Mono<Response<IdentityInner>> createOrUpdateWithResponseAsync(String resourceGroupName, String resourceName, IdentityInner parameters, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (parameters == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));<NEW_LINE>} else {<NEW_LINE>parameters.validate();<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, resourceName, this.client.getApiVersion(), parameters, accept, context);<NEW_LINE>}
error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
1,720,397
public FillPrepareResult prepare(int availableHeight) {<NEW_LINE>FillPrepareResult result = null;<NEW_LINE>JRComponentElement element = fillContext.getComponentElement();<NEW_LINE>if (template == null) {<NEW_LINE>template = new JRTemplateGenericElement(fillContext.getElementOrigin(), fillContext.getDefaultStyleProvider(), HTML_COMPONENT_PRINT_TYPE);<NEW_LINE>template.setMode(htmlComponent.getContext().getComponentElement().getModeValue());<NEW_LINE>template.setBackcolor(htmlComponent.getContext().getComponentElement().getBackcolor());<NEW_LINE>template.setForecolor(htmlComponent.getContext().getComponentElement().getForecolor());<NEW_LINE>}<NEW_LINE>printElement = new JRTemplateGenericPrintElement(template, printElementOriginator);<NEW_LINE>printElement.setX(element.getX());<NEW_LINE>printElement.setWidth(element.getWidth());<NEW_LINE>printElement.setHeight(element.getHeight());<NEW_LINE>if (isEvaluateNow()) {<NEW_LINE>copy(printElement);<NEW_LINE>} else {<NEW_LINE>fillContext.registerDelayedEvaluation(printElement, htmlComponent.getEvaluationTime(), null);<NEW_LINE>}<NEW_LINE>Dimension realSize = computeSizeOfPrintElement(printElement);<NEW_LINE>int realHeight = realSize.height;<NEW_LINE>int realWidth = realSize.width;<NEW_LINE>int imageWidth = realWidth;<NEW_LINE>int imageHeight = realHeight;<NEW_LINE>if (htmlComponent.getScaleType() == ScaleImageEnum.REAL_SIZE || htmlComponent.getScaleType() == ScaleImageEnum.REAL_HEIGHT) {<NEW_LINE>if (realWidth > element.getWidth()) {<NEW_LINE>double wRatio = ((double) element.getWidth()) / realWidth;<NEW_LINE>imageHeight = <MASK><NEW_LINE>imageWidth = element.getWidth();<NEW_LINE>}<NEW_LINE>int printElementHeight = Math.max(imageHeight, element.getHeight());<NEW_LINE>if (imageHeight <= availableHeight) {<NEW_LINE>result = FillPrepareResult.printStretch(imageHeight, false);<NEW_LINE>} else {<NEW_LINE>if (hasOverflowed) {<NEW_LINE>result = FillPrepareResult.printStretch(availableHeight, false);<NEW_LINE>if (htmlComponent.getScaleType() == ScaleImageEnum.REAL_SIZE) {<NEW_LINE>printElement.setWidth(imageWidth);<NEW_LINE>} else {<NEW_LINE>printElement.setWidth(element.getWidth());<NEW_LINE>}<NEW_LINE>printElement.setHeight(availableHeight);<NEW_LINE>printElement.setParameterValue(HtmlPrintElement.BUILTIN_PARAMETER_HAS_OVERFLOWED, Boolean.TRUE);<NEW_LINE>} else {<NEW_LINE>result = FillPrepareResult.noPrintOverflow(printElementHeight);<NEW_LINE>hasOverflowed = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>result = FillPrepareResult.PRINT_NO_STRETCH;<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
(int) (wRatio * realHeight);