auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public String toString() { int[] types = getTransportTypes(); String transports = (types.length > 0) ? " Transports: " + transportNamesOf(types) : ""; types = getCapabilities(); String capabilities = (types.length > 0 ? " Capabilities: " : ""); for (int i = 0; i < types.length; ) { capabilities += capabilityNameOf(types[i]); if (++i < types.length) capabilities += "&"; } String upBand = ((mLinkUpBandwidthKbps > 0) ? " LinkUpBandwidth>=" + mLinkUpBandwidthKbps + "Kbps" : ""); String dnBand = ((mLinkDownBandwidthKbps > 0) ? " LinkDnBandwidth>=" + mLinkDownBandwidthKbps + "Kbps" : ""); String specifier = (mNetworkSpecifier == null ? "" : " Specifier: <" + mNetworkSpecifier + ">"); String signalStrength = (hasSignalStrength() ? " SignalStrength: " + mSignalStrength : ""); final String uids; if (null == mUids) { uids = ""; } else if (1 == mUids.size() && mUids.valueAt(0).isSingleUid()) { uids = " Uid: " + mUids.valueAt(0).start; } else { uids = " Uids: <" + mUids + ">"; } String establishingAppUid = 0 > mEstablishingVpnAppUid ? "" : " EstablishingAppUid: " + <START> mEstablishingVpnAppUid; <END> return "[" + transports + capabilities + upBand + dnBand + specifier + signalStrength + uids + establishingAppUid + "]"; }</code><technical_language>Style-wise trouble whatsoever with: ... = (mEstablishingVpnAppUid > 0) ? " EstablishingAppUid: " + mEstablishingVpnAppUid : ""; foolish consistency damned</technical_language>

Target:
public String toString() { final StringBuilder sb = new StringBuilder("["); if (0 != mTransportTypes) { sb.append(" Transports: "); appendStringRepresentationOfBitMaskToStringBuilder(sb, mTransportTypes, NetworkCapabilities::transportNameOf, "|"); } if (0 != mNetworkCapabilities) { sb.append(" Capabilities: "); appendStringRepresentationOfBitMaskToStringBuilder(sb, mNetworkCapabilities, NetworkCapabilities::capabilityNameOf, "&"); } if (mLinkUpBandwidthKbps > 0) { sb.append(" LinkUpBandwidth>=" + mLinkUpBandwidthKbps + "Kbps"); } if (mLinkDownBandwidthKbps > 0) { sb.append(" LinkDnBandwidth>=" + mLinkDownBandwidthKbps + "Kbps"); } if (mNetworkSpecifier != null) { sb.append(" Specifier: <" + mNetworkSpecifier + ">"); } if (hasSignalStrength()) { sb.append(" SignalStrength: " + mSignalStrength); } if (null != mUids) { if (1 == mUids.size() && mUids.valueAt(0).isSingleUid()) { sb.append(" Uid: " + mUids.valueAt(0).start); } else { sb.append(" Uids: <" + mUids + ">"); } } if (mEstablishingVpnAppUid > 0) { sb.append(" EstablishingAppUid: " + mEstablishingVpnAppUid); } sb.append("]"); return sb.toString(); }
Source:
<code>private static Map<String, Set<AssignableReplica>> parseAllReplicas( ResourceControllerDataProvider dataProvider, Map<String, Resource> resourceMap, int instanceCount) { Map<String, Set<AssignableReplica>> totalReplicaMap = new HashMap<>(); for (String resourceName : resourceMap.keySet()) { ResourceConfig config = dataProvider.getResourceConfig(resourceName); IdealState is = dataProvider.getIdealState(resourceName); if (is == null) { throw new HelixException( "Cannot find the resource ideal state for resource: " + resourceName); } String defName = is.getStateModelDefRef(); StateModelDefinition def = dataProvider.getStateModelDef(defName); if (def == null) { throw new IllegalArgumentException(String <START> .format("Cannot fine state model definition %s for resource %s.", <END> is.getStateModelDefRef(), resourceName)); } Map<String, Integer> stateCountMap = def.getStateCountMap(instanceCount, is.getReplicaCount(instanceCount)); for (String partition : is.getPartitionSet()) { for (Map.Entry<String, Integer> entry : stateCountMap.entrySet()) { String state = entry.getKey(); for (int i = 0; i < entry.getValue(); i++) { totalReplicaMap.computeIfAbsent(resourceName, key -> new HashSet<>()).add( new AssignableReplica(config, partition, state, def.getStatePriorityMap().get(state))); } } } } return totalReplicaMap; }</code><technical_language>find</technical_language>

Target:
private static Map<String, Set<AssignableReplica>> parseAllReplicas( ResourceControllerDataProvider dataProvider, Map<String, Resource> resourceMap, int instanceCount) { Map<String, Set<AssignableReplica>> totalReplicaMap = new HashMap<>(); for (String resourceName : resourceMap.keySet()) { ResourceConfig config = dataProvider.getResourceConfig(resourceName); IdealState is = dataProvider.getIdealState(resourceName); if (is == null) { throw new HelixException( "Cannot find the resource ideal state for resource: " + resourceName); } String defName = is.getStateModelDefRef(); StateModelDefinition def = dataProvider.getStateModelDef(defName); if (def == null) { throw new IllegalArgumentException(String .format("Cannot find state model definition %s for resource %s.", is.getStateModelDefRef(), resourceName)); } Map<String, Integer> stateCountMap = def.getStateCountMap(instanceCount, is.getReplicaCount(instanceCount)); for (String partition : is.getPartitionSet()) { for (Map.Entry<String, Integer> entry : stateCountMap.entrySet()) { String state = entry.getKey(); for (int i = 0; i < entry.getValue(); i++) { totalReplicaMap.computeIfAbsent(resourceName, key -> new HashSet<>()).add( new AssignableReplica(config, partition, state, def.getStatePriorityMap().get(state))); } } } } return totalReplicaMap; }
Source:
<code>private JSONObject getReplicas(String blobId) throws RestServiceException { try { <START> PartitionId partitionId = BlobId.fromStringId(blobId, clusterMap).getPartition(); <END> if (partitionId == null) { adminMetrics.invalidBlobIdError.inc(); logger.warn("Partition for blob id is null. The blob id might be invalid", blobId); throw new RestServiceException("Partition for blob id " + blobId + " is null. The id might be invalid", RestServiceErrorCode.NotFound); } return packageResult(partitionId.getReplicaIds()); } catch (IllegalArgumentException e) { adminMetrics.invalidBlobIdError.inc(); throw new RestServiceException("Invalid blob id received for getReplicasForBlob request - " + blobId, e, RestServiceErrorCode.NotFound); } catch (IOException | JSONException e) { adminMetrics.responseConstructionError.inc(); throw new RestServiceException("Could not create response for GET of replicas for " + blobId, e, RestServiceErrorCode.InternalServerError); } }</code><technical_language>this changed constructor static function</technical_language>

