[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.

Similar Messages

  • 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

  • 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)

  • Prettiest & ugliest part of the java codebase

    In the interests of promoting good coding practices (whatever that may mean), I'd like to see peoples' opinions on what constitutes the prettiest & ugliest parts of the java codebase.
    As far as pretties go, I dunno...
    Integer.java perhaps???
    Uglies on the other hand; that's easy....
    ResourceBundle.java
    Unfortunately, I tend to only look at code when it is difficult to work with, or performs voodoo. So I'm a lot better at nominating uglies, and this is unfair. Regardless, I'd love to hear your thoughts!

    I feel there are so many good things about java that sometimes I think how easy my life has become being a java developer. Thinking about any other languages is out of question for me now as am pretty much at home with programming when it comes to java, it was never like that with C++. May be I dont know a lot many good things about other languages but honestly speaking - I dont care!
    Although am relatively new to this language compared to you guys and there are so many things I still dont know about java, but I guess the reason why I feel so great about it is the way it is organized...I mean like look at java.util package - simple, sweet and useful!! How about Matcher and Pattern classes?!
    And what do you say about javax.jms, I guess this is one of the best APIs for messaging.... you got it all man you just have to do it the way I should be done and thats it!
    May be I can only appreciate utilities provided by Java but I guess being a developer thats all I want.
    As with things we dont like either they are improving or may be there was no other way for them to be what they are right now.
    Look at the total number of posts in the forum - it shows how popular & useful java is!!

  • Part of my Java Product is "Disabled" ???

    I downloaded this software several months ago, and have had no problems with it until tonight, when I tried to email something to another, and received an error message that part of my Java product was either "disabled" or "no longer enabled". My immediate thought was that I could look up the program and it might have a feature there to correct it. It did not, but it did have the contact us features.
    Does anyone know of exactly what I should download again, to overwrite whatever error may have occcurred, so that I am up and running again?
    I will greatly appreciate it.
    Coondad2000

    Is this the Java SDK that is giving these messages or a program written in java?
    if it's the SDK i have NFI what the problem is, because AFAIK it doesn't expire. It is free after all.
    if it's some program written in java, you're asking in the wrong place. contact the person/company that wrote it and ask them what the problem is.
    It looks like you have a timed shareware version of some app, either download it again and see if that helps, or go and buy it :)

  • 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...

  • 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.

  • What are the runtime advantages of using Java generics?

    I have downloaded Build 31 (courtesy of JavaLobby) and compiled the following program.
    Both methods (main and main2) are compiled to the exact same bytecodes (use javap -c to dump the bytecodes). I believe that the generics version (main) is clearer and cleaner (I regularly use templates in my C++ programs), but for the JVM they are exactly the same thing.
    Why did not the JVM was slightly modified to support without using erasure (the checkcast opcode that is used in compiling (String) it.next() could be eliminated in for (String v : s) )?
    // Compile with: javac -source 1.5 Test15.java
    import java.util.*;
    public class Test15 {
         public static void main2(String[] args) {
              Set s = new TreeSet();
              s.add("one");
              s.add("two");
              s.add("three");
              for (Iterator it = s.iterator(); it.hasNext(); ) {
                   String v = (String)it.next();
                   System.out.println (v);
         public static void main(String[] args) {
              Set<String> s = new TreeSet<String>();
              s.add("one");
              s.add("two");
              s.add("three");
              for (String v : s) {
                   System.out.println (v);

    It is not meant to be faster than the normal approach, it is meant to be easier to implement and more secure.
    Why did not the JVM was slightly modified to support without using erasure
    (the checkcast opcode that is used in compiling (String) it.next() could be
    eliminated in for (String v : s) )?I agree, and more do, that the erasure is somewhat the wrong approach, however, the JSR proposal wants it that way.

  • 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

  • Error in starting SAP GUI as part of an Java RFC call from a PC

    Hi,
    We are on the 4.6C version of SAP and have the latest basis kernel patches that allow an RFC connection to start the SAP GUI. The program that I am running externally is java using the 3.0.1 JCo. The OS of the PC I am using is Windows XP. The SAPGUI version is 7.10 patch level 11.
    The program seems to be working properly as the command prompt window goes grey as if there is another window being opened but then I get back this error message and I do not see the GUI.
    The message I am getting back is:
    Exception in thread "main" com.sap.conn.jco.JCoException:(136) JCO_ERROR_ILLEGAL_STATE:Launching SAP GUI failed, though it was requested(error message:Communication with SAPGUI timed out)
    at com.sap.conn.jco.rt.MiddlewareJavaRfc$JavaRfcClient.startSAPGui(MiddlewareJavaRfc.java:1853)
    at com.sap.conn.jco.rt.MiddlewareJavaRfc$JavaRfcClient.connect(MiddlewareJavaRfc.java:1285)
    at com.sap.conn.jco.rt.ClientConnection.connect(ClientConnection.java:661)
    at com.sap.conn.jco.rt.PoolingFactory.init(PoolingFactory.java:103)
    at com.sap.conn.jco.rt.ConnectionManager.createFactory(ConnectionManager.java:171)
    at com.sap.conn.jco.rt.DefaultConnectionManager.createFactory(DefaultConnectionManager.java:44)
    at com.sap.conn.jco.rt.ConnectionManager.getFactory(ConnectionManager.java:160)
    at com.sap.conn.jco.rt.RfcDestination.initializ(RfcDestination.java:766)
    at com.sap.conn.jco.rt.RfcDestination.getSystemID(RfcDestination.java:794)
    at com.sap.conn.jco.rt.RepositoryManager.getRepository(RepositoryManager.java:32)
    at com.sap.conn.jco.rt.RfcDestination.getRepository(RfcDestination.java:865)
    at GISToSAPWO_Test.get_wo_call(GISToSAPWo.java:91)
    at GISToSAPWO_Test.main(GISToSAPWO_Test.java:206)
    I have been all over trying to find the solution to this and have come up empty. Any help will be greatly appreciated. If this is the wrong forum for this please let me know and I will re-post.
    Thank you in advance for any information you can pass on about the issue,
    Mark

    Hi Greetson,
    Thank you in advance for your response. It is greatly appreciated.
    1) In a way yes. I am using the connection setting USE_SAPGUI = 1. This is suppose to start the GUI prior to starting the RFC's program run. If this is not correct please let me know.
    2) The code is part of the JCo and the RFC library from what I have read. If this is not correct please let me know.
    3) I am only testing from my PC at this moment. I have re-installed my SAP GUI and am now at patch level 13 on 7.10.
    4) The application passes in the connection information which includes username and password along with the parameters for the RFC call. I would like the SAP GUI to open without the user having to re-enter his/her username and password. I thought that once the RFC is called using the dialog users credentials that the GUI would then open using the connection. I have used the java pooled connection method and it still does not open the GUI.
    5) The purpose is to pass Equipment objects, Functional Location objects and Leak Id objects to an RFC to open a list screen from IW39, List Maintenance Order transaction, for display of each at one pass, as well as open Excel with data from classification for the Leak Id's.
    Hope this sheds some light on the problem I am having. Please let me know if more information is needed.
    Best regards,
    Mark

  • XI: How To Use JAVA generic Class to  perform SAP data Lookup........

    Hello All,
    I want to create a generic class which is used to perorm SAP data lookup.
    I don't want to use Jco or RFC channel..
    Is there any other way to do this?
    waiting for Reply 
    thank in advance.
    - AKSHAY.

    Hi,
    use RFC channel
    you can wrap it up like this:
    /people/morten.wittrock/blog/2006/03/30/wrapping-your-mapping-lookup-api-code-in-easy-to-use-java-classes
    why do you want to create something diffucult to maintin and non standard if
    you can use the RFC API ?
    Regards,
    michal
    <a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>

  • Question about Java Generics

    Hello,
    I was wondering if there is any way to use multiple generics as you would use a list of arguments, for example
    Public void DoSomething(Object ...args)Could it be done the same with a generic interface?
    public interface Generic<T...>
       public void DoSomething(T args);
    new Generic<String,Integer>() {
        public void DoSomething(String arg1,Integer arg2) {
    new Generic<Class1,Class2,Class3>() {
       public void DoSomething(Class1 one,Class2 two,Class3 three) {
    }etc
    I am trying to do an event class, which would show me the required arguments for the event handler, instead of me having to document all the passed arguments (which are passed as Object... args)
    Here is my current class: Event and EventHandler class
    [http://pastebin.com/m252c65eb|http://pastebin.com/m252c65eb]
    Thank you in advance.
    Edited by: Naki on Jan 11, 2010 6:10 AM
    Edited by: Naki on Jan 11, 2010 6:13 AM

    Naki wrote:
    I am trying to do an event class, which would show me the required arguments for the event handler, instead of me having to document all the passed arguments (which are passed as Object... args)Why are they passed in as "Object..."? I assume you'll need to reference the concrete type anyway, so what's wrong with building a custom constructor in each concrete class that takes the correct arguments? You can still store them in an Object[] internally, if you really want.

  • Is there a debugger which comes with Java?

    Hi,
    I am running Java from the command line currently (my machine won't cope with an IDE) and would like to debug a program. Is there some form of command line debugger I can use?
    Cheers
    Stephen

    yup, jdb.
    http://java.sun.com/j2se/1.3/docs/tooldocs/tools.html
    find the "jdb" links.
    --p                                                                                                                                                                                       

  • One Sold-to-Part & THREE Ship-to-Parties in One SO-How to configure?

    Dear SAP Peers,
    My requirement is like this:
    Sold-to-Party is one and one sales order is created for the qty. of 250 each. Out of these 250 each we have to send as follows:
    Ship-to-party 01 -
    >    100
    Ship-to-party 02 -
    >      50
    Ship-to-party 03 -
    >    100
    All three Ship-to-Parties are at different places.
    I know that only one Ship-to-party can be given but I am not able to give more than one Ship-to-Party in the Item level also. The Error message is coming like this:
    “Partner function WE can only occur 1 times in procedure N (Sales Document Item)
    Message no. VPD012”
    I looked into the Procedure “N” for the function WE and it is only one time. How can I put more than one WE functions in the procedure “N” or any other procedure?
    Is it that I have to create in a different account group?
    Or
    This can be done by the “Subsequent Outbound delivery Split”?
    Or
    I have to make three different Sales order for three different Ship-to-parties?
    However, I have assigned these three ship-to-parties to the Customer.
    Please help to solve this Problem. If anybody has any detailed document please send to my mail ID <b><REMOVED BY MODERATOR></b>.
    Regards
    Jans

    Hi Harsh,
    Thank you for your reply. I have already assigned all ship-to-parties to the customer i.e sold-to-party.
    I also checked that in Patrner determination procedure "N" the ship-to-party is marked "M" i.e mandatory not "N" i,e. not changeable.
    However, I got the solution. It is not possible to assign more than one Ship-to-party in one item. I have to create three different line items for the same material and then I can assign different ship-to-part at each item level.
    Once again thank you for your reply.
    Jans

  • Need help wiith java generics

    I have written a java program using jdk1.5. After completing my program I noticed that the compiler was outputting a warning. It tells me that there were a few unsafe operations in my code. Anyway I found out that my code needed to include generics. I was able to figure out how too include some of the generics. I am having trouble with the following:
    [javac] /home/paul/Documents/java/PersonalInfo/src/personalInfo/logic/DB.java:105: warning: [unchecked] unchecked conversion
    [javac] found : personalInfo.logic.FNComparator
    [javac] required: java.util.Comparator<? super java.lang.Object>
    [javac] Arrays.sort(sort, fn);
    [javac] ^
    [javac] /home/paul/Documents/java/PersonalInfo/src/personalInfo/logic/DB.java:105: warning: [unchecked] unchecked method invocation: <T>sort(T[],java.util.Comparator<? super T>) in java.util.Arrays is applied to (java.lang.Object[],personalInfo.logic.FNComparator)
    [javac] Arrays.sort(sort, fn);
    [javac] ^
    [javac] /home/paul/Documents/java/PersonalInfo/src/personalInfo/logic/DB.java:109: warning: [unchecked] unchecked conversion
    [javac] found : personalInfo.logic.LNComparator
    [javac] required: java.util.Comparator<? super java.lang.Object>
    [javac] Arrays.sort(sort, ln);
    [javac] ^
    [javac] /home/paul/Documents/java/PersonalInfo/src/personalInfo/logic/DB.java:109: warning: [unchecked] unchecked method invocation: <T>sort(T[],java.util.Comparator<? super T>) in java.util.Arrays is applied to (java.lang.Object[],personalInfo.logic.LNComparator)
    [javac] Arrays.sort(sort, ln);
    [javac] ^
    The FN/LNComparator class implements the java.util.Comparator class. I have looked at the generics tutorial on the java.sun.com website. I can't figure out what I replace the <T> with to make the code compile and the warning to go away. I have tried <Comparator> but that just gives me an error that says FNComparator does not take any parameters.
    If anyone knows how to fix these warnings let me know
    -Hockeyfan

    You'll probably get an answer here, as a lot of people read this forum and at least some of them know generics pretty well. For future reference though, there's a forum here devoted to generics, and I know that at least one of Sun's generics implementors answers questions there, so that's probably better place to post generics questions.

Maybe you are looking for