idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
692,087 | private void clientStreamingMetrics(ProducerGrpcServiceClientImpl helper2, HttpServletResponse response) throws IOException {<NEW_LINE>// retrieve the metrics<NEW_LINE>int httpPort = Integer.parseInt<MASK><NEW_LINE>String metricValue = getMetric("localhost", httpPort, "/metrics/vendor/grpc.server.receivedMessages.total");<NEW_LINE>// create HTML response<NEW_LINE>response.setContentType("text/html");<NEW_LINE>response.setCharacterEncoding("UTF-8");<NEW_LINE>PrintWriter writer = response.getWriter();<NEW_LINE>// .append(" <title>clientStreaming metric response message</title>\r\n")<NEW_LINE>writer.append("<!DOCTYPE html>\r\n").append("<html>\r\n").append(" <head>\r\n").append(" </head>\r\n").append(" <body>\r\n");<NEW_LINE>if (metricValue != null) {<NEW_LINE>writer.append(metricValue);<NEW_LINE>}<NEW_LINE>} | (ProducerUtils.getSysProp("bvt.prop.HTTP_default")); |
250,002 | protected boolean processSCTokens() {<NEW_LINE>List<WSSecurityEngineResult> tokenResults = new ArrayList<WSSecurityEngineResult>();<NEW_LINE>List<WSSecurityEngineResult> dktResults = new ArrayList<WSSecurityEngineResult>();<NEW_LINE>for (WSSecurityEngineResult wser : results) {<NEW_LINE>Integer actInt = (Integer) wser.get(WSSecurityEngineResult.TAG_ACTION);<NEW_LINE>if (actInt.intValue() == WSConstants.SCT) {<NEW_LINE>if (derived) {<NEW_LINE>byte[] secret = (byte[]) <MASK><NEW_LINE>WSSecurityEngineResult dktResult = getMatchingDerivedKey(secret);<NEW_LINE>if (dktResult != null) {<NEW_LINE>dktResults.add(dktResult);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>tokenResults.add(wser);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (tokenResults.isEmpty()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (signed && !areTokensSigned(tokenResults)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (encrypted && !areTokensEncrypted(tokenResults)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>tokenResults.addAll(dktResults);<NEW_LINE>if (endorsed && !checkEndorsed(tokenResults)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (!validateSignedEncryptedPolicies(tokenResults)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | wser.get(WSSecurityEngineResult.TAG_SECRET); |
432,548 | final StopExperimentResult executeStopExperiment(StopExperimentRequest stopExperimentRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(stopExperimentRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<StopExperimentRequest> request = null;<NEW_LINE>Response<StopExperimentResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new StopExperimentRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(stopExperimentRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Evidently");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "StopExperiment");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<StopExperimentResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new StopExperimentResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint); |
344,132 | public void run(RegressionEnvironment env) {<NEW_LINE>String epl = "@name('s0') " + EventRepresentationChoice.AVRO.getAnnotationText() + " select 1 as myInt," + "{1L, 2L} as myLongArray," + EPLInsertIntoPopulateCreateStreamAvro.class.getName() + ".makeByteArray() as myByteArray, " + EPLInsertIntoPopulateCreateStreamAvro.class.getName() + ".makeMapStringString() as myMap " + "from SupportBean";<NEW_LINE>env.compileDeploy(epl).addListener("s0");<NEW_LINE>env.sendEventBean(new SupportBean());<NEW_LINE>env.assertEventNew("s0", event -> {<NEW_LINE>String json = SupportAvroUtil.avroToJson(event);<NEW_LINE>System.out.println(json);<NEW_LINE>assertEquals(1, event.get("myInt"));<NEW_LINE>EPAssertionUtil.assertEqualsExactOrder(new Long[] { 1L, 2L }, ((Collection) event.get(<MASK><NEW_LINE>assertTrue(Arrays.equals(new byte[] { 1, 2, 3 }, ((ByteBuffer) event.get("myByteArray")).array()));<NEW_LINE>assertEquals("{k1=v1}", ((Map) event.get("myMap")).toString());<NEW_LINE>Schema designSchema = record("name").fields().requiredInt("myInt").name("myLongArray").type(array().items(unionOf().nullType().and().longType().endUnion())).noDefault().name("myByteArray").type("bytes").noDefault().name("myMap").type(map().values().stringBuilder().prop(AvroConstant.PROP_JAVA_STRING_KEY, AvroConstant.PROP_JAVA_STRING_VALUE).endString()).noDefault().endRecord();<NEW_LINE>Schema assembledSchema = ((AvroEventType) event.getEventType()).getSchemaAvro();<NEW_LINE>String compareMsg = SupportAvroUtil.compareSchemas(designSchema, assembledSchema);<NEW_LINE>assertNull(compareMsg, compareMsg);<NEW_LINE>});<NEW_LINE>env.undeployAll();<NEW_LINE>} | "myLongArray")).toArray()); |
1,482,601 | public InputStream call() throws Exception {<NEW_LINE>URLConnection conn = url.openConnection();<NEW_LINE>configureConnection(conn, timeout);<NEW_LINE>// handle redirection here<NEW_LINE>int redirCount = 0;<NEW_LINE>URLConnection redir = conn;<NEW_LINE>do {<NEW_LINE>conn = redir;<NEW_LINE>redir = checkRedirect(conn, timeout);<NEW_LINE>redirCount++;<NEW_LINE>} while (conn != redir && redirCount <= MAX_REDIRECTS);<NEW_LINE>if (conn != redir) {<NEW_LINE>throw new IOException("Too many redirects for " + url);<NEW_LINE>}<NEW_LINE>InputStream is = conn.getInputStream();<NEW_LINE>contentLength = conn.getContentLength();<NEW_LINE>if (err.isLoggable(Level.FINE)) {<NEW_LINE>Map<String, List<String>> map = conn.getHeaderFields();<NEW_LINE>StringBuilder sb = new StringBuilder("Connection opened for:\n");<NEW_LINE>sb.append(" Url: ").append(conn.getURL<MASK><NEW_LINE>for (String field : map.keySet()) {<NEW_LINE>sb.append(" ").append(field == null ? "Status" : field).append(": ").append(map.get(field)).append("\n");<NEW_LINE>}<NEW_LINE>sb.append("\n");<NEW_LINE>err.log(Level.FINE, sb.toString());<NEW_LINE>}<NEW_LINE>return new BufferedInputStream(is);<NEW_LINE>} | ()).append("\n"); |
1,851,695 | private void bindText(TextView textView, SearchResult searchResult, String searchText) {<NEW_LINE>String text = searchResult.text;<NEW_LINE>if (TextUtils.isEmpty(text))<NEW_LINE>return;<NEW_LINE>text = <MASK><NEW_LINE>if (TextUtils.isEmpty(searchText)) {<NEW_LINE>textView.setText(text);<NEW_LINE>} else {<NEW_LINE>int idx = text.toLowerCase().indexOf(searchText.toLowerCase());<NEW_LINE>if (idx >= 0) {<NEW_LINE>SpannableStringBuilder builder = new SpannableStringBuilder();<NEW_LINE>builder.append(text);<NEW_LINE>builder.setSpan(textAppearanceSpan, idx, idx + searchText.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);<NEW_LINE>if (idx > ELLIPSIZE_LIMIT_COUNT && searchResult.isDescriptionType()) {<NEW_LINE>builder.delete(0, idx - ELLIPSIZE_LIMIT_COUNT);<NEW_LINE>builder.insert(0, ELLIPSIZE_TEXT);<NEW_LINE>}<NEW_LINE>textView.setText(builder);<NEW_LINE>} else {<NEW_LINE>textView.setText(text);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | text.replace("\n", " "); |
1,418,831 | public GetResult merge(List<PartitionGetResult> partResults) {<NEW_LINE>int resultSize = 0;<NEW_LINE>for (PartitionGetResult result : partResults) {<NEW_LINE>resultSize += ((PartGeneralGetResult) result).getNodeIds().length;<NEW_LINE>}<NEW_LINE>Long2ObjectOpenHashMap<Tuple3<long[], float[], int[]>> nodeIdToNeighbors = new Long2ObjectOpenHashMap<>(resultSize);<NEW_LINE>for (PartitionGetResult result : partResults) {<NEW_LINE>PartGeneralGetResult partResult = (PartGeneralGetResult) result;<NEW_LINE>long[] nodeIds = partResult.getNodeIds();<NEW_LINE>IElement[] data = partResult.getData();<NEW_LINE>for (int i = 0; i < nodeIds.length; i++) {<NEW_LINE>if (data[i] != null) {<NEW_LINE>long[] neighbors = ((AliasElement) data[i]).getNeighborIds();<NEW_LINE>float[] accept = ((AliasElement) data[i]).getAccept();<NEW_LINE>int[] alias = ((AliasElement) data[i]).getAlias();<NEW_LINE>if (neighbors.length > 0 && accept.length > 0 && alias.length > 0) {<NEW_LINE>nodeIdToNeighbors.put(nodeIds[i], new Tuple3<><MASK><NEW_LINE>} else {<NEW_LINE>nodeIdToNeighbors.put(nodeIds[i], emp);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>nodeIdToNeighbors.put(nodeIds[i], emp);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new PullAliasResult(nodeIdToNeighbors);<NEW_LINE>} | (neighbors, accept, alias)); |
177,971 | private void paintCorePaths() {<NEW_LINE>DisplayMetrics metrics = getResources().getDisplayMetrics();<NEW_LINE>Paint paint = mapView.getDefaultPathPaint();<NEW_LINE>paint.setColor(MaterialColors.getColor(mapView, R.attr.colorAccent));<NEW_LINE>paint.setStrokeWidth(2);<NEW_LINE>paint.setPathEffect(new CornerPathEffect(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 1, metrics)));<NEW_LINE>List<double[]> <MASK><NEW_LINE>for (VpnCountry vpnCountry : serverManager.getSecureCoreEntryCountries()) {<NEW_LINE>positionList.add(vpnCountry.getTranslatedCoordinates().asCoreCoordinates());<NEW_LINE>}<NEW_LINE>List<VpnCountry> secureEntryCountries = serverManager.getSecureCoreEntryCountries();<NEW_LINE>if (!secureEntryCountries.isEmpty()) {<NEW_LINE>positionList.add(secureEntryCountries.get(0).getTranslatedCoordinates().asCoreCoordinates());<NEW_LINE>paths.add(mapView.drawPath(positionList, null));<NEW_LINE>}<NEW_LINE>} | positionList = new ArrayList<>(); |
1,576,949 | final GetCachePolicyResult executeGetCachePolicy(GetCachePolicyRequest getCachePolicyRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getCachePolicyRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetCachePolicyRequest> request = null;<NEW_LINE>Response<GetCachePolicyResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetCachePolicyRequestMarshaller().marshall(super.beforeMarshalling(getCachePolicyRequest));<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.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetCachePolicy");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<GetCachePolicyResult> responseHandler = new StaxResponseHandler<GetCachePolicyResult>(new GetCachePolicyResultStaxUnmarshaller());<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.SERVICE_ID, "CloudFront"); |
1,509,769 | public BoundingBox createBoundsForConnectionController(@Nonnull EnumFacing dir, @Nonnull Offset offset) {<NEW_LINE>Vector3d nonUniformScale = ForgeDirectionOffsets.forDirCopy(dir);<NEW_LINE>nonUniformScale.scale(0.5);<NEW_LINE>nonUniformScale.x = 0.8 * (1 - Math.abs(nonUniformScale.x));<NEW_LINE>nonUniformScale.y = 0.8 * (1 - Math.abs(nonUniformScale.y));<NEW_LINE>nonUniformScale.z = 0.8 * (1 - Math.abs(nonUniformScale.z));<NEW_LINE>BoundingBox bb = CORE_BOUNDS;<NEW_LINE>bb = bb.scale(nonUniformScale.x, nonUniformScale.y, nonUniformScale.z);<NEW_LINE>double offsetFromEnd = Math.min(bb.sizeX(), bb.sizeY());<NEW_LINE>offsetFromEnd = Math.min(offsetFromEnd, bb.sizeZ());<NEW_LINE>offsetFromEnd = Math.max(offsetFromEnd, 0.075);<NEW_LINE>double transMag = 0.5 - (offsetFromEnd * 1.2);<NEW_LINE>Vector3d trans = ForgeDirectionOffsets.forDirCopy(dir);<NEW_LINE>trans.scale(transMag);<NEW_LINE><MASK><NEW_LINE>bb = bb.translate(getTranslation(dir, offset));<NEW_LINE>return bb;<NEW_LINE>} | bb = bb.translate(trans); |
1,176,685 | private void readHistoryFile() throws IOException {<NEW_LINE>ArrayList<Version> list <MASK><NEW_LINE>minVersion = 0;<NEW_LINE>curVersion = 0;<NEW_LINE>File historyFile = getHistoryFile();<NEW_LINE>BufferedReader in = new BufferedReader(new FileReader(historyFile));<NEW_LINE>try {<NEW_LINE>String line = in.readLine();<NEW_LINE>while (line != null) {<NEW_LINE>Version ver;<NEW_LINE>try {<NEW_LINE>ver = decodeVersion(line);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new IOException("Bad history file: " + historyFile);<NEW_LINE>}<NEW_LINE>int version = ver.getVersion();<NEW_LINE>if (curVersion != 0 && version != (curVersion + 1)) {<NEW_LINE>// Versions must be in sequential order<NEW_LINE>throw new IOException("Bad history file" + historyFile);<NEW_LINE>}<NEW_LINE>if (minVersion == 0) {<NEW_LINE>minVersion = version;<NEW_LINE>}<NEW_LINE>curVersion = version;<NEW_LINE>list.add(ver);<NEW_LINE>line = in.readLine();<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>in.close();<NEW_LINE>}<NEW_LINE>versions = new Version[list.size()];<NEW_LINE>list.toArray(versions);<NEW_LINE>} | = new ArrayList<Version>(); |
295,347 | public static void buildOperatorClause(String[] operatorFunc, String[] operators, int clauseIndex, String operator, String timeCol, double timeInterval, TableSchema tableSchema, MLEnvironment env) {<NEW_LINE>operatorFunc[clauseIndex] = operator.split("\\(")[0].trim().toUpperCase();<NEW_LINE>if (isLastTime(operatorFunc[clauseIndex])) {<NEW_LINE>String[] components = operator.split("\\)");<NEW_LINE>if (components[0].trim().endsWith("(")) {<NEW_LINE>operators[clauseIndex] = components[0] <MASK><NEW_LINE>} else {<NEW_LINE>operators[clauseIndex] = components[0] + ", " + timeCol + ", " + timeInterval + ")";<NEW_LINE>}<NEW_LINE>} else if (containsAggNeedTimeColAndTimeInterval(operatorFunc[clauseIndex])) {<NEW_LINE>String[] components = operator.split("\\)");<NEW_LINE>operators[clauseIndex] = components[0] + ", " + timeCol + ", " + timeInterval + ")";<NEW_LINE>} else if (isRankAggFunc(operatorFunc[clauseIndex])) {<NEW_LINE>operators[clauseIndex] = operatorFunc[clauseIndex] + "(unix_timestamp(" + timeCol + "))";<NEW_LINE>} else if (operatorFunc[clauseIndex].startsWith("MTABLE_AGG")) {<NEW_LINE>operators[clauseIndex] = registMTableAgg(operator, operatorFunc[clauseIndex], env, tableSchema, timeCol);<NEW_LINE>} else if (operatorFunc[clauseIndex].equals("LAST_VALUE")) {<NEW_LINE>String[] components = operator.split("\\(");<NEW_LINE>String[] components2 = components[1].split("\\)");<NEW_LINE>operators[clauseIndex] = UdafName.LAST_VALUE.name + "(" + components2[0] + ", " + timeCol + ", " + timeInterval + ")";<NEW_LINE>} else {<NEW_LINE>operators[clauseIndex] = operator;<NEW_LINE>}<NEW_LINE>} | + timeCol + ", " + timeInterval + ")"; |
204,257 | public void testCaptureDebuggerMemoryBytesPlugin() throws Throwable {<NEW_LINE>try (UndoableTransaction tid = tb.startTransaction()) {<NEW_LINE>long snap = tb.trace.getTimeManager().<MASK><NEW_LINE>tb.trace.getMemoryManager().addRegion(".text", Range.atLeast(0L), tb.range(0x00400000, 0x0040ffff), Set.of(TraceMemoryFlag.READ, TraceMemoryFlag.EXECUTE));<NEW_LINE>TraceSymbolManager symbolManager = tb.trace.getSymbolManager();<NEW_LINE>TraceNamespaceSymbol global = symbolManager.getGlobalNamespace();<NEW_LINE>TraceSymbol mainLabel = symbolManager.labels().create(snap, null, tb.addr(0x00400000), "main", global, SourceType.USER_DEFINED);<NEW_LINE>@SuppressWarnings("unused")<NEW_LINE>TraceSymbol cloneLabel = symbolManager.labels().create(snap, null, tb.addr(0x00400060), "clone", global, SourceType.USER_DEFINED);<NEW_LINE>TraceSymbol childLabel = symbolManager.labels().create(snap, null, tb.addr(0x00400034), "child", global, SourceType.USER_DEFINED);<NEW_LINE>@SuppressWarnings("unused")<NEW_LINE>TraceSymbol exitLabel = symbolManager.labels().create(snap, null, tb.addr(0x00400061), "exit", global, SourceType.USER_DEFINED);<NEW_LINE>Assembler assembler = Assemblers.getAssembler(tb.trace.getProgramView());<NEW_LINE>assembler.assemble(mainLabel.getAddress(), "PUSH RBP", "MOV RBP,RSP", "CALL clone", "TEST EAX,EAX", "JNZ child", "SUB RSP,0x10", "MOV dword ptr [RSP],0x6c6c6548", "MOV dword ptr [RSP+4],0x57202c6f", "MOV dword ptr [RSP+8],0x646c726f", "MOV word ptr [RSP+0xc],0x21", "CALL exit", "SUB RSP,0x10", "MOV dword ptr [RSP],0x2c657942", "MOV dword ptr [RSP+4],0x726f5720", "MOV dword ptr [RSP+8],0x21646c", "CALL exit");<NEW_LINE>TraceThread thread = tb.getOrAddThread("[1]", snap);<NEW_LINE>TraceMemoryRegisterSpace regs = tb.trace.getMemoryManager().getMemoryRegisterSpace(thread, true);<NEW_LINE>regs.setValue(snap, new RegisterValue(tb.language.getProgramCounter(), childLabel.getAddress().getOffsetAsBigInteger()));<NEW_LINE>}<NEW_LINE>traceManager.openTrace(tb.trace);<NEW_LINE>traceManager.activateTrace(tb.trace);<NEW_LINE>captureIsolatedProvider(DebuggerMemoryBytesProvider.class, 600, 600);<NEW_LINE>} | createSnapshot("First").getKey(); |
1,381,072 | protected void encodeStrictList(FacesContext context, DataList list) throws IOException {<NEW_LINE>ResponseWriter writer = context.getResponseWriter();<NEW_LINE>String clientId = list.getClientId(context);<NEW_LINE>boolean isDefinition = list.isDefinition();<NEW_LINE>UIComponent definitionFacet = list.getFacet("description");<NEW_LINE>boolean renderDefinition = isDefinition && ComponentUtils.shouldRenderFacet(definitionFacet);<NEW_LINE>String itemType = list.getItemType();<NEW_LINE>String listClass = DataList.LIST_CLASS;<NEW_LINE>if ("none".equals(itemType)) {<NEW_LINE>listClass = listClass + " " + DataList.NO_BULLETS_CLASS;<NEW_LINE>}<NEW_LINE>String listTag = list.getListTag();<NEW_LINE><MASK><NEW_LINE>writer.startElement(listTag, null);<NEW_LINE>writer.writeAttribute("id", clientId + "_list", null);<NEW_LINE>writer.writeAttribute("class", listClass, null);<NEW_LINE>if (list.getItemType() != null) {<NEW_LINE>writer.writeAttribute("type", list.getItemType(), null);<NEW_LINE>}<NEW_LINE>list.forEachRow((status) -> {<NEW_LINE>try {<NEW_LINE>String itemStyleClass = getStyleClassBuilder(context).add(DataList.LIST_ITEM_CLASS, list.getItemStyleClass()).build();<NEW_LINE>writer.startElement(listItemTag, null);<NEW_LINE>writer.writeAttribute("class", itemStyleClass, null);<NEW_LINE>renderChildren(context, list);<NEW_LINE>writer.endElement(listItemTag);<NEW_LINE>if (renderDefinition) {<NEW_LINE>writer.startElement("dd", null);<NEW_LINE>definitionFacet.encodeAll(context);<NEW_LINE>writer.endElement("dd");<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new FacesException(e);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>writer.endElement(listTag);<NEW_LINE>} | String listItemTag = isDefinition ? "dt" : "li"; |
125,284 | private TimeSeries createTimeSeries(Meter meter, TypedValue typedValue, MetricDescriptor.ValueType valueType, @Nullable String statistic, MetricDescriptor.MetricKind metricKind) {<NEW_LINE>Meter.Id id = meter.getId();<NEW_LINE>if (client != null)<NEW_LINE>createMetricDescriptorIfNecessary(client, id, valueType, statistic, metricKind);<NEW_LINE>String metricType = metricType(id, statistic);<NEW_LINE>Map<String, String> metricLabels = getConventionTags(id).stream().collect(Collectors.toMap(Tag::getKey, Tag::getValue));<NEW_LINE>return // https://cloud.google.com/monitoring/api/v3/metrics-details#metric-kinds<NEW_LINE>TimeSeries.newBuilder().setMetric(Metric.newBuilder().setType(metricType).putAllLabels(metricLabels).build()).setResource(MonitoredResource.newBuilder().setType(config.resourceType()).putLabels("project_id", config.projectId()).putAllLabels(config.resourceLabels()).build()).// https://cloud.google.com/monitoring/api/v3/metrics-details#metric-kinds<NEW_LINE>setMetricKind(metricKind).setValueType(valueType).addPoints(Point.newBuilder().setInterval(interval(metricKind)).setValue(typedValue).<MASK><NEW_LINE>} | build()).build(); |
1,180,518 | static RoundingInfo[] buildRoundings(ZoneId timeZone, String minimumInterval) {<NEW_LINE>int indexToSliceFrom = 0;<NEW_LINE>RoundingInfo[] roundings = new RoundingInfo[6];<NEW_LINE>roundings[0] = new RoundingInfo(Rounding.DateTimeUnit.SECOND_OF_MINUTE, timeZone, 1000L, "s", 1, 5, 10, 30);<NEW_LINE>roundings[1] = new RoundingInfo(Rounding.DateTimeUnit.MINUTES_OF_HOUR, timeZone, 60 * 1000L, "m", 1, 5, 10, 30);<NEW_LINE>roundings[2] = new RoundingInfo(Rounding.DateTimeUnit.HOUR_OF_DAY, timeZone, 60 * 60 * 1000L, "h", 1, 3, 12);<NEW_LINE>roundings[3] = new RoundingInfo(Rounding.DateTimeUnit.DAY_OF_MONTH, timeZone, 24 * 60 * 60 * 1000L, "d", 1, 7);<NEW_LINE>roundings[4] = new RoundingInfo(Rounding.DateTimeUnit.MONTH_OF_YEAR, timeZone, 30 * 24 * 60 * 60 * 1000L, "M", 1, 3);<NEW_LINE>roundings[5] = new RoundingInfo(Rounding.DateTimeUnit.YEAR_OF_CENTURY, timeZone, 365 * 24 * 60 * 60 * 1000L, "y", 1, 5, <MASK><NEW_LINE>for (int i = 0; i < roundings.length; i++) {<NEW_LINE>RoundingInfo roundingInfo = roundings[i];<NEW_LINE>if (roundingInfo.getDateTimeUnit().equals(minimumInterval)) {<NEW_LINE>indexToSliceFrom = i;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Arrays.copyOfRange(roundings, indexToSliceFrom, roundings.length);<NEW_LINE>} | 10, 20, 50, 100); |
1,058,189 | // Example usage of topological sort<NEW_LINE>public static void main(String[] args) {<NEW_LINE>// Graph setup<NEW_LINE>final int N = 7;<NEW_LINE>Map<Integer, List<Edge>> graph = new HashMap<>();<NEW_LINE>for (int i = 0; i < N; i++) graph.put(i, new ArrayList<>());<NEW_LINE>graph.get(0).add(new Edge(0, 1, 3));<NEW_LINE>graph.get(0).add(new Edge(0, 2, 2));<NEW_LINE>graph.get(0).add(new Edge(0, 5, 3));<NEW_LINE>graph.get(1).add(new Edge(1, 3, 1));<NEW_LINE>graph.get(1).add(new Edge(1, 2, 6));<NEW_LINE>graph.get(2).add(new Edge(2, 3, 1));<NEW_LINE>graph.get(2).add(new Edge(2, 4, 10));<NEW_LINE>graph.get(3).add(new Edge(3, 4, 5));<NEW_LINE>graph.get(5).add(new Edge(5, 4, 7));<NEW_LINE>int[] <MASK><NEW_LINE>// // Prints: [6, 0, 5, 1, 2, 3, 4]<NEW_LINE>System.out.println(java.util.Arrays.toString(ordering));<NEW_LINE>// Finds all the shortest paths starting at node 0<NEW_LINE>Integer[] dists = dagShortestPath(graph, 0, N);<NEW_LINE>// Find the shortest path from 0 to 4 which is 8.0<NEW_LINE>System.out.println(dists[4]);<NEW_LINE>// Find the shortest path from 0 to 6 which<NEW_LINE>// is null since 6 is not reachable!<NEW_LINE>System.out.println(dists[6]);<NEW_LINE>} | ordering = topologicalSort(graph, N); |
1,510,604 | protected void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception {<NEW_LINE>final ItemStack item = user.getBase().getItemInHand();<NEW_LINE>if (MaterialUtil.isAir(item.getType())) {<NEW_LINE>throw new Exception(tl("itemloreInvalidItem"));<NEW_LINE>}<NEW_LINE>if (args.length == 0) {<NEW_LINE>throw new NotEnoughArgumentsException();<NEW_LINE>}<NEW_LINE>final ItemMeta im = item.getItemMeta();<NEW_LINE>if (args[0].equalsIgnoreCase("add") && args.length > 1) {<NEW_LINE>final String line = FormatUtil.formatString(user, "essentials.itemlore", getFinalArg(args<MASK><NEW_LINE>final List<String> lore = im.hasLore() ? im.getLore() : new ArrayList<>();<NEW_LINE>lore.add(line);<NEW_LINE>im.setLore(lore);<NEW_LINE>item.setItemMeta(im);<NEW_LINE>user.sendMessage(tl("itemloreSuccess", line));<NEW_LINE>} else if (args[0].equalsIgnoreCase("clear")) {<NEW_LINE>im.setLore(new ArrayList<>());<NEW_LINE>item.setItemMeta(im);<NEW_LINE>user.sendMessage(tl("itemloreClear"));<NEW_LINE>} else if (args[0].equalsIgnoreCase("set") && args.length > 2 && NumberUtil.isInt(args[1])) {<NEW_LINE>if (!im.hasLore()) {<NEW_LINE>throw new Exception(tl("itemloreNoLore"));<NEW_LINE>}<NEW_LINE>final int line = Integer.parseInt(args[1]);<NEW_LINE>final String newLine = FormatUtil.formatString(user, "essentials.itemlore", getFinalArg(args, 2)).trim();<NEW_LINE>final List<String> lore = im.getLore();<NEW_LINE>try {<NEW_LINE>lore.set(line - 1, newLine);<NEW_LINE>} catch (final Exception e) {<NEW_LINE>throw new Exception(tl("itemloreNoLine", line), e);<NEW_LINE>}<NEW_LINE>im.setLore(lore);<NEW_LINE>item.setItemMeta(im);<NEW_LINE>user.sendMessage(tl("itemloreSuccessLore", line, newLine));<NEW_LINE>} else {<NEW_LINE>throw new NotEnoughArgumentsException();<NEW_LINE>}<NEW_LINE>} | , 1)).trim(); |
470,053 | public RTTexture readBack(Rectangle view) {<NEW_LINE>RenderTarget rt = getRenderTarget();<NEW_LINE>context.flushVertexBuffer();<NEW_LINE>context.validateLCDBuffer(rt);<NEW_LINE>RTTexture lcdrtt = context.getLCDBuffer();<NEW_LINE>Texture bbtex = ((<MASK><NEW_LINE>float x1 = view.x;<NEW_LINE>float y1 = view.y;<NEW_LINE>float x2 = x1 + view.width;<NEW_LINE>float y2 = y1 + view.height;<NEW_LINE>// Create a graphics for us to render into the LCDBuffer<NEW_LINE>// Note this also sets the current RenderTarget as the LCDBuffer<NEW_LINE>BaseShaderGraphics bsg = (BaseShaderGraphics) lcdrtt.createGraphics();<NEW_LINE>bsg.setCompositeMode(CompositeMode.SRC);<NEW_LINE>context.validateTextureOp(bsg, IDENT, bbtex, bbtex.getPixelFormat());<NEW_LINE>// sample the source RT in the following bounds and store it in the LCDBuffer RT.<NEW_LINE>bsg.drawTexture(bbtex, 0, 0, view.width, view.height, x1, y1, x2, y2);<NEW_LINE>context.flushVertexBuffer();<NEW_LINE>// set the RenderTarget back to this.<NEW_LINE>context.setRenderTarget(this);<NEW_LINE>return lcdrtt;<NEW_LINE>} | ReadbackRenderTarget) rt).getBackBuffer(); |
1,798,686 | public Integer debug(@NonNull final FileObject startFile, @NonNull final ExecutionDescriptor executionDescriptor, @NullAllowed final ExecutionDescriptor.InputProcessorFactory2 outProcessorFactory) throws ExecutionException {<NEW_LINE>if (!EventQueue.isDispatchThread()) {<NEW_LINE>return debugInternal(startFile, executionDescriptor, outProcessorFactory);<NEW_LINE>}<NEW_LINE>// ui thread<NEW_LINE>final AtomicReference<Integer> executionResult = new AtomicReference<>();<NEW_LINE>final AtomicReference<ExecutionException> executionException = new AtomicReference<>();<NEW_LINE>BaseProgressUtils.showProgressDialogAndRun(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>try {<NEW_LINE>executionResult.set(debugInternal(startFile, executionDescriptor, outProcessorFactory));<NEW_LINE>} catch (ExecutionException ex) {<NEW_LINE>executionException.set(ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (executionException.get() != null) {<NEW_LINE>throw executionException.get();<NEW_LINE>}<NEW_LINE>return executionResult.get();<NEW_LINE>} | }, Bundle.PhpExecutable_debug_progress()); |
112,796 | public Plan plan(Analysis analysis, Stage stage) {<NEW_LINE>PlanNode root = planStatement(analysis, analysis.getStatement());<NEW_LINE>planChecker.validateIntermediatePlan(root, session, metadata, sqlParser, variableAllocator.getTypes(), warningCollector);<NEW_LINE>boolean enableVerboseRuntimeStats = SystemSessionProperties.isVerboseRuntimeStatsEnabled(session);<NEW_LINE>if (stage.ordinal() >= Stage.OPTIMIZED.ordinal()) {<NEW_LINE>for (PlanOptimizer optimizer : planOptimizers) {<NEW_LINE>long start = System.nanoTime();<NEW_LINE>root = optimizer.optimize(root, session, variableAllocator.getTypes(), variableAllocator, idAllocator, warningCollector);<NEW_LINE>requireNonNull(root, format("%s returned a null plan", optimizer.getClass().getName()));<NEW_LINE>if (enableVerboseRuntimeStats) {<NEW_LINE>session.getRuntimeStats().addMetricValue(String.format("optimizer%sTimeNanos", optimizer.getClass().getSimpleName()), System.nanoTime() - start);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (stage.ordinal() >= Stage.OPTIMIZED_AND_VALIDATED.ordinal()) {<NEW_LINE>// make sure we produce a valid plan after optimizations run. This is mainly to catch programming errors<NEW_LINE>planChecker.validateFinalPlan(root, session, metadata, sqlParser, variableAllocator.getTypes(), warningCollector);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>return new Plan(root, types, computeStats(root, types));<NEW_LINE>} | TypeProvider types = variableAllocator.getTypes(); |
617,783 | public PoolTaskRest findByItem(@Parameter(value = "uuid", required = true) UUID itemUUID) {<NEW_LINE>PoolTask poolTask = null;<NEW_LINE>try {<NEW_LINE>Context context = obtainContext();<NEW_LINE>Item item = itemService.find(context, itemUUID);<NEW_LINE>if (item == null) {<NEW_LINE>throw new UnprocessableEntityException("There is no Item with uuid provided, uuid:" + itemUUID);<NEW_LINE>}<NEW_LINE>XmlWorkflowItem xmlWorkflowItem = xmlWorkflowItemService.findByItem(context, item);<NEW_LINE>if (xmlWorkflowItem == null) {<NEW_LINE>return null;<NEW_LINE>} else {<NEW_LINE>poolTask = poolTaskService.findByWorkflowIdAndEPerson(context, xmlWorkflowItem, context.getCurrentUser());<NEW_LINE>}<NEW_LINE>if (poolTask == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return converter.toRest(poolTask, utils.obtainProjection());<NEW_LINE>} catch (SQLException | AuthorizeException | IOException e) {<NEW_LINE>throw new RuntimeException(<MASK><NEW_LINE>}<NEW_LINE>} | e.getMessage(), e); |
341,439 | private MLocator findOldestLocatorWithSameWarehouse(final int M_Locator_ID) {<NEW_LINE>String trxName = null;<NEW_LINE>MLocator retValue = null;<NEW_LINE>String sql = "SELECT * FROM M_Locator l " + "WHERE IsActive = 'Y' AND IsDefault='Y'" + " AND EXISTS (SELECT * FROM M_Locator lx " + "WHERE l.M_Warehouse_ID=lx.M_Warehouse_ID AND lx.M_Locator_ID=?) " + "ORDER BY Created";<NEW_LINE>PreparedStatement pstmt = null;<NEW_LINE>ResultSet rs = null;<NEW_LINE>try {<NEW_LINE>pstmt = DB.prepareStatement(sql, trxName);<NEW_LINE>pstmt.setInt(1, M_Locator_ID);<NEW_LINE>rs = pstmt.executeQuery();<NEW_LINE>while (rs.next()) {<NEW_LINE>retValue = new MLocator(<MASK><NEW_LINE>}<NEW_LINE>} catch (SQLException e) {<NEW_LINE>throw new DBException(e, sql);<NEW_LINE>} finally {<NEW_LINE>DB.close(rs, pstmt);<NEW_LINE>rs = null;<NEW_LINE>pstmt = null;<NEW_LINE>}<NEW_LINE>return retValue;<NEW_LINE>} | getCtx(), rs, trxName); |
520,906 | ActionResult<Wo> execute(EffectivePerson effectivePerson, String flag, String portalFlag) throws Exception {<NEW_LINE>ActionResult<Wo> result = new ActionResult<>();<NEW_LINE>Wo wo = null;<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>Business business = new Business(emc);<NEW_LINE>CacheKey cacheKey = new CacheKey(this.<MASK><NEW_LINE>Optional<?> optional = CacheManager.get(cache, cacheKey);<NEW_LINE>if (optional.isPresent()) {<NEW_LINE>wo = (Wo) optional.get();<NEW_LINE>Portal portal = business.portal().pick(wo.getPortal());<NEW_LINE>if (!business.portal().visible(effectivePerson, portal)) {<NEW_LINE>throw new ExceptionPortalAccessDenied(effectivePerson.getDistinguishedName(), portal.getName(), portal.getId());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>Portal portal = emc.flag(portalFlag, Portal.class);<NEW_LINE>if (null == portal) {<NEW_LINE>throw new ExceptionPortalNotExist(portalFlag);<NEW_LINE>}<NEW_LINE>if (!business.portal().visible(effectivePerson, portal)) {<NEW_LINE>throw new ExceptionPortalAccessDenied(effectivePerson.getDistinguishedName(), portal.getName(), portal.getId());<NEW_LINE>}<NEW_LINE>Widget widget = emc.restrictFlag(flag, Widget.class, Widget.portal_FIELDNAME, portal.getId());<NEW_LINE>if (null == widget) {<NEW_LINE>throw new ExceptionWidgetNotExist(flag);<NEW_LINE>}<NEW_LINE>wo = Wo.copier.copy(widget);<NEW_LINE>wo.setData(widget.getDataOrMobileData());<NEW_LINE>CacheManager.put(cache, cacheKey, wo);<NEW_LINE>}<NEW_LINE>result.setData(wo);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>} | getClass(), flag, portalFlag); |
135,559 | public void onValidate(@NonNull String purchaseData, @NonNull ValidationStatus status, boolean isTrial) {<NEW_LINE>LOGGER.i(TAG, "Validation status of '" + mType + "': " + status);<NEW_LINE>if (status == ValidationStatus.VERIFIED)<NEW_LINE>Statistics.INSTANCE.trackPurchaseEvent(Statistics.EventName.INAPP_PURCHASE_VALIDATION_SUCCESS, mType.getServerId());<NEW_LINE>else<NEW_LINE>Statistics.INSTANCE.trackPurchaseValidationError(mType.getServerId(), status);<NEW_LINE>final boolean shouldActivateSubscription = status != ValidationStatus.NOT_VERIFIED;<NEW_LINE>final boolean hasActiveSubscription = Framework.nativeHasActiveSubscription(mType.ordinal());<NEW_LINE>if (!hasActiveSubscription && shouldActivateSubscription) {<NEW_LINE>LOGGER.i(TAG, "'" + mType + "' subscription activated");<NEW_LINE>Statistics.INSTANCE.trackPurchaseProductDelivered(mType.getServerId(), mType.getVendor(), isTrial);<NEW_LINE>} else if (hasActiveSubscription && !shouldActivateSubscription) {<NEW_LINE>LOGGER.i(<MASK><NEW_LINE>}<NEW_LINE>Framework.nativeSetActiveSubscription(mType.ordinal(), shouldActivateSubscription, isTrial);<NEW_LINE>if (getUiCallback() != null)<NEW_LINE>getUiCallback().onValidationFinish(shouldActivateSubscription);<NEW_LINE>} | TAG, "'" + mType + "' subscription deactivated"); |
1,603,919 | private void publishNotification(final String arn, @Nullable final String fallbackArn, final SNSMessage<?> message, final QualifiedName name, final String errorMessage, final String counterKey) {<NEW_LINE>this.notificationMetric.recordTime(message, Metrics.TimerNotificationsBeforePublishDelay.getMetricName());<NEW_LINE>try {<NEW_LINE>//<NEW_LINE>// Publish the event to original SNS topic. If we receive an error from SNS, we will then try publishing<NEW_LINE>// to the fallback topic.<NEW_LINE>//<NEW_LINE>try {<NEW_LINE>publishNotification(arn, message, counterKey);<NEW_LINE>} catch (final Exception exception) {<NEW_LINE>if (fallbackArn != null) {<NEW_LINE>log.info("Fallback published message to topic {} because of error {}", fallbackArn, exception.getMessage());<NEW_LINE>notificationMetric.counterIncrement(Metrics.CounterSNSNotificationPublishFallback.getMetricName());<NEW_LINE>publishNotification(fallbackArn, message, counterKey);<NEW_LINE>} else {<NEW_LINE>throw exception;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>notificationMetric.handleException(name, <MASK><NEW_LINE>}<NEW_LINE>} | errorMessage, counterKey, message, e); |
1,421,014 | public static DescribeLifecycleHooksResponse unmarshall(DescribeLifecycleHooksResponse describeLifecycleHooksResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeLifecycleHooksResponse.setRequestId(_ctx.stringValue("DescribeLifecycleHooksResponse.RequestId"));<NEW_LINE>describeLifecycleHooksResponse.setTotalCount(_ctx.integerValue("DescribeLifecycleHooksResponse.TotalCount"));<NEW_LINE>describeLifecycleHooksResponse.setPageNumber(_ctx.integerValue("DescribeLifecycleHooksResponse.PageNumber"));<NEW_LINE>describeLifecycleHooksResponse.setPageSize(_ctx.integerValue("DescribeLifecycleHooksResponse.PageSize"));<NEW_LINE>List<LifecycleHook> lifecycleHooks = new ArrayList<LifecycleHook>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeLifecycleHooksResponse.LifecycleHooks.Length"); i++) {<NEW_LINE>LifecycleHook lifecycleHook = new LifecycleHook();<NEW_LINE>lifecycleHook.setScalingGroupId(_ctx.stringValue<MASK><NEW_LINE>lifecycleHook.setLifecycleHookId(_ctx.stringValue("DescribeLifecycleHooksResponse.LifecycleHooks[" + i + "].LifecycleHookId"));<NEW_LINE>lifecycleHook.setLifecycleHookName(_ctx.stringValue("DescribeLifecycleHooksResponse.LifecycleHooks[" + i + "].LifecycleHookName"));<NEW_LINE>lifecycleHook.setDefaultResult(_ctx.stringValue("DescribeLifecycleHooksResponse.LifecycleHooks[" + i + "].DefaultResult"));<NEW_LINE>lifecycleHook.setHeartbeatTimeout(_ctx.integerValue("DescribeLifecycleHooksResponse.LifecycleHooks[" + i + "].HeartbeatTimeout"));<NEW_LINE>lifecycleHook.setLifecycleTransition(_ctx.stringValue("DescribeLifecycleHooksResponse.LifecycleHooks[" + i + "].LifecycleTransition"));<NEW_LINE>lifecycleHook.setNotificationMetadata(_ctx.stringValue("DescribeLifecycleHooksResponse.LifecycleHooks[" + i + "].NotificationMetadata"));<NEW_LINE>lifecycleHook.setNotificationArn(_ctx.stringValue("DescribeLifecycleHooksResponse.LifecycleHooks[" + i + "].NotificationArn"));<NEW_LINE>lifecycleHooks.add(lifecycleHook);<NEW_LINE>}<NEW_LINE>describeLifecycleHooksResponse.setLifecycleHooks(lifecycleHooks);<NEW_LINE>return describeLifecycleHooksResponse;<NEW_LINE>} | ("DescribeLifecycleHooksResponse.LifecycleHooks[" + i + "].ScalingGroupId")); |
897,639 | public ExternalWorkflowExecutionCancelRequestedEventAttributes unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ExternalWorkflowExecutionCancelRequestedEventAttributes externalWorkflowExecutionCancelRequestedEventAttributes = new ExternalWorkflowExecutionCancelRequestedEventAttributes();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("workflowExecution", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>externalWorkflowExecutionCancelRequestedEventAttributes.setWorkflowExecution(WorkflowExecutionJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("initiatedEventId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>externalWorkflowExecutionCancelRequestedEventAttributes.setInitiatedEventId(context.getUnmarshaller(Long.<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return externalWorkflowExecutionCancelRequestedEventAttributes;<NEW_LINE>} | class).unmarshall(context)); |
802,441 | public HbaseSchemaManagerTask create(ProgramCommand programCommand, ProgramOptions programOptions) {<NEW_LINE>if (programCommand == ProgramCommand.EMPTY) {<NEW_LINE>return new HelpTask();<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>Command command = Command.fromValue(commandString);<NEW_LINE>if (command == null) {<NEW_LINE>return new HelpTask();<NEW_LINE>}<NEW_LINE>switch(command) {<NEW_LINE>case INIT:<NEW_LINE>{<NEW_LINE>String namespace = programOptions.getNamespace();<NEW_LINE>return new InitTask(hbaseSchemaService, namespace);<NEW_LINE>}<NEW_LINE>case UPDATE:<NEW_LINE>{<NEW_LINE>String namespace = programOptions.getNamespace();<NEW_LINE>String compression = programOptions.getCompression();<NEW_LINE>return new UpdateTask(hbaseSchemaService, hbaseSchemaReader, namespace, compression);<NEW_LINE>}<NEW_LINE>case RESET:<NEW_LINE>{<NEW_LINE>String namespace = programOptions.getNamespace();<NEW_LINE>return new ResetTask(hbaseSchemaService, namespace);<NEW_LINE>}<NEW_LINE>case SUMMARY:<NEW_LINE>{<NEW_LINE>String namespace = programOptions.getNamespace();<NEW_LINE>return new PrintSchemaChangeSummaryTask(hbaseSchemaService, namespace);<NEW_LINE>}<NEW_LINE>case LOG:<NEW_LINE>{<NEW_LINE>String namespace = programOptions.getNamespace();<NEW_LINE>return new PrintSchemaChangeLogTask(hbaseSchemaService, xmlFormatter, namespace);<NEW_LINE>}<NEW_LINE>case HELP:<NEW_LINE>return new HelpTask();<NEW_LINE>default:<NEW_LINE>return new HelpTask();<NEW_LINE>}<NEW_LINE>} | String commandString = programCommand.getCommand(); |
688,878 | private void warnMissingSemi(int pos, int end) {<NEW_LINE>// Should probably change this to be a CompilerEnvirons setting,<NEW_LINE>// with an enum Never, Always, Permissive, where Permissive means<NEW_LINE>// don't warn for 1-line functions like function (s) {return x+2}<NEW_LINE>if (compilerEnv.isStrictMode()) {<NEW_LINE>int[] linep = new int[2];<NEW_LINE>String line = <MASK><NEW_LINE>// this code originally called lineBeginningFor() and in order to<NEW_LINE>// preserve its different line-offset handling, we need to special<NEW_LINE>// case ide-mode here<NEW_LINE>int beg = compilerEnv.isIdeMode() ? Math.max(pos, end - linep[1]) : pos;<NEW_LINE>if (line != null) {<NEW_LINE>addStrictWarning("msg.missing.semi", "", beg, end - beg, linep[0], line, linep[1]);<NEW_LINE>} else {<NEW_LINE>// no line information available, report warning at current line<NEW_LINE>addStrictWarning("msg.missing.semi", "", beg, end - beg);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ts.getLine(end, linep); |
1,586,815 | public List<VolumeVO> returnAttachableVolumes(VmInstanceInventory vm, List<VolumeVO> candidates) {<NEW_LINE>// find instantiated volumes<NEW_LINE>List<String> volUuids = CollectionUtils.transformToList(candidates, new Function<String, VolumeVO>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String call(VolumeVO arg) {<NEW_LINE>return VolumeStatus.Ready == arg.getStatus() ? arg.getUuid() : null;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>if (volUuids.isEmpty()) {<NEW_LINE>return candidates;<NEW_LINE>}<NEW_LINE>List<String> vmAllVolumeUuids = CollectionUtils.transformToList(vm.getAllVolumes(), VolumeInventory::getUuid);<NEW_LINE>// root volume could be located at a shared storage<NEW_LINE>String sql = "select ref.hostUuid" + " from LocalStorageResourceRefVO ref" + " where ref.resourceUuid in (:volUuids)" + " and ref.resourceType = :rtype";<NEW_LINE>TypedQuery<String> q = dbf.getEntityManager().createQuery(sql, String.class);<NEW_LINE>q.setParameter("volUuids", vmAllVolumeUuids);<NEW_LINE>q.setParameter("rtype", VolumeVO.class.getSimpleName());<NEW_LINE>List<String> ret = q.getResultList();<NEW_LINE>String hostUuid = vm.getHostUuid();<NEW_LINE>if (!ret.isEmpty()) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>sql = "select ref.resourceUuid" + " from LocalStorageResourceRefVO ref" + " where ref.resourceUuid in (:uuids)" + " and ref.resourceType = :rtype" + " and ref.hostUuid != :huuid";<NEW_LINE>q = dbf.getEntityManager().createQuery(sql, String.class);<NEW_LINE>q.setParameter("uuids", volUuids);<NEW_LINE>q.setParameter("huuid", hostUuid);<NEW_LINE>q.setParameter("rtype", VolumeVO.class.getSimpleName());<NEW_LINE>final List<String> toExclude = q.getResultList();<NEW_LINE>candidates = CollectionUtils.transformToList(candidates, new Function<VolumeVO, VolumeVO>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public VolumeVO call(VolumeVO arg) {<NEW_LINE>return toExclude.contains(arg.getUuid()) ? null : arg;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return candidates;<NEW_LINE>} | hostUuid = ret.get(0); |
142,910 | static OrientDBInternal remote(String[] hosts, OrientDBConfig configuration) {<NEW_LINE>OrientDBInternal factory;<NEW_LINE>try {<NEW_LINE>String className = "com.orientechnologies.orient.core.db.OrientDBRemote";<NEW_LINE>ClassLoader loader;<NEW_LINE>if (configuration != null) {<NEW_LINE>loader = configuration.getClassLoader();<NEW_LINE>} else {<NEW_LINE>loader = OrientDBInternal.class.getClassLoader();<NEW_LINE>}<NEW_LINE>Class<?> kass = loader.loadClass(className);<NEW_LINE>Constructor<?> constructor = kass.getConstructor(String[].class, OrientDBConfig.class, Orient.class);<NEW_LINE>factory = (OrientDBInternal) constructor.newInstance(hosts, configuration, Orient.instance());<NEW_LINE>} catch (ClassNotFoundException | NoSuchMethodException | IllegalAccessException | InstantiationException e) {<NEW_LINE>throw OException.wrapException(<MASK><NEW_LINE>} catch (InvocationTargetException e) {<NEW_LINE>// noinspection ThrowInsideCatchBlockWhichIgnoresCaughtException<NEW_LINE>throw OException.wrapException(new ODatabaseException("Error creating OrientDB remote factory"), e.getTargetException());<NEW_LINE>}<NEW_LINE>return factory;<NEW_LINE>} | new ODatabaseException("OrientDB client API missing"), e); |
1,824,550 | public void itemWritten(@Nullable final Object written) {<NEW_LINE>FlushBoundary boundary;<NEW_LINE>try {<NEW_LINE>boundary = flushBoundaryProvider.detectBoundary(written);<NEW_LINE>} catch (Throwable cause) {<NEW_LINE>// Exceptions are not supported, consider this a boundary to force a flush. This may happen if there are<NEW_LINE>// multiple content-length headers which haven't been caught by other validation yet.<NEW_LINE>boundary = End;<NEW_LINE>}<NEW_LINE>adjustForMissingBoundaries(boundary);<NEW_LINE>previousBoundary = boundary;<NEW_LINE>switch(boundary) {<NEW_LINE>case Start:<NEW_LINE>delegate = flushStrategyHolder.currentStrategy().apply(flushSender);<NEW_LINE>delegate.writeStarted();<NEW_LINE>delegate.itemWritten(written);<NEW_LINE>break;<NEW_LINE>case InProgress:<NEW_LINE>delegate.itemWritten(written);<NEW_LINE>break;<NEW_LINE>case End:<NEW_LINE>delegate.itemWritten(written);<NEW_LINE>// New boundary started, terminate the old listener<NEW_LINE>delegate.writeTerminated();<NEW_LINE>delegate = NOOP_LISTENER;<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | throw new IllegalArgumentException("Unknown flush boundary: " + boundary); |
1,598,853 | public CreateShareUploadChannelResponse createShareUploadChannel(CreateShareUploadChannelRequest body, String accessKey) throws ApiException {<NEW_LINE>Object localVarPostBody = body;<NEW_LINE>// verify the required parameter 'body' is set<NEW_LINE>if (body == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'body' when calling createShareUploadChannel");<NEW_LINE>}<NEW_LINE>// verify the required parameter 'accessKey' is set<NEW_LINE>if (accessKey == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'accessKey' when calling createShareUploadChannel");<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/v4/public/shares/uploads/{access_key}".replaceAll("\\{" + "access_key" + "\\}", apiClient.escapeString(accessKey.toString()));<NEW_LINE>// query params<NEW_LINE>List<Pair> localVarQueryParams <MASK><NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = { "application/json" };<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] localVarAuthNames = new String[] {};<NEW_LINE>GenericType<CreateShareUploadChannelResponse> localVarReturnType = new GenericType<CreateShareUploadChannelResponse>() {<NEW_LINE>};<NEW_LINE>return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);<NEW_LINE>} | = new ArrayList<Pair>(); |
814,464 | public ProgramFragment createFragment(String fragmentName) throws DuplicateNameException {<NEW_LINE>lock.acquire();<NEW_LINE>try {<NEW_LINE>checkDeleted();<NEW_LINE>if (moduleAdapter.getModuleRecord(fragmentName) != null || fragmentAdapter.getFragmentRecord(fragmentName) != null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>DBRecord fragmentRecord = fragmentAdapter.createFragmentRecord(key, fragmentName);<NEW_LINE>// negative value to indicates fragment<NEW_LINE>DBRecord pcRec = parentChildAdapter.addParentChildRecord(key, -fragmentRecord.getKey());<NEW_LINE>updateChildCount(1);<NEW_LINE>updateOrderField(pcRec, childCount - 1);<NEW_LINE>FragmentDB frag = moduleMgr.getFragmentDB(fragmentRecord);<NEW_LINE>moduleMgr.fragmentAdded(key, frag);<NEW_LINE>return frag;<NEW_LINE>} catch (IOException e) {<NEW_LINE>moduleMgr.dbError(e);<NEW_LINE>} finally {<NEW_LINE>lock.release();<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | throw new DuplicateNameException(fragmentName + " already exists"); |
1,388,199 | private void _processPortletRequest(HttpServletRequest req, HttpServletResponse res, boolean action) throws Exception {<NEW_LINE>String contentType = req.getHeader("Content-Type");<NEW_LINE>if ((contentType != null) && (contentType.startsWith("multipart/form-data"))) {<NEW_LINE>UploadServletRequest uploadReq = (UploadServletRequest) req;<NEW_LINE>req = uploadReq;<NEW_LINE>}<NEW_LINE>String companyId = PortalUtil.getCompanyId(req);<NEW_LINE>User user = PortalUtil.getUser(req);<NEW_LINE>Layout layout = (Layout) req.getAttribute(WebKeys.LAYOUT);<NEW_LINE>String portletId = ParamUtil.getString(req, "p_p_id");<NEW_LINE>Portlet portlet = PortletManagerUtil.getPortletById(companyId, portletId);<NEW_LINE>ServletContext ctx = (ServletContext) req.getAttribute(WebKeys.CTX);<NEW_LINE>ConcretePortletWrapper concretePortletWrapper = (ConcretePortletWrapper) APILocator.getPortletAPI().getImplementingInstance(portlet);<NEW_LINE>PortletPreferences portletPrefs = null;<NEW_LINE>PortletConfig portletConfig = APILocator.getPortletAPI().getPortletConfig(portlet);<NEW_LINE>PortletContext portletCtx = portletConfig.getPortletContext();<NEW_LINE>WindowState windowState = new WindowState(ParamUtil.getString(req, "p_p_state"));<NEW_LINE>PortletMode portletMode = new PortletMode(ParamUtil.getString(req, "p_p_mode"));<NEW_LINE>if (action) {<NEW_LINE>ActionRequestImpl actionRequest = new ActionRequestImpl(req, portlet, concretePortletWrapper, portletCtx, windowState, portletMode, portletPrefs, layout.getId());<NEW_LINE>ActionResponseImpl actionResponse = new ActionResponseImpl(actionRequest, res, portletId, <MASK><NEW_LINE>actionRequest.defineObjects(portletConfig, actionResponse);<NEW_LINE>concretePortletWrapper.processAction(actionRequest, actionResponse);<NEW_LINE>RenderParametersPool.put(req, layout.getId(), portletId, actionResponse.getRenderParameters());<NEW_LINE>} else {<NEW_LINE>// PortalUtil.updateWindowState(portletId, user, layout, windowState);<NEW_LINE>//<NEW_LINE>// PortalUtil.updatePortletMode(portletId, user, layout, portletMode);<NEW_LINE>}<NEW_LINE>} | user, layout, windowState, portletMode); |
303,486 | protected final ForLoopTree rewriteChildren(ForLoopTree tree) {<NEW_LINE>List<? extends StatementTree> init = translate(tree.getInitializer());<NEW_LINE>ExpressionTree cond = (ExpressionTree) translate(tree.getCondition());<NEW_LINE>List<? extends ExpressionStatementTree> step = translate(tree.getUpdate());<NEW_LINE>StatementTree body = (StatementTree) translate(tree.getStatement());<NEW_LINE>if (!init.equals(tree.getInitializer()) || cond != tree.getCondition() || !step.equals(tree.getUpdate()) || body != tree.getStatement()) {<NEW_LINE>if (init != tree.getInitializer())<NEW_LINE>init = optimize(init);<NEW_LINE>if (step != tree.getUpdate())<NEW_LINE>step = optimize(step);<NEW_LINE>ForLoopTree n = make.ForLoop(init, cond, step, body);<NEW_LINE>model.setType(n<MASK><NEW_LINE>copyCommentTo(tree, n);<NEW_LINE>if (tree.getInitializer().size() != init.size() || tree.getUpdate().size() != step.size())<NEW_LINE>model.setPos(tree, NOPOS);<NEW_LINE>else<NEW_LINE>copyPosTo(tree, n);<NEW_LINE>tree = n;<NEW_LINE>}<NEW_LINE>return tree;<NEW_LINE>} | , model.getType(tree)); |
449,935 | public State mouseWheelMoved(Widget widget, WidgetMouseWheelEvent event) {<NEW_LINE>Scene scene = widget.getScene();<NEW_LINE>int modifiers = scene.getInputBindings().getZoomActionModifiers();<NEW_LINE>if ((event.getModifiers() & modifiers) != modifiers)<NEW_LINE>return State.REJECTED;<NEW_LINE>int amount = event.getWheelRotation();<NEW_LINE>double scale = 1.0;<NEW_LINE>while (amount > 0) {<NEW_LINE>scale /= zoomMultiplier;<NEW_LINE>amount--;<NEW_LINE>}<NEW_LINE>while (amount < 0) {<NEW_LINE>scale *= zoomMultiplier;<NEW_LINE>amount++;<NEW_LINE>}<NEW_LINE>JComponent view = scene.getView();<NEW_LINE>if (view != null) {<NEW_LINE>Rectangle viewBounds = view.getVisibleRect();<NEW_LINE>Point center = widget.convertLocalToScene(event.getPoint());<NEW_LINE>Point mouseLocation = scene.convertSceneToView(center);<NEW_LINE>scene.setZoomFactor(scale * scene.getZoomFactor());<NEW_LINE>// HINT - forcing to change preferred size of the JComponent view<NEW_LINE>scene.validate();<NEW_LINE><MASK><NEW_LINE>view.scrollRectToVisible(new Rectangle(center.x - (mouseLocation.x - viewBounds.x), center.y - (mouseLocation.y - viewBounds.y), viewBounds.width, viewBounds.height));<NEW_LINE>} else<NEW_LINE>scene.setZoomFactor(scale * scene.getZoomFactor());<NEW_LINE>return State.CONSUMED;<NEW_LINE>} | center = scene.convertSceneToView(center); |
354,656 | void respondToRequest(WorkRequest request, RequestInfo requestInfo) throws IOException {<NEW_LINE>int exitCode;<NEW_LINE>StringWriter sw = new StringWriter();<NEW_LINE>try (PrintWriter pw = new PrintWriter(sw)) {<NEW_LINE>try {<NEW_LINE>exitCode = <MASK><NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>exitCode = 1;<NEW_LINE>} catch (RuntimeException e) {<NEW_LINE>e.printStackTrace(pw);<NEW_LINE>exitCode = 1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Optional<WorkResponse.Builder> optBuilder = requestInfo.takeBuilder();<NEW_LINE>if (optBuilder.isPresent()) {<NEW_LINE>WorkResponse.Builder builder = optBuilder.get();<NEW_LINE>builder.setRequestId(request.getRequestId());<NEW_LINE>if (requestInfo.isCancelled()) {<NEW_LINE>builder.setWasCancelled(true);<NEW_LINE>} else {<NEW_LINE>builder.setOutput(builder.getOutput() + sw).setExitCode(exitCode);<NEW_LINE>}<NEW_LINE>WorkResponse response = builder.build();<NEW_LINE>synchronized (this) {<NEW_LINE>messageProcessor.writeWorkResponse(response);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>gcScheduler.maybePerformGc();<NEW_LINE>} | callback.apply(request, pw); |
405,740 | public boolean[] findNativePointers(MethodReference method, ProgramReader program) {<NEW_LINE>IntDeque stack = new IntArrayDeque();<NEW_LINE>for (int i = 0; i < method.parameterCount(); ++i) {<NEW_LINE>if (isNativeType(method.parameterType(i))) {<NEW_LINE>stack.addLast(i + 1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Analyzer analyzer = new Analyzer(program.variableCount(), stack);<NEW_LINE>for (BasicBlockReader block : program.getBasicBlocks()) {<NEW_LINE>for (PhiReader phi : block.readPhis()) {<NEW_LINE>for (IncomingReader incoming : phi.readIncomings()) {<NEW_LINE>analyzer.assignmentGraph.addEdge(incoming.getValue().getIndex(), phi.getReceiver().getIndex());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>block.readAllInstructions(analyzer);<NEW_LINE>}<NEW_LINE>boolean[] result = new boolean[program.variableCount()];<NEW_LINE>Graph graph <MASK><NEW_LINE>while (!stack.isEmpty()) {<NEW_LINE>int v = stack.removeLast();<NEW_LINE>if (result[v]) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>result[v] = true;<NEW_LINE>for (int succ : graph.outgoingEdges(v)) {<NEW_LINE>if (!result[succ]) {<NEW_LINE>stack.addLast(succ);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | = analyzer.assignmentGraph.build(); |
1,084,627 | public String encryptMessage(final String message, final String id, final Ejson ejson) {<NEW_LINE>try {<NEW_LINE>Room room = readRoom(ejson);<NEW_LINE>if (room == null || !room.encrypted || room.e2eKey == null) {<NEW_LINE>return message;<NEW_LINE>}<NEW_LINE>String e2eKey = <MASK><NEW_LINE>if (e2eKey == null) {<NEW_LINE>return message;<NEW_LINE>}<NEW_LINE>Message m = new Message(id, ejson.userId(), message);<NEW_LINE>String cypher = gson.toJson(m);<NEW_LINE>SecureRandom random = new SecureRandom();<NEW_LINE>byte[] bytes = new byte[16];<NEW_LINE>random.nextBytes(bytes);<NEW_LINE>String encrypted = RCTAes.encrypt(Base64.encodeToString(cypher.getBytes("UTF-8"), Base64.NO_WRAP), e2eKey, Util.bytesToHex(bytes));<NEW_LINE>byte[] data = Base64.decode(encrypted, Base64.NO_WRAP);<NEW_LINE>return keyId + Base64.encodeToString(concat(bytes, data), Base64.NO_WRAP);<NEW_LINE>} catch (Exception e) {<NEW_LINE>Log.d("[ROCKETCHAT][E2E]", Log.getStackTraceString(e));<NEW_LINE>}<NEW_LINE>return message;<NEW_LINE>} | decryptRoomKey(room.e2eKey, ejson); |
118,286 | public static void renderSizeLabel(Font fontRenderer, float xPos, float yPos, String text, boolean largeFonts) {<NEW_LINE>final float scaleFactor = largeFonts ? 0.85f : 0.5f;<NEW_LINE>final float inverseScaleFactor = 1.0f / scaleFactor;<NEW_LINE>final int offset = largeFonts ? 0 : -1;<NEW_LINE>Transformation tm = new // Taken from<NEW_LINE>// Taken from<NEW_LINE>Transformation(// ItemRenderer.renderItemOverlayIntoGUI<NEW_LINE>new Vector3f(0, 0, 300), null, new Vector3f(scaleFactor, scaleFactor, scaleFactor), null);<NEW_LINE>RenderSystem.disableBlend();<NEW_LINE>final int X = (int) ((xPos + offset + 16.0f - fontRenderer.width(text) * scaleFactor) * inverseScaleFactor);<NEW_LINE>final int Y = (int) ((yPos + offset + 16.0f - 7.0f * scaleFactor) * inverseScaleFactor);<NEW_LINE>BufferSource buffer = MultiBufferSource.immediate(Tesselator.<MASK><NEW_LINE>fontRenderer.drawInBatch(text, X, Y, 0xffffff, true, tm.getMatrix(), buffer, false, 0, 15728880);<NEW_LINE>buffer.endBatch();<NEW_LINE>RenderSystem.enableBlend();<NEW_LINE>} | getInstance().getBuilder()); |
1,120,689 | public static boolean isValidScope(String scopes, AuthorizationRequestContext authorizationRequestContext, ClientModel client) {<NEW_LINE>if (scopes == null) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (authorizationRequestContext.getAuthorizationDetailEntries() == null || authorizationRequestContext.getAuthorizationDetailEntries().isEmpty()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Collection<String> requestedScopes = TokenManager.parseScopeParameter(scopes).collect(Collectors.toSet());<NEW_LINE>Set<String> rarScopes = authorizationRequestContext.getAuthorizationDetailEntries().stream().map(AuthorizationDetails::getAuthorizationDetails).map(AuthorizationDetailsJSONRepresentation::getScopeNameFromCustomData).collect(Collectors.toSet());<NEW_LINE>if (TokenUtil.isOIDCRequest(scopes)) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (logger.isTraceEnabled()) {<NEW_LINE>logger.tracef("Rar scopes to validate requested scopes against: %1s", String.join(" ", rarScopes));<NEW_LINE>logger.tracef("Requested scopes: %1s", String.join(" ", requestedScopes));<NEW_LINE>}<NEW_LINE>for (String requestedScope : requestedScopes) {<NEW_LINE>// We keep the check to the getDynamicClientScope for the OpenshiftSAClientAdapter<NEW_LINE>if (!rarScopes.contains(requestedScope) && client.getDynamicClientScope(requestedScope) == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | requestedScopes.remove(OAuth2Constants.SCOPE_OPENID); |
1,809,175 | public ObjectName createName(String type, String domain, String name) {<NEW_LINE>try {<NEW_LINE>ObjectName objectName;<NEW_LINE>Hashtable<String, String> properties = new Hashtable<>();<NEW_LINE>properties.put("name", name);<NEW_LINE>properties.put("type", type);<NEW_LINE>objectName = new ObjectName(domain, properties);<NEW_LINE>if (objectName.isDomainPattern()) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (objectName.isPropertyValuePattern("name") || shouldQuote(objectName.getKeyProperty("name"))) {<NEW_LINE>properties.put("name", ObjectName.quote(name));<NEW_LINE>}<NEW_LINE>if (objectName.isPropertyValuePattern("type") || shouldQuote(objectName.getKeyProperty("type"))) {<NEW_LINE>properties.put("type", ObjectName.quote(type));<NEW_LINE>}<NEW_LINE>objectName = new ObjectName(domain, properties);<NEW_LINE>return objectName;<NEW_LINE>} catch (MalformedObjectNameException e) {<NEW_LINE>try {<NEW_LINE>return new ObjectName(domain, "name", ObjectName.quote(name));<NEW_LINE>} catch (MalformedObjectNameException e1) {<NEW_LINE>LOGGER.warn("Unable to register {} {}", type, name, e1);<NEW_LINE>throw new RuntimeException(e1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | domain = ObjectName.quote(domain); |
559,424 | final UpdateLicenseConfigurationResult executeUpdateLicenseConfiguration(UpdateLicenseConfigurationRequest updateLicenseConfigurationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateLicenseConfigurationRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateLicenseConfigurationRequest> request = null;<NEW_LINE>Response<UpdateLicenseConfigurationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateLicenseConfigurationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateLicenseConfigurationRequest));<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, "License Manager");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateLicenseConfiguration");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateLicenseConfigurationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateLicenseConfigurationResultJsonUnmarshaller());<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 awsRequestMetrics = executionContext.getAwsRequestMetrics(); |
1,744,079 | public SubTaskGroup createPlacementInfoTask(Collection<NodeDetails> blacklistNodes) {<NEW_LINE>SubTaskGroup subTaskGroup = getTaskExecutor().createSubTaskGroup("UpdatePlacementInfo", executor);<NEW_LINE>UpdatePlacementInfo.Params params = new UpdatePlacementInfo.Params();<NEW_LINE>// Add the universe uuid.<NEW_LINE>params.universeUUID = taskParams().universeUUID;<NEW_LINE>// Set the blacklist nodes if any are passed in.<NEW_LINE>if (blacklistNodes != null && !blacklistNodes.isEmpty()) {<NEW_LINE>Set<String> blacklistNodeNames = new HashSet<String>();<NEW_LINE>for (NodeDetails node : blacklistNodes) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>params.blacklistNodes = blacklistNodeNames;<NEW_LINE>}<NEW_LINE>// Create the task to update placement info.<NEW_LINE>UpdatePlacementInfo task = createTask(UpdatePlacementInfo.class);<NEW_LINE>task.initialize(params);<NEW_LINE>task.setUserTaskUUID(userTaskUUID);<NEW_LINE>// Add it to the task list.<NEW_LINE>subTaskGroup.addSubTask(task);<NEW_LINE>getRunnableTask().addSubTaskGroup(subTaskGroup);<NEW_LINE>return subTaskGroup;<NEW_LINE>} | blacklistNodeNames.add(node.nodeName); |
1,527,674 | protected IDeserializationConverter createInternalConverter(String type) {<NEW_LINE>switch(type.toUpperCase(Locale.ENGLISH)) {<NEW_LINE>case "BOOL":<NEW_LINE>case "BOOLEAN":<NEW_LINE>return val -> new BooleanColumn(Boolean.parseBoolean<MASK><NEW_LINE>case "INT8":<NEW_LINE>case "TINYINT":<NEW_LINE>return val -> new ByteColumn((byte) val);<NEW_LINE>case "INT16":<NEW_LINE>case "SMALLINT":<NEW_LINE>return val -> new BigDecimalColumn((Short) val);<NEW_LINE>case "INTEGER":<NEW_LINE>case "INT32":<NEW_LINE>case "INT":<NEW_LINE>return val -> new BigDecimalColumn((Integer) val);<NEW_LINE>case "FLOAT":<NEW_LINE>return val -> new BigDecimalColumn((Float) val);<NEW_LINE>case "DOUBLE":<NEW_LINE>return val -> new BigDecimalColumn((Double) val);<NEW_LINE>case "LONG":<NEW_LINE>case "INT64":<NEW_LINE>case "BIGINT":<NEW_LINE>return val -> new BigDecimalColumn((Long) val);<NEW_LINE>case "DECIMAL":<NEW_LINE>return val -> new BigDecimalColumn((BigDecimal) val);<NEW_LINE>case "VARCHAR":<NEW_LINE>case "STRING":<NEW_LINE>return val -> new StringColumn((String) val);<NEW_LINE>case "DATE":<NEW_LINE>return val -> new SqlDateColumn(Date.valueOf(String.valueOf(val)));<NEW_LINE>case "TIMESTAMP":<NEW_LINE>return val -> new TimestampColumn((Timestamp) val);<NEW_LINE>case "BINARY":<NEW_LINE>return val -> new BytesColumn((byte[]) val);<NEW_LINE>default:<NEW_LINE>throw new UnsupportedOperationException("Unsupported type:" + type);<NEW_LINE>}<NEW_LINE>} | (val.toString())); |
1,787,534 | static void updateColumnNames(String rawTableName, PinotQuery pinotQuery, boolean isCaseInsensitive, Map<String, String> columnNameMap) {<NEW_LINE>Map<String, String> aliasMap = new HashMap<>();<NEW_LINE>if (pinotQuery != null) {<NEW_LINE>boolean hasStar = false;<NEW_LINE>for (Expression expression : pinotQuery.getSelectList()) {<NEW_LINE>fixColumnName(rawTableName, expression, columnNameMap, aliasMap, isCaseInsensitive);<NEW_LINE>// check if the select expression is '*'<NEW_LINE>if (!hasStar && expression.equals(STAR)) {<NEW_LINE>hasStar = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// if query has a '*' selection along with other columns<NEW_LINE>if (hasStar) {<NEW_LINE>expandStarExpressionsToActualColumns(pinotQuery, columnNameMap);<NEW_LINE>}<NEW_LINE>Expression filterExpression = pinotQuery.getFilterExpression();<NEW_LINE>if (filterExpression != null) {<NEW_LINE>fixColumnName(rawTableName, filterExpression, columnNameMap, aliasMap, isCaseInsensitive);<NEW_LINE>}<NEW_LINE>List<Expression> groupByList = pinotQuery.getGroupByList();<NEW_LINE>if (groupByList != null) {<NEW_LINE>for (Expression expression : groupByList) {<NEW_LINE>fixColumnName(rawTableName, expression, columnNameMap, aliasMap, isCaseInsensitive);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<Expression> orderByList = pinotQuery.getOrderByList();<NEW_LINE>if (orderByList != null) {<NEW_LINE>for (Expression expression : orderByList) {<NEW_LINE>// NOTE: Order-by is always a Function with the ordering of the Expression<NEW_LINE>fixColumnName(rawTableName, expression.getFunctionCall().getOperands().get(0), columnNameMap, aliasMap, isCaseInsensitive);<NEW_LINE>}<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (havingExpression != null) {<NEW_LINE>fixColumnName(rawTableName, havingExpression, columnNameMap, aliasMap, isCaseInsensitive);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | Expression havingExpression = pinotQuery.getHavingExpression(); |
688,112 | public void handleConditionalStatementIsPresentGet(IfTree node) {<NEW_LINE>ExpressionTree condExpr = TreeUtils.withoutParens(node.getCondition());<NEW_LINE>Pair<Boolean, ExpressionTree> isPresentCall = isCallToIsPresent(condExpr);<NEW_LINE>if (isPresentCall == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>StatementTree thenStmt = skipBlocks(node.getThenStatement());<NEW_LINE>StatementTree elseStmt = skipBlocks(node.getElseStatement());<NEW_LINE>if (!isPresentCall.first) {<NEW_LINE>StatementTree tmp = thenStmt;<NEW_LINE>thenStmt = elseStmt;<NEW_LINE>elseStmt = tmp;<NEW_LINE>}<NEW_LINE>if (!(elseStmt == null || (elseStmt.getKind() == Tree.Kind.BLOCK && ((BlockTree) elseStmt).getStatements().isEmpty()))) {<NEW_LINE>// else block is missing or is an empty block: "{}"<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (thenStmt.getKind() != Tree.Kind.EXPRESSION_STATEMENT) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ExpressionTree thenExpr = ((ExpressionStatementTree) thenStmt).getExpression();<NEW_LINE>if (thenExpr.getKind() != Tree.Kind.METHOD_INVOCATION) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>MethodInvocationTree invok = (MethodInvocationTree) thenExpr;<NEW_LINE>List<? extends ExpressionTree> args = invok.getArguments();<NEW_LINE>if (args.size() != 1) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ExpressionTree arg = TreeUtils.withoutParens(args.get(0));<NEW_LINE>if (!isCallToGet(arg)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ExpressionTree receiver = isPresentCall.second;<NEW_LINE>ExpressionTree getReceiver = TreeUtils.getReceiverTree(arg);<NEW_LINE>if (!receiver.toString().equals(getReceiver.toString())) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ExpressionTree method = invok.getMethodSelect();<NEW_LINE>String methodString = method.toString();<NEW_LINE>int dotPos = methodString.lastIndexOf(".");<NEW_LINE>if (dotPos != -1) {<NEW_LINE>methodString = methodString.substring(0, dotPos) + "::" + <MASK><NEW_LINE>}<NEW_LINE>checker.reportWarning(node, "prefer.ifpresent", receiver, methodString);<NEW_LINE>} | methodString.substring(dotPos + 1); |
1,301,058 | final ListProjectsResult executeListProjects(ListProjectsRequest listProjectsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listProjectsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListProjectsRequest> request = null;<NEW_LINE>Response<ListProjectsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListProjectsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listProjectsRequest));<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, "Mobile");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListProjects");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListProjectsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListProjectsResultJsonUnmarshaller());<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); |
825,682 | private void bindToService() {<NEW_LINE>Context context = getContextReference();<NEW_LINE>if (context == null || requestQueue.isEmpty() && isStopped) {<NEW_LINE>// fix issue 40. Thx Shussu<NEW_LINE>// fix issue 246.<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>lockAcquireService.lock();<NEW_LINE>lockSendRequestsToService.lock();<NEW_LINE>try {<NEW_LINE>if (spiceService == null) {<NEW_LINE>final Intent intentService = new Intent(context, spiceServiceClass);<NEW_LINE>Ln.v("Binding to service.");<NEW_LINE>spiceServiceConnection = new SpiceServiceConnection();<NEW_LINE>boolean bound = context.getApplicationContext().bindService(intentService, spiceServiceConnection, Context.BIND_AUTO_CREATE);<NEW_LINE>if (!bound) {<NEW_LINE>Ln.v("Binding to service failed.");<NEW_LINE>} else {<NEW_LINE>Ln.v("Binding to service succeeded.");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception t) {<NEW_LINE>// this should not happen in apps, but can happen during tests.<NEW_LINE>Ln.d(t, "Binding to service failed.");<NEW_LINE>Ln.d("Context is" + context);<NEW_LINE>Ln.d(<MASK><NEW_LINE>} finally {<NEW_LINE>lockSendRequestsToService.unlock();<NEW_LINE>lockAcquireService.unlock();<NEW_LINE>}<NEW_LINE>} | "ApplicationContext is " + context.getApplicationContext()); |
1,632,349 | public static <In extends ImageBase<In>, Out extends ImageBase<Out>, K extends Kernel1D> void vertical(K kernel, In input, Out output) {<NEW_LINE>switch(input.getImageType().getFamily()) {<NEW_LINE>case GRAY -><NEW_LINE>{<NEW_LINE>if (input instanceof GrayF32) {<NEW_LINE>ConvolveImageNoBorder.vertical((Kernel1D_F32) kernel, (GrayF32) input, (GrayF32) output);<NEW_LINE>} else if (input instanceof GrayU8) {<NEW_LINE>if (GrayI16.class.isAssignableFrom(output.getClass()))<NEW_LINE>ConvolveImageNoBorder.vertical((Kernel1D_S32) kernel, (GrayU8) input, (GrayI16) output);<NEW_LINE>else<NEW_LINE>ConvolveImageNoBorder.vertical((Kernel1D_S32) kernel, (GrayU8) input, (GrayS32) output);<NEW_LINE>} else if (input instanceof GrayS16) {<NEW_LINE>ConvolveImageNoBorder.vertical((Kernel1D_S32) kernel, (GrayS16<MASK><NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("Unknown image type: " + input.getClass().getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>case INTERLEAVED -><NEW_LINE>{<NEW_LINE>if (output instanceof InterleavedF32) {<NEW_LINE>ConvolveImageNoBorder.vertical((Kernel1D_F32) kernel, (InterleavedF32) input, (InterleavedF32) output);<NEW_LINE>} else if (input instanceof InterleavedU8) {<NEW_LINE>if (InterleavedI16.class.isAssignableFrom(output.getClass()))<NEW_LINE>ConvolveImageNoBorder.vertical((Kernel1D_S32) kernel, (InterleavedU8) input, (InterleavedI16) output);<NEW_LINE>else<NEW_LINE>ConvolveImageNoBorder.vertical((Kernel1D_S32) kernel, (InterleavedU8) input, (InterleavedS32) output);<NEW_LINE>} else if (input instanceof InterleavedS16) {<NEW_LINE>ConvolveImageNoBorder.vertical((Kernel1D_S32) kernel, (InterleavedS16) input, (InterleavedI16) output);<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("Unknown image type: " + input.getClass().getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>case PLANAR -><NEW_LINE>{<NEW_LINE>Planar inp = (Planar) input;<NEW_LINE>Planar outp = (Planar) output;<NEW_LINE>for (int i = 0; i < inp.getNumBands(); i++) {<NEW_LINE>vertical(kernel, inp.getBand(i), outp.getBand(i));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>default -><NEW_LINE>throw new IllegalArgumentException("Unknown image family");<NEW_LINE>}<NEW_LINE>} | ) input, (GrayI16) output); |
1,594,181 | private JsonResponseComposite toJson(@NonNull final BPartnerComposite bpartnerComposite) {<NEW_LINE>final BPartner bpartner = bpartnerComposite.getBpartner();<NEW_LINE>try (final MDCCloseable ignored = MDC.putCloseable("method", "JsonRetrieverService.toJson(BPartnerComposite)");<NEW_LINE>final MDCCloseable ignored1 = TableRecordMDC.putTableRecordReference(I_C_BPartner.Table_Name, bpartner != null ? bpartner.getId() : null)) {<NEW_LINE>final String orgCode = orgDAO.retrieveOrgValue(bpartnerComposite.getOrgId());<NEW_LINE>final JsonResponseCompositeBuilder result = JsonResponseComposite.<MASK><NEW_LINE>// bpartner<NEW_LINE>result.bpartner(toJson(bpartner));<NEW_LINE>// contacts<NEW_LINE>for (final BPartnerContact contact : bpartnerComposite.getContacts()) {<NEW_LINE>final Language language = bpartner.getLanguage();<NEW_LINE>result.contact(toJson(contact, language));<NEW_LINE>}<NEW_LINE>// locations<NEW_LINE>for (final BPartnerLocation location : bpartnerComposite.getLocations()) {<NEW_LINE>result.location(toJson(location));<NEW_LINE>}<NEW_LINE>return result.build();<NEW_LINE>}<NEW_LINE>} | builder().orgCode(orgCode); |
1,819,826 | private void completionOnMemberAccess(ASTNode astNode, ASTNode enclosingNode, Binding qualifiedBinding, Scope scope, boolean insideTypeAnnotation) {<NEW_LINE>this.insideQualifiedReference = true;<NEW_LINE>CompletionOnMemberAccess access = (CompletionOnMemberAccess) astNode;<NEW_LINE>long completionPosition = access.nameSourcePosition;<NEW_LINE>setSourceAndTokenRange((int) (completionPosition >>> 32), (int) completionPosition);<NEW_LINE>this.completionToken = access.token;<NEW_LINE>if (qualifiedBinding.problemId() == ProblemReasons.NotFound) {<NEW_LINE>// complete method members with missing return type<NEW_LINE>// class X {<NEW_LINE>// Missing f() {return null;}<NEW_LINE>// void foo() {<NEW_LINE>// f().|<NEW_LINE>// }<NEW_LINE>// }<NEW_LINE>if (this.assistNodeInJavadoc == 0 && (this.requestor.isAllowingRequiredProposals(CompletionProposal.FIELD_REF, CompletionProposal.TYPE_REF) || this.requestor.isAllowingRequiredProposals(CompletionProposal.METHOD_REF, CompletionProposal.TYPE_REF))) {<NEW_LINE>ProblemMethodBinding problemMethodBinding = (ProblemMethodBinding) qualifiedBinding;<NEW_LINE>findFieldsAndMethodsFromMissingReturnType(problemMethodBinding.selector, problemMethodBinding.parameters, scope, access, insideTypeAnnotation);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (!access.isInsideAnnotation) {<NEW_LINE>if (!this.requestor.isIgnored(CompletionProposal.KEYWORD) && !access.isSuperAccess()) {<NEW_LINE>findKeywords(this.completionToken, new char[][] { Keywords.NEW }, false, false);<NEW_LINE>}<NEW_LINE>ObjectVector fieldsFound = new ObjectVector();<NEW_LINE>ObjectVector methodsFound = new ObjectVector();<NEW_LINE>boolean superCall = access.receiver instanceof SuperReference;<NEW_LINE>findFieldsAndMethods(this.completionToken, ((TypeBinding) qualifiedBinding).capture(scope, access.receiver.sourceStart, access.receiver.sourceEnd), scope, fieldsFound, methodsFound, access, scope, false, superCall, null, null, null, false, <MASK><NEW_LINE>if (!superCall) {<NEW_LINE>checkCancel();<NEW_LINE>findFieldsAndMethodsFromCastedReceiver(enclosingNode, qualifiedBinding, scope, fieldsFound, methodsFound, access, scope, access.receiver);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | null, -1, -1); |
392,333 | protected void updateLayoutState() {<NEW_LINE>if (list.getLayoutOrientation() != JList.VERTICAL) {<NEW_LINE>super.updateLayoutState();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// pasted from BasicListUI to provide min-height<NEW_LINE>int fixedCellHeight = list.getFixedCellHeight();<NEW_LINE>int fixedCellWidth = list.getFixedCellWidth();<NEW_LINE>cellWidth = fixedCellWidth;<NEW_LINE>if (fixedCellHeight != -1) {<NEW_LINE>cellHeight = fixedCellHeight;<NEW_LINE>cellHeights = null;<NEW_LINE>} else {<NEW_LINE>cellHeight = -1;<NEW_LINE>cellHeights = new int[list.getModel().getSize()];<NEW_LINE>}<NEW_LINE>if ((fixedCellWidth == -1) || (fixedCellHeight == -1)) {<NEW_LINE>ListModel<Object> dataModel = list.getModel();<NEW_LINE>int dataModelSize = dataModel.getSize();<NEW_LINE>ListCellRenderer<Object<MASK><NEW_LINE>if (renderer != null) {<NEW_LINE>for (int index = 0; index < dataModelSize; index++) {<NEW_LINE>Object value = dataModel.getElementAt(index);<NEW_LINE>Component c = renderer.getListCellRendererComponent(list, value, index, false, false);<NEW_LINE>rendererPane.add(c);<NEW_LINE>Dimension cellSize = UIUtil.updateListRowHeight(c.getPreferredSize());<NEW_LINE>if (fixedCellWidth == -1) {<NEW_LINE>cellWidth = Math.max(cellSize.width, cellWidth);<NEW_LINE>}<NEW_LINE>if (fixedCellHeight == -1) {<NEW_LINE>cellHeights[index] = cellSize.height;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (cellWidth == -1) {<NEW_LINE>cellWidth = 0;<NEW_LINE>}<NEW_LINE>if (cellHeights == null) {<NEW_LINE>cellHeights = new int[dataModelSize];<NEW_LINE>}<NEW_LINE>for (int index = 0; index < dataModelSize; index++) {<NEW_LINE>cellHeights[index] = 0;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | > renderer = list.getCellRenderer(); |
1,166,145 | private String constructReply(String[] result) throws Exception {<NEW_LINE>String reply = new String();<NEW_LINE>StringWriter writer = new StringWriter();<NEW_LINE>DecimalFormat typeFormatter = new DecimalFormat("00");<NEW_LINE>DecimalFormat sizeFormatter = new DecimalFormat("000000");<NEW_LINE>writer.write(typeFormatter.format(Huddle.SOT) + sizeFormatter.format(0));<NEW_LINE>writer.write(typeFormatter.format(Huddle.HUDDLE_TYPE) + sizeFormatter.format(6) + "RETURN");<NEW_LINE>for (int i = 0; i < result.length; i++) {<NEW_LINE>writer.write(typeFormatter.format(Huddle.ARG) + sizeFormatter.format(result[i].length()) + result[i]);<NEW_LINE>}<NEW_LINE>writer.write(typeFormatter.format(Huddle.EOA) <MASK><NEW_LINE>reply = writer.toString();<NEW_LINE>return reply;<NEW_LINE>} | + sizeFormatter.format(0)); |
31,713 | // deleteLanguageById.<NEW_LINE>private void dbUpsert(final Language language) throws DotDataException {<NEW_LINE>if (language.getId() == 0) {<NEW_LINE>language.setId(APILocator.getDeterministicIdentifierAPI().generateDeterministicIdBestEffort(language));<NEW_LINE>}<NEW_LINE>Language tester = getLanguage(language.getId());<NEW_LINE>if (tester != null) {<NEW_LINE>new DotConnect().setSQL(UPDATE_LANGUAGE_BY_ID).addParam(language.getLanguageCode().toLowerCase()).addParam(language.getCountryCode()).addParam(language.getLanguage()).addParam(language.getCountry()).addParam(language.getId()).loadResult();<NEW_LINE>} else {<NEW_LINE>DotConnect dc = new DotConnect().setSQL(INSERT_LANGUAGE_BY_ID).addParam(language.getId()).addParam(language.getLanguageCode().toLowerCase()).addParam(language.getCountryCode()).addParam(language.getLanguage()).<MASK><NEW_LINE>dc.loadResult();<NEW_LINE>}<NEW_LINE>CacheLocator.getLanguageCache().removeLanguage(language);<NEW_LINE>} | addParam(language.getCountry()); |
741,820 | public AjaxResult microPayReverse(@RequestParam("outTradeNo") String outTradeNo) {<NEW_LINE>try {<NEW_LINE>Map<String, String> params = OrderQueryModel.builder().service(ServiceEnum.MICRO_PAY_REVERSE.toString()).mch_id(unionPayBean.getMachId()).out_trade_no(outTradeNo).nonce_str(WxPayKit.generateStr()).build().createSign(unionPayBean.<MASK><NEW_LINE>String xmlResult = UnionPayApi.execution(unionPayBean.getServerUrl(), params);<NEW_LINE>logger.info("xmlResult:" + xmlResult);<NEW_LINE>Map<String, String> result = WxPayKit.xmlToMap(xmlResult);<NEW_LINE>return new AjaxResult().success(result);<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>return new AjaxResult().addError(e.getMessage());<NEW_LINE>}<NEW_LINE>} | getKey(), SignType.MD5); |
40,767 | final CreateDatasetResult executeCreateDataset(CreateDatasetRequest createDatasetRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createDatasetRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateDatasetRequest> request = null;<NEW_LINE>Response<CreateDatasetResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateDatasetRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createDatasetRequest));<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, "LookoutEquipment");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateDataset");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateDatasetResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateDatasetResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); |
1,818,407 | protected void partialFinish(ManufOrder manufOrder, int inOrOut) throws AxelorException {<NEW_LINE>if (inOrOut != PART_FINISH_IN && inOrOut != PART_FINISH_OUT) {<NEW_LINE>throw new IllegalArgumentException(I18n.get(IExceptionMessage.IN_OR_OUT_INVALID_ARG));<NEW_LINE>}<NEW_LINE>Company company = manufOrder.getCompany();<NEW_LINE>StockConfigProductionService stockConfigService = Beans.get(StockConfigProductionService.class);<NEW_LINE>StockConfig stockConfig = stockConfigService.getStockConfig(company);<NEW_LINE>StockLocation fromStockLocation;<NEW_LINE>StockLocation toStockLocation;<NEW_LINE>List<StockMove> stockMoveList;<NEW_LINE>if (inOrOut == PART_FINISH_IN) {<NEW_LINE>stockMoveList = manufOrder.getInStockMoveList();<NEW_LINE>fromStockLocation = getDefaultStockLocation(manufOrder, company, STOCK_LOCATION_IN);<NEW_LINE>toStockLocation = stockConfigService.getProductionVirtualStockLocation(stockConfig, manufOrder.getProdProcess().getOutsourcing());<NEW_LINE>} else {<NEW_LINE>stockMoveList = manufOrder.getOutStockMoveList();<NEW_LINE>fromStockLocation = stockConfigService.getProductionVirtualStockLocation(stockConfig, manufOrder.getProdProcess().getOutsourcing());<NEW_LINE>toStockLocation = getDefaultStockLocation(manufOrder, company, STOCK_LOCATION_OUT);<NEW_LINE>}<NEW_LINE>// realize current stock move and update the price<NEW_LINE>Optional<StockMove> stockMoveToRealize = getPlannedStockMove(stockMoveList);<NEW_LINE>if (stockMoveToRealize.isPresent()) {<NEW_LINE>updateRealPrice(manufOrder, stockMoveToRealize.get());<NEW_LINE>finishStockMove(stockMoveToRealize.get());<NEW_LINE>}<NEW_LINE>// generate new stock move<NEW_LINE>StockMove newStockMove = stockMoveService.createStockMove(null, null, company, fromStockLocation, toStockLocation, null, manufOrder.getPlannedStartDateT().toLocalDate(), null, StockMoveRepository.TYPE_INTERNAL);<NEW_LINE>newStockMove.setStockMoveLineList(new ArrayList<>());<NEW_LINE>newStockMove.setOrigin(manufOrder.getManufOrderSeq());<NEW_LINE>newStockMove.setOriginId(manufOrder.getId());<NEW_LINE><MASK><NEW_LINE>createNewStockMoveLines(manufOrder, newStockMove, inOrOut);<NEW_LINE>if (!newStockMove.getStockMoveLineList().isEmpty()) {<NEW_LINE>// plan the stockmove<NEW_LINE>stockMoveService.plan(newStockMove);<NEW_LINE>if (inOrOut == PART_FINISH_IN) {<NEW_LINE>manufOrder.addInStockMoveListItem(newStockMove);<NEW_LINE>newStockMove.getStockMoveLineList().forEach(manufOrder::addConsumedStockMoveLineListItem);<NEW_LINE>manufOrder.clearDiffConsumeProdProductList();<NEW_LINE>} else {<NEW_LINE>manufOrder.addOutStockMoveListItem(newStockMove);<NEW_LINE>newStockMove.getStockMoveLineList().forEach(manufOrder::addProducedStockMoveLineListItem);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | newStockMove.setOriginTypeSelect(StockMoveRepository.ORIGIN_MANUF_ORDER); |
605,697 | public void resolveComponentMetaData(ModuleComponentIdentifier moduleComponentIdentifier, ComponentOverrideMetadata requestMetaData, BuildableModuleComponentMetaDataResolveResult result) {<NEW_LINE>ComponentOverrideMetadata forced = requestMetaData.withChanging();<NEW_LINE>delegate.getRemoteAccess().resolveComponentMetaData(moduleComponentIdentifier, forced, result);<NEW_LINE>switch(result.getState()) {<NEW_LINE>case Missing:<NEW_LINE>moduleMetadataCache.cacheMissing(delegate, moduleComponentIdentifier);<NEW_LINE>break;<NEW_LINE>case Resolved:<NEW_LINE>ModuleComponentResolveMetadata resolvedMetadata = result.getMetaData();<NEW_LINE>ModuleMetadataCache.CachedMetadata cachedMetadata = moduleMetadataCache.cacheMetaData(delegate, moduleComponentIdentifier, resolvedMetadata);<NEW_LINE>// Starting here we're going to process the component metadata rules<NEW_LINE>// Therefore metadata can be mutated, and will _not_ be stored in the module metadata cache<NEW_LINE>// but will be in the _in memory_ cache<NEW_LINE>ModuleComponentResolveMetadata processedMetadata = metadataProcessor.processMetadata(resolvedMetadata);<NEW_LINE>if (processedMetadata.isChanging() || requestMetaData.isChanging()) {<NEW_LINE>processedMetadata = makeChanging(resolvedMetadata, processedMetadata);<NEW_LINE>Expiry expiry = cachePolicy.changingModuleExpiry(moduleComponentIdentifier, cachedMetadata.getModuleVersion(), Duration.ZERO);<NEW_LINE>listener.onChangingModuleResolve(moduleComponentIdentifier, expiry);<NEW_LINE>}<NEW_LINE>cachedMetadata.putProcessedMetadata(<MASK><NEW_LINE>result.resolved(processedMetadata);<NEW_LINE>break;<NEW_LINE>case Failed:<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new IllegalStateException("Unexpected resolve state: " + result.getState());<NEW_LINE>}<NEW_LINE>} | metadataProcessor.getRulesHash(), processedMetadata); |
1,304,919 | public static void rookAttack(List<List<Integer>> A) {<NEW_LINE>int m = A.size(), n = A.get(0).size();<NEW_LINE>boolean hasFirstRowZero = A.get<MASK><NEW_LINE>boolean hasFirstColumnZero = A.stream().anyMatch(row -> row.get(0) == 0);<NEW_LINE>for (int i = 1; i < m; ++i) {<NEW_LINE>for (int j = 1; j < n; ++j) {<NEW_LINE>if (A.get(i).get(j) == 0) {<NEW_LINE>A.get(i).set(0, 0);<NEW_LINE>A.get(0).set(j, 0);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int i = 1; i < m; ++i) {<NEW_LINE>if (A.get(i).get(0) == 0) {<NEW_LINE>Collections.fill(A.get(i), 0);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int j = 1; j < n; ++j) {<NEW_LINE>if (A.get(0).get(j) == 0) {<NEW_LINE>final int idx = j;<NEW_LINE>A.stream().forEach(row -> row.set(idx, 0));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (hasFirstRowZero) {<NEW_LINE>Collections.fill(A.get(0), 0);<NEW_LINE>}<NEW_LINE>if (hasFirstColumnZero) {<NEW_LINE>A.stream().forEach(row -> row.set(0, 0));<NEW_LINE>}<NEW_LINE>} | (0).contains(0); |
464,160 | public static ImportNacosConfigResponse unmarshall(ImportNacosConfigResponse importNacosConfigResponse, UnmarshallerContext _ctx) {<NEW_LINE>importNacosConfigResponse.setRequestId(_ctx.stringValue("ImportNacosConfigResponse.RequestId"));<NEW_LINE>importNacosConfigResponse.setHttpStatusCode(_ctx.integerValue("ImportNacosConfigResponse.HttpStatusCode"));<NEW_LINE>importNacosConfigResponse.setSuccess(_ctx.booleanValue("ImportNacosConfigResponse.Success"));<NEW_LINE>importNacosConfigResponse.setErrorCode(_ctx.stringValue("ImportNacosConfigResponse.ErrorCode"));<NEW_LINE>importNacosConfigResponse.setCode(_ctx.integerValue("ImportNacosConfigResponse.Code"));<NEW_LINE>importNacosConfigResponse.setMessage<MASK><NEW_LINE>importNacosConfigResponse.setDynamicMessage(_ctx.stringValue("ImportNacosConfigResponse.DynamicMessage"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setSuccCount(_ctx.integerValue("ImportNacosConfigResponse.Data.SuccCount"));<NEW_LINE>data.setSkipCount(_ctx.integerValue("ImportNacosConfigResponse.Data.SkipCount"));<NEW_LINE>List<SkipDataItem> skipData = new ArrayList<SkipDataItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ImportNacosConfigResponse.Data.SkipData.Length"); i++) {<NEW_LINE>SkipDataItem skipDataItem = new SkipDataItem();<NEW_LINE>skipDataItem.setDataId(_ctx.stringValue("ImportNacosConfigResponse.Data.SkipData[" + i + "].DataId"));<NEW_LINE>skipDataItem.setGroup(_ctx.stringValue("ImportNacosConfigResponse.Data.SkipData[" + i + "].Group"));<NEW_LINE>skipData.add(skipDataItem);<NEW_LINE>}<NEW_LINE>data.setSkipData(skipData);<NEW_LINE>List<FailDataItem> failData = new ArrayList<FailDataItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ImportNacosConfigResponse.Data.FailData.Length"); i++) {<NEW_LINE>FailDataItem failDataItem = new FailDataItem();<NEW_LINE>failDataItem.setDataId(_ctx.stringValue("ImportNacosConfigResponse.Data.FailData[" + i + "].DataId"));<NEW_LINE>failDataItem.setGroup(_ctx.stringValue("ImportNacosConfigResponse.Data.FailData[" + i + "].Group"));<NEW_LINE>failData.add(failDataItem);<NEW_LINE>}<NEW_LINE>data.setFailData(failData);<NEW_LINE>importNacosConfigResponse.setData(data);<NEW_LINE>return importNacosConfigResponse;<NEW_LINE>} | (_ctx.stringValue("ImportNacosConfigResponse.Message")); |
717,239 | private void checkMailForAccount(Account account, boolean ignoreLastCheckedTime, boolean notify, MessagingListener listener) {<NEW_LINE>Timber.i("Synchronizing account %s", account);<NEW_LINE>NotificationState notificationState = new NotificationState();<NEW_LINE>sendPendingMessages(account, listener);<NEW_LINE>refreshFolderListIfStale(account);<NEW_LINE>try {<NEW_LINE>Account.FolderMode aDisplayMode = account.getFolderDisplayMode();<NEW_LINE>Account.FolderMode aSyncMode = account.getFolderSyncMode();<NEW_LINE>LocalStore localStore = localStoreProvider.getInstance(account);<NEW_LINE>for (final LocalFolder folder : localStore.getPersonalNamespaces(false)) {<NEW_LINE>folder.open();<NEW_LINE>FolderClass fDisplayClass = folder.getDisplayClass();<NEW_LINE>FolderClass fSyncClass = folder.getSyncClass();<NEW_LINE>if (LocalFolder.isModeMismatch(aDisplayMode, fDisplayClass)) {<NEW_LINE>// Never sync a folder that isn't displayed<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (LocalFolder.isModeMismatch(aSyncMode, fSyncClass)) {<NEW_LINE>// Do not sync folders in the wrong class<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>synchronizeFolder(account, folder, ignoreLastCheckedTime, notify, listener, notificationState);<NEW_LINE>}<NEW_LINE>} catch (MessagingException e) {<NEW_LINE>Timber.e(e, "Unable to synchronize account %s", account);<NEW_LINE>} finally {<NEW_LINE>putBackground("clear notification flag for " + account, null, new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>Timber.v("Clearing notification flag for %s", account);<NEW_LINE>clearFetchingMailNotification(account);<NEW_LINE>if (getUnreadMessageCount(account) == 0) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} | notificationController.clearNewMailNotifications(account, false); |
5,355 | public String extractBamlXml(String xml) throws AxelorException {<NEW_LINE>if (xml == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>DocumentBuilderFactory docBuilderFactory = new XPathParse().getDocumentBuilderFactory();<NEW_LINE>try {<NEW_LINE>docBuilderFactory.setNamespaceAware(false);<NEW_LINE>DocumentBuilder builder = docBuilderFactory.newDocumentBuilder();<NEW_LINE>InputStream inputStream = new ByteArrayInputStream(xml.getBytes());<NEW_LINE>Document doc = builder.parse(inputStream);<NEW_LINE>inputStream.close();<NEW_LINE>NodeList nodeList = doc.getElementsByTagName("process-action");<NEW_LINE>xml = BamlParser.createEmptyBamlXml();<NEW_LINE>inputStream = new ByteArrayInputStream(xml.getBytes());<NEW_LINE>doc = builder.parse(inputStream);<NEW_LINE>inputStream.close();<NEW_LINE>for (int i = 0; i < nodeList.getLength(); i++) {<NEW_LINE>Node node = doc.importNode(nodeList<MASK><NEW_LINE>doc.getFirstChild().appendChild(node);<NEW_LINE>}<NEW_LINE>TransformerFactory tFactory = TransformerFactory.newInstance();<NEW_LINE>Transformer transformer = tFactory.newTransformer();<NEW_LINE>DOMSource source = new DOMSource(doc);<NEW_LINE>ByteArrayOutputStream bout = new ByteArrayOutputStream();<NEW_LINE>StreamResult result = new StreamResult(bout);<NEW_LINE>transformer.transform(source, result);<NEW_LINE>xml = bout.toString();<NEW_LINE>bout.close();<NEW_LINE>return xml;<NEW_LINE>} catch (ParserConfigurationException | SAXException | IOException | TransformerException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>return xml;<NEW_LINE>} | .item(i), true); |
134,078 | public void addEvidence(final Map<String, List<EVIDENCE>> evidenceBySample, final double initialLikelihood) {<NEW_LINE>for (final Map.Entry<String, List<EVIDENCE>> entry : evidenceBySample.entrySet()) {<NEW_LINE>final String sample = entry.getKey();<NEW_LINE>final List<EVIDENCE<MASK><NEW_LINE>final int sampleIndex = samples.indexOfSample(sample);<NEW_LINE>if (sampleIndex == MISSING_INDEX) {<NEW_LINE>throw new IllegalArgumentException("input sample " + sample + " is not part of the evidence-likelihoods collection");<NEW_LINE>}<NEW_LINE>if (newSampleEvidence == null || newSampleEvidence.isEmpty()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>final int oldEvidenceCount = evidenceBySampleIndex.get(sampleIndex).size();<NEW_LINE>appendEvidence(newSampleEvidence, sampleIndex);<NEW_LINE>final int newEvidenceCount = evidenceBySampleIndex.get(sampleIndex).size();<NEW_LINE>extendsLikelihoodArrays(initialLikelihood, sampleIndex, oldEvidenceCount, newEvidenceCount);<NEW_LINE>}<NEW_LINE>} | > newSampleEvidence = entry.getValue(); |
1,445,963 | public static OnsTrendTopicInputTpsResponse unmarshall(OnsTrendTopicInputTpsResponse onsTrendTopicInputTpsResponse, UnmarshallerContext _ctx) {<NEW_LINE>onsTrendTopicInputTpsResponse.setRequestId(_ctx.stringValue("OnsTrendTopicInputTpsResponse.RequestId"));<NEW_LINE>onsTrendTopicInputTpsResponse.setHelpUrl<MASK><NEW_LINE>Data data = new Data();<NEW_LINE>data.setXUnit(_ctx.stringValue("OnsTrendTopicInputTpsResponse.Data.XUnit"));<NEW_LINE>data.setYUnit(_ctx.stringValue("OnsTrendTopicInputTpsResponse.Data.YUnit"));<NEW_LINE>data.setTitle(_ctx.stringValue("OnsTrendTopicInputTpsResponse.Data.Title"));<NEW_LINE>List<StatsDataDo> records = new ArrayList<StatsDataDo>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("OnsTrendTopicInputTpsResponse.Data.Records.Length"); i++) {<NEW_LINE>StatsDataDo statsDataDo = new StatsDataDo();<NEW_LINE>statsDataDo.setY(_ctx.floatValue("OnsTrendTopicInputTpsResponse.Data.Records[" + i + "].Y"));<NEW_LINE>statsDataDo.setX(_ctx.longValue("OnsTrendTopicInputTpsResponse.Data.Records[" + i + "].X"));<NEW_LINE>records.add(statsDataDo);<NEW_LINE>}<NEW_LINE>data.setRecords(records);<NEW_LINE>onsTrendTopicInputTpsResponse.setData(data);<NEW_LINE>return onsTrendTopicInputTpsResponse;<NEW_LINE>} | (_ctx.stringValue("OnsTrendTopicInputTpsResponse.HelpUrl")); |
1,574,885 | public ListPage<String> listTopicName(Integer pageIndex, Integer pageSize) throws BrokerException {<NEW_LINE>try {<NEW_LINE>ListPage<String> listPage = new ListPage<>();<NEW_LINE>Tuple3<BigInteger, BigInteger, List<String>> result = this.topicController.listTopicName(BigInteger.valueOf(pageIndex), BigInteger.valueOf(pageSize));<NEW_LINE>if (result == null) {<NEW_LINE>log.error("TopicController.listTopicName result is empty");<NEW_LINE>throw new BrokerException(ErrorCode.TRANSACTION_EXECUTE_ERROR);<NEW_LINE>}<NEW_LINE>listPage.setPageIndex(pageIndex);<NEW_LINE>listPage.setTotal(result.getValue1().intValue());<NEW_LINE>listPage.setPageSize(result.getValue2().intValue());<NEW_LINE>listPage.setPageData(result.getValue3());<NEW_LINE>return listPage;<NEW_LINE>} catch (ContractException e) {<NEW_LINE>log.error("listTopicName failed due to web3sdk rpc error.", e);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | throw new BrokerException(ErrorCode.WEB3SDK_RPC_ERROR); |
264,046 | public List<String> expendGroupRoleToPerson(List<String> groupList, List<String> roleList) throws Exception {<NEW_LINE>List<String> groupIds = new ArrayList<>();<NEW_LINE>List<String> expendGroupIds = new ArrayList<>();<NEW_LINE>List<String> <MASK><NEW_LINE>for (String s : ListTools.trim(groupList, true, true)) {<NEW_LINE>Group g = this.group().pick(s);<NEW_LINE>if (null != g) {<NEW_LINE>groupIds.add(g.getId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (String s : ListTools.trim(roleList, true, true)) {<NEW_LINE>Role r = this.role().pick(s);<NEW_LINE>if (null != r) {<NEW_LINE>groupIds.addAll(r.getGroupList());<NEW_LINE>personIds.addAll(r.getPersonList());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (String s : ListTools.trim(groupIds, true, true)) {<NEW_LINE>expendGroupIds.add(s);<NEW_LINE>expendGroupIds.addAll(this.group().listSubNested(s));<NEW_LINE>}<NEW_LINE>expendGroupIds = ListTools.trim(expendGroupIds, true, true);<NEW_LINE>EntityManager em = this.entityManagerContainer().get(Group.class);<NEW_LINE>CriteriaBuilder cb = em.getCriteriaBuilder();<NEW_LINE>CriteriaQuery<Group> cq = cb.createQuery(Group.class);<NEW_LINE>Root<Group> root = cq.from(Group.class);<NEW_LINE>Predicate p = root.get(Group_.id).in(expendGroupIds);<NEW_LINE>List<Group> os = em.createQuery(cq.select(root).where(p)).getResultList();<NEW_LINE>for (Group o : os) {<NEW_LINE>personIds.addAll(o.getPersonList());<NEW_LINE>}<NEW_LINE>personIds = ListTools.trim(personIds, true, true);<NEW_LINE>return personIds;<NEW_LINE>} | personIds = new ArrayList<>(); |
1,112,104 | private void enableV3OnionService(int localPort, int onionPort, String name) {<NEW_LINE>ContentValues fields = new ContentValues();<NEW_LINE>fields.put(OnionServiceContentProvider.OnionService.PORT, localPort);<NEW_LINE>fields.put(OrbotService.OnionService.NAME, name);<NEW_LINE>fields.put(OnionServiceContentProvider.OnionService.ONION_PORT, onionPort);<NEW_LINE>fields.put(<MASK><NEW_LINE>fields.put(OnionServiceContentProvider.OnionService.CREATED_BY_USER, 0);<NEW_LINE>ContentResolver contentResolver = getContentResolver();<NEW_LINE>lastInsertedOnionServiceRowId = ContentUris.parseId(contentResolver.insert(OnionServiceContentProvider.CONTENT_URI, fields));<NEW_LINE>if (torStatus.equals(OrbotConstants.STATUS_OFF)) {<NEW_LINE>startTor();<NEW_LINE>} else {<NEW_LINE>stopTor();<NEW_LINE>Toast.makeText(this, R.string.start_tor_again_for_finish_the_process, Toast.LENGTH_LONG).show();<NEW_LINE>}<NEW_LINE>} | OnionServiceContentProvider.OnionService.ENABLED, 1); |
176,314 | protected void doCloudOp(IProgressMonitor monitor) throws Exception, OperationCanceledException {<NEW_LINE>monitor.beginTask("Refresh services", 2);<NEW_LINE>boolean success = false;<NEW_LINE>try {<NEW_LINE>ClientRequests client = getClientRequests();<NEW_LINE>monitor.worked(1);<NEW_LINE>if (client != null) {<NEW_LINE>// debug("Resfres Services for connected client");<NEW_LINE>List<CFServiceInstance> serviceInfos = client.getServices();<NEW_LINE>Builder<CloudServiceInstanceDashElement> services = ImmutableSet.builder();<NEW_LINE>for (CFServiceInstance service : serviceInfos) {<NEW_LINE>services.add(elementFactory.createService(service));<NEW_LINE>}<NEW_LINE>model.<MASK><NEW_LINE>success = true;<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>// If Network is down, typically the same error will happen in parallel for refresing the aps.<NEW_LINE>// We don't want a double popup so just log this here instead of letting it fly.<NEW_LINE>// Note: handling this would be possible if the operations where able to parallel composed so there can<NEW_LINE>// be a single handler attached that is called when both of them are complete.<NEW_LINE>Log.log(e);<NEW_LINE>} finally {<NEW_LINE>if (!success) {<NEW_LINE>// debug("Resfresh Services for DISconnected client");<NEW_LINE>model.setServices(ImmutableSet.<CloudServiceInstanceDashElement>of());<NEW_LINE>}<NEW_LINE>monitor.done();<NEW_LINE>}<NEW_LINE>} | setServices(services.build()); |
804,756 | public static void convolve(Kernel2D_F32 kernel, GrayF32 src, GrayF32 dest) {<NEW_LINE>final float[] dataKernel = kernel.data;<NEW_LINE>final float[] dataSrc = src.data;<NEW_LINE>final float[] dataDst = dest.data;<NEW_LINE>final int width = src.getWidth();<NEW_LINE>final int height = src.getHeight();<NEW_LINE>int offsetL = kernel.offset;<NEW_LINE>int offsetR = kernel<MASK><NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(offsetL, height - offsetR, y -> {<NEW_LINE>for (int y = offsetL; y < height - offsetR; y++) {<NEW_LINE>int indexDst = dest.startIndex + y * dest.stride + offsetL;<NEW_LINE>for (int x = offsetL; x < width - offsetR; x++) {<NEW_LINE>float total = 0;<NEW_LINE>int indexKer = 0;<NEW_LINE>for (int ki = 0; ki < kernel.width; ki++) {<NEW_LINE>int indexSrc = src.startIndex + (y + ki - offsetL) * src.stride + x - offsetL;<NEW_LINE>for (int kj = 0; kj < kernel.width; kj++) {<NEW_LINE>total += (dataSrc[indexSrc + kj]) * dataKernel[indexKer++];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>dataDst[indexDst++] = total;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>} | .width - kernel.offset - 1; |
1,756,085 | private void fillSegmentInfo(SegmentReader segmentReader, boolean verbose, boolean search, Map<String, Segment> segments) {<NEW_LINE>SegmentCommitInfo info = segmentReader.getSegmentInfo();<NEW_LINE>assert segments.containsKey(info.info.name) == false;<NEW_LINE>Segment segment = new Segment(info.info.name);<NEW_LINE>segment.search = search;<NEW_LINE>segment.docCount = segmentReader.numDocs();<NEW_LINE>segment.delDocCount = segmentReader.numDeletedDocs();<NEW_LINE>segment.version = info.info.getVersion();<NEW_LINE>segment.compound = info.info.getUseCompoundFile();<NEW_LINE>try {<NEW_LINE>segment.sizeInBytes = info.sizeInBytes();<NEW_LINE>} catch (IOException e) {<NEW_LINE>logger.trace(() -> new ParameterizedMessage("failed to get size for [{}]", info<MASK><NEW_LINE>}<NEW_LINE>segment.segmentSort = info.info.getIndexSort();<NEW_LINE>segment.attributes = info.info.getAttributes();<NEW_LINE>// TODO: add more fine grained mem stats values to per segment info here<NEW_LINE>segments.put(info.info.name, segment);<NEW_LINE>} | .info.name), e); |
1,469,879 | public PCollection<T> expand(PBegin input) {<NEW_LINE>checkArgument(getScanResponseMapperFn() != null, "withScanResponseMapperFn() is required");<NEW_LINE>checkArgument(getScanRequestFn() != null, "withScanRequestFn() is required");<NEW_LINE>ScanRequest scanRequest = getScanRequestFn().apply(null);<NEW_LINE>checkArgument((scanRequest.totalSegments() != null && scanRequest.totalSegments<MASK><NEW_LINE>if (getDynamoDbClientProvider() == null) {<NEW_LINE>checkNotNull(getClientConfiguration(), "clientConfiguration cannot be null");<NEW_LINE>AwsOptions awsOptions = input.getPipeline().getOptions().as(AwsOptions.class);<NEW_LINE>ClientBuilderFactory.validate(awsOptions, getClientConfiguration());<NEW_LINE>}<NEW_LINE>PCollection<Read<T>> splits = input.apply("Create", Create.of(this)).apply("Split", ParDo.of(new SplitFn<>()));<NEW_LINE>splits.setCoder(SerializableCoder.of(new TypeDescriptor<Read<T>>() {<NEW_LINE>}));<NEW_LINE>PCollection<T> output = splits.apply("Reshuffle", Reshuffle.viaRandomKey()).apply("Read", ParDo.of(new ReadFn<>()));<NEW_LINE>output.setCoder(getCoder());<NEW_LINE>return output;<NEW_LINE>} | () > 0), "TotalSegments is required with withScanRequestFn() and greater zero"); |
258,344 | public DescribeWebsiteCertificateAuthorityResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DescribeWebsiteCertificateAuthorityResult describeWebsiteCertificateAuthorityResult = new DescribeWebsiteCertificateAuthorityResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return describeWebsiteCertificateAuthorityResult;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("Certificate", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>describeWebsiteCertificateAuthorityResult.setCertificate(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("CreatedTime", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>describeWebsiteCertificateAuthorityResult.setCreatedTime(DateJsonUnmarshallerFactory.getInstance(<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("DisplayName", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>describeWebsiteCertificateAuthorityResult.setDisplayName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return describeWebsiteCertificateAuthorityResult;<NEW_LINE>} | "unixTimestamp").unmarshall(context)); |
1,733,159 | private UpdateItemRequest buildUpdateStatement(OnboardingEvent onboardingEvent) {<NEW_LINE>HashMap<String, AttributeValue> compositeKey = new HashMap<>();<NEW_LINE>AttributeValue primaryKeyValue = AttributeValue.builder().s(String.format("%s%s%s", TENANT_PREFIX, ATTRIBUTE_DELIMITER, onboardingEvent.getTenantId())).build();<NEW_LINE>compositeKey.put(PRIMARY_KEY_NAME, primaryKeyValue);<NEW_LINE>AttributeValue sortKeyValue = AttributeValue.builder().<MASK><NEW_LINE>compositeKey.put(SORT_KEY_NAME, sortKeyValue);<NEW_LINE>HashMap<String, String> expressionAttributeNames = new HashMap<>();<NEW_LINE>expressionAttributeNames.put(INTERNAL_PRODUCT_CODE_EXPRESSION_NAME, onboardingEvent.getInternalProductCode());<NEW_LINE>expressionAttributeNames.put(SUBSCRIPTION_MAPPING_EXPRESSION_NAME, SUBSCRIPTION_MAPPING_ATTRIBUTE_NAME);<NEW_LINE>HashMap<String, AttributeValue> expressionAttributeValues = new HashMap<>();<NEW_LINE>AttributeValue externalProductCodeValue = AttributeValue.builder().s(onboardingEvent.getExternalProductCode()).build();<NEW_LINE>expressionAttributeValues.put(EXTERNAL_PRODUCT_CODE_EXPRESSION_VALUE, externalProductCodeValue);<NEW_LINE>String updateStatement = String.format("SET %s.%s = %s", SUBSCRIPTION_MAPPING_EXPRESSION_NAME, INTERNAL_PRODUCT_CODE_EXPRESSION_NAME, EXTERNAL_PRODUCT_CODE_EXPRESSION_VALUE);<NEW_LINE>return UpdateItemRequest.builder().tableName(TABLE_NAME).key(compositeKey).updateExpression(updateStatement).expressionAttributeNames(expressionAttributeNames).expressionAttributeValues(expressionAttributeValues).build();<NEW_LINE>} | s(CONFIG_SORT_KEY_VALUE).build(); |
761,932 | public void updateContext() {<NEW_LINE>String columnName = m_vo.ColumnNameAlias.isEmpty() ? m_vo.ColumnName : m_vo.ColumnNameAlias;<NEW_LINE>// Set Context<NEW_LINE>if (m_vo.displayType == DisplayType.Text || m_vo.displayType == DisplayType.Memo || m_vo.displayType == DisplayType.TextLong || m_vo.displayType == DisplayType.Binary || m_vo.displayType == DisplayType.RowID || isEncrypted())<NEW_LINE>// ignore<NEW_LINE>;<NEW_LINE>else if (m_value instanceof Boolean) {<NEW_LINE>// teo_sarca [ 1699826 ]<NEW_LINE>backupValue();<NEW_LINE>if (!isParentTabField()) {<NEW_LINE>Env.setContext(m_vo.ctx, m_vo.WindowNo, columnName, ((Boolean) m_value).booleanValue());<NEW_LINE>}<NEW_LINE>Env.setContext(m_vo.ctx, m_vo.WindowNo, m_vo.TabNo, columnName, m_value == null ? null : (((Boolean) m_value) ? "Y" : "N"));<NEW_LINE>} else if (m_value instanceof Timestamp) {<NEW_LINE>// teo_sarca [ 1699826 ]<NEW_LINE>backupValue();<NEW_LINE>if (!isParentTabField()) {<NEW_LINE>Env.setContext(m_vo.ctx, m_vo.WindowNo, columnName, (Timestamp) m_value);<NEW_LINE>}<NEW_LINE>// BUG:3075946 KTU - Fix Thai Date<NEW_LINE>// Env.setContext(m_vo.ctx, m_vo.WindowNo, m_vo.TabNo, m_vo.ColumnName,<NEW_LINE>// m_value==null ? null : m_value.toString().substring(0, m_value.toString().indexOf(".")));<NEW_LINE>String stringValue = null;<NEW_LINE>if (m_value != null && !m_value.toString().equals("")) {<NEW_LINE>Calendar c1 = Calendar.getInstance();<NEW_LINE>c1<MASK><NEW_LINE>SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");<NEW_LINE>stringValue = sdf.format(c1.getTime());<NEW_LINE>}<NEW_LINE>Env.setContext(m_vo.ctx, m_vo.WindowNo, m_vo.TabNo, columnName, stringValue);<NEW_LINE>// KTU - Fix Thai Date<NEW_LINE>} else {<NEW_LINE>// teo_sarca [ 1699826 ]<NEW_LINE>backupValue();<NEW_LINE>if (!isParentTabField()) {<NEW_LINE>Env.setContext(m_vo.ctx, m_vo.WindowNo, columnName, m_value == null ? null : m_value.toString());<NEW_LINE>}<NEW_LINE>Env.setContext(m_vo.ctx, m_vo.WindowNo, m_vo.TabNo, columnName, m_value == null ? null : m_value.toString());<NEW_LINE>}<NEW_LINE>} | .setTime((Date) m_value); |
768,307 | private static boolean matchStart(boolean advanced, PsiBuilder builder, int level, IElementType begin) {<NEW_LINE>if (begin == DO) {<NEW_LINE>return matchEnd(advanced, builder, level, TokenSet.EMPTY, END_SET);<NEW_LINE>} else if (begin == REPEAT) {<NEW_LINE>return matchEnd(advanced, builder, level, TokenSet.EMPTY, REPEAT_TYPES);<NEW_LINE>} else if (begin == IF) {<NEW_LINE>return matchEnd(advanced, builder, level, IF_SKIPS, END_SET);<NEW_LINE>} else if (begin == THEN) {<NEW_LINE>if (level == 0)<NEW_LINE>return matchEnd(advanced, builder, level, TokenSet.EMPTY, THEN_TYPES1);<NEW_LINE>else<NEW_LINE>return matchEnd(advanced, <MASK><NEW_LINE>} else if (begin == ELSE) {<NEW_LINE>return matchEnd(advanced, builder, level, TokenSet.EMPTY, END_SET);<NEW_LINE>} else if (begin == FUNCTION) {<NEW_LINE>return matchEnd(advanced, builder, level, TokenSet.EMPTY, END_SET);<NEW_LINE>}<NEW_LINE>// else if (BRACE_L_SET.contains(begin)) {<NEW_LINE>// return matchBrace(advanced, builder, level, getRBrace(begin));<NEW_LINE>// }<NEW_LINE>return false;<NEW_LINE>} | builder, level, THEN_SKIPS2, END_SET); |
1,834,956 | public void expandAll(@Nullable final Runnable onDone) {<NEW_LINE>final JTree tree = getTree();<NEW_LINE>if (tree.getRowCount() > 0) {<NEW_LINE>final int expandRecursionDepth = Math.max(2<MASK><NEW_LINE>new TreeRunnable("AbstractTreeUi.expandAll") {<NEW_LINE><NEW_LINE>private int myCurrentRow;<NEW_LINE><NEW_LINE>private int myInvocationCount;<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void perform() {<NEW_LINE>if (++myInvocationCount > expandRecursionDepth) {<NEW_LINE>myInvocationCount = 0;<NEW_LINE>if (isPassthroughMode()) {<NEW_LINE>run();<NEW_LINE>} else {<NEW_LINE>// need this to prevent stack overflow if the tree is rather big and is "synchronous"<NEW_LINE>// noinspection SSBasedInspection<NEW_LINE>SwingUtilities.invokeLater(this);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>final int row = myCurrentRow++;<NEW_LINE>if (row < tree.getRowCount()) {<NEW_LINE>final TreePath path = tree.getPathForRow(row);<NEW_LINE>final Object last = path.getLastPathComponent();<NEW_LINE>final Object elem = getElementFor(last);<NEW_LINE>expand(elem, this);<NEW_LINE>} else {<NEW_LINE>runDone(onDone);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}.run();<NEW_LINE>} else {<NEW_LINE>runDone(onDone);<NEW_LINE>}<NEW_LINE>} | , Registry.intValue("ide.tree.expandRecursionDepth")); |
443,283 | public final void layout(N rootNode) {<NEW_LINE>if (rootNode == null)<NEW_LINE>return;<NEW_LINE>Collection<N> allNodes = scene.getNodes();<NEW_LINE>ArrayList<N> nodesToResolve = new ArrayList<N>(allNodes);<NEW_LINE>HashSet<N> loadedSet = new HashSet<N>();<NEW_LINE>Node root = new Node(rootNode, loadedSet);<NEW_LINE>nodesToResolve.removeAll(loadedSet);<NEW_LINE>if (vertical) {<NEW_LINE>root.allocateHorizontally();<NEW_LINE>root.resolveVertically(originX, originY);<NEW_LINE>} else {<NEW_LINE>root.allocateVertically();<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>final HashMap<N, Point> resultPosition = new HashMap<N, Point>();<NEW_LINE>root.upload(resultPosition);<NEW_LINE>for (N node : nodesToResolve) {<NEW_LINE>Point position = new Point();<NEW_LINE>// TODO - resolve others<NEW_LINE>resultPosition.put(node, position);<NEW_LINE>}<NEW_LINE>for (Map.Entry<N, Point> entry : resultPosition.entrySet()) scene.findWidget(entry.getKey()).setPreferredLocation(entry.getValue());<NEW_LINE>} | root.resolveHorizontally(originX, originY); |
1,709,005 | public static String convertToStr(RestRequest restRequest) {<NEW_LINE>if (Objects.isNull(restRequest)) {<NEW_LINE>return "RestRequest: null";<NEW_LINE>}<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append("RestRequest: [");<NEW_LINE>sb.append("Method: " + ((restRequest.getRestMethod() == null) ? "null" : restRequest.getRestMethod().name()));<NEW_LINE>sb.append(", Path: " + ((restRequest.getPath() == null) ? "null" : restRequest.getPath()));<NEW_LINE>sb.append(", Uri: " + ((restRequest.getUri() == null) ? "null" : restRequest.getUri()));<NEW_LINE>Account account = null;<NEW_LINE>try {<NEW_LINE>account = RestUtils.getAccountFromArgs(restRequest.getArgs());<NEW_LINE>} catch (RestServiceException restServiceException) {<NEW_LINE>}<NEW_LINE>sb.append(", Account: " + ((account == null) ? "null" <MASK><NEW_LINE>Container container = null;<NEW_LINE>try {<NEW_LINE>container = RestUtils.getContainerFromArgs(restRequest.getArgs());<NEW_LINE>} catch (RestServiceException restServiceException) {<NEW_LINE>}<NEW_LINE>sb.append(", Container: " + ((container == null) ? "null" : container.toString()));<NEW_LINE>sb.append("]");<NEW_LINE>return sb.toString();<NEW_LINE>} | : account.toString())); |
263,457 | public long handle(Emulator<?> emulator) {<NEW_LINE>RegisterContext context = emulator.getContext();<NEW_LINE>UnidbgPointer clazz = context.getPointerArg(1);<NEW_LINE>UnidbgPointer jmethodID = context.getPointerArg(2);<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("CallStaticDoubleMethod clazz=" + clazz + ", jmethodID=" + jmethodID);<NEW_LINE>}<NEW_LINE>DvmClass dvmClass = classMap.get(clazz.toIntPeer());<NEW_LINE>DvmMethod dvmMethod = dvmClass == null ? null : dvmClass.getStaticMethod(jmethodID.toIntPeer());<NEW_LINE>if (dvmMethod == null) {<NEW_LINE>throw new BackendException();<NEW_LINE>} else {<NEW_LINE>VarArg varArg = ArmVarArg.create(emulator, DalvikVM64.this, dvmMethod);<NEW_LINE>double ret = dvmMethod.callStaticDoubleMethod(varArg);<NEW_LINE>if (verbose) {<NEW_LINE>System.out.printf("JNIEnv->CallStaticDoubleMethod(%s, %s(%s) => %s) was called from %s%n", dvmClass, dvmMethod.methodName, varArg.formatArgs(), <MASK><NEW_LINE>}<NEW_LINE>ByteBuffer buffer = ByteBuffer.allocate(16);<NEW_LINE>buffer.order(ByteOrder.LITTLE_ENDIAN);<NEW_LINE>buffer.putDouble(ret);<NEW_LINE>emulator.getBackend().reg_write_vector(Arm64Const.UC_ARM64_REG_Q0, buffer.array());<NEW_LINE>return context.getLongArg(0);<NEW_LINE>}<NEW_LINE>} | ret, context.getLRPointer()); |
1,314,871 | public static BatchJoinMeetingInternationalResponse unmarshall(BatchJoinMeetingInternationalResponse batchJoinMeetingInternationalResponse, UnmarshallerContext _ctx) {<NEW_LINE>batchJoinMeetingInternationalResponse.setRequestId(_ctx.stringValue("BatchJoinMeetingInternationalResponse.RequestId"));<NEW_LINE>batchJoinMeetingInternationalResponse.setMessage(_ctx.stringValue("BatchJoinMeetingInternationalResponse.Message"));<NEW_LINE>batchJoinMeetingInternationalResponse.setErrorCode(_ctx.integerValue("BatchJoinMeetingInternationalResponse.ErrorCode"));<NEW_LINE>batchJoinMeetingInternationalResponse.setSuccess<MASK><NEW_LINE>MeetingInfo meetingInfo = new MeetingInfo();<NEW_LINE>meetingInfo.setMeetingAppId(_ctx.stringValue("BatchJoinMeetingInternationalResponse.MeetingInfo.MeetingAppId"));<NEW_LINE>meetingInfo.setMeetingUUID(_ctx.stringValue("BatchJoinMeetingInternationalResponse.MeetingInfo.MeetingUUID"));<NEW_LINE>meetingInfo.setMeetingToken(_ctx.stringValue("BatchJoinMeetingInternationalResponse.MeetingInfo.MeetingToken"));<NEW_LINE>meetingInfo.setMeetingDomain(_ctx.stringValue("BatchJoinMeetingInternationalResponse.MeetingInfo.MeetingDomain"));<NEW_LINE>meetingInfo.setClientAppId(_ctx.stringValue("BatchJoinMeetingInternationalResponse.MeetingInfo.ClientAppId"));<NEW_LINE>meetingInfo.setMeetingCode(_ctx.stringValue("BatchJoinMeetingInternationalResponse.MeetingInfo.MeetingCode"));<NEW_LINE>SlsInfo slsInfo = new SlsInfo();<NEW_LINE>slsInfo.setLogServiceEndpoint(_ctx.stringValue("BatchJoinMeetingInternationalResponse.MeetingInfo.SlsInfo.LogServiceEndpoint"));<NEW_LINE>slsInfo.setLogstore(_ctx.stringValue("BatchJoinMeetingInternationalResponse.MeetingInfo.SlsInfo.Logstore"));<NEW_LINE>slsInfo.setProject(_ctx.stringValue("BatchJoinMeetingInternationalResponse.MeetingInfo.SlsInfo.Project"));<NEW_LINE>meetingInfo.setSlsInfo(slsInfo);<NEW_LINE>List<Member> memberList = new ArrayList<Member>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("BatchJoinMeetingInternationalResponse.MeetingInfo.MemberList.Length"); i++) {<NEW_LINE>Member member = new Member();<NEW_LINE>member.setMemberUUID(_ctx.stringValue("BatchJoinMeetingInternationalResponse.MeetingInfo.MemberList[" + i + "].MemberUUID"));<NEW_LINE>member.setMeetingToken(_ctx.stringValue("BatchJoinMeetingInternationalResponse.MeetingInfo.MemberList[" + i + "].MeetingToken"));<NEW_LINE>member.setUserId(_ctx.stringValue("BatchJoinMeetingInternationalResponse.MeetingInfo.MemberList[" + i + "].UserId"));<NEW_LINE>memberList.add(member);<NEW_LINE>}<NEW_LINE>meetingInfo.setMemberList(memberList);<NEW_LINE>batchJoinMeetingInternationalResponse.setMeetingInfo(meetingInfo);<NEW_LINE>return batchJoinMeetingInternationalResponse;<NEW_LINE>} | (_ctx.booleanValue("BatchJoinMeetingInternationalResponse.Success")); |
1,054,273 | private ReportResult exportAsExcel(final JasperPrint jasperPrint) throws JRException {<NEW_LINE>final ByteArrayOutputStream out = new ByteArrayOutputStream();<NEW_LINE>final MetasJRXlsExporter exporter = new MetasJRXlsExporter();<NEW_LINE>// Output<NEW_LINE>exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, out);<NEW_LINE>// Input<NEW_LINE>exporter.<MASK><NEW_LINE>// Make sure our cells will be locked by default<NEW_LINE>// and assume that cells which shall not be locked are particularly specified.<NEW_LINE>jasperPrint.setProperty(XlsReportConfiguration.PROPERTY_CELL_LOCKED, "true");<NEW_LINE>// there are cases when we don't want the cells to be blocked by password<NEW_LINE>// in those cases we put in jrxml the password property with empty value, which will indicate we don't want password<NEW_LINE>// if there is no such property we take default password. If empty we set no password and if set, we use that password from the report<NEW_LINE>// noinspection StatementWithEmptyBody<NEW_LINE>if (jasperPrint.getProperty(XlsReportConfiguration.PROPERTY_PASSWORD) == null) {<NEW_LINE>// do nothing;<NEW_LINE>} else if (jasperPrint.getProperty(XlsReportConfiguration.PROPERTY_PASSWORD).isEmpty()) {<NEW_LINE>exporter.setParameter(JRXlsAbstractExporterParameter.PASSWORD, null);<NEW_LINE>} else {<NEW_LINE>exporter.setParameter(JRXlsAbstractExporterParameter.PASSWORD, jasperPrint.getProperty(XlsReportConfiguration.PROPERTY_PASSWORD));<NEW_LINE>}<NEW_LINE>exporter.exportReport();<NEW_LINE>return ReportResult.builder().outputType(OutputType.XLS).reportContentBase64(Util.encodeBase64(out.toByteArray())).build();<NEW_LINE>} | setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint); |
1,039,234 | /* Merges a and b<NEW_LINE>Lists are merged: a + b = [*a, *b]<NEW_LINE>Strings are not allowed, they will throw an error<NEW_LINE>*/<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>public static Map<String, Object> mergeManifestContext(Map<String, Object> a, Map<String, Object> b) throws RuntimeException {<NEW_LINE>Map<String, Object> merged = new HashMap<String, Object>();<NEW_LINE>Set<String> allKeys = new HashSet<String>();<NEW_LINE>allKeys.addAll(a.keySet());<NEW_LINE>allKeys.addAll(b.keySet());<NEW_LINE>for (String key : allKeys) {<NEW_LINE>Object objA = a.getOrDefault(key, null);<NEW_LINE>Object objB = b.getOrDefault(key, null);<NEW_LINE>if (objA == null || objB == null) {<NEW_LINE>merged.put(key, <MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (!isSameClass(objA, objB)) {<NEW_LINE>throw new RuntimeException(String.format("Class types differ: '%s' != '%s' for values '%s' and '%s'", objA.getClass(), objB.getClass(), objA, objB));<NEW_LINE>}<NEW_LINE>if (isListOfStrings(objA)) {<NEW_LINE>List<String> listA = (List<String>) objA;<NEW_LINE>List<String> listB = (List<String>) objB;<NEW_LINE>List<String> list = new ArrayList<String>();<NEW_LINE>list.addAll(listA);<NEW_LINE>list.addAll(listB);<NEW_LINE>merged.put(key, list);<NEW_LINE>} else if (isMap(objA)) {<NEW_LINE>Map<String, Object> mergedChildren = ExtenderUtil.mergeManifestContext((Map<String, Object>) objA, (Map<String, Object>) objB);<NEW_LINE>merged.put(key, mergedChildren);<NEW_LINE>} else {<NEW_LINE>throw new RuntimeException(String.format("Unsupported value types: '%s' != '%s' for values '%s' and '%s'", objA.getClass(), objB.getClass(), objA, objB));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return merged;<NEW_LINE>} | objA == null ? objB : objA); |
762,316 | public void deleteRow() throws SQLException {<NEW_LINE>loggerExternal.entering(getClassNameLogging(), "deleteRow");<NEW_LINE>if (loggerExternal.isLoggable(Level.FINER) && Util.isActivityTraceOn()) {<NEW_LINE>loggerExternal.finer(toString() + " ActivityId: " + ActivityCorrelator.getNext().toString());<NEW_LINE>}<NEW_LINE>final class DeleteRowRPC extends TDSCommand {<NEW_LINE><NEW_LINE>private static final long serialVersionUID = 1L;<NEW_LINE><NEW_LINE>DeleteRowRPC() {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE><NEW_LINE>final boolean doExecute() throws SQLServerException {<NEW_LINE>doDeleteRowRPC(this);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (logger.isLoggable(java.util.logging.Level.FINER))<NEW_LINE>logger.finer(toString() + logCursorState());<NEW_LINE>checkClosed();<NEW_LINE>// From JDBC spec:<NEW_LINE>// Throws SQLException if this method is called on a ResultSet object that is not updatable ...<NEW_LINE>verifyResultSetIsUpdatable();<NEW_LINE>// ... or when the cursor is before the first row, after the last row, or on the insert row.<NEW_LINE>verifyResultSetIsNotOnInsertRow();<NEW_LINE>verifyResultSetHasCurrentRow();<NEW_LINE>// Deleted rows cannot be deleted.<NEW_LINE>verifyCurrentRowIsNotDeleted("R_cantUpdateDeletedRow");<NEW_LINE>try {<NEW_LINE>stmt.executeCommand(new DeleteRowRPC());<NEW_LINE>} finally {<NEW_LINE>cancelUpdates();<NEW_LINE>}<NEW_LINE>deletedCurrentRow = true;<NEW_LINE>loggerExternal.exiting(getClassNameLogging(), "deleteRow");<NEW_LINE>} | super("DeleteRowRPC", 0, 0); |
1,098,890 | private static void configureAnalyzer(Project proj, Circuit circuit, Analyzer analyzer, Map<Instance, String> pinNames, ArrayList<Var> inputVars, ArrayList<Var> outputVars) {<NEW_LINE>analyzer.getModel(<MASK><NEW_LINE>// If there are no inputs or outputs, we stop with that tab selected<NEW_LINE>if (inputVars.size() == 0 || outputVars.size() == 0) {<NEW_LINE>analyzer.setSelectedTab(Analyzer.IO_TAB);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Attempt to show the corresponding expression<NEW_LINE>try {<NEW_LINE>Analyze.computeExpression(analyzer.getModel(), circuit, pinNames);<NEW_LINE>analyzer.setSelectedTab(Analyzer.EXPRESSION_TAB);<NEW_LINE>return;<NEW_LINE>} catch (AnalyzeException ex) {<NEW_LINE>OptionPane.showMessageDialog(proj.getFrame(), ex.getMessage(), S.get("analyzeNoExpressionTitle"), OptionPane.INFORMATION_MESSAGE);<NEW_LINE>}<NEW_LINE>// As a backup measure, we compute a truth table.<NEW_LINE>Analyze.computeTable(analyzer.getModel(), proj, circuit, pinNames);<NEW_LINE>analyzer.setSelectedTab(Analyzer.TABLE_TAB);<NEW_LINE>} | ).setVariables(inputVars, outputVars); |
1,045,975 | private void addComponents() {<NEW_LINE>Components incomingComponents = OAInProgress.getComponents();<NEW_LINE>if (incomingComponents == null)<NEW_LINE>return;<NEW_LINE>Map m = null;<NEW_LINE>m = handleMapRename(incomingComponents.getExamples(), OA_COMPONENTS_EXAMPLES);<NEW_LINE>incomingComponents.setExamples(m);<NEW_LINE>m = handleMapRename(incomingComponents.getCallbacks(), OA_COMPONENTS_CALLBACKS);<NEW_LINE>incomingComponents.setCallbacks(m);<NEW_LINE>m = handleMapRename(incomingComponents.getHeaders(), OA_COMPONENTS_HEADERS);<NEW_LINE>incomingComponents.setHeaders(m);<NEW_LINE>m = handleMapRename(incomingComponents.getLinks(), OA_COMPONENTS_LINKS);<NEW_LINE>incomingComponents.setLinks(m);<NEW_LINE>m = handleMapRename(incomingComponents.getParameters(), OA_COMPONENTS_PARAMETERS);<NEW_LINE>incomingComponents.setParameters(m);<NEW_LINE>m = handleMapRename(<MASK><NEW_LINE>incomingComponents.setRequestBodies(m);<NEW_LINE>m = handleMapRename(incomingComponents.getResponses(), OA_COMPONENTS_RESPONSES);<NEW_LINE>incomingComponents.setResponses(m);<NEW_LINE>m = handleMapRename(incomingComponents.getSecuritySchemes(), OA_COMPONENTS_SECURITY_SHEMES);<NEW_LINE>incomingComponents.setSecuritySchemes(m);<NEW_LINE>m = handleMapRename(incomingComponents.getSchemas(), OA_COMPONENTS_SCHEMAS);<NEW_LINE>incomingComponents.setSchemas(m);<NEW_LINE>// special case do not rename vendor extensions<NEW_LINE>Map<String, Object> incomingExt = incomingComponents.getExtensions();<NEW_LINE>if (incomingExt != null && !incomingExt.isEmpty()) {<NEW_LINE>incomingExt.forEach((k, v) -> {<NEW_LINE>addKey(OA_COMPONENTS + "." + k);<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} | incomingComponents.getRequestBodies(), OA_COMPONENTS_REQUEST_BODIES); |
1,107,935 | private void importRealm(RealmRepresentation rep, String from) {<NEW_LINE>KeycloakSession session = factory.create();<NEW_LINE>boolean exists = false;<NEW_LINE>try {<NEW_LINE>session.getTransactionManager().begin();<NEW_LINE>try {<NEW_LINE>RealmManager manager = new RealmManager(session);<NEW_LINE>if (rep.getId() != null && manager.getRealm(rep.getId()) != null) {<NEW_LINE>ServicesLogger.LOGGER.realmExists(rep.getRealm(), from);<NEW_LINE>exists = true;<NEW_LINE>}<NEW_LINE>if (!exists && manager.getRealmByName(rep.getRealm()) != null) {<NEW_LINE>ServicesLogger.LOGGER.realmExists(rep.getRealm(), from);<NEW_LINE>exists = true;<NEW_LINE>}<NEW_LINE>if (!exists) {<NEW_LINE>RealmModel realm = manager.importRealm(rep);<NEW_LINE>ServicesLogger.LOGGER.importedRealm(realm.getName(), from);<NEW_LINE>}<NEW_LINE>session.getTransactionManager().commit();<NEW_LINE>} catch (Throwable cause) {<NEW_LINE>session.getTransactionManager().rollback();<NEW_LINE>if (!exists) {<NEW_LINE>throw new RuntimeException("Failed to import realm: " + <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>session.close();<NEW_LINE>}<NEW_LINE>} | rep.getRealm(), cause); |
457,854 | public <T> Flux<T> map(BiFunction<Row, RowMetadata, ? extends T> f) {<NEW_LINE>Assert.requireNonNull(f, "f must not be null");<NEW_LINE>return this.messages.handle((message, sink) -> {<NEW_LINE>try {<NEW_LINE>if (message instanceof ErrorResponse) {<NEW_LINE>this.factory.handleErrorResponse<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (message instanceof RowDescription) {<NEW_LINE>this.rowDescription = (RowDescription) message;<NEW_LINE>this.metadata = PostgresqlRowMetadata.toRowMetadata(this.resources.getCodecs(), (RowDescription) message);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (message instanceof DataRow) {<NEW_LINE>PostgresqlRow row = PostgresqlRow.toRow(this.resources, (DataRow) message, this.metadata, this.rowDescription);<NEW_LINE>sink.next(f.apply(row, this.metadata));<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>ReferenceCountUtil.release(message);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | (message, (SynchronousSink) sink); |
1,219,018 | public static void initConnectivity(@NonNull Context context) {<NEW_LINE>context = context.getApplicationContext();<NEW_LINE>ConnectivityManager cm = (ConnectivityManager) <MASK><NEW_LINE>assert cm != null;<NEW_LINE>if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {<NEW_LINE>NetworkRequest.Builder builder = new NetworkRequest.Builder();<NEW_LINE>builder.addCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET);<NEW_LINE>builder.addTransportType(NetworkCapabilities.TRANSPORT_CELLULAR);<NEW_LINE>builder.addTransportType(NetworkCapabilities.TRANSPORT_ETHERNET);<NEW_LINE>builder.addTransportType(NetworkCapabilities.TRANSPORT_WIFI);<NEW_LINE>ConnectivityManager.NetworkCallback callback = new ConnectivityManager.NetworkCallback() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onAvailable(@NonNull Network network) {<NEW_LINE>super.onAvailable(network);<NEW_LINE>setType(getConnectivityPostLollipop(cm, network));<NEW_LINE>}<NEW_LINE>};<NEW_LINE>try {<NEW_LINE>cm.registerNetworkCallback(builder.build(), callback);<NEW_LINE>Network[] networks = cm.getAllNetworks();<NEW_LINE>if (networks.length > 0)<NEW_LINE>setType(getConnectivityPostLollipop(cm, networks[0]));<NEW_LINE>} catch (SecurityException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>IntentFilter filter = new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION);<NEW_LINE>BroadcastReceiver receiver = new BroadcastReceiver() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onReceive(Context context, Intent intent) {<NEW_LINE>setType(getConnectivityPreLollipop(cm));<NEW_LINE>}<NEW_LINE>};<NEW_LINE>context.registerReceiver(receiver, filter);<NEW_LINE>setType(getConnectivityPreLollipop(cm));<NEW_LINE>}<NEW_LINE>} | context.getSystemService(Context.CONNECTIVITY_SERVICE); |
616,249 | @Nonnull<NEW_LINE>public EnumActionResult onItemUse(@Nonnull EntityPlayer player, @Nonnull World world, @Nonnull BlockPos pos, @Nonnull EnumHand hand, @Nonnull EnumFacing side, float hitX, float hitY, float hitZ) {<NEW_LINE>if (world.isRemote) {<NEW_LINE>return EnumActionResult.SUCCESS;<NEW_LINE>}<NEW_LINE>Block conduitBlock = Registry.getConduitBlock();<NEW_LINE>if (conduitBlock != null) {<NEW_LINE>ItemStack <MASK><NEW_LINE>BlockPos placeAt = pos.offset(side);<NEW_LINE>if (player.canPlayerEdit(placeAt, side, stack) && PaintUtil.getSourceBlock(stack) != null) {<NEW_LINE>if (world.isAirBlock(placeAt)) {<NEW_LINE>world.setBlockState(placeAt, conduitBlock.getDefaultState());<NEW_LINE>IConduitBundle bundle = NullHelper.notnullM((IConduitBundle) world.getTileEntity(placeAt), "placing block yielded no tileentity");<NEW_LINE>IBlockState bs = PaintUtil.getSourceBlock(stack);<NEW_LINE>bundle.setFacadeType(EnumFacadeType.getTypeFromMeta(stack.getItemDamage()));<NEW_LINE>bundle.setPaintSource(bs);<NEW_LINE>ConduitUtil.playPlaceSound(bs.getBlock().getSoundType(), world, pos);<NEW_LINE>if (!player.capabilities.isCreativeMode) {<NEW_LINE>stack.shrink(1);<NEW_LINE>}<NEW_LINE>return EnumActionResult.SUCCESS;<NEW_LINE>} else {<NEW_LINE>TileEntity tileEntity = world.getTileEntity(placeAt);<NEW_LINE>if (tileEntity instanceof IConduitBundle) {<NEW_LINE>if (((IConduitBundle) tileEntity).handleFacadeClick(world, placeAt, player, side.getOpposite(), stack, hand, hitX, hitY, hitZ)) {<NEW_LINE>return EnumActionResult.SUCCESS;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return EnumActionResult.PASS;<NEW_LINE>} | stack = player.getHeldItem(hand); |
1,810,482 | private JsonNode stats(Collection<String> indices, Collection<String> metrics, Consumer<Request> prepareRequest) {<NEW_LINE><MASK><NEW_LINE>if (!indices.isEmpty()) {<NEW_LINE>final String joinedIndices = String.join(",", indices);<NEW_LINE>endpoint.append("/");<NEW_LINE>endpoint.append(joinedIndices);<NEW_LINE>}<NEW_LINE>endpoint.append("/_stats");<NEW_LINE>if (!metrics.isEmpty()) {<NEW_LINE>final String joinedMetrics = String.join(",", metrics);<NEW_LINE>endpoint.append("/");<NEW_LINE>endpoint.append(joinedMetrics);<NEW_LINE>}<NEW_LINE>final Request request = new Request("GET", endpoint.toString());<NEW_LINE>prepareRequest.accept(request);<NEW_LINE>return client.execute((c, requestOptions) -> {<NEW_LINE>request.setOptions(requestOptions);<NEW_LINE>final Response response = c.getLowLevelClient().performRequest(request);<NEW_LINE>return objectMapper.readTree(response.getEntity().getContent());<NEW_LINE>}, "Unable to retrieve index stats for " + String.join(",", indices));<NEW_LINE>} | final StringBuilder endpoint = new StringBuilder(); |
62,186 | private static boolean isomorphic(PropFuncArg pfa1, PropFuncArg pfa2, NodeIsomorphismMap labelMap) {<NEW_LINE>if (pfa1 == null && pfa2 == null)<NEW_LINE>return true;<NEW_LINE>if (pfa1 == null)<NEW_LINE>return false;<NEW_LINE>if (pfa2 == null)<NEW_LINE>return false;<NEW_LINE>if (pfa1.isList() && pfa2.isList()) {<NEW_LINE>List<Node> list1 = pfa1.getArgList();<NEW_LINE>List<Node> list2 = pfa2.getArgList();<NEW_LINE>return Iso.isomorphicNodes(list1, list2, labelMap);<NEW_LINE>}<NEW_LINE>if (pfa1.isNode() && pfa2.isNode())<NEW_LINE>return Iso.nodeIso(pfa1.getArg(), <MASK><NEW_LINE>return false;<NEW_LINE>} | pfa2.getArg(), labelMap); |
1,811,233 | public void invoke(@NotNull Project project, @NotNull PsiFile file, @Nullable("is null when called from inspection") Editor editor, @NotNull PsiElement startElement, @NotNull PsiElement endElement) {<NEW_LINE>if (editor == null) {<NEW_LINE>LOG.error("Cannot run quick fix without editor: " + getClass().getSimpleName(), AttachmentFactory.createAttachment(file.getVirtualFile()));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!(startElement instanceof GoCallExpr))<NEW_LINE>return;<NEW_LINE>GoCallExpr call = (GoCallExpr) startElement;<NEW_LINE>List<GoExpression> args = call.getArgumentList().getExpressionList();<NEW_LINE>GoType resultType = ContainerUtil.getFirstItem(GoTypeUtil.getExpectedTypes(call));<NEW_LINE>PsiElement anchor = <MASK><NEW_LINE>Template template = TemplateManager.getInstance(project).createTemplate("", "");<NEW_LINE>template.addTextSegment("\nfunc " + myName);<NEW_LINE>setupFunctionParameters(template, args, file);<NEW_LINE>setupFunctionResult(template, resultType);<NEW_LINE>template.addTextSegment(" {\n\t");<NEW_LINE>template.addEndVariable();<NEW_LINE>template.addTextSegment("\n}");<NEW_LINE>int offset = anchor.getTextRange().getEndOffset();<NEW_LINE>editor.getCaretModel().moveToOffset(offset);<NEW_LINE>startTemplate(editor, template, project);<NEW_LINE>} | PsiTreeUtil.findPrevParent(file, call); |
1,708,135 | public void run() {<NEW_LINE>mPoster.setKeepScreenOn(playing);<NEW_LINE>if (!playing) {<NEW_LINE>mPlayPauseButton.setImageResource(R.drawable.ic_play);<NEW_LINE>mPlayPauseButton.setContentDescription(getString(R.string.lbl_play));<NEW_LINE>} else {<NEW_LINE>mPlayPauseButton.setImageResource(R.drawable.ic_pause);<NEW_LINE>mPlayPauseButton.setContentDescription(getString<MASK><NEW_LINE>}<NEW_LINE>mRepeatButton.setActivated(mediaManager.getValue().isRepeatMode());<NEW_LINE>mSaveButton.setEnabled(mediaManager.getValue().getCurrentAudioQueueSize() > 1);<NEW_LINE>mPrevButton.setEnabled(mediaManager.getValue().hasPrevAudioItem());<NEW_LINE>mNextButton.setEnabled(mediaManager.getValue().hasNextAudioItem());<NEW_LINE>mShuffleButton.setEnabled(mediaManager.getValue().getCurrentAudioQueueSize() > 1);<NEW_LINE>mShuffleButton.setActivated(mediaManager.getValue().isShuffleMode());<NEW_LINE>if (mBaseItem != null) {<NEW_LINE>mAlbumButton.setEnabled(mBaseItem.getAlbumId() != null);<NEW_LINE>mArtistButton.setEnabled(mBaseItem.getAlbumArtists() != null && mBaseItem.getAlbumArtists().size() > 0);<NEW_LINE>}<NEW_LINE>} | (R.string.lbl_pause)); |
1,578,071 | public HttpResult doDelete(CloseableHttpClient httpClient, String url, Map<String, String> header) throws Exception {<NEW_LINE>HttpDelete httpDelete = new HttpDelete(url);<NEW_LINE>httpDelete.addHeader("Connection", "close");<NEW_LINE>if (header != null) {<NEW_LINE>header.forEach((k, v) -> {<NEW_LINE>httpDelete.setHeader(k, v);<NEW_LINE>});<NEW_LINE>}<NEW_LINE>CloseableHttpResponse response = null;<NEW_LINE>response = httpClient.execute(httpDelete);<NEW_LINE>logger.info("status:" + response.getStatusLine().getStatusCode());<NEW_LINE>String data = null;<NEW_LINE>if (response.getStatusLine().getStatusCode() == 200) {<NEW_LINE>if (response.getEntity() != null)<NEW_LINE>data = EntityUtils.toString(response.getEntity(), "UTF-8");<NEW_LINE>else<NEW_LINE>data = null;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>response.close();<NEW_LINE>} catch (Exception e) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>return new HttpResult(response.getStatusLine().getStatusCode(), data);<NEW_LINE>} | logger.warn("", e); |
1,142,754 | private static void pointAdd(PointExt p, PointExt r) {<NEW_LINE>int[] a = F.create();<NEW_LINE>int[] b = F.create();<NEW_LINE>int[] c = F.create();<NEW_LINE>int[] d = F.create();<NEW_LINE>int[] e = F.create();<NEW_LINE>int[] f = F.create();<NEW_LINE>int[] g = F.create();<NEW_LINE>int[] h = F.create();<NEW_LINE>F.mul(p.z, r.z, a);<NEW_LINE>F.sqr(a, b);<NEW_LINE>F.mul(p.x, r.x, c);<NEW_LINE>F.mul(p.y, r.y, d);<NEW_LINE>F.mul(c, d, e);<NEW_LINE>F.mul(e, -C_d, e);<NEW_LINE>// F.apm(b, e, f, g);<NEW_LINE>F.add(b, e, f);<NEW_LINE>F.sub(b, e, g);<NEW_LINE>F.add(p.x, p.y, b);<NEW_LINE>F.add(r.x, r.y, e);<NEW_LINE>F.mul(b, e, h);<NEW_LINE>// F.apm(d, c, b, e);<NEW_LINE>F.add(d, c, b);<NEW_LINE>F.sub(d, c, e);<NEW_LINE>F.carry(b);<NEW_LINE>F.sub(h, b, h);<NEW_LINE>F.mul(h, a, h);<NEW_LINE>F.mul(e, a, e);<NEW_LINE>F.mul(<MASK><NEW_LINE>F.mul(e, g, r.y);<NEW_LINE>F.mul(f, g, r.z);<NEW_LINE>} | f, h, r.x); |
1,710,118 | public Request<UpdateCustomMetricRequest> marshall(UpdateCustomMetricRequest updateCustomMetricRequest) {<NEW_LINE>if (updateCustomMetricRequest == null) {<NEW_LINE>throw new AmazonClientException("Invalid argument passed to marshall(UpdateCustomMetricRequest)");<NEW_LINE>}<NEW_LINE>Request<UpdateCustomMetricRequest> request = new DefaultRequest<UpdateCustomMetricRequest>(updateCustomMetricRequest, "AWSIot");<NEW_LINE>request.setHttpMethod(HttpMethodName.PATCH);<NEW_LINE>String uriResourcePath = "/custom-metric/{metricName}";<NEW_LINE>uriResourcePath = uriResourcePath.replace("{metricName}", (updateCustomMetricRequest.getMetricName() == null) ? "" : StringUtils.fromString<MASK><NEW_LINE>request.setResourcePath(uriResourcePath);<NEW_LINE>try {<NEW_LINE>StringWriter stringWriter = new StringWriter();<NEW_LINE>AwsJsonWriter jsonWriter = JsonUtils.getJsonWriter(stringWriter);<NEW_LINE>jsonWriter.beginObject();<NEW_LINE>if (updateCustomMetricRequest.getDisplayName() != null) {<NEW_LINE>String displayName = updateCustomMetricRequest.getDisplayName();<NEW_LINE>jsonWriter.name("displayName");<NEW_LINE>jsonWriter.value(displayName);<NEW_LINE>}<NEW_LINE>jsonWriter.endObject();<NEW_LINE>jsonWriter.close();<NEW_LINE>String snippet = stringWriter.toString();<NEW_LINE>byte[] content = snippet.getBytes(UTF8);<NEW_LINE>request.setContent(new StringInputStream(snippet));<NEW_LINE>request.addHeader("Content-Length", Integer.toString(content.length));<NEW_LINE>} catch (Throwable t) {<NEW_LINE>throw new AmazonClientException("Unable to marshall request to JSON: " + t.getMessage(), t);<NEW_LINE>}<NEW_LINE>if (!request.getHeaders().containsKey("Content-Type")) {<NEW_LINE>request.addHeader("Content-Type", "application/x-amz-json-1.0");<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>} | (updateCustomMetricRequest.getMetricName())); |
195,598 | public void marshall(Template _template, Request<?> request, String _prefix) {<NEW_LINE>String prefix;<NEW_LINE>if (_template.getTemplateName() != null) {<NEW_LINE>prefix = _prefix + "TemplateName";<NEW_LINE>String templateName = _template.getTemplateName();<NEW_LINE>request.addParameter(prefix, StringUtils.fromString(templateName));<NEW_LINE>}<NEW_LINE>if (_template.getSubjectPart() != null) {<NEW_LINE>prefix = _prefix + "SubjectPart";<NEW_LINE>String subjectPart = _template.getSubjectPart();<NEW_LINE>request.addParameter(prefix, StringUtils.fromString(subjectPart));<NEW_LINE>}<NEW_LINE>if (_template.getTextPart() != null) {<NEW_LINE>prefix = _prefix + "TextPart";<NEW_LINE>String textPart = _template.getTextPart();<NEW_LINE>request.addParameter(prefix, StringUtils.fromString(textPart));<NEW_LINE>}<NEW_LINE>if (_template.getHtmlPart() != null) {<NEW_LINE>prefix = _prefix + "HtmlPart";<NEW_LINE><MASK><NEW_LINE>request.addParameter(prefix, StringUtils.fromString(htmlPart));<NEW_LINE>}<NEW_LINE>} | String htmlPart = _template.getHtmlPart(); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.