auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void scrobbleBroadcast() { Song song = mCurrentSong; if (song == null) return; if (!mStockBroadcast && !mScrobble) return; long[] androidIds = MediaUtils.getAndroidMediaIds(getApplicationContext(), song); if (mStockBroadcast) { Intent intent = new Intent("com.android.music.playstatechanged"); intent.putExtra("playing", (mState & FLAG_PLAYING) != 0); intent.putExtra("track", song.title); intent.putExtra("album", song.album); intent.putExtra("artist", song.artist); if (song.mbid != null) intent.putExtra("mbid", song.mbid); sendBroadcast(intent); } if (mScrobble) { Intent intent = new Intent("net.jjc1138.android.scrobbler.action.MUSIC_STATUS"); intent.putExtra("playing", (mState & FLAG_PLAYING) != 0); intent.putExtra("secs", (int)song.duration / 1000); <START> intent.putExtra("clashWithScrobbleDroid", "1"); <END> intent.putExtra("track", song.title); intent.putExtra("album", song.album); intent.putExtra("artist", song.artist); if (song.mbid != null) intent.putExtra("mb-trackid", song.mbid); sendBroadcast(intent); } }</code><technical_language>this line mean</technical_language>

Target:
private void scrobbleBroadcast() { Song song = mCurrentSong; if (song == null) return; if (!mStockBroadcast && !mScrobble) return; long[] androidIds = MediaUtils.getAndroidMediaIds(getApplicationContext(), song); if (mStockBroadcast) { Intent intent = new Intent("com.android.music.playstatechanged"); intent.putExtra("playing", (mState & FLAG_PLAYING) != 0); intent.putExtra("track", song.title); intent.putExtra("album", song.album); intent.putExtra("artist", song.artist); if (song.mbid != null) intent.putExtra("mbid", song.mbid); sendBroadcast(intent); } if (mScrobble) { Intent intent = new Intent("net.jjc1138.android.scrobbler.action.MUSIC_STATUS"); intent.putExtra("playing", (mState & FLAG_PLAYING) != 0); intent.putExtra("secs", (int)song.duration / 1000); intent.putExtra("track", song.title); intent.putExtra("album", song.album); intent.putExtra("artist", song.artist); if (song.mbid != null) intent.putExtra("mb-trackid", song.mbid); sendBroadcast(intent); } }
Source:
<code>private static TempFile createSingleColumnFileWithNullValues(int rows) throws IOException, ReflectiveOperationException, SerDeException { <START> @SuppressWarnings("deprecation") <END> Serializer serde = new OrcSerde(); TempFile tempFile = new TempFile(); FileSinkOperator.RecordWriter writer = createOrcRecordWriter(tempFile.getFile(), ORC_12, CompressionKind.NONE, BIGINT); SettableStructObjectInspector objectInspector = createSettableStructObjectInspector("test", BIGINT); Object row = objectInspector.create(); StructField field = objectInspector.getAllStructFieldRefs().get(0); for (int i = 0; i < rows; i++) { if (i % 10 == 0) { objectInspector.setStructFieldData(row, field, null); } else { objectInspector.setStructFieldData(row, field, (long) i); } Writable record = serde.serialize(row, objectInspector); writer.write(record); } writer.close(false); return tempFile; }</code><technical_language>nit: suppress deprecations</technical_language>

Target:
private static TempFile createSingleColumnFileWithNullValues(int rows) throws IOException, ReflectiveOperationException, SerDeException { Serializer serde = new OrcSerde(); TempFile tempFile = new TempFile(); FileSinkOperator.RecordWriter writer = createOrcRecordWriter(tempFile.getFile(), ORC_12, CompressionKind.NONE, BIGINT); SettableStructObjectInspector objectInspector = createSettableStructObjectInspector("test", BIGINT); Object row = objectInspector.create(); StructField field = objectInspector.getAllStructFieldRefs().get(0); for (int i = 0; i < rows; i++) { if (i % 10 == 0) { objectInspector.setStructFieldData(row, field, null); } else { objectInspector.setStructFieldData(row, field, (long) i); } Writable record = serde.serialize(row, objectInspector); writer.write(record); } writer.close(false); return tempFile; }
Source:
<code>private List<MetricDto> searchMetrics(DbSession dbSession, ComponentTreeWsRequest request) { List<String> metricKeys = requireNonNull(request.getMetricKeys()); List<MetricDto> metrics = dbClient.metricDao().selectByKeys(dbSession, metricKeys); if (metrics.size() < metricKeys.size()) { List<String> foundMetricKeys = Lists.transform(metrics, MetricDto::getKey); Set<String> missingMetricKeys = Sets.difference( new LinkedHashSet<>(metricKeys), new LinkedHashSet<>(foundMetricKeys)); throw new NotFoundException(format("The following metric keys are not found: %s", COMA_JOINER.join(missingMetricKeys))); } Set<String> forbiddenMetrics = new TreeSet<>(metrics.stream() .filter(metric -> ComponentTreeAction.FORBIDDEN_METRIC_TYPES.contains(metric.getValueType())) .map(MetricDto::getKey) .collect(Collectors.toSet())); <START> checkArgument(forbiddenMetrics.isEmpty(), "Metric types '%s' and '%s' are not allowed : %s", DATA.name(), DISTRIB.name(), COMA_JOINER.join(forbiddenMetrics)); <END> return metrics; }</code><technical_language>Manually listing values removes benefit FORBIDDEN_METRIC_TYPES. I suggest simply remove coupling changing label: checkArgument(forbiddenMetrics.isEmpty(), "Metrics %s requested in this web service. Please api/measures/component", COMMA_JOINER.join(forbiddenMetrics)); need for COMMA_JOINER. join keys stream (.sorted(...).collect(Collectors.joining(', ')))</technical_language>

