auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private static void addHostBondDevices(VDS vds, Map<String, Object> xmlRpcStruct) { Map<String, Map<String, Object>> bonds = (Map<String, Map<String, Object>>) xmlRpcStruct.get(VdsProperties.NETWORK_BONDINGS); if (bonds != null) { for (Entry<String, Map<String, Object>> entry : bonds.entrySet()) { VdsNetworkInterface iface = new Bond(); updateCommonInterfaceData(iface, vds, entry); iface.setBonded(true); Map<String, Object> bond = entry.getValue(); if (bond != null) { iface.setMacAddress((String) bond.get("hwaddr")); if (bond.get("slaves") != null) { addBondDeviceToHost(vds, iface, (Object[]) bond.get("slaves")); } Object bondOptions = null; <START> if (FeatureSupported.cfgEntriesDeprecated(vds.getVdsGroupCompatibilityVersion())) { <END> bondOptions = bond.get("opts"); } else { Map<String, Object> config = (Map<String, Object>) bond.get("cfg"); bondOptions = (config == null) ? null : config.get("BONDING_OPTS"); } if (bondOptions != null) { iface.setBondOptions(bondOptions.toString()); } } } } }</code><technical_language>this evaluated of for loop</technical_language>

Target:
private static void addHostBondDevices(VDS vds, Map<String, Object> xmlRpcStruct) { Map<String, Map<String, Object>> bonds = (Map<String, Map<String, Object>>) xmlRpcStruct.get(VdsProperties.NETWORK_BONDINGS); if (bonds != null) { boolean cfgEntriesDeprecated = FeatureSupported.cfgEntriesDeprecated(vds.getVdsGroupCompatibilityVersion()); for (Entry<String, Map<String, Object>> entry : bonds.entrySet()) { VdsNetworkInterface iface = new Bond(); updateCommonInterfaceData(iface, vds, entry); iface.setBonded(true); Map<String, Object> bond = entry.getValue(); if (bond != null) { iface.setMacAddress((String) bond.get("hwaddr")); if (bond.get("slaves") != null) { addBondDeviceToHost(vds, iface, (Object[]) bond.get("slaves")); } Object bondOptions = null; if (cfgEntriesDeprecated) { bondOptions = bond.get("opts"); } else { Map<String, Object> config = (Map<String, Object>) bond.get("cfg"); bondOptions = (config == null) ? null : config.get("BONDING_OPTS"); } if (bondOptions != null) { iface.setBondOptions(bondOptions.toString()); } } } } }
Source:
<code>public void edit(final UnitVmModel model) { Driver.driver.edit(model); model.getStorageDomain().getItemsChangedEvent().addListener(new IEventListener() { @Override public void eventRaised(Event ev, Object sender, EventArgs args) { addDiskAllocation(model); } }); model.getStorageDomain().getPropertyChangedEvent().addListener(new IEventListener() { @Override public void eventRaised(Event ev, Object sender, EventArgs args) { boolean isDisksAllocationEnabled = model.getDisks() != null && !model.getDisks().isEmpty(); disksAllocationView.setEnabled(isDisksAllocationEnabled); disksAllocationLabel.getElement().getStyle().setColor(isDisksAllocationEnabled ? "black" : "grey"); } }); model.getPropertyChangedEvent().addListener(new IEventListener() { @Override public void eventRaised(Event ev, Object sender, EventArgs args) { String propName = ((PropertyChangedEventArgs) args).PropertyName; if ("Message".equals(propName)) { <START> VmMakeTemplatePopupWidget.this.setMessage(model.getMessage()); <END> } } }); }</code><technical_language>'VmMakeTemplatePopupWidget.this' removed. Rename 'setMessage' 'appendMessage'</technical_language>

Target:
public void edit(final UnitVmModel model) { Driver.driver.edit(model); model.getStorageDomain().getItemsChangedEvent().addListener(new IEventListener() { @Override public void eventRaised(Event ev, Object sender, EventArgs args) { addDiskAllocation(model); } }); model.getStorageDomain().getPropertyChangedEvent().addListener(new IEventListener() { @Override public void eventRaised(Event ev, Object sender, EventArgs args) { boolean isDisksAllocationEnabled = model.getDisks() != null && !model.getDisks().isEmpty(); disksAllocationView.setEnabled(isDisksAllocationEnabled); disksAllocationLabel.getElement().getStyle().setColor(isDisksAllocationEnabled ? "black" : "grey"); } }); model.getPropertyChangedEvent().addListener(new IEventListener() { @Override public void eventRaised(Event ev, Object sender, EventArgs args) { String propName = ((PropertyChangedEventArgs) args).PropertyName; if ("Message".equals(propName)) { appendMessage(model.getMessage()); } } }); }
Source:
<code>protected ShoppingListUpdateCommand buildRequest(final ShoppingList wishlist, final RemoveWishlistLineItemFormData removeWishlistFormData) { final LineItem lineItemToRemove = wishlist.getLineItems().stream() .filter(lineItem -> removeWishlistFormData.lineItemId().equals(lineItem.getId())) .findFirst() .get(); <START> final RemoveLineItem removeLineItem = RemoveLineItem.of(lineItemToRemove); <END> return ShoppingListUpdateCommand.of(wishlist, removeLineItem); }</code><technical_language>streams find line item? RemoveLineItem accepts a lineItemId directly</technical_language>

Target:
protected ShoppingListUpdateCommand buildRequest(final ShoppingList wishlist, final RemoveWishlistLineItemFormData removeWishlistFormData) { final RemoveLineItem removeLineItem = RemoveLineItem.of(removeWishlistFormData.lineItemId()); return ShoppingListUpdateCommand.of(wishlist, removeLineItem); }
Source:
<code><START> public Map<String, Object> toObject() { <END> final HashMap<String, Object> flowObj = new HashMap<>(); fillMapFromExecutable(flowObj); flowObj.put(EXECUTIONID_PARAM, this.executionId); flowObj.put(EXECUTIONPATH_PARAM, this.executionPath); flowObj.put(PROJECTID_PARAM, this.projectId); flowObj.put(PROJECTNAME_PARAM, this.projectName); if (this.scheduleId >= 0) { flowObj.put(SCHEDULEID_PARAM, this.scheduleId); } flowObj.put(SUBMITUSER_PARAM, this.submitUser); flowObj.put(VERSION_PARAM, this.version); flowObj.put(LASTMODIFIEDTIME_PARAM, this.lastModifiedTimestamp); flowObj.put(LASTMODIFIEDUSER_PARAM, this.lastModifiedUser); flowObj.put(AZKABANFLOWVERSION_PARAM, this.azkabanFlowVersion); flowObj.put(EXECUTIONOPTIONS_PARAM, this.executionOptions.toObject()); final ArrayList<String> proxyUserList = new ArrayList<>(this.proxyUsers); flowObj.put(PROXYUSERS_PARAM, proxyUserList); flowObj.put(SUBMITTIME_PARAM, this.submitTime); final List<Map<String, Object>> slaOptions = new ArrayList<>(); this.executionOptions.getSlaOptions().stream() .forEach((slaOption) -> slaOptions.add(slaOption.toObject())); flowObj.put(SLAOPTIONS_PARAM, slaOptions); return flowObj; }</code><technical_language>locked info in DB? If yes, I need fill isLocked field in ExecutableFlow object</technical_language>

