Vivek-12 / google-enterprise-connector-sharepoint

Automatically exported from code.google.com/p/google-enterprise-connector-sharepoint
0 stars 0 forks source link

SharepointClientContext parameter in the constructor of GSSiteDiscoveryWS is unused #188

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I am evaluating the Google sharepoint-connector version 3.2.2. I was browsing 
through the source code and observed that most of the Java clients for the 
various web services for e.g. GSSiteDiscoveryWS or SPSiteDataWS take in the 
SharepointClientContext as a constructor parameter.

I however observed that the GSSiteDiscoveryWS also takes in the siteURL as a 
parameter. Hence the constructor is:

GSSiteDiscoveryWS(SharepointClientContext ctx, String siteURL).

Then on line 56 within the file GSSiteDiscovery.java the endpoint is created 
using the siteURL. This way the SharepointClientContext parameter is rendered 
useless. In fact, I am not seeing it assigned to any class member variable.

It is fair to expect that the SharepointClientContext be the sole source of 
truth while creating a web service stub. After all, the SharepointClientContext 
contains all the information related to the Sharepoint server URL, username 
password and other necessary contextual parameters. Providing constructors of 
the type present within GSSiteDiscoveryWS result in confusion to developers and 
is not a good design practice.

I am using version 3.2.2 of the sharepoint-connector

Original issue reported on code.google.com by prahal...@gmail.com on 18 Mar 2014 at 5:59