Program: 58311
Project: 58311
Buggy source:
@Override public void onViewCreated(final View view,Bundle savedInstanceState){
  ExpandingLayout anim=(ExpandingLayout)getActivity().findViewById(R.id.layoutDetails);
  anim.setAnimationBounds(mStartTop,mFinalTop,mStartBottom,mFinalBottom);
  super.onViewCreated(view,savedInstanceState);
  if (mListener != null) {
    mListener.onWakelockDetailSetTitle(mStat.getName());
    mListener.onWakelockDetailSetTaskerTitle("String_Node_Str");
  }
  loadStatsFromSource(view);
  final EditText edit=(EditText)view.findViewById(R.id.editWakelockSeconds);
  SharedPreferences prefs=getActivity().getSharedPreferences(WakelockDetailFragment.class.getPackage().getName() + "String_Node_Str",Context.MODE_WORLD_READABLE);
  String blockSeconds="String_Node_Str" + mStat.getName() + "String_Node_Str";
  Long blockSecondsLong=prefs.getLong(blockSeconds,240);
  edit.setText(String.valueOf(blockSecondsLong));
  edit.setOnEditorActionListener(new TextView.OnEditorActionListener(){
    @Override public boolean onEditorAction(    TextView textView,    int i,    KeyEvent keyEvent){
      if (i == EditorInfo.IME_ACTION_DONE) {
        return handleTextChange(textView,edit);
      }
      return false;
    }
  }
);
  edit.setOnFocusChangeListener(new View.OnFocusChangeListener(){
    @Override public void onFocusChange(    View view,    boolean b){
      if (!b) {
        handleTextChange((TextView)view,edit);
      }
    }
  }
);
  final Switch onOff=(Switch)view.findViewById(R.id.switchWakelock);
  boolean enabled=false;
  String blockName="String_Node_Str" + mStat.getName() + "String_Node_Str";
  enabled=prefs.getBoolean(blockName,false);
  onOff.setChecked(enabled);
  getView().findViewById(R.id.editWakelockSeconds).setEnabled(onOff.isChecked());
  onOff.setOnTouchListener(new View.OnTouchListener(){
    @Override public boolean onTouch(    View view,    MotionEvent motionEvent){
      if (motionEvent.getAction() == MotionEvent.ACTION_UP) {
        boolean isPremium=false;
        Activity baseActivity=getActivity();
        if (baseActivity instanceof MaterialSettingsActivity) {
          isPremium=((MaterialSettingsActivity)getActivity()).isPremium();
        }
 else         if (baseActivity instanceof TaskerActivity) {
          isPremium=((TaskerActivity)getActivity()).isPremium();
        }
        if (isPremium || mFreeWakelock) {
          final boolean b=!onOff.isChecked();
          if (b && !mKnownSafeWakelock) {
            warnUnknownWakelock(onOff);
          }
 else {
            updateEnabledWakelock(b);
            return false;
          }
        }
 else {
          warnLicensing(onOff);
        }
        return true;
      }
 else {
        return false;
      }
    }
  }
);
  View panel=(View)getView().findViewById(R.id.settingsPanel);
  panel.setBackgroundColor(enabled ? getResources().getColor(R.color.background_panel_enabled) : getResources().getColor(R.color.background_panel_disabled));
  panel.setAlpha(enabled ? 1 : (float).4);
  TextView resetButton=(TextView)view.findViewById(R.id.buttonResetStats);
  resetButton.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View resetView){
      Intent intent=new Intent(XposedReceiver.RESET_ACTION);
      intent.putExtra(XposedReceiver.STAT_TYPE,UnbounceStatsCollection.STAT_CURRENT);
      intent.putExtra(XposedReceiver.STAT_NAME,mStat.getName());
      try {
        getActivity().sendBroadcast(intent);
      }
 catch (      IllegalStateException ise) {
      }
      UnbounceStatsCollection.getInstance().resetLocalStats(mStat.getName());
      loadStatsFromSource(view);
      if (mClearListener != null) {
        mClearListener.onWakelockCleared();
      }
    }
  }
);
  TextView description=(TextView)view.findViewById(R.id.textViewWakelockDescription);
  String descriptionText=EventLookup.getDescription(mStat.getName());
  description.setText(descriptionText);
  mKnownSafeWakelock=EventLookup.isSafe(mStat.getName()) == EventLookup.SAFE;
  mFreeWakelock=EventLookup.isFree(mStat.getName());
}

Fixed version (ground truth):
@Override public void onViewCreated(final View view,Bundle savedInstanceState){
  ExpandingLayout anim=(ExpandingLayout)getActivity().findViewById(R.id.layoutDetails);
  anim.setAnimationBounds(mStartTop,mFinalTop,mStartBottom,mFinalBottom);
  super.onViewCreated(view,savedInstanceState);
  if (mListener != null) {
    mListener.onWakelockDetailSetTitle(mStat.getName());
    mListener.onWakelockDetailSetTaskerTitle(getResources().getString(R.string.tasker_choose_settings));
  }
  loadStatsFromSource(view);
  final EditText edit=(EditText)view.findViewById(R.id.editWakelockSeconds);
  SharedPreferences prefs=getActivity().getSharedPreferences(WakelockDetailFragment.class.getPackage().getName() + "String_Node_Str",Context.MODE_WORLD_READABLE);
  String blockSeconds="String_Node_Str" + mStat.getName() + "String_Node_Str";
  Long blockSecondsLong=prefs.getLong(blockSeconds,240);
  edit.setText(String.valueOf(blockSecondsLong));
  edit.setOnEditorActionListener(new TextView.OnEditorActionListener(){
    @Override public boolean onEditorAction(    TextView textView,    int i,    KeyEvent keyEvent){
      if (i == EditorInfo.IME_ACTION_DONE) {
        return handleTextChange(textView,edit);
      }
      return false;
    }
  }
);
  edit.setOnFocusChangeListener(new View.OnFocusChangeListener(){
    @Override public void onFocusChange(    View view,    boolean b){
      if (!b) {
        handleTextChange((TextView)view,edit);
      }
    }
  }
);
  final Switch onOff=(Switch)view.findViewById(R.id.switchWakelock);
  boolean enabled=false;
  String blockName="String_Node_Str" + mStat.getName() + "String_Node_Str";
  enabled=prefs.getBoolean(blockName,false);
  onOff.setChecked(enabled);
  getView().findViewById(R.id.editWakelockSeconds).setEnabled(onOff.isChecked());
  onOff.setOnTouchListener(new View.OnTouchListener(){
    @Override public boolean onTouch(    View view,    MotionEvent motionEvent){
      if (motionEvent.getAction() == MotionEvent.ACTION_UP) {
        boolean isPremium=false;
        Activity baseActivity=getActivity();
        if (baseActivity instanceof MaterialSettingsActivity) {
          isPremium=((MaterialSettingsActivity)getActivity()).isPremium();
        }
 else         if (baseActivity instanceof TaskerActivity) {
          isPremium=((TaskerActivity)getActivity()).isPremium();
        }
        if (isPremium || mFreeWakelock) {
          final boolean b=!onOff.isChecked();
          if (b && !mKnownSafeWakelock) {
            warnUnknownWakelock(onOff);
          }
 else {
            updateEnabledWakelock(b);
            return false;
          }
        }
 else {
          warnLicensing(onOff);
        }
        return true;
      }
 else {
        return false;
      }
    }
  }
);
  View panel=(View)getView().findViewById(R.id.settingsPanel);
  panel.setBackgroundColor(enabled ? getResources().getColor(R.color.background_panel_enabled) : getResources().getColor(R.color.background_panel_disabled));
  panel.setAlpha(enabled ? 1 : (float).4);
  TextView resetButton=(TextView)view.findViewById(R.id.buttonResetStats);
  resetButton.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View resetView){
      Intent intent=new Intent(XposedReceiver.RESET_ACTION);
      intent.putExtra(XposedReceiver.STAT_TYPE,UnbounceStatsCollection.STAT_CURRENT);
      intent.putExtra(XposedReceiver.STAT_NAME,mStat.getName());
      try {
        getActivity().sendBroadcast(intent);
      }
 catch (      IllegalStateException ise) {
      }
      UnbounceStatsCollection.getInstance().resetLocalStats(mStat.getName());
      loadStatsFromSource(view);
      if (mClearListener != null) {
        mClearListener.onWakelockCleared();
      }
    }
  }
);
  TextView description=(TextView)view.findViewById(R.id.textViewWakelockDescription);
  String descriptionText=EventLookup.getDescription(getActivity(),mStat.getName());
  description.setText(descriptionText);
  mKnownSafeWakelock=EventLookup.isSafe(mStat.getName()) == EventLookup.SAFE;
  mFreeWakelock=EventLookup.isFree(mStat.getName());
}