idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
345,548
public com.amazonaws.services.fsx.model.ResourceDoesNotSupportTaggingException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.fsx.model.ResourceDoesNotSupportTaggingException resourceDoesNotSupportTaggingException = new com.amazonaws.services.<MASK><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("ResourceARN", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>resourceDoesNotSupportTaggingException.setResourceARN(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return resourceDoesNotSupportTaggingException;<NEW_LINE>}
fsx.model.ResourceDoesNotSupportTaggingException(null);
114,594
public AviatorObject call(final Map<String, Object> env, final AviatorObject arg1, final AviatorObject arg2, final AviatorObject arg3) {<NEW_LINE>Object coll = arg1.getValue(env);<NEW_LINE>Object <MASK><NEW_LINE>Object val = arg3.getValue(env);<NEW_LINE>if (coll == null) {<NEW_LINE>throw new NullPointerException("null seq");<NEW_LINE>}<NEW_LINE>Class<?> clazz = coll.getClass();<NEW_LINE>Object previousVal = null;<NEW_LINE>if (List.class.isAssignableFrom(clazz)) {<NEW_LINE>int index = ((Number) key).intValue();<NEW_LINE>previousVal = ((List) coll).set(index, val);<NEW_LINE>} else if (Map.class.isAssignableFrom(clazz)) {<NEW_LINE>previousVal = ((Map) coll).put(key, val);<NEW_LINE>} else if (clazz.isArray()) {<NEW_LINE>int index = ((Number) key).intValue();<NEW_LINE>previousVal = Array.get(coll, index);<NEW_LINE>Array.set(coll, index, val);<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException(arg1.desc(env) + " can't put elements.");<NEW_LINE>}<NEW_LINE>return AviatorRuntimeJavaType.valueOf(previousVal);<NEW_LINE>}
key = arg2.getValue(env);
1,728,431
public Clustering<Model> run(Relation<? extends NumberVector> relation) {<NEW_LINE>// current dimensionality associated with each seed<NEW_LINE>int dim_c = RelationUtil.dimensionality(relation);<NEW_LINE>if (dim_c < l) {<NEW_LINE>throw new IllegalStateException("Dimensionality of data < parameter l! " + "(" + dim_c + " < " + l + ")");<NEW_LINE>}<NEW_LINE>// current number of seeds<NEW_LINE>int k_c = Math.min(relation.size(), k_i * k);<NEW_LINE>// pick k0 > k points from the database<NEW_LINE>List<ORCLUSCluster> clusters = initialSeeds(relation, k_c);<NEW_LINE>double beta = FastMath.exp(-FastMath.log(dim_c / (double) l) * FastMath.log(1 / alpha) / FastMath.log(k_c / (double) k));<NEW_LINE>IndefiniteProgress cprogress = LOG.isVerbose() ? new IndefiniteProgress("Current number of clusters:", LOG) : null;<NEW_LINE>while (k_c > k) {<NEW_LINE>// find partitioning induced by the seeds of the clusters<NEW_LINE>assign(relation, clusters);<NEW_LINE>// determine current subspace associated with each cluster<NEW_LINE>for (ORCLUSCluster cluster : clusters) {<NEW_LINE>if (cluster.objectIDs.size() > 0) {<NEW_LINE>cluster.basis = findBasis(relation, cluster, dim_c);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// reduce number of seeds and dimensionality associated with<NEW_LINE>// each seed<NEW_LINE>k_c = (int) Math.max(k, k_c * alpha);<NEW_LINE>dim_c = (int) Math.max(l, dim_c * beta);<NEW_LINE>merge(relation, clusters, k_c, dim_c, cprogress);<NEW_LINE>if (cprogress != null) {<NEW_LINE>cprogress.setProcessed(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>assign(relation, clusters);<NEW_LINE>LOG.setCompleted(cprogress);<NEW_LINE>// get the result<NEW_LINE>Clustering<Model> result = new Clustering<>();<NEW_LINE>Metadata.of(result).setLongName("ORCLUS Clustering");<NEW_LINE>for (ORCLUSCluster c : clusters) {<NEW_LINE>result.addToplevelCluster(new Cluster<Model>(c.objectIDs, ClusterModel.CLUSTER));<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
clusters.size(), LOG);
688,970
protected Javers assembleJaversInstance() {<NEW_LINE>CoreConfiguration coreConfiguration = configurationBuilder().build();<NEW_LINE>addComponent(coreConfiguration);<NEW_LINE>// boot main modules<NEW_LINE>addModule(new DiffFactoryModule());<NEW_LINE>addModule(new CommitFactoryModule(getContainer()));<NEW_LINE>addModule(new SnapshotModule(getContainer()));<NEW_LINE>addModule(new GraphFactoryModule(getContainer()));<NEW_LINE>addModule(new DiffAppendersModule(coreConfiguration, getContainer()));<NEW_LINE>addModule(new TailoredJaversMemberFactoryModule(coreConfiguration, getContainer()));<NEW_LINE>addModule(new ScannerModule(coreConfiguration, getContainer()));<NEW_LINE>addModule(new ShadowModule(getContainer()));<NEW_LINE>addModule(new JqlModule(getContainer()));<NEW_LINE>// boot TypeMapper module<NEW_LINE>addComponent(new DynamicMappingStrategy(ignoredClassesStrategy));<NEW_LINE>addModule(new TypeMapperModule(getContainer()));<NEW_LINE>// boot add-ons modules<NEW_LINE>Set<JaversType> additionalTypes = bootAddOns();<NEW_LINE>// boot JSON beans & domain aware typeAdapters<NEW_LINE>bootJsonConverter();<NEW_LINE>bootDateTimeProvider();<NEW_LINE>// clases to scan & additionalTypes<NEW_LINE>for (Class c : classesToScan) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>typeMapper().addPluginTypes(additionalTypes);<NEW_LINE>mapRegisteredClasses();<NEW_LINE>bootRepository();<NEW_LINE>return getContainerComponent(JaversCore.class);<NEW_LINE>}
typeMapper().getJaversType(c);
903,880
public GetDomainNameResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>GetDomainNameResult getDomainNameResult = new GetDomainNameResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return getDomainNameResult;<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("domainNameConfig", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getDomainNameResult.setDomainNameConfig(DomainNameConfigJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return getDomainNameResult;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
1,230,619
private Future<Connection> login(MSSQLSocketConnection conn, String username, String password, String database, Byte encryptionLevel, EventLoopContext context) {<NEW_LINE>if (clientConfigSsl && encryptionLevel != ENCRYPT_ON && encryptionLevel != ENCRYPT_REQ) {<NEW_LINE>Promise<Void> closePromise = context.promise();<NEW_LINE>conn.close(null, closePromise);<NEW_LINE>return closePromise.future().transform(v -> context.failedFuture("The client is configured for encryption but the server does not support it"));<NEW_LINE>}<NEW_LINE>Future<Void> future;<NEW_LINE>if (encryptionLevel != ENCRYPT_NOT_SUP) {<NEW_LINE>// Start connection encryption ...<NEW_LINE>future = conn.enableSsl(clientConfigSsl<MASK><NEW_LINE>} else {<NEW_LINE>// ... unless the client did not require encryption and the server does not support it<NEW_LINE>future = context.succeededFuture();<NEW_LINE>}<NEW_LINE>return future.compose(v -> conn.sendLoginMessage(username, password, database, properties));<NEW_LINE>}
, encryptionLevel, (MSSQLConnectOptions) options);
1,201,310
private void submitChange(String changeId) throws RepoException, ValidationException {<NEW_LINE>try (ProfilerTask ignore = generalOptions.profiler().start("submit_gerrit_change")) {<NEW_LINE>ChangeInfo changeInfo = findChange(changeId);<NEW_LINE>if (changeInfo == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>GerritApi gerritApi = gerritOptions.newGerritApi(repoUrl);<NEW_LINE>// If the change isn't yet submittable, try voting Code-Review+2 to approve the change.<NEW_LINE>// The change will generally not be submittable until it receives Code-Review+2, but<NEW_LINE>// individual Gerrit projects can change their Prolog submittability rules to change this<NEW_LINE>// behavior, and even to get rid of the Code-Review label entirely.<NEW_LINE>if (!changeInfo.isSubmittable()) {<NEW_LINE>gerritApi.setReview(changeInfo.getChangeId(), changeInfo.getCurrentRevision(), new SetReviewInput("", ImmutableMap.of("Code-Review", 2)));<NEW_LINE>}<NEW_LINE>ChangeInfo resultInfo = gerritApi.submitChange(changeInfo.getChangeId(), new SubmitInput(null));<NEW_LINE>console.infoFmt("Submitted change : %s/changes/%s", <MASK><NEW_LINE>} catch (RepoException e) {<NEW_LINE>if (e.getMessage().contains("2 is restricted")) {<NEW_LINE>throw new ValidationException(e.getMessage(), e);<NEW_LINE>}<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>}
repoUrl, resultInfo.getChangeId());
662,137
public List<StaticAsset> readAllStaticAssets() {<NEW_LINE><MASK><NEW_LINE>CriteriaQuery<StaticAsset> criteria = builder.createQuery(StaticAsset.class);<NEW_LINE>Root<StaticAssetImpl> handler = criteria.from(StaticAssetImpl.class);<NEW_LINE>criteria.select(handler);<NEW_LINE>List<Predicate> restrictions = new ArrayList<Predicate>();<NEW_LINE>List<Order> sorts = new ArrayList<Order>();<NEW_LINE>try {<NEW_LINE>if (queryExtensionManager != null) {<NEW_LINE>queryExtensionManager.getProxy().setup(StaticAssetImpl.class, null);<NEW_LINE>queryExtensionManager.getProxy().refineRetrieve(StaticAssetImpl.class, null, builder, criteria, handler, restrictions);<NEW_LINE>queryExtensionManager.getProxy().refineOrder(StaticAssetImpl.class, null, builder, criteria, handler, sorts);<NEW_LINE>}<NEW_LINE>criteria.where(restrictions.toArray(new Predicate[restrictions.size()]));<NEW_LINE>return em.createQuery(criteria).getResultList();<NEW_LINE>} catch (NoResultException e) {<NEW_LINE>return new ArrayList<StaticAsset>();<NEW_LINE>} finally {<NEW_LINE>if (queryExtensionManager != null) {<NEW_LINE>queryExtensionManager.getProxy().breakdown(StaticAssetImpl.class, null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
CriteriaBuilder builder = em.getCriteriaBuilder();
285,310
public void computeModuleUpdates(IClasspathEntry entry) throws JavaModelException {<NEW_LINE>for (IClasspathAttribute attribute : entry.getExtraAttributes()) {<NEW_LINE><MASK><NEW_LINE>// the attributes considered here may have multiple values separated by ':'<NEW_LINE>String values = attribute.getValue();<NEW_LINE>if (attributeName.equals(IClasspathAttribute.ADD_EXPORTS)) {<NEW_LINE>for (String value : values.split(":")) {<NEW_LINE>// format: <source-module>/<package>=<target-module>(,<target-module>)* //$NON-NLS-1$<NEW_LINE>int slash = value.indexOf('/');<NEW_LINE>int equals = value.indexOf('=');<NEW_LINE>if (slash != -1 && equals != -1) {<NEW_LINE>String modName = value.substring(0, slash);<NEW_LINE>char[] packName = value.substring(slash + 1, equals).toCharArray();<NEW_LINE>char[][] targets = CharOperation.splitOn(',', value.substring(equals + 1).toCharArray());<NEW_LINE>addModuleUpdate(modName, new IUpdatableModule.AddExports(packName, targets), UpdateKind.PACKAGE);<NEW_LINE>} else {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>Util.log(IStatus.WARNING, "Invalid argument to add-exports: " + value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (attributeName.equals(IClasspathAttribute.ADD_READS)) {<NEW_LINE>for (String value : values.split(":")) {<NEW_LINE>// format: <source-module>=<target-module> //$NON-NLS-1$<NEW_LINE>int equals = value.indexOf('=');<NEW_LINE>if (equals != -1) {<NEW_LINE>String srcMod = value.substring(0, equals);<NEW_LINE>char[] targetMod = value.substring(equals + 1).toCharArray();<NEW_LINE>addModuleUpdate(srcMod, new IUpdatableModule.AddReads(targetMod), UpdateKind.MODULE);<NEW_LINE>} else {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>Util.log(IStatus.WARNING, "Invalid argument to add-reads: " + value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (attributeName.equals(IClasspathAttribute.MODULE_MAIN_CLASS)) {<NEW_LINE>IModuleDescription module = this.javaProoject.getModuleDescription();<NEW_LINE>if (module == null)<NEW_LINE>throw new JavaModelException(new JavaModelStatus(IJavaModelStatusConstants.ELEMENT_DOES_NOT_EXIST));<NEW_LINE>addModuleUpdate(module.getElementName(), m -> m.setMainClassName(values.toCharArray()), UpdateKind.MODULE);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
String attributeName = attribute.getName();
475,085
static Iterator<Quad> accessData(Tuple<Node> patternTuple, NodeTupleTable nodeTupleTable, boolean anyGraph, Predicate<Tuple<NodeId>> filter, ExecutionContext execCxt) {<NEW_LINE>NodeTable nodeTable = nodeTupleTable.getNodeTable();<NEW_LINE>Function<Tuple<NodeId>, Quad> asQuad = asQuad(nodeTable, <MASK><NEW_LINE>Tuple<NodeId> patternTupleId = TupleLib.tupleNodeIds(nodeTable, patternTuple);<NEW_LINE>if (patternTupleId.contains(NodeId.NodeDoesNotExist))<NEW_LINE>// Can not match.<NEW_LINE>return Iter.nullIterator();<NEW_LINE>// -- DRY/StageMatchTuple ??<NEW_LINE>Iterator<Tuple<NodeId>> iterMatches = nodeTupleTable.find(patternTupleId);<NEW_LINE>// Add filter<NEW_LINE>if (filter != null)<NEW_LINE>iterMatches = Iter.filter(iterMatches, filter);<NEW_LINE>// Add anyGraph<NEW_LINE>if (anyGraph) {<NEW_LINE>// See StageMatchTuple for discussion.<NEW_LINE>iterMatches = Iter.map(iterMatches, quadsToAnyTriples);<NEW_LINE>iterMatches = Iter.distinctAdjacent(iterMatches);<NEW_LINE>}<NEW_LINE>// -- DRY/StageMatchTuple<NEW_LINE>// Iterator<Quad> qIter = TupleLib.convertToQuads(nodeTable, iterMatches) ;<NEW_LINE>Iterator<Quad> qIter = Iter.map(iterMatches, asQuad);<NEW_LINE>return qIter;<NEW_LINE>}
nodeTupleTable.getTupleLen(), anyGraph);
1,146,187
public void initRuntimeLibraryTypedAsts(Optional<ColorPool.Builder> colorPoolBuilder) {<NEW_LINE>checkState(this.runtimeLibraryTypedAsts == null);<NEW_LINE>String path = String.join("", "/runtime_libs.typedast");<NEW_LINE>TypedAstDeserializer.DeserializedAst astData = TypedAstDeserializer.deserializeRuntimeLibraries(this, SYNTHETIC_EXTERNS_FILE, colorPoolBuilder, Compiler<MASK><NEW_LINE>// Re-index the runtime libraries by file name rather than SourceFile object<NEW_LINE>LinkedHashMap<String, Supplier<Node>> runtimeLibraryTypedAsts = new LinkedHashMap<>();<NEW_LINE>for (Map.Entry<SourceFile, Supplier<Node>> library : astData.getFilesystem().entrySet()) {<NEW_LINE>runtimeLibraryTypedAsts.computeIfAbsent(library.getKey().getName(), (f) -> library.getValue());<NEW_LINE>}<NEW_LINE>this.runtimeLibraryTypedAsts = ImmutableMap.copyOf(runtimeLibraryTypedAsts);<NEW_LINE>}
.class.getResourceAsStream(path));
1,054,532
public BeanDefinition parse(Element elt, ParserContext pc) {<NEW_LINE>String loginUrl = null;<NEW_LINE>String defaultTargetUrl = null;<NEW_LINE>String authenticationFailureUrl = null;<NEW_LINE>String alwaysUseDefault = null;<NEW_LINE>String successHandlerRef = null;<NEW_LINE>String failureHandlerRef = null;<NEW_LINE>// Only available with form-login<NEW_LINE>String usernameParameter = null;<NEW_LINE>String passwordParameter = null;<NEW_LINE>String authDetailsSourceRef = null;<NEW_LINE>String authenticationFailureForwardUrl = null;<NEW_LINE>String authenticationSuccessForwardUrl = null;<NEW_LINE>Object source = null;<NEW_LINE>if (elt != null) {<NEW_LINE>source = pc.extractSource(elt);<NEW_LINE>loginUrl = elt.getAttribute(ATT_LOGIN_URL);<NEW_LINE>WebConfigUtils.validateHttpRedirect(loginUrl, pc, source);<NEW_LINE>defaultTargetUrl = elt.getAttribute(ATT_FORM_LOGIN_TARGET_URL);<NEW_LINE>WebConfigUtils.validateHttpRedirect(defaultTargetUrl, pc, source);<NEW_LINE>authenticationFailureUrl = elt.getAttribute(ATT_FORM_LOGIN_AUTHENTICATION_FAILURE_URL);<NEW_LINE>WebConfigUtils.validateHttpRedirect(authenticationFailureUrl, pc, source);<NEW_LINE>alwaysUseDefault = elt.getAttribute(ATT_ALWAYS_USE_DEFAULT_TARGET_URL);<NEW_LINE>this.loginPage = elt.getAttribute(ATT_LOGIN_PAGE);<NEW_LINE>successHandlerRef = elt.getAttribute(ATT_SUCCESS_HANDLER_REF);<NEW_LINE>failureHandlerRef = elt.getAttribute(ATT_FAILURE_HANDLER_REF);<NEW_LINE>authDetailsSourceRef = elt.getAttribute(AuthenticationConfigBuilder.ATT_AUTH_DETAILS_SOURCE_REF);<NEW_LINE>authenticationFailureForwardUrl = elt.getAttribute(ATT_FORM_LOGIN_AUTHENTICATION_FAILURE_FORWARD_URL);<NEW_LINE>WebConfigUtils.<MASK><NEW_LINE>authenticationSuccessForwardUrl = elt.getAttribute(ATT_FORM_LOGIN_AUTHENTICATION_SUCCESS_FORWARD_URL);<NEW_LINE>WebConfigUtils.validateHttpRedirect(authenticationSuccessForwardUrl, pc, source);<NEW_LINE>if (!StringUtils.hasText(this.loginPage)) {<NEW_LINE>this.loginPage = null;<NEW_LINE>}<NEW_LINE>WebConfigUtils.validateHttpRedirect(this.loginPage, pc, source);<NEW_LINE>usernameParameter = elt.getAttribute(ATT_USERNAME_PARAMETER);<NEW_LINE>passwordParameter = elt.getAttribute(ATT_PASSWORD_PARAMETER);<NEW_LINE>}<NEW_LINE>this.filterBean = createFilterBean(loginUrl, defaultTargetUrl, alwaysUseDefault, this.loginPage, authenticationFailureUrl, successHandlerRef, failureHandlerRef, authDetailsSourceRef, authenticationFailureForwardUrl, authenticationSuccessForwardUrl);<NEW_LINE>if (StringUtils.hasText(usernameParameter)) {<NEW_LINE>this.filterBean.getPropertyValues().addPropertyValue("usernameParameter", usernameParameter);<NEW_LINE>}<NEW_LINE>if (StringUtils.hasText(passwordParameter)) {<NEW_LINE>this.filterBean.getPropertyValues().addPropertyValue("passwordParameter", passwordParameter);<NEW_LINE>}<NEW_LINE>this.filterBean.setSource(source);<NEW_LINE>BeanDefinitionBuilder entryPointBuilder = BeanDefinitionBuilder.rootBeanDefinition(LoginUrlAuthenticationEntryPoint.class);<NEW_LINE>entryPointBuilder.getRawBeanDefinition().setSource(source);<NEW_LINE>entryPointBuilder.addConstructorArgValue((this.loginPage != null) ? this.loginPage : DEF_LOGIN_PAGE);<NEW_LINE>entryPointBuilder.addPropertyValue("portMapper", this.portMapper);<NEW_LINE>entryPointBuilder.addPropertyValue("portResolver", this.portResolver);<NEW_LINE>this.entryPointBean = (RootBeanDefinition) entryPointBuilder.getBeanDefinition();<NEW_LINE>return null;<NEW_LINE>}
validateHttpRedirect(authenticationFailureForwardUrl, pc, source);
1,038,835
Optional<ImagesAndRegistryClient> tryMirrors(BuildContext buildContext, ProgressEventDispatcher.Factory progressDispatcherFactory) throws LayerCountMismatchException, BadContainerConfigurationFormatException {<NEW_LINE>EventHandlers eventHandlers = buildContext.getEventHandlers();<NEW_LINE>Collection<Map.Entry<String, String>> mirrorEntries = buildContext.getRegistryMirrors().entries();<NEW_LINE>try (ProgressEventDispatcher progressDispatcher1 = progressDispatcherFactory.create("trying mirrors", mirrorEntries.size());<NEW_LINE>TimerEventDispatcher ignored1 = new TimerEventDispatcher(eventHandlers, "trying mirrors")) {<NEW_LINE>for (Map.Entry<String, String> entry : mirrorEntries) {<NEW_LINE>String registry = entry.getKey();<NEW_LINE><MASK><NEW_LINE>eventHandlers.dispatch(LogEvent.debug("mirror config: " + registry + " --> " + mirror));<NEW_LINE>if (!buildContext.getBaseImageConfiguration().getImageRegistry().equals(registry)) {<NEW_LINE>progressDispatcher1.dispatchProgress(1);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>eventHandlers.dispatch(LogEvent.info("trying mirror " + mirror + " for the base image"));<NEW_LINE>try (ProgressEventDispatcher progressDispatcher2 = progressDispatcher1.newChildProducer().create("trying mirror " + mirror, 2)) {<NEW_LINE>RegistryClient registryClient = buildContext.newBaseImageRegistryClientFactory(mirror).newRegistryClient();<NEW_LINE>List<Image> images = pullPublicImages(registryClient, progressDispatcher2);<NEW_LINE>eventHandlers.dispatch(LogEvent.info("pulled manifest from mirror " + mirror));<NEW_LINE>return Optional.of(new ImagesAndRegistryClient(images, registryClient));<NEW_LINE>} catch (IOException | RegistryException ex) {<NEW_LINE>// Ignore errors from this mirror and continue.<NEW_LINE>eventHandlers.dispatch(LogEvent.debug("failed to get manifest from mirror " + mirror + ": " + ex.getMessage()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>}
String mirror = entry.getValue();
1,530,452
/*<NEW_LINE>* Client to test Advertize... Run it on node boxes to test for firewall.<NEW_LINE>*/<NEW_LINE>public static void main(String[] args) throws Exception {<NEW_LINE>if (args.length != 2 && args.length != 3) {<NEW_LINE>System.out.println("Usage: Advertize multicastaddress port [bindaddress]");<NEW_LINE>System.out.println("java Advertize 224.0.1.105 23364");<NEW_LINE>System.out.println("or");<NEW_LINE>System.out.println("java Advertize 224.0.1.105 23364 10.33.144.3");<NEW_LINE>System.out.println("receive from 224.0.1.105:23364");<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>InetAddress group = InetAddress.getByName(args[0]);<NEW_LINE>int port = Integer.parseInt(args[1]);<NEW_LINE>InetAddress socketInterface = null;<NEW_LINE>if (args.length == 3)<NEW_LINE>socketInterface = InetAddress.getByName(args[2]);<NEW_LINE>MulticastSocket s = null;<NEW_LINE>String value = System.getProperty("os.name");<NEW_LINE>if ((value != null) && (value.toLowerCase().startsWith("linux") || value.toLowerCase().startsWith("mac") || value.toLowerCase().startsWith("hp"))) {<NEW_LINE><MASK><NEW_LINE>s = new MulticastSocket(new InetSocketAddress(group, port));<NEW_LINE>} else<NEW_LINE>s = new MulticastSocket(port);<NEW_LINE>s.setTimeToLive(0);<NEW_LINE>if (socketInterface != null) {<NEW_LINE>s.setInterface(socketInterface);<NEW_LINE>}<NEW_LINE>s.joinGroup(group);<NEW_LINE>boolean ok = true;<NEW_LINE>System.out.println("ready waiting...");<NEW_LINE>while (ok) {<NEW_LINE>byte[] buf = new byte[1000];<NEW_LINE>DatagramPacket recv = new DatagramPacket(buf, buf.length);<NEW_LINE>s.receive(recv);<NEW_LINE>String data = new String(buf);<NEW_LINE>System.out.println("received: " + data);<NEW_LINE>System.out.println("received from " + recv.getSocketAddress());<NEW_LINE>}<NEW_LINE>s.leaveGroup(group);<NEW_LINE>}
System.out.println("Linux like OS");
1,177,466
public static Map<String, String> listCategoriesAndTitles(String docLang) {<NEW_LINE>String docLangDir = (docLang != null && (!"en".equalsIgnoreCase(docLang) && !docLang.matches("en-.*"))) ? "_" + docLang : "";<NEW_LINE>File[] categories = new File(cheatSheetBaseDir + docLangDir).listFiles(new FileFilter() {<NEW_LINE><NEW_LINE>public boolean accept(File pathname) {<NEW_LINE>return pathname.isDirectory();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>if (categories == null || categories.length <= 0) {<NEW_LINE>categories = cheatSheetBaseDir.listFiles(new FileFilter() {<NEW_LINE><NEW_LINE>public boolean accept(File pathname) {<NEW_LINE>return pathname.isDirectory();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>Arrays.sort(categories);<NEW_LINE>Map<String, String> categoriesAndTitles = new <MASK><NEW_LINE>for (File category : categories) {<NEW_LINE>categoriesAndTitles.put(category.getName(), getCategoryTitle(category.getName()));<NEW_LINE>}<NEW_LINE>return categoriesAndTitles;<NEW_LINE>}
LinkedHashMap<String, String>();
60,133
void handleResponse(List<Slot> slots, MultiSearchResponse response, Exception e) {<NEW_LINE>remoteRequestPermits.release();<NEW_LINE>executedSearchesTotal.<MASK><NEW_LINE>if (response != null) {<NEW_LINE>assert slots.size() == response.getResponses().length;<NEW_LINE>for (int i = 0; i < response.getResponses().length; i++) {<NEW_LINE>MultiSearchResponse.Item responseItem = response.getResponses()[i];<NEW_LINE>Slot slot = slots.get(i);<NEW_LINE>if (responseItem.isFailure()) {<NEW_LINE>slot.actionListener.onFailure(responseItem.getFailure());<NEW_LINE>} else {<NEW_LINE>slot.actionListener.onResponse(responseItem.getResponse());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (e != null) {<NEW_LINE>slots.forEach(slot -> slot.actionListener.onFailure(e));<NEW_LINE>} else {<NEW_LINE>throw new AssertionError("no response and no error");<NEW_LINE>}<NEW_LINE>// There may be room to for a new request now that numberOfOutstandingRequests has been decreased:<NEW_LINE>coordinateLookups();<NEW_LINE>}
add(slots.size());
940,241
void runStartCellPhase() {<NEW_LINE>int startCell = isochroneNodeStorage.getCellId(fromNonVirtual);<NEW_LINE>CoreRangeDijkstra coreRangeDijkstra = new CoreRangeDijkstra(graph, weighting, isochroneNodeStorage, borderNodeDistanceStorage);<NEW_LINE>EdgeFilterSequence edgeFilterSequence = new EdgeFilterSequence();<NEW_LINE>if (additionalEdgeFilter != null)<NEW_LINE>edgeFilterSequence.add(additionalEdgeFilter);<NEW_LINE>edgeFilterSequence.add(new CellAndBorderNodeFilter(isochroneNodeStorage, startCell, graph.getNodes()));<NEW_LINE>coreRangeDijkstra.setEdgeFilter(edgeFilterSequence);<NEW_LINE>coreRangeDijkstra.setIsochroneLimit(isochroneLimit);<NEW_LINE>coreRangeDijkstra.initFrom(from);<NEW_LINE>coreRangeDijkstra.runAlgo();<NEW_LINE>startCellMap = coreRangeDijkstra.getFromMap();<NEW_LINE>findFullyReachableCells(startCellMap);<NEW_LINE>for (int inactiveBorderNode : inactiveBorderNodes) {<NEW_LINE>startCellMap.remove(inactiveBorderNode);<NEW_LINE>activeBorderNodes.remove(inactiveBorderNode);<NEW_LINE>}<NEW_LINE>for (int sweepEndNode : activeBorderNodes) {<NEW_LINE>double dist = coreRangeDijkstra.fromMap.get(sweepEndNode).getWeightOfVisitedPath();<NEW_LINE>int cell = isochroneNodeStorage.getCellId(sweepEndNode);<NEW_LINE>if (cell == startCell)<NEW_LINE>continue;<NEW_LINE>if (!upAndCoreGraphDistMap.containsKey(cell))<NEW_LINE>upAndCoreGraphDistMap.put(cell, new HashMap<>());<NEW_LINE>upAndCoreGraphDistMap.get(cell<MASK><NEW_LINE>startCellMap.remove(sweepEndNode);<NEW_LINE>}<NEW_LINE>}
).put(sweepEndNode, dist);
1,816,632
private long processNackWithReturnValue(ControlNack nackMsg) throws SIResourceException {<NEW_LINE>// This is called by a PubSubOutputHandler when it finds Unknown<NEW_LINE>// ticks in it's own stream and need the InputStream to resend them<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.entry(tc, "processNackWithReturnValue", nackMsg);<NEW_LINE>long returnValue = -1;<NEW_LINE>// The upstream cellule for this stream is stored in the originStreamMap<NEW_LINE>// unless we were the originator.<NEW_LINE>SIBUuid12 stream = nackMsg.getGuaranteedStreamUUID();<NEW_LINE>if (_sourceStreamManager.hasStream(stream)) {<NEW_LINE>// 242139: Currently we get back to here for every processNack<NEW_LINE>// that the InternalOutputStream handles. This is an error but<NEW_LINE>// a harmles one. For now the fix is to avoid throwing an exception<NEW_LINE>// as the InternalOutputstream has in fact satisfied the Nack correctly.<NEW_LINE>// The longer term fix is to writeCombined range into the IOS not just the<NEW_LINE>// value<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())<NEW_LINE><MASK><NEW_LINE>returnValue = _sourceStreamManager.getStreamSet().getStream(nackMsg.getPriority(), nackMsg.getReliability()).getCompletedPrefix();<NEW_LINE>} else {<NEW_LINE>// Else we are an IME<NEW_LINE>// send nacks if necessary<NEW_LINE>_internalInputStreamManager.processNack(nackMsg);<NEW_LINE>}<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.exit(tc, "processNackWithReturnValue", new Long(returnValue));<NEW_LINE>return returnValue;<NEW_LINE>}
SibTr.debug(tc, "Ignoring processNack on sourceStream at PubSubInputHandler");
1,301,061
/* Plays midi file through the system's midi sequencer.<NEW_LINE>* @param inFilepath points to a local file containing symbolic melodies<NEW_LINE>* @param instrumentName : See the list in Midi2MelodyStrings.java. If null, defaults to "Acoustic Grand Piano".<NEW_LINE>* @param secondsToPlay -- seconds after which to stop the music playback.<NEW_LINE>*/<NEW_LINE>public static void playMelodies(String inFilepath, int instrumentNumber, double secondsToPlay) throws IOException, MidiUnavailableException, InvalidMidiDataException {<NEW_LINE>System.<MASK><NEW_LINE>BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(inFilepath)));<NEW_LINE>int lineNumber = 0;<NEW_LINE>int startNote = 45;<NEW_LINE>while (true) {<NEW_LINE>String line = reader.readLine();<NEW_LINE>if (line == null) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>lineNumber++;<NEW_LINE>line = line.trim();<NEW_LINE>if (line.equals("")) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (line.startsWith(MelodyStrings.COMMENT_STRING)) {<NEW_LINE>System.out.println(line);<NEW_LINE>instrumentNumber = getInstrumentNumberFromLine(line, instrumentNumber);<NEW_LINE>startNote = getStartNoteFromLine(line, startNote);<NEW_LINE>System.out.println("Using instrument " + programs[instrumentNumber] + " and startNote " + startNote);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>System.out.println("\nPlaying " + lineNumber + " : " + line);<NEW_LINE>playMelody(line, startNote, instrumentNumber, secondsToPlay);<NEW_LINE>// so there's a noticeable gap between melodies<NEW_LINE>sleep(2000);<NEW_LINE>}<NEW_LINE>reader.close();<NEW_LINE>System.exit(0);<NEW_LINE>}
out.println("Playing melodies from " + inFilepath);
814,716
private void insert(String data) throws IoTDBConnectionException, StatementExecutionException {<NEW_LINE>String[] dataArray = data.split(",");<NEW_LINE>String device = dataArray[0];<NEW_LINE>long time = Long.parseLong(dataArray[1]);<NEW_LINE>List<String> measurements = Arrays.asList(dataArray[2].split(":"));<NEW_LINE>List<TSDataType> types = new ArrayList<>();<NEW_LINE>for (String type : dataArray[3].split(":")) {<NEW_LINE>types.add(TSDataType.valueOf(type));<NEW_LINE>}<NEW_LINE>List<Object> values = new ArrayList<>();<NEW_LINE>String[] valuesStr = dataArray[4].split(":");<NEW_LINE>for (int i = 0; i < valuesStr.length; i++) {<NEW_LINE>switch(types.get(i)) {<NEW_LINE>case INT64:<NEW_LINE>values.add(Long.parseLong(valuesStr[i]));<NEW_LINE>break;<NEW_LINE>case DOUBLE:<NEW_LINE>values.add(Double.parseDouble(valuesStr[i]));<NEW_LINE>break;<NEW_LINE>case INT32:<NEW_LINE>values.add(Integer.<MASK><NEW_LINE>break;<NEW_LINE>case TEXT:<NEW_LINE>values.add(valuesStr[i]);<NEW_LINE>break;<NEW_LINE>case FLOAT:<NEW_LINE>values.add(Float.parseFloat(valuesStr[i]));<NEW_LINE>break;<NEW_LINE>case BOOLEAN:<NEW_LINE>values.add(Boolean.parseBoolean(valuesStr[i]));<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>pool.insertRecord(device, time, measurements, types, values);<NEW_LINE>}
parseInt(valuesStr[i]));
474,949
public boolean refresh(TypeElement typeElement) {<NEW_LINE>Map<String, ? extends AnnotationMirror> types = getHelper().getAnnotationsByType(getHelper().getCompilationController().getElements().getAllAnnotationMirrors(typeElement));<NEW_LINE>// NOI18N<NEW_LINE>AnnotationMirror annotationMirror = types.get("javax.faces.component.FacesComponent");<NEW_LINE>if (annotationMirror == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>AnnotationParser parser = <MASK><NEW_LINE>// NOI18N<NEW_LINE>parser.expectString("value", null);<NEW_LINE>// NOI18N<NEW_LINE>parser.expectString("namespace", null);<NEW_LINE>// NOI18N<NEW_LINE>parser.expectString("tagName", null);<NEW_LINE>// NOI18N<NEW_LINE>parser.expectPrimitive("createTag", Boolean.class, null);<NEW_LINE>ParseResult parseResult = parser.parse(annotationMirror);<NEW_LINE>// NOI18N<NEW_LINE>type = parseResult.get("value", String.class);<NEW_LINE>clazz = typeElement.getQualifiedName().toString();<NEW_LINE>// NOI18N<NEW_LINE>createTag = parseResult.get("createTag", Boolean.class);<NEW_LINE>if (createTag == null) {<NEW_LINE>createTag = Boolean.FALSE;<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>namespace = parseResult.get("namespace", String.class);<NEW_LINE>if (namespace == null) {<NEW_LINE>namespace = DEFAULT_COMPONENT_NS;<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>tagName = parseResult.get("tagName", String.class);<NEW_LINE>if (tagName == null) {<NEW_LINE>tagName = typeElement.getSimpleName().toString();<NEW_LINE>tagName = tagName.substring(0, 1).toLowerCase() + tagName.substring(1);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
AnnotationParser.create(getHelper());
714,281
protected MessageCorrelationBuilder createMessageCorrelationBuilder(CorrelationMessageDto messageDto) {<NEW_LINE>RuntimeService runtimeService = processEngine.getRuntimeService();<NEW_LINE>ObjectMapper objectMapper = getObjectMapper();<NEW_LINE>Map<String, Object> correlationKeys = VariableValueDto.toMap(messageDto.getCorrelationKeys(), processEngine, objectMapper);<NEW_LINE>Map<String, Object> localCorrelationKeys = VariableValueDto.toMap(messageDto.getLocalCorrelationKeys(), processEngine, objectMapper);<NEW_LINE>Map<String, Object> processVariables = VariableValueDto.toMap(messageDto.getProcessVariables(), processEngine, objectMapper);<NEW_LINE>Map<String, Object> processVariablesLocal = VariableValueDto.toMap(messageDto.getProcessVariablesLocal(), processEngine, objectMapper);<NEW_LINE>MessageCorrelationBuilder builder = runtimeService.createMessageCorrelation(messageDto.getMessageName());<NEW_LINE>if (processVariables != null) {<NEW_LINE>builder.setVariables(processVariables);<NEW_LINE>}<NEW_LINE>if (processVariablesLocal != null) {<NEW_LINE>builder.setVariablesLocal(processVariablesLocal);<NEW_LINE>}<NEW_LINE>if (messageDto.getBusinessKey() != null) {<NEW_LINE>builder.processInstanceBusinessKey(messageDto.getBusinessKey());<NEW_LINE>}<NEW_LINE>if (correlationKeys != null && !correlationKeys.isEmpty()) {<NEW_LINE>for (Entry<String, Object> correlationKey : correlationKeys.entrySet()) {<NEW_LINE>String name = correlationKey.getKey();<NEW_LINE>Object value = correlationKey.getValue();<NEW_LINE>builder.processInstanceVariableEquals(name, value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (localCorrelationKeys != null && !localCorrelationKeys.isEmpty()) {<NEW_LINE>for (Entry<String, Object> correlationKey : localCorrelationKeys.entrySet()) {<NEW_LINE><MASK><NEW_LINE>Object value = correlationKey.getValue();<NEW_LINE>builder.localVariableEquals(name, value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (messageDto.getTenantId() != null) {<NEW_LINE>builder.tenantId(messageDto.getTenantId());<NEW_LINE>} else if (messageDto.isWithoutTenantId()) {<NEW_LINE>builder.withoutTenantId();<NEW_LINE>}<NEW_LINE>String processInstanceId = messageDto.getProcessInstanceId();<NEW_LINE>if (processInstanceId != null) {<NEW_LINE>builder.processInstanceId(processInstanceId);<NEW_LINE>}<NEW_LINE>return builder;<NEW_LINE>}
String name = correlationKey.getKey();
446,365
private static MPrintFormat copy(Properties ctx, int from_AD_PrintFormat_ID, int to_AD_PrintFormat_ID, int to_Client_ID) {<NEW_LINE>MClient company = MClient.get(ctx);<NEW_LINE>s_log.info("From AD_PrintFormat_ID=" + from_AD_PrintFormat_ID + ", To AD_PrintFormat_ID=" + to_AD_PrintFormat_ID + ", To Client_ID=" + to_Client_ID);<NEW_LINE>if (from_AD_PrintFormat_ID == 0)<NEW_LINE>throw new IllegalArgumentException("From_AD_PrintFormat_ID is 0");<NEW_LINE>//<NEW_LINE>MPrintFormat from = new MPrintFormat(ctx, from_AD_PrintFormat_ID, null);<NEW_LINE>// could be 0<NEW_LINE>MPrintFormat to = new <MASK><NEW_LINE>MPrintFormat.copyValues(from, to);<NEW_LINE>// New<NEW_LINE>if (to_AD_PrintFormat_ID == 0) {<NEW_LINE>if (to_Client_ID < 0)<NEW_LINE>to_Client_ID = Env.getAD_Client_ID(ctx);<NEW_LINE>to.setClientOrg(to_Client_ID, 0);<NEW_LINE>}<NEW_LINE>// Set Name - Remove TEMPLATE<NEW_LINE>to.setName(company.getValue() + " -> " + Util.replace(to.getName(), "** TEMPLATE **", "").trim());<NEW_LINE>String sql = "SELECT count(*) from AD_PrintFormat WHERE AD_Client_ID = ? AND AD_Table_ID = ? AND Name = ?";<NEW_LINE>String suggestedName = to.getName();<NEW_LINE>int count = 0;<NEW_LINE>while (DB.getSQLValue(to.get_TrxName(), sql, to.getAD_Client_ID(), to.getAD_Table_ID(), suggestedName) > 0) {<NEW_LINE>count++;<NEW_LINE>suggestedName = to.getName() + " (" + count + ")";<NEW_LINE>}<NEW_LINE>to.setName(suggestedName);<NEW_LINE>//<NEW_LINE>to.saveEx();<NEW_LINE>// Copy Items<NEW_LINE>to.setItems(copyItems(from, to));<NEW_LINE>return to;<NEW_LINE>}
MPrintFormat(ctx, to_AD_PrintFormat_ID, null);
861,336
public Suggestions search(final List<NamedIndexReader> indexReaders, final SuggesterQuery suggesterQuery, final Query query) {<NEW_LINE>if (indexReaders == null || suggesterQuery == null) {<NEW_LINE>return new Suggestions(Collections.emptyList(), true);<NEW_LINE>}<NEW_LINE>List<NamedIndexReader> readers = indexReaders;<NEW_LINE>if (!projectsEnabled) {<NEW_LINE>readers = Collections.singletonList(new NamedIndexReader(PROJECTS_DISABLED_KEY, indexReaders.get(<MASK><NEW_LINE>}<NEW_LINE>Suggestions suggestions;<NEW_LINE>if (!SuggesterUtils.isComplexQuery(query, suggesterQuery)) {<NEW_LINE>// use WFST for lone prefix<NEW_LINE>suggestions = prefixLookup(readers, (SuggesterPrefixQuery) suggesterQuery);<NEW_LINE>} else {<NEW_LINE>suggestions = complexLookup(readers, suggesterQuery, query);<NEW_LINE>}<NEW_LINE>return new Suggestions(SuggesterUtils.combineResults(suggestions.items, resultSize), suggestions.partialResult);<NEW_LINE>}
0).getReader()));
7,670
final DeleteImportResult executeDeleteImport(DeleteImportRequest deleteImportRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteImportRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteImportRequest> request = null;<NEW_LINE>Response<DeleteImportResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteImportRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteImportRequest));<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, "Lex Models V2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteImport");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteImportResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteImportResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
1,666,047
@Operation(summary = "List measurements for an area", description = "List measurements for an area")<NEW_LINE>public Response listDeviceMeasurementsForArea(@Parameter(description = "Token that identifies area", required = true) @PathParam("areaToken") String areaToken, @Parameter(description = "Page number", required = false) @QueryParam("page") @DefaultValue("1") int page, @Parameter(description = "Page size", required = false) @QueryParam("pageSize") @DefaultValue("100") int pageSize, @Parameter(description = "Start date", required = false) @QueryParam("startDate") String startDate, @Parameter(description = "End date", required = false) @QueryParam("endDate") String endDate) throws SiteWhereException {<NEW_LINE>List<UUID> areas = resolveAreaIdsRecursive(areaToken, true, getDeviceManagement());<NEW_LINE>IDateRangeSearchCriteria criteria = Assignments.createDateRangeSearchCriteria(page, pageSize, startDate, endDate);<NEW_LINE>ISearchResults<IDeviceMeasurement> results = getDeviceEventManagement().listDeviceMeasurementsForIndex(DeviceEventIndex.Area, areas, criteria);<NEW_LINE>// Marshal with asset info since multiple assignments might match.<NEW_LINE>List<IDeviceMeasurement> wrapped = new ArrayList<IDeviceMeasurement>();<NEW_LINE>for (IDeviceMeasurement result : results.getResults()) {<NEW_LINE>wrapped.add(new DeviceMeasurementsWithAsset<MASK><NEW_LINE>}<NEW_LINE>return Response.ok(new SearchResults<IDeviceMeasurement>(wrapped, results.getNumResults())).build();<NEW_LINE>}
(result, getAssetManagement()));
1,611,970
private void registerForMetamorphic(String variant, Consumer<FinishedRecipe> consumer) {<NEW_LINE>Block base = Registry.BLOCK.getOptional(prefix(LibBlockNames.METAMORPHIC_PREFIX + variant + "_stone")).get();<NEW_LINE>Block slab = Registry.BLOCK.getOptional(prefix(LibBlockNames.METAMORPHIC_PREFIX + variant + "_stone" + LibBlockNames.SLAB_SUFFIX)).get();<NEW_LINE>Block stair = Registry.BLOCK.getOptional(prefix(LibBlockNames.METAMORPHIC_PREFIX + variant + "_stone" + LibBlockNames.STAIR_SUFFIX)).get();<NEW_LINE>Block brick = Registry.BLOCK.getOptional(prefix(LibBlockNames.METAMORPHIC_PREFIX + variant + "_bricks")).get();<NEW_LINE>Block brickSlab = Registry.BLOCK.getOptional(prefix(LibBlockNames.METAMORPHIC_PREFIX + variant + "_bricks" + LibBlockNames.SLAB_SUFFIX)).get();<NEW_LINE>Block brickStair = Registry.BLOCK.getOptional(prefix(LibBlockNames.METAMORPHIC_PREFIX + variant + "_bricks" + LibBlockNames.STAIR_SUFFIX)).get();<NEW_LINE>Block brickWall = Registry.BLOCK.getOptional(prefix(LibBlockNames.METAMORPHIC_PREFIX + variant + "_bricks" + LibBlockNames.WALL_SUFFIX)).get();<NEW_LINE>Block chiseledBrick = Registry.BLOCK.getOptional(prefix("chiseled_" + LibBlockNames.METAMORPHIC_PREFIX + variant + "_bricks")).get();<NEW_LINE>Block cobble = Registry.BLOCK.getOptional(prefix(LibBlockNames.METAMORPHIC_PREFIX + variant + "_cobblestone")).get();<NEW_LINE>Block cobbleSlab = Registry.BLOCK.getOptional(prefix(LibBlockNames.METAMORPHIC_PREFIX + variant + "_cobblestone" + LibBlockNames.SLAB_SUFFIX)).get();<NEW_LINE>Block cobbleStair = Registry.BLOCK.getOptional(prefix(LibBlockNames.METAMORPHIC_PREFIX + variant + "_cobblestone" + LibBlockNames.STAIR_SUFFIX)).get();<NEW_LINE>Block cobbleWall = Registry.BLOCK.getOptional(prefix(LibBlockNames.METAMORPHIC_PREFIX + variant + "_cobblestone" + LibBlockNames<MASK><NEW_LINE>consumer.accept(stonecutting(base, slab, 2));<NEW_LINE>consumer.accept(stonecutting(base, stair));<NEW_LINE>consumer.accept(stonecutting(base, brick));<NEW_LINE>consumer.accept(stonecutting(base, brickSlab, 2));<NEW_LINE>consumer.accept(stonecutting(base, brickStair));<NEW_LINE>consumer.accept(stonecutting(base, brickWall));<NEW_LINE>consumer.accept(stonecutting(base, chiseledBrick));<NEW_LINE>consumer.accept(stonecutting(brick, brickSlab, 2));<NEW_LINE>consumer.accept(stonecutting(brick, brickStair));<NEW_LINE>consumer.accept(stonecutting(brick, brickWall));<NEW_LINE>consumer.accept(stonecutting(brick, chiseledBrick));<NEW_LINE>consumer.accept(stonecutting(cobble, cobbleSlab, 2));<NEW_LINE>consumer.accept(stonecutting(cobble, cobbleStair));<NEW_LINE>consumer.accept(stonecutting(cobble, cobbleWall));<NEW_LINE>}
.WALL_SUFFIX)).get();
1,827,536
public static Trajectory generateTrajectory(ControlVectorList controlVectors, TrajectoryConfig config) {<NEW_LINE>final var flip = new Transform2d(new Translation2d(), Rotation2d.fromDegrees(180.0));<NEW_LINE>final var newControlVectors = new ArrayList<Spline.ControlVector>(controlVectors.size());<NEW_LINE>// Create a new control vector list, flipping the orientation if reversed.<NEW_LINE>for (final var vector : controlVectors) {<NEW_LINE>var newVector = new Spline.ControlVector(vector.x, vector.y);<NEW_LINE>if (config.isReversed()) {<NEW_LINE>newVector.x[1] *= -1;<NEW_LINE>newVector.y[1] *= -1;<NEW_LINE>}<NEW_LINE>newControlVectors.add(newVector);<NEW_LINE>}<NEW_LINE>// Get the spline points<NEW_LINE>List<PoseWithCurvature> points;<NEW_LINE>try {<NEW_LINE>points = splinePointsFromSplines(SplineHelper.getQuinticSplinesFromControlVectors(newControlVectors.toArray(new Spline.ControlVector[] {})));<NEW_LINE>} catch (MalformedSplineException ex) {<NEW_LINE>reportError(ex.getMessage(), ex.getStackTrace());<NEW_LINE>return kDoNothingTrajectory;<NEW_LINE>}<NEW_LINE>// Change the points back to their original orientation.<NEW_LINE>if (config.isReversed()) {<NEW_LINE>for (var point : points) {<NEW_LINE>point.poseMeters = point.poseMeters.plus(flip);<NEW_LINE>point.curvatureRadPerMeter *= -1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Generate and return trajectory.<NEW_LINE>return TrajectoryParameterizer.timeParameterizeTrajectory(points, config.getConstraints(), config.getStartVelocity(), config.getEndVelocity(), config.getMaxVelocity(), config.getMaxAcceleration(<MASK><NEW_LINE>}
), config.isReversed());
1,629,486
private String addMarkdownLikeHyperlinks(String aboutText, List<StyleRange> styles) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>Pattern pattern = Pattern.compile("\\[(?<text>[^\\]]*)\\]\\((?<link>[^\\)]*)\\)");<NEW_LINE>Matcher matcher = pattern.matcher(aboutText);<NEW_LINE>StringBuilder answer = new StringBuilder(aboutText.length());<NEW_LINE>int pointer = 0;<NEW_LINE>while (matcher.find()) {<NEW_LINE>int start = matcher.start();<NEW_LINE>int end = matcher.end();<NEW_LINE>answer.append(aboutText.substring(pointer, start));<NEW_LINE>// $NON-NLS-1$<NEW_LINE>String text = matcher.group("text");<NEW_LINE>// $NON-NLS-1$<NEW_LINE>String link = matcher.group("link");<NEW_LINE>StyleRange styleRange = new StyleRange();<NEW_LINE>styleRange.underline = true;<NEW_LINE>styleRange.underlineStyle = SWT.UNDERLINE_LINK;<NEW_LINE>styleRange.underlineColor = Colors.theme().hyperlink();<NEW_LINE>styleRange.foreground = Colors<MASK><NEW_LINE>styleRange.data = link;<NEW_LINE>styleRange.start = answer.length();<NEW_LINE>styleRange.length = text.length();<NEW_LINE>styles.add(styleRange);<NEW_LINE>answer.append(text);<NEW_LINE>pointer = end;<NEW_LINE>}<NEW_LINE>if (pointer < aboutText.length())<NEW_LINE>answer.append(aboutText.substring(pointer));<NEW_LINE>return answer.toString();<NEW_LINE>}
.theme().hyperlink();
1,432,537
public static ElementHandle createHandle(ParserResult info, final GroovyElement object) {<NEW_LINE>if (object instanceof KeywordElement || object instanceof CommentElement) {<NEW_LINE>// Not tied to an AST - just pass it around<NEW_LINE>return new GroovyElementHandle(null, object, info.getSnapshot().getSource().getFileObject());<NEW_LINE>}<NEW_LINE>if (object instanceof IndexedElement) {<NEW_LINE>// Probably a function in a "foreign" file (not parsed from AST),<NEW_LINE>// such as a signature returned from the index of the Groovy libraries.<NEW_LINE>// TODO - make sure this is infrequent! getFileObject is expensive!<NEW_LINE>// Alternatively, do this in a delayed fashion - e.g. pass in null and in getFileObject<NEW_LINE>// look up from index<NEW_LINE>return new GroovyElementHandle(null, object, ((IndexedElement) object).getFileObject());<NEW_LINE>}<NEW_LINE>if (!(object instanceof ASTElement)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// XXX Gotta fix this<NEW_LINE>if (info == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>ParserResult result = ASTUtils.getParseResult(info);<NEW_LINE>if (result == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>ASTNode <MASK><NEW_LINE>return new GroovyElementHandle(root, object, info.getSnapshot().getSource().getFileObject());<NEW_LINE>}
root = ASTUtils.getRoot(info);
1,380,619
private void create() {<NEW_LINE>textPane = new JTextPane();<NEW_LINE>doc = textPane.getStyledDocument();<NEW_LINE>add(textPane, BorderLayout.CENTER);<NEW_LINE>textPane.setEditable(false);<NEW_LINE>pathAttrSet = new SimpleAttributeSet();<NEW_LINE>pathAttrSet.addAttribute(StyleConstants.FontFamily, "Tahoma");<NEW_LINE>pathAttrSet.addAttribute(StyleConstants.FontSize, Integer.valueOf(11));<NEW_LINE>pathAttrSet.addAttribute(StyleConstants.Bold, Boolean.TRUE);<NEW_LINE>pathAttrSet.addAttribute(StyleConstants.Foreground, MergeConstants.CONFLICT_COLOR);<NEW_LINE>nameAttrSet = new SimpleAttributeSet();<NEW_LINE>nameAttrSet.addAttribute(StyleConstants.FontFamily, "Tahoma");<NEW_LINE>nameAttrSet.addAttribute(StyleConstants.FontSize, Integer.valueOf(11));<NEW_LINE>nameAttrSet.addAttribute(StyleConstants.Bold, Boolean.TRUE);<NEW_LINE>sourceAttrSet = new SimpleAttributeSet();<NEW_LINE>sourceAttrSet.addAttribute(StyleConstants.FontFamily, "Tahoma");<NEW_LINE>sourceAttrSet.addAttribute(StyleConstants.FontSize, Integer.valueOf(11));<NEW_LINE>sourceAttrSet.addAttribute(StyleConstants.Bold, Boolean.TRUE);<NEW_LINE>sourceAttrSet.addAttribute(StyleConstants.Foreground, SOURCE_COLOR);<NEW_LINE>offsetAttrSet = new SimpleAttributeSet();<NEW_LINE>offsetAttrSet.addAttribute(StyleConstants.FontFamily, "Monospaced");<NEW_LINE>offsetAttrSet.addAttribute(StyleConstants.FontSize, Integer.valueOf(12));<NEW_LINE>offsetAttrSet.addAttribute(StyleConstants.Foreground, Color.BLACK);<NEW_LINE>contentAttrSet = new SimpleAttributeSet();<NEW_LINE>contentAttrSet.addAttribute(StyleConstants.FontFamily, "Monospaced");<NEW_LINE>contentAttrSet.addAttribute(StyleConstants.FontSize, Integer.valueOf(12));<NEW_LINE>contentAttrSet.addAttribute(StyleConstants.Foreground, Color.BLUE);<NEW_LINE>fieldNameAttrSet = new SimpleAttributeSet();<NEW_LINE>fieldNameAttrSet.addAttribute(StyleConstants.FontFamily, "Monospaced");<NEW_LINE>fieldNameAttrSet.addAttribute(StyleConstants.FontSize, Integer.valueOf(12));<NEW_LINE>fieldNameAttrSet.addAttribute(StyleConstants.Foreground, new Color<MASK><NEW_LINE>commentAttrSet = new SimpleAttributeSet();<NEW_LINE>commentAttrSet.addAttribute(StyleConstants.FontFamily, "Monospaced");<NEW_LINE>commentAttrSet.addAttribute(StyleConstants.FontSize, Integer.valueOf(12));<NEW_LINE>commentAttrSet.addAttribute(StyleConstants.Foreground, new Color(0, 204, 51));<NEW_LINE>deletedAttrSet = new SimpleAttributeSet();<NEW_LINE>deletedAttrSet.addAttribute(StyleConstants.FontFamily, "Tahoma");<NEW_LINE>deletedAttrSet.addAttribute(StyleConstants.FontSize, Integer.valueOf(12));<NEW_LINE>deletedAttrSet.addAttribute(StyleConstants.Bold, Boolean.TRUE);<NEW_LINE>deletedAttrSet.addAttribute(StyleConstants.Foreground, Color.RED);<NEW_LINE>setDataType(dataType);<NEW_LINE>}
(204, 0, 204));
1,513,452
public static ListDataServiceAuthorizedApisResponse unmarshall(ListDataServiceAuthorizedApisResponse listDataServiceAuthorizedApisResponse, UnmarshallerContext _ctx) {<NEW_LINE>listDataServiceAuthorizedApisResponse.setRequestId(_ctx.stringValue("ListDataServiceAuthorizedApisResponse.RequestId"));<NEW_LINE>listDataServiceAuthorizedApisResponse.setErrorCode(_ctx.stringValue("ListDataServiceAuthorizedApisResponse.ErrorCode"));<NEW_LINE>listDataServiceAuthorizedApisResponse.setErrorMessage(_ctx.stringValue("ListDataServiceAuthorizedApisResponse.ErrorMessage"));<NEW_LINE>listDataServiceAuthorizedApisResponse.setHttpStatusCode(_ctx.integerValue("ListDataServiceAuthorizedApisResponse.HttpStatusCode"));<NEW_LINE>listDataServiceAuthorizedApisResponse.setSuccess(_ctx.booleanValue("ListDataServiceAuthorizedApisResponse.Success"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setPageNumber(_ctx.integerValue("ListDataServiceAuthorizedApisResponse.Data.PageNumber"));<NEW_LINE>data.setPageSize(_ctx.integerValue("ListDataServiceAuthorizedApisResponse.Data.PageSize"));<NEW_LINE>data.setTotalCount(_ctx.integerValue("ListDataServiceAuthorizedApisResponse.Data.TotalCount"));<NEW_LINE>List<ApiAuthorized> apiAuthorizedList = new ArrayList<ApiAuthorized>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListDataServiceAuthorizedApisResponse.Data.ApiAuthorizedList.Length"); i++) {<NEW_LINE>ApiAuthorized apiAuthorized = new ApiAuthorized();<NEW_LINE>apiAuthorized.setApiId(_ctx.longValue("ListDataServiceAuthorizedApisResponse.Data.ApiAuthorizedList[" + i + "].ApiId"));<NEW_LINE>apiAuthorized.setApiName(_ctx.stringValue<MASK><NEW_LINE>apiAuthorized.setApiPath(_ctx.stringValue("ListDataServiceAuthorizedApisResponse.Data.ApiAuthorizedList[" + i + "].ApiPath"));<NEW_LINE>apiAuthorized.setApiStatus(_ctx.integerValue("ListDataServiceAuthorizedApisResponse.Data.ApiAuthorizedList[" + i + "].ApiStatus"));<NEW_LINE>apiAuthorized.setCreatedTime(_ctx.stringValue("ListDataServiceAuthorizedApisResponse.Data.ApiAuthorizedList[" + i + "].CreatedTime"));<NEW_LINE>apiAuthorized.setCreatorId(_ctx.stringValue("ListDataServiceAuthorizedApisResponse.Data.ApiAuthorizedList[" + i + "].CreatorId"));<NEW_LINE>apiAuthorized.setGrantCreatedTime(_ctx.stringValue("ListDataServiceAuthorizedApisResponse.Data.ApiAuthorizedList[" + i + "].GrantCreatedTime"));<NEW_LINE>apiAuthorized.setGrantEndTime(_ctx.stringValue("ListDataServiceAuthorizedApisResponse.Data.ApiAuthorizedList[" + i + "].GrantEndTime"));<NEW_LINE>apiAuthorized.setGrantOperatorId(_ctx.stringValue("ListDataServiceAuthorizedApisResponse.Data.ApiAuthorizedList[" + i + "].GrantOperatorId"));<NEW_LINE>apiAuthorized.setGroupId(_ctx.stringValue("ListDataServiceAuthorizedApisResponse.Data.ApiAuthorizedList[" + i + "].GroupId"));<NEW_LINE>apiAuthorized.setModifiedTime(_ctx.stringValue("ListDataServiceAuthorizedApisResponse.Data.ApiAuthorizedList[" + i + "].ModifiedTime"));<NEW_LINE>apiAuthorized.setProjectId(_ctx.longValue("ListDataServiceAuthorizedApisResponse.Data.ApiAuthorizedList[" + i + "].ProjectId"));<NEW_LINE>apiAuthorized.setTenantId(_ctx.longValue("ListDataServiceAuthorizedApisResponse.Data.ApiAuthorizedList[" + i + "].TenantId"));<NEW_LINE>apiAuthorizedList.add(apiAuthorized);<NEW_LINE>}<NEW_LINE>data.setApiAuthorizedList(apiAuthorizedList);<NEW_LINE>listDataServiceAuthorizedApisResponse.setData(data);<NEW_LINE>return listDataServiceAuthorizedApisResponse;<NEW_LINE>}
("ListDataServiceAuthorizedApisResponse.Data.ApiAuthorizedList[" + i + "].ApiName"));
614,738
protected void serviceAMF(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {<NEW_LINE>log.debug("Servicing AMF");<NEW_LINE>IRemotingConnection conn = null;<NEW_LINE>try {<NEW_LINE>RemotingPacket packet = decodeRequest(req);<NEW_LINE>if (packet == null) {<NEW_LINE>log.error("Packet should not be null");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Provide a valid IConnection in the Red5 object<NEW_LINE>final IGlobalScope global = getGlobalScope(req);<NEW_LINE>final IContext context = global.getContext();<NEW_LINE>final IScope scope = context.resolveScope(global, packet.getScopePath());<NEW_LINE>conn = new RemotingConnection(req, scope, packet);<NEW_LINE>// Make sure the connection object isn't garbage collected<NEW_LINE><MASK><NEW_LINE>// set thread local reference<NEW_LINE>Red5.setConnectionLocal(conn);<NEW_LINE>// fixed so that true is not returned for calls that have failed<NEW_LINE>boolean passed = handleRemotingPacket(req, context, scope, packet);<NEW_LINE>if (passed) {<NEW_LINE>resp.setStatus(HttpServletResponse.SC_OK);<NEW_LINE>} else {<NEW_LINE>log.warn("At least one invocation failed to execute");<NEW_LINE>resp.setStatus(HttpServletResponse.SC_EXPECTATION_FAILED);<NEW_LINE>}<NEW_LINE>// send our response<NEW_LINE>resp.setContentType(APPLICATION_AMF);<NEW_LINE>sendResponse(resp, packet);<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.error("Error handling remoting call", e);<NEW_LINE>resp.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);<NEW_LINE>} finally {<NEW_LINE>// ensure the conn attr gets removed<NEW_LINE>req.removeAttribute(CONNECTION);<NEW_LINE>// unregister the remote connection client<NEW_LINE>if (conn != null) {<NEW_LINE>((RemotingConnection) conn).cleanup();<NEW_LINE>}<NEW_LINE>// clear thread local reference<NEW_LINE>Red5.setConnectionLocal(null);<NEW_LINE>}<NEW_LINE>}
req.setAttribute(CONNECTION, conn);
272,665
private void createStreamWithMessageHeaderV1(StoreKey key, BlobProperties blobProperties, ByteBuffer userMetadata, InputStream blobStream, long streamSize, BlobType blobType) throws MessageFormatException {<NEW_LINE>int headerSize = MessageFormatRecord.MessageHeader_Format_V1.getHeaderSize();<NEW_LINE>int blobPropertiesRecordSize = MessageFormatRecord.BlobProperties_Format_V1.getBlobPropertiesRecordSize(blobProperties);<NEW_LINE>int userMetadataSize = <MASK><NEW_LINE>long blobSize = MessageFormatRecord.Blob_Format_V2.getBlobRecordSize(streamSize);<NEW_LINE>buffer = ByteBuffer.allocate(headerSize + key.sizeInBytes() + blobPropertiesRecordSize + userMetadataSize + (int) (blobSize - streamSize - MessageFormatRecord.Crc_Size));<NEW_LINE>MessageFormatRecord.MessageHeader_Format_V1.serializeHeader(buffer, blobPropertiesRecordSize + userMetadataSize + blobSize, headerSize + key.sizeInBytes(), MessageFormatRecord.Message_Header_Invalid_Relative_Offset, headerSize + key.sizeInBytes() + blobPropertiesRecordSize, headerSize + key.sizeInBytes() + blobPropertiesRecordSize + userMetadataSize);<NEW_LINE>buffer.put(key.toBytes());<NEW_LINE>MessageFormatRecord.BlobProperties_Format_V1.serializeBlobPropertiesRecord(buffer, blobProperties);<NEW_LINE>MessageFormatRecord.UserMetadata_Format_V1.serializeUserMetadataRecord(buffer, userMetadata);<NEW_LINE>int bufferBlobStart = buffer.position();<NEW_LINE>MessageFormatRecord.Blob_Format_V2.serializePartialBlobRecord(buffer, streamSize, blobType);<NEW_LINE>Crc32 crc = new Crc32();<NEW_LINE>crc.update(buffer.array(), bufferBlobStart, buffer.position() - bufferBlobStart);<NEW_LINE>stream = new CrcInputStream(crc, blobStream);<NEW_LINE>streamLength = streamSize;<NEW_LINE>messageLength = buffer.capacity() + streamLength + MessageFormatRecord.Crc_Size;<NEW_LINE>buffer.flip();<NEW_LINE>}
MessageFormatRecord.UserMetadata_Format_V1.getUserMetadataSize(userMetadata);
44,883
void decode(Decoder decoder, Instruction instruction) {<NEW_LINE>if ((decoder.state_zs_flags & StateFlags.W) != 0)<NEW_LINE>instruction.setCode(code64);<NEW_LINE>else<NEW_LINE>instruction.setCode(code32);<NEW_LINE>if ((((flags & 4) | (decoder.state_zs_flags & StateFlags.HAS66)) & decoder.invalidCheckMask) == (4 | StateFlags.HAS66))<NEW_LINE>decoder.setInvalidInstruction();<NEW_LINE>if (decoder.state_mod == 3) {<NEW_LINE>if ((decoder.state_zs_flags & StateFlags.W) != 0)<NEW_LINE>instruction.setOp0Register(decoder.state_rm + decoder.state_zs_extraBaseRegisterBase + Register.RAX);<NEW_LINE>else<NEW_LINE>instruction.setOp0Register(decoder.state_rm + decoder.state_zs_extraBaseRegisterBase + Register.EAX);<NEW_LINE>if ((disallowReg & decoder.invalidCheckMask) != 0)<NEW_LINE>decoder.setInvalidInstruction();<NEW_LINE>} else {<NEW_LINE>if ((disallowMem & decoder.invalidCheckMask) != 0)<NEW_LINE>decoder.setInvalidInstruction();<NEW_LINE><MASK><NEW_LINE>decoder.readOpMem(instruction);<NEW_LINE>}<NEW_LINE>}
instruction.setOp0Kind(OpKind.MEMORY);
1,782,611
public void readChromaResidual(MBlock mBlock, boolean leftAvailable, boolean topAvailable, int mbX) {<NEW_LINE>if (mBlock.cbpChroma() != 0) {<NEW_LINE>if ((mBlock.cbpChroma() & 3) > 0) {<NEW_LINE>readChromaDC(mbX, leftAvailable, topAvailable, mBlock.dc1, 1, mBlock.curMbType);<NEW_LINE>readChromaDC(mbX, leftAvailable, topAvailable, mBlock.dc2, 2, mBlock.curMbType);<NEW_LINE>}<NEW_LINE>_readChromaAC(leftAvailable, topAvailable, mbX, mBlock.dc1, 1, mBlock.curMbType, (mBlock.cbpChroma() & 2) > 0, mBlock.ac[1]);<NEW_LINE>_readChromaAC(leftAvailable, topAvailable, mbX, mBlock.dc2, 2, mBlock.curMbType, (mBlock.cbpChroma() & 2) > 0<MASK><NEW_LINE>} else if (!sh.pps.entropyCodingModeFlag) {<NEW_LINE>setZeroCoeff(1, mbX << 1, 0);<NEW_LINE>setZeroCoeff(1, (mbX << 1) + 1, 1);<NEW_LINE>setZeroCoeff(2, mbX << 1, 0);<NEW_LINE>setZeroCoeff(2, (mbX << 1) + 1, 1);<NEW_LINE>}<NEW_LINE>}
, mBlock.ac[2]);
1,837,303
public com.amazonaws.services.chimesdkmeetings.model.ServiceUnavailableException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.chimesdkmeetings.model.ServiceUnavailableException serviceUnavailableException = new com.amazonaws.services.chimesdkmeetings.model.ServiceUnavailableException(null);<NEW_LINE>if (context.isStartOfDocument()) {<NEW_LINE>if (context.getHeader("Retry-After") != null) {<NEW_LINE>context.setCurrentHeader("Retry-After");<NEW_LINE>serviceUnavailableException.setRetryAfterSeconds(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>}<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("Code", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>serviceUnavailableException.setCode(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("RequestId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>serviceUnavailableException.setRequestId(context.getUnmarshaller(String.<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 serviceUnavailableException;<NEW_LINE>}
class).unmarshall(context));
1,299,807
private static void maybeReplaceStatement(Buffer buffer) {<NEW_LINE>// Unassigned field access is only useful for compiler.<NEW_LINE>Matcher <MASK><NEW_LINE>if (m.matches()) {<NEW_LINE>buffer.replaceStatement("");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int index = buffer.lastStatementIndexOf("goog.");<NEW_LINE>if (index == -1) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (index == 0) {<NEW_LINE>// Unassigned goog.require is only useful for compiler and bundling.<NEW_LINE>m = buffer.matchLastStatement(GOOG_REQUIRE);<NEW_LINE>if (m.matches()) {<NEW_LINE>buffer.replaceStatement("");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// goog.forwardDeclare is only useful for compiler except the variable declaration.<NEW_LINE>m = buffer.matchLastStatement(GOOG_FORWARD_DECLARE);<NEW_LINE>if (m.matches()) {<NEW_LINE>buffer.replaceStatement(m.group(1) + ";");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
m = buffer.matchLastStatement(FIELD_STATEMENT);
391,948
public static Method findMethod(Class<?> clazz, String methodName, Class<?>[] args, boolean checkInheritance, boolean strictArgs) throws NoSuchMethodException {<NEW_LINE>if (clazz == null)<NEW_LINE>throw new NoSuchMethodException("No class");<NEW_LINE>if (methodName == null || methodName.trim().equals(""))<NEW_LINE>throw new NoSuchMethodException("No method name");<NEW_LINE>Method method = null;<NEW_LINE>Method[<MASK><NEW_LINE>for (int i = 0; i < methods.length && method == null; i++) {<NEW_LINE>if (methods[i].getName().equals(methodName) && checkParams(methods[i].getParameterTypes(), (args == null ? new Class[] {} : args), strictArgs)) {<NEW_LINE>method = methods[i];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (method != null) {<NEW_LINE>return method;<NEW_LINE>} else if (checkInheritance)<NEW_LINE>return findInheritedMethod(clazz.getPackage(), clazz.getSuperclass(), methodName, args, strictArgs);<NEW_LINE>else<NEW_LINE>throw new NoSuchMethodException("No such method " + methodName + " on class " + clazz.getName());<NEW_LINE>}
] methods = clazz.getDeclaredMethods();
357,381
public User ofRecord(@NonNull final I_AD_User userRecord) {<NEW_LINE>final IUserBL userBL = Services.get(IUserBL.class);<NEW_LINE>final IBPartnerBL bPartnerBL = Services.get(IBPartnerBL.class);<NEW_LINE>final Language userLanguage = Language.asLanguage(userRecord.getAD_Language());<NEW_LINE>final Language bpartnerLanguage = bPartnerBL.getLanguageForModel(userRecord).orElse(null);<NEW_LINE>final Language <MASK><NEW_LINE>return User.builder().bpartnerId(BPartnerId.ofRepoIdOrNull(userRecord.getC_BPartner_ID())).id(UserId.ofRepoId(userRecord.getAD_User_ID())).externalId(ExternalId.ofOrNull(userRecord.getExternalId())).name(userRecord.getName()).firstName(userRecord.getFirstname()).lastName(userRecord.getLastname()).birthday(TimeUtil.asLocalDate(userRecord.getBirthday())).emailAddress(userRecord.getEMail()).userLanguage(userLanguage).bPartnerLanguage(bpartnerLanguage).language(language).build();<NEW_LINE>}
language = userBL.getUserLanguage(userRecord);
1,778,981
public void mergeTo(IntIntVector mergedRow) {<NEW_LINE>StorageMethod method = VectorStorageUtils.getStorageMethod(vector);<NEW_LINE>switch(method) {<NEW_LINE>case DENSE:<NEW_LINE>{<NEW_LINE>int[] values = getVector().getStorage().getValues();<NEW_LINE>for (int i = 0; i < values.length; i++) {<NEW_LINE>mergedRow.set(i + (int) indexOffset, values[i]);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case SPARSE:<NEW_LINE>{<NEW_LINE>ObjectIterator<Entry> iter = getVector().getStorage().entryIterator();<NEW_LINE>Entry entry;<NEW_LINE>while (iter.hasNext()) {<NEW_LINE>entry = iter.next();<NEW_LINE>mergedRow.set(entry.getIntKey() + (int) <MASK><NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case SORTED:<NEW_LINE>{<NEW_LINE>int[] indices = getVector().getStorage().getIndices();<NEW_LINE>int[] values = getVector().getStorage().getValues();<NEW_LINE>for (int i = 0; i < indices.length; i++) {<NEW_LINE>mergedRow.set(indices[i] + (int) indexOffset, values[i]);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>default:<NEW_LINE>throw new UnsupportedOperationException("Unsupport storage method " + method);<NEW_LINE>}<NEW_LINE>}
indexOffset, entry.getIntValue());
1,017,916
// //////////////////////////////////////////////////////////////////////////<NEW_LINE>// ExecutorService call() Method //<NEW_LINE>// //////////////////////////////////////////////////////////////////////////<NEW_LINE>@Override<NEW_LINE>public TaskState call() {<NEW_LINE>GlassFishStatus state = GlassFishState.getStatus(instance).getStatus();<NEW_LINE>StateChange change;<NEW_LINE>switch(state) {<NEW_LINE>case UNKNOWN:<NEW_LINE>return fireOperationStateChanged(TaskState.FAILED, TaskEvent.ILLEGAL_STATE, "RestartTask.call.unknownState", instanceName);<NEW_LINE>case OFFLINE:<NEW_LINE>change = instance.isRemote() ? remoteOfflineStart() : localOfflineStart();<NEW_LINE>return change.fireOperationStateChanged();<NEW_LINE>case STARTUP:<NEW_LINE>change = startupWait();<NEW_LINE>return change.fireOperationStateChanged();<NEW_LINE>case ONLINE:<NEW_LINE>change = instance.isRemote() ? remoteRestart() : localRestart();<NEW_LINE>return change.fireOperationStateChanged();<NEW_LINE>case SHUTDOWN:<NEW_LINE>change = instance.isRemote() <MASK><NEW_LINE>return change.fireOperationStateChanged();<NEW_LINE>// This shall be unrechable, all states should have<NEW_LINE>// own case handlers.<NEW_LINE>default:<NEW_LINE>return fireOperationStateChanged(TaskState.FAILED, TaskEvent.ILLEGAL_STATE, "RestartTask.call.unknownState", instanceName);<NEW_LINE>}<NEW_LINE>}
? remoteShutdownStart() : localShutdownStart();
1,851,129
public static List<String> exportEndpointsToS3(PinpointClient pinpoint, S3Client s3Client, String s3BucketName, String iamExportRoleArn, String applicationId) {<NEW_LINE>SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd-HH_mm:ss.SSS_z");<NEW_LINE>String endpointsKeyPrefix = "exports/" + applicationId + "_" + dateFormat.format(new Date());<NEW_LINE>String s3UrlPrefix = "s3://" + s3BucketName + "/" + endpointsKeyPrefix + "/";<NEW_LINE>List<String> objectKeys = new ArrayList<>();<NEW_LINE>String key = "";<NEW_LINE>try {<NEW_LINE>// Defines the export job that Amazon Pinpoint runs<NEW_LINE>ExportJobRequest jobRequest = ExportJobRequest.builder().roleArn(iamExportRoleArn).<MASK><NEW_LINE>CreateExportJobRequest exportJobRequest = CreateExportJobRequest.builder().applicationId(applicationId).exportJobRequest(jobRequest).build();<NEW_LINE>System.out.format("Exporting endpoints from Amazon Pinpoint application %s to Amazon S3 " + "bucket %s . . .\n", applicationId, s3BucketName);<NEW_LINE>CreateExportJobResponse exportResult = pinpoint.createExportJob(exportJobRequest);<NEW_LINE>String jobId = exportResult.exportJobResponse().id();<NEW_LINE>System.out.println(jobId);<NEW_LINE>printExportJobStatus(pinpoint, applicationId, jobId);<NEW_LINE>ListObjectsV2Request v2Request = ListObjectsV2Request.builder().bucket(s3BucketName).prefix(endpointsKeyPrefix).build();<NEW_LINE>// Create a list of object keys<NEW_LINE>ListObjectsV2Response v2Response = s3Client.listObjectsV2(v2Request);<NEW_LINE>List<S3Object> objects = v2Response.contents();<NEW_LINE>for (S3Object object : objects) {<NEW_LINE>key = object.key();<NEW_LINE>objectKeys.add(key);<NEW_LINE>}<NEW_LINE>return objectKeys;<NEW_LINE>} catch (PinpointException e) {<NEW_LINE>System.err.println(e.awsErrorDetails().errorMessage());<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
s3UrlPrefix(s3UrlPrefix).build();
858,455
private static String[] makeLiteralNames() {<NEW_LINE>return new String[] { null, null, null, null, null, null, null, "'as'", "'def'", "'in'", "'trait'", "'threadsafe'", "'var'", null, "'abstract'", "'assert'", "'break'", "'case'", "'catch'", "'class'", "'const'", "'continue'", "'default'", "'do'", "'else'", "'enum'", "'extends'", "'final'", "'finally'", "'for'", "'if'", "'goto'", "'implements'", "'import'", "'instanceof'", "'interface'", "'native'", "'new'", "'package'", "'private'", "'protected'", "'public'", "'return'", "'static'", "'strictfp'", "'super'", "'switch'", "'synchronized'", "'this'", "'throw'", "'throws'", "'transient'", "'try'", "'void'", "'volatile'", "'while'", null, null, null, "'null'", "'..'", "'..<'", "'*.'", "'?.'", "'??.'", "'?:'", "'.&'", "'::'", "'=~'", "'==~'", "'**'", "'**='", "'<=>'", "'==='", "'!=='", "'->'", "'!instanceof'", "'!in'", null, null, null, null, null, null, "';'", "','", null, "'='", "'>'", "'<'", "'!'", "'~'", "'?'", "':'", "'=='", "'<='", "'>='", "'!='", "'&&'", "'||'", "'++'", "'--'", "'+'", "'-'", "'*'", null, "'&'", "'|'", "'^'", "'%'", "'+='", "'-='", "'*='", "'/='", "'&='", "'|='", "'^='", "'%='", "'<<='", "'>>='", "'>>>='", "'?='", <MASK><NEW_LINE>}
null, null, "'@'", "'...'" };
562,062
protected static void readConfig() {<NEW_LINE>send_peer_ids = COConfigurationManager.getBooleanParameter("Tracker Send Peer IDs");<NEW_LINE>max_peers_to_send = COConfigurationManager.getIntParameter("Tracker Max Peers Returned");<NEW_LINE>scrape_cache_period = COConfigurationManager.getIntParameter("Tracker Scrape Cache", TRTrackerServer.DEFAULT_SCRAPE_CACHE_PERIOD);<NEW_LINE>announce_cache_period = COConfigurationManager.getIntParameter("Tracker Announce Cache", TRTrackerServer.DEFAULT_ANNOUNCE_CACHE_PERIOD);<NEW_LINE>announce_cache_threshold = COConfigurationManager.getIntParameter("Tracker Announce Cache Min Peers", TRTrackerServer.DEFAULT_ANNOUNCE_CACHE_PEER_THRESHOLD);<NEW_LINE>max_seed_retention = COConfigurationManager.getIntParameter("Tracker Max Seeds Retained", 0);<NEW_LINE>seed_limit = COConfigurationManager.getIntParameter("Tracker Max Seeds", 0);<NEW_LINE>List nets = new ArrayList();<NEW_LINE>for (int i = 0; i < AENetworkClassifier.AT_NETWORKS.length; i++) {<NEW_LINE>String net = AENetworkClassifier.AT_NETWORKS[i];<NEW_LINE>boolean enabled = COConfigurationManager.getBooleanParameter("Tracker Network Selection Default." + net);<NEW_LINE>if (enabled) {<NEW_LINE>nets.add(net);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String[] s_nets = new String[nets.size()];<NEW_LINE>nets.toArray(s_nets);<NEW_LINE>permitted_networks = s_nets;<NEW_LINE>all_networks_permitted = s_nets.length == AENetworkClassifier.AT_NETWORKS.length;<NEW_LINE><MASK><NEW_LINE>redirect_on_not_found = COConfigurationManager.getStringParameter("Tracker Server Not Found Redirect").trim();<NEW_LINE>support_experimental_extensions = COConfigurationManager.getBooleanParameter("Tracker Server Support Experimental Extensions");<NEW_LINE>restrict_non_blocking_requests = COConfigurationManager.getBooleanParameter("Tracker TCP NonBlocking Restrict Request Types");<NEW_LINE>String banned = COConfigurationManager.getStringParameter("Tracker Banned Clients", "").trim();<NEW_LINE>banned_clients.clear();<NEW_LINE>if (banned.length() > 0) {<NEW_LINE>banned = banned.toLowerCase(Locale.US).replaceAll(";", ",");<NEW_LINE>String[] bits = banned.split(",");<NEW_LINE>for (String b : bits) {<NEW_LINE>b = b.trim();<NEW_LINE>if (b.length() > 0) {<NEW_LINE>banned_clients.add(b);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
full_scrape_enable = COConfigurationManager.getBooleanParameter("Tracker Server Full Scrape Enable");
897,476
public List<String> calculate() {<NEW_LINE>List<String> nameBlocks = new ArrayList<String>();<NEW_LINE>LinkedHashSet<String> names = new LinkedHashSet<String>();<NEW_LINE>Matcher matcher = pattern.matcher(typeName);<NEW_LINE>if (matcher.find()) {<NEW_LINE>int idx = matcher.start();<NEW_LINE>if (idx > 0) {<NEW_LINE>String prefix = <MASK><NEW_LINE>nameBlocks.add(prefix);<NEW_LINE>}<NEW_LINE>String group = matcher.group();<NEW_LINE>nameBlocks.add(group);<NEW_LINE>while (matcher.find()) {<NEW_LINE>group = matcher.group();<NEW_LINE>nameBlocks.add(group);<NEW_LINE>}<NEW_LINE>String[] blocks = nameBlocks.toArray(new String[0]);<NEW_LINE>for (int i = 0; i < blocks.length; i++) {<NEW_LINE>StringBuilder sb = new StringBuilder(StringUtils.toLowerCamelCase(blocks[i]));<NEW_LINE>for (int j = i + 1; j < blocks.length; j++) {<NEW_LINE>names.add(findFreeFieldName(sb.toString()));<NEW_LINE>sb.append(blocks[j]);<NEW_LINE>}<NEW_LINE>names.add(findFreeFieldName(sb.toString()));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>names.add(findFreeFieldName(typeName));<NEW_LINE>}<NEW_LINE>return Collections.unmodifiableList(new ArrayList<String>(names));<NEW_LINE>}
typeName.substring(0, idx);
276,008
private PersonAttribute checkPersonAttribute(Business business, PullResult result, Person person, User user, Attr attr) throws Exception {<NEW_LINE>EntityManagerContainer emc = business.entityManagerContainer();<NEW_LINE>EntityManager em = emc.get(PersonAttribute.class);<NEW_LINE>CriteriaBuilder cb = em.getCriteriaBuilder();<NEW_LINE>CriteriaQuery<PersonAttribute> cq = cb.createQuery(PersonAttribute.class);<NEW_LINE>Root<PersonAttribute> root = cq.from(PersonAttribute.class);<NEW_LINE>Predicate p = cb.equal(root.get(PersonAttribute_.person), person.getId());<NEW_LINE>p = cb.and(p, cb.equal(root.get(PersonAttribute_.name)<MASK><NEW_LINE>List<PersonAttribute> os = em.createQuery(cq.select(root).where(p)).setMaxResults(1).getResultList();<NEW_LINE>PersonAttribute personAttribute = null;<NEW_LINE>if (os.size() == 0) {<NEW_LINE>personAttribute = this.createPersonAttribute(business, result, person, attr);<NEW_LINE>} else {<NEW_LINE>personAttribute = os.get(0);<NEW_LINE>if (!StringUtils.equals(personAttribute.getAttributeList().get(0), attr.getValue())) {<NEW_LINE>personAttribute = this.updatePersonAttribute(business, result, personAttribute, attr);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return personAttribute;<NEW_LINE>}
, attr.getName()));
1,693,075
private static HRDParameters readHRDParameters(BitReader _in) {<NEW_LINE>HRDParameters hrd = new HRDParameters();<NEW_LINE>hrd.cpbCntMinus1 = readUEtrace(_in, "SPS: cpb_cnt_minus1");<NEW_LINE>hrd.bitRateScale = (int) readNBit(_in, 4, "HRD: bit_rate_scale");<NEW_LINE>hrd.cpbSizeScale = (int) readNBit(_in, 4, "HRD: cpb_size_scale");<NEW_LINE>hrd.bitRateValueMinus1 = new int[hrd.cpbCntMinus1 + 1];<NEW_LINE>hrd.cpbSizeValueMinus1 = new int[hrd.cpbCntMinus1 + 1];<NEW_LINE>hrd.cbrFlag = new boolean[hrd.cpbCntMinus1 + 1];<NEW_LINE>for (int SchedSelIdx = 0; SchedSelIdx <= hrd.cpbCntMinus1; SchedSelIdx++) {<NEW_LINE>hrd.bitRateValueMinus1[SchedSelIdx] = readUEtrace(_in, "HRD: bit_rate_value_minus1");<NEW_LINE>hrd.cpbSizeValueMinus1[SchedSelIdx] = readUEtrace(_in, "HRD: cpb_size_value_minus1");<NEW_LINE>hrd.cbrFlag[SchedSelIdx] = readBool(_in, "HRD: cbr_flag");<NEW_LINE>}<NEW_LINE>hrd.initialCpbRemovalDelayLengthMinus1 = (int) readNBit(_in, 5, "HRD: initial_cpb_removal_delay_length_minus1");<NEW_LINE>hrd.cpbRemovalDelayLengthMinus1 = (int) readNBit(_in, 5, "HRD: cpb_removal_delay_length_minus1");<NEW_LINE>hrd.dpbOutputDelayLengthMinus1 = (int) readNBit(_in, 5, "HRD: dpb_output_delay_length_minus1");<NEW_LINE>hrd.timeOffsetLength = (int) <MASK><NEW_LINE>return hrd;<NEW_LINE>}
readNBit(_in, 5, "HRD: time_offset_length");
1,494,293
public IAnyResource mergeGoldenResources(IAnyResource theFromGoldenResource, IAnyResource theMergedResource, IAnyResource theToGoldenResource, MdmTransactionContext theMdmTransactionContext) {<NEW_LINE>Long fromGoldenResourcePid = myIdHelperService.getPidOrThrowException(theFromGoldenResource);<NEW_LINE>Long toGoldenResourcePid = myIdHelperService.getPidOrThrowException(theToGoldenResource);<NEW_LINE><MASK><NEW_LINE>if (theMergedResource != null) {<NEW_LINE>if (myGoldenResourceHelper.hasIdentifier(theMergedResource)) {<NEW_LINE>throw new IllegalArgumentException(Msg.code(751) + "Manually merged resource can not contain identifiers");<NEW_LINE>}<NEW_LINE>myGoldenResourceHelper.mergeIndentifierFields(theFromGoldenResource, theMergedResource, theMdmTransactionContext);<NEW_LINE>myGoldenResourceHelper.mergeIndentifierFields(theToGoldenResource, theMergedResource, theMdmTransactionContext);<NEW_LINE>theMergedResource.setId(theToGoldenResource.getId());<NEW_LINE>theToGoldenResource = (IAnyResource) myMdmResourceDaoSvc.upsertGoldenResource(theMergedResource, resourceType).getResource();<NEW_LINE>} else {<NEW_LINE>myGoldenResourceHelper.mergeIndentifierFields(theFromGoldenResource, theToGoldenResource, theMdmTransactionContext);<NEW_LINE>myGoldenResourceHelper.mergeNonIdentiferFields(theFromGoldenResource, theToGoldenResource, theMdmTransactionContext);<NEW_LINE>// Save changes to the golden resource<NEW_LINE>myMdmResourceDaoSvc.upsertGoldenResource(theToGoldenResource, resourceType);<NEW_LINE>}<NEW_LINE>// Merge the links from the FROM to the TO resource. Clean up dangling links.<NEW_LINE>mergeGoldenResourceLinks(theFromGoldenResource, theToGoldenResource, toGoldenResourcePid, theMdmTransactionContext);<NEW_LINE>// Create the new REDIRECT link<NEW_LINE>addMergeLink(toGoldenResourcePid, fromGoldenResourcePid, resourceType);<NEW_LINE>// Strip the golden resource tag from the now-deprecated resource.<NEW_LINE>myMdmResourceDaoSvc.removeGoldenResourceTag(theFromGoldenResource, resourceType);<NEW_LINE>// Add the REDIRECT tag to that same deprecated resource.<NEW_LINE>MdmResourceUtil.setGoldenResourceRedirected(theFromGoldenResource);<NEW_LINE>// Save the deprecated resource.<NEW_LINE>myMdmResourceDaoSvc.upsertGoldenResource(theFromGoldenResource, resourceType);<NEW_LINE>log(theMdmTransactionContext, "Merged " + theFromGoldenResource.getIdElement().toVersionless() + " into " + theToGoldenResource.getIdElement().toVersionless());<NEW_LINE>return theToGoldenResource;<NEW_LINE>}
String resourceType = theMdmTransactionContext.getResourceType();
1,503,345
public boolean enclose() {<NEW_LINE>boolean retVal = false;<NEW_LINE>float[] minCoords = new float[getNumDims()];<NEW_LINE>Arrays.fill(minCoords, Float.POSITIVE_INFINITY);<NEW_LINE>float[] maxCoords = new float[getNumDims()];<NEW_LINE>Arrays.fill(maxCoords, Float.NEGATIVE_INFINITY);<NEW_LINE>for (Node child : getChildren()) {<NEW_LINE>for (int i = 0; i < getNumDims(); i++) {<NEW_LINE>minCoords[i] = Math.min(child.getMinCoordinates()[i], minCoords[i]);<NEW_LINE>maxCoords[i] = Math.max(child.getMaxCoordinates()[i], maxCoords[i]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!Arrays.equals(minCoords, minCoordinates)) {<NEW_LINE>System.arraycopy(minCoords, 0, <MASK><NEW_LINE>retVal = true;<NEW_LINE>}<NEW_LINE>if (!Arrays.equals(maxCoords, maxCoordinates)) {<NEW_LINE>System.arraycopy(maxCoords, 0, maxCoordinates, 0, maxCoordinates.length);<NEW_LINE>retVal = true;<NEW_LINE>}<NEW_LINE>return retVal;<NEW_LINE>}
minCoordinates, 0, minCoordinates.length);
1,027,007
private GerritMessageInfo createMessageInfo(TransformResult result, boolean newReview, String gerritChangeId, ChangeIdPolicy changeIdPolicy) throws ValidationException {<NEW_LINE>Revision rev = result.getCurrentRevision();<NEW_LINE>ImmutableList.Builder<LabelFinder> labels = ImmutableList.builder();<NEW_LINE>if (result.isSetRevId()) {<NEW_LINE>labels.add(new LabelFinder(result.getRevIdLabel() + ": " + rev.asString()));<NEW_LINE>}<NEW_LINE>String existingChangeId = getExistingChangeId(result.getSummary());<NEW_LINE>String effectiveChangeId = existingChangeId;<NEW_LINE>switch(changeIdPolicy) {<NEW_LINE>case REQUIRE:<NEW_LINE>ValidationException.checkCondition(existingChangeId != null, "%s label not found in message:\n%s", CHANGE_ID_LABEL, result.getSummary());<NEW_LINE>break;<NEW_LINE>case FAIL_IF_PRESENT:<NEW_LINE>ValidationException.checkCondition(existingChangeId == null, "%s label found in message:\n%s. You can use" + " git.gerrit_destination(change_id_policy = ...) to change this behavior", CHANGE_ID_LABEL, result.getSummary());<NEW_LINE>labels.add(new LabelFinder(CHANGE_ID_LABEL + ": " + gerritChangeId));<NEW_LINE>effectiveChangeId = gerritChangeId;<NEW_LINE>break;<NEW_LINE>case REUSE:<NEW_LINE>if (existingChangeId == null) {<NEW_LINE>labels.add(new LabelFinder<MASK><NEW_LINE>effectiveChangeId = gerritChangeId;<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case REPLACE:<NEW_LINE>labels.add(new LabelFinder(CHANGE_ID_LABEL + ": " + gerritChangeId));<NEW_LINE>effectiveChangeId = gerritChangeId;<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new UnsupportedOperationException("Unsupported policy: " + changeIdPolicy);<NEW_LINE>}<NEW_LINE>return new GerritMessageInfo(labels.build(), newReview, effectiveChangeId);<NEW_LINE>}
(CHANGE_ID_LABEL + ": " + gerritChangeId));
439,115
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {<NEW_LINE><MASK><NEW_LINE>out.println("Servlet to test ATP using UCP");<NEW_LINE>Connection conn = null;<NEW_LINE>try {<NEW_LINE>// Get a context for the JNDI look up<NEW_LINE>PoolDataSource pds = getPoolInstance();<NEW_LINE>conn = pds.getConnection();<NEW_LINE>// Prepare a statement to execute the SQL Queries.<NEW_LINE>Statement statement = conn.createStatement();<NEW_LINE>// Create table EMP<NEW_LINE>statement.executeUpdate("create table EMP(EMPLOYEEID NUMBER," + "EMPLOYEENAME VARCHAR2 (20))");<NEW_LINE>out.println("New table EMP is created");<NEW_LINE>// Insert some records into the table EMP<NEW_LINE>statement.executeUpdate("insert into EMP values(1, 'Jennifer Jones')");<NEW_LINE>statement.executeUpdate("insert into EMP values(2, 'Alex Debouir')");<NEW_LINE>out.println("Two records are inserted.");<NEW_LINE>// Update a record on EMP table.<NEW_LINE>statement.executeUpdate("update EMP set EMPLOYEENAME='Alex Deborie'" + " where EMPLOYEEID=2");<NEW_LINE>out.println("One record is updated.");<NEW_LINE>// Verify the table EMP<NEW_LINE>ResultSet resultSet = statement.executeQuery("select * from EMP");<NEW_LINE>out.println("\nNew table EMP contains:");<NEW_LINE>out.println("EMPLOYEEID" + " " + "EMPLOYEENAME");<NEW_LINE>out.println("--------------------------");<NEW_LINE>while (resultSet.next()) {<NEW_LINE>out.println(resultSet.getInt(1) + " " + resultSet.getString(2));<NEW_LINE>}<NEW_LINE>out.println("\nSuccessfully tested a connection to ATP using UCP");<NEW_LINE>} catch (Exception e) {<NEW_LINE>response.setStatus(500);<NEW_LINE>response.setHeader("Exception", e.toString());<NEW_LINE>out.print("\n Web Request failed");<NEW_LINE>out.print("\n " + e.toString());<NEW_LINE>e.printStackTrace();<NEW_LINE>} finally {<NEW_LINE>// Clean-up after everything<NEW_LINE>try (Statement statement = conn.createStatement()) {<NEW_LINE>statement.execute("drop table EMP");<NEW_LINE>conn.close();<NEW_LINE>} catch (SQLException e) {<NEW_LINE>System.out.println("UCPServlet - " + "doSQLWork()- SQLException occurred : " + e.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
PrintWriter out = response.getWriter();
413,634
public static Size fromDataSize(DataSize dataSize) {<NEW_LINE>switch(dataSize.getUnit()) {<NEW_LINE>case BYTES:<NEW_LINE>return Size.bytes(dataSize.getQuantity());<NEW_LINE>case KIBIBYTES:<NEW_LINE>return Size.<MASK><NEW_LINE>case KILOBYTES:<NEW_LINE>return Size.bytes(dataSize.toBytes());<NEW_LINE>case MEBIBYTES:<NEW_LINE>return Size.megabytes(dataSize.getQuantity());<NEW_LINE>case MEGABYTES:<NEW_LINE>return Size.bytes(dataSize.toBytes());<NEW_LINE>case GIBIBYTES:<NEW_LINE>return Size.gigabytes(dataSize.getQuantity());<NEW_LINE>case GIGABYTES:<NEW_LINE>return Size.bytes(dataSize.toBytes());<NEW_LINE>case TEBIBYTES:<NEW_LINE>return Size.terabytes(dataSize.getQuantity());<NEW_LINE>case TERABYTES:<NEW_LINE>return Size.bytes(dataSize.toBytes());<NEW_LINE>case PEBIBYTES:<NEW_LINE>return Size.terabytes(dataSize.toTebibytes() * 1024L);<NEW_LINE>case PETABYTES:<NEW_LINE>return Size.bytes(dataSize.toBytes());<NEW_LINE>default:<NEW_LINE>throw new IllegalArgumentException("Unknown unit: " + dataSize.getUnit());<NEW_LINE>}<NEW_LINE>}
kilobytes(dataSize.getQuantity());
1,329,268
protected TokenEntry processToken(Tokens tokenEntries, GenericToken currentToken, String fileName) {<NEW_LINE>String image = currentToken.getImage();<NEW_LINE>Token plsqlToken = (Token) currentToken;<NEW_LINE>if (ignoreIdentifiers && plsqlToken.kind == PLSQLParserConstants.IDENTIFIER) {<NEW_LINE>image = String.valueOf(plsqlToken.kind);<NEW_LINE>}<NEW_LINE>if (ignoreLiterals && (plsqlToken.kind == PLSQLParserConstants.UNSIGNED_NUMERIC_LITERAL || plsqlToken.kind == PLSQLParserConstants.FLOAT_LITERAL || plsqlToken.kind == PLSQLParserConstants.INTEGER_LITERAL || plsqlToken.kind == PLSQLParserConstants.CHARACTER_LITERAL || plsqlToken.kind == PLSQLParserConstants.STRING_LITERAL || plsqlToken.kind == PLSQLParserConstants.QUOTED_LITERAL)) {<NEW_LINE>image = String.valueOf(plsqlToken.kind);<NEW_LINE>}<NEW_LINE>return new TokenEntry(image, fileName, currentToken.getBeginLine(), currentToken.getBeginColumn(<MASK><NEW_LINE>}
), currentToken.getEndColumn());
831,599
public void testXA015(HttpServletRequest request, HttpServletResponse response) throws Exception {<NEW_LINE>final TransactionManager tm = TransactionManagerFactory.getTransactionManager();<NEW_LINE>final int commitRepeatCount = 3;<NEW_LINE>tm.begin();<NEW_LINE>final Transaction tx = tm.getTransaction();<NEW_LINE>tx.enlistResource(new XAResourceImpl());<NEW_LINE>tx<MASK><NEW_LINE>tx.enlistResource(new XAResourceImpl().setCommitAction(XAException.XAER_RMFAIL).setCommitRepeatCount(commitRepeatCount));<NEW_LINE>tx.enlistResource(new XAResourceImpl());<NEW_LINE>tx.enlistResource(new XAResourceImpl());<NEW_LINE>tx.enlistResource(new XAResourceImpl());<NEW_LINE>tx.enlistResource(new XAResourceImpl().setCommitAction(XAException.XAER_RMFAIL).setCommitRepeatCount(commitRepeatCount));<NEW_LINE>tx.enlistResource(new XAResourceImpl());<NEW_LINE>tx.enlistResource(new XAResourceImpl());<NEW_LINE>tx.enlistResource(new XAResourceImpl());<NEW_LINE>try {<NEW_LINE>tm.commit();<NEW_LINE>throw new Exception();<NEW_LINE>} catch (HeuristicMixedException e) {<NEW_LINE>// As expected<NEW_LINE>Thread.sleep(1000 * ((1 + commitRepeatCount) * HEURISTIC_RETRY_INTERVAL + SUITABLE_DELAY));<NEW_LINE>if (!XAResourceImpl.allInState(XAResourceImpl.COMMITTED)) {<NEW_LINE>throw new Exception();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.enlistResource(new XAResourceImpl());
1,267,281
public static StartingState determineStartingState(String jobId, List<PhaseProgress> progressOnStart) {<NEW_LINE>PhaseProgress lastIncompletePhase = null;<NEW_LINE>for (PhaseProgress phaseProgress : progressOnStart) {<NEW_LINE>if (phaseProgress.getProgressPercent() < 100) {<NEW_LINE>lastIncompletePhase = phaseProgress;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (lastIncompletePhase == null) {<NEW_LINE>return StartingState.FINISHED;<NEW_LINE>}<NEW_LINE>LOGGER.debug("[{}] Last incomplete progress [{}, {}]", jobId, lastIncompletePhase.getPhase(<MASK><NEW_LINE>if (ProgressTracker.REINDEXING.equals(lastIncompletePhase.getPhase())) {<NEW_LINE>return lastIncompletePhase.getProgressPercent() == 0 ? StartingState.FIRST_TIME : StartingState.RESUMING_REINDEXING;<NEW_LINE>}<NEW_LINE>if (ProgressTracker.INFERENCE.equals(lastIncompletePhase.getPhase())) {<NEW_LINE>return StartingState.RESUMING_INFERENCE;<NEW_LINE>}<NEW_LINE>return StartingState.RESUMING_ANALYZING;<NEW_LINE>}
), lastIncompletePhase.getProgressPercent());
885,956
public DefaultMutableTreeNode parent(MPPProductBOM bom) {<NEW_LINE>// System.out.println("Parent:" + bom.getName());<NEW_LINE>// X_M_Product product = new X_M_Product(getCtx(), bom.getM_Product_ID(),"M_Product");<NEW_LINE>// vparent.setValue(m_product_id);<NEW_LINE>DefaultMutableTreeNode parent = new DefaultMutableTreeNode(productSummary(bom));<NEW_LINE>if (m_level == getLevelNo()) {<NEW_LINE>m_level--;<NEW_LINE>return parent;<NEW_LINE>}<NEW_LINE>for (MPPProductBOMLine bomline : bom.getLines()) {<NEW_LINE>MProduct component = MProduct.get(getCtx(), bomline.getM_Product_ID());<NEW_LINE>// System.out.println("Componente :" + component.getValue() + "[" + component.getName() + "]");<NEW_LINE>// component(component);<NEW_LINE>Vector<Object> line = new Vector<Object>(17);<NEW_LINE>// 0 Select<NEW_LINE>line.add(new Boolean(false));<NEW_LINE>// 1 IsActive<NEW_LINE>line.add(new Boolean(true));<NEW_LINE>// 2 Line<NEW_LINE>line.add(new Integer(bomline.getLine()));<NEW_LINE>// 3 ValidDrom<NEW_LINE>line.add((Timestamp) bomline.getValidFrom());<NEW_LINE>// 4 ValidTo<NEW_LINE>line.add((Timestamp) bomline.getValidTo());<NEW_LINE>KeyNamePair pp = new KeyNamePair(component.getM_Product_ID(), component.getName());<NEW_LINE>// 5 M_Product_ID<NEW_LINE>line.add(pp);<NEW_LINE>KeyNamePair uom = new KeyNamePair(bomline.getC_UOM_ID(), bomline.getC_UOM().getUOMSymbol());<NEW_LINE>// 6 C_UOM_ID<NEW_LINE>line.add(uom);<NEW_LINE>// 7 IsQtyPercentage<NEW_LINE>line.add(new Boolean(bomline.isQtyPercentage()));<NEW_LINE>// 8 BatchPercent<NEW_LINE>line.add((BigDecimal) bomline.getQtyBatch());<NEW_LINE>// 9 QtyBom<NEW_LINE>line.add((BigDecimal) bomline.getQtyBOM());<NEW_LINE>// 10 IsCritical<NEW_LINE>line.add(new Boolean(bomline.isCritical()));<NEW_LINE>// 11 LTOffSet<NEW_LINE>line.add((Integer) bomline.getLeadTimeOffset());<NEW_LINE>// 12 Assay<NEW_LINE>line.add((<MASK><NEW_LINE>// 13 Scrap<NEW_LINE>line.add((BigDecimal) (bomline.getScrap()));<NEW_LINE>// 14 IssueMethod<NEW_LINE>line.add((String) bomline.getIssueMethod());<NEW_LINE>// 15 BackflushGroup<NEW_LINE>line.add((String) bomline.getBackflushGroup());<NEW_LINE>// 16 Forecast<NEW_LINE>line.add((BigDecimal) bomline.getForecast());<NEW_LINE>dataBOM.add(line);<NEW_LINE>parent.add(component(component));<NEW_LINE>}<NEW_LINE>m_level--;<NEW_LINE>return parent;<NEW_LINE>}
BigDecimal) bomline.getAssay());
382,059
private void extractX509Extensions() throws IOException, ParserException {<NEW_LINE>String ocspUrlResult = null;<NEW_LINE>byte[] certAsn1 = certificate.getEncoded();<NEW_LINE>// Parse ASN.1 structure of the certificate<NEW_LINE>Asn1Parser asn1Parser = new Asn1Parser(certAsn1, false);<NEW_LINE>List<Asn1Encodable> asn1Encodables = asn1Parser.parse(ParseOcspTypesContext.NAME);<NEW_LINE>Asn1Sequence innerObjects = (Asn1Sequence) ((Asn1Sequence) asn1Encodables.get(0)).getChildren().get(0);<NEW_LINE>// Get sequence containing X.509 extensions<NEW_LINE>Asn1Explicit x509Extensions = null;<NEW_LINE>for (Asn1Encodable singleObject : innerObjects.getChildren()) {<NEW_LINE>if (singleObject instanceof Asn1Explicit) {<NEW_LINE>if (((Asn1Explicit) singleObject).getOffset() == X509_EXTENSION_ASN1_EXPLICIT_OFFSET) {<NEW_LINE>x509Extensions = (Asn1Explicit) singleObject;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>x509ExtensionSequences = ((Asn1Sequence) x509Extensions.getChildren().get<MASK><NEW_LINE>}
(0)).getChildren();
683,532
public Request<DeleteTagsRequest> marshall(DeleteTagsRequest deleteTagsRequest) {<NEW_LINE>if (deleteTagsRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<DeleteTagsRequest> request = new DefaultRequest<DeleteTagsRequest>(deleteTagsRequest, "AmazonRedshift");<NEW_LINE>request.addParameter("Action", "DeleteTags");<NEW_LINE>request.addParameter("Version", "2012-12-01");<NEW_LINE><MASK><NEW_LINE>if (deleteTagsRequest.getResourceName() != null) {<NEW_LINE>request.addParameter("ResourceName", StringUtils.fromString(deleteTagsRequest.getResourceName()));<NEW_LINE>}<NEW_LINE>if (!deleteTagsRequest.getTagKeys().isEmpty() || !((com.amazonaws.internal.SdkInternalList<String>) deleteTagsRequest.getTagKeys()).isAutoConstruct()) {<NEW_LINE>com.amazonaws.internal.SdkInternalList<String> tagKeysList = (com.amazonaws.internal.SdkInternalList<String>) deleteTagsRequest.getTagKeys();<NEW_LINE>int tagKeysListIndex = 1;<NEW_LINE>for (String tagKeysListValue : tagKeysList) {<NEW_LINE>if (tagKeysListValue != null) {<NEW_LINE>request.addParameter("TagKeys.TagKey." + tagKeysListIndex, StringUtils.fromString(tagKeysListValue));<NEW_LINE>}<NEW_LINE>tagKeysListIndex++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
request.setHttpMethod(HttpMethodName.POST);
567,078
public static Object checkValidDataType(IParam sub, Context ctx, String type) {<NEW_LINE>Object retObj = null;<NEW_LINE>do {<NEW_LINE>if (sub == null) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>// System.out.println("checkValidDataType::IParam= "+sub);<NEW_LINE>Object o = sub.getLeafExpression().calculate(ctx);<NEW_LINE>if (type.equalsIgnoreCase("int")) {<NEW_LINE>if (!(o instanceof Integer)) {<NEW_LINE>System.out.println(<MASK><NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} else if (type.equalsIgnoreCase("long")) {<NEW_LINE>if (!(o instanceof Long)) {<NEW_LINE>System.out.println("instanceof = " + o + " is not " + type);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} else if (type.equalsIgnoreCase("bool")) {<NEW_LINE>if (!(o instanceof Boolean)) {<NEW_LINE>System.out.println("instanceof = " + o + " is not " + type);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} else if (type.equalsIgnoreCase("double")) {<NEW_LINE>if (!(o instanceof Double)) {<NEW_LINE>System.out.println("instanceof = " + o + " is not " + type);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} else if (type.equalsIgnoreCase("byte")) {<NEW_LINE>if (!(o instanceof byte[])) {<NEW_LINE>System.out.println("instanceof = " + o + " is not " + type);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} else if (type.equalsIgnoreCase("Sequence")) {<NEW_LINE>if (!(o instanceof Sequence)) {<NEW_LINE>System.out.println("instanceof = " + o + " is not " + type);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (o == null) {<NEW_LINE>break;<NEW_LINE>} else if (!(o instanceof String)) {<NEW_LINE>System.out.println("instanceof = " + o + " is not String");<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>retObj = o;<NEW_LINE>} while (false);<NEW_LINE>return retObj;<NEW_LINE>}
"instanceof = " + o + " is not " + type);
1,519,941
public void delete(String uid) {<NEW_LINE>Util.assertHasLength(uid);<NEW_LINE>if (!exist(uid)) {<NEW_LINE>throw new FeatureNotFoundException(uid);<NEW_LINE>}<NEW_LINE>// Parameter<NEW_LINE>Map<String, Object> paramUID = new HashMap<>();<NEW_LINE>paramUID.put("uid", uid);<NEW_LINE>Transaction tx = graphDb.beginTx();<NEW_LINE>// Delete Flipping Strategy if it exists<NEW_LINE>graphDb.execute(QUERY_CYPHER_DELETE_STRATEGY_FEATURE, paramUID);<NEW_LINE>// Delete Related Property if exist<NEW_LINE>graphDb.execute(QUERY_CYPHER_DELETE_PROPERTIES_FEATURE, paramUID);<NEW_LINE>// Check group<NEW_LINE>Result result = graphDb.execute(QUERY_CYPHER_GETGROUPNAME, paramUID);<NEW_LINE>if (result.hasNext()) {<NEW_LINE>String groupName = (String) result.next().get(GROUPNAME);<NEW_LINE>Map<String, Object> paramGroupName = new HashMap<>();<NEW_LINE><MASK><NEW_LINE>result = graphDb.execute(QUERY_CYPHER_COUNT_FEATURE_OF_GROUP, paramGroupName);<NEW_LINE>if (result.hasNext()) {<NEW_LINE>long nbFeature = (long) result.next().get(QUERY_CYPHER_ALIAS);<NEW_LINE>if (nbFeature == 1) {<NEW_LINE>// This is the last feature of this Group => delete the GROUP<NEW_LINE>graphDb.execute(QUERY_CYPHER_DELETE_GROUP_FEATURE, paramUID);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Delete feature<NEW_LINE>graphDb.execute(QUERY_CYPHER_DELETE_FEATURE, paramUID);<NEW_LINE>tx.success();<NEW_LINE>}
paramGroupName.put(GROUP_NAME, groupName);
471,082
public okhttp3.Call attachPolicyToUserCall(String userId, String policyId, final ApiCallback _callback) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/auth/users/{userId}/policies/{policyId}".replaceAll("\\{" + "userId" + "\\}", localVarApiClient.escapeString(userId.toString())).replaceAll("\\{" + "policyId" + "\\}", localVarApiClient.escapeString(policyId.toString()));<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, String> localVarCookieParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null) {<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>}<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "jwt_token" };<NEW_LINE>return localVarApiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, <MASK><NEW_LINE>}
localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
586,210
public void paintIcon(Component c, Graphics g, int x, int y) {<NEW_LINE>g.setColor(Color.WHITE);<NEW_LINE>g.fillRect(x, y, getIconWidth(), getIconHeight());<NEW_LINE>g.setColor(new Color(0xb5d5ff));<NEW_LINE>g.drawRect(x, y, getIconWidth(), getIconHeight());<NEW_LINE>float fontSize = getMaxFontSize(g, getIconWidth() - 1, getIconHeight());<NEW_LINE>Font originalFont = g.getFont();<NEW_LINE>Font textFont = originalFont.deriveFont(fontSize).deriveFont(Font.BOLD);<NEW_LINE>g.setFont(textFont);<NEW_LINE>FontMetrics fontMetrics = g.getFontMetrics(textFont);<NEW_LINE>Rectangle2D stringBounds = fontMetrics.getStringBounds(number, g);<NEW_LINE>int textHeight = (int) stringBounds.getHeight();<NEW_LINE>int iconHeight = getIconHeight();<NEW_LINE>int space = y + iconHeight - textHeight;<NEW_LINE>int halfSpace = space >> 1;<NEW_LINE>// - halfTextHeight;// + halfTextHeight;<NEW_LINE>int baselineY = y + iconHeight - halfSpace;<NEW_LINE>int textWidth = (int) stringBounds.getWidth();<NEW_LINE>int iconWidth = getIconWidth();<NEW_LINE>int halfWidth = iconWidth >> 1;<NEW_LINE>int halfTextWidth = textWidth >> 1;<NEW_LINE>int baselineX <MASK><NEW_LINE>g.setColor(Color.BLACK);<NEW_LINE>JComponent jc = null;<NEW_LINE>if (c instanceof JComponent) {<NEW_LINE>jc = (JComponent) c;<NEW_LINE>}<NEW_LINE>GraphicsUtils.drawString(jc, g, number, baselineX, baselineY);<NEW_LINE>}
= x + (halfWidth - halfTextWidth);
244,648
private static void writeParsedConfig(AppInfo appInfo, String certData, boolean uninstall, String... hostNames) throws IOException, CertificateEncodingException {<NEW_LINE>if (hostNames.length == 0)<NEW_LINE>hostNames = CertificateChainBuilder.DEFAULT_HOSTNAMES;<NEW_LINE>File cfgDir = tryWrite(appInfo, false);<NEW_LINE>// cleanup old version<NEW_LINE>deleteFile(cfgDir, "firefox-config.cfg");<NEW_LINE>File dest = new File(<MASK><NEW_LINE>HashMap<String, String> fieldMap = new HashMap<>();<NEW_LINE>// Dynamic fields<NEW_LINE>fieldMap.put("%CERT_DATA%", certData);<NEW_LINE>fieldMap.put("%COMMON_NAME%", hostNames[0]);<NEW_LINE>fieldMap.put("%TIMESTAMP%", uninstall ? "-1" : "" + new Date().getTime());<NEW_LINE>fieldMap.put("%APP_PATH%", SystemUtilities.isMac() ? SystemUtilities.getAppPath() != null ? SystemUtilities.getAppPath().toString() : "" : "");<NEW_LINE>fieldMap.put("%UNINSTALL%", "" + uninstall);<NEW_LINE>FileUtilities.configureAssetFile(CFG_TEMPLATE, dest, fieldMap, LegacyFirefoxCertificateInstaller.class);<NEW_LINE>dest.setReadable(true, false);<NEW_LINE>}
cfgDir.getPath(), CFG_FILE);
1,681,952
public static DetectIPCPedestrianResponse unmarshall(DetectIPCPedestrianResponse detectIPCPedestrianResponse, UnmarshallerContext _ctx) {<NEW_LINE>detectIPCPedestrianResponse.setRequestId(_ctx.stringValue("DetectIPCPedestrianResponse.RequestId"));<NEW_LINE>Data data = new Data();<NEW_LINE>List<ImageInfoListItem> imageInfoList = new ArrayList<ImageInfoListItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DetectIPCPedestrianResponse.Data.ImageInfoList.Length"); i++) {<NEW_LINE>ImageInfoListItem imageInfoListItem = new ImageInfoListItem();<NEW_LINE>imageInfoListItem.setErrorMessage(_ctx.stringValue("DetectIPCPedestrianResponse.Data.ImageInfoList[" + i + "].ErrorMessage"));<NEW_LINE>imageInfoListItem.setErrorCode(_ctx.stringValue("DetectIPCPedestrianResponse.Data.ImageInfoList[" + i + "].ErrorCode"));<NEW_LINE>imageInfoListItem.setDataId(_ctx.stringValue("DetectIPCPedestrianResponse.Data.ImageInfoList[" + i + "].DataId"));<NEW_LINE>List<Element> elements = new ArrayList<Element>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DetectIPCPedestrianResponse.Data.ImageInfoList[" + i + "].Elements.Length"); j++) {<NEW_LINE>Element element = new Element();<NEW_LINE>element.setScore(_ctx.floatValue("DetectIPCPedestrianResponse.Data.ImageInfoList[" + i + "].Elements[" + j + "].Score"));<NEW_LINE>List<Integer> boxes <MASK><NEW_LINE>for (int k = 0; k < _ctx.lengthValue("DetectIPCPedestrianResponse.Data.ImageInfoList[" + i + "].Elements[" + j + "].Boxes.Length"); k++) {<NEW_LINE>boxes.add(_ctx.integerValue("DetectIPCPedestrianResponse.Data.ImageInfoList[" + i + "].Elements[" + j + "].Boxes[" + k + "]"));<NEW_LINE>}<NEW_LINE>element.setBoxes(boxes);<NEW_LINE>elements.add(element);<NEW_LINE>}<NEW_LINE>imageInfoListItem.setElements(elements);<NEW_LINE>imageInfoList.add(imageInfoListItem);<NEW_LINE>}<NEW_LINE>data.setImageInfoList(imageInfoList);<NEW_LINE>detectIPCPedestrianResponse.setData(data);<NEW_LINE>return detectIPCPedestrianResponse;<NEW_LINE>}
= new ArrayList<Integer>();
25,655
private // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents<NEW_LINE>void initComponents() {<NEW_LINE>jScrollPane1 = <MASK><NEW_LINE>panel = new javax.swing.JPanel();<NEW_LINE>jScrollPane1.setBorder(null);<NEW_LINE>javax.swing.GroupLayout panelLayout = new javax.swing.GroupLayout(panel);<NEW_LINE>panel.setLayout(panelLayout);<NEW_LINE>panelLayout.setHorizontalGroup(panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 466, Short.MAX_VALUE));<NEW_LINE>panelLayout.setVerticalGroup(panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 201, Short.MAX_VALUE));<NEW_LINE>jScrollPane1.setViewportView(panel);<NEW_LINE>javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);<NEW_LINE>this.setLayout(layout);<NEW_LINE>layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 470, Short.MAX_VALUE));<NEW_LINE>layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 163, Short.MAX_VALUE));<NEW_LINE>}
new javax.swing.JScrollPane();
1,851,637
private Mono<Response<Flux<ByteBuffer>>> createOrUpdateWithResponseAsync(String resourceGroupName, String virtualHubName, VirtualHubInner virtualHubParameters, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (virtualHubName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter virtualHubName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (virtualHubParameters == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter virtualHubParameters is required and cannot be null."));<NEW_LINE>} else {<NEW_LINE>virtualHubParameters.validate();<NEW_LINE>}<NEW_LINE>final String apiVersion = "2018-11-01";<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, virtualHubName, <MASK><NEW_LINE>}
apiVersion, virtualHubParameters, accept, context);
1,154,404
public Parent createContent() {<NEW_LINE>htmlEditor = new HTMLEditor();<NEW_LINE>htmlEditor.setHtmlText(INITIAL_TEXT);<NEW_LINE>ScrollPane htmlSP = new ScrollPane();<NEW_LINE>htmlSP.setFitToWidth(true);<NEW_LINE>// Workaround of RT-21495<NEW_LINE>htmlSP.setPrefWidth(htmlEditor.prefWidth(-1));<NEW_LINE>htmlSP.setPrefHeight(245);<NEW_LINE>htmlSP.setVbarPolicy(ScrollBarPolicy.NEVER);<NEW_LINE>htmlSP.setContent(htmlEditor);<NEW_LINE>final Label htmlLabel = new Label();<NEW_LINE>htmlLabel.setWrapText(true);<NEW_LINE>ScrollPane scrollPane = new ScrollPane();<NEW_LINE>scrollPane.<MASK><NEW_LINE>scrollPane.setContent(htmlLabel);<NEW_LINE>scrollPane.setFitToWidth(true);<NEW_LINE>Button showHTMLButton = new Button("Show the HTML below");<NEW_LINE>showHTMLButton.setOnAction((ActionEvent arg0) -> {<NEW_LINE>htmlLabel.setText(htmlEditor.getHtmlText());<NEW_LINE>});<NEW_LINE>VBox vRoot = new VBox();<NEW_LINE>vRoot.setAlignment(Pos.CENTER);<NEW_LINE>vRoot.setSpacing(5);<NEW_LINE>vRoot.getChildren().addAll(htmlSP, showHTMLButton, scrollPane);<NEW_LINE>return vRoot;<NEW_LINE>}
getStyleClass().add("noborder-scroll-pane");
1,388,308
/*<NEW_LINE>* resets (clears) the reader database<NEW_LINE>*/<NEW_LINE>public static void reset(boolean retainBookmarkedPosts) {<NEW_LINE>// note that we must call getWritableDb() before getDatabase() in case the database<NEW_LINE>// object hasn't been created yet<NEW_LINE>SQLiteDatabase db = getWritableDb();<NEW_LINE>if (retainBookmarkedPosts && ReaderPostTable.hasBookmarkedPosts()) {<NEW_LINE>ReaderTagList tags = ReaderTagTable.getBookmarkTags();<NEW_LINE>if (!tags.isEmpty()) {<NEW_LINE>ReaderPostList bookmarkedPosts = ReaderPostTable.getPostsWithTag(tags.get(0), 0, false);<NEW_LINE>db.beginTransaction();<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>ReaderPostTable.addOrUpdatePosts(tags.get(0), bookmarkedPosts);<NEW_LINE>db.setTransactionSuccessful();<NEW_LINE>} finally {<NEW_LINE>db.endTransaction();<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>getDatabase().reset(db);<NEW_LINE>}
getDatabase().reset(db);
117,067
final CreateAssessmentResult executeCreateAssessment(CreateAssessmentRequest createAssessmentRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createAssessmentRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateAssessmentRequest> request = null;<NEW_LINE>Response<CreateAssessmentResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new CreateAssessmentRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createAssessmentRequest));<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, "AuditManager");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateAssessment");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateAssessmentResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateAssessmentResultJsonUnmarshaller());<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.RequestMarshallTime);
950,534
public Object execute(ExecutionEvent event) throws ExecutionException {<NEW_LINE>String wizardId = event.getParameter(ProjectTemplateSelectionPage.COMMAND_PROJECT_FROM_TEMPLATE_NEW_WIZARD_ID);<NEW_LINE>String templateName = event.getParameter(ProjectTemplateSelectionPage.COMMAND_PROJECT_FROM_TEMPLATE_PROJECT_TEMPLATE_NAME);<NEW_LINE>IWizardRegistry wizardRegistry = PlatformUI.getWorkbench().getNewWizardRegistry();<NEW_LINE>IWizardDescriptor wizardDescriptor = wizardRegistry.findWizard(wizardId);<NEW_LINE>if (wizardDescriptor == null) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>throw new ExecutionException("unknown wizard: " + wizardId);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>wizard.init(PlatformUI.getWorkbench(), null);<NEW_LINE>if (wizard instanceof IExecutableExtension) {<NEW_LINE>((IExecutableExtension) wizard).setInitializationData(null, ProjectTemplateSelectionPage.COMMAND_PROJECT_FROM_TEMPLATE_PROJECT_TEMPLATE_NAME, templateName);<NEW_LINE>}<NEW_LINE>if (wizardDescriptor.canFinishEarly() && !wizardDescriptor.hasPages()) {<NEW_LINE>wizard.performFinish();<NEW_LINE>return getProject(wizard);<NEW_LINE>}<NEW_LINE>Shell parent = UIUtils.getActiveShell();<NEW_LINE>WizardDialog dialog = new WizardDialog(parent, wizard);<NEW_LINE>dialog.create();<NEW_LINE>dialog.open();<NEW_LINE>return getProject(wizard);<NEW_LINE>} catch (CoreException ex) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>throw new ExecutionException("error creating wizard", ex);<NEW_LINE>}<NEW_LINE>}
IWorkbenchWizard wizard = wizardDescriptor.createWizard();
956,664
public static List<String> findClasses(String[] searchPathsOrJars, ClassFilter filter) throws IOException {<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("findClasses with searchPathsOrJars : {} and classFilter : {}", Arrays.toString(searchPathsOrJars), filter);<NEW_LINE>}<NEW_LINE>// Find all jars in the search path<NEW_LINE>Collection<File> strPathsOrJars = addJarsInPath(searchPathsOrJars);<NEW_LINE>// Some of the jars might be out of classpath, however java.class.path does not represent<NEW_LINE>// the actual ClassLoader in use. For instance, NewDriver builds its own classpath<NEW_LINE>Set<String> listClasses = new TreeSet<>();<NEW_LINE>// first get all the classes<NEW_LINE>for (File path : strPathsOrJars) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("listClasses.size()={}", listClasses.size());<NEW_LINE>for (String clazz : listClasses) {<NEW_LINE>log.debug("listClasses : {}", clazz);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new ArrayList<>(listClasses);<NEW_LINE>}
findClassesInOnePath(path, listClasses, filter);
1,517,827
final ListAssociationVersionsResult executeListAssociationVersions(ListAssociationVersionsRequest listAssociationVersionsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listAssociationVersionsRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListAssociationVersionsRequest> request = null;<NEW_LINE>Response<ListAssociationVersionsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListAssociationVersionsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listAssociationVersionsRequest));<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, "SSM");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListAssociationVersions");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListAssociationVersionsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListAssociationVersionsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
1,442,711
private boolean definePropertyLength(JSDynamicObject thisObj, PropertyDescriptor descriptor, PropertyDescriptor currentDesc, long len, boolean doThrow) {<NEW_LINE>assert JSRuntime.isValidArrayLength(len);<NEW_LINE>assert !currentDesc.getConfigurable();<NEW_LINE>boolean currentWritable = currentDesc.getWritable();<NEW_LINE>boolean currentEnumerable = currentDesc.getEnumerable();<NEW_LINE>boolean newWritable = descriptor.getIfHasWritable(currentWritable);<NEW_LINE>boolean newEnumerable = descriptor.getIfHasEnumerable(currentEnumerable);<NEW_LINE>boolean <MASK><NEW_LINE>if (newConfigurable || (newEnumerable != currentEnumerable)) {<NEW_LINE>// ES2020 9.1.6.3, 4.a and 4.b<NEW_LINE>return DefinePropertyUtil.reject(doThrow, CANNOT_REDEFINE_PROPERTY_LENGTH);<NEW_LINE>}<NEW_LINE>if (currentWritable == newWritable && currentEnumerable == newEnumerable) {<NEW_LINE>if (!descriptor.hasValue() || len == getLength(thisObj)) {<NEW_LINE>// nothing changed<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!currentWritable) {<NEW_LINE>return DefinePropertyUtil.reject(doThrow, LENGTH_PROPERTY_NOT_WRITABLE);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>setLength(thisObj, len, doThrow);<NEW_LINE>} finally {<NEW_LINE>int newAttr = JSAttributes.fromConfigurableEnumerableWritable(newConfigurable, newEnumerable, newWritable);<NEW_LINE>JSObjectUtil.changePropertyFlags(thisObj, LENGTH, newAttr);<NEW_LINE>}<NEW_LINE>if (!newWritable) {<NEW_LINE>setLengthNotWritable(thisObj);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
newConfigurable = descriptor.getIfHasConfigurable(false);
962,653
public void finished() {<NEW_LINE>if (debug) {<NEW_LINE>printClock();<NEW_LINE>}<NEW_LINE>int cold = (int) data.values().stream().filter(node -> node.status == Status.COLD).count();<NEW_LINE>int hot = (int) data.values().stream().filter(node -> node.status == Status.HOT).count();<NEW_LINE>int nonResident = (int) data.values().stream().filter(node -> node.status == Status.NR).count();<NEW_LINE>checkState(cold == sizeCold, "Cold: expected %s but was %s", sizeCold, cold);<NEW_LINE>checkState(hot == <MASK><NEW_LINE>checkState(nonResident == sizeNR, "NonResident: expected %s but was %s", sizeNR, nonResident);<NEW_LINE>checkState(data.size() == (cold + hot + nonResident));<NEW_LINE>checkState(cold + hot <= maxSize);<NEW_LINE>checkState(nonResident <= maxSize);<NEW_LINE>}
sizeHot, "Hot: expected %s but was %s", sizeHot, hot);
348,216
public static SqlOperatorTable operatorTable(String className) {<NEW_LINE>// Dummy schema to collect the functions<NEW_LINE>final CalciteSchema schema = CalciteSchema.createRootSchema(false, false);<NEW_LINE>ModelHandler.addFunctions(schema.plus(), null, ImmutableList.of(), className, "*", true);<NEW_LINE>// The following is technical debt; see [CALCITE-2082] Remove<NEW_LINE>// RelDataTypeFactory argument from SqlUserDefinedAggFunction constructor<NEW_LINE>final SqlTypeFactoryImpl typeFactory <MASK><NEW_LINE>final ListSqlOperatorTable table = new ListSqlOperatorTable();<NEW_LINE>for (String name : schema.getFunctionNames()) {<NEW_LINE>for (Function function : schema.getFunctions(name, true)) {<NEW_LINE>final SqlIdentifier id = new SqlIdentifier(name, SqlParserPos.ZERO);<NEW_LINE>table.add(toOp(typeFactory, id, function));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return table;<NEW_LINE>}
= new SqlTypeFactoryImpl(RelDataTypeSystem.DEFAULT);
1,753,537
public void generateBToJCheckCast(MethodVisitor mv, BType sourceType, JType targetType) {<NEW_LINE>switch(targetType.jTag) {<NEW_LINE>case JTypeTags.JBYTE:<NEW_LINE>generateCheckCastBToJByte(mv, sourceType);<NEW_LINE>break;<NEW_LINE>case JTypeTags.JCHAR:<NEW_LINE>generateCheckCastBToJChar(mv, sourceType);<NEW_LINE>break;<NEW_LINE>case JTypeTags.JSHORT:<NEW_LINE>generateCheckCastBToJShort(mv, sourceType);<NEW_LINE>break;<NEW_LINE>case JTypeTags.JINT:<NEW_LINE>generateCheckCastBToJInt(mv, sourceType);<NEW_LINE>break;<NEW_LINE>case JTypeTags.JLONG:<NEW_LINE>generateCheckCastBToJLong(mv, sourceType);<NEW_LINE>break;<NEW_LINE>case JTypeTags.JFLOAT:<NEW_LINE>generateCheckCastBToJFloat(mv, sourceType);<NEW_LINE>break;<NEW_LINE>case JTypeTags.JDOUBLE:<NEW_LINE>generateCheckCastBToJDouble(mv, sourceType);<NEW_LINE>break;<NEW_LINE>case JTypeTags.JBOOLEAN:<NEW_LINE>generateCheckCastBToJBoolean(mv, sourceType);<NEW_LINE>break;<NEW_LINE>case JTypeTags.JREF:<NEW_LINE>generateCheckCastBToJRef(mv, sourceType, targetType);<NEW_LINE>break;<NEW_LINE>case JTypeTags.JARRAY:<NEW_LINE><MASK><NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new BLangCompilerException("Casting is not supported from '" + sourceType + "' to" + " 'java " + targetType + "'");<NEW_LINE>}<NEW_LINE>}
generateCheckCastBToJRef(mv, sourceType, targetType);
1,179,467
public HttpResponse logoutUserForHttpResponse(Map<String, Object> params) throws IOException {<NEW_LINE>UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/user/logout");<NEW_LINE>// Copy the params argument if present, to allow passing in immutable maps<NEW_LINE>Map<String, Object> allParams = params == null ? new HashMap<String, Object>() : new HashMap<MASK><NEW_LINE>for (Map.Entry<String, Object> entry : allParams.entrySet()) {<NEW_LINE>String key = entry.getKey();<NEW_LINE>Object value = entry.getValue();<NEW_LINE>if (key != null && value != null) {<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, (Object[]) value);<NEW_LINE>} else {<NEW_LINE>uriBuilder = uriBuilder.queryParam(key, value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String localVarUrl = uriBuilder.build().toString();<NEW_LINE>GenericUrl genericUrl = new GenericUrl(localVarUrl);<NEW_LINE>HttpContent content = null;<NEW_LINE>return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content).execute();<NEW_LINE>}
<String, Object>(params);
1,693,075
private static HRDParameters readHRDParameters(BitReader _in) {<NEW_LINE>HRDParameters hrd = new HRDParameters();<NEW_LINE>hrd.cpbCntMinus1 = readUEtrace(_in, "SPS: cpb_cnt_minus1");<NEW_LINE>hrd.bitRateScale = (int) <MASK><NEW_LINE>hrd.cpbSizeScale = (int) readNBit(_in, 4, "HRD: cpb_size_scale");<NEW_LINE>hrd.bitRateValueMinus1 = new int[hrd.cpbCntMinus1 + 1];<NEW_LINE>hrd.cpbSizeValueMinus1 = new int[hrd.cpbCntMinus1 + 1];<NEW_LINE>hrd.cbrFlag = new boolean[hrd.cpbCntMinus1 + 1];<NEW_LINE>for (int SchedSelIdx = 0; SchedSelIdx <= hrd.cpbCntMinus1; SchedSelIdx++) {<NEW_LINE>hrd.bitRateValueMinus1[SchedSelIdx] = readUEtrace(_in, "HRD: bit_rate_value_minus1");<NEW_LINE>hrd.cpbSizeValueMinus1[SchedSelIdx] = readUEtrace(_in, "HRD: cpb_size_value_minus1");<NEW_LINE>hrd.cbrFlag[SchedSelIdx] = readBool(_in, "HRD: cbr_flag");<NEW_LINE>}<NEW_LINE>hrd.initialCpbRemovalDelayLengthMinus1 = (int) readNBit(_in, 5, "HRD: initial_cpb_removal_delay_length_minus1");<NEW_LINE>hrd.cpbRemovalDelayLengthMinus1 = (int) readNBit(_in, 5, "HRD: cpb_removal_delay_length_minus1");<NEW_LINE>hrd.dpbOutputDelayLengthMinus1 = (int) readNBit(_in, 5, "HRD: dpb_output_delay_length_minus1");<NEW_LINE>hrd.timeOffsetLength = (int) readNBit(_in, 5, "HRD: time_offset_length");<NEW_LINE>return hrd;<NEW_LINE>}
readNBit(_in, 4, "HRD: bit_rate_scale");
407,199
protected boolean writeCustomProperties(ServiceTask serviceTask, boolean didWriteExtensionStartElement, XMLStreamWriter xtw) throws Exception {<NEW_LINE>for (CustomProperty customProperty : serviceTask.getCustomProperties()) {<NEW_LINE>if (StringUtils.isEmpty(customProperty.getSimpleValue())) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (!didWriteExtensionStartElement) {<NEW_LINE>xtw.writeStartElement(ELEMENT_EXTENSIONS);<NEW_LINE>didWriteExtensionStartElement = true;<NEW_LINE>}<NEW_LINE>xtw.writeStartElement(FLOWABLE_EXTENSIONS_PREFIX, ELEMENT_FIELD, FLOWABLE_EXTENSIONS_NAMESPACE);<NEW_LINE>xtw.writeAttribute(ATTRIBUTE_FIELD_NAME, customProperty.getName());<NEW_LINE>if ((customProperty.getSimpleValue().contains("${") || customProperty.getSimpleValue().contains("#{")) && customProperty.getSimpleValue().contains("}")) {<NEW_LINE>xtw.<MASK><NEW_LINE>} else {<NEW_LINE>xtw.writeStartElement(FLOWABLE_EXTENSIONS_PREFIX, ELEMENT_FIELD_STRING, FLOWABLE_EXTENSIONS_NAMESPACE);<NEW_LINE>}<NEW_LINE>xtw.writeCharacters(customProperty.getSimpleValue());<NEW_LINE>xtw.writeEndElement();<NEW_LINE>xtw.writeEndElement();<NEW_LINE>}<NEW_LINE>return didWriteExtensionStartElement;<NEW_LINE>}
writeStartElement(FLOWABLE_EXTENSIONS_PREFIX, ATTRIBUTE_FIELD_EXPRESSION, FLOWABLE_EXTENSIONS_NAMESPACE);
1,084,416
public DescribeAttackResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DescribeAttackResult describeAttackResult = new DescribeAttackResult();<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 describeAttackResult;<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("Attack", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>describeAttackResult.setAttack(AttackDetailJsonUnmarshaller.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 describeAttackResult;<NEW_LINE>}
().unmarshall(context));
1,571,202
private static void initKafkaProducerMap(Long clusterId) {<NEW_LINE>ClusterDO clusterDO = PhysicalClusterMetadataManager.getClusterFromCache(clusterId);<NEW_LINE>if (clusterDO == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>lock.lock();<NEW_LINE>try {<NEW_LINE>KafkaProducer<String, String> kafkaProducer = KAFKA_PRODUCER_MAP.get(clusterId);<NEW_LINE>if (!ValidateUtils.isNull(kafkaProducer)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Properties properties = createProperties(clusterDO, true);<NEW_LINE>properties.setProperty(ProducerConfig.COMPRESSION_TYPE_CONFIG, "lz4");<NEW_LINE>properties.setProperty(ProducerConfig.LINGER_MS_CONFIG, "10");<NEW_LINE>properties.setProperty(ProducerConfig.RETRIES_CONFIG, "3");<NEW_LINE>KAFKA_PRODUCER_MAP.put(clusterId, new KafkaProducer<>(properties));<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.<MASK><NEW_LINE>} finally {<NEW_LINE>lock.unlock();<NEW_LINE>}<NEW_LINE>}
error("create kafka producer failed, clusterDO:{}.", clusterDO, e);
542,217
private ConfigCenterConfig registryAsConfigCenter(RegistryConfig registryConfig) {<NEW_LINE>String protocol = registryConfig.getProtocol();<NEW_LINE><MASK><NEW_LINE>URL url = URL.valueOf(registryConfig.getAddress(), registryConfig.getScopeModel());<NEW_LINE>String id = "config-center-" + protocol + "-" + url.getHost() + "-" + port;<NEW_LINE>ConfigCenterConfig cc = new ConfigCenterConfig();<NEW_LINE>cc.setId(id);<NEW_LINE>cc.setScopeModel(applicationModel);<NEW_LINE>if (cc.getParameters() == null) {<NEW_LINE>cc.setParameters(new HashMap<>());<NEW_LINE>}<NEW_LINE>if (CollectionUtils.isNotEmptyMap(registryConfig.getParameters())) {<NEW_LINE>// copy the parameters<NEW_LINE>cc.getParameters().putAll(registryConfig.getParameters());<NEW_LINE>}<NEW_LINE>cc.getParameters().put(CLIENT_KEY, registryConfig.getClient());<NEW_LINE>cc.setProtocol(protocol);<NEW_LINE>cc.setPort(port);<NEW_LINE>if (StringUtils.isNotEmpty(registryConfig.getGroup())) {<NEW_LINE>cc.setGroup(registryConfig.getGroup());<NEW_LINE>}<NEW_LINE>cc.setAddress(getRegistryCompatibleAddress(registryConfig));<NEW_LINE>cc.setNamespace(registryConfig.getGroup());<NEW_LINE>cc.setUsername(registryConfig.getUsername());<NEW_LINE>cc.setPassword(registryConfig.getPassword());<NEW_LINE>if (registryConfig.getTimeout() != null) {<NEW_LINE>cc.setTimeout(registryConfig.getTimeout().longValue());<NEW_LINE>}<NEW_LINE>cc.setHighestPriority(false);<NEW_LINE>return cc;<NEW_LINE>}
Integer port = registryConfig.getPort();
805,144
public static Iterable<SqlFeatureContext> loadFeatures() throws IOException {<NEW_LINE>try (InputStream sqlFeatures = SqlFeatures.class.getResourceAsStream("/sql_features.tsv")) {<NEW_LINE>if (sqlFeatures == null) {<NEW_LINE>throw new ResourceNotFoundException("sql_features.tsv file not found");<NEW_LINE>}<NEW_LINE>ArrayList<SqlFeatureContext> featuresList = new ArrayList<>();<NEW_LINE>try (BufferedReader reader = new BufferedReader(new InputStreamReader(sqlFeatures, StandardCharsets.UTF_8))) {<NEW_LINE>String next;<NEW_LINE>while ((next = reader.readLine()) != null) {<NEW_LINE>List<String> parts = List.of(next<MASK><NEW_LINE>var ctx = new SqlFeatureContext(parts.get(0), parts.get(1), parts.get(2), parts.get(3), parts.get(4).equals("YES"), parts.get(5).isEmpty() ? null : parts.get(5), parts.get(6).isEmpty() ? null : parts.get(6));<NEW_LINE>featuresList.add(ctx);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return featuresList;<NEW_LINE>}<NEW_LINE>}
.split("\t", NUM_COLS));
201,420
public Font resolveDeserializedFont(Font font) {<NEW_LINE>// We use the font.getName() method here because the name field in the java.awt.Font class is the only font name related information that gets serialized,<NEW_LINE>// along with the size and style. The font.getFontName() and font.getFamily() both return runtime calculated values, which are not accurate in case of AWT fonts<NEW_LINE>// created at runtime through font extensions (both seem to return 'Dialog').<NEW_LINE>// For AWT fonts created from font extensions using the Font.createFont(int, InputStream), the name field is set to the same value as the font.getFontName(),<NEW_LINE>// which is the recommended method to get the name of an AWT font.<NEW_LINE>String fontName = font.getName();<NEW_LINE>// We load an instance of an AWT font, even if the specified font name is not available (ignoreMissingFont=true),<NEW_LINE>// because only third-party visualization packages such as JFreeChart (chart themes) store serialized java.awt.Font objects,<NEW_LINE>// and they are responsible for the drawing as well.<NEW_LINE>// Here we rely on the utility method ability to find a font by face name, not only family name. This is because font.getName() above returns an AWT font name,<NEW_LINE>// not a font family name.<NEW_LINE>Font newFont = getAwtFontFromBundles(fontName, font.getStyle(), font.<MASK><NEW_LINE>if (newFont != null) {<NEW_LINE>return newFont.deriveFont(font.getAttributes());<NEW_LINE>}<NEW_LINE>return font;<NEW_LINE>}
getSize2D(), null, true);
471,470
protected void createMultiInstanceLoopCharacteristics(BpmnParse bpmnParse, Activity modelActivity) {<NEW_LINE><MASK><NEW_LINE>MultiInstanceActivityBehavior miActivityBehavior = createMultiInstanceActivityBehavior(bpmnParse, modelActivity, loopCharacteristics);<NEW_LINE>modelActivity.setBehavior(miActivityBehavior);<NEW_LINE>ExpressionManager expressionManager = Context.getProcessEngineConfiguration().getExpressionManager();<NEW_LINE>// loop cardinality<NEW_LINE>if (StringUtils.isNotEmpty(loopCharacteristics.getLoopCardinality())) {<NEW_LINE>miActivityBehavior.setLoopCardinalityExpression(expressionManager.createExpression(loopCharacteristics.getLoopCardinality()));<NEW_LINE>}<NEW_LINE>// completion condition<NEW_LINE>if (StringUtils.isNotEmpty(loopCharacteristics.getCompletionCondition())) {<NEW_LINE>miActivityBehavior.setCompletionConditionExpression(expressionManager.createExpression(loopCharacteristics.getCompletionCondition()));<NEW_LINE>}<NEW_LINE>// activiti:collection<NEW_LINE>if (StringUtils.isNotEmpty(loopCharacteristics.getInputDataItem())) {<NEW_LINE>if (loopCharacteristics.getInputDataItem().contains("{")) {<NEW_LINE>miActivityBehavior.setCollectionExpression(expressionManager.createExpression(loopCharacteristics.getInputDataItem()));<NEW_LINE>} else {<NEW_LINE>miActivityBehavior.setCollectionVariable(loopCharacteristics.getInputDataItem());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// activiti:elementVariable<NEW_LINE>if (StringUtils.isNotEmpty(loopCharacteristics.getElementVariable())) {<NEW_LINE>miActivityBehavior.setCollectionElementVariable(loopCharacteristics.getElementVariable());<NEW_LINE>}<NEW_LINE>// activiti:elementIndexVariable<NEW_LINE>if (StringUtils.isNotEmpty(loopCharacteristics.getElementIndexVariable())) {<NEW_LINE>miActivityBehavior.setCollectionElementIndexVariable(loopCharacteristics.getElementIndexVariable());<NEW_LINE>}<NEW_LINE>if (StringUtils.isNotEmpty(loopCharacteristics.getLoopDataOutputRef())) {<NEW_LINE>miActivityBehavior.setLoopDataOutputRef(loopCharacteristics.getLoopDataOutputRef());<NEW_LINE>}<NEW_LINE>if (StringUtils.isNotEmpty(loopCharacteristics.getOutputDataItem())) {<NEW_LINE>miActivityBehavior.setOutputDataItem(loopCharacteristics.getOutputDataItem());<NEW_LINE>}<NEW_LINE>}
MultiInstanceLoopCharacteristics loopCharacteristics = modelActivity.getLoopCharacteristics();
1,603,529
protected Single<Subject> enhance(ProviderRequest request, AuthenticationResponse previousResponse, Subject subject) {<NEW_LINE>String username = subject.principal().getName();<NEW_LINE>Optional<List<Grant>> grants = roleCache.computeValue(username, Optional::empty);<NEW_LINE>if (grants.isPresent()) {<NEW_LINE>return addAdditionalGrants(subject, grants.get()).map(it -> {<NEW_LINE>List<Grant> allGrants = new LinkedList<>(grants.get());<NEW_LINE>allGrants.addAll(it);<NEW_LINE>return buildSubject(subject, allGrants);<NEW_LINE>});<NEW_LINE>}<NEW_LINE>// we do not have a cached value, we must request it from remote server<NEW_LINE>// this may trigger multiple times in parallel - rather than creating a map of future for each user<NEW_LINE>// we leave this be (as the map of futures may be unlimited)<NEW_LINE>List<Grant> result = new LinkedList<>();<NEW_LINE>return computeGrants(subject).map(it -> {<NEW_LINE>result.addAll(it);<NEW_LINE>return result;<NEW_LINE>}).map(// additional grants may not be cached (leave this decision to overriding class)<NEW_LINE>newGrants -> roleCache.computeValue(username, () -> Optional.of(List.copyOf(newGrants))).orElseGet(List::of)).flatMapSingle(it -> addAdditionalGrants(subject, it)).map(newGrants -> {<NEW_LINE>result.addAll(newGrants);<NEW_LINE>return result;<NEW_LINE>}).map(it <MASK><NEW_LINE>}
-> buildSubject(subject, it));
1,556,694
private static void destroyOpenAL() {<NEW_LINE>if (!trackExists())<NEW_LINE>return;<NEW_LINE>stop();<NEW_LINE>if (!AL.isCreated())<NEW_LINE>return;<NEW_LINE>try {<NEW_LINE>// get Music object's (private) Audio object reference<NEW_LINE>Field sound = player.getClass().getDeclaredField("sound");<NEW_LINE>sound.setAccessible(true);<NEW_LINE>Audio audio = (Audio) (sound.get(player));<NEW_LINE>// first clear the sources allocated by SoundStore<NEW_LINE>int max = SoundStore<MASK><NEW_LINE>IntBuffer buf = BufferUtils.createIntBuffer(max);<NEW_LINE>for (int i = 0; i < max; i++) {<NEW_LINE>int source = SoundStore.get().getSource(i);<NEW_LINE>buf.put(source);<NEW_LINE>// stop and detach any buffers at this source<NEW_LINE>AL10.alSourceStop(source);<NEW_LINE>AL10.alSourcei(source, AL10.AL_BUFFER, 0);<NEW_LINE>}<NEW_LINE>buf.flip();<NEW_LINE>AL10.alDeleteSources(buf);<NEW_LINE>int exc = AL10.alGetError();<NEW_LINE>if (exc != AL10.AL_NO_ERROR) {<NEW_LINE>throw new SlickException("Could not clear SoundStore sources, err: " + exc);<NEW_LINE>}<NEW_LINE>// delete any buffer data stored in memory, too...<NEW_LINE>if (audio != null && audio.getBufferID() != 0) {<NEW_LINE>buf = BufferUtils.createIntBuffer(1).put(audio.getBufferID());<NEW_LINE>buf.flip();<NEW_LINE>AL10.alDeleteBuffers(buf);<NEW_LINE>exc = AL10.alGetError();<NEW_LINE>if (exc != AL10.AL_NO_ERROR) {<NEW_LINE>throw new SlickException("Could not clear buffer " + audio.getBufferID() + ", err: " + exc);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// clear OpenAL<NEW_LINE>AL.destroy();<NEW_LINE>// reset SoundStore so that next time we create a Sound/Music, it will reinit<NEW_LINE>SoundStore.get().clear();<NEW_LINE>player = null;<NEW_LINE>} catch (Exception e) {<NEW_LINE>ErrorHandler.error("Failed to destroy the OpenAL context.", e, true);<NEW_LINE>}<NEW_LINE>}
.get().getSourceCount();
946,361
public void onItemSelected(AdapterView<?> parent, View view, int pos, long id) {<NEW_LINE>String selected = parent.getItemAtPosition(pos).toString();<NEW_LINE>if (parent == baudRateSpinner) {<NEW_LINE>setBaudRate(Integer.parseInt(selected));<NEW_LINE>} else if (parent == modelSpinner) {<NEW_LINE>try {<NEW_LINE>masterList.stream().filter(f -> f.name.contains(selected)).findFirst().ifPresent(this::setModel);<NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>} else if (parent == deviceSpinner) {<NEW_LINE>setDevice(Device.valueOf(selected.toUpperCase()));<NEW_LINE>} else if (parent == logSpinner) {<NEW_LINE>setLogMode(LogMode.valueOf(selected.toUpperCase()));<NEW_LINE>} else if (parent == controlModeSpinner) {<NEW_LINE>setControlMode(ControlMode.valueOf<MASK><NEW_LINE>} else if (parent == driveModeSpinner) {<NEW_LINE>setDriveMode(DriveMode.valueOf(parent.getItemAtPosition(pos).toString().toUpperCase()));<NEW_LINE>} else if (parent == speedModeSpinner) {<NEW_LINE>setSpeedMode(SpeedMode.valueOf(selected.toUpperCase()));<NEW_LINE>}<NEW_LINE>}
(selected.toUpperCase()));
1,708,697
private void fullScreen() {<NEW_LINE>// hide top status bar<NEW_LINE>Activity activity = (Activity) getContext();<NEW_LINE>WindowManager.LayoutParams attrs = activity.getWindow().getAttributes();<NEW_LINE>attrs.flags |= WindowManager.LayoutParams.FLAG_FULLSCREEN;<NEW_LINE>activity.getWindow().setAttributes(attrs);<NEW_LINE>activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);<NEW_LINE>mFullScreenBtn.setBackgroundResource(R.drawable.aurora_preview_recover_screen);<NEW_LINE>mFullScreenBtn.setVisibility(VISIBLE);<NEW_LINE>mChatInputContainer.setVisibility(GONE);<NEW_LINE>mMenuItemContainer.setVisibility(GONE);<NEW_LINE>int height = mHeight;<NEW_LINE>if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {<NEW_LINE>Display display = mWindow.getWindowManager().getDefaultDisplay();<NEW_LINE>DisplayMetrics dm = getResources().getDisplayMetrics();<NEW_LINE>display.getRealMetrics(dm);<NEW_LINE>height = dm.heightPixels;<NEW_LINE>}<NEW_LINE>MarginLayoutParams marginParams1 = new MarginLayoutParams(mCaptureBtn.getLayoutParams());<NEW_LINE>marginParams1.setMargins(marginParams1.leftMargin, marginParams1.topMargin, marginParams1.rightMargin, dp2px(40));<NEW_LINE>FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(marginParams1);<NEW_LINE>params.gravity = Gravity.BOTTOM | Gravity.CENTER;<NEW_LINE>mCaptureBtn.setLayoutParams(params);<NEW_LINE>MarginLayoutParams marginParams2 = new <MASK><NEW_LINE>marginParams2.setMargins(dp2px(20), marginParams2.topMargin, marginParams2.rightMargin, dp2px(48));<NEW_LINE>FrameLayout.LayoutParams params2 = new FrameLayout.LayoutParams(marginParams2);<NEW_LINE>params2.gravity = Gravity.BOTTOM | Gravity.START;<NEW_LINE>mRecordVideoBtn.setLayoutParams(params2);<NEW_LINE>MarginLayoutParams marginParams3 = new MarginLayoutParams(mSwitchCameraBtn.getLayoutParams());<NEW_LINE>marginParams3.setMargins(marginParams3.leftMargin, marginParams3.topMargin, dp2px(20), dp2px(48));<NEW_LINE>FrameLayout.LayoutParams params3 = new FrameLayout.LayoutParams(marginParams3);<NEW_LINE>params3.gravity = Gravity.BOTTOM | Gravity.END;<NEW_LINE>mSwitchCameraBtn.setLayoutParams(params3);<NEW_LINE>// mMenuContainer.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, height));<NEW_LINE>mMenuContainer.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT));<NEW_LINE>mTextureView.setLayoutParams(new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, height));<NEW_LINE>mIsFullScreen = true;<NEW_LINE>}
MarginLayoutParams(mRecordVideoBtn.getLayoutParams());
938,979
protected void validateIcmpTypeAndCode(NetworkACLItemVO networkACLItemVO) {<NEW_LINE><MASK><NEW_LINE>Integer icmpCode = networkACLItemVO.getIcmpCode();<NEW_LINE>if (icmpType == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (icmpType.longValue() != -1 && !NetUtils.validateIcmpType(icmpType.longValue())) {<NEW_LINE>throw new InvalidParameterValueException(String.format("Invalid icmp type [%d]. It should belong to [0-255] range", icmpType));<NEW_LINE>}<NEW_LINE>if (icmpCode != null) {<NEW_LINE>if (icmpCode.longValue() != -1 && !NetUtils.validateIcmpCode(icmpCode.longValue())) {<NEW_LINE>throw new InvalidParameterValueException(String.format("Invalid icmp code [%d]. It should belong to [0-16] range and can be defined when icmpType belongs to [0-40] range", icmpCode));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
Integer icmpType = networkACLItemVO.getIcmpType();
1,424,913
public int[] calculateAspectRatio(int origWidth, int origHeight) {<NEW_LINE>int newWidth = this.targetWidth;<NEW_LINE>int newHeight = this.targetHeight;<NEW_LINE>// If no new width or height were specified return the original bitmap<NEW_LINE>if (newWidth <= 0 && newHeight <= 0) {<NEW_LINE>newWidth = origWidth;<NEW_LINE>newHeight = origHeight;<NEW_LINE>} else // Only the width was specified<NEW_LINE>if (newWidth > 0 && newHeight <= 0) {<NEW_LINE>newHeight = (int) ((double) (newWidth / <MASK><NEW_LINE>} else // only the height was specified<NEW_LINE>if (newWidth <= 0 && newHeight > 0) {<NEW_LINE>newWidth = (int) ((double) (newHeight / (double) origHeight) * origWidth);<NEW_LINE>} else // If the user specified both a positive width and height<NEW_LINE>// (potentially different aspect ratio) then the width or height is<NEW_LINE>// scaled so that the image fits while maintaining aspect ratio.<NEW_LINE>// Alternatively, the specified width and height could have been<NEW_LINE>// kept and Bitmap.SCALE_TO_FIT specified when scaling, but this<NEW_LINE>// would result in whitespace in the new image.<NEW_LINE>{<NEW_LINE>double newRatio = newWidth / (double) newHeight;<NEW_LINE>double origRatio = origWidth / (double) origHeight;<NEW_LINE>if (origRatio > newRatio) {<NEW_LINE>newHeight = (newWidth * origHeight) / origWidth;<NEW_LINE>} else if (origRatio < newRatio) {<NEW_LINE>newWidth = (newHeight * origWidth) / origHeight;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int[] retval = new int[2];<NEW_LINE>retval[0] = newWidth;<NEW_LINE>retval[1] = newHeight;<NEW_LINE>return retval;<NEW_LINE>}
(double) origWidth) * origHeight);
1,559,980
private Image createDelegatePaintedImage(Component c) {<NEW_LINE>double toolkitScale = Toolkit.getDefaultToolkit().getScreenResolution() / 96.0;<NEW_LINE>final int EXTRA_PIXELS = 2;<NEW_LINE>BufferedImage img = new BufferedImage(EXTRA_PIXELS + (int) Math.ceil(delegate.getIconWidth() * toolkitScale), EXTRA_PIXELS + (int) Math.ceil(delegate.getIconHeight() * toolkitScale), BufferedImage.TYPE_INT_ARGB);<NEW_LINE>Graphics2D g = img.createGraphics();<NEW_LINE>try {<NEW_LINE>addScalingRenderingHints(g);<NEW_LINE>g.scale(Math.round(width * toolkitScale) / (double) width, Math.round(height * <MASK><NEW_LINE>delegate.paintIcon(c, g, 0, 0);<NEW_LINE>} finally {<NEW_LINE>g.dispose();<NEW_LINE>}<NEW_LINE>return img;<NEW_LINE>}
toolkitScale) / (double) height);
867,544
private void savePreset() {<NEW_LINE>Thread saveThd = new Thread() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>EcuDataPv vid = (EcuDataPv) VidPvs.get(0);<NEW_LINE>String fileName = vid.get(EcuDataPv.FID_VALUE).toString().trim() + ".prs";<NEW_LINE>// notify about property change<NEW_LINE>firePropertyChange(new PropertyChangeEvent(this, "preset", lastPresetName, fileName));<NEW_LINE>// remember preset<NEW_LINE>lastPresetName = fileName;<NEW_LINE>// 1st VID is used as preset filename<NEW_LINE>File pstFile = new File(fileName);<NEW_LINE>// if file aleady exists, we don't save it<NEW_LINE>if (!pstFile.exists()) {<NEW_LINE>log.info("Save Preset: " + fileName);<NEW_LINE>FileWriter wtr = null;<NEW_LINE>try {<NEW_LINE>wtr = new FileWriter(pstFile);<NEW_LINE>// Loop through all known data grous<NEW_LINE>Iterator<Entry<Integer, Vector<EcuDataItem>>> it = knownGrpItems.entrySet().iterator();<NEW_LINE>while (it.hasNext()) {<NEW_LINE>Entry<Integer, Vector<EcuDataItem>> itmSet = it.next();<NEW_LINE>// write group number<NEW_LINE>wtr.write(String.format("%02X\t", itmSet.getKey()));<NEW_LINE>// loop through all items within data group<NEW_LINE>Vector<EcuDataItem> itms = itmSet.getValue();<NEW_LINE>Iterator<EcuDataItem> itItm = itms.iterator();<NEW_LINE>while (itItm.hasNext()) {<NEW_LINE>EcuDataItem currItm = itItm.next();<NEW_LINE>// write PID of item<NEW_LINE>wtr.write(String.format("%02X\t", currItm.pid));<NEW_LINE>}<NEW_LINE>// finish data group entry<NEW_LINE>wtr.write("\n");<NEW_LINE>}<NEW_LINE>log.info("Preset saved: " + fileName);<NEW_LINE>} catch (IOException ex) {<NEW_LINE>log.severe("SavePreset: " + ex.toString());<NEW_LINE>} finally {<NEW_LINE>try {<NEW_LINE>wtr.close();<NEW_LINE>} catch (IOException ex) {<NEW_LINE>log.severe("SavePreset: " + ex.toString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>// MIN priority to NOT disturb communication<NEW_LINE>saveThd.setPriority(Thread.MIN_PRIORITY);<NEW_LINE>saveThd.start();<NEW_LINE>}
log.info("Preset saving skipped: " + fileName);
1,424,267
public void createBackup() {<NEW_LINE>boolean backupEnabled = configProvider.getBaseConfig().getMain().getBackupEveryXDays().isPresent();<NEW_LINE>if (!backupEnabled) {<NEW_LINE>logger.debug("Automatic backup is disabled");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int backupEveryXDays = configProvider.getBaseConfig().getMain().getBackupEveryXDays().get();<NEW_LINE>Optional<LocalDateTime> firstStartOptional = genericStorage.get("FirstStart", LocalDateTime.class);<NEW_LINE>if (!firstStartOptional.isPresent()) {<NEW_LINE>logger.debug("First start date time not set (for some reason), aborting backup");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>long daysSinceFirstStart = ChronoUnit.DAYS.between(firstStartOptional.get(), LocalDateTime.now(clock));<NEW_LINE>if (daysSinceFirstStart < backupEveryXDays) {<NEW_LINE>logger.<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Optional<BackupData> backupData = genericStorage.get(KEY, BackupData.class);<NEW_LINE>if (!backupData.isPresent()) {<NEW_LINE>logger.debug("Executing first backup: {} days since first start and backup is to be executed every {} days", daysSinceFirstStart, backupEveryXDays);<NEW_LINE>executeBackup();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>long daysSinceLastBackup = ChronoUnit.DAYS.between(backupData.get().getLastBackup(), LocalDateTime.now(clock));<NEW_LINE>if (daysSinceLastBackup >= backupEveryXDays) {<NEW_LINE>logger.debug("Executing backup: {} days since last backup and backup is to be executed every {} days", daysSinceLastBackup, backupEveryXDays);<NEW_LINE>executeBackup();<NEW_LINE>}<NEW_LINE>}
debug("{} days since first start but backup is to be executed every {} days", daysSinceFirstStart, backupEveryXDays);
1,748,659
public void decode(MBlock mBlock, Picture mb) {<NEW_LINE>int mbX = mapper.getMbX(mBlock.mbIdx);<NEW_LINE>int mbY = mapper.getMbY(mBlock.mbIdx);<NEW_LINE>int address = mapper.getAddress(mBlock.mbIdx);<NEW_LINE>boolean leftAvailable = mapper.leftAvailable(mBlock.mbIdx);<NEW_LINE>boolean topAvailable = mapper.topAvailable(mBlock.mbIdx);<NEW_LINE>s.qp = (s.qp + mBlock.mbQPDelta + 52) % 52;<NEW_LINE>di.mbQps[0<MASK><NEW_LINE>residualLumaI16x16(mBlock, leftAvailable, topAvailable, mbX, mbY);<NEW_LINE>Intra16x16PredictionBuilder.predictWithMode(mBlock.luma16x16Mode, mBlock.ac[0], leftAvailable, topAvailable, s.leftRow[0], s.topLine[0], s.topLeft[0], mbX << 4, mb.getPlaneData(0));<NEW_LINE>decodeChroma(mBlock, mbX, mbY, leftAvailable, topAvailable, mb, s.qp);<NEW_LINE>di.mbTypes[address] = mBlock.curMbType;<NEW_LINE>collectPredictors(s, mb, mbX);<NEW_LINE>saveMvsIntra(di, mbX, mbY);<NEW_LINE>saveVectIntra(s, mapper.getMbX(mBlock.mbIdx));<NEW_LINE>}
][address] = s.qp;
268,809
public void run() {<NEW_LINE>Dispatcher dispatch = Dispatcher.instance();<NEW_LINE>try {<NEW_LINE>SIPStreamConectionAdapter connection = m_connection;<NEW_LINE>Socket socket = connection.m_socket;<NEW_LINE>final int packetSize = socket.getReceiveBufferSize();<NEW_LINE>final String peerHost = connection.getRemoteHost();<NEW_LINE>final int peerPort = connection.getRemotePort();<NEW_LINE>byte[<MASK><NEW_LINE>while (connection.isConnected()) {<NEW_LINE>// wait for incoming data<NEW_LINE>int nBytes = m_networkInputStream.read(buf, 0, packetSize);<NEW_LINE>if (nBytes == -1) {<NEW_LINE>throw new IOException("Socket broken" + this);<NEW_LINE>}<NEW_LINE>// copy network bytes to a buffer that is safely<NEW_LINE>// passed to the parser thread<NEW_LINE>SipMessageByteBuffer byteBuffer = SipMessageByteBuffer.fromNetwork(buf, nBytes, peerHost, peerPort);<NEW_LINE>dispatch.queueIncomingDataEvent(byteBuffer, connection);<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>// Assaf: print the damn exceptions!<NEW_LINE>// dont just dump it - I got 2 question about the stack throwing exception<NEW_LINE>// but yes<NEW_LINE>// print the message<NEW_LINE>if (c_logger.isTraceDebugEnabled()) {<NEW_LINE>c_logger.traceDebug(this, "run", "Connection closed" + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>m_connection.connectionError(e);<NEW_LINE>}<NEW_LINE>}
] buf = new byte[packetSize];
378,942
static DatePickerDialog createDialog(Bundle args, Context activityContext, @Nullable OnDateSetListener onDateSetListener) {<NEW_LINE>final Calendar c = Calendar.getInstance();<NEW_LINE>DatePickerDialog dialog = getDialog(args, activityContext, onDateSetListener);<NEW_LINE>if (args != null && args.containsKey(RNConstants.ARG_NEUTRAL_BUTTON_LABEL)) {<NEW_LINE>dialog.setButton(DialogInterface.BUTTON_NEUTRAL, args.getString(RNConstants.ARG_NEUTRAL_BUTTON_LABEL), mOnNeutralButtonActionListener);<NEW_LINE>}<NEW_LINE>final DatePicker datePicker = dialog.getDatePicker();<NEW_LINE>Integer timeZoneOffsetInMilliseconds = getTimeZoneOffset(args);<NEW_LINE>if (timeZoneOffsetInMilliseconds != null) {<NEW_LINE>c.setTimeZone(TimeZone.getTimeZone("GMT"));<NEW_LINE>}<NEW_LINE>if (args != null && args.containsKey(RNConstants.ARG_MINDATE)) {<NEW_LINE>// Set minDate to the beginning of the day. We need this because of clowniness in datepicker<NEW_LINE>// that causes it to throw an exception if minDate is greater than the internal timestamp<NEW_LINE>// that it generates from the y/m/d passed in the constructor.<NEW_LINE>c.setTimeInMillis(args.getLong(RNConstants.ARG_MINDATE));<NEW_LINE>c.set(Calendar.HOUR_OF_DAY, 0);<NEW_LINE>c.set(Calendar.MINUTE, 0);<NEW_LINE>c.set(Calendar.SECOND, 0);<NEW_LINE>c.set(Calendar.MILLISECOND, 0);<NEW_LINE>datePicker.setMinDate(c.getTimeInMillis() - getOffset(c, timeZoneOffsetInMilliseconds));<NEW_LINE>} else {<NEW_LINE>// This is to work around a bug in DatePickerDialog where it doesn't display a title showing<NEW_LINE>// the date under certain conditions.<NEW_LINE>datePicker.setMinDate(RNConstants.DEFAULT_MIN_DATE);<NEW_LINE>}<NEW_LINE>if (args != null && args.containsKey(RNConstants.ARG_MAXDATE)) {<NEW_LINE>// Set maxDate to the end of the day, same reason as for minDate.<NEW_LINE>c.setTimeInMillis(args.getLong(RNConstants.ARG_MAXDATE));<NEW_LINE>c.set(Calendar.HOUR_OF_DAY, 23);<NEW_LINE>c.set(Calendar.MINUTE, 59);<NEW_LINE>c.set(Calendar.SECOND, 59);<NEW_LINE>c.<MASK><NEW_LINE>datePicker.setMaxDate(c.getTimeInMillis() - getOffset(c, timeZoneOffsetInMilliseconds));<NEW_LINE>}<NEW_LINE>return dialog;<NEW_LINE>}
set(Calendar.MILLISECOND, 999);
733,350
public StreamPendingSummary build(Object data) {<NEW_LINE>if (null == data) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>List<Object> objectList = (List<Object>) data;<NEW_LINE>long total = BuilderFactory.LONG.build(objectList.get(0));<NEW_LINE>String minId = SafeEncoder.encode((byte[]) objectList.get(1));<NEW_LINE>String maxId = SafeEncoder.encode((byte[]) objectList.get(2));<NEW_LINE>List<List<Object>> consumerObjList = (List<List<Object><MASK><NEW_LINE>Map<String, Long> map = new HashMap<>(consumerObjList.size());<NEW_LINE>for (List<Object> consumerObj : consumerObjList) {<NEW_LINE>map.put(SafeEncoder.encode((byte[]) consumerObj.get(0)), Long.parseLong(SafeEncoder.encode((byte[]) consumerObj.get(1))));<NEW_LINE>}<NEW_LINE>return new StreamPendingSummary(total, new StreamEntryID(minId), new StreamEntryID(maxId), map);<NEW_LINE>}
>) objectList.get(3);
614,308
final DescribeChannelResult executeDescribeChannel(DescribeChannelRequest describeChannelRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeChannelRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeChannelRequest> request = null;<NEW_LINE>Response<DescribeChannelResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeChannelRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeChannelRequest));<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, "IoTAnalytics");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeChannel");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeChannelResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeChannelResultJsonUnmarshaller());<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);