I'm getting a compiler warning with generics in J2SDK1.5.0

javac -source 1.5 -target 1.5 -Xlint:unchecked Test.java
Test.java:72: warning: unchecked cast to type TYPE mValues = (TYPE[])new Object[aInitialSize];
My code is below, and ideas why this warning appears, is it a bug in my code or is the compiler faulty?
(crosspost warning, I posted the same question on www.javalobby.org, no need for flaming...)
static class Array
     private TYPE [] mValues;
     public Array(int aInitialSize)
          mValues = (TYPE[])new Object[aInitialSize];
     public void set(int aIndex, TYPE aValue)
          mValues[aIndex] = aValue;
     public TYPE get(int aIndex)
          return mValues[aIndex];
Sincerely,
Patrik Olsson

I asked Sun about this and they replayed:
No, because it is not typesafe. Consider the code
class A<T> {
T[] f() { return (T[])new Object[10]; }
This will cause a class cast exception in its caller, even if the caller has no
cast:
A<Integer> ai = new A<Integer>();
Integer[] a = ai.f(); // BOOM!
Don't use arrays. Use collections.

Similar Messages

  • [svn] 3050: Removed compile warning with JDK1.5

    Revision: 3050
    Author: [email protected]
    Date: 2008-08-29 16:48:58 -0700 (Fri, 29 Aug 2008)
    Log Message:
    Removed compile warning with JDK1.5
    Modified Paths:
    blazeds/trunk/modules/core/src/java/flex/messaging/io/BeanProxy.java

    Did you try this:
    http://forum.java.sun.com/thread.jsp?thread=434718&forum=60&message=1964421

  • Compiler warning with Collections.sort() method

    Hi,
    I am sorting a Vector that contains CardTiles objects. CardTiles is a class that extends JButton and implements Comparable. The code works fine but i get the following warning after compilation.
    Note: DeckOfCards.java uses unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    After compiling with -Xlint, i get the following warning;
    DeckOfCards.java:173: warning: [unchecked] unchecked method invocation: <T>sort(java.util.List<T>) in java.util.Collections is applied to (java.util.Vector<CardTiles>)
    Collections.sort(handTwo);
    ^
    What could be the problem? Is Collections.sort() only intended for Collections of type List?
    Many thanks!

