Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
43e34262
Commit
43e34262
authored
Jan 09, 2018
by
Stephane Nicoll
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #11534 from izeye:class-equals
* pr/11534: Use instance equality for Class
parents
b5a4edc9
b8706c47
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
18 additions
and
18 deletions
+18
-18
AutoConfigurationImportSelector.java
...k/boot/autoconfigure/AutoConfigurationImportSelector.java
+2
-2
TypeExcludeFiltersContextCustomizer.java
...configure/filter/TypeExcludeFiltersContextCustomizer.java
+2
-2
PropertyMappingContextCustomizer.java
...onfigure/properties/PropertyMappingContextCustomizer.java
+2
-2
TypeExcludeFiltersContextCustomizerFactoryTests.java
...lter/TypeExcludeFiltersContextCustomizerFactoryTests.java
+2
-2
ExampleBasicObject.java
.../boot/test/autoconfigure/json/app/ExampleBasicObject.java
+2
-2
ExampleCustomObject.java
...boot/test/autoconfigure/json/app/ExampleCustomObject.java
+2
-2
ImportsContextCustomizer.java
...framework/boot/test/context/ImportsContextCustomizer.java
+2
-2
TestPropertyValues.java
...rg/springframework/boot/test/util/TestPropertyValues.java
+2
-2
TypeExcludeFilter.java
...a/org/springframework/boot/context/TypeExcludeFilter.java
+2
-2
No files found.
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigurationImportSelector.java
View file @
43e34262
/*
/*
* Copyright 2012-201
7
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -108,7 +108,7 @@ public class AutoConfigurationImportSelector
...
@@ -108,7 +108,7 @@ public class AutoConfigurationImportSelector
}
}
protected
boolean
isEnabled
(
AnnotationMetadata
metadata
)
{
protected
boolean
isEnabled
(
AnnotationMetadata
metadata
)
{
if
(
getClass
()
.
equals
(
AutoConfigurationImportSelector
.
class
)
)
{
if
(
getClass
()
==
AutoConfigurationImportSelector
.
class
)
{
return
getEnvironment
().
getProperty
(
return
getEnvironment
().
getProperty
(
EnableAutoConfiguration
.
ENABLED_OVERRIDE_PROPERTY
,
Boolean
.
class
,
EnableAutoConfiguration
.
ENABLED_OVERRIDE_PROPERTY
,
Boolean
.
class
,
true
);
true
);
...
...
spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/filter/TypeExcludeFiltersContextCustomizer.java
View file @
43e34262
/*
/*
* Copyright 2012-201
7
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -80,7 +80,7 @@ class TypeExcludeFiltersContextCustomizer implements ContextCustomizer {
...
@@ -80,7 +80,7 @@ class TypeExcludeFiltersContextCustomizer implements ContextCustomizer {
@Override
@Override
public
boolean
equals
(
Object
obj
)
{
public
boolean
equals
(
Object
obj
)
{
return
(
obj
!=
null
&&
getClass
()
.
equals
(
obj
.
getClass
()
)
&&
this
.
filters
return
(
obj
!=
null
&&
getClass
()
==
obj
.
getClass
(
)
&&
this
.
filters
.
equals
(((
TypeExcludeFiltersContextCustomizer
)
obj
).
filters
));
.
equals
(((
TypeExcludeFiltersContextCustomizer
)
obj
).
filters
));
}
}
...
...
spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/properties/PropertyMappingContextCustomizer.java
View file @
43e34262
/*
/*
* Copyright 2012-201
7
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -62,7 +62,7 @@ class PropertyMappingContextCustomizer implements ContextCustomizer {
...
@@ -62,7 +62,7 @@ class PropertyMappingContextCustomizer implements ContextCustomizer {
@Override
@Override
public
boolean
equals
(
Object
obj
)
{
public
boolean
equals
(
Object
obj
)
{
return
(
obj
!=
null
&&
getClass
()
.
equals
(
obj
.
getClass
()
)
&&
this
.
propertySource
return
(
obj
!=
null
&&
getClass
()
==
obj
.
getClass
(
)
&&
this
.
propertySource
.
equals
(((
PropertyMappingContextCustomizer
)
obj
).
propertySource
));
.
equals
(((
PropertyMappingContextCustomizer
)
obj
).
propertySource
));
}
}
...
...
spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/filter/TypeExcludeFiltersContextCustomizerFactoryTests.java
View file @
43e34262
/*
/*
* Copyright 2012-201
7
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -125,7 +125,7 @@ public class TypeExcludeFiltersContextCustomizerFactoryTests {
...
@@ -125,7 +125,7 @@ public class TypeExcludeFiltersContextCustomizerFactoryTests {
@Override
@Override
public
boolean
equals
(
Object
obj
)
{
public
boolean
equals
(
Object
obj
)
{
return
obj
.
getClass
()
.
equals
(
getClass
()
);
return
obj
.
getClass
()
==
getClass
(
);
}
}
}
}
...
...
spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/json/app/ExampleBasicObject.java
View file @
43e34262
/*
/*
* Copyright 2012-201
7
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -40,7 +40,7 @@ public class ExampleBasicObject {
...
@@ -40,7 +40,7 @@ public class ExampleBasicObject {
@Override
@Override
public
boolean
equals
(
Object
obj
)
{
public
boolean
equals
(
Object
obj
)
{
if
(
obj
!=
null
&&
obj
.
getClass
()
.
equals
(
getClass
()
))
{
if
(
obj
!=
null
&&
obj
.
getClass
()
==
getClass
(
))
{
return
this
.
value
.
equals
(((
ExampleBasicObject
)
obj
).
value
);
return
this
.
value
.
equals
(((
ExampleBasicObject
)
obj
).
value
);
}
}
return
false
;
return
false
;
...
...
spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/json/app/ExampleCustomObject.java
View file @
43e34262
/*
/*
* Copyright 2012-201
7
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -36,7 +36,7 @@ public class ExampleCustomObject {
...
@@ -36,7 +36,7 @@ public class ExampleCustomObject {
@Override
@Override
public
boolean
equals
(
Object
obj
)
{
public
boolean
equals
(
Object
obj
)
{
if
(
obj
!=
null
&&
obj
.
getClass
()
.
equals
(
getClass
()
))
{
if
(
obj
!=
null
&&
obj
.
getClass
()
==
getClass
(
))
{
return
this
.
value
.
equals
(((
ExampleCustomObject
)
obj
).
value
);
return
this
.
value
.
equals
(((
ExampleCustomObject
)
obj
).
value
);
}
}
return
false
;
return
false
;
...
...
spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/ImportsContextCustomizer.java
View file @
43e34262
/*
/*
* Copyright 2012-201
7
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -346,7 +346,7 @@ class ImportsContextCustomizer implements ContextCustomizer {
...
@@ -346,7 +346,7 @@ class ImportsContextCustomizer implements ContextCustomizer {
@Override
@Override
public
boolean
equals
(
Object
obj
)
{
public
boolean
equals
(
Object
obj
)
{
return
(
obj
!=
null
&&
getClass
()
.
equals
(
obj
.
getClass
()
)
return
(
obj
!=
null
&&
getClass
()
==
obj
.
getClass
(
)
&&
this
.
key
.
equals
(((
ContextCustomizerKey
)
obj
).
key
));
&&
this
.
key
.
equals
(((
ContextCustomizerKey
)
obj
).
key
));
}
}
...
...
spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/util/TestPropertyValues.java
View file @
43e34262
/*
/*
* Copyright 2012-201
7
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -144,7 +144,7 @@ public final class TestPropertyValues {
...
@@ -144,7 +144,7 @@ public final class TestPropertyValues {
private
void
addToSources
(
MutablePropertySources
sources
,
Type
type
,
String
name
)
{
private
void
addToSources
(
MutablePropertySources
sources
,
Type
type
,
String
name
)
{
if
(
sources
.
contains
(
name
))
{
if
(
sources
.
contains
(
name
))
{
PropertySource
<?>
propertySource
=
sources
.
get
(
name
);
PropertySource
<?>
propertySource
=
sources
.
get
(
name
);
if
(
propertySource
.
getClass
()
.
equals
(
type
.
getSourceClass
()
))
{
if
(
propertySource
.
getClass
()
==
type
.
getSourceClass
(
))
{
((
Map
<
String
,
Object
>)
propertySource
.
getSource
())
((
Map
<
String
,
Object
>)
propertySource
.
getSource
())
.
putAll
(
this
.
properties
);
.
putAll
(
this
.
properties
);
return
;
return
;
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/TypeExcludeFilter.java
View file @
43e34262
/*
/*
* Copyright 2012-201
7
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -60,7 +60,7 @@ public class TypeExcludeFilter implements TypeFilter, BeanFactoryAware {
...
@@ -60,7 +60,7 @@ public class TypeExcludeFilter implements TypeFilter, BeanFactoryAware {
public
boolean
match
(
MetadataReader
metadataReader
,
public
boolean
match
(
MetadataReader
metadataReader
,
MetadataReaderFactory
metadataReaderFactory
)
throws
IOException
{
MetadataReaderFactory
metadataReaderFactory
)
throws
IOException
{
if
(
this
.
beanFactory
instanceof
ListableBeanFactory
if
(
this
.
beanFactory
instanceof
ListableBeanFactory
&&
getClass
()
.
equals
(
TypeExcludeFilter
.
class
)
)
{
&&
getClass
()
==
TypeExcludeFilter
.
class
)
{
Collection
<
TypeExcludeFilter
>
delegates
=
((
ListableBeanFactory
)
this
.
beanFactory
)
Collection
<
TypeExcludeFilter
>
delegates
=
((
ListableBeanFactory
)
this
.
beanFactory
)
.
getBeansOfType
(
TypeExcludeFilter
.
class
).
values
();
.
getBeansOfType
(
TypeExcludeFilter
.
class
).
values
();
for
(
TypeExcludeFilter
delegate
:
delegates
)
{
for
(
TypeExcludeFilter
delegate
:
delegates
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment