idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
829,842 | protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception {<NEW_LINE>if (state() == State.HEADER) {<NEW_LINE>int nLoc = in.bytesBefore((byte) '\n');<NEW_LINE>ByteBuf headerBuf = in.readBytes(nLoc + 1);<NEW_LINE>String headerLine = headerBuf.toString(UTF8).trim();<NEW_LINE>nLoc = in.bytesBefore((byte) '\n');<NEW_LINE>in.readBytes(nLoc);<NEW_LINE>in.readByte();<NEW_LINE>if (headerLine.startsWith(CONTENT_LENGTH)) {<NEW_LINE>String lenStr = headerLine.substring(CONTENT_LENGTH.length()).trim();<NEW_LINE>this.length = Integer.parseInt(lenStr);<NEW_LINE>state(State.BODY);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (state() == State.BODY) {<NEW_LINE>JsonNode node = mapper.readTree(new ByteBufInputStream(in, this.length));<NEW_LINE>String type = node.get("type").asText();<NEW_LINE>if ("request".equals(type)) {<NEW_LINE>String commandStr = node.get("command").asText();<NEW_LINE>AbstractCommand command = <MASK><NEW_LINE>if (command != null) {<NEW_LINE>Request request = command.newRequest();<NEW_LINE>request.setSeq(node.get("seq").asInt());<NEW_LINE>ObjectReader reader = mapper.reader().withValueToUpdate(request);<NEW_LINE>if (node.has("arguments")) {<NEW_LINE>reader.readValue(node.get("arguments"));<NEW_LINE>} else if (request instanceof NoArgumentsRequest) {<NEW_LINE>reader.readValue(node);<NEW_LINE>}<NEW_LINE>out.add(request);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>state(State.HEADER);<NEW_LINE>this.length = -1;<NEW_LINE>}<NEW_LINE>} | this.debugger.getCommand(commandStr); |
1,177,673 | public static void rememberWindowSize(final Window window) {<NEW_LINE>window.addComponentListener(new ComponentAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void componentResized(ComponentEvent e) {<NEW_LINE>final Dimension previousWindowSize = ((SwingPreferences) Application.getPreferences()).getWindowSize(window.getClass());<NEW_LINE>if (!window.getSize().equals(previousWindowSize)) {<NEW_LINE>log.debug("Storing size of " + window.getClass().getName() + ": " + window.getSize());<NEW_LINE>((SwingPreferences) Application.getPreferences()).setWindowSize(window.getClass(), window.getSize());<NEW_LINE>}<NEW_LINE>if (window instanceof JFrame) {<NEW_LINE>if ((((JFrame) window).getExtendedState() & JFrame.MAXIMIZED_BOTH) == JFrame.MAXIMIZED_BOTH) {<NEW_LINE>log.debug("Storing maximized state of " + window.<MASK><NEW_LINE>((SwingPreferences) Application.getPreferences()).setWindowMaximized(window.getClass());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>if (((SwingPreferences) Application.getPreferences()).isWindowMaximized(window.getClass())) {<NEW_LINE>if (window instanceof JFrame) {<NEW_LINE>((JFrame) window).setExtendedState(JFrame.MAXIMIZED_BOTH);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>Dimension dim = ((SwingPreferences) Application.getPreferences()).getWindowSize(window.getClass());<NEW_LINE>if (dim != null) {<NEW_LINE>window.setSize(dim);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | getClass().getName()); |
579,586 | public StringBuilder appendTo(final StringBuilder builder) {<NEW_LINE>if (null == buffer) {<NEW_LINE>return builder;<NEW_LINE>}<NEW_LINE>final int originalLimit = limit();<NEW_LINE>limit(initialOffset + actingBlockLength);<NEW_LINE>builder.append("[FrameCodec](sbeTemplateId=");<NEW_LINE>builder.append(TEMPLATE_ID);<NEW_LINE>builder.append("|sbeSchemaId=");<NEW_LINE>builder.append(SCHEMA_ID);<NEW_LINE>builder.append("|sbeSchemaVersion=");<NEW_LINE>if (parentMessage.actingVersion != SCHEMA_VERSION) {<NEW_LINE>builder.append(parentMessage.actingVersion);<NEW_LINE>builder.append('/');<NEW_LINE>}<NEW_LINE>builder.append(SCHEMA_VERSION);<NEW_LINE>builder.append("|sbeBlockLength=");<NEW_LINE>if (actingBlockLength != BLOCK_LENGTH) {<NEW_LINE>builder.append(actingBlockLength);<NEW_LINE>builder.append('/');<NEW_LINE>}<NEW_LINE>builder.append(BLOCK_LENGTH);<NEW_LINE>builder.append("):");<NEW_LINE>builder.append("irId=");<NEW_LINE>builder.append(irId());<NEW_LINE>builder.append('|');<NEW_LINE>builder.append("irVersion=");<NEW_LINE>builder.append(irVersion());<NEW_LINE>builder.append('|');<NEW_LINE>builder.append("schemaVersion=");<NEW_LINE>builder.append(schemaVersion());<NEW_LINE>builder.append('|');<NEW_LINE>builder.append("packageName=");<NEW_LINE>builder.append('\'').append(packageName()).append('\'');<NEW_LINE>builder.append('|');<NEW_LINE>builder.append("namespaceName=");<NEW_LINE>builder.append('\'').append(namespaceName<MASK><NEW_LINE>builder.append('|');<NEW_LINE>builder.append("semanticVersion=");<NEW_LINE>builder.append('\'').append(semanticVersion()).append('\'');<NEW_LINE>limit(originalLimit);<NEW_LINE>return builder;<NEW_LINE>} | ()).append('\''); |
1,636,787 | public MappeableContainer iandNot(final MappeableRunContainer x) {<NEW_LINE>if (BufferUtil.isBackedBySimpleArray(this.bitmap)) {<NEW_LINE>long[] b = this.bitmap.array();<NEW_LINE>for (int rlepos = 0; rlepos < x.nbrruns; ++rlepos) {<NEW_LINE>int start = (x.getValue(rlepos));<NEW_LINE>int end = start + (x.getLength(rlepos)) + 1;<NEW_LINE>int prevOnesInRange = Util.cardinalityInBitmapRange(b, start, end);<NEW_LINE>Util.resetBitmapRange(b, start, end);<NEW_LINE>updateCardinality(prevOnesInRange, 0);<NEW_LINE>}<NEW_LINE>if (getCardinality() > MappeableArrayContainer.DEFAULT_MAX_SIZE) {<NEW_LINE>return this;<NEW_LINE>} else {<NEW_LINE>return toArrayContainer();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int rlepos = 0; rlepos < x.nbrruns; ++rlepos) {<NEW_LINE>int start = (x.getValue(rlepos));<NEW_LINE>int end = start + (x<MASK><NEW_LINE>int prevOnesInRange = cardinalityInRange(start, end);<NEW_LINE>BufferUtil.resetBitmapRange(this.bitmap, start, end);<NEW_LINE>updateCardinality(prevOnesInRange, 0);<NEW_LINE>}<NEW_LINE>if (getCardinality() > MappeableArrayContainer.DEFAULT_MAX_SIZE) {<NEW_LINE>return this;<NEW_LINE>} else {<NEW_LINE>return toArrayContainer();<NEW_LINE>}<NEW_LINE>} | .getLength(rlepos)) + 1; |
824,294 | public SearchLocation findNextTokenForSearchRegex(String searchString, FieldLocation currentLocation, boolean forwardSearch) {<NEW_LINE>Pattern pattern = null;<NEW_LINE>try {<NEW_LINE>pattern = Pattern.compile(searchString, <MASK><NEW_LINE>} catch (PatternSyntaxException e) {<NEW_LINE>Msg.showError(this, decompilerPanel, "Regular Expression Syntax Error", e.getMessage());<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Pattern finalPattern = pattern;<NEW_LINE>if (forwardSearch) {<NEW_LINE>java.util.function.Function<String, SearchMatch> function = textLine -> {<NEW_LINE>Matcher matcher = finalPattern.matcher(textLine);<NEW_LINE>if (matcher.find()) {<NEW_LINE>int start = matcher.start();<NEW_LINE>int end = matcher.end();<NEW_LINE>return new SearchMatch(start, end, textLine);<NEW_LINE>}<NEW_LINE>return SearchMatch.NO_MATCH;<NEW_LINE>};<NEW_LINE>return findNextTokenGoingForward(function, searchString, currentLocation);<NEW_LINE>}<NEW_LINE>java.util.function.Function<String, SearchMatch> reverse = textLine -> {<NEW_LINE>Matcher matcher = finalPattern.matcher(textLine);<NEW_LINE>if (!matcher.find()) {<NEW_LINE>return SearchMatch.NO_MATCH;<NEW_LINE>}<NEW_LINE>int start = matcher.start();<NEW_LINE>int end = matcher.end();<NEW_LINE>// Since the matcher can only match from the start to end of line, we need<NEW_LINE>// to find all matches and then take the last match<NEW_LINE>while (matcher.find()) {<NEW_LINE>start = matcher.start();<NEW_LINE>end = matcher.end();<NEW_LINE>}<NEW_LINE>return new SearchMatch(start, end, textLine);<NEW_LINE>};<NEW_LINE>return findNextTokenGoingBackward(reverse, searchString, currentLocation);<NEW_LINE>} | Pattern.CASE_INSENSITIVE | Pattern.DOTALL); |
145,906 | private // <editor-fold defaultstate="collapsed" desc="Init EditMenu"><NEW_LINE>void initEditMenu() throws NoSuchMethodException {<NEW_LINE>int scMask = Toolkit.getDefaultToolkit().getMenuShortcutKeyMask();<NEW_LINE>_editMenu.setMnemonic(java.awt.event.KeyEvent.VK_E);<NEW_LINE>JMenuItem undoItem = _editMenu.add(_undoAction);<NEW_LINE>undoItem.setAccelerator(KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_Z, scMask));<NEW_LINE>JMenuItem redoItem = _editMenu.add(_redoAction);<NEW_LINE>redoItem.setAccelerator(KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_Z, scMask | InputEvent.SHIFT_MASK));<NEW_LINE>_editMenu.addSeparator();<NEW_LINE>_editMenu.add(createMenuItem(_I("menuEditCut"), KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_X, scMask), new EditAction(EditAction.CUT)));<NEW_LINE>_editMenu.add(createMenuItem(_I("menuEditCopy"), KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_C, scMask), new EditAction(EditAction.COPY)));<NEW_LINE>_editMenu.add(createMenuItem(_I("menuEditPaste"), KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_V, scMask), new EditAction(EditAction.PASTE)));<NEW_LINE>_editMenu.add(createMenuItem(_I("menuEditSelectAll"), KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_A, scMask), new EditAction(EditAction.SELECT_ALL)));<NEW_LINE>_editMenu.addSeparator();<NEW_LINE>JMenu findMenu = new JMenu(_I("menuFind"));<NEW_LINE>_findHelper = new FindAction();<NEW_LINE>findMenu.setMnemonic(KeyEvent.VK_F);<NEW_LINE>findMenu.add(createMenuItem(_I("menuFindFind"), KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F, scMask), new FindAction(FindAction.FIND)));<NEW_LINE>findMenu.add(createMenuItem(_I("menuFindFindNext"), KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_G, scMask), new <MASK><NEW_LINE>findMenu.add(createMenuItem(_I("menuFindFindPrev"), KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_G, scMask | InputEvent.SHIFT_MASK), new FindAction(FindAction.FIND_PREV)));<NEW_LINE>_editMenu.add(findMenu);<NEW_LINE>_editMenu.addSeparator();<NEW_LINE>_editMenu.add(createMenuItem(_I("menuEditIndent"), KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_TAB, 0), new EditAction(EditAction.INDENT)));<NEW_LINE>_editMenu.add(createMenuItem(_I("menuEditUnIndent"), KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_TAB, InputEvent.SHIFT_MASK), new EditAction(EditAction.UNINDENT)));<NEW_LINE>} | FindAction(FindAction.FIND_NEXT))); |
1,625,147 | static WebServer startServer() {<NEW_LINE>// load logging configuration<NEW_LINE>LogConfig.configureRuntime();<NEW_LINE>// By default this will pick up application.yaml from the classpath<NEW_LINE>Config config = Config.create();<NEW_LINE><MASK><NEW_LINE>WebServer server = WebServer.builder(createRouting(sendingService)).config(config.get("server")).build();<NEW_LINE>server.start().thenAccept(ws -> {<NEW_LINE>System.out.println("WEB server is up! http://localhost:" + ws.port());<NEW_LINE>ws.whenShutdown().thenRun(() -> {<NEW_LINE>// Stop messaging properly<NEW_LINE>sendingService.shutdown();<NEW_LINE>System.out.println("WEB server is DOWN. Good bye!");<NEW_LINE>});<NEW_LINE>}).exceptionally(t -> {<NEW_LINE>System.err.println("Startup failed: " + t.getMessage());<NEW_LINE>t.printStackTrace(System.err);<NEW_LINE>return null;<NEW_LINE>});<NEW_LINE>// Server threads are not daemon. No need to block. Just react.<NEW_LINE>return server;<NEW_LINE>} | SendingService sendingService = new SendingService(config); |
822,747 | public Orderer addOrderer(SDOrdererAdditionInfo sdOrdererAdditionInfo) throws InvalidArgumentException, ServiceDiscoveryException {<NEW_LINE>Properties properties = sdOrdererAdditionInfo.getProperties();<NEW_LINE>final String endpoint = sdOrdererAdditionInfo.getEndpoint();<NEW_LINE>final String mspid = sdOrdererAdditionInfo.getMspId();<NEW_LINE>String protocol = (String) findClientProp(config, "protocol", mspid, endpoint, sdOrdererAdditionInfo.isTLS() ? "grpcs:" : "grpc:");<NEW_LINE>String clientCertFile = (String) findClientProp(config, "clientCertFile", mspid, endpoint, null);<NEW_LINE>if (null != clientCertFile) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>String clientKeyFile = (String) findClientProp(config, "clientKeyFile", mspid, endpoint, null);<NEW_LINE>if (null != clientKeyFile) {<NEW_LINE>properties.put("clientKeyFile", clientKeyFile);<NEW_LINE>}<NEW_LINE>byte[] clientCertBytes = (byte[]) findClientProp(config, "clientCertBytes", mspid, endpoint, null);<NEW_LINE>if (null != clientCertBytes) {<NEW_LINE>properties.put("clientCertBytes", clientCertBytes);<NEW_LINE>}<NEW_LINE>byte[] clientKeyBytes = (byte[]) findClientProp(config, "clientKeyBytes", mspid, endpoint, null);<NEW_LINE>if (null != clientKeyBytes) {<NEW_LINE>properties.put("clientKeyBytes", clientKeyBytes);<NEW_LINE>}<NEW_LINE>String hostnameOverride = (String) findClientProp(config, "hostnameOverride", mspid, endpoint, null);<NEW_LINE>if (null != hostnameOverride) {<NEW_LINE>properties.put("hostnameOverride", hostnameOverride);<NEW_LINE>}<NEW_LINE>byte[] pemBytes = sdOrdererAdditionInfo.getAllTLSCerts();<NEW_LINE>if (pemBytes.length > 0) {<NEW_LINE>properties.put("pemBytes", pemBytes);<NEW_LINE>}<NEW_LINE>properties.put(Orderer.ORDERER_ORGANIZATION_MSPID_PROPERTY, sdOrdererAdditionInfo.getMspId());<NEW_LINE>Orderer orderer = sdOrdererAdditionInfo.getClient().newOrderer(endpoint, protocol + "//" + endpoint, properties);<NEW_LINE>sdOrdererAdditionInfo.getChannel().addOrderer(orderer);<NEW_LINE>return orderer;<NEW_LINE>} | properties.put("clientCertFile", clientCertFile); |
548,111 | public void paint(IFigure figure, Graphics g, Insets insets) {<NEW_LINE>ButtonModel model = ((Clickable) figure).getModel();<NEW_LINE>Rectangle r = getPaintRectangle(figure, insets);<NEW_LINE>g.setLineWidth(1);<NEW_LINE>r.width -= 3;<NEW_LINE>r.height -= 3;<NEW_LINE>if (model.isMouseOver() && !model.isArmed()) {<NEW_LINE>g.setForegroundColor(highlight);<NEW_LINE>g.drawRectangle(r);<NEW_LINE>r.translate(1, 1);<NEW_LINE>g.setForegroundColor(dropshadow2);<NEW_LINE>g.drawLine(r.x, r.bottom(), r.right(), r.bottom());<NEW_LINE>g.drawLine(r.right(), r.y, r.right(<MASK><NEW_LINE>r.translate(1, 1);<NEW_LINE>g.setForegroundColor(dropshadow3);<NEW_LINE>g.drawLine(r.x + 1, r.bottom(), r.right() - 1, r.bottom());<NEW_LINE>g.drawLine(r.right(), r.y + 1, r.right(), r.bottom() - 1);<NEW_LINE>} else if (model.isPressed()) {<NEW_LINE>r.translate(1, 1);<NEW_LINE>g.setForegroundColor(highlight);<NEW_LINE>g.drawRectangle(r);<NEW_LINE>r.translate(1, 1);<NEW_LINE>g.setForegroundColor(dropshadow2);<NEW_LINE>g.drawLine(r.x, r.bottom(), r.right(), r.bottom());<NEW_LINE>g.drawLine(r.right(), r.y, r.right(), r.bottom());<NEW_LINE>} else {<NEW_LINE>r.translate(1, 1);<NEW_LINE>g.setForegroundColor(dropshadow3);<NEW_LINE>g.drawRectangle(r);<NEW_LINE>r.translate(1, 1);<NEW_LINE>g.drawLine(r.x, r.bottom(), r.right(), r.bottom());<NEW_LINE>g.drawLine(r.right(), r.y, r.right(), r.bottom());<NEW_LINE>}<NEW_LINE>} | ), r.bottom()); |
1,405,556 | public void updateTask() {<NEW_LINE>final EntityLivingBase attackTargetNN = attackTarget;<NEW_LINE>if (attackTargetNN == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final double distToTargetSq = entityHost.getDistanceSq(attackTarget.posX, attackTargetNN.getEntityBoundingBox().minY, attackTarget.posZ);<NEW_LINE>final boolean canSee = entityHost.getEntitySenses().canSee(attackTargetNN);<NEW_LINE>if (canSee) {<NEW_LINE>++timeTargetVisible;<NEW_LINE>} else {<NEW_LINE>timeTargetVisible = 0;<NEW_LINE>}<NEW_LINE>if (distToTargetSq <= attackRangeSq && timeTargetVisible >= 20) {<NEW_LINE>entityHost<MASK><NEW_LINE>} else if (timeTargetHidden < 100) {<NEW_LINE>entityHost.getNavigator().tryMoveToEntityLiving(attackTargetNN, entityMoveSpeed);<NEW_LINE>}<NEW_LINE>entityHost.getLookHelper().setLookPositionWithEntity(attackTargetNN, 30.0F, 30.0F);<NEW_LINE>if (--timeUntilNextAttack <= 0) {<NEW_LINE>if (distToTargetSq > attackRangeSq || !canSee) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final float rangeRatio = MathHelper.clamp(MathHelper.sqrt(distToTargetSq) / attackRange, 0.1f, 1f);<NEW_LINE>rangedAttackEntityHost.attackEntityWithRangedAttack(attackTargetNN, rangeRatio);<NEW_LINE>timeUntilNextAttack = MathHelper.floor(rangeRatio * (maxRangedAttackTime - minRangedAttackTime) + minRangedAttackTime);<NEW_LINE>}<NEW_LINE>} | .getNavigator().clearPath(); |
27,440 | public List<DataType> calculateOutputDataTypes(List<DataType> dataTypes) {<NEW_LINE>Preconditions.checkState(dataTypes != null && (dataTypes.size() == 3 || dataTypes.size() <MASK><NEW_LINE>DataType first = dataTypes.get(0);<NEW_LINE>for (int i = 0; i < dataTypes.size(); i++) {<NEW_LINE>Preconditions.checkState(dataTypes.get(i).isFPType(), "Input %s datatype must be a floating point type, got datypes %s", dataTypes);<NEW_LINE>if (i > 0) {<NEW_LINE>Preconditions.checkState(first == dataTypes.get(i), "All datatypes must be same type, got input datatypes %s", dataTypes);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (withWeights) {<NEW_LINE>return Arrays.asList(first, first);<NEW_LINE>} else {<NEW_LINE>return Collections.singletonList(first);<NEW_LINE>}<NEW_LINE>} | == 4), "Expected exactly 3 or 4 input datatypes, got %s", dataTypes); |
265,324 | static void visitMapping(Map<String, ?> mapping, Consumer<Map<String, ?>> fieldMappingConsumer) {<NEW_LINE>Object <MASK><NEW_LINE>if (properties != null && properties instanceof Map) {<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>Map<String, ?> propertiesAsMap = (Map<String, ?>) properties;<NEW_LINE>for (Object v : propertiesAsMap.values()) {<NEW_LINE>if (v != null && v instanceof Map) {<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>Map<String, ?> fieldMapping = (Map<String, ?>) v;<NEW_LINE>fieldMappingConsumer.accept(fieldMapping);<NEW_LINE>visitMapping(fieldMapping, fieldMappingConsumer);<NEW_LINE>// Multi fields<NEW_LINE>Object fieldsO = fieldMapping.get("fields");<NEW_LINE>if (fieldsO != null && fieldsO instanceof Map) {<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>Map<String, ?> fields = (Map<String, ?>) fieldsO;<NEW_LINE>for (Object v2 : fields.values()) {<NEW_LINE>if (v2 instanceof Map) {<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>Map<String, ?> fieldMapping2 = (Map<String, ?>) v2;<NEW_LINE>fieldMappingConsumer.accept(fieldMapping2);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | properties = mapping.get("properties"); |
1,627,406 | public Future<MultiGetSortKeysResult> asyncMultiGetSortKeys(byte[] hashKey, int maxFetchCount, int maxFetchSize, int timeout) {<NEW_LINE>final DefaultPromise<MultiGetSortKeysResult> promise = table.newPromise();<NEW_LINE>asyncMultiGet(hashKey, null, maxFetchCount, maxFetchSize, true, timeout).addListener(new MultiGetListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void operationComplete(Future<MultiGetResult> future) throws Exception {<NEW_LINE>if (future.isSuccess()) {<NEW_LINE>MultiGetResult result = future.getNow();<NEW_LINE>MultiGetSortKeysResult sortkeyResult = new MultiGetSortKeysResult();<NEW_LINE>sortkeyResult.allFetched = result.allFetched;<NEW_LINE>sortkeyResult.keys = new ArrayList<byte[]>(result.values.size());<NEW_LINE>for (Pair<byte[], byte[]> kv : result.values) {<NEW_LINE>sortkeyResult.keys.<MASK><NEW_LINE>}<NEW_LINE>promise.setSuccess(sortkeyResult);<NEW_LINE>} else {<NEW_LINE>promise.setFailure(future.cause());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return promise;<NEW_LINE>} | add(kv.getLeft()); |
397,282 | public int read(byte[] buf, int off, int len) throws IOException {<NEW_LINE>if (log.isLoggable(Level.FINER))<NEW_LINE>log.finer("Read into " + buf + " " + hex(off) + " " + hex(len));<NEW_LINE>int n;<NEW_LINE>if (isMvsDataset) {<NEW_LINE>if (off == 0) {<NEW_LINE>n = Clib.fread(buf, 1, len, fp);<NEW_LINE>} else {<NEW_LINE>byte[] buf2 = new byte[len];<NEW_LINE>n = Clib.fread(buf2, 1, len, fp);<NEW_LINE>if (n > 0) {<NEW_LINE>System.arraycopy(buf2, 0, buf, off, n);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>n = raf.read(buf, off, len);<NEW_LINE>}<NEW_LINE>if (n > 0)<NEW_LINE>streamPos += n;<NEW_LINE>if (log.isLoggable(Level.FINER))<NEW_LINE>log.finer("read 0x" <MASK><NEW_LINE>return n;<NEW_LINE>} | + hex(n) + " bytes"); |
942,837 | private KeyManagerFactory createAndInitKeyManagerFactory() throws Exception {<NEW_LINE>X509Certificate certHolder = readCertFile(cert);<NEW_LINE>Object keyObject = readPrivateKeyFile(privateKey);<NEW_LINE>char[] passwordCharArray = "".toCharArray();<NEW_LINE>if (!StringUtils.isEmpty(password)) {<NEW_LINE>passwordCharArray = password.toCharArray();<NEW_LINE>}<NEW_LINE>JcaPEMKeyConverter keyConverter = new JcaPEMKeyConverter().setProvider("BC");<NEW_LINE>PrivateKey privateKey;<NEW_LINE>if (keyObject instanceof PEMEncryptedKeyPair) {<NEW_LINE>PEMDecryptorProvider provider = new JcePEMDecryptorProviderBuilder().build(passwordCharArray);<NEW_LINE>KeyPair key = keyConverter.getKeyPair(((PEMEncryptedKeyPair) keyObject).decryptKeyPair(provider));<NEW_LINE>privateKey = key.getPrivate();<NEW_LINE>} else if (keyObject instanceof PEMKeyPair) {<NEW_LINE>KeyPair key = keyConverter.getKeyPair((PEMKeyPair) keyObject);<NEW_LINE>privateKey = key.getPrivate();<NEW_LINE>} else if (keyObject instanceof PrivateKey) {<NEW_LINE>privateKey = (PrivateKey) keyObject;<NEW_LINE>} else {<NEW_LINE>throw new RuntimeException(<MASK><NEW_LINE>}<NEW_LINE>KeyStore clientKeyStore = KeyStore.getInstance(KeyStore.getDefaultType());<NEW_LINE>clientKeyStore.load(null, null);<NEW_LINE>clientKeyStore.setCertificateEntry("cert", certHolder);<NEW_LINE>clientKeyStore.setKeyEntry("private-key", privateKey, passwordCharArray, new Certificate[] { certHolder });<NEW_LINE>KeyManagerFactory keyManagerFactory = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());<NEW_LINE>keyManagerFactory.init(clientKeyStore, passwordCharArray);<NEW_LINE>return keyManagerFactory;<NEW_LINE>} | "Unable to get private key from object: " + keyObject.getClass()); |
83,715 | Executable detectBeanInstanceExecutable(BeanDefinition beanDefinition) {<NEW_LINE>Supplier<ResolvableType> beanType <MASK><NEW_LINE>List<ResolvableType> valueTypes = beanDefinition.hasConstructorArgumentValues() ? determineParameterValueTypes(beanDefinition.getConstructorArgumentValues()) : Collections.emptyList();<NEW_LINE>Method resolvedFactoryMethod = resolveFactoryMethod(beanDefinition, valueTypes);<NEW_LINE>if (resolvedFactoryMethod != null) {<NEW_LINE>return resolvedFactoryMethod;<NEW_LINE>}<NEW_LINE>Class<?> factoryBeanClass = getFactoryBeanClass(beanDefinition);<NEW_LINE>if (factoryBeanClass != null && !factoryBeanClass.equals(beanDefinition.getResolvableType().toClass())) {<NEW_LINE>ResolvableType resolvableType = beanDefinition.getResolvableType();<NEW_LINE>boolean isCompatible = ResolvableType.forClass(factoryBeanClass).as(FactoryBean.class).getGeneric(0).isAssignableFrom(resolvableType);<NEW_LINE>if (isCompatible) {<NEW_LINE>return resolveConstructor(() -> ResolvableType.forClass(factoryBeanClass), valueTypes);<NEW_LINE>} else {<NEW_LINE>throw new IllegalStateException(String.format("Incompatible target type '%s' for factory bean '%s'", resolvableType.toClass().getName(), factoryBeanClass.getName()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Executable resolvedConstructor = resolveConstructor(beanType, valueTypes);<NEW_LINE>if (resolvedConstructor != null) {<NEW_LINE>return resolvedConstructor;<NEW_LINE>}<NEW_LINE>Executable resolvedConstructorOrFactoryMethod = getField(beanDefinition, "resolvedConstructorOrFactoryMethod", Executable.class);<NEW_LINE>if (resolvedConstructorOrFactoryMethod != null) {<NEW_LINE>logger.error("resolvedConstructorOrFactoryMethod required for " + beanDefinition);<NEW_LINE>return resolvedConstructorOrFactoryMethod;<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | = () -> getBeanType(beanDefinition); |
1,749,973 | private void togglePredefinedLocation(@SuppressWarnings("unused") ObservableValue<? extends Toggle> observable, @SuppressWarnings("unused") Toggle oldValue, Toggle newValue) {<NEW_LINE>if (iclouddriveRadioButton.equals(newValue)) {<NEW_LINE>vaultPath.set(locationPresets.getIclouddriveLocation().resolve(vaultName.get()));<NEW_LINE>} else if (dropboxRadioButton.equals(newValue)) {<NEW_LINE>vaultPath.set(locationPresets.getDropboxLocation().resolve(vaultName.get()));<NEW_LINE>} else if (gdriveRadioButton.equals(newValue)) {<NEW_LINE>vaultPath.set(locationPresets.getGdriveLocation().resolve(vaultName.get()));<NEW_LINE>} else if (onedriveRadioButton.equals(newValue)) {<NEW_LINE>vaultPath.set(locationPresets.getOnedriveLocation().resolve(vaultName.get()));<NEW_LINE>} else if (megaRadioButton.equals(newValue)) {<NEW_LINE>vaultPath.set(locationPresets.getMegaLocation().resolve(vaultName.get()));<NEW_LINE>} else if (pcloudRadioButton.equals(newValue)) {<NEW_LINE>vaultPath.set(locationPresets.getPcloudLocation().resolve<MASK><NEW_LINE>} else if (customRadioButton.equals(newValue)) {<NEW_LINE>vaultPath.set(customVaultPath.resolve(vaultName.get()));<NEW_LINE>}<NEW_LINE>} | (vaultName.get())); |
885,370 | public final void update(EventBean[] newData, EventBean[] oldData) {<NEW_LINE>agentInstanceContext.getAuditProvider().view(newData, oldData, agentInstanceContext, lengthFirstFactory);<NEW_LINE>agentInstanceContext.getInstrumentationProvider().qViewProcessIRStream(lengthFirstFactory, newData, oldData);<NEW_LINE>OneEventCollection newDataToPost = null;<NEW_LINE>OneEventCollection oldDataToPost = null;<NEW_LINE>// add data points to the window as long as its not full, ignoring later events<NEW_LINE>if (newData != null) {<NEW_LINE>for (EventBean aNewData : newData) {<NEW_LINE>if (indexedEvents.size() < size) {<NEW_LINE>if (newDataToPost == null) {<NEW_LINE>newDataToPost = new OneEventCollection();<NEW_LINE>}<NEW_LINE>newDataToPost.add(aNewData);<NEW_LINE>indexedEvents.add(aNewData);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (oldData != null) {<NEW_LINE>for (EventBean anOldData : oldData) {<NEW_LINE>boolean removed = indexedEvents.remove(anOldData);<NEW_LINE>if (removed) {<NEW_LINE>if (oldDataToPost == null) {<NEW_LINE>oldDataToPost = new OneEventCollection();<NEW_LINE>}<NEW_LINE>oldDataToPost.add(anOldData);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// If there are child views, call update method<NEW_LINE>if ((child != null) && ((newDataToPost != null) || (oldDataToPost != null))) {<NEW_LINE>EventBean[] nd = (newDataToPost != null) ? newDataToPost.toArray() : null;<NEW_LINE>EventBean[] od = (oldDataToPost != null) <MASK><NEW_LINE>agentInstanceContext.getInstrumentationProvider().qViewIndicate(lengthFirstFactory, nd, od);<NEW_LINE>child.update(nd, od);<NEW_LINE>agentInstanceContext.getInstrumentationProvider().aViewIndicate();<NEW_LINE>}<NEW_LINE>agentInstanceContext.getInstrumentationProvider().aViewProcessIRStream();<NEW_LINE>} | ? oldDataToPost.toArray() : null; |
435,370 | public void visitVariableExpression(final VariableExpression expression) {<NEW_LINE>final String variableName = expression.getName();<NEW_LINE>if (expression.isThisExpression()) {<NEW_LINE>// "this" in static context is Class instance<NEW_LINE>if (controller.isStaticMethod() || controller.getCompileStack().isInSpecialConstructorCall() || (!controller.getCompileStack().isImplicitThis() && controller.isStaticContext())) {<NEW_LINE>classX(controller.getThisType()).visit(this);<NEW_LINE>} else {<NEW_LINE>loadThis(expression);<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (expression.isSuperExpression()) {<NEW_LINE>// "super" in static context is Class instance<NEW_LINE>if (controller.isStaticMethod()) {<NEW_LINE>ClassNode superType = controller.getClassNode().getSuperClass();<NEW_LINE>classX(superType).visit(this);<NEW_LINE>} else {<NEW_LINE>loadThis(expression);<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>BytecodeVariable variable = controller.getCompileStack().getVariable(variableName, false);<NEW_LINE>if (variable != null) {<NEW_LINE>controller.getOperandStack().loadOrStoreVariable(variable, expression.isUseReferenceDirectly());<NEW_LINE>} else if (passingParams && controller.isInScriptBody()) {<NEW_LINE>MethodVisitor mv = controller.getMethodVisitor();<NEW_LINE><MASK><NEW_LINE>mv.visitInsn(DUP);<NEW_LINE>loadThisOrOwner();<NEW_LINE>mv.visitLdcInsn(variableName);<NEW_LINE>mv.visitMethodInsn(INVOKESPECIAL, "org/codehaus/groovy/runtime/ScriptReference", "<init>", "(Lgroovy/lang/Script;Ljava/lang/String;)V", false);<NEW_LINE>} else {<NEW_LINE>PropertyExpression pexp = thisPropX(true, variableName);<NEW_LINE>pexp.getObjectExpression().setSourcePosition(expression);<NEW_LINE>pexp.getProperty().setSourcePosition(expression);<NEW_LINE>pexp.copyNodeMetaData(expression);<NEW_LINE>pexp.visit(this);<NEW_LINE>}<NEW_LINE>if (!controller.getCompileStack().isLHS()) {<NEW_LINE>controller.getAssertionWriter().record(expression);<NEW_LINE>}<NEW_LINE>} | mv.visitTypeInsn(NEW, "org/codehaus/groovy/runtime/ScriptReference"); |
1,778,780 | public void drawObjects(PlatformImage output) {<NEW_LINE>output.create(image.getWidth(), image.getHeight());<NEW_LINE>ImageUtils.log("Columns:", columns.size());<NEW_LINE>ImageUtils.log("Lines:", lines.size());<NEW_LINE>ImageUtils.log("Words:", words.size());<NEW_LINE>for (int y = 0; y < image.getHeight(); y++) {<NEW_LINE>for (int x = 0; x < image.getWidth(); x++) {<NEW_LINE>output.setPixel(x, y, image.getPixel(x, y));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (isDrawColums) {<NEW_LINE>for (Column col : columns) {<NEW_LINE>ImageUtils.drawRect(output, col.x1, col.y1, col.x2, col.y2, PlatformImage.GREEN);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (isDrawLines) {<NEW_LINE>for (Line l : lines) {<NEW_LINE>ImageUtils.drawRect(output, l.x1, l.y1, l.x2, <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (Word w : words) {<NEW_LINE>if (isDrawChars) {<NEW_LINE>ImageUtils.drawRect(output, w.x1, w.y1, w.x2, w.y2, PlatformImage.BLUE);<NEW_LINE>}<NEW_LINE>int dy = w.y1;<NEW_LINE>ImageUtils.drawRect(output, w.x1 - w.offsetLeft, dy, w.x1, dy + 2, PlatformImage.YELLOW);<NEW_LINE>}<NEW_LINE>for (Word w : wordsLong) {<NEW_LINE>ImageUtils.drawRect(output, w.x1, w.y1, w.x2, w.y2, PlatformImage.MAROON);<NEW_LINE>}<NEW_LINE>} | l.y2, PlatformImage.RED); |
1,433,282 | public HtmlResponse login(final LoginForm form) {<NEW_LINE>validate(form, messages -> {<NEW_LINE>}, () -> asIndexPage(form));<NEW_LINE>verifyToken(() -> asIndexPage(form));<NEW_LINE>final String username = form.username;<NEW_LINE>final String password = form.password;<NEW_LINE>form.clearSecurityInfo();<NEW_LINE>try {<NEW_LINE>final HtmlResponse loginRedirect = fessLoginAssist.loginRedirect(new LocalUserCredential(username, password), op -> {<NEW_LINE>}, () -> {<NEW_LINE>activityHelper.login(getUserBean());<NEW_LINE>userInfoHelper.deleteUserCodeFromCookie(request);<NEW_LINE>return getHtmlResponse();<NEW_LINE>});<NEW_LINE>if (ComponentUtil.getFessConfig().isValidAdminPassword(password)) {<NEW_LINE>return loginRedirect;<NEW_LINE>}<NEW_LINE>getSession().ifPresent(session -> session.setAttribute(INVALID_OLD_PASSWORD, password));<NEW_LINE>return asHtml(virtualHost(path_Login_NewpasswordJsp));<NEW_LINE>} catch (final LoginFailureException lfe) {<NEW_LINE>activityHelper.loginFailure(OptionalThing.of(new <MASK><NEW_LINE>throwValidationError(messages -> messages.addErrorsLoginError(GLOBAL), () -> asIndexPage(form));<NEW_LINE>}<NEW_LINE>return redirect(getClass());<NEW_LINE>} | LocalUserCredential(username, password))); |
1,090,797 | public void generate(NodeLIRBuilderTool gen) {<NEW_LINE>final LIRGeneratorTool tool = gen.getLIRGeneratorTool();<NEW_LINE>Logger.traceBuildLIR(Logger.BACKEND.PTX, "emitVectorValue: values=%s", values);<NEW_LINE>if (origin instanceof InvokeNode) {<NEW_LINE>gen.setResult(this, gen.operand(origin));<NEW_LINE>} else if (origin instanceof ValuePhiNode) {<NEW_LINE>final ValuePhiNode phi = (ValuePhiNode) origin;<NEW_LINE>final Value phiOperand = ((PTXNodeLIRBuilder) gen).operandForPhi(phi);<NEW_LINE>final AllocatableValue result = (gen.hasOperand(this)) ? (Variable) gen.operand(this) : tool.newVariable(LIRKind.value(getPTXKind()));<NEW_LINE>tool.append(new PTXLIRStmt.AssignStmt(result, phiOperand));<NEW_LINE>gen.setResult(this, result);<NEW_LINE>} else if (origin instanceof ParameterNode) {<NEW_LINE>gen.setResult(this, gen.operand(origin));<NEW_LINE>} else if (origin == null) {<NEW_LINE>final AllocatableValue result = tool.newVariable(LIRKind.value(getPTXKind()));<NEW_LINE>final <MASK><NEW_LINE>final ValueNode firstValue = values.first();<NEW_LINE>if (firstValue instanceof VectorValueNode || firstValue instanceof VectorOp) {<NEW_LINE>tool.append(new PTXLIRStmt.AssignStmt(result, gen.operand(values.first())));<NEW_LINE>gen.setResult(this, result);<NEW_LINE>} else if (numValues > 0 && gen.hasOperand(firstValue)) {<NEW_LINE>generateVectorAssign(gen, tool, result);<NEW_LINE>} else {<NEW_LINE>gen.setResult(this, result);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | int numValues = values.count(); |
298,060 | public void paint(Graphics g) {<NEW_LINE>super.paint(g);<NEW_LINE>Graphics2D g2d = (Graphics2D) g;<NEW_LINE>g2d.setColor(GuiBase.getTextColor());<NEW_LINE>centerX = (int) (getWidth() / 2);<NEW_LINE>centerY = (int) (getHeight() / 2);<NEW_LINE>// paints a coordinate system and draws a circle<NEW_LINE>// around the zero point<NEW_LINE>g2d.drawOval(centerX - RADIUS, centerY - RADIUS, <MASK><NEW_LINE>g2d.drawLine(centerX - (int) (1.5 * RADIUS), centerY, centerX + (int) (1.5 * RADIUS), centerY);<NEW_LINE>g2d.drawLine(centerX, centerY - (int) (1.5 * RADIUS), centerX, centerY + (int) (1.5 * RADIUS));<NEW_LINE>// paints every angle on the circular track<NEW_LINE>if (angles != null) {<NEW_LINE>int i = 0;<NEW_LINE>for (; i < selectedAngleIndex; i++) {<NEW_LINE>drawAngle(g2d, i);<NEW_LINE>}<NEW_LINE>i++;<NEW_LINE>for (; i < angles.length; i++) {<NEW_LINE>drawAngle(g2d, i);<NEW_LINE>}<NEW_LINE>// Selected angle has to be drawn last:<NEW_LINE>g2d.setColor(Color.RED);<NEW_LINE>drawAngle(g2d, selectedAngleIndex);<NEW_LINE>}<NEW_LINE>} | 2 * RADIUS, 2 * RADIUS); |
39,221 | public soot.Value eval(Body b) {<NEW_LINE>ConstructorDecl c = decl().erasedConstructor();<NEW_LINE>// this<NEW_LINE>Local base = b.emitThis(hostType());<NEW_LINE>int index = 0;<NEW_LINE>ArrayList list = new ArrayList();<NEW_LINE>if (c.needsEnclosing()) {<NEW_LINE>if (hasPrevExpr() && !prevExpr().isTypeAccess()) {<NEW_LINE>list.add(asImmediate(b, prevExpr().eval(b)));<NEW_LINE>} else {<NEW_LINE>if (hostType().needsSuperEnclosing()) {<NEW_LINE>soot.Type type = ((ClassDecl) hostType()).superclass().enclosingType().getSootType();<NEW_LINE>if (hostType().needsEnclosing())<NEW_LINE>list.add(asImmediate(b, b.newParameterRef(type, 1, this)));<NEW_LINE>else<NEW_LINE>list.add(asImmediate(b, b.newParameterRef(<MASK><NEW_LINE>} else {<NEW_LINE>list.add(emitThis(b, superConstructorQualifier(c.hostType().enclosingType())));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// args<NEW_LINE>for (int i = 0; i < getNumArg(); i++) list.add(// MethodInvocationConversion<NEW_LINE>asImmediate(// MethodInvocationConversion<NEW_LINE>b, getArg(i).type().emitCastTo(b, getArg(i), c.getParameter(i).type())));<NEW_LINE>if (decl().isPrivate() && decl().hostType() != hostType()) {<NEW_LINE>list.add(asImmediate(b, soot.jimple.NullConstant.v()));<NEW_LINE>b.add(b.newInvokeStmt(b.newSpecialInvokeExpr(base, decl().erasedConstructor().createAccessor().sootRef(), list, this), this));<NEW_LINE>return base;<NEW_LINE>} else {<NEW_LINE>return b.newSpecialInvokeExpr(base, c.sootRef(), list, this);<NEW_LINE>}<NEW_LINE>} | type, 0, this))); |
763,221 | private byte[] transformImpl(ClassLoader loader, String className, byte[] classfileBuffer) {<NEW_LINE>if (durationProfilingFilter.isEmpty() && argumentFilterProfilingFilter.isEmpty()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>String normalizedClassName = className.replaceAll("/", ".");<NEW_LINE>LOGGER.debug("Checking class for transform: " + normalizedClassName);<NEW_LINE>if (!durationProfilingFilter.matchClass(normalizedClassName) && !argumentFilterProfilingFilter.matchClass(normalizedClassName)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>byte[] byteCode;<NEW_LINE>LOGGER.info("Transforming class: " + normalizedClassName);<NEW_LINE>try {<NEW_LINE>ClassPool classPool = new ClassPool();<NEW_LINE>classPool.appendClassPath(new LoaderClassPath(loader));<NEW_LINE>final CtClass ctClass;<NEW_LINE>try (ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(classfileBuffer)) {<NEW_LINE>ctClass = classPool.makeClass(byteArrayInputStream);<NEW_LINE>}<NEW_LINE>CtMethod[] ctMethods = ctClass.getDeclaredMethods();<NEW_LINE>for (CtMethod ctMethod : ctMethods) {<NEW_LINE>boolean enableDurationProfiling = durationProfilingFilter.matchMethod(ctClass.getName(), ctMethod.getName());<NEW_LINE>List<Integer> enableArgumentProfiler = argumentFilterProfilingFilter.matchMethod(ctClass.getName(), ctMethod.getName());<NEW_LINE>transformMethod(<MASK><NEW_LINE>}<NEW_LINE>byteCode = ctClass.toBytecode();<NEW_LINE>ctClass.detach();<NEW_LINE>} catch (Throwable ex) {<NEW_LINE>ex.printStackTrace();<NEW_LINE>LOGGER.warn("Failed to transform class: " + normalizedClassName, ex);<NEW_LINE>byteCode = null;<NEW_LINE>}<NEW_LINE>return byteCode;<NEW_LINE>} | normalizedClassName, ctMethod, enableDurationProfiling, enableArgumentProfiler); |
229,013 | public void launchMpjwt20TCKLauncher_aud_noenv() throws Exception {<NEW_LINE>String port = String.valueOf(server.getBvtPort());<NEW_LINE>String bucketAndTestName = this.getClass().getCanonicalName();<NEW_LINE>Map<String, String> additionalProps = new HashMap<>();<NEW_LINE>// need to pass the correct url for PublicKeyAsPEMLocationURLTest<NEW_LINE>additionalProps.put("mp.jwt.tck.jwks.baseURL", "http://localhost:" + port + "/PublicKeyAsPEMLocationURLTest/");<NEW_LINE>MvnUtils.runTCKMvnCmd(server, bucketAndTestName, bucketAndTestName, "tck_suite_aud_noenv.xml", additionalProps, Collections.emptySet());<NEW_LINE>Map<String, String> <MASK><NEW_LINE>resultInfo.put("results_type", "MicroProfile");<NEW_LINE>resultInfo.put("feature_name", "JWT Auth");<NEW_LINE>resultInfo.put("feature_version", "2.0");<NEW_LINE>MvnUtils.preparePublicationFile(resultInfo);<NEW_LINE>} | resultInfo = MvnUtils.getResultInfo(server); |
1,357,452 | private RectNode findPositionForNewNodeContactPoint(int width, int height, int rotatedWidth, int rotatedHeight, boolean rotate) {<NEW_LINE>RectNode bestNode = new RectNode();<NEW_LINE>bestNode.rect = new Rect(null, 0, 0, 0, 0, 0);<NEW_LINE>// best contact score<NEW_LINE>bestNode.score1 = -1;<NEW_LINE>for (int i = 0; i < freeRectangles.size(); i++) {<NEW_LINE>// Try to place the rectangle in upright (non-rotated) orientation.<NEW_LINE>RectNode currentNode = freeRectangles.get(i);<NEW_LINE>if (currentNode.rect.width >= width && currentNode.rect.height >= height) {<NEW_LINE>int score = contactPointScoreNode(currentNode.rect.x, currentNode.rect.y, width, height);<NEW_LINE>if (score > bestNode.score1) {<NEW_LINE>bestNode.rect = new Rect(currentNode.rect.id, currentNode.rect.index, currentNode.rect.x, currentNode.rect.y, width, height);<NEW_LINE>bestNode.score1 = score;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (rotate && currentNode.rect.width >= rotatedWidth && currentNode.rect.height >= rotatedHeight) {<NEW_LINE>// This was width,height -- bug fixed?<NEW_LINE>int score = contactPointScoreNode(currentNode.rect.x, currentNode.<MASK><NEW_LINE>if (score > bestNode.score1) {<NEW_LINE>bestNode.rect = new Rect(currentNode.rect.id, currentNode.rect.index, currentNode.rect.x, currentNode.rect.y, rotatedWidth, rotatedHeight);<NEW_LINE>bestNode.score1 = score;<NEW_LINE>bestNode.rect.rotated = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return bestNode;<NEW_LINE>} | rect.y, rotatedWidth, rotatedHeight); |
645,682 | protected void convertElementToJson(ObjectNode propertiesNode, BaseElement baseElement) {<NEW_LINE>ServiceTask serviceTask = (ServiceTask) baseElement;<NEW_LINE>if ("mail".equalsIgnoreCase(serviceTask.getType())) {<NEW_LINE>setPropertyFieldValue(PROPERTY_MAILTASK_TO, serviceTask, propertiesNode);<NEW_LINE>setPropertyFieldValue(PROPERTY_MAILTASK_FROM, serviceTask, propertiesNode);<NEW_LINE>setPropertyFieldValue(PROPERTY_MAILTASK_SUBJECT, serviceTask, propertiesNode);<NEW_LINE>setPropertyFieldValue(PROPERTY_MAILTASK_CC, serviceTask, propertiesNode);<NEW_LINE>setPropertyFieldValue(PROPERTY_MAILTASK_BCC, serviceTask, propertiesNode);<NEW_LINE>setPropertyFieldValue(PROPERTY_MAILTASK_TEXT, serviceTask, propertiesNode);<NEW_LINE>setPropertyFieldValue(PROPERTY_MAILTASK_HTML, serviceTask, propertiesNode);<NEW_LINE>setPropertyFieldValue(PROPERTY_MAILTASK_CHARSET, serviceTask, propertiesNode);<NEW_LINE>} else if ("camel".equalsIgnoreCase(serviceTask.getType())) {<NEW_LINE>setPropertyFieldValue(PROPERTY_CAMELTASK_CAMELCONTEXT, "camelContext", serviceTask, propertiesNode);<NEW_LINE>} else if ("mule".equalsIgnoreCase(serviceTask.getType())) {<NEW_LINE>setPropertyFieldValue(PROPERTY_MULETASK_ENDPOINT_URL, "endpointUrl", serviceTask, propertiesNode);<NEW_LINE>setPropertyFieldValue(PROPERTY_MULETASK_LANGUAGE, "language", serviceTask, propertiesNode);<NEW_LINE>setPropertyFieldValue(PROPERTY_MULETASK_PAYLOAD_EXPRESSION, "payloadExpression", serviceTask, propertiesNode);<NEW_LINE>setPropertyFieldValue(PROPERTY_MULETASK_RESULT_VARIABLE, "resultVariable", serviceTask, propertiesNode);<NEW_LINE>} else if ("dmn".equalsIgnoreCase(serviceTask.getType())) {<NEW_LINE>for (FieldExtension fieldExtension : serviceTask.getFieldExtensions()) {<NEW_LINE>if (PROPERTY_DECISIONTABLE_REFERENCE_KEY.equals(fieldExtension.getFieldName()) && decisionTableKeyMap != null && decisionTableKeyMap.containsKey(fieldExtension.getStringValue())) {<NEW_LINE>ObjectNode decisionReferenceNode = objectMapper.createObjectNode();<NEW_LINE>propertiesNode.set(PROPERTY_DECISIONTABLE_REFERENCE, decisionReferenceNode);<NEW_LINE>ModelInfo modelInfo = decisionTableKeyMap.<MASK><NEW_LINE>decisionReferenceNode.put("id", modelInfo.getId());<NEW_LINE>decisionReferenceNode.put("name", modelInfo.getName());<NEW_LINE>decisionReferenceNode.put("key", modelInfo.getKey());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (ImplementationType.IMPLEMENTATION_TYPE_CLASS.equals(serviceTask.getImplementationType())) {<NEW_LINE>propertiesNode.put(PROPERTY_SERVICETASK_CLASS, serviceTask.getImplementation());<NEW_LINE>} else if (ImplementationType.IMPLEMENTATION_TYPE_EXPRESSION.equals(serviceTask.getImplementationType())) {<NEW_LINE>propertiesNode.put(PROPERTY_SERVICETASK_EXPRESSION, serviceTask.getImplementation());<NEW_LINE>} else if (ImplementationType.IMPLEMENTATION_TYPE_DELEGATEEXPRESSION.equals(serviceTask.getImplementationType())) {<NEW_LINE>propertiesNode.put(PROPERTY_SERVICETASK_DELEGATE_EXPRESSION, serviceTask.getImplementation());<NEW_LINE>}<NEW_LINE>if (StringUtils.isNotEmpty(serviceTask.getResultVariableName())) {<NEW_LINE>propertiesNode.put(PROPERTY_SERVICETASK_RESULT_VARIABLE, serviceTask.getResultVariableName());<NEW_LINE>}<NEW_LINE>addFieldExtensions(serviceTask.getFieldExtensions(), propertiesNode);<NEW_LINE>}<NEW_LINE>} | get(fieldExtension.getStringValue()); |
453,299 | private void fromApiParam(ParameterExpansionContext context, ApiParam apiParam) {<NEW_LINE>String allowableProperty = ofNullable(apiParam.allowableValues()).filter(((Predicate<String>) String::isEmpty).negate()).orElse(null);<NEW_LINE>AllowableValues allowable = allowableValues(ofNullable(allowableProperty), context.getFieldType().getErasedType());<NEW_LINE>maybeSetParameterName(context, apiParam.name());<NEW_LINE>context.getParameterBuilder().description(descriptions.resolve(apiParam.value())).defaultValue(apiParam.defaultValue()).required(apiParam.required()).allowMultiple(apiParam.allowMultiple()).allowableValues(allowable).parameterAccess(apiParam.access()).hidden(apiParam.hidden()).scalarExample(apiParam.example()).complexExamples(examples(apiParam.examples())).order(SWAGGER_PLUGIN_ORDER).build();<NEW_LINE>context.getRequestParameterBuilder().description(descriptions.resolve(apiParam.value())).required(apiParam.required()).hidden(apiParam.hidden()).example(new ExampleBuilder().value(apiParam.example()).build()).precedence(SWAGGER_PLUGIN_ORDER).query(q -> q.enumerationFacet(e -> <MASK><NEW_LINE>} | e.allowedValues(allowable))); |
1,803,690 | public Map<String, Object> execute(Map<String, Object> inputs) {<NEW_LINE>String itemName = (String) module.getConfiguration().get(ITEM_NAME);<NEW_LINE>String command = (String) module.getConfiguration().get(COMMAND);<NEW_LINE>if (itemName != null && eventPublisher != null && itemRegistry != null) {<NEW_LINE>try {<NEW_LINE>Item item = itemRegistry.getItem(itemName);<NEW_LINE>Command commandObj = null;<NEW_LINE>Object <MASK><NEW_LINE>if (cmd instanceof Command) {<NEW_LINE>if (item.getAcceptedCommandTypes().contains(cmd.getClass())) {<NEW_LINE>commandObj = (Command) cmd;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>commandObj = TypeParser.parseCommand(item.getAcceptedCommandTypes(), command);<NEW_LINE>}<NEW_LINE>if (commandObj != null) {<NEW_LINE>ItemCommandEvent itemCommandEvent = ItemEventFactory.createCommandEvent(itemName, commandObj);<NEW_LINE>logger.debug("Executing ItemCommandAction on Item {} with Command {}", itemCommandEvent.getItemName(), itemCommandEvent.getItemCommand());<NEW_LINE>eventPublisher.post(itemCommandEvent);<NEW_LINE>} else {<NEW_LINE>logger.warn("Command '{}' is not valid for item '{}'.", command, itemName);<NEW_LINE>}<NEW_LINE>} catch (ItemNotFoundException e) {<NEW_LINE>logger.error("Item with name {} not found in ItemRegistry.", itemName);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>logger.error("Command was not posted because either the configuration was not correct or a service was missing: ItemName: {}, Command: {}, eventPublisher: {}, ItemRegistry: {}", itemName, command, eventPublisher, itemRegistry);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | cmd = inputs.get(COMMAND); |
112,937 | public void handleEvent(@NonNull final ShipmentScheduleCreatedEvent event) {<NEW_LINE>final DemandDetailsQuery demandDetailsQuery = DemandDetailsQuery.<MASK><NEW_LINE>final CandidatesQuery candidatesQuery = CandidatesQuery.builder().type(CandidateType.DEMAND).businessCase(CandidateBusinessCase.SHIPMENT).demandDetailsQuery(demandDetailsQuery).build();<NEW_LINE>final DemandDetail demandDetail = DemandDetail.forDocumentLine(event.getShipmentScheduleId(), event.getDocumentLineDescriptor(), event.getMaterialDescriptor().getQuantity());<NEW_LINE>final CandidateBuilder candidateBuilder = Candidate.builderForEventDescr(event.getEventDescriptor()).materialDescriptor(event.getMaterialDescriptor()).minMaxDescriptor(event.getMinMaxDescriptor()).type(CandidateType.DEMAND).businessCase(CandidateBusinessCase.SHIPMENT).businessCaseDetail(demandDetail);<NEW_LINE>final Candidate existingCandidate = candidateRepository.retrieveLatestMatchOrNull(candidatesQuery);<NEW_LINE>if (existingCandidate != null) {<NEW_LINE>candidateBuilder.id(existingCandidate.getId());<NEW_LINE>}<NEW_LINE>final Candidate candidate = candidateBuilder.build();<NEW_LINE>candidateChangeHandler.onCandidateNewOrChange(candidate);<NEW_LINE>} | forDocumentLine(event.getDocumentLineDescriptor()); |
1,258,840 | private static void queryData() {<NEW_LINE>Query query;<NEW_LINE>QueryResult result;<NEW_LINE>// the selector query is parallel to the field value<NEW_LINE>query = new Query("select * from student where (name=\"xie\" and sex=\"m\")or time<now()-7d", "database");<NEW_LINE>result = influxDB.query(query);<NEW_LINE>System.out.println("query1 result:" + result.getResults().get(0).getSeries().get(0).toString());<NEW_LINE>// the selector query is parallel to the field value<NEW_LINE>query = new Query("select * from student ", "database");<NEW_LINE><MASK><NEW_LINE>System.out.println("query2 result:" + result.getResults().get(0).getSeries().get(0).toString());<NEW_LINE>// use iotdb built-in func<NEW_LINE>query = new Query("select max(score),min(score),sum(score),count(score),first(score),last(score) from student ", "database");<NEW_LINE>result = influxDB.query(query);<NEW_LINE>System.out.println("query3 result:" + result.getResults().get(0).getSeries().get(0).toString());<NEW_LINE>// aggregate query and selector query are parallel<NEW_LINE>query = new Query("select count(score),first(score),last(country),max(score),mean(score),median(score),min(score),mode(score),spread(score),stddev(score),sum(score) from student where (name=\"xie\" and sex=\"m\")or score<99", "database");<NEW_LINE>result = influxDB.query(query);<NEW_LINE>System.out.println("query4 result:" + result.getResults().get(0).getSeries().get(0).toString());<NEW_LINE>} | result = influxDB.query(query); |
726,619 | public SkyValue compute(SkyKey skyKey, Environment env) throws SkyFunctionException, InterruptedException {<NEW_LINE>RootModuleFileValue root = (RootModuleFileValue) <MASK><NEW_LINE>if (root == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>ImmutableMap<ModuleKey, Module> initialDepGraph = Discovery.run(env, root);<NEW_LINE>if (initialDepGraph == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>ImmutableMap<String, ModuleOverride> overrides = root.getOverrides();<NEW_LINE>ImmutableMap<ModuleKey, Module> resolvedDepGraph;<NEW_LINE>try {<NEW_LINE>resolvedDepGraph = Selection.run(initialDepGraph, overrides);<NEW_LINE>} catch (ExternalDepsException e) {<NEW_LINE>throw new BazelModuleResolutionFunctionException(e, Transience.PERSISTENT);<NEW_LINE>}<NEW_LINE>verifyRootModuleDirectDepsAreAccurate(env, initialDepGraph.get(ModuleKey.ROOT), resolvedDepGraph.get(ModuleKey.ROOT));<NEW_LINE>return createValue(resolvedDepGraph, overrides);<NEW_LINE>} | env.getValue(ModuleFileValue.KEY_FOR_ROOT_MODULE); |
606,930 | private void allSlotsIniTableDo() throws CorruptDataException {<NEW_LINE>J9ITablePointer iTable = J9ITablePointer.cast(ramClass.iTable());<NEW_LINE>int interfaceSize = 0;<NEW_LINE>final J9ITablePointer superclassITable;<NEW_LINE>final J9ClassPointer superclass = J9ClassHelper.superclass(ramClass);<NEW_LINE>if (superclass.isNull()) {<NEW_LINE>superclassITable = J9ITablePointer.NULL;<NEW_LINE>} else {<NEW_LINE>superclassITable = J9ITablePointer.cast(superclass.iTable());<NEW_LINE>}<NEW_LINE>while (!iTable.eq(superclassITable)) {<NEW_LINE>classWalkerCallback.addSlot(clazz, SlotType.J9_UDATA, iTable.interfaceClassEA(), "iTable->interfaceClass", "!j9class");<NEW_LINE>classWalkerCallback.addSlot(clazz, SlotType.J9_UDATA, iTable.<MASK><NEW_LINE>if (!ramClass.romClass().modifiers().allBitsIn(J9JavaAccessFlags.J9AccInterface)) {<NEW_LINE>int methodCount = iTable.interfaceClass().romClass().romMethodCount().intValue();<NEW_LINE>for (int i = 0; i < methodCount; i++) {<NEW_LINE>classWalkerCallback.addSlot(clazz, SlotType.J9_iTableMethod, iTable.nextEA().add(i + 1), "method", "!j9method");<NEW_LINE>interfaceSize += UDATA.SIZEOF;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>iTable = iTable.next();<NEW_LINE>interfaceSize += J9ITable.SIZEOF;<NEW_LINE>}<NEW_LINE>classWalkerCallback.addSection(clazz, ramClass.iTable(), interfaceSize, "iTable", false);<NEW_LINE>} | nextEA(), "iTable->next", "!j9itable"); |
1,750,961 | public void init() {<NEW_LINE>root = new DefaultTreeNode("Files", null);<NEW_LINE>TreeNode node0 = new DefaultTreeNode("Documents", root);<NEW_LINE>TreeNode node1 = new DefaultTreeNode("Events", root);<NEW_LINE>TreeNode node2 <MASK><NEW_LINE>TreeNode node00 = new DefaultTreeNode("Work", node0);<NEW_LINE>TreeNode node01 = new DefaultTreeNode("Home", node0);<NEW_LINE>node00.getChildren().add(new DefaultTreeNode("Expenses.doc"));<NEW_LINE>node00.getChildren().add(new DefaultTreeNode("Resume.doc"));<NEW_LINE>node01.getChildren().add(new DefaultTreeNode("Invoices.txt"));<NEW_LINE>TreeNode node10 = new DefaultTreeNode("Meeting", node1);<NEW_LINE>TreeNode node11 = new DefaultTreeNode("Product Launch", node1);<NEW_LINE>TreeNode node12 = new DefaultTreeNode("Report Review", node1);<NEW_LINE>TreeNode node20 = new DefaultTreeNode("Al Pacino", node2);<NEW_LINE>TreeNode node21 = new DefaultTreeNode("Robert De Niro", node2);<NEW_LINE>node20.getChildren().add(new DefaultTreeNode("Scarface"));<NEW_LINE>node20.getChildren().add(new DefaultTreeNode("Serpico"));<NEW_LINE>node21.getChildren().add(new DefaultTreeNode("Goodfellas"));<NEW_LINE>node21.getChildren().add(new DefaultTreeNode("Untouchables"));<NEW_LINE>} | = new DefaultTreeNode("Movies", root); |
1,136,158 | public void init(Properties properties) {<NEW_LINE>RocketMQProducerConfig rocketMQProperties = new RocketMQProducerConfig();<NEW_LINE>this.mqProperties = rocketMQProperties;<NEW_LINE>super.init(properties);<NEW_LINE>loadRocketMQProperties(properties);<NEW_LINE>RPCHook rpcHook = null;<NEW_LINE>if (mqProperties.getAliyunAccessKey().length() > 0 && mqProperties.getAliyunSecretKey().length() > 0) {<NEW_LINE>SessionCredentials sessionCredentials = new SessionCredentials();<NEW_LINE>sessionCredentials.setAccessKey(mqProperties.getAliyunAccessKey());<NEW_LINE>sessionCredentials.setSecretKey(mqProperties.getAliyunSecretKey());<NEW_LINE>rpcHook = new AclClientRPCHook(sessionCredentials);<NEW_LINE>}<NEW_LINE>defaultMQProducer = new DefaultMQProducer(rocketMQProperties.getProducerGroup(), rpcHook, rocketMQProperties.isEnableMessageTrace(), rocketMQProperties.getCustomizedTraceTopic());<NEW_LINE>if (CLOUD_ACCESS_CHANNEL.equals(rocketMQProperties.getAccessChannel())) {<NEW_LINE>defaultMQProducer.setAccessChannel(AccessChannel.CLOUD);<NEW_LINE>}<NEW_LINE>if (!StringUtils.isEmpty(rocketMQProperties.getNamespace())) {<NEW_LINE>defaultMQProducer.setNamespace(rocketMQProperties.getNamespace());<NEW_LINE>}<NEW_LINE>defaultMQProducer.setNamesrvAddr(rocketMQProperties.getNamesrvAddr());<NEW_LINE>defaultMQProducer.setRetryTimesWhenSendFailed(rocketMQProperties.getRetryTimesWhenSendFailed());<NEW_LINE>defaultMQProducer.<MASK><NEW_LINE>logger.info("##Start RocketMQ producer##");<NEW_LINE>try {<NEW_LINE>defaultMQProducer.start();<NEW_LINE>} catch (MQClientException ex) {<NEW_LINE>throw new CanalException("Start RocketMQ producer error", ex);<NEW_LINE>}<NEW_LINE>int parallelPartitionSendThreadSize = mqProperties.getParallelSendThreadSize();<NEW_LINE>sendPartitionExecutor = new ThreadPoolExecutor(parallelPartitionSendThreadSize, parallelPartitionSendThreadSize, 0, TimeUnit.SECONDS, new ArrayBlockingQueue<>(parallelPartitionSendThreadSize * 2), new NamedThreadFactory("MQ-Parallel-Sender-Partition"), new ThreadPoolExecutor.CallerRunsPolicy());<NEW_LINE>} | setVipChannelEnabled(rocketMQProperties.isVipChannelEnabled()); |
237,643 | public ClusterState execute(ClusterState currentState, Collection<Mutation> mutations, Collection<Event.SchemaChange> events) throws Exception {<NEW_LINE>if (request.create && currentState.metaData().templates().containsKey(request.name)) {<NEW_LINE>throw new IllegalArgumentException("index_template [" + request.name + "] already exists");<NEW_LINE>}<NEW_LINE>IndexTemplateMetaData.Builder templateBuilder = IndexTemplateMetaData.builder(request.name);<NEW_LINE>validateAndAddTemplate(<MASK><NEW_LINE>for (Alias alias : request.aliases) {<NEW_LINE>AliasMetaData aliasMetaData = AliasMetaData.builder(alias.name()).filter(alias.filter()).indexRouting(alias.indexRouting()).searchRouting(alias.searchRouting()).build();<NEW_LINE>templateBuilder.putAlias(aliasMetaData);<NEW_LINE>}<NEW_LINE>IndexTemplateMetaData template = templateBuilder.build();<NEW_LINE>MetaData.Builder builder = MetaData.builder(currentState.metaData()).setClusterUuid().put(template);<NEW_LINE>logger.info("adding template [{}] for index patterns {}", request.name, request.indexPatterns);<NEW_LINE>return ClusterState.builder(currentState).metaData(builder).build();<NEW_LINE>} | request, templateBuilder, indicesService, xContentRegistry); |
1,470,474 | public boolean apply(Game game, Ability source) {<NEW_LINE>Player controller = game.getPlayer(source.getControllerId());<NEW_LINE>MageObject <MASK><NEW_LINE>if (controller != null && sourceObject != null) {<NEW_LINE>if (getTargetPointer().getFirst(game, source) != null) {<NEW_LINE>Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source));<NEW_LINE>if (permanent != null) {<NEW_LINE>int zcc = permanent.getZoneChangeCounter(game);<NEW_LINE>if (controller.moveCards(permanent, Zone.EXILED, source, game)) {<NEW_LINE>Effect effect = new ReturnToBattlefieldUnderOwnerControlTargetEffect(false, false);<NEW_LINE>effect.setTargetPointer(new FixedTarget(permanent.getId(), zcc + 1));<NEW_LINE>AtTheBeginOfNextEndStepDelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(effect);<NEW_LINE>game.addDelayedTriggeredAbility(delayedAbility, source);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | sourceObject = game.getObject(source); |
1,794,209 | Mono<Response<Void>> deleteSubscriptionWithResponse(String topicName, String subscriptionName, Context context) {<NEW_LINE>if (subscriptionName == null) {<NEW_LINE>return monoError(LOGGER, new NullPointerException("'subscriptionName' cannot be null"));<NEW_LINE>} else if (subscriptionName.isEmpty()) {<NEW_LINE>return monoError(LOGGER, new IllegalArgumentException("'subscriptionName' cannot be an empty string."));<NEW_LINE>} else if (topicName == null) {<NEW_LINE>return monoError(LOGGER, new NullPointerException("'topicName' cannot be null"));<NEW_LINE>} else if (topicName.isEmpty()) {<NEW_LINE>return monoError(LOGGER, new IllegalArgumentException("'topicName' cannot be an empty string."));<NEW_LINE>} else if (context == null) {<NEW_LINE>return monoError(LOGGER, new NullPointerException("'context' cannot be null."));<NEW_LINE>}<NEW_LINE>final Context withTracing = <MASK><NEW_LINE>try {<NEW_LINE>return managementClient.getSubscriptions().deleteWithResponseAsync(topicName, subscriptionName, withTracing).onErrorMap(ServiceBusAdministrationAsyncClient::mapException).map(response -> new SimpleResponse<>(response.getRequest(), response.getStatusCode(), response.getHeaders(), null));<NEW_LINE>} catch (RuntimeException ex) {<NEW_LINE>return monoError(LOGGER, ex);<NEW_LINE>}<NEW_LINE>} | context.addData(AZ_TRACING_NAMESPACE_KEY, AZ_TRACING_NAMESPACE_VALUE); |
281,981 | static PathEvaluator create(@Nullable Class<?> type, String pathAndFormat) {<NEW_LINE>String path;<NEW_LINE>String format;<NEW_LINE>String formatArg;<NEW_LINE>int index = pathAndFormat.indexOf('|');<NEW_LINE>if (index == -1) {<NEW_LINE>path = pathAndFormat;<NEW_LINE>format = null;<NEW_LINE>formatArg = null;<NEW_LINE>} else {<NEW_LINE>// trim is to allow spaces on either side of the "|"<NEW_LINE>path = pathAndFormat.substring(0, index).trim();<NEW_LINE>String formatAndArg = pathAndFormat.substring(index + 1).trim();<NEW_LINE>index = formatAndArg.indexOf(':');<NEW_LINE>if (index == -1) {<NEW_LINE>format = formatAndArg;<NEW_LINE>formatArg = null;<NEW_LINE>} else {<NEW_LINE>format = formatAndArg.substring(0, index);<NEW_LINE>formatArg = formatAndArg.substring(index + 1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<Accessor> accessors = Lists.newArrayList();<NEW_LINE>if (type == null) {<NEW_LINE>return new PathEvaluator(accessors, splitter.splitToList<MASK><NEW_LINE>}<NEW_LINE>List<String> parts = Lists.newArrayList(splitter.split(path));<NEW_LINE>Class<?> currType = type;<NEW_LINE>while (!parts.isEmpty()) {<NEW_LINE>String currPart = parts.remove(0);<NEW_LINE>Accessor accessor = Beans.loadPossiblyArrayBasedAccessor(currType, currPart);<NEW_LINE>if (accessor == null) {<NEW_LINE>parts.add(0, currPart);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>accessors.add(accessor);<NEW_LINE>currType = accessor.getValueType();<NEW_LINE>}<NEW_LINE>return new PathEvaluator(accessors, parts, format, formatArg);<NEW_LINE>} | (path), format, formatArg); |
339,567 | public static void apply(ExprNode target, ExprNode start, ExprNode end, boolean includeStart, boolean includeEnd, boolean isNot, QueryGraphForge queryGraph) {<NEW_LINE>QueryGraphRangeEnum rangeOp = QueryGraphRangeEnum.getRangeOp(includeStart, includeEnd, isNot);<NEW_LINE>if (((target instanceof ExprIdentNode)) && ((start instanceof ExprIdentNode)) && ((end instanceof ExprIdentNode))) {<NEW_LINE>ExprIdentNode identNodeValue = (ExprIdentNode) target;<NEW_LINE>ExprIdentNode identNodeStart = (ExprIdentNode) start;<NEW_LINE>ExprIdentNode identNodeEnd = (ExprIdentNode) end;<NEW_LINE>int keyStreamStart = identNodeStart.getStreamId();<NEW_LINE>int keyStreamEnd = identNodeEnd.getStreamId();<NEW_LINE>int valueStream = identNodeValue.getStreamId();<NEW_LINE>queryGraph.addRangeStrict(keyStreamStart, identNodeStart, keyStreamEnd, identNodeEnd, valueStream, identNodeValue, rangeOp);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// handle constant-compare or transformation case<NEW_LINE>if (target instanceof ExprIdentNode) {<NEW_LINE>ExprIdentNode identNode = (ExprIdentNode) target;<NEW_LINE>int indexedStream = identNode.getStreamId();<NEW_LINE>EligibilityDesc eligibilityStart = EligibilityUtil.verifyInputStream(start, indexedStream);<NEW_LINE>if (!eligibilityStart.getEligibility().isEligible()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>EligibilityDesc eligibilityEnd = <MASK><NEW_LINE>if (!eligibilityEnd.getEligibility().isEligible()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>queryGraph.addRangeExpr(indexedStream, identNode, start, eligibilityStart.getStreamNum(), end, eligibilityEnd.getStreamNum(), rangeOp);<NEW_LINE>}<NEW_LINE>} | EligibilityUtil.verifyInputStream(end, indexedStream); |
570,646 | private void updatePreview() {<NEW_LINE>double paperWidth = paper.unit.convert(paper.width, units);<NEW_LINE>double paperHeight = paper.unit.convert(paper.height, units);<NEW_LINE>double unitsToPixel = 400.0 / paperWidth;<NEW_LINE>// TODO switch other calibration targets over to using the generic fiducial engine<NEW_LINE>if (selectedType == CalibrationPatterns.ECOCHECK) {<NEW_LINE>ConfigECoCheckMarkers c = (ConfigECoCheckMarkers) selectedCalib;<NEW_LINE>ECoCheckUtils utils = new ECoCheckUtils();<NEW_LINE>utils.setParametersFromConfig(c);<NEW_LINE>utils.fixate();<NEW_LINE>ConfigECoCheckMarkers.MarkerShape shape = c.markerShapes.get(0);<NEW_LINE>double markerWidth = shape.squareSize * (shape.numCols - 1);<NEW_LINE>double markerHeight = shape.squareSize * (shape.numRows - 1);<NEW_LINE>// Render the marker. Adjust marker size so that when the border is added it will match the paper size<NEW_LINE>FiducialRenderEngineGraphics2D render = configureRenderGraphics2D(markerWidth, markerHeight, unitsToPixel);<NEW_LINE>ECoCheckGenerator generator = new ECoCheckGenerator(utils);<NEW_LINE>generator.squareWidth = shape.squareSize * unitsToPixel;<NEW_LINE>generator.setRender(render);<NEW_LINE>generator.render(0);<NEW_LINE>renderingPanel.setImageUI(render.getImage());<NEW_LINE>return;<NEW_LINE>} else if (selectedType == CalibrationPatterns.HAMMING_CHESSBOARD) {<NEW_LINE>ConfigHammingChessboard c = (ConfigHammingChessboard) selectedCalib;<NEW_LINE>double markerWidth = c.getMarkerWidth();<NEW_LINE>double markerHeight = c.getMarkerHeight();<NEW_LINE>FiducialRenderEngineGraphics2D render = <MASK><NEW_LINE>HammingChessboardGenerator generator = new HammingChessboardGenerator(c);<NEW_LINE>generator.squareWidth = unitsToPixel;<NEW_LINE>generator.setRender(render);<NEW_LINE>generator.render();<NEW_LINE>renderingPanel.setImageUI(render.getImage());<NEW_LINE>return;<NEW_LINE>} else if (selectedType == CalibrationPatterns.HAMMING_GRID) {<NEW_LINE>ConfigHammingGrid c = (ConfigHammingGrid) selectedCalib;<NEW_LINE>double markerWidth = c.getMarkerWidth();<NEW_LINE>double markerHeight = c.getMarkerHeight();<NEW_LINE>FiducialRenderEngineGraphics2D render = configureRenderGraphics2D(markerWidth, markerHeight, unitsToPixel);<NEW_LINE>var generator = new HammingGridGenerator(c);<NEW_LINE>generator.squareWidth = unitsToPixel;<NEW_LINE>generator.setRender(render);<NEW_LINE>generator.render();<NEW_LINE>renderingPanel.setImageUI(render.getImage());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final RenderCalibrationTargetsGraphics2D renderer = new RenderCalibrationTargetsGraphics2D(-1, 400 / paperWidth);<NEW_LINE>renderer.setPaperSize(paperWidth, paperHeight);<NEW_LINE>if (selectedType == CalibrationPatterns.CHESSBOARD) {<NEW_LINE>ConfigGridDimen config = (ConfigGridDimen) selectedCalib;<NEW_LINE>renderer.chessboard(config.numRows, config.numCols, config.shapeSize);<NEW_LINE>} else if (selectedType == CalibrationPatterns.SQUARE_GRID) {<NEW_LINE>ConfigGridDimen config = (ConfigGridDimen) selectedCalib;<NEW_LINE>renderer.squareGrid(config.numRows, config.numCols, config.shapeSize, config.shapeDistance);<NEW_LINE>} else if (selectedType == CalibrationPatterns.CIRCLE_GRID) {<NEW_LINE>ConfigGridDimen config = (ConfigGridDimen) selectedCalib;<NEW_LINE>renderer.circleRegular(config.numRows, config.numCols, config.shapeSize, config.shapeDistance);<NEW_LINE>} else if (selectedType == CalibrationPatterns.CIRCLE_HEXAGONAL) {<NEW_LINE>ConfigGridDimen config = (ConfigGridDimen) selectedCalib;<NEW_LINE>renderer.circleHex(config.numRows, config.numCols, config.shapeSize, config.shapeDistance);<NEW_LINE>}<NEW_LINE>renderingPanel.setImageUI(renderer.getBuffered());<NEW_LINE>} | configureRenderGraphics2D(markerWidth, markerHeight, unitsToPixel); |
795,148 | private char[][] findMethodParameterNames(MethodBinding method, char[][] parameterTypeNames) {<NEW_LINE>TypeBinding erasure = method.declaringClass.erasure();<NEW_LINE>if (!(erasure instanceof ReferenceBinding))<NEW_LINE>return null;<NEW_LINE>char[][] parameterNames = null;<NEW_LINE>int length = parameterTypeNames.length;<NEW_LINE>if (length == 0) {<NEW_LINE>return CharOperation.NO_CHAR_CHAR;<NEW_LINE>}<NEW_LINE>// look into the corresponding unit if it is available<NEW_LINE>if (erasure instanceof SourceTypeBinding) {<NEW_LINE>SourceTypeBinding sourceType = (SourceTypeBinding) erasure;<NEW_LINE>if (sourceType.scope != null) {<NEW_LINE>TypeDeclaration parsedType;<NEW_LINE>if ((parsedType = sourceType.scope.referenceContext) != null) {<NEW_LINE>AbstractMethodDeclaration methodDecl = parsedType.declarationOf(method.original());<NEW_LINE>if (methodDecl != null) {<NEW_LINE>Argument[] arguments = methodDecl.arguments;<NEW_LINE>parameterNames = new char[length][];<NEW_LINE>for (int i = 0; i < length; i++) {<NEW_LINE>parameterNames[i] = arguments[i].name;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// look into the model<NEW_LINE>if (parameterNames == null) {<NEW_LINE>ReferenceBinding bindingType = (ReferenceBinding) erasure;<NEW_LINE>char[] compoundName = CharOperation.concatWith(bindingType.compoundName, '.');<NEW_LINE>Object type = this.typeCache.get(compoundName);<NEW_LINE>ISourceType sourceType = null;<NEW_LINE>if (type != null) {<NEW_LINE>if (type instanceof ISourceType) {<NEW_LINE>sourceType = (ISourceType) type;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>NameEnvironmentAnswer answer = this.nameEnvironment.findTypeInModules(bindingType.compoundName, this.unitScope.module());<NEW_LINE>if (answer != null && answer.isSourceType()) {<NEW_LINE>sourceType = answer.getSourceTypes()[0];<NEW_LINE>this.typeCache.put(compoundName, sourceType);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (sourceType != null) {<NEW_LINE>IType typeHandle = ((<MASK><NEW_LINE>String[] parameterTypeSignatures = new String[length];<NEW_LINE>for (int i = 0; i < length; i++) {<NEW_LINE>parameterTypeSignatures[i] = Signature.createTypeSignature(parameterTypeNames[i], false);<NEW_LINE>}<NEW_LINE>IMethod searchedMethod = typeHandle.getMethod(String.valueOf(method.selector), parameterTypeSignatures);<NEW_LINE>IMethod[] foundMethods = typeHandle.findMethods(searchedMethod);<NEW_LINE>if (foundMethods != null) {<NEW_LINE>int len = foundMethods.length;<NEW_LINE>if (len == 1) {<NEW_LINE>try {<NEW_LINE>SourceMethod sourceMethod = (SourceMethod) foundMethods[0];<NEW_LINE>parameterNames = ((SourceMethodElementInfo) sourceMethod.getElementInfo()).getArgumentNames();<NEW_LINE>} catch (JavaModelException e) {<NEW_LINE>// method doesn't exist: ignore<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return parameterNames;<NEW_LINE>} | SourceTypeElementInfo) sourceType).getHandle(); |
283,359 | public OutputStream encryptStream(OutputStream outputStream) throws CryptoException {<NEW_LINE>if (ivReused) {<NEW_LINE>throw new CryptoException("Key/IV reuse is forbidden in AESGCMCryptoModule. Too many RBlocks.");<NEW_LINE>}<NEW_LINE>incrementIV(<MASK><NEW_LINE>if (Arrays.equals(initVector, firstInitVector)) {<NEW_LINE>// This will allow us to write the final block, since the<NEW_LINE>ivReused = true;<NEW_LINE>// initialization vector<NEW_LINE>// is always incremented before use.<NEW_LINE>}<NEW_LINE>// write IV before encrypting<NEW_LINE>try {<NEW_LINE>outputStream.write(initVector);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new CryptoException("Unable to write IV to stream", e);<NEW_LINE>}<NEW_LINE>Cipher cipher;<NEW_LINE>try {<NEW_LINE>cipher = Cipher.getInstance(transformation);<NEW_LINE>cipher.init(Cipher.ENCRYPT_MODE, fek, new GCMParameterSpec(GCM_TAG_LENGTH_IN_BITS, initVector));<NEW_LINE>} catch (NoSuchAlgorithmException | NoSuchPaddingException | InvalidKeyException | InvalidAlgorithmParameterException e) {<NEW_LINE>throw new CryptoException("Unable to initialize cipher", e);<NEW_LINE>}<NEW_LINE>RFileCipherOutputStream cos = new RFileCipherOutputStream(new DiscardCloseOutputStream(outputStream), cipher);<NEW_LINE>// Prevent underlying stream from being closed with DiscardCloseOutputStream<NEW_LINE>// Without this, when the crypto stream is closed (in order to flush its last bytes)<NEW_LINE>// the underlying RFile stream will *also* be closed, and that's undesirable as the<NEW_LINE>// cipher<NEW_LINE>// stream is closed for every block written.<NEW_LINE>return new BlockedOutputStream(cos, cipher.getBlockSize(), 1024);<NEW_LINE>} | initVector, initVector.length - 1); |
1,017,381 | private void addMethods(Class<?> baseClass, List<PyReflectedFunction> reflectedFuncs, Map<String, PyBeanProperty> props, Map<String, PyBeanEvent<?>> events, Method[] methods) {<NEW_LINE>boolean isInAwt = name.startsWith("java.awt.") && name.indexOf('.', 9) == -1;<NEW_LINE>for (Method meth : methods) {<NEW_LINE>if (!declaredHere(baseClass, meth) || ignore(meth)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>String methname = meth.getName();<NEW_LINE>if (isInAwt && BAD_AWT_METHODS.contains(methname)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>String nmethname = normalize(methname);<NEW_LINE>PyReflectedFunction reflfunc = (<MASK><NEW_LINE>if (reflfunc == null) {<NEW_LINE>// A new descriptor is required<NEW_LINE>reflfunc = new PyReflectedFunction(meth);<NEW_LINE>reflectedFuncs.add(reflfunc);<NEW_LINE>dict.__setitem__(nmethname, reflfunc);<NEW_LINE>} else {<NEW_LINE>// A descriptor for the same simple name exists: add a signature to it.<NEW_LINE>reflfunc.addMethod(meth);<NEW_LINE>}<NEW_LINE>// Check if this is a Java Bean method, indicating the "bean nature" of the class<NEW_LINE>checkBeanMethod(props, events, meth);<NEW_LINE>}<NEW_LINE>} | PyReflectedFunction) dict.__finditem__(nmethname); |
424,589 | public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {<NEW_LINE>HttpServletRequest httpReq = (HttpServletRequest) request;<NEW_LINE>KeycloakSecurityContext session = getSession(httpReq);<NEW_LINE>if (session != null) {<NEW_LINE>HttpSession httpSession = httpReq.getSession();<NEW_LINE>// Set the token as a string in the request (as an attribute) for later use.<NEW_LINE>StudioConfigAuth auth = new StudioConfigAuth();<NEW_LINE>auth.setType(StudioConfigAuthType.token);<NEW_LINE>auth.setLogoutUrl(((HttpServletRequest) request).getContextPath() + "/logout");<NEW_LINE>auth.<MASK><NEW_LINE>auth.setTokenRefreshPeriod(expirationToRefreshPeriod(session.getToken().getExp()));<NEW_LINE>httpSession.setAttribute(RequestAttributeKeys.AUTH_KEY, auth);<NEW_LINE>// Fabricate a User object from information in the access token and store it in the request.<NEW_LINE>AccessToken token = session.getToken();<NEW_LINE>if (token != null) {<NEW_LINE>User user = new User();<NEW_LINE>user.setEmail(token.getEmail());<NEW_LINE>user.setLogin(token.getPreferredUsername());<NEW_LINE>user.setName(token.getName());<NEW_LINE>if (token.getRealmAccess() == null || token.getRealmAccess().getRoles() == null) {<NEW_LINE>user.setRoles(Collections.emptyList());<NEW_LINE>} else {<NEW_LINE>user.setRoles(token.getRealmAccess().getRoles().stream().map(StudioRole::forName).filter(Objects::nonNull).collect(Collectors.toUnmodifiableList()));<NEW_LINE>}<NEW_LINE>httpSession.setAttribute(RequestAttributeKeys.USER_KEY, user);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>chain.doFilter(request, response);<NEW_LINE>} | setToken(session.getTokenString()); |
1,100,094 | public void testSLLocalEnvEntry_Double_InvalidValue() throws Exception {<NEW_LINE>SLLa ejb1 = fhome1.create();<NEW_LINE>try {<NEW_LINE>// The test case looks for a environment variable named "envDoubleInvalid".<NEW_LINE>Double tempDouble = ejb1.getDoubleEnvVar("envDoubleBlankdValue");<NEW_LINE>fail("Get environment invalid double object should have failed, instead got: " + tempDouble);<NEW_LINE>} catch (NamingException ne) {<NEW_LINE>svLogger.info("Caught expected " + ne.getClass().getName());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>// The test case looks for a environment variable named "envDoubleInvalid".<NEW_LINE>Double <MASK><NEW_LINE>fail("Get environment invalid double object should have failed, instead got: " + tempDouble);<NEW_LINE>} catch (NamingException ne) {<NEW_LINE>svLogger.info("Caught expected " + ne.getClass().getName());<NEW_LINE>}<NEW_LINE>// The test case looks for a environment variable named "envDoubleInvalid".<NEW_LINE>Double tempDouble = ejb1.getDoubleEnvVar("envDoubleGT64bit");<NEW_LINE>assertTrue("Get environment invalid double object was not infinity (Double.isInifinite)", Double.isInfinite(tempDouble.doubleValue()));<NEW_LINE>} | tempDouble = ejb1.getDoubleEnvVar("envDoubleInvalid"); |
334,653 | public static FullHttpResponse serveSite(Path siteDirectory, FullHttpRequest request, ByteBufAllocator alloc) throws IOException {<NEW_LINE>if (request.method() != HttpMethod.GET) {<NEW_LINE>return new DefaultFullHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.FORBIDDEN);<NEW_LINE>}<NEW_LINE>String sitePath = request.uri();<NEW_LINE>while (sitePath.length() > 0 && sitePath.charAt(0) == '/') {<NEW_LINE>sitePath = sitePath.substring(1);<NEW_LINE>}<NEW_LINE>// we default to index.html, or what the plugin provides (as a unix-style path)<NEW_LINE>// this is a relative path under _site configured by the plugin.<NEW_LINE>if (sitePath.length() == 0) {<NEW_LINE>sitePath = "index.html";<NEW_LINE>}<NEW_LINE>final String separator = siteDirectory<MASK><NEW_LINE>// Convert file separators.<NEW_LINE>sitePath = sitePath.replace("/", separator);<NEW_LINE>Path file = siteDirectory.resolve(sitePath);<NEW_LINE>// return not found instead of forbidden to prevent malicious requests to find out if files exist or don't exist<NEW_LINE>if (!Files.exists(file) || FileSystemUtils.isHidden(file) || !file.toAbsolutePath().normalize().startsWith(siteDirectory.toAbsolutePath().normalize())) {<NEW_LINE>return Responses.contentResponse(HttpResponseStatus.NOT_FOUND, alloc, "Requested file [" + file + "] was not found");<NEW_LINE>}<NEW_LINE>BasicFileAttributes attributes = readAttributes(file, BasicFileAttributes.class);<NEW_LINE>if (!attributes.isRegularFile()) {<NEW_LINE>// If it's not a regular file, we send a 403<NEW_LINE>final String msg = "Requested file [" + file + "] is not a valid file.";<NEW_LINE>return Responses.contentResponse(HttpResponseStatus.NOT_FOUND, alloc, msg);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>byte[] data = Files.readAllBytes(file);<NEW_LINE>var resp = Responses.contentResponse(HttpResponseStatus.OK, alloc, data);<NEW_LINE>resp.headers().set(HttpHeaderNames.CONTENT_TYPE, guessMimeType(file.toAbsolutePath().toString()));<NEW_LINE>return resp;<NEW_LINE>} catch (IOException e) {<NEW_LINE>return Responses.contentResponse(HttpResponseStatus.INTERNAL_SERVER_ERROR, alloc, e.getMessage());<NEW_LINE>}<NEW_LINE>} | .getFileSystem().getSeparator(); |
1,703,801 | private BlockParsedResult parseNumericBlock() throws FormatException {<NEW_LINE>while (isStillNumeric(current.getPosition())) {<NEW_LINE>DecodedNumeric numeric = decodeNumeric(current.getPosition());<NEW_LINE>current.setPosition(numeric.getNewPosition());<NEW_LINE>if (numeric.isFirstDigitFNC1()) {<NEW_LINE>DecodedInformation information;<NEW_LINE>if (numeric.isSecondDigitFNC1()) {<NEW_LINE>information = new DecodedInformation(current.getPosition(), buffer.toString());<NEW_LINE>} else {<NEW_LINE>information = new DecodedInformation(current.getPosition(), buffer.toString(), numeric.getSecondDigit());<NEW_LINE>}<NEW_LINE>return new BlockParsedResult(information, true);<NEW_LINE>}<NEW_LINE>buffer.append(numeric.getFirstDigit());<NEW_LINE>if (numeric.isSecondDigitFNC1()) {<NEW_LINE>DecodedInformation information = new DecodedInformation(current.getPosition(<MASK><NEW_LINE>return new BlockParsedResult(information, true);<NEW_LINE>}<NEW_LINE>buffer.append(numeric.getSecondDigit());<NEW_LINE>}<NEW_LINE>if (isNumericToAlphaNumericLatch(current.getPosition())) {<NEW_LINE>current.setAlpha();<NEW_LINE>current.incrementPosition(4);<NEW_LINE>}<NEW_LINE>return new BlockParsedResult();<NEW_LINE>} | ), buffer.toString()); |
1,081,764 | public static Map<String, Object> defaultProps() {<NEW_LINE>final Map<String, Object> props = new HashMap<>();<NEW_LINE>props.<MASK><NEW_LINE>props.put(ConsumerConfig.AUTO_COMMIT_INTERVAL_MS_CONFIG, String.valueOf(DEFAULT_AUTO_COMMIT_INTERVAL_MS));<NEW_LINE>props.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, DEFAULT_AUTO_OFFSET_RESET);<NEW_LINE>props.put(ConsumerConfig.FETCH_MAX_WAIT_MS_CONFIG, String.valueOf(DEFAULT_FETCH_MAX_WAIT_MS));<NEW_LINE>props.put(ConsumerConfig.FETCH_MIN_BYTES_CONFIG, String.valueOf(DEFAULT_FETCH_MIN_BYTES));<NEW_LINE>props.put(ConsumerConfig.HEARTBEAT_INTERVAL_MS_CONFIG, String.valueOf(DEFAULT_HEARTBEAT_INTERVAL_MS));<NEW_LINE>props.put(ConsumerConfig.SESSION_TIMEOUT_MS_CONFIG, String.valueOf(DEFAULT_SESSION_TIMEOUT_MS));<NEW_LINE>props.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, DEFAULT_KEY_DESERIALIZER);<NEW_LINE>props.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, DEFAULT_VALUE_DESERIALIZER);<NEW_LINE>props.put(ConsumerConfig.MAX_PARTITION_FETCH_BYTES_CONFIG, String.valueOf(DEFAULT_MAX_PARTITION_FETCH_BYTES));<NEW_LINE>props.put(ConsumerConfig.RECEIVE_BUFFER_CONFIG, String.valueOf(DEFAULT_RECEIVE_BUFFER_BYTES));<NEW_LINE>props.put(ConsumerConfig.SEND_BUFFER_CONFIG, String.valueOf(DEFAULT_SEND_BUFFER_BYTES));<NEW_LINE>props.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, DEFAULT_BOOTSTRAP_SERVERS_CONFIG);<NEW_LINE>props.put(ConsumerConfig.METRIC_REPORTER_CLASSES_CONFIG, JmxReporter.class.getName());<NEW_LINE>props.put(ConsumerConfig.REQUEST_TIMEOUT_MS_CONFIG, String.valueOf(DEFAULT_REQUEST_TIMEOUT_MS));<NEW_LINE>props.put(ConsumerConfig.MAX_POLL_RECORDS_CONFIG, String.valueOf(DEFAULT_MAX_POLL_RECORDS));<NEW_LINE>props.put(ConsumerConfig.MAX_POLL_INTERVAL_MS_CONFIG, String.valueOf(DEFAULT_MAX_POLL_INTERVAL_MS));<NEW_LINE>props.put(ConsumerConfig.PARTITION_ASSIGNMENT_STRATEGY_CONFIG, RangeAssignor.class.getName());<NEW_LINE>return props;<NEW_LINE>} | put(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG, DEFAULT_AUTO_COMMIT_ENABLED); |
1,066,183 | final GetCloudFormationStackRecordsResult executeGetCloudFormationStackRecords(GetCloudFormationStackRecordsRequest getCloudFormationStackRecordsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getCloudFormationStackRecordsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetCloudFormationStackRecordsRequest> request = null;<NEW_LINE>Response<GetCloudFormationStackRecordsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetCloudFormationStackRecordsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getCloudFormationStackRecordsRequest));<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, "Lightsail");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetCloudFormationStackRecords");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetCloudFormationStackRecordsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><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>} | false), new GetCloudFormationStackRecordsResultJsonUnmarshaller()); |
850,707 | public void transfer(final Session<?> session, final Session<?> destination, final Path source, final Local n, final TransferOptions options, final TransferStatus overall, final TransferStatus segment, final ConnectionCallback connectionCallback, final ProgressListener listener, final StreamListener streamListener) throws BackgroundException {<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug(String.format("Transfer file %s with options %s", source, options));<NEW_LINE>}<NEW_LINE>listener.message(MessageFormat.format(LocaleFactory.localizedString("Copying {0} to {1}", "Status"), source.getName(), mapping.get(source).getName()));<NEW_LINE>if (source.isDirectory()) {<NEW_LINE>if (!segment.isExists()) {<NEW_LINE>final Directory feature = <MASK><NEW_LINE>feature.mkdir(mapping.get(source), segment);<NEW_LINE>segment.setComplete();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// Transfer<NEW_LINE>final Copy feature = new DefaultCopyFeature(session).withTarget(destination);<NEW_LINE>feature.copy(source, mapping.get(source), segment, connectionCallback, new CopyStreamListener(this, streamListener));<NEW_LINE>}<NEW_LINE>} | destination.getFeature(Directory.class); |
1,360,943 | private void handleAjaxLoginAction(final String username, final String password, final String ip, final HttpServletResponse resp, final Map<String, Object> ret) {<NEW_LINE>Session session = null;<NEW_LINE>try {<NEW_LINE>session = createSession(username, password, ip, false);<NEW_LINE>} catch (final UserManagerException e) {<NEW_LINE>ret.put("error", "Incorrect Login. " + e.getMessage());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final Cookie cookie = new Cookie(BROWSER_SESSION_ID_KEY, session.getSessionId());<NEW_LINE>cookie.setPath("/");<NEW_LINE>resp.addCookie(cookie);<NEW_LINE>final Set<Session> sessionsOfSameIP = getApplication().getSessionCache().findSessionsByIP(session.getIp());<NEW_LINE>// Check potential DDoS attack by bad hosts.<NEW_LINE>logger.info("Session id created for user '" + session.getUser().getUserId() + "' and ip " + session.getIp() + ", " + sessionsOfSameIP.size() + " session(s) found from this IP");<NEW_LINE>final boolean sessionAdded = getApplication().getSessionCache().addSession(session);<NEW_LINE>if (sessionAdded) {<NEW_LINE>ret.put("status", "success");<NEW_LINE>ret.put(SESSION_ID_KEY, session.getSessionId());<NEW_LINE>WebUtils.reportLoginEvent(EventType.USER_LOGIN, session.getUser(<MASK><NEW_LINE>} else {<NEW_LINE>final String message = "Potential DDoS found, the number of sessions for this user and IP " + "reached allowed limit (" + getApplication().getSessionCache().getMaxNumberOfSessionsPerIpPerUser().get() + ").";<NEW_LINE>ret.put("error", message);<NEW_LINE>WebUtils.reportLoginEvent(EventType.USER_LOGIN, session.getUser().getUserId(), ip, false, message);<NEW_LINE>}<NEW_LINE>} | ).getUserId(), ip); |
65,860 | public void listOrder() {<NEW_LINE>String sql = new String("SELECT o.C_Order_ID " + "FROM C_Order o " + "WHERE o.IsSOTrx='Y' " + "AND o.Processed = 'N' " + "AND o.AD_Client_ID = ? " + "AND o.C_POS_ID = ? " + "AND o.SalesRep_ID = ? " + "ORDER BY o.Updated");<NEW_LINE>PreparedStatement preparedStatement = null;<NEW_LINE>ResultSet resultSet = null;<NEW_LINE>orderList = new ArrayList<Integer>();<NEW_LINE>try {<NEW_LINE>// Set Parameter<NEW_LINE>preparedStatement = DB.prepareStatement(sql, null);<NEW_LINE>preparedStatement.setInt(1, Env.getAD_Client_ID(Env.getCtx()));<NEW_LINE>preparedStatement.setInt(2, getC_POS_ID());<NEW_LINE>preparedStatement.<MASK><NEW_LINE>// Execute<NEW_LINE>resultSet = preparedStatement.executeQuery();<NEW_LINE>// Add to List<NEW_LINE>while (resultSet.next()) {<NEW_LINE>orderList.add(resultSet.getInt(1));<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.severe("SubOrder.listOrder: " + e + " -> " + sql);<NEW_LINE>} finally {<NEW_LINE>DB.close(resultSet);<NEW_LINE>DB.close(preparedStatement);<NEW_LINE>}<NEW_LINE>// Seek Position<NEW_LINE>if (hasRecord())<NEW_LINE>recordPosition = orderList.size() - 1;<NEW_LINE>else<NEW_LINE>recordPosition = -1;<NEW_LINE>} | setInt(3, getSalesRep_ID()); |
303,811 | protected String doIt() throws Exception {<NEW_LINE>getSelectionKeys().stream().forEach(key -> {<NEW_LINE>Optional<MProductPrice> productPriceOptional = Optional.ofNullable(MProductPrice.get(getCtx(), getRecord_ID(), key, get_TrxName()));<NEW_LINE>MProductPrice productPrice = productPriceOptional.orElseGet(() -> new MProductPrice(getCtx(), getRecord_ID(), key, get_TrxName()));<NEW_LINE>productPrice.setAD_Org_ID(productPrice.getM_PriceList_Version().getAD_Org_ID());<NEW_LINE>BigDecimal <MASK><NEW_LINE>BigDecimal priceStd = getSelectionAsBigDecimal(key, "PP_PriceStd");<NEW_LINE>BigDecimal priceLimit = getSelectionAsBigDecimal(key, "PP_PriceLimit");<NEW_LINE>productPrice.setPrices(priceList == null ? Env.ZERO : priceList, priceStd == null ? Env.ZERO : priceStd, priceLimit == null ? Env.ZERO : priceLimit);<NEW_LINE>productPrice.saveEx();<NEW_LINE>});<NEW_LINE>// for all rows<NEW_LINE>return "";<NEW_LINE>} | priceList = getSelectionAsBigDecimal(key, "PP_PriceList"); |
1,679,314 | public void collect(URL url) {<NEW_LINE>// data to collect from url<NEW_LINE>int success = url.getParameter(SUCCESS_KEY, 0);<NEW_LINE>int failure = url.getParameter(FAILURE_KEY, 0);<NEW_LINE>int input = url.getParameter(INPUT_KEY, 0);<NEW_LINE>int output = url.getParameter(OUTPUT_KEY, 0);<NEW_LINE>int elapsed = url.getParameter(ELAPSED_KEY, 0);<NEW_LINE>int concurrent = url.getParameter(CONCURRENT_KEY, 0);<NEW_LINE>// init atomic reference<NEW_LINE>Statistics statistics = new Statistics(url);<NEW_LINE>AtomicReference<StatisticsItem> reference = statisticsMap.computeIfAbsent(statistics, k -> new AtomicReference<>());<NEW_LINE>// use CompareAndSet to sum<NEW_LINE>StatisticsItem current;<NEW_LINE>StatisticsItem update = new StatisticsItem();<NEW_LINE>do {<NEW_LINE>current = reference.get();<NEW_LINE>if (current == null) {<NEW_LINE>update.setItems(success, failure, input, output, elapsed, concurrent, input, output, elapsed, concurrent);<NEW_LINE>} else {<NEW_LINE>update.setItems(current.getSuccess() + success, current.getFailure() + failure, current.getInput() + input, current.getOutput() + output, current.getElapsed() + elapsed, (current.getConcurrent() + concurrent) / 2, current.getMaxInput() > input ? current.getMaxInput() : input, current.getMaxOutput() > output ? current.getMaxOutput() : output, current.getMaxElapsed() > elapsed ? current.getMaxElapsed() : elapsed, current.getMaxConcurrent() > concurrent ? <MASK><NEW_LINE>}<NEW_LINE>} while (!reference.compareAndSet(current, update));<NEW_LINE>} | current.getMaxConcurrent() : concurrent); |
1,063,402 | final DetectAnomaliesResult executeDetectAnomalies(DetectAnomaliesRequest detectAnomaliesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(detectAnomaliesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DetectAnomaliesRequest> request = null;<NEW_LINE>Response<DetectAnomaliesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DetectAnomaliesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(detectAnomaliesRequest));<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, "LookoutVision");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DetectAnomalies");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>request.addHandlerContext(HandlerContextKey.REQUIRES_LENGTH, Boolean.TRUE);<NEW_LINE>request.addHandlerContext(HandlerContextKey.HAS_STREAMING_INPUT, Boolean.TRUE);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DetectAnomaliesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DetectAnomaliesResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | endClientExecution(awsRequestMetrics, request, response); |
1,799,027 | public CheckedSupplier<Object> decorate(FallbackMethod fallbackMethod, CheckedSupplier<Object> supplier) {<NEW_LINE>return supplier.andThen(request -> {<NEW_LINE>if (request instanceof ObservableSource) {<NEW_LINE>Observable<?> observable <MASK><NEW_LINE>return observable.onErrorResumeNext(rxJava2OnErrorResumeNext(fallbackMethod, Observable::error));<NEW_LINE>} else if (request instanceof SingleSource) {<NEW_LINE>Single<?> single = (Single) request;<NEW_LINE>return single.onErrorResumeNext(rxJava2OnErrorResumeNext(fallbackMethod, Single::error));<NEW_LINE>} else if (request instanceof CompletableSource) {<NEW_LINE>Completable completable = (Completable) request;<NEW_LINE>return completable.onErrorResumeNext(rxJava2OnErrorResumeNext(fallbackMethod, Completable::error));<NEW_LINE>} else if (request instanceof MaybeSource) {<NEW_LINE>Maybe<?> maybe = (Maybe) request;<NEW_LINE>return maybe.onErrorResumeNext(rxJava2OnErrorResumeNext(fallbackMethod, Maybe::error));<NEW_LINE>} else if (request instanceof Flowable) {<NEW_LINE>Flowable<?> flowable = (Flowable) request;<NEW_LINE>return flowable.onErrorResumeNext(rxJava2OnErrorResumeNext(fallbackMethod, Flowable::error));<NEW_LINE>} else {<NEW_LINE>return request;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | = (Observable<?>) request; |
59,210 | private void initCards() {<NEW_LINE>card1 = new CardExample(getActivity(), "Header", "Title");<NEW_LINE>cardView1 = (CardViewNative) getActivity().findViewById(R.id.carddemo_card_changevalue_id);<NEW_LINE>cardView1.setCard(card1);<NEW_LINE>card2 = new CardExample2(getActivity(), "Header", "Title");<NEW_LINE>cardView2 = (CardViewNative) getActivity().<MASK><NEW_LINE>cardView2.setCard(card2);<NEW_LINE>card3 = new CardExample3(getActivity(), "Header", "Title");<NEW_LINE>cardView3 = (CardViewNative) getActivity().findViewById(R.id.carddemo_card_changevalue_id3);<NEW_LINE>cardView3.setCard(card3);<NEW_LINE>card4 = new ColorCard(getActivity());<NEW_LINE>card4.setTitle("A simple car");<NEW_LINE>cardView4 = (CardViewNative) getActivity().findViewById(R.id.carddemo_card_changevalue_id4);<NEW_LINE>StateListDrawable initDrawable = new StateListDrawable();<NEW_LINE>initDrawable.addState(new int[] { android.R.attr.state_pressed }, getResources().getDrawable(R.drawable.pressed_background_card));<NEW_LINE>initDrawable.addState(new int[] {}, getResources().getDrawable(R.drawable.demo_card_background_color1));<NEW_LINE>card4.setBackgroundResource(initDrawable);<NEW_LINE>cardView4.setCard(card4);<NEW_LINE>} | findViewById(R.id.carddemo_card_changevalue_id2); |
719,115 | public Matrix interpolate(float interpolatedTime, int childWidth, int childHeight, float anchorX, float anchorY) {<NEW_LINE>Ti2DMatrix first = this;<NEW_LINE>ArrayList<Ti2DMatrix> preMatrixList = new ArrayList<>();<NEW_LINE>while (first.prev != null) {<NEW_LINE>first = first.prev;<NEW_LINE>// It is safe to use prev matrix to trace back the transformation matrix list,<NEW_LINE>// since prev matrix is constant.<NEW_LINE>preMatrixList.add(0, first);<NEW_LINE>}<NEW_LINE>Matrix matrix = new Matrix();<NEW_LINE>for (Ti2DMatrix current : preMatrixList) {<NEW_LINE>if (current.op != null) {<NEW_LINE>current.op.apply(interpolatedTime, matrix, <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (op != null) {<NEW_LINE>op.apply(interpolatedTime, matrix, childWidth, childHeight, anchorX, anchorY);<NEW_LINE>}<NEW_LINE>return matrix;<NEW_LINE>} | childWidth, childHeight, anchorX, anchorY); |
619,496 | void merge(Parameters defaults) {<NEW_LINE>if (defaults == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>this.logRaw = this.logRaw == null ? defaults.logRaw : this.logRaw;<NEW_LINE>this.logSum = this.logSum == null ? defaults.logSum : this.logSum;<NEW_LINE>this.logMean = this.logMean == null ? defaults.logMean : this.logMean;<NEW_LINE>this.logMax = this.logMax == null ? defaults.logMax : this.logMax;<NEW_LINE>this.logMin = this.logMin == null ? defaults.logMin : this.logMin;<NEW_LINE>this.logInsertions = this.logInsertions == null ? defaults.logInsertions : this.logInsertions;<NEW_LINE>this.nameExtension = this.nameExtension == null ? defaults.nameExtension : this.nameExtension;<NEW_LINE>this.logHistogram = this.logHistogram == null <MASK><NEW_LINE>this.histogramId = this.histogramId == null ? defaults.histogramId : this.histogramId;<NEW_LINE>this.limits = this.limits == null ? defaults.limits : this.limits;<NEW_LINE>this.appendChar = this.appendChar == null ? defaults.appendChar : this.appendChar;<NEW_LINE>this.callback = this.callback == null ? defaults.callback : this.callback;<NEW_LINE>} | ? defaults.logHistogram : this.logHistogram; |
1,851,129 | public static List<String> exportEndpointsToS3(PinpointClient pinpoint, S3Client s3Client, String s3BucketName, String iamExportRoleArn, String applicationId) {<NEW_LINE>SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd-HH_mm:ss.SSS_z");<NEW_LINE>String endpointsKeyPrefix = "exports/" + applicationId + "_" + dateFormat.format(new Date());<NEW_LINE>String s3UrlPrefix = "s3://" + s3BucketName + "/" + endpointsKeyPrefix + "/";<NEW_LINE>List<String> objectKeys = new ArrayList<>();<NEW_LINE>String key = "";<NEW_LINE>try {<NEW_LINE>// Defines the export job that Amazon Pinpoint runs<NEW_LINE>ExportJobRequest jobRequest = ExportJobRequest.builder().roleArn(iamExportRoleArn).s3UrlPrefix(s3UrlPrefix).build();<NEW_LINE>CreateExportJobRequest exportJobRequest = CreateExportJobRequest.builder().applicationId(applicationId).exportJobRequest(jobRequest).build();<NEW_LINE>System.out.format(<MASK><NEW_LINE>CreateExportJobResponse exportResult = pinpoint.createExportJob(exportJobRequest);<NEW_LINE>String jobId = exportResult.exportJobResponse().id();<NEW_LINE>System.out.println(jobId);<NEW_LINE>printExportJobStatus(pinpoint, applicationId, jobId);<NEW_LINE>ListObjectsV2Request v2Request = ListObjectsV2Request.builder().bucket(s3BucketName).prefix(endpointsKeyPrefix).build();<NEW_LINE>// Create a list of object keys<NEW_LINE>ListObjectsV2Response v2Response = s3Client.listObjectsV2(v2Request);<NEW_LINE>List<S3Object> objects = v2Response.contents();<NEW_LINE>for (S3Object object : objects) {<NEW_LINE>key = object.key();<NEW_LINE>objectKeys.add(key);<NEW_LINE>}<NEW_LINE>return objectKeys;<NEW_LINE>} catch (PinpointException e) {<NEW_LINE>System.err.println(e.awsErrorDetails().errorMessage());<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | "Exporting endpoints from Amazon Pinpoint application %s to Amazon S3 " + "bucket %s . . .\n", applicationId, s3BucketName); |
1,022,355 | public void intercept(Invocation inv) {<NEW_LINE>Controller controller = inv.getController();<NEW_LINE>Method method = inv.getMethod();<NEW_LINE>Parameter[] parameters = method.getParameters();<NEW_LINE>Type[] paraTypes = method.getGenericParameterTypes();<NEW_LINE>Object jsonObjectOrArray = StrUtil.isBlank(controller.getRawData()) ? null : JSON.parse(controller.getRawData());<NEW_LINE>for (int index = 0; index < parameters.length; index++) {<NEW_LINE>JsonBody jsonBody = parameters[index].getAnnotation(JsonBody.class);<NEW_LINE>if (jsonBody != null) {<NEW_LINE>Class<?> paraClass = <MASK><NEW_LINE>Object result = null;<NEW_LINE>try {<NEW_LINE>Type paraType = paraTypes[index];<NEW_LINE>if (paraType instanceof TypeVariable) {<NEW_LINE>Type variableRawType = getTypeVariableRawType(controller.getClass(), ((TypeVariable<?>) paraType));<NEW_LINE>if (variableRawType != null) {<NEW_LINE>paraClass = (Class<?>) variableRawType;<NEW_LINE>paraType = variableRawType;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>result = parseJsonBody(jsonObjectOrArray, paraClass, paraType, jsonBody.value());<NEW_LINE>} catch (Exception e) {<NEW_LINE>String message = "Can not parse \"" + parameters[index].getType() + "\" in method " + ClassUtil.buildMethodString(method) + ", Cause: " + e.getMessage();<NEW_LINE>if (jsonBody.skipConvertError()) {<NEW_LINE>LogKit.error(message);<NEW_LINE>} else {<NEW_LINE>throw new ActionException(400, RenderManager.me().getRenderFactory().getErrorRender(400), message);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>inv.setArg(index, result);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>inv.invoke();<NEW_LINE>} | parameters[index].getType(); |
1,123,796 | public static DescribeCustomLineResponse unmarshall(DescribeCustomLineResponse describeCustomLineResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeCustomLineResponse.setRequestId<MASK><NEW_LINE>describeCustomLineResponse.setId(_ctx.longValue("DescribeCustomLineResponse.Id"));<NEW_LINE>describeCustomLineResponse.setName(_ctx.stringValue("DescribeCustomLineResponse.Name"));<NEW_LINE>describeCustomLineResponse.setDomainName(_ctx.stringValue("DescribeCustomLineResponse.DomainName"));<NEW_LINE>describeCustomLineResponse.setCreateTime(_ctx.stringValue("DescribeCustomLineResponse.CreateTime"));<NEW_LINE>describeCustomLineResponse.setCreateTimestamp(_ctx.longValue("DescribeCustomLineResponse.CreateTimestamp"));<NEW_LINE>describeCustomLineResponse.setIpSegments(_ctx.stringValue("DescribeCustomLineResponse.IpSegments"));<NEW_LINE>describeCustomLineResponse.setCode(_ctx.stringValue("DescribeCustomLineResponse.Code"));<NEW_LINE>List<IpSegment> ipSegmentList = new ArrayList<IpSegment>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeCustomLineResponse.IpSegmentList.Length"); i++) {<NEW_LINE>IpSegment ipSegment = new IpSegment();<NEW_LINE>ipSegment.setName(_ctx.stringValue("DescribeCustomLineResponse.IpSegmentList[" + i + "].Name"));<NEW_LINE>ipSegment.setStartIp(_ctx.stringValue("DescribeCustomLineResponse.IpSegmentList[" + i + "].StartIp"));<NEW_LINE>ipSegment.setEndIp(_ctx.stringValue("DescribeCustomLineResponse.IpSegmentList[" + i + "].EndIp"));<NEW_LINE>ipSegmentList.add(ipSegment);<NEW_LINE>}<NEW_LINE>describeCustomLineResponse.setIpSegmentList(ipSegmentList);<NEW_LINE>return describeCustomLineResponse;<NEW_LINE>} | (_ctx.stringValue("DescribeCustomLineResponse.RequestId")); |
825,410 | public ServiceResponse serviceImpl(Query call, HttpServletResponse response, Authorization rights, final JsonObjectWithDefault permissions) throws APIException {<NEW_LINE>JSONObject result = new JSONObject(true);<NEW_LINE>result.put("accepted", false);<NEW_LINE>result.put("message", "Error: Unable to process you request");<NEW_LINE>// check if token exists<NEW_LINE>if (call.get("getParameters", false)) {<NEW_LINE>if (call.get("token", null) != null && !call.get("token", null).isEmpty()) {<NEW_LINE>ClientCredential credentialcheck = new ClientCredential(ClientCredential.Type.resetpass_token, call.get("token", null));<NEW_LINE>if (DAO.passwordreset.has(credentialcheck.toString())) {<NEW_LINE>Authentication authentication = new Authentication(credentialcheck, DAO.passwordreset);<NEW_LINE>if (authentication.checkExpireTime()) {<NEW_LINE>String passwordPattern = DAO.getConfig("users.password.regex", "^((?=.*\\d)(?=.*[A-Z])(?=.*\\W).{8,64})$");<NEW_LINE>String passwordPatternTooltip = DAO.getConfig("users.password.regex.tooltip", "Enter a combination of atleast 8 characters and atleast one special character, one number and one capital letter");<NEW_LINE>result.put("message", "Email ID: " + authentication.getIdentity().getName());<NEW_LINE>result.put("regex", passwordPattern);<NEW_LINE>result.put("regexTooltip", passwordPatternTooltip);<NEW_LINE>result.put("accepted", true);<NEW_LINE>return new ServiceResponse(result);<NEW_LINE>}<NEW_LINE>authentication.delete();<NEW_LINE>throw new APIException(401, "Expired token");<NEW_LINE>}<NEW_LINE>throw new APIException(422, "Invalid token");<NEW_LINE>} else {<NEW_LINE>throw new APIException(400, "No token specified");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String usermail = call.get("forgotemail", null);<NEW_LINE>ClientCredential credential = new ClientCredential(ClientCredential.Type.passwd_login, usermail);<NEW_LINE>ClientIdentity identity = new ClientIdentity(ClientIdentity.Type.email, credential.getName());<NEW_LINE>if (!DAO.hasAuthentication(credential)) {<NEW_LINE>throw new APIException(422, "email does not exist");<NEW_LINE>}<NEW_LINE>String token = createRandomString(30);<NEW_LINE>ClientCredential tokenkey = new ClientCredential(ClientCredential.Type.resetpass_token, token);<NEW_LINE>Authentication resetauth = new Authentication(tokenkey, DAO.passwordreset);<NEW_LINE>resetauth.setIdentity(identity);<NEW_LINE>resetauth.setExpireTime(7 * 24 * 60 * 60);<NEW_LINE><MASK><NEW_LINE>String subject = "Password Recovery";<NEW_LINE>try {<NEW_LINE>EmailHandler.sendEmail(usermail, subject, getVerificationMailContent(token));<NEW_LINE>result.put("accepted", true);<NEW_LINE>result.put("message", "Recovery email sent to your email ID. Please check");<NEW_LINE>} catch (Exception e) {<NEW_LINE>result.put("message", e.getMessage());<NEW_LINE>}<NEW_LINE>return new ServiceResponse(result);<NEW_LINE>} | resetauth.put("one_time", true); |
1,533,936 | private void registerNavigateSearchReceiver(@NonNull MapActivity mapActivity) {<NEW_LINE>final WeakReference<MapActivity> mapActivityRef = new WeakReference<>(mapActivity);<NEW_LINE>BroadcastReceiver navigateSearchReceiver = new BroadcastReceiver() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onReceive(Context context, Intent intent) {<NEW_LINE>String profileStr = intent.getStringExtra(AIDL_PROFILE);<NEW_LINE>final ApplicationMode profile = ApplicationMode.valueOfStringKey(profileStr, DEFAULT_PROFILE);<NEW_LINE>boolean validProfile = false;<NEW_LINE>for (ApplicationMode mode : VALID_PROFILES) {<NEW_LINE>if (mode == profile) {<NEW_LINE>validProfile = true;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>MapActivity mapActivity = mapActivityRef.get();<NEW_LINE>final String searchQuery = intent.getStringExtra(AIDL_SEARCH_QUERY);<NEW_LINE>if (mapActivity != null && validProfile && !Algorithms.isEmpty(searchQuery)) {<NEW_LINE>String startName = intent.getStringExtra(AIDL_START_NAME);<NEW_LINE>if (Algorithms.isEmpty(startName)) {<NEW_LINE>startName = "";<NEW_LINE>}<NEW_LINE>final LatLon start;<NEW_LINE>final PointDescription startDesc;<NEW_LINE>double startLat = intent.getDoubleExtra(AIDL_START_LAT, 0);<NEW_LINE>double startLon = intent.getDoubleExtra(AIDL_START_LON, 0);<NEW_LINE>if (startLat != 0 && startLon != 0) {<NEW_LINE>start = new LatLon(startLat, startLon);<NEW_LINE>startDesc = new PointDescription(PointDescription.POINT_TYPE_LOCATION, startName);<NEW_LINE>} else {<NEW_LINE>start = null;<NEW_LINE>startDesc = null;<NEW_LINE>}<NEW_LINE>final LatLon searchLocation;<NEW_LINE>double searchLat = intent.getDoubleExtra(AIDL_SEARCH_LAT, 0);<NEW_LINE>double searchLon = <MASK><NEW_LINE>if (searchLat != 0 && searchLon != 0) {<NEW_LINE>searchLocation = new LatLon(searchLat, searchLon);<NEW_LINE>} else {<NEW_LINE>searchLocation = null;<NEW_LINE>}<NEW_LINE>if (searchLocation != null) {<NEW_LINE>final RoutingHelper routingHelper = app.getRoutingHelper();<NEW_LINE>boolean force = intent.getBooleanExtra(AIDL_FORCE, true);<NEW_LINE>final boolean locationPermission = intent.getBooleanExtra(AIDL_LOCATION_PERMISSION, false);<NEW_LINE>if (routingHelper.isFollowingMode() && !force) {<NEW_LINE>mapActivity.getMapActions().stopNavigationActionConfirm(dialog -> {<NEW_LINE>MapActivity mapActivity1 = mapActivityRef.get();<NEW_LINE>if (mapActivity1 != null && !routingHelper.isFollowingMode()) {<NEW_LINE>ExternalApiHelper.searchAndNavigate(mapActivity1, searchLocation, start, startDesc, profile, searchQuery, false, locationPermission);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} else {<NEW_LINE>ExternalApiHelper.searchAndNavigate(mapActivity, searchLocation, start, startDesc, profile, searchQuery, false, locationPermission);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>registerReceiver(navigateSearchReceiver, mapActivity, AIDL_NAVIGATE_SEARCH);<NEW_LINE>} | intent.getDoubleExtra(AIDL_SEARCH_LON, 0); |
1,478,525 | CompilationSupport registerFullyLinkAction(ObjcProvider objcProvider, Artifact outputArchive) throws InterruptedException, RuleErrorException {<NEW_LINE>checkNotNull(toolchain);<NEW_LINE>checkNotNull(toolchain.getFdoContext());<NEW_LINE>ObjcVariablesExtension extension = new ObjcVariablesExtension.Builder().setRuleContext(ruleContext).setObjcProvider(objcProvider).setConfiguration(buildConfiguration).setIntermediateArtifacts(intermediateArtifacts).setFullyLinkArchive(outputArchive).addVariableCategory(VariableCategory.FULLY_LINK_VARIABLES).build();<NEW_LINE>Label archiveLabel = null;<NEW_LINE>try {<NEW_LINE>archiveLabel = Label.create(ruleContext.getLabel().getPackageIdentifier(), FileSystemUtils.removeExtension<MASK><NEW_LINE>} catch (LabelSyntaxException e) {<NEW_LINE>// Formed from existing label, just replacing name with artifact name.<NEW_LINE>}<NEW_LINE>new CcLinkingHelper(ruleContext, archiveLabel, ruleContext, ruleContext, cppSemantics, getFeatureConfiguration(ruleContext, toolchain, buildConfiguration, cppSemantics), toolchain, toolchain.getFdoContext(), buildConfiguration, buildConfiguration.getFragment(CppConfiguration.class), ruleContext.getSymbolGenerator(), TargetUtils.getExecutionInfo(ruleContext.getRule(), ruleContext.isAllowTagsPropagation())).setGrepIncludes(CppHelper.getGrepIncludes(ruleContext)).setIsStampingEnabled(AnalysisUtils.isStampingEnabled(ruleContext)).setTestOrTestOnlyTarget(ruleContext.isTestOnlyTarget() || ruleContext.isTestTarget()).addNonCodeLinkerInputs(objcProvider.getObjcLibraries()).addNonCodeLinkerInputs(objcProvider.getCcLibraries()).addTransitiveAdditionalLinkerInputs(objcProvider.get(IMPORTED_LIBRARY)).setLinkingMode(LinkingMode.STATIC).setStaticLinkType(LinkTargetType.OBJC_FULLY_LINKED_ARCHIVE).setShouldCreateDynamicLibrary(false).addVariableExtension(extension).link(CcCompilationOutputs.EMPTY);<NEW_LINE>return this;<NEW_LINE>} | (outputArchive.getFilename())); |
645,451 | final DisassociateBotResult executeDisassociateBot(DisassociateBotRequest disassociateBotRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(disassociateBotRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DisassociateBotRequest> request = null;<NEW_LINE>Response<DisassociateBotResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DisassociateBotRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(disassociateBotRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Connect");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DisassociateBot");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DisassociateBotResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DisassociateBotResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint); |
1,063,314 | public void renderToBuffer(PoseStack matrixStackIn, VertexConsumer vertexBuilder, int packedLightIn, int packedOverlayIn, float red, float green, float blue, float alpha) {<NEW_LINE>if (base != null) {<NEW_LINE>matrixStackIn.pushPose();<NEW_LINE>matrixStackIn.translate(0.0D, base.young ? -0.015D : -0.02D, 0.0D);<NEW_LINE>matrixStackIn.scale(1.01f, 1.0f, 1.01f);<NEW_LINE>base.renderToBuffer(matrixStackIn, vertexBuilder, packedLightIn, packedOverlayIn, red, green, blue, alpha);<NEW_LINE>matrixStackIn.popPose();<NEW_LINE>if (headModel != null && headTexture != null && ArmorModelHelper.buffer != null) {<NEW_LINE>VertexConsumer headBuilder = ItemRenderer.getArmorFoilBuffer(ArmorModelHelper.buffer, RenderType.entityCutoutNoCullZOffset(headTexture), false, hasGlint);<NEW_LINE>boolean needsPush = base.young || base.crouching;<NEW_LINE>if (needsPush) {<NEW_LINE>matrixStackIn.pushPose();<NEW_LINE>if (base.young) {<NEW_LINE>matrixStackIn.scale(0.75F, 0.75F, 0.75F);<NEW_LINE>matrixStackIn.translate(0.0D, 1.0D, 0.0D);<NEW_LINE>}<NEW_LINE>if (base.crouching) {<NEW_LINE>matrixStackIn.translate(0, base.head.y / 16.0F, 0);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>headModel.setupAnim(0, base.head.yRot * 180f / (float) (Math.PI), base.head.xRot * 180f / (<MASK><NEW_LINE>headModel.renderToBuffer(matrixStackIn, headBuilder, packedLightIn, packedOverlayIn, red, green * 0.5f, blue, alpha * 0.8f);<NEW_LINE>if (needsPush) {<NEW_LINE>matrixStackIn.popPose();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | float) (Math.PI)); |
442,654 | public void userEventTriggered(@NotNull final ChannelHandlerContext ctx, @NotNull final Object evt) throws Exception {<NEW_LINE>if (!(evt instanceof SslHandshakeCompletionEvent)) {<NEW_LINE><MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final SslHandshakeCompletionEvent sslHandshakeCompletionEvent = (SslHandshakeCompletionEvent) evt;<NEW_LINE>if (!sslHandshakeCompletionEvent.isSuccess()) {<NEW_LINE>log.trace("Handshake failed", sslHandshakeCompletionEvent.cause());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final Channel channel = ctx.channel();<NEW_LINE>try {<NEW_LINE>final SslHandler sslHandler = (SslHandler) channel.pipeline().get(ChannelHandlerNames.SSL_HANDLER);<NEW_LINE>final SSLSession session = sslHandler.engine().getSession();<NEW_LINE>final Certificate[] peerCertificates = session.getPeerCertificates();<NEW_LINE>final SslClientCertificate sslClientCertificate = new SslClientCertificateImpl(peerCertificates);<NEW_LINE>channel.attr(ChannelAttributes.CLIENT_CONNECTION).get().setAuthCertificate(sslClientCertificate);<NEW_LINE>} catch (final SSLPeerUnverifiedException e) {<NEW_LINE>handleSslPeerUnverifiedException(channel, e);<NEW_LINE>} catch (final ClassCastException e2) {<NEW_LINE>// no logging needed as we rethrow it as a RuntimeException<NEW_LINE>mqttServerDisconnector.// no logging needed as we rethrow it as a RuntimeException<NEW_LINE>logAndClose(// no logging needed as we rethrow it as a RuntimeException<NEW_LINE>channel, null, "SSL handshake failed");<NEW_LINE>throw new RuntimeException("Not able to get SslHandler from pipeline", e2);<NEW_LINE>}<NEW_LINE>channel.pipeline().remove(this);<NEW_LINE>} | super.userEventTriggered(ctx, evt); |
554,875 | public static String format(Channel channel, String msg) {<NEW_LINE><MASK><NEW_LINE>Objects.requireNonNull(msg, "msg");<NEW_LINE>if (LOG_CHANNEL_INFO) {<NEW_LINE>String channelStr;<NEW_LINE>StringBuilder result;<NEW_LINE>Connection connection = Connection.from(channel);<NEW_LINE>if (connection instanceof ChannelOperationsId) {<NEW_LINE>channelStr = ((ChannelOperationsId) connection).asLongText();<NEW_LINE>if (channelStr.charAt(0) != TRACE_ID_PREFIX) {<NEW_LINE>result = new StringBuilder(1 + channelStr.length() + 2 + msg.length()).append(CHANNEL_ID_PREFIX).append(channelStr).append(CHANNEL_ID_SUFFIX_1);<NEW_LINE>} else {<NEW_LINE>result = new StringBuilder(channelStr.length() + 1 + msg.length()).append(channelStr).append(CHANNEL_ID_SUFFIX_2);<NEW_LINE>}<NEW_LINE>return result.append(msg).toString();<NEW_LINE>} else {<NEW_LINE>channelStr = channel.toString();<NEW_LINE>if (channelStr.charAt(0) == CHANNEL_ID_PREFIX) {<NEW_LINE>channelStr = channelStr.substring(ORIGINAL_CHANNEL_ID_PREFIX_LENGTH);<NEW_LINE>result = new StringBuilder(1 + channelStr.length() + 1 + msg.length()).append(CHANNEL_ID_PREFIX).append(channelStr);<NEW_LINE>} else {<NEW_LINE>int ind = channelStr.indexOf(ORIGINAL_CHANNEL_ID_PREFIX);<NEW_LINE>result = new StringBuilder(1 + (channelStr.length() - ORIGINAL_CHANNEL_ID_PREFIX_LENGTH) + 1 + msg.length()).append(channelStr.substring(0, ind)).append(CHANNEL_ID_PREFIX).append(channelStr.substring(ind + ORIGINAL_CHANNEL_ID_PREFIX_LENGTH));<NEW_LINE>}<NEW_LINE>return result.append(CHANNEL_ID_SUFFIX_2).append(msg).toString();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>return msg;<NEW_LINE>}<NEW_LINE>} | Objects.requireNonNull(channel, "channel"); |
548,426 | public RemoteActionResult executeRemotely(RemoteAction action, boolean acceptCachedResult, OperationObserver observer) throws IOException, InterruptedException {<NEW_LINE>checkState(!shutdown.get(), "shutdown");<NEW_LINE>checkState(mayBeExecutedRemotely(action.spawn), "spawn can't be executed remotely");<NEW_LINE>ExecuteRequest.Builder requestBuilder = ExecuteRequest.newBuilder().setInstanceName(remoteOptions.remoteInstanceName).setActionDigest(action.actionKey.getDigest(<MASK><NEW_LINE>if (remoteOptions.remoteResultCachePriority != 0) {<NEW_LINE>requestBuilder.getResultsCachePolicyBuilder().setPriority(remoteOptions.remoteResultCachePriority);<NEW_LINE>}<NEW_LINE>if (remoteOptions.remoteExecutionPriority != 0) {<NEW_LINE>requestBuilder.getExecutionPolicyBuilder().setPriority(remoteOptions.remoteExecutionPriority);<NEW_LINE>}<NEW_LINE>ExecuteRequest request = requestBuilder.build();<NEW_LINE>ExecuteResponse reply = remoteExecutor.executeRemotely(action.remoteActionExecutionContext, request, observer);<NEW_LINE>return RemoteActionResult.createFromResponse(reply);<NEW_LINE>} | )).setSkipCacheLookup(!acceptCachedResult); |
65,122 | private void buildExternalFunctionElement(Element parent, ProductExternalFunction function) {<NEW_LINE>if (!function.isValid()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Element functionElem = dom.createElement("extfn");<NEW_LINE>if (function.getName() != null && function.getName().length() > 0) {<NEW_LINE>// <fname> ... </fname><NEW_LINE>createChildElement(functionElem, "fname", function.getName());<NEW_LINE>}<NEW_LINE>// for inputs<NEW_LINE>Element inputsElem = dom.createElement("inputs");<NEW_LINE>for (ProductVar eachInput : function.getInputs()) {<NEW_LINE>if (eachInput != null && !"".equals(eachInput.getName())) {<NEW_LINE>inputsElem.appendChild(createVarElement(eachInput));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>functionElem.appendChild(inputsElem);<NEW_LINE>// for outputs<NEW_LINE>Element outputsElem = dom.createElement("outputs");<NEW_LINE>for (ProductMeasurement eachOutput : function.getOutputs()) {<NEW_LINE>if (eachOutput != null && eachOutput.isValid()) {<NEW_LINE>Element measurementElem = dom.createElement("measurement");<NEW_LINE>// <var>...</var><NEW_LINE>createChildElement(measurementElem, <MASK><NEW_LINE>// The units element is OPTIONAL and can be null,<NEW_LINE>// indicating that the user doesn't want units conversion.<NEW_LINE>String outPutUnits = eachOutput.getUnits();<NEW_LINE>if (outPutUnits != null) {<NEW_LINE>createChildElement(measurementElem, "units", outPutUnits);<NEW_LINE>}<NEW_LINE>outputsElem.appendChild(measurementElem);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>functionElem.appendChild(outputsElem);<NEW_LINE>parent.appendChild(functionElem);<NEW_LINE>} | "var", eachOutput.getName()); |
795,307 | public static HippyArray fromArray(Object array) {<NEW_LINE>HippyArray catalystArray = new HippyArray();<NEW_LINE>int length;<NEW_LINE>int index;<NEW_LINE>if (array instanceof String[]) {<NEW_LINE>String[] strs = (String[]) array;<NEW_LINE>length = strs.length;<NEW_LINE>for (index = 0; index < length; ++index) {<NEW_LINE>String str = strs[index];<NEW_LINE>catalystArray.pushString(str);<NEW_LINE>}<NEW_LINE>} else if (array instanceof Parcelable[]) {<NEW_LINE>Parcelable[] <MASK><NEW_LINE>length = parcelables.length;<NEW_LINE>for (index = 0; index < length; ++index) {<NEW_LINE>Parcelable parcelable = parcelables[index];<NEW_LINE>if (parcelable instanceof Bundle) {<NEW_LINE>catalystArray.pushMap(fromBundle((Bundle) parcelable));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (array instanceof int[]) {<NEW_LINE>int[] ints = (int[]) array;<NEW_LINE>length = ints.length;<NEW_LINE>for (index = 0; index < length; ++index) {<NEW_LINE>int value = ints[index];<NEW_LINE>catalystArray.pushInt(value);<NEW_LINE>}<NEW_LINE>} else if (array instanceof float[]) {<NEW_LINE>float[] values = (float[]) array;<NEW_LINE>length = values.length;<NEW_LINE>for (index = 0; index < length; ++index) {<NEW_LINE>float value = values[index];<NEW_LINE>catalystArray.pushDouble(value);<NEW_LINE>}<NEW_LINE>} else if (array instanceof double[]) {<NEW_LINE>double[] values = (double[]) array;<NEW_LINE>length = values.length;<NEW_LINE>for (index = 0; index < length; ++index) {<NEW_LINE>double value = values[index];<NEW_LINE>catalystArray.pushDouble(value);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (!(array instanceof boolean[])) {<NEW_LINE>throw new IllegalArgumentException("Unknown array type " + array.getClass());<NEW_LINE>}<NEW_LINE>boolean[] values = (boolean[]) array;<NEW_LINE>length = values.length;<NEW_LINE>for (index = 0; index < length; ++index) {<NEW_LINE>boolean value = values[index];<NEW_LINE>catalystArray.pushBoolean(value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return catalystArray;<NEW_LINE>} | parcelables = (Parcelable[]) array; |
289,086 | static void selectNextPrev(final boolean next, boolean isQuery, JTree tree) {<NEW_LINE>int[] rows = tree.getSelectionRows();<NEW_LINE>int newRow = rows == null || rows.length == 0 ? 0 : rows[0];<NEW_LINE><MASK><NEW_LINE>CheckNode node;<NEW_LINE>do {<NEW_LINE>if (next) {<NEW_LINE>newRow++;<NEW_LINE>if (newRow >= maxcount) {<NEW_LINE>newRow = 0;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>newRow--;<NEW_LINE>if (newRow < 0) {<NEW_LINE>newRow = maxcount - 1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>TreePath path = tree.getPathForRow(newRow);<NEW_LINE>node = (CheckNode) path.getLastPathComponent();<NEW_LINE>if (!node.isLeaf()) {<NEW_LINE>tree.expandRow(newRow);<NEW_LINE>maxcount = tree.getRowCount();<NEW_LINE>}<NEW_LINE>} while (!node.isLeaf());<NEW_LINE>tree.setSelectionRow(newRow);<NEW_LINE>tree.scrollRowToVisible(newRow);<NEW_LINE>if (isQuery) {<NEW_LINE>CheckNodeListener.findInSource(node);<NEW_LINE>} else {<NEW_LINE>CheckNodeListener.openDiff(node);<NEW_LINE>}<NEW_LINE>} | int maxcount = tree.getRowCount(); |
1,194,213 | // addSchemeIdColumn.<NEW_LINE>private void createWorkflowActionStepTable(final DotConnect dc) throws DotDataException {<NEW_LINE>boolean needToCreate = false;<NEW_LINE>Logger.info(this, "Creating intermediate 'workflow_action_step' table.");<NEW_LINE>try {<NEW_LINE>if (DbConnectionFactory.isMsSql() && !DbConnectionFactory.getAutoCommit()) {<NEW_LINE>DbConnectionFactory.setAutoCommit(true);<NEW_LINE>}<NEW_LINE>dc.setSQL(<MASK><NEW_LINE>} catch (Throwable e) {<NEW_LINE>Logger.info(this, "Table 'workflow_action_step' does not exists, creating it");<NEW_LINE>needToCreate = true;<NEW_LINE>// in some databases if an error is throw the transaction is not longer valid<NEW_LINE>this.closeAndStartTransaction();<NEW_LINE>}<NEW_LINE>if (needToCreate) {<NEW_LINE>try {<NEW_LINE>if (DbConnectionFactory.isMsSql() && !DbConnectionFactory.getAutoCommit()) {<NEW_LINE>DbConnectionFactory.setAutoCommit(true);<NEW_LINE>}<NEW_LINE>dc.setSQL(createIntermediateTable()).loadResult();<NEW_LINE>// The SQL Server and Oracle table definition already include de PK creation<NEW_LINE>if (DbConnectionFactory.isMySql() || DbConnectionFactory.isPostgres()) {<NEW_LINE>dc.setSQL(createIntermediateTablePk()).loadResult();<NEW_LINE>}<NEW_LINE>// adding the FK<NEW_LINE>Logger.info(this, "Creating the Workflow action step intermediate FKs.");<NEW_LINE>dc.setSQL(this.createIntermediateTableForeignKeyActionId()).loadResult();<NEW_LINE>dc.setSQL(this.createIntermediateTableForeignKeyStepId()).loadResult();<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new DotRuntimeException("The 'workflow_action_step' table could not be created.", e);<NEW_LINE>} finally {<NEW_LINE>this.closeCommitAndStartTransaction();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | findIntermediateTable()).loadObjectResults(); |
1,352,170 | void onMultiSqlStart(BackendConnection connection) {<NEW_LINE>LinkedList<String> splitSql = new LinkedList<>();<NEW_LINE>ServerParseFactory.getRwSplitParser().getMultiStatement(<MASK><NEW_LINE>if (splitSql.isEmpty()) {<NEW_LINE>multiFrontendSqlEntry = null;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>long time = System.nanoTime();<NEW_LINE>if (txEntry == null) {<NEW_LINE>txEntry = new StatisticTxEntry(frontendInfo, xaId, txid, time, true);<NEW_LINE>}<NEW_LINE>for (String sql : splitSql) {<NEW_LINE>StatisticFrontendSqlEntry frontendSqlEntry = new StatisticFrontendSqlEntry(frontendInfo, time);<NEW_LINE>frontendSqlEntry.put("&statistic_rw_key", new StatisticBackendSqlEntry(frontendInfo, ((MySQLInstance) connection.getInstance()).getName(), connection.getHost(), connection.getPort(), "-", sql, time));<NEW_LINE>frontendSqlEntry.setSql(sql);<NEW_LINE>frontendSqlEntry.setSchema(frontendSqlEntry.getSchema());<NEW_LINE>frontendSqlEntry.setTxId(txid);<NEW_LINE>frontendSqlEntry.setNeedToTx(false);<NEW_LINE>multiFrontendSqlEntry.add(frontendSqlEntry);<NEW_LINE>}<NEW_LINE>frontendSqlEntry = null;<NEW_LINE>} | frontendSqlEntry.getSql(), splitSql); |
1,441,845 | protected void calculatePath(RouterOperation routerOperation, Locale locale, OpenAPI openAPI) {<NEW_LINE>String operationPath = routerOperation.getPath();<NEW_LINE>io.swagger.v3.oas.annotations.Operation apiOperation = routerOperation.getOperation();<NEW_LINE>String[] methodConsumes = routerOperation.getConsumes();<NEW_LINE>String[] methodProduces = routerOperation.getProduces();<NEW_LINE>String[<MASK><NEW_LINE>Map<String, String> queryParams = routerOperation.getQueryParams();<NEW_LINE>Paths paths = openAPI.getPaths();<NEW_LINE>Map<HttpMethod, Operation> operationMap = null;<NEW_LINE>if (paths.containsKey(operationPath)) {<NEW_LINE>PathItem pathItem = paths.get(operationPath);<NEW_LINE>operationMap = pathItem.readOperationsMap();<NEW_LINE>}<NEW_LINE>for (RequestMethod requestMethod : routerOperation.getMethods()) {<NEW_LINE>Operation existingOperation = getExistingOperation(operationMap, requestMethod);<NEW_LINE>MethodAttributes methodAttributes = new MethodAttributes(springDocConfigProperties.getDefaultConsumesMediaType(), springDocConfigProperties.getDefaultProducesMediaType(), methodConsumes, methodProduces, headers, locale);<NEW_LINE>methodAttributes.setMethodOverloaded(existingOperation != null);<NEW_LINE>Operation operation = getOperation(routerOperation, existingOperation);<NEW_LINE>if (apiOperation != null)<NEW_LINE>openAPI = operationParser.parse(apiOperation, operation, openAPI, methodAttributes);<NEW_LINE>String operationId = operationParser.getOperationId(operation.getOperationId(), openAPI);<NEW_LINE>operation.setOperationId(operationId);<NEW_LINE>fillParametersList(operation, queryParams, methodAttributes);<NEW_LINE>if (!CollectionUtils.isEmpty(operation.getParameters()))<NEW_LINE>operation.getParameters().stream().filter(parameter -> StringUtils.isEmpty(parameter.get$ref())).forEach(parameter -> {<NEW_LINE>if (parameter.getSchema() == null)<NEW_LINE>parameter.setSchema(new StringSchema());<NEW_LINE>if (parameter.getIn() == null)<NEW_LINE>parameter.setIn(ParameterIn.QUERY.toString());<NEW_LINE>});<NEW_LINE>PathItem pathItemObject = buildPathItem(requestMethod, operation, operationPath, paths);<NEW_LINE>paths.addPathItem(operationPath, pathItemObject);<NEW_LINE>}<NEW_LINE>} | ] headers = routerOperation.getHeaders(); |
1,576,700 | public static ListUserAnalyzersResponse unmarshall(ListUserAnalyzersResponse listUserAnalyzersResponse, UnmarshallerContext _ctx) {<NEW_LINE>listUserAnalyzersResponse.setRequestId(_ctx.stringValue("ListUserAnalyzersResponse.requestId"));<NEW_LINE>listUserAnalyzersResponse.setTotalCount(_ctx.integerValue("ListUserAnalyzersResponse.totalCount"));<NEW_LINE>List<ResultItem> result = new ArrayList<ResultItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListUserAnalyzersResponse.result.Length"); i++) {<NEW_LINE>ResultItem resultItem = new ResultItem();<NEW_LINE>resultItem.setId(_ctx.stringValue("ListUserAnalyzersResponse.result[" + i + "].id"));<NEW_LINE>resultItem.setName(_ctx.stringValue("ListUserAnalyzersResponse.result[" + i + "].name"));<NEW_LINE>resultItem.setBusiness(_ctx.stringValue("ListUserAnalyzersResponse.result[" + i + "].business"));<NEW_LINE>resultItem.setAvailable(_ctx.booleanValue("ListUserAnalyzersResponse.result[" + i + "].available"));<NEW_LINE>resultItem.setCreated(_ctx.integerValue("ListUserAnalyzersResponse.result[" + i + "].created"));<NEW_LINE>resultItem.setUpdated(_ctx.integerValue<MASK><NEW_LINE>List<DictsItem> dicts = new ArrayList<DictsItem>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("ListUserAnalyzersResponse.result[" + i + "].dicts.Length"); j++) {<NEW_LINE>DictsItem dictsItem = new DictsItem();<NEW_LINE>dictsItem.setId(_ctx.stringValue("ListUserAnalyzersResponse.result[" + i + "].dicts[" + j + "].id"));<NEW_LINE>dictsItem.setType(_ctx.stringValue("ListUserAnalyzersResponse.result[" + i + "].dicts[" + j + "].type"));<NEW_LINE>dictsItem.setEntriesLimit(_ctx.integerValue("ListUserAnalyzersResponse.result[" + i + "].dicts[" + j + "].entriesLimit"));<NEW_LINE>dictsItem.setEntriesCount(_ctx.integerValue("ListUserAnalyzersResponse.result[" + i + "].dicts[" + j + "].entriesCount"));<NEW_LINE>dictsItem.setAvailable(_ctx.booleanValue("ListUserAnalyzersResponse.result[" + i + "].dicts[" + j + "].available"));<NEW_LINE>dictsItem.setCreated(_ctx.integerValue("ListUserAnalyzersResponse.result[" + i + "].dicts[" + j + "].created"));<NEW_LINE>dictsItem.setUpdated(_ctx.integerValue("ListUserAnalyzersResponse.result[" + i + "].dicts[" + j + "].updated"));<NEW_LINE>dicts.add(dictsItem);<NEW_LINE>}<NEW_LINE>resultItem.setDicts(dicts);<NEW_LINE>result.add(resultItem);<NEW_LINE>}<NEW_LINE>listUserAnalyzersResponse.setResult(result);<NEW_LINE>return listUserAnalyzersResponse;<NEW_LINE>} | ("ListUserAnalyzersResponse.result[" + i + "].updated")); |
1,412,377 | private DETAILXlief createDETAILXliefForLineAndPack(@NonNull final EDIExpDesadvType xmlDesadv, @NonNull final LineAndPack lineAndPack, @NonNull final DesadvSettings settings, @NonNull final DecimalFormat decimalFormat, @NonNull final String dateFormat) {<NEW_LINE>final EDIExpDesadvLineType line = lineAndPack.getLine();<NEW_LINE>final DETAILXlief detail = createDetailAndAddLineData(xmlDesadv, line, settings, decimalFormat);<NEW_LINE>final <MASK><NEW_LINE>final String lineNumber = extractLineNumber(line, decimalFormat);<NEW_LINE>final BigDecimal qtyDelivered = extractQtyDelivered(lineAndPack.getPack());<NEW_LINE>final DQUAN1 cuQuantity = createQuantityDetail(documentId, lineNumber, QuantityQual.DELV);<NEW_LINE>cuQuantity.setQUANTITY(formatNumber(qtyDelivered, decimalFormat));<NEW_LINE>// we set some of cuQuantity's properties in the following if-else-blocks<NEW_LINE>detail.getDQUAN1().add(cuQuantity);<NEW_LINE>if (lineAndPack.hasPack()) {<NEW_LINE>final EDIExpDesadvLinePackType pack = lineAndPack.getPack();<NEW_LINE>final String measurementUnitName = extractMeasurementUnitOrNull(pack.getCUOMID(), line, settings);<NEW_LINE>cuQuantity.setMEASUREMENTUNIT(measurementUnitName);<NEW_LINE>if (settings.isDesadvLineCUTURequired()) {<NEW_LINE>final BigDecimal qtyItemCapacity = validateObject(pack.getQtyCU(), "@FillMandatory@ @EDI_DesadvLine_ID@=" + line.getLine() + " @QtyCU@");<NEW_LINE>final DQUAN1 cuTuQuantity = createQuantityDetail(documentId, lineNumber, QuantityQual.CUTU);<NEW_LINE>cuTuQuantity.setQUANTITY(formatNumber(qtyItemCapacity, decimalFormat));<NEW_LINE>cuTuQuantity.setMEASUREMENTUNIT(measurementUnitName);<NEW_LINE>detail.getDQUAN1().add(cuTuQuantity);<NEW_LINE>}<NEW_LINE>final //<NEW_LINE>boolean //<NEW_LINE>dmark1Required = settings.isDesadvLineDMARK1BestBeforeDateRequired() || settings.isDesadvLineDMARK1BatchNoRequired();<NEW_LINE>if (dmark1Required) {<NEW_LINE>final String lotNumber = validateString(pack.getLotNumber(), "@FillMandatory@ @EDI_DesadvLine_ID@=" + line.getLine() + " @LotNumber@");<NEW_LINE>final DMARK1 dmark1 = DESADV_objectFactory.createDMARK1();<NEW_LINE>dmark1.setDOCUMENTID(documentId);<NEW_LINE>dmark1.setLINENUMBER(lineNumber);<NEW_LINE>dmark1.setIDENTIFICATIONQUAL(IdentificationQual.BATC.name());<NEW_LINE>dmark1.setIDENTIFICATIONCODE(lotNumber);<NEW_LINE>if (settings.isDesadvLineDMARK1BestBeforeDateRequired()) {<NEW_LINE>final XMLGregorianCalendar bestBefore = validateObject(pack.getBestBeforeDate(), "@FillMandatory@ @EDI_DesadvLine_ID@=" + line.getLine() + " @BestBeforeDate@");<NEW_LINE>dmark1.setIDENTIFICATIONDATE1(toFormattedStringDate(toDate(bestBefore), dateFormat));<NEW_LINE>}<NEW_LINE>detail.getDMARK1().add(dmark1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return detail;<NEW_LINE>} | String documentId = xmlDesadv.getDocumentNo(); |
1,322,397 | protected void translateCore(final ITranslationEnvironment environment, final IInstruction instruction, final List<ReilInstruction> instructions) {<NEW_LINE>final IOperandTreeNode registerOperand1 = instruction.getOperands().get(0).getRootNode().getChildren().get(0);<NEW_LINE>final IOperandTreeNode registerOperand2 = instruction.getOperands().get(1).getRootNode().getChildren().get(0);<NEW_LINE>final IOperandTreeNode registerOperand3 = instruction.getOperands().get(2).getRootNode().getChildren().get(0);<NEW_LINE>final String targetRegister = (registerOperand1.getValue());<NEW_LINE>final String sourceRegister1 = (registerOperand2.getValue());<NEW_LINE>final String sourceRegister2 = (registerOperand3.getValue());<NEW_LINE>final OperandSize wd = OperandSize.WORD;<NEW_LINE>final OperandSize dw = OperandSize.DWORD;<NEW_LINE>final OperandSize qw = OperandSize.QWORD;<NEW_LINE>long baseOffset = ReilHelpers.nextReilAddress(instruction, instructions);<NEW_LINE>final String operand2 = environment.getNextVariableString();<NEW_LINE>final String tmpVar1 = environment.getNextVariableString();<NEW_LINE>final String tmpVar2 = environment.getNextVariableString();<NEW_LINE>final String trueTmpResult = environment.getNextVariableString();<NEW_LINE>final String tmpResult = environment.getNextVariableString();<NEW_LINE>if (instruction.getMnemonic().contains("B")) {<NEW_LINE>Helpers.signExtend(baseOffset, environment, instruction, instructions, dw, sourceRegister2, dw, operand2, 16);<NEW_LINE>} else {<NEW_LINE>instructions.add(ReilHelpers.createBsh(baseOffset++, dw, sourceRegister2, wd, String.valueOf(-16L), dw, tmpVar1));<NEW_LINE>Helpers.signExtend(baseOffset, environment, instruction, instructions, dw, tmpVar1, dw, operand2, 16);<NEW_LINE>}<NEW_LINE>baseOffset = ReilHelpers.nextReilAddress(instruction, instructions);<NEW_LINE>Helpers.signedMul(baseOffset, environment, instruction, instructions, dw, sourceRegister1, dw, operand2, qw, tmpResult);<NEW_LINE>baseOffset = <MASK><NEW_LINE>instructions.add(ReilHelpers.createBsh(baseOffset++, qw, trueTmpResult, wd, String.valueOf(-16L), qw, tmpVar2));<NEW_LINE>instructions.add(ReilHelpers.createAnd(baseOffset++, qw, tmpVar2, dw, String.valueOf(0xFFFFFFFFL), dw, targetRegister));<NEW_LINE>} | ReilHelpers.nextReilAddress(instruction, instructions); |
1,348,801 | final GetProtocolsListResult executeGetProtocolsList(GetProtocolsListRequest getProtocolsListRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getProtocolsListRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetProtocolsListRequest> request = null;<NEW_LINE>Response<GetProtocolsListResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetProtocolsListRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getProtocolsListRequest));<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, "GetProtocolsList");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetProtocolsListResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetProtocolsListResultJsonUnmarshaller());<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, "FMS"); |
598,775 | /*<NEW_LINE>* (non-Javadoc)<NEW_LINE>*<NEW_LINE>* @see<NEW_LINE>* com.impetus.client.cassandra.query.ResultIterator#populateEntities(com<NEW_LINE>* .impetus.kundera.metadata.model.EntityMetadata,<NEW_LINE>* com.impetus.kundera.client.Client)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>protected List<E> populateEntities(EntityMetadata m, Client client) throws Exception {<NEW_LINE>int count = 0;<NEW_LINE>List results = new ArrayList();<NEW_LINE>MetamodelImpl metaModel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata().getMetamodel(m.getPersistenceUnit());<NEW_LINE>EntityType entityType = metaModel.entity(entityMetadata.getEntityClazz());<NEW_LINE>Map<String, Object> relationalValues = new HashMap<String, Object>();<NEW_LINE>if (rSet == null) {<NEW_LINE>String parsedQuery = query.onQueryOverCQL3(m, client, metaModel, null);<NEW_LINE>Statement statement = new SimpleStatement(parsedQuery);<NEW_LINE>statement.setFetchSize(fetchSize);<NEW_LINE>rSet = ((DSClient) client).executeStatement(statement);<NEW_LINE>rowIter = rSet.iterator();<NEW_LINE>}<NEW_LINE>while (rowIter.hasNext() && count++ < fetchSize) {<NEW_LINE>Object entity = null;<NEW_LINE><MASK><NEW_LINE>((DSClient) client).populateObjectFromRow(entityMetadata, metaModel, entityType, results, relationalValues, entity, row);<NEW_LINE>}<NEW_LINE>return results;<NEW_LINE>} | Row row = rowIter.next(); |
1,596,018 | void snapshotSession(final ClusterSession session) {<NEW_LINE>final String responseChannel = session.responseChannel();<NEW_LINE>final int length = MessageHeaderEncoder.ENCODED_LENGTH + ClusterSessionEncoder.BLOCK_LENGTH + ClusterSessionEncoder.responseChannelHeaderLength<MASK><NEW_LINE>idleStrategy.reset();<NEW_LINE>while (true) {<NEW_LINE>final long result = publication.tryClaim(length, bufferClaim);<NEW_LINE>if (result > 0) {<NEW_LINE>clusterSessionEncoder.wrapAndApplyHeader(bufferClaim.buffer(), bufferClaim.offset(), messageHeaderEncoder).clusterSessionId(session.id()).correlationId(session.correlationId()).openedLogPosition(session.openedLogPosition()).timeOfLastActivity(session.timeOfLastActivityNs()).closeReason(session.closeReason()).responseStreamId(session.responseStreamId()).responseChannel(responseChannel);<NEW_LINE>bufferClaim.commit();<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>checkResultAndIdle(result);<NEW_LINE>}<NEW_LINE>} | () + responseChannel.length(); |
1,301,984 | public ResponseEntity<Void> addPetWithHttpInfo(Pet body) throws RestClientException {<NEW_LINE>Object postBody = body;<NEW_LINE>// verify the required parameter 'body' is set<NEW_LINE>if (body == null) {<NEW_LINE>throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling addPet");<NEW_LINE>}<NEW_LINE>String path = apiClient.expandPath("/pet", Collections.<String, Object>emptyMap());<NEW_LINE>final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();<NEW_LINE>final HttpHeaders headerParams = new HttpHeaders();<NEW_LINE>final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();<NEW_LINE>final MultiValueMap formParams = new LinkedMultiValueMap();<NEW_LINE>final String[] accepts = {};<NEW_LINE>final List<MediaType> accept = apiClient.selectHeaderAccept(accepts);<NEW_LINE>final String[] contentTypes = { "application/json", "application/xml" };<NEW_LINE>final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);<NEW_LINE>String[] authNames = new String[] { "petstore_auth" };<NEW_LINE>ParameterizedTypeReference<Void> returnType = new ParameterizedTypeReference<Void>() {<NEW_LINE>};<NEW_LINE>return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, <MASK><NEW_LINE>} | accept, contentType, authNames, returnType); |
1,431,163 | private static void collectCoverageInformation(TestCase testCase) {<NEW_LINE><MASK><NEW_LINE>// NOTE: Count on a per-test-case basis, not on a 'per function seen' basis<NEW_LINE>// i.e., don't double count if a SameDiff instance has multiple copies of the same op type<NEW_LINE>// Collect coverage information for backprop:<NEW_LINE>DifferentialFunction[] functions = sd.ops();<NEW_LINE>Set<Class> backpropSeen = new HashSet<>();<NEW_LINE>for (DifferentialFunction df : functions) {<NEW_LINE>backpropSeen.add(df.getClass());<NEW_LINE>}<NEW_LINE>for (Class c : backpropSeen) {<NEW_LINE>if (gradCheckCoverageCountPerClass.containsKey(c))<NEW_LINE>gradCheckCoverageCountPerClass.put(c, gradCheckCoverageCountPerClass.get(c) + 1);<NEW_LINE>else<NEW_LINE>gradCheckCoverageCountPerClass.put(c, 1);<NEW_LINE>}<NEW_LINE>// Collect coverage information for forward pass (expected outputs)<NEW_LINE>Set<Class> seen = null;<NEW_LINE>if (testCase.fwdTestFns() != null) {<NEW_LINE>for (String s : testCase.fwdTestFns().keySet()) {<NEW_LINE>// Determine the differential function that this variable is the output of, if any<NEW_LINE>DifferentialFunction df = sd.getVariableOutputOp(s);<NEW_LINE>if (df != null) {<NEW_LINE>if (seen == null)<NEW_LINE>seen = new HashSet<>();<NEW_LINE>seen.add(df.getClass());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (seen != null) {<NEW_LINE>for (Class c : seen) {<NEW_LINE>if (fwdPassCoverageCountPerClass.containsKey(c)) {<NEW_LINE>fwdPassCoverageCountPerClass.put(c, fwdPassCoverageCountPerClass.get(c) + 1);<NEW_LINE>} else {<NEW_LINE>fwdPassCoverageCountPerClass.put(c, 1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | SameDiff sd = testCase.sameDiff(); |
645,180 | public void testRequiredNonXAOptionB() throws Exception {<NEW_LINE>String deliveryID = "MD_test4d";<NEW_LINE>prepareTRA();<NEW_LINE>// construct a FVTMessage<NEW_LINE>FVTMessage message = new FVTMessage();<NEW_LINE>message.addTestResult("CMTJMSRequired");<NEW_LINE>// Add a option B transacted delivery to another instance.<NEW_LINE>Method m = MessageListener.class.getMethod("onMessage", new Class[] { Message.class });<NEW_LINE>message.addDelivery("CMTJMSRequired", FVTMessage.BEFORE_DELIVERY, m);<NEW_LINE>message.add("CMTJMSRequired", "message1", m);<NEW_LINE>message.addDelivery("CMTJMSRequired", FVTMessage.AFTER_DELIVERY, null);<NEW_LINE>message.addDelivery("CMTJMSRequired", FVTMessage.BEFORE_DELIVERY, m);<NEW_LINE>message.add("CMTJMSRequired", "message2", m);<NEW_LINE>message.addDelivery("CMTJMSRequired", FVTMessage.AFTER_DELIVERY, null);<NEW_LINE>System.out.println(message.toString());<NEW_LINE>baseProvider.sendDirectMessage(deliveryID, message);<NEW_LINE>MessageEndpointTestResults results = baseProvider.getTestResult(deliveryID);<NEW_LINE>assertTrue("isDeliveryTransacted returns true for a method with the Required attribute.", results.isDeliveryTransacted());<NEW_LINE>assertTrue("Number of messages delivered is 2", results.getNumberOfMessagesDelivered() == 2);<NEW_LINE>assertTrue("Delivery option B is used for this test.", results.optionBMessageDeliveryUsed());<NEW_LINE>// assertTrue("This message delivery is in a global transaction context.", results.mdbInvokedInGlobalTransactionContext());<NEW_LINE>assertFalse("The commit should not be driven on the XAResource provided by TRA.", results.raXaResourceCommitWasDriven());<NEW_LINE>assertFalse(<MASK><NEW_LINE>baseProvider.releaseDeliveryId(deliveryID);<NEW_LINE>} | "The RA XAResource should not be enlisted in the global transaction.", results.raXaResourceEnlisted()); |
1,465,647 | public int sendMessageAsync(Message message) {<NEW_LINE><MASK><NEW_LINE>SessionID sId = cm.getSessionId(message.getFrom().getAddress(), mParticipant.getAddress().getAddress());<NEW_LINE>SessionStatus otrStatus = cm.getSessionStatus(sId);<NEW_LINE>message.setTo(new XmppAddress(sId.getRemoteUserId()));<NEW_LINE>if (otrStatus == SessionStatus.ENCRYPTED) {<NEW_LINE>boolean verified = cm.getKeyManager().isVerified(sId);<NEW_LINE>if (verified) {<NEW_LINE>message.setType(Imps.MessageType.OUTGOING_ENCRYPTED_VERIFIED);<NEW_LINE>} else {<NEW_LINE>message.setType(Imps.MessageType.OUTGOING_ENCRYPTED);<NEW_LINE>}<NEW_LINE>} else if (otrStatus == SessionStatus.FINISHED) {<NEW_LINE>message.setType(Imps.MessageType.POSTPONED);<NEW_LINE>// onSendMessageError(message, new ImErrorInfo(ImErrorInfo.INVALID_SESSION_CONTEXT,"error - session finished"));<NEW_LINE>return message.getType();<NEW_LINE>} else {<NEW_LINE>// not encrypted, send to all<NEW_LINE>// message.setTo(new XmppAddress(XmppAddress.stripResource(sId.getRemoteUserId())));<NEW_LINE>message.setType(Imps.MessageType.OUTGOING);<NEW_LINE>}<NEW_LINE>mHistoryMessages.add(message);<NEW_LINE>boolean canSend = cm.transformSending(message);<NEW_LINE>if (canSend) {<NEW_LINE>mManager.sendMessageAsync(this, message);<NEW_LINE>} else {<NEW_LINE>// can't be sent due to OTR state<NEW_LINE>message.setType(Imps.MessageType.POSTPONED);<NEW_LINE>}<NEW_LINE>return message.getType();<NEW_LINE>} | OtrChatManager cm = OtrChatManager.getInstance(); |
1,689,813 | private static void buildElement(Element element, Map<ConfigDefinitionKey, ConfigPayloadBuilder> builderMap, ConfigDefinitionStore configDefinitionStore, DeployLogger logger) {<NEW_LINE>ConfigDefinitionKey key = DomConfigPayloadBuilder.parseConfigName(element);<NEW_LINE>Optional<ConfigDefinition> def = configDefinitionStore.getConfigDefinition(key);<NEW_LINE>if (!def.isPresent()) {<NEW_LINE>// TODO: Fail instead of warn<NEW_LINE>logger.logApplicationPackage(Level.WARNING, "Unable to find config definition '" + key.asFileName() + "'. Please ensure that the name is spelled correctly, and that the def file is included in a bundle.");<NEW_LINE>}<NEW_LINE>ConfigPayloadBuilder payloadBuilder = new DomConfigPayloadBuilder(def.orElse(null), logger).build(element);<NEW_LINE>ConfigPayloadBuilder old = builderMap.get(key);<NEW_LINE>if (old != null) {<NEW_LINE>logger.logApplicationPackage(Level.<MASK><NEW_LINE>old.override(payloadBuilder);<NEW_LINE>} else {<NEW_LINE>builderMap.put(key, payloadBuilder);<NEW_LINE>}<NEW_LINE>} | WARNING, "Multiple overrides for " + key + " found. Applying in the order they are discovered"); |
181,489 | public void apply(AlignmentContext alignmentContext, ReferenceContext referenceContext, FeatureContext featureContext) {<NEW_LINE>final ReadPileup pileup = alignmentContext.getBasePileup();<NEW_LINE>final ReadPileup normalPileup = pileup.makeFilteredPileup(pe -> normalSamples.contains(ReadUtils.getSampleName(pe.getRead(), header)));<NEW_LINE>final byte refBase = referenceContext.getBase();<NEW_LINE>final int[] normalCounts = getBaseCounts(normalPileup, refBase);<NEW_LINE>final int bestNormalAllele = MathUtils.maxElementIndex(normalCounts);<NEW_LINE>final int normalAltCount = normalCounts[bestNormalAllele];<NEW_LINE>// skip cases of no evidence in normal or likely germline<NEW_LINE>if (normalAltCount == 0 || normalAltCount > 0.2 * normalPileup.size()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final ReadPileup tumorPileup = pileup.makeFilteredPileup(pe -> !normalSamples.contains(ReadUtils.getSampleName(pe.<MASK><NEW_LINE>final int tumorAltCount = getBaseCounts(tumorPileup, refBase)[bestNormalAllele];<NEW_LINE>// p value for this tumor alt count or greater<NEW_LINE>// we don't want to bloat our data with a lot of sites with a sequencing error in the normal and little or nothing in the tumor<NEW_LINE>// at the same time, we must include them. Thus we downsample and record the downsampling in order to upsample later<NEW_LINE>// when the p value is not significant<NEW_LINE>final double tumorPValue = 1 - new BinomialDistribution(tumorPileup.size(), errorProb).cumulativeProbability(tumorAltCount - 1);<NEW_LINE>final double downsampleProb = Math.max(1 - tumorPValue, 0.05);<NEW_LINE>if (rng.nextDouble() > downsampleProb) {<NEW_LINE>return;<NEW_LINE>} else if (tumorAltCount > 0.5 * tumorPileup.size()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final String type = bestNormalAllele < 4 ? "SNV" : "INDEL";<NEW_LINE>data.add(new NormalArtifactRecord(normalAltCount, normalPileup.size(), tumorAltCount, tumorPileup.size(), downsampleProb, type));<NEW_LINE>} | getRead(), header))); |
1,776,583 | public Dataverse execute(CommandContext ctxt) throws CommandException {<NEW_LINE>if ((!(getUser() instanceof AuthenticatedUser) || !getUser().isSuperuser())) {<NEW_LINE>throw new PermissionException("Delete dataverse linking dataverse can only be called by superusers.", this, Collections.singleton(Permission.DeleteDataverse), editedDv);<NEW_LINE>}<NEW_LINE>Dataverse merged = ctxt.em().merge(editedDv);<NEW_LINE>DataverseLinkingDataverse doomedAndMerged = ctxt.em().merge(doomed);<NEW_LINE>ctxt.em().remove(doomedAndMerged);<NEW_LINE>if (index) {<NEW_LINE>// can only index merged in the onSuccess method so must index doomed linking dataverse here<NEW_LINE>try {<NEW_LINE>ctxt.index().indexDataverse(doomed.getLinkingDataverse());<NEW_LINE>} catch (IOException | SolrServerException e) {<NEW_LINE>String failureLogText = "Indexing failed for Linked Dataverse. You can kickoff a re-index of this datavese with: \r\n curl http://localhost:8080/api/admin/index/datasets/" + doomed.getLinkingDataverse().getId().toString();<NEW_LINE>failureLogText <MASK><NEW_LINE>LoggingUtil.writeOnSuccessFailureLog(this, failureLogText, doomed.getLinkingDataverse());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return merged;<NEW_LINE>} | += "\r\n" + e.getLocalizedMessage(); |
45,529 | public File runFilter(final File file, final Map<String, String[]> parameters) {<NEW_LINE>double w = Try.of(() -> Integer.parseInt(parameters.get(getPrefix() + "w")[0])).getOrElse(0);<NEW_LINE>double h = Try.of(() -> Integer.parseInt(parameters.get(getPrefix() + "h")[0])).getOrElse(0);<NEW_LINE>final int loop = Try.of(() -> Integer.parseInt(parameters.get(getPrefix() + "loop")[0])).getOrElse(0);<NEW_LINE>final int maxFrames = Try.of(() -> Integer.parseInt(parameters.get(getPrefix() + "frames")[0])).getOrElse(Integer.MAX_VALUE);<NEW_LINE>final File resultFile = getResultsFile(file, parameters);<NEW_LINE>if (!overwrite(resultFile, parameters)) {<NEW_LINE>return resultFile;<NEW_LINE>}<NEW_LINE>resultFile.delete();<NEW_LINE>try {<NEW_LINE>BufferedImage <MASK><NEW_LINE>if (w == 0 && h == 0) {<NEW_LINE>return file;<NEW_LINE>} else if (w == 0 && h > 0) {<NEW_LINE>w = Math.round(h * src.getWidth() / src.getHeight());<NEW_LINE>} else if (w > 0 && h == 0) {<NEW_LINE>h = Math.round(w * src.getHeight() / src.getWidth());<NEW_LINE>}<NEW_LINE>final int width = (int) w;<NEW_LINE>final int height = (int) h;<NEW_LINE>File tempResultFile = new File(resultFile.getAbsoluteFile() + "_" + System.currentTimeMillis() + ".tmp");<NEW_LINE>readWriteGIF(file, tempResultFile, maxFrames, loop, width, height);<NEW_LINE>tempResultFile.renameTo(resultFile);<NEW_LINE>return resultFile;<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new DotRuntimeException("unable to convert file:" + file + " : " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | src = ImageIO.read(file); |
198,776 | public BufferedImageOp op() {<NEW_LINE>thirdparty.jhlabs.image.PointillizeFilter op = new thirdparty.jhlabs.image.PointillizeFilter();<NEW_LINE>op.setAngle(angle);<NEW_LINE>op.setScale(scale);<NEW_LINE>op.setEdgeThickness(edgeThickness);<NEW_LINE>op.setEdgeColor(edgeColor);<NEW_LINE>op.setFadeEdges(fadeEdges);<NEW_LINE>op.setFuzziness(fuzziness);<NEW_LINE>switch(gridType) {<NEW_LINE>case Random:<NEW_LINE>op.setGridType(thirdparty.jhlabs.image.CellularFilter.RANDOM);<NEW_LINE>break;<NEW_LINE>case Square:<NEW_LINE>op.setGridType(thirdparty.<MASK><NEW_LINE>break;<NEW_LINE>case Hexagonal:<NEW_LINE>op.setGridType(thirdparty.jhlabs.image.CellularFilter.HEXAGONAL);<NEW_LINE>break;<NEW_LINE>case Octangal:<NEW_LINE>op.setGridType(thirdparty.jhlabs.image.CellularFilter.OCTAGONAL);<NEW_LINE>break;<NEW_LINE>case Triangular:<NEW_LINE>op.setGridType(thirdparty.jhlabs.image.CellularFilter.TRIANGULAR);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>return op;<NEW_LINE>} | jhlabs.image.CellularFilter.SQUARE); |
1,767,058 | public UpdateCoreNetworkResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>UpdateCoreNetworkResult updateCoreNetworkResult = new UpdateCoreNetworkResult();<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 updateCoreNetworkResult;<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("CoreNetwork", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>updateCoreNetworkResult.setCoreNetwork(CoreNetworkJsonUnmarshaller.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 updateCoreNetworkResult;<NEW_LINE>} | String currentParentElement = context.getCurrentParentElement(); |
3,582 | private static void bindRequestParameters(UriComponentsBuilder builder, HandlerMethodParameter parameter, Object[] arguments, FormatterFactory factory) {<NEW_LINE>Object value = parameter.getVerifiedValue(arguments);<NEW_LINE>if (value == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Class<?> parameterType = parameter.parameter.getParameterType();<NEW_LINE>if (value instanceof MultiValueMap) {<NEW_LINE>Map<String, List<?>> requestParams = (Map<String, List<?>>) parameter.prepareValue(value, factory);<NEW_LINE>for (Entry<String, List<?>> entry : requestParams.entrySet()) {<NEW_LINE>for (Object element : entry.getValue()) {<NEW_LINE>TemplateVariable variable = TemplateVariable.pathVariable(entry.getKey());<NEW_LINE>builder.queryParam(entry.getKey(), variable.prepareAndEncode(element));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (value instanceof Map) {<NEW_LINE>Map<String, ?> requestParams = (Map<String, ?>) parameter.prepareValue(value, factory);<NEW_LINE>for (Entry<String, ?> entry : requestParams.entrySet()) {<NEW_LINE>String key = entry.getKey();<NEW_LINE>TemplateVariable <MASK><NEW_LINE>builder.queryParam(key, variable.prepareAndEncode(entry.getValue()));<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (Map.class.isAssignableFrom(parameterType) && SKIP_VALUE.equals(value)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String key = parameter.getVariableName();<NEW_LINE>TemplateVariable variable = TemplateVariable.requestParameter(key);<NEW_LINE>if (value instanceof Collection) {<NEW_LINE>Collection<?> collection = (Collection<?>) parameter.prepareValue(value, factory);<NEW_LINE>if (parameter.isNonComposite()) {<NEW_LINE>builder.queryParam(key, variable.prepareAndEncode(collection));<NEW_LINE>} else {<NEW_LINE>for (Object element : (Collection<?>) collection) {<NEW_LINE>if (key != null) {<NEW_LINE>builder.queryParam(key, variable.prepareAndEncode(element));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (SKIP_VALUE.equals(value)) {<NEW_LINE>if (parameter.isRequired()) {<NEW_LINE>if (key != null) {<NEW_LINE>builder.queryParam(key, String.format("{%s}", key));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (key != null) {<NEW_LINE>builder.queryParam(key, variable.prepareAndEncode(parameter.prepareValue(value, factory)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | variable = TemplateVariable.requestParameter(key); |
1,265,875 | private void editAccount() {<NEW_LINE>final String id = idText.getText();<NEW_LINE>final String password = passText.getText();<NEW_LINE>final String email = emailText.getText();<NEW_LINE>ExUtil.asyncRun(new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>TcpProxy tcp = TcpProxy.getTcpProxy(serverId);<NEW_LINE>boolean result = false;<NEW_LINE>try {<NEW_LINE>MapPack param = new MapPack();<NEW_LINE>param.put("id", id);<NEW_LINE>param.put("pass", CipherUtil.sha256(password));<NEW_LINE>param.put("email", email);<NEW_LINE><MASK><NEW_LINE>MapPack p = (MapPack) tcp.getSingle(RequestCmd.EDIT_ACCOUNT, param);<NEW_LINE>result = p.getBoolean("result");<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>} finally {<NEW_LINE>TcpProxy.putTcpProxy(tcp);<NEW_LINE>}<NEW_LINE>final boolean finalResult = result;<NEW_LINE>ExUtil.exec(dialog, new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>if (finalResult) {<NEW_LINE>if (ServerManager.getInstance().getServer(serverId).getUserId().equals(id)) {<NEW_LINE>MessageDialog.openInformation(dialog, "Success[Edit Account]", "Your modification has been successful.\nYou will be restart.");<NEW_LINE>RCPUtil.restart();<NEW_LINE>} else {<NEW_LINE>MessageDialog.openInformation(dialog, "Success[Edit Account]", "Your modification has been successful.");<NEW_LINE>dialog.close();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>MessageDialog.openError(dialog, "Failed[Edit Account]", "Your modification failed");<NEW_LINE>okBtn.setEnabled(true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | param.put("group", selectedGroup); |
1,312,778 | public static void encode(ClientMessage clientMessage, com.hazelcast.client.impl.protocol.task.dynamicconfig.NearCacheConfigHolder nearCacheConfigHolder) {<NEW_LINE>clientMessage.add(BEGIN_FRAME.copy());<NEW_LINE>ClientMessage.Frame initialFrame = new ClientMessage.Frame(new byte[INITIAL_FRAME_SIZE]);<NEW_LINE>encodeBoolean(initialFrame.content, SERIALIZE_KEYS_FIELD_OFFSET, nearCacheConfigHolder.isSerializeKeys());<NEW_LINE>encodeBoolean(initialFrame.content, INVALIDATE_ON_CHANGE_FIELD_OFFSET, nearCacheConfigHolder.isInvalidateOnChange());<NEW_LINE>encodeInt(initialFrame.content, TIME_TO_LIVE_SECONDS_FIELD_OFFSET, nearCacheConfigHolder.getTimeToLiveSeconds());<NEW_LINE>encodeInt(initialFrame.content, MAX_IDLE_SECONDS_FIELD_OFFSET, nearCacheConfigHolder.getMaxIdleSeconds());<NEW_LINE>encodeBoolean(initialFrame.content, CACHE_LOCAL_ENTRIES_FIELD_OFFSET, nearCacheConfigHolder.isCacheLocalEntries());<NEW_LINE>clientMessage.add(initialFrame);<NEW_LINE>StringCodec.encode(clientMessage, nearCacheConfigHolder.getName());<NEW_LINE>StringCodec.encode(clientMessage, nearCacheConfigHolder.getInMemoryFormat());<NEW_LINE>EvictionConfigHolderCodec.encode(clientMessage, nearCacheConfigHolder.getEvictionConfigHolder());<NEW_LINE>StringCodec.encode(clientMessage, nearCacheConfigHolder.getLocalUpdatePolicy());<NEW_LINE>CodecUtil.encodeNullable(clientMessage, nearCacheConfigHolder.getPreloaderConfig(), NearCachePreloaderConfigCodec::encode);<NEW_LINE>clientMessage.<MASK><NEW_LINE>} | add(END_FRAME.copy()); |
1,704,492 | private String addTableDataAndGetResponse(String route) {<NEW_LINE>UpdateRowResponse response;<NEW_LINE>try {<NEW_LINE>Uri uri = Uri.parse(URLDecoder<MASK><NEW_LINE>String tableName = uri.getQueryParameter("tableName");<NEW_LINE>String updatedData = uri.getQueryParameter("addData");<NEW_LINE>List<RowDataRequest> rowDataRequests = mGson.fromJson(updatedData, new TypeToken<List<RowDataRequest>>() {<NEW_LINE>}.getType());<NEW_LINE>if (Constants.APP_SHARED_PREFERENCES.equals(mSelectedDatabase)) {<NEW_LINE>response = PrefHelper.addOrUpdateRow(mContext, tableName, rowDataRequests);<NEW_LINE>} else {<NEW_LINE>response = DatabaseHelper.addRow(sqLiteDB, tableName, rowDataRequests);<NEW_LINE>}<NEW_LINE>return mGson.toJson(response);<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>response = new UpdateRowResponse();<NEW_LINE>response.isSuccessful = false;<NEW_LINE>return mGson.toJson(response);<NEW_LINE>}<NEW_LINE>} | .decode(route, "UTF-8")); |
967,842 | protected void onDraw(Canvas canvas) {<NEW_LINE>final int width = getMeasuredWidth();<NEW_LINE>final int height = getMeasuredHeight();<NEW_LINE>final int lThumbWidth = mLeftThumb.getMeasuredWidth();<NEW_LINE>final <MASK><NEW_LINE>final float rThumbOffset = mRightThumb.getX();<NEW_LINE>final float lineTop = mLineSize;<NEW_LINE>final float lineBottom = height - mLineSize;<NEW_LINE>// top line<NEW_LINE>canvas.drawRect(lThumbWidth + lThumbOffset, 0, rThumbOffset, lineTop, mLinePaint);<NEW_LINE>// bottom line<NEW_LINE>canvas.drawRect(lThumbWidth + lThumbOffset, lineBottom, rThumbOffset, height, mLinePaint);<NEW_LINE>if (lThumbOffset > mThumbWidth) {<NEW_LINE>canvas.drawRect(0, 0, lThumbOffset + mThumbWidth, height, mBgPaint);<NEW_LINE>}<NEW_LINE>if (rThumbOffset < width - mThumbWidth) {<NEW_LINE>canvas.drawRect(rThumbOffset, 0, width, height, mBgPaint);<NEW_LINE>}<NEW_LINE>} | float lThumbOffset = mLeftThumb.getX(); |
1,824,703 | private void sendResponse(Channel channel, int packetType, int index, int serviceType, int type, ByteBuf content) {<NEW_LINE>if (channel != null) {<NEW_LINE>ByteBuf data = Unpooled.buffer();<NEW_LINE>data.writeByte(type);<NEW_LINE>data.writeShortLE(content.readableBytes());<NEW_LINE>data.writeBytes(content);<NEW_LINE>content.release();<NEW_LINE>ByteBuf record = Unpooled.buffer();<NEW_LINE>if (packetType == PT_RESPONSE) {<NEW_LINE>record.writeShortLE(index);<NEW_LINE>// success<NEW_LINE>record.writeByte(0);<NEW_LINE>}<NEW_LINE>record.writeShortLE(data.readableBytes());<NEW_LINE>record.writeShortLE(0);<NEW_LINE>// flags (possibly 1 << 6)<NEW_LINE>record.writeByte(0);<NEW_LINE>record.writeByte(serviceType);<NEW_LINE>record.writeByte(serviceType);<NEW_LINE>record.writeBytes(data);<NEW_LINE>data.release();<NEW_LINE>int recordChecksum = Checksum.crc16(Checksum.CRC16_CCITT_FALSE, record.nioBuffer());<NEW_LINE>ByteBuf response = Unpooled.buffer();<NEW_LINE>// protocol version<NEW_LINE>response.writeByte(1);<NEW_LINE>// security key id<NEW_LINE>response.writeByte(0);<NEW_LINE>// flags<NEW_LINE>response.writeByte(0);<NEW_LINE>// header length<NEW_LINE>response.writeByte(5 + 2 + 2 + 2);<NEW_LINE>// encoding<NEW_LINE>response.writeByte(0);<NEW_LINE>response.writeShortLE(record.readableBytes());<NEW_LINE>response.writeShortLE(packetId++);<NEW_LINE>response.writeByte(packetType);<NEW_LINE>response.writeByte(Checksum.crc8(Checksum.CRC8_EGTS<MASK><NEW_LINE>response.writeBytes(record);<NEW_LINE>record.release();<NEW_LINE>response.writeShortLE(recordChecksum);<NEW_LINE>channel.writeAndFlush(new NetworkMessage(response, channel.remoteAddress()));<NEW_LINE>}<NEW_LINE>} | , response.nioBuffer())); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.