auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private InterpreterResult executeSql(String sql) { int counter = 0; StringBuilder finalmessage = null; finalmessage = new StringBuilder("%table "); String projId = getProperty(PROJECT_ID); long wTime = Long.parseLong(getProperty(WAIT_TIME)); long maxRows = Long.parseLong(getProperty(MAX_ROWS)); String sqlDialect = getProperty(SQL_DIALECT, ""); Boolean useLegacySql; switch (sqlDialect) { <START> case "standardSQL": <END> useLegacySql = false; break; case "legacySQL": useLegacySql = true; break; default: useLegacySql = null; } Iterator<GetQueryResultsResponse> pages; try { pages = run(sql, projId, wTime, maxRows, useLegacySql); } catch (IOException ex) { logger.error(ex.getMessage()); return new InterpreterResult(Code.ERROR, ex.getMessage()); } try { while (pages.hasNext()) { finalmessage.append(printRows(pages.next())); } return new InterpreterResult(Code.SUCCESS, finalmessage.toString()); } catch (NullPointerException ex) { return new InterpreterResult(Code.ERROR, ex.getMessage()); } }</code><technical_language>is this case sensitive</technical_language>

Target:
private InterpreterResult executeSql(String sql) { int counter = 0; StringBuilder finalmessage = null; finalmessage = new StringBuilder("%table "); String projId = getProperty(PROJECT_ID); long wTime = Long.parseLong(getProperty(WAIT_TIME)); long maxRows = Long.parseLong(getProperty(MAX_ROWS)); String sqlDialect = getProperty(SQL_DIALECT, "").toLowerCase(); Boolean useLegacySql; switch (sqlDialect) { case "standardsql": useLegacySql = false; break; case "legacysql": useLegacySql = true; break; default: useLegacySql = null; } Iterator<GetQueryResultsResponse> pages; try { pages = run(sql, projId, wTime, maxRows, useLegacySql); } catch (IOException ex) { logger.error(ex.getMessage()); return new InterpreterResult(Code.ERROR, ex.getMessage()); } try { while (pages.hasNext()) { finalmessage.append(printRows(pages.next())); } return new InterpreterResult(Code.SUCCESS, finalmessage.toString()); } catch (NullPointerException ex) { return new InterpreterResult(Code.ERROR, ex.getMessage()); } }
Source:
<code><START> public void <END> registerDialogWatchers() { registerWatcher( AppIsNotRespondingWatcher.class.getSimpleName(), new AppIsNotRespondingWatcher(InstrumentationRegistry.getInstrumentation())); }</code><technical_language>nit: leave private modifying API, JFYI. if necessary all. If not, I worth making change</technical_language>

Target:
private void registerDialogWatchers() { registerWatcher( AppIsNotRespondingWatcher.class.getSimpleName(), new AppIsNotRespondingWatcher(InstrumentationRegistry.getInstrumentation())); }
Source:
<code>private Span[] overrideDefaultType(Span[] names) { <START> Span[] converted = new Span[names.length]; <END> for (int i = 0; i < names.length; i++) { Span n = names[i]; if (Objects.isNull(n.getType())) { converted[i] = new Span(n.getStart(), n.getEnd(), this.defaultType, n.getProb()); } else { converted[i] = n; } } return converted; }</code><technical_language>Do need create a new array here? sense do this in place in original array</technical_language>

Target:
private Span[] overrideDefaultType(Span[] names) { for (int i = 0; i < names.length; i++) { Span n = names[i]; if (Objects.isNull(n.getType())) { names[i] = new Span(n.getStart(), n.getEnd(), this.defaultType, n.getProb()); } } return names; }
Source:
<code>public String contents() throws IOException { try (TextFileContext context = new TextFileContext(file)) { return context.getDocument().get(); } catch (CoreException e) { } <START> return null; <END> }</code><technical_language>implemented interface, return null (should change it?)</technical_language>

Target:
public String contents() throws IOException { try (TextFileContext context = new TextFileContext(file)) { return context.getDocument().get(); } catch (CoreException e) { throw new IOException("error while reading file: " + file.getFullPath(), e); } }
Source:
<code>private void annotate(RepositoryAnnotator annotator, Repository<Entity> repository, DatabaseAction action) { if (!repository.getCapabilities().contains(WRITABLE)) { throw new UnsupportedOperationException("Currently only writable repositories can be annotated"); } try { EntityType entityType = dataService.getMeta().getEntityType(repository.getName()); if (annotator instanceof EffectCreatingAnnotator) { targetMetaData = ((EffectCreatingAnnotator) annotator).getTargetEntityType(entityType); if (!dataService.hasRepository(targetMetaData.getId())) { try (Repository externalRepository = dataService.getMeta().createRepository(targetMetaData)) { permissionSystemService.giveUserWriteMetaPermissions(targetMetaData); runAsSystem(() -> dataService.getMeta().updateEntityType(externalRepository.getEntityType())); iterateOverEntitiesAndAnnotate(repository, annotator, DatabaseAction.ADD); } } else { throw new SecondRunNotSupportedException(annotator); } } else { runAsSystem(() -> dataService.getMeta() .updateEntityType( addAnnotatorMetaDataToRepositories(entityType, attributeFactory, annotator))); iterateOverEntitiesAndAnnotate(dataService.getRepository(repository.getName()), annotator, action); } } catch (CodedRuntimeException crte) { <START> deleteResultEntity(annotator, targetMetaData); <END> throw crte; } catch (Exception e) { deleteResultEntity(annotator, targetMetaData); throw new RuntimeException(e); } }</code><technical_language>assign</technical_language>

