text:
// Copyright © John Gietzen. All Rights Reserved. This source is subject to the MIT license. Please see license.md for more information.

namespace Intervals
{
    using System;
    using System.Collections.Generic;
    using System.Diagnostics.CodeAnalysis;
    using System.Linq;

    /// <summary>
    /// Provides methods for working with object implementing <see cref="IInterval{T}"/>.
    /// </summary>
    public static class IntervalExtensions
    {
        /// <summary>
        /// Tests an interval to see if it contains a given value.
        /// </summary>
        /// <typeparam name="T">The type of values included in the interval.</typeparam>
        /// <param name="interval">The interval to test.</param>
        /// <param name="value">The value to test.</param>
        /// <returns>true, if the interval is non-empty and contains the value; false, otherwise.</returns>
        [SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Justification = "Covered by tests.")]
        public static bool Contains<T>(this IInterval<T> interval, T value)
            where T : IComparable<T>
        {
            if (interval.IsEmpty())
            {
                return false;
            }

            var start = interval.Start.CompareTo(value);
            var end = interval.End.CompareTo(value);

            if ((interval.StartInclusive && start == 0) ||
                (interval.EndInclusive && end == 0))
            {
                return true;
            }

            if (start >= 0 ||
                end <= 0)
            {
                return false;
            }

            return true;
        }

        /// <summary>
        /// Tests an interval to see if it wholly contains another interval.
        /// </summary>
        /// <typeparam name="T">The type of values included in the intervals.</typeparam>
        /// <param name="interval">The interval to test.</param>
        /// <param name="other">The other interval.</param>
        /// <returns>true, if <paramref name="interval"/> contains <paramref name="other"/>; false, otherwise.</returns>
        /// <remarks>
        /// All intervals (including empty ones) contain every other empty interval.  So, if <paramref name="other"/> is empty, this method always returns true.
        /// Otherwise, this method only returns true if the start and end values of <paramref name="interval"/> surround the values of <paramref name="other"/>.
        /// </remarks>
        public static bool Contains<T>(this IInterval<T> interval, IInterval<T> other)
            where T : IComparable<T>
        {
            if (other.IsEmpty())
            {
                return true;
            }

            var intersection = other.IntersectWith(interval);

            return !intersection.IsEmpty() &&
                    intersection == other;
        }

        /// <summary>
        /// Tests a set of intervals to see if they contain a value.
        /// </summary>
        /// <typeparam name="T">The type of values included in the intervals.</typeparam>
        /// <param name="set">The set to test.</param>
        /// <param name="value">The value to test.</param>
        /// <returns>true, if the set is non-empty and at least on of its intervals contains the value; false, otherwise.</returns>
        public static bool Contains<T>(this IEnumerable<IInterval<T>> set, T value)
            where T : IComparable<T>
        {
            // TODO: Add tests to make sure that this method doesn't enumerate set more than once.
            if (set == null)
            {
                return false;
            }

            foreach (var interval in set)
            {
                if (interval.Contains(value))
                {
                    return true;
                }
            }

            return false;
        }

        /// <summary>
        /// Returns the difference of one interval to another.
        /// </summary>
        /// <typeparam name="T">The type of values included in the intervals.</typeparam>
        /// <param name="interval">The source interval.</param>
        /// <param name="other">The interval to exclude.</param>
        /// <returns>A set that contains every part of <paramref name="interval"/> that is not also contained by <paramref name="other"/>.</returns>
        [SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Justification = "Covered by tests.")]
        public static IList<IInterval<T>> DifferenceWith<T>(this IInterval<T> interval, IInterval<T> other)
            where T : IComparable<T>
        {
            if (interval.IsEmpty())
            {
                return null;
            }

            var intersection = interval.IntersectWith(other);

            if (intersection.IsEmpty())
            {
                return new[] { interval };
            }
            else if (intersection == interval)
            {
                return null;
            }

            var intervals = new List<IInterval<T>>();

            var startToStart = interval.Start.CompareTo(intersection.Start);

            if (startToStart != 0 ||
                (interval.StartInclusive && !intersection.StartInclusive))
            {
                intervals.Add(interval.Clone(
                        interval.Start,
                        interval.StartInclusive,
                        intersection.Start,
                        !intersection.StartInclusive));
            }

            var endToEnd = interval.End.CompareTo(intersection.End);

            if (endToEnd != 0 ||
                (interval.EndInclusive && !intersection.EndInclusive))
            {
                intervals.Add(interval.Clone(
                        intersection.End,
                        !intersection.EndInclusive,
                        interval.End,
                        interval.EndInclusive));
            }

            return intervals;
        }

        /// <summary>
        /// Returns the difference between a set and an interval.
        /// </summary>
        /// <typeparam name="T">The type of values included in the intervals.</typeparam>
        /// <param name="set">The source set.</param>
        /// <param name="interval">The interval to exclude.</param>
        /// <returns>A set that contains every part of <paramref name="set"/> that is not also contained by <paramref name="interval"/>.</returns>
        public static IList<IInterval<T>> DifferenceWith<T>(this IEnumerable<IInterval<T>> set, IInterval<T> interval)
            where T : IComparable<T>
        {
            // TODO: Add tests to make sure that this method doesn't enumerate set more than once.
            return set.DifferenceWith(new[] { interval });
        }

        /// <summary>
        /// Returns the difference between an interval and a set.
        /// </summary>
        /// <typeparam name="T">The type of values included in the intervals.</typeparam>
        /// <param name="interval">The source interval.</param>
        /// <param name="set">The set to exclude.</param>
        /// <returns>A set that contains every part of <paramref name="interval"/> that is not also contained by <paramref name="set"/>.</returns>
        public static IList<IInterval<T>> DifferenceWith<T>(this IInterval<T> interval, IEnumerable<IInterval<T>> set)
            where T : IComparable<T>
        {
            // TODO: Add tests to make sure that this method doesn't enumerate set more than once.
            return set.DifferenceWith(new[] { interval });
        }

        /// <summary>
        /// Returns the difference between two sets.
        /// </summary>
        /// <typeparam name="T">The type of values included in the intervals.</typeparam>
        /// <param name="setA">The source set.</param>
        /// <param name="setB">The set to exclude.</param>
        /// <returns>A set that contains every part of <paramref name="setA"/> that is not also contained by <paramref name="setB"/>.</returns>
        [SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "1", Justification = "Covered by tests.")]
        public static IList<IInterval<T>> DifferenceWith<T>(this IEnumerable<IInterval<T>> setA, IEnumerable<IInterval<T>> setB)
            where T : IComparable<T>
        {
            // TODO: Add tests to make sure that this method doesn't enumerate setA or setB more than once.
            if (setA.IsEmpty())
            {
                return null;
            }
            else if (setB.IsEmpty())
            {
                return setA.ToList();
            }

            List<IInterval<T>> results = null;

            foreach (var intervalB in setB)
            {
                results = new List<IInterval<T>>();

                foreach (var intervalA in setA)
                {
                    var diff = intervalA.DifferenceWith(intervalB);
                    if (diff != null)
                    {
                        results.AddRange(diff);
                    }
                }

                if (results.Count == 0)
                {
                    return null;
                }

                setA = results;
            }

            return results;
        }

        /// <summary>
        /// Returns the intersection of two intervals.
        /// </summary>
        /// <typeparam name="T">The type of values included in the intervals.</typeparam>
        /// <param name="interval">The first interval.</param>
        /// <param name="other">The second interval.</param>
        /// <returns>An interval that represents the intersection of the intervals.</returns>
        [SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Justification = "Covered by tests.")]
        [SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "1", Justification = "Covered by tests.")]
        public static IInterval<T> IntersectWith<T>(this IInterval<T> interval, IInterval<T> other)
            where T : IComparable<T>
        {
            if (interval.IsEmpty() ||
                other.IsEmpty())
            {
                return null;
            }

            T start, end;
            bool startInclusive, endInclusive;

            bool startMatchesInterval = false,
                 startMatchesOther = false,
                 endMatchesInterval = false,
                 endMatchesOther = false;

            var startToStart = interval.Start.CompareTo(other.Start);
            if (startToStart > 0)
            {
                start = interval.Start;
                startInclusive = interval.StartInclusive;
                startMatchesInterval = true;
            }
            else if (startToStart < 0)
            {
                start = other.Start;
                startInclusive = other.StartInclusive;
                startMatchesOther = true;
            }
            else
            {
                start = interval.Start;
                startInclusive = interval.StartInclusive && other.StartInclusive;
                startMatchesInterval = startInclusive == interval.StartInclusive;
                startMatchesOther = startInclusive == other.StartInclusive;
            }

            var endToEnd = interval.End.CompareTo(other.End);
            if (endToEnd < 0)
            {
                end = interval.End;
                endInclusive = interval.EndInclusive;
                endMatchesInterval = true;
            }
            else if (endToEnd > 0)
            {
                end = other.End;
                endInclusive = other.EndInclusive;
                endMatchesOther = true;
            }
            else
            {
                end = interval.End;
                endInclusive = interval.EndInclusive && other.EndInclusive;
                endMatchesInterval = endInclusive == interval.EndInclusive;
                endMatchesOther = endInclusive == other.EndInclusive;
            }

            var startToEnd = start.CompareTo(end);
            if (startToEnd > 0)
            {
                return null;
            }
            else if (startToEnd == 0 && (!startInclusive || !endInclusive))
            {
                return null;
            }

            if (startMatchesInterval && endMatchesInterval)
            {
                return interval;
            }
            else if (startMatchesOther && endMatchesOther)
            {
                return other;
            }

            return interval.Clone(
                start,
                startInclusive,
                end,
                endInclusive);
        }

        /// <summary>
        /// Tests an interval to determine if it is empty.
        /// </summary>
        /// <typeparam name="T">The type of values included in the interval.</typeparam>
        /// <param name="interval">The interval to test.</param>
        /// <returns>true, if the interval is null or considered empty; false, otherwise.</returns>
        /// <remarks>
        /// If an interval has the same start and end values, but either the start or end value is not inclusive, the interval is empty.
        /// An interval is also considered empty if its start value is greater than its end value.
        /// </remarks>
        public static bool IsEmpty<T>(this IInterval<T> interval)
            where T : IComparable<T>
        {
            if (interval == null)
            {
                return true;
            }

            var startToEnd = interval.Start.CompareTo(interval.End);
            if (startToEnd > 0)
            {
                return true;
            }
            else if (startToEnd == 0 && (!interval.StartInclusive || !interval.EndInclusive))
            {
                return true;
            }
            else
            {
                return false;
            }
        }

        /// <summary>
        /// Tests a set of intervals to see if it is empty.
        /// </summary>
        /// <typeparam name="T">The type of values included in the intervals.</typeparam>
        /// <param name="set">The set of intervals to test.</param>
        /// <returns>true, if the set is null or considered empty; false, otherwise.</returns>
        /// <remarks>
        /// See <see cref="IsEmpty{T}(IInterval{T})"/> for remarks.
        /// </remarks>
        public static bool IsEmpty<T>(this IEnumerable<IInterval<T>> set)
            where T : IComparable<T>
        {
            // TODO: Add tests to make sure that this method doesn't enumerate set more than once.
            if (set == null)
            {
                return true;
            }

            foreach (var interval in set)
            {
                if (!interval.IsEmpty())
                {
                    return false;
                }
            }

            return true;
        }

        /// <summary>
        /// Returns a simplified version of a given set.
        /// </summary>
        /// <typeparam name="T">The type of values included in the intervals.</typeparam>
        /// <param name="set">The set to simplify.</param>
        /// <returns>The simplified set.</returns>
        /// <remarks>
        /// Sets can be simplified if any of their components intersect.
        /// </remarks>
        public static IList<IInterval<T>> Simplify<T>(this IEnumerable<IInterval<T>> set)
            where T : IComparable<T>
        {
            // TODO: Add tests to make sure that this method doesn't enumerate set more than once.
            var list = (from r in set
                        where !r.IsEmpty()
                        orderby r.Start descending
                        select r).ToList();

            if (list.Count == 0)
            {
                return null;
            }

            Func<IInterval<T>> dequeue = () =>
            {
                var a = list[list.Count - 1];
                list.RemoveAt(list.Count - 1);
                return a;
            };

            var results = new Stack<IInterval<T>>();
            results.Push(dequeue());

            while (list.Count > 0)
            {
                var intervalA = results.Pop();
                var intervalB = dequeue();

                foreach (var result in intervalA.UnionWith(intervalB))
                {
                    results.Push(result);
                }
            }

            return results.ToArray();
        }

        /// <summary>
        /// Returns the union of two intervals.
        /// </summary>
        /// <typeparam name="T">The type of values included in the intervals.</typeparam>
        /// <param name="interval">The first interval.</param>
        /// <param name="other">The second interval.</param>
        /// <returns>A set that contains both intervals.</returns>
        /// <remarks>
        /// If the intervals intersect, the result will be a set with a single interval.
        /// </remarks>
        [SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Justification = "Covered by tests.")]
        [SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "1", Justification = "Covered by tests.")]
        public static IList<IInterval<T>> UnionWith<T>(this IInterval<T> interval, IInterval<T> other)
            where T : IComparable<T>
        {
            var intervalEmpty = interval.IsEmpty();
            var otherEmpty = other.IsEmpty();

            if (intervalEmpty && otherEmpty)
            {
                return null;
            }
            else if (intervalEmpty)
            {
                return new[] { other };
            }
            else if (otherEmpty)
            {
                return new[] { interval };
            }

            int startToStart, endToEnd, startToEnd;
            T start, end;
            bool startInclusive, endInclusive;

            startToStart = interval.Start.CompareTo(other.Start);
            if (startToStart > 0)
            {
                start = interval.Start;
                startInclusive = interval.StartInclusive;
            }
            else if (startToStart < 0)
            {
                start = other.Start;
                startInclusive = other.StartInclusive;
            }
            else
            {
                start = interval.Start;
                startInclusive = interval.StartInclusive && other.StartInclusive;
            }

            endToEnd = interval.End.CompareTo(other.End);
            if (endToEnd < 0)
            {
                end = interval.End;
                endInclusive = interval.EndInclusive;
            }
            else if (endToEnd > 0)
            {
                end = other.End;
                endInclusive = other.EndInclusive;
            }
            else
            {
                end = interval.End;
                endInclusive = interval.EndInclusive && other.EndInclusive;
            }

            startToEnd = start.CompareTo(end);
            if (startToEnd > 0)
            {
                return new[] { interval, other };
            }
            else if (startToEnd == 0 && !(startInclusive || endInclusive))
            {
                return new[] { interval, other };
            }

            bool startMatchesInterval = false,
                 startMatchesOther = false,
                 endMatchesInterval = false,
                 endMatchesOther = false;

            if (startToStart < 0)
            {
                start = interval.Start;
                startInclusive = interval.StartInclusive;
                startMatchesInterval = true;
            }
            else if (startToStart > 0)
            {
                start = other.Start;
                startInclusive = other.StartInclusive;
                startMatchesOther = true;
            }
            else
            {
                start = interval.Start;
                startInclusive = interval.StartInclusive || other.StartInclusive;
                startMatchesInterval = startInclusive == interval.StartInclusive;
                startMatchesOther = startInclusive == other.StartInclusive;
            }

            if (endToEnd > 0)
            {
                end = interval.End;
                endInclusive = interval.EndInclusive;
                endMatchesInterval = true;
            }
            else if (endToEnd < 0)
            {
                end = other.End;
                endInclusive = other.EndInclusive;
                endMatchesOther = true;
            }
            else
            {
                end = interval.End;
                endInclusive = interval.EndInclusive || other.EndInclusive;
                endMatchesInterval = endInclusive == interval.EndInclusive;
                endMatchesOther = endInclusive == other.EndInclusive;
            }

            if (startMatchesInterval && endMatchesInterval)
            {
                return new[] { interval };
            }
            else if (startMatchesOther && endMatchesOther)
            {
                return new[] { other };
            }

            return new[]
            {
                interval.Clone(
                    start,
                    startInclusive,
                    end,
                    endInclusive)
            };
        }

        /// <summary>
        /// Returns the union of a set and an interval.
        /// </summary>
        /// <typeparam name="T">The type of values included in the intervals.</typeparam>
        /// <param name="set">The set.</param>
        /// <param name="interval">The interval.</param>
        /// <returns>A set containing the union of the set and interval.</returns>
        public static IList<IInterval<T>> UnionWith<T>(this IEnumerable<IInterval<T>> set, IInterval<T> interval)
            where T : IComparable<T>
        {
            // TODO: Add tests to make sure that this method doesn't enumerate set more than once.
            return set.UnionWith(new[] { interval });
        }

        /// <summary>
        /// Returns the union of an interval and a set.
        /// </summary>
        /// <typeparam name="T">The type of values included in the intervals.</typeparam>
        /// <param name="interval">The interval.</param>
        /// <param name="set">The set.</param>
        /// <returns>A set containing the union of the interval and the set.</returns>
        public static IList<IInterval<T>> UnionWith<T>(this IInterval<T> interval, IEnumerable<IInterval<T>> set)
            where T : IComparable<T>
        {
            // TODO: Add tests to make sure that this method doesn't enumerate set more than once.
            return set.UnionWith(new[] { interval });
        }

        /// <summary>
        /// Returns the union of two sets.
        /// </summary>
        /// <typeparam name="T">The type of values included in the intervals.</typeparam>
        /// <param name="setA">The first set.</param>
        /// <param name="setB">The second set.</param>
        /// <returns>A set that contains both sets.</returns>
        public static IList<IInterval<T>> UnionWith<T>(this IEnumerable<IInterval<T>> setA, IEnumerable<IInterval<T>> setB)
            where T : IComparable<T>
        {
            // TODO: Add tests to make sure that this method doesn't enumerate setA or setB more than once.
            setA = setA ?? new IInterval<T>[0];
            setB = setB ?? new IInterval<T>[0];

            return setA.Concat(setB).Simplify();
        }
    }
}


