Java Code Examples for sun.reflect.misc.MethodUtil#invoke()

The following examples show how to use sun.reflect.misc.MethodUtil#invoke() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MethodElementHandler.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
/**
 * Returns the result of method execution.
 *
 * @param type  the base class
 * @param args  the array of arguments
 * @return the value of this element
 * @throws Exception if calculation is failed
 */
@Override
protected ValueObject getValueObject(Class<?> type, Object[] args) throws Exception {
    Object bean = getContextBean();
    Class<?>[] types = getArgumentTypes(args);
    Method method = (type != null)
            ? MethodFinder.findStaticMethod(type, this.name, types)
            : MethodFinder.findMethod(bean.getClass(), this.name, types);

    if (method.isVarArgs()) {
        args = getArguments(args, method.getParameterTypes());
    }
    Object value = MethodUtil.invoke(method, bean, args);
    return method.getReturnType().equals(void.class)
            ? ValueObjectImpl.VOID
            : ValueObjectImpl.create(value);
}
 
Example 2
Source File: DefaultMXBeanMappingFactory.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
@Override
final Object toNonNullOpenValue(Object value)
        throws OpenDataException {
    CompositeType ct = (CompositeType) getOpenType();
    if (value instanceof CompositeDataView)
        return ((CompositeDataView) value).toCompositeData(ct);
    if (value == null)
        return null;

    Object[] values = new Object[getters.length];
    for (int i = 0; i < getters.length; i++) {
        try {
            Object got = MethodUtil.invoke(getters[i], value, (Object[]) null);
            values[i] = getterMappings[i].toOpenValue(got);
        } catch (Exception e) {
            throw openDataException("Error calling getter for " +
                                    itemNames[i] + ": " + e, e);
        }
    }
    return new CompositeDataSupport(ct, itemNames, values);
}
 
Example 3
Source File: DefaultMXBeanMappingFactory.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
Object fromCompositeData(CompositeData cd,
                         String[] itemNames,
                         MXBeanMapping[] converters)
        throws InvalidObjectException {
    Object o;
    try {
        final Class<?> targetClass = getTargetClass();
        ReflectUtil.checkPackageAccess(targetClass);
        @SuppressWarnings("deprecation")
        Object tmp = targetClass.newInstance();
        o = tmp;
        for (int i = 0; i < itemNames.length; i++) {
            if (cd.containsKey(itemNames[i])) {
                Object openItem = cd.get(itemNames[i]);
                Object javaItem =
                    converters[i].fromOpenValue(openItem);
                MethodUtil.invoke(setters[i], o, new Object[] {javaItem});
            }
        }
    } catch (Exception e) {
        throw invalidObjectException(e);
    }
    return o;
}
 
Example 4
Source File: BasicComboBoxEditor.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
public Object getItem() {
    Object newValue = editor.getText();

    if (oldValue != null && !(oldValue instanceof String))  {
        // The original value is not a string. Should return the value in it's
        // original type.
        if (newValue.equals(oldValue.toString()))  {
            return oldValue;
        } else {
            // Must take the value from the editor and get the value and cast it to the new type.
            Class<?> cls = oldValue.getClass();
            try {
                Method method = MethodUtil.getMethod(cls, "valueOf", new Class[]{String.class});
                newValue = MethodUtil.invoke(method, oldValue, new Object[] { editor.getText()});
            } catch (Exception ex) {
                // Fail silently and return the newValue (a String object)
            }
        }
    }
    return newValue;
}
 
Example 5
Source File: PropertyElementHandler.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Performs the search of the setter for the property
 * with specified {@code name} in specified class
 * and updates value of the property.
 *
 * @param bean   the context bean that contains property
 * @param name   the name of the property
 * @param index  the index of the indexed property
 * @param value  the new value for the property
 * @throws IllegalAccessException    if the property is not accesible
 * @throws IntrospectionException    if the bean introspection is failed
 * @throws InvocationTargetException if the setter cannot be invoked
 * @throws NoSuchMethodException     if the setter is not found
 */
private static void setPropertyValue(Object bean, String name, Integer index, Object value) throws IllegalAccessException, IntrospectionException, InvocationTargetException, NoSuchMethodException {
    Class<?> type = bean.getClass();
    Class<?> param = (value != null)
            ? value.getClass()
            : null;

    if (index == null) {
        MethodUtil.invoke(findSetter(type, name, param), bean, new Object[] {value});
    } else if (type.isArray() && (name == null)) {
        Array.set(bean, index, value);
    } else {
        MethodUtil.invoke(findSetter(type, name, int.class, param), bean, new Object[] {index, value});
    }
}
 
Example 6
Source File: TransferHandler.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns an object which represents the data to be transferred.  The class
 * of the object returned is defined by the representation class of the flavor.
 *
 * @param flavor the requested flavor for the data
 * @see DataFlavor#getRepresentationClass
 * @exception IOException                if the data is no longer available
 *              in the requested flavor.
 * @exception UnsupportedFlavorException if the requested data flavor is
 *              not supported.
 */
public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException {
    if (! isDataFlavorSupported(flavor)) {
        throw new UnsupportedFlavorException(flavor);
    }
    Method reader = property.getReadMethod();
    Object value = null;
    try {
        value = MethodUtil.invoke(reader, component, (Object[])null);
    } catch (Exception ex) {
        throw new IOException("Property read failed: " + property.getName());
    }
    return value;
}
 
Example 7
Source File: PropertyElementHandler.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
/**
 * Performs the search of the setter for the property
 * with specified {@code name} in specified class
 * and updates value of the property.
 *
 * @param bean   the context bean that contains property
 * @param name   the name of the property
 * @param index  the index of the indexed property
 * @param value  the new value for the property
 * @throws IllegalAccessException    if the property is not accesible
 * @throws IntrospectionException    if the bean introspection is failed
 * @throws InvocationTargetException if the setter cannot be invoked
 * @throws NoSuchMethodException     if the setter is not found
 */
private static void setPropertyValue(Object bean, String name, Integer index, Object value) throws IllegalAccessException, IntrospectionException, InvocationTargetException, NoSuchMethodException {
    Class<?> type = bean.getClass();
    Class<?> param = (value != null)
            ? value.getClass()
            : null;

    if (index == null) {
        MethodUtil.invoke(findSetter(type, name, param), bean, new Object[] {value});
    } else if (type.isArray() && (name == null)) {
        Array.set(bean, index, value);
    } else {
        MethodUtil.invoke(findSetter(type, name, int.class, param), bean, new Object[] {index, value});
    }
}
 
Example 8
Source File: TransferHandler.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns an object which represents the data to be transferred.  The class
 * of the object returned is defined by the representation class of the flavor.
 *
 * @param flavor the requested flavor for the data
 * @see DataFlavor#getRepresentationClass
 * @exception IOException                if the data is no longer available
 *              in the requested flavor.
 * @exception UnsupportedFlavorException if the requested data flavor is
 *              not supported.
 */
public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException {
    if (! isDataFlavorSupported(flavor)) {
        throw new UnsupportedFlavorException(flavor);
    }
    Method reader = property.getReadMethod();
    Object value = null;
    try {
        value = MethodUtil.invoke(reader, component, (Object[])null);
    } catch (Exception ex) {
        throw new IOException("Property read failed: " + property.getName());
    }
    return value;
}
 
Example 9
Source File: TransferHandler.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Causes a transfer to a component from a clipboard or a
 * DND drop operation.  The <code>Transferable</code> represents
 * the data to be imported into the component.
 * <p>
 * Note: Swing now calls the newer version of <code>importData</code>
 * that takes a <code>TransferSupport</code>, which in turn calls this
 * method (if the component in the {@code TransferSupport} is a
 * {@code JComponent}). Developers are encouraged to call and override the
 * newer version as it provides more information (and is the only
 * version that supports use with a {@code TransferHandler} set directly
 * on a {@code JFrame} or other non-{@code JComponent}).
 *
 * @param comp  the component to receive the transfer;
 *              provided to enable sharing of <code>TransferHandler</code>s
 * @param t     the data to import
 * @return  true if the data was inserted into the component, false otherwise
 * @see #importData(TransferHandler.TransferSupport)
 */
public boolean importData(JComponent comp, Transferable t) {
    PropertyDescriptor prop = getPropertyDescriptor(comp);
    if (prop != null) {
        Method writer = prop.getWriteMethod();
        if (writer == null) {
            // read-only property. ignore
            return false;
        }
        Class<?>[] params = writer.getParameterTypes();
        if (params.length != 1) {
            // zero or more than one argument, ignore
            return false;
        }
        DataFlavor flavor = getPropertyDataFlavor(params[0], t.getTransferDataFlavors());
        if (flavor != null) {
            try {
                Object value = t.getTransferData(flavor);
                Object[] args = { value };
                MethodUtil.invoke(writer, comp, args);
                return true;
            } catch (Exception ex) {
                System.err.println("Invocation failed");
                // invocation code
            }
        }
    }
    return false;
}
 
Example 10
Source File: TransferHandler.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/**
 * Causes a transfer to a component from a clipboard or a
 * DND drop operation.  The <code>Transferable</code> represents
 * the data to be imported into the component.
 * <p>
 * Note: Swing now calls the newer version of <code>importData</code>
 * that takes a <code>TransferSupport</code>, which in turn calls this
 * method (if the component in the {@code TransferSupport} is a
 * {@code JComponent}). Developers are encouraged to call and override the
 * newer version as it provides more information (and is the only
 * version that supports use with a {@code TransferHandler} set directly
 * on a {@code JFrame} or other non-{@code JComponent}).
 *
 * @param comp  the component to receive the transfer;
 *              provided to enable sharing of <code>TransferHandler</code>s
 * @param t     the data to import
 * @return  true if the data was inserted into the component, false otherwise
 * @see #importData(TransferHandler.TransferSupport)
 */
public boolean importData(JComponent comp, Transferable t) {
    PropertyDescriptor prop = getPropertyDescriptor(comp);
    if (prop != null) {
        Method writer = prop.getWriteMethod();
        if (writer == null) {
            // read-only property. ignore
            return false;
        }
        Class<?>[] params = writer.getParameterTypes();
        if (params.length != 1) {
            // zero or more than one argument, ignore
            return false;
        }
        DataFlavor flavor = getPropertyDataFlavor(params[0], t.getTransferDataFlavors());
        if (flavor != null) {
            try {
                Object value = t.getTransferData(flavor);
                Object[] args = { value };
                MethodUtil.invoke(writer, comp, args);
                return true;
            } catch (Exception ex) {
                System.err.println("Invocation failed");
                // invocation code
            }
        }
    }
    return false;
}
 
Example 11
Source File: EventHandler.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
private Object applyGetters(Object target, String getters) {
    if (getters == null || getters.isEmpty()) {
        return target;
    }
    int firstDot = getters.indexOf('.');
    if (firstDot == -1) {
        firstDot = getters.length();
    }
    String first = getters.substring(0, firstDot);
    String rest = getters.substring(Math.min(firstDot + 1, getters.length()));

    try {
        Method getter = null;
        if (target != null) {
            getter = Statement.getMethod(target.getClass(),
                                  "get" + NameGenerator.capitalize(first),
                                  new Class<?>[]{});
            if (getter == null) {
                getter = Statement.getMethod(target.getClass(),
                               "is" + NameGenerator.capitalize(first),
                               new Class<?>[]{});
            }
            if (getter == null) {
                getter = Statement.getMethod(target.getClass(), first, new Class<?>[]{});
            }
        }
        if (getter == null) {
            throw new RuntimeException("No method called: " + first +
                                       " defined on " + target);
        }
        Object newTarget = MethodUtil.invoke(getter, target, new Object[]{});
        return applyGetters(newTarget, rest);
    }
    catch (Exception e) {
        throw new RuntimeException("Failed to call method: " + first +
                                   " on " + target, e);
    }
}
 
Example 12
Source File: TransferHandler.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Causes a transfer to a component from a clipboard or a
 * DND drop operation.  The <code>Transferable</code> represents
 * the data to be imported into the component.
 * <p>
 * Note: Swing now calls the newer version of <code>importData</code>
 * that takes a <code>TransferSupport</code>, which in turn calls this
 * method (if the component in the {@code TransferSupport} is a
 * {@code JComponent}). Developers are encouraged to call and override the
 * newer version as it provides more information (and is the only
 * version that supports use with a {@code TransferHandler} set directly
 * on a {@code JFrame} or other non-{@code JComponent}).
 *
 * @param comp  the component to receive the transfer;
 *              provided to enable sharing of <code>TransferHandler</code>s
 * @param t     the data to import
 * @return  true if the data was inserted into the component, false otherwise
 * @see #importData(TransferHandler.TransferSupport)
 */
public boolean importData(JComponent comp, Transferable t) {
    PropertyDescriptor prop = getPropertyDescriptor(comp);
    if (prop != null) {
        Method writer = prop.getWriteMethod();
        if (writer == null) {
            // read-only property. ignore
            return false;
        }
        Class<?>[] params = writer.getParameterTypes();
        if (params.length != 1) {
            // zero or more than one argument, ignore
            return false;
        }
        DataFlavor flavor = getPropertyDataFlavor(params[0], t.getTransferDataFlavors());
        if (flavor != null) {
            try {
                Object value = t.getTransferData(flavor);
                Object[] args = { value };
                MethodUtil.invoke(writer, comp, args);
                return true;
            } catch (Exception ex) {
                System.err.println("Invocation failed");
                // invocation code
            }
        }
    }
    return false;
}
 
Example 13
Source File: DefaultMXBeanMappingFactory.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
final Object fromCompositeData(CompositeData cd,
                               String[] itemNames,
                               MXBeanMapping[] converters)
        throws InvalidObjectException {
    try {
        return MethodUtil.invoke(fromMethod, null, new Object[] {cd});
    } catch (Exception e) {
        final String msg = "Failed to invoke from(CompositeData)";
        throw invalidObjectException(msg, e);
    }
}
 
Example 14
Source File: TransferHandler.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Causes a transfer to a component from a clipboard or a
 * DND drop operation.  The <code>Transferable</code> represents
 * the data to be imported into the component.
 * <p>
 * Note: Swing now calls the newer version of <code>importData</code>
 * that takes a <code>TransferSupport</code>, which in turn calls this
 * method (if the component in the {@code TransferSupport} is a
 * {@code JComponent}). Developers are encouraged to call and override the
 * newer version as it provides more information (and is the only
 * version that supports use with a {@code TransferHandler} set directly
 * on a {@code JFrame} or other non-{@code JComponent}).
 *
 * @param comp  the component to receive the transfer;
 *              provided to enable sharing of <code>TransferHandler</code>s
 * @param t     the data to import
 * @return  true if the data was inserted into the component, false otherwise
 * @see #importData(TransferHandler.TransferSupport)
 */
public boolean importData(JComponent comp, Transferable t) {
    PropertyDescriptor prop = getPropertyDescriptor(comp);
    if (prop != null) {
        Method writer = prop.getWriteMethod();
        if (writer == null) {
            // read-only property. ignore
            return false;
        }
        Class<?>[] params = writer.getParameterTypes();
        if (params.length != 1) {
            // zero or more than one argument, ignore
            return false;
        }
        DataFlavor flavor = getPropertyDataFlavor(params[0], t.getTransferDataFlavors());
        if (flavor != null) {
            try {
                Object value = t.getTransferData(flavor);
                Object[] args = { value };
                MethodUtil.invoke(writer, comp, args);
                return true;
            } catch (Exception ex) {
                System.err.println("Invocation failed");
                // invocation code
            }
        }
    }
    return false;
}
 
Example 15
Source File: DefaultMXBeanMappingFactory.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
final Object fromCompositeData(CompositeData cd,
                               String[] itemNames,
                               MXBeanMapping[] converters)
        throws InvalidObjectException {
    try {
        return MethodUtil.invoke(fromMethod, null, new Object[] {cd});
    } catch (Exception e) {
        final String msg = "Failed to invoke from(CompositeData)";
        throw invalidObjectException(msg, e);
    }
}
 
Example 16
Source File: EventHandler.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private Object applyGetters(Object target, String getters) {
    if (getters == null || getters.equals("")) {
        return target;
    }
    int firstDot = getters.indexOf('.');
    if (firstDot == -1) {
        firstDot = getters.length();
    }
    String first = getters.substring(0, firstDot);
    String rest = getters.substring(Math.min(firstDot + 1, getters.length()));

    try {
        Method getter = null;
        if (target != null) {
            getter = Statement.getMethod(target.getClass(),
                                  "get" + NameGenerator.capitalize(first),
                                  new Class<?>[]{});
            if (getter == null) {
                getter = Statement.getMethod(target.getClass(),
                               "is" + NameGenerator.capitalize(first),
                               new Class<?>[]{});
            }
            if (getter == null) {
                getter = Statement.getMethod(target.getClass(), first, new Class<?>[]{});
            }
        }
        if (getter == null) {
            throw new RuntimeException("No method called: " + first +
                                       " defined on " + target);
        }
        Object newTarget = MethodUtil.invoke(getter, target, new Object[]{});
        return applyGetters(newTarget, rest);
    }
    catch (Exception e) {
        throw new RuntimeException("Failed to call method: " + first +
                                   " on " + target, e);
    }
}
 
Example 17
Source File: AbstractRegionPainter.java    From JDKSourceCode1.8 with MIT License 4 votes vote down vote up
/**
 * Get a color property from the given JComponent. First checks for a
 * <code>getXXX()</code> method and if that fails checks for a client
 * property with key <code>property</code>. If that still fails to return
 * a Color then <code>defaultColor</code> is returned.
 *
 * @param c The component to get the color property from
 * @param property The name of a bean style property or client property
 * @param defaultColor The color to return if no color was obtained from
 *        the component.
 * @return The color that was obtained from the component or defaultColor
 */
protected final Color getComponentColor(JComponent c, String property,
                                        Color defaultColor,
                                        float saturationOffset,
                                        float brightnessOffset,
                                        int alphaOffset) {
    Color color = null;
    if (c != null) {
        // handle some special cases for performance
        if ("background".equals(property)) {
            color = c.getBackground();
        } else if ("foreground".equals(property)) {
            color = c.getForeground();
        } else if (c instanceof JList && "selectionForeground".equals(property)) {
            color = ((JList) c).getSelectionForeground();
        } else if (c instanceof JList && "selectionBackground".equals(property)) {
            color = ((JList) c).getSelectionBackground();
        } else if (c instanceof JTable && "selectionForeground".equals(property)) {
            color = ((JTable) c).getSelectionForeground();
        } else if (c instanceof JTable && "selectionBackground".equals(property)) {
            color = ((JTable) c).getSelectionBackground();
        } else {
            String s = "get" + Character.toUpperCase(property.charAt(0)) + property.substring(1);
            try {
                Method method = MethodUtil.getMethod(c.getClass(), s, null);
                color = (Color) MethodUtil.invoke(method, c, null);
            } catch (Exception e) {
                //don't do anything, it just didn't work, that's all.
                //This could be a normal occurance if you use a property
                //name referring to a key in clientProperties instead of
                //a real property
            }
            if (color == null) {
                Object value = c.getClientProperty(property);
                if (value instanceof Color) {
                    color = (Color) value;
                }
            }
        }
    }
    // we return the defaultColor if the color found is null, or if
    // it is a UIResource. This is done because the color for the
    // ENABLED state is set on the component, but you don't want to use
    // that color for the over state. So we only respect the color
    // specified for the property if it was set by the user, as opposed
    // to set by us.
    if (color == null || color instanceof UIResource) {
        return defaultColor;
    } else if (saturationOffset != 0 || brightnessOffset != 0 || alphaOffset != 0) {
        float[] tmp = Color.RGBtoHSB(color.getRed(), color.getGreen(), color.getBlue(), null);
        tmp[1] = clamp(tmp[1] + saturationOffset);
        tmp[2] = clamp(tmp[2] + brightnessOffset);
        int alpha = clamp(color.getAlpha() + alphaOffset);
        return new Color((Color.HSBtoRGB(tmp[0], tmp[1], tmp[2]) & 0xFFFFFF) | (alpha <<24));
    } else {
        return color;
    }
}
 
