A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pmd/pmd/issues/1738 below:

[java] MethodReturnsInternalArray does not work in inner classes · Issue #1738 · pmd/pmd · GitHub

Affects PMD Version: 6.12

Rule: MethodReturnsInternalArray

Description:
In the provided code sample only the getter of the outer class is found by the rule MethodReturnsInternalArray.
The rule ArrayIsStoredDirectly however finds both setters.

Code Sample demonstrating the issue:

public class Outer {
	private int[] arr;
	
	public int[] getArr() {
		return arr;
	}
	
	public void setArr(int... arr) {
		this.arr = arr;
	}
	
	public static class Inner {
		private int[] arr2;
		
		public int[] getArr2() {
			return arr2;
		}
		
		public void setArr2(int... arr2) {
			this.arr2 = arr2;
		}
	}
}

Running PMD through: Eclipse


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4