idx
int32 46
1.86M
| input
stringlengths 321
6.6k
| target
stringlengths 9
1.24k
|
|---|---|---|
11,026
|
public void enqueueAsyncResave(VKey<?> entityKey, DateTime now, ImmutableSortedSet<DateTime> whenToResave) {<NEW_LINE><MASK><NEW_LINE>checkArgument(isBeforeOrAt(now, firstResave), "Can't enqueue a resave to run in the past");<NEW_LINE>Duration etaDuration = new Duration(now, firstResave);<NEW_LINE>if (etaDuration.isLongerThan(MAX_ASYNC_ETA)) {<NEW_LINE>logger.atInfo().log("Ignoring async re-save of %s; %s is past the ETA threshold of %s.", entityKey, firstResave, MAX_ASYNC_ETA);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Multimap<String, String> params = ArrayListMultimap.create();<NEW_LINE>params.put(PARAM_RESOURCE_KEY, entityKey.stringify());<NEW_LINE>params.put(PARAM_REQUESTED_TIME, now.toString());<NEW_LINE>if (whenToResave.size() > 1) {<NEW_LINE>params.put(PARAM_RESAVE_TIMES, Joiner.on(',').join(whenToResave.tailSet(firstResave, false)));<NEW_LINE>}<NEW_LINE>logger.atInfo().log("Enqueuing async re-save of %s to run at %s.", entityKey, whenToResave);<NEW_LINE>cloudTasksUtils.enqueue(QUEUE_ASYNC_ACTIONS, cloudTasksUtils.createPostTaskWithDelay(ResaveEntityAction.PATH, Service.BACKEND.toString(), params, etaDuration));<NEW_LINE>}
|
DateTime firstResave = whenToResave.first();
|
896,188
|
String computeCurPos() {<NEW_LINE>int chari = 0;<NEW_LINE>int chart = 0;<NEW_LINE>for (int i = 0; i < buffer.lines.size(); i++) {<NEW_LINE>int l = buffer.lines.get(i).length() + 1;<NEW_LINE>if (i < buffer.line) {<NEW_LINE>chari += l;<NEW_LINE>} else if (i == buffer.line) {<NEW_LINE>chari += buffer.offsetInLine + buffer.column;<NEW_LINE>}<NEW_LINE>chart += l;<NEW_LINE>}<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append("line ");<NEW_LINE>sb.append(buffer.line + 1);<NEW_LINE>sb.append("/");<NEW_LINE>sb.append(buffer.lines.size());<NEW_LINE>sb.append(" (");<NEW_LINE>sb.append(Math.round((100.0 * buffer.line) / buffer.lines.size()));<NEW_LINE>sb.append("%), ");<NEW_LINE>sb.append("col ");<NEW_LINE>sb.append(buffer.offsetInLine + buffer.column + 1);<NEW_LINE>sb.append("/");<NEW_LINE>sb.append(buffer.length(buffer.lines.get(buffer.line)) + 1);<NEW_LINE>sb.append(" (");<NEW_LINE>if (buffer.lines.get(buffer.line).length() > 0) {<NEW_LINE>sb.append(Math.round((100.0 * (buffer.offsetInLine + buffer.column)) / (buffer.length(buffer.lines.get(<MASK><NEW_LINE>} else {<NEW_LINE>sb.append("100");<NEW_LINE>}<NEW_LINE>sb.append("%), ");<NEW_LINE>sb.append("char ");<NEW_LINE>sb.append(chari + 1);<NEW_LINE>sb.append("/");<NEW_LINE>sb.append(chart);<NEW_LINE>sb.append(" (");<NEW_LINE>sb.append(Math.round((100.0 * chari) / chart));<NEW_LINE>sb.append("%)");<NEW_LINE>return sb.toString();<NEW_LINE>}
|
buffer.line)))));
|
125,201
|
protected ObjectNode createAuthConfigWithService(UUID configUUID, ObjectNode config) {<NEW_LINE>// Skip creating a CMK for the KMS Configuration if the user inputted one<NEW_LINE>if (config.get("cmk_id") != null)<NEW_LINE>return config;<NEW_LINE>final String description = String.format("Yugabyte Master Key for KMS Configuration %s", configUUID.toString());<NEW_LINE>ObjectNode result = null;<NEW_LINE>try {<NEW_LINE>final String inputtedCMKPolicy = config.get("cmk_policy") == null ? null : config.get("cmk_policy").asText();<NEW_LINE>final String cmkId = AwsEARServiceUtil.createCMK(configUUID, description, inputtedCMKPolicy).getKeyMetadata().getKeyId();<NEW_LINE>if (cmkId != null) {<NEW_LINE>config.remove("cmk_policy");<NEW_LINE>config.put("cmk_id", cmkId);<NEW_LINE>}<NEW_LINE>result = config;<NEW_LINE>} catch (Exception e) {<NEW_LINE>final String errMsg = String.format("Error attempting to create CMK with AWS KMS with config %s", configUUID.toString());<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
|
LOG.error(errMsg, e);
|
166,967
|
private JobEventRdbSearch.Condition buildCondition(final Map<String, String> requestParams, final String[] params) throws ParseException {<NEW_LINE>int perPage = 10;<NEW_LINE>int page = 1;<NEW_LINE>if (!Strings.isNullOrEmpty(requestParams.get("per_page"))) {<NEW_LINE>perPage = Integer.parseInt(requestParams.get("per_page"));<NEW_LINE>}<NEW_LINE>if (!Strings.isNullOrEmpty(requestParams.get("page"))) {<NEW_LINE>page = Integer.parseInt(requestParams.get("page"));<NEW_LINE>}<NEW_LINE>String sort = requestParams.get("sort");<NEW_LINE>String order = requestParams.get("order");<NEW_LINE>Date startTime = null;<NEW_LINE>Date endTime = null;<NEW_LINE>Map<String, Object> fields = getQueryParameters(requestParams, params);<NEW_LINE>SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");<NEW_LINE>if (!Strings.isNullOrEmpty(requestParams.get("startTime"))) {<NEW_LINE>startTime = simpleDateFormat.parse(requestParams.get("startTime"));<NEW_LINE>}<NEW_LINE>if (!Strings.isNullOrEmpty(requestParams.get("endTime"))) {<NEW_LINE>endTime = simpleDateFormat.parse<MASK><NEW_LINE>}<NEW_LINE>return new JobEventRdbSearch.Condition(perPage, page, sort, order, startTime, endTime, fields);<NEW_LINE>}
|
(requestParams.get("endTime"));
|
997,574
|
public void configure(Map<String, ?> configs, boolean isKey) {<NEW_LINE>this.autoConfigs.putAll(configs);<NEW_LINE>this.forKeys = isKey;<NEW_LINE>String configKey = configKey();<NEW_LINE>Object value = configs.get(configKey);<NEW_LINE>if (value == null) {<NEW_LINE>return;<NEW_LINE>} else if (value instanceof Map) {<NEW_LINE>((Map<String, Object>) value).forEach((selector, serializer) -> {<NEW_LINE>if (serializer instanceof Serializer) {<NEW_LINE>this.delegates.put(selector, (Serializer<?>) serializer);<NEW_LINE>((Serializer<?>) serializer).configure(configs, isKey);<NEW_LINE>} else if (serializer instanceof Class) {<NEW_LINE>instantiateAndConfigure(configs, isKey, this.delegates, selector, (Class<?>) serializer);<NEW_LINE>} else if (serializer instanceof String) {<NEW_LINE>createInstanceAndConfigure(configs, isKey, this.delegates, selector, (String) serializer);<NEW_LINE>} else {<NEW_LINE>throw new IllegalStateException(configKey + <MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>} else if (value instanceof String) {<NEW_LINE>this.delegates.putAll(createDelegates((String) value, configs, isKey));<NEW_LINE>} else {<NEW_LINE>throw new IllegalStateException(configKey + " must be a map or String, not " + value.getClass());<NEW_LINE>}<NEW_LINE>}
|
" map entries must be Serializers or class names, not " + value.getClass());
|
1,571,202
|
private static void initKafkaProducerMap(Long clusterId) {<NEW_LINE>ClusterDO clusterDO = PhysicalClusterMetadataManager.getClusterFromCache(clusterId);<NEW_LINE>if (clusterDO == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>lock.lock();<NEW_LINE>try {<NEW_LINE>KafkaProducer<String, String> kafkaProducer = KAFKA_PRODUCER_MAP.get(clusterId);<NEW_LINE>if (!ValidateUtils.isNull(kafkaProducer)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Properties <MASK><NEW_LINE>properties.setProperty(ProducerConfig.COMPRESSION_TYPE_CONFIG, "lz4");<NEW_LINE>properties.setProperty(ProducerConfig.LINGER_MS_CONFIG, "10");<NEW_LINE>properties.setProperty(ProducerConfig.RETRIES_CONFIG, "3");<NEW_LINE>KAFKA_PRODUCER_MAP.put(clusterId, new KafkaProducer<>(properties));<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.error("create kafka producer failed, clusterDO:{}.", clusterDO, e);<NEW_LINE>} finally {<NEW_LINE>lock.unlock();<NEW_LINE>}<NEW_LINE>}
|
properties = createProperties(clusterDO, true);
|
903,287
|
public R next() {<NEW_LINE><MASK><NEW_LINE>boolean b2 = it2.hasNext();<NEW_LINE>boolean b3 = it3.hasNext();<NEW_LINE>boolean b4 = it4.hasNext();<NEW_LINE>boolean b5 = it5.hasNext();<NEW_LINE>boolean b6 = it6.hasNext();<NEW_LINE>boolean b7 = it7.hasNext();<NEW_LINE>boolean b8 = it8.hasNext();<NEW_LINE>boolean b9 = it9.hasNext();<NEW_LINE>if (!b1 && !b2 && !b3 && !b4 && !b5 && !b6 && !b7 && !b8 && !b9)<NEW_LINE>throw new NoSuchElementException("next on empty iterator");<NEW_LINE>return zipper.apply(b1 ? it1.next() : default1, b2 ? it2.next() : default2, b3 ? it3.next() : default3, b4 ? it4.next() : default4, b5 ? it5.next() : default5, b6 ? it6.next() : default6, b7 ? it7.next() : default7, b8 ? it8.next() : default8, b9 ? it9.next() : default9);<NEW_LINE>}
|
boolean b1 = it1.hasNext();
|
444,651
|
private void unprotectAddReplica(OlapTable olapTable, ReplicaPersistInfo info) {<NEW_LINE>LOG.debug("replay add a replica {}", info);<NEW_LINE>Partition partition = olapTable.getPartition(info.getPartitionId());<NEW_LINE>MaterializedIndex materializedIndex = partition.<MASK><NEW_LINE>Tablet tablet = materializedIndex.getTablet(info.getTabletId());<NEW_LINE>// for compatibility<NEW_LINE>int schemaHash = info.getSchemaHash();<NEW_LINE>if (schemaHash == -1) {<NEW_LINE>schemaHash = olapTable.getSchemaHashByIndexId(info.getIndexId());<NEW_LINE>}<NEW_LINE>Replica replica = new Replica(info.getReplicaId(), info.getBackendId(), info.getVersion(), schemaHash, info.getDataSize(), info.getRemoteDataSize(), info.getRowCount(), ReplicaState.NORMAL, info.getLastFailedVersion(), info.getLastSuccessVersion());<NEW_LINE>tablet.addReplica(replica);<NEW_LINE>}
|
getIndex(info.getIndexId());
|
1,806,120
|
private JComponent createTopCombo(JFileChooser fc) {<NEW_LINE>JPanel panel = new JPanel();<NEW_LINE>if (fc.getAccessory() != null) {<NEW_LINE>panel.setBorder(BorderFactory.createEmptyBorder(4, 0, 8, 0));<NEW_LINE>} else {<NEW_LINE>panel.setBorder(BorderFactory.createEmptyBorder(6, 0, 10, 0));<NEW_LINE>}<NEW_LINE>panel<MASK><NEW_LINE>Box labelBox = Box.createHorizontalBox();<NEW_LINE>lookInComboBoxLabel = new JLabel(lookInLabelText);<NEW_LINE>lookInComboBoxLabel.setDisplayedMnemonic(lookInLabelMnemonic);<NEW_LINE>lookInComboBoxLabel.setAlignmentX(JComponent.LEFT_ALIGNMENT);<NEW_LINE>lookInComboBoxLabel.setAlignmentY(JComponent.CENTER_ALIGNMENT);<NEW_LINE>labelBox.add(lookInComboBoxLabel);<NEW_LINE>labelBox.add(Box.createRigidArea(new Dimension(9, 0)));<NEW_LINE>// fixed #97525, made the height of the<NEW_LINE>// combo box bigger.<NEW_LINE>directoryComboBox = new JComboBox() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Dimension getMinimumSize() {<NEW_LINE>Dimension d = super.getMinimumSize();<NEW_LINE>d.width = 60;<NEW_LINE>return d;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Dimension getPreferredSize() {<NEW_LINE>Dimension d = super.getPreferredSize();<NEW_LINE>// Must be small enough to not affect total width and height.<NEW_LINE>d.height = 24;<NEW_LINE>d.width = 150;<NEW_LINE>return d;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>directoryComboBox.putClientProperty("JComboBox.lightweightKeyboardNavigation", "Lightweight");<NEW_LINE>lookInComboBoxLabel.setLabelFor(directoryComboBox);<NEW_LINE>directoryComboBoxModel = createDirectoryComboBoxModel(fc);<NEW_LINE>directoryComboBox.setModel(directoryComboBoxModel);<NEW_LINE>directoryComboBox.addActionListener(directoryComboBoxAction);<NEW_LINE>directoryComboBox.setRenderer(createDirectoryComboBoxRenderer(fc));<NEW_LINE>directoryComboBox.setAlignmentX(JComponent.LEFT_ALIGNMENT);<NEW_LINE>directoryComboBox.setAlignmentY(JComponent.CENTER_ALIGNMENT);<NEW_LINE>directoryComboBox.setMaximumRowCount(8);<NEW_LINE>panel.add(labelBox, BorderLayout.WEST);<NEW_LINE>panel.add(directoryComboBox, BorderLayout.CENTER);<NEW_LINE>return panel;<NEW_LINE>}
|
.setLayout(new BorderLayout());
|
1,386,361
|
public boolean handleRequest(MessageContext messageContext) {<NEW_LINE>if (!isSoapMessageContext(messageContext)) {<NEW_LINE>// cannot process this, as this is not a soap message context<NEW_LINE>throw new JAXRPCException(errMsg);<NEW_LINE>}<NEW_LINE>if (config_ == null) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>// get the ClientAuthContext<NEW_LINE>SOAPMessageContext smc = (SOAPMessageContext) messageContext;<NEW_LINE>SOAPMessage request = smc.getMessage();<NEW_LINE>ClientAuthContext cAC = config_.getAuthContext(null, request);<NEW_LINE>if (cAC == null) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>smc.setProperty(CLIENT_AUTH_CONTEXT, cAC);<NEW_LINE>smc.setProperty(javax.xml.ws.handler.MessageContext.WSDL_SERVICE, serviceName);<NEW_LINE>try {<NEW_LINE>WebServiceSecurity.secureRequest(smc, cAC, isAppclientContainer);<NEW_LINE>} catch (Exception e) {<NEW_LINE>if (_logger.isLoggable(Level.WARNING)) {<NEW_LINE>_logger.log(Level.<MASK><NEW_LINE>}<NEW_LINE>throw new JAXRPCException(e);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
|
WARNING, LogUtils.ERROR_REQUEST_SECURING, e);
|
82,856
|
private String _cleanLongFilename(String fname) {<NEW_LINE>int namemax = 136;<NEW_LINE>// 240 for windows<NEW_LINE>int pathmax = 1024;<NEW_LINE>// cap namemax based on absolute path<NEW_LINE>// ideally, name should be normalized. Without access to nio.Paths library, it's hard to do it really correctly. This is still a better approximation than nothing.<NEW_LINE>int dirlen = fname.length();<NEW_LINE>int remaining = pathmax - dirlen;<NEW_LINE>namemax = min(remaining, namemax);<NEW_LINE>Assert.<MASK><NEW_LINE>if (fname.length() > namemax) {<NEW_LINE>int lastSlash = fname.indexOf("/");<NEW_LINE>int lastDot = fname.indexOf(".");<NEW_LINE>if (lastDot == -1 || lastDot < lastSlash) {<NEW_LINE>// no dot, or before last slash<NEW_LINE>fname = fname.substring(0, namemax);<NEW_LINE>} else {<NEW_LINE>String ext = fname.substring(lastDot + 1);<NEW_LINE>String head = fname.substring(0, lastDot);<NEW_LINE>int headmax = namemax - ext.length();<NEW_LINE>head = head.substring(0, headmax);<NEW_LINE>fname = head + ext;<NEW_LINE>Assert.that(fname.length() <= namemax, "The length of the file is greater than the maximal name value.");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return fname;<NEW_LINE>}
|
that(namemax > 0, "The media directory is maximally long. There is no more length available for file name.");
|
650,400
|
public int compare(OptionSpec o1, OptionSpec o2) {<NEW_LINE>// options before params<NEW_LINE>if (o1 == null) {<NEW_LINE>return 1;<NEW_LINE>} else if (o2 == null) {<NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>String[] names1 = ShortestFirst.sort(o1.names());<NEW_LINE>String[] names2 = ShortestFirst.sort(o2.names());<NEW_LINE>String s1 = stripPrefix(names1[0]);<NEW_LINE>String s2 <MASK><NEW_LINE>// case insensitive sort<NEW_LINE>int result = s1.toUpperCase().compareTo(s2.toUpperCase());<NEW_LINE>// lower case before upper case<NEW_LINE>result = result == 0 ? -s1.compareTo(s2) : result;<NEW_LINE>// help options come last<NEW_LINE>return o1.help() == o2.help() ? result : o2.help() ? -1 : 1;<NEW_LINE>}
|
= stripPrefix(names2[0]);
|
902,204
|
public static BaseHttpClientInvocation createSearchInvocation(FhirContext theContext, String theResourceName, Map<String, List<String>> theParameters, IIdType theId, String theCompartmentName, SearchStyleEnum theSearchStyle) {<NEW_LINE>SearchStyleEnum searchStyle = theSearchStyle;<NEW_LINE>if (searchStyle == null) {<NEW_LINE>int length = 0;<NEW_LINE>for (Entry<String, List<String>> nextEntry : theParameters.entrySet()) {<NEW_LINE>length += nextEntry.getKey().length();<NEW_LINE>for (String next : nextEntry.getValue()) {<NEW_LINE>length += next.length();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (length < 5000) {<NEW_LINE>searchStyle = SearchStyleEnum.GET;<NEW_LINE>} else {<NEW_LINE>searchStyle = SearchStyleEnum.POST;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>BaseHttpClientInvocation invocation;<NEW_LINE>boolean compartmentSearch = false;<NEW_LINE>if (theCompartmentName != null) {<NEW_LINE>if (theId == null || !theId.hasIdPart()) {<NEW_LINE>String msg = theContext.getLocalizer().getMessage(SearchMethodBinding.class.getName() + ".idNullForCompartmentSearch");<NEW_LINE>throw new InvalidRequestException(Msg<MASK><NEW_LINE>}<NEW_LINE>compartmentSearch = true;<NEW_LINE>}<NEW_LINE>switch(searchStyle) {<NEW_LINE>case GET:<NEW_LINE>default:<NEW_LINE>if (compartmentSearch) {<NEW_LINE>invocation = new HttpGetClientInvocation(theContext, theParameters, theResourceName, theId.getIdPart(), theCompartmentName);<NEW_LINE>} else {<NEW_LINE>invocation = new HttpGetClientInvocation(theContext, theParameters, theResourceName);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case GET_WITH_SEARCH:<NEW_LINE>if (compartmentSearch) {<NEW_LINE>invocation = new HttpGetClientInvocation(theContext, theParameters, theResourceName, theId.getIdPart(), theCompartmentName, Constants.PARAM_SEARCH);<NEW_LINE>} else {<NEW_LINE>invocation = new HttpGetClientInvocation(theContext, theParameters, theResourceName, Constants.PARAM_SEARCH);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case POST:<NEW_LINE>if (compartmentSearch) {<NEW_LINE>invocation = new HttpPostClientInvocation(theContext, theParameters, theResourceName, theId.getIdPart(), theCompartmentName, Constants.PARAM_SEARCH);<NEW_LINE>} else {<NEW_LINE>invocation = new HttpPostClientInvocation(theContext, theParameters, theResourceName, Constants.PARAM_SEARCH);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return invocation;<NEW_LINE>}
|
.code(1444) + msg);
|
317,507
|
protected Control createControl(Composite parent) {<NEW_LINE>DB2DDLFormat ddlFormat = DB2DDLFormat.getCurrentFormat(getSourceObject().getDataSource());<NEW_LINE>final Combo ddlFormatCombo = new Combo(parent, SWT.BORDER | <MASK><NEW_LINE>ddlFormatCombo.setToolTipText("DDL Format");<NEW_LINE>for (DB2DDLFormat format : DB2DDLFormat.values()) {<NEW_LINE>ddlFormatCombo.add(format.getTitle());<NEW_LINE>if (format == ddlFormat) {<NEW_LINE>ddlFormatCombo.select(ddlFormatCombo.getItemCount() - 1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ddlFormatCombo.addSelectionListener(new SelectionAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void widgetSelected(SelectionEvent e) {<NEW_LINE>for (DB2DDLFormat format : DB2DDLFormat.values()) {<NEW_LINE>if (format.ordinal() == ddlFormatCombo.getSelectionIndex()) {<NEW_LINE>getSourceObject().getDataSource().getContainer().getPreferenceStore().setValue(DB2Constants.PREF_KEY_DDL_FORMAT, format.name());<NEW_LINE>refreshPart(this, true);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return ddlFormatCombo;<NEW_LINE>}
|
SWT.READ_ONLY | SWT.DROP_DOWN);
|
552,824
|
public boolean equalsStructurally(IJsonType o) {<NEW_LINE>if (this == o) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (o == null || getClass() != o.getClass()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (!super.equals(o)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>JsonStructureType that = (JsonStructureType) o;<NEW_LINE>int[] i = { 0 };<NEW_LINE>if (_state._superTypes.size() != that._state._superTypes.size() || !_state._superTypes.stream().allMatch(t -> that._state._superTypes.get(i[0]++).equalsStructurally(t))) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (!(_state._membersByName.size() == that._state._membersByName.size() && _state._membersByName.keySet().stream().allMatch(key -> that._state._membersByName.containsKey(key) && _state._membersByName.get(key).equalsStructurally(that._state._membersByName.get(key))))) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (!(_state._unionMembers.size() == that._state._unionMembers.size() && _state._unionMembers.keySet().stream().allMatch(key -> that._state._unionMembers.containsKey(key) && typeSetsSame(_state._unionMembers.get(key), that._state._unionMembers.get(key))))) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return _state._innerTypes.size() == that._state._innerTypes.size() && _state._innerTypes.keySet().stream().allMatch(key -> that._state._innerTypes.containsKey(key) && _state._innerTypes.get(key).equalsStructurally(that._state.<MASK><NEW_LINE>}
|
_innerTypes.get(key)));
|
1,657,475
|
public ExecPlan plan(UpdateStmt updateStmt, ConnectContext session) {<NEW_LINE>QueryRelation query = updateStmt.getQueryStatement().getQueryRelation();<NEW_LINE>List<String> colNames = query.getColumnOutputNames();<NEW_LINE>ColumnRefFactory columnRefFactory = new ColumnRefFactory();<NEW_LINE>LogicalPlan logicalPlan = new RelationTransformer(columnRefFactory, session).transformWithSelectLimit(query);<NEW_LINE>Optimizer optimizer = new Optimizer();<NEW_LINE>OptExpression optimizedPlan = optimizer.optimize(session, logicalPlan.getRoot(), new PhysicalPropertySet(), new ColumnRefSet(logicalPlan.getOutputColumn()), columnRefFactory);<NEW_LINE>ExecPlan execPlan = new PlanFragmentBuilder().createPhysicalPlanWithoutOutputFragment(optimizedPlan, session, logicalPlan.getOutputColumn(), columnRefFactory, colNames);<NEW_LINE>DescriptorTable descriptorTable = execPlan.getDescTbl();<NEW_LINE>TupleDescriptor olapTuple = descriptorTable.createTupleDescriptor();<NEW_LINE>List<Pair<Integer, ColumnDict>> globalDicts = Lists.newArrayList();<NEW_LINE>OlapTable table = (OlapTable) updateStmt.getTable();<NEW_LINE>long tableId = table.getId();<NEW_LINE>for (Column column : table.getFullSchema()) {<NEW_LINE>SlotDescriptor slotDescriptor = descriptorTable.addSlotDescriptor(olapTuple);<NEW_LINE>slotDescriptor.setIsMaterialized(true);<NEW_LINE>slotDescriptor.setType(column.getType());<NEW_LINE>slotDescriptor.setColumn(column);<NEW_LINE>slotDescriptor.setIsNullable(column.isAllowNull());<NEW_LINE>if (column.getType().isVarchar() && IDictManager.getInstance().hasGlobalDict(tableId, column.getName())) {<NEW_LINE>Optional<ColumnDict> dict = IDictManager.getInstance().getGlobalDict(tableId, column.getName());<NEW_LINE>if (dict != null && dict.isPresent()) {<NEW_LINE>globalDicts.add(new Pair<>(slotDescriptor.getId().asInt(), dict.get()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>olapTuple.computeMemLayout();<NEW_LINE>List<Long> partitionIds = Lists.newArrayList();<NEW_LINE>for (Partition partition : table.getPartitions()) {<NEW_LINE>partitionIds.add(partition.getId());<NEW_LINE>}<NEW_LINE>DataSink dataSink = new OlapTableSink(table, olapTuple, partitionIds);<NEW_LINE>execPlan.getFragments().get<MASK><NEW_LINE>execPlan.getFragments().get(0).setLoadGlobalDicts(globalDicts);<NEW_LINE>return execPlan;<NEW_LINE>}
|
(0).setSink(dataSink);
|
1,313,579
|
public TransitGatewayConnectRequestBgpOptions unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>TransitGatewayConnectRequestBgpOptions transitGatewayConnectRequestBgpOptions = new TransitGatewayConnectRequestBgpOptions();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 1;<NEW_LINE>while (true) {<NEW_LINE>XMLEvent xmlEvent = context.nextEvent();<NEW_LINE>if (xmlEvent.isEndDocument())<NEW_LINE>return transitGatewayConnectRequestBgpOptions;<NEW_LINE>if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {<NEW_LINE>if (context.testExpression("PeerAsn", targetDepth)) {<NEW_LINE>transitGatewayConnectRequestBgpOptions.setPeerAsn(LongStaxUnmarshaller.getInstance<MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent.isEndElement()) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return transitGatewayConnectRequestBgpOptions;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
().unmarshall(context));
|
1,692,757
|
private void reverseCorrectIt0() {<NEW_LINE>final MAllocationHdr reversal = new MAllocationHdr(getCtx(), 0, get_TrxName());<NEW_LINE>final boolean copyHonorIsCalculated = true;<NEW_LINE>copyValues(this, reversal, copyHonorIsCalculated);<NEW_LINE>//<NEW_LINE>// 07570: Keep AD_Org of original document<NEW_LINE>reversal.setAD_Org_ID(getAD_Org_ID());<NEW_LINE>// let it generate a new document#<NEW_LINE>reversal.setDocumentNo("");<NEW_LINE>reversal.setProcessing(false);<NEW_LINE>reversal.setProcessed(false);<NEW_LINE>reversal.setDocStatus(DocStatus.Drafted.getCode());<NEW_LINE>reversal.setDocAction(DOCACTION_Complete);<NEW_LINE>reversal.setPosted(false);<NEW_LINE>reversal.setReversal_ID(getC_AllocationHdr_ID());<NEW_LINE>InterfaceWrapperHelper.save(reversal);<NEW_LINE>setReversal_ID(reversal.getC_AllocationHdr_ID());<NEW_LINE>InterfaceWrapperHelper.save(this);<NEW_LINE>// task 09610: needed to set the correct counter-IDs if any<NEW_LINE>final Map<Integer, Integer> lineId2reversalLineId = new HashMap<>();<NEW_LINE>final Map<Integer, I_C_AllocationLine> reversalLineId2reversalLine = new HashMap<>();<NEW_LINE>for (final MAllocationLine line : getLines(true)) {<NEW_LINE>final MAllocationLine reversalLine = new MAllocationLine(reversal);<NEW_LINE>PO.copyValues(line, reversalLine, copyHonorIsCalculated);<NEW_LINE>//<NEW_LINE>// 07570: Keep AD_Org of original document<NEW_LINE>reversalLine.setAD_Org_ID(line.getAD_Org_ID());<NEW_LINE>reversalLine.setC_AllocationHdr_ID(reversal.getC_AllocationHdr_ID());<NEW_LINE>reversalLine.setAmount(reversalLine.getAmount().negate());<NEW_LINE>reversalLine.setDiscountAmt(reversalLine.getDiscountAmt().negate());<NEW_LINE>reversalLine.setOverUnderAmt(reversalLine.getOverUnderAmt().negate());<NEW_LINE>reversalLine.setWriteOffAmt(reversalLine.getWriteOffAmt().negate());<NEW_LINE>reversalLine.setReversalLine_ID(line.getC_AllocationLine_ID());<NEW_LINE>InterfaceWrapperHelper.save(reversalLine);<NEW_LINE>line.setReversalLine_ID(reversalLine.getC_AllocationLine_ID());<NEW_LINE>InterfaceWrapperHelper.save(line);<NEW_LINE>lineId2reversalLineId.put(line.getC_AllocationLine_ID(), reversalLine.getC_AllocationLine_ID());<NEW_LINE>reversalLineId2reversalLine.put(reversalLine.getC_AllocationLine_ID(), reversalLine);<NEW_LINE>}<NEW_LINE>// task 09610: iterate again and set the reversal lines' counter-IDs according to the original line's counter-IDs<NEW_LINE>for (final MAllocationLine line : getLines(false)) {<NEW_LINE>if (line.getCounter_AllocationLine_ID() <= 0) {<NEW_LINE>// nothing to do<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>final Integer reversalLineId = lineId2reversalLineId.get(line.getC_AllocationLine_ID());<NEW_LINE>final I_C_AllocationLine reversalLine = reversalLineId2reversalLine.get(reversalLineId);<NEW_LINE>final Integer reversalLineCounterLineId = lineId2reversalLineId.get(line.getCounter_AllocationLine_ID());<NEW_LINE>reversalLine.setCounter_AllocationLine_ID(reversalLineCounterLineId);<NEW_LINE>InterfaceWrapperHelper.save(reversalLine);<NEW_LINE>}<NEW_LINE>if (!reversal.processIt(DOCACTION_Complete)) {<NEW_LINE>throw new AdempiereException(reversal.getProcessMsg());<NEW_LINE>}<NEW_LINE>reversal.setDocStatus(DocStatus.Reversed.getCode());<NEW_LINE>reversal.setDocAction(DOCACTION_None);<NEW_LINE>InterfaceWrapperHelper.save(reversal);<NEW_LINE>setDocStatus(<MASK><NEW_LINE>setDocAction(DOCACTION_None);<NEW_LINE>}
|
DocStatus.Reversed.getCode());
|
1,101,258
|
public ResponseContainer showTableInformation(RequestContainer request, Templater templater) {<NEW_LINE>if (!(request instanceof JdbcRequestContainer)) {<NEW_LINE>throw new IllegalArgumentException("Unsupported request container: " + request.getType());<NEW_LINE>}<NEW_LINE>JdbcRequestContainer jdbcRequest = (JdbcRequestContainer) request;<NEW_LINE>String jdbcUrl = jdbcRequest.getJdbcUrl();<NEW_LINE>var tableName = getTableName();<NEW_LINE>Connection connection = DriverManager.getConnection(templater.replaceTags(jdbcUrl));<NEW_LINE>DatabaseMetaData md = connection.getMetaData();<NEW_LINE>ResultSet rs = md.getColumns(null, null, tableName, "%");<NEW_LINE>TableResponseContainer response = new TableResponseContainer();<NEW_LINE>RowSetResponseAspect rowSetAspect = new RowSetResponseAspect();<NEW_LINE>extractRows(rs, rowSetAspect);<NEW_LINE>response.getAspects().add(rowSetAspect);<NEW_LINE>response.getStatusInformations().complete(Map.of("Selected Rows", new StyledText("" + rowSetAspect.getRows(<MASK><NEW_LINE>return response;<NEW_LINE>}
|
).size())));
|
135,369
|
private void initFields() {<NEW_LINE>String address = instance.getProperty(PayaraModule.DEBUG_PORT);<NEW_LINE>SpinnerNumberModel addressModel = (SpinnerNumberModel) addressValue.getModel();<NEW_LINE>javaPlatforms = JavaUtils.findSupportedPlatforms(this.instance);<NEW_LINE>((JavaPlatformsComboBox) javaComboBox).updateModel(javaPlatforms);<NEW_LINE>javaComboBox.<MASK><NEW_LINE>if (null == address || "0".equals(address) || "".equals(address)) {<NEW_LINE>useUserDefinedAddress.setSelected(false);<NEW_LINE>} else {<NEW_LINE>useUserDefinedAddress.setSelected(true);<NEW_LINE>setAddressValue(address);<NEW_LINE>}<NEW_LINE>if (Utilities.isWindows() && !instance.isRemote()) {<NEW_LINE>useSharedMemRB.setSelected("true".equals(instance.getProperty(PayaraModule.USE_SHARED_MEM_ATTR)));<NEW_LINE>useSocketRB.setSelected(!("true".equals(instance.getProperty(PayaraModule.USE_SHARED_MEM_ATTR))));<NEW_LINE>} else {<NEW_LINE>// not windows -- disable shared mem and correct it if it was set...<NEW_LINE>// or remote instance....<NEW_LINE>useSharedMemRB.setEnabled(false);<NEW_LINE>useSharedMemRB.setSelected(false);<NEW_LINE>useSocketRB.setSelected(true);<NEW_LINE>}<NEW_LINE>useIDEProxyInfo.setSelected("true".equals(instance.getProperty(PayaraModule.USE_IDE_PROXY_FLAG)));<NEW_LINE>boolean isLocalDomain = instance.getProperty(PayaraModule.DOMAINS_FOLDER_ATTR) != null;<NEW_LINE>this.javaComboBox.setEnabled(isLocalDomain);<NEW_LINE>this.useIDEProxyInfo.setEnabled(isLocalDomain);<NEW_LINE>this.useSharedMemRB.setEnabled(isLocalDomain);<NEW_LINE>}
|
setSelectedItem(instance.getJavaPlatform());
|
1,271,038
|
public void write(org.apache.thrift.protocol.TProtocol oprot, HavingFilterQueryMap struct) throws org.apache.thrift.TException {<NEW_LINE>struct.validate();<NEW_LINE>oprot.writeStructBegin(STRUCT_DESC);<NEW_LINE>if (struct.filterQueryMap != null) {<NEW_LINE>if (struct.isSetFilterQueryMap()) {<NEW_LINE>oprot.writeFieldBegin(FILTER_QUERY_MAP_FIELD_DESC);<NEW_LINE>{<NEW_LINE>oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I32, org.apache.thrift.protocol.TType.STRUCT, struct.filterQueryMap.size()));<NEW_LINE>for (java.util.Map.Entry<java.lang.Integer, HavingFilterQuery> _iter46 : struct.filterQueryMap.entrySet()) {<NEW_LINE>oprot.writeI32(_iter46.getKey());<NEW_LINE>_iter46.<MASK><NEW_LINE>}<NEW_LINE>oprot.writeMapEnd();<NEW_LINE>}<NEW_LINE>oprot.writeFieldEnd();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>oprot.writeFieldStop();<NEW_LINE>oprot.writeStructEnd();<NEW_LINE>}
|
getValue().write(oprot);
|
269,875
|
private void analyzeHeadStems() {<NEW_LINE>logger.debug(<MASK><NEW_LINE>final List<Inter> heads = sig.inters(ShapeSet.StemHeads);<NEW_LINE>for (Inter hi : heads) {<NEW_LINE>HeadInter head = (HeadInter) hi;<NEW_LINE>// Retrieve connected stems into left and right sides<NEW_LINE>Map<HorizontalSide, Set<StemInter>> map = head.getSideStems();<NEW_LINE>// Check each side<NEW_LINE>for (Entry<HorizontalSide, Set<StemInter>> entry : map.entrySet()) {<NEW_LINE>Set<StemInter> set = entry.getValue();<NEW_LINE>if (set.size() > 1) {<NEW_LINE>// ////////////////////////////////////////////////HB sig.insertExclusions(set, Exclusion.ExclusionCause.OVERLAP);<NEW_LINE>// TODO:<NEW_LINE>// Instead of stem exclusion, we should disconnect head from some of these stems<NEW_LINE>// Either all the stems above or all the stems below<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
"S#{} analyzeHeadStems", system.getId());
|
14,725
|
private void writeFieldSet(JField serializableField) {<NEW_LINE>JType fieldType = serializableField.getType();<NEW_LINE>String fieldTypeQualifiedSourceName = fieldType.getQualifiedSourceName();<NEW_LINE>String serializableClassQualifedName = serializableClass.getQualifiedSourceName();<NEW_LINE>String fieldName = serializableField.getName();<NEW_LINE>maybeSuppressLongWarnings(fieldType);<NEW_LINE>sourceWriter.print("private static " + (isProd ? "native " : "") + "void");<NEW_LINE>sourceWriter.print(" set");<NEW_LINE>sourceWriter.print(Shared.capitalize(fieldName));<NEW_LINE>sourceWriter.print("(");<NEW_LINE>sourceWriter.print(serializableClassQualifedName);<NEW_LINE>sourceWriter.print(" instance, ");<NEW_LINE>sourceWriter.print(fieldTypeQualifiedSourceName);<NEW_LINE>sourceWriter.println(" value) ");<NEW_LINE>sourceWriter.println(methodStart);<NEW_LINE>sourceWriter.indent();<NEW_LINE>if (context.isProdMode()) {<NEW_LINE>sourceWriter.print("instance.@");<NEW_LINE>sourceWriter.print(SerializationUtils.getRpcTypeName(serializableClass));<NEW_LINE>sourceWriter.print("::");<NEW_LINE>sourceWriter.print(fieldName);<NEW_LINE>sourceWriter.println(" = value;");<NEW_LINE>} else {<NEW_LINE>sourceWriter.println("ReflectionHelper.setField(" + <MASK><NEW_LINE>}<NEW_LINE>sourceWriter.outdent();<NEW_LINE>sourceWriter.println(methodEnd);<NEW_LINE>sourceWriter.println();<NEW_LINE>}
|
serializableClassQualifedName + ".class, instance, \"" + fieldName + "\", value);");
|
1,788,825
|
public DiscoveryResult createResult(ServiceInfo service) {<NEW_LINE>final ThingUID uid = getThingUID(service);<NEW_LINE>if (uid == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final Map<String, Object> properties = new HashMap<>(2);<NEW_LINE>String host = service.getHostAddresses()[0];<NEW_LINE>properties.put(CONFIG_ADDRESS, host);<NEW_LINE>int port = service.getPort();<NEW_LINE>properties.put(CONFIG_PORT, port);<NEW_LINE>String firmwareVersion = service.getPropertyString("srcvers");<NEW_LINE>properties.put(Thing.PROPERTY_FIRMWARE_VERSION, firmwareVersion);<NEW_LINE>String modelId = service.getPropertyString("md");<NEW_LINE>properties.put(Thing.PROPERTY_MODEL_ID, modelId);<NEW_LINE>properties.<MASK><NEW_LINE>String qualifiedName = service.getQualifiedName();<NEW_LINE>logger.debug("Device found: {}", qualifiedName);<NEW_LINE>logger.trace("Discovered nanoleaf host: {} port: {} firmWare: {} modelId: {} qualifiedName: {}", host, port, firmwareVersion, modelId, qualifiedName);<NEW_LINE>logger.debug("Adding Nanoleaf controller {} with FW version {} found at {}:{} to inbox", qualifiedName, firmwareVersion, host, port);<NEW_LINE>if (!OpenAPIUtils.checkRequiredFirmware(service.getPropertyString("md"), firmwareVersion)) {<NEW_LINE>logger.debug("Nanoleaf controller firmware is too old. Must be {} or higher", MODEL_ID_LIGHTPANELS.equals(modelId) ? API_MIN_FW_VER_LIGHTPANELS : API_MIN_FW_VER_CANVAS);<NEW_LINE>}<NEW_LINE>final DiscoveryResult result = DiscoveryResultBuilder.create(uid).withThingType(getThingType(service)).withProperties(properties).withLabel(service.getName()).withRepresentationProperty(CONFIG_ADDRESS).build();<NEW_LINE>return result;<NEW_LINE>}
|
put(Thing.PROPERTY_VENDOR, "Nanoleaf");
|
444,146
|
public Builder mergeFrom(emu.grasscutter.net.proto.PlayerStoreNotifyOuterClass.PlayerStoreNotify other) {<NEW_LINE>if (other == emu.grasscutter.net.proto.PlayerStoreNotifyOuterClass.PlayerStoreNotify.getDefaultInstance())<NEW_LINE>return this;<NEW_LINE>if (other.storeType_ != 0) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (itemListBuilder_ == null) {<NEW_LINE>if (!other.itemList_.isEmpty()) {<NEW_LINE>if (itemList_.isEmpty()) {<NEW_LINE>itemList_ = other.itemList_;<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000001);<NEW_LINE>} else {<NEW_LINE>ensureItemListIsMutable();<NEW_LINE>itemList_.addAll(other.itemList_);<NEW_LINE>}<NEW_LINE>onChanged();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (!other.itemList_.isEmpty()) {<NEW_LINE>if (itemListBuilder_.isEmpty()) {<NEW_LINE>itemListBuilder_.dispose();<NEW_LINE>itemListBuilder_ = null;<NEW_LINE>itemList_ = other.itemList_;<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000001);<NEW_LINE>itemListBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getItemListFieldBuilder() : null;<NEW_LINE>} else {<NEW_LINE>itemListBuilder_.addAllMessages(other.itemList_);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (other.getWeightLimit() != 0) {<NEW_LINE>setWeightLimit(other.getWeightLimit());<NEW_LINE>}<NEW_LINE>this.mergeUnknownFields(other.unknownFields);<NEW_LINE>onChanged();<NEW_LINE>return this;<NEW_LINE>}
|
setStoreTypeValue(other.getStoreTypeValue());
|
751,216
|
private void initAssets() {<NEW_LINE>// cast lambdas explicitly to avoid inconsistent compiler behavior wrt. type inference<NEW_LINE>assetTypeManager.createAssetType(Prefab.class, PojoPrefab::new, "prefabs");<NEW_LINE>assetTypeManager.createAssetType(BlockShape.class, BlockShapeImpl::new, "shapes");<NEW_LINE>assetTypeManager.createAssetType(BlockSounds.class, BlockSounds::new, "blockSounds");<NEW_LINE>assetTypeManager.createAssetType(BlockTile.class, BlockTile::new, "blockTiles");<NEW_LINE>AssetType<BlockFamilyDefinition, BlockFamilyDefinitionData> blockFamilyDefinitionAssetType = assetTypeManager.createAssetType(BlockFamilyDefinition.class, BlockFamilyDefinition::new, "blocks");<NEW_LINE>assetTypeManager.getAssetFileDataProducer(blockFamilyDefinitionAssetType).addAssetFormat(new BlockFamilyDefinitionFormat(assetTypeManager.getAssetManager()));<NEW_LINE>assetTypeManager.createAssetType(UISkinAsset.class, UISkinAsset::new, "skins");<NEW_LINE>assetTypeManager.createAssetType(BehaviorTree.class, BehaviorTree::new, "behaviors");<NEW_LINE>assetTypeManager.createAssetType(UIElement.class, UIElement::new, "ui");<NEW_LINE>assetTypeManager.createAssetType(ByteBufferAsset.<MASK><NEW_LINE>for (EngineSubsystem subsystem : allSubsystems) {<NEW_LINE>subsystem.registerCoreAssetTypes(assetTypeManager);<NEW_LINE>}<NEW_LINE>}
|
class, ByteBufferAsset::new, "mesh");
|
255,801
|
static Object executeNotEquals(final IExpressionContext context, final NotEqualsExpression expression, final StandardExpressionExecutionContext expContext) {<NEW_LINE>Object leftValue = expression.getLeft(<MASK><NEW_LINE>Object rightValue = expression.getRight().execute(context, expContext);<NEW_LINE>leftValue = LiteralValue.unwrap(leftValue);<NEW_LINE>rightValue = LiteralValue.unwrap(rightValue);<NEW_LINE>if (leftValue == null) {<NEW_LINE>return Boolean.valueOf(rightValue != null);<NEW_LINE>}<NEW_LINE>Boolean result = null;<NEW_LINE>final BigDecimal leftNumberValue = EvaluationUtils.evaluateAsNumber(leftValue);<NEW_LINE>final BigDecimal rightNumberValue = EvaluationUtils.evaluateAsNumber(rightValue);<NEW_LINE>if (leftNumberValue != null && rightNumberValue != null) {<NEW_LINE>result = Boolean.valueOf(leftNumberValue.compareTo(rightNumberValue) != 0);<NEW_LINE>} else {<NEW_LINE>if (leftValue instanceof Character) {<NEW_LINE>// Just a character, no need to use conversionService here<NEW_LINE>leftValue = leftValue.toString();<NEW_LINE>}<NEW_LINE>if (rightValue != null && rightValue instanceof Character) {<NEW_LINE>// Just a character, no need to use conversionService here<NEW_LINE>rightValue = rightValue.toString();<NEW_LINE>}<NEW_LINE>if (rightValue != null && leftValue.getClass().equals(rightValue.getClass()) && Comparable.class.isAssignableFrom(leftValue.getClass())) {<NEW_LINE>result = Boolean.valueOf(((Comparable<Object>) leftValue).compareTo(rightValue) != 0);<NEW_LINE>} else {<NEW_LINE>result = Boolean.valueOf(!leftValue.equals(rightValue));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (logger.isTraceEnabled()) {<NEW_LINE>logger.trace("[THYMELEAF][{}] Evaluating NOT EQUALS expression: \"{}\". Left is \"{}\", right is \"{}\". Result is \"{}\"", new Object[] { TemplateEngine.threadIndex(), expression.getStringRepresentation(), leftValue, rightValue, result });<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
|
).execute(context, expContext);
|
520,498
|
public void onResponse(GetResponse getResponse) {<NEW_LINE>if (getResponse.isExists() == false) {<NEW_LINE>delegate.onFailure<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final long seqNo = getResponse.getSeqNo();<NEW_LINE>final long primaryTerm = getResponse.getPrimaryTerm();<NEW_LINE>BytesReference source = getResponse.getSourceAsBytesRef();<NEW_LINE>DatafeedConfig.Builder configBuilder;<NEW_LINE>try {<NEW_LINE>configBuilder = parseLenientlyFromSource(source);<NEW_LINE>} catch (IOException e) {<NEW_LINE>delegate.onFailure(new ElasticsearchParseException("Failed to parse datafeed config [" + datafeedId + "]", e));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>DatafeedConfig updatedConfig;<NEW_LINE>try {<NEW_LINE>updatedConfig = update.apply(configBuilder.build(), headers, clusterService.state());<NEW_LINE>} catch (Exception e) {<NEW_LINE>delegate.onFailure(e);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ActionListener<Boolean> validatedListener = ActionListener.wrap(ok -> indexUpdatedConfig(updatedConfig, seqNo, primaryTerm, ActionListener.wrap(indexResponse -> {<NEW_LINE>assert indexResponse.getResult() == DocWriteResponse.Result.UPDATED;<NEW_LINE>delegate.onResponse(updatedConfig);<NEW_LINE>}, delegate::onFailure)), delegate::onFailure);<NEW_LINE>validator.accept(updatedConfig, validatedListener);<NEW_LINE>}
|
(ExceptionsHelper.missingDatafeedException(datafeedId));
|
931,979
|
public void paintComponent(Graphics g) {<NEW_LINE>// do the superclass behavior first<NEW_LINE>super.paintComponent(g);<NEW_LINE>Graphics2D g2 = (Graphics2D) g;<NEW_LINE>BufferedImage bgImage = ImageLoader.getImage(ImageLoader.MAIN_WINDOW_BACKGROUND);<NEW_LINE>// paint the image<NEW_LINE>if (bgImage != null) {<NEW_LINE><MASK><NEW_LINE>boolean isTextureBackground = Boolean.parseBoolean(r.getSettingsString("impl.gui.IS_CONTACT_LIST_TEXTURE_BG_ENABLED"));<NEW_LINE>int width = getWidth(), height = getHeight();<NEW_LINE>if (isTextureBackground) {<NEW_LINE>Rectangle rect = new Rectangle(0, 0, bgImage.getWidth(null), bgImage.getHeight(null));<NEW_LINE>TexturePaint texture = new TexturePaint(bgImage, rect);<NEW_LINE>g2.setPaint(texture);<NEW_LINE>g2.fillRect(0, 0, width, height);<NEW_LINE>} else {<NEW_LINE>g.setColor(new Color(r.getColor("contactListBackground")));<NEW_LINE>// paint the background with the chosen color<NEW_LINE>g.fillRect(0, 0, width, height);<NEW_LINE>g2.drawImage(bgImage, width - bgImage.getWidth(), height - bgImage.getHeight(), this);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
ResourceManagementService r = GuiActivator.getResources();
|
1,416,115
|
public void processOpts() {<NEW_LINE>super.processOpts();<NEW_LINE>if (StringUtils.isEmpty(System.getenv("C_POST_PROCESS_FILE"))) {<NEW_LINE>LOGGER.info("Environment variable C_POST_PROCESS_FILE not defined so the C code may not be properly formatted by uncrustify (0.66 or later) or other code formatter. To define it, try `export C_POST_PROCESS_FILE=\"/usr/local/bin/uncrustify --no-backup\" && export UNCRUSTIFY_CONFIG=/path/to/uncrustify-rules.cfg` (Linux/Mac). Note: replace /path/to with the location of uncrustify-rules.cfg");<NEW_LINE>}<NEW_LINE>// make api and model doc path available in mustache template<NEW_LINE>additionalProperties.put("apiDocPath", apiDocPath);<NEW_LINE>additionalProperties.put("modelDocPath", modelDocPath);<NEW_LINE>// use constant model/api package (folder path)<NEW_LINE>setModelPackage("models");<NEW_LINE>setApiPackage("api");<NEW_LINE>// root folder<NEW_LINE>supportingFiles.add(new SupportingFile("CMakeLists.txt.mustache", "", "CMakeLists.txt"));<NEW_LINE>supportingFiles.add(new SupportingFile("Packing.cmake.mustache", "", "Packing.cmake"));<NEW_LINE>supportingFiles.add(new SupportingFile("libcurl.licence.mustache", "", "libcurl.licence"));<NEW_LINE>supportingFiles.add(new SupportingFile("uncrustify-rules.cfg.mustache", "", "uncrustify-rules.cfg"));<NEW_LINE>supportingFiles.add(new SupportingFile("README.md.mustache", "", "README.md"));<NEW_LINE>// src folder<NEW_LINE>supportingFiles.add(new SupportingFile("apiClient.c.mustache", "src", "apiClient.c"));<NEW_LINE>supportingFiles.add(new SupportingFile("apiKey.c.mustache", "src", "apiKey.c"));<NEW_LINE>supportingFiles.add(new SupportingFile<MASK><NEW_LINE>supportingFiles.add(new SupportingFile("binary.c.mustache", "src", "binary.c"));<NEW_LINE>// include folder<NEW_LINE>supportingFiles.add(new SupportingFile("apiClient.h.mustache", "include", "apiClient.h"));<NEW_LINE>supportingFiles.add(new SupportingFile("keyValuePair.h.mustache", "include", "keyValuePair.h"));<NEW_LINE>supportingFiles.add(new SupportingFile("list.h.mustache", "include", "list.h"));<NEW_LINE>supportingFiles.add(new SupportingFile("binary.h.mustache", "include", "binary.h"));<NEW_LINE>// external folder<NEW_LINE>supportingFiles.add(new SupportingFile("cJSON.licence.mustache", "external", "cJSON.licence"));<NEW_LINE>supportingFiles.add(new SupportingFile("cJSON.c.mustache", "external", "cJSON.c"));<NEW_LINE>supportingFiles.add(new SupportingFile("cJSON.h.mustache", "external", "cJSON.h"));<NEW_LINE>// Object files in model folder<NEW_LINE>supportingFiles.add(new SupportingFile("object-body.mustache", "model", "object.c"));<NEW_LINE>supportingFiles.add(new SupportingFile("object-header.mustache", "model", "object.h"));<NEW_LINE>}
|
("list.c.mustache", "src", "list.c"));
|
1,456,378
|
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {<NEW_LINE>View view = inflater.inflate(R.layout.date_picker_dialog, container, false);<NEW_LINE>Button doneButton = (Button) view.findViewById(R.id.done_button);<NEW_LINE>Button cancelButton = (Button) view.findViewById(R.id.cancel_button);<NEW_LINE>cancelButton.setTextColor(mTextColor);<NEW_LINE>cancelButton.setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View view) {<NEW_LINE>dismiss();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>doneButton.setTextColor(mTextColor);<NEW_LINE>doneButton.setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View view) {<NEW_LINE>for (DatePickerDialogHandler handler : mDatePickerDialogHandlers) {<NEW_LINE>handler.onDialogDateSet(mReference, mPicker.getYear(), mPicker.getMonthOfYear(), mPicker.getDayOfMonth());<NEW_LINE>}<NEW_LINE>final Activity activity = getActivity();<NEW_LINE>final Fragment fragment = getTargetFragment();<NEW_LINE>if (activity instanceof DatePickerDialogHandler) {<NEW_LINE>final DatePickerDialogHandler act = (DatePickerDialogHandler) activity;<NEW_LINE>act.onDialogDateSet(mReference, mPicker.getYear(), mPicker.getMonthOfYear(), mPicker.getDayOfMonth());<NEW_LINE>} else if (fragment instanceof DatePickerDialogHandler) {<NEW_LINE>final DatePickerDialogHandler frag = (DatePickerDialogHandler) fragment;<NEW_LINE>frag.onDialogDateSet(mReference, mPicker.getYear(), mPicker.getMonthOfYear(<MASK><NEW_LINE>}<NEW_LINE>dismiss();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>mPicker = (DatePicker) view.findViewById(R.id.date_picker);<NEW_LINE>mPicker.setSetButton(doneButton);<NEW_LINE>mPicker.setDate(mYear, mMonthOfYear, mDayOfMonth);<NEW_LINE>mPicker.setYearOptional(mYearOptional);<NEW_LINE>mPicker.setTheme(mTheme);<NEW_LINE>getDialog().getWindow().setBackgroundDrawableResource(mDialogBackgroundResId);<NEW_LINE>return view;<NEW_LINE>}
|
), mPicker.getDayOfMonth());
|
1,692,353
|
public void simpleInitApp() {<NEW_LINE>loadHintText();<NEW_LINE>setupKeys();<NEW_LINE>// WIREFRAME material<NEW_LINE>matWire = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");<NEW_LINE>matWire.getAdditionalRenderState().setWireframe(true);<NEW_LINE>matWire.setColor("Color", ColorRGBA.Green);<NEW_LINE>terrain = new TiledTerrain();<NEW_LINE>rootNode.attachChild(terrain);<NEW_LINE>DirectionalLight light = new DirectionalLight();<NEW_LINE>light.setDirection((new Vector3f(-0.5f, -1f, -0.5f)).normalize());<NEW_LINE>rootNode.addLight(light);<NEW_LINE>AmbientLight ambLight = new AmbientLight();<NEW_LINE>ambLight.setColor(new ColorRGBA(1f, 1f, 0.8f, 0.2f));<NEW_LINE>rootNode.addLight(ambLight);<NEW_LINE>cam.setLocation(new Vector3f(0, 256, 0));<NEW_LINE>cam.lookAtDirection(new Vector3f(0, -1, -1).normalizeLocal(), Vector3f.UNIT_Y);<NEW_LINE>Sphere s = new Sphere(12, 12, 3);<NEW_LINE>Geometry g = new Geometry("marker");<NEW_LINE>g.setMesh(s);<NEW_LINE>Material mat <MASK><NEW_LINE>mat.setColor("Color", ColorRGBA.Red);<NEW_LINE>g.setMaterial(mat);<NEW_LINE>g.setLocalTranslation(0, -100, 0);<NEW_LINE>rootNode.attachChild(g);<NEW_LINE>Geometry g2 = new Geometry("marker");<NEW_LINE>g2.setMesh(s);<NEW_LINE>mat.setColor("Color", ColorRGBA.Red);<NEW_LINE>g2.setMaterial(mat);<NEW_LINE>g2.setLocalTranslation(10, -100, 0);<NEW_LINE>rootNode.attachChild(g2);<NEW_LINE>Geometry g3 = new Geometry("marker");<NEW_LINE>g3.setMesh(s);<NEW_LINE>mat.setColor("Color", ColorRGBA.Red);<NEW_LINE>g3.setMaterial(mat);<NEW_LINE>g3.setLocalTranslation(0, -100, 10);<NEW_LINE>rootNode.attachChild(g3);<NEW_LINE>}
|
= new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
|
116,375
|
public void addHUDStrings(List<Component> list, Player player, ItemStack stack, EquipmentSlot slotType) {<NEW_LINE>if (slotType == getSlot()) {<NEW_LINE>ItemScubaTank scubaTank = (ItemScubaTank) stack.getItem();<NEW_LINE>list.add(MekanismLang.SCUBA_TANK_MODE.translateColored(EnumColor.DARK_GRAY, OnOff.of(scubaTank.getFlowing(stack), true)));<NEW_LINE>GasStack stored = GasStack.EMPTY;<NEW_LINE>Optional<IGasHandler> capability = stack.getCapability(<MASK><NEW_LINE>if (capability.isPresent()) {<NEW_LINE>IGasHandler gasHandlerItem = capability.get();<NEW_LINE>if (gasHandlerItem.getTanks() > 0) {<NEW_LINE>stored = gasHandlerItem.getChemicalInTank(0);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>list.add(MekanismLang.GENERIC_STORED.translateColored(EnumColor.DARK_GRAY, MekanismGases.OXYGEN, EnumColor.ORANGE, stored.getAmount()));<NEW_LINE>}<NEW_LINE>}
|
Capabilities.GAS_HANDLER_CAPABILITY).resolve();
|
1,536,450
|
final GetUserPolicyResult executeGetUserPolicy(GetUserPolicyRequest getUserPolicyRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getUserPolicyRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetUserPolicyRequest> request = null;<NEW_LINE>Response<GetUserPolicyResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetUserPolicyRequestMarshaller().marshall(super.beforeMarshalling(getUserPolicyRequest));<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, "IAM");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetUserPolicy");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<GetUserPolicyResult> responseHandler = new StaxResponseHandler<<MASK><NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
|
GetUserPolicyResult>(new GetUserPolicyResultStaxUnmarshaller());
|
1,124,094
|
public void runAsSystemUser() throws SiteWhereException {<NEW_LINE>Period missingInterval;<NEW_LINE>try {<NEW_LINE>missingInterval = Period.parse(getPresenceMissingInterval(), ISOPeriodFormat.standard());<NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>missingInterval = PERIOD_FORMATTER.parsePeriod(getPresenceMissingInterval());<NEW_LINE>}<NEW_LINE>int missingIntervalSecs = missingInterval.toStandardSeconds().getSeconds();<NEW_LINE>Period checkInterval;<NEW_LINE>try {<NEW_LINE>checkInterval = Period.parse(getPresenceCheckInterval(), ISOPeriodFormat.standard());<NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>checkInterval = PERIOD_FORMATTER.parsePeriod(getPresenceCheckInterval());<NEW_LINE>}<NEW_LINE>int checkIntervalSecs = checkInterval.toStandardSeconds().getSeconds();<NEW_LINE>getLogger().info("Presence manager checking every " + PERIOD_FORMATTER.print(checkInterval) + " (" + checkIntervalSecs + " seconds) " + "for devices with last interaction date of more than " + PERIOD_FORMATTER.print(missingInterval) + " (" + missingIntervalSecs + " seconds) " + ".");<NEW_LINE>while (true) {<NEW_LINE>try {<NEW_LINE>// TODO: For performance/memory consumption, this should be done in batches.<NEW_LINE>Date endDate = new Date(System.currentTimeMillis() - (missingIntervalSecs * 1000));<NEW_LINE>DeviceStateSearchCriteria criteria = new DeviceStateSearchCriteria(1, 0);<NEW_LINE>criteria.setLastInteractionDateBefore(endDate);<NEW_LINE>ISearchResults<? extends IDeviceState> missing = getDeviceStateManagement().searchDeviceStates(criteria);<NEW_LINE>if (missing.getNumResults() > 0) {<NEW_LINE>getLogger().info("Presence manager detected " + missing.getNumResults() + " non-present devices.");<NEW_LINE>} else {<NEW_LINE>getLogger().info("No non-present devices detected.");<NEW_LINE>}<NEW_LINE>for (IDeviceState deviceState : missing.getResults()) {<NEW_LINE>if (sendPresenceMissing(deviceState)) {<NEW_LINE>try {<NEW_LINE>DeviceStateCreateRequest update = new DeviceStateCreateRequest();<NEW_LINE>update.<MASK><NEW_LINE>update.setDeviceAssignmentId(deviceState.getDeviceAssignmentId());<NEW_LINE>update.setPresenceMissingDate(new Date());<NEW_LINE>update.setLastInteractionDate(deviceState.getLastInteractionDate());<NEW_LINE>getDeviceStateManagement().updateDeviceState(deviceState.getId(), update);<NEW_LINE>} catch (SiteWhereException e) {<NEW_LINE>getLogger().warn("Unable to update presence missing date.", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (SiteWhereException e) {<NEW_LINE>getLogger().error("Error processing presence query.", e);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Thread.sleep(checkIntervalSecs * 1000);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>getLogger().info("Presence check thread shut down.");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
setDeviceId(deviceState.getDeviceId());
|
1,295,172
|
private void fingerprintNode(DiagnosingMessageDigestDecorator md, Node node, FingerprintingConfig config) {<NEW_LINE>switch(config.getStrategy()) {<NEW_LINE>case EAGER:<NEW_LINE>StreamSupport.stream(node.getLabels().spliterator(), false).map(Label::name).sorted().map(String::getBytes).forEach(md::update);<NEW_LINE>break;<NEW_LINE>case LAZY:<NEW_LINE>StreamSupport.stream(node.getLabels().spliterator(), false).map(Label::name).filter(name -> config.getAllLabels().contains(name)).sorted().map(String::getBytes).forEach(md::update);<NEW_LINE>}<NEW_LINE>final List<String> keysToRetain = new ArrayList<>(config.getAllNodesAllowList());<NEW_LINE>keysToRetain.addAll(StreamSupport.stream(node.getLabels().spliterator(), false).map(Label::name).flatMap(label -> config.getNodeAllowMap().getOrDefault(label, Collections.emptyList()).stream()).collect(Collectors.toSet()));<NEW_LINE>final List<String> keysToRemove = new ArrayList<<MASK><NEW_LINE>keysToRemove.addAll(StreamSupport.stream(node.getLabels().spliterator(), false).map(Label::name).flatMap(label -> config.getNodeDisallowMap().getOrDefault(label, Collections.emptyList()).stream()).collect(Collectors.toSet()));<NEW_LINE>// just to backwards compatibility remove it<NEW_LINE>keysToRemove.addAll(config.getMapDisallowList());<NEW_LINE>final Map<String, Object> allProperties = getEntityProperties(node, config, keysToRetain, keysToRemove);<NEW_LINE>fingerprint(md, allProperties, config);<NEW_LINE>}
|
>(config.getAllNodesDisallowList());
|
1,826,428
|
public boolean storeSharedClass(String partition, Class<?> clazz, int foundAtIndex) {<NEW_LINE>if (!canStore) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (clazz == null) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>printVerboseError(Msg.getString("K05a7"));<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>ClassLoader actualLoader = getClassLoader();<NEW_LINE>if (!validateClassLoader(actualLoader, clazz)) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>printVerboseError(Msg.getString("K05a6"));<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (foundAtIndex >= urlCount) {<NEW_LINE>if (!validateURL(urls[foundAtIndex], true)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>validated[foundAtIndex] = true;<NEW_LINE>}<NEW_LINE>if (confirmedCount <= foundAtIndex) {<NEW_LINE>incConfirmedCount = true;<NEW_LINE>}<NEW_LINE>storeRet = storeSharedClassImpl2(this.id, partition, actualLoader, this.urls, this.urlCount, foundAtIndex, clazz, nativeFlags);<NEW_LINE>} finally {<NEW_LINE>urlcpReadWriteLock<MASK><NEW_LINE>}<NEW_LINE>if (incConfirmedCount) {<NEW_LINE>increaseConfirmedCount(foundAtIndex + 1);<NEW_LINE>}<NEW_LINE>return storeRet;<NEW_LINE>}
|
.readLock().unlock();
|
1,667,273
|
private PrintElement createStringElement(final String content, final int AD_PrintColor_ID, final int AD_PrintFont_ID, final int maxWidth, final int maxHeight, final boolean isHeightOneLine, final String FieldAlignmentType, final boolean isTranslated) {<NEW_LINE>if (content == null || content.length() == 0)<NEW_LINE>return null;<NEW_LINE>// Color / Font<NEW_LINE>// default<NEW_LINE>Color color = getColor();<NEW_LINE>if (AD_PrintColor_ID != 0 && m_printColor.get_ID() != AD_PrintColor_ID) {<NEW_LINE>MPrintColor c = MPrintColor.get(getCtx(), AD_PrintColor_ID);<NEW_LINE>if (c.getColor() != null)<NEW_LINE>color = c.getColor();<NEW_LINE>}<NEW_LINE>// default<NEW_LINE>Font font = m_printFont.getFont();<NEW_LINE>if (AD_PrintFont_ID != 0 && m_printFont.get_ID() != AD_PrintFont_ID) {<NEW_LINE>MPrintFont <MASK><NEW_LINE>if (f.getFont() != null)<NEW_LINE>font = f.getFont();<NEW_LINE>}<NEW_LINE>PrintElement e = new StringElement(content, font, color, null, isTranslated);<NEW_LINE>e.layout(maxWidth, maxHeight, isHeightOneLine, FieldAlignmentType);<NEW_LINE>return e;<NEW_LINE>}
|
f = MPrintFont.get(AD_PrintFont_ID);
|
849,853
|
public void resultReceived(SearchInstance search, SearchResult result) {<NEW_LINE>if (min_seeds > 0) {<NEW_LINE>Number seeds = ((Number) result.getProperty(SearchResult.PR_SEED_COUNT));<NEW_LINE>if (seeds != null && seeds.intValue() < min_seeds) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (min_leechers > 0) {<NEW_LINE>Number leechers = ((Number) result.getProperty(SearchResult.PR_LEECHER_COUNT));<NEW_LINE>if (leechers != null && leechers.intValue() < min_leechers) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (max_age_secs > 0) {<NEW_LINE>Date pub_date = (Date) <MASK><NEW_LINE>if (pub_date == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>long age_secs = (SystemTime.getCurrentTime() - pub_date.getTime()) / 1000;<NEW_LINE>if (age_secs > max_age_secs) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>observer.resultReceived(search, result);<NEW_LINE>logSearch("results=" + num_results.incrementAndGet());<NEW_LINE>}
|
result.getProperty(SearchResult.PR_PUB_DATE);
|
1,638,175
|
private void changeStatus(AnalyzerStatus newStatus) {<NEW_LINE>boolean resetAnalyzingStatus = analyzerStatus != null && analyzerStatus.isTextStatus() && analyzerStatus.getAnalyzingType() == AnalyzingType.COMPLETE;<NEW_LINE>analyzerStatus = newStatus;<NEW_LINE>// smallIconLabel.setIcon(analyzerStatus.getIcon());<NEW_LINE>if (showToolbar != analyzerStatus.getController().enableToolbar()) {<NEW_LINE>showToolbar = EditorSettingsExternalizable.getInstance().isShowInspectionWidget() && analyzerStatus<MASK><NEW_LINE>updateTrafficLightVisibility();<NEW_LINE>}<NEW_LINE>boolean analyzing = analyzerStatus.getAnalyzingType() != AnalyzingType.COMPLETE;<NEW_LINE>hasAnalyzed = !resetAnalyzingStatus && (hasAnalyzed || (isAnalyzing && !analyzing));<NEW_LINE>isAnalyzing = analyzing;<NEW_LINE>if (analyzerStatus.getAnalyzingType() != AnalyzingType.EMPTY) {<NEW_LINE>showNavigation = analyzerStatus.isShowNavigation();<NEW_LINE>}<NEW_LINE>myPopupManager.updateVisiblePopup();<NEW_LINE>ActivityTracker.getInstance().inc();<NEW_LINE>}
|
.getController().enableToolbar();
|
1,224,530
|
public void run(RegressionEnvironment env) {<NEW_LINE>String stmtText = "@name('s0') select s1.intBoxed as v1, s2.longBoxed as v2, s3.doubleBoxed as v3 from " + "SupportBean(theString='A')#length(1000000) s1 " <MASK><NEW_LINE>env.compileDeployAddListenerMileZero(stmtText, "s0");<NEW_LINE>// preload<NEW_LINE>for (int i = 0; i < 10000; i++) {<NEW_LINE>sendEvent(env, "A", i, 0, 0);<NEW_LINE>sendEvent(env, "C", 0, 0, i);<NEW_LINE>}<NEW_LINE>env.listenerReset("s0");<NEW_LINE>long startTime = System.currentTimeMillis();<NEW_LINE>for (int i = 0; i < 5000; i++) {<NEW_LINE>int index = 5000 + i % 1000;<NEW_LINE>sendEvent(env, "B", 0, index, 0);<NEW_LINE>env.assertEventNew("s0", theEvent -> {<NEW_LINE>assertEquals(index, theEvent.get("v1"));<NEW_LINE>assertEquals((long) index, theEvent.get("v2"));<NEW_LINE>assertEquals((double) index, theEvent.get("v3"));<NEW_LINE>});<NEW_LINE>}<NEW_LINE>long endTime = System.currentTimeMillis();<NEW_LINE>long delta = endTime - startTime;<NEW_LINE>assertTrue("Failed perf test, delta=" + delta, delta < 1500);<NEW_LINE>env.undeployAll();<NEW_LINE>}
|
+ " left outer join " + "SupportBean(theString='B')#length(1000000) s2 on s1.intBoxed=s2.longBoxed " + " left outer join " + "SupportBean(theString='C')#length(1000000) s3 on s1.intBoxed=s3.doubleBoxed";
|
1,695,957
|
private String checkAcs(AuthnRequest request, SamlServiceProvider sp, Map<String, Object> authnState) {<NEW_LINE>final String acs = request.getAssertionConsumerServiceURL();<NEW_LINE>if (Strings.hasText(acs) == false) {<NEW_LINE>final String message = request.getAssertionConsumerServiceIndex() == null ? "SAML authentication does not contain an AssertionConsumerService URL" : "SAML authentication does not contain an AssertionConsumerService URL. It contains an Assertion Consumer Service Index " + "but this IDP doesn't support multiple AssertionConsumerService URLs.";<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>if (acs.equals(sp.getAssertionConsumerService().toString()) == false) {<NEW_LINE>throw new ElasticsearchSecurityException("The registered ACS URL for this Service Provider is [{}] but the authentication " + "request contained [{}]", RestStatus.BAD_REQUEST, sp.getAssertionConsumerService(), acs);<NEW_LINE>}<NEW_LINE>return acs;<NEW_LINE>}
|
ElasticsearchSecurityException(message, RestStatus.BAD_REQUEST);
|
1,427,348
|
public Boolean delete(Integer id, String operator) {<NEW_LINE>LOGGER.info("begin to delete sink by id={}", id);<NEW_LINE>Preconditions.checkNotNull(id, ErrorCodeEnum.ID_IS_EMPTY.getMessage());<NEW_LINE>StreamSinkEntity entity = sinkMapper.selectByPrimaryKey(id);<NEW_LINE>Preconditions.checkNotNull(entity, ErrorCodeEnum.SINK_INFO_NOT_FOUND.getMessage());<NEW_LINE>groupCheckService.checkGroupStatus(entity.getInlongGroupId(), operator);<NEW_LINE>entity.setPreviousStatus(entity.getStatus());<NEW_LINE>entity.setStatus(InlongConstants.DELETED_STATUS);<NEW_LINE>entity.setIsDeleted(id);<NEW_LINE>entity.setModifier(operator);<NEW_LINE>entity<MASK><NEW_LINE>int rowCount = sinkMapper.updateByPrimaryKeySelective(entity);<NEW_LINE>if (rowCount != InlongConstants.AFFECTED_ONE_ROW) {<NEW_LINE>LOGGER.error("sink has already updated with groupId={}, streamId={}, name={}, curVersion={}", entity.getInlongGroupId(), entity.getInlongStreamId(), entity.getSinkName(), entity.getVersion());<NEW_LINE>throw new BusinessException(ErrorCodeEnum.CONFIG_EXPIRED);<NEW_LINE>}<NEW_LINE>sinkFieldMapper.logicDeleteAll(id);<NEW_LINE>LOGGER.info("success to delete sink info: {}", entity);<NEW_LINE>return true;<NEW_LINE>}
|
.setModifyTime(new Date());
|
720,741
|
public void deserialize(DataInputStream input) throws IOException, ClassNotFoundException {<NEW_LINE>useNewAPI = input.readBoolean();<NEW_LINE>int size = input.readInt();<NEW_LINE>int locSize = input.readInt();<NEW_LINE>locations = new String[locSize];<NEW_LINE>for (int i = 0; i < locSize; i++) {<NEW_LINE>locations[i] = input.readUTF();<NEW_LINE>}<NEW_LINE>if (useNewAPI) {<NEW_LINE>if (size > 0) {<NEW_LINE>String splitClass = input.readUTF();<NEW_LINE>splitsNewAPI = new ArrayList<org.apache.hadoop.mapreduce.InputSplit>(size);<NEW_LINE>SerializationFactory factory = new SerializationFactory(new Configuration());<NEW_LINE>Deserializer<? extends org.apache.hadoop.mapreduce.InputSplit> deSerializer = factory.getDeserializer((Class<? extends org.apache.hadoop.mapreduce.InputSplit>) Class.forName(splitClass));<NEW_LINE>deSerializer.open(input);<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>splitsNewAPI.add(deSerializer.deserialize(null));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (size > 0) {<NEW_LINE>String splitClass = input.readUTF();<NEW_LINE>splitsOldAPI = new ArrayList<org.apache.hadoop.mapred.InputSplit>(size);<NEW_LINE>SerializationFactory factory = new SerializationFactory(new Configuration());<NEW_LINE>Deserializer<? extends org.apache.hadoop.mapred.InputSplit> deSerializer = factory.getDeserializer((Class<? extends org.apache.hadoop.mapred.InputSplit><MASK><NEW_LINE>deSerializer.open(input);<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>splitsOldAPI.add(deSerializer.deserialize(null));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
) Class.forName(splitClass));
|
460,595
|
private static Map<TokenRange, Long> describeSplits(CassandraSessionPool.Session session, String keyspace, String table, long splitPartitions, long splitSize, TokenRange tokenRange) {<NEW_LINE>String query = String.format("SELECT mean_partition_size, partitions_count FROM %s.%s " + "WHERE keyspace_name = ? AND table_name = ? AND " + "range_start = ? AND range_end = ?", SchemaConstants.SYSTEM_KEYSPACE_NAME, SystemKeyspace.SIZE_ESTIMATES);<NEW_LINE>ResultSet resultSet = session.execute(query, keyspace, table, tokenRange.getStart().toString(), tokenRange.getEnd().toString());<NEW_LINE>Row row = resultSet.one();<NEW_LINE>long meanPartitionSize = 0L;<NEW_LINE>long partitionsCount = 0L;<NEW_LINE>long splitCount = 0L;<NEW_LINE>if (row != null) {<NEW_LINE>meanPartitionSize = row.getLong("mean_partition_size");<NEW_LINE>partitionsCount = row.getLong("partitions_count");<NEW_LINE>assert splitSize <= 0 || splitSize >= MIN_SHARD_SIZE;<NEW_LINE>splitCount = splitSize > 0 ? (meanPartitionSize * partitionsCount / splitSize) : (partitionsCount / splitPartitions);<NEW_LINE>}<NEW_LINE>if (splitCount == 0) {<NEW_LINE>return ImmutableMap.of(tokenRange, (long) 128);<NEW_LINE>}<NEW_LINE>List<TokenRange> ranges = tokenRange.splitEvenly((int) splitCount);<NEW_LINE>Map<TokenRange, Long> rangesWithLength = new HashMap<>();<NEW_LINE>for (TokenRange range : ranges) {<NEW_LINE>// Add a sub-range (with its partitions count per sub-range)<NEW_LINE>rangesWithLength.<MASK><NEW_LINE>}<NEW_LINE>return rangesWithLength;<NEW_LINE>}
|
put(range, partitionsCount / splitCount);
|
629,157
|
static byte[] encodeRequest(String host, int port, String reqUri, String path) throws IOException {<NEW_LINE>ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();<NEW_LINE>try (DataOutputStream packet = new DataOutputStream(byteArrayOutputStream)) {<NEW_LINE>// prefix_code<NEW_LINE>packet.write(JK_AJP13_FORWARD_REQUEST_PREFIX);<NEW_LINE>// method<NEW_LINE>packet.write(GET_METHOD);<NEW_LINE>// protocol<NEW_LINE>encodeString(packet, "HTTP/1.1");<NEW_LINE>// req_uri<NEW_LINE>encodeString(packet, reqUri);<NEW_LINE>// remote_addr<NEW_LINE>encodeString(packet, host);<NEW_LINE>// remote_host<NEW_LINE>encodeString(packet, null);<NEW_LINE>// server_name<NEW_LINE>encodeString(packet, host);<NEW_LINE>// server_port<NEW_LINE>packet.writeShort(port);<NEW_LINE>// is_ssl<NEW_LINE>packet.writeByte(0);<NEW_LINE>// num_headers and request_headers<NEW_LINE>encodeRequestHeaders(packet, ImmutableMap.<String, String>builder().put("accept", "text/htmlapplication/xhtml+xmlapplication/xml;q=0.9image/webp*/*;q=0.8").put("connection", "keep-alive").put("content-length", "0").put("host", host).put("user-agent", "Mozilla/5.0 (X11; Linux x86_64; rv,46.0) Gecko/20100101 Firefox/46.0").put("Accept-Encoding", "gzip deflate sdch").put("Accept-Language", "en-USen;q=0.5").put("Upgrade-Insecure-Requests", "1").put("Cache-Control", "max-age=0").build());<NEW_LINE>// attributes<NEW_LINE>encodeRequestAttributeAttribute(packet, "javax.servlet.include.request_uri", "/");<NEW_LINE>encodeRequestAttributeAttribute(packet, "javax.servlet.include.path_info", path);<NEW_LINE><MASK><NEW_LINE>// request_terminator<NEW_LINE>packet.writeByte(REQUEST_TERMINATOR);<NEW_LINE>}<NEW_LINE>return byteArrayOutputStream.toByteArray();<NEW_LINE>}
|
encodeRequestAttributeAttribute(packet, "javax.servlet.include.servlet_path", "/");
|
1,371,699
|
public DenseVector predict(SGDVector example) {<NEW_LINE>// Linear part of the prediction<NEW_LINE>DenseVector pred = weightMatrix.leftMultiply(example);<NEW_LINE>// Add in the label biases<NEW_LINE>pred.intersectAndAddInPlace(biasVector);<NEW_LINE>// Compute the contribution of the feature factors<NEW_LINE>DenseVector factorizedPred = new DenseVector(biasVector.size());<NEW_LINE>for (int i = 2; i < weights.length; i++) {<NEW_LINE>DenseMatrix curMatrix = (DenseMatrix) weights[i];<NEW_LINE>double curValue = 0.0;<NEW_LINE>for (int k = 0; k < numFactors; k++) {<NEW_LINE>double sumOfSquares = 0.0;<NEW_LINE>double sum = 0.0;<NEW_LINE>for (VectorTuple v : example) {<NEW_LINE>double curWeight = curMatrix.get(k, v.index);<NEW_LINE><MASK><NEW_LINE>sum += value;<NEW_LINE>sumOfSquares += value * value;<NEW_LINE>}<NEW_LINE>curValue += (sum * sum) - sumOfSquares;<NEW_LINE>}<NEW_LINE>curValue = curValue / 2;<NEW_LINE>factorizedPred.set(i - 2, curValue);<NEW_LINE>}<NEW_LINE>// Add factorized portion<NEW_LINE>pred.intersectAndAddInPlace(factorizedPred);<NEW_LINE>return pred;<NEW_LINE>}
|
double value = curWeight * v.value;
|
1,177,382
|
private Token includeFiltered() {<NEW_LINE>Matcher matcher = Pattern.compile("^include:([\\w\\-]+)([\\( ])").matcher(scanner.getInput());<NEW_LINE>if (matcher.find(0) && matcher.groupCount() > 1) {<NEW_LINE>this.consume(matcher.end() - 1);<NEW_LINE>String filter = matcher.group(1);<NEW_LINE>Token attrs = matcher.group(2).equals("(") <MASK><NEW_LINE>if (!(matcher.group(2).equals(" ") || scanner.getInput().charAt(0) == ' ')) {<NEW_LINE>throw new JadeLexerException("expected space after include:filter but got " + String.valueOf(scanner.getInput().charAt(0)), filename, getLineno(), templateLoader);<NEW_LINE>}<NEW_LINE>matcher = Pattern.compile("^ *([^\\n]+)").matcher(scanner.getInput());<NEW_LINE>if (!(matcher.find(0) && matcher.groupCount() > 0) || matcher.group(1).trim().equals("")) {<NEW_LINE>throw new JadeLexerException("missing path for include:filter", filename, getLineno(), templateLoader);<NEW_LINE>}<NEW_LINE>this.consume(matcher.end());<NEW_LINE>String path = matcher.group(1);<NEW_LINE>Include tok = new Include(path, lineno);<NEW_LINE>tok.setFilter(filter);<NEW_LINE>tok.setAttrs(attrs);<NEW_LINE>return tok;<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
|
? this.attrs() : null;
|
1,421,244
|
protected String toSvgString(QrCode qr, int border, String lightColor, String darkColor) {<NEW_LINE>Objects.requireNonNull(qr);<NEW_LINE>Objects.requireNonNull(lightColor);<NEW_LINE>Objects.requireNonNull(darkColor);<NEW_LINE>if (border < 0) {<NEW_LINE>throw new IllegalArgumentException("Border must be non-negative");<NEW_LINE>}<NEW_LINE>long brd = border;<NEW_LINE>StringBuilder sb = new StringBuilder().append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n").append("<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n").append(String.format("<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" viewBox=\"0 0 %1$d %1$d\" stroke=\"none\">\n", qr.size + brd * 2)).append("\t<rect width=\"100%\" height=\"100%\" fill=\"" + lightColor + "\"/>\n").append("\t<path d=\"");<NEW_LINE>for (int y = 0; y < qr.size; y++) {<NEW_LINE>for (int x = 0; x < qr.size; x++) {<NEW_LINE>if (qr.getModule(x, y)) {<NEW_LINE>if (x != 0 || y != 0) {<NEW_LINE>sb.append(" ");<NEW_LINE>}<NEW_LINE>sb.append(String.format("M%d,%dh1v1h-1z", x + brd, y + brd));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return sb.append("\" fill=\"" + darkColor + "\"/>\n").<MASK><NEW_LINE>}
|
append("</svg>\n").toString();
|
1,000,948
|
protected AnnotationNode annotation(AST annotationNode) {<NEW_LINE>annotationBeingDef = true;<NEW_LINE>AST node = annotationNode.getFirstChild();<NEW_LINE>AnnotationNode annotatedNode = new AnnotationNode(makeType(annotationNode));<NEW_LINE>// GRECLIPSE end<NEW_LINE>configureAST(annotatedNode, annotationNode);<NEW_LINE>// GRECLIPSE add<NEW_LINE>int start = annotatedNode.getStart();<NEW_LINE>int until = annotatedNode.getEnd();<NEW_LINE>// check for trailing whitespace<NEW_LINE>if (getController() != null) {<NEW_LINE>char[] sourceChars = getController().readSourceRange(start, until - start);<NEW_LINE>if (sourceChars != null) {<NEW_LINE>int i = (sourceChars.length - 1);<NEW_LINE>while (i >= 0 && Character.isWhitespace(sourceChars[i])) {<NEW_LINE>i -= 1;<NEW_LINE>until -= 1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>annotatedNode.setEnd(until);<NEW_LINE>int[] row_col = locations.getRowCol(until);<NEW_LINE>annotatedNode<MASK><NEW_LINE>annotatedNode.setLastColumnNumber(row_col[1]);<NEW_LINE>// GRECLIPSE end<NEW_LINE>while (true) {<NEW_LINE>node = node.getNextSibling();<NEW_LINE>if (isType(ANNOTATION_MEMBER_VALUE_PAIR, node)) {<NEW_LINE>AST memberNode = node.getFirstChild();<NEW_LINE>String param = identifier(memberNode);<NEW_LINE>Expression expression = expression(memberNode.getNextSibling());<NEW_LINE>if (annotatedNode.getMember(param) != null) {<NEW_LINE>throw new ASTRuntimeException(memberNode, "Annotation member '" + param + "' has already been associated with a value");<NEW_LINE>}<NEW_LINE>annotatedNode.setMember(param, expression);<NEW_LINE>} else {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>annotationBeingDef = false;<NEW_LINE>return annotatedNode;<NEW_LINE>}
|
.setLastLineNumber(row_col[0]);
|
772,626
|
private static HashMap<SwegonVentilationCommandType, Integer> parseMessage71(byte[] data) {<NEW_LINE>HashMap<SwegonVentilationCommandType, Integer> map = new HashMap<SwegonVentilationCommandType, Integer>();<NEW_LINE>int outdoorTemp = data[0];<NEW_LINE>int supplyTemp = data[1];<NEW_LINE>int extractTemp = data[2];<NEW_LINE>int supplyTempHeated = data[3];<NEW_LINE>int t5 = data[4];<NEW_LINE>int t6 = data[5];<NEW_LINE>int t7 = data[6];<NEW_LINE>int exhaustTemp = data[7];<NEW_LINE>int co2 = data[8];<NEW_LINE>int rh = data[9];<NEW_LINE>int supplyFanSpeed = (data[10] & 0xFF) * 10;<NEW_LINE>int extractFanSpeed = (data[11] & 0xFF) * 10;<NEW_LINE>int efficiency = data[12];<NEW_LINE>map.put(SwegonVentilationCommandType.T1, outdoorTemp);<NEW_LINE>map.put(SwegonVentilationCommandType.OUTDOOR_TEMP, outdoorTemp);<NEW_LINE>map.put(SwegonVentilationCommandType.T2, supplyTemp);<NEW_LINE>map.put(SwegonVentilationCommandType.SUPPLY_TEMP, supplyTemp);<NEW_LINE>map.put(SwegonVentilationCommandType.T3, extractTemp);<NEW_LINE>map.put(SwegonVentilationCommandType.EXTRACT_TEMP, extractTemp);<NEW_LINE>map.put(SwegonVentilationCommandType.T4, supplyTempHeated);<NEW_LINE>map.put(SwegonVentilationCommandType.SUPPLY_TEMP_HEATED, supplyTempHeated);<NEW_LINE>map.put(SwegonVentilationCommandType.T8, exhaustTemp);<NEW_LINE>map.put(SwegonVentilationCommandType.EXHAUST_TEMP, exhaustTemp);<NEW_LINE>map.put(SwegonVentilationCommandType.T5, t5);<NEW_LINE>map.put(SwegonVentilationCommandType.T6, t6);<NEW_LINE>map.put(SwegonVentilationCommandType.T7, t7);<NEW_LINE>map.put(SwegonVentilationCommandType.CO2, co2);<NEW_LINE>map.put(SwegonVentilationCommandType.HUMIDITY, rh);<NEW_LINE>map.put(SwegonVentilationCommandType.SUPPLY_AIR_FAN_SPEED, supplyFanSpeed);<NEW_LINE>map.put(SwegonVentilationCommandType.EXTRACT_AIR_FAN_SPEED, extractFanSpeed);<NEW_LINE>map.put(SwegonVentilationCommandType.EFFICIENCY, efficiency);<NEW_LINE>// Calculate supply efficiency<NEW_LINE>int calcEfficiency = (int) (((double) supplyTemp - (double) outdoorTemp) / ((double) extractTemp - (double) outdoorTemp) * 100);<NEW_LINE>map.put(SwegonVentilationCommandType.EFFICIENCY_SUPPLY, calcEfficiency);<NEW_LINE>// Calculate extract efficiency<NEW_LINE>calcEfficiency = (int) (((double) extractTemp - (double) exhaustTemp) / ((double) extractTemp - (double) outdoorTemp) * 100);<NEW_LINE>map.<MASK><NEW_LINE>return map;<NEW_LINE>}
|
put(SwegonVentilationCommandType.EFFICIENCY_EXTRACT, calcEfficiency);
|
1,271,591
|
public static void run(List<String> fileArgs, Options options) {<NEW_LINE>File preProcessorTempDir = null;<NEW_LINE>File strippedSourcesDir = null;<NEW_LINE>Parser parser = null;<NEW_LINE>try {<NEW_LINE>List<ProcessingContext> inputs = Lists.newArrayList();<NEW_LINE>GenerationBatch batch = new GenerationBatch(options);<NEW_LINE>batch.processFileArgs(fileArgs);<NEW_LINE>inputs.addAll(batch.getInputs());<NEW_LINE>if (ErrorUtil.errorCount() > 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>parser = createParser(options);<NEW_LINE>Parser.ProcessingResult processingResult = parser.processAnnotations(fileArgs, inputs);<NEW_LINE>List<ProcessingContext> generatedInputs = processingResult.getGeneratedSources();<NEW_LINE>// Ensure all generatedInputs are at end of input list.<NEW_LINE>inputs.addAll(generatedInputs);<NEW_LINE>preProcessorTempDir = processingResult.getSourceOutputDirectory();<NEW_LINE>if (ErrorUtil.errorCount() > 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (preProcessorTempDir != null) {<NEW_LINE>parser.addSourcepathEntry(preProcessorTempDir.getAbsolutePath());<NEW_LINE>}<NEW_LINE>InputFilePreprocessor inputFilePreprocessor = new InputFilePreprocessor(parser);<NEW_LINE>inputFilePreprocessor.processInputs(inputs);<NEW_LINE>if (ErrorUtil.errorCount() > 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>strippedSourcesDir = inputFilePreprocessor.getStrippedSourcesDir();<NEW_LINE>if (strippedSourcesDir != null) {<NEW_LINE>parser.prependSourcepathEntry(strippedSourcesDir.getPath());<NEW_LINE>}<NEW_LINE>options.getHeaderMap().loadMappings();<NEW_LINE>TranslationProcessor translationProcessor = new TranslationProcessor(parser, loadDeadCodeMap(options));<NEW_LINE>translationProcessor.processInputs(inputs);<NEW_LINE>if (ErrorUtil.errorCount() > 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>translationProcessor.postProcess();<NEW_LINE>options.getHeaderMap().printMappings();<NEW_LINE>} finally {<NEW_LINE>if (parser != null) {<NEW_LINE>try {<NEW_LINE>parser.close();<NEW_LINE>} catch (IOException e) {<NEW_LINE>ErrorUtil.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>Set<String> tempDirs = options.fileUtil().getTempDirs();<NEW_LINE>for (String dir : tempDirs) {<NEW_LINE>FileUtil.deleteTempDir(new File(dir));<NEW_LINE>}<NEW_LINE>FileUtil.deleteTempDir(preProcessorTempDir);<NEW_LINE>FileUtil.deleteTempDir(strippedSourcesDir);<NEW_LINE>}<NEW_LINE>}
|
error(e.getMessage());
|
762,490
|
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {<NEW_LINE>View v = inflater.inflate(R.layout.layout_drawlines, null);<NEW_LINE>btnRotateLeft = v.<MASK><NEW_LINE>btnRotateRight = v.findViewById(R.id.btnRotateRight);<NEW_LINE>btnRotateRight.setOnClickListener(this);<NEW_LINE>btnRotateLeft.setOnClickListener(this);<NEW_LINE>textViewCurrentLocation = v.findViewById(R.id.textViewCurrentLocation);<NEW_LINE>mMapView = v.findViewById(R.id.mapview);<NEW_LINE>mMapView.setMapListener(new MapListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean onScroll(ScrollEvent event) {<NEW_LINE>Log.i(IMapView.LOGTAG, System.currentTimeMillis() + " onScroll " + event.getX() + "," + event.getY());<NEW_LINE>// Toast.makeText(getActivity(), "onScroll", Toast.LENGTH_SHORT).show();<NEW_LINE>updateInfo();<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean onZoom(ZoomEvent event) {<NEW_LINE>Log.i(IMapView.LOGTAG, System.currentTimeMillis() + " onZoom " + event.getZoomLevel());<NEW_LINE>updateInfo();<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>RotationGestureOverlay mRotationGestureOverlay = new RotationGestureOverlay(mMapView);<NEW_LINE>mRotationGestureOverlay.setEnabled(true);<NEW_LINE>mMapView.setMultiTouchControls(true);<NEW_LINE>mMapView.getOverlayManager().add(mRotationGestureOverlay);<NEW_LINE>panning = v.findViewById(R.id.enablePanning);<NEW_LINE>panning.setOnClickListener(this);<NEW_LINE>panning.setBackgroundColor(Color.BLACK);<NEW_LINE>painting = v.findViewById(R.id.enablePainting);<NEW_LINE>painting.setOnClickListener(this);<NEW_LINE>paint = v.findViewById(R.id.paintingSurface);<NEW_LINE>paint.init(mMapView);<NEW_LINE>paint.setMode(CustomPaintingSurface.Mode.Polygon);<NEW_LINE>updateInfo();<NEW_LINE>return v;<NEW_LINE>}
|
findViewById(R.id.btnRotateLeft);
|
281,552
|
private void handleDuplicates() {<NEW_LINE>dumpDuplicates(context.duplicates);<NEW_LINE>List<Set<FullFunctionDeclaration>> newDuplicatesList = new ArrayList<Set<FullFunctionDeclaration>>();<NEW_LINE>for (Set<FullFunctionDeclaration> duplicates : context.duplicates) {<NEW_LINE>Set<FullFunctionDeclaration> newDuplicates = new HashSet<FullFunctionDeclaration>(duplicates);<NEW_LINE>for (FullFunctionDeclaration f : duplicates) {<NEW_LINE>if (context.overrides.containsKey(f)) {<NEW_LINE>for (Set<FullFunctionDeclaration> duplicates2 : context.duplicates) {<NEW_LINE>if (duplicates2.contains(context.overrides.get(f))) {<NEW_LINE>newDuplicates.addAll(duplicates2);<NEW_LINE>newDuplicatesList.remove(duplicates2);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>newDuplicatesList.add(newDuplicates);<NEW_LINE>}<NEW_LINE>dumpDuplicates(newDuplicatesList);<NEW_LINE>for (Set<FullFunctionDeclaration> duplicates : newDuplicatesList) {<NEW_LINE>Map<FullFunctionDeclaration, List<String>> nameMatrix = null;<NEW_LINE>// logger.info("disambiguation for " + duplicates);<NEW_LINE>nameMatrix = calculateNames(duplicates, Strategy.USER_FRIENDLY);<NEW_LINE>dumpNameMatrix(nameMatrix);<NEW_LINE>if (hasDuplicate(nameMatrix)) {<NEW_LINE>// logger.info("found duplicate!");<NEW_LINE>nameMatrix = <MASK><NEW_LINE>dumpNameMatrix(nameMatrix);<NEW_LINE>}<NEW_LINE>applyDisambiguation(duplicates, nameMatrix);<NEW_LINE>}<NEW_LINE>}
|
calculateNames(duplicates, Strategy.FULL);
|
816,582
|
public Void execute() throws UserException, BimserverLockConflictException, BimserverDatabaseException {<NEW_LINE>User actingUser = getUserByUoid(authorization.getUoid());<NEW_LINE>final Revision revision = getRevisionByRoid(sRevision.getOid());<NEW_LINE>if (revision == null) {<NEW_LINE>throw new UserException("Revision with pid " + sRevision.getOid() + " not found");<NEW_LINE>}<NEW_LINE>Project project = revision.getProject();<NEW_LINE>if (!authorization.hasRightsOnProjectOrSuperProjects(actingUser, project)) {<NEW_LINE>throw new UserException("User has no rights to update project properties");<NEW_LINE>}<NEW_LINE>final RevisionUpdated revisionUpdated = getDatabaseSession().create(RevisionUpdated.class);<NEW_LINE>revisionUpdated.setRevision(revision);<NEW_LINE>revisionUpdated<MASK><NEW_LINE>revisionUpdated.setExecutor(actingUser);<NEW_LINE>revisionUpdated.setAccessMethod(getAccessMethod());<NEW_LINE>getDatabaseSession().addPostCommitAction(new PostCommitAction() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void execute() throws UserException {<NEW_LINE>bimServer.getNotificationsManager().notify(new SConverter().convertToSObject(revisionUpdated));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>revision.setTag(sRevision.getTag());<NEW_LINE>getDatabaseSession().store(revision);<NEW_LINE>return null;<NEW_LINE>}
|
.setDate(new Date());
|
1,426,785
|
public void loadData() {<NEW_LINE>StringBuffer sql = new StringBuffer();<NEW_LINE>PreparedStatement pstm = null;<NEW_LINE>ResultSet rs = null;<NEW_LINE>try {<NEW_LINE>sql.append(" SELECT b.C_BPartner_ID, b.Value, b.Name, b.Email, b.Phone, b.Postal, b.City").append(" FROM RV_BPartner AS b").append(" WHERE b.C_BPartner_ID = ?");<NEW_LINE>int i = 1;<NEW_LINE>pstm = DB.prepareStatement(<MASK><NEW_LINE>// POS<NEW_LINE>pstm.setInt(i++, posPanel.getC_BPartner_ID());<NEW_LINE>rs = pstm.executeQuery();<NEW_LINE>posTable.loadTable(rs);<NEW_LINE>int rowNo = posTable.getRowCount();<NEW_LINE>if (rowNo > 0) {<NEW_LINE>posTable.setSelectedIndex(0);<NEW_LINE>if (rowNo == 1) {<NEW_LINE>select();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.severe("QueryTicket.setResults: " + e + " -> " + sql);<NEW_LINE>} finally {<NEW_LINE>DB.close(rs);<NEW_LINE>DB.close(pstm);<NEW_LINE>}<NEW_LINE>}
|
sql.toString(), null);
|
338,194
|
private void checkSnapshotCompatibility(Project project, FileCollection currentFiles, File previousDirectory, FileExtensionFilter filter, List<String> fileArgs) {<NEW_LINE>boolean isCheckRestSpecVsSnapshot = filter.getSuffix().equals(PegasusPlugin.IDL_FILE_SUFFIX);<NEW_LINE>for (File currentFile : currentFiles) {<NEW_LINE>getProject().getLogger().info("Checking interface file: {}", currentFile.getPath());<NEW_LINE>String apiFilename;<NEW_LINE>if (isCheckRestSpecVsSnapshot) {<NEW_LINE>String fileName = currentFile.getName().substring(0, currentFile.getName().length() - PegasusPlugin.SNAPSHOT_FILE_SUFFIX.length());<NEW_LINE>apiFilename = fileName + PegasusPlugin.IDL_FILE_SUFFIX;<NEW_LINE>} else {<NEW_LINE>apiFilename = currentFile.getName();<NEW_LINE>}<NEW_LINE>String apiFilePath = previousDirectory.getPath<MASK><NEW_LINE>File apiFile = project.file(apiFilePath);<NEW_LINE>if (apiFile.exists()) {<NEW_LINE>fileArgs.add(apiFilePath);<NEW_LINE>fileArgs.add(currentFile.getPath());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
() + File.separatorChar + apiFilename;
|
1,681,512
|
private void handleActionUp(MotionEvent event) {<NEW_LINE>if (null != getParent()) {<NEW_LINE>getParent().requestDisallowInterceptTouchEvent(false);<NEW_LINE>}<NEW_LINE>if (isClick) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int yVelocity = 0;<NEW_LINE>if (null != tracker) {<NEW_LINE>tracker.addMovement(event);<NEW_LINE>tracker.computeCurrentVelocity(1000, maximumVelocity);<NEW_LINE>yVelocity = (int) tracker.getYVelocity();<NEW_LINE>}<NEW_LINE>// Judge scroll or fling base on current velocity<NEW_LINE>isForceFinishScroll = false;<NEW_LINE>if (Math.abs(yVelocity) > minimumVelocity) {<NEW_LINE>scroller.fling(0, scrollOffsetYCoordinate, 0, yVelocity, <MASK><NEW_LINE>int endPoint = computeDistanceToEndPoint(scroller.getFinalY() % itemHeight);<NEW_LINE>scroller.setFinalY(scroller.getFinalY() + endPoint);<NEW_LINE>} else {<NEW_LINE>int endPoint = computeDistanceToEndPoint(scrollOffsetYCoordinate % itemHeight);<NEW_LINE>scroller.startScroll(0, scrollOffsetYCoordinate, 0, endPoint);<NEW_LINE>}<NEW_LINE>// Correct coordinates<NEW_LINE>if (!cyclicEnabled) {<NEW_LINE>if (scroller.getFinalY() > maxFlingYCoordinate) {<NEW_LINE>scroller.setFinalY(maxFlingYCoordinate);<NEW_LINE>} else if (scroller.getFinalY() < minFlingYCoordinate) {<NEW_LINE>scroller.setFinalY(minFlingYCoordinate);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>handler.post(this);<NEW_LINE>cancelTracker();<NEW_LINE>}
|
0, 0, minFlingYCoordinate, maxFlingYCoordinate);
|
528,401
|
private void parseAnonymousIpConfig(final JsonNode jo) throws JsonUtilsException {<NEW_LINE>final String anonymousPollingUrl = "anonymousip.polling.url";<NEW_LINE>final String anonymousPollingInterval = "anonymousip.polling.interval";<NEW_LINE>final String anonymousPolicyConfiguration = "anonymousip.policy.configuration";<NEW_LINE>final JsonNode config = JsonUtils.getJsonNode(jo, "config");<NEW_LINE>final String configUrl = JsonUtils.optString(config, anonymousPolicyConfiguration, null);<NEW_LINE>final String databaseUrl = JsonUtils.optString(config, anonymousPollingUrl, null);<NEW_LINE>if (configUrl == null) {<NEW_LINE>LOGGER.info(anonymousPolicyConfiguration + " not configured; stopping service updater and disabling feature");<NEW_LINE>getAnonymousIpConfigUpdater().stopServiceUpdater();<NEW_LINE>AnonymousIp.getCurrentConfig().enabled = false;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (databaseUrl == null) {<NEW_LINE>LOGGER.info(anonymousPollingUrl + " not configured; stopping service updater and disabling feature");<NEW_LINE>getAnonymousIpDatabaseUpdater().stopServiceUpdater();<NEW_LINE>AnonymousIp.getCurrentConfig().enabled = false;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (jo.has(deliveryServicesKey)) {<NEW_LINE>final JsonNode dss = JsonUtils.getJsonNode(jo, deliveryServicesKey);<NEW_LINE>final Iterator<String> dsNames = dss.fieldNames();<NEW_LINE>while (dsNames.hasNext()) {<NEW_LINE>final String ds = dsNames.next();<NEW_LINE>final JsonNode dsNode = JsonUtils.getJsonNode(dss, ds);<NEW_LINE>if (JsonUtils.optString(dsNode, "anonymousBlockingEnabled").equals("true")) {<NEW_LINE>final long interval = JsonUtils.optLong(config, anonymousPollingInterval);<NEW_LINE>getAnonymousIpConfigUpdater().setDataBaseURL(configUrl, interval);<NEW_LINE>getAnonymousIpDatabaseUpdater().setDataBaseURL(databaseUrl, interval);<NEW_LINE>AnonymousIp<MASK><NEW_LINE>LOGGER.debug("Anonymous Blocking in use, scheduling service updaters and enabling feature");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>LOGGER.debug("No DS using anonymous ip blocking - disabling feature");<NEW_LINE>getAnonymousIpConfigUpdater().cancelServiceUpdater();<NEW_LINE>getAnonymousIpDatabaseUpdater().cancelServiceUpdater();<NEW_LINE>AnonymousIp.getCurrentConfig().enabled = false;<NEW_LINE>}
|
.getCurrentConfig().enabled = true;
|
1,650,180
|
public static void main(String[] args) throws Exception {<NEW_LINE>ManagedChannel channel = NettyChannelBuilder.forAddress("localhost", ContinuousBackpressureDemoServer.PORT).usePlaintext().flowControlWindow(NettyChannelBuilder.DEFAULT_FLOW_CONTROL_WINDOW).build();<NEW_LINE>RxNumbersGrpc.RxNumbersStub <MASK><NEW_LINE>stub.oneToMany(Single.just(Message.getDefaultInstance())).subscribe(m -> {<NEW_LINE>int i = m.getNumber();<NEW_LINE>if (i % PRINT_EVERY == 0) {<NEW_LINE>System.out.println(i);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (PAUSE_AFTER_N_MESSAGES != 0 && i % PAUSE_AFTER_N_MESSAGES == 0) {<NEW_LINE>Thread.sleep(2);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>}<NEW_LINE>});<NEW_LINE>System.in.read();<NEW_LINE>}
|
stub = RxNumbersGrpc.newRxStub(channel);
|
812,075
|
public int stackRegionBlockUnits(Region region, BlockVector3 offset, int count, boolean copyEntities, boolean copyBiomes, Mask mask) throws MaxChangedBlocksException, RegionOperationException {<NEW_LINE>checkNotNull(region);<NEW_LINE>checkNotNull(offset);<NEW_LINE>checkArgument(count >= 1, "count >= 1 required");<NEW_LINE>BlockVector3 size = region.getMaximumPoint().subtract(region.getMinimumPoint()).add(1, 1, 1);<NEW_LINE>BlockVector3 offsetAbs = offset.abs();<NEW_LINE>if (offsetAbs.getX() < size.getX() && offsetAbs.getY() < size.getY() && offsetAbs.getZ() < size.getZ()) {<NEW_LINE>throw new RegionOperationException<MASK><NEW_LINE>}<NEW_LINE>BlockVector3 to = region.getMinimumPoint();<NEW_LINE>ForwardExtentCopy copy = new ForwardExtentCopy(this, region, this, to);<NEW_LINE>copy.setRepetitions(count);<NEW_LINE>copy.setTransform(new AffineTransform().translate(offset));<NEW_LINE>copy.setCopyingEntities(copyEntities);<NEW_LINE>copy.setCopyingBiomes(copyBiomes);<NEW_LINE>if (mask != null) {<NEW_LINE>copy.setSourceMask(mask);<NEW_LINE>}<NEW_LINE>Operations.completeLegacy(copy);<NEW_LINE>return copy.getAffected();<NEW_LINE>}
|
(TranslatableComponent.of("worldedit.stack.intersecting-region"));
|
1,420,559
|
public ReportEntry createEntry(final long initialBytesLost, final long timestampMs, final int sessionId, final int streamId, final String channel, final String source) {<NEW_LINE>ReportEntry reportEntry = null;<NEW_LINE>final int requiredCapacity = CHANNEL_OFFSET + BitUtil.align(SIZE_OF_INT + channel.length(), SIZE_OF_INT) + SIZE_OF_INT + source.length();<NEW_LINE>if (requiredCapacity <= (buffer.capacity() - nextRecordOffset)) {<NEW_LINE>final int offset = nextRecordOffset;<NEW_LINE>buffer.putLong(offset + TOTAL_BYTES_LOST_OFFSET, initialBytesLost);<NEW_LINE>buffer.putLong(offset + FIRST_OBSERVATION_OFFSET, timestampMs);<NEW_LINE>buffer.<MASK><NEW_LINE>buffer.putInt(offset + SESSION_ID_OFFSET, sessionId);<NEW_LINE>buffer.putInt(offset + STREAM_ID_OFFSET, streamId);<NEW_LINE>final int encodedChannelLength = buffer.putStringAscii(offset + CHANNEL_OFFSET, channel);<NEW_LINE>buffer.putStringAscii(offset + CHANNEL_OFFSET + BitUtil.align(encodedChannelLength, SIZE_OF_INT), source);<NEW_LINE>buffer.putLongOrdered(offset + OBSERVATION_COUNT_OFFSET, 1);<NEW_LINE>reportEntry = new ReportEntry(buffer, offset);<NEW_LINE>nextRecordOffset += BitUtil.align(requiredCapacity, ENTRY_ALIGNMENT);<NEW_LINE>}<NEW_LINE>return reportEntry;<NEW_LINE>}
|
putLong(offset + LAST_OBSERVATION_OFFSET, timestampMs);
|
1,557,158
|
private StylableTable createPDFTable(XWPFTable table, float[] colWidths, IITextContainer pdfParentContainer) throws DocumentException {<NEW_LINE>// 2) Compute tableWith<NEW_LINE>TableWidth tableWidth = stylesDocument.getTableWidth(table);<NEW_LINE>StylableTable pdfPTable = pdfDocument.createTable(pdfParentContainer, colWidths.length);<NEW_LINE>pdfPTable.setTotalWidth(colWidths);<NEW_LINE>if (tableWidth != null && tableWidth.width > 0) {<NEW_LINE>if (tableWidth.percentUnit) {<NEW_LINE>pdfPTable.setWidthPercentage(tableWidth.width);<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>pdfPTable.setLockedWidth(true);<NEW_LINE>// Table alignment<NEW_LINE>ParagraphAlignment alignment = stylesDocument.getTableAlignment(table);<NEW_LINE>if (alignment != null) {<NEW_LINE>switch(alignment) {<NEW_LINE>case LEFT:<NEW_LINE>pdfPTable.setHorizontalAlignment(Element.ALIGN_LEFT);<NEW_LINE>break;<NEW_LINE>case RIGHT:<NEW_LINE>pdfPTable.setHorizontalAlignment(Element.ALIGN_RIGHT);<NEW_LINE>break;<NEW_LINE>case CENTER:<NEW_LINE>pdfPTable.setHorizontalAlignment(Element.ALIGN_CENTER);<NEW_LINE>break;<NEW_LINE>case BOTH:<NEW_LINE>pdfPTable.setHorizontalAlignment(Element.ALIGN_JUSTIFIED);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Table indentation<NEW_LINE>Float indentation = stylesDocument.getTableIndentation(table);<NEW_LINE>if (indentation != null) {<NEW_LINE>pdfPTable.setPaddingLeft(indentation);<NEW_LINE>}<NEW_LINE>return pdfPTable;<NEW_LINE>}
|
pdfPTable.setTotalWidth(tableWidth.width);
|
1,601,665
|
static Map<String, String> enhanceWithQualityParameter(final Map<String, String> parameters, final String qualityParamName, final int quality) {<NEW_LINE>if (quality == DEFAULT) {<NEW_LINE>// special handling<NEW_LINE>if (parameters == null || parameters.isEmpty() || !parameters.containsKey(qualityParamName)) {<NEW_LINE>return parameters;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (parameters == null || parameters.isEmpty()) {<NEW_LINE>return Collections.singletonMap(qualityParamName, qualityValueToString(quality));<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>// Try to update the original map first...<NEW_LINE>parameters.put(qualityParamName, qualityValueToString(quality));<NEW_LINE>return parameters;<NEW_LINE>} catch (final UnsupportedOperationException uoe) {<NEW_LINE>// Unmodifiable map - let's create a new copy...<NEW_LINE>final Map<String, String> result = new HashMap<String, String>(parameters);<NEW_LINE>result.put<MASK><NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>}
|
(qualityParamName, qualityValueToString(quality));
|
1,433,690
|
public static QueryTaskRulesResponse unmarshall(QueryTaskRulesResponse queryTaskRulesResponse, UnmarshallerContext _ctx) {<NEW_LINE>queryTaskRulesResponse.setRequestId(_ctx.stringValue("QueryTaskRulesResponse.RequestId"));<NEW_LINE>queryTaskRulesResponse.setCode(_ctx.integerValue("QueryTaskRulesResponse.Code"));<NEW_LINE>queryTaskRulesResponse.setErrorMessage(_ctx.stringValue("QueryTaskRulesResponse.ErrorMessage"));<NEW_LINE>queryTaskRulesResponse.setSuccess(_ctx.booleanValue("QueryTaskRulesResponse.Success"));<NEW_LINE>List<DataItem> data = new ArrayList<DataItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("QueryTaskRulesResponse.Data.Length"); i++) {<NEW_LINE>DataItem dataItem = new DataItem();<NEW_LINE>dataItem.setType(_ctx.integerValue("QueryTaskRulesResponse.Data[" + i + "].Type"));<NEW_LINE>dataItem.setContent(_ctx.stringValue("QueryTaskRulesResponse.Data[" + i + "].Content"));<NEW_LINE>dataItem.setTaskId(_ctx.longValue<MASK><NEW_LINE>dataItem.setId(_ctx.integerValue("QueryTaskRulesResponse.Data[" + i + "].Id"));<NEW_LINE>data.add(dataItem);<NEW_LINE>}<NEW_LINE>queryTaskRulesResponse.setData(data);<NEW_LINE>return queryTaskRulesResponse;<NEW_LINE>}
|
("QueryTaskRulesResponse.Data[" + i + "].TaskId"));
|
1,193,571
|
/*<NEW_LINE><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><NEW_LINE><style><NEW_LINE><xsl:comment><NEW_LINE><NEW_LINE>/#paged media #/ div.header {display: none }<NEW_LINE>div.footer {display: none } /#@media print { #/<NEW_LINE><xsl:if<NEW_LINE>test="java:org.docx4j.convert.out.common.XsltCommonFunctions.hasDefaultHeader($conversionContext)"><NEW_LINE>div.header {display: block; position: running(header) }<NEW_LINE></xsl:if><NEW_LINE><xsl:if<NEW_LINE>test="java:org.docx4j.convert.out.common.XsltCommonFunctions.hasDefaultFooter($conversionContext)"><NEW_LINE>div.footer {display: block; position: running(footer) }<NEW_LINE></xsl:if><NEW_LINE><NEW_LINE>@page { size: A4; margin: 10%; @top-center {<NEW_LINE>content: element(header) } @bottom-center {<NEW_LINE>content: element(footer) } }<NEW_LINE><NEW_LINE><NEW_LINE>/#font definitions#/<NEW_LINE><NEW_LINE>/#element styles#/ .del<NEW_LINE>{text-decoration:line-through;color:red;}<NEW_LINE><xsl:choose><NEW_LINE><xsl:when test="/w:document/w:settings/w:trackRevisions"><NEW_LINE>.ins {text-decoration:none;background:#c0ffc0;padding:1px;}<NEW_LINE></xsl:when><NEW_LINE><xsl:otherwise><NEW_LINE>.ins {text-decoration:none;background:#c0ffc0;padding:1px;}<NEW_LINE></xsl:otherwise><NEW_LINE></xsl:choose><NEW_LINE><NEW_LINE><NEW_LINE>/# Word style definitions #/<NEW_LINE><xsl:copy-of<NEW_LINE>select="java:org.docx4j.convert.out.html.XsltHTMLFunctions.getCssForStyles(<NEW_LINE>$conversionContext)" /><NEW_LINE><NEW_LINE>/# TABLE CELL STYLES #/<NEW_LINE><xsl:variable name="tables" select="./w:body//w:tbl" /><NEW_LINE><xsl:copy-of<NEW_LINE>select="java:org.docx4j.convert.out.html.XsltHTMLFunctions.getCssForTableCells(<NEW_LINE>$conversionContext, $tables)" /><NEW_LINE><NEW_LINE><NEW_LINE></xsl:comment><NEW_LINE></style><NEW_LINE><NEW_LINE><xsl:value-of select="$userCSS" disable-output-escaping="yes" /><NEW_LINE><NEW_LINE><script type="text/javascript"><NEW_LINE><!-- For collapsible content controls --><NEW_LINE>function toggleDiv(divid){<NEW_LINE>if(document.getElementById(divid).style.display == 'none'){<NEW_LINE>document.getElementById(divid).style.display = 'block';<NEW_LINE>}else{<NEW_LINE>document.getElementById(divid).style.display = 'none';<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE></script><NEW_LINE><NEW_LINE><!-- User script --><NEW_LINE><xsl:value-of select="$userScript" disable-output-escaping="yes" /><NEW_LINE><NEW_LINE></head><NEW_LINE>*/<NEW_LINE>public static DocumentFragment appendHeadElement(HTMLConversionContext conversionContext) {<NEW_LINE>// There is a similar method for the non XSLT case, in HTMLExporterVisitorDelegate<NEW_LINE>// Create a DOM document to take the results<NEW_LINE>Document document = XmlUtils.getNewDocumentBuilder().newDocument();<NEW_LINE>Element headEl = document.createElement("head");<NEW_LINE>Element meta = document.createElement("meta");<NEW_LINE>Element element = null;<NEW_LINE>StringBuilder buffer = new StringBuilder(10240);<NEW_LINE>document.appendChild(headEl);<NEW_LINE>// <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><NEW_LINE>meta.setAttribute("http-equiv", "Content-Type");<NEW_LINE><MASK><NEW_LINE>headEl.appendChild(meta);<NEW_LINE>// <style..<NEW_LINE>element = createStyleElement(conversionContext, document, buffer);<NEW_LINE>if (element != null) {<NEW_LINE>headEl.appendChild(element);<NEW_LINE>}<NEW_LINE>// <script<NEW_LINE>buffer.setLength(0);<NEW_LINE>element = createScriptElement(conversionContext, document, buffer);<NEW_LINE>if (element != null) {<NEW_LINE>headEl.appendChild(element);<NEW_LINE>}<NEW_LINE>DocumentFragment docfrag = document.createDocumentFragment();<NEW_LINE>docfrag.appendChild(document.getDocumentElement());<NEW_LINE>return docfrag;<NEW_LINE>}
|
meta.setAttribute("content", "text/html; charset=utf-8");
|
1,325,179
|
final ModifyAuthenticationProfileResult executeModifyAuthenticationProfile(ModifyAuthenticationProfileRequest modifyAuthenticationProfileRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(modifyAuthenticationProfileRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<ModifyAuthenticationProfileRequest> request = null;<NEW_LINE>Response<ModifyAuthenticationProfileResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ModifyAuthenticationProfileRequestMarshaller().marshall(super.beforeMarshalling(modifyAuthenticationProfileRequest));<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, "Redshift");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ModifyAuthenticationProfile");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<ModifyAuthenticationProfileResult> responseHandler = new StaxResponseHandler<ModifyAuthenticationProfileResult>(new ModifyAuthenticationProfileResultStaxUnmarshaller());<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);
|
698,989
|
protected Solver.SolutionInfo solve(DataSet x) {<NEW_LINE>final int l = x.size();<NEW_LINE>byte[] y = new byte[l];<NEW_LINE>for (int i = 0; i < l; i++) {<NEW_LINE>y[i] = x.value(i) > 0 ? ONE : MONE;<NEW_LINE>}<NEW_LINE>double sum_pos = nu * l * .5, sum_neg = nu * l * .5;<NEW_LINE>double[] alpha = new double[l];<NEW_LINE>for (int i = 0; i < l; i++) {<NEW_LINE>if (y[i] == ONE) {<NEW_LINE>alpha[i] = sum_pos < 1.0 ? sum_pos : 1.0;<NEW_LINE>sum_pos -= alpha[i];<NEW_LINE>} else {<NEW_LINE>alpha[i] = sum_neg < 1.0 ? sum_neg : 1.0;<NEW_LINE>sum_neg -= alpha[i];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>double[<MASK><NEW_LINE>QMatrix Q = new CachedQMatrix(l, cache_size, new SVC_Q(x, y));<NEW_LINE>Q.initialize();<NEW_LINE>NuSolver solver = new NuSolver();<NEW_LINE>Solver.SolutionInfo si = solver.solve(l, Q, zeros, y, alpha, 1., 1., eps, shrinking);<NEW_LINE>final double ir = 1 / solver.r;<NEW_LINE>LOG.verbose("C = " + ir);<NEW_LINE>for (int i = 0; i < l; i++) {<NEW_LINE>si.alpha[i] *= y[i] * ir;<NEW_LINE>}<NEW_LINE>si.rho *= ir;<NEW_LINE>si.obj *= ir * ir;<NEW_LINE>si.upper_bound_p = si.upper_bound_n = ir;<NEW_LINE>return si;<NEW_LINE>}
|
] zeros = new double[l];
|
804,737
|
private void lsdSort(String[] bits, int initialDigit) {<NEW_LINE>// Binary digits<NEW_LINE>int alphabetSize = 2;<NEW_LINE>String[] auxArray = new String[bits.length];<NEW_LINE>for (int digit = initialDigit; digit >= 0; digit--) {<NEW_LINE>// Compute frequency counts<NEW_LINE>int[] count = new int[alphabetSize + 1];<NEW_LINE>for (int i = 0; i < bits.length; i++) {<NEW_LINE>int bitValue = Character.getNumericValue(bits[i].charAt(digit));<NEW_LINE>count[bitValue + 1]++;<NEW_LINE>}<NEW_LINE>// Transform counts to indices<NEW_LINE>for (int r = 0; r < alphabetSize; r++) {<NEW_LINE>count[r + 1] += count[r];<NEW_LINE>}<NEW_LINE>// Distribute<NEW_LINE>for (int i = 0; i < bits.length; i++) {<NEW_LINE>int bitValue = Character.getNumericValue(bits[i].charAt(digit));<NEW_LINE>int indexInAuxArray = count[bitValue]++;<NEW_LINE>auxArray[indexInAuxArray] = bits[i];<NEW_LINE>}<NEW_LINE>// Copy back<NEW_LINE>for (int i = 0; i < bits.length; i++) {<NEW_LINE>bits<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
[i] = auxArray[i];
|
760,873
|
private static void decode22(DataInput in, long[] tmp, long[] longs) throws IOException {<NEW_LINE>readLELongs(in, tmp, 0, 44);<NEW_LINE>shiftLongs(tmp, 44, longs, 0, 10, MASK32_22);<NEW_LINE>for (int iter = 0, tmpIdx = 0, longsIdx = 44; iter < 4; ++iter, tmpIdx += 11, longsIdx += 5) {<NEW_LINE>long l0 = (tmp[tmpIdx + 0] & MASK32_10) << 12;<NEW_LINE>l0 |= (tmp[tmpIdx + 1] & MASK32_10) << 2;<NEW_LINE>l0 |= (tmp[tmpIdx + 2] >>> 8) & MASK32_2;<NEW_LINE>longs[longsIdx + 0] = l0;<NEW_LINE>long l1 = (tmp[tmpIdx + 2] & MASK32_8) << 14;<NEW_LINE>l1 |= (tmp[tmpIdx <MASK><NEW_LINE>l1 |= (tmp[tmpIdx + 4] >>> 6) & MASK32_4;<NEW_LINE>longs[longsIdx + 1] = l1;<NEW_LINE>long l2 = (tmp[tmpIdx + 4] & MASK32_6) << 16;<NEW_LINE>l2 |= (tmp[tmpIdx + 5] & MASK32_10) << 6;<NEW_LINE>l2 |= (tmp[tmpIdx + 6] >>> 4) & MASK32_6;<NEW_LINE>longs[longsIdx + 2] = l2;<NEW_LINE>long l3 = (tmp[tmpIdx + 6] & MASK32_4) << 18;<NEW_LINE>l3 |= (tmp[tmpIdx + 7] & MASK32_10) << 8;<NEW_LINE>l3 |= (tmp[tmpIdx + 8] >>> 2) & MASK32_8;<NEW_LINE>longs[longsIdx + 3] = l3;<NEW_LINE>long l4 = (tmp[tmpIdx + 8] & MASK32_2) << 20;<NEW_LINE>l4 |= (tmp[tmpIdx + 9] & MASK32_10) << 10;<NEW_LINE>l4 |= (tmp[tmpIdx + 10] & MASK32_10) << 0;<NEW_LINE>longs[longsIdx + 4] = l4;<NEW_LINE>}<NEW_LINE>}
|
+ 3] & MASK32_10) << 4;
|
1,847,267
|
public static DescribePdnsThreatStatisticResponse unmarshall(DescribePdnsThreatStatisticResponse describePdnsThreatStatisticResponse, UnmarshallerContext _ctx) {<NEW_LINE>describePdnsThreatStatisticResponse.setRequestId(_ctx.stringValue("DescribePdnsThreatStatisticResponse.RequestId"));<NEW_LINE>List<StatisticItem> data = new ArrayList<StatisticItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribePdnsThreatStatisticResponse.Data.Length"); i++) {<NEW_LINE>StatisticItem statisticItem = new StatisticItem();<NEW_LINE>statisticItem.setUdpTotalCount(_ctx.longValue<MASK><NEW_LINE>statisticItem.setTotalCount(_ctx.longValue("DescribePdnsThreatStatisticResponse.Data[" + i + "].TotalCount"));<NEW_LINE>statisticItem.setThreatLevel(_ctx.stringValue("DescribePdnsThreatStatisticResponse.Data[" + i + "].ThreatLevel"));<NEW_LINE>statisticItem.setThreatType(_ctx.stringValue("DescribePdnsThreatStatisticResponse.Data[" + i + "].ThreatType"));<NEW_LINE>statisticItem.setTimestamp(_ctx.longValue("DescribePdnsThreatStatisticResponse.Data[" + i + "].Timestamp"));<NEW_LINE>statisticItem.setDohTotalCount(_ctx.longValue("DescribePdnsThreatStatisticResponse.Data[" + i + "].DohTotalCount"));<NEW_LINE>data.add(statisticItem);<NEW_LINE>}<NEW_LINE>describePdnsThreatStatisticResponse.setData(data);<NEW_LINE>return describePdnsThreatStatisticResponse;<NEW_LINE>}
|
("DescribePdnsThreatStatisticResponse.Data[" + i + "].UdpTotalCount"));
|
1,430,254
|
private static String encode_base64(byte[] d, int len) throws IllegalArgumentException {<NEW_LINE>int off = 0;<NEW_LINE>StringBuilder rs = new StringBuilder();<NEW_LINE>int c1, c2;<NEW_LINE>if (len <= 0 || len > d.length)<NEW_LINE>throw new IllegalArgumentException("Invalid len");<NEW_LINE>while (off < len) {<NEW_LINE>c1 = d[off++] & 0xff;<NEW_LINE>rs.append(base64_code[(c1 >> 2) & 0x3f]);<NEW_LINE>c1 = (c1 & 0x03) << 4;<NEW_LINE>if (off >= len) {<NEW_LINE>rs.append(base64_code[c1 & 0x3f]);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>c2 = d[off++] & 0xff;<NEW_LINE>c1 |= (c2 >> 4) & 0x0f;<NEW_LINE>rs.append<MASK><NEW_LINE>c1 = (c2 & 0x0f) << 2;<NEW_LINE>if (off >= len) {<NEW_LINE>rs.append(base64_code[c1 & 0x3f]);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>c2 = d[off++] & 0xff;<NEW_LINE>c1 |= (c2 >> 6) & 0x03;<NEW_LINE>rs.append(base64_code[c1 & 0x3f]);<NEW_LINE>rs.append(base64_code[c2 & 0x3f]);<NEW_LINE>}<NEW_LINE>return rs.toString();<NEW_LINE>}
|
(base64_code[c1 & 0x3f]);
|
1,029,424
|
final ListGeneratedCodeJobsResult executeListGeneratedCodeJobs(ListGeneratedCodeJobsRequest listGeneratedCodeJobsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listGeneratedCodeJobsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListGeneratedCodeJobsRequest> request = null;<NEW_LINE>Response<ListGeneratedCodeJobsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListGeneratedCodeJobsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listGeneratedCodeJobsRequest));<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, "GameSparks");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListGeneratedCodeJobs");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListGeneratedCodeJobsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListGeneratedCodeJobsResultJsonUnmarshaller());<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);
|
1,717,150
|
public static void main(String[] args) {<NEW_LINE>// Create a section file.<NEW_LINE>Logger rep = new Logger(Report.Verbose);<NEW_LINE>DuckContext duck = new DuckContext(rep);<NEW_LINE>SectionFile file = new SectionFile(duck);<NEW_LINE>// If command line arguments are provided, load the corresponding files.<NEW_LINE>for (String name : args) {<NEW_LINE>if (name.endsWith(".xml")) {<NEW_LINE>rep.info("loading XML file " + name);<NEW_LINE>file.loadXML(name);<NEW_LINE>} else if (name.endsWith(".bin")) {<NEW_LINE><MASK><NEW_LINE>file.loadBinary(name);<NEW_LINE>} else {<NEW_LINE>rep.error("unknown file type " + name + ", ignored");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>System.out.printf("After initial load: %d bytes, %d sections, %d tables\n", file.binarySize(), file.sectionsCount(), file.tablesCount());<NEW_LINE>// Loading inline XML table.<NEW_LINE>file.loadXML("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<tsduck>\n" + " <PAT transport_stream_id=\"10\">\n" + " <service service_id=\"1\" program_map_PID=\"100\"/>\n" + " <service service_id=\"2\" program_map_PID=\"200\"/>\n" + " </PAT>\n" + "</tsduck>");<NEW_LINE>System.out.printf("After inline XML load: %d bytes, %d sections, %d tables\n", file.binarySize(), file.sectionsCount(), file.tablesCount());<NEW_LINE>// Convert to XML and JSON.<NEW_LINE>System.out.println("---- XML file content ----");<NEW_LINE>System.out.println(file.toXML());<NEW_LINE>System.out.println("---- JSON file content ----");<NEW_LINE>System.out.println(file.toJSON());<NEW_LINE>// Deallocate C++ resources (in reverse order from creation).<NEW_LINE>file.delete();<NEW_LINE>rep.delete();<NEW_LINE>duck.delete();<NEW_LINE>}
|
rep.info("loading binary file " + name);
|
1,836,041
|
protected FontMatch fontMatchRun(String text, int startIndex, int endIndex, List<Face> fonts) {<NEW_LINE>LinkedList<Face> validFonts = new LinkedList<>(fonts);<NEW_LINE>Face lastValid = null;<NEW_LINE>int charIndex = startIndex;<NEW_LINE>int nextCharIndex = charIndex;<NEW_LINE>while (charIndex < endIndex) {<NEW_LINE>char textChar = text.charAt(charIndex);<NEW_LINE>nextCharIndex = charIndex + 1;<NEW_LINE>int codePoint;<NEW_LINE>if (Character.isHighSurrogate(textChar)) {<NEW_LINE>if (charIndex + 1 >= endIndex) {<NEW_LINE>// isolated high surrogate, not attempting to match fonts<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>char nextChar = text.charAt(charIndex + 1);<NEW_LINE>if (!Character.isLowSurrogate(nextChar)) {<NEW_LINE>// unpaired high surrogate, not attempting to match fonts<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>codePoint = Character.toCodePoint(textChar, nextChar);<NEW_LINE>++nextCharIndex;<NEW_LINE>} else {<NEW_LINE>codePoint = textChar;<NEW_LINE>}<NEW_LINE>for (ListIterator<Face> fontIt = validFonts.listIterator(); fontIt.hasNext(); ) {<NEW_LINE>Face face = fontIt.next();<NEW_LINE>if (!face.supports(codePoint)) {<NEW_LINE>fontIt.remove();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (validFonts.isEmpty()) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>lastValid = validFonts.getFirst();<NEW_LINE>charIndex = nextCharIndex;<NEW_LINE>}<NEW_LINE>FontMatch fontMatch = new FontMatch();<NEW_LINE>fontMatch.endIndex = lastValid == null ? nextCharIndex : charIndex;<NEW_LINE>fontMatch.fontInfo = lastValid <MASK><NEW_LINE>return fontMatch;<NEW_LINE>}
|
== null ? null : lastValid.fontInfo;
|
724,666
|
protected void plugDPDKInterface(InterfaceDef intf, String trafficLabel, Map<String, String> extraConfig, String vlanId, String guestOsType, NicTO nic, String nicAdapter) {<NEW_LINE>s_logger.debug("DPDK support enabled: configuring per traffic label " + trafficLabel);<NEW_LINE>String dpdkOvsPath = _libvirtComputingResource.dpdkOvsPath;<NEW_LINE>if (StringUtils.isBlank(dpdkOvsPath)) {<NEW_LINE>throw new CloudRuntimeException("DPDK is enabled on the host but no OVS path has been provided");<NEW_LINE>}<NEW_LINE>String port = dpdkDriver.getNextDpdkPort();<NEW_LINE>DpdkHelper.VHostUserMode <MASK><NEW_LINE>dpdkDriver.addDpdkPort(_pifs.get(trafficLabel), port, vlanId, dpdKvHostUserMode, dpdkOvsPath);<NEW_LINE>String interfaceMode = dpdkDriver.getGuestInterfacesModeFromDpdkVhostUserMode(dpdKvHostUserMode);<NEW_LINE>intf.defDpdkNet(dpdkOvsPath, port, nic.getMac(), getGuestNicModel(guestOsType, nicAdapter), 0, dpdkDriver.getExtraDpdkProperties(extraConfig), interfaceMode);<NEW_LINE>}
|
dpdKvHostUserMode = dpdkDriver.getDpdkvHostUserMode(extraConfig);
|
542,463
|
synchronized void tokenTextRemove(TokenItem token, int offset, int length) {<NEW_LINE>List<ExtTokenPosition> posList = getPosList(token);<NEW_LINE>int len = posList.size();<NEW_LINE>int newLen = token.getImage().length() - length;<NEW_LINE>List<ExtTokenPosition> nextList = getPosList(token.getNext());<NEW_LINE>for (int i = 0; i < len; i++) {<NEW_LINE>ExtTokenPosition etp = (ExtTokenPosition) posList.get(i);<NEW_LINE>if (etp.offset >= offset + length) {<NEW_LINE>// move to nextToken<NEW_LINE>etp.offset -= length;<NEW_LINE>} else if (etp.offset >= offset) {<NEW_LINE>etp.offset = offset;<NEW_LINE>}<NEW_LINE>// Check if pos right at the end of token and therefore invalid<NEW_LINE>if (etp.offset >= newLen) {<NEW_LINE>// need to move to begining of next token<NEW_LINE>etp<MASK><NEW_LINE>etp.offset = 0;<NEW_LINE>posList.remove(i);<NEW_LINE>nextList.add(etp);<NEW_LINE>i--;<NEW_LINE>len--;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
.token = token.getNext();
|
861,051
|
public void tick(Level world, BlockPos pos, FluidState state) {<NEW_LINE>hasFlownInTick = false;<NEW_LINE>super.tick(world, pos, state);<NEW_LINE>int timer = <MASK><NEW_LINE>int level = getLegacyLevel(state);<NEW_LINE>int quantaRemaining = 16 - level;<NEW_LINE>if (timer >= Math.min(14, quantaRemaining)) {<NEW_LINE>Block solidBlock;<NEW_LINE>if (level >= 14)<NEW_LINE>solidBlock = StoneDecoration.concreteSheet;<NEW_LINE>else if (level >= 10)<NEW_LINE>solidBlock = StoneDecoration.concreteQuarter;<NEW_LINE>else if (level >= 6)<NEW_LINE>solidBlock = IEBlocks.toSlab.get(StoneDecoration.concrete);<NEW_LINE>else if (level >= 2)<NEW_LINE>solidBlock = StoneDecoration.concreteThreeQuarter;<NEW_LINE>else<NEW_LINE>solidBlock = StoneDecoration.concrete;<NEW_LINE>world.setBlockAndUpdate(pos, solidBlock.defaultBlockState());<NEW_LINE>for (LivingEntity living : world.getEntitiesOfClass(LivingEntity.class, new AABB(pos, pos.offset(1, 1, 1)))) living.addEffect(new MobEffectInstance(IEPotions.concreteFeet, Integer.MAX_VALUE));<NEW_LINE>} else if (world.getBlockState(pos).getBlock() == block) {<NEW_LINE>BlockState newState = world.getBlockState(pos).setValue(IEProperties.INT_16, timer + (hasFlownInTick ? 1 : 2));<NEW_LINE>world.setBlockAndUpdate(pos, newState);<NEW_LINE>}<NEW_LINE>}
|
state.getValue(IEProperties.INT_16);
|
900,020
|
private static <T extends RepoIdAware> T extractIdOrNull(@NonNull final Throwable t, @NonNull final String name, @NonNull final IntFunction<T> mapper) {<NEW_LINE>if (t instanceof AdempiereException) {<NEW_LINE>final AdempiereException metasfreshException = (AdempiereException) t;<NEW_LINE>final String mdcValueStr = metasfreshException.getMDC(name);<NEW_LINE>if (mdcValueStr != null && !mdcValueStr.isEmpty()) {<NEW_LINE>final Integer <MASK><NEW_LINE>return valueInt != null ? mapper.apply(valueInt) : null;<NEW_LINE>}<NEW_LINE>final Object paramValueObj = metasfreshException.getParameter(name);<NEW_LINE>if (paramValueObj != null) {<NEW_LINE>final Integer valueInt = NumberUtils.asIntegerOrNull(paramValueObj);<NEW_LINE>return valueInt != null ? mapper.apply(valueInt) : null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Fallback<NEW_LINE>return null;<NEW_LINE>}
|
valueInt = NumberUtils.asIntegerOrNull(mdcValueStr);
|
1,585,761
|
private Mono<Response<Flux<ByteBuffer>>> deleteWithResponseAsync(String resourceGroupName, String workspaceName, 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.<MASK><NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (workspaceName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, context);<NEW_LINE>}
|
error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));
|
910,330
|
/*<NEW_LINE>* Register a IMetric instance. Storm will then call getValueAndReset on the metric every timeBucketSizeInSecs and the returned value is sent to all metrics<NEW_LINE>* consumers. You must call this during IBolt::prepare or ISpout::open.<NEW_LINE>*<NEW_LINE>* @return The IMetric argument unchanged.<NEW_LINE>*/<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>public <T extends IMetric> T registerMetric(String name, T metric, int timeBucketSizeInSecs) {<NEW_LINE>if ((Boolean) _openOrPrepareWasCalled.deref()) {<NEW_LINE>throw new RuntimeException("TopologyContext.registerMetric can only be called from within overridden " + "IBolt::prepare() or ISpout::open() method.");<NEW_LINE>}<NEW_LINE>if (metric == null) {<NEW_LINE>throw new IllegalArgumentException("Cannot register a null metric");<NEW_LINE>}<NEW_LINE>if (timeBucketSizeInSecs <= 0) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (getRegisteredMetricByName(name) != null) {<NEW_LINE>throw new RuntimeException("The same metric name `" + name + "` was registered twice.");<NEW_LINE>}<NEW_LINE>Map m1 = _registeredMetrics;<NEW_LINE>if (!m1.containsKey(timeBucketSizeInSecs)) {<NEW_LINE>m1.put(timeBucketSizeInSecs, new HashMap());<NEW_LINE>}<NEW_LINE>Map m2 = (Map) m1.get(timeBucketSizeInSecs);<NEW_LINE>if (!m2.containsKey(_taskId)) {<NEW_LINE>m2.put(_taskId, new HashMap());<NEW_LINE>}<NEW_LINE>Map m3 = (Map) m2.get(_taskId);<NEW_LINE>if (m3.containsKey(name)) {<NEW_LINE>throw new RuntimeException("The same metric name `" + name + "` was registered twice.");<NEW_LINE>} else {<NEW_LINE>m3.put(name, metric);<NEW_LINE>}<NEW_LINE>return metric;<NEW_LINE>}
|
throw new IllegalArgumentException("TopologyContext.registerMetric can only be called with timeBucketSizeInSecs " + "greater than or equal to 1 second.");
|
369,841
|
public ListSAMLProviderTagsResult unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>ListSAMLProviderTagsResult listSAMLProviderTagsResult = new ListSAMLProviderTagsResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 2;<NEW_LINE>while (true) {<NEW_LINE><MASK><NEW_LINE>if (xmlEvent.isEndDocument())<NEW_LINE>return listSAMLProviderTagsResult;<NEW_LINE>if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {<NEW_LINE>if (context.testExpression("Tags", targetDepth)) {<NEW_LINE>listSAMLProviderTagsResult.withTags(new ArrayList<Tag>());<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("Tags/member", targetDepth)) {<NEW_LINE>listSAMLProviderTagsResult.withTags(TagStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("IsTruncated", targetDepth)) {<NEW_LINE>listSAMLProviderTagsResult.setIsTruncated(BooleanStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("Marker", targetDepth)) {<NEW_LINE>listSAMLProviderTagsResult.setMarker(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent.isEndElement()) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return listSAMLProviderTagsResult;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
XMLEvent xmlEvent = context.nextEvent();
|
1,321,497
|
static public void apply(@NotNull String pattern, @NotNull StringLiteralExpression target, @NotNull ProblemsHolder holder) {<NEW_LINE>if (!pattern.isEmpty()) {<NEW_LINE>while (regexGroupsToSkip.matcher(normalizedPattern).find()) {<NEW_LINE>final Matcher matcher = regexGroupsToSkip.matcher(normalizedPattern);<NEW_LINE>if (matcher.find()) {<NEW_LINE>final String fragment = matcher.group(0);<NEW_LINE>if (fragment != null) {<NEW_LINE>normalizedPattern = normalizedPattern.replace(fragment, matcher.group(1) + matcher.group(3));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final Matcher <MASK><NEW_LINE>while (matcher.find()) {<NEW_LINE>final String fragment = matcher.group(2);<NEW_LINE>if (fragment != null) {<NEW_LINE>for (final String candidate : fragment.split("\\|")) {<NEW_LINE>if (!candidate.isEmpty() && candidate.matches("^\\\\[dDwWsS][*+]$")) {<NEW_LINE>holder.registerProblem(target, String.format(MessagesPresentationUtil.prefixWithEa(messagePattern), candidate, matcher.group(3)), ProblemHighlightType.GENERIC_ERROR);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
matcher = regexOuterGroup.matcher(normalizedPattern);
|
1,027,180
|
V putInternal(K key, V value, ExpirationPolicy expirationPolicy, long expirationNanos) {<NEW_LINE>writeLock.lock();<NEW_LINE>try {<NEW_LINE>ExpiringEntry<K, V> entry = entries.get(key);<NEW_LINE>V oldValue = null;<NEW_LINE>if (entry == null) {<NEW_LINE>entry = new ExpiringEntry<K, V>(key, value, variableExpiration ? new AtomicReference<ExpirationPolicy>(expirationPolicy) : this.expirationPolicy, variableExpiration ? new AtomicLong(expirationNanos) : this.expirationNanos);<NEW_LINE>if (entries.size() >= maxSize) {<NEW_LINE>ExpiringEntry<K, V> expiredEntry = entries.first();<NEW_LINE><MASK><NEW_LINE>notifyListeners(expiredEntry);<NEW_LINE>}<NEW_LINE>entries.put(key, entry);<NEW_LINE>if (entries.size() == 1 || entries.first().equals(entry))<NEW_LINE>scheduleEntry(entry);<NEW_LINE>} else {<NEW_LINE>oldValue = entry.getValue();<NEW_LINE>if (!ExpirationPolicy.ACCESSED.equals(expirationPolicy) && ((oldValue == null && value == null) || (oldValue != null && oldValue.equals(value))))<NEW_LINE>return value;<NEW_LINE>entry.setValue(value);<NEW_LINE>resetEntry(entry, false);<NEW_LINE>}<NEW_LINE>return oldValue;<NEW_LINE>} finally {<NEW_LINE>writeLock.unlock();<NEW_LINE>}<NEW_LINE>}
|
entries.remove(expiredEntry.key);
|
1,479,148
|
private void createCircuit(boolean useJKff, boolean useLUTs, ExpressionModifier... modifier) {<NEW_LINE>try {<NEW_LINE>final ModelAnalyserInfo modelAnalyzerInfo = undoManager.getActual().getModelAnalyzerInfo();<NEW_LINE>CircuitBuilder circuitBuilder = new CircuitBuilder(shapeFactory, undoManager.getActual().getVars()).setUseJK(useJKff).setUseLUTs<MASK><NEW_LINE>new BuilderExpressionCreator(circuitBuilder, modifier).setUseJKOptimizer(useJKff).create(lastGeneratedExpressions);<NEW_LINE>Circuit circuit = circuitBuilder.createCircuit();<NEW_LINE>new Main.MainBuilder().setParent(TableDialog.this).setLibrary(library).setCircuit(circuit).setBaseFileName(filename).openLater();<NEW_LINE>} catch (ExpressionException | FormatterException | RuntimeException e) {<NEW_LINE>new ErrorMessage(Lang.get("msg_errorDuringCalculation")).addCause(e).show(this);<NEW_LINE>}<NEW_LINE>}
|
(useLUTs).setModelAnalyzerInfo(modelAnalyzerInfo);
|
484,158
|
private RealmRepresentation createRealmRep() {<NEW_LINE>RealmRepresentation realm = new RealmRepresentation();<NEW_LINE>realm.setRealm(getDefaultRealmName());<NEW_LINE>realm.setEnabled(true);<NEW_LINE>realm.setUsers(new ArrayList<>());<NEW_LINE>realm.setClients(new ArrayList<>());<NEW_LINE>RolesRepresentation roles = new RolesRepresentation();<NEW_LINE>List<RoleRepresentation> <MASK><NEW_LINE>roles.setRealm(realmRoles);<NEW_LINE>realm.setRoles(roles);<NEW_LINE>if (capturedDevServicesConfiguration.roles.isEmpty()) {<NEW_LINE>realm.getRoles().getRealm().add(new RoleRepresentation("user", null, false));<NEW_LINE>realm.getRoles().getRealm().add(new RoleRepresentation("admin", null, false));<NEW_LINE>} else {<NEW_LINE>Set<String> allRoles = new HashSet<>();<NEW_LINE>for (List<String> distinctRoles : capturedDevServicesConfiguration.roles.values()) {<NEW_LINE>for (String role : distinctRoles) {<NEW_LINE>if (!allRoles.contains(role)) {<NEW_LINE>allRoles.add(role);<NEW_LINE>realm.getRoles().getRealm().add(new RoleRepresentation(role, null, false));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return realm;<NEW_LINE>}
|
realmRoles = new ArrayList<>();
|
216,102
|
public SslKeyConfig buildKeyConfig(Path basePath) {<NEW_LINE>final String certificatePath = stringSetting(CERTIFICATE);<NEW_LINE>final String keyPath = stringSetting(KEY);<NEW_LINE>final String keyStorePath = stringSetting(KEYSTORE_PATH);<NEW_LINE>if (certificatePath != null && keyStorePath != null) {<NEW_LINE>throw new SslConfigException("cannot specify both [" + settingPrefix + CERTIFICATE + "] and [" + settingPrefix + KEYSTORE_PATH + "]");<NEW_LINE>}<NEW_LINE>if (certificatePath != null || keyPath != null) {<NEW_LINE>if (keyPath == null) {<NEW_LINE>throw new SslConfigException("cannot specify [" + settingPrefix + CERTIFICATE + "] without also setting [" + settingPrefix + KEY + "]");<NEW_LINE>}<NEW_LINE>if (certificatePath == null) {<NEW_LINE>throw new SslConfigException("cannot specify [" + settingPrefix + KEYSTORE_PATH + "] without also setting [" + settingPrefix + CERTIFICATE + "]");<NEW_LINE>}<NEW_LINE>final char[] password = resolvePasswordSetting(KEY_SECURE_PASSPHRASE, KEY_LEGACY_PASSPHRASE);<NEW_LINE>return new PemKeyConfig(certificatePath, keyPath, password, basePath);<NEW_LINE>}<NEW_LINE>if (keyStorePath != null) {<NEW_LINE>final char[] <MASK><NEW_LINE>char[] keyPassword = resolvePasswordSetting(KEYSTORE_SECURE_KEY_PASSWORD, KEYSTORE_LEGACY_KEY_PASSWORD);<NEW_LINE>if (keyPassword.length == 0) {<NEW_LINE>keyPassword = storePassword;<NEW_LINE>}<NEW_LINE>final String storeType = resolveSetting(KEYSTORE_TYPE, Function.identity(), inferKeyStoreType(keyStorePath));<NEW_LINE>final String algorithm = resolveSetting(KEYSTORE_ALGORITHM, Function.identity(), KeyManagerFactory.getDefaultAlgorithm());<NEW_LINE>return new StoreKeyConfig(keyStorePath, storePassword, storeType, keyStoreFilter, keyPassword, algorithm, basePath);<NEW_LINE>}<NEW_LINE>return defaultKeyConfig;<NEW_LINE>}
|
storePassword = resolvePasswordSetting(KEYSTORE_SECURE_PASSWORD, KEYSTORE_LEGACY_PASSWORD);
|
1,138,612
|
boolean catchupPosition(final ExclusivePublication publication, final long leadershipTermId, final long logPosition, final int followerMemberId, final String catchupEndpoint) {<NEW_LINE>if (null == publication) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>final int length = MessageHeaderEncoder.ENCODED_LENGTH + CatchupPositionEncoder.BLOCK_LENGTH + CatchupPositionEncoder.catchupEndpointHeaderLength() + catchupEndpoint.length();<NEW_LINE>int attempts = SEND_ATTEMPTS;<NEW_LINE>do {<NEW_LINE>final long result = <MASK><NEW_LINE>if (result > 0) {<NEW_LINE>catchupPositionEncoder.wrapAndApplyHeader(bufferClaim.buffer(), bufferClaim.offset(), messageHeaderEncoder).leadershipTermId(leadershipTermId).logPosition(logPosition).followerMemberId(followerMemberId).catchupEndpoint(catchupEndpoint);<NEW_LINE>bufferClaim.commit();<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>checkResult(result);<NEW_LINE>} while (--attempts > 0);<NEW_LINE>return false;<NEW_LINE>}
|
publication.tryClaim(length, bufferClaim);
|
1,329,716
|
public static void log(XHook hook, int priority, String msg) {<NEW_LINE>// Check if logging enabled<NEW_LINE>int uid = Process.myUid();<NEW_LINE>if (!mLogDetermined && uid > 0) {<NEW_LINE>mLogDetermined = true;<NEW_LINE>try {<NEW_LINE>mLog = PrivacyManager.getSettingBool(0, PrivacyManager.cSettingLog, false);<NEW_LINE>} catch (Throwable ignored) {<NEW_LINE>mLog = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Log if enabled<NEW_LINE>if (priority != Log.DEBUG && (priority == Log.INFO ? mLog : true))<NEW_LINE>if (hook == null)<NEW_LINE>Log.println(priority, "XPrivacy", msg);<NEW_LINE>else<NEW_LINE>Log.println(priority, String.format("XPrivacy/%s", hook.getClass()<MASK><NEW_LINE>// Report to service<NEW_LINE>if (uid > 0 && priority == Log.ERROR)<NEW_LINE>if (PrivacyService.isRegistered())<NEW_LINE>PrivacyService.reportErrorInternal(msg);<NEW_LINE>else<NEW_LINE>try {<NEW_LINE>IPrivacyService client = PrivacyService.getClient();<NEW_LINE>if (client != null)<NEW_LINE>client.reportError(msg);<NEW_LINE>} catch (RemoteException ignored) {<NEW_LINE>}<NEW_LINE>}
|
.getSimpleName()), msg);
|
1,189,536
|
final UntagResourceResult executeUntagResource(UntagResourceRequest untagResourceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(untagResourceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UntagResourceRequest> request = null;<NEW_LINE>Response<UntagResourceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UntagResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(untagResourceRequest));<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, "Chime SDK Messaging");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UntagResourceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UntagResourceResultJsonUnmarshaller());<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.OPERATION_NAME, "UntagResource");
|
1,541,386
|
public static void main(String[] args) {<NEW_LINE>var context = new ClassPathXmlApplicationContext("applicationContext.xml");<NEW_LINE>var repository = context.getBean(PersonRepository.class);<NEW_LINE>var peter = new <MASK><NEW_LINE>var nasta = new Person("Nasta", "Kuzminova", 25);<NEW_LINE>var john = new Person("John", "lawrence", 35);<NEW_LINE>var terry = new Person("Terry", "Law", 36);<NEW_LINE>// Add new Person records<NEW_LINE>repository.save(peter);<NEW_LINE>repository.save(nasta);<NEW_LINE>repository.save(john);<NEW_LINE>repository.save(terry);<NEW_LINE>// Count Person records<NEW_LINE>LOGGER.info("Count Person records: {}", repository.count());<NEW_LINE>// Print all records<NEW_LINE>var persons = (List<Person>) repository.findAll();<NEW_LINE>persons.stream().map(Person::toString).forEach(LOGGER::info);<NEW_LINE>// Update Person<NEW_LINE>nasta.setName("Barbora");<NEW_LINE>nasta.setSurname("Spotakova");<NEW_LINE>repository.save(nasta);<NEW_LINE>repository.findById(2L).ifPresent(p -> LOGGER.info("Find by id 2: {}", p));<NEW_LINE>// Remove record from Person<NEW_LINE>repository.deleteById(2L);<NEW_LINE>// count records<NEW_LINE>LOGGER.info("Count Person records: {}", repository.count());<NEW_LINE>// find by name<NEW_LINE>repository.findOne(new PersonSpecifications.NameEqualSpec("John")).ifPresent(p -> LOGGER.info("Find by John is {}", p));<NEW_LINE>// find by age<NEW_LINE>persons = repository.findAll(new PersonSpecifications.AgeBetweenSpec(20, 40));<NEW_LINE>LOGGER.info("Find Person with age between 20,40: ");<NEW_LINE>persons.stream().map(Person::toString).forEach(LOGGER::info);<NEW_LINE>repository.deleteAll();<NEW_LINE>context.close();<NEW_LINE>}
|
Person("Peter", "Sagan", 17);
|
90,058
|
public int compareTo(checkTableClass_result other) {<NEW_LINE>if (!getClass().equals(other.getClass())) {<NEW_LINE>return getClass().getName().compareTo(other.getClass().getName());<NEW_LINE>}<NEW_LINE>int lastComparison = 0;<NEW_LINE>lastComparison = java.lang.Boolean.compare(isSetSuccess(<MASK><NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetSuccess()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lastComparison = java.lang.Boolean.compare(isSetSec(), other.isSetSec());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetSec()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sec, other.sec);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lastComparison = java.lang.Boolean.compare(isSetTope(), other.isSetTope());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetTope()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tope, other.tope);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return 0;<NEW_LINE>}
|
), other.isSetSuccess());
|
1,728,875
|
public DataWord shiftRightSigned(DataWord arg) {<NEW_LINE>// Taken from Pantheon implementation<NEW_LINE>// https://github.com/PegaSysEng/pantheon/blob/master/ethereum/core/src/main/java/tech/pegasys/pantheon/ethereum/vm/operations/SarOperation.java<NEW_LINE>if (arg.compareTo(DataWord.valueOf(MAX_POW)) >= 0) {<NEW_LINE>if (this.isNegative()) {<NEW_LINE>// This should be 0xFFFFF......<NEW_LINE>return valueOf(MAX_VALUE);<NEW_LINE>} else {<NEW_LINE>return DataWord.ZERO;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>byte[] bytes = ByteUtil.shiftRight(this.getData(), arg.intValueSafe());<NEW_LINE>if (isNegative()) {<NEW_LINE>byte[] allBits = valueOf(MAX_VALUE).getData();<NEW_LINE>byte[] significantBits = ByteUtil.shiftLeft(allBits, <MASK><NEW_LINE>bytes = ByteUtil.or(bytes, significantBits);<NEW_LINE>}<NEW_LINE>return new DataWord(bytes);<NEW_LINE>}
|
256 - arg.intValueSafe());
|
1,775,682
|
protected void parseCellDataElement(SOAPElement cellDataElement) throws SOAPException {<NEW_LINE>Name name = sf.createName("Cell", "", MDD_URI);<NEW_LINE>Iterator<?> itCells = cellDataElement.getChildElements(name);<NEW_LINE>while (itCells.hasNext()) {<NEW_LINE>SOAPElement cellElement = (SOAPElement) itCells.next();<NEW_LINE>Name errorName = sf.createName("Error", "", MDD_URI);<NEW_LINE>Iterator<?> errorElems = cellElement.getChildElements(errorName);<NEW_LINE>if (errorElems.hasNext()) {<NEW_LINE>handleCellErrors(errorElems);<NEW_LINE>}<NEW_LINE>Name ordinalName = sf.createName("CellOrdinal");<NEW_LINE>String <MASK><NEW_LINE>Object value = null;<NEW_LINE>Iterator<?> valueElements = cellElement.getChildElements(sf.createName("Value", "", MDD_URI));<NEW_LINE>if (valueElements.hasNext()) {<NEW_LINE>SOAPElement valueElement = (SOAPElement) valueElements.next();<NEW_LINE>String valueType = valueElement.getAttribute("xsi:type");<NEW_LINE>if (valueType.equals("xsd:int")) {<NEW_LINE>value = Long.valueOf(valueElement.getValue());<NEW_LINE>} else if (valueType.equals("xsd:double") || valueType.equals("xsd:decimal")) {<NEW_LINE>value = Double.valueOf(valueElement.getValue());<NEW_LINE>} else {<NEW_LINE>value = valueElement.getValue();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String fmtValue = "";<NEW_LINE>Iterator<?> fmtValueElements = cellElement.getChildElements(sf.createName("FmtValue", "", MDD_URI));<NEW_LINE>if (fmtValueElements.hasNext()) {<NEW_LINE>SOAPElement fmtValueElement = ((SOAPElement) fmtValueElements.next());<NEW_LINE>fmtValue = fmtValueElement.getValue();<NEW_LINE>}<NEW_LINE>int pos = Integer.parseInt(cellOrdinal);<NEW_LINE>JRXmlaCell cell = new JRXmlaCell(value, fmtValue);<NEW_LINE>xmlaResult.setCell(cell, pos);<NEW_LINE>}<NEW_LINE>}
|
cellOrdinal = cellElement.getAttributeValue(ordinalName);
|
292,113
|
public JsonNode evaluate(FunctionArgs args, EvaluationContext context) {<NEW_LINE>final String value = valueParam.required(args, context);<NEW_LINE>final String arrayHandler = arrayHandlerParam.required(args, context);<NEW_LINE>try {<NEW_LINE>switch(arrayHandler) {<NEW_LINE>case OPTION_IGNORE:<NEW_LINE>// ignore all top-level arrays<NEW_LINE>return JsonUtils.<MASK><NEW_LINE>case OPTION_JSON:<NEW_LINE>// return top-level arrays as valid JSON strings<NEW_LINE>return JsonUtils.extractJson(value, objectMapper, FLAGS_JSON);<NEW_LINE>case OPTION_FLATTEN:<NEW_LINE>// explode all arrays and objects into top-level key/values<NEW_LINE>return JsonUtils.extractJson(value, objectMapper, FLAGS_FLATTEN);<NEW_LINE>default:<NEW_LINE>LOG.warn("Unknown parameter array_handler: {}", arrayHandler);<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>LOG.warn("Unable to parse JSON", e);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
|
extractJson(value, objectMapper, FLAGS_IGNORE);
|
691,682
|
public static ListRolesResponse unmarshall(ListRolesResponse listRolesResponse, UnmarshallerContext _ctx) {<NEW_LINE>listRolesResponse.setRequestId(_ctx.stringValue("ListRolesResponse.RequestId"));<NEW_LINE>listRolesResponse.setPageSize(_ctx.integerValue("ListRolesResponse.PageSize"));<NEW_LINE>listRolesResponse.setTotalCount(_ctx.integerValue("ListRolesResponse.TotalCount"));<NEW_LINE>listRolesResponse.setPageNumber(_ctx.integerValue("ListRolesResponse.PageNumber"));<NEW_LINE>listRolesResponse.setSuccess(_ctx.booleanValue("ListRolesResponse.Success"));<NEW_LINE>List<SysRoleModel> roles = new ArrayList<SysRoleModel>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListRolesResponse.Roles.Length"); i++) {<NEW_LINE>SysRoleModel sysRoleModel = new SysRoleModel();<NEW_LINE>sysRoleModel.setMerchantId(_ctx.longValue("ListRolesResponse.Roles[" + i + "].MerchantId"));<NEW_LINE>sysRoleModel.setRoleId(_ctx.integerValue("ListRolesResponse.Roles[" + i + "].RoleId"));<NEW_LINE>sysRoleModel.setRemark(_ctx.stringValue("ListRolesResponse.Roles[" + i + "].Remark"));<NEW_LINE>sysRoleModel.setName(_ctx.stringValue("ListRolesResponse.Roles[" + i + "].Name"));<NEW_LINE>sysRoleModel.setStatus(_ctx.integerValue("ListRolesResponse.Roles[" + i + "].Status"));<NEW_LINE>List<BaseModel> apis = new ArrayList<BaseModel>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("ListRolesResponse.Roles[" + i + "].Apis.Length"); j++) {<NEW_LINE>BaseModel baseModel = new BaseModel();<NEW_LINE>baseModel.setId(_ctx.integerValue("ListRolesResponse.Roles[" + i + "].Apis[" + j + "].Id"));<NEW_LINE>baseModel.setName(_ctx.stringValue("ListRolesResponse.Roles[" + i + "].Apis[" + j + "].Name"));<NEW_LINE>baseModel.setCode(_ctx.stringValue("ListRolesResponse.Roles[" + i + "].Apis[" + j + "].Code"));<NEW_LINE>apis.add(baseModel);<NEW_LINE>}<NEW_LINE>sysRoleModel.setApis(apis);<NEW_LINE>List<BaseModel> menus = new ArrayList<BaseModel>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("ListRolesResponse.Roles[" + i + "].Menus.Length"); j++) {<NEW_LINE>BaseModel baseModel_ = new BaseModel();<NEW_LINE>baseModel_.setId(_ctx.integerValue("ListRolesResponse.Roles[" + i + "].Menus[" + j + "].Id"));<NEW_LINE>baseModel_.setName(_ctx.stringValue("ListRolesResponse.Roles[" + i + "].Menus[" + j + "].Name"));<NEW_LINE>baseModel_.setCode(_ctx.stringValue("ListRolesResponse.Roles[" + i <MASK><NEW_LINE>menus.add(baseModel_);<NEW_LINE>}<NEW_LINE>sysRoleModel.setMenus(menus);<NEW_LINE>roles.add(sysRoleModel);<NEW_LINE>}<NEW_LINE>listRolesResponse.setRoles(roles);<NEW_LINE>return listRolesResponse;<NEW_LINE>}
|
+ "].Menus[" + j + "].Code"));
|
1,639,257
|
public Result syncBackups() throws Exception {<NEW_LINE>Http.MultipartFormData<Files.TemporaryFile> body = request().body().asMultipartFormData();<NEW_LINE>Map<String, String[]> reqParams = body.asFormUrlEncoded();<NEW_LINE>String[] leaders = reqParams.getOrDefault("leader", new String[0]);<NEW_LINE>String[] senders = reqParams.getOrDefault("sender", new String[0]);<NEW_LINE>if (reqParams.size() != 2 || leaders.length != 1 || senders.length != 1) {<NEW_LINE>return ApiResponse.error(BAD_REQUEST, "Expected exactly 2 (leader and sender) argument in 'application/x-www-form-urlencoded' " + "data part. Received: " + reqParams);<NEW_LINE>}<NEW_LINE>Http.MultipartFormData.FilePart<Files.TemporaryFile> filePart = body.getFile("backup");<NEW_LINE>if (filePart == null) {<NEW_LINE>return ApiResponse.error(BAD_REQUEST, "backup file not found in request");<NEW_LINE>}<NEW_LINE>String fileName = filePart.getFilename();<NEW_LINE>File temporaryFile = (File) filePart.getFile();<NEW_LINE>String leader = leaders[0];<NEW_LINE>String sender = senders[0];<NEW_LINE>if (!leader.equals(sender)) {<NEW_LINE>return ApiResponse.error(BAD_REQUEST, "Sender: " + sender + " does not match leader: " + leader);<NEW_LINE>}<NEW_LINE>Optional<HighAvailabilityConfig> config = HighAvailabilityConfig.getByClusterKey(this.getClusterKey());<NEW_LINE>if (!config.isPresent()) {<NEW_LINE>return <MASK><NEW_LINE>}<NEW_LINE>Optional<PlatformInstance> localInstance = config.get().getLocal();<NEW_LINE>if (localInstance.isPresent() && leader.equals(localInstance.get().getAddress())) {<NEW_LINE>return ApiResponse.error(BAD_REQUEST, "Backup originated on the node itself. Leader: " + leader);<NEW_LINE>}<NEW_LINE>URL leaderUrl = new URL(leader);<NEW_LINE>// For all the other cases we will accept the backup without checking local config state.<NEW_LINE>boolean success = replicationManager.saveReplicationData(fileName, temporaryFile, leaderUrl, new URL(sender));<NEW_LINE>if (success) {<NEW_LINE>// TODO: (Daniel) - Need to cleanup backups in non-current leader dir too.<NEW_LINE>replicationManager.cleanupReceivedBackups(leaderUrl);<NEW_LINE>return YBPSuccess.withMessage("File uploaded");<NEW_LINE>} else {<NEW_LINE>return ApiResponse.error(INTERNAL_SERVER_ERROR, "failed to copy backup");<NEW_LINE>}<NEW_LINE>}
|
ApiResponse.error(BAD_REQUEST, "Could not find HA Config");
|
617,006
|
public OffsetMap fetchOffset(org.apache.kafka.clients.consumer.KafkaConsumer<?, ?> consumer, String topic) {<NEW_LINE>OffsetMap offsetMap = new OffsetMap();<NEW_LINE>List<TopicPartition> topicPartitions = new ArrayList<>();<NEW_LINE>consumer.subscribe(Collections.singleton(topic));<NEW_LINE>List<PartitionInfo> partitionInfos = consumer.partitionsFor(topic);<NEW_LINE>partitionInfos.forEach(item -> topicPartitions.add(new TopicPartition(topic, item.partition())));<NEW_LINE>Map<TopicPartition, Long> beginningOffsets = consumer.beginningOffsets(topicPartitions);<NEW_LINE>beginningOffsets.keySet().forEach(item -> offsetMap.setEarliest(new KafkaTopicPartition(topic, item.partition()), beginningOffsets.get(item)));<NEW_LINE>Map<TopicPartition, Long> endOffsets = consumer.endOffsets(topicPartitions);<NEW_LINE>endOffsets.keySet().forEach(item -> offsetMap.setLatest(new KafkaTopicPartition(topic, item.partition()), <MASK><NEW_LINE>return offsetMap;<NEW_LINE>}
|
endOffsets.get(item)));
|
1,542,295
|
protected void encode(ChannelHandlerContext ctx, ByteBuf in, ByteBuf out) throws Exception {<NEW_LINE>final int length = in.readableBytes();<NEW_LINE>final int idx = in.readerIndex();<NEW_LINE>final byte[] input;<NEW_LINE>final int inputPtr;<NEW_LINE>if (in.hasArray()) {<NEW_LINE>input = in.array();<NEW_LINE>inputPtr <MASK><NEW_LINE>} else {<NEW_LINE>input = recycler.allocInputBuffer(length);<NEW_LINE>in.getBytes(idx, input, 0, length);<NEW_LINE>inputPtr = 0;<NEW_LINE>}<NEW_LINE>// Estimate may apparently under-count by one in some cases.<NEW_LINE>final int maxOutputLength = LZFEncoder.estimateMaxWorkspaceSize(length) + 1;<NEW_LINE>out.ensureWritable(maxOutputLength);<NEW_LINE>final byte[] output;<NEW_LINE>final int outputPtr;<NEW_LINE>if (out.hasArray()) {<NEW_LINE>output = out.array();<NEW_LINE>outputPtr = out.arrayOffset() + out.writerIndex();<NEW_LINE>} else {<NEW_LINE>output = new byte[maxOutputLength];<NEW_LINE>outputPtr = 0;<NEW_LINE>}<NEW_LINE>final int outputLength;<NEW_LINE>if (length >= compressThreshold) {<NEW_LINE>// compress.<NEW_LINE>outputLength = encodeCompress(input, inputPtr, length, output, outputPtr);<NEW_LINE>} else {<NEW_LINE>// not compress.<NEW_LINE>outputLength = encodeNonCompress(input, inputPtr, length, output, outputPtr);<NEW_LINE>}<NEW_LINE>if (out.hasArray()) {<NEW_LINE>out.writerIndex(out.writerIndex() + outputLength);<NEW_LINE>} else {<NEW_LINE>out.writeBytes(output, 0, outputLength);<NEW_LINE>}<NEW_LINE>in.skipBytes(length);<NEW_LINE>if (!in.hasArray()) {<NEW_LINE>recycler.releaseInputBuffer(input);<NEW_LINE>}<NEW_LINE>}
|
= in.arrayOffset() + idx;
|
1,425,434
|
public void prepare(FilenameAndScaleHolder filenameAndScaleHolder) {<NEW_LINE>this.filenameAndScaleHolder = filenameAndScaleHolder;<NEW_LINE>setHeader("Export Diagram");<NEW_LINE>FlowPanel panel = new FlowPanel();<NEW_LINE>HTML w = new HTML("Optionally set a filename");<NEW_LINE>panel.add(w);<NEW_LINE>final TextBox textBox = new TextBox();<NEW_LINE>panel.add(textBox);<NEW_LINE>// handle scaling<NEW_LINE>HTML scaleHtml = new HTML("Set scaling of Image file:");<NEW_LINE>panel.add(scaleHtml);<NEW_LINE>final TextBox scaleBox = new TextBox();<NEW_LINE>panel.add(scaleBox);<NEW_LINE>scaleBox.setValue("1.0");<NEW_LINE>filenameAndScaleHolder.setScaling(1d);<NEW_LINE>textBox.setValue(filenameAndScaleHolder.getFilename());<NEW_LINE>Button bFile = new Button("Save Diagram File", buttonClickHandler(DownloadType.UXF));<NEW_LINE>Button bPNG = new Button("Save PNG File", buttonClickHandler(DownloadType.PNG));<NEW_LINE>Button bPDF = new Button("Save PDF File", buttonClickHandler(DownloadType.PDF));<NEW_LINE>setButtonStyle(bFile.getElement().getStyle());<NEW_LINE>setButtonStyle(bPNG.getElement().getStyle());<NEW_LINE>setButtonStyle(bPDF.getElement().getStyle());<NEW_LINE>panel.add(bFile);<NEW_LINE>panel.add(bPNG);<NEW_LINE>panel.add(bPDF);<NEW_LINE>setWidget(panel);<NEW_LINE>// listen to all input events from the browser (http://stackoverflow.com/a/43089693)<NEW_LINE>textBox.addDomHandler(new InputHandler() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onInput(InputEvent event) {<NEW_LINE>filenameAndScaleHolder.<MASK><NEW_LINE>}<NEW_LINE>}, InputEvent.getType());<NEW_LINE>scaleBox.addDomHandler(new InputHandler() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onInput(InputEvent event) {<NEW_LINE>try {<NEW_LINE>double scalingValue = Double.parseDouble(scaleBox.getValue());<NEW_LINE>if (scalingValue <= 0)<NEW_LINE>throw new Exception();<NEW_LINE>filenameAndScaleHolder.setScaling(scalingValue);<NEW_LINE>} catch (Exception e) {<NEW_LINE>// wrong scaling value, just default to standard<NEW_LINE>filenameAndScaleHolder.setScaling(1.0d);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}, InputEvent.getType());<NEW_LINE>}
|
setFilename(textBox.getText());
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.