Seda
Seda

Reputation: 103

Refactoring int,long etc

Is there any possible way how to refactor variable fields in eclipse?

long interval;

public WebsiteConnectionPing(String url, long interval, String serviceName) {
    this.url = url;
    this.interval = interval;
    this.serviceName = serviceName;
}
//......

I want to refactor interval which is type long to type String is it possible?

String interval;

public WebsiteConnectionPing(String url, String interval, String serviceName) {
    this.url = url;
    this.interval = interval;
    this.serviceName = serviceName;
}
//....

Upvotes: 0

Views: 515

Answers (1)

Michal Vitousek
Michal Vitousek

Reputation: 76

I found this way:

  1. Change type of argument "interval" in constructor from long to String.
  2. Eclipse show error at line with code: this.interval = interval;
  3. Choose the first quick-fix > Change type of 'interval' to String.

Upvotes: 1

Related Questions