private boolean isFieldModified(CliClientProjectComponent data, String type, int pos) {
try {
Field field = getClass().getDeclaredField("remote" + type + pos + "Field");
field.setAccessible(true);
String fieldValue = ((JTextField) field.get(this)).getText();
RemoteCommand cmd = data.getRemoteCommands()[pos - 1];
String dataValue = String.valueOf(cmd.getClass().getMethod("get" + type).invoke(cmd));
return fieldValue != null ?
!fieldValue.equals(dataValue) :
dataValue != null;
} catch (NoSuchFieldException e) {
throw new RuntimeException(e);