idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
1,257,278
public void visit(BLangXMLQName bLangXMLQName, AnalyzerData data) {<NEW_LINE>String prefix = bLangXMLQName.prefix.value;<NEW_LINE>data.resultType = types.checkType(bLangXMLQName, symTable.stringType, data.expType);<NEW_LINE>// TODO: check isLHS<NEW_LINE>if (data.env.node.getKind() == NodeKind.XML_ATTRIBUTE && prefix.isEmpty() && bLangXMLQName.localname.value.equals(XMLConstants.XMLNS_ATTRIBUTE)) {<NEW_LINE>((BLangXMLAttribute) data.env.node).isNamespaceDeclr = true;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (data.env.node.getKind() == NodeKind.XML_ATTRIBUTE && prefix.equals(XMLConstants.XMLNS_ATTRIBUTE)) {<NEW_LINE>((BLangXMLAttribute) data.env.node).isNamespaceDeclr = true;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (prefix.equals(XMLConstants.XMLNS_ATTRIBUTE)) {<NEW_LINE>dlog.error(bLangXMLQName.pos, DiagnosticErrorCode.INVALID_NAMESPACE_PREFIX, prefix);<NEW_LINE>bLangXMLQName.setBType(symTable.semanticError);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// XML attributes without a namespace prefix does not inherit default namespace<NEW_LINE>// https://www.w3.org/TR/xml-names/#defaulting<NEW_LINE>if (bLangXMLQName.prefix.value.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>BSymbol xmlnsSymbol = symResolver.lookupSymbolInPrefixSpace(data.env, names.fromIdNode(bLangXMLQName.prefix));<NEW_LINE>if (prefix.isEmpty() && xmlnsSymbol == symTable.notFoundSymbol) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!prefix.isEmpty() && xmlnsSymbol == symTable.notFoundSymbol) {<NEW_LINE>logUndefinedSymbolError(bLangXMLQName.pos, prefix);<NEW_LINE>bLangXMLQName.setBType(symTable.semanticError);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (xmlnsSymbol.getKind() == SymbolKind.PACKAGE) {<NEW_LINE>xmlnsSymbol = findXMLNamespaceFromPackageConst(bLangXMLQName.localname.value, bLangXMLQName.prefix.value, (BPackageSymbol) xmlnsSymbol, bLangXMLQName.pos, data);<NEW_LINE>}<NEW_LINE>if (xmlnsSymbol == null || xmlnsSymbol.getKind() != SymbolKind.XMLNS) {<NEW_LINE>data.resultType = symTable.semanticError;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>bLangXMLQName.namespaceURI = bLangXMLQName.nsSymbol.namespaceURI;<NEW_LINE>}
bLangXMLQName.nsSymbol = (BXMLNSSymbol) xmlnsSymbol;
1,368,983
final StartJobResult executeStartJob(StartJobRequest startJobRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(startJobRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<StartJobRequest> request = null;<NEW_LINE>Response<StartJobResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new StartJobRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(startJobRequest));<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, "DataExchange");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "StartJob");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<StartJobResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new StartJobResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
endClientExecution(awsRequestMetrics, request, response);
1,211,430
static TextFormatter prepareFormatter(Spec spec) throws PyException {<NEW_LINE>// Slight differences between format types<NEW_LINE>switch(spec.type) {<NEW_LINE>case Spec.NONE:<NEW_LINE>case 's':<NEW_LINE>// Check for disallowed parts of the specification<NEW_LINE>if (spec.grouping) {<NEW_LINE>throw Formatter.notAllowed("Grouping", "string", spec.type);<NEW_LINE>} else if (Spec.specified(spec.sign)) {<NEW_LINE>throw <MASK><NEW_LINE>} else if (spec.alternate) {<NEW_LINE>throw Formatter.alternateFormNotAllowed("string");<NEW_LINE>} else if (spec.align == '=') {<NEW_LINE>throw Formatter.alignmentNotAllowed('=', "string");<NEW_LINE>}<NEW_LINE>// spec may be incomplete. The defaults are those commonly used for string formats.<NEW_LINE>spec = spec.withDefaults(Spec.STRING);<NEW_LINE>// Get a formatter for the specification<NEW_LINE>return new TextFormatter(spec);<NEW_LINE>default:<NEW_LINE>// The type code was not recognised<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}
Formatter.signNotAllowed("string", '\0');
228,981
public void addToStatistics(NumberVector nv) {<NEW_LINE>final int d = nv.getDimensionality();<NEW_LINE>assert (d == ssd.length);<NEW_LINE>if (n == 0) {<NEW_LINE>for (int i = 0; i < d; i++) {<NEW_LINE>for (int j = 0; j < d; j++) {<NEW_LINE>ssd[i][j] = 0.;<NEW_LINE>}<NEW_LINE>mean[i] = nv.doubleValue(i);<NEW_LINE>}<NEW_LINE>n++;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>double[<MASK><NEW_LINE>double f = 1. / (n + 1.);<NEW_LINE>for (int i = 0; i < d; i++) {<NEW_LINE>double vi = nv.doubleValue(i);<NEW_LINE>double delta = vi - mean[i];<NEW_LINE>nmea[i] = mean[i] + delta * f;<NEW_LINE>for (int j = 0; j <= i; j++) {<NEW_LINE>ssd[i][j] += delta * (nv.doubleValue(j) - nmea[j]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int i = 0; i < d; i++) {<NEW_LINE>for (int j = 0; j < i; j++) {<NEW_LINE>ssd[j][i] = ssd[i][j];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>n++;<NEW_LINE>System.arraycopy(nmea, 0, mean, 0, nmea.length);<NEW_LINE>}
] nmea = new double[d];
1,545,453
private Mono<Response<Void>> validateMoveWithResponseAsync(String resourceGroupName, CsmMoveResourceEnvelope moveResourceEnvelope, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (moveResourceEnvelope == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter moveResourceEnvelope is required and cannot be null."));<NEW_LINE>} else {<NEW_LINE>moveResourceEnvelope.validate();<NEW_LINE>}<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.validateMove(this.client.getEndpoint(), resourceGroupName, this.client.getSubscriptionId(), this.client.getApiVersion(), moveResourceEnvelope, context);<NEW_LINE>}
error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));
1,121,823
public static Object convertStringToPrimitive(String value, Class<?> cls, Annotation[] anns) {<NEW_LINE>Message m = JAXRSUtils.getCurrentMessage();<NEW_LINE>Object obj = createFromParameterHandler(value, cls, cls, anns, m);<NEW_LINE>if (obj != null) {<NEW_LINE>return obj;<NEW_LINE>}<NEW_LINE>if (String.class == cls) {<NEW_LINE>return value;<NEW_LINE>} else if (cls.isPrimitive()) {<NEW_LINE>return PrimitiveUtils.read(value, cls);<NEW_LINE>} else if (cls.isEnum()) {<NEW_LINE>if (m != null && !MessageUtils.getContextualBoolean(m, ENUM_CONVERSION_CASE_SENSITIVE, false)) {<NEW_LINE>obj = invokeValueOf(value.toUpperCase(), cls);<NEW_LINE>}<NEW_LINE>if (obj == null) {<NEW_LINE>try {<NEW_LINE>obj = invokeValueOf(value, cls);<NEW_LINE>} catch (RuntimeException ex) {<NEW_LINE>if (m == null) {<NEW_LINE>obj = invokeValueOf(value.toUpperCase(), cls);<NEW_LINE>} else {<NEW_LINE>throw ex;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return obj;<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>Constructor<?> c = cls.getConstructor(new Class<?>[] { String.class });<NEW_LINE>return c.newInstance(<MASK><NEW_LINE>} catch (Throwable ex) {<NEW_LINE>// try valueOf<NEW_LINE>}<NEW_LINE>return invokeValueOf(value, cls);<NEW_LINE>}<NEW_LINE>}
new Object[] { value });
536,705
private void logAccess(Context ctx, LoginMember member) {<NEW_LINE>StringBuilder sb = new StringBuilder(256);<NEW_LINE>SimpleDateFormat dateFormat = new SimpleDateFormat("[yyyy-MM-dd HH:mm:ss]");<NEW_LINE>HttpServletRequest request = ctx.getHttpServletRequest();<NEW_LINE>String actionUri = ctx<MASK><NEW_LINE>sb.append(dateFormat.format(new Date()));<NEW_LINE>// sb.append(" ").append(member.getLoginName()).append('/').append(member.getLoginId()).append(' ');<NEW_LINE>if (request.getMethod().equalsIgnoreCase("post")) {<NEW_LINE>Enumeration<String> names = request.getParameterNames();<NEW_LINE>boolean hasQuestion = actionUri.indexOf('?') >= 0;<NEW_LINE>sb.append(actionUri);<NEW_LINE>while (names.hasMoreElements()) {<NEW_LINE>String name = names.nextElement();<NEW_LINE>String[] attributes = request.getParameterValues(name);<NEW_LINE>for (String attribute : attributes) {<NEW_LINE>if (attribute.length() > 0) {<NEW_LINE>if (!hasQuestion) {<NEW_LINE>sb.append('?');<NEW_LINE>hasQuestion = true;<NEW_LINE>} else {<NEW_LINE>sb.append('&');<NEW_LINE>}<NEW_LINE>sb.append(name).append('=').append(CodecFunction.urlEncode(attribute));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>sb.append(actionUri);<NEW_LINE>}<NEW_LINE>}
.getRequestContext().getActionUri();
1,783,378
public List<HistoricTaskInstance> findHistoricTaskInstancesAndVariablesByQueryCriteria(HistoricTaskInstanceQueryImpl historicTaskInstanceQuery) {<NEW_LINE>// paging doesn't work for combining task instances and variables<NEW_LINE>// due to an outer join, so doing it in-memory<NEW_LINE>if (historicTaskInstanceQuery.getFirstResult() < 0 || historicTaskInstanceQuery.getMaxResults() <= 0) {<NEW_LINE>return emptyList();<NEW_LINE>}<NEW_LINE>int firstResult = historicTaskInstanceQuery.getFirstResult();<NEW_LINE>int maxResults = historicTaskInstanceQuery.getMaxResults();<NEW_LINE>// setting max results, limit to 20000 results for performance reasons<NEW_LINE>if (historicTaskInstanceQuery.getTaskVariablesLimit() != null) {<NEW_LINE>historicTaskInstanceQuery.setMaxResults(historicTaskInstanceQuery.getTaskVariablesLimit());<NEW_LINE>} else {<NEW_LINE>historicTaskInstanceQuery.setMaxResults(getProcessEngineConfiguration().getHistoricTaskQueryLimit());<NEW_LINE>}<NEW_LINE>historicTaskInstanceQuery.setFirstResult(0);<NEW_LINE>List<HistoricTaskInstance> instanceList = getDbSqlSession().selectListWithRawParameterWithoutFilter("selectHistoricTaskInstancesWithVariablesByQueryCriteria", historicTaskInstanceQuery, historicTaskInstanceQuery.getFirstResult(<MASK><NEW_LINE>if (instanceList != null && !instanceList.isEmpty()) {<NEW_LINE>if (firstResult > 0) {<NEW_LINE>if (firstResult <= instanceList.size()) {<NEW_LINE>int toIndex = firstResult + Math.min(maxResults, instanceList.size() - firstResult);<NEW_LINE>return instanceList.subList(firstResult, toIndex);<NEW_LINE>} else {<NEW_LINE>return emptyList();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>int toIndex = Math.min(maxResults, instanceList.size());<NEW_LINE>return instanceList.subList(0, toIndex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return instanceList;<NEW_LINE>}
), historicTaskInstanceQuery.getMaxResults());
1,561,135
public IRubyObject step(ThreadContext context, IRubyObject[] args, Block block) {<NEW_LINE>if (!block.isGiven()) {<NEW_LINE>IRubyObject[] newArgs = new IRubyObject[3];<NEW_LINE>numExtractStepArgs(context, args, newArgs);<NEW_LINE>IRubyObject to = newArgs[0], step = newArgs[1<MASK><NEW_LINE>if (!by.isNil()) {<NEW_LINE>step = by;<NEW_LINE>}<NEW_LINE>if (step.isNil()) {<NEW_LINE>step = RubyFixnum.one(context.runtime);<NEW_LINE>} else if (step.op_equal(context, context.runtime.newFixnum(0)).isTrue()) {<NEW_LINE>throw context.runtime.newArgumentError("step can't be 0");<NEW_LINE>}<NEW_LINE>if ((to.isNil() || to instanceof RubyNumeric) && step instanceof RubyNumeric) {<NEW_LINE>return RubyArithmeticSequence.newArithmeticSequence(context, this, "step", args, this, to, step, context.fals);<NEW_LINE>}<NEW_LINE>return enumeratorizeWithSize(context, this, "step", args, RubyNumeric::stepSize);<NEW_LINE>}<NEW_LINE>IRubyObject[] newArgs = new IRubyObject[2];<NEW_LINE>boolean desc = scanStepArgs(context, args, newArgs);<NEW_LINE>return stepCommon(context, newArgs[0], newArgs[1], desc, block);<NEW_LINE>}
], by = newArgs[2];
1,073,834
public void run(String command, String[] args, Context context, PrintStream out) throws DDRInteractiveCommandException {<NEW_LINE>String[] newArgs = null;<NEW_LINE>if (args.length < 1) {<NEW_LINE>out.println("The time command requires another command to run as an argument.");<NEW_LINE>return;<NEW_LINE>} else if (args.length > 1) {<NEW_LINE>newArgs = new String[args.length - 1];<NEW_LINE>System.arraycopy(args, 1, newArgs, 0, newArgs.length);<NEW_LINE>} else {<NEW_LINE>newArgs = new String[0];<NEW_LINE>}<NEW_LINE>CommandParser commandParser;<NEW_LINE>try {<NEW_LINE>commandParser = new CommandParser(args[0], newArgs);<NEW_LINE>long startTime = System.currentTimeMillis();<NEW_LINE>context.execute(commandParser, out);<NEW_LINE>long endTime = System.currentTimeMillis();<NEW_LINE>double secs = ((double) endTime - (double) startTime) / 1000.0;<NEW_LINE>out.printf("\n---\nCommand '%s' took %f seconds\n", <MASK><NEW_LINE>} catch (ParseException e) {<NEW_LINE>e.printStackTrace(out);<NEW_LINE>}<NEW_LINE>}
commandParser.toString(), secs);
245,885
private void dealWithGroupedContexts(String resourceId, List<Phase2Context> contexts) {<NEW_LINE>DataSourceProxy dataSourceProxy = dataSourceManager.get(resourceId);<NEW_LINE>if (dataSourceProxy == null) {<NEW_LINE>LOGGER.warn("failed to find resource for {} and requeue", resourceId);<NEW_LINE>addAllToCommitQueue(contexts);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Connection conn = null;<NEW_LINE>try {<NEW_LINE>conn = dataSourceProxy.getPlainConnection();<NEW_LINE>UndoLogManager undoLogManager = UndoLogManagerFactory.getUndoLogManager(dataSourceProxy.getDbType());<NEW_LINE>// split contexts into several lists, with each list contain no more element than limit size<NEW_LINE>List<List<Phase2Context>> splitByLimit = <MASK><NEW_LINE>for (List<Phase2Context> partition : splitByLimit) {<NEW_LINE>deleteUndoLog(conn, undoLogManager, partition);<NEW_LINE>}<NEW_LINE>} catch (SQLException sqlExx) {<NEW_LINE>addAllToCommitQueue(contexts);<NEW_LINE>LOGGER.error("failed to get connection for async committing on {} and requeue", resourceId, sqlExx);<NEW_LINE>} finally {<NEW_LINE>IOUtil.close(conn);<NEW_LINE>}<NEW_LINE>}
Lists.partition(contexts, UNDOLOG_DELETE_LIMIT_SIZE);
368,587
private static void loadICUData(Context context, File workingDir) {<NEW_LINE>OutputStream out = null;<NEW_LINE>ZipInputStream in = null;<NEW_LINE>File icuDir = new File(workingDir, "icu");<NEW_LINE>File icuDataFile = new File(icuDir, "icudt46l.dat");<NEW_LINE>try {<NEW_LINE>if (!icuDir.exists())<NEW_LINE>icuDir.mkdirs();<NEW_LINE>if (!icuDataFile.exists()) {<NEW_LINE>in = new ZipInputStream(context.getAssets().open("icudt46l.zip"));<NEW_LINE>in.getNextEntry();<NEW_LINE>out = new FileOutputStream(icuDataFile);<NEW_LINE>byte[] buf = new byte[1024];<NEW_LINE>int len;<NEW_LINE>while ((len = in.read(buf)) > 0) {<NEW_LINE>out.write(buf, 0, len);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception ex) {<NEW_LINE>if (BuildConfig.DEBUG) {<NEW_LINE>Log.<MASK><NEW_LINE>}<NEW_LINE>if (icuDataFile.exists()) {<NEW_LINE>icuDataFile.delete();<NEW_LINE>}<NEW_LINE>throw new RuntimeException(ex);<NEW_LINE>} finally {<NEW_LINE>try {<NEW_LINE>if (in != null) {<NEW_LINE>in.close();<NEW_LINE>}<NEW_LINE>if (out != null) {<NEW_LINE>out.flush();<NEW_LINE>out.close();<NEW_LINE>}<NEW_LINE>} catch (IOException ioe) {<NEW_LINE>if (BuildConfig.DEBUG) {<NEW_LINE>Log.e(TAG, "Error in closing streams IO streams after expanding ICU dat file", ioe);<NEW_LINE>}<NEW_LINE>throw new RuntimeException(ioe);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
e(TAG, "Error copying icu dat file", ex);
493,162
private static void insideTag(DocTreePath tag, JavadocContext jdctx, int caretOffset) {<NEW_LINE>TokenSequence<JavadocTokenId> jdts = jdctx.jdts;<NEW_LINE>assert jdts.token() != null;<NEW_LINE>int start = (int) jdctx.positions.getStartPosition(jdctx.javac.getCompilationUnit(), jdctx.<MASK><NEW_LINE>boolean isThrowsKind = JavadocCompletionUtils.normalizedKind(tag.getLeaf()) == DocTree.Kind.THROWS;<NEW_LINE>if (isThrowsKind && !(EXECUTABLE.contains(jdctx.commentFor.getKind()))) {<NEW_LINE>// illegal tag in this context<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>jdts.move(start + (JavadocCompletionUtils.isBlockTag(tag) ? 0 : 1));<NEW_LINE>// @see|@link|@throws<NEW_LINE>if (!jdts.moveNext() || caretOffset <= jdts.offset() + jdts.token().length()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// white space<NEW_LINE>if (!jdts.moveNext() || caretOffset <= jdts.offset()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>boolean noPrefix = false;<NEW_LINE>if (caretOffset <= jdts.offset() + jdts.token().length()) {<NEW_LINE>int pos = caretOffset - jdts.offset();<NEW_LINE>CharSequence cs = jdts.token().text();<NEW_LINE>cs = pos < cs.length() ? cs.subSequence(0, pos) : cs;<NEW_LINE>if (JavadocCompletionUtils.isWhiteSpace(cs) || JavadocCompletionUtils.isLineBreak(jdts.token(), pos)) {<NEW_LINE>noPrefix = true;<NEW_LINE>} else {<NEW_LINE>// broken syntax<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} else if (!(JavadocCompletionUtils.isWhiteSpace(jdts.token()) || JavadocCompletionUtils.isLineBreak(jdts.token()))) {<NEW_LINE>// not java reference<NEW_LINE>return;<NEW_LINE>} else if (jdts.moveNext()) {<NEW_LINE>int end = (int) jdctx.positions.getEndPosition(jdctx.javac.getCompilationUnit(), jdctx.comment, tag.getLeaf());<NEW_LINE>insideReference(JavadocCompletionUtils.normalizedKind(tag.getLeaf()), jdts.offset(), end, jdctx, caretOffset);<NEW_LINE>}<NEW_LINE>}
comment, tag.getLeaf());
1,132,422
final GetSizeConstraintSetResult executeGetSizeConstraintSet(GetSizeConstraintSetRequest getSizeConstraintSetRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getSizeConstraintSetRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetSizeConstraintSetRequest> request = null;<NEW_LINE>Response<GetSizeConstraintSetResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetSizeConstraintSetRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getSizeConstraintSetRequest));<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, "WAF");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetSizeConstraintSet");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetSizeConstraintSetResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
false), new GetSizeConstraintSetResultJsonUnmarshaller());
1,530,846
public boolean execute() throws Exception {<NEW_LINE>PluginManager<MASK><NEW_LINE>if (_type == null) {<NEW_LINE>Set<Class<? extends QuickStartBase>> quickStarts = allQuickStarts();<NEW_LINE>throw new UnsupportedOperationException("No QuickStart type provided. " + "Valid types are: " + errroMessageFor(quickStarts));<NEW_LINE>}<NEW_LINE>QuickStartBase quickstart = selectQuickStart(_type);<NEW_LINE>if (_tmpDir != null) {<NEW_LINE>quickstart.setDataDir(_tmpDir);<NEW_LINE>}<NEW_LINE>if (_bootstrapTableDir != null) {<NEW_LINE>quickstart.setBootstrapDataDir(_bootstrapTableDir);<NEW_LINE>}<NEW_LINE>if (_zkExternalAddress != null) {<NEW_LINE>quickstart.setZkExternalAddress(_zkExternalAddress);<NEW_LINE>}<NEW_LINE>if (_configFilePath != null) {<NEW_LINE>quickstart.setConfigFilePath(_configFilePath);<NEW_LINE>}<NEW_LINE>quickstart.execute();<NEW_LINE>return true;<NEW_LINE>}
.get().init();
284,204
public void process(Operator operator, List<COSBase> operands) throws IOException {<NEW_LINE>if (operands.size() < 4) {<NEW_LINE>throw new MissingOperandException(operator, operands);<NEW_LINE>}<NEW_LINE>if (!checkArrayTypesClass(operands, COSNumber.class)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>COSNumber x2 = (<MASK><NEW_LINE>COSNumber y2 = (COSNumber) operands.get(1);<NEW_LINE>COSNumber x3 = (COSNumber) operands.get(2);<NEW_LINE>COSNumber y3 = (COSNumber) operands.get(3);<NEW_LINE>PointF currentPoint = context.getCurrentPoint();<NEW_LINE>PointF point2 = context.transformedPoint(x2.floatValue(), y2.floatValue());<NEW_LINE>PointF point3 = context.transformedPoint(x3.floatValue(), y3.floatValue());<NEW_LINE>if (currentPoint == null) {<NEW_LINE>Log.w("PdfBox-Android", "curveTo (" + point3.x + "," + point3.y + ") without initial MoveTo");<NEW_LINE>context.moveTo(point3.x, point3.y);<NEW_LINE>} else {<NEW_LINE>context.curveTo((float) currentPoint.x, (float) currentPoint.y, point2.x, point2.y, point3.x, point3.y);<NEW_LINE>}<NEW_LINE>}
COSNumber) operands.get(0);
1,509,415
private void closedown() {<NEW_LINE>boolean restarting = CoreFactory.isCoreAvailable() ? CoreFactory.getSingleton().isRestarting() : false;<NEW_LINE>logMessage(null, " closing buddy connections");<NEW_LINE>for (int i = 0; i < buddies.size(); i++) {<NEW_LINE>((BuddyPluginBuddy) buddies.get(i)).sendCloseRequest(restarting);<NEW_LINE>}<NEW_LINE>if (!restarting) {<NEW_LINE>logMessage(null, " updating online status");<NEW_LINE>List contacts = new ArrayList();<NEW_LINE>synchronized (publish_write_contacts) {<NEW_LINE>contacts.addAll(publish_write_contacts);<NEW_LINE>}<NEW_LINE>byte[] key_to_remove;<NEW_LINE>synchronized (this) {<NEW_LINE>key_to_remove = current_publish.getPublicKey();<NEW_LINE>}<NEW_LINE>if (contacts.size() == 0 || key_to_remove == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>DistributedDatabaseContact[] contact_a = new DistributedDatabaseContact[contacts.size()];<NEW_LINE>contacts.toArray(contact_a);<NEW_LINE>try {<NEW_LINE>ddb.delete(new DistributedDatabaseListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void event(DistributedDatabaseEvent event) {<NEW_LINE>if (event.getType() == DistributedDatabaseEvent.ET_VALUE_DELETED) {<NEW_LINE>// System.out.println( "Deleted status from " + event.getContact().getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}, getStatusKey(key_to_remove, "Friend status de-registration for closedown"), contact_a);<NEW_LINE>} catch (Throwable e) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
log(null, "Failed to remove existing publish", e);
1,682,946
public static X509TrustManager create() {<NEW_LINE>try {<NEW_LINE>KeyStore keystore = KeyStore.getInstance(KeyStore.getDefaultType());<NEW_LINE>// Clear<NEW_LINE>keystore.load(null);<NEW_LINE>CertificateFactory cf = CertificateFactory.getInstance("X.509");<NEW_LINE>keystore.setCertificateEntry("BACKPORT_COMODO_ROOT_CA", cf.generateCertificate(new ByteArrayInputStream(BackportCaCerts.COMODO.getBytes(Charset.forName("UTF-8")))));<NEW_LINE>keystore.setCertificateEntry("SECTIGO_USER_TRUST_CA", cf.generateCertificate(new ByteArrayInputStream(BackportCaCerts.SECTIGO_USER_TRUST.getBytes(Charset.forName("UTF-8")))));<NEW_LINE>keystore.setCertificateEntry("LETSENCRYPT_ISRG_CA", cf.generateCertificate(new ByteArrayInputStream(BackportCaCerts.LETSENCRYPT_ISRG.getBytes(Charset.forName("UTF-8")))));<NEW_LINE>List<X509TrustManager> managers = new ArrayList<>();<NEW_LINE>managers<MASK><NEW_LINE>managers.add(getSystemTrustManager(null));<NEW_LINE>return new CompositeX509TrustManager(managers);<NEW_LINE>} catch (KeyStoreException | CertificateException | NoSuchAlgorithmException | IOException e) {<NEW_LINE>Log.e(TAG, Log.getStackTraceString(e));<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}
.add(getSystemTrustManager(keystore));
1,497,607
public Tuple2<Boolean, Row> write(Map<String, String> in) {<NEW_LINE>StringBuilder sbd = new StringBuilder();<NEW_LINE>boolean isFirstPair = true;<NEW_LINE>if (valDelimiter != null) {<NEW_LINE>for (Map.Entry entry : in.entrySet()) {<NEW_LINE>if (isFirstPair) {<NEW_LINE>isFirstPair = false;<NEW_LINE>} else {<NEW_LINE>sbd.append(colDelimiter);<NEW_LINE>}<NEW_LINE>sbd.append(entry.getKey() + <MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>int itemSize = in.size();<NEW_LINE>int[] indices = new int[itemSize];<NEW_LINE>double[] values = new double[itemSize];<NEW_LINE>int count = 0;<NEW_LINE>for (Map.Entry<String, String> entry : in.entrySet()) {<NEW_LINE>indices[count] = ((Double) Double.parseDouble(entry.getKey())).intValue();<NEW_LINE>values[count] = Double.parseDouble(entry.getValue());<NEW_LINE>count++;<NEW_LINE>}<NEW_LINE>values = new SparseVector(-1, indices, values).getValues();<NEW_LINE>for (double value : values) {<NEW_LINE>if (isFirstPair) {<NEW_LINE>isFirstPair = false;<NEW_LINE>} else {<NEW_LINE>sbd.append(colDelimiter);<NEW_LINE>}<NEW_LINE>sbd.append(value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new Tuple2<>(true, Row.of(sbd.toString()));<NEW_LINE>}
valDelimiter + entry.getValue());
899,547
public Map<String, List<String>> updateSecurity(Context<? extends Trait> context, Shape shape, SecuritySchemeConverter<? extends Trait> converter, Map<String, List<String>> requirement) {<NEW_LINE>// Only modify requirements that exactly match the updated scheme.<NEW_LINE>if (requirement.size() != 1 || !requirement.keySet().iterator().next().equals(converter.getOpenApiAuthSchemeName())) {<NEW_LINE>return requirement;<NEW_LINE>}<NEW_LINE>ServiceShape service = context.getService();<NEW_LINE>AuthorizerIndex authorizerIndex = AuthorizerIndex.<MASK><NEW_LINE>return // Remove the original scheme authentication scheme from the operation if found.<NEW_LINE>authorizerIndex.getAuthorizer(service, shape).// Add a new scheme for this operation using the authorizer name.<NEW_LINE>map(authorizer -> MapUtils.of(authorizer, requirement.values().iterator().next())).orElse(requirement);<NEW_LINE>}
of(context.getModel());
44,048
public void watch() {<NEW_LINE>boolean activated = false;<NEW_LINE>if (this.properties.isMonitoringConfigMaps()) {<NEW_LINE>try {<NEW_LINE>String name = "config-maps-watch-event";<NEW_LINE>this.watches.put(name, this.kubernetesClient.configMaps().watch(new Watcher<ConfigMap>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void eventReceived(Watcher.Action action, ConfigMap configMap) {<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug(name + " received event for ConfigMap " + configMap.getMetadata().getName());<NEW_LINE>}<NEW_LINE>onEvent(configMap);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClose(WatcherException exception) {<NEW_LINE>log.warn("ConfigMaps watch closed", exception);<NEW_LINE>Optional.ofNullable(exception).map(e -> {<NEW_LINE>log.debug("Exception received during watch", e);<NEW_LINE>return exception.asClientException();<NEW_LINE>}).map(KubernetesClientException::getStatus).map(Status::getCode).filter(c -> c.equals(HttpURLConnection.HTTP_GONE)).<MASK><NEW_LINE>}<NEW_LINE>}));<NEW_LINE>activated = true;<NEW_LINE>this.log.info("Added new Kubernetes watch: " + name);<NEW_LINE>} catch (Exception e) {<NEW_LINE>this.log.error("Error while establishing a connection to watch config maps: configuration may remain stale", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (activated) {<NEW_LINE>this.log.info("Kubernetes event-based configMap change detector activated");<NEW_LINE>}<NEW_LINE>}
ifPresent(c -> watch());
1,018,210
final DescribeReservationResult executeDescribeReservation(DescribeReservationRequest describeReservationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeReservationRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeReservationRequest> request = null;<NEW_LINE>Response<DescribeReservationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeReservationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeReservationRequest));<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, "MediaLive");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeReservation");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeReservationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeReservationResultJsonUnmarshaller());<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,210,099
private int _kernelrpc_mach_vm_map_trap(Emulator<?> emulator) {<NEW_LINE>Backend backend = emulator.getBackend();<NEW_LINE>int target = backend.reg_read(ArmConst.UC_ARM_REG_R0).intValue();<NEW_LINE>Pointer address = UnidbgPointer.register(emulator, ArmConst.UC_ARM_REG_R1);<NEW_LINE>int r2 = backend.reg_read(ArmConst.UC_ARM_REG_R2).intValue();<NEW_LINE>long r3 = backend.reg_read(ArmConst.UC_ARM_REG_R3).intValue();<NEW_LINE>long size = (r3 << 32) | r2;<NEW_LINE>int r4 = backend.reg_read(ArmConst.UC_ARM_REG_R4).intValue();<NEW_LINE>long r5 = backend.reg_read(ArmConst.UC_ARM_REG_R5).intValue();<NEW_LINE>long mask = (r5 << 32) | r4;<NEW_LINE>int flags = backend.reg_read(<MASK><NEW_LINE>int cur_protection = backend.reg_read(ArmConst.UC_ARM_REG_R8).intValue();<NEW_LINE>int tag = flags >> 24;<NEW_LINE>boolean anywhere = (flags & MachO.VM_FLAGS_ANYWHERE) != 0;<NEW_LINE>if (!anywhere) {<NEW_LINE>throw new BackendException("_kernelrpc_mach_vm_map_trap fixed");<NEW_LINE>}<NEW_LINE>Pointer value = address.getPointer(0);<NEW_LINE>UnidbgPointer pointer;<NEW_LINE>if (mask != 0) {<NEW_LINE>MachOLoader loader = (MachOLoader) emulator.getMemory();<NEW_LINE>pointer = UnidbgPointer.pointer(emulator, loader.allocate(size, mask));<NEW_LINE>} else {<NEW_LINE>pointer = emulator.getMemory().mmap((int) size, cur_protection);<NEW_LINE>}<NEW_LINE>String msg = "_kernelrpc_mach_vm_map_trap target=" + target + ", address=" + address + ", value=" + value + ", size=0x" + Long.toHexString(size) + ", mask=0x" + Long.toHexString(mask) + ", flags=0x" + Long.toHexString(flags) + ", cur_protection=" + cur_protection + ", pointer=" + pointer + ", anywhere=true, tag=0x" + Integer.toHexString(tag);<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug(msg);<NEW_LINE>} else {<NEW_LINE>Log log = LogFactory.getLog("com.github.unidbg.ios.malloc");<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug(msg);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>address.setPointer(0, pointer);<NEW_LINE>return 0;<NEW_LINE>}
ArmConst.UC_ARM_REG_R6).intValue();
861,848
public synchronized void resetStorageGroupStatus(StorageGroupInfo storageGroupInfo) {<NEW_LINE>long delta = 0;<NEW_LINE>if (reportedStorageGroupMemCostMap.containsKey(storageGroupInfo)) {<NEW_LINE>delta = reportedStorageGroupMemCostMap.get(storageGroupInfo) - storageGroupInfo.getMemCost();<NEW_LINE>this.totalStorageGroupMemCost -= delta;<NEW_LINE>storageGroupInfo.setLastReportedSize(storageGroupInfo.getMemCost());<NEW_LINE>reportedStorageGroupMemCostMap.put(storageGroupInfo, storageGroupInfo.getMemCost());<NEW_LINE>}<NEW_LINE>if (totalStorageGroupMemCost >= FLUSH_THERSHOLD && totalStorageGroupMemCost < REJECT_THERSHOLD) {<NEW_LINE>logger.debug("SG ({}) released memory (delta: {}) but still exceeding flush proportion (totalSgMemCost: {}), call flush.", storageGroupInfo.getVirtualStorageGroupProcessor().getLogicalStorageGroupName(), delta, totalStorageGroupMemCost);<NEW_LINE>if (rejected) {<NEW_LINE>logger.info("SG ({}) released memory (delta: {}), set system to normal status (totalSgMemCost: {}).", storageGroupInfo.getVirtualStorageGroupProcessor().<MASK><NEW_LINE>}<NEW_LINE>logCurrentTotalSGMemory();<NEW_LINE>rejected = false;<NEW_LINE>} else if (totalStorageGroupMemCost >= REJECT_THERSHOLD) {<NEW_LINE>logger.warn("SG ({}) released memory (delta: {}), but system is still in reject status (totalSgMemCost: {}).", storageGroupInfo.getVirtualStorageGroupProcessor().getLogicalStorageGroupName(), delta, totalStorageGroupMemCost);<NEW_LINE>logCurrentTotalSGMemory();<NEW_LINE>rejected = true;<NEW_LINE>} else {<NEW_LINE>logger.debug("SG ({}) released memory (delta: {}), system is in normal status (totalSgMemCost: {}).", storageGroupInfo.getVirtualStorageGroupProcessor().getLogicalStorageGroupName(), delta, totalStorageGroupMemCost);<NEW_LINE>logCurrentTotalSGMemory();<NEW_LINE>rejected = false;<NEW_LINE>}<NEW_LINE>}
getLogicalStorageGroupName(), delta, totalStorageGroupMemCost);
390,127
protected void encodeNativeCheckbox(FacesContext context, DataTable table, boolean checked, boolean disabled, boolean isHeaderCheckbox) throws IOException {<NEW_LINE>ResponseWriter writer = context.getResponseWriter();<NEW_LINE>String ariaRowLabel = table.getAriaRowLabel();<NEW_LINE>if (isHeaderCheckbox) {<NEW_LINE>ariaRowLabel = MessageFactory.getMessage(DataTable.ARIA_HEADER_CHECKBOX_ALL);<NEW_LINE>}<NEW_LINE>writer.startElement("input", null);<NEW_LINE>writer.writeAttribute("type", "checkbox", null);<NEW_LINE>writer.writeAttribute("name", table.getClientId<MASK><NEW_LINE>writer.writeAttribute(HTML.ARIA_LABEL, ariaRowLabel, null);<NEW_LINE>writer.writeAttribute(HTML.ARIA_CHECKED, String.valueOf(checked), null);<NEW_LINE>if (checked) {<NEW_LINE>writer.writeAttribute("checked", "checked", null);<NEW_LINE>}<NEW_LINE>if (disabled) {<NEW_LINE>writer.writeAttribute("disabled", "disabled", null);<NEW_LINE>}<NEW_LINE>writer.endElement("input");<NEW_LINE>}
(context) + "_checkbox", null);
519,132
public boolean execute(Object result) throws ContractExeException {<NEW_LINE>TransactionResultCapsule ret = (TransactionResultCapsule) result;<NEW_LINE>if (Objects.isNull(ret)) {<NEW_LINE>throw new RuntimeException(ActuatorConstant.TX_RESULT_NULL);<NEW_LINE>}<NEW_LINE>final SetAccountIdContract setAccountIdContract;<NEW_LINE>final long fee = calcFee();<NEW_LINE>AccountStore accountStore = chainBaseManager.getAccountStore();<NEW_LINE>AccountIdIndexStore accountIdIndexStore = chainBaseManager.getAccountIdIndexStore();<NEW_LINE>try {<NEW_LINE>setAccountIdContract = any.unpack(SetAccountIdContract.class);<NEW_LINE>} catch (InvalidProtocolBufferException e) {<NEW_LINE>logger.debug(e.getMessage(), e);<NEW_LINE>ret.setStatus(fee, code.FAILED);<NEW_LINE>throw new ContractExeException(e.getMessage());<NEW_LINE>}<NEW_LINE>byte[] ownerAddress = setAccountIdContract.getOwnerAddress().toByteArray();<NEW_LINE>AccountCapsule account = accountStore.get(ownerAddress);<NEW_LINE>account.setAccountId(setAccountIdContract.<MASK><NEW_LINE>accountStore.put(ownerAddress, account);<NEW_LINE>accountIdIndexStore.put(account);<NEW_LINE>ret.setStatus(fee, code.SUCESS);<NEW_LINE>return true;<NEW_LINE>}
getAccountId().toByteArray());
1,574,320
public static void writeParts(JasperPrint jasperPrint, Writer writer) throws IOException {<NEW_LINE>PrintParts parts = jasperPrint.getParts();<NEW_LINE>writer.write("{");<NEW_LINE>writer.write("\"id\": \"parts_" + (parts.hashCode() & 0x7FFFFFFF) + "\",");<NEW_LINE>writer.write("\"type\": \"reportparts\",");<NEW_LINE>writer.write("\"parts\": [");<NEW_LINE>if (!parts.startsAtZero()) {<NEW_LINE>writer.write("{\"idx\": 0, \"name\": \"");<NEW_LINE>writer.write(JsonStringEncoder.getInstance().quoteAsString(jasperPrint.getName()));<NEW_LINE>writer.write("\"}");<NEW_LINE>if (parts.partCount() > 1) {<NEW_LINE>writer.write(",");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Iterator<Map.Entry<Integer, PrintPart>> it = parts.partsIterator();<NEW_LINE>while (it.hasNext()) {<NEW_LINE>Map.Entry<Integer, PrintPart<MASK><NEW_LINE>int idx = partsEntry.getKey();<NEW_LINE>PrintPart part = partsEntry.getValue();<NEW_LINE>writer.write("{\"idx\": " + idx + ", \"name\": \"");<NEW_LINE>writer.write(JsonStringEncoder.getInstance().quoteAsString(part.getName()));<NEW_LINE>writer.write("\"}");<NEW_LINE>if (it.hasNext()) {<NEW_LINE>writer.write(",");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>writer.write("]");<NEW_LINE>writer.write("}");<NEW_LINE>}
> partsEntry = it.next();
952,110
public OnlineAbDefinition unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>OnlineAbDefinition onlineAbDefinition = new OnlineAbDefinition();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("controlTreatmentName", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>onlineAbDefinition.setControlTreatmentName(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("treatmentWeights", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>onlineAbDefinition.setTreatmentWeights(new MapUnmarshaller<String, Long>(context.getUnmarshaller(String.class), context.getUnmarshaller(Long.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 onlineAbDefinition;<NEW_LINE>}
class).unmarshall(context));
1,280,560
public long handle(Emulator<?> emulator) {<NEW_LINE>RegisterContext context = emulator.getContext();<NEW_LINE>UnidbgPointer object = context.getPointerArg(1);<NEW_LINE>UnidbgPointer jmethodID = context.getPointerArg(2);<NEW_LINE>UnidbgPointer jvalue = context.getPointerArg(3);<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("CallObjectMethodA object=" + object + ", jmethodID=" + jmethodID + ", jvalue=" + jvalue + ", lr=" + context.getLRPointer());<NEW_LINE>}<NEW_LINE>DvmObject<?> dvmObject = getObject(object.toIntPeer());<NEW_LINE>DvmClass dvmClass = dvmObject == null ? null : dvmObject.getObjectType();<NEW_LINE>DvmMethod dvmMethod = dvmClass == null ? null : dvmClass.getMethod(jmethodID.toIntPeer());<NEW_LINE>if (dvmMethod == null) {<NEW_LINE>throw new BackendException("dvmObject=" + dvmObject + ", dvmClass=" + dvmClass + ", jmethodID=" + jmethodID);<NEW_LINE>} else {<NEW_LINE>VaList vaList = new JValueList(DalvikVM.this, jvalue, dvmMethod);<NEW_LINE>DvmObject<?> obj = dvmMethod.callObjectMethodA(dvmObject, vaList);<NEW_LINE>if (verbose) {<NEW_LINE>System.out.printf("JNIEnv->CallObjectMethodA(%s, %s(%s) => %s) was called from %s%n", dvmObject, dvmMethod.methodName, vaList.formatArgs(), <MASK><NEW_LINE>}<NEW_LINE>return addLocalObject(obj);<NEW_LINE>}<NEW_LINE>}
obj, context.getLRPointer());
672,493
public Object calculate(Context ctx) {<NEW_LINE>JobSpace js = ctx.getJobSpace();<NEW_LINE>if (js != null && js.getAppHome() != null) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException(mm.getMessage("license.fpNotSupport") + "system");<NEW_LINE>}<NEW_LINE>if (param == null) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("system" + mm.getMessage("function.missingParam"));<NEW_LINE>}<NEW_LINE>String cmd = null;<NEW_LINE>String[] cmds = null;<NEW_LINE>if (param.isLeaf()) {<NEW_LINE>Object cmdObj = param.getLeafExpression().calculate(ctx);<NEW_LINE>if (!(cmdObj instanceof String)) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("system" + mm.getMessage("function.paramTypeError"));<NEW_LINE>}<NEW_LINE>cmd = (String) cmdObj;<NEW_LINE>} else {<NEW_LINE>int count = param.getSubSize();<NEW_LINE>cmds = new String[count];<NEW_LINE>for (int i = 0; i < count; ++i) {<NEW_LINE>IParam sub = param.getSub(i);<NEW_LINE>if (sub == null || !sub.isLeaf()) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("system" + mm.getMessage("function.invalidParam"));<NEW_LINE>}<NEW_LINE>Object cmdObj = sub.getLeafExpression().calculate(ctx);<NEW_LINE>if (!(cmdObj instanceof String)) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("system" + mm.getMessage("function.paramTypeError"));<NEW_LINE>}<NEW_LINE>cmds[i] = (String) cmdObj;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Runtime runtime = Runtime.getRuntime();<NEW_LINE>Process process;<NEW_LINE>if (cmds == null) {<NEW_LINE>process = runtime.exec(cmd);<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>StringBuffer errBuf = new StringBuffer(1024);<NEW_LINE>StringBuffer outBuf = new StringBuffer(1024);<NEW_LINE>Grabber g1 = new Grabber(errBuf, process.getErrorStream());<NEW_LINE>Grabber g2 = new Grabber(outBuf, process.getInputStream());<NEW_LINE>g1.start();<NEW_LINE>g2.start();<NEW_LINE>if (option == null || option.indexOf('p') == -1) {<NEW_LINE>int n = process.waitFor();<NEW_LINE>g1.join();<NEW_LINE>g2.join();<NEW_LINE>if (g1.buf.length() > 0)<NEW_LINE>Logger.info(g1.buf);<NEW_LINE>if (g2.buf.length() > 0)<NEW_LINE>Logger.info(g2.buf);<NEW_LINE>return new Integer(n);<NEW_LINE>} else {<NEW_LINE>return Boolean.TRUE;<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new RQException(e);<NEW_LINE>}<NEW_LINE>}
process = runtime.exec(cmds);
1,053,202
public void drawTo(Graphic graphic, Style heighLight) {<NEW_LINE>Vector wavePos;<NEW_LINE>int waveSize = OUT_SIZE / 3;<NEW_LINE>if (graphic.isFlagSet(Graphic.Flag.smallIO)) {<NEW_LINE>Vector center = new Vector(-LATEX_RAD.x, 0);<NEW_LINE>graphic.drawCircle(center.sub(LATEX_RAD), center.add(LATEX_RAD), Style.NORMAL);<NEW_LINE>Vector textPos = new Vector(-SIZE2 - LATEX_RAD.x, 0);<NEW_LINE>graphic.drawText(textPos, label, <MASK><NEW_LINE>wavePos = center.sub(new Vector(2 * waveSize, LATEX_RAD.y + waveSize + 1));<NEW_LINE>} else {<NEW_LINE>int outSize = OutputShape.getOutSize(small);<NEW_LINE>waveSize = outSize / 3;<NEW_LINE>graphic.drawPolygon(new Polygon(true).add(-outSize * 2 - 1, -outSize).add(-1, -outSize).add(-1, outSize).add(-outSize * 2 - 1, outSize), Style.NORMAL);<NEW_LINE>Vector textPos = new Vector(-outSize * 3, 0);<NEW_LINE>graphic.drawText(textPos, label, Orientation.RIGHTCENTER, Style.INOUT);<NEW_LINE>wavePos = new Vector(-outSize - waveSize * 2, waveSize);<NEW_LINE>}<NEW_LINE>graphic.drawPolygon(new Polygon(false).add(wavePos).add(wavePos.add(waveSize, 0)).add(wavePos.add(waveSize, -waveSize * 2)).add(wavePos.add(2 * waveSize, -waveSize * 2)).add(wavePos.add(2 * waveSize, 0)).add(wavePos.add(3 * waveSize, 0)).add(wavePos.add(3 * waveSize, -waveSize * 2)).add(wavePos.add(4 * waveSize, -waveSize * 2)), Style.THIN);<NEW_LINE>}
Orientation.RIGHTCENTER, Style.INOUT);
859,605
private static void loadAllDialects() {<NEW_LINE>LOG.debug("Searching for and loading all JDBC source dialects on the classpath");<NEW_LINE>final AtomicInteger count = new AtomicInteger();<NEW_LINE>AccessController.doPrivileged(new PrivilegedAction<Void>() {<NEW_LINE><NEW_LINE>public Void run() {<NEW_LINE>ServiceLoader<DatabaseDialectProvider> loadedDialects = ServiceLoader.load(DatabaseDialectProvider.class);<NEW_LINE>// Always use ServiceLoader.iterator() to get lazy loading (see JavaDocs)<NEW_LINE>Iterator<DatabaseDialectProvider> dialectIterator = loadedDialects.iterator();<NEW_LINE>try {<NEW_LINE>while (dialectIterator.hasNext()) {<NEW_LINE>try {<NEW_LINE>DatabaseDialectProvider provider = dialectIterator.next();<NEW_LINE>REGISTRY.put(provider.getClass().getName(), provider);<NEW_LINE>count.incrementAndGet();<NEW_LINE>LOG.debug("Found '{}' provider {}", provider, provider.getClass());<NEW_LINE>} catch (Throwable t) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Throwable t) {<NEW_LINE>LOG.debug("Error loading dialect providers", t);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>LOG.debug("Registered {} source dialects", count.get());<NEW_LINE>}
LOG.debug("Skipping dialect provider after error while loading", t);
1,478,835
public DocIdAndVersion lookupVersion(BytesRef id, boolean loadSeqNo, LeafReaderContext context) throws IOException {<NEW_LINE>assert context.reader().getCoreCacheHelper().getKey().equals(readerKey) : "context's reader is not the same as the reader class was initialized on.";<NEW_LINE>int <MASK><NEW_LINE>if (docID != DocIdSetIterator.NO_MORE_DOCS) {<NEW_LINE>final long seqNo;<NEW_LINE>final long term;<NEW_LINE>if (loadSeqNo) {<NEW_LINE>seqNo = readNumericDocValues(context.reader(), SeqNoFieldMapper.NAME, docID);<NEW_LINE>term = readNumericDocValues(context.reader(), SeqNoFieldMapper.PRIMARY_TERM_NAME, docID);<NEW_LINE>} else {<NEW_LINE>seqNo = SequenceNumbers.UNASSIGNED_SEQ_NO;<NEW_LINE>term = 0;<NEW_LINE>}<NEW_LINE>final long version = readNumericDocValues(context.reader(), VersionFieldMapper.NAME, docID);<NEW_LINE>return new DocIdAndVersion(docID, version, seqNo, term, context.reader(), context.docBase);<NEW_LINE>} else {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}
docID = getDocID(id, context);
580,720
protected Object decode(Channel channel, SocketAddress remoteAddress, Object msg) throws Exception {<NEW_LINE>ByteBuf buf = (ByteBuf) msg;<NEW_LINE>if (BitUtil.check(buf.getByte(buf.readerIndex()), 7)) {<NEW_LINE>int content = buf.readUnsignedByte();<NEW_LINE>if (BitUtil.check(content, 0)) {<NEW_LINE>String id = ByteBufUtil.hexDump(buf.readSlice(buf.readUnsignedByte())<MASK><NEW_LINE>getDeviceSession(channel, remoteAddress, id);<NEW_LINE>}<NEW_LINE>if (BitUtil.check(content, 1)) {<NEW_LINE>// identifier type<NEW_LINE>buf.skipBytes(buf.readUnsignedByte());<NEW_LINE>}<NEW_LINE>if (BitUtil.check(content, 2)) {<NEW_LINE>// authentication<NEW_LINE>buf.skipBytes(buf.readUnsignedByte());<NEW_LINE>}<NEW_LINE>if (BitUtil.check(content, 3)) {<NEW_LINE>// routing<NEW_LINE>buf.skipBytes(buf.readUnsignedByte());<NEW_LINE>}<NEW_LINE>if (BitUtil.check(content, 4)) {<NEW_LINE>// forwarding<NEW_LINE>buf.skipBytes(buf.readUnsignedByte());<NEW_LINE>}<NEW_LINE>if (BitUtil.check(content, 5)) {<NEW_LINE>// response redirection<NEW_LINE>buf.skipBytes(buf.readUnsignedByte());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>DeviceSession deviceSession = getDeviceSession(channel, remoteAddress);<NEW_LINE>if (deviceSession == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>int service = buf.readUnsignedByte();<NEW_LINE>int type = buf.readUnsignedByte();<NEW_LINE>int index = buf.readUnsignedShort();<NEW_LINE>if (service == SERVICE_ACKNOWLEDGED) {<NEW_LINE>sendResponse(channel, remoteAddress, type, index, 0);<NEW_LINE>}<NEW_LINE>if (type == MSG_EVENT_REPORT || type == MSG_LOCATE_REPORT || type == MSG_MINI_EVENT_REPORT || type == MSG_USER_DATA) {<NEW_LINE>return decodePosition(deviceSession, type, buf);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
).replace("f", "");
1,042,949
final ModifyInstanceAttributeResult executeModifyInstanceAttribute(ModifyInstanceAttributeRequest modifyInstanceAttributeRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(modifyInstanceAttributeRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ModifyInstanceAttributeRequest> request = null;<NEW_LINE>Response<ModifyInstanceAttributeResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ModifyInstanceAttributeRequestMarshaller().marshall(super.beforeMarshalling(modifyInstanceAttributeRequest));<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, "EC2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ModifyInstanceAttribute");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<ModifyInstanceAttributeResult> responseHandler = new StaxResponseHandler<ModifyInstanceAttributeResult>(new ModifyInstanceAttributeResultStaxUnmarshaller());<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);
1,052,200
public void testCreateConsumerWithMsgSelectorNoLocalTopic_TcpIp_SecOff(HttpServletRequest request, HttpServletResponse response) throws Exception {<NEW_LINE>JMSContext jmsContext = jmsTCFTCP.createContext();<NEW_LINE>JMSConsumer jmsConsumer = jmsContext.createConsumer(jmsTopic, "Team = 'SIB'", false);<NEW_LINE><MASK><NEW_LINE>TextMessage sendmsg = jmsContext.createTextMessage("testCreateConsumerWithMsgSelectorNoLocalTopic_TcpIp_SecOff");<NEW_LINE>sendmsg.setStringProperty("Team", "SIB");<NEW_LINE>jmsProducer.send(jmsTopic, sendmsg);<NEW_LINE>TextMessage msg = (TextMessage) jmsConsumer.receive(DEFAULT_TIMEOUT);<NEW_LINE>boolean testFailed = false;<NEW_LINE>if ((msg == null) || (msg.getText() == null) || !msg.getText().equals("testCreateConsumerWithMsgSelectorNoLocalTopic_TcpIp_SecOff") || !msg.getStringProperty("Team").equals("SIB")) {<NEW_LINE>testFailed = true;<NEW_LINE>}<NEW_LINE>jmsConsumer.close();<NEW_LINE>jmsContext.close();<NEW_LINE>if (testFailed) {<NEW_LINE>throw new Exception("testCreateConsumerWithMsgSelectorNoLocalTopic_TcpIp_SecOff failed: Expected message or property value was not received");<NEW_LINE>}<NEW_LINE>}
JMSProducer jmsProducer = jmsContext.createProducer();
1,067,681
private static void processModuleSymbols(PdbApplicator applicator, Map<Address, List<Stuff>> map, TaskMonitor monitor) throws CancelledException {<NEW_LINE>AbstractPdb pdb = applicator.getPdb();<NEW_LINE><MASK><NEW_LINE>if (debugInfo == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int totalCount = 0;<NEW_LINE>int num = debugInfo.getNumModules();<NEW_LINE>for (int moduleNumber = 1; moduleNumber <= num; moduleNumber++) {<NEW_LINE>monitor.checkCanceled();<NEW_LINE>SymbolGroup symbolGroup = applicator.getSymbolGroupForModule(moduleNumber);<NEW_LINE>if (symbolGroup == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>totalCount += symbolGroup.size();<NEW_LINE>}<NEW_LINE>applicator.setMonitorMessage("PDB: Applying " + totalCount + " module symbol components...");<NEW_LINE>monitor.initialize(totalCount);<NEW_LINE>// Process symbols list for each module<NEW_LINE>for (int moduleNumber = 1; moduleNumber <= num; moduleNumber++) {<NEW_LINE>monitor.checkCanceled();<NEW_LINE>// String moduleName =<NEW_LINE>// pdb.getDebugInfo().getModuleInformation(index).getModuleName();<NEW_LINE>// Process module symbols list<NEW_LINE>SymbolGroup symbolGroup = applicator.getSymbolGroupForModule(moduleNumber);<NEW_LINE>if (symbolGroup == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>AbstractMsSymbolIterator iter = symbolGroup.iterator();<NEW_LINE>processSymbolGroup(applicator, map, moduleNumber, iter, monitor);<NEW_LINE>// do not call monitor.incrementProgress(1) here, as it is updated inside of<NEW_LINE>// processSymbolGroup.<NEW_LINE>}<NEW_LINE>}
PdbDebugInfo debugInfo = pdb.getDebugInfo();
1,572,680
void decode(Decoder decoder, Instruction instruction) {<NEW_LINE>instruction.setCode(code);<NEW_LINE>instruction.setOp0Register(decoder.state_reg + Register.K0);<NEW_LINE>instruction.setOp1Register(<MASK><NEW_LINE>int sss = decoder.getSss();<NEW_LINE>if (decoder.state_mod == 3) {<NEW_LINE>instruction.setOp2Register(decoder.state_rm + decoder.state_extraBaseRegisterBaseEVEX + Register.ZMM0);<NEW_LINE>if ((decoder.state_zs_flags & StateFlags.MVEX_EH) != 0) {<NEW_LINE>if (MvexInfo.canUseSuppressAllExceptions(code)) {<NEW_LINE>if ((sss & 4) != 0)<NEW_LINE>instruction.setSuppressAllExceptions(true);<NEW_LINE>if (MvexInfo.canUseRoundingControl(code)) {<NEW_LINE>instruction.setRoundingControl((sss & 3) + RoundingControl.ROUND_TO_NEAREST);<NEW_LINE>}<NEW_LINE>} else if (MvexInfo.getNoSaeRc(code) && (sss & decoder.invalidCheckMask) != 0)<NEW_LINE>decoder.setInvalidInstruction();<NEW_LINE>} else {<NEW_LINE>if ((MvexInfo.getInvalidSwizzleFns(code) & (1 << sss) & decoder.invalidCheckMask) != 0)<NEW_LINE>decoder.setInvalidInstruction();<NEW_LINE>assert Integer.compareUnsigned(sss, 7) <= 0 : sss;<NEW_LINE>instruction.setMvexRegMemConv(MvexRegMemConv.REG_SWIZZLE_NONE + sss);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>instruction.setOp2Kind(OpKind.MEMORY);<NEW_LINE>if ((decoder.state_zs_flags & StateFlags.MVEX_EH) != 0)<NEW_LINE>instruction.setMvexEvictionHint(true);<NEW_LINE>if ((MvexInfo.getInvalidConvFns(code) & (1 << sss) & decoder.invalidCheckMask) != 0)<NEW_LINE>decoder.setInvalidInstruction();<NEW_LINE>instruction.setMvexRegMemConv(MvexRegMemConv.MEM_CONV_NONE + sss);<NEW_LINE>decoder.readOpMem(instruction, MvexInfo.getTupleType(code, sss));<NEW_LINE>}<NEW_LINE>if (((decoder.state_zs_extraRegisterBase | decoder.state_extraRegisterBaseEVEX) & decoder.invalidCheckMask) != 0)<NEW_LINE>decoder.setInvalidInstruction();<NEW_LINE>instruction.setOp3Kind(OpKind.IMMEDIATE8);<NEW_LINE>instruction.setImmediate8((byte) decoder.readByte());<NEW_LINE>}
decoder.state_vvvv + Register.ZMM0);
1,231,023
public Integer runTests(PhpModule phpModule, TestRunInfo runInfo) throws TestRunException {<NEW_LINE>PhpExecutable phpUnit = getExecutable(phpModule);<NEW_LINE>if (phpUnit == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>File workingDirectory = getWorkingDirectory(phpModule);<NEW_LINE>if (workingDirectory != null) {<NEW_LINE>phpUnit.workDir(workingDirectory);<NEW_LINE>}<NEW_LINE>TestParams testParams = getTestParams(phpModule, runInfo);<NEW_LINE>phpUnit.additionalParameters(testParams.getParams());<NEW_LINE>phpUnit.environmentVariables(testParams.getEnvironmentVariables());<NEW_LINE>ExecutionDescriptor descriptor = getTestDescriptor();<NEW_LINE>try {<NEW_LINE>if (runInfo.getSessionType() == TestRunInfo.SessionType.TEST) {<NEW_LINE>// NOI18N<NEW_LINE>return phpUnit.runAndWait(descriptor, "Running PhpUnit tests...");<NEW_LINE>}<NEW_LINE>List<FileObject<MASK><NEW_LINE>assert startFiles.size() == 1 : "Exactly one file expected for debugging but got " + startFiles;<NEW_LINE>return phpUnit.debug(startFiles.get(0), descriptor, null);<NEW_LINE>} catch (CancellationException ex) {<NEW_LINE>// canceled<NEW_LINE>LOGGER.log(Level.FINE, "Test running cancelled", ex);<NEW_LINE>} catch (ExecutionException ex) {<NEW_LINE>LOGGER.log(Level.INFO, null, ex);<NEW_LINE>if (PhpUnitPreferences.isPhpUnitEnabled(phpModule)) {<NEW_LINE>// custom phpunit<NEW_LINE>UiUtils.processExecutionException(ex, phpModule, PhpUnitCustomizer.IDENTIFIER);<NEW_LINE>} else {<NEW_LINE>UiUtils.processExecutionException(ex, PhpUnitOptionsPanelController.OPTIONS_SUB_PATH);<NEW_LINE>}<NEW_LINE>throw new TestRunException(ex);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
> startFiles = runInfo.getStartFiles();
1,242,390
final AttachVolumeResult executeAttachVolume(AttachVolumeRequest attachVolumeRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(attachVolumeRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<AttachVolumeRequest> request = null;<NEW_LINE>Response<AttachVolumeResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new AttachVolumeRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(attachVolumeRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Storage Gateway");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AttachVolume");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<AttachVolumeResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new AttachVolumeResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
1,222,701
private void drawAllElses(UGraphic ug) {<NEW_LINE>final StringBounder stringBounder = ug.getStringBounder();<NEW_LINE>final double totalHeight = getTotalHeight(stringBounder);<NEW_LINE>final List<Double> ys = new ArrayList<>();<NEW_LINE>for (Tile tile : tiles) {<NEW_LINE>if (tile instanceof ElseTile) {<NEW_LINE>final ElseTile elseTile = (ElseTile) tile;<NEW_LINE>ys.add(elseTile.getY() - <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>ys.add(totalHeight);<NEW_LINE>int i = 0;<NEW_LINE>for (Tile tile : tiles) {<NEW_LINE>if (tile instanceof ElseTile) {<NEW_LINE>final ElseTile elseTile = (ElseTile) tile;<NEW_LINE>final Component comp = elseTile.getComponent(stringBounder);<NEW_LINE>final Area area = Area.create(max.getCurrentValue() - min.getCurrentValue(), ys.get(i + 1) - ys.get(i));<NEW_LINE>comp.drawU(ug.apply(new UTranslate(min.getCurrentValue(), ys.get(i))), area, (Context2D) ug);<NEW_LINE>i++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
getY() + MARGINY_MAGIC / 2);
1,061,680
protected void dataCalculations(Player player, float skillValue) {<NEW_LINE>FishingManager fishingManager = UserManager.<MASK><NEW_LINE>// TREASURE HUNTER<NEW_LINE>if (canTreasureHunt) {<NEW_LINE>lootTier = fishingManager.getLootTier();<NEW_LINE>// Item drop rates<NEW_LINE>commonTreasure = percent.format(FishingTreasureConfig.getInstance().getItemDropRate(lootTier, Rarity.COMMON) / 100.0);<NEW_LINE>uncommonTreasure = percent.format(FishingTreasureConfig.getInstance().getItemDropRate(lootTier, Rarity.UNCOMMON) / 100.0);<NEW_LINE>rareTreasure = percent.format(FishingTreasureConfig.getInstance().getItemDropRate(lootTier, Rarity.RARE) / 100.0);<NEW_LINE>epicTreasure = percent.format(FishingTreasureConfig.getInstance().getItemDropRate(lootTier, Rarity.EPIC) / 100.0);<NEW_LINE>legendaryTreasure = percent.format(FishingTreasureConfig.getInstance().getItemDropRate(lootTier, Rarity.LEGENDARY) / 100.0);<NEW_LINE>mythicTreasure = percent.format(FishingTreasureConfig.getInstance().getItemDropRate(lootTier, Rarity.MYTHIC) / 100.0);<NEW_LINE>// Magic hunter drop rates<NEW_LINE>double totalEnchantChance = 0;<NEW_LINE>for (Rarity rarity : Rarity.values()) {<NEW_LINE>if (rarity != Rarity.MYTHIC) {<NEW_LINE>totalEnchantChance += FishingTreasureConfig.getInstance().getEnchantmentDropRate(lootTier, rarity);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (totalEnchantChance >= 1)<NEW_LINE>magicChance = percent.format(totalEnchantChance / 100.0);<NEW_LINE>else<NEW_LINE>magicChance = percent.format(0);<NEW_LINE>}<NEW_LINE>// FISHING_SHAKE<NEW_LINE>if (canShake) {<NEW_LINE>String[] shakeStrings = RandomChanceUtil.calculateAbilityDisplayValuesStatic(player, PrimarySkillType.FISHING, fishingManager.getShakeChance());<NEW_LINE>shakeChance = shakeStrings[0];<NEW_LINE>shakeChanceLucky = shakeStrings[1];<NEW_LINE>}<NEW_LINE>// FISHERMAN'S DIET<NEW_LINE>if (canFishermansDiet) {<NEW_LINE>fishermansDietRank = RankUtils.getRank(player, SubSkillType.FISHING_FISHERMANS_DIET);<NEW_LINE>}<NEW_LINE>// MASTER ANGLER<NEW_LINE>if (canMasterAngler) {<NEW_LINE>maMinWaitTime = StringUtils.ticksToSeconds(fishingManager.getMasterAnglerTickMinWaitReduction(RankUtils.getRank(player, SubSkillType.FISHING_MASTER_ANGLER), false));<NEW_LINE>maMaxWaitTime = StringUtils.ticksToSeconds(fishingManager.getMasterAnglerTickMaxWaitReduction(RankUtils.getRank(player, SubSkillType.FISHING_MASTER_ANGLER), false, 0));<NEW_LINE>}<NEW_LINE>}
getPlayer(player).getFishingManager();
819,806
public void handleInit(ChaincodeMessage message) {<NEW_LINE>Runnable task = () -> {<NEW_LINE>ChaincodeMessage nextStatemessage = null;<NEW_LINE>boolean send = true;<NEW_LINE>try {<NEW_LINE>// Get the function and args from Payload<NEW_LINE>ChaincodeInput input;<NEW_LINE>try {<NEW_LINE>input = ChaincodeInput.parseFrom(message.getPayload());<NEW_LINE>} catch (Exception e) {<NEW_LINE>// payload = []byte(unmarshalErr.Error())<NEW_LINE>// // Send ERROR message to chaincode support and change state<NEW_LINE>// logger.debug(String.format("[%s]Incorrect payload format. Sending %s", shortUUID(message), ERROR)<NEW_LINE>// nextStatemessage = ChaincodeMessage.newBuilder(){Type: ERROR, Payload: payload, Uuid: message.getUuid()}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// // Mark as a transaction (allow put/del state)<NEW_LINE>markIsTransaction(message.getUuid(), true);<NEW_LINE>// Create the ChaincodeStub which the chaincode can use to callback<NEW_LINE>ChaincodeStub stub = new ChaincodeStub(message.getUuid(), this);<NEW_LINE>// Call chaincode's Run<NEW_LINE>ByteString result;<NEW_LINE>try {<NEW_LINE>result = chaincode.runHelper(stub, input.getFunction(), arrayHelper(input.getArgsList()));<NEW_LINE>} catch (Exception e) {<NEW_LINE>// Send ERROR message to chaincode support and change state<NEW_LINE>logger.debug(String.format("[%s]Init failed. Sending %s", shortUUID(message), ERROR));<NEW_LINE>nextStatemessage = ChaincodeMessage.newBuilder().setType(ERROR).setPayload(ByteString.copyFromUtf8(e.getMessage())).setUuid(message.getUuid()).build();<NEW_LINE>return;<NEW_LINE>} finally {<NEW_LINE>// delete isTransaction entry<NEW_LINE>deleteIsTransaction(message.getUuid());<NEW_LINE>}<NEW_LINE>// Send COMPLETED message to chaincode support and change state<NEW_LINE>nextStatemessage = ChaincodeMessage.newBuilder().setType(COMPLETED).setPayload(result).setUuid(message.getUuid()).build();<NEW_LINE>logger.debug(String.format(String.format("[%s]Init succeeded. Sending %s", shortUUID(message), COMPLETED)));<NEW_LINE>// TODO put in all exception states<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw e;<NEW_LINE>} finally {<NEW_LINE>triggerNextState(nextStatemessage, send);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>// Run above task<NEW_LINE>new <MASK><NEW_LINE>}
Thread(task).start();
1,790,688
private <T> T checkAndUpdateLowerBound(Supplier<T> timestampContainerSupplier, ToLongFunction<T> lowerBoundExtractor, ToLongFunction<T> upperBoundExtractor, OperationType operationType) {<NEW_LINE>// take snapshot before making the request<NEW_LINE><MASK><NEW_LINE>TimestampBounds timestampBounds = getTimestampBounds();<NEW_LINE>T timestampContainer = timestampContainerSupplier.get();<NEW_LINE>// take snapshot after making the request<NEW_LINE>Instant wallClockTimeAfterRequest = Instant.now();<NEW_LINE>long lowerFreshTimestamp = lowerBoundExtractor.applyAsLong(timestampContainer);<NEW_LINE>long upperFreshTimestamp = upperBoundExtractor.applyAsLong(timestampContainer);<NEW_LINE>TimestampBoundsRecord currentTimestampsBoundsRecord = ImmutableTimestampBoundsRecord.builder().operationType(operationType).inclusiveLowerBoundFromLastRequest(lowerFreshTimestamp).inclusiveUpperBoundFromLastRequest(upperFreshTimestamp).wallClockTimeBeforeRequest(wallClockTimeBeforeRequest).wallClockTimeAfterResponse(wallClockTimeAfterRequest).build();<NEW_LINE>checkTimestamp(timestampBounds, currentTimestampsBoundsRecord, lowerFreshTimestamp);<NEW_LINE>updateLowerBound(currentTimestampsBoundsRecord);<NEW_LINE>return timestampContainer;<NEW_LINE>}
Instant wallClockTimeBeforeRequest = Instant.now();
985,763
protected MultiGetResult<K, V> do_GET_ALL(Set<? extends K> keys) {<NEW_LINE>HashMap<K, CacheGetResult<V>> resultMap = new HashMap<>();<NEW_LINE>Set<K> restKeys = new HashSet<>(keys);<NEW_LINE>for (int i = 0; i < caches.length; i++) {<NEW_LINE>if (restKeys.size() == 0) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>Cache<K, CacheValueHolder<V>> c = caches[i];<NEW_LINE>MultiGetResult<K, CacheValueHolder<V>> allResult = c.GET_ALL(restKeys);<NEW_LINE>if (allResult.isSuccess() && allResult.getValues() != null) {<NEW_LINE>for (Map.Entry<K, CacheGetResult<CacheValueHolder<V>>> en : allResult.getValues().entrySet()) {<NEW_LINE>K key = en.getKey();<NEW_LINE>CacheGetResult result = en.getValue();<NEW_LINE>if (result.isSuccess()) {<NEW_LINE>CacheValueHolder<V> holder = unwrapHolder(result.getHolder());<NEW_LINE>checkResultAndFillUpperCache(key, i, holder);<NEW_LINE>resultMap.put(key, new CacheGetResult(CacheResultCode.SUCCESS, null, holder));<NEW_LINE>restKeys.remove(key);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (K k : restKeys) {<NEW_LINE>resultMap.<MASK><NEW_LINE>}<NEW_LINE>return new MultiGetResult<>(CacheResultCode.SUCCESS, null, resultMap);<NEW_LINE>}
put(k, CacheGetResult.NOT_EXISTS_WITHOUT_MSG);
1,418,461
private void loadPrev5min() {<NEW_LINE>Iterator<Integer> serverIds = serverObjMap.keySet().iterator();<NEW_LINE>final List<Pack> result = new ArrayList<Pack>();<NEW_LINE>while (serverIds.hasNext()) {<NEW_LINE>int serverId = serverIds.next();<NEW_LINE>TcpProxy tcp = TcpProxy.getTcpProxy(serverId);<NEW_LINE>try {<NEW_LINE>MapPack param = new MapPack();<NEW_LINE>long etime = TimeUtil.getCurrentTime();<NEW_LINE>long stime = etime - DateUtil.MILLIS_PER_MINUTE * 5;<NEW_LINE>param.put("stime", stime);<NEW_LINE>param.put("etime", etime);<NEW_LINE>param.put("counter", counter);<NEW_LINE>param.put("objHash", serverObjMap.get(serverId));<NEW_LINE>tcp.process(RequestCmd.COUNTER_PAST_TIME_GROUP, param, new INetReader() {<NEW_LINE><NEW_LINE>public void process(DataInputX in) throws IOException {<NEW_LINE><MASK><NEW_LINE>result.add(p);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>} finally {<NEW_LINE>TcpProxy.putTcpProxy(tcp);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final Map<Long, Double> valueMap = ScouterUtil.getLoadTotalMap(counter, result, mode, TimeTypeEnum.REALTIME);<NEW_LINE>ExUtil.exec(canvas, new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>CircularBufferDataProvider provider = (CircularBufferDataProvider) trace.getDataProvider();<NEW_LINE>provider.clearTrace();<NEW_LINE>Set<Long> timeSet = valueMap.keySet();<NEW_LINE>for (long time : timeSet) {<NEW_LINE>provider.addSample(new Sample(CastUtil.cdouble(time), CastUtil.cdouble(valueMap.get(time))));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
Pack p = in.readPack();
658,285
private void generateCheckin(List<BaseTerminalEvent> eventBatch) {<NEW_LINE>// Generate up to 100 unique terminal ids between 100 and 200<NEW_LINE>String[] termIds = new String[100];<NEW_LINE>for (int i = 0; i < termIds.length; i++) {<NEW_LINE>termIds[i] = Long.toString(i + 1000);<NEW_LINE>}<NEW_LINE>// Swap terminals to get a random ordering<NEW_LINE>randomize(termIds);<NEW_LINE>// Add a check-in event for each<NEW_LINE>for (int i = 0; i < termIds.length; i++) {<NEW_LINE>Checkin checkin = new Checkin(new TerminalInfo(termIds[i]));<NEW_LINE>eventBatch.add(checkin);<NEW_LINE>}<NEW_LINE>// Add a cancelled or completed or out-of-order for each<NEW_LINE>int completedCount = 0;<NEW_LINE>int cancelledCount = 0;<NEW_LINE>int outOfOrderCount = 0;<NEW_LINE>for (int i = 0; i < termIds.length; i++) {<NEW_LINE>BaseTerminalEvent theEvent = null;<NEW_LINE>// With a 1 in 1000 chance send an OutOfOrder<NEW_LINE>if (random.nextInt(1000) == 0) {<NEW_LINE>outOfOrderCount++;<NEW_LINE>theEvent = new OutOfOrder(new TerminalInfo(termIds[i]));<NEW_LINE>System.out.println("Generated an Checkin followed by " + theEvent.getType() + " event for terminal " + theEvent.getTerm().getId());<NEW_LINE>} else if (random.nextBoolean()) {<NEW_LINE>completedCount++;<NEW_LINE>theEvent = new Completed(new <MASK><NEW_LINE>} else {<NEW_LINE>cancelledCount++;<NEW_LINE>theEvent = new Cancelled(new TerminalInfo(termIds[i]));<NEW_LINE>}<NEW_LINE>eventBatch.add(theEvent);<NEW_LINE>}<NEW_LINE>System.out.println("Generated " + termIds.length + " Checkin events followed by " + completedCount + " Completed and " + cancelledCount + " Cancelled and " + outOfOrderCount + " OutOfOrder events");<NEW_LINE>}
TerminalInfo(termIds[i]));
910,177
private void handleUnManagedOSDiskContainers() {<NEW_LINE>final VirtualMachineScaleSetStorageProfile storageProfile = innerModel().virtualMachineProfile().storageProfile();<NEW_LINE>if (isManagedDiskEnabled()) {<NEW_LINE>storageProfile.osDisk().withVhdContainers(null);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (isOSDiskFromStoredImage(storageProfile)) {<NEW_LINE>// There is a restriction currently that virtual machine's disk cannot be stored in multiple storage<NEW_LINE>// accounts if scale set is based on stored image. Remove this check once azure start supporting it.<NEW_LINE>//<NEW_LINE>storageProfile.osDisk().vhdContainers().clear();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String containerName = null;<NEW_LINE>for (String containerUrl : storageProfile.osDisk().vhdContainers()) {<NEW_LINE>containerName = containerUrl.substring(containerUrl.lastIndexOf("/") + 1);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (containerName == null) {<NEW_LINE>containerName = "vhds";<NEW_LINE>}<NEW_LINE>if (isInCreateMode() && this.creatableStorageAccountKeys.isEmpty() && this.existingStorageAccountsToAssociate.isEmpty()) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalStateException("Expected storage account(s) for VMSS OS disk containers not found"));<NEW_LINE>}<NEW_LINE>for (String storageAccountKey : this.creatableStorageAccountKeys) {<NEW_LINE>StorageAccount storageAccount = this<MASK><NEW_LINE>storageProfile.osDisk().vhdContainers().add(mergePath(storageAccount.endPoints().primary().blob(), containerName));<NEW_LINE>}<NEW_LINE>for (StorageAccount storageAccount : this.existingStorageAccountsToAssociate) {<NEW_LINE>storageProfile.osDisk().vhdContainers().add(mergePath(storageAccount.endPoints().primary().blob(), containerName));<NEW_LINE>}<NEW_LINE>this.creatableStorageAccountKeys.clear();<NEW_LINE>this.existingStorageAccountsToAssociate.clear();<NEW_LINE>}
.<StorageAccount>taskResult(storageAccountKey);
1,052,594
void processRedirect(@Nullable Uri redirectData) {<NEW_LINE>if (mCreatedSource == null || mCreateSourcePromise == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (redirectData == null) {<NEW_LINE>mCreateSourcePromise.reject(getErrorCode(mErrorCodes, "redirectCancelled"), getDescription(mErrorCodes, "redirectCancelled"));<NEW_LINE>mCreatedSource = null;<NEW_LINE>mCreateSourcePromise = null;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final String clientSecret = redirectData.getQueryParameter("client_secret");<NEW_LINE>if (!mCreatedSource.getClientSecret().equals(clientSecret)) {<NEW_LINE>mCreateSourcePromise.reject(getErrorCode(mErrorCodes, "redirectNoSource"), getDescription(mErrorCodes, "redirectNoSource"));<NEW_LINE>mCreatedSource = null;<NEW_LINE>mCreateSourcePromise = null;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final String <MASK><NEW_LINE>if (!mCreatedSource.getId().equals(sourceId)) {<NEW_LINE>mCreateSourcePromise.reject(getErrorCode(mErrorCodes, "redirectWrongSourceId"), getDescription(mErrorCodes, "redirectWrongSourceId"));<NEW_LINE>mCreatedSource = null;<NEW_LINE>mCreateSourcePromise = null;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final Promise promise = mCreateSourcePromise;<NEW_LINE>// Nulls those properties to avoid processing them twice<NEW_LINE>mCreatedSource = null;<NEW_LINE>mCreateSourcePromise = null;<NEW_LINE>new AsyncTask<Void, Void, Void>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected Void doInBackground(Void... voids) {<NEW_LINE>Source source = null;<NEW_LINE>try {<NEW_LINE>source = mStripe.retrieveSourceSynchronous(sourceId, clientSecret);<NEW_LINE>} catch (Exception e) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>switch(source.getStatus()) {<NEW_LINE>case Chargeable:<NEW_LINE>case Consumed:<NEW_LINE>promise.resolve(convertSourceToWritableMap(source));<NEW_LINE>break;<NEW_LINE>case Canceled:<NEW_LINE>promise.reject(getErrorCode(mErrorCodes, "redirectCancelled"), getDescription(mErrorCodes, "redirectCancelled"));<NEW_LINE>break;<NEW_LINE>case Pending:<NEW_LINE>case Failed:<NEW_LINE>default:<NEW_LINE>promise.reject(getErrorCode(mErrorCodes, "redirectFailed"), getDescription(mErrorCodes, "redirectFailed"));<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}.execute();<NEW_LINE>}
sourceId = redirectData.getQueryParameter("source");
1,203,428
void handle(DownloadIsoToPrimaryStorageMsg msg, final ReturnValueCompletion<DownloadIsoToPrimaryStorageReply> completion) {<NEW_LINE>ImageSpec ispec = msg.getIsoSpec();<NEW_LINE>SimpleQuery<BackupStorageVO> q = dbf.createQuery(BackupStorageVO.class);<NEW_LINE>q.add(BackupStorageVO_.uuid, Op.EQ, ispec.<MASK><NEW_LINE>BackupStorageVO bsvo = q.find();<NEW_LINE>BackupStorageInventory bsinv = BackupStorageInventory.valueOf(bsvo);<NEW_LINE>ImageCache cache = new ImageCache();<NEW_LINE>cache.image = ispec.getInventory();<NEW_LINE>cache.hostUuid = msg.getDestHostUuid();<NEW_LINE>cache.primaryStorageInstallPath = makeCachedImageInstallUrl(ispec.getInventory());<NEW_LINE>cache.backupStorage = bsinv;<NEW_LINE>cache.backupStorageInstallPath = ispec.getSelectedBackupStorage().getInstallPath();<NEW_LINE>cache.download(new ReturnValueCompletion<ImageCacheInventory>(completion) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void success(ImageCacheInventory returnValue) {<NEW_LINE>DownloadIsoToPrimaryStorageReply reply = new DownloadIsoToPrimaryStorageReply();<NEW_LINE>reply.setInstallPath(returnValue.getInstallUrl());<NEW_LINE>completion.success(reply);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void fail(ErrorCode errorCode) {<NEW_LINE>completion.fail(errorCode);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
getSelectedBackupStorage().getBackupStorageUuid());
7,929
final DescribeUserProfileResult executeDescribeUserProfile(DescribeUserProfileRequest describeUserProfileRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeUserProfileRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeUserProfileRequest> request = null;<NEW_LINE>Response<DescribeUserProfileResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeUserProfileRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeUserProfileRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CodeStar");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeUserProfile");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeUserProfileResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeUserProfileResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
1,597,882
public void initializeKeyStore(boolean reinitialize) throws Exception {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>Tr.entry(tc, "initializeKeyStore");<NEW_LINE>try {<NEW_LINE>String initAtStartup = getProperty(Constants.SSLPROP_KEY_STORE_INITIALIZE_AT_STARTUP);<NEW_LINE>boolean createIfMissing = LibertyConstants.DEFAULT_KEYSTORE_REF_ID.equals(getProperty("id"));<NEW_LINE>if (Boolean.parseBoolean(initAtStartup) || reinitialize) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())<NEW_LINE><MASK><NEW_LINE>getKeyStore(reinitialize, createIfMissing);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())<NEW_LINE>Tr.debug(tc, "Exception initializing KeyStore; " + e, e);<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>Tr.exit(tc, "initializeKeyStore");<NEW_LINE>}
Tr.debug(tc, "Initializing keystore at startup.");
197,103
public SkyValue compute(SkyKey skyKey, Environment env) throws InterruptedException, ProcessPackageDirectorySkyFunctionException {<NEW_LINE>PrepareDepsOfTargetsUnderDirectoryKey argument = (PrepareDepsOfTargetsUnderDirectoryKey) skyKey.argument();<NEW_LINE>final FilteringPolicy filteringPolicy = argument.getFilteringPolicy();<NEW_LINE>RecursivePkgKey recursivePkgKey = argument.getRecursivePkgKey();<NEW_LINE>ProcessPackageDirectory processPackageDirectory = new ProcessPackageDirectory(directories, (repository, subdirectory, excludedSubdirectoriesBeneathSubdirectory) -> PrepareDepsOfTargetsUnderDirectoryValue.key(repository<MASK><NEW_LINE>ProcessPackageDirectoryResult packageExistenceAndSubdirDeps = processPackageDirectory.getPackageExistenceAndSubdirDeps(recursivePkgKey.getRootedPath(), recursivePkgKey.getRepositoryName(), recursivePkgKey.getExcludedPaths(), env);<NEW_LINE>if (env.valuesMissing()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Iterable<SkyKey> keysToRequest = packageExistenceAndSubdirDeps.getChildDeps();<NEW_LINE>if (packageExistenceAndSubdirDeps.packageExists()) {<NEW_LINE>keysToRequest = Iterables.concat(ImmutableList.of(CollectTargetsInPackageValue.key(PackageIdentifier.create(recursivePkgKey.getRepositoryName(), recursivePkgKey.getRootedPath().getRootRelativePath()), filteringPolicy)), keysToRequest);<NEW_LINE>}<NEW_LINE>return GraphTraversingHelper.declareDependenciesAndCheckIfValuesMissing(env, keysToRequest, NoSuchPackageException.class, ProcessPackageDirectoryException.class) ? null : PrepareDepsOfTargetsUnderDirectoryValue.INSTANCE;<NEW_LINE>}
, subdirectory, excludedSubdirectoriesBeneathSubdirectory, filteringPolicy));
1,817,565
private NodeModel moveToNewParent(final NodeModel selectedNode, final List<NodeModel> selectedNodes) {<NEW_LINE>final <MASK><NEW_LINE>for (final NodeModel node : selectedNodes) {<NEW_LINE>if (node.getParentNode() != oldParent) {<NEW_LINE>UITools.errorMessage(TextUtils.getText("cannot_add_parent_diff_parents"));<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (node.isRoot()) {<NEW_LINE>UITools.errorMessage(TextUtils.getText("cannot_add_parent_to_root"));<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final MMapController mapController = (MMapController) Controller.getCurrentModeController().getMapController();<NEW_LINE>final SummaryLevels summaryLevels = new SummaryLevels(oldParent);<NEW_LINE>int childPosition = selectedNode.getIndex();<NEW_LINE>final NodeModel summaryNode = summaryLevels.findSummaryNode(childPosition);<NEW_LINE>if (summaryNode != null) {<NEW_LINE>final Collection<NodeModel> summarizedNodes = summaryLevels.summarizedNodes(summaryNode);<NEW_LINE>if (selectedNodes.containsAll(summarizedNodes))<NEW_LINE>childPosition = summaryLevels.findGroupBeginNodeIndex(childPosition);<NEW_LINE>}<NEW_LINE>final NodeModel newParent = mapController.addNewNode(oldParent, childPosition, selectedNode.isLeft());<NEW_LINE>mapController.moveNodesAsChildren(selectedNodes, newParent, false, false);<NEW_LINE>return newParent;<NEW_LINE>}
NodeModel oldParent = selectedNode.getParentNode();
1,766,111
private void appendCommon(final ResourceModel resourceModel, final ResourceSchema resourceSchema) {<NEW_LINE>// Set the entityType only when it is a UNSTRUCTURED_DATA base resource to avoid<NEW_LINE>// modifying all existing resources, which by default are STRUCTURED_DATA base.<NEW_LINE>if (ResourceEntityType.UNSTRUCTURED_DATA == resourceModel.getResourceEntityType()) {<NEW_LINE>resourceSchema.setEntityType(ResourceEntityType.UNSTRUCTURED_DATA);<NEW_LINE>}<NEW_LINE>resourceSchema.<MASK><NEW_LINE>if (!resourceModel.getNamespace().isEmpty()) {<NEW_LINE>resourceSchema.setNamespace(resourceModel.getNamespace());<NEW_LINE>}<NEW_LINE>// Set the D2 service name only IF it is not null to avoid unnecessary IDL changes.<NEW_LINE>if (resourceModel.getD2ServiceName() != null) {<NEW_LINE>resourceSchema.setD2ServiceName(resourceModel.getD2ServiceName());<NEW_LINE>}<NEW_LINE>resourceSchema.setPath(buildPath(resourceModel));<NEW_LINE>final Class<?> valueClass = resourceModel.getValueClass();<NEW_LINE>if (valueClass != null) {<NEW_LINE>resourceSchema.setSchema(DataTemplateUtil.getSchema(valueClass).getUnionMemberKey());<NEW_LINE>}<NEW_LINE>final Class<?> resourceClass = resourceModel.getResourceClass();<NEW_LINE>final String doc = _docsProvider.getClassDoc(resourceClass);<NEW_LINE>final StringBuilder docBuilder = new StringBuilder();<NEW_LINE>if (doc != null) {<NEW_LINE>docBuilder.append(doc).append("\n\n");<NEW_LINE>}<NEW_LINE>docBuilder.append("generated from: ").append(resourceClass.getCanonicalName());<NEW_LINE>final String deprecatedDoc = _docsProvider.getClassDeprecatedTag(resourceClass);<NEW_LINE>if (deprecatedDoc != null) {<NEW_LINE>DataMap customAnnotationData = resourceModel.getCustomAnnotationData();<NEW_LINE>if (customAnnotationData == null) {<NEW_LINE>customAnnotationData = new DataMap();<NEW_LINE>resourceModel.setCustomAnnotation(customAnnotationData);<NEW_LINE>}<NEW_LINE>customAnnotationData.put(DEPRECATED_ANNOTATION_NAME, deprecateDocToAnnotationMap(deprecatedDoc));<NEW_LINE>}<NEW_LINE>resourceSchema.setDoc(docBuilder.toString());<NEW_LINE>}
setName(resourceModel.getName());
1,372,439
private XYSeriesCollection makeSolutionSeries(VehicleRoutingProblem vrp, Collection<VehicleRoute> routes) {<NEW_LINE>Map<String, Coordinate> coords = makeMap(vrp.getAllLocations());<NEW_LINE>XYSeriesCollection coll = new XYSeriesCollection();<NEW_LINE>int counter = 1;<NEW_LINE>for (VehicleRoute route : routes) {<NEW_LINE>if (route.isEmpty())<NEW_LINE>continue;<NEW_LINE>XYSeries series = new XYSeries(counter, false, true);<NEW_LINE>Coordinate startCoord = getCoordinate(coords.get(route.getStart().getLocation().getId()));<NEW_LINE>series.add(startCoord.getX() * scalingFactor, startCoord.getY() * scalingFactor);<NEW_LINE>for (TourActivity act : route.getTourActivities().getActivities()) {<NEW_LINE>Coordinate coord = getCoordinate(coords.get(act.getLocation().getId()));<NEW_LINE>series.add(coord.getX() * scalingFactor, coord.getY() * scalingFactor);<NEW_LINE>}<NEW_LINE>Coordinate endCoord = getCoordinate(coords.get(route.getEnd().getLocation().getId()));<NEW_LINE>series.add(endCoord.getX() * scalingFactor, <MASK><NEW_LINE>coll.addSeries(series);<NEW_LINE>counter++;<NEW_LINE>}<NEW_LINE>return coll;<NEW_LINE>}
endCoord.getY() * scalingFactor);
1,310,120
/*<NEW_LINE>* @see<NEW_LINE>* com.sitewhere.commands.spi.ICommandExecutionEncoder#encodeSystemCommand(com.<NEW_LINE>* sitewhere.spi.device.command.ISystemCommand,<NEW_LINE>* com.sitewhere.spi.device.IDeviceNestingContext, java.util.List)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public byte[] encodeSystemCommand(ISystemCommand command, IDeviceNestingContext nested, List<? extends IDeviceAssignment> assignments) throws SiteWhereException {<NEW_LINE>switch(command.getType()) {<NEW_LINE>case RegistrationAck:<NEW_LINE>{<NEW_LINE>IRegistrationAckCommand ack = (IRegistrationAckCommand) command;<NEW_LINE>RegistrationAck.Builder builder = RegistrationAck.newBuilder();<NEW_LINE>switch(ack.getReason()) {<NEW_LINE>case AlreadyRegistered:<NEW_LINE>{<NEW_LINE>builder.setState(RegistrationAckState.ALREADY_REGISTERED);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case NewRegistration:<NEW_LINE>{<NEW_LINE>builder.setState(RegistrationAckState.NEW_REGISTRATION);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return encodeRegistrationAck(builder.build());<NEW_LINE>}<NEW_LINE>case RegistrationFailure:<NEW_LINE>{<NEW_LINE>IRegistrationFailureCommand fail = (IRegistrationFailureCommand) command;<NEW_LINE>RegistrationAck.Builder builder = RegistrationAck.newBuilder();<NEW_LINE>builder.setState(RegistrationAckState.REGISTRATION_ERROR);<NEW_LINE>builder.setErrorMessage(GOptionalString.newBuilder().setValue(fail.getErrorMessage()));<NEW_LINE>switch(fail.getReason()) {<NEW_LINE>case NewDevicesNotAllowed:<NEW_LINE>{<NEW_LINE><MASK><NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case InvalidDeviceTypeToken:<NEW_LINE>{<NEW_LINE>builder.setErrorType(RegistrationAckError.INVALID_SPECIFICATION);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case SiteTokenRequired:<NEW_LINE>{<NEW_LINE>builder.setErrorType(RegistrationAckError.SITE_TOKEN_REQUIRED);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return encodeRegistrationAck(builder.build());<NEW_LINE>}<NEW_LINE>case DeviceStreamAck:<NEW_LINE>{<NEW_LINE>IDeviceStreamAckCommand ack = (IDeviceStreamAckCommand) command;<NEW_LINE>DeviceStreamAck.Builder builder = DeviceStreamAck.newBuilder();<NEW_LINE>switch(ack.getStatus()) {<NEW_LINE>case DeviceStreamCreated:<NEW_LINE>{<NEW_LINE>builder.setState(DeviceStreamAckState.STREAM_CREATED);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case DeviceStreamExists:<NEW_LINE>{<NEW_LINE>builder.setState(DeviceStreamAckState.STREAM_EXISTS);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case DeviceStreamFailed:<NEW_LINE>{<NEW_LINE>builder.setState(DeviceStreamAckState.STREAM_FAILED);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return encodeDeviceStreamAck(builder.build());<NEW_LINE>}<NEW_LINE>case SendDeviceStreamData:<NEW_LINE>{<NEW_LINE>ISendDeviceStreamDataCommand send = (ISendDeviceStreamDataCommand) command;<NEW_LINE>DeviceStreamData.Builder builder = DeviceStreamData.newBuilder();<NEW_LINE>builder.setDeviceToken(GOptionalString.newBuilder().setValue(send.getDeviceToken()));<NEW_LINE>builder.setSequenceNumber(GOptionalFixed64.newBuilder().setValue(send.getSequenceNumber()));<NEW_LINE>builder.setData(ByteString.copyFrom(send.getData()));<NEW_LINE>return encodeSendDeviceStreamData(builder.build());<NEW_LINE>}<NEW_LINE>case DeviceMappingAck:<NEW_LINE>{<NEW_LINE>String json = MarshalUtils.marshalJsonAsPrettyString(command);<NEW_LINE>getLogger().warn("No protocol buffer encoding implemented for sending device mapping acknowledgement.");<NEW_LINE>getLogger().info("JSON representation of command is:\n" + json + "\n");<NEW_LINE>return new byte[0];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw new SiteWhereException("Unable to encode command: " + command.getClass().getName());<NEW_LINE>}
builder.setErrorType(RegistrationAckError.NEW_DEVICES_NOT_ALLOWED);
265,074
public UploadResult call() throws Exception {<NEW_LINE>CompleteMultipartUploadResult res;<NEW_LINE>try {<NEW_LINE>CompleteMultipartUploadRequest req = new CompleteMultipartUploadRequest(origReq.getBucketName(), origReq.getKey(), uploadId, collectPartETags()).withRequesterPays(origReq.isRequesterPays()).withGeneralProgressListener(origReq.getGeneralProgressListener()).withRequestMetricCollector(origReq.getRequestMetricCollector()).withRequestCredentialsProvider(origReq.getRequestCredentialsProvider());<NEW_LINE><MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>monitor.setTransferStateToFailed();<NEW_LINE>publishProgress(listener, ProgressEventType.TRANSFER_FAILED_EVENT);<NEW_LINE>partFutures.cancel(false);<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>UploadResult uploadResult = new UploadResult();<NEW_LINE>uploadResult.setBucketName(origReq.getBucketName());<NEW_LINE>uploadResult.setKey(origReq.getKey());<NEW_LINE>uploadResult.setETag(res.getETag());<NEW_LINE>uploadResult.setVersionId(res.getVersionId());<NEW_LINE>monitor.setTransferStateToCompleted();<NEW_LINE>return uploadResult;<NEW_LINE>}
res = s3.completeMultipartUpload(req);
1,773,720
public void dialogChanged() {<NEW_LINE>IResource container = ResourcesPlugin.getWorkspace().getRoot().findMember(new Path(getContainerName()));<NEW_LINE>String fileName = getFileName();<NEW_LINE>IResource file = ResourcesPlugin.getWorkspace().getRoot().findMember(new Path(getContainerName<MASK><NEW_LINE>if (file != null) {<NEW_LINE>updateStatus("File " + fileName + " already exists. Choose a new name.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (getContainerName().length() == 0) {<NEW_LINE>updateStatus("File container must be specified");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (container == null || (container.getType() & (IResource.PROJECT | IResource.FOLDER)) == 0) {<NEW_LINE>updateStatus("File container must exist");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!container.isAccessible()) {<NEW_LINE>updateStatus("Project must be writable");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (fileName.length() == 0) {<NEW_LINE>updateStatus("File name must be specified");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (fileName.replace('\\', '/').indexOf('/', 1) > 0) {<NEW_LINE>updateStatus("File name must be valid");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int dotLoc = fileName.lastIndexOf('.');<NEW_LINE>if (dotLoc != -1) {<NEW_LINE>String ext = fileName.substring(dotLoc + 1);<NEW_LINE>if (ext.equalsIgnoreCase("go") == false) {<NEW_LINE>updateStatus("File extension must be \"go\"");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (sourceFileComposite.getSourceFileType() == SourceFileType.TEST) {<NEW_LINE>if (!sourceFileComposite.getSourceFilename().getText().endsWith("_test.go")) {<NEW_LINE>updateStatus("Tests must end with \"_test.go\" suffix");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>updateStatus(null);<NEW_LINE>}
() + "/" + fileName));
1,612,515
// getC_CurrencyTo_ID<NEW_LINE>@Override<NEW_LINE>protected boolean beforeSave(boolean newRecord) {<NEW_LINE>// Set Amt<NEW_LINE>if (getC_Invoice_ID() == 0 && getC_Payment_ID() == 0) {<NEW_LINE>setAmt(Env.ZERO);<NEW_LINE>setOpenAmt(Env.ZERO);<NEW_LINE>}<NEW_LINE>// Converted Amt<NEW_LINE>if (Env.ZERO.compareTo(getOpenAmt()) == 0) {<NEW_LINE>setConvertedAmt(Env.ZERO);<NEW_LINE>} else if (Env.ZERO.compareTo(getConvertedAmt()) == 0) {<NEW_LINE>setConvertedAmt(MConversionRate.convert(getCtx(), getOpenAmt(), getC_CurrencyFrom_ID(), getC_CurrencyTo_ID(), getAD_Client_ID(), getAD_Org_ID()));<NEW_LINE>}<NEW_LINE>// Total<NEW_LINE>setTotalAmt(getConvertedAmt().add(getFeeAmt())<MASK><NEW_LINE>// Set Collection Status<NEW_LINE>if (isProcessed() && getInvoice() != null) {<NEW_LINE>I_C_DunningLevel level = getParent().getC_DunningLevel();<NEW_LINE>if (level != null) {<NEW_LINE>getInvoice().setC_DunningLevel_ID(level.getC_DunningLevel_ID());<NEW_LINE>if (level.getInvoiceCollectionType() != null) {<NEW_LINE>getInvoice().setInvoiceCollectionType(level.getInvoiceCollectionType());<NEW_LINE>} else {<NEW_LINE>if (!level.isStatement()) {<NEW_LINE>getInvoice().setInvoiceCollectionType(MInvoice.INVOICECOLLECTIONTYPE_Dunning);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>getInvoice().saveEx();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
.add(getInterestAmt()));
1,483,312
public void updateErrorView(View dialogView) {<NEW_LINE>// Allow or disallow touches with other visible windows<NEW_LINE>LinearLayout manageSpace = dialogView.findViewById(R.id.root);<NEW_LINE>manageSpace.setFilterTouchesWhenObscured(PreferenceUtils.shouldDisallowTouchesWithOtherVisibleWindows(dialogView.getContext()));<NEW_LINE>// / clean<NEW_LINE>dialogView.findViewById(R.id.reason_no_info_about_error).setVisibility(View.GONE);<NEW_LINE>// / refresh<NEW_LINE>if (mSslException.getCertPathValidatorException() != null) {<NEW_LINE>dialogView.findViewById(R.id.reason_cert_not_trusted).setVisibility(View.VISIBLE);<NEW_LINE>} else {<NEW_LINE>dialogView.findViewById(R.id.reason_cert_not_trusted).setVisibility(View.GONE);<NEW_LINE>}<NEW_LINE>if (mSslException.getCertificateExpiredException() != null) {<NEW_LINE>dialogView.findViewById(R.id.reason_cert_expired).setVisibility(View.VISIBLE);<NEW_LINE>} else {<NEW_LINE>dialogView.findViewById(R.id.reason_cert_expired).setVisibility(View.GONE);<NEW_LINE>}<NEW_LINE>if (mSslException.getCertificateNotYetValidException() != null) {<NEW_LINE>dialogView.findViewById(R.id.reason_cert_not_yet_valid).setVisibility(View.VISIBLE);<NEW_LINE>} else {<NEW_LINE>dialogView.findViewById(R.id.reason_cert_not_yet_valid<MASK><NEW_LINE>}<NEW_LINE>if (mSslException.getSslPeerUnverifiedException() != null) {<NEW_LINE>dialogView.findViewById(R.id.reason_hostname_not_verified).setVisibility(View.VISIBLE);<NEW_LINE>} else {<NEW_LINE>dialogView.findViewById(R.id.reason_hostname_not_verified).setVisibility(View.GONE);<NEW_LINE>}<NEW_LINE>}
).setVisibility(View.GONE);
517,899
public void updateOrderLine() {<NEW_LINE>final I_C_OrderLine orderLine = request.getOrderLine();<NEW_LINE>// Product was not set yet. There is no point to calculate the prices<NEW_LINE>if (orderLine.getM_Product_ID() <= 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Calculate Pricing Result<NEW_LINE>final IEditablePricingContext pricingCtx = createPricingContext();<NEW_LINE>final IPricingResult <MASK><NEW_LINE>if (!pricingResult.isCalculated()) {<NEW_LINE>throw new ProductNotOnPriceListException(pricingCtx, orderLine.getLine()).setParameter("log", pricingResult.getLoggableMessages()).setParameter("pricingResult", pricingResult);<NEW_LINE>}<NEW_LINE>OrderLinePriceAndDiscount priceAndDiscount = extractPriceAndDiscount(pricingResult, pricingCtx.getSoTrx());<NEW_LINE>//<NEW_LINE>// Apply price limit restrictions<NEW_LINE>final BooleanWithReason applyPriceLimitRestrictions = checkApplyPriceLimitRestrictions(pricingResult);<NEW_LINE>if (applyPriceLimitRestrictions.isTrue()) {<NEW_LINE>final PriceLimitRuleResult priceLimitResult = pricingBL.computePriceLimit(PriceLimitRuleContext.builder().pricingContext(pricingCtx).priceLimit(priceAndDiscount.getPriceLimit()).priceActual(priceAndDiscount.getPriceActual()).paymentTermId(orderLineBL.getPaymentTermId(orderLine)).build());<NEW_LINE>priceAndDiscount = priceAndDiscount.enforcePriceLimit(priceLimitResult);<NEW_LINE>} else {<NEW_LINE>priceAndDiscount = priceAndDiscount.toBuilder().priceLimitEnforced(false).priceLimitNotEnforcedExplanation(applyPriceLimitRestrictions.getReason()).build();<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Prices<NEW_LINE>priceAndDiscount.applyTo(orderLine);<NEW_LINE>orderLine.setInvoicableQtyBasedOn(pricingResult.getInvoicableQtyBasedOn().getRecordString());<NEW_LINE>orderLine.setPriceList(pricingResult.getPriceList());<NEW_LINE>orderLine.setPriceStd(pricingResult.getPriceStd());<NEW_LINE>// 07090: when setting a priceActual, we also need to specify a PriceUOM<NEW_LINE>orderLine.setPrice_UOM_ID(UomId.toRepoId(pricingResult.getPriceUomId()));<NEW_LINE>//<NEW_LINE>// C_Currency_ID, M_PriceList_Version_ID<NEW_LINE>orderLine.setC_Currency_ID(CurrencyId.toRepoId(pricingResult.getCurrencyId()));<NEW_LINE>orderLine.setM_PriceList_Version_ID(PriceListVersionId.toRepoId(pricingResult.getPriceListVersionId()));<NEW_LINE>orderLine.setIsCampaignPrice(pricingResult.isCampaignPrice());<NEW_LINE>orderLine.setIsPriceEditable(pricingResult.isPriceEditable());<NEW_LINE>orderLine.setIsDiscountEditable(pricingResult.isDiscountEditable());<NEW_LINE>orderLine.setEnforcePriceLimit(pricingResult.getEnforcePriceLimit().isTrue());<NEW_LINE>orderLine.setPriceLimitNote(buildPriceLimitNote(pricingResult.getEnforcePriceLimit()));<NEW_LINE>updateOrderLineFromPricingConditionsResult(orderLine, pricingResult.getPricingConditions());<NEW_LINE>//<NEW_LINE>//<NEW_LINE>if (request.isUpdateLineNetAmt()) {<NEW_LINE>if (request.getQtyOverride() != null) {<NEW_LINE>orderLineBL.updateLineNetAmtFromQty(request.getQtyOverride(), orderLine);<NEW_LINE>} else {<NEW_LINE>orderLineBL.updateLineNetAmtFromQty(orderLineBL.getQtyEntered(orderLine), orderLine);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (request.isUpdateProfitPriceActual()) {<NEW_LINE>updateProfitPriceActual(orderLine);<NEW_LINE>}<NEW_LINE>}
pricingResult = pricingBL.calculatePrice(pricingCtx);
1,628,323
public static WritableArray convertJsonToArray(JSONArray jsonArray) throws JSONException {<NEW_LINE>WritableArray array = new WritableNativeArray();<NEW_LINE>for (int i = 0; i < jsonArray.length(); i++) {<NEW_LINE>Object value = jsonArray.get(i);<NEW_LINE>if (value instanceof JSONObject) {<NEW_LINE>array.pushMap(jsonToMap((JSONObject) value));<NEW_LINE>} else if (value instanceof JSONArray) {<NEW_LINE>array.pushArray(convertJsonToArray((JSONArray) value));<NEW_LINE>} else if (value instanceof Boolean) {<NEW_LINE>array.pushBoolean((Boolean) value);<NEW_LINE>} else if (value instanceof Integer) {<NEW_LINE>array.pushInt((Integer) value);<NEW_LINE>} else if (value instanceof Double) {<NEW_LINE>array<MASK><NEW_LINE>} else if (value instanceof String) {<NEW_LINE>array.pushString((String) value);<NEW_LINE>} else {<NEW_LINE>array.pushString(value.toString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return array;<NEW_LINE>}
.pushDouble((Double) value);
1,632,884
public JsonNode postQuery(String dialect, String query, Map<String, String> headers) throws Exception {<NEW_LINE>ObjectNode requestJson = JsonUtils.newObjectNode();<NEW_LINE>requestJson.put(dialect, query);<NEW_LINE>long start = System.currentTimeMillis();<NEW_LINE>String queryUrl = _brokerBaseApiUrl + "/query";<NEW_LINE>if (!"pql".equals(dialect)) {<NEW_LINE>queryUrl = _brokerBaseApiUrl + "/query/" + dialect;<NEW_LINE>}<NEW_LINE>URLConnection conn = new URL(queryUrl).openConnection();<NEW_LINE>conn.setDoOutput(true);<NEW_LINE>for (Map.Entry<String, String> header : headers.entrySet()) {<NEW_LINE>conn.setRequestProperty(header.getKey(), header.getValue());<NEW_LINE>}<NEW_LINE>try (BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(conn.getOutputStream(), StandardCharsets.UTF_8))) {<NEW_LINE>String requestString = requestJson.toString();<NEW_LINE>writer.write(requestString);<NEW_LINE>writer.flush();<NEW_LINE>try {<NEW_LINE>StringBuilder stringBuilder = new StringBuilder();<NEW_LINE>try (BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream(), StandardCharsets.UTF_8))) {<NEW_LINE>String line;<NEW_LINE>while ((line = reader.readLine()) != null) {<NEW_LINE>stringBuilder.append(line);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>long totalTime = System.currentTimeMillis() - start;<NEW_LINE>String responseString = stringBuilder.toString();<NEW_LINE>ObjectNode responseJson = (ObjectNode) JsonUtils.stringToJsonNode(responseString);<NEW_LINE>responseJson.put("totalTime", totalTime);<NEW_LINE>if (_verbose) {<NEW_LINE>if (!responseJson.has("exceptions") || responseJson.get("exceptions").size() <= 0) {<NEW_LINE>LOGGER.info("requestString: {}", requestString);<NEW_LINE>LOGGER.info("responseString: {}", responseString);<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>LOGGER.error("responseString: {}", responseString);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return responseJson;<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.error("requestString: {}", requestString);<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
LOGGER.error("requestString: {}", requestString);
1,190,216
public void execute() {<NEW_LINE>Map<String, Object> capabilities = _mgr.listCapabilities(this);<NEW_LINE>CapabilitiesResponse response = new CapabilitiesResponse();<NEW_LINE>response.setSecurityGroupsEnabled((Boolean) capabilities.get("securityGroupsEnabled"));<NEW_LINE>response.setDynamicRolesEnabled(roleService.isEnabled());<NEW_LINE>response.setCloudStackVersion((String) capabilities.get("cloudStackVersion"));<NEW_LINE>response.setUserPublicTemplateEnabled((Boolean) capabilities.get("userPublicTemplateEnabled"));<NEW_LINE>response.setSupportELB((String) capabilities.get("supportELB"));<NEW_LINE>response.setProjectInviteRequired((Boolean) capabilities.get("projectInviteRequired"));<NEW_LINE>response.setAllowUsersCreateProjects((Boolean) capabilities.get("allowusercreateprojects"));<NEW_LINE>response.setDiskOffMinSize((Long) capabilities.get("customDiskOffMinSize"));<NEW_LINE>response.setDiskOffMaxSize((Long) capabilities.get("customDiskOffMaxSize"));<NEW_LINE>response.setRegionSecondaryEnabled((Boolean) capabilities.get("regionSecondaryEnabled"));<NEW_LINE>response.setKVMSnapshotEnabled((Boolean) capabilities.get("KVMSnapshotEnabled"));<NEW_LINE>response.setAllowUserViewDestroyedVM((Boolean) capabilities.get("allowUserViewDestroyedVM"));<NEW_LINE>response.setAllowUserExpungeRecoverVM((Boolean) capabilities.get("allowUserExpungeRecoverVM"));<NEW_LINE>response.setAllowUserExpungeRecoverVolume((Boolean) capabilities.get("allowUserExpungeRecoverVolume"));<NEW_LINE>response.setAllowUserViewAllDomainAccounts((Boolean) capabilities.get("allowUserViewAllDomainAccounts"));<NEW_LINE>response.setKubernetesServiceEnabled((Boolean) capabilities.get("kubernetesServiceEnabled"));<NEW_LINE>response.setKubernetesClusterExperimentalFeaturesEnabled((Boolean<MASK><NEW_LINE>if (capabilities.containsKey("apiLimitInterval")) {<NEW_LINE>response.setApiLimitInterval((Integer) capabilities.get("apiLimitInterval"));<NEW_LINE>}<NEW_LINE>if (capabilities.containsKey("apiLimitMax")) {<NEW_LINE>response.setApiLimitMax((Integer) capabilities.get("apiLimitMax"));<NEW_LINE>}<NEW_LINE>response.setDefaultUiPageSize((Long) capabilities.get(ApiServiceConfiguration.DefaultUIPageSize.key()));<NEW_LINE>response.setObjectName("capability");<NEW_LINE>response.setResponseName(getCommandName());<NEW_LINE>this.setResponseObject(response);<NEW_LINE>}
) capabilities.get("kubernetesClusterExperimentalFeaturesEnabled"));
1,777,021
public List<ReportReloadEntity> loadReport(long time) {<NEW_LINE>List<ReportReloadEntity> results = new ArrayList<ReportReloadEntity>();<NEW_LINE>Map<String, List<BusinessReport>> mergedReports = new HashMap<String, List<BusinessReport>>();<NEW_LINE>for (int i = 0; i < getAnalyzerCount(); i++) {<NEW_LINE>Map<String, BusinessReport> reports = m_reportManager.loadLocalReports(time, i);<NEW_LINE>for (Entry<String, BusinessReport> entry : reports.entrySet()) {<NEW_LINE>String domain = entry.getKey();<NEW_LINE>BusinessReport r = entry.getValue();<NEW_LINE>List<BusinessReport> rs = mergedReports.get(domain);<NEW_LINE>if (rs == null) {<NEW_LINE>rs = new ArrayList<BusinessReport>();<NEW_LINE>mergedReports.put(domain, rs);<NEW_LINE>}<NEW_LINE>rs.add(r);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<<MASK><NEW_LINE>for (BusinessReport r : reports) {<NEW_LINE>HourlyReport report = new HourlyReport();<NEW_LINE>report.setCreationDate(new Date());<NEW_LINE>report.setDomain(r.getDomain());<NEW_LINE>report.setIp(NetworkInterfaceManager.INSTANCE.getLocalHostAddress());<NEW_LINE>report.setName(getId());<NEW_LINE>report.setPeriod(new Date(time));<NEW_LINE>report.setType(1);<NEW_LINE>byte[] content = DefaultNativeBuilder.build(r);<NEW_LINE>ReportReloadEntity entity = new ReportReloadEntity(report, content);<NEW_LINE>results.add(entity);<NEW_LINE>}<NEW_LINE>return results;<NEW_LINE>}
BusinessReport> reports = buildMergedReports(mergedReports);
1,350,291
private void updateFiles() {<NEW_LINE>_widgetFilesList = (_dir == null) ? new File[0] : _dir.listFiles(file -> !file.isDirectory() && TextFormat.isTextFile(file));<NEW_LINE>if (_dir != null && _dir.equals(FilesystemViewerAdapter.VIRTUAL_STORAGE_RECENTS)) {<NEW_LINE>_widgetFilesList = FilesystemViewerCreator.strlistToArray(AppSettings.get().getRecentDocuments());<NEW_LINE>}<NEW_LINE>if (_dir != null && _dir.equals(FilesystemViewerAdapter.VIRTUAL_STORAGE_POPULAR)) {<NEW_LINE>_widgetFilesList = FilesystemViewerCreator.strlistToArray(AppSettings.get().getPopularDocuments());<NEW_LINE>}<NEW_LINE>final ArrayList<File> files = new ArrayList<>(Arrays.asList(_widgetFilesList != null ? _widgetFilesList <MASK><NEW_LINE>// noinspection StatementWithEmptyBody<NEW_LINE>if (_dir != null && (_dir.equals(FilesystemViewerAdapter.VIRTUAL_STORAGE_RECENTS) || _dir.equals(FilesystemViewerAdapter.VIRTUAL_STORAGE_POPULAR))) {<NEW_LINE>// nothing to do<NEW_LINE>} else {<NEW_LINE>FilesystemViewerFragment.sortFolder(files);<NEW_LINE>}<NEW_LINE>_widgetFilesList = files.toArray(new File[files.size()]);<NEW_LINE>}
: new File[0]));
1,208,246
private void performTrackMaintenance(Se3_F64 key_to_curr) {<NEW_LINE>// Drop tracks which do not have known locations in the new frame<NEW_LINE>for (int quadIdx = trackQuads.size - 1; quadIdx >= 0; quadIdx--) {<NEW_LINE>TrackQuad quad = trackQuads.get(quadIdx);<NEW_LINE>if (quad.leftCurrIndex == -1) {<NEW_LINE>trackQuads.removeSwap(quadIdx);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// Convert the coordinate system from the old left to the new left camera<NEW_LINE>SePointOps_F64.transform(key_to_curr, quad.X, quad.X);<NEW_LINE>// If it's now behind the camera and can't be seen drop the track<NEW_LINE>if (quad.X.z <= 0.0) {<NEW_LINE>trackQuads.removeSwap(quadIdx);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Create a lookup table from feature index to track index<NEW_LINE>keyToTrackIdx.<MASK><NEW_LINE>keyToTrackIdx.fill(-1);<NEW_LINE>for (int quadIdx = 0; quadIdx < trackQuads.size; quadIdx++) {<NEW_LINE>TrackQuad quad = trackQuads.get(quadIdx);<NEW_LINE>keyToTrackIdx.data[quad.leftCurrIndex] = quadIdx;<NEW_LINE>}<NEW_LINE>}
resize(featsLeft1.locationPixels.size);
1,357,939
private static void createTF_RunState(Menu menu, Tag tag) {<NEW_LINE>final TagFeatureRunState tf_run_state = (TagFeatureRunState) tag;<NEW_LINE>int caps = tf_run_state.getRunStateCapabilities();<NEW_LINE>int[] op_set = { TagFeatureRunState.RSC_START, TagFeatureRunState.RSC_STOP, TagFeatureRunState.RSC_PAUSE, TagFeatureRunState.RSC_RESUME };<NEW_LINE>boolean[] can_ops_set = tf_run_state.getPerformableOperations(op_set);<NEW_LINE>if ((caps & TagFeatureRunState.RSC_START) != 0) {<NEW_LINE>final MenuItem itemOp = new MenuItem(menu, SWT.PUSH);<NEW_LINE>Messages.setLanguageText(itemOp, "MyTorrentsView.menu.queue");<NEW_LINE>Utils.setMenuItemImage(itemOp, "start");<NEW_LINE>itemOp.addListener(SWT.Selection, new Listener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void handleEvent(Event event) {<NEW_LINE>tf_run_state.performOperation(TagFeatureRunState.RSC_START);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>itemOp.setEnabled(can_ops_set[0]);<NEW_LINE>}<NEW_LINE>if ((caps & TagFeatureRunState.RSC_STOP) != 0) {<NEW_LINE>final MenuItem itemOp = new MenuItem(menu, SWT.PUSH);<NEW_LINE>Messages.setLanguageText(itemOp, "MyTorrentsView.menu.stop");<NEW_LINE>Utils.setMenuItemImage(itemOp, "stop");<NEW_LINE>itemOp.addListener(SWT.Selection, new Listener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void handleEvent(Event event) {<NEW_LINE>tf_run_state.performOperation(TagFeatureRunState.RSC_STOP);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>itemOp.setEnabled(can_ops_set[1]);<NEW_LINE>}<NEW_LINE>if ((caps & TagFeatureRunState.RSC_PAUSE) != 0) {<NEW_LINE>final MenuItem itemOp = new MenuItem(menu, SWT.PUSH);<NEW_LINE>Messages.setLanguageText(itemOp, "v3.MainWindow.button.pause");<NEW_LINE>Utils.setMenuItemImage(itemOp, "pause");<NEW_LINE>itemOp.addListener(SWT.Selection, new Listener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void handleEvent(Event event) {<NEW_LINE>tf_run_state.performOperation(TagFeatureRunState.RSC_PAUSE);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>itemOp.setEnabled(can_ops_set[2]);<NEW_LINE>}<NEW_LINE>if ((caps & TagFeatureRunState.RSC_RESUME) != 0) {<NEW_LINE>final MenuItem itemOp = new MenuItem(menu, SWT.PUSH);<NEW_LINE>Messages.setLanguageText(itemOp, "v3.MainWindow.button.resume");<NEW_LINE>Utils.setMenuItemImage(itemOp, "start");<NEW_LINE>itemOp.addListener(SWT.Selection, new Listener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void handleEvent(Event event) {<NEW_LINE>tf_run_state.performOperation(TagFeatureRunState.RSC_RESUME);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>itemOp<MASK><NEW_LINE>}<NEW_LINE>}
.setEnabled(can_ops_set[3]);
131,962
public static void main(String[] args) throws IOException, NoSuchAlgorithmException {<NEW_LINE>Regions clientRegion = Regions.DEFAULT_REGION;<NEW_LINE>String bucketName = "*** Bucket name ***";<NEW_LINE>String keyName = "*** Key name ***";<NEW_LINE>String uploadFileName = "*** File path ***";<NEW_LINE>String targetKeyName = "*** Target key name ***";<NEW_LINE>// Create an encryption key.<NEW_LINE>KEY_GENERATOR = KeyGenerator.getInstance("AES");<NEW_LINE>KEY_GENERATOR.init(256, new SecureRandom());<NEW_LINE>SSE_KEY = new SSECustomerKey(KEY_GENERATOR.generateKey());<NEW_LINE>try {<NEW_LINE>S3_CLIENT = AmazonS3ClientBuilder.standard().withCredentials(new ProfileCredentialsProvider()).withRegion(clientRegion).build();<NEW_LINE>// Upload an object.<NEW_LINE>uploadObject(bucketName, keyName, new File(uploadFileName));<NEW_LINE>// Download the object.<NEW_LINE>downloadObject(bucketName, keyName);<NEW_LINE>// Verify that the object is properly encrypted by attempting to retrieve it<NEW_LINE>// using the encryption key.<NEW_LINE>retrieveObjectMetadata(bucketName, keyName);<NEW_LINE>// Copy the object into a new object that also uses SSE-C.<NEW_LINE><MASK><NEW_LINE>} catch (AmazonServiceException e) {<NEW_LINE>// The call was transmitted successfully, but Amazon S3 couldn't process<NEW_LINE>// it, so it returned an error response.<NEW_LINE>e.printStackTrace();<NEW_LINE>} catch (SdkClientException e) {<NEW_LINE>// Amazon S3 couldn't be contacted for a response, or the client<NEW_LINE>// couldn't parse the response from Amazon S3.<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}
copyObject(bucketName, keyName, targetKeyName);
742,106
public void updateAround(int x, int y, int z) {<NEW_LINE>BlockUpdateEvent ev;<NEW_LINE>this.server.getPluginManager().callEvent(ev = new BlockUpdateEvent(this.getBlock(x, y - 1, z)));<NEW_LINE>if (!ev.isCancelled()) {<NEW_LINE>ev.getBlock().onUpdate(BLOCK_UPDATE_NORMAL);<NEW_LINE>}<NEW_LINE>this.server.getPluginManager().callEvent(ev = new BlockUpdateEvent(this.getBlock(x, y + 1, z)));<NEW_LINE>if (!ev.isCancelled()) {<NEW_LINE>ev.getBlock().onUpdate(BLOCK_UPDATE_NORMAL);<NEW_LINE>}<NEW_LINE>this.server.getPluginManager().callEvent(ev = new BlockUpdateEvent(this.getBlock(x - <MASK><NEW_LINE>if (!ev.isCancelled()) {<NEW_LINE>ev.getBlock().onUpdate(BLOCK_UPDATE_NORMAL);<NEW_LINE>}<NEW_LINE>this.server.getPluginManager().callEvent(ev = new BlockUpdateEvent(this.getBlock(x + 1, y, z)));<NEW_LINE>if (!ev.isCancelled()) {<NEW_LINE>ev.getBlock().onUpdate(BLOCK_UPDATE_NORMAL);<NEW_LINE>}<NEW_LINE>this.server.getPluginManager().callEvent(ev = new BlockUpdateEvent(this.getBlock(x, y, z - 1)));<NEW_LINE>if (!ev.isCancelled()) {<NEW_LINE>ev.getBlock().onUpdate(BLOCK_UPDATE_NORMAL);<NEW_LINE>}<NEW_LINE>this.server.getPluginManager().callEvent(ev = new BlockUpdateEvent(this.getBlock(x, y, z + 1)));<NEW_LINE>if (!ev.isCancelled()) {<NEW_LINE>ev.getBlock().onUpdate(BLOCK_UPDATE_NORMAL);<NEW_LINE>}<NEW_LINE>}
1, y, z)));
1,855,495
final DescribeForecastResult executeDescribeForecast(DescribeForecastRequest describeForecastRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeForecastRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeForecastRequest> request = null;<NEW_LINE>Response<DescribeForecastResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeForecastRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeForecastRequest));<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, "forecast");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeForecast");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeForecastResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeForecastResultJsonUnmarshaller());<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,734,425
public boolean apply(Game game, Ability source) {<NEW_LINE>Player player = game.getPlayer(source.getControllerId());<NEW_LINE>if (player == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>List<Permanent> permanents = game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source, game);<NEW_LINE>int count = permanents.size();<NEW_LINE>player.shuffleCardsToLibrary(new CardsImpl(permanents), game, source);<NEW_LINE>Cards cards = new CardsImpl(player.getLibrary().getTopCards(game, count));<NEW_LINE>player.revealCards(source, cards, game);<NEW_LINE>Cards toBattlefield = new CardsImpl(cards.getCards(StaticFilters.FILTER_CARD_PERMANENT, game));<NEW_LINE>toBattlefield.removeIf(uuid -> game.getCard(uuid).hasSubtype(SubType.AURA, game));<NEW_LINE>player.moveCards(toBattlefield, Zone.BATTLEFIELD, source, game);<NEW_LINE>toBattlefield.clear();<NEW_LINE>cards.retainZone(Zone.LIBRARY, game);<NEW_LINE>toBattlefield.addAll(cards.getCards(StaticFilters.FILTER_CARD_PERMANENT, game));<NEW_LINE>toBattlefield.removeIf(uuid -> !game.getCard(uuid).hasSubtype<MASK><NEW_LINE>player.moveCards(toBattlefield, Zone.BATTLEFIELD, source, game);<NEW_LINE>cards.retainZone(Zone.LIBRARY, game);<NEW_LINE>player.putCardsOnBottomOfLibrary(cards, game, source, false);<NEW_LINE>return true;<NEW_LINE>}
(SubType.AURA, game));
1,486,442
public static void checkIteratorConflicts(Map<String, String> props, IteratorSetting setting, EnumSet<IteratorScope> scopes) throws AccumuloException {<NEW_LINE>checkArgument(setting != null, "setting is null");<NEW_LINE>checkArgument(scopes != null, "scopes is null");<NEW_LINE>for (IteratorScope scope : scopes) {<NEW_LINE>String scopeStr = String.format("%s%s", Property.TABLE_ITERATOR_PREFIX, scope.name().toLowerCase());<NEW_LINE>String nameStr = String.format("%s.%s", scopeStr, setting.getName());<NEW_LINE>String optStr = String.format("%s.opt.", nameStr);<NEW_LINE>Map<String, String> optionConflicts = new TreeMap<>();<NEW_LINE>for (Entry<String, String> property : props.entrySet()) {<NEW_LINE>if (property.getKey().startsWith(scopeStr)) {<NEW_LINE>if (property.getKey().equals(nameStr))<NEW_LINE>throw new AccumuloException(new IllegalArgumentException("iterator name conflict for " + setting.getName() + ": " + property.getKey() + "=" + property.getValue()));<NEW_LINE>if (property.getKey().startsWith(optStr))<NEW_LINE>optionConflicts.put(property.getKey(), property.getValue());<NEW_LINE>if (property.getKey().contains(".opt."))<NEW_LINE>continue;<NEW_LINE>String[] parts = property.getValue().split(",");<NEW_LINE>if (parts.length != 2)<NEW_LINE>throw new AccumuloException("Bad value for existing iterator setting: " + property.getKey() + "=" + property.getValue());<NEW_LINE>try {<NEW_LINE>if (Integer.parseInt(parts[0]) == setting.getPriority())<NEW_LINE>throw new AccumuloException(new IllegalArgumentException("iterator priority conflict: " + property.getKey() + "=" + property.getValue()));<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>throw new AccumuloException("Bad value for existing iterator setting: " + property.getKey() + "=" + property.getValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!optionConflicts.isEmpty())<NEW_LINE>throw new AccumuloException(new IllegalArgumentException("iterator options conflict for " + setting.getName<MASK><NEW_LINE>}<NEW_LINE>}
() + ": " + optionConflicts));
132,964
protected StringBuffer print(StringBuffer output) {<NEW_LINE>if (this.findDeclarations) {<NEW_LINE>output.append(// $NON-NLS-1$<NEW_LINE>this.findReferences ? // $NON-NLS-1$<NEW_LINE>"FieldCombinedPattern: " : "FieldDeclarationPattern: ");<NEW_LINE>} else {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>output.append("FieldReferencePattern: ");<NEW_LINE>}<NEW_LINE>if (this.declaringQualification != null)<NEW_LINE>output.append(this.declaringQualification).append('.');<NEW_LINE>if (this.declaringSimpleName != null)<NEW_LINE>output.append(this.declaringSimpleName).append('.');<NEW_LINE>else // $NON-NLS-1$<NEW_LINE>if (this.declaringQualification != null)<NEW_LINE>output.append("*.");<NEW_LINE>if (this.name == null) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>output.append("*");<NEW_LINE>} else {<NEW_LINE>output.append(this.name);<NEW_LINE>}<NEW_LINE>if (this.typeQualification != null)<NEW_LINE>// $NON-NLS-1$<NEW_LINE>output.append(" --> ").append(this.typeQualification).append('.');<NEW_LINE>else // $NON-NLS-1$<NEW_LINE>if (this.typeSimpleName != null)<NEW_LINE>output.append(" --> ");<NEW_LINE>if (this.typeSimpleName != null)<NEW_LINE><MASK><NEW_LINE>else // $NON-NLS-1$<NEW_LINE>if (this.typeQualification != null)<NEW_LINE>output.append("*");<NEW_LINE>return super.print(output);<NEW_LINE>}
output.append(this.typeSimpleName);
452,492
public void run(RegressionEnvironment env) {<NEW_LINE>String[] fields = "a_string,b_string,c_string,d_string".split(",");<NEW_LINE>String text = "@name('s0') select * from SupportRecogBean#keepall " + "match_recognize (" + " measures A.theString as a_string, B.theString as b_string, C.theString as c_string, D.theString as d_string " + " all matches pattern ( (A | B) (C | D) ) " + " define " + " A as (A.value = 1)," + " B as (B.value = 2)," + " C as (C.value = 3)," + " D as (D.value = 4)" + ")";<NEW_LINE>env.compileDeploy(text).addListener("s0");<NEW_LINE>env.sendEventBean(new SupportRecogBean("E1", 3));<NEW_LINE>env.sendEventBean(new SupportRecogBean("E2", 1));<NEW_LINE>env.sendEventBean(new SupportRecogBean("E3", 2));<NEW_LINE>env.sendEventBean(new SupportRecogBean("E4", 5));<NEW_LINE>env.sendEventBean(new SupportRecogBean("E5", 1));<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>env.assertIterator("s0", it -> assertFalse<MASK><NEW_LINE>env.milestone(0);<NEW_LINE>env.sendEventBean(new SupportRecogBean("E6", 3));<NEW_LINE>env.assertPropsPerRowLastNew("s0", fields, new Object[][] { { "E5", null, "E6", null } });<NEW_LINE>env.assertPropsPerRowIterator("s0", fields, new Object[][] { { "E5", null, "E6", null } });<NEW_LINE>env.milestone(1);<NEW_LINE>env.sendEventBean(new SupportRecogBean("E7", 2));<NEW_LINE>env.sendEventBean(new SupportRecogBean("E8", 3));<NEW_LINE>env.assertPropsPerRowLastNew("s0", fields, new Object[][] { { null, "E7", "E8", null } });<NEW_LINE>env.assertPropsPerRowIterator("s0", fields, new Object[][] { { "E5", null, "E6", null }, { null, "E7", "E8", null } });<NEW_LINE>env.undeployAll();<NEW_LINE>}
(it.hasNext()));
1,739,345
static SortedSet<Filter> flatten(final Collection<Filter> filters) {<NEW_LINE>final SortedSet<Filter> result = new TreeSet<>();<NEW_LINE>filters.stream().flatMap(f -> f.optimize().visit(new Filter.Visitor<Stream<Filter>>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Stream<Filter> visitAnd(final AndFilter and) {<NEW_LINE>return and.terms().stream(<MASK><NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Stream<Filter> visitNot(final NotFilter not) {<NEW_LINE>// check for De Morgan's<NEW_LINE>return not.filter().visit(new Filter.Visitor<Stream<Filter>>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Stream<Filter> visitOr(final OrFilter or) {<NEW_LINE>return or.terms().stream().map(f -> NotFilter.of(f).optimize());<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Stream<Filter> defaultAction(final Filter filter) {<NEW_LINE>return Stream.of(not.optimize());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Stream<Filter> defaultAction(final Filter filter) {<NEW_LINE>return Stream.of(filter.optimize());<NEW_LINE>}<NEW_LINE>})).forEach(result::add);<NEW_LINE>return result;<NEW_LINE>}
).map(Filter::optimize);
614,085
public JComponent buildComponent() {<NEW_LINE>JPanel result = new JPanel(new BorderLayout());<NEW_LINE>result.add(myChooserImpl, BorderLayout.CENTER);<NEW_LINE>JPanel southPanel = new JPanel(new BorderLayout());<NEW_LINE>southPanel.add(new JLabel("Recent colors"), BorderLayout.WEST);<NEW_LINE>Box colorLabels = Box.createHorizontalBox();<NEW_LINE>for (final Color c : myRecentColors) {<NEW_LINE>final JXLabel label = new JXLabel();<NEW_LINE>label.setBackgroundPainter(new Painter<JXLabel>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void paint(Graphics2D g, JXLabel object, int width, int height) {<NEW_LINE>g.setColor(c);<NEW_LINE>g.fillRect(4, 4, width - 8, height - 8);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>label.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));<NEW_LINE>label.setFocusable(true);<NEW_LINE>label.setPreferredSize(new Dimension(20, 20));<NEW_LINE>label.setMaximumSize(new Dimension(20, 20));<NEW_LINE>final Border outsideFocusBorder = BorderFactory.createLineBorder(c.darker(), 2);<NEW_LINE>final Border outsideNoFocusBorder = BorderFactory.createEmptyBorder(<MASK><NEW_LINE>label.setBorder(outsideNoFocusBorder);<NEW_LINE>label.addFocusListener(new FocusAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void focusGained(FocusEvent e) {<NEW_LINE>label.setBorder(outsideFocusBorder);<NEW_LINE>myChooserImpl.setColor(c);<NEW_LINE>mySelectedColor = c;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void focusLost(FocusEvent e) {<NEW_LINE>label.setBorder(outsideNoFocusBorder);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>label.addMouseListener(new MouseAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void mouseClicked(MouseEvent e) {<NEW_LINE>label.requestFocus();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>colorLabels.add(label);<NEW_LINE>colorLabels.add(Box.createHorizontalStrut(5));<NEW_LINE>}<NEW_LINE>colorLabels.setBorder(BorderFactory.createEmptyBorder(0, 7, 0, 0));<NEW_LINE>southPanel.add(colorLabels, BorderLayout.CENTER);<NEW_LINE>southPanel.setBorder(BorderFactory.createEmptyBorder(10, 5, 5, 5));<NEW_LINE>result.add(southPanel, BorderLayout.SOUTH);<NEW_LINE>return result;<NEW_LINE>}
2, 2, 2, 2);
1,174,116
private static boolean visitChangesSince(Map<String, FileSystemLocationFingerprint> previousFingerprints, Map<String, FileSystemLocationFingerprint> currentFingerprints, String propertyTitle, ChangeVisitor visitor) {<NEW_LINE>ListMultimap<FileSystemLocationFingerprint, FilePathWithType> unaccountedForPreviousFiles = getUnaccountedForPreviousFingerprints(previousFingerprints, currentFingerprints.entrySet());<NEW_LINE>ListMultimap<String, FilePathWithType> addedFilesByNormalizedPath = getAddedFilesByNormalizedPath(currentFingerprints, unaccountedForPreviousFiles, previousFingerprints.entrySet());<NEW_LINE>Iterator<Entry<FileSystemLocationFingerprint, FilePathWithType>> iterator = unaccountedForPreviousFiles.entries().stream().sorted(comparingByKey()).iterator();<NEW_LINE>while (iterator.hasNext()) {<NEW_LINE>Entry<FileSystemLocationFingerprint, FilePathWithType> entry = iterator.next();<NEW_LINE>FileSystemLocationFingerprint previousFingerprint = entry.getKey();<NEW_LINE>FilePathWithType pathWithType = entry.getValue();<NEW_LINE>Change change = getChange(propertyTitle, addedFilesByNormalizedPath, previousFingerprint, pathWithType);<NEW_LINE>if (!visitor.visitChange(change)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (Entry<String, FilePathWithType> entry : addedFilesByNormalizedPath.entries()) {<NEW_LINE>Change <MASK><NEW_LINE>if (!visitor.visitChange(added)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
added = added(propertyTitle, entry);
1,680,828
public boolean blockLocation(Location location) {<NEW_LINE>final float inaccuracy = location.getAccuracy();<NEW_LINE>final double altitude = location.getAltitude();<NEW_LINE>final float bearing = location.getBearing();<NEW_LINE>final double latitude = location.getLatitude();<NEW_LINE>final double longitude = location.getLongitude();<NEW_LINE>final float speed = location.getSpeed();<NEW_LINE>final long timestamp = location.getTime();<NEW_LINE>final long tomorrow = System.currentTimeMillis() + MILLISECONDS_PER_DAY;<NEW_LINE>boolean block = false;<NEW_LINE>if (latitude == 0 && longitude == 0) {<NEW_LINE>block = true;<NEW_LINE>Log.w(LOG_TAG, "Bogus latitude,longitude: 0,0");<NEW_LINE>} else {<NEW_LINE>if (latitude < -90 || latitude > 90) {<NEW_LINE>block = true;<NEW_LINE>Log.w(LOG_TAG, "Bogus latitude: " + latitude);<NEW_LINE>}<NEW_LINE>if (longitude < -180 || longitude > 180) {<NEW_LINE>block = true;<NEW_LINE>Log.w(LOG_TAG, "Bogus longitude: " + longitude);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (location.hasAccuracy() && (inaccuracy < 0 || inaccuracy > MIN_ACCURACY)) {<NEW_LINE>block = true;<NEW_LINE>Log.w(<MASK><NEW_LINE>}<NEW_LINE>if (location.hasAltitude() && (altitude < MIN_ALTITUDE || altitude > MAX_ALTITUDE)) {<NEW_LINE>block = true;<NEW_LINE>Log.w(LOG_TAG, "Bogus altitude: " + altitude + " meters");<NEW_LINE>}<NEW_LINE>if (location.hasBearing() && (bearing < 0 || bearing > 360)) {<NEW_LINE>block = true;<NEW_LINE>Log.w(LOG_TAG, "Bogus bearing: " + bearing + " degrees");<NEW_LINE>}<NEW_LINE>if (location.hasSpeed() && (speed < 0 || speed > MAX_SPEED)) {<NEW_LINE>block = true;<NEW_LINE>Log.w(LOG_TAG, "Bogus speed: " + speed + " meters/second");<NEW_LINE>}<NEW_LINE>if (timestamp < MIN_TIMESTAMP || timestamp > tomorrow) {<NEW_LINE>block = true;<NEW_LINE>Log.w(LOG_TAG, "Bogus timestamp: " + timestamp);<NEW_LINE>}<NEW_LINE>return block;<NEW_LINE>}
LOG_TAG, "Insufficient accuracy: " + inaccuracy + " meters");
332,128
static WebServer startServer() {<NEW_LINE>// load logging configuration<NEW_LINE>LogConfig.configureRuntime();<NEW_LINE>// By default this will pick up application.yaml from the classpath<NEW_LINE>Config config = Config.create();<NEW_LINE>WebServer server = WebServer.builder(createRouting(config)).config(config.get("server")).tracer(TracerBuilder.create("mongo-db").build()).addMediaSupport(JsonpSupport.create()).addMediaSupport(JsonbSupport.create()).build();<NEW_LINE>// Start the server and print some info.<NEW_LINE>server.start().thenAccept(ws -> {<NEW_LINE>System.out.println("WEB server is up! http://localhost:" + <MASK><NEW_LINE>});<NEW_LINE>// Server threads are not daemon. NO need to block. Just react.<NEW_LINE>server.whenShutdown().thenRun(() -> System.out.println("WEB server is DOWN. Good bye!"));<NEW_LINE>return server;<NEW_LINE>}
ws.port() + "/");
1,672,540
public UpdateCallAnalyticsCategoryResult updateCallAnalyticsCategory(UpdateCallAnalyticsCategoryRequest updateCallAnalyticsCategoryRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateCallAnalyticsCategoryRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateCallAnalyticsCategoryRequest> request = null;<NEW_LINE>Response<UpdateCallAnalyticsCategoryResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateCallAnalyticsCategoryRequestMarshaller().marshall(updateCallAnalyticsCategoryRequest);<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>Unmarshaller<UpdateCallAnalyticsCategoryResult, JsonUnmarshallerContext> unmarshaller = new UpdateCallAnalyticsCategoryResultJsonUnmarshaller();<NEW_LINE>JsonResponseHandler<UpdateCallAnalyticsCategoryResult> responseHandler = new JsonResponseHandler<UpdateCallAnalyticsCategoryResult>(unmarshaller);<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.ClientExecuteTime);<NEW_LINE>endClientExecution(<MASK><NEW_LINE>}<NEW_LINE>}
awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);
1,143,703
private void execFindbugs() throws BuildException {<NEW_LINE>System.out.println("Executing findbugs " + this.getClass().getSimpleName() + " from ant task");<NEW_LINE>createFindbugsEngine();<NEW_LINE>configureFindbugsEngine();<NEW_LINE>beforeExecuteJavaProcess();<NEW_LINE>if (getDebug()) {<NEW_LINE>log(getFindbugsEngine().getCommandLine().describeCommand());<NEW_LINE>}<NEW_LINE>String execReturnCodeIdentifier = execResultProperty + "." + UUID.randomUUID().toString();<NEW_LINE>getFindbugsEngine().setResultProperty(execReturnCodeIdentifier);<NEW_LINE>getFindbugsEngine().setFailonerror(false);<NEW_LINE>try {<NEW_LINE>getFindbugsEngine().execute();<NEW_LINE>} catch (BuildException be) {<NEW_LINE>// setFailonerror(false) should ensure that this doesn't happen,<NEW_LINE>// but...<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>String returnProperty = getFindbugsEngine().getProject().getProperty(execReturnCodeIdentifier);<NEW_LINE>int rc = returnProperty == null ? 0 : Integer.parseInt(returnProperty);<NEW_LINE>afterExecuteJavaProcess(rc);<NEW_LINE>}
log(be.toString());
465,653
public static void registerType(ModelBuilder modelBuilder) {<NEW_LINE>ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(CaseFileItemDefinition.class, CMMN_ELEMENT_CASE_FILE_ITEM_DEFINITION).namespaceUri(CMMN11_NS).extendsType(CmmnElement.class).instanceProvider(new ModelTypeInstanceProvider<CaseFileItemDefinition>() {<NEW_LINE><NEW_LINE>public CaseFileItemDefinition newInstance(ModelTypeInstanceContext instanceContext) {<NEW_LINE>return new CaseFileItemDefinitionImpl(instanceContext);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>nameAttribute = typeBuilder.<MASK><NEW_LINE>definitionTypeAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_DEFINITION_TYPE).defaultValue("http://www.omg.org/spec/CMMN/DefinitionType/Unspecified").build();<NEW_LINE>structureAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_STRUCTURE_REF).build();<NEW_LINE>// TODO: The Import does not have an id attribute!<NEW_LINE>// importRefAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_IMPORT_REF)<NEW_LINE>// .qNameAttributeReference(Import.class)<NEW_LINE>// .build();<NEW_LINE>SequenceBuilder sequenceBuilder = typeBuilder.sequence();<NEW_LINE>propertyCollection = sequenceBuilder.elementCollection(Property.class).build();<NEW_LINE>typeBuilder.build();<NEW_LINE>}
stringAttribute(CMMN_ATTRIBUTE_NAME).build();
748,800
public void removeEntry(AclEntry entry) {<NEW_LINE>switch(entry.getType()) {<NEW_LINE>case NAMED_USER:<NEW_LINE>case NAMED_GROUP:<NEW_LINE>case MASK:<NEW_LINE>super.removeEntry(entry);<NEW_LINE>return;<NEW_LINE>case OWNING_USER:<NEW_LINE>Mode modeOwner = new Mode(mMode);<NEW_LINE>modeOwner.setOwnerBits(Mode.Bits.NONE);<NEW_LINE>if (mAccessAcl != null) {<NEW_LINE>// overwrite the owner actions from the access ACL.<NEW_LINE>modeOwner.setOwnerBits(new Mode(mAccessAcl.mMode).getOwnerBits());<NEW_LINE>}<NEW_LINE>mMode = modeOwner.toShort();<NEW_LINE>return;<NEW_LINE>case OWNING_GROUP:<NEW_LINE>Mode modeGroup = new Mode(mMode);<NEW_LINE>modeGroup.setGroupBits(Mode.Bits.NONE);<NEW_LINE>if (mAccessAcl != null) {<NEW_LINE>// overwrite the group actions from the access ACL.<NEW_LINE>modeGroup.setGroupBits(new Mode(mAccessAcl.mMode).getGroupBits());<NEW_LINE>}<NEW_LINE>mMode = modeGroup.toShort();<NEW_LINE>return;<NEW_LINE>case OTHER:<NEW_LINE>Mode modeOther = new Mode(mMode);<NEW_LINE>modeOther.setOtherBits(Mode.Bits.NONE);<NEW_LINE>if (mAccessAcl != null) {<NEW_LINE>// overwrite the other actions from the access ACL.<NEW_LINE>modeOther.setOtherBits(new Mode(mAccessAcl.mMode).getOtherBits());<NEW_LINE>}<NEW_LINE>mMode = modeOther.toShort();<NEW_LINE>return;<NEW_LINE>default:<NEW_LINE>throw new IllegalStateException(<MASK><NEW_LINE>}<NEW_LINE>}
"Unknown ACL entry type: " + entry.getType());
830,046
private void writePluginExecution(PluginExecution pluginExecution, String tagName, XmlSerializer serializer) throws java.io.IOException {<NEW_LINE>serializer.startTag(NAMESPACE, tagName);<NEW_LINE>flush(serializer);<NEW_LINE>StringBuffer b = b(serializer);<NEW_LINE>int start = b.length();<NEW_LINE>if ((pluginExecution.getId() != null) && !pluginExecution.getId().equals("default")) {<NEW_LINE>writeValue(serializer, "id", pluginExecution.getId(), pluginExecution);<NEW_LINE>}<NEW_LINE>if (pluginExecution.getPhase() != null) {<NEW_LINE>writeValue(serializer, "phase", pluginExecution.getPhase(), pluginExecution);<NEW_LINE>}<NEW_LINE>if ((pluginExecution.getGoals() != null) && (pluginExecution.getGoals().size() > 0)) {<NEW_LINE>serializer.startTag(NAMESPACE, "goals");<NEW_LINE>flush(serializer);<NEW_LINE>int start2 = b.length();<NEW_LINE>int index = 0;<NEW_LINE>InputLocation tracker = pluginExecution.getLocation("goals");<NEW_LINE>for (Iterator<String> iter = pluginExecution.getGoals().iterator(); iter.hasNext(); ) {<NEW_LINE>String goal = iter.next();<NEW_LINE>writeValue(serializer, "goal", goal, tracker, index);<NEW_LINE>index = index + 1;<NEW_LINE>}<NEW_LINE>serializer.endTag(NAMESPACE, "goals").flush();<NEW_LINE>logLocation(pluginExecution, "goals", <MASK><NEW_LINE>}<NEW_LINE>if (pluginExecution.getInherited() != null) {<NEW_LINE>writeValue(serializer, "inherited", pluginExecution.getInherited(), pluginExecution);<NEW_LINE>}<NEW_LINE>if (pluginExecution.getConfiguration() != null) {<NEW_LINE>writeXpp3DOM(serializer, (Xpp3Dom) pluginExecution.getConfiguration(), pluginExecution);<NEW_LINE>}<NEW_LINE>serializer.endTag(NAMESPACE, tagName).flush();<NEW_LINE>logLocation(pluginExecution, "", start, b.length());<NEW_LINE>}
start2, b.length());
1,742,781
public static double squaredDistance(SparseArray x, SparseArray y) {<NEW_LINE>Iterator<SparseArray.Entry<MASK><NEW_LINE>Iterator<SparseArray.Entry> it2 = y.iterator();<NEW_LINE>SparseArray.Entry e1 = it1.hasNext() ? it1.next() : null;<NEW_LINE>SparseArray.Entry e2 = it2.hasNext() ? it2.next() : null;<NEW_LINE>double sum = 0.0;<NEW_LINE>while (e1 != null && e2 != null) {<NEW_LINE>if (e1.i == e2.i) {<NEW_LINE>sum += pow2(e1.x - e2.x);<NEW_LINE>e1 = it1.hasNext() ? it1.next() : null;<NEW_LINE>e2 = it2.hasNext() ? it2.next() : null;<NEW_LINE>} else if (e1.i > e2.i) {<NEW_LINE>sum += pow2(e2.x);<NEW_LINE>e2 = it2.hasNext() ? it2.next() : null;<NEW_LINE>} else {<NEW_LINE>sum += pow2(e1.x);<NEW_LINE>e1 = it1.hasNext() ? it1.next() : null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>while (it1.hasNext()) {<NEW_LINE>double d = it1.next().x;<NEW_LINE>sum += d * d;<NEW_LINE>}<NEW_LINE>while (it2.hasNext()) {<NEW_LINE>double d = it2.next().x;<NEW_LINE>sum += d * d;<NEW_LINE>}<NEW_LINE>return sum;<NEW_LINE>}
> it1 = x.iterator();
815,393
// FocusListener methods<NEW_LINE>@Override<NEW_LINE>public void focusGained(FocusEvent evt) {<NEW_LINE>if (LOG.isLoggable(Level.FINE)) {<NEW_LINE>// NOI18N<NEW_LINE>LOG.// NOI18N<NEW_LINE>fine("BaseCaret.focusGained(); doc=" + component.getDocument().getProperty(Document.TitleProperty) + '\n');<NEW_LINE>}<NEW_LINE>JTextComponent c = component;<NEW_LINE>if (c != null) {<NEW_LINE>updateType();<NEW_LINE>if (component.isEnabled()) {<NEW_LINE>if (component.isEditable()) {<NEW_LINE>setVisible(true);<NEW_LINE>}<NEW_LINE>setSelectionVisible(true);<NEW_LINE>}<NEW_LINE>if (LOG.isLoggable(Level.FINER)) {<NEW_LINE>// NOI18N<NEW_LINE>LOG.finer("Caret visibility: " + isVisible() + '\n');<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (LOG.isLoggable(Level.FINER)) {<NEW_LINE>// NOI18N<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
LOG.finer("Text component is null, caret will not be visible" + '\n');
1,548,809
private void demoPlsqlProcedureINParams(Connection conn) throws SQLException {<NEW_LINE>// Create a PLSQL stored procedure with IN parameters.<NEW_LINE>final String PROC_NAME = "ProcINParams";<NEW_LINE>String sql = "CREATE OR REPLACE PROCEDURE " + PROC_NAME + "(num IN NUMBER, name IN VARCHAR2, insertedBy IN VARCHAR2) IS " + "BEGIN " + "INSERT INTO " + TABLE_NAME + " VALUES (num, name, insertedBy); " + "END; ";<NEW_LINE>Util.show(sql);<NEW_LINE>Util.doSql(conn, sql);<NEW_LINE>// Invoke the stored procedure.<NEW_LINE>sql = "CALL " + PROC_NAME + "(?,?,?)";<NEW_LINE>try (CallableStatement callStmt = conn.prepareCall(sql)) {<NEW_LINE>callStmt.setInt(1, 9);<NEW_LINE>callStmt.setString(2, "NINE");<NEW_LINE>callStmt.setString(3, PROC_NAME);<NEW_LINE>callStmt.addBatch();<NEW_LINE>callStmt.setInt(1, 10);<NEW_LINE><MASK><NEW_LINE>callStmt.setString(3, PROC_NAME);<NEW_LINE>callStmt.addBatch();<NEW_LINE>callStmt.setInt(1, 11);<NEW_LINE>callStmt.setString(2, "ELEVEN");<NEW_LINE>callStmt.setString(3, PROC_NAME);<NEW_LINE>callStmt.addBatch();<NEW_LINE>callStmt.setInt(1, 12);<NEW_LINE>callStmt.setString(2, "TWELVE");<NEW_LINE>callStmt.setString(3, PROC_NAME);<NEW_LINE>callStmt.addBatch();<NEW_LINE>callStmt.executeBatch();<NEW_LINE>// Display rows inserted by the above stored procedure call.<NEW_LINE>Util.show("Rows inserted by the stored procedure '" + PROC_NAME + "' are: ");<NEW_LINE>displayRows(conn, PROC_NAME);<NEW_LINE>} catch (SQLException sqlEx) {<NEW_LINE>Util.showError("demoPlsqlProcedureINParams", sqlEx);<NEW_LINE>} finally {<NEW_LINE>// Drop the procedure when done with it.<NEW_LINE>Util.doSql(conn, "DROP PROCEDURE " + PROC_NAME);<NEW_LINE>}<NEW_LINE>}
callStmt.setString(2, "TEN");
889,226
public void execute() throws Exception {<NEW_LINE>File quickstartTmpDir = new File(_dataDir, String.valueOf(System.currentTimeMillis()));<NEW_LINE>File baseDir = new File(quickstartTmpDir, "githubEvents");<NEW_LINE>File dataDir = new File(quickstartTmpDir, "rawdata");<NEW_LINE>Preconditions.checkState(dataDir.mkdirs());<NEW_LINE>File schemaFile = new File(baseDir, "githubEvents_schema.json");<NEW_LINE>File tableConfigFile = new File(baseDir, "githubEvents_offline_table_config.json");<NEW_LINE>File ingestionJobSpecFile = new File(baseDir, "ingestionJobSpec.yaml");<NEW_LINE>ClassLoader classLoader = JsonIndexQuickStart.class.getClassLoader();<NEW_LINE>URL resource = classLoader.getResource("examples/batch/githubEvents/githubEvents_offline_table_config.json");<NEW_LINE>Preconditions.checkNotNull(resource);<NEW_LINE>FileUtils.copyURLToFile(resource, tableConfigFile);<NEW_LINE><MASK><NEW_LINE>Preconditions.checkNotNull(resource);<NEW_LINE>FileUtils.copyURLToFile(resource, schemaFile);<NEW_LINE>resource = classLoader.getResource("examples/batch/githubEvents/ingestionJobSpec.yaml");<NEW_LINE>Preconditions.checkNotNull(resource);<NEW_LINE>FileUtils.copyURLToFile(resource, ingestionJobSpecFile);<NEW_LINE>QuickstartTableRequest request = new QuickstartTableRequest(baseDir.getAbsolutePath());<NEW_LINE>final QuickstartRunner runner = new QuickstartRunner(Collections.singletonList(request), 1, 1, 1, 0, dataDir, getConfigOverrides());<NEW_LINE>printStatus(Color.CYAN, "***** Starting Zookeeper, controller, broker and server *****");<NEW_LINE>runner.startAll();<NEW_LINE>Runtime.getRuntime().addShutdownHook(new Thread(() -> {<NEW_LINE>try {<NEW_LINE>printStatus(Color.GREEN, "***** Shutting down offline quick start *****");<NEW_LINE>runner.stop();<NEW_LINE>FileUtils.deleteDirectory(quickstartTmpDir);<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}));<NEW_LINE>printStatus(Color.CYAN, "***** Bootstrap githubEvents table *****");<NEW_LINE>runner.bootstrapTable();<NEW_LINE>waitForBootstrapToComplete(null);<NEW_LINE>printStatus(Color.YELLOW, "***** Offline json-index quickstart setup complete *****");<NEW_LINE>String q1 = "select json_extract_scalar(repo, '$.name', 'STRING'), count(*) from githubEvents where json_match(actor, " + "'\"$.login\"=''LombiqBot''') group by 1 order by 2 desc limit 10";<NEW_LINE>printStatus(Color.YELLOW, "Most contributed repos by 'LombiqBot'");<NEW_LINE>printStatus(Color.CYAN, "Query : " + q1);<NEW_LINE>printStatus(Color.YELLOW, prettyPrintResponse(runner.runQuery(q1)));<NEW_LINE>printStatus(Color.GREEN, "***************************************************");<NEW_LINE>printStatus(Color.GREEN, "You can always go to http://localhost:9000 to play around in the query console");<NEW_LINE>}
resource = classLoader.getResource("examples/batch/githubEvents/githubEvents_schema.json");
726,168
protected State<Command> visualModeBindings() {<NEW_LINE>Command sneakInput = ChangeToSneakModeCommand.fromVisual();<NEW_LINE>Command sneakInputBackwards = ChangeToSneakModeCommand.backwardsAndFromVisual();<NEW_LINE>Command sneak_f = ChangeToSneakModeCommand.fromVisual(CharOffsetHint.F_CHARS, InputCharsLimitHint.ONE);<NEW_LINE>Command sneak_F = ChangeToSneakModeCommand.backwardsAndFromVisual(CharOffsetHint.F_CHARS, InputCharsLimitHint.ONE);<NEW_LINE>Command sneak_t = ChangeToSneakModeCommand.fromVisual(CharOffsetHint.T_CHAR_FORWARD, InputCharsLimitHint.ONE);<NEW_LINE>Command sneak_T = ChangeToSneakModeCommand.backwardsAndFromVisual(CharOffsetHint.T_CHAR_BACKWARD, InputCharsLimitHint.ONE);<NEW_LINE>Command sneakNext = new VisualMotionCommand(ContinueFindingMotion.NORMAL_NAVIGATING);<NEW_LINE>Command sneakPrev <MASK><NEW_LINE>return state(leafBind(new PlugKeyStroke("(sneak_s)"), sneakInput), leafBind(new PlugKeyStroke("(sneak_S)"), sneakInputBackwards), leafBind(new PlugKeyStroke("(sneak_f)"), sneak_f), leafBind(new PlugKeyStroke("(sneak_F)"), sneak_F), leafBind(new PlugKeyStroke("(sneak_t)"), sneak_t), leafBind(new PlugKeyStroke("(sneak_T)"), sneak_T), leafBind(new PlugKeyStroke("(sneak-next)"), sneakNext), leafBind(new PlugKeyStroke("(sneak-prev)"), sneakPrev));<NEW_LINE>}
= new VisualMotionCommand(ContinueFindingMotion.REVERSE_NAVIGATING);
50,010
public static WorkspaceRuleEvent newExecuteEvent(Iterable<String> args, Integer timeout, Map<String, String> commonEnvironment, Map<String, String> customEnvironment, String outputDirectory, boolean quiet, String ruleLabel, Location location) {<NEW_LINE>WorkspaceLogProtos.ExecuteEvent.Builder e = WorkspaceLogProtos.ExecuteEvent.newBuilder().setTimeoutSeconds(timeout.intValue()).setOutputDirectory(outputDirectory).setQuiet(quiet);<NEW_LINE>if (commonEnvironment != null) {<NEW_LINE>e = e.putAllEnvironment(commonEnvironment);<NEW_LINE>}<NEW_LINE>if (customEnvironment != null) {<NEW_LINE>e = e.putAllEnvironment(customEnvironment);<NEW_LINE>}<NEW_LINE>for (String a : args) {<NEW_LINE>e.addArguments(a);<NEW_LINE>}<NEW_LINE>WorkspaceLogProtos.WorkspaceEvent.Builder result <MASK><NEW_LINE>result = result.setExecuteEvent(e.build());<NEW_LINE>if (location != null) {<NEW_LINE>result = result.setLocation(location.toString());<NEW_LINE>}<NEW_LINE>if (ruleLabel != null) {<NEW_LINE>result = result.setRule(ruleLabel);<NEW_LINE>}<NEW_LINE>return new WorkspaceRuleEvent(result.build());<NEW_LINE>}
= WorkspaceLogProtos.WorkspaceEvent.newBuilder();
1,317,348
public void subtractTo(GradPair gp, int index) {<NEW_LINE>if (numClass == 2 || multiClassMultiTree) {<NEW_LINE>((BinaryGradPair) gp).subtractBy(gradients[index], hessians[index]);<NEW_LINE>} else if (!fullHessian) {<NEW_LINE>MultiGradPair multi = (MultiGradPair) gp;<NEW_LINE>double[<MASK><NEW_LINE>double[] hess = multi.getHess();<NEW_LINE>int offset = index * numClass;<NEW_LINE>for (int i = 0; i < numClass; i++) {<NEW_LINE>grad[i] -= gradients[offset + i];<NEW_LINE>hess[i] -= hessians[offset + i];<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>MultiGradPair multi = (MultiGradPair) gp;<NEW_LINE>double[] grad = multi.getGrad();<NEW_LINE>double[] hess = multi.getHess();<NEW_LINE>int gradOffset = index * grad.length;<NEW_LINE>int hessOffset = index * hess.length;<NEW_LINE>for (int i = 0; i < grad.length; i++) {<NEW_LINE>grad[i] -= gradients[gradOffset + i];<NEW_LINE>}<NEW_LINE>for (int i = 0; i < hess.length; i++) {<NEW_LINE>hess[i] -= hessians[hessOffset + i];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
] grad = multi.getGrad();
1,636,137
public List<JoinCpuLoadBo> decodeValues(Buffer valueBuffer, ApplicationStatDecodingContext decodingContext) {<NEW_LINE>final String id = decodingContext.getApplicationId();<NEW_LINE>final long baseTimestamp = decodingContext.getBaseTimestamp();<NEW_LINE>final long timestampDelta = decodingContext.getTimestampDelta();<NEW_LINE>final long initialTimestamp = baseTimestamp + timestampDelta;<NEW_LINE>int numValues = valueBuffer.readVInt();<NEW_LINE>List<Long> timestamps = this.codec.decodeTimestamps(initialTimestamp, valueBuffer, numValues);<NEW_LINE>// decode headers<NEW_LINE>final byte[] header = valueBuffer.readPrefixedBytes();<NEW_LINE>AgentStatHeaderDecoder headerDecoder = new BitCountingHeaderDecoder(header);<NEW_LINE>JoinLongFieldEncodingStrategy jvmCpuLoadEncodingStrategy = JoinLongFieldEncodingStrategy.getFromCode(headerDecoder.getCode(), headerDecoder.getCode(), headerDecoder.getCode(), headerDecoder.getCode(), headerDecoder.getCode());<NEW_LINE>JoinLongFieldEncodingStrategy systemCpuLoadEncodingStrategy = JoinLongFieldEncodingStrategy.getFromCode(headerDecoder.getCode(), headerDecoder.getCode(), headerDecoder.getCode(), headerDecoder.getCode(<MASK><NEW_LINE>// decode values<NEW_LINE>final List<JoinLongFieldBo> jvmCpuLoadList = this.codec.decodeValues(valueBuffer, jvmCpuLoadEncodingStrategy, numValues);<NEW_LINE>final List<JoinLongFieldBo> systemCpuLoadList = this.codec.decodeValues(valueBuffer, systemCpuLoadEncodingStrategy, numValues);<NEW_LINE>List<JoinCpuLoadBo> joinCpuLoadBoList = new ArrayList<>(numValues);<NEW_LINE>for (int i = 0; i < numValues; i++) {<NEW_LINE>JoinCpuLoadBo joinCpuLoadBo = new JoinCpuLoadBo();<NEW_LINE>joinCpuLoadBo.setId(id);<NEW_LINE>joinCpuLoadBo.setTimestamp(timestamps.get(i));<NEW_LINE>joinCpuLoadBo.setJvmCpuLoadJoinValue(jvmCpuLoadList.get(i).toLongFieldBo());<NEW_LINE>joinCpuLoadBo.setSystemCpuLoadJoinValue(systemCpuLoadList.get(i).toLongFieldBo());<NEW_LINE>joinCpuLoadBoList.add(joinCpuLoadBo);<NEW_LINE>}<NEW_LINE>return joinCpuLoadBoList;<NEW_LINE>}
), headerDecoder.getCode());
675,295
public RestService createRestService(String schemaRegistryUrl, Map<String, String> configs) {<NEW_LINE>RestService restService = new RestService(schemaRegistryUrl);<NEW_LINE>ConfigDef configDef = new ConfigDef();<NEW_LINE>SslConfigs.addClientSslSupport(configDef);<NEW_LINE>Map<String, ConfigDef.ConfigKey> configKeyMap = configDef.configKeys();<NEW_LINE>Map<String, Object> sslConfigs = new HashMap<>();<NEW_LINE>for (String key : configs.keySet()) {<NEW_LINE>if (!key.equals(SCHEMA_REGISTRY_REST_URL) && key.startsWith(SCHEMA_REGISTRY_OPTS_PREFIX)) {<NEW_LINE>String <MASK><NEW_LINE>String schemaRegistryOptKey = key.substring(SCHEMA_REGISTRY_OPTS_PREFIX.length());<NEW_LINE>if (configKeyMap.containsKey(schemaRegistryOptKey)) {<NEW_LINE>if (configKeyMap.get(schemaRegistryOptKey).type == ConfigDef.Type.PASSWORD) {<NEW_LINE>sslConfigs.put(schemaRegistryOptKey, new Password(value));<NEW_LINE>} else {<NEW_LINE>sslConfigs.put(schemaRegistryOptKey, value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!sslConfigs.isEmpty()) {<NEW_LINE>DefaultSslEngineFactory sslFactory = new DefaultSslEngineFactory();<NEW_LINE>sslFactory.configure(sslConfigs);<NEW_LINE>restService.setSslSocketFactory(sslFactory.sslContext().getSocketFactory());<NEW_LINE>}<NEW_LINE>return restService;<NEW_LINE>}
value = configs.get(key);
1,702,387
private void buildRestOfGuiPages(GuiAutotest guiTest) {<NEW_LINE>// directory page<NEW_LINE>guiTest.addKeyAction(KeyEvent.VK_TAB);<NEW_LINE>guiTest.addKeyAction(KeyEvent.VK_TAB);<NEW_LINE>guiTest.addKeyAction(KeyEvent.VK_TAB);<NEW_LINE>guiTest.addKeyAction(KeyEvent.VK_TAB);<NEW_LINE>guiTest.addKeyAction(KeyEvent.VK_SPACE);<NEW_LINE>// java selection page<NEW_LINE>guiTest.addKeyAction(KeyEvent.VK_TAB);<NEW_LINE>guiTest.addKeyAction(KeyEvent.VK_TAB);<NEW_LINE>guiTest.addKeyAction(KeyEvent.VK_TAB);<NEW_LINE>guiTest.addKeyAction(KeyEvent.VK_TAB);<NEW_LINE>JavaHomeHandler javaHomeHandler = guiTest.getJavaHomeHandler();<NEW_LINE>boolean isValidDeviation = javaHomeHandler.isDeviation() && javaHomeHandler.isValidHome();<NEW_LINE>if (isValidDeviation) {<NEW_LINE>// need 2 more tabs<NEW_LINE>guiTest.addKeyAction(KeyEvent.VK_TAB);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>guiTest.addKeyAction(KeyEvent.VK_SPACE);<NEW_LINE>// overview page<NEW_LINE>if (isValidDeviation) {<NEW_LINE>// enough time to check the java version<NEW_LINE>guiTest.addKeyAction(KeyEvent.VK_SPACE, 3000);<NEW_LINE>} else {<NEW_LINE>guiTest.addKeyAction(KeyEvent.VK_SPACE);<NEW_LINE>}<NEW_LINE>// installation page (skipped)<NEW_LINE>// readme page<NEW_LINE>// wait for the installation to finish<NEW_LINE>guiTest.addWaitingKeyAction(KeyEvent.VK_TAB);<NEW_LINE>guiTest.addKeyAction(KeyEvent.VK_SPACE);<NEW_LINE>// success page<NEW_LINE>guiTest.addKeyAction(KeyEvent.VK_SPACE);<NEW_LINE>}
guiTest.addKeyAction(KeyEvent.VK_TAB);
109,676
protected void configureNestedVirtualization(Map<String, String> details, VirtualMachineTO to) {<NEW_LINE>String localNestedV = details.get(VmDetailConstants.NESTED_VIRTUALIZATION_FLAG);<NEW_LINE>Boolean globalNestedVirtualisationEnabled = getGlobalNestedVirtualisationEnabled();<NEW_LINE>Boolean globalNestedVPerVMEnabled = getGlobalNestedVPerVMEnabled();<NEW_LINE>Boolean shouldEnableNestedVirtualization = shouldEnableNestedVirtualization(globalNestedVirtualisationEnabled, globalNestedVPerVMEnabled, localNestedV);<NEW_LINE>if (LOGGER.isDebugEnabled()) {<NEW_LINE>LOGGER.debug(String.format("Due to '%B'(globalNestedVirtualisationEnabled) and '%B'(globalNestedVPerVMEnabled) I'm adding a flag with value %B to the vm configuration for Nested Virtualisation."<MASK><NEW_LINE>}<NEW_LINE>details.put(VmDetailConstants.NESTED_VIRTUALIZATION_FLAG, Boolean.toString(shouldEnableNestedVirtualization));<NEW_LINE>}
, globalNestedVirtualisationEnabled, globalNestedVPerVMEnabled, shouldEnableNestedVirtualization));
1,338,905
/* base rule is the rule with remote security group */<NEW_LINE>private List<RuleTO> calculateSecurityGroupBaseRule(List<String> sgUuids, List<String> l3Uuids, int ipVersion) {<NEW_LINE>List<RuleTO> rules = new ArrayList<>();<NEW_LINE>for (String sgUuid : sgUuids) {<NEW_LINE>String sql = "select r from SecurityGroupRuleVO r,SecurityGroupVO sg where r.securityGroupUuid = :sgUuid and r.ipVersion = :ipVersion" + " and r.remoteSecurityGroupUuid is not null and r.remoteSecurityGroupUuid = sg.uuid and sg.state in (:sgStates)";<NEW_LINE>TypedQuery<SecurityGroupRuleVO> q = dbf.getEntityManager().createQuery(sql, SecurityGroupRuleVO.class);<NEW_LINE>q.setParameter("sgUuid", sgUuid);<NEW_LINE>q.setParameter("sgStates", sgStates);<NEW_LINE><MASK><NEW_LINE>List<SecurityGroupRuleVO> remoteRules = q.getResultList();<NEW_LINE>for (SecurityGroupRuleVO r : remoteRules) {<NEW_LINE>RuleTO rule = new RuleTO();<NEW_LINE>rule.setIpVersion(r.getIpVersion());<NEW_LINE>rule.setStartPort(r.getStartPort());<NEW_LINE>rule.setEndPort(r.getEndPort());<NEW_LINE>rule.setProtocol(r.getProtocol().toString());<NEW_LINE>rule.setType(r.getType().toString());<NEW_LINE>rule.setAllowedCidr(r.getAllowedCidr());<NEW_LINE>rule.setSecurityGroupUuid(sgUuid);<NEW_LINE>rule.setRemoteGroupUuid(r.getRemoteSecurityGroupUuid());<NEW_LINE>// TODO: the same group only transport once<NEW_LINE>rule.setRemoteGroupVmIps(getVmIpsBySecurityGroup(r.getRemoteSecurityGroupUuid(), r.getIpVersion()));<NEW_LINE>rules.add(rule);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return rules;<NEW_LINE>}
q.setParameter("ipVersion", ipVersion);
1,041,508
private StackFrame computeDapStackFrame() {<NEW_LINE>try {<NEW_LINE>if (!isBalStackFrame(jStackFrame.getStackFrame())) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>StackFrame dapStackFrame = new StackFrame();<NEW_LINE>dapStackFrame.setId(frameId);<NEW_LINE>dapStackFrame.setName(getStackFrameName(jStackFrame));<NEW_LINE>dapStackFrame.setLine(jStackFrame.location().lineNumber());<NEW_LINE>dapStackFrame.setColumn(0);<NEW_LINE>Optional<Map.Entry<Path, DebugSourceType>> sourcePathAndType = PackageUtils.getStackFrameSourcePath(jStackFrame.location(<MASK><NEW_LINE>if (sourcePathAndType.isEmpty()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Path frameLocationPath = sourcePathAndType.get().getKey();<NEW_LINE>DebugSourceType sourceType = sourcePathAndType.get().getValue();<NEW_LINE>Source source = new Source();<NEW_LINE>source.setName(jStackFrame.location().sourceName());<NEW_LINE>URI uri = frameLocationPath.toAbsolutePath().toUri();<NEW_LINE>// If the corresponding source file of the stack frame is a bala source, the source should be readonly in<NEW_LINE>// the editor side. Therefore adds a custom URI scheme to the file path, after verifying that the connected<NEW_LINE>// debug client support custom URI schemes.<NEW_LINE>Optional<ClientConfigHolder.ExtendedClientCapabilities> capabilities = context.getAdapter().getClientConfigHolder().getExtendedCapabilities();<NEW_LINE>boolean supportsReadOnlyEditors = capabilities.isPresent() && capabilities.get().supportsReadOnlyEditors();<NEW_LINE>if (supportsReadOnlyEditors && sourceType == DebugSourceType.DEPENDENCY) {<NEW_LINE>// Note: Since we are using a Ballerina-specific custom URI scheme, the future DAP client<NEW_LINE>// implementations may have to implement custom editor providers in order to support URIs coming<NEW_LINE>// from the debug server.<NEW_LINE>source.setPath(PackageUtils.covertToBalaUri(uri).toString());<NEW_LINE>} else {<NEW_LINE>source.setPath(uri.toString());<NEW_LINE>}<NEW_LINE>dapStackFrame.setSource(source);<NEW_LINE>return dapStackFrame;<NEW_LINE>} catch (Exception e) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}
), context.getSourceProject());
498,298
protected void prepareComplete() {<NEW_LINE>StringBuilder buf = LOG.isDebuggingFine() ? new StringBuilder(1000) : null;<NEW_LINE>scalingreferencevalues = new double[dimensionality];<NEW_LINE>randomPerAttribute = new Random[dimensionality];<NEW_LINE>if (scalingreference == ScalingReference.STDDEV) {<NEW_LINE>if (buf != null) {<NEW_LINE>buf.append("Standard deviation per attribute: ");<NEW_LINE>}<NEW_LINE>for (int d = 0; d < dimensionality; d++) {<NEW_LINE>scalingreferencevalues[d] = mvs[d].getSampleStddev() * percentage;<NEW_LINE>if (scalingreferencevalues[d] == 0 || Double.isNaN(scalingreferencevalues[d])) {<NEW_LINE>scalingreferencevalues[d] = percentage;<NEW_LINE>}<NEW_LINE>randomPerAttribute[d] = new Random(RANDOM.nextLong());<NEW_LINE>if (buf != null) {<NEW_LINE>buf.append(' ').append(d).append(": ").append(scalingreferencevalues[d] / percentage);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (scalingreference == ScalingReference.MINMAX && minima.length == 0 && maxima.length == 0) {<NEW_LINE>if (buf != null) {<NEW_LINE>buf.append("extension per attribute: ");<NEW_LINE>}<NEW_LINE>for (int d = 0; d < dimensionality; d++) {<NEW_LINE>scalingreferencevalues[d] = (mvs[d].getMax() - mvs[d].getMin()) * percentage;<NEW_LINE>if (scalingreferencevalues[d] == 0 || Double.isNaN(scalingreferencevalues[d])) {<NEW_LINE>scalingreferencevalues[d] = percentage;<NEW_LINE>}<NEW_LINE>randomPerAttribute[d] = new <MASK><NEW_LINE>if (buf != null) {<NEW_LINE>buf.append(' ').append(d).append(": ").append(scalingreferencevalues[d] / percentage);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>mvs = null;<NEW_LINE>if (buf != null) {<NEW_LINE>LOG.debugFine(buf.toString());<NEW_LINE>}<NEW_LINE>}
Random(RANDOM.nextLong());