Created
January 4, 2016 22:41
-
-
Save NaanProphet/5cc6748f899ab725e4d1 to your computer and use it in GitHub Desktop.
Regex Pojos
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Notepad++ Regex for replacing malicious dates in POJOs | |
note: . matches newline must NOT be checked | |
Only meant for Notepad++, have to open the files from Explorer and then click Refresh in Eclipse afterwards. | |
May not be 100% foolproof! Imperative to review the files manually! | |
Note: before replacing, use the "Mark All" feature in Notepad++ with "Bookmark line" checked. Then after replacing, jump to the next bookmark using F2 (and Shift+F2) | |
******************** | |
For Getters | |
Find: | |
(public Date get\w*?\(\)\s\{\s*?\n\s.*?return )(?!ObjectUtils)(\w*?)(;)$ | |
Replace: | |
\1ObjectUtils.clone\(\2\)\3 | |
For Setters | |
Find: | |
(public void set\w+?\(Date \w+?\) \{\s*?\n\s.*? = )(?!ObjectUtils)(\w*)(;)$ | |
Replace: | |
\1ObjectUtils.clone\(\2\)\3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment