Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ public boolean equals(Object obj) {
@Override
public int hashCode() {
int hash = 7;
hash = 17 * hash + this.xmlText != null ? this.xmlText.hashCode() : 0;
hash = 17 * hash + this.displayText != null ? this.displayText.hashCode() : 0;
hash = 17 * hash + (this.xmlText != null ? this.xmlText.hashCode() : 0);
hash = 17 * hash + (this.displayText != null ? this.displayText.hashCode() : 0);
return hash;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public File getDirectoryForNewApplication (Target target, J2eeModule module, Mod
return f;
}*/
}
throw new IllegalArgumentException ("ModuleType:" + module == null ? null : module.getModuleType() + " Configuration:"+configuration); //NOI18N
throw new IllegalArgumentException("ModuleType:" + (module == null ? null : module.getModuleType()) + " Configuration:" + configuration); //NOI18N
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ private void editingCancelled() {

@Override
public String toString() {
return getClass().getSimpleName() + "; property: " + pmodel != null ? pmodel.getName() : "?"; //NOI18N
return getClass().getSimpleName() + "; property: " + (pmodel != null ? pmodel.getName() : "?"); //NOI18N
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1918,7 +1918,7 @@ private void upgrade() {

public @Override String toString() {
return "ReferenceHelper.RawReference<" + foreignProjectName + "," +
artifactType + "," + newScriptLocation != null ? newScriptLocation : scriptLocation +
artifactType + "," + (newScriptLocation != null ? newScriptLocation : scriptLocation) +
"," + targetName + "," + cleanTargetName + "," + artifactID + ">"; // NOI18N
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public static Test suite() {

public int findUsageCountForItem(NamedReferenceable<SchemaComponent> ref) {
long startTime = System.currentTimeMillis();
System.out.println("Finding Usage for " + ref.getName() == null? ref : ref.getName());
System.out.println("Finding Usage for " + (ref.getName() == null ? ref : ref.getName()));
FindUsageVisitor usage = new FindUsageVisitor();
Preview preview = usage.findUsages(Collections.singletonList(schema), ref);
System.out.println(preview.getUsages().size() + " occurances found!!!");
Expand Down
16 changes: 10 additions & 6 deletions java/java.platform/src/org/netbeans/api/java/platform/Profile.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,16 @@
*/
package org.netbeans.api.java.platform;

import java.util.Objects;
import org.openide.modules.SpecificationVersion;

/**
* Represents profile installed in the Java SDK
*/
public class Profile {

private String name;
private SpecificationVersion version;
private final String name;
private final SpecificationVersion version;

/**
* Creates new Profile
Expand Down Expand Up @@ -55,7 +56,8 @@ public final SpecificationVersion getVersion () {
}


public int hashCode () {
@Override
public int hashCode() {
int hc = 0;
if (name != null)
hc = name.hashCode() << 16;
Expand All @@ -64,7 +66,8 @@ public int hashCode () {
return hc;
}

public boolean equals (Object other) {
@Override
public boolean equals(Object other) {
if (other instanceof Profile) {
Profile op = (Profile) other;
return this.name == null ? op.name == null : this.name.equals(op.name) &&
Expand All @@ -74,10 +77,11 @@ public boolean equals (Object other) {
return false;
}

public String toString () {
@Override
public String toString() {
String str;
str = this.name == null ? "" : this.name;
str += " " + this.version == null ? "" : this.version.toString(); // NOI18N
str += " " + Objects.toString(this.version, ""); // NOI18N
return str;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,12 @@ public Void visitThrows(ThrowsTree tree, List<ErrorDescription> errors) {
final TypeElement errorEl = elements.getTypeElement("java.lang.Error");
final TypeElement runtimeEl = elements.getTypeElement("java.lang.RuntimeException");
if(throwableEl == null || errorEl == null || runtimeEl == null) {
LOG.warning("Broken java-platform, cannot resolve " + throwableEl == null? "java.lang.Throwable" : errorEl == null? "java.lang.Error" : "java.lang.RuntimeException"); //NOI18N
LOG.log(Level.WARNING, "Broken java-platform, cannot resolve {0}",
throwableEl == null
? "java.lang.Throwable"
: errorEl == null
? "java.lang.Error"
: "java.lang.RuntimeException");
return null;
}
TypeMirror throwable = throwableEl.asType();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public void accept(Visitor visitor) {
public String toString() {
StringBuilder sbAttributes = new StringBuilder();
getAttributes().forEach(attribute -> sbAttributes.append(attribute).append(" ")); // NOI18N
return sbAttributes.toString() + "case" + name + initializer == null ? "" : " = " + initializer; // NOI18N
return sbAttributes.toString() + "case" + name + (initializer == null ? "" : " = " + initializer); // NOI18N
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,6 @@ public String toString() {
for (Expression expression : getInterfaces()) {
sb.append(expression).append(","); // NOI18N
}
return sbAttributes.toString() + "enum " + getName() + backingType == null ? "" : ": " + backingType + " implements " + sb + getBody(); // NOI18N
return sbAttributes.toString() + "enum " + getName() + (backingType == null ? "" : ": " + backingType) + " implements " + sb + getBody(); // NOI18N
}
}