Target:
private JSONObject getReplicas(String blobId) throws RestServiceException { try { PartitionId partitionId = new BlobId(blobId, clusterMap).getPartition(); if (partitionId == null) { adminMetrics.invalidBlobIdError.inc(); logger.warn("Partition for blob id is null. The blob id might be invalid", blobId); throw new RestServiceException("Partition for blob id " + blobId + " is null. The id might be invalid", RestServiceErrorCode.NotFound); } return packageResult(partitionId.getReplicaIds()); } catch (IllegalArgumentException e) { adminMetrics.invalidBlobIdError.inc(); throw new RestServiceException("Invalid blob id received for getReplicasForBlob request - " + blobId, e, RestServiceErrorCode.NotFound); } catch (IOException | JSONException e) { adminMetrics.responseConstructionError.inc(); throw new RestServiceException("Could not create response for GET of replicas for " + blobId, e, RestServiceErrorCode.InternalServerError); } }
Source:
<code>public static int countItems(NLSSubstitution[] elems, int task) { Assert.isTrue(task == NLSSubstitution.EXTERNALIZED || task == NLSSubstitution.IGNORED || task == NLSSubstitution.INTERNALIZED); int result= 0; for (NLSSubstitution <START> elem : <END> elems) { if (elem.fState == task) { result++; } } return result; }</code><technical_language>rename substitution</technical_language>

Target:
public static int countItems(NLSSubstitution[] elems, int task) { Assert.isTrue(task == NLSSubstitution.EXTERNALIZED || task == NLSSubstitution.IGNORED || task == NLSSubstitution.INTERNALIZED); int result= 0; for (NLSSubstitution substitution : elems) { if (substitution.fState == task) { result++; } } return result; }
Source:
<code>public void processingReferenceSection() throws Exception { String text = "(1) Ahrens, M. Home fires that began with upholstered furniture; National Fire Protection Association: Quincy, Massachusetts, 2011.\n" + "(2) Evarts, B. Home fires that began with matresses and bedding; National Fire Protection Association: Quincy, Massachusetts, 2011.\n" + "(3) Kramer, R. H.; Zammarano, M.; Linteris, G. T.; Gedde, U. W.; Gilman, J. W. Polym. Degrad. Stab. 2010, 95, 1115−1122.\n" + "(4) Underwriter Laboratories, UL test: Legacy home contents and new content fires, YouTube online video clip, 2011.\n" + "(5) Gallagher, S.; Campbell, J. In Siloxane-Phosphonate Finishes on Cellulose: Thermal Characterization and Flammability Data; Proceed-ings of the Beltwide Cotton Conference, San Antonio, TX, 2004; pp 2443-2847.\n" + "(6) Watanabe, I.; Sakai, S. Environ. Int. 2003, 29, 665−682. (7) Babrauskas, V.; Blum,\n"; List<BibDataSet> res = engine.getParsers().getCitationParser().processingReferenceSection(text, engine.getParsers().getReferenceSegmenterParser()); assertNotNull(res); <START> System.out.println(res); <END> assertTrue(res.size() > 2); }</code><technical_language>remove this println please ;-)</technical_language>

Target:
public void processingReferenceSection() throws Exception { String text = "(1) Ahrens, M. Home fires that began with upholstered furniture; National Fire Protection Association: Quincy, Massachusetts, 2011.\n" + "(2) Evarts, B. Home fires that began with matresses and bedding; National Fire Protection Association: Quincy, Massachusetts, 2011.\n" + "(3) Kramer, R. H.; Zammarano, M.; Linteris, G. T.; Gedde, U. W.; Gilman, J. W. Polym. Degrad. Stab. 2010, 95, 1115−1122.\n" + "(4) Underwriter Laboratories, UL test: Legacy home contents and new content fires, YouTube online video clip, 2011.\n" + "(5) Gallagher, S.; Campbell, J. In Siloxane-Phosphonate Finishes on Cellulose: Thermal Characterization and Flammability Data; Proceed-ings of the Beltwide Cotton Conference, San Antonio, TX, 2004; pp 2443-2847.\n" + "(6) Watanabe, I.; Sakai, S. Environ. Int. 2003, 29, 665−682. (7) Babrauskas, V.; Blum,\n"; List<BibDataSet> res = engine.getParsers().getCitationParser().processingReferenceSection(text, engine.getParsers().getReferenceSegmenterParser()); assertNotNull(res); assertTrue(res.size() > 2); }
Source:
<code>public T getAckCheckpoint(String source, int sourcePartition) { <START> CallbackStatus status = _callbackStatusMap.get(new SourcePartition(source, sourcePartition)); <END> return status != null ? status.getAckCheckpoint() : null; }</code><technical_language>nit: add @Nullable tag</technical_language>

Target:
public Optional<T> getAckCheckpoint(String source, int sourcePartition) { CallbackStatus status = _callbackStatusMap.get(new SourcePartition(source, sourcePartition)); return Optional.ofNullable(status).map(CallbackStatus::getAckCheckpoint); }
Source:
<code>private void syncLocator() { <START> if (!locator.isValid()) <END> synchronized (this) { if (!locator.isValid()) locator = getLocatorFunction.getLocator(); } }</code><technical_language>volatile modifier underlying boolean returned isValid() result in a safe double-checked locking impl, no</technical_language>

Target:
private TabletLocator syncLocator() { TabletLocator loc = this.locator; if (!loc.isValid()) synchronized (this) { if (locator == loc) try { loc = locator = getLocatorFunction.call(); } catch (Exception e) { log.error("Problem obtaining TabletLocator", e); throw new RuntimeException(e); } } return loc; }
Source:
<code>public static String getClassName(String filePath) { <START> if (filePath == null) { <END> return null; } String fileName = Paths.get(filePath).getFileName().toString(); return fileName.substring(0, fileName.indexOf('.')); }</code><technical_language>Added code print error message exit</technical_language>