Target:
private void annotate(RepositoryAnnotator annotator, Repository<Entity> repository, DatabaseAction action) { if (!repository.getCapabilities().contains(WRITABLE)) { throw new UnsupportedOperationException("Currently only writable repositories can be annotated"); } try { EntityType entityType = dataService.getMeta().getEntityType(repository.getName()); if (annotator instanceof EffectCreatingAnnotator) { targetMetaData = ((EffectCreatingAnnotator) annotator).getTargetEntityType(entityType); if (!dataService.hasRepository(targetMetaData.getId())) { try (Repository externalRepository = dataService.getMeta().createRepository(targetMetaData)) { permissionSystemService.giveUserWriteMetaPermissions(targetMetaData); runAsSystem(() -> dataService.getMeta().updateEntityType(externalRepository.getEntityType())); iterateOverEntitiesAndAnnotate(repository, annotator, DatabaseAction.ADD); } } else { throw new SecondRunNotSupportedException(annotator); } } else { runAsSystem(() -> dataService.getMeta() .updateEntityType( addAnnotatorMetaDataToRepositories(entityType, attributeFactory, annotator))); iterateOverEntitiesAndAnnotate(dataService.getRepository(repository.getName()), annotator, action); } } catch (CodedRuntimeException crte) { throw crte; } catch (Exception e) { throw new RuntimeException(e); } }
Source:
<code>SimpleStateRequestHandler( KeyedStateBackend keyedStateBackend, TypeSerializer keySerializer) { this.keySerializer = keySerializer; this.valueSerializer = PrimitiveArrayTypeInfo.BYTE_PRIMITIVE_ARRAY_TYPE_INFO .createSerializer(new ExecutionConfig()); <START> this.keyedStateBackend = keyedStateBackend; <END> baos = new ByteArrayOutputStreamWithPos(); baosWrapper = new DataOutputViewStreamWrapper(baos); bais = new ByteArrayInputStreamWithPos(); baisWrapper = new DataInputViewStreamWrapper(bais); stateDescriptorCache = new HashMap<>(); }</code><technical_language>Move this line front of constructor</technical_language>

Target:
SimpleStateRequestHandler( KeyedStateBackend keyedStateBackend, TypeSerializer keySerializer) { this.keyedStateBackend = keyedStateBackend; this.keySerializer = keySerializer; this.valueSerializer = PrimitiveArrayTypeInfo.BYTE_PRIMITIVE_ARRAY_TYPE_INFO .createSerializer(new ExecutionConfig()); bais = new ByteArrayInputStreamWithPos(); baisWrapper = new DataInputViewStreamWrapper(bais); stateDescriptorCache = new HashMap<>(); }
Source:
<code><START> public StickyMulticastStrategy(Optional<Integer> maxTasks, Optional<Integer> imbalanceThreshold) { <END> _maxTasks = maxTasks; _imbalanceThreshold = imbalanceThreshold.orElse(DEFAULT_IMBALANCE_THRESHOLD); }</code><technical_language>nitpick: throw error if imbalance is 1</technical_language>

Target:
public StickyMulticastStrategy(Optional<Integer> maxTasks, Optional<Integer> imbalanceThreshold) { _maxTasks = maxTasks; _imbalanceThreshold = imbalanceThreshold.orElse(DEFAULT_IMBALANCE_THRESHOLD); if (_imbalanceThreshold < 1) { throw new IllegalArgumentException("Imbalance threshold must be larger or equal than 1"); } }
Source:
<code>private Optional<String> unlock(String name) { LOGGER.debug("Attempting to unlock {0}", name); <START> NamedLock lock = locksByName.get(name); <END> if (lock == null) { return Optional.of(name); } try { lock.unlock(); } catch (IllegalMonitorStateException e) { LOGGER.warn(JcrI18n.warnAnotherThreadAttemptingToUnlock, Thread.currentThread().getName(), lock); } if (lock.isLocked()) { LOGGER.debug("Failed to unlock {0} ", lock); return Optional.of(name); } else { LOGGER.debug("{0} unlocked", lock); return Optional.empty(); } }</code><technical_language>this synchronize locksByName</technical_language>

Target:
private Optional<String> unlock(String name) { LOGGER.debug("Attempting to unlock {0}", name); AtomicBoolean unlocked = new AtomicBoolean(false); locksByName.computeIfPresent(name, (key,lock)-> { if (!lock.isHeldByCurrentThread()) { LOGGER.debug("The thread '{0}' is attempting to unlock '{1}' which is held by another thread", Thread.currentThread().getName(), key); return lock; } while (lock.getHoldCount() > 0) { lock.unlock(); } unlocked.set(true); if (lock.hasQueuedThreads()) { LOGGER.debug("Lock '{0}' is not currently locked but will be", name); return lock; } return null; }); return unlocked.get() ? Optional.empty() : Optional.of(name); }
Source:
<code>public ImageScaleMenu(final DivaMainImageDisplay imageDisplay) { super(_I18N.getString("scale")); <START> final HashMap<Float, JRadioButtonMenuItem> scaleToButton = new HashMap<>(); <END> final ButtonGroup group = new ButtonGroup(); final ActionListener listener = new ActionListener() { @Override public void actionPerformed(ActionEvent e) { final float scale = Float.parseFloat(e.getActionCommand()); imageDisplay.setScale(scale); imageDisplay.updateImage(); } }; for (ScaleMenuOptions o : ScaleMenuOptions.values()) { final JMenu menu = new JMenu(o.i18name); for (int i=1; i <= ImageDisplayMenuBar.MAX_SCALE; ++i) { final float scale = o.createScaleForIndex(i); final JRadioButtonMenuItem b = new JRadioButtonMenuItem(o.createLabelForIndex(i)); b.setActionCommand(Float.toString(scale)); b.addActionListener(listener); group.add(b); menu.add(b); scaleToButton.put(scale, b); } add(menu); } final JMenuItem menuItem = new JMenuItem(_I18N.getString("fitImageInWindow")); menuItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { imageDisplay.scaleToFit(); imageDisplay.updateImage(); } }); add(menuItem); imageDisplay.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent ce) { ImageChangeEvent e = (ImageChangeEvent) ce; if (e.isNewScale()) { final JRadioButtonMenuItem b = scaleToButton.get(imageDisplay.getScale()); if (b != null) b.setSelected(true); } } }); }</code><technical_language>a rational (i.e., Pair<Integer, Integer> for key? numerator denominator integral</technical_language>

Target:
public ImageScaleMenu(final DivaMainImageDisplay imageDisplay) { super(_I18N.getString("scale")); scaleToButton = new HashMap<>(); final ButtonGroup group = new ButtonGroup(); for (ScaleMenuOptions o : ScaleMenuOptions.values()) { final JMenu menu = new JMenu(o.i18nName); for (int i=o.lowerBound; i <= o.upperBound; ++i) { final float scale = o.createScaleForIndex(i); final Pair<Integer, Integer> rational = o.createRationalScaleForIndex(i); final JRadioButtonMenuItem b = new JRadioButtonMenuItem(o.createLabelForIndex(i)); b.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { imageDisplay.setScale(scale); imageDisplay.updateImage(); } }); group.add(b); menu.add(b); scaleToButton.put(rational, b); } add(menu); } final JMenuItem menuItem = new JMenuItem(_I18N.getString("fitImageInWindow")); menuItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { imageDisplay.scaleToFit(); imageDisplay.updateImage(); } }); add(menuItem); imageDisplay.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent ce) { final ImageChangeEvent e = (ImageChangeEvent) ce; if (e.isNewScale()) enableButtonForScale(imageDisplay.getScale()); } }); enableButtonForScale(imageDisplay.getScale()); }
Source:
<code>public void handleCreated(Event event) { <START> curator.insert(new BasicDBObject(event.getNewEntity().toMap())); <END> }</code><technical_language>This a bit hairy, deconstructing reconstructing a hashmap</technical_language>

