text:
namespace google {
namespace type {

namespace {

const ::google::protobuf::Descriptor* Color_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
  Color_reflection_ = NULL;

}  // namespace

void protobuf_AssignDesc_google_2ftype_2fcolor_2eproto() GOOGLE_ATTRIBUTE_COLD;
void protobuf_AssignDesc_google_2ftype_2fcolor_2eproto() {
  protobuf_AddDesc_google_2ftype_2fcolor_2eproto();
  const ::google::protobuf::FileDescriptor* file =
    ::google::protobuf::DescriptorPool::generated_pool()->FindFileByName(
      "google/type/color.proto");
  GOOGLE_CHECK(file != NULL);
  Color_descriptor_ = file->message_type(0);
  static const int Color_offsets_[4] = {
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Color, red_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Color, green_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Color, blue_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Color, alpha_),
  };
  Color_reflection_ =
    ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection(
      Color_descriptor_,
      Color::internal_default_instance(),
      Color_offsets_,
      -1,
      -1,
      -1,
      sizeof(Color),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Color, _internal_metadata_));
}

namespace {

GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_);
void protobuf_AssignDescriptorsOnce() {
  ::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_,
                 &protobuf_AssignDesc_google_2ftype_2fcolor_2eproto);
}

void protobuf_RegisterTypes(const ::std::string&) GOOGLE_ATTRIBUTE_COLD;
void protobuf_RegisterTypes(const ::std::string&) {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
      Color_descriptor_, Color::internal_default_instance());
}

}  // namespace

void protobuf_ShutdownFile_google_2ftype_2fcolor_2eproto() {
  Color_default_instance_.Shutdown();
  delete Color_reflection_;
}

void protobuf_InitDefaults_google_2ftype_2fcolor_2eproto_impl() {
  GOOGLE_PROTOBUF_VERIFY_VERSION;

  ::google::protobuf::protobuf_InitDefaults_google_2fprotobuf_2fwrappers_2eproto();
  Color_default_instance_.DefaultConstruct();
  Color_default_instance_.get_mutable()->InitAsDefaultInstance();
}

GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_InitDefaults_google_2ftype_2fcolor_2eproto_once_);
void protobuf_InitDefaults_google_2ftype_2fcolor_2eproto() {
  ::google::protobuf::GoogleOnceInit(&protobuf_InitDefaults_google_2ftype_2fcolor_2eproto_once_,
                 &protobuf_InitDefaults_google_2ftype_2fcolor_2eproto_impl);
}
void protobuf_AddDesc_google_2ftype_2fcolor_2eproto_impl() {
  GOOGLE_PROTOBUF_VERIFY_VERSION;

  protobuf_InitDefaults_google_2ftype_2fcolor_2eproto();
  ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
    "\n\027google/type/color.proto\022\013google.type\032\036"
    "google/protobuf/wrappers.proto\"]\n\005Color\022"
    "\013\n\003red\030\001 \001(\002\022\r\n\005green\030\002 \001(\002\022\014\n\004blue\030\003 \001("
    "\002\022*\n\005alpha\030\004 \001(\0132\033.google.protobuf.Float"
    "ValueB]\n\017com.google.typeB\nColorProtoP\001Z6"
    "google.golang.org/genproto/googleapis/ty"
    "pe/color;color\242\002\003GTPb\006proto3", 268);
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
    "google/type/color.proto", &protobuf_RegisterTypes);
  ::google::protobuf::protobuf_AddDesc_google_2fprotobuf_2fwrappers_2eproto();
  ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_google_2ftype_2fcolor_2eproto);
}

GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AddDesc_google_2ftype_2fcolor_2eproto_once_);
void protobuf_AddDesc_google_2ftype_2fcolor_2eproto() {
  ::google::protobuf::GoogleOnceInit(&protobuf_AddDesc_google_2ftype_2fcolor_2eproto_once_,
                 &protobuf_AddDesc_google_2ftype_2fcolor_2eproto_impl);
}
// Force AddDescriptors() to be called at static initialization time.
struct StaticDescriptorInitializer_google_2ftype_2fcolor_2eproto {
  StaticDescriptorInitializer_google_2ftype_2fcolor_2eproto() {
    protobuf_AddDesc_google_2ftype_2fcolor_2eproto();
  }
} static_descriptor_initializer_google_2ftype_2fcolor_2eproto_;

namespace {

static void MergeFromFail(int line) GOOGLE_ATTRIBUTE_COLD GOOGLE_ATTRIBUTE_NORETURN;
static void MergeFromFail(int line) {
  ::google::protobuf::internal::MergeFromFail(__FILE__, line);
}

}  // namespace

// ===================================================================

#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int Color::kRedFieldNumber;
const int Color::kGreenFieldNumber;
const int Color::kBlueFieldNumber;
const int Color::kAlphaFieldNumber;
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900

Color::Color()
  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  if (this != internal_default_instance()) protobuf_InitDefaults_google_2ftype_2fcolor_2eproto();
  SharedCtor();
  // @@protoc_insertion_point(constructor:google.type.Color)
}

void Color::InitAsDefaultInstance() {
  alpha_ = const_cast< ::google::protobuf::FloatValue*>(
      ::google::protobuf::FloatValue::internal_default_instance());
}

Color::Color(const Color& from)
  : ::google::protobuf::Message(),
    _internal_metadata_(NULL) {
  SharedCtor();
  UnsafeMergeFrom(from);
  // @@protoc_insertion_point(copy_constructor:google.type.Color)
}

void Color::SharedCtor() {
  alpha_ = NULL;
  ::memset(&red_, 0, reinterpret_cast<char*>(&blue_) -
    reinterpret_cast<char*>(&red_) + sizeof(blue_));
  _cached_size_ = 0;
}

Color::~Color() {
  // @@protoc_insertion_point(destructor:google.type.Color)
  SharedDtor();
}

void Color::SharedDtor() {
  if (this != &Color_default_instance_.get()) {
    delete alpha_;
  }
}

void Color::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* Color::descriptor() {
  protobuf_AssignDescriptorsOnce();
  return Color_descriptor_;
}

const Color& Color::default_instance() {
  protobuf_InitDefaults_google_2ftype_2fcolor_2eproto();
  return *internal_default_instance();
}

::google::protobuf::internal::ExplicitlyConstructed<Color> Color_default_instance_;

Color* Color::New(::google::protobuf::Arena* arena) const {
  Color* n = new Color;
  if (arena != NULL) {
    arena->Own(n);
  }
  return n;
}

void Color::Clear() {
// @@protoc_insertion_point(message_clear_start:google.type.Color)
#if defined(__clang__)
#define ZR_HELPER_(f) \
  _Pragma("clang diagnostic push") \
  _Pragma("clang diagnostic ignored \"-Winvalid-offsetof\"") \
  __builtin_offsetof(Color, f) \
  _Pragma("clang diagnostic pop")
#else
#define ZR_HELPER_(f) reinterpret_cast<char*>(\
  &reinterpret_cast<Color*>(16)->f)
#endif

#define ZR_(first, last) do {\
  ::memset(&(first), 0,\
           ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\
} while (0)

  ZR_(red_, blue_);
  if (GetArenaNoVirtual() == NULL && alpha_ != NULL) delete alpha_;
  alpha_ = NULL;

#undef ZR_HELPER_
#undef ZR_

}

bool Color::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;
  // @@protoc_insertion_point(parse_start:google.type.Color)
  for (;;) {
    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
    tag = p.first;
    if (!p.second) goto handle_unusual;
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // optional float red = 1;
      case 1: {
        if (tag == 13) {

          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
                 input, &red_)));
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(21)) goto parse_green;
        break;
      }

      // optional float green = 2;
      case 2: {
        if (tag == 21) {
         parse_green:

          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
                 input, &green_)));
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(29)) goto parse_blue;
        break;
      }

      // optional float blue = 3;
      case 3: {
        if (tag == 29) {
         parse_blue:

          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
                 input, &blue_)));
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(34)) goto parse_alpha;
        break;
      }

      // optional .google.protobuf.FloatValue alpha = 4;
      case 4: {
        if (tag == 34) {
         parse_alpha:
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
               input, mutable_alpha()));
        } else {
          goto handle_unusual;
        }
        if (input->ExpectAtEnd()) goto success;
        break;
      }

      default: {
      handle_unusual:
        if (tag == 0 ||
            ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
          goto success;
        }
        DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag));
        break;
      }
    }
  }
success:
  // @@protoc_insertion_point(parse_success:google.type.Color)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:google.type.Color)
  return false;
#undef DO_
}

void Color::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:google.type.Color)
  // optional float red = 1;
  if (this->red() != 0) {
    ::google::protobuf::internal::WireFormatLite::WriteFloat(1, this->red(), output);
  }

  // optional float green = 2;
  if (this->green() != 0) {
    ::google::protobuf::internal::WireFormatLite::WriteFloat(2, this->green(), output);
  }

  // optional float blue = 3;
  if (this->blue() != 0) {
    ::google::protobuf::internal::WireFormatLite::WriteFloat(3, this->blue(), output);
  }

  // optional .google.protobuf.FloatValue alpha = 4;
  if (this->has_alpha()) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      4, *this->alpha_, output);
  }

  // @@protoc_insertion_point(serialize_end:google.type.Color)
}

::google::protobuf::uint8* Color::InternalSerializeWithCachedSizesToArray(
    bool deterministic, ::google::protobuf::uint8* target) const {
  (void)deterministic; // Unused
  // @@protoc_insertion_point(serialize_to_array_start:google.type.Color)
  // optional float red = 1;
  if (this->red() != 0) {
    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(1, this->red(), target);
  }

  // optional float green = 2;
  if (this->green() != 0) {
    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(2, this->green(), target);
  }

  // optional float blue = 3;
  if (this->blue() != 0) {
    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(3, this->blue(), target);
  }

  // optional .google.protobuf.FloatValue alpha = 4;
  if (this->has_alpha()) {
    target = ::google::protobuf::internal::WireFormatLite::
      InternalWriteMessageNoVirtualToArray(
        4, *this->alpha_, false, target);
  }

  // @@protoc_insertion_point(serialize_to_array_end:google.type.Color)
  return target;
}

size_t Color::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:google.type.Color)
  size_t total_size = 0;

  // optional float red = 1;
  if (this->red() != 0) {
    total_size += 1 + 4;
  }

  // optional float green = 2;
  if (this->green() != 0) {
    total_size += 1 + 4;
  }

  // optional float blue = 3;
  if (this->blue() != 0) {
    total_size += 1 + 4;
  }

  // optional .google.protobuf.FloatValue alpha = 4;
  if (this->has_alpha()) {
    total_size += 1 +
      ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
        *this->alpha_);
  }

  int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = cached_size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
  return total_size;
}

void Color::MergeFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:google.type.Color)
  if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__);
  const Color* source =
      ::google::protobuf::internal::DynamicCastToGenerated<const Color>(
          &from);
  if (source == NULL) {
  // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.type.Color)
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
  // @@protoc_insertion_point(generalized_merge_from_cast_success:google.type.Color)
    UnsafeMergeFrom(*source);
  }
}

void Color::MergeFrom(const Color& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:google.type.Color)
  if (GOOGLE_PREDICT_TRUE(&from != this)) {
    UnsafeMergeFrom(from);
  } else {
    MergeFromFail(__LINE__);
  }
}

void Color::UnsafeMergeFrom(const Color& from) {
  GOOGLE_DCHECK(&from != this);
  if (from.red() != 0) {
    set_red(from.red());
  }
  if (from.green() != 0) {
    set_green(from.green());
  }
  if (from.blue() != 0) {
    set_blue(from.blue());
  }
  if (from.has_alpha()) {
    mutable_alpha()->::google::protobuf::FloatValue::MergeFrom(from.alpha());
  }
}

