idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
7,269 | protected void onDraw(Canvas canvas) {<NEW_LINE>super.onDraw(canvas);<NEW_LINE>float eatRightX = mPadding + eatErWidth + eatErPositionX;<NEW_LINE>mRect.set(mPadding + eatErPositionX, mHigh / 2 - eatErWidth / 2, eatRightX, mHigh / 2 + eatErWidth / 2);<NEW_LINE>canvas.drawArc(mRect, <MASK><NEW_LINE>canvas.drawCircle(mPadding + eatErPositionX + eatErWidth / 2, mHigh / 2 - eatErWidth / 4, beansWidth / 2, mPaintEye);<NEW_LINE>int beansCount = (int) ((mWidth - mPadding * 2 - eatErWidth) / beansWidth / 2);<NEW_LINE>for (int i = 0; i < beansCount; i++) {<NEW_LINE>float x = beansCount * i + beansWidth / 2 + mPadding + eatErWidth;<NEW_LINE>if (x > eatRightX) {<NEW_LINE>canvas.drawCircle(x, mHigh / 2, beansWidth / 2, mPaintBeans);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | eatErStartAngle, eatErEndAngle, true, mPaint); |
1,749,548 | private boolean handle(SyntaxDocument doc, Token token) {<NEW_LINE>final Matcher matcher = nodeIdPattern.matcher(token.getText(doc));<NEW_LINE>if (matcher.matches()) {<NEW_LINE>String id = matcher.group(1);<NEW_LINE>final NodeModel node = Controller.getCurrentController().getMap().getNodeForID(id);<NEW_LINE>if (node != null) {<NEW_LINE>final MapController mapController = Controller.getCurrentModeController().getMapController();<NEW_LINE>final <MASK><NEW_LINE>if (node.equals(selectedNode)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>NodeModel originallySelectedNode = this.originallySelectedNode;<NEW_LINE>if (originallySelectedNode == null)<NEW_LINE>originallySelectedNode = mapController.getSelectedNode();<NEW_LINE>else {<NEW_LINE>deHighlight();<NEW_LINE>}<NEW_LINE>this.originallySelectedNode = originallySelectedNode;<NEW_LINE>mapController.displayNode(node, nodesOriginallyFolded);<NEW_LINE>mapController.select(node);<NEW_LINE>pane.setToolTipText(node.getText());<NEW_LINE>return true;<NEW_LINE>} else {<NEW_LINE>//<NEW_LINE>pane.//<NEW_LINE>setToolTipText("<html><body bgcolor='#CC0000'>" + TextUtils.format(getResourceKey("node_is_not_defined"), id) + "</body></html>");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>deHighlight();<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | NodeModel selectedNode = mapController.getSelectedNode(); |
666,740 | public static TrifocalTensor createTrifocal(Se3_F64 P2, Se3_F64 P3, @Nullable TrifocalTensor ret) {<NEW_LINE>if (ret == null)<NEW_LINE>ret = new TrifocalTensor();<NEW_LINE>DMatrixRMaj R2 = P2.getR();<NEW_LINE><MASK><NEW_LINE>Vector3D_F64 T2 = P2.getT();<NEW_LINE>Vector3D_F64 T3 = P3.getT();<NEW_LINE>for (int col = 0; col < 3; col++) {<NEW_LINE>DMatrixRMaj T = ret.getT(col);<NEW_LINE>int index = 0;<NEW_LINE>for (int i = 0; i < 3; i++) {<NEW_LINE>double a_left = R2.unsafe_get(i, col);<NEW_LINE>double a_right = T2.getIdx(i);<NEW_LINE>for (int j = 0; j < 3; j++) {<NEW_LINE>T.data[index++] = a_left * T3.getIdx(j) - a_right * R3.unsafe_get(j, col);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return ret;<NEW_LINE>} | DMatrixRMaj R3 = P3.getR(); |
965,215 | public boolean save() {<NEW_LINE>StringBuffer sql = new StringBuffer("INSERT INTO AD_PInstance_Log " + "(AD_PInstance_ID, AD_PInstance_Log_ID, P_Date, P_ID, P_Number, P_Msg)" + " VALUES (");<NEW_LINE>sql.append(m_AD_PInstance_ID).append(",").append(m_Log_ID).append(",");<NEW_LINE>if (m_P_Date == null) {<NEW_LINE>sql.append("NULL,");<NEW_LINE>} else {<NEW_LINE>sql.append(DB.TO_DATE(m_P_Date, false)).append(",");<NEW_LINE>}<NEW_LINE>if (m_P_ID == 0) {<NEW_LINE>sql.append("NULL,");<NEW_LINE>} else {<NEW_LINE>sql.append(m_P_ID).append(",");<NEW_LINE>}<NEW_LINE>if (m_P_Number == null) {<NEW_LINE>sql.append("NULL,");<NEW_LINE>} else {<NEW_LINE>sql.append(m_P_Number).append(",");<NEW_LINE>}<NEW_LINE>if (m_P_Msg == null) {<NEW_LINE>sql.append("NULL)");<NEW_LINE>} else {<NEW_LINE>sql.append(DB.TO_STRING(m_P_Msg, 2000)).append(")");<NEW_LINE>//<NEW_LINE>}<NEW_LINE>// outside of trx<NEW_LINE>int no = DB.executeUpdate(<MASK><NEW_LINE>return no == 1;<NEW_LINE>} | sql.toString(), null); |
1,114,270 | public void run(RegressionEnvironment env) {<NEW_LINE>RegressionPath path = new RegressionPath();<NEW_LINE>// widen to long<NEW_LINE>String stmtTextCreate = namedWindow ? "@public create window MyInfraW#keepall as (f1 long, f2 string)" : "@public create table MyInfraW as (f1 long primary key, f2 string primary key)";<NEW_LINE>env.compileDeploy(stmtTextCreate, path);<NEW_LINE><MASK><NEW_LINE>env.compileDeploy("create index MyInfraWIndex1 on MyInfraW(f1)", path);<NEW_LINE>String[] fields = "f1,f2".split(",");<NEW_LINE>sendEventLong(env, "E1", 10L);<NEW_LINE>env.assertThat(() -> {<NEW_LINE>EPFireAndForgetQueryResult result = env.compileExecuteFAF("select * from MyInfraW where f1=10", path);<NEW_LINE>EPAssertionUtil.assertPropsPerRow(result.getArray(), fields, new Object[][] { { 10L, "E1" } });<NEW_LINE>});<NEW_LINE>// coerce to short<NEW_LINE>stmtTextCreate = namedWindow ? "@public create window MyInfraWTwo#keepall as (f1 short, f2 string)" : "@public create table MyInfraWTwo as (f1 short primary key, f2 string primary key)";<NEW_LINE>env.compileDeploy(stmtTextCreate, path);<NEW_LINE>env.compileDeploy("insert into MyInfraWTwo(f1, f2) select shortPrimitive, theString from SupportBean", path);<NEW_LINE>env.compileDeploy("create index MyInfraWTwoIndex1 on MyInfraWTwo(f1)", path);<NEW_LINE>sendEventShort(env, "E1", (short) 2);<NEW_LINE>env.assertThat(() -> {<NEW_LINE>EPFireAndForgetQueryResult result = env.compileExecuteFAF("select * from MyInfraWTwo where f1=2", path);<NEW_LINE>EPAssertionUtil.assertPropsPerRow(result.getArray(), fields, new Object[][] { { (short) 2, "E1" } });<NEW_LINE>});<NEW_LINE>env.undeployAll();<NEW_LINE>} | env.compileDeploy("insert into MyInfraW(f1, f2) select longPrimitive, theString from SupportBean", path); |
398,314 | private boolean isNeedRun() {<NEW_LINE>List<String> ignoreAgentPortModule = new ArrayList<String>();<NEW_LINE>ignoreAgentPortModule.add("imagestorebackupstorage.py");<NEW_LINE>if (isFullDeploy()) {<NEW_LINE>logger.debug("Ansible.fullDeploy is set, run ansible anyway");<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (ansibleNeedRun != null) {<NEW_LINE>return ansibleNeedRun.isRunNeed();<NEW_LINE>}<NEW_LINE>boolean changed = asf.isModuleChanged(playBookName);<NEW_LINE>if (changed) {<NEW_LINE>logger.debug(String<MASK><NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (agentPort != 0) {<NEW_LINE>boolean opened = NetworkUtils.isRemotePortOpen(targetIp, agentPort, (int) TimeUnit.SECONDS.toMillis(5));<NEW_LINE>if (!opened) {<NEW_LINE>logger.debug(String.format("agent port[%s] on target ip[%s] is not opened, run ansible[%s]", agentPort, targetIp, playBookName));<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (runChecker()) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>logger.debug(String.format("agent port[%s] on target ip[%s] is opened, ansible module[%s] is not changed, skip to run ansible", agentPort, targetIp, playBookName));<NEW_LINE>return false;<NEW_LINE>} else if (ignoreAgentPortModule.contains(playBookName)) {<NEW_LINE>logger.debug(String.format("module %s will not check agent port, only check md5sum", playBookName));<NEW_LINE>if (runChecker()) {<NEW_LINE>logger.debug(String.format("module %s md5sum changed, run ansible", playBookName));<NEW_LINE>return true;<NEW_LINE>} else {<NEW_LINE>logger.debug(String.format("module %s md5sum not change, skip to run ansible", playBookName));<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>logger.debug("agent port is not set, run ansible anyway");<NEW_LINE>return true;<NEW_LINE>} | .format("ansible module[%s] changed, run ansible", playBookName)); |
862,874 | static ByteBuf encodeFirstFragment(ByteBufAllocator allocator, int mtu, FrameType frameType, int streamId, boolean hasMetadata, ByteBuf metadata, ByteBuf data) {<NEW_LINE>// subtract the header bytes + frame length size<NEW_LINE>int remaining = mtu - FRAME_OFFSET;<NEW_LINE>ByteBuf metadataFragment = hasMetadata ? Unpooled.EMPTY_BUFFER : null;<NEW_LINE>if (hasMetadata) {<NEW_LINE>// subtract the metadata frame length<NEW_LINE>remaining -= FrameLengthCodec.FRAME_LENGTH_SIZE;<NEW_LINE>if (metadata.isReadable()) {<NEW_LINE>int r = Math.min(remaining, metadata.readableBytes());<NEW_LINE>remaining -= r;<NEW_LINE>metadataFragment = metadata.readRetainedSlice(r);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ByteBuf dataFragment = Unpooled.EMPTY_BUFFER;<NEW_LINE>try {<NEW_LINE>if (remaining > 0 && data.isReadable()) {<NEW_LINE>int r = Math.min(remaining, data.readableBytes());<NEW_LINE>dataFragment = data.readRetainedSlice(r);<NEW_LINE>}<NEW_LINE>} catch (IllegalReferenceCountException | NullPointerException e) {<NEW_LINE>if (metadataFragment != null) {<NEW_LINE>metadataFragment.release();<NEW_LINE>}<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>switch(frameType) {<NEW_LINE>case REQUEST_FNF:<NEW_LINE>return RequestFireAndForgetFrameCodec.encode(allocator, streamId, true, metadataFragment, dataFragment);<NEW_LINE>case REQUEST_RESPONSE:<NEW_LINE>return RequestResponseFrameCodec.encode(allocator, streamId, true, metadataFragment, dataFragment);<NEW_LINE>// Payload and synthetic types from the responder side<NEW_LINE>case PAYLOAD:<NEW_LINE>return PayloadFrameCodec.encode(allocator, streamId, true, false, false, metadataFragment, dataFragment);<NEW_LINE>case NEXT:<NEW_LINE>// see https://github.com/rsocket/rsocket/blob/master/Protocol.md#handling-the-unexpected<NEW_LINE>// point 7<NEW_LINE>case NEXT_COMPLETE:<NEW_LINE>return PayloadFrameCodec.encode(allocator, streamId, true, false, true, metadataFragment, dataFragment);<NEW_LINE>default:<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | throw new IllegalStateException("unsupported fragment type: " + frameType); |
613,260 | // CSI: Sponge<NEW_LINE>private void checkFingerprint() {<NEW_LINE>final Certificate[] certificates = this.getClass().getProtectionDomain().getCodeSource().getCertificates();<NEW_LINE>final List<String> <MASK><NEW_LINE>if (((Boolean) Launch.blackboard.getOrDefault("fml.deobfuscatedEnvironment", false))) {<NEW_LINE>SpongeImpl.getLogger().debug("Skipping certificate fingerprint check - we're in a deobfuscated environment");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!EXPECTED_CERTIFICATE_FINGERPRINT.isEmpty()) {<NEW_LINE>if (!fingerprints.contains(EXPECTED_CERTIFICATE_FINGERPRINT)) {<NEW_LINE>final PrettyPrinter pp = new PrettyPrinter(60).wrapTo(60);<NEW_LINE>pp.add("Uh oh! Something's fishy here.").centre().hr();<NEW_LINE>pp.addWrapped("It looks like we didn't find the certificate fingerprint we were expecting.");<NEW_LINE>pp.add();<NEW_LINE>pp.add("%s: %s", "Expected Fingerprint", EXPECTED_CERTIFICATE_FINGERPRINT);<NEW_LINE>if (fingerprints.size() > 1) {<NEW_LINE>pp.add("Actual Fingerprints:");<NEW_LINE>for (final String fingerprint : fingerprints) {<NEW_LINE>pp.add(" - %s", fingerprint);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>pp.add("%s: %s", "Actual Fingerprint", fingerprints.get(0));<NEW_LINE>}<NEW_LINE>pp.log(SpongeImpl.getLogger(), Level.ERROR);<NEW_LINE>} else {<NEW_LINE>this.certificate = certificates[fingerprints.indexOf(EXPECTED_CERTIFICATE_FINGERPRINT)];<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>SpongeImpl.getLogger().warn("There's no certificate fingerprint available");<NEW_LINE>}<NEW_LINE>} | fingerprints = CertificateHelper.getFingerprints(certificates); |
131,214 | private ValueFetcher createFetcher(BlockValSet blockValSet) {<NEW_LINE>DataType storedType = blockValSet.getValueType().getStoredType();<NEW_LINE>if (blockValSet.isSingleValue()) {<NEW_LINE>switch(storedType) {<NEW_LINE>case INT:<NEW_LINE>return new IntSingleValueFetcher(blockValSet.getIntValuesSV());<NEW_LINE>case LONG:<NEW_LINE>return new LongSingleValueFetcher(blockValSet.getLongValuesSV());<NEW_LINE>case FLOAT:<NEW_LINE>return new FloatSingleValueFetcher(blockValSet.getFloatValuesSV());<NEW_LINE>case DOUBLE:<NEW_LINE>return new DoubleSingleValueFetcher(blockValSet.getDoubleValuesSV());<NEW_LINE>case STRING:<NEW_LINE>return new StringSingleValueFetcher(blockValSet.getStringValuesSV());<NEW_LINE>case BYTES:<NEW_LINE>return new BytesValueFetcher(blockValSet.getBytesValuesSV());<NEW_LINE>default:<NEW_LINE>throw new IllegalStateException("Unsupported value type: " + storedType + " for single-value column");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>switch(storedType) {<NEW_LINE>case INT:<NEW_LINE>return new IntMultiValueFetcher(blockValSet.getIntValuesMV());<NEW_LINE>case LONG:<NEW_LINE>return new LongMultiValueFetcher(blockValSet.getLongValuesMV());<NEW_LINE>case FLOAT:<NEW_LINE>return new <MASK><NEW_LINE>case DOUBLE:<NEW_LINE>return new DoubleMultiValueFetcher(blockValSet.getDoubleValuesMV());<NEW_LINE>case STRING:<NEW_LINE>return new StringMultiValueFetcher(blockValSet.getStringValuesMV());<NEW_LINE>default:<NEW_LINE>throw new IllegalStateException("Unsupported value type: " + storedType + " for multi-value column");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | FloatMultiValueFetcher(blockValSet.getFloatValuesMV()); |
443,268 | private InMemoryPrivateKey createBip32WebsitePrivateKey(byte[] masterSeed, int accountIndex, String site) {<NEW_LINE>// Create BIP32 root node<NEW_LINE>HdKeyNode rootNode = HdKeyNode.fromSeed(masterSeed, null);<NEW_LINE>// Create bit id node<NEW_LINE>HdKeyNode <MASK><NEW_LINE>// Create the private key for the specified account<NEW_LINE>InMemoryPrivateKey accountPriv = bidNode.createChildPrivateKey(accountIndex);<NEW_LINE>// Concatenate the private key bytes with the site name<NEW_LINE>byte[] sitePrivateKeySeed;<NEW_LINE>sitePrivateKeySeed = BitUtils.concatenate(accountPriv.getPrivateKeyBytes(), site.getBytes(StandardCharsets.UTF_8));<NEW_LINE>// Hash the seed and create a new private key from that which uses compressed public keys<NEW_LINE>byte[] sitePrivateKeyBytes = HashUtils.doubleSha256(sitePrivateKeySeed).getBytes();<NEW_LINE>return new InMemoryPrivateKey(sitePrivateKeyBytes, true);<NEW_LINE>} | bidNode = rootNode.createChildNode(BIP32_ROOT_AUTHENTICATION_INDEX); |
1,252,184 | public void propagate(InstanceState state) {<NEW_LINE>// get attributes<NEW_LINE>final var dataWidth = state.getAttributeValue(StdAttr.FP_WIDTH);<NEW_LINE>// compute outputs<NEW_LINE>final var a = state.getPortValue(IN0);<NEW_LINE>final var b = state.getPortValue(IN1);<NEW_LINE>final var a_val = dataWidth.getWidth() == 64 ? a.toDoubleValue() : a.toFloatValue();<NEW_LINE>final var b_val = dataWidth.getWidth() == 64 ? b.toDoubleValue() : b.toFloatValue();<NEW_LINE>// propagate them<NEW_LINE>final var delay = (dataWidth.getWidth() + 2) * PER_DELAY;<NEW_LINE>state.setPort(GT, Value.createKnown(1, a_val > b_val ? 1 : 0), delay);<NEW_LINE>state.setPort(EQ, Value.createKnown(1, a_val == b_val <MASK><NEW_LINE>state.setPort(LT, Value.createKnown(1, a_val < b_val ? 1 : 0), delay);<NEW_LINE>state.setPort(ERR, Value.createKnown(1, (Double.isNaN(a_val) || Double.isNaN(b_val)) ? 1 : 0), delay);<NEW_LINE>} | ? 1 : 0), delay); |
490,521 | public static ArrayList<ReminderEntry> readRemindersFromBundle(Bundle bundle) {<NEW_LINE>ArrayList<ReminderEntry> reminders = null;<NEW_LINE>ArrayList<Integer> reminderMinutes = bundle.getIntegerArrayList(EventInfoFragment.BUNDLE_KEY_REMINDER_MINUTES);<NEW_LINE>ArrayList<Integer> reminderMethods = <MASK><NEW_LINE>if (reminderMinutes == null || reminderMethods == null) {<NEW_LINE>if (reminderMinutes != null || reminderMethods != null) {<NEW_LINE>String nullList = (reminderMinutes == null ? "reminderMinutes" : "reminderMethods");<NEW_LINE>Log.d(TAG, String.format("Error resolving reminders: %s was null", nullList));<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>int numReminders = reminderMinutes.size();<NEW_LINE>if (numReminders == reminderMethods.size()) {<NEW_LINE>// Only if the size of the reminder minutes we've read in is<NEW_LINE>// the same as the size of the reminder methods. Otherwise,<NEW_LINE>// something went wrong with bundling them.<NEW_LINE>reminders = new ArrayList<ReminderEntry>(numReminders);<NEW_LINE>for (int reminder_i = 0; reminder_i < numReminders; reminder_i++) {<NEW_LINE>int minutes = reminderMinutes.get(reminder_i);<NEW_LINE>int method = reminderMethods.get(reminder_i);<NEW_LINE>reminders.add(ReminderEntry.valueOf(minutes, method));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>Log.d(TAG, String.format("Error resolving reminders." + " Found %d reminderMinutes, but %d reminderMethods.", numReminders, reminderMethods.size()));<NEW_LINE>}<NEW_LINE>return reminders;<NEW_LINE>} | bundle.getIntegerArrayList(EventInfoFragment.BUNDLE_KEY_REMINDER_METHODS); |
1,546,290 | private void buildClassInfo() {<NEW_LINE>String internalSuperName = ASMToolkit.getInternalName(Event.class.getName());<NEW_LINE>String internalClassName = type.getInternalName();<NEW_LINE>classWriter.visit(52, Opcodes.ACC_PUBLIC + Opcodes.ACC_FINAL + Opcodes.ACC_SUPER, internalClassName, null, internalSuperName, null);<NEW_LINE>for (AnnotationElement a : annotationElements) {<NEW_LINE>String descriptor = ASMToolkit.getDescriptor(a.getTypeName());<NEW_LINE>AnnotationVisitor av = classWriter.visitAnnotation(descriptor, true);<NEW_LINE>for (ValueDescriptor v : a.getValueDescriptors()) {<NEW_LINE>Object value = a.getValue(v.getName());<NEW_LINE>String name = v.getName();<NEW_LINE>if (v.isArray()) {<NEW_LINE>AnnotationVisitor arrayVisitor = av.visitArray(name);<NEW_LINE>Object[] array = (Object[]) value;<NEW_LINE>for (int i = 0; i < array.length; i++) {<NEW_LINE>arrayVisitor.visit<MASK><NEW_LINE>}<NEW_LINE>arrayVisitor.visitEnd();<NEW_LINE>} else {<NEW_LINE>av.visit(name, value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>av.visitEnd();<NEW_LINE>}<NEW_LINE>} | (null, array[i]); |
579,689 | private void bindView(View view) {<NEW_LINE>View llContent = view.findViewById(R.id.ll_content);<NEW_LINE>llContent.setOnClickListener(null);<NEW_LINE>searchView = view.findViewById(R.id.searchView);<NEW_LINE>atvTitle = view.findViewById(R.id.atv_title);<NEW_LINE>ibtStop = view.findViewById(R.id.ibt_stop);<NEW_LINE>rvSource = view.<MASK><NEW_LINE>ibtStop.setVisibility(View.INVISIBLE);<NEW_LINE>rvSource.addItemDecoration(new DividerItemDecoration(context, LinearLayout.VERTICAL));<NEW_LINE>rvSource.setBaseRefreshListener(this::reSearchBook);<NEW_LINE>ibtStop.setOnClickListener(v -> stopChangeSource());<NEW_LINE>searchView.onActionViewExpanded();<NEW_LINE>searchView.clearFocus();<NEW_LINE>searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean onQueryTextSubmit(String query) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean onQueryTextChange(String newText) {<NEW_LINE>if (StringUtils.isTrimEmpty(newText)) {<NEW_LINE>List<SearchBookBean> searchBookBeans = DbHelper.getDaoSession().getSearchBookBeanDao().queryBuilder().where(SearchBookBeanDao.Properties.Name.eq(bookName), SearchBookBeanDao.Properties.Author.eq(bookAuthor)).build().list();<NEW_LINE>adapter.reSetSourceAdapter();<NEW_LINE>adapter.addAllSourceAdapter(searchBookBeans);<NEW_LINE>} else {<NEW_LINE>List<SearchBookBean> searchBookBeans = DbHelper.getDaoSession().getSearchBookBeanDao().queryBuilder().where(SearchBookBeanDao.Properties.Name.eq(bookName), SearchBookBeanDao.Properties.Author.eq(bookAuthor), SearchBookBeanDao.Properties.Origin.like("%" + searchView.getQuery().toString() + "%")).build().list();<NEW_LINE>adapter.reSetSourceAdapter();<NEW_LINE>adapter.addAllSourceAdapter(searchBookBeans);<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | findViewById(R.id.rf_rv_change_source); |
301,686 | private Operation calculateNewDefaultOperation(long lastTimestamp) {<NEW_LINE>if (localTransferFile == null || remoteTransferFile == null) {<NEW_LINE>if (localTransferFile == null) {<NEW_LINE>return new RemoteTimestamp(remoteTransferFile.getTimestamp()).newerThan(lastTimestamp) ? Operation.DOWNLOAD : Operation.DELETE;<NEW_LINE>}<NEW_LINE>return localTransferFile.getTimestamp() > lastTimestamp ? Operation.UPLOAD : Operation.DELETE;<NEW_LINE>}<NEW_LINE>long localTimestamp = localTransferFile.getTimestamp();<NEW_LINE>RemoteTimestamp remoteTimestamp = new <MASK><NEW_LINE>long localSize = localTransferFile.getSize();<NEW_LINE>long remoteSize = remoteTransferFile.getSize();<NEW_LINE>if (remoteTimestamp.equalsTo(localTimestamp) && localSize == remoteSize) {<NEW_LINE>// simply equal files<NEW_LINE>return Operation.NOOP;<NEW_LINE>}<NEW_LINE>if (localTimestamp <= lastTimestamp && remoteTimestamp.equalsOrOlderThan(lastTimestamp) && localSize == remoteSize) {<NEW_LINE>// already synchronized<NEW_LINE>return Operation.NOOP;<NEW_LINE>}<NEW_LINE>if (localTimestamp > lastTimestamp && remoteTimestamp.newerThan(lastTimestamp)) {<NEW_LINE>// both files are newer<NEW_LINE>return Operation.FILE_CONFLICT;<NEW_LINE>}<NEW_LINE>// only one file is newer<NEW_LINE>if (remoteTimestamp.newerThan(localTimestamp)) {<NEW_LINE>return Operation.DOWNLOAD;<NEW_LINE>}<NEW_LINE>return Operation.UPLOAD;<NEW_LINE>} | RemoteTimestamp(remoteTransferFile.getTimestamp()); |
449,247 | public void run() {<NEW_LINE>IOException exception = null;<NEW_LINE>// Note that we do not need socketFinder lock here<NEW_LINE>// as we update nothing in socketFinder based on the condition.<NEW_LINE>// So, its perfectly fine to make a dirty read.<NEW_LINE>SocketFinder.Result result = socketFinder.getResult();<NEW_LINE>if (result.equals(SocketFinder.Result.UNKNOWN)) {<NEW_LINE>try {<NEW_LINE>if (logger.isLoggable(Level.FINER)) {<NEW_LINE>logger.finer(this.toString() + " connecting to InetSocketAddress:" + inetSocketAddress + " with timeout:" + timeoutInMilliseconds);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>} catch (IOException ex) {<NEW_LINE>if (logger.isLoggable(Level.FINER)) {<NEW_LINE>logger.finer(this.toString() + " exception:" + ex.getClass() + " with message:" + ex.getMessage() + " occurred while connecting to InetSocketAddress:" + inetSocketAddress);<NEW_LINE>}<NEW_LINE>exception = ex;<NEW_LINE>}<NEW_LINE>socketFinder.updateResult(socket, exception, this.toString());<NEW_LINE>}<NEW_LINE>} | socket.connect(inetSocketAddress, timeoutInMilliseconds); |
381,878 | private void ensureArrayCreated(CtReference reference) {<NEW_LINE>// Create memory array for the reference if it does not exist<NEW_LINE>if (memoryMap.get(reference) == null) {<NEW_LINE>ArrayExpr memoryArray;<NEW_LINE>ArraySort sort;<NEW_LINE>if (reference instanceof CtArrayTypeReference) {<NEW_LINE>ArraySort arraySort = context.mkArraySort(context.mkBitVecSort(32), getTypeSort(context, ((CtArrayTypeReference) reference).getComponentType()));<NEW_LINE>sort = context.mkArraySort(context.mkIntSort(), arraySort);<NEW_LINE>} else {<NEW_LINE>CtTypeReference typeReference = reference instanceof CtVariableReference ? ((CtVariableReference) reference).getType() : (CtTypeReference) reference;<NEW_LINE>sort = context.mkArraySort(context.getIntSort()<MASK><NEW_LINE>}<NEW_LINE>memoryArray = (ArrayExpr) context.mkFreshConst(reference + "_memo_array_", sort);<NEW_LINE>memoryMap.put(reference, memoryArray);<NEW_LINE>}<NEW_LINE>} | , getTypeSort(context, typeReference)); |
1,829,620 | public static String MakePrettyDate(String getCreatedTime) {<NEW_LINE>SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd'T'hh:mm:ssZ", Locale.US);<NEW_LINE>ParsePosition pos = new ParsePosition(0);<NEW_LINE>long then = formatter.parse(getCreatedTime, pos).getTime();<NEW_LINE>long now = <MASK><NEW_LINE>long seconds = (now - then) / 1000;<NEW_LINE>long minutes = seconds / 60;<NEW_LINE>long hours = minutes / 60;<NEW_LINE>long days = hours / 24;<NEW_LINE>String friendly = null;<NEW_LINE>long num = 0;<NEW_LINE>if (days > 0) {<NEW_LINE>num = days;<NEW_LINE>friendly = days + " day";<NEW_LINE>} else if (hours > 0) {<NEW_LINE>num = hours;<NEW_LINE>friendly = hours + " hour";<NEW_LINE>} else if (minutes > 0) {<NEW_LINE>num = minutes;<NEW_LINE>friendly = minutes + " minute";<NEW_LINE>} else {<NEW_LINE>num = seconds;<NEW_LINE>friendly = seconds + " second";<NEW_LINE>}<NEW_LINE>if (num > 1) {<NEW_LINE>friendly += "s";<NEW_LINE>}<NEW_LINE>String postTimeStamp = friendly + " ago";<NEW_LINE>return postTimeStamp;<NEW_LINE>} | new Date().getTime(); |
336,207 | public void write(org.apache.thrift.protocol.TProtocol prot, grantNamespacePermission_args struct) throws org.apache.thrift.TException {<NEW_LINE>org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache<MASK><NEW_LINE>java.util.BitSet optionals = new java.util.BitSet();<NEW_LINE>if (struct.isSetTinfo()) {<NEW_LINE>optionals.set(0);<NEW_LINE>}<NEW_LINE>if (struct.isSetCredentials()) {<NEW_LINE>optionals.set(1);<NEW_LINE>}<NEW_LINE>if (struct.isSetPrincipal()) {<NEW_LINE>optionals.set(2);<NEW_LINE>}<NEW_LINE>if (struct.isSetNs()) {<NEW_LINE>optionals.set(3);<NEW_LINE>}<NEW_LINE>if (struct.isSetPermission()) {<NEW_LINE>optionals.set(4);<NEW_LINE>}<NEW_LINE>oprot.writeBitSet(optionals, 5);<NEW_LINE>if (struct.isSetTinfo()) {<NEW_LINE>struct.tinfo.write(oprot);<NEW_LINE>}<NEW_LINE>if (struct.isSetCredentials()) {<NEW_LINE>struct.credentials.write(oprot);<NEW_LINE>}<NEW_LINE>if (struct.isSetPrincipal()) {<NEW_LINE>oprot.writeString(struct.principal);<NEW_LINE>}<NEW_LINE>if (struct.isSetNs()) {<NEW_LINE>oprot.writeString(struct.ns);<NEW_LINE>}<NEW_LINE>if (struct.isSetPermission()) {<NEW_LINE>oprot.writeByte(struct.permission);<NEW_LINE>}<NEW_LINE>} | .thrift.protocol.TTupleProtocol) prot; |
324,624 | public static <T> T deserialize(String json, Class<T> cls, JsonPathConfig jsonPathConfig) {<NEW_LINE>Validate.notNull(jsonPathConfig, "JsonPath configuration wasn't specified, cannot deserialize.");<NEW_LINE><MASK><NEW_LINE>DataToDeserialize dataToDeserialize = new DataToDeserialize() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String asString() {<NEW_LINE>return json;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public byte[] asByteArray() {<NEW_LINE>try {<NEW_LINE>return json.getBytes(jsonPathConfig.charset());<NEW_LINE>} catch (UnsupportedEncodingException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public InputStream asInputStream() {<NEW_LINE>return new ByteArrayInputStream(asByteArray());<NEW_LINE>}<NEW_LINE>};<NEW_LINE>ObjectDeserializationContext deserializationCtx = new ObjectDeserializationContextImpl(dataToDeserialize, cls, jsonPathConfig.charset());<NEW_LINE>if (jsonPathConfig.hasDefaultDeserializer()) {<NEW_LINE>return jsonPathConfig.defaultDeserializer().deserialize(deserializationCtx);<NEW_LINE>} else if (mapperType != null || jsonPathConfig.hasDefaultParserType()) {<NEW_LINE>JsonParserType mapperTypeToUse = mapperType == null ? jsonPathConfig.defaultParserType() : mapperType;<NEW_LINE>return deserializeWithObjectMapper(deserializationCtx, mapperTypeToUse, jsonPathConfig);<NEW_LINE>}<NEW_LINE>if (ObjectMapperResolver.isJackson2InClassPath()) {<NEW_LINE>return (T) deserializeWithJackson2(deserializationCtx, jsonPathConfig.jackson2ObjectMapperFactory());<NEW_LINE>} else if (ObjectMapperResolver.isJackson1InClassPath()) {<NEW_LINE>return (T) deserializeWithJackson1(deserializationCtx, jsonPathConfig.jackson1ObjectMapperFactory());<NEW_LINE>} else if (ObjectMapperResolver.isGsonInClassPath()) {<NEW_LINE>return (T) deserializeWithGson(deserializationCtx, jsonPathConfig.gsonObjectMapperFactory());<NEW_LINE>} else if (ObjectMapperResolver.isJohnzonInClassPath()) {<NEW_LINE>return (T) deserializeWithJohnzon(deserializationCtx, jsonPathConfig.johnzonObjectMapperFactory());<NEW_LINE>} else if (ObjectMapperResolver.isYassonInClassPath()) {<NEW_LINE>return (T) deserializeWithJsonb(deserializationCtx, jsonPathConfig.jsonbObjectMapperFactory());<NEW_LINE>}<NEW_LINE>throw new IllegalStateException("Cannot deserialize object because no JSON deserializer found in classpath. Please put Jackson (Databind), Gson, Jackson, or Yasson in the classpath.");<NEW_LINE>} | JsonParserType mapperType = jsonPathConfig.defaultParserType(); |
1,572,468 | private DonutChartModel initDonutModel() {<NEW_LINE>DonutChartModel model = new DonutChartModel();<NEW_LINE>Map<String, Number> circle1 = new LinkedHashMap<String, Number>();<NEW_LINE>circle1.put("Brand 1", 150);<NEW_LINE><MASK><NEW_LINE>circle1.put("Brand 3", 200);<NEW_LINE>circle1.put("Brand 4", 10);<NEW_LINE>model.addCircle(circle1);<NEW_LINE>Map<String, Number> circle2 = new LinkedHashMap<String, Number>();<NEW_LINE>circle2.put("Brand 1", 540);<NEW_LINE>circle2.put("Brand 2", 125);<NEW_LINE>circle2.put("Brand 3", 702);<NEW_LINE>circle2.put("Brand 4", 421);<NEW_LINE>model.addCircle(circle2);<NEW_LINE>Map<String, Number> circle3 = new LinkedHashMap<String, Number>();<NEW_LINE>circle3.put("Brand 1", 40);<NEW_LINE>circle3.put("Brand 2", 325);<NEW_LINE>circle3.put("Brand 3", 402);<NEW_LINE>circle3.put("Brand 4", 421);<NEW_LINE>model.addCircle(circle3);<NEW_LINE>return model;<NEW_LINE>} | circle1.put("Brand 2", 400); |
1,095,797 | public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {<NEW_LINE>if (!(c instanceof AbstractButton) || UIUtil.isHelpButton(c))<NEW_LINE>return;<NEW_LINE>Graphics2D g2 = (Graphics2D) g.create();<NEW_LINE>AbstractButton b = (AbstractButton) c;<NEW_LINE>Rectangle outerRect = new Rectangle(x, y, width, height);<NEW_LINE>try {<NEW_LINE>JBInsets.removeFrom(outerRect, b.getInsets());<NEW_LINE>g2.setRenderingHint(<MASK><NEW_LINE>g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_NORMALIZE);<NEW_LINE>Path2D border = new Path2D.Float(Path2D.WIND_EVEN_ODD);<NEW_LINE>border.append(outerRect, false);<NEW_LINE>Rectangle innerRect = new Rectangle(outerRect);<NEW_LINE>JBInsets.removeFrom(innerRect, JBUI.insets(getBorderWidth(b)));<NEW_LINE>border.append(innerRect, false);<NEW_LINE>g2.setColor(getBorderColor(b));<NEW_LINE>if (!c.isEnabled()) {<NEW_LINE>g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, DISABLED_ALPHA_LEVEL));<NEW_LINE>}<NEW_LINE>g2.fill(border);<NEW_LINE>} finally {<NEW_LINE>g2.dispose();<NEW_LINE>}<NEW_LINE>} | RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); |
956,021 | private PointSensitivityBuilder rateForwardSensitivity(OvernightAveragedRateComputation computation, OvernightIndexRates rates) {<NEW_LINE>OvernightIndex index = computation.getIndex();<NEW_LINE>HolidayCalendar calendar = computation.getFixingCalendar();<NEW_LINE>LocalDate startFixingDate = computation.getStartDate();<NEW_LINE>LocalDate endFixingDateP1 = computation.getEndDate();<NEW_LINE>LocalDate endFixingDate = calendar.previous(endFixingDateP1);<NEW_LINE>LocalDate onRateEndDate = computation.calculateMaturityFromFixing(endFixingDate);<NEW_LINE>LocalDate onRateStartDate = computation.calculateEffectiveFromFixing(startFixingDate);<NEW_LINE>LocalDate lastNonCutOffMatDate = onRateEndDate;<NEW_LINE>int cutoffOffset = computation.getRateCutOffDays() > 1 ? computation.getRateCutOffDays() : 1;<NEW_LINE>PointSensitivityBuilder combinedPointSensitivityBuilder = PointSensitivityBuilder.none();<NEW_LINE>double accrualFactorTotal = index.getDayCount().yearFraction(onRateStartDate, onRateEndDate);<NEW_LINE>if (cutoffOffset > 1) {<NEW_LINE>// Cut-off period<NEW_LINE>List<Double> noCutOffAccrualFactorList = new ArrayList<>();<NEW_LINE>LocalDate currentFixingDate = endFixingDateP1;<NEW_LINE>LocalDate cutOffEffectiveDate;<NEW_LINE>for (int i = 0; i < cutoffOffset; i++) {<NEW_LINE>currentFixingDate = calendar.previous(currentFixingDate);<NEW_LINE>cutOffEffectiveDate = computation.calculateEffectiveFromFixing(currentFixingDate);<NEW_LINE><MASK><NEW_LINE>double accrualFactor = index.getDayCount().yearFraction(cutOffEffectiveDate, lastNonCutOffMatDate);<NEW_LINE>noCutOffAccrualFactorList.add(accrualFactor);<NEW_LINE>}<NEW_LINE>OvernightIndexObservation lastIndexObs = computation.observeOn(currentFixingDate);<NEW_LINE>PointSensitivityBuilder forwardRateCutOffSensitivity = rates.ratePointSensitivity(lastIndexObs);<NEW_LINE>double totalAccrualFactor = 0.0;<NEW_LINE>for (int i = 0; i < cutoffOffset - 1; i++) {<NEW_LINE>totalAccrualFactor += noCutOffAccrualFactorList.get(i);<NEW_LINE>}<NEW_LINE>forwardRateCutOffSensitivity = forwardRateCutOffSensitivity.multipliedBy(totalAccrualFactor);<NEW_LINE>combinedPointSensitivityBuilder = combinedPointSensitivityBuilder.combinedWith(forwardRateCutOffSensitivity);<NEW_LINE>}<NEW_LINE>// Approximated part<NEW_LINE>OvernightIndexObservation indexObs = computation.observeOn(onRateStartDate);<NEW_LINE>PointSensitivityBuilder approximatedInterestAndSensitivity = approximatedInterestSensitivity(indexObs, lastNonCutOffMatDate, rates);<NEW_LINE>combinedPointSensitivityBuilder = combinedPointSensitivityBuilder.combinedWith(approximatedInterestAndSensitivity);<NEW_LINE>combinedPointSensitivityBuilder = combinedPointSensitivityBuilder.multipliedBy(1.0 / accrualFactorTotal);<NEW_LINE>// final rate<NEW_LINE>return combinedPointSensitivityBuilder;<NEW_LINE>} | lastNonCutOffMatDate = computation.calculateMaturityFromEffective(cutOffEffectiveDate); |
1,318,310 | public static ListApplicationsWithTagRulesResponse unmarshall(ListApplicationsWithTagRulesResponse listApplicationsWithTagRulesResponse, UnmarshallerContext _ctx) {<NEW_LINE>listApplicationsWithTagRulesResponse.setRequestId(_ctx.stringValue("ListApplicationsWithTagRulesResponse.RequestId"));<NEW_LINE>listApplicationsWithTagRulesResponse.setHttpStatusCode(_ctx.integerValue("ListApplicationsWithTagRulesResponse.HttpStatusCode"));<NEW_LINE>listApplicationsWithTagRulesResponse.setMessage(_ctx.stringValue("ListApplicationsWithTagRulesResponse.Message"));<NEW_LINE>listApplicationsWithTagRulesResponse.setCode<MASK><NEW_LINE>listApplicationsWithTagRulesResponse.setSuccess(_ctx.booleanValue("ListApplicationsWithTagRulesResponse.Success"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setTotalSize(_ctx.integerValue("ListApplicationsWithTagRulesResponse.Data.TotalSize"));<NEW_LINE>data.setPageNumber(_ctx.integerValue("ListApplicationsWithTagRulesResponse.Data.PageNumber"));<NEW_LINE>data.setPageSize(_ctx.integerValue("ListApplicationsWithTagRulesResponse.Data.PageSize"));<NEW_LINE>List<ApplicationList> result = new ArrayList<ApplicationList>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListApplicationsWithTagRulesResponse.Data.Result.Length"); i++) {<NEW_LINE>ApplicationList applicationList = new ApplicationList();<NEW_LINE>applicationList.setAppName(_ctx.stringValue("ListApplicationsWithTagRulesResponse.Data.Result[" + i + "].AppName"));<NEW_LINE>applicationList.setAppId(_ctx.stringValue("ListApplicationsWithTagRulesResponse.Data.Result[" + i + "].AppId"));<NEW_LINE>applicationList.setRouteStatus(_ctx.longValue("ListApplicationsWithTagRulesResponse.Data.Result[" + i + "].RouteStatus"));<NEW_LINE>List<RouteRule> routeRules = new ArrayList<RouteRule>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("ListApplicationsWithTagRulesResponse.Data.Result[" + i + "].RouteRules.Length"); j++) {<NEW_LINE>RouteRule routeRule = new RouteRule();<NEW_LINE>routeRule.setStatus(_ctx.integerValue("ListApplicationsWithTagRulesResponse.Data.Result[" + i + "].RouteRules[" + j + "].Status"));<NEW_LINE>routeRule.setInstanceNum(_ctx.integerValue("ListApplicationsWithTagRulesResponse.Data.Result[" + i + "].RouteRules[" + j + "].InstanceNum"));<NEW_LINE>routeRule.setRemove(_ctx.booleanValue("ListApplicationsWithTagRulesResponse.Data.Result[" + i + "].RouteRules[" + j + "].Remove"));<NEW_LINE>routeRule.setCarryData(_ctx.booleanValue("ListApplicationsWithTagRulesResponse.Data.Result[" + i + "].RouteRules[" + j + "].CarryData"));<NEW_LINE>routeRule.setTag(_ctx.stringValue("ListApplicationsWithTagRulesResponse.Data.Result[" + i + "].RouteRules[" + j + "].Tag"));<NEW_LINE>routeRule.setName(_ctx.stringValue("ListApplicationsWithTagRulesResponse.Data.Result[" + i + "].RouteRules[" + j + "].Name"));<NEW_LINE>routeRule.setRules(_ctx.stringValue("ListApplicationsWithTagRulesResponse.Data.Result[" + i + "].RouteRules[" + j + "].Rules"));<NEW_LINE>routeRule.setId(_ctx.longValue("ListApplicationsWithTagRulesResponse.Data.Result[" + i + "].RouteRules[" + j + "].Id"));<NEW_LINE>routeRule.setRate(_ctx.integerValue("ListApplicationsWithTagRulesResponse.Data.Result[" + i + "].RouteRules[" + j + "].Rate"));<NEW_LINE>routeRule.setGmtModified(_ctx.longValue("ListApplicationsWithTagRulesResponse.Data.Result[" + i + "].RouteRules[" + j + "].GmtModified"));<NEW_LINE>routeRule.setEnable(_ctx.booleanValue("ListApplicationsWithTagRulesResponse.Data.Result[" + i + "].RouteRules[" + j + "].Enable"));<NEW_LINE>routeRules.add(routeRule);<NEW_LINE>}<NEW_LINE>applicationList.setRouteRules(routeRules);<NEW_LINE>result.add(applicationList);<NEW_LINE>}<NEW_LINE>data.setResult(result);<NEW_LINE>listApplicationsWithTagRulesResponse.setData(data);<NEW_LINE>return listApplicationsWithTagRulesResponse;<NEW_LINE>} | (_ctx.integerValue("ListApplicationsWithTagRulesResponse.Code")); |
1,307,416 | private static Collection<Collection<Net.Pin>> create_ordered_subnets(Collection<Net.Pin> p_pin_list) {<NEW_LINE>Collection<Collection<Net.Pin>> result = new LinkedList<Collection<Net.Pin>>();<NEW_LINE>if (p_pin_list.isEmpty()) {<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>Iterator<Net.Pin> it = p_pin_list.iterator();<NEW_LINE>Net.Pin prev_pin = it.next();<NEW_LINE>while (it.hasNext()) {<NEW_LINE>Net.<MASK><NEW_LINE>Set<Net.Pin> curr_subnet_pin_list = new java.util.TreeSet<Net.Pin>();<NEW_LINE>curr_subnet_pin_list.add(prev_pin);<NEW_LINE>curr_subnet_pin_list.add(next_pin);<NEW_LINE>result.add(curr_subnet_pin_list);<NEW_LINE>prev_pin = next_pin;<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | Pin next_pin = it.next(); |
7,511 | private void internalReadEntryFailed(ManagedLedgerException exception, Object ctx) {<NEW_LINE>PendingReadEntryRequest pendingReadEntryRequest = (PendingReadEntryRequest) ctx;<NEW_LINE>PositionImpl readPosition = pendingReadEntryRequest.position;<NEW_LINE>pendingReadEntryRequest.retry++;<NEW_LINE>long waitTimeMillis = readFailureBackoff.next();<NEW_LINE>if (exception.getCause() instanceof TransactionBufferException.TransactionNotSealedException) {<NEW_LINE>waitTimeMillis = 1;<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("[{}] Error reading transaction entries : {}, - Retrying to read in {} seconds", cursor.getName(), exception.getMessage(), waitTimeMillis / 1000.0);<NEW_LINE>}<NEW_LINE>} else if (!(exception instanceof ManagedLedgerException.TooManyRequestsException)) {<NEW_LINE>log.error("[{} Error reading entries at {} : {} - Retrying to read in {} seconds", cursor.getName(), readPosition, exception.<MASK><NEW_LINE>} else {<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("[{}] Got throttled by bookies while reading at {} : {} - Retrying to read in {} seconds", cursor.getName(), readPosition, exception.getMessage(), waitTimeMillis / 1000.0);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!issuedReads.isEmpty()) {<NEW_LINE>if (issuedReads.peek().retry > maxRetry) {<NEW_LINE>cancelReadRequests(issuedReads.peek().position);<NEW_LINE>dispatcher.canReadMoreEntries(true);<NEW_LINE>STATE_UPDATER.set(this, State.Completed);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (pendingReadEntryRequest.retry <= maxRetry) {<NEW_LINE>retryReadRequest(pendingReadEntryRequest, waitTimeMillis);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | getMessage(), waitTimeMillis / 1000.0); |
1,713,659 | /*<NEW_LINE>* (non-Javadoc)<NEW_LINE>* @see com.fasterxml.jackson.databind.ser.std.StdSerializer#serialize(java.lang.Object, com.fasterxml.jackson.core.JsonGenerator, com.fasterxml.jackson.databind.SerializerProvider)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>@SuppressWarnings("null")<NEW_LINE>public void serialize(CollectionModel<?> value, JsonGenerator jgen, SerializerProvider provider) throws IOException {<NEW_LINE>//<NEW_LINE>CollectionJson<Object> //<NEW_LINE>collectionJson = //<NEW_LINE>new CollectionJson<>().//<NEW_LINE>withVersion(//<NEW_LINE>"1.0").//<NEW_LINE>withHref(//<NEW_LINE>value.getRequiredLink(IanaLinkRelations.SELF).getHref()).//<NEW_LINE>withLinks(//<NEW_LINE>value.getLinks().without(IanaLinkRelations.SELF)).//<NEW_LINE>withItems(//<NEW_LINE>resourcesToCollectionJsonItems(value)).//<NEW_LINE>withQueries(findQueries(value)).withTemplate(findTemplate(value));<NEW_LINE>CollectionJsonDocument<?> doc = new CollectionJsonDocument<>(collectionJson);<NEW_LINE>//<NEW_LINE>provider.findValueSerializer(CollectionJsonDocument.class).<MASK><NEW_LINE>} | serialize(doc, jgen, provider); |
1,484,855 | public Result build(List<String> args, String nativeImageName, String resultingExecutableName, Path outputDir, boolean debugSymbolsEnabled, boolean processInheritIODisabled) throws InterruptedException, IOException {<NEW_LINE>preBuild(args);<NEW_LINE>try {<NEW_LINE>CountDownLatch errorReportLatch = new CountDownLatch(1);<NEW_LINE>final String[] buildCommand = getBuildCommand(args);<NEW_LINE>final ProcessBuilder processBuilder = new ProcessBuilder(buildCommand).directory(outputDir.toFile());<NEW_LINE>log.info(String.join(" ", buildCommand).replace("$", "\\$"));<NEW_LINE>final Process process = ProcessUtil.launchProcessStreamStdOut(processBuilder, processInheritIODisabled);<NEW_LINE>addShutdownHook(process);<NEW_LINE>ExecutorService executor = Executors.newSingleThreadExecutor();<NEW_LINE>executor.submit(new ErrorReplacingProcessReader(process.getErrorStream(), outputDir.resolve("reports").toFile(), errorReportLatch));<NEW_LINE>executor.shutdown();<NEW_LINE>errorReportLatch.await();<NEW_LINE>int exitCode = process.waitFor();<NEW_LINE>boolean objcopyExists = objcopyExists();<NEW_LINE>if (exitCode != 0) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (objcopyExists) {<NEW_LINE>if (debugSymbolsEnabled) {<NEW_LINE>splitDebugSymbols(nativeImageName, resultingExecutableName);<NEW_LINE>} else {<NEW_LINE>// Strip debug symbols regardless, because the underlying JDK might contain them<NEW_LINE>objcopy("--strip-debug", resultingExecutableName);<NEW_LINE>}<NEW_LINE>} else if (SystemUtils.IS_OS_LINUX) {<NEW_LINE>log.warn("objcopy executable not found in PATH. Debug symbols will therefore not be separated from the executable.");<NEW_LINE>log.warn("That also means that resulting native executable is larger as it embeds the debug symbols.");<NEW_LINE>}<NEW_LINE>return new Result(0, objcopyExists);<NEW_LINE>} finally {<NEW_LINE>postBuild();<NEW_LINE>}<NEW_LINE>} | return new Result(exitCode, objcopyExists); |
1,472,530 | static ErrorProneAnalyzer createAnalyzer(ScannerSupplier scannerSupplier, ErrorProneOptions epOptions, Context context, RefactoringCollection[] refactoringCollection) {<NEW_LINE>if (!epOptions.patchingOptions().doRefactor()) {<NEW_LINE>return ErrorProneAnalyzer.createByScanningForPlugins(scannerSupplier, epOptions, context);<NEW_LINE>}<NEW_LINE>refactoringCollection[0] = RefactoringCollection.refactor(epOptions.patchingOptions(), context);<NEW_LINE>// Refaster refactorer or using builtin checks<NEW_LINE>CodeTransformer codeTransformer = epOptions.patchingOptions().customRefactorer().or(() -> {<NEW_LINE>ScannerSupplier toUse = ErrorPronePlugins.loadPlugins(scannerSupplier, context).applyOverrides(epOptions);<NEW_LINE>ImmutableSet<String> namedCheckers = epOptions.patchingOptions().namedCheckers();<NEW_LINE>if (!namedCheckers.isEmpty()) {<NEW_LINE>toUse = toUse.filter(bci -> namedCheckers.contains(bci.canonicalName()));<NEW_LINE>}<NEW_LINE>return ErrorProneScannerTransformer.<MASK><NEW_LINE>}).get();<NEW_LINE>return ErrorProneAnalyzer.createWithCustomDescriptionListener(codeTransformer, epOptions, context, refactoringCollection[0]);<NEW_LINE>} | create(toUse.get()); |
1,725,085 | public static DescribeLaunchTemplatesResponse unmarshall(DescribeLaunchTemplatesResponse describeLaunchTemplatesResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeLaunchTemplatesResponse.setRequestId(_ctx.stringValue("DescribeLaunchTemplatesResponse.RequestId"));<NEW_LINE>describeLaunchTemplatesResponse.setPageSize(_ctx.integerValue("DescribeLaunchTemplatesResponse.PageSize"));<NEW_LINE>describeLaunchTemplatesResponse.setPageNumber(_ctx.integerValue("DescribeLaunchTemplatesResponse.PageNumber"));<NEW_LINE>describeLaunchTemplatesResponse.setTotalCount(_ctx.integerValue("DescribeLaunchTemplatesResponse.TotalCount"));<NEW_LINE>List<LaunchTemplateSet> launchTemplateSets = new ArrayList<LaunchTemplateSet>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeLaunchTemplatesResponse.LaunchTemplateSets.Length"); i++) {<NEW_LINE>LaunchTemplateSet launchTemplateSet = new LaunchTemplateSet();<NEW_LINE>launchTemplateSet.setLaunchTemplateName(_ctx.stringValue("DescribeLaunchTemplatesResponse.LaunchTemplateSets[" + i + "].LaunchTemplateName"));<NEW_LINE>launchTemplateSet.setDefaultVersionNumber(_ctx.longValue<MASK><NEW_LINE>launchTemplateSet.setModifiedTime(_ctx.stringValue("DescribeLaunchTemplatesResponse.LaunchTemplateSets[" + i + "].ModifiedTime"));<NEW_LINE>launchTemplateSet.setLaunchTemplateId(_ctx.stringValue("DescribeLaunchTemplatesResponse.LaunchTemplateSets[" + i + "].LaunchTemplateId"));<NEW_LINE>launchTemplateSet.setCreateTime(_ctx.stringValue("DescribeLaunchTemplatesResponse.LaunchTemplateSets[" + i + "].CreateTime"));<NEW_LINE>launchTemplateSet.setResourceGroupId(_ctx.stringValue("DescribeLaunchTemplatesResponse.LaunchTemplateSets[" + i + "].ResourceGroupId"));<NEW_LINE>launchTemplateSet.setCreatedBy(_ctx.stringValue("DescribeLaunchTemplatesResponse.LaunchTemplateSets[" + i + "].CreatedBy"));<NEW_LINE>launchTemplateSet.setLatestVersionNumber(_ctx.longValue("DescribeLaunchTemplatesResponse.LaunchTemplateSets[" + i + "].LatestVersionNumber"));<NEW_LINE>List<Tag> tags = new ArrayList<Tag>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeLaunchTemplatesResponse.LaunchTemplateSets[" + i + "].Tags.Length"); j++) {<NEW_LINE>Tag tag = new Tag();<NEW_LINE>tag.setTagValue(_ctx.stringValue("DescribeLaunchTemplatesResponse.LaunchTemplateSets[" + i + "].Tags[" + j + "].TagValue"));<NEW_LINE>tag.setTagKey(_ctx.stringValue("DescribeLaunchTemplatesResponse.LaunchTemplateSets[" + i + "].Tags[" + j + "].TagKey"));<NEW_LINE>tags.add(tag);<NEW_LINE>}<NEW_LINE>launchTemplateSet.setTags(tags);<NEW_LINE>launchTemplateSets.add(launchTemplateSet);<NEW_LINE>}<NEW_LINE>describeLaunchTemplatesResponse.setLaunchTemplateSets(launchTemplateSets);<NEW_LINE>return describeLaunchTemplatesResponse;<NEW_LINE>} | ("DescribeLaunchTemplatesResponse.LaunchTemplateSets[" + i + "].DefaultVersionNumber")); |
1,232,370 | private void handleLocalDevice(Node deviceNode) {<NEW_LINE>BeanDefinitionBuilder deviceConfigBuilder = createBeanBuilder(LocalDeviceConfig.class);<NEW_LINE>AbstractBeanDefinition beanDefinition = deviceConfigBuilder.getBeanDefinition();<NEW_LINE>Node attName = deviceNode.getAttributes().getNamedItem("name");<NEW_LINE>String deviceName = getTextContent(attName);<NEW_LINE>deviceConfigBuilder.addPropertyValue("name", deviceName);<NEW_LINE>fillAttributeValues(deviceNode, deviceConfigBuilder);<NEW_LINE>for (Node n : childElements(deviceNode)) {<NEW_LINE>String name = cleanNodeName(n);<NEW_LINE>if ("base-dir".equals(name)) {<NEW_LINE>deviceConfigBuilder.addPropertyValue<MASK><NEW_LINE>} else if ("capacity".equals(name)) {<NEW_LINE>handleCapacity(n, deviceConfigBuilder);<NEW_LINE>} else if ("block-size".equals(name)) {<NEW_LINE>deviceConfigBuilder.addPropertyValue("blockSize", getIntegerValue("block-size", getTextContent(n)));<NEW_LINE>} else if ("read-io-thread-count".equals(name)) {<NEW_LINE>deviceConfigBuilder.addPropertyValue("readIOThreadCount", getIntegerValue("read-io-thread-count", getTextContent(n)));<NEW_LINE>} else if ("write-io-thread-count".equals(name)) {<NEW_LINE>deviceConfigBuilder.addPropertyValue("writeIOThreadCount", getIntegerValue("write-io-thread-count", getTextContent(n)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>deviceConfigManagedMap.put(deviceName, beanDefinition);<NEW_LINE>} | ("baseDir", getTextContent(n)); |
1,599,763 | CompletableFuture<CreateKVTableResponse> checkKeyValueTableExists(KeyValueTableConfiguration configuration, long timestamp, final int startingSegmentNumber, OperationContext context) {<NEW_LINE>CompletableFuture<CreateKVTableResponse> result = new CompletableFuture<>();<NEW_LINE>final long time;<NEW_LINE>final KVTConfigurationRecord config;<NEW_LINE>final VersionedMetadata<KVTStateRecord> currentState;<NEW_LINE>synchronized (lock) {<NEW_LINE>time = creationTime.get();<NEW_LINE>config = this.configuration == null ? null : this.configuration.getObject();<NEW_LINE>currentState = this.state;<NEW_LINE>}<NEW_LINE>if (time != Long.MIN_VALUE) {<NEW_LINE>if (config != null) {<NEW_LINE>handleMetadataExists(timestamp, result, time, startingSegmentNumber, config.getKvtConfiguration(), currentState);<NEW_LINE>} else {<NEW_LINE>result.complete(new CreateKVTableResponse(CreateKVTableResponse.CreateStatus.NEW, configuration, time, startingSegmentNumber));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>result.complete(new CreateKVTableResponse(CreateKVTableResponse.CreateStatus.NEW<MASK><NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | , configuration, timestamp, startingSegmentNumber)); |
901,752 | int writeMemberAttrs(Symbol sym) {<NEW_LINE>int acount = writeFlagAttrs(sym.flags());<NEW_LINE>long flags = sym.flags();<NEW_LINE>if (source.allowGenerics() && (flags & (SYNTHETIC | BRIDGE)) != SYNTHETIC && (flags & ANONCONSTR) == 0 && (!types.isSameType(sym.type, sym.erasure(types)) || signatureGen.hasTypeVar(sym.type.getThrownTypes()))) {<NEW_LINE>// note that a local class with captured variables<NEW_LINE>// will get a signature attribute<NEW_LINE>int alenIdx = writeAttr(names.Signature);<NEW_LINE>databuf.appendChar(pool.put(<MASK><NEW_LINE>endAttr(alenIdx);<NEW_LINE>acount++;<NEW_LINE>}<NEW_LINE>acount += writeJavaAnnotations(sym.getRawAttributes());<NEW_LINE>acount += writeTypeAnnotations(sym.getRawTypeAttributes(), false);<NEW_LINE>return acount;<NEW_LINE>} | typeSig(sym.type))); |
398,336 | static void bfs(int X, int Y) {<NEW_LINE>Queue<Pair> q = new LinkedList<>();<NEW_LINE>q.add(new Pair(X, Y));<NEW_LINE>visited[X][Y] = true;<NEW_LINE>while (!q.isEmpty()) {<NEW_LINE><MASK><NEW_LINE>for (int i = 0; i < 4; i++) {<NEW_LINE>int nextx = cur.x + dx[i];<NEW_LINE>int nexty = cur.y + dy[i];<NEW_LINE>if (nextx <= 0 || nexty <= 0 || nextx > n || nexty > m)<NEW_LINE>continue;<NEW_LINE>if (visited[nextx][nexty] == true || map[nextx][nexty] == 0)<NEW_LINE>continue;<NEW_LINE>q.add(new Pair(nextx, nexty));<NEW_LINE>distance[nextx][nexty] = distance[cur.x][cur.y] + 1;<NEW_LINE>visited[nextx][nexty] = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | Pair cur = q.poll(); |
1,697,130 | public String massageExampleFilePath(final String path) {<NEW_LINE>String modifiedPath = systemToUnix(path);<NEW_LINE>// System.out.println("demo.openFile() = "+path);<NEW_LINE>URL url = null;<NEW_LINE>try {<NEW_LINE>url = new URL(modifiedPath);<NEW_LINE>if (!UtilIO.validURL(url)) {<NEW_LINE>// System.out.println(" invalid URL");<NEW_LINE>url = null;<NEW_LINE>}<NEW_LINE>} catch (MalformedURLException ignore) {<NEW_LINE>}<NEW_LINE>if (url == null) {<NEW_LINE>// System.out.println("Invalid URL");<NEW_LINE>try {<NEW_LINE>url = new File(UtilIO.pathExample(path)).toURI().toURL();<NEW_LINE>if (!UtilIO.validURL(url)) {<NEW_LINE>System.<MASK><NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return url.toString();<NEW_LINE>} catch (MalformedURLException e) {<NEW_LINE>System.err.println(e.getMessage());<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// input URL was valid, so use it directly<NEW_LINE>return modifiedPath;<NEW_LINE>// System.out.println("Valid URL using "+inputFilePath);<NEW_LINE>}<NEW_LINE>} | err.println("Can't open " + path); |
1,793,901 | public User updateUser(final UpdateUserForm updateUserForm, final User modUser, final HttpServletRequest request, Locale locale) throws DotSecurityException, DotDataException, IncorrectPasswordException {<NEW_LINE>final HttpSession session = request.getSession();<NEW_LINE>boolean validatePassword = false;<NEW_LINE>User userToSave = null;<NEW_LINE>try {<NEW_LINE>userToSave = (User) this.userAPI.loadUserById(updateUserForm.getUserId(), this.userAPI.getSystemUser(), false).clone();<NEW_LINE>userToSave.setModified(false);<NEW_LINE>userToSave.setFirstName(updateUserForm.getGivenName());<NEW_LINE>userToSave.setLastName(updateUserForm.getSurname());<NEW_LINE>if (null != updateUserForm.getEmail()) {<NEW_LINE>userToSave.setEmailAddress(updateUserForm.getEmail());<NEW_LINE>}<NEW_LINE>if (null != updateUserForm.getNewPassword()) {<NEW_LINE>// Password has changed, so it has to be validated<NEW_LINE>userToSave.setPassword(updateUserForm.getNewPassword());<NEW_LINE>// And re-authentication might be required<NEW_LINE>validatePassword = true;<NEW_LINE>}<NEW_LINE>if (userToSave.getUserId().equalsIgnoreCase(modUser.getUserId())) {<NEW_LINE>boolean passwordMatch = loginService.passwordMatch(updateUserForm.getCurrentPassword(), modUser);<NEW_LINE>if (!passwordMatch) {<NEW_LINE>throw new IncorrectPasswordException();<NEW_LINE>}<NEW_LINE>this.userAPI.save(userToSave, this.userAPI.getSystemUser(), validatePassword, false);<NEW_LINE>// if the user logged is the same of the user to save, we need to set the new user changes to the session.<NEW_LINE>session.setAttribute(com.dotmarketing.<MASK><NEW_LINE>} else if (this.permissionAPI.doesUserHavePermission(this.userProxyAPI.getUserProxy(userToSave, modUser, false), PermissionAPI.PERMISSION_EDIT, modUser, false)) {<NEW_LINE>this.userAPI.save(userToSave, modUser, validatePassword, !userWebAPI.isLoggedToBackend(request));<NEW_LINE>} else {<NEW_LINE>throw new DotSecurityException(LanguageUtil.get(locale, "User-Doesnot-Have-Permission"));<NEW_LINE>}<NEW_LINE>} catch (SystemException | PortalException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>return userToSave;<NEW_LINE>} | util.WebKeys.CMS_USER, userToSave); |
1,579,228 | private static ResolvedEvent resolve(Rule rule, BlazeDirectories directories) {<NEW_LINE>String name = rule.getName();<NEW_LINE>Object pathObj = rule.getAttr("path");<NEW_LINE>ImmutableMap.Builder<String, Object> origAttr = ImmutableMap.<String, Object>builder().put("name", name).put("path", pathObj);<NEW_LINE>StringBuilder repr = new StringBuilder().append("new_local_repository(name = ").append(Starlark.repr(name)).append(", path = ").append(Starlark.repr(pathObj));<NEW_LINE>Object buildFileObj = rule.getAttr("build_file");<NEW_LINE>if ((buildFileObj instanceof String) && ((String) buildFileObj).length() > 0) {<NEW_LINE>// Build fiels might refer to an embedded file (as they to for "local_jdk"),<NEW_LINE>// so we have to describe the argument in a portable way.<NEW_LINE>origAttr.put("build_file", buildFileObj);<NEW_LINE>String buildFileArg;<NEW_LINE>PathFragment pathFragment = PathFragment.create((String) buildFileObj);<NEW_LINE>PathFragment embeddedDir = directories<MASK><NEW_LINE>if (pathFragment.isAbsolute() && pathFragment.startsWith(embeddedDir)) {<NEW_LINE>buildFileArg = "__embedded_dir__ + \"/\" + " + Starlark.repr(pathFragment.relativeTo(embeddedDir).toString());<NEW_LINE>} else {<NEW_LINE>buildFileArg = Starlark.repr(buildFileObj.toString()).toString();<NEW_LINE>}<NEW_LINE>repr.append(", build_file = ").append(buildFileArg);<NEW_LINE>} else {<NEW_LINE>Object buildFileContentObj = rule.getAttr("build_file_content");<NEW_LINE>if (buildFileContentObj != null) {<NEW_LINE>origAttr.put("build_file_content", buildFileContentObj);<NEW_LINE>repr.append(", build_file_content = ").append(Starlark.repr(buildFileContentObj));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String nativeCommand = repr.append(")").toString();<NEW_LINE>ImmutableMap<String, Object> orig = origAttr.build();<NEW_LINE>return new ResolvedEvent() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String getName() {<NEW_LINE>return name;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Object getResolvedInformation(XattrProvider xattrProvider) {<NEW_LINE>return ImmutableMap.<String, Object>builder().put(ResolvedHashesFunction.ORIGINAL_RULE_CLASS, "new_local_repository").put(ResolvedHashesFunction.ORIGINAL_ATTRIBUTES, orig).put(ResolvedHashesFunction.NATIVE, nativeCommand).build();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>} | .getEmbeddedBinariesRoot().asFragment(); |
820,685 | private static void buildConversionMap() {<NEW_LINE>// Values in the map below may be always changed<NEW_LINE>ArrayMap<String, String> keyValueMap = new ArrayMap<>(10);<NEW_LINE>keyValueMap.put("top", "0");<NEW_LINE>keyValueMap.put("left", "0");<NEW_LINE>keyValueMap.put("right", "DUMMY_RIGHT");<NEW_LINE>keyValueMap.put("bottom", "DUMMY_BOTTOM");<NEW_LINE><MASK><NEW_LINE>keyValueMap.put("height", "DUMMY_HEIGHT");<NEW_LINE>keyValueMap.put("screen_width", "DUMMY_DATA");<NEW_LINE>keyValueMap.put("screen_height", "DUMMY_DATA");<NEW_LINE>keyValueMap.put("margin", Integer.toString((int) Tools.dpToPx(2)));<NEW_LINE>keyValueMap.put("preferred_scale", Float.toString(LauncherPreferences.PREF_BUTTONSIZE));<NEW_LINE>conversionMap = new WeakReference<>(keyValueMap);<NEW_LINE>} | keyValueMap.put("width", "DUMMY_WIDTH"); |
808,484 | /*<NEW_LINE>* void GetStringUTFRegion(JNIEnv *env, jstring str, jsize start, jsize len, char *buf);<NEW_LINE>*/<NEW_LINE>@CEntryPoint(exceptionHandler = JNIExceptionHandlerVoid.class, include = CEntryPoint.NotIncludedAutomatically.class)<NEW_LINE>@CEntryPointOptions(prologue = JNIEnvEnterFatalOnFailurePrologue.class, publishAs = Publish.NotPublished)<NEW_LINE>static void GetStringUTFRegion(JNIEnvironment env, JNIObjectHandle hstr, int start, int len, CCharPointer buf) {<NEW_LINE>String str = JNIObjectHandles.getObject(hstr);<NEW_LINE>if (start < 0) {<NEW_LINE>throw new StringIndexOutOfBoundsException(start);<NEW_LINE>}<NEW_LINE>if (start + len > str.length()) {<NEW_LINE>throw new StringIndexOutOfBoundsException(start + len);<NEW_LINE>}<NEW_LINE>if (len < 0) {<NEW_LINE>throw new StringIndexOutOfBoundsException(len);<NEW_LINE>}<NEW_LINE>// estimate: caller must pre-allocate<NEW_LINE>int capacity = <MASK><NEW_LINE>// enough<NEW_LINE>ByteBuffer buffer = CTypeConversion.asByteBuffer(buf, capacity);<NEW_LINE>Utf8.substringToUtf8(buffer, str, start, start + len, true);<NEW_LINE>} | Utf8.maxUtf8ByteLength(len, true); |
146,396 | public static DescribeAntChainMembersResponse unmarshall(DescribeAntChainMembersResponse describeAntChainMembersResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeAntChainMembersResponse.setRequestId(_ctx.stringValue("DescribeAntChainMembersResponse.RequestId"));<NEW_LINE>Result result = new Result();<NEW_LINE>Pagination pagination = new Pagination();<NEW_LINE>pagination.setPageSize(_ctx.integerValue("DescribeAntChainMembersResponse.Result.Pagination.PageSize"));<NEW_LINE>pagination.setPageNumber(_ctx.integerValue("DescribeAntChainMembersResponse.Result.Pagination.PageNumber"));<NEW_LINE>pagination.setTotalCount(_ctx.integerValue("DescribeAntChainMembersResponse.Result.Pagination.TotalCount"));<NEW_LINE>result.setPagination(pagination);<NEW_LINE>List<MembersItem> members = new ArrayList<MembersItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeAntChainMembersResponse.Result.Members.Length"); i++) {<NEW_LINE>MembersItem membersItem = new MembersItem();<NEW_LINE>membersItem.setStatus(_ctx.stringValue("DescribeAntChainMembersResponse.Result.Members[" + i + "].Status"));<NEW_LINE>membersItem.setMemberId(_ctx.stringValue("DescribeAntChainMembersResponse.Result.Members[" + i + "].MemberId"));<NEW_LINE>membersItem.setRole(_ctx.stringValue("DescribeAntChainMembersResponse.Result.Members[" + i + "].Role"));<NEW_LINE>membersItem.setMemberName(_ctx.stringValue("DescribeAntChainMembersResponse.Result.Members[" + i + "].MemberName"));<NEW_LINE>membersItem.setJoinTime(_ctx.longValue<MASK><NEW_LINE>members.add(membersItem);<NEW_LINE>}<NEW_LINE>result.setMembers(members);<NEW_LINE>describeAntChainMembersResponse.setResult(result);<NEW_LINE>return describeAntChainMembersResponse;<NEW_LINE>} | ("DescribeAntChainMembersResponse.Result.Members[" + i + "].JoinTime")); |
1,538,771 | public static void createContent(MainDocumentPart wordDocumentPart) {<NEW_LINE>try {<NEW_LINE>// Do this explicitly, since we need<NEW_LINE>// it in order to create our content<NEW_LINE>PhysicalFonts.discoverPhysicalFonts();<NEW_LINE>Map<String, PhysicalFont> physicalFontMap = PhysicalFonts.getPhysicalFonts();<NEW_LINE>Iterator physicalFontMapIterator = physicalFontMap.entrySet().iterator();<NEW_LINE>while (physicalFontMapIterator.hasNext()) {<NEW_LINE>Map.Entry pairs = (Map.Entry) physicalFontMapIterator.next();<NEW_LINE>if (pairs.getKey() == null) {<NEW_LINE>pairs = (Map.Entry) physicalFontMapIterator.next();<NEW_LINE>}<NEW_LINE>String fontName = (String) pairs.getKey();<NEW_LINE>PhysicalFont pf = (PhysicalFont) pairs.getValue();<NEW_LINE>System.out.println("Added paragraph for " + fontName);<NEW_LINE>addObject(wordDocumentPart, sampleText, fontName);<NEW_LINE>// bold, italic etc<NEW_LINE>PhysicalFont pfVariation = PhysicalFonts.getBoldForm(pf);<NEW_LINE>if (pfVariation != null) {<NEW_LINE>addObject(wordDocumentPart, sampleTextBold, pfVariation.getName());<NEW_LINE>}<NEW_LINE>pfVariation = PhysicalFonts.getBoldItalicForm(pf);<NEW_LINE>if (pfVariation != null) {<NEW_LINE>addObject(wordDocumentPart, sampleTextBoldItalic, pfVariation.getName());<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (pfVariation != null) {<NEW_LINE>addObject(wordDocumentPart, sampleTextItalic, pfVariation.getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>} | pfVariation = PhysicalFonts.getItalicForm(pf); |
89,003 | private // (e.g. a revealjs presentation or a pdf)<NEW_LINE>String useQuartoPreview() {<NEW_LINE>if (session_.getSessionInfo().getQuartoConfig().enabled && (extendedType_ == SourceDocument.XT_QUARTO_DOCUMENT) && !isShinyDoc() && !isRmdNotebook() && !isQuartoWebsiteDefaultHtmlDoc()) {<NEW_LINE>String format = quartoFormat();<NEW_LINE>if (format == null) {<NEW_LINE>return "html";<NEW_LINE>} else {<NEW_LINE>final ArrayList<String> previewFormats = new ArrayList<String>(Arrays.asList(QUARTO_PDF_FORMAT, QUARTO_BEAMER_FORMAT<MASK><NEW_LINE>return previewFormats.stream().filter(fmt -> format.startsWith(fmt)).findAny().orElse(null);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} | , QUARTO_HTML_FORMAT, QUARTO_REVEALJS_FORMAT, QUARTO_SLIDY_FORMAT)); |
506,069 | private static boolean loadBTraceScript(String filePath, boolean traceToStdOut) {<NEW_LINE>try {<NEW_LINE>String scriptName = "";<NEW_LINE>String scriptParent = "";<NEW_LINE>File traceScript = new File(filePath);<NEW_LINE>scriptName = traceScript.getName();<NEW_LINE>scriptParent = traceScript.getParent();<NEW_LINE>if (!traceScript.exists()) {<NEW_LINE>traceScript = new File(Constants.EMBEDDED_BTRACE_SECTION_HEADER + filePath);<NEW_LINE>}<NEW_LINE>if (scriptName.endsWith(".java")) {<NEW_LINE>if (isDebug()) {<NEW_LINE>debugPrint("refusing " + filePath + " - script should be a pre-compiled class file");<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>SharedSettings clientSettings = new SharedSettings();<NEW_LINE>clientSettings.from(settings);<NEW_LINE>clientSettings.setClientName(scriptName);<NEW_LINE>if (traceToStdOut) {<NEW_LINE>clientSettings.setOutputFile("::stdout");<NEW_LINE>} else {<NEW_LINE>String traceOutput = clientSettings.getOutputFile();<NEW_LINE>String outDir = clientSettings.getOutputDir();<NEW_LINE>if (traceOutput == null || traceOutput.length() == 0) {<NEW_LINE>clientSettings.setOutputFile("${client}-${agent}.${ts}.btrace[default]");<NEW_LINE>if (outDir == null || outDir.length() == 0) {<NEW_LINE>clientSettings.setOutputDir(scriptParent);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ClientContext ctx = new ClientContext(inst, transformer, argMap, clientSettings);<NEW_LINE>Client client = new FileClient(ctx, traceScript);<NEW_LINE>if (client.isInitialized()) {<NEW_LINE>handleNewClient(client).get();<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>} catch (NullPointerException e) {<NEW_LINE>if (isDebug()) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} catch (RuntimeException | IOException | ExecutionException re) {<NEW_LINE>if (isDebug()) {<NEW_LINE>debugPrint(re);<NEW_LINE>}<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>Thread.currentThread().interrupt();<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | debugPrint("script " + filePath + " does not exist!"); |
324,870 | private void updateAndPublish() {<NEW_LINE>StationConfiguration config = getConfigAs(StationConfiguration.class);<NEW_LINE>try {<NEW_LINE>OpenDatasoftResponse measures = apiHandler.getMeasures(config.id);<NEW_LINE>measures.getFirstRecord().ifPresent(field -> {<NEW_LINE>double height = field.getHeight();<NEW_LINE>if (height != -1) {<NEW_LINE>updateQuantity(HEIGHT, height, SIUnits.METRE);<NEW_LINE>updateRelativeMeasure(RELATIVE_HEIGHT, referenceHeights, height);<NEW_LINE>}<NEW_LINE>double flow = field.getFlow();<NEW_LINE>if (flow != -1) {<NEW_LINE>updateQuantity(<MASK><NEW_LINE>updateRelativeMeasure(RELATIVE_FLOW, referenceFlows, flow);<NEW_LINE>}<NEW_LINE>field.getTimestamp().ifPresent(date -> updateDate(OBSERVATION_TIME, date));<NEW_LINE>});<NEW_LINE>String currentPortion = portion;<NEW_LINE>if (currentPortion != null) {<NEW_LINE>InfoVigiCru status = apiHandler.getTronconStatus(currentPortion);<NEW_LINE>updateAlert(ALERT, status.vicInfoVigiCru.vicNivInfoVigiCru - 1);<NEW_LINE>updateString(SHORT_COMMENT, status.vicInfoVigiCru.vicSituActuInfoVigiCru);<NEW_LINE>updateString(COMMENT, status.vicInfoVigiCru.vicQualifInfoVigiCru);<NEW_LINE>}<NEW_LINE>updateStatus(ThingStatus.ONLINE);<NEW_LINE>} catch (VigiCruesException e) {<NEW_LINE>updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, e.getMessage());<NEW_LINE>}<NEW_LINE>} | FLOW, flow, Units.CUBICMETRE_PER_SECOND); |
100,565 | public static ListRamUsersResponse unmarshall(ListRamUsersResponse listRamUsersResponse, UnmarshallerContext _ctx) {<NEW_LINE>listRamUsersResponse.setRequestId(_ctx.stringValue("ListRamUsersResponse.RequestId"));<NEW_LINE>listRamUsersResponse.setCode(_ctx.stringValue("ListRamUsersResponse.Code"));<NEW_LINE>listRamUsersResponse.setHttpStatusCode(_ctx.integerValue("ListRamUsersResponse.HttpStatusCode"));<NEW_LINE>listRamUsersResponse.setMessage(_ctx.stringValue("ListRamUsersResponse.Message"));<NEW_LINE>List<String> params = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListRamUsersResponse.Params.Length"); i++) {<NEW_LINE>params.add(_ctx.stringValue("ListRamUsersResponse.Params[" + i + "]"));<NEW_LINE>}<NEW_LINE>listRamUsersResponse.setParams(params);<NEW_LINE>Data data = new Data();<NEW_LINE>data.setPageNumber(_ctx.integerValue("ListRamUsersResponse.Data.PageNumber"));<NEW_LINE>data.setPageSize(_ctx.integerValue("ListRamUsersResponse.Data.PageSize"));<NEW_LINE>data.setTotalCount(_ctx.integerValue("ListRamUsersResponse.Data.TotalCount"));<NEW_LINE>List<RamUser> list = new ArrayList<RamUser>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListRamUsersResponse.Data.List.Length"); i++) {<NEW_LINE>RamUser ramUser = new RamUser();<NEW_LINE>ramUser.setDisplayName(_ctx.stringValue("ListRamUsersResponse.Data.List[" + i + "].DisplayName"));<NEW_LINE>ramUser.setEmail(_ctx.stringValue("ListRamUsersResponse.Data.List[" + i + "].Email"));<NEW_LINE>ramUser.setLoginName(_ctx.stringValue("ListRamUsersResponse.Data.List[" + i + "].LoginName"));<NEW_LINE>ramUser.setMobile(_ctx.stringValue("ListRamUsersResponse.Data.List[" + i + "].Mobile"));<NEW_LINE>ramUser.setAliyunUid(_ctx.longValue<MASK><NEW_LINE>ramUser.setPrimary(_ctx.booleanValue("ListRamUsersResponse.Data.List[" + i + "].Primary"));<NEW_LINE>ramUser.setRamId(_ctx.stringValue("ListRamUsersResponse.Data.List[" + i + "].RamId"));<NEW_LINE>list.add(ramUser);<NEW_LINE>}<NEW_LINE>data.setList(list);<NEW_LINE>listRamUsersResponse.setData(data);<NEW_LINE>return listRamUsersResponse;<NEW_LINE>} | ("ListRamUsersResponse.Data.List[" + i + "].AliyunUid")); |
296,758 | protected Object parseSourceValue(Object value) {<NEW_LINE>RangeType rangeType = rangeType();<NEW_LINE>if (!(value instanceof Map)) {<NEW_LINE>assert rangeType == RangeType.IP;<NEW_LINE>Tuple<InetAddress, Integer> ipRange = InetAddresses.parseCidr(value.toString());<NEW_LINE>return InetAddresses.toCidrString(ipRange.v1(<MASK><NEW_LINE>}<NEW_LINE>Map<String, Object> range = (Map<String, Object>) value;<NEW_LINE>Map<String, Object> parsedRange = new HashMap<>();<NEW_LINE>for (Map.Entry<String, Object> entry : range.entrySet()) {<NEW_LINE>Object parsedValue = rangeType.parseValue(entry.getValue(), coerce, dateMathParser);<NEW_LINE>Object formattedValue = rangeType.formatValue(parsedValue, formatter);<NEW_LINE>parsedRange.put(entry.getKey(), formattedValue);<NEW_LINE>}<NEW_LINE>return parsedRange;<NEW_LINE>} | ), ipRange.v2()); |
437,118 | public void createNode(int rootID, HippyArray hippyArray) {<NEW_LINE>HippyRootView hippyRootView = mContext.getInstance(rootID);<NEW_LINE>DomManager domManager = this.mContext.getDomManager();<NEW_LINE>if (hippyArray != null && hippyRootView != null && domManager != null) {<NEW_LINE><MASK><NEW_LINE>for (int i = 0; i < len; i++) {<NEW_LINE>HippyMap nodeArray = hippyArray.getMap(i);<NEW_LINE>int tag = ((Number) nodeArray.get(ID)).intValue();<NEW_LINE>int pTag = ((Number) nodeArray.get(PID)).intValue();<NEW_LINE>int index = ((Number) nodeArray.get(INDEX)).intValue();<NEW_LINE>if (tag < 0 || pTag < 0 || index < 0) {<NEW_LINE>throw new IllegalArgumentException("createNode invalid value: " + "id=" + tag + ", pId=" + pTag + ", index=" + index);<NEW_LINE>}<NEW_LINE>String className = (String) nodeArray.get(NAME);<NEW_LINE>String tagName = (String) nodeArray.get(TAG_NAME);<NEW_LINE>HippyMap props = (HippyMap) nodeArray.get(PROPS);<NEW_LINE>domManager.createNode(hippyRootView, rootID, tag, pTag, index, className, tagName, props);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | int len = hippyArray.size(); |
1,795,803 | final GetUploadResult executeGetUpload(GetUploadRequest getUploadRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getUploadRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetUploadRequest> request = null;<NEW_LINE>Response<GetUploadResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetUploadRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getUploadRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Device Farm");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetUpload");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetUploadResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetUploadResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); |
1,262,863 | public ModuleVariableDeclarationNode transform(ModuleVariableDeclarationNode moduleVariableDeclarationNode) {<NEW_LINE>MetadataNode metadata = formatNode(moduleVariableDeclarationNode.metadata().orElse(null), 0, 1);<NEW_LINE>Token visibilityQual = formatToken(moduleVariableDeclarationNode.visibilityQualifier().orElse(null), 1, 0);<NEW_LINE>NodeList<Token> qualifierList = formatNodeList(moduleVariableDeclarationNode.qualifiers(), 1, 0, 1, 0);<NEW_LINE>TypedBindingPatternNode typedBindingPatternNode = formatNode(moduleVariableDeclarationNode.typedBindingPattern(), moduleVariableDeclarationNode.equalsToken().isPresent(<MASK><NEW_LINE>Token equalsToken = formatToken(moduleVariableDeclarationNode.equalsToken().orElse(null), 1, 0);<NEW_LINE>boolean prevInLineAnnotation = env.inLineAnnotation;<NEW_LINE>setInLineAnnotation(true);<NEW_LINE>ExpressionNode initializer = formatNode(moduleVariableDeclarationNode.initializer().orElse(null), 0, 0);<NEW_LINE>setInLineAnnotation(prevInLineAnnotation);<NEW_LINE>Token semicolonToken = formatToken(moduleVariableDeclarationNode.semicolonToken(), env.trailingWS, env.trailingNL);<NEW_LINE>return moduleVariableDeclarationNode.modify().withMetadata(metadata).withVisibilityQualifier(visibilityQual).withQualifiers(qualifierList).withTypedBindingPattern(typedBindingPatternNode).withEqualsToken(equalsToken).withInitializer(initializer).withSemicolonToken(semicolonToken).apply();<NEW_LINE>} | ) ? 1 : 0, 0); |
220,675 | private static void tryAssertionDocSampleCarEvent(RegressionEnvironment env, AtomicInteger milestone) {<NEW_LINE>String[] fields = new String[] { "name", "place", "sum(count)", "grouping(name)", "grouping(place)", "gid" };<NEW_LINE>env.sendEventBean(new SupportCarEvent("skoda", "france", 100));<NEW_LINE>env.assertPropsPerRowLastNew("s0", fields, new Object[][] { { "skoda", "france", 100, 0, 0, 0 }, { "skoda", null, 100, 0, 1, 1 }, { null, "france", 100, 1, 0, 2 }, { null, null, 100, <MASK><NEW_LINE>env.milestoneInc(milestone);<NEW_LINE>env.sendEventBean(new SupportCarEvent("skoda", "germany", 75));<NEW_LINE>env.assertPropsPerRowLastNew("s0", fields, new Object[][] { { "skoda", "germany", 75, 0, 0, 0 }, { "skoda", null, 175, 0, 1, 1 }, { null, "germany", 75, 1, 0, 2 }, { null, null, 175, 1, 1, 3 } });<NEW_LINE>} | 1, 1, 3 } }); |
1,015,716 | static void edgeType(int u) {<NEW_LINE>status[u] = EXPLORED;<NEW_LINE>for (int v : adjList[u]) if (status[v] == UNVISITED) {<NEW_LINE>System.out.printf(<MASK><NEW_LINE>parent[v] = u;<NEW_LINE>edgeType(v);<NEW_LINE>} else if (// cross edges only occur in directed graph<NEW_LINE>status[v] == VISITED)<NEW_LINE>System.out.printf("Edge from %d to %d is %s%n", u, v, "forwad/cross edge");<NEW_LINE>else if (parent[u] == v)<NEW_LINE>System.out.printf("Edge from %d to %d is %s%n", u, v, "bidirectional edge");<NEW_LINE>else {<NEW_LINE>System.out.printf("Edge from %d to %d is %s%n", u, v, "back edge");<NEW_LINE>System.out.println("Cycle!");<NEW_LINE>}<NEW_LINE>status[u] = VISITED;<NEW_LINE>} | "Edge from %d to %d is %s%n", u, v, "tree edge"); |
1,230,528 | private HttpRequest.Builder testGroupParametersRequestBuilder(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) throws ApiException {<NEW_LINE>// verify the required parameter 'requiredStringGroup' is set<NEW_LINE>if (requiredStringGroup == null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>// verify the required parameter 'requiredBooleanGroup' is set<NEW_LINE>if (requiredBooleanGroup == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'requiredBooleanGroup' when calling testGroupParameters");<NEW_LINE>}<NEW_LINE>// verify the required parameter 'requiredInt64Group' is set<NEW_LINE>if (requiredInt64Group == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'requiredInt64Group' when calling testGroupParameters");<NEW_LINE>}<NEW_LINE>HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();<NEW_LINE>String localVarPath = "/fake";<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<>();<NEW_LINE>localVarQueryParams.addAll(ApiClient.parameterToPairs("required_string_group", requiredStringGroup));<NEW_LINE>localVarQueryParams.addAll(ApiClient.parameterToPairs("required_int64_group", requiredInt64Group));<NEW_LINE>localVarQueryParams.addAll(ApiClient.parameterToPairs("string_group", stringGroup));<NEW_LINE>localVarQueryParams.addAll(ApiClient.parameterToPairs("int64_group", int64Group));<NEW_LINE>if (!localVarQueryParams.isEmpty()) {<NEW_LINE>StringJoiner queryJoiner = new StringJoiner("&");<NEW_LINE>localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue()));<NEW_LINE>localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString()));<NEW_LINE>} else {<NEW_LINE>localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));<NEW_LINE>}<NEW_LINE>if (requiredBooleanGroup != null) {<NEW_LINE>localVarRequestBuilder.header("required_boolean_group", requiredBooleanGroup.toString());<NEW_LINE>}<NEW_LINE>if (booleanGroup != null) {<NEW_LINE>localVarRequestBuilder.header("boolean_group", booleanGroup.toString());<NEW_LINE>}<NEW_LINE>localVarRequestBuilder.header("Accept", "application/json");<NEW_LINE>localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody());<NEW_LINE>if (memberVarReadTimeout != null) {<NEW_LINE>localVarRequestBuilder.timeout(memberVarReadTimeout);<NEW_LINE>}<NEW_LINE>if (memberVarInterceptor != null) {<NEW_LINE>memberVarInterceptor.accept(localVarRequestBuilder);<NEW_LINE>}<NEW_LINE>return localVarRequestBuilder;<NEW_LINE>} | throw new ApiException(400, "Missing the required parameter 'requiredStringGroup' when calling testGroupParameters"); |
697,210 | public void copyFrom(final CopyFrom o) {<NEW_LINE>final YWeatherModuleImpl from = (YWeatherModuleImpl) o;<NEW_LINE>setAstronomy(from.getAstronomy() != null ? (Astronomy) from.getAstronomy().clone() : null);<NEW_LINE>setCondition(from.getCondition() != null ? (Condition) from.getCondition().clone() : null);<NEW_LINE>setLocation(from.getLocation() != null ? (Location) from.getLocation().clone() : null);<NEW_LINE>setUnits(from.getUnits() != null ? (Units) from.getUnits().clone() : null);<NEW_LINE>setWind(from.getWind() != null ? (Wind) from.getWind(<MASK><NEW_LINE>setAtmosphere(from.getAtmosphere() != null ? (Atmosphere) from.getAtmosphere().clone() : null);<NEW_LINE>if (from.getForecasts() != null) {<NEW_LINE>forecasts = new Forecast[from.forecasts.length];<NEW_LINE>for (int i = 0; i < from.forecasts.length; i++) {<NEW_LINE>forecasts[i] = from.forecasts[i] != null ? (Forecast) from.forecasts[i].clone() : null;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>forecasts = null;<NEW_LINE>}<NEW_LINE>} | ).clone() : null); |
1,277,873 | private static AsyncProfiler load() throws Exception {<NEW_LINE>// check compatibility<NEW_LINE>String os = System.getProperty("os.name").toLowerCase(Locale.ROOT).replace(" ", "");<NEW_LINE>String arch = System.getProperty("os.arch").toLowerCase(Locale.ROOT);<NEW_LINE>Table<String, String, String> supported = ImmutableTable.<String, String, String>builder().put("linux", "amd64", "linux/amd64").put("linux", "aarch64", "linux/aarch64").put("macosx", "amd64", "macos").put("macosx", "aarch64", "macos").build();<NEW_LINE>String libPath = <MASK><NEW_LINE>if (libPath == null) {<NEW_LINE>throw new UnsupportedSystemException(os, arch);<NEW_LINE>}<NEW_LINE>// extract the profiler binary from the spark jar file<NEW_LINE>String resource = "spark/" + libPath + "/libasyncProfiler.so";<NEW_LINE>URL profilerResource = AsyncProfilerAccess.class.getClassLoader().getResource(resource);<NEW_LINE>if (profilerResource == null) {<NEW_LINE>throw new IllegalStateException("Could not find " + resource + " in spark jar file");<NEW_LINE>}<NEW_LINE>Path extractPath = TemporaryFiles.create("spark-", "-libasyncProfiler.so.tmp");<NEW_LINE>try (InputStream in = profilerResource.openStream()) {<NEW_LINE>Files.copy(in, extractPath, StandardCopyOption.REPLACE_EXISTING);<NEW_LINE>}<NEW_LINE>// get an instance of async-profiler<NEW_LINE>try {<NEW_LINE>return AsyncProfiler.getInstance(extractPath.toAbsolutePath().toString());<NEW_LINE>} catch (UnsatisfiedLinkError e) {<NEW_LINE>throw new NativeLoadingException(e);<NEW_LINE>}<NEW_LINE>} | supported.get(os, arch); |
784,555 | public void rebuild(int source) {<NEW_LINE>for (int i = 0; i < n2; i++) {<NEW_LINE>mates[i].clear();<NEW_LINE>support.getSuccessorsOf(i).clear();<NEW_LINE>support.getPredecessorsOf(i).clear();<NEW_LINE>G_R.getPredecessorsOf(i).clear();<NEW_LINE>G_R.getSuccessorsOf(i).clear();<NEW_LINE>}<NEW_LINE>G_R.getNodes().clear();<NEW_LINE>for (int i = 0; i < n; i++) {<NEW_LINE>IntVar v = vars[i];<NEW_LINE>int lb = v.getLB();<NEW_LINE>int ub = v.getUB();<NEW_LINE>for (int j = lb; j <= ub; j = v.nextValue(j)) {<NEW_LINE>if (j - offSet == source) {<NEW_LINE>support.addEdge(i, n);<NEW_LINE>} else {<NEW_LINE>support.addEdge(i, j - offSet);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>SCCfinder.findAllSCC();<NEW_LINE>int n_R = SCCfinder.getNbSCC();<NEW_LINE>for (int i = 0; i < n_R; i++) {<NEW_LINE>G_R.<MASK><NEW_LINE>}<NEW_LINE>sccOf = SCCfinder.getNodesSCC();<NEW_LINE>ISetIterator succs;<NEW_LINE>int x;<NEW_LINE>for (int i = 0; i < n; i++) {<NEW_LINE>x = sccOf[i];<NEW_LINE>succs = support.getSuccessorsOf(i).iterator();<NEW_LINE>while (succs.hasNext()) {<NEW_LINE>int j = succs.nextInt();<NEW_LINE>if (x != sccOf[j]) {<NEW_LINE>G_R.addEdge(x, sccOf[j]);<NEW_LINE>mates[x].add((i + 1) * n2 + j);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | getNodes().add(i); |
1,613,110 | private void exportXLS() {<NEW_LINE>if (miniTable.getListHead() == null)<NEW_LINE>return;<NEW_LINE>ListHead listHead = miniTable.getListHead();<NEW_LINE>WListItemRenderer itemRenderer = (WListItemRenderer) ((WListbox) listHead.getParent()).getItemRenderer();<NEW_LINE>try {<NEW_LINE>HSSFWorkbook workbook = new HSSFWorkbook();<NEW_LINE>HSSFSheet sheet = workbook.createSheet("Trial Balance Drillable Report");<NEW_LINE>HSSFRow row = sheet.createRow(0);<NEW_LINE>int column = 0;<NEW_LINE>for (String columnNames : getColumnNames()) {<NEW_LINE>row.createCell(column++).setCellValue(columnNames);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < miniTable.getRowCount(); i++) {<NEW_LINE>row = sheet.createRow(i + 1);<NEW_LINE>ListItem item = miniTable.getItemAtIndex(i);<NEW_LINE>for (int j = 0; j < miniTable.getColumnCount(); j++) {<NEW_LINE>Listcell cell = (Listcell) item.getChildren().get(j);<NEW_LINE>WTableColumn m_tableColumns = ((WTableColumn) itemRenderer.getColumn(j));<NEW_LINE>if (m_tableColumns.getColumnClass() == BigDecimal.class)<NEW_LINE>row.createCell(j).setCellValue(Double.parseDouble(cell.getValue().toString()));<NEW_LINE>else<NEW_LINE>row.createCell(j).setCellValue(cell.getValue().toString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>File file = File.createTempFile("Export", ".xls");<NEW_LINE>FileOutputStream out = new FileOutputStream(file);<NEW_LINE>workbook.write(out);<NEW_LINE>out.close();<NEW_LINE>AMedia media = new AMedia(file.getName(), "xls", "application/vnd.ms-excel", file, true);<NEW_LINE>Filedownload.save(media, file.getName());<NEW_LINE>} catch (FileNotFoundException e) {<NEW_LINE>log.log(Level.SEVERE, e.getLocalizedMessage());<NEW_LINE>} catch (IOException e) {<NEW_LINE>log.log(Level.<MASK><NEW_LINE>}<NEW_LINE>} | SEVERE, e.getLocalizedMessage()); |
1,634,463 | public static Collection<RegressionExecution> executions() {<NEW_LINE>ArrayList<RegressionExecution> execs = new ArrayList<>();<NEW_LINE>execs.add(new ViewTimeWindowSceneOne());<NEW_LINE>execs.add(new ViewTimeWindowSceneTwo());<NEW_LINE>execs.add(new ViewTimeJustSelectStar());<NEW_LINE>execs.add(new ViewTimeSum());<NEW_LINE>execs.add(new ViewTimeSumGroupBy());<NEW_LINE>execs.add(new ViewTimeSumWFilter());<NEW_LINE>execs<MASK><NEW_LINE>execs.add(new ViewTimeWindowWPrev());<NEW_LINE>execs.add(new ViewTimeWindowPreparedStmt());<NEW_LINE>execs.add(new ViewTimeWindowVariableStmt());<NEW_LINE>execs.add(new ViewTimeWindowTimePeriod());<NEW_LINE>execs.add(new ViewTimeWindowVariableTimePeriodStmt());<NEW_LINE>execs.add(new ViewTimeWindowTimePeriodParams());<NEW_LINE>execs.add(new ViewTimeWindowFlipTimer(0, "1", 1000));<NEW_LINE>execs.add(new ViewTimeWindowFlipTimer(123456789, "10", 123456789 + 10 * 1000));<NEW_LINE>execs.add(new ViewTimeWindowFlipTimer(0, "1 months 10 milliseconds", timePlusMonth(0, 1) + 10));<NEW_LINE>long currentTime = DateTime.parseDefaultMSec("2002-05-1T08:00:01.999");<NEW_LINE>execs.add(new ViewTimeWindowFlipTimer(currentTime, "1 months 50 milliseconds", timePlusMonth(currentTime, 1) + 50));<NEW_LINE>return execs;<NEW_LINE>} | .add(new ViewTimeWindowMonthScoped()); |
766,256 | public void handleDiscoveredPeers(List<Peer> peers, String hexInfoHash) {<NEW_LINE>if (peers.size() == 0)<NEW_LINE>return;<NEW_LINE>SharedTorrent torrent = torrentsStorage.getTorrent(hexInfoHash);<NEW_LINE>if (torrent != null && torrent.isFinished())<NEW_LINE>return;<NEW_LINE>final LoadedTorrent announceableTorrent = torrentsStorage.getLoadedTorrent(hexInfoHash);<NEW_LINE>if (announceableTorrent == null) {<NEW_LINE>logger.info("announceable torrent {} is not found in storage. Maybe it was removed", hexInfoHash);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (announceableTorrent.getPieceStorage().isFinished())<NEW_LINE>return;<NEW_LINE>logger.debug("Got {} peer(s) ({}) for {} in tracker response", new Object[] { peers.size(), Arrays.toString(peers.toArray()), hexInfoHash });<NEW_LINE>Map<PeerUID, Peer> uniquePeers = new HashMap<PeerUID, Peer>();<NEW_LINE>for (Peer peer : peers) {<NEW_LINE>final PeerUID peerUID = new PeerUID(peer.getAddress(), hexInfoHash);<NEW_LINE>if (uniquePeers.containsKey(peerUID))<NEW_LINE>continue;<NEW_LINE>uniquePeers.put(peerUID, peer);<NEW_LINE>}<NEW_LINE>for (Map.Entry<PeerUID, Peer> e : uniquePeers.entrySet()) {<NEW_LINE><MASK><NEW_LINE>Peer peer = e.getValue();<NEW_LINE>boolean alreadyConnectedToThisPeer = peersStorage.getSharingPeer(peerUID) != null;<NEW_LINE>if (alreadyConnectedToThisPeer) {<NEW_LINE>logger.debug("skipping peer {}, because we already connected to this peer", peer);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>ConnectionListener connectionListener = new OutgoingConnectionListener(this, announceableTorrent.getTorrentHash(), peer.getIp(), peer.getPort());<NEW_LINE>logger.debug("trying to connect to the peer {}", peer);<NEW_LINE>boolean connectTaskAdded = this.myConnectionManager.offerConnect(new ConnectTask(peer.getIp(), peer.getPort(), connectionListener, new SystemTimeService().now(), Constants.DEFAULT_CONNECTION_TIMEOUT_MILLIS), 1, TimeUnit.SECONDS);<NEW_LINE>if (!connectTaskAdded) {<NEW_LINE>logger.info("can not connect to peer {}. Unable to add connect task to connection manager", peer);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | PeerUID peerUID = e.getKey(); |
831,597 | protected QualifiedDeclaration<TypeDeclaration> lookupTypeDeclaration(String name) {<NEW_LINE>if (name == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// NOTE: it is possible to search using the context find methods... it<NEW_LINE>// would be nicer but it may be slower, so we do it this way... to be<NEW_LINE>// thought of<NEW_LINE>Set<String> possibleNames = new LinkedHashSet<String>();<NEW_LINE>String mainModuleName = "";<NEW_LINE>if (getRoot() instanceof CompilationUnit) {<NEW_LINE>mainModuleName = ((CompilationUnit) getRoot()).getMainModule().getName();<NEW_LINE>}<NEW_LINE>// lookup in current compilation unit<NEW_LINE>for (int i = 0; i < getStack().size(); i++) {<NEW_LINE>String containerName = getContainerNameAtIndex(i);<NEW_LINE>String declFullName = StringUtils.isBlank(containerName) ? name : containerName + "." + name;<NEW_LINE>if (declFullName.startsWith(mainModuleName)) {<NEW_LINE>possibleNames.add(declFullName.substring(mainModuleName.length() + 1));<NEW_LINE>}<NEW_LINE>TypeDeclaration <MASK><NEW_LINE>if (match != null) {<NEW_LINE>return new QualifiedDeclaration<>(match, declFullName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// lookup in all compilation units<NEW_LINE>for (CompilationUnit compilUnit : context.compilationUnits) {<NEW_LINE>for (String rootRelativeName : possibleNames) {<NEW_LINE>TypeDeclaration match = context.getTypeDeclaration(compilUnit.getMainModule().getName() + "." + rootRelativeName);<NEW_LINE>if (match != null) {<NEW_LINE>return new QualifiedDeclaration<>(match, compilUnit.getMainModule().getName() + "." + rootRelativeName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | match = context.getTypeDeclaration(declFullName); |
1,034,546 | public void actionPerformed(ActionEvent e) {<NEW_LINE>for (int i = 0; i < algBoxes.length; i++) {<NEW_LINE>if (algBoxes[i] == e.getSource()) {<NEW_LINE>// see if its ready to start posting these events<NEW_LINE>if (!postAlgorithmEvents)<NEW_LINE>return;<NEW_LINE>// notify the main GUI to change the input algorithm<NEW_LINE>final Object cookie = algCookies[i].get(algBoxes[i].getSelectedIndex());<NEW_LINE>final String name = (String) algBoxes[i].getSelectedItem();<NEW_LINE>final int indexFamily = i;<NEW_LINE>new Thread(() -> performSetAlgorithm(indexFamily, name<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (e.getSource() == imageBox) {<NEW_LINE>// notify the main GUI to change the input image<NEW_LINE>final String name = (String) imageBox.getSelectedItem();<NEW_LINE>new Thread(() -> performChangeInput(name, imageBox.getSelectedIndex())).start();<NEW_LINE>} else if (e.getSource() == originalCheck) {<NEW_LINE>origPanel.setSize(gui.getWidth(), gui.getHeight());<NEW_LINE>// swap the main GUI with a picture of the original input image<NEW_LINE>if (originalCheck.isSelected()) {<NEW_LINE>remove(gui);<NEW_LINE>add(origPanel);<NEW_LINE>} else {<NEW_LINE>remove(origPanel);<NEW_LINE>add(gui);<NEW_LINE>}<NEW_LINE>validate();<NEW_LINE>repaint();<NEW_LINE>}<NEW_LINE>} | , cookie)).start(); |
22,401 | public static void main(String[] args) throws URISyntaxException, InterruptedException {<NEW_LINE>Map<String, String> httpHeaders = new HashMap<String, String>();<NEW_LINE>httpHeaders.put("Cookie", "test");<NEW_LINE>ExampleClient c = new ExampleClient(new URI("ws://localhost:8887"), httpHeaders);<NEW_LINE>// We expect no successful connection<NEW_LINE>c.connectBlocking();<NEW_LINE><MASK><NEW_LINE>c = new ExampleClient(new URI("ws://localhost:8887"), httpHeaders);<NEW_LINE>// Wer expect a successful connection<NEW_LINE>c.connectBlocking();<NEW_LINE>c.closeBlocking();<NEW_LINE>httpHeaders.put("Access-Control-Allow-Origin", "*");<NEW_LINE>c = new ExampleClient(new URI("ws://localhost:8887"), httpHeaders);<NEW_LINE>// We expect no successful connection<NEW_LINE>c.connectBlocking();<NEW_LINE>c.closeBlocking();<NEW_LINE>httpHeaders.clear();<NEW_LINE>httpHeaders.put("Origin", "localhost:8887");<NEW_LINE>httpHeaders.put("Cookie", "username=nemo");<NEW_LINE>c = new ExampleClient(new URI("ws://localhost:8887"), httpHeaders);<NEW_LINE>// We expect a successful connection<NEW_LINE>c.connectBlocking();<NEW_LINE>c.closeBlocking();<NEW_LINE>httpHeaders.clear();<NEW_LINE>httpHeaders.put("Origin", "localhost");<NEW_LINE>httpHeaders.put("cookie", "username=nemo");<NEW_LINE>c = new ExampleClient(new URI("ws://localhost:8887"), httpHeaders);<NEW_LINE>// We expect no successful connection<NEW_LINE>c.connectBlocking();<NEW_LINE>} | httpHeaders.put("Cookie", "username=nemo"); |
661,814 | private String generateMigration(Request request, Migration dbMigration, String dropsFor) throws IOException {<NEW_LINE>String fullVersion = fullVersion(request.nextVersion(), dropsFor);<NEW_LINE>logInfo("generating migration:%s", fullVersion);<NEW_LINE>if (!request.initMigration && !writeMigrationXml(dbMigration, request.modelDir, fullVersion)) {<NEW_LINE>logError("migration already exists, not generating DDL");<NEW_LINE>return null;<NEW_LINE>} else {<NEW_LINE>if (!platforms.isEmpty()) {<NEW_LINE>writeExtraPlatformDdl(fullVersion, request.currentModel, dbMigration, request.migrationDir);<NEW_LINE>} else if (databasePlatform != null) {<NEW_LINE>// writer needs the current model to provide table/column details for<NEW_LINE>// history ddl generation (triggers, history tables etc)<NEW_LINE>DdlOptions options = new DdlOptions(addForeignKeySkipCheck);<NEW_LINE>DdlWrite writer = new DdlWrite(new MConfiguration(<MASK><NEW_LINE>PlatformDdlWriter platformWriter = createDdlWriter(databasePlatform);<NEW_LINE>platformWriter.processMigration(dbMigration, writer, request.migrationDir, fullVersion);<NEW_LINE>}<NEW_LINE>return fullVersion;<NEW_LINE>}<NEW_LINE>} | ), request.current, options); |
2,044 | final CreateServiceResult executeCreateService(CreateServiceRequest createServiceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createServiceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateServiceRequest> request = null;<NEW_LINE>Response<CreateServiceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateServiceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createServiceRequest));<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, "ServiceDiscovery");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateService");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateServiceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateServiceResultJsonUnmarshaller());<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); |
253,226 | public boolean solveMLCP(SWIGTYPE_p_btMatrixXT_float_t A, SWIGTYPE_p_btVectorXT_float_t b, SWIGTYPE_p_btVectorXT_float_t x, SWIGTYPE_p_btVectorXT_float_t lo, SWIGTYPE_p_btVectorXT_float_t hi, SWIGTYPE_p_btAlignedObjectArrayT_int_t limitDependency, int numIterations, boolean useSparsity) {<NEW_LINE>return DynamicsJNI.btLemkeSolver_solveMLCP__SWIG_0(swigCPtr, this, SWIGTYPE_p_btMatrixXT_float_t.getCPtr(A), SWIGTYPE_p_btVectorXT_float_t.getCPtr(b), SWIGTYPE_p_btVectorXT_float_t.getCPtr(x), SWIGTYPE_p_btVectorXT_float_t.getCPtr(lo), SWIGTYPE_p_btVectorXT_float_t.getCPtr(hi), SWIGTYPE_p_btAlignedObjectArrayT_int_t.getCPtr<MASK><NEW_LINE>} | (limitDependency), numIterations, useSparsity); |
1,811,424 | public static void main(final String[] args) throws Exception {<NEW_LINE>final Options opts = new Options();<NEW_LINE>opts.addOption(Option.builder("b").longOpt("bootstrap-servers").hasArg().desc("Kafka cluster bootstrap server string (ex: broker:9092)").build());<NEW_LINE>opts.addOption(Option.builder("s").longOpt("schema-registry").hasArg().desc("Schema Registry URL").build());<NEW_LINE>opts.addOption(Option.builder("c").longOpt("config-file").hasArg().desc("Java properties file with configurations for Kafka Clients").build());<NEW_LINE>opts.addOption(Option.builder("t").longOpt("state-dir").hasArg().desc("The directory for state storage").build());<NEW_LINE>opts.addOption(Option.builder("h").longOpt("help").hasArg(false).desc<MASK><NEW_LINE>final CommandLine cl = new DefaultParser().parse(opts, args);<NEW_LINE>if (cl.hasOption("h")) {<NEW_LINE>final HelpFormatter formatter = new HelpFormatter();<NEW_LINE>formatter.printHelp("Validator Aggregator Service", opts);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final Properties defaultConfig = Optional.ofNullable(cl.getOptionValue("config-file", null)).map(path -> {<NEW_LINE>try {<NEW_LINE>return buildPropertiesFromConfigFile(path);<NEW_LINE>} catch (final IOException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>}).orElse(new Properties());<NEW_LINE>final String schemaRegistryUrl = cl.getOptionValue("schema-registry", DEFAULT_SCHEMA_REGISTRY_URL);<NEW_LINE>defaultConfig.put(AbstractKafkaSchemaSerDeConfig.SCHEMA_REGISTRY_URL_CONFIG, schemaRegistryUrl);<NEW_LINE>Schemas.configureSerdes(defaultConfig);<NEW_LINE>final ValidationsAggregatorService service = new ValidationsAggregatorService();<NEW_LINE>service.start(cl.getOptionValue("bootstrap-servers", DEFAULT_BOOTSTRAP_SERVERS), cl.getOptionValue("state-dir", "/tmp/kafka-streams-examples"), defaultConfig);<NEW_LINE>addShutdownHookAndBlock(service);<NEW_LINE>} | ("Show usage information").build()); |
1,434,156 | protected Integer doInBackground(Void... params) {<NEW_LINE>if (mDownloadUrl == null)<NEW_LINE>return DownloadManager.STATUS_FAILED;<NEW_LINE>String savedFile = DEFAULT_DOWNLOAD_FILE_NAME;<NEW_LINE>File downloadDir = FileHelpers.getCacheDir(mContext);<NEW_LINE>File downloadFile = new File(downloadDir, savedFile);<NEW_LINE>if (downloadFile.isFile())<NEW_LINE>downloadFile.delete();<NEW_LINE>MyDownloadManager.MyRequest request = new MyDownloadManager.MyRequest(Uri.parse(mDownloadUrl));<NEW_LINE>request.setDestinationUri(Uri.fromFile(downloadFile));<NEW_LINE>request.setProgressListener(new MyDownloadManager.ProgressListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void update(long bytesRead, long contentLength, boolean done) {<NEW_LINE>publishProgress((int<MASK><NEW_LINE>isDone = done;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>try {<NEW_LINE>mDownloadId = mDownloadManager.enqueue(request);<NEW_LINE>} catch (IllegalStateException ex) {<NEW_LINE>Log.e(TAG, ex.getMessage(), ex);<NEW_LINE>MessageHelpers.showMessage(mContext, TAG, ex);<NEW_LINE>}<NEW_LINE>return isDone ? DownloadManager.STATUS_SUCCESSFUL : DownloadManager.STATUS_FAILED;<NEW_LINE>} | ) bytesRead, (int) contentLength); |
795,679 | /*<NEW_LINE>* This method is called when an entry is removed from the cache. This could<NEW_LINE>* be because access time of that ledger has elapsed<NEW_LINE>* entrylogMapAccessExpiryTimeInSeconds period, or number of active<NEW_LINE>* currentlogs in the cache has reached the size of<NEW_LINE>* maximumNumberOfActiveEntryLogs, or if an entry is explicitly<NEW_LINE>* invalidated/removed. In these cases entry for that ledger is removed from<NEW_LINE>* cache. Since the entrylog of this ledger is not active anymore it has to<NEW_LINE>* be removed from replicaOfCurrentLogChannels and added to<NEW_LINE>* rotatedLogChannels.<NEW_LINE>*<NEW_LINE>* Because of performance/optimizations concerns the cleanup maintenance<NEW_LINE>* operations wont happen automatically, for more info on eviction cleanup<NEW_LINE>* maintenance tasks -<NEW_LINE>* https://google.github.io/guava/releases/19.0/api/docs/com/google/<NEW_LINE>* common/cache/CacheBuilder.html<NEW_LINE>*<NEW_LINE>*/<NEW_LINE>private void onCacheEntryRemoval(RemovalNotification<Long, EntryLogAndLockTuple> removedLedgerEntryLogMapEntry) {<NEW_LINE>Long ledgerId = removedLedgerEntryLogMapEntry.getKey();<NEW_LINE>log.debug("LedgerId {} is being evicted from the cache map because of {}", ledgerId, removedLedgerEntryLogMapEntry.getCause());<NEW_LINE>EntryLogAndLockTuple entryLogAndLockTuple = removedLedgerEntryLogMapEntry.getValue();<NEW_LINE>if (entryLogAndLockTuple == null) {<NEW_LINE>log.error("entryLogAndLockTuple is not supposed to be null in entry removal listener for ledger : {}", ledgerId);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Lock lock = entryLogAndLockTuple.ledgerLock;<NEW_LINE>BufferedLogChannelWithDirInfo logChannelWithDirInfo = entryLogAndLockTuple.getEntryLogWithDirInfo();<NEW_LINE>if (logChannelWithDirInfo == null) {<NEW_LINE><MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>lock.lock();<NEW_LINE>try {<NEW_LINE>BufferedLogChannel logChannel = logChannelWithDirInfo.getLogChannel();<NEW_LINE>// Append ledgers map at the end of entry log<NEW_LINE>try {<NEW_LINE>logChannel.appendLedgersMap();<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.error("Got IOException while trying to appendLedgersMap in cacheEntryRemoval callback", e);<NEW_LINE>}<NEW_LINE>replicaOfCurrentLogChannels.remove(logChannel.getLogId());<NEW_LINE>rotatedLogChannels.add(logChannel);<NEW_LINE>entryLogsPerLedgerCounter.removedLedgerFromEntryLogMapCache(ledgerId, removedLedgerEntryLogMapEntry.getCause());<NEW_LINE>} finally {<NEW_LINE>lock.unlock();<NEW_LINE>}<NEW_LINE>} | log.error("logChannel for ledger: {} is not supposed to be null in entry removal listener", ledgerId); |
694,093 | private void populateSubMap(NavigableMap subMap, FieldValues fieldValues, int startIndex) {<NEW_LINE>if (startIndex >= fieldValues.getValues().size())<NEW_LINE>return;<NEW_LINE>Pair<String, Object> pair = fieldValues.getValues().get(startIndex);<NEW_LINE><MASK><NEW_LINE>DBValue dbValue;<NEW_LINE>if (value == null) {<NEW_LINE>dbValue = DBNull.getInstance();<NEW_LINE>} else {<NEW_LINE>if (Iterable.class.isAssignableFrom(value.getClass()) || value.getClass().isArray()) {<NEW_LINE>throw new IndexingException("compound multikey index is supported on the first field of the index only");<NEW_LINE>}<NEW_LINE>if (!(value instanceof Comparable)) {<NEW_LINE>throw new IndexingException(value + " is not comparable");<NEW_LINE>}<NEW_LINE>dbValue = new DBValue((Comparable<?>) value);<NEW_LINE>}<NEW_LINE>if (startIndex == fieldValues.getValues().size() - 1) {<NEW_LINE>// terminal field<NEW_LINE>List<NitriteId> nitriteIds = (List<NitriteId>) subMap.get(dbValue);<NEW_LINE>nitriteIds = addNitriteIds(nitriteIds, fieldValues);<NEW_LINE>subMap.put(dbValue, nitriteIds);<NEW_LINE>} else {<NEW_LINE>// intermediate fields<NEW_LINE>NavigableMap subMap2 = (NavigableMap) subMap.get(dbValue);<NEW_LINE>if (subMap2 == null) {<NEW_LINE>// index are always in ascending order<NEW_LINE>subMap2 = new ConcurrentSkipListMap<>();<NEW_LINE>}<NEW_LINE>subMap.put(dbValue, subMap2);<NEW_LINE>populateSubMap(subMap2, fieldValues, startIndex + 1);<NEW_LINE>}<NEW_LINE>} | Object value = pair.getSecond(); |
1,814,029 | private void handleFeatureParameters() {<NEW_LINE>Parameter[] parameters = whereBlock.getParent().getAst().getParameters();<NEW_LINE>Map<Boolean, List<Parameter>> declaredParameters = Arrays.stream(parameters).collect(partitioningBy(parameter -> isDataProcessorVariable(parameter.getName())));<NEW_LINE>Map<String, Parameter> declaredDataVariableParameters = declaredParameters.get(TRUE).stream().collect(toMap(Parameter::getName, identity()));<NEW_LINE>List<Parameter> auxiliaryParameters = declaredParameters.get(FALSE);<NEW_LINE>List<Parameter> newParameters = new ArrayList<>(dataProcessorVars.size() + auxiliaryParameters.size());<NEW_LINE>// first all data variables in order of where block<NEW_LINE>for (VariableExpression dataProcessorVar : dataProcessorVars) {<NEW_LINE>String name = dataProcessorVar.getName();<NEW_LINE>Parameter declaredDataVariableParameter = declaredDataVariableParameters.get(name);<NEW_LINE>newParameters.add(declaredDataVariableParameter == null ? new Parameter(ClassHelper.OBJECT_TYPE, name) : declaredDataVariableParameter);<NEW_LINE>}<NEW_LINE>// then all auxiliary parameters in declaration order<NEW_LINE>newParameters.addAll(auxiliaryParameters);<NEW_LINE>whereBlock.getParent().getAst().setParameters(newParameters<MASK><NEW_LINE>} | .toArray(Parameter.EMPTY_ARRAY)); |
13,614 | public void run() {<NEW_LINE>try {<NEW_LINE>if (!isRunning) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Map<String, MessageId> currentOffsetsCopy;<NEW_LINE>synchronized (context.getCheckpointLock()) {<NEW_LINE>currentOffsetsCopy = new HashMap<>(currentOffsets);<NEW_LINE>}<NEW_LINE>for (Map.Entry<String, MessageId> entry : currentOffsetsCopy.entrySet()) {<NEW_LINE>String topicPartition = entry.getKey();<NEW_LINE>MessageId currentOffset = currentOffsetsCopy.get(topicPartition);<NEW_LINE>MessageId lastCommittedOffset = lastCommittedOffsets.get(topicPartition);<NEW_LINE>// Skips the committing if the offset is not changed.<NEW_LINE>if (Objects.equals(currentOffset, lastCommittedOffset)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>PulsarUtils.commitTopicPartitionOffset(admin, topicPartition, currentOffset, consumerGroup);<NEW_LINE>lastCommittedOffsets.put(topicPartition, currentOffset);<NEW_LINE>}<NEW_LINE>} catch (Throwable throwable) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | LOG.warn("Could not properly commit the offset.", throwable); |
1,851,184 | /*<NEW_LINE>* (non-Javadoc)<NEW_LINE>* @see javax.swing.text.DefaultCaret#paint(java.awt.Graphics)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public void paint(Graphics g) {<NEW_LINE>JTextComponent comp = getComponent();<NEW_LINE>if (comp == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int dot = getDot();<NEW_LINE>Rectangle r;<NEW_LINE>char dotChar;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>if (r == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>dotChar = comp.getText(dot, 1).charAt(0);<NEW_LINE>} catch (BadLocationException e) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (Character.isWhitespace(dotChar)) {<NEW_LINE>dotChar = '_';<NEW_LINE>}<NEW_LINE>if ((x != r.x) || (y != r.y)) {<NEW_LINE>// paint() has been called directly, without a previous call to<NEW_LINE>// damage(), so do some cleanup. (This happens, for example, when<NEW_LINE>// the text component is resized.)<NEW_LINE>damage(r);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>g.setColor(comp.getCaretColor());<NEW_LINE>// do this to draw in XOR mode<NEW_LINE>g.setXORMode(comp.getBackground());<NEW_LINE>width = g.getFontMetrics().charWidth(dotChar);<NEW_LINE>if (isVisible()) {<NEW_LINE>r.height = 2;<NEW_LINE>r.y = r.y + g.getFontMetrics().getHeight() - r.height - 1;<NEW_LINE>g.fillRect(r.x, r.y, width, r.height);<NEW_LINE>}<NEW_LINE>} | r = comp.modelToView(dot); |
1,708,504 | private static // TODO(hw): integer or long?<NEW_LINE>Map<Integer, List<Tablet.Dimension>> buildDimensions(CSVRecord record, Map<Integer, List<Integer>> keyIndexMap, int pidNum) {<NEW_LINE>Map<Integer, List<Tablet.Dimension>> dims = new HashMap<>();<NEW_LINE>int pid = 0;<NEW_LINE>for (Map.Entry<Integer, List<Integer>> entry : keyIndexMap.entrySet()) {<NEW_LINE>Integer index = entry.getKey();<NEW_LINE>List<Integer> keyCols = entry.getValue();<NEW_LINE>String combinedKey = keyCols.stream().map(record::get).collect<MASK><NEW_LINE>if (pidNum > 0) {<NEW_LINE>pid = (int) Math.abs(MurmurHash.hash64(combinedKey) % pidNum);<NEW_LINE>}<NEW_LINE>List<Tablet.Dimension> dim = dims.getOrDefault(pid, new ArrayList<>());<NEW_LINE>dim.add(Tablet.Dimension.newBuilder().setKey(combinedKey).setIdx(index).build());<NEW_LINE>dims.put(pid, dim);<NEW_LINE>}<NEW_LINE>return dims;<NEW_LINE>} | (Collectors.joining("|")); |
149,946 | protected void now(final IUser teleportee, final ITarget target, final TeleportCause cause) throws Exception {<NEW_LINE>cancel(false);<NEW_LINE>Location loc = target.getLocation();<NEW_LINE>final PreTeleportEvent event = new PreTeleportEvent(teleportee, cause, target);<NEW_LINE>Bukkit.getServer().getPluginManager().callEvent(event);<NEW_LINE>if (event.isCancelled()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (teleportee.isAuthorized("essentials.back.onteleport")) {<NEW_LINE>teleportee.setLastLocation();<NEW_LINE>}<NEW_LINE>if (!teleportee.getBase().isEmpty()) {<NEW_LINE>if (!ess.getSettings().isTeleportPassengerDismount()) {<NEW_LINE>throw new Exception(tl("passengerTeleportFail"));<NEW_LINE>}<NEW_LINE>teleportee.getBase().eject();<NEW_LINE>}<NEW_LINE>if (LocationUtil.isBlockUnsafeForUser(ess, teleportee, loc.getWorld(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ())) {<NEW_LINE>if (ess.getSettings().isTeleportSafetyEnabled()) {<NEW_LINE>if (ess.getSettings().isForceDisableTeleportSafety()) {<NEW_LINE>PaperLib.teleportAsync(teleportee.getBase(), loc, cause);<NEW_LINE>} else {<NEW_LINE>PaperLib.teleportAsync(teleportee.getBase(), LocationUtil.getSafeDestination(ess, teleportee, loc), cause);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new Exception(tl("unsafeTeleportDestination", loc.getWorld().getName(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (ess.getSettings().isForceDisableTeleportSafety()) {<NEW_LINE>PaperLib.teleportAsync(teleportee.getBase(), loc, cause);<NEW_LINE>} else {<NEW_LINE>if (ess.getSettings().isTeleportToCenterLocation()) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>PaperLib.teleportAsync(teleportee.getBase(), loc, cause);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | loc = LocationUtil.getRoundedDestination(loc); |
1,362,014 | protected void validate(Element element, ElementValidation validation) {<NEW_LINE>if (element.getKind() == ElementKind.METHOD || element.getKind() == ElementKind.PARAMETER) {<NEW_LINE>ExecutableElement methodElement = (ExecutableElement) (element.getKind() == ElementKind.METHOD ? element : element.getEnclosingElement());<NEW_LINE>validatorHelper.param.extendsAnyOfTypes(CanonicalNameConstants.VIEW_DATA_BINDING, CanonicalNameConstants.ANDROIDX_VIEW_DATA_BINDING).validate(methodElement, validation);<NEW_LINE>if (!validation.isValid()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>injectHelper.validate(BindingObject.class, element, validation);<NEW_LINE>if (validation.isValid()) {<NEW_LINE><MASK><NEW_LINE>validatorHelper.extendsOneOfTypes(injectHelper.getParam(element), asList(CanonicalNameConstants.VIEW_DATA_BINDING, CanonicalNameConstants.ANDROIDX_VIEW_DATA_BINDING), validation);<NEW_LINE>}<NEW_LINE>} | validatorHelper.isNotPrivate(element, validation); |
693,407 | /*<NEW_LINE>* @see<NEW_LINE>* com.sitewhere.microservice.api.device.IDeviceManagement#createCustomerType(<NEW_LINE>* com.sitewhere.spi.customer.request.ICustomerTypeCreateRequest)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public ICustomerType createCustomerType(ICustomerTypeCreateRequest request) throws SiteWhereException {<NEW_LINE>List<RdbCustomerType> contained = new ArrayList<>();<NEW_LINE>if (request.getContainedCustomerTypeTokens() != null) {<NEW_LINE>for (String token : request.getContainedCustomerTypeTokens()) {<NEW_LINE>contained<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Use common logic to load assignment from request.<NEW_LINE>CustomerType customerType = DeviceManagementPersistence.customerTypeCreateLogic(request);<NEW_LINE>RdbCustomerType created = new RdbCustomerType();<NEW_LINE>RdbCustomerType.copy(customerType, created);<NEW_LINE>created.setContainedCustomerTypes(contained);<NEW_LINE>return getEntityManagerProvider().persist(created);<NEW_LINE>} | .add(getCustomerTypeByToken(token)); |
560,472 | private void doRefreshMetadata(long timeoutMs) {<NEW_LINE><MASK><NEW_LINE>long remaining = timeoutMs;<NEW_LINE>Cluster beforeUpdate = cluster();<NEW_LINE>boolean isMetadataUpdated = _metadata.updateVersion() > updateVersion;<NEW_LINE>while (!isMetadataUpdated && remaining > 0) {<NEW_LINE>_metadata.requestUpdate();<NEW_LINE>long start = _time.milliseconds();<NEW_LINE>_networkClient.poll(remaining, start);<NEW_LINE>remaining -= (_time.milliseconds() - start);<NEW_LINE>isMetadataUpdated = _metadata.updateVersion() > updateVersion;<NEW_LINE>}<NEW_LINE>if (isMetadataUpdated) {<NEW_LINE>if (LOG.isDebugEnabled()) {<NEW_LINE>LOG.debug("Updated metadata {}", cluster());<NEW_LINE>}<NEW_LINE>if (MonitorUtils.metadataChanged(beforeUpdate, cluster())) {<NEW_LINE>_metadataGeneration.incrementAndGet();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>LOG.warn("Failed to update metadata in {}ms. Using old metadata with version {} and last successful update {}.", timeoutMs, _metadata.updateVersion(), _metadata.lastSuccessfulUpdate());<NEW_LINE>}<NEW_LINE>} | int updateVersion = _metadata.requestUpdate(); |
697,389 | public void handleOutboundPuback(@NotNull final ChannelHandlerContext ctx, @NotNull final PUBACK puback, @NotNull final ChannelPromise promise) {<NEW_LINE>final Channel channel = ctx.channel();<NEW_LINE>final ClientConnection clientConnection = channel.attr(ChannelAttributes.CLIENT_CONNECTION).get();<NEW_LINE>final String clientId = clientConnection.getClientId();<NEW_LINE>if (clientId == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final ClientContextImpl clientContext = clientConnection.getExtensionClientContext();<NEW_LINE>if (clientContext == null) {<NEW_LINE>ctx.write(puback, promise);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final List<PubackOutboundInterceptor<MASK><NEW_LINE>if (interceptors.isEmpty()) {<NEW_LINE>ctx.write(puback, promise);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final ClientInformation clientInfo = ExtensionInformationUtil.getAndSetClientInformation(channel, clientId);<NEW_LINE>final ConnectionInformation connectionInfo = ExtensionInformationUtil.getAndSetConnectionInformation(channel);<NEW_LINE>final PubackPacketImpl packet = new PubackPacketImpl(puback);<NEW_LINE>final PubackOutboundInputImpl input = new PubackOutboundInputImpl(clientInfo, connectionInfo, packet);<NEW_LINE>final ExtensionParameterHolder<PubackOutboundInputImpl> inputHolder = new ExtensionParameterHolder<>(input);<NEW_LINE>final ModifiablePubackPacketImpl modifiablePacket = new ModifiablePubackPacketImpl(packet, configurationService);<NEW_LINE>final PubackOutboundOutputImpl output = new PubackOutboundOutputImpl(asyncer, modifiablePacket);<NEW_LINE>final ExtensionParameterHolder<PubackOutboundOutputImpl> outputHolder = new ExtensionParameterHolder<>(output);<NEW_LINE>final PubackOutboundInterceptorContext context = new PubackOutboundInterceptorContext(clientId, interceptors.size(), ctx, promise, inputHolder, outputHolder);<NEW_LINE>for (final PubackOutboundInterceptor interceptor : interceptors) {<NEW_LINE>final HiveMQExtension extension = hiveMQExtensions.getExtensionForClassloader(interceptor.getClass().getClassLoader());<NEW_LINE>if (extension == null) {<NEW_LINE>context.finishInterceptor();<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>final PubackOutboundInterceptorTask task = new PubackOutboundInterceptorTask(interceptor, extension.getId());<NEW_LINE>executorService.handlePluginInOutTaskExecution(context, inputHolder, outputHolder, task);<NEW_LINE>}<NEW_LINE>} | > interceptors = clientContext.getPubackOutboundInterceptors(); |
906,249 | public static ListAcceleratorsResponse unmarshall(ListAcceleratorsResponse listAcceleratorsResponse, UnmarshallerContext _ctx) {<NEW_LINE>listAcceleratorsResponse.setRequestId(_ctx.stringValue("ListAcceleratorsResponse.RequestId"));<NEW_LINE>listAcceleratorsResponse.setTotalCount(_ctx.integerValue("ListAcceleratorsResponse.TotalCount"));<NEW_LINE>listAcceleratorsResponse.setPageNumber(_ctx.integerValue("ListAcceleratorsResponse.PageNumber"));<NEW_LINE>listAcceleratorsResponse.setPageSize(_ctx.integerValue("ListAcceleratorsResponse.PageSize"));<NEW_LINE>List<AcceleratorsItem> accelerators = new ArrayList<AcceleratorsItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListAcceleratorsResponse.Accelerators.Length"); i++) {<NEW_LINE>AcceleratorsItem acceleratorsItem = new AcceleratorsItem();<NEW_LINE>acceleratorsItem.setAcceleratorId(_ctx.stringValue("ListAcceleratorsResponse.Accelerators[" + i + "].AcceleratorId"));<NEW_LINE>acceleratorsItem.setName(_ctx.stringValue("ListAcceleratorsResponse.Accelerators[" + i + "].Name"));<NEW_LINE>acceleratorsItem.setDescription(_ctx.stringValue("ListAcceleratorsResponse.Accelerators[" + i + "].Description"));<NEW_LINE>acceleratorsItem.setBandwidth(_ctx.integerValue("ListAcceleratorsResponse.Accelerators[" + i + "].Bandwidth"));<NEW_LINE>acceleratorsItem.setType(_ctx.stringValue("ListAcceleratorsResponse.Accelerators[" + i + "].Type"));<NEW_LINE>acceleratorsItem.setInstanceChargeType(_ctx.stringValue("ListAcceleratorsResponse.Accelerators[" + i + "].InstanceChargeType"));<NEW_LINE>acceleratorsItem.setExpiredTime(_ctx.longValue("ListAcceleratorsResponse.Accelerators[" + i + "].ExpiredTime"));<NEW_LINE>acceleratorsItem.setCenId(_ctx.stringValue("ListAcceleratorsResponse.Accelerators[" + i + "].CenId"));<NEW_LINE>acceleratorsItem.setState(_ctx.stringValue("ListAcceleratorsResponse.Accelerators[" + i + "].State"));<NEW_LINE>acceleratorsItem.setDnsName(_ctx.stringValue("ListAcceleratorsResponse.Accelerators[" + i + "].DnsName"));<NEW_LINE>acceleratorsItem.setCreateTime(_ctx.longValue("ListAcceleratorsResponse.Accelerators[" + i + "].CreateTime"));<NEW_LINE>acceleratorsItem.setRegionId(_ctx.stringValue("ListAcceleratorsResponse.Accelerators[" + i + "].RegionId"));<NEW_LINE>acceleratorsItem.setSpec(_ctx.stringValue("ListAcceleratorsResponse.Accelerators[" + i + "].Spec"));<NEW_LINE>BasicBandwidthPackage basicBandwidthPackage = new BasicBandwidthPackage();<NEW_LINE>basicBandwidthPackage.setInstanceId(_ctx.stringValue("ListAcceleratorsResponse.Accelerators[" + i + "].BasicBandwidthPackage.InstanceId"));<NEW_LINE>basicBandwidthPackage.setBandwidth(_ctx.integerValue("ListAcceleratorsResponse.Accelerators[" + i + "].BasicBandwidthPackage.Bandwidth"));<NEW_LINE>basicBandwidthPackage.setBandwidthType(_ctx.stringValue("ListAcceleratorsResponse.Accelerators[" + i + "].BasicBandwidthPackage.BandwidthType"));<NEW_LINE>acceleratorsItem.setBasicBandwidthPackage(basicBandwidthPackage);<NEW_LINE>CrossDomainBandwidthPackage crossDomainBandwidthPackage = new CrossDomainBandwidthPackage();<NEW_LINE>crossDomainBandwidthPackage.setInstanceId(_ctx.stringValue("ListAcceleratorsResponse.Accelerators[" + i + "].CrossDomainBandwidthPackage.InstanceId"));<NEW_LINE>crossDomainBandwidthPackage.setBandwidth(_ctx.integerValue<MASK><NEW_LINE>acceleratorsItem.setCrossDomainBandwidthPackage(crossDomainBandwidthPackage);<NEW_LINE>accelerators.add(acceleratorsItem);<NEW_LINE>}<NEW_LINE>listAcceleratorsResponse.setAccelerators(accelerators);<NEW_LINE>return listAcceleratorsResponse;<NEW_LINE>} | ("ListAcceleratorsResponse.Accelerators[" + i + "].CrossDomainBandwidthPackage.Bandwidth")); |
791,215 | public void onClick(View v) {<NEW_LINE>if (currentId.equals(id)) {<NEW_LINE>// Back to all<NEW_LINE>resetAssignedFilter();<NEW_LINE>} else {<NEW_LINE>// New filter<NEW_LINE>currentId = id;<NEW_LINE>Criterion assignedCriterion;<NEW_LINE>if (ActFmPreferenceService.userId().equals(currentId))<NEW_LINE>assignedCriterion = Criterion.or(Task.USER_ID.eq(0), Task.USER_ID.eq(id));<NEW_LINE>else if (Task.userIdIsEmail(currentId) && !TextUtils.isEmpty(email))<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$ // Deprecated field OK for backwards compatibility<NEW_LINE>assignedCriterion = Criterion.or(Task.USER_ID.eq(email), Task.USER.like("%" + email + "%"));<NEW_LINE>else<NEW_LINE>assignedCriterion = Task.USER_ID.eq(id);<NEW_LINE>Criterion assigned = Criterion.and(TaskCriteria.activeAndVisible(), assignedCriterion);<NEW_LINE>filter = TagFilterExposer.filterFromTag(getActivity(), new Tag(tagData), assigned);<NEW_LINE>TextView filterByAssigned = (TextView) getView().findViewById(R.id.filter_assigned);<NEW_LINE>if (filterByAssigned != null) {<NEW_LINE>filterByAssigned.setVisibility(View.VISIBLE);<NEW_LINE>if (id == Task.USER_ID_UNASSIGNED)<NEW_LINE>filterByAssigned.setText(getString<MASK><NEW_LINE>else<NEW_LINE>filterByAssigned.setText(getString(R.string.actfm_TVA_filtered_by_assign, displayName));<NEW_LINE>}<NEW_LINE>isBeingFiltered.set(true);<NEW_LINE>setUpTaskList();<NEW_LINE>}<NEW_LINE>} | (R.string.actfm_TVA_filter_by_unassigned)); |
398,626 | private void refresh() {<NEW_LINE>Object[] temp = ActivitiesManager.getMostRecentUnseen();<NEW_LINE>ActivitiesEntry entry = (ActivitiesEntry) temp[0];<NEW_LINE>String old_text = (String) notification_text.getData();<NEW_LINE>if (entry == null) {<NEW_LINE>notification_icon.setImage(null);<NEW_LINE>if (old_text.length() > 0) {<NEW_LINE>notification_text.setData("");<NEW_LINE>notification_text.redraw();<NEW_LINE>}<NEW_LINE>more_text.setText("");<NEW_LINE>} else {<NEW_LINE>String cur_text = entry.getText();<NEW_LINE>if (!old_text.equals(cur_text)) {<NEW_LINE>notification_text.setData(cur_text);<NEW_LINE>notification_text.redraw();<NEW_LINE>}<NEW_LINE>String icon_id = entry.getIconID();<NEW_LINE>if (icon_id != null) {<NEW_LINE>String existing = (String) notification_icon.getData();<NEW_LINE>if (existing == null || notification_icon.getImage() == null || !existing.equals(icon_id)) {<NEW_LINE>ImageLoader imageLoader = ImageLoader.getInstance();<NEW_LINE>if (existing != null) {<NEW_LINE>imageLoader.releaseImage(existing);<NEW_LINE>}<NEW_LINE>Image image = imageLoader.getImage(icon_id);<NEW_LINE>notification_icon.setImage(image);<NEW_LINE>notification_icon.setData(icon_id);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>notification_icon.setImage(null);<NEW_LINE>}<NEW_LINE>int num = (Integer) temp[1];<NEW_LINE>if (num <= 1) {<NEW_LINE>more_text.setText("");<NEW_LINE>} else {<NEW_LINE>more_text.setText(MessageText.getString("popup.more.waiting", new String[] { String.valueOf<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | (num - 1) })); |
26,615 | private static boolean isSafeEquals(Tuple<Set<Var>> varsByPosition, Var left, Var right) {<NEW_LINE>// For equality based joins ensure at least one variable must be<NEW_LINE>// used in graph/subject/predicate position thus guaranteeing it to<NEW_LINE>// not be a literal so replacing with term equality by ways of<NEW_LINE>// substitution will be safe<NEW_LINE>// Should get 5 sets<NEW_LINE>if (varsByPosition.len() != 5)<NEW_LINE>return false;<NEW_LINE>// If anything is used in the object/unknown position then we<NEW_LINE>// potentially have an issue unless it is also used in a safe<NEW_LINE>// position<NEW_LINE>Set<Var> safeVars = new HashSet<>();<NEW_LINE>safeVars.addAll(varsByPosition.get(0));<NEW_LINE>safeVars.addAll(varsByPosition.get(1));<NEW_LINE>safeVars.addAll(varsByPosition.get(2));<NEW_LINE>Set<Var> unsafeVars = new HashSet<>();<NEW_LINE>unsafeVars.addAll(varsByPosition.get(3));<NEW_LINE>unsafeVars.addAll(varsByPosition.get(4));<NEW_LINE><MASK><NEW_LINE>if (unsafeVars.size() > 0) {<NEW_LINE>if (unsafeVars.contains(left)) {<NEW_LINE>// LHS Variable occurred in unsafe position<NEW_LINE>if (!safeVars.contains(left)) {<NEW_LINE>// LHS Variable is unsafe<NEW_LINE>lhsSafe = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (unsafeVars.contains(right)) {<NEW_LINE>// RHS Variable occurred in unsafe position<NEW_LINE>if (!safeVars.contains(right)) {<NEW_LINE>// RHS Variable is unsafe<NEW_LINE>rhsSafe = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// At least one variable must be safe or this equality expression is<NEW_LINE>// not an implicit join that can be safely optimized<NEW_LINE>return lhsSafe || rhsSafe;<NEW_LINE>} | boolean lhsSafe = true, rhsSafe = true; |
608,209 | public Object apply(final Object context, final Options options) throws IOException {<NEW_LINE>if (context == null) {<NEW_LINE>return options.hash("default", "");<NEW_LINE>}<NEW_LINE>String viewName = options.hash("view", "");<NEW_LINE>JsonGenerator generator = null;<NEW_LINE>try {<NEW_LINE>final ObjectWriter writer;<NEW_LINE>// do we need to use a view?<NEW_LINE>if (!Handlebars.Utils.isEmpty(viewName)) {<NEW_LINE>Class<?> viewClass = alias.get(viewName);<NEW_LINE>if (viewClass == null) {<NEW_LINE>viewClass = getClass().getClassLoader().loadClass(viewName);<NEW_LINE>}<NEW_LINE>writer = mapper.writerWithView(viewClass);<NEW_LINE>} else {<NEW_LINE>writer = mapper.writer();<NEW_LINE>}<NEW_LINE>JsonFactory jsonFactory = mapper.getFactory();<NEW_LINE>SegmentedStringWriter output = new SegmentedStringWriter(jsonFactory._getBufferRecycler());<NEW_LINE>// creates a json generator.<NEW_LINE>generator = jsonFactory.createJsonGenerator(output);<NEW_LINE>Boolean escapeHtml = options.hash("escapeHTML", Boolean.FALSE);<NEW_LINE>// do we need to escape html?<NEW_LINE>if (escapeHtml) {<NEW_LINE>generator<MASK><NEW_LINE>}<NEW_LINE>Boolean pretty = options.hash("pretty", Boolean.FALSE);<NEW_LINE>// write the JSON output.<NEW_LINE>if (pretty) {<NEW_LINE>writer.withDefaultPrettyPrinter().writeValue(generator, context);<NEW_LINE>} else {<NEW_LINE>writer.writeValue(generator, context);<NEW_LINE>}<NEW_LINE>generator.close();<NEW_LINE>return new Handlebars.SafeString(output.getAndClear());<NEW_LINE>} catch (ClassNotFoundException ex) {<NEW_LINE>throw new IllegalArgumentException(viewName, ex);<NEW_LINE>} finally {<NEW_LINE>if (generator != null && !generator.isClosed()) {<NEW_LINE>generator.close();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .setCharacterEscapes(new HtmlEscapes()); |
44,076 | private void zeroMeanWorldPoints(List<AssociatedPair> points) {<NEW_LINE>center.setTo(0, 0);<NEW_LINE>pointsAdj.reset();<NEW_LINE>for (int i = 0; i < points.size(); i++) {<NEW_LINE>AssociatedPair pair = points.get(i);<NEW_LINE>Point2D_F64 p = pair.p1;<NEW_LINE>pointsAdj.grow().p2.setTo(pair.p2);<NEW_LINE>center.x += p.x;<NEW_LINE>center.y += p.y;<NEW_LINE>}<NEW_LINE>center.x /= points.size();<NEW_LINE>center.y /= points.size();<NEW_LINE>for (int i = 0; i < points.size(); i++) {<NEW_LINE>Point2D_F64 p = points.get(i).p1;<NEW_LINE>pointsAdj.get(i).p1.setTo(p.x - center.x, <MASK><NEW_LINE>}<NEW_LINE>} | p.y - center.y); |
728,104 | public void marshall(CreateLicenseConfigurationRequest createLicenseConfigurationRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (createLicenseConfigurationRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(createLicenseConfigurationRequest.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(createLicenseConfigurationRequest.getDescription(), DESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(createLicenseConfigurationRequest.getLicenseCountingType(), LICENSECOUNTINGTYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(createLicenseConfigurationRequest.getLicenseCount(), LICENSECOUNT_BINDING);<NEW_LINE>protocolMarshaller.marshall(createLicenseConfigurationRequest.getLicenseCountHardLimit(), LICENSECOUNTHARDLIMIT_BINDING);<NEW_LINE>protocolMarshaller.marshall(createLicenseConfigurationRequest.getLicenseRules(), LICENSERULES_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(createLicenseConfigurationRequest.getDisassociateWhenNotFound(), DISASSOCIATEWHENNOTFOUND_BINDING);<NEW_LINE>protocolMarshaller.marshall(createLicenseConfigurationRequest.getProductInformationList(), PRODUCTINFORMATIONLIST_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | createLicenseConfigurationRequest.getTags(), TAGS_BINDING); |
326,167 | public // region bulk<NEW_LINE>BulkRequest bulkRequest(List<?> queries, BulkOptions bulkOptions, IndexCoordinates index) {<NEW_LINE>BulkRequest bulkRequest = new BulkRequest();<NEW_LINE>if (bulkOptions.getTimeout() != null) {<NEW_LINE>bulkRequest.timeout(TimeValue.timeValueMillis(bulkOptions.getTimeout().toMillis()));<NEW_LINE>}<NEW_LINE>if (bulkOptions.getRefreshPolicy() != null) {<NEW_LINE>bulkRequest.setRefreshPolicy(toElasticsearchRefreshPolicy(bulkOptions.getRefreshPolicy()));<NEW_LINE>}<NEW_LINE>if (bulkOptions.getWaitForActiveShards() != null) {<NEW_LINE>bulkRequest.waitForActiveShards(ActiveShardCount.from(bulkOptions.getWaitForActiveShards().getValue()));<NEW_LINE>}<NEW_LINE>if (bulkOptions.getPipeline() != null) {<NEW_LINE>bulkRequest.pipeline(bulkOptions.getPipeline());<NEW_LINE>}<NEW_LINE>if (bulkOptions.getRoutingId() != null) {<NEW_LINE>bulkRequest.routing(bulkOptions.getRoutingId());<NEW_LINE>}<NEW_LINE>queries.forEach(query -> {<NEW_LINE>if (query instanceof IndexQuery) {<NEW_LINE>bulkRequest.add(indexRequest((IndexQuery) query, index));<NEW_LINE>} else if (query instanceof UpdateQuery) {<NEW_LINE>bulkRequest.add(updateRequest(<MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>return bulkRequest;<NEW_LINE>} | (UpdateQuery) query, index)); |
335,416 | private Point parsePoint() {<NEW_LINE>double x = data.getDouble();<NEW_LINE>double y = data.getDouble();<NEW_LINE>double z = Double.NaN;<NEW_LINE>double m = Double.NaN;<NEW_LINE>if (xyzmMode.hasZ()) {<NEW_LINE>z = data.getDouble();<NEW_LINE>}<NEW_LINE>if (xyzmMode.hasM()) {<NEW_LINE>m = data.getDouble();<NEW_LINE>}<NEW_LINE>CoordinateSequenceFactory csf = factory.getCoordinateSequenceFactory();<NEW_LINE>if (Double.isNaN(x)) {<NEW_LINE>CoordinateSequence cs = csf.create(0, dimension, xyzmMode.hasM() ? 1 : 0);<NEW_LINE>return factory.createPoint(cs);<NEW_LINE>}<NEW_LINE>CoordinateSequence cs = csf.create(1, dimension, xyzmMode.hasM() ? 1 : 0);<NEW_LINE>cs.getCoordinate<MASK><NEW_LINE>cs.getCoordinate(0).setY(y);<NEW_LINE>if (xyzmMode.hasZ()) {<NEW_LINE>cs.getCoordinate(0).setZ(z);<NEW_LINE>}<NEW_LINE>if (xyzmMode.hasM()) {<NEW_LINE>cs.getCoordinate(0).setM(m);<NEW_LINE>}<NEW_LINE>return factory.createPoint(cs);<NEW_LINE>} | (0).setX(x); |
205,192 | public static ShardId selectSplitShard(int shardId, IndexMetaData sourceIndexMetadata, int numTargetShards) {<NEW_LINE>if (shardId >= numTargetShards) {<NEW_LINE>throw new IllegalArgumentException("the number of target shards (" + numTargetShards + ") must be greater than the shard id: " + shardId);<NEW_LINE>}<NEW_LINE>int numSourceShards = sourceIndexMetadata.getNumberOfShards();<NEW_LINE>if (numSourceShards > numTargetShards) {<NEW_LINE>throw new IllegalArgumentException("the number of source shards [" + <MASK><NEW_LINE>}<NEW_LINE>int routingFactor = getRoutingFactor(numSourceShards, numTargetShards);<NEW_LINE>// now we verify that the numRoutingShards is valid in the source index<NEW_LINE>int routingNumShards = sourceIndexMetadata.getRoutingNumShards();<NEW_LINE>if (routingNumShards % numTargetShards != 0) {<NEW_LINE>throw new IllegalStateException("the number of routing shards [" + routingNumShards + "] must be a multiple of the target shards [" + numTargetShards + "]");<NEW_LINE>}<NEW_LINE>// this is just an additional assertion that ensures we are a factor of the routing num shards.<NEW_LINE>assert getRoutingFactor(numTargetShards, sourceIndexMetadata.getRoutingNumShards()) >= 0;<NEW_LINE>return new ShardId(sourceIndexMetadata.getIndex(), shardId / routingFactor);<NEW_LINE>} | numSourceShards + "] must be less that the number of target shards [" + numTargetShards + "]"); |
1,759,902 | public Object combine(JRCalculable calculable, JRCalculable calculableValue, AbstractValueProvider valueProvider) {<NEW_LINE>Number value = (Number) calculable.getIncrementedValue();<NEW_LINE>if (calculableValue.getValue() == null) {<NEW_LINE>if (calculable.isInitialized()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return value;<NEW_LINE>} else if (value == null || calculable.isInitialized()) {<NEW_LINE>return ((Number) calculableValue.getIncrementedValue()).shortValue();<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>float c1 = ((Number) valueProvider.getValue(calculable.getHelperVariable(JRCalculable.HELPER_COUNT))).floatValue();<NEW_LINE>float s1 = ((Number) valueProvider.getValue(calculable.getHelperVariable(JRCalculable.HELPER_SUM))).floatValue();<NEW_LINE>float v2 = ((Number) calculableValue.getIncrementedValue()).floatValue();<NEW_LINE>float c2 = ((Number) valueProvider.getValue(calculableValue.getHelperVariable(JRCalculable.HELPER_COUNT))).floatValue();<NEW_LINE>float s2 = ((Number) valueProvider.getValue(calculableValue.getHelperVariable(JRCalculable.HELPER_SUM))).floatValue();<NEW_LINE>c1 -= c2;<NEW_LINE>s1 -= s2;<NEW_LINE>float c = c1 + c2;<NEW_LINE>return (short) (c1 / c * v1 + c2 / c * v2 + c2 / c1 * s1 / c * s1 / c + c1 / c2 * s2 / c * s2 / c - 2 * s1 / c * s2 / c);<NEW_LINE>} | float v1 = value.floatValue(); |
674,189 | protected Collection<Method> toMethods(SootClass clazz) {<NEW_LINE>if (clazz.getMethods().isEmpty()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>String classType = SootToDexUtils.getDexTypeDescriptor(clazz.getType());<NEW_LINE>List<Method> methods = new ArrayList<Method>();<NEW_LINE>for (SootMethod sm : clazz.getMethods()) {<NEW_LINE>if (isIgnored(sm)) {<NEW_LINE>// Do not print method bodies for inherited methods<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>MethodImplementation impl;<NEW_LINE>try {<NEW_LINE>impl = toMethodImplementation(sm);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new DexPrinterException("Error while processing method " + sm, e);<NEW_LINE>}<NEW_LINE>ParamNamesTag pnt = (ParamNamesTag) sm.getTag(ParamNamesTag.NAME);<NEW_LINE>List<String> parameterNames = pnt == null ? null : pnt.getNames();<NEW_LINE>int paramIdx = 0;<NEW_LINE>List<MethodParameter> parameters = null;<NEW_LINE>if (sm.getParameterCount() > 0) {<NEW_LINE>parameters = new ArrayList<>();<NEW_LINE>for (Type tp : sm.getParameterTypes()) {<NEW_LINE>String <MASK><NEW_LINE>parameters.add(new ImmutableMethodParameter(paramType, buildMethodParameterAnnotations(sm, paramIdx), sm.isConcrete() && parameterNames != null ? parameterNames.get(paramIdx) : null));<NEW_LINE>paramIdx++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String returnType = SootToDexUtils.getDexTypeDescriptor(sm.getReturnType());<NEW_LINE>ImmutableMethod meth = new ImmutableMethod(classType, sm.getName(), parameters, returnType, SootToDexUtils.getDexAccessFlags(sm), buildMethodAnnotations(sm), null, impl);<NEW_LINE>methods.add(meth);<NEW_LINE>}<NEW_LINE>return methods;<NEW_LINE>} | paramType = SootToDexUtils.getDexTypeDescriptor(tp); |
952,559 | public void exitRmm_route_type(Rmm_route_typeContext ctx) {<NEW_LINE>ImmutableSet.Builder<RouteMapMatchRouteType.Type> types = ImmutableSet.builder();<NEW_LINE>if (ctx.external != null) {<NEW_LINE>types.add(RouteMapMatchRouteType.Type.EXTERNAL);<NEW_LINE>}<NEW_LINE>if (ctx.internal != null) {<NEW_LINE>types.add(RouteMapMatchRouteType.Type.INTERNAL);<NEW_LINE>}<NEW_LINE>if (ctx.local != null) {<NEW_LINE>types.add(RouteMapMatchRouteType.Type.LOCAL);<NEW_LINE>}<NEW_LINE>if (ctx.nssa_external != null) {<NEW_LINE>types.<MASK><NEW_LINE>warn(ctx, "match route-type nssa-external is not currently supported");<NEW_LINE>}<NEW_LINE>if (ctx.type_1 != null) {<NEW_LINE>types.add(RouteMapMatchRouteType.Type.TYPE_1);<NEW_LINE>}<NEW_LINE>if (ctx.type_2 != null) {<NEW_LINE>types.add(RouteMapMatchRouteType.Type.TYPE_2);<NEW_LINE>}<NEW_LINE>_currentRouteMapEntry.setMatchRouteType(new RouteMapMatchRouteType(types.build()));<NEW_LINE>} | add(RouteMapMatchRouteType.Type.NSSA_EXTERNAL); |
1,005,905 | protected // ////////////////////////////////////////////////////////////<NEW_LINE>void imageImpl(PImage image, float x1, float y1, float x2, float y2, int u1, int v1, int u2, int v2) {<NEW_LINE>pushMatrix();<NEW_LINE>translate(x1, y1);<NEW_LINE>int imageWidth = image.width;<NEW_LINE>int imageHeight = image.height;<NEW_LINE>scale((x2 - x1) / imageWidth, <MASK><NEW_LINE>if (u2 - u1 == imageWidth && v2 - v1 == imageHeight) {<NEW_LINE>g2.drawImage((Image) image.getNative(), 0, 0, null);<NEW_LINE>} else {<NEW_LINE>PImage tmp = image.get(u1, v1, u2 - u1, v2 - v1);<NEW_LINE>g2.drawImage((Image) tmp.getNative(), 0, 0, null);<NEW_LINE>}<NEW_LINE>popMatrix();<NEW_LINE>} | (y2 - y1) / imageHeight); |
889,826 | public QuotaBalanceVO findLaterBalanceEntry(final Long accountId, final Long domainId, final Date afterThis) {<NEW_LINE>return Transaction.execute(TransactionLegacy.USAGE_DB, new TransactionCallback<QuotaBalanceVO>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public QuotaBalanceVO doInTransaction(final TransactionStatus status) {<NEW_LINE>List<QuotaBalanceVO> quotaBalanceEntries = new ArrayList<>();<NEW_LINE>Filter filter = new Filter(QuotaBalanceVO.class, <MASK><NEW_LINE>QueryBuilder<QuotaBalanceVO> qb = QueryBuilder.create(QuotaBalanceVO.class);<NEW_LINE>qb.and(qb.entity().getAccountId(), SearchCriteria.Op.EQ, accountId);<NEW_LINE>qb.and(qb.entity().getDomainId(), SearchCriteria.Op.EQ, domainId);<NEW_LINE>qb.and(qb.entity().getCreditsId(), SearchCriteria.Op.EQ, 0);<NEW_LINE>qb.and(qb.entity().getUpdatedOn(), SearchCriteria.Op.GT, afterThis);<NEW_LINE>quotaBalanceEntries = search(qb.create(), filter);<NEW_LINE>return quotaBalanceEntries.size() > 0 ? quotaBalanceEntries.get(0) : null;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | "updatedOn", true, 0L, 1L); |
1,503,911 | void executeDeletePendingMembership(ResourceContext ctx, String domainName, String roleName, String normalizedMember, String auditRef, String caller) {<NEW_LINE>// our exception handling code does the check for retry count<NEW_LINE>// and throws the exception it had received when the retry<NEW_LINE>// count reaches 0<NEW_LINE>for (int retryCount = defaultRetryCount; ; retryCount--) {<NEW_LINE>try (ObjectStoreConnection con = store.getConnection(true, true)) {<NEW_LINE><MASK><NEW_LINE>// first verify that auditing requirements are met<NEW_LINE>checkDomainAuditEnabled(con, domainName, auditRef, caller, principal, AUDIT_TYPE_ROLE);<NEW_LINE>// process our delete role member operation<NEW_LINE>if (!con.deletePendingRoleMember(domainName, roleName, normalizedMember, principal, auditRef)) {<NEW_LINE>con.rollbackChanges();<NEW_LINE>throw ZMSUtils.notFoundError(caller + ": unable to delete pending role member: " + normalizedMember + " from role: " + roleName, caller);<NEW_LINE>}<NEW_LINE>// update our role and domain time-stamps, and invalidate local cache entry<NEW_LINE>con.updateRoleModTimestamp(domainName, roleName);<NEW_LINE>con.updateDomainModTimestamp(domainName);<NEW_LINE>cacheStore.invalidate(domainName);<NEW_LINE>// audit log the request<NEW_LINE>auditLogRequest(ctx, domainName, auditRef, caller, ZMSConsts.HTTP_DELETE, roleName, "{\"pending-member\": \"" + normalizedMember + "\"}");<NEW_LINE>// add domain change event<NEW_LINE>addDomainChangeMessage(ctx, domainName, roleName, DomainChangeMessage.ObjectType.ROLE);<NEW_LINE>return;<NEW_LINE>} catch (ResourceException ex) {<NEW_LINE>if (!shouldRetryOperation(ex, retryCount)) {<NEW_LINE>throw ex;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | final String principal = getPrincipalName(ctx); |
1,165,814 | public void resolveRelatives() {<NEW_LINE>if (labelref == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (LabelRef ref : labelref) {<NEW_LINE>if ((ref.labelIndex >= labeldef.size()) || (labeldef.get(ref.labelIndex) == null)) {<NEW_LINE>throw new SleighException("Reference to non-existant sleigh label");<NEW_LINE>}<NEW_LINE>long res = (long) labeldef.get(ref.labelIndex) - (long) ref.opIndex;<NEW_LINE>if (ref.labelSize < 8) {<NEW_LINE>long mask = -1;<NEW_LINE>mask >>>= (8 - ref.labelSize) * 8;<NEW_LINE>res &= mask;<NEW_LINE>}<NEW_LINE>// We need to skip over op_tag, op_code, void_tag, addrsz_tag, and spc bytes<NEW_LINE>// Insert the final offset into the stream<NEW_LINE>insertOffset(<MASK><NEW_LINE>}<NEW_LINE>} | ref.streampos + 5, res); |
1,128,469 | private Mesh createFrequencyMesh(short frequency, boolean active) {<NEW_LINE>MeshBuilder meshBuilder = renderer.meshBuilder();<NEW_LINE>final AEColor[] colors = Platform.p2p().toColors(frequency);<NEW_LINE>final CubeBuilder cb = new CubeBuilder(meshBuilder.getEmitter());<NEW_LINE>cb.setTexture(this.texture);<NEW_LINE>cb.useStandardUV();<NEW_LINE>cb.setEmissiveMaterial(active);<NEW_LINE>for (int i = 0; i < 4; ++i) {<NEW_LINE>final int<MASK><NEW_LINE>for (int j = 0; j < 4; ++j) {<NEW_LINE>final AEColor col = colors[j];<NEW_LINE>// Same logic as in Biometric Card Model<NEW_LINE>if (active) {<NEW_LINE>cb.setColorRGB(col.mediumVariant);<NEW_LINE>} else {<NEW_LINE>final float scale = 0.3f / 255.0f;<NEW_LINE>cb.setColorRGB((col.blackVariant >> 16 & 0xff) * scale, (col.blackVariant >> 8 & 0xff) * scale, (col.blackVariant & 0xff) * scale);<NEW_LINE>}<NEW_LINE>final int startx = j % 2;<NEW_LINE>final int starty = 1 - j / 2;<NEW_LINE>cb.addCube(offs[0] + startx, offs[1] + starty, offs[2], offs[0] + startx + 1, offs[1] + starty + 1, offs[2] + 1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Reset back to default<NEW_LINE>cb.setEmissiveMaterial(false);<NEW_LINE>return meshBuilder.build();<NEW_LINE>} | [] offs = QUAD_OFFSETS[i]; |
1,829,548 | public void executeDmn(String decisionDefinitionId, Model model) throws AxelorException {<NEW_LINE>ProcessEngine processEngine = Beans.get(ProcessEngineService.class).getEngine();<NEW_LINE>FullContext context = new FullContext(model);<NEW_LINE>String varName = Beans.get(WkfCommonService.class).getVarName(EntityHelper.getEntity(model));<NEW_LINE>Map<String, Object> modelMap = new HashMap<String, Object>();<NEW_LINE>modelMap.put(varName, context);<NEW_LINE>DmnDecisionTableResult dmnDecisionTableResult = processEngine.getDecisionService().evaluateDecisionTableByKey(decisionDefinitionId, modelMap);<NEW_LINE>List<Map<String, Object>> result = dmnDecisionTableResult.getResultList();<NEW_LINE>DmnTable dmnTable = Beans.get(DmnTableRepository.class).all().filter("self.decisionId = ?1", decisionDefinitionId).fetchOne();<NEW_LINE>if (dmnTable != null) {<NEW_LINE>Map<String, Object> res = result.get(0);<NEW_LINE>for (DmnField dmnField : dmnTable.getOutputDmnFieldList()) {<NEW_LINE>if (dmnField.getField() != null) {<NEW_LINE>addValue(context, dmnField.getField(), res.get(dmnField<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>JpaRepository.of(EntityHelper.getEntityClass(model)).save(model);<NEW_LINE>} | .getName()), model); |
1,305,981 | void link() {<NEW_LINE>for (Map.Entry<StationElement, FeedScopedId> entry : stationElementsToStations.entrySet()) {<NEW_LINE>StationElement stationElement = entry.getKey();<NEW_LINE>FeedScopedId stationId = entry.getValue();<NEW_LINE>Station otpStation = otpStations.get(stationId);<NEW_LINE>if (otpStation == null) {<NEW_LINE>issueStore.add(new ParentStationNotFound(stationElement, stationId.getId()));<NEW_LINE>} else {<NEW_LINE>stationElement.setParentStation(otpStation);<NEW_LINE>if (stationElement instanceof Stop) {<NEW_LINE>otpStation<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (Map.Entry<BoardingArea, FeedScopedId> entry : boardingAreasToStops.entrySet()) {<NEW_LINE>BoardingArea boardingArea = entry.getKey();<NEW_LINE>FeedScopedId stopId = entry.getValue();<NEW_LINE>StationElement otpStop = otpStationElements.get(stopId);<NEW_LINE>if (!(otpStop instanceof Stop)) {<NEW_LINE>issueStore.add(new ParentStationNotFound(boardingArea, stopId.getId()));<NEW_LINE>} else {<NEW_LINE>boardingArea.setParentStop((Stop) otpStop);<NEW_LINE>((Stop) otpStop).addBoardingArea(boardingArea);<NEW_LINE>boardingArea.setParentStation(otpStop.getParentStation());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .addChildStop((Stop) stationElement); |
1,584,058 | public TransferAction prompt(final TransferItem item) {<NEW_LINE>final StringBuilder actions = new StringBuilder().append(StringUtils.LF);<NEW_LINE>final Set<TransferAction> options = new HashSet<TransferAction>(TransferAction.forTransfer(transfer));<NEW_LINE>options.add(TransferAction.cancel);<NEW_LINE>for (TransferAction a : options) {<NEW_LINE>actions.append("\t").append(a.getTitle()).append("\t").append(a.getDescription()).append(String.format(" (%s)", a.name())).append(StringUtils.LF);<NEW_LINE>}<NEW_LINE>final String input;<NEW_LINE>try {<NEW_LINE>switch(transfer) {<NEW_LINE>case download:<NEW_LINE>if (item.local.isDirectory()) {<NEW_LINE>log.warn(String.format("Skip prompt for directory %s", item));<NEW_LINE>return TransferAction.overwrite;<NEW_LINE>}<NEW_LINE>input = console.readLine("%nThe local file %s already exists. Choose what action to take:%n%s%nAction %s: ", item.local.getAbsolute(), actions, Arrays.toString(options.toArray()));<NEW_LINE>break;<NEW_LINE>case upload:<NEW_LINE>case move:<NEW_LINE>case copy:<NEW_LINE>input = console.readLine("%nThe remote file %s already exists. Choose what action to take:%n%s%nAction %s: ", item.remote.getAbsolute(), actions, Arrays.toString(options.toArray()));<NEW_LINE>break;<NEW_LINE>case sync:<NEW_LINE>input = console.readLine("%nChoose what action to take:%n%s%nAction %s: ", actions, Arrays.toString(options.toArray()));<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>return TransferAction.cancel;<NEW_LINE>}<NEW_LINE>} catch (ConnectionCanceledException e) {<NEW_LINE>return TransferAction.cancel;<NEW_LINE>}<NEW_LINE>final TransferAction <MASK><NEW_LINE>if (null == action) {<NEW_LINE>return this.prompt(item);<NEW_LINE>}<NEW_LINE>return action;<NEW_LINE>} | action = TransferAction.forName(input); |
622,730 | public static void resizeHeap(int newHeapSize) {<NEW_LINE>if (newHeapSize <= heapSize) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int newStorageSize = calculateStorageSize(newHeapSize);<NEW_LINE>int newRegionsCount = calculateRegionsCount(newHeapSize, regionSize);<NEW_LINE>int newRegionsSize = calculateRegionsSize(newRegionsCount);<NEW_LINE>Address newRegionsAddress = WasmRuntime.align(heapAddress.add(newHeapSize), 16);<NEW_LINE>Address newCardTable = WasmRuntime.align(newRegionsAddress.add(newRegionsSize), 16);<NEW_LINE>Address newStorageAddress = WasmRuntime.align(newCardTable.add(newRegionsCount), 16);<NEW_LINE>Address newMemoryLimit = WasmRuntime.align(newStorageAddress<MASK><NEW_LINE>if (newMemoryLimit != memoryLimit) {<NEW_LINE>growMemory((int) (newMemoryLimit.toLong() - memoryLimit.toLong()) / PAGE_SIZE);<NEW_LINE>memoryLimit = newMemoryLimit;<NEW_LINE>}<NEW_LINE>if (storageSize > 0) {<NEW_LINE>WasmRuntime.moveMemoryBlock(storageAddress, newStorageAddress, storageSize);<NEW_LINE>}<NEW_LINE>if (regionsSize > 0) {<NEW_LINE>WasmRuntime.moveMemoryBlock(cardTable, newCardTable, regionsCount);<NEW_LINE>WasmRuntime.moveMemoryBlock(regionsAddress, newRegionsAddress, regionsSize);<NEW_LINE>}<NEW_LINE>storageAddress = newStorageAddress;<NEW_LINE>regionsAddress = newRegionsAddress;<NEW_LINE>cardTable = newCardTable;<NEW_LINE>storageSize = newStorageSize;<NEW_LINE>regionsCount = newRegionsCount;<NEW_LINE>regionsSize = newRegionsSize;<NEW_LINE>heapSize = newHeapSize;<NEW_LINE>} | .add(newStorageSize), PAGE_SIZE); |
307,845 | private static void createEventPoolAndEvents(LevelZeroContext context, LevelZeroDevice device, ZeEventPoolHandle eventPoolHandle, int poolEventFlags, int poolSize, ZeEventHandle kernelEvent) {<NEW_LINE>ZeEventPoolDescription eventPoolDescription = new ZeEventPoolDescription();<NEW_LINE>eventPoolDescription.setCount(poolSize);<NEW_LINE>eventPoolDescription.setFlags(poolEventFlags);<NEW_LINE>int result = context.zeEventPoolCreate(context.getDefaultContextPtr(), eventPoolDescription, 1, device.getDeviceHandlerPtr(), eventPoolHandle);<NEW_LINE>LevelZeroUtils.errorLog("zeEventPoolCreate", result);<NEW_LINE>// Create Kernel Event<NEW_LINE>ZeEventDescription eventDescription = new ZeEventDescription();<NEW_LINE>eventDescription.setIndex(0);<NEW_LINE><MASK><NEW_LINE>eventDescription.setWait(ZeEventScopeFlags.ZE_EVENT_SCOPE_FLAG_HOST);<NEW_LINE>result = context.zeEventCreate(eventPoolHandle, eventDescription, kernelEvent);<NEW_LINE>LevelZeroUtils.errorLog("zeEventCreate", result);<NEW_LINE>} | eventDescription.setSignal(ZeEventScopeFlags.ZE_EVENT_SCOPE_FLAG_HOST); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.