idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
1,762,199 | private String unsuan(String s) {<NEW_LINE>final String su = baseUrl.replace("http://", "");<NEW_LINE>boolean b = false;<NEW_LINE>for (int i = 0; i < sw.split("|").length; i++) {<NEW_LINE>if (su.indexOf(sw.split("|")[i]) > -1) {<NEW_LINE>b = true;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!b)<NEW_LINE>return "";<NEW_LINE>final String x = s.substring(s.length() - 1);<NEW_LINE>final String w = "abcdefghijklmnopqrstuvwxyz";<NEW_LINE>int xi = w.indexOf(x) + 1;<NEW_LINE>final String sk = s.substring(s.length() - xi - 12, s.length() - xi - 1);<NEW_LINE>s = s.substring(0, s.length() - xi - 12);<NEW_LINE>String k = sk.substring(0, sk.length() - 1);<NEW_LINE>String f = sk.substring(sk.length() - 1);<NEW_LINE>for (int i = 0; i < k.length(); i++) {<NEW_LINE>s = s.replace(k.substring(i, i + 1)<MASK><NEW_LINE>}<NEW_LINE>String[] ss = s.split(f);<NEW_LINE>s = "";<NEW_LINE>for (int i = 0; i < ss.length; i++) {<NEW_LINE>s += fromCharCode(Integer.parseInt(ss[i]));<NEW_LINE>}<NEW_LINE>return s;<NEW_LINE>} | , Integer.toString(i)); |
790,716 | public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {<NEW_LINE>int topOffset = 0;<NEW_LINE>// TODO - other option is to let the painting of the dark border to the inner component and make this border's insets smaller.<NEW_LINE>if (c instanceof JComponent) {<NEW_LINE>JComponent jc = (JComponent) c;<NEW_LINE>Integer in = (Integer) jc.getClientProperty("MultiViewBorderHack.topOffset");<NEW_LINE>topOffset = in == null ? topOffset : in.intValue();<NEW_LINE>}<NEW_LINE>g.translate(x, y);<NEW_LINE>// NOI18N<NEW_LINE>g.setColor(UIManager.getColor("InternalFrame.borderShadow"));<NEW_LINE>g.drawLine(0, <MASK><NEW_LINE>if (topOffset != 0) {<NEW_LINE>g.drawLine(1, topOffset - 1, 1, topOffset);<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>g.setColor(UIManager.getColor("InternalFrame.borderDarkShadow"));<NEW_LINE>g.drawLine(1, topOffset, 1, height - 2);<NEW_LINE>// NOI18N<NEW_LINE>g.setColor(UIManager.getColor("InternalFrame.borderHighlight"));<NEW_LINE>g.drawLine(1, height - 1, width - 1, height - 1);<NEW_LINE>g.drawLine(width - 1, height - 2, width - 1, 0);<NEW_LINE>// NOI18N<NEW_LINE>g.setColor(UIManager.getColor("InternalFrame.borderLight"));<NEW_LINE>g.drawLine(2, height - 2, width - 2, height - 2);<NEW_LINE>g.drawLine(width - 2, height - 3, width - 2, 0);<NEW_LINE>g.translate(-x, -y);<NEW_LINE>} | 0, 0, height - 1); |
1,662,206 | public void onAttach(@NonNull Context context) {<NEW_LINE>super.onAttach(context);<NEW_LINE>mOnBackPressedDispatcher = requireActivity().getOnBackPressedDispatcher();<NEW_LINE>mOnBackPressedDispatcher.addCallback(this, mOnBackPressedCallback);<NEW_LINE>registerEffect(this, new QMUIFragmentResultEffectHandler() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean shouldHandleEffect(@NonNull FragmentResultEffect effect) {<NEW_LINE>return effect.getRequestCode() == mSourceRequestCode && effect.getRequestFragmentUUid() == mUUid;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void handleEffect(@NonNull FragmentResultEffect effect) {<NEW_LINE>onFragmentResult(effect.getRequestCode(), effect.getResultCode(<MASK><NEW_LINE>mSourceRequestCode = NO_REQUEST_CODE;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void handleEffect(@NonNull List<FragmentResultEffect> effects) {<NEW_LINE>// only handle the latest<NEW_LINE>handleEffect(effects.get(effects.size() - 1));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | ), effect.getIntent()); |
1,442,100 | public ApiScenarioWithBLOBs buildSaveScenario(SaveApiScenarioRequest request) {<NEW_LINE>ApiScenarioWithBLOBs scenario = new ApiScenarioWithBLOBs();<NEW_LINE>scenario.setId(request.getId());<NEW_LINE>scenario.setName(request.getName());<NEW_LINE>scenario.setProjectId(request.getProjectId());<NEW_LINE>scenario.setCustomNum(request.getCustomNum());<NEW_LINE>if (StringUtils.equals(request.getTags(), "[]")) {<NEW_LINE>scenario.setTags("");<NEW_LINE>} else {<NEW_LINE>scenario.<MASK><NEW_LINE>}<NEW_LINE>scenario.setApiScenarioModuleId(request.getApiScenarioModuleId());<NEW_LINE>scenario.setModulePath(request.getModulePath());<NEW_LINE>scenario.setLevel(request.getLevel());<NEW_LINE>scenario.setPrincipal(request.getPrincipal());<NEW_LINE>scenario.setStepTotal(request.getStepTotal());<NEW_LINE>scenario.setUpdateTime(System.currentTimeMillis());<NEW_LINE>scenario.setDescription(request.getDescription());<NEW_LINE>scenario.setCreateUser(SessionUtils.getUserId());<NEW_LINE>scenario.setScenarioDefinition(JSON.toJSONString(request.getScenarioDefinition()));<NEW_LINE>Boolean isValidEnum = EnumUtils.isValidEnum(EnvironmentType.class, request.getEnvironmentType());<NEW_LINE>if (BooleanUtils.isTrue(isValidEnum)) {<NEW_LINE>scenario.setEnvironmentType(request.getEnvironmentType());<NEW_LINE>} else {<NEW_LINE>scenario.setEnvironmentType(EnvironmentType.JSON.toString());<NEW_LINE>}<NEW_LINE>scenario.setEnvironmentJson(request.getEnvironmentJson());<NEW_LINE>scenario.setEnvironmentGroupId(request.getEnvironmentGroupId());<NEW_LINE>if (StringUtils.isNotEmpty(request.getStatus())) {<NEW_LINE>scenario.setStatus(request.getStatus());<NEW_LINE>} else {<NEW_LINE>scenario.setStatus(ScenarioStatus.Underway.name());<NEW_LINE>}<NEW_LINE>if (StringUtils.isNotEmpty(request.getUserId())) {<NEW_LINE>scenario.setUserId(request.getUserId());<NEW_LINE>} else {<NEW_LINE>scenario.setUserId(SessionUtils.getUserId());<NEW_LINE>}<NEW_LINE>if (StringUtils.isEmpty(request.getApiScenarioModuleId()) || "default-module".equals(request.getApiScenarioModuleId())) {<NEW_LINE>replenishScenarioModuleIdPath(request.getProjectId(), apiScenarioModuleMapper, scenario);<NEW_LINE>}<NEW_LINE>saveFollows(scenario.getId(), request.getFollows());<NEW_LINE>if (StringUtils.isEmpty(request.getVersionId())) {<NEW_LINE>scenario.setVersionId(extProjectVersionMapper.getDefaultVersion(request.getProjectId()));<NEW_LINE>} else {<NEW_LINE>scenario.setVersionId(request.getVersionId());<NEW_LINE>}<NEW_LINE>return scenario;<NEW_LINE>} | setTags(request.getTags()); |
430,380 | private static void installNotificationListHooks(ClassLoader classLoader) {<NEW_LINE>XLog.i("NotificationManagerServiceHooks.installNotificationListHooks");<NEW_LINE>try {<NEW_LINE>new LocalServices(classLoader).getService(NMSHelper.INSTANCE.nmsClass(classLoader)).ifPresent(new Consumer<Object>() {<NEW_LINE><NEW_LINE>@SuppressWarnings("rawtypes")<NEW_LINE>@Override<NEW_LINE>public void accept(Object service) {<NEW_LINE><MASK><NEW_LINE>// Install list proxy.<NEW_LINE>List mNotificationList = (List) XposedHelpers.getObjectField(service, "mNotificationList");<NEW_LINE>XLog.d("mNotificationList: " + mNotificationList);<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>List proxyList = NotificationRecordListProxy.newProxy(mNotificationList);<NEW_LINE>XposedHelpers.setObjectField(service, "mNotificationList", proxyList);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (Throwable e) {<NEW_LINE>XLog.e("NotificationManagerServiceHooks.installNotificationListHooks error", e);<NEW_LINE>}<NEW_LINE>} | XLog.i("NotificationManagerServiceHooks.installNotificationListHooks service: %s", service); |
1,510,217 | public String encodeInt16AsCharEscape(int v) {<NEW_LINE>if (v < Character.MIN_VALUE || v > Character.MAX_VALUE) {<NEW_LINE>throw new IllegalArgumentException(String.format("Cannot encode the specified value: %d", v));<NEW_LINE>}<NEW_LINE>if (isATNSerializedAsInts()) {<NEW_LINE>return Integer.toString(v);<NEW_LINE>}<NEW_LINE>char c = (char) v;<NEW_LINE>String escaped = <MASK><NEW_LINE>if (escaped != null) {<NEW_LINE>return escaped;<NEW_LINE>}<NEW_LINE>switch(Character.getType(c)) {<NEW_LINE>case Character.CONTROL:<NEW_LINE>case Character.LINE_SEPARATOR:<NEW_LINE>case Character.PARAGRAPH_SEPARATOR:<NEW_LINE>return escapeChar(v);<NEW_LINE>default:<NEW_LINE>if (v <= 127) {<NEW_LINE>// ascii chars can be as-is, no encoding<NEW_LINE>return String.valueOf(c);<NEW_LINE>}<NEW_LINE>// else we use hex encoding to ensure pure ascii chars generated<NEW_LINE>return escapeChar(v);<NEW_LINE>}<NEW_LINE>} | getTargetCharValueEscape().get(c); |
469,163 | public static Class _TextItemBuilder() {<NEW_LINE>Class tmp;<NEW_LINE>Class mTextItemBuilder = load("com/tencent/mobileqq/activity/aio/item/TextItemBuilder");<NEW_LINE>if (mTextItemBuilder == null) {<NEW_LINE>try {<NEW_LINE>tmp = load("com/tencent/mobileqq/activity/aio/item/TextItemBuilder$10");<NEW_LINE>mTextItemBuilder = tmp.getDeclaredField("this$0").getType();<NEW_LINE>} catch (Exception ignored) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (mTextItemBuilder == null) {<NEW_LINE>try {<NEW_LINE>tmp = load("com/tencent/mobileqq/activity/aio/item/TextItemBuilder$7");<NEW_LINE>mTextItemBuilder = tmp.getDeclaredField("this$0").getType();<NEW_LINE>} catch (Exception ignored) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (mTextItemBuilder == null) {<NEW_LINE>try {<NEW_LINE>tmp = load("com/tencent/mobileqq/activity/aio/item/TextItemBuilder$6");<NEW_LINE>mTextItemBuilder = tmp.<MASK><NEW_LINE>} catch (Exception ignored) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (mTextItemBuilder == null) {<NEW_LINE>try {<NEW_LINE>tmp = load("com/tencent/mobileqq/activity/aio/item/TextItemBuilder$3");<NEW_LINE>mTextItemBuilder = tmp.getDeclaredField("this$0").getType();<NEW_LINE>} catch (Exception ignored) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (mTextItemBuilder == null) {<NEW_LINE>try {<NEW_LINE>tmp = load("com/tencent/mobileqq/activity/aio/item/TextItemBuilder$8");<NEW_LINE>mTextItemBuilder = tmp.getDeclaredField("this$0").getType();<NEW_LINE>} catch (Exception ignored) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return mTextItemBuilder;<NEW_LINE>} | getDeclaredField("this$0").getType(); |
1,476,359 | public boolean next() throws SQLException {<NEW_LINE>if (isClosed()) {<NEW_LINE>throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_RESULTSET_CLOSED);<NEW_LINE>}<NEW_LINE>if (this.forward()) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>Request request = factory.generateFetch(queryId);<NEW_LINE>CompletableFuture<Response> send = transport.send(request);<NEW_LINE>try {<NEW_LINE>Response response = send.get();<NEW_LINE>FetchResp fetchResp = (FetchResp) response;<NEW_LINE>if (Code.SUCCESS.getCode() != fetchResp.getCode()) {<NEW_LINE>// TODO reWrite error type<NEW_LINE>throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNKNOWN, fetchResp.getMessage());<NEW_LINE>}<NEW_LINE>this.reset();<NEW_LINE>if (fetchResp.isCompleted() || fetchResp.getRows() == 0) {<NEW_LINE>this.isCompleted = true;<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>fieldLength = Arrays.asList(fetchResp.getLengths());<NEW_LINE>this<MASK><NEW_LINE>this.result = fetchJsonData();<NEW_LINE>return true;<NEW_LINE>} catch (InterruptedException | ExecutionException e) {<NEW_LINE>throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_RESTFul_Client_IOException, e.getMessage());<NEW_LINE>}<NEW_LINE>} | .numOfRows = fetchResp.getRows(); |
434,104 | final T call(Log log) {<NEW_LINE>long nodeCount = dimensions.hugeNodeCount();<NEW_LINE>final ImportSizing sizing = ImportSizing.of(concurrency, nodeCount);<NEW_LINE>int numberOfThreads = sizing.numberOfThreads();<NEW_LINE>AbstractStorePageCacheScanner<Record> scanner = new AbstractStorePageCacheScanner<>(DEFAULT_PREFETCH_SIZE, api, access);<NEW_LINE>ImportingThreadPool.CreateScanner creator = creator(nodeCount, sizing, scanner);<NEW_LINE>ImportingThreadPool pool = new ImportingThreadPool(numberOfThreads, creator);<NEW_LINE>ImportResult importResult = pool.run(threadPool);<NEW_LINE>long requiredBytes = scanner.storeSize();<NEW_LINE>long nodesImported = importResult.recordsImported;<NEW_LINE>BigInteger bigNanos = BigInteger.valueOf(importResult.tookNanos);<NEW_LINE>double tookInSeconds = new BigDecimal(bigNanos).divide(new BigDecimal(A_BILLION), 9, RoundingMode.CEILING).doubleValue();<NEW_LINE>long bytesPerSecond = A_BILLION.multiply(BigInteger.valueOf(requiredBytes)).<MASK><NEW_LINE>log.info("%s Store Scan: Imported %,d records from %s (%,d bytes); took %.3f s, %,.2f %1$ss/s, %s/s (%,d bytes/s) (per thread: %,.2f %1$ss/s, %s/s (%,d bytes/s))", label, nodesImported, humanReadable(requiredBytes), requiredBytes, tookInSeconds, (double) nodesImported / tookInSeconds, humanReadable(bytesPerSecond), bytesPerSecond, (double) nodesImported / tookInSeconds / numberOfThreads, humanReadable(bytesPerSecond / numberOfThreads), bytesPerSecond / numberOfThreads);<NEW_LINE>return build();<NEW_LINE>} | divide(bigNanos).longValueExact(); |
1,217,496 | private void changeSettings(JsonObject jsonchange) {<NEW_LINE>String jsoncmd = jsonchange.toString();<NEW_LINE>logger.trace("air-Q - airqHandler - changeSettings(): called with jsoncmd={}", jsoncmd);<NEW_LINE>Result res = null;<NEW_LINE>String url = "http://" + config.ipAddress + "/config";<NEW_LINE>String jsonbody = encrypt(jsoncmd.getBytes(StandardCharsets.UTF_8), config.password);<NEW_LINE>String fullbody = "request=" + jsonbody;<NEW_LINE>logger.trace("air-Q - airqHandler - changeSettings(): doing call to url={}, method=POST, body={}", url, fullbody);<NEW_LINE>res = getData(url, "POST", fullbody);<NEW_LINE>if (res != null) {<NEW_LINE>JsonElement ans = gson.fromJson(res.<MASK><NEW_LINE>if (ans != null) {<NEW_LINE>JsonObject jsonObj = ans.getAsJsonObject();<NEW_LINE>String jsonAnswer = decrypt(jsonObj.get("content").getAsString().getBytes(), config.password);<NEW_LINE>logger.trace("air-Q - airqHandler - changeSettings(): call returned {}", jsonAnswer);<NEW_LINE>} else {<NEW_LINE>logger.warn("The air-Q data could not be extracted from this string: {}", ans);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | getBody(), JsonElement.class); |
1,355,489 | public static void drawNumbers(Graphics2D g2, List<PointIndex2D_F64> points, @Nullable Point2Transform2_F32 transform, double scale) {<NEW_LINE>Font regular = new Font("Serif", Font.PLAIN, 16);<NEW_LINE>g2.setFont(regular);<NEW_LINE>Point2D_F32 adj = new Point2D_F32();<NEW_LINE>AffineTransform origTran = g2.getTransform();<NEW_LINE>for (int i = 0; i < points.size(); i++) {<NEW_LINE>Point2D_F64 p = points.get(i).p;<NEW_LINE>int gridIndex = points.get(i).index;<NEW_LINE>if (transform != null) {<NEW_LINE>transform.compute((float) p.x, (float) p.y, adj);<NEW_LINE>} else {<NEW_LINE>adj.setTo((float) p.x, (float) p.y);<NEW_LINE>}<NEW_LINE>String text = String.format("%2d", gridIndex);<NEW_LINE>int x = (int) (adj.x * scale);<NEW_LINE>int y = (int) (adj.y * scale);<NEW_LINE>g2.setColor(Color.BLACK);<NEW_LINE>g2.drawString(text, x - 1, y);<NEW_LINE>g2.drawString(text, x + 1, y);<NEW_LINE>g2.drawString(text, x, y - 1);<NEW_LINE>g2.drawString(<MASK><NEW_LINE>g2.setTransform(origTran);<NEW_LINE>g2.setColor(Color.GREEN);<NEW_LINE>g2.drawString(text, x, y);<NEW_LINE>}<NEW_LINE>} | text, x, y + 1); |
1,217,038 | private Point2D pickNodeXYPlane(Node node, double x, double y) {<NEW_LINE>final PickRay ray = computePickRay(x, y, null);<NEW_LINE>final Affine3D localToScene = new Affine3D();<NEW_LINE>TransformHelper.apply(node.getLocalToSceneTransform(), localToScene);<NEW_LINE>final Vec3d o = ray.getOriginNoClone();<NEW_LINE>final Vec3d d = ray.getDirectionNoClone();<NEW_LINE>try {<NEW_LINE>localToScene.inverseTransform(o, o);<NEW_LINE>localToScene.inverseDeltaTransform(d, d);<NEW_LINE>} catch (NoninvertibleTransformException e) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (almostZero(d.z)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final double t = <MASK><NEW_LINE>return new Point2D(o.x + (d.x * t), o.y + (d.y * t));<NEW_LINE>} | -o.z / d.z; |
849,982 | public static void assertDirectoriesEqual(VirtualFile dirAfter, VirtualFile dirBefore, @Nullable VirtualFileFilter fileFilter) throws IOException {<NEW_LINE>FileDocumentManager.getInstance().saveAllDocuments();<NEW_LINE>VirtualFile[] childrenAfter = dirAfter.getChildren();<NEW_LINE>if (dirAfter.isInLocalFileSystem()) {<NEW_LINE>File[] ioAfter = new File(dirAfter.getPath()).listFiles();<NEW_LINE>shallowCompare(childrenAfter, ioAfter);<NEW_LINE>}<NEW_LINE>VirtualFile[] childrenBefore = dirBefore.getChildren();<NEW_LINE>if (dirBefore.isInLocalFileSystem()) {<NEW_LINE>File[] ioBefore = new File(dirBefore.getPath()).listFiles();<NEW_LINE>shallowCompare(childrenBefore, ioBefore);<NEW_LINE>}<NEW_LINE>HashMap<String, VirtualFile> mapAfter = buildNameToFileMap(childrenAfter, fileFilter);<NEW_LINE>HashMap<String, VirtualFile> mapBefore = buildNameToFileMap(childrenBefore, fileFilter);<NEW_LINE>Set<String> keySetAfter = mapAfter.keySet();<NEW_LINE>Set<String> keySetBefore = mapBefore.keySet();<NEW_LINE>assertEquals(dirAfter.getPath(), keySetAfter, keySetBefore);<NEW_LINE>for (String name : keySetAfter) {<NEW_LINE>VirtualFile fileAfter = mapAfter.get(name);<NEW_LINE>VirtualFile fileBefore = mapBefore.get(name);<NEW_LINE>if (fileAfter.isDirectory()) {<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>assertFilesEqual(fileAfter, fileBefore);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | assertDirectoriesEqual(fileAfter, fileBefore, fileFilter); |
306,175 | public void initializeState(StateInitializationContext context) throws Exception {<NEW_LINE>super.initializeState(context);<NEW_LINE>this.flinkJobId = getContainingTask().getEnvironment().getJobID().toString();<NEW_LINE>// Open the table loader and load the table.<NEW_LINE>this.tableLoader.open();<NEW_LINE>this.table = tableLoader.loadTable();<NEW_LINE>maxContinuousEmptyCommits = PropertyUtil.propertyAsInt(table.properties(), MAX_CONTINUOUS_EMPTY_COMMITS, 10);<NEW_LINE>Preconditions.checkArgument(maxContinuousEmptyCommits > 0, MAX_CONTINUOUS_EMPTY_COMMITS + " must be positive");<NEW_LINE>int subTaskId = getRuntimeContext().getIndexOfThisSubtask();<NEW_LINE>int attemptId = getRuntimeContext().getAttemptNumber();<NEW_LINE>String operatorUniqueId = getRuntimeContext().getOperatorUniqueID();<NEW_LINE>this.manifestOutputFileFactory = FlinkManifestUtil.createOutputFileFactory(table, <MASK><NEW_LINE>this.maxCommittedCheckpointId = INITIAL_CHECKPOINT_ID;<NEW_LINE>this.checkpointsState = context.getOperatorStateStore().getListState(STATE_DESCRIPTOR);<NEW_LINE>this.jobIdState = context.getOperatorStateStore().getListState(JOB_ID_DESCRIPTOR);<NEW_LINE>if (context.isRestored()) {<NEW_LINE>String restoredFlinkJobId = jobIdState.get().iterator().next();<NEW_LINE>Preconditions.checkState(!Strings.isNullOrEmpty(restoredFlinkJobId), "Flink job id parsed from checkpoint snapshot shouldn't be null or empty");<NEW_LINE>// Since flink's checkpoint id will start from the max-committed-checkpoint-id + 1 in the new flink job even if<NEW_LINE>// it's restored from a snapshot created by another different flink job, so it's safe to assign the max committed<NEW_LINE>// checkpoint id from restored flink job to the current flink job.<NEW_LINE>this.maxCommittedCheckpointId = getMaxCommittedCheckpointId(table, restoredFlinkJobId);<NEW_LINE>NavigableMap<Long, byte[]> uncommittedDataFiles = Maps.newTreeMap(checkpointsState.get().iterator().next()).tailMap(maxCommittedCheckpointId, false);<NEW_LINE>if (!uncommittedDataFiles.isEmpty()) {<NEW_LINE>// Committed all uncommitted data files from the old flink job to iceberg table.<NEW_LINE>long maxUncommittedCheckpointId = uncommittedDataFiles.lastKey();<NEW_LINE>commitUpToCheckpoint(uncommittedDataFiles, restoredFlinkJobId, maxUncommittedCheckpointId);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | flinkJobId, operatorUniqueId, subTaskId, attemptId); |
991,399 | public void expectLater(final int tick) {<NEW_LINE>final Thread targetThread = Thread.currentThread();<NEW_LINE>LOGGER.debug("Thread {} expecting tick {}", targetThread, tick);<NEW_LINE>start(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>try {<NEW_LINE>Thread.sleep(500L);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>lock.lock();<NEW_LINE>try {<NEW_LINE>ClockTickImpl clockTick = getTick(tick);<NEW_LINE>if (!clockTick.isImmediatelyAfter(currentTick)) {<NEW_LINE>throw new RuntimeException(String.format<MASK><NEW_LINE>}<NEW_LINE>if (!active.contains(targetThread)) {<NEW_LINE>throw new RuntimeException("Cannot wait for clock tick from a thread which is not a test thread.");<NEW_LINE>}<NEW_LINE>synching.add(targetThread);<NEW_LINE>condition.signalAll();<NEW_LINE>} finally {<NEW_LINE>lock.unlock();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | ("Cannot wait for %s, as clock is currently at %s.", clockTick, currentTick)); |
1,552,808 | public synchronized Mono<Lease> addOrUpdateLease(final Lease lease) {<NEW_LINE>WorkerTask workerTask = this.currentlyOwnedPartitions.get(lease.getLeaseToken());<NEW_LINE>if (workerTask != null && workerTask.isRunning()) {<NEW_LINE>return this.leaseManager.updateProperties(lease).map(updatedLease -> {<NEW_LINE>logger.debug(<MASK><NEW_LINE>return updatedLease;<NEW_LINE>});<NEW_LINE>}<NEW_LINE>return this.leaseManager.acquire(lease).map(updatedLease -> {<NEW_LINE>WorkerTask checkTask = this.currentlyOwnedPartitions.get(lease.getLeaseToken());<NEW_LINE>if (checkTask == null) {<NEW_LINE>logger.info("Partition {}: acquired.", updatedLease.getLeaseToken());<NEW_LINE>PartitionSupervisor supervisor = this.partitionSupervisorFactory.create(updatedLease);<NEW_LINE>this.currentlyOwnedPartitions.put(updatedLease.getLeaseToken(), this.processPartition(supervisor, updatedLease));<NEW_LINE>}<NEW_LINE>return updatedLease;<NEW_LINE>}).onErrorResume(throwable -> {<NEW_LINE>logger.warn("Partition {}: unexpected error; removing lease from current cache.", lease.getLeaseToken());<NEW_LINE>return this.removeLease(lease).then(Mono.error(throwable));<NEW_LINE>});<NEW_LINE>} | "Partition {}: updated.", updatedLease.getLeaseToken()); |
1,384,101 | public HKerberosThriftClient open() {<NEW_LINE>if (isOpen()) {<NEW_LINE>throw new IllegalStateException("Open called on already open connection. You should not have gotten here.");<NEW_LINE>}<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("Creating a new thrift connection to {}", cassandraHost);<NEW_LINE>}<NEW_LINE>TSocket socket;<NEW_LINE>try {<NEW_LINE>socket = params == null ? new TSocket(cassandraHost.getHost(), cassandraHost.getPort(), timeout) : TSSLTransportFactory.getClientSocket(cassandraHost.getHost(), cassandraHost.getPort(), timeout, params);<NEW_LINE>} catch (TTransportException e) {<NEW_LINE>throw new HectorTransportException("Could not get client socket: ", e);<NEW_LINE>}<NEW_LINE>if (cassandraHost.getUseSocketKeepalive()) {<NEW_LINE>try {<NEW_LINE>socket.getSocket().setKeepAlive(true);<NEW_LINE>} catch (SocketException se) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>// TODO (patricioe) What should I do with it ?<NEW_LINE>// KerberosHelper.getSourcePrinciple(clientContext));<NEW_LINE>transport = maybeWrapWithTFramedTransport(socket);<NEW_LINE>try {<NEW_LINE>transport.open();<NEW_LINE>} catch (TTransportException e) {<NEW_LINE>// Thrift exceptions aren't very good in reporting, so we have to catch the exception here and<NEW_LINE>// add details to it.<NEW_LINE>log.debug("Unable to open transport to " + cassandraHost.getName());<NEW_LINE>// clientMonitor.incCounter(Counter.CONNECT_ERROR);<NEW_LINE>throw new HectorTransportException("Unable to open transport to " + cassandraHost.getName() + " , " + e.getLocalizedMessage(), e);<NEW_LINE>}<NEW_LINE>// Kerberos authentication<NEW_LINE>Socket internalSocket = socket.getSocket();<NEW_LINE>final GSSContext clientContext = KerberosHelper.authenticateClient(internalSocket, kerberosTicket, servicePrincipalName);<NEW_LINE>if (clientContext == null) {<NEW_LINE>close();<NEW_LINE>throw new HectorTransportException("Kerberos context couldn't be established with client.");<NEW_LINE>}<NEW_LINE>return this;<NEW_LINE>} | throw new HectorTransportException("Could not set SO_KEEPALIVE on socket: ", se); |
1,610,138 | // Visible for testing<NEW_LINE>byte[] DERToJOSE(byte[] derSignature) throws SignatureException {<NEW_LINE>// DER Structure: http://crypto.stackexchange.com/a/1797<NEW_LINE>boolean derEncoded = derSignature[0] == 0x30 && derSignature.length != ecNumberSize * 2;<NEW_LINE>if (!derEncoded) {<NEW_LINE>throw new SignatureException("Invalid DER signature format.");<NEW_LINE>}<NEW_LINE>final byte[] joseSignature = new byte[ecNumberSize * 2];<NEW_LINE>// Skip 0x30<NEW_LINE>int offset = 1;<NEW_LINE>if (derSignature[1] == (byte) 0x81) {<NEW_LINE>// Skip sign<NEW_LINE>offset++;<NEW_LINE>}<NEW_LINE>// Convert to unsigned. Should match DER length - offset<NEW_LINE>int encodedLength = derSignature[offset++] & 0xff;<NEW_LINE>if (encodedLength != derSignature.length - offset) {<NEW_LINE>throw new SignatureException("Invalid DER signature format.");<NEW_LINE>}<NEW_LINE>// Skip 0x02<NEW_LINE>offset++;<NEW_LINE>// Obtain R number length (Includes padding) and skip it<NEW_LINE>int rlength = derSignature[offset++];<NEW_LINE>if (rlength > ecNumberSize + 1) {<NEW_LINE>throw new SignatureException("Invalid DER signature format.");<NEW_LINE>}<NEW_LINE>int rpadding = ecNumberSize - rlength;<NEW_LINE>// Retrieve R number<NEW_LINE>System.arraycopy(derSignature, offset + Math.max(-rpadding, 0), joseSignature, Math.max(rpadding, 0), rlength + Math.min(rpadding, 0));<NEW_LINE>// Skip R number and 0x02<NEW_LINE>offset += rlength + 1;<NEW_LINE>// Obtain S number length. (Includes padding)<NEW_LINE>int slength = derSignature[offset++];<NEW_LINE>if (slength > ecNumberSize + 1) {<NEW_LINE>throw new SignatureException("Invalid DER signature format.");<NEW_LINE>}<NEW_LINE>int spadding = ecNumberSize - slength;<NEW_LINE>// Retrieve R number<NEW_LINE>System.arraycopy(derSignature, offset + Math.max(-spadding, 0), joseSignature, ecNumberSize + Math.max(spadding, 0), slength + Math<MASK><NEW_LINE>return joseSignature;<NEW_LINE>} | .min(spadding, 0)); |
442,814 | private List<LayerDeclaration> createDeclarations(AmidstSettings settings, List<Integer> enabledLayers) {<NEW_LINE>LayerDeclaration[] declarations = new LayerDeclaration[LayerIds.NUMBER_OF_LAYERS];<NEW_LINE>// @formatter:off<NEW_LINE>declare(settings, declarations, enabledLayers, LayerIds.ALPHA, null, false, Setting.createImmutable(true));<NEW_LINE>declare(settings, declarations, enabledLayers, LayerIds.BIOME_DATA, Dimension.OVERWORLD, false, Setting.createImmutable(true));<NEW_LINE>declare(settings, declarations, enabledLayers, LayerIds.END_ISLANDS, Dimension.END, false, Setting.createImmutable(true));<NEW_LINE>declare(settings, declarations, enabledLayers, LayerIds.BACKGROUND, null, false, Setting.createImmutable(true));<NEW_LINE>declare(settings, declarations, enabledLayers, LayerIds.SLIME, Dimension.OVERWORLD, false, settings.showSlimeChunks);<NEW_LINE>declare(settings, declarations, enabledLayers, LayerIds.GRID, null, true, settings.showGrid);<NEW_LINE>declare(settings, declarations, enabledLayers, LayerIds.SPAWN, Dimension.OVERWORLD, false, settings.showSpawn);<NEW_LINE>declare(settings, declarations, enabledLayers, LayerIds.STRONGHOLD, Dimension.OVERWORLD, false, settings.showStrongholds);<NEW_LINE>declare(settings, declarations, enabledLayers, LayerIds.PLAYER, <MASK><NEW_LINE>declare(settings, declarations, enabledLayers, LayerIds.VILLAGE, Dimension.OVERWORLD, false, settings.showVillages);<NEW_LINE>declare(settings, declarations, enabledLayers, LayerIds.TEMPLE, Dimension.OVERWORLD, false, settings.showTemples);<NEW_LINE>declare(settings, declarations, enabledLayers, LayerIds.MINESHAFT, Dimension.OVERWORLD, false, settings.showMineshafts);<NEW_LINE>declare(settings, declarations, enabledLayers, LayerIds.OCEAN_MONUMENT, Dimension.OVERWORLD, false, settings.showOceanMonuments);<NEW_LINE>declare(settings, declarations, enabledLayers, LayerIds.WOODLAND_MANSION, Dimension.OVERWORLD, false, settings.showWoodlandMansions);<NEW_LINE>declare(settings, declarations, enabledLayers, LayerIds.OCEAN_FEATURES, Dimension.OVERWORLD, false, settings.showOceanFeatures);<NEW_LINE>declare(settings, declarations, enabledLayers, LayerIds.NETHER_FEATURES, Dimension.OVERWORLD, false, settings.showNetherFortresses);<NEW_LINE>declare(settings, declarations, enabledLayers, LayerIds.END_CITY, Dimension.END, false, settings.showEndCities);<NEW_LINE>// @formatter:on<NEW_LINE>return Collections.unmodifiableList(Arrays.asList(declarations));<NEW_LINE>} | null, false, settings.showPlayers); |
1,349,320 | private boolean skipFunctionBody(final ParserContextFunctionNode functionNode) {<NEW_LINE>if (reparsedFunction == null) {<NEW_LINE>// Not reparsing, so don't skip any function body.<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// Skip to the RBRACE of this function, and continue parsing from there.<NEW_LINE>final RecompilableScriptFunctionData data = reparsedFunction.getScriptFunctionData(functionNode.getId());<NEW_LINE>if (data == null) {<NEW_LINE>// Nested function is not known to the reparsed function. This can happen if the FunctionNode was<NEW_LINE>// in dead code that was removed. Both FoldConstants and Lower prune dead code. In that case, the<NEW_LINE>// FunctionNode was dropped before a RecompilableScriptFunctionData could've been created for it.<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>final ParserState parserState = <MASK><NEW_LINE>assert parserState != null;<NEW_LINE>if (k < stream.last() && start < parserState.position && parserState.position <= Token.descPosition(stream.get(stream.last()))) {<NEW_LINE>// RBRACE is already in the token stream, so fast forward to it<NEW_LINE>for (; k < stream.last(); k++) {<NEW_LINE>long nextToken = stream.get(k + 1);<NEW_LINE>if (Token.descPosition(nextToken) == parserState.position && Token.descType(nextToken) == RBRACE) {<NEW_LINE>token = stream.get(k);<NEW_LINE>type = Token.descType(token);<NEW_LINE>next();<NEW_LINE>assert type == RBRACE && start == parserState.position;<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>stream.reset();<NEW_LINE>lexer = parserState.createLexer(source, lexer, stream, scripting && env.syntaxExtensions, env.es6, shebang);<NEW_LINE>line = parserState.line;<NEW_LINE>linePosition = parserState.linePosition;<NEW_LINE>// Doesn't really matter, but it's safe to treat it as if there were a semicolon before<NEW_LINE>// the RBRACE.<NEW_LINE>type = SEMICOLON;<NEW_LINE>scanFirstToken();<NEW_LINE>return true;<NEW_LINE>} | (ParserState) data.getEndParserState(); |
1,209,930 | public static GetNotificationConfigResponse unmarshall(GetNotificationConfigResponse getNotificationConfigResponse, UnmarshallerContext context) {<NEW_LINE>getNotificationConfigResponse.setRequestId<MASK><NEW_LINE>getNotificationConfigResponse.setSuccess(context.booleanValue("GetNotificationConfigResponse.Success"));<NEW_LINE>getNotificationConfigResponse.setCode(context.stringValue("GetNotificationConfigResponse.Code"));<NEW_LINE>getNotificationConfigResponse.setMessage(context.stringValue("GetNotificationConfigResponse.Message"));<NEW_LINE>getNotificationConfigResponse.setHttpStatusCode(context.integerValue("GetNotificationConfigResponse.HttpStatusCode"));<NEW_LINE>getNotificationConfigResponse.setProducerId(context.stringValue("GetNotificationConfigResponse.ProducerId"));<NEW_LINE>getNotificationConfigResponse.setAccessPoint(context.stringValue("GetNotificationConfigResponse.AccessPoint"));<NEW_LINE>getNotificationConfigResponse.setTopic(context.stringValue("GetNotificationConfigResponse.Topic"));<NEW_LINE>List<SubscriptionsItem> subscriptions = new ArrayList<SubscriptionsItem>();<NEW_LINE>for (int i = 0; i < context.lengthValue("GetNotificationConfigResponse.Subscriptions.Length"); i++) {<NEW_LINE>SubscriptionsItem subscriptionsItem = new SubscriptionsItem();<NEW_LINE>subscriptionsItem.setName(context.stringValue("GetNotificationConfigResponse.Subscriptions[" + i + "].Name"));<NEW_LINE>subscriptionsItem.setDisplayName(context.stringValue("GetNotificationConfigResponse.Subscriptions[" + i + "].DisplayName"));<NEW_LINE>subscriptionsItem.setSelected(context.booleanValue("GetNotificationConfigResponse.Subscriptions[" + i + "].Selected"));<NEW_LINE>subscriptions.add(subscriptionsItem);<NEW_LINE>}<NEW_LINE>getNotificationConfigResponse.setSubscriptions(subscriptions);<NEW_LINE>return getNotificationConfigResponse;<NEW_LINE>} | (context.stringValue("GetNotificationConfigResponse.RequestId")); |
1,739,372 | public void updateChangelog() {<NEW_LINE>final boolean objectChangelog = Settings.ChangelogEnabled.getValue();<NEW_LINE>final boolean userChangelog = Settings.UserChangelogEnabled.getValue();<NEW_LINE>if (doUpateChangelogIfEnabled && (objectChangelog || userChangelog)) {<NEW_LINE>final long t0 = System.currentTimeMillis();<NEW_LINE>for (final ModificationEvent ev : modificationEvents) {<NEW_LINE>try {<NEW_LINE>if (objectChangelog) {<NEW_LINE>final GraphObject obj = ev.getGraphObject();<NEW_LINE>final String newLog = ev.getChangeLog();<NEW_LINE>if (obj != null && obj.changelogEnabled()) {<NEW_LINE>final String uuid = ev.isDeleted() ? ev.getUuid() : obj.getUuid();<NEW_LINE>final String typeFolderName = obj.isNode() ? "n" : "r";<NEW_LINE>java.io.File file = ChangelogFunction.getChangeLogFileOnDisk(typeFolderName, uuid, true);<NEW_LINE>FileUtils.write(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (userChangelog) {<NEW_LINE>for (Map.Entry<String, StringBuilder> entry : ev.getUserChangeLogs().entrySet()) {<NEW_LINE>java.io.File file = ChangelogFunction.getChangeLogFileOnDisk("u", entry.getKey(), true);<NEW_LINE>FileUtils.write(file, entry.getValue().toString(), "utf-8", true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (IOException ioex) {<NEW_LINE>logger.error("Unable to write changelog to file: {}", ioex.getMessage());<NEW_LINE>} catch (Throwable t) {<NEW_LINE>logger.warn("", t);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>changelogUpdateTime = System.currentTimeMillis() - t0;<NEW_LINE>}<NEW_LINE>} | file, newLog, "utf-8", true); |
110,079 | private static ConstructingObjectParser<AnalysisConfig.Builder, Void> createParser(boolean ignoreUnknownFields) {<NEW_LINE>ConstructingObjectParser<AnalysisConfig.Builder, Void> parser = new ConstructingObjectParser<>(ANALYSIS_CONFIG.getPreferredName(), ignoreUnknownFields, a -> new AnalysisConfig.Builder((List<Detector>) a[0]));<NEW_LINE>parser.declareObjectArray(ConstructingObjectParser.constructorArg(), (p, c) -> (ignoreUnknownFields ? Detector.LENIENT_PARSER : Detector.STRICT_PARSER).apply(p, c).build(), DETECTORS);<NEW_LINE>parser.declareString((builder, val) -> builder.setBucketSpan(TimeValue.parseTimeValue(val, BUCKET_SPAN.getPreferredName())), BUCKET_SPAN);<NEW_LINE>parser.declareString(Builder::setCategorizationFieldName, CATEGORIZATION_FIELD_NAME);<NEW_LINE>parser.declareStringArray(Builder::setCategorizationFilters, CATEGORIZATION_FILTERS);<NEW_LINE>// This one is nasty - the syntax for analyzers takes either names or objects at many levels, hence it's not<NEW_LINE>// possible to simply declare whether the field is a string or object and a completely custom parser is required<NEW_LINE>parser.declareField(Builder::setCategorizationAnalyzerConfig, (p, c) -> CategorizationAnalyzerConfig.buildFromXContentFragment(p, ignoreUnknownFields), CATEGORIZATION_ANALYZER, ObjectParser.ValueType.OBJECT_OR_STRING);<NEW_LINE>parser.declareObject(Builder::setPerPartitionCategorizationConfig, ignoreUnknownFields ? PerPartitionCategorizationConfig.LENIENT_PARSER : PerPartitionCategorizationConfig.STRICT_PARSER, PER_PARTITION_CATEGORIZATION);<NEW_LINE>parser.declareString((builder, val) -> builder.setLatency(TimeValue.parseTimeValue(val, LATENCY.<MASK><NEW_LINE>parser.declareString(Builder::setSummaryCountFieldName, SUMMARY_COUNT_FIELD_NAME);<NEW_LINE>parser.declareStringArray(Builder::setInfluencers, INFLUENCERS);<NEW_LINE>parser.declareBoolean(Builder::setMultivariateByFields, MULTIVARIATE_BY_FIELDS);<NEW_LINE>parser.declareString((builder, val) -> builder.setModelPruneWindow(TimeValue.parseTimeValue(val, MODEL_PRUNE_WINDOW.getPreferredName())), MODEL_PRUNE_WINDOW);<NEW_LINE>return parser;<NEW_LINE>} | getPreferredName())), LATENCY); |
612,882 | private void queueWriteRequest() {<NEW_LINE>// non-contiguous write<NEW_LINE>// signal write ready<NEW_LINE>LockToken readRangeLockToken = null;<NEW_LINE>try {<NEW_LINE>readRangeLockToken = _lockProvider.acquireReaderLock(_batchStartOffset, _batchNextOffset, _eventBuffer.getBufferPositionParser(), "EventLogWriter.queueWriteRequest");<NEW_LINE>} catch (InterruptedException e1) {<NEW_LINE>LOG.warn("queueWriteRequest read lock wait interrupted", e1);<NEW_LINE>_stopRunning.set(true);<NEW_LINE>} catch (TimeoutException e1) {<NEW_LINE>LOG.error("queueWriteRequest read lock wait timed out", e1);<NEW_LINE>_stopRunning.set(true);<NEW_LINE>}<NEW_LINE>if (_blockOnWrite) {<NEW_LINE>try {<NEW_LINE>_contiguousRanges.put(readRangeLockToken);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>LOG.info("interrupted");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>boolean <MASK><NEW_LINE>if (!addRange) {<NEW_LINE>// Not able to keep up with event load<NEW_LINE>// Abandon persisting?<NEW_LINE>LOG.error("Not able to keep up with event load, abandoning attempts to persist the buffer");<NEW_LINE>_stopRunning.set(true);<NEW_LINE>// Release all the read locks<NEW_LINE>for (LockToken readRangeToken : _contiguousRanges) {<NEW_LINE>_lockProvider.releaseReaderLock(readRangeToken);<NEW_LINE>}<NEW_LINE>_lockProvider.releaseReaderLock(readRangeLockToken);<NEW_LINE>// Delete all the files generated so far<NEW_LINE>if (_writeSessionDir.exists()) {<NEW_LINE>for (File f : _writeSessionDir.listFiles()) {<NEW_LINE>LOG.info("deleting file " + f.getAbsolutePath() + " in directory");<NEW_LINE>if (!f.delete()) {<NEW_LINE>LOG.error("deleting failed: " + f.getAbsolutePath());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | addRange = _contiguousRanges.offer(readRangeLockToken); |
646,268 | public static void toJson(PoolOptions obj, java.util.Map<String, Object> json) {<NEW_LINE>json.put("connectionTimeout", obj.getConnectionTimeout());<NEW_LINE>if (obj.getConnectionTimeoutUnit() != null) {<NEW_LINE>json.put("connectionTimeoutUnit", obj.getConnectionTimeoutUnit().name());<NEW_LINE>}<NEW_LINE>json.put("eventLoopSize", obj.getEventLoopSize());<NEW_LINE>json.put("idleTimeout", obj.getIdleTimeout());<NEW_LINE>if (obj.getIdleTimeoutUnit() != null) {<NEW_LINE>json.put("idleTimeoutUnit", obj.getIdleTimeoutUnit().name());<NEW_LINE>}<NEW_LINE>json.put("maxSize", obj.getMaxSize());<NEW_LINE>json.put("maxWaitQueueSize", obj.getMaxWaitQueueSize());<NEW_LINE>if (obj.getName() != null) {<NEW_LINE>json.put("name", obj.getName());<NEW_LINE>}<NEW_LINE>json.put("poolCleanerPeriod", obj.getPoolCleanerPeriod());<NEW_LINE>json.put(<MASK><NEW_LINE>} | "shared", obj.isShared()); |
509,566 | public void save(int rowIndex) {<NEW_LINE>List<String> errorColumnIds = null;<NEW_LINE>String errorMessage = null;<NEW_LINE>boolean success = false;<NEW_LINE>try {<NEW_LINE>saveEditor();<NEW_LINE>success = true;<NEW_LINE>} catch (CommitException e) {<NEW_LINE>try {<NEW_LINE>CommitErrorEvent event = new CommitErrorEvent(Grid.this, e);<NEW_LINE>getEditorErrorHandler().commitError(event);<NEW_LINE>errorMessage = event.getUserErrorMessage();<NEW_LINE>errorColumnIds = new ArrayList<String>();<NEW_LINE>for (Column column : event.getErrorColumns()) {<NEW_LINE>errorColumnIds.add(column.state.id);<NEW_LINE>}<NEW_LINE>} catch (Exception ee) {<NEW_LINE>// A badly written error handler can throw an exception,<NEW_LINE>// which would lock up the Grid<NEW_LINE>handleError(ee);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>handleError(e);<NEW_LINE>}<NEW_LINE>getEditorRpc().<MASK><NEW_LINE>} | confirmSave(success, errorMessage, errorColumnIds); |
278,166 | public static void parse(String jsonString, JsonConsumer consumer) {<NEW_LINE>char[] chars = jsonString.toCharArray();<NEW_LINE>Deque<State> state = new ArrayDeque<>();<NEW_LINE>state.push(State.ANY);<NEW_LINE>int position = 0;<NEW_LINE>while (!state.isEmpty()) {<NEW_LINE>State current = state.pop();<NEW_LINE>position = consumeWhiteSpace(chars, position);<NEW_LINE>assertInput(chars, position);<NEW_LINE>switch(current) {<NEW_LINE>case ANY:<NEW_LINE>position = consumeAny(chars, position, consumer, state);<NEW_LINE>break;<NEW_LINE>case ARRAY_END_OR_VALUE:<NEW_LINE>position = consumeArrayEndOrValue(chars, position, consumer, state);<NEW_LINE>break;<NEW_LINE>case ARRAY_END_OR_COMMA:<NEW_LINE>position = consumeArrayEndOrComa(chars, position, consumer, state);<NEW_LINE>break;<NEW_LINE>case ARRAY_VALUE:<NEW_LINE>state.push(State.ARRAY_END_OR_COMMA);<NEW_LINE>position = consumeAny(chars, position, consumer, state);<NEW_LINE>break;<NEW_LINE>case OBJECT_KEY_OR_END:<NEW_LINE>position = consumeObjectKeyOrEnd(<MASK><NEW_LINE>break;<NEW_LINE>case OBJECT_VALUE:<NEW_LINE>state.push(State.OBJECT_END_OR_COMMA);<NEW_LINE>position = consumeAny(chars, position, consumer, state);<NEW_LINE>break;<NEW_LINE>case OBJECT_END_OR_COMMA:<NEW_LINE>position = consumeObjectEndOrComma(chars, position, consumer, state);<NEW_LINE>break;<NEW_LINE>case OBJECT_KEY:<NEW_LINE>position = consumeObjectKey(chars, position, consumer, state);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>position = consumeWhiteSpace(chars, position);<NEW_LINE>if (position < chars.length) {<NEW_LINE>throw new UnexpectedTokenException(position, "end of input");<NEW_LINE>}<NEW_LINE>} | chars, position, consumer, state); |
1,583,745 | final PutAppsListResult executePutAppsList(PutAppsListRequest putAppsListRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(putAppsListRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<PutAppsListRequest> request = null;<NEW_LINE>Response<PutAppsListResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new PutAppsListRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(putAppsListRequest));<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, "FMS");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "PutAppsList");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<PutAppsListResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new PutAppsListResultJsonUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | invoke(request, responseHandler, executionContext); |
1,787,832 | public static Vector apply(LongLongVector v1, LongDummyVector v2, Binary op) {<NEW_LINE>if (v1.isSparse()) {<NEW_LINE>if (op.isKeepStorage()) {<NEW_LINE>throw new AngelException("operation is not support!");<NEW_LINE>} else {<NEW_LINE>// multi-rehash<NEW_LINE>LongLongVectorStorage newStorage = v1.getStorage().emptySparse((int) (v1.getDim()));<NEW_LINE>LongLongVectorStorage v1Storage = v1.getStorage();<NEW_LINE>for (int i = 0; i < v1.getDim(); i++) {<NEW_LINE>if (v1Storage.hasKey(i)) {<NEW_LINE>newStorage.set(i, op.apply(v1.get(i), v2.get(i)));<NEW_LINE>} else {<NEW_LINE>newStorage.set(i, op.apply(0, v2.get(i)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>v1.setStorage(newStorage);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// sorted<NEW_LINE>if (op.isKeepStorage()) {<NEW_LINE>throw new AngelException("operation is not support!");<NEW_LINE>} else {<NEW_LINE>LongLongVectorStorage newStorage = new LongLongSparseVectorStorage(v1.getDim());<NEW_LINE>LongLongVectorStorage v1Storage = v1.getStorage();<NEW_LINE>for (int i = 0; i < v1.getDim(); i++) {<NEW_LINE>if (v1Storage.hasKey(i)) {<NEW_LINE>newStorage.set(i, op.apply(v1.get(i), <MASK><NEW_LINE>} else {<NEW_LINE>newStorage.set(i, op.apply(0, v2.get(i)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>v1.setStorage(newStorage);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return v1;<NEW_LINE>} | v2.get(i))); |
1,533,193 | public ApplicationSource unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ApplicationSource applicationSource = new ApplicationSource();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("CloudFormationStackARN", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>applicationSource.setCloudFormationStackARN(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("TagFilters", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>applicationSource.setTagFilters(new ListUnmarshaller<TagFilter>(TagFilterJsonUnmarshaller.getInstance(<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return applicationSource;<NEW_LINE>} | )).unmarshall(context)); |
502,816 | private void stateChanged() {<NEW_LINE>// NOI18N<NEW_LINE>LOGGER.log(Level.FINE, "Updating the lookup content");<NEW_LINE>Set servers = new HashSet(ServerRegistry.getInstance().getServers());<NEW_LINE>synchronized (LOCK) {<NEW_LINE>for (Iterator<Map.Entry<Server, T>> it = serversMap.entrySet().iterator(); it.hasNext(); ) {<NEW_LINE>Map.Entry<Server, T> entry = it.next();<NEW_LINE>Server server = entry.getKey();<NEW_LINE>if (!servers.contains(server)) {<NEW_LINE>beforeFinish(entry.getValue());<NEW_LINE>content.remove(serversMap.get(server));<NEW_LINE>it.remove();<NEW_LINE>finishBridgingInstance(server, entry.getValue());<NEW_LINE>} else {<NEW_LINE>servers.remove(server);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (Iterator it = servers.iterator(); it.hasNext(); ) {<NEW_LINE>Server server = (Server) it.next();<NEW_LINE>T instance = createBridgingInstance(server);<NEW_LINE>if (instance != null) {<NEW_LINE>content.add(instance);<NEW_LINE><MASK><NEW_LINE>afterAddition(instance);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>LOGGER.log(Level.FINE, "Lookup content updated");<NEW_LINE>} | serversMap.put(server, instance); |
327,773 | public void run(final JobExecutionContext jobContext) throws JobExecutionException {<NEW_LINE>final Permissionable permissionable;<NEW_LINE>final Trigger trigger = jobContext.getTrigger();<NEW_LINE>final Map<String, Serializable> map = getExecutionData(trigger, CascadePermissionsJob.class);<NEW_LINE>final String permissionableId = (<MASK><NEW_LINE>final String roleId = (String) map.get("roleId");<NEW_LINE>final String userId = (String) map.get("userId");<NEW_LINE>try {<NEW_LINE>permissionable = retrievePermissionable(permissionableId);<NEW_LINE>final Role role = roleAPI.loadRoleById(roleId);<NEW_LINE>permissionAPI.cascadePermissionUnder(permissionable, role);<NEW_LINE>permissionAPI.removePermissionableFromCache(permissionable.getPermissionId());<NEW_LINE>if (UtilMethods.isSet(userId)) {<NEW_LINE>// no actions<NEW_LINE>notificationAPI.// no actions<NEW_LINE>generateNotification(// no actions<NEW_LINE>new I18NMessage("notification.identifier.cascadepermissionsjob.info.title"), // no actions<NEW_LINE>new I18NMessage("notification.cascade.permissions.success"), null, NotificationLevel.INFO, NotificationType.GENERIC, Visibility.USER, userId, userId, userAPI.getSystemUser().getLocale());<NEW_LINE>}<NEW_LINE>Logger.info(CascadePermissionsJob.class, String.format("CascadePermissionsJob ::: finished for role `%s` and user `%s` .", roleId, userId));<NEW_LINE>} catch (DotDataException | DotSecurityException e) {<NEW_LINE>Logger.error(CascadePermissionsJob.class, e.getMessage(), e);<NEW_LINE>if (UtilMethods.isSet(userId)) {<NEW_LINE>try {<NEW_LINE>// no actions<NEW_LINE>notificationAPI.// no actions<NEW_LINE>generateNotification(// no actions<NEW_LINE>new I18NMessage("notification.identifier.cascadepermissionsjob.info.title"), // no actions<NEW_LINE>new I18NMessage("notification.cascade.permissions.error"), null, NotificationLevel.ERROR, NotificationType.GENERIC, Visibility.USER, userId, userId, userAPI.getSystemUser().getLocale());<NEW_LINE>} catch (DotDataException e1) {<NEW_LINE>Logger.error(CascadePermissionsJob.class, e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw new DotRuntimeException(e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | String) map.get("permissionableId"); |
9,039 | public void testContextInfoWildCardNoMatch() throws Exception {<NEW_LINE>CommonTasks.writeLogMsg(Level.INFO, "**** >>>>> server configuration thresholds for - <global - slow : 120s , hung : 120s> <timing - Slow : 5s , hung : 10s>");<NEW_LINE>server.setServerConfigurationFile("contextInfoPattern/server_timing_5.xml");<NEW_LINE>server.waitForStringInLog("CWWKG0017I", 30000);<NEW_LINE>server.setMarkToEndOfLog();<NEW_LINE>// Should sleep and not hit hung request threshold since the global defaults<NEW_LINE>// are longer than all the context-info-specific settings.<NEW_LINE>long startTime = System.nanoTime();<NEW_LINE>createRequests(12000, 1);<NEW_LINE>long elapsedSeconds = TimeUnit.SECONDS.convert(System.nanoTime() - startTime, TimeUnit.NANOSECONDS);<NEW_LINE>assertTrue("Test did not run long enough (elapsedSeconds)", elapsedSeconds >= 12);<NEW_LINE>// Make sure we didn't get any hung request messages<NEW_LINE>assertTrue("Test should not have found any slow request messages", fetchSlowRequestWarningsCount() == 0);<NEW_LINE>assertTrue("Test should not have found any hung request messages", fetchHungRequestWarningsCount() == 0);<NEW_LINE>// OK now test the opposite - that we do timeout because the global settings are short.<NEW_LINE>CommonTasks.<MASK><NEW_LINE>server.setServerConfigurationFile("contextInfoPattern/server_timing_6.xml");<NEW_LINE>server.waitForStringInLog("CWWKG0017I", 30000);<NEW_LINE>server.setMarkToEndOfLog();<NEW_LINE>// Should sleep and hit the hung request threshold since the context info specific settings<NEW_LINE>// are longer than the global defaults.<NEW_LINE>startTime = System.nanoTime();<NEW_LINE>createRequests(12000, 1);<NEW_LINE>elapsedSeconds = TimeUnit.SECONDS.convert(System.nanoTime() - startTime, TimeUnit.NANOSECONDS);<NEW_LINE>assertTrue("Test did not run long enough (elapsedSeconds)", elapsedSeconds >= 12);<NEW_LINE>// Make sure we had some hung request messages<NEW_LINE>assertTrue("Test should have found slow request messages", fetchSlowRequestWarningsCount() > 0);<NEW_LINE>assertTrue("Test should have found hung request messages", fetchHungRequestWarningsCount() > 0);<NEW_LINE>CommonTasks.writeLogMsg(Level.INFO, "***** Testcase pass *****");<NEW_LINE>} | writeLogMsg(Level.INFO, "**** >>>>> server configuration thresholds for - <global - slow : 5s , hung : 10s> <timing - Slow : 120s , hung : 120s>"); |
607,479 | public static void generateApplicationElbFiles(Map<String, List<LoadBalancerVH>> elbMap) throws IOException {<NEW_LINE>String fieldNames;<NEW_LINE>String keys;<NEW_LINE>fieldNames = "lb.LoadBalancerArn`lb.DNSName`lb.CanonicalHostedZoneID`lb.CreatedTime`lb.LoadBalancerName`lb.Scheme`lb.VPCId`AvailabilityZones`lb.type`subnets`accessLogBucketName`accessLog";<NEW_LINE>keys = "discoverydate`accountid`accountname`region`loadbalancerarn`dnsname`canonicalhostedzoneid`createdtime`loadbalancername`scheme`vpcid`availabilityzones`type`subnets`accesslogbucketname`accesslog";<NEW_LINE>FileGenerator.generateJson(elbMap, fieldNames, "aws-appelb.data", keys);<NEW_LINE>fieldNames = "lb.LoadBalancerName`tags.key`tags.value";<NEW_LINE>keys = "discoverydate`accountid`accountname`region`loadbalancername`key`value";<NEW_LINE>FileGenerator.generateJson(<MASK><NEW_LINE>fieldNames = "lb.LoadBalancerName`lb.securityGroups";<NEW_LINE>keys = "discoverydate`accountid`accountname`region`loadbalancername`securitygroupid";<NEW_LINE>FileGenerator.generateJson(elbMap, fieldNames, "aws-appelb-secgroups.data", keys);<NEW_LINE>} | elbMap, fieldNames, "aws-appelb-tags.data", keys); |
1,843,797 | ActionResult<Wo> execute(EffectivePerson effectivePerson, String id) throws Exception {<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>Business business = new Business(emc);<NEW_LINE>ActionResult<Wo> result = new ActionResult<>();<NEW_LINE>ImportModel model = business.pick(id, ImportModel.class);<NEW_LINE>if (null == model) {<NEW_LINE>throw new ExceptionEntityNotExist(id, ImportModel.class);<NEW_LINE>}<NEW_LINE>Query query = business.pick(model.<MASK><NEW_LINE>if (null == query) {<NEW_LINE>throw new ExceptionEntityNotExist(model.getQuery(), Query.class);<NEW_LINE>}<NEW_LINE>if (!business.readable(effectivePerson, query)) {<NEW_LINE>throw new ExceptionAccessDenied(effectivePerson, query);<NEW_LINE>}<NEW_LINE>if (!business.readable(effectivePerson, model)) {<NEW_LINE>throw new ExceptionAccessDenied(effectivePerson, model);<NEW_LINE>}<NEW_LINE>Wo wo = Wo.copier.copy(model);<NEW_LINE>result.setData(wo);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>} | getQuery(), Query.class); |
1,122,453 | public InsertTabletPlan generateInsertTabletPlan() throws IllegalPathException {<NEW_LINE>List<String> <MASK><NEW_LINE>int countOfNonEmptyColumns = 0;<NEW_LINE>for (int i = 0; i < columns.length; ++i) {<NEW_LINE>if (columns[i] == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>nonEmptyColumnNames.add(targetMeasurementIds.get(i));<NEW_LINE>columns[countOfNonEmptyColumns] = columns[i];<NEW_LINE>bitMaps[countOfNonEmptyColumns] = bitMaps[i];<NEW_LINE>dataTypes[countOfNonEmptyColumns] = dataTypes[i];<NEW_LINE>++countOfNonEmptyColumns;<NEW_LINE>}<NEW_LINE>InsertTabletPlan insertTabletPlan = new InsertTabletPlan(new PartialPath(targetDevice), nonEmptyColumnNames);<NEW_LINE>insertTabletPlan.setAligned(isIntoPathsAligned);<NEW_LINE>insertTabletPlan.setRowCount(rowCount);<NEW_LINE>if (countOfNonEmptyColumns != columns.length) {<NEW_LINE>columns = Arrays.copyOf(columns, countOfNonEmptyColumns);<NEW_LINE>bitMaps = Arrays.copyOf(bitMaps, countOfNonEmptyColumns);<NEW_LINE>dataTypes = Arrays.copyOf(dataTypes, countOfNonEmptyColumns);<NEW_LINE>}<NEW_LINE>if (rowCount != tabletRowLimit) {<NEW_LINE>times = Arrays.copyOf(times, rowCount);<NEW_LINE>for (int i = 0; i < columns.length; ++i) {<NEW_LINE>switch(dataTypes[i]) {<NEW_LINE>case BOOLEAN:<NEW_LINE>columns[i] = Arrays.copyOf((boolean[]) columns[i], rowCount);<NEW_LINE>break;<NEW_LINE>case INT32:<NEW_LINE>columns[i] = Arrays.copyOf((int[]) columns[i], rowCount);<NEW_LINE>break;<NEW_LINE>case INT64:<NEW_LINE>columns[i] = Arrays.copyOf((long[]) columns[i], rowCount);<NEW_LINE>break;<NEW_LINE>case FLOAT:<NEW_LINE>columns[i] = Arrays.copyOf((float[]) columns[i], rowCount);<NEW_LINE>break;<NEW_LINE>case DOUBLE:<NEW_LINE>columns[i] = Arrays.copyOf((double[]) columns[i], rowCount);<NEW_LINE>break;<NEW_LINE>case TEXT:<NEW_LINE>columns[i] = Arrays.copyOf((Binary[]) columns[i], rowCount);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new UnSupportedDataTypeException(String.format("Data type %s is not supported.", dataTypes[i]));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>insertTabletPlan.setTimes(times);<NEW_LINE>insertTabletPlan.setColumns(columns);<NEW_LINE>insertTabletPlan.setBitMaps(bitMaps);<NEW_LINE>insertTabletPlan.setDataTypes(dataTypes);<NEW_LINE>return insertTabletPlan;<NEW_LINE>} | nonEmptyColumnNames = new ArrayList<>(); |
592,434 | public boolean entityTypesAgree(Mention m, Dictionaries dict, boolean strict) {<NEW_LINE>if (strict) {<NEW_LINE>return nerString.equals(m.nerString);<NEW_LINE>} else {<NEW_LINE>if (isPronominal()) {<NEW_LINE>if (nerString.contains("-") || m.nerString.contains("-")) {<NEW_LINE>// for ACE with gold NE<NEW_LINE>if (m.nerString.equals("O")) {<NEW_LINE>return true;<NEW_LINE>} else if (m.nerString.startsWith("ORG")) {<NEW_LINE>return dict.organizationPronouns.contains(headString);<NEW_LINE>} else if (m.nerString.startsWith("PER")) {<NEW_LINE>return dict.personPronouns.contains(headString);<NEW_LINE>} else if (m.nerString.startsWith("LOC")) {<NEW_LINE>return dict.locationPronouns.contains(headString);<NEW_LINE>} else if (m.nerString.startsWith("GPE")) {<NEW_LINE>return dict.GPEPronouns.contains(headString);<NEW_LINE>} else if (m.nerString.startsWith("VEH") || m.nerString.startsWith("FAC") || m.nerString.startsWith("WEA")) {<NEW_LINE>return dict.facilityVehicleWeaponPronouns.contains(headString);<NEW_LINE>} else {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// ACE w/o gold NE or MUC<NEW_LINE>switch(m.nerString) {<NEW_LINE>case "O":<NEW_LINE>return true;<NEW_LINE>case "MISC":<NEW_LINE>return true;<NEW_LINE>case "ORGANIZATION":<NEW_LINE>return dict.organizationPronouns.contains(headString);<NEW_LINE>case "PERSON":<NEW_LINE>return dict.personPronouns.contains(headString);<NEW_LINE>case "LOCATION":<NEW_LINE>return dict.locationPronouns.contains(headString);<NEW_LINE>case "DATE":<NEW_LINE>case "TIME":<NEW_LINE>return dict.dateTimePronouns.contains(headString);<NEW_LINE>case "MONEY":<NEW_LINE>case "PERCENT":<NEW_LINE>case "NUMBER":<NEW_LINE>return <MASK><NEW_LINE>default:<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return nerString.equals("O") || m.nerString.equals("O") || nerString.equals(m.nerString);<NEW_LINE>}<NEW_LINE>} | dict.moneyPercentNumberPronouns.contains(headString); |
1,612,124 | private void acceptCommand(final TypedRecord<JobRecord> command, final CommandControl<JobRecord> commandControl) {<NEW_LINE>final long jobKey = command.getKey();<NEW_LINE>final JobRecord job = jobState.getJob(jobKey);<NEW_LINE>job.setErrorCode(command.getValue().getErrorCodeBuffer());<NEW_LINE>job.setErrorMessage(command.getValue().getErrorMessageBuffer());<NEW_LINE>final var serviceTaskInstanceKey = job.getElementInstanceKey();<NEW_LINE>final var serviceTaskInstance = elementInstanceState.getInstance(serviceTaskInstanceKey);<NEW_LINE>final var errorCode = job.getErrorCodeBuffer();<NEW_LINE>final var foundCatchEvent = stateAnalyzer.findCatchEvent(errorCode, serviceTaskInstance, Optional.of(job.getErrorMessageBuffer()));<NEW_LINE>this.foundCatchEvent = foundCatchEvent;<NEW_LINE>if (foundCatchEvent.isLeft()) {<NEW_LINE>job.setElementId(NO_CATCH_EVENT_FOUND);<NEW_LINE>commandControl.<MASK><NEW_LINE>} else if (!serviceTaskInstanceIsActive(serviceTaskInstance)) {<NEW_LINE>commandControl.reject(RejectionType.INVALID_STATE, "Expected to find active service task, but was " + serviceTaskInstance);<NEW_LINE>} else if (!eventScopeInstanceState.isAcceptingEvent(foundCatchEvent.get().getElementInstance().getKey())) {<NEW_LINE>commandControl.reject(RejectionType.INVALID_STATE, "Expected to find event scope that is accepting events, but was " + foundCatchEvent.get().getElementInstance());<NEW_LINE>} else {<NEW_LINE>commandControl.accept(JobIntent.ERROR_THROWN, job);<NEW_LINE>}<NEW_LINE>} | accept(JobIntent.ERROR_THROWN, job); |
1,700,069 | public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {<NEW_LINE>com.google.protobuf.GeneratedMessageV3.ExtendableMessage<com.google.transit.realtime.GtfsRealtime.FeedEntity>.ExtensionWriter extensionWriter = newExtensionWriter();<NEW_LINE>if (((bitField0_ & 0x00000001) != 0)) {<NEW_LINE>com.google.protobuf.GeneratedMessageV3.writeString(output, 1, id_);<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000002) != 0)) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000004) != 0)) {<NEW_LINE>output.writeMessage(3, getTripUpdate());<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000008) != 0)) {<NEW_LINE>output.writeMessage(4, getVehicle());<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000010) != 0)) {<NEW_LINE>output.writeMessage(5, getAlert());<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000020) != 0)) {<NEW_LINE>output.writeMessage(6, getShape());<NEW_LINE>}<NEW_LINE>extensionWriter.writeUntil(2000, output);<NEW_LINE>extensionWriter.writeUntil(10000, output);<NEW_LINE>unknownFields.writeTo(output);<NEW_LINE>} | output.writeBool(2, isDeleted_); |
754,517 | // createInvoiceLine<NEW_LINE>// metas<NEW_LINE>@SuppressWarnings("unused")<NEW_LINE>private int addPayments(MDunningLevel level) {<NEW_LINE>String sql = // ##1<NEW_LINE>"SELECT C_Payment_ID, C_Currency_ID, PayAmt," + " paymentAvailable(C_Payment_ID), C_BPartner_ID " + "FROM C_Payment_v p " + "WHERE AD_Client_ID=?" + " AND IsAllocated='N' AND C_BPartner_ID IS NOT NULL" + " AND C_Charge_ID IS NULL" + // Only BP with Dunning defined<NEW_LINE>" AND DocStatus IN ('CO','CL')" + " AND EXISTS (SELECT * FROM C_BPartner bp " + // ##2<NEW_LINE>"WHERE p.C_BPartner_ID=bp.C_BPartner_ID" + " AND bp.C_Dunning_ID=(SELECT C_Dunning_ID FROM C_DunningLevel WHERE C_DunningLevel_ID=?))";<NEW_LINE>if (p_C_BPartner_ID != 0)<NEW_LINE>// ##3<NEW_LINE>sql += " AND C_BPartner_ID=?";<NEW_LINE>else if (p_C_BP_Group_ID != 0)<NEW_LINE>sql += // ##3<NEW_LINE>" AND EXISTS (SELECT * FROM C_BPartner bp " + "WHERE p.C_BPartner_ID=bp.C_BPartner_ID AND bp.C_BP_Group_ID=?)";<NEW_LINE>if (p_OnlySOTrx)<NEW_LINE>sql += " AND IsReceipt='Y'";<NEW_LINE>if (p_AD_Org_ID != 0)<NEW_LINE>sql += " AND p.AD_Org_ID=" + p_AD_Org_ID;<NEW_LINE>int count = 0;<NEW_LINE>PreparedStatement pstmt = null;<NEW_LINE>ResultSet rs = null;<NEW_LINE>try {<NEW_LINE>pstmt = DB.prepareStatement(sql, get_TrxName());<NEW_LINE>pstmt.setInt(1, getAD_Client_ID());<NEW_LINE>pstmt.setInt(2, level.getC_DunningLevel_ID());<NEW_LINE>if (p_C_BPartner_ID != 0)<NEW_LINE><MASK><NEW_LINE>else if (p_C_BP_Group_ID != 0)<NEW_LINE>pstmt.setInt(3, p_C_BP_Group_ID);<NEW_LINE>rs = pstmt.executeQuery();<NEW_LINE>while (rs.next()) {<NEW_LINE>int C_Payment_ID = rs.getInt(1);<NEW_LINE>int C_Currency_ID = rs.getInt(2);<NEW_LINE>BigDecimal PayAmt = rs.getBigDecimal(3).negate();<NEW_LINE>BigDecimal OpenAmt = rs.getBigDecimal(4).negate();<NEW_LINE>int C_BPartner_ID = rs.getInt(5);<NEW_LINE>//<NEW_LINE>if (BigDecimal.ZERO.compareTo(OpenAmt) == 0)<NEW_LINE>continue;<NEW_LINE>//<NEW_LINE>if (createPaymentLine(C_Payment_ID, C_Currency_ID, PayAmt, OpenAmt, C_BPartner_ID, level.getC_DunningLevel_ID())) {<NEW_LINE>count++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.error(sql, e);<NEW_LINE>final ProcessExecutionResult result = getResult();<NEW_LINE>result.addLog(result.getPinstanceId(), null, null, e.getLocalizedMessage());<NEW_LINE>} finally {<NEW_LINE>DB.close(rs, pstmt);<NEW_LINE>rs = null;<NEW_LINE>pstmt = null;<NEW_LINE>}<NEW_LINE>return count;<NEW_LINE>} | pstmt.setInt(3, p_C_BPartner_ID); |
1,588,687 | final CreateRuleResult executeCreateRule(CreateRuleRequest createRuleRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createRuleRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateRuleRequest> request = null;<NEW_LINE>Response<CreateRuleResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new CreateRuleRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createRuleRequest));<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, "rbin");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateRule");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateRuleResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateRuleResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.RequestMarshallTime); |
693,481 | public void run() {<NEW_LINE>try {<NEW_LINE>Files.walkFileTree(root, new FileVisitor<Path>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException {<NEW_LINE>return FileVisitResult.CONTINUE;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {<NEW_LINE>try {<NEW_LINE>String nPath = root.<MASK><NEW_LINE>if (fileEndsWith != null && !fileEndsWith.isEmpty()) {<NEW_LINE>if (fileEndsWith.stream().noneMatch(nPath::endsWith)) {<NEW_LINE>return FileVisitResult.CONTINUE;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>queue.put(new Task(nPath));<NEW_LINE>return FileVisitResult.CONTINUE;<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>return FileVisitResult.TERMINATE;<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public FileVisitResult visitFileFailed(Path file, IOException exc) throws IOException {<NEW_LINE>return FileVisitResult.CONTINUE;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOException {<NEW_LINE>return FileVisitResult.CONTINUE;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (IOException ignore) {<NEW_LINE>// ignore<NEW_LINE>} finally {<NEW_LINE>try {<NEW_LINE>queue.put(new Task(null));<NEW_LINE>} catch (InterruptedException ignore) {<NEW_LINE>// ignore<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | relativize(file).toString(); |
1,259,853 | static void fromJSON(final JSONObject json) {<NEW_LINE>if (json != null) {<NEW_LINE>UserData.name = json.optString(NAME_KEY, null);<NEW_LINE>UserData.username = json.optString(USERNAME_KEY, null);<NEW_LINE>UserData.email = json.optString(EMAIL_KEY, null);<NEW_LINE>UserData.org = json.optString(ORG_KEY, null);<NEW_LINE>UserData.phone = json.optString(PHONE_KEY, null);<NEW_LINE>UserData.picture = json.optString(PICTURE_KEY, null);<NEW_LINE>UserData.gender = json.optString(GENDER_KEY, null);<NEW_LINE>UserData.byear = json.optInt(BYEAR_KEY, 0);<NEW_LINE>if (!json.isNull(CUSTOM_KEY)) {<NEW_LINE>JSONObject customJson;<NEW_LINE>try {<NEW_LINE>customJson = json.getJSONObject(CUSTOM_KEY);<NEW_LINE>if (customJson.length() == 0) {<NEW_LINE>UserData.custom = null;<NEW_LINE>} else {<NEW_LINE>UserData.custom = new HashMap<>(customJson.length());<NEW_LINE>Iterator<String> nameItr = customJson.keys();<NEW_LINE>while (nameItr.hasNext()) {<NEW_LINE>final <MASK><NEW_LINE>if (!customJson.isNull(key)) {<NEW_LINE>UserData.custom.put(key, customJson.getString(key));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (JSONException e) {<NEW_LINE>Countly.sharedInstance().L.w("[ModuleUserProfile] Got exception converting an Custom Json to Custom User data", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | String key = nameItr.next(); |
1,333,267 | public static TaobaoFilmGetSchedulesResponse unmarshall(TaobaoFilmGetSchedulesResponse taobaoFilmGetSchedulesResponse, UnmarshallerContext _ctx) {<NEW_LINE>taobaoFilmGetSchedulesResponse.setRequestId(_ctx.stringValue("TaobaoFilmGetSchedulesResponse.RequestId"));<NEW_LINE>taobaoFilmGetSchedulesResponse.setErrorCode(_ctx.stringValue("TaobaoFilmGetSchedulesResponse.ErrorCode"));<NEW_LINE>taobaoFilmGetSchedulesResponse.setMsg(_ctx.stringValue("TaobaoFilmGetSchedulesResponse.Msg"));<NEW_LINE>taobaoFilmGetSchedulesResponse.setSubCode(_ctx.stringValue("TaobaoFilmGetSchedulesResponse.SubCode"));<NEW_LINE>taobaoFilmGetSchedulesResponse.setSubMsg(_ctx.stringValue("TaobaoFilmGetSchedulesResponse.SubMsg"));<NEW_LINE>taobaoFilmGetSchedulesResponse.setLogsId(_ctx.stringValue("TaobaoFilmGetSchedulesResponse.LogsId"));<NEW_LINE>List<SchedulesItem> schedules = new ArrayList<SchedulesItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("TaobaoFilmGetSchedulesResponse.Schedules.Length"); i++) {<NEW_LINE>SchedulesItem schedulesItem = new SchedulesItem();<NEW_LINE>schedulesItem.setCinemaId(_ctx.longValue("TaobaoFilmGetSchedulesResponse.Schedules[" + i + "].CinemaId"));<NEW_LINE>schedulesItem.setCloseTime(_ctx.stringValue("TaobaoFilmGetSchedulesResponse.Schedules[" + i + "].CloseTime"));<NEW_LINE>schedulesItem.setHallName(_ctx.stringValue("TaobaoFilmGetSchedulesResponse.Schedules[" + i + "].HallName"));<NEW_LINE>schedulesItem.setId(_ctx.longValue("TaobaoFilmGetSchedulesResponse.Schedules[" + i + "].Id"));<NEW_LINE>schedulesItem.setIsExpired(_ctx.booleanValue("TaobaoFilmGetSchedulesResponse.Schedules[" + i + "].IsExpired"));<NEW_LINE>schedulesItem.setMaxCanBuy(_ctx.longValue("TaobaoFilmGetSchedulesResponse.Schedules[" + i + "].MaxCanBuy"));<NEW_LINE>schedulesItem.setPrice(_ctx.longValue("TaobaoFilmGetSchedulesResponse.Schedules[" + i + "].Price"));<NEW_LINE>schedulesItem.setScheduleArea(_ctx.stringValue("TaobaoFilmGetSchedulesResponse.Schedules[" + i + "].ScheduleArea"));<NEW_LINE>schedulesItem.setSectionId(_ctx.stringValue("TaobaoFilmGetSchedulesResponse.Schedules[" + i + "].SectionId"));<NEW_LINE>schedulesItem.setServiceFee(_ctx.longValue("TaobaoFilmGetSchedulesResponse.Schedules[" + i + "].ServiceFee"));<NEW_LINE>schedulesItem.setShowDate(_ctx.stringValue("TaobaoFilmGetSchedulesResponse.Schedules[" + i + "].ShowDate"));<NEW_LINE>schedulesItem.setShowId(_ctx.longValue("TaobaoFilmGetSchedulesResponse.Schedules[" + i + "].ShowId"));<NEW_LINE>schedulesItem.setShowTime(_ctx.stringValue("TaobaoFilmGetSchedulesResponse.Schedules[" + i + "].ShowTime"));<NEW_LINE>schedulesItem.setShowVersion(_ctx.stringValue("TaobaoFilmGetSchedulesResponse.Schedules[" + i + "].ShowVersion"));<NEW_LINE>schedulesItem.setHallId(_ctx.stringValue<MASK><NEW_LINE>schedules.add(schedulesItem);<NEW_LINE>}<NEW_LINE>taobaoFilmGetSchedulesResponse.setSchedules(schedules);<NEW_LINE>return taobaoFilmGetSchedulesResponse;<NEW_LINE>} | ("TaobaoFilmGetSchedulesResponse.Schedules[" + i + "].HallId")); |
1,818,084 | private boolean checkSelfIntersections_() {<NEW_LINE>MultiPathImpl multiPathImpl = (MultiPathImpl) m_geometry._getImpl();<NEW_LINE>m_edges.clear();<NEW_LINE>// we reuse the edges while going through a<NEW_LINE>m_edges.ensureCapacity(20);<NEW_LINE>// polygon.<NEW_LINE>m_lineEdgesRecycle.clear();<NEW_LINE>// we reuse the edges while going<NEW_LINE>m_lineEdgesRecycle.ensureCapacity(20);<NEW_LINE>// through a polygon.<NEW_LINE>m_recycledSegIter = multiPathImpl.querySegmentIterator();<NEW_LINE>m_recycledSegIter.setCirculator(true);<NEW_LINE>// stores<NEW_LINE>AttributeStreamOfInt32 bunch = new AttributeStreamOfInt32(0);<NEW_LINE>// coincident<NEW_LINE>// vertices<NEW_LINE>bunch.reserve(10);<NEW_LINE>int pointCount = multiPathImpl.getPointCount();<NEW_LINE>double xprev = NumberUtils.TheNaN;<NEW_LINE>double yprev = 0;<NEW_LINE>// We already have a sorted list of vertices from clustering check.<NEW_LINE>for (int index = 0, n = pointCount * 2; index < n; index++) {<NEW_LINE>int pairIndex = m_pairIndices.get(index);<NEW_LINE>int pair = m_pairs.get(pairIndex);<NEW_LINE>if ((pair & 1) != 0)<NEW_LINE>// m_pairs array is redundant. See checkClustering_.<NEW_LINE>continue;<NEW_LINE>int xyindex = pair >> 1;<NEW_LINE>double x = <MASK><NEW_LINE>double y = m_xy.read(2 * xyindex + 1);<NEW_LINE>if (bunch.size() != 0) {<NEW_LINE>if (x != xprev || y != yprev) {<NEW_LINE>if (!processBunchForSelfIntersectionTest_(bunch))<NEW_LINE>return false;<NEW_LINE>if (bunch != null)<NEW_LINE>bunch.clear(false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>bunch.add(xyindex);<NEW_LINE>xprev = x;<NEW_LINE>yprev = y;<NEW_LINE>}<NEW_LINE>// cannot be empty<NEW_LINE>assert (bunch.size() > 0);<NEW_LINE>if (!processBunchForSelfIntersectionTest_(bunch))<NEW_LINE>return false;<NEW_LINE>return true;<NEW_LINE>} | m_xy.read(2 * xyindex); |
1,785,920 | public void process(JCas jcas) throws AnalysisEngineProcessException {<NEW_LINE>Collection<Integer> visitedIDs = new TreeSet<Integer>();<NEW_LINE>results = new ArrayList<>();<NEW_LINE>i = 0;<NEW_LINE>Map<Integer, Concept> concepts = new HashMap<>();<NEW_LINE>SolrDocumentList documents;<NEW_LINE>int i;<NEW_LINE>try {<NEW_LINE>for (Concept concept : JCasUtil.select(questionView, Concept.class)) concepts.put(<MASK><NEW_LINE>Collection<Integer> IDs = concepts.keySet();<NEW_LINE>documents = solr.runIDQuery(IDs, hitListSize, /* XXX: should we even limit this? */<NEW_LINE>logger);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new AnalysisEngineProcessException(e);<NEW_LINE>}<NEW_LINE>i = 0;<NEW_LINE>for (SolrDocument doc : documents) {<NEW_LINE>Integer id = (Integer) doc.getFieldValue("id");<NEW_LINE>visitedIDs.add(id);<NEW_LINE>try {<NEW_LINE>Collection<Clue> clues = JCasUtil.select(questionView, Clue.class);<NEW_LINE>Collection<SolrTerm> terms = SolrTerm.cluesToTerms(clues);<NEW_LINE>documents = solr.runQuery(terms, hitListSize, settings, logger);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new AnalysisEngineProcessException(e);<NEW_LINE>}<NEW_LINE>i = 0;<NEW_LINE>for (SolrDocument doc : documents) {<NEW_LINE>Integer docID = (Integer) doc.getFieldValue("id");<NEW_LINE>if (visitedIDs.contains(docID)) {<NEW_LINE>logger.info(" REDUNDANT: " + docID);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>visitedIDs.add(docID); | concept.getPageID(), concept); |
553,961 | final PurchaseReservedElasticsearchInstanceOfferingResult executePurchaseReservedElasticsearchInstanceOffering(PurchaseReservedElasticsearchInstanceOfferingRequest purchaseReservedElasticsearchInstanceOfferingRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(purchaseReservedElasticsearchInstanceOfferingRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<PurchaseReservedElasticsearchInstanceOfferingRequest> request = null;<NEW_LINE>Response<PurchaseReservedElasticsearchInstanceOfferingResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new PurchaseReservedElasticsearchInstanceOfferingRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(purchaseReservedElasticsearchInstanceOfferingRequest));<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, "Elasticsearch Service");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "PurchaseReservedElasticsearchInstanceOffering");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<PurchaseReservedElasticsearchInstanceOfferingResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new PurchaseReservedElasticsearchInstanceOfferingResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.endEvent(Field.RequestMarshallTime); |
1,381,926 | private void showFilter(final NotificationFilter filter) {<NEW_LINE>if (null == filter) {<NEW_LINE>txtFilterName.setText(null);<NEW_LINE>pnlCateogories.removeAll();<NEW_LINE>pnlCateogories.add(new CateogoriesPanel(null), BorderLayout.CENTER);<NEW_LINE>} else {<NEW_LINE>CategoryFilter categoryFilter = filter.getCategoryFilter();<NEW_LINE>CateogoriesPanel cPanel = filter2types.get(categoryFilter);<NEW_LINE>if (cPanel == null) {<NEW_LINE>cPanel = new CateogoriesPanel(categoryFilter == null ? new CategoryFilter() : categoryFilter);<NEW_LINE>filter2types.put(categoryFilter, cPanel);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>pnlCateogories.removeAll();<NEW_LINE>pnlCateogories.add(cPanel, BorderLayout.CENTER);<NEW_LINE>cPanel.setVisible(true);<NEW_LINE>// select the active filter<NEW_LINE>if (filterModel.getSelectedFilter() != filter) {<NEW_LINE>// check to prevent cycle in notifications<NEW_LINE>listFilters.setSelectedIndex(filterModel.getIndexOf(filter));<NEW_LINE>}<NEW_LINE>txtFilterName.setText(filter.getName());<NEW_LINE>}<NEW_LINE>pnlCateogories.validate();<NEW_LINE>pnlCateogories.repaint();<NEW_LINE>} | cPanel.addPropertyChangeListener(PROP_VALUE_VALID, this); |
181,401 | protected void process() {<NEW_LINE>AccountingBatch accountingBatch = batch.getAccountingBatch();<NEW_LINE>List<String> filterList = new ArrayList<>();<NEW_LINE>List<Pair<String, Object>> bindingList = new ArrayList<>();<NEW_LINE>filterList.add("self.operationTypeSelect = :operationTypeSelect");<NEW_LINE>bindingList.add(Pair.of("operationTypeSelect", (Object) InvoiceRepository.OPERATION_TYPE_CLIENT_SALE));<NEW_LINE>filterList.add("self.statusSelect = :statusSelect");<NEW_LINE>bindingList.add(Pair.of("statusSelect", (Object) InvoiceRepository.STATUS_VENTILATED));<NEW_LINE>filterList.add("self.amountRemaining > 0");<NEW_LINE>filterList.add("self.hasPendingPayments = FALSE");<NEW_LINE>LocalDate dueDate = accountingBatch.getDueDate() != null ? accountingBatch.getDueDate() : Beans.get(AppBaseService.class).getTodayDate(accountingBatch.getCompany());<NEW_LINE>filterList.add("self.dueDate <= :dueDate");<NEW_LINE>bindingList.add(Pair.of("dueDate", (Object) dueDate));<NEW_LINE>if (accountingBatch.getCompany() != null) {<NEW_LINE>filterList.add("self.company = :company");<NEW_LINE>bindingList.add(Pair.of("company", (Object) accountingBatch.getCompany()));<NEW_LINE>}<NEW_LINE>filterList.add("self.partner.id NOT IN (SELECT DISTINCT partner.id FROM Partner partner LEFT JOIN partner.blockingList blocking WHERE blocking.blockingSelect = :blockingSelect AND blocking.blockingToDate >= :blockingToDate)");<NEW_LINE>bindingList.add(Pair.of("blockingSelect", BlockingRepository.DEBIT_BLOCKING));<NEW_LINE>bindingList.add(Pair.of("blockingToDate", Beans.get(AppBaseService.class).getTodayDate(accountingBatch.getCompany())));<NEW_LINE>if (accountingBatch.getBankDetails() != null) {<NEW_LINE>Set<BankDetails> bankDetailsSet = Sets.newHashSet(accountingBatch.getBankDetails());<NEW_LINE>if (accountingBatch.getIncludeOtherBankAccounts() && appBaseService.getAppBase().getManageMultiBanks()) {<NEW_LINE>bankDetailsSet.addAll(accountingBatch.getCompany().getBankDetailsList());<NEW_LINE>}<NEW_LINE>filterList.add("self.companyBankDetails IN (:bankDetailsSet)");<NEW_LINE>bindingList.add(Pair.of("bankDetailsSet", (Object) bankDetailsSet));<NEW_LINE>}<NEW_LINE>if (accountingBatch.getPaymentMode() != null) {<NEW_LINE>filterList.add("self.paymentMode = :paymentMode");<NEW_LINE>bindingList.add(Pair.of("paymentMode", (Object<MASK><NEW_LINE>}<NEW_LINE>List<InvoicePayment> invoicePaymentList = processQuery(filterList, bindingList);<NEW_LINE>if (!invoicePaymentList.isEmpty()) {<NEW_LINE>try {<NEW_LINE>final BankOrder bankOrder = Beans.get(BankOrderMergeService.class).mergeFromInvoicePayments(invoicePaymentList);<NEW_LINE>findBatch().setBankOrder(bankOrder);<NEW_LINE>} catch (AxelorException e) {<NEW_LINE>TraceBackService.trace(e, ExceptionOriginRepository.DIRECT_DEBIT, batch.getId());<NEW_LINE>LOG.error(e.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ) accountingBatch.getPaymentMode())); |
273,521 | public void registerRenderers(Map<Class<? extends HeapViewerNode>, HeapViewerRenderer> renderers, HeapContext context) {<NEW_LINE>Heap heap = context.getFragment().getHeap();<NEW_LINE>// packages<NEW_LINE>PackageNodeRenderer packageRenderer = new PackageNodeRenderer(heap);<NEW_LINE>renderers.put(ClassesContainer.Objects.class, packageRenderer);<NEW_LINE>renderers.put(ClassesContainer.Nodes.class, packageRenderer);<NEW_LINE>renderers.put(<MASK><NEW_LINE>// classes<NEW_LINE>ClassNodeRenderer classRenderer = new ClassNodeRenderer(heap);<NEW_LINE>renderers.put(ClassNode.class, classRenderer);<NEW_LINE>renderers.put(InstancesContainer.Objects.class, classRenderer);<NEW_LINE>renderers.put(InstancesContainer.Nodes.class, classRenderer);<NEW_LINE>// instances<NEW_LINE>renderers.put(InstanceNode.class, new InstanceNodeRenderer(heap));<NEW_LINE>// object fields & items<NEW_LINE>renderers.put(InstanceReferenceNode.class, new InstanceReferenceNodeRenderer(heap));<NEW_LINE>// primitive fields & items<NEW_LINE>renderers.put(PrimitiveNode.class, new PrimitiveNodeRenderer());<NEW_LINE>// threads<NEW_LINE>renderers.put(ThreadNode.class, new ThreadNodeRenderer(heap));<NEW_LINE>// stack frames<NEW_LINE>renderers.put(StackFrameNode.class, new StackFrameNodeRenderer());<NEW_LINE>// local variables<NEW_LINE>renderers.put(LocalObjectNode.class, new LocalObjectNodeRenderer(heap));<NEW_LINE>// GC types<NEW_LINE>renderers.put(GCTypeNode.class, new GCTypeNode.Renderer());<NEW_LINE>renderers.put(PathToGCRootPlugin.GCRootNode.class, new PathToGCRootPlugin.GCRootNode.Renderer(heap));<NEW_LINE>} | ClassesContainer.ContainerNodes.class, packageRenderer); |
284,014 | public static GetAsyncErrorRequestListByCodeResponse unmarshall(GetAsyncErrorRequestListByCodeResponse getAsyncErrorRequestListByCodeResponse, UnmarshallerContext _ctx) {<NEW_LINE>getAsyncErrorRequestListByCodeResponse.setRequestId(_ctx.stringValue("GetAsyncErrorRequestListByCodeResponse.RequestId"));<NEW_LINE>getAsyncErrorRequestListByCodeResponse.setCode(_ctx.longValue("GetAsyncErrorRequestListByCodeResponse.Code"));<NEW_LINE>getAsyncErrorRequestListByCodeResponse.setMessage(_ctx.stringValue("GetAsyncErrorRequestListByCodeResponse.Message"));<NEW_LINE>getAsyncErrorRequestListByCodeResponse.setSuccess(_ctx.booleanValue("GetAsyncErrorRequestListByCodeResponse.Success"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setFail(_ctx.booleanValue("GetAsyncErrorRequestListByCodeResponse.Data.fail"));<NEW_LINE>data.setResultId(_ctx.stringValue("GetAsyncErrorRequestListByCodeResponse.Data.resultId"));<NEW_LINE>data.setIsFinish(_ctx.booleanValue("GetAsyncErrorRequestListByCodeResponse.Data.isFinish"));<NEW_LINE>data.setState(_ctx.stringValue("GetAsyncErrorRequestListByCodeResponse.Data.state"));<NEW_LINE>data.setComplete(_ctx.booleanValue("GetAsyncErrorRequestListByCodeResponse.Data.complete"));<NEW_LINE>data.setTimestamp<MASK><NEW_LINE>List<ResultItem> result = new ArrayList<ResultItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("GetAsyncErrorRequestListByCodeResponse.Data.result.Length"); i++) {<NEW_LINE>ResultItem resultItem = new ResultItem();<NEW_LINE>resultItem.setSqlId(_ctx.stringValue("GetAsyncErrorRequestListByCodeResponse.Data.result[" + i + "].sqlId"));<NEW_LINE>resultItem.setInstanceId(_ctx.stringValue("GetAsyncErrorRequestListByCodeResponse.Data.result[" + i + "].instanceId"));<NEW_LINE>result.add(resultItem);<NEW_LINE>}<NEW_LINE>data.setResult(result);<NEW_LINE>getAsyncErrorRequestListByCodeResponse.setData(data);<NEW_LINE>return getAsyncErrorRequestListByCodeResponse;<NEW_LINE>} | (_ctx.longValue("GetAsyncErrorRequestListByCodeResponse.Data.timestamp")); |
1,673,529 | public static ListCalcEnginesResponse unmarshall(ListCalcEnginesResponse listCalcEnginesResponse, UnmarshallerContext _ctx) {<NEW_LINE>listCalcEnginesResponse.setRequestId(_ctx.stringValue("ListCalcEnginesResponse.RequestId"));<NEW_LINE>listCalcEnginesResponse.setHttpStatusCode(_ctx.integerValue("ListCalcEnginesResponse.HttpStatusCode"));<NEW_LINE>listCalcEnginesResponse.setSuccess(_ctx.booleanValue("ListCalcEnginesResponse.Success"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setPageNumber<MASK><NEW_LINE>data.setPageSize(_ctx.integerValue("ListCalcEnginesResponse.Data.PageSize"));<NEW_LINE>data.setTotalCount(_ctx.integerValue("ListCalcEnginesResponse.Data.TotalCount"));<NEW_LINE>List<CalcEnginesItem> calcEngines = new ArrayList<CalcEnginesItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListCalcEnginesResponse.Data.CalcEngines.Length"); i++) {<NEW_LINE>CalcEnginesItem calcEnginesItem = new CalcEnginesItem();<NEW_LINE>calcEnginesItem.setBindingProjectName(_ctx.stringValue("ListCalcEnginesResponse.Data.CalcEngines[" + i + "].BindingProjectName"));<NEW_LINE>calcEnginesItem.setIsDefault(_ctx.booleanValue("ListCalcEnginesResponse.Data.CalcEngines[" + i + "].IsDefault"));<NEW_LINE>calcEnginesItem.setEngineId(_ctx.integerValue("ListCalcEnginesResponse.Data.CalcEngines[" + i + "].EngineId"));<NEW_LINE>calcEnginesItem.setDwRegion(_ctx.stringValue("ListCalcEnginesResponse.Data.CalcEngines[" + i + "].DwRegion"));<NEW_LINE>calcEnginesItem.setTaskAuthType(_ctx.stringValue("ListCalcEnginesResponse.Data.CalcEngines[" + i + "].TaskAuthType"));<NEW_LINE>calcEnginesItem.setCalcEngineType(_ctx.stringValue("ListCalcEnginesResponse.Data.CalcEngines[" + i + "].CalcEngineType"));<NEW_LINE>calcEnginesItem.setEngineInfo(_ctx.mapValue("ListCalcEnginesResponse.Data.CalcEngines[" + i + "].EngineInfo"));<NEW_LINE>calcEnginesItem.setEnvType(_ctx.stringValue("ListCalcEnginesResponse.Data.CalcEngines[" + i + "].EnvType"));<NEW_LINE>calcEnginesItem.setRegion(_ctx.stringValue("ListCalcEnginesResponse.Data.CalcEngines[" + i + "].Region"));<NEW_LINE>calcEnginesItem.setGmtCreate(_ctx.stringValue("ListCalcEnginesResponse.Data.CalcEngines[" + i + "].GmtCreate"));<NEW_LINE>calcEnginesItem.setBindingProjectId(_ctx.integerValue("ListCalcEnginesResponse.Data.CalcEngines[" + i + "].BindingProjectId"));<NEW_LINE>calcEnginesItem.setName(_ctx.stringValue("ListCalcEnginesResponse.Data.CalcEngines[" + i + "].Name"));<NEW_LINE>calcEnginesItem.setTenantId(_ctx.longValue("ListCalcEnginesResponse.Data.CalcEngines[" + i + "].TenantId"));<NEW_LINE>calcEngines.add(calcEnginesItem);<NEW_LINE>}<NEW_LINE>data.setCalcEngines(calcEngines);<NEW_LINE>listCalcEnginesResponse.setData(data);<NEW_LINE>return listCalcEnginesResponse;<NEW_LINE>} | (_ctx.integerValue("ListCalcEnginesResponse.Data.PageNumber")); |
1,228,050 | static void generateEigrpPolicy(@Nonnull Configuration c, @Nonnull CiscoNxosConfiguration vsConfig, @Nullable DistributeList distributeList, @Nonnull String name) {<NEW_LINE>RoutingPolicy.Builder routingPolicy = RoutingPolicy.builder().setOwner(c).setName(name);<NEW_LINE>ImmutableList.Builder<Statement> statements = ImmutableList.builder();<NEW_LINE>if (distributeList == null || !sanityCheckEigrpDistributeList(distributeList, vsConfig)) {<NEW_LINE>statements.add(Statements.ExitAccept.toStaticStatement());<NEW_LINE>} else {<NEW_LINE>// only prefix-list-based distribute-lists are supported and will pass sanityCheck<NEW_LINE>assert distributeList<MASK><NEW_LINE>BooleanExpr matchDistributeList = new MatchPrefixSet(DestinationNetwork.instance(), new NamedPrefixSet(distributeList.getFilterName()));<NEW_LINE>statements.add(new If(matchDistributeList, ImmutableList.of(Statements.ExitAccept.toStaticStatement()), ImmutableList.of(Statements.ExitReject.toStaticStatement())));<NEW_LINE>}<NEW_LINE>// Building routing policy with owner c will add it to c's routing policies<NEW_LINE>routingPolicy.setStatements(statements.build()).build();<NEW_LINE>} | .getFilterType() == DistributeListFilterType.PREFIX_LIST; |
1,452,372 | private void drawArc(SVGPath path, double[] cent, double[] pre, double[] nex, double[] oPrev, double[] oNext, double scale) {<NEW_LINE>// Delta vectors<NEW_LINE>final double[] rPrev = minus(pre, cent);<NEW_LINE>final double[] rNext = minus(nex, cent);<NEW_LINE>final double[] rPrNe = minus(pre, nex);<NEW_LINE>// Scaled fix points<NEW_LINE>final double[] sPrev = plusTimes(cent, rPrev, scale);<NEW_LINE>final double[] sNext = plusTimes(cent, rNext, scale);<NEW_LINE>// Orthogonal double[]s to the relative double[]s<NEW_LINE>// final double[] oPrev = new double[](rPrev.get(1), -rPrev.get(0));<NEW_LINE>// final double[] oNext = new double[](-rNext.get(1), rNext.get(0));<NEW_LINE>// Compute the intersection of rPrev+tp*oPrev and rNext+tn*oNext<NEW_LINE>// rPrNe == rPrev - rNext<NEW_LINE>final double zp = rPrNe[0] * oNext[1] - rPrNe[1] * oNext[0];<NEW_LINE>final double zn = rPrNe[0] * oPrev[1] - rPrNe[1] * oPrev[0];<NEW_LINE>final double n = oPrev[1] * oNext[0] - oPrev[0] * oNext[1];<NEW_LINE>if (n == 0) {<NEW_LINE>LOG.warning("Parallel?!?");<NEW_LINE>path.drawTo(sNext[<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final double tp = Math.abs(zp / n), tn = Math.abs(zn / n);<NEW_LINE>// Guide points<NEW_LINE>final double[] gPrev = plusTimes(sPrev, oPrev, KAPPA * scale * tp);<NEW_LINE>final double[] gNext = minusTimes(sNext, oNext, KAPPA * scale * tn);<NEW_LINE>if (!path.isStarted()) {<NEW_LINE>path.moveTo(sPrev);<NEW_LINE>}<NEW_LINE>// path.drawTo(sPrev);<NEW_LINE>// path.drawTo(gPrev);<NEW_LINE>// path.drawTo(gNext);<NEW_LINE>// path.drawTo(sNext));<NEW_LINE>// path.moveTo(sPrev);<NEW_LINE>// if(tp < 0 || tn < 0) {<NEW_LINE>// path.drawTo(sNext);<NEW_LINE>// }<NEW_LINE>// else {<NEW_LINE>path.cubicTo(gPrev, gNext, sNext);<NEW_LINE>// }<NEW_LINE>} | 0], sNext[1]); |
1,287,009 | public void marshall(UpdateAssetModelRequest updateAssetModelRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (updateAssetModelRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(updateAssetModelRequest.getAssetModelName(), ASSETMODELNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateAssetModelRequest.getAssetModelDescription(), ASSETMODELDESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateAssetModelRequest.getAssetModelProperties(), ASSETMODELPROPERTIES_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateAssetModelRequest.getAssetModelHierarchies(), ASSETMODELHIERARCHIES_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateAssetModelRequest.getAssetModelCompositeModels(), ASSETMODELCOMPOSITEMODELS_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateAssetModelRequest.getClientToken(), CLIENTTOKEN_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | updateAssetModelRequest.getAssetModelId(), ASSETMODELID_BINDING); |
880,974 | final PutKMSEncryptionKeyResult executePutKMSEncryptionKey(PutKMSEncryptionKeyRequest putKMSEncryptionKeyRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(putKMSEncryptionKeyRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<PutKMSEncryptionKeyRequest> request = null;<NEW_LINE>Response<PutKMSEncryptionKeyResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new PutKMSEncryptionKeyRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(putKMSEncryptionKeyRequest));<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, "FraudDetector");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "PutKMSEncryptionKey");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<PutKMSEncryptionKeyResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new PutKMSEncryptionKeyResultJsonUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | invoke(request, responseHandler, executionContext); |
620,579 | public List<MethodCall<Object>> createMethodCallListToBeParsedFromBody(final String addressPrefix, final Object body, final Request<Object> originatingRequest) {<NEW_LINE>List<MethodCall<Object>> methodCalls;<NEW_LINE>if (body != null) {<NEW_LINE>methodCalls = parserRef.get().parseMethodCalls(addressPrefix, body.toString());<NEW_LINE>} else {<NEW_LINE>methodCalls = Collections.emptyList();<NEW_LINE>}<NEW_LINE>if (methodCalls == null || methodCalls.size() == 0) {<NEW_LINE>if (originatingRequest instanceof WebSocketMessage) {<NEW_LINE>WebSocketMessage webSocketMessage = ((WebSocketMessage) originatingRequest);<NEW_LINE>final Response<Object> response = ResponseImpl.response(-1, Timer.timer().now(), "SYSTEM", "ERROR", "CAN'T HANDLE CALL", originatingRequest, true);<NEW_LINE>final <MASK><NEW_LINE>sender.sendText(encoderRef.get().encodeResponses("SYSTEM", Lists.list(response)));<NEW_LINE>}<NEW_LINE>return Collections.emptyList();<NEW_LINE>}<NEW_LINE>// noinspection Convert2streamapi<NEW_LINE>for (MethodCall<Object> methodCall : methodCalls) {<NEW_LINE>if (methodCall instanceof MethodCallImpl) {<NEW_LINE>MethodCallImpl method = ((MethodCallImpl) methodCall);<NEW_LINE>method.originatingRequest(originatingRequest);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return methodCalls;<NEW_LINE>} | WebSocketSender sender = webSocketMessage.getSender(); |
479,434 | private Mono<Response<Flux<ByteBuffer>>> deleteMongoDBCollectionWithResponseAsync(String resourceGroupName, String accountName, String databaseName, String collectionName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (accountName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (databaseName == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (collectionName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter collectionName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.deleteMongoDBCollection(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, collectionName, this.client.getApiVersion(), context);<NEW_LINE>} | error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); |
850,740 | private static void pointAddVar(boolean negate, PointExt p, PointExt q, PointExt r) {<NEW_LINE>int[<MASK><NEW_LINE>int[] b = F.create();<NEW_LINE>int[] c = F.create();<NEW_LINE>int[] d = F.create();<NEW_LINE>int[] e = F.create();<NEW_LINE>int[] f = F.create();<NEW_LINE>int[] g = F.create();<NEW_LINE>int[] h = F.create();<NEW_LINE>int[] nc, nd, nf, ng;<NEW_LINE>if (negate) {<NEW_LINE>nc = d;<NEW_LINE>nd = c;<NEW_LINE>nf = g;<NEW_LINE>ng = f;<NEW_LINE>} else {<NEW_LINE>nc = c;<NEW_LINE>nd = d;<NEW_LINE>nf = f;<NEW_LINE>ng = g;<NEW_LINE>}<NEW_LINE>F.apm(p.y, p.x, b, a);<NEW_LINE>F.apm(q.y, q.x, nd, nc);<NEW_LINE>F.mul(a, c, a);<NEW_LINE>F.mul(b, d, b);<NEW_LINE>F.mul(p.t, q.t, c);<NEW_LINE>F.mul(c, C_d2, c);<NEW_LINE>F.mul(p.z, q.z, d);<NEW_LINE>F.add(d, d, d);<NEW_LINE>F.apm(b, a, h, e);<NEW_LINE>F.apm(d, c, ng, nf);<NEW_LINE>F.carry(ng);<NEW_LINE>F.mul(e, f, r.x);<NEW_LINE>F.mul(g, h, r.y);<NEW_LINE>F.mul(f, g, r.z);<NEW_LINE>F.mul(e, h, r.t);<NEW_LINE>} | ] a = F.create(); |
213,070 | private float testAo(VectorM3f vertex, Direction dir) {<NEW_LINE><MASK><NEW_LINE>int occluding = 0;<NEW_LINE>int x = 0;<NEW_LINE>if (vertex.x == 16) {<NEW_LINE>x = 1;<NEW_LINE>} else if (vertex.x == 0) {<NEW_LINE>x = -1;<NEW_LINE>}<NEW_LINE>int y = 0;<NEW_LINE>if (vertex.y == 16) {<NEW_LINE>y = 1;<NEW_LINE>} else if (vertex.y == 0) {<NEW_LINE>y = -1;<NEW_LINE>}<NEW_LINE>int z = 0;<NEW_LINE>if (vertex.z == 16) {<NEW_LINE>z = 1;<NEW_LINE>} else if (vertex.z == 0) {<NEW_LINE>z = -1;<NEW_LINE>}<NEW_LINE>if (x * dirVec.getX() + y * dirVec.getY() > 0) {<NEW_LINE>if (getRotationRelativeBlock(x, y, 0).getProperties().isOccluding())<NEW_LINE>occluding++;<NEW_LINE>}<NEW_LINE>if (x * dirVec.getX() + z * dirVec.getZ() > 0) {<NEW_LINE>if (getRotationRelativeBlock(x, 0, z).getProperties().isOccluding())<NEW_LINE>occluding++;<NEW_LINE>}<NEW_LINE>if (y * dirVec.getY() + z * dirVec.getZ() > 0) {<NEW_LINE>if (getRotationRelativeBlock(0, y, z).getProperties().isOccluding())<NEW_LINE>occluding++;<NEW_LINE>}<NEW_LINE>if (x * dirVec.getX() + y * dirVec.getY() + z * dirVec.getZ() > 0) {<NEW_LINE>if (getRotationRelativeBlock(x, y, z).getProperties().isOccluding())<NEW_LINE>occluding++;<NEW_LINE>}<NEW_LINE>if (occluding > 3)<NEW_LINE>occluding = 3;<NEW_LINE>return Math.max(0f, Math.min(1f - occluding * 0.25f, 1f));<NEW_LINE>} | Vector3i dirVec = dir.toVector(); |
81,504 | public boolean append(final DirectBuffer srcBuffer, final int srcOffset, final int srcLength) {<NEW_LINE>final int headOffset = (int) head & mask;<NEW_LINE>final int <MASK><NEW_LINE>final int alignedLength = BitUtil.align(HEADER_LENGTH + srcLength, HEADER_ALIGNMENT);<NEW_LINE>final int totalRemaining = capacity - (int) (tail - head);<NEW_LINE>if (alignedLength > totalRemaining) {<NEW_LINE>resize(alignedLength);<NEW_LINE>} else if (tailOffset >= headOffset) {<NEW_LINE>final int toEndRemaining = capacity - tailOffset;<NEW_LINE>if (alignedLength > toEndRemaining) {<NEW_LINE>if (alignedLength <= (totalRemaining - toEndRemaining)) {<NEW_LINE>buffer.putInt(tailOffset + MESSAGE_LENGTH_OFFSET, toEndRemaining);<NEW_LINE>buffer.putInt(tailOffset + MESSAGE_TYPE_OFFSET, MESSAGE_TYPE_PADDING);<NEW_LINE>tail += toEndRemaining;<NEW_LINE>} else {<NEW_LINE>resize(alignedLength);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final int newTotalRemaining = capacity - (int) (tail - head);<NEW_LINE>if (alignedLength > newTotalRemaining) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>writeMessage(srcBuffer, srcOffset, srcLength);<NEW_LINE>tail += alignedLength;<NEW_LINE>return true;<NEW_LINE>} | tailOffset = (int) tail & mask; |
581,061 | private Object convertMessageParamToString(final Object param, final ReplaceAfterFormatCollector replaceAfterFormatCollector) {<NEW_LINE>if (param == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final TableRecordReference record = toTableRecordReferenceOrNull(param);<NEW_LINE>if (record != null) {<NEW_LINE>if (html) {<NEW_LINE>final a recordLink = getRecordHtmlLink(record);<NEW_LINE>if (recordLink == null) {<NEW_LINE>return getRecordDisplayText(record);<NEW_LINE>} else {<NEW_LINE>return replaceAfterFormatCollector.addAndGetKey(recordLink.toString());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>return getRecordDisplayText(record);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (param instanceof String) {<NEW_LINE>final a link = toLinkOrNull(param.toString());<NEW_LINE>if (link == null) {<NEW_LINE>return param;<NEW_LINE>} else {<NEW_LINE>return replaceAfterFormatCollector.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return param;<NEW_LINE>} | addAndGetKey(link.toString()); |
1,457,488 | public static Intent createStartIntent(Activity parent, NvApp app, ComputerDetails computer, ComputerManagerService.ComputerManagerBinder managerBinder) {<NEW_LINE>Intent intent = new Intent(parent, Game.class);<NEW_LINE>intent.putExtra(Game.EXTRA_HOST, getCurrentAddressFromComputer(computer));<NEW_LINE>intent.putExtra(Game.EXTRA_APP_NAME, app.getAppName());<NEW_LINE>intent.putExtra(Game.EXTRA_APP_ID, app.getAppId());<NEW_LINE>intent.putExtra(Game.EXTRA_APP_HDR, app.isHdrSupported());<NEW_LINE>intent.putExtra(Game.EXTRA_UNIQUEID, managerBinder.getUniqueId());<NEW_LINE>intent.putExtra(Game.EXTRA_PC_UUID, computer.uuid);<NEW_LINE>intent.putExtra(<MASK><NEW_LINE>try {<NEW_LINE>if (computer.serverCert != null) {<NEW_LINE>intent.putExtra(Game.EXTRA_SERVER_CERT, computer.serverCert.getEncoded());<NEW_LINE>}<NEW_LINE>} catch (CertificateEncodingException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>return intent;<NEW_LINE>} | Game.EXTRA_PC_NAME, computer.name); |
77,686 | public void addTypeDefinition(@NotNull SDLDefinition<?> definition) {<NEW_LINE>GraphQLCompositeDefinition<?> builder = getCompositeDefinition(definition);<NEW_LINE>if (builder == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (builder instanceof GraphQLDirectiveTypeCompositeDefinition) {<NEW_LINE>((GraphQLDirectiveTypeCompositeDefinition) builder).addDefinition(ObjectUtils.tryCast(definition, DirectiveDefinition.class));<NEW_LINE>} else if (builder instanceof GraphQLEnumTypeCompositeDefinition) {<NEW_LINE>((GraphQLEnumTypeCompositeDefinition) builder).addDefinition(ObjectUtils.tryCast(definition, EnumTypeDefinition.class));<NEW_LINE>} else if (builder instanceof GraphQLInputObjectTypeCompositeDefinition) {<NEW_LINE>((GraphQLInputObjectTypeCompositeDefinition) builder).addDefinition(ObjectUtils.tryCast(definition, InputObjectTypeDefinition.class));<NEW_LINE>} else if (builder instanceof GraphQLInterfaceTypeCompositeDefinition) {<NEW_LINE>((GraphQLInterfaceTypeCompositeDefinition) builder).addDefinition(ObjectUtils.tryCast<MASK><NEW_LINE>} else if (builder instanceof GraphQLObjectTypeCompositeDefinition) {<NEW_LINE>((GraphQLObjectTypeCompositeDefinition) builder).addDefinition(ObjectUtils.tryCast(definition, ObjectTypeDefinition.class));<NEW_LINE>} else if (builder instanceof GraphQLScalarTypeCompositeDefinition) {<NEW_LINE>((GraphQLScalarTypeCompositeDefinition) builder).addDefinition(ObjectUtils.tryCast(definition, ScalarTypeDefinition.class));<NEW_LINE>} else if (builder instanceof GraphQLSchemaTypeCompositeDefinition) {<NEW_LINE>((GraphQLSchemaTypeCompositeDefinition) builder).addDefinition(ObjectUtils.tryCast(definition, SchemaDefinition.class));<NEW_LINE>} else if (builder instanceof GraphQLUnionTypeCompositeDefinition) {<NEW_LINE>((GraphQLUnionTypeCompositeDefinition) builder).addDefinition(ObjectUtils.tryCast(definition, UnionTypeDefinition.class));<NEW_LINE>} else {<NEW_LINE>LOG.error("Unknown builder type: " + builder.getClass().getName());<NEW_LINE>}<NEW_LINE>} | (definition, InterfaceTypeDefinition.class)); |
152,205 | private static FunctionSignature.WithValues<Object, SkylarkType> createSignature(ImmutableMap<String, Attribute<?>> parameters, Location location) throws EvalException {<NEW_LINE>Preconditions.checkState(!parameters.isEmpty());<NEW_LINE>int mandatory = 0;<NEW_LINE>String[] names = new String[parameters.size()];<NEW_LINE>ArrayList<Object> defaultValues = new ArrayList<>(parameters.size());<NEW_LINE>Stream<Map.Entry<String, Attribute<?>>> sortedStream = parameters.entrySet().stream().filter(e -> !e.getKey().startsWith("_")).sorted(MandatoryComparator.INSTANCE);<NEW_LINE>int i = 0;<NEW_LINE>for (Map.Entry<String, Attribute<?>> entry : (Iterable<Map.Entry<String, Attribute<?>>>) sortedStream::iterator) {<NEW_LINE>Attribute<?> param = entry.getValue();<NEW_LINE>if (param.getMandatory()) {<NEW_LINE>mandatory++;<NEW_LINE>} else {<NEW_LINE>defaultValues.add(param.getPreCoercionDefaultValue());<NEW_LINE>}<NEW_LINE>String name = entry.getKey();<NEW_LINE>BuckSkylarkTypes.validateKwargName(location, name);<NEW_LINE>names[i] = name;<NEW_LINE>i++;<NEW_LINE>}<NEW_LINE>// If we filtered anything out, shrink the array<NEW_LINE>if (i < parameters.size()) {<NEW_LINE>names = Arrays.copyOfRange(names, 0, i);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>FunctionSignature signature = FunctionSignature.of(0, 0, mandatory, false, false, names);<NEW_LINE>return FunctionSignature.WithValues.<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new EvalException(location, "Could not create FunctionSignature");<NEW_LINE>}<NEW_LINE>} | create(signature, defaultValues, null); |
1,767,649 | public NameEnvironmentAnswer findClass(char[] typeName, String qualifiedPackageName, String moduleName, String qualifiedBinaryFileName, boolean asBinaryOnly) {<NEW_LINE>if (!isPackage(qualifiedPackageName, moduleName))<NEW_LINE>// most common case<NEW_LINE>return null;<NEW_LINE>try {<NEW_LINE>ClassFileReader reader = null;<NEW_LINE>byte[] content = null;<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>qualifiedBinaryFileName = <MASK><NEW_LINE>if (this.subReleases != null && this.subReleases.length > 0) {<NEW_LINE>done: for (String rel : this.subReleases) {<NEW_LINE>if (moduleName == null) {<NEW_LINE>Path p = this.fs.getPath(rel);<NEW_LINE>try (DirectoryStream<java.nio.file.Path> stream = Files.newDirectoryStream(p)) {<NEW_LINE>for (final java.nio.file.Path subdir : stream) {<NEW_LINE>Path f = this.fs.getPath(rel, JRTUtil.sanitizedFileName(subdir), qualifiedBinaryFileName);<NEW_LINE>if (Files.exists(f)) {<NEW_LINE>content = JRTUtil.safeReadBytes(f);<NEW_LINE>if (content != null)<NEW_LINE>break done;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>Path p = this.fs.getPath(rel, moduleName, qualifiedBinaryFileName);<NEW_LINE>if (Files.exists(p)) {<NEW_LINE>content = JRTUtil.safeReadBytes(p);<NEW_LINE>if (content != null)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>content = JRTUtil.safeReadBytes(this.fs.getPath(this.releaseInHex, qualifiedBinaryFileName));<NEW_LINE>}<NEW_LINE>if (content != null) {<NEW_LINE>reader = new ClassFileReader(content, qualifiedBinaryFileName.toCharArray());<NEW_LINE>char[] modName = moduleName != null ? moduleName.toCharArray() : null;<NEW_LINE>return new NameEnvironmentAnswer(reader, fetchAccessRestriction(qualifiedBinaryFileName), modName);<NEW_LINE>}<NEW_LINE>} catch (ClassFormatException | IOException e) {<NEW_LINE>// continue<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | qualifiedBinaryFileName.replace(".class", ".sig"); |
1,414,918 | final DescribeStreamResult executeDescribeStream(DescribeStreamRequest describeStreamRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeStreamRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeStreamRequest> request = null;<NEW_LINE>Response<DescribeStreamResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeStreamRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeStreamRequest));<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, "Kinesis Video");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeStream");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeStreamResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeStreamResultJsonUnmarshaller());<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); |
672,108 | private void decodeSub4x8(MBlock mBlock, int partNo, Picture[] references, int offX, int offY, int tl, int t0, int t1, int tr, int l0, boolean tlAvb, boolean tAvb, boolean trAvb, boolean lAvb, MvList x, int i00, int i01, int i10, int i11, int refIdx, Picture mb, int off, int list) {<NEW_LINE>int mvpX1 = calcMVPredictionMedian(l0, t0, t1, tl, lAvb, tAvb, <MASK><NEW_LINE>int mvpY1 = calcMVPredictionMedian(l0, t0, t1, tl, lAvb, tAvb, tAvb, tlAvb, refIdx, 1);<NEW_LINE>int mv1 = packMv(mBlock.pb8x8.mvdX1[list][partNo] + mvpX1, mBlock.pb8x8.mvdY1[list][partNo] + mvpY1, refIdx);<NEW_LINE>x.setMv(i00, list, mv1);<NEW_LINE>x.setMv(i10, list, mv1);<NEW_LINE>debugPrint("MVP: (%d, %d), MVD: (%d, %d), MV: (%d,%d,%d)", mvpX1, mvpY1, mBlock.pb8x8.mvdX1[list][partNo], mBlock.pb8x8.mvdY1[list][partNo], mvX(mv1), mvY(mv1), refIdx);<NEW_LINE>int mvpX2 = calcMVPredictionMedian(mv1, t1, tr, t0, true, tAvb, trAvb, tAvb, refIdx, 0);<NEW_LINE>int mvpY2 = calcMVPredictionMedian(mv1, t1, tr, t0, true, tAvb, trAvb, tAvb, refIdx, 1);<NEW_LINE>int mv2 = packMv(mBlock.pb8x8.mvdX2[list][partNo] + mvpX2, mBlock.pb8x8.mvdY2[list][partNo] + mvpY2, refIdx);<NEW_LINE>x.setMv(i01, list, mv2);<NEW_LINE>x.setMv(i11, list, mv2);<NEW_LINE>debugPrint("MVP: (%d, %d), MVD: (%d, %d), MV: (%d,%d,%d)", mvpX2, mvpY2, mBlock.pb8x8.mvdX2[list][partNo], mBlock.pb8x8.mvdY2[list][partNo], mvX(mv2), mvY(mv2), refIdx);<NEW_LINE>interpolator.getBlockLuma(references[refIdx], mb, off, offX + mvX(mv1), offY + mvY(mv1), 4, 8);<NEW_LINE>interpolator.getBlockLuma(references[refIdx], mb, off + 4, offX + mvX(mv2) + 16, offY + mvY(mv2), 4, 8);<NEW_LINE>} | tAvb, tlAvb, refIdx, 0); |
656,772 | public static void bufferedToInterleaved(BufferedImage src, InterleavedF32 dst) {<NEW_LINE>final <MASK><NEW_LINE>final int height = src.getHeight();<NEW_LINE>if (dst.getNumBands() == 3) {<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(0, height, y -> {<NEW_LINE>for (int y = 0; y < height; y++) {<NEW_LINE>int indexDst = dst.startIndex + y * dst.stride;<NEW_LINE>for (int x = 0; x < width; x++) {<NEW_LINE>int argb = src.getRGB(x, y);<NEW_LINE>dst.data[indexDst++] = (argb >>> 16) & 0xFF;<NEW_LINE>dst.data[indexDst++] = (argb >>> 8) & 0xFF;<NEW_LINE>dst.data[indexDst++] = argb & 0xFF;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>} else if (dst.getNumBands() == 4) {<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(0, height, y -> {<NEW_LINE>for (int y = 0; y < height; y++) {<NEW_LINE>int indexDst = dst.startIndex + y * dst.stride;<NEW_LINE>for (int x = 0; x < width; x++) {<NEW_LINE>int argb = src.getRGB(x, y);<NEW_LINE>dst.data[indexDst++] = (argb >>> 24) & 0xFF;<NEW_LINE>dst.data[indexDst++] = (argb >>> 16) & 0xFF;<NEW_LINE>dst.data[indexDst++] = (argb >>> 8) & 0xFF;<NEW_LINE>dst.data[indexDst++] = argb & 0xFF;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>} else if (dst.getNumBands() == 1) {<NEW_LINE>bufferedToGray(src, dst.data, dst.startIndex, dst.stride);<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("Unsupported number of input bands");<NEW_LINE>}<NEW_LINE>} | int width = src.getWidth(); |
1,623,597 | private static void copyRowsToClipboard(TreeViewer viewer, Tree tree) {<NEW_LINE>int columnCount = tree.getColumnCount();<NEW_LINE>int[] columnOrder = tree.getColumnOrder();<NEW_LINE>SharesLabelProvider[] labelProvider = getSharesLabelProvider(viewer, columnCount);<NEW_LINE>StringBuilder result = new StringBuilder();<NEW_LINE>TreeItem[] rowItems = tree.getSelection();<NEW_LINE>for (int row = 0; row < rowItems.length; row++) {<NEW_LINE>if (row > 0)<NEW_LINE>// $NON-NLS-1$<NEW_LINE>result.append("\n");<NEW_LINE>TreeItem rowItem = rowItems[row];<NEW_LINE>for (int column = 0; column < columnCount; column++) {<NEW_LINE>if (column > 0)<NEW_LINE>result.append<MASK><NEW_LINE>int orderedColumn = columnOrder[column];<NEW_LINE>if (labelProvider[orderedColumn] != null) {<NEW_LINE>Long value = labelProvider[orderedColumn].getValue(rowItem.getData());<NEW_LINE>// $NON-NLS-1$<NEW_LINE>result.append(value != null ? Values.Share.format(value) : "");<NEW_LINE>} else {<NEW_LINE>result.append(rowItem.getText(orderedColumn));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Clipboard clipboard = new Clipboard(Display.getDefault());<NEW_LINE>clipboard.setContents(new Object[] { result.toString() }, new Transfer[] { TextTransfer.getInstance() });<NEW_LINE>clipboard.dispose();<NEW_LINE>} | ((char) SWT.TAB); |
1,207,073 | public void translate(final ITranslationEnvironment environment, final IInstruction instruction, final List<ReilInstruction> instructions) throws InternalTranslationException {<NEW_LINE>TranslationHelpers.checkTranslationArguments(environment, instruction, instructions, "bgela");<NEW_LINE>Long baseOffset = instruction.getAddress().toLong() * 0x100;<NEW_LINE>final String jumpOperand = environment.getNextVariableString();<NEW_LINE>final IOperandTreeNode addressOperand1 = instruction.getOperands().get(1).getRootNode().<MASK><NEW_LINE>final IOperandTreeNode BIOperand = instruction.getOperands().get(0).getRootNode().getChildren().get(0);<NEW_LINE>instructions.add(ReilHelpers.createOr(baseOffset++, OperandSize.BYTE, String.valueOf((Helpers.getCRRegisterIndex(BIOperand.getValue()) * 4) + 2), OperandSize.BYTE, String.valueOf((Helpers.getCRRegisterIndex(BIOperand.getValue()) * 4) + 1), OperandSize.BYTE, jumpOperand));<NEW_LINE>BranchGenerator.generate(baseOffset, environment, instruction, instructions, "bgela", jumpOperand, addressOperand1.getValue(), true, false, false, false, false, false);<NEW_LINE>} | getChildren().get(0); |
1,587,344 | public static void drawChessboard(Graphics2D g2, WorldToCameraToPixel fiducialToPixel, int numRows, int numCols, double squareWidth) {<NEW_LINE>Point3D_F64 fidPt = new Point3D_F64();<NEW_LINE>Point2D_F64 pixel0 = new Point2D_F64();<NEW_LINE>Point2D_F64 pixel1 = new Point2D_F64();<NEW_LINE>Point2D_F64 pixel2 = new Point2D_F64();<NEW_LINE>Point2D_F64 pixel3 = new Point2D_F64();<NEW_LINE>Line2D.Double l = new Line2D.Double();<NEW_LINE>int[] polyX = new int[4];<NEW_LINE>int[] polyY = new int[4];<NEW_LINE>int alpha = 100;<NEW_LINE>Color red = new Color(255, 0, 0, alpha);<NEW_LINE>Color black = new Color(0, 0, 0, alpha);<NEW_LINE>for (int row = 0; row < numRows; row++) {<NEW_LINE>double y0 = -numRows * squareWidth / 2 + row * squareWidth;<NEW_LINE>for (int col = row % 2; col < numCols; col += 2) {<NEW_LINE>double x0 = -numCols * squareWidth / 2 + col * squareWidth;<NEW_LINE>fidPt.setTo(x0, y0, 0);<NEW_LINE>fiducialToPixel.transform(fidPt, pixel0);<NEW_LINE>fidPt.setTo(x0 + squareWidth, y0, 0);<NEW_LINE>fiducialToPixel.transform(fidPt, pixel1);<NEW_LINE>fidPt.setTo(x0 + squareWidth, y0 + squareWidth, 0);<NEW_LINE><MASK><NEW_LINE>fidPt.setTo(x0, y0 + squareWidth, 0);<NEW_LINE>fiducialToPixel.transform(fidPt, pixel3);<NEW_LINE>polyX[0] = (int) (pixel0.x + 0.5);<NEW_LINE>polyX[1] = (int) (pixel1.x + 0.5);<NEW_LINE>polyX[2] = (int) (pixel2.x + 0.5);<NEW_LINE>polyX[3] = (int) (pixel3.x + 0.5);<NEW_LINE>polyY[0] = (int) (pixel0.y + 0.5);<NEW_LINE>polyY[1] = (int) (pixel1.y + 0.5);<NEW_LINE>polyY[2] = (int) (pixel2.y + 0.5);<NEW_LINE>polyY[3] = (int) (pixel3.y + 0.5);<NEW_LINE>g2.setColor(black);<NEW_LINE>g2.fillPolygon(polyX, polyY, 4);<NEW_LINE>g2.setColor(red);<NEW_LINE>drawLine(g2, l, pixel0.x, pixel0.y, pixel1.x, pixel1.y);<NEW_LINE>drawLine(g2, l, pixel1.x, pixel1.y, pixel2.x, pixel2.y);<NEW_LINE>drawLine(g2, l, pixel2.x, pixel2.y, pixel3.x, pixel3.y);<NEW_LINE>drawLine(g2, l, pixel3.x, pixel3.y, pixel0.x, pixel0.y);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | fiducialToPixel.transform(fidPt, pixel2); |
409,029 | public void actionPerformed(AnActionEvent e) {<NEW_LINE>final LayoutTreeComponent treeComponent = myArtifactEditor.getLayoutTreeComponent();<NEW_LINE>final LayoutTreeSelection selection = treeComponent.getSelection();<NEW_LINE>final CompositePackagingElement<?> parent = selection.getCommonParentElement();<NEW_LINE>if (parent == null)<NEW_LINE>return;<NEW_LINE>final PackagingElementNode<?> parentNode = selection.getNodes().get(0).getParentNode();<NEW_LINE>if (parentNode == null)<NEW_LINE>return;<NEW_LINE>if (!treeComponent.checkCanModifyChildren(parent, parentNode, selection.getNodes())) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final CompositePackagingElementType<?>[] types = PackagingElementFactory.getInstance(e.<MASK><NEW_LINE>final List<PackagingElement<?>> selected = selection.getElements();<NEW_LINE>if (types.length == 1) {<NEW_LINE>surroundWith(types[0], parent, selected, treeComponent);<NEW_LINE>} else {<NEW_LINE>JBPopupFactory.getInstance().createListPopup(new BaseListPopupStep<CompositePackagingElementType>("Surround With...", types) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Image getIconFor(CompositePackagingElementType aValue) {<NEW_LINE>return aValue.getIcon();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Nonnull<NEW_LINE>@Override<NEW_LINE>public String getTextFor(CompositePackagingElementType value) {<NEW_LINE>return value.getPresentableName();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public PopupStep onChosen(final CompositePackagingElementType selectedValue, boolean finalChoice) {<NEW_LINE>ApplicationManager.getApplication().invokeLater(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>surroundWith(selectedValue, parent, selected, treeComponent);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return FINAL_CHOICE;<NEW_LINE>}<NEW_LINE>}).showInBestPositionFor(e.getDataContext());<NEW_LINE>}<NEW_LINE>} | getProject()).getCompositeElementTypes(); |
1,841,722 | private static void copy(FhirContext theCtx, IGenericClient theTarget, String theResType, List<IBaseResource> theQueued, Set<String> theSent, Bundle theReceived) {<NEW_LINE>for (Bundle.BundleEntryComponent nextEntry : theReceived.getEntry()) {<NEW_LINE>Resource nextResource = nextEntry.getResource();<NEW_LINE>nextResource.setId(theResType + "/" + "CR-" + nextResource.getIdElement().getIdPart());<NEW_LINE>boolean haveUnsentReference = false;<NEW_LINE>for (ResourceReferenceInfo nextRefInfo : theCtx.newTerser().getAllResourceReferences(nextResource)) {<NEW_LINE>IIdType nextRef = nextRefInfo<MASK><NEW_LINE>if (nextRef.hasIdPart()) {<NEW_LINE>String newRef = nextRef.getResourceType() + "/" + "CR-" + nextRef.getIdPart();<NEW_LINE>ourLog.info("Changing reference {} to {}", nextRef.getValue(), newRef);<NEW_LINE>nextRefInfo.getResourceReference().setReference(newRef);<NEW_LINE>if (!theSent.contains(newRef)) {<NEW_LINE>haveUnsentReference = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (haveUnsentReference) {<NEW_LINE>ourLog.info("Queueing {} for delivery after", nextResource.getId());<NEW_LINE>theQueued.add(nextResource);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>IIdType newId = theTarget.update().resource(nextResource).execute().getId();<NEW_LINE>ourLog.info("Copied resource {} and got ID {}", nextResource.getId(), newId);<NEW_LINE>theSent.add(nextResource.getIdElement().toUnqualifiedVersionless().getValue());<NEW_LINE>}<NEW_LINE>} | .getResourceReference().getReferenceElement(); |
240,693 | public void rename(final ConnectorRequestContext context, final QualifiedName oldName, final QualifiedName newName) {<NEW_LINE>// check exists then rename in non-transactional optimistic manner<NEW_LINE>if (exists(context, newName)) {<NEW_LINE>throw new TableAlreadyExistsException(newName);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>final String lastModifiedBy = PolarisUtils.getUserOrDefault(context);<NEW_LINE>final PolarisTableEntity table = polarisStoreService.getTable(oldName.getDatabaseName(), oldName.getTableName()).orElseThrow(() -> new TableNotFoundException(oldName));<NEW_LINE>table.getAudit().setLastModifiedBy(lastModifiedBy);<NEW_LINE>polarisStoreService.saveTable(table.toBuilder().tblName(newName.getTableName()).build());<NEW_LINE>} catch (TableNotFoundException exception) {<NEW_LINE>log.error(String.format("Not found exception for polaris table %s", oldName), exception);<NEW_LINE>throw exception;<NEW_LINE>} catch (DataIntegrityViolationException exception) {<NEW_LINE><MASK><NEW_LINE>} catch (Exception exception) {<NEW_LINE>final String msg = String.format("Failed renaming polaris table %s", oldName);<NEW_LINE>log.error(msg, exception);<NEW_LINE>throw new ConnectorException(msg, exception);<NEW_LINE>}<NEW_LINE>} | throw new InvalidMetaException(oldName, exception); |
290,945 | private void readComponentProperties(@NotNull final ComponentStyle style, @NotNull final Map<String, Object> componentProperties, @NotNull final HierarchicalStreamReader reader, @NotNull final UnmarshallingContext context, @NotNull final ComponentDescriptor descriptor) {<NEW_LINE>Class<? extends JComponent> componentType = descriptor.getComponentClass();<NEW_LINE>// Reading component class property<NEW_LINE>// It might be specified explicitly to allow specifying additional parameters from the custom component class<NEW_LINE>final String componentClassName = reader.getAttribute(CLASS_ATTRIBUTE);<NEW_LINE>if (componentClassName != null) {<NEW_LINE>final Class<? extends JComponent> cc = ReflectUtils.getClassSafely(componentClassName);<NEW_LINE>if (cc != null) {<NEW_LINE>if (componentType.isAssignableFrom(cc)) {<NEW_LINE>componentType = cc;<NEW_LINE>} else {<NEW_LINE>final String custom = cc.getCanonicalName();<NEW_LINE>final <MASK><NEW_LINE>final String msg = "Specified custom component class '%s' for style '%s' is not assignable from base class '%s'";<NEW_LINE>throw new StyleException(String.format(msg, custom, style.getId(), basic));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>final String msg = "Specified custom component class %s for style %s cannot be found";<NEW_LINE>throw new StyleException(String.format(msg, componentClassName, style.getId()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Saving component class into context<NEW_LINE>context.put(CONTEXT_COMPONENT_CLASS, componentType);<NEW_LINE>// Reading component properties based on the component class<NEW_LINE>StyleConverterUtils.readProperties(reader, context, mapper, componentProperties, componentType, style.getId());<NEW_LINE>} | String basic = componentType.getCanonicalName(); |
1,438,280 | private void reportDeploymentMetrics() {<NEW_LINE>ApplicationList applications = ApplicationList.from(controller().applications().readable()).withProductionDeployment();<NEW_LINE>DeploymentStatusList deployments = controller().jobController().deploymentStatuses(applications);<NEW_LINE>metric.set(DEPLOYMENT_FAIL_METRIC, deploymentFailRatio(deployments) * 100, metric.createContext(Map.of()));<NEW_LINE>averageDeploymentDurations(deployments, clock.instant()).forEach((instance, duration) -> {<NEW_LINE>metric.set(DEPLOYMENT_AVERAGE_DURATION, duration.toSeconds(), metric.createContext(dimensions(instance)));<NEW_LINE>});<NEW_LINE>deploymentsFailingUpgrade(deployments).forEach((instance, failingJobs) -> {<NEW_LINE>metric.set(DEPLOYMENT_FAILING_UPGRADES, failingJobs, metric.<MASK><NEW_LINE>});<NEW_LINE>deploymentWarnings(deployments).forEach((instance, warnings) -> {<NEW_LINE>metric.set(DEPLOYMENT_WARNINGS, warnings, metric.createContext(dimensions(instance)));<NEW_LINE>});<NEW_LINE>overdueUpgradeDurationByInstance(deployments).forEach((instance, overduePeriod) -> {<NEW_LINE>metric.set(DEPLOYMENT_OVERDUE_UPGRADE, overduePeriod.toSeconds(), metric.createContext(dimensions(instance)));<NEW_LINE>});<NEW_LINE>for (Application application : applications.asList()) application.latestVersion().flatMap(ApplicationVersion::buildTime).ifPresent(buildTime -> metric.set(DEPLOYMENT_BUILD_AGE_SECONDS, controller().clock().instant().getEpochSecond() - buildTime.getEpochSecond(), metric.createContext(dimensions(application.id().defaultInstance()))));<NEW_LINE>} | createContext(dimensions(instance))); |
18,238 | public synchronized File[] unmountBestMatch(final float maxq, long maxResultSize) {<NEW_LINE>if (this.blobs.size() < 2)<NEW_LINE>return null;<NEW_LINE>long l, r, m;<NEW_LINE>File lf, rf;<NEW_LINE>float min = Float.MAX_VALUE;<NEW_LINE>final File[] bestMatch = new File[2];<NEW_LINE>maxResultSize = maxResultSize >> 1;<NEW_LINE>int loopcount = 0;<NEW_LINE>mainloop: for (int i = 0; i < this.blobs.size() - 1; i++) {<NEW_LINE>for (int j = i + 1; j < this.blobs.size(); j++) {<NEW_LINE>loopcount++;<NEW_LINE>lf = this.blobs.get(i).location;<NEW_LINE>rf = this.blobs.get(j).location;<NEW_LINE>m = this.blobs.get(i).blob.mem();<NEW_LINE>m += this.blobs.get(j).blob.mem();<NEW_LINE>l = 1 + (lf.length() >> 1);<NEW_LINE>r = 1 + (rf.length() >> 1);<NEW_LINE>if (l + r > maxResultSize)<NEW_LINE>continue;<NEW_LINE>if (!MemoryControl.request(m, true))<NEW_LINE>continue;<NEW_LINE>final float q = Math.max((float) l, (float) r) / Math.min((float) l, (float) r);<NEW_LINE>if (q < min) {<NEW_LINE>min = q;<NEW_LINE>bestMatch[0] = lf;<NEW_LINE>bestMatch[1] = rf;<NEW_LINE>}<NEW_LINE>if (loopcount > 1000 && min <= maxq && min != Float.MAX_VALUE)<NEW_LINE>break mainloop;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (min > maxq)<NEW_LINE>return null;<NEW_LINE>unmountBLOB<MASK><NEW_LINE>unmountBLOB(bestMatch[0], false);<NEW_LINE>return bestMatch;<NEW_LINE>} | (bestMatch[1], false); |
1,285,438 | protected boolean doSlowStartup() {<NEW_LINE>tempWorkDir = options.getWorkDir() == null;<NEW_LINE>if (tempWorkDir) {<NEW_LINE>try {<NEW_LINE>options.setWorkDir(Utility.makeTemporaryDirectory(null, "gwtc"));<NEW_LINE>} catch (IOException e) {<NEW_LINE>System.err.println("Unable to create hosted mode work directory");<NEW_LINE>e.printStackTrace();<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>TreeLogger branch = getTopLogger().<MASK><NEW_LINE>Event slowStartupEvent = SpeedTracerLogger.start(DevModeEventType.SLOW_STARTUP);<NEW_LINE>try {<NEW_LINE>for (ModuleDef module : startupModules.values()) {<NEW_LINE>TreeLogger loadLogger = branch.branch(TreeLogger.DEBUG, "Bootstrap link for command-line module '" + module.getCanonicalName() + "'");<NEW_LINE>link(loadLogger, module);<NEW_LINE>}<NEW_LINE>} catch (UnableToCompleteException e) {<NEW_LINE>// Already logged.<NEW_LINE>return false;<NEW_LINE>} finally {<NEW_LINE>slowStartupEvent.end();<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | branch(TreeLogger.TRACE, "Linking modules"); |
791,025 | protected View onCreateView(@NonNull ViewGroup parent) {<NEW_LINE>super.onCreateView(parent);<NEW_LINE>View view = View.inflate(getContext(), mLayout, null);<NEW_LINE>Button learnMoreButton = view.findViewById(R.id.learn_more_button);<NEW_LINE>learnMoreButton.setOnClickListener(this);<NEW_LINE>if (!TextUtils.isEmpty(mCaption)) {<NEW_LINE>TextView caption = view.findViewById(R.id.learn_more_caption);<NEW_LINE>caption.setText(mCaption);<NEW_LINE>caption.setVisibility(View.VISIBLE);<NEW_LINE>}<NEW_LINE>if (!TextUtils.isEmpty(mButtonText)) {<NEW_LINE>learnMoreButton.setText(mButtonText);<NEW_LINE>learnMoreButton.setVisibility(View.VISIBLE);<NEW_LINE>view.findViewById(R.id.bottom_padding).setVisibility(View.GONE);<NEW_LINE>}<NEW_LINE>if (mIcon != -1) {<NEW_LINE>ImageView icon = view.findViewById(R.id.learn_more_icon);<NEW_LINE>if (icon != null) {<NEW_LINE>icon.setImageResource(mIcon);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return view;<NEW_LINE>} | icon.setVisibility(View.VISIBLE); |
79,968 | protected void onCreate(@Nullable Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>Bundle extra = getIntent().getExtras();<NEW_LINE>String preLayout = extra.getString(Utils.KEY);<NEW_LINE>setTitle(layout_name = preLayout);<NEW_LINE>Context ctx = getApplicationContext();<NEW_LINE>int id = ctx.getResources().getIdentifier(preLayout, <MASK><NEW_LINE>setContentView(id);<NEW_LINE>mConstraintLayout = Utils.findConstraintLayout(this);<NEW_LINE>if (mConstraintLayout == null)<NEW_LINE>return;<NEW_LINE>mConstraintLayout.addValueModifier(new ConstraintLayout.ValueModifier() {<NEW_LINE><NEW_LINE>public boolean update(int width, int height, int id, View view, ConstraintLayout.LayoutParams params) {<NEW_LINE>if (id == R.id.myView) {<NEW_LINE>params.width = width / 3;<NEW_LINE>params.leftMargin = -width / 3;<NEW_LINE>params.verticalBias = (System.currentTimeMillis() % 10000) / 10000f;<NEW_LINE>view.post(() -> view.requestLayout());<NEW_LINE>if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {<NEW_LINE>params.setMarginStart(-width / 3);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | "layout", ctx.getPackageName()); |
257,671 | public static PrivTable read(DataInput in) throws IOException {<NEW_LINE>String <MASK><NEW_LINE>if (className.startsWith("com.baidu.palo")) {<NEW_LINE>// we need to be compatible with former class name<NEW_LINE>className = className.replaceFirst("com.baidu.palo", "org.apache.doris");<NEW_LINE>}<NEW_LINE>PrivTable privTable = null;<NEW_LINE>try {<NEW_LINE>Class<? extends PrivTable> derivedClass = (Class<? extends PrivTable>) Class.forName(className);<NEW_LINE>privTable = derivedClass.newInstance();<NEW_LINE>Class[] paramTypes = { DataInput.class };<NEW_LINE>Method readMethod = derivedClass.getMethod("readFields", paramTypes);<NEW_LINE>Object[] params = { in };<NEW_LINE>readMethod.invoke(privTable, params);<NEW_LINE>return privTable;<NEW_LINE>} catch (ClassNotFoundException | InstantiationException | IllegalAccessException | NoSuchMethodException | SecurityException | IllegalArgumentException | InvocationTargetException e) {<NEW_LINE>throw new IOException("failed read PrivTable", e);<NEW_LINE>}<NEW_LINE>} | className = Text.readString(in); |
1,669,091 | private Mono<Response<RegistryNameStatusInner>> checkNameAvailabilityWithResponseAsync(RegistryNameCheckRequest registryNameCheckRequest, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (registryNameCheckRequest == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>} else {<NEW_LINE>registryNameCheckRequest.validate();<NEW_LINE>}<NEW_LINE>final String apiVersion = "2021-09-01";<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.checkNameAvailability(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), registryNameCheckRequest, accept, context);<NEW_LINE>} | error(new IllegalArgumentException("Parameter registryNameCheckRequest is required and cannot be null.")); |
1,350,246 | public void handleRequest(final HttpServerExchange exchange) throws Exception {<NEW_LINE>// check if there is a bear token in the authorization header in the request. If this<NEW_LINE>// is one, then this must be the subject token that is linked to the original user.<NEW_LINE>// We will keep this token in the Authorization header but create a new token with<NEW_LINE>// client credentials grant type with scopes for the particular client. (Can we just<NEW_LINE>// assume that the subject token has the scope already?)<NEW_LINE>logger.debug(exchange.toString());<NEW_LINE>Result<String> result = getSAMLBearerToken(exchange.getRequestHeaders().getFirst(SAMLAssertionHeader), exchange.getRequestHeaders().getFirst(JWTAssertionHeader));<NEW_LINE>if (result.isFailure()) {<NEW_LINE>OauthHelper.sendStatusToResponse(exchange, result.getError());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>exchange.getRequestHeaders().put(Headers.AUTHORIZATION, "Bearer " + result.getResult());<NEW_LINE>exchange.<MASK><NEW_LINE>exchange.getRequestHeaders().remove(JWTAssertionHeader);<NEW_LINE>Handler.next(exchange, next);<NEW_LINE>} | getRequestHeaders().remove(SAMLAssertionHeader); |
1,212,534 | public void selectElement(final PsiElement element) {<NEW_LINE>if (element != null) {<NEW_LINE>final PackageSet packageSet = getCurrentScope().getValue();<NEW_LINE>final PsiFile psiFile = element.getContainingFile();<NEW_LINE>if (packageSet == null)<NEW_LINE>return;<NEW_LINE>final VirtualFile virtualFile = psiFile != null ? psiFile.getVirtualFile() : (element instanceof PsiDirectory ? ((PsiDirectory) element<MASK><NEW_LINE>if (virtualFile != null) {<NEW_LINE>final ProjectView projectView = ProjectView.getInstance(myProject);<NEW_LINE>final NamedScopesHolder holder = NamedScopesHolder.getHolder(myProject, CURRENT_SCOPE_NAME, myDependencyValidationManager);<NEW_LINE>if (packageSet instanceof PackageSetBase && !((PackageSetBase) packageSet).contains(virtualFile, myProject, holder) || psiFile != null && !packageSet.contains(psiFile, holder)) {<NEW_LINE>projectView.changeView(ProjectViewPane.ID);<NEW_LINE>}<NEW_LINE>projectView.select(element, virtualFile, false);<NEW_LINE>}<NEW_LINE>Editor editor = EditorHelper.openInEditor(element);<NEW_LINE>if (editor != null) {<NEW_LINE>ToolWindowManager.getInstance(myProject).activateEditorComponent();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ).getVirtualFile() : null); |
149,585 | public TextBody buildTextPlain() {<NEW_LINE>// The length of the formatted version of the user-supplied text/reply<NEW_LINE>int composedMessageLength;<NEW_LINE>// The offset of the user-supplied text/reply in the final text body<NEW_LINE>int composedMessageOffset;<NEW_LINE>// Get the user-supplied text<NEW_LINE>String text = mMessageContent;<NEW_LINE>// Capture composed message length before we start attaching quoted parts and signatures.<NEW_LINE>composedMessageLength = text.length();<NEW_LINE>composedMessageOffset = 0;<NEW_LINE>// Do we have to modify an existing message to include our reply?<NEW_LINE>if (mIncludeQuotedText) {<NEW_LINE>String quotedText = getQuotedText();<NEW_LINE>// Append signature to the text/reply<NEW_LINE>if (mAppendSignature && (mReplyAfterQuote || mSignatureBeforeQuotedText)) {<NEW_LINE>text += getSignature();<NEW_LINE>}<NEW_LINE>if (mReplyAfterQuote) {<NEW_LINE>composedMessageOffset = quotedText.length() + "\r\n".length();<NEW_LINE>text = quotedText + "\r\n" + text;<NEW_LINE>} else {<NEW_LINE>text += "\r\n\r\n" + quotedText;<NEW_LINE>}<NEW_LINE>// Place signature immediately after the quoted text<NEW_LINE>if (mAppendSignature && !(mReplyAfterQuote || mSignatureBeforeQuotedText)) {<NEW_LINE>text += getSignature();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// There is no text to quote so simply append the signature if available<NEW_LINE>if (mAppendSignature) {<NEW_LINE>// Append signature to the text/reply<NEW_LINE>text += getSignature();<NEW_LINE>}<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>body.setComposedMessageLength(composedMessageLength);<NEW_LINE>body.setComposedMessageOffset(composedMessageOffset);<NEW_LINE>return body;<NEW_LINE>} | TextBody body = new TextBody(text); |
1,723,132 | public SkyValue compute(SkyKey skyKey, Environment env) throws InterruptedException {<NEW_LINE>PackageIdentifier dir = (PackageIdentifier) skyKey.argument();<NEW_LINE>PackageLookupValue pkgLookupValue = (PackageLookupValue) env.getValue(PackageLookupValue.key(dir));<NEW_LINE>if (pkgLookupValue == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (pkgLookupValue.packageExists()) {<NEW_LINE>return ContainingPackageLookupValue.withContainingPackage(dir, pkgLookupValue.getRoot());<NEW_LINE>}<NEW_LINE>// Does the requested package cross into a sub-repository, which we should report via the<NEW_LINE>// correct package identifier?<NEW_LINE>if (pkgLookupValue instanceof IncorrectRepositoryReferencePackageLookupValue) {<NEW_LINE>IncorrectRepositoryReferencePackageLookupValue incorrectPackageLookupValue = (IncorrectRepositoryReferencePackageLookupValue) pkgLookupValue;<NEW_LINE>PackageIdentifier correctPackageIdentifier = incorrectPackageLookupValue.getCorrectedPackageIdentifier();<NEW_LINE>return env.getValue(ContainingPackageLookupValue.key(correctPackageIdentifier));<NEW_LINE>}<NEW_LINE>if (ErrorReason.REPOSITORY_NOT_FOUND.equals(pkgLookupValue.getErrorReason())) {<NEW_LINE>return new ContainingPackageLookupValue.NoContainingPackage(pkgLookupValue.getErrorMsg());<NEW_LINE>}<NEW_LINE>PathFragment parentDir = dir.getPackageFragment().getParentDirectory();<NEW_LINE>if (parentDir == null) {<NEW_LINE>return ContainingPackageLookupValue.NONE;<NEW_LINE>}<NEW_LINE>PackageIdentifier parentId = PackageIdentifier.create(<MASK><NEW_LINE>return env.getValue(ContainingPackageLookupValue.key(parentId));<NEW_LINE>} | dir.getRepository(), parentDir); |
1,728,613 | private String genLoadSelectSql(LoadNode loadNode, NodeRelation relation, Map<String, Node> nodeMap) {<NEW_LINE>String selectSql;<NEW_LINE>if (relation instanceof JoinRelation) {<NEW_LINE>// parse join relation and generate the select sql<NEW_LINE>JoinRelation joinRelation = (JoinRelation) relation;<NEW_LINE>selectSql = genJoinSelectSql(loadNode, loadNode.getFieldRelations(), joinRelation, loadNode.getFilters(), loadNode.getFilterStrategy(), nodeMap);<NEW_LINE>} else if (relation instanceof UnionNodeRelation) {<NEW_LINE>// parse union relation and generate the select sql<NEW_LINE>Preconditions.checkState(loadNode.getFilters() == null || loadNode.getFilters().isEmpty(), "Filter is not supported when union");<NEW_LINE>UnionNodeRelation unionRelation = (UnionNodeRelation) relation;<NEW_LINE>selectSql = genUnionNodeSelectSql(loadNode, loadNode.getFieldRelations(), unionRelation, nodeMap);<NEW_LINE>} else {<NEW_LINE>// parse base relation that one to one and generate the select sql<NEW_LINE>Preconditions.checkState(relation.getInputs().<MASK><NEW_LINE>Preconditions.checkState(relation.getOutputs().size() == 1, "join node only support one output node");<NEW_LINE>selectSql = genSimpleSelectSql(loadNode, loadNode.getFieldRelations(), relation, loadNode.getFilters(), loadNode.getFilterStrategy(), nodeMap);<NEW_LINE>}<NEW_LINE>return selectSql;<NEW_LINE>} | size() == 1, "simple transform only support one input node"); |
15,371 | protected void configure() {<NEW_LINE>this.addSinkType(<MASK><NEW_LINE>this.addSinkType(ElasticSearchSink.TYPE, ElasticSearchSink.class);<NEW_LINE>this.addSinkType(KafkaSink.TYPE, KafkaSink.class);<NEW_LINE>this.addSinkType(KafkaSinkV2.TYPE, KafkaSinkV2.class);<NEW_LINE>Message.classMap.put((byte) 1, SuroKeyedMessage.class);<NEW_LINE>this.addSinkType(S3FileSink.TYPE, S3FileSink.class);<NEW_LINE>this.addSinkType(HdfsFileSink.TYPE, HdfsFileSink.class);<NEW_LINE>this.addRemotePrefixFormatterType(DateRegionStackFormatter.TYPE, DateRegionStackFormatter.class);<NEW_LINE>this.addRemotePrefixFormatterType(DynamicRemotePrefixFormatter.TYPE, DynamicRemotePrefixFormatter.class);<NEW_LINE>this.addSinkType(SuroSink.TYPE, SuroSink.class);<NEW_LINE>this.addNoticeType(NoNotice.TYPE, NoNotice.class);<NEW_LINE>this.addNoticeType(QueueNotice.TYPE, QueueNotice.class);<NEW_LINE>this.addNoticeType(SQSNotice.TYPE, SQSNotice.class);<NEW_LINE>this.addNoticeType(LogNotice.TYPE, LogNotice.class);<NEW_LINE>} | LocalFileSink.TYPE, LocalFileSink.class); |
954,861 | final ListApplicationInstanceNodeInstancesResult executeListApplicationInstanceNodeInstances(ListApplicationInstanceNodeInstancesRequest listApplicationInstanceNodeInstancesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listApplicationInstanceNodeInstancesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListApplicationInstanceNodeInstancesRequest> request = null;<NEW_LINE>Response<ListApplicationInstanceNodeInstancesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListApplicationInstanceNodeInstancesRequestProtocolMarshaller(protocolFactory).marshall<MASK><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, "Panorama");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListApplicationInstanceNodeInstances");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListApplicationInstanceNodeInstancesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListApplicationInstanceNodeInstancesResultJsonUnmarshaller());<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>} | (super.beforeMarshalling(listApplicationInstanceNodeInstancesRequest)); |
173,569 | public I_C_Flatrate_Term createSubscriptionTerm(@NonNull final I_C_OrderLine ol, final boolean completeIt) {<NEW_LINE>final I_C_Order order = InterfaceWrapperHelper.create(ol.getC_Order(), I_C_Order.class);<NEW_LINE>final I_C_Flatrate_Conditions cond = ol.getC_Flatrate_Conditions();<NEW_LINE>final I_C_Flatrate_Term newTerm = InterfaceWrapperHelper.newInstance(I_C_Flatrate_Term.class, ol);<NEW_LINE>newTerm.setC_OrderLine_Term_ID(ol.getC_OrderLine_ID());<NEW_LINE>newTerm.setC_Order_Term_ID(ol.getC_Order_ID());<NEW_LINE>newTerm.setC_Flatrate_Conditions_ID(cond.getC_Flatrate_Conditions_ID());<NEW_LINE>// important: we need to use qtyEntered here, because qtyOrdered (which<NEW_LINE>// is used for pricing) contains the number of goods to be delivered<NEW_LINE>// over the whole subscription term<NEW_LINE>newTerm.setPlannedQtyPerUnit(ol.getQtyEntered());<NEW_LINE>newTerm.setC_UOM_ID(ol.getPrice_UOM_ID());<NEW_LINE>newTerm.setStartDate(order.getDatePromised());<NEW_LINE>newTerm.<MASK><NEW_LINE>newTerm.setDeliveryRule(order.getDeliveryRule());<NEW_LINE>newTerm.setDeliveryViaRule(order.getDeliveryViaRule());<NEW_LINE>final BPartnerLocationAndCaptureId billToLocationId = orderBL.getBillToLocationId(order);<NEW_LINE>final BPartnerContactId billToContactId = BPartnerContactId.ofRepoIdOrNull(billToLocationId.getBpartnerId(), order.getBill_User_ID());<NEW_LINE>ContractDocumentLocationAdapterFactory.billLocationAdapter(newTerm).setFrom(billToLocationId, billToContactId);<NEW_LINE>final BPartnerContactId dropshipContactId = BPartnerContactId.ofRepoIdOrNull(ol.getC_BPartner_ID(), ol.getAD_User_ID());<NEW_LINE>final BPartnerLocationAndCaptureId dropshipLocationId = orderBL.getShipToLocationId(order);<NEW_LINE>ContractDocumentLocationAdapterFactory.dropShipLocationAdapter(newTerm).setFrom(dropshipLocationId, dropshipContactId);<NEW_LINE>I_C_Flatrate_Data existingData = fetchFlatrateData(ol, order);<NEW_LINE>if (existingData == null) {<NEW_LINE>existingData = InterfaceWrapperHelper.newInstance(I_C_Flatrate_Data.class, ol);<NEW_LINE>existingData.setC_BPartner_ID(order.getBill_BPartner_ID());<NEW_LINE>save(existingData);<NEW_LINE>}<NEW_LINE>newTerm.setC_Flatrate_Data(existingData);<NEW_LINE>newTerm.setAD_User_InCharge_ID(order.getSalesRep_ID());<NEW_LINE>newTerm.setIsSimulation(cond.isSimulation());<NEW_LINE>newTerm.setM_Product_ID(ol.getM_Product_ID());<NEW_LINE>Services.get(IAttributeSetInstanceBL.class).cloneASI(ol, newTerm);<NEW_LINE>newTerm.setPriceActual(ol.getPriceActual());<NEW_LINE>newTerm.setC_Currency_ID(ol.getC_Currency_ID());<NEW_LINE>setPricingSystemTaxCategAndIsTaxIncluded(ol, newTerm);<NEW_LINE>newTerm.setContractStatus(X_C_Flatrate_Term.CONTRACTSTATUS_Waiting);<NEW_LINE>newTerm.setDocStatus(X_C_Flatrate_Term.DOCSTATUS_Drafted);<NEW_LINE>newTerm.setDocAction(X_C_Flatrate_Term.DOCACTION_Complete);<NEW_LINE>save(newTerm);<NEW_LINE>linkContractsIfNeeded(newTerm);<NEW_LINE>if (completeIt) {<NEW_LINE>Services.get(IDocumentBL.class).processEx(newTerm, X_C_Flatrate_Term.DOCACTION_Complete, X_C_Flatrate_Term.DOCSTATUS_Completed);<NEW_LINE>}<NEW_LINE>return newTerm;<NEW_LINE>} | setMasterStartDate(order.getDatePromised()); |
1,489,559 | private List<GridElement> gridElementCopyInOtherDiagram(List<GridElement> originals, int diffY) {<NEW_LINE>int verticalScrollbarDiff = otherDrawFocusPanel.scrollPanel.getVerticalScrollPosition() - scrollPanel.getVerticalScrollPosition();<NEW_LINE>int horizontalScrollbarDiff = otherDrawFocusPanel.scrollPanel.getHorizontalScrollPosition() - scrollPanel.getHorizontalScrollPosition();<NEW_LINE>List<GridElement> copies = new ArrayList<>();<NEW_LINE>double factor = getGridSize() * 1.0d / otherDrawFocusPanel.getGridSize();<NEW_LINE>// Calculating vertical paste position for other diagram<NEW_LINE>int pastePos = (int) ((diffY + paletteChooser.getOffsetHeight() + verticalScrollbarDiff) * factor);<NEW_LINE>for (GridElement original : originals) {<NEW_LINE>GridElement copy = ElementFactoryGwt.create(<MASK><NEW_LINE>copies.add(copy);<NEW_LINE>Rectangle copyRect = copy.getRectangle();<NEW_LINE>int newX = (int) (copyRect.getX() + (otherDrawFocusPanel.getVisibleBounds().width + horizontalScrollbarDiff) * factor);<NEW_LINE>int newY = pastePos + copy.getRectangle().y - lastDraggedGridElement.getRectangle().y - lastDraggedGridElement.getRectangle().getHeight() / 2;<NEW_LINE>copy.setLocation(newX, newY);<NEW_LINE>}<NEW_LINE>return copies;<NEW_LINE>} | original, otherDrawFocusPanel.getDiagram()); |
1,704,163 | // first part<NEW_LINE>void sieve(int upperbound) {<NEW_LINE>// create list of primes in [0..upperbound]<NEW_LINE>// add 1 to include upperbound<NEW_LINE>_sieve_size = upperbound + 1;<NEW_LINE>bs = new boolean[_sieve_size];<NEW_LINE>// set all bits to 1<NEW_LINE>Arrays.fill(bs, true);<NEW_LINE>// except index 0 and 1<NEW_LINE>bs[0] = bs[1] = false;<NEW_LINE>for (long i = 2; i < _sieve_size; i++) if (bs[(int) i]) {<NEW_LINE>// cross out multiples of i starting from i * i!<NEW_LINE>for (long j = i * i; j < _sieve_size; j += i) bs<MASK><NEW_LINE>// also add this vector containing list of primes<NEW_LINE>primes.add((int) i);<NEW_LINE>}<NEW_LINE>} | [(int) j] = false; |
1,595,812 | private void renderRuntimeIntern() throws IOException {<NEW_LINE>if (!needInternMethod()) {<NEW_LINE>writer.append("function $rt_intern(str) {").indent().softNewLine();<NEW_LINE>writer.append("return str;").softNewLine();<NEW_LINE>writer.outdent().append("}").softNewLine();<NEW_LINE>} else {<NEW_LINE>renderHandWrittenRuntime("intern.js");<NEW_LINE>writer.append("function $rt_stringHash(s)").ws().append("{").indent().softNewLine();<NEW_LINE>writer.append("return ").appendMethodBody(String.class, "hashCode", int.class).<MASK><NEW_LINE>writer.outdent().append("}").softNewLine();<NEW_LINE>writer.append("function $rt_stringEquals(a,").ws().append("b)").ws().append("{").indent().softNewLine();<NEW_LINE>writer.append("return ").appendMethodBody(String.class, "equals", Object.class, boolean.class).append("(a").ws().append(",b);").softNewLine();<NEW_LINE>writer.outdent().append("}").softNewLine();<NEW_LINE>}<NEW_LINE>} | append("(s);").softNewLine(); |
566,670 | public void run(final ResultHandler<? super Void> handler) {<NEW_LINE>if (operationDescriptors.isEmpty() && internalJvmTestRequests.isEmpty() && tasksAndTests.isEmpty()) {<NEW_LINE>throw new TestExecutionException("No test declared for execution.");<NEW_LINE>}<NEW_LINE>for (Map.Entry<String, List<InternalJvmTestRequest>> entry : tasksAndTests.entrySet()) {<NEW_LINE>if (entry.getValue().isEmpty()) {<NEW_LINE>throw new TestExecutionException("No test for task " + entry.getKey() + " declared for execution.");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final ConsumerOperationParameters operationParameters = getConsumerOperationParameters();<NEW_LINE>final TestExecutionRequest testExecutionRequest = new TestExecutionRequest(operationDescriptors, ImmutableList.copyOf(testClassNames), ImmutableSet.copyOf(internalJvmTestRequests), debugOptions, ImmutableMap.copyOf(tasksAndTests));<NEW_LINE>connection.run(new ConsumerAction<Void>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public ConsumerOperationParameters getParameters() {<NEW_LINE>return operationParameters;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Void run(ConsumerConnection connection) {<NEW_LINE>connection.runTests(testExecutionRequest, getParameters());<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>} | }, new ResultHandlerAdapter(handler)); |
457,175 | static void emitToNativeConversion(AsmBuilder builder, SkinnyMethodAdapter mv, ToNativeType toNativeType) {<NEW_LINE>ToNativeConverter parameterConverter = toNativeType.getToNativeConverter();<NEW_LINE>if (parameterConverter != null) {<NEW_LINE>Method toNativeMethod = getToNativeMethod(toNativeType, builder.getClassLoader());<NEW_LINE>if (toNativeType.getDeclaredType().isPrimitive()) {<NEW_LINE>boxValue(builder, mv, getBoxedClass(toNativeType.getDeclaredType()), toNativeType.getDeclaredType());<NEW_LINE>}<NEW_LINE>if (!toNativeMethod.getParameterTypes()[0].isAssignableFrom(getBoxedClass(toNativeType.getDeclaredType()))) {<NEW_LINE>mv.checkcast(toNativeMethod.getParameterTypes()[0]);<NEW_LINE>}<NEW_LINE>mv.aload(0);<NEW_LINE>AsmBuilder.ObjectField toNativeConverterField = builder.getToNativeConverterField(parameterConverter);<NEW_LINE>mv.getfield(builder.getClassNamePath(), toNativeConverterField.name, ci(toNativeConverterField.klass));<NEW_LINE>if (!toNativeMethod.getDeclaringClass().equals(toNativeConverterField.klass)) {<NEW_LINE>mv.checkcast(toNativeMethod.getDeclaringClass());<NEW_LINE>}<NEW_LINE>// Re-order so the value to be converted is on the top of the stack<NEW_LINE>mv.swap();<NEW_LINE>// load context parameter (if there is one)<NEW_LINE>if (toNativeType.getToNativeContext() != null) {<NEW_LINE>getfield(mv, builder, builder.getToNativeContextField(toNativeType.getToNativeContext()));<NEW_LINE>} else {<NEW_LINE>mv.aconst_null();<NEW_LINE>}<NEW_LINE>if (toNativeMethod.getDeclaringClass().isInterface()) {<NEW_LINE>mv.invokeinterface(toNativeMethod.getDeclaringClass(), toNativeMethod.getName(), toNativeMethod.getReturnType(), toNativeMethod.getParameterTypes());<NEW_LINE>} else {<NEW_LINE>mv.invokevirtual(toNativeMethod.getDeclaringClass(), toNativeMethod.getName(), toNativeMethod.getReturnType(<MASK><NEW_LINE>}<NEW_LINE>if (!parameterConverter.nativeType().isAssignableFrom(toNativeMethod.getReturnType())) {<NEW_LINE>mv.checkcast(p(parameterConverter.nativeType()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ), toNativeMethod.getParameterTypes()); |
901,728 | private void animateLayout() {<NEW_LINE>AnimatorListenerAdapter adapter = new AnimatorListenerAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onAnimationEnd(Animator animation) {<NEW_LINE>if (isHidden) {<NEW_LINE>pageSwitcher.setVisibility(View.GONE);<NEW_LINE>toolbar.setVisibility(View.GONE);<NEW_LINE>view.setVisibility(View.GONE);<NEW_LINE>cornerPageViewer.setVisibility(View.VISIBLE);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>pageSwitcher.setVisibility(View.VISIBLE);<NEW_LINE>toolbar.setVisibility(View.VISIBLE);<NEW_LINE><MASK><NEW_LINE>cornerPageViewer.setVisibility(View.GONE);<NEW_LINE>pageSwitcher.animate().alpha(isHidden ? 0f : 0.75f).setDuration(150).setListener(adapter).start();<NEW_LINE>view.animate().alpha(isHidden ? 0f : 0.75f).setDuration(150).setListener(adapter).start();<NEW_LINE>toolbar.animate().alpha(isHidden ? 0f : 0.75f).setDuration(150).setListener(adapter).start();<NEW_LINE>} | view.setVisibility(View.VISIBLE); |
1,254,300 | public Mono<Connection> datasourceCreate(DatasourceConfiguration datasourceConfiguration) {<NEW_LINE>try {<NEW_LINE>Class.forName("net.snowflake.client.jdbc.SnowflakeDriver");<NEW_LINE>} catch (ClassNotFoundException ex) {<NEW_LINE>System.err.println("Driver not found");<NEW_LINE>return Mono.error(new AppsmithPluginException(AppsmithPluginError.PLUGIN_ERROR, ex.getMessage()));<NEW_LINE>}<NEW_LINE>DBAuth authentication = (DBAuth) datasourceConfiguration.getAuthentication();<NEW_LINE>Properties properties = new Properties();<NEW_LINE>properties.setProperty("user", authentication.getUsername());<NEW_LINE>properties.setProperty("password", authentication.getPassword());<NEW_LINE>properties.setProperty("warehouse", String.valueOf(datasourceConfiguration.getProperties().get(0).getValue()));<NEW_LINE>properties.setProperty("db", String.valueOf(datasourceConfiguration.getProperties().get(1).getValue()));<NEW_LINE>properties.setProperty("schema", String.valueOf(datasourceConfiguration.getProperties().get(2).getValue()));<NEW_LINE>properties.setProperty("role", String.valueOf(datasourceConfiguration.getProperties().get(<MASK><NEW_LINE>return Mono.fromCallable(() -> {<NEW_LINE>Connection conn;<NEW_LINE>try {<NEW_LINE>conn = DriverManager.getConnection("jdbc:snowflake://" + datasourceConfiguration.getUrl() + ".snowflakecomputing.com", properties);<NEW_LINE>} catch (SQLException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_DATASOURCE_ARGUMENT_ERROR, e.getMessage());<NEW_LINE>}<NEW_LINE>if (conn == null) {<NEW_LINE>throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_ERROR, "Unable to create connection to Snowflake URL");<NEW_LINE>}<NEW_LINE>return conn;<NEW_LINE>}).subscribeOn(scheduler);<NEW_LINE>} | 3).getValue())); |
1,071,728 | public boolean turnDeviceOff(String token, DSID dsid, String name) {<NEW_LINE>if (((dsid != null && dsid.getValue() != null) || name != null)) {<NEW_LINE>String response = null;<NEW_LINE>if (dsid != null && dsid.getValue() != null) {<NEW_LINE>if (name != null) {<NEW_LINE>response = transport.execute(JSONRequestConstants.JSON_DEVICE_TURN_OFF + JSONRequestConstants.PARAMETER_TOKEN + token + JSONRequestConstants.INFIX_PARAMETER_DSID + dsid.getValue() + JSONRequestConstants.INFIX_PARAMETER_NAME + name);<NEW_LINE>} else {<NEW_LINE>response = transport.execute(JSONRequestConstants.JSON_DEVICE_TURN_OFF + JSONRequestConstants.PARAMETER_TOKEN + token + JSONRequestConstants.<MASK><NEW_LINE>}<NEW_LINE>} else if (name != null) {<NEW_LINE>response = transport.execute(JSONRequestConstants.JSON_DEVICE_TURN_OFF + JSONRequestConstants.PARAMETER_TOKEN + token + JSONRequestConstants.INFIX_PARAMETER_NAME + name);<NEW_LINE>}<NEW_LINE>if (handler.checkResponse(handler.toJSONObject(response))) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | INFIX_PARAMETER_DSID + dsid.getValue()); |
1,593,621 | public void serialize(LBMember member, JsonGenerator jGen, SerializerProvider serializer) throws IOException, JsonProcessingException {<NEW_LINE>jGen.writeStartObject();<NEW_LINE>jGen.writeStringField("id", member.id);<NEW_LINE>jGen.writeStringField("address", String.valueOf(IPv4Address.of(member.address)));<NEW_LINE>jGen.writeStringField("port", Short<MASK><NEW_LINE>jGen.writeStringField("poolId", member.poolId);<NEW_LINE>jGen.writeStringField("vipId", member.vipId);<NEW_LINE>jGen.writeStringField("weight", Short.toString(member.weight));<NEW_LINE>if (member.status == 0) {<NEW_LINE>jGen.writeStringField("status", "Alive");<NEW_LINE>}<NEW_LINE>if (member.status == 1) {<NEW_LINE>jGen.writeStringField("status", "Active");<NEW_LINE>}<NEW_LINE>if (member.status == -1) {<NEW_LINE>jGen.writeStringField("status", "Inactive");<NEW_LINE>}<NEW_LINE>jGen.writeEndObject();<NEW_LINE>} | .toString(member.port)); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.