Target:
public void handleCreated(Event event) { curator.insert((BasicDBObject) event.getNewEntity()); }
Source:
<code>public static TopicDraft getDefaultTopicDraft() { <START> return new TopicDraft(getDefaultUser(), "topic title", "Discussion"); <END> }</code><technical_language>Instead of hardcoding values generate randomly: RandomStringUtils.random(15). I in JC yet, need start moving this. PS: please update version of commons-lang 3.x.x</technical_language>

Target:
public static TopicDraft getDefaultTopicDraft() { TopicDraft draft = new TopicDraft(getDefaultUser(), RandomStringUtils.random(5), RandomStringUtils.random(15)); draft.setPollTitle(RandomStringUtils.random(5)); draft.setPollItemsValue(RandomStringUtils.random(5) + "\n" + RandomStringUtils.random(5)); return draft; }
Source:
<code>public void onChildScrollingPreferenceChanged() { final int position = viewHolder.profileSectionTabs.getSelectedTabPosition(); @AppBarLayout.LayoutParams.ScrollFlags final int scrollFlags; <START> Fragment fragment =(((StaticFragmentPagerAdapter) viewHolder.profileSectionPager.getAdapter()).getFragment(position)); <END> if(fragment != null) { if (position >= 0 && ((ScrollingPreferenceChild) fragment).prefersScrollingHeader()) { scrollFlags = AppBarLayout.LayoutParams.SCROLL_FLAG_SCROLL; } else { scrollFlags = 0; } final AppBarLayout.LayoutParams p = (AppBarLayout.LayoutParams) viewHolder.profileHeader.getLayoutParams(); p.setScrollFlags(scrollFlags); viewHolder.profileHeader.setLayoutParams(p); } }</code><technical_language>final indent code</technical_language>

Target:
public void onChildScrollingPreferenceChanged() { final int position = viewHolder.profileSectionTabs.getSelectedTabPosition(); @AppBarLayout.LayoutParams.ScrollFlags final int scrollFlags; final Fragment fragment = (((StaticFragmentPagerAdapter) viewHolder.profileSectionPager.getAdapter()).getFragment(position)); if (fragment != null) { if (position >= 0 && ((ScrollingPreferenceChild) fragment).prefersScrollingHeader()) { scrollFlags = AppBarLayout.LayoutParams.SCROLL_FLAG_SCROLL; } else { scrollFlags = 0; } final AppBarLayout.LayoutParams params = (AppBarLayout.LayoutParams) viewHolder.profileHeader.getLayoutParams(); params.setScrollFlags(scrollFlags); viewHolder.profileHeader.setLayoutParams(params); } }
Source:
<code>private void understandSchema(String schema) throws JSONException { JSONObject j1 = new JSONObject(schema); JSONArray fields = j1.getJSONArray(FIELDS); for (int k = 0; k < fields.length(); k++) { <START> JSONObject allEvents = new JSONObject(fields.get(k).toString()); <END> Object name = allEvents.get(NAME); if (name != null) { if (name.toString().equalsIgnoreCase(EVENT)) { JSONArray allTypeDetails = allEvents.getJSONArray(TYPE); for (int i = 0; i < allTypeDetails.length(); i++) { JSONObject actual = (JSONObject) allTypeDetails.get(i); JSONArray types = actual.getJSONArray(FIELDS); Map<String, String> typeDetails = new HashMap<String, String>(); for (int j = 0; j < types.length(); j++) { typeDetails.put(types.getJSONObject(j).getString(NAME), types.getJSONObject(j) .getString(TYPE)); } fieldTypes.put(Hadoop2RecordType.valueOf(actual.get(NAME).toString()), typeDetails); } } } } }</code><technical_language>fields.get(k) null ? If so, defensive coding fields.isNull(k) check</technical_language>

Target:
private void understandSchema(String schema) throws JSONException { JSONObject j1 = new JSONObject(schema); JSONArray fields = j1.getJSONArray(FIELDS); String fieldName; String fieldTypeValue; Object recName; for (int k = 0; k < fields.length(); k++) { if (fields.get(k) == null) { continue; } JSONObject allEvents = new JSONObject(fields.get(k).toString()); Object name = allEvents.get(NAME); if (name != null) { if (name.toString().equalsIgnoreCase(EVENT)) { JSONArray allTypeDetails = allEvents.getJSONArray(TYPE); for (int i = 0; i < allTypeDetails.length(); i++) { JSONObject actual = (JSONObject) allTypeDetails.get(i); JSONArray types = actual.getJSONArray(FIELDS); Map<String, String> typeDetails = new HashMap<String, String>(); for (int j = 0; j < types.length(); j++) { if (types.getJSONObject(j) == null ) { continue; } fieldName = types.getJSONObject(j).getString(NAME); fieldTypeValue = types.getJSONObject(j).getString(TYPE); if ((fieldName != null) && (fieldTypeValue != null)) { typeDetails.put(fieldName, fieldTypeValue); } } recName = actual.get(NAME); if (recName != null) { fieldTypes.put(Hadoop2RecordType.valueOf(recName.toString()), typeDetails); } } } } } }
Source:
<code>public int compare(CucumberFeature a, CucumberFeature b) { <START> if (a.equals(b)) { <END> return 0; } return a.getUri().compareTo(b.getUri()); }</code><technical_language>I this equals test is necessary</technical_language>

Target:
public int compare(CucumberFeature a, CucumberFeature b) { return a.getUri().compareTo(b.getUri()); }
Source:
<code>public void saveNewSanStorage() { StorageModel storageModel = (StorageModel) getWindow(); final SanStorageModel sanStorageModel = (SanStorageModel) storageModel.getCurrentStorageItem(); List<String> unkownStatusLuns = new ArrayList(); List<LUNs> usedStatusLuns = new ArrayList(); for (LunModel lunModel : sanStorageModel.getAddedLuns()) { if (lunModel.getStatus() == LunStatus.Used) { usedStatusLuns.add((LUNs) lunModel.getEntity()); } else if (lunModel.getStatus() == LunStatus.Unknown) { unkownStatusLuns.add(lunModel.getLunId()); } } if (!unkownStatusLuns.isEmpty()) { Guid hostId = sanStorageModel.getContainer().getHost().getSelectedItem().getId(); <START> Object target = getWidgetModel() != null ? getWidgetModel() : sanStorageModel.getContainer(); <END> Frontend.getInstance() .runQuery(VdcQueryType.GetDeviceList, new GetDeviceListQueryParameters(hostId, sanStorageModel.getType(), true, unkownStatusLuns), new AsyncQuery(target, new INewAsyncCallback() { @Override public void onSuccess(Object target, Object returnValue) { VdcQueryReturnValue response = (VdcQueryReturnValue) returnValue; if (response.getSucceeded()) { List<LUNs> checkedLuns = (ArrayList<LUNs>) response.getReturnValue(); postGetLunsMessages(sanStorageModel.getUsedLunsMessages(checkedLuns)); } else { sanStorageModel.setGetLUNsFailure( ConstantsManager.getInstance() .getConstants() .couldNotRetrieveLUNsLunsFailure()); } } }, true)); } else { postGetLunsMessages(sanStorageModel.getUsedLunsMessages(usedStatusLuns)); } }</code><technical_language>Object instead of Model</technical_language>

Target:
public void saveNewSanStorage() { StorageModel storageModel = (StorageModel) getWindow(); final SanStorageModel sanStorageModel = (SanStorageModel) storageModel.getCurrentStorageItem(); List<String> unkownStatusLuns = new ArrayList<>(); List<LUNs> usedStatusLuns = new ArrayList<>(); for (LunModel lunModel : sanStorageModel.getAddedLuns()) { if (lunModel.getStatus() == LunStatus.Used) { usedStatusLuns.add((LUNs) lunModel.getEntity()); } else if (lunModel.getStatus() == LunStatus.Unknown) { unkownStatusLuns.add(lunModel.getLunId()); } } if (!unkownStatusLuns.isEmpty()) { Guid hostId = sanStorageModel.getContainer().getHost().getSelectedItem().getId(); Model target = getWidgetModel() != null ? getWidgetModel() : sanStorageModel.getContainer(); Frontend.getInstance() .runQuery(VdcQueryType.GetDeviceList, new GetDeviceListQueryParameters(hostId, sanStorageModel.getType(), true, unkownStatusLuns), new AsyncQuery(target, new INewAsyncCallback() { @Override public void onSuccess(Object target, Object returnValue) { VdcQueryReturnValue response = (VdcQueryReturnValue) returnValue; if (response.getSucceeded()) { List<LUNs> checkedLuns = (ArrayList<LUNs>) response.getReturnValue(); postGetLunsMessages(sanStorageModel.getUsedLunsMessages(checkedLuns)); } else { sanStorageModel.setGetLUNsFailure( ConstantsManager.getInstance() .getConstants() .couldNotRetrieveLUNsLunsFailure()); } } }, true)); } else { postGetLunsMessages(sanStorageModel.getUsedLunsMessages(usedStatusLuns)); } }
Source:
<code>public static Envelope deserializeEnvelope(Slice shape) { if (shape == null) { return null; } BasicSliceInput input = shape.getInput(); Envelope overallEnvelope = null; if (input.available() > 0) { byte code = input.readByte(); <START> boolean isGeometryCollection = code == GeometryTypeName.GEOMETRY_COLLECTION.ordinal(); <END> while (input.available() > 0) { int length = isGeometryCollection ? input.readInt() : input.available(); ByteBuffer buffer = input.readSlice(length).toByteBuffer().order(LITTLE_ENDIAN); int type = buffer.getInt(); Envelope envelope = null; if (type == POINT_TYPE) { double x = buffer.getDouble(); double y = buffer.getDouble(); if (!isEsriNaN(x)) { Verify.verify(!isEsriNaN(y)); envelope = new Envelope(x, y, x, y); } } else { double xMin = buffer.getDouble(); double yMin = buffer.getDouble(); double xMax = buffer.getDouble(); double yMax = buffer.getDouble(); if (!isEsriNaN(xMin)) { Verify.verify(!isEsriNaN(xMax)); Verify.verify(!isEsriNaN(yMin)); Verify.verify(!isEsriNaN(yMax)); envelope = new Envelope(xMin, yMin, xMax, yMax); } } if (envelope != null) { if (overallEnvelope == null) { overallEnvelope = envelope; } else { overallEnvelope.merge(envelope); } } } } return overallEnvelope; }</code><technical_language>enum ordinal in this manner is fragile, changing order of constants in source code change ordinal. Instead, explicitly assigned value: java enum Fruit { APPLE(1), ORANGE(2); private final int id; Fruit(int id) { this.id = id; } public int id() { return id; } }</technical_language>

Target:
public static Envelope deserializeEnvelope(Slice shape) { if (shape == null) { return null; } BasicSliceInput input = shape.getInput(); Envelope overallEnvelope = null; if (input.available() > 0) { byte code = input.readByte(); boolean isGeometryCollection = (code == GeometryTypeName.GEOMETRY_COLLECTION.code()); while (input.available() > 0) { int length = isGeometryCollection ? input.readInt() : input.available(); ByteBuffer buffer = input.readSlice(length).toByteBuffer().order(LITTLE_ENDIAN); int type = buffer.getInt(); Envelope envelope = null; if (type == POINT_TYPE) { double x = buffer.getDouble(); double y = buffer.getDouble(); if (!isEsriNaN(x)) { Verify.verify(!isEsriNaN(y)); envelope = new Envelope(x, y, x, y); } } else { double xMin = buffer.getDouble(); double yMin = buffer.getDouble(); double xMax = buffer.getDouble(); double yMax = buffer.getDouble(); if (!isEsriNaN(xMin)) { Verify.verify(!isEsriNaN(xMax)); Verify.verify(!isEsriNaN(yMin)); Verify.verify(!isEsriNaN(yMax)); envelope = new Envelope(xMin, yMin, xMax, yMax); } } if (envelope != null) { if (overallEnvelope == null) { overallEnvelope = envelope; } else { overallEnvelope.merge(envelope); } } } } return overallEnvelope; }
Source:
<code>public static ColumnStatisticMetadata deserialize(String value) { int separatorIndex = value.indexOf(':'); verify(separatorIndex >= 0, "separator not found: %s", value); <START> String statisticTypeString = value.substring(0, separatorIndex); <END> String columnNameString = value.substring(separatorIndex + 1); return new ColumnStatisticMetadata(columnNameString, ColumnStatisticType.valueOf(statisticTypeString)); }</code><technical_language>This named "statisticType". "string" suffix is unnecessary</technical_language>

Target:
static ColumnStatisticMetadata deserialize(String value) { int separatorIndex = value.indexOf(':'); checkArgument(separatorIndex >= 0, "separator not found: %s", value); String statisticType = value.substring(0, separatorIndex); String column = value.substring(separatorIndex + 1); return new ColumnStatisticMetadata(column, ColumnStatisticType.valueOf(statisticType)); }
Source:
<code>public HttpRequest filter(HttpRequest request) throws HttpException { utils.logRequest(signatureLog, request, ">>"); Credentials creds = this.creds.get(); Authorization auth = cache.getUnchecked(creds); URI endpoint = request.getEndpoint(); <START> if (!endpoint.getHost().equals("localhost")) { <END> endpoint = URI.create(auth.apiUrl() + endpoint.getPath() + (endpoint.getQuery() == null ? "" : "?" + endpoint.getQuery())); } request = request.toBuilder() .endpoint(endpoint) .replaceHeader("Authorization", auth.authorizationToken()) .build(); utils.logRequest(signatureLog, request, "<<"); return request; }</code><technical_language>get rid of this, couples code tests? configure tests, json returned authorization requests return api url tests work this conditional</technical_language>

Target:
public HttpRequest filter(HttpRequest request) throws HttpException { Credentials creds = this.creds.get(); Authorization auth = this.auth.get(); URI endpoint = request.getEndpoint(); endpoint = URI.create(auth.apiUrl() + (endpoint.getPort() == -1 ? "" : ":" + endpoint.getPort()) + endpoint.getPath() + (endpoint.getQuery() == null ? "" : "?" + endpoint.getQuery())); request = request.toBuilder() .endpoint(endpoint) .replaceHeader(HttpHeaders.AUTHORIZATION, auth.authorizationToken()) .build(); return request; }
Source:
<code>public static void validateJson(String expectedJson, String actualJson, JSONCompareMode jsonCompareMode) { try { JSONAssert.assertEquals(expectedJson, actualJson, new JsonKeywordsComparator(jsonCompareMode)); } catch (JSONException e) { <START> throw new RuntimeException(e); <END> } }</code><technical_language>create carina-api exception minimize number of errors Sonar</technical_language>

Target:
public static void validateJson(String expectedJson, String actualJson, JSONCompareMode jsonCompareMode) { try { JSONAssert.assertEquals(expectedJson, actualJson, new JsonKeywordsComparator(jsonCompareMode)); } catch (JSONException e) { throw new AssertionError(e); } }
Source:
<code>void reallocate(PooledByteBuf<T> buf, int newCapacity, boolean freeOldMemory) { <START> checkPositiveOrZero(newCapacity, "newCapacity"); <END> if (newCapacity > buf.maxCapacity()) { throw new IllegalArgumentException("newCapacity: " + newCapacity); } int oldCapacity = buf.length; if (oldCapacity == newCapacity) { return; } PoolChunk<T> oldChunk = buf.chunk; ByteBuffer oldNioBuffer = buf.tmpNioBuf; long oldHandle = buf.handle; T oldMemory = buf.memory; int oldOffset = buf.offset; int oldMaxLength = buf.maxLength; int readerIndex = buf.readerIndex(); int writerIndex = buf.writerIndex(); allocate(parent.threadCache(), buf, newCapacity); if (newCapacity > oldCapacity) { memoryCopy( oldMemory, oldOffset, buf.memory, buf.offset, oldCapacity); } else if (newCapacity < oldCapacity) { if (readerIndex < newCapacity) { if (writerIndex > newCapacity) { writerIndex = newCapacity; } memoryCopy( oldMemory, oldOffset + readerIndex, buf.memory, buf.offset + readerIndex, writerIndex - readerIndex); } else { readerIndex = writerIndex = newCapacity; } } buf.setIndex(readerIndex, writerIndex); if (freeOldMemory) { free(oldChunk, oldNioBuffer, oldHandle, oldMaxLength, buf.cache); } }</code><technical_language>@thinkerou please revert this change... I prefer this if check</technical_language>

Target:
void reallocate(PooledByteBuf<T> buf, int newCapacity, boolean freeOldMemory) { if (newCapacity < 0 || newCapacity > buf.maxCapacity()) { throw new IllegalArgumentException("newCapacity: " + newCapacity); } int oldCapacity = buf.length; if (oldCapacity == newCapacity) { return; } PoolChunk<T> oldChunk = buf.chunk; ByteBuffer oldNioBuffer = buf.tmpNioBuf; long oldHandle = buf.handle; T oldMemory = buf.memory; int oldOffset = buf.offset; int oldMaxLength = buf.maxLength; int readerIndex = buf.readerIndex(); int writerIndex = buf.writerIndex(); allocate(parent.threadCache(), buf, newCapacity); if (newCapacity > oldCapacity) { memoryCopy( oldMemory, oldOffset, buf.memory, buf.offset, oldCapacity); } else if (newCapacity < oldCapacity) { if (readerIndex < newCapacity) { if (writerIndex > newCapacity) { writerIndex = newCapacity; } memoryCopy( oldMemory, oldOffset + readerIndex, buf.memory, buf.offset + readerIndex, writerIndex - readerIndex); } else { readerIndex = writerIndex = newCapacity; } } buf.setIndex(readerIndex, writerIndex); if (freeOldMemory) { free(oldChunk, oldNioBuffer, oldHandle, oldMaxLength, buf.cache); } }
Source:
<code>public void writeExternal(DataOutputStream out) throws IOException { ExtUtil.write(out, nodesetRef); ExtUtil.write(out, new ExtWrapTagged(nodesetExpr)); ExtUtil.write(out, contextRef); ExtUtil.write(out, labelRef); ExtUtil.write(out, new ExtWrapTagged(labelExpr)); ExtUtil.write(out, new ExtWrapNullable(valueRef)); ExtUtil.write(out, new ExtWrapNullable(valueExpr == null ? null : new ExtWrapTagged(valueExpr))); ExtUtil.write(out, new ExtWrapNullable(copyRef)); ExtUtil.writeBool(out, labelIsItext); ExtUtil.writeBool(out, copyMode); <START> ExtUtil.write(out, sortRef); <END> ExtUtil.write(out, new ExtWrapTagged(sortExpr)); }</code><technical_language>Do need wrapped in ExtWrapNullable</technical_language>

