{"action":"created","issue":{"url":"https://api.github.com/repos/spring-projects/spring-boot/issues/7580","repository_url":"https://api.github.com/repos/spring-projects/spring-boot","labels_url":"https://api.github.com/repos/spring-projects/spring-boot/issues/7580/labels{/name}","comments_url":"https://api.github.com/repos/spring-projects/spring-boot/issues/7580/comments","events_url":"https://api.github.com/repos/spring-projects/spring-boot/issues/7580/events","html_url":"https://github.com/spring-projects/spring-boot/issues/7580","id":193850179,"number":7580,"title":"Class.equals returns false in some cases with spring-boot-dev-tools activated","user":{"login":"bfortunato","id":870282,"avatar_url":"https://avatars.githubusercontent.com/u/870282?v=3","gravatar_id":"","url":"https://api.github.com/users/bfortunato","html_url":"https://github.com/bfortunato","followers_url":"https://api.github.com/users/bfortunato/followers","following_url":"https://api.github.com/users/bfortunato/following{/other_user}","gists_url":"https://api.github.com/users/bfortunato/gists{/gist_id}","starred_url":"https://api.github.com/users/bfortunato/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bfortunato/subscriptions","organizations_url":"https://api.github.com/users/bfortunato/orgs","repos_url":"https://api.github.com/users/bfortunato/repos","events_url":"https://api.github.com/users/bfortunato/events{/privacy}","received_events_url":"https://api.github.com/users/bfortunato/received_events","type":"User","site_admin":false},"labels":[{"id":16916894,"url":"https://api.github.com/repos/spring-projects/spring-boot/labels/invalid","name":"invalid","color":"e6e6e6","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-12-06T18:35:51Z","updated_at":"2016-12-07T08:21:29Z","closed_at":"2016-12-06T19:03:37Z","body":"Probably because of ReloaderClassLoader, in some cases there are classes that appears equals that are loaded by a different class loader.\r\n\r\nIf i store a reference of class type into a singleton bean and compare with the same class using equals(), the result is false.\r\n\r\nes:\r\n@Component\r\nclass SingletonBean() {\r\n    public Class getClassType() {\r\n        return MyClass.class\r\n    }\r\n}\r\n\r\n\r\nsomewhere in code, for example a controller\r\n\r\napplicationContext.getBean(SingletonBean.class).getClassType().equals(MyClass.class)\r\n\r\nreturns false\r\n\r\nIf I check the classloader of each class, in the first case is ReloaderClassLoader, in second case is AppLauncher$ClassLoader.\r\n"},"comment":{"url":"https://api.github.com/repos/spring-projects/spring-boot/issues/comments/265384979","html_url":"https://github.com/spring-projects/spring-boot/issues/7580#issuecomment-265384979","issue_url":"https://api.github.com/repos/spring-projects/spring-boot/issues/7580","id":265384979,"user":{"login":"wilkinsona","id":914682,"avatar_url":"https://avatars.githubusercontent.com/u/914682?v=3","gravatar_id":"","url":"https://api.github.com/users/wilkinsona","html_url":"https://github.com/wilkinsona","followers_url":"https://api.github.com/users/wilkinsona/followers","following_url":"https://api.github.com/users/wilkinsona/following{/other_user}","gists_url":"https://api.github.com/users/wilkinsona/gists{/gist_id}","starred_url":"https://api.github.com/users/wilkinsona/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wilkinsona/subscriptions","organizations_url":"https://api.github.com/users/wilkinsona/orgs","repos_url":"https://api.github.com/users/wilkinsona/repos","events_url":"https://api.github.com/users/wilkinsona/events{/privacy}","received_events_url":"https://api.github.com/users/wilkinsona/received_events","type":"User","site_admin":false},"created_at":"2016-12-07T08:21:29Z","updated_at":"2016-12-07T08:21:29Z","body":"We can investigate a bit more, but we'll need some more information. If you provide a sample that reproduces the problem we can take another look."}}
{"actor":{"display_login":"wilkinsona"}}