Deprecation in Java

I don't know what is deprecation in java please tell me brief about it?

It means that it is no longer supported and only kept around for backwards compatibility. If you can help it do not use them because they are not gaurenteed to be in future releases.
http://www.google.com/search?source=ig&hl=en&rlz=&=&q=java+deprecation&btnG=Google+Search
http://javaboutique.internet.com/articles/ITJ/qanda/q23.html

Similar Messages

  • EP6 SP2 ICrawler (deprecated) - XCrawler java docs?

    Hallo all,
    I want to implement a Crawler for EP6 SP2 and found out in the Java docs that ICrawler is deprecated for EP6 SP2 and that XCrawler should be used. But I can't find any information (e.g. java docs or sample coding) for XCrawler replacing ICrawler. Neither do I find the necessary libraries for implementing a crawler.
    Could someone please point me to the right place to look for libraries/docs/samples? Or does anyone know something about ICrawler / XCrawler implementation on EP6 SP2?
    Thanks a lot for any input on this!
    Best Regards
    Helga
    Message was edited by: Helga Ortius

    See /thread/41429 [original link is broken]

  • Java.io.PrintStream deprecation

    Hello,
    When I compile my program, which is written with JDK 1.4.2, I get as output from the compilation
    the message warning: The class `java.io.PrintStream' has been deprecated. But when I look
    in javadoc there isn't anything about deprecation for java.io.PrintStream. Anyone who knows why
    this output is written?

    The row the compiler is complaining on is row #2
    BLOB blob=((oracle.jdbc.driver.OracleResultSet)rs).getBLOB(1);
    PrintStream pw = new PrintStream(blob.getBinaryOutputStream());
    where blob is an instance of oracle.sql.BLOB

  • Java.sql.Date vs java.util.Date vs. java.util.Calendar

    All I want to do is create a java.sql.Date subclass which has the Date(String) constructor, some checks for values and a few other additional methods and that avoids deprecation warnings/errors.
    I am trying to write a wrapper for the java.sql.Date class that would allow a user to create a Date object using the methods:
    Date date1 = new Date(2003, 10, 7);ORDate date2 = new Date("2003-10-07");I am creating classes that mimic MySQL (and eventually other databases) column types in order to allow for data checking since MySQL does not force checks or throw errors as, say, Oracle can be set up to do. All the types EXCEPT the Date, Datetime, Timestamp and Time types for MySQL map nicely to and from java.sql.* objects through wrappers of one sort or another.
    Unfortunately, java.sql.Date, java.sql.Timestamp, java.sql.Time are not so friendly and very confusing.
    One of my problems is that new java.sql.Date(int,int,int); and new java.util.Date(int,int,int); are both deprecated, so if I use them, I get deprecation warnings (errors) on compile.
    Example:
    public class Date extends java.sql.Date implements RangedColumn {
      public static final String RANGE = "FROM '1000-01-01' to '8099-12-31'";
      public static final String TYPE = "DATE";
       * Minimum date allowed by <strong>MySQL</strong>. NOTE: This is a MySQL
       * limitation. Java allows dates from '0000-01-01' while MySQL only supports
       * dates from '1000-01-01'.
      public static final Date MIN_DATE = new Date(1000 + 1900,1,1);
       * Maximum date allowed by <strong>Java</strong>. NOTE: This is a Java limitation, not a MySQL
       * limitation. MySQL allows dates up to '9999-12-31' while Java only supports
       * dates to '8099-12-31'.
      public static final Date MAX_DATE = new Date(8099 + 1900,12,31);
      protected int _precision = 0;
      private java.sql.Date _date = null;
      public Date(int year, int month, int date) {
        // Deprecated, so I get deprecation warnings from the next line:
        super(year,month,date);
        if(! isWithinRange(this))
          throw new ValueOutOfRangeException((RangedColumn)this, "" + this);
      public Date(String s) {
        super(0l);
        // Start Cut-and-paste from java.sql.Date.valueOf(String s)
        int year;
        int month;
        int day;
        int firstDash;
        int secondDash;
        if (s == null) throw new java.lang.IllegalArgumentException();
        firstDash = s.indexOf('-');
        secondDash = s.indexOf('-', firstDash+1);
        if ((firstDash > 0) & (secondDash > 0) & (secondDash < s.length()-1)) {
          year = Integer.parseInt(s.substring(0, firstDash)) - 1900;
          month = Integer.parseInt(s.substring(firstDash+1, secondDash)) - 1;
          day = Integer.parseInt(s.substring(secondDash+1));
        } else {
          throw new java.lang.IllegalArgumentException();
        // End Cut-and-paste from java.sql.Date.valueOf(String s)
        // Next three lines are deprecated, causing warnings.
        this.setYear(year);
        this.setMonth(month);
        this.setDate(day);
        if(! isWithinRange(this))
          throw new ValueOutOfRangeException((RangedColumn)this, "" + this);
      public static boolean isWithinRange(Date date) {
        if(date.before(MIN_DATE))
          return false;
        if(date.after(MAX_DATE))
          return false;
        return true;
      public String getRange() { return RANGE; }
      public int getPrecision() { return _precision; }
      public String getType() { return TYPE; }
    }This works well, but it's deprecated. I don't see how I can use a java.util.Calendar object in stead without either essentially re-writing java.sql.Date almost entirely or losing the ability to be able to use java.sql.PreparedStatement.get[set]Date(int pos, java.sql.Date date);
    So at this point, I am at a loss.
    The deprecation documentation for constructor new Date(int,int,int)says "instead use the constructor Date(long date)", which I can't do unless I do a bunch of expensive String -> [Calendar/Date] -> Milliseconds conversions, and then I can't use "super()", so I'm back to re-writing the class again.
    I can't use setters like java.sql.Date.setYear(int) or java.util.setMonth(int) because they are deprecated too: "replaced by Calendar.set(Calendar.DAY_OF_MONTH, int date)". Well GREAT, I can't go from a Date object to a Calendar object, so how am I supposed to use the "Calendar.set(...)" method!?!? From where I'm sitting, this whole Date deprecation thing seems like a step backward not forward, especially in the java.sql.* realm.
    To prove my point, the non-deprecated method java.sql.Date.valueOf(String) USES the DEPRECATED constructor java.util.Date(int,int,int).
    So, how do I create a java.sql.Date subclass which has the Date(String) constructor that avoids deprecation warnings/errors?
    That's all I really want.
    HELP!

    I appreciate your help, but what I was hoping to accomplish was to have two constructors for my java.sql.Date subclass, one that took (int,int,int) and one that took ("yyyy-MM-dd"). From what I gather from your answers, you don't think it's possible. I would have to have a static instantiator method like:public static java.sql.Date createDate (int year, int month, int date) { ... } OR public static java.sql.Date createDate (String dateString) { ... }Is that correct?
    If it is, I have to go back to the drawing board since it breaks my constructor paradigm for all of my 20 or so other MySQL column objects and, well, that's not acceptable, so I might just keep my deprecations for now.
    -G

  • Installing Java add-in on ABAP Stack

    Hello Gurus,
    We have recently upgrade from SAP R/3 4.7 ext. 20 SR2 to ECC 6.0 SR3 on Solaris platform using Oracle 10g. We are on Non-unicode system and on Single Stack i.e. AS ABAP only.
    Now as new requirement comes up in organization, we need to install additional Java Stack on upgraded system. Please help me in provide some details to proceed further.
    1. Advantages of JAVA Stack (is there any performance issues after installing Java Stack?).
    2. How to install Java Stack with ABAP stack in Cluster Environment.
    Early response is highly appreciated.
    Regards,
    Kshitiz Goyal

    > We have recently upgrade from SAP R/3 4.7 ext. 20 SR2 to ECC 6.0 SR3 on Solaris platform using Oracle 10g. We are on Non-unicode system and on Single Stack i.e. AS ABAP only.
    >
    > Now as new requirement comes up in organization, we need to install additional Java Stack on upgraded system. Please help me in provide some details to proceed further.
    There are two issues here:
    a) double stack instances are deprecated, they shouldn't be installed any more. Install the Java instance as a separate SID, at best on a separate machine (or on a separate Solaris zone on the same machine). See Note 855534 - Dual Stack and SAP Business Suite 7
    b) Java stacks with non-Unicode backends are not supported (see Note 975768 - Deprecation of Java features with non-Unicode Backend)
    You may be able to technically install the Java AddIn with "some special DVD" but because your backend is non-Unicode this configuration would be unsupported.
    I highly suggest you first convert your system to Unicode before trying to connect them to a Java system.
    Markus

  • Problem while Consuming Java Webservice from WCF client

    Hi,
    I am trying to Consume Java Webservice from WCF client.The webservice main functionality is digital data management.The client can Query Digital data and upload digital data by calling webservice methods.Problem is when i am trying to call webmethod from WCF client its giving "Unrecognised message versions".I have no idea about how the message objects are processed at serverside.but at server side they have used JAXP for XML document parsing.
    The response content type is Multipart/related and applicatio/XOP+XML.
    Can u plz help me how to handle this situation.I have minimum knowledge in Java WS architecture.Basically i am .Net programmer.
    Can U please guide me in a proper way to resolve the problem.

    Hi Abinash,
    I have the same problem. Have you solve that problem?
    I am using a java program to call a webservice too. And I have generated the client proxy definition for Stand alone proxy using NWDS. When I call the method of the webservice I am getting the correct result but along with the result I am getting one error and one warning message in the output.
    The java code to call the webservice is as follows.
    MIDadosPessoaisSyncService service = new MIDadosPessoaisSyncServiceImpl();
    MIDadosPessoaisSync port = service.getLogicalPort("MIDadosPessoaisSyncPort");
    port._setProperty("javax.xml.rpc.security.auth.username","xpto");
    port._setProperty("javax.xml.rpc.security.auth.password","xpto");
    String out = port.MIDadosPessoaisSync("xpto", "xpto");
    System.out.println(out);
    The result I am getting is :
    Warning ! Protocol Implementation [com.sap.engine.services.webservices.jaxrpc.wsdl2java.features.builtin.MessageIdProtocol] could not be loaded (NoClassDefFoundError) !
    Error Message is :com/sap/guid/GUIDGeneratorFactory
    <b>The result of the WS is correct!!!</b>
    The Java project does not have any warning. But the stand alone proxy project has following warnings associated with it.
    This method has a constructor name     MIDadosPessoaisSync.java     
    The import javax.xml.rpc.holders is never used     MIDadosPessoaisSyncBindingStub.java     
    The import javax.xml.rpc.encoding is never used     MIDadosPessoaisSyncBindingStub.java     
    The constructor BaseRuntimeException(ResourceAccessor, String, Throwable) is deprecated     MIDadosPessoaisSyncBindingStub.java
    It is very similar with your problem, could you help me?
    Thanks
    Gustavo Freitas

  • Problem while calling a Webservice from a Stand alone java program

    Hello Everyone,
    I am using a java program to call a webservice as follows. For this I have generated the client proxy definition for Stand alone proxy using NWDS.
    Now when I call the method of the webservice I am getting the correct result but along with the result I am getting one error and one warning message in the output.
    The java code to call the webservice is as follows.
    public class ZMATRDESCProxyClient {
         public static void main(String[] args) throws Exception {
              Z_MATRDESC_WSDService ws = new Z_MATRDESC_WSDServiceImpl();
              Z_MATRDESC_WSD port = (Z_MATRDESC_WSD)ws.getLogicalPort("Z_MATRDESC_WSDSoapBinding",Z_MATRDESC_WSD.class);
              String res = port.zXiTestGetMatrDesc("ABCD134");
              System.out.print(res);
    The result I am getting is :
    Warning ! Protocol Implementation [com.sap.engine.services.webservices.jaxrpc.wsdl2java.features.builtin.MessageIdProtocol] could not be loaded (NoClassDefFoundError) !
    Error Message is :com/sap/guid/GUIDGeneratorFactory
    <b>Material Not Found</b> -
    > This is the output of webservice method and it is right.
    Can any one please let me know why I am getting the warning and error message and how can I fix this.
    Thanks
    Abinash

    Hi Abinash,
    I have the same problem. Have you solve that problem?
    I am using a java program to call a webservice too. And I have generated the client proxy definition for Stand alone proxy using NWDS. When I call the method of the webservice I am getting the correct result but along with the result I am getting one error and one warning message in the output.
    The java code to call the webservice is as follows.
    MIDadosPessoaisSyncService service = new MIDadosPessoaisSyncServiceImpl();
    MIDadosPessoaisSync port = service.getLogicalPort("MIDadosPessoaisSyncPort");
    port._setProperty("javax.xml.rpc.security.auth.username","xpto");
    port._setProperty("javax.xml.rpc.security.auth.password","xpto");
    String out = port.MIDadosPessoaisSync("xpto", "xpto");
    System.out.println(out);
    The result I am getting is :
    Warning ! Protocol Implementation [com.sap.engine.services.webservices.jaxrpc.wsdl2java.features.builtin.MessageIdProtocol] could not be loaded (NoClassDefFoundError) !
    Error Message is :com/sap/guid/GUIDGeneratorFactory
    <b>The result of the WS is correct!!!</b>
    The Java project does not have any warning. But the stand alone proxy project has following warnings associated with it.
    This method has a constructor name     MIDadosPessoaisSync.java     
    The import javax.xml.rpc.holders is never used     MIDadosPessoaisSyncBindingStub.java     
    The import javax.xml.rpc.encoding is never used     MIDadosPessoaisSyncBindingStub.java     
    The constructor BaseRuntimeException(ResourceAccessor, String, Throwable) is deprecated     MIDadosPessoaisSyncBindingStub.java
    It is very similar with your problem, could you help me?
    Thanks
    Gustavo Freitas

  • Deprecation

    Hi,
    when I run this applet with deprection I get the following warnings, I have also got an error with the mouseDragged, How do I solve these. I hope the code isn't too long for you to understand.
    macnero
    javac -deprecation precess2.java
    C:Java_Progs>javac -deprecation precess2.java
    precess2.java:28: precess2 should be declared abstract; it does not define mouseDragged(java.awt.event.MouseEvent) in precess2
    public class precess2 extends Applet implements Runnable, ActionListener, MouseListener, MouseMotionListener
           ^
    precess2.java:97: warning: size() in java.awt.Component has been deprecated
          d=size();                         //  method below.
            ^
    precess2.java:154: warning: suspend() in java.lang.Thread has been deprecated
             t.suspend();
              ^
    precess2.java:158: warning: resume() in java.lang.Thread has been deprecated
             t.resume();
              ^
    precess2.java:162: warning: stop() in java.lang.Thread has been deprecated
             t.stop();
              ^
    1 error
    4 warnings
    import java.applet.Applet;
    import java.awt.*;          
    import javax.swing.*;          
    import java.awt.event.*;     
    import java.awt.geom.*;
    public class precess2 extends Applet implements Runnable, ActionListener, MouseListener, MouseMotionListener
       Dimension offDimension,d; 
       Image offImage;           
       Graphics offGraphics;     
       int tipLength=16;         
       int tipWidth=10;          
       int time=0;               
       int Hfield=20;                  
       int mx=100;               
       int my=50;                
       int tip1x=100;            
       int tip1y=50;             
       int tip2x=100;          
       int tip2y=50;             
       int set=0;
       double freq=(2.0*3.1415/2000.); 
       double damp=0.0001;             
       double sinPhi=0;         
       double cosPhi=1;         
       Thread t;                  
       Button b1, b2, b3, b4, b5, b6, b7;
       int[] hArrowXpoints =                      
         {100, 100+tipWidth/2, 100-tipWidth/2};   
       int[] hArrowYpoints = {50-Hfield,          
         50-Hfield+tipLength,                     
         50-Hfield+tipLength};                    
       int[] mArrowXpoints =                      
         {100, 100+tipWidth/2, 100-tipWidth/2};   
       int[] mArrowYpoints = {50,                 
         50+tipLength,                             
         50+tipLength};                           
       public void init()                     
          setLayout(new BorderLayout(10,10)); 
          Panel p1 = new Panel();            
          p1.setLayout(new GridLayout(7,1));
          b1 = new Button("Increase H");     
          b2 = new Button("Decrease H");    
          b3 = new Button("More Damping");
          b4 = new Button("Less Damping");
          b5 = new Button("Pause");
          b6 = new Button("Resume");
          b7 = new Button("Finish");
          p1.add(b1);
          p1.add(b2);
          p1.add(b3);
          p1.add(b4);
          p1.add(b5);
          p1.add(b6);
          p1.add(b7);
          add("East", p1);
          t=new Thread(this);
          t.start();
         addMouseListener(this);
         addMouseMotionListener(this);
       public void paint(Graphics g)       
          d=size();                        
          update(g);                       
       public void mouseDragged(MouseEvent e, int mDx, int mDy)
          if(mDx<200)
          time=0;                          
          set=0;                           
          sinPhi=(mDx-100)/Math.sqrt       
            ((mDx-100)*(mDx-100)
            +(150-mDy)*(150-mDy));
          cosPhi=(150-mDy)/Math.sqrt
            ((mDx-100)*(mDx-100)
            +(150-mDy)*(150-mDy));        
          repaint();
          //return true;
       public void mouseReleased(MouseEvent e, int mDx, int mDy)
          set=1;                       
          //return true;                
       public void actionListener(ActionEvent e, Object o)
          if (o.equals("Increase H"))       
             freq = freq*1.1;
             Hfield = Hfield+2;
          else if (o.equals("Decrease H"))
             freq = freq*0.9;
             Hfield = Hfield-2;
          else if (o.equals("More Damping"))
             damp = damp*1.1;
          else if (o.equals("Less Damping"))
             damp = damp*0.9;
          else if (o.equals("Pause"))
             t.suspend();
          else if (o.equals("Resume"))
             t.resume();
          else if (o.equals("Finish"))
             t.stop();
          hArrowYpoints[0] = 50-Hfield;             
          hArrowYpoints[1] = 50-Hfield+tipLength;   
          hArrowYpoints[2] = 50-Hfield+tipLength;   
          //return true;
          public void run()    
             while(true)        
                int a = (int) (100*sinPhi*(Math.exp(time*damp*(-1)))*
                  (Math.cos(time*freq)));
                int b = (int) (50*sinPhi*(Math.exp(time*damp*(-1)))*
                  (Math.sin(time*freq)));
                mx= 100+a;
                my= (int) (150-100*Math.sqrt(1-(sinPhi)*(sinPhi)*
                  Math.exp((-2)*time*damp))-b);
                //  Now calculate the vertices for the triangular vector tip
                tip1x=mx+(int)(((100-mx)*tipLength+(tipWidth/2)*(my-150))/
                  Math.sqrt((my-150)*(my-150)+(mx-100)*(mx-100)));
                tip2x=mx+(int)(((100-mx)*tipLength-(tipWidth/2)*(my-150))/
                  Math.sqrt((my-150)*(my-150)+(mx-100)*(mx-100)));
                tip1y=my+(int)(((150-my)*tipLength-(tipWidth/2)*(mx-100))/
                  Math.sqrt((my-150)*(my-150)+(mx-100)*(mx-100)));
                tip2y=my+(int)(((150-my)*tipLength+(tipWidth/2)*(mx-100))/
                  Math.sqrt((my-150)*(my-150)+(mx-100)*(mx-100)));
                 mArrowXpoints[0] = mx;
                 mArrowXpoints[1] = tip1x;
                 mArrowXpoints[2] = tip2x;
                 mArrowYpoints[0] = my;
                 mArrowYpoints[1] = tip1y;
                 mArrowYpoints[2] = tip2y;
                 if (set!=0)        
                    repaint();      
                    time=time+1;    
        public void update(Graphics g)
           if((offGraphics ==null)              
            ||(d.width !=offDimension.width)     
            || (d.height != offDimension.height))
           offDimension=d;
           offImage=createImage(d.width, d.height);
           offGraphics=offImage.getGraphics();
           offGraphics.setColor(getBackground());
           offGraphics.fillRect(0,0, d.width, d.height);
           offGraphics.setColor(Color.blue);
           offGraphics.drawLine(100, 150, 100, (50-Hfield));
           offGraphics.fillPolygon(hArrowXpoints, hArrowYpoints, 3);
           offGraphics.setColor(Color.red);
           offGraphics.drawLine(100, 150, mx, my);
           offGraphics.fillPolygon(mArrowXpoints, mArrowYpoints, 3);
           if( mx > 90-tipWidth/2  && mx < 110+tipWidth/2
             && my  < (int) (150-100*Math.sqrt(1-(sinPhi)*(sinPhi)*
             Math.exp((-2)*time*damp))))
              offGraphics.setColor(Color.blue);
              offGraphics.drawLine(100, 150, 100, (50-Hfield));
              offGraphics.fillPolygon(hArrowXpoints, hArrowYpoints, 3);
            g.drawImage(offImage, 0, 0, this);
    }

    I believe that interrupt replaces suspend... though interrupt, from what I have read, behaves more like a suggestion.... Although I could be way way off base... Again, my personal choice is to have some method (stop() can't be used... kill() die() done() work!) that sets the "running" boolean to false. This breaks the while loop...
    So a
    while(true)
    becomes
    while(running)
    and
    die()
    {running=false;}
    re-starting is actually re-threading... ie, creating a new Thread variable (or re-assigning the old one) and starting it.
    if you had a "int count" that was 30 when 'stopped'.... rethreading
    (ie...
    if (t==null){t=new Thread(this); t.start();}
    SHOULD keep int at 30 when it starts, assuming that it is not 0'd out at the beginning..
    So...
    while(running)
    count++;
    Would start where it was topped the next time rethreaded, because the Object still has a variable count with the value of 30...
    ~Dave

  • Warning: [deprecation] getRealPath in ServletRequest has been deprecated

    I have extended class HttpServletRequestWrapper for custom implementation I have neither overriden the method getRealPath(java.lang.String) nor has this method been used/accessed anywhere. I still get following warning
    [javac] /home/pangav1/dev/upgrade/webapps/common/src/minimed/ddms/webapp/common/filter/LocaleFilter.java:222: warning: [deprecation] getRealPath(java.lang.String) in javax.servlet.ServletRequest has been deprecated
    [javac] public static class HttpRequest extends HttpServletRequestWrapper {
    [javac] ^
    Can anyone tell me the reason why compiler shows the warning message?

    It should certainly not be ignored, especially if you don't understand the reason of deprecation and don't know the alternatives, which is the case of the topicstarter. In any case of deprecated classes/methods, the reasoning of deprecation and any alternatives should already be described in the API docs.
    [Here is the API doc of ServletRequest#getRealPath()|http://java.sun.com/javaee/5/docs/api/javax/servlet/ServletRequest.html#getRealPath(java.lang.String)]

  • Java-Excel program not working

    Hi,
    Can anyone Help me?
    Below is a small code snippet i used to read an excel file using the POI-HSSF API
    import org.apache.poi.hssf.usermodel.HSSFWorkbook;
    import org.apache.poi.hssf.usermodel.HSSFSheet;
    import org.apache.poi.hssf.usermodel.HSSFRow;
    import org.apache.poi.hssf.usermodel.HSSFCell;
    import java.io.FileInputStream;
    * This is a sample to Read an  Excel Sheet using
    * Jakarta POI API
    * @author  Elango Sundaram
    * @version 1.0
    public class ReadXL {
        /** Location where the Excel has to be read from. Note the forward Slash */
        public static String fileToBeRead="Read.xls";
        public static void main(String argv[]){      
            try{
                    System.out.println("hai");
                        // Create a work book reference
                        HSSFWorkbook workbook = new HSSFWorkbook(new FileInputStream(fileToBeRead));
                        // Refer to the sheet. Put the Name of the sheet to be referred from
                        // Alternative you can also refer the sheet by index using getSheetAt(int index)
                        HSSFSheet sheet = workbook.getSheet("Sheet1");
                        //Reading the TOP LEFT CELL
                        HSSFRow row = sheet.getRow(0);
                        // Create a cell ate index zero ( Top Left)
                        HSSFCell cell = row.getCell((short)0);
                        // Type the content
                        //System.out.println("THE TOP LEFT CELL--> " + cell.getStringCellValue());           
            }catch(Exception e) {
                System.out.println("!! Bang !! xlRead() : " + e );
    }I have compiled in JAVA 1.5.0_09 under Solaris 5.10 platform
    $ javac -cp poi-3.0.1-FINAL-20070705.jar  -Xlint:deprecation ReadXL.java
    $ java ReadXL
    Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/poi/hssf/usermodel/HSSFWorkbookHow to proceed???

    You need to add the directory where the ReadXL class is located.
    java -cp .:poi-3.0.1-FINAL-20070705.jar ReadXLMessage was edited by:
    RealHowTo

  • Deprecated - HELP

    D:\JMF>javac -deprecation RTCPViewer.java
    RTCPViewer.java:212: Note: The method java.lang.String getLabel() in class javax
    .swing.AbstractButton has been deprecated.
    if( start.getLabel().equals( "Stop Recording")) {
    Hi, when i run the above it gives me the error. I understand that the above method might be replaced by newer method soon. How do i know where and what to chage to. The above program is downloaded from the examples in JMF.
    Note: RTCPViewer.java uses or overrides a deprecated API. Please consult the documentation for a better alternative.
    1 warning
    What abt the above error?
    Thanks!

    Read the JavaDocs for the classes that have the deprecated methods. Look at the entry for the method concerned and it usually tells you the alternative to use.
    JavaDocs are here http://java.sun.com/j2se/1.4/docs/api/

  • How to avoid the following deprecated warnings

    hi,
    I use JAXB 2.0 and I get the following warnings
    All the below API;s have been deprecated since JAXB 2.0, How can I avoid gettings these warnings.
    warning: [deprecation] javax.xml.bind.Validator in javax.xml.bind has been deprecated
    warning: [deprecation] com.sun.xml.bind.marshaller.SchemaLocationFilter in com.sun.xml.bind.marshaller has been deprecated
    warning: [deprecation] javax.xml.bind.Validator in javax.xml.bind has been deprecated
    warning: [deprecation] javax.xml.bind.Validator in javax.xml.bind has been deprecated
    warning: [deprecation] javax.xml.bind.Validator in javax.xml.bind has been deprecated
    warning: [deprecation] javax.xml.bind.Validator in javax.xml.bind has been deprecated
    warning: [deprecation] com.sun.xml.bind.marshaller.SchemaLocationFilter in com.sun.xml.bind.marshaller has been deprecated
    warning: [deprecation] javax.xml.bind.Validator in javax.xml.bind has been deprecated
    warning: [deprecation] javax.xml.bind.Validator in javax.xml.bind has been deprecated
    warning: javax.xml.bind.Validator in javax.xml.bind has been deprecated
    warning: [deprecation] javax.xml.bind.Validator in javax.xml.bind has been deprecated
    warning: com.sun.xml.bind.marshaller.SchemaLocationFilter in com.sun.xml.bind.marshaller has been deprecated
    warning: javax.xml.bind.Validator in javax.xml.bind has been deprecated
    warning: javax.xml.bind.Validator in javax.xml.bind has been deprecated
    warning: [deprecation] javax.xml.bind.Validator in javax.xml.bind has been deprecated
    warning: [deprecation] javax.xml.bind.Validator in javax.xml.bind has been deprecated
    warning: [deprecation] com.sun.xml.bind.marshaller.SchemaLocationFilter in com.sun.xml.bind.marshaller has been deprecated
    warning: [deprecation] javax.xml.bind.Validator in javax.xml.bind has been deprecated
    warning: [deprecation] javax.xml.bind.Validator in javax.xml.bind has been deprecated
    warning: [deprecation] createValidator() in javax.xml.bind.JAXBContext has been deprecated
    warning: [deprecation] createValidator() in javax.xml.bind.JAXBContext has been deprecated
    warning: [deprecation] createValidator() in javax.xml.bind.JAXBContext has been deprecated
    warning: [deprecation] com.sun.xml.bind.marshaller.SchemaLocationFilter in com.sun.xml.bind.marshaller has been deprecated
    warning: [deprecation] ERR_NOT_IDENTIFIABLE in com.sun.xml.bind.marshaller.Messages has been deprecated
    warning: [deprecation] ERR_DANGLING_IDREF in com.sun.xml.bind.marshaller.Messages has been deprecated
    warning: [deprecation] isValidating() in javax.xml.bind.Unmarshaller has been deprecated
    warning: [deprecation] setValidating(boolean) in javax.xml.bind.Unmarshaller has been deprecated
    warning: warning: [deprecation] parse(org.w3c.dom.Element,org.xml.sax.ContentHandler) in com.sun.xml.bind.unmarshaller.DOMScanner has been
    warning: warning: [deprecation] parse(org.w3c.dom.Element,org.xml.sax.ContentHandler) in com.sun.xml.bind.unmarshaller.DOMScanner has been
    warning: [deprecation] getProperty(java.lang.String) in javax.xml.bind.Validator has been deprecated
    warning: [deprecation] setProperty(java.lang.String,java.lang.Object) in javax.xml.bind.Validator has been deprecated
    warning: [deprecation] setEventHandler(javax.xml.bind.ValidationEventHandler) in javax.xml.bind.Validator has been deprecated

    TimThe.., I disagree about the result of a bad design
    comment. In simple cases it can be beneficial to
    only require an object's constructor, then that
    object's actions are self contained and its methods
    can then be called from its own constructor. In the
    right situations this can help to loosen coupling
    between classes and increase encapsulation.I disagree with that. If your code depends on behaviour that is carried out by a constructor, you have a dependency on a concrete class, which is a nice quick way to tightly couple classes. You'd achieve looser coupling if the desired behaviour was inside a method, which was in turn declared on an interface

  • Deprecation problem

    when i compile my program i get error message that says
    "myfile.java uses or overrides a deprecated API. Recompile with -deprecation for details."
    what does this mean and how do i fix it ?
    thanx
    trin

    means that you are probly either overriding or using a method which has been deprecated, not supported any more.
    It is just a warning, you could continue using it. The class file will be created. But you might probably want to use a more updated method.
    Normally when someone deprecates a Class or Method a replacement is usually there. Check to javadoc to find out more.
    To find out exactly which deprecated method/class you are trying to use, compile your code with the following:
    javac -deprecation myfile.java
    this will tell you the exact line in your code which is using it.

  • How to find deprecated code

    Hi there
    I've just been handed over a great big project that was coded a couple of years ago and have just recompiled most of it - problem is that the compiler keeps telling me that the code has deprecated stuff in it but it won't tell me WHERE! (I'm using netbeans 4.1, Java 5.0)
    Does anyone know of a tool that can pick out deprecated code or wether netbeans can do this please?
    Cheers
    JJ

    C:\temp>javac someApplet.java
    Note: someApplet.java uses or overrides a deprecated API.
    Note: Recompile with -Xlint:deprecation for details.
    C:\temp>javac -Xlint:deprecation someApplet.java
    someApplet.java:9: warning: [deprecation] stop() in java.lang.Thread has been de
    precated
    Thread.currentThread().stop();
    ^
    1 warning

  • Time stamps in Java

    Do we have some functions which I can use to implement timestamps in java ?

    There are many...
    simplest you could use System.currentTimeMillis().
    alternately you could use the "Date" clas (which seems to have deprecated in Java 5).
    also, the new Calendar class which deprecates Date can be used to get a variety of formats od the current date and time. havaq look at their docs at http://java.sun.com/j2se/1.5.0/docs/api/java/util/Calendar.html.

Maybe you are looking for