Target:
public Map<String, Object> toObject() { final HashMap<String, Object> flowObj = new HashMap<>(); fillMapFromExecutable(flowObj); flowObj.put(EXECUTIONID_PARAM, this.executionId); flowObj.put(EXECUTIONPATH_PARAM, this.executionPath); flowObj.put(PROJECTID_PARAM, this.projectId); flowObj.put(PROJECTNAME_PARAM, this.projectName); if (this.scheduleId >= 0) { flowObj.put(SCHEDULEID_PARAM, this.scheduleId); } flowObj.put(SUBMITUSER_PARAM, this.submitUser); flowObj.put(VERSION_PARAM, this.version); flowObj.put(LASTMODIFIEDTIME_PARAM, this.lastModifiedTimestamp); flowObj.put(LASTMODIFIEDUSER_PARAM, this.lastModifiedUser); flowObj.put(AZKABANFLOWVERSION_PARAM, this.azkabanFlowVersion); flowObj.put(EXECUTIONOPTIONS_PARAM, this.executionOptions.toObject()); final ArrayList<String> proxyUserList = new ArrayList<>(this.proxyUsers); flowObj.put(PROXYUSERS_PARAM, proxyUserList); flowObj.put(SUBMITTIME_PARAM, this.submitTime); final List<Map<String, Object>> slaOptions = new ArrayList<>(); this.executionOptions.getSlaOptions().stream() .forEach((slaOption) -> slaOptions.add(slaOption.toObject())); flowObj.put(SLAOPTIONS_PARAM, slaOptions); flowObj.put(IS_LOCKED_PARAM, this.isLocked); return flowObj; }
Source:
<code>public boolean start() throws Exception { Cloud cloud = Jenkins.getActiveInstance().getCloud(step.getCloud()); if (cloud == null) { throw new AbortException(String.format("Cloud does not exist: %s", step.getCloud())); } if (!(cloud instanceof KubernetesCloud)) { throw new AbortException(String.format("Cloud is not a Kubernetes cloud: %s (%s)", step.getCloud(), cloud.getClass().getName())); } KubernetesCloud kubernetesCloud = (KubernetesCloud) cloud; String name = String.format(NAME_FORMAT, UUID.randomUUID().toString().replaceAll("-", "")); PodTemplateAction action = new PodTemplateAction(step.getRun()); PodTemplate newTemplate = new PodTemplate(); newTemplate.setName(name); newTemplate.setInheritFrom(!Strings.isNullOrEmpty( action.getParentTemplates()) ? action.getParentTemplates() : step.getInheritFrom()); newTemplate.setInstanceCap(step.getInstanceCap()); newTemplate.setLabel(step.getLabel()); newTemplate.setVolumes(step.getVolumes()); newTemplate.setCustomWorkspaceVolumeEnabled(step.getWorkspaceVolume() != null); newTemplate.setWorkspaceVolume(step.getWorkspaceVolume()); newTemplate.setContainers(step.getContainers()); newTemplate.setNodeSelector(step.getNodeSelector()); newTemplate.setServiceAccount(step.getServiceAccount()); <START> newTemplate.setAnnotations(step.getAnnotations()); <END> kubernetesCloud.addTemplate(newTemplate); getContext().newBodyInvoker() .withCallback(new PodTemplateCallback(newTemplate)) .start(); action.push(step.getLabel()); return false; }</code><technical_language>FYI upgrading getAnnotations() is null, is loaded xml config exist, checked API break a null value</technical_language>

Target:
public boolean start() throws Exception { Cloud cloud = Jenkins.getInstance().getCloud(step.getCloud()); if (cloud == null) { throw new AbortException(String.format("Cloud does not exist: %s", step.getCloud())); } if (!(cloud instanceof KubernetesCloud)) { throw new AbortException(String.format("Cloud is not a Kubernetes cloud: %s (%s)", step.getCloud(), cloud.getClass().getName())); } KubernetesCloud kubernetesCloud = (KubernetesCloud) cloud; String name = String.format(NAME_FORMAT, UUID.randomUUID().toString().replaceAll("-", "")); PodTemplateAction action = new PodTemplateAction(getContext().get(Run.class)); PodTemplate newTemplate = new PodTemplate(); newTemplate.setName(name); newTemplate.setInheritFrom(!Strings.isNullOrEmpty( action.getParentTemplates()) ? action.getParentTemplates() : step.getInheritFrom()); newTemplate.setInstanceCap(step.getInstanceCap()); newTemplate.setLabel(step.getLabel()); newTemplate.setVolumes(step.getVolumes()); newTemplate.setCustomWorkspaceVolumeEnabled(step.getWorkspaceVolume() != null); newTemplate.setWorkspaceVolume(step.getWorkspaceVolume()); newTemplate.setContainers(step.getContainers()); newTemplate.setNodeSelector(step.getNodeSelector()); newTemplate.setServiceAccount(step.getServiceAccount()); newTemplate.setAnnotations(step.getAnnotations()); kubernetesCloud.addTemplate(newTemplate); getContext().newBodyInvoker().withContext(step).withCallback(new PodTemplateCallback(newTemplate)).start(); action.push(step.getLabel()); return false; }
Source:
<code>private static void restoreViews() { for (IWorkbenchWindow window : PlatformUI.getWorkbench().getWorkbenchWindows()) { <START> for (IWorkbenchPage page : window.getPages()) { <END> for (IViewReference ref : page.getViewReferences()) { IViewPart view = ref.getView(false); if (view instanceof TmfView && view instanceof ITmfTimeAligned) { ITmfTimeAligned alignedView = (ITmfTimeAligned) view; alignedView.performAlign(alignedView.getTimeViewAlignmentInfo().getTimeAxisOffset(), Integer.MAX_VALUE); } } } } }</code><technical_language>extract restorePage</technical_language>