Target:
public void writeExternal(DataOutputStream out) throws IOException { ExtUtil.write(out, nodesetRef); ExtUtil.write(out, new ExtWrapTagged(nodesetExpr)); ExtUtil.write(out, contextRef); ExtUtil.write(out, labelRef); ExtUtil.write(out, new ExtWrapTagged(labelExpr)); ExtUtil.write(out, new ExtWrapNullable(valueRef)); ExtUtil.write(out, new ExtWrapNullable(valueExpr == null ? null : new ExtWrapTagged(valueExpr))); ExtUtil.write(out, new ExtWrapNullable(copyRef)); ExtUtil.writeBool(out, labelIsItext); ExtUtil.writeBool(out, copyMode); ExtUtil.write(out, new ExtWrapNullable(sortRef)); ExtUtil.write(out, new ExtWrapNullable(sortExpr == null ? null : new ExtWrapTagged(sortExpr))); }
Source:
<code>private List<String> getTrashedResourcesId(List<String> resourceIds, List<String> archivedResources) { List<String> trashedResources = null; Iterator<String> it = resourceIds.iterator(); String id = null; while (it.hasNext()) { id = (String) it.next(); if (null == archivedResources || !archivedResources.contains(id)) { ResourceInterface resourceInterface = null; try { resourceInterface = this.getTrashedResourceManager().loadTrashedResource(id); if (null != resourceInterface) { if (null == trashedResources) { trashedResources = new ArrayList<String>(); } trashedResources.add(id); } } catch (Throwable t) { <START> logger.error("Errore in verifica risorsa " + id, t); <END> throw new RuntimeException("Errore in verifica risorsa cestinata, id " + id, t); } } } return trashedResources; }</code><technical_language>Translate this log message in English please</technical_language>

Target:
private List<String> getTrashedResourcesId(List<String> resourceIds, List<String> archivedResources) { List<String> trashedResources = null; Iterator<String> it = resourceIds.iterator(); String id = null; while (it.hasNext()) { id = (String) it.next(); if (null == archivedResources || !archivedResources.contains(id)) { ResourceInterface resourceInterface = null; try { resourceInterface = this.getTrashedResourceManager().loadTrashedResource(id); if (null != resourceInterface) { if (null == trashedResources) { trashedResources = new ArrayList<>(); } trashedResources.add(id); } } catch (Throwable t) { logger.error("Error checking resource " + id, t); throw new RuntimeException("Error checking resource " + id, t); } } } return trashedResources; }
Source:
<code>private void addMetadataHeaderLine(final VCFHeaderLine line) { if ( line instanceof VCFInfoHeaderLine ) { final VCFInfoHeaderLine infoLine = (VCFInfoHeaderLine)line; addMetaDataMapBinding(mInfoMetaData, infoLine); } else if ( line instanceof VCFFormatHeaderLine ) { final VCFFormatHeaderLine formatLine = (VCFFormatHeaderLine)line; addMetaDataMapBinding(mFormatMetaData, formatLine); if ( hasFormatLine(VCFConstants.GENOTYPE_LIKELIHOODS_KEY) && ! hasFormatLine(VCFConstants.GENOTYPE_PL_KEY) ) { if ( GeneralUtils.DEBUG_MODE_ENABLED ) { System.err.println("Found " + VCFConstants.GENOTYPE_LIKELIHOODS_KEY + " format, but no " + VCFConstants.GENOTYPE_PL_KEY + " field. We now only manage PL fields internally" + " automatically adding a corresponding PL field to your VCF header"); } addMetaDataLine(new VCFFormatHeaderLine(VCFConstants.GENOTYPE_PL_KEY, VCFHeaderLineCount.G, VCFHeaderLineType.Integer, "Normalized, Phred-scaled likelihoods for genotypes as defined in the VCF specification")); } } else if ( line instanceof VCFFilterHeaderLine ) { final VCFFilterHeaderLine filterLine = (VCFFilterHeaderLine)line; mFilterMetaData.put(filterLine.getID(), filterLine); } else if ( line instanceof VCFContigHeaderLine ) { <START> contigMetaData.add((VCFContigHeaderLine)line); <END> } else { mOtherMetaData.put(line.getKey(), line); } }</code><technical_language>checking adding a duplicate contig declaration contigMetaData</technical_language>

Target:
private void addMetadataHeaderLine(final VCFHeaderLine line) { if ( line instanceof VCFInfoHeaderLine ) { final VCFInfoHeaderLine infoLine = (VCFInfoHeaderLine)line; addMetaDataMapBinding(mInfoMetaData, infoLine.getID(), infoLine); } else if ( line instanceof VCFFormatHeaderLine ) { final VCFFormatHeaderLine formatLine = (VCFFormatHeaderLine)line; addMetaDataMapBinding(mFormatMetaData, formatLine.getID(), formatLine); if ( hasFormatLine(VCFConstants.GENOTYPE_LIKELIHOODS_KEY) && ! hasFormatLine(VCFConstants.GENOTYPE_PL_KEY) ) { if ( GeneralUtils.DEBUG_MODE_ENABLED ) { System.err.println("Found " + VCFConstants.GENOTYPE_LIKELIHOODS_KEY + " format, but no " + VCFConstants.GENOTYPE_PL_KEY + " field. We now only manage PL fields internally" + " automatically adding a corresponding PL field to your VCF header"); } addMetadataHeaderLine(new VCFFormatHeaderLine(VCFConstants.GENOTYPE_PL_KEY, VCFHeaderLineCount.G, VCFHeaderLineType.Integer, "Normalized, Phred-scaled likelihoods for genotypes as defined in the VCF specification")); } } else if ( line instanceof VCFFilterHeaderLine ) { final VCFFilterHeaderLine filterLine = (VCFFilterHeaderLine)line; addMetaDataMapBinding(mFilterMetaData, filterLine.getID(), filterLine); } else if ( line instanceof VCFContigHeaderLine ) { addContigMetaDataLine((VCFContigHeaderLine) line); } else { addMetaDataMapBinding(mOtherMetaData, line.getKey(), line); } }
Source:
<code>public DynamicBooleanProperty(String propName, boolean defaultValue) { super(propName, Boolean.valueOf(defaultValue)); this.primitiveValue = chooseValue(); <START> this.prop.addCallback(new Runnable() { <END> @Override public void run() { primitiveValue = chooseValue(); } }); }</code><technical_language>adding this callback here, override of propertyChanged methods update PropertyWrapper class add this class SUBCLASSES_WITH_NO_CALLBACK map. This cleaner result in code</technical_language>

Target:
public DynamicBooleanProperty(String propName, boolean defaultValue) { super(propName, Boolean.valueOf(defaultValue)); }
Source:
<code>static List<Interval> sortAndAddSkipIntervalFromLatest( DateTime latest, Period skipOffset, @Nullable List<Interval> skipIntervals ) { final List<Interval> nonNullSkipIntervals = skipIntervals == null <START> ? new ArrayList<>() <END> : new ArrayList<>(skipIntervals.size()); if (skipIntervals != null) { final List<Interval> sortedSkipIntervals = new ArrayList<>(skipIntervals); sortedSkipIntervals.sort(Comparators.intervalsByStartThenEnd()); final List<Interval> overlapIntervals = new ArrayList<>(); final Interval skipFromLatest = new Interval(skipOffset, latest); for (Interval interval : sortedSkipIntervals) { if (interval.overlaps(skipFromLatest)) { overlapIntervals.add(interval); } else { nonNullSkipIntervals.add(interval); } } if (!overlapIntervals.isEmpty()) { overlapIntervals.add(skipFromLatest); nonNullSkipIntervals.add(JodaUtils.umbrellaInterval(overlapIntervals)); } else { nonNullSkipIntervals.add(skipFromLatest); } } else { final Interval skipFromLatest = new Interval(skipOffset, latest); nonNullSkipIntervals.add(skipFromLatest); } return nonNullSkipIntervals; }</code><technical_language>new ArrayList<>(1) better</technical_language>

Target:
static List<Interval> sortAndAddSkipIntervalFromLatest( DateTime latest, Period skipOffset, @Nullable List<Interval> skipIntervals ) { final List<Interval> nonNullSkipIntervals = skipIntervals == null ? new ArrayList<>(1) : new ArrayList<>(skipIntervals.size()); if (skipIntervals != null) { final List<Interval> sortedSkipIntervals = new ArrayList<>(skipIntervals); sortedSkipIntervals.sort(Comparators.intervalsByStartThenEnd()); final List<Interval> overlapIntervals = new ArrayList<>(); final Interval skipFromLatest = new Interval(skipOffset, latest); for (Interval interval : sortedSkipIntervals) { if (interval.overlaps(skipFromLatest)) { overlapIntervals.add(interval); } else { nonNullSkipIntervals.add(interval); } } if (!overlapIntervals.isEmpty()) { overlapIntervals.add(skipFromLatest); nonNullSkipIntervals.add(JodaUtils.umbrellaInterval(overlapIntervals)); } else { nonNullSkipIntervals.add(skipFromLatest); } } else { final Interval skipFromLatest = new Interval(skipOffset, latest); nonNullSkipIntervals.add(skipFromLatest); } return nonNullSkipIntervals; }
Source:
<code>DockerRegistryToken getToken(Item context) { if (credentialsId == null) { return null; } List<DomainRequirement> requirements = Collections.emptyList(); try { requirements = Collections.<DomainRequirement>singletonList(new HostnameRequirement(getEffectiveUrl().getHost())); } catch (IOException e) { } <START> Authentication runAuth = context instanceof Queue.Task ? <END> Tasks.getAuthenticationOf((Queue.Task) context) : ACL.SYSTEM; List<IdCredentials> candidates = new ArrayList(); candidates.addAll(CredentialsProvider.lookupCredentials(IdCredentials.class, context, runAuth, requirements)); if (runAuth != ACL.SYSTEM && context.getACL().hasPermission(runAuth, CredentialsProvider.USE_ITEM)) { candidates.addAll(CredentialsProvider.lookupCredentials(IdCredentials.class, context, ACL.SYSTEM, requirements)); } return AuthenticationTokens.convert(DockerRegistryToken.class, firstOrNull(candidates, allOf(AuthenticationTokens.matcher(DockerRegistryToken.class), withId(credentialsId)))); }</code><technical_language>getToken(Item) patched if this method longer used</technical_language>

Target:
public @CheckForNull DockerRegistryToken getToken(Item context) { if (credentialsId == null) { return null; } List<DomainRequirement> requirements = Collections.emptyList(); try { requirements = Collections.<DomainRequirement>singletonList(new HostnameRequirement(getEffectiveUrl().getHost())); } catch (IOException e) { } return AuthenticationTokens.convert(DockerRegistryToken.class, firstOrNull(CredentialsProvider.lookupCredentials( IdCredentials.class, context, Jenkins.getAuthentication(), requirements), allOf(AuthenticationTokens.matcher(DockerRegistryToken.class), withId(credentialsId)))); }
Source:
<code>OperationController() throws IOException { try { <START> ConnectionManagerFactory connectionManagerFactory = Utils <END> .getObj(routerConfig.routerConnectionManagerFactory, networkMetrics, networkConfig, sslConfig, routerConfig.routerMaxConnectionsPerPortPlainText, routerConfig.routerMaxConnectionsPerPortSsl, time); connectionManager = connectionManagerFactory.getConnectionManager(); } catch (Exception e) { throw new IOException("Could not create connection manager using the given connection manager " + "factory"); } putManager = new PutManager(routerConfig.routerMaxPutChunkSizeBytes, connectionManager, routerConfig, clusterMap); getManager = new GetManager(connectionManager, clusterMap); deleteManager = new DeleteManager(connectionManager, clusterMap); requestResponseHandlerThread = Utils.newThread("RequestResponseHandlerThread", this, true); requestResponseHandlerThread.start(); }</code><technical_language>move this NonBlockingRouterFactory pass in factory NonBlockingRouter</technical_language>

