Skip to content

Commit

Permalink
Add a separate import group for jakarta imports
Browse files Browse the repository at this point in the history
Closes gh-289
  • Loading branch information
philwebb committed Sep 29, 2021
1 parent 8e6be0f commit 3076583
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ formatter_settings_version=13
org.eclipse.jdt.ui.exception.name=e
org.eclipse.jdt.ui.gettersetter.use.is=true
org.eclipse.jdt.ui.ignorelowercasenames=true
org.eclipse.jdt.ui.importorder=java;javax;;org.springframework;\#;
org.eclipse.jdt.ui.importorder=java;javax;jakarta;;org.springframework;\#;
org.eclipse.jdt.ui.javadoc=true
org.eclipse.jdt.ui.keywordthis=false
org.eclipse.jdt.ui.ondemandthreshold=9999
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public SpringImportOrderCheck() {
}

public void setProjectRootPackage(String projectRootPackage) {
setGroups("java", "/^javax?\\./", "*", projectRootPackage);
setGroups("java", "/^javax?\\./", "/^jakarta?\\./", "*", projectRootPackage);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
+0 errors
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* Copyright 2017-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.example;

import java.util.Objects;

import javax.annotation.Nonnull;

import jakarta.servlet.Servlet;

/**
* Custom pacakge with valid imports.
*
* @author Phillip Webb
*/
public final class ImportOrderValid {

private ImportOrderValid() {
}

@Nonnull
public static void main(String[] args) {
Objects.nonNull(null);
Servlet s = null;
}

}

0 comments on commit 3076583

Please sign in to comment.