Java Generics problem

abstract class ABS<K extends Number>
     public abstract <K> K useMe(Object k);// understood ..
     public abstract <K> ABS<? extends Number> useMe(ABS<? super K> k)     ; //1
     public abstract <K> ABS<? super Number> useMe(ABS<? extends K> k); //2
     public abstract <K> ABS<K> useMe(ABS<K> k);// understood ..
1 and 2 this both should not work because K can be anything here....
can anyone please explain???
Thanks in advance...

user13384537 wrote:
Firstly thanks for your kind reply .....
can you please elaborate it more ???? because i am confused too much in generic methods especially ....i am preparing for OCPJP and i am not getting reply for this question any where. You are first to reply this question...Both "? super Number" and "? super K" (indeed, "? super {anything}") represent unknown types with no upper bound. While it's true that they could both, in fact, be 'Number's, the compiler has no way of knowing this, which is why it's invalid for an ABS (because you've already defined it as taking a type that extends Number).
I'll be flamed if I'm wrong; but that's the way I understand it.
My suggestion would be to look at the [url http://download.oracle.com/javase/tutorial/extra/generics/index.html]Gilad Bracha tutorial. It's quite long in the tooth, but it's still the best one around, I reckon.
Winston

Similar Messages

  • One thing java generics are missing

    specialization!
    I'll give you a templated example with a function here:
    template <typename T>
    inline std::string to_string(const T& t)
    std::istringstream ss;
    ss << t;
    return ss.str();
    that's one of those standard conversion snippets that everyone uses... as long as T supports the "<<" operator, it will convert just fine...
    Now, if you're using this function in other template based code, the problem comes up:
    template <typename T>
    void foo(const T& t)
    std::string s = to_string(t);
    ... do something with s now...
    it makes sense, if you want to do operations with a string... but what if the type T *was* a string... the to_string function just did a whole mess of needless operations (stringstream conversion)...
    here comes template specialization to the rescue:
    template <> inline std::string to_string<std::string>(const std::string& t)
    return t;
    there we go... no extra steps... because it's inlined to begin with, the compiler will remove it... (this is what's called a conversion shim).  Now when the to_string function is called with an std::string argument, it does nothing.

    Hmmm, it seems I didn't explain it too well:
    the 3rd snippit is the same as the first, however the "typename T" has been removed and all instances of "T" have been replaced with a specific type: this is template specialization... it allows for you to have different code for each type... it's a complicated form of function overloading....
    what I'm saying is that, in a java generic collection, you may have all this code that works for all types, but could be optimized for one of those types... I used string above...
    for instance... let's say there's a member function to count the number of characters used if the type were converted to a string... the easiest thing to do would be to convert it to a string an get the length.... however, in the case of numbers, there's a much, much more efficient way to do it (can't recall the algorithm... but you can get the number of digits with division and maybe a log10 or something...)... this is a mundane case, but even if you did want to use that math for the int version of that generic, you couldn't...

  • Generics problem - unchecked and unsafe problems

    basically my teacher said it needs to run if she types in "% javac *.java " otherwise i'll get a zero...
    so with that said, i've read that to fix the generic problem you can do the -Xlint:unchecked but that wont help me.
    and i've also read about raw types being the source of the problem, but now i'm completely stuck as to how to fix it. any suggestions would be greatly appreciated.
    here is my source code for the file that is causing this:
    import java.io.*;
    import java.util.*;
    public class OrderedLinkedList<T> implements OrderedListADT<T>
         private int size;
         private DoubleNode<T> current;
         public OrderedLinkedList()
              size = 0;
              current = null;
         public void add (T element)
              boolean notBegin = true;
              size = size + 1;
              if (isEmpty())
                   current = new DoubleNode<T>(element);
              while (current.getPrevious() != null)
                   current = current.getPrevious();
              Comparable<T> cElement = (Comparable<T>)element;
              while (cElement.compareTo(current.getElement()) > 0)
                   if (current.getNext() != null)
                        current = current.getNext();
                   else
                        notBegin = false;
              if (notBegin)
                   DoubleNode<T> temp = new DoubleNode<T>(element);
                   DoubleNode<T> temp2 = current;
                   current.setPrevious(temp);
                   temp.setNext(current);
                   temp.setPrevious(temp2.getPrevious());
                   current = temp;
              else
                   DoubleNode<T> temp = new DoubleNode<T>(element);
                   while (current.getPrevious() != null)
                        current = current.getPrevious();
                   temp.setNext(current);
                   current.setPrevious(temp);
         public T removeFirst()
              try
                   if (isEmpty())
                        throw new EmptyCollectionException("List");
              catch (EmptyCollectionException e)
                   System.out.println(e.getMessage());
              while (current.getPrevious() != null)
                   current = current.getPrevious();
              DoubleNode<T> temp = current;
              current = temp.getNext();
              size = size - 1;
              return temp.getElement();
         public T removeLast()
              try
                   if (isEmpty())
                        throw new EmptyCollectionException("List");
              catch (EmptyCollectionException e)
                   System.out.println(e.getMessage());
              while (current.getNext() != null)
                   current = current.getNext();
              DoubleNode<T> temp = current;
              current = temp.getPrevious();
              size = size - 1;
              return temp.getElement();
         public T first()
              try
                   if (isEmpty())
                        throw new EmptyCollectionException("List");
              catch (EmptyCollectionException e)
                   System.out.println(e.getMessage());
              while (current.getPrevious() != null)
                   current = current.getPrevious();
              return current.getElement();
         public T last()
              try
                   if (isEmpty())
                        throw new EmptyCollectionException("List");
              catch (EmptyCollectionException e)
                   System.out.println(e.getMessage());
              while (current.getNext() != null)
                   current = current.getNext();
              return current.getElement();
         public int size()
              return size;
         public boolean isEmpty()
              if (size == 0)
                   return true;
              else
                   return false;
         public String toString()
               return "An ordered linked list.";
    }the other file that uses this class:
    import java.io.*;
    import java.util.StringTokenizer;
    public class ListBuilder
         public static void main(String[] args) throws IOException
              String input;
              StringTokenizer st;
              int current;
              OrderedLinkedList<Integer> list = new OrderedLinkedList<Integer>();
              FileReader fr = new FileReader("C://TestData.txt");
              BufferedReader br = new BufferedReader(fr);
              input = br.readLine();
              while (input != null)
                   st = new StringTokenizer(input);
                   while (st.hasMoreTokens())
                        current = Integer.parseInt(st.nextToken());
                        if (current != -987654321)
                             list.add(current);
                        else
                             try
                                  unload(list);
                             catch(EmptyCollectionException f)
                                  System.out.println(f.getMessage());
                   input = br.readLine();
              System.out.println("Glad That's Over!");
         public static void unload(OrderedLinkedList<Integer> a) throws EmptyCollectionException
              while (!a.isEmpty())
                   System.out.println(a.removeFirst());
                   if (!a.isEmpty())
                        System.out.println(a.removeLast());
              System.out.println("That's all Folks!\n");
    }

    i tried @SuppressWarnings("unchecked") and that didnt work. so i ran it and it showed these errors:
    Exception in thread "main" java.lang.NullPointerException
    at OrderedLinkedList.add(OrderedLinkedList.java:30)
    at ListBuilder.main(ListBuilder.java:32)
    Press any key to continue...
    which would be:
              while (current.getPrevious() != null)and:
                             list.add(current);

  • Can someone help me understand this? (java generics wildcards)

    Hi all.
    First of all this is my first post on sun forums. Besides that i only used java for few weeks now and i think java is quit a nice language.
    I do have a question regarding java generics and wildcard casting (if you can call it that).
    Assume you have following code.
    public class Test <T extends Number> {
         private T x;
         Test(T x)
              this.x = x;
         T getX()
              return x;
         <U extends Number> void setX(U x)
              this.x = (T)x;
    public class Main {
         public static void main(String[] args) {
              Test<Integer> p = new Test <Integer>(5);
              System.out.println(p.getX());
              p.setX(53.32);
              System.out.println(p.getX());
    }This compiles with following results:
    5
    53.32
    Question:
    First: If I declared p to be of type Test<Integer> then why did x in Test class changed its type from Integer to Double?
    Second: Is this a possible unchecked casting behavior? and if so why does this work but doing something like this :
    Integer x = 5 ;
    Double y = 6.32;
    x=(Integer)y;fails with compile time error?

    Hello and welcome to the Sun Java forums.
    The behavior you describe would not occur if your setX(?) method used T instead of another type constraint.
    However, let's look at why it works!
    At line 1 in main, you create your Test with a type parameter of Integer; this becomes the type variable T for that particular instance of Test. The only constraint is that the type extends/implements Number, which Integer does.
    At line 2 you obtain a reference to a Number, which is what getX() is guaranteed to return. toString() is called on that object, etc.
    At line 3 you set the Number in the Test to a Double, which fits the type constraint U extends Number, as well as the type constraint T extends Number which is unused (!). Note that using a different type constraint for U, such as U extends Object or U super Number, could cause a compile-time error.
    At line 4 you obtain a reference to a Number, which is what getX() is guaranteed to return.
    The quirky behavior of setX is due to the second type constraint, which is obeyed separately; in this case, you probably want to use void setX(T x) {
    this.x = x;
    }edit: For the second part of your question, x = (Integer)y; fails because Integer and Double are distinct types; that is, Integer is not a subclass of Double and Double is not a subclass of Integer. This code would compile and work correctly: Number x = 5 ;
    Double y = 6.32;
    x=y;s
    Edited by: Looce on Nov 15, 2008 7:15 PM

  • Java Session problem while sending mail(using javamail) using Pl/SQL

    Hello ...
    i am using Java stored procedure to send mail. but i'm getting java session problem. means only once i can execute that procedure
    pls any help.

    props.put("smtp.gmail.com",host);I doubt javamail recognizes the 'smtp.gmail.com' property. I think it expects 'mail.host'. Of course since it cannot find a specified howt it assumes by default localhost
    Please format your code when you post the next time, there is a nice 'code' button above the post area.
    Mike

  • Java Programming Problem

    Hi all,
    I was looking for this java programming problem which had to do with a large building and there was some gallons of water involved in it too somehow and we had to figure out the height of the buiding using java. This problem is also in one of the java books and I really need to find out all details about this problem and the solution. NEED HELP!!
    Thanks
    mac

    Yes, it will. The water will drain from the bottom of
    the tank until the pressure from the water inside the
    tank equals the pressure from the pipe. In other
    words, without a pump, the water will drain out until
    there is the same amount of water in the tank as in
    the pipe The water pressure depends on the depth of the water, not the volume. So once the depth of the water inside the pipe reaches the same depth as the water inside the tank it will stop flowing. This will never be above the height of the tank.
    I found this applet which demonstrates our problem. If you run it you can drag the guy up to the top, when water in his hose reaches the level of the water in the tank it will stop flowing out.

  • Java Uninstall Problem

    Java Uninstall Problem
    This all came about because of a failed uninstall, using Your Uninstaller.
    The {Java runtime which is all I want) is not listed now & I tried all the other fix bad uninstall type features, all to no avail.} )
    When I DL & run the latest package (jxpiinstall-6u11-fcs-bin-b90-windows-i586-25_nov_2008.exe}
    & run it I get:
    1st message:
         "This software has already been installed on your computer.
         Would you like to install it?"
    If I say no, it exits.
    If I say yes, I get this second message:
         :This action is only valid for products that are currently installed."
    So Now I have no Java & have no idea what to do.
    Any help would be greatly appreciated.
    Thanks, Neuromancer23

    Sorry...after posting it i realized there was a more appropriate forum, of which it took quiet awhile to find.)
    Now that I know where to find the forum list I will never double-post again.
    I'll close the question if I can

  • How to represent java generics in UML

    Hello,
    Can anyone tell me how to represent java generics in UML? Say I have ClassA<ClassB>. How do I represent this in UML?
    Thanks in advance,
    Julien Martin.

    More formally you can use parameterized types.
                : T:Classifier :
      +---------:..............:
      |    ClassA    |
    <<bind>> <T -> ClassB>
    | ClassA<ClassB> |
      Which may be useful if you have different instantiations of ClassA<T> with different values of T.
    Pete
    (I really must get round to making an ascii art UML editor sometime)

  • Sun Java security problems

    Please any one tel me about Sun Java security problems
    with Desktop application

    Hi.
    If you're using SSGD 4.41, please download the Admin guide from here:
    http://docs.sun.com/app/docs/doc/820-4907
    There, at page #41 you'll find useful info concerning "Client Connections and Security Warnings".
    Hope this helps,
    Rob

  • OS X Lion - JAVA SCRIPT PROBLEM

    I recently updated from Snow Leopard to OS X Lion. Now I seem to have a JAVA Script problem. Where do I start fixing this issue. I have checked updates etc etc but it seems to be updated. However, when I login to my web site backend, I have a problem. Any advice please?

    Would you please write some more details? explain the problem and what web site backend you use. Thanks.

  • [svn] 1059: debugger: Part three of Java generics

    Revision: 1059
    Author: [email protected]
    Date: 2008-04-01 15:11:05 -0700 (Tue, 01 Apr 2008)
    Log Message:
    debugger: Part three of Java generics
    Modified Paths:
    flex/sdk/trunk/modules/debugger/src/java/flash/tools/debugger/DefaultDebuggerCallbacks.ja va
    flex/sdk/trunk/modules/debugger/src/java/flash/tools/debugger/InProgressException.java
    flex/sdk/trunk/modules/debugger/src/java/flash/tools/debugger/NoResponseException.java
    flex/sdk/trunk/modules/debugger/src/java/flash/tools/debugger/concrete/DManager.java
    flex/sdk/trunk/modules/debugger/src/java/flash/tools/debugger/concrete/DModule.java
    flex/sdk/trunk/modules/debugger/src/java/flash/tools/debugger/concrete/DProtocol.java
    flex/sdk/trunk/modules/debugger/src/java/flash/tools/debugger/concrete/DStackContext.java
    flex/sdk/trunk/modules/debugger/src/java/flash/tools/debugger/concrete/DValue.java
    flex/sdk/trunk/modules/debugger/src/java/flash/tools/debugger/concrete/PlayerSession.java
    flex/sdk/trunk/modules/debugger/src/java/flash/tools/debugger/concrete/PlayerSessionManag er.java
    flex/sdk/trunk/modules/debugger/src/java/flash/tools/debugger/expression/ASTBuilder.java
    flex/sdk/trunk/modules/debugger/src/java/flash/tools/debugger/expression/NoSuchVariableEx ception.java
    flex/sdk/trunk/modules/debugger/src/java/flash/tools/debugger/expression/Operator.java
    flex/sdk/trunk/modules/debugger/src/java/flash/util/URLHelper.java
    flex/sdk/trunk/modules/debugger/src/java/flex/tools/debugger/cli/BreakAction.java
    flex/sdk/trunk/modules/debugger/src/java/flex/tools/debugger/cli/DebugCLI.java
    flex/sdk/trunk/modules/debugger/src/java/flex/tools/debugger/cli/ExpressionCache.java
    flex/sdk/trunk/modules/debugger/src/java/flex/tools/debugger/cli/ExpressionContext.java
    flex/sdk/trunk/modules/debugger/src/java/flex/tools/debugger/cli/Extensions.java
    flex/sdk/trunk/modules/debugger/src/java/flex/tools/debugger/cli/FaultActions.java
    flex/sdk/trunk/modules/debugger/src/java/flex/tools/debugger/cli/FileInfoCache.java
    flex/sdk/trunk/modules/debugger/src/java/flex/tools/debugger/cli/Help.java
    flex/sdk/trunk/modules/debugger/src/java/flex/tools/debugger/cli/IntProperties.java
    flex/sdk/trunk/modules/debugger/src/java/flex/tools/debugger/cli/LocationCollection.java
    flex/sdk/trunk/modules/debugger/src/java/flex/tools/debugger/cli/NoMatchException.java
    flex/sdk/trunk/modules/debugger/src/java/flex/tools/debugger/cli/StringIntArray.java

    Not a real question. This is not a homework cheat site. Locking.

  • Programming task: Java Generics

    Hi,
    I am new to Java Generics.
    Please suggest a programming task, which when implemented, let me study the features of Java Generics.
    Thanks in advance.

    Here are some same tasks
    - Create a simple static method which returns its only parameter as the same type. Call it "runtime". (Can you suggest a use for it ;)
    - Create a simple ArrayList with an add, size and get(int) method.
    - Create a Comparator which wraps another Comparator which works in the opposite direction. i.e. it return -1 instead of 1 and visa-versa.

  • Java Syntax problem

    Hello all,
    I am studying stacks lately and I have came across a special parenthesis that i do not quite understand.
    This parenthesis is " < arguments >"
    Eg, private Arraylist<String> info; // in this case i know i created a reference to an expandable of array that holds string objects
    public interface Stack<E> // a stack that contains generic elements.
    However i still dont quite get the real use for <> parenthesis, like when are they used. It wasn't quite explained the book i am reading. And i dont know the keywords to google more info about those parentheses.
    Another question would be the class E, can someone breif me a little on that please.

    http://java.sun.com/docs/books/tutorial/java/generics/index.html> >
    Hello all,
    I am studying stacks lately and I have came across a special parenthesis that i do not quite understand.
    This parenthesis is " < arguments >"
    Eg, private Arraylist<String> info; // in this case i know i created a reference to an expandable of array that holds string objects
    public interface Stack<E> // a stack that contains generic elements.
    However i still dont quite get the real use for <> parenthesis, like when are they used. It wasn't quite explained the book i am reading. And i dont know the keywords to google more info about those parentheses.
    Another question would be the class E, can someone breif me a little on that please.
    Those are just the less than and greater than sign on your keyboard. They are used in the implementation of Java Generics and, very simply put, you put the Class that you want the Generic to service between "<>".
    For instance:
    private ArrayList<String> asl = new ArrayList<String)();Says to create an ArrayList that will contain String values.
    Generics are discussed here in the tutorial: Generics

  • Java Generics in Ejbs WebLogic 9.2 MP1 WindowsXP Sun JDK

    Hi guys,
    I tried to deploy our application on Weblogic Server 9.2 MP1 (Windows, Sun JDK) and during deployment I have this error see bellow.
    Can somebody tell me what is the problem with generics and EJB compiler?
    Is necessary to add any path or change any server settings?
    Thanks for help
    Robert
    location: interface
    ...daoadapter_DaoAdapter_rge4uk_Intf
    public void batchPersist(java.util.List<T> arg0);
    ^
    ...daoadapter_DaoAdapter_rge4uk_Intf.java:20: cannot find symbol
    symbol : class T
    location: interface
    2 errors
    at weblogic.utils.compiler.CompilerInvoker.compileMaybeExit(CompilerInvoker.java:435)
    at weblogic.utils.compiler.CompilerInvoker.compile(CompilerInvoker.java:295)
    at weblogic.utils.compiler.CompilerInvoker.compile(CompilerInvoker.java:303)
    at weblogic.ejb.container.ejbc.EJBCompiler.doCompile(EJBCompiler.java:309)
    at weblogic.ejb.container.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:497)
    at weblogic.ejb.container.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:464)
    at weblogic.ejb.container.deployer.EJBDeployer.runEJBC(EJBDeployer.java:430)
    at weblogic.ejb.container.deployer.EJBDeployer.compileJar(EJBDeployer.java:752)
    at weblogic.ejb.container.deployer.EJBDeployer.compileIfNecessary(EJBDeployer.java:655)
    at weblogic.ejb.container.deployer.EJBDeployer.prepare(EJBDeployer.java:1199)
    at weblogic.ejb.container.deployer.EJBModule.prepare(EJBModule.java:354)
    at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:93)
    at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:360)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
    at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:56)
    at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:46)
    at weblogic.application.internal.BaseDeployment$1.next(BaseDeployment.java:615)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
    at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:191)
    at weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:147)
    at weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:61)
    at weblogic.deploy.internal.targetserver.operations.ActivateOperation.createAndPrepareContainer(ActivateOperatio
    n.java:189)
    at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doPrepare(ActivateOperation.java:87)
    at weblogic.deploy.internal.targetserver.operations.AbstractOperation.prepare(AbstractOperation.java:217)
    at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentPrepare(DeploymentManager.java:718)
    at weblogic.deploy.internal.targetserver.DeploymentManager.prepareDeploymentList(DeploymentManager.java:1185)
    at weblogic.deploy.internal.targetserver.DeploymentManager.handlePrepare(DeploymentManager.java:247)
    at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.prepare(DeploymentServiceDispatcher.java:15
    7)
    at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doPrepareCallback(Deploymen
    tReceiverCallbackDeliverer.java:157)
    at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$000(DeploymentReceiv
    erCallbackDeliverer.java:12)
    at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$1.run(DeploymentReceiverCal
    lbackDeliverer.java:45)
    at weblogic.work.ServerWorkManagerImpl$WorkAdapterImpl.run(ServerWorkManagerImpl.java:518)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)

    Thanks Matt for your answer.
    But I don't finish my testing :)
    I tried to deploy the same application on Weblogic 9.2 MP2 and then MP3 (sun jdk domain) and I didn't have problem with generics (application was correctly deployed and running).
    Then something was fixed in newer versions or may be bea guys support more then is in EJB 2.x specification.
    My next step, I'll try to deploy it on Jrockit domain and I give a note to conference what happen, may be it can help to somebody else.
    Thanks
    Robert

  • DataControl and Java Generics

    I tried to make DataControl from SessionBean:
    @Stateless(name="SessionEJB")
    public class SessionEJBBean implements SessionEJB, SessionEJBLocal {
    @PersistenceContext(unitName="ExampleUnit")
    private Entity Manager em;
    public SessionEJBBean() {
    public List<Employees> getAll(Employees p) {
    return null;
    public Result<Employees> getResult(Employees parametar) {
    return null;
    But my GENERIC type Result<T>, in the second method, caused problems.
    When I remove this method, everything work just fine.
    Is this a BUG, or I'm doing something wrong ?
    ERROR:
    java.lang.NullPointerException
         at oracle.adfdtinternal.model.ide.managers.BeanManager.findOrCreateBean(BeanManager.java:70)
         at oracle.adfdtinternal.model.ide.managers.BeanManager.findOrCreateBean(BeanManager.java:53)
         at oracle.adfdtinternal.model.ide.objects.builders.StructureDefinitionBuilder.build(StructureDefinitionBuilder.java:628)
         at oracle.adfdtinternal.model.ide.objects.builders.StructureDefinitionBuilder.generateXmlIfNecessary(StructureDefinitionBuilder.java:293)
         at oracle.adfdtinternal.model.ide.objects.builders.StructureDefinitionBuilder.buildMethods(StructureDefinitionBuilder.java:416)
         at oracle.adfdtinternal.model.ide.objects.builders.StructureDefinitionBuilder$1.runHandlingExceptions(StructureDefinitionBuilder.java:647)
         at oracle.adfdt.jdev.transaction.JDevTransactionManager$1.performTask(JDevTransactionManager.java:54)
         at oracle.bali.xml.model.task.StandardTransactionTask.runThrowingXCE(StandardTransactionTask.java:172)
         at oracle.bali.xml.model.task.StandardTransactionTask.run(StandardTransactionTask.java:103)
         at oracle.adfdt.jdev.transaction.JDevTransactionManager.runTaskUnderTransaction(JDevTransactionManager.java:43)
         at oracle.adfdtinternal.model.ide.objects.builders.StructureDefinitionBuilder.build(StructureDefinitionBuilder.java:653)
         at oracle.adfdtinternal.model.ide.objects.builders.JSR227BeanXmlBuilder.build(JSR227BeanXmlBuilder.java:32)
         at oracle.adfdtinternal.model.ide.adapter.AdapterDCHelper.addCreatableTypes(AdapterDCHelper.java:175)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at oracle.adfdt.model.datacontrols.JUDTAdapterDataControl.internalRefreshStructure(JUDTAdapterDataControl.java:624)
         at oracle.adfdt.model.datacontrols.JUDTAdapterDataControl.refreshStructure(JUDTAdapterDataControl.java:275)
         at oracle.adfdtinternal.model.ide.factories.adapter.DCFactoryAdapter.createDataControl(DCFactoryAdapter.java:365)
         at oracle.adfdtinternal.model.ide.factories.adapter.DCFactoryAdapter.createDataControl(DCFactoryAdapter.java:236)
         at oracle.adfdtinternal.model.ide.ProjectCompileListener.invokeFactory(DataControlFactoryMenuListener.java:250)
         at oracle.adfdtinternal.model.ide.DataControlFactoryMenuListener.handleCreateDataControl(DataControlFactoryMenuListener.java:207)
         at oracle.adfdtinternal.model.ide.DataControlFactoryMenuListener.mav$handleCreateDataControl(DataControlFactoryMenuListener.java:35)
         at oracle.adfdtinternal.model.ide.DataControlFactoryMenuListener$1.run(DataControlFactoryMenuListener.java:141)
         at oracle.ide.dialogs.ProgressBar.run(ProgressBar.java:615)
         at java.lang.Thread.run(Thread.java:595)

    Hi,
    I tried the usecase with POJOs
    package pojo;
    import java.util.ArrayList;
    public class SessionFacade {
        ArrayList<Employees> al = new ArrayList<Employees>();
        public SessionFacade() {
            Employees e1 = new Employees();
            e1.setAge(2);
            e1.setFirstname("Hello");
            e1.setName("Test");
            al.add(e1);
        public void setAl(ArrayList<Employees> al) {
            this.al = al;
        public ArrayList<Employees> getAl() {
            return al;
    package pojo;
    public class Employees {
    String name;
    String firstname;
    int age;
        public Employees() {
        public void setName(String name) {
            this.name = name;
        public String getName() {
            return name;
        public void setFirstname(String firstname) {
            this.firstname = firstname;
        public String getFirstname() {
            return firstname;
        public void setAge(int age) {
            this.age = age;
        public int getAge() {
            return age;
    }with no errors
    Frank

Maybe you are looking for