<editor-fold desc="Setters">
973886
public function getSetterDeclarationLines(CPPAttribute $attribute)
    {
        $lines = [];

        if ('object' === $attribute->getType()) {
            $lines[] = $this->getEntity()->getProject()->getAutocodeProperty('base')
                ? $this->getEntity()->getNameBase() . ' ' . $attribute->getSetterName() . '(' . $attribute->getEntitySubtype()->getName() . ' ' . $attribute->getName() . ');'
                : $this->getEntity()->getName() . ' ' . $attribute->getSetterName() . '(' . $attribute->getEntitySubtype()->getName() . ' ' . $attribute->getName() . ');';
        } else {
            $lines[] = $this->getEntity()->getProject()->getAutocodeProperty('base')
                ? $this->getEntity()->getNameBase() . ' ' . $attribute->getSetterName() . '(' . $attribute->getType() . ');'
                : $this->getEntity()->getName() . ' ' . $attribute->getSetterName() . '(' . $attribute->getType() . ');';
        }

        return $lines;
    }
491787
public static void invokeSetter(Object obj, String propertyName, Object value) {
		Method method = getSetterMethod(obj.getClass(), propertyName, value.getClass());
		if (method == null) {
			throw new IllegalArgumentException(
					"Could not find getter method [" + propertyName + "] on target [" + obj + ']');
		}
		invokeMethod(obj, method, value);
	}
160827
@Override
    public Object setE(int key, Object value) throws ExpressionException {
	if (offset + key > arr.length) enlargeCapacity(key);
	if (key > size) size = key;
	arr[(offset + key) - 1] = checkValue(value);
	return value;
    }
278729
function(value) {
                this.lastValue = this.currentValue;
                this.currentValue = value;
                this.setter.call(this.target, this.target, value, this);
            }
245177
function Set() {
            var set = this;
            set = emulateES6construct(set);
            if (!set._es6set) {
              throw new TypeError('bad set');
            }

            defineProperties(set, {
              '[[SetData]]': null,
              '_storage': emptyObject()
            });

            // Optionally initialize map from iterable
            var iterable = arguments[0];
            if (iterable !== undefined && iterable !== null) {
              var it = ES.GetIterator(iterable);
              var adder = set.add;
              if (!ES.IsCallable(adder)) { throw new TypeError('bad set'); }
              while (true) {
                var next = ES.IteratorNext(it);
                if (next.done) { break; }
                var nextItem = next.value;
                adder.call(set, nextItem);
              }
            }
            return set;
          }
769934
@Override
	public void setY(double min, double max) {
		if (min <= max) {
			this.minyProperty.set(min);
			this.maxyProperty.set(max);
		} else {
			this.minyProperty.set(max);
			this.maxyProperty.set(min);
		}
	}
1188516
private void generateSetter(Field field) {
    if (isPrivate) {
      invokeReflection(getMethod(void.class, "set", Object.class, Object.class), setterSignature());
    } else {
      directSetter(field);
    }

    if (field.getType().isPrimitive()) {
      primitiveSetter(field);
    }
  }
567417
public static void setPropertyEL(Object obj, String prop, Object value) {

	// first check for field
	Field[] fields = getFieldsIgnoreCase(obj.getClass(), prop, null);
	if (!ArrayUtil.isEmpty(fields)) {
	    try {
		fields[0].set(obj, value);
		return;
	    }
	    catch (Throwable t) {
		ExceptionUtil.rethrowIfNecessary(t);
	    }
	}

	// then check for setter
	try {
	    getSetter(obj, prop, value).invoke(obj);
	}
	catch (Throwable t) {
	    ExceptionUtil.rethrowIfNecessary(t);
	}

    }
869220
function createGettersAndSetters() {
        var editor = EditorManager.getActiveEditor();
        if (!editor) {
            return;
        }
        initializeRefactoringSession(editor);

        var startIndex = current.startIndex,
            endIndex = current.endIndex,
            selectedText = current.selectedText;

        if (selectedText.length >= 1) {
            var selectionDetails = RefactoringUtils.normalizeText(selectedText, startIndex, endIndex);
            selectedText = selectionDetails.text;
            startIndex = selectionDetails.start;
            endIndex = selectionDetails.end;
        }

        var token = TokenUtils.getTokenAt(current.cm, current.cm.posFromIndex(endIndex)),
            commaString = ",",
            isLastNode,
            templateParams,
            parentNode,
            propertyEndPos;

        //Create getters and setters only if selected reference is a property
        if (token.type !== "property") {
            current.editor.displayErrorMessageAtCursor(Strings.ERROR_GETTERS_SETTERS);
            return;
        }

        parentNode = current.getParentNode(current.ast, endIndex);
        // Check if selected propery is child of a object expression
        if (!parentNode || !parentNode.properties) {
            current.editor.displayErrorMessageAtCursor(Strings.ERROR_GETTERS_SETTERS);
            return;
        }


        var propertyNodeArray = parentNode.properties;
        // Find the last Propery Node before endIndex
        var properyNodeIndex = propertyNodeArray.findIndex(function (element) {
            return (endIndex >= element.start && endIndex < element.end);
        });

        var propertyNode = propertyNodeArray[properyNodeIndex];

        //Get Current Selected Property End Index;
        propertyEndPos = editor.posFromIndex(propertyNode.end);


        //We have to add ',' so we need to find position of current property selected
        isLastNode = current.isLastNodeInScope(current.ast, endIndex);
        var nextPropertNode, nextPropertyStartPos;
        if(!isLastNode && properyNodeIndex + 1 <= propertyNodeArray.length - 1) {
            nextPropertNode = propertyNodeArray[properyNodeIndex + 1];
            nextPropertyStartPos = editor.posFromIndex(nextPropertNode.start);

            if(propertyEndPos.line !== nextPropertyStartPos.line) {
                propertyEndPos = current.lineEndPosition(current.startPos.line);
            } else {
                propertyEndPos = nextPropertyStartPos;
                commaString = ", ";
            }
        }

        var getSetPos;
        if (isLastNode) {
            getSetPos = current.document.adjustPosForChange(propertyEndPos, commaString.split("\n"),
                                                            propertyEndPos, propertyEndPos);
        } else {
            getSetPos = propertyEndPos;
        }
        templateParams = {
            "getName": token.string,
            "setName": token.string,
            "tokenName": token.string
        };

        // Replace, setSelection, IndentLine
        // We need to call batchOperation as indentLine don't have option to add origin as like replaceRange
        current.document.batchOperation(function() {
            if (isLastNode) {
                //Add ',' in the end of current line
                current.document.replaceRange(commaString, propertyEndPos, propertyEndPos);
            }

            current.editor.setSelection(getSetPos); //Selection on line end

            // Add getters and setters for given token using template at current cursor position
            current.replaceTextFromTemplate(GETTERS_SETTERS, templateParams);

            if (!isLastNode) {
                // Add ',' at the end setter
                current.document.replaceRange(commaString, current.editor.getSelection().start, current.editor.getSelection().start);
            }
        });
    }
1232674
public static void invokeSetter(Object object, String fieldName, Object value, boolean ignoreNonExisting)
	{
		Field field = ReflectionUtils.findField(object.getClass(), fieldName);
		if(null == field) {
			if (ignoreNonExisting) {
				return;
			} else {
				throw new NullPointerException("no field with name " + fieldName + " found on output object. ignoreNonExisting was " + ignoreNonExisting);
			}
		}
		invokeSetter(object, field, value, ignoreNonExisting);
	}
1024062
function(prop) {
      var args = Array.prototype.slice.apply(arguments, [1]);
      if (this.setter[prop]) {
        this.setter[prop].apply(this, args);
      } else {
        this[prop] = args.join(',');
      }
    }
847366
def getter_to_setter(getter)
      getter = getter.strip.gsub(/\(\s*\)/, '')

      # Check to see if this can be converted to a setter
      if getter[0] =~ /^[A-Z]/ && getter[-1] != ')'
        if getter.index('.')
          "#{getter}=(val)"
        else
          "raise \"could not auto generate setter for `#{getter}`\""
        end
      elsif getter[0] =~ /^[a-z_]/ && getter[-1] != ')'
        # Convert a getter into a setter
        if getter.index('.') || getter.index('@')
          prefix = ''
        else
          prefix = 'self.'
        end

        "#{prefix}#{getter}=(val)"
      else
        "raise \"could not auto generate setter for `#{getter}`\""
      end
    end
