Skip to content
This repository has been archived by the owner on May 1, 2022. It is now read-only.

Commit

Permalink
Fixed errors regarding two identical galaxies not being identical.
Browse files Browse the repository at this point in the history
Updated to version 0.0.8
  • Loading branch information
Sobuno committed Aug 3, 2015
1 parent 11becb8 commit ea92887
Show file tree
Hide file tree
Showing 13 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions SWGAide-version.TXT
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
0.9.8-Sobuno-0.0.7
Wed April 8 23:00:00 CET 2015
0.9.8-Sobuno-0.0.8
Mon August 3 22:20:00 CET 2015
2 changes: 1 addition & 1 deletion swg/SWGConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public class SWGConstants {
/**
* The version number of the SWGAide that is available for download.
*/
public static final String version = "0.9.8-Sobuno-0.0.7";
public static final String version = "0.9.8-Sobuno-0.0.8";

/**
* Indicates whether we are operating in NGE mode or pre-CU mode
Expand Down
8 changes: 4 additions & 4 deletions swg/crafting/resources/SWGResourceCache.java
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ SWGKnownResource getInstance(String name, SWGCGalaxy galaxy) {
throw new NullPointerException("An argument is null");

for (SWGKnownResource kr : cache) {
if (kr.galaxy() == galaxy && kr.getName().equals(name))
if (kr.galaxy().equals(galaxy) && kr.getName().equals(name))
return kr;
}
return null;
Expand Down Expand Up @@ -225,7 +225,7 @@ SWGResourceSet getSet(SWGCGalaxy galaxy) {

SWGResourceSet ret = new SWGResourceSet(cache.size());
for (SWGKnownResource kr : cache) {
if (kr.galaxy() == galaxy)
if (kr.galaxy().equals(galaxy))
ret.privateAdd(kr); // we are sure kr is valid
}
return ret.get();
Expand Down Expand Up @@ -283,7 +283,7 @@ SWGResourceSet getType(SWGResourceClass type, SWGCGalaxy galaxy) {
SWGResourceSet ret = new SWGResourceSet(cache.size());
Class<? extends SWGResourceClass> c = type.getClass();
for (SWGKnownResource kr : cache) {
if (kr.galaxy() == galaxy && kr.rc().isSub(c))
if (kr.galaxy().equals(galaxy) && kr.rc().isSub(c))
ret.privateAdd(kr); // we are sure kr is valid
}
return ret.get();
Expand Down Expand Up @@ -347,7 +347,7 @@ private static SWGKnownResource contains(SWGResource res) {
return kr;
if (id > 0 && id == kr.id())
return kr;
if (gx == kr.galaxy() && name.equals(kr.getName()))
if (gx.equals(kr.galaxy()) && name.equals(kr.getName()))
return kr;
}
return null;
Expand Down
2 changes: 1 addition & 1 deletion swg/crafting/resources/SWGResourceList.java
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ public SWGResource getByNameAndGalaxy(String name, SWGCGalaxy galaxy) {
+ galaxy);

for (SWGResource r : storage)
if (r.galaxy() == galaxy && r.getName().equals(name))
if (r.galaxy().equals(galaxy) && r.getName().equals(name))
return r;

return null;
Expand Down
2 changes: 1 addition & 1 deletion swg/crafting/resources/SWGResourceMgr.java
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ else if (isTrusted)
// finally, if the former instance is --replaced-- at SWGCraft
if (isTrusted
&& known.getName().equals(other.getName())
&& known.galaxy() == other.galaxy()
&& known.galaxy().equals(other.galaxy())
&& other.id() > 0
&& known.id() < other.id()) {
// is-trusted: name and galaxy equals but known is older than other
Expand Down
2 changes: 1 addition & 1 deletion swg/crafting/resources/SWGResourceSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ public SWGKnownResource getBy(String name, SWGCGalaxy galaxy) {
+ galaxy);

for (SWGKnownResource kr : storage)
if (kr.galaxy() == galaxy && kr.getName().equals(name))
if (kr.galaxy().equals(galaxy) && kr.getName().equals(name))
return kr;

return null;
Expand Down
2 changes: 1 addition & 1 deletion swg/gui/resources/SWGCurrentTab.java
Original file line number Diff line number Diff line change
Expand Up @@ -2786,7 +2786,7 @@ private void updateCurrent() {
currentResourcesModel.fireTableDataChanged();

// retain the selection, if possible
if (sr != null && sr.galaxy() == SWGFrame.getSelectedGalaxy()) {
if (sr != null && sr.galaxy().equals(SWGFrame.getSelectedGalaxy())) {
selectedResource = sr;
SWGResourceSet cl = currentGet();
for (int i = 0; i < cl.size(); ++i) {
Expand Down
2 changes: 1 addition & 1 deletion swg/gui/resources/SWGInventoryDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -1134,7 +1134,7 @@ private boolean save() {
SWGKnownResource kr = wrap.getResource();
if (!kr.rc().isSpaceOrRecycled()) {
SWGCGalaxy gxy = getGalaxy();
if (kr.id() <= 0 && gxy != null && kr.galaxy() != gxy) {
if (kr.id() <= 0 && gxy != null && kr.galaxy().equals(gxy) == false) {
SWGMutableResource mr = new SWGMutableResource(kr);
mr.galaxy(gxy);
SWGResourceManager.updateInstance(kr, mr);
Expand Down
4 changes: 2 additions & 2 deletions swg/gui/resources/SWGInventoryTab.java
Original file line number Diff line number Diff line change
Expand Up @@ -2313,7 +2313,7 @@ private String notesShaveString(String string) {
*/
private void notesWrite(SWGInventoryWrapper w, ZString z) {
if (!w.getResource().rc().isSpaceOrRecycled()
&& w.getResource().galaxy() != recentGalaxy) {
&& w.getResource().galaxy().equals(recentGalaxy) == false) {
SWGCGalaxy g = w.getResource().galaxy();
z.app("(").app(g != null
? g.getName()
Expand Down Expand Up @@ -3119,7 +3119,7 @@ public Object getValueAt(int row, int col) {
return wrapper.getAssignee();
case 1: {
SWGCGalaxy g = kr.galaxy();
return g != recentGalaxy && g != null
return g.equals(recentGalaxy) == false && g != null
? String.format(gxyfmt, g.getName(), kr.getName())
: kr.getName();
}
Expand Down
2 changes: 1 addition & 1 deletion swg/gui/resources/SWGResController.java
Original file line number Diff line number Diff line change
Expand Up @@ -2082,7 +2082,7 @@ static SWGResourceClass resourceClassFrom(String rcName) {
*/
public static void resourceDetails(SWGKnownResource kr, ZString z) {
SWGCGalaxy gxy = SWGFrame.getSelectedGalaxy();
if (kr.galaxy() != gxy) z.app('(').app(gxy.getName()).app(')');
if (kr.galaxy().equals(gxy) == false) z.app('(').app(gxy.getName()).app(')');
z.appnl(kr.getName()).app(kr.rc().rcName());
z.app("\tAge: ").appnl( SWGResController.dateString(kr.age()));
kr.stats().toString(z, true);
Expand Down
2 changes: 1 addition & 1 deletion swg/gui/schematics/SWGTodays.java
Original file line number Diff line number Diff line change
Expand Up @@ -1095,7 +1095,7 @@ private String tripletDetails(Triplet tri) {
z.app("<tr><td>").app(FS);
z.app("<b>Inventory: </b></font></td><td>").app(FS);
SWGKnownResource kr = tri.inventory.getResource();
if (kr.galaxy() != SWGFrame.getSelectedGalaxy())
if (kr.galaxy().equals(SWGFrame.getSelectedGalaxy()) == false)
z.app('(').app(kr.galaxy().getName()).app(')');
z.app(kr.getName()).app(" --- ");
z.app(tri.inventory.getResource().rc().rcName());
Expand Down
4 changes: 2 additions & 2 deletions swg/model/mail/SWGISDroidReport.java
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public int compareTo(SWGISDroidReport o) {
*/
@SuppressWarnings("synthetic-access")
public List<Wrapper> depleted(SWGResourceSet inSpawn) {
if (!inSpawn.isEmpty() && inSpawn.get(0).galaxy() != gxy())
if (!inSpawn.isEmpty() && inSpawn.get(0).galaxy().equals(gxy()) == false)
throw new IllegalArgumentException("Wrong galaxy");

// reduce the collection -> planet -> resource class
Expand Down Expand Up @@ -486,7 +486,7 @@ public boolean equals(Object obj) {
if (obj instanceof Wrapper) {
Wrapper o = (Wrapper) obj;
return mutable.getName().equals(o.mutable.getName())
&& mutable.galaxy() == o.mutable.galaxy();
&& mutable.galaxy().equals(o.mutable.galaxy());
}
return false;
}
Expand Down
4 changes: 2 additions & 2 deletions swg/swgcraft/SWGResourceManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,7 @@ private static SWGKnownResource helperKnown(SWGMutableResource mr) {
updateInstance(kr, mr, true);
return kr;
}
if (kr.galaxy() == mr.galaxy())
if (kr.galaxy().equals(mr.galaxy()))
return kr;
else if (kr.isDepleted())
SWGResourceMgr.remove(kr); // remove from general map
Expand Down Expand Up @@ -1243,7 +1243,7 @@ public static SWGSoapStatusResponse sendNew(
// from SWGCraft.org
kr = getKnown(mr);

if (mr.galaxy() != kr.galaxy()) {
if (mr.galaxy().equals(kr.galaxy()) == false) {
// trust the caller to be sending for the proper galaxy
kr = getKnownTrusted(mr);
}
Expand Down

0 comments on commit ea92887

Please sign in to comment.