idx
int32 46
1.86M
| input
stringlengths 321
6.6k
| target
stringlengths 9
1.24k
|
|---|---|---|
576,962
|
public void onPlayerDeathEvent(final PlayerDeathEvent event) {<NEW_LINE>final Entity entity = event.getEntity();<NEW_LINE>if (entity.hasMetadata("NPC")) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final User user = ess.getUser(event.getEntity());<NEW_LINE>if (ess.getSettings().infoAfterDeath()) {<NEW_LINE>final <MASK><NEW_LINE>user.sendMessage(tl("infoAfterDeath", loc.getWorld().getName(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()));<NEW_LINE>}<NEW_LINE>if (user.isAuthorized("essentials.back.ondeath") && !ess.getSettings().isCommandDisabled("back")) {<NEW_LINE>user.setLastLocation();<NEW_LINE>user.sendMessage(tl("backAfterDeath"));<NEW_LINE>}<NEW_LINE>if (!ess.getSettings().areDeathMessagesEnabled()) {<NEW_LINE>event.setDeathMessage("");<NEW_LINE>}<NEW_LINE>}
|
Location loc = user.getLocation();
|
114,464
|
public void onError(java.lang.Exception e) {<NEW_LINE>byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;<NEW_LINE>org.apache.thrift.TSerializable msg;<NEW_LINE>append_result result = new append_result();<NEW_LINE>if (e instanceof org.apache.thrift.transport.TTransportException) {<NEW_LINE>_LOGGER.error("TTransportException inside handler", e);<NEW_LINE>fb.close();<NEW_LINE>return;<NEW_LINE>} else if (e instanceof org.apache.thrift.TApplicationException) {<NEW_LINE>_LOGGER.error("TApplicationException inside handler", e);<NEW_LINE>msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;<NEW_LINE>msg = (org.apache.thrift.TApplicationException) e;<NEW_LINE>} else {<NEW_LINE>_LOGGER.error("Exception inside handler", e);<NEW_LINE>msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;<NEW_LINE>msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.<MASK><NEW_LINE>}<NEW_LINE>try {<NEW_LINE>fcall.sendResponse(fb, msg, msgType, seqid);<NEW_LINE>} catch (java.lang.Exception ex) {<NEW_LINE>_LOGGER.error("Exception writing to internal frame buffer", ex);<NEW_LINE>fb.close();<NEW_LINE>}<NEW_LINE>}
|
INTERNAL_ERROR, e.getMessage());
|
1,637,793
|
protected static Pair<Type, Integer> fromThrift(TTypeDesc typeDesc, int nodeIdx) throws InternalException {<NEW_LINE>TTypeNode node = typeDesc.getTypes().get(nodeIdx);<NEW_LINE>Type type = null;<NEW_LINE>switch(node.getType()) {<NEW_LINE>case SCALAR:<NEW_LINE>{<NEW_LINE>Preconditions.checkState(node.isSetScalarType());<NEW_LINE>TScalarType scalarType = node.getScalarType();<NEW_LINE>if (scalarType.getType() == TPrimitiveType.CHAR) {<NEW_LINE>Preconditions.checkState(scalarType.isSetLen());<NEW_LINE>type = ScalarType.<MASK><NEW_LINE>} else if (scalarType.getType() == TPrimitiveType.VARCHAR) {<NEW_LINE>Preconditions.checkState(scalarType.isSetLen());<NEW_LINE>type = ScalarType.createVarcharType(scalarType.getLen());<NEW_LINE>} else if (scalarType.getType() == TPrimitiveType.DECIMALV2) {<NEW_LINE>Preconditions.checkState(scalarType.isSetPrecision() && scalarType.isSetScale());<NEW_LINE>type = ScalarType.createDecimalType(scalarType.getPrecision(), scalarType.getScale());<NEW_LINE>} else {<NEW_LINE>type = ScalarType.createType(PrimitiveType.fromThrift(scalarType.getType()));<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>default:<NEW_LINE>throw new InternalException("Return type " + node.getType() + " is not supported now!");<NEW_LINE>}<NEW_LINE>return Pair.of(type, nodeIdx);<NEW_LINE>}
|
createCharType(scalarType.getLen());
|
1,821,418
|
public void encode(Buffer valueBuffer) {<NEW_LINE>StrategyAnalyzer<Short> versionStrategyAnalyzer = versionAnalyzerBuilder.build();<NEW_LINE>StrategyAnalyzer<Integer> schemaTypeStrategyAnalyzer = schemaTypeAnalyzerBuilder.build();<NEW_LINE>StrategyAnalyzer<Integer> fastTraceCountsStrategyAnalyzer = fastTraceCountsAnalyzerBuilder.build();<NEW_LINE>StrategyAnalyzer<Integer> normalTraceCountsStrategyAnalyzer = normalTraceCountsAnalyzerBuilder.build();<NEW_LINE>StrategyAnalyzer<Integer> slowTraceCountsStrategyAnalyzer = slowTraceCountsAnalyzerBuilder.build();<NEW_LINE>StrategyAnalyzer<Integer> verySlowTraceCountsStrategyAnalyzer = verySlowTraceCountsAnalyzerBuilder.build();<NEW_LINE>// encode header<NEW_LINE>AgentStatHeaderEncoder headerEncoder = new BitCountingHeaderEncoder();<NEW_LINE>headerEncoder.addCode(versionStrategyAnalyzer.getBestStrategy().getCode());<NEW_LINE>headerEncoder.addCode(schemaTypeStrategyAnalyzer.getBestStrategy().getCode());<NEW_LINE>headerEncoder.addCode(fastTraceCountsStrategyAnalyzer.getBestStrategy().getCode());<NEW_LINE>headerEncoder.addCode(normalTraceCountsStrategyAnalyzer.<MASK><NEW_LINE>headerEncoder.addCode(slowTraceCountsStrategyAnalyzer.getBestStrategy().getCode());<NEW_LINE>headerEncoder.addCode(verySlowTraceCountsStrategyAnalyzer.getBestStrategy().getCode());<NEW_LINE>final byte[] header = headerEncoder.getHeader();<NEW_LINE>valueBuffer.putPrefixedBytes(header);<NEW_LINE>// encode values<NEW_LINE>this.codec.encodeValues(valueBuffer, versionStrategyAnalyzer.getBestStrategy(), versionStrategyAnalyzer.getValues());<NEW_LINE>this.codec.encodeValues(valueBuffer, schemaTypeStrategyAnalyzer.getBestStrategy(), schemaTypeStrategyAnalyzer.getValues());<NEW_LINE>this.codec.encodeValues(valueBuffer, fastTraceCountsStrategyAnalyzer.getBestStrategy(), fastTraceCountsStrategyAnalyzer.getValues());<NEW_LINE>this.codec.encodeValues(valueBuffer, normalTraceCountsStrategyAnalyzer.getBestStrategy(), normalTraceCountsStrategyAnalyzer.getValues());<NEW_LINE>this.codec.encodeValues(valueBuffer, slowTraceCountsStrategyAnalyzer.getBestStrategy(), slowTraceCountsStrategyAnalyzer.getValues());<NEW_LINE>this.codec.encodeValues(valueBuffer, verySlowTraceCountsStrategyAnalyzer.getBestStrategy(), verySlowTraceCountsStrategyAnalyzer.getValues());<NEW_LINE>}
|
getBestStrategy().getCode());
|
880,289
|
private void saveSubFolder(Business business, String folderId, String newFolderId, EffectivePerson effectivePerson) throws Exception {<NEW_LINE>EntityManagerContainer emc = business.entityManagerContainer();<NEW_LINE>List<Attachment2> attachments = business.attachment2().listWithFolder2(folderId, FileStatus.VALID.getName());<NEW_LINE>for (Attachment2 att : attachments) {<NEW_LINE>usedSize = usedSize + att.getLength();<NEW_LINE>int vResult = business.verifyConstraint(effectivePerson.getDistinguishedName(), usedSize);<NEW_LINE>if (vResult > 0) {<NEW_LINE>long usedCapacity <MASK><NEW_LINE>throw new ExceptionCapacityOut(usedCapacity, vResult);<NEW_LINE>}<NEW_LINE>Attachment2 newAtt = new Attachment2(att.getName(), effectivePerson.getDistinguishedName(), newFolderId, att.getOriginFile(), att.getLength(), att.getType());<NEW_LINE>EntityManager em2 = emc.beginTransaction(Attachment2.class);<NEW_LINE>em2.persist(newAtt);<NEW_LINE>em2.getTransaction().commit();<NEW_LINE>}<NEW_LINE>List<Folder2> subFolders = business.folder2().listSubDirect1(folderId, FileStatus.VALID.getName());<NEW_LINE>for (Folder2 folder : subFolders) {<NEW_LINE>Folder2 newSubFolder = new Folder2(folder.getName(), effectivePerson.getDistinguishedName(), newFolderId, folder.getStatus());<NEW_LINE>EntityManager em1 = emc.beginTransaction(Folder2.class);<NEW_LINE>em1.persist(newSubFolder);<NEW_LINE>em1.getTransaction().commit();<NEW_LINE>saveSubFolder(business, folder.getId(), newSubFolder.getId(), effectivePerson);<NEW_LINE>}<NEW_LINE>}
|
= usedSize / (1024 * 1024);
|
693,851
|
public StockQtyAndUOMQty subtract(@NonNull final StockQtyAndUOMQty minuend, @NonNull final StockQtyAndUOMQty subtrahend) {<NEW_LINE>final ProductId productId = extractCommonProductId(minuend, subtrahend);<NEW_LINE>final Quantity stockQty1 = minuend.getStockQty();<NEW_LINE>final Quantity stockQty2 = subtrahend.getStockQty();<NEW_LINE>final Quantity stockQtySum = Quantitys.subtract(UOMConversionContext.of(minuend.getProductId<MASK><NEW_LINE>final Quantity uomQtySum = Quantitys.subtract(UOMConversionContext.of(productId), minuend.getUOMQtyOpt().orElse(stockQty1), subtrahend.getUOMQtyOpt().orElse(stockQty2));<NEW_LINE>return validate(StockQtyAndUOMQty.builder().productId(productId).stockQty(stockQtySum).uomQty(uomQtySum).build());<NEW_LINE>}
|
()), stockQty1, stockQty2);
|
1,038,949
|
public void write(IntBuffer value, String name, IntBuffer defVal) throws IOException {<NEW_LINE>if (value == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (value.equals(defVal)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Element el = appendElement(name);<NEW_LINE>el.setAttribute("size", String.valueOf(value.limit()));<NEW_LINE>StringBuilder buf = new StringBuilder();<NEW_LINE>int pos = value.position();<NEW_LINE>value.rewind();<NEW_LINE>int ctr = 0;<NEW_LINE>while (value.hasRemaining()) {<NEW_LINE>ctr++;<NEW_LINE>buf.<MASK><NEW_LINE>buf.append(" ");<NEW_LINE>}<NEW_LINE>if (ctr != value.limit()) {<NEW_LINE>throw new IOException("'" + name + "' buffer contention resulted in write data consistency. " + ctr + " values written when should have written " + value.limit());<NEW_LINE>}<NEW_LINE>if (buf.length() > 0) {<NEW_LINE>// remove last space<NEW_LINE>buf.setLength(buf.length() - 1);<NEW_LINE>}<NEW_LINE>value.position(pos);<NEW_LINE>el.setAttribute(dataAttributeName, buf.toString());<NEW_LINE>currentElement = (Element) el.getParentNode();<NEW_LINE>}
|
append(value.get());
|
974,876
|
public void showProgress(final boolean show) {<NEW_LINE>// On Honeycomb MR2 we have the ViewPropertyAnimator APIs, which allow<NEW_LINE>// for very easy animations. If available, use these APIs to fade-in<NEW_LINE>// the progress spinner.<NEW_LINE>if (VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) {<NEW_LINE>int shortAnimTime = getResources().getInteger(<MASK><NEW_LINE>mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);<NEW_LINE>mLoginFormView.animate().setDuration(shortAnimTime).alpha(show ? 0 : 1).setListener(new AnimatorListenerAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onAnimationEnd(Animator animation) {<NEW_LINE>mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);<NEW_LINE>mProgressView.animate().setDuration(shortAnimTime).alpha(show ? 1 : 0).setListener(new AnimatorListenerAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onAnimationEnd(Animator animation) {<NEW_LINE>mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} else {<NEW_LINE>// The ViewPropertyAnimator APIs are not available, so simply show<NEW_LINE>// and hide the relevant UI components.<NEW_LINE>mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);<NEW_LINE>mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);<NEW_LINE>}<NEW_LINE>}
|
android.R.integer.config_shortAnimTime);
|
1,213,339
|
protected boolean writeExtensionChildElements(BaseElement element, boolean didWriteExtensionStartElement, XMLStreamWriter xtw) throws Exception {<NEW_LINE>ServiceTask serviceTask = (ServiceTask) element;<NEW_LINE>if (!serviceTask.getCustomProperties().isEmpty()) {<NEW_LINE>for (CustomProperty customProperty : serviceTask.getCustomProperties()) {<NEW_LINE>if (StringUtils.isEmpty(customProperty.getSimpleValue())) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (!didWriteExtensionStartElement) {<NEW_LINE>xtw.writeStartElement(ELEMENT_EXTENSIONS);<NEW_LINE>didWriteExtensionStartElement = true;<NEW_LINE>}<NEW_LINE>xtw.writeStartElement(ACTIVITI_EXTENSIONS_PREFIX, ELEMENT_FIELD, ACTIVITI_EXTENSIONS_NAMESPACE);<NEW_LINE>xtw.writeAttribute(ATTRIBUTE_FIELD_NAME, customProperty.getName());<NEW_LINE>if ((customProperty.getSimpleValue().contains("${") || customProperty.getSimpleValue().contains("#{")) && customProperty.getSimpleValue().contains("}")) {<NEW_LINE>xtw.<MASK><NEW_LINE>} else {<NEW_LINE>xtw.writeStartElement(ACTIVITI_EXTENSIONS_PREFIX, ELEMENT_FIELD_STRING, ACTIVITI_EXTENSIONS_NAMESPACE);<NEW_LINE>}<NEW_LINE>xtw.writeCharacters(customProperty.getSimpleValue());<NEW_LINE>xtw.writeEndElement();<NEW_LINE>xtw.writeEndElement();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>didWriteExtensionStartElement = FieldExtensionExport.writeFieldExtensions(serviceTask.getFieldExtensions(), didWriteExtensionStartElement, xtw);<NEW_LINE>}<NEW_LINE>return didWriteExtensionStartElement;<NEW_LINE>}
|
writeStartElement(ACTIVITI_EXTENSIONS_PREFIX, ATTRIBUTE_FIELD_EXPRESSION, ACTIVITI_EXTENSIONS_NAMESPACE);
|
1,732,943
|
public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo) {<NEW_LINE>// here requires to generate a sequence of finally blocks invocations depending corresponding<NEW_LINE>// to each of the traversed try statements, so that execution will terminate properly.<NEW_LINE>// lookup the label, this should answer the returnContext<NEW_LINE>FlowContext targetContext = (this.label == null) ? flowContext.getTargetContextForDefaultContinue() : flowContext.getTargetContextForContinueLabel(this.label);<NEW_LINE>if (targetContext == null) {<NEW_LINE>if (this.label == null) {<NEW_LINE>currentScope.<MASK><NEW_LINE>} else {<NEW_LINE>currentScope.problemReporter().undefinedLabel(this);<NEW_LINE>}<NEW_LINE>// pretend it did not continue since no actual target<NEW_LINE>return flowInfo;<NEW_LINE>}<NEW_LINE>targetContext.recordAbruptExit();<NEW_LINE>targetContext.expireNullCheckedFieldInfo();<NEW_LINE>if (targetContext == FlowContext.NotContinuableContext) {<NEW_LINE>currentScope.problemReporter().invalidContinue(this);<NEW_LINE>// pretend it did not continue since no actual target<NEW_LINE>return flowInfo;<NEW_LINE>}<NEW_LINE>this.initStateIndex = currentScope.methodScope().recordInitializationStates(flowInfo);<NEW_LINE>this.targetLabel = targetContext.continueLabel();<NEW_LINE>FlowContext traversedContext = flowContext;<NEW_LINE>int subCount = 0;<NEW_LINE>this.subroutines = new SubRoutineStatement[5];<NEW_LINE>do {<NEW_LINE>SubRoutineStatement sub;<NEW_LINE>if ((sub = traversedContext.subroutine()) != null) {<NEW_LINE>if (subCount == this.subroutines.length) {<NEW_LINE>// grow<NEW_LINE>System.arraycopy(this.subroutines, 0, this.subroutines = new SubRoutineStatement[subCount * 2], 0, subCount);<NEW_LINE>}<NEW_LINE>this.subroutines[subCount++] = sub;<NEW_LINE>if (sub.isSubRoutineEscaping()) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>traversedContext.recordReturnFrom(flowInfo.unconditionalInits());<NEW_LINE>if (traversedContext instanceof InsideSubRoutineFlowContext) {<NEW_LINE>ASTNode node = traversedContext.associatedNode;<NEW_LINE>if (node instanceof TryStatement) {<NEW_LINE>TryStatement tryStatement = (TryStatement) node;<NEW_LINE>// collect inits<NEW_LINE>flowInfo.addInitializationsFrom(tryStatement.subRoutineInits);<NEW_LINE>}<NEW_LINE>} else if (traversedContext == targetContext) {<NEW_LINE>// only record continue info once accumulated through subroutines, and only against target context<NEW_LINE>targetContext.recordContinueFrom(flowContext, flowInfo);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} while ((traversedContext = traversedContext.getLocalParent()) != null);<NEW_LINE>// resize subroutines<NEW_LINE>if (subCount != this.subroutines.length) {<NEW_LINE>System.arraycopy(this.subroutines, 0, this.subroutines = new SubRoutineStatement[subCount], 0, subCount);<NEW_LINE>}<NEW_LINE>return FlowInfo.DEAD_END;<NEW_LINE>}
|
problemReporter().invalidContinue(this);
|
1,761,455
|
public final void updateTreeTableColumn(TreeTableColumn<S, T> col) {<NEW_LINE>// remove style class of existing tree table column, if it is non-null<NEW_LINE>TreeTableColumn<S, T> oldCol = getTableColumn();<NEW_LINE>if (oldCol != null) {<NEW_LINE>oldCol.getStyleClass().removeListener(weakColumnStyleClassListener);<NEW_LINE>getStyleClass().removeAll(oldCol.getStyleClass());<NEW_LINE>oldCol.idProperty().removeListener(weakColumnIdListener);<NEW_LINE>oldCol.styleProperty().removeListener(weakColumnStyleListener);<NEW_LINE>String id = getId();<NEW_LINE>String style = getStyle();<NEW_LINE>if (id != null && id.equals(oldCol.getId())) {<NEW_LINE>setId(null);<NEW_LINE>}<NEW_LINE>if (style != null && style.equals(oldCol.getStyle())) {<NEW_LINE>setStyle("");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>setTableColumn(col);<NEW_LINE>if (col != null) {<NEW_LINE>getStyleClass().<MASK><NEW_LINE>col.getStyleClass().addListener(weakColumnStyleClassListener);<NEW_LINE>col.idProperty().addListener(weakColumnIdListener);<NEW_LINE>col.styleProperty().addListener(weakColumnStyleListener);<NEW_LINE>possiblySetId(col.getId());<NEW_LINE>possiblySetStyle(col.getStyle());<NEW_LINE>}<NEW_LINE>}
|
addAll(col.getStyleClass());
|
847,240
|
public Object handleException(RequestDetails theRequestDetails, BaseServerResponseException theException) throws ServletException, IOException {<NEW_LINE>IRestfulResponse response = theRequestDetails.getResponse();<NEW_LINE>FhirContext ctx = theRequestDetails<MASK><NEW_LINE>IBaseOperationOutcome oo = theException.getOperationOutcome();<NEW_LINE>if (oo == null) {<NEW_LINE>oo = createOperationOutcome(theException, ctx);<NEW_LINE>}<NEW_LINE>int statusCode = theException.getStatusCode();<NEW_LINE>// Add headers associated with the specific error code<NEW_LINE>if (theException.hasResponseHeaders()) {<NEW_LINE>Map<String, List<String>> additional = theException.getResponseHeaders();<NEW_LINE>for (Entry<String, List<String>> next : additional.entrySet()) {<NEW_LINE>if (isNotBlank(next.getKey()) && next.getValue() != null) {<NEW_LINE>String nextKey = next.getKey();<NEW_LINE>for (String nextValue : next.getValue()) {<NEW_LINE>response.addHeader(nextKey, nextValue);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String statusMessage = null;<NEW_LINE>if (theException instanceof UnclassifiedServerFailureException) {<NEW_LINE>String sm = theException.getMessage();<NEW_LINE>if (isNotBlank(sm) && sm.indexOf('\n') == -1) {<NEW_LINE>statusMessage = sm;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>BaseResourceReturningMethodBinding.callOutgoingFailureOperationOutcomeHook(theRequestDetails, oo);<NEW_LINE>return response.streamResponseAsResource(oo, true, Collections.singleton(SummaryEnum.FALSE), statusCode, statusMessage, false, false);<NEW_LINE>}
|
.getServer().getFhirContext();
|
665,262
|
private void cftfsub(int n, float[] a, int offa, int[] ip, int nw, float[] w) {<NEW_LINE>if (n > 8) {<NEW_LINE>if (n > 32) {<NEW_LINE>cftf1st(n, a, offa, w, nw - (n >> 2));<NEW_LINE>if (n > 512) {<NEW_LINE>cftrec4(n, a, offa, nw, w);<NEW_LINE>} else if (n > 128) {<NEW_LINE>cftleaf(n, 1, a, offa, nw, w);<NEW_LINE>} else {<NEW_LINE>cftfx41(n, a, offa, nw, w);<NEW_LINE>}<NEW_LINE>bitrv2(n, ip, a, offa);<NEW_LINE>} else if (n == 32) {<NEW_LINE>cftf161(a, offa, w, nw - 8);<NEW_LINE>bitrv216(a, offa);<NEW_LINE>} else {<NEW_LINE>cftf081(<MASK><NEW_LINE>bitrv208(a, offa);<NEW_LINE>}<NEW_LINE>} else if (n == 8) {<NEW_LINE>cftf040(a, offa);<NEW_LINE>} else if (n == 4) {<NEW_LINE>cftxb020(a, offa);<NEW_LINE>}<NEW_LINE>}
|
a, offa, w, 0);
|
356,818
|
public Response<Void> deleteByIdWithResponse(String id, String ifMatch, Context context) {<NEW_LINE>String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));<NEW_LINE>}<NEW_LINE>String serviceName = Utils.getValueFromIdByName(id, "service");<NEW_LINE>if (serviceName == null) {<NEW_LINE>throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id)));<NEW_LINE>}<NEW_LINE>String gatewayId = <MASK><NEW_LINE>if (gatewayId == null) {<NEW_LINE>throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'gateways'.", id)));<NEW_LINE>}<NEW_LINE>String certificateId = Utils.getValueFromIdByName(id, "certificateAuthorities");<NEW_LINE>if (certificateId == null) {<NEW_LINE>throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'certificateAuthorities'.", id)));<NEW_LINE>}<NEW_LINE>return this.deleteWithResponse(resourceGroupName, serviceName, gatewayId, certificateId, ifMatch, context);<NEW_LINE>}
|
Utils.getValueFromIdByName(id, "gateways");
|
1,622,813
|
public static IRubyObject from_memory(ThreadContext context, IRubyObject cls, IRubyObject[] args) {<NEW_LINE>// args[0]: string, args[1]: url, args[2]: encoding, args[3]: options<NEW_LINE>Ruby runtime = context.getRuntime();<NEW_LINE>// Not nil allowed!<NEW_LINE>if (args[0].isNil()) {<NEW_LINE>throw runtime.newArgumentError("string cannot be nil");<NEW_LINE>}<NEW_LINE>XmlReader reader = (XmlReader) NokogiriService.XML_READER_ALLOCATOR.allocate(runtime, getNokogiriClass(runtime, "Nokogiri::XML::Reader"));<NEW_LINE>reader.init(runtime);<NEW_LINE>reader.setInstanceVariable("@source", args[0]);<NEW_LINE>reader.setInstanceVariable(<MASK><NEW_LINE>IRubyObject url = context.nil;<NEW_LINE>if (args.length > 1) {<NEW_LINE>url = args[1];<NEW_LINE>}<NEW_LINE>if (args.length > 2) {<NEW_LINE>reader.setInstanceVariable("@encoding", args[2]);<NEW_LINE>}<NEW_LINE>Options options;<NEW_LINE>if (args.length > 3) {<NEW_LINE>options = new ParserContext.Options(args[3].toJava(Long.class));<NEW_LINE>} else {<NEW_LINE>// use the default options RECOVER | NONET<NEW_LINE>options = new ParserContext.Options(2048 | 1);<NEW_LINE>}<NEW_LINE>IRubyObject stringIO = runtime.getClass("StringIO").newInstance(context, args[0], Block.NULL_BLOCK);<NEW_LINE>InputStream in = new IOInputStream(stringIO);<NEW_LINE>reader.setInput(context, in, url, options);<NEW_LINE>return reader;<NEW_LINE>}
|
"@errors", runtime.newArray());
|
997,427
|
final GetItemResult executeGetItem(GetItemRequest getItemRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getItemRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetItemRequest> request = null;<NEW_LINE>Response<GetItemResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetItemRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getItemRequest));<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, "DynamoDB");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetItem");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>URI cachedEndpoint = null;<NEW_LINE>if (endpointDiscoveryEnabled) {<NEW_LINE>cachedEndpoint = cache.get(awsCredentialsProvider.getCredentials().getAWSAccessKeyId(), false, endpoint);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetItemResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetItemResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext, cachedEndpoint, null);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
|
HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
|
732,487
|
final CreatePolicyVersionResult executeCreatePolicyVersion(CreatePolicyVersionRequest createPolicyVersionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createPolicyVersionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreatePolicyVersionRequest> request = null;<NEW_LINE>Response<CreatePolicyVersionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreatePolicyVersionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createPolicyVersionRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "IoT");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreatePolicyVersion");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreatePolicyVersionResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreatePolicyVersionResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
|
addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
|
1,309,122
|
private void readSipListeners(SipAppDesc application) throws UnableToAdaptException {<NEW_LINE>Set<String> sipListenerClassesName = _fragmentAnnotations.selectAnnotatedClasses(SipListener.class);<NEW_LINE>if (sipListenerClassesName.isEmpty()) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(tc, "processSipServletAnnotations", "No Listeners found ");<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<String> _sipListeners <MASK><NEW_LINE>for (String cName : sipListenerClassesName) {<NEW_LINE>final String fullyQualifiedClassName = cName;<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(tc, "@SipListener found on class {0}", fullyQualifiedClassName);<NEW_LINE>}<NEW_LINE>_sipListeners.add(fullyQualifiedClassName);<NEW_LINE>}<NEW_LINE>application.setSipListeners(_sipListeners);<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(tc, "processSipServletAnnotations", "Listeners = " + sipListenerClassesName);<NEW_LINE>}<NEW_LINE>}
|
= new LinkedList<String>();
|
1,571,203
|
private void selectItem(int pos) {<NEW_LINE>if (pos < 0 || pos >= mMainMenu.getEntries().length) {<NEW_LINE>pos = 0;<NEW_LINE>}<NEW_LINE>String titlePrefix = getString(R.string.main_activity_title_prefix);<NEW_LINE>getSupportActionBar().setTitle(titlePrefix + mMainMenu.getEntries()[pos]);<NEW_LINE>String nextFragmentTag = "FRAGMENT_TAG_" + Integer.toString(pos);<NEW_LINE>Fragment currentFragment = getSupportFragmentManager().findFragmentById(R.id.container);<NEW_LINE>if (currentFragment != null && nextFragmentTag.equals(currentFragment.getTag())) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Fragment recycledFragment = getSupportFragmentManager().findFragmentByTag(nextFragmentTag);<NEW_LINE>try {<NEW_LINE>FragmentTransaction transaction <MASK><NEW_LINE>if (currentFragment != null) {<NEW_LINE>transaction.detach(currentFragment);<NEW_LINE>}<NEW_LINE>if (recycledFragment != null) {<NEW_LINE>transaction.attach(recycledFragment);<NEW_LINE>} else {<NEW_LINE>transaction.add(R.id.container, mMainMenu.createFragment(pos), nextFragmentTag);<NEW_LINE>}<NEW_LINE>transaction.commit();<NEW_LINE>getSupportFragmentManager().executePendingTransactions();<NEW_LINE>// The header takes the first position.<NEW_LINE>mDrawerMenu.setItemChecked(pos + 1, true);<NEW_LINE>getAppPreferences().edit().putInt(PREF_LAST_SCREEN_ID, pos).apply();<NEW_LINE>} catch (InstantiationException e) {<NEW_LINE>Log.wtf(LoggingService.LOG_TAG, "Error while instantiating the selected fragment", e);<NEW_LINE>} catch (IllegalAccessException e) {<NEW_LINE>Log.wtf(LoggingService.LOG_TAG, "Error while instantiating the selected fragment", e);<NEW_LINE>}<NEW_LINE>}
|
= getSupportFragmentManager().beginTransaction();
|
968,137
|
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {<NEW_LINE>if (!openAsDialog()) {<NEW_LINE>OsmandApplication app = getMyApplication();<NEW_LINE>boolean nightMode = !app<MASK><NEW_LINE>int colorResId = ColorUtilities.getActiveButtonsAndLinksTextColorId(nightMode);<NEW_LINE>MenuItem itemReload = menu.add(0, RELOAD_ID, 0, R.string.shared_string_refresh);<NEW_LINE>Drawable icReload = app.getUIUtilities().getIcon(R.drawable.ic_action_refresh_dark, colorResId);<NEW_LINE>itemReload.setIcon(icReload);<NEW_LINE>itemReload.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);<NEW_LINE>MenuItem itemSearch = menu.add(0, SEARCH_ID, 1, R.string.shared_string_search);<NEW_LINE>Drawable icSearch = app.getUIUtilities().getIcon(R.drawable.ic_action_search_dark, colorResId);<NEW_LINE>itemSearch.setIcon(icSearch);<NEW_LINE>itemSearch.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);<NEW_LINE>}<NEW_LINE>}
|
.getSettings().isLightContent();
|
770,731
|
public static void analyzeHeap(List<String> classNames, List<File> dumps) throws IOException {<NEW_LINE>for (File dump : dumps) {<NEW_LINE>String dumpName = dump.getName();<NEW_LINE>Heap heap = HeapFactory.createHeap(dump);<NEW_LINE>System.out.println(dumpName + "\tTotal.JavaHeap\tsize:\t" + heap.getSummary().getTotalLiveBytes());<NEW_LINE>for (String className : classNames) {<NEW_LINE>long instances = 0L;<NEW_LINE>long size = 0L;<NEW_LINE>JavaClass javaClass = heap.getJavaClassByName(className);<NEW_LINE>if (javaClass != null) {<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>Collection<JavaClass> subClasses = javaClass.getSubClasses();<NEW_LINE>subClasses.add(javaClass);<NEW_LINE>for (JavaClass subClass : subClasses) {<NEW_LINE>instances += subClass.getInstancesCount();<NEW_LINE>size += subClass.getAllInstancesSize();<NEW_LINE>}<NEW_LINE>String prefix = dumpName + "\t" + className;<NEW_LINE>System.out.<MASK><NEW_LINE>System.out.println(prefix + "\tsize:\t" + size);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
println(prefix + "\tinstances:\t" + instances);
|
1,356,490
|
public Statement parseStatement() throws ParseException {<NEW_LINE>// look for any labels preceding statement<NEW_LINE>Mark m = tq.mark();<NEW_LINE>Token<JsTokenType<MASK><NEW_LINE>if (JsTokenType.WORD == t.type) {<NEW_LINE>String label = parseIdentifier(false);<NEW_LINE>FilePosition labelPos = t.pos;<NEW_LINE>if (tq.checkToken(Punctuation.COLON)) {<NEW_LINE>t = tq.peek();<NEW_LINE>AbstractStatement s = null;<NEW_LINE>if (JsTokenType.KEYWORD == t.type) {<NEW_LINE>switch(Keyword.fromString(t.text)) {<NEW_LINE>case FOR:<NEW_LINE>case DO:<NEW_LINE>case WHILE:<NEW_LINE>case SWITCH:<NEW_LINE>s = parseLoopOrSwitch(labelPos, label);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (null == s) {<NEW_LINE>Statement labelless = parseStatementWithoutLabel();<NEW_LINE>s = new LabeledStmtWrapper(posFrom(m), label, labelless);<NEW_LINE>}<NEW_LINE>finish(s, m);<NEW_LINE>return s;<NEW_LINE>}<NEW_LINE>tq.rewind(m);<NEW_LINE>}<NEW_LINE>return parseStatementWithoutLabel();<NEW_LINE>}
|
> t = tq.peek();
|
1,648,302
|
public LowLevelHttpResponse execute() throws IOException {<NEW_LINE>if (tokenRequestStatusCode != null) {<NEW_LINE>MockLowLevelHttpResponse response = new MockLowLevelHttpResponse().setStatusCode(tokenRequestStatusCode).setContent("Token Fetch Error");<NEW_LINE>return response;<NEW_LINE>}<NEW_LINE>String metadataRequestHeader = getFirstHeaderValue("Metadata-Flavor");<NEW_LINE>if (!"Google".equals(metadataRequestHeader)) {<NEW_LINE>throw new IOException("Metadata request header not found.");<NEW_LINE>}<NEW_LINE>// Create the JSon response<NEW_LINE>GenericJson refreshContents = new GenericJson();<NEW_LINE>refreshContents.setFactory(JSON_FACTORY);<NEW_LINE>refreshContents.put("access_token", accessToken);<NEW_LINE>refreshContents.put("expires_in", 3600000);<NEW_LINE>refreshContents.put("token_type", "Bearer");<NEW_LINE><MASK><NEW_LINE>MockLowLevelHttpResponse response = new MockLowLevelHttpResponse().setContentType(Json.MEDIA_TYPE).setContent(refreshText);<NEW_LINE>return response;<NEW_LINE>}
|
String refreshText = refreshContents.toPrettyString();
|
1,754,712
|
public void watch(GameEvent event, Game game) {<NEW_LINE>if (event.getType() == GameEvent.EventType.UPKEEP_STEP_POST) {<NEW_LINE>// clear the watcher after upkeep<NEW_LINE>blockedOrBeenBlockedCreatures.put(event.getPlayerId(), new HashSet<>());<NEW_LINE>} else if (event.getType() == GameEvent.EventType.BLOCKER_DECLARED) {<NEW_LINE>// store blocker<NEW_LINE>MageObjectReference morBlocker = new MageObjectReference(event.getSourceId(), game);<NEW_LINE>// store attacker blocked<NEW_LINE>MageObjectReference morAttackerBlocked = new MageObjectReference(<MASK><NEW_LINE>for (UUID player : game.getPlayerList()) {<NEW_LINE>if (!blockedOrBeenBlockedCreatures.containsKey(player)) {<NEW_LINE>blockedOrBeenBlockedCreatures.put(player, new HashSet<>());<NEW_LINE>}<NEW_LINE>blockedOrBeenBlockedCreatures.get(player).add(morBlocker);<NEW_LINE>blockedOrBeenBlockedCreatures.get(player).add(morAttackerBlocked);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
event.getTargetId(), game);
|
1,803,975
|
public ApiResponse<Void> publicSharesSendUploadNotificationWithHttpInfo(String id) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// verify the required parameter 'id' is set<NEW_LINE>if (id == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'id' when calling publicSharesSendUploadNotification");<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/v4/publicshares/{id}/uploadnotification".replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));<NEW_LINE>// query params<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = {};<NEW_LINE>final String <MASK><NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] localVarAuthNames = new String[] { "oauth2" };<NEW_LINE>return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);<NEW_LINE>}
|
localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
456,554
|
public boolean storeEntry(AuditLogEntry entry) {<NEW_LINE>LOGGER.debug("Storing entry {}", entry);<NEW_LINE>// Note checks for action, time and action are redundant since<NEW_LINE>// they are already checked in AuditLogEntry<NEW_LINE>if (entry == null || entry.getAction() == null || entry.getUser() == null || entry.getTime() == null) {<NEW_LINE>throw new RepositoryException("Can not insert AuditLogEntry " + entry + " into database, required values are null.");<NEW_LINE>}<NEW_LINE>// If application name is null use global entry name<NEW_LINE>String applicationName = AuditLogRepository.GLOBAL_ENTRY_APPLICATION.toString();<NEW_LINE>if (entry.getApplicationName() != null && !StringUtils.isBlank(entry.getApplicationName().toString())) {<NEW_LINE>applicationName = entry.getApplicationName().toString();<NEW_LINE>}<NEW_LINE>Date time = entry.getTime().getTime();<NEW_LINE>String action = entry.getAction().toString();<NEW_LINE>String firstName = makeEmptyStringForNull(entry.getUser().getFirstName());<NEW_LINE>String lastName = makeEmptyStringForNull(entry.getUser().getLastName());<NEW_LINE>String email = makeEmptyStringForNull(entry.getUser().getEmail());<NEW_LINE>String userId = makeEmptyStringForNull(entry.getUser().getUserId());<NEW_LINE>String userName = makeEmptyStringForNull(entry.getUser().getUsername().getUsername());<NEW_LINE>UUID experimentId = entry.getExperimentId() == null ? null : entry.getExperimentId().getRawID();<NEW_LINE>String experimentLabel = entry.getExperimentLabel() == null ? "" : entry.getExperimentLabel().toString();<NEW_LINE>String bucketLabel = entry.getBucketLabel() == null ? "" : entry.getBucketLabel().toString();<NEW_LINE>String changedProperty = makeEmptyStringForNull(entry.getChangedProperty());<NEW_LINE>String before = <MASK><NEW_LINE>String after = makeEmptyStringForNull(entry.getAfter());<NEW_LINE>accessor.storeEntry(applicationName, time, action, firstName, lastName, email, userName, userId, experimentId, experimentLabel, bucketLabel, changedProperty, before, after);<NEW_LINE>return true;<NEW_LINE>}
|
makeEmptyStringForNull(entry.getBefore());
|
1,343,053
|
private void deleteIsomorphism() {<NEW_LINE>int[] compacted = new int[nextFreeCell - _removedCells];<NEW_LINE>int[] nodes = new int[<MASK><NEW_LINE>int[] gains = new int[_nodesToRemove.size() + 1];<NEW_LINE>int idx = 1;<NEW_LINE>if (_nodesToRemove.isEmpty()) {<NEW_LINE>// If no equality detected, simply resize the array<NEW_LINE>System.arraycopy(mdd, 0, compacted, 0, nextFreeCell);<NEW_LINE>mdd = compacted;<NEW_LINE>} else {<NEW_LINE>int to, from = 0;<NEW_LINE>int gain = 0;<NEW_LINE>int[] keys = _nodesToRemove.keys();<NEW_LINE>Arrays.sort(keys);<NEW_LINE>// otherwise, iterate over nodes to remove<NEW_LINE>for (int k : keys) {<NEW_LINE>// node to remove<NEW_LINE>nodes[idx] = k;<NEW_LINE>to = nodes[idx] - nodes[idx - 1] - gain;<NEW_LINE>System.arraycopy(mdd, nodes[idx - 1] + gain, compacted, from, to);<NEW_LINE>from += to;<NEW_LINE>gain = _nodesToRemove.get(k);<NEW_LINE>gains[idx] = gains[idx - 1] + gain;<NEW_LINE>idx++;<NEW_LINE>}<NEW_LINE>System.arraycopy(mdd, nodes[idx - 1] + gain, compacted, from, compacted.length - from);<NEW_LINE>for (int i = 0; i < compacted.length; i++) {<NEW_LINE>if (compacted[i] > EMPTY) {<NEW_LINE>compacted[i] -= gains[searchClosest(nodes, compacted[i])];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>mdd = compacted;<NEW_LINE>nextFreeCell -= _removedCells;<NEW_LINE>}<NEW_LINE>}
|
_nodesToRemove.size() + 1];
|
1,127,122
|
int calcColumn(int matcherStart) {<NEW_LINE>try {<NEW_LINE>while (bcs.position() < matcherStart) {<NEW_LINE><MASK><NEW_LINE>switch(curChar) {<NEW_LINE>case BufferedCharSequence.UnicodeLineTerminator.LF:<NEW_LINE>case BufferedCharSequence.UnicodeLineTerminator.PS:<NEW_LINE>case BufferedCharSequence.UnicodeLineTerminator.LS:<NEW_LINE>case BufferedCharSequence.UnicodeLineTerminator.NEL:<NEW_LINE>lineNumber++;<NEW_LINE>lineStartOffset = bcs.position();<NEW_LINE>prevCR = 0;<NEW_LINE>break;<NEW_LINE>case BufferedCharSequence.UnicodeLineTerminator.CR:<NEW_LINE>prevCR++;<NEW_LINE>char nextChar = bcs.charAt(bcs.position());<NEW_LINE>if (nextChar != BufferedCharSequence.UnicodeLineTerminator.LF) {<NEW_LINE>lineNumber++;<NEW_LINE>lineStartOffset = bcs.position();<NEW_LINE>prevCR = 0;<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>prevCR = 0;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (IndexOutOfBoundsException ioobe) {<NEW_LINE>// It is OK. It means that EOF is reached, i.e.<NEW_LINE>// bcs.position() >= bcs.length()<NEW_LINE>}<NEW_LINE>int column = matcherStart - lineStartOffset + 1 - prevCR;<NEW_LINE>return column;<NEW_LINE>}
|
char curChar = bcs.nextChar();
|
1,285,990
|
public ResultMap scoreWithDetails(long user, @Nonnull Collection<Long> items) {<NEW_LINE>Long2DoubleMap history = dao.userRatingVector(user);<NEW_LINE>logger.debug("Predicting for {} items for user {} with {} events", items.size(), user, history.size());<NEW_LINE>LongSortedSet itemSet = LongUtils.packedSet(items);<NEW_LINE>Long2ObjectMap<List<Neighbor>> neighborhoods = findNeighbors(user, itemSet);<NEW_LINE>// Make the normalizing transform to reverse<NEW_LINE>InvertibleFunction<Long2DoubleMap, Long2DoubleMap> xform = normalizer.makeTransformation(user, history);<NEW_LINE>// And prepare results<NEW_LINE>List<UserUserResult> rawResults = new ArrayList<>();<NEW_LINE>LongIterator iter = itemSet.iterator();<NEW_LINE>while (iter.hasNext()) {<NEW_LINE>final long item = iter.nextLong();<NEW_LINE>double sum = 0;<NEW_LINE>double weight = 0;<NEW_LINE>int count = 0;<NEW_LINE>List<Neighbor> nbrs = neighborhoods.get(item);<NEW_LINE>UserUserResult score = <MASK><NEW_LINE>if (score != null) {<NEW_LINE>if (logger.isTraceEnabled()) {<NEW_LINE>logger.trace("result {}", score);<NEW_LINE>}<NEW_LINE>rawResults.add(score);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// de-normalize the results<NEW_LINE>Long2DoubleMap itemScores = new Long2DoubleOpenHashMap(rawResults.size());<NEW_LINE>for (UserUserResult r : rawResults) {<NEW_LINE>itemScores.put(r.getId(), r.getScore());<NEW_LINE>}<NEW_LINE>itemScores = xform.unapply(itemScores);<NEW_LINE>// and finish up<NEW_LINE>List<Result> results = new ArrayList<>(rawResults.size());<NEW_LINE>for (UserUserResult r : rawResults) {<NEW_LINE>results.add(r.copyBuilder().setScore(itemScores.get(r.getId())).build());<NEW_LINE>}<NEW_LINE>return Results.newResultMap(results);<NEW_LINE>}
|
neighborhoodScorer.score(item, nbrs);
|
327,773
|
public void run(final JobExecutionContext jobContext) throws JobExecutionException {<NEW_LINE>final Permissionable permissionable;<NEW_LINE>final Trigger trigger = jobContext.getTrigger();<NEW_LINE>final Map<String, Serializable> map = getExecutionData(trigger, CascadePermissionsJob.class);<NEW_LINE>final String permissionableId = (String) map.get("permissionableId");<NEW_LINE>final String roleId = (String) map.get("roleId");<NEW_LINE>final String userId = (<MASK><NEW_LINE>try {<NEW_LINE>permissionable = retrievePermissionable(permissionableId);<NEW_LINE>final Role role = roleAPI.loadRoleById(roleId);<NEW_LINE>permissionAPI.cascadePermissionUnder(permissionable, role);<NEW_LINE>permissionAPI.removePermissionableFromCache(permissionable.getPermissionId());<NEW_LINE>if (UtilMethods.isSet(userId)) {<NEW_LINE>// no actions<NEW_LINE>notificationAPI.// no actions<NEW_LINE>generateNotification(// no actions<NEW_LINE>new I18NMessage("notification.identifier.cascadepermissionsjob.info.title"), // no actions<NEW_LINE>new I18NMessage("notification.cascade.permissions.success"), null, NotificationLevel.INFO, NotificationType.GENERIC, Visibility.USER, userId, userId, userAPI.getSystemUser().getLocale());<NEW_LINE>}<NEW_LINE>Logger.info(CascadePermissionsJob.class, String.format("CascadePermissionsJob ::: finished for role `%s` and user `%s` .", roleId, userId));<NEW_LINE>} catch (DotDataException | DotSecurityException e) {<NEW_LINE>Logger.error(CascadePermissionsJob.class, e.getMessage(), e);<NEW_LINE>if (UtilMethods.isSet(userId)) {<NEW_LINE>try {<NEW_LINE>// no actions<NEW_LINE>notificationAPI.// no actions<NEW_LINE>generateNotification(// no actions<NEW_LINE>new I18NMessage("notification.identifier.cascadepermissionsjob.info.title"), // no actions<NEW_LINE>new I18NMessage("notification.cascade.permissions.error"), null, NotificationLevel.ERROR, NotificationType.GENERIC, Visibility.USER, userId, userId, userAPI.getSystemUser().getLocale());<NEW_LINE>} catch (DotDataException e1) {<NEW_LINE>Logger.error(CascadePermissionsJob.class, e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw new DotRuntimeException(e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
|
String) map.get("userId");
|
1,816,141
|
public void run() {<NEW_LINE>fGraphicalViewer = getWorkbenchPart().getAdapter(GraphicalViewer.class);<NEW_LINE>fOldParent = fGraphicalViewer.getControl().getParent();<NEW_LINE>fOldPaletteViewer = fGraphicalViewer.getEditDomain().getPaletteViewer();<NEW_LINE>// Set Property so clients know this is in full screen mode<NEW_LINE>// $NON-NLS-1$<NEW_LINE>fGraphicalViewer.setProperty("full_screen", true);<NEW_LINE>addKeyBindings();<NEW_LINE>// Add key and menu listeners<NEW_LINE>fGraphicalViewer.getContextMenu().addMenuListener(contextMenuListener);<NEW_LINE>fGraphicalViewer.getControl().addKeyListener(keyListener);<NEW_LINE>// Create new Shell<NEW_LINE>fNewShell = new Shell(Display.getCurrent(), SWT.NONE);<NEW_LINE>// To put the full screen on the current monitor<NEW_LINE>fNewShell.setLocation(fOldParent.getShell().getLocation());<NEW_LINE>fNewShell.setFullScreen(true);<NEW_LINE>fNewShell.setMaximized(true);<NEW_LINE>fNewShell.setText(Display.getAppName());<NEW_LINE>fNewShell.setLayout(new FillLayout());<NEW_LINE>fNewShell.setImage(IArchiImages.ImageFactory.getImage(IArchiImages.ICON_APP_128));<NEW_LINE>// On Ubuntu the min/max/close buttons are shown, so trap the close button<NEW_LINE>fNewShell.addShellListener(new ShellAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void shellClosed(ShellEvent e) {<NEW_LINE>close();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// Set the Viewer's control's parent to be the new Shell<NEW_LINE>fGraphicalViewer.getControl().setParent(fNewShell);<NEW_LINE>fNewShell.layout();<NEW_LINE>fNewShell.open();<NEW_LINE>fFloatingPalette = new FloatingPalette((IDiagramModelEditor) ((DefaultEditDomain) fGraphicalViewer.getEditDomain()).getEditorPart(), fNewShell);<NEW_LINE>if (fFloatingPalette.getPaletteState().isOpen) {<NEW_LINE>fFloatingPalette.open();<NEW_LINE>}<NEW_LINE>// Disable the old parent shell<NEW_LINE>fOldParent.getShell().setEnabled(false);<NEW_LINE>// Listen to Parts being closed<NEW_LINE>getWorkbenchPart().getSite().getWorkbenchWindow().<MASK><NEW_LINE>// Set Focus on new Shell<NEW_LINE>fNewShell.setFocus();<NEW_LINE>}
|
getPartService().addPartListener(partListener);
|
271,483
|
public Object resolveConstructorArgument(String paramName, Class<?> paramType, NativeWebRequest request) throws Exception {<NEW_LINE>MultipartRequest multipartRequest = <MASK><NEW_LINE>if (multipartRequest != null) {<NEW_LINE>List<MultipartFile> files = multipartRequest.getFiles(paramName);<NEW_LINE>if (!files.isEmpty()) {<NEW_LINE>return (files.size() == 1 ? files.get(0) : files);<NEW_LINE>}<NEW_LINE>} else if (StringUtils.startsWithIgnoreCase(request.getHeader(HttpHeaders.CONTENT_TYPE), MediaType.MULTIPART_FORM_DATA_VALUE)) {<NEW_LINE>HttpServletRequest servletRequest = request.getNativeRequest(HttpServletRequest.class);<NEW_LINE>if (servletRequest != null && HttpMethod.POST.matches(servletRequest.getMethod())) {<NEW_LINE>List<Part> parts = StandardServletPartUtils.getParts(servletRequest, paramName);<NEW_LINE>if (!parts.isEmpty()) {<NEW_LINE>return (parts.size() == 1 ? parts.get(0) : parts);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
|
request.getNativeRequest(MultipartRequest.class);
|
356,702
|
public void supplierPartnerDomain(ActionRequest request, ActionResponse response) {<NEW_LINE>PurchaseOrderSupplierLine purchaseOrderSupplierLine = request.getContext().asType(PurchaseOrderSupplierLine.class);<NEW_LINE>PurchaseOrderLine purchaseOrderLine = purchaseOrderSupplierLine.getPurchaseOrderLine();<NEW_LINE>if (purchaseOrderLine == null) {<NEW_LINE>purchaseOrderLine = request.getContext().getParent().asType(PurchaseOrderLine.class);<NEW_LINE>}<NEW_LINE>PurchaseOrder purchaseOrder = request.getContext().getParent().getParent().asType(PurchaseOrder.class);<NEW_LINE>if (purchaseOrder.getId() != null) {<NEW_LINE>purchaseOrder = purchaseOrderLine.getPurchaseOrder();<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>String domain = "";<NEW_LINE>if (Beans.get(AppPurchaseService.class).getAppPurchase().getManageSupplierCatalog() && purchaseOrderLine.getProduct() != null && !purchaseOrderLine.getProduct().getSupplierCatalogList().isEmpty()) {<NEW_LINE>domain += "self.id != " + company.getPartner().getId() + " AND self.id IN " + purchaseOrderLine.getProduct().getSupplierCatalogList().stream().map(s -> s.getSupplierPartner().getId()).collect(Collectors.toList()).toString().replace('[', '(').replace(']', ')');<NEW_LINE>String blockedPartnerQuery = Beans.get(BlockingService.class).listOfBlockedPartner(company, BlockingRepository.PURCHASE_BLOCKING);<NEW_LINE>if (!Strings.isNullOrEmpty(blockedPartnerQuery)) {<NEW_LINE>domain += String.format(" AND self.id NOT in (%s)", blockedPartnerQuery);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>domain += "self.id = 0";<NEW_LINE>}<NEW_LINE>domain += " AND " + company.getId() + " in (SELECT id FROM self.companySet)";<NEW_LINE>response.setAttr("supplierPartner", "domain", domain);<NEW_LINE>}
|
Company company = purchaseOrder.getCompany();
|
464,331
|
public APNSVoipSandboxChannelRequest unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>AwsJsonReader reader = context.getReader();<NEW_LINE>if (!reader.isContainer()) {<NEW_LINE>reader.skipValue();<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>APNSVoipSandboxChannelRequest aPNSVoipSandboxChannelRequest = new APNSVoipSandboxChannelRequest();<NEW_LINE>reader.beginObject();<NEW_LINE>while (reader.hasNext()) {<NEW_LINE>String name = reader.nextName();<NEW_LINE>if (name.equals("BundleId")) {<NEW_LINE>aPNSVoipSandboxChannelRequest.setBundleId(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("Certificate")) {<NEW_LINE>aPNSVoipSandboxChannelRequest.setCertificate(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("DefaultAuthenticationMethod")) {<NEW_LINE>aPNSVoipSandboxChannelRequest.setDefaultAuthenticationMethod(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("Enabled")) {<NEW_LINE>aPNSVoipSandboxChannelRequest.setEnabled(BooleanJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("PrivateKey")) {<NEW_LINE>aPNSVoipSandboxChannelRequest.setPrivateKey(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("TeamId")) {<NEW_LINE>aPNSVoipSandboxChannelRequest.setTeamId(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("TokenKey")) {<NEW_LINE>aPNSVoipSandboxChannelRequest.setTokenKey(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("TokenKeyId")) {<NEW_LINE>aPNSVoipSandboxChannelRequest.setTokenKeyId(StringJsonUnmarshaller.getInstance<MASK><NEW_LINE>} else {<NEW_LINE>reader.skipValue();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>reader.endObject();<NEW_LINE>return aPNSVoipSandboxChannelRequest;<NEW_LINE>}
|
().unmarshall(context));
|
1,000,989
|
private boolean addDirectoryInfo(String path, long quota, Map<String, MountedStorage> storageMap) throws IOException {<NEW_LINE>File file = new File(path);<NEW_LINE>if (!file.exists()) {<NEW_LINE>System.err.format("Path %s does not exist.%n", path);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (!file.isDirectory()) {<NEW_LINE>System.err.format("Path %s is not a valid directory.%n", path);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>long <MASK><NEW_LINE>// gets mounted FileStore that backs the directory of the given path<NEW_LINE>FileStore store = Files.getFileStore(Paths.get(path));<NEW_LINE>MountedStorage storage = storageMap.get(store.name());<NEW_LINE>if (storage == null) {<NEW_LINE>storage = new MountedStorage(store);<NEW_LINE>storageMap.put(store.name(), storage);<NEW_LINE>}<NEW_LINE>storage.addDirectoryInfo(path, quota, directorySize);<NEW_LINE>return true;<NEW_LINE>}
|
directorySize = FileUtils.sizeOfDirectory(file);
|
463,749
|
private void resetValues() {<NEW_LINE>mPdfOptions = new ImageToPDFOptions();<NEW_LINE>mPdfOptions.setBorderWidth(mSharedPreferences.getInt(DEFAULT_IMAGE_BORDER_TEXT, DEFAULT_BORDER_WIDTH));<NEW_LINE>mPdfOptions.setQualityString(Integer.toString(mSharedPreferences.getInt(DEFAULT_COMPRESSION, DEFAULT_QUALITY_VALUE)));<NEW_LINE>mPdfOptions.setPageSize(mSharedPreferences.getString(DEFAULT_PAGE_SIZE_TEXT, DEFAULT_PAGE_SIZE));<NEW_LINE>mPdfOptions.setPasswordProtected(false);<NEW_LINE>mPdfOptions.setWatermarkAdded(false);<NEW_LINE>mImagesUri.clear();<NEW_LINE>showEnhancementOptions();<NEW_LINE>mNoOfImages.setVisibility(View.GONE);<NEW_LINE>ImageUtils.getInstance().mImageScaleType = mSharedPreferences.getString(DEFAULT_IMAGE_SCALE_TYPE_TEXT, IMAGE_SCALE_TYPE_ASPECT_RATIO);<NEW_LINE>mPdfOptions.setMargins(0, 0, 0, 0);<NEW_LINE>mPageNumStyle = mSharedPreferences.getString(Constants.PREF_PAGE_STYLE, null);<NEW_LINE>mPageColor = mSharedPreferences.<MASK><NEW_LINE>}
|
getInt(Constants.DEFAULT_PAGE_COLOR_ITP, DEFAULT_PAGE_COLOR);
|
1,525,692
|
public synchronized void createTweet(Status status, int account) {<NEW_LINE>ContentValues values = new ContentValues();<NEW_LINE>String originalName = "";<NEW_LINE>long id = status.getId();<NEW_LINE>long time = status<MASK><NEW_LINE>String[] html = TweetLinkUtils.getLinksInStatus(status);<NEW_LINE>String text = html[0];<NEW_LINE>String media = html[1];<NEW_LINE>String otherUrl = html[2];<NEW_LINE>String hashtags = html[3];<NEW_LINE>String users = html[4];<NEW_LINE>if (media.contains("/tweet_video/")) {<NEW_LINE>media = media.replace("tweet_video", "tweet_video_thumb").replace(".mp4", ".png");<NEW_LINE>}<NEW_LINE>values.put(MentionsSQLiteHelper.COLUMN_ACCOUNT, account);<NEW_LINE>values.put(MentionsSQLiteHelper.COLUMN_TEXT, text);<NEW_LINE>values.put(MentionsSQLiteHelper.COLUMN_TWEET_ID, id);<NEW_LINE>values.put(MentionsSQLiteHelper.COLUMN_NAME, status.getUser().getName());<NEW_LINE>values.put(MentionsSQLiteHelper.COLUMN_PRO_PIC, status.getUser().getOriginalProfileImageURL());<NEW_LINE>values.put(MentionsSQLiteHelper.COLUMN_SCREEN_NAME, status.getUser().getScreenName());<NEW_LINE>values.put(MentionsSQLiteHelper.COLUMN_TIME, time);<NEW_LINE>values.put(MentionsSQLiteHelper.COLUMN_RETWEETER, originalName);<NEW_LINE>values.put(MentionsSQLiteHelper.COLUMN_UNREAD, 1);<NEW_LINE>values.put(MentionsSQLiteHelper.COLUMN_PIC_URL, media);<NEW_LINE>values.put(MentionsSQLiteHelper.COLUMN_URL, otherUrl);<NEW_LINE>values.put(MentionsSQLiteHelper.COLUMN_USERS, users);<NEW_LINE>values.put(MentionsSQLiteHelper.COLUMN_HASHTAGS, hashtags);<NEW_LINE>values.put(MentionsSQLiteHelper.COLUMN_ANIMATED_GIF, TweetLinkUtils.getGIFUrl(status, otherUrl));<NEW_LINE>values.put(HomeSQLiteHelper.COLUMN_CONVERSATION, status.getInReplyToStatusId() == -1 ? 0 : 1);<NEW_LINE>try {<NEW_LINE>database.insert(MentionsSQLiteHelper.TABLE_MENTIONS, null, values);<NEW_LINE>} catch (Exception e) {<NEW_LINE>open();<NEW_LINE>database.insert(MentionsSQLiteHelper.TABLE_MENTIONS, null, values);<NEW_LINE>}<NEW_LINE>}
|
.getCreatedAt().getTime();
|
1,760,989
|
public List<Template> findTemplates(final User user, final boolean includeArchived, final Map<String, Object> params, final String hostId, final String inode, final String identifier, final String parent, final int offset, final int limit, final String orderBy) throws DotSecurityException, DotDataException {<NEW_LINE>Logger.debug(this, () -> "Calling findTemplates, params " + params + ", user:" + user.getUserId() + ", inode = " + inode + ", id: " + identifier + ", parent: " + parent);<NEW_LINE>return // if it is the first page and do not include archived, include the system template<NEW_LINE>offset == 0 && !includeArchived ? this.includeSystemTemplate(templateFactory.findTemplates(user, includeArchived, params, hostId, inode, identifier, parent, offset, limit, orderBy)) : this.templateFactory.findTemplates(user, includeArchived, params, hostId, inode, identifier, <MASK><NEW_LINE>}
|
parent, offset, limit, orderBy);
|
39,541
|
private void loadNode1135() {<NEW_LINE>BaseDataVariableTypeNode node = new BaseDataVariableTypeNode(this.context, Identifiers.ServerStatusType_BuildInfo_ProductName, new QualifiedName(0, "ProductName"), new LocalizedText("en", "ProductName"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.String, -1, new UInteger[] {}, UByte.valueOf(1), UByte.valueOf(1), 1000.0, false);<NEW_LINE>node.addReference(new Reference(Identifiers.ServerStatusType_BuildInfo_ProductName, Identifiers.HasTypeDefinition, Identifiers.BaseDataVariableType.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ServerStatusType_BuildInfo_ProductName, Identifiers.HasModellingRule, Identifiers.ModellingRule_Mandatory<MASK><NEW_LINE>node.addReference(new Reference(Identifiers.ServerStatusType_BuildInfo_ProductName, Identifiers.HasComponent, Identifiers.ServerStatusType_BuildInfo.expanded(), false));<NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>}
|
.expanded(), true));
|
511,189
|
public CEditor addUOM(Object feature, MLookup uomLookup, int c_uom_id) {<NEW_LINE>String name = "";<NEW_LINE>String description = "";<NEW_LINE>int displayType = uomLookup.getDisplayType();<NEW_LINE>WEditor uomEditor = null;<NEW_LINE>if (displayType == DisplayType.TableDir || displayType == DisplayType.Table || displayType == DisplayType.List || displayType == DisplayType.ID) {<NEW_LINE>uomEditor = new WTableDirEditor(uomLookup, name, <MASK><NEW_LINE>} else if (displayType == DisplayType.Search) {<NEW_LINE>uomEditor = new WSearchEditor(uomLookup, name, description, true, false, true);<NEW_LINE>}<NEW_LINE>if (uomEditor != null) {<NEW_LINE>uomEditor.setValue(c_uom_id);<NEW_LINE>uomEditor.addValueChangeListener(controller);<NEW_LINE>((HtmlBasedComponent) uomEditor.getComponent()).setWidth("100%");<NEW_LINE>boxBOMItem.appendChild(uomEditor.getComponent());<NEW_LINE>}<NEW_LINE>return uomEditor;<NEW_LINE>}
|
description, true, false, true);
|
908,360
|
public static SyncFileNotEnoughSpaceDialogFragment newInstance(OCFile file, long availableDeviceSpace) {<NEW_LINE>Bundle args = new Bundle();<NEW_LINE>SyncFileNotEnoughSpaceDialogFragment frag = new SyncFileNotEnoughSpaceDialogFragment();<NEW_LINE>String properFileSize = DisplayUtils.bytesToHumanReadable(file.getFileLength());<NEW_LINE>String properDiskAvailableSpace = DisplayUtils.bytesToHumanReadable(availableDeviceSpace);<NEW_LINE>// Defining title, message and resources<NEW_LINE>args.putInt(<MASK><NEW_LINE>args.putInt(ARG_MESSAGE_RESOURCE_ID, R.string.sync_not_enough_space_dialog_placeholder);<NEW_LINE>args.putStringArray(ARG_MESSAGE_ARGUMENTS, new String[] { file.getFileName(), properFileSize, properDiskAvailableSpace });<NEW_LINE>args.putParcelable(ARG_PASSED_FILE, file);<NEW_LINE>// Defining buttons<NEW_LINE>if (file.isFolder()) {<NEW_LINE>args.putInt(ARG_POSITIVE_BTN_RES, R.string.sync_not_enough_space_dialog_action_choose);<NEW_LINE>}<NEW_LINE>if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.N_MR1) {<NEW_LINE>args.putInt(ARG_NEGATIVE_BTN_RES, R.string.sync_not_enough_space_dialog_action_free_space);<NEW_LINE>}<NEW_LINE>args.putInt(ARG_NEUTRAL_BTN_RES, R.string.common_cancel);<NEW_LINE>frag.setArguments(args);<NEW_LINE>return frag;<NEW_LINE>}
|
ARG_TITLE_ID, R.string.sync_not_enough_space_dialog_title);
|
1,469,115
|
public void flushToLocalStorage() {<NEW_LINE>MatrixStorage storage = PSAgentContext.get().getMatrixStorageManager().getMatrixStoage(matrixId);<NEW_LINE>MatrixMeta matrixMeta = PSAgentContext.get().getMatrixMetaManager().getMatrixMeta(matrixId);<NEW_LINE>int row = matrixMeta.getRowNum();<NEW_LINE>Vector deltaVector;<NEW_LINE>Vector vector;<NEW_LINE>ReentrantReadWriteLock globalStorageLock = storage.getLock();<NEW_LINE>try {<NEW_LINE>globalStorageLock.writeLock().lock();<NEW_LINE>for (int rowIndex = 0; rowIndex < row; rowIndex++) {<NEW_LINE>deltaVector = getRow(rowIndex);<NEW_LINE>vector = storage.getRow(rowIndex);<NEW_LINE>if (deltaVector == null || vector == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>vector.iaxpy(deltaVector, 1.0 / PSAgentContext.get().getTotalTaskNum());<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>globalStorageLock<MASK><NEW_LINE>}<NEW_LINE>}
|
.writeLock().unlock();
|
1,538,165
|
public void execute(String label) {<NEW_LINE>// move cursor to next insert location<NEW_LINE>Position pos = moveCursorToNextInsertLocation();<NEW_LINE>// truncate length to print margin - 5<NEW_LINE>int printMarginColumn = prefs_.marginColumn().getValue();<NEW_LINE>int length = printMarginColumn - 5;<NEW_LINE>// truncate label to maxLength - 10 (but always allow at<NEW_LINE>// least 20 chars for the label)<NEW_LINE>int maxLabelLength = length - 10;<NEW_LINE>maxLabelLength = Math.max(maxLabelLength, 20);<NEW_LINE>if (label.length() > maxLabelLength)<NEW_LINE>label = label.substring(0, maxLabelLength - 1);<NEW_LINE>// prefix<NEW_LINE>String prefix = "# ";<NEW_LINE>if (!label.isEmpty())<NEW_LINE>prefix = prefix + label + " ";<NEW_LINE>// fill to maxLength (bit ensure at least 4 fill characters<NEW_LINE>// so the section parser is sure to pick it up)<NEW_LINE>StringBuffer sectionLabel = new StringBuffer();<NEW_LINE>sectionLabel.append("\n");<NEW_LINE>sectionLabel.append(prefix);<NEW_LINE>int fillChars = length - prefix.length();<NEW_LINE>fillChars = Math.max(fillChars, 4);<NEW_LINE>for (int i = 0; i < fillChars; i<MASK><NEW_LINE>sectionLabel.append("\n\n");<NEW_LINE>// insert code and move cursor<NEW_LINE>docDisplay_.insertCode(sectionLabel.toString(), false);<NEW_LINE>docDisplay_.setCursorPosition(Position.create(pos.getRow() + 3, 0));<NEW_LINE>docDisplay_.focus();<NEW_LINE>}
|
++) sectionLabel.append("-");
|
1,688,912
|
private void handleNewJobLogPart() {<NEW_LINE>// Ensure a publisher has been injected, otherwise do not send job log event to be published<NEW_LINE>if (getBatchEventsPublisher() != null) {<NEW_LINE>String logContent = null;<NEW_LINE>try {<NEW_LINE>// get the content of the job log part<NEW_LINE>logContent = new String(Files.readAllBytes(previousLogPath), StandardCharsets.UTF_8);<NEW_LINE>} catch (IOException e) {<NEW_LINE>logger.log(Level.WARNING, "job.logging.read.log", new Object[] { ((e.getCause() != null) ? e.getCause() : e) });<NEW_LINE>} catch (OutOfMemoryError e) {<NEW_LINE>logger.log(Level.WARNING, "job.logging.read.log", new Object[] { ((e.getCause() != null) ? e.<MASK><NEW_LINE>} catch (SecurityException e) {<NEW_LINE>logger.log(Level.WARNING, "job.logging.read.log", new Object[] { ((e.getCause() != null) ? e.getCause() : e) });<NEW_LINE>}<NEW_LINE>// If an exception was caught reading the log file then continue on without sending an event<NEW_LINE>if (logContent != null) {<NEW_LINE>// send the previous part number along with the content in the log<NEW_LINE>sendJobLogEvent(filePart - 1, logContent, false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// If purgeOnPublish is enabled then uncomment this to allow for the job log to be purged<NEW_LINE>// if (purgeOnPublish) {<NEW_LINE>// deleteFileOrDirectory(new File(previousLogPath.toString()));<NEW_LINE>// }<NEW_LINE>}
|
getCause() : e) });
|
1,555,088
|
final ListUnsupportedAppVersionResourcesResult executeListUnsupportedAppVersionResources(ListUnsupportedAppVersionResourcesRequest listUnsupportedAppVersionResourcesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listUnsupportedAppVersionResourcesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListUnsupportedAppVersionResourcesRequest> request = null;<NEW_LINE>Response<ListUnsupportedAppVersionResourcesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListUnsupportedAppVersionResourcesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listUnsupportedAppVersionResourcesRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "resiliencehub");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListUnsupportedAppVersionResources");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListUnsupportedAppVersionResourcesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListUnsupportedAppVersionResourcesResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
|
addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
|
475,228
|
public static ListServicesResponse unmarshall(ListServicesResponse listServicesResponse, UnmarshallerContext _ctx) {<NEW_LINE>listServicesResponse.setRequestId(_ctx.stringValue("ListServicesResponse.RequestId"));<NEW_LINE>listServicesResponse.setNextToken(_ctx.stringValue("ListServicesResponse.NextToken"));<NEW_LINE>listServicesResponse.setTotalCount(_ctx.stringValue("ListServicesResponse.TotalCount"));<NEW_LINE>listServicesResponse.setMaxResults(_ctx.integerValue("ListServicesResponse.MaxResults"));<NEW_LINE>List<Service> services = new ArrayList<Service>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListServicesResponse.Services.Length"); i++) {<NEW_LINE>Service service = new Service();<NEW_LINE>service.setStatus(_ctx.stringValue("ListServicesResponse.Services[" + i + "].Status"));<NEW_LINE>service.setDefaultVersion(_ctx.booleanValue("ListServicesResponse.Services[" + i + "].DefaultVersion"));<NEW_LINE>service.setPublishTime(_ctx.stringValue("ListServicesResponse.Services[" + i + "].PublishTime"));<NEW_LINE>service.setVersion(_ctx.stringValue("ListServicesResponse.Services[" + i + "].Version"));<NEW_LINE>service.setDeployType(_ctx.stringValue("ListServicesResponse.Services[" + i + "].DeployType"));<NEW_LINE>service.setServiceId(_ctx.stringValue<MASK><NEW_LINE>service.setSupplierUrl(_ctx.stringValue("ListServicesResponse.Services[" + i + "].SupplierUrl"));<NEW_LINE>service.setServiceType(_ctx.stringValue("ListServicesResponse.Services[" + i + "].ServiceType"));<NEW_LINE>service.setSupplierName(_ctx.stringValue("ListServicesResponse.Services[" + i + "].SupplierName"));<NEW_LINE>service.setCommodityCode(_ctx.stringValue("ListServicesResponse.Services[" + i + "].CommodityCode"));<NEW_LINE>List<ServiceInfo> serviceInfos = new ArrayList<ServiceInfo>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("ListServicesResponse.Services[" + i + "].ServiceInfos.Length"); j++) {<NEW_LINE>ServiceInfo serviceInfo = new ServiceInfo();<NEW_LINE>serviceInfo.setLocale(_ctx.stringValue("ListServicesResponse.Services[" + i + "].ServiceInfos[" + j + "].Locale"));<NEW_LINE>serviceInfo.setImage(_ctx.stringValue("ListServicesResponse.Services[" + i + "].ServiceInfos[" + j + "].Image"));<NEW_LINE>serviceInfo.setName(_ctx.stringValue("ListServicesResponse.Services[" + i + "].ServiceInfos[" + j + "].Name"));<NEW_LINE>serviceInfo.setShortDescription(_ctx.stringValue("ListServicesResponse.Services[" + i + "].ServiceInfos[" + j + "].ShortDescription"));<NEW_LINE>serviceInfos.add(serviceInfo);<NEW_LINE>}<NEW_LINE>service.setServiceInfos(serviceInfos);<NEW_LINE>services.add(service);<NEW_LINE>}<NEW_LINE>listServicesResponse.setServices(services);<NEW_LINE>return listServicesResponse;<NEW_LINE>}
|
("ListServicesResponse.Services[" + i + "].ServiceId"));
|
911,917
|
private void changeStartTimes(List<LatticeWord> words, int newStartTime) {<NEW_LINE>ArrayList<LatticeWord> toRemove = new ArrayList<>();<NEW_LINE>for (LatticeWord lw : words) {<NEW_LINE>latticeWords.remove(lw);<NEW_LINE>int oldStartTime = lw.startNode;<NEW_LINE>lw.startNode = newStartTime;<NEW_LINE>if (latticeWords.contains(lw)) {<NEW_LINE>if (DEBUG) {<NEW_LINE>log.info("duplicate found");<NEW_LINE>}<NEW_LINE>LatticeWord twin = latticeWords.get(latticeWords.indexOf(lw));<NEW_LINE>// assert (twin != lw) ;<NEW_LINE>lw.startNode = oldStartTime;<NEW_LINE>twin.merge(lw);<NEW_LINE>// wordsStartAt[lw.startNode].remove(lw);<NEW_LINE>toRemove.add(lw);<NEW_LINE>wordsEndAt[lw.endNode].remove(lw);<NEW_LINE>for (int i = lw.startNode; i <= lw.endNode; i++) {<NEW_LINE>wordsAtTime[i].remove(lw);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (oldStartTime < newStartTime) {<NEW_LINE>for (int i = oldStartTime; i < newStartTime; i++) {<NEW_LINE>wordsAtTime[i].remove(lw);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>for (int i = newStartTime; i < oldStartTime; i++) {<NEW_LINE>wordsAtTime<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>latticeWords.add(lw);<NEW_LINE>if (oldStartTime != newStartTime) {<NEW_LINE>// wordsStartAt[oldStartTime].remove(lw);<NEW_LINE>toRemove.add(lw);<NEW_LINE>wordsStartAt[newStartTime].add(lw);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>words.removeAll(toRemove);<NEW_LINE>}
|
[i].add(lw);
|
737,687
|
public String serialize(int nodeIdx, boolean verbose) {<NEW_LINE>boolean empty = true;<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>String prefix = (nodeIdx == -1 ? "" : "." + nodeIdx + ".");<NEW_LINE>if (state != State.UP) {<NEW_LINE>empty = false;<NEW_LINE>sb.append(prefix).append("s:").append(state.serialize());<NEW_LINE>}<NEW_LINE>if (Math.abs(capacity - 1.0) > 0.000000001) {<NEW_LINE>if (empty) {<NEW_LINE>empty = false;<NEW_LINE>} else {<NEW_LINE>sb.append(' ');<NEW_LINE>}<NEW_LINE>sb.append(prefix).append<MASK><NEW_LINE>}<NEW_LINE>if (state == State.INITIALIZING) {<NEW_LINE>sb.append(' ');<NEW_LINE>sb.append(prefix).append("i:").append(initProgress);<NEW_LINE>}<NEW_LINE>if (startTimestamp != 0) {<NEW_LINE>if (empty) {<NEW_LINE>empty = false;<NEW_LINE>} else {<NEW_LINE>sb.append(' ');<NEW_LINE>}<NEW_LINE>sb.append(prefix).append("t:").append(startTimestamp);<NEW_LINE>}<NEW_LINE>if (nodeIdx == -1 && minUsedBits != 16) {<NEW_LINE>if (empty) {<NEW_LINE>empty = false;<NEW_LINE>} else {<NEW_LINE>sb.append(' ');<NEW_LINE>}<NEW_LINE>sb.append(prefix).append("b:").append(minUsedBits);<NEW_LINE>}<NEW_LINE>if ((verbose || nodeIdx == -1) && description.length() > 0) {<NEW_LINE>if (!empty) {<NEW_LINE>sb.append(' ');<NEW_LINE>}<NEW_LINE>sb.append(prefix).append("m:").append(StringUtilities.escape(description, ' '));<NEW_LINE>}<NEW_LINE>return sb.toString();<NEW_LINE>}
|
("c:").append(capacity);
|
175,585
|
@BackpressureSupport(BackpressureKind.ERROR)<NEW_LINE>@SchedulerSupport(SchedulerSupport.CUSTOM)<NEW_LINE>public static Flowable<Long> intervalRange(long start, long count, long initialDelay, long period, @NonNull TimeUnit unit, @NonNull Scheduler scheduler) {<NEW_LINE>if (count < 0L) {<NEW_LINE>throw new IllegalArgumentException("count >= 0 required but it was " + count);<NEW_LINE>}<NEW_LINE>if (count == 0L) {<NEW_LINE>return Flowable.<Long>empty().<MASK><NEW_LINE>}<NEW_LINE>long end = start + (count - 1);<NEW_LINE>if (start > 0 && end < 0) {<NEW_LINE>throw new IllegalArgumentException("Overflow! start + count is bigger than Long.MAX_VALUE");<NEW_LINE>}<NEW_LINE>Objects.requireNonNull(unit, "unit is null");<NEW_LINE>Objects.requireNonNull(scheduler, "scheduler is null");<NEW_LINE>return RxJavaPlugins.onAssembly(new FlowableIntervalRange(start, end, Math.max(0L, initialDelay), Math.max(0L, period), unit, scheduler));<NEW_LINE>}
|
delay(initialDelay, unit, scheduler);
|
1,019,080
|
public void reload() {<NEW_LINE>try {<NEW_LINE>// stop deleted cluster<NEW_LINE>deletingClusterList.forEach(item -> {<NEW_LINE>item.stop();<NEW_LINE>});<NEW_LINE>deletingClusterList.clear();<NEW_LINE>// update cluster list<NEW_LINE>List<CacheClusterConfig> configList = this.context.getCacheClusters();<NEW_LINE>List<PulsarProducerCluster> newClusterList = new ArrayList<>(configList.size());<NEW_LINE>// prepare<NEW_LINE>Set<String> newClusterNames = new HashSet<>();<NEW_LINE>configList.forEach(item -> {<NEW_LINE>newClusterNames.add(item.getClusterName());<NEW_LINE>});<NEW_LINE>Set<String> oldClusterNames = new HashSet<>();<NEW_LINE>clusterList.forEach(item -> {<NEW_LINE>oldClusterNames.add(item.getCacheClusterName());<NEW_LINE>});<NEW_LINE>// add<NEW_LINE>for (CacheClusterConfig config : configList) {<NEW_LINE>if (!oldClusterNames.contains(config.getClusterName())) {<NEW_LINE>PulsarProducerCluster cluster = new PulsarProducerCluster(workerName, config, context);<NEW_LINE>cluster.start();<NEW_LINE>newClusterList.add(cluster);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// remove<NEW_LINE>for (PulsarProducerCluster cluster : this.clusterList) {<NEW_LINE>if (newClusterNames.contains(cluster.getCacheClusterName())) {<NEW_LINE>newClusterList.add(cluster);<NEW_LINE>} else {<NEW_LINE>deletingClusterList.add(cluster);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.clusterList = newClusterList;<NEW_LINE>} catch (Throwable e) {<NEW_LINE>LOG.error(<MASK><NEW_LINE>}<NEW_LINE>}
|
e.getMessage(), e);
|
1,105,393
|
public static void main(String[] args) {<NEW_LINE>LogConfig.configureRuntime();<NEW_LINE><MASK><NEW_LINE>CoordinatorService coordinatorService = CoordinatorService.builder().build();<NEW_LINE>WebServer server = WebServer.builder(createRouting(config, coordinatorService)).config(config.get("helidon.lra.coordinator.server")).build();<NEW_LINE>String context = config.get("helidon.lra.coordinator.context.path").asString().orElse("/lra-coordinator");<NEW_LINE>Single<WebServer> webserver = server.start();<NEW_LINE>webserver.thenAccept(ws -> {<NEW_LINE>System.out.println("Helidon LRA Coordinator is up! http://localhost:" + ws.port() + context);<NEW_LINE>ws.whenShutdown().thenRun(() -> {<NEW_LINE>System.out.println("Helidon LRA Coordinator is DOWN. Good bye!");<NEW_LINE>});<NEW_LINE>}).exceptionallyAccept(t -> {<NEW_LINE>System.err.println("Startup failed: " + t.getMessage());<NEW_LINE>t.printStackTrace(System.err);<NEW_LINE>});<NEW_LINE>}
|
Config config = Config.create();
|
1,640,557
|
public MappeableContainer xor(MappeableBitmapContainer value2) {<NEW_LINE>int newCardinality = 0;<NEW_LINE>if (BufferUtil.isBackedBySimpleArray(this.bitmap) && BufferUtil.isBackedBySimpleArray(value2.bitmap)) {<NEW_LINE>long[] b = this.bitmap.array();<NEW_LINE>long[] v2 = value2.bitmap.array();<NEW_LINE>int len = this.bitmap.limit();<NEW_LINE>for (int k = 0; k < len; ++k) {<NEW_LINE>newCardinality += Long.bitCount(b[k] ^ v2[k]);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>int len = this.bitmap.limit();<NEW_LINE>for (int k = 0; k < len; ++k) {<NEW_LINE>newCardinality += Long.bitCount(this.bitmap.get(k) ^ value2.bitmap.get(k));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (newCardinality > MappeableArrayContainer.DEFAULT_MAX_SIZE) {<NEW_LINE><MASK><NEW_LINE>long[] bitArray = answer.bitmap.array();<NEW_LINE>if (BufferUtil.isBackedBySimpleArray(this.bitmap) && BufferUtil.isBackedBySimpleArray(value2.bitmap)) {<NEW_LINE>long[] b = this.bitmap.array();<NEW_LINE>long[] v2 = value2.bitmap.array();<NEW_LINE>int len = answer.bitmap.limit();<NEW_LINE>for (int k = 0; k < len; ++k) {<NEW_LINE>bitArray[k] = b[k] ^ v2[k];<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>int len = answer.bitmap.limit();<NEW_LINE>for (int k = 0; k < len; ++k) {<NEW_LINE>bitArray[k] = this.bitmap.get(k) ^ value2.bitmap.get(k);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>answer.cardinality = newCardinality;<NEW_LINE>return answer;<NEW_LINE>}<NEW_LINE>final MappeableArrayContainer ac = new MappeableArrayContainer(newCardinality);<NEW_LINE>BufferUtil.fillArrayXOR(ac.content.array(), this.bitmap, value2.bitmap);<NEW_LINE>ac.cardinality = newCardinality;<NEW_LINE>return ac;<NEW_LINE>}
|
final MappeableBitmapContainer answer = new MappeableBitmapContainer();
|
1,710,448
|
public ANode visitSource(SourceContext ctx) {<NEW_LINE>List<SFunction> functions = new ArrayList<>();<NEW_LINE>for (FunctionContext function : ctx.function()) {<NEW_LINE>functions.add((SFunction) visit(function));<NEW_LINE>}<NEW_LINE>// handle the code to generate the execute method here<NEW_LINE>// because the statements come loose from the grammar as<NEW_LINE>// part of the overall class<NEW_LINE>List<AStatement> statements = new ArrayList<>();<NEW_LINE>for (StatementContext statement : ctx.statement()) {<NEW_LINE>statements.add(<MASK><NEW_LINE>}<NEW_LINE>// generate the execute method from the collected statements and parameters<NEW_LINE>SFunction execute = new SFunction(nextIdentifier(), location(ctx), "<internal>", "execute", emptyList(), emptyList(), new SBlock(nextIdentifier(), location(ctx), statements), false, false, false, false);<NEW_LINE>functions.add(execute);<NEW_LINE>return new SClass(nextIdentifier(), location(ctx), functions);<NEW_LINE>}
|
(AStatement) visit(statement));
|
741,090
|
public String[][] dealCSV(BufferedReader reader, String filedNames, String seprator, String quoteStr, String escapeStr) {<NEW_LINE>char sepratorChar = seprator.charAt(0);<NEW_LINE>char quoteChar = quoteStr.charAt(0);<NEW_LINE>char escapeChar = escapeStr.charAt(0);<NEW_LINE>CSVReader csv = null;<NEW_LINE>String tempString = null;<NEW_LINE>List<String[]> result = new LinkedList<>();<NEW_LINE>int line = 0;<NEW_LINE>// add filed header<NEW_LINE>if (StringUtils.isNotEmpty(filedNames)) {<NEW_LINE>result.add(filedNames.split(","));<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>// Read line by line<NEW_LINE>while ((tempString = reader.readLine()) != null) {<NEW_LINE>if (StringUtils.isBlank(tempString.trim())) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (line++ > resultLimit) {<NEW_LINE>throw new CBoardException("Cube result count is greater than limit " + resultLimit);<NEW_LINE>}<NEW_LINE>csv = newReader(new CharArrayReader(tempString.toCharArray()), sepratorChar, quoteChar, escapeChar);<NEW_LINE>result.add(csv.readNext());<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.error("ERROR:" + e.getMessage());<NEW_LINE>throw new CBoardException("ERROR:" + e.getMessage());<NEW_LINE>}<NEW_LINE>return result.toArray(new <MASK><NEW_LINE>}
|
String[][] {});
|
1,247,982
|
static PersonaAccount addPersonaAccount(Persona persona, CentralRepoAccount account, String justification, Persona.Confidence confidence) throws CentralRepoException {<NEW_LINE>CentralRepoExaminer currentExaminer = getCRInstance().getOrInsertExaminer(System.getProperty("user.name"));<NEW_LINE>Instant instant = Instant.now();<NEW_LINE>Long timeStampMillis = instant.toEpochMilli();<NEW_LINE>String insertSQL = "INSERT INTO persona_accounts (persona_id, account_id, justification, confidence_id, date_added, examiner_id ) " + " VALUES ( ?, ?, ?, ?, ?, ?)";<NEW_LINE>List<Object> params = new ArrayList<>();<NEW_LINE>params.add(persona.getId());<NEW_LINE>params.add(account.getId());<NEW_LINE>params.add(StringUtils.isBlank(justification) ? "" : justification);<NEW_LINE>params.add(confidence.getLevelId());<NEW_LINE>params.add(timeStampMillis);<NEW_LINE>params.add(currentExaminer.getId());<NEW_LINE>getCRInstance(<MASK><NEW_LINE>String querySQL = PERSONA_ACCOUNTS_QUERY_CLAUSE + "WHERE persona_id = ? " + " AND account_type_id = ?" + " AND account_unique_identifier = ?";<NEW_LINE>List<Object> queryParams = new ArrayList<>();<NEW_LINE>queryParams.add(persona.getId());<NEW_LINE>queryParams.add(account.getAccountType().getAccountTypeId());<NEW_LINE>queryParams.add(account.getIdentifier());<NEW_LINE>PersonaAccountsQueryCallback queryCallback = new PersonaAccountsQueryCallback();<NEW_LINE>getCRInstance().executeQuery(querySQL, queryParams, queryCallback);<NEW_LINE>Collection<PersonaAccount> accounts = queryCallback.getPersonaAccountsList();<NEW_LINE>if (accounts.size() != 1) {<NEW_LINE>throw new CentralRepoException("Account add query failed");<NEW_LINE>}<NEW_LINE>return accounts.iterator().next();<NEW_LINE>}
|
).executeCommand(insertSQL, params);
|
494,213
|
private void validatePlanNumberOfPartitions() {<NEW_LINE>int numPreviousPartitions = getTopLevelStepInstance().getPartitionPlanSize();<NEW_LINE>int numCurrentPartitions = currentPlan.getNumPartitionsInPlan();<NEW_LINE>if (logger.isLoggable(Level.FINE)) {<NEW_LINE>logger.fine("For step: " + getStepName() + ", previous num partitions = " + numPreviousPartitions + ", and current num partitions = " + numCurrentPartitions);<NEW_LINE>}<NEW_LINE>if (executionType == ExecutionType.RESTART_NORMAL) {<NEW_LINE>if (numPreviousPartitions == EntityConstants.PARTITION_PLAN_SIZE_UNINITIALIZED) {<NEW_LINE>logger.fine("For step: " + getStepName() + ", previous num partitions has not been initialized, so don't validate the current plan size against it");<NEW_LINE>} else if (numCurrentPartitions != numPreviousPartitions) {<NEW_LINE>throw new IllegalArgumentException("Partition not configured for override, and previous execution used " + numPreviousPartitions + " number of partitions, while current plan uses a different number: " + numCurrentPartitions);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (numCurrentPartitions < 0) {<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>}
|
IllegalArgumentException("Partition plan size is calculated as " + numCurrentPartitions + ", must be greater than or equal to 0.");
|
1,711,596
|
public CommandLineRunner commandLineRunner(ServletContext servletContext) {<NEW_LINE>return (args) -> {<NEW_LINE>File temp = new File(System.getProperty("java.io.tmpdir"));<NEW_LINE>URL resourceUrl = servletContext.getResource("webjars/jquery/3.5.0/jquery.js");<NEW_LINE>JarURLConnection connection = <MASK><NEW_LINE>String jarName = connection.getJarFile().getName();<NEW_LINE>System.out.println(">>>>> jar file " + jarName);<NEW_LINE>if (jarName.contains(temp.getAbsolutePath())) {<NEW_LINE>System.out.println(">>>>> jar written to temp");<NEW_LINE>}<NEW_LINE>byte[] resourceContent = FileCopyUtils.copyToByteArray(resourceUrl.openStream());<NEW_LINE>URL directUrl = new URL(resourceUrl.toExternalForm());<NEW_LINE>byte[] directContent = FileCopyUtils.copyToByteArray(directUrl.openStream());<NEW_LINE>String message = (!Arrays.equals(resourceContent, directContent)) ? "NO MATCH" : directContent.length + " BYTES";<NEW_LINE>System.out.println(">>>>> " + message + " from " + resourceUrl);<NEW_LINE>};<NEW_LINE>}
|
(JarURLConnection) resourceUrl.openConnection();
|
1,159,736
|
private synchronized void buildCache() {<NEW_LINE>Map<String, ManagementNodeNotFoundHandler> oldEntries = null;<NEW_LINE>if (managementNodeNotFoundHandlers != null) {<NEW_LINE>oldEntries = managementNodeNotFoundHandlers.asMap();<NEW_LINE>}<NEW_LINE>long maxNum = CloudBusGlobalConfig.MAX_MANAGEMENTNODE_NOTFOUND_ERROR_HANDLER_NUM.value(Long.class);<NEW_LINE>long timeout = CloudBusGlobalConfig.MAX_MANAGEMENTNODE_NOTFOUND_ERROR_HANDLER_TIMEOUT.value(Long.class);<NEW_LINE>managementNodeNotFoundHandlers = CacheBuilder.newBuilder().maximumSize(maxNum).expireAfterWrite(timeout, TimeUnit.SECONDS).removalListener((RemovalListener<String, ManagementNodeNotFoundHandler>) removalNotification -> {<NEW_LINE>if (removalNotification.getCause() == RemovalCause.SIZE || removalNotification.getCause() == RemovalCause.EXPIRED || removalNotification.getCause() == RemovalCause.COLLECTED) {<NEW_LINE>ManagementNodeNotFoundHandler handler = removalNotification.getValue();<NEW_LINE>logger.warn(String.format("A message failing to send to the management node[uuid:%s] because the node is offline while the message being sent. Now the message is being dropped " + "because the cache policy[%s] requires and the management node is not online til now. The message dump:\n %s", handler.managementNodeUuid, removalNotification.getCause(), CloudBusGson.<MASK><NEW_LINE>}<NEW_LINE>}).build();<NEW_LINE>if (oldEntries != null) {<NEW_LINE>oldEntries.forEach((k, v) -> managementNodeNotFoundHandlers.put(k, v));<NEW_LINE>}<NEW_LINE>logger.debug(String.format("build cache of ManagementNodeNotFoundHandler[maxNum:%s, timeout: %ss, current entries: %s]", maxNum, timeout, managementNodeNotFoundHandlers.size()));<NEW_LINE>}
|
toJson(handler.message)));
|
1,431,414
|
public okhttp3.Call readFlowSchemaCall(String name, String pretty, final ApiCallback _callback) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/apis/flowcontrol.apiserver.k8s.io/v1beta1/flowschemas/{name}".replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString()));<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();<NEW_LINE>if (pretty != null) {<NEW_LINE>localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty));<NEW_LINE>}<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, String> localVarCookieParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new <MASK><NEW_LINE>final String[] localVarAccepts = { "application/json", "application/yaml", "application/vnd.kubernetes.protobuf" };<NEW_LINE>final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null) {<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>}<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>String[] localVarAuthNames = new String[] { "BearerToken" };<NEW_LINE>return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);<NEW_LINE>}
|
HashMap<String, Object>();
|
1,463,490
|
final DeleteUserPoolResult executeDeleteUserPool(DeleteUserPoolRequest deleteUserPoolRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteUserPoolRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteUserPoolRequest> request = null;<NEW_LINE>Response<DeleteUserPoolResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteUserPoolRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteUserPoolRequest));<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, "Cognito Identity Provider");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteUserPool");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteUserPoolResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteUserPoolResultJsonUnmarshaller());<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);
|
870,243
|
public static DescribeClusterDashboardResponse unmarshall(DescribeClusterDashboardResponse describeClusterDashboardResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeClusterDashboardResponse.setRequestId(_ctx.stringValue("DescribeClusterDashboardResponse.RequestId"));<NEW_LINE>Dashboard dashboard = new Dashboard();<NEW_LINE>dashboard.setClusterId(_ctx.stringValue("DescribeClusterDashboardResponse.Dashboard.ClusterId"));<NEW_LINE>List<DataCenter> dataCenters = new ArrayList<DataCenter>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeClusterDashboardResponse.Dashboard.DataCenters.Length"); i++) {<NEW_LINE>DataCenter dataCenter = new DataCenter();<NEW_LINE>dataCenter.setDataCenterId(_ctx.stringValue("DescribeClusterDashboardResponse.Dashboard.DataCenters[" + i + "].DataCenterId"));<NEW_LINE>List<Node> nodes = new ArrayList<Node>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeClusterDashboardResponse.Dashboard.DataCenters[" + i + "].Nodes.Length"); j++) {<NEW_LINE>Node node = new Node();<NEW_LINE>node.setAddress(_ctx.stringValue("DescribeClusterDashboardResponse.Dashboard.DataCenters[" + i <MASK><NEW_LINE>node.setStatus(_ctx.stringValue("DescribeClusterDashboardResponse.Dashboard.DataCenters[" + i + "].Nodes[" + j + "].Status"));<NEW_LINE>node.setLoad(_ctx.stringValue("DescribeClusterDashboardResponse.Dashboard.DataCenters[" + i + "].Nodes[" + j + "].Load"));<NEW_LINE>nodes.add(node);<NEW_LINE>}<NEW_LINE>dataCenter.setNodes(nodes);<NEW_LINE>dataCenters.add(dataCenter);<NEW_LINE>}<NEW_LINE>dashboard.setDataCenters(dataCenters);<NEW_LINE>describeClusterDashboardResponse.setDashboard(dashboard);<NEW_LINE>return describeClusterDashboardResponse;<NEW_LINE>}
|
+ "].Nodes[" + j + "].Address"));
|
383,394
|
public Optional<ServiceBindingConfigSource> convert(List<ServiceBinding> serviceBindings) {<NEW_LINE>var matchingByType = ServiceBinding.singleMatchingByType("serviceregistry", serviceBindings);<NEW_LINE>Config config = ConfigProvider.getConfig();<NEW_LINE>if (matchingByType.isEmpty()) {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>var binding = matchingByType.get();<NEW_LINE>List<String> channels = extractChannels(config);<NEW_LINE>Map<String, String> properties = new HashMap<>();<NEW_LINE>String registryUrl = binding.getProperties().get("registryUrl");<NEW_LINE>if (registryUrl == null) {<NEW_LINE>registryUrl = binding.getProperties().get("registryurl");<NEW_LINE>}<NEW_LINE>if (registryUrl != null) {<NEW_LINE>properties.put("kafka.apicurio.registry.url", registryUrl);<NEW_LINE>}<NEW_LINE>for (String channel : channels) {<NEW_LINE>String prefix = channel;<NEW_LINE>String oauthTokenUrl = binding.getProperties().get("oauthTokenUrl");<NEW_LINE>if (oauthTokenUrl == null) {<NEW_LINE>oauthTokenUrl = binding.getProperties().get("oauthtokenurl");<NEW_LINE>}<NEW_LINE>if (oauthTokenUrl != null) {<NEW_LINE>properties.put(prefix + "apicurio.auth.service.token.endpoint", oauthTokenUrl);<NEW_LINE>}<NEW_LINE>String clientId = binding.getProperties().get("clientId");<NEW_LINE>if (clientId == null) {<NEW_LINE>clientId = binding.getProperties().get("clientid");<NEW_LINE>}<NEW_LINE>if (clientId != null) {<NEW_LINE>properties.put(prefix + "apicurio.auth.client.id", clientId);<NEW_LINE>}<NEW_LINE>String clientSecret = binding.<MASK><NEW_LINE>if (clientSecret == null) {<NEW_LINE>clientSecret = binding.getProperties().get("clientsecret");<NEW_LINE>}<NEW_LINE>if (clientSecret != null) {<NEW_LINE>properties.put(prefix + "apicurio.auth.client.secret", clientSecret);<NEW_LINE>}<NEW_LINE>if (registryUrl != null) {<NEW_LINE>properties.put(prefix + "apicurio.registry.url", registryUrl);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Optional.of(new ServiceBindingConfigSource("serviceregistry-k8s-service-binding-source", properties));<NEW_LINE>}
|
getProperties().get("clientSecret");
|
1,133,449
|
public static void startTrack(final Object... args) {<NEW_LINE>if (isClosed) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// --Create Record<NEW_LINE>final int len = args.length == 0 ? 0 : args.length - 1;<NEW_LINE>final Object content = args.length == 0 ? "" : args[len];<NEW_LINE>final Object[] tags = new Object[len];<NEW_LINE>final <MASK><NEW_LINE>System.arraycopy(args, 0, tags, 0, len);<NEW_LINE>// --Create Task<NEW_LINE>final Runnable startTrack = () -> {<NEW_LINE>assert !isThreaded || control.isHeldByCurrentThread();<NEW_LINE>Record toPass = new Record(content, tags, depth, timestamp);<NEW_LINE>depth += 1;<NEW_LINE>titleStack.push(args.length == 0 ? "" : args[len].toString());<NEW_LINE>handlers.process(toPass, MessageType.START_TRACK, depth, toPass.timesstamp);<NEW_LINE>assert !isThreaded || control.isHeldByCurrentThread();<NEW_LINE>};<NEW_LINE>// --Run Task<NEW_LINE>if (isThreaded) {<NEW_LINE>// (case: multithreaded)<NEW_LINE>long threadId = Thread.currentThread().getId();<NEW_LINE>attemptThreadControl(threadId, startTrack);<NEW_LINE>} else {<NEW_LINE>// (case: no threading)<NEW_LINE>startTrack.run();<NEW_LINE>}<NEW_LINE>}
|
long timestamp = System.currentTimeMillis();
|
1,327,848
|
private List<Wo> list(Business business, Wi wi, List<Identity> identityList) throws Exception {<NEW_LINE>List<Wo> wos = new ArrayList<>();<NEW_LINE>if (StringUtils.isBlank(wi.getKey()) && (ListTools.isEmpty(wi.getUnitList()) || ListTools.isEmpty(identityList))) {<NEW_LINE>return wos;<NEW_LINE>}<NEW_LINE>EntityManager em = business.entityManagerContainer().get(Person.class);<NEW_LINE>CriteriaBuilder cb = em.getCriteriaBuilder();<NEW_LINE>CriteriaQuery<String> cq = cb.createQuery(String.class);<NEW_LINE>Root<Person> root = cq.from(Person.class);<NEW_LINE>Predicate p = cb.conjunction();<NEW_LINE>if (StringUtils.isNotBlank(wi.getKey())) {<NEW_LINE>String str = StringUtils.lowerCase(StringTools.escapeSqlLikeKey(wi.getKey()));<NEW_LINE>p = cb.like(cb.lower(root.get(Person_.name)), "%" + str + "%", StringTools.SQL_ESCAPE_CHAR);<NEW_LINE>p = cb.or(p, cb.like(cb.lower(root.get(Person_.unique)), "%" + str + "%", StringTools.SQL_ESCAPE_CHAR));<NEW_LINE>p = cb.or(p, cb.like(cb.lower(root.get(Person_.pinyin)), str + "%", StringTools.SQL_ESCAPE_CHAR));<NEW_LINE>p = cb.or(p, cb.like(cb.lower(root.get(Person_.pinyinInitial)), str + "%", StringTools.SQL_ESCAPE_CHAR));<NEW_LINE>p = cb.or(p, cb.like(cb.lower(root.get(Person_.mobile)), str + "%", StringTools.SQL_ESCAPE_CHAR));<NEW_LINE>p = cb.or(p, cb.like(cb.lower(root.get(Person_.distinguishedName)), str + "%", StringTools.SQL_ESCAPE_CHAR));<NEW_LINE>}<NEW_LINE>Map<String, Integer> map = new HashMap<>();<NEW_LINE>if (ListTools.isNotEmpty(identityList)) {<NEW_LINE>for (Identity identity : identityList) {<NEW_LINE>map.put(identity.getPerson(), identity.getOrderNumber());<NEW_LINE>}<NEW_LINE>p = cb.and(p, cb.isMember(root.get(Person_.id), cb.literal(map.keySet())));<NEW_LINE>}<NEW_LINE>List<String> list = em.createQuery(cq.select(root.get(Person_.id)).where(p)).getResultList().stream().distinct().collect(Collectors.toList());<NEW_LINE>for (Person o : business.person().pick(list)) {<NEW_LINE>if (!map.isEmpty()) {<NEW_LINE>o.setOrderNumber(map.get(o.getId()));<NEW_LINE>}<NEW_LINE>wos.add(this.convert(business<MASK><NEW_LINE>}<NEW_LINE>wos = wos.stream().sorted(Comparator.comparing(Wo::getOrderNumber, Comparator.nullsLast(Integer::compareTo)).thenComparing(Comparator.comparing(Wo::getName, Comparator.nullsFirst(String::compareTo)).reversed())).collect(Collectors.toList());<NEW_LINE>return wos;<NEW_LINE>}
|
, o, Wo.class));
|
1,412,399
|
Object doTimeout(VirtualFrame frame, PSimpleQueue self, boolean block, Object timeout, @Cached PyLongAsLongAndOverflowNode asLongNode, @Cached CastToJavaDoubleNode castToDouble) {<NEW_LINE>assert block;<NEW_LINE>// convert timeout object (given in seconds) to a Java long in microseconds<NEW_LINE>long ltimeout;<NEW_LINE>try {<NEW_LINE>ltimeout = (long) (castToDouble<MASK><NEW_LINE>} catch (CannotCastException e) {<NEW_LINE>try {<NEW_LINE>ltimeout = PythonUtils.multiplyExact(asLongNode.execute(frame, timeout), 1000000);<NEW_LINE>} catch (OverflowException oe) {<NEW_LINE>throw raise(OverflowError, "timeout value is too large");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (ltimeout < 0) {<NEW_LINE>throw raise(ValueError, "'timeout' must be a non-negative number");<NEW_LINE>}<NEW_LINE>// CPython first tries a non-blocking get without releasing the GIL<NEW_LINE>Object result = self.poll();<NEW_LINE>if (result != null) {<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>ensureGil().release(true);<NEW_LINE>result = self.get(ltimeout);<NEW_LINE>if (result != null) {<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>CompilerDirectives.transferToInterpreter();<NEW_LINE>Thread.currentThread().interrupt();<NEW_LINE>} finally {<NEW_LINE>ensureGil().acquire();<NEW_LINE>}<NEW_LINE>throw raise(Empty);<NEW_LINE>}
|
.execute(timeout) * 1000000.0);
|
514,611
|
public MTable deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {<NEW_LINE>final <MASK><NEW_LINE>final JsonNode node = codec.readTree(jsonParser);<NEW_LINE>final JsonNode schemaNode = node.get(M_TABLE_SCHEMA_STR);<NEW_LINE>final JsonNode dataNode = node.get(M_TABLE_DATA);<NEW_LINE>final TableSchema schema = TableUtil.schemaStr2Schema(schemaNode.asText());<NEW_LINE>final String[] names = schema.getFieldNames();<NEW_LINE>final TypeInformation<?>[] types = schema.getFieldTypes();<NEW_LINE>final int arity = names.length;<NEW_LINE>final List<Row> data = new ArrayList<>();<NEW_LINE>for (int j = 0; j < names.length; ++j) {<NEW_LINE>final Iterator<JsonNode> objectIterator = dataNode.get(names[j]).elements();<NEW_LINE>int index = 0;<NEW_LINE>while (objectIterator.hasNext()) {<NEW_LINE>JsonNode item = objectIterator.next();<NEW_LINE>if (j == 0) {<NEW_LINE>Row row = new Row(arity);<NEW_LINE>row.setField(j, from(codec, item, types[j]));<NEW_LINE>data.add(index, row);<NEW_LINE>} else {<NEW_LINE>data.get(index).setField(j, from(codec, item, types[j]));<NEW_LINE>}<NEW_LINE>index++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new MTable(data, schema);<NEW_LINE>}
|
ObjectCodec codec = jsonParser.getCodec();
|
1,345,235
|
public void read(org.apache.thrift.protocol.TProtocol iprot, TKeyExtent struct) throws org.apache.thrift.TException {<NEW_LINE>org.apache.thrift.protocol.TField schemeField;<NEW_LINE>iprot.readStructBegin();<NEW_LINE>while (true) {<NEW_LINE>schemeField = iprot.readFieldBegin();<NEW_LINE>if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>switch(schemeField.id) {<NEW_LINE>case // TABLE<NEW_LINE>1:<NEW_LINE>if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {<NEW_LINE>struct.table = iprot.readBinary();<NEW_LINE>struct.setTableIsSet(true);<NEW_LINE>} else {<NEW_LINE>org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case // END_ROW<NEW_LINE>2:<NEW_LINE>if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {<NEW_LINE>struct.endRow = iprot.readBinary();<NEW_LINE>struct.setEndRowIsSet(true);<NEW_LINE>} else {<NEW_LINE>org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case // PREV_END_ROW<NEW_LINE>3:<NEW_LINE>if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {<NEW_LINE>struct.prevEndRow = iprot.readBinary();<NEW_LINE>struct.setPrevEndRowIsSet(true);<NEW_LINE>} else {<NEW_LINE>org.apache.thrift.protocol.TProtocolUtil.<MASK><NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);<NEW_LINE>}<NEW_LINE>iprot.readFieldEnd();<NEW_LINE>}<NEW_LINE>iprot.readStructEnd();<NEW_LINE>// check for required fields of primitive type, which can't be checked in the validate method<NEW_LINE>struct.validate();<NEW_LINE>}
|
skip(iprot, schemeField.type);
|
1,599,023
|
public DescribePiiEntitiesDetectionJobResult describePiiEntitiesDetectionJob(DescribePiiEntitiesDetectionJobRequest describePiiEntitiesDetectionJobRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describePiiEntitiesDetectionJobRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribePiiEntitiesDetectionJobRequest> request = null;<NEW_LINE>Response<DescribePiiEntitiesDetectionJobResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribePiiEntitiesDetectionJobRequestMarshaller().marshall(describePiiEntitiesDetectionJobRequest);<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<DescribePiiEntitiesDetectionJobResult, JsonUnmarshallerContext> unmarshaller = new DescribePiiEntitiesDetectionJobResultJsonUnmarshaller();<NEW_LINE>JsonResponseHandler<DescribePiiEntitiesDetectionJobResult> responseHandler = <MASK><NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.ClientExecuteTime);<NEW_LINE>endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);<NEW_LINE>}<NEW_LINE>}
|
new JsonResponseHandler<DescribePiiEntitiesDetectionJobResult>(unmarshaller);
|
1,655,619
|
private RevolutPaymentExport toRevolutExport(@NonNull final I_Revolut_Payment_Export record) {<NEW_LINE>final CurrencyId currencyId = CurrencyId.<MASK><NEW_LINE>final CurrencyCode currencyCode = currencyDAO.getCurrencyCodeById(currencyId);<NEW_LINE>final Amount amount = Amount.of(record.getAmount(), currencyCode);<NEW_LINE>final TableRecordReference recordRef = TableRecordReference.of(record.getAD_Table_ID(), record.getRecord_ID());<NEW_LINE>return RevolutPaymentExport.builder().revolutPaymentExportId(RevolutPaymentExportId.ofRepoId(record.getRevolut_Payment_Export_ID())).orgId(OrgId.ofRepoId(record.getAD_Org_ID())).recordReference(recordRef).name(record.getName()).recipientType(RecipientType.ofCode(record.getRecipientType())).accountNo(record.getAccountNo()).routingNo(record.getRoutingNo()).IBAN(record.getIBAN()).BIC(record.getBIC()).amount(amount).recipientBankCountryId(CountryId.ofRepoIdOrNull(record.getRecipientBankCountryId())).paymentReference(record.getPaymentReference()).recipientCountryId(CountryId.ofRepoIdOrNull(record.getRecipientCountryId())).regionName(record.getRegionName()).addressLine1(record.getAddressLine1()).addressLine2(record.getAddressLine2()).city(record.getCity()).postalCode(record.getPostalCode()).build();<NEW_LINE>}
|
ofRepoId(record.getC_Currency_ID());
|
975,198
|
private void convertNodeToDenseNode(RecordProxy<NodeRecord, Void> nodeChange, RelationshipRecord firstRel, RecordAccess<RelationshipRecord, Void> relRecords, RelationshipGroupDegreesStore.Updater groupDegreesUpdater, NodeDataLookup nodeDataLookup) {<NEW_LINE>NodeRecord node = nodeChange.forChangingLinkage();<NEW_LINE>node.setDense(true);<NEW_LINE>node.setNextRel(NO_NEXT_RELATIONSHIP.intValue());<NEW_LINE>long relId = firstRel.getId();<NEW_LINE>RelationshipRecord relRecord = firstRel;<NEW_LINE>while (!isNull(relId)) {<NEW_LINE>// Get the next relationship id before connecting it (where linkage is overwritten)<NEW_LINE>relId = relRecord.getNextRel(node.getId());<NEW_LINE>relRecord.setPrevRel(NO_NEXT_RELATIONSHIP.longValue(), node.getId());<NEW_LINE>relRecord.setNextRel(NO_NEXT_RELATIONSHIP.longValue(), node.getId());<NEW_LINE>connectRelationshipToDenseNode(nodeChange, relRecord, relRecords, groupDegreesUpdater, null, nodeDataLookup);<NEW_LINE>if (!isNull(relId)) {<NEW_LINE>// Lock and load the next relationship in the chain<NEW_LINE>relRecord = relRecords.getOrLoad(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
relId, null).forChangingLinkage();
|
1,012,234
|
public Result visit(Project e) {<NEW_LINE>final Result x = visitInput(e, 0, Clause.SELECT);<NEW_LINE>parseCorrelTable(e, x);<NEW_LINE>final Builder builder = x.builder(e);<NEW_LINE>if (!isStar(e.getProjects(), e.getInput().getRowType(), e.getRowType())) {<NEW_LINE>final List<SqlNode> selectList = new ArrayList<>();<NEW_LINE>for (RexNode ref : e.getProjects()) {<NEW_LINE>SqlNode sqlExpr = builder.context.toSql(null, ref);<NEW_LINE>if (SqlUtil.isNullLiteral(sqlExpr, false)) {<NEW_LINE>sqlExpr = castNullType(sqlExpr, e.getRowType().getFieldList().get(selectList.size()));<NEW_LINE>}<NEW_LINE>addSelect(selectList, <MASK><NEW_LINE>}<NEW_LINE>builder.setSelect(new SqlNodeList(selectList, POS));<NEW_LINE>}<NEW_LINE>return builder.result();<NEW_LINE>}
|
sqlExpr, e.getRowType());
|
1,189,889
|
public Request<ModifyLaunchTemplateRequest> marshall(ModifyLaunchTemplateRequest modifyLaunchTemplateRequest) {<NEW_LINE>if (modifyLaunchTemplateRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<ModifyLaunchTemplateRequest> request = new DefaultRequest<MASK><NEW_LINE>request.addParameter("Action", "ModifyLaunchTemplate");<NEW_LINE>request.addParameter("Version", "2016-11-15");<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>if (modifyLaunchTemplateRequest.getClientToken() != null) {<NEW_LINE>request.addParameter("ClientToken", StringUtils.fromString(modifyLaunchTemplateRequest.getClientToken()));<NEW_LINE>}<NEW_LINE>if (modifyLaunchTemplateRequest.getLaunchTemplateId() != null) {<NEW_LINE>request.addParameter("LaunchTemplateId", StringUtils.fromString(modifyLaunchTemplateRequest.getLaunchTemplateId()));<NEW_LINE>}<NEW_LINE>if (modifyLaunchTemplateRequest.getLaunchTemplateName() != null) {<NEW_LINE>request.addParameter("LaunchTemplateName", StringUtils.fromString(modifyLaunchTemplateRequest.getLaunchTemplateName()));<NEW_LINE>}<NEW_LINE>if (modifyLaunchTemplateRequest.getDefaultVersion() != null) {<NEW_LINE>request.addParameter("SetDefaultVersion", StringUtils.fromString(modifyLaunchTemplateRequest.getDefaultVersion()));<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
|
<ModifyLaunchTemplateRequest>(modifyLaunchTemplateRequest, "AmazonEC2");
|
1,072,569
|
private String issueProjectLine(MProject project) {<NEW_LINE>MProjectLine projectLine = new MProjectLine(getCtx(), getProjectLineId(), get_TrxName());<NEW_LINE>if (projectLine.getM_Product_ID() == 0)<NEW_LINE>throw new IllegalArgumentException("Projet Line has no Product");<NEW_LINE>if (projectLine.getC_ProjectIssue_ID() != 0)<NEW_LINE>throw new IllegalArgumentException("Projet Line already been issued");<NEW_LINE>if (getLocatorId() == 0)<NEW_LINE>throw new IllegalArgumentException("No Locator");<NEW_LINE>// Set to Qty 1<NEW_LINE>if (projectLine.getPlannedQty() == null || projectLine.getPlannedQty().signum() == 0)<NEW_LINE>projectLine.setPlannedQty(Env.ONE);<NEW_LINE>//<NEW_LINE><MASK><NEW_LINE>projectIssue.setMandatory(getLocatorId(), projectLine.getM_Product_ID(), projectLine.getPlannedQty());<NEW_LINE>if (// default today<NEW_LINE>getMovementDate() != null)<NEW_LINE>projectIssue.setMovementDate(getMovementDate());<NEW_LINE>if (getDescription() != null && getDescription().length() > 0)<NEW_LINE>projectIssue.setDescription(getDescription());<NEW_LINE>else if (projectLine.getDescription() != null)<NEW_LINE>projectIssue.setDescription(projectLine.getDescription());<NEW_LINE>projectIssue.process();<NEW_LINE>// Update Line<NEW_LINE>projectLine.setMProjectIssue(projectIssue);<NEW_LINE>projectLine.saveEx();<NEW_LINE>addLog(projectIssue.getLine(), projectIssue.getMovementDate(), projectIssue.getMovementQty(), null);<NEW_LINE>return "@Created@ 1";<NEW_LINE>}
|
MProjectIssue projectIssue = new MProjectIssue(project);
|
1,328,560
|
private void writeRequestRumData(CounterRequest request) throws IOException {<NEW_LINE>final CounterRequestRumData rumData = request.getRumData();<NEW_LINE>final DecimalFormat percentUsFormat = new DecimalFormat("0.00", DecimalFormatSymbols.getInstance(Locale.US));<NEW_LINE>final DecimalFormat percentLocaleFormat = I18N.createPercentFormat();<NEW_LINE>final int networkTimeMean = rumData.getNetworkTimeMean();<NEW_LINE>final int serverMean = request.getMean();<NEW_LINE>final int domProcessingMean = rumData.getDomProcessingMean();<NEW_LINE>final int pageRenderingMean = rumData.getPageRenderingMean();<NEW_LINE>final int total <MASK><NEW_LINE>final double networkPercent = 100d * networkTimeMean / total;<NEW_LINE>final double serverPercent = 100d * serverMean / total;<NEW_LINE>final double domProcessingPercent = 100d * domProcessingMean / total;<NEW_LINE>final double pageRenderingPercent = 100d * pageRenderingMean / total;<NEW_LINE>writeln("<br/><table class='rumData' summary=''><tr>");<NEW_LINE>writeln("<td class='rumDataNetwork tooltip' data-width-percent='" + percentUsFormat.format(networkPercent) + "'><em>#Network#: " + integerFormat.format(networkTimeMean) + " ms (" + percentLocaleFormat.format(networkPercent) + ")</em>#Network#</td>");<NEW_LINE>writeln("<td class='rumDataServer tooltip' data-width-percent='" + percentUsFormat.format(serverPercent) + "'><em>#Server#: " + integerFormat.format(serverMean) + " ms (" + percentLocaleFormat.format(serverPercent) + "%)</em>#Server#</td>");<NEW_LINE>writeln("<td class='rumDataDomProcessing tooltip' data-width-percent='" + percentUsFormat.format(domProcessingPercent) + "'><em>#DOM_processing#:" + integerFormat.format(domProcessingMean) + " ms (" + percentLocaleFormat.format(domProcessingPercent) + "%)</em>#DOM_processing#</td>");<NEW_LINE>writeln("<td class='rumDataPageRendering tooltip' data-width-percent='" + percentUsFormat.format(pageRenderingPercent) + "'><em>#Page_rendering#:" + integerFormat.format(pageRenderingMean) + " ms (" + percentLocaleFormat.format(pageRenderingPercent) + "%)</em>#Page_rendering#</td>");<NEW_LINE>writeln("</tr></table>");<NEW_LINE>}
|
= networkTimeMean + serverMean + domProcessingMean + pageRenderingMean;
|
929,139
|
private void inject(PolyfillUsage polyfillUsage) {<NEW_LINE>Polyfill polyfill = polyfillUsage.polyfill();<NEW_LINE>final FeatureSet outputFeatureSet = compiler<MASK><NEW_LINE>final FeatureSet featuresRequiredByPolyfill = FeatureSet.valueOf(polyfill.polyfillVersion);<NEW_LINE>if (polyfill.kind.equals(Polyfill.Kind.STATIC) && !outputFeatureSet.contains(featuresRequiredByPolyfill)) {<NEW_LINE>compiler.report(JSError.make(polyfillUsage.node(), INSUFFICIENT_OUTPUT_VERSION_ERROR, polyfillUsage.name(), outputFeatureSet.version()));<NEW_LINE>}<NEW_LINE>// The question we want to ask here is:<NEW_LINE>// "Does the target platform already have the symbol this polyfill provides?"<NEW_LINE>// We approximate it by asking instead:<NEW_LINE>// "Does the target platform support all of the features that existed in the language<NEW_LINE>// version that introduced this symbol?"<NEW_LINE>if (!outputFeatureSet.contains(FeatureSet.valueOf(polyfill.nativeVersion)) && !polyfill.library.isEmpty()) {<NEW_LINE>libraries.add(polyfill.library);<NEW_LINE>}<NEW_LINE>}
|
.getOptions().getOutputFeatureSet();
|
1,059,920
|
public void onCheckedChanged(RadioGroup group, int checkedId) {<NEW_LINE>SlidingMenu sm = getSlidingMenu();<NEW_LINE>switch(checkedId) {<NEW_LINE>case R.id.left:<NEW_LINE>sm.setMode(SlidingMenu.LEFT);<NEW_LINE>sm.<MASK><NEW_LINE>break;<NEW_LINE>case R.id.right:<NEW_LINE>sm.setMode(SlidingMenu.RIGHT);<NEW_LINE>sm.setShadowDrawable(R.drawable.shadowright);<NEW_LINE>break;<NEW_LINE>case R.id.left_right:<NEW_LINE>sm.setMode(SlidingMenu.LEFT_RIGHT);<NEW_LINE>sm.setSecondaryMenu(R.layout.menu_frame_two);<NEW_LINE>getSupportFragmentManager().beginTransaction().replace(R.id.menu_frame_two, new SampleListFragment()).commit();<NEW_LINE>sm.setSecondaryShadowDrawable(R.drawable.shadowright);<NEW_LINE>sm.setShadowDrawable(R.drawable.shadow);<NEW_LINE>}<NEW_LINE>}
|
setShadowDrawable(R.drawable.shadow);
|
1,472,138
|
public com.amazonaws.services.secretsmanager.model.EncryptionFailureException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.secretsmanager.model.EncryptionFailureException encryptionFailureException = new com.amazonaws.services.secretsmanager.model.EncryptionFailureException(null);<NEW_LINE><MASK><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>} 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 encryptionFailureException;<NEW_LINE>}
|
int originalDepth = context.getCurrentDepth();
|
11,717
|
public <T> T chooseElement(final String dialogTitle, final String message, final List<T> elements, Function<T, String> labelFun) {<NEW_LINE>try (LiveVariable<T> chosen = new LiveVariable<>()) {<NEW_LINE>getShell().getDisplay().syncExec(new Runnable() {<NEW_LINE><NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>public void run() {<NEW_LINE>ILabelProvider labelProvider = new LabelProvider() {<NEW_LINE><NEW_LINE>public String getText(Object element) {<NEW_LINE>return labelFun.apply((T) element);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>try {<NEW_LINE>ElementListSelectionDialog dialog = new ElementListSelectionDialog(getShell(), labelProvider);<NEW_LINE>dialog.setElements(elements.toArray());<NEW_LINE>dialog.setTitle(dialogTitle);<NEW_LINE>dialog.setMessage(message);<NEW_LINE>dialog.setMultipleSelection(false);<NEW_LINE>int result = dialog.open();<NEW_LINE>labelProvider.dispose();<NEW_LINE>if (result == Window.OK) {<NEW_LINE>chosen.setValue((<MASK><NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>labelProvider.dispose();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return chosen.getValue();<NEW_LINE>}<NEW_LINE>}
|
T) dialog.getFirstResult());
|
686,946
|
public int initialQpDelta(Picture pic, int mbX, int mbY) {<NEW_LINE>if (initialQp <= MINQP) {<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>byte[] patch = new byte[256];<NEW_LINE>MBEncoderHelper.take(pic.getPlaneData(0), pic.getPlaneWidth(0), pic.getPlaneHeight(0), mbX << 4, mbY << 4, patch, 16, 16);<NEW_LINE>int avg = calcAvg(patch);<NEW_LINE>double var = calcVar(patch, avg);<NEW_LINE>double bright = calcBright(avg);<NEW_LINE>int newQp = initialQp;<NEW_LINE>int range <MASK><NEW_LINE>// Brightness<NEW_LINE>double delta = var * 0.1 * Math.max(0, bright - 2);<NEW_LINE>var += delta;<NEW_LINE>// Variance<NEW_LINE>if (var < 4) {<NEW_LINE>newQp = sliceType == SliceType.I ? Math.max(initialQp / 2, 12) : Math.max(2 * initialQp / 3, 18);<NEW_LINE>} else if (var < 8) {<NEW_LINE>newQp = initialQp - range / 2;<NEW_LINE>} else if (var < 16) {<NEW_LINE>newQp = initialQp - range / 4;<NEW_LINE>} else if (var < 32) {<NEW_LINE>newQp = initialQp - range / 8;<NEW_LINE>} else if (var < 64) {<NEW_LINE>newQp = initialQp - range / 16;<NEW_LINE>}<NEW_LINE>int qpDelta = newQp - oldQp;<NEW_LINE>oldQp = newQp;<NEW_LINE>return qpDelta;<NEW_LINE>}
|
= (initialQp - MINQP) / 2;
|
1,750,233
|
// autogenerated by CtBiScannerGenerator<NEW_LINE>@java.lang.Override<NEW_LINE>public <T> void visitCtIntersectionTypeReference(final spoon.reflect.reference.CtIntersectionTypeReference<T> reference) {<NEW_LINE>spoon.reflect.reference.CtIntersectionTypeReference other = ((spoon.reflect.reference.CtIntersectionTypeReference) (this.stack.peek()));<NEW_LINE>enter(reference);<NEW_LINE>biScan(spoon.reflect.path.CtRole.PACKAGE_REF, reference.getPackage(<MASK><NEW_LINE>biScan(spoon.reflect.path.CtRole.DECLARING_TYPE, reference.getDeclaringType(), other.getDeclaringType());<NEW_LINE>// TypeReferenceTest fails if actual type arguments are really not set-able on CtIntersectionTypeReference<NEW_LINE>biScan(spoon.reflect.path.CtRole.TYPE_ARGUMENT, reference.getActualTypeArguments(), other.getActualTypeArguments());<NEW_LINE>biScan(spoon.reflect.path.CtRole.ANNOTATION, reference.getAnnotations(), other.getAnnotations());<NEW_LINE>biScan(spoon.reflect.path.CtRole.BOUND, reference.getBounds(), other.getBounds());<NEW_LINE>exit(reference);<NEW_LINE>}
|
), other.getPackage());
|
600,920
|
public static void onLoadStyle(Context c, TextStyle textStyle) {<NEW_LINE>final Resources.Theme theme = c.getTheme();<NEW_LINE>// check first if provided attributes contain textAppearance. As an analogy to TextView<NEW_LINE>// behavior,<NEW_LINE>// we will parse textAppearance attributes first and then will override leftovers from main<NEW_LINE>// style<NEW_LINE>TypedArray a;<NEW_LINE>if (SDK_INT <= LOLLIPOP_MR1) {<NEW_LINE>synchronized (theme) {<NEW_LINE>a = c.obtainStyledAttributes(null, R.styleable.Text_RenderCoreTextAppearanceAttr, 0, 0);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>a = c.obtainStyledAttributes(null, R.styleable.Text_RenderCoreTextAppearanceAttr, 0, 0);<NEW_LINE>}<NEW_LINE>int textAppearanceResId = a.getResourceId(R.styleable.Text_RenderCoreTextAppearanceAttr_android_textAppearance, -1);<NEW_LINE>a.recycle();<NEW_LINE>if (textAppearanceResId != -1) {<NEW_LINE>if (SDK_INT <= LOLLIPOP_MR1) {<NEW_LINE>synchronized (theme) {<NEW_LINE>a = theme.obtainStyledAttributes(textAppearanceResId, R.styleable.RenderCoreText);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>a = theme.obtainStyledAttributes(textAppearanceResId, R.styleable.RenderCoreText);<NEW_LINE>}<NEW_LINE>resolveStyleAttrsForTypedArray(a, textStyle);<NEW_LINE>a.recycle();<NEW_LINE>}<NEW_LINE>// Now read the textViewStyle set on this theme. We do this to be able to just read any<NEW_LINE>// attribute set for a TextView<NEW_LINE>if (SDK_INT <= LOLLIPOP_MR1) {<NEW_LINE>synchronized (theme) {<NEW_LINE>a = c.obtainStyledAttributes(null, R.styleable.Text_RenderCoreTextStyleAttr, 0, 0);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>a = c.obtainStyledAttributes(null, R.styleable.Text_RenderCoreTextStyleAttr, 0, 0);<NEW_LINE>}<NEW_LINE>int textStyleResId = a.getResourceId(R.styleable.Text_RenderCoreTextStyleAttr_android_textViewStyle, -1);<NEW_LINE>a.recycle();<NEW_LINE>if (textStyleResId != -1) {<NEW_LINE>if (SDK_INT <= LOLLIPOP_MR1) {<NEW_LINE>synchronized (theme) {<NEW_LINE>a = theme.obtainStyledAttributes(<MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>a = theme.obtainStyledAttributes(textStyleResId, R.styleable.RenderCoreText);<NEW_LINE>}<NEW_LINE>resolveStyleAttrsForTypedArray(a, textStyle);<NEW_LINE>a.recycle();<NEW_LINE>}<NEW_LINE>}
|
textStyleResId, R.styleable.RenderCoreText);
|
736,817
|
public static Exception writeGpx(Writer output, GPXFile file, IProgress progress) {<NEW_LINE>if (progress != null) {<NEW_LINE>progress.startWork(file.getItemsToWriteSize());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>XmlSerializer serializer = PlatformUtil.newSerializer();<NEW_LINE>serializer.setOutput(output);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>serializer.setFeature("http://xmlpull.org/v1/doc/features.html#indent-output", true);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>serializer.startDocument("UTF-8", true);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>serializer.startTag(null, "gpx");<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>serializer.attribute(null, "version", "1.1");<NEW_LINE>if (file.author != null) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>serializer.attribute(null, "creator", file.author);<NEW_LINE>}<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>serializer.attribute(null, "xmlns", "http://www.topografix.com/GPX/1/1");<NEW_LINE>serializer.<MASK><NEW_LINE>serializer.attribute(null, "xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance");<NEW_LINE>serializer.attribute(null, "xsi:schemaLocation", "http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd");<NEW_LINE>writeMetadata(serializer, file, progress);<NEW_LINE>writePoints(serializer, file, progress);<NEW_LINE>writeRoutes(serializer, file, progress);<NEW_LINE>writeTracks(serializer, file, progress);<NEW_LINE>writeExtensions(serializer, file, progress);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>serializer.endTag(null, "gpx");<NEW_LINE>serializer.endDocument();<NEW_LINE>serializer.flush();<NEW_LINE>} catch (Exception e) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>log.error("Error saving gpx", e);<NEW_LINE>return e;<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
|
attribute(null, "xmlns:osmand", "https://osmand.net");
|
1,011,047
|
public int bindParameters(PreparedStatement statement) throws SQLException {<NEW_LINE>// first write the changed properties<NEW_LINE>int index = EntityWriter.this.bindParameters(statement, entity, filter);<NEW_LINE>// write the where arguments<NEW_LINE>for (Attribute<E, ?> attribute : whereAttributes) {<NEW_LINE>if (attribute == versionAttribute) {<NEW_LINE>mapping.write((Expression) attribute, <MASK><NEW_LINE>} else {<NEW_LINE>if (attribute.getPrimitiveKind() != null) {<NEW_LINE>mapPrimitiveType(proxy, attribute, statement, index + 1);<NEW_LINE>} else {<NEW_LINE>Object value;<NEW_LINE>if (attribute.isKey() && attribute.isAssociation()) {<NEW_LINE>value = proxy.getKey(attribute);<NEW_LINE>} else {<NEW_LINE>value = proxy.get(attribute, false);<NEW_LINE>}<NEW_LINE>mapping.write((Expression) attribute, statement, index + 1, value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>index++;<NEW_LINE>}<NEW_LINE>return index;<NEW_LINE>}
|
statement, index + 1, version);
|
296,150
|
private TransactionJson buildCreateSmartContractTransaction(byte[] ownerAddress, BuildArguments args) throws JsonRpcInvalidParamsException, JsonRpcInvalidRequestException, JsonRpcInternalException {<NEW_LINE>try {<NEW_LINE>CreateSmartContract.Builder build = CreateSmartContract.newBuilder();<NEW_LINE>build.setOwnerAddress(ByteString.copyFrom(ownerAddress));<NEW_LINE>build.setCallTokenValue(args.getTokenValue()).setTokenId(args.getTokenId());<NEW_LINE>ABI.Builder abiBuilder = ABI.newBuilder();<NEW_LINE>if (StringUtils.isNotEmpty(args.getAbi())) {<NEW_LINE>String abiStr = "{" + "\"entrys\":" + args.getAbi() + "}";<NEW_LINE>JsonFormat.merge(abiStr, abiBuilder, args.isVisible());<NEW_LINE>}<NEW_LINE>SmartContract.Builder smartBuilder = SmartContract.newBuilder();<NEW_LINE>smartBuilder.setAbi(abiBuilder).setCallValue(args.parseValue()).setConsumeUserResourcePercent(args.getConsumeUserResourcePercent()).setOriginEnergyLimit(args.getOriginEnergyLimit());<NEW_LINE>smartBuilder.setOriginAddress(ByteString.copyFrom(ownerAddress));<NEW_LINE>// bytecode + parameter<NEW_LINE>smartBuilder.setBytecode(ByteString.copyFrom(ByteArray.fromHexString(args.getData())));<NEW_LINE>if (StringUtils.isNotEmpty(args.getName())) {<NEW_LINE>smartBuilder.setName(args.getName());<NEW_LINE>}<NEW_LINE>build.setNewContract(smartBuilder);<NEW_LINE>Transaction tx = wallet.createTransactionCapsule(build.build(), ContractType.CreateSmartContract).getInstance();<NEW_LINE>Transaction.Builder txBuilder = tx.toBuilder();<NEW_LINE>Transaction.raw.Builder rawBuilder = tx.getRawData().toBuilder();<NEW_LINE>rawBuilder.setFeeLimit(args.parseGas() * wallet.getEnergyFee());<NEW_LINE>txBuilder.setRawData(rawBuilder);<NEW_LINE>tx = setTransactionPermissionId(args.getPermissionId(), txBuilder.build());<NEW_LINE>TransactionJson transactionJson = new TransactionJson();<NEW_LINE>transactionJson.setTransaction(JSON.parseObject(Util.printCreateTransaction(tx, false)));<NEW_LINE>return transactionJson;<NEW_LINE>} catch (JsonRpcInvalidParamsException e) {<NEW_LINE>throw new JsonRpcInvalidParamsException(e.getMessage());<NEW_LINE>} catch (ContractValidateException e) {<NEW_LINE>throw new JsonRpcInvalidRequestException(e.getMessage());<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>}
|
JsonRpcInternalException(e.getMessage());
|
688,629
|
private boolean actionText(final WarehouseId only_Warehouse_ID, final int only_Product_ID) {<NEW_LINE>String text = m_text.getText();<NEW_LINE>log.debug(text);<NEW_LINE>// Null<NEW_LINE>if (text == null || text.length() == 0) {<NEW_LINE>if (isMandatory()) {<NEW_LINE>return false;<NEW_LINE>} else {<NEW_LINE>setValue(null, true);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (text.endsWith("%")) {<NEW_LINE>text = text.toUpperCase();<NEW_LINE>} else {<NEW_LINE>text <MASK><NEW_LINE>}<NEW_LINE>// Look up - see MLocatorLookup.run<NEW_LINE>StringBuffer sql = new StringBuffer("SELECT M_Locator_ID FROM M_Locator ").append(" WHERE IsActive='Y' AND UPPER(Value) LIKE ").append(DB.TO_STRING(text));<NEW_LINE>if (only_Warehouse_ID != null) {<NEW_LINE>sql.append(" AND M_Warehouse_ID=?");<NEW_LINE>}<NEW_LINE>if (getOnly_Product_ID() != 0) {<NEW_LINE>// Default Locator<NEW_LINE>// Product Locator<NEW_LINE>sql.append(" AND (IsDefault='Y' ").// Product Locator<NEW_LINE>append("OR EXISTS (SELECT * FROM M_Product p ").append(// Storage Locator<NEW_LINE>"WHERE p.M_Locator_ID=M_Locator.M_Locator_ID AND p.M_Product_ID=?)").// Storage Locator<NEW_LINE>append("OR EXISTS (SELECT * FROM M_Storage s ").append("WHERE s.M_Locator_ID=M_Locator.M_Locator_ID AND s.M_Product_ID=?))");<NEW_LINE>}<NEW_LINE>String finalSql = Env.getUserRolePermissions().addAccessSQL(sql.toString(), "M_Locator", IUserRolePermissions.SQL_NOTQUALIFIED, Access.READ);<NEW_LINE>//<NEW_LINE>int M_Locator_ID = 0;<NEW_LINE>PreparedStatement pstmt = null;<NEW_LINE>ResultSet rs = null;<NEW_LINE>try {<NEW_LINE>pstmt = DB.prepareStatement(finalSql, ITrx.TRXNAME_None);<NEW_LINE>int index = 1;<NEW_LINE>if (only_Warehouse_ID != null) {<NEW_LINE>pstmt.setInt(index++, only_Warehouse_ID.getRepoId());<NEW_LINE>}<NEW_LINE>if (only_Product_ID != 0) {<NEW_LINE>pstmt.setInt(index++, only_Product_ID);<NEW_LINE>pstmt.setInt(index++, only_Product_ID);<NEW_LINE>}<NEW_LINE>rs = pstmt.executeQuery();<NEW_LINE>if (rs.next()) {<NEW_LINE>M_Locator_ID = rs.getInt(1);<NEW_LINE>if (rs.next()) {<NEW_LINE>// more than one<NEW_LINE>M_Locator_ID = 0;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (SQLException ex) {<NEW_LINE>log.error(finalSql, ex);<NEW_LINE>} finally {<NEW_LINE>DB.close(rs, pstmt);<NEW_LINE>}<NEW_LINE>if (M_Locator_ID <= 0) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>setValue(M_Locator_ID, true);<NEW_LINE>return true;<NEW_LINE>}
|
= text.toUpperCase() + "%";
|
756,122
|
public void start() {<NEW_LINE>Runnable r = new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>if (parent.stopSync())<NEW_LINE>return;<NEW_LINE>if (!NbApplication.isAppForeground()) {<NEW_LINE>Process.setThreadPriority(<MASK><NEW_LINE>} else {<NEW_LINE>Process.setThreadPriority(Process.THREAD_PRIORITY_DEFAULT + Process.THREAD_PRIORITY_LESS_FAVORABLE + Process.THREAD_PRIORITY_LESS_FAVORABLE);<NEW_LINE>}<NEW_LINE>Thread.currentThread().setName(this.getClass().getName());<NEW_LINE>exec_();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>try {<NEW_LINE>executor.execute(r);<NEW_LINE>// enqueue a check task that will run strictly after the real one, so the callback<NEW_LINE>// can effectively check queue size to see if there are queued tasks<NEW_LINE>executor.execute(new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>parent.checkCompletion();<NEW_LINE>parent.sendSyncUpdate(UPDATE_STATUS);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (RejectedExecutionException ree) {<NEW_LINE>// this is perfectly normal, as service soft-stop mechanics might have shut down our thread pool<NEW_LINE>// while peer subservices are still running<NEW_LINE>}<NEW_LINE>}
|
Process.THREAD_PRIORITY_BACKGROUND + Process.THREAD_PRIORITY_LESS_FAVORABLE);
|
1,409,428
|
protected void internalTransform(Body b, String phaseName, Map<String, String> options) {<NEW_LINE>LocalDefs ld = G.v().<MASK><NEW_LINE>for (Unit s : b.getUnits()) {<NEW_LINE>// System.out.println("stmt: "+s);<NEW_LINE>for (ValueBox vbox : s.getUseBoxes()) {<NEW_LINE>Value v = vbox.getValue();<NEW_LINE>if (v instanceof Local) {<NEW_LINE>Local l = (Local) v;<NEW_LINE>// System.out.println("local: "+l);<NEW_LINE>for (Unit next : ld.getDefsOfAt(l, s)) {<NEW_LINE>String info = l + " has reaching def: " + next;<NEW_LINE>String className = b.getMethod().getDeclaringClass().getName();<NEW_LINE>s.addTag(new LinkTag(info, next, className, "Reaching Defs"));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
soot_toolkits_scalar_LocalDefsFactory().newLocalDefs(b);
|
64,879
|
public ProjectInvitationResponse newProjectInvitationResponse(ProjectInvitationJoinVO invite) {<NEW_LINE>ProjectInvitationResponse response = new ProjectInvitationResponse();<NEW_LINE>response.setId(invite.getUuid());<NEW_LINE>response.setProjectId(invite.getProjectUuid());<NEW_LINE>response.setProjectName(invite.getProjectName());<NEW_LINE>if (invite.getState() != null) {<NEW_LINE>response.setInvitationState(invite.getState().toString());<NEW_LINE>}<NEW_LINE>if (invite.getAccountName() != null) {<NEW_LINE>response.setAccountName(invite.getAccountName());<NEW_LINE>}<NEW_LINE>if (invite.getUserId() != null) {<NEW_LINE>response.setUserId(invite.getUserId());<NEW_LINE>}<NEW_LINE>if (invite.getEmail() != null) {<NEW_LINE>response.setEmail(invite.getEmail());<NEW_LINE>}<NEW_LINE>response.<MASK><NEW_LINE>response.setDomainName(invite.getDomainName());<NEW_LINE>response.setObjectName("projectinvitation");<NEW_LINE>return response;<NEW_LINE>}
|
setDomainId(invite.getDomainUuid());
|
673,775
|
public int calcSelectedIndex(@Nonnull Object[] modelElements, @Nonnull String trimmedText) {<NEW_LINE>if (myModel instanceof Comparator) {<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>Matcher matcher <MASK><NEW_LINE>final String statContext = statisticsContext();<NEW_LINE>Comparator<Object> itemComparator = Comparator.comparing(e -> trimmedText.equalsIgnoreCase(myModel.getElementName(e))).thenComparing(e -> matchingDegree(matcher, e)).thenComparing(e -> getUseCount(statContext, e)).reversed();<NEW_LINE>int bestPosition = 0;<NEW_LINE>while (bestPosition < modelElements.length - 1 && isSpecialElement(modelElements[bestPosition])) bestPosition++;<NEW_LINE>for (int i = 1; i < modelElements.length; i++) {<NEW_LINE>final Object modelElement = modelElements[i];<NEW_LINE>if (isSpecialElement(modelElement))<NEW_LINE>continue;<NEW_LINE>if (itemComparator.compare(modelElement, modelElements[bestPosition]) < 0) {<NEW_LINE>bestPosition = i;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return bestPosition;<NEW_LINE>}
|
= buildPatternMatcher(transformPattern(trimmedText));
|
438,815
|
public void processInlineConstructor(RecoveredClass recoveredClass, Function inlinedConstructorFunction, Map<Address, RecoveredClass> referenceToClassMap) throws CancelledException, InvalidInputException, DuplicateNameException, CircularDependencyException {<NEW_LINE>if (referenceToClassMap.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<Address> referencesToVftables = new ArrayList<Address>();<NEW_LINE>List<Address> referenceAddresses = new ArrayList<Address>(referenceToClassMap.keySet());<NEW_LINE>Iterator<Address> referenceIterator = referenceAddresses.iterator();<NEW_LINE>while (referenceIterator.hasNext()) {<NEW_LINE>monitor.checkCanceled();<NEW_LINE><MASK><NEW_LINE>Address vftableAddress = getVftableAddress(reference);<NEW_LINE>if (vftableAddress != null) {<NEW_LINE>referencesToVftables.add(reference);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (referencesToVftables.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Collections.sort(referencesToVftables);<NEW_LINE>int numRefs = referencesToVftables.size();<NEW_LINE>Address lastRef = referencesToVftables.get(numRefs - 1);<NEW_LINE>Iterator<Address> refToVtablesIterator = referencesToVftables.iterator();<NEW_LINE>while (refToVtablesIterator.hasNext()) {<NEW_LINE>monitor.checkCanceled();<NEW_LINE>Address refToVftable = refToVtablesIterator.next();<NEW_LINE>RecoveredClass referencedClass = referenceToClassMap.get(refToVftable);<NEW_LINE>// last reference is the constructor<NEW_LINE>if (refToVftable.equals(lastRef)) {<NEW_LINE>addConstructorToClass(referencedClass, inlinedConstructorFunction);<NEW_LINE>} else // the rest are inlined constructors<NEW_LINE>{<NEW_LINE>addInlinedConstructorToClass(referencedClass, inlinedConstructorFunction);<NEW_LINE>}<NEW_LINE>referencedClass.removeIndeterminateInline(inlinedConstructorFunction);<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}
|
Address reference = referenceIterator.next();
|
1,818,469
|
public static String toJSONString(Object object, boolean prettyFormat) {<NEW_LINE>JSONWriter.Context context = JSONFactory.<MASK><NEW_LINE>if (prettyFormat) {<NEW_LINE>context.config(JSONWriter.Feature.PrettyFormat);<NEW_LINE>}<NEW_LINE>context.setDateFormat("millis");<NEW_LINE>try (JSONWriter writer = JSONWriter.of(context)) {<NEW_LINE>writer.setRootObject(object);<NEW_LINE>if (object == null) {<NEW_LINE>writer.writeNull();<NEW_LINE>} else {<NEW_LINE>Class<?> valueClass = object.getClass();<NEW_LINE>ObjectWriter objectWriter = context.getObjectWriter(valueClass, valueClass);<NEW_LINE>objectWriter.write(writer, object, null, null, 0);<NEW_LINE>}<NEW_LINE>return writer.toString();<NEW_LINE>} catch (com.alibaba.fastjson2.JSONException ex) {<NEW_LINE>Throwable cause = ex.getCause() != null ? ex.getCause() : ex;<NEW_LINE>throw new JSONException("toJSONString error", cause);<NEW_LINE>} catch (RuntimeException ex) {<NEW_LINE>throw new JSONException("toJSONString error", ex);<NEW_LINE>}<NEW_LINE>}
|
createWriteContext(JSONWriter.Feature.ReferenceDetection);
|
915,266
|
float evaluate(int indexA, int indexB, float t) {<NEW_LINE>m_sweepA.getTransform(xfa, t);<NEW_LINE>m_sweepB.getTransform(xfb, t);<NEW_LINE>switch(m_type) {<NEW_LINE>case POINTS:<NEW_LINE>{<NEW_LINE>Rotation.mulTransUnsafe(xfa.q, m_axis, axisA);<NEW_LINE>Rotation.mulTransUnsafe(xfb.q, m_axis.negateLocal(), axisB);<NEW_LINE>m_axis.negateLocal();<NEW_LINE>localPointA.set(m_proxyA.getVertex(indexA));<NEW_LINE>localPointB.set(m_proxyB.getVertex(indexB));<NEW_LINE>Transform.mulToOutUnsafe(xfa, localPointA, pointA);<NEW_LINE>Transform.mulToOutUnsafe(xfb, localPointB, pointB);<NEW_LINE>return Vec2.dot(pointB.subLocal(pointA), m_axis);<NEW_LINE>}<NEW_LINE>case FACE_A:<NEW_LINE>{<NEW_LINE>Rotation.mulToOutUnsafe(xfa.q, m_axis, normal);<NEW_LINE>Transform.mulToOutUnsafe(xfa, m_localPoint, pointA);<NEW_LINE>Rotation.mulTransUnsafe(xfb.q, normal.negateLocal(), axisB);<NEW_LINE>normal.negateLocal();<NEW_LINE>localPointB.set(m_proxyB.getVertex(indexB));<NEW_LINE>Transform.mulToOutUnsafe(xfb, localPointB, pointB);<NEW_LINE>return Vec2.dot(pointB.subLocal(pointA), normal);<NEW_LINE>}<NEW_LINE>case FACE_B:<NEW_LINE>{<NEW_LINE>Rotation.mulToOutUnsafe(xfb.q, m_axis, normal);<NEW_LINE>Transform.mulToOutUnsafe(xfb, m_localPoint, pointB);<NEW_LINE>Rotation.mulTransUnsafe(xfa.q, normal.negateLocal(), axisA);<NEW_LINE>normal.negateLocal();<NEW_LINE>localPointA.set(m_proxyA.getVertex(indexA));<NEW_LINE>Transform.mulToOutUnsafe(xfa, localPointA, pointA);<NEW_LINE>return Vec2.dot(pointA<MASK><NEW_LINE>}<NEW_LINE>default:<NEW_LINE>assert false;<NEW_LINE>return 0f;<NEW_LINE>}<NEW_LINE>}
|
.subLocal(pointB), normal);
|
1,685,624
|
public static <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Tuple13Task<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> par(final Task<T1> task1, final Task<T2> task2, final Task<T3> task3, final Task<T4> task4, final Task<T5> task5, final Task<T6> task6, final Task<T7> task7, final Task<T8> task8, final Task<T9> task9, final Task<T10> task10, final Task<T11> task11, final Task<T12> task12, final Task<T13> task13) {<NEW_LINE>ArgumentUtil.requireNotNull(task1, "task1");<NEW_LINE>ArgumentUtil.requireNotNull(task2, "task2");<NEW_LINE>ArgumentUtil.requireNotNull(task3, "task3");<NEW_LINE>ArgumentUtil.requireNotNull(task4, "task4");<NEW_LINE>ArgumentUtil.requireNotNull(task5, "task5");<NEW_LINE>ArgumentUtil.requireNotNull(task6, "task6");<NEW_LINE>ArgumentUtil.requireNotNull(task7, "task7");<NEW_LINE><MASK><NEW_LINE>ArgumentUtil.requireNotNull(task9, "task9");<NEW_LINE>ArgumentUtil.requireNotNull(task10, "task10");<NEW_LINE>ArgumentUtil.requireNotNull(task11, "task11");<NEW_LINE>ArgumentUtil.requireNotNull(task12, "task12");<NEW_LINE>ArgumentUtil.requireNotNull(task13, "task13");<NEW_LINE>return new Par13Task<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>("par13", task1, task2, task3, task4, task5, task6, task7, task8, task9, task10, task11, task12, task13);<NEW_LINE>}
|
ArgumentUtil.requireNotNull(task8, "task8");
|
1,000,948
|
protected AnnotationNode annotation(AST annotationNode) {<NEW_LINE>annotationBeingDef = true;<NEW_LINE>AST node = annotationNode.getFirstChild();<NEW_LINE>AnnotationNode annotatedNode = new AnnotationNode(makeType(annotationNode));<NEW_LINE>// GRECLIPSE end<NEW_LINE>configureAST(annotatedNode, annotationNode);<NEW_LINE>// GRECLIPSE add<NEW_LINE>int start = annotatedNode.getStart();<NEW_LINE><MASK><NEW_LINE>// check for trailing whitespace<NEW_LINE>if (getController() != null) {<NEW_LINE>char[] sourceChars = getController().readSourceRange(start, until - start);<NEW_LINE>if (sourceChars != null) {<NEW_LINE>int i = (sourceChars.length - 1);<NEW_LINE>while (i >= 0 && Character.isWhitespace(sourceChars[i])) {<NEW_LINE>i -= 1;<NEW_LINE>until -= 1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>annotatedNode.setEnd(until);<NEW_LINE>int[] row_col = locations.getRowCol(until);<NEW_LINE>annotatedNode.setLastLineNumber(row_col[0]);<NEW_LINE>annotatedNode.setLastColumnNumber(row_col[1]);<NEW_LINE>// GRECLIPSE end<NEW_LINE>while (true) {<NEW_LINE>node = node.getNextSibling();<NEW_LINE>if (isType(ANNOTATION_MEMBER_VALUE_PAIR, node)) {<NEW_LINE>AST memberNode = node.getFirstChild();<NEW_LINE>String param = identifier(memberNode);<NEW_LINE>Expression expression = expression(memberNode.getNextSibling());<NEW_LINE>if (annotatedNode.getMember(param) != null) {<NEW_LINE>throw new ASTRuntimeException(memberNode, "Annotation member '" + param + "' has already been associated with a value");<NEW_LINE>}<NEW_LINE>annotatedNode.setMember(param, expression);<NEW_LINE>} else {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>annotationBeingDef = false;<NEW_LINE>return annotatedNode;<NEW_LINE>}
|
int until = annotatedNode.getEnd();
|
1,332,599
|
public CompletableFuture<BallerinaExampleListResponse> list(BallerinaExampleListRequest request) {<NEW_LINE>return CompletableFuture.supplyAsync(() -> {<NEW_LINE>BallerinaExampleListResponse response = new BallerinaExampleListResponse();<NEW_LINE>Gson gson = new Gson();<NEW_LINE>Path bbeJSONPath = Paths.get(CommonUtil.BALLERINA_HOME).resolve<MASK><NEW_LINE>try {<NEW_LINE>InputStreamReader fileReader = new InputStreamReader(new FileInputStream(bbeJSONPath.toFile()), StandardCharsets.UTF_8);<NEW_LINE>JsonReader jsonReader = new JsonReader(fileReader);<NEW_LINE>List<BallerinaExampleCategory> data = gson.fromJson(jsonReader, EXAMPLE_CATEGORY_TYPE);<NEW_LINE>response.setSamples(data);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>String msg = "Operation 'ballerinaExample/list' failed!";<NEW_LINE>this.clientLogger.logError(ExampleContext.EXAMPLE_LIST, msg, e, new TextDocumentIdentifier(bbeJSONPath.toString()), (Position) null);<NEW_LINE>response.setSamples(new ArrayList<>());<NEW_LINE>}<NEW_LINE>return response;<NEW_LINE>});<NEW_LINE>}
|
(EXAMPLES_DIR).resolve(BBE_DEF_JSON);
|
232,235
|
public void joinParticleGroups(ParticleGroup groupA, ParticleGroup groupB) {<NEW_LINE>assert (groupA != groupB);<NEW_LINE>RotateBuffer(groupB.m_firstIndex, groupB.m_lastIndex, m_count);<NEW_LINE>assert (groupB.m_lastIndex == m_count);<NEW_LINE>RotateBuffer(groupA.m_firstIndex, groupA.m_lastIndex, groupB.m_firstIndex);<NEW_LINE>assert (groupA.m_lastIndex == groupB.m_firstIndex);<NEW_LINE>int particleFlags = 0;<NEW_LINE>for (int i = groupA.m_firstIndex; i < groupB.m_lastIndex; i++) {<NEW_LINE>particleFlags |= m_flagsBuffer.data[i];<NEW_LINE>}<NEW_LINE>updateContacts(true);<NEW_LINE>if ((particleFlags & k_pairFlags) != 0) {<NEW_LINE>for (int k = 0; k < m_contactCount; k++) {<NEW_LINE>final ParticleContact contact = m_contactBuffer[k];<NEW_LINE>int a = contact.indexA;<NEW_LINE>int b = contact.indexB;<NEW_LINE>if (a > b) {<NEW_LINE>int temp = a;<NEW_LINE>a = b;<NEW_LINE>b = temp;<NEW_LINE>}<NEW_LINE>if (groupA.m_firstIndex <= a && a < groupA.m_lastIndex && groupB.m_firstIndex <= b && b < groupB.m_lastIndex) {<NEW_LINE>if (m_pairCount >= m_pairCapacity) {<NEW_LINE>int oldCapacity = m_pairCapacity;<NEW_LINE>int newCapacity = m_pairCount != 0 ? 2 * m_pairCount : Settings.minParticleBufferCapacity;<NEW_LINE>m_pairBuffer = BufferUtils.reallocateBuffer(Pair.class, m_pairBuffer, oldCapacity, newCapacity);<NEW_LINE>m_pairCapacity = newCapacity;<NEW_LINE>}<NEW_LINE>Pair pair = m_pairBuffer[m_pairCount];<NEW_LINE>pair.indexA = a;<NEW_LINE>pair.indexB = b;<NEW_LINE>pair.flags = contact.flags;<NEW_LINE>pair.strength = MathUtils.min(<MASK><NEW_LINE>pair.distance = MathUtils.distance(m_positionBuffer.data[a], m_positionBuffer.data[b]);<NEW_LINE>m_pairCount++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if ((particleFlags & k_triadFlags) != 0) {<NEW_LINE>VoronoiDiagram diagram = new VoronoiDiagram(groupB.m_lastIndex - groupA.m_firstIndex);<NEW_LINE>for (int i = groupA.m_firstIndex; i < groupB.m_lastIndex; i++) {<NEW_LINE>if ((m_flagsBuffer.data[i] & ParticleType.b2_zombieParticle) == 0) {<NEW_LINE>diagram.addGenerator(m_positionBuffer.data[i], i);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>diagram.generate(getParticleStride() / 2);<NEW_LINE>JoinParticleGroupsCallback callback = new JoinParticleGroupsCallback();<NEW_LINE>callback.system = this;<NEW_LINE>callback.groupA = groupA;<NEW_LINE>callback.groupB = groupB;<NEW_LINE>diagram.getNodes(callback);<NEW_LINE>}<NEW_LINE>for (int i = groupB.m_firstIndex; i < groupB.m_lastIndex; i++) {<NEW_LINE>m_groupBuffer[i] = groupA;<NEW_LINE>}<NEW_LINE>int groupFlags = groupA.m_groupFlags | groupB.m_groupFlags;<NEW_LINE>groupA.m_groupFlags = groupFlags;<NEW_LINE>groupA.m_lastIndex = groupB.m_lastIndex;<NEW_LINE>groupB.m_firstIndex = groupB.m_lastIndex;<NEW_LINE>destroyParticleGroup(groupB);<NEW_LINE>if ((groupFlags & ParticleGroupType.b2_solidParticleGroup) != 0) {<NEW_LINE>computeDepthForGroup(groupA);<NEW_LINE>}<NEW_LINE>}
|
groupA.m_strength, groupB.m_strength);
|
369,876
|
private void addPreviewPane(JDialog dialog) {<NEW_LINE>String content = getText();<NEW_LINE>try {<NEW_LINE>FormulaUtils.evalIfScript(getNode(), content);<NEW_LINE>evaluationStatus = EvaluationStatus.PASSED;<NEW_LINE>} catch (ExecuteScriptException e) {<NEW_LINE>final StringWriter out = new StringWriter();<NEW_LINE>try (PrintWriter writer = new PrintWriter(out)) {<NEW_LINE>e.printStackTrace(writer);<NEW_LINE>}<NEW_LINE>final JTextArea exceptionView = new JTextArea(out.toString());<NEW_LINE>exceptionView.setBackground(Color.LIGHT_GRAY);<NEW_LINE>exceptionView.setForeground(Color.RED.darker());<NEW_LINE>final Font font = textEditor.getFont();<NEW_LINE>exceptionView.setFont(font.deriveFont(font.getSize2D() * 0.8f));<NEW_LINE>exceptionView.setEditable(false);<NEW_LINE>final JScrollPane scrollPane = new JScrollPane(exceptionView, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);<NEW_LINE>final Rectangle availableScreenBounds = UITools.getAvailableScreenBounds(UITools.getCurrentRootComponent());<NEW_LINE>final Dimension maximumSize = new Dimension(availableScreenBounds.width * 3 / 4, Integer.MAX_VALUE);<NEW_LINE>final Dimension preferredSize = scrollPane.getPreferredSize();<NEW_LINE>preferredSize.width = Math.min(preferredSize.width, maximumSize.width);<NEW_LINE>preferredSize.height = 0;<NEW_LINE>scrollPane.setPreferredSize(preferredSize);<NEW_LINE>final Box resisablePreview = Box.createHorizontalBox();<NEW_LINE>dialog.<MASK><NEW_LINE>evaluationStatus = EvaluationStatus.FAILED;<NEW_LINE>}<NEW_LINE>}
|
add(resisablePreview, BorderLayout.EAST);
|
1,303,098
|
private void addMembers(final TypeElement e, final Description parentDescription, final CompilationInfo info, final Context ctx, boolean fqn) {<NEW_LINE>List<? extends Element> members = info.getElements().getAllMembers(e);<NEW_LINE>for (Element m : members) {<NEW_LINE>if (canceled.get())<NEW_LINE>return;<NEW_LINE>if (m.getKind() == ElementKind.STATIC_INIT) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Description d = element2description(m, e, parentDescription.isInherited, info, ctx, fqn);<NEW_LINE>if (null != d) {<NEW_LINE>if (!parentDescription.subs.add(d)) {<NEW_LINE>// NOI18N Should never happen<NEW_LINE>LOG.log(Level.INFO, "Duplicate enclosed element: {0}", d.name);<NEW_LINE>}<NEW_LINE>if (m instanceof TypeElement && !d.isInherited) {<NEW_LINE>addMembers((TypeElement) m, <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
d, info, ctx, fqn);
|
933,568
|
public void update(Downloader d, String file) {<NEW_LINE>titleLbl.setText(file);<NEW_LINE>if (d.getProgress() > 0) {<NEW_LINE>setTitle("[" + d.<MASK><NEW_LINE>} else {<NEW_LINE>setTitle(file);<NEW_LINE>}<NEW_LINE>String statTxt = "";<NEW_LINE>if (d.isConverting()) {<NEW_LINE>statTxt = StringResource.get("TITLE_CONVERT");<NEW_LINE>} else if (d.isAssembling()) {<NEW_LINE>statTxt = StringResource.get("STAT_ASSEMBLING");<NEW_LINE>} else {<NEW_LINE>statTxt = StringResource.get("STAT_DOWNLOADING");<NEW_LINE>}<NEW_LINE>lblStat.setText(statTxt);<NEW_LINE>// StringBuilder sb = new StringBuilder();<NEW_LINE>// sb.append((d.isAssembling() ? StringResource.get("STAT_ASSEMBLING")<NEW_LINE>// : StringResource.get("DWN_DOWNLOAD")));<NEW_LINE>// sb.append(" ");<NEW_LINE>// sb.append(FormatUtilities.formatSize(d.getDownloaded()));<NEW_LINE>// sb.append(" ");<NEW_LINE>// sb.append(d.getType()==XDMConstants.HTTP?)<NEW_LINE>lblDet.setText((d.isAssembling() ? StringResource.get("STAT_ASSEMBLING") : StringResource.get("DWN_DOWNLOAD")) + " " + FormatUtilities.formatSize(d.getDownloaded()) + " " + ((d.getType() == XDMConstants.HTTP || d.getType() == XDMConstants.DASH) ? "/ " + FormatUtilities.formatSize(d.getSize()) : "( " + d.getProgress() + " % )"));<NEW_LINE>lblSpeed.setText(FormatUtilities.formatSize(d.getDownloadSpeed()) + "/s");<NEW_LINE>lblETA.setText("ETA " + d.getEta());<NEW_LINE>prgCircle.setValue(d.getProgress());<NEW_LINE>SegmentDetails segDet = d.getSegmentDetails();<NEW_LINE>long sz = ((d.getType() == XDMConstants.HTTP || d.getType() == XDMConstants.FTP || d.getType() == XDMConstants.DASH) ? d.getSize() : 100);<NEW_LINE>segProgress.setValues(segDet, sz);<NEW_LINE>if (Taskbar.isTaskbarSupported()) {<NEW_LINE>Taskbar taskbar = Taskbar.getTaskbar();<NEW_LINE>if (taskbar.isSupported(Feature.PROGRESS_VALUE_WINDOW)) {<NEW_LINE>taskbar.setWindowProgressValue(this, d.getProgress());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
getProgress() + "%]" + file);
|
436,132
|
public static QueryAppTasksResponse unmarshall(QueryAppTasksResponse queryAppTasksResponse, UnmarshallerContext _ctx) {<NEW_LINE>queryAppTasksResponse.setRequestId(_ctx.stringValue("QueryAppTasksResponse.RequestId"));<NEW_LINE>queryAppTasksResponse.setCode(_ctx.integerValue("QueryAppTasksResponse.Code"));<NEW_LINE>queryAppTasksResponse.setSuccess(_ctx.booleanValue("QueryAppTasksResponse.Success"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setCount(_ctx.integerValue("QueryAppTasksResponse.Data.Count"));<NEW_LINE>List<ListItem> list = new ArrayList<ListItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("QueryAppTasksResponse.Data.List.Length"); i++) {<NEW_LINE>ListItem listItem = new ListItem();<NEW_LINE>listItem.setStatus(_ctx.integerValue("QueryAppTasksResponse.Data.List[" + i + "].Status"));<NEW_LINE>listItem.setTimeSchema(_ctx.stringValue<MASK><NEW_LINE>listItem.setQuota(_ctx.longValue("QueryAppTasksResponse.Data.List[" + i + "].Quota"));<NEW_LINE>listItem.setContentIds(_ctx.stringValue("QueryAppTasksResponse.Data.List[" + i + "].ContentIds"));<NEW_LINE>listItem.setChargeCost(_ctx.longValue("QueryAppTasksResponse.Data.List[" + i + "].ChargeCost"));<NEW_LINE>listItem.setProxyUserId(_ctx.longValue("QueryAppTasksResponse.Data.List[" + i + "].ProxyUserId"));<NEW_LINE>listItem.setOpenScene(_ctx.integerValue("QueryAppTasksResponse.Data.List[" + i + "].OpenScene"));<NEW_LINE>listItem.setPriority(_ctx.integerValue("QueryAppTasksResponse.Data.List[" + i + "].Priority"));<NEW_LINE>listItem.setAccountNo(_ctx.stringValue("QueryAppTasksResponse.Data.List[" + i + "].AccountNo"));<NEW_LINE>listItem.setAllContentStatus(_ctx.integerValue("QueryAppTasksResponse.Data.List[" + i + "].AllContentStatus"));<NEW_LINE>listItem.setQuotaDay(_ctx.longValue("QueryAppTasksResponse.Data.List[" + i + "].QuotaDay"));<NEW_LINE>listItem.setEndTime(_ctx.stringValue("QueryAppTasksResponse.Data.List[" + i + "].EndTime"));<NEW_LINE>listItem.setStartTime(_ctx.stringValue("QueryAppTasksResponse.Data.List[" + i + "].StartTime"));<NEW_LINE>listItem.setBrandUserId(_ctx.longValue("QueryAppTasksResponse.Data.List[" + i + "].BrandUserId"));<NEW_LINE>listItem.setPriceType(_ctx.stringValue("QueryAppTasksResponse.Data.List[" + i + "].PriceType"));<NEW_LINE>listItem.setName(_ctx.stringValue("QueryAppTasksResponse.Data.List[" + i + "].Name"));<NEW_LINE>listItem.setBalanceDay(_ctx.longValue("QueryAppTasksResponse.Data.List[" + i + "].BalanceDay"));<NEW_LINE>listItem.setPopularizePosition(_ctx.integerValue("QueryAppTasksResponse.Data.List[" + i + "].PopularizePosition"));<NEW_LINE>listItem.setId(_ctx.longValue("QueryAppTasksResponse.Data.List[" + i + "].Id"));<NEW_LINE>listItem.setBalance(_ctx.longValue("QueryAppTasksResponse.Data.List[" + i + "].Balance"));<NEW_LINE>list.add(listItem);<NEW_LINE>}<NEW_LINE>data.setList(list);<NEW_LINE>queryAppTasksResponse.setData(data);<NEW_LINE>return queryAppTasksResponse;<NEW_LINE>}
|
("QueryAppTasksResponse.Data.List[" + i + "].TimeSchema"));
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.