Skip to content

Instantly share code, notes, and snippets.

@nerzid
Created March 17, 2017 20:14
Show Gist options
  • Save nerzid/467971c05144eb5d351215dea37f8932 to your computer and use it in GitHub Desktop.
Save nerzid/467971c05144eb5d351215dea37f8932 to your computer and use it in GitHub Desktop.
public class hello {
public String foo(String s) {
s = "hello world";
String x = "eren";
System.out.println("s: " + s + "x: " + x);
System.out.println("s: " + s + "x: " + x);
System.out.println("s: " + s + "x: " + x);
System.out.println(s = s + x);
magic();
if (!(s.isEmpty()))
return s + x;
else if (s.length > 5){
return s + "x";
}
else{
int count = 0;
List<String> list = new ArrayList<>();
while (count <= s.length) {
count++;
list.add(s);
}
if (list.length > 0)
return list.get(0);
else
return count;
}
}
public void magic(){
}
}
@nerzid
Copy link
Author

nerzid commented Mar 17, 2017

METHOD: java.lang.String foo(java.lang.String)
ENDING S_UNITS
----> return s + x
----> return s + "x"
----> return list.get(0)
----> return count

VOID-RETURN S_UNITS
----> System.out.println(((("s: " + s) + "x: ") + x))
----> System.out.println(((("s: " + s) + "x: ") + x))
----> System.out.println(((("s: " + s) + "x: ") + x))
----> System.out.println((s = s + x))
----> magic()

SAME-ACTION S_UNITS
----> System.out.println(((("s: " + s) + "x: ") + x))

DATA-FACILITATING S_UNITS
----> s = "hello world"
----> (s = s + x)

CONTROLLING S_UNITS
----> !(s.isEmpty())
----> (s.length) > 5
----> count <= (s.length)
----> list > 0

METHOD: void magic()
ENDING S_UNITS
none

VOID-RETURN S_UNITS
none

SAME-ACTION S_UNITS
none

DATA-FACILITATING S_UNITS
none

CONTROLLING S_UNITS
none

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment