Is it possible to add custom metadata to .class files?

We have used liquibase at our company for a while, and we've had a continuous integration environment set up for the database migrations that would break a job when a patch had an error. An interesting "feature" of that CI environment is that the breakage had a "likely culprit", because all patches need to have an "author", and the error message shows the author name. If you don't know what liquibase is, that's ok, its not the point. The point is: having a **person** name attached to a error is really good to the software development proccess: **problems get addressed way faster**. So I was thinking: Is that possible for Java stacktraces? Could we possibly had a stacktrace with peoples names along with line numbers like the one below? java.lang.NullPointerException at org.hibernate.tuple.AbstractEntityTuplizer.createProxy( at org.hibernate.persister.entity.AbstractEntityPersister.createProxy( at org.hibernate.event.def.DefaultLoadEventListener.createProxyIfNecessary( at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad( at org.hibernate.event.def.DefaultLoadEventListener.onLoad( at org.hibernate.impl.SessionImpl.fireLoad( That kind of information would have to be pulled out from a SCM system (like performing "svn blame" for each source file). Now, forget about trashing the compilation time for a minute: Would that be even possible? To add metadata to class files like that?
Why would you put this in a class file? Having this in an external system would probably be a better idea?

以上就是Is it possible to add custom metadata to .class files?的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准