Target:
private static void restoreViews() { for (IWorkbenchWindow window : PlatformUI.getWorkbench().getWorkbenchWindows()) { for (IWorkbenchPage page : window.getPages()) { for (IViewReference ref : page.getViewReferences()) { restoreView(ref); } } } }
Source:
<code>public void testLargeData() { int length = 123456789; byte[] expected = new byte[length]; <START> ThreadLocalRandom.current().nextBytes(expected); <END> List<byte[]> buffers = new ArrayList<>(); int copyBytes = 0; while (copyBytes < length) { int currentLength = min(length - copyBytes, ThreadLocalRandom.current().nextInt(1 << 20) + 64); buffers.add(Arrays.copyOfRange(expected, copyBytes, copyBytes + currentLength)); copyBytes += currentLength; } try (GatheringByteArrayInputStream in = new GatheringByteArrayInputStream(buffers, length)) { byte[] actual = new byte[length]; copyBytes = 0; while (copyBytes < length) { int currentLength = min(length - copyBytes, ThreadLocalRandom.current().nextInt(1 << 20) + 64); assertEquals(in.read(actual, copyBytes, currentLength), currentLength); assertByteArrayEquals(actual, copyBytes, expected, copyBytes, currentLength); copyBytes += currentLength; } assertEquals(in.skip(100), 0); assertEquals(in.read(), -1); } }</code><technical_language>new Random(0) instead get a consistent test</technical_language>

Target:
public void testLargeData() { int length = 123456789; Random random = new Random(0); byte[] expected = new byte[length]; random.nextBytes(expected); List<byte[]> buffers = new ArrayList<>(); int copyBytes = 0; while (copyBytes < length) { int currentLength = min(length - copyBytes, random.nextInt(1 << 20) + 64); buffers.add(Arrays.copyOfRange(expected, copyBytes, copyBytes + currentLength)); copyBytes += currentLength; } try (GatheringByteArrayInputStream in = new GatheringByteArrayInputStream(buffers, length)) { byte[] actual = new byte[length]; copyBytes = 0; while (copyBytes < length) { int currentLength = min(length - copyBytes, random.nextInt(1 << 20) + 64); assertEquals(in.read(actual, copyBytes, currentLength), currentLength); assertByteArrayEquals(actual, copyBytes, expected, copyBytes, currentLength); copyBytes += currentLength; } assertEquals(in.skip(100), 0); assertEquals(in.read(), -1); } }
Source:
<code>public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((id == null) ? 0 : id.hashCode()); result = prime * result + ((description == null) ? 0 : description.hashCode()); result = prime * result + (readOnly ? 1231 : 1237); result = prime * result + ((name == null) ? 0 : name.hashCode()); result = prime * result + ((type == null) ? 0 : type.hashCode()); <START> result = prime * result + ((appMode == null) ? ApplicationMode.VirtOnly.getValue() : appMode.getValue()); <END> return result; }</code><technical_language>this VirtOnly</technical_language>

Target:
public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((id == null) ? 0 : id.hashCode()); result = prime * result + ((description == null) ? 0 : description.hashCode()); result = prime * result + (readOnly ? 1231 : 1237); result = prime * result + ((name == null) ? 0 : name.hashCode()); result = prime * result + ((type == null) ? 0 : type.hashCode()); result = prime * result + ((appMode == null) ? 0 : appMode.getValue()); return result; }
Source:
<code>private void assertBucketFilter(Plan plan, String tableName, int readBucketCount, Set<Integer> bucketsToKeep) { TableScanNode tableScan = searchFrom(plan.getRoot()) .where(node -> isTableScanNode(node, tableName)) .findOnlyElement(); assertTrue(tableScan.getTable().getLayout().isPresent()); HiveTableLayoutHandle layoutHandle = (HiveTableLayoutHandle) tableScan.getTable().getLayout().get(); assertEquals(layoutHandle.getBucketHandle().get().getReadBucketCount(), readBucketCount); assertEquals(layoutHandle.getBucketFilter().get().getBucketsToKeep(), bucketsToKeep); <START> } <END></code><technical_language>@gparai add assertTrue(layoutHandle. getBucketHandle().isPresent()); assertTrue(layoutHandle.getBucketFilter().isPresent());</technical_language>

Target:
private void assertBucketFilter(Plan plan, String tableName, int readBucketCount, Set<Integer> bucketsToKeep) { TableScanNode tableScan = searchFrom(plan.getRoot()) .where(node -> isTableScanNode(node, tableName)) .findOnlyElement(); assertTrue(tableScan.getTable().getLayout().isPresent()); HiveTableLayoutHandle layoutHandle = (HiveTableLayoutHandle) tableScan.getTable().getLayout().get(); assertTrue(layoutHandle.getBucketHandle().isPresent()); assertTrue(layoutHandle.getBucketFilter().isPresent()); assertEquals(layoutHandle.getBucketHandle().get().getReadBucketCount(), readBucketCount); assertEquals(layoutHandle.getBucketFilter().get().getBucketsToKeep(), bucketsToKeep); }
Source:
<code><START> protected void handleConnectionSelected() throws CoreException { <END> final boolean enabled = fWidgetListener.isEnabled(); fWidgetListener.disable(); IRemoteConnection selectedConnection = null; if (fLocalButton != null && fLocalButton.getSelection()) { selectedConnection = fRemoteServicesManager.getLocalConnectionType().getConnections().get(0); } else { int currentSelection = fConnectionCombo.getSelectionIndex(); if (currentSelection > 0) { String connectionName = fConnectionCombo.getItem(currentSelection); selectedConnection = getSelectedConnectionType().getConnection(connectionName); } } if (selectedConnection == null || fSelectedConnection == null || !selectedConnection.getName().equals(fSelectedConnection.getName())) { fSelectedConnection = selectedConnection; Event evt = new Event(); evt.widget = this; notifyListeners(new SelectionEvent(evt)); } fWidgetListener.setEnabled(enabled); }</code><technical_language>I reason throw CoreException here</technical_language>