Target:
OperationController() throws IOException { RouterNetworkComponents networkComponents = routerNetworkComponentsFactory.getRouterNetworkComponents(); selector = networkComponents.getSelector(); connectionManager = networkComponents.getConnectionManager(); putManager = new PutManager(routerConfig.routerMaxPutChunkSizeBytes, connectionManager, routerConfig, clusterMap); getManager = new GetManager(connectionManager, clusterMap); deleteManager = new DeleteManager(connectionManager, clusterMap); requestResponseHandlerThread = Utils.newThread("RequestResponseHandlerThread", this, true); requestResponseHandlerThread.start(); }
Source:
<code>private void setupListHeaderView() { View headerView = getLayoutInflater().inflate(R.layout.activity_claim_header, getListView(), false); nameField = (EditText)headerView.findViewById(R.id.et_name); nameField.setText(claim.getName()); descriptionField = (EditText)headerView.findViewById(R.id.et_description); descriptionField.setText(claim.getDescription()); startDateField = (DateEditText)headerView.findViewById(R.id.et_start_date); startDateField.setDate(claim.getStartDate()); startDateField.setOnDateChangedListener(new DateEditText.OnDateChangedListener() { @Override public void onDateChanged(DateEditText view, Date date) { endDateField.setMinDate(date); } }); endDateField = (DateEditText)headerView.findViewById(R.id.et_end_date); endDateField.setDate(claim.getEndDate()); endDateField.setOnDateChangedListener(new DateEditText.OnDateChangedListener() { @Override public void onDateChanged(DateEditText view, Date date) { startDateField.setMaxDate(date); } }); userField = (TextView)headerView.findViewById(R.id.tv_user); userField.append(claim.getUser().getName()); approverField = (TextView)headerView.findViewById(R.id.tv_approver); <START> try{ <END> approverField.append(claim.getApprover().getName()); } catch(NullPointerException e){ } comments = (EditText)headerView.findViewById(R.id.et_comments); comments.setText(claim.getComments()); getListView().addHeaderView(headerView); }</code><technical_language>In cases this throw a NullPointerException</technical_language>

Target:
private void setupListHeaderView() { View headerView = getLayoutInflater().inflate(R.layout.activity_claim_header, getListView(), false); nameField = (EditText)headerView.findViewById(R.id.et_name); nameField.setText(claim.getName()); descriptionField = (EditText)headerView.findViewById(R.id.et_description); descriptionField.setText(claim.getDescription()); startDateField = (DateEditText)headerView.findViewById(R.id.et_start_date); startDateField.setDate(claim.getStartDate()); startDateField.setOnDateChangedListener(new DateEditText.OnDateChangedListener() { @Override public void onDateChanged(DateEditText view, Date date) { endDateField.setMinDate(date); } }); endDateField = (DateEditText)headerView.findViewById(R.id.et_end_date); endDateField.setDate(claim.getEndDate()); endDateField.setOnDateChangedListener(new DateEditText.OnDateChangedListener() { @Override public void onDateChanged(DateEditText view, Date date) { startDateField.setMaxDate(date); } }); userField = (TextView)headerView.findViewById(R.id.tv_user); userField.append(claim.getUser().getName()); approverField = (TextView)headerView.findViewById(R.id.tv_approver); approverField.append(claim.getApprover().getName()); comments = (EditText)headerView.findViewById(R.id.et_comments); comments.setText(claim.getComments()); getListView().addHeaderView(headerView); }
Source:
<code>private File prepareSiteTest(String testPath, String latestDir) throws Exception { File testDir = prepareSiteTest(testPath); File testTargetDir = this.buildFile(testDir, "target", "pit-reports"); DirectoriesOnlyWalker walker = new DirectoriesOnlyWalker(); for(File f : walker.locateDirectories(testTargetDir)) { f.setLastModified(0L); } <START> buildFile(testTargetDir, latestDir).setLastModified(System.currentTimeMillis()); <END> return testDir; }</code><technical_language>kind rename method buildFile() buildFilePath() this describes more does. Thx</technical_language>

Target:
private File prepareSiteTest(String testPath, String latestDir) throws Exception { File testDir = prepareSiteTest(testPath); File testTargetDir = this.buildFilePath(testDir, "target", "pit-reports"); DirectoriesOnlyWalker walker = new DirectoriesOnlyWalker(); for(File f : walker.locateDirectories(testTargetDir)) { f.setLastModified(0L); } assertThat(buildFilePath(testTargetDir, latestDir).setLastModified(System.currentTimeMillis())).isTrue(); return testDir; }
Source:
<code>public FilterDTO update(final FilterDTO dto) throws EntityRetrievalException { <START> FilterEntity entity = new FilterEntity(); <END> entity.setFilter(dto.getFilter()); entity.setLastModifiedUser(Util.getAuditId()); entity.setFilterType(new FilterTypeEntity()); entity.getFilterType().setId(dto.getFilterType().getId()); entity.getFilterType().setName(dto.getFilterType().getName()); entity.setUser(getUserEntityById(dto.getUser().getId())); entity.setDeleted(false); entity.setLastModifiedUser(Util.getAuditId()); entityManager.merge(entity); entityManager.flush(); return new FilterDTO(entity); }</code><technical_language>is this updating? I thought for update method get FilterEntity ID fill in rest of values done this is creating a new FilterEntity setting ID field. end inserting a new row update existing one</technical_language>

Target:
public FilterDTO update(final FilterDTO dto) throws EntityRetrievalException { FilterEntity entity = getEntityById(dto.getId()); entity.setFilter(dto.getFilter()); entity.setLastModifiedUser(Util.getAuditId()); entity.setFilterType(new FilterTypeEntity()); entity.getFilterType().setId(dto.getFilterType().getId()); entity.getFilterType().setName(dto.getFilterType().getName()); entity.setUserId(dto.getUser().getId()); entity.setDeleted(false); entity.setLastModifiedUser(Util.getAuditId()); entityManager.merge(entity); entityManager.flush(); return new FilterDTO(entity); }
Source:
<code>protected SSHClient connect(String serverName) { <START> SSHClient client = new SSHClient(); <END> Integer timeout = Config.<Integer> GetValue(ConfigValues.ConnectToServerTimeoutInSeconds) * 1000; client.setHardTimeout(timeout); client.setSoftTimeout(timeout); client.setHost(serverName, SSH_PORT); try { client.connect(); return client; } catch (Exception e) { log.debug(String.format("Could not connect to server %1$s: %2$s", serverName, e.getMessage())); throw new RuntimeException(e); } }</code><technical_language>why? set _vds, if _vds is null do enforce. I talked this. engine interfaces</technical_language>

Target:
protected EngineSSHClient connect(String serverName) { EngineSSHClient client = new EngineSSHClient(); Integer timeout = Config.<Integer> GetValue(ConfigValues.ConnectToServerTimeoutInSeconds) * 1000; client.setHardTimeout(timeout); client.setSoftTimeout(timeout); client.setHost(serverName, SSH_PORT); try { client.connect(); return client; } catch (Exception e) { log.debug(String.format("Could not connect to server %1$s: %2$s", serverName, e.getMessage())); throw new RuntimeException(e); } }