Line number of method

Hi,
How can I find the list of method in class and the line number of each method or for specific method what is the line number?
Thanks

idan72 wrote:
Hi,
How can I find the list of method in class and the line number of each method or for specific method what is the line number?
ThanksQuite easy:
Have ANTLR (1) generate a Java language parser for you. Don't worry, there's a Java grammar available for you to use (2).
After ANTLR has generated a parser, add a Map<Integer, String> in the source code of that parser and whenever the parser stumbles a new line character, let a counter increase and when it "sees" a method, just put the counter and the method name in your Map<Integer, String>. After the parser has fully parsed your source file, all the methods, and their corresponding line numbers are stored in your Map.
After that, have a beer.
(1) [http://www.antlr.org/]
(2) [http://www.antlr.org/grammar/1152141644268/Java.g]

Similar Messages

  • Number of lines in a method

    Hi all,
    can you please tell me how to get the number of lines in each method in a java file.
    class test
    public void method(){
    sop()...
    sop()...
    In that above class, the number of lines in "method" is 2.
    is there any api in java which will return us the number of lines in each method in a java file?
    Please suggest me..

    -I was wondering about some crazy bytecode reader.javap?
    -I agree it's not the best solution, but going for 100% accuracy wasn't the aim here :)Please understand that I'm not criticizing your attempt, but rather that the OP's requirements are far too vague to provide any useful advice.
    -How does it not deal with loops/code blocks? (case statements maybe as I forgot ":")Example:
    String method =
        "void method() {\n" +
        "    for (int i = 0; i < 1; i++) {\n" +
        "        System.out.println(this.toString());\n" +
        "    }\n" +
    int expectedLineCount = 3; // possibly, based on what the OP's indicated so far...
    int actualLineCount = method.split("[;{}]").length; // per your example
    assert expectedLineCount != actualLineCount;~

  • Re: Method name and/or line number available from withinForte?

    To my knowledge there is no such capability with forte, and for sure it
    would be nice. Short
    of storing all that metadata at runtime, a compile-time substitution such
    as is done with
    most C preprocessors would work as well.
    However, I believe the solution you've identified falls short in a deployed
    fashion - I think
    all that method name/line number stuff is only available from the workshop...
    -J
    At 02:54 PM 10/27/98 -0600, [email protected] wrote:
    I'm sure this question has been asked many times, but I don't know that I've
    ever heard the answer. Is there any way from Forte to access the method
    name of the currently executing method? What about the current line number?
    I'm sure you all know what I'm getting at by now -- when raising your own
    custom exceptions or logging messages we'd like to be able to not hard-code
    method names and line numbers into them. I know these are available with
    log flags so this information is stored somewhere -- is there an API to
    access it on an agent, the task, or the environment? The only way I can
    think of doing this (which is not-so-elegant) is to force a Forte exception
    to be raised (like access a method on a null TextData or something), then
    immediately catch it and extract the method and line number from it. Is
    there a more elegant way?
    -J.C.
    J.C. Hamlin, Senior Consultant, Forte National Practice
    Born Information Services Group, Wayzata, MN
    Ph: (612) 404-4000 Ph2: (612) 783-8270 FAX: (612) 404-4441
    <[email protected]> <[email protected]>
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>**************************************
    John L. Jamison
    Vice President and Chief Technology Officer
    Sage IT Partners, Inc.
    415 392 7243 x 306
    [email protected]
    The Leaders in Internet Enabled Business Change
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

    Method task.TraceBack () returns a string suitable for shoving on the error
    stack, and representing a call trace. The method
    method TomW_RaiseException.RaiseException
    begin
    ge : GenericException = New ();
    ge.SetWithParams (SP_ER_USER, task.TraceBack ());
    task.ErrorMgr.AddError (ge);
    Raise ge;
    end method;
    produces the following when called from the display method of the window in
    which it is embedded.
    USER ERROR:
    Traceback:
    TomW_RaiseException.RaiseException at line 2
    TomW_RaiseException.Display at line 4
    TomW_RaiseException. at offset 13
    C++ Method(s)
    UserApp.Run at offset 96
    Class: qqsp_Exception
    Last TOOL statement: method TomW_RaiseException.RaiseException, line 3
    Error Time: Wed Oct 28 08:28:34
    Exception occurred (locally) on partition "TomW_Test_CL0_Client",
    (partitionId = AA6475E0-3DD2-11D2-B582-04228BFFAA77:0x117f:0x6,
    taskId =
    [AA6475E0-3DD2-11D2-B582-04228BFFAA77:0x117f:0x6.34]) in application
    "FTLaunch_cl0", pid 195 on node SPNMXSHOP7 in environment SFDEVL.
    I suppose that a sufficiently determined person could parse the results of
    TraceBack () and extract the
    method and line from it. But I know of no method that explicitly returns
    the name of the calling method.
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

  • Java Program+To count the number of lines in a method excluding comments???

    Hi friends
    can u plz help me out, the java program is counting the number of lines in a method excluding comments.
    The first thing is how to identify a method, then there can be an inner method inside the parent method,
    Please friends its urgent
    Bye
    Sandy

    There's no such thing as an inner method in Java. You can either write the code yourself to parse Java source, or maybe something like ANTLR can do it.

  • Line Number in JTextPane

    Hi Experts;
    How do I add a caret listener on this code so that it will just add a number
    when the user goes to the next line.
    import java.awt.*;
    import javax.swing.*;
    public class LineNumber extends JComponent
         private final static Color DEFAULT_BACKGROUND = new Color(213, 213, 234);
         private final static Color DEFAULT_FOREGROUND = Color.white;
         private final static Font DEFAULT_FONT = new Font("arial", Font.PLAIN, 11);
         // LineNumber height (abends when I use MAX_VALUE)
         private final static int HEIGHT = Integer.MAX_VALUE - 1000000;
         // Set right/left margin
         private final static int MARGIN = 5;
         // Line height of this LineNumber component
         private int lineHeight;
         // Line height of this LineNumber component
         private int fontLineHeight;
         // With of the LineNumber component
         private int currentRowWidth;
         // Metrics of this LineNumber component
         private FontMetrics fontMetrics;
          * Convenience constructor for Text Components
         public LineNumber(JComponent component)
              if (component == null)
                   setBackground( DEFAULT_BACKGROUND );
                   setForeground( DEFAULT_FOREGROUND );
                   setFont( DEFAULT_FONT );
              else
                   setBackground( DEFAULT_BACKGROUND );
                   setForeground( DEFAULT_FOREGROUND );
                   setFont( component.getFont() );
              setPreferredSize( 99 );
         public void setPreferredSize(int row)
              int width = fontMetrics.stringWidth( String.valueOf(row) );
              if (currentRowWidth < width)
                   currentRowWidth = width;
                   setPreferredSize( new Dimension(2 * MARGIN + width, HEIGHT) );
         public void setFont(Font font)
              super.setFont(font);
              fontMetrics = getFontMetrics( getFont() );
              fontLineHeight = fontMetrics.getHeight();
          * The line height defaults to the line height of the font for this
          * component. The line height can be overridden by setting it to a
          * positive non-zero value.
         public int getLineHeight()
              if (lineHeight == 0)
                   return fontLineHeight;
              else
                   return lineHeight;
         public void setLineHeight(int lineHeight)
              if (lineHeight > 0)
                   this.lineHeight = lineHeight;
         public int getStartOffset()
              return 4;
         public void paintComponent(Graphics g)
               int lineHeight = getLineHeight();
               int startOffset = getStartOffset();
               Rectangle drawHere = g.getClipBounds();
               g.setColor( getBackground() );
               g.fillRect(drawHere.x, drawHere.y, drawHere.width, drawHere.height);
               g.setColor( getForeground() );
               int startLineNumber = (drawHere.y / lineHeight) + 1;
               int endLineNumber = startLineNumber + (drawHere.height / lineHeight);
               int start = (drawHere.y / lineHeight) * lineHeight + lineHeight - startOffset;
               for (int i = startLineNumber; i <= endLineNumber; i++)
               String lineNumber = String.valueOf(i);
               int width = fontMetrics.stringWidth( lineNumber );
               g.drawString(lineNumber, MARGIN + currentRowWidth - width, start);
               start += lineHeight;
               setPreferredSize( endLineNumber );
    } Thanks for your time . . .
    The_Developer

    Here's what I use. It behaves correctly WRT wrapped lines, and should work equally well with a JTextArea or a JTextPane.
    import java.awt.Color;
    import java.awt.Dimension;
    import java.awt.Font;
    import java.awt.FontMetrics;
    import java.awt.Graphics;
    import java.awt.Rectangle;
    import java.awt.event.ComponentAdapter;
    import java.awt.event.ComponentEvent;
    import java.beans.PropertyChangeEvent;
    import java.beans.PropertyChangeListener;
    import javax.swing.BorderFactory;
    import javax.swing.JComponent;
    import javax.swing.SizeSequence;
    import javax.swing.UIManager;
    import javax.swing.event.DocumentEvent;
    import javax.swing.event.DocumentListener;
    import javax.swing.text.BadLocationException;
    import javax.swing.text.Document;
    import javax.swing.text.Element;
    import javax.swing.text.JTextComponent;
    * LineNumberView is a simple line-number gutter that works correctly
    * even when lines are wrapped in the associated text component.  This
    * is meant to be used as the RowHeaderView in a JScrollPane that
    * contains the associated text component.  Example usage:
    *<pre>
    *   JTextArea ta = new JTextArea();
    *   ta.setLineWrap(true);
    *   ta.setWrapStyleWord(true);
    *   JScrollPane sp = new JScrollPane(ta);
    *   sp.setRowHeaderView(new LineNumberView(ta));
    *</pre>
    * @author Alan Moore
    public class LineNumberView extends JComponent
      // This is for the border to the right of the line numbers.
      // There's probably a UIDefaults value that could be used for this.
      private static final Color BORDER_COLOR = Color.GRAY;
      private static final int WIDTH_TEMPLATE = 99999;
      private static final int MARGIN = 5;
      private FontMetrics viewFontMetrics;
      private int maxNumberWidth;
      private int componentWidth;
      private int textTopInset;
      private int textFontAscent;
      private int textFontHeight;
      private JTextComponent text;
      private SizeSequence sizes;
      private int startLine = 0;
      private boolean structureChanged = true;
       * Construct a LineNumberView and attach it to the given text component.
       * The LineNumberView will listen for certain kinds of events from the
       * text component and update itself accordingly.
       * @param startLine the line that changed, if there's only one
       * @param structureChanged if <tt>true</tt>, ignore the line number and
       *     update all the line heights.
      public LineNumberView(JTextComponent text)
        if (text == null)
          throw new IllegalArgumentException("Text component cannot be null");
        this.text = text;
        updateCachedMetrics();
        UpdateHandler handler = new UpdateHandler();
        text.getDocument().addDocumentListener(handler);
        text.addPropertyChangeListener(handler);
        text.addComponentListener(handler);
        setBorder(BorderFactory.createMatteBorder(0, 0, 0, 1, BORDER_COLOR));
       * Schedule a repaint because one or more line heights may have changed.
       * @param startLine the line that changed, if there's only one
       * @param structureChanged if <tt>true</tt>, ignore the line number and
       *     update all the line heights.
      private void viewChanged(int startLine, boolean structureChanged)
        this.startLine = startLine;
        this.structureChanged = structureChanged;
        revalidate();
        repaint();
      /** Update the line heights as needed. */
      private void updateSizes()
        if (startLine < 0)
          return;
        if (structureChanged)
          int count = getAdjustedLineCount();
          sizes = new SizeSequence(count);
          for (int i = 0; i < count; i++)
            sizes.setSize(i, getLineHeight(i));
          structureChanged = false;
        else
          sizes.setSize(startLine, getLineHeight(startLine));
        startLine = -1;
      /* Copied from javax.swing.text.PlainDocument */
      private int getAdjustedLineCount()
        // There is an implicit break being modeled at the end of the
        // document to deal with boundary conditions at the end.  This
        // is not desired in the line count, so we detect it and remove
        // its effect if throwing off the count.
        Element map = text.getDocument().getDefaultRootElement();
        int n = map.getElementCount();
        Element lastLine = map.getElement(n - 1);
        if ((lastLine.getEndOffset() - lastLine.getStartOffset()) > 1)
          return n;
        return n - 1;
       * Get the height of a line from the JTextComponent.
       * @param index the line number
       * @param the height, in pixels
      private int getLineHeight(int index)
        int lastPos = sizes.getPosition(index) + textTopInset;
        int height = textFontHeight;
        try
          Element map = text.getDocument().getDefaultRootElement();
          int lastChar = map.getElement(index).getEndOffset() - 1;
          Rectangle r = text.modelToView(lastChar);
          height = (r.y - lastPos) + r.height;
        catch (BadLocationException ex)
          ex.printStackTrace();
        return height;
       * Cache some values that are used a lot in painting or size
       * calculations. Also ensures that the line-number font is not
       * larger than the text component's font (by point-size, anyway).
      private void updateCachedMetrics()
        Font textFont = text.getFont();
        FontMetrics fm = getFontMetrics(textFont);
        textFontHeight = fm.getHeight();
        textFontAscent = fm.getAscent();
        textTopInset = text.getInsets().top;
        Font viewFont = getFont();
        boolean changed = false;
        if (viewFont == null)
          viewFont = UIManager.getFont("Label.font");
          changed = true;
        if (viewFont.getSize() > textFont.getSize())
          viewFont = viewFont.deriveFont(textFont.getSize2D());
          changed = true;
        viewFontMetrics = getFontMetrics(viewFont);
        maxNumberWidth = viewFontMetrics.stringWidth(String.valueOf(WIDTH_TEMPLATE));
        componentWidth = 2 * MARGIN + maxNumberWidth;
        if (changed)
          super.setFont(viewFont);
      public Dimension getPreferredSize()
        return new Dimension(componentWidth, text.getHeight());
      public void setFont(Font font)
        super.setFont(font);
        updateCachedMetrics();
      public void paintComponent(Graphics g)
        updateSizes();
        Rectangle clip = g.getClipBounds();
        g.setColor(getBackground());
        g.fillRect(clip.x, clip.y, clip.width, clip.height);
        g.setColor(getForeground());
        int base = clip.y - textTopInset;
        int first = sizes.getIndex(base);
        int last = sizes.getIndex(base + clip.height);
        String text = "";
        for (int i = first; i <= last; i++)
          text = String.valueOf(i+1);
          int x = MARGIN + maxNumberWidth - viewFontMetrics.stringWidth(text);
          int y = sizes.getPosition(i) + textFontAscent + textTopInset;
          g.drawString(text, x, y);
      class UpdateHandler extends ComponentAdapter
          implements PropertyChangeListener, DocumentListener
         * The text component was resized. 'Nuff said.
        public void componentResized(ComponentEvent evt)
          viewChanged(0, true);
         * A bound property was changed on the text component. Properties
         * like the font, border, and tab size affect the layout of the
         * whole document, so we invalidate all the line heights here.
        public void propertyChange(PropertyChangeEvent evt)
          Object oldValue = evt.getOldValue();
          Object newValue = evt.getNewValue();
          String propertyName = evt.getPropertyName();
          if ("document".equals(propertyName))
            if (oldValue != null && oldValue instanceof Document)
              ((Document)oldValue).removeDocumentListener(this);
            if (newValue != null && newValue instanceof Document)
              ((Document)newValue).addDocumentListener(this);
          updateCachedMetrics();
          viewChanged(0, true);
         * Text was inserted into the document.
        public void insertUpdate(DocumentEvent evt)
          update(evt);
         * Text was removed from the document.
        public void removeUpdate(DocumentEvent evt)
          update(evt);
         * Text attributes were changed.  In a source-code editor based on
         * StyledDocument, attribute changes should be applied automatically
         * in response to inserts and removals.  Since we're already
         * listening for those, this method should be redundant, but YMMV.
        public void changedUpdate(DocumentEvent evt)
    //      update(evt);
         * If the edit was confined to a single line, invalidate that
         * line's height.  Otherwise, invalidate them all.
        private void update(DocumentEvent evt)
          Element map = text.getDocument().getDefaultRootElement();
          int line = map.getElementIndex(evt.getOffset());
          DocumentEvent.ElementChange ec = evt.getChange(map);
          viewChanged(line, ec != null);
    }

  • Line number in JEditorPane

    I would like to know the line number of the current caret position in a JEditorPane. The getLineOfOffset(int offset) method in JTextArea offers exactly what I want. How come there's no method to find out about line number in JEditorPane?
    As a workaround, I copied the Swing code from the JTextArea.getLineOfOffset method and used it in my class which extends from JEditorPane. It seems to work fine, but it feels like a bad hack. Will the JTextArea code always work in JEditorPane? Any alternatives? I just think that it's tedious and inefficient to deal with StringTokenizer or manually searching for new line charactors on CaretEvent's.
        public int getLineOfOffset(int offset) throws BadLocationException {
            Document doc = getDocument();
            if (offset < 0) {
                throw new BadLocationException("Can't translate offset to line", -1);
            } else if (offset > doc.getLength()) {
                throw new BadLocationException("Can't translate offset to line", doc.getLength()+1);
            } else {
                Element map = getDocument().getDefaultRootElement();
                return map.getElementIndex(offset);
        }

    It's not a hack. Any document used with a Swing text component is supposed to have the same basic element structure, i.e., a default root element whose children represent logical lines. It's just that with some kinds of documents, like HTML, line numbers don't really mean anything. But JTextArea is hard-coded to use a PlainDocument, which means a logical line always represents a paragraph (or a line of code, or something meaningful), so it made sense for it to provide those convenience methods.

  • Line number in a *.class file, please help, advanced language guys

    dear all,
    i use c++ to open a *.class file and try to read line number of code in the file, i have 2 questions:
    1. i read line number in a method successfully, but i can not understand the meaning of start_pc, following are one of those data, please explain:
    s = start_pc,n = line_number
    s , n
    0 , 123
    8 , 125
    23 , 126
    29 , 127
    34 , 129
    38 , 130
    2. i can not find where the class's line number are, i.e. class start line and class end line, or field's line number.
    does these info exist inside a *.class file?
    thx for any light

    jdb gets line number of fields from class file, not
    source file definitely.I'm not really sure how you tested this, but here's my test, and JDB definitely gets its listing from the source file.
    First, I created and compiled class Tester:
    public class Tester
        public static void main( String[] argv )
        throws Exception
            Tester x = new Tester();
            System.out.println(x.toString());
        int     x;
        int     y;
        private Tester()
            x = 0;
            y = 1;
    }Then, I ran this in JDB. Note lines 16 and 17 in the output from "list":
    H:\Workspace>jdb Tester
    Initializing jdb ...
    stop in Tester.mainDeferring breakpoint Tester.main.
    It will be set after the class is loaded.
    runrun Tester
    Set uncaught java.lang.Throwable
    Set deferred uncaught java.lang.Throwable
    >
    VM Started: Set deferred breakpoint Tester.main
    Breakpoint hit: "thread=main", Tester.main(), line=12 bci=0
    12            Tester x = new Tester();
    main[1] list
    8    {
    9        public static void main( String[] argv )
    10        throws Exception
    11        {
    12 =>         Tester x = new Tester();
    13            System.out.println(x.toString());
    14        }
    15
    16        int     x;
    17        int     y;
    main[1] quit
    Tester@b82368Then I edited the source file. Again, look at lines 16 and 17:
    H:\Workspace>jdb Tester
    Initializing jdb ...
    stop in Tester.mainDeferring breakpoint Tester.main.
    It will be set after the class is loaded.
    runrun Tester
    Set uncaught java.lang.Throwable
    Set deferred uncaught java.lang.Throwable
    >
    VM Started: Set deferred breakpoint Tester.main
    Breakpoint hit: "thread=main", Tester.main(), line=12 bci=0
    12            Tester x = new Tester();
    main[1] list
    8    {
    9        public static void main( String[] argv )
    10        throws Exception
    11        {
    12 =>         Tester x = new Tester();
    13            System.out.println(x.toString());
    14        }
    15
    16        int     a;
    17        int     b;
    main[1]

  • How to get Line number from a DOM Element

    Hi
    I am using dom xerces parser. Is there anyway to work out which line number a element will be when it is outputted into a file ??

    org.w3c.dom.DOMLocator method getLineNumber() returns the line number at which an error occurs.
    A corrresponding method for file output is not defined.

  • Updating the Line number on status bar.

    Hi all,
    I have developed an editor using swing, however I have used the JTextpane class to display the text. I had did of trouble with features such as go to line as this class does not support methods such as getLineCount in the JTextArea class. However I over came this by writing the method shown below.
    The problem is that I want to show the current line number on the status bar. When do I call this method? After every '\n'?
    The setLine Number method is below.
    Thanks for your help
    Ciara
    public void setLineNumber(int num) {
    int lineNum = 1;
    int lastNewline = 0;
    char text[] = editor.getText().toCharArray();
    if (num < 1)
    return;
    if (num == 1) {
    editor.setCaretPosition(0);
    return;
    int i;
    for (i = 0; i < text.length; i++) {
         if (text[i] == '\n') {
         lastNewline = i;
         lineNum++;
         if (num == lineNum) {
         editor.requestFocus();
         editor.setCaretPosition(lastNewline + 1);
         return;
    }     

    Perhaps extending a PlainDocument is better, if line
    numbers are meaningful for your application.
    About your method, mind that getText can be quite dear,
    so it is better not to call it if you don't need it.
    For a more efficient alternative, look at Document.getText(int offset, int length, Segment txt)It uses a Segment (un unguarded string) pointing directly
    into the document, which you can use much like a char
    array.
    As to your question, I would define a CaretListener
    so as to update the status bar when the caret moves.

  • How do I get the line number of the sales order and how do I save info?

    I am trying to create a form that is able to be called from a right click on the sales order matrix and will display some of the user defined fields associated with the line.
    I've managed to create a form and add a menu option to the right click but I'm now stuck because of the following:
    1. How to I know which line the user selected? I need the REAL Line Number from the RDR1 table because I need to use it on the data filter of the form.
    2. I hard coded a line to just to see if I can load a form and it appears to load and bind the data to the controls, but how do I save changes made? There are several text fields, combo boxes, and a picture control.

    Hi Coleman,
    1. The pVal returned form a menu event does no provide the LineId, but a pVal from a Item Event does. I suggest you use a DoubleClick or Control + Click on the Line to trigger an event that you can catch and use to launch your form.
    2. Please note that if the Sales Order line is closed you'll not be able to update the values. If it's not, then you need to instantiate a Sales Order document, get the correct document with the GetByKey method and update whatever fields you need.
                    Dim oSalesOrder As SAPbobsCOM.Documents = oCompany.GetBusinessObject(BoObjectTypes.oOrders)
                    If oSalesOrder.GetByKey(docentry) = True Then
                        oSalesOrder.Lines.SetCurrentLine(pVal.Row - 1)
                        oSalesOrder.Lines.UserFields.Fields.Item("U_MyUDF").Value = ""
                        oSalesOrder.Update()
                    End If
    Regards,
    Vítor Vieira

  • Invalid pc in line number table

    Hi,
    I try to decompile and recompile the class file and copy it back to the server getting the following error. I am using the latest Jdeveloper with OA , The ARU number is 5455514. I tried with few other classes, it works fine. Getting error for only one class (i.e. RcptTrxFListener). It's a telnet application for mobile devices.
    Can anyone help?
    Thanks
    Lalit
    [Wed Oct 11 05:39:59 CDT 2006] (Thread-10) SM_EXCEPTION: Exception occurred with user LALIT MISHRA
    java.lang.ClassFormatError: oracle/apps/inv/invtxn/server/RcptTrxFListener (Invalid pc in line number table)
         at java.lang.ClassLoader.defineClass0(Native Method)
         at java.lang.ClassLoader.defineClass(ClassLoader.java:488)
         at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:106)
         at java.net.URLClassLoader.defineClass(URLClassLoader.java:243)
         at java.net.URLClassLoader.access$100(URLClassLoader.java:51)
         at java.net.URLClassLoader$1.run(URLClassLoader.java:190)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(URLClassLoader.java:183)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:294)
         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:288)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:250)
         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:310)
         at oracle.apps.inv.invtxn.server.RcptTrxPage.<init>(RcptTrxPage.java:552)
         at java.lang.reflect.Constructor.newInstance(Native Method)
         at oracle.apps.mwa.container.StateMachine.loadPage(StateMachine.java:1329)
         at oracle.apps.mwa.container.StateMachine.loadMenuItem(StateMachine.java:1541)
         at oracle.apps.mwa.container.StateMachine.handleEvent(StateMachine.java:926)
         at oracle.apps.mwa.presentation.telnet.PresentationManager.handle(PresentationManager.java:690)
         at oracle.apps.mwa.presentation.telnet.ProtocolHandler.run(ProtocolHandler.java:818)

    Hi,
    Have you solved this error? I'm encountering the same error. Please reply ASAP.
    OAF gurus, this is the error i'm getting..
    ## Detail 0 ##
    JBO-30003: The application pool (dev4.devorg.orgDVI21540devorg.oracle.apps.po.createpo.server.CreatePosAM) failed to checkout an application module due to the following exception:
    oracle.jbo.JboException: JBO-29000: Unexpected exception caught: java.lang.ClassFormatError, msg=devorg/oracle/apps/po/createpo/server/CreatePosAMImpl (Invalid pc in line number table)
    Thanks in advance.

  • Print line number on print layout

    Hi all,
    Is there a way to print the line number on the print layout?
    Thanks,
    Jane

    Hi,
    Try this, you will get Line Number in Print.
    1st Method,
    ->> Open your PLD. Create 1 System Variable Field in Repetetive Area.
    ->> Put Variable No. - 77
    Else, 2nd Method,
    ->> Open your PLD. Create 1 Formula Field in Repetetive Area.
    ->> Put this Formula LineNum().
    Regards,
    Madhan.

  • Getting line number of  XML document

    Hi all,
    Can someone please help me in 'how to get the line number of XML document'. I know when it throws SAXParseException it give the line number. I want to get the line number when it parses the document successfully. I know i need to use setDocumentLocator and then implement the Locator.
    can someone give me a chunk of code for it.
    thx in advance,
    -Soni

    Hi,
    Atlast i got the solution. It goes like this..
    class A {
    Location loc;
    public void setDocumentLocator(Locator l) {
    loc = l;
    //Here goes other methods like startElement, endElement etc.
    public void someMethod() {
    loc.getLineNumber(); //u can do this anywhere inside the class
    -Soni

  • Javadoc Comments Begin and End Offset, Line number etc...

    Hello Everyone,
    I was wondering if there is a method that return the begin and end offsets, and line number of source code comment. I know this is possible to get the line number for Doc, MethodDoc, ConstutorDoc etc... with the position() method. I was unable to get the locations of comments corresponding to the actual source code. Also, I found that when asking for the position of constructors the value returned was that of the class, is this a known bug?
    Thanks in Advanced,
    Nick

    nkhamis wrote:
    Just out of curiosity, what do the folks at sun use for Java Parsers?They didn't need to go too far. The Java Parser must be a part of any Java compiler itself! Therefore, it is a part of any JDK. Obviously, they have some internal API of their Java parser and, I guess, Javadoc uses it to build the Java code model provided via the Doclet API. But Sun had never published the full API to their Java parser. (At least, I don't know such.) Although, it would be very useful indeed...
    FYI, a parser for a high-level programming language (like Java) is a software module that inputs a program written (by humans) as text in that language and converts it into some object representation (model) "understandable" to computer. That object representation must be a sort of tree representing all the language constructs found in the program. Typically, that tree is accessible via a certain API, which I call here a Parser API (although, other terminology may be used).
    Other software modules may use that object representation of the program for various purposes, for instance:
    - To generate an executable machine (or byte-) code by it
    - To transform the initial program in order to optimize it (this is used by compilers) or to do other things (e.g. refactoring)
    - To generate documentation (that's what Javadoc does)
    Besides generating the program object representation, another job of a parser is to provide diagnostics about various syntactical errors found in the initial program source (a well as possibly some semantic warnings).
    A parser is rather sophisticated piece of code. To develop it properly, one needs to learn first some theory about this, e.g. a formal grammar that describes the given programming language and how to deal with it. I know, there have been attempts to create some universal parsers that can be adjusted to parse any programming language (within a certain range) by specifying to them some formal grammar of that language. That topic was particularly beloved by university guys, so there must be many scientific articles about this.
    thomas.behr wrote:
    Well, if you are developing an Eclipse plugin, have you considered working with Eclipse' Abstract Syntax Tree (basically an object model for Java code) instead of the Doclet API?Interesting stuff... Looks like this might be that very Java parser API I am talking about here.
    Leonid Rudy
    [http://www.docflex.com|http://www.docflex.com]

  • How to get the line number of source file?

    Hi,
    What is the equivalent in Java of the __LINE__ and __FILE__ macros in C? I want to print out the line number and the file name where the instruction is being executed.
    Thanks,

    If you are doing this because you're implementing your own debug logging, have a look at Log4J.
    You can configure it to log classnames, method names and line numbers of the code you're executing.

Maybe you are looking for