Resolve an issue where the error icon is hidden under some cases in JB
due to a bug http://code.google.com/p/android/issues/detail?id=40417
333266
@Override
    public void setError(CharSequence error, Drawable icon) {
        super.setError(error, icon);
        lastErrorIcon = icon;

        // if the error is not null, and we are in JB, force
        // the error to show
        if (error != null /* !isFocused() && */) {
            showErrorIconHax(icon);
        }
    }
1083487
public void addTangoArchiveListener(ITangoArchiveListener listener, String attrName, boolean stateless)
            throws DevFailed {
        addTangoArchiveListener(listener, attrName, new String[0], stateless);
    }
1366627
public void removeTangoChangeListener(ITangoChangeListener listener, String attrName)
            throws DevFailed {
        synchronized (moni) {
            TangoChange tangoChange;
            String key = deviceName+"/"+attrName;
            if ((tangoChange = tango_change_source.get(key)) != null)
                tangoChange.removeTangoChangeListener(listener);
        }
    }
897787
public void removeTangoPeriodicListener(ITangoPeriodicListener listener) 
                throws DevFailed
    {
        event_listeners.remove(ITangoPeriodicListener.class,listener);
        if ( event_listeners.size() == 0 )
           unsubscribe_event(event_identifier);

    }
669655
@SuppressWarnings({"unused", "WeakerAccess"})
    public void pushError(final String errorMessage, final int errorCode) {
        final HashMap<String, Object> props = new HashMap<>();
        props.put("Error Message", errorMessage);
        props.put("Error Code", errorCode);

        try {
            final String activityName = getCurrentActivityName();
            if (activityName != null) {
                props.put("Location", activityName);
            } else {
                props.put("Location", "Unknown");
            }
        } catch (Throwable t) {
            // Ignore
            props.put("Location", "Unknown");
        }

        pushEvent("Error Occurred", props);
    }
1023404
function Unavailable(message, code_id) {
    Error.call(this);
    this.message = message || "temporarily unavailable";
    this.code_id = code_id || null;
    this.statusCode = 503;
}
230087
private static void subscribeIfNotDone(EventCallBackStruct eventCallBackStruct,
                                          String callbackKey) throws DevFailed{

        eventCallBackStruct.consumer.subscribe_event(
                eventCallBackStruct.device,
                eventCallBackStruct.attr_name,
                eventCallBackStruct.event_type,
                eventCallBackStruct.callback,
                eventCallBackStruct.max_size,
                eventCallBackStruct.filters,
                false);
        failed_event_callback_map.remove(callbackKey);
    }
1155916
void replicationError() {
        Log.i(LOG_TAG, "error()");
        reloadTasksFromModel();
        Toast.makeText(getApplicationContext(),
                R.string.replication_error,
                Toast.LENGTH_LONG).show();
        dismissDialog(DIALOG_PROGRESS);
    }
560693
function DiscogsError(statusCode, message){
	Error.captureStackTrace(this, this.constructor);
	this.statusCode = statusCode||404;
	this.message = message||'Unknown error.';
}
546001
public void addTangoUserListener(ITangoUserListener listener, String attrName, String[] filters, boolean stateless)
            throws DevFailed {
        TangoUser tangoUser;
        String key = deviceName+"/"+attrName;
        if ((tangoUser = tango_user_source.get(key)) == null) {
            tangoUser = new TangoUser(deviceProxy, attrName, filters);
            tango_user_source.put(key, tangoUser);
        }

        synchronized (moni) {
            tangoUser.addTangoUserListener(listener, stateless);
        }
    }
478030
public void removeTangoChangeListener(ITangoChangeListener listener)
            throws DevFailed {
        event_listeners.remove(ITangoChangeListener.class, listener);
        if (event_listeners.size() == 0)
            unsubscribe_event(event_identifier);
    }
217677
private void showFacebookAppError() {
        Toast.makeText(mContext, mContext.getString(R.string.wings_facebook__error_facebook_app), Toast.LENGTH_SHORT).show();
    }
1152362
public void addTangoPeriodicListener(ITangoPeriodicListener listener, String attrName, boolean stateless)
            throws DevFailed {
        addTangoPeriodicListener(listener, attrName, new String[0], stateless);
    }
1001948
private void showLinkError() {
        Toast.makeText(mContext, mContext.getString(R.string.wings_dropbox__error_link), Toast.LENGTH_SHORT).show();
    }
718271
def error(self, status_code, request, message=None):
        
        status_code_text = HTTP_STATUS_CODES.get(status_code, 'http error')
        status_error_tag = status_code_text.lower().replace(' ', '_')
        custom_response_map = {
            404: self.make_error_response(
                status_error_tag,
                'The requested URL {} was not found on this service.'.format(
                    request.path
                )
            ),
            400: self.make_error_response(status_error_tag, message),
            405: self.make_error_response(
                status_error_tag,
                'The requested URL {} was not allowed HTTP method {}.'.format(
                    request.path, request.method
                )
            ),
        }
        return self._raw_response(
            status_code,
            custom_response_map.get(
                status_code,
                self.make_error_response(
                    status_error_tag, message or status_code_text
                )
            )
        )
