idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
420,452
protected HttpsRequestMessage parseMessageContent() {<NEW_LINE>HttpsRequestMessage message = new HttpsRequestMessage();<NEW_LINE>String request = parseStringTill((<MASK><NEW_LINE>String[] split = request.replaceAll("\r", " ").split(" ");<NEW_LINE>if (split.length != 3) {<NEW_LINE>throw new ParserException("Could not parse as HttpsRequestMessage");<NEW_LINE>}<NEW_LINE>message.setRequestType(split[0]);<NEW_LINE>message.setRequestPath(split[1]);<NEW_LINE>message.setRequestProtocol(split[2]);<NEW_LINE>String line = parseStringTill((byte) 0x0A);<NEW_LINE>// compatible with \r\n and \n line endings<NEW_LINE>while (!line.trim().isEmpty()) {<NEW_LINE>HttpsHeaderParser parser = new HttpsHeaderParser(0, line.getBytes(Charset.forName("ASCII")));<NEW_LINE>HttpsHeader header = parser.parse();<NEW_LINE>message.getHeader().add(header);<NEW_LINE>line = parseStringTill((byte) 0x0A);<NEW_LINE>}<NEW_LINE>LOGGER.info(new String(getAlreadyParsed(), Charset.forName("ASCII")));<NEW_LINE>return message;<NEW_LINE>}
byte) 0x0A).trim();
919,027
public Stream<SimilaritySummaryResult> overlap(@Name(value = "data", defaultValue = "null") List<Map<String, Object>> data, @Name(value = "config", defaultValue = "{}") Map<String, Object> config) {<NEW_LINE>ProcedureConfiguration configuration = ProcedureConfiguration.create(config);<NEW_LINE>CategoricalInput[] inputs = prepareCategories(data, getDegreeCutoff(configuration));<NEW_LINE>String writeRelationshipType = <MASK><NEW_LINE>String writeProperty = configuration.getWriteProperty("score");<NEW_LINE>if (inputs.length == 0) {<NEW_LINE>return emptyStream(writeRelationshipType, writeProperty);<NEW_LINE>}<NEW_LINE>long[] inputIds = SimilarityInput.extractInputIds(inputs);<NEW_LINE>int[] sourceIndexIds = indexesFor(inputIds, configuration, "sourceIds");<NEW_LINE>int[] targetIndexIds = indexesFor(inputIds, configuration, "targetIds");<NEW_LINE>SimilarityComputer<CategoricalInput> computer = similarityComputer(sourceIndexIds, targetIndexIds);<NEW_LINE>SimilarityRecorder<CategoricalInput> recorder = categoricalSimilarityRecorder(computer, configuration);<NEW_LINE>double similarityCutoff = getSimilarityCutoff(configuration);<NEW_LINE>Stream<SimilarityResult> stream = topN(similarityStream(inputs, sourceIndexIds, targetIndexIds, recorder, configuration, () -> null, similarityCutoff, getTopK(configuration)), getTopN(configuration));<NEW_LINE>boolean write = configuration.isWriteFlag(false) && similarityCutoff > 0.0;<NEW_LINE>return writeAndAggregateResults(stream, inputs.length, sourceIndexIds.length, targetIndexIds.length, configuration, write, writeRelationshipType, writeProperty, recorder);<NEW_LINE>}
configuration.get("writeRelationshipType", "NARROWER_THAN");
1,665,761
synchronized public long write(JournalEntryType type, ComponentId componentId, ByteBuffer buffer) {<NEW_LINE>// Check buffer set right.<NEW_LINE>if (LOGGING) {<NEW_LINE>log("write@%-3d >> %s %s %s", position, type.name(), componentId == null ? "<null>" : componentId.label(), buffer == null ? "<null>" <MASK><NEW_LINE>}<NEW_LINE>long posn = position;<NEW_LINE>int len = -1;<NEW_LINE>int bufferLimit = -1;<NEW_LINE>int bufferPosition = -1;<NEW_LINE>if (buffer != null) {<NEW_LINE>bufferLimit = buffer.limit();<NEW_LINE>bufferPosition = buffer.position();<NEW_LINE>buffer.rewind();<NEW_LINE>len = buffer.remaining();<NEW_LINE>}<NEW_LINE>// Header: (length/4, crc/4, entry/4, component/16)<NEW_LINE>header.clear();<NEW_LINE>header.putInt(len);<NEW_LINE>// Set CRC to zero<NEW_LINE>header.putInt(0);<NEW_LINE>header.putInt(type.id);<NEW_LINE>header.put(componentId.getBytes());<NEW_LINE>header.flip();<NEW_LINE>// Need to put CRC in before writing.<NEW_LINE>Adler32 adler = new Adler32();<NEW_LINE>adler.update(header.array());<NEW_LINE>if (len > 0) {<NEW_LINE>adler.update(buffer);<NEW_LINE>buffer.rewind();<NEW_LINE>}<NEW_LINE>int crc = (int) adler.getValue();<NEW_LINE>header.putInt(posnCRC, crc);<NEW_LINE>if (LOGGING)<NEW_LINE>log("write@ -- crc = %s", Integer.toHexString(crc));<NEW_LINE>channel.write(header);<NEW_LINE>if (len > 0) {<NEW_LINE>channel.write(buffer);<NEW_LINE>buffer.position(bufferPosition);<NEW_LINE>buffer.limit(bufferLimit);<NEW_LINE>}<NEW_LINE>position += HeaderLen + len;<NEW_LINE>if (LOGGING)<NEW_LINE>log("write@%-3d << %s", position, componentId.label());<NEW_LINE>if (len > 0) {<NEW_LINE>buffer.position(bufferPosition);<NEW_LINE>buffer.limit(bufferLimit);<NEW_LINE>}<NEW_LINE>return posn;<NEW_LINE>}
: ByteBufferLib.details(buffer));
1,118,958
public LongObjectHashMap<Long> measureGroupingOnSortedNumericDocValues() throws Exception {<NEW_LINE>var weight = searcher.createWeight(new MatchAllDocsQuery(<MASK><NEW_LINE>var leaf = searcher.getTopReaderContext().leaves().get(0);<NEW_LINE>var scorer = weight.scorer(leaf);<NEW_LINE>var docValues = DocValues.getSortedNumeric(leaf.reader(), "y");<NEW_LINE>var docIt = scorer.iterator();<NEW_LINE>LongObjectHashMap<Long> sumByKey = new LongObjectHashMap<>();<NEW_LINE>for (int docId = docIt.nextDoc(); docId != DocIdSetIterator.NO_MORE_DOCS; docId = docIt.nextDoc()) {<NEW_LINE>if (docValues.advanceExact(docId)) {<NEW_LINE>if (docValues.docValueCount() == 1) {<NEW_LINE>long number = docValues.nextValue();<NEW_LINE>sumByKey.compute(number, (key, oldValue) -> {<NEW_LINE>if (oldValue == null) {<NEW_LINE>return number;<NEW_LINE>} else {<NEW_LINE>return oldValue + number;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return sumByKey;<NEW_LINE>}
), ScoreMode.COMPLETE_NO_SCORES, 1.0f);
970,070
public static void main(String[] arg) throws Exception {<NEW_LINE>// Change the value of bucket to the S3 bucket that contains your image file.<NEW_LINE>// Change the value of photo to your image file name.<NEW_LINE>String photo = "input.png";<NEW_LINE>String bucket = "bucket";<NEW_LINE>int height = 0;<NEW_LINE>int width = 0;<NEW_LINE>// Get the image from an S3 Bucket<NEW_LINE>AmazonS3 s3client = AmazonS3ClientBuilder.defaultClient();<NEW_LINE>com.amazonaws.services.s3.model.S3Object s3object = s3client.getObject(bucket, photo);<NEW_LINE>S3ObjectInputStream inputStream = s3object.getObjectContent();<NEW_LINE>BufferedImage image = ImageIO.read(inputStream);<NEW_LINE>DetectFacesRequest request = new DetectFacesRequest().withImage(new Image().withS3Object(new S3Object().withName(photo).withBucket(bucket)));<NEW_LINE>width = image.getWidth();<NEW_LINE>height = image.getHeight();<NEW_LINE>// Call DetectFaces<NEW_LINE><MASK><NEW_LINE>DetectFacesResult result = amazonRekognition.detectFaces(request);<NEW_LINE>// Show the bounding box info for each face.<NEW_LINE>List<FaceDetail> faceDetails = result.getFaceDetails();<NEW_LINE>for (FaceDetail face : faceDetails) {<NEW_LINE>BoundingBox box = face.getBoundingBox();<NEW_LINE>float left = width * box.getLeft();<NEW_LINE>float top = height * box.getTop();<NEW_LINE>System.out.println("Face:");<NEW_LINE>System.out.println("Left: " + String.valueOf((int) left));<NEW_LINE>System.out.println("Top: " + String.valueOf((int) top));<NEW_LINE>System.out.println("Face Width: " + String.valueOf((int) (width * box.getWidth())));<NEW_LINE>System.out.println("Face Height: " + String.valueOf((int) (height * box.getHeight())));<NEW_LINE>System.out.println();<NEW_LINE>}<NEW_LINE>// Create frame and panel.<NEW_LINE>JFrame frame = new JFrame("RotateImage");<NEW_LINE>frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);<NEW_LINE>DisplayFaces panel = new DisplayFaces(result, image);<NEW_LINE>panel.setPreferredSize(new Dimension(image.getWidth() / scale, image.getHeight() / scale));<NEW_LINE>frame.setContentPane(panel);<NEW_LINE>frame.pack();<NEW_LINE>frame.setVisible(true);<NEW_LINE>}
AmazonRekognition amazonRekognition = AmazonRekognitionClientBuilder.defaultClient();
1,287,632
public static WritableComparable convertToWritableComparable(Object value, FieldSpec.DataType dataType) {<NEW_LINE>if (value instanceof Number) {<NEW_LINE>Number numberValue = (Number) value;<NEW_LINE>switch(dataType) {<NEW_LINE>case INT:<NEW_LINE>return new IntWritable(numberValue.intValue());<NEW_LINE>case LONG:<NEW_LINE>return new LongWritable(numberValue.longValue());<NEW_LINE>case FLOAT:<NEW_LINE>return new FloatWritable(numberValue.floatValue());<NEW_LINE>case DOUBLE:<NEW_LINE>return new DoubleWritable(numberValue.doubleValue());<NEW_LINE>case STRING:<NEW_LINE>return new Text(numberValue.toString());<NEW_LINE>default:<NEW_LINE>throw new IllegalArgumentException("Unsupported data type: " + dataType);<NEW_LINE>}<NEW_LINE>} else if (value instanceof String) {<NEW_LINE>String stringValue = (String) value;<NEW_LINE>switch(dataType) {<NEW_LINE>case INT:<NEW_LINE>return new IntWritable(Integer.parseInt(stringValue));<NEW_LINE>case LONG:<NEW_LINE>return new LongWritable(Long.parseLong(stringValue));<NEW_LINE>case FLOAT:<NEW_LINE>return new FloatWritable(Float.parseFloat(stringValue));<NEW_LINE>case DOUBLE:<NEW_LINE>return new DoubleWritable<MASK><NEW_LINE>case STRING:<NEW_LINE>return new Text(stringValue);<NEW_LINE>default:<NEW_LINE>throw new IllegalArgumentException("Unsupported data type: " + dataType);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException(String.format("Value: %s must be either a Number or a String, found: %s", value, value.getClass()));<NEW_LINE>}<NEW_LINE>}
(Double.parseDouble(stringValue));
1,806,545
public ColumnDraft addNodeColumn(String key, Class typeClass, boolean dynamic) {<NEW_LINE>key = key.toLowerCase().trim();<NEW_LINE>ColumnDraft column = nodeColumns.get(key);<NEW_LINE><MASK><NEW_LINE>if (column == null) {<NEW_LINE>int index = nodeColumns.size();<NEW_LINE>column = new ColumnDraftImpl(key, index, dynamic, typeClass);<NEW_LINE>nodeColumns.put(key, column);<NEW_LINE>if (dynamic) {<NEW_LINE>report.log(NbBundle.getMessage(ImportContainerImpl.class, "ImportContainerLog.AddDynamicNodeColumn", key, typeClass.getSimpleName()));<NEW_LINE>} else {<NEW_LINE>report.log(NbBundle.getMessage(ImportContainerImpl.class, "ImportContainerLog.AddNodeColumn", key, typeClass.getSimpleName()));<NEW_LINE>}<NEW_LINE>} else if (!column.getTypeClass().equals(typeClass)) {<NEW_LINE>report.logIssue(new Issue(NbBundle.getMessage(ImportContainerImpl.class, "ImportContainerException_Column_Type_Mismatch", key, column.getTypeClass()), Level.SEVERE));<NEW_LINE>}<NEW_LINE>return column;<NEW_LINE>}
typeClass = AttributeUtils.getStandardizedType(typeClass);
237,953
public static DescribeSavingsPlansCoverageTotalResponse unmarshall(DescribeSavingsPlansCoverageTotalResponse describeSavingsPlansCoverageTotalResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeSavingsPlansCoverageTotalResponse.setRequestId(_ctx.stringValue("DescribeSavingsPlansCoverageTotalResponse.RequestId"));<NEW_LINE>describeSavingsPlansCoverageTotalResponse.setCode(_ctx.stringValue("DescribeSavingsPlansCoverageTotalResponse.Code"));<NEW_LINE>describeSavingsPlansCoverageTotalResponse.setMessage(_ctx.stringValue("DescribeSavingsPlansCoverageTotalResponse.Message"));<NEW_LINE>describeSavingsPlansCoverageTotalResponse.setSuccess(_ctx.booleanValue("DescribeSavingsPlansCoverageTotalResponse.Success"));<NEW_LINE>Data data = new Data();<NEW_LINE>TotalCoverage totalCoverage = new TotalCoverage();<NEW_LINE>totalCoverage.setCoveragePercentage(_ctx.floatValue("DescribeSavingsPlansCoverageTotalResponse.Data.TotalCoverage.CoveragePercentage"));<NEW_LINE>totalCoverage.setDeductAmount<MASK><NEW_LINE>data.setTotalCoverage(totalCoverage);<NEW_LINE>List<Item> periodCoverage = new ArrayList<Item>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeSavingsPlansCoverageTotalResponse.Data.PeriodCoverage.Length"); i++) {<NEW_LINE>Item item = new Item();<NEW_LINE>item.setPercentage(_ctx.floatValue("DescribeSavingsPlansCoverageTotalResponse.Data.PeriodCoverage[" + i + "].Percentage"));<NEW_LINE>item.setPeriod(_ctx.stringValue("DescribeSavingsPlansCoverageTotalResponse.Data.PeriodCoverage[" + i + "].Period"));<NEW_LINE>periodCoverage.add(item);<NEW_LINE>}<NEW_LINE>data.setPeriodCoverage(periodCoverage);<NEW_LINE>describeSavingsPlansCoverageTotalResponse.setData(data);<NEW_LINE>return describeSavingsPlansCoverageTotalResponse;<NEW_LINE>}
(_ctx.floatValue("DescribeSavingsPlansCoverageTotalResponse.Data.TotalCoverage.DeductAmount"));
1,231,018
private static JWTClaimsSet convert(JwtClaimsSet claims) {<NEW_LINE>JWTClaimsSet.Builder builder = new JWTClaimsSet.Builder();<NEW_LINE>// NOTE: The value of the 'iss' claim is a String or URL (StringOrURI).<NEW_LINE>Object issuer = claims.getClaim(JwtClaimNames.ISS);<NEW_LINE>if (issuer != null) {<NEW_LINE>builder.issuer(issuer.toString());<NEW_LINE>}<NEW_LINE>String subject = claims.getSubject();<NEW_LINE>if (StringUtils.hasText(subject)) {<NEW_LINE>builder.subject(subject);<NEW_LINE>}<NEW_LINE>List<String> audience = claims.getAudience();<NEW_LINE>if (!CollectionUtils.isEmpty(audience)) {<NEW_LINE>builder.audience(audience);<NEW_LINE>}<NEW_LINE>Instant expiresAt = claims.getExpiresAt();<NEW_LINE>if (expiresAt != null) {<NEW_LINE>builder.expirationTime(Date.from(expiresAt));<NEW_LINE>}<NEW_LINE>Instant notBefore = claims.getNotBefore();<NEW_LINE>if (notBefore != null) {<NEW_LINE>builder.notBeforeTime(Date.from(notBefore));<NEW_LINE>}<NEW_LINE>Instant issuedAt = claims.getIssuedAt();<NEW_LINE>if (issuedAt != null) {<NEW_LINE>builder.issueTime(Date.from(issuedAt));<NEW_LINE>}<NEW_LINE>String jwtId = claims.getId();<NEW_LINE>if (StringUtils.hasText(jwtId)) {<NEW_LINE>builder.jwtID(jwtId);<NEW_LINE>}<NEW_LINE>Map<String, Object> customClaims = new HashMap<>();<NEW_LINE>claims.getClaims().forEach((name, value) -> {<NEW_LINE>if (!JWTClaimsSet.getRegisteredNames().contains(name)) {<NEW_LINE>customClaims.put(name, value);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>if (!customClaims.isEmpty()) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>return builder.build();<NEW_LINE>}
customClaims.forEach(builder::claim);
1,131,987
private org.python.types.Int validateValueType(org.python.Object value) {<NEW_LINE>if (value instanceof org.python.types.Int) {<NEW_LINE>return (org<MASK><NEW_LINE>} else if (value == null || value instanceof org.python.types.NoneType) {<NEW_LINE>return null;<NEW_LINE>} else {<NEW_LINE>org.python.Object index_object = null;<NEW_LINE>boolean error_caught = false;<NEW_LINE>try {<NEW_LINE>index_object = value.__index__();<NEW_LINE>} catch (org.python.exceptions.TypeError error) {<NEW_LINE>error_caught = true;<NEW_LINE>} catch (org.python.exceptions.AttributeError error) {<NEW_LINE>error_caught = true;<NEW_LINE>}<NEW_LINE>if (error_caught) {<NEW_LINE>throw new org.python.exceptions.TypeError("slice indices must be integers or None or have an __index__ method");<NEW_LINE>}<NEW_LINE>if (index_object instanceof org.python.types.Int) {<NEW_LINE>return (org.python.types.Int) index_object;<NEW_LINE>} else {<NEW_LINE>throw new org.python.exceptions.TypeError("TypeError: __index__ returned non-int (type " + index_object.typeName() + ")");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.python.types.Int) value;
831,874
private String renderTemplate(String configurationId, Map<String, Object> sidecarContext) throws RenderTemplateException {<NEW_LINE>Writer writer = new StringWriter();<NEW_LINE>String template;<NEW_LINE>final Map<String, Object> context = new HashMap<>();<NEW_LINE>context.put("sidecar", sidecarContext);<NEW_LINE>final Map<String, Object> userContext = configurationVariableService.all().stream().collect(Collectors.toMap(ConfigurationVariable::name, ConfigurationVariable::content));<NEW_LINE>context.put(ConfigurationVariable.VARIABLE_PREFIX, userContext);<NEW_LINE>try {<NEW_LINE>Template compiledTemplate = templateConfiguration.getTemplate(configurationId);<NEW_LINE>compiledTemplate.process(context, writer);<NEW_LINE>} catch (TemplateException e) {<NEW_LINE>LOG.error("Failed to render template: " + e.getMessageWithoutStackTop());<NEW_LINE>throw new RenderTemplateException(e.getFTLInstructionStack(), e);<NEW_LINE>} catch (IOException e) {<NEW_LINE>LOG.error("Failed to render template: ", e);<NEW_LINE>throw new RenderTemplateException(<MASK><NEW_LINE>}<NEW_LINE>template = writer.toString();<NEW_LINE>return template.endsWith("\n") ? template : template + "\n";<NEW_LINE>}
e.getMessage(), e);
1,541,500
public void log(Level logLevel, byte[] message, String remoteIP, String remotePort, String localIP, String localPort) {<NEW_LINE>if (!isEnabled(logLevel) || null == message) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>// [date] [level] [clientIP:port/serverIP:port] message<NEW_LINE>StringBuilder sb = new StringBuilder(125);<NEW_LINE>// save the [date]<NEW_LINE>sb.append('[');<NEW_LINE>sb.append(HttpDispatcher.getDateFormatter().getRFC1123Time());<NEW_LINE>sb.append("] [");<NEW_LINE>sb.append(logLevel.name());<NEW_LINE>sb.append("] [");<NEW_LINE>sb.append(remoteIP);<NEW_LINE>sb.append(':');<NEW_LINE>sb.append(remotePort);<NEW_LINE>sb.append('/');<NEW_LINE>sb.append(localIP);<NEW_LINE>sb.append(':');<NEW_LINE>sb.append(localPort);<NEW_LINE>sb.append("] ");<NEW_LINE>byte[] data = HttpChannelUtils.getBytes(sb);<NEW_LINE>// now dump it into the WsByteBuffer object<NEW_LINE>WsByteBuffer wsbb = HttpDispatcher.getBufferManager().allocateDirect(data.<MASK><NEW_LINE>wsbb.put(data);<NEW_LINE>wsbb.put(message);<NEW_LINE>wsbb.put(CRLF);<NEW_LINE>wsbb.flip();<NEW_LINE>super.log(wsbb);<NEW_LINE>} catch (Throwable t) {<NEW_LINE>FFDCFilter.processException(t, getClass().getName() + ".log", "3", this);<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {<NEW_LINE>Tr.event(tc, "Error writing to log; " + t);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
length + message.length + 2);
624,565
private void registerImportErasePrefs() {<NEW_LINE>ArrayList<Preference> <MASK><NEW_LINE>preferences.add(findPreference("local_blacklist"));<NEW_LINE>preferences.add(findPreference("local_whitelist"));<NEW_LINE>preferences.add(findPreference("local_ipblacklist"));<NEW_LINE>preferences.add(findPreference("local_forwarding_rules"));<NEW_LINE>preferences.add(findPreference("local_cloaking_rules"));<NEW_LINE>preferences.add(findPreference("erase_blacklist"));<NEW_LINE>preferences.add(findPreference("erase_whitelist"));<NEW_LINE>preferences.add(findPreference("erase_ipblacklist"));<NEW_LINE>preferences.add(findPreference("erase_forwarding_rules"));<NEW_LINE>preferences.add(findPreference("erase_cloaking_rules"));<NEW_LINE>for (Preference preference : preferences) {<NEW_LINE>if (preference != null) {<NEW_LINE>preference.setOnPreferenceClickListener(this);<NEW_LINE>} else if (!appVersion.startsWith("g")) {<NEW_LINE>Log.e(LOG_TAG, "PreferencesDNSFragment preference is null exception");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
preferences = new ArrayList<>();
1,480,609
@SuppressLint("WrongConstant")<NEW_LINE>public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {<NEW_LINE>mProgressBar = view.findViewById(R.id.top_progress_bar);<NEW_LINE>mContinueButton = view.findViewById(R.id.button_continue);<NEW_LINE>mContinueButton.setOnClickListener(this);<NEW_LINE>String link = getFlowParams().emailLink;<NEW_LINE>EmailLinkParser parser = new EmailLinkParser(link);<NEW_LINE>String providerId = parser.getProviderId();<NEW_LINE>String providerName = ProviderUtils.providerIdToProviderName(providerId);<NEW_LINE>TextView body = view.findViewById(R.id.cross_device_linking_body);<NEW_LINE>String bodyText = getString(R.string.fui_email_link_cross_device_linking_text, providerName);<NEW_LINE><MASK><NEW_LINE>TextHelper.boldAllOccurencesOfText(spannableStringBuilder, bodyText, providerName);<NEW_LINE>body.setText(spannableStringBuilder);<NEW_LINE>// Justifies the text<NEW_LINE>if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {<NEW_LINE>body.setJustificationMode(android.text.Layout.JUSTIFICATION_MODE_INTER_WORD);<NEW_LINE>}<NEW_LINE>TextView footerText = view.findViewById(R.id.email_footer_tos_and_pp_text);<NEW_LINE>PrivacyDisclosureUtils.setupTermsOfServiceFooter(requireContext(), getFlowParams(), footerText);<NEW_LINE>}
SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder(bodyText);
441,533
public <T extends E> Indexed<T> append(T entry) {<NEW_LINE>// Store the entry index.<NEW_LINE>final long index = getNextIndex();<NEW_LINE>// Serialize the entry.<NEW_LINE>int position = buffer.position();<NEW_LINE>if (position + Integer.BYTES + Integer.BYTES > buffer.limit()) {<NEW_LINE>throw new BufferOverflowException();<NEW_LINE>}<NEW_LINE>buffer.position(position + Integer.BYTES + Integer.BYTES);<NEW_LINE>try {<NEW_LINE>namespace.serialize(entry, buffer);<NEW_LINE>} catch (KryoException e) {<NEW_LINE>throw new BufferOverflowException();<NEW_LINE>}<NEW_LINE>final int length = buffer.position() - (position + Integer.BYTES + Integer.BYTES);<NEW_LINE>// If the entry length exceeds the maximum entry size then throw an exception.<NEW_LINE>if (length > maxEntrySize) {<NEW_LINE>// Just reset the buffer. There's no need to zero the bytes since we haven't written the length or checksum.<NEW_LINE>buffer.position(position);<NEW_LINE>throw new StorageException.TooLarge("Entry size " + length + " exceeds maximum allowed bytes (" + maxEntrySize + ")");<NEW_LINE>}<NEW_LINE>// Compute the checksum for the entry.<NEW_LINE>final CRC32 crc32 = new CRC32();<NEW_LINE>buffer.position(position + Integer.BYTES + Integer.BYTES);<NEW_LINE>ByteBuffer slice = buffer.slice();<NEW_LINE>slice.limit(length);<NEW_LINE>crc32.update(slice);<NEW_LINE>final <MASK><NEW_LINE>// Create a single byte[] in memory for the entire entry and write it as a batch to the underlying buffer.<NEW_LINE>buffer.position(position);<NEW_LINE>buffer.putInt(length);<NEW_LINE>buffer.putInt((int) checksum);<NEW_LINE>buffer.position(position + Integer.BYTES + Integer.BYTES + length);<NEW_LINE>// Update the last entry with the correct index/term/length.<NEW_LINE>Indexed<E> indexedEntry = new Indexed<>(index, entry, length);<NEW_LINE>this.lastEntry = indexedEntry;<NEW_LINE>this.index.index(index, position);<NEW_LINE>return (Indexed<T>) indexedEntry;<NEW_LINE>}
long checksum = crc32.getValue();
240,908
private void fillContextMenu(IMenuManager manager) {<NEW_LINE>for (RunStateAction a : actions.getRunStateActions()) {<NEW_LINE>addVisible(manager, a);<NEW_LINE>}<NEW_LINE>addVisible(manager, actions.getOpenBrowserAction());<NEW_LINE>addVisible(manager, actions.getOpenNgrokAdminUi());<NEW_LINE>addVisible(manager, actions.getOpenConsoleAction());<NEW_LINE>addVisible(manager, actions.getOpenInPackageExplorerAction());<NEW_LINE>addVisible(manager, actions.getShowPropertiesViewAction());<NEW_LINE>MenuUtil.addDynamicSubmenu(manager, actions.getLiveDataConnectionManagement());<NEW_LINE>manager<MASK><NEW_LINE>addVisible(manager, actions.getOpenConfigAction());<NEW_LINE>addVisible(manager, actions.getDuplicateConfigAction());<NEW_LINE>addVisible(manager, actions.getDeleteConfigsAction());<NEW_LINE>manager.add(new Separator());<NEW_LINE>addVisible(manager, actions.getExposeRunAppAction());<NEW_LINE>addVisible(manager, actions.getExposeDebugAppAction());<NEW_LINE>addSubmenu(manager, "Deploy and Run On...", BootDashActivator.getImageDescriptor("icons/run-on-cloud.png"), actions.getRunOnTargetActions());<NEW_LINE>addSubmenu(manager, "Deploy and Debug On...", BootDashActivator.getImageDescriptor("icons/debug-on-cloud.png"), actions.getDebugOnTargetActions());<NEW_LINE>manager.add(new Separator());<NEW_LINE>for (AddRunTargetAction a : actions.getAddRunTargetActions()) {<NEW_LINE>addVisible(manager, a);<NEW_LINE>}<NEW_LINE>manager.add(new Separator());<NEW_LINE>addVisible(manager, actions.getConnectAction());<NEW_LINE>addVisible(manager, actions.getRemoveRunTargetAction());<NEW_LINE>addVisible(manager, actions.getRefreshRunTargetAction());<NEW_LINE>addVisible(manager, actions.getDeleteAppsAction());<NEW_LINE>addVisible(manager, actions.getEnableDevtoolsAction());<NEW_LINE>addVisible(manager, actions.getRestartDevtoolsClientAction());<NEW_LINE>for (IAction a : actions.getInjectedActions(AbstractBootDashAction.Location.CONTEXT_MENU)) {<NEW_LINE>addVisible(manager, a);<NEW_LINE>}<NEW_LINE>manager.add(new Separator());<NEW_LINE>ImmutableList.Builder<IAction> customizeActions = ImmutableList.builder();<NEW_LINE>customizeActions.add(actions.getCustomizeTargetLabelAction());<NEW_LINE>for (IAction a : actions.getInjectedActions(AbstractBootDashAction.Location.CUSTOMIZE_MENU)) {<NEW_LINE>customizeActions.add(a);<NEW_LINE>}<NEW_LINE>addSubmenu(manager, "Customize...", null, customizeActions.build());<NEW_LINE>}
.add(new Separator());
1,202,493
private void addResourceRequest(Priority priority, String resourceName, Resource capability) {<NEW_LINE>Map<String, Map<Resource, ResourceRequest>> remoteRequests = this.remoteRequestsTable.get(priority);<NEW_LINE>if (remoteRequests == null) {<NEW_LINE>remoteRequests = new HashMap<String, Map<Resource, ResourceRequest>>();<NEW_LINE>this.remoteRequestsTable.put(priority, remoteRequests);<NEW_LINE>if (LOG.isDebugEnabled()) {<NEW_LINE>LOG.debug("Added priority=" + priority);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Map<Resource, ResourceRequest> <MASK><NEW_LINE>if (reqMap == null) {<NEW_LINE>reqMap = new HashMap<Resource, ResourceRequest>();<NEW_LINE>remoteRequests.put(resourceName, reqMap);<NEW_LINE>}<NEW_LINE>ResourceRequest remoteRequest = reqMap.get(capability);<NEW_LINE>if (remoteRequest == null) {<NEW_LINE>remoteRequest = recordFactory.newRecordInstance(ResourceRequest.class);<NEW_LINE>remoteRequest.setPriority(priority);<NEW_LINE>remoteRequest.setResourceName(resourceName);<NEW_LINE>remoteRequest.setCapability(capability);<NEW_LINE>remoteRequest.setNumContainers(0);<NEW_LINE>reqMap.put(capability, remoteRequest);<NEW_LINE>}<NEW_LINE>remoteRequest.setNumContainers(remoteRequest.getNumContainers() + 1);<NEW_LINE>// Note this down for next interaction with ResourceManager<NEW_LINE>addResourceRequestToAsk(remoteRequest);<NEW_LINE>if (LOG.isDebugEnabled()) {<NEW_LINE>LOG.debug("addResourceRequest:" + " applicationId=" + context.getApplicationId() + " priority=" + priority.getPriority() + " resourceName=" + resourceName + " numContainers=" + remoteRequest.getNumContainers() + " #asks=" + ask.size());<NEW_LINE>}<NEW_LINE>}
reqMap = remoteRequests.get(resourceName);
5,176
public void onSuccess(String[] returnValue) {<NEW_LINE>if (responseOffset == 0) {<NEW_LINE>keys = returnValue;<NEW_LINE>} else {<NEW_LINE>String[] k = new String[<MASK><NEW_LINE>Util.mergeArrays(keys, returnValue, k);<NEW_LINE>keys = k;<NEW_LINE>}<NEW_LINE>newRefreshRate();<NEW_LINE>cache.put("keyIndex", keys);<NEW_LINE>modelListener.fireDataChangeEvent(-1, DataChangedListener.ADDED);<NEW_LINE>// we might have more data, send another request<NEW_LINE>if (returnValue.length == keyBatchSize) {<NEW_LINE>responseOffset = keys.length;<NEW_LINE>if (index > 0) {<NEW_LINE>CloudStorage.getInstance().queryEqualsKeys(type, index, queryValue, keys.length, keyBatchSize, visibilityScope, this);<NEW_LINE>} else {<NEW_LINE>CloudStorage.getInstance().querySortedKeys(type, sortProperty, ascending, keys.length, keyBatchSize, visibilityScope, this);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
keys.length + returnValue.length];
633,123
DanglingChainMergeHelper generateCigarAgainstUpwardsReferencePath(final MultiDeBruijnVertex vertex, final int pruneFactor, final int minDanglingBranchLength, final boolean recoverAll, final SmithWatermanAligner aligner, final SWParameters danglingHeadSWParameters) {<NEW_LINE>// find the highest common descendant path between vertex and the reference source if available<NEW_LINE>final List<MultiDeBruijnVertex> altPath = findPathDownwardsToHighestCommonDescendantOfReference(vertex, pruneFactor, !recoverAll);<NEW_LINE>if (// add 1 to include the LCA<NEW_LINE>altPath == null || isRefSink(altPath.get(0)) || altPath.size() < minDanglingBranchLength + 1) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// now get the reference path from the LCA<NEW_LINE>final List<MultiDeBruijnVertex> refPath = getReferencePath(altPath.get(0), TraversalDirection.upwards, Optional.empty());<NEW_LINE>// create the Smith-Waterman strings to use<NEW_LINE>final byte[] refBases = getBasesForPath(refPath, true);<NEW_LINE>final byte[] <MASK><NEW_LINE>// run Smith-Waterman to determine the best alignment (and remove trailing deletions since they aren't interesting)<NEW_LINE>final SmithWatermanAlignment alignment = aligner.align(refBases, altBases, danglingHeadSWParameters, SWOverhangStrategy.LEADING_INDEL);<NEW_LINE>return new DanglingChainMergeHelper(altPath, refPath, altBases, refBases, AlignmentUtils.removeTrailingDeletions(alignment.getCigar()));<NEW_LINE>}
altBases = getBasesForPath(altPath, true);
1,663,910
private void updateUIAndNote(boolean doRefresh) {<NEW_LINE>if (mNoteId == null) {<NEW_LINE>showErrorToastAndFinish();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (doRefresh) {<NEW_LINE>setProgressVisible(true);<NEW_LINE>// here start the service and wait for it<NEW_LINE>NotificationsUpdateServiceStarter.startService(this, mNoteId);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Note <MASK><NEW_LINE>if (note == null) {<NEW_LINE>// no note found<NEW_LINE>showErrorToastAndFinish();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// here compare the current Note - is it any different from the Note the user is<NEW_LINE>// currently viewing?<NEW_LINE>// if it is, then replace the dataset with the new one.<NEW_LINE>// If not, just let it be.<NEW_LINE>if (mAdapter != null) {<NEW_LINE>Note currentNote = mAdapter.getNoteWithId(mNoteId);<NEW_LINE>if (note.equalsTimeAndLength(currentNote)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>NotesAdapter.FILTERS filter = NotesAdapter.FILTERS.FILTER_ALL;<NEW_LINE>if (getIntent().hasExtra(NotificationsListFragment.NOTE_CURRENT_LIST_FILTER_EXTRA)) {<NEW_LINE>filter = (NotesAdapter.FILTERS) getIntent().getSerializableExtra(NotificationsListFragment.NOTE_CURRENT_LIST_FILTER_EXTRA);<NEW_LINE>}<NEW_LINE>mAdapter = buildNoteListAdapterAndSetPosition(note, filter);<NEW_LINE>resetOnPageChangeListener();<NEW_LINE>// set title<NEW_LINE>setActionBarTitleForNote(note);<NEW_LINE>markNoteAsRead(note);<NEW_LINE>// If `note.getTimestamp()` is not the most recent seen note, the server will discard the value.<NEW_LINE>NotificationsActions.updateSeenTimestamp(note);<NEW_LINE>// analytics tracking<NEW_LINE>Map<String, String> properties = new HashMap<>();<NEW_LINE>properties.put("notification_type", note.getType());<NEW_LINE>AnalyticsTracker.track(AnalyticsTracker.Stat.NOTIFICATIONS_OPENED_NOTIFICATION_DETAILS, properties);<NEW_LINE>setProgressVisible(false);<NEW_LINE>}
note = NotificationsTable.getNoteById(mNoteId);
238,879
private void loadNode420() throws IOException, SAXException {<NEW_LINE>PropertyTypeNode node = new PropertyTypeNode(this.context, Identifiers.CertificateGroupFolderType_DefaultUserTokenGroup_TrustList_Write_InputArguments, new QualifiedName(0, "InputArguments"), new LocalizedText("en", "InputArguments"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.Argument, 1, new UInteger[] { org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UInteger.valueOf(0) }, UByte.valueOf(1), UByte.valueOf(1), 0.0, false);<NEW_LINE>node.addReference(new Reference(Identifiers.CertificateGroupFolderType_DefaultUserTokenGroup_TrustList_Write_InputArguments, Identifiers.HasTypeDefinition, Identifiers.PropertyType.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.CertificateGroupFolderType_DefaultUserTokenGroup_TrustList_Write_InputArguments, Identifiers.HasModellingRule, Identifiers.ModellingRule_Mandatory.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.CertificateGroupFolderType_DefaultUserTokenGroup_TrustList_Write_InputArguments, Identifiers.HasProperty, Identifiers.CertificateGroupFolderType_DefaultUserTokenGroup_TrustList_Write.expanded(), false));<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append("<ListOfExtensionObject xmlns=\"http://opcfoundation.org/UA/2008/02/Types.xsd\"><ExtensionObject><TypeId><Identifier>i=297</Identifier> </TypeId><Body><Argument><Name>FileHandle</Name><DataType><Identifier>i=7</Identifier> </DataType><ValueRank>-1</ValueRank><ArrayDimensions/> </Argument> </Body> </ExtensionObject><ExtensionObject><TypeId><Identifier>i=297</Identifier> </TypeId><Body><Argument><Name>Data</Name><DataType><Identifier>i=15</Identifier> </DataType><ValueRank>-1</ValueRank><ArrayDimensions/> </Argument> </Body> </ExtensionObject> </ListOfExtensionObject>");<NEW_LINE>String xml = sb.toString();<NEW_LINE>OpcUaXmlStreamDecoder decoder = new OpcUaXmlStreamDecoder(context.getServer().getSerializationContext()).setInput(new StringReader(xml));<NEW_LINE><MASK><NEW_LINE>DataValue value = new DataValue(new Variant(o));<NEW_LINE>node.setValue(value);<NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>}
Object o = decoder.readVariantValue();
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>r = comp.modelToView(dot);<NEW_LINE>if (r == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>dotChar = comp.getText(dot<MASK><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>}
, 1).charAt(0);
753,428
public void transformJson(HistoryJobEntity job, ObjectNode historicalData, CommandContext commandContext) {<NEW_LINE>HistoricCaseInstanceEntityManager historicCaseInstanceEntityManager = cmmnEngineConfiguration.getHistoricCaseInstanceEntityManager();<NEW_LINE>String id = getStringFromJson(historicalData, "id");<NEW_LINE>HistoricCaseInstanceEntity historicCaseInstanceEntity = historicCaseInstanceEntityManager.findById(id);<NEW_LINE>// If the entity is already persisted, no need to do anything.<NEW_LINE>// The end event already has inserted the latest state and there is no new data in the json here.<NEW_LINE>if (historicCaseInstanceEntity == null) {<NEW_LINE>historicCaseInstanceEntity = historicCaseInstanceEntityManager.create();<NEW_LINE>historicCaseInstanceEntity.setId(getStringFromJson(historicalData, CmmnAsyncHistoryConstants.FIELD_ID));<NEW_LINE>historicCaseInstanceEntity.setName(getStringFromJson(historicalData, CmmnAsyncHistoryConstants.FIELD_NAME));<NEW_LINE>historicCaseInstanceEntity.setBusinessKey(getStringFromJson(historicalData, CmmnAsyncHistoryConstants.FIELD_BUSINESS_KEY));<NEW_LINE>historicCaseInstanceEntity.setBusinessStatus(getStringFromJson(historicalData, CmmnAsyncHistoryConstants.FIELD_BUSINESS_STATUS));<NEW_LINE>historicCaseInstanceEntity.setParentId(getStringFromJson(historicalData, CmmnAsyncHistoryConstants.FIELD_PARENT_ID));<NEW_LINE>historicCaseInstanceEntity.setCaseDefinitionId(getStringFromJson(historicalData, CmmnAsyncHistoryConstants.FIELD_CASE_DEFINITION_ID));<NEW_LINE>historicCaseInstanceEntity.setState(getStringFromJson(historicalData, CmmnAsyncHistoryConstants.FIELD_STATE));<NEW_LINE>historicCaseInstanceEntity.setStartUserId(getStringFromJson(historicalData, CmmnAsyncHistoryConstants.FIELD_START_USER_ID));<NEW_LINE>historicCaseInstanceEntity.setStartTime(getDateFromJson(historicalData, CmmnAsyncHistoryConstants.FIELD_START_TIME));<NEW_LINE>historicCaseInstanceEntity.setCallbackId(getStringFromJson(historicalData, CmmnAsyncHistoryConstants.FIELD_CALLBACK_ID));<NEW_LINE>historicCaseInstanceEntity.setCallbackType(getStringFromJson(historicalData, CmmnAsyncHistoryConstants.FIELD_CALLBACK_TYPE));<NEW_LINE>historicCaseInstanceEntity.setReferenceId(getStringFromJson(historicalData, CmmnAsyncHistoryConstants.FIELD_REFERENCE_ID));<NEW_LINE>historicCaseInstanceEntity.setReferenceType(getStringFromJson<MASK><NEW_LINE>historicCaseInstanceEntity.setTenantId(getStringFromJson(historicalData, CmmnAsyncHistoryConstants.FIELD_TENANT_ID));<NEW_LINE>historicCaseInstanceEntityManager.insert(historicCaseInstanceEntity);<NEW_LINE>}<NEW_LINE>}
(historicalData, CmmnAsyncHistoryConstants.FIELD_REFERENCE_TYPE));
1,108,775
public void deserialize(DataInputStream input) throws IOException {<NEW_LINE>int featsFlag = StreamSerdeUtils.deserializeInt(input);<NEW_LINE>if (featsFlag > 0) {<NEW_LINE>feats = (IntFloatVector) StreamSerdeUtils.deserializeVector(input);<NEW_LINE>}<NEW_LINE>int neighborsFlag = StreamSerdeUtils.deserializeInt(input);<NEW_LINE>if (neighborsFlag > 0) {<NEW_LINE>neighbors = StreamSerdeUtils.deserializeLongs(input);<NEW_LINE>}<NEW_LINE>int typesFlag = StreamSerdeUtils.deserializeInt(input);<NEW_LINE>if (typesFlag > 0) {<NEW_LINE>types = StreamSerdeUtils.deserializeInts(input);<NEW_LINE>}<NEW_LINE>int edgeTypesFlag = StreamSerdeUtils.deserializeInt(input);<NEW_LINE>if (edgeTypesFlag > 0) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>int edgeFeaturesFlag = StreamSerdeUtils.deserializeInt(input);<NEW_LINE>if (edgeFeaturesFlag > 0) {<NEW_LINE>int len = StreamSerdeUtils.deserializeInt(input);<NEW_LINE>edgeFeatures = new IntFloatVector[len];<NEW_LINE>for (int i = 0; i < len; i++) {<NEW_LINE>edgeFeatures[i] = (IntFloatVector) StreamSerdeUtils.deserializeVector(input);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int weightsFlag = StreamSerdeUtils.deserializeInt(input);<NEW_LINE>if (weightsFlag > 0) {<NEW_LINE>weights = StreamSerdeUtils.deserializeFloats(input);<NEW_LINE>}<NEW_LINE>int labelsFlag = StreamSerdeUtils.deserializeInt(input);<NEW_LINE>if (labelsFlag > 0) {<NEW_LINE>weights = StreamSerdeUtils.deserializeFloats(input);<NEW_LINE>}<NEW_LINE>}
edgeTypes = StreamSerdeUtils.deserializeInts(input);
21,061
public void testAutoCompleteDependentFutures() throws Exception {<NEW_LINE>CountDownLatch beginLatch = new CountDownLatch(1);<NEW_LINE>CountDownLatch continueLatch = new CountDownLatch(1);<NEW_LINE>try {<NEW_LINE>BlockableSupplier<String> supplier = new BlockableSupplier<String<MASK><NEW_LINE>BlockableIncrementFunction increment = new BlockableIncrementFunction("testAutoCompleteDependentFutures", null, null);<NEW_LINE>CompletableFuture<String> cf1 = defaultManagedExecutor.supplyAsync(supplier);<NEW_LINE>CompletableFuture<Integer> cf2 = cf1.thenApply(s -> s.length());<NEW_LINE>CompletableFuture<Integer> cf3 = cf2.thenApplyAsync(increment);<NEW_LINE>assertTrue(beginLatch.await(TIMEOUT_NS, TimeUnit.NANOSECONDS));<NEW_LINE>assertTrue(cf1.cancel(true));<NEW_LINE>try {<NEW_LINE>Integer i = cf2.get(TIMEOUT_NS, TimeUnit.NANOSECONDS);<NEW_LINE>fail("Dependent completable future [2] should have been canceled. Instead: " + i);<NEW_LINE>} catch (ExecutionException x) {<NEW_LINE>if (!(x.getCause() instanceof CancellationException))<NEW_LINE>throw x;<NEW_LINE>}<NEW_LINE>assertTrue(cf2.isCompletedExceptionally());<NEW_LINE>try {<NEW_LINE>Integer i = cf3.get(TIMEOUT_NS, TimeUnit.NANOSECONDS);<NEW_LINE>fail("Dependent completable future [3] should have been canceled. Instead: " + i);<NEW_LINE>} catch (ExecutionException x) {<NEW_LINE>if (!(x.getCause() instanceof CancellationException))<NEW_LINE>throw x;<NEW_LINE>}<NEW_LINE>assertTrue(cf3.isCompletedExceptionally());<NEW_LINE>// Expect supplier thread to be interrupted due to premature completion<NEW_LINE>for (long start = System.nanoTime(); supplier.executionThread != null && System.nanoTime() - start < TIMEOUT_NS; TimeUnit.MILLISECONDS.sleep(200)) ;<NEW_LINE>assertNull(supplier.executionThread);<NEW_LINE>assertNull(increment.executionThread);<NEW_LINE>} finally {<NEW_LINE>// in case the test fails, unblock the thread that is running the supplier<NEW_LINE>continueLatch.countDown();<NEW_LINE>}<NEW_LINE>}
>("testAutoCompleteDependentFutures", beginLatch, continueLatch);
1,186,934
private void createV1MutationQueue() {<NEW_LINE>ifTablesDontExist(new String[] { "mutation_queues", "mutations", "document_mutations" }, () -> {<NEW_LINE>// A table naming all the mutation queues in the system.<NEW_LINE>db.execSQL("CREATE TABLE mutation_queues (" + "uid TEXT PRIMARY KEY, " + "last_acknowledged_batch_id INTEGER, " + "last_stream_token BLOB)");<NEW_LINE>// All the mutation batches in the system, partitioned by user.<NEW_LINE>db.execSQL("CREATE TABLE mutations (" + <MASK><NEW_LINE>// A manually maintained index of all the mutation batches that affect a given document<NEW_LINE>// key.<NEW_LINE>// the rows in this table are references based on the contents of mutations.mutations.<NEW_LINE>db.execSQL("CREATE TABLE document_mutations (" + "uid TEXT, " + "path TEXT, " + "batch_id INTEGER, " + "PRIMARY KEY (uid, path, batch_id))");<NEW_LINE>});<NEW_LINE>}
"uid TEXT, " + "batch_id INTEGER, " + "mutations BLOB, " + "PRIMARY KEY (uid, batch_id))");
727,557
private static List<Caption> listCaptions(String videoId) throws IOException {<NEW_LINE>// Call the YouTube Data API's captions.list method to<NEW_LINE>// retrieve video caption tracks.<NEW_LINE>CaptionListResponse captionListResponse = youtube.captions().list("snippet", videoId).execute();<NEW_LINE>List<Caption> captions = captionListResponse.getItems();<NEW_LINE>// Print information from the API response.<NEW_LINE>System.out.println("\n================== Returned Caption Tracks ==================\n");<NEW_LINE>CaptionSnippet snippet;<NEW_LINE>for (Caption caption : captions) {<NEW_LINE>snippet = caption.getSnippet();<NEW_LINE>System.out.println(<MASK><NEW_LINE>System.out.println(" - Name: " + snippet.getName());<NEW_LINE>System.out.println(" - Language: " + snippet.getLanguage());<NEW_LINE>System.out.println("\n-------------------------------------------------------------\n");<NEW_LINE>}<NEW_LINE>return captions;<NEW_LINE>}
" - ID: " + caption.getId());
1,620,302
private TornadoInstalledCode compileTask(SchedulableTask task) {<NEW_LINE>final CompilableTask executable = (CompilableTask) task;<NEW_LINE>final ResolvedJavaMethod resolvedMethod = TornadoCoreRuntime.getTornadoRuntime().resolveMethod(executable.getMethod());<NEW_LINE>final Sketch sketch = TornadoSketcher.lookup(resolvedMethod, task.meta().getDriverIndex(), task.<MASK><NEW_LINE>// copy meta data into task<NEW_LINE>final TaskMetaData taskMeta = executable.meta();<NEW_LINE>final Access[] sketchAccess = sketch.getArgumentsAccess();<NEW_LINE>final Access[] taskAccess = taskMeta.getArgumentsAccess();<NEW_LINE>System.arraycopy(sketchAccess, 0, taskAccess, 0, sketchAccess.length);<NEW_LINE>try {<NEW_LINE>OCLProviders providers = (OCLProviders) getBackend().getProviders();<NEW_LINE>TornadoProfiler profiler = task.getProfiler();<NEW_LINE>profiler.start(ProfilerType.TASK_COMPILE_GRAAL_TIME, taskMeta.getId());<NEW_LINE>final OCLCompilationResult result = OCLCompiler.compileSketchForDevice(sketch, executable, providers, getBackend());<NEW_LINE>profiler.stop(ProfilerType.TASK_COMPILE_GRAAL_TIME, taskMeta.getId());<NEW_LINE>profiler.sum(ProfilerType.TOTAL_GRAAL_COMPILE_TIME, profiler.getTaskTimer(ProfilerType.TASK_COMPILE_GRAAL_TIME, taskMeta.getId()));<NEW_LINE>RuntimeUtilities.maybePrintSource(result.getTargetCode());<NEW_LINE>return null;<NEW_LINE>} catch (Exception e) {<NEW_LINE>driver.fatal("unable to compile %s for device %s", task.getId(), getDeviceName());<NEW_LINE>driver.fatal("exception occured when compiling %s", ((CompilableTask) task).getMethod().getName());<NEW_LINE>driver.fatal("exception: %s", e.toString());<NEW_LINE>throw new TornadoBailoutRuntimeException("[Error During the Task Compilation] ", e);<NEW_LINE>}<NEW_LINE>}
meta().getDeviceIndex());
1,237,817
protected void configurePlot(Plot p, JRChartPlot jrPlot) {<NEW_LINE>RectangleInsets defaultPlotInsets = (RectangleInsets) <MASK><NEW_LINE>Paint defaultPlotOutlinePaint = (Paint) getDefaultValue(defaultPlotPropertiesMap, ChartThemesConstants.PLOT_OUTLINE_PAINT);<NEW_LINE>Stroke defaultPlotOutlineStroke = (Stroke) getDefaultValue(defaultPlotPropertiesMap, ChartThemesConstants.PLOT_OUTLINE_STROKE);<NEW_LINE>Boolean defaultPlotOutlineVisible = (Boolean) getDefaultValue(defaultPlotPropertiesMap, ChartThemesConstants.PLOT_OUTLINE_VISIBLE);<NEW_LINE>if (defaultPlotInsets != null)<NEW_LINE>p.setInsets(defaultPlotInsets);<NEW_LINE>if (defaultPlotOutlineVisible != null) {<NEW_LINE>if (defaultPlotOutlineVisible) {<NEW_LINE>if (defaultPlotOutlinePaint != null)<NEW_LINE>p.setOutlinePaint(defaultPlotOutlinePaint);<NEW_LINE>if (defaultPlotOutlineStroke != null)<NEW_LINE>p.setOutlineStroke(defaultPlotOutlineStroke);<NEW_LINE>p.setOutlineVisible(true);<NEW_LINE>} else {<NEW_LINE>p.setOutlineVisible(false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>setPlotBackground(p, jrPlot);<NEW_LINE>if (p instanceof CategoryPlot) {<NEW_LINE>handleCategoryPlotSettings((CategoryPlot) p, jrPlot);<NEW_LINE>}<NEW_LINE>setPlotDrawingDefaults(p, jrPlot);<NEW_LINE>}
getDefaultValue(defaultPlotPropertiesMap, ChartThemesConstants.PLOT_INSETS);
1,732,889
public EditorHighlighter createEditorHighlighter(@Nonnull VirtualFile vFile, @Nonnull EditorColorsScheme settings, @javax.annotation.Nullable Project project) {<NEW_LINE><MASK><NEW_LINE>if (fileType instanceof LanguageFileType) {<NEW_LINE>LanguageFileType substFileType = substituteFileType(((LanguageFileType) fileType).getLanguage(), vFile, project);<NEW_LINE>if (substFileType != null) {<NEW_LINE>EditorHighlighterProvider provider = FileTypeEditorHighlighterProviders.INSTANCE.forFileType(substFileType);<NEW_LINE>EditorHighlighter editorHighlighter = provider.getEditorHighlighter(project, fileType, vFile, settings);<NEW_LINE>boolean isPlain = editorHighlighter.getClass() == LexerEditorHighlighter.class && ((LexerEditorHighlighter) editorHighlighter).isPlain();<NEW_LINE>if (!isPlain) {<NEW_LINE>return editorHighlighter;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>return FileTypeEditorHighlighterProviders.INSTANCE.forFileType(fileType).getEditorHighlighter(project, fileType, vFile, settings);<NEW_LINE>} catch (ProcessCanceledException e) {<NEW_LINE>throw e;<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.error(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>SyntaxHighlighter highlighter = SyntaxHighlighterFactory.getSyntaxHighlighter(fileType, project, vFile);<NEW_LINE>return createEditorHighlighter(highlighter, settings);<NEW_LINE>}
FileType fileType = vFile.getFileType();
497,854
public ReviveModelResultRepresentation reviveProcessModelHistory(ModelHistory modelHistory, String userId, String newVersionComment) {<NEW_LINE>Model latestModel = modelRepository.<MASK><NEW_LINE>if (latestModel == null) {<NEW_LINE>throw new IllegalArgumentException("No process model found with id: " + modelHistory.getModelId());<NEW_LINE>}<NEW_LINE>// Store the current model in history<NEW_LINE>ModelHistory latestModelHistory = createNewModelhistory(latestModel);<NEW_LINE>persistModelHistory(latestModelHistory);<NEW_LINE>// Populate the actual latest version with the properties in the historic model<NEW_LINE>latestModel.setVersion(latestModel.getVersion() + 1);<NEW_LINE>latestModel.setLastUpdated(new Date());<NEW_LINE>latestModel.setLastUpdatedBy(userId);<NEW_LINE>latestModel.setName(modelHistory.getName());<NEW_LINE>latestModel.setKey(modelHistory.getKey());<NEW_LINE>latestModel.setDescription(modelHistory.getDescription());<NEW_LINE>latestModel.setModelEditorJson(modelHistory.getModelEditorJson());<NEW_LINE>latestModel.setModelType(modelHistory.getModelType());<NEW_LINE>latestModel.setComment(newVersionComment);<NEW_LINE>persistModel(latestModel);<NEW_LINE>ReviveModelResultRepresentation result = new ReviveModelResultRepresentation();<NEW_LINE>// For apps, we need to make sure the referenced processes exist as models.<NEW_LINE>// It could be the user has deleted the process model in the meantime. We give back that info to the user.<NEW_LINE>if (latestModel.getModelType() == AbstractModel.MODEL_TYPE_APP) {<NEW_LINE>if (StringUtils.isNotEmpty(latestModel.getModelEditorJson())) {<NEW_LINE>try {<NEW_LINE>AppDefinition appDefinition = objectMapper.readValue(latestModel.getModelEditorJson(), AppDefinition.class);<NEW_LINE>for (AppModelDefinition appModelDefinition : appDefinition.getModels()) {<NEW_LINE>if (modelRepository.get(appModelDefinition.getId()) == null) {<NEW_LINE>result.getUnresolvedModels().add(new UnresolveModelRepresentation(appModelDefinition.getId(), appModelDefinition.getName(), appModelDefinition.getLastUpdatedBy()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.error("Could not deserialize app model json (id = {})", latestModel.getId(), e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
get(modelHistory.getModelId());
725,480
protected void mergeLocations(RdbDeviceState original, IDeviceStateEventMergeRequest request) throws SiteWhereException {<NEW_LINE>if (request.getLocations().size() > 0) {<NEW_LINE>// Combine existing with new locations.<NEW_LINE>List<IDeviceLocation> all = new ArrayList<>();<NEW_LINE>List<RdbRecentLocationEvent> recent = original.getRecentLocations();<NEW_LINE>if (recent != null) {<NEW_LINE>for (RdbRecentLocationEvent current : recent) {<NEW_LINE>all.add(RdbRecentLocationEvent.createApiFrom(current));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>all.addAll(request.getLocations());<NEW_LINE>// Inverse sort of locations by event date.<NEW_LINE>all.sort(new Comparator<IDeviceLocation>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int compare(IDeviceLocation o1, IDeviceLocation o2) {<NEW_LINE>return -1 * o1.getEventDate().compareTo(o2.getEventDate());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>int remaining = NUM_RECENT_LOCATIONS;<NEW_LINE>List<RdbRecentLocationEvent> <MASK><NEW_LINE>while (remaining > 0) {<NEW_LINE>if (all.size() > 0) {<NEW_LINE>IDeviceLocation location = all.remove(0);<NEW_LINE>RdbRecentLocationEvent rdb = RdbRecentLocationEvent.createFrom(original, location);<NEW_LINE>rdb = getRdbEntityManagerProvider().persist(rdb);<NEW_LINE>updated.add(rdb);<NEW_LINE>}<NEW_LINE>remaining--;<NEW_LINE>}<NEW_LINE>original.setRecentLocations(updated);<NEW_LINE>}<NEW_LINE>}
updated = new ArrayList<>();
1,187,025
private Program doLoad(ByteProvider provider, String programName, DomainFolder programFolder, LoadSpec loadSpec, List<Option> options, MessageLog log, Object consumer, TaskMonitor monitor, Set<String> unprocessedLibraries) throws CancelledException, IOException {<NEW_LINE>LanguageCompilerSpecPair pair = loadSpec.getLanguageCompilerSpec();<NEW_LINE>Language language = getLanguageService().getLanguage(pair.languageID);<NEW_LINE>CompilerSpec compilerSpec = language.getCompilerSpecByID(pair.compilerSpecID);<NEW_LINE>monitor.setMessage(provider.getName());<NEW_LINE>Address imageBaseAddr = language.getAddressFactory().getDefaultAddressSpace().getAddress(loadSpec.getDesiredImageBase());<NEW_LINE>Program program = createProgram(provider, programName, imageBaseAddr, getName(), language, compilerSpec, consumer);<NEW_LINE>Comparator<String> libNameComparator = getLibNameComparator();<NEW_LINE>int transactionID = program.startTransaction("importing");<NEW_LINE>boolean success = false;<NEW_LINE>try {<NEW_LINE>log.appendMsg("----- Loading " + provider.getAbsolutePath() + " -----");<NEW_LINE>load(provider, loadSpec, options, program, monitor, log);<NEW_LINE>createDefaultMemoryBlocks(program, language, log);<NEW_LINE>if (unprocessedLibraries != null) {<NEW_LINE><MASK><NEW_LINE>String[] externalNames = extMgr.getExternalLibraryNames();<NEW_LINE>Arrays.sort(externalNames, libNameComparator);<NEW_LINE>for (String name : externalNames) {<NEW_LINE>if (libNameComparator.compare(name, provider.getName()) == 0 || libNameComparator.compare(name, program.getName()) == 0 || Library.UNKNOWN.equals(name)) {<NEW_LINE>// skip self-references and UNKNOWN library...<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>unprocessedLibraries.add(name);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>success = true;<NEW_LINE>return program;<NEW_LINE>} finally {<NEW_LINE>program.endTransaction(transactionID, success);<NEW_LINE>if (!success) {<NEW_LINE>program.release(consumer);<NEW_LINE>program = null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
ExternalManager extMgr = program.getExternalManager();
937,427
protected List findByUserId(String userId, int begin, int end, OrderByComparator obc) throws SystemException {<NEW_LINE>Session session = null;<NEW_LINE>try {<NEW_LINE>session = openSession();<NEW_LINE>StringBuffer query = new StringBuffer();<NEW_LINE>query.append("FROM PortletPreferences IN CLASS com.liferay.portal.ejb.PortletPreferencesHBM WHERE ");<NEW_LINE>query.append("userId = ?");<NEW_LINE>query.append(" ");<NEW_LINE>if (obc != null) {<NEW_LINE>query.append("ORDER BY " + obc.getOrderBy());<NEW_LINE>}<NEW_LINE>Query q = session.createQuery(query.toString());<NEW_LINE>int queryPos = 0;<NEW_LINE>q.setString(queryPos++, userId);<NEW_LINE>List list = new ArrayList();<NEW_LINE>if (getDialect().supportsLimit()) {<NEW_LINE>q.setMaxResults(end - begin);<NEW_LINE>q.setFirstResult(begin);<NEW_LINE>Iterator itr = q.list().iterator();<NEW_LINE>while (itr.hasNext()) {<NEW_LINE>PortletPreferencesHBM portletPreferencesHBM = (PortletPreferencesHBM) itr.next();<NEW_LINE>list.add<MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>ScrollableResults sr = q.scroll();<NEW_LINE>if (sr.first() && sr.scroll(begin)) {<NEW_LINE>for (int i = begin; i < end; i++) {<NEW_LINE>PortletPreferencesHBM portletPreferencesHBM = (PortletPreferencesHBM) sr.get(0);<NEW_LINE>list.add(PortletPreferencesHBMUtil.model(portletPreferencesHBM));<NEW_LINE>if (!sr.next()) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return list;<NEW_LINE>} catch (HibernateException he) {<NEW_LINE>throw new SystemException(he);<NEW_LINE>} finally {<NEW_LINE>HibernateUtil.closeSession(session);<NEW_LINE>}<NEW_LINE>}
(PortletPreferencesHBMUtil.model(portletPreferencesHBM));
1,024,443
public Response keycloakInitiatedBrowserLogout(KeycloakSession session, UserSessionModel userSession, UriInfo uriInfo, RealmModel realm) {<NEW_LINE>String singleLogoutServiceUrl = getConfig().getSingleLogoutServiceUrl();<NEW_LINE>if (singleLogoutServiceUrl == null || singleLogoutServiceUrl.trim().equals(""))<NEW_LINE>return null;<NEW_LINE>if (getConfig().isBackchannelSupported()) {<NEW_LINE>backchannelLogout(session, userSession, uriInfo, realm);<NEW_LINE>return null;<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>LogoutRequestType logoutRequest = buildLogoutRequest(userSession, uriInfo, realm, singleLogoutServiceUrl);<NEW_LINE>if (logoutRequest.getDestination() != null) {<NEW_LINE>singleLogoutServiceUrl = logoutRequest.getDestination().toString();<NEW_LINE>}<NEW_LINE>JaxrsSAML2BindingBuilder binding = buildLogoutBinding(session, userSession, realm);<NEW_LINE>if (getConfig().isPostBindingLogout()) {<NEW_LINE>return binding.postBinding(SAML2Request.convert(logoutRequest)).request(singleLogoutServiceUrl);<NEW_LINE>} else {<NEW_LINE>return binding.redirectBinding(SAML2Request.convert(<MASK><NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
logoutRequest)).request(singleLogoutServiceUrl);
883,795
public void init(final NodeEngine nodeEngine, Properties properties) {<NEW_LINE>LockSupportService lockService = nodeEngine.getServiceOrNull(LockSupportService.SERVICE_NAME);<NEW_LINE>if (lockService != null) {<NEW_LINE>lockService.registerLockStoreConstructor(SERVICE_NAME, key -> {<NEW_LINE><MASK><NEW_LINE>final MultiMapConfig multiMapConfig = nodeEngine.getConfig().findMultiMapConfig(name);<NEW_LINE>return new LockStoreInfo() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int getBackupCount() {<NEW_LINE>return multiMapConfig.getBackupCount();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int getAsyncBackupCount() {<NEW_LINE>return multiMapConfig.getAsyncBackupCount();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>});<NEW_LINE>}<NEW_LINE>boolean dsMetricsEnabled = nodeEngine.getProperties().getBoolean(ClusterProperty.METRICS_DATASTRUCTURES);<NEW_LINE>if (dsMetricsEnabled) {<NEW_LINE>((NodeEngineImpl) nodeEngine).getMetricsRegistry().registerDynamicMetricsProvider(this);<NEW_LINE>}<NEW_LINE>}
String name = key.getObjectName();
901,787
private void prepareWriteHeader(byte opCode, int payloadLength) {<NEW_LINE>//<NEW_LINE>// We need to prepare the frame header.<NEW_LINE>//<NEW_LINE>_writeBuffer.resize(_writeBufferSize, false);<NEW_LINE>_writeBuffer.limit(_writeBufferSize);<NEW_LINE>_writeBuffer.position(0);<NEW_LINE>//<NEW_LINE>// Set the opcode - this is the one and only data frame.<NEW_LINE>//<NEW_LINE>_writeBuffer.b.put((byte) (opCode | FLAG_FINAL));<NEW_LINE>//<NEW_LINE>// Set the payload length.<NEW_LINE>//<NEW_LINE>if (payloadLength <= 125) {<NEW_LINE>_writeBuffer.b<MASK><NEW_LINE>} else if (payloadLength > 125 && payloadLength <= 65535) {<NEW_LINE>//<NEW_LINE>// Use an extra 16 bits to encode the payload length.<NEW_LINE>//<NEW_LINE>_writeBuffer.b.put((byte) 126);<NEW_LINE>_writeBuffer.b.putShort((short) payloadLength);<NEW_LINE>} else if (payloadLength > 65535) {<NEW_LINE>//<NEW_LINE>// Use an extra 64 bits to encode the payload length.<NEW_LINE>//<NEW_LINE>_writeBuffer.b.put((byte) 127);<NEW_LINE>_writeBuffer.b.putLong(payloadLength);<NEW_LINE>}<NEW_LINE>if (!_incoming) {<NEW_LINE>//<NEW_LINE>// Add a random 32-bit mask to every outgoing frame, copy the payload data,<NEW_LINE>// and apply the mask.<NEW_LINE>//<NEW_LINE>_writeBuffer.b.put(1, (byte) (_writeBuffer.b.get(1) | FLAG_MASKED));<NEW_LINE>_rand.nextBytes(_writeMask);<NEW_LINE>_writeBuffer.b.put(_writeMask);<NEW_LINE>}<NEW_LINE>}
.put((byte) payloadLength);
1,495,253
public boolean loadAll() {<NEW_LINE>MapPack param = new MapPack();<NEW_LINE>ListValue typeList = param.newList(ParamConstant.TYPE);<NEW_LINE>ListValue hashList = <MASK><NEW_LINE>for (Map.Entry<TextTypeEnum, Set<Integer>> e : typedHashes.entrySet()) {<NEW_LINE>String type = e.getKey().getTypeName();<NEW_LINE>Iterator<Integer> iter = e.getValue().iterator();<NEW_LINE>while (iter.hasNext()) {<NEW_LINE>int hash = iter.next();<NEW_LINE>if (TextTypeEnum.of(type).getTextModel().getCachedText(hash) == null) {<NEW_LINE>if (TextModel.isScopeStarted() && TextModel.isFailedInScope(hash)) {<NEW_LINE>// skip<NEW_LINE>} else {<NEW_LINE>typeList.add(type);<NEW_LINE>hashList.add(hash);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (hashList.size() > 0) {<NEW_LINE>try (TcpProxy tcpProxy = TcpProxy.getTcpProxy(serverId)) {<NEW_LINE>List<Pack> valueList = tcpProxy.process(RequestCmd.GET_TEXT_ANY_TYPE, param);<NEW_LINE>for (Pack pack : valueList) {<NEW_LINE>TextPack textPack = (TextPack) pack;<NEW_LINE>TextTypeEnum.of(textPack.xtype).getTextModel().cache(textPack);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.error(e.getMessage());<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (TextModel.isScopeStarted()) {<NEW_LINE>for (int i = 0; i < hashList.size(); i++) {<NEW_LINE>int hash = hashList.getInt(i);<NEW_LINE>TextModel textModel = TextTypeEnum.of(typeList.getString(i)).getTextModel();<NEW_LINE>if (textModel.getCachedText(hash) == null) {<NEW_LINE>TextModel.addFailedList(hashList.getInt(i));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
param.newList(ParamConstant.HASH);
1,525,935
ActionResult<Wo> execute(EffectivePerson effectivePerson, String flag, JsonElement jsonElement) throws Exception {<NEW_LINE>logger.debug(effectivePerson.getDistinguishedName());<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>ActionResult<Wo> result = new ActionResult<>();<NEW_LINE>Wi wi = this.convertToWrapIn(jsonElement, Wi.class);<NEW_LINE>Business business = new Business(emc);<NEW_LINE>Query query = emc.flag(flag, Query.class);<NEW_LINE>if (null == query) {<NEW_LINE>throw new ExceptionQueryNotExist(flag);<NEW_LINE>}<NEW_LINE>if (!business.editable(effectivePerson, query)) {<NEW_LINE>throw new ExceptionQueryAccessDenied(effectivePerson.getDistinguishedName(), query.getName(), query.getId());<NEW_LINE>}<NEW_LINE>emc.beginTransaction(Query.class);<NEW_LINE>Wi.copier.copy(wi, query);<NEW_LINE>if (!this.idleName(business, query)) {<NEW_LINE>throw new ExceptionNameExist(query.getName());<NEW_LINE>}<NEW_LINE>if (StringUtils.isNotEmpty(query.getAlias()) && (!this.idleAlias(business, query))) {<NEW_LINE>throw new ExceptionAliasExist(query.getAlias());<NEW_LINE>}<NEW_LINE>query.setLastUpdatePerson(effectivePerson.getDistinguishedName());<NEW_LINE>query.setLastUpdateTime(new Date());<NEW_LINE>emc.check(query, CheckPersistType.all);<NEW_LINE>emc.commit();<NEW_LINE><MASK><NEW_LINE>Wo wo = new Wo();<NEW_LINE>wo.setId(query.getId());<NEW_LINE>result.setData(wo);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>}
CacheManager.notify(Query.class);
500,487
public <AT> AT retrieveValue(final ResultSet rs, final String columnName, final Class<AT> returnType) throws SQLException {<NEW_LINE>final AT value;<NEW_LINE>if (returnType.isAssignableFrom(BigDecimal.class)) {<NEW_LINE>value = (AT) rs.getBigDecimal(columnName);<NEW_LINE>} else if (returnType.isAssignableFrom(Double.class) || returnType == double.class) {<NEW_LINE>value = (AT) Double.valueOf(rs.getDouble(columnName));<NEW_LINE>} else if (returnType.isAssignableFrom(Integer.class) || returnType == int.class) {<NEW_LINE>value = (AT) Integer.valueOf(rs.getInt(columnName));<NEW_LINE>} else if (returnType.isAssignableFrom(Timestamp.class)) {<NEW_LINE>value = (AT) rs.getTimestamp(columnName);<NEW_LINE>} else if (returnType.isAssignableFrom(Date.class)) {<NEW_LINE>final Timestamp <MASK><NEW_LINE>value = (AT) ts;<NEW_LINE>} else if (returnType.isAssignableFrom(Boolean.class) || returnType == boolean.class) {<NEW_LINE>value = (AT) StringUtils.toBoolean(rs.getString(columnName), Boolean.FALSE);<NEW_LINE>} else if (returnType.isAssignableFrom(String.class)) {<NEW_LINE>value = (AT) rs.getString(columnName);<NEW_LINE>} else {<NEW_LINE>value = (AT) rs.getObject(columnName);<NEW_LINE>}<NEW_LINE>return value;<NEW_LINE>}
ts = rs.getTimestamp(columnName);
1,346,376
public static void removeAbilityBuff(@Nullable ItemStack itemStack) {<NEW_LINE>if (itemStack == null)<NEW_LINE>return;<NEW_LINE>if (!ItemUtils.canBeSuperAbilityDigBoosted(itemStack))<NEW_LINE>return;<NEW_LINE>// 1.13.2+ will have persistent metadata for this itemStack<NEW_LINE>ItemMetadataService itemMetadataService = mcMMO.getMetadataService().getItemMetadataService();<NEW_LINE>if (itemMetadataService.isLegacyAbilityTool(itemStack)) {<NEW_LINE>ItemMeta itemMeta = itemStack.getItemMeta();<NEW_LINE>if (itemMeta != null) {<NEW_LINE>// This is safe to call without prior checks.<NEW_LINE><MASK><NEW_LINE>itemStack.setItemMeta(itemMeta);<NEW_LINE>ItemUtils.removeAbilityLore(itemStack);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (itemMetadataService.isSuperAbilityBoosted(itemStack)) {<NEW_LINE>itemMetadataService.removeBonusDigSpeedOnSuperAbilityTool(itemStack);<NEW_LINE>}<NEW_LINE>}
itemMeta.removeEnchant(Enchantment.DIG_SPEED);
850,690
static KeySpec pkcs1RsaKeySpec(byte[] bytes) {<NEW_LINE>try {<NEW_LINE>// fully qualified class names allow us to compile this without failure<NEW_LINE>sun.security.util.DerInputStream derReader = new sun.security.util.DerInputStream(bytes);<NEW_LINE>sun.security.util.DerValue[] seq = derReader.getSequence(0);<NEW_LINE>// skip version seq[0];<NEW_LINE>BigInteger modulus = seq[1].getBigInteger();<NEW_LINE>BigInteger publicExp = seq[2].getBigInteger();<NEW_LINE>BigInteger privateExp = <MASK><NEW_LINE>BigInteger prime1 = seq[4].getBigInteger();<NEW_LINE>BigInteger prime2 = seq[5].getBigInteger();<NEW_LINE>BigInteger exp1 = seq[6].getBigInteger();<NEW_LINE>BigInteger exp2 = seq[7].getBigInteger();<NEW_LINE>BigInteger crtCoef = seq[8].getBigInteger();<NEW_LINE>return new RSAPrivateCrtKeySpec(modulus, publicExp, privateExp, prime1, prime2, exp1, exp2, crtCoef);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new PkiException("Failed to get PKCS#1 RSA key spec", e);<NEW_LINE>}<NEW_LINE>}
seq[3].getBigInteger();
787,492
public String processQuery(String entityName, List<String> valueProperties, String queryString, Sort sort) {<NEW_LINE>List<Sort.Order> orders = sort.getOrders();<NEW_LINE>if (orders.isEmpty()) {<NEW_LINE>return queryString;<NEW_LINE>}<NEW_LINE>Map<Sort.Direction, List<Sort.Order>> directions = orders.stream().collect(Collectors.groupingBy(Sort.Order::getDirection));<NEW_LINE>if (directions.size() > 1) {<NEW_LINE>throw new UnsupportedOperationException("Sorting by multiple properties in different directions is not supported");<NEW_LINE>}<NEW_LINE>boolean asc = directions.keySet().iterator().next<MASK><NEW_LINE>List<String> sortExpressions = new ArrayList<>();<NEW_LINE>if (entityName != null) {<NEW_LINE>MetaClass metaClass = metadata.getClassNN(entityName);<NEW_LINE>for (Sort.Order order : sort.getOrders()) {<NEW_LINE>MetaPropertyPath metaPropertyPath = metaClass.getPropertyPath(order.getProperty());<NEW_LINE>checkNotNullArgument(metaPropertyPath, "Could not resolve property path '%s' in '%s'", order.getProperty(), metaClass);<NEW_LINE>sortExpressions.addAll(getPropertySortExpressions(metaPropertyPath, asc));<NEW_LINE>}<NEW_LINE>if (!sortExpressions.isEmpty()) {<NEW_LINE>sortExpressions.addAll(getUniqueSortExpression(sortExpressions, metaClass, asc));<NEW_LINE>}<NEW_LINE>} else if (valueProperties != null) {<NEW_LINE>List<String> selectedExpressions = queryTransformerFactory.parser(queryString).getSelectedExpressionsList();<NEW_LINE>for (Sort.Order order : sort.getOrders()) {<NEW_LINE>sortExpressions.addAll(getValuePropertySortExpression(order.getProperty(), valueProperties, selectedExpressions, asc));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return transformQuery(queryString, sortExpressions, asc);<NEW_LINE>}
() == Sort.Direction.ASC;
1,184,164
// Sleep invoke based on SLA<NEW_LINE>private long caclSleepTime(MockInfo info) {<NEW_LINE>double rMean = info.totalSleepTime.doubleValue() / info.callNum.get();<NEW_LINE>long sleepTime;<NEW_LINE>int n = ThreadLocalRandom.current().nextInt(1000);<NEW_LINE>long delta = (long) (rMean - info.mean + 1);<NEW_LINE>if (n < 900) {<NEW_LINE>sleepTime = info.p90;<NEW_LINE>} else if (900 <= n && n < 990) {<NEW_LINE>sleepTime = info.p99;<NEW_LINE>} else if (990 <= n && n < 999) {<NEW_LINE>sleepTime = info.p999;<NEW_LINE>} else {<NEW_LINE>sleepTime = info.p999 + 1;<NEW_LINE>}<NEW_LINE>// Use 0ms to offset the mean time.<NEW_LINE>sleepTime <MASK><NEW_LINE>info.totalSleepTime.addAndGet(sleepTime);<NEW_LINE>// Throw runtimeException when errorRate is defined.<NEW_LINE>if (info.errorRate != 0) {<NEW_LINE>int rate = 1;<NEW_LINE>while (info.errorRate * rate < 1) {<NEW_LINE>rate *= 10;<NEW_LINE>}<NEW_LINE>if (ThreadLocalRandom.current().nextInt(rate) == 1) {<NEW_LINE>throw new RuntimeException();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return sleepTime;<NEW_LINE>}
= delta > 0 ? 0 : sleepTime;
768,567
public static DescribeWebsiteScanResultDetailResponse unmarshall(DescribeWebsiteScanResultDetailResponse describeWebsiteScanResultDetailResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeWebsiteScanResultDetailResponse.setRequestId(_ctx.stringValue("DescribeWebsiteScanResultDetailResponse.RequestId"));<NEW_LINE>describeWebsiteScanResultDetailResponse.setBaseline(_ctx.stringValue("DescribeWebsiteScanResultDetailResponse.Baseline"));<NEW_LINE>describeWebsiteScanResultDetailResponse.setContent(_ctx.stringValue("DescribeWebsiteScanResultDetailResponse.Content"));<NEW_LINE>describeWebsiteScanResultDetailResponse.setTamperedSource(_ctx.stringValue("DescribeWebsiteScanResultDetailResponse.TamperedSource"));<NEW_LINE>describeWebsiteScanResultDetailResponse.setResourceType(_ctx.stringValue("DescribeWebsiteScanResultDetailResponse.ResourceType"));<NEW_LINE>List<String> hitKeywords = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeWebsiteScanResultDetailResponse.HitKeywords.Length"); i++) {<NEW_LINE>hitKeywords.add(_ctx.stringValue("DescribeWebsiteScanResultDetailResponse.HitKeywords[" + i + "]"));<NEW_LINE>}<NEW_LINE>describeWebsiteScanResultDetailResponse.setHitKeywords(hitKeywords);<NEW_LINE>List<ImageScanResult> imageScanResults <MASK><NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeWebsiteScanResultDetailResponse.ImageScanResults.Length"); i++) {<NEW_LINE>ImageScanResult imageScanResult = new ImageScanResult();<NEW_LINE>imageScanResult.setUrl(_ctx.stringValue("DescribeWebsiteScanResultDetailResponse.ImageScanResults[" + i + "].Url"));<NEW_LINE>List<String> labels = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeWebsiteScanResultDetailResponse.ImageScanResults[" + i + "].Labels.Length"); j++) {<NEW_LINE>labels.add(_ctx.stringValue("DescribeWebsiteScanResultDetailResponse.ImageScanResults[" + i + "].Labels[" + j + "]"));<NEW_LINE>}<NEW_LINE>imageScanResult.setLabels(labels);<NEW_LINE>imageScanResults.add(imageScanResult);<NEW_LINE>}<NEW_LINE>describeWebsiteScanResultDetailResponse.setImageScanResults(imageScanResults);<NEW_LINE>return describeWebsiteScanResultDetailResponse;<NEW_LINE>}
= new ArrayList<ImageScanResult>();
34,392
private Mono<PagedResponse<NetworkVirtualApplianceInner>> listSinglePageAsync(Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String apiVersion = "2021-05-01";<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context).map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue()<MASK><NEW_LINE>}
.nextLink(), null));
1,417,844
private Archive requireStaticLibrary(BuildTarget baseTarget, ProjectFilesystem projectFilesystem, BuildRuleParams baseParams, ActionGraphBuilder graphBuilder, HaskellPlatformsProvider haskellPlatformsProvider, HaskellPlatform platform, HaskellLibraryDescriptionArg args, ImmutableSet<BuildRule> deps, Linker.LinkableDepType depType, boolean hsProfile) {<NEW_LINE>Preconditions.checkArgument(Sets.intersection(baseTarget.getFlavors().getSet(), Sets.union(Type.FLAVOR_VALUES, haskellPlatformsProvider.getHaskellPlatforms().getFlavors(<MASK><NEW_LINE>BuildTarget target = baseTarget.withAppendedFlavors(depType == Linker.LinkableDepType.STATIC ? Type.STATIC.getFlavor() : Type.STATIC_PIC.getFlavor(), platform.getCxxPlatform().getFlavor());<NEW_LINE>if (hsProfile) {<NEW_LINE>target = target.withAppendedFlavors(HaskellDescriptionUtils.PROF);<NEW_LINE>} else {<NEW_LINE>target = target.withoutFlavors(HaskellDescriptionUtils.PROF);<NEW_LINE>}<NEW_LINE>return (Archive) graphBuilder.computeIfAbsent(target, target1 -> createStaticLibrary(target1, projectFilesystem, baseParams, graphBuilder, platform, args, deps, depType, hsProfile));<NEW_LINE>}
))).isEmpty());
420,356
public VirtualGatewayListenerTls unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>VirtualGatewayListenerTls virtualGatewayListenerTls = new VirtualGatewayListenerTls();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("certificate", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>virtualGatewayListenerTls.setCertificate(VirtualGatewayListenerTlsCertificateJsonUnmarshaller.getInstance<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("mode", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>virtualGatewayListenerTls.setMode(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("validation", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>virtualGatewayListenerTls.setValidation(VirtualGatewayListenerTlsValidationContextJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return virtualGatewayListenerTls;<NEW_LINE>}
().unmarshall(context));
1,637,918
public Object evaluate(EditorAdaptor vim, Queue<String> command) {<NEW_LINE>if (command.isEmpty()) {<NEW_LINE>try {<NEW_LINE>new ListUserCommandsCommand().execute(vim);<NEW_LINE>} catch (CommandExecutionException e) {<NEW_LINE>vim.getUserInterfaceService().setErrorMessage(e.getMessage());<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>String name = command.poll();<NEW_LINE>if (Character.isLowerCase(name.charAt(0))) {<NEW_LINE>vim.getUserInterfaceService().setErrorMessage("User defined commands must start with an uppercase letter");<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (command.isEmpty()) {<NEW_LINE>try {<NEW_LINE>new ListUserCommandsCommand(name).execute(vim);<NEW_LINE>} catch (CommandExecutionException e) {<NEW_LINE>vim.getUserInterfaceService().setErrorMessage(e.getMessage());<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>String args = "";<NEW_LINE>while (command.size() > 0) args <MASK><NEW_LINE>// add this command to the mappings for future use<NEW_LINE>vim.getPlatformSpecificStateProvider().getCommands().addUserDefined(name, args);<NEW_LINE>return null;<NEW_LINE>}
+= command.poll() + " ";
1,612,591
private void init() {<NEW_LINE>initFile(PhpUnitPreferences.isBootstrapEnabled(phpModule), PhpUnitPreferences.getBootstrapPath(phpModule), bootstrapCheckBox, bootstrapTextField);<NEW_LINE>bootstrapForCreateTestsCheckBox.setSelected(PhpUnitPreferences.isBootstrapForCreateTests(phpModule));<NEW_LINE>initFile(PhpUnitPreferences.isConfigurationEnabled(phpModule), PhpUnitPreferences.getConfigurationPath(phpModule), configurationCheckBox, configurationTextField);<NEW_LINE>initFile(PhpUnitPreferences.isCustomSuiteEnabled(phpModule), PhpUnitPreferences.getCustomSuitePath<MASK><NEW_LINE>initFile(PhpUnitPreferences.isPhpUnitEnabled(phpModule), PhpUnitPreferences.getPhpUnitPath(phpModule), scriptCheckBox, scriptTextField);<NEW_LINE>runPhpUnitOnlyCheckBox.setSelected(PhpUnitPreferences.getRunPhpUnitOnly(phpModule));<NEW_LINE>runTestUsingUnitCheckBox.setSelected(PhpUnitPreferences.getRunAllTestFiles(phpModule));<NEW_LINE>askForTestGroupsCheckBox.setSelected(PhpUnitPreferences.getAskForTestGroups(phpModule));<NEW_LINE>enableFile(bootstrapCheckBox.isSelected(), bootstrapLabel, bootstrapTextField, bootstrapGenerateButton, bootstrapBrowseButton, bootstrapForCreateTestsCheckBox);<NEW_LINE>enableFile(configurationCheckBox.isSelected(), configurationLabel, configurationTextField, configurationGenerateButton, configurationBrowseButton);<NEW_LINE>enableFile(suiteCheckBox.isSelected(), suiteLabel, suiteTextField, suiteBrowseButton, suiteInfoLabel);<NEW_LINE>enableFile(scriptCheckBox.isSelected(), scriptLabel, scriptTextField, scriptBrowseButton);<NEW_LINE>addListeners();<NEW_LINE>validateData();<NEW_LINE>category.setStoreListener(new ActionListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>storeData();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
(phpModule), suiteCheckBox, suiteTextField);
94,026
public com.amazonaws.services.mediapackagevod.model.NotFoundException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.mediapackagevod.model.NotFoundException notFoundException = new com.amazonaws.services.mediapackagevod.model.NotFoundException(null);<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return notFoundException;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
1,305,676
private void rescue(JMethod method) {<NEW_LINE>if (method == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (liveFieldsAndMethods.add(method)) {<NEW_LINE>membersToRescueIfTypeIsInstantiated.remove(method);<NEW_LINE>if (dependencyRecorder != null) {<NEW_LINE>curMethodStack.add(method);<NEW_LINE>dependencyRecorder.methodIsLiveBecause(method, curMethodStack);<NEW_LINE>}<NEW_LINE>accept(method);<NEW_LINE>if (dependencyRecorder != null) {<NEW_LINE>curMethodStack.remove(curMethodStack.size() - 1);<NEW_LINE>}<NEW_LINE>if (method.isJsniMethod() || method.canBeImplementedExternally()) {<NEW_LINE>// Returning from this method passes a value from JavaScript into Java.<NEW_LINE>maybeRescueJavaScriptObjectPassingIntoJava(method.getType());<NEW_LINE>}<NEW_LINE>if (method.canBeReferencedExternally() || method.canBeImplementedExternally()) {<NEW_LINE>for (JParameter param : method.getParams()) {<NEW_LINE>// Parameters in JsExport, JsType, JsFunction methods should not be pruned in order to<NEW_LINE>// keep the API intact.<NEW_LINE>if (method.canBeReferencedExternally()) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>rescue(param);<NEW_LINE>if (param.isVarargs()) {<NEW_LINE>assert method.isJsMethodVarargs();<NEW_LINE>// Rescue the (array) type of varargs parameters as the array creation is implicit.<NEW_LINE>JArrayType paramType = (JArrayType) param.getType().getUnderlyingType();<NEW_LINE>rescue(paramType, true);<NEW_LINE>// Rescue the class literal for the array type as it will be needed when<NEW_LINE>// ImplementJsVarargs inserts the method prelude to support the JS vararg calling<NEW_LINE>// convention.<NEW_LINE>rescue(program.getClassLiteralField(paramType.getLeafType()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>rescueOverridingMethods(method);<NEW_LINE>if (method == getClassMethod) {<NEW_LINE>rescueClassLiteralsIfGetClassIsLive();<NEW_LINE>}<NEW_LINE>if (method.getSpecialization() != null) {<NEW_LINE>rescue(method.getSpecialization().getTargetMethod());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
maybeRescueJavaScriptObjectPassingIntoJava(param.getType());
600,610
public static RawTypeInstance loadRawTypeInstance(final SQLProvider provider, final INaviModule module, final Integer typeInstanceId) throws CouldntLoadDataException {<NEW_LINE>Preconditions.checkNotNull(provider, "Error: provider argument can not be null");<NEW_LINE>Preconditions.checkNotNull(module, "Error: module argument can not be null");<NEW_LINE>Preconditions.checkNotNull(typeInstanceId, "Error: typeInstanceId argument can not be null");<NEW_LINE>final String query = " SELECT * FROM load_type_instance(?, ?) ";<NEW_LINE>try {<NEW_LINE>final PreparedStatement statement = provider.getConnection().getConnection().prepareStatement(query, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);<NEW_LINE>statement.setInt(1, module.getConfiguration().getId());<NEW_LINE>statement.setInt(2, typeInstanceId);<NEW_LINE>final ResultSet resultSet = statement.executeQuery();<NEW_LINE>try {<NEW_LINE>while (resultSet.next()) {<NEW_LINE>if (resultSet.first()) {<NEW_LINE>final int moduleId = resultSet.getInt("module_id");<NEW_LINE>final int <MASK><NEW_LINE>final String name = resultSet.getString("name");<NEW_LINE>final int commentId = resultSet.getInt("comment_id");<NEW_LINE>final int typeId = resultSet.getInt("type_id");<NEW_LINE>final int sectionId = resultSet.getInt("section_id");<NEW_LINE>final long sectionOffset = resultSet.getLong("section_offset");<NEW_LINE>return new RawTypeInstance(moduleId, id, name, commentId, typeId, sectionId, sectionOffset);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>resultSet.close();<NEW_LINE>statement.close();<NEW_LINE>}<NEW_LINE>} catch (final SQLException exception) {<NEW_LINE>throw new CouldntLoadDataException(exception);<NEW_LINE>}<NEW_LINE>throw new CouldntLoadDataException("Error: could not load singe type instance from the database.");<NEW_LINE>}
id = resultSet.getInt("id");
512,430
private String md5String(String source, String salt, int iterator) {<NEW_LINE>StringBuilder token = new StringBuilder();<NEW_LINE>try {<NEW_LINE>MessageDigest <MASK><NEW_LINE>if (StringUtils.isNotEmpty(salt)) {<NEW_LINE>digest.update(salt.getBytes(StandardCharsets.UTF_8));<NEW_LINE>}<NEW_LINE>byte[] result = digest.digest(source.getBytes());<NEW_LINE>for (int i = 0; i < iterator - 1; i++) {<NEW_LINE>digest.reset();<NEW_LINE>result = digest.digest(result);<NEW_LINE>}<NEW_LINE>for (byte aResult : result) {<NEW_LINE>int temp = aResult & 0xFF;<NEW_LINE>if (temp <= 0xF) {<NEW_LINE>token.append("0");<NEW_LINE>}<NEW_LINE>token.append(Integer.toHexString(temp));<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new RuntimeException(e.getMessage());<NEW_LINE>}<NEW_LINE>return token.toString();<NEW_LINE>}
digest = MessageDigest.getInstance("md5");
1,711,667
private Iterable<String> queryStringIndex(final String key, final String prefix) throws DatastoreException {<NEW_LINE>List<ResultSetFuture> futures = queryClusters((cluster) -> {<NEW_LINE>BoundStatement boundStatement <MASK><NEW_LINE>boundStatement.setBytesUnsafe(0, serializeString(key));<NEW_LINE>boundStatement.setBytesUnsafe(1, serializeString(prefix));<NEW_LINE>boundStatement.setBytesUnsafe(2, serializeEndString(prefix));<NEW_LINE>boundStatement.setConsistencyLevel(cluster.getReadConsistencyLevel());<NEW_LINE>return cluster.executeAsync(boundStatement);<NEW_LINE>});<NEW_LINE>ListenableFuture<List<ResultSet>> listListenableFuture = Futures.allAsList(futures);<NEW_LINE>Set<String> ret = new HashSet<String>();<NEW_LINE>try {<NEW_LINE>Iterator<ResultSet> iterator = listListenableFuture.get().iterator();<NEW_LINE>while (iterator.hasNext()) {<NEW_LINE>ResultSet resultSet = iterator.next();<NEW_LINE>while (!resultSet.isExhausted()) {<NEW_LINE>Row row = resultSet.one();<NEW_LINE>ret.add(row.getString(0));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new DatastoreException("CQL Query failure", e);<NEW_LINE>}<NEW_LINE>return ret;<NEW_LINE>}
= new BoundStatement(cluster.psStringIndexPrefixQuery);
1,326,496
public Optional<RefundInvoiceCandidate> ofNullableRefundRecord(@Nullable final I_C_Invoice_Candidate refundRecord) {<NEW_LINE>final IUOMDAO uomDAO = Services.get(IUOMDAO.class);<NEW_LINE>final IProductDAO productDAO = Services.get(IProductDAO.class);<NEW_LINE>final IProductBL productBL = Services.get(IProductBL.class);<NEW_LINE>if (refundRecord == null) {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>final TableRecordReference reference = refundRecord.getAD_Table_ID() > 0 ? TableRecordReference.ofReferenced(refundRecord) : null;<NEW_LINE>final RefundContract refundContract = retrieveRefundContractOrNull(reference);<NEW_LINE>if (refundContract == null) {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>final InvoiceCandidateId invoiceCandidateId = InvoiceCandidateId.ofRepoId(refundRecord.getC_Invoice_Candidate_ID());<NEW_LINE>final Map<RefundConfig, BigDecimal> configIdAndQuantity = assignmentAggregateService.retrieveAssignedQuantities(invoiceCandidateId);<NEW_LINE>final List<RefundConfig> refundConfigs;<NEW_LINE>final BigDecimal assignedQuantity;<NEW_LINE>if (configIdAndQuantity.isEmpty()) {<NEW_LINE>refundConfigs = ImmutableList.of(refundContract.getRefundConfig(ZERO));<NEW_LINE>assignedQuantity = ZERO;<NEW_LINE>} else {<NEW_LINE>// add assigned quantities for the different refund configs<NEW_LINE>assignedQuantity = configIdAndQuantity.values().stream().reduce(ZERO, BigDecimal::add);<NEW_LINE>refundConfigs = ImmutableList.copyOf(configIdAndQuantity.keySet());<NEW_LINE>}<NEW_LINE>final Timestamp invoicableFromDate = getValueOverrideOrValue(refundRecord, I_C_Invoice_Candidate.COLUMNNAME_DateToInvoice);<NEW_LINE>final BigDecimal priceActual = <MASK><NEW_LINE>final Money money = Money.of(priceActual, CurrencyId.ofRepoId(refundRecord.getC_Currency_ID()));<NEW_LINE>final I_C_UOM productUom = productBL.getStockUOM(ProductId.ofRepoId(refundRecord.getM_Product_ID()));<NEW_LINE>final BPartnerLocationAndCaptureId billLocationId = InvoiceCandidateLocationAdapterFactory.billLocationAdapter(refundRecord).getBPartnerLocationAndCaptureId();<NEW_LINE>final RefundInvoiceCandidate invoiceCandidate = RefundInvoiceCandidate.builder().id(invoiceCandidateId).refundContract(refundContract).refundConfigs(refundConfigs).assignedQuantity(Quantity.of(assignedQuantity, productUom)).bpartnerId(billLocationId.getBpartnerId()).bpartnerLocationId(billLocationId.getBpartnerLocationId()).invoiceableFrom(TimeUtil.asLocalDate(invoicableFromDate)).money(money).build();<NEW_LINE>return Optional.of(invoiceCandidate);<NEW_LINE>}
getValueOverrideOrValue(refundRecord, I_C_Invoice_Candidate.COLUMNNAME_PriceActual);
354,158
public void start(Stage stage) {<NEW_LINE>this.stage = stage;<NEW_LINE>WorkspaceWindow workspaceWindow = new WorkspaceWindow();<NEW_LINE>workspaceWindow.readFromFile();<NEW_LINE>if (WorkspaceWindow.getWorkspace() == null) {<NEW_LINE>workspaceWindow.show(null);<NEW_LINE>}<NEW_LINE>if (WorkspaceWindow.getWorkspace() == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>GlobalConfig.getInstance().setWorkspace(WorkspaceWindow.getWorkspace().getAbsolutePath());<NEW_LINE>stage.setTitle(SystemProperties.getInstance().getSystemName());<NEW_LINE>mainWindow = new MainWindow(stage, SystemProperties.getInstance().getWidth(), SystemProperties.getInstance().getHeight());<NEW_LINE>mainWindow.getStage().setMaximized(true);<NEW_LINE>scene = mainWindow.getScene();<NEW_LINE>// ImageView iv = new ImageView(new Image("file:images/LisaSumoIcon.png"));<NEW_LINE>// mainWindow.getCenterAnchorPane().getChildren().add(iv);<NEW_LINE>stage.setOnCloseRequest((WindowEvent event) -> {<NEW_LINE>Actions.getInstance().exitSystem(event, stage);<NEW_LINE>});<NEW_LINE>DLRLogger.setLevel(LogLevel.parse(GlobalConfig.getInstance().getLoggingLevel()));<NEW_LINE>initMainMenu();<NEW_LINE>stage.getIcons().add(SystemProperties.getInstance().getMainIcon());<NEW_LINE>Message.setProgramName(SystemProperties.getInstance().getSystemName());<NEW_LINE>Message.setIcon(SystemProperties.getInstance().getMainIcon());<NEW_LINE>mainWindow.getCenterArea().set(new CenterAdmin().getNode());<NEW_LINE>mainWindow.getTopArea().<MASK><NEW_LINE>mainWindow.getTopArea().getMainToolBar().addToolBar(simulationToolBar);<NEW_LINE>bottomBarUpdate();<NEW_LINE>changeApplicationTitleListener();<NEW_LINE>mainWindow.show();<NEW_LINE>}
getMainToolBar().addToolBar(fileToolBar);
1,248,556
protected void makeKeepersOk(Long clusterDbId, Long shardDbId, Pair<String, Integer> newMaster) {<NEW_LINE>List<KeeperMeta> keepers = currentMetaManager.getSurviveKeepers(clusterDbId, shardDbId);<NEW_LINE>executionLog.info("[makeKeepersOk]" + keepers);<NEW_LINE>KeeperStateChangeJob job = new KeeperStateChangeJob(keepers, new Pair<String, Integer>(newMaster.getKey(), newMaster.getValue()), currentMetaManager.randomRoute(clusterDbId), keyedObjectPool, 1000, 1, scheduled, executors);<NEW_LINE>try {<NEW_LINE>job.execute().get(waitTimeoutSeconds / 2, TimeUnit.SECONDS);<NEW_LINE>executionLog.info("[makeKeepersOk]success");<NEW_LINE>} catch (InterruptedException | ExecutionException | TimeoutException e) {<NEW_LINE>logger.error(<MASK><NEW_LINE>executionLog.info("[makeKeepersOk][fail]" + e.getMessage());<NEW_LINE>}<NEW_LINE>}
"[makeKeepersOk]" + e.getMessage());
842,871
private void logResponse(final ShenyuContext shenyuContext, final BodyWriter writer) {<NEW_LINE>if (StringUtils.isNotBlank(getHeaders().getFirst(HttpHeaders.CONTENT_LENGTH))) {<NEW_LINE>String size = StringUtils.defaultIfEmpty(getHeaders().getFirst(HttpHeaders.CONTENT_LENGTH), "0");<NEW_LINE>logInfo.setResponseContentLength(Integer.parseInt(size));<NEW_LINE>} else {<NEW_LINE>logInfo.setResponseContentLength(writer.size());<NEW_LINE>}<NEW_LINE>logInfo.setTimeLocal(shenyuContext.getStartDateTime().format(DATE_TIME_FORMATTER));<NEW_LINE>logInfo.setModule(shenyuContext.getModule());<NEW_LINE>long costTime = DateUtils.acquireMillisBetween(shenyuContext.getStartDateTime(), LocalDateTime.now());<NEW_LINE>logInfo.setUpstreamResponseTime(costTime);<NEW_LINE>logInfo.setMethod(shenyuContext.getMethod());<NEW_LINE>logInfo.<MASK><NEW_LINE>if (StringUtils.isNotBlank(shenyuContext.getRpcType())) {<NEW_LINE>logInfo.setUpstreamIp(getUpstreamIp());<NEW_LINE>}<NEW_LINE>int size = writer.size();<NEW_LINE>String body = writer.output();<NEW_LINE>if (size > 0 && !LogCollectConfigUtils.isResponseBodyTooLarge(size)) {<NEW_LINE>logInfo.setResponseBody(body);<NEW_LINE>}<NEW_LINE>// collect log<NEW_LINE>if (Objects.nonNull(logCollector)) {<NEW_LINE>logCollector.collect(logInfo);<NEW_LINE>}<NEW_LINE>}
setRpcType(shenyuContext.getRpcType());
944,513
private TypeDefPatch updateSubjectAreaDefinitionEntity() {<NEW_LINE>final String typeName = "SubjectAreaDefinition";<NEW_LINE>TypeDefPatch <MASK><NEW_LINE>typeDefPatch.setUpdatedBy(originatorName);<NEW_LINE>typeDefPatch.setUpdateTime(creationDate);<NEW_LINE>List<TypeDefAttribute> properties = new ArrayList<>();<NEW_LINE>TypeDefAttribute property;<NEW_LINE>final String attribute5Name = "domain";<NEW_LINE>final String attribute5Description = "Deprecated. Governance domain for this governance definition.";<NEW_LINE>final String attribute5DescriptionGUID = null;<NEW_LINE>final String attribute5ReplacedBy = "domainIdentifier";<NEW_LINE>property = archiveHelper.getEnumTypeDefAttribute("GovernanceDomain", attribute5Name, attribute5Description, attribute5DescriptionGUID);<NEW_LINE>property.setAttributeStatus(TypeDefAttributeStatus.DEPRECATED_ATTRIBUTE);<NEW_LINE>property.setReplacedByAttribute(attribute5ReplacedBy);<NEW_LINE>properties.add(property);<NEW_LINE>typeDefPatch.setPropertyDefinitions(properties);<NEW_LINE>return typeDefPatch;<NEW_LINE>}
typeDefPatch = archiveBuilder.getPatchForType(typeName);
216,559
public Request<DeleteMessageRequest> marshall(DeleteMessageRequest deleteMessageRequest) {<NEW_LINE>if (deleteMessageRequest == null) {<NEW_LINE>throw new AmazonClientException("Invalid argument passed to marshall(DeleteMessageRequest)");<NEW_LINE>}<NEW_LINE>Request<DeleteMessageRequest> request = new DefaultRequest<DeleteMessageRequest>(deleteMessageRequest, "AmazonSQS");<NEW_LINE>request.addParameter("Action", "DeleteMessage");<NEW_LINE>request.addParameter("Version", "2012-11-05");<NEW_LINE>String prefix;<NEW_LINE>if (deleteMessageRequest.getQueueUrl() != null) {<NEW_LINE>prefix = "QueueUrl";<NEW_LINE>String queueUrl = deleteMessageRequest.getQueueUrl();<NEW_LINE>request.addParameter(prefix<MASK><NEW_LINE>}<NEW_LINE>if (deleteMessageRequest.getReceiptHandle() != null) {<NEW_LINE>prefix = "ReceiptHandle";<NEW_LINE>String receiptHandle = deleteMessageRequest.getReceiptHandle();<NEW_LINE>request.addParameter(prefix, StringUtils.fromString(receiptHandle));<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
, StringUtils.fromString(queueUrl));
817,315
public static byte[] toByteArray(TbMsg msg) {<NEW_LINE>MsgProtos.TbMsgProto.Builder builder = MsgProtos.TbMsgProto.newBuilder();<NEW_LINE>builder.setId(msg.getId().toString());<NEW_LINE>builder.setTs(msg.getTs());<NEW_LINE>builder.setType(msg.getType());<NEW_LINE>builder.setEntityType(msg.getOriginator().getEntityType().name());<NEW_LINE>builder.setEntityIdMSB(msg.getOriginator().getId().getMostSignificantBits());<NEW_LINE>builder.setEntityIdLSB(msg.getOriginator().getId().getLeastSignificantBits());<NEW_LINE>if (msg.getCustomerId() != null) {<NEW_LINE>builder.setCustomerIdMSB(msg.getCustomerId().getId().getMostSignificantBits());<NEW_LINE>builder.setCustomerIdLSB(msg.getCustomerId().getId().getLeastSignificantBits());<NEW_LINE>}<NEW_LINE>if (msg.getRuleChainId() != null) {<NEW_LINE>builder.setRuleChainIdMSB(msg.getRuleChainId().getId().getMostSignificantBits());<NEW_LINE>builder.setRuleChainIdLSB(msg.getRuleChainId().getId().getLeastSignificantBits());<NEW_LINE>}<NEW_LINE>if (msg.getRuleNodeId() != null) {<NEW_LINE>builder.setRuleNodeIdMSB(msg.getRuleNodeId().getId().getMostSignificantBits());<NEW_LINE>builder.setRuleNodeIdLSB(msg.getRuleNodeId().<MASK><NEW_LINE>}<NEW_LINE>if (msg.getMetaData() != null) {<NEW_LINE>builder.setMetaData(MsgProtos.TbMsgMetaDataProto.newBuilder().putAllData(msg.getMetaData().getData()).build());<NEW_LINE>}<NEW_LINE>builder.setDataType(msg.getDataType().ordinal());<NEW_LINE>builder.setData(msg.getData());<NEW_LINE>builder.setCtx(msg.ctx.toProto());<NEW_LINE>return builder.build().toByteArray();<NEW_LINE>}
getId().getLeastSignificantBits());
1,843,797
ActionResult<Wo> execute(EffectivePerson effectivePerson, String id) throws Exception {<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>Business business = new Business(emc);<NEW_LINE>ActionResult<Wo> result = new ActionResult<>();<NEW_LINE>ImportModel model = business.pick(id, ImportModel.class);<NEW_LINE>if (null == model) {<NEW_LINE>throw new ExceptionEntityNotExist(id, ImportModel.class);<NEW_LINE>}<NEW_LINE>Query query = business.pick(model.getQuery(), Query.class);<NEW_LINE>if (null == query) {<NEW_LINE>throw new ExceptionEntityNotExist(model.getQuery(), Query.class);<NEW_LINE>}<NEW_LINE>if (!business.readable(effectivePerson, query)) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (!business.readable(effectivePerson, model)) {<NEW_LINE>throw new ExceptionAccessDenied(effectivePerson, model);<NEW_LINE>}<NEW_LINE>Wo wo = Wo.copier.copy(model);<NEW_LINE>result.setData(wo);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>}
throw new ExceptionAccessDenied(effectivePerson, query);
647,213
public JComponent createOptionsPanel() {<NEW_LINE>return OptionsComponent.create((component) -> {<NEW_LINE>component.addDropDown("PHPUnit version", PHP_UNIT_VERSION == null ? PhpUnitVersion.PHPUNIT80 : PHP_UNIT_VERSION, (version) -> PHP_UNIT_VERSION = (PhpUnitVersion) version);<NEW_LINE>component.addCheckbox("Promote dedicated asserts", PROMOTE_PHPUNIT_API, (isSelected) -> PROMOTE_PHPUNIT_API = isSelected);<NEW_LINE>component.addCheckbox("Promote ->once()", PROMOTE_MOCKING_ONCE, (isSelected) -> PROMOTE_MOCKING_ONCE = isSelected);<NEW_LINE>component.addCheckbox("Promote ->willReturn*(...)", PROMOTE_MOCKING_WILL_RETURN, (isSelected) -> PROMOTE_MOCKING_WILL_RETURN = isSelected);<NEW_LINE>component.addCheckbox("Suggest to use type safe asserts", SUGGEST_TO_USE_ASSERTSAME, <MASK><NEW_LINE>component.addCheckbox("Suggest to use named datasets", SUGGEST_TO_USE_NAMED_DATASETS, (isSelected) -> SUGGEST_TO_USE_NAMED_DATASETS = isSelected);<NEW_LINE>});<NEW_LINE>}
(isSelected) -> SUGGEST_TO_USE_ASSERTSAME = isSelected);
421,227
public Boolean visitBinary(BinaryTree node, Void p) {<NEW_LINE>int alignIndent = cs.alignMultilineBinaryOp() ? col : -1;<NEW_LINE>scan(node.getLeftOperand(), p);<NEW_LINE>if (cs.wrapAfterBinaryOps()) {<NEW_LINE>boolean containedNewLine = spaces(cs.spaceAroundBinaryOps() ? 1 : 0, false);<NEW_LINE>if (OPERATOR.equals(tokens.token().id().primaryCategory())) {<NEW_LINE>col += tokens<MASK><NEW_LINE>lastBlankLines = -1;<NEW_LINE>lastBlankLinesTokenIndex = -1;<NEW_LINE>tokens.moveNext();<NEW_LINE>if (containedNewLine)<NEW_LINE>newline();<NEW_LINE>}<NEW_LINE>wrapTree(cs.wrapBinaryOps(), alignIndent, cs.spaceAroundBinaryOps() ? 1 : 0, node.getRightOperand());<NEW_LINE>} else {<NEW_LINE>wrapOperatorAndTree(cs.wrapBinaryOps(), alignIndent, cs.spaceAroundBinaryOps() ? 1 : 0, node.getRightOperand());<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
.token().length();
1,290,206
public MultiPolygon toMultiPolygon() {<NEW_LINE>GeometryFactory geometryFactory = new GeometryFactory();<NEW_LINE>MultiPolygon emptyMultiPolygon = geometryFactory.createMultiPolygon(new Polygon[0]);<NEW_LINE>List<Polygon> polygons = new ArrayList<>();<NEW_LINE>for (Ring outerRing : outerRings) {<NEW_LINE>if (!outerRing.isClosed()) {<NEW_LINE>return emptyMultiPolygon;<NEW_LINE>}<NEW_LINE>List<LinearRing> innerLinearRings = new ArrayList<>();<NEW_LINE>Set<Ring> innerRings = containedInnerInOuter.get(outerRing);<NEW_LINE>if (!Algorithms.isEmpty(innerRings)) {<NEW_LINE>for (Ring innerRing : innerRings) {<NEW_LINE>if (!innerRing.isClosed()) {<NEW_LINE>return emptyMultiPolygon;<NEW_LINE>}<NEW_LINE>innerLinearRings.add(innerRing.toLinearRing());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>polygons.add(geometryFactory.createPolygon(outerRing.toLinearRing(), innerLinearRings.toArray(<MASK><NEW_LINE>}<NEW_LINE>return geometryFactory.createMultiPolygon(polygons.toArray(new Polygon[0]));<NEW_LINE>}
new LinearRing[0])));
557,652
private boolean matchProblem(Diagnostic problem, String expect) {<NEW_LINE>String[] <MASK><NEW_LINE>assertEquals(2, parts.length);<NEW_LINE>String badSnippet = parts[0];<NEW_LINE>String snippetBefore;<NEW_LINE>String snippetAfter;<NEW_LINE>String[] badParts = StringUtil.split(badSnippet, '^');<NEW_LINE>Assert.assertTrue(badParts.length <= 3);<NEW_LINE>if (badParts.length == 1) {<NEW_LINE>snippetBefore = "";<NEW_LINE>snippetAfter = "";<NEW_LINE>badSnippet = badParts[0];<NEW_LINE>} else if (badParts.length == 2) {<NEW_LINE>snippetBefore = "";<NEW_LINE>badSnippet = badParts[0];<NEW_LINE>snippetAfter = badParts[1];<NEW_LINE>} else {<NEW_LINE>// badParts.length == 3<NEW_LINE>snippetBefore = badParts[0];<NEW_LINE>badSnippet = badParts[1];<NEW_LINE>snippetAfter = badParts[2];<NEW_LINE>}<NEW_LINE>String messageSnippet = parts[1];<NEW_LINE>boolean spaceSensitive = badSnippet.trim().length() < badSnippet.length();<NEW_LINE>boolean emptyRange = problem.getRange().getStart().equals(problem.getRange().getEnd());<NEW_LINE>String actualBadSnippet = emptyRange ? getCharAt(problem.getRange().getStart()) : getText(problem.getRange());<NEW_LINE>if (!spaceSensitive) {<NEW_LINE>actualBadSnippet = actualBadSnippet.trim();<NEW_LINE>}<NEW_LINE>int start = doc.toOffset(problem.getRange().getStart());<NEW_LINE>int end = doc.toOffset(problem.getRange().getEnd());<NEW_LINE>return actualBadSnippet.equals(badSnippet) && snippetBefore.equals(doc.textBetween(start - snippetBefore.length(), start)) && snippetAfter.equals(doc.textBetween(end, end + snippetAfter.length())) && problem.getMessage().contains(messageSnippet);<NEW_LINE>}
parts = expect.split("\\|");
894,726
public CustomPluginFileDescription unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>CustomPluginFileDescription customPluginFileDescription = new CustomPluginFileDescription();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("fileMd5", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>customPluginFileDescription.setFileMd5(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("fileSize", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>customPluginFileDescription.setFileSize(context.getUnmarshaller(Long.<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return customPluginFileDescription;<NEW_LINE>}
class).unmarshall(context));
1,431,546
protected void checkExtendsImplements(ClassTree classTree) {<NEW_LINE>if (TypesUtils.isAnonymous(TreeUtils.typeOf(classTree))) {<NEW_LINE>// Don't check extends clause on anonymous classes.<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Set<AnnotationMirror> classBounds = atypeFactory.getTypeDeclarationBounds<MASK><NEW_LINE>QualifierHierarchy qualifierHierarchy = atypeFactory.getQualifierHierarchy();<NEW_LINE>// If "@B class Y extends @A X {}", then enforce that @B must be a subtype of @A.<NEW_LINE>// classTree.getExtendsClause() is null when there is no explicitly-written extends clause,<NEW_LINE>// as in "class X {}". This is equivalent to writing "class X extends @Top Object {}", so<NEW_LINE>// there is no need to do any subtype checking.<NEW_LINE>if (classTree.getExtendsClause() != null) {<NEW_LINE>Set<AnnotationMirror> extendsAnnos = atypeFactory.getTypeOfExtendsImplements(classTree.getExtendsClause()).getAnnotations();<NEW_LINE>for (AnnotationMirror classAnno : classBounds) {<NEW_LINE>AnnotationMirror extendsAnno = qualifierHierarchy.findAnnotationInSameHierarchy(extendsAnnos, classAnno);<NEW_LINE>if (!qualifierHierarchy.isSubtype(classAnno, extendsAnno)) {<NEW_LINE>checker.reportError(classTree.getExtendsClause(), "declaration.inconsistent.with.extends.clause", classAnno, extendsAnno);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Do the same check as above for implements clauses.<NEW_LINE>for (Tree implementsClause : classTree.getImplementsClause()) {<NEW_LINE>Set<AnnotationMirror> implementsClauseAnnos = atypeFactory.getTypeOfExtendsImplements(implementsClause).getAnnotations();<NEW_LINE>for (AnnotationMirror classAnno : classBounds) {<NEW_LINE>AnnotationMirror implementsAnno = qualifierHierarchy.findAnnotationInSameHierarchy(implementsClauseAnnos, classAnno);<NEW_LINE>if (!qualifierHierarchy.isSubtype(classAnno, implementsAnno)) {<NEW_LINE>checker.reportError(implementsClause, "declaration.inconsistent.with.implements.clause", classAnno, implementsAnno);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(TreeUtils.typeOf(classTree));
407,359
// snippet-start:[pinpoint.java2.update_endpoint.main]<NEW_LINE>public static void updatePinpointEndpoint(PinpointClient pinpoint, String applicationId, String endPointId) {<NEW_LINE>try {<NEW_LINE>List<String> wangXiList = new ArrayList<String>();<NEW_LINE>wangXiList.add("cooking");<NEW_LINE>wangXiList.add("running");<NEW_LINE>wangXiList.add("swimming");<NEW_LINE>Map myMapWang = new HashMap<String, List>();<NEW_LINE>myMapWang.put("interests", wangXiList);<NEW_LINE>List<String> myNameWang = new ArrayList<String>();<NEW_LINE>myNameWang.add("Wang ");<NEW_LINE>myNameWang.add("Xiulan");<NEW_LINE>Map wangName = new HashMap<String, List>();<NEW_LINE>wangName.put("name", myNameWang);<NEW_LINE>EndpointUser wangMajor = EndpointUser.builder().userId("example_user_10").userAttributes(wangName).build();<NEW_LINE>// Create an EndpointBatchItem object for Mary Major.<NEW_LINE>EndpointRequest wangXiulanEndpoint = EndpointRequest.builder().channelType(ChannelType.EMAIL).address("wang_xiulan@example.com").attributes(myMapWang).<MASK><NEW_LINE>// Adds multiple endpoint definitions to a single request object.<NEW_LINE>UpdateEndpointRequest endpointList = UpdateEndpointRequest.builder().applicationId(applicationId).endpointRequest(wangXiulanEndpoint).endpointId(endPointId).build();<NEW_LINE>UpdateEndpointResponse result = pinpoint.updateEndpoint(endpointList);<NEW_LINE>System.out.format("Update endpoint result: %s\n", result.messageBody().message());<NEW_LINE>} catch (PinpointException e) {<NEW_LINE>System.err.println(e.awsErrorDetails().errorMessage());<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>}
user(wangMajor).build();
1,451,021
public void resize() {<NEW_LINE>if (((m_initialMovieHeight == -1 || m_initialMovieWidth == -1) && !m_isAudioOnly) || m_textureView == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Handler handler = new Handler(Looper.getMainLooper());<NEW_LINE>handler.post(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>View <MASK><NEW_LINE>if (currentParent != null) {<NEW_LINE>int screenWidth = currentParent.getWidth();<NEW_LINE>int newHeight = 200;<NEW_LINE>if (!m_isAudioOnly) {<NEW_LINE>newHeight = (int) ((float) (screenWidth * m_initialMovieHeight) / (float) m_initialMovieWidth);<NEW_LINE>} else {<NEW_LINE>newHeight = 200;<NEW_LINE>}<NEW_LINE>if (m_textureView != null) {<NEW_LINE>FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) m_textureView.getLayoutParams();<NEW_LINE>layoutParams.width = screenWidth;<NEW_LINE>layoutParams.height = newHeight;<NEW_LINE>m_textureView.setLayoutParams(layoutParams);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
currentParent = (View) getParent();
680,607
public boolean optimize(int numIterations) {<NEW_LINE>int iterations;<NEW_LINE>double[] params = new double[maxable.getNumParameters()];<NEW_LINE>double[] gis = new double[maxable.getNumParameters()];<NEW_LINE>double[] old_params = new double[maxable.getNumParameters()];<NEW_LINE>double[] updates = new double[maxable.getNumParameters()];<NEW_LINE>maxable.getParameters(params);<NEW_LINE>maxable.getParameters(gis);<NEW_LINE>maxable.getParameters(old_params);<NEW_LINE>for (iterations = 0; iterations < numIterations; iterations++) {<NEW_LINE>boolean complete = false;<NEW_LINE>double old = maxable.getValue();<NEW_LINE>maxable.getGISUpdate(updates);<NEW_LINE>MatrixOps.plusEquals(gis, updates);<NEW_LINE>MatrixOps.plusEquals(params, updates, eta);<NEW_LINE>maxable.setParameters(params);<NEW_LINE>double next = maxable.getValue();<NEW_LINE>// Different from normal AGIS, only fall back to GIS updates<NEW_LINE>// If log-likelihood gets worse<NEW_LINE>// i.e. if lower log-likelihood, always make AGIS update<NEW_LINE>if (next > old) {<NEW_LINE>complete = true;<NEW_LINE>// don't let eta get too large<NEW_LINE>if (eta * alpha < 99999999.0)<NEW_LINE>eta = eta * alpha;<NEW_LINE>}<NEW_LINE>if (backTrack && complete == false) {<NEW_LINE>// gone too far<NEW_LINE>// unlike Roweis et al., we will back track on eta to find<NEW_LINE>// acceptable value, instead of automatically setting it to 1<NEW_LINE>while (eta > 1.0 && complete == false) {<NEW_LINE>eta = eta / 2.0;<NEW_LINE>MatrixOps.set(params, old_params);<NEW_LINE>MatrixOps.<MASK><NEW_LINE>maxable.setParameters(params);<NEW_LINE>next = maxable.getValue();<NEW_LINE>if (next > old)<NEW_LINE>complete = true;<NEW_LINE>}<NEW_LINE>} else if (complete == false) {<NEW_LINE>maxable.setParameters(gis);<NEW_LINE>eta = 1.0;<NEW_LINE>next = maxable.getValue();<NEW_LINE>}<NEW_LINE>logger.info("eta: " + eta);<NEW_LINE>if (2.0 * Math.abs(next - old) <= tolerance * (Math.abs(next) + Math.abs(old) + eps)) {<NEW_LINE>converged = true;<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (numIterations > 1) {<NEW_LINE>maxable.getParameters(params);<NEW_LINE>maxable.getParameters(old_params);<NEW_LINE>maxable.getParameters(gis);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>converged = false;<NEW_LINE>return false;<NEW_LINE>}
plusEquals(params, updates, eta);
1,560,198
private void loadNode86() {<NEW_LINE>UaMethodNode node = new UaMethodNode(this.context, Identifiers.CertificateGroupFolderType_AdditionalGroup_Placeholder_TrustList_OpenWithMasks, new QualifiedName(0, "OpenWithMasks"), new LocalizedText("en", "OpenWithMasks"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), true, true);<NEW_LINE>node.addReference(new Reference(Identifiers.CertificateGroupFolderType_AdditionalGroup_Placeholder_TrustList_OpenWithMasks, Identifiers.HasProperty, Identifiers.CertificateGroupFolderType_AdditionalGroup_Placeholder_TrustList_OpenWithMasks_InputArguments.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.CertificateGroupFolderType_AdditionalGroup_Placeholder_TrustList_OpenWithMasks, Identifiers.HasProperty, Identifiers.CertificateGroupFolderType_AdditionalGroup_Placeholder_TrustList_OpenWithMasks_OutputArguments.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.CertificateGroupFolderType_AdditionalGroup_Placeholder_TrustList_OpenWithMasks, Identifiers.HasModellingRule, Identifiers.ModellingRule_Mandatory<MASK><NEW_LINE>node.addReference(new Reference(Identifiers.CertificateGroupFolderType_AdditionalGroup_Placeholder_TrustList_OpenWithMasks, Identifiers.HasComponent, Identifiers.CertificateGroupFolderType_AdditionalGroup_Placeholder_TrustList.expanded(), false));<NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>}
.expanded(), true));
606,559
private void parseTagkCustomRule() {<NEW_LINE>if (meta.getTags() == null || meta.getTags().isEmpty()) {<NEW_LINE>throw new IllegalStateException("Timeseries meta data was missing tags");<NEW_LINE>}<NEW_LINE>// first, find the tagk UIDMeta we're matching against<NEW_LINE>UIDMeta tagk = null;<NEW_LINE>for (UIDMeta tag : meta.getTags()) {<NEW_LINE>if (tag.getType() == UniqueIdType.TAGK && tag.getName().equals(rule.getField())) {<NEW_LINE>tagk = tag;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (tagk == null) {<NEW_LINE>testMessage("No match on tagk [" + rule.getField() + "] for rule: " + rule);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// now scan the custom tags for a matching tag name and it's value<NEW_LINE>testMessage("Matched tagk [" + rule.getField() + "] for rule: " + rule);<NEW_LINE>final Map<String, String> custom = tagk.getCustom();<NEW_LINE>if (custom != null && custom.containsKey(rule.getCustomField())) {<NEW_LINE>if (custom.get(rule.getCustomField()) == null) {<NEW_LINE>throw new IllegalStateException("Value for custom tagk field [" + rule.getCustomField() + "] was null");<NEW_LINE>}<NEW_LINE>processParsedValue(custom.get(rule.getCustomField()));<NEW_LINE>testMessage("Matched custom tag [" + rule.<MASK><NEW_LINE>} else {<NEW_LINE>testMessage("No match on custom tag [" + rule.getCustomField() + "] for rule: " + rule);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}
getCustomField() + "] for rule: " + rule);
22,492
private String mergePathsRemoveDots(String basePath) {<NEW_LINE>int slash = basePath.lastIndexOf('/');<NEW_LINE>StringBuffer output = new StringBuffer();<NEW_LINE>if (slash != -1)<NEW_LINE>output.append(basePath.substring<MASK><NEW_LINE>if (base.dotsOK() && rel.dotsOK()) {<NEW_LINE>String relPath = rel.getRawPath();<NEW_LINE>if (relPath.startsWith("./"))<NEW_LINE>relPath = relPath.substring(2);<NEW_LINE>while (relPath.startsWith("../")) {<NEW_LINE>relPath = relPath.substring(3);<NEW_LINE>removeLastSeqment2(output);<NEW_LINE>}<NEW_LINE>if (relPath.equals("..")) {<NEW_LINE>relPath = "";<NEW_LINE>removeLastSeqment2(output);<NEW_LINE>}<NEW_LINE>if (relPath.equals("."))<NEW_LINE>relPath = "";<NEW_LINE>output.append(relPath);<NEW_LINE>return output.toString();<NEW_LINE>}<NEW_LINE>output.append(rel.getRawPath());<NEW_LINE>return removeDotSegments(output.toString());<NEW_LINE>}
(0, slash + 1));
487,708
public org.apache.dubbo.remoting.ChannelHandler dispatch(org.apache.dubbo.remoting.ChannelHandler arg0, org.apache.dubbo.common.URL arg1) {<NEW_LINE>if (arg1 == null)<NEW_LINE>throw new IllegalArgumentException("url == null");<NEW_LINE>org.apache.dubbo.common.URL url = arg1;<NEW_LINE>String extName = url.getParameter("dispatcher", url.getParameter("dispather", url.getParameter("channel.handler", "all")));<NEW_LINE>if (extName == null)<NEW_LINE>throw new IllegalStateException("Failed to get extension (org.apache.dubbo.remoting.Dispatcher) name from url (" + url.toString() + ") use keys([dispatcher, dispather, channel.handler])");<NEW_LINE>ScopeModel scopeModel = ScopeModelUtil.getOrDefault(url.getScopeModel(), org.apache.dubbo.remoting.Dispatcher.class);<NEW_LINE>org.apache.dubbo.remoting.Dispatcher extension = (org.apache.dubbo.remoting.Dispatcher) scopeModel.getExtensionLoader(org.apache.dubbo.remoting.Dispatcher.class).getExtension(extName);<NEW_LINE>return <MASK><NEW_LINE>}
extension.dispatch(arg0, arg1);
1,655,367
public void addCurrencies() {<NEW_LINE>try {<NEW_LINE>InputStream is = mContext.getAssets().open("currency.json");<NEW_LINE>int size = is.available();<NEW_LINE>byte[] buffer = new byte[size];<NEW_LINE>is.read(buffer);<NEW_LINE>is.close();<NEW_LINE>s_ids_names = new String(buffer, "UTF-8");<NEW_LINE>} catch (IOException ex) {<NEW_LINE>ex.printStackTrace();<NEW_LINE>}<NEW_LINE>s_ids_names = s_ids_names.replace("{", "");<NEW_LINE>s_ids_names = s_ids_names.replace("}", "");<NEW_LINE>s_ids_names = s_ids_names.replace("\"", "");<NEW_LINE>stok = new StringTokenizer(s_ids_names, ",");<NEW_LINE>while (stok.hasMoreElements()) {<NEW_LINE>temp = stok.nextElement().toString();<NEW_LINE>if (temp.contains("currencySymbol")) {<NEW_LINE>temp = stok.nextElement().toString();<NEW_LINE>}<NEW_LINE>String[] split = temp.split(":");<NEW_LINE>temp = stok.nextElement().toString();<NEW_LINE>if (temp.contains("currencySymbol")) {<NEW_LINE>temp = stok.nextElement().toString();<NEW_LINE>}<NEW_LINE>String[] split2 = temp.split(":");<NEW_LINE>temp = null;<NEW_LINE>currences_names.add(new ZoneName(split[2], split2[1]));<NEW_LINE>}<NEW_LINE>Collections.sort(currences_names, (n1, n2) -> n1.shortName.compareTo(n2.shortName));<NEW_LINE>mAdaptorListView = new <MASK><NEW_LINE>RecyclerView.LayoutManager mLayoutManager = new LinearLayoutManager(mContext.getApplicationContext());<NEW_LINE>mListview.setLayoutManager(mLayoutManager);<NEW_LINE>mListview.setAdapter(mAdaptorListView);<NEW_LINE>}
CurrencyConverterAdapter(CurrencyListViewActivity.this, currences_names);
107,067
public Clustering<Model> run(Relation<V> relation) {<NEW_LINE>final DBIDs ids = relation.getDBIDs();<NEW_LINE>final int size = ids.size();<NEW_LINE>// Domain of the database<NEW_LINE>this.domain = RelationUtil.computeMinMax(relation);<NEW_LINE>this.dim = domain[0].length;<NEW_LINE>this.offset = new double[dim];<NEW_LINE>this.cells = new int[dim];<NEW_LINE>// Compute the grid start, and the number of cells in each dimension.<NEW_LINE>long numcells = computeGridBaseOffsets(size);<NEW_LINE>// Build the data grid.<NEW_LINE>buildGrid(relation, (int) numcells, offset);<NEW_LINE>if (grid.size() <= dim) {<NEW_LINE>LOG.warning("There are only " + grid.size() + " occupied cells. This will likely be slower than regular DBSCAN!");<NEW_LINE>}<NEW_LINE>// Check grid cell counts:<NEW_LINE>int mincells = checkGridCellSizes(size, numcells);<NEW_LINE>// (Temporary) store the cluster ID assigned.<NEW_LINE>clusterids = DataStoreUtil.makeStorage(ids, DataStoreFactory.HINT_TEMP, Assignment.class);<NEW_LINE>temporary = DataStoreUtil.makeIntegerStorage(ids, DataStoreFactory.HINT_TEMP, UNPROCESSED);<NEW_LINE>final ArrayModifiableDBIDs activeSet = DBIDUtil.newArray();<NEW_LINE>// Reserve the first two cluster ids:<NEW_LINE>int clusterid = NOISE + 1;<NEW_LINE>this.cores = new Core[2];<NEW_LINE>this.borders = new Border[2];<NEW_LINE>// Reused storage for neighbors:<NEW_LINE>ModifiableDoubleDBIDList neighbors = DBIDUtil.newDistanceDBIDList(minpts << 1);<NEW_LINE>// Run DBSCAN on each cell that has enough objects.<NEW_LINE>FiniteProgress cprog = LOG.isVerbose() ? new FiniteProgress("Processing grid cells", mincells, LOG) : null;<NEW_LINE>for (ModifiableDBIDs cellids : grid.values()) {<NEW_LINE>if (cellids.size() < minpts) {<NEW_LINE>// Too few objects.<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>clusterid += runDBSCANOnCell(cellids, relation, neighbors, activeSet, clusterid);<NEW_LINE>// Post-process DBSCAN clustering result:<NEW_LINE>updateCoreBorderObjects(clusterid);<NEW_LINE><MASK><NEW_LINE>LOG.incrementProcessed(cprog);<NEW_LINE>}<NEW_LINE>LOG.ensureCompleted(cprog);<NEW_LINE>temporary.destroy();<NEW_LINE>return buildResult(ids, clusterid);<NEW_LINE>}
mergeClusterInformation(cellids, temporary, clusterids);
592,569
/*<NEW_LINE>Used to delete all data related to a filter criteria based on registryId, runId etc.<NEW_LINE>*/<NEW_LINE>@Action(name = "deleteAll")<NEW_LINE>@Nonnull<NEW_LINE>@WithSpan<NEW_LINE>public Task<RollbackResponse> deleteEntities(@ActionParam("registryId") @Optional String registryId, @ActionParam("dryRun") @Optional Boolean dryRun) {<NEW_LINE>String registryName = null;<NEW_LINE>ComparableVersion registryVersion = new ComparableVersion("0.0.0-dev");<NEW_LINE>if (registryId != null) {<NEW_LINE>try {<NEW_LINE>registryName = registryId.split(":")[0];<NEW_LINE>registryVersion = new ComparableVersion(registryId.split(":")[1]);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new RestLiServiceException(HttpStatus.S_500_INTERNAL_SERVER_ERROR, "Failed to parse registry id: " + registryId, e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String finalRegistryName = registryName;<NEW_LINE>ComparableVersion finalRegistryVersion = registryVersion;<NEW_LINE>String finalRegistryName1 = registryName;<NEW_LINE>ComparableVersion finalRegistryVersion1 = registryVersion;<NEW_LINE>return RestliUtil.toTask(() -> {<NEW_LINE>RollbackResponse response = new RollbackResponse();<NEW_LINE>List<AspectRowSummary> aspectRowsToDelete = _systemMetadataService.findByRegistry(finalRegistryName, finalRegistryVersion.toString(), false);<NEW_LINE>log.info("found {} rows to delete...", stringifyRowCount(aspectRowsToDelete.size()));<NEW_LINE>response.setAspectsAffected(aspectRowsToDelete.size());<NEW_LINE>response.setEntitiesAffected(aspectRowsToDelete.stream().collect(Collectors.groupingBy(AspectRowSummary::getUrn)).keySet().size());<NEW_LINE>response.setEntitiesDeleted(aspectRowsToDelete.stream().filter(row -> row.isKeyAspect()).count());<NEW_LINE>response.setAspectRowSummaries(new AspectRowSummaryArray(aspectRowsToDelete.subList(0, Math.min(100, aspectRowsToDelete.size()))));<NEW_LINE>if ((dryRun == null) || (!dryRun)) {<NEW_LINE>Map<String, String> conditions = new HashMap();<NEW_LINE>conditions.put("registryName", finalRegistryName1);<NEW_LINE>conditions.put("registryVersion", finalRegistryVersion1.toString());<NEW_LINE>_entityService.rollbackWithConditions(aspectRowsToDelete, conditions, false);<NEW_LINE>}<NEW_LINE>return response;<NEW_LINE>}, MetricRegistry.name(this<MASK><NEW_LINE>}
.getClass(), "deleteAll"));
361,955
protected void perform(RelOptRuleCall call, List<RexNode> leftFilters, List<RexNode> rightFilters, RelOptPredicateList relOptPredicateList) {<NEW_LINE>final LogicalSemiJoin logicalSemiJoin = (LogicalSemiJoin) call.rels[0];<NEW_LINE>final LogicalView leftView = (<MASK><NEW_LINE>final LogicalView rightView = (LogicalView) call.rels[2];<NEW_LINE>LogicalSemiJoin newLogicalSemiJoin = logicalSemiJoin.copy(logicalSemiJoin.getTraitSet(), logicalSemiJoin.getCondition(), logicalSemiJoin.getLeft(), logicalSemiJoin.getRight(), logicalSemiJoin.getJoinType(), logicalSemiJoin.isSemiJoinDone());<NEW_LINE>LogicalView newLeftView = leftView.copy(leftView.getTraitSet());<NEW_LINE>LogicalView newRightView = rightView.copy(rightView.getTraitSet());<NEW_LINE>newLeftView.pushSemiJoin(newLogicalSemiJoin, newRightView, leftFilters, rightFilters, newLogicalSemiJoin.getPushDownRelNode(newRightView.getPushedRelNode(), call.builder(), call.builder().getRexBuilder(), leftFilters, rightFilters, false));<NEW_LINE>RelUtils.changeRowType(newLeftView, logicalSemiJoin.getRowType());<NEW_LINE>call.transformTo(newLeftView);<NEW_LINE>}
LogicalView) call.rels[1];
1,140,102
private void processMouseClickInLayout(RADComponent metacomp, MouseEvent e) {<NEW_LINE>if (formDesigner.getMenuEditLayer().isVisible()) {<NEW_LINE>if (!formDesigner.getMenuEditLayer().isMenuLayerComponent(metacomp)) {<NEW_LINE>formDesigner.getMenuEditLayer().hideMenuLayer();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (metacomp != null && metacomp.getBeanClass().getName().equals(javax.swing.JMenu.class.getName())) {<NEW_LINE>formDesigner.openMenu(metacomp);<NEW_LINE>}<NEW_LINE>if (!(metacomp instanceof RADVisualComponent)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>selectTabInUnknownTabbedPane((RADVisualComponent) metacomp, e.getPoint());<NEW_LINE>RADVisualContainer metacont = metacomp instanceof RADVisualContainer ? (RADVisualContainer) metacomp : (RADVisualContainer) metacomp.getParentComponent();<NEW_LINE>if (metacont == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>LayoutSupportManager laysup = metacont.getLayoutSupport();<NEW_LINE>if (laysup == null) {<NEW_LINE>Point p = convertPointToComponent(e.getPoint(), formDesigner.getTopDesignComponentView());<NEW_LINE>if (formDesigner.getLayoutDesigner().selectInside(p)) {<NEW_LINE>// NOI18N<NEW_LINE>FormEditor.getAssistantModel(getFormModel()).setContext("layoutGaps", "selectedLayoutGaps");<NEW_LINE>repaint();<NEW_LINE>mouseHint = formDesigner.getLayoutDesigner().getToolTipText(p);<NEW_LINE>showToolTip(e);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>Container cont = (Container) formDesigner.getComponent(metacont);<NEW_LINE>Container contDelegate = metacont.getContainerDelegate(cont);<NEW_LINE>Point p = convertPointToComponent(e.getPoint(), contDelegate);<NEW_LINE>laysup.<MASK><NEW_LINE>}<NEW_LINE>}
processMouseClick(p, cont, contDelegate);
1,678,684
public void restoreState(Parcelable state, ClassLoader loader) {<NEW_LINE>if (state != null) {<NEW_LINE>Bundle bundle = (Bundle) state;<NEW_LINE>bundle.setClassLoader(loader);<NEW_LINE>mSavedState.clear();<NEW_LINE>mFragments.clear();<NEW_LINE>String lastMode = bundle.getString("mode", "");<NEW_LINE>if (!mode.equals(lastMode)) {<NEW_LINE>cleanupOldFragments(bundle);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Parcelable[] fss = bundle.getParcelableArray("states");<NEW_LINE>if (fss != null) {<NEW_LINE>for (Parcelable fs : fss) {<NEW_LINE>mSavedState.add((Fragment.SavedState) fs);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Iterable<String> keys = bundle.keySet();<NEW_LINE>for (String key : keys) {<NEW_LINE>if (key.startsWith("f")) {<NEW_LINE>int index = Integer.parseInt(key.substring(1));<NEW_LINE>Fragment f = <MASK><NEW_LINE>if (f != null) {<NEW_LINE>while (mFragments.size() <= index) {<NEW_LINE>mFragments.add(null);<NEW_LINE>}<NEW_LINE>f.setMenuVisibility(false);<NEW_LINE>mFragments.set(index, f);<NEW_LINE>} else {<NEW_LINE>Timber.w("Bad fragment at key %s", key);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
mFragmentManager.getFragment(bundle, key);
1,295,488
public static void configure(LineReader reader, Reader r) throws IOException {<NEW_LINE>BufferedReader br;<NEW_LINE>if (r instanceof BufferedReader) {<NEW_LINE>br = (BufferedReader) r;<NEW_LINE>} else {<NEW_LINE>br = new BufferedReader(r);<NEW_LINE>}<NEW_LINE>reader.getVariables().putIfAbsent(LineReader.EDITING_MODE, "emacs");<NEW_LINE><MASK><NEW_LINE>if ("vi".equals(reader.getVariable(LineReader.EDITING_MODE))) {<NEW_LINE>reader.getKeyMaps().put(LineReader.MAIN, reader.getKeyMaps().get(LineReader.VIINS));<NEW_LINE>} else if ("emacs".equals(reader.getVariable(LineReader.EDITING_MODE))) {<NEW_LINE>reader.getKeyMaps().put(LineReader.MAIN, reader.getKeyMaps().get(LineReader.EMACS));<NEW_LINE>}<NEW_LINE>new InputRC(reader).parse(br);<NEW_LINE>if ("vi".equals(reader.getVariable(LineReader.EDITING_MODE))) {<NEW_LINE>reader.getKeyMaps().put(LineReader.MAIN, reader.getKeyMaps().get(LineReader.VIINS));<NEW_LINE>} else if ("emacs".equals(reader.getVariable(LineReader.EDITING_MODE))) {<NEW_LINE>reader.getKeyMaps().put(LineReader.MAIN, reader.getKeyMaps().get(LineReader.EMACS));<NEW_LINE>}<NEW_LINE>}
reader.setKeyMap(LineReader.MAIN);
862,390
public RelRoot optimizeRaQuery(String query, HeavyDBSchema schema) throws IOException {<NEW_LINE>ready();<NEW_LINE>RexBuilder builder <MASK><NEW_LINE>RelOptCluster cluster = RelOptCluster.create(new VolcanoPlanner(), builder);<NEW_LINE>CalciteCatalogReader catalogReader = createCatalogReader();<NEW_LINE>HeavyDBRelJsonReader reader = new HeavyDBRelJsonReader(cluster, catalogReader, schema);<NEW_LINE>RelRoot relR = RelRoot.of(reader.read(query), SqlKind.SELECT);<NEW_LINE>if (restrictions != null) {<NEW_LINE>relR = applyInjectFilterRule(relR, restrictions);<NEW_LINE>}<NEW_LINE>relR = applyQueryOptimizationRules(relR);<NEW_LINE>relR = applyFilterPushdown(relR);<NEW_LINE>relR = applyOptimizationsRules(relR, ImmutableSet.of(CoreRules.JOIN_PROJECT_BOTH_TRANSPOSE_INCLUDE_OUTER, CoreRules.FILTER_REDUCE_EXPRESSIONS, ProjectProjectRemoveRule.INSTANCE, CoreRules.PROJECT_FILTER_TRANSPOSE));<NEW_LINE>relR = applyOptimizationsRules(relR, ImmutableSet.of(CoreRules.PROJECT_MERGE));<NEW_LINE>relR = applyOptimizationsRules(relR, ImmutableSet.of(CoreRules.FILTER_PROJECT_TRANSPOSE, CoreRules.PROJECT_REMOVE));<NEW_LINE>return RelRoot.of(relR.project(), relR.kind);<NEW_LINE>}
= new RexBuilder(getTypeFactory());
341,097
private void applyMigration(final Function<String, ViewElementDefinition> currentElementSupplier, final Map<String, ViewMigration> newElementDefs, final MigrateElement migration) {<NEW_LINE>final ViewElementDefinition originalOldElement = currentElementSupplier.apply(migration.getOldGroup());<NEW_LINE>final ViewElementDefinition originalNewElement = currentElementSupplier.apply(migration.getNewGroup());<NEW_LINE>final boolean queriedForOld = null != originalOldElement;<NEW_LINE>final boolean queriedForNew = null != originalNewElement;<NEW_LINE>if (queriedForOld || queriedForNew) {<NEW_LINE>final ViewMigration oldElement;<NEW_LINE>final ViewMigration newElement;<NEW_LINE>if (queriedForOld && queriedForNew) {<NEW_LINE>// Queried for old and new<NEW_LINE>oldElement = migrateViewOldFromOld(migration, originalOldElement);<NEW_LINE>newElement = migrateViewNewFromNew(migration, originalNewElement);<NEW_LINE>} else if (queriedForOld) {<NEW_LINE>// Queried for old<NEW_LINE>oldElement = migrateViewOldFromOld(migration, originalOldElement);<NEW_LINE>newElement = migrateViewNewFromOld(migration, originalOldElement);<NEW_LINE>} else {<NEW_LINE>// Queried for new<NEW_LINE>oldElement = migrateViewOldFromNew(migration, originalNewElement);<NEW_LINE>newElement = migrateViewNewFromNew(migration, originalNewElement);<NEW_LINE>}<NEW_LINE>newElementDefs.put(<MASK><NEW_LINE>newElementDefs.put(migration.getNewGroup(), newElement);<NEW_LINE>}<NEW_LINE>}
migration.getOldGroup(), oldElement);
172,028
/*<NEW_LINE>* (non-Javadoc)<NEW_LINE>*<NEW_LINE>* @see org.eclipse.draw2d.Label#paintFigure(org.eclipse.draw2d.Graphics)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public void paint(Graphics graphics) {<NEW_LINE>int blue = getBackgroundColor().getBlue();<NEW_LINE>blue = (int) (blue - (blue * 0.20));<NEW_LINE>blue = blue > 0 ? blue : 0;<NEW_LINE>int red = getBackgroundColor().getRed();<NEW_LINE>red = (int) (red - (red * 0.20));<NEW_LINE>red = red > 0 ? red : 0;<NEW_LINE>int green = getBackgroundColor().getGreen();<NEW_LINE>green = (int) (green - (green * 0.20));<NEW_LINE>green = green > 0 ? green : 0;<NEW_LINE>Color lightenColor = new Color(Display.getCurrent(), new RGB(red, green, blue));<NEW_LINE>graphics.setForegroundColor(lightenColor);<NEW_LINE>graphics.setBackgroundColor(getBackgroundColor());<NEW_LINE>graphics.pushState();<NEW_LINE>// fill in the background<NEW_LINE>Rectangle bounds = getBounds().getCopy();<NEW_LINE>Rectangle r = bounds.getCopy();<NEW_LINE>// r.x += arcWidth / 2;<NEW_LINE>r.y += arcWidth / 2;<NEW_LINE>// r.width -= arcWidth;<NEW_LINE>r.height -= arcWidth;<NEW_LINE>Rectangle top = bounds.getCopy();<NEW_LINE>top.height /= 2;<NEW_LINE>// graphics.setForegroundColor(lightenColor);<NEW_LINE>// graphics.setBackgroundColor(lightenColor);<NEW_LINE>graphics.setForegroundColor(getBackgroundColor());<NEW_LINE>graphics.setBackgroundColor(getBackgroundColor());<NEW_LINE>graphics.<MASK><NEW_LINE>top.y = top.y + top.height;<NEW_LINE>// graphics.setForegroundColor(getBackgroundColor());<NEW_LINE>// graphics.setBackgroundColor(getBackgroundColor());<NEW_LINE>graphics.setForegroundColor(lightenColor);<NEW_LINE>graphics.setBackgroundColor(lightenColor);<NEW_LINE>graphics.fillRoundRectangle(top, arcWidth, arcWidth);<NEW_LINE>// graphics.setForegroundColor(lightenColor);<NEW_LINE>// graphics.setBackgroundColor(getBackgroundColor());<NEW_LINE>graphics.setBackgroundColor(lightenColor);<NEW_LINE>graphics.setForegroundColor(getBackgroundColor());<NEW_LINE>graphics.fillGradient(r, true);<NEW_LINE>super.paint(graphics);<NEW_LINE>graphics.popState();<NEW_LINE>graphics.setForegroundColor(lightenColor);<NEW_LINE>graphics.setBackgroundColor(lightenColor);<NEW_LINE>// paint the border<NEW_LINE>bounds.setSize(bounds.width - 1, bounds.height - 1);<NEW_LINE>graphics.drawRoundRectangle(bounds, arcWidth, arcWidth);<NEW_LINE>}
fillRoundRectangle(top, arcWidth, arcWidth);
257,371
public Condition createPredicateResourceId(@Nullable DbColumn theSourceJoinColumn, String theResourceName, List<List<IQueryParameterType>> theValues, SearchFilterParser.CompareOperation theOperation, RequestPartitionId theRequestPartitionId) {<NEW_LINE>Set<ResourcePersistentId> allOrPids = null;<NEW_LINE>SearchFilterParser.CompareOperation defaultOperation = SearchFilterParser.CompareOperation.eq;<NEW_LINE>boolean allIdsAreForcedIds = true;<NEW_LINE>for (List<? extends IQueryParameterType> nextValue : theValues) {<NEW_LINE>Set<ResourcePersistentId> orPids = new HashSet<>();<NEW_LINE>boolean haveValue = false;<NEW_LINE>for (IQueryParameterType next : nextValue) {<NEW_LINE>String value = next.getValueAsQueryToken(getFhirContext());<NEW_LINE>if (value != null && value.startsWith("|")) {<NEW_LINE>value = value.substring(1);<NEW_LINE>}<NEW_LINE>IdType valueAsId = new IdType(value);<NEW_LINE>if (isNotBlank(value)) {<NEW_LINE>if (!myIdHelperService.idRequiresForcedId(valueAsId.getIdPart()) && allIdsAreForcedIds) {<NEW_LINE>allIdsAreForcedIds = false;<NEW_LINE>}<NEW_LINE>haveValue = true;<NEW_LINE>try {<NEW_LINE>ResourcePersistentId pid = myIdHelperService.resolveResourcePersistentIds(theRequestPartitionId, theResourceName, valueAsId.getIdPart());<NEW_LINE>orPids.add(pid);<NEW_LINE>} catch (ResourceNotFoundException e) {<NEW_LINE>// This is not an error in a search, it just results in no matches<NEW_LINE>ourLog.debug("Resource ID {} was requested but does not exist", valueAsId.getIdPart());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (next instanceof TokenParam) {<NEW_LINE>if (((TokenParam) next).getModifier() == TokenParamModifier.NOT) {<NEW_LINE>defaultOperation = SearchFilterParser.CompareOperation.ne;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (haveValue) {<NEW_LINE>if (allOrPids == null) {<NEW_LINE>allOrPids = orPids;<NEW_LINE>} else {<NEW_LINE>allOrPids.retainAll(orPids);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (allOrPids != null && allOrPids.isEmpty()) {<NEW_LINE>setMatchNothing();<NEW_LINE>} else if (allOrPids != null) {<NEW_LINE>SearchFilterParser.CompareOperation operation = defaultIfNull(theOperation, defaultOperation);<NEW_LINE>assert operation == SearchFilterParser.CompareOperation.eq || operation == SearchFilterParser.CompareOperation.ne;<NEW_LINE>List<Long> <MASK><NEW_LINE>if (theSourceJoinColumn == null) {<NEW_LINE>BaseJoiningPredicateBuilder queryRootTable = super.getOrCreateQueryRootTable(!allIdsAreForcedIds);<NEW_LINE>Condition predicate;<NEW_LINE>switch(operation) {<NEW_LINE>default:<NEW_LINE>case eq:<NEW_LINE>predicate = queryRootTable.createPredicateResourceIds(false, resourceIds);<NEW_LINE>return queryRootTable.combineWithRequestPartitionIdPredicate(theRequestPartitionId, predicate);<NEW_LINE>case ne:<NEW_LINE>predicate = queryRootTable.createPredicateResourceIds(true, resourceIds);<NEW_LINE>return queryRootTable.combineWithRequestPartitionIdPredicate(theRequestPartitionId, predicate);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>return QueryStack.toEqualToOrInPredicate(theSourceJoinColumn, generatePlaceholders(resourceIds), operation == SearchFilterParser.CompareOperation.ne);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
resourceIds = ResourcePersistentId.toLongList(allOrPids);
1,107,872
static long readLongFast(ByteBuf buffer) {<NEW_LINE>int b = buffer.readByte();<NEW_LINE>long result = b & 0x7F;<NEW_LINE>if ((b & 0x80) != 0) {<NEW_LINE>b = buffer.readByte();<NEW_LINE>result |= (b & 0x7F) << 7;<NEW_LINE>if ((b & 0x80) != 0) {<NEW_LINE>b = buffer.readByte();<NEW_LINE>result |= (b & 0x7F) << 14;<NEW_LINE>if ((b & 0x80) != 0) {<NEW_LINE>b = buffer.readByte();<NEW_LINE>result |= (b & 0x7F) << 21;<NEW_LINE>if ((b & 0x80) != 0) {<NEW_LINE>b = buffer.readByte();<NEW_LINE>result |= (long<MASK><NEW_LINE>if ((b & 0x80) != 0) {<NEW_LINE>b = buffer.readByte();<NEW_LINE>result |= (long) (b & 0x7F) << 35;<NEW_LINE>if ((b & 0x80) != 0) {<NEW_LINE>b = buffer.readByte();<NEW_LINE>result |= (long) (b & 0x7F) << 42;<NEW_LINE>if ((b & 0x80) != 0) {<NEW_LINE>b = buffer.readByte();<NEW_LINE>result |= (long) (b & 0x7F) << 49;<NEW_LINE>if ((b & 0x80) != 0) {<NEW_LINE>b = buffer.readByte();<NEW_LINE>result |= (long) b << 56;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
) (b & 0x7F) << 28;
452,346
final DescribeProductAsAdminResult executeDescribeProductAsAdmin(DescribeProductAsAdminRequest describeProductAsAdminRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeProductAsAdminRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeProductAsAdminRequest> request = null;<NEW_LINE>Response<DescribeProductAsAdminResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeProductAsAdminRequestProtocolMarshaller(protocolFactory).marshall<MASK><NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Service Catalog");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeProductAsAdmin");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeProductAsAdminResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeProductAsAdminResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
(super.beforeMarshalling(describeProductAsAdminRequest));
1,338,723
public static HashMap<String, Object> calculateLoanProvision(Properties ctx, int agreementId, Timestamp runningDate, String trxName) {<NEW_LINE>// Validate agreement<NEW_LINE>if (agreementId <= 0) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>HashMap<String, Object> returnValues = new HashMap<String, Object>();<NEW_LINE>// if null then is now<NEW_LINE>if (runningDate == null) {<NEW_LINE>runningDate = new Timestamp(System.currentTimeMillis());<NEW_LINE>}<NEW_LINE>// Get agreement<NEW_LINE>MFMAgreement agreement = MFMAgreement.getById(ctx, agreementId, trxName);<NEW_LINE>// Calculate it<NEW_LINE>MFMProduct financialProduct = MFMProduct.getById(ctx, agreement.getFM_Product_ID(), trxName);<NEW_LINE>// Get Interest Rate<NEW_LINE>int dunningId = financialProduct.get_ValueAsInt("FM_Dunning_ID");<NEW_LINE>// Validate Dunning for it<NEW_LINE>if (dunningId == 0) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>//<NEW_LINE>MFMDunning dunning = null;<NEW_LINE>// Get dunning configuration if exist<NEW_LINE>if (dunningId > 0) {<NEW_LINE>dunning = <MASK><NEW_LINE>}<NEW_LINE>// Get<NEW_LINE>List<MFMAccount> accounts = MFMAccount.getAccountFromAgreement(agreement);<NEW_LINE>MFMAccount account = null;<NEW_LINE>if (accounts.isEmpty()) {<NEW_LINE>account = new MFMAccount(agreement);<NEW_LINE>account.saveEx();<NEW_LINE>} else {<NEW_LINE>account = accounts.get(0);<NEW_LINE>}<NEW_LINE>// Hash Map for Amortization<NEW_LINE>List<AmortizationValue> amortizationList = new ArrayList<AmortizationValue>();<NEW_LINE>//<NEW_LINE>for (AmortizationValue row : getCurrentAmortizationList(ctx, agreementId, trxName)) {<NEW_LINE>if (row.isPaid()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (row.getDaysDue(runningDate) <= 0) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// For distinct levels<NEW_LINE>MFMDunningLevel level = null;<NEW_LINE>if (dunning != null) {<NEW_LINE>level = dunning.getValidLevelInstance(row.getDaysDue());<NEW_LINE>if (level == null || !level.isAccrual()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// Get Provision Rate<NEW_LINE>BigDecimal provisionRate = level.getProvisionPercentage();<NEW_LINE>if (provisionRate == null || provisionRate.doubleValue() == 0) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>provisionRate = provisionRate.divide(Env.ONEHUNDRED);<NEW_LINE>// Set Capital<NEW_LINE>BigDecimal capitalAmount = row.getCapitalAmtFee();<NEW_LINE>// Set Interest<NEW_LINE>BigDecimal interestAmount = row.getInterestAmtFee();<NEW_LINE>// Set Dunning<NEW_LINE>BigDecimal dunningInterestAmount = row.getDunningInterestAmount();<NEW_LINE>// Set Provision<NEW_LINE>BigDecimal provisionAmount = (capitalAmount.add(interestAmount).add(dunningInterestAmount)).multiply(provisionRate);<NEW_LINE>row.setProvisionAmt(provisionAmount);<NEW_LINE>amortizationList.add(row);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Add list<NEW_LINE>returnValues.put("AMORTIZATION_LIST", amortizationList);<NEW_LINE>return returnValues;<NEW_LINE>}
MFMDunning.getById(ctx, dunningId);
222,865
final ListApplicationsResult executeListApplications(ListApplicationsRequest listApplicationsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listApplicationsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListApplicationsRequest> request = null;<NEW_LINE>Response<ListApplicationsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListApplicationsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listApplicationsRequest));<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, "ServerlessApplicationRepository");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListApplications");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListApplicationsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListApplicationsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
405,451
public void didRangeBeaconsInRegion(final Collection<Beacon> iBeacons, final Region region) {<NEW_LINE>threadPoolExecutor.execute(new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>try {<NEW_LINE>JSONObject data = new JSONObject();<NEW_LINE>JSONArray beaconData = new JSONArray();<NEW_LINE>for (Beacon beacon : iBeacons) {<NEW_LINE>beaconData.put(mapOfBeacon(beacon));<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>data.put("region", mapOfRegion(region));<NEW_LINE>data.put("beacons", beaconData);<NEW_LINE>debugLog("didRangeBeacons: " + data.toString());<NEW_LINE>// send and keep reference to callback<NEW_LINE>PluginResult result = new PluginResult(PluginResult.Status.OK, data);<NEW_LINE>result.setKeepCallback(true);<NEW_LINE>callbackContext.sendPluginResult(result);<NEW_LINE>} catch (Exception e) {<NEW_LINE>Log.e(TAG, "'rangingBeaconsDidFailForRegion' exception " + e.getCause());<NEW_LINE>beaconServiceNotifier.rangingBeaconsDidFailForRegion(region, e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
data.put("eventType", "didRangeBeaconsInRegion");
763,925
private void init() {<NEW_LINE>// WARNING: called from ctor so must not be overridden (i.e. must be private or final)<NEW_LINE>this.setLayout(new BorderLayout());<NEW_LINE>// MAIN PANEL<NEW_LINE>JPanel mainPanel = new JPanel();<NEW_LINE>Border margin = new EmptyBorder(10, 10, 5, 10);<NEW_LINE>Border margin2 = new EmptyBorder(<MASK><NEW_LINE>mainPanel.setBorder(margin);<NEW_LINE>mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.Y_AXIS));<NEW_LINE>mainPanel.add(makeTitlePanel());<NEW_LINE>JPanel settingsPane = new VerticalPanel();<NEW_LINE>settingsPane.setBorder(margin2);<NEW_LINE>graphPanel = new RespTimeGraphChart();<NEW_LINE>graphPanel.setPreferredSize(new Dimension(DEFAULT_WIDTH, DEFAULT_HEIGTH));<NEW_LINE>settingsPane.add(createGraphActionsPane());<NEW_LINE>settingsPane.add(createGraphSettingsPane());<NEW_LINE>settingsPane.add(createGraphTitlePane());<NEW_LINE>settingsPane.add(createLinePane());<NEW_LINE>settingsPane.add(createGraphDimensionPane());<NEW_LINE>JPanel axisPane = new JPanel(new BorderLayout());<NEW_LINE>axisPane.add(createGraphXAxisPane(), BorderLayout.WEST);<NEW_LINE>axisPane.add(createGraphYAxisPane(), BorderLayout.CENTER);<NEW_LINE>settingsPane.add(axisPane);<NEW_LINE>settingsPane.add(createLegendPane());<NEW_LINE>// $NON-NLS-1$<NEW_LINE>tabbedGraph.addTab(JMeterUtils.getResString("aggregate_graph_tab_settings"), settingsPane);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>tabbedGraph.addTab(JMeterUtils.getResString("aggregate_graph_tab_graph"), graphPanel);<NEW_LINE>// If clic on the Graph tab, make the graph (without apply interval or filter)<NEW_LINE>ChangeListener changeListener = changeEvent -> {<NEW_LINE>JTabbedPane srcTab = (JTabbedPane) changeEvent.getSource();<NEW_LINE>int index = srcTab.getSelectedIndex();<NEW_LINE>if (srcTab.getTitleAt(index).equals(JMeterUtils.getResString("aggregate_graph_tab_graph"))) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>actionMakeGraph();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>tabbedGraph.addChangeListener(changeListener);<NEW_LINE>this.add(mainPanel, BorderLayout.NORTH);<NEW_LINE>this.add(tabbedGraph, BorderLayout.CENTER);<NEW_LINE>}
10, 10, 5, 10);
1,523,843
private void extractTrackFromResultEntry(List<AudioTrack> tracks, Element element, Function<AudioTrackInfo, AudioTrack> trackFactory) {<NEW_LINE>Element durationElement = element.<MASK><NEW_LINE>Element contentElement = element.select(".yt-lockup-content").first();<NEW_LINE>String videoId = element.attr("data-context-item-id");<NEW_LINE>if (durationElement == null || contentElement == null || videoId.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>long duration = DataFormatTools.durationTextToMillis(durationElement.text());<NEW_LINE>String title = contentElement.select(".yt-lockup-title > a").text();<NEW_LINE>String author = contentElement.select(".yt-lockup-byline > a").text();<NEW_LINE>AudioTrackInfo info = new AudioTrackInfo(title, author, duration, videoId, false, WATCH_URL_PREFIX + videoId);<NEW_LINE>tracks.add(trackFactory.apply(info));<NEW_LINE>}
select("[class^=video-time]").first();
1,541,736
private JPanel createStatusPanel() {<NEW_LINE>JLabel startLabel = new GLabel("Start:", SwingConstants.RIGHT);<NEW_LINE>JLabel endLabel = new GLabel("End:", SwingConstants.RIGHT);<NEW_LINE>JLabel offsetLabel = new GLabel("Offset:", SwingConstants.RIGHT);<NEW_LINE>JLabel insertionLabel = new GLabel("Insertion:", SwingConstants.RIGHT);<NEW_LINE>startField = new GDLabel("00000000");<NEW_LINE>startField.setName("Start");<NEW_LINE>endField = new GDLabel("00000000");<NEW_LINE>endField.setName("End");<NEW_LINE>offsetField = new GDLabel("00000000");<NEW_LINE>offsetField.setName("Offset");<NEW_LINE>insertionField = new GDLabel("00000000");<NEW_LINE>insertionField.setName("Insertion");<NEW_LINE>Font f = new Font("SansSerif", Font.PLAIN, 11);<NEW_LINE>startLabel.setFont(f);<NEW_LINE>endLabel.setFont(f);<NEW_LINE>offsetLabel.setFont(f);<NEW_LINE>insertionLabel.setFont(f);<NEW_LINE>startField.setFont(f);<NEW_LINE>endField.setFont(f);<NEW_LINE>offsetField.setFont(f);<NEW_LINE>insertionField.setFont(f);<NEW_LINE>// make a panel for each label/value pair<NEW_LINE>JPanel p1 = new JPanel(new PairLayout(0, 5));<NEW_LINE>p1.add(startLabel);<NEW_LINE>p1.add(startField);<NEW_LINE>JPanel p2 = new JPanel(new PairLayout(0, 5));<NEW_LINE>p2.add(endLabel);<NEW_LINE>p2.add(endField);<NEW_LINE>JPanel p3 = new JPanel(<MASK><NEW_LINE>p3.add(offsetLabel);<NEW_LINE>p3.add(offsetField);<NEW_LINE>JPanel p4 = new JPanel(new PairLayout(0, 5));<NEW_LINE>p4.add(insertionLabel);<NEW_LINE>p4.add(insertionField);<NEW_LINE>JPanel[] panels = { p1, p2, p3, p4 };<NEW_LINE>JPanel panel = new JPanel();<NEW_LINE>panel.setLayout(new BoxLayout(panel, BoxLayout.X_AXIS));<NEW_LINE>panel.add(Box.createHorizontalStrut(10));<NEW_LINE>for (JPanel element : panels) {<NEW_LINE>panel.add(element);<NEW_LINE>}<NEW_LINE>panel.add(Box.createHorizontalStrut(10));<NEW_LINE>panel.setBorder(BorderFactory.createEmptyBorder(5, 0, 5, 0));<NEW_LINE>return panel;<NEW_LINE>}
new PairLayout(0, 5));
642,083
private static byte[] fixupHeadZeros(byte[] array, int size) {<NEW_LINE><MASK><NEW_LINE>if (padding == 0) {<NEW_LINE>return array;<NEW_LINE>}<NEW_LINE>if (padding < 0) {<NEW_LINE>// There is one zero byte at the beginning, added by BigInteger to make there be a sign<NEW_LINE>// bit when converting to bytes.<NEW_LINE>verify(padding == -1, "key %s: expected length %s with exactly one byte of padding, found %s", ByteKey.copyFrom(array), size, -padding);<NEW_LINE>verify((array[0] == 0) && ((array[1] & 0x80) == 0x80), "key %s: is 1 byte longer than expected, indicating BigInteger padding. Expect first byte" + " to be zero with set MSB in second byte.", ByteKey.copyFrom(array));<NEW_LINE>return Arrays.copyOfRange(array, 1, array.length);<NEW_LINE>}<NEW_LINE>byte[] ret = new byte[size];<NEW_LINE>System.arraycopy(array, 0, ret, padding, array.length);<NEW_LINE>return ret;<NEW_LINE>}
int padding = size - array.length;
944,919
private void sendRequest(KeycloakDeployment deployment) {<NEW_LINE>if (log.isTraceEnabled()) {<NEW_LINE>log.trace(<MASK><NEW_LINE>}<NEW_LINE>HttpGet getMethod = new HttpGet(deployment.getJwksUrl());<NEW_LINE>try {<NEW_LINE>JSONWebKeySet jwks = HttpAdapterUtils.sendJsonHttpRequest(deployment, getMethod, JSONWebKeySet.class);<NEW_LINE>Map<String, PublicKey> publicKeys = JWKSUtils.getKeysForUse(jwks, JWK.Use.SIG);<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("Realm public keys successfully retrieved for client " + deployment.getResourceName() + ". New kids: " + publicKeys.keySet().toString());<NEW_LINE>}<NEW_LINE>// Update current keys<NEW_LINE>currentKeys.clear();<NEW_LINE>currentKeys.putAll(publicKeys);<NEW_LINE>} catch (HttpClientAdapterException e) {<NEW_LINE>log.error("Error when sending request to retrieve realm keys", e);<NEW_LINE>}<NEW_LINE>}
"Going to send request to retrieve new set of realm public keys for client " + deployment.getResourceName());
1,834,424
public Value nodeSetProperty(long node, int propertyKey, Value value) throws EntityNotFoundException, ConstraintValidationException {<NEW_LINE>assert value != NO_VALUE;<NEW_LINE>acquireExclusiveNodeLock(node);<NEW_LINE>ktx.assertOpen();<NEW_LINE>singleNode(node);<NEW_LINE>long[] labels = acquireSharedNodeLabelLocks();<NEW_LINE>Value existingValue = readNodeProperty(propertyKey);<NEW_LINE>int[] existingPropertyKeyIds = null;<NEW_LINE>boolean hasRelatedSchema = storageReader.<MASK><NEW_LINE>if (hasRelatedSchema) {<NEW_LINE>existingPropertyKeyIds = loadSortedNodePropertyKeyList();<NEW_LINE>}<NEW_LINE>if (existingValue == NO_VALUE) {<NEW_LINE>ktx.securityAuthorizationHandler().assertAllowsSetProperty(ktx.securityContext(), this::resolvePropertyKey, Labels.from(labels), propertyKey);<NEW_LINE>checkUniquenessConstraints(node, propertyKey, value, labels, existingPropertyKeyIds);<NEW_LINE>// no existing value, we just add it<NEW_LINE>ktx.txState().nodeDoAddProperty(node, propertyKey, value);<NEW_LINE>if (hasRelatedSchema) {<NEW_LINE>updater.onPropertyAdd(nodeCursor, propertyCursor, labels, propertyKey, existingPropertyKeyIds, value);<NEW_LINE>}<NEW_LINE>} else if (propertyHasChanged(value, existingValue)) {<NEW_LINE>ktx.securityAuthorizationHandler().assertAllowsSetProperty(ktx.securityContext(), this::resolvePropertyKey, Labels.from(labels), propertyKey);<NEW_LINE>checkUniquenessConstraints(node, propertyKey, value, labels, existingPropertyKeyIds);<NEW_LINE>// the value has changed to a new value<NEW_LINE>ktx.txState().nodeDoChangeProperty(node, propertyKey, value);<NEW_LINE>if (hasRelatedSchema) {<NEW_LINE>updater.onPropertyChange(nodeCursor, propertyCursor, labels, propertyKey, existingPropertyKeyIds, existingValue, value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return existingValue;<NEW_LINE>}
hasRelatedSchema(labels, propertyKey, NODE);
1,775,931
protected AsyncNodeSelection<K, V> nodes(Predicate<RedisClusterNode> predicate, ClusterConnectionProvider.Intent intent, boolean dynamic) {<NEW_LINE>NodeSelectionSupport<RedisAsyncCommands<<MASK><NEW_LINE>StatefulRedisClusterConnectionImpl<K, V> impl = (StatefulRedisClusterConnectionImpl<K, V>) getConnection();<NEW_LINE>if (dynamic) {<NEW_LINE>selection = new DynamicNodeSelection<RedisAsyncCommands<K, V>, Object, K, V>(impl.getClusterDistributionChannelWriter(), predicate, intent, StatefulRedisConnection::async);<NEW_LINE>} else {<NEW_LINE>selection = new StaticNodeSelection<RedisAsyncCommands<K, V>, Object, K, V>(impl.getClusterDistributionChannelWriter(), predicate, intent, StatefulRedisConnection::async);<NEW_LINE>}<NEW_LINE>NodeSelectionInvocationHandler h = new NodeSelectionInvocationHandler((AbstractNodeSelection<?, ?, ?, ?>) selection, RedisClusterAsyncCommands.class, ASYNC);<NEW_LINE>return (AsyncNodeSelection<K, V>) Proxy.newProxyInstance(NodeSelectionSupport.class.getClassLoader(), new Class<?>[] { NodeSelectionAsyncCommands.class, AsyncNodeSelection.class }, h);<NEW_LINE>}
K, V>, ?> selection;
1,155,322
final DBInstance executeCreateDBInstance(CreateDBInstanceRequest createDBInstanceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createDBInstanceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<CreateDBInstanceRequest> request = null;<NEW_LINE>Response<DBInstance> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateDBInstanceRequestMarshaller().marshall(super.beforeMarshalling(createDBInstanceRequest));<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, "RDS");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateDBInstance");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DBInstance> responseHandler = new StaxResponseHandler<DBInstance>(new DBInstanceStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.ClientExecuteTime);