Skip to content
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

Refactor/#1434 Remove the useless curly braces #1472

Conversation

Taaaaaserface
Copy link
Contributor

I remove the useless curly braces around the statement to make the code more readability and easy to read for developers

@ukp-svc-jenkins
Copy link

Can one of the admins verify this patch?

@Taaaaaserface
Copy link
Contributor Author

There are some other changes except removing useless curly braces
in:
inception-ui-kb/src/main/java/de/tudarmstadt/ukp/inception/ui/kb/project/AccessSpecificSettingsPanel.java
from line 185:

IModel adapter = new LambdaModelAdapter(() -> {
return model.getObject() != null ? model.getObject().stringValue() : null;
}, str ->

I should remove both useless curly braces and delete the semicolon and return like this

IModel adapter = new LambdaModelAdapter(() ->
model.getObject() != null ? model.getObject().stringValue() : null
, str ->

Can the return be removed here?

@reckart
Copy link
Member

reckart commented Oct 21, 2019

The curlies might be a "hack" to let the Eclipse formatter format the code in a way compatible with the checkstyle rules - or to make the code "more readable" my making more explicit that there ware actually two embedded code blocks in the LamdaModelAdapter constructor ... but general, I don't see why they would be necessary.

@munterkalmsteiner
Copy link
Contributor

Can the return be removed here?
@Taaaaaserface, yes (see Section 8.4). Do you get compilation errors otherwise?

@Taaaaaserface
Copy link
Contributor Author

Can the return be removed here?
@Taaaaaserface, yes (see Section 8.4). Do you get compilation errors otherwise?

There is no compilation errors after modifing.

@munterkalmsteiner munterkalmsteiner self-requested a review October 25, 2019 15:56
Copy link
Contributor

@munterkalmsteiner munterkalmsteiner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! @reckart what do you think?

@reckart
Copy link
Member

reckart commented Oct 25, 2019

Jenkins, can you test this please?

@reckart
Copy link
Member

reckart commented Oct 25, 2019

Looks good - let's see what Jenkins thinks.

@reckart
Copy link
Member

reckart commented Oct 27, 2019

Jenkins, can you test this please?

@reckart
Copy link
Member

reckart commented Oct 28, 2019

Jenkins, can you test this please?

@reckart
Copy link
Member

reckart commented Oct 31, 2019

Jenkins complains about more checkstyle issues - now unused imports in the "Task" class.

Please do run mvn clean install on the command line - it should generate the same checkstyle issues that Jenkins is reporting.

@munterkalmsteiner
Copy link
Contributor

@Taaaaaserface please check reckart's comment.

@Taaaaaserface
Copy link
Contributor Author

Jenkins complains about more checkstyle issues - now unused imports in the "Task" class.

Please do run mvn clean install on the command line - it should generate the same checkstyle issues that Jenkins is reporting.

Is this means I should delete all the imports as following:
import static org.apache.commons.lang3.Validate.notNull;
import org.apache.uima.cas.CAS;
import de.tudarmstadt.ukp.clarin.webanno.model.AnnotationDocument;
import de.tudarmstadt.ukp.clarin.webanno.model.Project;
import de.tudarmstadt.ukp.clarin.webanno.model.SourceDocument;
in Task.java class and run mvn clean install on the command line?
*By the way, can I ask where is the commend line in eclipse?Is that means in git bash?

@reckart
Copy link
Member

reckart commented Nov 5, 2019

Sounds like you might be on Windows. In that case, best look how to install Maven on Windows so that you can use it from the command line. This article might help.

@reckart
Copy link
Member

reckart commented Nov 5, 2019

Removing unused imports in Eclipse is usually a matter of using the "Organize imports" functionality of Eclipse. Do not apply this to all files - only to files which you actually modified.

@Taaaaaserface
Copy link
Contributor Author

Removing unused imports in Eclipse is usually a matter of using the "Organize imports" functionality of Eclipse. Do not apply this to all files - only to files which you actually modified.

I ran mvn clean install on the command line and it reported error like this
image
then I turn to Task.java and used the "Organize imports" functionality of Eclipse, but seems nothing happend. what should I do?
Should I do like this:

  1. delete all imports in Task.java and use "Organize imports" functionality (ctrl+shift+o)
  2. Then choose type to import which are
    image
  3. After importing either two type the mvn clean install comment is still wrong.

I wanna ask where my order is wrong and what should be the correct order.

@reckart
Copy link
Member

reckart commented Nov 6, 2019

Looks like your system cannot execute the tests - maybe because it doesn't have enough memory. Try mvn -DskipTests clean install.

@Taaaaaserface
Copy link
Contributor Author

Looks like your system cannot execute the tests - maybe because it doesn't have enough memory. Try mvn -DskipTests clean install.

Is this the same question?
image

jcklie pushed a commit that referenced this pull request Feb 2, 2021
- uimaFIT 3.0.0 -> 3.1.0
- Tomcat 9.0.34 -> 9.0.35
jcklie pushed a commit that referenced this pull request Feb 2, 2021
* master: (36 commits)
  #1472 - Upgrade dependencies (4.0.0)
  #1694 - Improve annotation detail sidebar architecture and performance
  #1694 - Improve annotation detail sidebar architecture and performance
  #1694 - Improve annotation detail sidebar architecture and performance
  #1694 - Improve annotation detail sidebar architecture and performance
  #1694 - Improve annotation detail sidebar architecture and performance
  #1694 - Improve annotation detail sidebar architecture and performance
  #1694 - Improve annotation detail sidebar architecture and performance
  #1694 - Improve annotation detail sidebar architecture and performance
  #1694 - Improve annotation detail sidebar architecture and performance
  #1694 - Improve annotation detail sidebar architecture and performance
  #1694 - Improve annotation detail sidebar architecture and performance
  #1694 - Improve annotation detail sidebar architecture and performance
  #1694 - Improve annotation detail sidebar architecture and performance
  #1694 - Improve annotation detail sidebar architecture and performance
  #1694 - Improve annotation detail sidebar architecture and performance
  #1694 - Improve annotation detail sidebar architecture and performance
  #1694 - Improve annotation detail sidebar architecture and performance
  #1694 - Improve annotation detail sidebar architecture and performance
  #1694 - Improve annotation detail sidebar architecture and performance
  ...

% Conflicts:
%	webanno-api-dao/src/main/java/de/tudarmstadt/ukp/clarin/webanno/api/dao/AnnotationSchemaServiceImpl.java
jcklie pushed a commit that referenced this pull request Feb 2, 2021
jcklie pushed a commit that referenced this pull request Feb 2, 2021
- Spring Boot 2.2.6 -> 2.3.0
- Spring Security 5.2.3 -> 5.3.3
jcklie pushed a commit that referenced this pull request Feb 2, 2021
- Spring Boot 2.3.0 -> 2.3.1
- Spring 5.2.6 -> 5.2.7
jcklie pushed a commit that referenced this pull request Feb 2, 2021
- Dom4J 2.1.1 -> 2.1.3
jcklie pushed a commit that referenced this pull request Feb 2, 2021
- Spring Boot 2.2.6 -> 2.3.0
- Spring Security 5.2.3 -> 5.3.3
jcklie pushed a commit that referenced this pull request Feb 2, 2021
jcklie pushed a commit that referenced this pull request Feb 2, 2021
- Spring Boot 2.3.0 -> 2.3.1
- Spring 5.2.6 -> 5.2.7
jcklie pushed a commit that referenced this pull request Feb 2, 2021
- mysql-driver 8.0.15 -> 8.0.20
jcklie pushed a commit that referenced this pull request Feb 2, 2021
jcklie pushed a commit that referenced this pull request Feb 2, 2021
- commons-csv 1.7 -> 1.8
- commons-beanutils 1.9.3 -> 1.9.4
jcklie pushed a commit that referenced this pull request Feb 2, 2021
jcklie pushed a commit that referenced this pull request Feb 2, 2021
* commit '608c37c619cb677952908154d813f61ac2b34a1e':
  [maven-release-plugin] prepare for next development iteration
  [maven-release-plugin] prepare release webanno-4.0.0-beta-14
  Bump spring.security.version from 5.2.3.RELEASE to 5.3.3.RELEASE
  #1472 - Upgrade dependencies (4.0.0)
  #1472 - Upgrade dependencies (4.0.0)
  #1472 - Upgrade dependencies (4.0.0)
  #1707 - Layout for relations not having a label is broken
  #1712 Auto logout not succeeding

% Conflicts:
%	pom.xml
jcklie pushed a commit that referenced this pull request Feb 2, 2021
- dkpro-statistics-agreement 2.2.0 -> 2.2.1
jcklie pushed a commit that referenced this pull request Feb 2, 2021
- Mockito 3.3.3 -> 3.6.0
- AssertJ 3.15.0 -> 3.18.1
- Spring 5.2.7 -> 5.3.1
- Spring Boot 2.3.4 -> 2.4.0
- Wicket 9.1.0 -> 9.2.0
- Wicketstuff 9.1.0 -> 9.2.0
- Wicket JQuery 9.0.0 -> 9.1.0
jcklie pushed a commit that referenced this pull request Feb 2, 2021
jcklie pushed a commit that referenced this pull request Feb 2, 2021
* master:
  #1811 - Webanno does not boot in Intellij due to javax errors
  #1811 - Webanno does not boot in Intellij due to javax errors
  #1811 - Webanno does not boot in Intellij due to javax errors
  #1811 - Webanno does not boot in Intellij due to javax errors
  #1811 - Webanno does not boot in Intellij due to javax errors
  #1811 - Webanno does not boot in Intellij due to javax errors
  #1472 - Upgrade dependencies

% Conflicts:
%	webanno-webapp/src/main/java/de/tudarmstadt/ukp/clarin/webanno/webapp/WebAnno.java
jcklie pushed a commit that referenced this pull request Feb 2, 2021
- Wicket 8.8.0 -> 8.11.0
- Wicketstuff 8.8.0 -> 8.11.0
- Wicket JQuery 8.8.0 -> 8.10.0
jcklie pushed a commit that referenced this pull request Feb 2, 2021
* commit 'ae4e61460e5058eac135bbaecbed087ea0d13194':
  #1472 - Upgrade dependencies (4.0.0)
  #1835 - Use server-side timing API to display server times in browser profiling tab
  #1834 - Fetch built-in type system only once

% Conflicts:
%	pom.xml
%	webanno-api-dao/src/main/java/de/tudarmstadt/ukp/clarin/webanno/api/dao/AnnotationSchemaServiceImpl.java
%	webanno-brat/src/main/java/de/tudarmstadt/ukp/clarin/webanno/brat/annotation/BratAnnotationEditor.java
%	webanno-ui-core/src/main/java/de/tudarmstadt/ukp/clarin/webanno/ui/core/WicketApplicationBase.java
jcklie pushed a commit that referenced this pull request Feb 2, 2021
- Spring 5.3.1 -> 5.3.2
- Spring Boot 2.4.0 -> 2.4.1
jcklie pushed a commit that referenced this pull request Feb 2, 2021
jcklie pushed a commit that referenced this pull request Feb 2, 2021
- Spring Boot 2.4.0 -> 2.4.1
jcklie pushed a commit that referenced this pull request Feb 2, 2021
…o-TSV-format-master

* master: (637 commits)
  No issue. Fix typo in class names.
  No issue. Fix typo in class names.
  #1851 - Update copyright/license headers
  [maven-release-plugin] prepare for next development iteration
  [maven-release-plugin] prepare release webanno-4.0.0-beta-20
  #1187 - Make possible to delete entire layers
  #1187 - Make possible to delete entire layers
  #1847 - Detect Docker
  #1847 - Detect Docker
  #1843 - Ready entities for 2nd-level cache support
  #1843 - Ready entities for 2nd-level cache support
  #1845 - Move brat-specific settings to brat module
  #1847 - Detect Docker
  #1845 - Move brat-specific settings to brat module
  #1843 - Ready entities for 2nd-level cache support
  #1842 - Using the "jump to annotation" does not work when viewing other user
  #1472 - Upgrade dependencies (4.0.0)
  Revert "#1472 - Upgrade dependencies (4.0.0)"
  #1841 - Rendering error with zero-width characters
  #1841 - Rendering error with zero-width characters
  ...

% Conflicts:
%	webanno-io-tsv/src/main/java/de/tudarmstadt/ukp/clarin/webanno/tsv/internal/tsv3x/Escaping.java
%	webanno-io-tsv/src/main/java/de/tudarmstadt/ukp/clarin/webanno/tsv/internal/tsv3x/Tsv3XDeserializer.java
%	webanno-io-tsv/src/main/java/de/tudarmstadt/ukp/clarin/webanno/tsv/internal/tsv3x/model/TsvFormatHeader.java
%	webanno-io-tsv/src/main/resources/META-INF/asciidoc/user-guide/webannotsv.adoc
%	webanno-io-tsv/src/test/java/de/tudarmstadt/ukp/clarin/webanno/tsv/WebAnnoTsv3WriterTest.java
jcklie pushed a commit that referenced this pull request Feb 2, 2021
- Wicket JQuery 9.1.0 -> 9.2.0
jcklie pushed a commit that referenced this pull request Feb 2, 2021
- Mockito 3.6.0 -> 3.7.0
- Spring 5.3.1 -> 5.3.3
- Spring Boot 2.4.1 -> 2.4.2
- Spring Security 5.4.1 -> 5.4.2
- Wicket JQuery Selectors 3.0.1 -> 3.0.2
- Wicket Webjars 3.0.1 -> 3.0.2
- Bootstrap 4.5.2 -> 4.5.3
- Log4J 2.13.2 -> 2.14.0
- Jackson 2.11.0 -> 2.12.1
- Tomcat 9.0.35 ->  9.0.41
jcklie pushed a commit that referenced this pull request Feb 2, 2021
- DKPro Parent POM 24 -> 25
- DKPro Core 2.1.0 -> 2.2.0
jcklie pushed a commit that referenced this pull request Feb 2, 2021
- Fix antrun invocation
- Fix creation of parent directories when installing Eclipse style configuration
reckart added a commit that referenced this pull request Feb 4, 2021
* master: (267 commits)
  No issue. If a feature structure does not actually have a particular feature while trying to fetch the feature value (maybe the CAS has not been upgraded yet), return the null value.
  No issue. Demote non-critical issue from error to warning.
  No issue. Added missing dependency.
  #1828  - A simple import of already tokenized text to which no further tokenization is applied
  #1828  - A simple import of already tokenized text to which no further tokenization is applied
  No issue. Avoid throwing exceptions if no authentication information is available.
  No issue. Shorten commit ID in UI
  #1863 - NPE on login page
  #1862 - Creating Project with no permission
  #1860 Redirect to previous url after login does not work
  #1472 - Upgrade dependencies (4.0.0)
  #1472 - Upgrade dependencies (4.0.0)
  #1855 - Improve ordering in auto-complete string feature editor
  #1858 - Deleting very large constraints may not work
  #1472 - Upgrade dependencies
  #1581 - Wicket Ajax error when refreshing settings-page
  #1581 - Wicket Ajax error when refreshing settings-page
  #1855 - Improve ordering in auto-complete string feature editor
  #1847 - Detect Docker
  #1855 - Improve ordering in auto-complete string feature editor
  ...

% Conflicts:
%	webanno-api-annotation/src/main/java/de/tudarmstadt/ukp/clarin/webanno/api/annotation/rendering/ChainRenderer.java
%	webanno-api-annotation/src/main/java/de/tudarmstadt/ukp/clarin/webanno/api/annotation/rendering/RelationRenderer.java
%	webanno-api-annotation/src/main/java/de/tudarmstadt/ukp/clarin/webanno/api/annotation/rendering/Renderer.java
%	webanno-api-annotation/src/main/java/de/tudarmstadt/ukp/clarin/webanno/api/annotation/rendering/SpanRenderer.java
%	webanno-api-annotation/src/main/java/de/tudarmstadt/ukp/clarin/webanno/api/annotation/rendering/model/VObject.java
%	webanno-api-annotation/src/main/java/de/tudarmstadt/ukp/clarin/webanno/api/annotation/rendering/model/VSpan.java
%	webanno-api-annotation/src/main/java/de/tudarmstadt/ukp/clarin/webanno/api/annotation/util/TypeUtil.java
%	webanno-brat/src/main/java/de/tudarmstadt/ukp/clarin/webanno/brat/annotation/BratAnnotationEditor.java
%	webanno-brat/src/main/java/de/tudarmstadt/ukp/clarin/webanno/brat/render/BratRenderer.java
%	webanno-brat/src/main/java/de/tudarmstadt/ukp/clarin/webanno/brat/render/model/Entity.java
%	webanno-brat/src/test/java/de/tudarmstadt/ukp/clarin/webanno/brat/display/model/EntityTest.java
reckart added a commit to waleedabdeen/inception that referenced this pull request Feb 6, 2021
…ecting-recommendations

* master: (82 commits)
  [maven-release-plugin] prepare for next development iteration
  [maven-release-plugin] prepare release webanno-4.0.0-beta-19
  inception-project#1472 - Upgrade dependencies (4.0.0)
  inception-project#1835 - Use server-side timing API to display server times in browser profiling tab
  inception-project#1834 - Fetch built-in type system only once
  No issue. Added method to get the data folder for a project.
  inception-project#1831 - When many tags exist the annotations are not saved
  inception-project#1826 Update Java JDK in Admin Guide
  No issue. Changed order of items in enum.
  No issue: Add sort markers back to the tables.
  inception-project#1824 - Update Java version in docker file
  inception-project#1824 - Update Java version in docker file
  No issue: Fix problem when reloading the browser while viewing another users annotations who has just made a change to their annotations.
  inception-project#1822 Annotation disabled for curator - update doc state for curation user as well - check for curation in editable
  [maven-release-plugin] prepare for next development iteration
  [maven-release-plugin] prepare release webanno-4.0.0-beta-18
  inception-project#1814 - Format code
  No issue: Fix version
  No issue: Set version back to 4.0.0-SNAPSHOT
  No issue: Set version back to 4.0.0-SNAPSHOT
  ...

% Conflicts:
%	webanno-api-annotation/src/main/java/de/tudarmstadt/ukp/clarin/webanno/api/annotation/rendering/model/VObject.java
%	webanno-brat/src/main/java/de/tudarmstadt/ukp/clarin/webanno/brat/render/BratRenderer.java
%	webanno-brat/src/main/java/de/tudarmstadt/ukp/clarin/webanno/brat/render/model/EntityAttributes.java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants