Skip to content

Add collapse hierarchy java #109

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions simple/java/collapse-hiearchy-after.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
public class Website
{
public string Title { get; set; }
public string Description { get; set; }
public IEnumerable<Webpage> Pages { get; set; }
public bool IsActive { get; set; }
}
11 changes: 11 additions & 0 deletions simple/java/collapse-hierarchy-before.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
public class Website
{
public string Title { get; set; }
public string Description { get; set; }
public IEnumerable<Webpage> Pages { get; set; }
}

public class StudentWebsite : Website
{
public bool IsActive { get; set; }
}
8 changes: 8 additions & 0 deletions simple/java/dead-code-after.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
int testFunction() {
// ...
if (a) {
return a;
}
b++;
return b;
}
10 changes: 10 additions & 0 deletions simple/java/dead-code-before.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
int testFunction() {
// ...
if (a) {
return a;
}
else {
b++;
return b;
}
}
25 changes: 25 additions & 0 deletions simple/php/primitive-obsession-after.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php
class contactUs {
private $streetNum;
private $streetName;
private $zipCode;

public function addressCountryA() {
$address = new Array();
$this->streetNum = 10;
$this->streetName = 'Oregon St';
$this->zipCode = '7726128';

return $this->streetName.' '.$this->streetNum.','.$this->zipCode;
}

public function addressCountryB() {
$address = new Array();
$this->streetNum = 22;
$this->streetName = 'Berlin St';
$this->zipCode = '882719';

return $this->streetName.' '.$this->streetNum.','.$this->zipCode;
}
// ...
}
21 changes: 21 additions & 0 deletions simple/php/primitive-obsession-before.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php
class contactUs {
public function addressCountryA() {
$address = new Array();
$address['streetNum'] = 10;
$address['streetName'] = 'Oregon St';
$address['zipCode'] = '7726128';

return $address['streetName'].' '.$address['streetNum'].','.$address['zipCode'];
}

public function addressCountryB() {
$address = new Array();
$address['streetNum'] = 22;
$address['streetName'] = 'Berlin St';
$address['zipCode'] = '882719';

return $address['streetName'].' '.$address['streetNum'].','.$address['zipCode'];
}
// ...
}