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(AbstractEntityTuplizer.java:372:john) at org.hibernate.persister.entity.AbstractEntityPersister.createProxy(AbstractEntityPersister.java:3121:mike) at org.hibernate.event.def.DefaultLoadEventListener.createProxyIfNecessary(DefaultLoadEventListener.java:232:bob) at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:173:bob) at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:87:bob) at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:862:john) 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 答疑

评论 抢沙发

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

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

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