用Lombok生成Java getter / setter以获得带注释的代码(Java getter/setter generation with Lombok for code with annotations)
我使用Project Lombok为Java类的所有字段自动生成getter和setter方法。
当使用
@XmlTransient
注释一个字段时,注释不会传播到生成的getter / setter方法,因此在生成的代码中它不会显示任何效果。 有没有办法使用自动getter / setter生成结合进一步的注释?I use Project Lombok to automatically generate getter and setter methods for all fields of a Java class.
When a field is annotated with e.g.
@XmlTransient
, the annotation is not propagated to the generated getter/setter methods, thus in the resulting code it does not show any effect. Is there a way to use automatic getter/setter generation in conjunction with further annotations?
原文:https://stackoverflow.com/questions/3665924
最满意答案
据我所知,这只是指出内存中重复的字符串。 但是,这不仅仅用于找到相同字符串已被输入到多个资源的情况。 例如,由于字符串在Java中是不可变的,因此您最终可能会得到比您最初意识到的更多的字符串实例。 如果你的应用程序有很多字符串连接代码,但不使用StringBuilder,或者如果你的应用程序进行任何字符串/文本处理,它很容易以字符串占用意想不到的大量空间。 但相反,为了获得一些空间(一旦你能看到问题出在哪里),通常可以进行相对容易的优化。 所以你可以说这个任务更多的是关于记忆的“优化”,而不是找到泄漏。
As far as I know, this does just point out duplicated strings in memory. However, this is useful for more than just finding cases where the same string has been entered into more than one resource. For example, as Strings are immutable in Java, you can easily end up with many more instances of strings than you might initially realise. If your app has lots of string concatenation code but dont use StringBuilder, or if your app does any string/text processing, its fairly easy to end up with unexpectedly large amounts of space taken up by strings. But conversely, it can often be a relatively easy optimization to make in order to gain back some space (once you can see what the problem is). So you could say this task is more about memory 'optimization', rather than finding a leak.
相关问答
更多-
LINUX 如何查看JPG文件[2022-06-13]
find -
为什么我想用HPROF查看器和分析器查找“重复字符串”?(Why would I want to find “Duplicate Strings” with HPROF Viewer and Analyzer?)[2023-07-01]
据我所知,这只是指出内存中重复的字符串。 但是,这不仅仅用于找到相同字符串已被输入到多个资源的情况。 例如,由于字符串在Java中是不可变的,因此您最终可能会得到比您最初意识到的更多的字符串实例。 如果你的应用程序有很多字符串连接代码,但不使用StringBuilder,或者如果你的应用程序进行任何字符串/文本处理,它很容易以字符串占用意想不到的大量空间。 但相反,为了获得一些空间(一旦你能看到问题出在哪里),通常可以进行相对容易的优化。 所以你可以说这个任务更多的是关于记忆的“优化”,而不是找到泄漏。 A ... -
最后找出我需要这个代码来生成hprof,因为DDMS已经有了这个功能。 对不起,打扰你们,谢谢。 Finally find out I dun reli need this code to generate hprof as DDMS already has this function. Sorry for disturbing you guys and thank you.
-
启动Android设备监视器时无法找到hprof-conv(Unable to find hprof-conv when launching Android Device Monitor)[2022-05-16]
FYI这个应该已经是最新的。 如果您看到此错误,请重新运行Android SDK管理器,并确保Android SDK Tools已更新为23.0.1或更新版本。 FYI this should already be fixed with latest. If you're seeing this error, re-run your Android SDK manager and make sure Android SDK Tools is updated to Rev. 23.0.1 or later. -
如何分析.hprof文件?(How do I analyze a .hprof file?)[2023-09-17]
如果你想要一个相当先进的工具来做一些严重的问题,可以看看Eclipse 的内存分析器项目 ,由SAP贡献给他们。 你可以做的一些事情是有意识地发现内存泄漏等等 - 包括针对内存中对象运行一种有限的SQL(OQL)形式,即 SELECT toString(firstName)FROM com.yourcompany.somepackage.User 完全辉煌 If you want a fairly advanced tool to do some serious poking around, look at ... -
为了让DDMS在运行中进行转换,请在Preferences Android - > DDMS - > HPROF Action:Eclipse中打开。 To let DDMS convert it on-the-fly, set in Preferences Android -> DDMS -> HPROF Action: Open in Eclipse.
-
大型HPROF文件(Large HPROF file)[2023-10-08]
JProfiler 8.1将能够在不调整-Xmx VM参数的情况下打开更大的HPROF文件。 要获得预发布,请联系support @ ej-technologies。 JProfiler 8.1 will be able to open much larger HPROF files without tuning the -Xmx VM parameter. To get a pre-release, please contact support@ej-technologies. -
你不需要使用emacs,因为vim可以为你做(我说这是因为你标记了这个vim ,而不是开始一场火焰战争)。 要在vim中执行此操作,请在vim中打开二进制文件并键入以下内容: :%!xxd 这将过滤文件并转换为十六进制模式。 打开时看起来像这样的东西: Êþº¾^@^@^@^B^@^@^@^R^@^@^@^@^@^@^P^@^@^@L0^@^@^@^L^@^@^@^G^@^@^@^C^@^@`^@^@^@ ^@^@^L^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@ ...
-
我认为它似乎是位图的DIB部分,我不熟悉mac看到DIB的工具,但你可以尝试google它。 The answer appears to be here: MAT (Eclipse Memory Analyzer) - how to view bitmaps from memory dump However, I had some difficulty getting it to work.
-
尝试了一种不同的方法,它起作用(排除设置进入体内)。 这是怎么回事。 put trial { "settings" : { "analysis" : { "analyzer" : { "lyzer" : { "tokenizer" : "nizer" } }, ...