idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
679,966
public boolean isAllowable(URL url, Invocation invocation) {<NEW_LINE>int rate = url.getMethodParameter(invocation.getMethodName(), TPS_LIMIT_RATE_KEY, -1);<NEW_LINE>long interval = url.getMethodParameter(invocation.getMethodName(), TPS_LIMIT_INTERVAL_KEY, DEFAULT_TPS_LIMIT_INTERVAL);<NEW_LINE>String serviceKey = url.getServiceKey();<NEW_LINE>if (rate > 0) {<NEW_LINE>StatItem statItem = stats.get(serviceKey);<NEW_LINE>if (statItem == null) {<NEW_LINE>stats.putIfAbsent(serviceKey, new StatItem(serviceKey, rate, interval));<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>// rate or interval has changed, rebuild<NEW_LINE>if (statItem.getRate() != rate || statItem.getInterval() != interval) {<NEW_LINE>stats.put(serviceKey, new StatItem(serviceKey, rate, interval));<NEW_LINE>statItem = stats.get(serviceKey);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return statItem.isAllowable();<NEW_LINE>} else {<NEW_LINE>StatItem statItem = stats.get(serviceKey);<NEW_LINE>if (statItem != null) {<NEW_LINE>stats.remove(serviceKey);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
statItem = stats.get(serviceKey);
1,081,150
private ALight buildLight(Model l) {<NEW_LINE>int m = l.properties.lightType != null ? l.properties.lightType : ALight.POINT_LIGHT;<NEW_LINE>switch(m) {<NEW_LINE>case // Point<NEW_LINE>ALight.POINT_LIGHT:<NEW_LINE>PointLight light = new PointLight();<NEW_LINE>light.setPosition(l.properties.lclTranslation);<NEW_LINE>light.setX(light.getX() * -1f);<NEW_LINE>light.setRotation(l.properties.lclRotation);<NEW_LINE>light.setPower(l.properties.intensity / 100f);<NEW_LINE>light.setColor(l.properties.color);<NEW_LINE>// TODO add to scene<NEW_LINE>// mRootObject.addLight(light);<NEW_LINE>return light;<NEW_LINE>case // Area<NEW_LINE>ALight.DIRECTIONAL_LIGHT:<NEW_LINE>// TODO calculate direction based on position and rotation<NEW_LINE>DirectionalLight lD = new DirectionalLight();<NEW_LINE>lD.setPosition(l.properties.lclTranslation);<NEW_LINE>lD.setX(lD.getX() * -1f);<NEW_LINE>lD.setRotation(l.properties.lclRotation);<NEW_LINE>lD.setPower(l.properties.intensity / 100f);<NEW_LINE>lD.setColor(l.properties.color);<NEW_LINE>// TODO add to scene<NEW_LINE>// mRootObject.addLight(lD);<NEW_LINE>return lD;<NEW_LINE>default:<NEW_LINE>case // Spot<NEW_LINE>ALight.SPOT_LIGHT:<NEW_LINE>// TODO calculate direction based on position and rotation<NEW_LINE>SpotLight lS = new SpotLight();<NEW_LINE>lS.<MASK><NEW_LINE>lS.setX(lS.getX() * -1f);<NEW_LINE>lS.setRotation(l.properties.lclRotation);<NEW_LINE>lS.setPower(l.properties.intensity / 100f);<NEW_LINE>lS.setCutoffAngle(l.properties.coneangle);<NEW_LINE>lS.setColor(l.properties.color);<NEW_LINE>lS.setLookAt(0, 0, 0);<NEW_LINE>// TODO add to scene<NEW_LINE>// mRootObject.addLight(lS);<NEW_LINE>return lS;<NEW_LINE>}<NEW_LINE>}
setPosition(l.properties.lclTranslation);
1,070,690
private void handler(final ServiceBean<?> serviceBean) {<NEW_LINE>Object refProxy = serviceBean.getRef();<NEW_LINE>Class<?> clazz = refProxy.getClass();<NEW_LINE>if (AopUtils.isAopProxy(refProxy)) {<NEW_LINE>clazz = AopUtils.getTargetClass(refProxy);<NEW_LINE>}<NEW_LINE>final ShenyuDubboClient beanShenyuClient = AnnotatedElementUtils.findMergedAnnotation(clazz, ShenyuDubboClient.class);<NEW_LINE>final String superPath = buildApiSuperPath(clazz, beanShenyuClient);<NEW_LINE>if (superPath.contains("*") && Objects.nonNull(beanShenyuClient)) {<NEW_LINE>Method[] <MASK><NEW_LINE>for (Method method : methods) {<NEW_LINE>publisher.publishEvent(buildMetaDataDTO(serviceBean, beanShenyuClient, method, superPath));<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Method[] methods = ReflectionUtils.getUniqueDeclaredMethods(clazz);<NEW_LINE>for (Method method : methods) {<NEW_LINE>ShenyuDubboClient methodShenyuClient = AnnotatedElementUtils.findMergedAnnotation(method, ShenyuDubboClient.class);<NEW_LINE>if (Objects.nonNull(methodShenyuClient)) {<NEW_LINE>publisher.publishEvent(buildMetaDataDTO(serviceBean, methodShenyuClient, method, superPath));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
methods = ReflectionUtils.getDeclaredMethods(clazz);
1,195,909
private RelationPlan planStatementWithoutOutput(Analysis analysis, Statement statement) {<NEW_LINE>if (statement instanceof CreateTableAsSelect) {<NEW_LINE>if (analysis.getCreate().orElseThrow().isCreateTableAsSelectNoOp()) {<NEW_LINE>throw new TrinoException(NOT_SUPPORTED, "CREATE TABLE IF NOT EXISTS is not supported in this context " + statement.getClass().getSimpleName());<NEW_LINE>}<NEW_LINE>return createTableCreationPlan(analysis, ((CreateTableAsSelect) statement).getQuery());<NEW_LINE>}<NEW_LINE>if (statement instanceof Analyze) {<NEW_LINE>return createAnalyzePlan(analysis, (Analyze) statement);<NEW_LINE>}<NEW_LINE>if (statement instanceof Insert) {<NEW_LINE>checkState(analysis.getInsert().isPresent(), "Insert handle is missing");<NEW_LINE>return createInsertPlan<MASK><NEW_LINE>}<NEW_LINE>if (statement instanceof RefreshMaterializedView) {<NEW_LINE>return createRefreshMaterializedViewPlan(analysis);<NEW_LINE>}<NEW_LINE>if (statement instanceof Delete) {<NEW_LINE>return createDeletePlan(analysis, (Delete) statement);<NEW_LINE>}<NEW_LINE>if (statement instanceof Update) {<NEW_LINE>return createUpdatePlan(analysis, (Update) statement);<NEW_LINE>}<NEW_LINE>if (statement instanceof Query) {<NEW_LINE>return createRelationPlan(analysis, (Query) statement);<NEW_LINE>}<NEW_LINE>if (statement instanceof ExplainAnalyze) {<NEW_LINE>return createExplainAnalyzePlan(analysis, (ExplainAnalyze) statement);<NEW_LINE>}<NEW_LINE>if (statement instanceof TableExecute) {<NEW_LINE>return createTableExecutePlan(analysis, (TableExecute) statement);<NEW_LINE>}<NEW_LINE>throw new TrinoException(NOT_SUPPORTED, "Unsupported statement type " + statement.getClass().getSimpleName());<NEW_LINE>}
(analysis, (Insert) statement);
1,293,815
private void addBindings() {<NEW_LINE>if (dataModel.getDirection() == OfferDirection.BUY) {<NEW_LINE>volumeDescriptionLabel.bind(createStringBinding(() -> Res.get("createOffer.amountPriceBox.buy.volumeDescription", dataModel.getTradeCurrencyCode().get()), dataModel.getTradeCurrencyCode()));<NEW_LINE>} else {<NEW_LINE>volumeDescriptionLabel.bind(createStringBinding(() -> Res.get("createOffer.amountPriceBox.sell.volumeDescription", dataModel.getTradeCurrencyCode().get())<MASK><NEW_LINE>}<NEW_LINE>volumePromptLabel.bind(createStringBinding(() -> Res.get("createOffer.volume.prompt", dataModel.getTradeCurrencyCode().get()), dataModel.getTradeCurrencyCode()));<NEW_LINE>totalToPay.bind(createStringBinding(() -> btcFormatter.formatCoinWithCode(dataModel.totalToPayAsCoinProperty().get()), dataModel.totalToPayAsCoinProperty()));<NEW_LINE>tradeAmount.bind(createStringBinding(() -> btcFormatter.formatCoinWithCode(dataModel.getAmount().get()), dataModel.getAmount()));<NEW_LINE>tradeCurrencyCode.bind(dataModel.getTradeCurrencyCode());<NEW_LINE>triggerPriceDescription.bind(createStringBinding(this::getTriggerPriceDescriptionLabel, dataModel.getTradeCurrencyCode()));<NEW_LINE>percentagePriceDescription.bind(createStringBinding(this::getPercentagePriceDescription, dataModel.getTradeCurrencyCode()));<NEW_LINE>}
, dataModel.getTradeCurrencyCode()));
1,338,029
final GetComponentVersionArtifactResult executeGetComponentVersionArtifact(GetComponentVersionArtifactRequest getComponentVersionArtifactRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getComponentVersionArtifactRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetComponentVersionArtifactRequest> request = null;<NEW_LINE>Response<GetComponentVersionArtifactResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetComponentVersionArtifactRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getComponentVersionArtifactRequest));<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, "GreengrassV2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetComponentVersionArtifact");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetComponentVersionArtifactResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetComponentVersionArtifactResultJsonUnmarshaller());<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);
180,160
private static long addUnsignedReturnOverflow(Slice left, Slice right, Slice result, boolean resultNegative) {<NEW_LINE>// TODO: consider two 7 bytes operations<NEW_LINE>int l0 = getInt(left, 0);<NEW_LINE>int l1 = getInt(left, 1);<NEW_LINE>int l2 = getInt(left, 2);<NEW_LINE>int l3 = getInt(left, 3);<NEW_LINE>int r0 = getInt(right, 0);<NEW_LINE>int r1 = getInt(right, 1);<NEW_LINE>int r2 = getInt(right, 2);<NEW_LINE>int r3 = getInt(right, 3);<NEW_LINE>long intermediateResult;<NEW_LINE>intermediateResult = (l0 & LONG_MASK) + (r0 & LONG_MASK);<NEW_LINE>int z0 = (int) intermediateResult;<NEW_LINE>intermediateResult = (l1 & LONG_MASK) + (r1 & LONG_MASK) + (intermediateResult >>> 32);<NEW_LINE>int z1 = (int) intermediateResult;<NEW_LINE>intermediateResult = (l2 & LONG_MASK) + (r2 & LONG_MASK) <MASK><NEW_LINE>int z2 = (int) intermediateResult;<NEW_LINE>intermediateResult = (l3 & LONG_MASK) + (r3 & LONG_MASK) + (intermediateResult >>> 32);<NEW_LINE>int z3 = (int) intermediateResult & (~SIGN_INT_MASK);<NEW_LINE>pack(result, z0, z1, z2, z3, resultNegative);<NEW_LINE>return intermediateResult >> 31;<NEW_LINE>}
+ (intermediateResult >>> 32);
1,024,185
private void onStartCommand(String commandDisplayName) {<NEW_LINE>lock.lock();<NEW_LINE>try {<NEW_LINE>switch(state) {<NEW_LINE>case Broken:<NEW_LINE>throw new DaemonUnavailableException("This daemon is in a broken state and will stop.");<NEW_LINE>case StopRequested:<NEW_LINE>throw new DaemonUnavailableException("This daemon is currently stopping.");<NEW_LINE>case Stopped:<NEW_LINE>throw new DaemonUnavailableException("This daemon has stopped.");<NEW_LINE>case Busy:<NEW_LINE>case Canceled:<NEW_LINE>throw new DaemonUnavailableException(String<MASK><NEW_LINE>}<NEW_LINE>LOGGER.debug("Command execution: started {} after {} minutes of idle", commandDisplayName, getIdleMinutes());<NEW_LINE>try {<NEW_LINE>setState(State.Busy);<NEW_LINE>onStartCommand.run();<NEW_LINE>currentCommandExecution = commandDisplayName;<NEW_LINE>result = null;<NEW_LINE>updateActivityTimestamp();<NEW_LINE>updateCancellationToken();<NEW_LINE>condition.signalAll();<NEW_LINE>} catch (Throwable throwable) {<NEW_LINE>setState(State.Broken);<NEW_LINE>throw UncheckedException.throwAsUncheckedException(throwable);<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>lock.unlock();<NEW_LINE>}<NEW_LINE>}
.format("This daemon is currently executing: %s", currentCommandExecution));
1,473,794
public StaticObject toGuestComponent(Meta meta, ObjectKlass klass) {<NEW_LINE>assert meta.getJavaVersion().java16OrLater();<NEW_LINE><MASK><NEW_LINE>StaticObject component = meta.java_lang_reflect_RecordComponent.allocateInstance();<NEW_LINE>Symbol<Name> nameSymbol = pool.symbolAt(name);<NEW_LINE>Symbol<Type> typeSymbol = pool.symbolAt(descriptor);<NEW_LINE>Symbol<Signature> signature = meta.getSignatures().makeRaw(typeSymbol);<NEW_LINE>meta.java_lang_reflect_RecordComponent_clazz.setObject(component, klass.mirror());<NEW_LINE>meta.java_lang_reflect_RecordComponent_name.setObject(component, meta.toGuestString(nameSymbol));<NEW_LINE>meta.java_lang_reflect_RecordComponent_type.setObject(component, meta.resolveSymbolAndAccessCheck(typeSymbol, klass).mirror());<NEW_LINE>// Find and set accessor<NEW_LINE>Method m = klass.lookupMethod(nameSymbol, signature);<NEW_LINE>boolean validMethod = m != null && !m.isStatic() && !m.isConstructor();<NEW_LINE>meta.java_lang_reflect_RecordComponent_accessor.setObject(component, validMethod ? m.makeMirror() : StaticObject.NULL);<NEW_LINE>// Find and set generic signature<NEW_LINE>SignatureAttribute genericSignatureAttribute = (SignatureAttribute) getAttribute(SignatureAttribute.NAME);<NEW_LINE>meta.java_lang_reflect_RecordComponent_signature.setObject(component, genericSignatureAttribute != null ? meta.toGuestString(pool.symbolAt(genericSignatureAttribute.getSignatureIndex())) : StaticObject.NULL);<NEW_LINE>// Find and set annotations<NEW_LINE>doAnnotation(component, Name.RuntimeVisibleAnnotations, meta.java_lang_reflect_RecordComponent_annotations, meta);<NEW_LINE>doAnnotation(component, Name.RuntimeVisibleTypeAnnotations, meta.java_lang_reflect_RecordComponent_typeAnnotations, meta);<NEW_LINE>return component;<NEW_LINE>}
RuntimeConstantPool pool = klass.getConstantPool();
1,336,378
public Object execute(CommandContext commandContext) {<NEW_LINE>if (taskId == null) {<NEW_LINE>throw new FlowableIllegalArgumentException("Task id should not be null");<NEW_LINE>}<NEW_LINE>ProcessEngineConfigurationImpl <MASK><NEW_LINE>TaskEntity task = processEngineConfiguration.getTaskServiceConfiguration().getTaskService().getTask(taskId);<NEW_LINE>if (task == null) {<NEW_LINE>throw new FlowableObjectNotFoundException("Task '" + taskId + "' not found", Task.class);<NEW_LINE>}<NEW_LINE>FormHandlerHelper formHandlerHelper = processEngineConfiguration.getFormHandlerHelper();<NEW_LINE>TaskFormHandler taskFormHandler = formHandlerHelper.getTaskFormHandlder(task);<NEW_LINE>if (taskFormHandler != null) {<NEW_LINE>FormEngine formEngine = processEngineConfiguration.getFormEngines().get(formEngineName);<NEW_LINE>if (formEngine == null) {<NEW_LINE>throw new FlowableException("No formEngine '" + formEngineName + "' defined process engine configuration");<NEW_LINE>}<NEW_LINE>TaskFormData taskForm = taskFormHandler.createTaskForm(task);<NEW_LINE>return formEngine.renderTaskForm(taskForm);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
processEngineConfiguration = CommandContextUtil.getProcessEngineConfiguration(commandContext);
471,489
public TabularData canInvoke(Map<String, List<String>> bulkQuery) throws Exception {<NEW_LINE><MASK><NEW_LINE>for (Map.Entry<String, List<String>> entry : bulkQuery.entrySet()) {<NEW_LINE>String objectName = entry.getKey();<NEW_LINE>List<String> methods = entry.getValue();<NEW_LINE>if (methods.size() == 0) {<NEW_LINE>boolean res = canInvoke(objectName);<NEW_LINE>CompositeData data = new CompositeDataSupport(CAN_INVOKE_RESULT_ROW_TYPE, CAN_INVOKE_RESULT_COLUMNS, new Object[] { objectName, "", true });<NEW_LINE>table.put(data);<NEW_LINE>} else {<NEW_LINE>for (String method : methods) {<NEW_LINE>CompositeData data = new CompositeDataSupport(CAN_INVOKE_RESULT_ROW_TYPE, CAN_INVOKE_RESULT_COLUMNS, new Object[] { objectName, method, true });<NEW_LINE>table.put(data);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return table;<NEW_LINE>}
TabularData table = new TabularDataSupport(CAN_INVOKE_TABULAR_TYPE);
193,086
public Object read(SourceRecord record) {<NEW_LINE>Object obj = converter.read(record);<NEW_LINE>if (obj == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Struct value = (Struct) record.value();<NEW_LINE>Schema valueSchema = record.valueSchema();<NEW_LINE>Schema beforeSchema = valueSchema.field(Envelope.FieldName.BEFORE).schema();<NEW_LINE>Struct before = value.getStruct(Envelope.FieldName.BEFORE);<NEW_LINE>Map<StringData, StringData> oldData = new HashMap<>();<NEW_LINE>for (int i = 0; i < this.fieldNames.length; i++) {<NEW_LINE>final String fieldName = this.fieldNames[i];<NEW_LINE>final StringConverter stringConverter = this.stringConverters[i];<NEW_LINE>final Field <MASK><NEW_LINE>if (field == null) {<NEW_LINE>oldData.put(StringData.fromString(fieldName), null);<NEW_LINE>} else {<NEW_LINE>final Object fieldValue = before.get(field);<NEW_LINE>final Schema fieldSchema = field.schema();<NEW_LINE>StringData strFieldValue = null;<NEW_LINE>try {<NEW_LINE>final String str = stringConverter.convert(fieldValue, fieldSchema);<NEW_LINE>strFieldValue = StringData.fromString(str);<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.error("Failed to convert value " + fieldValue + " (" + fieldSchema.name() + ") to string.");<NEW_LINE>}<NEW_LINE>oldData.put(StringData.fromString(fieldName), strFieldValue);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new GenericArrayData(new Object[] { new GenericMapData(oldData) });<NEW_LINE>}
field = beforeSchema.field(fieldName);
787,886
final QueryLineageResult executeQueryLineage(QueryLineageRequest queryLineageRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(queryLineageRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<QueryLineageRequest> request = null;<NEW_LINE>Response<QueryLineageResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new QueryLineageRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(queryLineageRequest));<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, "SageMaker");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "QueryLineage");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<QueryLineageResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new QueryLineageResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
1,123,351
public void process(Operator operator, List<COSBase> arguments) throws IOException {<NEW_LINE>if (arguments.isEmpty()) {<NEW_LINE>throw new MissingOperandException(operator, arguments);<NEW_LINE>}<NEW_LINE>COSBase <MASK><NEW_LINE>if (!(base0 instanceof COSName)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>COSName name = (COSName) base0;<NEW_LINE>PDXObject xobject = context.getResources().getXObject(name);<NEW_LINE>((PDFMarkedContentExtractor) context).xobject(xobject);<NEW_LINE>if (xobject instanceof PDFormXObject) {<NEW_LINE>try {<NEW_LINE>context.increaseLevel();<NEW_LINE>if (context.getLevel() > 25) {<NEW_LINE>Log.e("PdfBox-Android", "recursion is too deep, skipping form XObject");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>PDFormXObject form = (PDFormXObject) xobject;<NEW_LINE>if (form instanceof PDTransparencyGroup) {<NEW_LINE>context.showTransparencyGroup((PDTransparencyGroup) form);<NEW_LINE>} else {<NEW_LINE>context.showForm(form);<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>context.decreaseLevel();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
base0 = arguments.get(0);
776,913
public void checkMessages(XMLFile messagesDoc) throws DocumentException {<NEW_LINE>// Detector elements must all have a class attribute<NEW_LINE>// and details child element.<NEW_LINE>for (Iterator<Node> i = messagesDoc.xpathIterator("/MessageCollection/Detector"); i.hasNext(); ) {<NEW_LINE>Node node = i.next();<NEW_LINE>messagesDoc.checkAttribute(node, "class");<NEW_LINE>messagesDoc.checkElement(node, "Details");<NEW_LINE>}<NEW_LINE>// BugPattern elements must all have type attribute<NEW_LINE>// and ShortDescription, LongDescription, and Details<NEW_LINE>// child elements.<NEW_LINE>for (Iterator<Node> i = messagesDoc.xpathIterator("/MessageCollection/BugPattern"); i.hasNext(); ) {<NEW_LINE>Node node = i.next();<NEW_LINE>messagesDoc.checkAttribute(node, "type");<NEW_LINE>messagesDoc.checkElement(node, "ShortDescription");<NEW_LINE>messagesDoc.checkElement(node, "LongDescription");<NEW_LINE>messagesDoc.checkElement(node, "Details");<NEW_LINE>}<NEW_LINE>// BugCode elements must contain abbrev attribute<NEW_LINE>// and have non-empty text<NEW_LINE>for (Iterator<Node> i = messagesDoc.xpathIterator("/MessageCollection/BugCode"); i.hasNext(); ) {<NEW_LINE>Node node = i.next();<NEW_LINE>messagesDoc.checkAttribute(node, "abbrev");<NEW_LINE>messagesDoc.checkNonEmptyText(node);<NEW_LINE>}<NEW_LINE>// Check that all Detectors are described<NEW_LINE>Set<String> describedDetectorsSet = messagesDoc.collectAttributes("/MessageCollection/Detector", "class");<NEW_LINE>checkDescribed("Bug detectors not described by Detector elements", messagesDoc, declaredDetectorsSet, describedDetectorsSet);<NEW_LINE>// Check that all BugCodes are described<NEW_LINE>Set<String> describedAbbrevsSet = messagesDoc.collectAttributes("/MessageCollection/BugCode", "abbrev");<NEW_LINE>checkDescribed(<MASK><NEW_LINE>}
"Abbreviations not described by BugCode elements", messagesDoc, declaredAbbrevsSet, describedAbbrevsSet);
34,232
public Dialog onCreateDialog(Bundle savedInstanceState) {<NEW_LINE>LayoutInflater inflater = LayoutInflater.from(getContext());<NEW_LINE>View contentView = inflater.inflate(R.layout.procedure_definition_mutator_dialog, null, false);<NEW_LINE>String headerFormat = getString(R.string.mutator_procedure_def_header_format);<NEW_LINE>String headerText = String.format(headerFormat, mProcedureName);<NEW_LINE>TextView header = (TextView) contentView.<MASK><NEW_LINE>header.setText(headerText);<NEW_LINE>mRecycler = (RecyclerView) contentView.findViewById(R.id.mutator_procedure_def_recycler);<NEW_LINE>mRecycler.setLayoutManager(new LinearLayoutManager(getContext()));<NEW_LINE>mAdapter = new Adapter();<NEW_LINE>mRecycler.setAdapter(mAdapter);<NEW_LINE>AlertDialog dialog = new AlertDialog.Builder(getActivity()).setTitle(R.string.mutator_procedure_def_title).setPositiveButton(R.string.mutator_done, new DialogInterface.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(DialogInterface dialog, int which) {<NEW_LINE>finishMutation();<NEW_LINE>}<NEW_LINE>}).setView(contentView).create();<NEW_LINE>return dialog;<NEW_LINE>}
findViewById(R.id.mutator_procedure_def_header);
1,094,855
public ASTNode visitTableFactor(final TableFactorContext ctx) {<NEW_LINE>if (null != ctx.subquery()) {<NEW_LINE>SQLServerSelectStatement subquery = (SQLServerSelectStatement) visit(ctx.subquery());<NEW_LINE>SubquerySegment subquerySegment = new SubquerySegment(ctx.subquery().start.getStartIndex(), ctx.subquery().<MASK><NEW_LINE>SubqueryTableSegment result = new SubqueryTableSegment(subquerySegment);<NEW_LINE>if (null != ctx.alias()) {<NEW_LINE>result.setAlias((AliasSegment) visit(ctx.alias()));<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>if (null != ctx.tableName()) {<NEW_LINE>SimpleTableSegment result = (SimpleTableSegment) visit(ctx.tableName());<NEW_LINE>if (null != ctx.alias()) {<NEW_LINE>result.setAlias((AliasSegment) visit(ctx.alias()));<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>return visit(ctx.tableReferences());<NEW_LINE>}
stop.getStopIndex(), subquery);
119,802
public void aggregate(long address, long addressSize, int columnSizeHint, int workerId) {<NEW_LINE>if (address != 0) {<NEW_LINE>// Neumaier compensated summation<NEW_LINE>final double x = Vect.sumDoubleNeumaier(address, addressSize / Double.BYTES);<NEW_LINE>if (x == x) {<NEW_LINE>final int offset = workerId * Misc.CACHE_LINE_SIZE;<NEW_LINE>final double <MASK><NEW_LINE>final double t = sum + x;<NEW_LINE>double c = this.sum[offset + 1];<NEW_LINE>if (Math.abs(sum) >= x) {<NEW_LINE>c += (sum - t) + x;<NEW_LINE>} else {<NEW_LINE>c += (x - t) + sum;<NEW_LINE>}<NEW_LINE>// sum = t<NEW_LINE>this.sum[offset] = t;<NEW_LINE>this.sum[offset + 1] = c;<NEW_LINE>this.count[offset]++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
sum = this.sum[offset];
189,783
private void restartProxies() {<NEW_LINE>List<ProxiesParamProxy> proxyParams = this.getParam().getProxies();<NEW_LINE>Map<String, ProxiesParamProxy> newProxies = new HashMap<>();<NEW_LINE>Map<String, org.parosproxy.paros.core.proxy.ProxyServer> currentProxies = proxyServers;<NEW_LINE>proxyServers = new HashMap<>();<NEW_LINE>for (ProxiesParamProxy proxyParam : proxyParams) {<NEW_LINE>if (proxyParam.isEnabled()) {<NEW_LINE>// Treat disabled proxies as if they dont really exist<NEW_LINE>String key = createProxyKey(proxyParam.getAddress(), proxyParam.getPort());<NEW_LINE>org.parosproxy.paros.core.proxy.ProxyServer proxy = currentProxies.remove(key);<NEW_LINE>if (proxy == null) {<NEW_LINE>// Its a new one<NEW_LINE>newProxies.put(key, proxyParam);<NEW_LINE>} else {<NEW_LINE>applyProxyOptions(proxyParam, proxy);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Any proxies left have been removed<NEW_LINE>for (Entry<String, org.parosproxy.paros.core.proxy.ProxyServer> entry : currentProxies.entrySet()) {<NEW_LINE>stopProxyServer(entry.getKey(), entry.getValue());<NEW_LINE>}<NEW_LINE>for (Entry<String, ProxiesParamProxy> entry : newProxies.entrySet()) {<NEW_LINE>org.parosproxy.paros.core.proxy.ProxyServer proxy = startProxyServer(entry.getValue());<NEW_LINE>proxyServers.put(entry.getKey(), proxy);<NEW_LINE>}<NEW_LINE>}
proxyServers.put(key, proxy);
1,164,771
public int compare(Object o1, Object o2) {<NEW_LINE>if (o1 instanceof JPDADVThreadGroup) {<NEW_LINE>if (o2 instanceof JPDADVThreadGroup) {<NEW_LINE>String tgn1 = ((JPDADVThreadGroup) o1).getName();<NEW_LINE>String tgn2 = ((JPDADVThreadGroup) o2).getName();<NEW_LINE>return java.text.Collator.getInstance().compare(tgn1, tgn2);<NEW_LINE>}<NEW_LINE>return 1;<NEW_LINE>} else if (o2 instanceof JPDADVThreadGroup) {<NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>if (!(o1 instanceof JPDADVThread) && !(o2 instanceof JPDADVThread)) {<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>String n1 = ((JPDADVThread) o1).getName();<NEW_LINE>String n2 = ((<MASK><NEW_LINE>return java.text.Collator.getInstance().compare(n1, n2);<NEW_LINE>}
JPDADVThread) o2).getName();
757,553
private Attributes extract(Attributes emf, int frame, String cuid, boolean enhanced) {<NEW_LINE>Attributes dest = new Attributes(emf.size() * 2);<NEW_LINE>dest.addNotSelected(emf, EXCLUDE_TAGS);<NEW_LINE>if (enhanced) {<NEW_LINE>Attributes sfgs = emf.getNestedDataset(Tag.SharedFunctionalGroupsSequence);<NEW_LINE>if (sfgs == null)<NEW_LINE>throw new IllegalArgumentException("Missing (5200,9229) Shared Functional Groups Sequence");<NEW_LINE>Attributes fgs = emf.getNestedDataset(Tag.PerFrameFunctionalGroupsSequence, frame);<NEW_LINE>if (fgs == null)<NEW_LINE>throw new IllegalArgumentException("Missing (5200,9230) Per-frame Functional Groups Sequence Item for frame #" + (frame + 1));<NEW_LINE>addFunctionGroups(dest, sfgs);<NEW_LINE>addFunctionGroups(dest, fgs);<NEW_LINE>dest.setString(Tag.ImageType, VR.CS, dest.getStrings(Tag.FrameType));<NEW_LINE>dest.remove(Tag.FrameType);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>dest.setString(Tag.SOPClassUID, VR.UI, cuid);<NEW_LINE>dest.setString(Tag.SOPInstanceUID, VR.UI, uidMapper.get(dest.getString(Tag.SOPInstanceUID)) + '.' + (frame + 1));<NEW_LINE>dest.setString(Tag.InstanceNumber, VR.IS, createInstanceNumber(dest.getString(Tag.InstanceNumber, ""), frame));<NEW_LINE>if (!preserveSeriesInstanceUID)<NEW_LINE>dest.setString(Tag.SeriesInstanceUID, VR.UI, uidMapper.get(dest.getString(Tag.SeriesInstanceUID)));<NEW_LINE>adjustReferencedImages(dest, Tag.ReferencedImageSequence);<NEW_LINE>adjustReferencedImages(dest, Tag.SourceImageSequence);<NEW_LINE>return dest;<NEW_LINE>}
addPixelData(dest, emf, frame);
1,316,040
private void addTableToUpdate(String tableName) {<NEW_LINE>StringBuffer keyColumnNames = new StringBuffer();<NEW_LINE>String uuidKey = I_AD_Table.COLUMNNAME_UUID;<NEW_LINE>String uuidWhereClause = uuidKey + " IS NOT NULL";<NEW_LINE>if (isOnlyUUIDMissing()) {<NEW_LINE>uuidKey = "getUUID()";<NEW_LINE>uuidWhereClause = I_AD_Table.COLUMNNAME_UUID + " IS NULL";<NEW_LINE>}<NEW_LINE>MTable table = MTable.get(getCtx(), tableName);<NEW_LINE>// Validate multiple key<NEW_LINE>String[<MASK><NEW_LINE>if (keyColumn != null) {<NEW_LINE>Arrays.asList(keyColumn).forEach(columnName -> {<NEW_LINE>if (keyColumnNames.length() > 0) {<NEW_LINE>keyColumnNames.append(" || ' AND ' || ");<NEW_LINE>}<NEW_LINE>keyColumnNames.append("'").append(columnName).append(" = ' || ").append(columnName);<NEW_LINE>});<NEW_LINE>}<NEW_LINE>// Only for key columns<NEW_LINE>if (keyColumnNames.length() > 0) {<NEW_LINE>List<Object> parameters = new ArrayList<>();<NEW_LINE>parameters.add(getAD_Client_ID());<NEW_LINE>// Get<NEW_LINE>ValueNamePair[] uuidValuesPair = DB.getValueNamePairs("SELECT " + keyColumnNames + ", " + uuidKey + " FROM " + tableName + " WHERE AD_Client_ID = ? AND " + uuidWhereClause + entityTypeWhereClause, false, parameters);<NEW_LINE>// Get all UUID<NEW_LINE>for (ValueNamePair value : uuidValuesPair) {<NEW_LINE>updateList.add("UPDATE " + tableName + " SET " + I_AD_Table.COLUMNNAME_UUID + " = '" + value.getName() + "' WHERE " + value.getValue() + ";");<NEW_LINE>rollbackList.add("UPDATE " + tableName + " SET " + I_AD_Table.COLUMNNAME_UUID + " = NULL WHERE " + value.getValue() + ";");<NEW_LINE>}<NEW_LINE>// Add<NEW_LINE>addMigration();<NEW_LINE>}<NEW_LINE>}
] keyColumn = table.getKeyColumns();
1,349,957
public AvroHttpRequest build() {<NEW_LINE>try {<NEW_LINE>AvroHttpRequest record = new AvroHttpRequest();<NEW_LINE>record.requestTime = fieldSetFlags()[0] ? this.requestTime : (java.lang.Long) defaultValue(fields()[0]);<NEW_LINE>if (clientIdentifierBuilder != null) {<NEW_LINE>record.clientIdentifier = this.clientIdentifierBuilder.build();<NEW_LINE>} else {<NEW_LINE>record.clientIdentifier = fieldSetFlags()[1] ? this.clientIdentifier : (ClientIdentifier) defaultValue(fields()[1]);<NEW_LINE>}<NEW_LINE>record.employeeNames = fieldSetFlags()[2] ? this.employeeNames : (java.util.List<java.lang.CharSequence>) defaultValue<MASK><NEW_LINE>record.active = fieldSetFlags()[3] ? this.active : (Active) defaultValue(fields()[3]);<NEW_LINE>return record;<NEW_LINE>} catch (java.lang.Exception e) {<NEW_LINE>throw new org.apache.avro.AvroRuntimeException(e);<NEW_LINE>}<NEW_LINE>}
(fields()[2]);
1,781,489
private void updateVolumeAfterMigration(Answer answer, DataObject srcData, DataObject destData) {<NEW_LINE>VolumeVO destinationVO = volDao.findById(destData.getId());<NEW_LINE>if (!(answer instanceof MigrateVolumeAnswer)) {<NEW_LINE>// OfflineVmwareMigration: reset states and such<NEW_LINE>VolumeVO sourceVO = volDao.findById(srcData.getId());<NEW_LINE>sourceVO.setState(Volume.State.Ready);<NEW_LINE>volDao.update(<MASK><NEW_LINE>if (destinationVO.getId() != sourceVO.getId()) {<NEW_LINE>destinationVO.setState(Volume.State.Expunged);<NEW_LINE>destinationVO.setRemoved(new Date());<NEW_LINE>volDao.update(destinationVO.getId(), destinationVO);<NEW_LINE>}<NEW_LINE>throw new CloudRuntimeException("unexpected answer from hypervisor agent: " + answer.getDetails());<NEW_LINE>}<NEW_LINE>MigrateVolumeAnswer ans = (MigrateVolumeAnswer) answer;<NEW_LINE>if (s_logger.isDebugEnabled()) {<NEW_LINE>String format = "retrieved '%s' as new path for volume(%d)";<NEW_LINE>s_logger.debug(String.format(format, ans.getVolumePath(), destData.getId()));<NEW_LINE>}<NEW_LINE>// OfflineVmwareMigration: update the volume with new pool/volume path<NEW_LINE>destinationVO.setPoolId(destData.getDataStore().getId());<NEW_LINE>destinationVO.setPath(ans.getVolumePath());<NEW_LINE>volDao.update(destinationVO.getId(), destinationVO);<NEW_LINE>}
sourceVO.getId(), sourceVO);
1,812,001
public static JSONObject create(JSONObject ui) {<NEW_LINE>if (ui == null) {<NEW_LINE>ui = new JSONObject();<NEW_LINE>}<NEW_LINE>// Main Window Position & Size<NEW_LINE>ui.put("main-window-position", new JSONArray("[]"));<NEW_LINE>ui.put("gtp-console-position", new JSONArray("[]"));<NEW_LINE>ui.put("board-position-proportion", 4);<NEW_LINE>// Panes<NEW_LINE>ui.put("main-board-position", new JSONArray("[]"));<NEW_LINE>ui.put("sub-board-position", new JSONArray("[]"));<NEW_LINE>ui.put("basic-info-position", new JSONArray("[]"));<NEW_LINE>ui.put(<MASK><NEW_LINE>ui.put("variation-tree-position", new JSONArray("[]"));<NEW_LINE>ui.put("comment-position", new JSONArray("[]"));<NEW_LINE>ui.put("window-maximized", false);<NEW_LINE>ui.put("toolbar-position", "South");<NEW_LINE>return ui;<NEW_LINE>}
"winrate-position", new JSONArray("[]"));
1,498,687
private static String unionPreambleToString(final Memory mem, final Family family, final int preLongs) {<NEW_LINE>final ResizeFactor rf = ResizeFactor.getRF(extractResizeFactor(mem));<NEW_LINE>final int serVer = extractSerVer(mem);<NEW_LINE>// Flags<NEW_LINE>final int flags = extractFlags(mem);<NEW_LINE>final String flagsStr = zeroPad(Integer.toBinaryString(flags), 8) + ", " + (flags);<NEW_LINE>// final boolean bigEndian = (flags & BIG_ENDIAN_FLAG_MASK) > 0;<NEW_LINE>// final String nativeOrder = ByteOrder.nativeOrder().toString();<NEW_LINE>// final boolean readOnly = (flags & READ_ONLY_FLAG_MASK) > 0;<NEW_LINE>final boolean isEmpty = (flags & EMPTY_FLAG_MASK) > 0;<NEW_LINE>final int k;<NEW_LINE>if (serVer == 1) {<NEW_LINE>final short encK = extractEncodedReservoirSize(mem);<NEW_LINE>k = ReservoirSize.decodeValue(encK);<NEW_LINE>} else {<NEW_LINE>k = extractK(mem);<NEW_LINE>}<NEW_LINE>final long dataBytes = mem.getCapacity() - (preLongs << 3);<NEW_LINE>return // + " BIG_ENDIAN_STORAGE : " + bigEndian + LS<NEW_LINE>LS + "### END " + family.getFamilyName().toUpperCase() + " PREAMBLE SUMMARY" + LS + "Byte 0: Preamble Longs : " + preLongs + LS + "Byte 0: ResizeFactor : " + rf.toString() + LS + "Byte 1: Serialization Version : " + serVer + LS + "Byte 2: Family : " + family.toString() + LS + "Byte 3: Flags Field : " + flagsStr + LS + // + " (Native Byte Order) : " + nativeOrder + LS<NEW_LINE>// + " READ_ONLY : " + readOnly + LS<NEW_LINE>" EMPTY : " + isEmpty + LS + "Bytes 4-7: Max Sketch Size (maxK): " + k + LS + "TOTAL Sketch Bytes : " + mem.getCapacity() + LS + " Preamble Bytes : " + (preLongs << 3) + LS + " Sketch Bytes : " + dataBytes + LS + "### END " + family.getFamilyName()<MASK><NEW_LINE>}
.toUpperCase() + " PREAMBLE SUMMARY" + LS;
94,701
private void displayCancellingProgressMessages() {<NEW_LINE>if (usingNetBeansGUI) {<NEW_LINE>SwingUtilities.invokeLater(() -> {<NEW_LINE>if (dataSourceIngestProgressBar != null) {<NEW_LINE>dataSourceIngestProgressBar.setDisplayName(NbBundle.getMessage(getClass(), "IngestJob.progress.dataSourceIngest.initialDisplayName", ingestJob.getDataSource<MASK><NEW_LINE>dataSourceIngestProgressBar.progress(NbBundle.getMessage(getClass(), "IngestJob.progress.cancelling"));<NEW_LINE>}<NEW_LINE>if (fileIngestProgressBar != null) {<NEW_LINE>fileIngestProgressBar.setDisplayName(NbBundle.getMessage(getClass(), "IngestJob.progress.fileIngest.displayName", ingestJob.getDataSource().getName()));<NEW_LINE>fileIngestProgressBar.progress(NbBundle.getMessage(getClass(), "IngestJob.progress.cancelling"));<NEW_LINE>}<NEW_LINE>if (artifactIngestProgressBar != null) {<NEW_LINE>artifactIngestProgressBar.setDisplayName(NbBundle.getMessage(getClass(), "IngestJob.progress.dataArtifactIngest.displayName", ingestJob.getDataSource().getName()));<NEW_LINE>artifactIngestProgressBar.progress(NbBundle.getMessage(getClass(), "IngestJob.progress.cancelling"));<NEW_LINE>}<NEW_LINE>if (resultIngestProgressBar != null) {<NEW_LINE>resultIngestProgressBar.setDisplayName(Bundle.IngestJob_progress_analysisResultIngest_displayName(ingestJob.getDataSource().getName()));<NEW_LINE>resultIngestProgressBar.progress(NbBundle.getMessage(getClass(), "IngestJob.progress.cancelling"));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}
().getName()));
641,867
private static List<RingEntry> buildRing(Map<EquivalentAddressGroup, Long> serverWeights, long totalWeight, double scale) {<NEW_LINE>List<RingEntry> ring = new ArrayList<>();<NEW_LINE>double currentHashes = 0.0;<NEW_LINE>double targetHashes = 0.0;<NEW_LINE>for (Map.Entry<EquivalentAddressGroup, Long> entry : serverWeights.entrySet()) {<NEW_LINE>EquivalentAddressGroup addrKey = entry.getKey();<NEW_LINE>double normalizedWeight = (double) entry.getValue() / totalWeight;<NEW_LINE>// TODO(chengyuanzhang): is using the list of socket address correct?<NEW_LINE>StringBuilder sb = new StringBuilder(addrKey.getAddresses().toString());<NEW_LINE>sb.append('_');<NEW_LINE>targetHashes += scale * normalizedWeight;<NEW_LINE>long i = 0L;<NEW_LINE>while (currentHashes < targetHashes) {<NEW_LINE>sb.append(i);<NEW_LINE>long hash = hashFunc.hashAsciiString(sb.toString());<NEW_LINE>ring.add(new RingEntry(hash, addrKey));<NEW_LINE>i++;<NEW_LINE>currentHashes++;<NEW_LINE>sb.setLength(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>Collections.sort(ring);<NEW_LINE>return Collections.unmodifiableList(ring);<NEW_LINE>}
sb.length() - 1);
937,363
public OutlierResult autorun(Database database) {<NEW_LINE>Object <MASK><NEW_LINE>OutlierResult or = getOutlierResult(innerresult);<NEW_LINE>final DoubleRelation scores = or.getScores();<NEW_LINE>if (scaling instanceof OutlierScaling) {<NEW_LINE>((OutlierScaling) scaling).prepare(or);<NEW_LINE>}<NEW_LINE>WritableDoubleDataStore scaledscores = DataStoreUtil.makeDoubleStorage(scores.getDBIDs(), DataStoreFactory.HINT_HOT | DataStoreFactory.HINT_STATIC);<NEW_LINE>DoubleMinMax minmax = new DoubleMinMax();<NEW_LINE>for (DBIDIter iditer = scores.iterDBIDs(); iditer.valid(); iditer.advance()) {<NEW_LINE>double val = scaling.getScaled(scores.doubleValue(iditer));<NEW_LINE>scaledscores.putDouble(iditer, val);<NEW_LINE>minmax.put(val);<NEW_LINE>}<NEW_LINE>OutlierScoreMeta meta = new BasicOutlierScoreMeta(minmax.getMin(), minmax.getMax(), scaling.getMin(), scaling.getMax());<NEW_LINE>DoubleRelation scoresult = new MaterializedDoubleRelation("Scaled Outlier", scores.getDBIDs(), scaledscores);<NEW_LINE>OutlierResult result = new OutlierResult(meta, scoresult);<NEW_LINE>Metadata.hierarchyOf(result).addChild(innerresult);<NEW_LINE>return result;<NEW_LINE>}
innerresult = algorithm.autorun(database);
660,909
public static void main(String[] args) {<NEW_LINE>final Properties options = StringUtils.argsToProperties(args, argOptionDefs());<NEW_LINE>if (args.length < 1 || options.containsKey("help")) {<NEW_LINE>log.info(usage());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final Pattern posPattern = options.containsKey("searchPos") ? Pattern.compile(options.getProperty("searchPos")) : null;<NEW_LINE>final Pattern wordPattern = options.containsKey("searchWord") ? Pattern.compile(options.getProperty("searchWord")) : null;<NEW_LINE>final boolean plainPrint = PropertiesUtils.getBool(options, "plain", false);<NEW_LINE>final boolean ner = PropertiesUtils.getBool(options, "ner", false);<NEW_LINE>final boolean detailedAnnotations = PropertiesUtils.getBool(options, "detailedAnnotations", false);<NEW_LINE>final boolean expandElisions = PropertiesUtils.getBool(options, "expandElisions", false);<NEW_LINE>final boolean expandConmigo = PropertiesUtils.getBool(options, "expandConmigo", false);<NEW_LINE>String[] remainingArgs = options.getProperty("").split(" ");<NEW_LINE>List<File> fileList = new ArrayList<>();<NEW_LINE>for (String remainingArg : remainingArgs) fileList.add(new File(remainingArg));<NEW_LINE>final SpanishXMLTreeReaderFactory trf = new SpanishXMLTreeReaderFactory(true, true, ner, detailedAnnotations, expandElisions, expandConmigo);<NEW_LINE>ExecutorService pool = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors());<NEW_LINE>for (final File file : fileList) {<NEW_LINE>pool.execute(() -> {<NEW_LINE>try {<NEW_LINE>Reader in = new BufferedReader(new InputStreamReader(new FileInputStream(file), "ISO-8859-1"));<NEW_LINE>TreeReader tr = trf.newTreeReader(file.getPath(), in);<NEW_LINE>process(file, <MASK><NEW_LINE>tr.close();<NEW_LINE>} catch (IOException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>pool.shutdown();<NEW_LINE>try {<NEW_LINE>pool.awaitTermination(Long.MAX_VALUE, TimeUnit.NANOSECONDS);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>throw new RuntimeInterruptedException(e);<NEW_LINE>}<NEW_LINE>}
tr, posPattern, wordPattern, plainPrint);
386,571
public ListResponsePlansResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListResponsePlansResult listResponsePlansResult = new ListResponsePlansResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return listResponsePlansResult;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("nextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listResponsePlansResult.setNextToken(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("responsePlanSummaries", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listResponsePlansResult.setResponsePlanSummaries(new ListUnmarshaller<ResponsePlanSummary>(ResponsePlanSummaryJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return listResponsePlansResult;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
489,067
public Mapper.Builder<AnnotatedTextFieldMapper.Builder, AnnotatedTextFieldMapper> parse(String fieldName, Map<String, Object> node, ParserContext parserContext) throws MapperParsingException {<NEW_LINE>AnnotatedTextFieldMapper.Builder builder = new AnnotatedTextFieldMapper.Builder(fieldName);<NEW_LINE>builder.fieldType().setIndexAnalyzer(parserContext.getIndexAnalyzers().getDefaultIndexAnalyzer());<NEW_LINE>builder.fieldType().setSearchAnalyzer(parserContext.getIndexAnalyzers().getDefaultSearchAnalyzer());<NEW_LINE>builder.fieldType().setSearchQuoteAnalyzer(parserContext.getIndexAnalyzers().getDefaultSearchQuoteAnalyzer());<NEW_LINE>parseTextField(builder, fieldName, node, parserContext);<NEW_LINE>for (Iterator<Map.Entry<String, Object>> iterator = node.entrySet().iterator(); iterator.hasNext(); ) {<NEW_LINE>Map.Entry<String, Object> entry = iterator.next();<NEW_LINE><MASK><NEW_LINE>Object propNode = entry.getValue();<NEW_LINE>if (propName.equals("position_increment_gap")) {<NEW_LINE>int newPositionIncrementGap = XContentMapValues.nodeIntegerValue(propNode, -1);<NEW_LINE>builder.positionIncrementGap(newPositionIncrementGap);<NEW_LINE>iterator.remove();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return builder;<NEW_LINE>}
String propName = entry.getKey();
1,264,989
protected void taskOnceLoop() {<NEW_LINE>try {<NEW_LINE>WeEvent event = this.eventQueue.poll(this.idleTime, TimeUnit.MILLISECONDS);<NEW_LINE>// empty queue, try next.<NEW_LINE>if (event == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>log.debug("poll from notify queue, event: {}", event);<NEW_LINE>// avoid duplicate with FIFO cache<NEW_LINE>if (this.mergeCache.containsKey(event.getEventId())) {<NEW_LINE>log.warn("event to be notify again, skip {}", event.getEventId());<NEW_LINE>} else {<NEW_LINE>// notify a single event once time<NEW_LINE>this.consumerListener.onEvent(this.subscriptionId, event);<NEW_LINE>this.notifiedCount++;<NEW_LINE><MASK><NEW_LINE>this.lastTimeStamp.setTime(now);<NEW_LINE>// avoid duplicate with FIFO cache<NEW_LINE>this.mergeCache.put(event.getEventId(), now);<NEW_LINE>log.info("notify biz done, subscriptionId: {} eventId: {}", this.subscriptionId, event.getEventId());<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>this.consumerListener.onException(e);<NEW_LINE>}<NEW_LINE>}
long now = System.currentTimeMillis();
326,389
public static ClientMessage encodeRequest(com.hazelcast.cp.internal.RaftGroupId groupId, java.lang.String name, com.hazelcast.internal.serialization.Data function, int returnValueType) {<NEW_LINE>ClientMessage clientMessage = ClientMessage.createForEncode();<NEW_LINE>clientMessage.setRetryable(false);<NEW_LINE>clientMessage.setOperationName("AtomicLong.Alter");<NEW_LINE>ClientMessage.Frame initialFrame = new ClientMessage.Frame(new byte[REQUEST_INITIAL_FRAME_SIZE], UNFRAGMENTED_MESSAGE);<NEW_LINE>encodeInt(initialFrame.content, TYPE_FIELD_OFFSET, REQUEST_MESSAGE_TYPE);<NEW_LINE>encodeInt(initialFrame.content, PARTITION_ID_FIELD_OFFSET, -1);<NEW_LINE>encodeInt(initialFrame.content, REQUEST_RETURN_VALUE_TYPE_FIELD_OFFSET, returnValueType);<NEW_LINE>clientMessage.add(initialFrame);<NEW_LINE>RaftGroupIdCodec.encode(clientMessage, groupId);<NEW_LINE><MASK><NEW_LINE>DataCodec.encode(clientMessage, function);<NEW_LINE>return clientMessage;<NEW_LINE>}
StringCodec.encode(clientMessage, name);
920,783
public Dialog createDialog(Activity activity, Bundle args) {<NEW_LINE>AlertDialog.Builder builder = new AlertDialog.Builder(mapActivity);<NEW_LINE>builder.setTitle(R.string.gps_status);<NEW_LINE>LinearLayout ll = new LinearLayout(activity);<NEW_LINE>final ListView lv = new ListView(activity);<NEW_LINE>final int dp24 = AndroidUtils.dpToPx(mapActivity, 24f);<NEW_LINE>final int dp12 = AndroidUtils.dpToPx(mapActivity, 12f);<NEW_LINE>final int dp8 = AndroidUtils.dpToPx(mapActivity, 8f);<NEW_LINE>lv.setPadding(0, dp8, 0, dp8);<NEW_LINE>final AppCompatCheckBox cb = new AppCompatCheckBox(activity);<NEW_LINE>cb.setText(R.string.shared_string_remember_my_choice);<NEW_LINE>LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);<NEW_LINE>AndroidUtils.setMargins(lp, dp24, dp8, dp8, dp24);<NEW_LINE>cb.setLayoutParams(lp);<NEW_LINE>cb.setPadding(dp8, 0, 0, 0);<NEW_LINE>int textColorPrimary = ColorUtilities.<MASK><NEW_LINE>int selectedModeColor = getSettings().getApplicationMode().getProfileColor(isNightMode());<NEW_LINE>cb.setTextColor(textColorPrimary);<NEW_LINE>UiUtilities.setupCompoundButton(isNightMode(), selectedModeColor, cb);<NEW_LINE>final int layout = R.layout.list_menu_item_native;<NEW_LINE>final ArrayAdapter<GpsStatusApps> adapter = new ArrayAdapter<GpsStatusApps>(mapActivity, layout, GpsStatusApps.values()) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public View getView(int position, View convertView, ViewGroup parent) {<NEW_LINE>View v = mapActivity.getLayoutInflater().inflate(layout, null);<NEW_LINE>TextView tv = (TextView) v.findViewById(R.id.title);<NEW_LINE>tv.setPadding(dp12, 0, dp24, 0);<NEW_LINE>tv.setText(getItem(position).stringRes);<NEW_LINE>v.findViewById(R.id.toggle_item).setVisibility(View.INVISIBLE);<NEW_LINE>return v;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>lv.setAdapter(adapter);<NEW_LINE>ll.setOrientation(LinearLayout.VERTICAL);<NEW_LINE>ll.addView(lv);<NEW_LINE>ll.addView(cb);<NEW_LINE>final AlertDialog dlg = builder.create();<NEW_LINE>lv.setOnItemClickListener(new OnItemClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onItemClick(AdapterView<?> parent, View view, int position, long id) {<NEW_LINE>boolean remember = cb.isChecked();<NEW_LINE>GpsStatusApps item = adapter.getItem(position);<NEW_LINE>if (remember) {<NEW_LINE>getSettings().GPS_STATUS_APP.set(item.appName);<NEW_LINE>}<NEW_LINE>dlg.dismiss();<NEW_LINE>runChosenGPSStatus(item);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>dlg.setView(ll);<NEW_LINE>return dlg;<NEW_LINE>}
getPrimaryTextColor(activity, isNightMode());
1,023,146
public T resultOrThrow() {<NEW_LINE>// Avoid changing behavior. Old implementation would throw an exception if<NEW_LINE>// this method was called from the UI thread<NEW_LINE>if (Looper.myLooper() == Looper.getMainLooper()) {<NEW_LINE>throw new AppException(ErrorCode<MASK><NEW_LINE>}<NEW_LINE>execute(this);<NEW_LINE>try {<NEW_LINE>// Wait indefinitely. Timeouts should be handled by the Network layer,<NEW_LINE>// so will eventually bubble up as an exception.<NEW_LINE>latch.await();<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>RealmLog.debug("Network request interrupted.");<NEW_LINE>}<NEW_LINE>// Result of request should be available. Throw if an error happened, otherwise return<NEW_LINE>// the result.<NEW_LINE>if (error.get() != null) {<NEW_LINE>throw error.get();<NEW_LINE>} else {<NEW_LINE>if (success != null) {<NEW_LINE>return success.get();<NEW_LINE>} else {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.NETWORK_UNKNOWN, new NetworkOnMainThreadException());
623,153
public void cancelPendingBuilds(Job<?, ?> job, Integer projectId, String branch) {<NEW_LINE>Queue queue = Jenkins<MASK><NEW_LINE>for (Queue.Item item : queue.getItems()) {<NEW_LINE>if (!job.getName().equals(item.task.getName())) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>GitLabWebHookCause queueItemGitLabWebHookCause = getGitLabWebHookCauseData(item);<NEW_LINE>if (queueItemGitLabWebHookCause == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>CauseData queueItemCauseData = queueItemGitLabWebHookCause.getData();<NEW_LINE>if (!projectId.equals(queueItemCauseData.getSourceProjectId())) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (branch.equals(queueItemCauseData.getBranch())) {<NEW_LINE>cancel(item, queue, branch);<NEW_LINE>setCommitStatusCancelledIfNecessary(queueItemCauseData, job);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.getInstance().getQueue();
295,282
public void addSyntheticArrayConstructor(SyntheticMethodBinding methodBinding) {<NEW_LINE>generateMethodInfoHeader(methodBinding);<NEW_LINE>int methodAttributeOffset = this.contentsOffset;<NEW_LINE>// this will add exception attribute, synthetic attribute, deprecated attribute,...<NEW_LINE>int attributeNumber = generateMethodInfoAttributes(methodBinding);<NEW_LINE>// Code attribute<NEW_LINE>int codeAttributeOffset = this.contentsOffset;<NEW_LINE>// add code attribute<NEW_LINE>attributeNumber++;<NEW_LINE>generateCodeAttributeHeader();<NEW_LINE>this.codeStream.init(this);<NEW_LINE>this.codeStream.generateSyntheticBodyForArrayConstructor(methodBinding);<NEW_LINE>completeCodeAttributeForSyntheticMethod(methodBinding, codeAttributeOffset, ((SourceTypeBinding) methodBinding.declaringClass).scope.referenceCompilationUnit(<MASK><NEW_LINE>// update the number of attributes<NEW_LINE>this.contents[methodAttributeOffset++] = (byte) (attributeNumber >> 8);<NEW_LINE>this.contents[methodAttributeOffset] = (byte) attributeNumber;<NEW_LINE>}
).compilationResult.getLineSeparatorPositions());
179,959
private void traverseRecurse(DataSchema schema) {<NEW_LINE>if (schema instanceof NamedDataSchema) {<NEW_LINE>_path.add(((NamedDataSchema<MASK><NEW_LINE>} else {<NEW_LINE>_path.add(schema.getUnionMemberKey());<NEW_LINE>}<NEW_LINE>if (_callbacks.containsKey(Order.PRE_ORDER)) {<NEW_LINE>_callbacks.get(Order.PRE_ORDER).callback(_path, schema);<NEW_LINE>}<NEW_LINE>switch(schema.getType()) {<NEW_LINE>case TYPEREF:<NEW_LINE>TyperefDataSchema typerefDataSchema = (TyperefDataSchema) schema;<NEW_LINE>traverseChild(DataSchemaConstants.REF_KEY, typerefDataSchema.getRef());<NEW_LINE>break;<NEW_LINE>case MAP:<NEW_LINE>MapDataSchema mapDataSchema = (MapDataSchema) schema;<NEW_LINE>traverseChild(DataSchemaConstants.VALUES_KEY, mapDataSchema.getValues());<NEW_LINE>break;<NEW_LINE>case ARRAY:<NEW_LINE>ArrayDataSchema arrayDataSchema = (ArrayDataSchema) schema;<NEW_LINE>traverseChild(DataSchemaConstants.ITEMS_KEY, arrayDataSchema.getItems());<NEW_LINE>break;<NEW_LINE>case RECORD:<NEW_LINE>RecordDataSchema recordDataSchema = (RecordDataSchema) schema;<NEW_LINE>for (RecordDataSchema.Field field : recordDataSchema.getFields()) {<NEW_LINE>traverseChild(field.getName(), field.getType());<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case UNION:<NEW_LINE>UnionDataSchema unionDataSchema = (UnionDataSchema) schema;<NEW_LINE>for (UnionDataSchema.Member member : unionDataSchema.getMembers()) {<NEW_LINE>traverseChild(member.getUnionMemberKey(), member.getType());<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case FIXED:<NEW_LINE>break;<NEW_LINE>case ENUM:<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>assert (schema.isPrimitive());<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (_callbacks.containsKey(Order.POST_ORDER)) {<NEW_LINE>_callbacks.get(Order.POST_ORDER).callback(_path, schema);<NEW_LINE>}<NEW_LINE>_path.remove(_path.size() - 1);<NEW_LINE>}
) schema).getFullName());
237,178
// reverseCorrectIt<NEW_LINE>MJournal reverseCorrectIt(final int GL_JournalBatch_ID) {<NEW_LINE>log.info("{}", this);<NEW_LINE>// Journal<NEW_LINE>final MJournal reverse = new MJournal(this);<NEW_LINE>reverse.setGL_JournalBatch_ID(GL_JournalBatch_ID);<NEW_LINE>reverse.setDateDoc(getDateDoc());<NEW_LINE>reverse.setDateAcct(getDateAcct());<NEW_LINE>// Reverse indicator<NEW_LINE>reverse.addDescription(<MASK><NEW_LINE>// FR [ 1948157 ]<NEW_LINE>reverse.setReversal_ID(getGL_Journal_ID());<NEW_LINE>InterfaceWrapperHelper.save(reverse);<NEW_LINE>addDescription("(" + reverse.getDocumentNo() + "<-)");<NEW_LINE>reverse.setControlAmt(this.getControlAmt().negate());<NEW_LINE>// Lines<NEW_LINE>reverse.copyLinesFrom(this, null, 'C');<NEW_LINE>// Complete the reversal and set it's status to Reversed<NEW_LINE>if (!reverse.processIt(IDocument.ACTION_Complete)) {<NEW_LINE>throw new AdempiereException(reverse.getProcessMsg());<NEW_LINE>}<NEW_LINE>reverse.setDocStatus(DOCSTATUS_Reversed);<NEW_LINE>reverse.setDocAction(DOCACTION_None);<NEW_LINE>InterfaceWrapperHelper.save(reverse);<NEW_LINE>//<NEW_LINE>// Update this journal<NEW_LINE>setProcessed(true);<NEW_LINE>// FR [ 1948157 ]<NEW_LINE>setReversal_ID(reverse.getGL_Journal_ID());<NEW_LINE>setDocStatus(DOCSTATUS_Reversed);<NEW_LINE>setDocAction(DOCACTION_None);<NEW_LINE>saveEx();<NEW_LINE>return reverse;<NEW_LINE>}
"(->" + getDocumentNo() + ")");
818,444
public ProcessStatus restCheckVerification(final PwmRequest pwmRequest) throws IOException, PwmUnrecoverableException, ServletException {<NEW_LINE>final HelpdeskProfile helpdeskProfile = getHelpdeskProfile(pwmRequest);<NEW_LINE>final Map<String, String> bodyMap = pwmRequest.readBodyAsJsonStringMap(PwmHttpRequestWrapper.Flag.BypassValidation);<NEW_LINE>final UserIdentity userIdentity = HelpdeskServletUtil.userIdentityFromMap(pwmRequest, bodyMap);<NEW_LINE>HelpdeskServletUtil.checkIfUserIdentityViewable(pwmRequest, helpdeskProfile, userIdentity);<NEW_LINE>final String rawVerificationStr = bodyMap.get(HelpdeskVerificationStateBean.PARAMETER_VERIFICATION_STATE_KEY);<NEW_LINE>final HelpdeskVerificationStateBean state = HelpdeskVerificationStateBean.fromClientString(pwmRequest, rawVerificationStr);<NEW_LINE>final boolean passed = HelpdeskServletUtil.<MASK><NEW_LINE>final HelpdeskVerificationOptionsBean optionsBean = HelpdeskVerificationOptionsBean.makeBean(pwmRequest, helpdeskProfile, userIdentity);<NEW_LINE>final HashMap<String, Object> results = new HashMap<>();<NEW_LINE>results.put("passed", passed);<NEW_LINE>results.put("verificationOptions", optionsBean);<NEW_LINE>final RestResultBean restResultBean = RestResultBean.withData(results, Map.class);<NEW_LINE>pwmRequest.outputJsonResult(restResultBean);<NEW_LINE>return ProcessStatus.Halt;<NEW_LINE>}
checkIfRequiredVerificationPassed(userIdentity, state, helpdeskProfile);
890,067
public static Set<ParamType> constituentGenerics(final ParamType type) {<NEW_LINE>if (type instanceof ArrayType) {<NEW_LINE>return constituentGenerics(((ArrayType) type).element());<NEW_LINE>} else if (type instanceof MapType) {<NEW_LINE>return Sets.union(constituentGenerics(((MapType) type).key()), constituentGenerics(((MapType) type).value()));<NEW_LINE>} else if (type instanceof StructType) {<NEW_LINE>return ((StructType) type).getSchema().values().stream().map(GenericsUtil::constituentGenerics).flatMap(Collection::stream).collect(Collectors.toSet());<NEW_LINE>} else if (type instanceof GenericType) {<NEW_LINE>return ImmutableSet.of(type);<NEW_LINE>} else if (type instanceof LambdaType) {<NEW_LINE>final Set<ParamType> inputSet = new HashSet<>();<NEW_LINE>for (final ParamType paramType : ((LambdaType) type).inputTypes()) {<NEW_LINE>inputSet.addAll(constituentGenerics(paramType));<NEW_LINE>}<NEW_LINE>return Sets.union(inputSet, constituentGenerics(((LambdaType) <MASK><NEW_LINE>} else {<NEW_LINE>return ImmutableSet.of();<NEW_LINE>}<NEW_LINE>}
type).returnType()));
1,489,233
private void updateNodes() {<NEW_LINE>final DayEntryView view = getSkinnable();<NEW_LINE>final ObservableMap<Pos, List<Node>> nodes = view.getNodes();<NEW_LINE>if (nodes != null) {<NEW_LINE>Set<Pos> previouslyUsedPositions = null;<NEW_LINE>if (nodePanes != null) {<NEW_LINE>previouslyUsedPositions = nodePanes.keySet();<NEW_LINE>}<NEW_LINE>final Set<Pos> currentlyUsedPositions = nodes.keySet();<NEW_LINE>// we have to remove some previously used flow panes from the entry view<NEW_LINE>if (previouslyUsedPositions != null) {<NEW_LINE>previouslyUsedPositions.removeAll(currentlyUsedPositions);<NEW_LINE>final Iterator<Pos<MASK><NEW_LINE>while (iterator.hasNext()) {<NEW_LINE>final Pos next = iterator.next();<NEW_LINE>final FlowPane removedPane = nodePanes.remove(next);<NEW_LINE>getChildren().remove(removedPane);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>currentlyUsedPositions.forEach(pos -> createPosition(pos, nodes.get(pos)));<NEW_LINE>}<NEW_LINE>if (nodePanes != null && nodePanes.isEmpty()) {<NEW_LINE>nodePanes = null;<NEW_LINE>}<NEW_LINE>}
> iterator = previouslyUsedPositions.iterator();
1,459,091
private void updateWatchlistBox(final CacheDetailActivity activity) {<NEW_LINE>final boolean supportsWatchList = cache.supportsWatchList();<NEW_LINE>binding.watchlistBox.setVisibility(supportsWatchList ? <MASK><NEW_LINE>if (!supportsWatchList) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final int watchListCount = cache.getWatchlistCount();<NEW_LINE>if (cache.isOnWatchlist() || cache.isOwner()) {<NEW_LINE>binding.addToWatchlist.setVisibility(View.GONE);<NEW_LINE>binding.removeFromWatchlist.setVisibility(View.VISIBLE);<NEW_LINE>if (watchListCount != -1) {<NEW_LINE>binding.watchlistText.setText(activity.res.getString(R.string.cache_watchlist_on_extra, watchListCount));<NEW_LINE>} else {<NEW_LINE>binding.watchlistText.setText(R.string.cache_watchlist_on);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>binding.addToWatchlist.setVisibility(View.VISIBLE);<NEW_LINE>binding.removeFromWatchlist.setVisibility(View.GONE);<NEW_LINE>if (watchListCount != -1) {<NEW_LINE>binding.watchlistText.setText(activity.res.getString(R.string.cache_watchlist_not_on_extra, watchListCount));<NEW_LINE>} else {<NEW_LINE>binding.watchlistText.setText(R.string.cache_watchlist_not_on);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// the owner of a cache has it always on his watchlist. Adding causes an error<NEW_LINE>if (cache.isOwner()) {<NEW_LINE>binding.addToWatchlist.setEnabled(false);<NEW_LINE>binding.addToWatchlist.setVisibility(View.GONE);<NEW_LINE>binding.removeFromWatchlist.setEnabled(false);<NEW_LINE>binding.removeFromWatchlist.setVisibility(View.GONE);<NEW_LINE>}<NEW_LINE>}
View.VISIBLE : View.GONE);
1,850,056
public FixResult executeFix(Map<String, String> issue, Map<String, Object> clientMap, Map<String, String> ruleParams) {<NEW_LINE>String resourceId = issue.get("resourceDisplayId");<NEW_LINE>String defaultCidrIp = ruleParams.get("defaultCidrIp");<NEW_LINE>Map<String, Object> ec2ClinetMap = null;<NEW_LINE>List<SecurityGroup> securityGroupsDetails = null;<NEW_LINE>AmazonEC2 ec2Client = null;<NEW_LINE>Collection<IpPermission> ipPermissionsToBeAdded;<NEW_LINE>Set<String> securityGroupsSet = new HashSet<>();<NEW_LINE>Set<String> alreadyCheckedSgSet = new HashSet<>();<NEW_LINE>try {<NEW_LINE>ec2ClinetMap = PublicAccessAutoFix.getAWSClient("ec2", issue, CommonUtils.getPropValue(PacmanSdkConstants.AUTO_FIX_ROLE_NAME));<NEW_LINE>AmazonRedshift amazonRedshift = (AmazonRedshift) clientMap.get("client");<NEW_LINE>Set<String> securityGroupsTobeApplied = new HashSet<>();<NEW_LINE>List<Cluster> clusters = PublicAccessAutoFix.getClusterForRedhiftResource(clientMap, resourceId);<NEW_LINE>if (clusters.get(0).getPubliclyAccessible()) {<NEW_LINE>Integer port = clusters.get(0).getEndpoint().getPort();<NEW_LINE>List<VpcSecurityGroupMembership> originalSgMembers = clusters.get(0).getVpcSecurityGroups();<NEW_LINE>for (VpcSecurityGroupMembership sgm : originalSgMembers) {<NEW_LINE>if ("active".equals(sgm.getStatus())) {<NEW_LINE>securityGroupsSet.add(sgm.getVpcSecurityGroupId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (ec2ClinetMap != null) {<NEW_LINE>ec2Client = (AmazonEC2) ec2ClinetMap.get("client");<NEW_LINE>securityGroupsDetails = PublicAccessAutoFix.getExistingSecurityGroupDetails(securityGroupsSet, ec2Client);<NEW_LINE>}<NEW_LINE>String vpcid;<NEW_LINE>String securityGroupId = null;<NEW_LINE>Set<String> publiclyAccessible = new HashSet<>();<NEW_LINE>boolean isSgApplied = false;<NEW_LINE>for (SecurityGroup securityGroup : securityGroupsDetails) {<NEW_LINE>ipPermissionsToBeAdded = new ArrayList<>();<NEW_LINE><MASK><NEW_LINE>vpcid = securityGroup.getVpcId();<NEW_LINE>securityGroupId = securityGroup.getGroupId();<NEW_LINE>PublicAccessAutoFix.nestedSecurityGroupDetails(securityGroupId, ipPermissionsToBeAdded, ec2Client, publiclyAccessible, alreadyCheckedSgSet, port);<NEW_LINE>if (!publiclyAccessible.isEmpty()) {<NEW_LINE>// copy the security group and remove in bound rules<NEW_LINE>String createdSgId = PublicAccessAutoFix.createSecurityGroup(securityGroupId, vpcid, ec2Client, ipPermissionsToBeAdded, resourceId, defaultCidrIp, securityGroup.getIpPermissions());<NEW_LINE>if (!StringUtils.isEmpty(createdSgId)) {<NEW_LINE>securityGroupsTobeApplied.add(createdSgId);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>securityGroupsTobeApplied.add(securityGroupId);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!securityGroupsTobeApplied.isEmpty()) {<NEW_LINE>isSgApplied = PublicAccessAutoFix.applySecurityGroupsToRedshift(amazonRedshift, securityGroupsTobeApplied, resourceId);<NEW_LINE>ATTACHED_SG = securityGroupsTobeApplied.toString();<NEW_LINE>}<NEW_LINE>if (isSgApplied) {<NEW_LINE>LOGGER.info(" {} sg's successfully applied for the resource {}", securityGroupsTobeApplied, resourceId);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.error(e.getMessage());<NEW_LINE>}<NEW_LINE>return new FixResult(PacmanSdkConstants.STATUS_SUCCESS_CODE, "the redshift " + resourceId + " is now fixed");<NEW_LINE>}
publiclyAccessible = new HashSet<>();
1,174,312
private static void addMavenCoordinates(File modifiedJsonFile, JsonArray jsonArray, Map<String, LibertyFeature> features) throws IOException {<NEW_LINE>JsonArrayBuilder jsonArrayBuilder = Json.createArrayBuilder();<NEW_LINE>for (int i = 0; i < jsonArray.size(); i++) {<NEW_LINE>JsonObject <MASK><NEW_LINE>JsonObjectBuilder jsonObjectBuilder = Json.createObjectBuilder(jsonObject);<NEW_LINE>JsonObject wlpInfo = jsonObject.getJsonObject(Constants.WLP_INFORMATION_KEY);<NEW_LINE>JsonObjectBuilder wlpInfoBuilder = Json.createObjectBuilder(wlpInfo);<NEW_LINE>JsonArray provideFeatureArray = wlpInfo.getJsonArray(Constants.PROVIDE_FEATURE_KEY);<NEW_LINE>String symbolicName = provideFeatureArray.getString(0);<NEW_LINE>wlpInfoBuilder.add(Constants.MAVEN_COORDINATES_KEY, features.get(symbolicName).getMavenCoordinates().toString());<NEW_LINE>if (features.get(symbolicName).getMinimumLicenseMavenCoordinate() != null) {<NEW_LINE>wlpInfoBuilder.add("licenseMavenCoordinate", features.get(symbolicName).getMinimumLicenseMavenCoordinate());<NEW_LINE>}<NEW_LINE>jsonObjectBuilder.add(Constants.WLP_INFORMATION_KEY, wlpInfoBuilder);<NEW_LINE>jsonArrayBuilder.add(jsonObjectBuilder);<NEW_LINE>}<NEW_LINE>// Write JSON to the modified file<NEW_LINE>FileOutputStream out = null;<NEW_LINE>try {<NEW_LINE>Map<String, Object> config = new HashMap<String, Object>();<NEW_LINE>config.put(JsonGenerator.PRETTY_PRINTING, true);<NEW_LINE>JsonWriterFactory writerFactory = Json.createWriterFactory(config);<NEW_LINE>out = new FileOutputStream(modifiedJsonFile);<NEW_LINE>JsonWriter streamWriter = writerFactory.createWriter(out);<NEW_LINE>streamWriter.write(jsonArrayBuilder.build());<NEW_LINE>} finally {<NEW_LINE>if (out != null) {<NEW_LINE>out.close();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
jsonObject = jsonArray.getJsonObject(i);
1,642,330
private String convert(RuntimeConstant cst) {<NEW_LINE>switch(cst.getKind()) {<NEW_LINE>case RuntimeConstant.INT:<NEW_LINE>return String.valueOf(cst.getInt());<NEW_LINE>case RuntimeConstant.LONG:<NEW_LINE>return String.valueOf(cst.getLong());<NEW_LINE>case RuntimeConstant.FLOAT:<NEW_LINE>return String.valueOf(cst.getFloat());<NEW_LINE>case RuntimeConstant.DOUBLE:<NEW_LINE>return String.valueOf(cst.getDouble());<NEW_LINE>case RuntimeConstant.STRING:<NEW_LINE>return String.valueOf(cst.getString());<NEW_LINE>case RuntimeConstant.TYPE:<NEW_LINE>return String.valueOf(cst.getValueType());<NEW_LINE>case RuntimeConstant.METHOD:<NEW_LINE>{<NEW_LINE>ValueType[] methodType = cst.getMethodType();<NEW_LINE>return "(" + Arrays.stream(methodType, 0, methodType.length - 1).map(Object::toString).collect(Collectors.joining()) + ")" + methodType[methodType.length - 1];<NEW_LINE>}<NEW_LINE>case RuntimeConstant.METHOD_HANDLE:<NEW_LINE>return convert(cst.getMethodHandle());<NEW_LINE>}<NEW_LINE>throw new IllegalArgumentException(<MASK><NEW_LINE>}
"Unexpected runtime constant type: " + cst.getKind());
115,556
public static ListIndexesResponse unmarshall(ListIndexesResponse listIndexesResponse, UnmarshallerContext _ctx) {<NEW_LINE>listIndexesResponse.setRequestId(_ctx.stringValue("ListIndexesResponse.RequestId"));<NEW_LINE>listIndexesResponse.setErrorCode(_ctx.stringValue("ListIndexesResponse.ErrorCode"));<NEW_LINE>listIndexesResponse.setErrorMessage(_ctx.stringValue("ListIndexesResponse.ErrorMessage"));<NEW_LINE>listIndexesResponse.setSuccess<MASK><NEW_LINE>List<Index> indexList = new ArrayList<Index>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListIndexesResponse.IndexList.Length"); i++) {<NEW_LINE>Index index = new Index();<NEW_LINE>index.setIndexName(_ctx.stringValue("ListIndexesResponse.IndexList[" + i + "].IndexName"));<NEW_LINE>index.setIndexType(_ctx.stringValue("ListIndexesResponse.IndexList[" + i + "].IndexType"));<NEW_LINE>index.setTableId(_ctx.stringValue("ListIndexesResponse.IndexList[" + i + "].TableId"));<NEW_LINE>index.setIndexId(_ctx.stringValue("ListIndexesResponse.IndexList[" + i + "].IndexId"));<NEW_LINE>index.setIndexComment(_ctx.stringValue("ListIndexesResponse.IndexList[" + i + "].IndexComment"));<NEW_LINE>indexList.add(index);<NEW_LINE>}<NEW_LINE>listIndexesResponse.setIndexList(indexList);<NEW_LINE>return listIndexesResponse;<NEW_LINE>}
(_ctx.booleanValue("ListIndexesResponse.Success"));
1,362,359
public void handleSourceEvents(SourceEvent sourceEvent) {<NEW_LINE>if (sourceEvent instanceof FinishedSnapshotSplitsAckEvent) {<NEW_LINE>FinishedSnapshotSplitsAckEvent ackEvent = (FinishedSnapshotSplitsAckEvent) sourceEvent;<NEW_LINE>LOG.debug("The subtask {} receives ack event for {} from enumerator.", subtaskId, ackEvent.getFinishedSplits());<NEW_LINE>for (String splitId : ackEvent.getFinishedSplits()) {<NEW_LINE>this.finishedUnackedSplits.remove(splitId);<NEW_LINE>}<NEW_LINE>} else if (sourceEvent instanceof FinishedSnapshotSplitsRequestEvent) {<NEW_LINE>// report finished snapshot splits<NEW_LINE>LOG.debug("The subtask {} receives request to report finished snapshot splits.", subtaskId);<NEW_LINE>reportFinishedSnapshotSplitsIfNeed();<NEW_LINE>} else if (sourceEvent instanceof StreamSplitMetaEvent) {<NEW_LINE>LOG.debug("The subtask {} receives binlog meta with group id {}.", subtaskId, ((StreamSplitMetaEvent<MASK><NEW_LINE>fillMetaDataForBinlogSplit((StreamSplitMetaEvent) sourceEvent);<NEW_LINE>} else {<NEW_LINE>super.handleSourceEvents(sourceEvent);<NEW_LINE>}<NEW_LINE>}
) sourceEvent).getMetaGroupId());
1,118,683
public void marshall(StepExecution stepExecution, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (stepExecution == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(stepExecution.getStepName(), STEPNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(stepExecution.getAction(), ACTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(stepExecution.getTimeoutSeconds(), TIMEOUTSECONDS_BINDING);<NEW_LINE>protocolMarshaller.marshall(stepExecution.getOnFailure(), ONFAILURE_BINDING);<NEW_LINE>protocolMarshaller.marshall(stepExecution.getMaxAttempts(), MAXATTEMPTS_BINDING);<NEW_LINE>protocolMarshaller.marshall(stepExecution.getExecutionStartTime(), EXECUTIONSTARTTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(stepExecution.getExecutionEndTime(), EXECUTIONENDTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(stepExecution.getStepStatus(), STEPSTATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(stepExecution.getResponseCode(), RESPONSECODE_BINDING);<NEW_LINE>protocolMarshaller.marshall(stepExecution.getInputs(), INPUTS_BINDING);<NEW_LINE>protocolMarshaller.marshall(stepExecution.getOutputs(), OUTPUTS_BINDING);<NEW_LINE>protocolMarshaller.marshall(stepExecution.getResponse(), RESPONSE_BINDING);<NEW_LINE>protocolMarshaller.marshall(stepExecution.getFailureMessage(), FAILUREMESSAGE_BINDING);<NEW_LINE>protocolMarshaller.marshall(stepExecution.getFailureDetails(), FAILUREDETAILS_BINDING);<NEW_LINE>protocolMarshaller.marshall(stepExecution.getStepExecutionId(), STEPEXECUTIONID_BINDING);<NEW_LINE>protocolMarshaller.marshall(stepExecution.getOverriddenParameters(), OVERRIDDENPARAMETERS_BINDING);<NEW_LINE>protocolMarshaller.marshall(stepExecution.getIsEnd(), ISEND_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(stepExecution.getIsCritical(), ISCRITICAL_BINDING);<NEW_LINE>protocolMarshaller.marshall(stepExecution.getValidNextSteps(), VALIDNEXTSTEPS_BINDING);<NEW_LINE>protocolMarshaller.marshall(stepExecution.getTargets(), TARGETS_BINDING);<NEW_LINE>protocolMarshaller.marshall(stepExecution.getTargetLocation(), TARGETLOCATION_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
stepExecution.getNextStep(), NEXTSTEP_BINDING);
563,384
public String delete(@RequestAttribute SysSite site, @SessionAttribute SysUser admin, Long[] ids, HttpServletRequest request, ModelMap model) {<NEW_LINE>if (CommonUtils.notEmpty(ids)) {<NEW_LINE>Set<Integer> categoryIdSet = new HashSet<>();<NEW_LINE>for (CmsContent entity : service.delete(site.getId(), admin, ids)) {<NEW_LINE>categoryIdSet.add(entity.getCategoryId());<NEW_LINE>if (entity.isHasStatic()) {<NEW_LINE>String filePath = siteComponent.getWebFilePath(site, entity.getUrl());<NEW_LINE>if (CmsFileUtils.exists(filePath)) {<NEW_LINE>String backupFilePath = siteComponent.getWebBackupFilePath(site, filePath);<NEW_LINE>CmsFileUtils.moveFile(filePath, backupFilePath);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!categoryIdSet.isEmpty()) {<NEW_LINE>Integer[] categoryIds = categoryIdSet.toArray(new Integer[categoryIdSet.size()]);<NEW_LINE>for (CmsCategory entity : categoryService.getEntitys(categoryIds)) {<NEW_LINE>templateComponent.createCategoryFile(site, entity, null, null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>logOperateService.save(new LogOperate(site.getId(), admin.getId(), LogLoginService.CHANNEL_WEB_MANAGER, "delete.content", RequestUtils.getIpAddress(request), CommonUtils.getDate(), StringUtils.join(<MASK><NEW_LINE>}<NEW_LINE>return CommonConstants.TEMPLATE_DONE;<NEW_LINE>}
ids, CommonConstants.COMMA)));
1,729,943
public void applyBeanDefinitions(SimpleDIContext context) throws Exception {<NEW_LINE>// TargetType<NEW_LINE>context.def(RunTargetType.class, CloudFoundryRunTargetType::new);<NEW_LINE>// Auto sync of cf deployed apps with JMX over SSH tunnel with boot ls (for live hover/data features).<NEW_LINE>context.def(RemoteBootAppsDataHolder.Contributor.class, CloudFoundryRemoteBootAppsDataContributor::new);<NEW_LINE>// UI actions<NEW_LINE>context.defInstance(BootDashActions.Factory.class, CfBootDashActions.factory);<NEW_LINE>// BootDashLabels<NEW_LINE>context.defInstance(BootDashLabels.Contribution.class, BootDashCfLabels.jmxDecoration);<NEW_LINE>// cf internal<NEW_LINE>context.def(CfUserInteractions.class, DefaultCfUserInteractions::new);<NEW_LINE>context.defInstance(DebugSupport.class, SshDebugSupport.INSTANCE);<NEW_LINE>context.defInstance(SshTunnelFactory.class, SshTunnelImpl::new);<NEW_LINE>context.defInstance(JmxSshTunnelManager<MASK><NEW_LINE>context.defInstance(CloudFoundryClientFactory.class, DefaultCloudFoundryClientFactoryV2.INSTANCE);<NEW_LINE>}
.class, new JmxSshTunnelManager());
1,386,747
protected Volume liveMigrateVolume(Volume volume, StoragePool destPool) throws StorageUnavailableException {<NEW_LINE>VolumeInfo vol = volFactory.getVolume(volume.getId());<NEW_LINE>DataStore dataStoreTarget = dataStoreMgr.getDataStore(destPool.<MASK><NEW_LINE>AsyncCallFuture<VolumeApiResult> future = volService.migrateVolume(vol, dataStoreTarget);<NEW_LINE>try {<NEW_LINE>VolumeApiResult result = future.get();<NEW_LINE>if (result.isFailed()) {<NEW_LINE>s_logger.debug("migrate volume failed:" + result.getResult());<NEW_LINE>throw new StorageUnavailableException("Migrate volume failed: " + result.getResult(), destPool.getId());<NEW_LINE>}<NEW_LINE>return result.getVolume();<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>s_logger.debug("migrate volume failed", e);<NEW_LINE>throw new CloudRuntimeException(e.getMessage());<NEW_LINE>} catch (ExecutionException e) {<NEW_LINE>s_logger.debug("migrate volume failed", e);<NEW_LINE>throw new CloudRuntimeException(e.getMessage());<NEW_LINE>}<NEW_LINE>}
getId(), DataStoreRole.Primary);
113,210
final UpdateCustomLineItemResult executeUpdateCustomLineItem(UpdateCustomLineItemRequest updateCustomLineItemRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateCustomLineItemRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateCustomLineItemRequest> request = null;<NEW_LINE>Response<UpdateCustomLineItemResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateCustomLineItemRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateCustomLineItemRequest));<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, "billingconductor");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateCustomLineItem");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateCustomLineItemResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateCustomLineItemResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
841,834
public static TypePatternElement fromString(String s, int expressionIndex) {<NEW_LINE>boolean isNullable = s.startsWith("-");<NEW_LINE>if (isNullable)<NEW_LINE>s = s.substring(1);<NEW_LINE>int flagMask = ~0;<NEW_LINE>if (s.startsWith("*")) {<NEW_LINE>s = s.substring(1);<NEW_LINE>flagMask &= ~SkriptParser.PARSE_EXPRESSIONS;<NEW_LINE>} else if (s.startsWith("~")) {<NEW_LINE>s = s.substring(1);<NEW_LINE>flagMask &= ~SkriptParser.PARSE_LITERALS;<NEW_LINE>}<NEW_LINE>if (!isNullable) {<NEW_LINE>isNullable = s.startsWith("-");<NEW_LINE>if (isNullable)<NEW_LINE>s = s.substring(1);<NEW_LINE>}<NEW_LINE>int time = 0;<NEW_LINE>int timeStart = s.indexOf("@");<NEW_LINE>if (timeStart != -1) {<NEW_LINE>time = Integer.parseInt(s.substring(timeStart + 1));<NEW_LINE>s = s.substring(0, timeStart);<NEW_LINE>}<NEW_LINE>String[] classes = s.split("/");<NEW_LINE>ClassInfo<?>[] classInfos = new ClassInfo[classes.length];<NEW_LINE>boolean[] isPlural <MASK><NEW_LINE>for (int i = 0; i < classes.length; i++) {<NEW_LINE>NonNullPair<String, Boolean> p = Utils.getEnglishPlural(classes[i]);<NEW_LINE>classInfos[i] = Classes.getClassInfo(p.getFirst());<NEW_LINE>isPlural[i] = p.getSecond();<NEW_LINE>}<NEW_LINE>return new TypePatternElement(classInfos, isPlural, isNullable, flagMask, time, expressionIndex);<NEW_LINE>}
= new boolean[classes.length];
814,869
private void updateScrolledCompositeMinSize() {<NEW_LINE>// because this method can be called *after* calculating data in the<NEW_LINE>// background, all widgets can already be disposed<NEW_LINE>if (scrolledComposite.isDisposed())<NEW_LINE>return;<NEW_LINE>Composite parent = scrolledComposite.getParent();<NEW_LINE>if (parent.isDisposed())<NEW_LINE>return;<NEW_LINE>Composite grandparent = parent.getParent();<NEW_LINE>if (grandparent.isDisposed())<NEW_LINE>return;<NEW_LINE>Rectangle clientArea = grandparent.getClientArea();<NEW_LINE>Point size = container.computeSize(<MASK><NEW_LINE>// On windows only, we do not have an overlay scrollbar and hence have<NEW_LINE>// to reduce the visible area to make room for the vertical scrollbar<NEW_LINE>if (Platform.OS_WIN32.equals(Platform.getOS()) && size.y > clientArea.height) {<NEW_LINE>int width = clientArea.width - scrolledComposite.getVerticalBar().getSize().x;<NEW_LINE>size = container.computeSize(width, SWT.DEFAULT);<NEW_LINE>}<NEW_LINE>scrolledComposite.setMinSize(size);<NEW_LINE>}
clientArea.width, SWT.DEFAULT);
1,624,443
public void paintComponent(Graphics g0) {<NEW_LINE>super.paintComponent(g0);<NEW_LINE>Graphics2D g = (Graphics2D) g0.create();<NEW_LINE>try {<NEW_LINE>g.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_PURE);<NEW_LINE>g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);<NEW_LINE>// Vertical spacing between the dots.<NEW_LINE>final int dotSpacingPixels = 4;<NEW_LINE>// Minimum vertical space before the first dot and after the last dot.<NEW_LINE>final int verticalMargin = 6;<NEW_LINE>// The resulting number of dots.<NEW_LINE>final int dotCount = (getHeight() - 2 * verticalMargin) / dotSpacingPixels + 1;<NEW_LINE>// Center the dots vertically.<NEW_LINE>final int startY = (getHeight() - (dotCount - 1) * dotSpacingPixels) / 2;<NEW_LINE>final int x = 4;<NEW_LINE>g.setColor(UIManager.getColor("controlShadow"));<NEW_LINE>for (int i = 0; i < dotCount; i++) {<NEW_LINE>final <MASK><NEW_LINE>g.fill(new Ellipse2D.Float(x, y, 1.8f, 1.8f));<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>g.dispose();<NEW_LINE>}<NEW_LINE>}
int y = startY + i * dotSpacingPixels;
1,640,522
public void encryptStr(String text, String key, String vector) {<NEW_LINE>try {<NEW_LINE>if (TopFragment.debug) {<NEW_LINE>key = key.substring(key.length() - 16);<NEW_LINE>// Create key and cipher<NEW_LINE>Key aesKey = new SecretKeySpec(key.getBytes(), "AES");<NEW_LINE>Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");<NEW_LINE>byte[] ivBytes = vector.substring(vector.length() - 16).getBytes();<NEW_LINE>// encrypt the text<NEW_LINE>cipher.init(Cipher.ENCRYPT_MODE, aesKey, new IvParameterSpec(ivBytes));<NEW_LINE>byte[] encrypted = cipher.doFinal(text.getBytes(StandardCharsets.UTF_8));<NEW_LINE>File f = new File(pathVars.get(<MASK><NEW_LINE>if (f.mkdirs() && f.setReadable(true) && f.setWritable(true)) {<NEW_LINE>Log.i(LOG_TAG, "encryptStr log dir created");<NEW_LINE>} else {<NEW_LINE>Log.e(LOG_TAG, "encryptStr Unable to create and chmod log dir");<NEW_LINE>}<NEW_LINE>PrintWriter writer = new PrintWriter(new BufferedWriter(new FileWriter(pathVars.get().getAppDataDir() + "/logs/EncryptedStr.txt", true)));<NEW_LINE>writer.println(text);<NEW_LINE>writer.println(Base64.encodeToString(encrypted, Base64.DEFAULT));<NEW_LINE>writer.println("********************");<NEW_LINE>writer.close();<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>Log.e(LOG_TAG, "encryptStr Failed " + e.getMessage() + " " + e.getCause());<NEW_LINE>}<NEW_LINE>}
).getAppDataDir() + "/logs");
440,045
public static Recurrence fromLegacyPeriod(long period) {<NEW_LINE>int result = (int) (period / RecurrenceParser.YEAR_MILLIS);<NEW_LINE>if (result > 0) {<NEW_LINE>Recurrence recurrence = new Recurrence(PeriodType.YEAR);<NEW_LINE>recurrence.setMultiplier(result);<NEW_LINE>return recurrence;<NEW_LINE>}<NEW_LINE>result = (int) (period / RecurrenceParser.MONTH_MILLIS);<NEW_LINE>if (result > 0) {<NEW_LINE>Recurrence recurrence = new Recurrence(PeriodType.MONTH);<NEW_LINE>recurrence.setMultiplier(result);<NEW_LINE>return recurrence;<NEW_LINE>}<NEW_LINE>result = (int) (period / RecurrenceParser.WEEK_MILLIS);<NEW_LINE>if (result > 0) {<NEW_LINE>Recurrence recurrence <MASK><NEW_LINE>recurrence.setMultiplier(result);<NEW_LINE>return recurrence;<NEW_LINE>}<NEW_LINE>result = (int) (period / RecurrenceParser.DAY_MILLIS);<NEW_LINE>if (result > 0) {<NEW_LINE>Recurrence recurrence = new Recurrence(PeriodType.DAY);<NEW_LINE>recurrence.setMultiplier(result);<NEW_LINE>return recurrence;<NEW_LINE>}<NEW_LINE>result = (int) (period / RecurrenceParser.HOUR_MILLIS);<NEW_LINE>if (result > 0) {<NEW_LINE>Recurrence recurrence = new Recurrence(PeriodType.HOUR);<NEW_LINE>recurrence.setMultiplier(result);<NEW_LINE>return recurrence;<NEW_LINE>}<NEW_LINE>return new Recurrence(PeriodType.DAY);<NEW_LINE>}
= new Recurrence(PeriodType.WEEK);
150,823
private static CloudHealthcare createClient() throws IOException {<NEW_LINE>// Use Application Default Credentials (ADC) to authenticate the requests<NEW_LINE>// For more information see https://cloud.google.com/docs/authentication/production<NEW_LINE>GoogleCredentials credential = GoogleCredentials.getApplicationDefault().createScoped(Collections.singleton(CloudHealthcareScopes.CLOUD_PLATFORM));<NEW_LINE>HttpHeaders headers = new HttpHeaders();<NEW_LINE><MASK><NEW_LINE>// Avoid parsing multipart boundaries by setting 'application/dicom' HTTP header.<NEW_LINE>// Add 'transfer-syntax=*' to avoid transcoding by returning the file in the format it<NEW_LINE>// was originally stored in.<NEW_LINE>headers.setAccept("application/dicom; transfer-syntax=*");<NEW_LINE>// Create a HttpRequestInitializer, which will provide a baseline configuration to all requests.<NEW_LINE>HttpRequestInitializer requestInitializer = request -> {<NEW_LINE>new HttpCredentialsAdapter(credential).initialize(request);<NEW_LINE>// 1 minute connect timeout<NEW_LINE>request.setConnectTimeout(60000);<NEW_LINE>// 1 minute read timeout<NEW_LINE>request.setReadTimeout(60000);<NEW_LINE>};<NEW_LINE>// Build the client for interacting with the service.<NEW_LINE>return new CloudHealthcare.Builder(HTTP_TRANSPORT, JSON_FACTORY, requestInitializer).setApplicationName("your-application-name").build();<NEW_LINE>}
headers.set("X-GFE-SSL", "yes");
865,610
public void showComments(final RequestContext context) {<NEW_LINE>final Request request = context.getRequest();<NEW_LINE>final AbstractFreeMarkerRenderer renderer = new SkinRenderer(context, "admin/comments.ftl");<NEW_LINE>final Map<String, Object> dataModel = renderer.getDataModel();<NEW_LINE>final int pageNum = Paginator.getPage(request);<NEW_LINE>final int pageSize = PAGE_SIZE;<NEW_LINE>final int windowSize = WINDOW_SIZE;<NEW_LINE>final JSONObject requestJSONObject = new JSONObject();<NEW_LINE>requestJSONObject.<MASK><NEW_LINE>requestJSONObject.put(Pagination.PAGINATION_PAGE_SIZE, pageSize);<NEW_LINE>requestJSONObject.put(Pagination.PAGINATION_WINDOW_SIZE, windowSize);<NEW_LINE>final List<String> commentFields = new ArrayList<>();<NEW_LINE>commentFields.add(Keys.OBJECT_ID);<NEW_LINE>commentFields.add(Comment.COMMENT_CREATE_TIME);<NEW_LINE>commentFields.add(Comment.COMMENT_AUTHOR_ID);<NEW_LINE>commentFields.add(Comment.COMMENT_ON_ARTICLE_ID);<NEW_LINE>commentFields.add(Comment.COMMENT_SHARP_URL);<NEW_LINE>commentFields.add(Comment.COMMENT_STATUS);<NEW_LINE>commentFields.add(Comment.COMMENT_CONTENT);<NEW_LINE>final JSONObject result = commentQueryService.getComments(requestJSONObject, commentFields);<NEW_LINE>dataModel.put(Comment.COMMENTS, result.opt(Comment.COMMENTS));<NEW_LINE>final JSONObject pagination = result.optJSONObject(Pagination.PAGINATION);<NEW_LINE>final int pageCount = pagination.optInt(Pagination.PAGINATION_PAGE_COUNT);<NEW_LINE>final JSONArray pageNums = pagination.optJSONArray(Pagination.PAGINATION_PAGE_NUMS);<NEW_LINE>dataModel.put(Pagination.PAGINATION_FIRST_PAGE_NUM, pageNums.opt(0));<NEW_LINE>dataModel.put(Pagination.PAGINATION_LAST_PAGE_NUM, pageNums.opt(pageNums.length() - 1));<NEW_LINE>dataModel.put(Pagination.PAGINATION_CURRENT_PAGE_NUM, pageNum);<NEW_LINE>dataModel.put(Pagination.PAGINATION_PAGE_COUNT, pageCount);<NEW_LINE>dataModel.put(Pagination.PAGINATION_PAGE_NUMS, CollectionUtils.jsonArrayToList(pageNums));<NEW_LINE>dataModelService.fillHeaderAndFooter(context, dataModel);<NEW_LINE>}
put(Pagination.PAGINATION_CURRENT_PAGE_NUM, pageNum);
334,222
public ClusterEndpoint unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ClusterEndpoint clusterEndpoint = new ClusterEndpoint();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("Endpoint", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>clusterEndpoint.setEndpoint(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("Region", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>clusterEndpoint.setRegion(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return clusterEndpoint;<NEW_LINE>}
class).unmarshall(context));
303,253
public String[] childrenNames() {<NEW_LINE>Statistics.StopWatch sw = Statistics.getStopWatch(Statistics.CHILDREN_NAMES, true);<NEW_LINE>try {<NEW_LINE>FileObject folder = toFolder();<NEW_LINE>List<String> folderNames = new ArrayList<String>();<NEW_LINE>if (folder != null) {<NEW_LINE>for (FileObject fo : Collections.list(folder.getFolders(false))) {<NEW_LINE>Enumeration<? extends FileObject> en = fo.getChildren(true);<NEW_LINE>while (en.hasMoreElements()) {<NEW_LINE>FileObject ffo = en.nextElement();<NEW_LINE>if (ffo.hasExt("properties")) {<NEW_LINE>// NOI18N<NEW_LINE>folderNames.add(fo.getNameExt());<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (FileObject fo : Collections.list(folder.getData(false))) {<NEW_LINE>if (fo.hasExt("properties")) {<NEW_LINE>// NOI18N<NEW_LINE>folderNames.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return folderNames.toArray(new String[folderNames.size()]);<NEW_LINE>} finally {<NEW_LINE>sw.stop();<NEW_LINE>}<NEW_LINE>}
add(fo.getName());
1,575,536
public static StringBuilder append(StringBuilder sb, Pod.Value v) {<NEW_LINE>switch(v.getValCase()) {<NEW_LINE>case VAL_NOT_SET:<NEW_LINE>return sb.append("[null]");<NEW_LINE>case STRING:<NEW_LINE>return sb.append(v.getString());<NEW_LINE>case BOOL:<NEW_LINE>return sb.append(v.getBool());<NEW_LINE>case FLOAT64:<NEW_LINE>return sb.append(v.getFloat64());<NEW_LINE>case FLOAT32:<NEW_LINE>return sb.append(v.getFloat32());<NEW_LINE>case SINT:<NEW_LINE>return sb.append(v.getSint());<NEW_LINE>case SINT8:<NEW_LINE>return sb.append(v.getSint8());<NEW_LINE>case SINT16:<NEW_LINE>return sb.append(v.getSint16());<NEW_LINE>case SINT32:<NEW_LINE>return sb.append(v.getSint32());<NEW_LINE>case SINT64:<NEW_LINE>return sb.append(v.getSint64());<NEW_LINE>case UINT:<NEW_LINE>return sb.append(v.getUint());<NEW_LINE>case UINT8:<NEW_LINE>return sb.append(v.getUint8());<NEW_LINE>case UINT16:<NEW_LINE>return sb.append(v.getUint16());<NEW_LINE>case UINT32:<NEW_LINE>return sb.append(v.getUint32());<NEW_LINE>case UINT64:<NEW_LINE>return sb.append(v.getUint64());<NEW_LINE>case STRING_ARRAY:<NEW_LINE>return sb.append(v.<MASK><NEW_LINE>case BOOL_ARRAY:<NEW_LINE>return sb.append(v.getBoolArray().getValList());<NEW_LINE>case FLOAT64_ARRAY:<NEW_LINE>return sb.append(v.getFloat64Array().getValList());<NEW_LINE>case FLOAT32_ARRAY:<NEW_LINE>return sb.append(v.getFloat32Array().getValList());<NEW_LINE>case SINT_ARRAY:<NEW_LINE>return sb.append(v.getSintArray().getValList());<NEW_LINE>case SINT8_ARRAY:<NEW_LINE>return sb.append(v.getSint8Array().getValList());<NEW_LINE>case SINT16_ARRAY:<NEW_LINE>return sb.append(v.getSint16Array().getValList());<NEW_LINE>case SINT32_ARRAY:<NEW_LINE>return sb.append(v.getSint32Array().getValList());<NEW_LINE>case SINT64_ARRAY:<NEW_LINE>return sb.append(v.getSint64Array().getValList());<NEW_LINE>case UINT_ARRAY:<NEW_LINE>return sb.append(v.getUintArray().getValList());<NEW_LINE>case UINT8_ARRAY:<NEW_LINE>return sb.append(ProtoDebugTextFormat.escapeBytes(v.getUint8Array()));<NEW_LINE>case UINT16_ARRAY:<NEW_LINE>return sb.append(v.getUint16Array().getValList());<NEW_LINE>case UINT32_ARRAY:<NEW_LINE>return sb.append(v.getUint32Array().getValList());<NEW_LINE>case UINT64_ARRAY:<NEW_LINE>return sb.append(v.getUint64Array().getValList());<NEW_LINE>default:<NEW_LINE>assert false;<NEW_LINE>return sb.append(ProtoDebugTextFormat.shortDebugString(v));<NEW_LINE>}<NEW_LINE>}
getStringArray().getValList());
1,511,570
public io.kubernetes.client.proto.V1Apps.ReplicaSetStatus buildPartial() {<NEW_LINE>io.kubernetes.client.proto.V1Apps.ReplicaSetStatus result = new io.kubernetes.client.proto.V1Apps.ReplicaSetStatus(this);<NEW_LINE>int from_bitField0_ = bitField0_;<NEW_LINE>int to_bitField0_ = 0;<NEW_LINE>if (((from_bitField0_ & 0x00000001) == 0x00000001)) {<NEW_LINE>to_bitField0_ |= 0x00000001;<NEW_LINE>}<NEW_LINE>result.replicas_ = replicas_;<NEW_LINE>if (((from_bitField0_ & 0x00000002) == 0x00000002)) {<NEW_LINE>to_bitField0_ |= 0x00000002;<NEW_LINE>}<NEW_LINE>result.fullyLabeledReplicas_ = fullyLabeledReplicas_;<NEW_LINE>if (((from_bitField0_ & 0x00000004) == 0x00000004)) {<NEW_LINE>to_bitField0_ |= 0x00000004;<NEW_LINE>}<NEW_LINE>result.readyReplicas_ = readyReplicas_;<NEW_LINE>if (((from_bitField0_ & 0x00000008) == 0x00000008)) {<NEW_LINE>to_bitField0_ |= 0x00000008;<NEW_LINE>}<NEW_LINE>result.availableReplicas_ = availableReplicas_;<NEW_LINE>if (((from_bitField0_ & 0x00000010) == 0x00000010)) {<NEW_LINE>to_bitField0_ |= 0x00000010;<NEW_LINE>}<NEW_LINE>result.observedGeneration_ = observedGeneration_;<NEW_LINE>if (conditionsBuilder_ == null) {<NEW_LINE>if (((bitField0_ & 0x00000020) == 0x00000020)) {<NEW_LINE>conditions_ = java.util.Collections.unmodifiableList(conditions_);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>result.conditions_ = conditions_;<NEW_LINE>} else {<NEW_LINE>result.conditions_ = conditionsBuilder_.build();<NEW_LINE>}<NEW_LINE>result.bitField0_ = to_bitField0_;<NEW_LINE>onBuilt();<NEW_LINE>return result;<NEW_LINE>}
bitField0_ = (bitField0_ & ~0x00000020);
1,589,348
private Structure createDefaultFileAssetStructure() throws DotDataException {<NEW_LINE>String inode = FileAssetAPI.DEFAULT_FILE_ASSET_STRUCTURE_INODE;<NEW_LINE>Structure fileAsset = new Structure();<NEW_LINE>fileAsset.setInode(inode);<NEW_LINE>fileAsset.setFixed(true);<NEW_LINE>fileAsset.setHost(Host.SYSTEM_HOST);<NEW_LINE>fileAsset.setFolder(FolderAPI.SYSTEM_FOLDER);<NEW_LINE>fileAsset.setName(FileAssetAPI.DEFAULT_FILE_ASSET_STRUCTURE_NAME);<NEW_LINE>fileAsset.setDescription(FileAssetAPI.DEFAULT_FILE_ASSET_STRUCTURE_DESCRIPTION);<NEW_LINE>fileAsset.setOwner(APILocator.getUserAPI().getSystemUser().getUserId());<NEW_LINE>fileAsset.setStructureType(Structure.STRUCTURE_TYPE_FILEASSET);<NEW_LINE>fileAsset.setVelocityVarName(FileAssetAPI.DEFAULT_FILE_ASSET_STRUCTURE_VELOCITY_VAR_NAME);<NEW_LINE>DotConnect dc = new DotConnect();<NEW_LINE>dc.setSQL("INSERT INTO inode (inode, owner, idate, type) values (?,?,?,?)");<NEW_LINE>dc.addParam(inode);<NEW_LINE>dc.addParam(APILocator.getUserAPI().getSystemUser().getUserId());<NEW_LINE>dc.addParam(new Date());<NEW_LINE>dc.addParam(fileAsset.getType());<NEW_LINE>dc.loadResult();<NEW_LINE>dc.setSQL("INSERT INTO structure (inode, name, fixed,system,default_structure,host, folder, description, structuretype, velocity_var_name) values (?,?,?,?,?,?,?,?,?,?)");<NEW_LINE>dc.addParam(inode);<NEW_LINE>dc.<MASK><NEW_LINE>dc.addParam(fileAsset.isFixed());<NEW_LINE>dc.addParam(false);<NEW_LINE>dc.addParam(false);<NEW_LINE>dc.addParam(fileAsset.getHost());<NEW_LINE>dc.addParam(fileAsset.getFolder());<NEW_LINE>dc.addParam(fileAsset.getDescription());<NEW_LINE>dc.addParam(fileAsset.getStructureType());<NEW_LINE>dc.addParam(fileAsset.getVelocityVarName());<NEW_LINE>dc.loadResult();<NEW_LINE>upgradeFieldTableWithModDate();<NEW_LINE>APILocator.getFileAssetAPI().createBaseFileAssetFields(fileAsset);<NEW_LINE>CacheLocator.getContentTypeCache().add(fileAsset);<NEW_LINE>return fileAsset;<NEW_LINE>}
addParam(fileAsset.getName());
733,681
public void visitToken(DetailAST ast) {<NEW_LINE>final int currentType = ast.getType();<NEW_LINE>if (!isNotRelevantSituation(ast, currentType)) {<NEW_LINE>final int[] line = getLineCodePoints(ast.getLineNo() - 1);<NEW_LINE>final int before = ast.getColumnNo() - 1;<NEW_LINE>final int after = ast.getColumnNo() + ast<MASK><NEW_LINE>if (before >= 0 && shouldCheckSeparationFromPreviousToken(ast) && !CommonUtil.isCodePointWhitespace(line, before)) {<NEW_LINE>log(ast, MSG_WS_NOT_PRECEDED, ast.getText());<NEW_LINE>}<NEW_LINE>if (after < line.length) {<NEW_LINE>final char nextChar = Character.toChars(line[after])[0];<NEW_LINE>if (shouldCheckSeparationFromNextToken(ast, nextChar) && !Character.isWhitespace(nextChar)) {<NEW_LINE>log(ast, MSG_WS_NOT_FOLLOWED, ast.getText());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.getText().length();
1,163,428
public void marshall(SamplingRuleUpdate samplingRuleUpdate, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (samplingRuleUpdate == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(samplingRuleUpdate.getRuleName(), RULENAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(samplingRuleUpdate.getRuleARN(), RULEARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(samplingRuleUpdate.getResourceARN(), RESOURCEARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(samplingRuleUpdate.getPriority(), PRIORITY_BINDING);<NEW_LINE>protocolMarshaller.marshall(samplingRuleUpdate.getFixedRate(), FIXEDRATE_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(samplingRuleUpdate.getHost(), HOST_BINDING);<NEW_LINE>protocolMarshaller.marshall(samplingRuleUpdate.getServiceName(), SERVICENAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(samplingRuleUpdate.getServiceType(), SERVICETYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(samplingRuleUpdate.getHTTPMethod(), HTTPMETHOD_BINDING);<NEW_LINE>protocolMarshaller.marshall(samplingRuleUpdate.getURLPath(), URLPATH_BINDING);<NEW_LINE>protocolMarshaller.marshall(samplingRuleUpdate.getAttributes(), ATTRIBUTES_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
samplingRuleUpdate.getReservoirSize(), RESERVOIRSIZE_BINDING);
1,661,197
private void createPortsTab() {<NEW_LINE>RowLayout rowLayout = createRowLayout();<NEW_LINE>portsTab = new Composite(tabFolder, SWT.NONE);<NEW_LINE>portsTab.setLayout(rowLayout);<NEW_LINE>GridLayout groupLayout = new GridLayout();<NEW_LINE>groupLayout.numColumns = 2;<NEW_LINE>Group timingGroup = new Group(portsTab, SWT.NONE);<NEW_LINE>timingGroup.setText(Labels.getLabel("preferences.ports.timing"));<NEW_LINE>timingGroup.setLayout(groupLayout);<NEW_LINE>GridData gridData = new GridData();<NEW_LINE>gridData.widthHint = 50;<NEW_LINE>Label label = new Label(timingGroup, SWT.NONE);<NEW_LINE>label.setText(Labels.getLabel("preferences.ports.timing.timeout"));<NEW_LINE>portTimeoutText = new Text(timingGroup, SWT.BORDER);<NEW_LINE>portTimeoutText.setLayoutData(gridData);<NEW_LINE>GridData gridData1 = new GridData();<NEW_LINE>gridData1.horizontalSpan = 2;<NEW_LINE>adaptTimeoutCheckbox = new Button(timingGroup, SWT.CHECK);<NEW_LINE>adaptTimeoutCheckbox.setText(Labels.getLabel("preferences.ports.timing.adaptTimeout"));<NEW_LINE>adaptTimeoutCheckbox.setLayoutData(gridData1);<NEW_LINE>adaptTimeoutCheckbox.addListener(SWT.Selection, event -> minPortTimeoutText.setEnabled(adaptTimeoutCheckbox.getSelection()));<NEW_LINE>label = new Label(timingGroup, SWT.NONE);<NEW_LINE>label.setText(Labels.getLabel("preferences.ports.timing.minTimeout"));<NEW_LINE>minPortTimeoutText = new Text(timingGroup, SWT.BORDER);<NEW_LINE>minPortTimeoutText.setLayoutData(gridData);<NEW_LINE>RowLayout portsLayout = new RowLayout(SWT.VERTICAL);<NEW_LINE>portsLayout.fill = true;<NEW_LINE>portsLayout.marginHeight = 2;<NEW_LINE>portsLayout.marginWidth = 2;<NEW_LINE>Group portsGroup = new Group(portsTab, SWT.NONE);<NEW_LINE>portsGroup.setText(Labels.getLabel("preferences.ports.ports"));<NEW_LINE>portsGroup.setLayout(portsLayout);<NEW_LINE>label = new Label(portsGroup, SWT.WRAP);<NEW_LINE>label.setText<MASK><NEW_LINE>// label.setLayoutData(new RowData(300, SWT.DEFAULT));<NEW_LINE>portsText = new Text(portsGroup, SWT.MULTI | SWT.BORDER | SWT.V_SCROLL);<NEW_LINE>portsText.setLayoutData(new RowData(SWT.DEFAULT, 60));<NEW_LINE>portsText.addKeyListener(new PortsTextValidationListener());<NEW_LINE>addRequestedPortsCheckbox = new Button(portsGroup, SWT.CHECK);<NEW_LINE>addRequestedPortsCheckbox.setText(Labels.getLabel("preferences.ports.addRequested"));<NEW_LINE>addRequestedPortsCheckbox.setToolTipText(Labels.getLabel("preferences.ports.addRequested.info"));<NEW_LINE>}
(Labels.getLabel("preferences.ports.portsDescription"));
1,625,080
public void paint(Graphics2D gr, Rectangle bounds) {<NEW_LINE>Paint oldPaint = gr.getPaint();<NEW_LINE>RoundRectangle2D rect = new RoundRectangle2D.Double(bounds.x + 0.5f, bounds.y + 0.5f, bounds.width - depth - 1, bounds.height - depth - 1, radius, radius);<NEW_LINE>if (drawColor != null) {<NEW_LINE>RoundRectangle2D outerRect = new RoundRectangle2D.Double(bounds.x + depth + 0.5f, bounds.y + depth + 0.5f, bounds.width - depth - 1, bounds.height - depth - 1, radius, radius);<NEW_LINE><MASK><NEW_LINE>raisedArea.subtract(new Area(rect));<NEW_LINE>gr.setPaint(SHADOW_COLOR);<NEW_LINE>gr.fill(raisedArea);<NEW_LINE>gr.setPaint(widget.getState().isSelected() ? SELECTED_BORDER_COLOR : drawColor);<NEW_LINE>Stroke s = gr.getStroke();<NEW_LINE>if (widget.getState().isFocused())<NEW_LINE>gr.setStroke(new BasicStroke(1, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND, BasicStroke.JOIN_MITER, new float[] { 2, 2 }, 0));<NEW_LINE>gr.draw(rect);<NEW_LINE>gr.setStroke(s);<NEW_LINE>}<NEW_LINE>gr.setPaint(oldPaint);<NEW_LINE>}
Area raisedArea = new Area(outerRect);
1,391,847
protected Control createDialogArea(Composite parent) {<NEW_LINE>setTitle("Select Deployment Manifest for project '" + model.getProjectName() + "'");<NEW_LINE>Composite container = (Composite) super.createDialogArea(parent);<NEW_LINE>final Composite composite = new Composite(container, parent.getStyle());<NEW_LINE>composite.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create());<NEW_LINE>composite.setLayout(new GridLayout());<NEW_LINE>createModeSwitchGroup(composite);<NEW_LINE>createFileGroup(composite);<NEW_LINE>createResizeSash(composite);<NEW_LINE>createYamlContentsGroup(composite);<NEW_LINE>if (model.supportsSsh) {<NEW_LINE>createJmxSshOptionsGroup(composite);<NEW_LINE>}<NEW_LINE>activateHandlers();<NEW_LINE>model.type.addListener(new ValueListener<ManifestType>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void gotValue(LiveExpression<ManifestType> exp, ManifestType type) {<NEW_LINE>GridData gridData;<NEW_LINE>boolean isFile = type == ManifestType.FILE;<NEW_LINE>buttonFileManifest.setSelection(isFile);<NEW_LINE>buttonManualManifest.setSelection(!isFile);<NEW_LINE>refreshButton.setEnabled(isFile && !workspaceViewer.getSelection().isEmpty());<NEW_LINE>workspaceViewer.getControl().setEnabled(isFile);<NEW_LINE>fileLabel.setEnabled(isFile);<NEW_LINE>gridData = GridDataFactory.copyData((GridData) fileGroup.getLayoutData());<NEW_LINE>gridData.exclude = !isFile;<NEW_LINE>fileGroup.setVisible(isFile);<NEW_LINE>fileGroup.setLayoutData(gridData);<NEW_LINE>gridData = GridDataFactory.copyData((GridData) resizeSash.getLayoutData());<NEW_LINE>gridData.exclude = !isFile;<NEW_LINE>resizeSash.setVisible(isFile);<NEW_LINE>resizeSash.setLayoutData(gridData);<NEW_LINE>fileGroup.getParent().layout();<NEW_LINE>fileYamlComposite.setVisible(isFile);<NEW_LINE>gridData = GridDataFactory.copyData((GridData) fileYamlComposite.getLayoutData());<NEW_LINE>gridData.exclude = !isFile;<NEW_LINE>fileYamlComposite.setLayoutData(gridData);<NEW_LINE>manualYamlComposite.setVisible(!isFile);<NEW_LINE>gridData = GridDataFactory.copyData((GridData) manualYamlComposite.getLayoutData());<NEW_LINE>gridData.exclude = isFile;<NEW_LINE>manualYamlComposite.setLayoutData(gridData);<NEW_LINE>yamlGroup.layout();<NEW_LINE>yamlGroup.getParent().layout();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>model.getValidator().addListener(new UIValueListener<ValidationResult>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void uiGotValue(LiveExpression<ValidationResult> exp, ValidationResult value) {<NEW_LINE>ValidationResult result = exp.getValue();<NEW_LINE>if (getButton(IDialogConstants.OK_ID) != null) {<NEW_LINE>getButton(IDialogConstants.OK_ID).setEnabled(result.status != IStatus.ERROR);<NEW_LINE>}<NEW_LINE>setMessage(result.msg, result.getMessageProviderStatus());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>parent.pack(true);<NEW_LINE>if (!workspaceViewer.getSelection().isEmpty()) {<NEW_LINE>workspaceViewer.setSelection(<MASK><NEW_LINE>}<NEW_LINE>return container;<NEW_LINE>}
workspaceViewer.getSelection(), true);
64,859
protected void initLineBuffers() {<NEW_LINE>boolean createBuffer = bufLineVertex == null;<NEW_LINE>if (createBuffer)<NEW_LINE>bufLineVertex = new VertexBuffer(pg, PGL.ARRAY_BUFFER, 4, PGL.SIZEOF_FLOAT, PGL.bufferUsageRetained);<NEW_LINE>pgl.bindBuffer(PGL.ARRAY_BUFFER, bufLineVertex.glId);<NEW_LINE>tessGeo.initLineVerticesBuffer(!createBuffer, true, PGL.bufferUsageRetained);<NEW_LINE>createBuffer = bufLineColor == null;<NEW_LINE>if (createBuffer)<NEW_LINE>bufLineColor = new VertexBuffer(pg, PGL.ARRAY_BUFFER, 1, PGL.SIZEOF_INT, PGL.bufferUsageRetained);<NEW_LINE>pgl.bindBuffer(PGL.ARRAY_BUFFER, bufLineColor.glId);<NEW_LINE>tessGeo.initLineColorsBuffer(!createBuffer, true, PGL.bufferUsageRetained);<NEW_LINE>createBuffer = bufLineAttrib == null;<NEW_LINE>if (createBuffer)<NEW_LINE>bufLineAttrib = new VertexBuffer(pg, PGL.ARRAY_BUFFER, 4, PGL.SIZEOF_FLOAT, PGL.bufferUsageRetained);<NEW_LINE>pgl.bindBuffer(PGL.ARRAY_BUFFER, bufLineAttrib.glId);<NEW_LINE>tessGeo.initLineDirectionsBuffer(!createBuffer, true, PGL.bufferUsageRetained);<NEW_LINE>pgl.bindBuffer(PGL.ARRAY_BUFFER, 0);<NEW_LINE>createBuffer = bufLineIndex == null;<NEW_LINE>if (createBuffer)<NEW_LINE>bufLineIndex = new VertexBuffer(pg, PGL.ELEMENT_ARRAY_BUFFER, 1, PGL.<MASK><NEW_LINE>pgl.bindBuffer(PGL.ELEMENT_ARRAY_BUFFER, bufLineIndex.glId);<NEW_LINE>tessGeo.initLineIndicesBuffer(!createBuffer, true, PGL.bufferUsageRetained);<NEW_LINE>pgl.bindBuffer(PGL.ELEMENT_ARRAY_BUFFER, 0);<NEW_LINE>}
SIZEOF_INDEX, PGL.bufferUsageRetained, true);
26,928
public String execute(SampleResult previousResult, Sampler currentSampler) throws InvalidVariableException {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>String str = "";<NEW_LINE>CompoundVariable var <MASK><NEW_LINE>String exp = var.execute();<NEW_LINE>// $NON-NLS-1$<NEW_LINE>String varName = "";<NEW_LINE>if (values.length > 1) {<NEW_LINE>varName = ((CompoundVariable) values[1]).execute().trim();<NEW_LINE>}<NEW_LINE>JMeterContext jmctx = JMeterContextService.getContext();<NEW_LINE>JMeterVariables vars = jmctx.getVariables();<NEW_LINE>try {<NEW_LINE>JexlContext jc = new MapContext();<NEW_LINE>// $NON-NLS-1$<NEW_LINE>jc.set("log", log);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>jc.set("ctx", jmctx);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>jc.set("vars", vars);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>jc.set("props", JMeterUtils.getJMeterProperties());<NEW_LINE>// Previously mis-spelt as theadName<NEW_LINE>// $NON-NLS-1$<NEW_LINE>jc.set("threadName", Thread.currentThread().getName());<NEW_LINE>// $NON-NLS-1$ (may be null)<NEW_LINE>jc.set("sampler", currentSampler);<NEW_LINE>// $NON-NLS-1$ (may be null)<NEW_LINE>jc.set("sampleResult", previousResult);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>jc.set("OUT", System.out);<NEW_LINE>// Now evaluate the script, getting the result<NEW_LINE>Script e = getJexlEngine().createScript(exp);<NEW_LINE>Object o = e.execute(jc);<NEW_LINE>if (o != null) {<NEW_LINE>str = o.toString();<NEW_LINE>}<NEW_LINE>if (vars != null && varName.length() > 0) {<NEW_LINE>// vars will be null on TestPlan<NEW_LINE>vars.put(varName, str);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.error("An error occurred while evaluating the expression \"" + exp + "\"\n", e);<NEW_LINE>}<NEW_LINE>return str;<NEW_LINE>}
= (CompoundVariable) values[0];
267,838
public void process(char character) throws UnsupportedAudioFileException, LineUnavailableException {<NEW_LINE>final float[] floatBuffer = DTMF.generateDTMFTone(character);<NEW_LINE>final AudioFormat format = new AudioFormat(44100, 16, 1, true, false);<NEW_LINE>JVMAudioInputStream.toTarsosDSPFormat(format);<NEW_LINE>final TarsosDSPAudioFloatConverter converter = TarsosDSPAudioFloatConverter.getConverter(JVMAudioInputStream.toTarsosDSPFormat(format));<NEW_LINE>final byte[] byteBuffer = new byte[floatBuffer.length * format.getFrameSize()];<NEW_LINE>converter.toByteArray(floatBuffer, byteBuffer);<NEW_LINE>final ByteArrayInputStream bais = new ByteArrayInputStream(byteBuffer);<NEW_LINE>final AudioInputStream inputStream = new AudioInputStream(bais, format, floatBuffer.length);<NEW_LINE>final TarsosDSPAudioInputStream stream = new JVMAudioInputStream(inputStream);<NEW_LINE>final AudioDispatcher dispatcher = new <MASK><NEW_LINE>dispatcher.addAudioProcessor(goertzelAudioProcessor);<NEW_LINE>dispatcher.addAudioProcessor(new AudioPlayer(format));<NEW_LINE>new Thread(dispatcher).start();<NEW_LINE>}
AudioDispatcher(stream, stepSize, 0);
1,131,382
public void unannounce(String path) {<NEW_LINE>final ZKPaths.PathAndNode pathAndNode = ZKPaths.getPathAndNode(path);<NEW_LINE>final <MASK><NEW_LINE>final ConcurrentMap<String, byte[]> subPaths = announcements.get(parentPath);<NEW_LINE>if (subPaths == null || subPaths.remove(pathAndNode.getNode()) == null) {<NEW_LINE>log.debug("Path[%s] not announced, cannot unannounce.", path);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>log.info("Unannouncing [%s]", path);<NEW_LINE>try {<NEW_LINE>curator.inTransaction().delete().forPath(path).and().commit();<NEW_LINE>} catch (KeeperException.NoNodeException e) {<NEW_LINE>log.info("Node[%s] didn't exist anyway...", path);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>}
String parentPath = pathAndNode.getPath();
1,742,663
protected RestChannelConsumer prepareRequest(RestRequest request, NodeClient client) throws IOException {<NEW_LINE>PostStartTrialRequest startTrialRequest = new PostStartTrialRequest();<NEW_LINE>startTrialRequest.setType(request.param("type", License.LicenseType.TRIAL.getTypeName()));<NEW_LINE>startTrialRequest.acknowledge(request.paramAsBoolean("acknowledge", false));<NEW_LINE>return channel -> client.execute(PostStartTrialAction.INSTANCE, startTrialRequest, new RestBuilderListener<>(channel) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public RestResponse buildResponse(PostStartTrialResponse response, XContentBuilder builder) throws Exception {<NEW_LINE>PostStartTrialResponse.Status status = response.getStatus();<NEW_LINE>builder.startObject();<NEW_LINE>builder.field("acknowledged", startTrialRequest.isAcknowledged());<NEW_LINE>if (status.isTrialStarted()) {<NEW_LINE>builder.field("trial_was_started", true);<NEW_LINE>builder.field("type", startTrialRequest.getType());<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>builder.field("error_message", status.getErrorMessage());<NEW_LINE>}<NEW_LINE>Map<String, String[]> acknowledgementMessages = response.getAcknowledgementMessages();<NEW_LINE>if (acknowledgementMessages.isEmpty() == false) {<NEW_LINE>builder.startObject("acknowledge");<NEW_LINE>builder.field("message", response.getAcknowledgementMessage());<NEW_LINE>for (Map.Entry<String, String[]> entry : acknowledgementMessages.entrySet()) {<NEW_LINE>builder.startArray(entry.getKey());<NEW_LINE>for (String message : entry.getValue()) {<NEW_LINE>builder.value(message);<NEW_LINE>}<NEW_LINE>builder.endArray();<NEW_LINE>}<NEW_LINE>builder.endObject();<NEW_LINE>}<NEW_LINE>builder.endObject();<NEW_LINE>return new BytesRestResponse(status.getRestStatus(), builder);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
builder.field("trial_was_started", false);
1,395,406
public byte[] encrypt(byte[] plain) {<NEW_LINE>try {<NEW_LINE>byte[] salt = new byte[saltSize];<NEW_LINE>SECURE_RANDOM_INSTANCE.nextBytes(salt);<NEW_LINE>SecretKey <MASK><NEW_LINE>SecretKey secret = new SecretKeySpec(tmp.getEncoded(), cipherAlgName);<NEW_LINE>// error-prone warns if the transformation is not a compile-time constant<NEW_LINE>// since it cannot check it for insecure combinations.<NEW_LINE>@SuppressWarnings("InsecureCryptoUsage")<NEW_LINE>Cipher ecipher = Cipher.getInstance(transformation);<NEW_LINE>ecipher.init(Cipher.ENCRYPT_MODE, secret);<NEW_LINE>return new EncryptedData(salt, ecipher.getParameters().getParameterSpec(IvParameterSpec.class).getIV(), ecipher.doFinal(plain)).toByteAray();<NEW_LINE>} catch (InvalidKeySpecException | NoSuchAlgorithmException | NoSuchPaddingException | InvalidKeyException | InvalidParameterSpecException | IllegalBlockSizeException | BadPaddingException ex) {<NEW_LINE>throw new RuntimeException(ex);<NEW_LINE>}<NEW_LINE>}
tmp = getKeyFromPassword(passPhrase, salt);
1,347,762
// NOI18N<NEW_LINE>@org.netbeans.api.annotations.common.SuppressWarnings(value = { "DMI_COLLECTION_OF_URLS" }, justification = "URLs have never host part")<NEW_LINE>public void run(final Result result, final SchedulerEvent event) {<NEW_LINE>final CompilationInfo info = CompilationInfo.get(result);<NEW_LINE>final ClasspathInfo cpInfo = info.getClasspathInfo();<NEW_LINE>if (cpInfo != null) {<NEW_LINE>final ClassPath src = <MASK><NEW_LINE>final ClassPath boot = cpInfo.getClassPath(PathKind.BOOT);<NEW_LINE>final ClassPath compile = cpInfo.getClassPath(PathKind.COMPILE);<NEW_LINE>if (!isIncomplete(src, boot, compile)) {<NEW_LINE>final ClassPath cachedSrc = ClasspathInfoAccessor.getINSTANCE().getCachedClassPath(cpInfo, PathKind.SOURCE);<NEW_LINE>try {<NEW_LINE>final Set<URL> unknown = new HashSet<URL>();<NEW_LINE>if (cachedSrc.entries().isEmpty() && !src.entries().isEmpty()) {<NEW_LINE>for (ClassPath.Entry entry : src.entries()) {<NEW_LINE>final URL url = entry.getURL();<NEW_LINE>if (!this.factory.firedFor.contains(url) && !JavaIndex.hasSourceCache(url, false) && FileOwnerQuery.getOwner(url.toURI()) != null) {<NEW_LINE>unknown.add(url);<NEW_LINE>this.factory.firedFor.add(url);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!unknown.isEmpty()) {<NEW_LINE>PathRegistry.getDefault().registerUnknownSourceRoots(src, unknown);<NEW_LINE>}<NEW_LINE>} catch (URISyntaxException e) {<NEW_LINE>Exceptions.printStackTrace(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
cpInfo.getClassPath(PathKind.SOURCE);
369,102
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {<NEW_LINE>View view = inflater.inflate(R.layout.fragment_flexiblespacewithimagegridview, container, false);<NEW_LINE>final ObservableGridView gridView = (ObservableGridView) view.findViewById(R.id.scroll);<NEW_LINE>// Set padding view for GridView. This is the flexible space.<NEW_LINE>View paddingView = new View(getActivity());<NEW_LINE>final int flexibleSpaceImageHeight = getResources().getDimensionPixelSize(R.dimen.flexible_space_image_height);<NEW_LINE>FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, flexibleSpaceImageHeight);<NEW_LINE>paddingView.setLayoutParams(lp);<NEW_LINE>// This is required to disable header's list selector effect<NEW_LINE>paddingView.setClickable(true);<NEW_LINE>gridView.addHeaderView(paddingView);<NEW_LINE>setDummyData(gridView);<NEW_LINE>// TouchInterceptionViewGroup should be a parent view other than ViewPager.<NEW_LINE>// This is a workaround for the issue #117:<NEW_LINE>// https://github.com/ksoichiro/Android-ObservableScrollView/issues/117<NEW_LINE>gridView.setTouchInterceptionViewGroup((ViewGroup) view.findViewById(R.id.fragment_root));<NEW_LINE>// Scroll to the specified offset after layout<NEW_LINE>Bundle args = getArguments();<NEW_LINE>if (args != null && args.containsKey(ARG_SCROLL_Y)) {<NEW_LINE>final int scrollY = <MASK><NEW_LINE>ScrollUtils.addOnGlobalLayoutListener(gridView, new Runnable() {<NEW_LINE><NEW_LINE>@SuppressLint("NewApi")<NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>int offset = scrollY % flexibleSpaceImageHeight;<NEW_LINE>setSelectionFromTop(gridView, 0, -offset);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>updateFlexibleSpace(scrollY, view);<NEW_LINE>} else {<NEW_LINE>updateFlexibleSpace(0, view);<NEW_LINE>}<NEW_LINE>gridView.setScrollViewCallbacks(this);<NEW_LINE>updateFlexibleSpace(0, view);<NEW_LINE>return view;<NEW_LINE>}
args.getInt(ARG_SCROLL_Y, 0);
1,152,338
public void build(Model model, Datas datas, String id, List<Expression> exps, List<EAnnotation> annotations) {<NEW_LINE>BoolVar[] as = exps.get(0).toBoolVarArray(model);<NEW_LINE>BoolVar[] bs = exps.get(1).toBoolVarArray(model);<NEW_LINE>BoolVar r = exps.get<MASK><NEW_LINE>int PL = as.length;<NEW_LINE>int NL = bs.length;<NEW_LINE>BoolVar[] LITS = new BoolVar[PL + NL];<NEW_LINE>System.arraycopy(as, 0, LITS, 0, PL);<NEW_LINE>for (int i = 0; i < NL; i++) {<NEW_LINE>LITS[i + PL] = bs[i].not();<NEW_LINE>}<NEW_LINE>model.sum(LITS, ">", 0).impliedBy(r);<NEW_LINE>}
(2).boolVarValue(model);
399,246
public <T extends JpaObject, W extends Object> List<T> listEqualAndInAndNotEqual(Class<T> cls, String firstAttribute, Object firstValue, String secondAttribute, Collection<W> secondValues, String thirdAttribute, Object thirdValue) throws Exception {<NEW_LINE>EntityManager em = this.get(cls);<NEW_LINE>CriteriaBuilder cb = em.getCriteriaBuilder();<NEW_LINE>CriteriaQuery<T> cq = cb.createQuery(cls);<NEW_LINE>Root<T> root = cq.from(cls);<NEW_LINE>Predicate p = cb.equal(root<MASK><NEW_LINE>p = cb.and(p, cb.isMember(root.get(secondAttribute), cb.literal(secondValues)));<NEW_LINE>p = cb.and(p, cb.notEqual(root.get(thirdAttribute), thirdValue));<NEW_LINE>List<T> os = em.createQuery(cq.select(root).where(p)).getResultList();<NEW_LINE>List<T> list = new ArrayList<>(os);<NEW_LINE>return list;<NEW_LINE>}
.get(firstAttribute), firstValue);
1,499,908
private void drawIcon(Graphics graphics) {<NEW_LINE>if (!isIconVisible()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>graphics.pushState();<NEW_LINE>graphics.setLineWidth(1);<NEW_LINE>graphics.setForegroundColor(isEnabled() ? ColorConstants.black : ColorConstants.gray);<NEW_LINE>graphics.setBackgroundColor(isEnabled() ? ColorConstants.black : ColorConstants.gray);<NEW_LINE>// triangle of shortcut glyph<NEW_LINE>Path path = new Path(null);<NEW_LINE>Point pt = getIconOrigin();<NEW_LINE>float x = pt.x - 5.4f, y = pt.y + 9f;<NEW_LINE>path.moveTo(x, y);<NEW_LINE>path.lineTo(x + 6f, y + 1f);<NEW_LINE>path.lineTo(x + 3f, y + 6.2f);<NEW_LINE>graphics.fillPath(path);<NEW_LINE>path.dispose();<NEW_LINE>// line of shortcut glyph<NEW_LINE>path = new Path(null);<NEW_LINE>graphics.setLineWidthFloat(2f);<NEW_LINE>path.addArc(pt.x - 7.5f, pt.y + 12f, 10, 10, 90, 80);<NEW_LINE>graphics.drawPath(path);<NEW_LINE>path.dispose();<NEW_LINE>// 2 circles and blob<NEW_LINE>graphics.setLineWidthFloat(1.2f);<NEW_LINE>path = new Path(null);<NEW_LINE>pt = getIconOrigin();<NEW_LINE>path.addArc(pt.x, pt.y, 13, 13, 0, 360);<NEW_LINE>path.addArc(pt.x + 2.5f, pt.y + 2.5f, 8, 8, 0, 360);<NEW_LINE>path.addArc(pt.x + 5f, pt.y + 5f, <MASK><NEW_LINE>path.addArc(pt.x + 6f, pt.y + 6f, 1f, 1f, 0, 360);<NEW_LINE>graphics.drawPath(path);<NEW_LINE>path.dispose();<NEW_LINE>graphics.popState();<NEW_LINE>}
3, 3, 0, 360);
1,459,462
public BaseConnectionParam createConnectionParams(BaseDataSourceParamDTO datasourceParam) {<NEW_LINE>HiveDataSourceParamDTO hiveParam = (HiveDataSourceParamDTO) datasourceParam;<NEW_LINE>StringBuilder address = new StringBuilder();<NEW_LINE>address.append(Constants.JDBC_HIVE_2);<NEW_LINE>for (String zkHost : hiveParam.getHost().split(",")) {<NEW_LINE>address.append(String.format("%s:%s,", zkHost, hiveParam.getPort()));<NEW_LINE>}<NEW_LINE>address.deleteCharAt(address.length() - 1);<NEW_LINE>String jdbcUrl = address.toString() + "/" + hiveParam.getDatabase();<NEW_LINE>HiveConnectionParam hiveConnectionParam = new HiveConnectionParam();<NEW_LINE>hiveConnectionParam.setDatabase(hiveParam.getDatabase());<NEW_LINE>hiveConnectionParam.setAddress(address.toString());<NEW_LINE>hiveConnectionParam.setJdbcUrl(jdbcUrl);<NEW_LINE>hiveConnectionParam.setUser(hiveParam.getUserName());<NEW_LINE>hiveConnectionParam.setPassword(PasswordUtils.encodePassword(hiveParam.getPassword()));<NEW_LINE>hiveConnectionParam.setDriverClassName(getDatasourceDriver());<NEW_LINE>hiveConnectionParam.setValidationQuery(getValidationQuery());<NEW_LINE>if (CommonUtils.getKerberosStartupState()) {<NEW_LINE>hiveConnectionParam.setPrincipal(hiveParam.getPrincipal());<NEW_LINE>hiveConnectionParam.setJavaSecurityKrb5Conf(hiveParam.getJavaSecurityKrb5Conf());<NEW_LINE>hiveConnectionParam.setLoginUserKeytabPath(hiveParam.getLoginUserKeytabPath());<NEW_LINE>hiveConnectionParam.setLoginUserKeytabUsername(hiveParam.getLoginUserKeytabUsername());<NEW_LINE>}<NEW_LINE>hiveConnectionParam.setOther(transformOther<MASK><NEW_LINE>hiveConnectionParam.setProps(hiveParam.getOther());<NEW_LINE>return hiveConnectionParam;<NEW_LINE>}
(hiveParam.getOther()));
276,422
public <T> Object execute(T... args) {<NEW_LINE>LOG.warn("Some workers are dead during upgrade, upgrade fails, rolling back...");<NEW_LINE>try {<NEW_LINE>StormBase stormBase = data.getStormClusterState().storm_base(topologyId, null);<NEW_LINE>if (stormBase.getStatus().getStatusType() == StatusType.rollback) {<NEW_LINE>LOG.warn("Topology {} is already rolling back, skip.", topologyId);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>StormClusterState stormClusterState = data.getStormClusterState();<NEW_LINE>BlobStore blobStore = data.getBlobStore();<NEW_LINE>GrayUpgradeConfig upgradeConfig = (GrayUpgradeConfig) stormClusterState.get_gray_upgrade_conf(topologyId);<NEW_LINE>if (upgradeConfig != null) {<NEW_LINE>String codeKeyBak = StormConfig.master_stormcode_bak_key(topologyId);<NEW_LINE>LOG.info("Restoring storm code with key:{}", codeKeyBak);<NEW_LINE>BlobStoreUtils.updateBlob(blobStore, StormConfig.master_stormcode_key(topologyId), blobStore.getBlob(codeKeyBak));<NEW_LINE>String stormJarKeyBak = StormConfig.master_stormjar_bak_key(topologyId);<NEW_LINE><MASK><NEW_LINE>BlobStoreUtils.updateBlob(blobStore, StormConfig.master_stormjar_key(topologyId), blobStore.getBlob(stormJarKeyBak));<NEW_LINE>upgradeConfig.setRollback(true);<NEW_LINE>stormClusterState.set_gray_upgrade_conf(topologyId, upgradeConfig);<NEW_LINE>Set<String> upgradedWorkers = Sets.newHashSet(stormClusterState.get_upgraded_workers(topologyId));<NEW_LINE>if (upgradedWorkers.size() > 0) {<NEW_LINE>LOG.info("Setting rollback workers:{}", upgradedWorkers);<NEW_LINE>for (String upgradedWorker : upgradedWorkers) {<NEW_LINE>stormClusterState.add_upgrading_worker(topologyId, upgradedWorker);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>LOG.warn("Cannot get upgrade config, aborting...");<NEW_LINE>}<NEW_LINE>return new StormStatus(StatusType.rollback);<NEW_LINE>} catch (Exception ex) {<NEW_LINE>LOG.error("Failed to call RollbackTransitionCallback!", ex);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
LOG.info("Restoring storm jar with key:{}", stormJarKeyBak);
1,031,650
private void createNormalTable(Model model) throws StorageException {<NEW_LINE>ElasticSearchClient esClient = (ElasticSearchClient) client;<NEW_LINE>String tableName = IndexController.INSTANCE.getTableName(model);<NEW_LINE>Mappings mapping = createMapping(model);<NEW_LINE>if (!esClient.isExistsIndex(tableName)) {<NEW_LINE>Map<String, Object> settings = createSetting(model);<NEW_LINE>boolean isAcknowledged = esClient.createIndex(tableName, mapping, settings);<NEW_LINE>log.info("create {} index finished, isAcknowledged: {}", tableName, isAcknowledged);<NEW_LINE>if (!isAcknowledged) {<NEW_LINE>throw new StorageException("create " + tableName + " index failure, ");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>Mappings historyMapping = esClient.getIndex(tableName).map(Index::getMappings).orElseGet(Mappings::new);<NEW_LINE>structures.putStructure(tableName, mapping);<NEW_LINE>Mappings appendMapping = <MASK><NEW_LINE>if (appendMapping.getProperties() != null && !appendMapping.getProperties().isEmpty()) {<NEW_LINE>boolean isAcknowledged = esClient.updateIndexMapping(tableName, appendMapping);<NEW_LINE>log.info("update {} index finished, isAcknowledged: {}, append mappings: {}", tableName, isAcknowledged, appendMapping);<NEW_LINE>if (!isAcknowledged) {<NEW_LINE>throw new StorageException("update " + tableName + " index failure");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
structures.diffStructure(tableName, historyMapping);
433,234
public static String toCTypeName(ResolvedJavaMethod method, ResolvedJavaType type, Optional<String> useSiteTypedef, boolean isConst, boolean isUnsigned, MetaAccessProvider metaAccess, NativeLibraries nativeLibs) {<NEW_LINE>boolean isNumericInteger = type.getJavaKind().isNumericInteger();<NEW_LINE>UserError.guarantee(isNumericInteger || !isUnsigned, "Only integer types can be unsigned. %s is not an integer type in %s", type, method);<NEW_LINE>boolean isUnsignedWord = metaAccess.lookupJavaType(UnsignedWord.class).isAssignableFrom(type);<NEW_LINE>boolean isSignedWord = metaAccess.lookupJavaType(SignedWord.class).isAssignableFrom(type);<NEW_LINE>boolean isWord = isUnsignedWord || isSignedWord;<NEW_LINE>boolean isObject = type.getJavaKind() == JavaKind.Object && !isWord;<NEW_LINE>UserError.guarantee(isObject || !isConst, "Only pointer types can be const. %s in method %s is not a pointer type.", type, method);<NEW_LINE>if (useSiteTypedef.isPresent()) {<NEW_LINE>return (isConst ? "const " : "") + useSiteTypedef.get();<NEW_LINE>} else if (isNumericInteger) {<NEW_LINE>return toCIntegerType(type, isUnsigned);<NEW_LINE>} else if (isUnsignedWord) {<NEW_LINE>return "size_t";<NEW_LINE>} else if (isSignedWord) {<NEW_LINE>return "ssize_t";<NEW_LINE>} else if (isObject) {<NEW_LINE>return (isConst ? "const " : "") + <MASK><NEW_LINE>} else {<NEW_LINE>switch(type.getJavaKind()) {<NEW_LINE>case Double:<NEW_LINE>return "double";<NEW_LINE>case Float:<NEW_LINE>return "float";<NEW_LINE>case Void:<NEW_LINE>return "void";<NEW_LINE>default:<NEW_LINE>throw shouldNotReachHere();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
cTypeForObject(type, metaAccess, nativeLibs);
900,793
static void UpdateNfaData(int maxState, int startStateName, int lexicalStateIndex, int matchAnyCharKind) {<NEW_LINE>// Cleanup the state set.<NEW_LINE>final Set<Integer> done = new HashSet<Integer>();<NEW_LINE>List<NfaState> cleanStates = new ArrayList<NfaState>();<NEW_LINE>NfaState startState = null;<NEW_LINE>for (int i = 0; i < allStates.size(); i++) {<NEW_LINE>NfaState tmp = (NfaState) allStates.get(i);<NEW_LINE>if (tmp.stateName == -1)<NEW_LINE>continue;<NEW_LINE>if (done.contains(tmp.stateName))<NEW_LINE>continue;<NEW_LINE><MASK><NEW_LINE>cleanStates.add(tmp);<NEW_LINE>if (tmp.stateName == startStateName) {<NEW_LINE>startState = tmp;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>initialStates.put(lexicalStateIndex, startState);<NEW_LINE>statesForLexicalState.put(lexicalStateIndex, cleanStates);<NEW_LINE>nfaStateOffset.put(lexicalStateIndex, maxState);<NEW_LINE>if (matchAnyCharKind > 0) {<NEW_LINE>matchAnyChar.put(lexicalStateIndex, matchAnyCharKind);<NEW_LINE>} else {<NEW_LINE>matchAnyChar.put(lexicalStateIndex, Integer.MAX_VALUE);<NEW_LINE>}<NEW_LINE>}
done.add(tmp.stateName);
1,121,374
private RequestPartitionId validateAndNormalizePartitionNames(RequestPartitionId theRequestPartitionId) {<NEW_LINE>List<Integer> ids = null;<NEW_LINE>for (int i = 0; i < theRequestPartitionId.getPartitionNames().size(); i++) {<NEW_LINE>PartitionEntity partition;<NEW_LINE>try {<NEW_LINE>partition = myPartitionConfigSvc.getPartitionByName(theRequestPartitionId.getPartitionNames<MASK><NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>String msg = myFhirContext.getLocalizer().getMessage(RequestPartitionHelperSvc.class, "unknownPartitionName", theRequestPartitionId.getPartitionNames().get(i));<NEW_LINE>throw new ResourceNotFoundException(Msg.code(1317) + msg);<NEW_LINE>}<NEW_LINE>if (theRequestPartitionId.hasPartitionIds()) {<NEW_LINE>if (partition == null) {<NEW_LINE>Validate.isTrue(theRequestPartitionId.getPartitionIds().get(i) == null, "Partition %s must not have an ID", JpaConstants.DEFAULT_PARTITION_NAME);<NEW_LINE>} else {<NEW_LINE>Validate.isTrue(Objects.equals(theRequestPartitionId.getPartitionIds().get(i), partition.getId()), "Partition name %s does not match ID %n", theRequestPartitionId.getPartitionNames().get(i), theRequestPartitionId.getPartitionIds().get(i));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (ids == null) {<NEW_LINE>ids = new ArrayList<>();<NEW_LINE>}<NEW_LINE>if (partition != null) {<NEW_LINE>ids.add(partition.getId());<NEW_LINE>} else {<NEW_LINE>ids.add(null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (ids != null) {<NEW_LINE>return RequestPartitionId.forPartitionIdsAndNames(theRequestPartitionId.getPartitionNames(), ids, theRequestPartitionId.getPartitionDate());<NEW_LINE>}<NEW_LINE>return theRequestPartitionId;<NEW_LINE>}
().get(i));
1,056,095
/* public static RuleDataSet merge(RuleDataSet original, RuleDataSet modified) {<NEW_LINE>if (modified.dataList.size() > 0) {<NEW_LINE>for (Integer integer : modified.dataList) {<NEW_LINE>if (integer > 0) {<NEW_LINE>original.dataList.add(integer);<NEW_LINE>} else {<NEW_LINE>original.dataList.remove(Integer.valueOf(-integer));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (modified.roamList.size() > 0) {<NEW_LINE>for (Integer integer : modified.roamList) {<NEW_LINE>if (integer > 0) {<NEW_LINE>original.roamList.add(integer);<NEW_LINE>} else {<NEW_LINE>original.roamList.remove(Integer.valueOf(-integer));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (modified.lanList.size() > 0) {<NEW_LINE>for (Integer integer : modified.lanList) {<NEW_LINE>if (integer > 0) {<NEW_LINE>original.lanList.add(integer);<NEW_LINE>} else {<NEW_LINE>original.lanList.remove(Integer.valueOf(-integer));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (modified.vpnList.size() > 0) {<NEW_LINE>for (Integer integer : modified.vpnList) {<NEW_LINE>if (integer > 0) {<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>original.vpnList.remove(Integer.valueOf(-integer));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (modified.wifiList.size() > 0) {<NEW_LINE>for (Integer integer : modified.wifiList) {<NEW_LINE>if (integer > 0) {<NEW_LINE>original.wifiList.add(integer);<NEW_LINE>} else {<NEW_LINE>original.wifiList.remove(Integer.valueOf(-integer));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (modified.torList.size() > 0) {<NEW_LINE>for (Integer integer : modified.torList) {<NEW_LINE>if (integer > 0) {<NEW_LINE>original.torList.add(integer);<NEW_LINE>} else {<NEW_LINE>original.torList.remove(Integer.valueOf(-integer));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return original;<NEW_LINE>}*/<NEW_LINE>private static void applyShortRules(Context ctx, List<String> cmds, boolean ipv6) {<NEW_LINE>Log.i(TAG, "Setting OUTPUT chain to DROP");<NEW_LINE>cmds.add("-P OUTPUT DROP");<NEW_LINE>Log.i(TAG, "Applying custom rules");<NEW_LINE>addCustomRules(Api.PREF_CUSTOMSCRIPT, cmds);<NEW_LINE>addInterfaceRouting(ctx, cmds, ipv6);<NEW_LINE>Log.i(TAG, "Setting OUTPUT chain to ACCEPT");<NEW_LINE>cmds.add("-P OUTPUT ACCEPT");<NEW_LINE>}
original.vpnList.add(integer);
1,328,171
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {<NEW_LINE>chosenFile = fileList.get(position).file;<NEW_LINE>File sel = new File(path + "/" + chosenFile);<NEW_LINE>Log.d(LOGTAG, "Clicked:" + chosenFile);<NEW_LINE>if (sel.isDirectory()) {<NEW_LINE>if (sel.canRead()) {<NEW_LINE>// Adds chosen directory to list<NEW_LINE>pathDirsList.add(chosenFile);<NEW_LINE>path = new File(sel + "");<NEW_LINE>Log.d(LOGTAG, "Just reloading the list");<NEW_LINE>loadFileList();<NEW_LINE>adapter.notifyDataSetChanged();<NEW_LINE>updateCurrentDirectoryTextView();<NEW_LINE>Log.d(<MASK><NEW_LINE>} else {<NEW_LINE>// if(sel.canRead()) {<NEW_LINE>showToast("Path does not exist or cannot be read");<NEW_LINE>}<NEW_LINE>// } else {//if(sel.canRead()) {<NEW_LINE>} else // if (sel.isDirectory()) {<NEW_LINE>// File picked or an empty directory message clicked<NEW_LINE>{<NEW_LINE>// if (sel.isDirectory()) {<NEW_LINE>Log.d(LOGTAG, "item clicked");<NEW_LINE>if (!directoryShownIsEmpty) {<NEW_LINE>Log.d(LOGTAG, "File selected:" + chosenFile);<NEW_LINE>returnFileFinishActivity(sel.getAbsolutePath());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// else {//if (sel.isDirectory()) {<NEW_LINE>}
LOGTAG, path.getAbsolutePath());
1,809,383
public void doSetupArtifact(String gav, ClassRealm realm) throws MalformedURLException {<NEW_LINE>String[] parts = gav.split(":");<NEW_LINE>Artifact root = system.createArtifact(parts[0], parts[1], parts[2], "pom");<NEW_LINE>ArtifactResolutionResult result;<NEW_LINE>result = system.resolve(new ArtifactResolutionRequest().setArtifact(root).setCollectionFilter(new ArtifactFilter() {<NEW_LINE><NEW_LINE>public boolean include(Artifact artifact) {<NEW_LINE>return !"polyglot-common".equals(artifact.getArtifactId()) && !"test".<MASK><NEW_LINE>}<NEW_LINE>}).setResolveRoot(true).setForceUpdate(true).setOffline(legacySupport.getSession().getRequest().isOffline()).setMirrors(legacySupport.getSession().getRequest().getMirrors()).setProxies(legacySupport.getSession().getRequest().getProxies()).setServers(legacySupport.getSession().getRequest().getServers()).setLocalRepository(legacySupport.getSession().getRequest().getLocalRepository()).setRemoteRepositories(legacySupport.getSession().getRequest().getRemoteRepositories()).setResolveTransitively(true));<NEW_LINE>// get searchable list of existing urls<NEW_LINE>Set<String> urls = new TreeSet<String>();<NEW_LINE>for (URL url : realm.getURLs()) {<NEW_LINE>urls.add(url.toString());<NEW_LINE>}<NEW_LINE>for (Artifact a : result.getArtifacts()) {<NEW_LINE>if ("jar".equals(a.getType()) && a.getFile() != null) {<NEW_LINE>URL url = a.getFile().toURI().toURL();<NEW_LINE>// add only if not already exist<NEW_LINE>if (!urls.contains(url.toString())) {<NEW_LINE>realm.addURL(a.getFile().toURI().toURL());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
equals(artifact.getScope());
1,184,996
private void waitForFutureCompletion(GroupByQuery query, List<ListenableFuture<Void>> futures, IncrementalIndex closeOnFailure) {<NEW_LINE>ListenableFuture<List<Void>> <MASK><NEW_LINE>try {<NEW_LINE>queryWatcher.registerQueryFuture(query, future);<NEW_LINE>if (QueryContexts.hasTimeout(query)) {<NEW_LINE>future.get(QueryContexts.getTimeout(query), TimeUnit.MILLISECONDS);<NEW_LINE>} else {<NEW_LINE>future.get();<NEW_LINE>}<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>log.warn(e, "Query interrupted, cancelling pending results, query id [%s]", query.getId());<NEW_LINE>GuavaUtils.cancelAll(true, future, futures);<NEW_LINE>closeOnFailure.close();<NEW_LINE>throw new QueryInterruptedException(e);<NEW_LINE>} catch (CancellationException e) {<NEW_LINE>closeOnFailure.close();<NEW_LINE>throw new QueryInterruptedException(e);<NEW_LINE>} catch (TimeoutException e) {<NEW_LINE>closeOnFailure.close();<NEW_LINE>log.info("Query timeout, cancelling pending results for query id [%s]", query.getId());<NEW_LINE>GuavaUtils.cancelAll(true, future, futures);<NEW_LINE>throw new QueryTimeoutException(StringUtils.nonStrictFormat("Query [%s] timed out", query.getId()));<NEW_LINE>} catch (ExecutionException e) {<NEW_LINE>GuavaUtils.cancelAll(true, future, futures);<NEW_LINE>closeOnFailure.close();<NEW_LINE>Throwables.propagateIfPossible(e.getCause());<NEW_LINE>throw new RuntimeException(e.getCause());<NEW_LINE>}<NEW_LINE>}
future = Futures.allAsList(futures);
1,780,609
public void mapPartition(Iterable<Row> values, Collector<Tuple2<Integer, Long>> out) throws Exception {<NEW_LINE>StreamSupport.stream(values.spliterator(), false).flatMap(x -> {<NEW_LINE>long[] counts = new long[x.getArity()];<NEW_LINE>Arrays.fill(counts, 0L);<NEW_LINE>for (int i = 0; i < x.getArity(); ++i) {<NEW_LINE>if (x.getField(i) == null || (zeroAsMissing && ((Number) x.getField(i)).doubleValue() == 0.0) || Double.isNaN(((Number) x.getField(i)).doubleValue())) {<NEW_LINE>counts[i]++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return IntStream.range(0, x.getArity()).mapToObj(y -> Tuple2.of(<MASK><NEW_LINE>}).collect(Collectors.groupingBy(x -> x.f0, Collectors.mapping(x -> x.f1, Collectors.reducing((a, b) -> a + b)))).entrySet().stream().map(x -> Tuple2.of(x.getKey(), x.getValue().get())).forEach(out::collect);<NEW_LINE>}
y, counts[y]));
1,853,061
private void initViews() {<NEW_LINE>if (mPusherPlayQRCodeFragment == null) {<NEW_LINE>mPusherPlayQRCodeFragment = new QRCodeGenerateFragment();<NEW_LINE>}<NEW_LINE>mEditInputURL = findViewById(R.id.livepusher_et_input_url);<NEW_LINE>mEditInputURL.setOnEditorActionListener(new TextView.OnEditorActionListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {<NEW_LINE>if (actionId == EditorInfo.IME_ACTION_GO || (event != null && event.getAction() == KeyEvent.ACTION_UP)) {<NEW_LINE>String url = mEditInputURL.getText()<MASK><NEW_LINE>startLivePusher(url);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>findViewById(R.id.livepusher_ibtn_back).setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>finish();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
.toString().trim();
467,752
public final CursorStatementContext cursorStatement() throws RecognitionException {<NEW_LINE>CursorStatementContext _localctx = new CursorStatementContext(_ctx, getState());<NEW_LINE><MASK><NEW_LINE>int _la;<NEW_LINE>try {<NEW_LINE>setState(4271);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>switch(_input.LA(1)) {<NEW_LINE>case CLOSE:<NEW_LINE>_localctx = new CloseCursorContext(_localctx);<NEW_LINE>enterOuterAlt(_localctx, 1);<NEW_LINE>{<NEW_LINE>setState(4256);<NEW_LINE>match(CLOSE);<NEW_LINE>setState(4257);<NEW_LINE>uid();<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case FETCH:<NEW_LINE>_localctx = new FetchCursorContext(_localctx);<NEW_LINE>enterOuterAlt(_localctx, 2);<NEW_LINE>{<NEW_LINE>setState(4258);<NEW_LINE>match(FETCH);<NEW_LINE>setState(4263);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>switch(getInterpreter().adaptivePredict(_input, 614, _ctx)) {<NEW_LINE>case 1:<NEW_LINE>{<NEW_LINE>setState(4260);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>_la = _input.LA(1);<NEW_LINE>if (_la == NEXT) {<NEW_LINE>{<NEW_LINE>setState(4259);<NEW_LINE>match(NEXT);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>setState(4262);<NEW_LINE>match(FROM);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>setState(4265);<NEW_LINE>uid();<NEW_LINE>setState(4266);<NEW_LINE>match(INTO);<NEW_LINE>setState(4267);<NEW_LINE>uidList();<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case OPEN:<NEW_LINE>_localctx = new OpenCursorContext(_localctx);<NEW_LINE>enterOuterAlt(_localctx, 3);<NEW_LINE>{<NEW_LINE>setState(4269);<NEW_LINE>match(OPEN);<NEW_LINE>setState(4270);<NEW_LINE>uid();<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new NoViableAltException(this);<NEW_LINE>}<NEW_LINE>} catch (RecognitionException re) {<NEW_LINE>_localctx.exception = re;<NEW_LINE>_errHandler.reportError(this, re);<NEW_LINE>_errHandler.recover(this, re);<NEW_LINE>} finally {<NEW_LINE>exitRule();<NEW_LINE>}<NEW_LINE>return _localctx;<NEW_LINE>}
enterRule(_localctx, 364, RULE_cursorStatement);
1,571,140
private CompletableFuture<ContainerHandle> startContainerInternal(int containerId) {<NEW_LINE>ContainerWithHandle newContainer = new ContainerWithHandle(this.factory.createStreamSegmentContainer(containerId), new SegmentContainerHandle(containerId));<NEW_LINE>ContainerWithHandle existingContainer = this.containers.putIfAbsent(containerId, newContainer);<NEW_LINE>if (existingContainer != null) {<NEW_LINE>// We had multiple concurrent calls to start this Container and some other request beat us to it.<NEW_LINE>newContainer.container.close();<NEW_LINE>throw new IllegalArgumentException(String.format("Container %d is already registered.", containerId));<NEW_LINE>}<NEW_LINE>log.info("Registered SegmentContainer {}.", containerId);<NEW_LINE>// Attempt to Start the container, but first, attach a shutdown listener so we know to unregister it when it's stopped.<NEW_LINE>Services.onStop(newContainer.container, () -> unregisterContainer(newContainer), ex -> handleContainerFailure(newContainer, ex), this.executor);<NEW_LINE>return Services.startAsync(newContainer.container, this.executor).<MASK><NEW_LINE>}
thenApply(v -> newContainer.handle);
1,556,998
public void loadSettings(DBWHandlerConfiguration configuration) {<NEW_LINE>if (isCertificatesSupported()) {<NEW_LINE>if (caCertPath != null) {<NEW_LINE>caCertPath.setText(CommonUtils.notEmpty(configuration.getStringProperty(SSLHandlerTrustStoreImpl.PROP_SSL_CA_CERT)));<NEW_LINE>}<NEW_LINE>clientCertPath.setText(CommonUtils.notEmpty(configuration.getStringProperty(SSLHandlerTrustStoreImpl.PROP_SSL_CLIENT_CERT)));<NEW_LINE>clientKeyPath.setText(CommonUtils.notEmpty(configuration.getStringProperty(SSLHandlerTrustStoreImpl.PROP_SSL_CLIENT_KEY)));<NEW_LINE>}<NEW_LINE>if (isKeystoreSupported()) {<NEW_LINE>keyStorePath.setText(CommonUtils.notEmpty(configuration.<MASK><NEW_LINE>keyStorePassword.setText(CommonUtils.notEmpty(configuration.getPassword()));<NEW_LINE>}<NEW_LINE>final SSLConfigurationMethod method;<NEW_LINE>if (isCertificatesSupported() && isKeystoreSupported()) {<NEW_LINE>method = CommonUtils.valueOf(SSLConfigurationMethod.class, configuration.getStringProperty(SSLHandlerTrustStoreImpl.PROP_SSL_METHOD), SSLConfigurationMethod.CERTIFICATES);<NEW_LINE>if (method == SSLConfigurationMethod.CERTIFICATES) {<NEW_LINE>certRadioButton.setSelection(true);<NEW_LINE>} else {<NEW_LINE>keyStoreRadioButton.setSelection(true);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>method = isCertificatesSupported() ? SSLConfigurationMethod.CERTIFICATES : SSLConfigurationMethod.KEYSTORE;<NEW_LINE>}<NEW_LINE>showMethodControls(method);<NEW_LINE>}
getStringProperty(SSLHandlerTrustStoreImpl.PROP_SSL_KEYSTORE)));
27,249
public final ILock retrieveLockForOwner(@NonNull final LockOwner lockOwner) {<NEW_LINE>Check.assumeNotNull(lockOwner.<MASK><NEW_LINE>final String sql = "SELECT " + " " + I_T_Lock.COLUMNNAME_IsAutoCleanup + ", COUNT(1) as CountLocked" + " FROM " + I_T_Lock.Table_Name + " WHERE " + " " + I_T_Lock.COLUMNNAME_Owner + "=?" + " GROUP BY " + I_T_Lock.COLUMNNAME_IsAutoCleanup;<NEW_LINE>final List<Object> sqlParams = Collections.singletonList(lockOwner.getOwnerName());<NEW_LINE>PreparedStatement pstmt = null;<NEW_LINE>ResultSet rs = null;<NEW_LINE>try {<NEW_LINE>pstmt = DB.prepareStatement(sql, ITrx.TRXNAME_None);<NEW_LINE>DB.setParameters(pstmt, sqlParams);<NEW_LINE>rs = pstmt.executeQuery();<NEW_LINE>if (rs.next()) {<NEW_LINE>final boolean autoCleanup = DisplayType.toBoolean(rs.getString(I_T_Lock.COLUMNNAME_IsAutoCleanup), false);<NEW_LINE>final int countLocked = rs.getInt("CountLocked");<NEW_LINE>final ILock lock = newLock(lockOwner, autoCleanup, countLocked);<NEW_LINE>Check.assume(!rs.next(), "More than one lock found for owner");<NEW_LINE>return lock;<NEW_LINE>}<NEW_LINE>} catch (final SQLException e) {<NEW_LINE>throw new LockFailedException("Failed loading lock for owner " + lockOwner, e).setSql(sql, sqlParams.toArray());<NEW_LINE>} finally {<NEW_LINE>DB.close(rs, pstmt);<NEW_LINE>}<NEW_LINE>throw new LockFailedException("No lock found for " + lockOwner);<NEW_LINE>}
isRealOwner(), "Lock owner shall be real owner but it was {}", lockOwner);
63,952
protected Representation toHtml(StatusInfo status) {<NEW_LINE>final StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append("<html>\n");<NEW_LINE>sb.append("<head>\n");<NEW_LINE>sb.append(" <title>Status page</title>\n");<NEW_LINE>sb.append("</head>\n");<NEW_LINE>sb.append("<body style=\"font-family: sans-serif;\">\n");<NEW_LINE>sb.append("<p style=\"font-size: 1.2em;font-weight: bold;margin: 1em 0px;\">");<NEW_LINE>sb.append(StringUtils.htmlEscape(getStatusLabel(status)));<NEW_LINE>sb.append("</p>\n");<NEW_LINE>if (status.getDescription() != null) {<NEW_LINE>sb.append("<p>");<NEW_LINE>sb.append(StringUtils.htmlEscape(status.getDescription()));<NEW_LINE>sb.append("</p>\n");<NEW_LINE>}<NEW_LINE>sb.append("<p>You can get technical details <a href=\"");<NEW_LINE>sb.append(status.getUri());<NEW_LINE>sb.append("\">here</a>.<br>\n");<NEW_LINE>if (status.getContactEmail() != null) {<NEW_LINE>sb.append("For further assistance, you can contact the <a href=\"mailto:");<NEW_LINE>sb.append(status.getContactEmail());<NEW_LINE>sb.append("\">administrator</a>.<br>\n");<NEW_LINE>}<NEW_LINE>if (status.getHomeRef() != null) {<NEW_LINE>sb.append("Please continue your visit at our <a href=\"");<NEW_LINE>sb.<MASK><NEW_LINE>sb.append("\">home page</a>.\n");<NEW_LINE>}<NEW_LINE>sb.append("</p>\n");<NEW_LINE>sb.append("</body>\n");<NEW_LINE>sb.append("</html>\n");<NEW_LINE>return new StringRepresentation(sb.toString(), MediaType.TEXT_HTML);<NEW_LINE>}
append(status.getHomeRef());
1,518,320
public void actionPerformed(@NotNull AnActionEvent e) {<NEW_LINE>final AnAction action = ActionManager.getInstance().getAction("ExtractMethod");<NEW_LINE>if (action != null) {<NEW_LINE>final FlutterOutline outline = getWidgetOutline();<NEW_LINE>if (outline != null) {<NEW_LINE>TransactionGuard.submitTransaction(project, () -> {<NEW_LINE>final Editor editor = getCurrentEditor();<NEW_LINE>if (editor == null) {<NEW_LINE>// It is a race condition if we hit this. Gracefully assume<NEW_LINE>// the action has just been canceled.<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final OutlineOffsetConverter converter = new OutlineOffsetConverter(project, activeFile.getValue());<NEW_LINE>final int offset = converter.getConvertedOutlineOffset(outline);<NEW_LINE>editor.<MASK><NEW_LINE>final JComponent editorComponent = editor.getComponent();<NEW_LINE>final DataContext editorContext = DataManager.getInstance().getDataContext(editorComponent);<NEW_LINE>final AnActionEvent editorEvent = AnActionEvent.createFromDataContext(ActionPlaces.UNKNOWN, null, editorContext);<NEW_LINE>action.actionPerformed(editorEvent);<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
getCaretModel().moveToOffset(offset);