Example 18
Source File: StandardMBeanIntrospector.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
@Override
Object invokeM2(Method m, Object target, Object[] args, Object cookie)
        throws InvocationTargetException, IllegalAccessException,
               MBeanException {
    return MethodUtil.invoke(m, target, args);
}
 
Example 19
Source File: AbstractRegionPainter.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Get a color property from the given JComponent. First checks for a
 * <code>getXXX()</code> method and if that fails checks for a client
 * property with key <code>property</code>. If that still fails to return
 * a Color then <code>defaultColor</code> is returned.
 *
 * @param c The component to get the color property from
 * @param property The name of a bean style property or client property
 * @param defaultColor The color to return if no color was obtained from
 *        the component.
 * @return The color that was obtained from the component or defaultColor
 */
protected final Color getComponentColor(JComponent c, String property,
                                        Color defaultColor,
                                        float saturationOffset,
                                        float brightnessOffset,
                                        int alphaOffset) {
    Color color = null;
    if (c != null) {
        // handle some special cases for performance
        if ("background".equals(property)) {
            color = c.getBackground();
        } else if ("foreground".equals(property)) {
            color = c.getForeground();
        } else if (c instanceof JList && "selectionForeground".equals(property)) {
            color = ((JList) c).getSelectionForeground();
        } else if (c instanceof JList && "selectionBackground".equals(property)) {
            color = ((JList) c).getSelectionBackground();
        } else if (c instanceof JTable && "selectionForeground".equals(property)) {
            color = ((JTable) c).getSelectionForeground();
        } else if (c instanceof JTable && "selectionBackground".equals(property)) {
            color = ((JTable) c).getSelectionBackground();
        } else {
            String s = "get" + Character.toUpperCase(property.charAt(0)) + property.substring(1);
            try {
                Method method = MethodUtil.getMethod(c.getClass(), s, null);
                color = (Color) MethodUtil.invoke(method, c, null);
            } catch (Exception e) {
                //don't do anything, it just didn't work, that's all.
                //This could be a normal occurance if you use a property
                //name referring to a key in clientProperties instead of
                //a real property
            }
            if (color == null) {
                Object value = c.getClientProperty(property);
                if (value instanceof Color) {
                    color = (Color) value;
                }
            }
        }
    }
    // we return the defaultColor if the color found is null, or if
    // it is a UIResource. This is done because the color for the
    // ENABLED state is set on the component, but you don't want to use
    // that color for the over state. So we only respect the color
    // specified for the property if it was set by the user, as opposed
    // to set by us.
    if (color == null || color instanceof UIResource) {
        return defaultColor;
    } else if (saturationOffset != 0 || brightnessOffset != 0 || alphaOffset != 0) {
        float[] tmp = Color.RGBtoHSB(color.getRed(), color.getGreen(), color.getBlue(), null);
        tmp[1] = clamp(tmp[1] + saturationOffset);
        tmp[2] = clamp(tmp[2] + brightnessOffset);
        int alpha = clamp(color.getAlpha() + alphaOffset);
        return new Color((Color.HSBtoRGB(tmp[0], tmp[1], tmp[2]) & 0xFFFFFF) | (alpha <<24));
    } else {
        return color;
    }
}
 
Example 20
Source File: StandardMBeanIntrospector.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
@Override
Object invokeM2(Method m, Object target, Object[] args, Object cookie)
        throws InvocationTargetException, IllegalAccessException,
               MBeanException {
    return MethodUtil.invoke(m, target, args);
}