idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
1,374,890 | public static /*<NEW_LINE>public static class EPLInsertIntoPerformance implements RegressionExecution {<NEW_LINE>public void run(RegressionEnvironment env) {<NEW_LINE>String epl =<NEW_LINE>"insert into MyStream1 select * from SupportBean;\n" +<NEW_LINE>"insert into MyStream2 select * from MyStream1;\n" +<NEW_LINE>"insert into MyStream3 select * from MyStream2;\n" +<NEW_LINE>"insert into MyStream4 select * from MyStream3;\n" +<NEW_LINE>"insert into MyStream5 select * from MyStream4;\n" +<NEW_LINE>"insert into MyStream6 select * from MyStream5;\n" +<NEW_LINE>"insert into MyStream7 select * from MyStream6;\n" +<NEW_LINE>"insert into MyStream8 select * from MyStream7;\n" +<NEW_LINE>"@name('s0') select count(*) as cnt from MyStream8;\n";<NEW_LINE>env.compileDeploy(epl);<NEW_LINE>int count = 10000000;<NEW_LINE><NEW_LINE>long start = System.currentTimeMillis();<NEW_LINE>for (int i = 0; i < count; i++) {<NEW_LINE>env.sendEventBean(new SupportBean());<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>env.assertPropsPerRowIterator("s0", new String[] {"cnt"}, new Object[][] {{count * 1L}});<NEW_LINE>System.out.println((end-start) / 1000d);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>*/<NEW_LINE>int computeEventPrecedence(int value, Object param) {<NEW_LINE>assertTrue(param instanceof HashMap);<NEW_LINE>return value;<NEW_LINE>} | long end = System.currentTimeMillis(); |
47,438 | public static void checkPbVersion() {<NEW_LINE>if (isClassExist("com.google.protobuf.MapField")) {<NEW_LINE>pbVersion = PbVersion.PROTO3;<NEW_LINE>try {<NEW_LINE>Class jsonFormatClazz = Class.forName("com.google.protobuf.util.JsonFormat");<NEW_LINE>Method method = jsonFormatClazz.getMethod("printer");<NEW_LINE>pb3Printer = method.invoke(jsonFormatClazz);<NEW_LINE>pb3PrinterClazz = Class.forName("com.google.protobuf.util.JsonFormat$Printer");<NEW_LINE>method = pb3PrinterClazz.getDeclaredMethod("includingDefaultValueFields");<NEW_LINE>method.invoke(pb3Printer);<NEW_LINE>pb3PrintMethod = pb3PrinterClazz.getDeclaredMethod("print", MessageOrBuilder.class);<NEW_LINE><MASK><NEW_LINE>pb3Parser = method.invoke(jsonFormatClazz);<NEW_LINE>pb3ParserClazz = Class.forName("com.google.protobuf.util.JsonFormat$Parser");<NEW_LINE>method = pb3ParserClazz.getDeclaredMethod("ignoringUnknownFields");<NEW_LINE>method.invoke(pb3Parser);<NEW_LINE>pb3ParseMethod = pb3ParserClazz.getDeclaredMethod("merge", String.class, Message.Builder.class);<NEW_LINE>} catch (Exception ex) {<NEW_LINE>throw new RuntimeException("dependency of protobuf-java-util not exist");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>pbVersion = PbVersion.PROTO2;<NEW_LINE>pb2Converter = new JsonFormat() {<NEW_LINE><NEW_LINE>protected void print(Message message, JsonGenerator generator) throws IOException {<NEW_LINE>for (Iterator<Map.Entry<Descriptors.FieldDescriptor, Object>> iter = message.getAllFields().entrySet().iterator(); iter.hasNext(); ) {<NEW_LINE>Map.Entry<Descriptors.FieldDescriptor, Object> field = iter.next();<NEW_LINE>printField(field.getKey(), field.getValue(), generator);<NEW_LINE>if (iter.hasNext()) {<NEW_LINE>generator.print(",");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// ignore UnknownFields<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}<NEW_LINE>} | method = jsonFormatClazz.getMethod("parser"); |
142,222 | private void initalizeSwingControls() {<NEW_LINE>accountLabel = new JTextPane();<NEW_LINE>accountLabel.setEditable(false);<NEW_LINE>accountLabel.setOpaque(false);<NEW_LINE>personaHeader = new JLabel(Bundle.MessageAccountPanel_persona_label());<NEW_LINE>contactHeader = new JLabel(Bundle.MessageAccountPanel_contact_label());<NEW_LINE>personaDisplayName = new JTextPane();<NEW_LINE>personaDisplayName.setOpaque(false);<NEW_LINE>personaDisplayName.setEditable(false);<NEW_LINE>personaDisplayName.setPreferredSize(new Dimension(100, 26));<NEW_LINE>personaDisplayName.setMaximumSize(new Dimension(100, 26));<NEW_LINE>contactDisplayName = new JTextPane();<NEW_LINE>contactDisplayName.setOpaque(false);<NEW_LINE>contactDisplayName.setEditable(false);<NEW_LINE>contactDisplayName.setPreferredSize(new Dimension(100, 26));<NEW_LINE>button = new JButton();<NEW_LINE>button.addActionListener(new PersonaButtonListener(this));<NEW_LINE>accountLabel.setMargin(new Insets(0, 0, 0, 0));<NEW_LINE>accountLabel.setText(account.getTypeSpecificID());<NEW_LINE>accountLabel.setFont(ContentViewerDefaults.getHeaderFont());<NEW_LINE>contactDisplayName.setText(contactName);<NEW_LINE>personaDisplayName.setText(persona != null ? persona.getName() : Bundle.MessageAccountPanel_unknown_label());<NEW_LINE>// This is a bit of a hack to size the JTextPane correctly, but it gets the job done.<NEW_LINE>personaDisplayName.setMaximumSize((new JLabel(personaDisplayName.getText()).getMaximumSize()));<NEW_LINE>contactDisplayName.setMaximumSize((new JLabel(contactDisplayName.getText()).getMaximumSize()));<NEW_LINE>accountLabel.setMaximumSize((new JLabel(accountLabel.getText()).getMaximumSize()));<NEW_LINE>button.setText(persona != null ? Bundle.MessageAccountPanel_button_view_label(<MASK><NEW_LINE>initalizePopupMenus();<NEW_LINE>} | ) : Bundle.MessageAccountPanel_button_create_label()); |
1,838,328 | private void writeTabToDesign(Element design, DesignContext designContext, Tab tab) {<NEW_LINE>// get default tab instance<NEW_LINE>Tab def = new TabSheetTabImpl(null, null, null);<NEW_LINE>// create element for tab<NEW_LINE>Element <MASK><NEW_LINE>// add tab content<NEW_LINE>tabElement.appendChild(designContext.createElement(tab.getComponent()));<NEW_LINE>Attributes attr = tabElement.attributes();<NEW_LINE>// write attributes<NEW_LINE>DesignAttributeHandler.writeAttribute("visible", attr, tab.isVisible(), def.isVisible(), Boolean.class, designContext);<NEW_LINE>DesignAttributeHandler.writeAttribute("closable", attr, tab.isClosable(), def.isClosable(), Boolean.class, designContext);<NEW_LINE>DesignAttributeHandler.writeAttribute("caption", attr, tab.getCaption(), def.getCaption(), String.class, designContext);<NEW_LINE>DesignAttributeHandler.writeAttribute("enabled", attr, tab.isEnabled(), def.isEnabled(), Boolean.class, designContext);<NEW_LINE>DesignAttributeHandler.writeAttribute("icon", attr, tab.getIcon(), def.getIcon(), Resource.class, designContext);<NEW_LINE>DesignAttributeHandler.writeAttribute("icon-alt", attr, tab.getIconAlternateText(), def.getIconAlternateText(), String.class, designContext);<NEW_LINE>DesignAttributeHandler.writeAttribute("description", attr, tab.getDescription(), def.getDescription(), String.class, designContext);<NEW_LINE>DesignAttributeHandler.writeAttribute("style-name", attr, tab.getStyleName(), def.getStyleName(), String.class, designContext);<NEW_LINE>DesignAttributeHandler.writeAttribute("id", attr, tab.getId(), def.getId(), String.class, designContext);<NEW_LINE>if (getSelectedTab() != null && getSelectedTab().equals(tab.getComponent())) {<NEW_LINE>// use write attribute to get consistent handling for boolean<NEW_LINE>DesignAttributeHandler.writeAttribute("selected", attr, true, false, boolean.class, designContext);<NEW_LINE>}<NEW_LINE>} | tabElement = design.appendElement("tab"); |
862,144 | public ExecutionLifecycleStatus afterJobEnds(final JobExecutionEvent event) throws ExecutionLifecyclePluginException {<NEW_LINE>if (enabled) {<NEW_LINE>event.getExecutionLogger(<MASK><NEW_LINE>String name = event.getUserName();<NEW_LINE>if (event.getResult().getResult().isSuccess()) {<NEW_LINE>event.getExecutionLogger().log(2, String.format("Congrats it was successful, %s!", name));<NEW_LINE>String url = randomUrl();<NEW_LINE>if (null != url) {<NEW_LINE>HashMap<String, String> meta = new HashMap<>();<NEW_LINE>meta.put("content-data-type", "text/html");<NEW_LINE>event.getExecutionLogger().log(2, String.format("<img src=\"https://imgs.xkcd.com/comics/%s.png\"/>", url), meta);<NEW_LINE>} else {<NEW_LINE>event.getExecutionLogger().log(1, "(Sorry, no fun for you)");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>event.getExecutionLogger().log(2, String.format("Sorry, this job failed, %s!", name));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | ).log(2, "Finished the job!"); |
74,758 | private void createNewKey() {<NEW_LINE>findViewById(R.id<MASK><NEW_LINE>findViewById(R.id.btShuffle).setEnabled(false);<NEW_LINE>new AsyncTask<Void, Void, InMemoryPrivateKey>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected InMemoryPrivateKey doInBackground(Void... voids) {<NEW_LINE>return new InMemoryPrivateKey(manager.getRandomSource(), true);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void onPostExecute(InMemoryPrivateKey pk) {<NEW_LINE>key = pk;<NEW_LINE>Map<AddressType, BitcoinAddress> addresses = key.getPublicKey().getAllSupportedAddresses(manager.getNetwork());<NEW_LINE>((AddressLabel) findViewById(R.id.tvAddressP2PKH)).setAddress(AddressUtils.fromAddress(addresses.get(AddressType.P2PKH)));<NEW_LINE>((AddressLabel) findViewById(R.id.tvAddressP2SH)).setAddress(AddressUtils.fromAddress(addresses.get(AddressType.P2SH_P2WPKH)));<NEW_LINE>((AddressLabel) findViewById(R.id.tvAddressBech)).setAddress(AddressUtils.fromAddress(addresses.get(AddressType.P2WPKH)));<NEW_LINE>findViewById(R.id.btShuffle).setEnabled(true);<NEW_LINE>findViewById(R.id.btUse).setEnabled(true);<NEW_LINE>}<NEW_LINE>}.execute();<NEW_LINE>} | .btUse).setEnabled(false); |
622,581 | protected void eStep() {<NEW_LINE>// variational inference to compute Q<NEW_LINE>for (MatrixEntry me : trainMatrix) {<NEW_LINE>int u = me.row();<NEW_LINE><MASK><NEW_LINE>double r = me.get();<NEW_LINE>double denominator = 0;<NEW_LINE>double[] numerator = new double[numTopics];<NEW_LINE>for (int z = 0; z < numTopics; z++) {<NEW_LINE>double val = topicProbs.get(z) * topicUserProbs.get(z, u) * topicItemProbs.get(z, i) * Gaussian.pdf(r, topicProbsMean.get(z), topicProbsVariance.get(z));<NEW_LINE>numerator[z] = val;<NEW_LINE>denominator += val;<NEW_LINE>}<NEW_LINE>Map<Integer, Double> QTopicProbs = Q.get(u, i);<NEW_LINE>for (int z = 0; z < numTopics; z++) {<NEW_LINE>double prob = (denominator > 0 ? numerator[z] / denominator : 0.0d);<NEW_LINE>QTopicProbs.put(z, prob);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | int i = me.column(); |
351,132 | final RestoreWorkspaceResult executeRestoreWorkspace(RestoreWorkspaceRequest restoreWorkspaceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(restoreWorkspaceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<RestoreWorkspaceRequest> request = null;<NEW_LINE>Response<RestoreWorkspaceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new RestoreWorkspaceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(restoreWorkspaceRequest));<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, "RestoreWorkspace");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<RestoreWorkspaceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new RestoreWorkspaceResultJsonUnmarshaller());<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, "WorkSpaces"); |
1,681,254 | public void init() {<NEW_LINE>if (configurationWrapper != null) {<NEW_LINE>eventMeshEnv = checkNotEmpty(ConfKeys.KEYS_EVENTMESH_ENV);<NEW_LINE><MASK><NEW_LINE>eventMeshCluster = checkNotEmpty(ConfKeys.KEYS_EVENTMESH_SERVER_CLUSTER);<NEW_LINE>eventMeshName = checkNotEmpty(ConfKeys.KEYS_EVENTMESH_SERVER_NAME);<NEW_LINE>eventMeshIDC = checkNotEmpty(ConfKeys.KEYS_EVENTMESH_IDC);<NEW_LINE>eventMeshServerIp = get(ConfKeys.KEYS_EVENTMESH_SERVER_HOST_IP, IPUtils::getLocalAddress);<NEW_LINE>eventMeshConnectorPluginType = checkNotEmpty(ConfKeys.KEYS_ENENTMESH_CONNECTOR_PLUGIN_TYPE);<NEW_LINE>eventMeshServerSecurityEnable = Boolean.parseBoolean(get(ConfKeys.KEYS_EVENTMESH_SECURITY_ENABLED, () -> "false"));<NEW_LINE>eventMeshSecurityPluginType = checkNotEmpty(ConfKeys.KEYS_ENENTMESH_SECURITY_PLUGIN_TYPE);<NEW_LINE>eventMeshServerRegistryEnable = Boolean.parseBoolean(get(ConfKeys.KEYS_EVENTMESH_REGISTRY_ENABLED, () -> "false"));<NEW_LINE>eventMeshRegistryPluginType = checkNotEmpty(ConfKeys.KEYS_ENENTMESH_REGISTRY_PLUGIN_TYPE);<NEW_LINE>String metricsPluginType = configurationWrapper.getProp(ConfKeys.KEYS_EVENTMESH_METRICS_PLUGIN_TYPE);<NEW_LINE>if (StringUtils.isNotEmpty(metricsPluginType)) {<NEW_LINE>eventMeshMetricsPluginType = Arrays.stream(metricsPluginType.split(",")).filter(StringUtils::isNotBlank).map(String::trim).collect(Collectors.toList());<NEW_LINE>}<NEW_LINE>eventMeshServerTraceEnable = Boolean.parseBoolean(get(ConfKeys.KEYS_EVENTMESH_TRACE_ENABLED, () -> "false"));<NEW_LINE>eventMeshTracePluginType = checkNotEmpty(ConfKeys.KEYS_EVENTMESH_TRACE_PLUGIN_TYPE);<NEW_LINE>}<NEW_LINE>} | sysID = checkNumeric(ConfKeys.KEYS_EVENTMESH_SYSID); |
1,355,090 | public GetOpsItemResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>GetOpsItemResult getOpsItemResult = new GetOpsItemResult();<NEW_LINE><MASK><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 getOpsItemResult;<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("OpsItem", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getOpsItemResult.setOpsItem(OpsItemJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return getOpsItemResult;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
1,839,930 | public void simulate(ProgramStatement statement) throws ExitingException {<NEW_LINE>String inputString = "";<NEW_LINE>// buf addr<NEW_LINE>int buf = RegisterFile.getValue("a0");<NEW_LINE>int maxLength = RegisterFile.getValue("a1") - 1;<NEW_LINE>boolean addNullByte = true;<NEW_LINE>// Guard against negative maxLength. DPS 13-July-2011<NEW_LINE>if (maxLength < 0) {<NEW_LINE>maxLength = 0;<NEW_LINE>addNullByte = false;<NEW_LINE>}<NEW_LINE>inputString = SystemIO.readString(this.getNumber(), maxLength);<NEW_LINE>byte[] utf8BytesList = inputString.getBytes(StandardCharsets.UTF_8);<NEW_LINE>// TODO: allow for utf-8 encoded strings<NEW_LINE>int stringLength = Math.min(maxLength, utf8BytesList.length);<NEW_LINE>try {<NEW_LINE>for (int index = 0; index < stringLength; index++) {<NEW_LINE>Globals.memory.setByte(buf + index, utf8BytesList[index]);<NEW_LINE>}<NEW_LINE>if (stringLength < maxLength) {<NEW_LINE>Globals.memory.setByte(buf + stringLength, '\n');<NEW_LINE>stringLength++;<NEW_LINE>}<NEW_LINE>if (addNullByte)<NEW_LINE>Globals.memory.setByte(buf + stringLength, 0);<NEW_LINE>} catch (AddressErrorException e) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | throw new ExitingException(statement, e); |
1,237,986 | private void adjustColumnWidths(int topColumn) {<NEW_LINE>TableColumnModel colModel = getColumnModel();<NEW_LINE>int colWidth = 0;<NEW_LINE>int subColWidth = -1;<NEW_LINE>for (int row = 0; row < getRowCount(); row++) {<NEW_LINE>Item item = (Item) getValueAt(row, topColumn);<NEW_LINE>Component ren = prepareRenderer(this.getCellRenderer(row, topColumn), row, topColumn, item, true);<NEW_LINE>int prefWidth = ren.getPreferredSize().width;<NEW_LINE>colWidth = Math.max(colWidth, prefWidth);<NEW_LINE>if (null != item && item.hasSubItems() && topColumn + 1 < getColumnCount() && !getSwitcherModel().isTopItemColumn(topColumn + 1)) {<NEW_LINE>Item[] subItems = item.getActivatableSubItems();<NEW_LINE>for (int i = 0; i < subItems.length; i++) {<NEW_LINE>ren = prepareRenderer(this.getCellRenderer(0, topColumn + 1), 0, topColumn + 1, subItems[i], true);<NEW_LINE>prefWidth = ren.getPreferredSize().width;<NEW_LINE>subColWidth = Math.max(subColWidth, prefWidth);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>colWidth = Math.min(colWidth, MAX_TOP_COLUMN_WIDTH);<NEW_LINE>TableColumn tc = colModel.getColumn(topColumn);<NEW_LINE>tc.setPreferredWidth(colWidth);<NEW_LINE>tc.setWidth(colWidth);<NEW_LINE>tc.setMaxWidth(colWidth);<NEW_LINE>if (subColWidth > 0) {<NEW_LINE>subColWidth = Math.min(subColWidth, MAX_SUB_COLUMN_WIDTH);<NEW_LINE>tc = <MASK><NEW_LINE>tc.setPreferredWidth(subColWidth);<NEW_LINE>tc.setWidth(subColWidth);<NEW_LINE>tc.setMaxWidth(subColWidth);<NEW_LINE>}<NEW_LINE>} | colModel.getColumn(topColumn + 1); |
499,357 | private static List<MetricListener> parseDomain(String domain, Context domainContext) {<NEW_LINE>String listeners = domainContext.getString(MetricListener.KEY_DOMAIN_LISTENERS);<NEW_LINE>if (StringUtils.isBlank(listeners)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>String[] listenerTypes = listeners.split("\\s+");<NEW_LINE>List<MetricListener> listenerList = new ArrayList<>();<NEW_LINE>for (String listenerType : listenerTypes) {<NEW_LINE>// new listener object<NEW_LINE>try {<NEW_LINE>Class<?> listenerClass = ClassUtils.getClass(listenerType);<NEW_LINE>Object listenerObject = listenerClass.getDeclaredConstructor().newInstance();<NEW_LINE>if (listenerObject == null || !(listenerObject instanceof MetricListener)) {<NEW_LINE>LOG.error("{} is not instance of MetricListener.", listenerType);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>listenerList.add(listener);<NEW_LINE>} catch (Throwable t) {<NEW_LINE>LOG.error("Fail to init MetricListener:{},error:{}", listenerType, t.getMessage());<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return listenerList;<NEW_LINE>} | final MetricListener listener = (MetricListener) listenerObject; |
549,957 | protected void writeValue(ByteArrayOutputStream stream, Object value) {<NEW_LINE>if (value instanceof CreateEngineRequest) {<NEW_LINE>stream.write(128);<NEW_LINE>writeValue(stream, ((CreateEngineRequest<MASK><NEW_LINE>} else if (value instanceof CreateEngineResponse) {<NEW_LINE>stream.write(129);<NEW_LINE>writeValue(stream, ((CreateEngineResponse) value).toMap());<NEW_LINE>} else if (value instanceof EventMessage) {<NEW_LINE>stream.write(130);<NEW_LINE>writeValue(stream, ((EventMessage) value).toMap());<NEW_LINE>} else if (value instanceof ReadCompleted) {<NEW_LINE>stream.write(131);<NEW_LINE>writeValue(stream, ((ReadCompleted) value).toMap());<NEW_LINE>} else if (value instanceof ResponseStarted) {<NEW_LINE>stream.write(132);<NEW_LINE>writeValue(stream, ((ResponseStarted) value).toMap());<NEW_LINE>} else if (value instanceof StartRequest) {<NEW_LINE>stream.write(133);<NEW_LINE>writeValue(stream, ((StartRequest) value).toMap());<NEW_LINE>} else if (value instanceof StartResponse) {<NEW_LINE>stream.write(134);<NEW_LINE>writeValue(stream, ((StartResponse) value).toMap());<NEW_LINE>} else {<NEW_LINE>super.writeValue(stream, value);<NEW_LINE>}<NEW_LINE>} | ) value).toMap()); |
1,241,931 | private void applyPhaseOptions(JimpleBody b, Map<String, String> opts) {<NEW_LINE>JBOptions options = new JBOptions(opts);<NEW_LINE>if (options.use_original_names()) {<NEW_LINE>PhaseOptions.v().setPhaseOptionIfUnset("jb.lns", "only-stack-locals");<NEW_LINE>}<NEW_LINE>final PackManager pacman = PackManager.v();<NEW_LINE>final boolean time = Options.v().time();<NEW_LINE>if (time) {<NEW_LINE>Timers.v().splitTimer.start();<NEW_LINE>}<NEW_LINE>// TrapTigthener<NEW_LINE>pacman.getTransform("jb.tt").apply(b);<NEW_LINE>// DuplicateCatchAllTrapRemover<NEW_LINE>pacman.getTransform("jb.dtr").apply(b);<NEW_LINE>// UnreachableCodeEliminator: We need to do this before splitting<NEW_LINE>// locals for not creating disconnected islands of useless assignments<NEW_LINE>// that afterwards mess up type assignment.<NEW_LINE>pacman.getTransform("jb.uce").apply(b);<NEW_LINE>pacman.getTransform("jb.ls").apply(b);<NEW_LINE>pacman.getTransform("jb.sils").apply(b);<NEW_LINE>if (time) {<NEW_LINE>Timers.v().splitTimer.end();<NEW_LINE>}<NEW_LINE>pacman.getTransform("jb.a").apply(b);<NEW_LINE>pacman.getTransform("jb.ule").apply(b);<NEW_LINE>if (time) {<NEW_LINE>Timers.v().assignTimer.start();<NEW_LINE>}<NEW_LINE>pacman.getTransform("jb.tr").apply(b);<NEW_LINE>if (time) {<NEW_LINE>Timers.v().assignTimer.end();<NEW_LINE>}<NEW_LINE>if (options.use_original_names()) {<NEW_LINE>pacman.getTransform("jb.ulp").apply(b);<NEW_LINE>}<NEW_LINE>// LocalNameStandardizer<NEW_LINE>pacman.getTransform("jb.lns").apply(b);<NEW_LINE>// CopyPropagator<NEW_LINE>pacman.getTransform("jb.cp").apply(b);<NEW_LINE>// DeadAssignmentElimintaor<NEW_LINE>pacman.getTransform<MASK><NEW_LINE>// UnusedLocalEliminator<NEW_LINE>pacman.getTransform("jb.cp-ule").apply(b);<NEW_LINE>// LocalPacker<NEW_LINE>pacman.getTransform("jb.lp").apply(b);<NEW_LINE>// NopEliminator<NEW_LINE>pacman.getTransform("jb.ne").apply(b);<NEW_LINE>// UnreachableCodeEliminator: Again, we might have new dead code<NEW_LINE>pacman.getTransform("jb.uce").apply(b);<NEW_LINE>// LocalNameStandardizer: After all these changes, some locals<NEW_LINE>// may end up being eliminated. If we want a stable local iteration<NEW_LINE>// order between soot instances, running LocalNameStandardizer<NEW_LINE>// again after all other changes is required.<NEW_LINE>if (options.stabilize_local_names()) {<NEW_LINE>PhaseOptions.v().setPhaseOption("jb.lns", "sort-locals:true");<NEW_LINE>pacman.getTransform("jb.lns").apply(b);<NEW_LINE>}<NEW_LINE>if (time) {<NEW_LINE>Timers.v().stmtCount += b.getUnits().size();<NEW_LINE>}<NEW_LINE>} | ("jb.dae").apply(b); |
261,128 | protected void send(final JsonArray reqInvocations, final JsonObject extraJson) {<NEW_LINE>startRequest();<NEW_LINE>JsonObject payload = Json.createObject();<NEW_LINE>String csrfToken = getMessageHandler().getCsrfToken();<NEW_LINE>if (!csrfToken.equals(ApplicationConstants.CSRF_TOKEN_DEFAULT_VALUE)) {<NEW_LINE>payload.put(ApplicationConstants.CSRF_TOKEN, csrfToken);<NEW_LINE>}<NEW_LINE>payload.put(ApplicationConstants.RPC_INVOCATIONS, reqInvocations);<NEW_LINE>payload.put(ApplicationConstants.SERVER_SYNC_ID, <MASK><NEW_LINE>payload.put(ApplicationConstants.CLIENT_TO_SERVER_ID, clientToServerMessageId++);<NEW_LINE>if (extraJson != null) {<NEW_LINE>for (String key : extraJson.keys()) {<NEW_LINE>JsonValue value = extraJson.get(key);<NEW_LINE>payload.put(key, value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>send(payload);<NEW_LINE>} | getMessageHandler().getLastSeenServerSyncId()); |
1,001,154 | public void run(RegressionEnvironment env) {<NEW_LINE>String[] fields = "id".split(",");<NEW_LINE>env.advanceTime(1000);<NEW_LINE>String text = "@name('s0') select irstream * from SupportBeanTimestamp#groupwin(groupId)#time_order(timestamp, 10 sec)";<NEW_LINE>env.compileDeploy(text).addListener<MASK><NEW_LINE>// 1st event<NEW_LINE>env.advanceTime(1000);<NEW_LINE>sendEventTS(env, "E1", "G1", 3000);<NEW_LINE>assertId(env, "E1");<NEW_LINE>env.milestone(1);<NEW_LINE>// 2nd event<NEW_LINE>env.advanceTime(2000);<NEW_LINE>sendEventTS(env, "E2", "G2", 2000);<NEW_LINE>assertId(env, "E2");<NEW_LINE>env.milestone(2);<NEW_LINE>// 3rd event<NEW_LINE>env.advanceTime(3000);<NEW_LINE>sendEventTS(env, "E3", "G2", 3000);<NEW_LINE>assertId(env, "E3");<NEW_LINE>env.milestone(3);<NEW_LINE>// 4th event<NEW_LINE>env.advanceTime(4000);<NEW_LINE>sendEventTS(env, "E4", "G1", 2500);<NEW_LINE>assertId(env, "E4");<NEW_LINE>env.milestone(4);<NEW_LINE>// Window pushes out event E2<NEW_LINE>env.advanceTime(11999);<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>env.advanceTime(12000);<NEW_LINE>env.assertPropsPerRowIRPair("s0", fields, null, new Object[][] { { "E2" } });<NEW_LINE>env.milestone(5);<NEW_LINE>// Window pushes out event E4<NEW_LINE>env.advanceTime(12499);<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>env.advanceTime(12500);<NEW_LINE>env.assertPropsPerRowIRPair("s0", fields, null, new Object[][] { { "E4" } });<NEW_LINE>env.milestone(6);<NEW_LINE>env.undeployAll();<NEW_LINE>} | ("s0").milestone(0); |
1,235,259 | static List<SVKmer> processFasta(final int kSize, final int maxDUSTScore, final String fastaFilename) {<NEW_LINE>try (BufferedReader rdr = new BufferedReader(new InputStreamReader(BucketUtils.openFile(fastaFilename)))) {<NEW_LINE>final List<SVKmer> kmers = new ArrayList<>((int) BucketUtils.fileSize(fastaFilename));<NEW_LINE>String line;<NEW_LINE>final StringBuilder sb = new StringBuilder();<NEW_LINE>final SVKmer kmerSeed = new SVKmerLong();<NEW_LINE>while ((line = rdr.readLine()) != null) {<NEW_LINE>if (line.charAt(0) != '>')<NEW_LINE>sb.append(line);<NEW_LINE>else if (sb.length() > 0) {<NEW_LINE>SVDUSTFilteredKmerizer.canonicalStream(sb, kSize, maxDUSTScore, kmerSeed<MASK><NEW_LINE>sb.setLength(0);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (sb.length() > 0) {<NEW_LINE>SVDUSTFilteredKmerizer.canonicalStream(sb, kSize, maxDUSTScore, kmerSeed).forEach(kmers::add);<NEW_LINE>}<NEW_LINE>return kmers;<NEW_LINE>} catch (IOException ioe) {<NEW_LINE>throw new GATKException("Can't read high copy kmers fasta file " + fastaFilename, ioe);<NEW_LINE>}<NEW_LINE>} | ).forEach(kmers::add); |
1,656,151 | public void marshall(SourceServer sourceServer, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (sourceServer == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(sourceServer.getArn(), ARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(sourceServer.getDataReplicationInfo(), DATAREPLICATIONINFO_BINDING);<NEW_LINE>protocolMarshaller.marshall(sourceServer.getIsArchived(), ISARCHIVED_BINDING);<NEW_LINE>protocolMarshaller.marshall(sourceServer.getLaunchedInstance(), LAUNCHEDINSTANCE_BINDING);<NEW_LINE>protocolMarshaller.marshall(sourceServer.getLifeCycle(), LIFECYCLE_BINDING);<NEW_LINE>protocolMarshaller.marshall(sourceServer.getReplicationType(), REPLICATIONTYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(sourceServer.getSourceProperties(), SOURCEPROPERTIES_BINDING);<NEW_LINE>protocolMarshaller.marshall(sourceServer.getSourceServerID(), SOURCESERVERID_BINDING);<NEW_LINE>protocolMarshaller.marshall(sourceServer.getTags(), TAGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | sourceServer.getVcenterClientID(), VCENTERCLIENTID_BINDING); |
321,362 | public ListTagsForResourceResult unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>ListTagsForResourceResult listTagsForResourceResult = new ListTagsForResourceResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 2;<NEW_LINE>while (true) {<NEW_LINE>XMLEvent xmlEvent = context.nextEvent();<NEW_LINE>if (xmlEvent.isEndDocument())<NEW_LINE>return listTagsForResourceResult;<NEW_LINE>if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {<NEW_LINE>if (context.testExpression("ResourceArn", targetDepth)) {<NEW_LINE>listTagsForResourceResult.setResourceArn(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("ResourceTags", targetDepth)) {<NEW_LINE>listTagsForResourceResult.withResourceTags(<MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("ResourceTags/member", targetDepth)) {<NEW_LINE>listTagsForResourceResult.withResourceTags(TagStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent.isEndElement()) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return listTagsForResourceResult;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | new ArrayList<Tag>()); |
1,819,991 | static public // TODO figure out a better way to handle the above.<NEW_LINE>File selectFolder(String prompt, File folder, Frame frame) {<NEW_LINE>if (Platform.isMacOS()) {<NEW_LINE>// .pack();<NEW_LINE>if (frame == null)<NEW_LINE>frame = new Frame();<NEW_LINE>FileDialog fd = new FileDialog(frame, prompt, FileDialog.LOAD);<NEW_LINE>if (folder != null) {<NEW_LINE>fd.<MASK><NEW_LINE>// fd.setFile(folder.getName());<NEW_LINE>}<NEW_LINE>System.setProperty("apple.awt.fileDialogForDirectories", "true");<NEW_LINE>fd.setModalityType(Dialog.ModalityType.APPLICATION_MODAL);<NEW_LINE>fd.setVisible(true);<NEW_LINE>System.setProperty("apple.awt.fileDialogForDirectories", "false");<NEW_LINE>if (fd.getFile() == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return new File(fd.getDirectory(), fd.getFile());<NEW_LINE>} else {<NEW_LINE>JFileChooser fc = new JFileChooser();<NEW_LINE>fc.setDialogTitle(prompt);<NEW_LINE>if (folder != null) {<NEW_LINE>fc.setSelectedFile(folder);<NEW_LINE>}<NEW_LINE>fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);<NEW_LINE>int returned = fc.showOpenDialog(frame);<NEW_LINE>if (returned == JFileChooser.APPROVE_OPTION) {<NEW_LINE>return fc.getSelectedFile();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | setDirectory(folder.getParent()); |
1,382,090 | public void visit(BLangLetExpression letExpression) {<NEW_LINE>SymbolEnv prevEnv = this.env;<NEW_LINE>// Set the enclInvokable of let expression since, when in module level the enclInvokable will be initFunction<NEW_LINE>// and the initFunction is created in desugar phase.<NEW_LINE>letExpression.env.enclInvokable = this.env.enclInvokable;<NEW_LINE>this.env = letExpression.env;<NEW_LINE>BLangExpression expr = letExpression.expr;<NEW_LINE>BLangBlockStmt blockStmt = ASTBuilderUtil.createBlockStmt(letExpression.pos);<NEW_LINE>blockStmt<MASK><NEW_LINE>blockStmt.isLetExpr = true;<NEW_LINE>for (BLangLetVariable letVariable : letExpression.letVarDeclarations) {<NEW_LINE>BLangNode node = rewrite((BLangNode) letVariable.definitionNode, env);<NEW_LINE>if (node.getKind() == NodeKind.BLOCK) {<NEW_LINE>blockStmt.stmts.addAll(((BLangBlockStmt) node).stmts);<NEW_LINE>} else {<NEW_LINE>blockStmt.addStatement((BLangSimpleVariableDef) node);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>BLangSimpleVariableDef tempVarDef = createVarDef(String.format("$let_var_%d_$", letCount++), expr.getBType(), expr, expr.pos);<NEW_LINE>BLangSimpleVarRef tempVarRef = ASTBuilderUtil.createVariableRef(expr.pos, tempVarDef.var.symbol);<NEW_LINE>blockStmt.addStatement(tempVarDef);<NEW_LINE>BLangStatementExpression stmtExpr = ASTBuilderUtil.createStatementExpression(blockStmt, tempVarRef);<NEW_LINE>stmtExpr.setBType(expr.getBType());<NEW_LINE>result = rewrite(stmtExpr, env);<NEW_LINE>this.env = prevEnv;<NEW_LINE>} | .scope = letExpression.env.scope; |
1,841,324 | public Iterator<Tuple2<Long, Double>> call(Iterator<DataSet> dataSetIterator) throws Exception {<NEW_LINE>if (!dataSetIterator.hasNext()) {<NEW_LINE>return Collections.singletonList(new Tuple2<>(0L, 0.0)).iterator();<NEW_LINE>}<NEW_LINE>// Does batching where appropriate<NEW_LINE>DataSetIterator iter = new IteratorDataSetIterator(dataSetIterator, minibatchSize);<NEW_LINE>ComputationGraph network = new ComputationGraph(ComputationGraphConfiguration.fromJson(json));<NEW_LINE>network.init();<NEW_LINE>// .value() is shared by all executors on single machine -> OK, as params are not changed in score function<NEW_LINE>INDArray val = params.value().unsafeDuplication();<NEW_LINE>if (val.length() != network.numParams(false))<NEW_LINE>throw new IllegalStateException("Network did not have same number of parameters as the broadcast set parameters");<NEW_LINE>network.setParams(val);<NEW_LINE>List<Tuple2<Long, Double>> out = new ArrayList<>();<NEW_LINE>while (iter.hasNext()) {<NEW_LINE>DataSet ds = iter.next();<NEW_LINE>double score = network.score(ds, false);<NEW_LINE>long numExamples = ds.getFeatures().size(0);<NEW_LINE>out.add(new Tuple2<>(numExamples, score * numExamples));<NEW_LINE>}<NEW_LINE>Nd4j<MASK><NEW_LINE>return out.iterator();<NEW_LINE>} | .getExecutioner().commit(); |
233,740 | private Answer execute(VmDataCommand cmd) {<NEW_LINE>com.trilead.ssh2.Connection sshConnection = new com.trilead.<MASK><NEW_LINE>try {<NEW_LINE>List<String[]> vmData = cmd.getVmData();<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>for (String[] data : vmData) {<NEW_LINE>String folder = data[0];<NEW_LINE>String file = data[1];<NEW_LINE>String contents = (data[2] == null) ? "none" : data[2];<NEW_LINE>sb.append(cmd.getVmIpAddress());<NEW_LINE>sb.append(",");<NEW_LINE>sb.append(folder);<NEW_LINE>sb.append(",");<NEW_LINE>sb.append(file);<NEW_LINE>sb.append(",");<NEW_LINE>sb.append(contents);<NEW_LINE>sb.append(";");<NEW_LINE>}<NEW_LINE>String arg = StringUtils.stripEnd(sb.toString(), ";");<NEW_LINE>sshConnection.connect(null, 60000, 60000);<NEW_LINE>if (!sshConnection.authenticateWithPassword(_username, _password)) {<NEW_LINE>s_logger.debug("SSH Failed to authenticate");<NEW_LINE>throw new ConfigurationException(String.format("Cannot connect to PING PXE server(IP=%1$s, username=%2$s, password=%3$s", _ip, _username, _password));<NEW_LINE>}<NEW_LINE>String script = String.format("python /usr/bin/baremetal_user_data.py '%s'", arg);<NEW_LINE>if (!SSHCmdHelper.sshExecuteCmd(sshConnection, script)) {<NEW_LINE>return new Answer(cmd, false, "Failed to add user data, command:" + script);<NEW_LINE>}<NEW_LINE>return new Answer(cmd, true, "Success");<NEW_LINE>} catch (Exception e) {<NEW_LINE>s_logger.debug("Prepare for creating baremetal template failed", e);<NEW_LINE>return new Answer(cmd, false, e.getMessage());<NEW_LINE>} finally {<NEW_LINE>if (sshConnection != null) {<NEW_LINE>sshConnection.close();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ssh2.Connection(_ip, 22); |
1,370,306 | public void serializeEvent(ByteBuf dest, ProtocolVersion version) {<NEW_LINE>if (target == Target.FUNCTION || target == Target.AGGREGATE) {<NEW_LINE>if (version.isGreaterOrEqualTo(ProtocolVersion.V4)) {<NEW_LINE>// available since protocol version 4<NEW_LINE>CBUtil.writeEnumValue(change, dest);<NEW_LINE>CBUtil.writeEnumValue(target, dest);<NEW_LINE>CBUtil.writeAsciiString(keyspace, dest);<NEW_LINE>CBUtil.writeAsciiString(name, dest);<NEW_LINE>CBUtil.writeStringList(argTypes, dest);<NEW_LINE>} else {<NEW_LINE>// not available in protocol versions < 4 - just say the keyspace was updated.<NEW_LINE>CBUtil.writeEnumValue(Change.UPDATED, dest);<NEW_LINE>if (version.isGreaterOrEqualTo(ProtocolVersion.V3))<NEW_LINE>CBUtil.writeEnumValue(Target.KEYSPACE, dest);<NEW_LINE>CBUtil.writeAsciiString(keyspace, dest);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (version.isGreaterOrEqualTo(ProtocolVersion.V3)) {<NEW_LINE>CBUtil.writeEnumValue(change, dest);<NEW_LINE>CBUtil.writeEnumValue(target, dest);<NEW_LINE>CBUtil.writeAsciiString(keyspace, dest);<NEW_LINE>if (target != Target.KEYSPACE)<NEW_LINE>CBUtil.writeAsciiString(name, dest);<NEW_LINE>} else {<NEW_LINE>if (target == Target.TYPE) {<NEW_LINE>// For the v1/v2 protocol, we have no way to represent type changes, so we simply say the<NEW_LINE>// keyspace<NEW_LINE>// was updated. See CASSANDRA-7617.<NEW_LINE>CBUtil.writeEnumValue(Change.UPDATED, dest);<NEW_LINE>CBUtil.writeAsciiString(keyspace, dest);<NEW_LINE>CBUtil.writeAsciiString("", dest);<NEW_LINE>} else {<NEW_LINE>CBUtil.writeEnumValue(change, dest);<NEW_LINE>CBUtil.writeAsciiString(keyspace, dest);<NEW_LINE>CBUtil.writeAsciiString(target == Target.KEYSPACE ? "" : name, dest);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | CBUtil.writeAsciiString("", dest); |
970,166 | // Public because it's also used to convert index metadata into a thrift-compatible format<NEW_LINE>public static Pair<ColumnDefinition, IndexTarget.Type> parseTarget(CFMetaData cfm, IndexMetadata indexDef) {<NEW_LINE>String target = indexDef.options.get("target");<NEW_LINE>assert target != null : String.format(Locale.ROOT, "No target definition found for index %s", indexDef.name);<NEW_LINE>// if the regex matches then the target is in the form "keys(foo)", "entries(bar)" etc<NEW_LINE>// if not, then it must be a simple column name and implictly its type is VALUES<NEW_LINE>Matcher matcher = TARGET_REGEX.matcher(target);<NEW_LINE>String columnName;<NEW_LINE>IndexTarget.Type targetType;<NEW_LINE>if (matcher.matches()) {<NEW_LINE>targetType = IndexTarget.Type.fromString(matcher.group(1));<NEW_LINE>columnName = matcher.group(2);<NEW_LINE>} else {<NEW_LINE>columnName = target;<NEW_LINE>targetType = IndexTarget.Type.VALUES;<NEW_LINE>}<NEW_LINE>// in the case of a quoted column name the name in the target string<NEW_LINE>// will be enclosed in quotes, which we need to unwrap. It may also<NEW_LINE>// include quote characters internally, escaped like so:<NEW_LINE>// abc"def -> abc""def.<NEW_LINE>// Because the target string is stored in a CQL compatible form, we<NEW_LINE>// need to un-escape any such quotes to get the actual column name<NEW_LINE>if (columnName.startsWith("\"")) {<NEW_LINE>columnName = StringUtils.substring(StringUtils.substring(columnName, 1), 0, -1);<NEW_LINE>columnName = <MASK><NEW_LINE>}<NEW_LINE>// if it's not a CQL table, we can't assume that the column name is utf8, so<NEW_LINE>// in that case we have to do a linear scan of the cfm's columns to get the matching one<NEW_LINE>if (cfm.isCQLTable())<NEW_LINE>return Pair.create(cfm.getColumnDefinition(new ColumnIdentifier(columnName, true)), targetType);<NEW_LINE>else<NEW_LINE>for (ColumnDefinition column : cfm.allColumns()) if (column.name.toString().equals(columnName))<NEW_LINE>return Pair.create(column, targetType);<NEW_LINE>throw new RuntimeException(String.format(Locale.ROOT, "Unable to parse targets for index %s (%s)", indexDef.name, target));<NEW_LINE>} | columnName.replaceAll("\"\"", "\""); |
1,567,237 | public boolean substituteMethodInvocation(MethodInvocationElement invocation) {<NEW_LINE>if (invocation.getTargetExpression() != null) {<NEW_LINE>Element targetType = invocation.getTargetExpression().getTypeAsElement();<NEW_LINE>if (BigDecimal.class.getName().equals(targetType.toString())) {<NEW_LINE>// BigDecimal methods are mapped to their Big.js equivalent<NEW_LINE>switch(invocation.getMethodName()) {<NEW_LINE>case "multiply":<NEW_LINE>printMacroName(invocation.getMethodName());<NEW_LINE>print(invocation.getTargetExpression()).print(".times(").printArgList(invocation.getArguments()).print(")");<NEW_LINE>return true;<NEW_LINE>case "add":<NEW_LINE>printMacroName(invocation.getMethodName());<NEW_LINE>print(invocation.getTargetExpression()).print(".plus(").printArgList(invocation.getArguments<MASK><NEW_LINE>return true;<NEW_LINE>case "subtract":<NEW_LINE>printMacroName(invocation.getMethodName());<NEW_LINE>print(invocation.getTargetExpression()).print(".minus(").printArgList(invocation.getArguments()).print(")");<NEW_LINE>return true;<NEW_LINE>case "scale":<NEW_LINE>printMacroName(invocation.getMethodName());<NEW_LINE>// we assume that we always have a scale of 2, which is a<NEW_LINE>// good default if we deal with currencies...<NEW_LINE>// to be changed/implemented further<NEW_LINE>print("2");<NEW_LINE>return true;<NEW_LINE>case "setScale":<NEW_LINE>printMacroName(invocation.getMethodName());<NEW_LINE>print(invocation.getTargetExpression()).print(".round(").print(invocation.getArguments().get(0)).print(")");<NEW_LINE>return true;<NEW_LINE>case "compareTo":<NEW_LINE>printMacroName(invocation.getMethodName());<NEW_LINE>print(invocation.getTargetExpression()).print(".cmp(").print(invocation.getArguments().get(0)).print(")");<NEW_LINE>return true;<NEW_LINE>case "equals":<NEW_LINE>printMacroName(invocation.getMethodName());<NEW_LINE>print(invocation.getTargetExpression()).print(".eq(").print(invocation.getArguments().get(0)).print(")");<NEW_LINE>return true;<NEW_LINE>case "signum":<NEW_LINE>printMacroName(invocation.getMethodName());<NEW_LINE>print(invocation.getTargetExpression()).print(".cmp(0)");<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// delegate to the adapter chain<NEW_LINE>return super.substituteMethodInvocation(invocation);<NEW_LINE>} | ()).print(")"); |
1,259,700 | private void updateButtonState(boolean next) {<NEW_LINE>if (showFilterItem != null) {<NEW_LINE>showFilterItem.setVisible(filter != null && !isNameSearch());<NEW_LINE>}<NEW_LINE>if (filter != null) {<NEW_LINE>int maxLength = 24;<NEW_LINE>String name = filter.getGeneratedName(maxLength);<NEW_LINE>// Next displays the actual query term instead of the generic "Seach by name", can be enabled for debugging or in general<NEW_LINE>if (isNameSearch()) {<NEW_LINE>name = "'" + filter.getFilterByName() + "'";<NEW_LINE>}<NEW_LINE>if (name.length() >= maxLength) {<NEW_LINE>name = name.substring(0, maxLength) + getString(R.string.shared_string_ellipsis);<NEW_LINE>}<NEW_LINE>if (filter instanceof NominatimPoiFilter && !((NominatimPoiFilter) filter).isPlacesQuery()) {<NEW_LINE>// nothing to add<NEW_LINE>} else {<NEW_LINE>name += " " + filter.getSearchArea(next);<NEW_LINE>}<NEW_LINE>getSupportActionBar().setTitle(name);<NEW_LINE>}<NEW_LINE>if (searchPOILevel != null) {<NEW_LINE>int title = location == null ? R.string.search_poi_location : R.string.search_POI_level_btn;<NEW_LINE>boolean taskAlreadyFinished = currentSearchTask == null || currentSearchTask.getStatus() != Status.RUNNING;<NEW_LINE>boolean enabled = taskAlreadyFinished && location != null && filter <MASK><NEW_LINE>if (isNameSearch() && !Algorithms.objectEquals(searchFilter.getText().toString(), filter.getFilterByName())) {<NEW_LINE>title = R.string.search_button;<NEW_LINE>// Issue #2667 (2)<NEW_LINE>if (currentSearchTask == null) {<NEW_LINE>enabled = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>searchPOILevel.setEnabled(enabled);<NEW_LINE>searchPOILevel.setTitle(title);<NEW_LINE>}<NEW_LINE>} | != null && filter.isSearchFurtherAvailable(); |
735,504 | private <R extends Resource, Q extends ResourceQuery> List<R> cacheQuery(String cacheKey, Class<Q> queryType, Supplier<List<R>> resultSupplier, BiFunction<Long, List<R>, Q> querySupplier, ResourceServer resourceServer, Consumer<R> consumer, boolean cacheResult) {<NEW_LINE>Q query = cache.get(cacheKey, queryType);<NEW_LINE>if (query != null) {<NEW_LINE>logger.tracev("cache hit for key: {0}", cacheKey);<NEW_LINE>}<NEW_LINE>List<R> model = Collections.emptyList();<NEW_LINE>if (query == null) {<NEW_LINE>Long loaded = cache.getCurrentRevision(cacheKey);<NEW_LINE>model = resultSupplier.get();<NEW_LINE>if (model == null)<NEW_LINE>return null;<NEW_LINE>if (!invalidations.contains(cacheKey)) {<NEW_LINE>query = querySupplier.apply(loaded, model);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} else if (query.isInvalid(invalidations)) {<NEW_LINE>model = resultSupplier.get();<NEW_LINE>} else {<NEW_LINE>cacheResult = false;<NEW_LINE>Set<String> resources = query.getResources();<NEW_LINE>if (consumer != null) {<NEW_LINE>resources.stream().map(resourceId -> (R) findById(resourceServer, resourceId)).forEach(consumer);<NEW_LINE>} else {<NEW_LINE>model = resources.stream().map(resourceId -> (R) findById(resourceServer, resourceId)).collect(Collectors.toList());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (cacheResult) {<NEW_LINE>model.forEach(StoreFactoryCacheSession.this::cacheResource);<NEW_LINE>}<NEW_LINE>return model;<NEW_LINE>} | cache.addRevisioned(query, startupRevision); |
1,711,551 | public DateTimeParseResult parse(ExtractResult er, LocalDateTime reference) {<NEW_LINE>LocalDateTime referenceDate = reference;<NEW_LINE>Object value = null;<NEW_LINE>if (er.getType().equals(getParserName())) {<NEW_LINE>DateTimeResolutionResult innerResult = this.mergeDateAndTime(er.getText(), referenceDate);<NEW_LINE>if (!innerResult.getSuccess()) {<NEW_LINE>innerResult = this.parseBasicRegex(er.getText(), referenceDate);<NEW_LINE>}<NEW_LINE>if (!innerResult.getSuccess()) {<NEW_LINE>innerResult = this.parseTimeOfToday(er.getText(), referenceDate);<NEW_LINE>}<NEW_LINE>if (!innerResult.getSuccess()) {<NEW_LINE>innerResult = this.parseSpecialTimeOfDate(er.getText(), referenceDate);<NEW_LINE>}<NEW_LINE>if (!innerResult.getSuccess()) {<NEW_LINE>innerResult = this.parserDurationWithAgoAndLater(er.getText(), referenceDate);<NEW_LINE>}<NEW_LINE>if (innerResult.getSuccess()) {<NEW_LINE>Map<String, String> futureResolution = ImmutableMap.<String, String>builder().put(TimeTypeConstants.DATETIME, DateTimeFormatUtil.formatDateTime((LocalDateTime) innerResult.getFutureValue<MASK><NEW_LINE>innerResult.setFutureResolution(futureResolution);<NEW_LINE>Map<String, String> pastResolution = ImmutableMap.<String, String>builder().put(TimeTypeConstants.DATETIME, DateTimeFormatUtil.formatDateTime((LocalDateTime) innerResult.getPastValue())).build();<NEW_LINE>innerResult.setPastResolution(pastResolution);<NEW_LINE>value = innerResult;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>DateTimeParseResult ret = new DateTimeParseResult(er.getStart(), er.getLength(), er.getText(), er.getType(), er.getData(), value, "", value == null ? "" : ((DateTimeResolutionResult) value).getTimex());<NEW_LINE>return ret;<NEW_LINE>} | ())).build(); |
1,158,886 | public void prepareRenaming(PsiElement element, String newName, @NotNull Map<PsiElement, String> allRenames, @NotNull SearchScope scope) {<NEW_LINE>if (element instanceof GoTypeSpec) {<NEW_LINE>Query<PsiReference> search = ReferencesSearch.search(element, scope);<NEW_LINE>for (PsiReference ref : search) {<NEW_LINE>PsiElement refElement = ref.getElement();<NEW_LINE>PsiElement type = refElement == null ? null : refElement.getParent();<NEW_LINE>if (!(type instanceof GoType))<NEW_LINE>continue;<NEW_LINE>PsiElement typeParent = type.getParent();<NEW_LINE>GoPointerType pointer = ObjectUtils.tryCast(typeParent, GoPointerType.class);<NEW_LINE>PsiElement anon = pointer != null ? pointer.getParent() : typeParent;<NEW_LINE>if (anon instanceof GoAnonymousFieldDefinition) {<NEW_LINE>allRenames.put(anon, newName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (element instanceof GoAnonymousFieldDefinition) {<NEW_LINE>GoTypeReferenceExpression reference = ((<MASK><NEW_LINE>PsiElement resolve = reference != null ? reference.resolve() : null;<NEW_LINE>if (resolve instanceof GoTypeSpec) {<NEW_LINE>allRenames.put(resolve, newName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | GoAnonymousFieldDefinition) element).getTypeReferenceExpression(); |
408,358 | private void processPersonalBlockChanges() {<NEW_LINE>if (blockChanges.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// separate messages by chunk<NEW_LINE>// inner map is used to only send one entry for same coordinates<NEW_LINE>Map<Key, Map<BlockVector, BlockChangeMessage>> <MASK><NEW_LINE>BlockChangeMessage message;<NEW_LINE>while ((message = blockChanges.poll()) != null) {<NEW_LINE>Key key = GlowChunk.Key.of(message.getX() >> 4, message.getZ() >> 4);<NEW_LINE>if (canSeeChunk(key)) {<NEW_LINE>Map<BlockVector, BlockChangeMessage> map = chunks.computeIfAbsent(key, k -> new HashMap<>());<NEW_LINE>map.put(new BlockVector(message.getX(), message.getY(), message.getZ()), message);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// send away<NEW_LINE>for (Map.Entry<Key, Map<BlockVector, BlockChangeMessage>> entry : chunks.entrySet()) {<NEW_LINE>Key key = entry.getKey();<NEW_LINE>List<BlockChangeMessage> value = new ArrayList<>(entry.getValue().values());<NEW_LINE>if (value.size() == 1) {<NEW_LINE>session.send(value.get(0));<NEW_LINE>} else if (value.size() > 1) {<NEW_LINE>session.send(new MultiBlockChangeMessage(key.getX(), key.getZ(), value));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | chunks = new HashMap<>(); |
878,390 | public static QueryParamsBuilder copy(QueryParams that) {<NEW_LINE>QueryParamsBuilder copy = new QueryParamsBuilder(that.limit()).skip(that.skip());<NEW_LINE>that.from().ifPresent(it -> copy.from(it));<NEW_LINE>that.to().ifPresent(it -> copy.to(it));<NEW_LINE>that.fromInstant().ifPresent(it -> copy.fromInstant(it));<NEW_LINE>that.toInstant().ifPresent(it -> copy.toInstant(it));<NEW_LINE>that.toCommitId().ifPresent((it -> copy.toCommitId(it)));<NEW_LINE>copy.commitIds = that.commitIds();<NEW_LINE>that.version().ifPresent((it -> copy.version(it)));<NEW_LINE>that.author().ifPresent((it -> <MASK><NEW_LINE>copy.withChildValueObjects(that.isAggregate());<NEW_LINE>copy.commitProperties = that.commitProperties();<NEW_LINE>copy.commitPropertiesLike = that.commitPropertiesLike();<NEW_LINE>copy.changedProperties = that.changedProperties();<NEW_LINE>that.snapshotType().ifPresent((it -> copy.withSnapshotType(it)));<NEW_LINE>copy.loadCommitProps = that.isLoadCommitProps();<NEW_LINE>that.snapshotQueryLimit().ifPresent((it -> copy.snapshotQueryLimit(it)));<NEW_LINE>return copy;<NEW_LINE>} | copy.author(it))); |
1,440,128 | public static DescribeVodDomainBpsDataResponse unmarshall(DescribeVodDomainBpsDataResponse describeVodDomainBpsDataResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeVodDomainBpsDataResponse.setRequestId(_ctx.stringValue("DescribeVodDomainBpsDataResponse.RequestId"));<NEW_LINE>describeVodDomainBpsDataResponse.setDomainName(_ctx.stringValue("DescribeVodDomainBpsDataResponse.DomainName"));<NEW_LINE>describeVodDomainBpsDataResponse.setStartTime(_ctx.stringValue("DescribeVodDomainBpsDataResponse.StartTime"));<NEW_LINE>describeVodDomainBpsDataResponse.setEndTime(_ctx.stringValue("DescribeVodDomainBpsDataResponse.EndTime"));<NEW_LINE>describeVodDomainBpsDataResponse.setLocationNameEn(_ctx.stringValue("DescribeVodDomainBpsDataResponse.LocationNameEn"));<NEW_LINE>describeVodDomainBpsDataResponse.setIspNameEn(_ctx.stringValue("DescribeVodDomainBpsDataResponse.IspNameEn"));<NEW_LINE>describeVodDomainBpsDataResponse.setDataInterval(_ctx.stringValue("DescribeVodDomainBpsDataResponse.DataInterval"));<NEW_LINE>List<DataModule> bpsDataPerInterval = new ArrayList<DataModule>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeVodDomainBpsDataResponse.BpsDataPerInterval.Length"); i++) {<NEW_LINE>DataModule dataModule = new DataModule();<NEW_LINE>dataModule.setTimeStamp(_ctx.stringValue("DescribeVodDomainBpsDataResponse.BpsDataPerInterval[" + i + "].TimeStamp"));<NEW_LINE>dataModule.setValue(_ctx.stringValue("DescribeVodDomainBpsDataResponse.BpsDataPerInterval[" + i + "].Value"));<NEW_LINE>dataModule.setDomesticValue(_ctx.stringValue("DescribeVodDomainBpsDataResponse.BpsDataPerInterval[" + i + "].DomesticValue"));<NEW_LINE>dataModule.setOverseasValue(_ctx.stringValue("DescribeVodDomainBpsDataResponse.BpsDataPerInterval[" + i + "].OverseasValue"));<NEW_LINE>dataModule.setHttpsValue(_ctx.stringValue<MASK><NEW_LINE>dataModule.setHttpsDomesticValue(_ctx.stringValue("DescribeVodDomainBpsDataResponse.BpsDataPerInterval[" + i + "].HttpsDomesticValue"));<NEW_LINE>dataModule.setHttpsOverseasValue(_ctx.stringValue("DescribeVodDomainBpsDataResponse.BpsDataPerInterval[" + i + "].HttpsOverseasValue"));<NEW_LINE>bpsDataPerInterval.add(dataModule);<NEW_LINE>}<NEW_LINE>describeVodDomainBpsDataResponse.setBpsDataPerInterval(bpsDataPerInterval);<NEW_LINE>return describeVodDomainBpsDataResponse;<NEW_LINE>} | ("DescribeVodDomainBpsDataResponse.BpsDataPerInterval[" + i + "].HttpsValue")); |
910,559 | public InternalAggregation reduce(InternalAggregation aggregation, InternalAggregation.ReduceContext reduceContext) {<NEW_LINE>InternalMultiBucketAggregation<? extends InternalMultiBucketAggregation, ? extends InternalMultiBucketAggregation.InternalBucket> histo = (InternalMultiBucketAggregation<? extends InternalMultiBucketAggregation, ? extends InternalMultiBucketAggregation.InternalBucket>) aggregation;<NEW_LINE>List<? extends InternalMultiBucketAggregation.InternalBucket> buckets = histo.getBuckets();<NEW_LINE>HistogramFactory factory = (HistogramFactory) histo;<NEW_LINE>List<MultiBucketsAggregation.Bucket> newBuckets = new ArrayList<>();<NEW_LINE>EvictingQueue<Double> values = new EvictingQueue<>(this.window);<NEW_LINE>// Initialize the script<NEW_LINE>MovingFunctionScript.Factory scriptFactory = reduceContext.scriptService().compile(script, MovingFunctionScript.CONTEXT);<NEW_LINE>Map<String, Object> vars = new HashMap<>();<NEW_LINE>if (script.getParams() != null) {<NEW_LINE>vars.<MASK><NEW_LINE>}<NEW_LINE>MovingFunctionScript executableScript = scriptFactory.newInstance();<NEW_LINE>for (InternalMultiBucketAggregation.InternalBucket bucket : buckets) {<NEW_LINE>Double thisBucketValue = resolveBucketValue(histo, bucket, bucketsPaths()[0], gapPolicy);<NEW_LINE>// Default is to reuse existing bucket. Simplifies the rest of the logic,<NEW_LINE>// since we only change newBucket if we can add to it<NEW_LINE>MultiBucketsAggregation.Bucket newBucket = bucket;<NEW_LINE>if (thisBucketValue != null && thisBucketValue.equals(Double.NaN) == false) {<NEW_LINE>// The custom context mandates that the script returns a double (not Double) so we<NEW_LINE>// don't need null checks, etc.<NEW_LINE>double movavg = executableScript.execute(vars, values.stream().mapToDouble(Double::doubleValue).toArray());<NEW_LINE>List<InternalAggregation> aggs = StreamSupport.stream(bucket.getAggregations().spliterator(), false).map(InternalAggregation.class::cast).collect(Collectors.toList());<NEW_LINE>aggs.add(new InternalSimpleValue(name(), movavg, formatter, new ArrayList<>(), metaData()));<NEW_LINE>newBucket = factory.createBucket(factory.getKey(bucket), bucket.getDocCount(), new InternalAggregations(aggs));<NEW_LINE>values.offer(thisBucketValue);<NEW_LINE>}<NEW_LINE>newBuckets.add(newBucket);<NEW_LINE>}<NEW_LINE>return factory.createAggregation(newBuckets);<NEW_LINE>} | putAll(script.getParams()); |
945,618 | public final void start() {<NEW_LINE>initMBeans();<NEW_LINE>if (timerHandlers != null) {<NEW_LINE>timer = new Timer(true);<NEW_LINE>TimerTask[] timerTasks = new TimerTask[timerHandlers.length];<NEW_LINE>wrapToTimerTasks(timerTasks);<NEW_LINE>for (int index = 0; index < timerHandlers.length; index++) {<NEW_LINE>TimerHandler th = timerHandlers[index];<NEW_LINE>long period = th.period;<NEW_LINE>String periodArg = th.periodArg;<NEW_LINE>if (periodArg != null) {<NEW_LINE>period = BTraceRuntime.parseLong(args.template(periodArg), period);<NEW_LINE>}<NEW_LINE>timer.schedule(timerTasks[index], period, period);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (lowMemoryHandlers != null) {<NEW_LINE>lowMemoryHandlerMap = new HashMap<>();<NEW_LINE>for (LowMemoryHandler lmh : lowMemoryHandlers) {<NEW_LINE>String poolName = args.template(lmh.pool);<NEW_LINE>lowMemoryHandlerMap.put(poolName, lmh);<NEW_LINE>}<NEW_LINE>for (MemoryPoolMXBean mpoolBean : getMemoryPoolMXBeans()) {<NEW_LINE>String name = mpoolBean.getName();<NEW_LINE>LowMemoryHandler lmh = lowMemoryHandlerMap.get(name);<NEW_LINE>if (lmh != null) {<NEW_LINE>if (mpoolBean.isUsageThresholdSupported()) {<NEW_LINE>mpoolBean.setUsageThreshold(lmh.threshold);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>NotificationEmitter emitter = (NotificationEmitter) memoryMBean;<NEW_LINE>emitter.<MASK><NEW_LINE>}<NEW_LINE>leave();<NEW_LINE>} | addNotificationListener(memoryListener, null, null); |
1,300,789 | public void apply(Skeleton skeleton, float lastTime, float time, @Null Array<Event> events, float alpha, MixBlend blend, MixDirection direction) {<NEW_LINE>Bone bone = skeleton.bones.get(boneIndex);<NEW_LINE>if (!bone.active)<NEW_LINE>return;<NEW_LINE>float[] frames = this.frames;<NEW_LINE>if (time < frames[0]) {<NEW_LINE>// Time is before first frame.<NEW_LINE>switch(blend) {<NEW_LINE>case setup:<NEW_LINE>bone.shearY = bone.data.shearY;<NEW_LINE>return;<NEW_LINE>case first:<NEW_LINE>bone.shearY += (bone.data.shearY - bone.shearY) * alpha;<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>float y = getCurveValue(time);<NEW_LINE>switch(blend) {<NEW_LINE>case setup:<NEW_LINE>bone.shearY = bone.data.shearY + y * alpha;<NEW_LINE>break;<NEW_LINE>case first:<NEW_LINE>case replace:<NEW_LINE>bone.shearY += (bone.data.shearY + <MASK><NEW_LINE>break;<NEW_LINE>case add:<NEW_LINE>bone.shearY += y * alpha;<NEW_LINE>}<NEW_LINE>} | y - bone.shearY) * alpha; |
83,912 | public void process(T input) {<NEW_LINE>super.initialize(input.width, input.height);<NEW_LINE>lazyDeclareSigmas(this.sigma);<NEW_LINE>if (temp == null) {<NEW_LINE>// declare it to be the latest image that it might need to be, resize below<NEW_LINE>temp = (T) input.createNew(1, 1);<NEW_LINE>}<NEW_LINE>if (levelScales[0] == 1) {<NEW_LINE>if (isSaveOriginalReference()) {<NEW_LINE>setFirstLayer(input);<NEW_LINE>} else {<NEW_LINE>getLayer(0).setTo(input);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>int skip = levelScales[0];<NEW_LINE>horizontal.setSkip(skip);<NEW_LINE>vertical.setSkip(skip);<NEW_LINE>temp.reshape(input.width / skip, input.height);<NEW_LINE>horizontal.process(input, temp);<NEW_LINE>vertical.process<MASK><NEW_LINE>}<NEW_LINE>for (int index = 1; index < getNumLayers(); index++) {<NEW_LINE>int skip = levelScales[index] / levelScales[index - 1];<NEW_LINE>T prev = getLayer(index - 1);<NEW_LINE>temp.reshape(prev.width / skip, prev.height);<NEW_LINE>horizontal.setSkip(skip);<NEW_LINE>vertical.setSkip(skip);<NEW_LINE>horizontal.process(prev, temp);<NEW_LINE>vertical.process(temp, getLayer(index));<NEW_LINE>}<NEW_LINE>} | (temp, getLayer(0)); |
1,816,962 | public void executeWriteAction(final Editor editor, Caret caret, DataContext dataContext) {<NEW_LINE>FeatureUsageTracker.getInstance().triggerFeatureUsed("editor.delete.line");<NEW_LINE>CommandProcessor.getInstance().setCurrentCommandGroupId(EditorActionUtil.DELETE_COMMAND_GROUP);<NEW_LINE>CopyPasteManager.getInstance().stopKillRings();<NEW_LINE>final Document document = editor.getDocument();<NEW_LINE>final List<Caret> carets = caret == null ? editor.getCaretModel().getAllCarets() : Collections.singletonList(caret);<NEW_LINE>editor.getCaretModel().runBatchCaretOperation(() -> {<NEW_LINE>int[] caretColumns = new int[carets.size()];<NEW_LINE>int caretIndex = carets.size() - 1;<NEW_LINE>TextRange range = getRangeToDelete(editor, carets.get(caretIndex));<NEW_LINE>while (caretIndex >= 0) {<NEW_LINE>int currentCaretIndex = caretIndex;<NEW_LINE>TextRange currentRange = range;<NEW_LINE>// find carets with overlapping line ranges<NEW_LINE>while (--caretIndex >= 0) {<NEW_LINE>range = getRangeToDelete(editor, carets.get(caretIndex));<NEW_LINE>if (range.getEndOffset() < currentRange.getStartOffset()) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>currentRange = new TextRange(range.getStartOffset(), currentRange.getEndOffset());<NEW_LINE>}<NEW_LINE>for (int i = caretIndex + 1; i <= currentCaretIndex; i++) {<NEW_LINE>caretColumns[i] = carets.get(i).getVisualPosition().column;<NEW_LINE>}<NEW_LINE>int targetLine = editor.offsetToVisualPosition(currentRange.getStartOffset()).line;<NEW_LINE>document.deleteString(currentRange.getStartOffset(), currentRange.getEndOffset());<NEW_LINE>for (int i = caretIndex + 1; i <= currentCaretIndex; i++) {<NEW_LINE>carets.get(i).moveToVisualPosition(new VisualPosition(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | targetLine, caretColumns[i])); |
1,386,307 | public void marshall(CreateUpdatedImageRequest createUpdatedImageRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (createUpdatedImageRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(createUpdatedImageRequest.getExistingImageName(), EXISTINGIMAGENAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(createUpdatedImageRequest.getNewImageDescription(), NEWIMAGEDESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(createUpdatedImageRequest.getNewImageDisplayName(), NEWIMAGEDISPLAYNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(createUpdatedImageRequest.getNewImageTags(), NEWIMAGETAGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createUpdatedImageRequest.getDryRun(), DRYRUN_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | createUpdatedImageRequest.getNewImageName(), NEWIMAGENAME_BINDING); |
915,992 | public void encode(ChannelHandlerContext ctx, Frame frame, List<Object> results) throws IOException {<NEW_LINE>ByteBuf header = CBUtil.allocator.buffer(Header.LENGTH);<NEW_LINE>Message.Type type = frame.header.type;<NEW_LINE>header.writeByte(type.direction.addToVersion(frame.header.version.asInt()));<NEW_LINE>header.writeByte(Header.Flag.serialize(frame.header.flags));<NEW_LINE>// Continue to support writing pre-v3 headers so that we can give proper error messages to<NEW_LINE>// drivers that<NEW_LINE>// connect with the v1/v2 protocol. See CASSANDRA-11464.<NEW_LINE>if (frame.header.version.isGreaterOrEqualTo(ProtocolVersion.V3))<NEW_LINE>header.writeShort(frame.header.streamId);<NEW_LINE>else<NEW_LINE>header.writeByte(frame.header.streamId);<NEW_LINE><MASK><NEW_LINE>header.writeInt(frame.body.readableBytes());<NEW_LINE>int messageSize = header.readableBytes() + frame.body.readableBytes();<NEW_LINE>ClientMetrics.instance.incrementTotalBytesWritten(messageSize);<NEW_LINE>ClientMetrics.instance.recordBytesTransmittedPerFrame(messageSize);<NEW_LINE>results.add(header);<NEW_LINE>results.add(frame.body);<NEW_LINE>} | header.writeByte(type.opcode); |
744,729 | //<NEW_LINE>// admin index<NEW_LINE>@GetMapping("/admin")<NEW_LINE>public void adminHome(Model model, @Value("${alfio.version}") String version, HttpServletRequest request, HttpServletResponse response, Principal principal) throws IOException {<NEW_LINE>model.addAttribute("alfioVersion", version);<NEW_LINE>model.addAttribute("username", principal.getName());<NEW_LINE>model.addAttribute(<MASK><NEW_LINE>boolean isDBAuthentication = !(principal instanceof OpenIdAlfioAuthentication);<NEW_LINE>model.addAttribute("isDBAuthentication", isDBAuthentication);<NEW_LINE>if (!isDBAuthentication) {<NEW_LINE>String idpLogoutRedirectionUrl = ((OpenIdAlfioAuthentication) SecurityContextHolder.getContext().getAuthentication()).getIdpLogoutRedirectionUrl();<NEW_LINE>model.addAttribute("idpLogoutRedirectionUrl", idpLogoutRedirectionUrl);<NEW_LINE>} else {<NEW_LINE>model.addAttribute("idpLogoutRedirectionUrl", null);<NEW_LINE>}<NEW_LINE>Collection<String> authorities = SecurityContextHolder.getContext().getAuthentication().getAuthorities().stream().map(GrantedAuthority::getAuthority).toList();<NEW_LINE>boolean isAdmin = authorities.contains(Role.ADMIN.getRoleName());<NEW_LINE>model.addAttribute("isOwner", isAdmin || authorities.contains(Role.OWNER.getRoleName()));<NEW_LINE>model.addAttribute("isAdmin", isAdmin);<NEW_LINE>//<NEW_LINE>addCommonModelAttributes(model, request, version);<NEW_LINE>model.addAttribute("displayProjectBanner", isAdmin && configurationManager.getForSystem(SHOW_PROJECT_BANNER).getValueAsBooleanOrDefault());<NEW_LINE>//<NEW_LINE>try (var os = response.getOutputStream()) {<NEW_LINE>response.setContentType(TEXT_HTML_CHARSET_UTF_8);<NEW_LINE>response.setCharacterEncoding(UTF_8);<NEW_LINE>var nonce = addCspHeader(response, false);<NEW_LINE>model.addAttribute("nonce", nonce);<NEW_LINE>templateManager.renderHtml(new ClassPathResource("alfio/web-templates/admin-index.ms"), model.asMap(), os);<NEW_LINE>}<NEW_LINE>} | "basicConfigurationNeeded", configurationManager.isBasicConfigurationNeeded()); |
1,772,099 | public static QueryFaceUserBatchResponse unmarshall(QueryFaceUserBatchResponse queryFaceUserBatchResponse, UnmarshallerContext _ctx) {<NEW_LINE>queryFaceUserBatchResponse.setRequestId(_ctx.stringValue("QueryFaceUserBatchResponse.RequestId"));<NEW_LINE>queryFaceUserBatchResponse.setSuccess(_ctx.booleanValue("QueryFaceUserBatchResponse.Success"));<NEW_LINE>queryFaceUserBatchResponse.setErrorMessage(_ctx.stringValue("QueryFaceUserBatchResponse.ErrorMessage"));<NEW_LINE>queryFaceUserBatchResponse.setCode(_ctx.stringValue("QueryFaceUserBatchResponse.Code"));<NEW_LINE>List<DataItem> data = new ArrayList<DataItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("QueryFaceUserBatchResponse.Data.Length"); i++) {<NEW_LINE>DataItem dataItem = new DataItem();<NEW_LINE>dataItem.setUserId(_ctx.stringValue("QueryFaceUserBatchResponse.Data[" + i + "].UserId"));<NEW_LINE>dataItem.setCustomUserId(_ctx.stringValue("QueryFaceUserBatchResponse.Data[" + i + "].CustomUserId"));<NEW_LINE>dataItem.setName(_ctx.stringValue("QueryFaceUserBatchResponse.Data[" + i + "].Name"));<NEW_LINE>dataItem.setParams(_ctx.stringValue<MASK><NEW_LINE>dataItem.setCreateTime(_ctx.longValue("QueryFaceUserBatchResponse.Data[" + i + "].CreateTime"));<NEW_LINE>dataItem.setModifyTime(_ctx.longValue("QueryFaceUserBatchResponse.Data[" + i + "].ModifyTime"));<NEW_LINE>List<FacePicListItem> facePicList = new ArrayList<FacePicListItem>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("QueryFaceUserBatchResponse.Data[" + i + "].FacePicList.Length"); j++) {<NEW_LINE>FacePicListItem facePicListItem = new FacePicListItem();<NEW_LINE>facePicListItem.setFaceMd5(_ctx.stringValue("QueryFaceUserBatchResponse.Data[" + i + "].FacePicList[" + j + "].FaceMd5"));<NEW_LINE>facePicListItem.setFaceUrl(_ctx.stringValue("QueryFaceUserBatchResponse.Data[" + i + "].FacePicList[" + j + "].FaceUrl"));<NEW_LINE>List<FeatureDTO> featureDTOList = new ArrayList<FeatureDTO>();<NEW_LINE>for (int k = 0; k < _ctx.lengthValue("QueryFaceUserBatchResponse.Data[" + i + "].FacePicList[" + j + "].FeatureDTOList.Length"); k++) {<NEW_LINE>FeatureDTO featureDTO = new FeatureDTO();<NEW_LINE>featureDTO.setAlgorithmName(_ctx.stringValue("QueryFaceUserBatchResponse.Data[" + i + "].FacePicList[" + j + "].FeatureDTOList[" + k + "].AlgorithmName"));<NEW_LINE>featureDTO.setAlgorithmProvider(_ctx.stringValue("QueryFaceUserBatchResponse.Data[" + i + "].FacePicList[" + j + "].FeatureDTOList[" + k + "].AlgorithmProvider"));<NEW_LINE>featureDTO.setAlgorithmVersion(_ctx.stringValue("QueryFaceUserBatchResponse.Data[" + i + "].FacePicList[" + j + "].FeatureDTOList[" + k + "].AlgorithmVersion"));<NEW_LINE>featureDTO.setFaceMd5(_ctx.stringValue("QueryFaceUserBatchResponse.Data[" + i + "].FacePicList[" + j + "].FeatureDTOList[" + k + "].FaceMd5"));<NEW_LINE>featureDTO.setErrorCode(_ctx.stringValue("QueryFaceUserBatchResponse.Data[" + i + "].FacePicList[" + j + "].FeatureDTOList[" + k + "].ErrorCode"));<NEW_LINE>featureDTO.setErrorMessage(_ctx.stringValue("QueryFaceUserBatchResponse.Data[" + i + "].FacePicList[" + j + "].FeatureDTOList[" + k + "].ErrorMessage"));<NEW_LINE>featureDTOList.add(featureDTO);<NEW_LINE>}<NEW_LINE>facePicListItem.setFeatureDTOList(featureDTOList);<NEW_LINE>facePicList.add(facePicListItem);<NEW_LINE>}<NEW_LINE>dataItem.setFacePicList(facePicList);<NEW_LINE>data.add(dataItem);<NEW_LINE>}<NEW_LINE>queryFaceUserBatchResponse.setData(data);<NEW_LINE>return queryFaceUserBatchResponse;<NEW_LINE>} | ("QueryFaceUserBatchResponse.Data[" + i + "].Params")); |
765,769 | public void execute() {<NEW_LINE>final OrgChangeBPartnerComposite bpartnerAndSubscriptions = orgChangeRepo.getByIdAndOrgChangeDate(request.getBpartnerId(), request.getStartDate());<NEW_LINE>final OrgMappingId orgMappingId = bpartnerAndSubscriptions.getBPartnerOrgMappingId();<NEW_LINE>final BPartnerId newBPartnerId = getOrCreateCounterpartBPartner(request, orgMappingId);<NEW_LINE>// gets the partner with all the active and inactive locations, users and bank accounts<NEW_LINE>BPartnerComposite <MASK><NEW_LINE>{<NEW_LINE>destinationBPartnerComposite.getBpartner().setActive(true);<NEW_LINE>final List<BPartnerLocation> newLocations = getOrCreateLocations(bpartnerAndSubscriptions, destinationBPartnerComposite);<NEW_LINE>final List<BPartnerContact> newContacts = getOrCreateContacts(bpartnerAndSubscriptions, destinationBPartnerComposite);<NEW_LINE>final List<BPartnerBankAccount> newBPBankAccounts = getOrCreateBPBankAccounts(bpartnerAndSubscriptions, destinationBPartnerComposite);<NEW_LINE>destinationBPartnerComposite = destinationBPartnerComposite.deepCopy().toBuilder().locations(newLocations).contacts(newContacts).bankAccounts(newBPBankAccounts).build();<NEW_LINE>bpCompositeRepo.save(destinationBPartnerComposite, false);<NEW_LINE>}<NEW_LINE>bpartnerBL.updateNameAndGreetingFromContacts(newBPartnerId);<NEW_LINE>saveOrgChangeBPartnerComposite(bpartnerAndSubscriptions);<NEW_LINE>createNewSubscriptions(bpartnerAndSubscriptions, destinationBPartnerComposite);<NEW_LINE>cancelCurrentSubscriptions(bpartnerAndSubscriptions);<NEW_LINE>final OrgChangeHistoryId orgChangeHistoryId = orgChangeHistoryRepo.createOrgChangeHistory(request, orgMappingId, destinationBPartnerComposite);<NEW_LINE>createOrgSwitchRequest(orgChangeHistoryId);<NEW_LINE>} | destinationBPartnerComposite = bpCompositeRepo.getById(newBPartnerId); |
952,654 | private Mono<Response<Flux<ByteBuffer>>> migrateCassandraKeyspaceToManualThroughputWithResponseAsync(String resourceGroupName, String accountName, String keyspaceName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (accountName == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (keyspaceName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.migrateCassandraKeyspaceToManualThroughput(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, this.client.getApiVersion(), accept, context);<NEW_LINE>} | error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); |
807,846 | protected void doExecute(Configuration configuration) throws MojoExecutionException, MojoFailureException {<NEW_LINE>File packageDirectoryBase = configuration.getPackageDirectoryBase();<NEW_LINE>packageDirectoryBase.mkdirs();<NEW_LINE>ResourceGeneratorUsingModel gen = new ResourceGeneratorUsingModel(configuration.getVersion(), configuration.getBaseDir());<NEW_LINE>gen.setBaseResourceNames(configuration.getResourceNames());<NEW_LINE>try {<NEW_LINE>gen.parse();<NEW_LINE>VelocityContext ctx = new VelocityContext();<NEW_LINE>ctx.put("resources", gen.getResources());<NEW_LINE>ctx.put("packageBase", configuration.getPackageBase());<NEW_LINE>ctx.put("version", configuration.getVersion());<NEW_LINE>ctx.put("package_suffix", configuration.getPackageSuffix());<NEW_LINE>ctx.put<MASK><NEW_LINE>ctx.put("resourcePackage", configuration.getResourcePackage());<NEW_LINE>ctx.put("versionCapitalized", configuration.getVersionCapitalized());<NEW_LINE>VelocityEngine v = new VelocityEngine();<NEW_LINE>v.setProperty(RuntimeConstants.RESOURCE_LOADERS, "cp");<NEW_LINE>v.setProperty("resource.loader.cp.class", "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader");<NEW_LINE>v.setProperty("runtime.strict_mode.enable", Boolean.TRUE);<NEW_LINE>InputStream templateIs = ResourceGeneratorUsingSpreadsheet.class.getResourceAsStream(templateName);<NEW_LINE>InputStreamReader templateReader = new InputStreamReader(templateIs);<NEW_LINE>File file = new File(packageDirectoryBase, fileName);<NEW_LINE>OutputStreamWriter w = new OutputStreamWriter(new FileOutputStream(file, false), "UTF-8");<NEW_LINE>v.evaluate(ctx, w, "", templateReader);<NEW_LINE>w.close();<NEW_LINE>Resource resource = new Resource();<NEW_LINE>resource.setDirectory(packageDirectoryBase.getAbsolutePath());<NEW_LINE>// resource.setDirectory(targetDirectory.getAbsolutePath());<NEW_LINE>// resource.addInclude(packageBase);<NEW_LINE>myProject.addResource(resource);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new MojoFailureException(Msg.code(100) + "Failed to generate resources", e);<NEW_LINE>}<NEW_LINE>} | ("esc", new EscapeTool()); |
1,164,970 | private void namesChanged(ProgramModule sourceRoot, ProgramModule destRoot, ProgramModule origRoot, int conflictIndex) throws CancelledException {<NEW_LINE><MASK><NEW_LINE>String destTreeName = destRoot.getTreeName();<NEW_LINE>String origTreeName = origRoot.getTreeName();<NEW_LINE>if (onlyNamesChangedChoice == ASK_USER && conflictOption == ASK_USER && mergeManager != null) {<NEW_LINE>waitForUserInput(sourceTreeName, destTreeName, origTreeName, conflictIndex, true, false, true, false);<NEW_LINE>if (conflictOption == CANCELED) {<NEW_LINE>throw new CancelledException();<NEW_LINE>}<NEW_LINE>// If the "Use For All" check box is selected<NEW_LINE>// then save the option chosen for this conflict type.<NEW_LINE>if (mergePanel.getUseForAll()) {<NEW_LINE>onlyNamesChangedChoice = conflictOption;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int optionToUse = (onlyNamesChangedChoice == ASK_USER) ? conflictOption : onlyNamesChangedChoice;<NEW_LINE>switch(optionToUse) {<NEW_LINE>case KEEP_OTHER_NAME:<NEW_LINE>// no action required<NEW_LINE>break;<NEW_LINE>case KEEP_PRIVATE_NAME:<NEW_LINE>try {<NEW_LINE>resultListing.renameTree(destTreeName, getUniqueTreeName(sourceTreeName));<NEW_LINE>} catch (DuplicateNameException e) {<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case ADD_NEW_TREE:<NEW_LINE>createTree(resultListing, sourceTreeName, sourceRoot);<NEW_LINE>break;<NEW_LINE>case RENAME_PRIVATE:<NEW_LINE>try {<NEW_LINE>resultListing.renameTree(sourceTreeName, getUniqueTreeName(sourceTreeName));<NEW_LINE>} catch (DuplicateNameException e2) {<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case ORIGINAL_NAME:<NEW_LINE>try {<NEW_LINE>resultListing.renameTree(destTreeName, getUniqueTreeName(origTreeName));<NEW_LINE>} catch (DuplicateNameException e2) {<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case CANCELED:<NEW_LINE>throw new CancelledException();<NEW_LINE>}<NEW_LINE>conflictOption = ASK_USER;<NEW_LINE>} | String sourceTreeName = sourceRoot.getTreeName(); |
821,570 | private void loadCacertsAndCustomCerts() {<NEW_LINE>try {<NEW_LINE>KeyStore keystore = KeyStore.<MASK><NEW_LINE>InputStream keystoreStream = NzbHydra.class.getResource("/cacerts").openStream();<NEW_LINE>keystore.load(keystoreStream, null);<NEW_LINE>final File certificatesFolder = new File(NzbHydra.getDataFolder(), "certificates");<NEW_LINE>if (certificatesFolder.exists()) {<NEW_LINE>final File[] files = certificatesFolder.listFiles();<NEW_LINE>logger.info("Loading {} custom certificates", files.length);<NEW_LINE>for (File file : files) {<NEW_LINE>try (FileInputStream fileInputStream = new FileInputStream(file)) {<NEW_LINE>final Certificate certificate = CertificateFactory.getInstance("X.509").generateCertificate(fileInputStream);<NEW_LINE>logger.debug("Loading certificate in file {}", file);<NEW_LINE>keystore.setCertificateEntry(file.getName(), certificate);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>TrustManagerFactory customTrustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());<NEW_LINE>customTrustManagerFactory.init(keystore);<NEW_LINE>TrustManager[] trustManagers = customTrustManagerFactory.getTrustManagers();<NEW_LINE>caCertsContext = SSLContext.getInstance("SSL");<NEW_LINE>caCertsContext.init(null, trustManagers, null);<NEW_LINE>SSLContext.setDefault(caCertsContext);<NEW_LINE>SSLSocketFactory sslSocketFactory = caCertsContext.getSocketFactory();<NEW_LINE>defaultTrustManager = (X509TrustManager) trustManagers[0];<NEW_LINE>defaultSslSocketFactory = new SniWhitelistingSocketFactory(sslSocketFactory);<NEW_LINE>} catch (IOException | GeneralSecurityException e) {<NEW_LINE>logger.error("Unable to load packaged cacerts file", e);<NEW_LINE>}<NEW_LINE>} | getInstance(KeyStore.getDefaultType()); |
1,589,564 | final UpdateDetectorResult executeUpdateDetector(UpdateDetectorRequest updateDetectorRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateDetectorRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateDetectorRequest> request = null;<NEW_LINE>Response<UpdateDetectorResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateDetectorRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateDetectorRequest));<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, "GuardDuty");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateDetectorResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateDetectorResultJsonUnmarshaller());<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.OPERATION_NAME, "UpdateDetector"); |
974,924 | protected void onHandleIntent(Intent intent) {<NEW_LINE>// String className = intent.getStringExtra("backgroundClass");<NEW_LINE>final android.location.Location location = <MASK><NEW_LINE>if (AndroidLocationPlayServiceManager.inMemoryBackgroundLocationListener != null) {<NEW_LINE>// This is basically just a short-term location request and we are using the in-memory listeners.<NEW_LINE>AndroidLocationPlayServiceManager mgr = AndroidLocationPlayServiceManager.inMemoryBackgroundLocationListener;<NEW_LINE>mgr.onLocationChanged(location);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (intent.getDataString() == null) {<NEW_LINE>System.out.println("BackgroundLocationHandler received update without data string.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String[] params = intent.getDataString().split("[?]");<NEW_LINE>// might happen on some occasions, no need to do anything.<NEW_LINE>if (location == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// if the Display is not initialized we need to launch the CodenameOneBackgroundLocationActivity<NEW_LINE>// activity to handle this<NEW_LINE>boolean shouldStopWhenDone = false;<NEW_LINE>if (!Display.isInitialized()) {<NEW_LINE>shouldStopWhenDone = true;<NEW_LINE>AndroidImplementation.startContext(this);<NEW_LINE>// Display.init(this);<NEW_LINE>}<NEW_LINE>// else {<NEW_LINE>try {<NEW_LINE>// the 2nd parameter is the class name we need to create<NEW_LINE>LocationListener l = (LocationListener) Class.forName(params[1]).newInstance();<NEW_LINE>l.locationUpdated(AndroidLocationManager.convert(location));<NEW_LINE>} catch (Exception e) {<NEW_LINE>Log.e("Codename One", "background location error", e);<NEW_LINE>}<NEW_LINE>if (shouldStopWhenDone) {<NEW_LINE>AndroidImplementation.stopContext(this);<NEW_LINE>}<NEW_LINE>// }<NEW_LINE>} | intent.getParcelableExtra(FusedLocationProviderApi.KEY_LOCATION_CHANGED); |
675,252 | private void printParameterDeclarations(JavaWriter out, List<ParameterDefinition> parameters, boolean parametersAsField, String separator) {<NEW_LINE>for (ParameterDefinition parameter : parameters) {<NEW_LINE>final String memberName = getStrategy().getJavaMemberName(parameter);<NEW_LINE>if (scala) {<NEW_LINE>if (parametersAsField)<NEW_LINE>out.println("%s%s: %s[%s]", separator, scalaWhitespaceSuffix(memberName), Field.class, refExtendsNumberType(out, parameter.getType(resolver(out))));<NEW_LINE>else<NEW_LINE>out.println("%s%s: %s", separator, scalaWhitespaceSuffix(memberName), refNumberType(out, parameter.getType(resolver(out))));<NEW_LINE>} else if (kotlin) {<NEW_LINE>if (parametersAsField)<NEW_LINE>out.println("%s%s: %s<%s?>", separator, memberName, Field.class, refExtendsNumberType(out, parameter.getType(resolver(out))));<NEW_LINE>else<NEW_LINE>out.println("%s%s: %s%s", separator, memberName, refNumberType(out, parameter.getType(resolver(out)<MASK><NEW_LINE>} else {<NEW_LINE>if (parametersAsField)<NEW_LINE>out.println("%s%s<%s> %s", separator, Field.class, refExtendsNumberType(out, parameter.getType(resolver(out))), memberName);<NEW_LINE>else<NEW_LINE>out.println("%s%s %s", separator, refNumberType(out, parameter.getType(resolver(out))), memberName);<NEW_LINE>}<NEW_LINE>separator = ", ";<NEW_LINE>}<NEW_LINE>} | )), kotlinNullability(parameter)); |
1,544,343 | private static void findTwinMentionsRelaxed(Document doc) {<NEW_LINE>for (int sentNum = 0; sentNum < doc.goldMentions.size(); sentNum++) {<NEW_LINE>List<Mention> golds = <MASK><NEW_LINE>List<Mention> predicts = doc.predictedMentions.get(sentNum);<NEW_LINE>Map<IntPair, Mention> goldMentionPositions = Generics.newHashMap();<NEW_LINE>Map<Integer, LinkedList<Mention>> goldMentionHeadPositions = Generics.newHashMap();<NEW_LINE>for (Mention g : golds) {<NEW_LINE>goldMentionPositions.put(new IntPair(g.startIndex, g.endIndex), g);<NEW_LINE>if (!goldMentionHeadPositions.containsKey(g.headIndex)) {<NEW_LINE>goldMentionHeadPositions.put(g.headIndex, new LinkedList<>());<NEW_LINE>}<NEW_LINE>goldMentionHeadPositions.get(g.headIndex).add(g);<NEW_LINE>}<NEW_LINE>List<Mention> remains = new ArrayList<>();<NEW_LINE>for (Mention p : predicts) {<NEW_LINE>IntPair pos = new IntPair(p.startIndex, p.endIndex);<NEW_LINE>if (goldMentionPositions.containsKey(pos)) {<NEW_LINE>Mention g = goldMentionPositions.get(pos);<NEW_LINE>p.mentionID = g.mentionID;<NEW_LINE>p.hasTwin = true;<NEW_LINE>g.hasTwin = true;<NEW_LINE>goldMentionHeadPositions.get(g.headIndex).remove(g);<NEW_LINE>if (goldMentionHeadPositions.get(g.headIndex).isEmpty()) {<NEW_LINE>goldMentionHeadPositions.remove(g.headIndex);<NEW_LINE>}<NEW_LINE>} else<NEW_LINE>remains.add(p);<NEW_LINE>}<NEW_LINE>for (Mention r : remains) {<NEW_LINE>if (goldMentionHeadPositions.containsKey(r.headIndex)) {<NEW_LINE>Mention g = goldMentionHeadPositions.get(r.headIndex).poll();<NEW_LINE>r.mentionID = g.mentionID;<NEW_LINE>r.hasTwin = true;<NEW_LINE>g.hasTwin = true;<NEW_LINE>if (goldMentionHeadPositions.get(g.headIndex).isEmpty()) {<NEW_LINE>goldMentionHeadPositions.remove(g.headIndex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | doc.goldMentions.get(sentNum); |
1,392,000 | public static String generateHash(String value, byte[] hmacKey) throws NoSuchAlgorithmException, InvalidKeyException {<NEW_LINE>// Time-stamp at Encryption time<NEW_LINE>long tStamp = System.currentTimeMillis();<NEW_LINE>String uTValue = new String();<NEW_LINE>String cValue;<NEW_LINE>String finalEncValue;<NEW_LINE>// Concatenated Values<NEW_LINE>uTValue = uTValue.concat(value).concat(":").concat(Long.toString(tStamp));<NEW_LINE>cValue = uTValue;<NEW_LINE>// Digest - HMAC-SHA256<NEW_LINE>SecretKeySpec signingKey = new SecretKeySpec(hmacKey, HMAC_SHA256_ALGORITHM);<NEW_LINE>Mac mac = Mac.getInstance(HMAC_SHA256_ALGORITHM);<NEW_LINE>mac.init(signingKey);<NEW_LINE>byte[] rawHmac = mac.<MASK><NEW_LINE>String hmacString = getHex(rawHmac);<NEW_LINE>finalEncValue = Base64.getEncoder().encodeToString((cValue.concat(DELIIMITER).concat(hmacString).getBytes()));<NEW_LINE>return finalEncValue;<NEW_LINE>} | doFinal(uTValue.getBytes()); |
1,202,288 | public ProcResult fetchResult() throws AnalysisException {<NEW_LINE>final BaseProcResult result = new BaseProcResult();<NEW_LINE>final Map<String, QueryStatisticsItem> statistic = QeProcessorImpl.INSTANCE.getQueryStatistics();<NEW_LINE>result.setNames(TITLE_NAMES.asList());<NEW_LINE>final List<List<String>> sortedRowData = Lists.newArrayList();<NEW_LINE>final CurrentQueryInfoProvider provider = new CurrentQueryInfoProvider();<NEW_LINE>final Map<String, CurrentQueryInfoProvider.QueryStatistics> statisticsMap = provider.getQueryStatistics(statistic.values());<NEW_LINE>for (QueryStatisticsItem item : statistic.values()) {<NEW_LINE>final List<String> values = Lists.newArrayList();<NEW_LINE>values.add(item.getQueryId());<NEW_LINE>values.add(item.getConnId());<NEW_LINE>values.add(item.getDb());<NEW_LINE>values.add(item.getUser());<NEW_LINE>final CurrentQueryInfoProvider.QueryStatistics statistics = statisticsMap.<MASK><NEW_LINE>values.add(QueryStatisticsFormatter.getScanBytes(statistics.getScanBytes()));<NEW_LINE>values.add(QueryStatisticsFormatter.getRowsReturned(statistics.getRowsReturned()));<NEW_LINE>values.add(item.getQueryExecTime());<NEW_LINE>sortedRowData.add(values);<NEW_LINE>}<NEW_LINE>// sort according to ExecTime<NEW_LINE>sortedRowData.sort(new Comparator<List<String>>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int compare(List<String> l1, List<String> l2) {<NEW_LINE>final int execTime1 = Integer.parseInt(l1.get(EXEC_TIME_INDEX));<NEW_LINE>final int execTime2 = Integer.parseInt(l2.get(EXEC_TIME_INDEX));<NEW_LINE>return execTime1 <= execTime2 ? 1 : -1;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>result.setRows(sortedRowData);<NEW_LINE>return result;<NEW_LINE>} | get(item.getQueryId()); |
210,478 | protected void paintIcon(Graphics2D g2) {<NEW_LINE>final var s = new StringBuilder();<NEW_LINE>if (state < 0) {<NEW_LINE>s.append("\u25b6".repeat(3));<NEW_LINE>} else {<NEW_LINE>var mask = 4;<NEW_LINE>while (mask > 0) {<NEW_LINE>s.append((state & mask) == 0 ? "0" : "1");<NEW_LINE>mask >>= 1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final var f = g2.getFont().deriveFont(scale((float) 6)).deriveFont(Font.BOLD);<NEW_LINE>g2.setColor(Color.BLACK);<NEW_LINE>g2.drawRect(0, scale(4), scale(16), scale(8));<NEW_LINE>final var t = new TextLayout(s.toString(), f, g2.getFontRenderContext());<NEW_LINE>final var x = scale((float) 8) - (float) t.getBounds().getCenterX();<NEW_LINE>final var y = scale((float) 8) - (float) t<MASK><NEW_LINE>t.draw(g2, x, y);<NEW_LINE>} | .getBounds().getCenterY(); |
1,364,823 | final ListTagsForResourceResult executeListTagsForResource(ListTagsForResourceRequest listTagsForResourceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listTagsForResourceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListTagsForResourceRequest> request = null;<NEW_LINE>Response<ListTagsForResourceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListTagsForResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listTagsForResourceRequest));<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, "GuardDuty");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListTagsForResourceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListTagsForResourceResultJsonUnmarshaller());<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.OPERATION_NAME, "ListTagsForResource"); |
1,839,767 | private List<Result> partitionHits(Result result, String summaryClass) {<NEW_LINE>List<Result> parts = new ArrayList<>();<NEW_LINE>TinyIdentitySet<Query> queryMap = new TinyIdentitySet<>(4);<NEW_LINE>for (Iterator<Hit> i = hitIterator(result); i.hasNext(); ) {<NEW_LINE><MASK><NEW_LINE>if (hit instanceof FastHit) {<NEW_LINE>FastHit fastHit = (FastHit) hit;<NEW_LINE>if (!fastHit.isFilled(summaryClass)) {<NEW_LINE>Query q = fastHit.getQuery();<NEW_LINE>if (q == null) {<NEW_LINE>// fallback for untagged hits<NEW_LINE>q = result.hits().getQuery();<NEW_LINE>}<NEW_LINE>int idx = queryMap.indexOf(q);<NEW_LINE>if (idx < 0) {<NEW_LINE>idx = queryMap.size();<NEW_LINE>Result r = new Result(q);<NEW_LINE>parts.add(r);<NEW_LINE>queryMap.add(q);<NEW_LINE>}<NEW_LINE>parts.get(idx).hits().add(fastHit);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return parts;<NEW_LINE>} | Hit hit = i.next(); |
783,502 | private static <Value, Context> UnknownFieldParser<Value, Context> consumeUnknownField(UnknownFieldConsumer<Value> consumer) {<NEW_LINE>return (objectParser, field, location, parser, value, context) -> {<NEW_LINE>XContentParser.Token t = parser.currentToken();<NEW_LINE>switch(t) {<NEW_LINE>case VALUE_STRING:<NEW_LINE>consumer.accept(value, field, parser.text());<NEW_LINE>break;<NEW_LINE>case VALUE_NUMBER:<NEW_LINE>consumer.accept(value, field, parser.numberValue());<NEW_LINE>break;<NEW_LINE>case VALUE_BOOLEAN:<NEW_LINE>consumer.accept(value, <MASK><NEW_LINE>break;<NEW_LINE>case VALUE_NULL:<NEW_LINE>consumer.accept(value, field, null);<NEW_LINE>break;<NEW_LINE>case START_OBJECT:<NEW_LINE>consumer.accept(value, field, parser.map());<NEW_LINE>break;<NEW_LINE>case START_ARRAY:<NEW_LINE>consumer.accept(value, field, parser.list());<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new XContentParseException(parser.getTokenLocation(), "[" + objectParser.name + "] cannot parse field [" + field + "] with value type [" + t + "]");<NEW_LINE>}<NEW_LINE>};<NEW_LINE>} | field, parser.booleanValue()); |
1,139,273 | private void createControls() {<NEW_LINE>int shellStyle = SWT.DIALOG_TRIM | SWT.RESIZE;<NEW_LINE>if ((style & MODAL) != 0) {<NEW_LINE>shellStyle |= SWT.APPLICATION_MODAL;<NEW_LINE>}<NEW_LINE>shell = ShellFactory.createMainShell(shellStyle);<NEW_LINE>shell.setText(MessageText.getString("progress.window.title"));<NEW_LINE>Utils.setShellIcon(shell);<NEW_LINE>GridLayout gLayout = new GridLayout();<NEW_LINE>gLayout.marginHeight = 0;<NEW_LINE>gLayout.marginWidth = 0;<NEW_LINE>shell.setLayout(gLayout);<NEW_LINE>scrollable = new ScrolledComposite(shell, SWT.V_SCROLL);<NEW_LINE>scrollable.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));<NEW_LINE>scrollChild = new Composite(scrollable, SWT.NONE);<NEW_LINE>GridLayout gLayoutChild = new GridLayout();<NEW_LINE>gLayoutChild.marginHeight = 0;<NEW_LINE>gLayoutChild.marginWidth = 0;<NEW_LINE>gLayoutChild.verticalSpacing = 0;<NEW_LINE>scrollChild.setLayout(gLayoutChild);<NEW_LINE>scrollable.setContent(scrollChild);<NEW_LINE>scrollable.setExpandVertical(true);<NEW_LINE>scrollable.setExpandHorizontal(true);<NEW_LINE>scrollable.addControlListener(new ControlAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void controlResized(ControlEvent e) {<NEW_LINE>Rectangle r = scrollable.getClientArea();<NEW_LINE>scrollable.setMinSize(scrollChild.computeSize(r<MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>shell.addListener(SWT.Close, new Listener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void handleEvent(Event event) {<NEW_LINE>Control[] controls = scrollChild.getChildren();<NEW_LINE>for (int i = 0; i < controls.length; i++) {<NEW_LINE>if (controls[i] instanceof ProgressReporterPanel) {<NEW_LINE>((ProgressReporterPanel) controls[i]).removeDisposeListener(ProgressReporterWindow.this);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int i = 0; i < pReporters.length; i++) {<NEW_LINE>reportersRegistry.remove(pReporters[i]);<NEW_LINE>}<NEW_LINE>isShowingEmpty = false;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>if (pReporters.length == 0) {<NEW_LINE>createEmptyPanel();<NEW_LINE>} else {<NEW_LINE>createPanels();<NEW_LINE>}<NEW_LINE>if ((style & SHOW_TOOLBAR) != 0) {<NEW_LINE>createToolbar();<NEW_LINE>}<NEW_LINE>isAutoRemove = COConfigurationManager.getBooleanParameter("auto_remove_inactive_items");<NEW_LINE>} | .width, SWT.DEFAULT)); |
1,141,495 | public void render(@Nonnull TileIncensePlate plate, float ticks, PoseStack ms, MultiBufferSource buffers, int light, int overlay) {<NEW_LINE>ItemStack stack = plate.getItemHandler().getItem(0);<NEW_LINE>if (stack.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Direction facing = plate.getBlockState().getValue(BlockStateProperties.HORIZONTAL_FACING);<NEW_LINE>ms.pushPose();<NEW_LINE>ms.translate(0.5F, 1.5F, 0.5F);<NEW_LINE>ms.mulPose(Vector3f.YP.rotationDegrees(<MASK><NEW_LINE>float s = 0.6F;<NEW_LINE>ms.translate(-0.11F, -1.35F, 0F);<NEW_LINE>ms.scale(s, s, s);<NEW_LINE>Minecraft.getInstance().getItemRenderer().renderStatic(stack, ItemTransforms.TransformType.GROUND, light, overlay, ms, buffers, 0);<NEW_LINE>ms.popPose();<NEW_LINE>} | ROTATIONS.get(facing))); |
1,025,752 | public void generate(@NotNull Project project) {<NEW_LINE>if (ANALYZED_PROJECT_FILES.containsKey(project.getBasePath())) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>LOG = FlutterSettings.getInstance().isVerboseLogging() ? Logger.getInstance(FontPreviewProcessor.class) : null;<NEW_LINE>log("Analyzing project ", project.getName());<NEW_LINE>ANALYZED_PROJECT_FILES.put(project.getBasePath(), new THashSet<>());<NEW_LINE>ProjectManager.getInstance().addProjectManagerListener(project, new ProjectManagerListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void projectClosed(@NotNull Project project) {<NEW_LINE>clearProjectCaches(project);<NEW_LINE>ProjectManagerListener.super.projectClosed(project);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>final <MASK><NEW_LINE>final WorkItem item = new WorkItem(projectPath);<NEW_LINE>WORK_ITEMS.put(projectPath, item);<NEW_LINE>final String packagesText = FlutterSettings.getInstance().getFontPackages();<NEW_LINE>final String[] packages = packagesText.split(PACKAGE_SEPARATORS);<NEW_LINE>item.addPackages(Arrays.stream(packages).map(String::trim).filter((each) -> !each.isEmpty() || FontPreviewProcessor.UNSUPPORTED_PACKAGES.get(each) != null).collect(Collectors.toList()));<NEW_LINE>processItems(project);<NEW_LINE>} | String projectPath = project.getBasePath(); |
627,290 | public static float[] XYZtoLAB(float x, float y, float z, float[] tristimulus) {<NEW_LINE>float[] lab = new float[3];<NEW_LINE>x /= tristimulus[0];<NEW_LINE>y /= tristimulus[1];<NEW_LINE>z /= tristimulus[2];<NEW_LINE>if (x > 0.008856)<NEW_LINE>x = (float) Math.pow(x, 0.33f);<NEW_LINE>else<NEW_LINE>x = (7.787f * x) + (0.1379310344827586f);<NEW_LINE>if (y > 0.008856)<NEW_LINE>y = (float) Math.pow(y, 0.33f);<NEW_LINE>else<NEW_LINE>y = (7.787f * y) + (0.1379310344827586f);<NEW_LINE>if (z > 0.008856)<NEW_LINE>z = (float) Math.pow(z, 0.33f);<NEW_LINE>else<NEW_LINE>z = (7.787f * z) + (0.1379310344827586f);<NEW_LINE>lab[0] = (116 * y) - 16;<NEW_LINE>lab[1] <MASK><NEW_LINE>lab[2] = 200 * (y - z);<NEW_LINE>return lab;<NEW_LINE>} | = 500 * (x - y); |
413,304 | public static ListExpressCompanyResponse unmarshall(ListExpressCompanyResponse listExpressCompanyResponse, UnmarshallerContext _ctx) {<NEW_LINE>listExpressCompanyResponse.setRequestId(_ctx.stringValue("ListExpressCompanyResponse.RequestId"));<NEW_LINE>listExpressCompanyResponse.setPageSize(_ctx.integerValue("ListExpressCompanyResponse.PageSize"));<NEW_LINE>listExpressCompanyResponse.setTotalCount(_ctx.integerValue("ListExpressCompanyResponse.TotalCount"));<NEW_LINE>listExpressCompanyResponse.setPageNumber(_ctx.integerValue("ListExpressCompanyResponse.PageNumber"));<NEW_LINE>listExpressCompanyResponse.setSuccess(_ctx.booleanValue("ListExpressCompanyResponse.Success"));<NEW_LINE>List<ExpressCompanyBiz> expressCompanies = new ArrayList<ExpressCompanyBiz>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListExpressCompanyResponse.ExpressCompanies.Length"); i++) {<NEW_LINE>ExpressCompanyBiz expressCompanyBiz = new ExpressCompanyBiz();<NEW_LINE>expressCompanyBiz.setDisable(_ctx.integerValue("ListExpressCompanyResponse.ExpressCompanies[" + i + "].Disable"));<NEW_LINE>expressCompanyBiz.setUpdateDate(_ctx.stringValue("ListExpressCompanyResponse.ExpressCompanies[" + i + "].UpdateDate"));<NEW_LINE>expressCompanyBiz.setCreateDate(_ctx.stringValue("ListExpressCompanyResponse.ExpressCompanies[" + i + "].CreateDate"));<NEW_LINE>expressCompanyBiz.setExpressCompanyId(_ctx.stringValue("ListExpressCompanyResponse.ExpressCompanies[" + i + "].ExpressCompanyId"));<NEW_LINE>expressCompanyBiz.setExpressCompanyName(_ctx.stringValue("ListExpressCompanyResponse.ExpressCompanies[" + i + "].ExpressCompanyName"));<NEW_LINE>expressCompanyBiz.setExpressCompanyCode(_ctx.stringValue<MASK><NEW_LINE>expressCompanyBiz.setDescription(_ctx.stringValue("ListExpressCompanyResponse.ExpressCompanies[" + i + "].Description"));<NEW_LINE>expressCompanies.add(expressCompanyBiz);<NEW_LINE>}<NEW_LINE>listExpressCompanyResponse.setExpressCompanies(expressCompanies);<NEW_LINE>return listExpressCompanyResponse;<NEW_LINE>} | ("ListExpressCompanyResponse.ExpressCompanies[" + i + "].ExpressCompanyCode")); |
670,297 | private void analyzeSimple(Locals locals) {<NEW_LINE>AStoreable lhs = (AStoreable) this.lhs;<NEW_LINE>// If the lhs node is a def optimized node we update the actual type to remove the need for a cast.<NEW_LINE>if (lhs.isDefOptimized()) {<NEW_LINE>rhs.analyze(locals);<NEW_LINE>if (rhs.actual == void.class) {<NEW_LINE>throw createError(new IllegalArgumentException("Right-hand side cannot be a [void] type for assignment."));<NEW_LINE>}<NEW_LINE>rhs.expected = rhs.actual;<NEW_LINE>lhs.updateActual(rhs.actual);<NEW_LINE>// Otherwise, we must adapt the rhs type to the lhs type with a cast.<NEW_LINE>} else {<NEW_LINE>rhs.expected = lhs.actual;<NEW_LINE>rhs.analyze(locals);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>this.statement = true;<NEW_LINE>this.actual = read ? lhs.actual : void.class;<NEW_LINE>} | rhs = rhs.cast(locals); |
1,548,410 | private Mono<Response<Flux<ByteBuffer>>> deleteWithResponseAsync(String resourceGroupName, String registryName, String replicationName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (registryName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (replicationName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter replicationName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String apiVersion = "2021-09-01";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, registryName, replicationName, context);<NEW_LINE>} | error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); |
41,979 | private Position decodeAlternative(Channel channel, SocketAddress remoteAddress, String sentence) {<NEW_LINE>Parser parser <MASK><NEW_LINE>if (!parser.matches()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, parser.next());<NEW_LINE>if (deviceSession == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Position position = new Position(getProtocolName());<NEW_LINE>position.setDeviceId(deviceSession.getDeviceId());<NEW_LINE>position.set(Position.KEY_EVENT, parser.next());<NEW_LINE>position.set("sensorId", parser.next());<NEW_LINE>position.set("sensorVoltage", parser.nextDouble());<NEW_LINE>position.setTime(parser.nextDateTime(Parser.DateTimeFormat.HMS_DMY));<NEW_LINE>position.set(Position.KEY_RSSI, parser.nextInt());<NEW_LINE>position.setValid(parser.nextInt() > 0);<NEW_LINE>position.setLatitude(parser.nextDouble());<NEW_LINE>position.setLongitude(parser.nextDouble());<NEW_LINE>position.setSpeed(UnitsConverter.knotsFromKph(parser.nextInt()));<NEW_LINE>position.setCourse(parser.nextInt());<NEW_LINE>position.setAltitude(parser.nextInt());<NEW_LINE>position.set(Position.KEY_HDOP, parser.nextDouble());<NEW_LINE>position.set(Position.KEY_SATELLITES, parser.nextInt());<NEW_LINE>position.set(Position.KEY_IGNITION, parser.nextInt() > 0);<NEW_LINE>position.set(Position.KEY_CHARGE, parser.nextInt() > 0);<NEW_LINE>position.set("error", parser.next());<NEW_LINE>return position;<NEW_LINE>} | = new Parser(PATTERN_ALT, sentence); |
1,478,845 | private CompletableFuture<TableWriterFlushResult> flushOnce(DirectSegmentAccess segment, TimeoutTimer timer) {<NEW_LINE>// Index all the keys in the segment range pointed to by the aggregator.<NEW_LINE>long lastOffset = this.aggregator.getLastIndexToProcessAtOnce(this.connector.getMaxFlushSize());<NEW_LINE>assert lastOffset - this.aggregator.getFirstOffset() <= this.connector.getMaxFlushSize();<NEW_LINE>if (lastOffset < this.aggregator.getLastOffset()) {<NEW_LINE>log.info("{}: Partial flush initiated up to offset {}. State: {}.", this.traceObjectId, lastOffset, this.aggregator);<NEW_LINE>}<NEW_LINE>KeyUpdateCollection keyUpdates = readKeysFromSegment(segment, this.aggregator.getFirstOffset(), lastOffset, timer);<NEW_LINE>log.debug("{}: Flush.ReadFromSegment KeyCount={}, UpdateCount={}, HighestCopiedOffset={}, LastIndexedOffset={}.", this.traceObjectId, keyUpdates.getUpdates().size(), keyUpdates.getTotalUpdateCount(), keyUpdates.getHighestCopiedOffset(), keyUpdates.getLastIndexedOffset());<NEW_LINE>// Group keys by their assigned TableBucket (whether existing or not), then fetch all existing keys<NEW_LINE>// for each such bucket and finally (reindex) update the bucket.<NEW_LINE>return this.indexWriter.groupByBucket(segment, keyUpdates.getUpdates(), timer).thenComposeAsync(builders -> fetchExistingKeys(builders, segment, timer).thenComposeAsync(v -> {<NEW_LINE>val bucketUpdates = builders.stream().map(BucketUpdate.Builder::build).collect(Collectors.toList());<NEW_LINE>logBucketUpdates(bucketUpdates);<NEW_LINE>return this.indexWriter.updateBuckets(segment, bucketUpdates, this.aggregator.getLastIndexedOffset(), keyUpdates.getLastIndexedOffset(), keyUpdates.getTotalUpdateCount(), timer.getRemaining());<NEW_LINE>}, this.executor), this.executor).thenApply(updateCount -> <MASK><NEW_LINE>} | new TableWriterFlushResult(keyUpdates, updateCount)); |
947,962 | public void buildEndStopRow(@NonNull View view, Drawable icon, String timeText, final Spannable title, Spannable secondaryText, OnClickListener onClickListener) {<NEW_LINE>OsmandApplication app = requireMyApplication();<NEW_LINE>FrameLayout baseItemView = new <MASK><NEW_LINE>FrameLayout.LayoutParams baseViewLayoutParams = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);<NEW_LINE>baseItemView.setLayoutParams(baseViewLayoutParams);<NEW_LINE>LinearLayout baseView = new LinearLayout(view.getContext());<NEW_LINE>baseView.setOrientation(LinearLayout.VERTICAL);<NEW_LINE>baseView.setLayoutParams(baseViewLayoutParams);<NEW_LINE>baseView.setGravity(Gravity.END);<NEW_LINE>baseView.setBackgroundResource(AndroidUtils.resolveAttribute(view.getContext(), android.R.attr.selectableItemBackground));<NEW_LINE>baseItemView.addView(baseView);<NEW_LINE>LinearLayout ll = buildHorizontalContainerView(view.getContext(), 48, new OnLongClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean onLongClick(View v) {<NEW_LINE>copyToClipboard(title.toString(), v.getContext());<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>baseView.addView(ll);<NEW_LINE>if (icon != null) {<NEW_LINE>ImageView iconView = new ImageView(view.getContext());<NEW_LINE>iconView.setImageDrawable(icon);<NEW_LINE>FrameLayout.LayoutParams imageViewLayoutParams = new FrameLayout.LayoutParams(dpToPx(28), dpToPx(28));<NEW_LINE>imageViewLayoutParams.gravity = Gravity.TOP | Gravity.START;<NEW_LINE>iconView.setLayoutParams(imageViewLayoutParams);<NEW_LINE>iconView.setScaleType(ImageView.ScaleType.CENTER_INSIDE);<NEW_LINE>AndroidUtils.setMargins(imageViewLayoutParams, dpToPx(14), dpToPx(8), dpToPx(22), 0);<NEW_LINE>iconView.setBackgroundResource(R.drawable.border_round_solid_light);<NEW_LINE>AndroidUtils.setPadding(iconView, dpToPx(2), dpToPx(2), dpToPx(2), dpToPx(2));<NEW_LINE>baseItemView.addView(iconView);<NEW_LINE>}<NEW_LINE>LinearLayout llText = buildTextContainerView(view.getContext());<NEW_LINE>ll.addView(llText);<NEW_LINE>if (!TextUtils.isEmpty(secondaryText)) {<NEW_LINE>buildDescriptionView(secondaryText, llText, 8, 0);<NEW_LINE>}<NEW_LINE>buildTitleView(title, llText);<NEW_LINE>if (!TextUtils.isEmpty(timeText)) {<NEW_LINE>TextView timeView = new TextView(view.getContext());<NEW_LINE>FrameLayout.LayoutParams timeViewParams = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);<NEW_LINE>timeViewParams.gravity = Gravity.END | Gravity.TOP;<NEW_LINE>AndroidUtils.setMargins(timeViewParams, 0, dpToPx(8), 0, 0);<NEW_LINE>timeView.setLayoutParams(timeViewParams);<NEW_LINE>AndroidUtils.setPadding(timeView, 0, 0, dpToPx(16), 0);<NEW_LINE>timeView.setTextSize(16);<NEW_LINE>timeView.setTextColor(getMainFontColor());<NEW_LINE>timeView.setText(timeText);<NEW_LINE>baseItemView.addView(timeView);<NEW_LINE>}<NEW_LINE>if (onClickListener != null) {<NEW_LINE>ll.setOnClickListener(onClickListener);<NEW_LINE>}<NEW_LINE>((LinearLayout) view).addView(baseItemView);<NEW_LINE>} | FrameLayout(view.getContext()); |
37,883 | private Map<String, Object> doCheck() {<NEW_LINE>String domainString;<NEW_LINE>InternetDomainName domainName;<NEW_LINE>try {<NEW_LINE>domainString <MASK><NEW_LINE>domainName = validateDomainName(domainString);<NEW_LINE>} catch (IllegalArgumentException | EppException e) {<NEW_LINE>metricBuilder.status(INVALID_NAME);<NEW_LINE>return fail("Must supply a valid domain name on an authoritative TLD");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>// Throws an EppException with a reasonable error message which will be sent back to caller.<NEW_LINE>validateDomainNameWithIdnTables(domainName);<NEW_LINE>DateTime now = clock.nowUtc();<NEW_LINE>Registry registry = Registry.get(domainName.parent().toString());<NEW_LINE>try {<NEW_LINE>verifyNotInPredelegation(registry, now);<NEW_LINE>} catch (BadCommandForRegistryPhaseException e) {<NEW_LINE>metricBuilder.status(INVALID_REGISTRY_PHASE);<NEW_LINE>return fail("Check in this TLD is not allowed in the current registry phase");<NEW_LINE>}<NEW_LINE>boolean isRegistered = checkExists(domainString, now);<NEW_LINE>Optional<String> reservedError = Optional.empty();<NEW_LINE>boolean isReserved = false;<NEW_LINE>if (!isRegistered) {<NEW_LINE>reservedError = checkReserved(domainName);<NEW_LINE>isReserved = reservedError.isPresent();<NEW_LINE>}<NEW_LINE>Availability availability = isRegistered ? REGISTERED : (isReserved ? RESERVED : AVAILABLE);<NEW_LINE>String errorMsg = isRegistered ? "In use" : (isReserved ? reservedError.get() : null);<NEW_LINE>ImmutableMap.Builder<String, Object> responseBuilder = new ImmutableMap.Builder<>();<NEW_LINE>metricBuilder.status(SUCCESS).availability(availability);<NEW_LINE>responseBuilder.put("status", "success").put("available", availability.equals(AVAILABLE));<NEW_LINE>boolean isPremium = isDomainPremium(domainString, now);<NEW_LINE>metricBuilder.tier(isPremium ? PREMIUM : STANDARD);<NEW_LINE>responseBuilder.put("tier", isPremium ? "premium" : "standard");<NEW_LINE>if (!AVAILABLE.equals(availability)) {<NEW_LINE>responseBuilder.put("reason", errorMsg);<NEW_LINE>}<NEW_LINE>return responseBuilder.build();<NEW_LINE>} catch (InvalidIdnDomainLabelException e) {<NEW_LINE>metricBuilder.status(INVALID_NAME);<NEW_LINE>return fail(e.getResult().getMsg());<NEW_LINE>} catch (Exception e) {<NEW_LINE>metricBuilder.status(UNKNOWN_ERROR);<NEW_LINE>logger.atWarning().withCause(e).log("Unknown error.");<NEW_LINE>return fail("Invalid request");<NEW_LINE>}<NEW_LINE>} | = canonicalizeDomainName(nullToEmpty(domain)); |
69,330 | private final void loadQtysIfNeeded() {<NEW_LINE>final IUOMDAO uomDAO = Services.get(IUOMDAO.class);<NEW_LINE>if (_loaded) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final I_M_InOutLine firstInOutLine = inOutLines.get(0);<NEW_LINE>//<NEW_LINE>// Vendor Product<NEW_LINE>final <MASK><NEW_LINE>final UomId productUomId = UomId.ofRepoIdOrNull(_product.getC_UOM_ID());<NEW_LINE>Check.assumeNotNull(productUomId, "UomId of product={} may not be null", _product);<NEW_LINE>// Define the conversion context (in case we need it)<NEW_LINE>final UOMConversionContext uomConversionCtx = UOMConversionContext.of(ProductId.ofRepoId(_product.getM_Product_ID()));<NEW_LINE>//<NEW_LINE>// UOM<NEW_LINE>final UomId qtyReceivedTotalUomId = UomId.ofRepoId(firstInOutLine.getC_UOM_ID());<NEW_LINE>//<NEW_LINE>// Iterate Receipt Lines linked to this invoice candidate, extract & aggregate informations from them<NEW_LINE>BigDecimal qtyReceivedTotal = BigDecimal.ZERO;<NEW_LINE>IHandlingUnitsInfo handlingUnitsInfoTotal = null;<NEW_LINE>final ILoggable loggable = Loggables.withLogger(logger, Level.DEBUG);<NEW_LINE>for (final I_M_InOutLine inoutLine : inOutLines) {<NEW_LINE>if (inoutLine.getM_Product_ID() != productId) {<NEW_LINE>loggable.addLog("Not counting {} because its M_Product_ID={} is not the ID of product {}", new Object[] { inoutLine, inoutLine.getM_Product_ID(), _product });<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>final I_M_InOut inOutRecord = inoutLine.getM_InOut();<NEW_LINE>// task 09117: we only may count iol that are not reversed, in progress of otherwise "not relevant"<NEW_LINE>final I_M_InOut inout = inoutLine.getM_InOut();<NEW_LINE>final DocStatus inoutDocStatus = DocStatus.ofCode(inout.getDocStatus());<NEW_LINE>if (!inoutDocStatus.isCompletedOrClosed()) {<NEW_LINE>loggable.addLog("Not counting {} because its M_InOut has docstatus {}", inoutLine, inOutRecord.getDocStatus());<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>final BigDecimal qtyReceived = inoutBL.negateIfReturnMovmenType(inoutLine, inoutLine.getMovementQty());<NEW_LINE>logger.debug("M_InOut_ID={} has MovementType={}; -> proceeding with qtyReceived={}", inOutRecord.getM_InOut_ID(), inOutRecord.getMovementType(), qtyReceived);<NEW_LINE>final BigDecimal qtyReceivedConv = uomConversionBL.convertQty(uomConversionCtx, qtyReceived, productUomId, qtyReceivedTotalUomId);<NEW_LINE>qtyReceivedTotal = qtyReceivedTotal.add(qtyReceivedConv);<NEW_LINE>final IHandlingUnitsInfo handlingUnitsInfo = handlingUnitsInfoFactory.createFromModel(inoutLine);<NEW_LINE>if (handlingUnitsInfo == null) {<NEW_LINE>// do nothing<NEW_LINE>}<NEW_LINE>if (handlingUnitsInfoTotal == null) {<NEW_LINE>handlingUnitsInfoTotal = handlingUnitsInfo;<NEW_LINE>} else {<NEW_LINE>handlingUnitsInfoTotal = handlingUnitsInfoTotal.add(handlingUnitsInfo);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Set loaded values<NEW_LINE>_qtyReceived = qtyReceivedTotal;<NEW_LINE>_qtyReceivedUOM = uomDAO.getById(qtyReceivedTotalUomId);<NEW_LINE>_handlingUnitsInfo = handlingUnitsInfoTotal;<NEW_LINE>_loaded = true;<NEW_LINE>} | int productId = _product.getM_Product_ID(); |
965,881 | public JavaScriptNode enterCallNode(CallNode callNode) {<NEW_LINE>JavaScriptNode function = transform(callNode.getFunction());<NEW_LINE>JavaScriptNode[] args = transformArgs(callNode.getArgs());<NEW_LINE>if (callNode.isOptionalChain()) {<NEW_LINE>function = filterOptionalChainTarget(function, callNode.isOptional());<NEW_LINE>}<NEW_LINE>JavaScriptNode call;<NEW_LINE>if (callNode.isEval() && args.length >= 1) {<NEW_LINE>call = createCallEvalNode(function, args);<NEW_LINE>} else if (callNode.isApplyArguments() && currentFunction().isDirectArgumentsAccess()) {<NEW_LINE>call = createCallApplyArgumentsNode(function, args);<NEW_LINE>} else if (callNode.getFunction() instanceof IdentNode && ((IdentNode) callNode.getFunction()).isDirectSuper()) {<NEW_LINE>call = createCallDirectSuper(function, <MASK><NEW_LINE>} else if (callNode.isImport()) {<NEW_LINE>call = createImportCallNode(args);<NEW_LINE>} else {<NEW_LINE>call = factory.createFunctionCall(context, function, args);<NEW_LINE>}<NEW_LINE>tagExpression(tagCall(call), callNode);<NEW_LINE>if (callNode.isOptionalChain()) {<NEW_LINE>call = factory.createOptionalChain(call);<NEW_LINE>}<NEW_LINE>return call;<NEW_LINE>} | args, callNode.isDefaultDerivedConstructorSuperCall()); |
295,434 | protected void bindTyped() {<NEW_LINE>if (currentPG == null) {<NEW_LINE>setRenderer(primaryPG.getCurrentPG());<NEW_LINE>loadAttributes();<NEW_LINE>loadUniforms();<NEW_LINE>}<NEW_LINE>setCommonUniforms();<NEW_LINE>if (-1 < vertexLoc)<NEW_LINE>pgl.enableVertexAttribArray(vertexLoc);<NEW_LINE>if (-1 < colorLoc)<NEW_LINE>pgl.enableVertexAttribArray(colorLoc);<NEW_LINE>if (-1 < texCoordLoc)<NEW_LINE>pgl.enableVertexAttribArray(texCoordLoc);<NEW_LINE>if (-1 < normalLoc)<NEW_LINE>pgl.enableVertexAttribArray(normalLoc);<NEW_LINE>if (-1 < normalMatLoc) {<NEW_LINE>currentPG.updateGLNormal();<NEW_LINE>setUniformMatrix(normalMatLoc, currentPG.glNormal);<NEW_LINE>}<NEW_LINE>if (-1 < ambientLoc)<NEW_LINE>pgl.enableVertexAttribArray(ambientLoc);<NEW_LINE>if (-1 < specularLoc)<NEW_LINE>pgl.enableVertexAttribArray(specularLoc);<NEW_LINE>if (-1 < emissiveLoc)<NEW_LINE>pgl.enableVertexAttribArray(emissiveLoc);<NEW_LINE>if (-1 < shininessLoc)<NEW_LINE>pgl.enableVertexAttribArray(shininessLoc);<NEW_LINE>int count = currentPG.lightCount;<NEW_LINE>setUniformValue(lightCountLoc, count);<NEW_LINE>if (0 < count) {<NEW_LINE>setUniformVector(lightPositionLoc, currentPG.lightPosition, 4, count);<NEW_LINE>setUniformVector(lightNormalLoc, currentPG.lightNormal, 3, count);<NEW_LINE>setUniformVector(lightAmbientLoc, currentPG.lightAmbient, 3, count);<NEW_LINE>setUniformVector(lightDiffuseLoc, currentPG.lightDiffuse, 3, count);<NEW_LINE>setUniformVector(lightSpecularLoc, currentPG.lightSpecular, 3, count);<NEW_LINE>setUniformVector(lightFalloffLoc, currentPG.lightFalloffCoefficients, 3, count);<NEW_LINE>setUniformVector(lightSpotLoc, currentPG.lightSpotParameters, 2, count);<NEW_LINE>}<NEW_LINE>if (-1 < directionLoc)<NEW_LINE>pgl.enableVertexAttribArray(directionLoc);<NEW_LINE>if (-1 < offsetLoc)<NEW_LINE>pgl.enableVertexAttribArray(offsetLoc);<NEW_LINE>if (-1 < perspectiveLoc) {<NEW_LINE>if (currentPG.getHint(ENABLE_STROKE_PERSPECTIVE) && currentPG.nonOrthoProjection()) {<NEW_LINE>setUniformValue(perspectiveLoc, 1);<NEW_LINE>} else {<NEW_LINE>setUniformValue(perspectiveLoc, 0);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (-1 < scaleLoc) {<NEW_LINE>if (currentPG.getHint(DISABLE_OPTIMIZED_STROKE)) {<NEW_LINE>setUniformValue(scaleLoc, 1.0f, 1.0f, 1.0f);<NEW_LINE>} else {<NEW_LINE>float f = PGL.STROKE_DISPLACEMENT;<NEW_LINE>if (currentPG.orthoProjection()) {<NEW_LINE>setUniformValue(<MASK><NEW_LINE>} else {<NEW_LINE>setUniformValue(scaleLoc, f, f, f);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | scaleLoc, 1, 1, f); |
55,798 | Collection<InferenceVariable> inputVariables(final InferenceContext18 context) {<NEW_LINE>// from 18.5.2.<NEW_LINE>if (this.left instanceof LambdaExpression) {<NEW_LINE>if (this.right instanceof InferenceVariable) {<NEW_LINE>return Collections.singletonList((InferenceVariable) this.right);<NEW_LINE>}<NEW_LINE>if (this.right.isFunctionalInterface(context.scope)) {<NEW_LINE>LambdaExpression lambda = (LambdaExpression) this.left;<NEW_LINE>// TODO derive with target type?<NEW_LINE>MethodBinding sam = this.right.getSingleAbstractMethod(context.scope, true);<NEW_LINE>final Set<InferenceVariable> variables = new HashSet<>();<NEW_LINE>if (lambda.argumentsTypeElided()) {<NEW_LINE>// i)<NEW_LINE>int len = sam.parameters.length;<NEW_LINE>for (int i = 0; i < len; i++) {<NEW_LINE>sam.parameters<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (sam.returnType != TypeBinding.VOID) {<NEW_LINE>// ii)<NEW_LINE>sam.returnType.collectInferenceVariables(variables);<NEW_LINE>}<NEW_LINE>return variables;<NEW_LINE>}<NEW_LINE>} else if (this.left instanceof ReferenceExpression) {<NEW_LINE>if (this.right instanceof InferenceVariable) {<NEW_LINE>return Collections.singletonList((InferenceVariable) this.right);<NEW_LINE>}<NEW_LINE>if (this.right.isFunctionalInterface(context.scope)) {<NEW_LINE>// TODO: && this.left is inexact<NEW_LINE>// TODO derive with target type?<NEW_LINE>MethodBinding sam = this.right.getSingleAbstractMethod(context.scope, true);<NEW_LINE>final Set<InferenceVariable> variables = new HashSet<>();<NEW_LINE>int len = sam.parameters.length;<NEW_LINE>for (int i = 0; i < len; i++) {<NEW_LINE>sam.parameters[i].collectInferenceVariables(variables);<NEW_LINE>}<NEW_LINE>sam.returnType.collectInferenceVariables(variables);<NEW_LINE>return variables;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return EMPTY_VARIABLE_LIST;<NEW_LINE>} | [i].collectInferenceVariables(variables); |
324,863 | public boolean apply(Game game, Ability source) {<NEW_LINE>Permanent permanent = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);<NEW_LINE>if (permanent != null) {<NEW_LINE>Player player = game.<MASK><NEW_LINE>if (player != null) {<NEW_LINE>Library library = player.getLibrary();<NEW_LINE>if (library.hasCards()) {<NEW_LINE>Cards cards = new CardsImpl();<NEW_LINE>Card toBattlefield = null;<NEW_LINE>for (Card card : library.getCards(game)) {<NEW_LINE>cards.add(card);<NEW_LINE>if (card.isCreature(game)) {<NEW_LINE>toBattlefield = card;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (toBattlefield != null) {<NEW_LINE>player.moveCards(toBattlefield, Zone.BATTLEFIELD, source, game);<NEW_LINE>}<NEW_LINE>player.revealCards(source, cards, game);<NEW_LINE>cards.remove(toBattlefield);<NEW_LINE>if (!cards.isEmpty()) {<NEW_LINE>player.shuffleLibrary(source, game);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | getPlayer(permanent.getControllerId()); |
269,006 | private void writeGroup(JRGroup group) {<NEW_LINE>String groupName = group.getName();<NEW_LINE>groupsMap.put(groupName, groupName);<NEW_LINE>write("JRDesignGroup " + groupName + " = new JRDesignGroup();\n");<NEW_LINE>write(groupName + ".setName(\"" + JRStringUtil.escapeJavaStringLiteral(groupName) + "\");\n");<NEW_LINE>write(groupName + ".setStartNewColumn({0});\n", group.isStartNewColumn(), false);<NEW_LINE>write(groupName + ".setStartNewPage({0});\n", <MASK><NEW_LINE>write(groupName + ".setReprintHeaderOnEachPage({0});\n", group.isReprintHeaderOnEachPage(), false);<NEW_LINE>write(groupName + ".setReprintHeaderOnEachColumn({0});\n", group.isReprintHeaderOnEachColumn(), false);<NEW_LINE>write(groupName + ".setMinHeightToStartNewPage({0});\n", group.getMinHeightToStartNewPage());<NEW_LINE>write(groupName + ".setMinDetailsToStartFromTop({0});\n", group.getMinDetailsToStartFromTop());<NEW_LINE>write(groupName + ".setFooterPosition({0});\n", group.getFooterPositionValue(), FooterPositionEnum.NORMAL);<NEW_LINE>write(groupName + ".setKeepTogether({0});\n", group.isKeepTogether(), false);<NEW_LINE>write(groupName + ".setPreventOrphanFooter({0});\n", group.isPreventOrphanFooter(), false);<NEW_LINE>writeExpression(group.getExpression(), groupName, "Expression");<NEW_LINE>JRSection groupHeader = group.getGroupHeaderSection();<NEW_LINE>if (groupHeader != null) {<NEW_LINE>writeSection(groupHeader, groupName + "Header", "((JRDesignSection)" + groupName + ".getGroupHeaderSection()).getBandsList()");<NEW_LINE>}<NEW_LINE>JRSection groupFooter = group.getGroupFooterSection();<NEW_LINE>if (groupFooter != null) {<NEW_LINE>writeSection(groupFooter, groupName + "Footer", "((JRDesignSection)" + groupName + ".getGroupFooterSection()).getBandsList()");<NEW_LINE>}<NEW_LINE>flush();<NEW_LINE>} | group.isStartNewPage(), false); |
321,097 | final ListRealtimeLogConfigsResult executeListRealtimeLogConfigs(ListRealtimeLogConfigsRequest listRealtimeLogConfigsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listRealtimeLogConfigsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListRealtimeLogConfigsRequest> request = null;<NEW_LINE>Response<ListRealtimeLogConfigsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListRealtimeLogConfigsRequestMarshaller().marshall(super.beforeMarshalling(listRealtimeLogConfigsRequest));<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, "CloudFront");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListRealtimeLogConfigs");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<ListRealtimeLogConfigsResult> responseHandler = new StaxResponseHandler<ListRealtimeLogConfigsResult>(new ListRealtimeLogConfigsResultStaxUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | invoke(request, responseHandler, executionContext); |
475,674 | private static Map<String, Object> buildContextPropertiesMap(int agentInstanceId, Object[] allPartitionKeys, ContextDefinition contextDefinition) {<NEW_LINE>Map<String, Object> props = new HashMap<>();<NEW_LINE>props.put(ContextPropertyEventType.PROP_CTX_NAME, contextDefinition.getContextName());<NEW_LINE>props.<MASK><NEW_LINE>ContextControllerFactory[] controllerFactories = contextDefinition.getControllerFactories();<NEW_LINE>if (controllerFactories.length == 1) {<NEW_LINE>controllerFactories[0].populateContextProperties(props, allPartitionKeys[0]);<NEW_LINE>return props;<NEW_LINE>}<NEW_LINE>for (int level = 0; level < controllerFactories.length; level++) {<NEW_LINE>String nestedContextName = controllerFactories[level].getFactoryEnv().getContextName();<NEW_LINE>Map<String, Object> nestedProps = new HashMap<>();<NEW_LINE>nestedProps.put(ContextPropertyEventType.PROP_CTX_NAME, nestedContextName);<NEW_LINE>if (level == controllerFactories.length - 1) {<NEW_LINE>nestedProps.put(ContextPropertyEventType.PROP_CTX_ID, agentInstanceId);<NEW_LINE>}<NEW_LINE>controllerFactories[level].populateContextProperties(nestedProps, allPartitionKeys[level]);<NEW_LINE>props.put(nestedContextName, nestedProps);<NEW_LINE>}<NEW_LINE>return props;<NEW_LINE>} | put(ContextPropertyEventType.PROP_CTX_ID, agentInstanceId); |
431,732 | final public String String() throws ParseException {<NEW_LINE>Token t;<NEW_LINE>String lex;<NEW_LINE>switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {<NEW_LINE>case STRING_LITERAL1:<NEW_LINE>{<NEW_LINE>t = jj_consume_token(STRING_LITERAL1);<NEW_LINE>lex = stripQuotes(t.image);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case STRING_LITERAL2:<NEW_LINE>{<NEW_LINE>t = jj_consume_token(STRING_LITERAL2);<NEW_LINE>lex = stripQuotes(t.image);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case STRING_LITERAL_LONG1:<NEW_LINE>{<NEW_LINE>t = jj_consume_token(STRING_LITERAL_LONG1);<NEW_LINE>lex = stripQuotes3(t.image);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case STRING_LITERAL_LONG2:<NEW_LINE>{<NEW_LINE>t = jj_consume_token(STRING_LITERAL_LONG2);<NEW_LINE><MASK><NEW_LINE>break;<NEW_LINE>}<NEW_LINE>default:<NEW_LINE>jj_la1[161] = jj_gen;<NEW_LINE>jj_consume_token(-1);<NEW_LINE>throw new ParseException();<NEW_LINE>}<NEW_LINE>checkString(lex, t.beginLine, t.beginColumn);<NEW_LINE>lex = unescapeStr(lex, t.beginLine, t.beginColumn);<NEW_LINE>{<NEW_LINE>if ("" != null)<NEW_LINE>return lex;<NEW_LINE>}<NEW_LINE>throw new Error("Missing return statement in function");<NEW_LINE>} | lex = stripQuotes3(t.image); |
1,758,761 | public void downloadToFile() {<NEW_LINE>// BEGIN: com.azure.storage.blob.BlobClient.downloadToFile#String<NEW_LINE>client.downloadToFile(file);<NEW_LINE>System.out.println("Completed download to file");<NEW_LINE>// END: com.azure.storage.blob.BlobClient.downloadToFile#String<NEW_LINE>// BEGIN: com.azure.storage.blob.BlobClient.downloadToFileWithResponse#String-BlobRange-ParallelTransferOptions-DownloadRetryOptions-BlobRequestConditions-boolean-Duration-Context<NEW_LINE>BlobRange range <MASK><NEW_LINE>DownloadRetryOptions options = new DownloadRetryOptions().setMaxRetryRequests(5);<NEW_LINE>client.downloadToFileWithResponse(file, range, new ParallelTransferOptions().setBlockSizeLong(4L * Constants.MB), options, null, false, timeout, new Context(key2, value2));<NEW_LINE>System.out.println("Completed download to file");<NEW_LINE>// END: com.azure.storage.blob.BlobClient.downloadToFileWithResponse#String-BlobRange-ParallelTransferOptions-DownloadRetryOptions-BlobRequestConditions-boolean-Duration-Context<NEW_LINE>} | = new BlobRange(1024, 2048L); |
742,727 | // TODO: replace with MethodLevelExceptionMappingFeature<NEW_LINE>@BuildStep<NEW_LINE>void handleClassLevelExceptionMappers(Optional<ResourceScanningResultBuildItem> resourceScanningResultBuildItem, BuildProducer<GeneratedClassBuildItem> generatedClass, BuildProducer<ReflectiveClassBuildItem> reflectiveClass, BuildProducer<ClassLevelExceptionMappersBuildItem> classLevelExceptionMappers) {<NEW_LINE>if (!resourceScanningResultBuildItem.isPresent()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<MethodInfo> methodExceptionMapper = resourceScanningResultBuildItem.get().getResult().getClassLevelExceptionMappers();<NEW_LINE>if (methodExceptionMapper.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>GeneratedClassGizmoAdaptor classOutput = new GeneratedClassGizmoAdaptor(generatedClass, true);<NEW_LINE>final Map<DotName, Map<String, String>> resultingMappers = new HashMap<<MASK><NEW_LINE>for (MethodInfo methodInfo : methodExceptionMapper) {<NEW_LINE>Map<String, String> generationResult = ServerExceptionMapperGenerator.generatePerClassMapper(methodInfo, classOutput, Set.of(HTTP_SERVER_REQUEST, HTTP_SERVER_RESPONSE, ROUTING_CONTEXT), Set.of(Unremovable.class.getName()));<NEW_LINE>reflectiveClass.produce(new ReflectiveClassBuildItem(true, false, false, generationResult.values().toArray(new String[0])));<NEW_LINE>Map<String, String> classMappers;<NEW_LINE>DotName classDotName = methodInfo.declaringClass().name();<NEW_LINE>if (resultingMappers.containsKey(classDotName)) {<NEW_LINE>classMappers = resultingMappers.get(classDotName);<NEW_LINE>} else {<NEW_LINE>classMappers = new HashMap<>();<NEW_LINE>resultingMappers.put(classDotName, classMappers);<NEW_LINE>}<NEW_LINE>classMappers.putAll(generationResult);<NEW_LINE>}<NEW_LINE>classLevelExceptionMappers.produce(new ClassLevelExceptionMappersBuildItem(resultingMappers));<NEW_LINE>} | >(methodExceptionMapper.size()); |
1,047,900 | protected List<Contentlet> findContentletsByIdentifier(String identifier, Boolean live, Long languageId) throws DotDataException, DotStateException, DotSecurityException {<NEW_LINE>final List<Contentlet> contentlets = new ArrayList<>();<NEW_LINE>final StringBuilder queryBuffer = new StringBuilder();<NEW_LINE><MASK><NEW_LINE>queryBuffer.append("select contentlet.*, contentlet_1_.owner ").append("from contentlet, inode contentlet_1_, contentlet_version_info contentvi ").append("where contentlet_1_.type = 'contentlet' and contentlet.inode = contentlet_1_.inode and ").append("contentvi.identifier=contentlet.identifier and ").append(((live != null && live.booleanValue()) ? "contentvi.live_inode" : "contentvi.working_inode")).append(" = contentlet_1_.inode ");<NEW_LINE>if (languageId != null) {<NEW_LINE>queryBuffer.append(" and contentvi.lang = ? ");<NEW_LINE>}<NEW_LINE>queryBuffer.append(" and contentlet.identifier = ? ");<NEW_LINE>dotConnect.setSQL(queryBuffer.toString());<NEW_LINE>if (languageId != null) {<NEW_LINE>dotConnect.addParam(languageId.longValue());<NEW_LINE>}<NEW_LINE>dotConnect.addParam(identifier);<NEW_LINE>final List<Contentlet> result = TransformerLocator.createContentletTransformer(dotConnect.loadObjectResults()).asList();<NEW_LINE>result.forEach(contentlet -> contentletCache.add(String.valueOf(contentlet.getInode()), contentlet));<NEW_LINE>return result;<NEW_LINE>} | final DotConnect dotConnect = new DotConnect(); |
823,939 | public static ListCabInstancesResponse unmarshall(ListCabInstancesResponse listCabInstancesResponse, UnmarshallerContext context) {<NEW_LINE>listCabInstancesResponse.setRequestId(context.stringValue("ListCabInstancesResponse.RequestId"));<NEW_LINE>listCabInstancesResponse.setSuccess(context.booleanValue("ListCabInstancesResponse.Success"));<NEW_LINE>listCabInstancesResponse.setCode(context.stringValue("ListCabInstancesResponse.Code"));<NEW_LINE>listCabInstancesResponse.setMessage(context.stringValue("ListCabInstancesResponse.Message"));<NEW_LINE>listCabInstancesResponse.setHttpStatusCode(context.integerValue("ListCabInstancesResponse.HttpStatusCode"));<NEW_LINE>List<AgentBotInstance> instances = new ArrayList<AgentBotInstance>();<NEW_LINE>for (int i = 0; i < context.lengthValue("ListCabInstancesResponse.Instances.Length"); i++) {<NEW_LINE>AgentBotInstance agentBotInstance = new AgentBotInstance();<NEW_LINE>agentBotInstance.setInstanceId(context.stringValue<MASK><NEW_LINE>agentBotInstance.setInstanceName(context.stringValue("ListCabInstancesResponse.Instances[" + i + "].InstanceName"));<NEW_LINE>agentBotInstance.setInstanceDescription(context.stringValue("ListCabInstancesResponse.Instances[" + i + "].InstanceDescription"));<NEW_LINE>agentBotInstance.setMaxConcurrentConversation(context.integerValue("ListCabInstancesResponse.Instances[" + i + "].MaxConcurrentConversation"));<NEW_LINE>agentBotInstance.setOwner(context.stringValue("ListCabInstancesResponse.Instances[" + i + "].Owner"));<NEW_LINE>agentBotInstance.setCreationTime(context.longValue("ListCabInstancesResponse.Instances[" + i + "].CreationTime"));<NEW_LINE>agentBotInstance.setCallCenterInstanceId(context.stringValue("ListCabInstancesResponse.Instances[" + i + "].CallCenterInstanceId"));<NEW_LINE>agentBotInstance.setIsTemplateContainer(context.booleanValue("ListCabInstancesResponse.Instances[" + i + "].IsTemplateContainer"));<NEW_LINE>instances.add(agentBotInstance);<NEW_LINE>}<NEW_LINE>listCabInstancesResponse.setInstances(instances);<NEW_LINE>return listCabInstancesResponse;<NEW_LINE>} | ("ListCabInstancesResponse.Instances[" + i + "].InstanceId")); |
1,511,274 | public static GasInventorySlot fillOrConvert(IGasTank gasTank, Supplier<Level> worldSupplier, @Nullable IContentsListener listener, int x, int y) {<NEW_LINE>Objects.requireNonNull(gasTank, "Gas tank cannot be null");<NEW_LINE><MASK><NEW_LINE>Function<ItemStack, GasStack> potentialConversionSupplier = stack -> getPotentialConversion(worldSupplier.get(), stack);<NEW_LINE>return new GasInventorySlot(gasTank, worldSupplier, getFillOrConvertExtractPredicate(gasTank, GasInventorySlot::getCapability, potentialConversionSupplier), getFillOrConvertInsertPredicate(gasTank, GasInventorySlot::getCapability, potentialConversionSupplier), stack -> {<NEW_LINE>if (stack.getCapability(Capabilities.GAS_HANDLER_CAPABILITY).isPresent()) {<NEW_LINE>// Note: we mark all gas items as valid and have a more restrictive insert check so that we allow full tanks when they are done being filled<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>// Allow gas conversion of items that have a gas that is valid<NEW_LINE>GasStack gasConversion = getPotentialConversion(worldSupplier.get(), stack);<NEW_LINE>return !gasConversion.isEmpty() && gasTank.isValid(gasConversion);<NEW_LINE>}, listener, x, y);<NEW_LINE>} | Objects.requireNonNull(worldSupplier, "World supplier cannot be null"); |
1,692,833 | public static ListApplicantsResponse unmarshall(ListApplicantsResponse listApplicantsResponse, UnmarshallerContext _ctx) {<NEW_LINE>listApplicantsResponse.setRequestId(_ctx.stringValue("ListApplicantsResponse.RequestId"));<NEW_LINE>listApplicantsResponse.setTotalCount(_ctx.integerValue("ListApplicantsResponse.TotalCount"));<NEW_LINE>listApplicantsResponse.setPageSize<MASK><NEW_LINE>listApplicantsResponse.setPageNumber(_ctx.integerValue("ListApplicantsResponse.PageNumber"));<NEW_LINE>List<Applicant> applicants = new ArrayList<Applicant>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListApplicantsResponse.Applicants.Length"); i++) {<NEW_LINE>Applicant applicant = new Applicant();<NEW_LINE>applicant.setApplicantId(_ctx.longValue("ListApplicantsResponse.Applicants[" + i + "].ApplicantId"));<NEW_LINE>applicant.setApplicantName(_ctx.stringValue("ListApplicantsResponse.Applicants[" + i + "].ApplicantName"));<NEW_LINE>applicant.setApplicantType(_ctx.integerValue("ListApplicantsResponse.Applicants[" + i + "].ApplicantType"));<NEW_LINE>applicant.setApplicantRegion(_ctx.integerValue("ListApplicantsResponse.Applicants[" + i + "].ApplicantRegion"));<NEW_LINE>applicant.setContactName(_ctx.stringValue("ListApplicantsResponse.Applicants[" + i + "].ContactName"));<NEW_LINE>applicant.setAuditStatus(_ctx.integerValue("ListApplicantsResponse.Applicants[" + i + "].AuditStatus"));<NEW_LINE>applicant.setAuthorizationUrl(_ctx.stringValue("ListApplicantsResponse.Applicants[" + i + "].AuthorizationUrl"));<NEW_LINE>applicant.setAuthorizationAuditStatus(_ctx.integerValue("ListApplicantsResponse.Applicants[" + i + "].AuthorizationAuditStatus"));<NEW_LINE>applicant.setCardNumber(_ctx.stringValue("ListApplicantsResponse.Applicants[" + i + "].CardNumber"));<NEW_LINE>applicants.add(applicant);<NEW_LINE>}<NEW_LINE>listApplicantsResponse.setApplicants(applicants);<NEW_LINE>return listApplicantsResponse;<NEW_LINE>} | (_ctx.integerValue("ListApplicantsResponse.PageSize")); |
81,498 | private static List<Rule> createRules(AndroidAppTarget target, List<String> additionalDeps, List<String> additionalResDeps) {<NEW_LINE>List<String> deps = new ArrayList<>();<NEW_LINE>deps.add(":" + AndroidBuckRuleComposer.src(target));<NEW_LINE>deps.addAll(additionalDeps);<NEW_LINE>List<Rule> libRules = createRules(target, target.getExopackage() != null ? target.getExopackage().getAppClass() : null, additionalDeps, additionalResDeps);<NEW_LINE>List<Rule> rules = new ArrayList<>(libRules);<NEW_LINE>libRules.forEach(rule -> {<NEW_LINE>if (rule instanceof AndroidModuleRule && rule.name() != null) {<NEW_LINE>deps.add(rule.buckName().replace(":src_", ":res_"));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>Rule <MASK><NEW_LINE>if (target.getExopackage() != null) {<NEW_LINE>Rule exoPackageRule = ExopackageAndroidLibraryRuleComposer.compose(target);<NEW_LINE>rules.add(exoPackageRule);<NEW_LINE>deps.add(exoPackageRule.buckName());<NEW_LINE>}<NEW_LINE>if (keystoreRule != null) {<NEW_LINE>rules.add(keystoreRule);<NEW_LINE>Rule appManifest = ManifestRuleComposer.composeForBinary(target);<NEW_LINE>rules.add(appManifest);<NEW_LINE>rules.add(AndroidBinaryRuleComposer.compose(target, appManifest.buckName(), deps, ":" + AndroidBuckRuleComposer.keystore(target)));<NEW_LINE>}<NEW_LINE>return rules;<NEW_LINE>} | keystoreRule = KeystoreRuleComposer.compose(target); |
987,931 | public String loginUser(String username, String password) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// verify the required parameter 'username' is set<NEW_LINE>if (username == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'username' when calling loginUser");<NEW_LINE>}<NEW_LINE>// verify the required parameter 'password' is set<NEW_LINE>if (password == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'password' when calling loginUser");<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/user/login";<NEW_LINE>// query params<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, String> localVarCookieParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>localVarQueryParams.addAll(apiClient.parameterToPair("username", username));<NEW_LINE>localVarQueryParams.addAll(apiClient.parameterToPair("password", password));<NEW_LINE>final String[] localVarAccepts = { "application/xml", "application/json" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String <MASK><NEW_LINE>String[] localVarAuthNames = new String[] {};<NEW_LINE>TypeReference<String> localVarReturnType = new TypeReference<String>() {<NEW_LINE>};<NEW_LINE>return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);<NEW_LINE>} | localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); |
1,672,960 | public void preferenceChange(PreferenceChangeEvent evt) {<NEW_LINE>if (suppressPrefChanges == Boolean.TRUE) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>boolean ch = detectIsChanged();<NEW_LINE>MemoryPreferences defMime;<NEW_LINE>synchronized (preferences) {<NEW_LINE>// NOI18N<NEW_LINE>defMime = preferences.get("");<NEW_LINE>}<NEW_LINE>if (defMime != null && defMime.getPreferences() == evt.getNode()) {<NEW_LINE>if (FoldUtilitiesImpl.PREF_CODE_FOLDING_ENABLED.equals(evt.getKey())) {<NEW_LINE>// propagate to all preferences, suppress events<NEW_LINE>suppressPrefChanges = true;<NEW_LINE>Collection<MemoryPreferences> col;<NEW_LINE>synchronized (preferences) {<NEW_LINE>col = new ArrayList<>(preferences.values());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>for (MemoryPreferences p : col) {<NEW_LINE>if (p != defMime) {<NEW_LINE>if (((OverridePreferences) p.getPreferences()).isOverriden(FoldUtilitiesImpl.PREF_CODE_FOLDING_ENABLED)) {<NEW_LINE>p.getPreferences().remove(FoldUtilitiesImpl.PREF_CODE_FOLDING_ENABLED);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>suppressPrefChanges = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (ch != changed) {<NEW_LINE>propSupport.firePropertyChange<MASK><NEW_LINE>changed = true;<NEW_LINE>}<NEW_LINE>} | (PROP_CHANGED, !ch, ch); |
883,705 | public void start() throws Exception {<NEW_LINE>// To simplify the development of the web components we use a Router to route all HTTP requests<NEW_LINE>// to organize our code in a reusable way.<NEW_LINE>final Router <MASK><NEW_LINE>// In order to use a Thymeleaf template we first need to create an engine<NEW_LINE>final ThymeleafTemplateEngine engine = ThymeleafTemplateEngine.create(vertx);<NEW_LINE>// Entry point to the application, this will render a custom JADE template.<NEW_LINE>router.get().handler(ctx -> {<NEW_LINE>// we define a hardcoded title for our application<NEW_LINE>JsonObject data = new JsonObject().put("welcome", "Hi there!");<NEW_LINE>// and now delegate to the engine to render it.<NEW_LINE>engine.render(data, "templates/index.html", res -> {<NEW_LINE>if (res.succeeded()) {<NEW_LINE>ctx.response().end(res.result());<NEW_LINE>} else {<NEW_LINE>ctx.fail(res.cause());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>});<NEW_LINE>// start a HTTP web server on port 8080<NEW_LINE>vertx.createHttpServer().requestHandler(router).listen(8080);<NEW_LINE>} | router = Router.router(vertx); |
887,106 | public MutablePair<CoreV1Event, V1Patch> observe(CoreV1Event event, String key) {<NEW_LINE>OffsetDateTime now = OffsetDateTime.now();<NEW_LINE>EventLog lastObserved = this.eventCache.getIfPresent(key);<NEW_LINE>V1Patch patch = null;<NEW_LINE>if (lastObserved != null && lastObserved.count != null && lastObserved.count > 0) {<NEW_LINE>event.setCount(lastObserved.count + 1);<NEW_LINE>event.setFirstTimestamp(lastObserved.firstTimestamp);<NEW_LINE>event.getMetadata().setName(lastObserved.name);<NEW_LINE>event.getMetadata().setResourceVersion(lastObserved.resourceVersion);<NEW_LINE>patch = buildEventPatch(event.getCount(), event.getMessage(), now);<NEW_LINE>}<NEW_LINE>EventLog log = new EventLog();<NEW_LINE>log.count = event.getCount();<NEW_LINE>log<MASK><NEW_LINE>log.name = event.getMetadata().getName();<NEW_LINE>log.resourceVersion = event.getMetadata().getResourceVersion();<NEW_LINE>this.eventCache.put(key, log);<NEW_LINE>return new MutablePair<>(event, patch);<NEW_LINE>} | .firstTimestamp = event.getFirstTimestamp(); |
1,328,700 | public static Map marshalMap(List<Class<?>> mapGenericClasses, Class keyClass, Class valueClass, Map rawMap) {<NEW_LINE>Map dataCollection = new HashMap();<NEW_LINE>if (keyClass.isAssignableFrom(BytesType.class) || valueClass.isAssignableFrom(BytesType.class)) {<NEW_LINE>Iterator iter = rawMap.keySet().iterator();<NEW_LINE>while (iter.hasNext()) {<NEW_LINE>Object key = iter.next();<NEW_LINE>Object value = rawMap.get(key);<NEW_LINE>if (keyClass.isAssignableFrom(BytesType.class)) {<NEW_LINE>byte[] keyAsBytes = new byte[((ByteBuffer) value).remaining()];<NEW_LINE>((ByteBuffer) key).get(keyAsBytes);<NEW_LINE>key = PropertyAccessorHelper.getObject(mapGenericClasses<MASK><NEW_LINE>}<NEW_LINE>if (valueClass.isAssignableFrom(BytesType.class)) {<NEW_LINE>byte[] valueAsBytes = new byte[((ByteBuffer) value).remaining()];<NEW_LINE>((ByteBuffer) value).get(valueAsBytes);<NEW_LINE>value = PropertyAccessorHelper.getObject(mapGenericClasses.get(1), valueAsBytes);<NEW_LINE>}<NEW_LINE>dataCollection.put(key, value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return dataCollection;<NEW_LINE>} | .get(0), keyAsBytes); |
1,500,831 | public static DescribeSmartAccessGatewayHaResponse unmarshall(DescribeSmartAccessGatewayHaResponse describeSmartAccessGatewayHaResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeSmartAccessGatewayHaResponse.setRequestId(_ctx.stringValue("DescribeSmartAccessGatewayHaResponse.RequestId"));<NEW_LINE>describeSmartAccessGatewayHaResponse.setDeviceLevelBackupState(_ctx.stringValue("DescribeSmartAccessGatewayHaResponse.DeviceLevelBackupState"));<NEW_LINE>describeSmartAccessGatewayHaResponse.setBackupDeviceId(_ctx.stringValue("DescribeSmartAccessGatewayHaResponse.BackupDeviceId"));<NEW_LINE>describeSmartAccessGatewayHaResponse.setSmartAGId(_ctx.stringValue("DescribeSmartAccessGatewayHaResponse.SmartAGId"));<NEW_LINE>describeSmartAccessGatewayHaResponse.setDeviceLevelBackupType<MASK><NEW_LINE>describeSmartAccessGatewayHaResponse.setMainDeviceId(_ctx.stringValue("DescribeSmartAccessGatewayHaResponse.MainDeviceId"));<NEW_LINE>List<LinkBackupInfoListItem> linkBackupInfoList = new ArrayList<LinkBackupInfoListItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeSmartAccessGatewayHaResponse.LinkBackupInfoList.Length"); i++) {<NEW_LINE>LinkBackupInfoListItem linkBackupInfoListItem = new LinkBackupInfoListItem();<NEW_LINE>linkBackupInfoListItem.setMainLinkId(_ctx.stringValue("DescribeSmartAccessGatewayHaResponse.LinkBackupInfoList[" + i + "].MainLinkId"));<NEW_LINE>linkBackupInfoListItem.setBackupLinkState(_ctx.stringValue("DescribeSmartAccessGatewayHaResponse.LinkBackupInfoList[" + i + "].BackupLinkState"));<NEW_LINE>linkBackupInfoListItem.setLinkLevelBackupState(_ctx.stringValue("DescribeSmartAccessGatewayHaResponse.LinkBackupInfoList[" + i + "].LinkLevelBackupState"));<NEW_LINE>linkBackupInfoListItem.setBackupLinkId(_ctx.stringValue("DescribeSmartAccessGatewayHaResponse.LinkBackupInfoList[" + i + "].BackupLinkId"));<NEW_LINE>linkBackupInfoListItem.setMainLinkState(_ctx.stringValue("DescribeSmartAccessGatewayHaResponse.LinkBackupInfoList[" + i + "].MainLinkState"));<NEW_LINE>linkBackupInfoListItem.setLinkLevelBackupType(_ctx.stringValue("DescribeSmartAccessGatewayHaResponse.LinkBackupInfoList[" + i + "].LinkLevelBackupType"));<NEW_LINE>linkBackupInfoList.add(linkBackupInfoListItem);<NEW_LINE>}<NEW_LINE>describeSmartAccessGatewayHaResponse.setLinkBackupInfoList(linkBackupInfoList);<NEW_LINE>return describeSmartAccessGatewayHaResponse;<NEW_LINE>} | (_ctx.stringValue("DescribeSmartAccessGatewayHaResponse.DeviceLevelBackupType")); |
1,256,573 | public void logMetric(LogMetric request, StreamObserver<LogMetric.Response> responseObserver) {<NEW_LINE>try {<NEW_LINE>final var response = futureExperimentRunDAO.logMetrics(LogMetrics.newBuilder().setId(request.getId()).addMetrics(request.getMetric()).build()).thenCompose(experimentRun -> addEvent(experimentRun.getId(), Optional.of(experimentRun.getExperimentId()), experimentRun.getProjectId(), UPDATE_EVENT_TYPE, Optional.of("metrics"), Collections.singletonMap("metrics", new Gson().toJsonTree(Stream.of(request.getMetric()).map(KeyValue::getKey).collect(Collectors.toSet()), new TypeToken<ArrayList<String>>() {<NEW_LINE>}.getType())), "experiment_run metric added successfully"), executor).thenApply(unused -> LogMetric.Response.newBuilder().build(), executor);<NEW_LINE>FutureGrpc.<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>CommonUtils.observeError(responseObserver, e);<NEW_LINE>}<NEW_LINE>} | ServerResponse(responseObserver, response, executor); |
79,149 | public void makeBlock(long blockOffset, long blockSize, byte[] firstChunkData, boolean isAsync, final RequestProgressHandler progressHandler, final RequestCompleteHandler completeHandler) {<NEW_LINE>requestInfo.requestType = UploadRequestInfo.RequestTypeMkblk;<NEW_LINE>requestInfo.fileOffset = blockOffset;<NEW_LINE>String token = String.format("UpToken %s", (this.token.token != null ? this<MASK><NEW_LINE>HashMap<String, String> header = new HashMap<String, String>();<NEW_LINE>header.put("Authorization", token);<NEW_LINE>header.put("Content-Type", "application/octet-stream");<NEW_LINE>header.put("User-Agent", userAgent);<NEW_LINE>String action = "/mkblk/" + blockSize;<NEW_LINE>final String chunkCrc = "" + Crc32.bytes(firstChunkData);<NEW_LINE>RequestShouldRetryHandler shouldRetryHandler = new RequestShouldRetryHandler() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean shouldRetry(ResponseInfo responseInfo, JSONObject response) {<NEW_LINE>if (response == null) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>String ctx = null;<NEW_LINE>String crcServer = null;<NEW_LINE>try {<NEW_LINE>ctx = response.getString("ctx");<NEW_LINE>crcServer = String.valueOf(response.getLong("crc32"));<NEW_LINE>} catch (JSONException e) {<NEW_LINE>}<NEW_LINE>return !responseInfo.isOK() || ctx == null || crcServer == null || !chunkCrc.equals(crcServer);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>regionRequest.post(action, isAsync, firstChunkData, header, shouldRetryHandler, progressHandler, new HttpRegionRequest.RequestCompleteHandler() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void complete(ResponseInfo responseInfo, UploadRegionRequestMetrics requestMetrics, JSONObject response) {<NEW_LINE>completeAction(responseInfo, requestMetrics, response, completeHandler);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | .token.token : "")); |
1,485,796 | public CanaryRunStatus unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>CanaryRunStatus canaryRunStatus = new CanaryRunStatus();<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("State", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>canaryRunStatus.setState(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("StateReason", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>canaryRunStatus.setStateReason(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("StateReasonCode", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>canaryRunStatus.setStateReasonCode(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 canaryRunStatus;<NEW_LINE>} | class).unmarshall(context)); |
618,641 | private static boolean hasCirvAnnotation(ExpressionTree tree, VisitorState state) {<NEW_LINE>Symbol untypedSymbol = getSymbol(tree);<NEW_LINE>if (!(untypedSymbol instanceof MethodSymbol)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>MethodSymbol sym = (MethodSymbol) untypedSymbol;<NEW_LINE>// Directly has @CanIgnoreReturnValue<NEW_LINE>if (ASTHelpers.hasAnnotation(sym, CanIgnoreReturnValue.class, state)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>// If a super-class's method is annotated with @CanIgnoreReturnValue, we only honor that<NEW_LINE>// if the super-type returned the exact same type. This lets us catch issues where a<NEW_LINE>// superclass was annotated with @CanIgnoreReturnValue but the parent did not intend to<NEW_LINE>// return an Rx type<NEW_LINE>return ASTHelpers.findSuperMethods(sym, state.getTypes()).stream().anyMatch(superSym -> hasAnnotation(superSym, CanIgnoreReturnValue.class, state) && superSym.getReturnType().tsym.equals(sym<MASK><NEW_LINE>} | .getReturnType().tsym)); |
642,725 | public void initDefaultHandlers() {<NEW_LINE>if (stateHandlers.isEmpty()) {<NEW_LINE>stateHandlers.put(DomainConstants.STATE_TYPE_SERVICE_TASK, new ServiceTaskStateHandler());<NEW_LINE>stateHandlers.put(DomainConstants.STATE_TYPE_SCRIPT_TASK, new ScriptTaskStateHandler());<NEW_LINE>stateHandlers.put(DomainConstants<MASK><NEW_LINE>stateHandlers.put(DomainConstants.STATE_TYPE_SUB_STATE_MACHINE, new SubStateMachineHandler());<NEW_LINE>stateHandlers.put(DomainConstants.STATE_TYPE_CHOICE, new ChoiceStateHandler());<NEW_LINE>stateHandlers.put(DomainConstants.STATE_TYPE_SUCCEED, new SucceedEndStateHandler());<NEW_LINE>stateHandlers.put(DomainConstants.STATE_TYPE_FAIL, new FailEndStateHandler());<NEW_LINE>stateHandlers.put(DomainConstants.STATE_TYPE_COMPENSATION_TRIGGER, new CompensationTriggerStateHandler());<NEW_LINE>stateHandlers.put(DomainConstants.STATE_TYPE_LOOP_START, new LoopStartStateHandler());<NEW_LINE>}<NEW_LINE>} | .STATE_TYPE_SUB_MACHINE_COMPENSATION, new ServiceTaskStateHandler()); |
335,118 | protected void initChannel(SocketChannel ch) throws Exception {<NEW_LINE>int heartbeatInterval = UrlUtils.getHeartbeat(getUrl());<NEW_LINE>if (getUrl().getParameter(SSL_ENABLED_KEY, false)) {<NEW_LINE>ch.pipeline().addLast("negotiation", new SslClientTlsHandler(getUrl()));<NEW_LINE>}<NEW_LINE>NettyCodecAdapter adapter = new NettyCodecAdapter(getCodec(), getUrl(), NettyClient.this);<NEW_LINE>// .addLast("logging",new LoggingHandler(LogLevel.INFO))//for debug<NEW_LINE>ch.pipeline().addLast("decoder", adapter.getDecoder()).addLast("encoder", adapter.getEncoder()).addLast("client-idle-handler", new IdleStateHandler(heartbeatInterval, 0, 0, MILLISECONDS)<MASK><NEW_LINE>String socksProxyHost = ConfigurationUtils.getProperty(getUrl().getOrDefaultApplicationModel(), SOCKS_PROXY_HOST);<NEW_LINE>if (socksProxyHost != null && !isFilteredAddress(getUrl().getHost())) {<NEW_LINE>int socksProxyPort = Integer.parseInt(ConfigurationUtils.getProperty(getUrl().getOrDefaultApplicationModel(), SOCKS_PROXY_PORT, DEFAULT_SOCKS_PROXY_PORT));<NEW_LINE>Socks5ProxyHandler socks5ProxyHandler = new Socks5ProxyHandler(new InetSocketAddress(socksProxyHost, socksProxyPort));<NEW_LINE>ch.pipeline().addFirst(socks5ProxyHandler);<NEW_LINE>}<NEW_LINE>} | ).addLast("handler", nettyClientHandler); |
879,249 | public Pack read(DataInputX din) throws IOException {<NEW_LINE>this.gxid = din.readLong();<NEW_LINE>this.txid = din.readLong();<NEW_LINE>this.caller = din.readLong();<NEW_LINE>this.timestamp = din.readLong();<NEW_LINE>this.elapsed = (int) din.readDecimal();<NEW_LINE>this.spanType = din.readByte();<NEW_LINE>this.name = (int) din.readDecimal();<NEW_LINE>this.objHash = (int) din.readDecimal();<NEW_LINE>this.error = (int) din.readDecimal();<NEW_LINE>this.localEndpointServiceName = <MASK><NEW_LINE>this.localEndpointIp = din.readBlob();<NEW_LINE>this.localEndpointPort = din.readShort();<NEW_LINE>this.remoteEndpointServiceName = (int) din.readDecimal();<NEW_LINE>this.remoteEndpointIp = din.readBlob();<NEW_LINE>this.remoteEndpointPort = din.readShort();<NEW_LINE>this.debug = din.readBoolean();<NEW_LINE>this.shared = din.readBoolean();<NEW_LINE>this.annotationTimestamps = (ListValue) din.readValue();<NEW_LINE>this.annotationValues = (ListValue) din.readValue();<NEW_LINE>this.tags = (MapValue) din.readValue();<NEW_LINE>return this;<NEW_LINE>} | (int) din.readDecimal(); |
1,694,729 | protected void configureEditor() {<NEW_LINE>super.configureEditor();<NEW_LINE>if (editor instanceof JTextField) {<NEW_LINE>JTextField textField = (JTextField) editor;<NEW_LINE>textField.setColumns(editorColumns);<NEW_LINE>// remove default text field border from editor<NEW_LINE>Border border = textField.getBorder();<NEW_LINE>if (border == null || border instanceof UIResource) {<NEW_LINE>// assign a non-null and non-javax.swing.plaf.UIResource border to the text field,<NEW_LINE>// otherwise it is replaced with default text field border when switching LaF<NEW_LINE>// because javax.swing.plaf.basic.BasicComboBoxEditor.BorderlessTextField.setBorder()<NEW_LINE>// uses "border instanceof javax.swing.plaf.basic.BasicComboBoxEditor.UIResource"<NEW_LINE>// instead of "border instanceof javax.swing.plaf.UIResource"<NEW_LINE>textField.setBorder(BorderFactory.createEmptyBorder());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// explicitly make non-opaque<NEW_LINE>if (editor instanceof JComponent)<NEW_LINE>((JComponent) editor).setOpaque(false);<NEW_LINE>editor.applyComponentOrientation(comboBox.getComponentOrientation());<NEW_LINE>updateEditorPadding();<NEW_LINE>updateEditorColors();<NEW_LINE>// macOS<NEW_LINE>if (SystemInfo.isMacOS && editor instanceof JTextComponent) {<NEW_LINE>// delegate actions from editor text field to combobox, which is necessary<NEW_LINE>// because text field on macOS already handle those keys<NEW_LINE>InputMap inputMap = ((JTextComponent) editor).getInputMap();<NEW_LINE>new EditorDelegateAction(inputMap, KeyStroke.getKeyStroke("UP"));<NEW_LINE>new EditorDelegateAction(inputMap, KeyStroke.getKeyStroke("KP_UP"));<NEW_LINE>new EditorDelegateAction(inputMap, KeyStroke.getKeyStroke("DOWN"));<NEW_LINE>new EditorDelegateAction(inputMap, KeyStroke.getKeyStroke("KP_DOWN"));<NEW_LINE>new EditorDelegateAction(inputMap, KeyStroke.getKeyStroke("HOME"));<NEW_LINE>new EditorDelegateAction(inputMap<MASK><NEW_LINE>}<NEW_LINE>} | , KeyStroke.getKeyStroke("END")); |
427,249 | private void pasteFormat(final NodeModel node) {<NEW_LINE>final NodeModel pattern = CopyFormat.getPattern();<NEW_LINE>if (pattern == null) {<NEW_LINE>JOptionPane.showMessageDialog(Controller.getCurrentController().getViewController().getCurrentRootComponent(), TextUtils.getText("no_format_copy_before_format_paste"), "", /*=Title*/<NEW_LINE>JOptionPane.ERROR_MESSAGE);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final ModeController modeController = Controller.getCurrentModeController();<NEW_LINE>modeController.undoableRemoveExtensions(LogicalStyleKeys.LOGICAL_STYLE, node, node);<NEW_LINE>modeController.undoableCopyExtensions(LogicalStyleKeys.LOGICAL_STYLE, pattern, node);<NEW_LINE>modeController.undoableRemoveExtensions(LogicalStyleKeys.NODE_STYLE, node, node);<NEW_LINE>modeController.undoableCopyExtensions(LogicalStyleKeys.NODE_STYLE, pattern, node);<NEW_LINE>if (ResourceController.getResourceController().getBooleanProperty("copyFormatToNewNodeIncludesIcons")) {<NEW_LINE>modeController.undoableRemoveExtensions(<MASK><NEW_LINE>modeController.undoableCopyExtensions(Keys.ICONS, pattern, node);<NEW_LINE>}<NEW_LINE>} | Keys.ICONS, node, node); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.