idx
int32 46
1.86M
| input
stringlengths 321
6.6k
| target
stringlengths 9
1.24k
|
|---|---|---|
1,316,778
|
public static Map<String, List<TargetGroupVH>> fetchTargetGroups(BasicSessionCredentials temporaryCredentials, String skipRegions, String accountId, String accountName) {<NEW_LINE>com.<MASK><NEW_LINE>Map<String, List<TargetGroupVH>> targetGrpMap = new LinkedHashMap<>();<NEW_LINE>String expPrefix = InventoryConstants.ERROR_PREFIX_CODE + accountId + "\",\"Message\": \"Exception in fetching info for resource in specific region\" ,\"type\": \"Target Group\" , \"region\":\"";<NEW_LINE>for (Region region : RegionUtils.getRegions()) {<NEW_LINE>try {<NEW_LINE>if (!skipRegions.contains(region.getName())) {<NEW_LINE>elbClient = com.amazonaws.services.elasticloadbalancingv2.AmazonElasticLoadBalancingClientBuilder.standard().withCredentials(new AWSStaticCredentialsProvider(temporaryCredentials)).withRegion(region.getName()).build();<NEW_LINE>String nextMarker = null;<NEW_LINE>List<TargetGroupVH> targetGrpList = new ArrayList<>();<NEW_LINE>do {<NEW_LINE>DescribeTargetGroupsResult trgtGrpRslt = elbClient.describeTargetGroups(new DescribeTargetGroupsRequest().withMarker(nextMarker));<NEW_LINE>List<TargetGroup> targetGrpListTemp = trgtGrpRslt.getTargetGroups();<NEW_LINE>for (TargetGroup tg : targetGrpListTemp) {<NEW_LINE>DescribeTargetHealthResult rslt = elbClient.describeTargetHealth(new DescribeTargetHealthRequest().withTargetGroupArn(tg.getTargetGroupArn()));<NEW_LINE>targetGrpList.add(new TargetGroupVH(tg, rslt.getTargetHealthDescriptions()));<NEW_LINE>}<NEW_LINE>nextMarker = trgtGrpRslt.getNextMarker();<NEW_LINE>} while (nextMarker != null);<NEW_LINE>if (!targetGrpList.isEmpty()) {<NEW_LINE>log.debug(InventoryConstants.ACCOUNT + accountId + " Type : Target Group " + region.getName() + "-" + targetGrpList.size());<NEW_LINE>targetGrpMap.put(accountId + delimiter + accountName + delimiter + region.getName(), targetGrpList);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.warn(expPrefix + region.getName() + InventoryConstants.ERROR_CAUSE + e.getMessage() + "\"}");<NEW_LINE>ErrorManageUtil.uploadError(accountId, region.getName(), "targetgroup", e.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return targetGrpMap;<NEW_LINE>}
|
amazonaws.services.elasticloadbalancingv2.AmazonElasticLoadBalancing elbClient;
|
269,188
|
final DeleteCorsConfigurationResult executeDeleteCorsConfiguration(DeleteCorsConfigurationRequest deleteCorsConfigurationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteCorsConfigurationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteCorsConfigurationRequest> request = null;<NEW_LINE>Response<DeleteCorsConfigurationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteCorsConfigurationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteCorsConfigurationRequest));<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, "ApiGatewayV2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteCorsConfiguration");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteCorsConfigurationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteCorsConfigurationResultJsonUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
|
invoke(request, responseHandler, executionContext);
|
146,562
|
private void refreshUpdateVersionViews() {<NEW_LINE>if (mPlugin.isInstalled()) {<NEW_LINE>mInstallButton.setVisibility(View.GONE);<NEW_LINE>if (isNotAutoManaged()) {<NEW_LINE>boolean isUpdateAvailable = PluginUtils.isUpdateAvailable(mPlugin);<NEW_LINE>boolean canUpdate = isUpdateAvailable && !mIsUpdatingPlugin;<NEW_LINE>mUpdateButton.setVisibility(canUpdate ? View.VISIBLE : View.GONE);<NEW_LINE>mInstalledText.setVisibility(isUpdateAvailable || mIsUpdatingPlugin ? View.GONE : View.VISIBLE);<NEW_LINE>} else {<NEW_LINE>mUpdateButton.setVisibility(View.GONE);<NEW_LINE>mInstalledText.setVisibility(View.GONE);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>mUpdateButton.setVisibility(View.GONE);<NEW_LINE>mInstalledText.setVisibility(View.GONE);<NEW_LINE>mInstallButton.setVisibility(mIsInstallingPlugin ? View.GONE : View.VISIBLE);<NEW_LINE>}<NEW_LINE>findViewById(R.id.plugin_update_progress_bar).setVisibility(mIsUpdatingPlugin || mIsInstallingPlugin ? <MASK><NEW_LINE>}
|
View.VISIBLE : View.GONE);
|
1,176,571
|
// ===================================================================================<NEW_LINE>// Basic Override<NEW_LINE>// ==============<NEW_LINE>@Override<NEW_LINE>protected String doBuildColumnString(String dm) {<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append(dm).append(createdBy);<NEW_LINE>sb.append(dm).append(createdTime);<NEW_LINE>sb.append(dm).append(excludedPaths);<NEW_LINE>sb.append(dm).append(includedPaths);<NEW_LINE>sb.append(dm).append(name);<NEW_LINE>sb.append(dm).append(permissions);<NEW_LINE>sb.append(dm).append(sortOrder);<NEW_LINE>sb.append(dm).append(updatedBy);<NEW_LINE>sb.append<MASK><NEW_LINE>sb.append(dm).append(value);<NEW_LINE>sb.append(dm).append(virtualHost);<NEW_LINE>if (sb.length() > dm.length()) {<NEW_LINE>sb.delete(0, dm.length());<NEW_LINE>}<NEW_LINE>sb.insert(0, "{").append("}");<NEW_LINE>return sb.toString();<NEW_LINE>}
|
(dm).append(updatedTime);
|
662,129
|
private static void validateScoresArePositive(Version indexCreatedVersion, Similarity similarity) throws IOException {<NEW_LINE>CollectionStatistics collectionStats = new CollectionStatistics("some_field", 1200, 1100, 3000, 2000);<NEW_LINE>TermStatistics termStats = new TermStatistics(new BytesRef("some_value"), 100, 130);<NEW_LINE>SimWeight simWeight = similarity.computeWeight(2f, collectionStats, termStats);<NEW_LINE>FieldInvertState state = new // length = 20, no overlap<NEW_LINE>FieldInvertState(// length = 20, no overlap<NEW_LINE>indexCreatedVersion.luceneVersion.major, // length = 20, no overlap<NEW_LINE>"some_field", // length = 20, no overlap<NEW_LINE>20, // length = 20, no overlap<NEW_LINE>20, // length = 20, no overlap<NEW_LINE>0, 50);<NEW_LINE>final long norm = similarity.computeNorm(state);<NEW_LINE>LeafReader reader = new SingleNormLeafReader(norm);<NEW_LINE>SimScorer scorer = similarity.simScorer(<MASK><NEW_LINE>for (int freq = 1; freq <= 10; ++freq) {<NEW_LINE>float score = scorer.score(0, freq);<NEW_LINE>if (score < 0) {<NEW_LINE>DEPRECATION_LOGGER.deprecated("Similarities should not return negative scores:\n" + scorer.explain(0, Explanation.match(freq, "term freq")));<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
simWeight, reader.getContext());
|
349,086
|
public boolean isReadOnlyFromContext() {<NEW_LINE>int clientId = Env.getContextAsInt(m_vo.ctx, m_vo.WindowNo, m_vo.TabNo, "AD_Client_ID");<NEW_LINE>if (clientId <= 0) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>int orgId = Env.getContextAsInt(m_vo.ctx, m_vo.WindowNo, m_vo.TabNo, "AD_Org_ID");<NEW_LINE>String keyColumn = Env.getContext(m_vo.ctx, m_vo.WindowNo, <MASK><NEW_LINE>if ("EntityType".equals(keyColumn))<NEW_LINE>keyColumn = "AD_EntityType_ID";<NEW_LINE>if (!keyColumn.endsWith("_ID"))<NEW_LINE>// AD_Language_ID<NEW_LINE>keyColumn += "_ID";<NEW_LINE>int tableId = m_vo.AD_Table_ID;<NEW_LINE>if (MRole.getDefault(m_vo.ctx, false).canUpdate(clientId, orgId, tableId, 0, false))<NEW_LINE>return false;<NEW_LINE>// Default<NEW_LINE>return true;<NEW_LINE>}
|
m_vo.TabNo, GridTab.CTX_KeyColumnName);
|
1,294,867
|
public void onEnterStage(MySQLResponseService service) {<NEW_LINE>if (service.getConnection().isClosed()) {<NEW_LINE>service.setXaStatus(TxState.TX_COMMIT_FAILED_STATE);<NEW_LINE>xaHandler.fakedResponse(service, "the conn has been closed before executing XA COMMIT");<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>RouteResultsetNode rrn = (RouteResultsetNode) service.getAttachment();<NEW_LINE>String xaTxId = service.getConnXID(session.getSessionXaID(), rrn);<NEW_LINE>if (logger.isDebugEnabled()) {<NEW_LINE>logger.debug("XA COMMIT " + xaTxId + " to " + service);<NEW_LINE>}<NEW_LINE>XaDelayProvider.delayBeforeXaCommit(rrn.getName(), xaTxId);<NEW_LINE>service.execCmd("XA COMMIT " + xaTxId);<NEW_LINE>} catch (Exception e) {<NEW_LINE><MASK><NEW_LINE>if (!xaHandler.isFail()) {<NEW_LINE>xaHandler.fakedResponse(service, "cause error when executing XA COMMIT. reason [" + e.getMessage() + "]");<NEW_LINE>} else {<NEW_LINE>xaHandler.fakedResponse(service, null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
logger.info("xa commit error", e);
|
380,639
|
public Map<String, Object> buildHiveReader() {<NEW_LINE>DataxHivePojo dataxHivePojo = new DataxHivePojo();<NEW_LINE>dataxHivePojo.setJdbcDatasource(readerDatasource);<NEW_LINE>List<Map<String, Object>> columns = Lists.newArrayList();<NEW_LINE>readerColumns.forEach(c -> {<NEW_LINE>Map<String, Object> column = Maps.newLinkedHashMap();<NEW_LINE>column.put("index", c.split(<MASK><NEW_LINE>column.put("type", c.split(Constants.SPLIT_SCOLON)[2]);<NEW_LINE>columns.add(column);<NEW_LINE>});<NEW_LINE>dataxHivePojo.setColumns(columns);<NEW_LINE>dataxHivePojo.setReaderDefaultFS(hiveReaderDto.getReaderDefaultFS());<NEW_LINE>dataxHivePojo.setReaderFieldDelimiter(hiveReaderDto.getReaderFieldDelimiter());<NEW_LINE>dataxHivePojo.setReaderFileType(hiveReaderDto.getReaderFileType());<NEW_LINE>dataxHivePojo.setReaderPath(hiveReaderDto.getReaderPath());<NEW_LINE>dataxHivePojo.setSkipHeader(hiveReaderDto.getReaderSkipHeader());<NEW_LINE>return readerPlugin.buildHive(dataxHivePojo);<NEW_LINE>}
|
Constants.SPLIT_SCOLON)[0]);
|
1,727,633
|
// ----- private methods -----<NEW_LINE>private void init() {<NEW_LINE>factories.put(NotEmptyQuery.class, new NotEmptyQueryFactory(this));<NEW_LINE>factories.put(FulltextQuery.class, new KeywordQueryFactory(this));<NEW_LINE>factories.put(SpatialQuery.class, new SpatialQueryFactory(this));<NEW_LINE>factories.put(GraphQuery.class, new GraphQueryFactory(this));<NEW_LINE>factories.put(GroupQuery.class, new GroupQueryFactory(this));<NEW_LINE>factories.put(RangeQuery.class, new RangeQueryFactory(this));<NEW_LINE>factories.put(ExactQuery.class, new KeywordQueryFactory(this));<NEW_LINE>factories.put(ArrayQuery.class, new ArrayQueryFactory(this));<NEW_LINE>factories.put(EmptyQuery.class, new EmptyQueryFactory(this));<NEW_LINE>factories.put(TypeQuery.class, new TypeQueryFactory(this));<NEW_LINE>factories.put(UuidQuery.class, new UuidQueryFactory(this));<NEW_LINE>factories.put(RelationshipQuery.<MASK><NEW_LINE>factories.put(ComparisonQuery.class, new ComparisonQueryFactory(this));<NEW_LINE>converters.put(Boolean.class, new BooleanTypeConverter());<NEW_LINE>converters.put(String.class, new StringTypeConverter());<NEW_LINE>converters.put(Date.class, new DateTypeConverter());<NEW_LINE>converters.put(Long.class, new LongTypeConverter());<NEW_LINE>converters.put(Short.class, new ShortTypeConverter());<NEW_LINE>converters.put(Integer.class, new IntTypeConverter());<NEW_LINE>converters.put(Float.class, new FloatTypeConverter());<NEW_LINE>converters.put(Double.class, new DoubleTypeConverter());<NEW_LINE>converters.put(byte.class, new ByteTypeConverter());<NEW_LINE>}
|
class, new RelationshipQueryFactory(this));
|
102,639
|
protected static void constructM(List<Point2D_F64> obsPts, DMatrixRMaj alphas, DMatrixRMaj M) {<NEW_LINE>int N = obsPts.size();<NEW_LINE>M.reshape(3 * alphas.numCols, 2 * N, false);<NEW_LINE>for (int i = 0; i < N; i++) {<NEW_LINE>Point2D_F64 p2 = obsPts.get(i);<NEW_LINE>int row = i * 2;<NEW_LINE>for (int j = 0; j < alphas.numCols; j++) {<NEW_LINE>int col = j * 3;<NEW_LINE>double alpha = alphas.unsafe_get(i, j);<NEW_LINE>// TODO Investigate rows and columns being swapped here. Explain or fix<NEW_LINE>M.unsafe_set(col, row, alpha);<NEW_LINE>M.unsafe_set(col + 1, row, 0);<NEW_LINE>M.unsafe_set(col + 2, row, -alpha * p2.x);<NEW_LINE>M.unsafe_set(<MASK><NEW_LINE>M.unsafe_set(col + 1, row + 1, alpha);<NEW_LINE>M.unsafe_set(col + 2, row + 1, -alpha * p2.y);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
col, row + 1, 0);
|
317,899
|
/* (non-Javadoc)<NEW_LINE>* @see com.ibm.ws.sib.processor.impl.store.items.SIMPItem#restore(java.io.ObjectInputStream, int)<NEW_LINE>*/<NEW_LINE>public void restore(ObjectInputStream dis, int dataVersion) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.entry(tc, "restore", new Object[] { dis<MASK><NEW_LINE>try {<NEW_LINE>// read in all the completed prefixes<NEW_LINE>for (int i = 0; i < streams.length; i++) {<NEW_LINE>long completedPrefix = dis.readLong();<NEW_LINE>setPersistentData(i, completedPrefix);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>// FFDC<NEW_LINE>FFDCFilter.processException(e, "com.ibm.ws.sib.processor.gd.StreamSet.ReliabilitySubset.restore", "1:1135:1.67", this);<NEW_LINE>SibTr.exception(tc, e);<NEW_LINE>SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0002", new Object[] { "com.ibm.ws.sib.processor.gd.StreamSet.ReliabilitySubset", "1:1142:1.67", e });<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.exit(tc, "restore", "SIErrorException");<NEW_LINE>throw new SIErrorException(nls.getFormattedMessage("INTERNAL_MESSAGING_ERROR_CWSIP0002", new Object[] { "com.ibm.ws.sib.processor.gd.StreamSet.ReliabilitySubset", "1:1151:1.67", e }, null), e);<NEW_LINE>}<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.exit(tc, "restore");<NEW_LINE>}
|
, new Integer(dataVersion) });
|
1,082,155
|
public synchronized int codePointBefore(int index) {<NEW_LINE>int currentLength = lengthInternalUnsynchronized();<NEW_LINE>if (index > 0 && index <= currentLength) {<NEW_LINE>// Check if the StringBuffer is compressed<NEW_LINE>if (String.COMPACT_STRINGS && count >= 0) {<NEW_LINE>return helpers.byteToCharUnsigned(helpers.getByteFromArrayByIndex(value, index - 1));<NEW_LINE>} else {<NEW_LINE>int low = value[index - 1];<NEW_LINE>if (index > 1 && low >= Character.MIN_LOW_SURROGATE && low <= Character.MAX_LOW_SURROGATE) {<NEW_LINE>int <MASK><NEW_LINE>if (high >= Character.MIN_HIGH_SURROGATE && high <= Character.MAX_HIGH_SURROGATE) {<NEW_LINE>return 0x10000 + ((high - Character.MIN_HIGH_SURROGATE) << 10) + (low - Character.MIN_LOW_SURROGATE);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return low;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new StringIndexOutOfBoundsException(index);<NEW_LINE>}<NEW_LINE>}
|
high = value[index - 2];
|
254,352
|
final GlobalCluster executeDeleteGlobalCluster(DeleteGlobalClusterRequest deleteGlobalClusterRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteGlobalClusterRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteGlobalClusterRequest> request = null;<NEW_LINE>Response<GlobalCluster> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteGlobalClusterRequestMarshaller().marshall(super.beforeMarshalling(deleteGlobalClusterRequest));<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, "DocDB");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteGlobalCluster");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<GlobalCluster> responseHandler = new StaxResponseHandler<GlobalCluster>(new GlobalClusterStaxUnmarshaller());<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 awsRequestMetrics = executionContext.getAwsRequestMetrics();
|
1,566,588
|
private HandlerInfo adaptToHandlerInfo(org.apache.cxf.jaxws30.handler.types.PortComponentHandlerType pt) {<NEW_LINE>HandlerInfo handler = new HandlerInfo();<NEW_LINE>handler.<MASK><NEW_LINE>handler.setHandlerClass(pt.getHandlerClass().getValue());<NEW_LINE>handler.setHandlerName(pt.getHandlerName().getValue());<NEW_LINE>for (org.apache.cxf.jaxws30.handler.types.CString sRole : pt.getSoapRole()) {<NEW_LINE>handler.addSoapRole(sRole.getValue());<NEW_LINE>}<NEW_LINE>for (org.apache.cxf.jaxws30.handler.types.XsdQNameType sHead : pt.getSoapHeader()) {<NEW_LINE>handler.addSoapHeader(new XsdQNameInfo(sHead.getValue(), sHead.getId()));<NEW_LINE>}<NEW_LINE>for (org.apache.cxf.jaxws30.handler.types.ParamValueType param : pt.getInitParam()) {<NEW_LINE>handler.addInitParam(new ParamValueInfo(param.getParamName().getValue(), param.getParamValue().getValue()));<NEW_LINE>}<NEW_LINE>return handler;<NEW_LINE>}
|
setId(pt.getId());
|
731,165
|
public void read(org.apache.thrift.protocol.TProtocol prot, ListBlobsResult struct) throws org.apache.thrift.TException {<NEW_LINE>TTupleProtocol iprot = (TTupleProtocol) prot;<NEW_LINE>{<NEW_LINE>org.apache.thrift.protocol.TList _list229 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());<NEW_LINE>struct.keys = new ArrayList<String>(_list229.size);<NEW_LINE>String _elem230;<NEW_LINE>for (int _i231 = 0; _i231 < _list229.size; ++_i231) {<NEW_LINE>_elem230 = iprot.readString();<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>struct.set_keys_isSet(true);<NEW_LINE>struct.session = iprot.readString();<NEW_LINE>struct.set_session_isSet(true);<NEW_LINE>}
|
struct.keys.add(_elem230);
|
276,103
|
public void run() {<NEW_LINE>try {<NEW_LINE>this.ttlScheduler.client.agentCheckPass(this.checkId);<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("Sending consul heartbeat for: " + this.checkId);<NEW_LINE>}<NEW_LINE>} catch (OperationException e) {<NEW_LINE>if (this.ttlScheduler.heartbeatProperties.isReregisterServiceOnFailure() && this.ttlScheduler.reregistrationPredicate.isEligible(e)) {<NEW_LINE>log.<MASK><NEW_LINE>NewService registeredService = this.ttlScheduler.registeredServices.get(this.serviceId);<NEW_LINE>if (registeredService != null) {<NEW_LINE>if (log.isInfoEnabled()) {<NEW_LINE>log.info("Re-register " + registeredService);<NEW_LINE>}<NEW_LINE>this.ttlScheduler.client.agentServiceRegister(registeredService, this.ttlScheduler.discoveryProperties.getAclToken());<NEW_LINE>} else {<NEW_LINE>log.warn("The service to re-register is not found.");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
warn(e.getMessage());
|
262,586
|
protected void onHandleIntent(Intent intent) {<NEW_LINE>Caches caches = new Caches(this);<NEW_LINE>if (intent != null) {<NEW_LINE>final String action = intent.getAction();<NEW_LINE>if (ACTION_SEND_PKG_INFO.equals(action)) {<NEW_LINE>String socketName = intent.getStringExtra(EXTRA_SOCKET_NAME);<NEW_LINE>if (socketName == null) {<NEW_LINE>socketName = DEFAULT_SOCKET_NAME;<NEW_LINE>}<NEW_LINE>boolean onlyDebug = intent.getBooleanExtra(EXTRA_ONLY_DEBUG, false);<NEW_LINE>boolean includeIcons = intent.getBooleanExtra(EXTRA_INCLUDE_ICONS, false);<NEW_LINE>float iconDensityScale = intent.getFloatExtra(EXTRA_ICON_DENSITY_SCALE, 1.0f);<NEW_LINE>try (Counter.Scope t = Counter.time("handleSendPackageInfo")) {<NEW_LINE>handleSendPackageInfo(caches, <MASK><NEW_LINE>}<NEW_LINE>if (PROFILE) {<NEW_LINE>Log.i(TAG, Counter.collect(true));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
socketName, onlyDebug, includeIcons, iconDensityScale);
|
1,384,845
|
public String toXml(int offset) {<NEW_LINE>StringBuilder buffer = new StringBuilder();<NEW_LINE>appendOffset(buffer, offset);<NEW_LINE>buffer.append("<relation ID=\"" + getId() + "\" TYPE =\"" + mType + "\" SUBTYPE=\"" + mSubtype + "\" MODALITY=\"" + mModality + "\" TENSE=\"" + mTense + "\">\n");<NEW_LINE>AceRelationMentionArgument arg1 = mMentions.get(0).getArgs()[0];<NEW_LINE>AceRelationMentionArgument arg2 = mMentions.get(0<MASK><NEW_LINE>if (arg1.getRole().equals("Arg-1")) {<NEW_LINE>// left to right<NEW_LINE>buffer.append(arg1.toXmlShort(offset + 2) + "\n");<NEW_LINE>buffer.append(arg2.toXmlShort(offset + 2) + "\n");<NEW_LINE>} else {<NEW_LINE>// right to left<NEW_LINE>buffer.append(arg2.toXmlShort(offset + 2) + "\n");<NEW_LINE>buffer.append(arg1.toXmlShort(offset + 2) + "\n");<NEW_LINE>}<NEW_LINE>for (AceRelationMention m : mMentions) {<NEW_LINE>buffer.append(m.toXml(offset + 2));<NEW_LINE>buffer.append("\n");<NEW_LINE>}<NEW_LINE>appendOffset(buffer, offset);<NEW_LINE>buffer.append("</relation>");<NEW_LINE>return buffer.toString();<NEW_LINE>}
|
).getArgs()[1];
|
782,087
|
// DO NOT MODIFY THIS CODE, GENERATED AUTOMATICALLY<NEW_LINE>public static float floatValue(com.sun.jdi.PrimitiveValue a) throws org.netbeans.modules.debugger.jpda.jdi.InternalExceptionWrapper, org.netbeans.modules.debugger.jpda.jdi.VMDisconnectedExceptionWrapper {<NEW_LINE>if (org.netbeans.modules.debugger.jpda.JDIExceptionReporter.isLoggable()) {<NEW_LINE>org.netbeans.modules.debugger.jpda.JDIExceptionReporter.logCallStart("com.sun.jdi.PrimitiveValue", "floatValue", "JDI CALL: com.sun.jdi.PrimitiveValue({0}).floatValue()", new Object[] { a });<NEW_LINE>}<NEW_LINE>Object retValue = null;<NEW_LINE>try {<NEW_LINE>float ret;<NEW_LINE>ret = a.floatValue();<NEW_LINE>retValue = ret;<NEW_LINE>return ret;<NEW_LINE>} catch (com.sun.jdi.InternalException ex) {<NEW_LINE>retValue = ex;<NEW_LINE>org.netbeans.modules.debugger.jpda.JDIExceptionReporter.report(ex);<NEW_LINE>throw new org.netbeans.modules.debugger.jpda.jdi.InternalExceptionWrapper(ex);<NEW_LINE>} catch (com.sun.jdi.VMDisconnectedException ex) {<NEW_LINE>retValue = ex;<NEW_LINE>if (a instanceof com.sun.jdi.Mirror) {<NEW_LINE>com.sun.jdi.VirtualMachine vm = ((com.sun.jdi.<MASK><NEW_LINE>try {<NEW_LINE>vm.dispose();<NEW_LINE>} catch (com.sun.jdi.VMDisconnectedException vmdex) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw new org.netbeans.modules.debugger.jpda.jdi.VMDisconnectedExceptionWrapper(ex);<NEW_LINE>} catch (Error err) {<NEW_LINE>retValue = err;<NEW_LINE>throw err;<NEW_LINE>} catch (RuntimeException rex) {<NEW_LINE>retValue = rex;<NEW_LINE>throw rex;<NEW_LINE>} finally {<NEW_LINE>if (org.netbeans.modules.debugger.jpda.JDIExceptionReporter.isLoggable()) {<NEW_LINE>org.netbeans.modules.debugger.jpda.JDIExceptionReporter.logCallEnd("com.sun.jdi.PrimitiveValue", "floatValue", retValue);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
Mirror) a).virtualMachine();
|
1,804,889
|
public void generateCode(BlockScope currentScope, CodeStream codeStream, boolean valueRequired) {<NEW_LINE>int pc = codeStream.position;<NEW_LINE>if (this.constant != Constant.NotAConstant) {<NEW_LINE>if (valueRequired) {<NEW_LINE>codeStream.generateConstant(this.constant, this.implicitConversion);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>FieldBinding codegenBinding = this.binding.original();<NEW_LINE>boolean isStatic = codegenBinding.isStatic();<NEW_LINE>this.receiver.generateCode(currentScope, codeStream, !isStatic);<NEW_LINE>if (valueRequired) {<NEW_LINE>Constant fieldConstant = codegenBinding.constant();<NEW_LINE>if (fieldConstant == Constant.NotAConstant) {<NEW_LINE>if (codegenBinding.declaringClass == null) {<NEW_LINE>// array length<NEW_LINE>codeStream.arraylength();<NEW_LINE>} else {<NEW_LINE>if (codegenBinding.canBeSeenBy(this.actualReceiverType, this, currentScope)) {<NEW_LINE>TypeBinding constantPoolDeclaringClass = CodeStream.getConstantPoolDeclaringClass(currentScope, codegenBinding, this.actualReceiverType, this.receiver.isImplicitThis());<NEW_LINE>if (isStatic) {<NEW_LINE>codeStream.fieldAccess(Opcodes.OPC_getstatic, codegenBinding, constantPoolDeclaringClass);<NEW_LINE>} else {<NEW_LINE>codeStream.fieldAccess(Opcodes.OPC_getfield, codegenBinding, constantPoolDeclaringClass);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (isStatic) {<NEW_LINE>// we need a null on the stack to use the reflect emulation<NEW_LINE>codeStream.aconst_null();<NEW_LINE>}<NEW_LINE>codeStream.generateEmulatedReadAccessForField(codegenBinding);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>codeStream.generateImplicitConversion(this.implicitConversion);<NEW_LINE>} else {<NEW_LINE>if (!isStatic) {<NEW_LINE>// perform null check<NEW_LINE>codeStream.invokeObjectGetClass();<NEW_LINE>codeStream.pop();<NEW_LINE>}<NEW_LINE>codeStream.<MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (!isStatic) {<NEW_LINE>// perform null check<NEW_LINE>codeStream.invokeObjectGetClass();<NEW_LINE>codeStream.pop();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>codeStream.recordPositionsFrom(pc, this.sourceStart);<NEW_LINE>}
|
generateConstant(fieldConstant, this.implicitConversion);
|
1,130,093
|
public ResponseHeader execute() {<NEW_LINE>LogicSQL logicSQL = getLogicSQL();<NEW_LINE>ExecutionContext executionContext = getKernelProcessor().generateExecutionContext(logicSQL, getMetaData(), ProxyContext.getInstance().getContextManager().getMetaDataContexts().getProps());<NEW_LINE>// TODO move federation route logic to binder<NEW_LINE>SQLStatementContext<?<MASK><NEW_LINE>String defaultSchemaName = backendConnection.getConnectionSession().getSchemaName();<NEW_LINE>if (executionContext.getRouteContext().isFederated() || (sqlStatementContext instanceof SelectStatementContext && SystemSchemaUtil.containsSystemSchema(sqlStatementContext.getDatabaseType(), sqlStatementContext.getTablesContext().getSchemaNames(), defaultSchemaName))) {<NEW_LINE>MetaDataContexts metaDataContexts = ProxyContext.getInstance().getContextManager().getMetaDataContexts();<NEW_LINE>ResultSet resultSet = doExecuteFederation(logicSQL, metaDataContexts);<NEW_LINE>return processExecuteFederation(resultSet, metaDataContexts);<NEW_LINE>}<NEW_LINE>if (executionContext.getExecutionUnits().isEmpty()) {<NEW_LINE>return new UpdateResponseHeader(executionContext.getSqlStatementContext().getSqlStatement());<NEW_LINE>}<NEW_LINE>proxySQLExecutor.checkExecutePrerequisites(executionContext);<NEW_LINE>checkLockedSchema(executionContext);<NEW_LINE>List result = proxySQLExecutor.execute(executionContext);<NEW_LINE>refreshMetaData(executionContext);<NEW_LINE>Object executeResultSample = result.iterator().next();<NEW_LINE>return executeResultSample instanceof QueryResult ? processExecuteQuery(executionContext, result, (QueryResult) executeResultSample) : processExecuteUpdate(executionContext, result);<NEW_LINE>}
|
> sqlStatementContext = logicSQL.getSqlStatementContext();
|
1,334,483
|
public void calculate(@NonNull final IPricingContext pricingCtx, @NonNull final IPricingResult result) {<NEW_LINE>final ILoggable loggable = Loggables.withLogger(logger, Level.DEBUG);<NEW_LINE>final Object referencedObject = pricingCtx.getReferencedObject();<NEW_LINE>final I_C_Flatrate_Conditions conditions = ContractPricingUtil.getC_Flatrate_Conditions(referencedObject);<NEW_LINE>// subscription-discount<NEW_LINE>final SubscriptionDiscountLine subscriptionDiscountLine;<NEW_LINE>if (!pricingCtx.isDisallowDiscount()) {<NEW_LINE>subscriptionDiscountLine = getSubscriptionDiscountOrNull(pricingCtx, conditions);<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>subscriptionDiscountLine = null;<NEW_LINE>}<NEW_LINE>// alternate pricing-system<NEW_LINE>final IPricingResult subscriptionPricingResult;<NEW_LINE>if (conditions.getM_PricingSystem_ID() > 0) {<NEW_LINE>loggable.addLog("START Invoking pricing engine with M_PricingSystem_ID={}", conditions.getM_PricingSystem_ID());<NEW_LINE>final I_M_PriceList subscriptionPriceList = retrievePriceListForConditionsAndCountry(pricingCtx.getCountryId(), conditions);<NEW_LINE>final IEditablePricingContext subscriptionPricingCtx = copyPricingCtxButInsertPriceList(pricingCtx, subscriptionPriceList);<NEW_LINE>subscriptionPricingResult = invokePricingEngine(subscriptionPricingCtx.setFailIfNotCalculated());<NEW_LINE>loggable.addLog("END Invoking pricing engine with M_PricingSystem_ID={}", conditions.getM_PricingSystem_ID());<NEW_LINE>} else {<NEW_LINE>subscriptionPricingResult = result;<NEW_LINE>}<NEW_LINE>final IPricingResult combinedPricingResult = aggregateSubscriptionDiscount(subscriptionDiscountLine, subscriptionPricingResult);<NEW_LINE>copySubscriptionResultIntoResult(combinedPricingResult, result);<NEW_LINE>copyDiscountIntoResultIfAllowedByPricingContext(combinedPricingResult, result, pricingCtx);<NEW_LINE>}
|
loggable.addLog("pricingCtx does not allow discounts; -> not considering C_Subscr_Discount; pricingCtx={}", pricingCtx);
|
1,584,251
|
private void doVerify() throws Exception {<NEW_LINE>List<BlockPayload> blocks = new ArrayList<BlockPayload>();<NEW_LINE>HeaderBlock header = store.readFirst(HeaderBlock.class);<NEW_LINE>blocks.add(header);<NEW_LINE>verifyTree(header.getRoot(), "", <MASK><NEW_LINE>Collections.sort(blocks, new Comparator<BlockPayload>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int compare(BlockPayload block, BlockPayload block1) {<NEW_LINE>return block.getPos().compareTo(block1.getPos());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>for (int i = 0; i < blocks.size() - 1; i++) {<NEW_LINE>Block b1 = blocks.get(i).getBlock();<NEW_LINE>Block b2 = blocks.get(i + 1).getBlock();<NEW_LINE>if (b1.getPos().getPos() + b1.getSize() > b2.getPos().getPos()) {<NEW_LINE>throw new IOException(String.format("%s overlaps with %s", b1, b2));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
blocks, Long.MAX_VALUE, true);
|
1,199,359
|
public void make(CodegenMethod method, CodegenClassScope classScope) {<NEW_LINE>CodegenSetterBuilder builder = new CodegenSetterBuilder(ModuleDependenciesRuntime.EPTYPE, ModuleDependenciesCompileTime.class, "md", classScope, method);<NEW_LINE>builder.expressionDefaultChecked("pathEventTypes", NameAndModule.makeArrayNullIfEmpty(pathEventTypes)).expressionDefaultChecked("pathNamedWindows", NameAndModule.makeArrayNullIfEmpty(pathNamedWindows)).expressionDefaultChecked("pathTables", NameAndModule.makeArrayNullIfEmpty(pathTables)).expressionDefaultChecked("pathVariables", NameAndModule.makeArrayNullIfEmpty(pathVariables)).expressionDefaultChecked("pathContexts", NameAndModule.makeArrayNullIfEmpty(pathContexts)).expressionDefaultChecked("pathExpressions", NameAndModule.makeArrayNullIfEmpty(pathExpressions)).expressionDefaultChecked("pathIndexes", ModuleIndexMeta.makeArrayNullIfEmpty(pathIndexes)).expressionDefaultChecked("pathScripts", NameParamNumAndModule.makeArrayNullIfEmpty(pathScripts)).expressionDefaultChecked("pathClasses", NameAndModule.makeArrayNullIfEmpty(pathClasses)).expressionDefaultChecked("publicEventTypes", makeStringArrayNullIfEmpty(publicEventTypes)).expressionDefaultChecked("publicVariables", makeStringArrayNullIfEmpty(publicVariables));<NEW_LINE>method.getBlock().<MASK><NEW_LINE>}
|
methodReturn(builder.getRefName());
|
77,298
|
private void distinguishSubmission(final Activity mContext, final Submission submission, final SubmissionViewHolder holder) {<NEW_LINE>new AsyncTask<Void, Void, Boolean>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onPostExecute(Boolean b) {<NEW_LINE>if (b) {<NEW_LINE>Snackbar s = Snackbar.make(holder.itemView, "Submission distinguished", Snackbar.LENGTH_LONG);<NEW_LINE>LayoutUtils.showSnackbar(s);<NEW_LINE>} else {<NEW_LINE>new AlertDialog.Builder(mContext).setTitle(R.string.err_general).setMessage(R.string.err_retry_later).show();<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected Boolean doInBackground(Void... params) {<NEW_LINE>try {<NEW_LINE>new ModerationManager(Authentication.reddit).setDistinguishedStatus(submission, DistinguishedStatus.MODERATOR);<NEW_LINE>} catch (ApiException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>}
|
}.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
1,161,028
|
protected final void fastPathOrderedEmitMax(U value, boolean delayError, Disposable dispose) {<NEW_LINE>final Subscriber<? super V> s = downstream;<NEW_LINE>final SimplePlainQueue<U> q = queue;<NEW_LINE>if (fastEnter()) {<NEW_LINE><MASK><NEW_LINE>if (r != 0L) {<NEW_LINE>if (q.isEmpty()) {<NEW_LINE>if (accept(s, value)) {<NEW_LINE>if (r != Long.MAX_VALUE) {<NEW_LINE>produced(1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (leave(-1) == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>q.offer(value);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>cancelled = true;<NEW_LINE>dispose.dispose();<NEW_LINE>s.onError(new MissingBackpressureException("Could not emit buffer due to lack of requests"));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>q.offer(value);<NEW_LINE>if (!enter()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>QueueDrainHelper.drainMaxLoop(q, s, delayError, dispose, this);<NEW_LINE>}
|
long r = requested.get();
|
1,658,770
|
public static void main(String[] args) {<NEW_LINE>int numClusters = 20;<NEW_LINE>int numSamplesInClusters = 2000;<NEW_LINE>double[] variances = { 0.01 };<NEW_LINE>int vectorDim = 10;<NEW_LINE>ClusteredDataGenerator[] c = new ClusteredDataGenerator[vectorDim];<NEW_LINE>int i, j, n;<NEW_LINE>int totalVectors = 0;<NEW_LINE>for (i = 0; i < vectorDim; i++) {<NEW_LINE>if (i < variances.length)<NEW_LINE>c[i] = new ClusteredDataGenerator(numClusters, numSamplesInClusters, 10.0 * (i + <MASK><NEW_LINE>else<NEW_LINE>c[i] = new ClusteredDataGenerator(numClusters, numSamplesInClusters, 10.0 * (i + 1), variances[0]);<NEW_LINE>}<NEW_LINE>totalVectors = c[0].data.length;<NEW_LINE>double[][] x = new double[totalVectors][vectorDim];<NEW_LINE>int counter = 0;<NEW_LINE>for (n = 0; n < c.length; n++) {<NEW_LINE>for (i = 0; i < c[n].data.length; i++) x[i][n] = c[n].data[i];<NEW_LINE>}<NEW_LINE>x = MathUtils.randomSort(x);<NEW_LINE>double[] m = MathUtils.mean(x);<NEW_LINE>double[] v = MathUtils.variance(x, m);<NEW_LINE>System.out.println(String.valueOf(m[0]) + " " + String.valueOf(v[0]));<NEW_LINE>GMMTrainerParams gmmParams = new GMMTrainerParams();<NEW_LINE>gmmParams.totalComponents = numClusters;<NEW_LINE>gmmParams.isDiagonalCovariance = true;<NEW_LINE>gmmParams.kmeansMaxIterations = 100;<NEW_LINE>gmmParams.kmeansMinClusterChangePercent = 0.01;<NEW_LINE>gmmParams.kmeansMinSamplesInOneCluster = 10;<NEW_LINE>gmmParams.emMinIterations = 100;<NEW_LINE>gmmParams.emMaxIterations = 2000;<NEW_LINE>gmmParams.isUpdateCovariances = true;<NEW_LINE>gmmParams.tinyLogLikelihoodChangePercent = 0.001;<NEW_LINE>gmmParams.minCovarianceAllowed = 1e-5;<NEW_LINE>gmmParams.useNativeCLibTrainer = true;<NEW_LINE>GMMTrainer g = new GMMTrainer();<NEW_LINE>GMM gmm = g.train(x, gmmParams);<NEW_LINE>if (gmm != null) {<NEW_LINE>for (i = 0; i < gmm.totalComponents; i++) System.out.println("Gaussian #" + String.valueOf(i + 1) + " mean=" + String.valueOf(gmm.components[i].meanVector[0]) + " variance=" + String.valueOf(gmm.components[i].covMatrix[0][0]) + " prior=" + gmm.weights[i]);<NEW_LINE>}<NEW_LINE>}
|
1), variances[i]);
|
1,102,358
|
public void createIndex(String collectionName, List<String> columnList, int order) {<NEW_LINE>DBCollection coll = mongoDb.getCollection(collectionName);<NEW_LINE>// List of all current<NEW_LINE>List<DBObject> indexes = coll.getIndexInfo();<NEW_LINE>// indexes on collection<NEW_LINE>// List of all current<NEW_LINE>Set<String> indexNames = new HashSet<String>();<NEW_LINE>// index names<NEW_LINE>for (DBObject index : indexes) {<NEW_LINE>BasicDBObject obj = (<MASK><NEW_LINE>// Set containing index name which<NEW_LINE>Set<String> set = obj.keySet();<NEW_LINE>// is key<NEW_LINE>indexNames.addAll(set);<NEW_LINE>}<NEW_LINE>// Create index if not already created<NEW_LINE>for (String columnName : columnList) {<NEW_LINE>if (!indexNames.contains(columnName)) {<NEW_LINE>KunderaCoreUtils.printQuery("Create index on:" + columnName, showQuery);<NEW_LINE>coll.createIndex(new BasicDBObject(columnName, order));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
BasicDBObject) index.get("key");
|
1,479,536
|
private CompletableFuture<Void> copyBytes(ChunkHandle writeHandle, ChunkHandle readHandle, long startOffset, long length) {<NEW_LINE>Preconditions.checkArgument(length <= chunkedSegmentStorage.getConfig().getMaxSizeForTruncateRelocationInbytes(), "size of data exceeds max size allowed for relocation. length={}, max={} ", length, chunkedSegmentStorage.getConfig().getMaxSizeForTruncateRelocationInbytes());<NEW_LINE>val bytesToRead = new AtomicLong(length);<NEW_LINE>val readAtOffset = new AtomicLong(startOffset);<NEW_LINE><MASK><NEW_LINE>return Futures.loop(() -> bytesToRead.get() > 0, () -> {<NEW_LINE>val buffer = new byte[Math.toIntExact(Math.min(chunkedSegmentStorage.getConfig().getMaxBufferSizeForChunkDataTransfer(), bytesToRead.get()))];<NEW_LINE>return chunkedSegmentStorage.getChunkStorage().read(readHandle, readAtOffset.get(), buffer.length, buffer, 0).thenComposeAsync(size -> {<NEW_LINE>bytesToRead.addAndGet(-size);<NEW_LINE>readAtOffset.addAndGet(size);<NEW_LINE>return chunkedSegmentStorage.getChunkStorage().write(writeHandle, writeAtOffset.get(), size, new ByteArrayInputStream(buffer, 0, size)).thenAcceptAsync(writeAtOffset::addAndGet, chunkedSegmentStorage.getExecutor());<NEW_LINE>}, chunkedSegmentStorage.getExecutor());<NEW_LINE>}, chunkedSegmentStorage.getExecutor());<NEW_LINE>}
|
val writeAtOffset = new AtomicLong(0);
|
1,276,255
|
protected static void analyzeEqualsNode(ExprEqualsNode equalsNode, QueryGraphForge queryGraph, boolean isOuterJoin) {<NEW_LINE>if ((equalsNode.getChildNodes()[0] instanceof ExprIdentNode) && (equalsNode.getChildNodes()[1] instanceof ExprIdentNode)) {<NEW_LINE>ExprIdentNode identNodeLeft = (ExprIdentNode) equalsNode.getChildNodes()[0];<NEW_LINE>ExprIdentNode identNodeRight = (ExprIdentNode) equalsNode.getChildNodes()[1];<NEW_LINE>if (identNodeLeft.getStreamId() != identNodeRight.getStreamId()) {<NEW_LINE>queryGraph.addStrictEquals(identNodeLeft.getStreamId(), identNodeLeft.getResolvedPropertyName(), identNodeLeft, identNodeRight.getStreamId(), identNodeRight.getResolvedPropertyName(), identNodeRight);<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (isOuterJoin) {<NEW_LINE>// outerjoins don't use constants or one-way expression-derived information to evaluate join<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// handle constant-compare or transformation case<NEW_LINE>int indexedStream = -1;<NEW_LINE>ExprIdentNode indexedPropExpr = null;<NEW_LINE>ExprNode exprNodeNoIdent = null;<NEW_LINE>if (equalsNode.getChildNodes()[0] instanceof ExprIdentNode) {<NEW_LINE>indexedPropExpr = (ExprIdentNode) equalsNode.getChildNodes()[0];<NEW_LINE>indexedStream = indexedPropExpr.getStreamId();<NEW_LINE>exprNodeNoIdent = equalsNode.getChildNodes()[1];<NEW_LINE>} else if (equalsNode.getChildNodes()[1] instanceof ExprIdentNode) {<NEW_LINE>indexedPropExpr = (ExprIdentNode) equalsNode.getChildNodes()[1];<NEW_LINE>indexedStream = indexedPropExpr.getStreamId();<NEW_LINE>exprNodeNoIdent = equalsNode.getChildNodes()[0];<NEW_LINE>}<NEW_LINE>if (indexedStream == -1) {<NEW_LINE>// require property of right/left side of equals<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>EligibilityDesc eligibility = EligibilityUtil.verifyInputStream(exprNodeNoIdent, indexedStream);<NEW_LINE>if (!eligibility.getEligibility().isEligible()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (eligibility.getEligibility() == Eligibility.REQUIRE_NONE) {<NEW_LINE>queryGraph.addUnkeyedExpression(indexedStream, indexedPropExpr, exprNodeNoIdent);<NEW_LINE>} else {<NEW_LINE>queryGraph.addKeyedExpression(indexedStream, indexedPropExpr, <MASK><NEW_LINE>}<NEW_LINE>}
|
eligibility.getStreamNum(), exprNodeNoIdent);
|
1,112,162
|
void drawVideo(ComponentDrawContext context, int x, int y, State state) {<NEW_LINE>final var g = context.getGraphics();<NEW_LINE>final var attrs = getAttributeSet();<NEW_LINE>Object blinkOption = attrs.getValue(BLINK_OPTION);<NEW_LINE>final var cm = getColorModel(attrs.getValue(COLOR_OPTION));<NEW_LINE>final var s = attrs.getValue(SCALE_OPTION);<NEW_LINE>final var w = attrs.getValue(WIDTH_OPTION);<NEW_LINE>final var h = attrs.getValue(HEIGHT_OPTION);<NEW_LINE>final var bw = (Math.max(s <MASK><NEW_LINE>final var bh = (Math.max(s * h + 14, 20));<NEW_LINE>x += (-30);<NEW_LINE>y += (-bh);<NEW_LINE>g.drawRoundRect(x, y, bw, bh, 6, 6);<NEW_LINE>for (var i = 0; i < 6; i++) {<NEW_LINE>if (i != P_CLK)<NEW_LINE>context.drawPin(this, i);<NEW_LINE>}<NEW_LINE>context.drawClock(this, P_CLK, Direction.NORTH);<NEW_LINE>g.drawRect(x + 6, y + 6, s * w + 2, s * h + 2);<NEW_LINE>g.drawImage(state.img, x + 7, y + 7, x + 7 + s * w, y + 7 + s * h, 0, 0, w, h, null);<NEW_LINE>// draw a little cursor for sanity<NEW_LINE>if (blinkOption == null)<NEW_LINE>blinkOption = BLINK_OPTIONS[0];<NEW_LINE>if (BLINK_YES.equals(blinkOption) && blink() && state.lastX >= 0 && state.lastX < w && state.lastY >= 0 && state.lastY < h) {<NEW_LINE>g.setColor(new Color(cm.getRGB(state.color)));<NEW_LINE>g.fillRect(x + 7 + state.lastX * s, y + 7 + state.lastY * s, s, s);<NEW_LINE>}<NEW_LINE>}
|
* w + 14, 100));
|
484,897
|
private void initComponents() {<NEW_LINE>setLayout(new MigLayout("fill", "[20%][80%]"));<NEW_LINE>add(new JLabel("Tool diameter"));<NEW_LINE>toolDiameter = new TextFieldWithUnit(Unit.MM, 3, controller.getSettings().getToolDiameter());<NEW_LINE>add(toolDiameter, "grow, wrap");<NEW_LINE>add(new JLabel("Feed speed"));<NEW_LINE>feedSpeed = new TextFieldWithUnit(Unit.MM_PER_MINUTE, 0, controller.getSettings().getFeedSpeed());<NEW_LINE>add(feedSpeed, "grow, wrap");<NEW_LINE><MASK><NEW_LINE>plungeSpeed = new TextFieldWithUnit(Unit.MM_PER_MINUTE, 0, controller.getSettings().getPlungeSpeed());<NEW_LINE>add(plungeSpeed, "grow, wrap");<NEW_LINE>add(new JLabel("Depth per pass"));<NEW_LINE>depthPerPass = new TextFieldWithUnit(Unit.MM, 2, controller.getSettings().getDepthPerPass());<NEW_LINE>add(depthPerPass, "grow, wrap");<NEW_LINE>add(new JLabel("Step over"));<NEW_LINE>stepOver = new TextFieldWithUnit(Unit.PERCENT, 2, controller.getSettings().getToolStepOver());<NEW_LINE>add(stepOver, "grow, wrap");<NEW_LINE>add(new JLabel("Safe height"));<NEW_LINE>safeHeight = new TextFieldWithUnit(Unit.MM, 2, controller.getSettings().getSafeHeight());<NEW_LINE>add(safeHeight, "grow, wrap");<NEW_LINE>}
|
add(new JLabel("Plunge speed"));
|
1,108,242
|
public Map<String, Object> importNode(String userName, AbstractAppConnNode node, Map<String, Object> resourceMap, Workspace workspace, String orcVersion) throws Exception {<NEW_LINE>NodeInfo nodeInfo = nodeInfoMapper.getWorkflowNodeByType(node.getNodeType());<NEW_LINE>AppConn appConn = AppConnManager.getAppConnManager().getAppConn(nodeInfo.getAppConnName());<NEW_LINE>EnvDSSLabel dssLabel = new EnvDSSLabel(DSSWorkFlowConstant.DSS_IMPORT_ENV.getValue());<NEW_LINE>if (appConn != null) {<NEW_LINE>DevelopmentIntegrationStandard devStand = ((OnlyDevelopmentAppConn) appConn).getOrCreateDevelopmentStandard();<NEW_LINE>if (null != devStand) {<NEW_LINE>AppInstance appInstance = getAppInstance(appConn, dssLabel.getEnv());<NEW_LINE>RefImportService refImportService = devStand.getRefImportService(appInstance);<NEW_LINE>ImportRequestRef requestRef = AppConnRefFactoryUtils.newAppConnRef(ImportRequestRef.class, appConn.getClass().getClassLoader(), appConn.getClass().getPackage().getName());<NEW_LINE>// todo request param def<NEW_LINE>requestRef.setParameter("jobContent", node.getJobContent());<NEW_LINE>requestRef.setParameter("projectId", parseProjectId(node.getProjectId(), appConn.getAppDesc().getAppName(), dssLabel.getEnv()));<NEW_LINE>requestRef.setParameter("nodeType", node.getNodeType());<NEW_LINE><MASK><NEW_LINE>requestRef.setParameter("user", userName);<NEW_LINE>requestRef.getParameters().putAll(resourceMap);<NEW_LINE>requestRef.setWorkspace(workspace);<NEW_LINE>if (null != refImportService) {<NEW_LINE>ResponseRef responseRef = refImportService.getRefImportOperation().importRef(requestRef);<NEW_LINE>return responseRef.toMap();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
|
requestRef.setParameter("orcVersion", orcVersion);
|
307,384
|
void log(SessionLogEntry entry, String formattedMessage) {<NEW_LINE>int level = entry.getLevel();<NEW_LINE><MASK><NEW_LINE>String msgParm;<NEW_LINE>if ((formattedMessage == null || formattedMessage.equals("")) && loggedException != null) {<NEW_LINE>msgParm = loggedException.toString();<NEW_LINE>} else {<NEW_LINE>msgParm = formattedMessage;<NEW_LINE>}<NEW_LINE>switch(level) {<NEW_LINE>case 8:<NEW_LINE>return;<NEW_LINE>case // SEVERE<NEW_LINE>7:<NEW_LINE>// With the persistence service, only errors will be logged. The rest will be debug.<NEW_LINE>String errMsg = Tr.formatMessage(_stc, "PROVIDER_ERROR_CWWKD0292E", msgParm);<NEW_LINE>Tr.error(_tc, errMsg);<NEW_LINE>break;<NEW_LINE>case // WARN<NEW_LINE>6:<NEW_LINE>String wrnMsg = Tr.formatMessage(_stc, "PROVIDER_WARNING_CWWKD0291W", msgParm);<NEW_LINE>// 170432 - move warnings to debug<NEW_LINE>Tr.debug(_tc, wrnMsg);<NEW_LINE>break;<NEW_LINE>// FINE<NEW_LINE>case 3:<NEW_LINE>// FINER<NEW_LINE>case 2:<NEW_LINE>// FINEST<NEW_LINE>case 1:<NEW_LINE>case // TRACE<NEW_LINE>0:<NEW_LINE>Tr.debug(_tc, formattedMessage);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>// end switch<NEW_LINE>// if there is an exception - only log it to trace<NEW_LINE>if (_tc.isDebugEnabled() && loggedException != null) {<NEW_LINE>Tr.debug(_tc, "throwable", loggedException);<NEW_LINE>}<NEW_LINE>}
|
Throwable loggedException = entry.getException();
|
39,922
|
protected void updateMode() {<NEW_LINE>Mode mode = editor.getMode();<NEW_LINE>// necessary?<NEW_LINE>MutableAttributeSet standard = new SimpleAttributeSet();<NEW_LINE>StyleConstants.setAlignment(standard, StyleConstants.ALIGN_LEFT);<NEW_LINE>consoleDoc.setParagraphAttributes(0, 0, standard, true);<NEW_LINE>Font font = Preferences.getFont("console.font");<NEW_LINE>// build styles for different types of console output<NEW_LINE>Color bgColor = mode.getColor("console.color");<NEW_LINE>Color fgColorOut = mode.getColor("console.output.color");<NEW_LINE>Color fgColorErr = mode.getColor("console.error.color");<NEW_LINE>// Make things line up with the Editor above. If this is ever removed,<NEW_LINE>// setBorder(null) should be called instead. The defaults are nasty.<NEW_LINE>setBorder(new MatteBorder(0, Editor.LEFT_GUTTER, 0, 0, bgColor));<NEW_LINE>stdStyle = new SimpleAttributeSet();<NEW_LINE>StyleConstants.setForeground(stdStyle, fgColorOut);<NEW_LINE>StyleConstants.setBackground(stdStyle, bgColor);<NEW_LINE>StyleConstants.setFontSize(stdStyle, font.getSize());<NEW_LINE>StyleConstants.setFontFamily(<MASK><NEW_LINE>StyleConstants.setBold(stdStyle, font.isBold());<NEW_LINE>StyleConstants.setItalic(stdStyle, font.isItalic());<NEW_LINE>errStyle = new SimpleAttributeSet();<NEW_LINE>StyleConstants.setForeground(errStyle, fgColorErr);<NEW_LINE>StyleConstants.setBackground(errStyle, bgColor);<NEW_LINE>StyleConstants.setFontSize(errStyle, font.getSize());<NEW_LINE>StyleConstants.setFontFamily(errStyle, font.getFamily());<NEW_LINE>StyleConstants.setBold(errStyle, font.isBold());<NEW_LINE>StyleConstants.setItalic(errStyle, font.isItalic());<NEW_LINE>if (UIManager.getLookAndFeel().getID().equals("Nimbus")) {<NEW_LINE>getViewport().setBackground(bgColor);<NEW_LINE>consoleTextPane.setOpaque(false);<NEW_LINE>consoleTextPane.setBackground(new Color(0, 0, 0, 0));<NEW_LINE>} else {<NEW_LINE>consoleTextPane.setBackground(bgColor);<NEW_LINE>}<NEW_LINE>// calculate height of a line of text in pixels<NEW_LINE>// and size window accordingly<NEW_LINE>FontMetrics metrics = this.getFontMetrics(font);<NEW_LINE>int height = metrics.getAscent() + metrics.getDescent();<NEW_LINE>// , 4);<NEW_LINE>int lines = Preferences.getInteger("console.lines");<NEW_LINE>// 10; // unclear why this is necessary, but it is<NEW_LINE>int sizeFudge = 6;<NEW_LINE>setPreferredSize(new Dimension(1024, (height * lines) + sizeFudge));<NEW_LINE>setMinimumSize(new Dimension(1024, (height * 4) + sizeFudge));<NEW_LINE>}
|
stdStyle, font.getFamily());
|
560,809
|
public static void hullSet(Point a, Point b, ArrayList<Point> set, ArrayList<Point> hull) {<NEW_LINE>int insertPosition = hull.indexOf(b);<NEW_LINE>if (set.size() == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (set.size() == 1) {<NEW_LINE>Point p = set.get(0);<NEW_LINE>set.remove(p);<NEW_LINE>hull.add(insertPosition, p);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>double dist = Double.MIN_VALUE;<NEW_LINE>int furthestPoint = -1;<NEW_LINE>for (int i = 0; i < set.size(); i++) {<NEW_LINE>Point p = set.get(i);<NEW_LINE>double distance = distance(a, b, p);<NEW_LINE>if (distance > dist) {<NEW_LINE>dist = distance;<NEW_LINE>furthestPoint = i;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Point p = set.get(furthestPoint);<NEW_LINE>set.remove(furthestPoint);<NEW_LINE><MASK><NEW_LINE>// Determine who's to the left of AP<NEW_LINE>ArrayList<Point> leftSetAP = new ArrayList<Point>();<NEW_LINE>for (int i = 0; i < set.size(); i++) {<NEW_LINE>Point m = set.get(i);<NEW_LINE>if (pointLocation(a, p, m) == 1) {<NEW_LINE>leftSetAP.add(m);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Determine who's to the left of PB<NEW_LINE>ArrayList<Point> leftSetPB = new ArrayList<Point>();<NEW_LINE>for (int i = 0; i < set.size(); i++) {<NEW_LINE>Point m = set.get(i);<NEW_LINE>if (pointLocation(p, b, m) == 1) {<NEW_LINE>leftSetPB.add(m);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>hullSet(a, p, leftSetAP, hull);<NEW_LINE>hullSet(p, b, leftSetPB, hull);<NEW_LINE>}
|
hull.add(insertPosition, p);
|
679,595
|
public String test() {<NEW_LINE>// AppsServer<NEW_LINE>String server = p_data.getAppsServer();<NEW_LINE>boolean pass = server != null && server.length() > 0 && server.toLowerCase().indexOf("localhost") == -1 && !server.equals("127.0.0.1");<NEW_LINE>InetAddress appsServer = null;<NEW_LINE>String error = "Not correct: AppsServer = " + server;<NEW_LINE>try {<NEW_LINE>if (pass)<NEW_LINE>appsServer = InetAddress.getByName(server);<NEW_LINE>} catch (Exception e) {<NEW_LINE>error += " - " + e.getMessage();<NEW_LINE>pass = false;<NEW_LINE>}<NEW_LINE>if (getPanel() != null)<NEW_LINE>signalOK(getPanel().okAppsServer, "ErrorAppsServer", pass, true, error);<NEW_LINE>if (!pass)<NEW_LINE>return error;<NEW_LINE>log.info("OK: AppsServer = " + appsServer);<NEW_LINE>setProperty(ConfigurationData.ADEMPIERE_APPS_SERVER, appsServer.getHostName());<NEW_LINE>setProperty(ConfigurationData.ADEMPIERE_APPS_TYPE, p_data.getAppsServerType());<NEW_LINE>// Server Dir<NEW_LINE>File serverPath = new <MASK><NEW_LINE>pass = serverPath.exists();<NEW_LINE>error = "Not found: " + serverPath;<NEW_LINE>if (getPanel() != null)<NEW_LINE>signalOK(getPanel().okServerDir, "ErrorServerDir", pass, true, error);<NEW_LINE>if (!pass)<NEW_LINE>return error;<NEW_LINE>setProperty(ConfigurationData.ADEMPIERE_APPS_PATH, p_data.getAppsServerDir());<NEW_LINE>log.info("OK: Deploy Directory = " + serverPath);<NEW_LINE>// Deploy Dir<NEW_LINE>p_data.setAppsServerDeployDir(getDeployDir());<NEW_LINE>File deploy = new File(p_data.getAppsServerDeployDir());<NEW_LINE>pass = deploy.exists();<NEW_LINE>error = "Not found: " + deploy;<NEW_LINE>if (getPanel() != null)<NEW_LINE>signalOK(getPanel().okDeployDir, "ErrorDeployDir", pass, true, error);<NEW_LINE>if (!pass)<NEW_LINE>return error;<NEW_LINE>// JNP Port<NEW_LINE>int JNPPort = p_data.getAppsServerJNPPort();<NEW_LINE>setProperty(ConfigurationData.ADEMPIERE_JNP_PORT, String.valueOf(JNPPort));<NEW_LINE>// Web Port<NEW_LINE>int WebPort = p_data.getAppsServerWebPort();<NEW_LINE>pass = !p_data.testPort("http", appsServer.getHostName(), WebPort, "/") && p_data.testServerPort(WebPort);<NEW_LINE>error = "Not correct: Web Port = " + WebPort;<NEW_LINE>if (getPanel() != null)<NEW_LINE>signalOK(getPanel().okWebPort, "ErrorWebPort", pass, true, error);<NEW_LINE>if (!pass)<NEW_LINE>return error;<NEW_LINE>log.info("OK: Web Port = " + WebPort);<NEW_LINE>setProperty(ConfigurationData.ADEMPIERE_WEB_PORT, String.valueOf(WebPort));<NEW_LINE>// SSL Port<NEW_LINE>int sslPort = p_data.getAppsServerSSLPort();<NEW_LINE>pass = !p_data.testPort("https", appsServer.getHostName(), sslPort, "/") && p_data.testServerPort(sslPort);<NEW_LINE>error = "Not correct: SSL Port = " + sslPort;<NEW_LINE>if (getPanel() != null)<NEW_LINE>signalOK(getPanel().okSSLPort, "ErrorWebPort", pass, true, error);<NEW_LINE>if (!pass)<NEW_LINE>return error;<NEW_LINE>log.info("OK: SSL Port = " + sslPort);<NEW_LINE>setProperty(ConfigurationData.ADEMPIERE_SSL_PORT, String.valueOf(sslPort));<NEW_LINE>//<NEW_LINE>return null;<NEW_LINE>}
|
File(p_data.getAppsServerDir());
|
631,009
|
private int submitSequential(final TaskMetaData meta) {<NEW_LINE>final int task;<NEW_LINE>debugInfo(meta);<NEW_LINE>if ((meta.getGlobalWork() == null) || (meta.getGlobalWork().length == 0)) {<NEW_LINE>// Sequential kernel execution<NEW_LINE>task = deviceContext.enqueueNDRangeKernel(kernel, 1, <MASK><NEW_LINE>} else {<NEW_LINE>// Ahead Of Time kernel execution<NEW_LINE>task = deviceContext.enqueueNDRangeKernel(kernel, 1, null, meta.getGlobalWork(), meta.getLocalWork(), null);<NEW_LINE>}<NEW_LINE>if (TornadoOptions.isProfilerEnabled()) {<NEW_LINE>Event tornadoKernelEvent = deviceContext.resolveEvent(task);<NEW_LINE>tornadoKernelEvent.waitForEvents();<NEW_LINE>long timer = meta.getProfiler().getTimer(ProfilerType.TOTAL_KERNEL_TIME);<NEW_LINE>// Register globalTime<NEW_LINE>meta.getProfiler().setTimer(ProfilerType.TOTAL_KERNEL_TIME, timer + tornadoKernelEvent.getElapsedTime());<NEW_LINE>// Register the time for the task<NEW_LINE>meta.getProfiler().setTaskTimer(ProfilerType.TASK_KERNEL_TIME, meta.getId(), tornadoKernelEvent.getElapsedTime());<NEW_LINE>// Register the dispatch time of the kernel<NEW_LINE>long dispatchValue = meta.getProfiler().getTimer(ProfilerType.TOTAL_DISPATCH_KERNEL_TIME);<NEW_LINE>dispatchValue += tornadoKernelEvent.getDriverDispatchTime();<NEW_LINE>meta.getProfiler().setTimer(ProfilerType.TOTAL_DISPATCH_KERNEL_TIME, dispatchValue);<NEW_LINE>}<NEW_LINE>return task;<NEW_LINE>}
|
null, singleThreadGlobalWorkSize, singleThreadLocalWorkSize, null);
|
232,419
|
public // override SqlOperator<NEW_LINE>SqlNode rewriteCall(SqlValidator validator, SqlCall call) {<NEW_LINE>// check DISTINCT/ALL<NEW_LINE>validateQuantifier(validator, call);<NEW_LINE>List<SqlNode> operands = call.getOperandList();<NEW_LINE>if (operands.size() == 1) {<NEW_LINE>// No CASE needed<NEW_LINE>return operands.get(0);<NEW_LINE>}<NEW_LINE>SqlParserPos pos = call.getParserPosition();<NEW_LINE>SqlNodeList whenList = new SqlNodeList(pos);<NEW_LINE>SqlNodeList thenList = new SqlNodeList(pos);<NEW_LINE>// todo: optimize when know operand is not null.<NEW_LINE>for (SqlNode operand : Util.skipLast(operands)) {<NEW_LINE>whenList.add(SqlStdOperatorTable.IS_NOT_NULL.createCall(pos, operand));<NEW_LINE>thenList.add(SqlNode.clone(operand));<NEW_LINE>}<NEW_LINE>SqlNode <MASK><NEW_LINE>assert call.getFunctionQuantifier() == null;<NEW_LINE>return SqlCase.createSwitched(pos, null, whenList, thenList, elseExpr);<NEW_LINE>}
|
elseExpr = Util.last(operands);
|
511,231
|
public void deploy(DmnDeploymentEntity deployment, Map<String, Object> deploymentSettings) {<NEW_LINE>LOGGER.debug("Processing deployment {}", deployment.getName());<NEW_LINE>// The ParsedDeployment represents the deployment, the decision and the DMN<NEW_LINE>// resource, parse, and model associated with each decision table.<NEW_LINE>ParsedDeployment parsedDeployment = parsedDeploymentBuilderFactory.getBuilderForDeploymentAndSettings(<MASK><NEW_LINE>dmnDeploymentHelper.copyDeploymentValuesToDecisions(parsedDeployment.getDeployment(), parsedDeployment.getAllDecisions());<NEW_LINE>dmnDeploymentHelper.setResourceNamesOnDecisions(parsedDeployment);<NEW_LINE>dmnDeploymentHelper.createAndPersistNewDiagramsIfNeeded(parsedDeployment, decisionRequirementsDiagramHelper);<NEW_LINE>dmnDeploymentHelper.setDecisionDefinitionDiagramNames(parsedDeployment);<NEW_LINE>if (deployment.isNew()) {<NEW_LINE>Map<DecisionEntity, DecisionEntity> mapOfNewDefinitionToPreviousVersion = getPreviousVersionsOfDecisions(parsedDeployment);<NEW_LINE>setDecisionVersionsAndIds(parsedDeployment, mapOfNewDefinitionToPreviousVersion);<NEW_LINE>persistDecisions(parsedDeployment);<NEW_LINE>} else {<NEW_LINE>makeDecisionsConsistentWithPersistedVersions(parsedDeployment);<NEW_LINE>}<NEW_LINE>cachingAndArtifactsManager.updateCachingAndArtifacts(parsedDeployment);<NEW_LINE>}
|
deployment, deploymentSettings).build();
|
1,372,093
|
private SqlNode createOrderNode(OrderOperator operator) {<NEW_LINE>SqlNode sqlNode;<NEW_LINE>if (functionColumnMap.containsKey(operator.getColumn())) {<NEW_LINE>sqlNode = functionColumnMap.get(operator.getColumn());<NEW_LINE>} else {<NEW_LINE>if (operator.getColumn() == null) {<NEW_LINE>sqlNode = <MASK><NEW_LINE>} else {<NEW_LINE>sqlNode = SqlNodeUtils.createSqlIdentifier(operator.getColumn(), T);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (operator.getAggOperator() != null) {<NEW_LINE>SqlOperator aggOperator = mappingSqlAggFunction(operator.getAggOperator());<NEW_LINE>sqlNode = new SqlBasicCall(aggOperator, new SqlNode[] { sqlNode }, SqlParserPos.ZERO);<NEW_LINE>}<NEW_LINE>if (operator.getOperator() == OrderOperator.SqlOperator.DESC) {<NEW_LINE>return new SqlBasicCall(SqlStdOperatorTable.DESC, new SqlNode[] { sqlNode }, SqlParserPos.ZERO);<NEW_LINE>} else {<NEW_LINE>return sqlNode;<NEW_LINE>}<NEW_LINE>}
|
SqlLiteral.createNull(SqlParserPos.ZERO);
|
1,220,520
|
public static FutureTask<Void> startInferenceProcessWatcher(Process process, MLContext mlContext) {<NEW_LINE>Thread inLogger = new Thread(new ShellExec.ProcessLogger(process.getInputStream(), new ShellExec.StdOutConsumer()));<NEW_LINE>Thread errLogger = new Thread(new ShellExec.ProcessLogger(process.getErrorStream(), <MASK><NEW_LINE>inLogger.setName(mlContext.getIdentity() + "-JavaInferenceProcess-in-logger");<NEW_LINE>inLogger.setDaemon(true);<NEW_LINE>errLogger.setName(mlContext.getIdentity() + "-JavaInferenceProcess-err-logger");<NEW_LINE>errLogger.setDaemon(true);<NEW_LINE>inLogger.start();<NEW_LINE>errLogger.start();<NEW_LINE>FutureTask<Void> res = new FutureTask<>(() -> {<NEW_LINE>try {<NEW_LINE>int r = process.waitFor();<NEW_LINE>inLogger.join();<NEW_LINE>errLogger.join();<NEW_LINE>if (r != 0) {<NEW_LINE>throw new RuntimeException("Java inference process exited with " + r);<NEW_LINE>}<NEW_LINE>LOG.info("{} Java inference process finished successfully", mlContext.getIdentity());<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>LOG.info("{} Java inference process watcher interrupted, killing the process", mlContext.getIdentity());<NEW_LINE>} finally {<NEW_LINE>process.destroyForcibly();<NEW_LINE>}<NEW_LINE>}, null);<NEW_LINE>Thread t = new Thread(res);<NEW_LINE>t.setName(mlContext.getIdentity() + "-JavaInferenceWatcher");<NEW_LINE>t.setDaemon(true);<NEW_LINE>t.start();<NEW_LINE>return res;<NEW_LINE>}
|
new ShellExec.StdOutConsumer()));
|
1,138,467
|
public void visitSymbol(ESymbol userSymbolNode, ScriptScope scriptScope) {<NEW_LINE>ExpressionNode irExpressionNode;<NEW_LINE>if (scriptScope.hasDecoration(userSymbolNode, StaticType.class)) {<NEW_LINE>Class<?> staticType = scriptScope.getDecoration(userSymbolNode, StaticType.class).getStaticType();<NEW_LINE>StaticNode staticNode = new StaticNode(userSymbolNode.getLocation());<NEW_LINE>staticNode.setExpressionType(staticType);<NEW_LINE>irExpressionNode = staticNode;<NEW_LINE>} else if (scriptScope.hasDecoration(userSymbolNode, ValueType.class)) {<NEW_LINE>boolean read = scriptScope.getCondition(userSymbolNode, Read.class);<NEW_LINE>boolean write = scriptScope.getCondition(userSymbolNode, Write.class);<NEW_LINE>boolean compound = scriptScope.getCondition(userSymbolNode, Compound.class);<NEW_LINE>Location location = userSymbolNode.getLocation();<NEW_LINE>String symbol = userSymbolNode.getSymbol();<NEW_LINE>Class<?> valueType = scriptScope.getDecoration(userSymbolNode, <MASK><NEW_LINE>StoreNode irStoreNode = null;<NEW_LINE>ExpressionNode irLoadNode = null;<NEW_LINE>if (write || compound) {<NEW_LINE>StoreVariableNode irStoreVariableNode = new StoreVariableNode(location);<NEW_LINE>irStoreVariableNode.setExpressionType(read ? valueType : void.class);<NEW_LINE>irStoreVariableNode.setStoreType(valueType);<NEW_LINE>irStoreVariableNode.setName(symbol);<NEW_LINE>irStoreNode = irStoreVariableNode;<NEW_LINE>}<NEW_LINE>if (write == false || compound) {<NEW_LINE>LoadVariableNode irLoadVariableNode = new LoadVariableNode(location);<NEW_LINE>irLoadVariableNode.setExpressionType(valueType);<NEW_LINE>irLoadVariableNode.setName(symbol);<NEW_LINE>irLoadNode = irLoadVariableNode;<NEW_LINE>}<NEW_LINE>scriptScope.putDecoration(userSymbolNode, new AccessDepth(0));<NEW_LINE>irExpressionNode = buildLoadStore(0, location, false, null, null, irLoadNode, irStoreNode);<NEW_LINE>} else {<NEW_LINE>throw userSymbolNode.createError(new IllegalStateException("illegal tree structure"));<NEW_LINE>}<NEW_LINE>scriptScope.putDecoration(userSymbolNode, new IRNodeDecoration(irExpressionNode));<NEW_LINE>}
|
ValueType.class).getValueType();
|
56,345
|
public static void initConsoleView(@Nonnull final SMTRunnerConsoleView consoleView, @Nonnull final String testFrameworkName, @javax.annotation.Nullable final TestLocationProvider locator, final boolean idBasedTreeConstruction, @Nullable final TestProxyFilterProvider filterProvider) {<NEW_LINE>consoleView.addAttachToProcessListener(new AttachToProcessListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onAttachToProcess(@Nonnull ProcessHandler processHandler) {<NEW_LINE>TestConsoleProperties properties = consoleView.getProperties();<NEW_LINE>SMTestLocator testLocator = new CompositeTestLocationProvider(locator);<NEW_LINE>TestProxyPrinterProvider printerProvider = null;<NEW_LINE>if (filterProvider != null) {<NEW_LINE>printerProvider <MASK><NEW_LINE>}<NEW_LINE>SMTestRunnerResultsForm resultsForm = consoleView.getResultsViewer();<NEW_LINE>attachEventsProcessors(properties, resultsForm, resultsForm.getStatisticsPane(), processHandler, testFrameworkName, testLocator, idBasedTreeConstruction, printerProvider);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>consoleView.setHelpId("reference.runToolWindow.testResultsTab");<NEW_LINE>consoleView.initUI();<NEW_LINE>}
|
= new TestProxyPrinterProvider(consoleView, filterProvider);
|
1,129,226
|
// snippet-start:[sagemaker.java2.transform_job.main]<NEW_LINE>public static void transformJob(SageMakerClient sageMakerClient, String s3Uri, String s3OutputPath, String modelName, String transformJobName) {<NEW_LINE>try {<NEW_LINE>TransformS3DataSource s3DataSource = TransformS3DataSource.builder().s3DataType("S3Prefix").s3Uri(s3Uri).build();<NEW_LINE>TransformDataSource dataSource = TransformDataSource.builder().<MASK><NEW_LINE>TransformInput input = TransformInput.builder().dataSource(dataSource).contentType("text/csv").splitType("Line").build();<NEW_LINE>TransformOutput output = TransformOutput.builder().s3OutputPath(s3OutputPath).build();<NEW_LINE>TransformResources resources = TransformResources.builder().instanceCount(1).instanceType("ml.m4.xlarge").build();<NEW_LINE>CreateTransformJobRequest jobRequest = CreateTransformJobRequest.builder().transformJobName(transformJobName).modelName(modelName).transformInput(input).transformOutput(output).transformResources(resources).build();<NEW_LINE>CreateTransformJobResponse jobResponse = sageMakerClient.createTransformJob(jobRequest);<NEW_LINE>System.out.println("Response " + jobResponse.transformJobArn());<NEW_LINE>} catch (SageMakerException e) {<NEW_LINE>System.err.println(e.awsErrorDetails().errorMessage());<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>}
|
s3DataSource(s3DataSource).build();
|
1,692,240
|
private void informModuleNotification(final ViewNotificationContainer moduleViewNotificationContainer, final SQLProvider provider) throws CouldntLoadDataException {<NEW_LINE>if (moduleViewNotificationContainer.getDatabaseOperation().equals("INSERT")) {<NEW_LINE>final INaviModule module = moduleViewNotificationContainer<MASK><NEW_LINE>if (!module.isLoaded()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final Integer viewId = moduleViewNotificationContainer.getViewId();<NEW_LINE>final ImmutableNaviViewConfiguration databaseViewConfiguration = provider.loadFlowGraphInformation(module, viewId);<NEW_LINE>final CModuleViewGenerator generator = new CModuleViewGenerator(provider, module);<NEW_LINE>final INaviView view = generator.generate(databaseViewConfiguration, GraphType.FLOWGRAPH);<NEW_LINE>module.getContent().getViewContainer().addView(view);<NEW_LINE>}<NEW_LINE>if (moduleViewNotificationContainer.getDatabaseOperation().equals("UPDATE")) {<NEW_LINE>// updates will not happen as this is only a mapping of id to id.<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (moduleViewNotificationContainer.getDatabaseOperation().equals("DELETE")) {<NEW_LINE>final INaviModule module = moduleViewNotificationContainer.getNotificationModule().get();<NEW_LINE>if (!module.isLoaded()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final Integer viewId = moduleViewNotificationContainer.getViewId();<NEW_LINE>final INaviView view = ViewManager.get(provider).getView(viewId);<NEW_LINE>module.getContent().getViewContainer().deleteViewInternal(view);<NEW_LINE>}<NEW_LINE>}
|
.getNotificationModule().get();
|
1,776,878
|
public void serve404(HttpServletRequest servletRequest, HttpServletResponse servletResponse, NotFound e) {<NEW_LINE>Logger.warn("404 -> %s %s (%s)", servletRequest.getMethod(), servletRequest.getRequestURI(), e.getMessage());<NEW_LINE>servletResponse.setStatus(404);<NEW_LINE>servletResponse.setContentType("text/html");<NEW_LINE>Map<String, Object> binding = new HashMap<>();<NEW_LINE>binding.put("result", e);<NEW_LINE>binding.put("session", <MASK><NEW_LINE>binding.put("request", Http.Request.current());<NEW_LINE>binding.put("flash", Scope.Flash.current());<NEW_LINE>binding.put("params", Scope.Params.current());<NEW_LINE>binding.put("play", new Play());<NEW_LINE>try {<NEW_LINE>binding.put("errors", Validation.errors());<NEW_LINE>} catch (Exception ex) {<NEW_LINE>Logger.error(ex, "Failed to bind errors");<NEW_LINE>}<NEW_LINE>String format = Request.current().format;<NEW_LINE>servletResponse.setStatus(404);<NEW_LINE>// Do we have an ajax request? If we have then we want to display some text even if it is html that is requested<NEW_LINE>if ("XMLHttpRequest".equals(servletRequest.getHeader("X-Requested-With")) && (format == null || format.equals("html"))) {<NEW_LINE>format = "txt";<NEW_LINE>}<NEW_LINE>if (format == null) {<NEW_LINE>format = "txt";<NEW_LINE>}<NEW_LINE>servletResponse.setContentType(MimeTypes.getContentType("404." + format, "text/plain"));<NEW_LINE>String errorHtml = TemplateLoader.load("errors/404." + format).render(binding);<NEW_LINE>try {<NEW_LINE>servletResponse.getOutputStream().write(errorHtml.getBytes(Response.current().encoding));<NEW_LINE>} catch (Exception fex) {<NEW_LINE>Logger.error(fex, "(encoding ?)");<NEW_LINE>}<NEW_LINE>}
|
Scope.Session.current());
|
90,986
|
public List<CachedRow> fastFetchQuery() throws SQLException, DatabaseException {<NEW_LINE>CatalogAndSchema catalogAndSchema = new CatalogAndSchema(catalogName<MASK><NEW_LINE>if (database instanceof OracleDatabase) {<NEW_LINE>return queryOracle(catalogAndSchema, table);<NEW_LINE>} else if (database instanceof MSSQLDatabase) {<NEW_LINE>return queryMssql(catalogAndSchema, table);<NEW_LINE>} else if (database instanceof Db2zDatabase) {<NEW_LINE>return queryDb2Zos(catalogAndSchema, table);<NEW_LINE>} else if (database instanceof PostgresDatabase) {<NEW_LINE>return queryPostgres(catalogAndSchema, table);<NEW_LINE>}<NEW_LINE>String catalog = ((AbstractJdbcDatabase) database).getJdbcCatalogName(catalogAndSchema);<NEW_LINE>String schema = ((AbstractJdbcDatabase) database).getJdbcSchemaName(catalogAndSchema);<NEW_LINE>return extract(databaseMetaData.getTables(catalog, escapeForLike(schema), ((table == null) ? SQL_FILTER_MATCH_ALL : escapeForLike(table)), new String[] { "TABLE" }));<NEW_LINE>}
|
, schemaName).customize(database);
|
729,699
|
public static JdbcDatabaseContainer<?> create(DatabaseContainerType defaultType) throws IllegalArgumentException {<NEW_LINE>String <MASK><NEW_LINE>String dbProperty = System.getProperty("fat.bucket.db.type", defaultType.name());<NEW_LINE>Log.info(c, "create", "System property: fat.test.databases is " + dbRotation);<NEW_LINE>Log.info(c, "create", "System property: fat.bucket.db.type is " + dbProperty);<NEW_LINE>if (!"true".equals(dbRotation)) {<NEW_LINE>throw new IllegalArgumentException("To use a generic database, the FAT must be opted into database rotation by setting 'fat.test.databases: true' in the FAT project's bnd.bnd file");<NEW_LINE>}<NEW_LINE>DatabaseContainerType type = null;<NEW_LINE>try {<NEW_LINE>type = DatabaseContainerType.valueOf(dbProperty);<NEW_LINE>Log.info(c, "create", "FOUND: database test-container type: " + type);<NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>throw new IllegalArgumentException("No database test-container supported for " + dbProperty, e);<NEW_LINE>}<NEW_LINE>return initContainer(type);<NEW_LINE>}
|
dbRotation = System.getProperty("fat.test.databases");
|
1,408,868
|
private static InputStream fakeManifest(ModuleInfo m) throws IOException {<NEW_LINE>// NOI18N<NEW_LINE>String exp = (String) m.getAttribute("OpenIDE-Module-Public-Packages");<NEW_LINE>if ("-".equals(exp)) {<NEW_LINE>// NOI18N<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>ByteArrayOutputStream os = new ByteArrayOutputStream();<NEW_LINE>Manifest man = new Manifest();<NEW_LINE>// workaround for JDK bug<NEW_LINE>man.getMainAttributes(<MASK><NEW_LINE>// NOI18N<NEW_LINE>man.getMainAttributes().putValue("Bundle-ManifestVersion", "2");<NEW_LINE>// NOI18N<NEW_LINE>man.getMainAttributes().putValue("Bundle-SymbolicName", m.getCodeNameBase());<NEW_LINE>if (m.getSpecificationVersion() != null) {<NEW_LINE>String spec = threeDotsWithMajor(m.getSpecificationVersion().toString(), m.getCodeName());<NEW_LINE>// NOI18N<NEW_LINE>man.getMainAttributes().putValue("Bundle-Version", spec.toString());<NEW_LINE>}<NEW_LINE>if (exp != null) {<NEW_LINE>// NOI18N<NEW_LINE>man.getMainAttributes().putValue("Export-Package", exp.replaceAll("\\.\\*", ""));<NEW_LINE>} else {<NEW_LINE>// NOI18N<NEW_LINE>man.getMainAttributes().putValue("Export-Package", m.getCodeNameBase());<NEW_LINE>}<NEW_LINE>man.write(os);<NEW_LINE>return new ByteArrayInputStream(os.toByteArray());<NEW_LINE>}
|
).putValue("Manifest-Version", "1.0");
|
552,439
|
public static void main(String[] args) {<NEW_LINE>Scanner sc = new Scanner(System.in);<NEW_LINE>System.out.print("Enter the Heap Capacity: ");<NEW_LINE>int hCap = sc.nextInt();<NEW_LINE>Min_Heap hp = new Min_Heap(hCap);<NEW_LINE>boolean flag = true;<NEW_LINE>int val = 0;<NEW_LINE>while (flag) {<NEW_LINE>System.out.println();<NEW_LINE>System.out.println("0. Exit");<NEW_LINE>System.out.println("1 - Insert an Element");<NEW_LINE>System.out.println("2 - Display the Heap");<NEW_LINE>System.out.println("3 - Height of the Heap");<NEW_LINE>System.out.println("4 - Current Heap Size");<NEW_LINE>System.out.println("5 - minExtract()");<NEW_LINE>System.out.println("6 - Delete Key");<NEW_LINE>System.out.println("7 - Heap Sort");<NEW_LINE>System.out.print("Enter Your Choice: ");<NEW_LINE>int ch = sc.nextInt();<NEW_LINE>switch(ch) {<NEW_LINE>case 0:<NEW_LINE>flag = false;<NEW_LINE>break;<NEW_LINE>case 1:<NEW_LINE>System.out.print("Enter Value to be Inserted: ");<NEW_LINE>val = sc.nextInt();<NEW_LINE>hp.insert(val);<NEW_LINE>break;<NEW_LINE>case 2:<NEW_LINE>hp.display();<NEW_LINE>break;<NEW_LINE>case 3:<NEW_LINE>System.out.println("Height of Heap Tree = " + ((int) Math.ceil(Math.log(hp.hSize + 1) / Math.log(2)) - 1));<NEW_LINE>break;<NEW_LINE>case 4:<NEW_LINE>System.out.println("The Size of the Heap is = " + hp.hSize);<NEW_LINE>break;<NEW_LINE>case 5:<NEW_LINE>System.out.println(hp.minExtract());<NEW_LINE>break;<NEW_LINE>case 6:<NEW_LINE><MASK><NEW_LINE>val = sc.nextInt();<NEW_LINE>hp.minDeleteKey(val);<NEW_LINE>break;<NEW_LINE>case 7:<NEW_LINE>hp.hSize = hp.hCap;<NEW_LINE>System.out.println("Enter Elements of Unsorted Array:");<NEW_LINE>for (int i = 0; i < hp.hCap; i++) {<NEW_LINE>hp.hArr[i] = sc.nextInt();<NEW_LINE>}<NEW_LINE>hp.heapSort(hp.hArr);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>System.out.println("Invalid Choice");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
System.out.print("Enter Key to be Deleted: ");
|
1,676,784
|
public void decode16x16(MBlock mBlock, Picture mb, Frame[][] refs, PartPred p0) {<NEW_LINE>int mbX = mapper.getMbX(mBlock.mbIdx);<NEW_LINE>int mbY = mapper.getMbY(mBlock.mbIdx);<NEW_LINE>boolean leftAvailable = <MASK><NEW_LINE>boolean topAvailable = mapper.topAvailable(mBlock.mbIdx);<NEW_LINE>boolean topLeftAvailable = mapper.topLeftAvailable(mBlock.mbIdx);<NEW_LINE>boolean topRightAvailable = mapper.topRightAvailable(mBlock.mbIdx);<NEW_LINE>int address = mapper.getAddress(mBlock.mbIdx);<NEW_LINE>int xx = mbX << 2;<NEW_LINE>for (int list = 0; list < 2; list++) {<NEW_LINE>predictInter16x16(mBlock, mbb[list], refs, mbX, mbY, leftAvailable, topAvailable, topLeftAvailable, topRightAvailable, mBlock.x, xx, list, p0);<NEW_LINE>}<NEW_LINE>PredictionMerger.mergePrediction(sh, mBlock.x.mv0R(0), mBlock.x.mv1R(0), p0, 0, mbb[0].getPlaneData(0), mbb[1].getPlaneData(0), 0, 16, 16, 16, mb.getPlaneData(0), refs, poc);<NEW_LINE>mBlock.partPreds[0] = mBlock.partPreds[1] = mBlock.partPreds[2] = mBlock.partPreds[3] = p0;<NEW_LINE>predictChromaInter(refs, mBlock.x, mbX << 3, mbY << 3, 1, mb, mBlock.partPreds);<NEW_LINE>predictChromaInter(refs, mBlock.x, mbX << 3, mbY << 3, 2, mb, mBlock.partPreds);<NEW_LINE>residualInter(mBlock, refs, leftAvailable, topAvailable, mbX, mbY, mapper.getAddress(mBlock.mbIdx));<NEW_LINE>saveMvs(di, mBlock.x, mbX, mbY);<NEW_LINE>mergeResidual(mb, mBlock.ac, mBlock.transform8x8Used ? COMP_BLOCK_8x8_LUT : COMP_BLOCK_4x4_LUT, mBlock.transform8x8Used ? COMP_POS_8x8_LUT : COMP_POS_4x4_LUT);<NEW_LINE>collectPredictors(s, mb, mbX);<NEW_LINE>di.mbTypes[address] = mBlock.curMbType;<NEW_LINE>}
|
mapper.leftAvailable(mBlock.mbIdx);
|
511,818
|
private static void tryAssertionSix(RegressionEnvironment env, String expression) {<NEW_LINE>env.compileDeploy(expression).addListener("s0");<NEW_LINE>String[] <MASK><NEW_LINE>sendBeanInt(env, "S00", 1, 1, 1);<NEW_LINE>env.assertPropsPerRowIteratorAnyOrder("s0", fields, new Object[][] { { "H01", "H11", "H01-H21" } });<NEW_LINE>sendBeanInt(env, "S01", 0, 1, 1);<NEW_LINE>env.assertPropsPerRowIteratorAnyOrder("s0", fields, null);<NEW_LINE>sendBeanInt(env, "S02", 1, 1, 0);<NEW_LINE>env.assertPropsPerRowIteratorAnyOrder("s0", fields, null);<NEW_LINE>sendBeanInt(env, "S03", 1, 1, 2);<NEW_LINE>env.assertPropsPerRowIteratorAnyOrder("s0", fields, new Object[][] { { "H01", "H11", "H01-H21" }, { "H01", "H11", "H01-H22" } });<NEW_LINE>sendBeanInt(env, "S04", 2, 2, 1);<NEW_LINE>Object[][] result = new Object[][] { { "H01", "H11", "H01-H21" }, { "H02", "H11", "H02-H21" }, { "H01", "H12", "H01-H21" }, { "H02", "H12", "H02-H21" } };<NEW_LINE>env.assertPropsPerRowIteratorAnyOrder("s0", fields, result);<NEW_LINE>env.undeployModuleContaining("s0");<NEW_LINE>}
|
fields = "valh0,valh1,valh2".split(",");
|
1,177,145
|
public void stateChanged(ChangeEvent e) {<NEW_LINE>if (project != null && ProviderUtil.isValidServerInstanceOrNone(project)) {<NEW_LINE>// stop listening once a server was set<NEW_LINE>serverStatusProvider.removeChangeListener(changeListener);<NEW_LINE>if (!Util.isContainerManaged(project)) {<NEW_LINE>// if selected server does not support DataSource then<NEW_LINE>// swap the combo to DB Connection selection<NEW_LINE>datasourceComboBox.setModel(new DefaultComboBoxModel());<NEW_LINE>initializeWithDbConnections();<NEW_LINE>// notify user about result of server selection:<NEW_LINE>DialogDisplayer.getDefault().notify(new NotifyDescriptor.Message(NbBundle.getMessage(DatabaseTablesPanel.class, "WRN_Server_Does_Not_Support_DS")));<NEW_LINE>} else {<NEW_LINE>// #190671 - because of hacks around server set in maven<NEW_LINE>// listen and update data sources after server was set here again.<NEW_LINE>// In theory this should not be necessary and<NEW_LINE>// j2ee.common.DatasourceUIHelper.performServerSelection should have done<NEW_LINE>// everything necessary but often at that time<NEW_LINE>// PersistenceProviderSupplier.supportsDefaultProvider() is still false<NEW_LINE>// (server change was not propagated there yet). In worst case combo model will be set twice:<NEW_LINE>datasourceComboBox<MASK><NEW_LINE>initializeWithDatasources();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
.setModel(new DefaultComboBoxModel());
|
1,265,353
|
final ExecuteChangeSetResult executeExecuteChangeSet(ExecuteChangeSetRequest executeChangeSetRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(executeChangeSetRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ExecuteChangeSetRequest> request = null;<NEW_LINE>Response<ExecuteChangeSetResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ExecuteChangeSetRequestMarshaller().marshall(super.beforeMarshalling(executeChangeSetRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudFormation");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ExecuteChangeSet");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<ExecuteChangeSetResult> responseHandler = new StaxResponseHandler<ExecuteChangeSetResult>(new ExecuteChangeSetResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
|
addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
|
1,082,826
|
private TextChunk[] extractChunks(@Nonnull UsageInfo2UsageAdapter usageInfo2UsageAdapter, @Nonnull PsiFile file) {<NEW_LINE>int absoluteStartOffset = usageInfo2UsageAdapter.getNavigationOffset();<NEW_LINE>if (absoluteStartOffset == -1)<NEW_LINE>return TextChunk.EMPTY_ARRAY;<NEW_LINE>Document visibleDocument = myDocument instanceof DocumentWindow ? ((DocumentWindow) <MASK><NEW_LINE>int visibleStartOffset = myDocument instanceof DocumentWindow ? ((DocumentWindow) myDocument).injectedToHost(absoluteStartOffset) : absoluteStartOffset;<NEW_LINE>int lineNumber = myDocument.getLineNumber(absoluteStartOffset);<NEW_LINE>int visibleLineNumber = visibleDocument.getLineNumber(visibleStartOffset);<NEW_LINE>int visibleColumnNumber = visibleStartOffset - visibleDocument.getLineStartOffset(visibleLineNumber);<NEW_LINE>final List<TextChunk> result = new ArrayList<TextChunk>();<NEW_LINE>appendPrefix(result, visibleLineNumber, visibleColumnNumber);<NEW_LINE>int fragmentToShowStart = myDocument.getLineStartOffset(lineNumber);<NEW_LINE>int fragmentToShowEnd = fragmentToShowStart < myDocument.getTextLength() ? myDocument.getLineEndOffset(lineNumber) : 0;<NEW_LINE>if (fragmentToShowStart > fragmentToShowEnd)<NEW_LINE>return TextChunk.EMPTY_ARRAY;<NEW_LINE>final CharSequence chars = myDocument.getCharsSequence();<NEW_LINE>if (fragmentToShowEnd - fragmentToShowStart > MAX_LINE_LENGTH_TO_SHOW) {<NEW_LINE>final int lineStartOffset = fragmentToShowStart;<NEW_LINE>fragmentToShowStart = Math.max(lineStartOffset, absoluteStartOffset - OFFSET_BEFORE_TO_SHOW_WHEN_LONG_LINE);<NEW_LINE>final int lineEndOffset = fragmentToShowEnd;<NEW_LINE>Segment segment = usageInfo2UsageAdapter.getUsageInfo().getSegment();<NEW_LINE>int usage_length = segment != null ? segment.getEndOffset() - segment.getStartOffset() : 0;<NEW_LINE>fragmentToShowEnd = Math.min(lineEndOffset, absoluteStartOffset + usage_length + OFFSET_AFTER_TO_SHOW_WHEN_LONG_LINE);<NEW_LINE>// if we search something like a word, then expand shown context from one symbol before / after at least for word boundary<NEW_LINE>// this should not cause restarts of the lexer as the tokens are usually words<NEW_LINE>if (usage_length > 0 && StringUtil.isJavaIdentifierStart(chars.charAt(absoluteStartOffset)) && StringUtil.isJavaIdentifierStart(chars.charAt(absoluteStartOffset + usage_length - 1))) {<NEW_LINE>while (fragmentToShowEnd < lineEndOffset && StringUtil.isJavaIdentifierStart(chars.charAt(fragmentToShowEnd - 1))) ++fragmentToShowEnd;<NEW_LINE>while (fragmentToShowStart > lineStartOffset && StringUtil.isJavaIdentifierStart(chars.charAt(fragmentToShowStart))) --fragmentToShowStart;<NEW_LINE>if (fragmentToShowStart != lineStartOffset)<NEW_LINE>++fragmentToShowStart;<NEW_LINE>if (fragmentToShowEnd != lineEndOffset)<NEW_LINE>--fragmentToShowEnd;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (myDocument instanceof DocumentWindow) {<NEW_LINE>List<TextRange> editable = InjectedLanguageManager.getInstance(file.getProject()).intersectWithAllEditableFragments(file, new TextRange(fragmentToShowStart, fragmentToShowEnd));<NEW_LINE>for (TextRange range : editable) {<NEW_LINE>createTextChunks(usageInfo2UsageAdapter, chars, range.getStartOffset(), range.getEndOffset(), true, result);<NEW_LINE>}<NEW_LINE>return result.toArray(new TextChunk[result.size()]);<NEW_LINE>}<NEW_LINE>return createTextChunks(usageInfo2UsageAdapter, chars, fragmentToShowStart, fragmentToShowEnd, true, result);<NEW_LINE>}
|
myDocument).getDelegate() : myDocument;
|
1,267,970
|
public static void main(String[] args) {<NEW_LINE>File file = new File(args[0]);<NEW_LINE>try {<NEW_LINE>JarFile jar = new JarFile(file);<NEW_LINE>URLClassLoader loader = new URLClassLoader(new URL[] { file.toURI().toURL() });<NEW_LINE>Enumeration<JarEntry> entries = jar.entries();<NEW_LINE>while (entries.hasMoreElements()) {<NEW_LINE>JarEntry entry = entries.nextElement();<NEW_LINE>if (getClassName(entry) != null) {<NEW_LINE>try {<NEW_LINE>// NOI18N<NEW_LINE>System.out.// NOI18N<NEW_LINE>println<MASK><NEW_LINE>loader.loadClass(getClassName(entry));<NEW_LINE>} catch (NoClassDefFoundError e) {<NEW_LINE>// do nothing; this is OK - classpath issues<NEW_LINE>} catch (IllegalAccessError e) {<NEW_LINE>// do nothing; this is also somewhat OK, since we do not<NEW_LINE>// define any security policies<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>jar.close();<NEW_LINE>System.exit(0);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>// we need to catch everything here in order to not<NEW_LINE>// allow unexpected exceptions to pass through<NEW_LINE>e.printStackTrace();<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>}
|
("loading class " + getClassName(entry));
|
531,363
|
public void synchronizeToLocalDirectory(final File localDirectory, final int maxFetchSize) {<NEW_LINE>if (maxFetchSize == 0) {<NEW_LINE>if (this.logger.isDebugEnabled()) {<NEW_LINE>this.logger.debug("Max Fetch Size is zero - fetch to " + <MASK><NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String remoteDirectory = this.remoteDirectoryExpression.getValue(this.evaluationContext, String.class);<NEW_LINE>if (this.logger.isTraceEnabled()) {<NEW_LINE>this.logger.trace("Synchronizing " + remoteDirectory + " to " + localDirectory);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>int transferred = this.remoteFileTemplate.execute(session -> transferFilesFromRemoteToLocal(remoteDirectory, localDirectory, maxFetchSize, session));<NEW_LINE>if (this.logger.isDebugEnabled()) {<NEW_LINE>this.logger.debug(transferred + " files transferred from '" + remoteDirectory + "'");<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new MessagingException("Problem occurred while synchronizing '" + remoteDirectory + "' to local directory", e);<NEW_LINE>}<NEW_LINE>}
|
localDirectory.getAbsolutePath() + " ignored");
|
1,341,612
|
public List<CheckpointInfo> reachableCheckpoints() throws IOException {<NEW_LINE>var logFile = logFiles.getLogFile();<NEW_LINE>long highestVersion = logFile.getHighestLogVersion();<NEW_LINE>if (highestVersion < 0) {<NEW_LINE>return emptyList();<NEW_LINE>}<NEW_LINE>long lowestVersion = logFile.getLowestLogVersion();<NEW_LINE>long currentVersion = highestVersion;<NEW_LINE>var checkpoints = new ArrayList<CheckpointInfo>();<NEW_LINE>while (currentVersion >= lowestVersion) {<NEW_LINE>try (var channel = logFile.openForVersion(currentVersion);<NEW_LINE>var reader = new ReadAheadLogChannel(channel, <MASK><NEW_LINE>var logEntryCursor = new LogEntryCursor(context.getLogEntryReader(), reader)) {<NEW_LINE>LogHeader logHeader = logFile.extractHeader(currentVersion);<NEW_LINE>var storeId = logHeader.getStoreId();<NEW_LINE>LogPosition lastLocation = reader.getCurrentPosition();<NEW_LINE>while (logEntryCursor.next()) {<NEW_LINE>LogEntry logEntry = logEntryCursor.get();<NEW_LINE>// Collect data about latest checkpoint<NEW_LINE>if (logEntry instanceof LogEntryInlinedCheckPoint) {<NEW_LINE>checkpoints.add(new CheckpointInfo((LogEntryInlinedCheckPoint) logEntry, storeId, lastLocation));<NEW_LINE>}<NEW_LINE>lastLocation = reader.getCurrentPosition();<NEW_LINE>}<NEW_LINE>currentVersion--;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return checkpoints;<NEW_LINE>}
|
NO_MORE_CHANNELS, context.getMemoryTracker());
|
614,752
|
public void deleteFilesUploadSessionsId(String uploadSessionId) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// verify the required parameter 'uploadSessionId' is set<NEW_LINE>if (uploadSessionId == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'uploadSessionId' when calling deleteFilesUploadSessionsId");<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/files/upload_sessions/{upload_session_id}".replaceAll("\\{" + "upload_session_id" + "\\}", apiClient.escapeString(uploadSessionId.toString()));<NEW_LINE>// query params<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] localVarAuthNames = new String[] {};<NEW_LINE>apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, <MASK><NEW_LINE>}
|
localVarAccept, localVarContentType, localVarAuthNames, null);
|
614,155
|
public void writeThermometerChart(JRChart chart) throws IOException {<NEW_LINE>writer.startElement(JRXmlConstants.ELEMENT_thermometerChart, getNamespace());<NEW_LINE>writeChart(chart);<NEW_LINE>writeValueDataset((JRValueDataset) chart.getDataset());<NEW_LINE>// write plot<NEW_LINE>JRThermometerPlot plot = (JRThermometerPlot) chart.getPlot();<NEW_LINE>writer.startElement(JRThermometerPlotFactory.ELEMENT_thermometerPlot, getNamespace());<NEW_LINE>writer.addAttribute(JRThermometerPlotFactory.ATTRIBUTE_valueLocation, plot.getValueLocationValue());<NEW_LINE>writer.addAttribute(JRThermometerPlotFactory.ATTRIBUTE_mercuryColor, plot.getMercuryColor());<NEW_LINE>writePlot(chart.getPlot());<NEW_LINE>writeValueDisplay(plot.getValueDisplay());<NEW_LINE>writeDataRange(plot.getDataRange());<NEW_LINE>if (plot.getLowRange() != null) {<NEW_LINE>writer.startElement(JRThermometerPlotFactory.ELEMENT_lowRange);<NEW_LINE>writeDataRange(plot.getLowRange());<NEW_LINE>writer.closeElement();<NEW_LINE>}<NEW_LINE>if (plot.getMediumRange() != null) {<NEW_LINE>writer.startElement(JRThermometerPlotFactory.ELEMENT_mediumRange);<NEW_LINE><MASK><NEW_LINE>writer.closeElement();<NEW_LINE>}<NEW_LINE>if (plot.getHighRange() != null) {<NEW_LINE>writer.startElement(JRThermometerPlotFactory.ELEMENT_highRange);<NEW_LINE>writeDataRange(plot.getHighRange());<NEW_LINE>writer.closeElement();<NEW_LINE>}<NEW_LINE>writer.closeElement();<NEW_LINE>writer.closeElement();<NEW_LINE>}
|
writeDataRange(plot.getMediumRange());
|
85,507
|
private List<AnnotationEntry> constructOverrideAnnotationEntryFromProperties(Map<String, Object> schemaProperties, AnnotationEntry.AnnotationType annotationType, ArrayDeque<String> pathToAnnotatedTarget, Object annotatedTarget, String startSchemaName) {<NEW_LINE>Object properties = schemaProperties.getOrDefault(getAnnotationNamespace(), Collections.emptyMap());<NEW_LINE>if (!(properties instanceof Map)) {<NEW_LINE>getSchemaVisitorTraversalResult().addMessage(pathToAnnotatedTarget, OVERRIDE_PATH_ERROR_MSG_ENTRIES_NOT_IN_MAP);<NEW_LINE>return new ArrayList<>();<NEW_LINE>}<NEW_LINE>Map<String, Object> propertiesMap = (Map<String, Object>) properties;<NEW_LINE>List<AnnotationEntry> annotationEntryToReturn = new ArrayList<>();<NEW_LINE>for (Map.Entry<String, Object> entry : propertiesMap.entrySet()) {<NEW_LINE>if (!PathSpec.validatePathSpecString(entry.getKey())) {<NEW_LINE>getSchemaVisitorTraversalResult().addMessage(pathToAnnotatedTarget, <MASK><NEW_LINE>} else {<NEW_LINE>AnnotationEntry annotationEntry = new AnnotationEntry(entry.getKey(), entry.getValue(), annotationType, pathToAnnotatedTarget, annotatedTarget);<NEW_LINE>// This is override, need to set start schema name for cyclic referencing checking<NEW_LINE>annotationEntry.setStartSchemaName(startSchemaName);<NEW_LINE>annotationEntryToReturn.add(annotationEntry);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return annotationEntryToReturn;<NEW_LINE>}
|
OVERRIDE_PATH_ERROR_MSG_TEMPLATE_MAL_FORMATTED_KEY, entry.getKey());
|
534,440
|
public List<Object> query(EventQuery query) throws IOException {<NEW_LINE>List<Object> list = new ArrayList<>();<NEW_LINE>ModelVO model = modelDal.getModelById(query.getModelId());<NEW_LINE>String entityName = model.getEntityName();<NEW_LINE>String dateField = model.getReferenceDate();<NEW_LINE>Map<String, Object> queryMap = new HashMap<>();<NEW_LINE>queryMap.put("entityId", query.getEntityId());<NEW_LINE>queryMap.put("entityName", entityName);<NEW_LINE>Map<String, Object> filterMap = new HashMap<>();<NEW_LINE><MASK><NEW_LINE>Calendar beginTime = null;<NEW_LINE>Calendar endTime = null;<NEW_LINE>try {<NEW_LINE>beginTime = DateUtils.parse(query.getBeginTime(), "yyyy-MM-dd HH:mm:ss");<NEW_LINE>endTime = DateUtils.parse(query.getEndTime(), "yyyy-MM-dd HH:mm:ss");<NEW_LINE>filterMap.put("beginTime", beginTime.getTimeInMillis());<NEW_LINE>filterMap.put("endTime", endTime.getTimeInMillis());<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error("error time format:{},{}", query.getBeginTime(), query.getEndTime());<NEW_LINE>filterMap = null;<NEW_LINE>}<NEW_LINE>SearchHits hitsRet = searchService.search(model.getGuid().toLowerCase(), queryMap, filterMap, (query.getPageNo() - 1) * query.getPageSize(), query.getPageSize());<NEW_LINE>SearchHit[] hits = hitsRet.getHits();<NEW_LINE>for (SearchHit hit : hits) {<NEW_LINE>String info = hit.getSourceRef().utf8ToString();<NEW_LINE>list.add(JSONObject.parse(info));<NEW_LINE>list.add(info);<NEW_LINE>}<NEW_LINE>return list;<NEW_LINE>}
|
filterMap.put("refDate", dateField);
|
1,523,687
|
public DeleteAppResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DeleteAppResult deleteAppResult = new DeleteAppResult();<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 deleteAppResult;<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("appArn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>deleteAppResult.setAppArn(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 deleteAppResult;<NEW_LINE>}
|
String currentParentElement = context.getCurrentParentElement();
|
1,186,058
|
public Flux<?> receiveMessagesFromTopic(@PathVariable String name) {<NEW_LINE>DestinationsConfig.DestinationInfo d = destinationsConfig.getTopics().get(name);<NEW_LINE>if (d == null) {<NEW_LINE>return Flux.just(ResponseEntity.<MASK><NEW_LINE>}<NEW_LINE>Queue topicQueue = createTopicQueue(d);<NEW_LINE>String qname = topicQueue.getName();<NEW_LINE>MessageListenerContainer mlc = messageListenerContainerFactory.createMessageListenerContainer(qname);<NEW_LINE>Flux<String> f = Flux.<String>create(emitter -> {<NEW_LINE>log.info("[I168] Adding listener, queue={}", qname);<NEW_LINE>mlc.setupMessageListener((MessageListener) m -> {<NEW_LINE>log.info("[I137] Message received, queue={}", qname);<NEW_LINE>if (emitter.isCancelled()) {<NEW_LINE>log.info("[I166] cancelled, queue={}", qname);<NEW_LINE>mlc.stop();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String payload = new String(m.getBody());<NEW_LINE>emitter.next(payload);<NEW_LINE>log.info("[I176] Message sent to client, queue={}", qname);<NEW_LINE>});<NEW_LINE>emitter.onRequest(v -> {<NEW_LINE>log.info("[I171] Starting container, queue={}", qname);<NEW_LINE>mlc.start();<NEW_LINE>});<NEW_LINE>emitter.onDispose(() -> {<NEW_LINE>log.info("[I176] onDispose: queue={}", qname);<NEW_LINE>amqpAdmin.deleteQueue(qname);<NEW_LINE>mlc.stop();<NEW_LINE>});<NEW_LINE>log.info("[I171] Container started, queue={}", qname);<NEW_LINE>});<NEW_LINE>return Flux.interval(Duration.ofSeconds(5)).map(v -> {<NEW_LINE>log.info("[I209] sending keepalive message...");<NEW_LINE>return "No news is good news";<NEW_LINE>}).mergeWith(f);<NEW_LINE>}
|
notFound().build());
|
1,456,157
|
/*<NEW_LINE>* (non-Javadoc)<NEW_LINE>*<NEW_LINE>* @see org.apache.cxf.interceptor.Interceptor#handleMessage(org.apache.cxf.message.Message)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public void handleMessage(Message message) {<NEW_LINE>handlersList = getHanderList(busType, flow);<NEW_LINE>if (handlersList == null || handlersList.size() == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ArrayList<Handler> excutedHandlers = new ArrayList<Handler>();<NEW_LINE>JAXRS20MessageContextImpl jaxrsMessageContext = new JAXRS20MessageContextImpl(message);<NEW_LINE>jaxrsMessageContext.isServerSide = busType.equals(Type.SERVER);<NEW_LINE>jaxrsMessageContext.isClientSide = busType.equals(Type.CLIENT);<NEW_LINE>jaxrsMessageContext.setProperty(HandlerConstants.<MASK><NEW_LINE>try {<NEW_LINE>Iterator<Handler> it = handlersList.iterator();<NEW_LINE>while (it.hasNext()) {<NEW_LINE>Handler handler = it.next();<NEW_LINE>handler.handleMessage(jaxrsMessageContext);<NEW_LINE>excutedHandlers.add(handler);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>for (int i = excutedHandlers.size() - 1; i >= 0; i--) {<NEW_LINE>excutedHandlers.get(i).handleFault(jaxrsMessageContext);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
FLOW_TYPE, flow.toUpperCase());
|
1,672,173
|
private void saveStoredConfig() {<NEW_LINE>if (this.paired) {<NEW_LINE>File cfgFile = new File(generateConfigFilename());<NEW_LINE>File cfgDir = new File(getUserPersistenceDataFolder());<NEW_LINE>if (!cfgFile.exists()) {<NEW_LINE>try {<NEW_LINE>if (!cfgDir.exists()) {<NEW_LINE>cfgDir.mkdirs();<NEW_LINE>}<NEW_LINE>cfgFile.createNewFile();<NEW_LINE>} catch (IOException e) {<NEW_LINE>logger.warn("Unable to create new properties file for " + this.getDeviceType() + " " + this.getSerialNumber() + <MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Properties propertiesFile = new Properties();<NEW_LINE>propertiesFile.setProperty("devAddr", this.devAddr);<NEW_LINE>try {<NEW_LINE>FileOutputStream foStream = new FileOutputStream(cfgFile);<NEW_LINE>Date updateTime = new Date();<NEW_LINE>propertiesFile.store(foStream, "Autogenerated by MaxCul binding on " + updateTime.toString());<NEW_LINE>this.paired = true;<NEW_LINE>foStream.close();<NEW_LINE>} catch (IOException e) {<NEW_LINE>logger.warn("Unable to load information for " + this.getDeviceType() + " " + this.getSerialNumber() + " it may not yet be paired. Error was " + e.getMessage());<NEW_LINE>this.paired = false;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>logger.debug("Successfully wrote pairing info for " + this.getSerialNumber());<NEW_LINE>} else {<NEW_LINE>logger.error("Tried saving configuration for " + this.getSerialNumber() + " which is not paired.");<NEW_LINE>}<NEW_LINE>}
|
". Data won't be saved so pairing will be lost. Error was " + e.getMessage());
|
1,071,461
|
public app.freerouting.geometry.planar.Shape transform_to_board(CoordinateTransform p_coordinate_transform) {<NEW_LINE>FloatPoint[] corner_arr = new FloatPoint[this.coordinate_arr.length / 2];<NEW_LINE>double[] curr_point = new double[2];<NEW_LINE>for (int i = 0; i < corner_arr.length; ++i) {<NEW_LINE>curr_point[0] = this.coordinate_arr[2 * i];<NEW_LINE>curr_point[1] = this.coordinate_arr[2 * i + 1];<NEW_LINE>corner_arr[i] = p_coordinate_transform.dsn_to_board(curr_point);<NEW_LINE>}<NEW_LINE>double offset = p_coordinate_transform.dsn_to_board(this.width) / 2;<NEW_LINE>if (corner_arr.length <= 2) {<NEW_LINE>IntOctagon bounding_oct = FloatPoint.bounding_octagon(corner_arr);<NEW_LINE>return bounding_oct.enlarge(offset);<NEW_LINE>}<NEW_LINE>IntPoint[] rounded_corner_arr <MASK><NEW_LINE>for (int i = 0; i < corner_arr.length; ++i) {<NEW_LINE>rounded_corner_arr[i] = corner_arr[i].round();<NEW_LINE>}<NEW_LINE>app.freerouting.geometry.planar.Shape result = new app.freerouting.geometry.planar.PolygonShape(rounded_corner_arr);<NEW_LINE>if (offset > 0) {<NEW_LINE>result = result.bounding_tile().enlarge(offset);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
|
= new IntPoint[corner_arr.length];
|
1,190,060
|
public void replaceTokens(int[] tokens, int start, int end) {<NEW_LINE>if (!this.record)<NEW_LINE>return;<NEW_LINE>tokens = filterTokens(tokens);<NEW_LINE>if (tokens.length == 0)<NEW_LINE>return;<NEW_LINE>this.data.replacedTokensPtr++;<NEW_LINE>if (this.data.replacedTokensStart == null) {<NEW_LINE>this.data.replacedTokens = new int[10][];<NEW_LINE>this.data.replacedTokensStart = new int[10];<NEW_LINE>this.data.replacedTokensEnd = new int[10];<NEW_LINE>this.data.replacedTokenUsed = new boolean[10];<NEW_LINE>} else if (this.data.replacedTokensStart.length == this.data.replacedTokensPtr) {<NEW_LINE>int length = this.data.replacedTokensStart.length;<NEW_LINE>System.arraycopy(this.data.replacedTokens, 0, this.data.replacedTokens = new int[length * 2][], 0, length);<NEW_LINE>System.arraycopy(this.data.replacedTokensStart, 0, this.data.replacedTokensStart = new int[length * 2], 0, length);<NEW_LINE>System.arraycopy(this.data.replacedTokensEnd, 0, this.data.replacedTokensEnd = new int[length * 2], 0, length);<NEW_LINE>System.arraycopy(this.data.replacedTokenUsed, 0, this.data.replacedTokenUsed = new boolean[length * 2], 0, length);<NEW_LINE>}<NEW_LINE>this.data.replacedTokens[this.data.replacedTokensPtr] = reverse(tokens);<NEW_LINE>this.data.replacedTokensStart[<MASK><NEW_LINE>this.data.replacedTokensEnd[this.data.replacedTokensPtr] = end;<NEW_LINE>this.data.replacedTokenUsed[this.data.replacedTokensPtr] = false;<NEW_LINE>}
|
this.data.replacedTokensPtr] = start;
|
959,111
|
private ObjectMetadata toObjectMetadata(ObjectMetadata metadata) {<NEW_LINE>// If we generated a symmetric key to encrypt the data, store it in the<NEW_LINE>// object metadata.<NEW_LINE>final byte[] encryptedCEK = getEncryptedCEK();<NEW_LINE>metadata.addUserMetadata(Headers.CRYPTO_KEY_V2, Base64.encodeAsString(encryptedCEK));<NEW_LINE>// Put the cipher initialization vector (IV) into the object metadata<NEW_LINE>final byte[] iv = cipherLite.getIV();<NEW_LINE>metadata.addUserMetadata(Headers.CRYPTO_IV<MASK><NEW_LINE>// Put the materials description into the object metadata as JSON<NEW_LINE>metadata.addUserMetadata(Headers.MATERIALS_DESCRIPTION, kekMaterialDescAsJson());<NEW_LINE>// The CRYPTO_CEK_ALGORITHM, CRYPTO_TAG_LENGTH and<NEW_LINE>// CRYPTO_KEYWRAP_ALGORITHM were not available in the Encryption Only<NEW_LINE>// (EO) implementation<NEW_LINE>final ContentCryptoScheme scheme = getContentCryptoScheme();<NEW_LINE>metadata.addUserMetadata(Headers.CRYPTO_CEK_ALGORITHM, scheme.getCipherAlgorithm());<NEW_LINE>final int tagLen = scheme.getTagLengthInBits();<NEW_LINE>if (tagLen > 0) {<NEW_LINE>metadata.addUserMetadata(Headers.CRYPTO_TAG_LENGTH, String.valueOf(tagLen));<NEW_LINE>}<NEW_LINE>final String keyWrapAlgo = getKeyWrappingAlgorithm();<NEW_LINE>if (keyWrapAlgo != null) {<NEW_LINE>metadata.addUserMetadata(Headers.CRYPTO_KEYWRAP_ALGORITHM, keyWrapAlgo);<NEW_LINE>}<NEW_LINE>return metadata;<NEW_LINE>}
|
, Base64.encodeAsString(iv));
|
1,025,650
|
public Response<Void> deleteByIdWithResponse(String id, Context context) {<NEW_LINE>String resourceGroup = Utils.getValueFromIdByName(id, "resourceGroups");<NEW_LINE>if (resourceGroup == 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 registrationName = Utils.getValueFromIdByName(id, "registrations");<NEW_LINE>if (registrationName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.<MASK><NEW_LINE>}<NEW_LINE>String customerSubscriptionName = Utils.getValueFromIdByName(id, "customerSubscriptions");<NEW_LINE>if (customerSubscriptionName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'customerSubscriptions'.", id)));<NEW_LINE>}<NEW_LINE>return this.deleteWithResponse(resourceGroup, registrationName, customerSubscriptionName, context);<NEW_LINE>}
|
format("The resource ID '%s' is not valid. Missing path segment 'registrations'.", id)));
|
1,298,290
|
public void marshall(BGPPeer bGPPeer, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (bGPPeer == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(bGPPeer.getBgpPeerId(), BGPPEERID_BINDING);<NEW_LINE>protocolMarshaller.marshall(bGPPeer.getAsn(), ASN_BINDING);<NEW_LINE>protocolMarshaller.marshall(bGPPeer.getAuthKey(), AUTHKEY_BINDING);<NEW_LINE>protocolMarshaller.marshall(bGPPeer.getAddressFamily(), ADDRESSFAMILY_BINDING);<NEW_LINE>protocolMarshaller.marshall(bGPPeer.getAmazonAddress(), AMAZONADDRESS_BINDING);<NEW_LINE>protocolMarshaller.marshall(bGPPeer.getCustomerAddress(), CUSTOMERADDRESS_BINDING);<NEW_LINE>protocolMarshaller.marshall(bGPPeer.getBgpPeerState(), BGPPEERSTATE_BINDING);<NEW_LINE>protocolMarshaller.marshall(bGPPeer.getBgpStatus(), BGPSTATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(bGPPeer.getAwsDeviceV2(), AWSDEVICEV2_BINDING);<NEW_LINE>protocolMarshaller.marshall(bGPPeer.getAwsLogicalDeviceId(), AWSLOGICALDEVICEID_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + <MASK><NEW_LINE>}<NEW_LINE>}
|
e.getMessage(), e);
|
1,186,718
|
public static DescribeBackupSourcesResponse unmarshall(DescribeBackupSourcesResponse describeBackupSourcesResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeBackupSourcesResponse.setRequestId<MASK><NEW_LINE>describeBackupSourcesResponse.setSuccess(_ctx.booleanValue("DescribeBackupSourcesResponse.Success"));<NEW_LINE>describeBackupSourcesResponse.setCode(_ctx.stringValue("DescribeBackupSourcesResponse.Code"));<NEW_LINE>describeBackupSourcesResponse.setMessage(_ctx.stringValue("DescribeBackupSourcesResponse.Message"));<NEW_LINE>describeBackupSourcesResponse.setTotalCount(_ctx.longValue("DescribeBackupSourcesResponse.TotalCount"));<NEW_LINE>describeBackupSourcesResponse.setPageSize(_ctx.integerValue("DescribeBackupSourcesResponse.PageSize"));<NEW_LINE>describeBackupSourcesResponse.setPageNumber(_ctx.integerValue("DescribeBackupSourcesResponse.PageNumber"));<NEW_LINE>List<BackupSource> backupSources = new ArrayList<BackupSource>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeBackupSourcesResponse.BackupSources.Length"); i++) {<NEW_LINE>BackupSource backupSource = new BackupSource();<NEW_LINE>backupSource.setBackupSourceId(_ctx.stringValue("DescribeBackupSourcesResponse.BackupSources[" + i + "].BackupSourceId"));<NEW_LINE>backupSource.setDescription(_ctx.stringValue("DescribeBackupSourcesResponse.BackupSources[" + i + "].Description"));<NEW_LINE>backupSource.setSourceType(_ctx.stringValue("DescribeBackupSourcesResponse.BackupSources[" + i + "].SourceType"));<NEW_LINE>backupSource.setBackupSourceGroupId(_ctx.stringValue("DescribeBackupSourcesResponse.BackupSources[" + i + "].BackupSourceGroupId"));<NEW_LINE>backupSource.setClusterId(_ctx.stringValue("DescribeBackupSourcesResponse.BackupSources[" + i + "].ClusterId"));<NEW_LINE>backupSource.setDatabaseName(_ctx.stringValue("DescribeBackupSourcesResponse.BackupSources[" + i + "].DatabaseName"));<NEW_LINE>backupSource.setAllDatabase(_ctx.booleanValue("DescribeBackupSourcesResponse.BackupSources[" + i + "].AllDatabase"));<NEW_LINE>backupSource.setCreatedTime(_ctx.longValue("DescribeBackupSourcesResponse.BackupSources[" + i + "].CreatedTime"));<NEW_LINE>backupSource.setUpdatedTime(_ctx.longValue("DescribeBackupSourcesResponse.BackupSources[" + i + "].UpdatedTime"));<NEW_LINE>backupSources.add(backupSource);<NEW_LINE>}<NEW_LINE>describeBackupSourcesResponse.setBackupSources(backupSources);<NEW_LINE>return describeBackupSourcesResponse;<NEW_LINE>}
|
(_ctx.stringValue("DescribeBackupSourcesResponse.RequestId"));
|
1,288,159
|
public void initialize(String rootDirName) throws RuntimeException, IOException {<NEW_LINE>String jFluidNativeLibFullName = Platform.getAgentNativeLibFullName(rootDirName, false, null, -1);<NEW_LINE>// NOI18N<NEW_LINE>String jFluidNativeLibDirName = jFluidNativeLibFullName.substring(0<MASK><NEW_LINE>// NOI18N // Needed only for error reporting<NEW_LINE>String checkedPath = "";<NEW_LINE>try {<NEW_LINE>File rootDir = MiscUtils.checkDirForName(checkedPath = rootDirName);<NEW_LINE>MiscUtils.checkDirForName(checkedPath = jFluidNativeLibDirName);<NEW_LINE>MiscUtils.checkFile(new File(checkedPath = jFluidNativeLibFullName), false);<NEW_LINE>jFluidRootDirName = rootDir.getCanonicalPath();<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new IOException("Problem with a required JFluid installation directory or file " + checkedPath, e);<NEW_LINE>}<NEW_LINE>}
|
, jFluidNativeLibFullName.lastIndexOf('/'));
|
82,591
|
public void readFrom(MiniDump dump) throws IOException {<NEW_LINE>dump.coreSeek(getLocation());<NEW_LINE>short processorArchitecture = dump.coreReadShort();<NEW_LINE>short processorLevel = dump.coreReadShort();<NEW_LINE>short processorRevision = dump.coreReadShort();<NEW_LINE>// this probably shouldn't be formatted into a string here but it is the only way that the data is currently used so it simplifies things a bit<NEW_LINE>// we need an updated key of what processorLevel means. It is something like "Pentium 4", for example<NEW_LINE>// we can, however, assume that processorRevision is in the xxyy layout so the bytes can be interpreted<NEW_LINE>byte model = (byte) ((processorRevision >> 8) & 0xFF);<NEW_LINE>byte stepping = (byte) (processorRevision & 0xFF);<NEW_LINE>String procSubtype = "Level " + processorLevel + " Model " + model + " Stepping " + stepping;<NEW_LINE><MASK><NEW_LINE>// skip NumberOfProcessors<NEW_LINE>dump.coreReadByte();<NEW_LINE>// skip ProductType<NEW_LINE>dump.coreReadByte();<NEW_LINE>int majorVersion = dump.coreReadInt();<NEW_LINE>dump.setWindowsMajorVersion(majorVersion);<NEW_LINE>}
|
dump.setProcessorArchitecture(processorArchitecture, procSubtype);
|
534,471
|
public void doAlarm(List<AlarmMessage> alarmMessage) {<NEW_LINE>alarmMessage.forEach(message -> {<NEW_LINE>if (LOGGER.isDebugEnabled()) {<NEW_LINE>LOGGER.debug("Alarm message: {}", message.getAlarmMessage());<NEW_LINE>}<NEW_LINE>AlarmRecord record = new AlarmRecord();<NEW_LINE>record.setScope(message.getScopeId());<NEW_LINE>record.setId0(message.getId0());<NEW_LINE>record.setId1(message.getId1());<NEW_LINE>record.setName(message.getName());<NEW_LINE>record.setAlarmMessage(message.getAlarmMessage());<NEW_LINE>record.<MASK><NEW_LINE>record.setTimeBucket(TimeBucket.getRecordTimeBucket(message.getStartTime()));<NEW_LINE>record.setRuleName(message.getRuleName());<NEW_LINE>Collection<Tag> tags = appendSearchableTags(message.getTags());<NEW_LINE>record.setTags(new ArrayList<>(tags));<NEW_LINE>record.setTagsRawData(gson.toJson(message.getTags()).getBytes(Charsets.UTF_8));<NEW_LINE>record.setTagsInString(Tag.Util.toStringList(new ArrayList<>(tags)));<NEW_LINE>RecordStreamProcessor.getInstance().in(record);<NEW_LINE>});<NEW_LINE>}
|
setStartTime(message.getStartTime());
|
1,337,331
|
private CompletableFuture<Boolean> updateCorpGroupDescription(Urn targetUrn, DescriptionUpdateInput input, QueryContext context) {<NEW_LINE>return CompletableFuture.supplyAsync(() -> {<NEW_LINE>if (!DescriptionUtils.isAuthorizedToUpdateDescription(context, targetUrn)) {<NEW_LINE>throw new AuthorizationException("Unauthorized to perform this action. Please contact your DataHub administrator.");<NEW_LINE>}<NEW_LINE>DescriptionUtils.validateCorpGroupInput(targetUrn, _entityService);<NEW_LINE>try {<NEW_LINE>Urn actor = CorpuserUrn.createFromString(context.getActorUrn());<NEW_LINE>DescriptionUtils.updateCorpGroupDescription(input.getDescription(<MASK><NEW_LINE>return true;<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.error("Failed to perform update against input {}, {}", input.toString(), e.getMessage());<NEW_LINE>throw new RuntimeException(String.format("Failed to perform update against input %s", input.toString()), e);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
|
), targetUrn, actor, _entityService);
|
1,622,575
|
final ListClassificationJobsResult executeListClassificationJobs(ListClassificationJobsRequest listClassificationJobsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listClassificationJobsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListClassificationJobsRequest> request = null;<NEW_LINE>Response<ListClassificationJobsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListClassificationJobsRequestProtocolMarshaller(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, "Macie2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListClassificationJobs");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListClassificationJobsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListClassificationJobsResultJsonUnmarshaller());<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(listClassificationJobsRequest));
|
334,157
|
public Request<ListGroupsRequest> marshall(ListGroupsRequest listGroupsRequest) {<NEW_LINE>if (listGroupsRequest == null) {<NEW_LINE>throw new AmazonClientException("Invalid argument passed to marshall(ListGroupsRequest)");<NEW_LINE>}<NEW_LINE>Request<ListGroupsRequest> request = new DefaultRequest<ListGroupsRequest>(listGroupsRequest, "AmazonCognitoIdentityProvider");<NEW_LINE>String target = "AWSCognitoIdentityProviderService.ListGroups";<NEW_LINE>request.addHeader("X-Amz-Target", target);<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>String uriResourcePath = "/";<NEW_LINE>request.setResourcePath(uriResourcePath);<NEW_LINE>try {<NEW_LINE>StringWriter stringWriter = new StringWriter();<NEW_LINE>AwsJsonWriter jsonWriter = JsonUtils.getJsonWriter(stringWriter);<NEW_LINE>jsonWriter.beginObject();<NEW_LINE>if (listGroupsRequest.getUserPoolId() != null) {<NEW_LINE>String userPoolId = listGroupsRequest.getUserPoolId();<NEW_LINE>jsonWriter.name("UserPoolId");<NEW_LINE>jsonWriter.value(userPoolId);<NEW_LINE>}<NEW_LINE>if (listGroupsRequest.getLimit() != null) {<NEW_LINE>Integer limit = listGroupsRequest.getLimit();<NEW_LINE>jsonWriter.name("Limit");<NEW_LINE>jsonWriter.value(limit);<NEW_LINE>}<NEW_LINE>if (listGroupsRequest.getNextToken() != null) {<NEW_LINE>String nextToken = listGroupsRequest.getNextToken();<NEW_LINE>jsonWriter.name("NextToken");<NEW_LINE>jsonWriter.value(nextToken);<NEW_LINE>}<NEW_LINE>jsonWriter.endObject();<NEW_LINE>jsonWriter.close();<NEW_LINE>String snippet = stringWriter.toString();<NEW_LINE>byte[] content = snippet.getBytes(UTF8);<NEW_LINE>request.setContent(new StringInputStream(snippet));<NEW_LINE>request.addHeader("Content-Length", Integer.toString(content.length));<NEW_LINE>} catch (Throwable t) {<NEW_LINE>throw new AmazonClientException("Unable to marshall request to JSON: " + <MASK><NEW_LINE>}<NEW_LINE>if (!request.getHeaders().containsKey("Content-Type")) {<NEW_LINE>request.addHeader("Content-Type", "application/x-amz-json-1.1");<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
|
t.getMessage(), t);
|
232,004
|
public void initComponents() {<NEW_LINE>jPanel = new JPanel();<NEW_LINE>jScrollPane1 = new JScrollPane(jPanel);<NEW_LINE>jScrollPane1.getViewport().setBackground(new Color(0, 0, 0, 0));<NEW_LINE>hand = new mage.client.cards.Cards(true, jScrollPane1);<NEW_LINE>hand.setCardDimension(GUISizeHelper.handCardDimension);<NEW_LINE>// centers hand<NEW_LINE>jPanel.setLayout(new GridBagLayout());<NEW_LINE>jPanel.setBackground(new Color(0, 0, 0, 0));<NEW_LINE>jPanel.add(hand);<NEW_LINE>setOpaque(false);<NEW_LINE>jPanel.setOpaque(false);<NEW_LINE>jScrollPane1.setOpaque(false);<NEW_LINE>jPanel.setBorder(EMPTY_BORDER);<NEW_LINE>jScrollPane1.setBorder(EMPTY_BORDER);<NEW_LINE>jScrollPane1.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_NEVER);<NEW_LINE>jScrollPane1.getHorizontalScrollBar().setUnitIncrement(8);<NEW_LINE>jScrollPane1.setViewportBorder(EMPTY_BORDER);<NEW_LINE>setLayout(new BorderLayout());<NEW_LINE>add(jScrollPane1, BorderLayout.CENTER);<NEW_LINE>hand.setHScrollSpeed(8);<NEW_LINE>hand.setBackgroundColor(new Color(0, 0, 0, 0));<NEW_LINE>hand.setVisibleIfEmpty(false);<NEW_LINE>hand.setBorder(EMPTY_BORDER);<NEW_LINE><MASK><NEW_LINE>}
|
hand.setZone(Zone.HAND);
|
1,269,565
|
private void deleteNode(final Entity entity, final String c, final boolean closeChangeSet) {<NEW_LINE>final boolean isLocalEdit = openstreetmapUtil instanceof OpenstreetmapLocalUtil;<NEW_LINE>commitEntity(Action.DELETE, entity, openstreetmapUtil.getEntityInfo(entity.getId()), c, closeChangeSet, result -> {<NEW_LINE>if (result != null) {<NEW_LINE>OsmEditingPlugin plugin = OsmandPlugin.getPlugin(OsmEditingPlugin.class);<NEW_LINE>if (plugin != null && isLocalEdit) {<NEW_LINE>List<OpenstreetmapPoint> points = plugin.getDBPOI().getOpenstreetmapPoints();<NEW_LINE>if (activity instanceof MapActivity && points.size() > 0) {<NEW_LINE>OsmPoint point = points.get(points.size() - 1);<NEW_LINE>MapActivity mapActivity = (MapActivity) activity;<NEW_LINE>mapActivity.getContextMenu().showOrUpdate(new LatLon(point.getLatitude(), point.getLongitude()), plugin.getOsmEditsLayer(mapActivity).getObjectName(point), point);<NEW_LINE>mapActivity.getMapLayers().getContextMenuLayer().updateContextMenu();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>Toast.makeText(activity, R.string.poi_remove_success, Toast.LENGTH_LONG).show();<NEW_LINE>}<NEW_LINE>if (activity instanceof MapActivity) {<NEW_LINE>((MapActivity) activity).<MASK><NEW_LINE>}<NEW_LINE>if (callback != null) {<NEW_LINE>callback.poiDeleted();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}, activity, openstreetmapUtil, null);<NEW_LINE>}
|
getMapView().refreshMap(true);
|
318,302
|
public void configure(final LifecycleEnvironment lifecycle, final ServletEnvironment servlets, final JerseyEnvironment jersey, final HealthEnvironment health, final ObjectMapper mapper, final String name) {<NEW_LINE>if (!isEnabled()) {<NEW_LINE>LOGGER.info("Health check configuration is disabled.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final MetricRegistry metrics = lifecycle.getMetricRegistry();<NEW_LINE>final <MASK><NEW_LINE>final String fullName = DEFAULT_BASE_NAME + "-" + name;<NEW_LINE>final List<HealthCheckConfiguration> healthCheckConfigs = getHealthCheckConfigurations();<NEW_LINE>// setup schedules for configured health checks<NEW_LINE>final ScheduledExecutorService scheduledHealthCheckExecutor = createScheduledExecutorForHealthChecks(healthCheckConfigs.size(), metrics, lifecycle, fullName);<NEW_LINE>final HealthCheckScheduler scheduler = new HealthCheckScheduler(scheduledHealthCheckExecutor);<NEW_LINE>// configure health manager to receive registered health state listeners from HealthEnvironment (via reference)<NEW_LINE>final HealthCheckManager healthCheckManager = new HealthCheckManager(healthCheckConfigs, scheduler, metrics, shutdownWaitPeriod, initialOverallState, health.healthStateListeners());<NEW_LINE>healthCheckManager.initializeAppHealth();<NEW_LINE>// setup response provider and responder to respond to health check requests<NEW_LINE>final HealthResponseProvider responseProvider = healthResponseProviderFactory.build(healthCheckManager, healthCheckManager, mapper);<NEW_LINE>healthResponderFactory.configure(fullName, healthCheckUrlPaths, responseProvider, health, jersey, servlets, mapper);<NEW_LINE>// register listener for HealthCheckRegistry and setup validator to ensure correct config<NEW_LINE>envHealthChecks.addListener(healthCheckManager);<NEW_LINE>lifecycle.manage(new HealthCheckConfigValidator(healthCheckConfigs, envHealthChecks));<NEW_LINE>// register shutdown handler with Jetty<NEW_LINE>final Duration shutdownDelay = getShutdownWaitPeriod();<NEW_LINE>if (isDelayedShutdownHandlerEnabled() && shutdownDelay.toMilliseconds() > 0) {<NEW_LINE>final DelayedShutdownHandler shutdownHandler = new DelayedShutdownHandler(healthCheckManager);<NEW_LINE>shutdownHandler.register();<NEW_LINE>LOGGER.debug("Set up delayed shutdown with delay: {}", shutdownDelay);<NEW_LINE>}<NEW_LINE>// Set the health state aggregator on the HealthEnvironment<NEW_LINE>health.setHealthStateAggregator(healthCheckManager);<NEW_LINE>LOGGER.debug("Configured ongoing health check monitoring for healthChecks: {}", getHealthChecks());<NEW_LINE>}
|
HealthCheckRegistry envHealthChecks = health.healthChecks();
|
1,521,160
|
public static String build(Task task, List<File> inputs) {<NEW_LINE>List<SourceFile> externs;<NEW_LINE>try {<NEW_LINE>externs = CommandLineRunner.getDefaultExterns();<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new BuildException(e);<NEW_LINE>}<NEW_LINE>List<SourceFile> jsInputs <MASK><NEW_LINE>for (File f : inputs) {<NEW_LINE>jsInputs.add(SourceFile.fromFile(f));<NEW_LINE>}<NEW_LINE>CompilerOptions options = new CompilerOptions();<NEW_LINE>CompilationLevel.ADVANCED_OPTIMIZATIONS.setOptionsForCompilationLevel(options);<NEW_LINE>WarningLevel.VERBOSE.setOptionsForWarningLevel(options);<NEW_LINE>for (DiagnosticGroup dg : diagnosticGroups) {<NEW_LINE>options.setWarningLevel(dg, CheckLevel.ERROR);<NEW_LINE>}<NEW_LINE>options.setCodingConvention(new GoogleCodingConvention());<NEW_LINE>Compiler compiler = new Compiler();<NEW_LINE>MessageFormatter formatter = options.errorFormat.toFormatter(compiler, false);<NEW_LINE>AntErrorManager errorManager = new AntErrorManager(formatter, task);<NEW_LINE>compiler.setErrorManager(errorManager);<NEW_LINE>Result r = compiler.compile(externs, jsInputs, options);<NEW_LINE>if (!r.success) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>String wrapped = "(function(){" + compiler.toSource() + "})();\n";<NEW_LINE>return wrapped;<NEW_LINE>}
|
= new ArrayList<SourceFile>();
|
1,544,962
|
public static void registerType(ModelBuilder modelBuilder) {<NEW_LINE>ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(Stage.class, CMMN_ELEMENT_STAGE).namespaceUri(CMMN11_NS).extendsType(PlanFragment.class).instanceProvider(new ModelTypeInstanceProvider<Stage>() {<NEW_LINE><NEW_LINE>public Stage newInstance(ModelTypeInstanceContext instanceContext) {<NEW_LINE>return new StageImpl(instanceContext);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>autoCompleteAttribute = typeBuilder.booleanAttribute(CMMN_ATTRIBUTE_AUTO_COMPLETE).defaultValue(false).build();<NEW_LINE>exitCriteriaRefCollection = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_EXIT_CRITERIA_REFS).namespace(CMMN10_NS).idAttributeReferenceCollection(Sentry.class, CmmnAttributeElementReferenceCollection.class).build();<NEW_LINE><MASK><NEW_LINE>planningTableChild = sequenceBuilder.element(PlanningTable.class).build();<NEW_LINE>planItemDefinitionCollection = sequenceBuilder.elementCollection(PlanItemDefinition.class).build();<NEW_LINE>exitCriterionCollection = sequenceBuilder.elementCollection(ExitCriterion.class).build();<NEW_LINE>typeBuilder.build();<NEW_LINE>}
|
SequenceBuilder sequenceBuilder = typeBuilder.sequence();
|
174,392
|
private void onDetectionTaskSuccess(List<DetectedObject> results) {<NEW_LINE>graphicOverlay.clear();<NEW_LINE>if (needUpdateGraphicOverlayImageSourceInfo) {<NEW_LINE>Size size = cameraXSource.getPreviewSize();<NEW_LINE>if (size != null) {<NEW_LINE>Log.d(TAG, "preview width: " + size.getWidth());<NEW_LINE>Log.d(TAG, "preview height: " + size.getHeight());<NEW_LINE>boolean isImageFlipped = cameraXSource.getCameraFacing() == CameraSourceConfig.CAMERA_FACING_FRONT;<NEW_LINE>if (isPortraitMode()) {<NEW_LINE>// Swap width and height sizes when in portrait, since it will be rotated by<NEW_LINE>// 90 degrees. The camera preview and the image being processed have the same size.<NEW_LINE>graphicOverlay.setImageSourceInfo(size.getHeight(), size.getWidth(), isImageFlipped);<NEW_LINE>} else {<NEW_LINE>graphicOverlay.setImageSourceInfo(size.getWidth(), size.getHeight(), isImageFlipped);<NEW_LINE>}<NEW_LINE>needUpdateGraphicOverlayImageSourceInfo = false;<NEW_LINE>} else {<NEW_LINE>Log.d(TAG, "previewsize is null");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Log.v(TAG, "Number of object been detected: " + results.size());<NEW_LINE>for (DetectedObject object : results) {<NEW_LINE>graphicOverlay.add(<MASK><NEW_LINE>}<NEW_LINE>graphicOverlay.add(new InferenceInfoGraphic(graphicOverlay));<NEW_LINE>graphicOverlay.postInvalidate();<NEW_LINE>}
|
new ObjectGraphic(graphicOverlay, object));
|
805,856
|
public void cleanUpState(VirtualConnection vc) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {<NEW_LINE>Tr.entry(tc, "cleanUpState");<NEW_LINE>}<NEW_LINE>// Remove the discriminator state from the state map.<NEW_LINE>SSLDiscriminatorState discState = (SSLDiscriminatorState) vc.getStateMap().remove(SSL_DISCRIMINATOR_STATE);<NEW_LINE>// PK13349 - close the discrimination engine<NEW_LINE>closeEngine(discState.getEngine());<NEW_LINE>WsByteBuffer decryptedNetBuffer = discState.getDecryptedNetBuffer();<NEW_LINE>// Release the decrypted network buffer back to the pool. This shouldn't<NEW_LINE>// ever be null, but check anyhow.<NEW_LINE>if (decryptedNetBuffer != null) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>decryptedNetBuffer.release();<NEW_LINE>decryptedNetBuffer = null;<NEW_LINE>}<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {<NEW_LINE>Tr.exit(tc, "cleanUpState");<NEW_LINE>}<NEW_LINE>}
|
Tr.event(tc, "Releasing decryptedNetworkBuffer");
|
992,404
|
public ProvisionedBandwidth unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>ProvisionedBandwidth provisionedBandwidth = new ProvisionedBandwidth();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 1;<NEW_LINE>while (true) {<NEW_LINE>int xmlEvent = context.nextEvent();<NEW_LINE>if (xmlEvent == XmlPullParser.END_DOCUMENT)<NEW_LINE>return provisionedBandwidth;<NEW_LINE>if (xmlEvent == XmlPullParser.START_TAG) {<NEW_LINE>if (context.testExpression("provisioned", targetDepth)) {<NEW_LINE>provisionedBandwidth.setProvisioned(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("requested", targetDepth)) {<NEW_LINE>provisionedBandwidth.setRequested(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("requestTime", targetDepth)) {<NEW_LINE>provisionedBandwidth.setRequestTime(DateStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("provisionTime", targetDepth)) {<NEW_LINE>provisionedBandwidth.setProvisionTime(DateStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("status", targetDepth)) {<NEW_LINE>provisionedBandwidth.setStatus(StringStaxUnmarshaller.getInstance<MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent == XmlPullParser.END_TAG) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return provisionedBandwidth;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
().unmarshall(context));
|
1,315,688
|
public void consume(List<Datum> records) {<NEW_LINE>List<DatumWithNorm> toClassify = new ArrayList<>();<NEW_LINE>double[] scores = new double[records.size()];<NEW_LINE>for (int i = 0; i < records.size(); i++) {<NEW_LINE>Datum d = records.get(i);<NEW_LINE>DatumWithNorm dwn = new DatumWithNorm(d);<NEW_LINE>toClassify.add(dwn);<NEW_LINE>scores[i] = dwn.getNorm();<NEW_LINE>}<NEW_LINE>Percentile pCalc = new Percentile().withNaNStrategy(NaNStrategy.MAXIMAL);<NEW_LINE>pCalc.setData(scores);<NEW_LINE>double cutoff = pCalc.evaluate(scores, targetPercentile * 100);<NEW_LINE>log.<MASK><NEW_LINE>log.debug("Median: {}", pCalc.evaluate(50));<NEW_LINE>log.debug("Max: {}", pCalc.evaluate(100));<NEW_LINE>for (DatumWithNorm dwn : toClassify) {<NEW_LINE>results.add(new OutlierClassificationResult(dwn.getDatum(), dwn.getNorm() >= cutoff || dwn.getNorm().isInfinite()));<NEW_LINE>}<NEW_LINE>}
|
debug("{} Percentile Cutoff: {}", targetPercentile, cutoff);
|
525,621
|
public void marshall(Firewall firewall, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (firewall == 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(firewall.getFirewallArn(), FIREWALLARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(firewall.getFirewallPolicyArn(), FIREWALLPOLICYARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(firewall.getVpcId(), VPCID_BINDING);<NEW_LINE>protocolMarshaller.marshall(firewall.getSubnetMappings(), SUBNETMAPPINGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(firewall.getDeleteProtection(), DELETEPROTECTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(firewall.getSubnetChangeProtection(), SUBNETCHANGEPROTECTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(firewall.getFirewallPolicyChangeProtection(), FIREWALLPOLICYCHANGEPROTECTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(firewall.getDescription(), DESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(firewall.getFirewallId(), FIREWALLID_BINDING);<NEW_LINE>protocolMarshaller.marshall(firewall.getTags(), TAGS_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
|
firewall.getFirewallName(), FIREWALLNAME_BINDING);
|
816,532
|
private void handle(APIAddLdapServerMsg msg) {<NEW_LINE>APIAddLdapServerEvent evt = new APIAddLdapServerEvent(msg.getId());<NEW_LINE>if (Q.New(LdapServerVO.class).eq(LdapServerVO_.scope, msg.getScope()).count() == 1) {<NEW_LINE>evt.setError(err(LdapErrors.MORE_THAN_ONE_LDAP_SERVER, "There has been a LDAP/AD server record. " + "You'd better remove it before adding a new one!"));<NEW_LINE>bus.publish(evt);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>LdapServerVO ldapServerVO = new LdapServerVO();<NEW_LINE>ldapServerVO.setUuid(Platform.getUuid());<NEW_LINE>ldapServerVO.setName(msg.getName());<NEW_LINE>ldapServerVO.setDescription(msg.getDescription());<NEW_LINE>ldapServerVO.setUrl(msg.getUrl());<NEW_LINE>ldapServerVO.<MASK><NEW_LINE>ldapServerVO.setUsername(msg.getUsername());<NEW_LINE>ldapServerVO.setPassword(msg.getPassword());<NEW_LINE>ldapServerVO.setEncryption(msg.getEncryption());<NEW_LINE>ldapServerVO.setScope(msg.getScope());<NEW_LINE>ldapServerVO = dbf.persistAndRefresh(ldapServerVO);<NEW_LINE>LdapServerInventory inv = LdapServerInventory.valueOf(ldapServerVO);<NEW_LINE>evt.setInventory(inv);<NEW_LINE>this.saveLdapCleanBindingFilterTag(msg.getSystemTags(), ldapServerVO.getUuid());<NEW_LINE>this.saveLdapServerTypeTag(msg.getSystemTags(), ldapServerVO.getUuid());<NEW_LINE>this.saveLdapUseAsLoginNameTag(msg.getSystemTags(), ldapServerVO.getUuid());<NEW_LINE>for (AddLdapExtensionPoint ext : pluginRgty.getExtensionList(AddLdapExtensionPoint.class)) {<NEW_LINE>ext.afterAddLdapServer(msg, ldapServerVO.getUuid());<NEW_LINE>}<NEW_LINE>bus.publish(evt);<NEW_LINE>}
|
setBase(msg.getBase());
|
1,618,591
|
public void shutdown() {<NEW_LINE>if (this.started.compareAndSet(true, false) && null != this.deliverExecutorService) {<NEW_LINE>this.deliverExecutorService.shutdown();<NEW_LINE>try {<NEW_LINE>this.deliverExecutorService.awaitTermination(WAIT_FOR_SHUTDOWN, TimeUnit.MILLISECONDS);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>log.error("deliverExecutorService awaitTermination error", e);<NEW_LINE>}<NEW_LINE>if (this.handleExecutorService != null) {<NEW_LINE>this.handleExecutorService.shutdown();<NEW_LINE>try {<NEW_LINE>this.handleExecutorService.<MASK><NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>log.error("handleExecutorService awaitTermination error", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (this.deliverPendingTable != null) {<NEW_LINE>for (int i = 1; i <= this.deliverPendingTable.size(); i++) {<NEW_LINE>log.warn("deliverPendingTable level: {}, size: {}", i, this.deliverPendingTable.get(i).size());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.persist();<NEW_LINE>}<NEW_LINE>}
|
awaitTermination(WAIT_FOR_SHUTDOWN, TimeUnit.MILLISECONDS);
|
1,580,318
|
public void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>Log.i(TAG, "onCreate");<NEW_LINE>setContentView(io.selendroid.testapp.R.layout.verify_user);<NEW_LINE>Bundle extras = getIntent().getExtras();<NEW_LINE>if (extras != null) {<NEW_LINE>User user = (User) extras.getSerializable("user");<NEW_LINE>System.out.println(" the user " + user);<NEW_LINE>setTextOfUiElement(user.getEmail(), io.selendroid.testapp.R.id.label_email_data);<NEW_LINE>setTextOfUiElement(user.getName(), io.selendroid.testapp.R.id.label_name_data);<NEW_LINE>setTextOfUiElement(user.getPassword(), io.selendroid.testapp.R.id.label_password_data);<NEW_LINE>setTextOfUiElement(user.getPreferedProgrammingLanguge(), io.selendroid.<MASK><NEW_LINE>setTextOfUiElement(user.getUsername(), io.selendroid.testapp.R.id.label_username_data);<NEW_LINE>setTextOfUiElement(String.valueOf(user.isAcceptAdds()), io.selendroid.testapp.R.id.label_acceptAdds_data);<NEW_LINE>}<NEW_LINE>}
|
testapp.R.id.label_preferedProgrammingLanguage_data);
|
56,823
|
// searches through morphotactics graph.<NEW_LINE>private List<SearchPath> search(List<SearchPath> currentPaths) {<NEW_LINE>if (currentPaths.size() > 30) {<NEW_LINE>currentPaths = pruneCyclicPaths(currentPaths);<NEW_LINE>}<NEW_LINE>List<SearchPath> result <MASK><NEW_LINE>// new Paths are generated with matching transitions.<NEW_LINE>while (currentPaths.size() > 0) {<NEW_LINE>List<SearchPath> allNewPaths = Lists.newArrayList();<NEW_LINE>for (SearchPath path : currentPaths) {<NEW_LINE>// if there are no more letters to consume and path can be terminated, we accept this<NEW_LINE>// path as a correct result.<NEW_LINE>if (path.tail.length() == 0) {<NEW_LINE>if (path.isTerminal() && !path.containsPhoneticAttribute(PhoneticAttribute.CannotTerminate)) {<NEW_LINE>result.add(path);<NEW_LINE>if (debugMode) {<NEW_LINE>debugData.finishedPaths.add(path);<NEW_LINE>}<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (debugMode) {<NEW_LINE>debugData.failedPaths.put(path, "Finished but Path not terminal");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Creates new paths with outgoing and matching transitions.<NEW_LINE>List<SearchPath> newPaths = advance(path);<NEW_LINE>allNewPaths.addAll(newPaths);<NEW_LINE>if (debugMode) {<NEW_LINE>if (newPaths.isEmpty()) {<NEW_LINE>debugData.failedPaths.put(path, "No Transition");<NEW_LINE>}<NEW_LINE>debugData.paths.addAll(newPaths);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>currentPaths = allNewPaths;<NEW_LINE>}<NEW_LINE>if (debugMode) {<NEW_LINE>debugData.resultPaths.addAll(result);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
|
= new ArrayList<>(3);
|
393,731
|
public static AntProjectHelper createProject(final File dir, final String name, final JavaPlatform platform) throws IOException {<NEW_LINE>// NOI18N<NEW_LINE>Parameters.notNull("dir", dir);<NEW_LINE>// NOI18N<NEW_LINE>Parameters.notNull("name", name);<NEW_LINE>final FileObject dirFO = FileUtil.createFolder(dir);<NEW_LINE>final AntProjectHelper[] h = new AntProjectHelper[1];<NEW_LINE>dirFO.getFileSystem().runAtomicAction(() -> {<NEW_LINE><MASK><NEW_LINE>// NOI18N<NEW_LINE>h[0] = createProject(dirFO, name, sourceLevel, "src", "classes", "tests", platform.getProperties().get(PROP_PLATFORM_ANT_NAME));<NEW_LINE>final J2SEModularProject p = (J2SEModularProject) ProjectManager.getDefault().findProject(dirFO);<NEW_LINE>ProjectManager.getDefault().saveProject(p);<NEW_LINE>try {<NEW_LINE>ProjectManager.mutex().writeAccess((Mutex.ExceptionAction<Void>) () -> {<NEW_LINE>ProjectManager.getDefault().saveProject(p);<NEW_LINE>ProjectUtils.getSources(p).getSourceGroups(JavaProjectConstants.SOURCES_TYPE_MODULES);<NEW_LINE>return null;<NEW_LINE>});<NEW_LINE>} catch (MutexException ex) {<NEW_LINE>Exceptions.printStackTrace(ex.getException());<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>dirFO.createFolder("src");<NEW_LINE>});<NEW_LINE>return h[0];<NEW_LINE>}
|
final SpecificationVersion sourceLevel = getSourceLevel(platform);
|
118,937
|
private void update() {<NEW_LINE>try {<NEW_LINE>entityIRIField.setText("");<NEW_LINE>messageArea.setText("");<NEW_LINE>if (userSuppliedNameField.getText().trim().isEmpty()) {<NEW_LINE>setValid(false);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>OWLEntityCreationSet<?> creationSet = getOWLEntityCreationSet(EntityCreationMode.PREVIEW);<NEW_LINE>if (creationSet == null) {<NEW_LINE>setValid(false);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>String iriString = owlEntity.getIRI().toString();<NEW_LINE>entityIRIField.setText(iriString);<NEW_LINE>setValid(true);<NEW_LINE>} catch (RuntimeException e) {<NEW_LINE>setValid(false);<NEW_LINE>Throwable cause = e.getCause();<NEW_LINE>if (cause != null) {<NEW_LINE>if (cause instanceof OWLOntologyCreationException) {<NEW_LINE>messageArea.setText("Entity already exists");<NEW_LINE>} else {<NEW_LINE>messageArea.setText(cause.getMessage());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>messageArea.setText(e.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
OWLEntity owlEntity = creationSet.getOWLEntity();
|
596,194
|
/* recompute set of visible columns<NEW_LINE>*/<NEW_LINE>private void computeVisiblePorperties(int visCount) {<NEW_LINE>propertyColumns = new int[visCount];<NEW_LINE>TreeMap<Double, Integer> sort = new TreeMap<Double, Integer>();<NEW_LINE>for (int i = 0; i < allPropertyColumns.length; i++) {<NEW_LINE>int vi = allPropertyColumns[i].getVisibleIndex();<NEW_LINE>if (vi == -1) {<NEW_LINE>sort.put(new Double(i - 0.1), Integer.valueOf(i));<NEW_LINE>} else {<NEW_LINE>sort.put(new Double(vi), Integer.valueOf(i));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int j = 0;<NEW_LINE>Iterator<Integer> it = sort<MASK><NEW_LINE>while (it.hasNext()) {<NEW_LINE>int i = it.next().intValue();<NEW_LINE>Property p = allPropertyColumns[i].getProperty();<NEW_LINE>if (isVisible(p)) {<NEW_LINE>propertyColumns[j] = i;<NEW_LINE>allPropertyColumns[i].setVisibleIndex(j);<NEW_LINE>j++;<NEW_LINE>} else {<NEW_LINE>allPropertyColumns[i].setVisibleIndex(-1);<NEW_LINE>Object o = p.getValue(ATTR_SORTING_COLUMN);<NEW_LINE>if ((o != null) && o instanceof Boolean) {<NEW_LINE>if (((Boolean) o).booleanValue()) {<NEW_LINE>p.setValue(ATTR_SORTING_COLUMN, Boolean.FALSE);<NEW_LINE>p.setValue(ATTR_DESCENDING_ORDER, Boolean.FALSE);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>fireTableStructureChanged();<NEW_LINE>}
|
.values().iterator();
|
192,268
|
public static double crossGamma(double forward, double strike, double timeToExpiry, double lognormalVol) {<NEW_LINE>ArgChecker.isTrue(forward >= 0d, "negative/NaN forward; have {}", forward);<NEW_LINE>ArgChecker.isTrue(strike >= 0d, "negative/NaN strike; have {}", strike);<NEW_LINE>ArgChecker.isTrue(timeToExpiry >= 0d, "negative/NaN timeToExpiry; have {}", timeToExpiry);<NEW_LINE>ArgChecker.isTrue(lognormalVol >= 0d, "negative/NaN lognormalVol; have {}", lognormalVol);<NEW_LINE>double sigmaRootT = lognormalVol * Math.sqrt(timeToExpiry);<NEW_LINE>if (Double.isNaN(sigmaRootT)) {<NEW_LINE>log.info("lognormalVol * Math.sqrt(timeToExpiry) ambiguous");<NEW_LINE>sigmaRootT = 1d;<NEW_LINE>}<NEW_LINE>double d2 = 0d;<NEW_LINE>boolean bFwd = (forward > LARGE);<NEW_LINE>boolean bStr = (strike > LARGE);<NEW_LINE>boolean bSigRt = (sigmaRootT > LARGE);<NEW_LINE>if (bSigRt) {<NEW_LINE>return 0d;<NEW_LINE>}<NEW_LINE>if (sigmaRootT < SMALL) {<NEW_LINE>if (Math.abs(forward - strike) >= SMALL && !(bFwd && bStr)) {<NEW_LINE>return 0d;<NEW_LINE>}<NEW_LINE>log.info("(log 1d)/0d ambiguous");<NEW_LINE>return bFwd ? -NORMAL.getPDF(0d) : -NORMAL.getPDF(0d) / forward / sigmaRootT;<NEW_LINE>}<NEW_LINE>if (Math.abs(forward - strike) < SMALL | (bFwd && bStr)) {<NEW_LINE>d2 = -0.5 * sigmaRootT;<NEW_LINE>} else {<NEW_LINE>d2 = Math.log(forward / strike) / sigmaRootT - 0.5 * sigmaRootT;<NEW_LINE>}<NEW_LINE>double <MASK><NEW_LINE>return nVal == 0d ? 0d : -nVal / forward / sigmaRootT;<NEW_LINE>}
|
nVal = NORMAL.getPDF(d2);
|
906,685
|
public static ProtoTxnOpImpl newTxnOp(TxnRequest request) {<NEW_LINE>ProtoTxnOpImpl op = RECYCLER.get();<NEW_LINE>op.setRequest(request);<NEW_LINE>RecyclableArrayList<CompareOp<byte[], byte[]>> compareOps = COMPARE_OPS_RECYCLER.newInstance();<NEW_LINE>for (Compare compare : request.getCompareList()) {<NEW_LINE>compareOps.add(ProtoCompareImpl.newCompareOp(compare));<NEW_LINE>}<NEW_LINE>op.setCompareOps(compareOps);<NEW_LINE>RecyclableArrayList<Op<byte[], byte[]>> successOps = OPS_RECYCLER.newInstance();<NEW_LINE>for (RequestOp reqOp : request.getSuccessList()) {<NEW_LINE>successOps.add(toApiOp(reqOp));<NEW_LINE>}<NEW_LINE>op.setSuccessOps(successOps);<NEW_LINE>RecyclableArrayList<Op<byte[], byte[]><MASK><NEW_LINE>for (RequestOp reqOp : request.getFailureList()) {<NEW_LINE>failureOps.add(toApiOp(reqOp));<NEW_LINE>}<NEW_LINE>return op;<NEW_LINE>}
|
> failureOps = OPS_RECYCLER.newInstance();
|
1,639,015
|
private synchronized void configWriter(String content, Path filePath) {<NEW_LINE>if (Files.exists(filePath) && !Files.isWritable(filePath)) {<NEW_LINE>log.error("Error file is not writable: " + filePath);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (Files.notExists(filePath.getParent())) {<NEW_LINE>try {<NEW_LINE>Files.createDirectories(filePath.getParent());<NEW_LINE>} catch (IOException e) {<NEW_LINE>log.error("Error creating the directory: " + filePath + " message: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Path target = null;<NEW_LINE>if (Files.exists(filePath)) {<NEW_LINE>target = FileSystems.getDefault().getPath(filePath.getParent().toString(), "habridge.config.old." + getCurrentDate());<NEW_LINE>Files.move(filePath, target);<NEW_LINE>}<NEW_LINE>Files.write(filePath, content.getBytes(), StandardOpenOption.CREATE);<NEW_LINE>// set attributes to be for user only<NEW_LINE>// using PosixFilePermission to set file permissions<NEW_LINE>Set<PosixFilePermission> perms = new HashSet<PosixFilePermission>();<NEW_LINE>// add owners permission<NEW_LINE>perms.add(PosixFilePermission.OWNER_READ);<NEW_LINE>perms.add(PosixFilePermission.OWNER_WRITE);<NEW_LINE>try {<NEW_LINE>String osName = System.getProperty("os.name");<NEW_LINE>if (osName.toLowerCase().indexOf("win") < 0)<NEW_LINE>Files.setPosixFilePermissions(filePath, perms);<NEW_LINE>} catch (UnsupportedOperationException e) {<NEW_LINE>log.info("Cannot set permissions for config file on this system as it is not supported. Continuing");<NEW_LINE>}<NEW_LINE>if (target != null)<NEW_LINE>Files.delete(target);<NEW_LINE>} catch (IOException e) {<NEW_LINE>log.error("Error writing the file: " + filePath + " message: " + <MASK><NEW_LINE>}<NEW_LINE>}
|
e.getMessage(), e);
|
1,177,697
|
protected void updateBeforeRender() {<NEW_LINE>super.updateBeforeRender();<NEW_LINE>this.selectCPU.setMessage(getNextCpuButtonLabel());<NEW_LINE>CraftingPlanSummary plan = menu.getPlan();<NEW_LINE>boolean planIsStartable = plan != null && !plan.isSimulation();<NEW_LINE>this.start.active = !this.menu.hasNoCPU() && planIsStartable;<NEW_LINE>this.selectCPU.active = planIsStartable;<NEW_LINE>// Show additional status about the selected CPU and plan when the planning is done<NEW_LINE>Component planDetails <MASK><NEW_LINE>Component cpuDetails = TextComponent.EMPTY;<NEW_LINE>if (plan != null) {<NEW_LINE>String byteUsed = NumberFormat.getInstance().format(plan.getUsedBytes());<NEW_LINE>planDetails = GuiText.BytesUsed.text(byteUsed);<NEW_LINE>if (plan.isSimulation()) {<NEW_LINE>cpuDetails = GuiText.PartialPlan.text();<NEW_LINE>} else if (this.menu.getCpuAvailableBytes() > 0) {<NEW_LINE>cpuDetails = GuiText.ConfirmCraftCpuStatus.text(this.menu.getCpuAvailableBytes(), this.menu.getCpuCoProcessors());<NEW_LINE>} else {<NEW_LINE>cpuDetails = GuiText.ConfirmCraftNoCpu.text();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>setTextContent(TEXT_ID_DIALOG_TITLE, GuiText.CraftingPlan.text(planDetails));<NEW_LINE>setTextContent("cpu_status", cpuDetails);<NEW_LINE>final int size = plan != null ? plan.getEntries().size() : 0;<NEW_LINE>scrollbar.setRange(0, AbstractTableRenderer.getScrollableRows(size), 1);<NEW_LINE>}
|
= GuiText.CalculatingWait.text();
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.