text:
layout: post
title:  "SFPC: Day 63 - Showcase, Day Two"
date:   2016-12-11 20:00:00 -0400
categories: showcase
---

Today was the second day of our final showcase.

-----

Today

The first part of the day, told in photos.

*In the morning, at Beny's Delicatessen.*

![Sick of the C](/images/IMG_6869.JPG)

*Lil' church Sunday School trailer in Bed Stuy.*

![Sunday Schoo Trailer](/images/IMG_6873.JPG)

![Sunday Schoo Trailer](/images/IMG_6875.JPG)

![Sunday Schoo Trailer](/images/IMG_6878.JPG)

*View from my train station, 9th St.-Smith Ave., of Gowanus Canal.*

![Gowanus Canal](/images/IMG_6882.JPG)

*Pano of G train.*

![Gowanus Canal](/images/IMG_6889.JPG)

![Gowanus Canal](/images/IMG_6888.JPG)

And for the second part of the day, here's a list.

- Came into SFPC at 2p.
- Talked to some people. My friend Jo showed up. Good to see her.

![Showcase](/images/AlexJoDeepDream.png)

It started snowing after she left at 4pm.

- A couple more photos from Showcase: Day Two.

![Showcase](/images/IMG_6892.JPG)

![Showcase](/images/IMG_6894.JPG)

- I started to get tired and left SFPC around 7p.

*In Brooklyn, on the walk home.*

![Gowanus Canal](/images/IMG_6896.JPG)

- Got home. Bryan came over from Bushwick and we had some beers. We got some food at Peaches Hothouse, a southern-style restaurant on Tompkins. It took an hour to get our food, but hey, that's New York sometimes. The food did taste good.
- Later, at the house, Bryan, Dannie, and I talked and kvetched about our experiences at SFPC. We all agreed the scheduling could've been a *lot* better, and that we would've liked it if Taeyoon and Lauren were more present during the 10 weeks.

We have a feedback session on Friday before our potluck. I don't know how outspoken I'll be at that. I find it a lot easier to express my thoughts here.

Criticisms

To be honest, I have a lot of my own criticisms about the school. I think I will feel more fond about the experience with time.

Despite that, I do love the school, but not because it delivered the experience or experiences I was expecting. I love the school, in my way, because it was sort of a sorcerer's stone that transmuted energy and curiosity into new ideas, friendships, and transformative experiences(albeit haphazardly and painfully so, but I must be careful not to conflate my experience of the school with my experience of New York - I do find it nearly impossible to separate the two).

I feel a lot more like myself than I did when I got here. SFPC wasn't everything I needed but it was a lot of what I needed for the short period of 10 weeks.

And if I hadn't said this before, I'm glad it's pretty much over. I am exhausted. I've taken on a lot in my time at the school.

On some level, I do understand how hard it is to run an alternative art school. It takes a lot of administrative work and physical labor, a lot of leadership and consensus with the other people involved in the school. I'm sure operating an experimental school takes A LOT of energy, emotional and otherwise.

I'm tired. I've been tired, and tired at school, for the past 2-3 weeks. However, I probably shouldn't put that all on the school.

I hope I'm being fair.

-----

**For Breakfast:**

Maybe a cigarette and some green tea?

**For Lunch:**

Ruby gave me some of her curry soup from Green Apron. She is an angel. I was starving.

**For Dinner:**

Fried green tomatoes bacon cheeseburger at Peaches Hothouse. It took an hour to get our food. Food was tasty but do not recommend.

redpajama_set_name: RedPajamaGithub


text:
Annoucement: There's a new OneDrive SDK
================