Target:
protected void handleConnectionSelected() { final boolean enabled = fWidgetListener.isEnabled(); fWidgetListener.disable(); IRemoteConnection selectedConnection = null; if (fLocalButton != null && fLocalButton.getSelection()) { selectedConnection = fRemoteServicesManager.getLocalConnectionType().getConnections().get(0); } else { int currentSelection = fConnectionCombo.getSelectionIndex(); if (currentSelection > 0) { String connectionName = fConnectionCombo.getItem(currentSelection); selectedConnection = getSelectedConnectionType().getConnection(connectionName); } } if (selectedConnection == null || fSelectedConnection == null || !selectedConnection.getName().equals(fSelectedConnection.getName())) { fSelectedConnection = selectedConnection; Event evt = new Event(); evt.widget = this; notifyListeners(new SelectionEvent(evt)); } fWidgetListener.setEnabled(enabled); }
Source:
<code>public void openTsView_navigateToFlow_navigationSuccessful() { getDriver().get(getRootURL() + "/"); waitForDevServer(); waitUntil( <START> input -> getInShadowRoot(findElement(By.tagName("about-view")), <END> By.id("navigate-hello")).isDisplayed()); getInShadowRoot(findElement(By.tagName("about-view")), By.id("navigate-hello")).click(); Assert.assertThat(getDriver().getCurrentUrl(), CoreMatchers.endsWith("/hello")); }</code><technical_language>getInShadowRoot</technical_language>

Target:
public void openTsView_navigateToFlow_navigationSuccessful() { getDriver().get(getRootURL() + "/"); waitForDevServer(); waitUntil(input -> $("about-view").first().$("a").id("navigate-hello") .isDisplayed()); getInShadowRoot(findElement(By.tagName("about-view")), By.id("navigate-hello")).click(); Assert.assertThat(getDriver().getCurrentUrl(), CoreMatchers.endsWith("/hello")); Assert.assertTrue("Missing expected native button on page", $(NativeButtonElement.class).id(NAVIGATE_ABOUT).isDisplayed()); }
Source:
<code>protected boolean inForceMode() { <START> if (toPrompt == null) { <END> refreshPromptObject(); } return toPrompt.isForced(); }</code><technical_language>This check a bit odd me, in a places. Is a reason refreshPromptObject() check if toPrompt is null replace if so? understanding class super comprehensively, worries a bit a for prompt null, assume for null in refreshPromptObject request for prompt</technical_language>

Target:
protected boolean inForceMode() { if (toPrompt != null) { return toPrompt.isForced(); } return false; }
Source:
<code>public Guid getQuotaIdToConsume(Guid quotaId, storage_pool storagePool) { <START> Guid returnedQuotaGuid = quotaId; <END> if (storagePool == null) { log.errorFormat("Storage pool Id is null, Quota id will be set from the parameter"); } else { if (storagePool.getQuotaEnforcementType() == QuotaEnforcmentTypeEnum.DISABLED) { log.debugFormat("Storage pool quota is disabled, Quota id which will be consume from is the default DC quota"); returnedQuotaGuid = DbFacade.getInstance() .getQuotaDAO() .getDefaultQuotaByStoragePoolId(storagePool.getId()) .getId(); } } return returnedQuotaGuid; }</code><technical_language>i this function is weird used, decision default quota done in validate quota phase</technical_language>

Target:
public Guid getQuotaIdToConsume(Guid quotaId, storage_pool storagePool) { Guid returnedQuotaGuid = quotaId; if (storagePool == null) { log.errorFormat("Storage pool is null, Quota id will be set from the parameter"); } else if (storagePool.getQuotaEnforcementType() == QuotaEnforcmentTypeEnum.DISABLED) { log.debugFormat("Storage pool quota is disabled, Quota id which will be consume from is the default DC quota"); returnedQuotaGuid = getQuotaDAO() .getDefaultQuotaByStoragePoolId(storagePool.getId()) .getId(); } return returnedQuotaGuid; }
Source:
<code>public void deregister() { if ((getChartViewer().getControl() != null) && !getChartViewer().getControl().isDisposed()) { <START> getChart().getPlotArea().removeMouseTrackListener(this); <END> } }</code><technical_language>remove add a deactivate fTooltipHandler</technical_language>