    Hi Jverd, my handTwo Vector was declared as follows;
    Vector<CardTiles> handTwo = new Vector<CardTiles>();
    The CardTiles Source code is as follows;
    import javax.swing.*;
    import java.util.*;
    public class CardTiles extends JButton implements Comparable{
         static String typeOfSort = "face";
         public static final long serialVersionUID = 24362462L;
         int i=1;
         public ImageIcon myIcon;
         public Card myCard;
         public CardTiles(ImageIcon i, Card c){
              super(i);
              myIcon = i;
              myCard = c;
         public int compareTo(Object o){
              CardTiles compare = (CardTiles)o;
              if(typeOfSort.equals("face")){
                   Integer ref1 = new Integer(this.myCard.getFaceValue());
                   Integer ref2 = new Integer(compare.myCard.getFaceValue());
                   return ref1.compareTo(ref2);
              }else{
                   if(this.myCard.getFaceValue() > 9 || compare.myCard.getFaceValue() >9){
                        if(this.myCard.getFaceValue() > 9 && compare.myCard.getFaceValue() >9){
                             String ref1 = this.myCard.getSuit().substring(0,(this.myCard.getSuit().length()-1));
                             String ref2 = compare.myCard.getSuit().substring(0,(compare.myCard.getSuit().length()-1));
                             return ref1.compareTo(ref2);
                        }else{
                             if(this.myCard.getFaceValue() > 9 || compare.myCard.getFaceValue() >9){
                                  String ref1 = this.myCard.getSuit().substring(0,(this.myCard.getSuit().length()-1));
                                  String ref2 = compare.myCard.getSuit() + Integer.toString(compare.myCard.getFaceValue());
                                  return ref1.compareTo(ref2);
                             }else{
                                  String ref1 = this.myCard.getSuit() + Integer.toString(this.myCard.getFaceValue());
                                  String ref2 = compare.myCard.getSuit().substring(0,(compare.myCard.getSuit().length()-1));
                                  return ref1.compareTo(ref2);
                   }else{
                        String ref1 = this.myCard.getSuit() + Integer.toString(this.myCard.getFaceValue());
                        String ref2 = compare.myCard.getSuit() + Integer.toString(compare.myCard.getFaceValue());
                        return ref1.compareTo(ref2);
         public String toString(){
              return ( myCard.toString() + " with fileName " + myIcon.toString());
    }What could be wrong?
    Many thanks!

  • Warning with Generics & Aspects

    Hi,
    I�m upgrading an application to use Java 5 generics and I have a warning which I cannot get ride of. My code uses some aspects to monitor some method calls and when I implement generics on the methods return type, I get the following warning from my IDE
    unchecked conversion when advice applied at shadow method-execution(java.util.List com.sample.business.impl.AccountServiceImpl.getAccounts(java.lang.String)), expected java.util.List<com.sample.domain.Account> but advice uses java.util.List [Xlint:uncheckedAdviceConversion]     The method declaration is as follows
    public List<Account> getAccounts(String id) throws CustomExceptionand the around advice on the aspect is as follows without the padding
    List<Account> accounts = proceed();Any idea how I can remove the warning?
    Thanks

    What is advice and how is it declared?
    Means: seems like advice is used in a raw fashion.

  • Compiler bug with generics and private inner classes

    There appears to be a bug in the sun java compiler. This problem was reported against eclipse and the developers their concluded that it must be a problem with javac.
    Idea also seems to compile the example below. I couldn't find a bug report in the sun bug database. Can somebody tell me if this is a bug in javac and if there is a bug report for it.
    https://bugs.eclipse.org/bugs/show_bug.cgi?id=185422
    public class Foo <T>{
    private T myT;
    public T getT() {
    return myT;
    public void setT(T aT) {
    myT = aT;
    public class Bar extends Foo<Bar.Baz> {
    public static void main(String[] args) {
    Bar myBar = new Bar();
    myBar.setT(new Baz());
    System.out.println(myBar.getT().toString());
    private static class Baz {
    @Override
    public String toString() {
    return "Baz";
    Eclipse compiles and runs the code even though the Baz inner class is private.
    javac reports:
    Bar.java:1: Bar.Baz has private access in Bar
    public class Bar extends Foo<Bar.Baz>
    ^
    1 error

    As I said in my original post its not just eclipse that thinks the code snippet is compilable. IntelliJ Idea also parses it without complaining. I haven't looked at the java language spec but intuitively I see no reason why the code should not compile. I don't think eclipse submitting bug reports to sun has anything to do with courage. I would guess they just couldn't be bothered.

  • Compiler bug in 10.1.3 EA1?  get "Internal compilation error" with EnumSet

    The code sample below generates "Error: Internal compilation error, terminated with a fatal exception" when doing make. It's a very simple example, it creates an EnumSet with one element and dumps it via the "toString()" method.
    If I change the line:
    "EnumSet set = EnumSet.of(Buttons.ONE);"
    To:
    "EnumSet set = EnumSet.allOf(c);"
    It works fine. For some reason the "of" method of "EnumSet" crashes the compiler.
    Any ideas?
    ========================================
    package mypackage;
    import java.util.EnumSet;
    public class EnumDemo
    enum Buttons { ONE, TWO, THREE }
    public EnumDemo()
    public void dump()
              Class c = Buttons.class;
              EnumSet set = EnumSet.of(Buttons.ONE);
              System.out.println(set.toString());
    public static void main(String[] args)
    EnumDemo cls = new EnumDemo();
    cls.dump();
    ==============================

    package com.esp.main;
    import java.awt.Dimension;
    import java.awt.event.MouseAdapter;
    import java.awt.event.MouseEvent;
    import javax.swing.JTree;
    import javax.swing.event.TreeModelEvent;
    import javax.swing.event.TreeModelListener;
    import javax.swing.event.TreeSelectionEvent;
    import javax.swing.event.TreeSelectionListener;
    import javax.swing.tree.DefaultTreeModel;
    import javax.swing.tree.TreePath;
    public class TreeNavigator extends JTree {
    private FormMain fm;
    public TreeNavigatorNode selectedTreeNode;
    public TreePath selectedTreePath;
    public JTree thisTree;
    public TreeNavigator(FormMain pFM) {
    fm = pFM;
    thisTree = this;
    addTreeSelectionListener(new TreeSelectionListener() {
    public void valueChanged(TreeSelectionEvent e) {
    selectedTreeNode = (TreeNavigatorNode)thisTree.getLastSelectedPathComponent();
    if (selectedTreeNode == null) {
    return;
    selectedTreePath = e.getPath();
    addMouseListener(new MouseAdapter() {
    public void mouseReleased(MouseEvent e) {
    if (e.getClickCount() == 1) {
    doPopup(e.getX(), e.getY());
    String nodeInternalFrameClassName = selectedTreeNode.getInternalFrameClassName();
    String nodeNodeTypeDesc = selectedTreeNode.getNodeTypeDesc();
    if ((selectedTreeNode != null) && (nodeNodeTypeDesc.equals("FORM") || nodeNodeTypeDesc.equals("GRAPH"))) {
    fm.showInternalFrame(nodeInternalFrameClassName, fm, null);
    } else if (e.getClickCount() == 1) {
    TreePath path = thisTree.getClosestPathForLocation(e.getX(), e.getY());
    thisTree.setSelectionPath(path);
    public void doPopup(int x, int y) {
    if ((selectedTreeNode != null) && selectedTreeNode.nodeTypeDesc.equals("MODULE")) {
    fm.cm.sendString("Do Nothing");
    } else {
    fm.cm.sendString("Launch form");
    setEditable(false);
    setMaximumSize(new java.awt.Dimension(3200, 3200));
    setPreferredSize(new java.awt.Dimension(800, 100));
    setShowsRootHandles(false);
    setLargeModel(false);
    setRootVisible(false);
    setDragEnabled(false);
    DefaultTreeModel treeNavigatorModel = new DefaultTreeModel(fm.treeNavigatorNodeArray[fm.rootNode], true);
    treeModel.addTreeModelListener(new NavigatorTreeModelListener());
    setModel(treeNavigatorModel);
    expandAll(this);
    try {
    jbInit();
    } catch (Exception e) {
    e.printStackTrace();
    public void expandAll(JTree tree) {
    int row = 0;
    while (row < tree.getRowCount()) {
    tree.expandRow(row);
    row++;
    private void jbInit() throws Exception {
    this.setSize(new Dimension(286, 383));
    TreeNavigatorCellRenderer renderer = new TreeNavigatorCellRenderer(fm);
    this.setCellRenderer(renderer);
    class NavigatorTreeModelListener implements TreeModelListener {
    public void treeNodesChanged(TreeModelEvent e) {
    TreeNavigatorNode node;
    node = (TreeNavigatorNode)(e.getTreePath().getLastPathComponent());
    * If the event lists children, then the changed
    * node is the child of the node we've already
    * gotten. Otherwise, the changed node and the
    * specified node are the same.
    try {
    int index = e.getChildIndices()[0];
    node = (TreeNavigatorNode)(node.getChildAt(index));
    } catch (NullPointerException exc) {
    public void treeNodesInserted(TreeModelEvent e) {
    public void treeNodesRemoved(TreeModelEvent e) {
    public void treeStructureChanged(TreeModelEvent e) {
    }

  • Program with generics compiles without -source 1.5 but doesn't run.

    This could probably be considered a bug in J2SE1.5 beta 1.
    A program with generics that is compiled with JDK 1.5 beta1 without the "-source 1.5" option behaves oddly: it compiles but sometimes fails to execute. It shouldn't behave like that. It should fail in the compilation, with a complaint about using the wrong version of the language.
    This odd behaviour doesn't always occur! In the small program below, I get that behaviour when using the EnumSet.range method.
    If I only use the basic EnumSet, it does executes.
    -- Lars
    import java.util.EnumSet;
    import java.util.*;
    public class Example {
         public enum Season { WINTER, SPRING, SUMMER, FALL }
         public static EnumSet<Season> warmSeason = EnumSet.range(Season.SPRING, Season.FALL);
         public static void main(String[] args) {
              System.out.println("Season: ");     
              for (Season s : Season.values()) {
              System.out.println(s);
              System.out.println("Cold Season: ");     
              for (Season s : warmSeason) {
              System.out.println(s);

    Example.java:6: warning: as of release 1.5, 'enum' is a keyword, and may not be used as an identifier
        public enum Season { WINTER, SPRING, SUMMER, FALL }
               ^
    Example.java:6: ';' expected
        public enum Season { WINTER, SPRING, SUMMER, FALL }
                           ^
    Example.java:12: ';' expected
            for (Season s : Season.values()) {
                          ^
    Example.java:17: illegal start of expression
            for (Season s : warmSeason) {
            ^
    Example.java:20: ';' expected
        ^
    4 errors
    1 warning

  • Working with generics generates a compilation error

    hi again,
    i?m trying to work with generics but when i try to compile my work i get a "generics are not supported in -source 1.4" error, i am working with BlueJ, and i have jdk1.5.0_06 installed in my computer, why am i getting this error? is there any parameter I need to change in blueJ, if ti is so, Which one?
    thanks again...

    I actually think that the OP is compiling with Java 5, but he has set source compability to 1.4 on the project (or default settings). The error message "generics are not supported in -source 1.4" indicates the the compiler knows about generics.
    @OP. Look for something like source compability. I have never used BlueJ, but I would guess that you can find it under building/compiling, probably in some project settings.
    Kaj

  • All of the music on my Ipod Touch is blown out after I synched it with my new MacBook. I didn't get the 'synch' warning-- but now can't find my library of songs. I'm about to panic!

    All of the music on my Ipod Touch is blown out after I synched it with my new MacBook. I didn't get the 'synch' warning-- but now can't find my library of songs. I'm about to panic!

    The iPod backup that iTunes makes does not inlcuded synced media like apps and music. Thes those iTunes are not restored to the iPod unless they are in the iTunes library.
    Try:
    - Reset the iOS device. Nothing will be lost
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Unsync all music and resync
    - Reset all settings
    Go to Settings > General > Reset and tap Reset All Settings.
    All your preferences and settings are reset. Information (such as contacts and calendars) and media (such as songs and videos) aren’t affected.
    - Restore from backup. See:       
    iOS: How to back up
    - Restore to factory settings/new iOS device.

  • After upgrading to IOS 8 on my iPad I constantly get a temperature warning despite the fact it is cool. Did not happen with IOS 7. I have restored the iPad to factory settings with the problem not resolved.

    After upgrading to IOS 8 on my iPad I constantly get a temperature warning despite the fact it is cool. Did not happen with IOS 7. I have restored the iPad to factory settings with the problem not resolved.

    Hey, I've got the same problem. Did you find any help or solution by now?

  • After upgrading to IOS 8 on my iPad I constantly get a temperature warning despite the fact it is cool. Did not happen with IOS 7

    After upgrading to IOS 8 on my iPad I constantly get a temperature warning despite the fact it is cool. Did not happen with IOS 7. I have restored the iPad to factory settings with the problem not resolved.

    Both of you please choose the correct forum to start a new topic thread.  Classic has nothing to do with iOS.
    Site map of Communities and Categories

  • Factory Patterns with Generics

    I am trying to combine the good old factory pattern with generics and could use some advice.
    I have the following
    //Base class from which all my things extend
    public abstract class Thing {
    //one kind of thing
    public class ThingOne extends Thing {
    //another kind of thing
    public class ThingTwo extends Thing {
    //interface for my factory
    public interface ThingFactory<T> {
    public T create(long id);
    //a factory for thingones
    public class ThingOneFactory<T> implements ThingFactory<T> {
    public T create(long id) {
    return (T) new ThingOne();
    public class TestClass{
    public <T extends Thing> T getThing(ThingFactory<T> tf){
    //do a bunch of generic stuff to figure out id to call create
    ThingFactory<T> instance = tf;
    return (T) instance.create(Long id);
    }My calling code would know what kind of thing it needs but necessarily the things id. Which can be computed in a generic way.
    TestClass gt = new TestClass();
    gt.getThing(new ThingOneFactory<ThingOne>());This all seems to work properly but I am getting "Type safety: Unchecked cast from ThingOne to T" in my ThingOneFactory
    My T's will always extend Thing, what am I missing? Is there a better way to do this?
    Edited by: nedry on Dec 29, 2009 5:39 PM

    I thought of that after I posted. But that just moves my unsafe cast warning into TestClass.Why?
    return (T) instance.create(Long id);That can't have ever compiled. What is the exact code? And why did you have to cast (what was the warning/error)?

  • [solved] Error compiling wpa_supplicant with broadcom_wl support

    Hello friends.
    I'm using the broadcom_wl driver for my bcm4312 card in my Dell XPS m1530 laptop. Unsecured wifi is tested and works fine.
    I need to use wpa_supplicant to connect to my university's wifi. The core package for wpa_supplicant is not compiled with broadcom support. I tried using the generic wext option, but I get
    Trying to associate with 00:11:92:90:de:e1 (SSID='restricted.utexas.edu' freq=2462 MHz)
    ioctl[SIOCSIWAP]: Device or resource busy
    Association request to the driver failed
    It looks like the generic wext option doesn't work for the bcm4312.
    So I tried to compile wpa_supplicant with broadcom support using ABS with this package: http://aur.archlinux.org/packages.php?ID=18511 from AUR. I enabled broadcom support in the config file and pointed it toward my local copy of wlioctl.h.
    Unfortunately, build() dies with
    In file included from /var/abs/local/broadcom/src/src/include/proto/802.11.h:39,
    from /var/abs/local/broadcom/src/src/include/wlioctl.h:38,
    from ../src/drivers/driver_broadcom.c:34:
    /var/abs/local/broadcom/src/src/include/proto/wpa.h:109:1: warning: this is the location of the previous definition
    ../src/drivers/driver_broadcom.c: In function 'wpa_driver_broadcom_event_receive':
    ../src/drivers/driver_broadcom.c:229: error: 'wl_wpa_header_t' undeclared (first use in this function)
    ../src/drivers/driver_broadcom.c:229: error: (Each undeclared identifier is reported only once
    ../src/drivers/driver_broadcom.c:229: error: for each function it appears in.)
    ../src/drivers/driver_broadcom.c:229: error: 'wwh' undeclared (first use in this function)
    ../src/drivers/driver_broadcom.c:240: error: expected expression before ')' token
    ../src/drivers/driver_broadcom.c:242: error: 'WL_WPA_ETHER_TYPE' undeclared (first use in this function)
    ../src/drivers/driver_broadcom.c:244: error: 'wl_wpa_snap_template' undeclared (first use in this function)
    ../src/drivers/driver_broadcom.c:250: error: 'WLC_ASSOC_MSG' undeclared (first use in this function)
    ../src/drivers/driver_broadcom.c:251: error: 'WL_WPA_HEADER_LEN' undeclared (first use in this function)
    ../src/drivers/driver_broadcom.c:271: error: 'WLC_DISASSOC_MSG' undeclared (first use in this function)
    ../src/drivers/driver_broadcom.c:275: error: 'WLC_PTK_MIC_MSG' undeclared (first use in this function)
    ../src/drivers/driver_broadcom.c:280: error: 'WLC_GTK_MIC_MSG' undeclared (first use in this function)
    ../src/drivers/driver_broadcom.c: In function 'wpa_driver_broadcom_get_scan_results':
    ../src/drivers/driver_broadcom.c:465: error: 'wl_bss_info_t' has no member named 'channel'
    ../src/drivers/driver_broadcom.c: In function 'wpa_driver_broadcom_associate':
    ../src/drivers/driver_broadcom.c:573: error: 'WLC_GET_WEP' undeclared (first use in this function)
    ../src/drivers/driver_broadcom.c:576: error: 'WLC_SET_WEP' undeclared (first use in this function)
    make: *** [../src/drivers/driver_broadcom.o] Error 1
    ==> ERROR: Build Failed.
    I don't know c. Can someone decipher this error for me?
    Thanks in advance.
    EDIT: There are multiple versions of wlioctl.h floating around. I eventually got this to work with the version included with the wrt54g tarball. BUT, wpa_supplicant still had driver problems when being run with the -D broadcom option.
    I eventually got this working with ndiswrapper and instructions found here: https://help.ubuntu.com/community/WifiD … y_No-Fluff
    Pay special attention to the instruction:
    "This Chipset/PCI ID is the correct/reliable way to identify the device: Any other labels can be misleading (e.g., notice that both the '14e4:4311 (rev 02)' and '14e4:4319 (rev 02)' call themselves a "BCM4311 (Rev 02)", even though they are different devices)."
    Download the driver that matches the output of
    lspci -n | grep '14e4:43'
    Anyway, wpa_supplicant still gave me driver troubles when using the -D ndiswrapper option. However, it works well with -D wext.
    Tldr;
    -Your bcm4312 may actually be a BCM4310 (rev 01).
    -Use ndiswrapper with this driver: http://myspamb8.googlepages.com/R174291-pruned.zip
    -use wpa_supplicant with the -D wext option.
    Last edited by BurtHawk101 (2008-11-05 06:28:04)

    falconindy wrote:
    mkinitcpio needs to refuse to run without /dev mounted to avoid errors like this.
    mount -t devtmpfs devtmpfs /dev
    Thanks falconindy, works great now.

  • Compare to 1 Uncheked warning - Needs generics

    I get an "unchecked" warning when compiling (for failing to use generics...). Please help me with this (optimally by revising my code to be generics compliant)! Not that I am quite unfamiliar with generics, and hence could not revise this myself, a brief explanation of your revisions would also be nice.
    public static void sort(Comparable[] array) { //suppress warning for failing to use generics
        Comparable smallest = array[0]; //stores the smallest object
        int smallestLocation = 0; //stores the index of the smallest object
        for (int front = 0; front < array.length-1;front++) {
          smallest = array[front]; //reset variables
          smallestLocation = front;
          for (int i = front;i < array.length;i++) {
            if (smallest.compareTo(array) > 0) { //this if statement sets the smallest location based on comparing every element in the array *error occurs here*
    smallest = array[i];
    smallestLocation = i;
    swap(front,smallestLocation,array); //puts the smallest element at the front of the array
    }Thanks.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    MakingGUIs wrote:
    I have read those! You must have tired out near the end, then. The relevant section (I think) is here:
    [http://java.sun.com/docs/books/tutorial/extra/generics/fineprint.html|http://java.sun.com/docs/books/tutorial/extra/generics/fineprint.html]
    which is near the end of the second tutorial you say you read. (The section headed "Arrays"...) However, frankly, I would modify the method to look like this:
    public static void sort(Object[] array) {
      Arrays.sort(array);
    }

  • Get the Type of a generic field at runtime, How to?

    Hello,
    As the topic already says, i need to get the Type of a particular field of a class. This field is declared private and generic. In C# there is a method
    Type Object.getTypeIs there any specific way to do this in Java 1.5?
    Please excuse my poor english.
    Thanks in advance.
    Markus

    McNepp wrote:
    endasil wrote:
    McNepp wrote:
    If you want to know the parametrized type (String in the example), I think there is no way of knowing this in Java 1.5 or Java 1.6, since the parametrized type is erased and not available at run time.The type of a parameterized field is not erased.For most intents and purposes, it is. Type erasure refers to the fact that at runtime, there are not actually multiple class binaries depending on the generic arguments to a class. Therefore, an ArrayList<T> is actually just an ArrayList with no generics.
    Frankly, I don't understand why you insist that the information on generic fields that the OP was asking about is lost at runtime.I wasn't trying to insist that. At the time, I was replying more to Saish and trying to reaffirm that most information about generics is lost at run-time. I mistakenly ignored how you qualified it with "field."
    What you write about instances of generic classes losing their type information is of course correct, albeit not to the point of the original question.Nope, you're right. I was just trying to reconcile the fact that many people get confused that there's any information available at run-time, and so start down the path of thinking that type erasure doesn't exist. But it very much does.
    The original question was about how to obtain the type of a generic field.And I did show in my example that even that is fairly limited, given that if the type is provided by the parameter of the class, it doesn't give you anything useful (I'm not trying to say you said it would!).
    The compiler preservers this information in the class file, so it can be obtained at runtime. Frameworks like JPA put this to use extensively, proving that it is of real value.Definitely. However I don't see this having as much to do with generics as basic reflection functionality. If you can get the type of a field at run-time, you should be able to get the parameters as well! That should in no way belittle its value, though. But I would have guessed (knowing little about) that JPA wouldn't put that to use so much as the type parameters of an accessor return type or mutator argument type. Especially since I thought we'd shown that you would need your fields to be non-private for JPA to be able to gain information about their type.
    Edit: getDeclaredField works fine with private members, and returns the expected "java.lang.String" from jschell's example above
    Edited by: endasil on 28-Apr-2009 10:39 AM

Maybe you are looking for

  • Ken Burns Effect Simple Question :)

    I'm doing a video slideshow in iMovie '09 and I'm using the Ken Burns effect to pan around the pictures. I'm narrating a childrens book, and as I get to the end of the Ken Burns effect on the photo (zoomed in a little), I'd like to keep the image the

  • Very urgent please ----repetting values in the output

    I am getting values for acc seq   access seq number and codndition table  repeting values as in the output of the report, please have a look in my code and please do respond immediatley. regards always, below is my code and output REPORT zmaster_cond

  • Hide Password in FTP_CONNCET FM

    Hi, In FTP_CONNECT we need to pass user name and password. Here if we pass hard coded password then that thing will be open to all. So my requirement is u201CHow to hide or encrypt FTP user password from user for security reasons?u201D Here I also wa

  • JSP generates error - thread.java:481 - Source code viewing is disabled

    I run IBM WebSphere 3.5.3 on a WinNT platform. When I try to run my JSP testpage (which is a normal HTML page with jsp extension) I get the error message: thread.java:481 - Source code viewing is disabled. What is this? What can I do to get it runnin

  • Display Messagebox From WCF

    Hi I am developing a project having two solutions one for WCF and another for WEB. I want to display a messagebox from WCF so that the user can see the message. How can i do it? What is the best method to do it?  Thanks