Target:
public static String getClassName(String filePath) { if (filePath == null) { System.err.println("File path should not be null."); System.exit(1); } String fileName = Paths.get(filePath).getFileName().toString(); return fileName.substring(0, fileName.indexOf('.')); }
Source:
<code>public Map<Integer, Long> pagesCount(CacheGroupContext grp) throws IgniteCheckedException { <START> Map<Integer, Long> partStates = new HashMap<>(); <END> ctx.cache().context().database().checkpointReadLock(); try { forEachPageStore(grp, new IgniteInClosureX<Integer>() { @Override public void applyx(Integer partId) throws IgniteCheckedException { int pagesCnt = ctx.cache().context().pageStore().pages(grp.groupId(), partId); partStates.put(partId, (long)pagesCnt); } }); } finally { ctx.cache().context().database().checkpointReadUnlock(); } return partStates; }</code><technical_language>more resource-friendly long[] (value for partition)</technical_language>

Target:
public long[] pagesCount(CacheGroupContext grp) throws IgniteCheckedException { long[] partStates = new long[grp.affinity().partitions() + 1]; ctx.cache().context().database().checkpointReadLock(); try { forEachPageStore(grp, new IgniteInClosureX<Integer>() { @Override public void applyx(Integer partId) throws IgniteCheckedException { int pagesCnt = ctx.cache().context().pageStore().pages(grp.groupId(), partId); partStates[Math.min(partId, partStates.length - 1)] = pagesCnt; } }); } finally { ctx.cache().context().database().checkpointReadUnlock(); } return partStates; }
Source:
<code>public boolean supportsScroll() { StorageConfiguration conf = coreFeature.getStorageConfiguration(); <START> return conf.isDBSMongoDB() || conf.isVCS(); <END> }</code><technical_language>Please do cleanups in commit bugfixes/features/improvements</technical_language>

Target:
public boolean supportsScroll() { StorageConfiguration conf = coreFeature.getStorageConfiguration(); return (conf.isDBSMongoDB() || conf.isVCS()); }
Source:
<code>public void postGetHeadDeleteTest() throws ExecutionException, InterruptedException, JSONException { ByteBuffer content = ByteBuffer.wrap(getRandomBytes(1024)); String serviceId = "postGetHeadDeleteServiceID"; String contentType = "application/octet-stream"; String ownerId = "postGetHeadDeleteOwnerID"; HttpHeaders headers = new DefaultHttpHeaders(); setAmbryHeaders(headers, content.capacity(), 7200, false, serviceId, contentType, ownerId); headers.set(HttpHeaders.Names.CONTENT_LENGTH, content.capacity()); <START> headers.add(RestUtils.Headers.UserMetaData_Header_Prefix + "key1", "value1"); <END> headers.add(RestUtils.Headers.UserMetaData_Header_Prefix + "key2", "value2"); String blobId = postBlobAndVerify(headers, content); getBlobAndVerify(blobId, headers, content); getHeadAndVerify(blobId, headers); deleteBlobAndVerify(blobId); verifyOperationsAfterDelete(blobId); }</code><technical_language>I missing context here. I remember for handling user metadata is a multipart, in headers. frontend changed support new design? Is part ready</technical_language>

Target:
public void postGetHeadDeleteTest() throws ExecutionException, InterruptedException, JSONException { ByteBuffer content = ByteBuffer.wrap(RestTestUtils.getRandomBytes(1024)); String serviceId = "postGetHeadDeleteServiceID"; String contentType = "application/octet-stream"; String ownerId = "postGetHeadDeleteOwnerID"; HttpHeaders headers = new DefaultHttpHeaders(); setAmbryHeaders(headers, content.capacity(), 7200, false, serviceId, contentType, ownerId); headers.set(HttpHeaders.Names.CONTENT_LENGTH, content.capacity()); headers.add(RestUtils.Headers.USER_META_DATA_HEADER_PREFIX + "key1", "value1"); headers.add(RestUtils.Headers.USER_META_DATA_HEADER_PREFIX + "key2", "value2"); String blobId = postBlobAndVerify(headers, content); getBlobAndVerify(blobId, headers, content); getHeadAndVerify(blobId, headers); deleteBlobAndVerify(blobId); verifyOperationsAfterDelete(blobId); }
Source:
<code>public void resetInput(Block block) { requireNonNull(block, "block is null"); <START> this.columnarMap = toColumnarMap(block); <END> currentPosition = 0; keyUnnestBlockBuilder.resetInputBlock(columnarMap.getKeysBlock()); valueUnnestBlockBuilder.resetInputBlock(columnarMap.getValuesBlock()); }</code><technical_language>drop this</technical_language>

Target:
public void resetInput(Block block) { requireNonNull(block, "block is null"); columnarMap = toColumnarMap(block); keyUnnestBlockBuilder.resetInputBlock(columnarMap.getKeysBlock()); valueUnnestBlockBuilder.resetInputBlock(columnarMap.getValuesBlock()); int positionCount = block.getPositionCount(); lengths = ensureCapacity(lengths, positionCount); for (int i = 0; i < positionCount; i++) { lengths[i] = columnarMap.getEntryCount(i); } }
Source:
<code>@Test public void responseBodyBuffers() throws IOException { Retrofit retrofit = new Retrofit.Builder() .baseUrl(server.getUrl("/").toString()) .converterFactory(new ToStringConverterFactory()) .build(); Service example = retrofit.create(Service.class); server.enqueue(new MockResponse() .setBody("1234") .setSocketPolicy(DISCONNECT_DURING_RESPONSE_BODY)); try { <START> example.getBody().execute(); <END> } catch (IOException e) { assertThat(e).hasMessage("unexpected end of stream"); } }</code><technical_language>fail fail</technical_language>

Target:
@Test public void responseBodyBuffers() throws IOException { Retrofit retrofit = new Retrofit.Builder() .baseUrl(server.getUrl("/").toString()) .converterFactory(new ToStringConverterFactory()) .build(); Service example = retrofit.create(Service.class); server.enqueue(new MockResponse() .setBody("1234") .setSocketPolicy(DISCONNECT_DURING_RESPONSE_BODY)); Call<ResponseBody> buffered = example.getBody(); try { buffered.execute(); fail(); } catch (IOException e) { assertThat(e).hasMessage("unexpected end of stream"); } }
Source:
<code>public static ICommonXAxisResponse create(String title, double[] xValues, Map<String, IYSeries> ySeries, long currentEnd, boolean isComplete) { ICommonXAxisModel model = new CommonXAxisModel(title, xValues, ySeries); if (isComplete) <START> { return new CommonXAxisResponse(model, ICommonXAxisResponse.Status.COMPLETED, "Completed", currentEnd); <END> } return new CommonXAxisResponse(model, ICommonXAxisResponse.Status.RUNNING, "Running", currentEnd); }</code><technical_language>extract constants</technical_language>

Target:
public static ICommonXAxisResponse create(String title, double[] xValues, Map<String, IYSeries> ySeries, long currentEnd, boolean isComplete) { ICommonXAxisModel model = new CommonXAxisModel(title, xValues, ySeries); if (isComplete) { return new CommonXAxisResponse(model, ICommonXAxisResponse.Status.COMPLETED, CommonStatusMessage.COMPLETED, currentEnd); } return new CommonXAxisResponse(model, ICommonXAxisResponse.Status.RUNNING, CommonStatusMessage.RUNNING, currentEnd); }
Source:
<code>private void analyzeIfRequired(Session session) { synchronized (this) { <START> if (++changesSinceAnalyze <= nextAnalyze) { <END> return; } changesSinceAnalyze = 0; if (nextAnalyze <= Integer.MAX_VALUE / 2) { nextAnalyze *= 2; } } session.markTableForAnalyze(this); }</code><technical_language>logic changed here? Initial of nextAnalyze is copied ANALYZE_AUTO a special meaning for 0 means do automatically run ANALYZE</technical_language>

Target:
private void analyzeIfRequired(Session session) { if (changesUnitlAnalyze != null) { if (changesUnitlAnalyze.decrementAndGet() == 0) { if (nextAnalyze <= Integer.MAX_VALUE / 2) { nextAnalyze *= 2; } changesUnitlAnalyze.set(nextAnalyze); session.markTableForAnalyze(this); } } }
Source:
<code>private void storeFile(History histNew, File file, Repository repo, boolean mergeHistory) throws HistoryException { File cacheFile = getCachedFile(file); History history = histNew; File dir = cacheFile.getParentFile(); if (!dir.isDirectory() && !dir.mkdirs()) { throw new HistoryException( "Unable to create cache directory '" + dir + "'."); } if (mergeHistory && cacheFile.exists()) { history = mergeOldAndNewHistory(cacheFile, histNew, repo); } <START> writeHistoryToFile(dir, history, cacheFile); <END> }</code><technical_language>mergeOldAndNewHistory() returns null. fail in writeHistoryToFile() later</technical_language>

Target:
private void storeFile(History histNew, File file, Repository repo, boolean mergeHistory) throws HistoryException { File cacheFile = getCachedFile(file); History history = histNew; File dir = cacheFile.getParentFile(); if (!dir.isDirectory() && !dir.mkdirs()) { throw new HistoryException( "Unable to create cache directory '" + dir + "'."); } if (mergeHistory && cacheFile.exists()) { history = mergeOldAndNewHistory(cacheFile, histNew, repo); } if (history != null) { writeHistoryToFile(dir, history, cacheFile); } else { writeHistoryToFile(dir, histNew, cacheFile); } }
Source:
<code>synchronized public Instance getInstance() { if (cachedInstance == null) { if (mock) { <START> cachedInstance = DeprecationUtil.makeMockInstance(instance); <END> } else { try { cachedInstance = getConnector().getInstance(); } catch (AccumuloSecurityException | AccumuloException e) { throw new RuntimeException(e); } } } return cachedInstance; }</code><technical_language>Mock is deprecated. If changing this code anyway, phase out, if add complications</technical_language>

Target:
synchronized public Instance getInstance() { if (cachedInstance == null) { try { cachedInstance = getConnector().getInstance(); } catch (AccumuloSecurityException | AccumuloException e) { throw new IllegalStateException(e); } } return cachedInstance; }
Source:
<code>private List<Cluster> getClustersWithOvsSwitchType(Guid networkId) { List<NetworkCluster> physicalNetworkClusters = networkClusterDao.getAllForNetwork(networkId); return physicalNetworkClusters.stream() .map(networkCluster -> clusterDao.get(networkCluster.getClusterId())) .filter(cluster -> <START> cluster.getRequiredSwitchTypeForCluster().equals(SwitchType.OVS)) <END> .collect(Collectors.toList()); }</code><technical_language>I change 'SwitchType.OVS.equals(cluster.getRequiredSwitchTypeForCluster())', avoid NPE</technical_language>

Target:
private List<Cluster> getClustersWithOvsSwitchType(Guid networkId) { List<NetworkCluster> physicalNetworkClusters = networkClusterDao.getAllForNetwork(networkId); return physicalNetworkClusters.stream() .map(networkCluster -> clusterDao.get(networkCluster.getClusterId())) .filter(cluster -> cluster.hasRequiredSwitchType(SwitchType.OVS)) .collect(Collectors.toList()); }
Source:
<code>public String toString() { <START> if (getName() == null) { <END> return getPersonId(); } else { if (getPersonId() == null) { return getName(); } else { if (getName().equals(getPersonId())) { return getName(); } else { return getName() + " <" + getPersonId() + ">"; } } } }</code><technical_language>Please avoid unnecessarily nesting if blocks. This method written as: if (getName() == null) { return getPersonId(); } else if (getPersonId() == null) { return getName(); } else if (getName().equals(getPersonId())) { return getName(); } else { return getName() + " <" + getPersonId() + ">"; //$NON-NLS-1$ //$NON-NLS-2$ }</technical_language>

Target:
public String toString() { if (getName() == null) { return getPersonId(); } else if (getPersonId() == null) { return getName(); } else if (getName().equals(getPersonId())) { return getName(); } else { return getName() + " <" + getPersonId() + ">"; } }
Source:
<code>public void onDisconnected() { Log.i("Location_info", "onDisconnected"); <START> <END> }</code><technical_language>isConnected = false;</technical_language>

Target:
public void onDisconnected() { Log.i("Location_info", "onDisconnected"); isConnected = false; }
Source:
<code>private DataSpacesFileObject resolveToExisting(DataSpacesFileObject space, String spaceName, boolean input) { if (space == null) { logger.info(spaceName + " space is disabled"); return null; } <START> logger.debug("Resolving " + spaceName + ": " + space.getAllRealURIs()); <END> try { space = space.ensureExistingOrSwitch(!input); } catch (Exception e) { logger.info("Error occurred when switching to alternate space root", e); logger.info(spaceName + " space is disabled"); return null; } if (space == null) { logger.info("No existing " + spaceName + " space found"); logger.info(spaceName + " space is disabled"); } else { logger.debug(spaceName + " space is " + space.getRealURI()); logger.debug("(other available urls for " + spaceName + " space are " + space.getAllRealURIs() + " )"); } return space; }</code><technical_language>if (logger.isDebugEnabled())? space.getAllRealURIs() is free</technical_language>

Target:
private DataSpacesFileObject resolveToExisting(DataSpacesFileObject space, String spaceName, boolean input) { if (space == null) { logger.info(spaceName + " space is disabled"); return null; } if (logger.isDebugEnabled()) { logger.debug("Resolving " + spaceName + ": " + space.getAllRealURIs()); } try { space = space.ensureExistingOrSwitch(!input); } catch (Exception e) { logger.info("Error occurred when switching to alternate space root", e); logger.info(spaceName + " space is disabled"); return null; } if (space == null) { logger.info("No existing " + spaceName + " space found"); logger.info(spaceName + " space is disabled"); } else { logger.debug(spaceName + " space is " + space.getRealURI()); logger.debug("(other available urls for " + spaceName + " space are " + space.getAllRealURIs() + " )"); } return space; }
Source:
<code>public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { Command command = (Command) msg; <START> command.setChannelHandlerContext(ctx); <END> synchronized (commandQueue) { boolean isEmpty = commandQueue.isEmpty(); boolean isAsync = command.getCommandType().isAsync(); if (!isAsync && isEmpty) { executeCommand(command); return; } commandQueue.offer(command); if (isAsync && isEmpty) { startAsyncCommandExecution(command); } } }</code><technical_language>I this read a bit this: synchronized (commandQueue) { boolean isEmpty = commandQueue.isEmpty(); boolean isAsync = command.getCommandType().isAsync(); if (!isEmpty) { commandQueue.offer(command); return; } if (!isAsync) { executeCommand(command); } else { commandQueue.offer(command); startAsyncCommandExecution(command); } }</technical_language>

Target:
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { Command command = (Command) msg; command.setChannelHandlerContext(ctx); synchronized (commandQueue) { if (!commandQueue.isEmpty()) { commandQueue.offer(command); return; } if (command.getCommandType().isAsync()) { commandQueue.offer(command); startAsyncCommandExecution(command); return; } executeCommand(command); } }
Source:
<code>protected VDSParametersBase getVDSParameters() { HashMap<String,String> httpHeaders = new HashMap<>(); String XAuthToken = getProviderProxy().getXAuthToken(); if (XAuthToken != null) { <START> httpHeaders.put("X-Auth-Token", XAuthToken); <END> } String imageUrl = getProviderProxy().getImageUrl(getEnclosingCommand().getParameters().getSourceRepoImageId()); return new DownloadImageVDSCommandParameters( getEnclosingCommand().getParameters().getStoragePoolId(), getEnclosingCommand().getParameters().getStorageDomainId(), getEnclosingCommand().getParameters().getImageGroupID(), getEnclosingCommand().getParameters().getDestinationImageId(), new HttpLocationInfo(imageUrl, httpHeaders) ); }</code><technical_language>consider helper class/method handle</technical_language>

Target:
protected VDSParametersBase getVDSParameters() { return new DownloadImageVDSCommandParameters( getEnclosingCommand().getParameters().getStoragePoolId(), getEnclosingCommand().getParameters().getStorageDomainId(), getEnclosingCommand().getParameters().getImageGroupID(), getEnclosingCommand().getParameters().getDestinationImageId(), new HttpLocationInfo( getProviderProxy().getImageUrl(getEnclosingCommand().getParameters().getSourceRepoImageId()), getProviderProxy().getDownloadHeaders()) ); }
Source:
<code>public void markGroupSeen(GroupKey<?> groupKey, boolean seen, long examinerID) throws TskCoreException { String cacheKey = groupKey.getDataSourceObjId() + "_" + groupKey.getValueDisplayName() + "_" + groupKey.getAttribute().getDisplayName(); <START> Boolean cachedValue = groupSeenCache.getIfPresent(cacheKey); <END> if (cachedValue != null && cachedValue == seen) { return; } String innerQuery = String.format("( SELECT group_id FROM " + GROUPS_TABLENAME + " WHERE attribute = \'%s\' AND value = \'%s\' and data_source_obj_id = %d )", SleuthkitCase.escapeSingleQuotes(groupKey.getAttribute().attrName.toString()), SleuthkitCase.escapeSingleQuotes(groupKey.getValueDisplayName()), groupKey.getAttribute() == DrawableAttribute.PATH ? groupKey.getDataSourceObjId() : 0); String insertSQL = String.format(" (group_id, examiner_id, seen) VALUES (%s, %d, %d)", innerQuery, examinerID, seen ? 1 : 0); if (DbType.POSTGRESQL == tskCase.getDatabaseType()) { insertSQL += String.format(" ON CONFLICT (group_id, examiner_id) DO UPDATE SET seen = %d", seen ? 1 : 0); } tskCase.getCaseDbAccessManager().insertOrUpdate(GROUPS_SEEN_TABLENAME, insertSQL); groupSeenCache.put(cacheKey, seen); }</code><technical_language>is a reason groupKey cacheKey directly</technical_language>

Target:
public void markGroupSeen(GroupKey<?> groupKey, boolean seen, long examinerID) throws TskCoreException { Boolean cachedValue = groupSeenCache.getIfPresent(groupKey); if (cachedValue != null && cachedValue == seen) { return; } String innerQuery = String.format("( SELECT group_id FROM " + GROUPS_TABLENAME + " WHERE attribute = \'%s\' AND value = \'%s\' and data_source_obj_id = %d )", SleuthkitCase.escapeSingleQuotes(groupKey.getAttribute().attrName.toString()), SleuthkitCase.escapeSingleQuotes(groupKey.getValueDisplayName()), groupKey.getAttribute() == DrawableAttribute.PATH ? groupKey.getDataSourceObjId() : 0); String insertSQL = String.format(" (group_id, examiner_id, seen) VALUES (%s, %d, %d)", innerQuery, examinerID, seen ? 1 : 0); if (DbType.POSTGRESQL == tskCase.getDatabaseType()) { insertSQL += String.format(" ON CONFLICT (group_id, examiner_id) DO UPDATE SET seen = %d", seen ? 1 : 0); } tskCase.getCaseDbAccessManager().insertOrUpdate(GROUPS_SEEN_TABLENAME, insertSQL); groupSeenCache.put(groupKey, seen); }
Source:
<code>public void shouldBeAbleToRemoveHealthMetricConfiguredGlobally() throws Exception { List<FolderHealthMetric> healthMetrics = new ArrayList<>(1); healthMetrics.add(new WorstChildHealthMetric(true)); AbstractFolderConfiguration.get().setHealthMetrics(healthMetrics); <START> assertThat("by default, global configuration should not have any folder health metrics", <END> AbstractFolderConfiguration.get().getHealthMetrics(), hasSize((int) FolderHealthMetricDescriptor.all().stream().filter(d -> d.createDefault() != null).count())); HtmlForm cfg = r.createWebClient().goTo("configure").getFormByName("config"); for (HtmlElement element : cfg.getElementsByAttribute("div", "name", "healthMetrics")) { element.remove(); } r.submit(cfg); assertThat("deleting all global metrics should result in an empty list", AbstractFolderConfiguration.get().getHealthMetrics(), hasSize(0)); }</code><technical_language>Remove this assertion **now** sense checked in FolderTest</technical_language>

Target:
public void shouldBeAbleToRemoveHealthMetricConfiguredGlobally() throws Exception { List<FolderHealthMetric> healthMetrics = new ArrayList<>(1); healthMetrics.add(new WorstChildHealthMetric(true)); AbstractFolderConfiguration.get().setHealthMetrics(healthMetrics); HtmlForm cfg = r.createWebClient().goTo("configure").getFormByName("config"); for (HtmlElement element : cfg.getElementsByAttribute("div", "name", "healthMetrics")) { element.remove(); } r.submit(cfg); assertThat("deleting all global metrics should result in an empty list", AbstractFolderConfiguration.get().getHealthMetrics(), hasSize(0)); }
Source:
<code>private boolean isISOCompatible( File iso, RpmVersion ovirtHostOsVersion ) { boolean ret = false; log.debugFormat("Check if ISO compatible: {0}", iso); <START> String FileName = iso.getName(); <END> Path path = Paths.get(iso.toString()); try { if (Files.isSymbolicLink(path)) { FileName = Files.readSymbolicLink(path).getFileName().toString(); } } catch(java.nio.file.NotLinkException e) { } catch(IOException e) { log.errorFormat( "Cannot find iso [{0}] [{1}]", path, ExceptionUtils.getMessage(e) ); } for (OVirtNodeInfo.Entry info : OVirtNodeInfo.getInstance().get()) { if (info.path.equals(iso.getParentFile())) { Matcher matcher = info.isoPattern.matcher(FileName); if (matcher.find()) { String rpmLike = matcher.group(1).replaceAll("-", "."); log.debugFormat("ISO version: {0} {1} {2}", iso, rpmLike, ovirtHostOsVersion); RpmVersion isoVersion = new RpmVersion(rpmLike, "", true); if (VdsHandler.isIsoVersionCompatibleForUpgrade(ovirtHostOsVersion, isoVersion)) { log.debugFormat("ISO compatible: {0}", iso); ret = true; break; } } } } return ret; }</code><technical_language>same.... iso.getCanonicalPath()</technical_language>

Target:
private boolean isISOCompatible( File iso, RpmVersion ovirtHostOsVersion ) { boolean ret = false; log.debugFormat("Check if ISO compatible: {0}", iso); for (OVirtNodeInfo.Entry info : OVirtNodeInfo.getInstance().get()) { if (info.path.equals(iso.getParentFile())) { try { Matcher matcher = info.isoPattern.matcher( iso.getCanonicalPath().substring(iso.getCanonicalPath().lastIndexOf("/")+1) ); if (matcher.find()) { String rpmLike = matcher.group(1).replaceAll("-", "."); log.debugFormat("ISO version: {0} {1} {2}", iso, rpmLike, ovirtHostOsVersion); RpmVersion isoVersion = new RpmVersion(rpmLike, "", true); if (VdsHandler.isIsoVersionCompatibleForUpgrade(ovirtHostOsVersion, isoVersion)) { log.debugFormat("ISO compatible: {0}", iso); ret = true; break; } } } catch (IOException e) { log.errorFormat( "Cannot get canonical path to {0} with error {1}", iso.getName(), ExceptionUtils.getMessage(e) ); } } } return ret; }
Source:
<code>public void saveFile() throws IOException { File file = new File(pathOfOldMetaFormat); <START> testMetaOldFormat = FileReader.readFileToByteArray(file); <END> file = new File("src/test/resources/testmetaUnsupportedFormat.xml"); testmetaUnsupportedFormat = FileReader.readFileToByteArray(file); }</code><technical_language>Please [IOUtils.toByteArray()](<LINK_0> Apache Commons IO. adjust file pom.xml, I checked. (The more times lines lower.)</technical_language>

Target:
public void saveFile() throws IOException { File file = new File(pathOfOldMetaFormat); testMetaOldFormat = IOUtils.toByteArray(file.toURI()); file = new File("src/test/resources/testmetaUnsupportedFormat.xml"); testmetaUnsupportedFormat = IOUtils.toByteArray(file.toURI()); }
Source:
<code>private Tracer getTracer() { <START> return tracerRegistry.getTracer(minionIdentity.getId()+"@"+minionIdentity.getLocation()); <END> }</code><technical_language>flip location id of systems location a "grouped" in Jaeger UI</technical_language>

Target:
private Tracer getTracer() { return tracerRegistry.getTracer(minionIdentity.getLocation() + "@" + minionIdentity.getId()); }
Source:
<code>protected boolean canDoAction() { GlusterVolumeEntity glusterVolume = getGlusterVolume(); if (!super.canDoAction()) { return false; } if (!glusterVolume.isOnline()) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_SHOULD_BE_STARTED); } GlusterAsyncTask asyncTask = glusterVolume.getAsyncTask(); if (asyncTask != null && asyncTask.getType() == GlusterTaskType.REMOVE_BRICK) { GlusterVolumeRemoveBricksParameters params = (GlusterVolumeRemoveBricksParameters)getParameters(); if (params.getBricks().isEmpty()) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_BRICKS_REQUIRED); } <START> List<GlusterBrickEntity> bricksForTask = getGlusterBrickDao().getGlusterVolumeBricksByTaskId(asyncTask.getTaskId()); <END> List<GlusterBrickEntity> paramBricks = params.getBricks(); if (paramBricks.size() != bricksForTask.size()) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_REMOVE_BRICKS_PARAMS_SIZE_DOES_NOT_MATCH); } int counter = 0; for (GlusterBrickEntity paramBrick : paramBricks) { for (GlusterBrickEntity brick : bricksForTask) { if (paramBrick.getBrickDirectory().equals(brick.getBrickDirectory())) { break; } counter++; if (counter == bricksForTask.size()) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_REMOVE_BRICKS_PARAMS_INVALID); } } } } return true; }</code><technical_language>In case of startRemoveBrick, bricksForTask empty</technical_language>

Target:
protected boolean canDoAction() { GlusterVolumeEntity glusterVolume = getGlusterVolume(); if (!super.canDoAction()) { return false; } if (!glusterVolume.isOnline()) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_SHOULD_BE_STARTED); } return true; }
Source:
<code>public void test_init() throws IOException, InterruptedException { Run runSrc = Mockito.mock(Run.class); AbstractBuild abDst = Mockito.mock(AbstractBuild.class); for (C c : new C[] {new C1(), new C2(), new C3()}) { c.init(runSrc, abDst, null, null); Assert.assertEquals(1, c.callCnt); } C4 c4 = new C4(); c4.init(runSrc, abDst, null, null); Assert.assertEquals(2, c4.callCnt); testRunDst(new C1(), 1); testRunDst(new C2(), 1); testRunDst(new C4(), 1); try { testRunDst(new C3(), 0); Assert.fail("expected AbstractMethodError"); } catch (AbstractMethodError e) { Assert.assertEquals("Invalid call to Copier.init(Run src, Run dst, FilePath, FilePath), passing an AbstractBuild " + "instance for the 'dst' arg when hudson.plugins.copyartifact.CopierTest$C3 does not implement the deprecated " + <START> "version of 'init' that takes an AbstractBuild. Please supply a Run instance for the 'dst' arg.", e.getMessage()); <END> } }</code><technical_language>This works, suffice assertTrue(e.getMessage(), e.getMessage().contains(C3.class.getName()));</technical_language>

Target:
public void test_init() throws IOException, InterruptedException { Run runSrc = Mockito.mock(Run.class); AbstractBuild abDst = Mockito.mock(AbstractBuild.class); for (C c : new C[] {new C1(), new C2(), new C3()}) { c.init(runSrc, abDst, null, null); Assert.assertEquals(1, c.callCnt); } C4 c4 = new C4(); c4.init(runSrc, abDst, null, null); Assert.assertEquals(2, c4.callCnt); testRunDst(new C1(), 1); testRunDst(new C2(), 1); testRunDst(new C4(), 1); try { testRunDst(new C3(), 0); Assert.fail("expected AbstractMethodError"); } catch (AbstractMethodError e) { Assert.assertEquals("Invalid call to Copier.initialize(Run src, Run dst, FilePath, FilePath), passing an AbstractBuild " + "instance for the 'dst' arg when hudson.plugins.copyartifact.CopierTest$C3 does not implement the deprecated " + "version of 'init' that takes an AbstractBuild. Please supply a Run instance for the 'dst' arg.", e.getMessage()); } }
Source:
<code>public CauseOfBlockage getCauseOfBlockage() { ResourceActivity r = getBlockingActivity(task); if (r != null) { if (r == task) return CauseOfBlockage.fromMessage(Messages._Queue_InProgress()); return CauseOfBlockage.fromMessage(Messages._Queue_BlockedBy(r.getDisplayName())); } <START> if (causeOfBlockage != null) { <END> return causeOfBlockage; } return task.getCauseOfBlockage(); }</code><technical_language>Fine for me. checked calling getBlockingActivity() speedup more. needs more feedback @jenkinsci/code-reviewers</technical_language>

Target:
public CauseOfBlockage getCauseOfBlockage() { if (causeOfBlockage != null) { return causeOfBlockage; } return getCauseOfBlockageForItem(this); }
Source:
<code>public QueryImplementor createQuery(String queryString) { SessionImpl session = (SessionImpl) delegate; QueryImpl queryImplementor = (QueryImpl) session.createQuery( queryString ); <START> OgmQueryImplFacade ogmQueryImplFacade = new OgmQueryImplFacade( queryImplementor ); <END> return ogmQueryImplFacade; }</code><technical_language>java super.createQuery( queryString) obtain instance of **OgmQueryImplFacade**</technical_language>

Target:
public QueryImplementor createQuery(String queryString) { QueryImpl queryImplementor = (QueryImpl) super.createQuery( queryString ); return new OgmQueryImpl( queryImplementor ); }
Source:
<code>public ActivityLogEntry(String servlet, String act, AccountAttributes acc, String params, String link){ time = System.currentTimeMillis(); servletName = servlet; action = act; toShow = true; message = params; url = link; if (acc == null){ role = "Unknown"; name = "Unknown"; googleId = "Unknown"; email = "Unknown"; } else { role = acc.isInstructor ? "Instructor" : "Student"; name = acc.name; googleId = acc.googleId; email = acc.email; } <START> id = googleId + time; <END> role = changeRoleToAutoIfAutomatedActions(servletName, role); }</code><technical_language>formatCurrentTimeForId() line 217 below? for line 115. pass time a parameter function for general cases current time only</technical_language>

Target:
public ActivityLogEntry(String servlet, String act, AccountAttributes acc, String params, String link){ time = System.currentTimeMillis(); servletName = servlet; action = act; toShow = true; message = params; url = link; if (acc == null){ role = "Unknown"; name = "Unknown"; googleId = "Unknown"; email = "Unknown"; } else { role = acc.isInstructor ? "Instructor" : "Student"; name = acc.name; googleId = acc.googleId; email = acc.email; } id = googleId + formatTimeForId(new Date(time)); role = changeRoleToAutoIfAutomatedActions(servletName, role); }
Source:
<code>public AgentInstance buildEntityFromRequestBody(Request req) { <START> return null; <END> }</code><technical_language>throw exception? this is intended use</technical_language>

Target:
public AgentInstance buildEntityFromRequestBody(Request req) { throw new UnsupportedOperationException(); }
Source:
<code>protected void format() throws EmailException { formatBranch(); appendText(velocifyFile("BranchFooter.vm")); for (Account.Id thisOwner : owners) { <START> appendText("Gerrit-Owner: " + getNameEmailFor(thisOwner) + "\n"); <END> } }</code><technical_language>I this is valuable? care project/branch owners are? Is info sensitive even</technical_language>