void Color::CopyFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:google.type.Color)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void Color::CopyFrom(const Color& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:google.type.Color)
  if (&from == this) return;
  Clear();
  UnsafeMergeFrom(from);
}

bool Color::IsInitialized() const {

  return true;
}

void Color::Swap(Color* other) {
  if (other == this) return;
  InternalSwap(other);
}
void Color::InternalSwap(Color* other) {
  std::swap(red_, other->red_);
  std::swap(green_, other->green_);
  std::swap(blue_, other->blue_);
  std::swap(alpha_, other->alpha_);
  _internal_metadata_.Swap(&other->_internal_metadata_);
  std::swap(_cached_size_, other->_cached_size_);
}

::google::protobuf::Metadata Color::GetMetadata() const {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::Metadata metadata;
  metadata.descriptor = Color_descriptor_;
  metadata.reflection = Color_reflection_;
  return metadata;
}

#if PROTOBUF_INLINE_NOT_IN_HEADERS
// Color

// optional float red = 1;
void Color::clear_red() {
  red_ = 0;
}
float Color::red() const {
  // @@protoc_insertion_point(field_get:google.type.Color.red)
  return red_;
}
void Color::set_red(float value) {

  red_ = value;
  // @@protoc_insertion_point(field_set:google.type.Color.red)
}

// optional float green = 2;
void Color::clear_green() {
  green_ = 0;
}
float Color::green() const {
  // @@protoc_insertion_point(field_get:google.type.Color.green)
  return green_;
}
void Color::set_green(float value) {

  green_ = value;
  // @@protoc_insertion_point(field_set:google.type.Color.green)
}

// optional float blue = 3;
void Color::clear_blue() {
  blue_ = 0;
}
float Color::blue() const {
  // @@protoc_insertion_point(field_get:google.type.Color.blue)
  return blue_;
}
void Color::set_blue(float value) {

  blue_ = value;
  // @@protoc_insertion_point(field_set:google.type.Color.blue)
}

// optional .google.protobuf.FloatValue alpha = 4;
bool Color::has_alpha() const {
  return this != internal_default_instance() && alpha_ != NULL;
}
void Color::clear_alpha() {
  if (GetArenaNoVirtual() == NULL && alpha_ != NULL) delete alpha_;
  alpha_ = NULL;
}
const ::google::protobuf::FloatValue& Color::alpha() const {
  // @@protoc_insertion_point(field_get:google.type.Color.alpha)
  return alpha_ != NULL ? *alpha_
                         : *::google::protobuf::FloatValue::internal_default_instance();
}
::google::protobuf::FloatValue* Color::mutable_alpha() {

  if (alpha_ == NULL) {
    alpha_ = new ::google::protobuf::FloatValue;
  }
  // @@protoc_insertion_point(field_mutable:google.type.Color.alpha)
  return alpha_;
}
::google::protobuf::FloatValue* Color::release_alpha() {
  // @@protoc_insertion_point(field_release:google.type.Color.alpha)

  ::google::protobuf::FloatValue* temp = alpha_;
  alpha_ = NULL;
  return temp;
}
void Color::set_allocated_alpha(::google::protobuf::FloatValue* alpha) {
  delete alpha_;
  if (alpha != NULL && alpha->GetArena() != NULL) {
    ::google::protobuf::FloatValue* new_alpha = new ::google::protobuf::FloatValue;
    new_alpha->CopyFrom(*alpha);
    alpha = new_alpha;
  }
  alpha_ = alpha;
  if (alpha) {

  } else {

  }
  // @@protoc_insertion_point(field_set_allocated:google.type.Color.alpha)
}

inline const Color* Color::internal_default_instance() {
  return &Color_default_instance_.get();
}
#endif  // PROTOBUF_INLINE_NOT_IN_HEADERS

// @@protoc_insertion_point(namespace_scope)

}  // namespace type
}  // namespace google

// @@protoc_insertion_point(global_scope)


text:
/**
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*     http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License
*/

#include <algorithm>
#include <string>

#include <gmock/gmock.h>

#include <stout/gtest.hpp>
#include <stout/none.hpp>
#include <stout/option.hpp>

using std::string;

TEST(OptionTest, Min)
{
  Option<int> none1 = None();
  Option<int> none2 = None();
  Option<int> value1 = 10;
  Option<int> value2 = 20;
  int value3 = 15;

  Option<int> result = min(none1, none2);
  ASSERT_NONE(result);

  result = min(none1, value1);
  ASSERT_SOME(result);
  EXPECT_EQ(10, result.get());

  result = min(value2, none2);
  ASSERT_SOME(result);
  EXPECT_EQ(20, result.get());

  result = min(value1, value2);
  ASSERT_SOME(result);
  EXPECT_EQ(10, result.get());

  result = min(none1, value3);
  ASSERT_SOME(result);
  EXPECT_EQ(15, result.get());

  result = min(value3, value1);
  ASSERT_SOME(result);
  EXPECT_EQ(10, result.get());
}

TEST(OptionTest, Max)
{
  Option<int> none1 = None();
  Option<int> none2 = None();
  Option<int> value1 = 10;
  Option<int> value2 = 20;
  int value3 = 15;

  Option<int> result = max(none1, none2);
  ASSERT_NONE(result);

  result = max(none1, value1);
  ASSERT_SOME(result);
  EXPECT_EQ(10, result.get());

  result = max(value2, none2);
  ASSERT_SOME(result);
  EXPECT_EQ(20, result.get());

  result = max(value1, value2);
  ASSERT_SOME(result);
  EXPECT_EQ(20, result.get());

  result = max(none1, value3);
  ASSERT_SOME(result);
  EXPECT_EQ(15, result.get());

  result = max(value3, value2);
  ASSERT_SOME(result);
  EXPECT_EQ(20, result.get());
}

TEST(OptionTest, Comparison)
{
  Option<int> none = None();
  EXPECT_NE(none, 1);
  EXPECT_FALSE(none == 1);

  Option<int> one = 1;
  EXPECT_EQ(one, 1);
  EXPECT_NE(none, one);
  EXPECT_FALSE(none == one);
  EXPECT_EQ(one, Option<int>::some(1));

  Option<int> two = 2;
  EXPECT_NE(one, two);

  Option<Option<int> > someNone = Option<Option<int> >::some(None());
  Option<Option<int> > noneNone = Option<Option<int> >::none();
  EXPECT_NE(someNone, noneNone);
  EXPECT_NE(noneNone, someNone);
}

TEST(OptionTest, NonConstReference)
{
  Option<string> s = string("hello");
  s.get() += " world";
  EXPECT_EQ("hello world", s.get());
}

TEST(OptionTest, ArrowOperator)
{
  Option<string> s = string("hello");
  EXPECT_EQ(5u, s->size());

  s->clear();
  EXPECT_TRUE(s->empty());
}

struct NonCopyable
{
  NonCopyable() = default;
  NonCopyable(NonCopyable&&) = default;
  NonCopyable(const NonCopyable& that) = delete;
};

TEST(OptionTest, NonCopyable)
{
  Option<NonCopyable> o1(NonCopyable{});
  ASSERT_SOME(o1);

  o1 = NonCopyable();
  ASSERT_SOME(o1);

  o1 = None();
  ASSERT_NONE(o1);

  Option<NonCopyable> o2 = NonCopyable();
  ASSERT_SOME(o2);

  o2 = NonCopyable();
  ASSERT_SOME(o2);

  o2 = None();
  ASSERT_NONE(o2);

  Option<NonCopyable> o3 = None();
  ASSERT_NONE(o3);

  Option<NonCopyable> o4 = Some(NonCopyable());
  ASSERT_SOME(o4);

  o4 = Some(NonCopyable());
  ASSERT_SOME(o4);
}

TEST(OptionTest, GetOrElse)
{
  Option<string> something = string("Something");
  Option<string> none = None();
  EXPECT_EQ("Something", something.getOrElse("Else"));
  EXPECT_EQ("Else", none.getOrElse("Else"));
}

redpajama_set_name: RedPajamaGithub


text:
module Citrus
  module Web
    class CreateBuild

      takes :builds_repository, :build_queue

      def call(changeset)
        build  = builds_repository.create_build(changeset, Core::TestOutput.new)
        build_queue.push(build)
      end

    end
  end
end


text:
namespace oo

alias throw="__EXCEPTION_TYPE__=\${e:-Manually invoked} command_not_found_handle"

command_not_found_handle() {
    # USE DEFAULT IFS IN CASE IT WAS CHANGED - important!
    local IFS=$' \t\n'

    # ignore the error from the catch subshell itself
    if [[ "$*" = '( set -e; true'* ]]
    then
        return 0
    fi

    local script="${BASH_SOURCE[1]#./}"
    local lineNo="${BASH_LINENO[0]}"
    local undefinedObject="$*"
    local type="${__EXCEPTION_TYPE__:-"Undefined command"}"

    if [[ "$undefinedObject" == "("*")" ]]
    then
        type="Subshell returned a non-zero value"
    fi

    if [[ -z "$undefinedObject" ]]
    then
        undefinedObject="$type"
    fi

    if [[ $__oo__insideTryCatch -gt 0 ]]
    then
        subject=level3 Log "inside Try No.: $__oo__insideTryCatch"

        if [[ ! -s $__oo__storedExceptionLineFile ]]; then
            echo "$lineNo" > $__oo__storedExceptionLineFile
        fi
        if [[ ! -s $__oo__storedExceptionFile ]]; then
            echo "$undefinedObject" > $__oo__storedExceptionFile
        fi
        if [[ ! -s $__oo__storedExceptionSourceFile ]]; then
            echo "$script" > $__oo__storedExceptionSourceFile
        fi
        if [[ ! -s $__oo__storedExceptionBacktraceFile ]]; then
            Exception.DumpBacktrace 2 > $__oo__storedExceptionBacktraceFile
        fi

        return 1 # needs to be return 1
    fi

    if [[ $BASH_SUBSHELL -ge 25 ]]
    then
        echo "ERROR: Call stack exceeded (25)."
        Exception.ContinueOrBreak || exit 1
    fi

    local -a exception=( "$lineNo" "$undefinedObject" "$script" )

    local IFS=$'\n'
    for traceElement in $(Exception.DumpBacktrace 2)
    do
        exception+=( "$traceElement" )
    done
    IFS=$' \t\n'

    Console.WriteStdErr
    Console.WriteStdErr " $(UI.Color.Red)$(UI.Powerline.Fail) $(UI.Color.Bold)UNCAUGHT EXCEPTION: $(UI.Color.LightRed)${type}$(UI.Color.Default)"
    Exception.PrintException "${exception[@]}"

    Exception.ContinueOrBreak
}

Exception.SetupTemp() {
    declare -g __oo__storedExceptionLineFile="$(mktemp -t stored_exception_line.$$.XXXXXXXXXX)"
    declare -g __oo__storedExceptionSourceFile="$(mktemp -t stored_exception_source.$$.XXXXXXXXXX)"
    declare -g __oo__storedExceptionBacktraceFile="$(mktemp -t stored_exception_backtrace.$$.XXXXXXXXXX)"
    declare -g __oo__storedExceptionFile="$(mktemp -t stored_exception.$$.XXXXXXXXXX)"
}

Exception.SetupTemp

Exception.CleanUp() {
    rm -f $__oo__storedExceptionLineFile $__oo__storedExceptionSourceFile $__oo__storedExceptionBacktraceFile $__oo__storedExceptionFile || exit 1
    exit 0
}

Exception.ResetStore() {
    > $__oo__storedExceptionLineFile
    > $__oo__storedExceptionFile
    > $__oo__storedExceptionSourceFile
    > $__oo__storedExceptionBacktraceFile
}

trap Exception.CleanUp EXIT INT TERM

