Skip to content

Commit

Permalink
teiiddes-2477: Cleaned up if statement in WSConnectionInfoProvider as
Browse files Browse the repository at this point in the history
well as other places.
  • Loading branch information
tejones authored and blafond committed Apr 7, 2015
1 parent f9f828b commit 76d3280
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package org.teiid.designer.datatools.profiles.ws;

import java.util.Properties;

import org.eclipse.datatools.connectivity.IConnectionProfile;
import org.teiid.core.designer.util.StringUtilities;
import org.teiid.designer.core.ModelerCore;
import org.teiid.designer.core.workspace.ModelResource;
import org.teiid.designer.core.workspace.ModelWorkspaceException;
Expand Down Expand Up @@ -34,7 +36,7 @@ public void setConnectionInfo(ModelResource modelResource,
}

String user = props.getProperty(ICredentialsCommon.USERNAME_PROP_ID);
if (null != user && user.isEmpty()) {
if (null != user && !user.isEmpty()) {
connectionProps.setProperty(CONNECTION_NAMESPACE + ICredentialsCommon.USERNAME_PROP_ID, user);
}

Expand Down Expand Up @@ -87,9 +89,9 @@ public Properties getTeiidRelatedProperties(
connectionProps.setProperty(IWSProfileConstants.END_POINT_URI_PROP_ID, url);
}

String securityType = props.getProperty(ICredentialsCommon.SECURITY_TYPE_ID);
if (null != securityType &! securityType.equals("")) {
connectionProps.setProperty(ICredentialsCommon.SECURITY_TYPE_ID, securityType);
String contextFactory = props.getProperty(ICredentialsCommon.SECURITY_TYPE_ID);
if (null != contextFactory && !contextFactory.isEmpty()) {
connectionProps.setProperty(ICredentialsCommon.SECURITY_TYPE_ID, contextFactory);
}
else {
connectionProps.setProperty(ICredentialsCommon.SECURITY_TYPE_ID,
Expand All @@ -98,7 +100,7 @@ public Properties getTeiidRelatedProperties(

if (!connectionProps.getProperty(ICredentialsCommon.SECURITY_TYPE_ID).equals(SecurityType.None.name())){
String user = props.getProperty(ICredentialsCommon.USERNAME_PROP_ID);
if (null != user &! user.equals("")) { //$NON-NLS-1$
if (null != user && !user.equals(StringUtilities.EMPTY_STRING)) {
connectionProps.setProperty(ICredentialsCommon.USERNAME_PROP_ID, user);
}
}
Expand All @@ -111,8 +113,8 @@ public Properties getTeiidRelatedProperties(
public boolean requiresPassword(IConnectionProfile connectionProfile) {
Properties props = connectionProfile.getBaseProperties();

String securityType = props.getProperty(ICredentialsCommon.SECURITY_TYPE_ID);
if( securityType != null &! securityType.equals("") &! securityType.equalsIgnoreCase(IWSProfileConstants.SecurityType.None.name()) ) {
String contextFactory = props.getProperty(ICredentialsCommon.SECURITY_TYPE_ID);
if( null != contextFactory && !contextFactory.isEmpty() && !contextFactory.equalsIgnoreCase(IWSProfileConstants.SecurityType.None.name()) ) {
props.remove(ICredentialsCommon.USERNAME_PROP_ID);
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ private void determineEnablement() {
// }
// }
// } else {
if( modelResource != null &&! modelResource.isReadOnly() ) {
if( modelResource != null && !modelResource.isReadOnly() ) {
setEnabled(true);
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,11 @@ private void updateDesignerProperties() {
*/
@Override
public void stateChanged(IChangeNotifier theSource) {
refreshing = true;

refreshUiFromManager();

refreshing = false;
}

public void notifyChanged() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ protected ModelResource createViewsInExistingModel(String relationalModelName) t

for( TeiidXmlFileInfo info : this.getInfo().getXmlFileInfos()) {
if( info.doProcess() ) {
if (info.getViewProcedureName() != null &! info.getViewProcedureName().equals(StringConstants.EMPTY_STRING)) {
if (info.getViewProcedureName() != null && !info.getViewProcedureName().equals(StringConstants.EMPTY_STRING)) {
factory.createViewProcedure(editor.getModelResource(), info, relationalModelName);
}else{
factory.createViewTable(editor.getModelResource(), info, relationalModelName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ private String getHeaderString() {
headerString.append(SPACE).append(XMLNAMESPACES).append(L_PAREN).append(S_QUOTE).append(ENVELOPE_NS).append(S_QUOTE).append(SPACE).append(AS).append(SPACE);
headerString.append(ENVELOPE_NS_ALIAS);

if (requestInfo.getNamespaceMap().size()>0 || (getWrapperProcedure().getNamespaceURI() != null &! getWrapperProcedure().getNamespaceURI().isEmpty())){
if (requestInfo.getNamespaceMap().size()>0 || (getWrapperProcedure().getNamespaceURI() != null && !getWrapperProcedure().getNamespaceURI().isEmpty())){

String prefix=requestInfo.getReverseNSMap().get(getWrapperProcedure().getNamespaceURI());
if (isDefaultNS(prefix)) {
Expand Down Expand Up @@ -267,7 +267,7 @@ public String getSQLStatement() {
}
String nsString = nsMap.get(NSSTRING);
String nsPrefix = nsMap.get(NSPREFIX);
if (nsPrefix!=null &! isDefaultNS(nsPrefix)){
if (nsPrefix!=null && !isDefaultNS(nsPrefix)){
sb.append("\""+nsPrefix+":"+elementName+"\"").append(COMMA).append(SPACE); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}else{
sb.append(convertSqlNameSegment(elementName)).append(COMMA).append(SPACE);
Expand Down

0 comments on commit 76d3280

Please sign in to comment.