Target:
protected void format() throws EmailException { formatBranch(); appendText(velocifyFile("BranchFooter.vm")); }
Source:
<code>protected String getNonCompilablePath(String filename) throws IOException { <START> return new File("src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/" <END> + filename).getCanonicalPath(); }</code><technical_language>replce com/puppycrawl... getPackageLocation()</technical_language>

Target:
protected final String getNonCompilablePath(String filename) throws IOException { return new File("src/test/resources-noncompilable/" + getPackageLocation() + filename).getCanonicalPath(); }
Source:
<code>public Response status(@Context ServletContext servletContext) { final Map<String, String> status = new HashMap<>(); status.putAll(manifestUtil.getFrom()); if (inventoryService.isRunning()) { status.put("status", "UP"); return Response.ok(status).build(); } else { status.put("status", "DOWN"); <START> return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(status).build(); <END> } }</code><technical_language>503 Service Unavailable more I</technical_language>

Target:
public Response status(@Context ServletContext servletContext) { final Map<String, String> status = new HashMap<>(); status.putAll(manifestUtil.getFrom()); if (inventoryService.isRunning()) { status.put("status", "UP"); return Response.ok(status).build(); } else { status.put("status", "DOWN"); return Response.status(Response.Status.SERVICE_UNAVAILABLE).entity(status).build(); } }
Source:
<code>public void generateResponse(StaplerRequest req, StaplerResponse rsp, Object node) throws IOException, ServletException { if (!ResourceDomainConfiguration.isResourceRequest(req) && ResourceDomainConfiguration.isResourceDomainConfigured()) { <START> resourceRootUrlKey = ExtensionList.lookupSingleton(ResourceDomainRootAction.class).register(this, req); <END> } try { serveFile(req,rsp,base,icon,serveDirIndex); } catch (InterruptedException e) { throw new IOException("interrupted",e); } }</code><technical_language>register renamed consistent current approach (was more meaningful stateful). Proposal: generateToken</technical_language>

Target:
public void generateResponse(StaplerRequest req, StaplerResponse rsp, Object node) throws IOException, ServletException { if (!ResourceDomainConfiguration.isResourceRequest(req) && ResourceDomainConfiguration.isResourceDomainConfigured()) { resourceToken = ResourceDomainRootAction.get().getToken(this, req); } try { serveFile(req,rsp,base,icon,serveDirIndex); } catch (InterruptedException e) { throw new IOException("interrupted",e); } }
Source:
<code>public R invoke(InvokeContext context, M message, BiFunction<InvokeContext, M, R> invokeFunction) throws EntityUserException { if (trackerPolicy.test(message) && context.isValidClientInformation()) { ClientSourceId clientId = context.getClientSource(); int index = segmentationStrategy.applyAsInt(message); Tracker<R> messageTracker = clientMessageTrackers.get(index).getTracker(clientId); messageTracker.reconcile(context.getOldestTransactionId()); R response = messageTracker.getTrackedValue(context.getCurrentTransactionId()); if (sharedMessageTracker.getTrackedClients().contains(clientId)) { Tracker<R> sharedTracker = sharedMessageTracker.getTracker(clientId); sharedTracker.reconcile(context.getOldestTransactionId()); <START> if (response == null) { <END> response = sharedTracker.getTrackedValue(context.getCurrentTransactionId()); } } if (response != null) { return response; } response = invokeFunction.apply(context, message); messageTracker.track(context.getCurrentTransactionId(), message, response); return response; } else { return invokeFunction.apply(context, message); } }</code><technical_language>I move if sharedMessageTracker check is cheaper</technical_language>

Target:
public R invoke(InvokeContext context, M message, BiFunction<InvokeContext, M, R> invokeFunction) throws EntityUserException { if (trackerPolicy.test(message) && context.isValidClientInformation()) { ClientSourceId clientId = context.getClientSource(); int index = segmentationStrategy.applyAsInt(message); Tracker<R> messageTracker = clientMessageTrackers.get(index).getTracker(clientId); messageTracker.reconcile(context.getOldestTransactionId()); R response = messageTracker.getTrackedValue(context.getCurrentTransactionId()); if (response == null && sharedMessageTracker.getTrackedClients().contains(clientId)) { Tracker<R> sharedTracker = sharedMessageTracker.getTracker(clientId); sharedTracker.reconcile(context.getOldestTransactionId()); response = sharedTracker.getTrackedValue(context.getCurrentTransactionId()); } if (response != null) { return response; } response = invokeFunction.apply(context, message); messageTracker.track(context.getCurrentTransactionId(), message, response); return response; } else { return invokeFunction.apply(context, message); } }
Source:
<code>private SqlSchema convertSchema(List<Schema.Field> fields) { SqlSchemaBuilder schemaBuilder = SqlSchemaBuilder.builder(); for (Schema.Field field : fields) { SqlFieldSchema fieldSchema = convertField(field.schema()); schemaBuilder.addField(field.name(), fieldSchema); } <START> return schemaBuilder.build(); <END> }</code><technical_language>need guard this fields is empty</technical_language>

Target:
private SqlSchema convertSchema(List<Schema.Field> fields) { Validate.notEmpty(fields, "Fields cannot be empty"); SqlSchemaBuilder schemaBuilder = SqlSchemaBuilder.builder(); for (Schema.Field field : fields) { SqlFieldSchema fieldSchema = convertField(field.schema()); schemaBuilder.addField(field.name(), fieldSchema); } return schemaBuilder.build(); }
Source:
<code>public void activate(final BundleContext bundleContext, final Map<String, Object> configuration) { logger.debug("activate()"); try { startup(PanStampBindingSettings.parseConfig(configuration)); } catch (ValueException e) { <START> logger.error(e.getMessage()); <END> } }</code><technical_language>Possibly more descriptive error message</technical_language>

Target:
public void activate(final BundleContext bundleContext, final Map<String, Object> configuration) { logger.debug("activate()"); try { startup(PanStampBindingSettings.parseConfig(configuration)); } catch (ValueException e) { logger.error("Configuration error: ", e.getMessage()); } }
Source:
<code>default File resolve(File path) { <START> return path.isAbsolute() ? path : new VoltFile(getVoltDBRoot(), path.getPath()); <END> }</code><technical_language>dont VoltFile this is for new cli right</technical_language>

Target:
default File resolve(File path) { return path.isAbsolute() ? path : new File(getVoltDBRoot(), path.getPath()); }