Skip to content

Commit

Permalink
Merge pull request #445 from tejones/teiiddes-2477
Browse files Browse the repository at this point in the history
teiiddes-2477
  • Loading branch information
blafond committed Apr 7, 2015
2 parents a0fc54c + 4d3a7aa commit 8314699
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 8 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 @@ -88,7 +90,7 @@ public Properties getTeiidRelatedProperties(
}

String contextFactory = props.getProperty(ICredentialsCommon.SECURITY_TYPE_ID);
if (null != contextFactory &! contextFactory.isEmpty()) {
if (null != contextFactory && !contextFactory.isEmpty()) {
connectionProps.setProperty(ICredentialsCommon.SECURITY_TYPE_ID, contextFactory);
}
else {
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 @@ -112,7 +114,7 @@ public boolean requiresPassword(IConnectionProfile connectionProfile) {
Properties props = connectionProfile.getBaseProperties();

String contextFactory = props.getProperty(ICredentialsCommon.SECURITY_TYPE_ID);
if( contextFactory != null &! contextFactory.isEmpty() && !contextFactory.equalsIgnoreCase(IWSProfileConstants.SecurityType.None.name()) ) {
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 8314699

Please sign in to comment.