6

I have a bug from my customer and when I look into the log we trace the exception, some of the stacktrace do not have line number:

at xxxx.xxx.xx.x.xx.DayIntervalRule.getInterval(DayIntervalRule.java)
at xxxx.xxx.xx.x.xx.XXSchedule.getNextDueDate(XXSchedule.java)
at xxxx.xxx.xx.x.xx.XXSchedule.evaluateRules(XXSchedule.java)

Please note that: I have replace the package name into something like"xx"),and all of the class and method are defined in our application:

The full stack trace are as below:

java.lang.NullPointerException
    at xxxx.xxx.xx.x.xx.DayIntervalRule.getInterval(DayIntervalRule.java)
    at xxxx.xxx.xx.x.xx.XXSchedule.getNextDueDate(XXSchedule.java)
    at xxxx.xxx.xx.x.xx.XXSchedule.evaluateRules(XXSchedule.java)
    at xxxx.xxx.xx.x.xx.EvaluateRulesVistor.visitXXNode(EvaluateRulesVistor.java:56)
    at xxxx.xxx.xx.x.xx.XXNode.accept(XXNode.java:396)
    at xxxx.xxx.xx.x.xx.AssetXX.traverseForest(AssetXX.java:351)
    at xxxx.xxx.xx.x.xx.AssetXX.run(AssetXX.java:70)
    at xxxx.xxx.xx.x.xx.XXEngine.doForecast(XXEngine.java:437)
    at xxxx.xxx.xx.x.xx.XXEngine.forecastWorkOrders2(XXEngine.java:380)

I am interested in why this happens?Is it possible that my customer do something to the existing code(customization)?

JaskeyLam
  • 15,405
  • 21
  • 114
  • 149

1 Answers1

5

The code that does not display line numbers was compiled without debug information.

Mureinik
  • 297,002
  • 52
  • 306
  • 350
  • 2
    Thank you for your answer? What do you mean compiled without debug information? And I read http://stackoverflow.com/questions/5746894/javac-with-debugging-information-option-gvars-output-example and the accepted answer says that -g Generate all debugging information, including local variables. By default, only line number and source file information is generated. So, it seems the line number should be included by default isn't it? – JaskeyLam Aug 07 '14 at 05:28
  • 1
    @Jaskey This depends on how the code was compiled, take a look at [Option "-g" - Controlling Debugging Information](http://www.herongyang.com/Java-Tools/javac-g-Controlling-Debugging-Information.html) for more details – MadProgrammer Aug 07 '14 at 05:46
  • @Jaskey If you use Eclipse, you can configure it under `Java Compiler` of Project's Properties setting. Like *Add line number attributes to generated...* – Wundwin Born Aug 07 '14 at 05:54