mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
class Test {
|
||||
void m(int[] array) {
|
||||
for (int i = 1; i < array.length; <caret>i++) { }
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
class ListA<Ta> {
|
||||
public <R extends Ta> Ta foo() { throw new Error(); }
|
||||
}
|
||||
|
||||
class ListB<Tb> extends ListA<Tb> {
|
||||
public <Rb extends Tb> Rb foo() { throw new Error(); }
|
||||
}
|
||||
|
||||
class ListC<Tc> extends ListB<Tc> {
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
class A {
|
||||
{
|
||||
Runnable r = Syst::setOu<caret>
|
||||
}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
class A {
|
||||
{
|
||||
Runnable r = System::setOut;<caret>
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
|
||||
abstract class Bug {
|
||||
{
|
||||
D<?> _m = m();
|
||||
}
|
||||
|
||||
abstract <J extends C<? extends String>> J m();
|
||||
}
|
||||
|
||||
abstract class C<T extends String> { }
|
||||
abstract class D<T extends String> extends C<T> { }
|
||||
+24
@@ -81,3 +81,27 @@ class InsideThisRxpression {
|
||||
public interface Bar extends Foo {}
|
||||
}
|
||||
|
||||
class SameDefaultMethodDifferentInheritors {
|
||||
interface A { default void a() {} }
|
||||
interface B extends A { default void a() {} }
|
||||
interface B1 extends A { }
|
||||
interface C extends A {}
|
||||
|
||||
class Clazz implements B, C {
|
||||
{
|
||||
<error descr="Bad type qualifier in default super call: method a is overridden in SameDefaultMethodDifferentInheritors.B">C</error>.super.a();
|
||||
}
|
||||
}
|
||||
|
||||
class Clazz1 implements B1, C {
|
||||
{
|
||||
C.super.a();
|
||||
}
|
||||
}
|
||||
|
||||
class Clazz2 implements C {
|
||||
{
|
||||
C.super.a();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// "Assign Parameter to Field 'myA'" "false"
|
||||
|
||||
class Person {
|
||||
int myA;
|
||||
int myId;
|
||||
void f(int <caret>a, String id) {
|
||||
this.myA = foo(a);
|
||||
}
|
||||
int foo(int a) {return a;}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// "Assign Parameter to Field 'myId'" "false"
|
||||
|
||||
class Person {
|
||||
int a;
|
||||
int myId;
|
||||
void f(int a, String id<caret>) {
|
||||
this.a = foo(a);
|
||||
}
|
||||
int foo(int a) {return a;}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
// "Assign Parameter to Field 'myStr'" "false"
|
||||
|
||||
|
||||
class Foo1 {
|
||||
final String myStr;
|
||||
Foo1(String str, int i) {
|
||||
myStr = (str);
|
||||
}
|
||||
|
||||
Foo1(String st<caret>r) {
|
||||
this(str, 2);
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// "Surround with array initialization" "false"
|
||||
class A {
|
||||
void m1(String[] s,
|
||||
String[] s2,
|
||||
String[] s3) {}
|
||||
{
|
||||
m1( <caret>null, null);
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Fix all 'Unnecessary boxing to compare primitives' problems in file" "true"
|
||||
// "Fix all ''compare()' method can be used to compare primitives' problems in file" "true"
|
||||
public class Test {
|
||||
public void test(int a, int b) {
|
||||
if(Integer.compare(a, b) > 0) {
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Fix all 'Unnecessary boxing to compare primitives' problems in file" "true"
|
||||
// "Fix all ''compare()' method can be used to compare primitives' problems in file" "true"
|
||||
public class Test {
|
||||
public int test(String s1, String s2) {
|
||||
int res = Integer.compare(s1.length(), s2.length());
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
// "Fix all ''compare()' method can be used to compare primitives' problems in file" "true"
|
||||
class Test {
|
||||
public void test(String s1, String s2) {
|
||||
int res;
|
||||
res = Integer.compare(s2.length(), s1.length())
|
||||
System.out.println(res);
|
||||
}
|
||||
|
||||
public void testMissingElse(String s1, String s2) {
|
||||
int res;
|
||||
if(s1.length() < s2.length()) res = 1;
|
||||
else if(s1.length() > s2.length()) res = -1;
|
||||
res = 0;
|
||||
System.out.println(res);
|
||||
}
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
// "Fix all ''compare()' method can be used to compare primitives' problems in file" "true"
|
||||
class Test {
|
||||
public int test(String s1, String s2) {
|
||||
return Integer.compare(s1.length(), s2.length());
|
||||
/*otherwise bigger*/
|
||||
}
|
||||
|
||||
public int test2(String s1, String s2) {
|
||||
return Integer.compare(s2.length(), s1.length());
|
||||
}
|
||||
|
||||
public int test3(String s1, String s2) {
|
||||
if(s1.length() > s2.length()) return -1;
|
||||
else if(s2.length() > s1.length()) return -1;
|
||||
else return 0;
|
||||
}
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
// "Fix all ''compare()' method can be used to compare primitives' problems in file" "true"
|
||||
public class Test {
|
||||
public void test(String s1, String s2) {
|
||||
System.out.println(Integer.compare(s1.length(), s2.length()));
|
||||
System.out.println(Integer.compare(s2.length(), s1.length()));
|
||||
/*greater!*/
|
||||
/*less!*/
|
||||
/*equal!*/
|
||||
System.out.println(Integer.compare(s1.length(), s2.length()));
|
||||
System.out.println(Integer.compare(s2.length(), s1.length()));
|
||||
System.out.println(Integer.compare(s2.length(), s1.length()));
|
||||
|
||||
System.out.println(s1.length() < s2.length() ? -1 : s1.length() == s2.length() ? 0 : 2);
|
||||
System.out.println(s1.length() < s2.length() ? 1 : s2.length() < s1.length() ? 0 : 1);
|
||||
System.out.println(s1.length() == s2.length() ? 1 : s2.length() < s1.length() ? 0 : 1);
|
||||
System.out.println(s1.length() == s2.length() ? 0 : s2.length() < s2.length() ? -1 : 1);
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Fix all 'Unnecessary boxing to compare primitives' problems in file" "true"
|
||||
// "Fix all ''compare()' method can be used to compare primitives' problems in file" "true"
|
||||
public class Test {
|
||||
public void test(int a, int b) {
|
||||
if(((Integer)a).compa<caret>reTo(b) > 0) {
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Fix all 'Unnecessary boxing to compare primitives' problems in file" "true"
|
||||
// "Fix all ''compare()' method can be used to compare primitives' problems in file" "true"
|
||||
public class Test {
|
||||
public int test(String s1, String s2) {
|
||||
int res = new Integer(s1.length()).co<caret>mpareTo(s2.length());
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
// "Fix all ''compare()' method can be used to compare primitives' problems in file" "true"
|
||||
class Test {
|
||||
public void test(String s1, String s2) {
|
||||
int res;
|
||||
i<caret>f(s1.length() < s2.length()) res = 1;
|
||||
else if(s1.length() > s2.length()) res = -1;
|
||||
else res = 0;
|
||||
System.out.println(res);
|
||||
}
|
||||
|
||||
public void testMissingElse(String s1, String s2) {
|
||||
int res;
|
||||
if(s1.length() < s2.length()) res = 1;
|
||||
else if(s1.length() > s2.length()) res = -1;
|
||||
res = 0;
|
||||
System.out.println(res);
|
||||
}
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
// "Fix all ''compare()' method can be used to compare primitives' problems in file" "true"
|
||||
class Test {
|
||||
public int test(String s1, String s2) {
|
||||
if(s1.length() < s2.length()) {
|
||||
return -1;
|
||||
}
|
||||
if((s1.length()) == s2.length()) return 0;
|
||||
else /*otherwise bigger*/ return +1;
|
||||
}
|
||||
|
||||
public int test2(String s1, String s2) {
|
||||
i<caret>f(s1.length() > s2.length()) return -1;
|
||||
else if(s2.length() > s1.length()) return 1;
|
||||
else return 0;
|
||||
}
|
||||
|
||||
public int test3(String s1, String s2) {
|
||||
if(s1.length() > s2.length()) return -1;
|
||||
else if(s2.length() > s1.length()) return -1;
|
||||
else return 0;
|
||||
}
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
// "Fix all ''compare()' method can be used to compare primitives' problems in file" "true"
|
||||
public class Test {
|
||||
public void test(String s1, String s2) {
|
||||
System.out.println(s1.<caret>length() < s2.length() ? -1 : s1.length() == s2.length() ? 0 : 1);
|
||||
System.out.println((s1.length() > s2.length()) ? -1 : s1.length() == s2.length() ? 0 : 1);
|
||||
System.out.println((s1.length() > s2.length()) ? /*greater!*/+1 : s1.length() < s2.length() ? /*less!*/-1 : /*equal!*/0);
|
||||
System.out.println(s1.length() == s2.length() ? 0 : s2.length() < s1.length() ? -1 : 1);
|
||||
System.out.println(s1.length() < s2.length() ? 1 : s2.length() < s1.length() ? -1 : 0);
|
||||
|
||||
System.out.println(s1.length() < s2.length() ? -1 : s1.length() == s2.length() ? 0 : 2);
|
||||
System.out.println(s1.length() < s2.length() ? 1 : s2.length() < s1.length() ? 0 : 1);
|
||||
System.out.println(s1.length() == s2.length() ? 1 : s2.length() < s1.length() ? 0 : 1);
|
||||
System.out.println(s1.length() == s2.length() ? 0 : s2.length() < s2.length() ? -1 : 1);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user