ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Guru Balse <guru.ba...@oracle.com>
Subject Re: Javac problem in Ant 1.6.1
Date Fri, 16 Apr 2004 23:35:12 GMT
Oops, I meant

debugLevel = debugLevel.replaceAll(" ", "");

:-O

Guru Balse wrote:
> 
> Good catch, Matt!
> 
> I know this is a javac limitation:
> 
> Usage: javac <options> <source files>
> where possible options include:
>   -g                        Generate all debugging info
>   -g:none                   Generate no debugging info
>   -g:{lines,vars,source}    Generate only some debugging info
> ...
> 
> But so many are falling into this trap that I'm wondering if the DefaultCompilerAdapter
should be changed to make it "smart" enough to remove spaces from attributes.getDebugLevel()
to make this work correctly?
> 
> Namely:
> 
>             if (useDebugLevel && !assumeJava11()) {
>                 String debugLevel = attributes.getDebugLevel();
>                 debugLevel.replaceAll(" ", "");                 // *** workaround for
jdk 1.4.X and above ***
>                 if (debugLevel != null) {
>                     cmd.createArgument().setValue("-g:" + debugLevel);
>                 } else {
>                     cmd.createArgument().setValue("-g");
>                 }
>             } else {
>                 cmd.createArgument().setValue("-g");
>             }
> 
> Matt Benson wrote:
> >
> > Just saw this recently:
> > http://marc.theaimsgroup.com/?t=108087280700001&r=1&w=2
> > --Take the spaces out of your debuglevel attribute.
> >
> > -Matt
> >
> > --- Rhino <rhino1@sympatico.ca> wrote:
> > > I'm having a problem with the javac task in Ant
> > > 1.6.1. Even though I have debug set to 'on' and
> > > debuglevel includes the 'lines' argument, I get
> > > (Unknown Source) in my stacktrace for that module
> > > when an exception is detected.
> > >
> > > Here is my task:
> > > <javac srcdir="${RDS.src.dir}"
> > > destdir="${RDS.bin.dir}" compiler="modern"
> > > fork="yes"
> > >
> > > includes="${package}/IncomeClient.java,
> > > ${package}/IncomeProc.java" verbose="yes"
> > >
> > > debug="on" debuglevel="lines, vars, source"
> > > deprecation="yes"
> > >
> > > description="Compile client and procedure."/>
> > >
> > >
> > >
> > > Here is my stacktrace; the last line is one of the
> > > modules compiled in the task above:
> > >
> > > at java.lang.Throwable.<init>(Throwable.java:96)
> > >
> > > at java.lang.Exception.<init>(Exception.java:44)
> > >
> > > at
> > > java.sql.SQLException.<init>(SQLException.java:45)
> > >
> > > at
> > >
> > COM.ibm.db2.jdbc.DB2Exception.<init>(DB2Exception.java:72)
> > >
> > > at
> > >
> > COM.ibm.db2.jdbc.app.SQLExceptionGenerator.throw_SQLException(SQLExceptionGenerator.java:275)
> > >
> > > at
> > >
> > COM.ibm.db2.jdbc.app.SQLExceptionGenerator.throw_SQLException(SQLExceptionGenerator.java:212)
> > >
> > > at
> > >
> > COM.ibm.db2.jdbc.app.SQLExceptionGenerator.check_return_code(SQLExceptionGenerator.java:463)
> > >
> > > at
> > >
> > COM.ibm.db2.jdbc.app.DB2PreparedStatement.<init>(DB2PreparedStatement.java:612)
> > >
> > > at
> > >
> > COM.ibm.db2.jdbc.app.DB2PreparedStatement.<init>(DB2PreparedStatement.java:680)
> > >
> > > at
> > >
> > COM.ibm.db2.jdbc.app.DB2Connection.prepareStatement(DB2Connection.java:600)
> > >
> > > at
> > > notlogged.IncomeProc.getIncomeByHomeCountry(Unknown
> > > Source)
> > >
> > > As you can see, I'm not getting any line numbers for
> > > the module which I compiled via the javac task.
> > >
> > > I researched this in Google and couldn't find any
> > > reasons for not seeing line numbers in a stacktrace
> > > other than the failure to request debugging
> > > information during the compile. Am I doing something
> > > wrong or is there a bug in the javac task?
> > >
> > > I'm using Ant 1.6.1 on Windows XP.
> > >
> > >
> > > Rhino
> > > ---
> > > rhino1 AT sympatico DOT ca
> > > "If you're getting something for nothing, you're not
> > > using your own credit card."
> >
> >
> >
> > __________________________________
> > Do you Yahoo!?
> > Yahoo! Tax Center - File online by April 15th
> > http://taxes.yahoo.com/filing.html
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> > For additional commands, e-mail: user-help@ant.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org

-- 
Guru Balse
   Oracle - Server Technologies - iAS Integration QA
   Work: 650.506.1611 (1op668 - HQ)

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message