idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
1,660,471
static Object toJsonValue(final Object cqlValue) {<NEW_LINE>if (// Large numbers can cause JSON interoperability issues, for example Javascript only handles<NEW_LINE>cqlValue instanceof UUID || cqlValue instanceof CqlDuration || // integers in the range [-(2**53)+1, (2**53)-1].<NEW_LINE>cqlValue instanceof Long || cqlValue instanceof BigInteger || cqlValue instanceof BigDecimal) {<NEW_LINE>return cqlValue.toString();<NEW_LINE>}<NEW_LINE>if (cqlValue instanceof InetAddress) {<NEW_LINE>return ((InetAddress) cqlValue).getHostAddress();<NEW_LINE>}<NEW_LINE>if (cqlValue instanceof Collection) {<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>Collection<Object> cqlCollection = (Collection<Object>) cqlValue;<NEW_LINE>return cqlCollection.stream().map(Converters::toJsonValue).collect(Collectors.toList());<NEW_LINE>}<NEW_LINE>if (cqlValue instanceof Map) {<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>Map<Object, Object> cqlMap = (Map<Object, Object>) cqlValue;<NEW_LINE>return cqlMap.entrySet().stream().map(entry -> ImmutableMap.of("key", toJsonValue(entry.getKey()), "value", toJsonValue(entry.getValue()))).collect(Collectors.toList());<NEW_LINE>}<NEW_LINE>if (cqlValue instanceof UdtValue) {<NEW_LINE>UdtValue udtValue = (UdtValue) cqlValue;<NEW_LINE>com.datastax.oss.driver.api.core.type.<MASK><NEW_LINE>Map<String, Object> jsonObject = Maps.newLinkedHashMapWithExpectedSize(udtValue.size());<NEW_LINE>for (int i = 0; i < udtValue.size(); i++) {<NEW_LINE>CqlIdentifier fieldName = udtType.getFieldNames().get(i);<NEW_LINE>jsonObject.put(fieldName.asInternal(), toJsonValue(udtValue.getObject(fieldName)));<NEW_LINE>}<NEW_LINE>return jsonObject;<NEW_LINE>}<NEW_LINE>if (cqlValue instanceof TupleValue) {<NEW_LINE>TupleValue tupleValue = (TupleValue) cqlValue;<NEW_LINE>List<Object> jsonArray = Lists.newArrayListWithCapacity(tupleValue.size());<NEW_LINE>for (int i = 0; i < tupleValue.size(); i++) {<NEW_LINE>jsonArray.add(toJsonValue(tupleValue.getObject(i)));<NEW_LINE>}<NEW_LINE>return jsonArray;<NEW_LINE>}<NEW_LINE>// This covers null, booleans, strings, the remaining number types, blobs (which Jackson already<NEW_LINE>// converts to base64 natively), and time types (which are handled by registering JavaTimeModule<NEW_LINE>// with the object mapper -- see Server.java).<NEW_LINE>return cqlValue;<NEW_LINE>}
UserDefinedType udtType = udtValue.getType();
766,693
// List cannot contain duplicated byPropertyName()<NEW_LINE>private List<springfox.documentation.schema.ModelProperty> propertiesFor(ResolvedType type, ModelContext givenContext, String namePrefix) {<NEW_LINE>Set<springfox.documentation.schema.ModelProperty> properties = new TreeSet<>(byPropertyName());<NEW_LINE>BeanDescription <MASK><NEW_LINE>Map<String, BeanPropertyDefinition> propertyLookup = beanDescription.findProperties().stream().collect(toMap(beanPropertyByInternalName(), identity()));<NEW_LINE>for (Map.Entry<String, BeanPropertyDefinition> each : propertyLookup.entrySet()) {<NEW_LINE>LOG.debug("Reading property {}", each.getKey());<NEW_LINE>BeanPropertyDefinition jacksonProperty = each.getValue();<NEW_LINE>Optional<AnnotatedMember> annotatedMember = ofNullable(safeGetPrimaryMember(jacksonProperty, givenContext));<NEW_LINE>annotatedMember.ifPresent(member -> properties.addAll(candidateProperties(type, member, jacksonProperty, givenContext, namePrefix)));<NEW_LINE>}<NEW_LINE>return new ArrayList<>(properties);<NEW_LINE>}
beanDescription = beanDescription(type, givenContext);
178,112
public static List<com.appsmith.external.constants.DataType> extractExplicitCasting(String query) {<NEW_LINE>Matcher matcher = questionWithCastPattern.matcher(query);<NEW_LINE>List<com.appsmith.external.constants.DataType> <MASK><NEW_LINE>while (matcher.find()) {<NEW_LINE>String prospectiveDataType = matcher.group(1);<NEW_LINE>if (prospectiveDataType != null) {<NEW_LINE>String dataTypeFromInput = prospectiveDataType.trim().toLowerCase();<NEW_LINE>if (dataType.getDataTypes().contains(dataTypeFromInput)) {<NEW_LINE>com.appsmith.external.constants.DataType appsmithDataType = (com.appsmith.external.constants.DataType) getDataTypeMapper().get(dataTypeFromInput);<NEW_LINE>inputDataTypes.add(appsmithDataType);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Either no external casting exists or unsupported data type is being used. Do not use external casting for this<NEW_LINE>// and instead default to implicit type casting (default behaviour) by setting the entry to null.<NEW_LINE>inputDataTypes.add(null);<NEW_LINE>}<NEW_LINE>return inputDataTypes;<NEW_LINE>}
inputDataTypes = new ArrayList<>();
1,754,155
private void validateTupleValue(TomlNode value, String variableName, TupleType tupleType) {<NEW_LINE>value = getValueFromKeyValueNode(value);<NEW_LINE>if (!checkEffectiveTomlType(value.kind(), tupleType, variableName)) {<NEW_LINE>throwTypeIncompatibleError(value, variableName, tupleType);<NEW_LINE>}<NEW_LINE>visitedNodes.add(value);<NEW_LINE>List<TomlValueNode> elements = ((TomlArrayValueNode) value).elements();<NEW_LINE>List<Type> tupleElementTypes = tupleType.getTupleTypes();<NEW_LINE>int tomlSize = elements.size();<NEW_LINE>int tupleSize = tupleElementTypes.size();<NEW_LINE>if (tomlSize != tupleSize && tupleType.getRestType() == null) {<NEW_LINE>invalidTomlLines.add(value.<MASK><NEW_LINE>throw new ConfigException(CONFIG_SIZE_MISMATCH, getLineRange(value), variableName, tupleSize, tomlSize);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < tomlSize; i++) {<NEW_LINE>Type elementType = Utils.getTupleElementType(tupleElementTypes, i, tupleType);<NEW_LINE>TomlValueNode tomlElement = elements.get(i);<NEW_LINE>String elementName = variableName + "[" + i + "]";<NEW_LINE>if (isSimpleType(elementType.getTag()) || isXMLType(elementType)) {<NEW_LINE>validateSimpleValue(elementName, elementType, tomlElement);<NEW_LINE>} else {<NEW_LINE>validateStructuredValue(tomlElement, elementName, elementType);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
location().lineRange());
491,636
public StockMove createStockMove(Address fromAddress, Address toAddress, Company company, Partner clientPartner, StockLocation fromStockLocation, StockLocation toStockLocation, LocalDate realDate, LocalDate estimatedDate, String note, ShipmentMode shipmentMode, FreightCarrierMode freightCarrierMode, Partner carrierPartner, Partner forwarderPartner, Incoterm incoterm, int typeSelect) throws AxelorException {<NEW_LINE>StockMove stockMove = this.createStockMove(fromAddress, toAddress, company, fromStockLocation, toStockLocation, realDate, estimatedDate, note, typeSelect);<NEW_LINE>stockMove.setPartner(clientPartner);<NEW_LINE>stockMove.setShipmentMode(shipmentMode);<NEW_LINE>stockMove.setFreightCarrierMode(freightCarrierMode);<NEW_LINE>stockMove.setCarrierPartner(carrierPartner);<NEW_LINE>stockMove.setForwarderPartner(forwarderPartner);<NEW_LINE>stockMove.setIncoterm(incoterm);<NEW_LINE>stockMove.setNote(note);<NEW_LINE>stockMove.setIsIspmRequired(stockMoveToolService<MASK><NEW_LINE>return stockMove;<NEW_LINE>}
.getDefaultISPM(clientPartner, toAddress));
1,655,366
public Request<RevokeClientVpnIngressRequest> marshall(RevokeClientVpnIngressRequest revokeClientVpnIngressRequest) {<NEW_LINE>if (revokeClientVpnIngressRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<RevokeClientVpnIngressRequest> request = new DefaultRequest<RevokeClientVpnIngressRequest>(revokeClientVpnIngressRequest, "AmazonEC2");<NEW_LINE>request.addParameter("Action", "RevokeClientVpnIngress");<NEW_LINE>request.addParameter("Version", "2016-11-15");<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>if (revokeClientVpnIngressRequest.getClientVpnEndpointId() != null) {<NEW_LINE>request.addParameter("ClientVpnEndpointId", StringUtils.fromString(revokeClientVpnIngressRequest.getClientVpnEndpointId()));<NEW_LINE>}<NEW_LINE>if (revokeClientVpnIngressRequest.getTargetNetworkCidr() != null) {<NEW_LINE>request.addParameter("TargetNetworkCidr", StringUtils.fromString<MASK><NEW_LINE>}<NEW_LINE>if (revokeClientVpnIngressRequest.getAccessGroupId() != null) {<NEW_LINE>request.addParameter("AccessGroupId", StringUtils.fromString(revokeClientVpnIngressRequest.getAccessGroupId()));<NEW_LINE>}<NEW_LINE>if (revokeClientVpnIngressRequest.getRevokeAllGroups() != null) {<NEW_LINE>request.addParameter("RevokeAllGroups", StringUtils.fromBoolean(revokeClientVpnIngressRequest.getRevokeAllGroups()));<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
(revokeClientVpnIngressRequest.getTargetNetworkCidr()));
427,628
protected void updateTitle() {<NEW_LINE>// different naming for global and local sheets<NEW_LINE>Mode ourMode = WindowManager.<MASK><NEW_LINE>String nodeTitle = null;<NEW_LINE>// Fix a bug #12890, copy the nodes to prevent race condition.<NEW_LINE>List<Node> copyNodes = new ArrayList<Node>(Arrays.asList(nodes));<NEW_LINE>Node node = null;<NEW_LINE>if (!copyNodes.isEmpty()) {<NEW_LINE>node = copyNodes.get(0);<NEW_LINE>}<NEW_LINE>if (node == null) {<NEW_LINE>// NOI18N<NEW_LINE>nodeTitle = "";<NEW_LINE>} else {<NEW_LINE>nodeTitle = node.getDisplayName();<NEW_LINE>Object alternativeDisplayName = node.getValue(PROP_LONGER_DISPLAY_NAME);<NEW_LINE>if (alternativeDisplayName instanceof String) {<NEW_LINE>nodeTitle = (String) alternativeDisplayName;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Object[] titleParams = new Object[] { Integer.valueOf(copyNodes.size()), nodeTitle };<NEW_LINE>// different naming if docked in properties mode<NEW_LINE>if ((ourMode != null) && ("properties".equals(ourMode.getName()))) {<NEW_LINE>// NOI18N<NEW_LINE>if (globalPropertiesFormat == null) {<NEW_LINE>globalPropertiesFormat = new MessageFormat(NbBundle.getMessage(NbSheet.class, "CTL_FMT_GlobalProperties"));<NEW_LINE>}<NEW_LINE>setName(globalPropertiesFormat.format(titleParams));<NEW_LINE>} else {<NEW_LINE>if (localPropertiesFormat == null) {<NEW_LINE>localPropertiesFormat = new MessageFormat(NbBundle.getMessage(NbSheet.class, "CTL_FMT_LocalProperties"));<NEW_LINE>}<NEW_LINE>setName(localPropertiesFormat.format(titleParams));<NEW_LINE>}<NEW_LINE>setToolTipText(getName());<NEW_LINE>}
getDefault().findMode(this);
397,809
public Size apply(MethodVisitor methodVisitor, Context implementationContext, MethodDescription instrumentedMethod) {<NEW_LINE>TypeDescription instrumentedType = instrumentedMethod.getDeclaringType().asErasure();<NEW_LINE>MethodDescription enumConstructor = instrumentedType.getDeclaredMethods().filter(isConstructor().and(takesArguments(String.class, int.class))).getOnly();<NEW_LINE>int ordinal = 0;<NEW_LINE><MASK><NEW_LINE>List<FieldDescription> enumerationFields = new ArrayList<FieldDescription>(values.size());<NEW_LINE>for (String value : values) {<NEW_LINE>FieldDescription fieldDescription = instrumentedType.getDeclaredFields().filter(named(value)).getOnly();<NEW_LINE>stackManipulation = new StackManipulation.Compound(stackManipulation, TypeCreation.of(instrumentedType), Duplication.SINGLE, new TextConstant(value), IntegerConstant.forValue(ordinal++), MethodInvocation.invoke(enumConstructor), FieldAccess.forField(fieldDescription).write());<NEW_LINE>enumerationFields.add(fieldDescription);<NEW_LINE>}<NEW_LINE>List<StackManipulation> fieldGetters = new ArrayList<StackManipulation>(values.size());<NEW_LINE>for (FieldDescription fieldDescription : enumerationFields) {<NEW_LINE>fieldGetters.add(FieldAccess.forField(fieldDescription).read());<NEW_LINE>}<NEW_LINE>stackManipulation = new StackManipulation.Compound(stackManipulation, ArrayFactory.forType(instrumentedType.asGenericType()).withValues(fieldGetters), FieldAccess.forField(instrumentedType.getDeclaredFields().filter(named(ENUM_VALUES)).getOnly()).write());<NEW_LINE>return new Size(stackManipulation.apply(methodVisitor, implementationContext).getMaximalSize(), instrumentedMethod.getStackSize());<NEW_LINE>}
StackManipulation stackManipulation = StackManipulation.Trivial.INSTANCE;
1,341,535
protected void compute() {<NEW_LINE>if (endPos <= startPos) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (endPos - startPos <= maxPartsInSingleFile) {<NEW_LINE>try {<NEW_LINE>process(matrix, matrixPath, fs, action, partIds, context, startPos, endPos, dataFilesMeta);<NEW_LINE>} catch (Throwable x) {<NEW_LINE>LOG.error(action + " model partitions failed.", x);<NEW_LINE>errorMsgs.add(action + " model partitions failed." + x.getMessage());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>int middle = (startPos + endPos) / 2;<NEW_LINE>PartitionDiskOp opLeft = new PartitionDiskOp(matrix, fs, matrixPath, action, partIds, context, dataFilesMeta, <MASK><NEW_LINE>PartitionDiskOp opRight = new PartitionDiskOp(matrix, fs, matrixPath, action, partIds, context, dataFilesMeta, errorMsgs, middle, endPos, maxPartsInSingleFile);<NEW_LINE>invokeAll(opLeft, opRight);<NEW_LINE>}<NEW_LINE>}
errorMsgs, startPos, middle, maxPartsInSingleFile);
1,487,120
public void deleteAsync(DataStore dataStore, DataObject dataObject, AsyncCompletionCallback<CommandResult> callback) {<NEW_LINE>String errMsg = null;<NEW_LINE>StoragePoolVO storagePool = _storagePoolDao.findById(dataStore.getId());<NEW_LINE>// if the primary storage is not managed(thick provisioned) then no need<NEW_LINE>// to delete volume at elastistor, just<NEW_LINE>// call the super(default) to delete a vdi(disk) only.<NEW_LINE>if (!(storagePool.isManaged())) {<NEW_LINE>super.deleteAsync(dataStore, dataObject, callback);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (dataObject.getType() == DataObjectType.VOLUME) {<NEW_LINE>VolumeInfo volumeInfo = (VolumeInfo) dataObject;<NEW_LINE>long storagePoolId = dataStore.getId();<NEW_LINE>boolean result = false;<NEW_LINE>try {<NEW_LINE>result = ElastistorUtil.deleteElastistorVolume(volumeInfo.getUuid());<NEW_LINE>} catch (Throwable e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>CommandResult result2 = new CommandResult();<NEW_LINE>result2.setResult(e.toString());<NEW_LINE>callback.complete(result2);<NEW_LINE>}<NEW_LINE>if (result) {<NEW_LINE>long usedBytes = storagePool.getUsedBytes();<NEW_LINE>long capacityIops = storagePool.getCapacityIops();<NEW_LINE>usedBytes -= volumeInfo.getSize();<NEW_LINE>capacityIops += volumeInfo.getMaxIops();<NEW_LINE>storagePool.setUsedBytes(usedBytes < 0 ? 0 : usedBytes);<NEW_LINE>storagePool.setCapacityIops(capacityIops < 0 ? 0 : capacityIops);<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>errMsg = "Invalid DataObjectType (" + dataObject.getType() + ") passed to deleteAsync";<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>errMsg = "Invalid DataObjectType (" + dataObject.getType() + ") passed to deleteAsync";<NEW_LINE>}<NEW_LINE>CommandResult result = new CommandResult();<NEW_LINE>result.setResult(errMsg);<NEW_LINE>callback.complete(result);<NEW_LINE>}
_storagePoolDao.update(storagePoolId, storagePool);
1,586,092
public void populateItem(final Item<RepositoryUrl> repoLinkItem) {<NEW_LINE>RepositoryUrl repoUrl = repoLinkItem.getModelObject();<NEW_LINE>Fragment fragment = new Fragment("actionItem", "actionFragment", this);<NEW_LINE>fragment.add<MASK><NEW_LINE>if (!StringUtils.isEmpty(clientApp.cloneUrl)) {<NEW_LINE>// custom registered url<NEW_LINE>String url = substitute(clientApp.cloneUrl, repoUrl.url, baseURL, user.username, repository.name);<NEW_LINE>fragment.add(new LinkPanel("content", "applicationMenuItem", getString("gb.clone") + " " + repoUrl.url, url));<NEW_LINE>repoLinkItem.add(fragment);<NEW_LINE>fragment.add(new Label("copyFunction").setVisible(false));<NEW_LINE>} else if (!StringUtils.isEmpty(clientApp.command)) {<NEW_LINE>// command-line<NEW_LINE>String command = substitute(clientApp.command, repoUrl.url, baseURL, user.username, repository.name);<NEW_LINE>Label content = new Label("content", command);<NEW_LINE>WicketUtils.setCssClass(content, "commandMenuItem");<NEW_LINE>fragment.add(content);<NEW_LINE>repoLinkItem.add(fragment);<NEW_LINE>// copy function for command<NEW_LINE>fragment.add(createCopyFragment(command));<NEW_LINE>}<NEW_LINE>}
(createPermissionBadge("permission", repoUrl));
865,171
public static void main(final String[] args, final Configuration configuration) throws Exception {<NEW_LINE>HeroicLogging.configure();<NEW_LINE>Thread.setDefaultUncaughtExceptionHandler((t, e) -> {<NEW_LINE>try {<NEW_LINE>log.error("Uncaught exception in thread {}, exiting...", t, e);<NEW_LINE>} finally {<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>final Parameters params = parseArguments(args);<NEW_LINE>if (params == null) {<NEW_LINE>System.exit(0);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final HeroicCore.Builder builder = HeroicCore.builder();<NEW_LINE>configureBuilder(builder, params);<NEW_LINE>try {<NEW_LINE>loadResourceConfigurations(builder, params);<NEW_LINE>} catch (final ResourceException e) {<NEW_LINE>log.error("Failed to load configurators from resource: {}", e.getMessage(), e);<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>final HeroicCore core = builder.build();<NEW_LINE>final HeroicCoreInstance instance;<NEW_LINE>try {<NEW_LINE>instance = core.newInstance();<NEW_LINE>} catch (final Exception e) {<NEW_LINE>log.error("Failed to create Heroic instance", e);<NEW_LINE>System.exit(1);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>instance.start().get();<NEW_LINE>} catch (final Exception e) {<NEW_LINE>log.error("Failed to start Heroic instance", e);<NEW_LINE>System.exit(1);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final Thread shutdown = new Thread(instance::shutdown);<NEW_LINE>shutdown.setName("heroic-shutdown-hook");<NEW_LINE>instance<MASK><NEW_LINE>log.info("Shutting down, bye bye!");<NEW_LINE>System.exit(0);<NEW_LINE>}
.join().get();
1,315,505
public SSTNode registerGlobal(String[] names, int startOffset, int endOffset) {<NEW_LINE>ScopeInfo scopeInfo = scopeEnvironment.getCurrentScope();<NEW_LINE><MASK><NEW_LINE>for (String name : names) {<NEW_LINE>if (scopeInfo.isExplicitNonlocalVariable(name)) {<NEW_LINE>throw errors.raiseInvalidSyntax(source, createSourceSection(startOffset, endOffset), ErrorMessages.NONLOCAL_AND_GLOBAL, name);<NEW_LINE>}<NEW_LINE>if (scopeInfo.findFrameSlot(name) != null) {<NEW_LINE>// The expectation is that in the local context the variable can not have slot yet.<NEW_LINE>// The slot is created by assignment or declaration<NEW_LINE>throw errors.raiseInvalidSyntax(source, createSourceSection(startOffset, endOffset), ErrorMessages.NAME_IS_ASSIGNED_BEFORE_GLOBAL, name);<NEW_LINE>}<NEW_LINE>if (scopeInfo.getSeenVars() != null && scopeInfo.getSeenVars().contains(name)) {<NEW_LINE>throw errors.raiseInvalidSyntax(source, createSourceSection(startOffset, endOffset), ErrorMessages.NAME_IS_USED_BEFORE_GLOBAL, name);<NEW_LINE>}<NEW_LINE>scopeInfo.addExplicitGlobalVariable(name);<NEW_LINE>// place the global variable into global space, see test_global_statemnt.py<NEW_LINE>globalScope.addExplicitGlobalVariable(name);<NEW_LINE>}<NEW_LINE>return new SimpleSSTNode(SimpleSSTNode.Type.EMPTY, startOffset, endOffset);<NEW_LINE>}
ScopeInfo globalScope = scopeEnvironment.getGlobalScope();
1,769,952
private NotificationDto migrateAlarmCallback(Document alarmCallback) {<NEW_LINE>final String title = alarmCallback.getString("title");<NEW_LINE>final String type = alarmCallback.getString("type");<NEW_LINE>final Document configDoc = (Document) alarmCallback.get("configuration");<NEW_LINE>final Map<String, Object> configuration = configDoc.entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));<NEW_LINE>final LegacyAlarmCallbackEventNotificationConfig config = LegacyAlarmCallbackEventNotificationConfig.builder().callbackType(type).configuration(configuration).build();<NEW_LINE>final NotificationDto dto = NotificationDto.builder().title(firstNonNull(title, "Untitled")).description("Migrated legacy alarm callback").config(config).build();<NEW_LINE>LOG.info("Migrate legacy alarm callback <{}>", dto.title());<NEW_LINE>return notificationResourceHandler.create(<MASK><NEW_LINE>}
dto, userService.getRootUser());
244,844
public void initVariableTypes() {<NEW_LINE>if (variableTypes == null) {<NEW_LINE>variableTypes = new DefaultVariableTypes();<NEW_LINE>if (customPreVariableTypes != null) {<NEW_LINE>for (VariableType customVariableType : customPreVariableTypes) {<NEW_LINE>variableTypes.addType(customVariableType);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>variableTypes.addType(new NullType());<NEW_LINE>variableTypes.addType(new StringType(getMaxLengthString()));<NEW_LINE>variableTypes.addType(new LongStringType(getMaxLengthString() + 1));<NEW_LINE>variableTypes.addType(new BooleanType());<NEW_LINE>variableTypes.addType(new ShortType());<NEW_LINE>variableTypes.addType(new IntegerType());<NEW_LINE>variableTypes.addType(new LongType());<NEW_LINE>variableTypes.addType(new DateType());<NEW_LINE>variableTypes.addType(new InstantType());<NEW_LINE>variableTypes.addType(new LocalDateType());<NEW_LINE>variableTypes.addType(new LocalDateTimeType());<NEW_LINE>variableTypes.addType(new JodaDateType());<NEW_LINE>variableTypes.addType(new JodaDateTimeType());<NEW_LINE>variableTypes.addType(new DoubleType());<NEW_LINE>variableTypes.addType(new UUIDType());<NEW_LINE>variableTypes.addType(new JsonType(getMaxLengthString(), objectMapper, jsonVariableTypeTrackObjects));<NEW_LINE>// longJsonType only needed for reading purposes<NEW_LINE>variableTypes.addType(JsonType.longJsonType(getMaxLengthString(), objectMapper, jsonVariableTypeTrackObjects));<NEW_LINE>variableTypes.addType(new ByteArrayType());<NEW_LINE>variableTypes.addType(new EmptyCollectionType());<NEW_LINE>variableTypes.<MASK><NEW_LINE>if (customPostVariableTypes != null) {<NEW_LINE>for (VariableType customVariableType : customPostVariableTypes) {<NEW_LINE>variableTypes.addType(customVariableType);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
addType(new SerializableType(serializableVariableTypeTrackDeserializedObjects));
998,806
void analyze(Locals locals) {<NEW_LINE>if (block == null) {<NEW_LINE>throw createError(new IllegalArgumentException("Extraneous try statement."));<NEW_LINE>}<NEW_LINE>block.lastSource = lastSource;<NEW_LINE>block.inLoop = inLoop;<NEW_LINE>block.lastLoop = lastLoop;<NEW_LINE>block.analyze<MASK><NEW_LINE>methodEscape = block.methodEscape;<NEW_LINE>loopEscape = block.loopEscape;<NEW_LINE>allEscape = block.allEscape;<NEW_LINE>anyContinue = block.anyContinue;<NEW_LINE>anyBreak = block.anyBreak;<NEW_LINE>int statementCount = 0;<NEW_LINE>for (SCatch catc : catches) {<NEW_LINE>catc.lastSource = lastSource;<NEW_LINE>catc.inLoop = inLoop;<NEW_LINE>catc.lastLoop = lastLoop;<NEW_LINE>catc.analyze(Locals.newLocalScope(locals));<NEW_LINE>methodEscape &= catc.methodEscape;<NEW_LINE>loopEscape &= catc.loopEscape;<NEW_LINE>allEscape &= catc.allEscape;<NEW_LINE>anyContinue |= catc.anyContinue;<NEW_LINE>anyBreak |= catc.anyBreak;<NEW_LINE>statementCount = Math.max(statementCount, catc.statementCount);<NEW_LINE>}<NEW_LINE>this.statementCount = block.statementCount + statementCount;<NEW_LINE>}
(Locals.newLocalScope(locals));
1,141,905
protected void update() {<NEW_LINE>Widget container = chatboxPanelManager.getContainerWidget();<NEW_LINE>container.deleteAllChildren();<NEW_LINE>Widget promptWidget = container.createChild(-1, WidgetType.TEXT);<NEW_LINE><MASK><NEW_LINE>promptWidget.setTextColor(0x800000);<NEW_LINE>promptWidget.setFontId(fontID);<NEW_LINE>promptWidget.setXPositionMode(WidgetPositionMode.ABSOLUTE_CENTER);<NEW_LINE>promptWidget.setOriginalX(0);<NEW_LINE>promptWidget.setYPositionMode(WidgetPositionMode.ABSOLUTE_TOP);<NEW_LINE>promptWidget.setOriginalY(8);<NEW_LINE>promptWidget.setOriginalHeight(24);<NEW_LINE>promptWidget.setXTextAlignment(WidgetTextAlignment.CENTER);<NEW_LINE>promptWidget.setYTextAlignment(WidgetTextAlignment.CENTER);<NEW_LINE>promptWidget.setWidthMode(WidgetSizeMode.MINUS);<NEW_LINE>promptWidget.revalidate();<NEW_LINE>buildEdit(0, 50, container.getWidth(), 0);<NEW_LINE>}
promptWidget.setText(this.prompt);
1,512,796
private void initMap(Map<String, Map<String, Long>> mapWithValue, Map<QuotaResource, Long> mapToInit) {<NEW_LINE>for (Map.Entry<String, Map<String, Long>> mapEntry : mapWithValue.entrySet()) {<NEW_LINE>Account account = accountService.getAccountById(Short.valueOf(mapEntry.getKey()));<NEW_LINE>if (account != null) {<NEW_LINE>if (account.getQuotaResourceType() == QuotaResourceType.ACCOUNT) {<NEW_LINE>// Put this in account storage usage<NEW_LINE>long accountUsage = mapEntry.getValue().values().stream().mapToLong(Long::longValue).sum();<NEW_LINE>mapToInit.put(QuotaResource.fromAccount(account), accountUsage);<NEW_LINE>} else {<NEW_LINE>for (Map.Entry<String, Long> innerMapEntry : mapEntry.getValue().entrySet()) {<NEW_LINE>// Replace the value in the map anyway.<NEW_LINE>Container container = account.getContainerById(Short.valueOf(innerMapEntry.getKey()));<NEW_LINE>if (container != null) {<NEW_LINE>mapToInit.put(QuotaResource.fromContainer(container<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
), innerMapEntry.getValue());
1,127,969
final GetStreamingDistributionResult executeGetStreamingDistribution(GetStreamingDistributionRequest getStreamingDistributionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getStreamingDistributionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetStreamingDistributionRequest> request = null;<NEW_LINE>Response<GetStreamingDistributionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetStreamingDistributionRequestMarshaller().marshall(super.beforeMarshalling(getStreamingDistributionRequest));<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, "CloudFront");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetStreamingDistribution");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<GetStreamingDistributionResult> responseHandler = new StaxResponseHandler<<MASK><NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
GetStreamingDistributionResult>(new GetStreamingDistributionResultStaxUnmarshaller());
238,503
public void apply(RuleContext ctx) {<NEW_LINE>double deviation;<NEW_LINE>double minimum = 0.0;<NEW_LINE>if (rule.getProperty(SIGMA_DESCRIPTOR) != null) {<NEW_LINE>// TODO - need to come<NEW_LINE>// up with a good<NEW_LINE>// default value<NEW_LINE>deviation = getStdDev();<NEW_LINE>double sigma = rule.getProperty(SIGMA_DESCRIPTOR);<NEW_LINE>minimum = getMean() + (sigma * deviation);<NEW_LINE>}<NEW_LINE>if (rule.getProperty(MINIMUM_DESCRIPTOR) != null) {<NEW_LINE>// TODO - need to<NEW_LINE>// come up with a<NEW_LINE>// good default<NEW_LINE>// value<NEW_LINE>double <MASK><NEW_LINE>if (mMin > minimum) {<NEW_LINE>minimum = mMin;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>SortedSet<DataPoint> newPoints = applyMinimumValue(dataPoints, minimum);<NEW_LINE>if (rule.getProperty(TOP_SCORE_DESCRIPTOR) != null) {<NEW_LINE>// TODO - need to<NEW_LINE>// come up with a<NEW_LINE>// good default<NEW_LINE>// value<NEW_LINE>int topScore = rule.getProperty(TOP_SCORE_DESCRIPTOR);<NEW_LINE>if (newPoints.size() >= topScore) {<NEW_LINE>newPoints = applyTopScore(newPoints, topScore);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>makeViolations(ctx, newPoints);<NEW_LINE>double low = 0.0d;<NEW_LINE>double high = 0.0d;<NEW_LINE>if (!dataPoints.isEmpty()) {<NEW_LINE>low = dataPoints.first().getScore();<NEW_LINE>high = dataPoints.last().getScore();<NEW_LINE>}<NEW_LINE>ctx.getReport().addMetric(new Metric(rule.getName(), count, total, low, high, getMean(), getStdDev()));<NEW_LINE>dataPoints.clear();<NEW_LINE>}
mMin = rule.getProperty(MINIMUM_DESCRIPTOR);
1,632,209
public void copyInterval(TerminalRow line, int sourceX1, int sourceX2, int destinationX) {<NEW_LINE>mHasNonOneWidthOrSurrogateChars |= line.mHasNonOneWidthOrSurrogateChars;<NEW_LINE>final int x1 = line.findStartOfColumn(sourceX1);<NEW_LINE>final int x2 = line.findStartOfColumn(sourceX2);<NEW_LINE>boolean startingFromSecondHalfOfWideChar = (sourceX1 > 0 && line.wideDisplayCharacterStartingAt(sourceX1 - 1));<NEW_LINE>final char[] sourceChars = (this == line) ? Arrays.copyOf(line.mText, line.<MASK><NEW_LINE>int latestNonCombiningWidth = 0;<NEW_LINE>for (int i = x1; i < x2; i++) {<NEW_LINE>char sourceChar = sourceChars[i];<NEW_LINE>int codePoint = Character.isHighSurrogate(sourceChar) ? Character.toCodePoint(sourceChar, sourceChars[++i]) : sourceChar;<NEW_LINE>if (startingFromSecondHalfOfWideChar) {<NEW_LINE>// Just treat copying second half of wide char as copying whitespace.<NEW_LINE>codePoint = ' ';<NEW_LINE>startingFromSecondHalfOfWideChar = false;<NEW_LINE>}<NEW_LINE>int w = WcWidth.width(codePoint);<NEW_LINE>if (w > 0) {<NEW_LINE>destinationX += latestNonCombiningWidth;<NEW_LINE>sourceX1 += latestNonCombiningWidth;<NEW_LINE>latestNonCombiningWidth = w;<NEW_LINE>}<NEW_LINE>setChar(destinationX, codePoint, line.getStyle(sourceX1));<NEW_LINE>}<NEW_LINE>}
mText.length) : line.mText;
1,769,238
public void unparse(SqlWriter writer, int leftPrec, int rightPrec) {<NEW_LINE>switch(typeName) {<NEW_LINE>case BOOLEAN:<NEW_LINE>if (writer.getDialect().getDatabaseProduct() == SqlDialect.DatabaseProduct.ORACLE) {<NEW_LINE>writer.keyword(value == null ? "UNKNOWN" : (Boolean) value ? "1" : "0");<NEW_LINE>} else {<NEW_LINE>writer.keyword(value == null ? "UNKNOWN" : (Boolean) value ? "TRUE" : "FALSE");<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case NULL:<NEW_LINE>writer.keyword("NULL");<NEW_LINE>break;<NEW_LINE>case CHAR:<NEW_LINE>case DECIMAL:<NEW_LINE>case DOUBLE:<NEW_LINE>case BINARY:<NEW_LINE>// should be handled in subtype<NEW_LINE>throw Util.unexpected(typeName);<NEW_LINE>case SYMBOL:<NEW_LINE>if (value instanceof Enum) {<NEW_LINE>Enum enumVal = (Enum) value;<NEW_LINE>writer.keyword(enumVal.toString());<NEW_LINE>} else {<NEW_LINE>writer.keyword<MASK><NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>writer.literal(value.toString());<NEW_LINE>}<NEW_LINE>}
(String.valueOf(value));
512,496
private void exportIndexDefinitions() throws IOException {<NEW_LINE>listener.onMessage("\nExporting index info...");<NEW_LINE>writer.<MASK><NEW_LINE>final OIndexManagerAbstract indexManager = database.getMetadata().getIndexManagerInternal();<NEW_LINE>indexManager.reload();<NEW_LINE>final Collection<? extends OIndex> indexes = indexManager.getIndexes(database);<NEW_LINE>for (OIndex index : indexes) {<NEW_LINE>final String clsName = index.getDefinition() != null ? index.getDefinition().getClassName() : null;<NEW_LINE>if (ODatabaseImport.EXPORT_IMPORT_CLASS_NAME.equals(clsName)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// CHECK TO FILTER CLASS<NEW_LINE>if (includeClasses != null) {<NEW_LINE>if (!includeClasses.contains(clsName))<NEW_LINE>continue;<NEW_LINE>} else if (excludeClasses != null) {<NEW_LINE>if (excludeClasses.contains(clsName))<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>listener.onMessage("\n- Index " + index.getName() + "...");<NEW_LINE>writer.beginObject(2, true, null);<NEW_LINE>writer.writeAttribute(3, true, "name", index.getName());<NEW_LINE>writer.writeAttribute(3, true, "type", index.getType());<NEW_LINE>if (index.getAlgorithm() != null)<NEW_LINE>writer.writeAttribute(3, true, "algorithm", index.getAlgorithm());<NEW_LINE>if (!index.getClusters().isEmpty())<NEW_LINE>writer.writeAttribute(3, true, "clustersToIndex", index.getClusters());<NEW_LINE>if (index.getDefinition() != null) {<NEW_LINE>writer.beginObject(4, true, "definition");<NEW_LINE>writer.writeAttribute(5, true, "defClass", index.getDefinition().getClass().getName());<NEW_LINE>writer.writeAttribute(5, true, "stream", index.getDefinition().toStream());<NEW_LINE>writer.endObject(4, true);<NEW_LINE>}<NEW_LINE>final ODocument metadata = index.getMetadata();<NEW_LINE>if (metadata != null)<NEW_LINE>writer.writeAttribute(4, true, "metadata", metadata);<NEW_LINE>final ODocument configuration = index.getConfiguration();<NEW_LINE>if (configuration.field("blueprintsIndexClass") != null)<NEW_LINE>writer.writeAttribute(4, true, "blueprintsIndexClass", configuration.field("blueprintsIndexClass"));<NEW_LINE>writer.endObject(2, true);<NEW_LINE>listener.onMessage("OK");<NEW_LINE>}<NEW_LINE>writer.endCollection(1, true);<NEW_LINE>listener.onMessage("\nOK (" + indexes.size() + " indexes)");<NEW_LINE>}
beginCollection(1, true, "indexes");
88,127
protected void processAttributeGroup(String parentElement, SchemaRep.AttributeGroup attrGroup) throws Schema2BeansException {<NEW_LINE>SchemaRep.AttributeGroup schemaTypeDef = (SchemaRep.AttributeGroup) schema.getSchemaTypeDef(attrGroup.getRef());<NEW_LINE>if (debug)<NEW_LINE>config.messageOut.println("processAttributeGroup schemaTypeDef=" + schemaTypeDef);<NEW_LINE>if (schemaTypeDef == null)<NEW_LINE>throw new IllegalStateException("attributeGroup ref has reference to unknown name: " + attrGroup.getRef());<NEW_LINE>Iterator it = schemaTypeDef.subElementsIterator();<NEW_LINE>while (it.hasNext()) {<NEW_LINE>SchemaRep.ElementExpr childee = (SchemaRep.ElementExpr) it.next();<NEW_LINE>if (childee instanceof SchemaRep.Attribute) {<NEW_LINE>processAttribute(parentElement<MASK><NEW_LINE>} else if (childee instanceof SchemaRep.AttributeGroup) {<NEW_LINE>processAttributeGroup(parentElement, (SchemaRep.AttributeGroup) childee);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
, (SchemaRep.Attribute) childee);
614,005
public static <T> Collection<T> union(Collection<? extends T> collection1, Collection<? extends T> collection2) {<NEW_LINE>if (isEmpty(collection1)) {<NEW_LINE>if (isEmpty(collection2)) {<NEW_LINE>// if both are empty, return empty list<NEW_LINE>return Collections.emptyList();<NEW_LINE>}<NEW_LINE>// if just 1 is empty, return 2<NEW_LINE>return new ArrayList<T>(collection2);<NEW_LINE>}<NEW_LINE>// at this point when know 1 is not empty<NEW_LINE>if (isEmpty(collection2)) {<NEW_LINE>// so if 2 is, return 1.<NEW_LINE>return <MASK><NEW_LINE>}<NEW_LINE>// we know both 1 and 2 aren't empty<NEW_LINE>Set<T> union = new HashSet<T>(collection1.size() + collection2.size());<NEW_LINE>union.addAll(collection1);<NEW_LINE>union.addAll(collection2);<NEW_LINE>return new ArrayList<T>(union);<NEW_LINE>}
new ArrayList<T>(collection1);
1,717,895
private void mergeLookArounds(ASTTransitionCanonicalizer canonicalizer, CompilationBuffer compilationBuffer) {<NEW_LINE>assert mergedStates.isEmpty();<NEW_LINE>canonicalizer.addArgument(initialTransition, getInitialTransitionCharSet(compilationBuffer));<NEW_LINE>for (ASTStep lookBehind : lookBehinds) {<NEW_LINE>ASTSuccessor lb = lookBehind.getSuccessors().get(0);<NEW_LINE>if (lookBehind.getSuccessors().size() > 1 || lb.hasLookArounds()) {<NEW_LINE>throw new UnsupportedRegexException("nested look-behind assertions");<NEW_LINE>}<NEW_LINE>CodePointSet intersection = getInitialTransitionCharSet(compilationBuffer).createIntersection(lb.getInitialTransitionCharSet(compilationBuffer), compilationBuffer);<NEW_LINE>if (intersection.matchesSomething()) {<NEW_LINE>canonicalizer.addArgument(lb.getInitialTransition(), intersection);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>TransitionBuilder<RegexAST, Term, ASTTransition>[] <MASK><NEW_LINE>Collections.addAll(mergedStates, mergedLookBehinds);<NEW_LINE>ArrayList<TransitionBuilder<RegexAST, Term, ASTTransition>> newMergedStates = new ArrayList<>();<NEW_LINE>for (ASTStep lookAhead : lookAheads) {<NEW_LINE>for (TransitionBuilder<RegexAST, Term, ASTTransition> state : mergedStates) {<NEW_LINE>addAllIntersecting(canonicalizer, state, lookAhead, newMergedStates, compilationBuffer);<NEW_LINE>}<NEW_LINE>ArrayList<TransitionBuilder<RegexAST, Term, ASTTransition>> tmp = mergedStates;<NEW_LINE>mergedStates = newMergedStates;<NEW_LINE>newMergedStates = tmp;<NEW_LINE>newMergedStates.clear();<NEW_LINE>}<NEW_LINE>}
mergedLookBehinds = canonicalizer.run(compilationBuffer);
1,489,657
private String generateJMXConfig() {<NEW_LINE>List<JmxTransQueries> queries = jmxTransQueries();<NEW_LINE>List<JmxTransServer> servers = new ArrayList<>(numberOfBrokers);<NEW_LINE>String headlessService = KafkaResources.brokersServiceName(cluster);<NEW_LINE>for (int brokerNumber = 0; brokerNumber < numberOfBrokers; brokerNumber++) {<NEW_LINE>String brokerServiceName = KafkaCluster.externalServiceName(<MASK><NEW_LINE>servers.add(jmxTransServer(queries, brokerServiceName));<NEW_LINE>}<NEW_LINE>JmxTransServers jmxTransConfiguration = new JmxTransServers();<NEW_LINE>jmxTransConfiguration.setServers(servers);<NEW_LINE>try {<NEW_LINE>ObjectMapper mapper = new ObjectMapper();<NEW_LINE>return mapper.writeValueAsString(jmxTransConfiguration);<NEW_LINE>} catch (JsonProcessingException e) {<NEW_LINE>LOGGER.errorCr(reconciliation, "Failed to convert JMX Trans configuration to JSON", e);<NEW_LINE>throw new RuntimeException("Failed to convert JMX Trans configuration to JSON", e);<NEW_LINE>}<NEW_LINE>}
cluster, brokerNumber) + "." + headlessService;
1,720,880
public void run(RegressionEnvironment env) {<NEW_LINE>SupportBeanCombinedProps combined = SupportBeanCombinedProps.makeDefaultBean();<NEW_LINE>SupportBeanComplexProps complex = SupportBeanComplexProps.makeDefaultBean();<NEW_LINE>assertEquals("0ma0", combined.getIndexed(0).getMapped("0ma").getValue());<NEW_LINE>String epl = "@name('s0') select nested.nested, s1.indexed[0], nested.indexed[1] from " + "SupportBeanComplexProps#length(3) nested, " + "SupportBeanCombinedProps#length(3) s1" + " where mapped('keyOne') = indexed[2].mapped('2ma').value and" + " indexed[0].mapped('0ma').value = '0ma0'";<NEW_LINE>env.compileDeploy<MASK><NEW_LINE>env.sendEventBean(combined);<NEW_LINE>env.sendEventBean(complex);<NEW_LINE>env.assertListener("s0", listener -> {<NEW_LINE>EventBean theEvent = listener.getAndResetLastNewData()[0];<NEW_LINE>assertSame(complex.getNested(), theEvent.get("nested.nested"));<NEW_LINE>assertSame(combined.getIndexed(0), theEvent.get("s1.indexed[0]"));<NEW_LINE>assertEquals(complex.getIndexed(1), theEvent.get("nested.indexed[1]"));<NEW_LINE>});<NEW_LINE>env.undeployAll();<NEW_LINE>}
(epl).addListener("s0");
529,232
// addElasticReadyOnlyMonitor.<NEW_LINE>private static void addDeleteOldESIndicesJob(final Scheduler scheduler) {<NEW_LINE>try {<NEW_LINE>final String jobName = "DeleteOldESIndicesJob";<NEW_LINE>final String triggerName = "trigger30";<NEW_LINE>final String triggerGroup = "group30";<NEW_LINE>if (Config.getBooleanProperty("ENABLE_DELETE_OLD_ES_INDICES_JOB", true)) {<NEW_LINE>final JobBuilder deleteOldESIndicesJob = new JobBuilder().setJobClass(DeleteInactiveLiveWorkingIndicesJob.class).setJobName(jobName).setJobGroup(DOTCMS_JOB_GROUP_NAME).setTriggerName(triggerName).setTriggerGroup(triggerGroup).setCronExpressionProp("DELETE_OLD_ES_INDICES_JOB_CRON_EXPRESSION").setCronExpressionPropDefault("0 0 1 ? * *").setCronMissfireInstruction(CronTrigger.MISFIRE_INSTRUCTION_FIRE_ONCE_NOW);<NEW_LINE>scheduleJob(deleteOldESIndicesJob);<NEW_LINE>} else {<NEW_LINE>if ((scheduler.getJobDetail(jobName, DOTCMS_JOB_GROUP_NAME)) != null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>Logger.info(DotInitScheduler.class, e.toString());<NEW_LINE>}<NEW_LINE>}
scheduler.deleteJob(jobName, DOTCMS_JOB_GROUP_NAME);
359,243
protected <F extends Comparable> Predicate createPredicate(FilterMeta filter, Field filterField, Root<T> root, CriteriaBuilder cb, Expression fieldExpression, F filterValue) {<NEW_LINE>Lazy<Expression<String>> fieldExpressionAsString = new Lazy(() -> fieldExpression.as(String.class));<NEW_LINE>switch(filter.getMatchMode()) {<NEW_LINE>case STARTS_WITH:<NEW_LINE>return cb.like(fieldExpressionAsString.get(), filterValue + "%");<NEW_LINE>case NOT_STARTS_WITH:<NEW_LINE>return cb.notLike(fieldExpressionAsString.get(), filterValue + "%");<NEW_LINE>case ENDS_WITH:<NEW_LINE>return cb.like(fieldExpressionAsString.get(), "%" + filterValue);<NEW_LINE>case NOT_ENDS_WITH:<NEW_LINE>return cb.notLike(fieldExpressionAsString.get(), "%" + filterValue);<NEW_LINE>case CONTAINS:<NEW_LINE>return cb.like(fieldExpressionAsString.get(), "%" + filterValue + "%");<NEW_LINE>case NOT_CONTAINS:<NEW_LINE>return cb.notLike(fieldExpressionAsString.get(<MASK><NEW_LINE>case EXACT:<NEW_LINE>case EQUALS:<NEW_LINE>return cb.equal(fieldExpression, filterValue);<NEW_LINE>case NOT_EXACT:<NEW_LINE>case NOT_EQUALS:<NEW_LINE>return cb.notEqual(fieldExpression, filterValue);<NEW_LINE>case LESS_THAN:<NEW_LINE>return cb.lessThan(fieldExpression, filterValue);<NEW_LINE>case LESS_THAN_EQUALS:<NEW_LINE>return cb.lessThanOrEqualTo(fieldExpression, filterValue);<NEW_LINE>case GREATER_THAN:<NEW_LINE>return cb.greaterThan(fieldExpression, filterValue);<NEW_LINE>case GREATER_THAN_EQUALS:<NEW_LINE>return cb.greaterThanOrEqualTo(fieldExpression, filterValue);<NEW_LINE>case IN:<NEW_LINE>throw new UnsupportedOperationException("MatchMode.IN currently not supported!");<NEW_LINE>case NOT_IN:<NEW_LINE>throw new UnsupportedOperationException("MatchMode.NOT_IN currently not supported!");<NEW_LINE>case BETWEEN:<NEW_LINE>throw new UnsupportedOperationException("MatchMode.BETWEEN currently not supported!");<NEW_LINE>case NOT_BETWEEN:<NEW_LINE>throw new UnsupportedOperationException("MatchMode.NOT_BETWEEN currently not supported!");<NEW_LINE>case GLOBAL:<NEW_LINE>throw new UnsupportedOperationException("MatchMode.GLOBAL currently not supported!");<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
), "%" + filterValue + "%");
671,806
public boolean apply(Game game, Ability source) {<NEW_LINE>Player opponent = game.getPlayer(targetPointer.getFirst(game, source));<NEW_LINE>MageObject sourceObject = game.getObject(source);<NEW_LINE>String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY);<NEW_LINE>if (opponent != null && sourceObject != null && cardName != null && !cardName.isEmpty()) {<NEW_LINE>if (!opponent.getHand().isEmpty()) {<NEW_LINE>Cards revealed = new CardsImpl();<NEW_LINE>Card card = opponent.getHand().getRandom(game);<NEW_LINE>if (card != null) {<NEW_LINE>revealed.add(card);<NEW_LINE>opponent.revealCards(sourceObject.<MASK><NEW_LINE>if (CardUtil.haveSameNames(card, cardName, game)) {<NEW_LINE>opponent.discard(card, false, source, game);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
getName(), revealed, game);
1,716,607
public synchronized long addBalance(byte[] address, long value) {<NEW_LINE>AccountCapsule accountCapsule = getAccount(address);<NEW_LINE>if (accountCapsule == null) {<NEW_LINE>accountCapsule = createAccount(<MASK><NEW_LINE>}<NEW_LINE>long balance = accountCapsule.getBalance();<NEW_LINE>if (value == 0) {<NEW_LINE>return balance;<NEW_LINE>}<NEW_LINE>if (value < 0 && balance < -value) {<NEW_LINE>throw new RuntimeException(StringUtil.createReadableString(accountCapsule.createDbKey()) + " insufficient balance");<NEW_LINE>}<NEW_LINE>accountCapsule.setBalance(Math.addExact(balance, value));<NEW_LINE>Key key = Key.create(address);<NEW_LINE>Value val = Value.create(accountCapsule.getData(), Type.VALUE_TYPE_DIRTY | accountCache.get(key).getType().getType());<NEW_LINE>accountCache.put(key, val);<NEW_LINE>return accountCapsule.getBalance();<NEW_LINE>}
address, Protocol.AccountType.Normal);
437,296
public AutoCloseable process(Class<?> context, Object testInstance) {<NEW_LINE>Field[] fields = context.getDeclaredFields();<NEW_LINE>MemberAccessor accessor = Plugins.getMemberAccessor();<NEW_LINE>for (Field field : fields) {<NEW_LINE>if (field.isAnnotationPresent(Spy.class) && !field.isAnnotationPresent(InjectMocks.class)) {<NEW_LINE>assertNoIncompatibleAnnotations(Spy.class, field, Mock.class, Captor.class);<NEW_LINE>Object instance;<NEW_LINE>try {<NEW_LINE>instance = accessor.get(field, testInstance);<NEW_LINE>if (MockUtil.isMock(instance)) {<NEW_LINE>// instance has been spied earlier<NEW_LINE>// for example happens when MockitoAnnotations.openMocks is called two<NEW_LINE>// times.<NEW_LINE>Mockito.reset(instance);<NEW_LINE>} else if (instance != null) {<NEW_LINE>accessor.set(field, testInstance, spyInstance(field, instance));<NEW_LINE>} else {<NEW_LINE>accessor.set(field, testInstance, spyNewInstance(testInstance, field));<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new MockitoException("Unable to initialize @Spy annotated field '" + field.getName() + "'.\n" + <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new NoAction();<NEW_LINE>}
e.getMessage(), e);
1,779,830
public PlanWithProperties visitLimit(LimitNode node, StreamPreferredProperties parentPreferences) {<NEW_LINE>if (node.isWithTies()) {<NEW_LINE>throw new IllegalStateException("Unexpected node: LimitNode with ties");<NEW_LINE>}<NEW_LINE>if (node.isPartial()) {<NEW_LINE>StreamPreferredProperties requiredProperties = parentPreferences.withoutPreference().withDefaultParallelism(session);<NEW_LINE>StreamPreferredProperties <MASK><NEW_LINE>if (node.requiresPreSortedInputs()) {<NEW_LINE>requiredProperties = requiredProperties.withOrderSensitivity();<NEW_LINE>preferredProperties = preferredProperties.withOrderSensitivity();<NEW_LINE>}<NEW_LINE>return planAndEnforceChildren(node, requiredProperties, preferredProperties);<NEW_LINE>}<NEW_LINE>// final limit requires that all data be in one stream<NEW_LINE>// also, a final changes the input organization completely, so we do not pass through parent preferences<NEW_LINE>return planAndEnforceChildren(node, singleStream(), defaultParallelism(session));<NEW_LINE>}
preferredProperties = parentPreferences.withDefaultParallelism(session);
200,269
private void handleString() {<NEW_LINE>final StringBuilder str = new StringBuilder();<NEW_LINE>char ch;<NEW_LINE>if (this.parser.peek() == '\"') {<NEW_LINE>this.parser.advance();<NEW_LINE>}<NEW_LINE>do {<NEW_LINE>ch = this.parser.readChar();<NEW_LINE>if (ch == 34) {<NEW_LINE>// handle double quote<NEW_LINE>if (this.parser.peek() == 34) {<NEW_LINE>this.parser.advance();<NEW_LINE>str.append(ch);<NEW_LINE>ch = this.parser.readChar();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>str.append(ch);<NEW_LINE>}<NEW_LINE>} while ((ch != 34<MASK><NEW_LINE>if (ch != 34) {<NEW_LINE>throw (new EACompileError("Unterminated string"));<NEW_LINE>}<NEW_LINE>ProgramNode v = this.holder.getFunctions().factorProgramNode("#const", holder, new ProgramNode[] {});<NEW_LINE>v.getData()[0] = new ExpressionValue(str.toString());<NEW_LINE>outputQueue(v);<NEW_LINE>}
) && (ch > 0));
1,744,979
public final void pieceDoneChanged(DiskManagerPiece dmPiece) {<NEW_LINE>final int pieceNumber = dmPiece.getPieceNumber();<NEW_LINE>if (dmPiece.isDone()) {<NEW_LINE>addHavePiece(null, pieceNumber);<NEW_LINE>nbPiecesDone++;<NEW_LINE>if (nbPiecesDone >= nbPieces)<NEW_LINE>checkDownloadablePiece();<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>availabilityMon.enter();<NEW_LINE>if (availabilityAsynch == null) {<NEW_LINE>availabilityAsynch = (int<MASK><NEW_LINE>}<NEW_LINE>if (availabilityAsynch[pieceNumber] > 0)<NEW_LINE>--availabilityAsynch[pieceNumber];<NEW_LINE>else<NEW_LINE>availabilityDrift++;<NEW_LINE>availabilityChange++;<NEW_LINE>} finally {<NEW_LINE>availabilityMon.exit();<NEW_LINE>}<NEW_LINE>nbPiecesDone--;<NEW_LINE>if (dmPiece.calcNeeded() && !hasNeededUndonePiece) {<NEW_LINE>hasNeededUndonePiece = true;<NEW_LINE>neededUndonePieceChange++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
[]) availability.clone();
1,516,480
protected void startAndCompleteReportingInstances(ProcessEngine engine, BpmnModelInstance model, Date currentTime, int offset) {<NEW_LINE>Calendar calendar = Calendar.getInstance();<NEW_LINE>int currentMonth = calendar.get(Calendar.MONTH);<NEW_LINE>int currentYear = calendar.get(Calendar.YEAR);<NEW_LINE>calendar.add(Calendar.MONTH, offset * (-1));<NEW_LINE>ClockUtil.setCurrentTime(calendar.getTime());<NEW_LINE>createDeployment(engine, "reports", model);<NEW_LINE>RuntimeService runtimeService = engine.getRuntimeService();<NEW_LINE>TaskService taskService = engine.getTaskService();<NEW_LINE>while (calendar.get(Calendar.YEAR) < currentYear || calendar.get(Calendar.MONTH) <= currentMonth) {<NEW_LINE>int numOfInstances = getRandomBetween(10, 50);<NEW_LINE>for (int i = 0; i <= numOfInstances; i++) {<NEW_LINE>ProcessInstance pi = runtimeService.startProcessInstanceByKey("my-reporting-process");<NEW_LINE>try {<NEW_LINE>int <MASK><NEW_LINE>int max = offset > 0 ? offset * 30 : min;<NEW_LINE>int randomDuration = getRandomBetween(min, max);<NEW_LINE>Calendar calendarInstance = Calendar.getInstance();<NEW_LINE>calendarInstance.setTime(ClockUtil.getCurrentTime());<NEW_LINE>calendarInstance.add(Calendar.DAY_OF_YEAR, randomDuration);<NEW_LINE>ClockUtil.setCurrentTime(calendarInstance.getTime());<NEW_LINE>String processInstanceId = pi.getId();<NEW_LINE>String taskId = taskService.createTaskQuery().processInstanceId(processInstanceId).singleResult().getId();<NEW_LINE>taskService.complete(taskId);<NEW_LINE>} finally {<NEW_LINE>ClockUtil.setCurrentTime(calendar.getTime());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>offset--;<NEW_LINE>calendar.add(Calendar.MONTH, 1);<NEW_LINE>ClockUtil.setCurrentTime(calendar.getTime());<NEW_LINE>if (calendar.get(Calendar.YEAR) > currentYear) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ClockUtil.reset();<NEW_LINE>}
min = getRandomBetween(1, 10);
1,641,721
public CompletableFuture<Void> removeLedgerMetadata(long ledgerId, Version version) {<NEW_LINE>Optional<Long> existingVersion = Optional.empty();<NEW_LINE>if (Version.NEW == version) {<NEW_LINE>log.error("Request to delete ledger {} metadata with version set to the initial one", ledgerId);<NEW_LINE>return FutureUtil.failedFuture(new BKException.BKMetadataVersionException());<NEW_LINE>} else if (Version.ANY != version) {<NEW_LINE>if (!(version instanceof LongVersion)) {<NEW_LINE><MASK><NEW_LINE>return FutureUtil.failedFuture(new BKException.BKMetadataVersionException());<NEW_LINE>} else {<NEW_LINE>existingVersion = Optional.of(((LongVersion) version).getLongVersion());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return store.delete(getLedgerPath(ledgerId), existingVersion).thenRun(() -> {<NEW_LINE>// removed listener on ledgerId<NEW_LINE>Set<BookkeeperInternalCallbacks.LedgerMetadataListener> listenerSet = listeners.remove(ledgerId);<NEW_LINE>if (null != listenerSet) {<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("Remove registered ledger metadata listeners on ledger {} after ledger is deleted.", ledgerId);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("No ledger metadata listeners to remove from ledger {} when it's being deleted.", ledgerId);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
log.info("Not an instance of ZKVersion: {}", ledgerId);
1,515,161
private static List<VertexData> processTriangles(Mesh mesh, int[] index, Vector3f[] v, Vector2f[] t, boolean splitMirrored) {<NEW_LINE>IndexBuffer indexBuffer = mesh.getIndexBuffer();<NEW_LINE>FloatBuffer vertexBuffer = (FloatBuffer) mesh.getBuffer(Type.Position).getData();<NEW_LINE>if (mesh.getBuffer(Type.TexCoord) == null) {<NEW_LINE>throw new IllegalArgumentException("Can only generate tangents for " + "meshes with texture coordinates");<NEW_LINE>}<NEW_LINE>FloatBuffer textureBuffer = (FloatBuffer) mesh.getBuffer(Type.TexCoord).getData();<NEW_LINE>List<VertexData> vertices = initVertexData(vertexBuffer.limit() / 3);<NEW_LINE>for (int i = 0; i < indexBuffer.size() / 3; i++) {<NEW_LINE>for (int j = 0; j < 3; j++) {<NEW_LINE>index[j] = indexBuffer.get(i * 3 + j);<NEW_LINE>populateFromBuffer(v[j], vertexBuffer, index[j]);<NEW_LINE>populateFromBuffer(t[j], textureBuffer, index[j]);<NEW_LINE>}<NEW_LINE>TriangleData triData = <MASK><NEW_LINE>if (splitMirrored) {<NEW_LINE>triData.setIndex(index);<NEW_LINE>triData.triangleOffset = i * 3;<NEW_LINE>}<NEW_LINE>vertices.get(index[0]).triangles.add(triData);<NEW_LINE>vertices.get(index[1]).triangles.add(triData);<NEW_LINE>vertices.get(index[2]).triangles.add(triData);<NEW_LINE>}<NEW_LINE>return vertices;<NEW_LINE>}
processTriangle(index, v, t);
403,025
public void onDataSetChanged() {<NEW_LINE>dbNotes.clear();<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>Log.v(TAG, "--- data - " + data);<NEW_LINE>switch(data.getMode()) {<NEW_LINE>case MODE_DISPLAY_ALL:<NEW_LINE>dbNotes.addAll(repo.searchRecentByModified(data.getAccountId(), "%"));<NEW_LINE>break;<NEW_LINE>case MODE_DISPLAY_STARRED:<NEW_LINE>dbNotes.addAll(repo.searchFavoritesByModified(data.getAccountId(), "%"));<NEW_LINE>break;<NEW_LINE>case MODE_DISPLAY_CATEGORY:<NEW_LINE>default:<NEW_LINE>if (data.getCategory() != null) {<NEW_LINE>dbNotes.addAll(repo.searchCategoryByModified(data.getAccountId(), "%", data.getCategory()));<NEW_LINE>} else {<NEW_LINE>dbNotes.addAll(repo.searchUncategorizedByModified(data.getAccountId(), "%"));<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}
data = repo.getNoteListWidgetData(appWidgetId);
1,070,179
private void doSetText(@Nonnull CharSequence text, @Nullable String debugInfo) {<NEW_LINE>if (Comparing.equal(myText, text))<NEW_LINE>return;<NEW_LINE>text = ImmutableCharSequence.asImmutable(text);<NEW_LINE>SegmentArrayWithData tempSegments = createSegments();<NEW_LINE>TokenProcessor processor = createTokenProcessor(0, tempSegments, text);<NEW_LINE>int textLength = text.length();<NEW_LINE>Lexer lexerWrapper = new ValidatingLexerWrapper(myLexer);<NEW_LINE>lexerWrapper.start(text, 0, textLength, myLexer instanceof RestartableLexer ? ((RestartableLexer) myLexer).getStartState() : myInitialState);<NEW_LINE>int i = 0;<NEW_LINE>while (true) {<NEW_LINE>final IElementType tokenType = lexerWrapper.getTokenType();<NEW_LINE>if (tokenType == null)<NEW_LINE>break;<NEW_LINE><MASK><NEW_LINE>int data = tempSegments.packData(tokenType, state, canRestart(state));<NEW_LINE>processor.addToken(i, lexerWrapper.getTokenStart(), lexerWrapper.getTokenEnd(), data, tokenType, debugInfo);<NEW_LINE>i++;<NEW_LINE>if (i % 1024 == 0) {<NEW_LINE>ProgressManager.checkCanceled();<NEW_LINE>}<NEW_LINE>lexerWrapper.advance();<NEW_LINE>}<NEW_LINE>myText = text;<NEW_LINE>mySegments = tempSegments;<NEW_LINE>processor.finish();<NEW_LINE>if (textLength > 0 && (mySegments.mySegmentCount == 0 || mySegments.myEnds[mySegments.mySegmentCount - 1] != textLength)) {<NEW_LINE>throw new IllegalStateException("Unexpected termination offset for lexer " + myLexer);<NEW_LINE>}<NEW_LINE>if (myEditor != null && !ApplicationManager.getApplication().isHeadlessEnvironment()) {<NEW_LINE>UIUtil.invokeLaterIfNeeded(() -> myEditor.repaint(0, textLength));<NEW_LINE>}<NEW_LINE>}
int state = lexerWrapper.getState();
1,018,165
final DeleteDomainConfigurationResult executeDeleteDomainConfiguration(DeleteDomainConfigurationRequest deleteDomainConfigurationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteDomainConfigurationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteDomainConfigurationRequest> request = null;<NEW_LINE>Response<DeleteDomainConfigurationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteDomainConfigurationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteDomainConfigurationRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "IoT");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteDomainConfiguration");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteDomainConfigurationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteDomainConfigurationResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
374,223
public void customize(MutableProjectDescription description) {<NEW_LINE>if (!StringUtils.hasText(description.getApplicationName())) {<NEW_LINE>description.setApplicationName(this.metadata.getConfiguration().generateApplicationName(description.getName()));<NEW_LINE>}<NEW_LINE>String targetArtifactId = determineValue(description.getArtifactId(), () -> this.metadata.getArtifactId().getContent());<NEW_LINE>description.setArtifactId(cleanMavenCoordinate(targetArtifactId, "-"));<NEW_LINE>if (targetArtifactId.equals(description.getBaseDirectory())) {<NEW_LINE>description.setBaseDirectory(cleanMavenCoordinate(targetArtifactId, "-"));<NEW_LINE>}<NEW_LINE>if (!StringUtils.hasText(description.getDescription())) {<NEW_LINE>description.setDescription(this.metadata.getDescription().getContent());<NEW_LINE>}<NEW_LINE>String targetGroupId = determineValue(description.getGroupId(), () -> this.metadata.<MASK><NEW_LINE>description.setGroupId(cleanMavenCoordinate(targetGroupId, "."));<NEW_LINE>if (!StringUtils.hasText(description.getName())) {<NEW_LINE>description.setName(this.metadata.getName().getContent());<NEW_LINE>} else if (targetArtifactId.equals(description.getName())) {<NEW_LINE>description.setName(cleanMavenCoordinate(targetArtifactId, "-"));<NEW_LINE>}<NEW_LINE>description.setPackageName(this.metadata.getConfiguration().cleanPackageName(description.getPackageName(), this.metadata.getPackageName().getContent()));<NEW_LINE>if (description.getPlatformVersion() == null) {<NEW_LINE>description.setPlatformVersion(Version.parse(this.metadata.getBootVersions().getDefault().getId()));<NEW_LINE>}<NEW_LINE>if (!StringUtils.hasText(description.getVersion())) {<NEW_LINE>description.setVersion(this.metadata.getVersion().getContent());<NEW_LINE>}<NEW_LINE>}
getGroupId().getContent());
150,137
/*<NEW_LINE>* (non-Javadoc)<NEW_LINE>* @see com.aptana.index.core.MetadataLoader#writeIndex(com.aptana.index.core.MetadataReader)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>protected void writeIndex(CSSMetadataReader reader) {<NEW_LINE>// remove old index<NEW_LINE>getIndexManager().resetIndex(URI.create(ICSSIndexConstants.METADATA_INDEX_LOCATION));<NEW_LINE>CSSIndexWriter indexer = new CSSIndexWriter();<NEW_LINE>// TODO: The following should be done in the index writer, but this will introduce a dependency to<NEW_LINE>// com.aptana.parsing in com.aptana.index.core<NEW_LINE>Index index = getIndex();<NEW_LINE>for (ElementElement element : reader.getElements()) {<NEW_LINE>indexer.writeElement(index, element);<NEW_LINE>}<NEW_LINE>for (PropertyElement property : reader.getProperties()) {<NEW_LINE>indexer.writeProperty(index, property);<NEW_LINE>}<NEW_LINE>for (PseudoClassElement pseudoClass : reader.getPseudoClasses()) {<NEW_LINE>indexer.writePseudoClass(index, pseudoClass);<NEW_LINE>}<NEW_LINE>for (PseudoElementElement pseudoElement : reader.getPseudoElements()) {<NEW_LINE>indexer.writePseudoElement(index, pseudoElement);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>index.save();<NEW_LINE>} catch (IOException e) {<NEW_LINE>IdeLog.logError(<MASK><NEW_LINE>}<NEW_LINE>}
CSSCorePlugin.getDefault(), e);
678,527
private void annotateEntries(String prefix, PrintWriter printTo, AnnotatedOutput annotateTo) {<NEW_LINE>finishProcessingIfNecessary();<NEW_LINE>boolean consume = (annotateTo != null);<NEW_LINE><MASK><NEW_LINE>int amt2 = consume ? 2 : 0;<NEW_LINE>int size = table.size();<NEW_LINE>String subPrefix = prefix + " ";<NEW_LINE>if (consume) {<NEW_LINE>annotateTo.annotate(0, prefix + "tries:");<NEW_LINE>} else {<NEW_LINE>printTo.println(prefix + "tries:");<NEW_LINE>}<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>CatchTable.Entry entry = table.get(i);<NEW_LINE>CatchHandlerList handlers = entry.getHandlers();<NEW_LINE>String s1 = subPrefix + "try " + Hex.u2or4(entry.getStart()) + ".." + Hex.u2or4(entry.getEnd());<NEW_LINE>String s2 = handlers.toHuman(subPrefix, "");<NEW_LINE>if (consume) {<NEW_LINE>annotateTo.annotate(amt1, s1);<NEW_LINE>annotateTo.annotate(amt2, s2);<NEW_LINE>} else {<NEW_LINE>printTo.println(s1);<NEW_LINE>printTo.println(s2);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!consume) {<NEW_LINE>// Only emit the handler lists if we are consuming bytes.<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>annotateTo.annotate(0, prefix + "handlers:");<NEW_LINE>annotateTo.annotate(encodedHandlerHeaderSize, subPrefix + "size: " + Hex.u2(handlerOffsets.size()));<NEW_LINE>int lastOffset = 0;<NEW_LINE>CatchHandlerList lastList = null;<NEW_LINE>for (Map.Entry<CatchHandlerList, Integer> mapping : handlerOffsets.entrySet()) {<NEW_LINE>CatchHandlerList list = mapping.getKey();<NEW_LINE>int offset = mapping.getValue();<NEW_LINE>if (lastList != null) {<NEW_LINE>annotateAndConsumeHandlers(lastList, lastOffset, offset - lastOffset, subPrefix, printTo, annotateTo);<NEW_LINE>}<NEW_LINE>lastList = list;<NEW_LINE>lastOffset = offset;<NEW_LINE>}<NEW_LINE>annotateAndConsumeHandlers(lastList, lastOffset, encodedHandlers.length - lastOffset, subPrefix, printTo, annotateTo);<NEW_LINE>}
int amt1 = consume ? 6 : 0;
398,460
public void fireIfOnlySentryParts() {<NEW_LINE>// the following steps are a workaround, because setVariable()<NEW_LINE>// does not check nor fire a sentry!!!<NEW_LINE>Set<String> affectedSentries = new HashSet<String>();<NEW_LINE>List<CmmnSentryPart> sentryParts = collectSentryParts(getSentries());<NEW_LINE>for (CmmnSentryPart sentryPart : sentryParts) {<NEW_LINE>if (isNotSatisfiedIfPartOnly(sentryPart)) {<NEW_LINE>affectedSentries.add(sentryPart.getSentryId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Step 7: check each not affected sentry whether it is satisfied<NEW_LINE>List<String> satisfiedSentries = getSatisfiedSentries(new <MASK><NEW_LINE>// Step 8: reset sentries -> satisfied == false<NEW_LINE>resetSentries(satisfiedSentries);<NEW_LINE>// Step 9: fire satisfied sentries<NEW_LINE>fireSentries(satisfiedSentries);<NEW_LINE>}
ArrayList<String>(affectedSentries));
329,720
private void loadNode980() {<NEW_LINE>BaseDataVariableTypeNode node = new BaseDataVariableTypeNode(this.context, Identifiers.SessionDiagnosticsObjectType_SessionDiagnostics_DeleteNodesCount, new QualifiedName(0, "DeleteNodesCount"), new LocalizedText("en", "DeleteNodesCount"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.ServiceCounterDataType, -1, new UInteger[] {}, UByte.valueOf(1), UByte.valueOf(1), 0.0, false);<NEW_LINE>node.addReference(new Reference(Identifiers.SessionDiagnosticsObjectType_SessionDiagnostics_DeleteNodesCount, Identifiers.HasTypeDefinition, Identifiers.BaseDataVariableType.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.SessionDiagnosticsObjectType_SessionDiagnostics_DeleteNodesCount, Identifiers.HasModellingRule, Identifiers.ModellingRule_Mandatory<MASK><NEW_LINE>node.addReference(new Reference(Identifiers.SessionDiagnosticsObjectType_SessionDiagnostics_DeleteNodesCount, Identifiers.HasComponent, Identifiers.SessionDiagnosticsObjectType_SessionDiagnostics.expanded(), false));<NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>}
.expanded(), true));
139,163
void init(String text) {<NEW_LINE>setBackground(Color.yellow);<NEW_LINE>setForeground(Color.black);<NEW_LINE>JPanel content = new JPanel();<NEW_LINE>content.setLayout(new BoxLayout(content, BoxLayout.Y_AXIS));<NEW_LINE>add(content);<NEW_LINE>textPane = new TextPane();<NEW_LINE>textPane.setText(text);<NEW_LINE>textPane.setBorder(BorderFactory.createEmptyBorder(3, 5, 3, 5));<NEW_LINE>Color darkyellow = new Color(238, 185, 57);<NEW_LINE>titleBar = new JLabel();<NEW_LINE>titleBar.setFont(new Font("sansserif", Font.BOLD, 14));<NEW_LINE>titleBar.setBackground(darkyellow);<NEW_LINE>titleBar.setOpaque(true);<NEW_LINE>titleBar.setBorder(BorderFactory.createEmptyBorder(5, 5, 3, 5));<NEW_LINE>titleBar.setSize(titleBar.getPreferredSize());<NEW_LINE>titleBar.setVisible(false);<NEW_LINE>buttons = new Box(BoxLayout.X_AXIS);<NEW_LINE>defaultButton = new Button("Close");<NEW_LINE>buttons.add(defaultButton);<NEW_LINE>buttons.setBorder(BorderFactory.createEmptyBorder(15, 5, 5, 5));<NEW_LINE>content.add(titleBar);<NEW_LINE>content.add(textPane);<NEW_LINE>content.add(buttons);<NEW_LINE>// this allows the title bar to take the whole width of the dialog box<NEW_LINE>titleBar.setMaximumSize(new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE));<NEW_LINE>buttons.setMaximumSize(new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE));<NEW_LINE>textPane.setMaximumSize(new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE));<NEW_LINE>// these allow all the parts to left aligned<NEW_LINE>titleBar.setAlignmentX(Component.LEFT_ALIGNMENT);<NEW_LINE>textPane.setAlignmentX(Component.LEFT_ALIGNMENT);<NEW_LINE><MASK><NEW_LINE>// these are meant to prevent the message box from stealing<NEW_LINE>// focus when it's clicked, but they don't seem to work<NEW_LINE>// setFocusableWindowState(false);<NEW_LINE>// setFocusable(false);<NEW_LINE>// this allows the window to be dragged to another location on the screen<NEW_LINE>ComponentMover cm = new ComponentMover();<NEW_LINE>cm.registerComponent(this);<NEW_LINE>pack();<NEW_LINE>}
buttons.setAlignmentX(Component.LEFT_ALIGNMENT);
313,439
public static Query<Integer> averageNewPlayerCount(long after, long before, long timeZoneOffset, ServerUUID serverUUID) {<NEW_LINE>return database -> {<NEW_LINE><MASK><NEW_LINE>String selectNewPlayersQuery = SELECT + sql.dateToEpochSecond(sql.dateToDayStamp(sql.epochSecondToDate('(' + UserInfoTable.REGISTERED + "+?)/1000"))) + "*1000 as date," + "COUNT(1) as player_count" + FROM + UserInfoTable.TABLE_NAME + WHERE + UserInfoTable.REGISTERED + "<=?" + AND + UserInfoTable.REGISTERED + ">=?" + AND + UserInfoTable.SERVER_UUID + "=?" + GROUP_BY + "date";<NEW_LINE>String selectAverage = SELECT + "AVG(player_count) as average" + FROM + '(' + selectNewPlayersQuery + ") q1";<NEW_LINE>return database.query(new QueryStatement<Integer>(selectAverage, 100) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void prepare(PreparedStatement statement) throws SQLException {<NEW_LINE>statement.setLong(1, timeZoneOffset);<NEW_LINE>statement.setLong(2, before);<NEW_LINE>statement.setLong(3, after);<NEW_LINE>statement.setString(4, serverUUID.toString());<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Integer processResults(ResultSet set) throws SQLException {<NEW_LINE>return set.next() ? (int) set.getDouble("average") : 0;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>};<NEW_LINE>}
Sql sql = database.getSql();
627,853
public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception {<NEW_LINE>final boolean denyAll;<NEW_LINE>if (args.length > 0) {<NEW_LINE>denyAll = args[0].equals("*") || args[0].equalsIgnoreCase("all");<NEW_LINE>} else {<NEW_LINE>denyAll = false;<NEW_LINE>}<NEW_LINE>if (!user.hasPendingTpaRequests(false, false)) {<NEW_LINE>throw <MASK><NEW_LINE>}<NEW_LINE>final IUser.TpaRequest denyRequest;<NEW_LINE>if (args.length > 0) {<NEW_LINE>if (denyAll) {<NEW_LINE>denyAllRequests(user);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>denyRequest = user.getOutstandingTpaRequest(getPlayer(server, user, args, 0).getName(), false);<NEW_LINE>} else {<NEW_LINE>denyRequest = user.getNextTpaRequest(false, true, false);<NEW_LINE>}<NEW_LINE>if (denyRequest == null) {<NEW_LINE>throw new Exception(tl("noPendingRequest"));<NEW_LINE>}<NEW_LINE>final User player = ess.getUser(denyRequest.getRequesterUuid());<NEW_LINE>if (player == null || !player.getBase().isOnline()) {<NEW_LINE>throw new Exception(tl("noPendingRequest"));<NEW_LINE>}<NEW_LINE>if (sendEvent(user, player, denyRequest)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>user.sendMessage(tl("requestDenied"));<NEW_LINE>player.sendMessage(tl("requestDeniedFrom", user.getDisplayName()));<NEW_LINE>user.removeTpaRequest(denyRequest.getName());<NEW_LINE>}
new Exception(tl("noPendingRequest"));
1,631,012
final UpdateUserProfileResult executeUpdateUserProfile(UpdateUserProfileRequest updateUserProfileRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateUserProfileRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateUserProfileRequest> request = null;<NEW_LINE>Response<UpdateUserProfileResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateUserProfileRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateUserProfileRequest));<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, "CodeStar");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateUserProfile");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateUserProfileResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateUserProfileResultJsonUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
invoke(request, responseHandler, executionContext);
1,543,176
void decode(Decoder decoder, Instruction instruction) {<NEW_LINE>if ((((decoder.state_zs_flags & (StateFlags.Z | StateFlags.B)) | decoder.state_vvvv_invalidCheck | decoder.state_aaa) & decoder.invalidCheckMask) != 0)<NEW_LINE>decoder.setInvalidInstruction();<NEW_LINE>instruction.setCode(code);<NEW_LINE>instruction.setOp0Register(decoder.state_reg + decoder.state_zs_extraRegisterBase + decoder.state_extraRegisterBaseEVEX + baseReg1);<NEW_LINE>if (decoder.state_mod == 3) {<NEW_LINE>instruction.setOp1Register(decoder.<MASK><NEW_LINE>if (((decoder.state_zs_flags & StateFlags.B) & decoder.invalidCheckMask) != 0)<NEW_LINE>decoder.setInvalidInstruction();<NEW_LINE>} else {<NEW_LINE>instruction.setOp1Kind(OpKind.MEMORY);<NEW_LINE>decoder.readOpMem(instruction, tupleType);<NEW_LINE>}<NEW_LINE>}
state_rm + decoder.state_extraBaseRegisterBaseEVEX + baseReg2);
351,646
final DeleteDeploymentResult executeDeleteDeployment(DeleteDeploymentRequest deleteDeploymentRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteDeploymentRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteDeploymentRequest> request = null;<NEW_LINE>Response<DeleteDeploymentResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteDeploymentRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteDeploymentRequest));<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, "API Gateway");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteDeployment");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteDeploymentResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
false), new DeleteDeploymentResultJsonUnmarshaller());
1,327,778
protected void recalc() {<NEW_LINE>if (dirty) {<NEW_LINE>minimum = null;<NEW_LINE>maximum = null;<NEW_LINE>for (Entry<Double, Double> entry : data.entrySet()) {<NEW_LINE>double x = entry.getKey();<NEW_LINE>double y = data.get(x);<NEW_LINE>if (minimum == null) {<NEW_LINE>minimum = new Point2D.Double(x, y);<NEW_LINE>} else {<NEW_LINE>minimum.x = Math.min(x, minimum.x);<NEW_LINE>minimum.y = Math.min(y, minimum.y);<NEW_LINE>}<NEW_LINE>if (maximum == null) {<NEW_LINE>maximum = new Point2D.Double(x, y);<NEW_LINE>} else {<NEW_LINE>maximum.x = Math.<MASK><NEW_LINE>maximum.y = Math.max(y, maximum.y);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (minimum != null) {<NEW_LINE>if (minimum.x != maximum.x && minimum.y == maximum.y) {<NEW_LINE>// Flatline detected, just add a pseudo min/max.<NEW_LINE>minimum.y -= 0.0001;<NEW_LINE>maximum.y += 0.0001;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>dirty = false;<NEW_LINE>}<NEW_LINE>}
max(x, maximum.x);
297,803
public PartitionByDefinition copy() {<NEW_LINE>PartitionByDefinition newPartDef = new PartitionByDefinition();<NEW_LINE>newPartDef.setStrategy(this.strategy);<NEW_LINE>List<PartitionSpec> newPartitions = new ArrayList<>();<NEW_LINE>for (int i = 0; i < this.getPartitions().size(); i++) {<NEW_LINE>newPartitions.add(this.getPartitions().get(i).copy());<NEW_LINE>}<NEW_LINE>newPartDef.setPartitions(newPartitions);<NEW_LINE>List<SqlNode> newPartitionExprList = new ArrayList<>();<NEW_LINE>newPartitionExprList.addAll(this.getPartitionExprList());<NEW_LINE>newPartDef.setPartitionExprList(newPartitionExprList);<NEW_LINE>List<RelDataType> newPartitionExprTypeList = new ArrayList<>();<NEW_LINE>newPartitionExprTypeList.addAll(this.getPartitionExprTypeList());<NEW_LINE>newPartDef.setPartitionExprTypeList(newPartitionExprTypeList);<NEW_LINE>List<ColumnMeta> newPartitionFieldList = new ArrayList<>();<NEW_LINE>newPartitionFieldList.addAll(this.getPartitionFieldList());<NEW_LINE>newPartDef.setPartitionFieldList(newPartitionFieldList);<NEW_LINE>List<String> newPartitionColumnNameList = new ArrayList<>();<NEW_LINE>newPartitionColumnNameList.addAll(this.getPartitionColumnNameList());<NEW_LINE>newPartDef.setPartitionColumnNameList(newPartitionColumnNameList);<NEW_LINE>newPartDef.setNeedEnumRange(this.isNeedEnumRange());<NEW_LINE>newPartDef.setPruningSpaceComparator(this.getPruningSpaceComparator());<NEW_LINE>newPartDef.setHasher(this.getHasher());<NEW_LINE>newPartDef.<MASK><NEW_LINE>newPartDef.setPartIntFuncOperator(this.getPartIntFuncOperator());<NEW_LINE>newPartDef.setPartIntFunc(this.getPartIntFunc());<NEW_LINE>newPartDef.setPartIntFuncMonotonicity(this.getPartIntFuncMonotonicity());<NEW_LINE>newPartDef.setQuerySpaceComparator(this.getQuerySpaceComparator());<NEW_LINE>newPartDef.setRouter(this.getRouter());<NEW_LINE>return newPartDef;<NEW_LINE>}
setBoundSpaceComparator(this.getBoundSpaceComparator());
848,310
public void load(ByteProvider provider, LoadSpec loadSpec, List<Option> options, Program prog, TaskMonitor monitor, MessageLog log) throws IOException {<NEW_LINE>if (!prog.getExecutableFormat().equals(PeLoader.PE_NAME)) {<NEW_LINE>throw new IOException("Program must be a " + PeLoader.PE_NAME);<NEW_LINE>}<NEW_LINE>SymbolTable symtab = prog.getSymbolTable();<NEW_LINE>Consumer<String> errorConsumer = err -> log.error("DefLoader", err);<NEW_LINE>for (DefExportLine def : parseExports(provider)) {<NEW_LINE>Symbol symbol = SymbolUtilities.getLabelOrFunctionSymbol(prog, SymbolUtilities.ORDINAL_PREFIX + def.getOrdinal(), errorConsumer);<NEW_LINE>if (symbol == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Symbol label = symtab.createLabel(symbol.getAddress(), def.getName(), SourceType.IMPORTED);<NEW_LINE>label.setPrimary();<NEW_LINE>} catch (InvalidInputException e) {<NEW_LINE>log.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
appendMsg(e.getMessage());
1,481,679
final ListStudioSessionMappingsResult executeListStudioSessionMappings(ListStudioSessionMappingsRequest listStudioSessionMappingsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listStudioSessionMappingsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<ListStudioSessionMappingsRequest> request = null;<NEW_LINE>Response<ListStudioSessionMappingsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListStudioSessionMappingsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listStudioSessionMappingsRequest));<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, "EMR");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListStudioSessionMappings");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListStudioSessionMappingsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListStudioSessionMappingsResultJsonUnmarshaller());<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,580,316
public int readInt32() throws IOException {<NEW_LINE>// See implementation notes for readInt64<NEW_LINE>fastpath: {<NEW_LINE>int tempOffset = _currentArrayOffset;<NEW_LINE>if (getCurrentRemaining() == 0) {<NEW_LINE>break fastpath;<NEW_LINE>}<NEW_LINE>final byte[] buffer = _currentSegment.getArray();<NEW_LINE>int x;<NEW_LINE>if ((x = buffer[tempOffset++]) >= 0) {<NEW_LINE>_currentArrayOffset = tempOffset;<NEW_LINE>return x;<NEW_LINE>} else if (_currentSegment.getLength() - (tempOffset - _currentSegment.getOffset()) < 9) {<NEW_LINE>break fastpath;<NEW_LINE>} else if ((x ^= (buffer[tempOffset++] << 7)) < 0) {<NEW_LINE>x ^= (~0 << 7);<NEW_LINE>} else if ((x ^= (buffer[tempOffset++] << 14)) >= 0) {<NEW_LINE>x ^= (~0 << 7) ^ (~0 << 14);<NEW_LINE>} else if ((x ^= (buffer[tempOffset++] << 21)) < 0) {<NEW_LINE>x ^= (~0 << 7) ^ (~0 << 14<MASK><NEW_LINE>} else {<NEW_LINE>int y = buffer[tempOffset++];<NEW_LINE>x ^= y << 28;<NEW_LINE>x ^= (~0 << 7) ^ (~0 << 14) ^ (~0 << 21) ^ (~0 << 28);<NEW_LINE>if (y < 0 && buffer[tempOffset++] < 0 && buffer[tempOffset++] < 0 && buffer[tempOffset++] < 0 && buffer[tempOffset++] < 0 && buffer[tempOffset++] < 0) {<NEW_LINE>// Will throw malformedVarint()<NEW_LINE>break fastpath;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>_currentArrayOffset = tempOffset;<NEW_LINE>return x;<NEW_LINE>}<NEW_LINE>return (int) readRawVarint64SlowPath();<NEW_LINE>}
) ^ (~0 << 21);
1,817,504
public void deleteApiKeysId(Integer id) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// verify the required parameter 'id' is set<NEW_LINE>if (id == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'id' when calling deleteApiKeysId");<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/api_keys/{id}".replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));<NEW_LINE>// query params<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = {};<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] localVarAuthNames = new String[] {};<NEW_LINE>apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, <MASK><NEW_LINE>}
localVarAccept, localVarContentType, localVarAuthNames, null);
661,462
public boolean restartProcess(String groupId, String streamId, String operator, boolean sync) {<NEW_LINE>log.info("begin to restart stream process for groupId={} streamId={}", groupId, streamId);<NEW_LINE>InlongGroupInfo groupInfo = groupService.get(groupId);<NEW_LINE>if (groupInfo == null) {<NEW_LINE>throw new BusinessException(ErrorCodeEnum.GROUP_NOT_FOUND);<NEW_LINE>}<NEW_LINE>GroupStatus groupStatus = GroupStatus.forCode(groupInfo.getStatus());<NEW_LINE>if (groupStatus != GroupStatus.CONFIG_SUCCESSFUL && groupStatus != GroupStatus.RESTARTED) {<NEW_LINE>throw new BusinessException(String.format("group status=%s not support restart stream for groupId=%s", groupStatus, groupId));<NEW_LINE>}<NEW_LINE>InlongStreamInfo streamInfo = streamService.get(groupId, streamId);<NEW_LINE>if (streamInfo == null) {<NEW_LINE>throw new BusinessException(ErrorCodeEnum.STREAM_NOT_FOUND);<NEW_LINE>}<NEW_LINE>StreamStatus status = StreamStatus.<MASK><NEW_LINE>if (status == StreamStatus.RESTARTED || status == StreamStatus.RESTARTING) {<NEW_LINE>log.warn("GroupId={}, StreamId={} is already in {}", groupId, streamId, status);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (status != StreamStatus.SUSPENDED) {<NEW_LINE>throw new BusinessException(String.format("stream status=%s not support restart stream for groupId=%s streamId=%s", status, groupId, streamId));<NEW_LINE>}<NEW_LINE>StreamResourceProcessForm processForm = genStreamProcessForm(groupInfo, streamInfo, GroupOperateType.RESTART);<NEW_LINE>ProcessName processName = ProcessName.RESTART_STREAM_RESOURCE;<NEW_LINE>if (sync) {<NEW_LINE>WorkflowResult workflowResult = workflowService.start(processName, operator, processForm);<NEW_LINE>ProcessStatus processStatus = workflowResult.getProcessInfo().getStatus();<NEW_LINE>return processStatus == ProcessStatus.COMPLETED;<NEW_LINE>} else {<NEW_LINE>executorService.execute(() -> workflowService.start(processName, operator, processForm));<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}
forCode(streamInfo.getStatus());
1,551,713
private void sendCandidatesWithConfiguredIp(String senderPublicId, IceCandidate candidate) {<NEW_LINE>try {<NEW_LINE>// Get media node private IP<NEW_LINE>String kurentoPrivateIp = this.owner.getSession().getKms().getIp();<NEW_LINE>// Get Ip to be replaced<NEW_LINE>String ipToReplace = this.openviduConfig.<MASK><NEW_LINE>// If Ip is configured<NEW_LINE>if (ipToReplace != null && !ipToReplace.isEmpty()) {<NEW_LINE>// Create IceCandidateParser to modify original candidate information<NEW_LINE>IceCandidateDataParser candidateParser = new IceCandidateDataParser(candidate);<NEW_LINE>// get original IP<NEW_LINE>String originalIp = candidateParser.getIp();<NEW_LINE>// Replace all candidates with with new configured IP<NEW_LINE>IceCandidate candidateMaxPriority = new IceCandidate(candidate.getCandidate(), candidate.getSdpMid(), candidate.getSdpMLineIndex());<NEW_LINE>candidateParser.setIp(ipToReplace);<NEW_LINE>candidateParser.setMaxPriority();<NEW_LINE>candidateMaxPriority.setCandidate(candidateParser.toString());<NEW_LINE>sendCandidate(senderPublicId, candidateMaxPriority);<NEW_LINE>// Resend old public IP next to the new one<NEW_LINE>if (candidateParser.isType(IceCandidateType.srflx)) {<NEW_LINE>IceCandidate candidateMinPriority = new IceCandidate(candidate.getCandidate(), candidate.getSdpMid(), candidate.getSdpMLineIndex());<NEW_LINE>if (openviduConfig.isCoturnUsingInternalRelay()) {<NEW_LINE>// If coturn is using internal relay, there should be candidates with the private IP<NEW_LINE>// to relay on the internal network<NEW_LINE>// Send candidate with private ip<NEW_LINE>candidateParser.setIp(kurentoPrivateIp);<NEW_LINE>} else {<NEW_LINE>// If coturn is configured using public IP as relay, candidates with the original IP<NEW_LINE>// and the new one should be sent<NEW_LINE>// to relay using the public internet<NEW_LINE>// Send candidate with original IP<NEW_LINE>candidateParser.setIp(originalIp);<NEW_LINE>}<NEW_LINE>// Set min priority for this candidate<NEW_LINE>candidateParser.setMinPriority();<NEW_LINE>candidateMinPriority.setCandidate(candidateParser.toString());<NEW_LINE>sendCandidate(senderPublicId, candidateMinPriority);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.error("Error on adding additional IP in candidates: {}", e.getMessage());<NEW_LINE>// On Exception, send candidate without any modification<NEW_LINE>sendCandidate(senderPublicId, candidate);<NEW_LINE>}<NEW_LINE>}
getMediaNodesPublicIpsMap().get(kurentoPrivateIp);
393,711
private void loadContent() {<NEW_LINE>ViewUtils.setGone(loadingBar, false);<NEW_LINE>ViewUtils.setGone(codeView, true);<NEW_LINE>new RefreshBlobTask(repo, sha, this) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void onSuccess(Blob blob) throws Exception {<NEW_LINE>super.onSuccess(blob);<NEW_LINE>BranchFileViewActivity.this.blob = blob;<NEW_LINE>if (markdownItem != null)<NEW_LINE>markdownItem.setEnabled(true);<NEW_LINE>if (isMarkdownFile && PreferenceUtils.getCodePreferences(BranchFileViewActivity.this).getBoolean(RENDER_MARKDOWN, true))<NEW_LINE>loadMarkdown();<NEW_LINE>else {<NEW_LINE>ViewUtils.setGone(loadingBar, true);<NEW_LINE>ViewUtils.setGone(codeView, false);<NEW_LINE>editor.setMarkdown(false).setSource(file, blob);<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void onException(Exception e) throws RuntimeException {<NEW_LINE>super.onException(e);<NEW_LINE>Log.d(TAG, "Loading file contents failed", e);<NEW_LINE>ViewUtils.setGone(loadingBar, true);<NEW_LINE><MASK><NEW_LINE>ToastUtils.show(BranchFileViewActivity.this, e, R.string.error_file_load);<NEW_LINE>}<NEW_LINE>}.execute();<NEW_LINE>}
ViewUtils.setGone(codeView, false);
1,831,671
public void saveMacroButtonProperty(MacroButtonProperties properties, boolean gmPanel) {<NEW_LINE>List<MacroButtonProperties> macroButtonList = gmPanel ? gmMacroButtonProperties : macroButtonProperties;<NEW_LINE>AbstractMacroPanel macroPanel = gmPanel ? MapTool.getFrame().getGmPanel() : MapTool.getFrame().getCampaignPanel();<NEW_LINE>for (MacroButtonProperties prop : macroButtonList) {<NEW_LINE>if (prop.getIndex() == properties.getIndex()) {<NEW_LINE>prop.setColorKey(properties.getColorKey());<NEW_LINE>prop.setAutoExecute(properties.getAutoExecute());<NEW_LINE>prop.setCommand(properties.getCommand());<NEW_LINE>prop.<MASK><NEW_LINE>prop.setIncludeLabel(properties.getIncludeLabel());<NEW_LINE>prop.setApplyToTokens(properties.getApplyToTokens());<NEW_LINE>prop.setLabel(properties.getLabel());<NEW_LINE>prop.setGroup(properties.getGroup());<NEW_LINE>prop.setSortby(properties.getSortby());<NEW_LINE>prop.setFontColorKey(properties.getFontColorKey());<NEW_LINE>prop.setFontSize(properties.getFontSize());<NEW_LINE>prop.setMinWidth(properties.getMinWidth());<NEW_LINE>prop.setMaxWidth(properties.getMaxWidth());<NEW_LINE>prop.setToolTip(properties.getToolTip());<NEW_LINE>prop.setAllowPlayerEdits(properties.getAllowPlayerEdits());<NEW_LINE>prop.setDisplayHotKey(properties.getDisplayHotKey());<NEW_LINE>prop.setCompareIncludeLabel(properties.getCompareIncludeLabel());<NEW_LINE>prop.setCompareAutoExecute(properties.getCompareAutoExecute());<NEW_LINE>prop.setCompareApplyToSelectedTokens(properties.getCompareApplyToSelectedTokens());<NEW_LINE>prop.setCompareGroup(properties.getCompareGroup());<NEW_LINE>prop.setCompareSortPrefix(properties.getCompareSortPrefix());<NEW_LINE>prop.setCompareCommand(properties.getCompareCommand());<NEW_LINE>macroPanel.reset();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>macroButtonList.add(properties);<NEW_LINE>macroPanel.reset();<NEW_LINE>}
setHotKey(properties.getHotKey());
1,483,322
public final DotOperatorContext dotOperator() throws RecognitionException {<NEW_LINE>DotOperatorContext _localctx = new DotOperatorContext(_ctx, getState());<NEW_LINE>enterRule(_localctx, 4, RULE_dotOperator);<NEW_LINE>try {<NEW_LINE>setState(51);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>switch(_input.LA(1)) {<NEW_LINE>case LBRACK:<NEW_LINE>enterOuterAlt(_localctx, 1);<NEW_LINE>{<NEW_LINE>setState(48);<NEW_LINE>bracketOperator();<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case Identifier:<NEW_LINE>case StringLiteral:<NEW_LINE>enterOuterAlt(_localctx, 2);<NEW_LINE>{<NEW_LINE>setState(49);<NEW_LINE>property();<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case WILDCARD:<NEW_LINE>enterOuterAlt(_localctx, 3);<NEW_LINE>{<NEW_LINE>setState(50);<NEW_LINE>wildcard();<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><MASK><NEW_LINE>_errHandler.recover(this, re);<NEW_LINE>} finally {<NEW_LINE>exitRule();<NEW_LINE>}<NEW_LINE>return _localctx;<NEW_LINE>}
_errHandler.reportError(this, re);
39,260
public Destination unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>Destination destination = new Destination();<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("s3", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>destination.setS3(S3DestinationJsonUnmarshaller.getInstance<MASK><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 destination;<NEW_LINE>}
().unmarshall(context));
1,193,321
protected void startMasters() throws IOException {<NEW_LINE>ServerConfiguration.set(PropertyKey.ZOOKEEPER_ENABLED, true);<NEW_LINE>ServerConfiguration.set(PropertyKey.ZOOKEEPER_ADDRESS, mCuratorServer.getConnectString());<NEW_LINE>ServerConfiguration.set(PropertyKey.ZOOKEEPER_ELECTION_PATH, "/alluxio/election");<NEW_LINE>ServerConfiguration.set(PropertyKey.ZOOKEEPER_LEADER_PATH, "/alluxio/leader");<NEW_LINE>for (int k = 0; k < mNumOfMasters; k++) {<NEW_LINE>ServerConfiguration.set(PropertyKey.MASTER_METASTORE_DIR, PathUtils.concatPath(mWorkDirectory, "metastore-" + k));<NEW_LINE>final LocalAlluxioMaster master = LocalAlluxioMaster.create(mWorkDirectory, false);<NEW_LINE>master.start();<NEW_LINE>LOG.info("master NO.{} started, isServing: {}, address: {}", k, master.isServing(), master.getAddress());<NEW_LINE>mMasters.add(master);<NEW_LINE>// Each master should generate a new port for binding<NEW_LINE>ServerConfiguration.set(PropertyKey.MASTER_RPC_PORT, 0);<NEW_LINE>ServerConfiguration.set(PropertyKey.MASTER_WEB_PORT, 0);<NEW_LINE>}<NEW_LINE>// Create the UFS directory after LocalAlluxioMaster construction, because LocalAlluxioMaster<NEW_LINE>// sets MASTER_MOUNT_TABLE_ROOT_UFS.<NEW_LINE>UnderFileSystem ufs = UnderFileSystem.Factory.createForRoot(ServerConfiguration.global());<NEW_LINE>String path = ServerConfiguration.getString(PropertyKey.MASTER_MOUNT_TABLE_ROOT_UFS);<NEW_LINE>if (ufs.isDirectory(path)) {<NEW_LINE>ufs.deleteExistingDirectory(path, DeleteOptions.defaults().setRecursive(true));<NEW_LINE>}<NEW_LINE>if (!ufs.mkdirs(path)) {<NEW_LINE>throw new IOException("Failed to make folder: " + path);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>LOG.info("waiting for a leader.");<NEW_LINE>try {<NEW_LINE>waitForMasterServing();<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new IOException(e);<NEW_LINE>}<NEW_LINE>// Use first master port<NEW_LINE>ServerConfiguration.set(PropertyKey.MASTER_RPC_PORT, getLocalAlluxioMaster().getRpcLocalPort());<NEW_LINE>}
LOG.info("all {} masters started.", mNumOfMasters);
1,735,661
private void bindValidityStatus(boolean isValid) {<NEW_LINE>if (!isValid) {<NEW_LINE>int key_flag_gray = itemView.getResources().getColor(R.color.key_flag_gray);<NEW_LINE>vCertifyIcon.setColorFilter(<MASK><NEW_LINE>vSignIcon.setColorFilter(key_flag_gray, PorterDuff.Mode.SRC_IN);<NEW_LINE>vEncryptIcon.setColorFilter(key_flag_gray, PorterDuff.Mode.SRC_IN);<NEW_LINE>vAuthenticateIcon.setColorFilter(key_flag_gray, PorterDuff.Mode.SRC_IN);<NEW_LINE>} else {<NEW_LINE>vCertifyIcon.clearColorFilter();<NEW_LINE>vSignIcon.clearColorFilter();<NEW_LINE>vEncryptIcon.clearColorFilter();<NEW_LINE>vAuthenticateIcon.clearColorFilter();<NEW_LINE>}<NEW_LINE>vKeyId.setEnabled(isValid);<NEW_LINE>vKeyDetails.setEnabled(isValid);<NEW_LINE>vKeyStatus.setEnabled(isValid);<NEW_LINE>}
key_flag_gray, PorterDuff.Mode.SRC_IN);
1,622,019
private void daemonStopped(String details) {<NEW_LINE>if (project.isDisposed())<NEW_LINE>return;<NEW_LINE>final <MASK><NEW_LINE>if (current == null || current.isRunning()) {<NEW_LINE>// The active daemon didn't die, so it must be some older process. Just log it.<NEW_LINE>LOG.info("A Flutter device daemon stopped.\n" + details);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// If we haven't tried restarting recently, try again.<NEW_LINE>final long now = System.currentTimeMillis();<NEW_LINE>final long millisSinceLastRestart = now - lastRestartTime.get();<NEW_LINE>if (millisSinceLastRestart > TimeUnit.SECONDS.toMillis(20)) {<NEW_LINE>LOG.info("A Flutter device daemon stopped. Automatically restarting it.\n" + details);<NEW_LINE>refreshDeviceDaemon();<NEW_LINE>lastRestartTime.set(now);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Display as a notification to the user.<NEW_LINE>final ApplicationInfo info = ApplicationInfo.getInstance();<NEW_LINE>FlutterMessages.showWarning("Flutter daemon terminated", "Consider re-starting " + info.getVersionName() + ".", project);<NEW_LINE>}
DeviceDaemon current = deviceDaemon.getNow();
1,300,196
private static void createLibrary(Workspace workspace, String container, List<String> importProblems) throws IOException {<NEW_LINE>// create eclipse user libraries in NetBeans:<NEW_LINE>assert container.startsWith(USER_LIBRARY_CONTAINER) || container.startsWith(JSF_CONTAINER) || container.startsWith(MYECLIPSE_CONTAINERS) : container;<NEW_LINE>String library = getNetBeansLibraryName(container);<NEW_LINE>LibraryManager lm = LibraryManager.getDefault();<NEW_LINE>if (lm.getLibrary(library) != null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Map<String, List<URL>> content = new HashMap<String, List<URL>>();<NEW_LINE>if (workspace == null) {<NEW_LINE>importProblems.add(org.openide.util.NbBundle.getMessage(ClassPathContainerResolver.class, "MSG_CannotCreateUserLibrary", library));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>content.put("classpath", workspace.getJarsForUserLibrary(getEclipseLibraryName(container)));<NEW_LINE>List<URL> urls = workspace.getJavadocForUserLibrary(getEclipseLibraryName(container), importProblems);<NEW_LINE>if (urls != null) {<NEW_LINE>content.put("javadoc", urls);<NEW_LINE>}<NEW_LINE>urls = workspace.getSourcesForUserLibrary(getEclipseLibraryName(container), importProblems);<NEW_LINE>if (urls != null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>lm.createLibrary("j2se", library, content);<NEW_LINE>}
content.put("src", urls);
1,298,845
final UntagResourceResult executeUntagResource(UntagResourceRequest untagResourceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(untagResourceRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UntagResourceRequest> request = null;<NEW_LINE>Response<UntagResourceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UntagResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(untagResourceRequest));<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, "signer");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UntagResource");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UntagResourceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UntagResourceResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
799,513
/*<NEW_LINE>* (non-Javadoc)<NEW_LINE>*<NEW_LINE>* @see org.apache.jmeter.report.csv.processor.impl.AbstractGraphConsumer#<NEW_LINE>* createGroupInfos()<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>protected Map<String, GroupInfo> createGroupInfos() {<NEW_LINE>AbstractSeriesSelector seriesSelector = new AbstractSeriesSelector(true) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Iterable<String> select(Sample sample) {<NEW_LINE>String success = sample.getSuccess() ? SUCCESS_SERIES_SUFFIX : FAILURE_SERIES_SUFFIX;<NEW_LINE>String label = sample<MASK><NEW_LINE>return Arrays.asList(label);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>return Collections.singletonMap(AbstractGraphConsumer.DEFAULT_GROUP, new // We include Transaction Controller results<NEW_LINE>GroupInfo(// We include Transaction Controller results<NEW_LINE>new TimeRateAggregatorFactory(), // We include Transaction Controller results<NEW_LINE>seriesSelector, new CountValueSelector(false), false, false));<NEW_LINE>}
.getName() + "-" + success;
1,248,841
public static PrivateKey convertStringToPrivateKey(String strKey) throws Exception {<NEW_LINE>java.security.Security.addProvider(new BouncyCastleProvider());<NEW_LINE>strKey = strKey.replace(System.lineSeparator(), "");<NEW_LINE>strKey = <MASK><NEW_LINE>strKey = strKey.replace("-----BEGIN PRIVATE KEY-----", "");<NEW_LINE>strKey = strKey.replace("-----END PRIVATE KEY-----", "");<NEW_LINE>strKey = strKey.replace("-----BEGIN RSA PRIVATE KEY-----", "");<NEW_LINE>strKey = strKey.replace("-----END RSA PRIVATE KEY-----", "");<NEW_LINE>byte[] decoded = Base64.getMimeDecoder().decode(strKey);<NEW_LINE>PKCS8EncodedKeySpec spec = new PKCS8EncodedKeySpec(decoded);<NEW_LINE>KeyFactory kf = KeyFactory.getInstance("RSA");<NEW_LINE>return kf.generatePrivate(spec);<NEW_LINE>}
strKey.replaceAll("^\"+|\"+$", "");
1,238,701
public static void log(String str) {<NEW_LINE>// get the adapter values.<NEW_LINE>SpeedManagerAlgorithmProviderAdapter adpter = SMInstance.getInstance().getAdapter();<NEW_LINE>int adptCurrUpLimit = adpter.getCurrentUploadLimit();<NEW_LINE>int adptCurrDownLimit = adpter.getCurrentDownloadLimit();<NEW_LINE>// get the COConfigurationManager values.<NEW_LINE>SMConfigurationAdapter conf = SMInstance<MASK><NEW_LINE>SpeedManagerLimitEstimate uploadSetting = conf.getUploadLimit();<NEW_LINE>SpeedManagerLimitEstimate downloadSetting = conf.getDownloadLimit();<NEW_LINE>StringBuilder sb = new StringBuilder(str);<NEW_LINE>sb.append(", Download current =").append(adptCurrDownLimit);<NEW_LINE>sb.append(", max limit =").append(downloadSetting.getString());<NEW_LINE>sb.append(", Upload current = ").append(adptCurrUpLimit);<NEW_LINE>sb.append(", max limit = ").append(uploadSetting.getString());<NEW_LINE>String msg = sb.toString();<NEW_LINE>LogEvent e = new LogEvent(ID, msg);<NEW_LINE>Logger.log(e);<NEW_LINE>if (dLog != null) {<NEW_LINE>dLog.log(msg);<NEW_LINE>}<NEW_LINE>}
.getInstance().getConfigManager();
1,347,351
public void serializeNativeObject(OCompositeKey compositeKey, byte[] stream, int startPosition, Object... hints) {<NEW_LINE>final OType[] types = getKeyTypes(hints);<NEW_LINE>final List<Object> keys = compositeKey.getKeys();<NEW_LINE>final int keysSize = keys.size();<NEW_LINE>final int oldStartPosition = startPosition;<NEW_LINE>startPosition += OIntegerSerializer.INT_SIZE;<NEW_LINE>OIntegerSerializer.INSTANCE.serializeNative(keysSize, stream, startPosition);<NEW_LINE>startPosition += OIntegerSerializer.INT_SIZE;<NEW_LINE>final OBinarySerializerFactory factory = OBinarySerializerFactory.getInstance();<NEW_LINE>for (int i = 0; i < keys.size(); i++) {<NEW_LINE>final Object <MASK><NEW_LINE>OBinarySerializer<Object> binarySerializer;<NEW_LINE>if (key != null) {<NEW_LINE>final OType type;<NEW_LINE>if (types.length > i)<NEW_LINE>type = types[i];<NEW_LINE>else<NEW_LINE>type = OType.getTypeByClass(key.getClass());<NEW_LINE>binarySerializer = factory.getObjectSerializer(type);<NEW_LINE>} else<NEW_LINE>binarySerializer = ONullSerializer.INSTANCE;<NEW_LINE>stream[startPosition] = binarySerializer.getId();<NEW_LINE>startPosition += OBinarySerializerFactory.TYPE_IDENTIFIER_SIZE;<NEW_LINE>binarySerializer.serializeNativeObject(key, stream, startPosition);<NEW_LINE>startPosition += binarySerializer.getObjectSize(key);<NEW_LINE>}<NEW_LINE>OIntegerSerializer.INSTANCE.serializeNative((startPosition - oldStartPosition), stream, oldStartPosition);<NEW_LINE>}
key = keys.get(i);
1,751,389
private void addToChain(InterceptorChain chain, Message m) {<NEW_LINE>Collection<InterceptorProvider> providers = CastUtils.cast((Collection<?>) m<MASK><NEW_LINE>if (providers != null) {<NEW_LINE>for (InterceptorProvider p : providers) {<NEW_LINE>chain.add(p.getInInterceptors());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Collection<Interceptor<? extends Message>> is = CastUtils.cast((Collection<?>) m.get(Message.IN_INTERCEPTORS));<NEW_LINE>if (is != null) {<NEW_LINE>// this helps to detect if need add CertConstraintsInterceptor to chain<NEW_LINE>String rqURL = (String) m.get(Message.REQUEST_URL);<NEW_LINE>boolean isHttps = (rqURL != null && rqURL.indexOf("https:") > -1) ? true : false;<NEW_LINE>for (Interceptor<? extends Message> i : is) {<NEW_LINE>if (i instanceof CertConstraintsInterceptor && isHttps == false) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>chain.add(i);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (m.getDestination() instanceof InterceptorProvider) {<NEW_LINE>chain.add(((InterceptorProvider) m.getDestination()).getInInterceptors());<NEW_LINE>}<NEW_LINE>}
.get(Message.INTERCEPTOR_PROVIDERS));
779,067
public void extractKeyParts(final CacheKeyBuilder keyBuilder, final Object targetObject, final Object[] params) {<NEW_LINE>final Object modelObj = params[parameterIndex];<NEW_LINE>int id = -1;<NEW_LINE>Exception errorException = null;<NEW_LINE>if (modelObj != null) {<NEW_LINE>try {<NEW_LINE>id = InterfaceWrapperHelper.getId(modelObj);<NEW_LINE>} catch (final Exception ex) {<NEW_LINE>id = -1;<NEW_LINE>errorException = ex;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (id < 0 || errorException != null) {<NEW_LINE>keyBuilder.setSkipCaching();<NEW_LINE>final CacheGetException ex = new CacheGetException("Invalid parameter type.").addSuppressIfNotNull(errorException).setTargetObject(targetObject).setMethodArguments(params).setInvalidParameter(parameterIndex, modelObj<MASK><NEW_LINE>logger.warn("Invalid parameter. Skip caching", ex);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>keyBuilder.add(id);<NEW_LINE>}
).setAnnotation(CacheTrx.class);
1,548,617
final GetServiceQuotaResult executeGetServiceQuota(GetServiceQuotaRequest getServiceQuotaRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getServiceQuotaRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetServiceQuotaRequest> request = null;<NEW_LINE>Response<GetServiceQuotaResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetServiceQuotaRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getServiceQuotaRequest));<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, "Service Quotas");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetServiceQuota");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetServiceQuotaResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetServiceQuotaResultJsonUnmarshaller());<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);
1,550,281
public boolean masterClear(ModuleInfo moduleInfo) {<NEW_LINE>if (moduleInfo.hasFlag(ModuleInfo.FLAGS_MODULE_ACTIVE))<NEW_LINE>return false;<NEW_LINE>String escapedId = moduleInfo.id.replace("\\", "\\\\").replace("\"", "\\\"").replace(" ", "\\ ");<NEW_LINE>try {<NEW_LINE>// Check for module that declare having file outside their own folder.<NEW_LINE>try (BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(SuFileInputStream.open("/data/adb/modules/." + moduleInfo.id + "-files"), StandardCharsets.UTF_8))) {<NEW_LINE>String line;<NEW_LINE>while ((line = bufferedReader.readLine()) != null) {<NEW_LINE>line = line.trim().replace(' ', '.');<NEW_LINE>if (!line.startsWith("/data/adb/") || line.contains("*") || line.contains("/../") || line.endsWith("/..") || line.startsWith("/data/adb/modules") || line.equals("/data/adb/magisk.db"))<NEW_LINE>continue;<NEW_LINE>line = line.replace("\\", "\\\\").replace("\"", "\\\"");<NEW_LINE>Shell.cmd("rm -rf \"" + line + "\"").exec();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (IOException ignored) {<NEW_LINE>}<NEW_LINE>Shell.cmd("rm -rf /data/adb/modules/" + escapedId + "/").exec();<NEW_LINE>Shell.cmd("rm -f /data/adb/modules/." + escapedId + "-files").exec();<NEW_LINE>Shell.cmd("rm -rf /data/adb/modules_update/" + <MASK><NEW_LINE>moduleInfo.flags = ModuleInfo.FLAG_METADATA_INVALID;<NEW_LINE>return true;<NEW_LINE>}
escapedId + "/").exec();
1,363,943
public Map workers(@PathVariable String clusterName, @PathVariable String host, @RequestParam(value = "window", required = false) String window) {<NEW_LINE>Map<String, Object> ret = new HashMap<>();<NEW_LINE>int <MASK><NEW_LINE>NimbusClient client = null;<NEW_LINE>try {<NEW_LINE>client = NimbusClientManager.getNimbusClient(clusterName);<NEW_LINE>SupervisorWorkers supervisorWorkers = client.getClient().getSupervisorWorkers(host);<NEW_LINE>ret.put("supervisor", new SupervisorEntity(supervisorWorkers.get_supervisor()));<NEW_LINE>// get worker summary<NEW_LINE>List<WorkerSummary> workerSummaries = supervisorWorkers.get_workers();<NEW_LINE>ret.put("workers", UIUtils.getWorkerEntities(workerSummaries));<NEW_LINE>Map<String, MetricInfo> workerMetricInfo = supervisorWorkers.get_workerMetric();<NEW_LINE>List<UIWorkerMetric> workerMetrics = UIMetricUtils.getWorkerMetrics(workerMetricInfo, workerSummaries, host, win);<NEW_LINE>ret.put("workerMetrics", workerMetrics);<NEW_LINE>} catch (Exception e) {<NEW_LINE>NimbusClientManager.removeClient(clusterName);<NEW_LINE>ret = UIUtils.exceptionJson(e);<NEW_LINE>LOG.error(e.getMessage(), e);<NEW_LINE>}<NEW_LINE>return ret;<NEW_LINE>}
win = UIUtils.parseWindow(window);
1,415,313
public static DescribeNodeDevicesInfoResponse unmarshall(DescribeNodeDevicesInfoResponse describeNodeDevicesInfoResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeNodeDevicesInfoResponse.setRequestId(_ctx.stringValue("DescribeNodeDevicesInfoResponse.RequestId"));<NEW_LINE>List<NodeDevice> nodeDevices = new ArrayList<NodeDevice>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeNodeDevicesInfoResponse.NodeDevices.Length"); i++) {<NEW_LINE>NodeDevice nodeDevice = new NodeDevice();<NEW_LINE>nodeDevice.setNodeName(_ctx.stringValue("DescribeNodeDevicesInfoResponse.NodeDevices[" + i + "].NodeName"));<NEW_LINE>List<DeviceInfo> deviceInfos = new ArrayList<DeviceInfo>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeNodeDevicesInfoResponse.NodeDevices[" + i + "].DeviceInfos.Length"); j++) {<NEW_LINE>DeviceInfo deviceInfo = new DeviceInfo();<NEW_LINE>deviceInfo.setInstanceId(_ctx.stringValue("DescribeNodeDevicesInfoResponse.NodeDevices[" + i <MASK><NEW_LINE>deviceInfo.setName(_ctx.stringValue("DescribeNodeDevicesInfoResponse.NodeDevices[" + i + "].DeviceInfos[" + j + "].Name"));<NEW_LINE>deviceInfo.setIP(_ctx.stringValue("DescribeNodeDevicesInfoResponse.NodeDevices[" + i + "].DeviceInfos[" + j + "].IP"));<NEW_LINE>deviceInfo.setServer(_ctx.stringValue("DescribeNodeDevicesInfoResponse.NodeDevices[" + i + "].DeviceInfos[" + j + "].Server"));<NEW_LINE>deviceInfos.add(deviceInfo);<NEW_LINE>}<NEW_LINE>nodeDevice.setDeviceInfos(deviceInfos);<NEW_LINE>nodeDevices.add(nodeDevice);<NEW_LINE>}<NEW_LINE>describeNodeDevicesInfoResponse.setNodeDevices(nodeDevices);<NEW_LINE>return describeNodeDevicesInfoResponse;<NEW_LINE>}
+ "].DeviceInfos[" + j + "].InstanceId"));
235,623
public HttpResponse testBodyWithQueryParamsForHttpResponse(String query, User body) throws IOException {<NEW_LINE>// verify the required parameter 'query' is set<NEW_LINE>if (query == null) {<NEW_LINE>throw new IllegalArgumentException("Missing the required parameter 'query' when calling testBodyWithQueryParams");<NEW_LINE>}<NEW_LINE>// verify the required parameter 'body' is set<NEW_LINE>if (body == null) {<NEW_LINE>throw new IllegalArgumentException("Missing the required parameter 'body' when calling testBodyWithQueryParams");<NEW_LINE>}<NEW_LINE>UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/body-with-query-params");<NEW_LINE>if (query != null) {<NEW_LINE>String key = "query";<NEW_LINE>Object value = query;<NEW_LINE>if (value instanceof Collection) {<NEW_LINE>uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());<NEW_LINE>} else if (value instanceof Object[]) {<NEW_LINE>uriBuilder = uriBuilder.queryParam(key<MASK><NEW_LINE>} else {<NEW_LINE>uriBuilder = uriBuilder.queryParam(key, value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String localVarUrl = uriBuilder.build().toString();<NEW_LINE>GenericUrl genericUrl = new GenericUrl(localVarUrl);<NEW_LINE>HttpContent content = apiClient.new JacksonJsonHttpContent(body);<NEW_LINE>return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PUT, genericUrl, content).execute();<NEW_LINE>}
, (Object[]) value);
559,444
public void onBindViewHolder(ViewHolder holder, Feed feed) {<NEW_LINE>String title = feed.getTitle();<NEW_LINE>holder.tvTitle.setText(title);<NEW_LINE>holder.tvTitle.setVisibility(title != null ? View.VISIBLE : View.GONE);<NEW_LINE>holder.tvDesc.setText(feed.getPreview());<NEW_LINE>holder.tvDesc.setGravity(mShowExtra ? Gravity.TOP : Gravity.CENTER_VERTICAL);<NEW_LINE>if (mShowExtra && feed.getUserId() > 0) {<NEW_LINE>AvatarHandler.assignAvatar(holder.ivGravatar, feed.getAuthor(), feed.getUserId(), feed.getAvatarUrl());<NEW_LINE><MASK><NEW_LINE>holder.ivGravatar.setVisibility(View.VISIBLE);<NEW_LINE>} else {<NEW_LINE>holder.ivGravatar.setVisibility(View.GONE);<NEW_LINE>}<NEW_LINE>if (mShowExtra) {<NEW_LINE>Date date = feed.getPublished() != null ? feed.getPublished() : feed.getUpdated();<NEW_LINE>String published = date != null ? DateFormat.getMediumDateFormat(mContext).format(date) : "";<NEW_LINE>holder.tvExtra.setText(feed.getAuthor());<NEW_LINE>holder.tvTimestamp.setText(published);<NEW_LINE>holder.tvExtra.setVisibility(feed.getAuthor() != null ? View.VISIBLE : View.GONE);<NEW_LINE>holder.tvTimestamp.setVisibility(View.VISIBLE);<NEW_LINE>} else {<NEW_LINE>holder.tvExtra.setVisibility(View.GONE);<NEW_LINE>holder.tvTimestamp.setVisibility(View.GONE);<NEW_LINE>}<NEW_LINE>}
holder.ivGravatar.setTag(feed);
1,426,658
Change doPerformReorg(IProgressMonitor pm) throws CoreException, OperationCanceledException {<NEW_LINE>String name;<NEW_LINE>String newName = getNewName();<NEW_LINE>if (newName == null) {<NEW_LINE>name <MASK><NEW_LINE>} else {<NEW_LINE>name = newName;<NEW_LINE>}<NEW_LINE>// get current modification stamp<NEW_LINE>long currentStamp = IResource.NULL_STAMP;<NEW_LINE>IResource resource = getCu().getResource();<NEW_LINE>if (resource != null) {<NEW_LINE>currentStamp = resource.getModificationStamp();<NEW_LINE>}<NEW_LINE>IPackageFragment destination = getDestinationPackage();<NEW_LINE>fUndoable = !destination.exists() || !destination.getCompilationUnit(name).exists();<NEW_LINE>IPackageFragment[] createdPackages = null;<NEW_LINE>if (!destination.exists()) {<NEW_LINE>IPackageFragmentRoot packageFragmentRoot = (IPackageFragmentRoot) destination.getParent();<NEW_LINE>createdPackages = createDestination(packageFragmentRoot, destination, pm);<NEW_LINE>}<NEW_LINE>// perform the move and restore modification stamp<NEW_LINE>getCu().move(destination, null, newName, true, pm);<NEW_LINE>if (fStampToRestore != IResource.NULL_STAMP) {<NEW_LINE>ICompilationUnit moved = destination.getCompilationUnit(name);<NEW_LINE>IResource movedResource = moved.getResource();<NEW_LINE>if (movedResource != null) {<NEW_LINE>movedResource.revertModificationStamp(fStampToRestore);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (fDeletePackages != null) {<NEW_LINE>for (int i = fDeletePackages.length - 1; i >= 0; i--) {<NEW_LINE>fDeletePackages[i].delete(true, pm);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (fUndoable) {<NEW_LINE>return new MoveCompilationUnitChange(destination, getCu().getElementName(), getOldPackage(), currentStamp, createdPackages);<NEW_LINE>} else {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}
= getCu().getElementName();
724,244
public Function newInstance(int position, ObjList<Function> args, IntList argPositions, CairoConfiguration configuration, SqlExecutionContext sqlExecutionContext) {<NEW_LINE>final Function perionFunction = args.getQuick(0);<NEW_LINE>if (perionFunction.isConstant()) {<NEW_LINE>final Function start = args.getQuick(1);<NEW_LINE>final Function end = args.getQuick(2);<NEW_LINE>final char period = perionFunction.getChar(null);<NEW_LINE>if (period < diffFunctionsMax) {<NEW_LINE>final LongDiffFunction func = diffFunctions.getQuick(period);<NEW_LINE>if (func != null) {<NEW_LINE>if (start.isConstant() && start.getTimestamp(null) != Numbers.LONG_NaN) {<NEW_LINE>return new DiffVarConstFunction(args.getQuick(2), start.getLong(null), func);<NEW_LINE>}<NEW_LINE>if (end.isConstant() && end.getTimestamp(null) != Numbers.LONG_NaN) {<NEW_LINE>return new DiffVarConstFunction(args.getQuick(1), end<MASK><NEW_LINE>}<NEW_LINE>return new DiffVarVarFunction(args.getQuick(1), args.getQuick(2), func);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return TimestampConstant.NULL;<NEW_LINE>}<NEW_LINE>return new DateDiffFunc(args.getQuick(0), args.getQuick(1), args.getQuick(2));<NEW_LINE>}
.getLong(null), func);
464,754
public void onError(java.lang.Exception e) {<NEW_LINE>byte msgType = org.apache<MASK><NEW_LINE>org.apache.thrift.TSerializable msg;<NEW_LINE>getDiskUsage_result result = new getDiskUsage_result();<NEW_LINE>if (e instanceof ThriftSecurityException) {<NEW_LINE>result.sec = (ThriftSecurityException) e;<NEW_LINE>result.setSecIsSet(true);<NEW_LINE>msg = result;<NEW_LINE>} else if (e instanceof ThriftTableOperationException) {<NEW_LINE>result.toe = (ThriftTableOperationException) e;<NEW_LINE>result.setToeIsSet(true);<NEW_LINE>msg = result;<NEW_LINE>} else if (e instanceof org.apache.thrift.transport.TTransportException) {<NEW_LINE>_LOGGER.error("TTransportException inside handler", e);<NEW_LINE>fb.close();<NEW_LINE>return;<NEW_LINE>} else if (e instanceof org.apache.thrift.TApplicationException) {<NEW_LINE>_LOGGER.error("TApplicationException inside handler", e);<NEW_LINE>msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;<NEW_LINE>msg = (org.apache.thrift.TApplicationException) e;<NEW_LINE>} else {<NEW_LINE>_LOGGER.error("Exception inside handler", e);<NEW_LINE>msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;<NEW_LINE>msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>fcall.sendResponse(fb, msg, msgType, seqid);<NEW_LINE>} catch (java.lang.Exception ex) {<NEW_LINE>_LOGGER.error("Exception writing to internal frame buffer", ex);<NEW_LINE>fb.close();<NEW_LINE>}<NEW_LINE>}
.thrift.protocol.TMessageType.REPLY;
864,935
private static void registerMBean(final Class<?> interfaceClass, final IMBeanAwareService service) {<NEW_LINE>Check.errorIf(service instanceof IMultitonService && !(service instanceof ISingletonService), "IMBeanAwareService=" + service + " cannot implement IMultitonService");<NEW_LINE>final Object mbean = service.getMBean();<NEW_LINE>if (mbean == null) {<NEW_LINE>logger.<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final String jmxName = createJMXName(interfaceClass, service);<NEW_LINE>final ObjectName jmxObjectName;<NEW_LINE>try {<NEW_LINE>jmxObjectName = new ObjectName(jmxName);<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.warn("Cannot create JMX Name: " + jmxName + ". Skip registering MBean.", e);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();<NEW_LINE>try {<NEW_LINE>if (!mbs.isRegistered(jmxObjectName)) {<NEW_LINE>mbs.registerMBean(mbean, jmxObjectName);<NEW_LINE>}<NEW_LINE>} catch (InstanceAlreadyExistsException e) {<NEW_LINE>logger.warn("Cannot register MBean Name: " + jmxName + ". (caught InstanceAlreadyExistsException)", e);<NEW_LINE>} catch (MBeanRegistrationException e) {<NEW_LINE>logger.warn("Cannot register MBean Name: " + jmxName + ". (caught MBeanRegistrationException)", e);<NEW_LINE>} catch (NotCompliantMBeanException e) {<NEW_LINE>logger.warn("Cannot register MBean Name: " + jmxName + ". (caught NotCompliantMBeanException)", e);<NEW_LINE>} catch (NullPointerException e) {<NEW_LINE>logger.warn("Cannot register MBean Name: " + jmxName + ". (caught NullPointerException)", e);<NEW_LINE>}<NEW_LINE>}
warn("No MBean found for " + service + ". Skip registering MBean.");
905,908
public Page<ElasticTaskInstance> list(String taskIdListString, String statusListString, Integer page, Integer pageSize) {<NEW_LINE>List<String> statusList;<NEW_LINE>if (StringUtil.isEmpty(statusListString)) {<NEW_LINE>statusList = Arrays.stream(TaskInstanceStatus.values()).map(Enum::name).collect(Collectors.toList());<NEW_LINE>} else {<NEW_LINE>statusList = Arrays.stream(statusListString.split(",")).collect(Collectors.toList());<NEW_LINE>}<NEW_LINE>Pageable <MASK><NEW_LINE>if (StringUtil.isEmpty(taskIdListString)) {<NEW_LINE>return elasticTaskInstanceRepository.findAllByStatusInOrderByGmtCreateDesc(statusList, pageable);<NEW_LINE>} else {<NEW_LINE>List<Long> taskIdList = Arrays.stream(taskIdListString.split(",")).map(Long::valueOf).collect(Collectors.toList());<NEW_LINE>return elasticTaskInstanceRepository.findAllByTaskIdInAndStatusInOrderByGmtCreateDesc(taskIdList, statusList, pageable);<NEW_LINE>}<NEW_LINE>}
pageable = pageable(page, pageSize);
693,240
public void finalizeEStep(double weight, double prior) {<NEW_LINE>final int dim = covariance.length;<NEW_LINE>this.weight = weight;<NEW_LINE>double f = wsum > Double.MIN_NORMAL && wsum < Double.POSITIVE_INFINITY ? 1. / wsum : 1.;<NEW_LINE>if (prior > 0 && priormatrix != null) {<NEW_LINE>// MAP<NEW_LINE>// Popular default.<NEW_LINE>final double nu = dim + 2.;<NEW_LINE>final double f2 = 1. / (wsum + prior * (nu + dim + 2));<NEW_LINE>for (int i = 0; i < dim; i++) {<NEW_LINE>final double[] row_i = covariance[i], pri_i = priormatrix[i];<NEW_LINE>for (int j = 0; j < i; j++) {<NEW_LINE>// Restore symmetry & scale<NEW_LINE>covariance[j][i] = row_i[j] = (row_i[j] + prior * pri_i[j]) * f2;<NEW_LINE>}<NEW_LINE>// Diagonal<NEW_LINE>row_i[i] = (row_i[i] + prior * pri_i[i]) * f2;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// MLE<NEW_LINE>for (int i = 0; i < dim; i++) {<NEW_LINE>final double[] row_i = covariance[i];<NEW_LINE>for (int j = 0; j < i; j++) {<NEW_LINE>// Restore symmetry & scale<NEW_LINE>covariance[j][i<MASK><NEW_LINE>}<NEW_LINE>// Diagonal<NEW_LINE>row_i[i] *= f;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.chol = updateCholesky(covariance, null);<NEW_LINE>this.logNormDet = FastMath.log(weight) - .5 * logNorm - getHalfLogDeterminant(this.chol);<NEW_LINE>if (prior > 0 && priormatrix == null) {<NEW_LINE>priormatrix = copy(covariance);<NEW_LINE>}<NEW_LINE>}
] = row_i[j] *= f;
1,698,123
public static Map<String, String> parseProperties(String query) {<NEW_LINE>if (!query.startsWith("[") || !query.endsWith("]"))<NEW_LINE>return Map.of();<NEW_LINE>if (query.length() == 2)<NEW_LINE>return Map.of();<NEW_LINE>final int entries = StringUtils.countMatches(query, ',') + 1;<NEW_LINE>assert entries > 0;<NEW_LINE>String[<MASK><NEW_LINE>String[] values = new String[entries];<NEW_LINE>int entryCount = 0;<NEW_LINE>final int length = query.length() - 1;<NEW_LINE>int start = 1;<NEW_LINE>int index = 1;<NEW_LINE>while (index <= length) {<NEW_LINE>if (query.charAt(index) == ',' || index == length) {<NEW_LINE>final int equalIndex = query.indexOf('=', start);<NEW_LINE>if (equalIndex != -1) {<NEW_LINE>final String key = query.substring(start, equalIndex).trim();<NEW_LINE>final String value = query.substring(equalIndex + 1, index).trim();<NEW_LINE>keys[entryCount] = key;<NEW_LINE>values[entryCount++] = value;<NEW_LINE>}<NEW_LINE>start = index + 1;<NEW_LINE>}<NEW_LINE>index++;<NEW_LINE>}<NEW_LINE>return new Object2ObjectArrayMap<>(keys, values, entryCount);<NEW_LINE>}
] keys = new String[entries];
951,006
public Object instanceCreate() throws java.io.IOException, ClassNotFoundException {<NEW_LINE>synchronized (this) {<NEW_LINE>Object o = refConnection.get();<NEW_LINE>if (o != null) {<NEW_LINE>return o;<NEW_LINE>}<NEW_LINE>XMLDataObject obj = getHolder();<NEW_LINE>if (obj == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>FileObject connectionFO = obj.getPrimaryFile();<NEW_LINE>Handler handler = new Handler(connectionFO.getNameExt());<NEW_LINE>try {<NEW_LINE>XMLReader reader = XMLUtil.createXMLReader();<NEW_LINE>InputSource is = new InputSource(obj.getPrimaryFile().getInputStream());<NEW_LINE>is.setSystemId(connectionFO.toURL().toExternalForm());<NEW_LINE>reader.setContentHandler(handler);<NEW_LINE>reader.setErrorHandler(handler);<NEW_LINE>reader.setEntityResolver(EntityCatalog.getDefault());<NEW_LINE>reader.parse(is);<NEW_LINE>} catch (SAXException ex) {<NEW_LINE>Exception x = ex.getException();<NEW_LINE>LOGGER.log(Level.FINE, "Cannot read " + obj + ". Cause: " + ex.getLocalizedMessage(), ex);<NEW_LINE>if (x instanceof java.io.IOException) {<NEW_LINE>throw (IOException) x;<NEW_LINE>} else {<NEW_LINE>throw new java.io.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>DatabaseConnection inst = createDatabaseConnection(handler);<NEW_LINE>refConnection = new WeakReference<>(inst);<NEW_LINE>attachListener();<NEW_LINE>return inst;<NEW_LINE>}<NEW_LINE>}
IOException(ex.getMessage());
1,436,232
// Suppress unclosed resource warning<NEW_LINE>@SuppressWarnings("squid:S2095")<NEW_LINE>@Override<NEW_LINE>public SyncStatus initSyncData(String fileInfo) {<NEW_LINE>File file;<NEW_LINE>String filePath = fileInfo;<NEW_LINE>try {<NEW_LINE>if (fileInfo.equals(MetadataConstant.METADATA_LOG)) {<NEW_LINE>// schema mlog.txt file<NEW_LINE>file = new File(getSyncDataPath(), filePath);<NEW_LINE>} else {<NEW_LINE>filePath = currentSG.get() + File.separator + getFilePathByFileInfo(fileInfo);<NEW_LINE>file = new <MASK><NEW_LINE>}<NEW_LINE>file.delete();<NEW_LINE>currentFile.set(file);<NEW_LINE>if (!file.getParentFile().exists()) {<NEW_LINE>file.getParentFile().mkdirs();<NEW_LINE>}<NEW_LINE>if (currentFileWriter.get() != null) {<NEW_LINE>currentFileWriter.get().close();<NEW_LINE>}<NEW_LINE>currentFileWriter.set(new FileOutputStream(file));<NEW_LINE>syncLog.get().startSyncTsFiles();<NEW_LINE>messageDigest.set(MessageDigest.getInstance(SyncConstant.MESSAGE_DIGIT_NAME));<NEW_LINE>} catch (IOException | NoSuchAlgorithmException e) {<NEW_LINE>logger.error("Can not init sync resource for file {}", filePath, e);<NEW_LINE>return getErrorResult(String.format("Can not init sync resource for file %s because %s", filePath, e.getMessage()));<NEW_LINE>}<NEW_LINE>return getSuccessResult();<NEW_LINE>}
File(getSyncDataPath(), filePath);
669,793
// BUGFIX: (TS) A data min card restriction is top-equiv iff the<NEW_LINE>// cardinality is 0.<NEW_LINE>// BUGFIX: (TS, 2) Added the cases where the filler is top-equiv<NEW_LINE>// BUGFIX: (TS, 2) Left out redundant check cardinality > 0 in TOP_TOP<NEW_LINE>// case<NEW_LINE>// BUGFIX: (TS, 3) Extended the cases where the filler is top-equiv in<NEW_LINE>// TOP_TOP<NEW_LINE>@Override<NEW_LINE>public void visit(OWLDataMinCardinality ce) {<NEW_LINE>switch(getLocality()) {<NEW_LINE>case BOTTOM_BOTTOM:<NEW_LINE>case TOP_BOTTOM:<NEW_LINE>isTopEquivalent = ce.getCardinality() == 0;<NEW_LINE>break;<NEW_LINE>case TOP_TOP:<NEW_LINE>isTopEquivalent = ce.getCardinality() == 0 || ce.getCardinality() == 1 && !signature.contains(ce.getProperty().asOWLDataProperty()) && isTopOrBuiltInDatatype(ce.getFiller()) || ce.getCardinality() > 1 && !signature.contains(ce.getProperty().asOWLDataProperty()) && <MASK><NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}
isTopOrBuiltInInfiniteDatatype(ce.getFiller());
1,685,708
public void kill(boolean awaitCompletion) throws IOException {<NEW_LINE>LOGGER.debug("[{}] Killing {} process", jobId, getName());<NEW_LINE>processKilled = true;<NEW_LINE>try {<NEW_LINE>// The PID comes via the processes log stream. We do wait here to give the process the time to start up and report its PID.<NEW_LINE>// Without the PID we cannot kill the process.<NEW_LINE>nativeController.killProcess(cppLogHandler().getPid(processPipes<MASK><NEW_LINE>// Wait for the process to die before closing processInStream as if the process<NEW_LINE>// is still alive when processInStream is closed it may start persisting state<NEW_LINE>cppLogHandler().waitForLogStreamClose(WAIT_FOR_KILL_TIMEOUT);<NEW_LINE>} catch (TimeoutException e) {<NEW_LINE>LOGGER.warn("[{}] Failed to get PID of {} process to kill", jobId, getName());<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>Thread.currentThread().interrupt();<NEW_LINE>LOGGER.warn("[{}] Interrupted while killing {} process", jobId, getName());<NEW_LINE>} finally {<NEW_LINE>try {<NEW_LINE>if (processInStream() != null) {<NEW_LINE>processInStream().close();<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>// Ignore it - we're shutting down and the method itself has logged a warning<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>deleteAssociatedFiles();<NEW_LINE>} catch (IOException e) {<NEW_LINE>// Ignore it - we're shutting down and the method itself has logged a warning<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.getTimeout()), awaitCompletion);
595,472
private void paintBase(InstancePainter painter) {<NEW_LINE>final var g = painter.getGraphics();<NEW_LINE>final var facing = <MASK><NEW_LINE>final var loc = painter.getLocation();<NEW_LINE>final var x = loc.getX();<NEW_LINE>final var y = loc.getY();<NEW_LINE>g.translate(x, y);<NEW_LINE>var rotate = 0.0;<NEW_LINE>if (facing != null && facing != Direction.EAST && g instanceof Graphics2D) {<NEW_LINE>rotate = -facing.toRadians();<NEW_LINE>((Graphics2D) g).rotate(rotate);<NEW_LINE>}<NEW_LINE>Object shape = painter.getGateShape();<NEW_LINE>if (shape == AppPreferences.SHAPE_RECTANGULAR) {<NEW_LINE>paintRectangularBase(g, painter);<NEW_LINE>// } else if (shape == AppPreferences.SHAPE_DIN40700) {<NEW_LINE>// int width = painter.getAttributeValue(ATTR_SIZE) == SIZE_NARROW ? 20 : 30;<NEW_LINE>// PainterDin.paintAnd(painter, width, 18, true);<NEW_LINE>} else {<NEW_LINE>PainterShaped.paintNot(painter);<NEW_LINE>}<NEW_LINE>if (rotate != 0.0) {<NEW_LINE>((Graphics2D) g).rotate(-rotate);<NEW_LINE>}<NEW_LINE>g.translate(-x, -y);<NEW_LINE>}
painter.getAttributeValue(StdAttr.FACING);
266,259
/* Sample generated code:<NEW_LINE>*<NEW_LINE>* @com.ibm.j9ddr.GeneratedFieldAccessor(offsetFieldName="_isDirOffset_", declaredType="uint32_t:1")<NEW_LINE>* public UDATA isDir() throws CorruptDataException {<NEW_LINE>* return getU32Bitfield(J9FileStat._isDir_s_, J9FileStat._isDir_b_);<NEW_LINE>* }<NEW_LINE>*/<NEW_LINE>private void doBitfieldMethod(FieldDescriptor field, String baseType, int width) {<NEW_LINE>String fieldName = field.getName();<NEW_LINE>Type qualifiedBaseType = Type<MASK><NEW_LINE>Type qualifiedReturnType = Type.getObjectType(qualifyType(generalizeSimpleType(baseType)));<NEW_LINE>String returnDesc = Type.getMethodDescriptor(qualifiedReturnType);<NEW_LINE>String startFieldName = String.format("_%s_s_", fieldName);<NEW_LINE>String accessorName = String.format("get%sBitfield", baseType);<NEW_LINE>String accessorDesc = Type.getMethodDescriptor(qualifiedBaseType, Type.INT_TYPE, Type.INT_TYPE);<NEW_LINE>MethodVisitor method = beginAnnotatedMethod(field, fieldName, returnDesc);<NEW_LINE>method.visitCode();<NEW_LINE>if (checkPresent(field, method)) {<NEW_LINE>method.visitVarInsn(ALOAD, 0);<NEW_LINE>method.visitFieldInsn(GETSTATIC, getStructureClassName(), startFieldName, Type.INT_TYPE.getDescriptor());<NEW_LINE>loadInt(method, width);<NEW_LINE>method.visitMethodInsn(INVOKEVIRTUAL, className, accessorName, accessorDesc, false);<NEW_LINE>method.visitInsn(ARETURN);<NEW_LINE>}<NEW_LINE>method.visitMaxs(3, 1);<NEW_LINE>method.visitEnd();<NEW_LINE>// no EA method for a bitfield<NEW_LINE>}
.getObjectType(qualifyType(baseType));
665,527
private Properties defaultProperties() {<NEW_LINE>Properties felixProps = new Properties();<NEW_LINE>final String felixDirectory = getFelixBaseDirFromConfig();<NEW_LINE>Logger.info(this, () -> "Felix base dir: " + felixDirectory);<NEW_LINE>final String felixAutoDeployDirectory = Config.getStringProperty(AUTO_DEPLOY_DIR_PROPERTY, felixDirectory + File.separator + "bundle");<NEW_LINE>final String felixUploadDirectory = Config.getStringProperty(FELIX_UPLOAD_DIR, felixDirectory + File.separator + "upload");<NEW_LINE>final String felixLoadDirectory = Config.getStringProperty(FELIX_FILEINSTALL_DIR, felixDirectory + File.separator + "load");<NEW_LINE>final String felixUndeployDirectory = Config.getStringProperty(FELIX_UNDEPLOYED_DIR, felixDirectory + File.separator + "undeployed");<NEW_LINE>final String felixCacheDirectory = Config.getStringProperty(FELIX_FRAMEWORK_STORAGE, felixDirectory + File.separator + "felix-cache");<NEW_LINE>felixProps.put(FELIX_BASE_DIR, felixDirectory);<NEW_LINE><MASK><NEW_LINE>felixProps.put(FELIX_FRAMEWORK_STORAGE, felixCacheDirectory);<NEW_LINE>felixProps.put(FELIX_UPLOAD_DIR, felixUploadDirectory);<NEW_LINE>felixProps.put(FELIX_FILEINSTALL_DIR, felixLoadDirectory);<NEW_LINE>felixProps.put(FELIX_UNDEPLOYED_DIR, felixUndeployDirectory);<NEW_LINE>felixProps.put("felix.auto.deploy.action", "install,start");<NEW_LINE>felixProps.put("felix.fileinstall.start.level", "1");<NEW_LINE>felixProps.put("felix.fileinstall.log.level", "3");<NEW_LINE>felixProps.put("org.osgi.framework.startlevel.beginning", "2");<NEW_LINE>felixProps.put("org.osgi.framework.storage.clean", "onFirstInit");<NEW_LINE>felixProps.put("felix.log.level", "3");<NEW_LINE>felixProps.put("felix.fileinstall.disableNio2", "true");<NEW_LINE>felixProps.put("gosh.args", "--noi");<NEW_LINE>// Create host activator;<NEW_LINE>HostActivator hostActivator = HostActivator.instance();<NEW_LINE>felixProps.put(FelixConstants.SYSTEMBUNDLE_ACTIVATORS_PROP, ImmutableList.of(hostActivator));<NEW_LINE>return felixProps;<NEW_LINE>}
felixProps.put(AUTO_DEPLOY_DIR_PROPERTY, felixAutoDeployDirectory);
479,312
private void doAutoEmbedMemoryStrategy() {<NEW_LINE>if (!STRATEGY_NONE.equals(this.strategy)) {<NEW_LINE>if (!mIsVisible && mNestedInstance != null) {<NEW_LINE>if (PRIORITY_LOW.equals(this.priority)) {<NEW_LINE>destoryNestInstance();<NEW_LINE>} else {<NEW_LINE>if (getInstance().hiddenEmbeds == null) {<NEW_LINE>// low is in front, when priority is same, hidden time pre in first<NEW_LINE>getInstance().hiddenEmbeds = new PriorityQueue<>(8, new Comparator<WXEmbed>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int compare(WXEmbed o1, WXEmbed o2) {<NEW_LINE>int level = getLevel(o1) - getLevel(o2);<NEW_LINE>if (level != 0) {<NEW_LINE>return level;<NEW_LINE>}<NEW_LINE>return (int) (o1.hiddenTime - o2.hiddenTime);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>// getInstance().hiddenEmbeds.remove(this);<NEW_LINE>if (!getInstance().hiddenEmbeds.contains(this)) {<NEW_LINE>this.hiddenTime = System.currentTimeMillis();<NEW_LINE>getInstance(<MASK><NEW_LINE>}<NEW_LINE>if (getInstance().hiddenEmbeds != null && getInstance().getMaxHiddenEmbedsNum() >= 0) {<NEW_LINE>while (getInstance().hiddenEmbeds.size() > getInstance().getMaxHiddenEmbedsNum()) {<NEW_LINE>WXEmbed embed = getInstance().hiddenEmbeds.poll();<NEW_LINE>if (embed.mIsVisible) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (embed != null) {<NEW_LINE>embed.destoryNestInstance();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (mIsVisible && mNestedInstance != null) {<NEW_LINE>if (getInstance().hiddenEmbeds != null && getInstance().hiddenEmbeds.contains(this)) {<NEW_LINE>getInstance().hiddenEmbeds.remove(this);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
).hiddenEmbeds.add(this);
1,202,781
public void printStat(Collection<ClassloadersSummaryNode> stats, PrintStream out, boolean printSegments) throws CorruptDataException {<NEW_LINE>int longestName = 0;<NEW_LINE>int numClassloaders = 0;<NEW_LINE>long numROMSegment = 0;<NEW_LINE>long numRAMSegment = 0;<NEW_LINE>long totalROMSegmentAllocatedSize = 0;<NEW_LINE>long totalRAMSegmentAllocatedSize = 0;<NEW_LINE>for (ClassloadersSummaryNode csc : stats) {<NEW_LINE>numClassloaders += csc.numClassloaders;<NEW_LINE>longestName = Math.max(longestName, csc.name.length());<NEW_LINE>}<NEW_LINE>out.println();<NEW_LINE>out.println("[Classloaders Summary]");<NEW_LINE>CommandUtils.dbgPrint(out, "<num, %-" + longestName + "s, # Classloaders, # Loaded Classes", "Classloader name");<NEW_LINE>if (printSegments) {<NEW_LINE>CommandUtils.dbgPrint(out, ", # RAM Segments, RAM Segment memory, # ROM Segments, ROM Segment memory, Total Segments, Segments memory>" + nl);<NEW_LINE>} else {<NEW_LINE>CommandUtils.dbgPrint(out, ", Total Segments, Segments memory>" + nl);<NEW_LINE>}<NEW_LINE>TreeMap<Long, Long> countmap = new TreeMap<Long, Long>(Collections.reverseOrder());<NEW_LINE>HashMap<Long, String> cllist = new LinkedHashMap<Long, String>();<NEW_LINE>int count = 0;<NEW_LINE>for (ClassloadersSummaryNode csc : stats) {<NEW_LINE>long totalSegmentCount = csc.romSegmentCounter + csc.ramSegmentCounter;<NEW_LINE>long totalAllocatedMemoryForclassloader = csc.totalROMSegmentAllocatedMemory + csc.totalRAMSegmentAllocatedMemory;<NEW_LINE>CommandUtils.dbgPrint(out, "%3d) %-" + longestName + "s, %-14d, %-16d", count, csc.name, csc.numClassloaders, csc.numLoadedClasses);<NEW_LINE>if (printSegments) {<NEW_LINE>CommandUtils.dbgPrint(out, ", %-14d, %-18d, %-14d, %-18d, %-14d, %d" + nl, csc.ramSegmentCounter, csc.totalRAMSegmentAllocatedMemory, csc.romSegmentCounter, csc.totalROMSegmentAllocatedMemory, totalSegmentCount, totalAllocatedMemoryForclassloader);<NEW_LINE>} else {<NEW_LINE>CommandUtils.dbgPrint(out, ", %-14d, %d" + nl, totalSegmentCount, totalAllocatedMemoryForclassloader);<NEW_LINE>}<NEW_LINE>numROMSegment += csc.romSegmentCounter;<NEW_LINE>numRAMSegment += csc.ramSegmentCounter;<NEW_LINE>totalROMSegmentAllocatedSize += csc.totalROMSegmentAllocatedMemory;<NEW_LINE>totalRAMSegmentAllocatedSize += csc.totalRAMSegmentAllocatedMemory;<NEW_LINE>Long cpval = <MASK><NEW_LINE>if (cpval != null) {<NEW_LINE>Long clcount = new Long(cpval + csc.numClassloaders);<NEW_LINE>countmap.put(csc.numLoadedClasses, clcount);<NEW_LINE>String list = cllist.get(csc.numLoadedClasses);<NEW_LINE>cllist.put(csc.numLoadedClasses, list + ", " + csc.name);<NEW_LINE>} else {<NEW_LINE>countmap.put(csc.numLoadedClasses, csc.numClassloaders);<NEW_LINE>cllist.put(csc.numLoadedClasses, csc.name);<NEW_LINE>}<NEW_LINE>count += 1;<NEW_LINE>}<NEW_LINE>if (!countmap.isEmpty()) {<NEW_LINE>out.println("\n<# Loaded Classes, # Classloaders, Classloader Names>");<NEW_LINE>for (Map.Entry<Long, Long> entry : countmap.entrySet()) {<NEW_LINE>CommandUtils.dbgPrint(out, "%-17d, %-14d, %s" + nl, entry.getKey(), entry.getValue(), cllist.get(entry.getKey()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>out.println();<NEW_LINE>out.println("Number of Classloaders: " + numClassloaders);<NEW_LINE>out.println();<NEW_LINE>out.println("Segment Totals: ");<NEW_LINE>out.println("\n<# RAM Segments, RAM Segments memory, # ROM Segments, ROM Segments memory, Total Segments, Segments memory>");<NEW_LINE>CommandUtils.dbgPrint(out, " %-14d, %-19d, %-14d, %-19d, %-14d, %d", numRAMSegment, totalRAMSegmentAllocatedSize, numROMSegment, totalROMSegmentAllocatedSize, numRAMSegment + numROMSegment, totalRAMSegmentAllocatedSize + totalROMSegmentAllocatedSize);<NEW_LINE>out.println();<NEW_LINE>}
countmap.get(csc.numLoadedClasses);
1,497,092
private static URI goUp(URI u) {<NEW_LINE>assert u.isAbsolute() : u;<NEW_LINE>assert u.getFragment() == null : u;<NEW_LINE>assert u.getQuery() == null : u;<NEW_LINE>// XXX isn't there any easier way to do this?<NEW_LINE>// Using getPath in the new path does not work; nbfs: URLs break. (#39613)<NEW_LINE>// On the other hand, nbfs: URLs are not really used any more, so do we care?<NEW_LINE>String path = u.getPath();<NEW_LINE>if (path == null || path.equals("/")) {<NEW_LINE>// NOI18N<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>String us = u.toString();<NEW_LINE>if (us.endsWith("/")) {<NEW_LINE>// NOI18N<NEW_LINE>us = us.substring(0, us.length() - 1);<NEW_LINE>// NOI18N<NEW_LINE>assert path.endsWith("/");<NEW_LINE>path = path.substring(0, path.length() - 1);<NEW_LINE>}<NEW_LINE>int idx = us.lastIndexOf('/');<NEW_LINE>assert idx != -1 : path;<NEW_LINE>if (path.lastIndexOf('/') == 0) {<NEW_LINE>us = us.substring(0, idx + 1);<NEW_LINE>} else {<NEW_LINE>us = us.substring(0, idx);<NEW_LINE>}<NEW_LINE>URI nue;<NEW_LINE>try {<NEW_LINE>nue = new URI(us);<NEW_LINE>} catch (URISyntaxException e) {<NEW_LINE>throw new AssertionError(e);<NEW_LINE>}<NEW_LINE>if (WINDOWS) {<NEW_LINE><MASK><NEW_LINE>// check that path is not "/C:" or "/"<NEW_LINE>if ((pth.length() == 3 && pth.endsWith(":")) || (pth.length() == 1 && pth.endsWith("/"))) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>assert nue.isAbsolute() : nue;<NEW_LINE>assert u.toString().startsWith(nue.toString()) : "not a parent: " + nue + " of " + u;<NEW_LINE>return nue;<NEW_LINE>}
String pth = nue.getPath();
1,739,093
public void draw(Canvas canvas) {<NEW_LINE>mLeftPauseBar.rewind();<NEW_LINE>mRightPauseBar.rewind();<NEW_LINE>// The current distance between the two pause bars.<NEW_LINE>final float barDist = lerp(mPauseBarDistance, 0, mProgress) - 1;<NEW_LINE>// The current width of each pause bar.<NEW_LINE>final float barWidth = lerp(mPauseBarWidth, mPauseBarHeight / 1.75f, mProgress);<NEW_LINE>// The current position of the left pause bar's top left coordinate.<NEW_LINE>final float firstBarTopLeft = lerp(0, barWidth, mProgress);<NEW_LINE>// The current position of the right pause bar's top right coordinate.<NEW_LINE>final float secondBarTopRight = lerp(2 * barWidth + barDist, barWidth + barDist, mProgress);<NEW_LINE>// Draw the left pause bar. The left pause bar transforms into the<NEW_LINE>// top half of the play button triangle by animating the position of the<NEW_LINE>// rectangle's top left coordinate and expanding its bottom width.<NEW_LINE>mLeftPauseBar.moveTo(0, 0);<NEW_LINE>mLeftPauseBar.lineTo(firstBarTopLeft, -mPauseBarHeight);<NEW_LINE>mLeftPauseBar.lineTo(barWidth, -mPauseBarHeight);<NEW_LINE>mLeftPauseBar.lineTo(barWidth, 0);<NEW_LINE>mLeftPauseBar.close();<NEW_LINE>// Draw the right pause bar. The right pause bar transforms into the<NEW_LINE>// bottom half of the play button triangle by animating the position of the<NEW_LINE>// rectangle's top right coordinate and expanding its bottom width.<NEW_LINE>mRightPauseBar.moveTo(barWidth + barDist, 0);<NEW_LINE>mRightPauseBar.lineTo(barWidth + barDist, -mPauseBarHeight);<NEW_LINE>mRightPauseBar.lineTo(secondBarTopRight, -mPauseBarHeight);<NEW_LINE>mRightPauseBar.lineTo(2 * barWidth + barDist, 0);<NEW_LINE>mRightPauseBar.close();<NEW_LINE>canvas.save();<NEW_LINE>// Translate the play button a tiny bit to the right so it looks more centered.<NEW_LINE>canvas.translate(lerp(0, mPauseBarHeight / 8f, mProgress), 0);<NEW_LINE>// (1) Pause --> Play: rotate 0 to 90 degrees clockwise.<NEW_LINE>// (2) Play --> Pause: rotate 90 to 180 degrees clockwise.<NEW_LINE>final float rotationProgress = mIsPlay ? 1 - mProgress : mProgress;<NEW_LINE>final float startingRotation = mIsPlay ? 90 : 0;<NEW_LINE>canvas.rotate(lerp(startingRotation, startingRotation + 90, rotationProgress), mWidth / 2f, mHeight / 2f);<NEW_LINE>// Position the pause/play button in the center of the drawable's bounds.<NEW_LINE>canvas.translate(mWidth / 2f - ((2 * barWidth + barDist) / 2f), mHeight / 2f + (mPauseBarHeight / 2f));<NEW_LINE>// Draw the two bars that form the animated pause/play button.<NEW_LINE>canvas.drawPath(mLeftPauseBar, mPaint);<NEW_LINE><MASK><NEW_LINE>canvas.restore();<NEW_LINE>}
canvas.drawPath(mRightPauseBar, mPaint);