The Live SDK has been replaced by the [OneDrive API](https://dev.onedrive.com) and
[OneDrive SDK for C#](https://github.com/OneDrive/onedrive-sdk-csharp). All new projects
should use the OneDrive API to integrate with OneDrive instead of Live SDK.

This Live SDK project will remain available for existing applications to continue to use
but new application development should be done using the OneDrive SDK.

LiveSDK for Windows and Windows Phone (legacy)
================
version 5.6

1. Introduction
---------------

The Live SDK for Windows and Windows Phone library is intended to help developers to easily
integrate OneDrive and Outlook.com contacts into their Windows Runtime apps (HTML and XAML).

The Live SDK enables access to users' identity profile info and allows your apps to:
* Upload and download photos, videos, documents, and other files in OneDrive
* Personalize your users' experience
* Take advantage of single sign-on using Microsoft Account in Windows 8.1 and Windows Phone 8.1
* Create, read, and update contacts, calendars, and events in Outlook.com

2. Reference the SDK
--------------------
* Install the Live SDK from the [download site](http://www.microsoft.com/en-us/download/details.aspx?id=42552)
* Open your app's project in Visual Studio
* In Solution Explorer, right-click References > Add Reference
* For Windows Runtime HTML apps: Click Windows > Extension SDKs and select both Live SDK and Windows Library for JavaScript 2.1. Further details available [here](http://msdn.microsoft.com/en-us/library/dn631820.aspx)
* For Windows Runtime XAML apps: Click Windows 8.1 or Windows Phone 8.1 > Extensions and select Live SDK. Further details available [here](http://msdn.microsoft.com/en-us/library/dn631823.aspx)

To use the SDK in a Windows Store app with single sign-in (the default), you need to register the application with the Windows Store. Failing to register the app will generate a runtime exception when logging in with the SDK. For more information about how to register with the Windows Store, click [here](http://msdn.microsoft.com/en-US/library/dn631823.aspx#associate_your_app_with_the_store)

3. Documentation
----------------

Visit: http://dev.onedrive.com.

4. Sample code
-----------------
[Windows Store App Samples](https://github.com/liveservices/LiveSDK-for-Windows/tree/master/src/WinStore)
* Includes samples for HTML and XAML apps for Windows and Windows Phone

[Desktop Samples](https://github.com/liveservices/LiveSDK-for-Windows/tree/master/src/Desktop)
* API Explorer: Authenticates user and uploads and downloads files

[Web Samples](https://github.com/liveservices/LiveSDK-for-Windows/tree/master/src/Web)
* 3 samples that demonstrate authentication and OAuth with ASP.Net or PHP

[Windows Phone 8 Samples](https://github.com/liveservices/LiveSDK-for-Windows/tree/master/src/WP8)
* 5 samples that demonstrate authentication and core concepts (upload, download, etc)


text:
package org.hawkular.inventory.api;

import org.jboss.logging.BasicLogger;
import org.jboss.logging.LogMessage;
import org.jboss.logging.Logger;
import org.jboss.logging.MessageLogger;
import org.jboss.logging.annotations.Cause;
import org.jboss.logging.annotations.Message;
import org.jboss.logging.annotations.ValidIdRange;

/**
 * @author Lukas Krejci
 * @since 0.1.0
 */
@MessageLogger(projectCode = "HAWKINV")
@ValidIdRange(min = 1, max = 999)
public interface Log extends BasicLogger {
    Log LOGGER = Logger.getMessageLogger(Log.class, "org.hawkular.inventory.api");

    @LogMessage(level = Logger.Level.WARN)
    @Message(id = 1, value = "Error while sending inventory event.")
    void wErrorSendingEvent(@Cause Throwable cause);
}


text:
package com.mogujie.tt.imlib.network;

import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.channel.ChannelHandlerContext;
import org.jboss.netty.channel.ChannelStateEvent;
import org.jboss.netty.channel.MessageEvent;

import com.mogujie.tt.imlib.IMLoginManager;
import com.mogujie.tt.imlib.IMPacketDispatcher;

public class MsgServerHandler extends BaseServerHandler {

	@Override
	public void channelConnected(ChannelHandlerContext ctx, ChannelStateEvent e)
			throws Exception {
		// TODO Auto-generated method stub
		super.channelConnected(ctx, e);

		IMLoginManager.instance().onMsgServerConnected();
	}

	@Override
	public void channelDisconnected(ChannelHandlerContext ctx,
			ChannelStateEvent e) throws Exception {
		// TODO Auto-generated method stub
		super.channelDisconnected(ctx, e);

		IMLoginManager.instance().onMsgServerDisconnected();
	}

	@Override
	public void messageReceived(ChannelHandlerContext ctx, MessageEvent e)
			throws Exception {
		// TODO Auto-generated method stub
		super.messageReceived(ctx, e);

		IMPacketDispatcher.dispatch((ChannelBuffer) e.getMessage());
	}

	@Override
	protected void channelUnconnected() {
		// TODO Auto-generated method stub

		IMLoginManager.instance().onMessageServerUnconnected();

	}

}


text:
using pw::string::HexDigitCount;
using pw::string::IntToHexString;

namespace pw::dump {
namespace {

constexpr const std::string_view kAddressSeparator(": ");
constexpr const std::string_view kSectionSeparator("  ");
constexpr const std::string_view kAddressHeader("Address");
constexpr const std::string_view kOffsetHeader("Offs.");
constexpr const std::string_view kAsciiHeader("Text");

// Minimum number of hex characters to use when displaying dump offset.
constexpr const size_t kMinOffsetChars = 4;

char PrintableChar(std::byte b) {
  if (std::isprint(std::to_integer<char>(b)) == 0) {
    return '.';
  }
  return std::to_integer<char>(b);
}

void AddGroupingByte(size_t byte_index,
                     FormattedHexDumper::Flags& flags,
                     StringBuilder& builder) {
  // Never add grouping when it is disabled.
  if (flags.group_every == 0) {
    return;
  }
  // If this byte isn't at the end of a group, don't add a space.
  if ((byte_index + 1) % flags.group_every != 0) {
    return;
  }
  // If this byte is the last byte in a line, don't add a grouping byte
  // (prevents trailing spaces).
  if (byte_index + 1 == flags.bytes_per_line) {
    return;
  }

  builder << ' ';
}

}  // namespace

Status DumpAddr(span<char> dest, uintptr_t addr) {
  if (dest.data() == nullptr) {
    return Status::InvalidArgument();
  }
  // Include null terminator.
  if (dest.size() < kHexAddrStringSize + 1) {
    return Status::ResourceExhausted();
  }
  dest[0] = '0';
  dest[1] = 'x';

  return IntToHexString(addr, dest.subspan(2), sizeof(uintptr_t) * 2).status();
}

Status FormattedHexDumper::PrintFormatHeader() {
  StringBuilder builder(dest_);

  if (flags.prefix_mode != AddressMode::kDisabled) {
    std::string_view header(flags.prefix_mode == AddressMode::kOffset
                                ? kOffsetHeader
                                : kAddressHeader);
    // Pad to align to address width.
    size_t padding = 0;
    if (flags.prefix_mode == AddressMode::kOffset) {
      size_t offs_width =
          HexDigitCount(source_data_.size_bytes() + current_offset_);
      padding = std::max(offs_width, kMinOffsetChars);
    } else {
      padding = kHexAddrStringSize;
    }

    padding += kAddressSeparator.length();
    padding -= header.size();

    builder << header;
    builder.append(padding, ' ');
  }

  // Print offsets.
  for (size_t i = 0; i < static_cast<size_t>(flags.bytes_per_line); ++i) {
    // Early loop termination for when bytes_remaining <
    // bytes_per_line.
    if (flags.group_every != 0 &&
        i % static_cast<uint8_t>(flags.group_every) == 0) {
      builder << std::byte(i);
    } else {
      builder.append(2, ' ');
    }
    AddGroupingByte(i, flags, builder);
  }

  if (flags.show_ascii) {
    builder << kSectionSeparator;
    builder << kAsciiHeader;
  }

  return builder.status();
}

Status FormattedHexDumper::DumpLine() {
  if (source_data_.empty()) {
    return Status::ResourceExhausted();
  }

  if (!ValidateBufferSize().ok() || dest_.data() == nullptr) {
    return Status::FailedPrecondition();
  }

  if (dest_[0] == 0 && flags.show_header) {
    // First line, print out dump format header.
    return PrintFormatHeader();
  }

  StringBuilder builder(dest_);
  // Dump address/offset prefix.
  // TODO(amontanez): This block can be much nicer if StringBuilder exposed an
  // easy way to control zero padding for hex address.
  if (flags.prefix_mode != AddressMode::kDisabled) {
    uintptr_t val;
    if (flags.prefix_mode == AddressMode::kAbsolute) {
      val = reinterpret_cast<uintptr_t>(source_data_.data());
      builder << "0x";
      uint8_t significant = HexDigitCount(val);
      builder.append(sizeof(uintptr_t) * 2 - significant, '0');
    } else {
      val = current_offset_;
      size_t significant =
          HexDigitCount(source_data_.size_bytes() + current_offset_);
      if (significant < kMinOffsetChars) {
        builder.append(kMinOffsetChars - significant, '0');
      }
    }
    if (val != 0) {
      builder << reinterpret_cast<void*>(val);
    } else {
      builder.append(2, '0');
    }
    builder << kAddressSeparator;
  }

  size_t bytes_in_line = std::min(source_data_.size_bytes(),
                                  static_cast<size_t>(flags.bytes_per_line));
  // Convert raw bytes to hex characters.
  for (size_t i = 0; i < bytes_in_line; ++i) {
    // Early loop termination for when bytes_remaining <
    // bytes_per_line.
    builder << source_data_[i];
    AddGroupingByte(i, flags, builder);
  }
  // Add padding spaces to ensure lines are aligned.
  if (flags.show_ascii) {
    for (size_t i = bytes_in_line;
         i < static_cast<size_t>(flags.bytes_per_line);
         ++i) {
      builder.append(2, ' ');
      AddGroupingByte(i, flags, builder);
    }
  }

  // Interpret bytes as characters.
  if (flags.show_ascii) {
    builder << kSectionSeparator;
    for (size_t i = 0; i < bytes_in_line; ++i) {
      builder << PrintableChar(source_data_[i]);
    }
  }

  source_data_ = source_data_.subspan(bytes_in_line);
  current_offset_ += bytes_in_line;
  return builder.status();
}

Status FormattedHexDumper::SetLineBuffer(span<char> dest) {
  if (dest.data() == nullptr || dest.size_bytes() == 0) {
    return Status::InvalidArgument();
  }
  dest_ = dest;
  return ValidateBufferSize().ok() ? OkStatus() : Status::ResourceExhausted();
}

Status FormattedHexDumper::BeginDump(ConstByteSpan data) {
  current_offset_ = 0;
  source_data_ = data;
  if (data.data() == nullptr) {
    return Status::InvalidArgument();
  }
  if (dest_.data() != nullptr && dest_.size_bytes() > 0) {
    dest_[0] = 0;
  }
  return ValidateBufferSize().ok() ? OkStatus() : Status::FailedPrecondition();
}

Status FormattedHexDumper::ValidateBufferSize() {
  // Minimum size is number of bytes per line as hex pairs plus the null
  // terminator.
  size_t required_size = flags.bytes_per_line * 2 + 1;
  if (flags.show_ascii) {
    required_size += kSectionSeparator.length() + flags.bytes_per_line;
  }
  if (flags.prefix_mode == AddressMode::kAbsolute) {
    required_size += kHexAddrStringSize;
    required_size += kAddressSeparator.length();
  } else if (flags.prefix_mode == AddressMode::kOffset) {
    required_size +=
        HexDigitCount(std::max(source_data_.size_bytes(), kMinOffsetChars));
    required_size += kAddressSeparator.length();
  }
  if (flags.group_every != 0) {
    required_size += (flags.bytes_per_line - 1) / flags.group_every;
  }

  if (dest_.size_bytes() < required_size) {
    return Status::ResourceExhausted();
  }

  return OkStatus();
}

}  // namespace pw::dump


text:
.class public Lcom/htc/widget/HtcPopupWindowWrapper;
.super Ljava/lang/Object;
.source "HtcPopupWindowWrapper.java"

# interfaces
.implements Landroid/view/View$OnKeyListener;
.implements Landroid/view/ViewTreeObserver$OnGlobalLayoutListener;
.implements Lcom/htc/widget/PopupBubbleWindow$OnDismissListener;
.implements Lcom/htc/widget/AdapterView$OnItemClickListener;

# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/htc/widget/HtcPopupWindowWrapper$ShareViaOnItemClickListener;
    }
.end annotation

# instance fields
.field private clickListenerChd:Lcom/htc/widget/HtcExpandableListView$OnChildClickListener;

.field private clickListenerGrp:Lcom/htc/widget/HtcExpandableListView$OnGroupClickListener;

.field private mAdapter:Ljava/lang/ref/WeakReference;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/lang/ref/WeakReference",
            "<",
            "Landroid/widget/ListAdapter;",
            ">;"
        }
    .end annotation
.end field

.field private mAnimationListener:Landroid/view/animation/Animation$AnimationListener;

.field private mArchorView:Landroid/view/View;

.field private mCustomizeTriangleOffset:I

.field private mDismissListener:Lcom/htc/widget/PopupBubbleWindow$OnDismissListener;

.field private mExpandDirection:I

.field private mItemClickListener:Lcom/htc/widget/HtcAdapterView$OnItemClickListener;

.field private mPopup:Lcom/htc/widget/ListPopupBubbleWindow;

.field private mPopupAdapterExp:Ljava/lang/ref/WeakReference;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/lang/ref/WeakReference",
            "<",
            "Landroid/widget/ExpandableListAdapter;",
            ">;"
        }
    .end annotation
.end field

.field private mPopupBubbleExp:Lcom/htc/widget/ExpandableListPopupBubbleWindow;

.field private mPopupMaxWidth:I

.field private mShareViaOnItemClickListener:Lcom/htc/widget/HtcPopupWindowWrapper$ShareViaOnItemClickListener;

.field private mTaggleView:Landroid/view/View;

# direct methods
.method public constructor <init>()V
    .locals 1

    .prologue
    const/4 v0, 0x0

    .line 83
    invoke-direct {p0, v0, v0}, Lcom/htc/widget/HtcPopupWindowWrapper;-><init>(Landroid/view/View;Landroid/widget/ListAdapter;)V

    .line 84
    return-void
.end method

.method public constructor <init>(Landroid/view/View;Landroid/widget/ListAdapter;)V
    .locals 1
    .parameter "view"
    .parameter "adapter"

    .prologue
    const/4 v0, 0x0

    .line 89
    invoke-direct/range {p0 .. p0}, Ljava/lang/Object;-><init>()V

    .line 63
    iput-object v0, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->clickListenerChd:Lcom/htc/widget/HtcExpandableListView$OnChildClickListener;

    .line 64
    iput-object v0, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->clickListenerGrp:Lcom/htc/widget/HtcExpandableListView$OnGroupClickListener;

    .line 66
    iput-object v0, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mAnimationListener:Landroid/view/animation/Animation$AnimationListener;

    .line 73
    iput-object v0, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mPopupBubbleExp:Lcom/htc/widget/ExpandableListPopupBubbleWindow;

    .line 74
    iput-object v0, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mPopupAdapterExp:Ljava/lang/ref/WeakReference;

    .line 75
    iput-object v0, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mDismissListener:Lcom/htc/widget/PopupBubbleWindow$OnDismissListener;

    .line 90
    invoke-virtual {p0, p1}, Lcom/htc/widget/HtcPopupWindowWrapper;->setArchorView(Landroid/view/View;)V

    .line 91
    invoke-virtual {p0, p2}, Lcom/htc/widget/HtcPopupWindowWrapper;->setAdapter(Landroid/widget/ListAdapter;)V

    .line 92
    return-void
.end method

.method static synthetic access$000(Lcom/htc/widget/HtcPopupWindowWrapper;)Lcom/htc/widget/ListPopupBubbleWindow;
    .locals 1
    .parameter "x0"

    .prologue
    .line 53
    iget-object v0, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mPopup:Lcom/htc/widget/ListPopupBubbleWindow;

    return-object v0
.end method

.method private getPopupExpWindow()Lcom/htc/widget/ExpandableListPopupBubbleWindow;
    .locals 3

    .prologue
    .line 305
    invoke-virtual {p0}, Lcom/htc/widget/HtcPopupWindowWrapper;->getArchorView()Landroid/view/View;

    move-result-object v0

    .line 306
    .local v0, v:Landroid/view/View;
    if-nez v0, :cond_0

    .line 307
    const/4 v1, 0x0

    .line 312
    :goto_0
    return-object v1

    .line 309
    :cond_0
    iget-object v1, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mPopupBubbleExp:Lcom/htc/widget/ExpandableListPopupBubbleWindow;

    if-nez v1, :cond_1

    .line 310
    new-instance v1, Lcom/htc/widget/ExpandableListPopupBubbleWindow;

    invoke-virtual {v0}, Landroid/view/View;->getContext()Landroid/content/Context;

    move-result-object v2

    invoke-direct {v1, v2}, Lcom/htc/widget/ExpandableListPopupBubbleWindow;-><init>(Landroid/content/Context;)V

    iput-object v1, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mPopupBubbleExp:Lcom/htc/widget/ExpandableListPopupBubbleWindow;

    .line 312
    :cond_1
    iget-object v1, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mPopupBubbleExp:Lcom/htc/widget/ExpandableListPopupBubbleWindow;

    goto :goto_0
.end method

.method private getPopupWindow()Lcom/htc/widget/ListPopupBubbleWindow;
    .locals 3

    .prologue
    .line 294
    invoke-virtual {p0}, Lcom/htc/widget/HtcPopupWindowWrapper;->getArchorView()Landroid/view/View;

    move-result-object v0

    .line 295
    .local v0, v:Landroid/view/View;
    if-nez v0, :cond_0

    .line 296
    const/4 v1, 0x0

    .line 301
    :goto_0
    return-object v1

    .line 298
    :cond_0
    iget-object v1, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mPopup:Lcom/htc/widget/ListPopupBubbleWindow;

    if-nez v1, :cond_1

    .line 299
    new-instance v1, Lcom/htc/widget/ListPopupBubbleWindow;

    invoke-virtual {v0}, Landroid/view/View;->getContext()Landroid/content/Context;

    move-result-object v2

    invoke-direct {v1, v2}, Lcom/htc/widget/ListPopupBubbleWindow;-><init>(Landroid/content/Context;)V

    iput-object v1, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mPopup:Lcom/htc/widget/ListPopupBubbleWindow;

    .line 301
    :cond_1
    iget-object v1, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mPopup:Lcom/htc/widget/ListPopupBubbleWindow;

    goto :goto_0
.end method

.method private measureContentWidth(Landroid/widget/Adapter;)I
    .locals 10
    .parameter "adapter"

    .prologue
    const/4 v9, 0x0

    const/4 v8, 0x0

    .line 535
    const/4 v6, 0x0

    .line 536
    .local v6, width:I
    const/4 v3, 0x0

    .line 537
    .local v3, itemType:I
    const/4 v4, 0x0

    .line 538
    .local v4, itemView:Landroid/view/View;
    invoke-static {v8, v8}, Landroid/view/View$MeasureSpec;->makeMeasureSpec(II)I

    move-result v7

    .line 540
    .local v7, widthMeasureSpec:I
    invoke-static {v8, v8}, Landroid/view/View$MeasureSpec;->makeMeasureSpec(II)I

    move-result v1

    .line 542
    .local v1, heightMeasureSpec:I
    invoke-interface {p1}, Landroid/widget/Adapter;->getCount()I

    move-result v0

    .line 543
    .local v0, count:I
    const/4 v2, 0x0

    .local v2, i:I
    :goto_0
    if-ge v2, v0, :cond_1

    .line 544
    invoke-interface {p1, v2}, Landroid/widget/Adapter;->getItemViewType(I)I

    move-result v5

    .line 545
    .local v5, positionType:I
    if-eq v5, v3, :cond_0

    .line 546
    move v3, v5

    .line 547
    const/4 v4, 0x0

    .line 549
    :cond_0
    invoke-interface {p1, v2, v9, v9}, Landroid/widget/Adapter;->getView(ILandroid/view/View;Landroid/view/ViewGroup;)Landroid/view/View;

    move-result-object v4

    .line 550
    invoke-virtual {v4, v7, v1}, Landroid/view/View;->measure(II)V

    .line 551
    invoke-virtual {v4}, Landroid/view/View;->getMeasuredWidth()I

    move-result v8

    invoke-static {v6, v8}, Ljava/lang/Math;->max(II)I

    move-result v6

    .line 543
    add-int/lit8 v2, v2, 0x1

    goto :goto_0

    .line 553
    .end local v5           #positionType:I
    :cond_1
    return v6
.end method

.method private setArchorViewBackground(Z)Z
    .locals 4
    .parameter "bPressed"

    .prologue
    const/4 v3, 0x0

    .line 246
    invoke-virtual {p0}, Lcom/htc/widget/HtcPopupWindowWrapper;->getTaggleView()Landroid/view/View;

    move-result-object v2

    .line 247
    .local v2, v:Landroid/view/View;
    if-nez v2, :cond_0

    .line 248
    invoke-virtual {p0}, Lcom/htc/widget/HtcPopupWindowWrapper;->getArchorView()Landroid/view/View;

    move-result-object v2

    .line 250
    :cond_0
    if-nez v2, :cond_1

    .line 270
    :goto_0
    return v3

    .line 253
    :cond_1
    invoke-virtual {v2}, Landroid/view/View;->getPaddingLeft()I

    move-result v0

    .line 254
    .local v0, paddingLeft:I
    invoke-virtual {v2}, Landroid/view/View;->getPaddingRight()I

    move-result v1

    .line 256
    .local v1, paddingRight:I
    invoke-virtual {v2, p1}, Landroid/view/View;->setPressed(Z)V

    .line 268
    invoke-virtual {v2, v0, v3, v1, v3}, Landroid/view/View;->setPadding(IIII)V

    .line 270
    const/4 v3, 0x1

    goto :goto_0
.end method

.method private setOnGlobalLayoutListener(Z)Z
    .locals 3
    .parameter "bEnable"

    .prologue
    const/4 v2, 0x0

    .line 221
    invoke-virtual {p0}, Lcom/htc/widget/HtcPopupWindowWrapper;->getArchorView()Landroid/view/View;

    move-result-object v0

    .line 222
    .local v0, v:Landroid/view/View;
    if-nez v0, :cond_1

    .line 237
    :cond_0
    :goto_0
    return v2

    .line 226
    :cond_1
    invoke-virtual {v0}, Landroid/view/View;->getViewTreeObserver()Landroid/view/ViewTreeObserver;

    move-result-object v1

    .line 228
    .local v1, vto:Landroid/view/ViewTreeObserver;
    if-eqz v1, :cond_0

    .line 231
    if-eqz p1, :cond_2

    .line 232
    invoke-virtual {v1, p0}, Landroid/view/ViewTreeObserver;->addOnGlobalLayoutListener(Landroid/view/ViewTreeObserver$OnGlobalLayoutListener;)V

    .line 237
    :goto_1
    const/4 v2, 0x1

    goto :goto_0

    .line 234
    :cond_2
    invoke-virtual {v1, p0}, Landroid/view/ViewTreeObserver;->removeGlobalOnLayoutListener(Landroid/view/ViewTreeObserver$OnGlobalLayoutListener;)V

    goto :goto_1
.end method

.method private setPopupExpShow(Z)Z
    .locals 1
    .parameter "bShow"

    .prologue
    .line 286
    iget-object v0, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mPopupBubbleExp:Lcom/htc/widget/ExpandableListPopupBubbleWindow;

    if-eqz v0, :cond_1

    .line 287
    if-nez p1, :cond_0

    iget-object v0, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mPopupBubbleExp:Lcom/htc/widget/ExpandableListPopupBubbleWindow;

    invoke-virtual {v0}, Lcom/htc/widget/ExpandableListPopupBubbleWindow;->isShowing()Z

    move-result v0

    if-eqz v0, :cond_0

    .line 288
    iget-object v0, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mPopupBubbleExp:Lcom/htc/widget/ExpandableListPopupBubbleWindow;

    invoke-virtual {v0}, Lcom/htc/widget/ExpandableListPopupBubbleWindow;->dismiss()V

    .line 289
    :cond_0
    const/4 v0, 0x1

    .line 291
    :goto_0
    return v0

    :cond_1
    const/4 v0, 0x0

    goto :goto_0
.end method

.method private setPopupShow(Z)Z
    .locals 1
    .parameter "bShow"

    .prologue
    .line 274
    iget-object v0, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mPopup:Lcom/htc/widget/ListPopupBubbleWindow;

    if-eqz v0, :cond_2

    .line 275
    if-nez p1, :cond_0

    iget-object v0, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mPopup:Lcom/htc/widget/ListPopupBubbleWindow;

    invoke-virtual {v0}, Lcom/htc/widget/ListPopupBubbleWindow;->isShowing()Z

    move-result v0

    if-eqz v0, :cond_0

    .line 276
    iget-object v0, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mPopup:Lcom/htc/widget/ListPopupBubbleWindow;

    invoke-virtual {v0}, Lcom/htc/widget/ListPopupBubbleWindow;->dismiss()V

    .line 277
    :cond_0
    iget-object v0, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mShareViaOnItemClickListener:Lcom/htc/widget/HtcPopupWindowWrapper$ShareViaOnItemClickListener;

    if-eqz v0, :cond_1

    .line 278
    iget-object v0, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mShareViaOnItemClickListener:Lcom/htc/widget/HtcPopupWindowWrapper$ShareViaOnItemClickListener;

    invoke-virtual {v0}, Lcom/htc/widget/HtcPopupWindowWrapper$ShareViaOnItemClickListener;->shrinkAdapter()V

    .line 280
    :cond_1
    const/4 v0, 0x1

    .line 282
    :goto_0
    return v0

    :cond_2
    const/4 v0, 0x0

    goto :goto_0
.end method

.method private showPopup()Z
    .locals 7

    .prologue
    const/4 v5, 0x0

    const/4 v6, 0x1

    .line 317
    invoke-direct {p0, v5}, Lcom/htc/widget/HtcPopupWindowWrapper;->setPopupShow(Z)Z

    .line 322
    iget-object v4, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mAdapter:Ljava/lang/ref/WeakReference;

    if-eqz v4, :cond_0

    iget-object v4, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mAdapter:Ljava/lang/ref/WeakReference;

    invoke-virtual {v4}, Ljava/lang/ref/WeakReference;->get()Ljava/lang/Object;

    move-result-object v4

    check-cast v4, Landroid/widget/ListAdapter;

    move-object v0, v4

    .line 323
    .local v0, adapter:Landroid/widget/ListAdapter;
    :goto_0
    invoke-virtual {p0}, Lcom/htc/widget/HtcPopupWindowWrapper;->getArchorView()Landroid/view/View;

    move-result-object v3

    .line 324
    .local v3, v:Landroid/view/View;
    if-nez v3, :cond_1

    move v4, v5

    .line 361
    :goto_1
    return v4

    .line 322
    .end local v0           #adapter:Landroid/widget/ListAdapter;
    .end local v3           #v:Landroid/view/View;
    :cond_0
    const/4 v0, 0x0

    goto :goto_0

    .line 327
    .restart local v0       #adapter:Landroid/widget/ListAdapter;
    .restart local v3       #v:Landroid/view/View;
    :cond_1
    if-nez v0, :cond_2

    iget-object v4, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mShareViaOnItemClickListener:Lcom/htc/widget/HtcPopupWindowWrapper$ShareViaOnItemClickListener;

    if-eqz v4, :cond_6

    .line 328
    :cond_2
    invoke-direct {p0, v6}, Lcom/htc/widget/HtcPopupWindowWrapper;->setOnGlobalLayoutListener(Z)Z

    .line 329
    invoke-direct {p0}, Lcom/htc/widget/HtcPopupWindowWrapper;->getPopupWindow()Lcom/htc/widget/ListPopupBubbleWindow;

    move-result-object v1

    .line 330
    .local v1, lpbw:Lcom/htc/widget/ListPopupBubbleWindow;
    if-eqz v1, :cond_4

    .line 332
    invoke-virtual {v3}, Landroid/view/View;->getResources()Landroid/content/res/Resources;

    move-result-object v4

    invoke-virtual {v4}, Landroid/content/res/Resources;->getDisplayMetrics()Landroid/util/DisplayMetrics;

    move-result-object v2

    .line 333
    .local v2, metrics:Landroid/util/DisplayMetrics;
    iget v4, v2, Landroid/util/DisplayMetrics;->widthPixels:I

    iput v4, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mPopupMaxWidth:I

    .line 334
    iget-object v4, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mShareViaOnItemClickListener:Lcom/htc/widget/HtcPopupWindowWrapper$ShareViaOnItemClickListener;

    if-eqz v4, :cond_5

    .line 335
    iget-object v4, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mShareViaOnItemClickListener:Lcom/htc/widget/HtcPopupWindowWrapper$ShareViaOnItemClickListener;

    invoke-virtual {v1, v4}, Lcom/htc/widget/ListPopupBubbleWindow;->setOnItemClickListener(Lcom/htc/widget/HtcAdapterView$OnItemClickListener;)V

    .line 336
    iget-object v4, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mShareViaOnItemClickListener:Lcom/htc/widget/HtcPopupWindowWrapper$ShareViaOnItemClickListener;

    invoke-virtual {v4}, Lcom/htc/widget/HtcPopupWindowWrapper$ShareViaOnItemClickListener;->getAdapter()Lcom/htc/widget/IHtcShareViaAdapter;

    move-result-object v4

    invoke-virtual {v1, v4}, Lcom/htc/widget/ListPopupBubbleWindow;->setAdapter(Landroid/widget/ListAdapter;)V

    .line 337
    iget-object v4, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mShareViaOnItemClickListener:Lcom/htc/widget/HtcPopupWindowWrapper$ShareViaOnItemClickListener;

    invoke-virtual {v4}, Lcom/htc/widget/HtcPopupWindowWrapper$ShareViaOnItemClickListener;->getAdapter()Lcom/htc/widget/IHtcShareViaAdapter;

    move-result-object v4

    invoke-direct {p0, v4}, Lcom/htc/widget/HtcPopupWindowWrapper;->measureContentWidth(Landroid/widget/Adapter;)I

    move-result v4

    iget v5, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mPopupMaxWidth:I

    invoke-static {v4, v5}, Ljava/lang/Math;->min(II)I

    move-result v4

    invoke-virtual {v1, v4}, Lcom/htc/widget/ListPopupBubbleWindow;->setContentWidth(I)V

    .line 343
    :goto_2
    iget-object v4, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mAnimationListener:Landroid/view/animation/Animation$AnimationListener;

    if-eqz v4, :cond_3

    .line 344
    iget-object v4, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mAnimationListener:Landroid/view/animation/Animation$AnimationListener;

    invoke-virtual {v1, v4}, Lcom/htc/widget/ListPopupBubbleWindow;->setAnimationListener(Landroid/view/animation/Animation$AnimationListener;)V

    .line 346
    :cond_3
    iget v4, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mCustomizeTriangleOffset:I

    invoke-virtual {v1, v4}, Lcom/htc/widget/ListPopupBubbleWindow;->setTriangleOffset(I)V

    .line 347
    invoke-virtual {v1, v3}, Lcom/htc/widget/ListPopupBubbleWindow;->setAnchorView(Landroid/view/View;)V

    .line 348
    invoke-virtual {v1, p0}, Lcom/htc/widget/ListPopupBubbleWindow;->setOnDismissListener(Lcom/htc/widget/PopupBubbleWindow$OnDismissListener;)V

    .line 349
    invoke-virtual {v1, v6}, Lcom/htc/widget/ListPopupBubbleWindow;->setModal(Z)V

    .line 352
    const/4 v4, 0x2

    invoke-virtual {v1, v4}, Lcom/htc/widget/ListPopupBubbleWindow;->setInputMethodMode(I)V

    .line 353
    iget v4, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mExpandDirection:I

    invoke-virtual {v1, v4}, Lcom/htc/widget/ListPopupBubbleWindow;->setExpandDirection(I)V

    .line 354
    invoke-virtual {v1}, Lcom/htc/widget/ListPopupBubbleWindow;->show()V

    .line 355
    invoke-virtual {v1}, Lcom/htc/widget/ListPopupBubbleWindow;->getListView()Lcom/htc/widget/HtcListView;

    move-result-object v4

    invoke-virtual {v4, p0}, Lcom/htc/widget/HtcListView;->setOnKeyListener(Landroid/view/View$OnKeyListener;)V

    .line 356
    invoke-direct {p0, v6}, Lcom/htc/widget/HtcPopupWindowWrapper;->setArchorViewBackground(Z)Z

    .end local v2           #metrics:Landroid/util/DisplayMetrics;
    :cond_4
    move v4, v6

    .line 361
    goto :goto_1

    .line 339
    .restart local v2       #metrics:Landroid/util/DisplayMetrics;
    :cond_5
    iget-object v4, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mItemClickListener:Lcom/htc/widget/HtcAdapterView$OnItemClickListener;

    invoke-virtual {v1, v4}, Lcom/htc/widget/ListPopupBubbleWindow;->setOnItemClickListener(Lcom/htc/widget/HtcAdapterView$OnItemClickListener;)V

    .line 340
    invoke-virtual {v1, v0}, Lcom/htc/widget/ListPopupBubbleWindow;->setAdapter(Landroid/widget/ListAdapter;)V

    .line 341
    invoke-direct {p0, v0}, Lcom/htc/widget/HtcPopupWindowWrapper;->measureContentWidth(Landroid/widget/Adapter;)I

    move-result v4

    iget v5, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mPopupMaxWidth:I

    invoke-static {v4, v5}, Ljava/lang/Math;->min(II)I

    move-result v4

    invoke-virtual {v1, v4}, Lcom/htc/widget/ListPopupBubbleWindow;->setContentWidth(I)V

    goto :goto_2

    .end local v1           #lpbw:Lcom/htc/widget/ListPopupBubbleWindow;
    .end local v2           #metrics:Landroid/util/DisplayMetrics;
    :cond_6
    move v4, v5

    .line 359
    goto/16 :goto_1
.end method

.method private showPopupExp()Z
    .locals 7

    .prologue
    const/4 v5, 0x0

    const/4 v6, 0x1

    .line 366
    invoke-direct {p0, v5}, Lcom/htc/widget/HtcPopupWindowWrapper;->setPopupExpShow(Z)Z

    .line 371
    iget-object v4, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mPopupAdapterExp:Ljava/lang/ref/WeakReference;

    if-eqz v4, :cond_0

    iget-object v4, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mPopupAdapterExp:Ljava/lang/ref/WeakReference;

    invoke-virtual {v4}, Ljava/lang/ref/WeakReference;->get()Ljava/lang/Object;

    move-result-object v4

    check-cast v4, Landroid/widget/ExpandableListAdapter;

    move-object v0, v4

    .line 372
    .local v0, adapterExp:Landroid/widget/ExpandableListAdapter;
    :goto_0
    invoke-virtual {p0}, Lcom/htc/widget/HtcPopupWindowWrapper;->getArchorView()Landroid/view/View;

    move-result-object v3

    .line 374
    .local v3, v:Landroid/view/View;
    if-nez v3, :cond_1

    move v4, v5

    .line 407
    :goto_1
    return v4

    .line 371
    .end local v0           #adapterExp:Landroid/widget/ExpandableListAdapter;
    .end local v3           #v:Landroid/view/View;
    :cond_0
    const/4 v0, 0x0

    goto :goto_0

    .line 377
    .restart local v0       #adapterExp:Landroid/widget/ExpandableListAdapter;
    .restart local v3       #v:Landroid/view/View;
    :cond_1
    if-eqz v0, :cond_4

    .line 378
    invoke-direct {p0, v6}, Lcom/htc/widget/HtcPopupWindowWrapper;->setOnGlobalLayoutListener(Z)Z

    .line 380
    invoke-direct {p0}, Lcom/htc/widget/HtcPopupWindowWrapper;->getPopupExpWindow()Lcom/htc/widget/ExpandableListPopupBubbleWindow;

    move-result-object v1

    .line 381
    .local v1, elpbw:Lcom/htc/widget/ExpandableListPopupBubbleWindow;
    if-eqz v1, :cond_3

    .line 382
    iget-object v4, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->clickListenerChd:Lcom/htc/widget/HtcExpandableListView$OnChildClickListener;

    invoke-virtual {v1, v4}, Lcom/htc/widget/ExpandableListPopupBubbleWindow;->setOnChildClickListener(Lcom/htc/widget/HtcExpandableListView$OnChildClickListener;)V

    .line 383
    iget-object v4, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->clickListenerGrp:Lcom/htc/widget/HtcExpandableListView$OnGroupClickListener;

    invoke-virtual {v1, v4}, Lcom/htc/widget/ExpandableListPopupBubbleWindow;->setOnGroupClickListener(Lcom/htc/widget/HtcExpandableListView$OnGroupClickListener;)V

    .line 384
    iget-object v4, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mItemClickListener:Lcom/htc/widget/HtcAdapterView$OnItemClickListener;

    invoke-virtual {v1, v4}, Lcom/htc/widget/ExpandableListPopupBubbleWindow;->setOnItemClickListener(Lcom/htc/widget/HtcAdapterView$OnItemClickListener;)V

    .line 386
    iget-object v4, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mAnimationListener:Landroid/view/animation/Animation$AnimationListener;

    if-eqz v4, :cond_2

    .line 387
    iget-object v4, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mAnimationListener:Landroid/view/animation/Animation$AnimationListener;

    invoke-virtual {v1, v4}, Lcom/htc/widget/ExpandableListPopupBubbleWindow;->setAnimationListener(Landroid/view/animation/Animation$AnimationListener;)V

    .line 389
    :cond_2
    iget v4, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mCustomizeTriangleOffset:I

    invoke-virtual {v1, v4}, Lcom/htc/widget/ExpandableListPopupBubbleWindow;->setTriangleOffset(I)V

    .line 390
    invoke-virtual {v1, v3}, Lcom/htc/widget/ExpandableListPopupBubbleWindow;->setAnchorView(Landroid/view/View;)V

    .line 391
    invoke-virtual {v1, p0}, Lcom/htc/widget/ExpandableListPopupBubbleWindow;->setOnDismissListener(Lcom/htc/widget/PopupBubbleWindow$OnDismissListener;)V

    .line 392
    invoke-virtual {v1, v0}, Lcom/htc/widget/ExpandableListPopupBubbleWindow;->setAdapter(Landroid/widget/ExpandableListAdapter;)V

    .line 393
    invoke-virtual {v1, v6}, Lcom/htc/widget/ExpandableListPopupBubbleWindow;->setModal(Z)V

    .line 396
    invoke-virtual {v3}, Landroid/view/View;->getResources()Landroid/content/res/Resources;

    move-result-object v4

    invoke-virtual {v4}, Landroid/content/res/Resources;->getDisplayMetrics()Landroid/util/DisplayMetrics;

    move-result-object v2

    .line 397
    .local v2, metrics:Landroid/util/DisplayMetrics;
    iget v4, v2, Landroid/util/DisplayMetrics;->widthPixels:I

    iput v4, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mPopupMaxWidth:I

    .line 398
    invoke-virtual {p0, v0}, Lcom/htc/widget/HtcPopupWindowWrapper;->measureContentWidth(Landroid/widget/ExpandableListAdapter;)I

    move-result v4

    iget v5, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mPopupMaxWidth:I

    invoke-static {v4, v5}, Ljava/lang/Math;->min(II)I

    move-result v4

    invoke-virtual {v1, v4}, Lcom/htc/widget/ExpandableListPopupBubbleWindow;->setContentWidth(I)V

    .line 399
    const/4 v4, 0x2

    invoke-virtual {v1, v4}, Lcom/htc/widget/ExpandableListPopupBubbleWindow;->setInputMethodMode(I)V

    .line 400
    iget v4, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mExpandDirection:I

    invoke-virtual {v1, v4}, Lcom/htc/widget/ExpandableListPopupBubbleWindow;->setExpandDirection(I)V

    .line 401
    invoke-virtual {v1}, Lcom/htc/widget/ExpandableListPopupBubbleWindow;->show()V

    .line 402
    invoke-virtual {v1}, Lcom/htc/widget/ExpandableListPopupBubbleWindow;->getExpandableListView()Lcom/htc/widget/HtcExpandableListView;

    move-result-object v4

    invoke-virtual {v4, p0}, Lcom/htc/widget/HtcExpandableListView;->setOnKeyListener(Landroid/view/View$OnKeyListener;)V

    .line 405
    .end local v2           #metrics:Landroid/util/DisplayMetrics;
    :cond_3
    invoke-direct {p0, v6}, Lcom/htc/widget/HtcPopupWindowWrapper;->setArchorViewBackground(Z)Z

    .end local v1           #elpbw:Lcom/htc/widget/ExpandableListPopupBubbleWindow;
    :cond_4
    move v4, v6

    .line 407
    goto :goto_1
.end method

.method private tryShow()Z
    .locals 3

    .prologue
    .line 411
    invoke-direct {p0}, Lcom/htc/widget/HtcPopupWindowWrapper;->showPopup()Z

    move-result v0

    .line 412
    .local v0, bShowPopup:Z
    invoke-direct {p0}, Lcom/htc/widget/HtcPopupWindowWrapper;->showPopupExp()Z

    move-result v1

    .line 414
    .local v1, bShowPopupExp:Z
    if-nez v0, :cond_0

    if-eqz v1, :cond_1

    :cond_0
    const/4 v2, 0x1

    :goto_0
    return v2

    :cond_1
    const/4 v2, 0x0

    goto :goto_0
.end method

# virtual methods
.method public dismiss()V
    .locals 1

    .prologue
    const/4 v0, 0x0

    .line 444
    invoke-direct {p0, v0}, Lcom/htc/widget/HtcPopupWindowWrapper;->setOnGlobalLayoutListener(Z)Z

    .line 446
    invoke-direct {p0, v0}, Lcom/htc/widget/HtcPopupWindowWrapper;->setPopupShow(Z)Z

    .line 447
    invoke-direct {p0, v0}, Lcom/htc/widget/HtcPopupWindowWrapper;->setPopupExpShow(Z)Z

    .line 448
    return-void
.end method

.method public dismissWithoutAnimation()V
    .locals 1

    .prologue
    .line 451
    const/4 v0, 0x0

    invoke-direct {p0, v0}, Lcom/htc/widget/HtcPopupWindowWrapper;->setOnGlobalLayoutListener(Z)Z

    .line 453
    iget-object v0, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mPopup:Lcom/htc/widget/ListPopupBubbleWindow;

    if-eqz v0, :cond_0

    .line 454
    iget-object v0, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mPopup:Lcom/htc/widget/ListPopupBubbleWindow;

    invoke-virtual {v0}, Lcom/htc/widget/ListPopupBubbleWindow;->isShowing()Z

    move-result v0

    if-eqz v0, :cond_0

    .line 455
    iget-object v0, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mPopup:Lcom/htc/widget/ListPopupBubbleWindow;

    invoke-virtual {v0}, Lcom/htc/widget/ListPopupBubbleWindow;->dismissWithoutAnimation()V

    .line 459
    :cond_0
    iget-object v0, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mPopupBubbleExp:Lcom/htc/widget/ExpandableListPopupBubbleWindow;

    if-eqz v0, :cond_1

    .line 460
    iget-object v0, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mPopupBubbleExp:Lcom/htc/widget/ExpandableListPopupBubbleWindow;

    invoke-virtual {v0}, Lcom/htc/widget/ExpandableListPopupBubbleWindow;->isShowing()Z

    move-result v0

    if-eqz v0, :cond_1

    .line 461
    iget-object v0, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mPopupBubbleExp:Lcom/htc/widget/ExpandableListPopupBubbleWindow;

    invoke-virtual {v0}, Lcom/htc/widget/ExpandableListPopupBubbleWindow;->dismissWithoutAnimation()V

    .line 464
    :cond_1
    return-void
.end method

.method public getArchorView()Landroid/view/View;
    .locals 1

    .prologue
    .line 105
    iget-object v0, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mArchorView:Landroid/view/View;

    return-object v0
.end method

.method public getExpandDirection()I
    .locals 1

    .prologue
    .line 212
    iget-object v0, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mPopup:Lcom/htc/widget/ListPopupBubbleWindow;

    if-eqz v0, :cond_1

    .line 213
    iget-object v0, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mPopup:Lcom/htc/widget/ListPopupBubbleWindow;

    invoke-virtual {v0}, Lcom/htc/widget/ListPopupBubbleWindow;->getExpandDirection()I

    move-result v0

    iput v0, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mExpandDirection:I

    .line 217
    :cond_0
    :goto_0
    iget v0, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mExpandDirection:I

    return v0

    .line 214
    :cond_1
    iget-object v0, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mPopupBubbleExp:Lcom/htc/widget/ExpandableListPopupBubbleWindow;

    if-eqz v0, :cond_0

    .line 215
    iget-object v0, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mPopupBubbleExp:Lcom/htc/widget/ExpandableListPopupBubbleWindow;

    invoke-virtual {v0}, Lcom/htc/widget/ExpandableListPopupBubbleWindow;->getExpandDirection()I

    move-result v0

    iput v0, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mExpandDirection:I

    goto :goto_0
.end method

.method public getTaggleView()Landroid/view/View;
    .locals 1

    .prologue
    .line 121
    iget-object v0, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mTaggleView:Landroid/view/View;

    return-object v0
.end method

.method getTriangleOffset()I
    .locals 1

    .prologue
    .line 181
    iget v0, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mCustomizeTriangleOffset:I

    return v0
.end method

.method public isPopupExpShowing()Z
    .locals 1

    .prologue
    .line 470
    iget-object v0, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mPopupBubbleExp:Lcom/htc/widget/ExpandableListPopupBubbleWindow;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mPopupBubbleExp:Lcom/htc/widget/ExpandableListPopupBubbleWindow;

    invoke-virtual {v0}, Lcom/htc/widget/ExpandableListPopupBubbleWindow;->isShowing()Z

    move-result v0

    if-eqz v0, :cond_0

    const/4 v0, 0x1

    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method

.method public isPopupShowing()Z
    .locals 1

    .prologue
    .line 467
    iget-object v0, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mPopup:Lcom/htc/widget/ListPopupBubbleWindow;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mPopup:Lcom/htc/widget/ListPopupBubbleWindow;

    invoke-virtual {v0}, Lcom/htc/widget/ListPopupBubbleWindow;->isShowing()Z

    move-result v0

    if-eqz v0, :cond_0

    const/4 v0, 0x1

    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method

.method protected measureContentWidth(Landroid/widget/ExpandableListAdapter;)I
    .locals 10
    .parameter "adapter"

    .prologue
    const/4 v9, 0x0

    const/4 v8, 0x0

    .line 558
    const/4 v5, 0x0

    .line 559
    .local v5, width:I
    const/4 v3, 0x0

    .line 560
    .local v3, itemType:I
    const/4 v4, 0x0

    .line 561
    .local v4, itemView:Landroid/view/View;
    invoke-static {v8, v8}, Landroid/view/View$MeasureSpec;->makeMeasureSpec(II)I

    move-result v6

    .line 563
    .local v6, widthMeasureSpec:I
    invoke-static {v8, v8}, Landroid/view/View$MeasureSpec;->makeMeasureSpec(II)I

    move-result v1

    .line 565
    .local v1, heightMeasureSpec:I
    invoke-interface {p1}, Landroid/widget/ExpandableListAdapter;->getGroupCount()I

    move-result v0

    .line 566
    .local v0, count:I
    const/4 v2, 0x0

    .local v2, i:I
    :goto_0
    if-ge v2, v0, :cond_0

    .line 567
    invoke-interface {p1, v2, v8, v9, v9}, Landroid/widget/ExpandableListAdapter;->getGroupView(IZLandroid/view/View;Landroid/view/ViewGroup;)Landroid/view/View;

    move-result-object v4

    .line 568
    invoke-virtual {v4, v6, v1}, Landroid/view/View;->measure(II)V

    .line 569
    invoke-virtual {v4}, Landroid/view/View;->getMeasuredWidth()I

    move-result v7

    invoke-static {v5, v7}, Ljava/lang/Math;->max(II)I

    move-result v5

    .line 566
    add-int/lit8 v2, v2, 0x1

    goto :goto_0

    .line 571
    :cond_0
    return v5
.end method

.method public onDismiss()V
    .locals 3

    .prologue
    const/4 v2, 0x0

    const/4 v1, 0x0

    .line 424
    iget-object v0, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mPopup:Lcom/htc/widget/ListPopupBubbleWindow;

    if-eqz v0, :cond_0

    .line 425
    iget-object v0, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mPopup:Lcom/htc/widget/ListPopupBubbleWindow;

    invoke-virtual {v0, v1}, Lcom/htc/widget/ListPopupBubbleWindow;->setAdapter(Landroid/widget/ListAdapter;)V

    .line 426
    :cond_0
    iput-object v1, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mPopup:Lcom/htc/widget/ListPopupBubbleWindow;

    .line 428
    iget-object v0, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mShareViaOnItemClickListener:Lcom/htc/widget/HtcPopupWindowWrapper$ShareViaOnItemClickListener;

    if-eqz v0, :cond_1

    .line 429
    iget-object v0, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mShareViaOnItemClickListener:Lcom/htc/widget/HtcPopupWindowWrapper$ShareViaOnItemClickListener;

    invoke-virtual {v0}, Lcom/htc/widget/HtcPopupWindowWrapper$ShareViaOnItemClickListener;->shrinkAdapter()V

    .line 431
    :cond_1
    invoke-direct {p0, v2}, Lcom/htc/widget/HtcPopupWindowWrapper;->setOnGlobalLayoutListener(Z)Z

    .line 432
    invoke-direct {p0, v2}, Lcom/htc/widget/HtcPopupWindowWrapper;->setArchorViewBackground(Z)Z

    .line 434
    iget-object v0, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mPopupBubbleExp:Lcom/htc/widget/ExpandableListPopupBubbleWindow;

    if-eqz v0, :cond_2

    .line 435
    iget-object v0, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mPopupBubbleExp:Lcom/htc/widget/ExpandableListPopupBubbleWindow;

    invoke-virtual {v0, v1}, Lcom/htc/widget/ExpandableListPopupBubbleWindow;->setAdapter(Landroid/widget/ExpandableListAdapter;)V

    .line 436
    :cond_2
    iput-object v1, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mPopupBubbleExp:Lcom/htc/widget/ExpandableListPopupBubbleWindow;

    .line 438
    iget-object v0, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mDismissListener:Lcom/htc/widget/PopupBubbleWindow$OnDismissListener;

    if-eqz v0, :cond_3

    .line 439
    iget-object v0, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mDismissListener:Lcom/htc/widget/PopupBubbleWindow$OnDismissListener;

    invoke-interface {v0}, Lcom/htc/widget/PopupBubbleWindow$OnDismissListener;->onDismiss()V

    .line 440
    :cond_3
    return-void
.end method

.method public onGlobalLayout()V
    .locals 2

    .prologue
    .line 474
    invoke-virtual {p0}, Lcom/htc/widget/HtcPopupWindowWrapper;->getArchorView()Landroid/view/View;

    move-result-object v0

    .line 476
    .local v0, v:Landroid/view/View;
    if-nez v0, :cond_1

    .line 492
    :cond_0
    :goto_0
    return-void

    .line 479
    :cond_1
    invoke-virtual {p0}, Lcom/htc/widget/HtcPopupWindowWrapper;->isPopupShowing()Z

    move-result v1

    if-nez v1, :cond_2

    invoke-virtual {p0}, Lcom/htc/widget/HtcPopupWindowWrapper;->isPopupExpShowing()Z

    move-result v1

    if-nez v1, :cond_2

    .line 480
    const/4 v1, 0x0

    invoke-direct {p0, v1}, Lcom/htc/widget/HtcPopupWindowWrapper;->setOnGlobalLayoutListener(Z)Z

    goto :goto_0

    .line 482
    :cond_2
    if-eqz v0, :cond_3

    invoke-virtual {v0}, Landroid/view/View;->isShown()Z

    move-result v1

    if-nez v1, :cond_3

    .line 483
    invoke-virtual {p0}, Lcom/htc/widget/HtcPopupWindowWrapper;->dismiss()V

    goto :goto_0

    .line 485
    :cond_3
    iget-object v1, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mPopup:Lcom/htc/widget/ListPopupBubbleWindow;

    if-eqz v1, :cond_4

    .line 486
    iget-object v1, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mPopup:Lcom/htc/widget/ListPopupBubbleWindow;

    invoke-virtual {v1}, Lcom/htc/widget/ListPopupBubbleWindow;->show()V

    .line 488
    :cond_4
    iget-object v1, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mPopupBubbleExp:Lcom/htc/widget/ExpandableListPopupBubbleWindow;

    if-eqz v1, :cond_0

    .line 489
    iget-object v1, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mPopupBubbleExp:Lcom/htc/widget/ExpandableListPopupBubbleWindow;

    invoke-virtual {v1}, Lcom/htc/widget/ExpandableListPopupBubbleWindow;->show()V

    goto :goto_0
.end method

.method public onItemClick(Lcom/htc/widget/AdapterView;Landroid/view/View;IJ)V
    .locals 0
    .parameter
    .parameter "arg1"
    .parameter "arg2"
    .parameter "arg3"
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lcom/htc/widget/AdapterView",
            "<*>;",
            "Landroid/view/View;",
            "IJ)V"
        }
    .end annotation

    .prologue
    .line 531
    .local p1, arg0:Lcom/htc/widget/AdapterView;,"Lcom/htc/widget/AdapterView<*>;"
    return-void
.end method

.method public onKey(Landroid/view/View;ILandroid/view/KeyEvent;)Z
    .locals 1
    .parameter "v"
    .parameter "keyCode"
    .parameter "event"

    .prologue
    .line 495
    const/4 v0, 0x0

    return v0
.end method

.method public setAdapter(Landroid/widget/ExpandableListAdapter;)V
    .locals 2
    .parameter "adapter"

    .prologue
    const/4 v1, 0x0

    .line 156
    iput-object v1, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mPopupAdapterExp:Ljava/lang/ref/WeakReference;

    .line 157
    if-eqz p1, :cond_4

    new-instance v0, Ljava/lang/ref/WeakReference;

    invoke-direct {v0, p1}, Ljava/lang/ref/WeakReference;-><init>(Ljava/lang/Object;)V

    :goto_0
    iput-object v0, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mPopupAdapterExp:Ljava/lang/ref/WeakReference;

    .line 159
    iget-object v0, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mPopupBubbleExp:Lcom/htc/widget/ExpandableListPopupBubbleWindow;

    if-eqz v0, :cond_0

    if-nez p1, :cond_0

    .line 160
    iget-object v0, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mPopupBubbleExp:Lcom/htc/widget/ExpandableListPopupBubbleWindow;

    invoke-virtual {v0, p1}, Lcom/htc/widget/ExpandableListPopupBubbleWindow;->setAdapter(Landroid/widget/ExpandableListAdapter;)V

    .line 163
    :cond_0
    iget-object v0, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mAdapter:Ljava/lang/ref/WeakReference;

    if-nez v0, :cond_1

    iget-object v0, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mPopup:Lcom/htc/widget/ListPopupBubbleWindow;

    if-eqz v0, :cond_3

    .line 165
    :cond_1
    iget-object v0, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mPopup:Lcom/htc/widget/ListPopupBubbleWindow;

    if-eqz v0, :cond_2

    .line 167
    iget-object v0, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mPopup:Lcom/htc/widget/ListPopupBubbleWindow;

    invoke-virtual {v0}, Lcom/htc/widget/ListPopupBubbleWindow;->dismiss()V

    .line 168
    iget-object v0, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mPopup:Lcom/htc/widget/ListPopupBubbleWindow;

    invoke-virtual {v0, v1}, Lcom/htc/widget/ListPopupBubbleWindow;->setAdapter(Landroid/widget/ListAdapter;)V

    .line 171
    :cond_2
    iput-object v1, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mPopup:Lcom/htc/widget/ListPopupBubbleWindow;

    .line 172
    iput-object v1, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mAdapter:Ljava/lang/ref/WeakReference;

    .line 174
    :cond_3
    return-void

    :cond_4
    move-object v0, v1

    .line 157
    goto :goto_0
.end method

.method public setAdapter(Landroid/widget/ListAdapter;)V
    .locals 2
    .parameter "adapter"

    .prologue
    const/4 v1, 0x0

    .line 133
    iput-object v1, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mAdapter:Ljava/lang/ref/WeakReference;

    .line 134
    if-eqz p1, :cond_4

    new-instance v0, Ljava/lang/ref/WeakReference;

    invoke-direct {v0, p1}, Ljava/lang/ref/WeakReference;-><init>(Ljava/lang/Object;)V

    :goto_0
    iput-object v0, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mAdapter:Ljava/lang/ref/WeakReference;

    .line 136
    iget-object v0, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mPopup:Lcom/htc/widget/ListPopupBubbleWindow;

    if-eqz v0, :cond_0

    if-nez p1, :cond_0

    .line 137
    iget-object v0, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mPopup:Lcom/htc/widget/ListPopupBubbleWindow;

    invoke-virtual {v0, p1}, Lcom/htc/widget/ListPopupBubbleWindow;->setAdapter(Landroid/widget/ListAdapter;)V

    .line 140
    :cond_0
    iget-object v0, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mPopupAdapterExp:Ljava/lang/ref/WeakReference;

    if-nez v0, :cond_1

    iget-object v0, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mPopupBubbleExp:Lcom/htc/widget/ExpandableListPopupBubbleWindow;

    if-eqz v0, :cond_3

    .line 142
    :cond_1
    iget-object v0, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mPopupBubbleExp:Lcom/htc/widget/ExpandableListPopupBubbleWindow;

    if-eqz v0, :cond_2

    .line 144
    iget-object v0, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mPopupBubbleExp:Lcom/htc/widget/ExpandableListPopupBubbleWindow;

    invoke-virtual {v0}, Lcom/htc/widget/ExpandableListPopupBubbleWindow;->dismiss()V

    .line 145
    iget-object v0, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mPopupBubbleExp:Lcom/htc/widget/ExpandableListPopupBubbleWindow;

    invoke-virtual {v0, v1}, Lcom/htc/widget/ExpandableListPopupBubbleWindow;->setAdapter(Landroid/widget/ExpandableListAdapter;)V

    .line 148
    :cond_2
    iput-object v1, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mPopupBubbleExp:Lcom/htc/widget/ExpandableListPopupBubbleWindow;

    .line 149
    iput-object v1, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mPopupAdapterExp:Ljava/lang/ref/WeakReference;

    .line 151
    :cond_3
    return-void

    :cond_4
    move-object v0, v1

    .line 134
    goto :goto_0
.end method

.method public setAnimationListener(Landroid/view/animation/Animation$AnimationListener;)V
    .locals 0
    .parameter "listener"

    .prologue
    .line 241
    iput-object p1, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mAnimationListener:Landroid/view/animation/Animation$AnimationListener;

    .line 242
    return-void
.end method

.method public setArchorView(Landroid/view/View;)V
    .locals 0
    .parameter "view"

    .prologue
    .line 98
    iput-object p1, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mArchorView:Landroid/view/View;

    .line 99
    return-void
.end method

.method public setExpandDirection(I)V
    .locals 0
    .parameter "direction"

    .prologue
    .line 203
    iput p1, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mExpandDirection:I

    .line 204
    return-void
.end method

.method public setOnChildClickListener(Lcom/htc/widget/HtcExpandableListView$OnChildClickListener;)V
    .locals 1
    .parameter "listener"

    .prologue
    .line 515
    iput-object p1, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->clickListenerChd:Lcom/htc/widget/HtcExpandableListView$OnChildClickListener;

    .line 517
    iget-object v0, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mPopupBubbleExp:Lcom/htc/widget/ExpandableListPopupBubbleWindow;

    if-eqz v0, :cond_0

    .line 518
    iget-object v0, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mPopupBubbleExp:Lcom/htc/widget/ExpandableListPopupBubbleWindow;

    invoke-virtual {v0, p1}, Lcom/htc/widget/ExpandableListPopupBubbleWindow;->setOnChildClickListener(Lcom/htc/widget/HtcExpandableListView$OnChildClickListener;)V

    .line 519
    :cond_0
    return-void
.end method

.method public setOnDismissListener(Lcom/htc/widget/PopupBubbleWindow$OnDismissListener;)V
    .locals 0
    .parameter "listener"

    .prologue
    .line 420
    iput-object p1, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mDismissListener:Lcom/htc/widget/PopupBubbleWindow$OnDismissListener;

    .line 421
    return-void
.end method

.method public setOnGroupClickListener(Lcom/htc/widget/HtcExpandableListView$OnGroupClickListener;)V
    .locals 1
    .parameter "listener"

    .prologue
    .line 523
    iput-object p1, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->clickListenerGrp:Lcom/htc/widget/HtcExpandableListView$OnGroupClickListener;

    .line 525
    iget-object v0, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mPopupBubbleExp:Lcom/htc/widget/ExpandableListPopupBubbleWindow;

    if-eqz v0, :cond_0

    .line 526
    iget-object v0, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mPopupBubbleExp:Lcom/htc/widget/ExpandableListPopupBubbleWindow;

    invoke-virtual {v0, p1}, Lcom/htc/widget/ExpandableListPopupBubbleWindow;->setOnGroupClickListener(Lcom/htc/widget/HtcExpandableListView$OnGroupClickListener;)V

    .line 527
    :cond_0
    return-void
.end method

.method public setOnItemClickListener(Lcom/htc/widget/HtcAdapterView$OnItemClickListener;)V
    .locals 1
    .parameter "listener"

    .prologue
    .line 500
    iput-object p1, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mItemClickListener:Lcom/htc/widget/HtcAdapterView$OnItemClickListener;

    .line 502
    iget-object v0, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mPopup:Lcom/htc/widget/ListPopupBubbleWindow;

    if-eqz v0, :cond_0

    .line 503
    iget-object v0, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mPopup:Lcom/htc/widget/ListPopupBubbleWindow;

    invoke-virtual {v0, p1}, Lcom/htc/widget/ListPopupBubbleWindow;->setOnItemClickListener(Lcom/htc/widget/HtcAdapterView$OnItemClickListener;)V

    .line 505
    :cond_0
    iget-object v0, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mPopupBubbleExp:Lcom/htc/widget/ExpandableListPopupBubbleWindow;

    if-eqz v0, :cond_1

    .line 506
    iget-object v0, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mPopupBubbleExp:Lcom/htc/widget/ExpandableListPopupBubbleWindow;

    invoke-virtual {v0, p1}, Lcom/htc/widget/ExpandableListPopupBubbleWindow;->setOnItemClickListener(Lcom/htc/widget/HtcAdapterView$OnItemClickListener;)V

    .line 507
    :cond_1
    return-void
.end method

.method public setOnItemClickListener(Lcom/htc/widget/HtcPopupWindowWrapper$ShareViaOnItemClickListener;)V
    .locals 0
    .parameter "shareViaClickListener"

    .prologue
    .line 510
    iput-object p1, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mShareViaOnItemClickListener:Lcom/htc/widget/HtcPopupWindowWrapper$ShareViaOnItemClickListener;

    .line 511
    return-void
.end method

.method public setTaggleView(Landroid/view/View;)V
    .locals 0
    .parameter "view"

    .prologue
    .line 114
    iput-object p1, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mTaggleView:Landroid/view/View;

    .line 115
    return-void
.end method

.method setTriangleOffset(I)V
    .locals 0
    .parameter "offset"

    .prologue
    .line 177
    iput p1, p0, Lcom/htc/widget/HtcPopupWindowWrapper;->mCustomizeTriangleOffset:I

    .line 178
    return-void
.end method

.method public showPopupWindow()V
    .locals 2

    .prologue
    .line 185
    invoke-direct {p0}, Lcom/htc/widget/HtcPopupWindowWrapper;->tryShow()Z

    move-result v0

    if-nez v0, :cond_0

    .line 186
    new-instance v0, Ljava/lang/IllegalStateException;

    const-string v1, "MenuPopupHelper cannot be used without an anchor"

    invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V

    throw v0

    .line 188
    :cond_0
    return-void
.end method


text:
import { Routes, RouterModule }  from '@angular/router';

import { Srot } from './srot.component';

// noinspection TypeScriptValidateTypes
const routes: Routes = [
  {
    path: '',
    component: Srot,
    children: [
    ]
  }
];

export const routing = RouterModule.forChild(routes);


text:
% sample from the indices 1:numel(probs) such that the probability of selecting i
% each one is approximately probs(i) (actually slightly larger due to rounding).
% Makes sure that res is nonempty.
function res=randsamplewithprob(probs)
  expectednum=sum(probs)
  res=[];
  remainingprobs=expectednum;
  gotprobs=0;
  while(gotprobs<expectednum)
    idx=find(cumsum(probs)>rand*remainingprobs);
    remainingprobs=remainingprobs-probs(idx(1));
    gotprobs=gotprobs+probs(idx(1));
    probs(idx(1))=0;
    res=[res idx(1)];
  end
end


text:
ACCEPTED

#### According to
International Plant Names Index

#### Published in
null

#### Original name
Bignonia pandorea Vent.

### Remarks
null


text:
package org.wso2.carbon.analytics.msf4j.interceptor.common;

import org.osgi.service.component.annotations.Component;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.wso2.carbon.analytics.idp.client.core.api.IdPClient;
import org.wso2.carbon.analytics.idp.client.core.exception.AuthenticationException;
import org.wso2.carbon.analytics.idp.client.core.utils.IdPClientConstants;
import org.wso2.carbon.analytics.msf4j.interceptor.common.internal.DataHolder;
import org.wso2.carbon.messaging.Headers;
import org.wso2.msf4j.Request;
import org.wso2.msf4j.Response;
import org.wso2.msf4j.interceptor.RequestInterceptor;

import java.nio.charset.Charset;
import java.util.Arrays;
import java.util.Base64;
import java.util.HashMap;
import java.util.Map;
import javax.ws.rs.core.MediaType;

/**
 * Interceptor to check authentication into sp.
 */
@Component(
        name = "Authentication-Interceptor",
        service = RequestInterceptor.class
)
public class AuthenticationInterceptor implements RequestInterceptor {
    private static final Logger LOG = LoggerFactory.getLogger(AuthenticationInterceptor.class);

    @Override
    public boolean interceptRequest(Request request, Response response) throws Exception {

        IdPClient idPClient = DataHolder.getInstance().getIdPClient();

        Headers headers = request.getHeaders();
        String authorizationHeader = request.getHeader(IdPClientConstants.AUTHORIZATION_HEADER);
        if (authorizationHeader != null) {
            String headerPrefix = authorizationHeader.split(" ")[0];
            String headerPostfix = authorizationHeader.split(" ")[1];
            if (headerPostfix != null) {
                if (headerPrefix.equalsIgnoreCase(IdPClientConstants.BEARER_PREFIX)) {
                    String cookieHeader = headers.get(IdPClientConstants.COOKIE_HEADER);
                    String partialTokenFromCookie = null;
                    if (cookieHeader != null) {
                        cookieHeader = cookieHeader.trim();
                        String[] cookies = cookieHeader.split(";");
                        String token2 = Arrays.stream(cookies)
                                .filter(name -> name.contains(IdPClientConstants.WSO2_SP_TOKEN_2))
                                .findFirst().orElse("");
                        String tokensArr[] = token2.split("=");
                        if (tokensArr.length == 2) {
                            partialTokenFromCookie = tokensArr[1];
                        }
                    }
                    String accessToken = (partialTokenFromCookie != null) ?
                            headerPostfix + partialTokenFromCookie :
                            headerPostfix;
                    return idPClient.authenticate(accessToken);
                } else if (headerPrefix.equalsIgnoreCase(IdPClientConstants.BASIC_PREFIX)) {
                    byte[] decodedAuthHeader = Base64.getDecoder().decode(headerPostfix);
                    String authHeader = new String(decodedAuthHeader, Charset.forName("UTF-8"));
                    String userName = authHeader.split(":")[0];
                    String password = authHeader.split(":")[1];
                    String appName = request.getUri().split("/\\|?")[1];

                    Map<String, String> loginProperties = new HashMap<>();
                    loginProperties.put(IdPClientConstants.APP_NAME, appName);
                    loginProperties.put(IdPClientConstants.GRANT_TYPE, IdPClientConstants.PASSWORD_GRANT_TYPE);
                    loginProperties.put(IdPClientConstants.USERNAME, userName);
                    loginProperties.put(IdPClientConstants.PASSWORD, password);
                    Map<String, String> loginValues = idPClient.login(loginProperties);

                    if (loginValues.get(IdPClientConstants.LOGIN_STATUS)
                            .equals(IdPClientConstants.LoginStatus.LOGIN_FAILURE)) {
                        LOG.error("Authentication failed for the request to : '" + request.getUri() + "' due to " +
                                "Error :'" + loginValues.get(IdPClientConstants.ERROR) + "', Error Description : '"
                                + loginValues.get(IdPClientConstants.ERROR_DESCRIPTION));
                        response.setEntity("Authentication failed for the request to : '" + request.getUri() +
                                "' due to Error :'" + loginValues.get(IdPClientConstants.ERROR) + "'," +
                                " Error Description : '" + loginValues.get(IdPClientConstants.ERROR_DESCRIPTION))
                                .setStatus(javax.ws.rs.core.Response.Status.UNAUTHORIZED.getStatusCode());
                        return false;
                    }
                    return true;
                } else {
                    LOG.error("Authorization method '" + headerPrefix + "' not supported for : '"
                            + request.getUri() + "'.");
                    response.setEntity("Authorization method '" + headerPrefix + "' not supported for : '"
                            + request.getUri() + "'. Please reset the authentication header and try again.")
                            .setStatus(javax.ws.rs.core.Response.Status.UNAUTHORIZED.getStatusCode());
                    return false;
                }
            } else {
                LOG.error("Malformed Authorization header found for request : '" + request.getUri() + "'.");
                response.setEntity("Malformed authorization header when accessing uri '" +
                        request.getUri() + "'. Please reset the authentication header and try again.")
                        .setStatus(javax.ws.rs.core.Response.Status.UNAUTHORIZED.getStatusCode());
                return false;
            }
        } else {
            LOG.error("Authorization header not found for request : '" + request.getUri() + "'");
            response.setEntity("Authorization is required to access uri '" + request.getUri() + "'. " +
                    "Please set the authentication header and try again.")
                    .setStatus(javax.ws.rs.core.Response.Status.UNAUTHORIZED.getStatusCode());
            return false;
        }
    }

    @Override
    public boolean onRequestInterceptionError(Request request, Response response, Exception e) {
        if (e instanceof AuthenticationException) {
            LOG.error("Authorization invalid for request : '" + request.getUri() + "'", e);
            response.setEntity(e.getMessage())
                    .setMediaType(MediaType.TEXT_PLAIN)
                    .setStatus(javax.ws.rs.core.Response.Status.UNAUTHORIZED.getStatusCode());
            return false;
        }
        String message = "Exception while executing request interceptor '" + this.getClass() + "' for uri : '" +
                request.getUri() + "'. Error: '" + e.getMessage() + "'";
        LOG.error(message, e);
        response.setEntity(message)
                .setMediaType(MediaType.TEXT_PLAIN)
                .setStatus(javax.ws.rs.core.Response.Status.INTERNAL_SERVER_ERROR.getStatusCode());
        return false;
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<wcs:CoverageDescriptions
    xmlns:wcs='http://www.opengis.net/wcs/2.0'
    xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
    xmlns='http://www.opengis.net/gml/3.2'
    xmlns:gml='http://www.opengis.net/gml/3.2'
    xmlns:gmlcov='http://www.opengis.net/gmlcov/1.0'
    xmlns:swe='http://www.opengis.net/swe/2.0'
    xsi:schemaLocation='http://www.opengis.net/swe/2.0 http://schemas.opengis.net/sweCommon/2.0/swe.xsd
                        http://www.opengis.net/wcs/2.0 http://schemas.opengis.net/wcs/2.0/wcsAll.xsd'>
    <wcs:CoverageDescription gml:id="CD0003">
        <gml:boundedBy>
            <gml:Envelope srsName="http://www.opengis.net/def/crs/EPSG/0/4326" axisLabels="Lat Long" srsDimension="2">
                <gml:lowerCorner>1.1 1.1</gml:lowerCorner>
                <gml:upperCorner>5.5 5.5</gml:upperCorner>
            </gml:Envelope>
        </gml:boundedBy>
        <wcs:CoverageId>C0003</wcs:CoverageId>
        <gml:domainSet>
            <gml:MultiCurve gml:id="mc0001_C0003" srsName="http://www.opengis.net/def/crs/EPSG/0/4326"/>
        </gml:domainSet>
        <gmlcov:rangeType>
            <swe:DataRecord>
                <swe:field name="Temperature">
                    <swe:Quantity definition="http://www.opengis.net/def/property/OGC/0/Temperature">
                        <swe:description>Temperature</swe:description>
                        <swe:uom code="Cel"/>
                        <swe:constraint>
                            <swe:AllowedValues>
                                <swe:interval>0 100</swe:interval>
                            </swe:AllowedValues>
                        </swe:constraint>
                    </swe:Quantity>
                </swe:field>
                <swe:field name="Pressure">
                    <swe:Quantity definition="http://www.opengis.net/def/property/OGC/0/Pressure">
                        <swe:description>pressure</swe:description>
                        <swe:uom code="HPa"/>
                    </swe:Quantity>
                </swe:field>
            </swe:DataRecord>
        </gmlcov:rangeType>
        <wcs:ServiceParameters>
            <wcs:CoverageSubtype>MultiCurveCoverage</wcs:CoverageSubtype>
            <wcs:nativeFormat>application/gml+xml</wcs:nativeFormat>
        </wcs:ServiceParameters>
    </wcs:CoverageDescription>
</wcs:CoverageDescriptions>


text:
<?xml version="1.0" encoding="UTF-8"?>
<sequence xmlns="http://ws.apache.org/ns/synapse"
          name="ErrorSeq_IfcFileCheckinResponserSeq">
   <log>
      <property xmlns:ns="http://org.apache.synapse/xsd"
                name="[BIM-EX_LOG] | Error Response"
                expression="json-eval($.)"/>
   </log>
   <property name="messageType"
             value="application/xml"
             scope="default"
             type="STRING"/>
   <payloadFactory media-type="xml">
      <format>
         <p:updateCheckinStatusById_Op xmlns:p="http://ws.wso2.org/dataservice">
            <p:status>$1</p:status>
            <p:referenceId>$2</p:referenceId>
         </p:updateCheckinStatusById_Op>
      </format>
      <args>
         <arg value="WAITING"/>
         <arg evaluator="xml" expression="get-property('IFC_REFERENCE_ID')"/>
      </args>
   </payloadFactory>
</sequence>


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Bull. Jard. Bot. Princip. de l'URSS 28(3-4): 267 (1929)

#### Original name
Cylindroroccellaceae Elenkin

### Remarks
null