-
Notifications
You must be signed in to change notification settings - Fork 202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configured the code to work with Java 6 standards and using gradlew #1
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As above - we should generally refrain from submitting IDE specific files |
||
<module external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" external.system.module.group="AppInsights Java" external.system.module.version="unspecified" type="JAVA_MODULE" version="4"> | ||
<module external.linked.project.id=":Core" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" external.system.module.group="AppInsights Java" external.system.module.version="unspecified" type="JAVA_MODULE" version="4"> | ||
<component name="NewModuleRootManager" inherit-compiler-output="false"> | ||
<output url="file://$MODULE_DIR$/build/classes/main" /> | ||
<output-test url="file://$MODULE_DIR$/build/classes/test" /> | ||
|
@@ -14,13 +14,12 @@ | |
</content> | ||
<orderEntry type="inheritedJdk" /> | ||
<orderEntry type="sourceFolder" forTests="false" /> | ||
<orderEntry type="library" scope="TEST" name="Gradle: junit-4.11" level="project" /> | ||
<orderEntry type="library" scope="TEST" name="Gradle: hamcrest-core-1.3" level="project" /> | ||
<orderEntry type="library" exported="" name="Gradle: commons-lang3-3.3.2" level="project" /> | ||
<orderEntry type="library" exported="" name="Gradle: httpclient-4.3.5" level="project" /> | ||
<orderEntry type="library" exported="" name="Gradle: httpcore-4.3.2" level="project" /> | ||
<orderEntry type="library" exported="" name="Gradle: commons-logging-1.1.3" level="project" /> | ||
<orderEntry type="library" exported="" name="Gradle: commons-codec-1.6" level="project" /> | ||
<orderEntry type="library" exported="" name="Gradle: org.apache.commons:commons-lang3:3.3.2" level="project" /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess you might have done it already but please make sure that we're including the libraries required for our SDK |
||
<orderEntry type="library" exported="" name="Gradle: org.apache.httpcomponents:httpclient:4.3.5" level="project" /> | ||
<orderEntry type="library" exported="" name="Gradle: org.apache.httpcomponents:httpcore:4.3.2" level="project" /> | ||
<orderEntry type="library" exported="" name="Gradle: commons-logging:commons-logging:1.1.3" level="project" /> | ||
<orderEntry type="library" exported="" name="Gradle: commons-codec:commons-codec:1.6" level="project" /> | ||
<orderEntry type="library" scope="TEST" name="Gradle: junit:junit:4.11" level="project" /> | ||
<orderEntry type="library" scope="TEST" name="Gradle: org.hamcrest:hamcrest-core:1.3" level="project" /> | ||
</component> | ||
</module> | ||
|
||
</module> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,15 +50,31 @@ public void send(Telemetry item) | |
|
||
CloseableHttpClient httpClient = HttpClients.createDefault(); | ||
|
||
try (CloseableHttpResponse response = httpClient.execute(request)) | ||
CloseableHttpResponse response = null; | ||
try | ||
{ | ||
response = httpClient.execute(request); | ||
HttpEntity respEntity = response.getEntity(); | ||
if (respEntity != null) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please check whether the common practices for single statement block is to add curly parentheses or not There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sure, my guess is that opening should be on the line and not in a new line There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Until we decide i did what is done in the project to make sure there is unification There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually I was referring to using a one-line statements inside the 'if' statement vs. using a statement block using curly parentheses |
||
respEntity.getContent().close(); | ||
|
||
if (developerMode) System.out.println("Status: " + response.getStatusLine()); | ||
} | ||
|
||
catch (IOException ioe) | ||
{ | ||
ioe.printStackTrace(System.err); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not so sure that an SDK should print anything to System.err. |
||
try | ||
{ | ||
if (response != null) | ||
{ | ||
response.close(); | ||
} | ||
} | ||
catch (IOException ioeIn) | ||
{ | ||
ioeIn.printStackTrace(System.err); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As above regarding printing to System.err There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a version that aligns with SE 6 We will need to tackle that issue in the near future. But for now I think it is out of scope |
||
} | ||
} | ||
} | ||
catch (IOException ioe) | ||
{ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
apply plugin: 'java' | ||
|
||
jar { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually our repo should not include IDE specific files to allow anyone use their own tool of choice
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure about it. C# has the .sln file.
If we go with Intellij then we need to share a few files
please read: #1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.Net sln files are used to list the projects to build.
However, as in this project we're using build.gradle as long as IntelliJ knows how to import the project from then I'm not sure that these files are really needed