Exception.GetLastException() {
    if [[ -s $__oo__storedExceptionFile ]]
    then
        cat $__oo__storedExceptionLineFile
        cat $__oo__storedExceptionFile
        cat $__oo__storedExceptionSourceFile
        cat $__oo__storedExceptionBacktraceFile

        Exception.ResetStore
    else
        echo -e "${BASH_LINENO[1]}\n \n${BASH_SOURCE[2]#./}"
    fi
}

Exception.PrintException() {
    @params exception

    local -i backtraceIndentationLevel=${backtraceIndentationLevel:-0}

    local -i counter=0
    local -i backtraceNo=0

    local -a backtraceLine
    local -a backtraceCommand
    local -a backtraceFile

    #for traceElement in Exception.GetLastException
    while [[ $counter -lt ${#exception[@]} ]]
    do
        backtraceLine[$backtraceNo]="${exception[$counter]}"
        counter+=1
        backtraceCommand[$backtraceNo]="${exception[$counter]}"
        counter+=1
        backtraceFile[$backtraceNo]="${exception[$counter]}"
        counter+=1

        backtraceNo+=1
    done

    local -i index=1

    while [[ $index -lt $backtraceNo ]]
    do
        Console.WriteStdErr "$(Exception.FormatExceptionSegment "${backtraceFile[$index]}" "${backtraceLine[$index]}" "${backtraceCommand[($index - 1)]}" $(( $index + $backtraceIndentationLevel )) )"
        index+=1
    done
}

Exception.CanHighlight() {
    @var errLine
    @var stringToMark

    local stringToMarkWithoutSlash="$(String.ReplaceSlashes "$stringToMark")"
    errLine="$(String.ReplaceSlashes "$errLine")"

    if [[ "$errLine" == *"$stringToMarkWithoutSlash"* ]]
    then
        return 0
    else
        return 1
    fi
}

Exception.HighlightPart() {
    @var errLine
    @var stringToMark

    # Workaround for a Bash bug that causes string replacement to fail when a \ is in the string
    local stringToMarkWithoutSlash="$(String.ReplaceSlashes "$stringToMark")"
    errLine="$(String.ReplaceSlashes "$errLine")"

    local underlinedObject="$(Exception.GetUnderlinedPart "$stringToMark")"
    local underlinedObjectInLine="${errLine/$stringToMarkWithoutSlash/$underlinedObject}"

    # Bring back the slash:
    underlinedObjectInLine="$(String.BringBackSlashes "$underlinedObjectInLine")"

    # Trimming:
    underlinedObjectInLine="${underlinedObjectInLine#"${underlinedObjectInLine%%[![:space:]]*}"}" # "

	echo "$underlinedObjectInLine"
}

Exception.GetUnderlinedPart() {
    @var stringToMark

    echo "$(UI.Color.LightGreen)$(UI.Powerline.RefersTo) $(UI.Color.Magenta)$(UI.Color.Underline)$stringToMark$(UI.Color.White)$(UI.Color.NoUnderline)"
}

Exception.FormatExceptionSegment() {
    @var script
    @int lineNo
    @var stringToMark
    @int callPosition=1

    local errLine="$(sed "${lineNo}q;d" "$script")"
    local originalErrLine="$errLine"

    local -i linesTried=0

    # In case it's a multiline eval, sometimes bash gives a line that's offset by a few
    while [[ $linesTried -lt 5 && $lineNo -gt 0 ]] && ! Exception.CanHighlight "$errLine" "$stringToMark"
    do
        linesTried+=1
        lineNo+=-1
        errLine="$(sed "${lineNo}q;d" "$script")"
    done

    # Cut out the path, leave the script name
    script="${script##*/}"

    local prefix="   $(UI.Powerline.Branch)$(String.GetXSpaces $(($callPosition * 3 - 3)) || true) "

    if [[ $linesTried -ge 5 ]]
    then
        # PRINT THE ORGINAL OBJECT AND ORIGINAL LINE #
        #local underlinedObject="$(Exception.HighlightPart "$errLine" "$stringToMark")"
        local underlinedObject="$(Exception.GetUnderlinedPart "$stringToMark")"
        echo "${prefix}$(UI.Color.White)${underlinedObject}$(UI.Color.Default) [$(UI.Color.Blue)${script}:${lineNo}$(UI.Color.Default)]"
        prefix="$prefix$(UI.Powerline.Fail) "
        errLine="$originalErrLine"
    fi

    local underlinedObjectInLine="$(Exception.HighlightPart "$errLine" "$stringToMark")"

    echo "${prefix}$(UI.Color.White)${underlinedObjectInLine}$(UI.Color.Default) [$(UI.Color.Blue)${script}:${lineNo}$(UI.Color.Default)]"
}

Exception.ContinueOrBreak()
{
    ## TODO: Exceptions that happen in commands that are piped to others do not HALT the execution
    ## TODO: Add a workaround for this ^

    # if in a terminal
    if [ -t 0 ]
    then
        Console.WriteStdErr
        Console.WriteStdErr " $(UI.Color.Yellow)$(UI.Powerline.Lightning)$(UI.Color.White) Press $(UI.Color.Bold)[CTRL+C]$(UI.Color.White) to exit or $(UI.Color.Bold)[Return]$(UI.Color.White) to continue execution."
        read -s
        Console.WriteStdErr " $(UI.Color.Blue)$(UI.Powerline.Cog)$(UI.Color.White) Continuing...$(UI.Color.Default)"
        return 0
        Console.WriteStdErr
    else
        Console.WriteStdErr
        exit 1
    fi
}

Exception.DumpBacktrace()
{
    @int startFrom=1
    # inspired by: http://stackoverflow.com/questions/64786/error-handling-in-bash

    # USE DEFAULT IFS IN CASE IT WAS CHANGED - important!
    local IFS=$' \t\n'

    local -i i=0

    while caller $i > /dev/null
    do
        if (( $i + 1 >= $startFrom ))
        then
            local -a trace=( $(caller $i) )

            echo "${trace[0]}"
            echo "${trace[1]}"
            echo "${trace[@]:2}"
        fi
        i+=1
    done
}


text:
package com.tecnoguru.scuby

import org.specs2.mutable.Specification

import JRuby._

class BasicSpec extends Specification {
  sequential

  "Scuby" should {
    "evaluate ruby code" in {
      eval[Long]("1 + 1") === 2
    }

    "send methods to Ruby objects" in {
      val array1 = evalRuby("[1,2,3]")
      val length = array1.send[Long]('length)
      length === 3
    }

    "send methods to Ruby objects when the method exists" in {
      val array1 = evalRuby("[1,2,3]")
      val length = array1.sendOpt[Long]('length)
      length === Some(3)
    }

    "Forward equals to ==" in {
      val array1 = evalRuby("[1, 2, 3]")
      val array2 = evalRuby("[1, 2, 3]")
      array1 === array2
    }

    "create Ruby objects of a given class with new RubyObject" in {
      val array1 = evalRuby("[]")
      val array2 = new RubyObject('Array)
      array1 === array2
    }

    "create Ruby objects of a given class with RubyClass" in {
      val array1 = evalRuby("[]")
      val array2 = RubyClass('Array) ! 'new
      array1 === array2
    }

    "create Ruby Symbols" in {
      val sym = evalRuby(":foo")
      %('foo) === sym
    }

    "implicitly convert Scala symbols to Ruby symbols" in {
      val sym = evalRuby(":foo")
      val sym2: RubyObj = 'foo
      sym === sym2
    }

    "forward require to Ruby" in {
      require("test.rb")
      val array1: RubyObj = evalRuby("[]")
      val array2: RubyObj = evalRuby("get_empty_array")
      array1 === array2
    }

    "get a reference to a Ruby Class object using RubyClass" in {
      require("test.rb")
      val testClass = RubyClass("TestModule::Inner::Test")
      testClass.send[String]('name) === "TestModule::Inner::Test"
      (testClass ! 'class).send[String]('name) === "Class"
    }

    "get a reference to a Ruby module and call a method" in {
      require("test.rb")
      val module = RubyModule("TestModule::Inner")
      module.send[String]('test) === "Testing module method"
    }

    "throw an exception if a Ruby class doesn't exist" in {
      require("test.rb")
      RubyClass("TestModule::Foo") must throwA[IllegalArgumentException]
    }

    "be able to check if a Ruby object is of a given class" in {
      val array = evalRuby("[]")
      array.isA_?('Array) must beTrue
      array.isA_?('Hash) must beFalse
      array.isA_?('Object) must beTrue
    }

    "be able to check if a Ruby object responds to a method" in {
      val array = evalRuby("[]")
      array.respondTo_?('length) must beTrue
      array.respondTo_?('foo) must beFalse
      array.respondTo_?("[]") must beTrue
    }

    "retrieve Ruby Array elements with parentheses" in {
      val array1 = evalRuby("['foo','bar','baz']")
      array1(0) === "foo"
      array1(1) === "bar"
      array1(2) === "baz"
    }

    "retrieve Ruby Hash elements with parentheses" in {
      val hash = evalRuby("{ :foo => 1, :bar => 2, :baz => 3 }")
      hash('foo) === 1
    }

    "chain Hash calls" in {
      val hash = evalRuby(
                           """{ :foo => {:x => 'foo x', :y => 'foo y'},
                                :bar => {:x => 'bar x', :y => 'bar y'},
                                :baz => {:x => 'baz x', :y => 'baz y'} }""")
      hash('foo, 'x) === "foo x"
      hash('bar, 'y) === "bar y"
    }
  }
}


text:
<?php

use yii\db\Migration;

class m171004_005025_init extends Migration
{
    public function up()
    {
        // SerializeBehavior
        // SerializeProxyBehavior
        $this->createTable('news', [
            'id' => $this->primaryKey(),
            'title' => $this->string(),
            '_data' => $this->text(),
            '_tags' => $this->text(),
            '_options' => $this->text(),
        ]);

        // PushBehavior
        $this->createTable('user', [
            'id' => $this->primaryKey(),
            'login' => $this->string()->notNull(),
            'first_name' => $this->string()->notNull(),
            'last_name' => $this->string(),
            'created_at' => $this->integer()->notNull(),
            'updated_at' => $this->integer()->notNull(),
            'last_login' => $this->integer(),
            'company_id' => $this->integer(),
        ]);

        // hasOne
        $this->createTable('user_profile', [
            'user_id' => $this->primaryKey(),
            'birthday' => $this->integer(),
        ]);

        // hasOne
        $this->createTable('user_email', [
            'user_id' => $this->primaryKey(),
            'email' => $this->string(),
        ]);

        // hasMany
        $this->createTable('user_phone', [
            'id' => $this->primaryKey(),
            'user_id' => $this->integer()->notNull(),
            'type' => $this->string()->notNull(),
            'phone' => $this->string()->notNull(),
        ]);

        // push to many relations
        $this->createTable('company', [
            'id' => $this->primaryKey(),
            'name' => $this->string()->notNull(),
        ]);

        $this->createTable('api_user', [
            'id' => $this->primaryKey(),
            'user_login' => $this->string()->notNull(),
            'fio' => $this->string()->notNull(),
            'createdAt' => $this->integer()->notNull(),
            'updatedAt' => $this->integer()->notNull(),
            'lastLogin' => $this->integer(),
            'birthday' => $this->integer(),
            'phones' => $this->string()->defaultValue('[]'),
            'email' => $this->string(),
            'company_id' => $this->integer(),
            'company_name' => $this->string(),
        ]);

        // PushModelBehavior
        $this->createTable('push_model', [
            'id' => $this->primaryKey(),
            'username' => $this->string(),
        ]);
        $this->createTable('target_model', [
            'id' => $this->primaryKey(),
            'username' => $this->string(),
        ]);
    }
}


text:
package org.ukiuni.opendataja4j.entity;

import java.util.Map;

public class InformationHeader {
	private String id;
	private String name;
	private Map<String, Information> informationMap;

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Map<String, Information> getInformationMap() {
		return informationMap;
	}

	public void setInformationMap(Map<String, Information> informationMap) {
		this.informationMap = informationMap;
	}
}


text:
package ericminio.firebase;

import ericminio.data.GameRepository;
import ericminio.data.UserRepository;
import org.junit.Before;
import org.junit.Test;

import java.util.Arrays;
import java.util.List;

import static org.hamcrest.CoreMatchers.equalTo;
import static org.junit.Assert.assertThat;

public class DeleteNewsTest {

    private Firebase database;
    private String url = "https://sandbox-5f095.firebaseio.com/";

    @Before
    public void givenOurDatabase() throws Exception {
        database = new Firebase(url);
        database.delete("games");
        database.save(new Entry("games/" + System.currentTimeMillis(), "{\"name\":\"Monopoly\"}"));
        database.save(new Entry("games/" + System.currentTimeMillis(), "{\"name\":\"Chess\"}"));
        database.save(new Entry("games/" + System.currentTimeMillis(), "{\"name\":\"Tarot\"}"));
        database.save(new Entry("games/" + System.currentTimeMillis(), "{\"name\":\"Black Jack\"}"));
        database.delete("users");
        database.save(new Entry("users/" + System.currentTimeMillis(), "{\"name\":\"Alice\"}"));
        database.save(new Entry("users/" + System.currentTimeMillis(), "{\"name\":\"Eric\"}"));
        database.save(new Entry("users/" + System.currentTimeMillis(), "{\"name\":\"Galak\"}"));
    }

    @Test
    public void someGamesExists() throws Exception {
        GameRepository storage = new FirebaseRepository(database);
        List<String> names = storage.allGames();

        assertThat(names, equalTo(Arrays.asList("Monopoly", "Chess", "Tarot", "Black Jack")));
    }

    @Test
    public void someUsersExists() throws Exception {
        UserRepository storage = new FirebaseRepository(database);
        List<String> names = storage.allUsers();

        assertThat(names, equalTo(Arrays.asList("Alice", "Eric", "Galak")));
    }
}


text:
package com.dci.intellij.dbn.data.find.action;

import com.dci.intellij.dbn.data.find.DataSearchComponent;
import com.intellij.find.FindSettings;
import com.intellij.openapi.actionSystem.AnActionEvent;

public class ToggleWholeWordsOnlyAction extends DataSearchHeaderToggleAction {
    public ToggleWholeWordsOnlyAction(DataSearchComponent searchComponent) {
        super(searchComponent, "W&hole Words");
    }

    @Override
    public boolean isSelected(AnActionEvent e) {
        return getEditorSearchComponent().getFindModel().isWholeWordsOnly();
    }

    @Override
    public void update(AnActionEvent e) {
        super.update(e);
        e.getPresentation().setEnabled(!getEditorSearchComponent().getFindModel().isRegularExpressions());
        e.getPresentation().setVisible(true);
    }

    @Override
    public void setSelected(AnActionEvent e, boolean state) {
        FindSettings.getInstance().setLocalWholeWordsOnly(state);
        getEditorSearchComponent().getFindModel().setWholeWordsOnly(state);
    }
}


text:
package view

import (
	"fmt"
)

func ViewFail(value string) {
	fmt.Print("Content-Type: text/plain\n\n")
	fmt.Println("Error " + value)
}

func AccessStore() error {
	return nil
}


text:
// <copyright file="MetaMedia.cs" company="Logikfabrik">
//   Copyright (c) 2015 anton(at)logikfabrik.se. Licensed under the MIT license.
// </copyright>

namespace Logikfabrik.Umbraco.Jet.Social.Web.Models
{
    /// <summary>
    /// The <see cref="MetaMedia" /> class. Class for including meta data on API calls.
    /// </summary>
    /// <seealso cref="Media.Media" />
    public class MetaMedia : Media.Media
    {
        /// <summary>
        /// Gets or sets the name.
        /// </summary>
        /// <value>
        /// The name.
        /// </value>
        public string Name { get; set; }

        /// <summary>
        /// Gets or sets the URL.
        /// </summary>
        /// <value>
        /// The URL.
        /// </value>
        public string Url { get; set; }
    }
}


text:
Meteor.startup(function() {
	Router.map(function() {
		this.route('about', {
			path: '/about',
			template: getTemplate('aboutPage')
		});
	});
});

heroModules.push({
 				 template: 'heroPage'
});

Meteor.startup(function () {
  Template[getTemplate('heroPage')].helpers({
    hasCategories: function(){
      return typeof Categories !== 'undefined' && Categories.find().count();
    },
    cat: function () {
      return __('categories')
    },
    categories: function(){
      return Categories.find({}, {sort: {order: 1, name: 1}});
    },
    categoryLink: function () {
      return getCategoryUrl(this.slug);
    }
  });
});

getCategoryUrl = function(slug){
  return getSiteUrl()+'category/'+slug;
};

/*Template Overrides*/
templates["postDomain"] = "newPostDomain";
templates["postUpvote"] = "newPostUpvote";
templates["post_page"] = "new_post_page";
templates["postTitle"] = "newPostTitle";
templates["postAuthor"] = "newPostAuthor";
templates["postInfo"] = "newPostInfo";
templates["submitButton"] = "newSubmitButton";

// var i = primaryNav.indexOf("viewsMenu");
// if(i != -1) {
// 	primaryNav.splice(i, 1);
// }

upvoteCallbacks.push(function (collection, item, user) {
  if (collection === Posts) {
    subscribeItem(Posts, item._id, user);
  }
  return item;
});

//console.log(upvoteCallbacks);

primaryNav.push({template:'leaderboardLink'});

// Replace the words "silent hangout" with icons


text:
import java.util.ArrayList;
import java.util.Calendar;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author jackylian
 */
public class Main {
    public static void main(String[] args) {
        WxCardGroupon card = new WxCardGroupon();
        WxCardBaseInfo baseInfo = card.getBaseInfo();
        baseInfo.setLogoUrl("123");
        baseInfo.setDateInfoTimeRange(Calendar.getInstance().getTime(), Calendar.getInstance().getTime());
        baseInfo.setBrandName("brandname");
        baseInfo.setBindOpenid(false);
        baseInfo.setCanGiveFriend(false);
        baseInfo.setCanShare(true);
        baseInfo.setCodeType(WxCardBaseInfo.CODE_TYPE_QRCODE);
        baseInfo.setColor("Color010");
        baseInfo.setDescription("desc");
        baseInfo.setGetLimit(3);
        baseInfo.setUseCustomCode(false);
        baseInfo.setNotice("notice");
        baseInfo.setServicePhone("phone");
        baseInfo.addLocationIdList(123123);
        baseInfo.addLocationIdList(5345);
        baseInfo.setUseLimit(5);
        baseInfo.setQuantity(10000000);

        System.out.println(baseInfo.toJsonString());
        baseInfo.setLogoUrl("435345");
        ArrayList<Integer> locationIdList = new ArrayList<Integer>();
        locationIdList.add(809809);
        locationIdList.add(423532);
        card.setDealDetail("团购详情啊啊啊啊啊!!!");

        System.out.println(locationIdList.getClass().isArray());
        baseInfo.setLocationIdList(locationIdList);
        System.out.println(card.toJsonString());
    }
}


text:
namespace UnitTests.Grains
{
    using System;
    using System.Threading.Tasks;

    using Orleans;
    using Orleans.Runtime;
    using Orleans.Serialization;

    using UnitTests.GrainInterfaces;

    public class MessageSerializationGrain : Grain, IMessageSerializationGrain
    {
        public Task<object> EchoObject(object input) => Task.FromResult(input);

        public async Task GetUnserializableObjectChained()
        {
            // Find a grain on another silo.
            IMessageSerializationGrain otherGrain;
            var id = this.GetPrimaryKeyLong();
            var currentSiloIdentity = await this.GetSiloIdentity();
            while (true)
            {
                otherGrain = this.GrainFactory.GetGrain<IMessageSerializationGrain>(++id);
                var otherIdentity = await otherGrain.GetSiloIdentity();
                if (!string.Equals(otherIdentity, currentSiloIdentity))
                {
                    break;
                }
            }

            // Message that grain in a way which should fail.
            await otherGrain.EchoObject(new SimpleType(35));
        }

        public Task<string> GetSiloIdentity()
        {
            return Task.FromResult(this.RuntimeIdentity);
        }
    }

    [Serializable]
    public struct SimpleType
    {
        static SimpleType()
        {
            SerializationManager.Register(typeof(SimpleType));
        }

        public SimpleType(int num)
        {
            this.Number = num;
        }

        public int Number { get; }
    }

    /// <summary>
    /// Serializer which can serialize <see cref="SimpleType"/> but cannot deserialize it.
    /// </summary>
    [Serializable]
    public class OneWaySerializer : IExternalSerializer
    {
        public const string FailureMessage = "Can't do it, sorry.";

        public void Initialize(Logger logger)
        {
        }

        public bool IsSupportedType(Type itemType) => itemType == typeof(SimpleType);

        public object DeepCopy(object source, ICopyContext context)
        {
            return source;
        }

        public void Serialize(object item, ISerializationContext context, Type expectedType)
        {
            var typed = (SimpleType)item;
            context.StreamWriter.Write(typed.Number);
        }

        public object Deserialize(Type expectedType, IDeserializationContext context)
        {
            throw new NotSupportedException(FailureMessage);
        }
    }
}


text:
<?php

namespace Pagerfanta\View;

use Pagerfanta\PagerfantaInterface;

/**
 * TwitterBootstrapView.
 *
 * View that can be used with the pagination module
 * from the Twitter Bootstrap CSS Toolkit
 * http://twitter.github.com/bootstrap/
 *
 * @author Pablo Díez <pablodip@gmail.com>
 * @author Jan Sorgalla <jsorgalla@gmail.com>
 *
 * @api
 */
class TwitterBootstrapView implements ViewInterface
{
    /**
     * {@inheritdoc}
     */
    public function render(PagerfantaInterface $pagerfanta, $routeGenerator, array $options = array())
    {
        $options = array_merge(array(
            'proximity'           => 3,
            'prev_message'        => '← Previous',
            'prev_disabled_href'  => '',
            'next_message'        => 'Next →',
            'next_disabled_href'  => '',
            'dots_message'        => '…',
            'dots_href'           => '',
            'css_container_class' => 'pagination',
            'css_prev_class'      => 'prev',
            'css_next_class'      => 'next',
            'css_disabled_class'  => 'disabled',
            'css_dots_class'      => 'disabled',
            'css_active_class'    => 'active',
        ), $options);

        $currentPage = $pagerfanta->getCurrentPage();

        $startPage = $currentPage - $options['proximity'];
        $endPage = $currentPage + $options['proximity'];

        if ($startPage < 1) {
            $endPage = min($endPage + (1 - $startPage), $pagerfanta->getNbPages());
            $startPage = 1;
        }
        if ($endPage > $pagerfanta->getNbPages()) {
            $startPage = max($startPage - ($endPage - $pagerfanta->getNbPages()), 1);
            $endPage = $pagerfanta->getNbPages();
        }

        $pages = array();

        // previous
        $class = $options['css_prev_class'];
        $url   = $options['prev_disabled_href'];
        if (!$pagerfanta->hasPreviousPage()) {
            $class .= ' '.$options['css_disabled_class'];
        } else {
            $url = $routeGenerator($pagerfanta->getPreviousPage());
        }

        $pages[] = sprintf('
%s
', $class, $url, $options['prev_message']);

        // first
        if ($startPage > 1) {
            $pages[] = sprintf('
%s
', $routeGenerator(1), 1);
            if (3 == $startPage) {
                $pages[] = sprintf('
%s
', $routeGenerator(2), 2);
            } elseif (2 != $startPage) {
                $pages[] = sprintf('
%s
', $options['css_dots_class'], $options['dots_href'], $options['dots_message']);
            }
        }

        // pages
        for ($page = $startPage; $page <= $endPage; $page++) {
            $class = '';
            if ($page == $currentPage) {
                $class = sprintf(' class="%s"', $options['css_active_class']);
            }

            $pages[] = sprintf('
%s
', $class, $routeGenerator($page), $page);
        }

        // last
        if ($pagerfanta->getNbPages() > $endPage) {
            if ($pagerfanta->getNbPages() > ($endPage + 1)) {
                if ($pagerfanta->getNbPages() > ($endPage + 2)) {
                    $pages[] = sprintf('
%s
', $options['css_dots_class'], $options['dots_href'], $options['dots_message']);
                } else {
                    $pages[] = sprintf('
%s
', $routeGenerator($endPage + 1), $endPage + 1);
                }
            }

            $pages[] = sprintf('
%s
', $routeGenerator($pagerfanta->getNbPages()), $pagerfanta->getNbPages());
        }

        // next
        $class = $options['css_next_class'];
        $url   = $options['next_disabled_href'];
        if (!$pagerfanta->hasNextPage()) {
            $class .= ' '.$options['css_disabled_class'];
        } else {
            $url = $routeGenerator($pagerfanta->getNextPage());
        }

        $pages[] = sprintf('
%s
', $class, $url, $options['next_message']);

        return sprintf('

%s

', $options['css_container_class'], implode('', $pages));
    }

    /**
     * {@inheritdoc}
     */
    public function getName()
    {
        return 'twitter_bootstrap';
    }
}


text:
package sk.mrtn.demo.pixi.client;

import com.google.gwt.logging.client.LogConfiguration;
import sk.mrtn.pixi.client.*;
import sk.mrtn.pixi.client.particles.*;
import sk.mrtn.pixi.client.particles.config.EmitterConfig;
import sk.mrtn.pixi.client.resources.textureatlas.TextureAtlasResource;

import javax.inject.Inject;
import javax.inject.Provider;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 * Created by martinliptak on 23/08/16.
 * Object should serve as automator for building
 * and bringing to life standard/simple particle systems
 */
public class ParticleBuilder {

    private static Logger LOG;
    static {
        if (LogConfiguration.loggingIsEnabled()) {
            LOG = Logger.getLogger(ParticleBuilder.class.getSimpleName());
            LOG.setLevel(Level.ALL);
        }
    }

    private final EmitterFactory emitterFactory;
    private final Provider<ParticleContainer> particleContainerProvider;
    private final Provider<Container> containerProvider;
    private final Provider<ParticleContainerProperties> particleContainerPropertiesProvider;
    private Emitter emitter;

    public Container getContainer() {
        return container;
    }

    private Container container;

    @Inject
    ParticleBuilder(
            final EmitterFactory emitterFactory,
            final Provider<ParticleContainer> particleContainerProvider,
            final Provider<Container> containerProvider,
            final Provider<ParticleContainerProperties> particleContainerPropertiesProvider
            ){
        this.emitterFactory = emitterFactory;
        this.particleContainerProvider = particleContainerProvider;
        this.containerProvider = containerProvider;
        this.particleContainerPropertiesProvider = particleContainerPropertiesProvider;
    }

    // TODO: add customisation for container type, and particle type
    public void initialize(String emitterConfig, TextureAtlasResource textureAtlasResource) {
        LOG.fine("initialize");
        EmitterConfig config = EmitterConfig.parse(emitterConfig);
        AnimatedParticleArtTextureNames[] arts = new AnimatedParticleArtTextureNames[1];
        AnimatedParticleArtTextureNames art = new AnimatedParticleArtTextureNames();
        art.setFramerateToMatchLife();
        art.loop = true;
        List<String> frames = textureAtlasResource.getFrames();
        String[] textures = new String[frames.size()];
        for (int i = 0; i < frames.size(); i++) {
            textures[i] = frames.get(i);
        }
        art.setTextures(textures);
        art.addTexture(new RepetitiveTexture(Texture.fromFrame("gold_6.png"),20));
        arts[0]=art;
        this.container = getContainer(true);
        this.emitter = buildEmitter(this.container, config, arts, ParticleType.ANIMATED_PARTICLE);
    }

    public static native void logg(Object object) /*-{
        $wnd.console.log(object);
    }-*/;

    private Emitter buildEmitter(Container container, EmitterConfig config, AnimatedParticleArtTextureNames[] art, ParticleType animatedParticle) {
        // fixme: find out why usage of autofactory fails here.
//        Emitter emitter = this.emitterFactory.create(container, art, config);
        Emitter emitter = new Emitter(container, art, config);
        switch (animatedParticle) {
            case PARTICLE:
                break;
            case ANIMATED_PARTICLE:
                setAnimatedParticleConstructor(emitter);
                break;
            case PATH_PARTICLE:
                setPathParticleConstructor(emitter);
                break;
        }
        return emitter;
    }

    // at time i did not know any better solution for this setting :-(
    public static native void setAnimatedParticleConstructor(Emitter emitter) /*-{
        emitter.particleConstructor = $wnd.PIXI.particles.AnimatedParticle;
    }-*/;

    // at time i did not know any better solution for this setting :-(
    public static native void setPathParticleConstructor(Emitter emitter) /*-{
        emitter.particleConstructor = $wnd.PIXI.particles.PathParticle;
    }-*/;

    private Container getContainer(boolean useParticleContainer) {
        if (useParticleContainer) {
            ParticleContainerProperties particleContainerProperties = this.particleContainerPropertiesProvider.get();
            ParticleContainer particleContainer = this.particleContainerProvider.get();
            particleContainer.setProperties(particleContainerProperties.set(true,true,true,true,true));
            return particleContainer;
        } else {
            return containerProvider.get();
        }
    }

    public Emitter getEmitter() {
        return emitter;
    }
}


text:
<?php

error_reporting(E_STRICT | E_ALL);

// You can set the include path to src directory or reference
// DfpUser.php directly via require_once.
// $path = '/path/to/dfp_api_php_lib/src';
$path = dirname(__FILE__) . '/../../../../src';
set_include_path(get_include_path() . PATH_SEPARATOR . $path);

require_once 'Google/Api/Ads/Dfp/Lib/DfpUser.php';
require_once dirname(__FILE__) . '/../../../Common/ExampleUtils.php';
require_once 'Google/Api/Ads/Common/Util/MapUtils.php';

try {
  // Get DfpUser from credentials in "../auth.ini"
  // relative to the DfpUser.php file's directory.
  $user = new DfpUser();

  // Log SOAP XML request and response.
  $user->LogDefaults();

  // Get the SuggestedAdUnitService.
  $suggestedAdUnitService =
      $user->GetService('SuggestedAdUnitService', 'v201403');

  // Create a statement to only select suggested ad units with more than 50
  // requests.
  $filterStatement =
      new Statement("WHERE numRequests > :numRequests LIMIT 500",
      MapUtils::GetMapEntries(array('numRequests' => new NumberValue(50))));

  // Get ad units by statement.
  $page = $suggestedAdUnitService->getSuggestedAdUnitsByStatement(
      $filterStatement);

  // Display results.
  if (isset($page->results)) {
    $i = $page->startIndex;
    foreach ($page->results as $suggestedAdUnit) {
      printf("%d) Suggested ad unit with ID '%s' and number of requests '%d' "
          . "was found.\n", $i, $suggestedAdUnit->id,
          $suggestedAdUnit->numRequests);
      $i++;
    }
  }

  print 'Number of results found: ' . $page->totalResultSetSize . "\n";
} catch (OAuth2Exception $e) {
  ExampleUtils::CheckForOAuth2Errors($e);
} catch (ValidationException $e) {
  ExampleUtils::CheckForOAuth2Errors($e);
} catch (Exception $e) {
  print $e->getMessage() . "\n";
}


text:
<?php

namespace Oriancci;

class DatetimeTest extends OriancciTest
{

    public function testTimezone()
    {
        $date = new \Oriancci\DataType\DateTime(
            ['Y' => '1990', 'M' => '1', 'D' => '1', 'Z' => 'Australia/Brisbane']
        );

        $this->assertEquals('1990', $date->format('Y'));
        $this->assertEquals('1'   , $date->format('m'));
        $this->assertEquals('1'   , $date->format('d'));
        $this->assertEquals('Australia/Brisbane', $date->getTimezone()->getName());
        $this->assertFalse($date->isNull());

        $date = new \Oriancci\DataType\DateTime(
            ['Y' => '1990', 'M' => '1', 'D' => '1', 'Z' => 'Europe/London']
        );

        $this->assertEquals('Europe/London', $date->getTimezone()->getName());
        $this->assertFalse($date->isNull());
    }

    public function testSetTimezone()
    {
        // When you change the timezone, the time changes too
        $date = new \Oriancci\DataType\DateTime(
            ['Y' => '1990', 'M' => '1', 'D' => '1', 'H' => '23', 'I' => '59', 'Z' => 'UTC']
        );

        $date->setTimezone(new \DateTimeZone('Australia/Brisbane')); // UTC+10
        $this->assertEquals('1990', $date->format('Y'));
        $this->assertEquals('1'   , $date->format('m'));
        $this->assertEquals('2'   , $date->format('d'));
        $this->assertEquals('Australia/Brisbane', $date->getTimezone()->getName());
        $this->assertEquals('Australia/Brisbane', $date->getInput('Z'));
        $this->assertFalse($date->isNull());

        $date = new \Oriancci\DataType\DateTime(
            ['Y' => '1990', 'M' => '1', 'D' => '1', 'Z' => 'Europe/London']
        );

        $this->assertEquals('Europe/London', $date->getTimezone()->getName());
        $this->assertFalse($date->isNull());
    }

    public function testDateFromArray()
    {
        $date = new \Oriancci\DataType\DateTime(['Y' => '1990', 'M' => '1', 'D' => '1']);
        $this->assertEquals('1990', $date->format('Y'));
        $this->assertEquals('1'   , $date->format('m'));
        $this->assertEquals('1'   , $date->format('d'));
        $this->assertFalse($date->isNull());
    }

    public function testInvalidDateFormatFromArray()
    {
        $date = new \Oriancci\DataType\DateTime(['Y' => 'INVALID', 'M' => 'INVALID']);
        $this->assertTrue($date->hasErrors());
        $this->assertEquals('INVALID', $date->getInput('Y'));
        $this->assertEquals('INVALID', $date->getInput('M'));
        $this->assertNull($date->getInput('D'));
    }

    public function testInvalidDateFromArray()
    {
        $date = new \Oriancci\DataType\DateTime(['Y' => '2000', 'M' => '02', 'D' => '31']);
        $this->assertTrue($date->hasErrors());
        $this->assertEquals('2000', $date->getInput('Y'));
        $this->assertEquals('02'  , $date->getInput('M'));
        $this->assertEquals('31'  , $date->getInput('D'));
    }

    public function testTimeFromArray()
    {
        $date = new \Oriancci\DataType\DateTime(['H' => '08', 'I' => '15']);
        $this->assertEquals('08', $date->format('H'));
        $this->assertEquals('15', $date->format('i'));
        $this->assertEquals('00', $date->format('s'));
        $this->assertFalse($date->isNull());
    }

    public function testSetDate()
    {
        $date = new \Oriancci\DataType\DateTime('1990-01-01 00:00:00');
        $date->setDate(1991, 02, 03);
        $this->assertEquals('1991', $date->format('Y'));
        $this->assertEquals('2'   , $date->format('m'));
        $this->assertEquals('3'   , $date->format('d'));
        $this->assertEquals('0'   , $date->format('H'));
        $this->assertEquals('0'   , $date->format('i'));
        $this->assertEquals('0'   , $date->format('s'));
        $this->assertFalse($date->isNull());
    }

    public function testSetTime()
    {
        $date = new \Oriancci\DataType\DateTime('1990-01-01 00:00:00');
        $date->setTime(10, 11, 12);
        $this->assertEquals('1990', $date->format('Y'));
        $this->assertEquals('1'   , $date->format('m'));
        $this->assertEquals('1'   , $date->format('d'));
        $this->assertEquals('10'  , $date->format('H'));
        $this->assertEquals('11'  , $date->format('i'));
        $this->assertEquals('12'  , $date->format('s'));
        $this->assertFalse($date->isNull());
    }

    public function testNull()
    {
        $date = new \Oriancci\DataType\DateTime(null);
        $this->assertNull($date->format('H'));
        $this->assertNull($date->getOffset());
        $this->assertNull($date->getTimestamp());
        $this->assertNull($date->getTimezone());
        $this->assertNull($date->modify('+1 day'));
        $this->assertEmpty($date->__toString());
        $this->assertTrue($date->isNull());
    }

    public function testNullSetTime()
    {
        $date = new \Oriancci\DataType\DateTime(null);
        $date->setTime(10, 11, 12);
        $this->assertEquals('10'  , $date->format('H'));
        $this->assertEquals('11'  , $date->format('i'));
        $this->assertEquals('12'  , $date->format('s'));
        $this->assertFalse($date->isNull());
    }

    public function testNullSetDate()
    {
        $date = new \Oriancci\DataType\DateTime(null);
        $date->setDate(1990, 1, 1);
        $this->assertEquals('1990', $date->format('Y'));
        $this->assertEquals('1'   , $date->format('m'));
        $this->assertEquals('1'   , $date->format('d'));
        $this->assertEquals('00'  , $date->format('H'));
        $this->assertEquals('00'  , $date->format('i'));
        $this->assertEquals('00'  , $date->format('s'));
        $this->assertFalse($date->isNull());
    }

    public function testSetTimestamp()
    {
        $date = new \Oriancci\DataType\DateTime(null);
        $this->assertTrue($date->isNull());

        $date->setTimestamp('631152000'); // 1990-01-01 00:00:00
        $this->assertEquals('1990', $date->format('Y'));
        $this->assertEquals('1'   , $date->format('m'));
        $this->assertEquals('1'   , $date->format('d'));
        $this->assertEquals('00'  , $date->format('H'));
        $this->assertEquals('00'  , $date->format('i'));
        $this->assertEquals('00'  , $date->format('s'));
        $this->assertFalse($date->isNull());
    }

    public function testSetSub()
    {
        $date = new \Oriancci\DataType\DateTime('1990-01-02 00:00:00');
        $date->sub(new \DateInterval('P1D'));

        $this->assertEquals('1990', $date->format('Y'));
        $this->assertEquals('1'   , $date->format('m'));
        $this->assertEquals('1'   , $date->format('d'));
        $this->assertEquals('00'  , $date->format('H'));
        $this->assertEquals('00'  , $date->format('i'));
        $this->assertEquals('00'  , $date->format('s'));
        $this->assertFalse($date->isNull());
    }

    public function testSetSubNull()
    {
        $date = new \Oriancci\DataType\DateTime(null);
        $date->sub(new \DateInterval('P1D'));
        $this->assertTrue($date->isNull());
    }

    public function testSetAdd()
    {
        $date = new \Oriancci\DataType\DateTime('1990-01-01 00:00:00');
        $date->add(new \DateInterval('P1D'));

        $this->assertEquals('1990', $date->format('Y'));
        $this->assertEquals('1'   , $date->format('m'));
        $this->assertEquals('2'   , $date->format('d'));
        $this->assertEquals('00'  , $date->format('H'));
        $this->assertEquals('00'  , $date->format('i'));
        $this->assertEquals('00'  , $date->format('s'));
        $this->assertFalse($date->isNull());
    }

    public function testSetAddNull()
    {
        $date = new \Oriancci\DataType\DateTime(null);
        $date->add(new \DateInterval('P1D'));
        $this->assertTrue($date->isNull());
    }

    public function testSetDateIncomplete()
    {
        $date = new \Oriancci\DataType\DateTime(['Y' => '1990', 'M' => '05']);
        $this->assertTrue($date->hasErrors());
        $this->assertTrue($date->isNull());
        $this->assertEquals('1990', $date->getInput('Y'));
        $this->assertEquals('5'   , $date->getInput('M'));
        $this->assertNull($date->getInput('D'));

        $date->setInput(['D' => '06']);
        $this->assertFalse($date->hasErrors());
        $this->assertFalse($date->isNull());

        $this->assertEquals('1990', $date->format('Y'));
        $this->assertEquals('5'   , $date->format('m'));
        $this->assertEquals('6'   , $date->format('d'));

        $this->assertEquals('1990', $date->getInput('Y'));
        $this->assertEquals('5'   , $date->getInput('M'));
        $this->assertEquals('6'   , $date->getInput('D'));
    }

    public function testSetInputDate()
    {
        $date = new \Oriancci\DataType\DateTime;
        $date->setInput(['Y' => '1990', 'M' => '05', 'D' => '05']);

        $this->assertFalse($date->hasErrors());
        $this->assertFalse($date->isNull());
        $this->assertEquals('1990', $date->getInput('Y'));
        $this->assertEquals('5'   , $date->getInput('M'));
        $this->assertEquals('5'   , $date->getInput('D'));
        $this->assertNotNull($date->isNull('D'));
    }
}


text:
angular.module("tattva")
.controller('FunctionCtrl',['$scope','$mdDialog','fieldData','loadExprData','fieldData2','namespaceFactory',function($scope,$mdDialog,fieldData,loadExprData,fieldData2,namespaceFactory)
{
  $scope.function=[];
  $scope.namespace=fieldData2.namespace;
  loadExprData.getFunction().then(function(result){
    var data=result.data;

    return data;
  }).then(function(data)
  {
    for(i in data)
    {
      $scope.function.push(data[i].name);
    }
  });

  $scope.funParam=[];
  namespaceFactory.getNamespaceDetails($scope.namespace).then(function(data){
    for (i in data.dataSchema){
      $scope.funParam.push(data.dataSchema[i].name);
    }
  });

  $scope.getExprAsText =function(){
    return $scope.fieldData.function+"("+$scope.fieldData.functionparam+")";
  }

  $scope.fieldData=fieldData;
  //console.log("dialogueData data within publisherCtrl is : ", $scope.fieldData);
  $scope.hide = function() {
    $mdDialog.hide();
  };

  $scope.updateBackPublisher = function() {
    $scope.fieldData.exprAsText = $scope.getExprAsText();
    $mdDialog.hide($scope.fieldData);
  };
  $scope.cancel = function() {
    $mdDialog.cancel();
  };

}]);


text:
.class public Lcom/samsung/android/settings/face/UseFaceLockSettings;
.super Landroid/app/Activity;
.source "UseFaceLockSettings.java"

# interfaces
.implements Landroid/view/View$OnClickListener;
.implements Lcom/samsung/android/settings/face/FaceSettingsHelper$FaceTurnOnDialog$FaceTurnOnDialogFragmentListener;

# instance fields
.field private descriptionTextView:Landroid/widget/TextView;

.field private mContext:Landroid/content/Context;

.field private mFaceManager:Lcom/samsung/android/bio/face/SemBioFaceManager;

.field private mFaceTurnOnDialog:Lcom/samsung/android/settings/face/FaceSettingsHelper$FaceTurnOnDialog;

.field private mFaceUnlock:Landroid/widget/CheckedTextView;

.field private mFaceUnlockBtnArea:Landroid/view/View;

.field private mIrisUnlock:Landroid/widget/CheckedTextView;

.field private mIrisUnlockBtnArea:Landroid/view/View;

.field private mIsIrisLockEnabled:Z

.field private mIsSecured:Z

.field private mLaterBtn:Landroid/widget/Button;

.field private mLockPatternUtils:Lcom/android/internal/widget/LockPatternUtils;

.field private mLockTypeArea:Landroid/widget/RadioGroup;

.field private mOkBtn:Landroid/widget/Button;

.field private mOneBtnContainer:Landroid/widget/LinearLayout;

.field private mTurnOnBtn:Landroid/widget/Button;

.field private mTwoBtnContainer:Landroid/widget/LinearLayout;

.field private mUserId:I

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

    invoke-direct {p0}, Landroid/app/Activity;-><init>()V

    const/4 v0, 0x0

    iput-object v0, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mFaceTurnOnDialog:Lcom/samsung/android/settings/face/FaceSettingsHelper$FaceTurnOnDialog;

    return-void
.end method

.method private getFaceLockDescription()Ljava/lang/String;
    .locals 8

    const/4 v7, 0x1

    const/4 v6, 0x0

    const-string/jumbo v1, ""

    const-string/jumbo v0, ""

    iget-boolean v3, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mIsIrisLockEnabled:Z

    if-eqz v3, :cond_0

    invoke-virtual {p0}, Lcom/samsung/android/settings/face/UseFaceLockSettings;->getResources()Landroid/content/res/Resources;

    move-result-object v3

    const v4, 0x7f120acd

    invoke-virtual {v3, v4}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object v0

    return-object v0

    :cond_0
    iget-object v3, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mLockPatternUtils:Lcom/android/internal/widget/LockPatternUtils;

    invoke-static {}, Landroid/os/UserHandle;->myUserId()I

    move-result v4

    invoke-virtual {v3, v4}, Lcom/android/internal/widget/LockPatternUtils;->getActivePasswordQuality(I)I

    move-result v2

    sparse-switch v2, :sswitch_data_0

    const-string/jumbo v3, "FcstUseFaceLockSettings"

    const-string/jumbo v4, "Wrong case!"

    invoke-static {v3, v4}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I

    :goto_0
    invoke-virtual {p0}, Lcom/samsung/android/settings/face/UseFaceLockSettings;->getResources()Landroid/content/res/Resources;

    move-result-object v3

    new-array v4, v7, [Ljava/lang/Object;

    aput-object v1, v4, v6

    const v5, 0x7f120acb

    invoke-virtual {v3, v5, v4}, Landroid/content/res/Resources;->getString(I[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v0

    invoke-static {}, Lcom/android/settings/Utils;->isTablet()Z

    move-result v3

    if-eqz v3, :cond_1

    invoke-virtual {p0}, Lcom/samsung/android/settings/face/UseFaceLockSettings;->getResources()Landroid/content/res/Resources;

    move-result-object v3

    new-array v4, v7, [Ljava/lang/Object;

    aput-object v1, v4, v6

    const v5, 0x7f120acc

    invoke-virtual {v3, v5, v4}, Landroid/content/res/Resources;->getString(I[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v0

    :cond_1
    const-string/jumbo v3, "FcstUseFaceLockSettings"

    new-instance v4, Ljava/lang/StringBuilder;

    invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V

    const-string/jumbo v5, "description : "

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-static {v3, v4}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    return-object v0

    :sswitch_0
    invoke-virtual {p0}, Lcom/samsung/android/settings/face/UseFaceLockSettings;->getResources()Landroid/content/res/Resources;

    move-result-object v3

    const v4, 0x7f121c84

    invoke-virtual {v3, v4}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object v1

    goto :goto_0

    :sswitch_1
    invoke-virtual {p0}, Lcom/samsung/android/settings/face/UseFaceLockSettings;->getResources()Landroid/content/res/Resources;

    move-result-object v3

    const v4, 0x7f121c80

    invoke-virtual {v3, v4}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object v1

    goto :goto_0

    :sswitch_2
    invoke-virtual {p0}, Lcom/samsung/android/settings/face/UseFaceLockSettings;->getResources()Landroid/content/res/Resources;

    move-result-object v3

    const v4, 0x7f121c82

    invoke-virtual {v3, v4}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object v1

    goto :goto_0

    :sswitch_3
    iget-object v3, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mLockPatternUtils:Lcom/android/internal/widget/LockPatternUtils;

    invoke-static {}, Landroid/os/UserHandle;->myUserId()I

    move-result v4

    invoke-virtual {v3, v4}, Lcom/android/internal/widget/LockPatternUtils;->isLockScreenDisabled(I)Z

    move-result v3

    if-eqz v3, :cond_2

    invoke-virtual {p0}, Lcom/samsung/android/settings/face/UseFaceLockSettings;->getResources()Landroid/content/res/Resources;

    move-result-object v3

    const v4, 0x7f121c7e

    invoke-virtual {v3, v4}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object v1

    goto :goto_0

    :cond_2
    invoke-virtual {p0}, Lcom/samsung/android/settings/face/UseFaceLockSettings;->getResources()Landroid/content/res/Resources;

    move-result-object v3

    const v4, 0x7f121c7c

    invoke-virtual {v3, v4}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object v1

    goto/16 :goto_0

    :sswitch_4
    invoke-virtual {p0}, Lcom/samsung/android/settings/face/UseFaceLockSettings;->getResources()Landroid/content/res/Resources;

    move-result-object v3

    const v4, 0x7f120840

    invoke-virtual {v3, v4}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object v1

    goto/16 :goto_0

    nop

    :sswitch_data_0
    .sparse-switch
        0x0 -> :sswitch_3
        0x10000 -> :sswitch_2
        0x10001 -> :sswitch_4
        0x20000 -> :sswitch_0
        0x30000 -> :sswitch_0
        0x40000 -> :sswitch_1
        0x50000 -> :sswitch_1
        0x60000 -> :sswitch_1
    .end sparse-switch
.end method

.method private showFaceTurnOnDialog(Z)V
    .locals 3

    iget-object v0, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mFaceTurnOnDialog:Lcom/samsung/android/settings/face/FaceSettingsHelper$FaceTurnOnDialog;

    if-nez v0, :cond_0

    const-string/jumbo v0, "FcstUseFaceLockSettings"

    const-string/jumbo v1, "showFaceTurnOnDialog : create dialog"

    invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    new-instance v0, Lcom/samsung/android/settings/face/FaceSettingsHelper$FaceTurnOnDialog;

    iget v1, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mUserId:I

    invoke-direct {v0, v1, p1}, Lcom/samsung/android/settings/face/FaceSettingsHelper$FaceTurnOnDialog;-><init>(IZ)V

    iput-object v0, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mFaceTurnOnDialog:Lcom/samsung/android/settings/face/FaceSettingsHelper$FaceTurnOnDialog;

    :cond_0
    iget-object v0, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mFaceTurnOnDialog:Lcom/samsung/android/settings/face/FaceSettingsHelper$FaceTurnOnDialog;

    invoke-virtual {v0, p0}, Lcom/samsung/android/settings/face/FaceSettingsHelper$FaceTurnOnDialog;->setTurnOnDialogFragmentListener(Lcom/samsung/android/settings/face/FaceSettingsHelper$FaceTurnOnDialog$FaceTurnOnDialogFragmentListener;)V

    iget-object v0, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mFaceTurnOnDialog:Lcom/samsung/android/settings/face/FaceSettingsHelper$FaceTurnOnDialog;

    invoke-virtual {p0}, Lcom/samsung/android/settings/face/UseFaceLockSettings;->getFragmentManager()Landroid/app/FragmentManager;

    move-result-object v1

    const-string/jumbo v2, "UseFaceLockSettings_FaceTurnOnDialog"

    invoke-virtual {v0, v1, v2}, Lcom/samsung/android/settings/face/FaceSettingsHelper$FaceTurnOnDialog;->show(Landroid/app/FragmentManager;Ljava/lang/String;)V

    return-void
.end method

# virtual methods
.method public onClick(Landroid/view/View;)V
    .locals 6

    const/4 v0, 0x0

    const/4 v1, 0x1

    iget-object v2, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mTurnOnBtn:Landroid/widget/Button;

    if-ne p1, v2, :cond_2

    const-string/jumbo v2, "FcstUseFaceLockSettings"

    const-string/jumbo v3, "Turn on pressed"

    invoke-static {v2, v3}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    iget-object v2, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mFaceManager:Lcom/samsung/android/bio/face/SemBioFaceManager;

    if-eqz v2, :cond_1

    iget-object v2, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mFaceManager:Lcom/samsung/android/bio/face/SemBioFaceManager;

    iget v3, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mUserId:I

    invoke-virtual {v2, v3}, Lcom/samsung/android/bio/face/SemBioFaceManager;->hasEnrolledFaces(I)Z

    move-result v2

    if-eqz v2, :cond_1

    iget-object v2, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mContext:Landroid/content/Context;

    iget-object v3, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mLockPatternUtils:Lcom/android/internal/widget/LockPatternUtils;

    iget v4, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mUserId:I

    invoke-static {v2, v3, v4}, Lcom/samsung/android/settings/face/FaceSettingsHelper;->getIrisUnlockEnalbed(Landroid/content/Context;Lcom/android/internal/widget/LockPatternUtils;I)Z

    move-result v2

    if-eqz v2, :cond_0

    invoke-direct {p0, v0}, Lcom/samsung/android/settings/face/UseFaceLockSettings;->showFaceTurnOnDialog(Z)V

    return-void

    :cond_0
    iget-object v0, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mContext:Landroid/content/Context;

    iget-object v2, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mLockPatternUtils:Lcom/android/internal/widget/LockPatternUtils;

    iget v3, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mUserId:I

    invoke-static {v0, v2, v3, v1}, Lcom/samsung/android/settings/face/FaceSettingsHelper;->setFaceLock(Landroid/content/Context;Lcom/android/internal/widget/LockPatternUtils;IZ)V

    :cond_1
    :goto_0
    invoke-virtual {p0}, Lcom/samsung/android/settings/face/UseFaceLockSettings;->finish()V

    return-void

    :cond_2
    iget-object v2, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mLaterBtn:Landroid/widget/Button;

    if-ne p1, v2, :cond_4

    const-string/jumbo v2, "FcstUseFaceLockSettings"

    const-string/jumbo v3, "Later pressed"

    invoke-static {v2, v3}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    iget-object v2, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mContext:Landroid/content/Context;

    iget-object v3, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mLockPatternUtils:Lcom/android/internal/widget/LockPatternUtils;

    iget v4, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mUserId:I

    iget-boolean v5, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mIsSecured:Z

    if-eqz v5, :cond_3

    :goto_1
    invoke-static {v2, v3, v4, v0}, Lcom/samsung/android/settings/face/FaceSettingsHelper;->removeFaceLock(Landroid/content/Context;Lcom/android/internal/widget/LockPatternUtils;IZ)V

    goto :goto_0

    :cond_3
    move v0, v1

    goto :goto_1

    :cond_4
    iget-object v2, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mOkBtn:Landroid/widget/Button;

    if-ne p1, v2, :cond_6

    const-string/jumbo v0, "FcstUseFaceLockSettings"

    const-string/jumbo v2, "OK pressed"

    invoke-static {v0, v2}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    iget-object v0, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mFaceUnlock:Landroid/widget/CheckedTextView;

    invoke-virtual {v0}, Landroid/widget/CheckedTextView;->isChecked()Z

    move-result v0

    if-eqz v0, :cond_5

    const-string/jumbo v0, "FcstUseFaceLockSettings"

    const-string/jumbo v2, "Change to face unlock"

    invoke-static {v0, v2}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    iget-object v0, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mContext:Landroid/content/Context;

    iget-object v2, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mLockPatternUtils:Lcom/android/internal/widget/LockPatternUtils;

    iget v3, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mUserId:I

    invoke-static {v0, v2, v3}, Lcom/samsung/android/settings/face/FaceSettingsHelper;->removeIrisLock(Landroid/content/Context;Lcom/android/internal/widget/LockPatternUtils;I)V

    iget-object v0, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mContext:Landroid/content/Context;

    iget-object v2, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mLockPatternUtils:Lcom/android/internal/widget/LockPatternUtils;

    iget v3, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mUserId:I

    invoke-static {v0, v2, v3, v1}, Lcom/samsung/android/settings/face/FaceSettingsHelper;->setFaceLock(Landroid/content/Context;Lcom/android/internal/widget/LockPatternUtils;IZ)V

    goto :goto_0

    :cond_5
    const-string/jumbo v0, "FcstUseFaceLockSettings"

    const-string/jumbo v1, "Keep iris unlock"

    invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    goto :goto_0

    :cond_6
    iget-object v2, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mFaceUnlock:Landroid/widget/CheckedTextView;

    if-eq p1, v2, :cond_7

    iget-object v2, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mFaceUnlockBtnArea:Landroid/view/View;

    if-ne p1, v2, :cond_8

    :cond_7
    const-string/jumbo v2, "FcstUseFaceLockSettings"

    const-string/jumbo v3, "Face unlock button enabled"

    invoke-static {v2, v3}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    iget-object v2, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mFaceUnlock:Landroid/widget/CheckedTextView;

    invoke-virtual {v2, v1}, Landroid/widget/CheckedTextView;->setChecked(Z)V

    iget-object v1, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mIrisUnlock:Landroid/widget/CheckedTextView;

    invoke-virtual {v1, v0}, Landroid/widget/CheckedTextView;->setChecked(Z)V

    return-void

    :cond_8
    iget-object v2, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mIrisUnlock:Landroid/widget/CheckedTextView;

    if-eq p1, v2, :cond_9

    iget-object v2, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mIrisUnlockBtnArea:Landroid/view/View;

    if-ne p1, v2, :cond_1

    :cond_9
    const-string/jumbo v2, "FcstUseFaceLockSettings"

    const-string/jumbo v3, "Iris unlock button enabled"

    invoke-static {v2, v3}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    iget-object v2, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mFaceUnlock:Landroid/widget/CheckedTextView;

    invoke-virtual {v2, v0}, Landroid/widget/CheckedTextView;->setChecked(Z)V

    iget-object v0, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mIrisUnlock:Landroid/widget/CheckedTextView;

    invoke-virtual {v0, v1}, Landroid/widget/CheckedTextView;->setChecked(Z)V

    return-void
.end method

.method public onConfigurationChanged(Landroid/content/res/Configuration;)V
    .locals 2

    invoke-super {p0, p1}, Landroid/app/Activity;->onConfigurationChanged(Landroid/content/res/Configuration;)V

    const-string/jumbo v0, "FcstUseFaceLockSettings"

    const-string/jumbo v1, "onConfigurationChanged"

    invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    invoke-virtual {p0}, Lcom/samsung/android/settings/face/UseFaceLockSettings;->getWindow()Landroid/view/Window;

    move-result-object v0

    invoke-static {p0, v0}, Lcom/android/settings/Utils;->applyLandscapeFullScreen(Landroid/content/Context;Landroid/view/Window;)V

    return-void
.end method

.method public onCreate(Landroid/os/Bundle;)V
    .locals 5

    const/16 v4, 0x8

    const/4 v3, 0x0

    invoke-super {p0, p1}, Landroid/app/Activity;->onCreate(Landroid/os/Bundle;)V

    iput-object p0, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mContext:Landroid/content/Context;

    const-string/jumbo v0, "FcstUseFaceLockSettings"

    const v1, 0x7f120378

    invoke-static {p0, v1, v0}, Lcom/android/settings/Utils;->isNotAvailableBiometricsWithDexAndMultiWindow(Landroid/app/Activity;ILjava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_0

    invoke-virtual {p0}, Lcom/samsung/android/settings/face/UseFaceLockSettings;->finish()V

    return-void

    :cond_0
    new-instance v0, Lcom/android/internal/widget/LockPatternUtils;

    invoke-direct {v0, p0}, Lcom/android/internal/widget/LockPatternUtils;-><init>(Landroid/content/Context;)V

    iput-object v0, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mLockPatternUtils:Lcom/android/internal/widget/LockPatternUtils;

    invoke-static {p0}, Lcom/samsung/android/bio/face/SemBioFaceManager;->getInstance(Landroid/content/Context;)Lcom/samsung/android/bio/face/SemBioFaceManager;

    move-result-object v0

    iput-object v0, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mFaceManager:Lcom/samsung/android/bio/face/SemBioFaceManager;

    const v0, 0x7f0d02bc

    invoke-virtual {p0, v0}, Lcom/samsung/android/settings/face/UseFaceLockSettings;->setContentView(I)V

    invoke-virtual {p0}, Lcom/samsung/android/settings/face/UseFaceLockSettings;->getIntent()Landroid/content/Intent;

    move-result-object v0

    const-string/jumbo v1, "isSecured"

    invoke-virtual {v0, v1, v3}, Landroid/content/Intent;->getBooleanExtra(Ljava/lang/String;Z)Z

    move-result v0

    iput-boolean v0, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mIsSecured:Z

    invoke-virtual {p0}, Lcom/samsung/android/settings/face/UseFaceLockSettings;->getIntent()Landroid/content/Intent;

    move-result-object v0

    const-string/jumbo v1, "android.intent.extra.USER_ID"

    invoke-static {}, Landroid/os/UserHandle;->myUserId()I

    move-result v2

    invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->getIntExtra(Ljava/lang/String;I)I

    move-result v0

    iput v0, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mUserId:I

    iget-object v0, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mContext:Landroid/content/Context;

    iget-object v1, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mLockPatternUtils:Lcom/android/internal/widget/LockPatternUtils;

    iget v2, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mUserId:I

    invoke-static {v0, v1, v2}, Lcom/samsung/android/settings/face/FaceSettingsHelper;->getIrisUnlockEnalbed(Landroid/content/Context;Lcom/android/internal/widget/LockPatternUtils;I)Z

    move-result v0

    iput-boolean v0, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mIsIrisLockEnabled:Z

    const-string/jumbo v0, "FcstUseFaceLockSettings"

    new-instance v1, Ljava/lang/StringBuilder;

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

    const-string/jumbo v2, "Iris is enabled : "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    iget-boolean v2, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mIsIrisLockEnabled:Z

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    const v0, 0x7f0a02fb

    invoke-virtual {p0, v0}, Lcom/samsung/android/settings/face/UseFaceLockSettings;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/TextView;

    iput-object v0, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->descriptionTextView:Landroid/widget/TextView;

    iget-object v0, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->descriptionTextView:Landroid/widget/TextView;

    invoke-direct {p0}, Lcom/samsung/android/settings/face/UseFaceLockSettings;->getFaceLockDescription()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    const v0, 0x7f0a04e0

    invoke-virtual {p0, v0}, Lcom/samsung/android/settings/face/UseFaceLockSettings;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/RadioGroup;

    iput-object v0, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mLockTypeArea:Landroid/widget/RadioGroup;

    const v0, 0x7f0a0302

    invoke-virtual {p0, v0}, Lcom/samsung/android/settings/face/UseFaceLockSettings;->findViewById(I)Landroid/view/View;

    move-result-object v0

    iput-object v0, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mFaceUnlockBtnArea:Landroid/view/View;

    const v0, 0x7f0a0451

    invoke-virtual {p0, v0}, Lcom/samsung/android/settings/face/UseFaceLockSettings;->findViewById(I)Landroid/view/View;

    move-result-object v0

    iput-object v0, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mIrisUnlockBtnArea:Landroid/view/View;

    const v0, 0x7f0a0301

    invoke-virtual {p0, v0}, Lcom/samsung/android/settings/face/UseFaceLockSettings;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/CheckedTextView;

    iput-object v0, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mFaceUnlock:Landroid/widget/CheckedTextView;

    const v0, 0x7f0a0450

    invoke-virtual {p0, v0}, Lcom/samsung/android/settings/face/UseFaceLockSettings;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/CheckedTextView;

    iput-object v0, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mIrisUnlock:Landroid/widget/CheckedTextView;

    const v0, 0x7f0a05e5

    invoke-virtual {p0, v0}, Lcom/samsung/android/settings/face/UseFaceLockSettings;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/LinearLayout;

    iput-object v0, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mOneBtnContainer:Landroid/widget/LinearLayout;

    const v0, 0x7f0a08fc

    invoke-virtual {p0, v0}, Lcom/samsung/android/settings/face/UseFaceLockSettings;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/LinearLayout;

    iput-object v0, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mTwoBtnContainer:Landroid/widget/LinearLayout;

    const v0, 0x7f0a0482

    invoke-virtual {p0, v0}, Lcom/samsung/android/settings/face/UseFaceLockSettings;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/Button;

    iput-object v0, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mLaterBtn:Landroid/widget/Button;

    const v0, 0x7f0a08f0

    invoke-virtual {p0, v0}, Lcom/samsung/android/settings/face/UseFaceLockSettings;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/Button;

    iput-object v0, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mTurnOnBtn:Landroid/widget/Button;

    const v0, 0x7f0a05e1

    invoke-virtual {p0, v0}, Lcom/samsung/android/settings/face/UseFaceLockSettings;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/Button;

    iput-object v0, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mOkBtn:Landroid/widget/Button;

    iget-boolean v0, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mIsIrisLockEnabled:Z

    if-eqz v0, :cond_3

    const v0, 0x7f120ad0

    invoke-virtual {p0, v0}, Lcom/samsung/android/settings/face/UseFaceLockSettings;->setTitle(I)V

    iget-object v0, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mTwoBtnContainer:Landroid/widget/LinearLayout;

    if-eqz v0, :cond_1

    iget-object v0, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mTwoBtnContainer:Landroid/widget/LinearLayout;

    invoke-virtual {v0, v4}, Landroid/widget/LinearLayout;->setVisibility(I)V

    :cond_1
    :goto_0
    iget-object v0, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mLaterBtn:Landroid/widget/Button;

    invoke-virtual {v0, p0}, Landroid/widget/Button;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    iget-object v0, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mTurnOnBtn:Landroid/widget/Button;

    invoke-virtual {v0, p0}, Landroid/widget/Button;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    iget-object v0, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mOkBtn:Landroid/widget/Button;

    invoke-virtual {v0, p0}, Landroid/widget/Button;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    iget-object v0, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mFaceUnlock:Landroid/widget/CheckedTextView;

    invoke-virtual {v0, p0}, Landroid/widget/CheckedTextView;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    iget-object v0, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mIrisUnlock:Landroid/widget/CheckedTextView;

    invoke-virtual {v0, p0}, Landroid/widget/CheckedTextView;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    iget-object v0, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mFaceUnlockBtnArea:Landroid/view/View;

    invoke-virtual {v0, p0}, Landroid/view/View;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    iget-object v0, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mIrisUnlockBtnArea:Landroid/view/View;

    invoke-virtual {v0, p0}, Landroid/view/View;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    iget-object v0, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mIrisUnlock:Landroid/widget/CheckedTextView;

    const/4 v1, 0x1

    invoke-virtual {v0, v1}, Landroid/widget/CheckedTextView;->setChecked(Z)V

    invoke-virtual {p0}, Lcom/samsung/android/settings/face/UseFaceLockSettings;->getWindow()Landroid/view/Window;

    move-result-object v0

    invoke-static {p0, v0}, Lcom/android/settings/Utils;->applyLandscapeFullScreen(Landroid/content/Context;Landroid/view/Window;)V

    iget-object v0, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mContext:Landroid/content/Context;

    invoke-static {}, Landroid/os/UserHandle;->myUserId()I

    move-result v1

    invoke-static {v0, v1}, Lcom/android/settings/Utils;->isFaceDisabled(Landroid/content/Context;I)Z

    move-result v0

    if-eqz v0, :cond_2

    iget-object v0, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mTurnOnBtn:Landroid/widget/Button;

    invoke-virtual {v0, v3}, Landroid/widget/Button;->setEnabled(Z)V

    iget-object v0, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mOkBtn:Landroid/widget/Button;

    invoke-virtual {v0, v3}, Landroid/widget/Button;->setEnabled(Z)V

    :cond_2
    return-void

    :cond_3
    const v0, 0x7f120acf

    invoke-virtual {p0, v0}, Lcom/samsung/android/settings/face/UseFaceLockSettings;->setTitle(I)V

    iget-object v0, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mLockTypeArea:Landroid/widget/RadioGroup;

    if-eqz v0, :cond_4

    iget-object v0, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mLockTypeArea:Landroid/widget/RadioGroup;

    invoke-virtual {v0, v4}, Landroid/widget/RadioGroup;->setVisibility(I)V

    :cond_4
    iget-object v0, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mOneBtnContainer:Landroid/widget/LinearLayout;

    if-eqz v0, :cond_1

    iget-object v0, p0, Lcom/samsung/android/settings/face/UseFaceLockSettings;->mOneBtnContainer:Landroid/widget/LinearLayout;

    invoke-virtual {v0, v4}, Landroid/widget/LinearLayout;->setVisibility(I)V

    goto :goto_0
.end method

.method public turnOffFaceLock()V
    .locals 2

    const-string/jumbo v0, "FcstUseFaceLockSettings"

    const-string/jumbo v1, "turnOffFaceLock"

    invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    invoke-virtual {p0}, Lcom/samsung/android/settings/face/UseFaceLockSettings;->finish()V

    return-void
.end method

.method public turnOnFaceLock()V
    .locals 2

    const-string/jumbo v0, "FcstUseFaceLockSettings"

    const-string/jumbo v1, "turnOnFaceLock"

    invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    invoke-virtual {p0}, Lcom/samsung/android/settings/face/UseFaceLockSettings;->finish()V

    return-void
.end method


text:
package com.example.butterknife.functional;

import android.content.Context;
import android.view.View;
import androidx.test.InstrumentationRegistry;
import butterknife.BindDimen;
import butterknife.ButterKnife;
import butterknife.Unbinder;
import com.example.butterknife.test.R;
import org.junit.Test;

import static com.google.common.truth.Truth.assertThat;

public final class BindDimenTest {
  private final Context context = InstrumentationRegistry.getContext();
  private final View tree = ViewTree.create(1);

  static class IntTarget {
    @BindDimen(R.dimen.twelve_point_two_dp) int actual;
  }

  @Test public void asInt() {
    IntTarget target = new IntTarget();
    int expected = context.getResources().getDimensionPixelSize(R.dimen.twelve_point_two_dp);

    Unbinder unbinder = ButterKnife.bind(target, tree);
    assertThat(target.actual).isEqualTo(expected);

    unbinder.unbind();
    assertThat(target.actual).isEqualTo(expected);
  }

  static class FloatTarget {
    @BindDimen(R.dimen.twelve_point_two_dp) float actual;
  }

  @Test public void asFloat() {
    FloatTarget target = new FloatTarget();
    float expected = context.getResources().getDimension(R.dimen.twelve_point_two_dp);

    Unbinder unbinder = ButterKnife.bind(target, tree);
    assertThat(target.actual).isEqualTo(expected);

    unbinder.unbind();
    assertThat(target.actual).isEqualTo(expected);
  }
}