idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
119,035 | private String[] determineQName(Tag tag) {<NEW_LINE>TagAttribute attr = tag.getAttributes().get("jsfc");<NEW_LINE>if (attr != null) {<NEW_LINE>if (log.isLoggable(Level.FINE)) {<NEW_LINE>log.fine(attr + " JSF Facelet Compile Directive Found");<NEW_LINE>}<NEW_LINE>String value = attr.getValue();<NEW_LINE>String namespace;<NEW_LINE>String localName;<NEW_LINE>int c = value.indexOf(':');<NEW_LINE>if (c == -1) {<NEW_LINE>namespace = this.namespaceManager.getNamespace("");<NEW_LINE>localName = value;<NEW_LINE>} else {<NEW_LINE>String prefix = value.substring(0, c);<NEW_LINE>namespace = this.namespaceManager.getNamespace(prefix);<NEW_LINE>if (namespace == null) {<NEW_LINE>throw new TagAttributeException(<MASK><NEW_LINE>}<NEW_LINE>localName = value.substring(c + 1);<NEW_LINE>}<NEW_LINE>return new String[] { namespace, localName };<NEW_LINE>} else {<NEW_LINE>return new String[] { tag.getNamespace(), tag.getLocalName() };<NEW_LINE>}<NEW_LINE>} | tag, attr, "No Namespace matched for: " + prefix); |
1,795,219 | private static List<ClientThread> initDb(String dbname, Properties props, int threadcount, double targetperthreadperms, Workload workload, Tracer tracer, CountDownLatch completeLatch) {<NEW_LINE>boolean initFailed = false;<NEW_LINE>boolean dotransactions = Boolean.valueOf(props.getProperty(DO_TRANSACTIONS_PROPERTY, String.valueOf(true)));<NEW_LINE>final List<ClientThread> clients = new ArrayList<>(threadcount);<NEW_LINE>try (final TraceScope span = tracer.newScope(CLIENT_INIT_SPAN)) {<NEW_LINE>int opcount;<NEW_LINE>if (dotransactions) {<NEW_LINE>opcount = Integer.parseInt(props.getProperty(OPERATION_COUNT_PROPERTY, "0"));<NEW_LINE>} else {<NEW_LINE>if (props.containsKey(INSERT_COUNT_PROPERTY)) {<NEW_LINE>opcount = Integer.parseInt(props.getProperty(INSERT_COUNT_PROPERTY, "0"));<NEW_LINE>} else {<NEW_LINE>opcount = Integer.parseInt(props.getProperty(RECORD_COUNT_PROPERTY, DEFAULT_RECORD_COUNT));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (threadcount > opcount && opcount > 0) {<NEW_LINE>threadcount = opcount;<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>for (int threadid = 0; threadid < threadcount; threadid++) {<NEW_LINE>DB db;<NEW_LINE>try {<NEW_LINE>db = DBFactory.newDB(dbname, props, tracer);<NEW_LINE>} catch (UnknownDBException e) {<NEW_LINE>System.out.println("Unknown DB " + dbname);<NEW_LINE>initFailed = true;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>int threadopcount = opcount / threadcount;<NEW_LINE>// ensure correct number of operations, in case opcount is not a multiple of threadcount<NEW_LINE>if (threadid < opcount % threadcount) {<NEW_LINE>++threadopcount;<NEW_LINE>}<NEW_LINE>ClientThread t = new ClientThread(db, dotransactions, workload, props, threadopcount, targetperthreadperms, completeLatch);<NEW_LINE>t.setThreadId(threadid);<NEW_LINE>t.setThreadCount(threadcount);<NEW_LINE>clients.add(t);<NEW_LINE>}<NEW_LINE>if (initFailed) {<NEW_LINE>System.err.println("Error initializing datastore bindings.");<NEW_LINE>System.exit(0);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return clients;<NEW_LINE>} | System.out.println("Warning: the threadcount is bigger than recordcount, the threadcount will be recordcount!"); |
192,700 | public void onReceive(Context context, Intent intent) {<NEW_LINE>LogManager.d(TAG, "onReceive called in startup broadcast receiver");<NEW_LINE>if (Build.VERSION.SDK_INT < 18) {<NEW_LINE>LogManager.w(TAG, "Not starting up beacon service because we do not have API version 18 (Android 4.3). We have: %s", Build.VERSION.SDK_INT);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>BeaconManager beaconManager = BeaconManager.getInstanceForApplication(context.getApplicationContext());<NEW_LINE>if (beaconManager.isAnyConsumerBound() || beaconManager.getScheduledScanJobsEnabled() || beaconManager.getIntentScanStrategyCoordinator() != null) {<NEW_LINE>// e.g. ScanSettings.CALLBACK_TYPE_FIRST_MATCH<NEW_LINE>int bleCallbackType = intent.getIntExtra(BluetoothLeScanner.EXTRA_CALLBACK_TYPE, -1);<NEW_LINE>if (bleCallbackType != -1) {<NEW_LINE>LogManager.d(TAG, "Passive background scan callback type: " + bleCallbackType);<NEW_LINE>LogManager.d(TAG, "got Android O background scan via intent");<NEW_LINE>// e.g. ScanCallback.SCAN_FAILED_INTERNAL_ERROR<NEW_LINE>int errorCode = intent.getIntExtra<MASK><NEW_LINE>if (errorCode != -1) {<NEW_LINE>LogManager.w(TAG, "Passive background scan failed. Code; " + errorCode);<NEW_LINE>}<NEW_LINE>ArrayList<ScanResult> scanResults = intent.getParcelableArrayListExtra(BluetoothLeScanner.EXTRA_LIST_SCAN_RESULT);<NEW_LINE>if (beaconManager.getIntentScanStrategyCoordinator() != null && Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {<NEW_LINE>beaconManager.getIntentScanStrategyCoordinator().processScanResults(scanResults);<NEW_LINE>} else if (beaconManager.getScheduledScanJobsEnabled() && Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {<NEW_LINE>ScanJobScheduler.getInstance().scheduleAfterBackgroundWakeup(context, scanResults);<NEW_LINE>}<NEW_LINE>} else if (intent.getBooleanExtra("wakeup", false)) {<NEW_LINE>LogManager.d(TAG, "got wake up intent");<NEW_LINE>} else {<NEW_LINE>LogManager.d(TAG, "Already started. Ignoring intent: %s of type: %s", intent, intent.getStringExtra("wakeup"));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>LogManager.d(TAG, "No consumers are bound. Ignoring broadcast receiver.");<NEW_LINE>}<NEW_LINE>} | (BluetoothLeScanner.EXTRA_ERROR_CODE, -1); |
388,872 | private MInOut createShipment(MDocType dt, Timestamp movementDate) {<NEW_LINE>log.info("For " + dt);<NEW_LINE>MInOut shipment = new MInOut(this, dt.getC_DocTypeShipment_ID(), movementDate);<NEW_LINE><MASK><NEW_LINE>//<NEW_LINE>MOrderLine[] oLines = getLines(true, null);<NEW_LINE>for (int i = 0; i < oLines.length; i++) {<NEW_LINE>MOrderLine oLine = oLines[i];<NEW_LINE>//<NEW_LINE>MInOutLine ioLine = new MInOutLine(shipment);<NEW_LINE>// Qty = Ordered - Delivered<NEW_LINE>BigDecimal MovementQty = oLine.getQtyOrdered().subtract(oLine.getQtyDelivered());<NEW_LINE>// Location<NEW_LINE>int M_Locator_ID = MStorage.getM_Locator_ID(oLine.getM_Warehouse_ID(), oLine.getM_Product_ID(), oLine.getM_AttributeSetInstance_ID(), MovementQty, get_TrxName());<NEW_LINE>if (// Get default Location<NEW_LINE>M_Locator_ID == 0) {<NEW_LINE>MWarehouse wh = MWarehouse.get(getCtx(), oLine.getM_Warehouse_ID());<NEW_LINE>M_Locator_ID = wh.getDefaultLocator().getM_Locator_ID();<NEW_LINE>}<NEW_LINE>//<NEW_LINE>ioLine.setOrderLine(oLine, M_Locator_ID, MovementQty);<NEW_LINE>ioLine.setQty(MovementQty);<NEW_LINE>if (oLine.getQtyEntered().compareTo(oLine.getQtyOrdered()) != 0) {<NEW_LINE>ioLine.setQtyEntered(MovementQty.multiply(oLine.getQtyEntered()).divide(oLine.getQtyOrdered(), 6, BigDecimal.ROUND_HALF_UP));<NEW_LINE>}<NEW_LINE>ioLine.saveEx(get_TrxName());<NEW_LINE>}<NEW_LINE>// Manually Process Shipment<NEW_LINE>shipment.processIt(DocAction.ACTION_Complete);<NEW_LINE>shipment.saveEx(get_TrxName());<NEW_LINE>if (!DOCSTATUS_Completed.equals(shipment.getDocStatus())) {<NEW_LINE>m_processMsg = "@M_InOut_ID@: " + shipment.getProcessMsg();<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return shipment;<NEW_LINE>} | shipment.saveEx(get_TrxName()); |
784,618 | protected static String literalBitsComment(CstLiteralBits value, int width) {<NEW_LINE>StringBuilder sb = new StringBuilder(20);<NEW_LINE>sb.append("#");<NEW_LINE>long bits;<NEW_LINE>if (value instanceof CstLiteral64) {<NEW_LINE>bits = value.getLongBits();<NEW_LINE>} else {<NEW_LINE>bits = value.getIntBits();<NEW_LINE>}<NEW_LINE>switch(width) {<NEW_LINE>case 4:<NEW_LINE>sb.append(Hex.uNibble((int) bits));<NEW_LINE>break;<NEW_LINE>case 8:<NEW_LINE>sb.append(Hex.u1((int) bits));<NEW_LINE>break;<NEW_LINE>case 16:<NEW_LINE>sb.append(Hex.<MASK><NEW_LINE>break;<NEW_LINE>case 32:<NEW_LINE>sb.append(Hex.u4((int) bits));<NEW_LINE>break;<NEW_LINE>case 64:<NEW_LINE>sb.append(Hex.u8(bits));<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>{<NEW_LINE>throw new RuntimeException("shouldn't happen");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return sb.toString();<NEW_LINE>} | u2((int) bits)); |
848,325 | private static void addErrorFileAppender(LoggerContext context, String logErrorFile) {<NEW_LINE>// More documentation is available at: https://github.com/logstash/logstash-logback-encoder<NEW_LINE>final RollingFileAppender<ILoggingEvent> errorFileAppender = new RollingFileAppender<>();<NEW_LINE>errorFileAppender.setContext(context);<NEW_LINE>errorFileAppender.addFilter(errorLevelFilter(context));<NEW_LINE>errorFileAppender.setEncoder(patternLayoutEncoder(context));<NEW_LINE>errorFileAppender.setName(LoggingUtil.FILE_ERROR_APPENDER_NAME);<NEW_LINE>errorFileAppender.setFile(logErrorFile);<NEW_LINE>errorFileAppender.setRollingPolicy(LoggingUtil.rollingPolicy(context, errorFileAppender, logErrorFile));<NEW_LINE>errorFileAppender.start();<NEW_LINE>context.getLogger(Logger.ROOT_LOGGER_NAME).detachAppender(LoggingUtil.FILE_ERROR_APPENDER_NAME);<NEW_LINE>context.getLogger(Logger<MASK><NEW_LINE>} | .ROOT_LOGGER_NAME).addAppender(errorFileAppender); |
629,203 | public <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18> Result<Record18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18>> newResult(Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8, Field<T9> field9, Field<T10> field10, Field<T11> field11, Field<T12> field12, Field<T13> field13, Field<T14> field14, Field<T15> field15, Field<T16> field16, Field<T17> field17, Field<T18> field18) {<NEW_LINE>return (Result) newResult(new Field[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15<MASK><NEW_LINE>} | , field16, field17, field18 }); |
118,795 | private void collectIndex(Class entity) {<NEW_LINE>List<Field> fs;<NEW_LINE>Class superClass = entity.getSuperclass();<NEW_LINE>if (superClass.isAnnotationPresent(Entity.class) || entity.isAnnotationPresent(EO.class)) {<NEW_LINE>// parent class or EO class is also an entity, it will take care of its foreign key,<NEW_LINE>// so we only do our own foreign keys;<NEW_LINE>fs = FieldUtils.getAnnotatedFieldsOnThisClass(Index.class, entity);<NEW_LINE>} else {<NEW_LINE>fs = FieldUtils.getAnnotatedFields(Index.class, entity);<NEW_LINE>}<NEW_LINE>List<IndexInfo> keyInfos = indexMap.get(entity);<NEW_LINE>if (keyInfos == null) {<NEW_LINE>keyInfos <MASK><NEW_LINE>indexMap.put(entity, keyInfos);<NEW_LINE>}<NEW_LINE>for (Field f : fs) {<NEW_LINE>keyInfos.add(new IndexInfo(entity, f));<NEW_LINE>}<NEW_LINE>} | = new ArrayList<IndexInfo>(); |
179,734 | static ShaderProgram createDefaultShader() {<NEW_LINE>//<NEW_LINE>String //<NEW_LINE>vertexShader = //<NEW_LINE>"attribute vec4 " + ShaderProgram.POSITION_ATTRIBUTE + ";\n" + "attribute vec4 " + ShaderProgram.COLOR_ATTRIBUTE + ";\n" + "attribute vec2 " + //<NEW_LINE>ShaderProgram.TEXCOORD_ATTRIBUTE + //<NEW_LINE>"0;\n" + //<NEW_LINE>"uniform mat4 u_projectionViewMatrix;\n" + //<NEW_LINE>"varying vec4 v_color;\n" + //<NEW_LINE>"varying vec2 v_texCoords;\n" + //<NEW_LINE>"\n" + //<NEW_LINE>"void main()\n" + "{\n" + " v_color = " + //<NEW_LINE>ShaderProgram.COLOR_ATTRIBUTE + //<NEW_LINE>";\n" + " v_color.a = v_color.a * (255.0/254.0);\n" + " v_texCoords = " + //<NEW_LINE>ShaderProgram.TEXCOORD_ATTRIBUTE + "0;\n" + " gl_Position = u_projectionViewMatrix * " + //<NEW_LINE>ShaderProgram.POSITION_ATTRIBUTE + ";\n" + "}\n";<NEW_LINE>//<NEW_LINE>String //<NEW_LINE>fragmentShader = //<NEW_LINE>"#ifdef GL_ES\n" + //<NEW_LINE>"precision mediump float;\n" + //<NEW_LINE>"#endif\n" + //<NEW_LINE>"varying vec4 v_color;\n" + //<NEW_LINE>"varying vec2 v_texCoords;\n" + //<NEW_LINE>"uniform sampler2D u_texture;\n" + //<NEW_LINE>"void main()\n" + //<NEW_LINE>"{\n" + " gl_FragColor = v_color * texture2D(u_texture, v_texCoords);\n" + "}";<NEW_LINE>ShaderProgram shader = new ShaderProgram(vertexShader, fragmentShader);<NEW_LINE>if (!shader.isCompiled())<NEW_LINE>throw new IllegalArgumentException(<MASK><NEW_LINE>return shader;<NEW_LINE>} | "Error compiling shader: " + shader.getLog()); |
1,750,465 | public void marshall(Partition partition, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (partition == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(partition.getValues(), VALUES_BINDING);<NEW_LINE>protocolMarshaller.marshall(partition.getDatabaseName(), DATABASENAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(partition.getTableName(), TABLENAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(partition.getCreationTime(), CREATIONTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(partition.getLastAccessTime(), LASTACCESSTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(partition.getParameters(), PARAMETERS_BINDING);<NEW_LINE>protocolMarshaller.marshall(partition.getLastAnalyzedTime(), LASTANALYZEDTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(partition.getCatalogId(), CATALOGID_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | partition.getStorageDescriptor(), STORAGEDESCRIPTOR_BINDING); |
541,395 | public static void addCopyPaste(ActionListener copyListener, ActionListener pasteListener, JComponent panel) {<NEW_LINE>// TODO ideally support paste and copy with control or command<NEW_LINE>KeyStroke copy = KeyStroke.getKeyStroke(KeyEvent.VK_C, InputEvent.CTRL_MASK, false);<NEW_LINE>KeyStroke copy2 = KeyStroke.getKeyStroke(KeyEvent.<MASK><NEW_LINE>KeyStroke paste = KeyStroke.getKeyStroke(KeyEvent.VK_V, InputEvent.CTRL_MASK, false);<NEW_LINE>KeyStroke paste2 = KeyStroke.getKeyStroke(KeyEvent.VK_V, InputEvent.META_MASK, false);<NEW_LINE>panel.registerKeyboardAction(copyListener, "Copy", copy, JComponent.WHEN_FOCUSED);<NEW_LINE>panel.registerKeyboardAction(copyListener, "Copy", copy2, JComponent.WHEN_FOCUSED);<NEW_LINE>panel.registerKeyboardAction(pasteListener, "Paste", paste, JComponent.WHEN_FOCUSED);<NEW_LINE>panel.registerKeyboardAction(pasteListener, "Paste", paste2, JComponent.WHEN_FOCUSED);<NEW_LINE>} | VK_C, InputEvent.META_MASK, false); |
47,100 | protected void run(BookKeeper bk, Flags flags) throws Exception {<NEW_LINE>// test data<NEW_LINE>byte[] data = new byte[100];<NEW_LINE>try (WriteHandle wh = result(bk.newCreateLedgerOp().withEnsembleSize(flags.ensembleSize).withWriteQuorumSize(flags.writeQuorumSize).withAckQuorumSize(flags.ackQuorumSize).withDigestType(DigestType.CRC32C).withPassword(new byte[0]).execute())) {<NEW_LINE>LOG.info(<MASK><NEW_LINE>long lastReport = System.nanoTime();<NEW_LINE>for (int i = 0; i < flags.numEntries; i++) {<NEW_LINE>wh.append(data);<NEW_LINE>if (TimeUnit.SECONDS.convert(System.nanoTime() - lastReport, TimeUnit.NANOSECONDS) > 1) {<NEW_LINE>LOG.info(i + " entries written");<NEW_LINE>lastReport = System.nanoTime();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>LOG.info(flags.numEntries + " entries written to ledger " + wh.getId());<NEW_LINE>}<NEW_LINE>} | "Ledger ID: " + wh.getId()); |
303,814 | private void readHeader() throws IOException {<NEW_LINE>assertInput();<NEW_LINE>if (header == null) {<NEW_LINE>header = PSDHeader.read(imageInput);<NEW_LINE>if (!header.hasValidDimensions()) {<NEW_LINE>processWarningOccurred(String.format("Dimensions exceed maximum allowed for %s: %dx%d (max %dx%d)", header.largeFormat ? "PSB" : "PSD", header.width, header.height, header.getMaxSize(), header.getMaxSize()));<NEW_LINE>}<NEW_LINE>metadata = new PSDMetadata();<NEW_LINE>metadata.header = header;<NEW_LINE>// Contains the required data to define the color mode.<NEW_LINE>//<NEW_LINE>// For indexed color images, the count will be equal to 768, and the mode data<NEW_LINE>// will contain the color table for the image, in non-interleaved order.<NEW_LINE>//<NEW_LINE>// For duotone images, the mode data will contain the duotone specification,<NEW_LINE>// the format of which is not documented. Non-Photoshop readers can treat<NEW_LINE>// the duotone image as a grayscale image, and keep the duotone specification<NEW_LINE>// around as a black box for use when saving the file.<NEW_LINE>if (header.mode == PSD.COLOR_MODE_INDEXED) {<NEW_LINE>metadata.colorData = new PSDColorData(imageInput);<NEW_LINE>} else {<NEW_LINE>// TODO: We need to store the duotone spec if we decide to create a writer...<NEW_LINE>// Skip color mode data for other modes<NEW_LINE>long length = imageInput.readUnsignedInt();<NEW_LINE>imageInput.skipBytes(length);<NEW_LINE>}<NEW_LINE>metadata.imageResourcesStart = imageInput.getStreamPosition();<NEW_LINE>// Don't need the header again<NEW_LINE>imageInput.flushBefore(imageInput.getStreamPosition());<NEW_LINE>if (DEBUG) {<NEW_LINE>System.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | out.println("header: " + header); |
1,277,098 | private double onehHat(int t, double[] data, double[] h, double[] alpha, double[] beta, double c) {<NEW_LINE>double result = c * c;<NEW_LINE>if (t < alpha.length) {<NEW_LINE>for (int i = 0; i < t; i++) {<NEW_LINE>result += alpha[i] * alpha[i] * h[t - i - 1];<NEW_LINE>}<NEW_LINE>for (int i = t; i < alpha.length - t; i++) {<NEW_LINE>result += alpha[i] * alpha[i] * initH;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>for (int i = 0; i < alpha.length; i++) {<NEW_LINE>result += alpha[i] * alpha[i] * h[t - i - 1];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int i = 0; i < beta.length; i++) {<NEW_LINE>result += beta[i] * beta[i] * data[t - i - 1] * <MASK><NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | data[t - i - 1]; |
626,752 | private Quantity addQtyShipped(final DDOrderLineToAllocate ddOrderLineToAllocate, final I_M_HU hu, final Quantity qtyToAllocate, final boolean force) {<NEW_LINE>final ProductId productId = ddOrderLineToAllocate.getProductId();<NEW_LINE>//<NEW_LINE>// Get how much we can allocate (maximum)<NEW_LINE>final Quantity qtyToAllocateMax;<NEW_LINE>if (force) {<NEW_LINE>qtyToAllocateMax = qtyToAllocate;<NEW_LINE>} else {<NEW_LINE>qtyToAllocateMax = ddOrderLineToAllocate.getQtyToShipRemaining();<NEW_LINE>}<NEW_LINE>final Quantity qtyToAllocateConv = uomConversionBL.convertQuantityTo(qtyToAllocate, productId, qtyToAllocateMax.getUomId());<NEW_LINE>final Quantity qtyToAllocateRemaining = qtyToAllocateMax.subtract(qtyToAllocateConv);<NEW_LINE>final Quantity qtyShipped;<NEW_LINE>if (qtyToAllocateRemaining.signum() < 0) {<NEW_LINE>// allocate the maximum allowed qty if it's lower than the remaining qty<NEW_LINE>qtyShipped = qtyToAllocateMax;<NEW_LINE>} else {<NEW_LINE>// allocate the full remaining qty because it's within the maximum boundaries<NEW_LINE>qtyShipped = qtyToAllocateConv;<NEW_LINE>}<NEW_LINE>if (qtyShipped.isZero()) {<NEW_LINE>return qtyShipped;<NEW_LINE>}<NEW_LINE>final Quantity qtyShippedConv = uomConversionBL.convertQuantityTo(qtyShipped, productId, qtyToAllocateMax.getUomId());<NEW_LINE>ddOrderLineToAllocate.addPickFromHU(DDOrderLineToAllocate.PickFromHU.builder().hu(hu).qty<MASK><NEW_LINE>return qtyShippedConv;<NEW_LINE>} | (qtyShippedConv).build()); |
891,353 | private List<CSVBind> createCSVBinding(String column, FileField fileField, Mapper mapper, List<CSVBind> allBindings) throws ClassNotFoundException {<NEW_LINE>Property prop = mapper.getProperty(fileField.getImportField().getName());<NEW_LINE>if (prop == null) {<NEW_LINE>return allBindings;<NEW_LINE>}<NEW_LINE>CSVBind dummyBind = null;<NEW_LINE>if (!fileField.getIsMatchWithFile()) {<NEW_LINE>dummyBind = this.createCSVBind(null, column, null, null, null, null);<NEW_LINE>allBindings.add(0, dummyBind);<NEW_LINE>}<NEW_LINE>if (Strings.isNullOrEmpty(fileField.getSubImportField())) {<NEW_LINE>String expression = this.setExpression(column, fileField, prop);<NEW_LINE>String adapter = null;<NEW_LINE>String dateFormat = fileField.getDateFormat();<NEW_LINE>if (Strings.isNullOrEmpty(expression) && !Strings.isNullOrEmpty(dateFormat)) {<NEW_LINE>adapter = this.getAdapter(prop.getJavaType().getSimpleName(), dateFormat.trim());<NEW_LINE>}<NEW_LINE>CSVBind bind = null;<NEW_LINE>if (!fileField.getIsMatchWithFile()) {<NEW_LINE>dummyBind.setExpression(expression);<NEW_LINE>dummyBind.setAdapter(adapter);<NEW_LINE>bind = this.createCSVBind(column, prop.getName(), null, null, null, null);<NEW_LINE>this.setImportIf(prop, bind, column);<NEW_LINE>} else {<NEW_LINE>bind = this.createCSVBind(column, prop.getName(), null, expression, adapter, null);<NEW_LINE>this.setImportIf(prop, bind, column);<NEW_LINE>}<NEW_LINE>allBindings.add(bind);<NEW_LINE>} else {<NEW_LINE>CSVBind parentBind = null;<NEW_LINE>boolean isSameParentExist = false;<NEW_LINE>if (parentBindMap.containsKey(prop.getName())) {<NEW_LINE>parentBind = parentBindMap.get(prop.getName());<NEW_LINE>isSameParentExist = true;<NEW_LINE>} else {<NEW_LINE>parentBind = this.createCSVBind(null, prop.getName(), null, null, null, true);<NEW_LINE>parentBind.setBindings(new ArrayList<>());<NEW_LINE>allBindings.add(parentBind);<NEW_LINE>parentBindMap.put(prop.getName(), parentBind);<NEW_LINE>}<NEW_LINE>fullFieldName = prop.getName();<NEW_LINE>String[] subFields = fileField.getSubImportField().split("\\.");<NEW_LINE>this.createCSVSubBinding(subFields, 0, column, prop, <MASK><NEW_LINE>}<NEW_LINE>if (!Strings.isNullOrEmpty(fileField.getNoImportIf())) {<NEW_LINE>String importIf = this.convertExpression(fileField.getNoImportIf().trim(), fileField.getTargetType(), column);<NEW_LINE>ifList.add(importIf);<NEW_LINE>}<NEW_LINE>return allBindings;<NEW_LINE>} | fileField, parentBind, dummyBind, isSameParentExist); |
1,034,771 | public SslContext deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException {<NEW_LINE>ObjectNode node = jp.readValueAsTree();<NEW_LINE>try {<NEW_LINE>String keyStoreFile = node.path("keystoreFile").asText();<NEW_LINE>String keyStorePassword = node.path("keystorePassword").asText();<NEW_LINE>String trustStoreFile = node.path("truststoreFile").asText();<NEW_LINE>String trustStorePassword = node.path("truststorePassword").asText();<NEW_LINE>if (keyStoreFile.isEmpty()) {<NEW_LINE>throw new IllegalStateException("keystoreFile must be set if any ssl properties are set");<NEW_LINE>} else if (keyStorePassword.isEmpty()) {<NEW_LINE>throw new IllegalStateException("keystorePassword must be set if any ssl properties are set");<NEW_LINE>} else if (!trustStoreFile.isEmpty() && trustStorePassword.isEmpty()) {<NEW_LINE>throw new IllegalStateException("truststorePassword must be specified when truststoreFile is specified");<NEW_LINE>}<NEW_LINE>KeyManagerFactory keyManagerFactory;<NEW_LINE>try (InputStream is = Files.newInputStream(Paths.get(keyStoreFile))) {<NEW_LINE>keyManagerFactory = SslContexts.keyManagerFactory(is, keyStorePassword.toCharArray());<NEW_LINE>}<NEW_LINE>SslContextBuilder <MASK><NEW_LINE>if (!trustStoreFile.isEmpty()) {<NEW_LINE>try (InputStream is = Files.newInputStream(Paths.get(trustStoreFile))) {<NEW_LINE>builder.trustManager(SslContexts.trustManagerFactory(is, trustStorePassword.toCharArray()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return builder.build();<NEW_LINE>} catch (GeneralSecurityException ex) {<NEW_LINE>throw Exceptions.uncheck(ex);<NEW_LINE>}<NEW_LINE>} | builder = SslContextBuilder.forServer(keyManagerFactory); |
905,899 | private void handleSwitchType(SwitchSelection selection) {<NEW_LINE>ContextMenu menu = new ContextMenu();<NEW_LINE>Menu refs = new Menu<MASK><NEW_LINE>for (AST ast : root.getChildren()) {<NEW_LINE>if (ast instanceof LabelAST) {<NEW_LINE>String name = ((LabelAST) ast).getName().getName();<NEW_LINE>String key = selection.mappings.get(name);<NEW_LINE>if (key == null && name.equals(selection.dflt))<NEW_LINE>key = "Default";<NEW_LINE>if (key != null) {<NEW_LINE>MenuItem ref = new ActionMenuItem(key + ": '" + ast.getLine() + ": " + ast.print() + "'", () -> {<NEW_LINE>int line = ast.getLine() - 1;<NEW_LINE>codeArea.moveTo(line, 0);<NEW_LINE>codeArea.requestFollowCaret();<NEW_LINE>});<NEW_LINE>refs.getItems().add(ref);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (refs.getItems().isEmpty())<NEW_LINE>refs.setDisable(true);<NEW_LINE>menu.getItems().add(refs);<NEW_LINE>codeArea.setContextMenu(menu);<NEW_LINE>} | (LangUtil.translate("ui.edit.method.follow")); |
1,521,550 | protected void importPhoneNumber(Person googlePerson, Partner partner, Boolean updateContactField) {<NEW_LINE>if (googlePerson.getPhoneNumbers() == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>PhoneNumber googleNumb = Mapper.toBean(PhoneNumber.class, googlePerson.getPhoneNumbers().get(0));<NEW_LINE>if (!Strings.isNullOrEmpty(googleNumb.getCanonicalForm())) {<NEW_LINE>if (partner.getMobilePhone() == null) {<NEW_LINE>partner.setMobilePhone(googleNumb.getCanonicalForm().trim());<NEW_LINE>} else {<NEW_LINE>if (!partner.getMobilePhone().equals(googleNumb.getCanonicalForm().trim())) {<NEW_LINE>if (updateContactField) {<NEW_LINE>updateDescription(partner, I18n.get(SYNC_CONTACT_OLD_PHONE_NUMB), partner.getMobilePhone());<NEW_LINE>partner.setMobilePhone(googleNumb.<MASK><NEW_LINE>} else {<NEW_LINE>updateDescription(partner, I18n.get(SYNC_CONTACT_GOOGLE_PHONE_NUMB), googleNumb.getCanonicalForm().trim());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | getCanonicalForm().trim()); |
1,816,773 | protected void applyDye(BlockState state, Level world, BlockPos pos, @Nullable DyeColor color) {<NEW_LINE>BlockState newState = (color == null ? AllBlocks.SAIL_FRAME : AllBlocks.DYED_SAILS.get(color)).getDefaultState();<NEW_LINE>newState = BlockHelper.copyProperties(state, newState);<NEW_LINE>// Dye the block itself<NEW_LINE>if (state != newState) {<NEW_LINE>world.setBlockAndUpdate(pos, newState);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Dye all adjacent<NEW_LINE>for (Direction d : Iterate.directions) {<NEW_LINE>if (d.getAxis() == state.getValue(FACING).getAxis())<NEW_LINE>continue;<NEW_LINE>BlockPos <MASK><NEW_LINE>BlockState adjacentState = world.getBlockState(offset);<NEW_LINE>Block block = adjacentState.getBlock();<NEW_LINE>if (!(block instanceof SailBlock) || ((SailBlock) block).frame)<NEW_LINE>continue;<NEW_LINE>if (state == adjacentState)<NEW_LINE>continue;<NEW_LINE>world.setBlockAndUpdate(offset, newState);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Dye all the things<NEW_LINE>List<BlockPos> frontier = new ArrayList<>();<NEW_LINE>frontier.add(pos);<NEW_LINE>Set<BlockPos> visited = new HashSet<>();<NEW_LINE>int timeout = 100;<NEW_LINE>while (!frontier.isEmpty()) {<NEW_LINE>if (timeout-- < 0)<NEW_LINE>break;<NEW_LINE>BlockPos currentPos = frontier.remove(0);<NEW_LINE>visited.add(currentPos);<NEW_LINE>for (Direction d : Iterate.directions) {<NEW_LINE>if (d.getAxis() == state.getValue(FACING).getAxis())<NEW_LINE>continue;<NEW_LINE>BlockPos offset = currentPos.relative(d);<NEW_LINE>if (visited.contains(offset))<NEW_LINE>continue;<NEW_LINE>BlockState adjacentState = world.getBlockState(offset);<NEW_LINE>Block block = adjacentState.getBlock();<NEW_LINE>if (!(block instanceof SailBlock) || ((SailBlock) block).frame && color != null)<NEW_LINE>continue;<NEW_LINE>if (state != adjacentState)<NEW_LINE>world.setBlockAndUpdate(offset, newState);<NEW_LINE>frontier.add(offset);<NEW_LINE>visited.add(offset);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | offset = pos.relative(d); |
899,266 | private static Template transform(Map<String, Object> map) {<NEW_LINE>final Template template;<NEW_LINE>template = new Template();<NEW_LINE>template.setInode(String.valueOf(map.get("inode")));<NEW_LINE>template.setOwner(String.valueOf(map.get("owner")));<NEW_LINE>template.setIDate((Date) map.get("create_date"));<NEW_LINE>template.setShowOnMenu(ConversionUtils.toBooleanFromDb(map.getOrDefault("show_on_menu", false)));<NEW_LINE>template.setTitle(String.valueOf(map.get("title")));<NEW_LINE>template.setModDate((Date) map.get("mod_date"));<NEW_LINE>template.setModUser(String.valueOf(map.get("mod_user")));<NEW_LINE>template.setSortOrder(ConversionUtils.toInt(map.get("sort_order"), 0));<NEW_LINE>template.setFriendlyName(String.valueOf(map.get("friendly_name")));<NEW_LINE>template.setBody(String.valueOf(map.get("body")));<NEW_LINE>template.setHeader(String.valueOf(map.get("header")));<NEW_LINE>template.setFooter(String.valueOf(map.get("footer")));<NEW_LINE>template.setImage(String.valueOf(map.get("image")));<NEW_LINE>template.setIdentifier(String.valueOf(map.get("identifier")));<NEW_LINE>template.setDrawed(ConversionUtils.toBooleanFromDb(map.get("drawed")));<NEW_LINE>template.setDrawedBody((String) map.get("drawed_body"));<NEW_LINE>template.setCountAddContainer(ConversionUtils.toInt(map.<MASK><NEW_LINE>template.setCountContainers(ConversionUtils.toInt(map.get("containers_added"), 0));<NEW_LINE>template.setHeadCode((String) map.get("head_code"));<NEW_LINE>template.setTheme((String) map.get("theme"));<NEW_LINE>return template;<NEW_LINE>} | get("add_container_links"), 0)); |
945,372 | public int transform(CtClass clazz, int pos, CodeIterator iterator, ConstPool cp) throws CannotCompileException {<NEW_LINE>int index;<NEW_LINE>int c = iterator.byteAt(pos);<NEW_LINE>if (c == NEW) {<NEW_LINE>index = iterator.u16bitAt(pos + 1);<NEW_LINE>if (cp.getClassInfo(index).equals(classname)) {<NEW_LINE>if (iterator.byteAt(pos + 3) != DUP)<NEW_LINE>throw new CannotCompileException("NEW followed by no DUP was found");<NEW_LINE>iterator.writeByte(NOP, pos);<NEW_LINE>iterator.writeByte(NOP, pos + 1);<NEW_LINE>iterator.writeByte(NOP, pos + 2);<NEW_LINE>iterator.writeByte(NOP, pos + 3);<NEW_LINE>++nested;<NEW_LINE>StackMapTable smt = (StackMapTable) iterator.get().getAttribute(StackMapTable.tag);<NEW_LINE>if (smt != null)<NEW_LINE>smt.removeNew(pos);<NEW_LINE>StackMap sm = (StackMap) iterator.get(<MASK><NEW_LINE>if (sm != null)<NEW_LINE>sm.removeNew(pos);<NEW_LINE>}<NEW_LINE>} else if (c == INVOKESPECIAL) {<NEW_LINE>index = iterator.u16bitAt(pos + 1);<NEW_LINE>int typedesc = cp.isConstructor(classname, index);<NEW_LINE>if (typedesc != 0 && nested > 0) {<NEW_LINE>int methodref = computeMethodref(typedesc, cp);<NEW_LINE>iterator.writeByte(INVOKESTATIC, pos);<NEW_LINE>iterator.write16bit(methodref, pos + 1);<NEW_LINE>--nested;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return pos;<NEW_LINE>} | ).getAttribute(StackMap.tag); |
1,525,692 | public synchronized void createTweet(Status status, int account) {<NEW_LINE>ContentValues values = new ContentValues();<NEW_LINE>String originalName = "";<NEW_LINE>long id = status.getId();<NEW_LINE>long time = status.getCreatedAt().getTime();<NEW_LINE>String[] html = TweetLinkUtils.getLinksInStatus(status);<NEW_LINE>String text = html[0];<NEW_LINE>String media = html[1];<NEW_LINE>String otherUrl = html[2];<NEW_LINE>String hashtags = html[3];<NEW_LINE>String users = html[4];<NEW_LINE>if (media.contains("/tweet_video/")) {<NEW_LINE>media = media.replace("tweet_video", "tweet_video_thumb").replace(".mp4", ".png");<NEW_LINE>}<NEW_LINE>values.put(MentionsSQLiteHelper.COLUMN_ACCOUNT, account);<NEW_LINE>values.put(MentionsSQLiteHelper.COLUMN_TEXT, text);<NEW_LINE>values.put(MentionsSQLiteHelper.COLUMN_TWEET_ID, id);<NEW_LINE>values.put(MentionsSQLiteHelper.COLUMN_NAME, status.<MASK><NEW_LINE>values.put(MentionsSQLiteHelper.COLUMN_PRO_PIC, status.getUser().getOriginalProfileImageURL());<NEW_LINE>values.put(MentionsSQLiteHelper.COLUMN_SCREEN_NAME, status.getUser().getScreenName());<NEW_LINE>values.put(MentionsSQLiteHelper.COLUMN_TIME, time);<NEW_LINE>values.put(MentionsSQLiteHelper.COLUMN_RETWEETER, originalName);<NEW_LINE>values.put(MentionsSQLiteHelper.COLUMN_UNREAD, 1);<NEW_LINE>values.put(MentionsSQLiteHelper.COLUMN_PIC_URL, media);<NEW_LINE>values.put(MentionsSQLiteHelper.COLUMN_URL, otherUrl);<NEW_LINE>values.put(MentionsSQLiteHelper.COLUMN_USERS, users);<NEW_LINE>values.put(MentionsSQLiteHelper.COLUMN_HASHTAGS, hashtags);<NEW_LINE>values.put(MentionsSQLiteHelper.COLUMN_ANIMATED_GIF, TweetLinkUtils.getGIFUrl(status, otherUrl));<NEW_LINE>values.put(HomeSQLiteHelper.COLUMN_CONVERSATION, status.getInReplyToStatusId() == -1 ? 0 : 1);<NEW_LINE>try {<NEW_LINE>database.insert(MentionsSQLiteHelper.TABLE_MENTIONS, null, values);<NEW_LINE>} catch (Exception e) {<NEW_LINE>open();<NEW_LINE>database.insert(MentionsSQLiteHelper.TABLE_MENTIONS, null, values);<NEW_LINE>}<NEW_LINE>} | getUser().getName()); |
828,342 | final ListFlowsResult executeListFlows(ListFlowsRequest listFlowsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listFlowsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListFlowsRequest> request = null;<NEW_LINE>Response<ListFlowsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListFlowsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listFlowsRequest));<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, "MediaConnect");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListFlows");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListFlowsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListFlowsResultJsonUnmarshaller());<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); |
1,055,915 | public Object execute(final Map<Object, Object> iArgs) {<NEW_LINE>if (schemaClass == null)<NEW_LINE>throw new OCommandExecutionException("Cannot execute the command because it has not been parsed yet");<NEW_LINE>final long recs = schemaClass.count(deep);<NEW_LINE>if (recs > 0 && !unsafe) {<NEW_LINE>if (schemaClass.isSubClassOf("V")) {<NEW_LINE>throw new OCommandExecutionException("'TRUNCATE CLASS' command cannot be used on not empty vertex classes. Apply the 'UNSAFE' keyword to force it (at your own risk)");<NEW_LINE>} else if (schemaClass.isSubClassOf("E")) {<NEW_LINE>throw new OCommandExecutionException("'TRUNCATE CLASS' command cannot be used on not empty edge classes. Apply the 'UNSAFE' keyword to force it (at your own risk)");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Collection<OClass> subclasses = schemaClass.getAllSubclasses();<NEW_LINE>if (deep && !unsafe) {<NEW_LINE>// for multiple inheritance<NEW_LINE>for (OClass subclass : subclasses) {<NEW_LINE><MASK><NEW_LINE>if (subclassRecs > 0) {<NEW_LINE>if (subclass.isSubClassOf("V")) {<NEW_LINE>throw new OCommandExecutionException("'TRUNCATE CLASS' command cannot be used on not empty vertex classes (" + subclass.getName() + "). Apply the 'UNSAFE' keyword to force it (at your own risk)");<NEW_LINE>} else if (subclass.isSubClassOf("E")) {<NEW_LINE>throw new OCommandExecutionException("'TRUNCATE CLASS' command cannot be used on not empty edge classes (" + subclass.getName() + "). Apply the 'UNSAFE' keyword to force it (at your own risk)");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>schemaClass.truncate();<NEW_LINE>if (deep) {<NEW_LINE>for (OClass subclass : subclasses) {<NEW_LINE>subclass.truncate();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw OException.wrapException(new OCommandExecutionException("Error on executing command"), e);<NEW_LINE>}<NEW_LINE>return recs;<NEW_LINE>} | long subclassRecs = schemaClass.count(); |
1,021,614 | static // http://www.ecb.europa.eu/press/pr/date/2000/html/pr001214_4.en.html<NEW_LINE>ImmutableHolidayCalendar generateEuropeanTarget() {<NEW_LINE>List<LocalDate> holidays = new ArrayList<>(2000);<NEW_LINE>for (int year = 1997; year <= 2099; year++) {<NEW_LINE>if (year >= 2000) {<NEW_LINE>holidays.add(date(year, 1, 1));<NEW_LINE>holidays.add(easter(year).minusDays(2));<NEW_LINE>holidays.add(easter(year).plusDays(1));<NEW_LINE>holidays.add(date<MASK><NEW_LINE>holidays.add(date(year, 12, 25));<NEW_LINE>holidays.add(date(year, 12, 26));<NEW_LINE>} else {<NEW_LINE>// 1997 to 1999<NEW_LINE>holidays.add(date(year, 1, 1));<NEW_LINE>holidays.add(date(year, 12, 25));<NEW_LINE>}<NEW_LINE>if (year == 1999 || year == 2001) {<NEW_LINE>holidays.add(date(year, 12, 31));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>removeSatSun(holidays);<NEW_LINE>return ImmutableHolidayCalendar.of(HolidayCalendarIds.EUTA, holidays, SATURDAY, SUNDAY);<NEW_LINE>} | (year, 5, 1)); |
330,072 | protected int encodeLogViewLink(MessageTree tree, Message message, ByteBuf buf, int level, LineCounter counter) {<NEW_LINE>BufferHelper helper = m_bufferHelper;<NEW_LINE>Map<String, String> links = parseLinks(message.getData().toString());<NEW_LINE>int count = 0;<NEW_LINE>for (Map.Entry<String, String> e : links.entrySet()) {<NEW_LINE>String link = e.getKey();<NEW_LINE>String title = e.getValue();<NEW_LINE>if (title.length() == 0) {<NEW_LINE>title = "show";<NEW_LINE>}<NEW_LINE>if (counter != null) {<NEW_LINE>counter.inc();<NEW_LINE>count += helper.tr1(buf, "link");<NEW_LINE>} else {<NEW_LINE>count += helper.tr1(buf, null);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>// 2 spaces per level<NEW_LINE>count += helper.nbsp(buf, level * 2);<NEW_LINE>count += //<NEW_LINE>helper.//<NEW_LINE>write(//<NEW_LINE>buf, //<NEW_LINE>String.//<NEW_LINE>format("<a href=\"%s%s\" onclick=\"return show(this,'%s');\">[:: %s ::]</a>", m_logViewPrefix, link, link, title));<NEW_LINE>count += helper.td2(buf);<NEW_LINE>count += helper.td(buf, "<div id=\"" + link + "\"></div>", "colspan=\"4\"");<NEW_LINE>count += helper.tr2(buf);<NEW_LINE>count += helper.crlf(buf);<NEW_LINE>}<NEW_LINE>return count;<NEW_LINE>} | count += helper.td1(buf); |
1,480,078 | public Observable<T> subscribeChannel(String channelName, Object... args) {<NEW_LINE>final String channelId = getSubscriptionUniqueId(channelName, args);<NEW_LINE>LOG.info("Subscribing to channel {}", channelId);<NEW_LINE>return Observable.<T>create(e -> {<NEW_LINE>if (webSocketChannel == null || !webSocketChannel.isOpen()) {<NEW_LINE>e.onError(new NotConnectedException());<NEW_LINE>}<NEW_LINE>channels.computeIfAbsent(channelId, cid -> {<NEW_LINE>Subscription newSubscription = new <MASK><NEW_LINE>try {<NEW_LINE>sendMessage(getSubscribeMessage(channelName, args));<NEW_LINE>} catch (Exception throwable) {<NEW_LINE>// if getSubscribeMessage throws this, it is because it<NEW_LINE>// needs to report<NEW_LINE>// a problem creating the message<NEW_LINE>e.onError(throwable);<NEW_LINE>}<NEW_LINE>return newSubscription;<NEW_LINE>});<NEW_LINE>}).doOnDispose(() -> {<NEW_LINE>if (channels.remove(channelId) != null) {<NEW_LINE>try {<NEW_LINE>sendMessage(getUnsubscribeMessage(channelId));<NEW_LINE>} catch (IOException e) {<NEW_LINE>LOG.debug("Failed to unsubscribe channel: {} {}", channelId, e.toString());<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.warn("Failed to unsubscribe channel: {}", channelId, e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}).share();<NEW_LINE>} | Subscription(e, channelName, args); |
895,712 | private void mergeOrdinal(int i) {<NEW_LINE>boolean addFromDelta = additionsReader.nextElement() == i;<NEW_LINE>boolean removeData = removalsReader.nextElement() == i;<NEW_LINE>for (int fieldIndex = 0; fieldIndex < numMergeFields; fieldIndex++) {<NEW_LINE>int deltaFieldIndex = deltaFieldIndexMapping[fieldIndex];<NEW_LINE>if (addFromDelta) {<NEW_LINE>addFromDelta(removeData, fieldIndex, deltaFieldIndex);<NEW_LINE>} else {<NEW_LINE>if (i <= from.maxOrdinal) {<NEW_LINE>long readStartBit = currentFromStateReadFixedLengthStartBit + from.bitOffsetPerField[fieldIndex];<NEW_LINE>copyRecordField(fieldIndex, fieldIndex, from, readStartBit, <MASK><NEW_LINE>} else if (target.varLengthData[fieldIndex] != null) {<NEW_LINE>writeNullVarLengthField(fieldIndex, currentWriteFixedLengthStartBit, currentWriteVarLengthDataPointers);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>currentWriteFixedLengthStartBit += target.bitsPerField[fieldIndex];<NEW_LINE>}<NEW_LINE>if (addFromDelta) {<NEW_LINE>currentDeltaStateReadFixedLengthStartBit += delta.bitsPerRecord;<NEW_LINE>additionsReader.advance();<NEW_LINE>}<NEW_LINE>currentFromStateReadFixedLengthStartBit += from.bitsPerRecord;<NEW_LINE>if (removeData)<NEW_LINE>removalsReader.advance();<NEW_LINE>} | currentWriteFixedLengthStartBit, currentFromStateReadVarLengthDataPointers, currentWriteVarLengthDataPointers, removeData); |
1,043,010 | final public CompletableFuture<Integer> write(ChunkHandle handle, long offset, int length, InputStream data) {<NEW_LINE>Exceptions.checkNotClosed(this.closed.get(), this);<NEW_LINE>// Validate parameters<NEW_LINE>Preconditions.checkArgument(null != handle, "handle must not be null");<NEW_LINE>checkChunkName(handle.getChunkName());<NEW_LINE>Preconditions.checkArgument(!handle.isReadOnly(), "handle must not be readonly. Chunk = %s", handle.getChunkName());<NEW_LINE>Preconditions.checkArgument(null != data, "data must not be null");<NEW_LINE>Preconditions.checkArgument(offset >= 0, "offset must be non-negative. Chunk=%s offset=%s", handle.getChunkName(), offset);<NEW_LINE>Preconditions.checkArgument(length >= 0, "length must be non-negative. Chunk=%s length=%s", handle.getChunkName(), length);<NEW_LINE>if (!supportsAppend()) {<NEW_LINE>Preconditions.checkArgument(offset == 0, "offset must be 0 because storage does not support appends.");<NEW_LINE>}<NEW_LINE>val traceId = LoggerHelpers.traceEnter(log, "write", handle.getChunkName(), offset, length);<NEW_LINE>val opContext = new OperationContext();<NEW_LINE>// Call concrete implementation.<NEW_LINE>val returnFuture = doWriteAsync(handle, <MASK><NEW_LINE>returnFuture.thenAcceptAsync(bytesWritten -> {<NEW_LINE>val elapsed = opContext.getInclusiveLatency();<NEW_LINE>ChunkStorageMetrics.WRITE_LATENCY.reportSuccessEvent(elapsed);<NEW_LINE>ChunkStorageMetrics.WRITE_BYTES.add(bytesWritten);<NEW_LINE>log.debug("Write - chunk={}, offset={}, bytesWritten={}, latency={}.", handle.getChunkName(), offset, length, elapsed.toMillis());<NEW_LINE>LoggerHelpers.traceLeave(log, "write", traceId, bytesWritten);<NEW_LINE>}, executor);<NEW_LINE>return returnFuture;<NEW_LINE>} | offset, length, data, opContext); |
510,848 | private void decodeRows() throws EOFException {<NEW_LINE>decodedLength = decodedRows.length;<NEW_LINE>for (int u = 0; u < units; u++) {<NEW_LINE>if (bufferPos >= bufferLength) {<NEW_LINE>throw new EOFException("Unexpected end of stream");<NEW_LINE>}<NEW_LINE>// Decode one unit<NEW_LINE>byte cb1 = buffer[bufferPos + unitSize - 4];<NEW_LINE>byte cb2 = buffer[bufferPos + unitSize - 3];<NEW_LINE>byte cr1 = buffer[bufferPos + unitSize - 2];<NEW_LINE>byte cr2 = buffer[bufferPos + unitSize - 1];<NEW_LINE>for (int y = 0; y < vertChromaSub; y++) {<NEW_LINE>for (int x = 0; x < horizChromaSub; x++) {<NEW_LINE>// Skip padding at end of row<NEW_LINE>int column = horizChromaSub * u + x;<NEW_LINE>if (column >= columns) {<NEW_LINE>bufferPos += padding;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>int pixelOff = 2 * 3 * (column + columns * y);<NEW_LINE>decodedRows[pixelOff] = buffer[bufferPos++];<NEW_LINE>decodedRows[pixelOff + 1] = buffer[bufferPos++];<NEW_LINE>decodedRows[pixelOff + 2] = cb1;<NEW_LINE>decodedRows[pixelOff + 3] = cb2;<NEW_LINE>decodedRows[pixelOff + 4] = cr1;<NEW_LINE><MASK><NEW_LINE>// Convert to RGB<NEW_LINE>// convertYCbCr2RGB(decodedRows, decodedRows, coefficients, pixelOff);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Skip CbCr bytes at end of unit<NEW_LINE>bufferPos += 2 * 2;<NEW_LINE>}<NEW_LINE>bufferPos = bufferLength;<NEW_LINE>decodedPos = 0;<NEW_LINE>} | decodedRows[pixelOff + 5] = cr2; |
291,015 | private void saveSettings() {<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();<NEW_LINE>Document document = documentBuilder.newDocument();<NEW_LINE>Element settingsElement = document.createElement("settings");<NEW_LINE>document.appendChild(settingsElement);<NEW_LINE>Element codeElement = document.createElement("code");<NEW_LINE>settingsElement.appendChild(codeElement);<NEW_LINE>codeElement.setAttribute("language-version", getLanguageVersion().getTerseName());<NEW_LINE>codeElement.appendChild(document.createCDATASection(codeEditorPane.getText()));<NEW_LINE>Element xpathElement = document.createElement("xpath");<NEW_LINE>settingsElement.appendChild(xpathElement);<NEW_LINE>xpathElement.setAttribute("version", xpathVersionButtonGroup.getSelection().getActionCommand());<NEW_LINE>xpathElement.appendChild(document.createCDATASection(xpathQueryArea.getText()));<NEW_LINE>TransformerFactory transformerFactory = TransformerFactory.newInstance();<NEW_LINE>Transformer transformer = transformerFactory.newTransformer();<NEW_LINE>transformer.setOutputProperty(OutputKeys.METHOD, "xml");<NEW_LINE>// This is as close to pretty printing as we'll get using standard<NEW_LINE>// Java APIs.<NEW_LINE>transformer.setOutputProperty(OutputKeys.INDENT, "yes");<NEW_LINE>transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "3");<NEW_LINE>transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");<NEW_LINE>Source source = new DOMSource(document);<NEW_LINE>Result result = new StreamResult(Files.newBufferedWriter(new File(SETTINGS_FILE_NAME).toPath(), StandardCharsets.UTF_8));<NEW_LINE>transformer.transform(source, result);<NEW_LINE>} catch (ParserConfigurationException | IOException | TransformerException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>} | DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); |
1,572,103 | private Mono<Response<List<VnetInfoInner>>> listVnetConnectionsWithResponseAsync(String resourceGroupName, String name, 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 (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (name == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter name 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>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.listVnetConnections(this.client.getEndpoint(), resourceGroupName, name, this.client.getSubscriptionId(), this.client.<MASK><NEW_LINE>} | getApiVersion(), accept, context); |
1,304,764 | final EnterStandbyResult executeEnterStandby(EnterStandbyRequest enterStandbyRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(enterStandbyRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<EnterStandbyRequest> request = null;<NEW_LINE>Response<EnterStandbyResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new EnterStandbyRequestMarshaller().marshall(super.beforeMarshalling(enterStandbyRequest));<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, "Auto Scaling");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "EnterStandby");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<EnterStandbyResult> responseHandler = new StaxResponseHandler<EnterStandbyResult>(new EnterStandbyResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.ClientExecuteTime); |
1,517,749 | public PrivateKey parse() throws GeneralSecurityException, IOException {<NEW_LINE>Path path = pemFile.toPath();<NEW_LINE>String privateKeyPem = new String(Files.readAllBytes(path));<NEW_LINE>if (privateKeyPem.contains(PEM_PRIVATE_START)) {<NEW_LINE>// PKCS#8 format<NEW_LINE>privateKeyPem = privateKeyPem.replace(PEM_PRIVATE_START, "").replace(PEM_PRIVATE_END, "").replaceAll("\\s", "");<NEW_LINE>byte[] pkcs8EncodedKey = Base64.getDecoder().decode(privateKeyPem);<NEW_LINE>KeyFactory factory = KeyFactory.getInstance("RSA");<NEW_LINE>return factory.generatePrivate(new PKCS8EncodedKeySpec(pkcs8EncodedKey));<NEW_LINE>} else if (privateKeyPem.contains(PEM_RSA_PRIVATE_START)) {<NEW_LINE>// PKCS#1 format<NEW_LINE>privateKeyPem = privateKeyPem.replace(PEM_RSA_PRIVATE_START, "").replace(PEM_RSA_PRIVATE_END, "").replaceAll("\\s", "");<NEW_LINE>DerParser parser = new DerParser(new ByteArrayInputStream(Base64.getDecoder().decode(privateKeyPem)));<NEW_LINE>Asn1Object sequence = parser.read();<NEW_LINE>parser = sequence.read();<NEW_LINE>// Skip version<NEW_LINE>parser.read();<NEW_LINE>BigInteger modulus = parser.read().getBigInteger();<NEW_LINE>BigInteger publicExp = parser.read().getBigInteger();<NEW_LINE>BigInteger privateExp = parser.read().getBigInteger();<NEW_LINE>BigInteger prime1 = parser.read().getBigInteger();<NEW_LINE>BigInteger prime2 = parser.read().getBigInteger();<NEW_LINE>BigInteger exp1 = parser<MASK><NEW_LINE>BigInteger exp2 = parser.read().getBigInteger();<NEW_LINE>BigInteger crtCoef = parser.read().getBigInteger();<NEW_LINE>RSAPrivateCrtKeySpec keySpec = new RSAPrivateCrtKeySpec(modulus, publicExp, privateExp, prime1, prime2, exp1, exp2, crtCoef);<NEW_LINE>KeyFactory factory = KeyFactory.getInstance("RSA");<NEW_LINE>return factory.generatePrivate(keySpec);<NEW_LINE>} else {<NEW_LINE>throw new GeneralSecurityException("The format of the key is not supported");<NEW_LINE>}<NEW_LINE>} | .read().getBigInteger(); |
1,455,792 | private static Object replaceMotifLazyInputMaps(Object k, Object v) {<NEW_LINE>if (!(v instanceof UIDefaults.LazyInputMap))<NEW_LINE>return v;<NEW_LINE>return new UIDefaults.LazyValue() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Object createValue(UIDefaults table) {<NEW_LINE>Object value = ((UIDefaults.LazyInputMap) v).createValue(table);<NEW_LINE>if (!(value instanceof InputMap))<NEW_LINE>return value;<NEW_LINE>InputMap inputMap = (InputMap) value;<NEW_LINE>KeyStroke keyStrokeControlC = keystrokes.computeIfAbsent("control C", KeyStroke::getKeyStroke);<NEW_LINE>if (inputMap.get(keyStrokeControlC) != null)<NEW_LINE>return value;<NEW_LINE>KeyStroke keyStrokeCopy = keystrokes.computeIfAbsent("COPY", KeyStroke::getKeyStroke);<NEW_LINE>Object copyValue = inputMap.get(keyStrokeCopy);<NEW_LINE>if (copyValue == null)<NEW_LINE>return value;<NEW_LINE>inputMap.put(keyStrokeControlC, copyValue);<NEW_LINE>KeyStroke keyStrokePaste = keystrokes.computeIfAbsent("PASTE", KeyStroke::getKeyStroke);<NEW_LINE>KeyStroke keyStrokeControlV = keystrokes.computeIfAbsent("control V", KeyStroke::getKeyStroke);<NEW_LINE>inputMap.put(keyStrokeControlV<MASK><NEW_LINE>KeyStroke keyStrokeCut = keystrokes.computeIfAbsent("CUT", KeyStroke::getKeyStroke);<NEW_LINE>KeyStroke keyStrokeControlX = keystrokes.computeIfAbsent("control X", KeyStroke::getKeyStroke);<NEW_LINE>inputMap.put(keyStrokeControlX, inputMap.get(keyStrokeCut));<NEW_LINE>return inputMap;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>} | , inputMap.get(keyStrokePaste)); |
443,890 | public void applyMigrationScripts(@NonNull final RolloutMigrationConfig config, @NonNull final DBConnectionSettings dbConnectionSettings, @NonNull final String dbName) {<NEW_LINE>logger.info("Just mark the script as executed: " + config.isJustMarkScriptAsExecuted());<NEW_LINE>logger.info("Script file: " + config.getScriptFileName());<NEW_LINE>final AbstractScriptsApplierTemplate scriptApplier = new AbstractScriptsApplierTemplate() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected IScriptFactory createScriptFactory() {<NEW_LINE>return new RolloutDirScriptFactory();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void configureScriptExecutorFactory(final IScriptExecutorFactory scriptExecutorFactory) {<NEW_LINE>scriptExecutorFactory.setDryRunMode(config.isJustMarkScriptAsExecuted());<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected IScriptScanner createScriptScanner(final IScriptScannerFactory scriptScannerFactory) {<NEW_LINE>final CompositeScriptScanner scriptScanners = new CompositeScriptScanner();<NEW_LINE>final File sqlDir = constructSqlDir(config.getRolloutDirName());<NEW_LINE>if (config.getScriptFileName() != null && !config.getScriptFileName().isEmpty()) {<NEW_LINE>if (new File(config.getScriptFileName()).exists()) {<NEW_LINE>final <MASK><NEW_LINE>final IScriptScanner scriptScanner = scriptScannerFactory.createScriptScannerByFilename(filename);<NEW_LINE>scriptScanners.addScriptScanner(scriptScanner);<NEW_LINE>} else {<NEW_LINE>final String filename = sqlDir.getAbsolutePath() + File.separator + config.getScriptFileName();<NEW_LINE>final IScriptScanner scriptScanner = scriptScannerFactory.createScriptScannerByFilename(filename);<NEW_LINE>scriptScanners.addScriptScanner(scriptScanner);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>final String filename = sqlDir.getAbsolutePath();<NEW_LINE>final IScriptScanner scriptScanner = scriptScannerFactory.createScriptScannerByFilename(filename);<NEW_LINE>scriptScanners.addScriptScanner(scriptScanner);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>config.getAdditionalSqlDirs().stream().forEach(file -> {<NEW_LINE>final IScriptScanner scriptScanner = scriptScannerFactory.createScriptScanner(file);<NEW_LINE>if (scriptScanner == null) {<NEW_LINE>throw new RuntimeException("Cannot create script scanner from " + file);<NEW_LINE>}<NEW_LINE>logger.info("Additional SQL source: {}", file);<NEW_LINE>scriptScanners.addScriptScanner(scriptScanner);<NEW_LINE>});<NEW_LINE>return new GloballyOrderedScannerDecorator(scriptScanners);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected IScriptsApplierListener createScriptsApplierListener() {<NEW_LINE>return config.getScriptsApplierListener();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected IDatabase createDatabase() {<NEW_LINE>return dbconnectionMaker.createDb(dbConnectionSettings, dbName);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>scriptApplier.run();<NEW_LINE>} | String filename = config.getScriptFileName(); |
1,275,272 | private void loadNode964() {<NEW_LINE>BaseDataVariableTypeNode node = new BaseDataVariableTypeNode(this.context, Identifiers.SessionDiagnosticsObjectType_SessionDiagnostics_HistoryUpdateCount, new QualifiedName(0, "HistoryUpdateCount"), new LocalizedText("en", "HistoryUpdateCount"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.ServiceCounterDataType, -1, new UInteger[] {}, UByte.valueOf(1), UByte.valueOf(1), 0.0, false);<NEW_LINE>node.addReference(new Reference(Identifiers.SessionDiagnosticsObjectType_SessionDiagnostics_HistoryUpdateCount, Identifiers.HasTypeDefinition, Identifiers.BaseDataVariableType.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.SessionDiagnosticsObjectType_SessionDiagnostics_HistoryUpdateCount, Identifiers.HasModellingRule, Identifiers.ModellingRule_Mandatory.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.SessionDiagnosticsObjectType_SessionDiagnostics_HistoryUpdateCount, Identifiers.HasComponent, Identifiers.SessionDiagnosticsObjectType_SessionDiagnostics.expanded(), false));<NEW_LINE><MASK><NEW_LINE>} | this.nodeManager.addNode(node); |
429,011 | public static void splitSameNamedVariablesOfDiffTypes(MethodNode node) {<NEW_LINE>if (node.localVariables == null)<NEW_LINE>return;<NEW_LINE>Map<Integer, LocalVariableNode> indexToVar = new HashMap<>();<NEW_LINE>Map<Integer, String> indexToName = new HashMap<>();<NEW_LINE>Map<String, Integer> nameToIndex = new HashMap<>();<NEW_LINE>boolean changed = false;<NEW_LINE>for (LocalVariableNode lvn : node.localVariables) {<NEW_LINE>int index = lvn.index;<NEW_LINE>String name = lvn.name;<NEW_LINE>if (indexToName.containsValue(name)) {<NEW_LINE>// The variable name is NOT unique.<NEW_LINE>// Set both variables names to <NAME + INDEX><NEW_LINE>// Even with 3+ duplicates, this method will give each a unique index-based name.<NEW_LINE>int otherIndex = nameToIndex.get(name);<NEW_LINE>LocalVariableNode otherLvn = indexToVar.get(otherIndex);<NEW_LINE>if (!lvn.desc.equals(otherLvn.desc)) {<NEW_LINE>if (index != otherIndex) {<NEW_LINE>// Different indices are used<NEW_LINE>lvn.name = name + index;<NEW_LINE>otherLvn.name = name + otherIndex;<NEW_LINE>} else {<NEW_LINE>// Same index but other type?<NEW_LINE>// Just give it a random name.<NEW_LINE>// TODO: Naming instead off of types would be better.<NEW_LINE>lvn.name = nextIndexName(name, node);<NEW_LINE>}<NEW_LINE>changed = true;<NEW_LINE>}<NEW_LINE>// Update maps<NEW_LINE>indexToVar.put(index, lvn);<NEW_LINE>indexToName.put(index, lvn.name);<NEW_LINE>nameToIndex.<MASK><NEW_LINE>} else {<NEW_LINE>// The variable name is unique.<NEW_LINE>// Update maps<NEW_LINE>indexToVar.put(index, lvn);<NEW_LINE>indexToName.put(index, name);<NEW_LINE>nameToIndex.put(name, index);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Logging<NEW_LINE>if (changed) {<NEW_LINE>Log.warn("Separating variables of same name pointing to different indices: " + node.name + node.desc);<NEW_LINE>}<NEW_LINE>} | put(lvn.name, index); |
647,992 | protected void write(ClassWriter classWriter, MethodWriter methodWriter, WriteScope writeScope) {<NEW_LINE>methodWriter.writeStatementOffset(getLocation());<NEW_LINE>Variable variable = writeScope.defineVariable(variableType, variableName);<NEW_LINE>Variable iterator = writeScope.defineInternalVariable(iteratorType, iteratorName);<NEW_LINE>getConditionNode().write(classWriter, methodWriter, writeScope);<NEW_LINE>if (method == null) {<NEW_LINE>org.objectweb.asm.Type methodType = org.objectweb.asm.Type.getMethodType(org.objectweb.asm.Type.getType(Iterator.class), org.objectweb.asm.Type.getType(Object.class));<NEW_LINE>methodWriter.invokeDefCall(<MASK><NEW_LINE>} else {<NEW_LINE>methodWriter.invokeMethodCall(method);<NEW_LINE>}<NEW_LINE>methodWriter.visitVarInsn(iterator.getAsmType().getOpcode(Opcodes.ISTORE), iterator.getSlot());<NEW_LINE>Label begin = new Label();<NEW_LINE>Label end = new Label();<NEW_LINE>methodWriter.mark(begin);<NEW_LINE>methodWriter.visitVarInsn(iterator.getAsmType().getOpcode(Opcodes.ILOAD), iterator.getSlot());<NEW_LINE>methodWriter.invokeInterface(ITERATOR_TYPE, ITERATOR_HASNEXT);<NEW_LINE>methodWriter.ifZCmp(MethodWriter.EQ, end);<NEW_LINE>methodWriter.visitVarInsn(iterator.getAsmType().getOpcode(Opcodes.ILOAD), iterator.getSlot());<NEW_LINE>methodWriter.invokeInterface(ITERATOR_TYPE, ITERATOR_NEXT);<NEW_LINE>methodWriter.writeCast(cast);<NEW_LINE>methodWriter.visitVarInsn(variable.getAsmType().getOpcode(Opcodes.ISTORE), variable.getSlot());<NEW_LINE>Variable loop = writeScope.getInternalVariable("loop");<NEW_LINE>if (loop != null) {<NEW_LINE>methodWriter.writeLoopCounter(loop.getSlot(), getLocation());<NEW_LINE>}<NEW_LINE>getBlockNode().continueLabel = begin;<NEW_LINE>getBlockNode().breakLabel = end;<NEW_LINE>getBlockNode().write(classWriter, methodWriter, writeScope);<NEW_LINE>methodWriter.goTo(begin);<NEW_LINE>methodWriter.mark(end);<NEW_LINE>} | "iterator", methodType, DefBootstrap.ITERATOR); |
848,712 | public boolean rawInvocation(Request request, Response response) throws Exception {<NEW_LINE>// Mark an evolution as resolved<NEW_LINE>if (Play.mode.isDev() && request.method.equals("POST") && request.url.matches("^/@evolutions/force/[a-zA-Z0-9]+/[0-9]+$")) {<NEW_LINE>int index = request.url.lastIndexOf("/@evolutions/force/") + "/@evolutions/force/".length();<NEW_LINE>String dbName = DB.DEFAULT;<NEW_LINE>String moduleKey = request.url.substring(index, request.url.lastIndexOf('/'));<NEW_LINE>int revision = Integer.parseInt(request.url.substring(request.url.lastIndexOf('/') + 1));<NEW_LINE>resolve(dbName, moduleKey, revision);<NEW_LINE>new Redirect("/").apply(request, response);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>// Apply the current evolution script<NEW_LINE>if (Play.mode.isDev() && request.method.equals("POST") && request.url.equals("/@evolutions/apply")) {<NEW_LINE>for (Entry<String, VirtualFile> moduleRoot : modulesWithEvolutions.entrySet()) {<NEW_LINE>applyScript(true, moduleRoot.getKey(<MASK><NEW_LINE>}<NEW_LINE>new Redirect("/").apply(request, response);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return super.rawInvocation(request, response);<NEW_LINE>} | ), moduleRoot.getValue()); |
1,011,785 | private // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents<NEW_LINE>void initComponents() {<NEW_LINE>java.awt.GridBagConstraints gridBagConstraints;<NEW_LINE>titleLabel = new javax.swing.JLabel();<NEW_LINE>jScrollPane1 = new javax.swing.JScrollPane();<NEW_LINE>viewsList = new javax.swing.JList<SymfonyViewItem>();<NEW_LINE>setFocusCycleRoot(true);<NEW_LINE>setLayout(new java.awt.GridBagLayout());<NEW_LINE>titleLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);<NEW_LINE>// NOI18N<NEW_LINE>titleLabel.setText(org.openide.util.NbBundle.getMessage(SymfonyGoToViewActionPanel.class, "SymfonyGoToViewActionPanel.titleLabel.text"));<NEW_LINE>titleLabel.setFocusable(false);<NEW_LINE>gridBagConstraints = new java.awt.GridBagConstraints();<NEW_LINE>gridBagConstraints.fill <MASK><NEW_LINE>add(titleLabel, gridBagConstraints);<NEW_LINE>viewsList.setModel(createListModel());<NEW_LINE>viewsList.setSelectedIndex(0);<NEW_LINE>viewsList.setVisibleRowCount(views.size());<NEW_LINE>viewsList.addMouseListener(new java.awt.event.MouseAdapter() {<NEW_LINE><NEW_LINE>public void mouseClicked(java.awt.event.MouseEvent evt) {<NEW_LINE>viewsListMouseClicked(evt);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>viewsList.addKeyListener(new java.awt.event.KeyAdapter() {<NEW_LINE><NEW_LINE>public void keyPressed(java.awt.event.KeyEvent evt) {<NEW_LINE>viewsListKeyPressed(evt);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>jScrollPane1.setViewportView(viewsList);<NEW_LINE>gridBagConstraints = new java.awt.GridBagConstraints();<NEW_LINE>gridBagConstraints.gridx = 0;<NEW_LINE>gridBagConstraints.gridy = 1;<NEW_LINE>gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;<NEW_LINE>gridBagConstraints.weightx = 1.0;<NEW_LINE>gridBagConstraints.weighty = 1.0;<NEW_LINE>add(jScrollPane1, gridBagConstraints);<NEW_LINE>} | = java.awt.GridBagConstraints.HORIZONTAL; |
1,003,918 | private static SqlRexConvertlet coalesceConvertlet() {<NEW_LINE>return (cx, call) -> {<NEW_LINE><MASK><NEW_LINE>if (operandsCount == 1) {<NEW_LINE>return cx.convertExpression(call.operand(0));<NEW_LINE>} else {<NEW_LINE>List<RexNode> caseOperands = new ArrayList<>();<NEW_LINE>for (int i = 0; i < operandsCount - 1; i++) {<NEW_LINE>RexNode caseOperand = cx.convertExpression(call.operand(i));<NEW_LINE>caseOperands.add(cx.getRexBuilder().makeCall(SqlStdOperatorTable.IS_NOT_NULL, caseOperand));<NEW_LINE>caseOperands.add(caseOperand);<NEW_LINE>}<NEW_LINE>caseOperands.add(cx.convertExpression(call.operand(operandsCount - 1)));<NEW_LINE>return cx.getRexBuilder().makeCall(SqlStdOperatorTable.CASE, caseOperands);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>} | int operandsCount = call.operandCount(); |
692,878 | public void processOpts() {<NEW_LINE>super.processOpts();<NEW_LINE>// handle library not being set<NEW_LINE>if (additionalProperties.get(CodegenConstants.SERIALIZATION_LIBRARY) == null) {<NEW_LINE>this.library = SERIALIZATION_LIBRARY_NATIVE;<NEW_LINE>LOGGER.debug("Serialization library not set, using default {}", SERIALIZATION_LIBRARY_NATIVE);<NEW_LINE>} else {<NEW_LINE>this.library = additionalProperties.get(CodegenConstants.SERIALIZATION_LIBRARY).toString();<NEW_LINE>}<NEW_LINE>this.setSerializationLibrary();<NEW_LINE>final String libFolder = sourceFolder + File.separator + "lib";<NEW_LINE>supportingFiles.add(new SupportingFile("pubspec.mustache", "", "pubspec.yaml"));<NEW_LINE>supportingFiles.add(new SupportingFile("analysis_options.mustache", "", "analysis_options.yaml"));<NEW_LINE>supportingFiles.add(new SupportingFile("api_client.mustache", libFolder, "api_client.dart"));<NEW_LINE>supportingFiles.add(new SupportingFile("api_exception.mustache", libFolder, "api_exception.dart"));<NEW_LINE>supportingFiles.add(new SupportingFile<MASK><NEW_LINE>supportingFiles.add(new SupportingFile("apilib.mustache", libFolder, "api.dart"));<NEW_LINE>final String authFolder = sourceFolder + File.separator + "lib" + File.separator + "auth";<NEW_LINE>supportingFiles.add(new SupportingFile("auth/authentication.mustache", authFolder, "authentication.dart"));<NEW_LINE>supportingFiles.add(new SupportingFile("auth/http_basic_auth.mustache", authFolder, "http_basic_auth.dart"));<NEW_LINE>supportingFiles.add(new SupportingFile("auth/http_bearer_auth.mustache", authFolder, "http_bearer_auth.dart"));<NEW_LINE>supportingFiles.add(new SupportingFile("auth/api_key_auth.mustache", authFolder, "api_key_auth.dart"));<NEW_LINE>supportingFiles.add(new SupportingFile("auth/oauth.mustache", authFolder, "oauth.dart"));<NEW_LINE>supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh"));<NEW_LINE>supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore"));<NEW_LINE>supportingFiles.add(new SupportingFile("README.mustache", "", "README.md"));<NEW_LINE>supportingFiles.add(new SupportingFile("travis.mustache", "", ".travis.yml"));<NEW_LINE>} | ("api_helper.mustache", libFolder, "api_helper.dart")); |
1,382,486 | public TaskStatus<?> scheduleWithFixedDelay(Runnable runnable, long initialDelay, long delay, TimeUnit unit) {<NEW_LINE>int compare = <MASK><NEW_LINE>initialDelay = // no conversion needed<NEW_LINE>initialDelay <= 0 ? // no conversion needed<NEW_LINE>0 : // no conversion needed<NEW_LINE>compare == 0 ? // round up to nearest millisecond<NEW_LINE>initialDelay : // round up to nearest millisecond<NEW_LINE>compare < 0 ? unit.toMillis(initialDelay - 1) + 1 : unit.toMillis(initialDelay);<NEW_LINE>if (delay > 0)<NEW_LINE>delay = // round up to nearest millisecond<NEW_LINE>compare == 0 ? // round up to nearest millisecond<NEW_LINE>delay : // round up to nearest millisecond<NEW_LINE>compare < 0 ? unit.toMillis(delay - 1) + 1 : unit.toMillis(delay);<NEW_LINE>else<NEW_LINE>throw new IllegalArgumentException(Long.toString(delay));<NEW_LINE>TaskInfo taskInfo = new TaskInfo(false);<NEW_LINE>taskInfo.initForRepeatingTask(false, initialDelay, delay);<NEW_LINE>return newTask(runnable, taskInfo, null, null);<NEW_LINE>} | unit.compareTo(TimeUnit.MILLISECONDS); |
1,315,593 | public CompletableFuture<WebSocket> buildAsync(Listener listener) {<NEW_LINE>Request request = builder.build();<NEW_LINE>CompletableFuture<WebSocket> future = new CompletableFuture<>();<NEW_LINE>httpClient.newWebSocket(request, new WebSocketListener() {<NEW_LINE><NEW_LINE>private volatile boolean opened;<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onFailure(okhttp3.WebSocket webSocket, Throwable t, Response response) {<NEW_LINE>if (response != null) {<NEW_LINE>response.close();<NEW_LINE>}<NEW_LINE>if (!opened) {<NEW_LINE>if (response != null) {<NEW_LINE>try {<NEW_LINE>future.completeExceptionally(new WebSocketHandshakeException(new OkHttpResponseImpl<>(response, null)).initCause(t));<NEW_LINE>} catch (IOException e) {<NEW_LINE>// can't happen<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>future.completeExceptionally(t);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>listener.onError(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onOpen(okhttp3.WebSocket webSocket, Response response) {<NEW_LINE>opened = true;<NEW_LINE>if (response != null) {<NEW_LINE>response.close();<NEW_LINE>}<NEW_LINE>OkHttpWebSocketImpl value = new OkHttpWebSocketImpl(webSocket);<NEW_LINE>listener.onOpen(value);<NEW_LINE>future.complete(value);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onMessage(okhttp3.WebSocket webSocket, ByteString bytes) {<NEW_LINE>listener.onMessage(new OkHttpWebSocketImpl(webSocket), bytes.asByteBuffer());<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onMessage(okhttp3.WebSocket webSocket, String text) {<NEW_LINE>listener.onMessage(new OkHttpWebSocketImpl(webSocket), text);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClosing(okhttp3.WebSocket webSocket, int code, String reason) {<NEW_LINE>listener.onClose(new OkHttpWebSocketImpl(webSocket), code, reason);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return future;<NEW_LINE>} | new OkHttpWebSocketImpl(webSocket), t); |
1,186,788 | static Object CreateSwappedType(VirtualFrame frame, Object type, Object[] args, PKeyword[] kwds, Object proto, FieldDesc fmt, TypeNode typeNew, InternStringNode internStringNode, CastToJavaStringNode toString, GetDictIfExistsNode getDict, SetDictNode setDict, HashingStorageLibrary hlib, PythonObjectFactory factory) {<NEW_LINE>int argsLen = args.length;<NEW_LINE>Object[] swapped_args = new Object[argsLen];<NEW_LINE>String suffix = toString.execute(internStringNode.execute("_be"));<NEW_LINE>String name = toString.execute(args[0]);<NEW_LINE>Object newname = PString.cat(name, suffix);<NEW_LINE>swapped_args[0] = newname;<NEW_LINE>PythonUtils.arraycopy(args, 1, swapped_args, 1, argsLen - 1);<NEW_LINE>Object result = typeNew.execute(frame, type, swapped_args[0], swapped_args[1], swapped_args[2], kwds);<NEW_LINE>StgDictObject stgdict = factory.createStgDictObject(StgDict);<NEW_LINE>stgdict.ffi_type_pointer = fmt.pffi_type;<NEW_LINE>stgdict.align = fmt.pffi_type.alignment;<NEW_LINE>stgdict.length = 0;<NEW_LINE>stgdict<MASK><NEW_LINE>stgdict.setfunc = fmt.setfunc_swapped;<NEW_LINE>stgdict.getfunc = fmt.getfunc_swapped;<NEW_LINE>stgdict.proto = proto; | .size = fmt.pffi_type.size; |
434,828 | private Mono<Response<NatGatewayInner>> updateTagsWithResponseAsync(String resourceGroupName, String natGatewayName, TagsObject parameters, 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 (resourceGroupName == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (natGatewayName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter natGatewayName 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 (parameters == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));<NEW_LINE>} else {<NEW_LINE>parameters.validate();<NEW_LINE>}<NEW_LINE>final String apiVersion = "2021-05-01";<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.updateTags(this.client.getEndpoint(), resourceGroupName, natGatewayName, apiVersion, this.client.getSubscriptionId(), parameters, accept, context);<NEW_LINE>} | error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); |
958,529 | public MappeableContainer ior(MappeableArrayContainer x) {<NEW_LINE>if (isFull()) {<NEW_LINE>return this;<NEW_LINE>}<NEW_LINE>final int nbrruns = this.nbrruns;<NEW_LINE>final int offset = Math.max(nbrruns, x.getCardinality());<NEW_LINE>copyToOffset(offset);<NEW_LINE>char[] vl = this.valueslength.array();<NEW_LINE>int rlepos = 0;<NEW_LINE>this.nbrruns = 0;<NEW_LINE><MASK><NEW_LINE>while (i.hasNext() && (rlepos < nbrruns)) {<NEW_LINE>if ((getValue(vl, rlepos + offset)) - (i.peekNext()) <= 0) {<NEW_LINE>smartAppend(vl, getValue(vl, rlepos + offset), getLength(vl, rlepos + offset));<NEW_LINE>rlepos++;<NEW_LINE>} else {<NEW_LINE>smartAppend(vl, i.next());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (i.hasNext()) {<NEW_LINE>while (i.hasNext()) {<NEW_LINE>smartAppend(vl, i.next());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>while (rlepos < nbrruns) {<NEW_LINE>smartAppend(vl, getValue(vl, rlepos + offset), getLength(vl, rlepos + offset));<NEW_LINE>rlepos++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return toEfficientContainer();<NEW_LINE>} | PeekableCharIterator i = x.getCharIterator(); |
29,924 | private Object callAction(String apiStr, String outputStr, Map<String, Object> params) {<NEW_LINE>List<String> o = Arrays.asList(outputStr.split("\\."));<NEW_LINE>if (o.isEmpty()) {<NEW_LINE>throw new OperationFailureException(Platform.operr("output from [%s] is empty", apiStr));<NEW_LINE>}<NEW_LINE>String apiName = "org.zstack.sdk." + apiStr + "Action";<NEW_LINE>logger.debug(String.format("start to call sdk: %s, params: %s", apiName, JSONObjectUtil.toJsonString(params)));<NEW_LINE>try {<NEW_LINE>Object action = Class.forName(apiName).newInstance();<NEW_LINE>params.forEach((k, v) -> {<NEW_LINE>setField(action, k, v);<NEW_LINE>});<NEW_LINE>Method call = action.getClass().getMethod("call");<NEW_LINE>Field f = action.getClass().getDeclaredField("sessionId");<NEW_LINE>f.setAccessible(true);<NEW_LINE>f.set(action, ZQLContext.getAPISessionUuid());<NEW_LINE>Object <MASK><NEW_LINE>Field err = result.getClass().getField("error");<NEW_LINE>err.setAccessible(true);<NEW_LINE>Object ob = err.get(result);<NEW_LINE>if (ob != null) {<NEW_LINE>throw new OperationFailureException(operr("call action[%s] failed, cause: %s", apiName, JSONObjectUtil.toJsonString(ob)));<NEW_LINE>} else {<NEW_LINE>Field field = result.getClass().getField("value");<NEW_LINE>field.setAccessible(true);<NEW_LINE>ob = field.get(result);<NEW_LINE>return result(ob, o);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.debug(String.format("failed to call sdk: %s, params: %s\n%s", apiName, JSONObjectUtil.toJsonString(params), Throwables.getStackTraceAsString(e)));<NEW_LINE>// InvocationTargetException contains actual exception in its target<NEW_LINE>// but no error message in itself<NEW_LINE>if (e instanceof InvocationTargetException) {<NEW_LINE>throw new OperationFailureException(operr(((InvocationTargetException) e).getTargetException().getMessage()));<NEW_LINE>}<NEW_LINE>throw new OperationFailureException(operr(e.getMessage()));<NEW_LINE>}<NEW_LINE>} | result = call.invoke(action); |
854,553 | final GetIPSetResult executeGetIPSet(GetIPSetRequest getIPSetRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getIPSetRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<GetIPSetRequest> request = null;<NEW_LINE>Response<GetIPSetResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetIPSetRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getIPSetRequest));<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, "WAFV2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetIPSet");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetIPSetResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetIPSetResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.ClientExecuteTime); |
77,325 | public boolean apply(Game game, Ability source) {<NEW_LINE>Card card = game.getCard(source.getSourceId());<NEW_LINE>if (card == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Player player;<NEW_LINE>if (ownerControl) {<NEW_LINE>player = game.<MASK><NEW_LINE>} else {<NEW_LINE>player = game.getPlayer(source.getControllerId());<NEW_LINE>}<NEW_LINE>if (player == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (game.getState().getZone(source.getSourceId()) == Zone.GRAVEYARD) {<NEW_LINE>player.moveCards(card, Zone.BATTLEFIELD, source, game, tapped, false, true, null);<NEW_LINE>if (haste) {<NEW_LINE>Permanent permanent = game.getPermanent(card.getId());<NEW_LINE>if (permanent != null) {<NEW_LINE>ContinuousEffect effect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.Custom);<NEW_LINE>effect.setTargetPointer(new FixedTarget(permanent, game));<NEW_LINE>game.addEffect(effect, source);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | getPlayer(card.getOwnerId()); |
1,582,054 | protected void handleUnresolvedReferences(String modelKey, Model model, Map<String, List<String>> unresolvedReferencesMap, Map<String, Model> keyToModelMap, String referenceProperyName) {<NEW_LINE>if (unresolvedReferencesMap.containsKey(modelKey)) {<NEW_LINE>List<String> referencingModelKeys = unresolvedReferencesMap.get(modelKey);<NEW_LINE>for (String referencingCaseModelKey : referencingModelKeys) {<NEW_LINE>Model referencingCaseModel = keyToModelMap.get(referencingCaseModelKey);<NEW_LINE>try {<NEW_LINE>JsonNode referencingCaseModelJson = objectMapper.readTree(referencingCaseModel.getModelEditorJson());<NEW_LINE>updateModelReferenceProperties(model, referenceProperyName, referencingCaseModelJson);<NEW_LINE>// toString is also done in the regular import<NEW_LINE>referencingCaseModel.setModelEditorJson(referencingCaseModelJson.toString());<NEW_LINE>modelService.saveModel(referencingCaseModel);<NEW_LINE>} catch (Exception e) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>unresolvedReferencesMap.remove(modelKey);<NEW_LINE>}<NEW_LINE>} | throw new FlowableException("Could not read model json", e); |
1,234,120 | public GetMasterAccountResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>GetMasterAccountResult getMasterAccountResult = new GetMasterAccountResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return getMasterAccountResult;<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("master", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getMasterAccountResult.setMaster(InvitationJsonUnmarshaller.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 getMasterAccountResult;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
1,764,115 | public DefaultConfigurationCustomizer jooqProvidersDefaultConfigurationCustomizer(ObjectProvider<TransactionProvider> transactionProvider, ObjectProvider<RecordMapperProvider> recordMapperProvider, ObjectProvider<RecordUnmapperProvider> recordUnmapperProvider, ObjectProvider<Settings> settings, ObjectProvider<RecordListenerProvider> recordListenerProviders, ObjectProvider<VisitListenerProvider> visitListenerProviders, ObjectProvider<TransactionListenerProvider> transactionListenerProviders, ObjectProvider<ExecutorProvider> executorProvider) {<NEW_LINE>return new OrderedDefaultConfigurationCustomizer((configuration) -> {<NEW_LINE>transactionProvider.ifAvailable(configuration::set);<NEW_LINE>recordMapperProvider.ifAvailable(configuration::set);<NEW_LINE>recordUnmapperProvider.ifAvailable(configuration::set);<NEW_LINE>settings.ifAvailable(configuration::set);<NEW_LINE>executorProvider.ifAvailable(configuration::set);<NEW_LINE>configuration.set(recordListenerProviders.orderedStream().toArray(RecordListenerProvider[]::new));<NEW_LINE>configuration.set(visitListenerProviders.orderedStream().toArray(VisitListenerProvider[]::new));<NEW_LINE>configuration.setTransactionListenerProvider(transactionListenerProviders.orderedStream().toArray<MASK><NEW_LINE>});<NEW_LINE>} | (TransactionListenerProvider[]::new)); |
1,072,159 | private boolean detectTwoFaceTriangles(HashMapVirtualObject ifcProduct, IntBuffer indicesAsInt, DoubleBuffer verticesAsDouble, float margin) {<NEW_LINE>Set<ComplexLine2> complexLines = new TreeSet<>();<NEW_LINE>for (int i = 0; i < indicesAsInt.capacity(); i += 3) {<NEW_LINE>for (int j = 0; j < 3; j++) {<NEW_LINE>int index1 = indicesAsInt.get(i + j);<NEW_LINE>int index2 = indicesAsInt.get(i + (j + 1) % 3);<NEW_LINE>ComplexLine2 line2 = new ComplexLine2(<MASK><NEW_LINE>if (complexLines.contains(line2)) {<NEW_LINE>complexLines.remove(line2);<NEW_LINE>} else {<NEW_LINE>complexLines.add(line2);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!complexLines.isEmpty()) {<NEW_LINE>LOGGER.debug("Probably a non-closed object in " + ifcProduct.eClass().getName() + " (" + complexLines.size() + ")");<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | index1, index2, verticesAsDouble, margin); |
600,376 | public void benchmarkCglib(Blackhole blackHole) {<NEW_LINE>blackHole.consume(cglibInstance.method(booleanValue));<NEW_LINE>blackHole.consume(cglibInstance.method(byteValue));<NEW_LINE>blackHole.consume(cglibInstance.method(shortValue));<NEW_LINE>blackHole.consume(cglibInstance.method(intValue));<NEW_LINE>blackHole.consume(cglibInstance.method(charValue));<NEW_LINE>blackHole.consume(cglibInstance.method(intValue));<NEW_LINE>blackHole.consume(cglibInstance.method(longValue));<NEW_LINE>blackHole.consume(cglibInstance.method(floatValue));<NEW_LINE>blackHole.consume(cglibInstance.method(doubleValue));<NEW_LINE>blackHole.consume<MASK><NEW_LINE>blackHole.consume(cglibInstance.method(booleanValue, booleanValue, booleanValue));<NEW_LINE>blackHole.consume(cglibInstance.method(byteValue, byteValue, byteValue));<NEW_LINE>blackHole.consume(cglibInstance.method(shortValue, shortValue, shortValue));<NEW_LINE>blackHole.consume(cglibInstance.method(intValue, intValue, intValue));<NEW_LINE>blackHole.consume(cglibInstance.method(charValue, charValue, charValue));<NEW_LINE>blackHole.consume(cglibInstance.method(intValue, intValue, intValue));<NEW_LINE>blackHole.consume(cglibInstance.method(longValue, longValue, longValue));<NEW_LINE>blackHole.consume(cglibInstance.method(floatValue, floatValue, floatValue));<NEW_LINE>blackHole.consume(cglibInstance.method(doubleValue, doubleValue, doubleValue));<NEW_LINE>blackHole.consume(cglibInstance.method(stringValue, stringValue, stringValue));<NEW_LINE>} | (cglibInstance.method(stringValue)); |
1,402,684 | // Supply invalid arguments to various ExecutorService methods and verify the behavior matches the requirements of the JavaDoc.<NEW_LINE>// Also supply some values as the top and bottom of the valid range.<NEW_LINE>@Test<NEW_LINE>public void testInvalidArguments() throws Exception {<NEW_LINE>ExecutorService executor = provider.create("testInvalidArguments");<NEW_LINE>assertFalse(executor.awaitTermination(-1, TimeUnit.MILLISECONDS));<NEW_LINE>assertFalse(executor.awaitTermination(Long.MIN_VALUE, TimeUnit.DAYS));<NEW_LINE>try {<NEW_LINE>fail("Should fail with missing unit. Instead: " + executor.awaitTermination(5, null));<NEW_LINE>} catch (NullPointerException x) {<NEW_LINE>}<NEW_LINE>// pass<NEW_LINE>try {<NEW_LINE>executor.execute(null);<NEW_LINE>fail("Execute should fail with null task.");<NEW_LINE>} catch (NullPointerException x) {<NEW_LINE>}<NEW_LINE>// pass<NEW_LINE>try {<NEW_LINE>fail("Should fail with null Callable. Instead: " + executor.submit((Callable<String>) null));<NEW_LINE>} catch (NullPointerException x) {<NEW_LINE>}<NEW_LINE>// pass<NEW_LINE>try {<NEW_LINE>fail("Should fail with null Runnable. Instead: " + executor.submit((Runnable) null));<NEW_LINE>} catch (NullPointerException x) {<NEW_LINE>}<NEW_LINE>// pass<NEW_LINE>try {<NEW_LINE>fail("Should fail with null Runnable & valid result. Instead: " + executor.submit(null, 1));<NEW_LINE>} catch (NullPointerException x) {<NEW_LINE>}<NEW_LINE>// pass<NEW_LINE>executor.shutdown();<NEW_LINE><MASK><NEW_LINE>assertTrue(executor.awaitTermination(Long.MAX_VALUE, TimeUnit.DAYS));<NEW_LINE>long duration = start - System.nanoTime();<NEW_LINE>assertTrue("awaitTermination took " + duration + "ns", duration < TIMEOUT_NS);<NEW_LINE>} | long start = System.nanoTime(); |
47,187 | private RubyBigDecimal multImpl(final Ruby runtime, RubyBigDecimal val) {<NEW_LINE>if (isNaN() || val.isNaN())<NEW_LINE>return newNaN(runtime);<NEW_LINE>if (isZero() || val.isZero()) {<NEW_LINE>if ((isInfinity() && val.isZero()) || (isZero() && val.isInfinity()))<NEW_LINE>return newNaN(runtime);<NEW_LINE>int sign1 = isZero() ? zeroSign : value.signum();<NEW_LINE>int sign2 = val.isZero() ? val.zeroSign : val.value.signum();<NEW_LINE>return newZero(runtime, sign1 * sign2);<NEW_LINE>}<NEW_LINE>if (isInfinity() || val.isInfinity()) {<NEW_LINE>int sign1 = isInfinity() ? infinitySign : value.signum();<NEW_LINE>int sign2 = val.isInfinity() ? val.infinitySign : val.value.signum();<NEW_LINE>return <MASK><NEW_LINE>}<NEW_LINE>int mx = value.precision() + val.value.precision();<NEW_LINE>MathContext mathContext = new MathContext(mx, getRoundingMode(runtime));<NEW_LINE>BigDecimal result;<NEW_LINE>try {<NEW_LINE>result = value.multiply(val.value, mathContext);<NEW_LINE>} catch (ArithmeticException ex) {<NEW_LINE>return (RubyBigDecimal) checkOverUnderFlow(runtime, ex, false, true, true);<NEW_LINE>}<NEW_LINE>return new RubyBigDecimal(runtime, result).setResult();<NEW_LINE>} | newInfinity(runtime, sign1 * sign2); |
972,987 | public AttackResult completed(@RequestParam String[] question_0_solution, @RequestParam String[] question_1_solution, @RequestParam String[] question_2_solution, @RequestParam String[] question_3_solution, @RequestParam String[] question_4_solution) throws IOException {<NEW_LINE>int correctAnswers = 0;<NEW_LINE>String[] givenAnswers = { question_0_solution[0], question_1_solution[0], question_2_solution[0], question_3_solution[0], question_4_solution[0] };<NEW_LINE>for (int i = 0; i < solutions.length; i++) {<NEW_LINE>if (givenAnswers[i].contains(solutions[i])) {<NEW_LINE>// answer correct<NEW_LINE>correctAnswers++;<NEW_LINE>guesses[i] = true;<NEW_LINE>} else {<NEW_LINE>// answer incorrect<NEW_LINE>guesses[i] = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (correctAnswers == solutions.length) {<NEW_LINE>return success(this).build();<NEW_LINE>} else {<NEW_LINE>return <MASK><NEW_LINE>}<NEW_LINE>} | failed(this).build(); |
462,698 | public SnapshotFilter unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>SnapshotFilter snapshotFilter = new SnapshotFilter();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("Name", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>snapshotFilter.setName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Values", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>snapshotFilter.setValues(new ListUnmarshaller<String>(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 snapshotFilter;<NEW_LINE>} | String currentParentElement = context.getCurrentParentElement(); |
120,322 | private void processDeferredConcepts() {<NEW_LINE>int codeCount = 0, relCount = 0;<NEW_LINE>StopWatch stopwatch = new StopWatch();<NEW_LINE>int count = Math.min(1000, myDeferredConcepts.size());<NEW_LINE>ourLog.debug("Saving {} deferred concepts...", count);<NEW_LINE>while (codeCount < count && myDeferredConcepts.size() > 0) {<NEW_LINE>TermConcept next = myDeferredConcepts.remove(0);<NEW_LINE>if (myCodeSystemVersionDao.findById(next.getCodeSystemVersion().getPid()).isPresent()) {<NEW_LINE>try {<NEW_LINE>codeCount += myTermConceptDaoSvc.saveConcept(next);<NEW_LINE>} catch (Exception theE) {<NEW_LINE>ourLog.error("Exception thrown when attempting to save TermConcept {} in Code System {}", next.getCode(), next.getCodeSystemVersion().getCodeSystemDisplayName(), theE);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>ourLog.warn("Unable to save deferred TermConcept {} because Code System {} version PID {} is no longer valid. Code system may have since been replaced.", next.getCode(), next.getCodeSystemVersion().getCodeSystemDisplayName(), next.getCodeSystemVersion().getPid());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (codeCount > 0) {<NEW_LINE>ourLog.info("Saved {} deferred concepts ({} codes remain and {} relationships remain) in {}ms ({} codes/sec)", codeCount, myDeferredConcepts.size(), myConceptLinksToSaveLater.size(), stopwatch.getMillis(), stopwatch.formatThroughput(codeCount, TimeUnit.SECONDS));<NEW_LINE>}<NEW_LINE>if (codeCount == 0) {<NEW_LINE>count = Math.min(<MASK><NEW_LINE>ourLog.info("Saving {} deferred concept relationships...", count);<NEW_LINE>while (relCount < count && myConceptLinksToSaveLater.size() > 0) {<NEW_LINE>TermConceptParentChildLink next = myConceptLinksToSaveLater.remove(0);<NEW_LINE>assert next.getChild() != null;<NEW_LINE>assert next.getParent() != null;<NEW_LINE>if ((next.getChild().getId() == null || !myConceptDao.findById(next.getChild().getId()).isPresent()) || (next.getParent().getId() == null || !myConceptDao.findById(next.getParent().getId()).isPresent())) {<NEW_LINE>ourLog.warn("Not inserting link from child {} to parent {} because it appears to have been deleted", next.getParent().getCode(), next.getChild().getCode());<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>saveConceptLink(next);<NEW_LINE>relCount++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (relCount > 0) {<NEW_LINE>ourLog.info("Saved {} deferred relationships ({} remain) in {}ms ({} entries/sec)", relCount, myConceptLinksToSaveLater.size(), stopwatch.getMillis(), stopwatch.formatThroughput(relCount, TimeUnit.SECONDS));<NEW_LINE>}<NEW_LINE>if ((myDeferredConcepts.size() + myConceptLinksToSaveLater.size()) == 0) {<NEW_LINE>ourLog.info("All deferred concepts and relationships have now been synchronized to the database");<NEW_LINE>}<NEW_LINE>} | 1000, myConceptLinksToSaveLater.size()); |
618,485 | public static void openInCustomTabsOrBrowser(@NonNull Context context, @NonNull String url) {<NEW_LINE>if (StringUtils.isBlank(url)) {<NEW_LINE>Toasty.warning(context, context.getString(R.string.invalid_url), Toast.LENGTH_LONG).show();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// check http prefix<NEW_LINE>if (!url.contains("//")) {<NEW_LINE>url = "http://".concat(url);<NEW_LINE>}<NEW_LINE>String customTabsPackageName;<NEW_LINE>if (PrefUtils.isCustomTabsEnable() && (customTabsPackageName = CustomTabsHelper.INSTANCE.getBestPackageName(context)) != null) {<NEW_LINE>Bitmap backIconBitmap = ViewUtils.getBitmapFromResource(<MASK><NEW_LINE>Intent shareIntent = new Intent(context.getApplicationContext(), ShareBroadcastReceiver.class);<NEW_LINE>shareIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);<NEW_LINE>PendingIntent sharePendingIntent = PendingIntent.getBroadcast(context.getApplicationContext(), 0, shareIntent, 0);<NEW_LINE>Intent copyIntent = new Intent(context.getApplicationContext(), CopyBroadcastReceiver.class);<NEW_LINE>copyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);<NEW_LINE>PendingIntent copyPendingIntent = PendingIntent.getBroadcast(context.getApplicationContext(), 0, copyIntent, 0);<NEW_LINE>CustomTabsIntent customTabsIntent = // .setStartAnimations(context, R.anim.slide_in_right, R.anim.slide_out_left)<NEW_LINE>new CustomTabsIntent.Builder().setToolbarColor(ViewUtils.getPrimaryColor(context)).setCloseButtonIcon(backIconBitmap).setShowTitle(true).addMenuItem(context.getString(R.string.share), sharePendingIntent).addMenuItem(context.getString(R.string.copy_url), copyPendingIntent).// .setExitAnimations(context, android.R.anim.slide_in_left, android.R.anim.slide_out_right)<NEW_LINE>build();<NEW_LINE>customTabsIntent.intent.setPackage(customTabsPackageName);<NEW_LINE>customTabsIntent.launchUrl(context, Uri.parse(url));<NEW_LINE>if (PrefUtils.isCustomTabsTipsEnable()) {<NEW_LINE>Toasty.info(context, context.getString(R.string.use_custom_tabs_tips), Toast.LENGTH_LONG).show();<NEW_LINE>PrefUtils.set(PrefUtils.CUSTOM_TABS_TIPS_ENABLE, false);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>openInBrowser(context, url);<NEW_LINE>}<NEW_LINE>} | context, R.drawable.ic_arrow_back_title); |
1,748,311 | public okhttp3.Call readNamespacedReplicaSetCall(String name, String namespace, String pretty, final ApiCallback _callback) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/apis/apps/v1/namespaces/{namespace}/replicasets/{name}".replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString())).replaceAll("\\{" + "namespace" + "\\}", localVarApiClient.escapeString<MASK><NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();<NEW_LINE>if (pretty != null) {<NEW_LINE>localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty));<NEW_LINE>}<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>final String[] localVarAccepts = { "application/json", "application/yaml", "application/vnd.kubernetes.protobuf" };<NEW_LINE>final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null) {<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>}<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>String[] localVarAuthNames = new String[] { "BearerToken" };<NEW_LINE>return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);<NEW_LINE>} | (namespace.toString())); |
934,141 | private // ---------------------//<NEW_LINE>void processArticulation(ArticulationInter articulation) {<NEW_LINE>try {<NEW_LINE>logger.debug("Visiting {}", articulation);<NEW_LINE>JAXBElement<?> element = getArticulationObject(articulation.getShape());<NEW_LINE>// Staff?<NEW_LINE>Staff staff = current.note.getStaff();<NEW_LINE>// Placement<NEW_LINE>Class<?> classe = element.getDeclaredType();<NEW_LINE>Method method = classe.getMethod("setPlacement", AboveBelow.class);<NEW_LINE>method.invoke(element.getValue(), (articulation.getCenter().y < current.note.getCenter().y) ? AboveBelow.ABOVE : AboveBelow.BELOW);<NEW_LINE>// Default-Y<NEW_LINE>method = classe.getMethod("setDefaultY", BigDecimal.class);<NEW_LINE>method.invoke(element.getValue(), yOf(articulation<MASK><NEW_LINE>// Include in Articulations<NEW_LINE>getArticulations().getAccentOrStrongAccentOrStaccato().add(element);<NEW_LINE>} catch (IllegalAccessException | IllegalArgumentException | NoSuchMethodException | SecurityException | InvocationTargetException ex) {<NEW_LINE>logger.warn("Error visiting " + articulation, ex);<NEW_LINE>}<NEW_LINE>} | .getCenter(), staff)); |
1,724,380 | private static Integer determineIndent(PsiFile file, Editor editor, int offset, CommonCodeStyleSettings settings) {<NEW_LINE>if (offset == 0) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Document doc = editor.getDocument();<NEW_LINE>PsiElement element = getRelevantElement(file, doc, offset);<NEW_LINE>PsiElement parent = element != null <MASK><NEW_LINE>if (parent == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>IndentOptions indentOptions = settings.getIndentOptions();<NEW_LINE>if (endsBlock(element)) {<NEW_LINE>// current line indent subtract block indent<NEW_LINE>return Math.max(0, getIndent(doc, element) - (indentOptions != null ? indentOptions.INDENT_SIZE : 0));<NEW_LINE>}<NEW_LINE>if (parent instanceof BuildListType) {<NEW_LINE>BuildListType<?> list = (BuildListType<?>) parent;<NEW_LINE>if (endsList(list, element) && element.getTextOffset() < offset) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>int listOffset = list.getStartOffset();<NEW_LINE>LogicalPosition caretPosition = editor.getCaretModel().getLogicalPosition();<NEW_LINE>LogicalPosition listStart = editor.offsetToLogicalPosition(listOffset);<NEW_LINE>if (listStart.line != caretPosition.line) {<NEW_LINE>// take the minimum of the current line's indent and the current caret position<NEW_LINE>return indentOfLineUpToCaret(doc, caretPosition.line, offset);<NEW_LINE>}<NEW_LINE>BuildElement firstChild = ((BuildListType<?>) parent).getFirstElement();<NEW_LINE>if (firstChild != null && firstChild.getNode().getStartOffset() < offset) {<NEW_LINE>return getIndent(doc, firstChild);<NEW_LINE>}<NEW_LINE>return lineIndent(doc, listStart.line) + additionalIndent(parent, indentOptions);<NEW_LINE>}<NEW_LINE>if (parent instanceof StatementListContainer && afterColon(doc, offset)) {<NEW_LINE>return getIndent(doc, parent) + additionalIndent(parent, indentOptions);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | ? element.getParent() : null; |
283,430 | public CompletableFuture<Either<List<? extends Location>, List<? extends LocationLink>>> definition(DefinitionParams params) {<NEW_LINE>try {<NEW_LINE>String uri = params.getTextDocument().getUri();<NEW_LINE>Document doc = server.getOpenedDocuments().getDocument(uri);<NEW_LINE>if (doc instanceof LineDocument) {<NEW_LINE>FileObject file = Utils.fromUri(uri);<NEW_LINE>if (file != null) {<NEW_LINE>int offset = Utils.getOffset((LineDocument) doc, params.getPosition());<NEW_LINE>return HyperlinkLocation.resolve(doc, offset).thenApply(locs -> {<NEW_LINE>return Either.forLeft(locs.stream().map(location -> {<NEW_LINE>FileObject fo = location.getFileObject();<NEW_LINE>return new Location(Utils.toUri(fo), new Range(Utils.createPosition(fo, location.getStartOffset()), Utils.createPosition(fo, location.getEndOffset())));<NEW_LINE>}).collect(Collectors.toList()));<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (MalformedURLException ex) {<NEW_LINE>client.logMessage(new MessageParams(MessageType.Error, ex.getMessage()));<NEW_LINE>}<NEW_LINE>return CompletableFuture.completedFuture(Either.forLeft<MASK><NEW_LINE>} | (Collections.emptyList())); |
1,463,681 | static void normalMenuStartUp(MainActivity mainActivity, Class[] activitiesDemo) {<NEW_LINE>String[] layouts = getLayouts(s -> s.matches(LAYOUTS_MATCHES));<NEW_LINE>ScrollView sv = new ScrollView(mainActivity);<NEW_LINE>LinearLayout linearLayout = new LinearLayout(mainActivity);<NEW_LINE>linearLayout.setOrientation(LinearLayout.VERTICAL);<NEW_LINE>for (int i = 0; i < layouts.length; i++) {<NEW_LINE>Button button = new Button(mainActivity);<NEW_LINE>button.setText(layouts[i]);<NEW_LINE>button<MASK><NEW_LINE>linearLayout.addView(button);<NEW_LINE>button.setOnClickListener(view -> launch(mainActivity, (String) view.getTag()));<NEW_LINE>}<NEW_LINE>for (Class aClass : activitiesDemo) {<NEW_LINE>Button button = new Button(mainActivity);<NEW_LINE>button.setText("Demo from " + aClass.getSimpleName());<NEW_LINE>linearLayout.addView(button);<NEW_LINE>button.setOnClickListener(v -> {<NEW_LINE>Intent intent = new Intent(mainActivity, aClass);<NEW_LINE>mainActivity.startActivity(intent);<NEW_LINE>});<NEW_LINE>}<NEW_LINE>sv.addView(linearLayout);<NEW_LINE>mainActivity.setContentView(sv);<NEW_LINE>} | .setTag(layouts[i]); |
754,291 | public void onClose(Status status, Metadata trailers) {<NEW_LINE>if (status.getCode().equals(Code.DEADLINE_EXCEEDED)) {<NEW_LINE>// TODO(zdapeng:) check effective deadline locally, and<NEW_LINE>// do the following only if the local deadline is exceeded.<NEW_LINE>// (If the server sends DEADLINE_EXCEEDED for its own deadline, then the<NEW_LINE>// injected delay does not contribute to the error, because the request is<NEW_LINE>// only sent out after the delay. There could be a race between local and<NEW_LINE>// remote, but it is rather rare.)<NEW_LINE>String description = String.format("Deadline exceeded after up to %d ns of fault-injected delay", finalDelayNanos);<NEW_LINE>if (status.getDescription() != null) {<NEW_LINE>description = description + ": " + status.getDescription();<NEW_LINE>}<NEW_LINE>status = Status.DEADLINE_EXCEEDED.withDescription(description).withCause(status.getCause());<NEW_LINE>// Replace trailers to prevent mixing sources of status and trailers.<NEW_LINE>trailers = new Metadata();<NEW_LINE>}<NEW_LINE>delegate(<MASK><NEW_LINE>} | ).onClose(status, trailers); |
526,290 | private void checkSubtype(TypeMirror expected, Object givenValue) {<NEW_LINE>if (expected.getKind().isPrimitive()) {<NEW_LINE>expected = types.boxedClass((PrimitiveType) expected).asType();<NEW_LINE>}<NEW_LINE>if (expected.getKind() == TypeKind.DECLARED && TypesUtils.isClass(expected) && givenValue instanceof TypeMirror) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>TypeMirror found;<NEW_LINE>boolean isSubtype;<NEW_LINE>if (expected.getKind() == TypeKind.DECLARED && ((DeclaredType) expected).asElement().getKind() == ElementKind.ANNOTATION_TYPE && givenValue instanceof AnnotationMirror) {<NEW_LINE>found = ((AnnotationMirror) givenValue).getAnnotationType();<NEW_LINE>isSubtype = ((DeclaredType) expected).asElement().equals(((DeclaredType<MASK><NEW_LINE>} else if (givenValue instanceof AnnotationMirror) {<NEW_LINE>found = ((AnnotationMirror) givenValue).getAnnotationType();<NEW_LINE>// TODO: why is this always failing???<NEW_LINE>isSubtype = false;<NEW_LINE>} else if (givenValue instanceof VariableElement) {<NEW_LINE>found = ((VariableElement) givenValue).asType();<NEW_LINE>if (expected.getKind() == TypeKind.DECLARED) {<NEW_LINE>isSubtype = types.isSubtype(types.erasure(found), types.erasure(expected));<NEW_LINE>} else {<NEW_LINE>isSubtype = false;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>String name = givenValue.getClass().getCanonicalName();<NEW_LINE>assert name != null : "@AssumeAssertion(nullness): assumption";<NEW_LINE>found = elements.getTypeElement(name).asType();<NEW_LINE>isSubtype = types.isSubtype(types.erasure(found), types.erasure(expected));<NEW_LINE>}<NEW_LINE>if (!isSubtype) {<NEW_LINE>// Annotations in stub files sometimes are the same type, but Types#isSubtype fails anyways.<NEW_LINE>isSubtype = found.toString().equals(expected.toString());<NEW_LINE>}<NEW_LINE>if (!isSubtype) {<NEW_LINE>throw new BugInCF("given value differs from expected; " + "found: " + found + "; expected: " + expected);<NEW_LINE>}<NEW_LINE>} | ) found).asElement()); |
1,505,965 | public void testJMSProducerSendTextMessage_B_SecOn(HttpServletRequest request, HttpServletResponse response) throws Throwable {<NEW_LINE>boolean exceptionFlag = false;<NEW_LINE>JMSContext jmsContext = QCFBindings.createContext();<NEW_LINE>emptyQueue(QCFBindings, queue2);<NEW_LINE>JMSConsumer <MASK><NEW_LINE>JMSProducer jmsProducer = jmsContext.createProducer().setJMSCorrelationID("TestCorrelID").setJMSType("NewTestType").send(queue2, "This is the messageBody");<NEW_LINE>QueueBrowser qb = jmsContext.createBrowser(queue2);<NEW_LINE>Enumeration e = qb.getEnumeration();<NEW_LINE>int numMsgs = 0;<NEW_LINE>while (e.hasMoreElements()) {<NEW_LINE>TextMessage message = (TextMessage) e.nextElement();<NEW_LINE>numMsgs++;<NEW_LINE>}<NEW_LINE>String msgBody = jmsConsumer.receive(30000).getBody(String.class);<NEW_LINE>if (!(numMsgs == 1 && msgBody.equals("This is the messageBody") && jmsProducer.getJMSCorrelationID().equals("TestCorrelID") && jmsProducer.getJMSType().equals("NewTestType")))<NEW_LINE>exceptionFlag = true;<NEW_LINE>jmsConsumer.receive(30000);<NEW_LINE>if (exceptionFlag)<NEW_LINE>throw new WrongException("testJMSProducerSendMessage_Topic_TCP_SecOn failed ");<NEW_LINE>jmsConsumer.close();<NEW_LINE>jmsContext.close();<NEW_LINE>} | jmsConsumer = jmsContext.createConsumer(queue2); |
531,662 | protected Control createDialogArea(Composite parent) {<NEW_LINE>Composite main = new Composite(parent, SWT.NONE);<NEW_LINE>GridLayout layout = new GridLayout();<NEW_LINE>layout.marginWidth = 0;<NEW_LINE>layout.marginHeight = 0;<NEW_LINE>layout.verticalSpacing = 0;<NEW_LINE>layout.horizontalSpacing = 0;<NEW_LINE>main.setLayout(layout);<NEW_LINE>main.setLayoutData(new GridData(SWT.FILL, SWT<MASK><NEW_LINE>Composite comp = new Composite(main, SWT.NONE);<NEW_LINE>comp.setLayout(new GridLayout(2, false));<NEW_LINE>comp.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));<NEW_LINE>Label label = new Label(comp, SWT.RIGHT);<NEW_LINE>label.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false));<NEW_LINE>label.setAlignment(SWT.RIGHT);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>label.setImage(SWTUtils.getImage(UIPlugin.getDefault(), "icons/aptana_dialog_tag.png"));<NEW_LINE>label = new Label(comp, SWT.WRAP);<NEW_LINE>label.setFont(SWTUtils.getDefaultSmallFont());<NEW_LINE>GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true);<NEW_LINE>gridData.heightHint = 50;<NEW_LINE>gridData.widthHint = 400;<NEW_LINE>gridData.horizontalIndent = 5;<NEW_LINE>gridData.verticalIndent = 3;<NEW_LINE>label.setLayoutData(gridData);<NEW_LINE>label.setText(Messages.ChooseSiteConnectionDialog_LBL_Message);<NEW_LINE>comp = new Composite(main, SWT.NONE);<NEW_LINE>comp.setLayout(new GridLayout(2, false));<NEW_LINE>comp.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));<NEW_LINE>label = new Label(comp, SWT.NONE);<NEW_LINE>label.setText(StringUtil.makeFormLabel(Messages.ChooseSiteConnectionDialog_LBL_Connection));<NEW_LINE>fSiteCombo = new Combo(comp, SWT.DROP_DOWN | SWT.READ_ONLY);<NEW_LINE>fSiteCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));<NEW_LINE>fSiteCombo.addSelectionListener(this);<NEW_LINE>fSiteCombo.addModifyListener(new ModifyListener() {<NEW_LINE><NEW_LINE>public void modifyText(ModifyEvent e) {<NEW_LINE>validate();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// left padding<NEW_LINE>new Label(comp, SWT.NONE);<NEW_LINE>fSiteDescriptionLabel = new Label(comp, SWT.NONE);<NEW_LINE>gridData = new GridData(SWT.FILL, SWT.CENTER, true, false);<NEW_LINE>gridData.widthHint = 450;<NEW_LINE>fSiteDescriptionLabel.setLayoutData(gridData);<NEW_LINE>if (fShowRememberMyDecision) {<NEW_LINE>fRememberMyDecisionButton = new Button(comp, SWT.CHECK);<NEW_LINE>fRememberMyDecisionButton.setText(Messages.ChooseSiteConnectionDialog_LBL_RememberMyDecision);<NEW_LINE>gridData = new GridData(SWT.BEGINNING, SWT.CENTER, false, false);<NEW_LINE>gridData.horizontalSpan = 2;<NEW_LINE>fRememberMyDecisionButton.setLayoutData(gridData);<NEW_LINE>fRememberMyDecisionButton.addSelectionListener(this);<NEW_LINE>label = new Label(comp, SWT.WRAP);<NEW_LINE>label.setText(Messages.ChooseSiteConnectionDialog_LBL_PropertyPage);<NEW_LINE>gridData = new GridData(SWT.BEGINNING, SWT.CENTER, true, false);<NEW_LINE>gridData.horizontalSpan = 2;<NEW_LINE>label.setLayoutData(gridData);<NEW_LINE>}<NEW_LINE>initializeDefaultValues();<NEW_LINE>return main;<NEW_LINE>} | .FILL, true, true)); |
1,850,722 | final UpdateApprovalRuleTemplateNameResult executeUpdateApprovalRuleTemplateName(UpdateApprovalRuleTemplateNameRequest updateApprovalRuleTemplateNameRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateApprovalRuleTemplateNameRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateApprovalRuleTemplateNameRequest> request = null;<NEW_LINE>Response<UpdateApprovalRuleTemplateNameResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateApprovalRuleTemplateNameRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateApprovalRuleTemplateNameRequest));<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, "UpdateApprovalRuleTemplateName");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateApprovalRuleTemplateNameResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateApprovalRuleTemplateNameResultJsonUnmarshaller());<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, "CodeCommit"); |
822,332 | public ArtifactContainer convertToContainer(boolean local) {<NEW_LINE>if (!local) {<NEW_LINE>// See if the container factory can create a container from us<NEW_LINE>File newCacheDir = null;<NEW_LINE>String relativeLocation = getEnclosingContainer().getPath();<NEW_LINE>if (relativeLocation.equals("/")) {<NEW_LINE>newCacheDir = rootContainer.getCacheDir();<NEW_LINE>} else {<NEW_LINE>// use of substring 1 is ok here, because this zip entry MUST be within a container, and the smallest path<NEW_LINE>// as container can have is "/", which is dealt with above, therefore, in this branch the relativeLocation MUST<NEW_LINE>// be longer than "/"<NEW_LINE>newCacheDir = new File(rootContainer.getCacheDir(), relativeLocation.substring(1));<NEW_LINE>}<NEW_LINE>// newCacheDir = new File(newCacheDir, this.getName());<NEW_LINE>return this.rootContainer.getContainerFactory().getContainer(newCacheDir, this.getEnclosingContainer(<MASK><NEW_LINE>} else<NEW_LINE>return null;<NEW_LINE>} | ), this, this.bundleUrl); |
850,930 | private void copyFieldTrl(final int targetFieldId, final int sourceFieldId) {<NEW_LINE>Check.assumeGreaterThanZero(targetFieldId, "targetFieldId");<NEW_LINE>Check.assumeGreaterThanZero(sourceFieldId, "sourceFieldId");<NEW_LINE>final String sqlDelete = "DELETE FROM AD_Field_Trl WHERE AD_Field_ID = " + targetFieldId;<NEW_LINE>final int countDelete = DB.executeUpdateEx(sqlDelete, ITrx.TRXNAME_ThreadInherited);<NEW_LINE><MASK><NEW_LINE>final String sqlInsert = "INSERT INTO AD_Field_Trl (AD_Field_ID, AD_Language, " + " AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy, " + " Name, Description, Help, IsTranslated) " + " SELECT " + targetFieldId + ", AD_Language, AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, " + " Updated, UpdatedBy, Name, Description, Help, IsTranslated " + " FROM AD_Field_Trl WHERE AD_Field_ID = " + sourceFieldId;<NEW_LINE>final int countInsert = DB.executeUpdateEx(sqlInsert, ITrx.TRXNAME_ThreadInherited);<NEW_LINE>logger.debug("AD_Field_Trl inserted: {}", countInsert);<NEW_LINE>} | logger.debug("AD_Field_Trl deleted: {}", countDelete); |
338,299 | public void run(RegressionEnvironment env) {<NEW_LINE>AtomicInteger milestone = new AtomicInteger();<NEW_LINE>String epl = "@name('s0') select symbol from " + "SupportMarketDataBean#length(10) as one, " + "SupportBeanString#length(100) as two " + "where one.symbol = two.theString " + "order by price";<NEW_LINE>SymbolPricesVolumes spv = new SymbolPricesVolumes();<NEW_LINE>SupportUpdateListener listener = new SupportUpdateListener();<NEW_LINE>createAndSend(env, epl, milestone);<NEW_LINE>sendJoinEvents(env, milestone);<NEW_LINE><MASK><NEW_LINE>assertValues(env, spv.symbols, "symbol");<NEW_LINE>clearValues(spv);<NEW_LINE>sendEvent(env, "DOG", 10);<NEW_LINE>spv.symbols.add("DOG");<NEW_LINE>assertValues(env, spv.symbols, "symbol");<NEW_LINE>clearValuesDropStmt(env, spv);<NEW_LINE>// Set start time<NEW_LINE>sendTimeEvent(env, 0);<NEW_LINE>epl = "@name('s0') select symbol from " + "SupportMarketDataBean#time_batch(1) as one, " + "SupportBeanString#length(100) as two " + "where one.symbol = two.theString " + "order by price, symbol";<NEW_LINE>createAndSend(env, epl, milestone);<NEW_LINE>sendJoinEvents(env, milestone);<NEW_LINE>orderValuesByPriceJoin(spv);<NEW_LINE>sendTimeEvent(env, 1000);<NEW_LINE>assertValues(env, spv.symbols, "symbol");<NEW_LINE>assertOnlyProperties(env, Arrays.asList(new String[] { "symbol" }));<NEW_LINE>clearValuesDropStmt(env, spv);<NEW_LINE>} | spv.symbols.add("KGB"); |
1,177,686 | public static ListDistributedProductResponse unmarshall(ListDistributedProductResponse listDistributedProductResponse, UnmarshallerContext _ctx) {<NEW_LINE>listDistributedProductResponse.setRequestId(_ctx.stringValue("ListDistributedProductResponse.RequestId"));<NEW_LINE>listDistributedProductResponse.setSuccess(_ctx.booleanValue("ListDistributedProductResponse.Success"));<NEW_LINE>listDistributedProductResponse.setCode<MASK><NEW_LINE>listDistributedProductResponse.setErrorMessage(_ctx.stringValue("ListDistributedProductResponse.ErrorMessage"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setTotal(_ctx.integerValue("ListDistributedProductResponse.Data.Total"));<NEW_LINE>List<Items> info = new ArrayList<Items>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListDistributedProductResponse.Data.Info.Length"); i++) {<NEW_LINE>Items items = new Items();<NEW_LINE>items.setSourceUid(_ctx.stringValue("ListDistributedProductResponse.Data.Info[" + i + "].SourceUid"));<NEW_LINE>items.setTargetUid(_ctx.stringValue("ListDistributedProductResponse.Data.Info[" + i + "].TargetUid"));<NEW_LINE>items.setProductKey(_ctx.stringValue("ListDistributedProductResponse.Data.Info[" + i + "].ProductKey"));<NEW_LINE>items.setSourceInstanceId(_ctx.stringValue("ListDistributedProductResponse.Data.Info[" + i + "].SourceInstanceId"));<NEW_LINE>items.setTargetInstanceId(_ctx.stringValue("ListDistributedProductResponse.Data.Info[" + i + "].TargetInstanceId"));<NEW_LINE>items.setGmtCreate(_ctx.longValue("ListDistributedProductResponse.Data.Info[" + i + "].GmtCreate"));<NEW_LINE>items.setTargetAliyunId(_ctx.stringValue("ListDistributedProductResponse.Data.Info[" + i + "].TargetAliyunId"));<NEW_LINE>items.setSourceRegion(_ctx.stringValue("ListDistributedProductResponse.Data.Info[" + i + "].SourceRegion"));<NEW_LINE>items.setTargetRegion(_ctx.stringValue("ListDistributedProductResponse.Data.Info[" + i + "].TargetRegion"));<NEW_LINE>items.setSourceInstanceName(_ctx.stringValue("ListDistributedProductResponse.Data.Info[" + i + "].SourceInstanceName"));<NEW_LINE>items.setTargetInstanceName(_ctx.stringValue("ListDistributedProductResponse.Data.Info[" + i + "].TargetInstanceName"));<NEW_LINE>info.add(items);<NEW_LINE>}<NEW_LINE>data.setInfo(info);<NEW_LINE>listDistributedProductResponse.setData(data);<NEW_LINE>return listDistributedProductResponse;<NEW_LINE>} | (_ctx.stringValue("ListDistributedProductResponse.Code")); |
970,832 | public com.amazonaws.services.mediaconnect.model.NotFoundException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.mediaconnect.model.NotFoundException notFoundException = new com.amazonaws.services.<MASK><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>} 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 notFoundException;<NEW_LINE>} | mediaconnect.model.NotFoundException(null); |
1,366,057 | public void whenStatsOnNotInitializedSubscriptionThenCorrectResponse() throws IOException {<NEW_LINE>final String et = createEventType().getName();<NEW_LINE>final Subscription s = createSubscriptionForEventType(et);<NEW_LINE>final Response response = when().get("/subscriptions/{sid}/stats", s.getId()).thenReturn();<NEW_LINE>final ItemsWrapper<SubscriptionEventTypeStats> statsItems = MAPPER.readValue(response.print(), new TypeReference<ItemsWrapper<SubscriptionEventTypeStats>>() {<NEW_LINE>});<NEW_LINE>Assert.assertEquals(1, statsItems.getItems().size());<NEW_LINE>final SubscriptionEventTypeStats stats = statsItems.getItems().get(0);<NEW_LINE>Assert.assertEquals(et, stats.getEventType());<NEW_LINE>Assert.assertEquals(1, stats.getPartitions().size());<NEW_LINE>for (final SubscriptionEventTypeStats.Partition partition : stats.getPartitions()) {<NEW_LINE>Assert.assertNotNull(partition);<NEW_LINE>Assert.assertNotNull(partition.getPartition());<NEW_LINE>Assert.assertEquals("", partition.getStreamId());<NEW_LINE>Assert.assertNull(partition.getUnconsumedEvents());<NEW_LINE>Assert.assertEquals(<MASK><NEW_LINE>}<NEW_LINE>} | "unassigned", partition.getState()); |
465,027 | public void loadAdditinalData(long stime, long etime, final boolean reverse) {<NEW_LINE>collectObj();<NEW_LINE>Iterator<Integer> serverIds = serverObjMap<MASK><NEW_LINE>final TreeSet<XLogData> tempSet = new TreeSet<XLogData>(new XLogDataComparator());<NEW_LINE>int limit = PManager.getInstance().getInt(PreferenceConstants.P_XLOG_IGNORE_TIME);<NEW_LINE>final int max = getMaxCount();<NEW_LINE>while (serverIds.hasNext()) {<NEW_LINE>final int serverId = serverIds.next();<NEW_LINE>TcpProxy tcp = TcpProxy.getTcpProxy(serverId);<NEW_LINE>try {<NEW_LINE>MapPack param = new MapPack();<NEW_LINE>param.put("date", DateUtil.yyyymmdd(stime));<NEW_LINE>param.put("stime", stime);<NEW_LINE>param.put("etime", etime);<NEW_LINE>param.put("objHash", serverObjMap.get(serverId));<NEW_LINE>param.put("reverse", new BooleanValue(reverse));<NEW_LINE>if (limit > 0) {<NEW_LINE>param.put("limit", limit);<NEW_LINE>}<NEW_LINE>if (max > 0) {<NEW_LINE>param.put("max", max);<NEW_LINE>}<NEW_LINE>twdata.setMax(max);<NEW_LINE>tcp.process(RequestCmd.TRANX_LOAD_TIME_GROUP, param, new INetReader() {<NEW_LINE><NEW_LINE>public void process(DataInputX in) throws IOException {<NEW_LINE>Pack p = in.readPack();<NEW_LINE>XLogPack x = XLogUtil.toXLogPack(p);<NEW_LINE>if (tempSet.size() < max) {<NEW_LINE>tempSet.add(new XLogData(x, serverId));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (Throwable t) {<NEW_LINE>ConsoleProxy.errorSafe(t.toString());<NEW_LINE>} finally {<NEW_LINE>TcpProxy.putTcpProxy(tcp);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (reverse) {<NEW_LINE>Iterator<XLogData> itr = tempSet.descendingIterator();<NEW_LINE>while (itr.hasNext()) {<NEW_LINE>XLogData d = itr.next();<NEW_LINE>twdata.putFirst(d.p.txid, d);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>Iterator<XLogData> itr = tempSet.iterator();<NEW_LINE>while (itr.hasNext()) {<NEW_LINE>XLogData d = itr.next();<NEW_LINE>twdata.putLast(d.p.txid, d);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .keySet().iterator(); |
1,227,410 | protected byte[] generateGlue(Collection<Executable> members) {<NEW_LINE>ClassWriter cw = new ClassWriter(COMPUTE_MAXS);<NEW_LINE>MethodVisitor mv;<NEW_LINE>// target Java8 because that's all we need for the generated trampoline code<NEW_LINE>cw.visit(V1_8, PUBLIC | FINAL | ACC_SUPER, proxyName, null, "java/lang/Object", FAST_CLASS_API);<NEW_LINE>cw.visitSource(GENERATED_SOURCE, null);<NEW_LINE>// this shared field contains the constructor handle adapted to look like an invoker table<NEW_LINE>cw.visitField(PUBLIC | STATIC | FINAL, INVOKERS_NAME, INVOKERS_DESCRIPTOR, null, null).visitEnd();<NEW_LINE>setupInvokerTable(cw);<NEW_LINE>cw.visitField(PRIVATE | FINAL, "index", "I", null, null).visitEnd();<NEW_LINE>// fast-class constructor that takes an index and binds it<NEW_LINE>mv = cw.visitMethod(PUBLIC, "<init>", "(I)V", null, null);<NEW_LINE>mv.visitCode();<NEW_LINE>mv.visitVarInsn(ALOAD, 0);<NEW_LINE>mv.visitInsn(DUP);<NEW_LINE>mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "<init>", "()V", false);<NEW_LINE>mv.visitVarInsn(ILOAD, 1);<NEW_LINE>mv.visitFieldInsn(PUTFIELD, proxyName, "index", "I");<NEW_LINE>mv.visitInsn(RETURN);<NEW_LINE>mv.visitMaxs(0, 0);<NEW_LINE>mv.visitEnd();<NEW_LINE>// fast-class invoker function that takes a context object and argument array<NEW_LINE>mv = cw.visitMethod(PUBLIC, "apply", RAW_INVOKER_DESCRIPTOR, null, null);<NEW_LINE>mv.visitCode();<NEW_LINE>// combine bound index with context object and argument array<NEW_LINE>mv.visitVarInsn(ALOAD, 0);<NEW_LINE>mv.visitFieldInsn(GETFIELD, proxyName, "index", "I");<NEW_LINE>mv.visitVarInsn(ALOAD, 1);<NEW_LINE><MASK><NEW_LINE>mv.visitTypeInsn(CHECKCAST, OBJECT_ARRAY_TYPE);<NEW_LINE>// call into the shared trampoline<NEW_LINE>mv.visitMethodInsn(INVOKESTATIC, proxyName, TRAMPOLINE_NAME, TRAMPOLINE_DESCRIPTOR, false);<NEW_LINE>mv.visitInsn(ARETURN);<NEW_LINE>mv.visitMaxs(0, 0);<NEW_LINE>mv.visitEnd();<NEW_LINE>generateTrampoline(cw, members);<NEW_LINE>cw.visitEnd();<NEW_LINE>return cw.toByteArray();<NEW_LINE>} | mv.visitVarInsn(ALOAD, 2); |
759,231 | public INDArray leverage() {<NEW_LINE>WorkspaceUtils.assertValidArray(this, "Cannot leverage INDArray to new workspace");<NEW_LINE>if (!isAttached())<NEW_LINE>return this;<NEW_LINE>MemoryWorkspace workspace = Nd4j.getMemoryManager().getCurrentWorkspace();<NEW_LINE>if (workspace == null) {<NEW_LINE>return this.detach();<NEW_LINE>}<NEW_LINE>MemoryWorkspace parentWorkspace = workspace.getParentWorkspace();<NEW_LINE>if (this.data.getParentWorkspace() == parentWorkspace)<NEW_LINE>return this;<NEW_LINE>// if there's no parent ws - just detach<NEW_LINE>if (parentWorkspace == null)<NEW_LINE>return this.detach();<NEW_LINE>else {<NEW_LINE>Nd4j.getExecutioner().commit();<NEW_LINE>// temporary set parent ws as current ws<NEW_LINE>Nd4j.getMemoryManager().setCurrentWorkspace(parentWorkspace);<NEW_LINE>INDArray copy = null;<NEW_LINE>if (!this.isView()) {<NEW_LINE>Nd4j.getExecutioner().commit();<NEW_LINE>DataBuffer buffer = Nd4j.createBuffer(this.length(), false);<NEW_LINE>Nd4j.getMemoryManager().memcpy(<MASK><NEW_LINE>copy = Nd4j.createArrayFromShapeBuffer(buffer, this.shapeInfoDataBuffer());<NEW_LINE>} else {<NEW_LINE>copy = this.dup(this.ordering());<NEW_LINE>Nd4j.getExecutioner().commit();<NEW_LINE>}<NEW_LINE>// restore current ws<NEW_LINE>Nd4j.getMemoryManager().setCurrentWorkspace(workspace);<NEW_LINE>return copy;<NEW_LINE>}<NEW_LINE>} | buffer, this.data()); |
661,371 | public static String transformName(@NotNull DBPDataSource dataSource, @Nullable String value) {<NEW_LINE>if (value == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final SQLDialect dialect = dataSource.getSQLDialect();<NEW_LINE>final boolean isNameCaseSensitive = dataSource.getContainer().getPreferenceStore().getBoolean(ModelPreferences.META_CASE_SENSITIVE) || dialect.storesUnquotedCase() == DBPIdentifierCase.MIXED;<NEW_LINE>if (isNameCaseSensitive) {<NEW_LINE>return value;<NEW_LINE>}<NEW_LINE>if (DBUtils.isQuotedIdentifier(dataSource, value)) {<NEW_LINE>if (dialect.supportsQuotedMixedCase()) {<NEW_LINE>return value;<NEW_LINE>}<NEW_LINE>value = DBUtils.getUnQuotedIdentifier(dataSource, value);<NEW_LINE>} else {<NEW_LINE>if (dialect.supportsUnquotedMixedCase() || dialect.storesUnquotedCase() == null) {<NEW_LINE>return value;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String xName = dialect.<MASK><NEW_LINE>if (!DBUtils.getQuotedIdentifier(dataSource, xName).equals(xName)) {<NEW_LINE>// Name contains special characters and has to be quoted - leave it as is<NEW_LINE>return value;<NEW_LINE>}<NEW_LINE>return xName;<NEW_LINE>} | storesUnquotedCase().transform(value); |
1,734,761 | public void partitionUpdate(PartitionUpdateParam partParam) {<NEW_LINE>GeneralPartUpdateParam param = (GeneralPartUpdateParam) partParam;<NEW_LINE>ServerLongAnyRow row = GraphMatrixUtils.getPSLongKeyRow(psContext, param);<NEW_LINE>ILongKeyAnyValuePartOp keyValuePart = (ILongKeyAnyValuePartOp) param.getKeyValuePart();<NEW_LINE>long[] nodeIds = keyValuePart.getKeys();<NEW_LINE>IElement[] neighbors = keyValuePart.getValues();<NEW_LINE>row.startWrite();<NEW_LINE>try {<NEW_LINE>for (int i = 0; i < nodeIds.length; i++) {<NEW_LINE>GraphNode graphNode = (GraphNode) row.get(nodeIds[i]);<NEW_LINE>if (graphNode == null) {<NEW_LINE>graphNode = new GraphNode();<NEW_LINE>row.set<MASK><NEW_LINE>}<NEW_LINE>graphNode.setTypes(((NodeType) neighbors[i]).getTypes());<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>row.endWrite();<NEW_LINE>}<NEW_LINE>} | (nodeIds[i], graphNode); |
1,788,553 | protected void createBeanPool() {<NEW_LINE>ObjectFactory sessionCtxFactory = new SessionContextFactory();<NEW_LINE>iased = ejbDescriptor.getIASEjbExtraDescriptors();<NEW_LINE>if (iased != null) {<NEW_LINE>beanPoolDes = iased.getBeanPool();<NEW_LINE>}<NEW_LINE>poolProp <MASK><NEW_LINE>String val = ejbDescriptor.getEjbBundleDescriptor().getEnterpriseBeansProperty(SINGLETON_BEAN_POOL_PROP);<NEW_LINE>if (poolProp.maxWaitTimeInMillis != -1) {<NEW_LINE>pool = new //<NEW_LINE>//<NEW_LINE>BlockingPool(//<NEW_LINE>getContainerId(), //<NEW_LINE>ejbDescriptor.getName(), //<NEW_LINE>sessionCtxFactory, //<NEW_LINE>poolProp.steadyPoolSize, //<NEW_LINE>poolProp.poolResizeQuantity, poolProp.maxPoolSize, poolProp.poolIdleTimeoutInSeconds, loader, Boolean.parseBoolean(val), poolProp.maxWaitTimeInMillis);<NEW_LINE>} else {<NEW_LINE>pool = new //<NEW_LINE>//<NEW_LINE>NonBlockingPool(//<NEW_LINE>getContainerId(), //<NEW_LINE>ejbDescriptor.getName(), //<NEW_LINE>sessionCtxFactory, //<NEW_LINE>poolProp.steadyPoolSize, //<NEW_LINE>poolProp.poolResizeQuantity, poolProp.maxPoolSize, poolProp.poolIdleTimeoutInSeconds, loader, Boolean.parseBoolean(val));<NEW_LINE>}<NEW_LINE>} | = new PoolProperties(ejbContainer, beanPoolDes); |
921,093 | protected void prepare() {<NEW_LINE>ProcessInfoParameter[] para = getParameter();<NEW_LINE>for (int i = 0; i < para.length; i++) {<NEW_LINE>String name = para[i].getParameterName();<NEW_LINE>if (para[i].getParameter() == null)<NEW_LINE>;<NEW_LINE>else if (name.equals("C_AcctSchema_ID"))<NEW_LINE>p_C_AcctSchema_ID = ((BigDecimal) para[i].getParameter()).intValue();<NEW_LINE>else if (name.equals("C_ConversionType_ID"))<NEW_LINE>p_C_ConversionType_ID = ((BigDecimal) para[i].getParameter()).intValue();<NEW_LINE>else if (name.equals("StatementDate"))<NEW_LINE>p_StatementDate = (Timestamp) para[i].getParameter();<NEW_LINE>else if (name.equals("IsSOTrx") && para[i].getParameter() != null)<NEW_LINE>p_IsSOTrx = (String) para[i].getParameter();<NEW_LINE>else if (name.equals("C_Currency_ID"))<NEW_LINE>p_C_Currency_ID = ((BigDecimal) para[i].getParameter()).intValue();<NEW_LINE>else if (name.equals("AD_Org_ID"))<NEW_LINE>p_AD_Org_ID = ((BigDecimal) para[i].getParameter()).intValue();<NEW_LINE>else if (name.equals("C_BP_Group_ID"))<NEW_LINE>p_C_BP_Group_ID = ((BigDecimal) para[i].getParameter()).intValue();<NEW_LINE>else if (name.equals("C_BPartner_ID"))<NEW_LINE>p_C_BPartner_ID = ((BigDecimal) para[i].getParameter()).intValue();<NEW_LINE>else if (name.equals("ListSources"))<NEW_LINE>p_ListSources = "Y".equals(para[i].getParameter());<NEW_LINE>else if (name.equals("IsIncludePayments"))<NEW_LINE>p_IncludePayments = "Y".equals(para[i].getParameter());<NEW_LINE>else<NEW_LINE>log.log(Level.SEVERE, "Unknown Parameter: " + name);<NEW_LINE>}<NEW_LINE>// get currency_id for account schema<NEW_LINE>final MAcctSchema as = MAcctSchema.<MASK><NEW_LINE>as_C_Currency_ID = as.getC_Currency_ID();<NEW_LINE>if (p_StatementDate == null)<NEW_LINE>p_StatementDate = new Timestamp(System.currentTimeMillis());<NEW_LINE>else<NEW_LINE>m_statementOffset = TimeUtil.getDaysBetween(new Timestamp(System.currentTimeMillis()), p_StatementDate);<NEW_LINE>} | get(getCtx(), p_C_AcctSchema_ID); |
511,894 | public boolean instantiateTo(int value, ICause cause) throws ContradictionException {<NEW_LINE>assert cause != null;<NEW_LINE>boolean done = false;<NEW_LINE>if (!this.contains(value)) {<NEW_LINE>model.getSolver().getEventObserver().instantiateTo(this, value, cause, getLB(), getUB());<NEW_LINE><MASK><NEW_LINE>} else if (!isInstantiated()) {<NEW_LINE>model.getSolver().getEventObserver().instantiateTo(this, value, cause, getLB(), getUB());<NEW_LINE>this.fixed.set(true);<NEW_LINE>if (reactOnRemoval) {<NEW_LINE>delta.add(1 - value, cause);<NEW_LINE>}<NEW_LINE>if (value == 1) {<NEW_LINE>done = var.updateUpperBound(cste, this);<NEW_LINE>} else {<NEW_LINE>done = var.updateLowerBound(cste + 1, this);<NEW_LINE>}<NEW_LINE>notifyPropagators(IntEventType.INSTANTIATE, cause);<NEW_LINE>}<NEW_LINE>return done;<NEW_LINE>} | this.contradiction(cause, MSG_EMPTY); |
415,321 | public StopFlowResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>StopFlowResult stopFlowResult = new StopFlowResult();<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 stopFlowResult;<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("flowArn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>stopFlowResult.setFlowArn(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("flowStatus", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>stopFlowResult.setFlowStatus(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return stopFlowResult;<NEW_LINE>} | class).unmarshall(context)); |
1,641,849 | protected void executeActionInvocation(ActionInvocation invocation) {<NEW_LINE>if (invocation != null) {<NEW_LINE>new ActionCallback.Default(invocation, upnpService.getControlPoint()).run();<NEW_LINE>ActionException anException = invocation.getFailure();<NEW_LINE>if (anException != null && anException.getMessage() != null) {<NEW_LINE>logger.warn(anException.getMessage());<NEW_LINE>}<NEW_LINE>Map<String, ActionArgumentValue> result = invocation.getOutputMap();<NEW_LINE>Map<String, StateVariableValue> mapToProcess = new HashMap<String, StateVariableValue>();<NEW_LINE>if (result != null) {<NEW_LINE>// only process the variables that have changed value<NEW_LINE>for (String variable : result.keySet()) {<NEW_LINE>ActionArgumentValue <MASK><NEW_LINE>StateVariable newVariable = new StateVariable(variable, new StateVariableTypeDetails(newArgument.getDatatype()));<NEW_LINE>StateVariableValue newValue = new StateVariableValue(newVariable, newArgument.getValue());<NEW_LINE>if (isUpdatedValue(variable, newValue)) {<NEW_LINE>mapToProcess.put(variable, newValue);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>stateMap.putAll(mapToProcess);<NEW_LINE>sonosBinding.processVariableMap(device, mapToProcess);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | newArgument = result.get(variable); |
1,719,521 | private void renderPeak(Graphics2D gr) {<NEW_LINE>if (peakColor == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int position = getPosition(peak);<NEW_LINE>int decrement = 0;<NEW_LINE>int left = 0;<NEW_LINE>int right = 0;<NEW_LINE>do {<NEW_LINE>left = Math.round(position - ((peakMarkSize - decrement) / 2f));<NEW_LINE>right = Math.round(left + ((peakMarkSize - decrement) / 2f));<NEW_LINE>if (left < 0) {<NEW_LINE>right += Math.abs(left);<NEW_LINE>left = 0;<NEW_LINE>}<NEW_LINE>if (right > canvasDimension.getWidth()) {<NEW_LINE>left -= (right - canvasDimension.getWidth());<NEW_LINE>right = <MASK><NEW_LINE>}<NEW_LINE>decrement++;<NEW_LINE>} while (((left < 0) || (right > canvasDimension.getWidth())) && (left != right));<NEW_LINE>gr.setPaint(peakColor);<NEW_LINE>gr.fillRect(left, 0, right - left + 1, canvasDimension.height);<NEW_LINE>} | (int) canvasDimension.getWidth(); |
1,139,979 | public ListRoomMembershipsResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListRoomMembershipsResult listRoomMembershipsResult = new ListRoomMembershipsResult();<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 listRoomMembershipsResult;<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("RoomMemberships", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listRoomMembershipsResult.setRoomMemberships(new ListUnmarshaller<RoomMembership>(RoomMembershipJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("NextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listRoomMembershipsResult.setNextToken(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return listRoomMembershipsResult;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
862,191 | public ReplaceContentEntry unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ReplaceContentEntry replaceContentEntry = new ReplaceContentEntry();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("filePath", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>replaceContentEntry.setFilePath(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("replacementType", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>replaceContentEntry.setReplacementType(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("content", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>replaceContentEntry.setContent(context.getUnmarshaller(java.nio.ByteBuffer.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("fileMode", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>replaceContentEntry.setFileMode(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 replaceContentEntry;<NEW_LINE>} | String currentParentElement = context.getCurrentParentElement(); |
140,591 | public List<User> executeList(CommandContext commandContext) {<NEW_LINE>// GET /{realm}/users<NEW_LINE>// Query parameters: username, email, firstName, lastName, search(email, first, last or username)<NEW_LINE>// paging first, max<NEW_LINE>UriComponentsBuilder builder = prepareQuery("/users");<NEW_LINE>if (getMaxResults() >= 0) {<NEW_LINE>builder.queryParam("max", getMaxResults());<NEW_LINE>}<NEW_LINE>if (getFirstResult() >= 0) {<NEW_LINE>builder.queryParam("first", getFirstResult());<NEW_LINE>}<NEW_LINE>URI uri = builder.buildAndExpand(keycloakConfiguration.<MASK><NEW_LINE>ResponseEntity<List<KeycloakUserRepresentation>> response = keycloakConfiguration.getRestTemplate().exchange(uri, HttpMethod.GET, null, KEYCLOAK_LIST_OF_USERS);<NEW_LINE>HttpStatus statusCode = response.getStatusCode();<NEW_LINE>if (statusCode.is2xxSuccessful()) {<NEW_LINE>LOGGER.debug("Successful response from keycloak");<NEW_LINE>List<KeycloakUserRepresentation> keycloakUsers = response.getBody();<NEW_LINE>if (keycloakUsers != null) {<NEW_LINE>List<User> users = new ArrayList<>(keycloakUsers.size());<NEW_LINE>for (KeycloakUserRepresentation keycloakUser : keycloakUsers) {<NEW_LINE>User user = new UserEntityImpl();<NEW_LINE>user.setId(keycloakUser.getUsername());<NEW_LINE>user.setFirstName(keycloakUser.getFirstName());<NEW_LINE>user.setLastName(keycloakUser.getLastName());<NEW_LINE>user.setEmail(keycloakUser.getEmail());<NEW_LINE>users.add(user);<NEW_LINE>}<NEW_LINE>return users;<NEW_LINE>} else {<NEW_LINE>LOGGER.warn("Keycloak didn't return any body when querying users");<NEW_LINE>return Collections.emptyList();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new FlowableException("Keycloak returned status code: " + statusCode);<NEW_LINE>}<NEW_LINE>} | getRealm()).toUri(); |
1,132,127 | protected org.activiti.engine.impl.persistence.entity.JobEntity convertToActiviti5JobEntity(final JobEntity job) {<NEW_LINE>org.activiti.engine.impl.persistence.entity.JobEntity activity5Job = new org.activiti.engine.impl.persistence.entity.JobEntity();<NEW_LINE>activity5Job.<MASK><NEW_LINE>activity5Job.setDuedate(job.getDuedate());<NEW_LINE>activity5Job.setExclusive(job.isExclusive());<NEW_LINE>activity5Job.setExecutionId(job.getExecutionId());<NEW_LINE>activity5Job.setId(job.getId());<NEW_LINE>activity5Job.setJobHandlerConfiguration(job.getJobHandlerConfiguration());<NEW_LINE>activity5Job.setJobHandlerType(job.getJobHandlerType());<NEW_LINE>activity5Job.setEndDate(job.getEndDate());<NEW_LINE>activity5Job.setRepeat(job.getRepeat());<NEW_LINE>activity5Job.setProcessDefinitionId(job.getProcessDefinitionId());<NEW_LINE>activity5Job.setProcessInstanceId(job.getProcessInstanceId());<NEW_LINE>activity5Job.setRetries(job.getRetries());<NEW_LINE>activity5Job.setRevision(job.getRevision());<NEW_LINE>activity5Job.setTenantId(job.getTenantId());<NEW_LINE>activity5Job.setExceptionMessage(job.getExceptionMessage());<NEW_LINE>return activity5Job;<NEW_LINE>} | setJobType(job.getJobType()); |
1,433,843 | protected NodesReloadSecureSettingsResponse.NodeResponse nodeOperation(NodeRequest nodeReloadRequest) {<NEW_LINE>try (KeyStoreWrapper keystore = KeyStoreWrapper.load(environment.configFile())) {<NEW_LINE>// reread keystore from config file<NEW_LINE>if (keystore == null) {<NEW_LINE>return new NodesReloadSecureSettingsResponse.NodeResponse(clusterService.localNode(), new IllegalStateException("Keystore is missing"));<NEW_LINE>}<NEW_LINE>keystore.decrypt(new char[0]);<NEW_LINE>// add the keystore to the original node settings object<NEW_LINE>final Settings settingsWithKeystore = Settings.builder().put(environment.settings(), false).setSecureSettings(keystore).build();<NEW_LINE>final List<Exception> exceptions = new ArrayList<>();<NEW_LINE>// broadcast the new settings object (with the open embedded keystore) to all reloadable plugins<NEW_LINE>pluginsService.filterPlugins(ReloadablePlugin.class).stream().forEach(p -> {<NEW_LINE>try {<NEW_LINE>p.reload(settingsWithKeystore);<NEW_LINE>} catch (final Exception e) {<NEW_LINE>logger.warn((Supplier<?>) () -> new ParameterizedMessage("Reload failed for plugin [{}]", p.getClass().getSimpleName()), e);<NEW_LINE>exceptions.add(e);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>ExceptionsHelper.rethrowAndSuppress(exceptions);<NEW_LINE>return new NodesReloadSecureSettingsResponse.NodeResponse(<MASK><NEW_LINE>} catch (final Exception e) {<NEW_LINE>return new NodesReloadSecureSettingsResponse.NodeResponse(clusterService.localNode(), e);<NEW_LINE>}<NEW_LINE>} | clusterService.localNode(), null); |
1,587,286 | public boolean doMonitor(ServiceEmitter emitter) {<NEW_LINE>FireDepartmentMetrics metrics = fireDepartment.getMetrics().snapshot();<NEW_LINE>RowIngestionMetersTotals rowIngestionMetersTotals = rowIngestionMeters.getTotals();<NEW_LINE>final ServiceMetricEvent.Builder builder = new ServiceMetricEvent.Builder().setDimension(DruidMetrics.DATASOURCE, fireDepartment.getDataSchema().getDataSource());<NEW_LINE>MonitorUtils.addDimensionsToBuilder(builder, dimensions);<NEW_LINE>final long thrownAway = rowIngestionMetersTotals.getThrownAway() - previousRowIngestionMetersTotals.getThrownAway();<NEW_LINE>if (thrownAway > 0) {<NEW_LINE>log.warn("[%,d] events thrown away. Possible causes: null events, events filtered out by transformSpec, or events outside earlyMessageRejectionPeriod / lateMessageRejectionPeriod.", thrownAway);<NEW_LINE>}<NEW_LINE>emitter.emit(builder.build("ingest/events/thrownAway", thrownAway));<NEW_LINE>final long unparseable = rowIngestionMetersTotals.getUnparseable() - previousRowIngestionMetersTotals.getUnparseable();<NEW_LINE>if (unparseable > 0) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>emitter.emit(builder.build("ingest/events/unparseable", unparseable));<NEW_LINE>final long processedWithError = rowIngestionMetersTotals.getProcessedWithError() - previousRowIngestionMetersTotals.getProcessedWithError();<NEW_LINE>if (processedWithError > 0) {<NEW_LINE>log.error("[%,d] events processed with errors! Set logParseExceptions to true in the ingestion spec to log these errors.", processedWithError);<NEW_LINE>}<NEW_LINE>emitter.emit(builder.build("ingest/events/processedWithError", processedWithError));<NEW_LINE>emitter.emit(builder.build("ingest/events/processed", rowIngestionMetersTotals.getProcessed() - previousRowIngestionMetersTotals.getProcessed()));<NEW_LINE>final long dedup = metrics.dedup() - previousFireDepartmentMetrics.dedup();<NEW_LINE>if (dedup > 0) {<NEW_LINE>log.warn("[%,d] duplicate events!", dedup);<NEW_LINE>}<NEW_LINE>emitter.emit(builder.build("ingest/events/duplicate", dedup));<NEW_LINE>emitter.emit(builder.build("ingest/rows/output", metrics.rowOutput() - previousFireDepartmentMetrics.rowOutput()));<NEW_LINE>emitter.emit(builder.build("ingest/persists/count", metrics.numPersists() - previousFireDepartmentMetrics.numPersists()));<NEW_LINE>emitter.emit(builder.build("ingest/persists/time", metrics.persistTimeMillis() - previousFireDepartmentMetrics.persistTimeMillis()));<NEW_LINE>emitter.emit(builder.build("ingest/persists/cpu", metrics.persistCpuTime() - previousFireDepartmentMetrics.persistCpuTime()));<NEW_LINE>emitter.emit(builder.build("ingest/persists/backPressure", metrics.persistBackPressureMillis() - previousFireDepartmentMetrics.persistBackPressureMillis()));<NEW_LINE>emitter.emit(builder.build("ingest/persists/failed", metrics.failedPersists() - previousFireDepartmentMetrics.failedPersists()));<NEW_LINE>emitter.emit(builder.build("ingest/handoff/failed", metrics.failedHandoffs() - previousFireDepartmentMetrics.failedHandoffs()));<NEW_LINE>emitter.emit(builder.build("ingest/merge/time", metrics.mergeTimeMillis() - previousFireDepartmentMetrics.mergeTimeMillis()));<NEW_LINE>emitter.emit(builder.build("ingest/merge/cpu", metrics.mergeCpuTime() - previousFireDepartmentMetrics.mergeCpuTime()));<NEW_LINE>emitter.emit(builder.build("ingest/handoff/count", metrics.handOffCount() - previousFireDepartmentMetrics.handOffCount()));<NEW_LINE>emitter.emit(builder.build("ingest/sink/count", metrics.sinkCount()));<NEW_LINE>emitter.emit(builder.build("ingest/events/messageGap", metrics.messageGap()));<NEW_LINE>previousRowIngestionMetersTotals = rowIngestionMetersTotals;<NEW_LINE>previousFireDepartmentMetrics = metrics;<NEW_LINE>return true;<NEW_LINE>} | log.error("[%,d] unparseable events discarded. Turn on debug logging to see exception stack trace.", unparseable); |
363,809 | public static Map<String, byte[]> compile(ClassPath compile, final String code) throws IOException {<NEW_LINE>DiagnosticListener<JavaFileObject> devNull = (Diagnostic<? extends JavaFileObject> diagnostic) -> {<NEW_LINE>};<NEW_LINE>StandardJavaFileManager sjfm = ToolProvider.getSystemJavaCompiler().getStandardFileManager(devNull, null, null);<NEW_LINE>final Map<String, ByteArrayOutputStream> <MASK><NEW_LINE>sjfm.setLocation(StandardLocation.CLASS_PATH, toFiles(compile));<NEW_LINE>JavaFileManager jfm = new ForwardingJavaFileManager<JavaFileManager>(sjfm) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public JavaFileObject getJavaFileForOutput(Location location, String className, Kind kind, FileObject sibling) throws IOException {<NEW_LINE>final ByteArrayOutputStream buffer = new ByteArrayOutputStream();<NEW_LINE>class2BAOS.put(className, buffer);<NEW_LINE>return new SimpleJavaFileObject(sibling.toUri(), kind) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public OutputStream openOutputStream() throws IOException {<NEW_LINE>return buffer;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}<NEW_LINE>};<NEW_LINE>JavaFileObject file = new SimpleJavaFileObject(URI.create("mem://mem"), Kind.SOURCE) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public CharSequence getCharContent(boolean ignoreEncodingErrors) throws IOException {<NEW_LINE>return code;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>ToolProvider.getSystemJavaCompiler().getTask(null, jfm, devNull, /*XXX:*/<NEW_LINE>Arrays.asList("-source", SOURCE_LEVEL, "-target", SOURCE_LEVEL, "-proc:none"), null, Arrays.asList(file)).call();<NEW_LINE>Map<String, byte[]> result = new HashMap<>();<NEW_LINE>for (Map.Entry<String, ByteArrayOutputStream> e : class2BAOS.entrySet()) {<NEW_LINE>result.put(e.getKey(), e.getValue().toByteArray());<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | class2BAOS = new HashMap<>(); |
1,608,662 | private void initVerticalToolbar(ActionListener outputListener) {<NEW_LINE>// NOI18N<NEW_LINE>URL url = getClass().getResource(IMG_PREFIX + "row_add.png");<NEW_LINE>insert = new JButton(new ImageIcon(url));<NEW_LINE>insert.setToolTipText(NbBundle.getMessage(DataViewUI.class, "TOOLTIP_insert") + " (Alt+I)");<NEW_LINE>insert.setMnemonic('I');<NEW_LINE>insert.addActionListener(outputListener);<NEW_LINE>insert.setEnabled(false);<NEW_LINE>processButton(insert);<NEW_LINE>editButtons[0] = insert;<NEW_LINE>// NOI18N<NEW_LINE>url = getClass().getResource(IMG_PREFIX + "row_delete.png");<NEW_LINE>deleteRow = new JButton(new ImageIcon(url));<NEW_LINE>deleteRow.setToolTipText(NbBundle.getMessage(DataViewUI.class, "TOOLTIP_deleterow"));<NEW_LINE>deleteRow.addActionListener(outputListener);<NEW_LINE>deleteRow.setEnabled(false);<NEW_LINE>processButton(deleteRow);<NEW_LINE>editButtons[1] = deleteRow;<NEW_LINE>// NOI18N<NEW_LINE>url = getClass().getResource(IMG_PREFIX + "row_commit.png");<NEW_LINE>commit = new JButton(new ImageIcon(url));<NEW_LINE>commit.setToolTipText(NbBundle.getMessage<MASK><NEW_LINE>commit.addActionListener(outputListener);<NEW_LINE>commit.setEnabled(false);<NEW_LINE>processButton(commit);<NEW_LINE>editButtons[2] = commit;<NEW_LINE>// NOI18N<NEW_LINE>url = getClass().getResource(IMG_PREFIX + "cancel_edits.png");<NEW_LINE>cancel = new JButton(new ImageIcon(url));<NEW_LINE>cancel.setToolTipText(NbBundle.getMessage(DataViewUI.class, "TOOLTIP_cancel_edits_all"));<NEW_LINE>cancel.addActionListener(outputListener);<NEW_LINE>cancel.setEnabled(false);<NEW_LINE>processButton(cancel);<NEW_LINE>editButtons[3] = cancel;<NEW_LINE>// add truncate button<NEW_LINE>// NOI18N<NEW_LINE>url = getClass().getResource(IMG_PREFIX + "table_truncate.png");<NEW_LINE>truncateButton = new JButton(new ImageIcon(url));<NEW_LINE>truncateButton.setToolTipText(NbBundle.getMessage(DataViewUI.class, "TOOLTIP_truncate_table") + " (Alt+T)");<NEW_LINE>truncateButton.setMnemonic('T');<NEW_LINE>truncateButton.addActionListener(outputListener);<NEW_LINE>truncateButton.setEnabled(false);<NEW_LINE>processButton(truncateButton);<NEW_LINE>editButtons[4] = truncateButton;<NEW_LINE>} | (DataViewUI.class, "TOOLTIP_commit_all")); |
159,928 | // Binary Search<NEW_LINE>public static void main(String[] args) {<NEW_LINE>// Creating Scanner Object for taking Inputs from the USER<NEW_LINE>Scanner sc = new Scanner(System.in);<NEW_LINE>// Take the SIZE of the Array from the USER<NEW_LINE>System.out.print(" Enter SIZE of the Array: ");<NEW_LINE>int n = sc.nextInt();<NEW_LINE>// Create Array of Required SIZE<NEW_LINE>int[] arr = new int[n];<NEW_LINE>// fill the Array By Taking n inputs from the USER<NEW_LINE>System.out.print(" Enter " + n + " Elements: ");<NEW_LINE>for (int i = 0; i < n; i++) arr[i] = sc.nextInt();<NEW_LINE>// Display the Array<NEW_LINE>System.out.println<MASK><NEW_LINE>// take the Target Element from the USER<NEW_LINE>System.out.print(" Enter target Element to Find: ");<NEW_LINE>int target = sc.nextInt();<NEW_LINE>// Display if the Element Found or not<NEW_LINE>System.out.println(target + " Found at Index: " + search(arr, target));<NEW_LINE>} | (Arrays.toString(arr)); |
749,366 | public void syncObjects(Object... objects) {<NEW_LINE>if (vm == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Event[] events = new Event[objects.length];<NEW_LINE>for (int i = 0; i < objects.length; i++) {<NEW_LINE>Object object = objects[i];<NEW_LINE>events[i] = syncObjectInner(object);<NEW_LINE>}<NEW_LINE>for (Event e : events) {<NEW_LINE>e.waitOn();<NEW_LINE>}<NEW_LINE>if (TornadoOptions.isProfilerEnabled()) {<NEW_LINE>timeProfiler.clean();<NEW_LINE>for (int i = 0; i < events.length; i++) {<NEW_LINE>long value = timeProfiler.getTimer(ProfilerType.COPY_OUT_TIME_SYNC);<NEW_LINE>events[i].waitForEvents();<NEW_LINE>value += events[i].getElapsedTime();<NEW_LINE>timeProfiler.setTimer(ProfilerType.COPY_OUT_TIME_SYNC, value);<NEW_LINE>LocalObjectState localState = executionContext<MASK><NEW_LINE>DeviceObjectState deviceObjectState = localState.getGlobalState().getDeviceState(meta().getLogicDevice());<NEW_LINE>timeProfiler.addValueToMetric(ProfilerType.COPY_OUT_SIZE_BYTES_SYNC, TimeProfiler.NO_TASK_NAME, deviceObjectState.getBuffer().size());<NEW_LINE>}<NEW_LINE>updateProfiler();<NEW_LINE>}<NEW_LINE>} | .getObjectState(objects[i]); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.