Target:
public void deregister() { if ((getChartViewer().getControl() != null) && !getChartViewer().getControl().isDisposed()) { fToolTipHandler.deactivateHoverHelp(getChart().getPlotArea()); } }
Source:
<code>public static void startLatency(Object messageId) { <START> startTimestampPerId.put(messageId, System.nanoTime()); <END> }</code><technical_language>static classes stateful. class Foo { static Foo singleton = new Foo() // side effects in cotr.. pref empty cotr public static Foo getInstance() { return singleton; if(Monitor.connection.client == null || !Monitor.connection.client.isConnected()) - Monitor.connection.connect(); ??? } Map x = Maps.hashMap(); }</technical_language>

Target:
public void startLatency(Object messageId) { startTimestampPerId.put(messageId, System.nanoTime()); }
Source:
<code>public Collection<MailAddress> match(Mail mail) throws MessagingException { Object exceptionValue = mail.getAttribute(Mail.MAILET_ERROR_ATTRIBUTE_NAME); if (exceptionValue != null && exceptionClass.isAssignableFrom(exceptionValue.getClass())) { return mail.getRecipients(); } else { <START> return null; <END> } }</code><technical_language>return empty immutable list a null value... return immutableList.of(); do trick</technical_language>

Target:
public Collection<MailAddress> match(Mail mail) throws MessagingException { Object exceptionValue = mail.getAttribute(Mail.MAILET_ERROR_ATTRIBUTE_NAME); if (exceptionValue != null && exceptionClass.isAssignableFrom(exceptionValue.getClass())) { return mail.getRecipients(); } else { return ImmutableList.of(); } }
Source:
<code>public void testMergeabilityOfChangesbyBranch() { try { List<Change> changes = <START> schema.changes().byProject(destBranch.getParentKey()).toList(); <END> for (Change change : changes) { if ((destBranch.equals(change.getDest())) && (change.getStatus() == Change.Status.NEW)) { testMergeQueue.addToQueue(change); } } testMergeQueue.consumesQueue(); } catch (OrmException e) { log.error("Test merge attempt for branch: " + destBranch.get() + " failed: Not able to query database", e); } }</code><technical_language>Is a query involving branch? If not, add ProjectAccess? include status</technical_language>

Target:
public void testMergeabilityOfChangesbyBranch() { try { List<Change> changes = schema.changes().allNewNotMergeable(destBranch).toList(); for (Change change : changes) { changeTestMergeQueue.add(change); } } catch (OrmException e) { log.error("Test merge attempt for branch: " + destBranch.get() + " failed: Not able to query database", e); } }
Source:
<code>public void deleteFromTenant(String tenant) { String hql = "DELETE FROM Policy " + "WHERE internalId.tenant = :tenant_id"; Query query = this.currentSession().createQuery(hql); query.setParameter("tenant_id", tenant); int result = query.executeUpdate(); <START> System.out.println("The result of the delete tenant is " + result); <END> }</code><technical_language>Remove statement</technical_language>

Target:
public void deleteFromTenant(String tenant) { String hql = "DELETE FROM Policy " + "WHERE internalId.tenant = :tenant_id"; Query query = this.currentSession().createQuery(hql); query.setParameter("tenant_id", tenant); int result = query.executeUpdate(); }
Source:
<code>public static <T> T run(ISafeRunnableWithResult<T> code) { Assert.isNotNull(code); try { return code.runWithResult(); } catch (Exception | LinkageError | AssertionError e) { handleException(code, e); } <START> return null; <END> }</code><technical_language>move return null; catch-block. a bit clearer IMHO</technical_language>

Target:
public static <T> T run(ISafeRunnableWithResult<T> code) { Assert.isNotNull(code); try { return code.runWithResult(); } catch (Exception | LinkageError | AssertionError e) { handleException(code, e); return null; } }
Source:
<code>public final <U> U to(@NonNull Function<? super ParallelFlowable<T>, U> converter) { try { <START> return converter.apply(this); <END> } catch (Throwable ex) { Exceptions.throwIfFatal(ex); throw ExceptionHelper.wrapOrThrow(ex); } }</code><technical_language>Missing check for converter null</technical_language>

Target:
public final <U> U to(@NonNull Function<? super ParallelFlowable<T>, U> converter) { try { return ObjectHelper.requireNonNull(converter, "converter is null").apply(this); } catch (Throwable ex) { Exceptions.throwIfFatal(ex); throw ExceptionHelper.wrapOrThrow(ex); } }
Source:
<code>public OAuth2TokenValidatorResult validate(Jwt token) { Assert.notNull(token, "token cannot be null"); T claimValue = token.getClaim(this.claim); if (test.test(claimValue)) { return OAuth2TokenValidatorResult.success(); } else { if (logger.isDebugEnabled()) { <START> logger.debug("Failed to validate OAuth2 token claim " + claim); <END> } return OAuth2TokenValidatorResult.failure(error); } }</code><technical_language>nice error description align debug message here, too, nbf</technical_language>

Target:
public OAuth2TokenValidatorResult validate(Jwt token) { Assert.notNull(token, "token cannot be null"); T claimValue = token.getClaim(this.claim); if (test.test(claimValue)) { return OAuth2TokenValidatorResult.success(); } else { if (logger.isDebugEnabled()) { logger.debug(error.getDescription()); } return OAuth2TokenValidatorResult.failure(error); } }
Source:
<code>protected SCMRevision retrieve(@NonNull SCMHead head, @NonNull TaskListener listener) throws IOException { SVNRepositoryView repository = null; try { listener.getLogger().println("Opening connection to " + remoteBase); SVNURL repoURL = SVNURL.parseURIEncoded(remoteBase); repository = openSession(repoURL); String repoPath = SubversionSCM.DescriptorImpl.getRelativePath(repoURL, repository.getRepository()); String path = SVNPathUtil.append(repoPath, head.getName()); SVNRepositoryView.NodeEntry svnEntry = repository.getNode(path, -1); <START> return new SCMRevisionImpl(head, svnEntry.getRevision(), (additionalCredentials.size()>0)); <END> } catch (SVNException e) { throw new IOException(e); } finally { closeSession(repository); } }</code><technical_language>This is precise. Additional credentials used. More plausibly, server externals simply do need distinct credentials</technical_language>

Target:
protected SCMRevision retrieve(@NonNull SCMHead head, @NonNull TaskListener listener) throws IOException { SVNRepositoryView repository = null; try { listener.getLogger().println("Opening connection to " + remoteBase); SVNURL repoURL = SVNURL.parseURIEncoded(remoteBase); repository = openSession(repoURL); String repoPath = SubversionSCM.DescriptorImpl.getRelativePath(repoURL, repository.getRepository()); String path = SVNPathUtil.append(repoPath, head.getName()); SVNRepositoryView.NodeEntry svnEntry = repository.getNode(path, -1); return new SCMRevisionImpl(head, svnEntry.getRevision()); } catch (SVNException e) { throw new IOException(e); } finally { closeSession(repository); } }
Source:
<code>protected List<String> listResources(JarInputStream jar, String path) throws IOException { if (!path.startsWith("/")) { path = "/" + path; } if (!path.endsWith("/")) { path = path + "/"; } List<String> resources = new ArrayList<>(); for (JarEntry entry; (entry = jar.getNextJarEntry()) != null;) { if (!entry.isDirectory()) { StringBuilder name = new StringBuilder(entry.getName()); <START> if (!name.substring(0).startsWith("/")) { <END> name.insert(0, '/'); } if (name.substring(0).startsWith(path)) { if (log.isDebugEnabled()) { log.debug("Found resource: " + name); } resources.add(name.substring(1)); } } } return resources; }</code><technical_language>substring() creates a new String, name.charAt(0) != '/' more efficient</technical_language>

Target:
protected List<String> listResources(JarInputStream jar, String path) throws IOException { if (!path.startsWith("/")) { path = "/" + path; } if (!path.endsWith("/")) { path = path + "/"; } List<String> resources = new ArrayList<>(); for (JarEntry entry; (entry = jar.getNextJarEntry()) != null;) { if (!entry.isDirectory()) { StringBuilder name = new StringBuilder(entry.getName()); if (name.charAt(0) != '/') { name.insert(0, '/'); } if (name.indexOf(path) == 0) { if (log.isDebugEnabled()) { log.debug("Found resource: " + name); } resources.add(name.substring(1)); } } } return resources; }
Source:
<code>void pollQueue() { int emitted = 0; do { counter = 1; while (!scheduledUnsubscribe.isUnsubscribed()) { if (finished) { <START> if (error != null) { <END> child.onError(error); return; } else if (queue.isEmpty()) { child.onCompleted(); return; } } if (REQUESTED.getAndDecrement(this) != 0) { Object o = queue.poll(); if (o == null) { if (finished) { if (error != null) { child.onError(error); return; } else if (queue.isEmpty()) { child.onCompleted(); return; } } REQUESTED.incrementAndGet(this); break; } else { if (!on.accept(child, o)) { emitted++; } } } else { REQUESTED.incrementAndGet(this); break; } } } while (COUNTER_UPDATER.decrementAndGet(this) > 0); if (emitted > 0) { request(emitted); } }</code><technical_language>Avoid reading volatile here</technical_language>

Target:
void pollQueue() { int emitted = 0; do { counter = 1; long produced = 0; long r = requested; while (!child.isUnsubscribed()) { Throwable error; if (finished) { if ((error = this.error) != null) { queue.clear(); child.onError(error); return; } else if (queue.isEmpty()) { child.onCompleted(); return; } } if (r > 0) { Object o = queue.poll(); if (o != null) { child.onNext(on.getValue(o)); r--; emitted++; produced++; } else { break; } } else { break; } } if (produced > 0 && requested != Long.MAX_VALUE) { REQUESTED.addAndGet(this, -produced); } } while (COUNTER_UPDATER.decrementAndGet(this) > 0); if (emitted > 0) { request(emitted); } }
Source:
<code>public Optional<Table> getTable(String databaseName, String tableName) { try { return retry() .stopOn(NoSuchObjectException.class, HiveViewNotSupportedException.class) .stopOnIllegalExceptions() .run("getTable", stats.getGetTable().wrap(() -> { try (HiveMetastoreClient client = clientProvider.createMetastoreClient()) { Table table = client.getTable(databaseName, tableName); if (table.getTableType().equals(TableType.VIRTUAL_VIEW.name()) && <START> (!"true".equals(table.getParameters().get(PRESTO_VIEW_FLAG)))) { <END> throw new HiveViewNotSupportedException(new SchemaTableName(databaseName, tableName)); } return Optional.of(table); } })); } catch (NoSuchObjectException e) { return Optional.empty(); } catch (TException e) { throw new PrestoException(HIVE_METASTORE_ERROR, e); } catch (Exception e) { throw Throwables.propagate(e); } }</code><technical_language>Please leave isPrestoView a method. contains kind of logic I prefer in a special-purpose function. BTW, I find easier read if a (...) !. ok if feel strongly otherwise</technical_language>

Target:
public Optional<Table> getTable(String databaseName, String tableName) { try { return retry() .stopOn(NoSuchObjectException.class, HiveViewNotSupportedException.class) .stopOnIllegalExceptions() .run("getTable", stats.getGetTable().wrap(() -> { try (HiveMetastoreClient client = clientProvider.createMetastoreClient()) { Table table = client.getTable(databaseName, tableName); if (table.getTableType().equals(TableType.VIRTUAL_VIEW.name()) && !isPrestoView(table)) { throw new HiveViewNotSupportedException(new SchemaTableName(databaseName, tableName)); } return Optional.of(table); } })); } catch (NoSuchObjectException e) { return Optional.empty(); } catch (TException e) { throw new PrestoException(HIVE_METASTORE_ERROR, e); } catch (Exception e) { throw Throwables.propagate(e); } }
Source:
<code>private Runnable getIAMUserProfileUpdater(AuthzToken authzToken, UserProfile userProfile) throws UserProfileServiceException { IamAdminServices.Client iamAdminServicesClient = iasClientPool.getResource(); return () -> { try { iamAdminServicesClient.updateUserProfile(authzToken, userProfile); iasClientPool.returnResource(iamAdminServicesClient); } catch (TException e) { <START> if (iamAdminServicesClient != null) { <END> iasClientPool.returnBrokenResource(iamAdminServicesClient); } throw new RuntimeException("Failed to update user profile in IAM service", e); } }; }</code><technical_language>add error log</technical_language>

Target:
private Runnable getIAMUserProfileUpdater(AuthzToken authzToken, UserProfile userProfile) throws UserProfileServiceException { IamAdminServices.Client iamAdminServicesClient = iasClientPool.getResource(); return () -> { try { iamAdminServicesClient.updateUserProfile(authzToken, userProfile); iasClientPool.returnResource(iamAdminServicesClient); } catch (TException e) { if (iamAdminServicesClient != null) { logger.error("Error while Updating user profile in IAM Service", e); iasClientPool.returnBrokenResource(iamAdminServicesClient); } throw new RuntimeException("Failed to update user profile in IAM service", e); } }; }
Source:
<code>public static void main(String args[]) { <START> if (args.length != 4) { <END> System.out.println("USAGE: java [options] " + AmbryServer.class.getSimpleName() + " log4j.properties server.properties hardwarelayout partitionlayout"); System.exit(1); } try { PropertyConfigurator.configure(args[0]); Properties props = Utils.loadProps(args[1]); VerifiableProperties vprops = new VerifiableProperties(props); ClusterMap clusterMap = new ClusterMapManager(args[2], args[3], new ClusterMapConfig(vprops)); final AmbryServer server = new AmbryServer(vprops, clusterMap); Runtime.getRuntime().addShutdownHook(new Thread() { public void run() { server.shutdown(); } }); server.startup(); server.awaitShutdown(); } catch (Exception e) { System.out.println("error " + e); } System.exit(0); }</code><technical_language>is this change for</technical_language>

Target:
public static void main(String args[]) { if (args.length != 3) { System.out.println("USAGE: java [options] " + AmbryMain.class.getCanonicalName() + " server.properties hardwarelayout partitionlayout"); System.exit(1); } try { Properties props = Utils.loadProps(args[0]); VerifiableProperties vprops = new VerifiableProperties(props); ClusterMap clusterMap = new ClusterMapManager(args[1], args[2], new ClusterMapConfig(vprops)); final AmbryServer server = new AmbryServer(vprops, clusterMap); Runtime.getRuntime().addShutdownHook(new Thread() { public void run() { server.shutdown(); } }); server.startup(); server.awaitShutdown(); } catch (Exception e) { System.out.println("error " + e); } System.exit(0); }
Source:
<code>protected LockAndUnlockContendedBenchmark(TimelockService timelock, int numClients, int numRequestsPerClient, int numDistinctLocks) { super(numClients, numRequestsPerClient); this.timelock = timelock; <START> List<LockDescriptor> descriptors = Lists.newArrayList(); <END> for (int i = 0; i < numDistinctLocks; i++) { descriptors.add(StringLockDescriptor.of(UUID.randomUUID().toString())); } lockDescriptors = ImmutableList.copyOf(descriptors); }</code><technical_language>this in a hot path, presize ImmutableList.builder()</technical_language>

Target:
protected LockAndUnlockContendedBenchmark(TimelockService timelock, int numClients, int numRequestsPerClient, int numDistinctLocks) { super(numClients, numRequestsPerClient); this.timelock = timelock; List<LockDescriptor> descriptors = Lists.newArrayListWithExpectedSize(numDistinctLocks); for (int i = 0; i < numDistinctLocks; i++) { descriptors.add(StringLockDescriptor.of(UUID.randomUUID().toString())); } lockDescriptors = ImmutableList.copyOf(descriptors); }
Source:
<code>static ReadCountCollection removeTargetsWithTooManyZeros(final ReadCountCollection readCounts, final int maximumTargetZeros, final Logger logger) { final Set<Target> targetsToKeep = new HashSet<>(readCounts.targets().size()); final RealMatrix counts = readCounts.counts(); <START> for (int i = 0; i < counts.getRowDimension(); i++) { <END> final double[] rowCounts = counts.getRow(i); int zeroCounts = 0; for (final double rowCount : rowCounts) { if (rowCount == 0.0) { zeroCounts++; } } if (zeroCounts <= maximumTargetZeros) { targetsToKeep.add(readCounts.targets().get(i)); } } final int targetsToDropCount = readCounts.targets().size() - targetsToKeep.size(); if (targetsToDropCount == 0) { logger.info( String.format("No target drop due to too many zero counts; there is no target with a large number of columns with zero counts (<= %d of %d) ", maximumTargetZeros, readCounts.targets().size())); return readCounts; } else if (targetsToDropCount == readCounts.targets().size()) { throw new UserException.BadInput("the number of zeros per target in the input is too large resulting in all targets being dropped"); } else { logger.info( String.format("Some targets dropped, %d of %d, as they have too many zeros (> %d of %d)." , targetsToDropCount, readCounts.columnNames().size(), maximumTargetZeros, readCounts.targets().size())); return readCounts.subsetTargets(targetsToKeep); } }</code><technical_language>Predicate<double[]> keepRow = rowCounts -> rowCounts.stream().filter(x -> x == 0.0).count() <= maximumTargetZeros(); final Set<Target> targetsToKeep IntStream.range(0, counts.getRowDimension()).filter(row -> keepRow(counts.getRow(row))).map(readCounts.targets()::get).collect(Collectors.toSet());</technical_language>

Target:
static ReadCountCollection removeTargetsWithTooManyZeros(final ReadCountCollection readCounts, final int maximumTargetZeros, final Logger logger) { final RealMatrix counts = readCounts.counts(); final Set<Target> targetsToKeep = IntStream.range(0, counts.getRowDimension()).boxed() .filter(i -> countZeroes(counts.getRow(i)) <= maximumTargetZeros) .map(i -> readCounts.targets().get(i)).collect(Collectors.toSet()); final int targetsToDropCount = readCounts.targets().size() - targetsToKeep.size(); if (targetsToDropCount == 0) { logger.info( String.format("No target drop due to too many zero counts; there is no target with a large number of columns with zero counts (<= %d of %d) ", maximumTargetZeros, readCounts.targets().size())); return readCounts; } else if (targetsToDropCount == readCounts.targets().size()) { throw new UserException.BadInput("the number of zeros per target in the input is too large resulting in all targets being dropped"); } else { logger.info( String.format("Some targets dropped, %d of %d, as they have too many zeros (> %d of %d)." , targetsToDropCount, readCounts.columnNames().size(), maximumTargetZeros, readCounts.targets().size())); return readCounts.subsetTargets(targetsToKeep); } }
Source:
<code>private void retryWork(int maxRetries) { for (int attempt = 0; attempt < maxRetries; attempt++) { if (attempt > 0 && log.isDebugEnabled()) log.debugf("Retrying due to previous failure. %s attempts left.", maxRetries - attempt); try { if (!failSilently) { availabilityLock.lock(); try { if (!delegateAvailable) { if (stopped) { log.debugf("Failed to write async modifications to %s as the store is unavailable and stop() was called", actual); return; } availability.await(); } } catch (InterruptedException e) { log.debugf("%s interrupted: %s", this, e); Thread.currentThread().interrupt(); break; } finally { availabilityLock.unlock(); } } AsyncCacheWriter.this.applyModificationsSync(modifications); return; } catch (Exception e) { if (log.isDebugEnabled()) log.debug("Failed to process async modifications", e); if (!failSilently) { try { Thread.sleep(configuration.availabilityInterval()); } catch (InterruptedException ie) { break; <START> } <END> } } } log.unableToProcessAsyncModifications(maxRetries); }</code><technical_language>Missed resetting interrupt flag</technical_language>

Target:
private void retryWork(int maxRetries) { for (int attempt = 0; attempt < maxRetries; attempt++) { if (attempt > 0 && log.isDebugEnabled()) log.debugf("Retrying due to previous failure. %s attempts left.", maxRetries - attempt); try { if (!failSilently) { availabilityLock.lock(); try { if (!delegateAvailable) { if (stopped) { log.debugf("Failed to write async modifications to %s as the store is unavailable and stop() was called", actual); return; } availability.await(); } } catch (InterruptedException e) { log.debugf("%s interrupted: %s", this, e); Thread.currentThread().interrupt(); break; } finally { availabilityLock.unlock(); } } AsyncCacheWriter.this.applyModificationsSync(modifications); return; } catch (Exception e) { if (log.isDebugEnabled()) log.debug("Failed to process async modifications", e); if (!failSilently) { try { Thread.sleep(configuration.availabilityInterval()); } catch (InterruptedException ie) { Thread.currentThread().interrupt(); break; } } } } log.unableToProcessAsyncModifications(maxRetries); }
Source:
<code>public BibEntry createNewEntry(JSONObject jsonObject) { BibEntry newEntry = new BibEntry(); <START> newEntry.setField(StandardField.TITLE, jsonObject.getString("title")); <END> newEntry.setField(StandardField.AUTHOR, jsonObject.getString("author")); newEntry.setField(StandardField.YEAR, jsonObject.getString("year")); newEntry.setField(StandardField.PAGES, jsonObject.getString("page")); newEntry.setField(StandardField.VOLUME, jsonObject.getString("volume")); newEntry.setField(StandardField.ISSUE, jsonObject.getString("issue")); newEntry.setField(StandardField.DOI, jsonObject.getString("doi")); return newEntry; }</code><technical_language>withField, easily chain all:</technical_language>

Target:
private BibEntry createNewEntry(JSONObject jsonObject) { LOGGER.debug("Paper found: {}", jsonObject.getString("doi")); return new BibEntry() .withField(StandardField.TITLE, jsonObject.getString("title")) .withField(StandardField.AUTHOR, jsonObject.getString("author")) .withField(StandardField.YEAR, jsonObject.getString("year")) .withField(StandardField.PAGES, jsonObject.getString("page")) .withField(StandardField.VOLUME, jsonObject.getString("volume")) .withField(StandardField.ISSUE, jsonObject.getString("issue")) .withField(StandardField.DOI, jsonObject.getString("doi")); }
Source:
<code>public Collection<IDataProviderDescriptor> getDescriptors(@NonNull ITmfTrace trace) { return <START> Collections.singletonList(DESCRIPTOR); <END> }</code><technical_language>singleton</technical_language>

Target:
public Collection<IDataProviderDescriptor> getDescriptors(@NonNull ITmfTrace trace) { return Collections.singleton(DESCRIPTOR); }
Source:
<code>public void selectionChanged(IStructuredSelection sel) { <START> if( sel.size() == 0 || sel.size() > 1 ) { <END> setEnabled(false); return; } setEnabled(true); synchronized(this) { switchListener(previousSelection, sel); previousSelection = sel; } super.selectionChanged(sel); }</code><technical_language>if( sel.size() != 1 )</technical_language>

Target:
public void selectionChanged(IStructuredSelection sel) { if( sel.size() != 1 ) { setEnabled(false); return; } setEnabled(true); synchronized(this) { switchListener(previousSelection, sel); previousSelection = sel; } super.selectionChanged(sel); }
Source:
<code>public CompletableFuture<TransferBatchResponse> tryTransferForRandomNodes( RandomNodeIterator nodeIterator) { return CompletableFuture.supplyAsync(() -> { while (nodeIterator.hasNext()) { TransferBatchRequestForNode transferBatchRequestForNode = nodeIterator.next(); List<Long> addresses = transferBatchRequestForNode.getAddresses(); String destinationNode = transferBatchRequestForNode.getDestinationNode(); LogUnitClient logUnitClientToTargetNode = runtimeLayout.getLogUnitClient(destinationNode); LogUnitClient logUnitClientToCurrentNode = runtimeLayout.getLogUnitClient(currentNode); try { ReadBatch readBatch = readRecords(addresses, Optional.of(destinationNode), logUnitClientToTargetNode); return writeRecords(readBatch, logUnitClientToCurrentNode, maxWriteRetries, writeSleepDuration); } catch (ReadBatchException re) { log.warn("Read exception for node occurred. " + "Retry transfer for the next available node.", destinationNode, re); } catch (Exception e) { log.error("Exception during batch transfer occurred. Failing the transfer.", e); throw e; } } <START> throw new IllegalStateException("No target nodes left to select from"); <END> }); }</code><technical_language>I illegal State, exhausted retryable nodes. ReadBatchException RetryExhaustedException better</technical_language>

Target:
private CompletableFuture<TransferBatchResponse> tryTransferForRandomNodes( RandomNodeIterator nodeIterator) { return CompletableFuture.supplyAsync(() -> { while (nodeIterator.hasNext()) { TransferBatchRequestForNode transferBatchRequestForNode = nodeIterator.next(); List<Long> addresses = transferBatchRequestForNode.getAddresses(); String destinationNode = transferBatchRequestForNode.getDestinationNode(); LogUnitClient logUnitClientToTargetNode = runtimeLayout.getLogUnitClient(destinationNode); LogUnitClient logUnitClientToCurrentNode = runtimeLayout.getLogUnitClient(currentNode); try { ReadBatch readBatch = readRecords(addresses, Optional.of(destinationNode), logUnitClientToTargetNode); return writeRecords(readBatch, logUnitClientToCurrentNode, maxWriteRetries, writeSleepDuration); } catch (ReadBatchException re) { log.warn("Read exception for node occurred. " + "Retry transfer for the next available node.", destinationNode, re); } catch (Exception e) { log.error("Exception during batch transfer occurred. Failing the transfer.", e); throw e; } } throw new ReadBatchException("No target nodes left to select from"); }); }
Source:
<code>private void restoreTable(Connection connection, Database d, String name, int id, String charset, String pks) throws SQLException { Statement s = connection.createStatement(); Table t = d.buildTable(name, charset); ResultSet cRS = s.executeQuery("SELECT * from `columns` where table_id = " + id + " ORDER by id"); int i = 0; while (cRS.next()) { String[] enumValues = null; if ( cRS.getString("enum_values") != null ) enumValues = StringUtils.splitByWholeSeparatorPreserveAllTokens(cRS.getString("enum_values"), ","); ColumnDef c = ColumnDef.build( cRS.getString("name"), cRS.getString("charset"), cRS.getString("coltype"), i++, cRS.getInt("is_signed") == 1, enumValues, <START> Long.valueOf(cRS.getInt("column_length"))); <END> t.addColumn(c); } if ( pks != null ) { List<String> pkList = Arrays.asList(StringUtils.split(pks, ',')); t.setPKList(pkList); } }</code><technical_language>this column_length 0.. if allow NULL if intended "zero is a good enough null"</technical_language>

Target:
private void restoreTable(Connection connection, Database d, String name, int id, String charset, String pks) throws SQLException { Statement s = connection.createStatement(); Table t = d.buildTable(name, charset); ResultSet cRS = s.executeQuery("SELECT * from `columns` where table_id = " + id + " ORDER by id"); int i = 0; while (cRS.next()) { Long columnLength; int columnLengthInt = cRS.getInt("column_length"); if ( cRS.wasNull() ) columnLength = null; else columnLength = Long.valueOf(columnLengthInt); String[] enumValues = null; if ( cRS.getString("enum_values") != null ) enumValues = StringUtils.splitByWholeSeparatorPreserveAllTokens(cRS.getString("enum_values"), ","); ColumnDef c = ColumnDef.build( cRS.getString("name"), cRS.getString("charset"), cRS.getString("coltype"), i++, cRS.getInt("is_signed") == 1, enumValues, columnLength); t.addColumn(c); } if ( pks != null ) { List<String> pkList = Arrays.asList(StringUtils.split(pks, ',')); t.setPKList(pkList); } }