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

Unnecessary and wrong imports #598

Open
khaes-kth opened this issue Aug 30, 2021 · 3 comments
Open

Unnecessary and wrong imports #598

khaes-kth opened this issue Aug 30, 2021 · 3 comments
Labels
bug Something isn't working

Comments

@khaes-kth
Copy link
Collaborator

When rule 2142 fixes are applied on YCSB (commit: 0a4310), unnecessary imports are added to different files, including riak/src/main/java/site/ycsb/db/riak/RiakKVClient.java. These imports cause compilation errors.

import java.util.HashMap;
import java.util.Vector;
import com.basho.riak.client.api.commands.indexes.IntIndexQuery.Response;
import com.basho.riak.client.api.commands.kv.FetchValue.Response;
import com.basho.riak.client.api.commands.kv.StoreValue.Response;
import com.basho.riak.client.api.commands.kv.UpdateValue.Response;
import java.util.Map;
import java.util.Set;
import java.util.List;
import com.basho.riak.client.api.commands.indexes.IntIndexQuery.Response.Entry;
import java.util.Properties;
import com.basho.riak.client.api.commands.buckets.StoreBucketProperties.Builder;
import com.basho.riak.client.api.commands.indexes.IntIndexQuery.Builder;
import com.basho.riak.client.api.commands.kv.DeleteValue.Builder;
import com.basho.riak.client.api.commands.kv.FetchValue.Builder;
import com.basho.riak.client.api.commands.kv.StoreValue.Builder;
import com.basho.riak.client.api.commands.kv.UpdateValue.Builder;
import com.basho.riak.client.core.RiakCluster.Builder;
import com.basho.riak.client.core.RiakNode.Builder;
import java.util.Arrays;
@algomaster99
Copy link
Member

algomaster99 commented Dec 7, 2021

INRIA/spoon#4320 will fix imports of classes from java.util.


I have figured out why imports like import com.basho.riak.client.api.commands.kv.FetchValue.Builder; are present despite the presence fo this import statement. Spoon is unable to resolve imports as in line 40 so, we can't check if declaringType of Builder is present.

@algomaster99
Copy link
Member

@khaes-kth do you remember if running in MAVEN mode resolved this?

@khaes-kth
Copy link
Collaborator Author

@algomaster99 Not really. I'm not sure if we even checked which specific bugs were fixed. We may need to give it a try again to see if this is fixed.

Just to make sure we do not forget this: At the end, we did not use the MAVEN mode, we used that --resolve-classpath.... option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

2 participants