549685
function(proto, key, def) {
		var desc;
		["getter", "setter"].forEach(function(name, set) {
			while (proto && proto[key] && !gui.Type.isDefined(def[name])) {
				proto = Object.getPrototypeOf(proto);
				desc = Object.getOwnPropertyDescriptor(proto, key);
				if (desc) {
					def[name] = desc[set ? "set" : "get"];
				}
			}
		});
		return {
			enumerable: true,
			configurable: true,
			get: def.getter || this._NOGETTER,
			set: def.setter || this._NOSETTER
		};
	}
197777
function set() {
    function Set() {}
    var ret = new Set();
    var arg, i, len;

    for(i = 0, len = arguments.length; i < len; i++) {
        arg = arguments[i];

        if(arg.constructor.name == 'Set') Object.keys(arg).filter(
            not(prop.bind(undefined, ret))
        ).forEach(addElem.bind(undefined, ret));
        else if(!(arg in ret)) addElem(ret, arg);
    }

    return Object.preventExtensions(ret);
}
1175337
function(getterSetter, context, eventName, bindOnce) {
	var args = [];

	for(var i = 0, arglen = arguments.length; i < arglen; i++) {
		args[i] = arguments[i];
	}

	var contextType = typeof args[1];

	if (typeof args[0] === 'function') {
		// Getter/Setter functional computes.
		// `new can.Compute(function(){ ... })`
		this._setupGetterSetterFn(args[0], args[1], args[2], args[3]);
	} else if (args[1] !== undefined) {
		if (contextType === 'string' || contextType === 'number') {
			// Property computes.
			// `new can.Compute(object, propertyName[, eventName])`
			var isListLike = canReflect.isObservableLike(args[0]) && canReflect.isListLike(args[0]);
			var isMapLike = canReflect.isObservableLike(args[0]) && canReflect.isMapLike(args[0]);
			if(isMapLike || isListLike) {
				var map = args[0];
				var propertyName = args[1];
				var mapGetterSetter = function(newValue){
					if(arguments.length) {
						observeReader.set(map,propertyName, newValue);
					} else {
						// forces length to be read
						if(isListLike) {
							observeReader.get(map,"length");
						}
						return observeReader.get(map,""+propertyName);
					}
				};
				this._setupGetterSetterFn(mapGetterSetter, args[1], args[2], args[3]);
			} else {
				this._setupProperty(args[0], args[1], args[2]);
			}

		} else if(contextType === 'function') {
			// Setter computes.
			// `new can.Compute(initialValue, function(newValue){ ... })`
			this._setupSetter(args[0], args[1], args[2]);
		} else {

			if(args[1] && args[1].fn) {
				// Async computes.
				this._setupAsyncCompute(args[0], args[1]);
			} else {
				// Settings computes.
				//`new can.Compute(initialValue, {on, off, get, set})`
				this._setupSettings(args[0], args[1]);
			}

		}
	} else {
		// Simple value computes.
		// `new can.Compute(initialValue)`
		this._setupSimpleValue(args[0]);
	}

	this._args = args;
	this._primaryDepth = 0;

	this.isComputed = true;

}
166701
private void addGetterAndSetter(JDefinedClass traversingVisitor, JFieldVar field) {
        String propName = Character.toUpperCase(field.name().charAt(0)) + field.name().substring(1);
        traversingVisitor.method(JMod.PUBLIC, field.type(), "get" + propName).body()._return(field);
        JMethod setVisitor = traversingVisitor.method(JMod.PUBLIC, void.class, "set" + propName);
        JVar visParam = setVisitor.param(field.type(), "aVisitor");
        setVisitor.body().assign(field, visParam);
    }
1267772
static Set<Method> getSetters(Class<?> targetClass, String propertyName) {
		String setterName = setterName(propertyName);
		Set<Method> setters = new HashSet<>();

		while (targetClass != null) {
			for (Method method : targetClass.getDeclaredMethods()) {
				if (method.getName().equals(setterName) && method.getParameterTypes().length == 1) {
					logger.debug("Found setter {} in class {}", method, targetClass);
					setters.add(method);
				}
			}
			targetClass = targetClass.getSuperclass();
		}

		return setters;
	}