Use this page to discuss script 490 java_getset: automatically add getter/setters for Java properties

  • Add constructive comments, bug reports, or discuss improvements (see the guideline).
  • Do not document the script here (the author should do that on
  • This page may be out of date: check the script's page above, and its release notes.

Problem with genericsEdit

Superb script really great, however it seems to fail on generics.

private List<String> foo;

getset won't generate methods for this field.

private List foo;

but it will when generics are removed. --January 16, 2012

A quick hack to support generics:
  1. Open your java_getset.vim file
  2. Search for definition of s:variable (i.e. let s:variable = ......)
  3. Before that line add a new definition: let s:generics = '\%(\s*\%(<.*>\)\)\='
  4. Change the definition of s:variable to (see underlined part): let s:variable = '\(\s*\)\(\(' . s:modifier . '\s\+\)*\)\(' . s:javaname . s:generics . '\)' . s:brackets . '\s\+\(' . s:javaname . '\)\s*\(;\|=[^;]\+;\)'
What this does is it extends the regular expression matching the field definitions by adding "<...>" to the type part. Actually it does not check for what's inside the angle brackets and since allowing for multi-type generics and nested generics, too.
(As with the nature of quick hacks this one does not fix the javadoc creation where angle brackets will still appear as angle brackets instead of HTML-code.)
--February 27, 2012


Unrelated, but I love the comments in this script! Great job commenting your code!!! Very organized and easy to follow!!

Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.