863037
private void iorAnalysis() throws DevFailed {
        if (!iorString.startsWith("IOR:")) {
            throw DevFailedUtils.newDevFailed("CORBA_ERROR", iorString + " not an IOR");
        }
        final ORB orb = ORBManager.getOrb();
        final ParsedIOR pior = new ParsedIOR((org.jacorb.orb.ORB) orb, iorString);
        final org.omg.IOP.IOR ior = pior.getIOR();
        typeId = ior.type_id;
        final List<Profile> profiles = pior.getProfiles();
        for (final Profile profile : profiles) {
            if (profile instanceof IIOPProfile) {
                final IIOPProfile iiopProfile = ((IIOPProfile) profile).to_GIOP_1_0();
                iiopVersion = (int) iiopProfile.version().major + "." + (int) iiopProfile.version().minor;
                final String name = ((IIOPAddress) iiopProfile.getAddress()).getOriginalHost();
                java.net.InetAddress iadd = null;
                try {
                    iadd = java.net.InetAddress.getByName(name);
                } catch (final UnknownHostException e) {
                   throw DevFailedUtils.newDevFailed(e);
                }
                hostName = iadd.getHostName();

                port = ((IIOPAddress) iiopProfile.getAddress()).getPort();
                if (port < 0) {
                    port += 65536;
                }

            } else {
                throw DevFailedUtils.newDevFailed("CORBA_ERROR", iorString + " not an IOR");
            }
        }
        // code for old jacorb 2.3
        // final List<IIOPProfile> profiles = pior.getProfiles();
        // for (IIOPProfile profile : profiles) {
        // iiopVersion = (int) profile.version().major + "." + (int)
        // p.version().minor;
        // final String name = ((IIOPAddress)
        // profile.getAddress()).getOriginalHost();
        // java.net.InetAddress iadd = null;
        // try {
        // iadd = java.net.InetAddress.getByName(name);
        // } catch (final UnknownHostException e) {
        // throw DevFailedUtils.newDevFailed(e);
        // }
        // hostName = iadd.getHostName();
        //
        // port = ((IIOPAddress) profile.getAddress()).getPort();
        // if (port < 0) {
        // port += 65536;
        // }
        // }

    }
503993
@SuppressLint("NewApi")
    @SuppressWarnings("deprecation")
    protected void onPrepareShow() {
        final int sdkVersion = android.os.Build.VERSION.SDK_INT;

        // Modify various attributes of the message TextView
        this.mTextView.setText(this.mStyle.message);
        this.mTextView.setTypeface(this.mTextView.getTypeface(), this.mStyle.messageTypefaceStyle);
        this.mTextView.setTextColor(this.mStyle.messageTextColor);
        this.mTextView.setTextSize(this.mStyle.messageTextSize);
        if (this.mStyle.messageIconResource > 0) {
            if (this.mStyle.messageIconPosition == Style.ICONPOSITION_LEFT) {
                this.mTextView.setCompoundDrawablesWithIntrinsicBounds(
                        this.mStyle.messageIconResource, 0, 0, 0);
            } else if (this.mStyle.messageIconPosition == Style.ICONPOSITION_TOP) {
                this.mTextView.setCompoundDrawablesWithIntrinsicBounds(
                        0, this.mStyle.messageIconResource, 0, 0);
            } else if (this.mStyle.messageIconPosition == Style.ICONPOSITION_RIGHT) {
                this.mTextView.setCompoundDrawablesWithIntrinsicBounds(
                        0, 0, this.mStyle.messageIconResource, 0);
            } else if (this.mStyle.messageIconPosition == Style.ICONPOSITION_BOTTOM) {
                this.mTextView.setCompoundDrawablesWithIntrinsicBounds(
                        0, 0, 0, this.mStyle.messageIconResource);
            }
        }

        // Handle depreciated API for setting the background
        if (sdkVersion >= Build.VERSION_CODES.JELLY_BEAN) {
            this.mView.setBackground(BackgroundUtils.getBackground(this.mStyle, this.mStyle.color));
            // Give Lollipop devices a nice shadow (does not work with transparent backgrounds)
            if (sdkVersion >= Build.VERSION_CODES.LOLLIPOP) mView.setElevation(3f);
        } else this.mView.setBackgroundDrawable(BackgroundUtils.getBackground(this.mStyle, this.mStyle.color));

        // Make adjustments that are specific to Lollipop frames
        if (this.mStyle.frame == Style.FRAME_LOLLIPOP) {
            this.mTextView.setGravity(Gravity.START);

            // We are on a big screen device, show the SuperToast on the bottom left with padding
            if ((this.mContext.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK)
                    >= Configuration.SCREENLAYOUT_SIZE_LARGE) {
                this.mStyle.xOffset = BackgroundUtils.convertToDIP(12);
                this.mStyle.yOffset = BackgroundUtils.convertToDIP(12);
                this.mStyle.width = BackgroundUtils.convertToDIP(288);
                this.mStyle.gravity = Gravity.BOTTOM | Gravity.START;

                // Simple background shape with rounded corners
                final GradientDrawable gradientDrawable = new GradientDrawable();
                gradientDrawable.setCornerRadius(BackgroundUtils.convertToDIP(2));
                gradientDrawable.setColor(this.mStyle.color);

                // Handle depreciated API for setting the background
                if (sdkVersion >= Build.VERSION_CODES.JELLY_BEAN) this.mView.setBackground(gradientDrawable);
                else this.mView.setBackgroundDrawable(gradientDrawable);

            // We are NOT on a big screen device, show the SuperToast on the bottom with NO padding
            } else {
                this.mStyle.yOffset = 0;
                this.mStyle.width = FrameLayout.LayoutParams.MATCH_PARENT;
            }
            
            // Set the priority color of the Lollipop frame if any
            if (this.mStyle.priorityColor != 0) {
                mView.findViewById(R.id.border).setVisibility(View.VISIBLE);
                mView.findViewById(R.id.border).setBackgroundColor(this.mStyle.priorityColor);
            }
        }
        // Used for PriorityQueue comparisons
        this.getStyle().timestamp = System.currentTimeMillis();
    }