Target:
private List<MetricDto> searchMetrics(DbSession dbSession, ComponentTreeWsRequest request) { List<String> metricKeys = requireNonNull(request.getMetricKeys()); List<MetricDto> metrics = dbClient.metricDao().selectByKeys(dbSession, metricKeys); if (metrics.size() < metricKeys.size()) { List<String> foundMetricKeys = Lists.transform(metrics, MetricDto::getKey); Set<String> missingMetricKeys = Sets.difference( new LinkedHashSet<>(metricKeys), new LinkedHashSet<>(foundMetricKeys)); throw new NotFoundException(format("The following metric keys are not found: %s", COMA_JOINER.join(missingMetricKeys))); } String forbiddenMetrics = metrics.stream() .filter(metric -> ComponentTreeAction.FORBIDDEN_METRIC_TYPES.contains(metric.getValueType())) .map(MetricDto::getKey) .sorted() .collect(Collectors.join(COMA_JOINER)); checkArgument(forbiddenMetrics.isEmpty(), "Metrics %s can't be requested in this web service. Please use api/measures/component", forbiddenMetrics); return metrics; }
Source:
<code>private Champ overwriteChildLink(final int bitpos, final Pair<Champ, Multihash> node) { final int setIndex = this.contents.length - 1 - index(nodeMap, bitpos); final HashPrefixPayload[] src = this.contents; final HashPrefixPayload[] dst = new HashPrefixPayload[src.length]; <START> System.arraycopy(src, 0, dst, 0, src.length); <END> dst[setIndex] = new HashPrefixPayload(null, MaybeMultihash.of(node.right)); return new Champ(dataMap, nodeMap, dst); }</code><technical_language>323-326 is repeated a bit, extract a utility method (or dst = Arrays.copyOf(src))</technical_language>

Target:
private Champ overwriteChildLink(final int bitpos, final Pair<Champ, Multihash> node) { final int setIndex = this.contents.length - 1 - getIndex(nodeMap, bitpos); final HashPrefixPayload[] src = this.contents; final HashPrefixPayload[] dst = Arrays.copyOf(src, src.length); dst[setIndex] = new HashPrefixPayload(MaybeMultihash.of(node.right)); return new Champ(dataMap, nodeMap, dst); }
Source:
<code>private void updateTaskStatuses( Map<Guid, Map<Guid, AsyncTaskStatus>> poolsAllTasksMap) { for (SPMTask task : _tasks.values()) { if (task.getShouldPoll()) { Map<Guid, AsyncTaskStatus> asyncTasksForPoolMap = poolsAllTasksMap .get(task.getStoragePoolID()); if (asyncTasksForPoolMap != null) { AsyncTask asyncTask = task.getParameters().getDbAsyncTask(); CommandEntity rootCmdEntity = coco.getCommandEntity(asyncTask.getRootCommandId()); if (rootCmdEntity != null && !rootCmdEntity.isExecuted()) { <START> task.setPartiallyCompletedCommandTask(true); <END> } AsyncTaskStatus cachedAsyncTaskStatus = asyncTasksForPoolMap .get(task.getVdsmTaskId()); task.updateTask(cachedAsyncTaskStatus); } } } }</code><technical_language>Lets move this check running endAction(). run this code time for command's tasks, instead of polling for task</technical_language>

Target:
private void updateTaskStatuses( Map<Guid, Map<Guid, AsyncTaskStatus>> poolsAllTasksMap) { for (SPMTask task : _tasks.values()) { if (task.getShouldPoll()) { Map<Guid, AsyncTaskStatus> asyncTasksForPoolMap = poolsAllTasksMap .get(task.getStoragePoolID()); if (asyncTasksForPoolMap != null) { AsyncTaskStatus cachedAsyncTaskStatus = asyncTasksForPoolMap .get(task.getVdsmTaskId()); task.updateTask(cachedAsyncTaskStatus); } } } }
Source:
<code>public synchronized List<IMarkerEvent> getMarkerList(String category, long startTime, long endTime, long resolution, IProgressMonitor monitor) { if (!category.equals(LOST_EVENTS)) { return Collections.emptyList(); } int lostEventsQuark = getLostEventsQuark(); if (lostEventsQuark == -1) { return Collections.emptyList(); } long[] request = new long[] { startTime, endTime, resolution, fStateSystem.getCurrentEndTime() }; if (Arrays.equals(request, fLastRequest)) { return fLastMarkers; } List<IMarkerEvent> markers = new ArrayList<>(); try { final long start = Math.max(startTime, fStateSystem.getStartTime()); final long end = Math.min(endTime, fStateSystem.getCurrentEndTime()); if (start <= end) { List<ITmfStateInterval> intervals = StateSystemUtils.queryHistoryRange(checkNotNull(fStateSystem), lostEventsQuark, start, end, resolution, monitor); for (ITmfStateInterval interval : intervals) { if (interval.getStateValue().isNull()) { continue; } <START> long time = interval.getStartTime(); <END> long duration = interval.getStateValue().unboxLong() - time; IMarkerEvent marker = new MarkerEvent(null, time, duration, LOST_EVENTS, COLOR, null, false); markers.add(marker); } } } catch (AttributeNotFoundException | StateSystemDisposedException e) { } fLastRequest = request; fLastMarkers = Collections.unmodifiableList(markers); return fLastMarkers; }</code><technical_language>time -> startTime</technical_language>

Target:
public synchronized List<IMarkerEvent> getMarkerList(String category, long startTime, long endTime, long resolution, IProgressMonitor monitor) { if (!category.equals(LOST_EVENTS)) { return Collections.emptyList(); } ITmfStateSystem ss = getStateSystem(); if (ss == null) { return Collections.emptyList(); } int lostEventsQuark = getLostEventsQuark(ss); if (lostEventsQuark == -1) { return Collections.emptyList(); } long[] request = new long[] { startTime, endTime, resolution, ss.getCurrentEndTime() }; if (Arrays.equals(request, fLastRequest)) { return fLastMarkers; } List<IMarkerEvent> markers = new ArrayList<>(); try { final long start = Math.max(startTime, ss.getStartTime()); final long end = Math.min(endTime, ss.getCurrentEndTime()); if (start <= end) { List<ITmfStateInterval> intervals = StateSystemUtils.queryHistoryRange(ss, lostEventsQuark, start, end, resolution, monitor); for (ITmfStateInterval interval : intervals) { if (interval.getStateValue().isNull()) { continue; } long time = interval.getStartTime(); long duration = interval.getStateValue().unboxLong() - time; IMarkerEvent marker = new MarkerEvent(null, time, duration, LOST_EVENTS, COLOR, null, false); markers.add(marker); } } } catch (AttributeNotFoundException | StateSystemDisposedException e) { } fLastRequest = request; fLastMarkers = Collections.unmodifiableList(markers); return fLastMarkers; }
Source:
<code>public Group nextRow() throws TranslatorException, DataNotAvailableException { <START> while(true){ <END> try { Group row = nextRowInternal(); if (row == null) { return null; } return row; } catch (IOException e) { throw new TranslatorException(e); } } }</code><technical_language>is need for while</technical_language>

Target:
public Group nextRow() throws TranslatorException, DataNotAvailableException { try { Group row = nextRowInternal(); if (row == null) { return null; } return row; } catch (IOException e) { throw new TranslatorException(e); } }
Source:
<code>public Worker create(WorkerKey key) throws Exception { int workerId = pidCounter.getAndIncrement(); Path logFile = workerBaseDir.getRelative("worker-" + workerId + "-" + key.getMnemonic() + ".log"); Worker worker; boolean sandboxed = workerOptions.workerSandboxing || key.mustBeSandboxed(); <START> boolean proxyed = key.proxyed(); <END> if (sandboxed) { Path workDir = getSandboxedWorkerPath(key, workerId); worker = new SandboxedWorker(key, workerId, workDir, logFile); } else if (proxyed) { worker = new WorkerProxy(key, workerId, key.getExecRoot(), logFile); } else { worker = new Worker(key, workerId, key.getExecRoot(), logFile); } if (workerOptions.workerVerbose) { reporter.handle( Event.info( String.format( "Created new %s %s worker (id %d), logging to %s", sandboxed ? "sandboxed" : "non-sandboxed", key.getMnemonic(), workerId, logFile))); } return worker; }</code><technical_language>nit: Do need extra variable? If key.proxyed() is expensive computation, inline this necessary reduce cognitive load</technical_language>

Target:
public Worker create(WorkerKey key) throws Exception { int workerId = pidCounter.getAndIncrement(); Path logFile = workerBaseDir.getRelative("worker-" + workerId + "-" + key.getMnemonic() + ".log"); Worker worker; boolean sandboxed = workerOptions.workerSandboxing || key.mustBeSandboxed(); if (sandboxed) { Path workDir = getSandboxedWorkerPath(key, workerId); worker = new SandboxedWorker(key, workerId, workDir, logFile); } else if (key.getProxied()) { worker = new WorkerProxy(key, workerId, key.getExecRoot(), logFile, WorkerMultiplexerManager.getInstance(key.hashCode())); } else { worker = new Worker(key, workerId, key.getExecRoot(), logFile); } if (workerOptions.workerVerbose) { reporter.handle( Event.info( String.format( "Created new %s %s worker (id %d), logging to %s", sandboxed ? "sandboxed" : "non-sandboxed", key.getMnemonic(), workerId, logFile))); } return worker; }
Source:
<code>public static boolean dimensionMatchesType(WorldProvider provider, String type) { Set<String> dimTypes = getDimensionTypes(provider); Queue<String> curTypes = new ArrayDeque<String>(); curTypes.add(type); String curType; <START> while ((curType = curTypes.poll()) != null) <END> { if (dimTypes.contains(curType)) return true; Type curT = types.get(curType); if (curT != null) curTypes.addAll(curT.subtypes); } return false; }</code><technical_language>is type string put a collection pull out of collection</technical_language>

Target:
public static boolean dimensionMatchesType(WorldProvider provider, String type) { Set<String> dimTypes = getDimensionTypes(provider); Queue<String> curTypes = new ArrayDeque<String>(); do { if (dimTypes.contains(type)) return true; Type curT = types.get(type); if (curT != null) curTypes.addAll(curT.subtypes); } while ((type = curTypes.poll()) != null); return false; }
Source:
<code>private void displayParents(final List<PatchSetInfo.ParentInfo> parents) { if (parents.size() == 0) { infoTable.setWidget(R_PARENTS, 1, new InlineLabel(Util.C.initialCommit())); return; } final Grid parentsTable = new Grid(parents.size(), 2); parentsTable.setStyleName(Gerrit.RESOURCES.css().parentsTable()); parentsTable.addStyleName(Gerrit.RESOURCES.css().noborder()); final CellFormatter ptfmt = parentsTable.getCellFormatter(); int row = 0; for (PatchSetInfo.ParentInfo parent : parents) { parentsTable.setWidget(row, 0, new InlineLabel(parent.id.get())); ptfmt.addStyleName(row, 0, Gerrit.RESOURCES.css().noborder()); ptfmt.addStyleName(row, 0, Gerrit.RESOURCES.css().monospace()); String parentMsg = parent.shortMessage; <START> if (parentMsg.length() > 80) { <END> parentMsg = parentMsg.substring(0, 77) + "..."; } parentsTable.setWidget(row, 1, new InlineLabel(parentMsg)); ptfmt.addStyleName(row, 1, Gerrit.RESOURCES.css().noborder()); row++; } infoTable.setWidget(R_PARENTS, 1, parentsTable); }</code><technical_language>I prefer constants hard-coded values</technical_language>

Target:
private void displayParents(final List<PatchSetInfo.ParentInfo> parents) { if (parents.size() == 0) { infoTable.setWidget(R_PARENTS, 1, new InlineLabel(Util.C.initialCommit())); return; } final Grid parentsTable = new Grid(parents.size(), 2); parentsTable.setStyleName(Gerrit.RESOURCES.css().parentsTable()); parentsTable.addStyleName(Gerrit.RESOURCES.css().noborder()); final CellFormatter ptfmt = parentsTable.getCellFormatter(); int row = 0; for (PatchSetInfo.ParentInfo parent : parents) { parentsTable.setWidget(row, 0, new InlineLabel(parent.id.get())); ptfmt.addStyleName(row, 0, Gerrit.RESOURCES.css().noborder()); ptfmt.addStyleName(row, 0, Gerrit.RESOURCES.css().monospace()); parentsTable.setWidget(row, 1, new InlineLabel(Util.cropSubject(parent.shortMessage))); ptfmt.addStyleName(row, 1, Gerrit.RESOURCES.css().noborder()); row++; } infoTable.setWidget(R_PARENTS, 1, parentsTable); }
Source:
<code>private <T, R> R calculateConfirmedVolume(GlusterVolumeEntity volume, Function<BrickProperties, T> field, Function<List<Stream<T>>, R> reduce) { List<BrickProperties> bricks = volume.getBricks().stream() .map(GlusterBrickEntity::getId) .map(b -> brickDao.getById(b)) .filter(Objects::nonNull) .map(GlusterBrickEntity::getBrickProperties) .collect(Collectors.toList()); if (bricks.stream().map(field).anyMatch(Objects::isNull)) { log.info("Volume have non-thin bricks, skipping confirmed free size calculation", volume.getName()); return null; } List<Stream<T>> replicaSets = new ArrayList<>(); switch (volume.getVolumeType()) { case REPLICATE: case DISTRIBUTED_REPLICATE: int replicaSize = bricks.size()/volume.getReplicaCount(); while (!bricks.isEmpty()) { int replicaCounter = 0; List<BrickProperties> set = new ArrayList<>(); <START> while(replicaCounter < replicaSize) { <END> set.add(bricks.get(0)); bricks.remove(0); replicaCounter++; } replicaSets.add(set.stream().map(field)); } break; default: replicaSets = Collections.singletonList(bricks.stream().map(field)); break; } return reduce.apply(replicaSets); }</code><technical_language>relation replicaCounter replicaSize. for instance if brick count is 6, replicaCount=3 - replicaSize = 2, add 2 bricks set is correct</technical_language>

Target:
private <T, R> R calculateConfirmedVolume(GlusterVolumeEntity volume, Function<BrickProperties, T> field, Function<List<Stream<T>>, R> reduce) { List<BrickProperties> bricks = volume.getBricks().stream() .map(GlusterBrickEntity::getId) .map(b -> brickDao.getById(b)) .filter(Objects::nonNull) .map(GlusterBrickEntity::getBrickProperties) .collect(Collectors.toList()); if (bricks.stream().map(field).anyMatch(Objects::isNull)) { log.info("Volume have non-thin bricks, skipping confirmed free size calculation", volume.getName()); return null; } List<Stream<T>> replicaSets = new ArrayList<>(); switch (volume.getVolumeType()) { case REPLICATE: case DISTRIBUTED_REPLICATE: while (!bricks.isEmpty()) { int replicaCounter = 0; List<BrickProperties> set = new ArrayList<>(); while(replicaCounter < volume.getReplicaCount() && !bricks.isEmpty()) { set.add(bricks.get(0)); bricks.remove(0); replicaCounter++; } replicaSets.add(set.stream().map(field)); } break; default: replicaSets = Collections.singletonList(bricks.stream().map(field)); break; } return reduce.apply(replicaSets); }
Source:
<code>public String unpackString() throws IOException { int strLen = unpackRawStringHeader(); if(strLen > 0) { if(strLen > config.getMaxUnpackStringSize()) { throw new MessageSizeException(String.format("cannot unpack a String of size larger than %,d: %,d", config.getMaxUnpackStringSize(), strLen), strLen); } prepareDecoder(); assert(decoder != null); decoder.reset(); try { int cursor = 0; decodeBuffer.clear(); StringBuilder sb = new StringBuilder(); while(cursor < strLen) { if(!ensureBuffer()) throw new EOFException(); int readLen = Math.min(buffer.size() - position, strLen-cursor); ByteBuffer bb = buffer.toByteBuffer(position, readLen); while(bb.hasRemaining()) { boolean endOfInput = (cursor + readLen) >= strLen; CoderResult cr = decoder.decode(bb, decodeBuffer, endOfInput); if(endOfInput && cr.isUnderflow()) cr = decoder.flush(decodeBuffer); if(cr.isOverflow()) { <START> readLen = bb.position() - bb.remaining(); <END> } if(cr.isError()) { if(cr.isMalformed() && config.getActionOnMalFormedInput() == CodingErrorAction.REPORT) { cr.throwException(); } else if(cr.isUnmappable() && config.getActionOnUnmappableCharacter() == CodingErrorAction.REPORT) { cr.throwException(); } } decodeBuffer.flip(); sb.append(decodeBuffer); decodeBuffer.clear(); cursor += readLen; consume(readLen); } } return sb.toString(); } catch(CharacterCodingException e) { throw new MessageStringCodingException(e); } } else return EMPTY_STRING; }</code><technical_language>explain bb.position() - bb.remaining()</technical_language>

Target:
public String unpackString() throws IOException { int strLen = unpackRawStringHeader(); if(strLen > 0) { if(strLen > config.getMaxUnpackStringSize()) { throw new MessageSizeException(String.format("cannot unpack a String of size larger than %,d: %,d", config.getMaxUnpackStringSize(), strLen), strLen); } prepareDecoder(); assert(decoder != null); decoder.reset(); try { int cursor = 0; decodeBuffer.clear(); StringBuilder sb = new StringBuilder(); while(cursor < strLen) { if(!ensureBuffer()) throw new EOFException(); int readLen = Math.min(buffer.size() - position, strLen-cursor); ByteBuffer bb = buffer.toByteBuffer(position, readLen); while(bb.hasRemaining()) { boolean endOfInput = (cursor + readLen) >= strLen; CoderResult cr = decoder.decode(bb, decodeBuffer, endOfInput); if(endOfInput && cr.isUnderflow()) cr = decoder.flush(decodeBuffer); if(cr.isOverflow()) { readLen = bb.limit() - bb.remaining(); decoder.reset(); } if(cr.isError()) { if((cr.isMalformed() && config.getActionOnMalFormedInput() == CodingErrorAction.REPORT) || (cr.isUnmappable() && config.getActionOnUnmappableCharacter() == CodingErrorAction.REPORT)) { cr.throwException(); } } decodeBuffer.flip(); sb.append(decodeBuffer); decodeBuffer.clear(); cursor += readLen; consume(readLen); } } return sb.toString(); } catch(CharacterCodingException e) { throw new MessageStringCodingException(e); } } else return EMPTY_STRING; }
Source:
<code>private void checkInputSize(byte[] bytes) { if (bytes.length > runtimeOptions.getUploadSize()) { logger.debug("Total size is greater than the allowed size {}", bytes.length, runtimeOptions.getUploadSize()); <START> throw new WebApplicationException("Upload size is greater than the allowed size.", <END> Response.Status.BAD_REQUEST); } }</code><technical_language>useful for users if allowed size is appended this message</technical_language>

Target:
private void checkInputSize(byte[] bytes) { if (bytes.length > runtimeOptions.getUploadSize()) { logger.debug("Total size is greater than the allowed size {}", bytes.length, runtimeOptions.getUploadSize()); throw new WebApplicationException("Upload size is greater than the allowed size: " + runtimeOptions.getUploadSize(), Response.Status.BAD_REQUEST); } }
Source:
<code>GdkRGBA gdk_color_to_rgba (GdkColor color) { GdkRGBA rgba = null; if (color != null) { <START> rgba = new GdkRGBA (); <END> rgba = display.toGdkRGBA (color); } return rgba; }</code><technical_language>display.toGdkRGBA returns null remove "rgba=new GdkRGBA()"</technical_language>

Target:
GdkRGBA gdk_color_to_rgba (GdkColor color) { GdkRGBA rgba = null; if (color != null) { rgba = display.toGdkRGBA (color); } return rgba; }
Source:
<code>protected void executeQueryCommand() { if (getParameters().getGlusterServerId() == null) { getQueryReturnValue().setReturnValue(getGlusterHookDao().getGlusterHookcontent(getParameters().getGlusterHookId())); } else { GlusterHookEntity hook = getGlusterHookDao().getById(getParameters().getGlusterHookId()); VDSReturnValue returnValue = runVdsCommand(VDSCommandType.GetGlusterHookContent, new GlusterHookVDSParameters(getParameters().getGlusterServerId(), hook.getGlusterCommand(), hook.getStage(), hook.getName())); <START> getQueryReturnValue().setReturnValue(returnValue.getReturnValue()); <END> } }</code><technical_language>vdsm return hook content in base64 encoded format, decoded return</technical_language>

Target:
protected void executeQueryCommand() { if (getParameters().getGlusterServerId() == null) { getQueryReturnValue().setReturnValue(getGlusterHookDao().getGlusterHookContent(getParameters().getGlusterHookId())); } else { GlusterHookEntity hook = getGlusterHookDao().getById(getParameters().getGlusterHookId()); VDSReturnValue returnValue = runVdsCommand(VDSCommandType.GetGlusterHookContent, new GlusterHookVDSParameters(getParameters().getGlusterServerId(), hook.getGlusterCommand(), hook.getStage(), hook.getName())); getQueryReturnValue().setReturnValue(returnValue.getReturnValue()); } }
Source:
<code>public void themeDefiningClassAndName_throwsException() throws ClassNotFoundException { Mockito.when(classFinder.getSubTypesOf(AppShellConfigurator.class)) .thenReturn(Collections.singleton(FaultyThemeAnnotation.class)); Mockito.when(classFinder.loadClass(FakeLumo.class.getName())) .thenReturn((Class) FakeLumo.class); IllegalStateException exception = Assert .assertThrows(IllegalStateException.class, () -> new FrontendDependencies(classFinder, false)); Assert.assertTrue("Unexpected message: " + exception.getMessage(), <START> exception.getMessage().startsWith( <END> "Theme name and theme class can not both be specified.")); }</code><technical_language>check entire message protect agains accidental modifucation/deletion of part of message</technical_language>

Target:
public void themeDefiningClassAndName_throwsException() throws ClassNotFoundException { Mockito.when(classFinder.getSubTypesOf(AppShellConfigurator.class)) .thenReturn(Collections.singleton(FaultyThemeAnnotation.class)); Mockito.when(classFinder.loadClass(FakeLumo.class.getName())) .thenReturn((Class) FakeLumo.class); IllegalStateException exception = Assert .assertThrows(IllegalStateException.class, () -> new FrontendDependencies(classFinder, false)); Assert.assertEquals("Unexpected message for the thrown exception", "Theme name and theme class can not both be specified. " + "Theme name uses Lumo and can not be used in combination with custom theme class.", exception.getMessage()); }
Source:
<code>public ComboBoxModel doFillPatternItems(@QueryParameter("serverName") @RelativePath("..") final String serverName) { ComboBoxModel cb = new ComboBoxModel(); if (serverName != null && !serverName.isEmpty()) { if (ANY_SERVER.equals(serverName)) { for (GerritServer server : PluginImpl.getInstance().getServers()) { <START> cb.addAll(server.getGerritProjects()); <END> } } else { cb.addAll(PluginImpl.getInstance().getServer(serverName).getGerritProjects()); } } return cb; }</code><technical_language>add projects a Set avoid duplicates put result model</technical_language>

Target:
public ComboBoxModel doFillPatternItems(@QueryParameter("serverName") @RelativePath("..") final String serverName) { Collection<String> projects = new HashSet<String>(); if (serverName != null && !serverName.isEmpty()) { if (ANY_SERVER.equals(serverName)) { for (GerritServer server : PluginImpl.getInstance().getServers()) { projects.addAll(server.getGerritProjects()); } } else { projects.addAll(PluginImpl.getInstance().getServer(serverName).getGerritProjects()); } } return new ComboBoxModel(projects); }
Source:
<code>public PhysicalSlot reserveFreeSlot(AllocationID allocationId, ResourceProfile requiredSlotProfile) { final AllocatedSlot allocatedSlot = slotPool.reserveFreeSlot(allocationId); Preconditions.checkState(allocatedSlot.getResourceProfile().isMatching(requiredSlotProfile), ""); <START> ResourceProfile previouslyMatchedResourceProfile = Preconditions.checkNotNull(slotToRequirementProfileMappings.get(allocationId)); updateSlotToRequirementProfileMapping(allocationId, requiredSlotProfile); <END> adjustRequirements(previouslyMatchedResourceProfile, requiredSlotProfile); return allocatedSlot; }</code><technical_language>I rethink need this mapping in this class live in wrapper. feels wrong DefaultDeclarativeSlotPool needs track for ResourceProfile a slot reserved</technical_language>

Target:
public PhysicalSlot reserveFreeSlot(AllocationID allocationId, ResourceProfile requiredSlotProfile) { final AllocatedSlot allocatedSlot = slotPool.reserveFreeSlot(allocationId); Preconditions.checkState( allocatedSlot.getResourceProfile().isMatching(requiredSlotProfile), "Slot cannot fulfill the given requirement. SlotProfile={} Requirement={}", allocationId, allocatedSlot.getResourceProfile(), requiredSlotProfile); ResourceProfile previouslyMatchedResourceProfile = Preconditions.checkNotNull(slotToRequirementProfileMappings.get(allocationId)); if (!previouslyMatchedResourceProfile.equals(requiredSlotProfile)) { LOG.debug( "Adjusting requirements because a slot was reserved for a different requirement than initially assumed. Slot={} assumedRequirement={} actualRequirement={}", allocationId, previouslyMatchedResourceProfile, requiredSlotProfile); updateSlotToRequirementProfileMapping(allocationId, requiredSlotProfile); adjustRequirements(previouslyMatchedResourceProfile, requiredSlotProfile); } return allocatedSlot; }
Source:
<code>public void deactivateOSPF() throws CapabilityException { OSPFService service = new OSPFService(); <START> service.setEnabledState(EnabledState.ENABLED); <END> IAction action = createActionAndCheckParams(OSPFActionSet.OSPF_DEACTIVATE, service); queueAction(action); }</code><technical_language>this EnabledState.DISABLED,</technical_language>

Target:
public void deactivateOSPF() throws CapabilityException { OSPFService service = new OSPFService(); service.setEnabledState(EnabledState.DISABLED); IAction action = createActionAndCheckParams(OSPFActionSet.OSPF_DEACTIVATE, service); queueAction(action); }
Source:
<code><START> void updateV2VJobInfos(List<V2VJobInfo> v2vJobInfos) { <END> for (V2VJobInfo existingJobInfo : vmIdToV2VJob.values()) { if (existingJobInfo.monitor() && !v2vJobInfos.contains(existingJobInfo)) { existingJobInfo.setStatus(JobStatus.ERROR); } } if (v2vJobInfos.isEmpty()) { return; } synchronized (vmIdToV2VJob) { for (V2VJobInfo jobInfo : v2vJobInfos) { if (vmIdToV2VJob.containsKey(jobInfo.getId())) { vmIdToV2VJob.put(jobInfo.getId(), jobInfo); } } } }</code><technical_language>please add some doc for this method</technical_language>

Target:
void updateV2VJobInfos(List<V2VJobInfo> v2vJobInfos) { for (V2VJobInfo existingJobInfo : vmIdToV2VJob.values()) { if (existingJobInfo.isMonitored() && !v2vJobInfos.contains(existingJobInfo)) { existingJobInfo.setStatus(JobStatus.NOT_EXIST); } } if (v2vJobInfos.isEmpty()) { return; } synchronized (vmIdToV2VJob) { for (V2VJobInfo jobInfo : v2vJobInfos) { if (vmIdToV2VJob.containsKey(jobInfo.getId())) { vmIdToV2VJob.put(jobInfo.getId(), jobInfo); } } } }
Source:
<code><START> public Set<PlanNode> getSources() <END> { return sources; }</code><technical_language>Good point. potentially happen if equal cost plans. I a LinkedHashSet</technical_language>

Target:
public LinkedHashSet<PlanNode> getSources() { return sources; }
Source:
<code>public final void canGetStatus() throws IOException { final String name = UUID.randomUUID().toString(); final String path = testPathPrefix + name; final byte[] content = RandomUtils.nextBytes(5242880); ServerSideMultipartUpload upload = multipart.initiateUpload(path); MantaMultipartStatus newStatus = multipart.getStatus(upload); Assert.assertEquals(newStatus, MantaMultipartStatus.CREATED, "Created status wasn't set. Actual status: " + newStatus); MantaMultipartUploadPart part = multipart.uploadPart(upload, 1, content); multipart.complete(upload, Stream.of(part)); MantaMultipartStatus completeStatus = multipart.getStatus(upload); if (completeStatus.equals(MantaMultipartStatus.COMMITTING)) { MantaMultipartStatus lastStatus = completeStatus; for (int i = 2; i <= 15 ; i++) { try { Thread.sleep((long)Math.pow(2, i)); if (mantaClient.existsAndIsAccessible(path)) { lastStatus = null; break; } lastStatus = multipart.getStatus(upload); } catch (InterruptedException e) { return; } } if (lastStatus != MantaMultipartStatus.COMPLETED) { <START> Assert.fail("MPU " + upload + "did not complete after multiple status checks. Last status: " + lastStatus); <END> } } else if (completeStatus.equals(MantaMultipartStatus.COMPLETED)) { } else { Assert.fail("MPU " + upload + "in invalid status after complete invocation. Actual status: " + completeStatus); } }</code><technical_language>This integration-test is failing lastStatus is null breaks out of if-loop</technical_language>

Target:
public final void canGetStatus() throws IOException { final String name = UUID.randomUUID().toString(); final String path = testPathPrefix + name; final byte[] content1 = RandomUtils.nextBytes(5242880); final byte[] content2 = RandomUtils.nextBytes(1242880); ServerSideMultipartUpload upload = multipart.initiateUpload(path); MantaMultipartStatus newStatus = multipart.getStatus(upload); Assert.assertEquals(newStatus, MantaMultipartStatus.CREATED, "Created status wasn't set. Actual status: " + newStatus); MantaMultipartUploadPart part1 = multipart.uploadPart(upload, 1, content1); MantaMultipartUploadPart part2 = multipart.uploadPart(upload, 2, content2); multipart.complete(upload, Stream.of(part1, part2)); MantaMultipartStatus completeStatus = multipart.getStatus(upload); Assert.assertNotNull(completeStatus, "Status should never be null"); switch (completeStatus) { case COMMITTING: { MantaMultipartStatus lastStatus = completeStatus; for (int i = 2; i <= 15 ; i++) { try { Thread.sleep((long)Math.pow(2, i)); lastStatus = multipart.getStatus(upload); } catch (InterruptedException e) { return; } } if (lastStatus != MantaMultipartStatus.COMPLETED) { final String msg = String.format("MPU %s did not complete after " + "multiple status checks. Last status: %s", upload, lastStatus); Assert.fail(msg); } break; } case COMPLETED: { break; } default: { final String msg = String.format("MPU %s returned an unexpected status: %s", upload, completeStatus); Assert.fail(msg); } } }
Source:
<code>private Map<String, DbParameterAccessor> readIntoParams( String objName, String query) throws SQLException { String[] nameParts = objName.toUpperCase().split("\\."); String schemaName = nameParts.length == 2 ? nameParts[0] : getConnection().getSchema(); String objectName = nameParts.length == 2 ? nameParts[1] : nameParts[0]; try (PreparedStatement dc = getConnection().prepareStatement(query)) { if (objectName.trim().startsWith("\"") && objectName.trim().endsWith("\"")) { objectName = objectName.replaceFirst("\"", ""); int i = objectName.lastIndexOf("\""); objectName = objName.substring(0, i) + objName.substring(i + 1); } dc.setString(1, objectName); dc.setString(2, schemaName); ResultSet rs = dc.executeQuery(); Map<String, DbParameterAccessor> allParams = new HashMap<String, DbParameterAccessor>(); int position = 0; while (rs.next()) { String columnName = rs.getString("PARAMETER_NAME"); String dataType = rs.getString("TYPE_NAME"); Direction direction = null; switch (rs.getString("PARAMETER_MODE")) { <START> case "IN": <END> direction = Direction.INPUT; break; case "INOUT": direction = Direction.INPUT_OUTPUT; break; case "OUT": direction = Direction.OUTPUT; break; case "RETURN_VALUE": direction = Direction.RETURN_VALUE; break; } DbParameterAccessor dbp = createDbParameterAccessor( columnName, direction, typeMapper.getJDBCSQLTypeForDBType(dataType), getJavaClass(dataType), position++ - 1); allParams.put(NameNormaliser.normaliseName(columnName), dbp); } rs.close(); return allParams; } }</code><technical_language>If control query column names, match Direction names (e.g. IN -> INPUT, INOUT -> INPUT_OUTPUT? parse Direction</technical_language>

Target:
private Map<String, DbParameterAccessor> readIntoParams(String objName, String query) throws SQLException { String[] nameParts = objName.toUpperCase().split("\\."); String schemaName = nameParts.length == 2 ? nameParts[0] : getConnection().getSchema(); String objectName = nameParts.length == 2 ? nameParts[1] : nameParts[0]; try (PreparedStatement dc = getConnection().prepareStatement(query)) { if (objectName.trim().startsWith("\"") && objectName.trim().endsWith("\"")) { objectName = objectName.replaceFirst("\"", ""); int i = objectName.lastIndexOf("\""); objectName = objName.substring(0, i) + objName.substring(i + 1); } dc.setString(1, objectName); dc.setString(2, schemaName); ResultSet rs = dc.executeQuery(); Map<String, DbParameterAccessor> allParams = new HashMap<String, DbParameterAccessor>(); int position = 0; while (rs.next()) { String columnName = rs.getString("PARAMETER_NAME"); String dataType = rs.getString("TYPE_NAME"); DbParameterAccessor dbp = createDbParameterAccessor( columnName, Direction.valueOf(rs.getString("STATEMENT_PARAMETER_MODE")), typeMapper.getJDBCSQLTypeForDBType(dataType), getJavaClass(dataType), position++ - 1); allParams.put(NameNormaliser.normaliseName(columnName), dbp); } rs.close(); return allParams; } }
Source:
<code>public boolean isEngineRunning() { <START> LOGGER.info("isEngineRunning Called"); <END> try { if (restClient == null || !restClient.ping(RequestOptions.DEFAULT)) { LOGGER.info("isEngineRunning: false"); return false; } ClusterHealthStatus healthStatus = restClient.cluster() .health(new ClusterHealthRequest(), RequestOptions.DEFAULT) .getStatus(); LOGGER.info("isEngineRunning Status: " + healthStatus); return ClusterHealthStatus.GREEN.equals(healthStatus); } catch (Exception e) { LOGGER.info("isEngineRunning: false"); return false; } }</code><technical_language>remove</technical_language>

Target:
public boolean isEngineRunning() { try { if (restClient == null || !restClient.ping(RequestOptions.DEFAULT)) { return false; } ClusterHealthStatus healthStatus = restClient.cluster() .health(new ClusterHealthRequest(), RequestOptions.DEFAULT) .getStatus(); return ClusterHealthStatus.GREEN.equals(healthStatus); } catch (Exception e) { return false; } }
Source:
<code>public Dataset execConstructDataset(){ DatasetGraph graph = DatasetGraphFactory.createMem(); checkNotClosed() ; try { Iterator<Quad> it = execConstructQuads(); while (it.hasNext()) { Quad q = it.next(); <START> graph.add(q); <END> } } finally { this.close(); } return DatasetFactory.create(graph); }</code><technical_language>Java 8 this iterator loop execConstructQuads().forEachRemaining(graph::add);</technical_language>

Target:
public Dataset execConstructDataset(){ DatasetGraph graph = DatasetGraphFactory.createMem(); checkNotClosed() ; try { execConstructQuads().forEachRemaining(graph::add); } finally { this.close(); } return DatasetFactory.create(graph); }
Source:
<code>public List<EmailInfo> apply(AccountResource rsrc) throws AuthException, OrmException { <START> IdentifiedUser s = (IdentifiedUser) self.get(); <END> if (s.getAccountId().get() != rsrc.getUser().getAccountId().get() && !self.get().getCapabilities().canAdministrateServer()) { throw new AuthException("not allowed to list email addresses"); } List<EmailInfo> emails = Lists.newArrayList(); ResultSet<AccountExternalId> ids = dbProvider.get().accountExternalIds() .byAccount(rsrc.getUser().getAccountId()); for (AccountExternalId extId : ids) { String email = extId.getEmailAddress(); if (email != null) { EmailInfo e = new EmailInfo(); e.email = email; e.setPreferred(email.equals(rsrc.getUser().getAccount() .getPreferredEmail())); emails.add(e); } } return emails; }</code><technical_language>If I call this authentication, i.e. /a/ in URL, is internal server error: java.lang.ClassCastException: com.google.gerrit.server.AnonymousUser cast com.google.gerrit.server.IdentifiedUser</technical_language>

Target:
public List<EmailInfo> apply(AccountResource rsrc) throws AuthException, OrmException { if (!(self.get() instanceof IdentifiedUser)) { throw new AuthException("Authentication required"); } IdentifiedUser s = (IdentifiedUser) self.get(); if (s.getAccountId().get() != rsrc.getUser().getAccountId().get() && !s.getCapabilities().canAdministrateServer()) { throw new AuthException("not allowed to list email addresses"); } List<EmailInfo> emails = Lists.newArrayList(); ResultSet<AccountExternalId> ids = dbProvider.get().accountExternalIds() .byAccount(rsrc.getUser().getAccountId()); for (AccountExternalId extId : ids) { String email = extId.getEmailAddress(); if (email != null) { EmailInfo e = new EmailInfo(); e.email = email; e.setPreferred(email.equals(rsrc.getUser().getAccount() .getPreferredEmail())); emails.add(e); } } return emails; }
Source:
<code>public Optional<String> scope() { <START> return Optional.of("query-log"); <END> }</code><technical_language>consistent, "query-logging"</technical_language>

Target:
public Optional<String> scope() { return Optional.of("query-logging"); }
Source:
<code>public void processCacheEntryDestroyed(CacheEntryRemovedEvent event) { if (!event.isPre()) { emitSessionDestroyedEvent((String) event.getKey()); } <START> } <END></code><technical_language>if (!event.isPre()) avoided adding @Listener(observation = Observation.POST) class level</technical_language>

Target:
public void processCacheEntryDestroyed(CacheEntryRemovedEvent event) { emitSessionDestroyedEvent((String) event.getKey()); }
Source:
<code>private void updateNetworkInterfacesByTemplate(VmTemplate template) { AsyncQuery query = new AsyncQuery(getModel(), new INewAsyncCallback() { @Override public void onSuccess(Object model, Object returnValue) { if (returnValue == null) { return; } List<VmNetworkInterface> nics = (List<VmNetworkInterface>) ((VdcQueryReturnValue) returnValue).getReturnValue(); <START> if (nics.size() == 0) { <END> return; } initNetworkInterfaces(networkBehavior, nics); } }); Frontend.RunQuery(VdcQueryType.GetTemplateInterfacesByTemplateId, new IdQueryParameters(template.getId()), query); }</code><technical_language>this code part of initNetworkInterfaces</technical_language>

Target:
private void updateNetworkInterfacesByTemplate(VmTemplate template) { AsyncQuery query = new AsyncQuery(getModel(), new INewAsyncCallback() { @Override public void onSuccess(Object model, Object returnValue) { if (returnValue == null) { return; } List<VmNetworkInterface> nics = (List<VmNetworkInterface>) ((VdcQueryReturnValue) returnValue).getReturnValue(); initNetworkInterfaces(networkBehavior, nics); } }); Frontend.RunQuery(VdcQueryType.GetTemplateInterfacesByTemplateId, new IdQueryParameters(template.getId()), query); }
Source:
<code><START> private static void update(final ProjectEvent event, final Path projectMirrorPath, final String projectApiBaseUrl, <END> ExecutorService executor) { if (event.getType() == ProjectEvent.EventType.DELETED) { IoUtil.deleteRecursive(projectMirrorPath.resolve(event.getPath()).toFile()); } else if (event.getType() == ProjectEvent.EventType.UPDATED || event.getType() == ProjectEvent.EventType.CREATED) { executor.execute(new Runnable() { @Override public void run() { int index = projectApiBaseUrl.indexOf(event.getProject()); try { HttpURLConnection conn = (HttpURLConnection)new URL(projectApiBaseUrl.substring(0, index) .concat("/file") .concat(event.getProject()) .concat("/") .concat(event.getPath())).openConnection(); conn.setConnectTimeout(30 * 1000); conn.setRequestMethod("GET"); conn.addRequestProperty(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON); conn.setDoInput(true); conn.setDoOutput(true); conn.connect(); final int responseCode = conn.getResponseCode(); if (responseCode == HttpURLConnection.HTTP_OK) { java.io.File updatedFile = new java.io.File(projectMirrorPath.toString(), event.getPath()); byte[] buffer = new byte[8192]; try (InputStream input = conn.getInputStream(); OutputStream output = new FileOutputStream(updatedFile)) { int bytesRead; while ((bytesRead = input.read(buffer)) != -1) { output.write(buffer, 0, bytesRead); } } } } catch (IOException e) { LOG.error("Unable to update mirror of project for GWT code server.", event.getProject()); } } }); } }</code><technical_language>this method is static</technical_language>

Target:
private void update(final ProjectEvent event, final Path projectMirrorPath, final String projectApiBaseUrl, ExecutorService executor) { if (event.getType() == ProjectEvent.EventType.DELETED) { IoUtil.deleteRecursive(projectMirrorPath.resolve(event.getPath()).toFile()); } else if (event.getType() == ProjectEvent.EventType.UPDATED || event.getType() == ProjectEvent.EventType.CREATED) { executor.execute(new Runnable() { @Override public void run() { int index = projectApiBaseUrl.indexOf(event.getProject()); try { HttpURLConnection conn = (HttpURLConnection)new URL(projectApiBaseUrl.substring(0, index) .concat("/file") .concat(event.getProject()) .concat("/") .concat(event.getPath())).openConnection(); conn.setConnectTimeout(30 * 1000); conn.setRequestMethod("GET"); conn.addRequestProperty(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON); conn.setDoInput(true); conn.setDoOutput(true); conn.connect(); final int responseCode = conn.getResponseCode(); if (responseCode == HttpURLConnection.HTTP_OK) { java.io.File updatedFile = new java.io.File(projectMirrorPath.toString(), event.getPath()); byte[] buffer = new byte[8192]; try (InputStream input = conn.getInputStream(); OutputStream output = new FileOutputStream(updatedFile)) { int bytesRead; while ((bytesRead = input.read(buffer)) != -1) { output.write(buffer, 0, bytesRead); } } } } catch (IOException e) { LOG.error("Unable to update mirror of project for GWT code server.", event.getProject()); } } }); } }
Source:
<code>public static NumberValue subtract( long a, long b ) { try { return Values.longValue( Math.subtractExact( a, b ) ); } catch ( ArithmeticException e ) <START> { <END> return Values.doubleValue( (double) a - (double) b ); } }</code><technical_language>frequent, is do this exceptions a code path</technical_language>

Target:
public static LongValue subtract( long a, long b ) { return longValue( Math.subtractExact( a, b ) ); }
Source:
<code>public void execute() { final List<QuotaTariffVO> result = _responseBuilder.listQuotaTariffPlans(this); final List<QuotaTariffResponse> responses = new ArrayList<QuotaTariffResponse>(); for (final QuotaTariffVO resource : result) { <START> s_logger.info("Result desc=" + resource.getDescription() + " date=" + resource.getEffectiveOn() + " val=" + resource.getCurrencyValue()); <END> responses.add(_responseBuilder.createQuotaTariffResponse(resource)); } final ListResponse<QuotaTariffResponse> response = new ListResponse<QuotaTariffResponse>(); response.setResponses(responses); response.setResponseName(getCommandName()); setResponseObject(response); }</code><technical_language>This message a DEBUG INFO level. of thinking, INFO level message provide information a system administrator understand operation of system. This message provide information</technical_language>

Target:
public void execute() { final List<QuotaTariffVO> result = _responseBuilder.listQuotaTariffPlans(this); final List<QuotaTariffResponse> responses = new ArrayList<QuotaTariffResponse>(); for (final QuotaTariffVO resource : result) { if (s_logger.isDebugEnabled()){ s_logger.debug("Result desc=" + resource.getDescription() + " date=" + resource.getEffectiveOn() + " val=" + resource.getCurrencyValue()); } responses.add(_responseBuilder.createQuotaTariffResponse(resource)); } final ListResponse<QuotaTariffResponse> response = new ListResponse<QuotaTariffResponse>(); response.setResponses(responses); response.setResponseName(getCommandName()); setResponseObject(response); }