idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
1,081,433
public DateType invoke() {<NEW_LINE>if (!SQLDataTypeImpl.class.isInstance(dataType)) {<NEW_LINE>return this;<NEW_LINE>}<NEW_LINE>String[<MASK><NEW_LINE>String name = dataType.getName();<NEW_LINE>String dataTypeString = null;<NEW_LINE>if (signed[1].equalsIgnoreCase(name)) {<NEW_LINE>if (!dataType.isUnsigned()) {<NEW_LINE>dataTypeString = signed[1];<NEW_LINE>} else {<NEW_LINE>dataTypeString = signed[0];<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>dataTypeString = name.toUpperCase();<NEW_LINE>}<NEW_LINE>if (dataType.isZerofill()) {<NEW_LINE>// Nothing<NEW_LINE>}<NEW_LINE>final List<SQLExpr> arguments = dataType.getArguments();<NEW_LINE>if (arguments.size() > 0) {<NEW_LINE>final SQLExpr sqlExpr = arguments.get(0);<NEW_LINE>if (sqlExpr instanceof SQLIntegerExpr) {<NEW_LINE>final Number number = ((SQLIntegerExpr) sqlExpr).getNumber();<NEW_LINE>this.p = number.intValue();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>SqlTypeName castType = SqlTypeName.getNameForJdbcType(TypeUtils.mysqlTypeToJdbcType(dataTypeString));<NEW_LINE>setPAndC(castType);<NEW_LINE>setCharset();<NEW_LINE>return this;<NEW_LINE>}
] signed = { "UNSIGNED", "SIGNED" };
1,010,785
public PreloadIconDrawable applyProgressLevel() {<NEW_LINE>if (!(getTag() instanceof ItemInfoWithIcon)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>ItemInfoWithIcon info = (ItemInfoWithIcon) getTag();<NEW_LINE>int progressLevel = info.getProgressLevel();<NEW_LINE>if (progressLevel >= 100) {<NEW_LINE>setContentDescription(info.contentDescription != <MASK><NEW_LINE>} else if (progressLevel > 0) {<NEW_LINE>setDownloadStateContentDescription(info, progressLevel);<NEW_LINE>} else {<NEW_LINE>setContentDescription(getContext().getString(R.string.app_waiting_download_title, info.title));<NEW_LINE>}<NEW_LINE>if (mIcon != null) {<NEW_LINE>PreloadIconDrawable preloadIconDrawable;<NEW_LINE>if (mIcon instanceof PreloadIconDrawable) {<NEW_LINE>preloadIconDrawable = (PreloadIconDrawable) mIcon;<NEW_LINE>preloadIconDrawable.setLevel(progressLevel);<NEW_LINE>preloadIconDrawable.setIsDisabled(!info.isAppStartable());<NEW_LINE>} else {<NEW_LINE>preloadIconDrawable = makePreloadIcon();<NEW_LINE>setIcon(preloadIconDrawable);<NEW_LINE>}<NEW_LINE>return preloadIconDrawable;<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
null ? info.contentDescription : "");
535,936
private static void tryAssertion15_16(RegressionEnvironment env, String stmtText, String outputLimit, AtomicInteger milestone) {<NEW_LINE>sendTimer(env, 0);<NEW_LINE>env.compileDeploy(stmtText).addListener("s0");<NEW_LINE>String[] fields = new String[] { "symbol", "volume", "sum(price)" };<NEW_LINE>ResultAssertTestResult expected = new ResultAssertTestResult(CATEGORY, outputLimit, fields);<NEW_LINE>expected.addResultInsRem(<MASK><NEW_LINE>expected.addResultInsert(2200, 0, new Object[][] { { "IBM", 155L, 75d } });<NEW_LINE>expected.addResultInsRem(3200, 0, null, null);<NEW_LINE>expected.addResultInsRem(4200, 0, null, null);<NEW_LINE>expected.addResultInsert(5200, 0, new Object[][] { { "IBM", 150L, 97d } });<NEW_LINE>expected.addResultInsRem(6200, 0, null, new Object[][] { { "IBM", 100L, 72d } });<NEW_LINE>expected.addResultInsRem(7200, 0, null, null);<NEW_LINE>ResultAssertExecution execution = new ResultAssertExecution(stmtText, env, expected);<NEW_LINE>execution.execute(false, milestone);<NEW_LINE>}
1200, 0, null, null);
1,762,127
private static FileObject copyFolderRecursively(final FileObject sourceFolder, final FileObject destination) throws IOException {<NEW_LINE>FileUtil.runAtomicAction(new FileSystem.AtomicAction() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() throws IOException {<NEW_LINE>assert sourceFolder.isFolder() : sourceFolder;<NEW_LINE>assert destination.isFolder() : destination;<NEW_LINE>FileObject destinationSubFolder = destination.getFileObject(sourceFolder.getName());<NEW_LINE>if (destinationSubFolder == null) {<NEW_LINE>destinationSubFolder = destination.<MASK><NEW_LINE>}<NEW_LINE>for (FileObject fo : sourceFolder.getChildren()) {<NEW_LINE>if (fo.isFolder()) {<NEW_LINE>copyFolderRecursively(fo, destinationSubFolder);<NEW_LINE>} else {<NEW_LINE>FileObject foExists = destinationSubFolder.getFileObject(fo.getName(), fo.getExt());<NEW_LINE>if (foExists != null) {<NEW_LINE>foExists.delete();<NEW_LINE>}<NEW_LINE>FileUtil.copyFile(fo, destinationSubFolder, fo.getName(), fo.getExt());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return destination.getFileObject(sourceFolder.getName());<NEW_LINE>}
createFolder(sourceFolder.getName());
776,420
public static void createSpnegoSPNEntry() throws Exception {<NEW_LINE>String methodName = "createSpnegoSPNEntry";<NEW_LINE>Log.info(c, methodName, "Creating KDC user entries");<NEW_LINE>session = kdcServer<MASK><NEW_LINE>// spnego HTTP service<NEW_LINE>Entry entry = new DefaultEntry(session.getDirectoryService().getSchemaManager());<NEW_LINE>entry.setDn(spnegoUserDN);<NEW_LINE>entry.add("objectClass", "top", "person", "inetOrgPerson", "krb5principal", "krb5kdcentry");<NEW_LINE>entry.add("cn", "HTTP");<NEW_LINE>entry.add("sn", "Service");<NEW_LINE>entry.add("uid", "HTTP");<NEW_LINE>entry.add("userPassword", SPN_PASSWORD);<NEW_LINE>entry.add("krb5PrincipalName", SPN);<NEW_LINE>entry.add("krb5KeyVersionNumber", "0");<NEW_LINE>session.add(entry);<NEW_LINE>Log.info(c, methodName, "Created " + entry.getDn());<NEW_LINE>}
.getDirectoryService().getAdminSession();
623,417
public MutableBooleanCollection select(BooleanPredicate predicate) {<NEW_LINE>MutableBooleanList result = BooleanLists.mutable.empty();<NEW_LINE>if (this.getSentinelValues() != null) {<NEW_LINE>if (this.getSentinelValues().containsZeroKey && predicate.accept(this.getSentinelValues().zeroValue)) {<NEW_LINE>result.add(this.getSentinelValues().zeroValue);<NEW_LINE>}<NEW_LINE>if (this.getSentinelValues().containsOneKey && predicate.accept(this.getSentinelValues().oneValue)) {<NEW_LINE>result.add(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int i = 0; i < this.getTableSize(); i++) {<NEW_LINE>if (this.isNonSentinelAtIndex(i) && predicate.accept(this.getValueAtIndex(i))) {<NEW_LINE>result.add(this.getValueAtIndex(i));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
this.getSentinelValues().oneValue);
990,173
public int readinto(PyObject buf) {<NEW_LINE>if (buf instanceof PyArray) {<NEW_LINE>// PyArray has the buffer interface (for bytes) but this way we can read any type<NEW_LINE>PyArray array = (PyArray) buf;<NEW_LINE>String read = read(array.__len__() * array.getItemsize());<NEW_LINE>array.fromstring(0, read);<NEW_LINE>return read.length();<NEW_LINE>} else if (buf instanceof BufferProtocol) {<NEW_LINE>try (PyBuffer view = ((BufferProtocol) buf).getBuffer(PyBUF.FULL_RO)) {<NEW_LINE>if (view.isReadonly()) {<NEW_LINE>// More helpful than falling through to CPython message<NEW_LINE>throw Py.TypeError("cannot read into read-only " + buf.getType().fastGetName());<NEW_LINE>} else {<NEW_LINE>// Inefficiently, we have to go via a String<NEW_LINE>String read = <MASK><NEW_LINE>int n = read.length();<NEW_LINE>for (int i = 0; i < n; i++) {<NEW_LINE>view.storeAt((byte) read.charAt(i), i);<NEW_LINE>}<NEW_LINE>return read.length();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// No valid alternative worked<NEW_LINE>throw Py.TypeError("argument 1 must be read-write buffer, not " + buf.getType().fastGetName());<NEW_LINE>}
read(view.getLen());
1,323,022
private void readReplicaVersions() {<NEW_LINE>InternalPartitionServiceImpl partitionService = getService();<NEW_LINE>OperationService operationService = getNodeEngine().getOperationService();<NEW_LINE>PartitionReplicaVersionManager versionManager = partitionService.getPartitionReplicaVersionManager();<NEW_LINE>UrgentPartitionRunnable<Void> gatherReplicaVersionsRunnable = new UrgentPartitionRunnable<>(partitionId(), () -> {<NEW_LINE>for (ServiceNamespace ns : namespaces) {<NEW_LINE>// make a copy because<NEW_LINE>// getPartitionReplicaVersions<NEW_LINE>// returns references to the internal<NEW_LINE>// replica versions data structures<NEW_LINE>// that may change under our feet<NEW_LINE>long[] versions = Arrays.copyOf(versionManager.getPartitionReplicaVersions(partitionId()<MASK><NEW_LINE>replicaVersions.put(BiTuple.of(partitionId(), ns), versions);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>operationService.execute(gatherReplicaVersionsRunnable);<NEW_LINE>gatherReplicaVersionsRunnable.future.joinInternal();<NEW_LINE>}
, ns), IPartition.MAX_BACKUP_COUNT);
872,389
public void savePoiFilter() {<NEW_LINE>AlertDialog.Builder builder = new AlertDialog.Builder(this);<NEW_LINE>builder.setTitle(R.string.edit_filter_save_as_menu_item);<NEW_LINE>final EditText editText = new EditText(this);<NEW_LINE>if (filter.isStandardFilter()) {<NEW_LINE>editText.setText((filter.getName() + " " + searchFilter.getText()).trim());<NEW_LINE>} else {<NEW_LINE>editText.setText(filter.getName());<NEW_LINE>}<NEW_LINE>LinearLayout ll = new LinearLayout(this);<NEW_LINE>ll.setPadding(5, 3, 5, 0);<NEW_LINE>ll.addView(editText, new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));<NEW_LINE>builder.setView(ll);<NEW_LINE>builder.setNegativeButton(R.string.shared_string_cancel, null);<NEW_LINE>builder.setPositiveButton(R.string.shared_string_yes, new DialogInterface.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(DialogInterface dialog, int which) {<NEW_LINE>PoiUIFilter nFilter = new PoiUIFilter(editText.getText().toString(), null, filter.getAcceptedTypes()<MASK><NEW_LINE>if (searchFilter.getText().toString().length() > 0) {<NEW_LINE>nFilter.setSavedFilterByName(searchFilter.getText().toString());<NEW_LINE>}<NEW_LINE>if (app.getPoiFilters().createPoiFilter(nFilter, false)) {<NEW_LINE>Toast.makeText(SearchPOIActivity.this, MessageFormat.format(SearchPOIActivity.this.getText(R.string.edit_filter_create_message).toString(), editText.getText().toString()), Toast.LENGTH_SHORT).show();<NEW_LINE>}<NEW_LINE>SearchPOIActivity.this.finish();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>builder.create().show();<NEW_LINE>}
, (OsmandApplication) getApplication());
1,478,125
private static String[] formatPathSegments(String[] segments, int index, String groupName) {<NEW_LINE>String[] nameSegments = groupName.split("/");<NEW_LINE>if (nameSegments.length > 1 && segments.length >= nameSegments.length) {<NEW_LINE>for (int i = 0; i < nameSegments.length; i++) {<NEW_LINE>if (!nameSegments[i].equals(segments[index + i])) {<NEW_LINE>return segments;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int numMergedIndexes = nameSegments.length - 1;<NEW_LINE>String[] newPath = new <MASK><NEW_LINE>for (int i = 0; i < newPath.length; i++) {<NEW_LINE>if (i == index) {<NEW_LINE>newPath[i] = groupName;<NEW_LINE>} else if (i > index) {<NEW_LINE>newPath[i] = segments[i + numMergedIndexes];<NEW_LINE>} else {<NEW_LINE>newPath[i] = segments[i];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return newPath;<NEW_LINE>}<NEW_LINE>return segments;<NEW_LINE>}
String[segments.length - numMergedIndexes];
1,493,786
private String updateContainer(MetadataContainer container, String parentGUID, String anchorGUID, boolean bNested, String parentQName, Map<String, EntityDetail> assetEntities) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException {<NEW_LINE>String methodName = "updateContainer";<NEW_LINE>String qualifiedName = QualifiedNameUtils.buildQualifiedName(parentQName, IdMap.SCHEMA_ATTRIBUTE_TYPE_NAME, container.getIdentifier());<NEW_LINE>SoftwareServerCapability ssc = ctx.getServerSoftwareCapability();<NEW_LINE>container.setQualifiedName(qualifiedName);<NEW_LINE>EntityDetail entity = assetEntities.remove(qualifiedName);<NEW_LINE>if (entity == null) {<NEW_LINE>// new container<NEW_LINE>return createContainer(container, parentGUID, anchorGUID, bNested, parentQName);<NEW_LINE>}<NEW_LINE>AnalyticsMetadata containerOld = analyticsMetadataConverter.getNewBean(entity, methodName);<NEW_LINE>AnalyticsMetadataConverter.prepareAnalyticsMetadataProperties(container);<NEW_LINE>if (!container.equals(containerOld)) {<NEW_LINE>metadataHandler.updateSchemaAttribute(ctx.getUserId(), ssc.getGUID(), ssc.getSource(), entity.getGUID(), createAnalyticsMetadataBuilder(container, null, <MASK><NEW_LINE>}<NEW_LINE>// update nested containers<NEW_LINE>if (container.getContainer() != null) {<NEW_LINE>verifyOrder(container.getContainer());<NEW_LINE>for (MetadataContainer subContainer : container.getContainer()) {<NEW_LINE>updateContainer(subContainer, entity.getGUID(), anchorGUID, true, qualifiedName, assetEntities);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// update items<NEW_LINE>updateItems(container.getItem(), entity.getGUID(), anchorGUID, true, qualifiedName, assetEntities);<NEW_LINE>return entity.getGUID();<NEW_LINE>}
false).getInstanceProperties(methodName));
526,210
public void run(RegressionEnvironment env) {<NEW_LINE>String stmtTextSet = "@name('set') on SupportBean set var1OND = intPrimitive, var2OND = var1OND + 1, var3OND = var1OND + var2OND";<NEW_LINE>env.compileDeploy(stmtTextSet).addListener("set");<NEW_LINE>String[] fieldsVar = new String[<MASK><NEW_LINE>env.assertPropsPerRowIterator("set", fieldsVar, new Object[][] { { 12, 2, null } });<NEW_LINE>sendSupportBean(env, "S1", 3);<NEW_LINE>env.assertPropsNew("set", fieldsVar, new Object[] { 3, 4, 7 });<NEW_LINE>env.assertPropsPerRowIterator("set", fieldsVar, new Object[][] { { 3, 4, 7 } });<NEW_LINE>env.milestone(0);<NEW_LINE>sendSupportBean(env, "S1", -1);<NEW_LINE>env.assertPropsNew("set", fieldsVar, new Object[] { -1, 0, -1 });<NEW_LINE>env.assertPropsPerRowIterator("set", fieldsVar, new Object[][] { { -1, 0, -1 } });<NEW_LINE>sendSupportBean(env, "S1", 90);<NEW_LINE>env.assertPropsNew("set", fieldsVar, new Object[] { 90, 91, 181 });<NEW_LINE>env.assertPropsPerRowIterator("set", fieldsVar, new Object[][] { { 90, 91, 181 } });<NEW_LINE>env.undeployAll();<NEW_LINE>}
] { "var1OND", "var2OND", "var3OND" };
279,033
protected void masterOperation(final ClusterSearchShardsRequest request, final ClusterState state, final ActionListener<ClusterSearchShardsResponse> listener) {<NEW_LINE><MASK><NEW_LINE>String[] concreteIndices = indexNameExpressionResolver.concreteIndexNames(clusterState, request);<NEW_LINE>Map<String, Set<String>> routingMap = indexNameExpressionResolver.resolveSearchRouting(state, request.routing(), request.indices());<NEW_LINE>Map<String, AliasFilter> indicesAndFilters = new HashMap<>();<NEW_LINE>Set<String> indicesAndAliases = indexNameExpressionResolver.resolveExpressions(clusterState, request.indices());<NEW_LINE>for (String index : concreteIndices) {<NEW_LINE>final AliasFilter aliasFilter = indicesService.buildAliasFilter(clusterState, index, indicesAndAliases);<NEW_LINE>final String[] aliases = indexNameExpressionResolver.indexAliases(clusterState, index, aliasMetadata -> true, true, indicesAndAliases);<NEW_LINE>indicesAndFilters.put(index, new AliasFilter(aliasFilter.getQueryBuilder(), aliases));<NEW_LINE>}<NEW_LINE>Set<String> nodeIds = new HashSet<>();<NEW_LINE>GroupShardsIterator<ShardIterator> groupShardsIterator = clusterService.operationRouting().searchShards(clusterState, concreteIndices, routingMap, request.preference());<NEW_LINE>ShardRouting shard;<NEW_LINE>ClusterSearchShardsGroup[] groupResponses = new ClusterSearchShardsGroup[groupShardsIterator.size()];<NEW_LINE>int currentGroup = 0;<NEW_LINE>for (ShardIterator shardIt : groupShardsIterator) {<NEW_LINE>ShardId shardId = shardIt.shardId();<NEW_LINE>ShardRouting[] shardRoutings = new ShardRouting[shardIt.size()];<NEW_LINE>int currentShard = 0;<NEW_LINE>shardIt.reset();<NEW_LINE>while ((shard = shardIt.nextOrNull()) != null) {<NEW_LINE>shardRoutings[currentShard++] = shard;<NEW_LINE>nodeIds.add(shard.currentNodeId());<NEW_LINE>}<NEW_LINE>groupResponses[currentGroup++] = new ClusterSearchShardsGroup(shardId, shardRoutings);<NEW_LINE>}<NEW_LINE>DiscoveryNode[] nodes = new DiscoveryNode[nodeIds.size()];<NEW_LINE>int currentNode = 0;<NEW_LINE>for (String nodeId : nodeIds) {<NEW_LINE>nodes[currentNode++] = clusterState.getNodes().get(nodeId);<NEW_LINE>}<NEW_LINE>listener.onResponse(new ClusterSearchShardsResponse(groupResponses, nodes, indicesAndFilters));<NEW_LINE>}
ClusterState clusterState = clusterService.state();
240,741
private Optional<HttpResponse<Buffer>> respondFromCache(HttpContext<Buffer> context, CachedHttpResponse response) {<NEW_LINE>if (response == null) {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>HttpResponse<Buffer<MASK><NEW_LINE>result.headers().set(HttpHeaders.AGE, Long.toString(response.age()));<NEW_LINE>if (response.getCacheControl().noCache()) {<NEW_LINE>// We must validate with the server before releasing the cached data<NEW_LINE>markForRevalidation(context, response);<NEW_LINE>return Optional.empty();<NEW_LINE>} else if (response.isFresh()) {<NEW_LINE>// Response is current, reply with it immediately<NEW_LINE>return Optional.of(result);<NEW_LINE>} else if (response.useStaleWhileRevalidate()) {<NEW_LINE>// Send off a request to revalidate the cache but don't want for a response, just respond<NEW_LINE>// immediately with the cached value.<NEW_LINE>context.clientRequest().send();<NEW_LINE>return Optional.of(result);<NEW_LINE>} else {<NEW_LINE>// Can't use the response as-is, fetch updated information before responding<NEW_LINE>markForRevalidation(context, response);<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>}
> result = response.rehydrate();
140,300
public ValueVector visit(FixedSizeListVector deltaVector, Void value) {<NEW_LINE>Preconditions.checkArgument(typeVisitor.equals(deltaVector), "The vector to append must have the same type as the targetVector being appended");<NEW_LINE>if (deltaVector.getValueCount() == 0) {<NEW_LINE>// optimization, nothing to append, return<NEW_LINE>return targetVector;<NEW_LINE>}<NEW_LINE>FixedSizeListVector targetListVector = (FixedSizeListVector) targetVector;<NEW_LINE>Preconditions.checkArgument(targetListVector.getListSize() == deltaVector.getListSize(), "FixedSizeListVector must have the same list size to append");<NEW_LINE>int newValueCount = targetVector.getValueCount() + deltaVector.getValueCount();<NEW_LINE>int targetListSize = targetListVector.getValueCount() * targetListVector.getListSize();<NEW_LINE>int deltaListSize = deltaVector.getValueCount() * deltaVector.getListSize();<NEW_LINE>// make sure the underlying vector has value count set<NEW_LINE>targetListVector.getDataVector().setValueCount(targetListSize);<NEW_LINE>deltaVector.<MASK><NEW_LINE>// make sure there is enough capacity<NEW_LINE>while (targetVector.getValueCapacity() < newValueCount) {<NEW_LINE>targetVector.reAlloc();<NEW_LINE>}<NEW_LINE>// append validity buffer<NEW_LINE>BitVectorHelper.concatBits(targetVector.getValidityBuffer(), targetVector.getValueCount(), deltaVector.getValidityBuffer(), deltaVector.getValueCount(), targetVector.getValidityBuffer());<NEW_LINE>// append underlying vectors<NEW_LINE>VectorAppender innerAppender = new VectorAppender(targetListVector.getDataVector());<NEW_LINE>deltaVector.getDataVector().accept(innerAppender, null);<NEW_LINE>targetVector.setValueCount(newValueCount);<NEW_LINE>return targetVector;<NEW_LINE>}
getDataVector().setValueCount(deltaListSize);
1,765,350
public void onMessage(quickfix.fix40.NewOrderSingle order, SessionID sessionID) throws FieldNotFound, UnsupportedMessageType, IncorrectTagValue {<NEW_LINE>try {<NEW_LINE>validateOrder(order);<NEW_LINE>OrderQty orderQty = order.getOrderQty();<NEW_LINE>Price price = getPrice(order);<NEW_LINE>quickfix.fix40.ExecutionReport accept = new quickfix.fix40.ExecutionReport(genOrderID(), genExecID(), new ExecTransType(ExecTransType.NEW), new OrdStatus(OrdStatus.NEW), order.getSymbol(), order.getSide(), orderQty, new LastShares(0), new LastPx(0), new CumQty(0<MASK><NEW_LINE>accept.set(order.getClOrdID());<NEW_LINE>sendMessage(sessionID, accept);<NEW_LINE>if (isOrderExecutable(order, price)) {<NEW_LINE>quickfix.fix40.ExecutionReport fill = new quickfix.fix40.ExecutionReport(genOrderID(), genExecID(), new ExecTransType(ExecTransType.NEW), new OrdStatus(OrdStatus.FILLED), order.getSymbol(), order.getSide(), orderQty, new LastShares(orderQty.getValue()), new LastPx(price.getValue()), new CumQty(orderQty.getValue()), new AvgPx(price.getValue()));<NEW_LINE>fill.set(order.getClOrdID());<NEW_LINE>sendMessage(sessionID, fill);<NEW_LINE>}<NEW_LINE>} catch (RuntimeException e) {<NEW_LINE>LogUtil.logThrowable(sessionID, e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
), new AvgPx(0));
880,185
private Set<ModuleLocation> moduleLocations(final Location baseLocation) {<NEW_LINE>if (!forLocation.equals(baseLocation)) {<NEW_LINE>throw new IllegalStateException(// NOI18N<NEW_LINE>String.// NOI18N<NEW_LINE>format("Locations computed for: %s, but queried for: %s", forLocation, baseLocation));<NEW_LINE>}<NEW_LINE>if (moduleLocations == null) {<NEW_LINE>final Set<ModuleLocation> moduleRoots = new HashSet<>();<NEW_LINE>final Set<URL> seen = new HashSet<>();<NEW_LINE>for (ClassPath.Entry e : modulePath.entries()) {<NEW_LINE>final URL root = e.getURL();<NEW_LINE>if (!seen.contains(root)) {<NEW_LINE>final String moduleName = SourceUtils.getModuleName(root);<NEW_LINE>if (moduleName != null) {<NEW_LINE>Collection<? extends URL> p = peers.apply(root);<NEW_LINE>moduleRoots.add(ModuleLocation.create<MASK><NEW_LINE>seen.addAll(p);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>moduleLocations = moduleRoots;<NEW_LINE>}<NEW_LINE>return moduleLocations;<NEW_LINE>}
(baseLocation, p, moduleName));
540,206
void logTrailer(long seqId, String serviceName, String methodName, Status status, Metadata metadata, int maxHeaderBytes, GrpcLogRecord.EventLogger eventLogger, String rpcId, @Nullable SocketAddress peerAddress) {<NEW_LINE>checkNotNull(serviceName, "serviceName");<NEW_LINE>checkNotNull(methodName, "methodName");<NEW_LINE>checkNotNull(status, "status");<NEW_LINE>checkNotNull(rpcId, "rpcId");<NEW_LINE>checkArgument(peerAddress == null || eventLogger == GrpcLogRecord.EventLogger.LOGGER_CLIENT, "peerAddress can only be specified for client");<NEW_LINE>PayloadBuilder<GrpcLogRecord.Metadata.Builder> pair = createMetadataProto(metadata, maxHeaderBytes);<NEW_LINE>GrpcLogRecord.Builder logEntryBuilder = createTimestamp().setSequenceId(seqId).setServiceName(serviceName).setMethodName(methodName).setEventType(EventType.GRPC_CALL_TRAILER).setEventLogger(eventLogger).setLogLevel(LogLevel.LOG_LEVEL_DEBUG).setMetadata(pair.payload).setPayloadSize(pair.size).setPayloadTruncated(pair.truncated).setStatusCode(status.getCode().value()).setRpcId(rpcId);<NEW_LINE>String statusDescription = status.getDescription();<NEW_LINE>if (statusDescription != null) {<NEW_LINE>logEntryBuilder.setStatusMessage(statusDescription);<NEW_LINE>}<NEW_LINE>byte[] statusDetailBytes = metadata.get(STATUS_DETAILS_KEY);<NEW_LINE>if (statusDetailBytes != null) {<NEW_LINE>logEntryBuilder.setStatusDetails(ByteString.copyFrom(statusDetailBytes));<NEW_LINE>}<NEW_LINE>if (peerAddress != null) {<NEW_LINE>logEntryBuilder<MASK><NEW_LINE>}<NEW_LINE>sink.write(logEntryBuilder.build());<NEW_LINE>}
.setPeerAddress(socketAddressToProto(peerAddress));
876,201
private static Map<String, List<String>> createRequestHeaders(String host, int port, ClientEndpointConfig clientEndpointConfiguration) {<NEW_LINE>Map<String, List<String>> headers = new HashMap<>();<NEW_LINE>List<Extension> extensions = clientEndpointConfiguration.getExtensions();<NEW_LINE>List<String> subProtocols = clientEndpointConfiguration.getPreferredSubprotocols();<NEW_LINE>Map<String, Object> userProperties = clientEndpointConfiguration.getUserProperties();<NEW_LINE>if (userProperties.get(Constants.AUTHORIZATION_HEADER_NAME) != null) {<NEW_LINE>List<String> authValues = new ArrayList<>(1);<NEW_LINE>authValues.add((String) userProperties.get(Constants.AUTHORIZATION_HEADER_NAME));<NEW_LINE>headers.<MASK><NEW_LINE>}<NEW_LINE>// Host header<NEW_LINE>List<String> hostValues = new ArrayList<>(1);<NEW_LINE>if (port == -1) {<NEW_LINE>hostValues.add(host);<NEW_LINE>} else {<NEW_LINE>hostValues.add(host + ':' + port);<NEW_LINE>}<NEW_LINE>headers.put(Constants.HOST_HEADER_NAME, hostValues);<NEW_LINE>// Upgrade header<NEW_LINE>List<String> upgradeValues = new ArrayList<>(1);<NEW_LINE>upgradeValues.add(Constants.UPGRADE_HEADER_VALUE);<NEW_LINE>headers.put(Constants.UPGRADE_HEADER_NAME, upgradeValues);<NEW_LINE>// Connection header<NEW_LINE>List<String> connectionValues = new ArrayList<>(1);<NEW_LINE>connectionValues.add(Constants.CONNECTION_HEADER_VALUE);<NEW_LINE>headers.put(Constants.CONNECTION_HEADER_NAME, connectionValues);<NEW_LINE>// WebSocket version header<NEW_LINE>List<String> wsVersionValues = new ArrayList<>(1);<NEW_LINE>wsVersionValues.add(Constants.WS_VERSION_HEADER_VALUE);<NEW_LINE>headers.put(Constants.WS_VERSION_HEADER_NAME, wsVersionValues);<NEW_LINE>// WebSocket key<NEW_LINE>List<String> wsKeyValues = new ArrayList<>(1);<NEW_LINE>wsKeyValues.add(generateWsKeyValue());<NEW_LINE>headers.put(Constants.WS_KEY_HEADER_NAME, wsKeyValues);<NEW_LINE>// WebSocket sub-protocols<NEW_LINE>if (subProtocols != null && subProtocols.size() > 0) {<NEW_LINE>headers.put(Constants.WS_PROTOCOL_HEADER_NAME, subProtocols);<NEW_LINE>}<NEW_LINE>// WebSocket extensions<NEW_LINE>if (extensions != null && extensions.size() > 0) {<NEW_LINE>headers.put(Constants.WS_EXTENSIONS_HEADER_NAME, generateExtensionHeaders(extensions));<NEW_LINE>}<NEW_LINE>return headers;<NEW_LINE>}
put(Constants.AUTHORIZATION_HEADER_NAME, authValues);
382,023
public void onEvent(Event event) throws Exception {<NEW_LINE>//<NEW_LINE>if (Events.ON_CLICK.equalsIgnoreCase(event.getName())) {<NEW_LINE>Integer oldValue = (Integer) getValue();<NEW_LINE>int S_ResourceAssignment_ID = oldValue == null ? 0 : oldValue.intValue();<NEW_LINE>MResourceAssignment ma = new MResourceAssignment(Env.getCtx(), S_ResourceAssignment_ID, null);<NEW_LINE>if (S_ResourceAssignment_ID == 0) {<NEW_LINE>if (gridField != null && gridField.getGridTab() != null) {<NEW_LINE>// assign the resource of the document if any<NEW_LINE>Object org = gridField.getGridTab().getValue("AD_Org_ID");<NEW_LINE>if (org != null && org instanceof Integer)<NEW_LINE>ma.setAD_Org_ID((Integer) org);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Start VAssignment Dialog<NEW_LINE>if (S_ResourceAssignment_ID != 0) {<NEW_LINE>WAssignmentDialog vad = new WAssignmentDialog(ma, true, true);<NEW_LINE>ma = vad.getMResourceAssignment();<NEW_LINE>} else // Start InfoSchedule directly<NEW_LINE>{<NEW_LINE>InfoSchedule is <MASK><NEW_LINE>ma = is.getMResourceAssignment();<NEW_LINE>}<NEW_LINE>// Set Value<NEW_LINE>if (ma != null && ma.getS_ResourceAssignment_ID() != 0) {<NEW_LINE>setValue(new Integer(ma.getS_ResourceAssignment_ID()));<NEW_LINE>ValueChangeEvent vce = new ValueChangeEvent(this, gridField.getColumnName(), oldValue, getValue());<NEW_LINE>fireValueChange(vce);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
= new InfoSchedule(ma, true);
1,846,366
public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {<NEW_LINE>for (Callback c : callbacks) {<NEW_LINE>if (c instanceof NameCallback) {<NEW_LINE>LOG.debug("name callback");<NEW_LINE>} else if (c instanceof PasswordCallback) {<NEW_LINE>LOG.debug("password callback");<NEW_LINE>LOG.warn("Could not login: the client is being asked for a password, but the " + " client code does not currently support obtaining a password from the user." + " Make sure that the client is configured to use a ticket cache (using" + " the JAAS configuration setting 'useTicketCache=true)' and restart the client. If" + " you still get this message after that, the TGT in the ticket cache has expired and must" + " be manually refreshed. To do so, first determine if you are using a password or a" + " keytab. If the former, run kinit in a Unix shell in the environment of the user who" + " is running this client using the command" + " 'kinit <princ>' (where <princ> is the name of the client's Kerberos principal)." + " If the latter, do" + " 'kinit -k -t <keytab> <princ>' (where <princ> is the name of the Kerberos principal, and" + " <keytab> is the location of the keytab file). After manually refreshing your cache," + " restart this client. If you continue to see this message after manually refreshing" + " your cache, ensure that your KDC host's clock is in sync with this host's clock.");<NEW_LINE>} else if (c instanceof AuthorizeCallback) {<NEW_LINE>LOG.debug("authorization callback");<NEW_LINE>AuthorizeCallback ac = (AuthorizeCallback) c;<NEW_LINE><MASK><NEW_LINE>String authzid = ac.getAuthorizationID();<NEW_LINE>if (authid.equals(authzid)) {<NEW_LINE>ac.setAuthorized(true);<NEW_LINE>} else {<NEW_LINE>ac.setAuthorized(false);<NEW_LINE>}<NEW_LINE>if (ac.isAuthorized()) {<NEW_LINE>ac.setAuthorizedID(authzid);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new UnsupportedCallbackException(c);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
String authid = ac.getAuthenticationID();
321,443
public static DependencyGraphResult createPackageDependencyGraph(Path balaPath) {<NEW_LINE>DependencyGraphResult dependencyGraphResult;<NEW_LINE>if (balaPath.toFile().isDirectory()) {<NEW_LINE>Path dependencyGraphJsonPath = balaPath.resolve(DEPENDENCY_GRAPH_JSON);<NEW_LINE>dependencyGraphResult = createPackageDependencyGraphFromJson(dependencyGraphJsonPath);<NEW_LINE>} else {<NEW_LINE>URI zipURI = URI.create("jar:" + balaPath.toAbsolutePath().<MASK><NEW_LINE>try (FileSystem zipFileSystem = FileSystems.newFileSystem(zipURI, new HashMap<>())) {<NEW_LINE>Path dependencyGraphJsonPath = zipFileSystem.getPath(DEPENDENCY_GRAPH_JSON);<NEW_LINE>dependencyGraphResult = createPackageDependencyGraphFromJson(dependencyGraphJsonPath);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new ProjectException("Failed to read balr file:" + balaPath);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return dependencyGraphResult;<NEW_LINE>}
toUri().toString());
1,030,329
protected void paintIcon(Graphics2D g2) {<NEW_LINE>g2.translate(AppPreferences.getScaled(7), AppPreferences.getScaled(7));<NEW_LINE>if (dir.equals(Direction.WEST))<NEW_LINE>g2.rotate((6 * Math.PI) / 4);<NEW_LINE>else if (dir.equals(Direction.SOUTH))<NEW_LINE>g2.rotate(Math.PI);<NEW_LINE>else if (dir.equals(Direction.EAST))<NEW_LINE>g2.rotate(Math.PI / 2);<NEW_LINE>g2.translate(-AppPreferences.getScaled(7), -AppPreferences.getScaled(7));<NEW_LINE>g2.setColor(Color.blue);<NEW_LINE><MASK><NEW_LINE>path.moveTo(AppPreferences.getScaled(points[0]), AppPreferences.getScaled(points[1]));<NEW_LINE>for (var i = 2; i < points.length; i += 2) path.lineTo(AppPreferences.getScaled(points[i]), AppPreferences.getScaled(points[i + 1]));<NEW_LINE>path.closePath();<NEW_LINE>g2.fill(path);<NEW_LINE>g2.setColor(Color.blue.darker());<NEW_LINE>g2.draw(path);<NEW_LINE>}
final var path = new GeneralPath();
331,517
private List<NameValueCountPair> groupByProcess(Business business, Predicate predicate) throws Exception {<NEW_LINE>EntityManager em = business.entityManagerContainer().get(Review.class);<NEW_LINE>CriteriaBuilder cb = em.getCriteriaBuilder();<NEW_LINE>CriteriaQuery<Tuple> cq = cb.createQuery(Tuple.class);<NEW_LINE>Root<Review> root = <MASK><NEW_LINE>Path<String> pathProcess = root.get(Review_.process);<NEW_LINE>Path<String> pathProcessName = root.get(Review_.processName);<NEW_LINE>cq.multiselect(pathProcess, pathProcessName, cb.count(root)).where(predicate).groupBy(pathProcess);<NEW_LINE>List<Tuple> os = em.createQuery(cq).getResultList();<NEW_LINE>List<NameValueCountPair> list = new ArrayList<>();<NEW_LINE>NameValueCountPair pair = null;<NEW_LINE>for (Tuple o : os) {<NEW_LINE>pair = new NameValueCountPair();<NEW_LINE>pair.setName(o.get(pathProcessName));<NEW_LINE>pair.setValue(o.get(pathProcess));<NEW_LINE>pair.setCount(o.get(2, Long.class));<NEW_LINE>list.add(pair);<NEW_LINE>}<NEW_LINE>return list.stream().sorted(Comparator.comparing(NameValueCountPair::getCount).reversed()).collect(Collectors.toList());<NEW_LINE>}
cq.from(Review.class);
208,923
public static List<Entry> parseShort(String url) {<NEW_LINE>String res = getHTTP(url);<NEW_LINE>Document doc = Jsoup.parse(res, "koi8");<NEW_LINE>Elements items = doc.select("tr");<NEW_LINE>List<Entry> list = new ArrayList<Entry>();<NEW_LINE>for (int i = 0; i < items.size(); i++) {<NEW_LINE>Element item = items.get(i);<NEW_LINE>Elements a = item.select("td > a");<NEW_LINE>if (a.size() < 2) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Element title = a.get(0);<NEW_LINE>Element author = a.get(1);<NEW_LINE>if (title == null || author == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (!title.attr("href").endsWith(".shtml")) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>list.add<MASK><NEW_LINE>}<NEW_LINE>return list;<NEW_LINE>}
(makeEntry(title, author));
812,009
public void updateHealthStatusForPersistentInstance(String namespace, String fullServiceName, String clusterName, String ip, int port, boolean healthy) throws NacosException {<NEW_LINE>String groupName = NamingUtils.getGroupName(fullServiceName);<NEW_LINE>String serviceName = NamingUtils.getServiceName(fullServiceName);<NEW_LINE>Service service = Service.newService(namespace, groupName, serviceName);<NEW_LINE>Optional<ServiceMetadata> <MASK><NEW_LINE>if (!serviceMetadata.isPresent() || !serviceMetadata.get().getClusters().containsKey(clusterName)) {<NEW_LINE>throwHealthCheckerException(fullServiceName, clusterName);<NEW_LINE>}<NEW_LINE>ClusterMetadata clusterMetadata = serviceMetadata.get().getClusters().get(clusterName);<NEW_LINE>if (!HealthCheckType.NONE.name().equals(clusterMetadata.getHealthyCheckType())) {<NEW_LINE>throwHealthCheckerException(fullServiceName, clusterName);<NEW_LINE>}<NEW_LINE>String clientId = IpPortBasedClient.getClientId(ip + InternetAddressUtil.IP_PORT_SPLITER + port, false);<NEW_LINE>Client client = clientManager.getClient(clientId);<NEW_LINE>if (null == client) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>InstancePublishInfo oldInstance = client.getInstancePublishInfo(service);<NEW_LINE>if (null == oldInstance) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Instance newInstance = InstanceUtil.parseToApiInstance(service, oldInstance);<NEW_LINE>newInstance.setHealthy(healthy);<NEW_LINE>clientOperationService.registerInstance(service, newInstance, clientId);<NEW_LINE>}
serviceMetadata = metadataManager.getServiceMetadata(service);
1,124,009
private static void mergeInitContainers(V1PodSpec podSpec, V1PodSpec podSpecFromTemplate) {<NEW_LINE>List<V1Container> podSpecInitContainers = podSpec.getInitContainers();<NEW_LINE>if (null == podSpecInitContainers) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Get init containers from podSpecFromTemplate which are not part of pod-spec init containers.<NEW_LINE>final List<V1Container> templateOnlyInitContainers = getInitContainers(podSpecFromTemplate, templateInitContainer -> podSpecInitContainers.stream().map(V1Container::getName).noneMatch(name -> name.equals(<MASK><NEW_LINE>// Get init containers from podSpecFromTemplate which are also part of pod-spec init containers<NEW_LINE>// i.e. the other containers apart from the above list templateOnlyInitContainers.<NEW_LINE>final List<V1Container> templateAlsoInitContainers = getInitContainers(podSpecFromTemplate, templateInitContainer -> templateOnlyInitContainers.stream().map(V1Container::getName).noneMatch(name -> name.equals(templateInitContainer.getName())));<NEW_LINE>// Get init containers from pod-spec which are not part of podSpecFromTemplate init containers.<NEW_LINE>final List<V1Container> podSpecOnlyInitContainers = getInitContainers(podSpec, podSpecInitContainer -> templateAlsoInitContainers.stream().map(V1Container::getName).noneMatch(name -> name.equals(podSpecInitContainer.getName())));<NEW_LINE>// Get init containers from pod-spec which are also part of podSpecFromTemplate init containers<NEW_LINE>// i.e. the other containers apart from the above list podSpecOnlyInitContainers.<NEW_LINE>final Map<String, V1Container> podSpecAlsoInitContainers = getInitContainers(podSpec, podSpecInitContainer -> podSpecOnlyInitContainers.stream().map(V1Container::getName).noneMatch(name -> name.equals(podSpecInitContainer.getName()))).stream().collect(Collectors.toMap(V1Container::getName, e -> e));<NEW_LINE>final List<V1Container> allInitContainers = new ArrayList<>();<NEW_LINE>allInitContainers.addAll(podSpecOnlyInitContainers);<NEW_LINE>allInitContainers.addAll(templateOnlyInitContainers);<NEW_LINE>// Merge templateAlsoInitContainers and podSpecAlsoInitContainers.<NEW_LINE>List<V1Container> mergedInitContainers = getMergedInitContainers(templateAlsoInitContainers, podSpecAlsoInitContainers);<NEW_LINE>allInitContainers.addAll(mergedInitContainers);<NEW_LINE>// This resets the init containers already part of pod-spec.<NEW_LINE>podSpec.setInitContainers(allInitContainers);<NEW_LINE>}
templateInitContainer.getName())));
1,800,677
public Object visit(ASTMethod node, Object data) {<NEW_LINE>if (node.getParent() instanceof ASTProperty) {<NEW_LINE>// Skip property methods, doc is required on the property itself<NEW_LINE>return data;<NEW_LINE>}<NEW_LINE>ApexDocComment comment = getApexDocComment(node);<NEW_LINE>if (comment == null) {<NEW_LINE>if (shouldHaveApexDocs(node)) {<NEW_LINE>asCtx(data).addViolationWithMessage(node, MISSING_COMMENT_MESSAGE);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (getProperty(REPORT_MISSING_DESCRIPTION_DESCRIPTOR) && !comment.hasDescription) {<NEW_LINE>asCtx(data).addViolationWithMessage(node, MISSING_DESCRIPTION_MESSAGE);<NEW_LINE>}<NEW_LINE>String returnType = node.getReturnType();<NEW_LINE>boolean shouldHaveReturn = !(returnType.isEmpty() || "void".equalsIgnoreCase(returnType));<NEW_LINE>if (comment.hasReturn != shouldHaveReturn) {<NEW_LINE>if (shouldHaveReturn) {<NEW_LINE>asCtx(data).addViolationWithMessage(node, MISSING_RETURN_MESSAGE);<NEW_LINE>} else {<NEW_LINE>asCtx(data).addViolationWithMessage(node, UNEXPECTED_RETURN_MESSAGE);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Collect parameter names in order<NEW_LINE>final List<String> params = node.findChildrenOfType(ASTParameter.class).stream().map(p -> p.getImage()).collect(Collectors.toList());<NEW_LINE>if (!comment.params.equals(params)) {<NEW_LINE>asCtx(data<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return data;<NEW_LINE>}
).addViolationWithMessage(node, MISMATCHED_PARAM_MESSAGE);
1,293,079
public com.amazonaws.services.mobile.model.UnauthorizedException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.mobile.model.UnauthorizedException unauthorizedException = new com.amazonaws.services.mobile.model.UnauthorizedException(null);<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return unauthorizedException;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
1,841,259
private boolean executeBatch(final WriteBatchTemplate template) {<NEW_LINE>this.readLock.lock();<NEW_LINE>if (this.db == null) {<NEW_LINE>LOG.warn("DB not initialized or destroyed in data path: {}.", this.path);<NEW_LINE>this.readLock.unlock();<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>try (final WriteBatch batch = new WriteBatch()) {<NEW_LINE>template.execute(batch);<NEW_LINE>this.db.write(this.writeOptions, batch);<NEW_LINE>} catch (final RocksDBException e) {<NEW_LINE>LOG.error("Execute batch failed with rocksdb exception.", e);<NEW_LINE>return false;<NEW_LINE>} catch (final IOException e) {<NEW_LINE>LOG.error("Execute batch failed with io exception.", e);<NEW_LINE>return false;<NEW_LINE>} catch (final InterruptedException e) {<NEW_LINE><MASK><NEW_LINE>Thread.currentThread().interrupt();<NEW_LINE>return false;<NEW_LINE>} finally {<NEW_LINE>this.readLock.unlock();<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
LOG.error("Execute batch failed with interrupt.", e);
607,859
private static ArrayList<String> listDirectoryContents(RemoteFile serverDir, String fileName) throws Exception {<NEW_LINE>final String method = "serverDirectoryContents";<NEW_LINE>String s = "The specified directoryPath \'" + serverDir.getAbsolutePath() + "\' ";<NEW_LINE>Log.entering(c, method);<NEW_LINE>if (serverDir.exists() && !serverDir.isDirectory() && !serverDir.isFile()) {<NEW_LINE>Log.info(c, "listDirectoryContents", "serverDir exists & !Dir & !File !? Recreate serverDir,retry and hope for the best...");<NEW_LINE>serverDir = new RemoteFile(machine, serverDir.getAbsolutePath());<NEW_LINE>}<NEW_LINE>if (!serverDir.isDirectory() || !serverDir.exists())<NEW_LINE>throw new TopologyException(s + "was not a directory");<NEW_LINE>RemoteFile[] <MASK><NEW_LINE>ArrayList<String> firstLevelFileNames = new ArrayList<String>();<NEW_LINE>for (RemoteFile f : firstLevelFiles) {<NEW_LINE>if (!f.isFile())<NEW_LINE>continue;<NEW_LINE>if (fileName == null) {<NEW_LINE>firstLevelFileNames.add(f.getName());<NEW_LINE>} else if (f.getName().contains(fileName)) {<NEW_LINE>firstLevelFileNames.add(f.getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return firstLevelFileNames;<NEW_LINE>}
firstLevelFiles = serverDir.list(false);
806,094
void addFunction(final T function) {<NEW_LINE>final List<ParamType> parameters = function.parameters();<NEW_LINE>if (allFunctions.put(parameters, function) != null) {<NEW_LINE>throw new KsqlFunctionException("Can't add function " + function.name() + " with parameters " + function.parameters() + " as a function with the same name and parameter types already exists " + allFunctions.get(parameters));<NEW_LINE>}<NEW_LINE>Node curr = root;<NEW_LINE>Node parent = curr;<NEW_LINE>for (final ParamType parameter : parameters) {<NEW_LINE>final Parameter param = new Parameter(parameter, false);<NEW_LINE>parent = curr;<NEW_LINE>curr = curr.children.computeIfAbsent(param, ignored -> new Node());<NEW_LINE>}<NEW_LINE>if (function.isVariadic()) {<NEW_LINE>// first add the function to the parent to address the<NEW_LINE>// case of empty varargs<NEW_LINE>parent.update(function);<NEW_LINE>// then add a new child node with the parameter value type<NEW_LINE>// and add this function to that node<NEW_LINE>final ParamType varargSchema = Iterables.getLast(parameters);<NEW_LINE>final Parameter vararg = new Parameter(varargSchema, true);<NEW_LINE>final Node leaf = parent.children.computeIfAbsent(vararg, ignored -> new Node());<NEW_LINE>leaf.update(function);<NEW_LINE>// add a self referential loop for varargs so that we can<NEW_LINE>// add as many of the same param at the end and still retrieve<NEW_LINE>// this node<NEW_LINE>leaf.<MASK><NEW_LINE>}<NEW_LINE>curr.update(function);<NEW_LINE>}
children.putIfAbsent(vararg, leaf);
245,494
public void processElement(ProcessContext context) throws Exception {<NEW_LINE>Query query = context.element();<NEW_LINE>String namespace = options.getNamespace();<NEW_LINE>int userLimit = query.hasLimit() ? query.getLimit().getValue() : Integer.MAX_VALUE;<NEW_LINE>boolean moreResults = true;<NEW_LINE>QueryResultBatch currentBatch = null;<NEW_LINE>while (moreResults) {<NEW_LINE>Query.Builder queryBuilder = query.toBuilder();<NEW_LINE>queryBuilder.setLimit(Int32Value.newBuilder().setValue(Math.min(userLimit, QUERY_BATCH_LIMIT)));<NEW_LINE>if (currentBatch != null && !currentBatch.getEndCursor().isEmpty()) {<NEW_LINE>queryBuilder.setStartCursor(currentBatch.getEndCursor());<NEW_LINE>}<NEW_LINE>RunQueryRequest request = makeRequest(queryBuilder.build(), namespace);<NEW_LINE>RunQueryResponse response = runQueryWithRetries(request);<NEW_LINE>currentBatch = response.getBatch();<NEW_LINE>// MORE_RESULTS_AFTER_LIMIT is not implemented yet:<NEW_LINE>// https://groups.google.com/forum/#!topic/gcd-discuss/iNs6M1jA2Vw, so<NEW_LINE>// use result count to determine if more results might exist.<NEW_LINE>int numFetch = currentBatch.getEntityResultsCount();<NEW_LINE>if (query.hasLimit()) {<NEW_LINE>verify(userLimit >= numFetch, "Expected userLimit %s >= numFetch %s, because query limit %s must be <= userLimit", userLimit, <MASK><NEW_LINE>userLimit -= numFetch;<NEW_LINE>}<NEW_LINE>// output all the entities from the current batch.<NEW_LINE>for (EntityResult entityResult : currentBatch.getEntityResultsList()) {<NEW_LINE>context.output(entityResult.getEntity());<NEW_LINE>}<NEW_LINE>// Check if we have more entities to be read.<NEW_LINE>// User-limit does not exist (so userLimit == MAX_VALUE) and/or has not been satisfied<NEW_LINE>moreResults = // All indications from the API are that there are/may be more results.<NEW_LINE>(userLimit > 0) && ((numFetch == QUERY_BATCH_LIMIT) || (currentBatch.getMoreResults() == NOT_FINISHED));<NEW_LINE>}<NEW_LINE>}
numFetch, query.getLimit());
1,003,028
public static String[] partitionCommandLine(final String command) {<NEW_LINE>final ArrayList<String> commands = new ArrayList<>();<NEW_LINE>int index = 0;<NEW_LINE>StringBuffer buffer = new <MASK><NEW_LINE>boolean isApos = false;<NEW_LINE>boolean isQuote = false;<NEW_LINE>while (index < command.length()) {<NEW_LINE>final char c = command.charAt(index);<NEW_LINE>switch(c) {<NEW_LINE>case ' ':<NEW_LINE>if (!isQuote && !isApos) {<NEW_LINE>final String arg = buffer.toString();<NEW_LINE>buffer = new StringBuffer(command.length() - index);<NEW_LINE>if (arg.length() > 0) {<NEW_LINE>commands.add(arg);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>buffer.append(c);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case '\'':<NEW_LINE>if (!isQuote) {<NEW_LINE>isApos = !isApos;<NEW_LINE>} else {<NEW_LINE>buffer.append(c);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case '"':<NEW_LINE>if (!isApos) {<NEW_LINE>isQuote = !isQuote;<NEW_LINE>} else {<NEW_LINE>buffer.append(c);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>buffer.append(c);<NEW_LINE>}<NEW_LINE>index++;<NEW_LINE>}<NEW_LINE>if (buffer.length() > 0) {<NEW_LINE>final String arg = buffer.toString();<NEW_LINE>commands.add(arg);<NEW_LINE>}<NEW_LINE>return commands.toArray(new String[commands.size()]);<NEW_LINE>}
StringBuffer(command.length());
879,809
private int bound(IntVar var, int val) {<NEW_LINE>Model model = var.getModel();<NEW_LINE>int cost;<NEW_LINE>// // if decision is '<=' ('>='), UB (LB) should be ignored to avoid infinite loop<NEW_LINE>if (dop == DecisionOperatorFactory.makeIntSplit() && val == var.getUB() || dop == DecisionOperatorFactory.makeIntReverseSplit() && val == var.getLB()) {<NEW_LINE>return Integer.MAX_VALUE;<NEW_LINE>}<NEW_LINE>model<MASK><NEW_LINE>try {<NEW_LINE>dop.apply(var, val, Cause.Null);<NEW_LINE>model.getSolver().getEngine().propagate();<NEW_LINE>ResolutionPolicy rp = model.getSolver().getObjectiveManager().getPolicy();<NEW_LINE>if (rp == ResolutionPolicy.SATISFACTION) {<NEW_LINE>cost = 1;<NEW_LINE>} else if (rp == ResolutionPolicy.MINIMIZE) {<NEW_LINE>cost = ((IntVar) model.getObjective()).getLB();<NEW_LINE>} else {<NEW_LINE>cost = -((IntVar) model.getObjective()).getUB();<NEW_LINE>}<NEW_LINE>} catch (ContradictionException cex) {<NEW_LINE>cost = Integer.MAX_VALUE;<NEW_LINE>}<NEW_LINE>model.getSolver().getEngine().flush();<NEW_LINE>model.getEnvironment().worldPop();<NEW_LINE>return cost;<NEW_LINE>}
.getEnvironment().worldPush();
1,639,476
private DomNode toXmlNode() {<NEW_LINE>DomNode root = new DomNode(nodeNameFor("application"));<NEW_LINE>Map<String, String> rootAttributes = Cast.uncheckedCast(root.attributes());<NEW_LINE>rootAttributes.put("version", version);<NEW_LINE>if (!"1.3".equals(version)) {<NEW_LINE>rootAttributes.put("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance");<NEW_LINE>}<NEW_LINE>if ("1.3".equals(version)) {<NEW_LINE>root.setPublicId("-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN");<NEW_LINE>root.setSystemId("http://java.sun.com/dtd/application_1_3.dtd");<NEW_LINE>} else if ("1.4".equals(version)) {<NEW_LINE>rootAttributes.put("xsi:schemaLocation", "http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/application_1_4.xsd");<NEW_LINE>} else if ("5".equals(version) || "6".equals(version)) {<NEW_LINE>rootAttributes.put("xsi:schemaLocation", "http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_" + version + ".xsd");<NEW_LINE>} else if ("7".equals(version)) {<NEW_LINE>rootAttributes.put("xsi:schemaLocation", "http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/application_" + version + ".xsd");<NEW_LINE>}<NEW_LINE>if (applicationName != null) {<NEW_LINE>new Node(root, nodeNameFor("application-name"), applicationName);<NEW_LINE>}<NEW_LINE>if (description != null) {<NEW_LINE>new Node(root, nodeNameFor("description"), description);<NEW_LINE>}<NEW_LINE>if (displayName != null) {<NEW_LINE>new Node(root, nodeNameFor("display-name"), displayName);<NEW_LINE>}<NEW_LINE>if (initializeInOrder != null && initializeInOrder) {<NEW_LINE>new Node(root, nodeNameFor("initialize-in-order"), initializeInOrder);<NEW_LINE>}<NEW_LINE>for (EarModule module : modules) {<NEW_LINE>Node moduleNode = new Node<MASK><NEW_LINE>module.toXmlNode(moduleNode, moduleNameFor(module));<NEW_LINE>}<NEW_LINE>if (securityRoles != null) {<NEW_LINE>for (EarSecurityRole role : securityRoles) {<NEW_LINE>Node roleNode = new Node(root, nodeNameFor("security-role"));<NEW_LINE>if (role.getDescription() != null) {<NEW_LINE>new Node(roleNode, nodeNameFor("description"), role.getDescription());<NEW_LINE>}<NEW_LINE>new Node(roleNode, nodeNameFor("role-name"), role.getRoleName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (libraryDirectory != null) {<NEW_LINE>new Node(root, nodeNameFor("library-directory"), libraryDirectory);<NEW_LINE>}<NEW_LINE>return root;<NEW_LINE>}
(root, nodeNameFor("module"));
109,340
public boolean onMenuItemClick(MenuItem item) {<NEW_LINE>switch(item.getItemId()) {<NEW_LINE>case R.id.enableChartActionBar:<NEW_LINE>if (item.isChecked()) {<NEW_LINE>item.setChecked(false);<NEW_LINE>prefs.edit().putBoolean("enableOverviewChartActionBar", false).apply();<NEW_LINE>chartActionBarView.setVisibility(View.GONE);<NEW_LINE>} else {<NEW_LINE>item.setChecked(true);<NEW_LINE>prefs.edit().putBoolean("enableOverviewChartActionBar", true).apply();<NEW_LINE>chartActionBarView.setVisibility(View.VISIBLE);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>case R.id.menu_range_day:<NEW_LINE>prefs.edit().putInt("selectRangeMode", ChartMeasurementView.ViewMode.DAY_OF_ALL.ordinal()).commit();<NEW_LINE>break;<NEW_LINE>case R.id.menu_range_week:<NEW_LINE>prefs.edit().putInt("selectRangeMode", ChartMeasurementView.ViewMode.WEEK_OF_ALL.ordinal()).commit();<NEW_LINE>break;<NEW_LINE>case R.id.menu_range_month:<NEW_LINE>prefs.edit().putInt("selectRangeMode", ChartMeasurementView.ViewMode.MONTH_OF_ALL.<MASK><NEW_LINE>break;<NEW_LINE>case R.id.menu_range_year:<NEW_LINE>prefs.edit().putInt("selectRangeMode", ChartMeasurementView.ViewMode.YEAR_OF_ALL.ordinal()).commit();<NEW_LINE>}<NEW_LINE>item.setChecked(true);<NEW_LINE>// TODO HACK to refresh graph; graph.invalidate and notfiydatachange is not enough!?<NEW_LINE>getActivity().recreate();<NEW_LINE>return true;<NEW_LINE>}
ordinal()).commit();
527,286
public ConstructorDeclaration parseStatements(char[] source, int offset, int length, Map<String, String> settings, boolean recordParsingInformation, boolean enabledStatementRecovery) {<NEW_LINE>if (source == null) {<NEW_LINE>throw new IllegalArgumentException();<NEW_LINE>}<NEW_LINE>CompilerOptions compilerOptions = new CompilerOptions(settings);<NEW_LINE>// in this case we don't want to ignore method bodies since we are parsing only statements<NEW_LINE>final ProblemReporter problemReporter = new ProblemReporter(DefaultErrorHandlingPolicies.proceedWithAllProblems(), compilerOptions, new DefaultProblemFactory(Locale.getDefault()));<NEW_LINE>CommentRecorderParser parser = new CommentRecorderParser(problemReporter, false);<NEW_LINE>parser.setMethodsFullRecovery(false);<NEW_LINE>parser.setStatementsRecovery(enabledStatementRecovery);<NEW_LINE>ICompilationUnit sourceUnit = new // $NON-NLS-1$<NEW_LINE>CompilationUnit(// $NON-NLS-1$<NEW_LINE>source, "", compilerOptions.defaultEncoding);<NEW_LINE>final CompilationResult compilationResult = new CompilationResult(sourceUnit, 0, 0, compilerOptions.maxProblemsPerUnit);<NEW_LINE>CompilationUnitDeclaration compilationUnitDeclaration = new CompilationUnitDeclaration(problemReporter, compilationResult, length);<NEW_LINE>ConstructorDeclaration constructorDeclaration = new ConstructorDeclaration(compilationResult);<NEW_LINE>constructorDeclaration.sourceEnd = -1;<NEW_LINE>constructorDeclaration<MASK><NEW_LINE>constructorDeclaration.bodyStart = offset;<NEW_LINE>constructorDeclaration.bodyEnd = offset + length - 1;<NEW_LINE>parser.scanner.setSource(compilationResult);<NEW_LINE>parser.scanner.resetTo(offset, offset + length);<NEW_LINE>parser.parse(constructorDeclaration, compilationUnitDeclaration, true);<NEW_LINE>if (recordParsingInformation) {<NEW_LINE>this.recordedParsingInformation = getRecordedParsingInformation(compilationResult, compilationUnitDeclaration.comments);<NEW_LINE>}<NEW_LINE>return constructorDeclaration;<NEW_LINE>}
.declarationSourceEnd = offset + length - 1;
753,708
private static String makeSessionDestroyedDebugMsg(final PwmSession pwmSession) {<NEW_LINE>final LocalSessionStateBean sessionStateBean = pwmSession.getSessionStateBean();<NEW_LINE>final Map<String, String> debugItems = new LinkedHashMap<>();<NEW_LINE>debugItems.put("requests", sessionStateBean.getRequestCount().toString());<NEW_LINE>final Instant startTime = sessionStateBean.getSessionCreationTime();<NEW_LINE>final Instant lastAccessedTime = sessionStateBean.getSessionLastAccessedTime();<NEW_LINE>if (startTime != null && lastAccessedTime != null) {<NEW_LINE>final TimeDuration timeDuration = TimeDuration.between(startTime, lastAccessedTime);<NEW_LINE>debugItems.put(<MASK><NEW_LINE>}<NEW_LINE>final TimeDuration avgReqDuration = TimeDuration.fromDuration(sessionStateBean.getAvgRequestDuration().getAverageAsDuration());<NEW_LINE>debugItems.put("avgRequestDuration", avgReqDuration.asCompactString());<NEW_LINE>return StringUtil.mapToString(debugItems);<NEW_LINE>}
"firstToLastRequestInterval", timeDuration.asCompactString());
1,572,621
public static char[] hex2CharArray(String hex) {<NEW_LINE>if (hex == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>int length = hex.length();<NEW_LINE>if ((1 & length) != 0) {<NEW_LINE>throw new IllegalArgumentException("'" + hex + "' has odd length!");<NEW_LINE>}<NEW_LINE>length /= 2;<NEW_LINE>char[] result = new char[length];<NEW_LINE>for (int indexDest = 0, indexSrc = 0; indexDest < length; ++indexDest) {<NEW_LINE>int digit = Character.digit(hex.charAt(indexSrc), 16);<NEW_LINE>if (digit < 0) {<NEW_LINE>throw new IllegalArgumentException("'" + hex + "' digit " + indexSrc + " is not hexadecimal!");<NEW_LINE>}<NEW_LINE>result[indexDest] = <MASK><NEW_LINE>++indexSrc;<NEW_LINE>digit = Character.digit(hex.charAt(indexSrc), 16);<NEW_LINE>if (digit < 0) {<NEW_LINE>throw new IllegalArgumentException("'" + hex + "' digit " + indexSrc + " is not hexadecimal!");<NEW_LINE>}<NEW_LINE>result[indexDest] |= (char) digit;<NEW_LINE>++indexSrc;<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
(char) (digit << 4);
235,465
public GetImageRecipePolicyResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>GetImageRecipePolicyResult getImageRecipePolicyResult = new GetImageRecipePolicyResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return getImageRecipePolicyResult;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("requestId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getImageRecipePolicyResult.setRequestId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("policy", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getImageRecipePolicyResult.setPolicy(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return getImageRecipePolicyResult;<NEW_LINE>}
JsonToken token = context.getCurrentToken();
1,345,626
final GetPlayerConnectionStatusResult executeGetPlayerConnectionStatus(GetPlayerConnectionStatusRequest getPlayerConnectionStatusRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getPlayerConnectionStatusRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetPlayerConnectionStatusRequest> request = null;<NEW_LINE>Response<GetPlayerConnectionStatusResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetPlayerConnectionStatusRequestProtocolMarshaller(protocolFactory).marshall<MASK><NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GameSparks");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetPlayerConnectionStatus");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetPlayerConnectionStatusResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetPlayerConnectionStatusResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
(super.beforeMarshalling(getPlayerConnectionStatusRequest));
674,207
public static boolean markActionInvoked(@Nonnull Project project, @Nonnull final Editor editor, @Nonnull IntentionAction action) {<NEW_LINE>final int offset = ((EditorEx) editor).getExpectedCaretOffset();<NEW_LINE>List<HighlightInfo> infos = new ArrayList<>();<NEW_LINE>DaemonCodeAnalyzerImpl.processHighlightsNearOffset(editor.getDocument(), project, HighlightSeverity.INFORMATION, offset, true, new CommonProcessors.CollectProcessor<>(infos));<NEW_LINE>boolean removed = false;<NEW_LINE>for (HighlightInfo info : infos) {<NEW_LINE>if (info.quickFixActionMarkers != null) {<NEW_LINE>for (Pair<HighlightInfo.IntentionActionDescriptor, RangeMarker> pair : info.quickFixActionMarkers) {<NEW_LINE><MASK><NEW_LINE>if (actionInGroup.getAction() == action) {<NEW_LINE>// no CME because the list is concurrent<NEW_LINE>removed |= info.quickFixActionMarkers.remove(pair);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return removed;<NEW_LINE>}
HighlightInfo.IntentionActionDescriptor actionInGroup = pair.first;
710,909
public static void main(String[] args) throws Exception {<NEW_LINE>Properties properties = Utils.readPropertiesFile(ExampleConstants.CONFIG_FILE_NAME);<NEW_LINE>final String eventMeshIp = <MASK><NEW_LINE>final String eventMeshGrpcPort = properties.getProperty(ExampleConstants.EVENTMESH_GRPC_PORT);<NEW_LINE>EventMeshGrpcClientConfig eventMeshClientConfig = EventMeshGrpcClientConfig.builder().serverAddr(eventMeshIp).serverPort(Integer.parseInt(eventMeshGrpcPort)).producerGroup(ExampleConstants.DEFAULT_EVENTMESH_TEST_PRODUCER_GROUP).env("env").idc("idc").sys("1234").build();<NEW_LINE>EventMeshGrpcProducer eventMeshGrpcProducer = new EventMeshGrpcProducer(eventMeshClientConfig);<NEW_LINE>eventMeshGrpcProducer.init();<NEW_LINE>Map<String, String> content = new HashMap<>();<NEW_LINE>content.put("content", "testRequestReplyMessage");<NEW_LINE>List<EventMeshMessage> messageList = new ArrayList<>();<NEW_LINE>for (int i = 0; i < 5; i++) {<NEW_LINE>EventMeshMessage message = EventMeshMessage.builder().topic(ExampleConstants.EVENTMESH_GRPC_ASYNC_TEST_TOPIC).content((JsonUtils.serialize(content))).uniqueId(RandomStringUtils.generateNum(30)).bizSeqNo(RandomStringUtils.generateNum(30)).build().addProp(Constants.EVENTMESH_MESSAGE_CONST_TTL, String.valueOf(4 * 1000));<NEW_LINE>messageList.add(message);<NEW_LINE>}<NEW_LINE>eventMeshGrpcProducer.publish(messageList);<NEW_LINE>Thread.sleep(10000);<NEW_LINE>try (EventMeshGrpcProducer ignore = eventMeshGrpcProducer) {<NEW_LINE>// ignore<NEW_LINE>}<NEW_LINE>}
properties.getProperty(ExampleConstants.EVENTMESH_IP);
521,876
public static void main(String[] args) {<NEW_LINE>if (args == null) {<NEW_LINE>args = new String[] {};<NEW_LINE>}<NEW_LINE>if (args.length != 0 && args.length != 2 && args.length != 4) {<NEW_LINE>usageAndExit();<NEW_LINE>}<NEW_LINE>// Set defaults by assuming this is run from an eclipse workspace with paho projects loaded<NEW_LINE>String dir = "../org.eclipse.paho.client.mqttv3/src";<NEW_LINE>String file = dir + "/org/eclipse/paho/client/mqttv3/internal/nls/logcat.properties";<NEW_LINE>for (int i = 0; i < args.length; i += 2) {<NEW_LINE>if (args[i].equals("-d")) {<NEW_LINE>dir = args[i + 1];<NEW_LINE>} else if (args[i].equals("-o")) {<NEW_LINE>file = args[i + 1];<NEW_LINE>} else {<NEW_LINE>System.out.println<MASK><NEW_LINE>usageAndExit();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>LogMessageExtractor tpe = new LogMessageExtractor(dir, file);<NEW_LINE>tpe.parse();<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>}
("Unknown arg: " + args[i]);
1,574,989
private PactDslResponse createPactDslResponse(Contract contract, PactDslRequestWithPath pactDslRequest) {<NEW_LINE>Response response = contract.getResponse();<NEW_LINE>PactDslResponse pactDslResponse = pactDslRequest.willRespondWith().status((Integer) response.getStatus().getClientValue());<NEW_LINE>PactDslResponse finalPactDslResponse = pactDslResponse;<NEW_LINE>if (response.getHeaders() != null) {<NEW_LINE>response.getHeaders().getEntries().forEach(h -> processHeader(finalPactDslResponse, h));<NEW_LINE>}<NEW_LINE>if (response.getCookies() != null) {<NEW_LINE>pactDslResponse = processCookies(<MASK><NEW_LINE>}<NEW_LINE>if (response.getBody() != null) {<NEW_LINE>DslPart pactResponseBody = BodyConverter.toPactBody(response.getBody(), DslProperty::getClientValue);<NEW_LINE>if (response.getBodyMatchers() != null) {<NEW_LINE>pactResponseBody.setMatchers(MatchingRulesConverter.matchingRulesForBody(response.getBodyMatchers()));<NEW_LINE>}<NEW_LINE>pactResponseBody.setGenerators(ValueGeneratorConverter.extract(response.getBody(), DslProperty::getServerValue));<NEW_LINE>pactDslResponse = pactDslResponse.body(pactResponseBody);<NEW_LINE>}<NEW_LINE>return pactDslResponse;<NEW_LINE>}
pactDslResponse, response.getCookies());
143,586
private void applyRepeatingRequestBuilder(boolean checkStarted, int errorReason) {<NEW_LINE>if ((getState() == CameraState.PREVIEW && !isChangingState()) || !checkStarted) {<NEW_LINE>try {<NEW_LINE>mSession.setRepeatingRequest(mRepeatingRequestBuilder.<MASK><NEW_LINE>} catch (CameraAccessException e) {<NEW_LINE>throw new CameraException(e, errorReason);<NEW_LINE>} catch (IllegalStateException e) {<NEW_LINE>// mSession is invalid - has been closed. This is extremely worrying because<NEW_LINE>// it means that the session state and getPreviewState() are not synced.<NEW_LINE>// This probably signals an error in the setup/teardown synchronization.<NEW_LINE>LOG.e("applyRepeatingRequestBuilder: session is invalid!", e, "checkStarted:", checkStarted, "currentThread:", Thread.currentThread().getName(), "state:", getState(), "targetState:", getTargetState());<NEW_LINE>throw new CameraException(CameraException.REASON_DISCONNECTED);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
build(), mRepeatingRequestCallback, null);
309,985
public void onAfterTransport(BootEvent event) {<NEW_LINE>// register schema to microservice;<NEW_LINE>Microservice microservice = RegistrationManager.INSTANCE.getMicroservice();<NEW_LINE>String swaggerSchema = "http";<NEW_LINE>for (String endpoint : microservice.getInstance().getEndpoints()) {<NEW_LINE>if (endpoint.startsWith("rest://") && endpoint.indexOf("sslEnabled=true") > 0) {<NEW_LINE>swaggerSchema = "https";<NEW_LINE>}<NEW_LINE>}<NEW_LINE>MicroserviceMeta microserviceMeta = event<MASK><NEW_LINE>for (SchemaMeta schemaMeta : microserviceMeta.getSchemaMetas().values()) {<NEW_LINE>Swagger swagger = schemaMeta.getSwagger();<NEW_LINE>swagger.addScheme(Scheme.forValue(swaggerSchema));<NEW_LINE>String content = SwaggerUtils.swaggerToString(swagger);<NEW_LINE>LOGGER.info("generate swagger for {}/{}/{}, swagger: {}", microserviceMeta.getAppId(), microserviceMeta.getMicroserviceName(), schemaMeta.getSchemaId(), content);<NEW_LINE>RegistrationManager.INSTANCE.addSchema(schemaMeta.getSchemaId(), content);<NEW_LINE>}<NEW_LINE>saveBasePaths(microserviceMeta);<NEW_LINE>}
.getScbEngine().getProducerMicroserviceMeta();
778,397
public void handleEvent(Event e) {<NEW_LINE>String alias = alias_field.getText().trim();<NEW_LINE>int strength = strengths[strength_combo.getSelectionIndex()];<NEW_LINE>String dn = "";<NEW_LINE>for (int i = 0; i < fields.length; i++) {<NEW_LINE>String rn = fields[i].getText().trim();<NEW_LINE>if (rn.length() == 0) {<NEW_LINE>rn = "Unknown";<NEW_LINE>}<NEW_LINE>dn += (dn.length() == 0 ? "" : ",") + field_rns[i] + "=" + rn;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>SESecurityManager.<MASK><NEW_LINE>close(true);<NEW_LINE>Logger.log(new LogAlert(LogAlert.UNREPEATABLE, LogAlert.AT_INFORMATION, MessageText.getString("security.certcreate.createok") + "\n" + alias + ":" + strength + "\n" + dn + "\n" + SystemTime.getCurrentTime()));<NEW_LINE>} catch (Throwable f) {<NEW_LINE>Logger.log(new LogAlert(LogAlert.UNREPEATABLE, MessageText.getString("security.certcreate.createfail") + "\n" + SystemTime.getCurrentTime(), f));<NEW_LINE>}<NEW_LINE>}
createSelfSignedCertificate(alias, dn, strength);
168,389
public void writeAll(SubGraph graph, Reporter reporter, ExportConfig config, CSVWriter out) {<NEW_LINE>Map<String, Class> nodePropTypes = collectPropTypesForNodes(graph, db, config);<NEW_LINE>Map<String, Class> relPropTypes = collectPropTypesForRelationships(graph, db, config);<NEW_LINE>List<String> nodeHeader = generateHeader(nodePropTypes, config.useTypes(), NODE_HEADER_FIXED_COLUMNS);<NEW_LINE>List<String> relHeader = generateHeader(relPropTypes, config.useTypes(), REL_HEADER_FIXED_COLUMNS);<NEW_LINE>List<String> header = new ArrayList<>(nodeHeader);<NEW_LINE>header.addAll(relHeader);<NEW_LINE>out.writeNext(header.toArray(new String[header.size()]), applyQuotesToAll);<NEW_LINE>int cols = header.size();<NEW_LINE>writeNodes(graph, out, reporter, nodeHeader.subList(NODE_HEADER_FIXED_COLUMNS.length, nodeHeader.size()), cols, config.getBatchSize(), config.getDelim());<NEW_LINE>writeRels(graph, out, reporter, relHeader.subList(REL_HEADER_FIXED_COLUMNS.length, relHeader.size()), cols, nodeHeader.size(), config.getBatchSize(<MASK><NEW_LINE>}
), config.getDelim());
1,595,858
public static DescribeBackupsResponse unmarshall(DescribeBackupsResponse describeBackupsResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeBackupsResponse.setRequestId(_ctx.stringValue("DescribeBackupsResponse.RequestId"));<NEW_LINE>describeBackupsResponse.setTotalEcsSnapshotSize(_ctx.longValue("DescribeBackupsResponse.TotalEcsSnapshotSize"));<NEW_LINE>describeBackupsResponse.setPageRecordCount(_ctx.stringValue("DescribeBackupsResponse.PageRecordCount"));<NEW_LINE>describeBackupsResponse.setTotalRecordCount(_ctx.stringValue("DescribeBackupsResponse.TotalRecordCount"));<NEW_LINE>describeBackupsResponse.setTotalBackupSize(_ctx.longValue("DescribeBackupsResponse.TotalBackupSize"));<NEW_LINE>describeBackupsResponse.setPageNumber(_ctx.stringValue("DescribeBackupsResponse.PageNumber"));<NEW_LINE>List<Backup> items = new ArrayList<Backup>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeBackupsResponse.Items.Length"); i++) {<NEW_LINE>Backup backup = new Backup();<NEW_LINE>backup.setStorageClass(_ctx.stringValue("DescribeBackupsResponse.Items[" + i + "].StorageClass"));<NEW_LINE>backup.setEncryption(_ctx.stringValue("DescribeBackupsResponse.Items[" + i + "].Encryption"));<NEW_LINE>backup.setBackupStatus(_ctx.stringValue("DescribeBackupsResponse.Items[" + i + "].BackupStatus"));<NEW_LINE>backup.setStoreStatus(_ctx.stringValue("DescribeBackupsResponse.Items[" + i + "].StoreStatus"));<NEW_LINE>backup.setConsistentTime(_ctx.longValue("DescribeBackupsResponse.Items[" + i + "].ConsistentTime"));<NEW_LINE>backup.setBackupType(_ctx.stringValue("DescribeBackupsResponse.Items[" + i + "].BackupType"));<NEW_LINE>backup.setCopyOnlyBackup(_ctx.stringValue("DescribeBackupsResponse.Items[" + i + "].CopyOnlyBackup"));<NEW_LINE>backup.setBackupEndTime(_ctx.stringValue("DescribeBackupsResponse.Items[" + i + "].BackupEndTime"));<NEW_LINE>backup.setMetaStatus(_ctx.stringValue("DescribeBackupsResponse.Items[" + i + "].MetaStatus"));<NEW_LINE>backup.setBackupScale(_ctx.stringValue("DescribeBackupsResponse.Items[" + i + "].BackupScale"));<NEW_LINE>backup.setBackupInitiator(_ctx.stringValue("DescribeBackupsResponse.Items[" + i + "].BackupInitiator"));<NEW_LINE>backup.setBackupIntranetDownloadURL(_ctx.stringValue<MASK><NEW_LINE>backup.setBackupMethod(_ctx.stringValue("DescribeBackupsResponse.Items[" + i + "].BackupMethod"));<NEW_LINE>backup.setSlaveStatus(_ctx.stringValue("DescribeBackupsResponse.Items[" + i + "].SlaveStatus"));<NEW_LINE>backup.setBackupStartTime(_ctx.stringValue("DescribeBackupsResponse.Items[" + i + "].BackupStartTime"));<NEW_LINE>backup.setBackupLocation(_ctx.stringValue("DescribeBackupsResponse.Items[" + i + "].BackupLocation"));<NEW_LINE>backup.setTotalBackupSize(_ctx.longValue("DescribeBackupsResponse.Items[" + i + "].TotalBackupSize"));<NEW_LINE>backup.setBackupDownloadURL(_ctx.stringValue("DescribeBackupsResponse.Items[" + i + "].BackupDownloadURL"));<NEW_LINE>backup.setIsAvail(_ctx.integerValue("DescribeBackupsResponse.Items[" + i + "].IsAvail"));<NEW_LINE>backup.setBackupId(_ctx.stringValue("DescribeBackupsResponse.Items[" + i + "].BackupId"));<NEW_LINE>backup.setBackupDBNames(_ctx.stringValue("DescribeBackupsResponse.Items[" + i + "].BackupDBNames"));<NEW_LINE>backup.setHostInstanceID(_ctx.stringValue("DescribeBackupsResponse.Items[" + i + "].HostInstanceID"));<NEW_LINE>backup.setBackupSize(_ctx.longValue("DescribeBackupsResponse.Items[" + i + "].BackupSize"));<NEW_LINE>backup.setBackupMode(_ctx.stringValue("DescribeBackupsResponse.Items[" + i + "].BackupMode"));<NEW_LINE>backup.setDBInstanceId(_ctx.stringValue("DescribeBackupsResponse.Items[" + i + "].DBInstanceId"));<NEW_LINE>backup.setBackupExtractionStatus(_ctx.stringValue("DescribeBackupsResponse.Items[" + i + "].BackupExtractionStatus"));<NEW_LINE>backup.setChecksum(_ctx.stringValue("DescribeBackupsResponse.Items[" + i + "].Checksum"));<NEW_LINE>List<BackupDownloadLinkByDBItem> backupDownloadLinkByDB = new ArrayList<BackupDownloadLinkByDBItem>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeBackupsResponse.Items[" + i + "].BackupDownloadLinkByDB.Length"); j++) {<NEW_LINE>BackupDownloadLinkByDBItem backupDownloadLinkByDBItem = new BackupDownloadLinkByDBItem();<NEW_LINE>backupDownloadLinkByDBItem.setIntranetDownloadLink(_ctx.stringValue("DescribeBackupsResponse.Items[" + i + "].BackupDownloadLinkByDB[" + j + "].IntranetDownloadLink"));<NEW_LINE>backupDownloadLinkByDBItem.setDataBase(_ctx.stringValue("DescribeBackupsResponse.Items[" + i + "].BackupDownloadLinkByDB[" + j + "].DataBase"));<NEW_LINE>backupDownloadLinkByDBItem.setDownloadLink(_ctx.stringValue("DescribeBackupsResponse.Items[" + i + "].BackupDownloadLinkByDB[" + j + "].DownloadLink"));<NEW_LINE>backupDownloadLinkByDB.add(backupDownloadLinkByDBItem);<NEW_LINE>}<NEW_LINE>backup.setBackupDownloadLinkByDB(backupDownloadLinkByDB);<NEW_LINE>items.add(backup);<NEW_LINE>}<NEW_LINE>describeBackupsResponse.setItems(items);<NEW_LINE>return describeBackupsResponse;<NEW_LINE>}
("DescribeBackupsResponse.Items[" + i + "].BackupIntranetDownloadURL"));
1,611,277
default int copyBaseQualities(final int offset, final byte[] destination, final int destinationOffset, final int maxLength) {<NEW_LINE>Utils.nonNull(destination);<NEW_LINE>ParamUtils.isPositiveOrZero(offset, "read base offset must be 0 or greater");<NEW_LINE>ParamUtils.isPositiveOrZero(destinationOffset, "destination array offset must be 0 or greater");<NEW_LINE>ParamUtils.isPositiveOrZero(maxLength, "the requested max-length cannot be negative");<NEW_LINE>if (maxLength == 0 || !hasBaseQualities()) {<NEW_LINE>// short-cut for trival non-copy cases:<NEW_LINE>return 0;<NEW_LINE>} else {<NEW_LINE>final byte[] quals = getBaseQualitiesNoCopy();<NEW_LINE>final int qualsLength = quals.length;<NEW_LINE>Utils.validIndex(offset, qualsLength);<NEW_LINE>final int copyLength = qualsLength - offset < maxLength ? qualsLength - offset : maxLength;<NEW_LINE>System.arraycopy(quals, <MASK><NEW_LINE>return copyLength;<NEW_LINE>}<NEW_LINE>}
offset, destination, destinationOffset, copyLength);
1,503,922
private TaggableItem segment(String field, OperatorNode<ExpressionOperator> ast, String wordData, boolean fromQuery, Class<?> parent, Language language) {<NEW_LINE>String toSegment = wordData;<NEW_LINE>Substring s = getOrigin(ast);<NEW_LINE>Language usedLanguage = language == null ? currentlyParsing.getLanguage() : language;<NEW_LINE>if (s != null) {<NEW_LINE>toSegment = s.getValue();<NEW_LINE>}<NEW_LINE>List<String> words = segmenter.segment(toSegment, usedLanguage);<NEW_LINE>TaggableItem wordItem;<NEW_LINE>if (words.size() == 0) {<NEW_LINE>wordItem = new WordItem(wordData, fromQuery);<NEW_LINE>} else if (words.size() == 1 || !phraseArgumentSupported(parent)) {<NEW_LINE>wordItem = new WordItem(words.get(0), fromQuery);<NEW_LINE>} else {<NEW_LINE>wordItem = new PhraseSegmentItem(toSegment, fromQuery, false);<NEW_LINE>((PhraseSegmentItem) wordItem).setIndexName(field);<NEW_LINE>for (String w : words) {<NEW_LINE>WordItem segment = new WordItem(w, fromQuery);<NEW_LINE>prepareWord(field, ast, segment);<NEW_LINE>((PhraseSegmentItem<MASK><NEW_LINE>}<NEW_LINE>((PhraseSegmentItem) wordItem).lock();<NEW_LINE>}<NEW_LINE>return wordItem;<NEW_LINE>}
) wordItem).addItem(segment);
1,483,025
final PutConfigurationSetReputationOptionsResult executePutConfigurationSetReputationOptions(PutConfigurationSetReputationOptionsRequest putConfigurationSetReputationOptionsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(putConfigurationSetReputationOptionsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<PutConfigurationSetReputationOptionsRequest> request = null;<NEW_LINE>Response<PutConfigurationSetReputationOptionsResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new PutConfigurationSetReputationOptionsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(putConfigurationSetReputationOptionsRequest));<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, "Pinpoint Email");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "PutConfigurationSetReputationOptions");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<PutConfigurationSetReputationOptionsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new PutConfigurationSetReputationOptionsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
569,643
public void sendResponse(final Exchange exchange) {<NEW_LINE>boolean ready = true;<NEW_LINE>Response response = exchange.getCurrentResponse();<NEW_LINE>// ensure Token is set<NEW_LINE>response.ensureToken(exchange.<MASK><NEW_LINE>// Insert CON to match ACKs and RSTs to the exchange.<NEW_LINE>// Do not insert ACKs and RSTs.<NEW_LINE>if (response.getType() == Type.CON) {<NEW_LINE>// If this is a CON notification we now can forget<NEW_LINE>// all previous NON notifications<NEW_LINE>exchange.removeNotifications();<NEW_LINE>if (exchangeStore.registerOutboundResponse(exchange)) {<NEW_LINE>LOGGER.debug("tracking open response [{}]", exchange.getKeyMID());<NEW_LINE>ready = false;<NEW_LINE>} else {<NEW_LINE>response.setSendError(new IllegalStateException("automatic message IDs exhausted"));<NEW_LINE>}<NEW_LINE>} else if (response.getType() == Type.NON) {<NEW_LINE>if (response.isNotification()) {<NEW_LINE>// this is a NON notification<NEW_LINE>// we need to register it so that we can match an RST sent<NEW_LINE>// by a peer that wants to cancel the observation<NEW_LINE>// these NON notifications will later be removed from the<NEW_LINE>// exchange store when Exchange.setComplete() is called<NEW_LINE>if (exchangeStore.registerOutboundResponse(exchange)) {<NEW_LINE>ready = false;<NEW_LINE>} else {<NEW_LINE>response.setSendError(new IllegalStateException("automatic message IDs exhausted"));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// we only need to assign an unused MID but we do not need to<NEW_LINE>// register the exchange under the MID since we do not<NEW_LINE>// expect/want a reply that we would need to match it against<NEW_LINE>if (exchangeStore.assignMessageId(response) == Message.NONE) {<NEW_LINE>response.setSendError(new IllegalStateException("automatic message IDs exhausted"));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Only CONs and Observe keep the exchange active (CoAP server side)<NEW_LINE>if (ready) {<NEW_LINE>exchange.setComplete();<NEW_LINE>}<NEW_LINE>}
getCurrentRequest().getToken());
437,465
public void deleteById(String id) {<NEW_LINE>String resourceGroupName = <MASK><NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));<NEW_LINE>}<NEW_LINE>String applicationGroupName = Utils.getValueFromIdByName(id, "applicationGroups");<NEW_LINE>if (applicationGroupName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'applicationGroups'.", id)));<NEW_LINE>}<NEW_LINE>String applicationName = Utils.getValueFromIdByName(id, "applications");<NEW_LINE>if (applicationName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'applications'.", id)));<NEW_LINE>}<NEW_LINE>this.deleteWithResponse(resourceGroupName, applicationGroupName, applicationName, Context.NONE);<NEW_LINE>}
Utils.getValueFromIdByName(id, "resourceGroups");
1,659,539
// ==================================================================================================================<NEW_LINE>private static VariantContext annotateWithImpreciseEvidenceLinks(final VariantContext variant, final PairedStrandedIntervalTree<EvidenceTargetLink> evidenceTargetLinks, final SAMSequenceDictionary referenceSequenceDictionary, final ReadMetadata metadata, final int defaultUncertainty) {<NEW_LINE>if (variant.getStructuralVariantType() == StructuralVariantType.DEL) {<NEW_LINE>SVContext <MASK><NEW_LINE>final int padding = (metadata == null) ? defaultUncertainty : (metadata.getMaxMedianFragmentSize() / 2);<NEW_LINE>PairedStrandedIntervals svcIntervals = svc.getPairedStrandedIntervals(metadata, referenceSequenceDictionary, padding);<NEW_LINE>final Iterator<Tuple2<PairedStrandedIntervals, EvidenceTargetLink>> overlappers = evidenceTargetLinks.overlappers(svcIntervals);<NEW_LINE>int readPairs = 0;<NEW_LINE>int splitReads = 0;<NEW_LINE>while (overlappers.hasNext()) {<NEW_LINE>final Tuple2<PairedStrandedIntervals, EvidenceTargetLink> next = overlappers.next();<NEW_LINE>readPairs += next._2.getReadPairs();<NEW_LINE>splitReads += next._2.getSplitReads();<NEW_LINE>overlappers.remove();<NEW_LINE>}<NEW_LINE>final VariantContextBuilder variantContextBuilder = new VariantContextBuilder(variant);<NEW_LINE>if (readPairs > 0) {<NEW_LINE>variantContextBuilder.attribute(GATKSVVCFConstants.READ_PAIR_SUPPORT, readPairs);<NEW_LINE>}<NEW_LINE>if (splitReads > 0) {<NEW_LINE>variantContextBuilder.attribute(GATKSVVCFConstants.SPLIT_READ_SUPPORT, splitReads);<NEW_LINE>}<NEW_LINE>return variantContextBuilder.make();<NEW_LINE>} else {<NEW_LINE>return variant;<NEW_LINE>}<NEW_LINE>}
svc = SVContext.of(variant);
396,095
public View render(RenderedAdaptiveCard renderedCard, Context context, FragmentManager fragmentManager, ViewGroup viewGroup, BaseCardElement baseCardElement, ICardActionHandler cardActionHandler, HostConfig hostConfig, RenderArgs renderArgs) throws Exception {<NEW_LINE>ImageSet imageSet = Util.castTo(baseCardElement, ImageSet.class);<NEW_LINE>IBaseCardElementRenderer imageRenderer = CardRendererRegistration.getInstance().getRenderer(CardElementType.Image.toString());<NEW_LINE>if (imageRenderer == null) {<NEW_LINE>throw new IllegalArgumentException("No renderer registered for: " + CardElementType.Image.toString());<NEW_LINE>}<NEW_LINE>HorizontalFlowLayout horizFlowLayout = new HorizontalFlowLayout(context);<NEW_LINE>horizFlowLayout.setTag(new TagContent(imageSet));<NEW_LINE>setVisibility(baseCardElement.GetIsVisible(), horizFlowLayout);<NEW_LINE>ImageSize imageSize = imageSet.GetImageSize();<NEW_LINE><MASK><NEW_LINE>long imageVectorSize = imageVector.size();<NEW_LINE>for (int i = 0; i < imageVectorSize; i++) {<NEW_LINE>Image image = imageVector.get(i);<NEW_LINE>// TODO: temporary - this will be handled in the object model<NEW_LINE>if (imageSize != ImageSize.Small && imageSize != ImageSize.Medium && imageSize != ImageSize.Large) {<NEW_LINE>imageSize = ImageSize.Medium;<NEW_LINE>}<NEW_LINE>image.SetImageSize(imageSize);<NEW_LINE>try {<NEW_LINE>View imageView = imageRenderer.render(renderedCard, context, fragmentManager, horizFlowLayout, image, cardActionHandler, hostConfig, renderArgs);<NEW_LINE>((ImageView) imageView).setMaxHeight(Util.dpToPixels(context, hostConfig.GetImageSet().getMaxImageHeight()));<NEW_LINE>} catch (AdaptiveFallbackException e) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (imageSet.GetHeight() == HeightType.Stretch) {<NEW_LINE>viewGroup.addView(horizFlowLayout, new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT, 1));<NEW_LINE>} else {<NEW_LINE>viewGroup.addView(horizFlowLayout, new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT));<NEW_LINE>}<NEW_LINE>return horizFlowLayout;<NEW_LINE>}
ImageVector imageVector = imageSet.GetImages();
485,717
public void marshall(UpdatePatchBaselineRequest updatePatchBaselineRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (updatePatchBaselineRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(updatePatchBaselineRequest.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(updatePatchBaselineRequest.getGlobalFilters(), GLOBALFILTERS_BINDING);<NEW_LINE>protocolMarshaller.marshall(updatePatchBaselineRequest.getApprovalRules(), APPROVALRULES_BINDING);<NEW_LINE>protocolMarshaller.marshall(updatePatchBaselineRequest.getApprovedPatches(), APPROVEDPATCHES_BINDING);<NEW_LINE>protocolMarshaller.marshall(updatePatchBaselineRequest.getApprovedPatchesComplianceLevel(), APPROVEDPATCHESCOMPLIANCELEVEL_BINDING);<NEW_LINE>protocolMarshaller.marshall(updatePatchBaselineRequest.getApprovedPatchesEnableNonSecurity(), APPROVEDPATCHESENABLENONSECURITY_BINDING);<NEW_LINE>protocolMarshaller.marshall(updatePatchBaselineRequest.getRejectedPatches(), REJECTEDPATCHES_BINDING);<NEW_LINE>protocolMarshaller.marshall(updatePatchBaselineRequest.getRejectedPatchesAction(), REJECTEDPATCHESACTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(updatePatchBaselineRequest.getDescription(), DESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(updatePatchBaselineRequest.getSources(), SOURCES_BINDING);<NEW_LINE>protocolMarshaller.marshall(updatePatchBaselineRequest.getReplace(), REPLACE_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
updatePatchBaselineRequest.getBaselineId(), BASELINEID_BINDING);
1,703,103
protected <E extends Entity> BulkEditorWindow buildEditor(EditorBuilder<E> builder) {<NEW_LINE>FrameOwner origin = builder.getOrigin();<NEW_LINE>Screens screens = getScreenContext(origin).getScreens();<NEW_LINE>if (CollectionUtils.isEmpty(builder.getEntities())) {<NEW_LINE>throw new IllegalStateException(String.format("BulkEditor of %s cannot be open with no entities were set", builder.getMetaClass()));<NEW_LINE>}<NEW_LINE>ScreenOptions options = new MapScreenOptions(ParamsMap.of().pair("metaClass", builder.getMetaClass()).pair("selected", builder.getEntities()).pair("exclude", builder.getExclude()).pair("includeProperties", builder.getIncludeProperties() != null ? builder.getIncludeProperties() : Collections.emptyList()).pair("fieldValidators", builder.getFieldValidators()).pair("modelValidators", builder.getModelValidators()).pair("loadDynamicAttributes", builder.isLoadDynamicAttributes()).pair("useConfirmDialog", builder.isUseConfirmDialog()).pair("fieldSorter", builder.getFieldSorter()).pair("columnsMode", builder.getColumnsMode()).create());<NEW_LINE>BulkEditorWindow bulkEditorWindow = (BulkEditorWindow) screens.create("bulkEditor", builder.launchMode, options);<NEW_LINE>bulkEditorWindow.addAfterCloseListener(afterCloseEvent -> {<NEW_LINE>ListComponent<E> listComponent = builder.getListComponent();<NEW_LINE>CloseAction closeAction = afterCloseEvent.getCloseAction();<NEW_LINE>if (isCommitCloseAction(closeAction) && listComponent != null) {<NEW_LINE>refreshItems(listComponent.getItems());<NEW_LINE>}<NEW_LINE>if (listComponent instanceof com.haulmont.cuba.gui.components.Component.Focusable) {<NEW_LINE>((com.haulmont.cuba.gui.components.Component.<MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>return bulkEditorWindow;<NEW_LINE>}
Focusable) listComponent).focus();
1,286,848
private void recipesCloth(@Nonnull Consumer<FinishedRecipe> out) {<NEW_LINE>ShapedRecipeBuilder.shaped(Cloth.balloon, 2).pattern(" f ").pattern("ftf").pattern(" s ").define('f', IEItems.Ingredients.hempFabric).define('t', Items.TORCH).define('s', IETags.getItemTag(IETags.treatedWoodSlab)).unlockedBy("has_hemp_fabric", has(IETags.fabricHemp)).save(out, toRL(toPath(Cloth.balloon)));<NEW_LINE>ShapedRecipeBuilder.shaped(Cloth.cushion, 3).pattern("fff").pattern("f f").pattern("fff").define('f', IEItems.Ingredients.hempFabric).unlockedBy("has_hemp_fabric", has(IETags.fabricHemp)).save(out, toRL(<MASK><NEW_LINE>ShapedRecipeBuilder.shaped(Cloth.curtain, 3).pattern("sss").pattern("fff").pattern("fff").define('s', IETags.metalRods).define('f', IEItems.Ingredients.hempFabric).unlockedBy("has_hemp_fabric", has(IETags.fabricHemp)).unlockedBy("has_metal_rod", has(IETags.metalRods)).save(out, toRL(toPath(Cloth.curtain)));<NEW_LINE>}
toPath(Cloth.cushion)));
201,359
public Model<Label> train(Dataset<Label> examples, Map<String, Provenance> runProvenance, int invocationCount) {<NEW_LINE>if (examples.getOutputInfo().getUnknownCount() > 0) {<NEW_LINE>throw new IllegalArgumentException("The supplied Dataset contained unknown Outputs, and this Trainer is supervised.");<NEW_LINE>}<NEW_LINE>ImmutableOutputInfo<Label> labelInfos = examples.getOutputIDInfo();<NEW_LINE>ImmutableFeatureMap featureInfos = examples.getFeatureIDMap();<NEW_LINE>Map<Integer, Map<Integer, Double>> labelWeights = new HashMap<>();<NEW_LINE>for (Pair<Integer, Label> label : labelInfos) {<NEW_LINE>labelWeights.put(label.getA(), new HashMap<>());<NEW_LINE>}<NEW_LINE>for (Example<Label> ex : examples) {<NEW_LINE>int idx = labelInfos.getID(ex.getOutput());<NEW_LINE>Map<Integer, Double> featureMap = labelWeights.get(idx);<NEW_LINE>double curWeight = ex.getWeight();<NEW_LINE>for (Feature feat : ex) {<NEW_LINE>if (feat.getValue() < 0.0) {<NEW_LINE>throw new IllegalStateException("Multinomial Naive Bayes requires non-negative features. Found feature " + feat.toString());<NEW_LINE>}<NEW_LINE>featureMap.merge(featureInfos.getID(feat.getName()), curWeight * feat.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (invocationCount != INCREMENT_INVOCATION_COUNT) {<NEW_LINE>setInvocationCount(invocationCount);<NEW_LINE>}<NEW_LINE>TrainerProvenance trainerProvenance = getProvenance();<NEW_LINE>ModelProvenance provenance = new ModelProvenance(MultinomialNaiveBayesModel.class.getName(), OffsetDateTime.now(), examples.getProvenance(), trainerProvenance, runProvenance);<NEW_LINE>trainInvocationCount++;<NEW_LINE>SparseVector[] labelVectors = new SparseVector[labelInfos.size()];<NEW_LINE>for (int i = 0; i < labelInfos.size(); i++) {<NEW_LINE>SparseVector sv = SparseVector.createSparseVector(featureInfos.size(), labelWeights.get(i));<NEW_LINE>double unsmoothedZ = sv.oneNorm();<NEW_LINE>sv.foreachInPlace(d -> Math.log((d + alpha) / (unsmoothedZ + (featureInfos.size() * alpha))));<NEW_LINE>labelVectors[i] = sv;<NEW_LINE>}<NEW_LINE>DenseSparseMatrix labelWordProbs = DenseSparseMatrix.createFromSparseVectors(labelVectors);<NEW_LINE>return new MultinomialNaiveBayesModel("", provenance, featureInfos, labelInfos, labelWordProbs, alpha);<NEW_LINE>}
getValue(), Double::sum);
1,469,487
public static <T extends ImageBase<T>> void down(T input, T output) {<NEW_LINE>if (ImageGray.class.isAssignableFrom(input.getClass())) {<NEW_LINE>if (BoofConcurrency.USE_CONCURRENT) {<NEW_LINE>if (input instanceof GrayU8) {<NEW_LINE>GrayF32 middle = new GrayF32(output.width, input.height);<NEW_LINE>ImplAverageDownSample_MT.horizontal((GrayU8) input, middle);<NEW_LINE>ImplAverageDownSample_MT.vertical(middle, (GrayI8) output);<NEW_LINE>} else if (input instanceof GrayU16) {<NEW_LINE>GrayF32 middle = new GrayF32(output.width, input.height);<NEW_LINE>ImplAverageDownSample_MT.horizontal((GrayU16) input, middle);<NEW_LINE>ImplAverageDownSample_MT.vertical(middle, (GrayU16) output);<NEW_LINE>} else if (input instanceof GrayF32) {<NEW_LINE>GrayF32 middle = new GrayF32(output.width, input.height);<NEW_LINE>ImplAverageDownSample_MT.horizontal((GrayF32) input, middle);<NEW_LINE>ImplAverageDownSample_MT.vertical(middle, (GrayF32) output);<NEW_LINE>} else if (input instanceof GrayF64) {<NEW_LINE>GrayF64 middle = new GrayF64(output.width, input.height);<NEW_LINE>ImplAverageDownSample_MT.horizontal((GrayF64) input, middle);<NEW_LINE>ImplAverageDownSample_MT.vertical<MASK><NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("Unknown image type");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (input instanceof GrayU8) {<NEW_LINE>GrayF32 middle = new GrayF32(output.width, input.height);<NEW_LINE>ImplAverageDownSample.horizontal((GrayU8) input, middle);<NEW_LINE>ImplAverageDownSample.vertical(middle, (GrayI8) output);<NEW_LINE>} else if (input instanceof GrayU16) {<NEW_LINE>GrayF32 middle = new GrayF32(output.width, input.height);<NEW_LINE>ImplAverageDownSample.horizontal((GrayU16) input, middle);<NEW_LINE>ImplAverageDownSample.vertical(middle, (GrayU16) output);<NEW_LINE>} else if (input instanceof GrayF32) {<NEW_LINE>GrayF32 middle = new GrayF32(output.width, input.height);<NEW_LINE>ImplAverageDownSample.horizontal((GrayF32) input, middle);<NEW_LINE>ImplAverageDownSample.vertical(middle, (GrayF32) output);<NEW_LINE>} else if (input instanceof GrayF64) {<NEW_LINE>GrayF64 middle = new GrayF64(output.width, input.height);<NEW_LINE>ImplAverageDownSample.horizontal((GrayF64) input, middle);<NEW_LINE>ImplAverageDownSample.vertical(middle, (GrayF64) output);<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("Unknown image type");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (Planar.class.isAssignableFrom(input.getClass())) {<NEW_LINE>down((Planar) input, (Planar) output);<NEW_LINE>}<NEW_LINE>}
(middle, (GrayF64) output);
658,285
private void generateCheckin(List<BaseTerminalEvent> eventBatch) {<NEW_LINE>// Generate up to 100 unique terminal ids between 100 and 200<NEW_LINE>String[] termIds = new String[100];<NEW_LINE>for (int i = 0; i < termIds.length; i++) {<NEW_LINE>termIds[i] = Long.toString(i + 1000);<NEW_LINE>}<NEW_LINE>// Swap terminals to get a random ordering<NEW_LINE>randomize(termIds);<NEW_LINE>// Add a check-in event for each<NEW_LINE>for (int i = 0; i < termIds.length; i++) {<NEW_LINE>Checkin checkin = new Checkin(new TerminalInfo(termIds[i]));<NEW_LINE>eventBatch.add(checkin);<NEW_LINE>}<NEW_LINE>// Add a cancelled or completed or out-of-order for each<NEW_LINE>int completedCount = 0;<NEW_LINE>int cancelledCount = 0;<NEW_LINE>int outOfOrderCount = 0;<NEW_LINE>for (int i = 0; i < termIds.length; i++) {<NEW_LINE>BaseTerminalEvent theEvent = null;<NEW_LINE>// With a 1 in 1000 chance send an OutOfOrder<NEW_LINE>if (random.nextInt(1000) == 0) {<NEW_LINE>outOfOrderCount++;<NEW_LINE>theEvent = new OutOfOrder(new TerminalInfo(termIds[i]));<NEW_LINE>System.out.println("Generated an Checkin followed by " + theEvent.getType() + " event for terminal " + theEvent.getTerm().getId());<NEW_LINE>} else if (random.nextBoolean()) {<NEW_LINE>completedCount++;<NEW_LINE>theEvent = new Completed(new TerminalInfo(termIds[i]));<NEW_LINE>} else {<NEW_LINE>cancelledCount++;<NEW_LINE>theEvent = new Cancelled(new <MASK><NEW_LINE>}<NEW_LINE>eventBatch.add(theEvent);<NEW_LINE>}<NEW_LINE>System.out.println("Generated " + termIds.length + " Checkin events followed by " + completedCount + " Completed and " + cancelledCount + " Cancelled and " + outOfOrderCount + " OutOfOrder events");<NEW_LINE>}
TerminalInfo(termIds[i]));
388,586
public void updateAllocationLUForTU(final I_M_HU tuHU) {<NEW_LINE>Check.assume(handlingUnitsBL.isTransportUnitOrVirtual(tuHU), "{} shall be a TU", tuHU);<NEW_LINE>final I_M_HU <MASK><NEW_LINE>final IHUContext huContext = huContextFactory.createMutableHUContext(getContextAware(tuHU));<NEW_LINE>//<NEW_LINE>// Iterate all QtyPicked records and update M_LU_HU_ID<NEW_LINE>final List<I_M_ShipmentSchedule_QtyPicked> ssQtyPickedList = huShipmentScheduleDAO.retrieveSchedsQtyPickedForHU(tuHU);<NEW_LINE>for (final I_M_ShipmentSchedule_QtyPicked ssQtyPicked : ssQtyPickedList) {<NEW_LINE>// Don't touch those which were already delivered<NEW_LINE>if (shipmentScheduleAllocBL.isDelivered(ssQtyPicked)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// Update LU<NEW_LINE>ssQtyPicked.setM_LU_HU(luHU);<NEW_LINE>ShipmentScheduleWithHU.ofShipmentScheduleQtyPicked(ssQtyPicked, huContext).updateQtyTUAndQtyLU();<NEW_LINE>save(ssQtyPicked);<NEW_LINE>}<NEW_LINE>}
luHU = handlingUnitsBL.getLoadingUnitHU(tuHU);
1,294,675
public JsonNode injectTimestamp(final AirbyteRecordMessage message) {<NEW_LINE>final String streamName = message.getStream();<NEW_LINE>final List<String> cursorField = streamCursorFields.get(streamName);<NEW_LINE>final JsonNode data = message.getData();<NEW_LINE>if (timestampInferenceEnabled && cursorField != null) {<NEW_LINE>try {<NEW_LINE>final String timestamp = parseTimestamp(cursorField, data);<NEW_LINE>injectTimestamp(data, timestamp);<NEW_LINE>} catch (final Exception e) {<NEW_LINE>// If parsing of timestamp has failed, remove stream from timestamp-parsable stream map,<NEW_LINE>// so it won't be parsed for future messages.<NEW_LINE><MASK><NEW_LINE>streamCursorFields.remove(streamName);<NEW_LINE>injectTimestamp(data, Instant.ofEpochMilli(message.getEmittedAt()).toString());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>injectTimestamp(data, Instant.ofEpochMilli(message.getEmittedAt()).toString());<NEW_LINE>}<NEW_LINE>return data;<NEW_LINE>}
LOGGER.info("Unable to parse cursor field: {} into a keen.timestamp", cursorField);
1,786,878
private static void tryMT(RegressionEnvironment env, int numSeconds, int numWriteThreads) throws InterruptedException {<NEW_LINE>RegressionPath path = new RegressionPath();<NEW_LINE>String eplCreateVariable = "@public create table varagg (c0 int, c1 int, c2 int, c3 int, c4 int, c5 int)";<NEW_LINE>env.compileDeploy(eplCreateVariable, path);<NEW_LINE>String eplMerge = "on SupportBean_S0 merge varagg " + "when not matched then insert select -1 as c0, -1 as c1, -1 as c2, -1 as c3, -1 as c4, -1 as c5 " + "when matched then update set c0=id, c1=id, c2=id, c3=id, c4=id, c5=id";<NEW_LINE>env.compileDeploy(eplMerge, path);<NEW_LINE>String eplQuery = "@name('s0') select varagg.c0 as c0, varagg.c1 as c1, varagg.c2 as c2," + "varagg.c3 as c3, varagg.c4 as c4, varagg.c5 as c5 from SupportBean_S1";<NEW_LINE>env.compileDeploy(eplQuery, path).addListener("s0");<NEW_LINE>Thread[] writeThreads = new Thread[numWriteThreads];<NEW_LINE>WriteRunnable[] writeRunnables = new WriteRunnable[numWriteThreads];<NEW_LINE>for (int i = 0; i < writeThreads.length; i++) {<NEW_LINE>writeRunnables[i] = new WriteRunnable(env, i);<NEW_LINE>writeThreads[i] = new Thread(writeRunnables[i], InfraTableMTUngroupedAccessReadMergeWrite.class.getSimpleName() + "-write");<NEW_LINE>writeThreads[i].start();<NEW_LINE>}<NEW_LINE>ReadRunnable readRunnable = new ReadRunnable(env, env.listener("s0"));<NEW_LINE>Thread readThread = new Thread(readRunnable, InfraTableMTUngroupedAccessReadMergeWrite.class.getSimpleName() + "-read");<NEW_LINE>readThread.start();<NEW_LINE>Thread.sleep(numSeconds * 1000);<NEW_LINE>// join<NEW_LINE>log.info("Waiting for completion");<NEW_LINE>for (int i = 0; i < writeThreads.length; i++) {<NEW_LINE>writeRunnables[i].setShutdown(true);<NEW_LINE>writeThreads[i].join();<NEW_LINE>assertNull(writeRunnables<MASK><NEW_LINE>}<NEW_LINE>readRunnable.setShutdown(true);<NEW_LINE>readThread.join();<NEW_LINE>env.undeployAll();<NEW_LINE>assertNull(readRunnable.getException());<NEW_LINE>}
[i].getException());
1,303,227
public ListImagePackagesResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListImagePackagesResult listImagePackagesResult = new ListImagePackagesResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return listImagePackagesResult;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("requestId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listImagePackagesResult.setRequestId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("imagePackageList", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listImagePackagesResult.setImagePackageList(new ListUnmarshaller<ImagePackage>(ImagePackageJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("nextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listImagePackagesResult.setNextToken(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return listImagePackagesResult;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
1,413,143
public PipelineState pipelineStateFor(String pipelineName) {<NEW_LINE>String cacheKey = pipelineLockStateCacheKey(pipelineName);<NEW_LINE>PipelineState pipelineState = (PipelineState) goCache.get(cacheKey);<NEW_LINE>if (pipelineState != null) {<NEW_LINE>return pipelineState.equals(PipelineState.NOT_LOCKED) ? null : pipelineState;<NEW_LINE>}<NEW_LINE>synchronized (cacheKey) {<NEW_LINE>pipelineState = (PipelineState) goCache.get(cacheKey);<NEW_LINE>if (pipelineState != null) {<NEW_LINE>return pipelineState.equals(PipelineState.NOT_LOCKED) ? null : pipelineState;<NEW_LINE>}<NEW_LINE>pipelineState = (PipelineState) transactionTemplate.execute(new TransactionCallback() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Object doInTransaction(TransactionStatus transactionStatus) {<NEW_LINE>return sessionFactory.getCurrentSession().createCriteria(PipelineState.class).add(Restrictions.eq("pipelineName", pipelineName)).<MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>if (pipelineState != null && pipelineState.isLocked()) {<NEW_LINE>StageIdentifier lockedBy = (StageIdentifier) getSqlMapClientTemplate().queryForObject("lockedPipeline", pipelineState.getLockedByPipelineId());<NEW_LINE>pipelineState.setLockedBy(lockedBy);<NEW_LINE>}<NEW_LINE>goCache.put(cacheKey, pipelineState == null ? PipelineState.NOT_LOCKED : pipelineState);<NEW_LINE>return pipelineState;<NEW_LINE>}<NEW_LINE>}
setCacheable(false).uniqueResult();
1,827,819
public ActionResult<Wo> call() throws Exception {<NEW_LINE>ActionResult<Wo> result = new ActionResult<>();<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>Business business = new Business(emc);<NEW_LINE>WorkCompleted workCompleted = emc.find(id, WorkCompleted.class);<NEW_LINE>if (null == workCompleted) {<NEW_LINE>throw new ExceptionEntityNotExist(id, WorkCompleted.class);<NEW_LINE>}<NEW_LINE>Snap snap = new Snap(workCompleted);<NEW_LINE>List<Item> items = new ArrayList<>();<NEW_LINE>List<TaskCompleted> taskCompleteds = new ArrayList<>();<NEW_LINE>List<Read> reads = new ArrayList<>();<NEW_LINE>List<ReadCompleted> readCompleteds = new ArrayList<>();<NEW_LINE>List<Review> reviews = new ArrayList<>();<NEW_LINE>List<WorkLog> workLogs = new ArrayList<>();<NEW_LINE>List<Record> records = new ArrayList<>();<NEW_LINE>List<Attachment> attachments = new ArrayList<>();<NEW_LINE>snap.setProperties(snap(business, workCompleted.getJob(), items, workCompleted, taskCompleteds, reads, readCompleteds, reviews, workLogs, records, attachments));<NEW_LINE><MASK><NEW_LINE>emc.beginTransaction(Snap.class);<NEW_LINE>emc.persist(snap, CheckPersistType.all);<NEW_LINE>emc.commit();<NEW_LINE>clean(business, items, workCompleted, taskCompleteds, reads, readCompleteds, reviews, workLogs, records, attachments);<NEW_LINE>emc.commit();<NEW_LINE>Wo wo = new Wo();<NEW_LINE>wo.setId(snap.getId());<NEW_LINE>result.setData(wo);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>}
snap.setType(Snap.TYPE_ABANDONEDWORKCOMPLETED);
1,207,933
protected AtomicValue[] atomize(final Axis mOperand) throws SirixXPathException {<NEW_LINE>final XmlNodeReadOnlyTrx trx = asXdmNodeReadTrx();<NEW_LINE>int type = trx.getTypeKey();<NEW_LINE>// (3.) if type is untypedAtomic, cast to string<NEW_LINE>if (type == trx.keyForName("xs:unytpedAtomic")) {<NEW_LINE>type = trx.keyForName("xs:string");<NEW_LINE>}<NEW_LINE>final AtomicValue atomized = new AtomicValue(((XmlNodeReadOnlyTrx) mOperand.asXdmNodeReadTrx()).getValue(<MASK><NEW_LINE>final AtomicValue[] op = { atomized };<NEW_LINE>// (4.) the operands must be singletons in case of a value comparison<NEW_LINE>if (mOperand.hasNext()) {<NEW_LINE>throw EXPathError.XPTY0004.getEncapsulatedException();<NEW_LINE>} else {<NEW_LINE>return op;<NEW_LINE>}<NEW_LINE>}
).getBytes(), type);
1,393,398
public void processElement(ProcessContext c) throws Exception {<NEW_LINE>Iterable<MutationGroup> mutations = c.element();<NEW_LINE>// Batch upsert rows.<NEW_LINE>try {<NEW_LINE>mutationGroupBatchesReceived.inc();<NEW_LINE>mutationGroupsReceived.inc(Iterables.size(mutations));<NEW_LINE>Iterable<Mutation> <MASK><NEW_LINE>writeMutations(batch);<NEW_LINE>mutationGroupBatchesWriteSuccess.inc();<NEW_LINE>mutationGroupsWriteSuccess.inc(Iterables.size(mutations));<NEW_LINE>return;<NEW_LINE>} catch (SpannerException e) {<NEW_LINE>mutationGroupBatchesWriteFail.inc();<NEW_LINE>if (failureMode == FailureMode.REPORT_FAILURES) {<NEW_LINE>// fall through and retry individual mutationGroups.<NEW_LINE>} else if (failureMode == FailureMode.FAIL_FAST) {<NEW_LINE>mutationGroupsWriteFail.inc(Iterables.size(mutations));<NEW_LINE>throw e;<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("Unknown failure mode " + failureMode);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// If we are here, writing a batch has failed, retry individual mutations.<NEW_LINE>for (MutationGroup mg : mutations) {<NEW_LINE>try {<NEW_LINE>spannerWriteRetries.inc();<NEW_LINE>writeMutations(mg);<NEW_LINE>mutationGroupsWriteSuccess.inc();<NEW_LINE>} catch (SpannerException e) {<NEW_LINE>mutationGroupsWriteFail.inc();<NEW_LINE>LOG.warn("Failed to write the mutation group: " + mg, e);<NEW_LINE>c.output(failedTag, mg);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
batch = Iterables.concat(mutations);
395,112
private List<ApplicationDictItem> listWithApplicationDictWithPath(String applicationDict, String... paths) throws Exception {<NEW_LINE>EntityManager em = this.emc.get(ApplicationDictItem.class);<NEW_LINE>CriteriaBuilder cb = em.getCriteriaBuilder();<NEW_LINE>CriteriaQuery<ApplicationDictItem> cq = <MASK><NEW_LINE>Root<ApplicationDictItem> root = cq.from(ApplicationDictItem.class);<NEW_LINE>Predicate p = cb.equal(root.get(ApplicationDictItem_.bundle), applicationDict);<NEW_LINE>for (int i = 0; (i < paths.length && i < 8); i++) {<NEW_LINE>p = cb.and(p, cb.equal(root.get(("path" + i)), paths[i]));<NEW_LINE>}<NEW_LINE>cq.select(root).where(p);<NEW_LINE>List<ApplicationDictItem> list = em.createQuery(cq).getResultList();<NEW_LINE>return list;<NEW_LINE>}
cb.createQuery(ApplicationDictItem.class);
899,154
public void marshall(ResourceShareAssociation resourceShareAssociation, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (resourceShareAssociation == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(resourceShareAssociation.getResourceShareArn(), RESOURCESHAREARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(resourceShareAssociation.getResourceShareName(), RESOURCESHARENAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(resourceShareAssociation.getAssociatedEntity(), ASSOCIATEDENTITY_BINDING);<NEW_LINE>protocolMarshaller.marshall(resourceShareAssociation.getAssociationType(), ASSOCIATIONTYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(resourceShareAssociation.getStatus(), STATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(resourceShareAssociation.getStatusMessage(), STATUSMESSAGE_BINDING);<NEW_LINE>protocolMarshaller.marshall(resourceShareAssociation.getCreationTime(), CREATIONTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(resourceShareAssociation.getLastUpdatedTime(), LASTUPDATEDTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
resourceShareAssociation.getExternal(), EXTERNAL_BINDING);
779,049
public Object apply(final ActionContext ctx, final Object caller, final Object[] sources) throws FrameworkException {<NEW_LINE>try {<NEW_LINE>assertArrayHasMinLengthAndMaxLengthAndAllElementsNotNull(sources, 7, 8);<NEW_LINE>final String from = sources[0].toString();<NEW_LINE>final String fromName = sources[1].toString();<NEW_LINE>final String to = sources[2].toString();<NEW_LINE>final String toName = sources[3].toString();<NEW_LINE>final String subject = sources[4].toString();<NEW_LINE>final String htmlContent = sources[5].toString();<NEW_LINE>final String textContent = sources[6].toString();<NEW_LINE>List<File> fileNodes = null;<NEW_LINE>List<DynamicMailAttachment> attachments = new ArrayList<>();<NEW_LINE>try {<NEW_LINE>if (sources.length == 8 && sources[7] instanceof List && ((List) sources[7]).size() > 0 && ((List) sources[7]).get(0) instanceof File) {<NEW_LINE>fileNodes = (List<MASK><NEW_LINE>for (File fileNode : fileNodes) {<NEW_LINE>final DynamicMailAttachment attachment = new DynamicMailAttachment();<NEW_LINE>attachment.setName(fileNode.getProperty(File.name));<NEW_LINE>attachment.setDisposition(EmailAttachment.ATTACHMENT);<NEW_LINE>if (fileNode.isTemplate()) {<NEW_LINE>attachment.setDataSource(fileNode);<NEW_LINE>} else {<NEW_LINE>attachment.setDataSource(new FileDataSource(fileNode.getFileOnDisk()));<NEW_LINE>}<NEW_LINE>attachments.add(attachment);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return MailHelper.sendHtmlMail(from, fromName, to, toName, null, null, from, subject, htmlContent, textContent, attachments);<NEW_LINE>} catch (EmailException ex) {<NEW_LINE>logException(caller, ex, sources);<NEW_LINE>}<NEW_LINE>} catch (ArgumentNullException pe) {<NEW_LINE>logParameterError(caller, sources, pe.getMessage(), ctx.isJavaScriptContext());<NEW_LINE>} catch (ArgumentCountException pe) {<NEW_LINE>logParameterError(caller, sources, pe.getMessage(), ctx.isJavaScriptContext());<NEW_LINE>return usage(ctx.isJavaScriptContext());<NEW_LINE>}<NEW_LINE>return "";<NEW_LINE>}
<File>) sources[7];
1,659,869
private List<JavaMethodHost> buildUpdateMethodHosts(List<JavaParameterHost> allColumns, List<GenTaskBySqlBuilder> currentTableBuilders) throws Exception {<NEW_LINE>List<JavaMethodHost> methods = new ArrayList<>();<NEW_LINE>for (GenTaskBySqlBuilder builder : currentTableBuilders) {<NEW_LINE>if (!builder.getCrud_type().equals("update")) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>JavaMethodHost method = new JavaMethodHost();<NEW_LINE>method.setCrud_type(builder.getCrud_type());<NEW_LINE>method.setName(builder.getMethod_name());<NEW_LINE>method.setSql(builder.getSql_content());<NEW_LINE>method.setScalarType(builder.getScalarType());<NEW_LINE>method.setPaging(builder.getPagination());<NEW_LINE>method.<MASK><NEW_LINE>method.setField(buildSelectFieldExp(builder));<NEW_LINE>method.setTableName(builder.getTable_name());<NEW_LINE>List<JavaParameterHost> updateSetParameters = new ArrayList<>();<NEW_LINE>// Have both set and condition clause<NEW_LINE>String[] fields = StringUtils.split(builder.getFields(), ",");<NEW_LINE>for (String field : fields) {<NEW_LINE>for (JavaParameterHost pHost : allColumns) {<NEW_LINE>if (pHost.getName().equals(field)) {<NEW_LINE>JavaParameterHost host_ls = new JavaParameterHost(pHost);<NEW_LINE>updateSetParameters.add(host_ls);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>method.setUpdateSetParameters(updateSetParameters);<NEW_LINE>method.setParameters(buildMethodParameterHost4SqlConditin(builder, allColumns));<NEW_LINE>method.setHints(builder.getHints());<NEW_LINE>methods.add(method);<NEW_LINE>}<NEW_LINE>return methods;<NEW_LINE>}
setComments(builder.getComment());
804,654
public final FieldaccessContext fieldaccess() throws RecognitionException {<NEW_LINE>FieldaccessContext _localctx = new FieldaccessContext(_ctx, getState());<NEW_LINE>enterRule(_localctx, 56, RULE_fieldaccess);<NEW_LINE>int _la;<NEW_LINE>try {<NEW_LINE>enterOuterAlt(_localctx, 1);<NEW_LINE>{<NEW_LINE>setState(430);<NEW_LINE><MASK><NEW_LINE>if (!(_la == DOT || _la == NSDOT)) {<NEW_LINE>_errHandler.recoverInline(this);<NEW_LINE>} else {<NEW_LINE>consume();<NEW_LINE>}<NEW_LINE>setState(431);<NEW_LINE>_la = _input.LA(1);<NEW_LINE>if (!(_la == DOTINTEGER || _la == DOTID)) {<NEW_LINE>_errHandler.recoverInline(this);<NEW_LINE>} else {<NEW_LINE>consume();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (RecognitionException re) {<NEW_LINE>_localctx.exception = re;<NEW_LINE>_errHandler.reportError(this, re);<NEW_LINE>_errHandler.recover(this, re);<NEW_LINE>} finally {<NEW_LINE>exitRule();<NEW_LINE>}<NEW_LINE>return _localctx;<NEW_LINE>}
_la = _input.LA(1);
361,502
public BatchOperator<?> transform(BatchOperator<?> input) {<NEW_LINE>List<<MASK><NEW_LINE>int maxNumThread = getMaxNumThread(this);<NEW_LINE>for (PipelineModel model : pipelineModels) {<NEW_LINE>if (model.transformers.length == 1) {<NEW_LINE>input = model.transformers[0].transform(input);<NEW_LINE>} else {<NEW_LINE>int maxCurModelNumThread = getMaxNumThread(model);<NEW_LINE>if (0 >= maxCurModelNumThread) {<NEW_LINE>maxCurModelNumThread = maxNumThread;<NEW_LINE>}<NEW_LINE>if (0 >= maxCurModelNumThread) {<NEW_LINE>maxCurModelNumThread = MapperParams.NUM_THREADS.getDefaultValue();<NEW_LINE>}<NEW_LINE>BatchOperator<?> pipelineExpandModel = model.save();<NEW_LINE>TableSchema outSchema = getOutSchema(model, input.getSchema());<NEW_LINE>input = new PipelinePredictBatchOp().setMLEnvironmentId(input.getMLEnvironmentId()).setNumThreads(maxCurModelNumThread).set(PipelineModelMapper.PIPELINE_TRANSFORM_OUT_COL_NAMES, outSchema.getFieldNames()).set(PipelineModelMapper.PIPELINE_TRANSFORM_OUT_COL_TYPES, FlinkTypeConverter.getTypeString(outSchema.getFieldTypes())).linkFrom(pipelineExpandModel, input);<NEW_LINE>TransformerBase<?> transformer = model.transformers[model.transformers.length - 1];<NEW_LINE>if (transformer.params.get(LAZY_PRINT_TRANSFORM_DATA_ENABLED)) {<NEW_LINE>input.lazyPrint(transformer.params.get(LAZY_PRINT_TRANSFORM_DATA_NUM), transformer.params.get(LAZY_PRINT_TRANSFORM_DATA_TITLE));<NEW_LINE>}<NEW_LINE>if (transformer.params.get(LAZY_PRINT_TRANSFORM_STAT_ENABLED)) {<NEW_LINE>input.lazyPrintStatistics(transformer.params.get(LAZY_PRINT_TRANSFORM_STAT_TITLE));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return postProcessTransformResult(input);<NEW_LINE>}
PipelineModel> pipelineModels = splitPipelineModel(true);
1,418,812
private String genSimpleSelectSql(Node node, List<FieldRelation> fieldRelations, NodeRelation relation, List<FilterFunction> filters, FilterStrategy filterStrategy, Map<String, Node> nodeMap) {<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append("SELECT ");<NEW_LINE>Map<String, FieldRelation> fieldRelationMap = new HashMap<>(fieldRelations.size());<NEW_LINE>fieldRelations.forEach(s -> {<NEW_LINE>fieldRelationMap.put(s.getOutputField(<MASK><NEW_LINE>});<NEW_LINE>if (node instanceof HbaseLoadNode) {<NEW_LINE>HbaseLoadNode hbaseLoadNode = (HbaseLoadNode) node;<NEW_LINE>parseHbaseLoadFieldRelation(hbaseLoadNode.getRowKey(), hbaseLoadNode.getFieldRelations(), sb);<NEW_LINE>} else {<NEW_LINE>parseFieldRelations(node.getFields(), fieldRelationMap, sb);<NEW_LINE>}<NEW_LINE>if (node instanceof DistinctNode) {<NEW_LINE>genDistinctSql((DistinctNode) node, sb);<NEW_LINE>}<NEW_LINE>sb.append("\n FROM `").append(nodeMap.get(relation.getInputs().get(0)).genTableName()).append("` ");<NEW_LINE>parseFilterFields(filterStrategy, filters, sb);<NEW_LINE>if (node instanceof DistinctNode) {<NEW_LINE>sb = genDistinctFilterSql(node.getFields(), sb);<NEW_LINE>}<NEW_LINE>return sb.toString();<NEW_LINE>}
).getName(), s);
1,573,324
public static String encode(Encoding encoding, String hrp, final byte[] values) {<NEW_LINE>checkArgument(hrp.length() >= 1, "Human-readable part is too short");<NEW_LINE>checkArgument(hrp.length() <= 83, "Human-readable part is too long");<NEW_LINE>hrp = hrp.toLowerCase(Locale.ROOT);<NEW_LINE>byte[] checksum = createChecksum(encoding, hrp, values);<NEW_LINE>byte[] combined = new byte[values.length + checksum.length];<NEW_LINE>System.arraycopy(values, 0, combined, 0, values.length);<NEW_LINE>System.arraycopy(checksum, 0, combined, values.length, checksum.length);<NEW_LINE>StringBuilder sb = new StringBuilder(hrp.length() + 1 + combined.length);<NEW_LINE>sb.append(hrp);<NEW_LINE>sb.append('1');<NEW_LINE>for (byte b : combined) {<NEW_LINE>sb.append<MASK><NEW_LINE>}<NEW_LINE>return sb.toString();<NEW_LINE>}
(CHARSET.charAt(b));
904,674
private TUProducerDestination createTUProducerDestination(final int maxTUs) {<NEW_LINE>final I_M_HU_PI tuPI = getTUPI();<NEW_LINE>final TUProducerDestination producer = new TUProducerDestination(tuPI);<NEW_LINE>producer.addCapacityConstraints(productId2tuCapacity.values());<NEW_LINE>//<NEW_LINE>// Set maximum TUs to produce as Qty TU/LU<NEW_LINE>producer.setMaxTUs(maxTUs);<NEW_LINE>// 06902: Make sure we inherit the status and locator.<NEW_LINE>producer.setHUStatus(getHUStatus());<NEW_LINE>producer.setHUClearanceStatus(getHUClearanceStatus(), getHUClearanceNote());<NEW_LINE><MASK><NEW_LINE>producer.setBPartnerId(getBPartnerId());<NEW_LINE>producer.setC_BPartner_Location_ID(getC_BPartner_Location_ID());<NEW_LINE>producer.setIsHUPlanningReceiptOwnerPM(isHUPlanningReceiptOwnerPM());<NEW_LINE>return producer;<NEW_LINE>}
producer.setLocatorId(getLocatorId());
1,560,498
private Class findJmxInterface(String beanKey, Class<?> beanClass) {<NEW_LINE>Class cachedInterface = interfaceCache.get(beanKey);<NEW_LINE>if (cachedInterface != null) {<NEW_LINE>return cachedInterface;<NEW_LINE>}<NEW_LINE>Class mbeanInterface = JmxUtils.getMBeanInterface(beanClass);<NEW_LINE>if (mbeanInterface != null) {<NEW_LINE>// found with MBean ending<NEW_LINE>interfaceCache.put(beanKey, mbeanInterface);<NEW_LINE>return mbeanInterface;<NEW_LINE>}<NEW_LINE>Class[] ifaces = ClassUtils.getAllInterfacesForClass(beanClass);<NEW_LINE>for (Class ifc : ifaces) {<NEW_LINE>ManagedResource <MASK><NEW_LINE>if (metadata != null) {<NEW_LINE>// found with @ManagedResource annotation<NEW_LINE>interfaceCache.put(beanKey, ifc);<NEW_LINE>return ifc;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw new IllegalArgumentException(String.format("Bean %s doesn't implement management interfaces. Management interface should either follow naming scheme or be annotated by @ManagedResource", beanKey));<NEW_LINE>}
metadata = attributeSource.getManagedResource(ifc);
1,183,836
// args of type byte32 should be passed as Hex string for encoding to work<NEW_LINE>private byte[] encodeData(Param[] params, Object... args) {<NEW_LINE>if (args.length > params.length) {<NEW_LINE>throw new CallTransactionException("Too many arguments: " + args.length + " > " + params.length);<NEW_LINE>}<NEW_LINE>int staticSize = 0;<NEW_LINE>int dynamicCnt = 0;<NEW_LINE>// calculating static size and number of dynamic params<NEW_LINE>for (int i = 0; i < args.length; i++) {<NEW_LINE>Param param = params[i];<NEW_LINE>if (param.type.isDynamicType()) {<NEW_LINE>dynamicCnt++;<NEW_LINE>}<NEW_LINE>staticSize += param.type.getFixedSize();<NEW_LINE>}<NEW_LINE>byte[][] bb = new byte[args.length + dynamicCnt][];<NEW_LINE>int curDynamicPtr = staticSize;<NEW_LINE>int curDynamicCnt = 0;<NEW_LINE>for (int i = 0; i < args.length; i++) {<NEW_LINE>Param param = params[i];<NEW_LINE>if (param.type.isDynamicType()) {<NEW_LINE>byte[] dynBB = param.type<MASK><NEW_LINE>bb[i] = SolidityType.IntType.encodeInt(curDynamicPtr);<NEW_LINE>bb[args.length + curDynamicCnt] = dynBB;<NEW_LINE>curDynamicCnt++;<NEW_LINE>curDynamicPtr += dynBB.length;<NEW_LINE>} else {<NEW_LINE>bb[i] = param.type.encode(args[i]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return ByteUtil.merge(bb);<NEW_LINE>}
.encode(args[i]);
46,904
private Map<String, String> tokenToValueMap(Map<String, String> flattenValueNodes) {<NEW_LINE>return flattenValueNodes.keySet().stream().flatMap(this::tokensFromKey).distinct().collect(Collectors.toMap(Function.identity(), t -> flattenValueNodes.compute(Config.Key.unescapeName(t), (k, v) -> {<NEW_LINE>if (v == null) {<NEW_LINE>throw new ConfigException(String.format("Missing token '%s' to resolve.", t));<NEW_LINE>} else if (v.equals("")) {<NEW_LINE>throw new ConfigException(String.format("Missing value in token '%s' definition.", t));<NEW_LINE>} else if (v.startsWith("$")) {<NEW_LINE>throw new ConfigException(String.format("Key token '%s' references to a reference in value. A recursive references is not " + "allowed.", t));<NEW_LINE>}<NEW_LINE>return <MASK><NEW_LINE>})));<NEW_LINE>}
Config.Key.escapeName(v);
1,276,688
public void explain(int p, ExplanationForSignedClause explanation) {<NEW_LINE>IntVar pivot = explanation.readVar(p);<NEW_LINE>assert !explanation.readDom(p).isEmpty();<NEW_LINE>int value = getValue();<NEW_LINE>if (value == 1) {<NEW_LINE>// b is true and X < c holds<NEW_LINE>if (pivot == this) {<NEW_LINE>// b is the pivot<NEW_LINE>assert explanation.readDom(this).cardinality() == 2;<NEW_LINE>this.intersectLit(1, explanation);<NEW_LINE>var.unionLit(cste + 1, IntIterableRangeSet.MAX, explanation);<NEW_LINE>} else /*if (pivot == var)*/<NEW_LINE>{<NEW_LINE>// x is the pivot<NEW_LINE>assert explanation.readDom(this).cardinality() == 1;<NEW_LINE><MASK><NEW_LINE>var.intersectLit(IntIterableRangeSet.MIN, cste, explanation);<NEW_LINE>}<NEW_LINE>} else if (value == 0) {<NEW_LINE>if (pivot == this) {<NEW_LINE>// b is the pivot<NEW_LINE>assert explanation.readDom(this).cardinality() == 2;<NEW_LINE>this.intersectLit(0, explanation);<NEW_LINE>var.unionLit(IntIterableRangeSet.MIN, cste, explanation);<NEW_LINE>} else /*if (pivot == vars[0])*/<NEW_LINE>{<NEW_LINE>// x is the pivot, case e. in javadoc<NEW_LINE>assert explanation.readDom(this).cardinality() == 1;<NEW_LINE>this.unionLit(1, explanation);<NEW_LINE>var.intersectLit(cste + 1, IntIterableRangeSet.MAX, explanation);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
this.unionLit(0, explanation);
692,772
private void maybeReportActiveUploadsOrDownloads(PositionAwareAnsiTerminalWriter terminalWriter) throws IOException {<NEW_LINE><MASK><NEW_LINE>int downloads = activeActionDownloads.get();<NEW_LINE>if (!buildComplete || (uploads == 0 && downloads == 0)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Duration waitTime = Duration.between(buildCompleteAt, Instant.ofEpochMilli(clock.currentTimeMillis()));<NEW_LINE>if (waitTime.getSeconds() == 0) {<NEW_LINE>// Special case for when bazel was interrupted, in which case we don't want to have a message.<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String suffix = "";<NEW_LINE>if (waitTime.compareTo(Duration.ofSeconds(SHOW_TIME_THRESHOLD_SECONDS)) > 0) {<NEW_LINE>suffix = "; " + waitTime.getSeconds() + "s";<NEW_LINE>}<NEW_LINE>String message = "Waiting for remote cache: ";<NEW_LINE>if (uploads != 0) {<NEW_LINE>if (uploads == 1) {<NEW_LINE>message += "1 upload";<NEW_LINE>} else {<NEW_LINE>message += uploads + " uploads";<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (downloads != 0) {<NEW_LINE>if (uploads != 0) {<NEW_LINE>message += ", ";<NEW_LINE>}<NEW_LINE>if (downloads == 1) {<NEW_LINE>message += "1 download";<NEW_LINE>} else {<NEW_LINE>message += downloads + " downloads";<NEW_LINE>}<NEW_LINE>}<NEW_LINE>terminalWriter.newline().append(message).append(suffix);<NEW_LINE>}
int uploads = activeActionUploads.get();
1,356,348
/*<NEW_LINE>* Enum type extensions have the potential to be invalid if incorrectly defined.<NEW_LINE>*<NEW_LINE>* The named type must already be defined and must be an Enum type.<NEW_LINE>* All values of an Enum type extension must be unique.<NEW_LINE>* All values of an Enum type extension must not already be a value of the original Enum.<NEW_LINE>* Any directives provided must not already apply to the original Enum type.<NEW_LINE>*/<NEW_LINE>private void checkEnumTypeExtensions(List<GraphQLError> errors, TypeDefinitionRegistry typeRegistry, Map<String, DirectiveDefinition> directiveDefinitionMap) {<NEW_LINE>typeRegistry.enumTypeExtensions().forEach((name, extensions) -> {<NEW_LINE>checkTypeExtensionHasCorrespondingType(errors, typeRegistry, name, extensions, EnumTypeDefinition.class);<NEW_LINE>extensions.forEach(extension -> {<NEW_LINE>// field unique ness<NEW_LINE>List<EnumValueDefinition> enumValueDefinitions = extension.getEnumValueDefinitions();<NEW_LINE>checkNamedUniqueness(errors, enumValueDefinitions, EnumValueDefinition::getName, (namedField, enumValue) -> <MASK><NEW_LINE>//<NEW_LINE>// enum values must be unique within a type extension<NEW_LINE>forEachBut(extension, extensions, otherTypeExt -> checkForEnumValueRedefinition(errors, otherTypeExt, otherTypeExt.getEnumValueDefinitions(), enumValueDefinitions));<NEW_LINE>//<NEW_LINE>// then check for field re-defs from the base type<NEW_LINE>Optional<EnumTypeDefinition> baseTypeOpt = typeRegistry.getType(extension.getName(), EnumTypeDefinition.class);<NEW_LINE>baseTypeOpt.ifPresent(baseTypeDef -> checkForEnumValueRedefinition(errors, extension, enumValueDefinitions, baseTypeDef.getEnumValueDefinitions()));<NEW_LINE>});<NEW_LINE>});<NEW_LINE>}
new NonUniqueNameError(extension, enumValue));
1,313,548
protected Content prepare(@Nonnull T field, @Nonnull Function<? super String, String> onShow) {<NEW_LINE>Font font = field.getFont();<NEW_LINE>FontMetrics metrics = font == null ? null : field.getFontMetrics(font);<NEW_LINE>int height = metrics == null ? 16 : metrics.getHeight();<NEW_LINE>Dimension size = new Dimension(field.<MASK><NEW_LINE>JPanel mainPanel = new JPanel(new BorderLayout());<NEW_LINE>JTextArea area = new JTextArea(onShow.fun(field.getText()));<NEW_LINE>area.putClientProperty(Expandable.class, this);<NEW_LINE>area.setEditable(field.isEditable());<NEW_LINE>// area.setBackground(field.getBackground());<NEW_LINE>// area.setForeground(field.getForeground());<NEW_LINE>area.setFont(font);<NEW_LINE>area.setWrapStyleWord(true);<NEW_LINE>area.setLineWrap(true);<NEW_LINE>IntelliJExpandableSupport.copyCaretPosition(field, area);<NEW_LINE>UIUtil.addUndoRedoActions(area);<NEW_LINE>JLabel label = ExpandableSupport.createLabel(createCollapseExtension());<NEW_LINE>label.setBorder(JBUI.Borders.empty(5));<NEW_LINE>JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(area, true);<NEW_LINE>mainPanel.add(scrollPane, BorderLayout.CENTER);<NEW_LINE>JPanel eastPanel = new JPanel(new VerticalFlowLayout(0, 0));<NEW_LINE>eastPanel.add(label);<NEW_LINE>mainPanel.add(eastPanel, BorderLayout.EAST);<NEW_LINE>scrollPane.setPreferredSize(size);<NEW_LINE>return new Content() {<NEW_LINE><NEW_LINE>@Nonnull<NEW_LINE>@Override<NEW_LINE>public JComponent getContentComponent() {<NEW_LINE>return mainPanel;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public JComponent getFocusableComponent() {<NEW_LINE>return area;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void cancel(@Nonnull Function<? super String, String> onHide) {<NEW_LINE>if (field.isEditable()) {<NEW_LINE>field.setText(onHide.fun(area.getText()));<NEW_LINE>IntelliJExpandableSupport.copyCaretPosition(area, field);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
getWidth(), height * 16);
1,655,473
private static NBTTagCompound migrate(ItemStack stack, NBTTagCompound nbt) {<NEW_LINE><MASK><NEW_LINE>int metadata = 0, metadataAlt;<NEW_LINE>PipeWire wire = null;<NEW_LINE>if (nbt.hasKey("id"))<NEW_LINE>block = Block.REGISTRY.getObjectById(nbt.getInteger("id"));<NEW_LINE>else if (nbt.hasKey("name"))<NEW_LINE>block = Block.REGISTRY.getObject(new ResourceLocation(nbt.getString("name")));<NEW_LINE>if (nbt.hasKey("name_alt"))<NEW_LINE>blockAlt = Block.REGISTRY.getObject(new ResourceLocation(nbt.getString("name_alt")));<NEW_LINE>if (nbt.hasKey("meta"))<NEW_LINE>metadata = nbt.getInteger("meta");<NEW_LINE>if (nbt.hasKey("meta_alt"))<NEW_LINE>metadataAlt = nbt.getInteger("meta_alt");<NEW_LINE>else<NEW_LINE>metadataAlt = stack.getItemDamage() & 0x0000F;<NEW_LINE>if (nbt.hasKey("wire"))<NEW_LINE>wire = PipeWire.fromOrdinal(nbt.getInteger("wire"));<NEW_LINE>if (block != null) {<NEW_LINE>FacadeState[] states;<NEW_LINE>FacadeState mainState = FacadeState.create(block.getStateFromMeta(metadata));<NEW_LINE>if (blockAlt != null && wire != null) {<NEW_LINE>FacadeState altState = FacadeState.create(blockAlt.getStateFromMeta(metadataAlt), wire);<NEW_LINE>states = new FacadeState[] { mainState, altState };<NEW_LINE>} else {<NEW_LINE>states = new FacadeState[] { mainState };<NEW_LINE>}<NEW_LINE>NBTTagCompound newNbt = getFacade(states).getTagCompound();<NEW_LINE>stack.setTagCompound(newNbt);<NEW_LINE>return newNbt;<NEW_LINE>}<NEW_LINE>return nbt;<NEW_LINE>}
Block block = null, blockAlt = null;
273,421
private void loadServices(List<Class> notLazyServices, InjectingContainerBuilder builder) {<NEW_LINE>ExtensionPointName<ServiceDescriptor> ep = getServiceExtensionPointName();<NEW_LINE>if (ep != null) {<NEW_LINE>ExtensionPointImpl<ServiceDescriptor> extensionPoint = myExtensionsArea.getExtensionPointImpl(ep);<NEW_LINE>// there no injector at that level - build it via hardcode<NEW_LINE>List<Pair<ServiceDescriptor, PluginDescriptor>> descriptorList = extensionPoint.buildUnsafe(aClass -> new ServiceDescriptor());<NEW_LINE>// and cache it<NEW_LINE>extensionPoint.setExtensionCache(descriptorList);<NEW_LINE>for (ServiceDescriptor descriptor : extensionPoint.getExtensionList()) {<NEW_LINE>InjectingKey<Object> key = InjectingKey.of(descriptor.getInterface(), getTargetClassLoader<MASK><NEW_LINE>InjectingKey<Object> implKey = InjectingKey.of(descriptor.getImplementation(), getTargetClassLoader(descriptor.getPluginDescriptor()));<NEW_LINE>InjectingPoint<Object> point = builder.bind(key);<NEW_LINE>// bind to impl class<NEW_LINE>point.to(implKey);<NEW_LINE>// require singleton<NEW_LINE>point.forceSingleton();<NEW_LINE>// remap object initialization<NEW_LINE>point.factory(objectProvider -> runServiceInitialize(descriptor, objectProvider::get));<NEW_LINE>point.injectListener((time, instance) -> {<NEW_LINE>if (myChecker.containsKey(key.getTargetClass())) {<NEW_LINE>throw new IllegalArgumentException("Duplicate init of " + key.getTargetClass());<NEW_LINE>}<NEW_LINE>myChecker.put(key.getTargetClass(), instance);<NEW_LINE>if (instance instanceof Disposable) {<NEW_LINE>Disposer.register(this, (Disposable) instance);<NEW_LINE>}<NEW_LINE>initializeIfStorableComponent(instance, true, descriptor.isLazy());<NEW_LINE>});<NEW_LINE>if (!descriptor.isLazy()) {<NEW_LINE>// if service is not lazy - add it for init at start<NEW_LINE>notLazyServices.add(key.getTargetClass());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(descriptor.getPluginDescriptor()));
1,837,113
public JobExecution mapRow(ResultSet rs, int rowNum) throws SQLException {<NEW_LINE>Long id = rs.getLong(1);<NEW_LINE>JobExecution jobExecution;<NEW_LINE>if (jobParameters == null) {<NEW_LINE>jobParameters = getJobParameters(id);<NEW_LINE>}<NEW_LINE>if (jobInstance == null) {<NEW_LINE>jobExecution <MASK><NEW_LINE>} else {<NEW_LINE>jobExecution = new JobExecution(jobInstance, id, jobParameters);<NEW_LINE>}<NEW_LINE>jobExecution.setStartTime(rs.getTimestamp(2));<NEW_LINE>jobExecution.setEndTime(rs.getTimestamp(3));<NEW_LINE>jobExecution.setStatus(BatchStatus.valueOf(rs.getString(4)));<NEW_LINE>jobExecution.setExitStatus(new ExitStatus(rs.getString(5), rs.getString(6)));<NEW_LINE>jobExecution.setCreateTime(rs.getTimestamp(7));<NEW_LINE>jobExecution.setLastUpdated(rs.getTimestamp(8));<NEW_LINE>jobExecution.setVersion(rs.getInt(9));<NEW_LINE>return jobExecution;<NEW_LINE>}
= new JobExecution(id, jobParameters);
170,540
protected double featureCost(Target target, Unit unit, String featureName, FeatureDefinition weights, WeightFunc[] weightFunctions) {<NEW_LINE>if (!this.featureDefinition.hasFeature(featureName)) {<NEW_LINE>throw new IllegalArgumentException("this feature does not exists in feature definition");<NEW_LINE>}<NEW_LINE>FeatureVector targetFeatures = target.getFeatureVector();<NEW_LINE>assert targetFeatures != null : "Target " + target + " does not have pre-computed feature vector";<NEW_LINE>FeatureVector unitFeatures = featureVectors[unit.index];<NEW_LINE>int nBytes = targetFeatures.byteValuedDiscreteFeatures.length;<NEW_LINE>int nShorts = targetFeatures.shortValuedDiscreteFeatures.length;<NEW_LINE>int nFloats = targetFeatures.continuousFeatures.length;<NEW_LINE>assert nBytes == unitFeatures.byteValuedDiscreteFeatures.length;<NEW_LINE>assert nShorts == unitFeatures.shortValuedDiscreteFeatures.length;<NEW_LINE>assert nFloats == unitFeatures.continuousFeatures.length;<NEW_LINE>int featureIndex = this.featureDefinition.getFeatureIndex(featureName);<NEW_LINE>float[] weightVector = weights.getFeatureWeights();<NEW_LINE>double cost = 0;<NEW_LINE>if (featureIndex < nBytes) {<NEW_LINE>if (weightsNonZero[featureIndex]) {<NEW_LINE>float weight = weightVector[featureIndex];<NEW_LINE>if (featureDefinition.hasSimilarityMatrix(featureIndex)) {<NEW_LINE>byte targetFeatValueIndex = targetFeatures.byteValuedDiscreteFeatures[featureIndex];<NEW_LINE>byte unitFeatValueIndex = unitFeatures.byteValuedDiscreteFeatures[featureIndex];<NEW_LINE>float similarity = featureDefinition.getSimilarity(featureIndex, unitFeatValueIndex, targetFeatValueIndex);<NEW_LINE>cost = similarity * weight;<NEW_LINE>if (debugShowCostGraph)<NEW_LINE><MASK><NEW_LINE>} else if (targetFeatures.byteValuedDiscreteFeatures[featureIndex] != unitFeatures.byteValuedDiscreteFeatures[featureIndex]) {<NEW_LINE>cost = weight;<NEW_LINE>if (debugShowCostGraph)<NEW_LINE>cumulWeightedCosts[featureIndex] += weight;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (featureIndex < nShorts + nBytes) {<NEW_LINE>if (weightsNonZero[featureIndex]) {<NEW_LINE>float weight = weightVector[featureIndex];<NEW_LINE>// if (targetFeatures.getShortFeature(i) != unitFeatures.getShortFeature(i)) {<NEW_LINE>if (targetFeatures.shortValuedDiscreteFeatures[featureIndex - nBytes] != unitFeatures.shortValuedDiscreteFeatures[featureIndex - nBytes]) {<NEW_LINE>cost = weight;<NEW_LINE>if (debugShowCostGraph)<NEW_LINE>cumulWeightedCosts[featureIndex] += weight;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>int nDiscrete = nBytes + nShorts;<NEW_LINE>if (weightsNonZero[featureIndex]) {<NEW_LINE>float weight = weightVector[featureIndex];<NEW_LINE>// float a = targetFeatures.getContinuousFeature(i);<NEW_LINE>float a = targetFeatures.continuousFeatures[featureIndex - nDiscrete];<NEW_LINE>// float b = unitFeatures.getContinuousFeature(i);<NEW_LINE>float b = unitFeatures.continuousFeatures[featureIndex - nDiscrete];<NEW_LINE>// if (!Float.isNaN(a) && !Float.isNaN(b)) {<NEW_LINE>// Implementation of isNaN() is: (v != v).<NEW_LINE>if (!(a != a) && !(b != b)) {<NEW_LINE>double myCost = weightFunctions[featureIndex - nDiscrete].cost(a, b);<NEW_LINE>cost = weight * myCost;<NEW_LINE>if (debugShowCostGraph) {<NEW_LINE>cumulWeightedCosts[featureIndex] += weight * myCost;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// and if it is NaN, simply compute no cost<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return cost;<NEW_LINE>}
cumulWeightedCosts[featureIndex] += similarity * weight;
1,747,701
public void run() {<NEW_LINE>try {<NEW_LINE>boolean isShutdown = false;<NEW_LINE>do {<NEW_LINE>isShutdown = isShutdown || shutdownRequested.get();<NEW_LINE>final QueueBatch batch = readClient.readBatch();<NEW_LINE>final boolean isFlush = flushRequested.compareAndSet(true, false);<NEW_LINE>if (batch.filteredSize() > 0 || isFlush) {<NEW_LINE>consumedCounter.add(batch.filteredSize());<NEW_LINE>readClient.startMetrics(batch);<NEW_LINE>final int outputCount = execution.<MASK><NEW_LINE>int filteredCount = batch.filteredSize();<NEW_LINE>filteredCounter.add(filteredCount);<NEW_LINE>readClient.addOutputMetrics(outputCount);<NEW_LINE>readClient.addFilteredMetrics(filteredCount);<NEW_LINE>readClient.closeBatch(batch);<NEW_LINE>if (isFlush) {<NEW_LINE>flushing.set(false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} while (!isShutdown || isDraining());<NEW_LINE>// we are shutting down, queue is drained if it was required, now perform a final flush.<NEW_LINE>// for this we need to create a new empty batch to contain the final flushed events<NEW_LINE>final QueueBatch batch = readClient.newBatch();<NEW_LINE>readClient.startMetrics(batch);<NEW_LINE>execution.compute(batch, true, true);<NEW_LINE>readClient.closeBatch(batch);<NEW_LINE>} catch (final Exception ex) {<NEW_LINE>throw new IllegalStateException(ex);<NEW_LINE>}<NEW_LINE>}
compute(batch, isFlush, false);
16,525
protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) {<NEW_LINE>String dataSource = element.getAttribute(ATT_DATA_SOURCE);<NEW_LINE>if (dataSource != null) {<NEW_LINE>builder.addPropertyReference("dataSource", dataSource);<NEW_LINE>} else {<NEW_LINE>parserContext.getReaderContext().error(ATT_DATA_SOURCE + " is required for " + Elements.JDBC_USER_SERVICE, parserContext.extractSource(element));<NEW_LINE>}<NEW_LINE>String usersQuery = element.getAttribute(ATT_USERS_BY_USERNAME_QUERY);<NEW_LINE>String authoritiesQuery = element.getAttribute(ATT_AUTHORITIES_BY_USERNAME_QUERY);<NEW_LINE>String groupAuthoritiesQuery = element.getAttribute(ATT_GROUP_AUTHORITIES_QUERY);<NEW_LINE>String rolePrefix = element.getAttribute(ATT_ROLE_PREFIX);<NEW_LINE>if (StringUtils.hasText(rolePrefix)) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (StringUtils.hasText(usersQuery)) {<NEW_LINE>builder.addPropertyValue("usersByUsernameQuery", usersQuery);<NEW_LINE>}<NEW_LINE>if (StringUtils.hasText(authoritiesQuery)) {<NEW_LINE>builder.addPropertyValue("authoritiesByUsernameQuery", authoritiesQuery);<NEW_LINE>}<NEW_LINE>if (StringUtils.hasText(groupAuthoritiesQuery)) {<NEW_LINE>builder.addPropertyValue("enableGroups", Boolean.TRUE);<NEW_LINE>builder.addPropertyValue("groupAuthoritiesByUsernameQuery", groupAuthoritiesQuery);<NEW_LINE>}<NEW_LINE>}
builder.addPropertyValue("rolePrefix", rolePrefix);
1,126,190
/*<NEW_LINE>* Loads the icon for the application, either a user provided one or the default one.<NEW_LINE>*/<NEW_LINE>private boolean prepareApplicationIcon(File outputPngFile, List<File> mipmapDirectories, List<Integer> standardICSizes, List<Integer> foregroundICSizes) {<NEW_LINE>String userSpecifiedIcon = Strings.<MASK><NEW_LINE>try {<NEW_LINE>BufferedImage icon;<NEW_LINE>if (!userSpecifiedIcon.isEmpty()) {<NEW_LINE>File iconFile = new File(project.getAssetsDirectory(), userSpecifiedIcon);<NEW_LINE>icon = ImageIO.read(iconFile);<NEW_LINE>if (icon == null) {<NEW_LINE>// This can happen if the iconFile isn't an image file.<NEW_LINE>// For example, icon is null if the file is a .wav file.<NEW_LINE>// TODO(lizlooney) - This happens if the user specifies a .ico file. We should<NEW_LINE>// fix that.<NEW_LINE>userErrors.print(String.format(ICON_ERROR, userSpecifiedIcon));<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// Load the default image.<NEW_LINE>icon = ImageIO.read(Compiler.class.getResource(DEFAULT_ICON));<NEW_LINE>}<NEW_LINE>BufferedImage roundIcon = produceRoundIcon(icon);<NEW_LINE>BufferedImage roundRectIcon = produceRoundedCornerIcon(icon);<NEW_LINE>BufferedImage foregroundIcon = produceForegroundImageIcon(icon);<NEW_LINE>// For each mipmap directory, create all types of ic_launcher photos with respective mipmap sizes<NEW_LINE>for (int i = 0; i < mipmapDirectories.size(); i++) {<NEW_LINE>File mipmapDirectory = mipmapDirectories.get(i);<NEW_LINE>Integer standardSize = standardICSizes.get(i);<NEW_LINE>Integer foregroundSize = foregroundICSizes.get(i);<NEW_LINE>BufferedImage round = resizeImage(roundIcon, standardSize, standardSize);<NEW_LINE>BufferedImage roundRect = resizeImage(roundRectIcon, standardSize, standardSize);<NEW_LINE>BufferedImage foreground = resizeImage(foregroundIcon, foregroundSize, foregroundSize);<NEW_LINE>File roundIconPng = new File(mipmapDirectory, "ic_launcher_round.png");<NEW_LINE>File roundRectIconPng = new File(mipmapDirectory, "ic_launcher.png");<NEW_LINE>File foregroundPng = new File(mipmapDirectory, "ic_launcher_foreground.png");<NEW_LINE>ImageIO.write(round, "png", roundIconPng);<NEW_LINE>ImageIO.write(roundRect, "png", roundRectIconPng);<NEW_LINE>ImageIO.write(foreground, "png", foregroundPng);<NEW_LINE>}<NEW_LINE>ImageIO.write(icon, "png", outputPngFile);<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>// If the user specified the icon, this is fatal.<NEW_LINE>if (!userSpecifiedIcon.isEmpty()) {<NEW_LINE>userErrors.print(String.format(ICON_ERROR, userSpecifiedIcon));<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
nullToEmpty(project.getIcon());
1,201,373
private void loadNode472() throws IOException, SAXException {<NEW_LINE>PropertyTypeNode node = new PropertyTypeNode(this.context, Identifiers.ServerConfiguration_CertificateGroups_DefaultHttpsGroup_TrustList_Read_InputArguments, new QualifiedName(0, "InputArguments"), new LocalizedText("en", "InputArguments"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.Argument, 1, new UInteger[] { org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UInteger.valueOf(0) }, UByte.valueOf(1), UByte.valueOf(1), 0.0, false);<NEW_LINE>node.addReference(new Reference(Identifiers.ServerConfiguration_CertificateGroups_DefaultHttpsGroup_TrustList_Read_InputArguments, Identifiers.HasTypeDefinition, Identifiers.PropertyType.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ServerConfiguration_CertificateGroups_DefaultHttpsGroup_TrustList_Read_InputArguments, Identifiers.HasProperty, Identifiers.ServerConfiguration_CertificateGroups_DefaultHttpsGroup_TrustList_Read.expanded(), false));<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append("<ListOfExtensionObject xmlns=\"http://opcfoundation.org/UA/2008/02/Types.xsd\"><ExtensionObject><TypeId><Identifier>i=297</Identifier> </TypeId><Body><Argument><Name>FileHandle</Name><DataType><Identifier>i=7</Identifier> </DataType><ValueRank>-1</ValueRank><ArrayDimensions/> </Argument> </Body> </ExtensionObject><ExtensionObject><TypeId><Identifier>i=297</Identifier> </TypeId><Body><Argument><Name>Length</Name><DataType><Identifier>i=6</Identifier> </DataType><ValueRank>-1</ValueRank><ArrayDimensions/> </Argument> </Body> </ExtensionObject> </ListOfExtensionObject>");<NEW_LINE><MASK><NEW_LINE>OpcUaXmlStreamDecoder decoder = new OpcUaXmlStreamDecoder(context.getServer().getSerializationContext()).setInput(new StringReader(xml));<NEW_LINE>Object o = decoder.readVariantValue();<NEW_LINE>DataValue value = new DataValue(new Variant(o));<NEW_LINE>node.setValue(value);<NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>}
String xml = sb.toString();
455,389
public boolean init() {<NEW_LINE>final ParseLogHandler log = SkriptLogger.startParseLogHandler();<NEW_LINE>try {<NEW_LINE>boolean hasValue = false;<NEW_LINE>final Class<? extends Event>[] es = getParser().getCurrentEvents();<NEW_LINE>if (es == null) {<NEW_LINE>assert false;<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>for (final Class<? extends Event> e : es) {<NEW_LINE>if (getters.containsKey(e)) {<NEW_LINE>hasValue = getters.get(e) != null;<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>final Getter<? extends T, ?> getter = EventValues.getEventValueGetter(<MASK><NEW_LINE>if (getter != null) {<NEW_LINE>getters.put(e, getter);<NEW_LINE>hasValue = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!hasValue) {<NEW_LINE>log.printError("There's no " + Classes.getSuperClassInfo(c).getName() + " in " + Utils.a(getParser().getCurrentEventName()) + " event");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>log.printLog();<NEW_LINE>return true;<NEW_LINE>} finally {<NEW_LINE>log.stop();<NEW_LINE>}<NEW_LINE>}
e, c, getTime());
1,035,614
public void transform(Picture src, Picture dst) {<NEW_LINE>copy(src.getPlaneData(0), dst.getPlaneData(0), src.getWidth(), dst.getWidth(), dst.getHeight());<NEW_LINE>_copy(src.getPlaneData(1), dst.getPlaneData(1), 0, 0, 1, 2, src.getWidth() >> 1, dst.getWidth() >> 1, src.getHeight() >> 1, dst.getHeight());<NEW_LINE>_copy(src.getPlaneData(1), dst.getPlaneData(1), 0, 1, 1, 2, src.getWidth() >> 1, dst.getWidth() >> 1, src.getHeight() >> 1, dst.getHeight());<NEW_LINE>_copy(src.getPlaneData(2), dst.getPlaneData(2), 0, 0, 1, 2, src.getWidth() >> 1, dst.getWidth() >> 1, src.getHeight() >> 1, dst.getHeight());<NEW_LINE>_copy(src.getPlaneData(2), dst.getPlaneData(2), 0, 1, 1, 2, src.getWidth() >> 1, dst.getWidth() >> 1, src.getHeight() >> <MASK><NEW_LINE>}
1, dst.getHeight());
1,724,821
public // }<NEW_LINE>void printStdev(AutoTypeImage typeMean, AutoTypeImage typePow2) {<NEW_LINE>String bitWiseMean = typeMean.getBitWise();<NEW_LINE><MASK><NEW_LINE>String typeCast = typeMean.getDataType();<NEW_LINE>String sumType = typeMean.getSumType();<NEW_LINE>out.print("\tpublic static void stdev( " + typeMean.getSingleBandName() + " mean, " + typePow2.getSingleBandName() + " pow2, " + typeMean.getSingleBandName() + " stdev ) {\n" + "\n" + "\t\tfinal int h = mean.getHeight();\n" + "\t\tfinal int w = mean.getWidth();\n" + "\n" + "\t\t//CONCURRENT_BELOW BoofConcurrency.loopFor(0,h,y->{\n" + "\t\tfor (int y = 0; y < h; y++) {\n" + "\t\t\tint indexMean = mean.startIndex + y * mean.stride;\n" + "\t\t\tint indexPow = pow2.startIndex + y * pow2.stride;\n" + "\t\t\tint indexStdev = stdev.startIndex + y * stdev.stride;\n" + "\n" + "\t\t\tint indexEnd = indexMean+w;\n" + "\t\t\t// for(int x = 0; x < w; x++ ) {\n" + "\t\t\tfor (; indexMean < indexEnd; indexMean++, indexPow++, indexStdev++ ) {\n" + "\t\t\t\t" + sumType + " mu = mean.data[indexMean]" + bitWiseMean + ";\n" + "\t\t\t\t" + sumType + " p2 = pow2.data[indexPow]" + bitWisePow + ";\n" + "\n" + "\t\t\t\tstdev.data[indexStdev] = (" + typeCast + ")Math.sqrt(Math.max(0,p2-mu*mu));\n" + "\t\t\t}\n" + "\t\t}\n" + "\t\t//CONCURRENT_ABOVE });\n" + "\t}\n\n");<NEW_LINE>}
String bitWisePow = typePow2.getBitWise();
330,540
public void show(final String date) {<NEW_LINE>dialog = setDialogLayout();<NEW_LINE>UIUtil.setDialogDefaultFunctions(dialog);<NEW_LINE>ExUtil.asyncRun(new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>ObjectPack objectPack = null;<NEW_LINE>TcpProxy proxy = TcpProxy.getTcpProxy(serverId);<NEW_LINE>try {<NEW_LINE>MapPack param = new MapPack();<NEW_LINE>param.put("date", date);<NEW_LINE>param.put("objHash", objHash);<NEW_LINE>objectPack = (ObjectPack) proxy.<MASK><NEW_LINE>CounterEngine counterEngine = ServerManager.getInstance().getServer(serverId).getCounterEngine();<NEW_LINE>String code = counterEngine.getMasterCounter(objectPack.objType);<NEW_LINE>objectPack.tags.put("main counter", code);<NEW_LINE>} catch (Throwable t) {<NEW_LINE>ConsoleProxy.errorSafe(t.toString());<NEW_LINE>} finally {<NEW_LINE>TcpProxy.putTcpProxy(proxy);<NEW_LINE>}<NEW_LINE>ObjectPropertiesDialog.this.objectPack = objectPack;<NEW_LINE>ExUtil.exec(propertyTableViewer.getTable(), new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>makeTableContents();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
getSingle(RequestCmd.OBJECT_INFO, param);