auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public BinaryContent transform(Metacard metacard, Map<String, Serializable> arguments) throws CatalogTransformerException { if (metacard == null) { throw new CatalogTransformerException("Cannot transform null metacard."); } String preview = "No preview text available."; if (metacard.getAttribute(Extracted.EXTRACTED_TEXT) != null && metacard.getAttribute(Extracted.EXTRACTED_TEXT).getValue() != null) { preview = StringEscapeUtils.escapeHtml4( metacard.getAttribute(Extracted.EXTRACTED_TEXT).getValue().toString()) .replaceAll("[\n|\r]", "<br>"); } else if (previewFromMetadata && xPathExpressions != null && StringUtils.isNotEmpty(metacard.getMetadata())) { String text = xPathExpressions .stream() .map(x -> evaluateXPath(metacard.getMetadata(), x)) .filter(Objects::nonNull) .findFirst() .orElse(""); if (StringUtils.isNotEmpty(text)) { preview = StringEscapeUtils.escapeHtml4(text).replaceAll("[\n|\r]", "<br>"); <START> } <END> } preview = String.format("<head><meta charset=\"utf-8\"/>%s</head>", preview); return new BinaryContentImpl(IOUtils.toInputStream(preview)); }</code><technical_language>exclamation: This method is complex. Factor out logical chunks smaller methods. [Use intention-revealing method names](<LINK_0> reader method does. IntelliJ's extract method refactoring action easy do it</technical_language>

Target:
public BinaryContent transform(Metacard metacard, Map<String, Serializable> arguments) throws CatalogTransformerException { if (metacard == null) { throw new CatalogTransformerException("Cannot transform null metacard."); } String preview = getPreviewText(metacard); return new BinaryContentImpl(IOUtils.toInputStream(preview)); }
Source:
<code>public Map<String, DbParameterAccessor> getAllProcedureParameters(String callableName) throws SQLException { DatabaseObject o; String name = callableName.toUpperCase(); DatabaseProcedure p = new DatabaseProcedure(getConnection(), getConnection().getSchema(), name); if (p.exists()) { o = p; } else { DatabaseFunction f = new DatabaseFunction(getConnection(), getConnection().getSchema(), name); if (f.exists()) { <START> o = f; <END> } else { throw new SQLException("Procedure/function " + name + " does not exist"); } } return o.getParams(); }</code><technical_language>in multiple levels of nesting some single-letter variable names. if/else if/else in other PR looked a bit easier read</technical_language>

Target:
public Map<String, DbParameterAccessor> getAllProcedureParameters(String callableName) throws SQLException { return findStoredRoutine(buildDatabaseObjectName(callableName)).getParams(); }
Source:
<code>public ImmutableList<Trade> trades(LocalDate valuationDate, ObservableValues marketData) { <START> ImmutableList.Builder<Trade> result = ImmutableList.builder(); <END> for (CurveGroupEntry entry : entries) { NodalCurveDefinition defn = entry.getCurveDefinition(); for (CurveNode node : defn.getNodes()) { result.add(node.trade(valuationDate, marketData)); } } return result.build(); }</code><technical_language>about: return entries.stream() .map(CurveGroupEntry::getCurveDefinition) .flatMap(curveDef -> curveDef.getNodes().stream()) .map(node -> node.trade(valuationDate, marketData)) .collect(toImmutableList());</technical_language>

Target:
public ImmutableList<Trade> trades(LocalDate valuationDate, ObservableValues marketData) { return entries.stream() .map(CurveGroupEntry::getCurveDefinition) .flatMap(curveDef -> curveDef.getNodes().stream()) .map(node -> node.trade(valuationDate, marketData)) .collect(toImmutableList()); }
Source:
<code><START> public List<GeneratorSwitch> getGenerators() { <END> if (this.contentFolders == null) { this.contentFolders = new ArrayList<>(); } Stream<Project> projects = template.getProjects().stream(); Stream<Project> projectsWithSourceFolder = projects.filter(λ -> Objects.nonNull(λ.getGeneratorSource())); Stream<Pair<Folder, Folder>> foldersWithSources = projectsWithSourceFolder .flatMap(λ -> λ.getFolders().stream().map(μ -> Pair.of(μ, λ.getGeneratorSource()))); Stream<Folder> allowedFolders = foldersWithSources.filter(λ -> !λ.getLeft().equals(λ.getRight())) .map(λ -> λ.getLeft()); Stream<Folder> generatableFolders = allowedFolders.filter(λ -> λ.getDerivative().isPresent() || λ.getDpi().isPresent() || λ.getImageScale().isPresent() || λ.getImageSize().isPresent()); Stream<GeneratorSwitch> taskGenerators = generatableFolders.map(λ -> new GeneratorSwitch(λ, contentFolders)); return new ArrayList<GeneratorSwitch>() { { taskGenerators.forEach(this::add); } }; }</code><technical_language>logic in Bean-classes, please extract TaskService. this code is duplicated in "GeneratorSwitch" class. Please consider, code go</technical_language>

Target:
public List<GeneratorSwitch> getGenerators() { if (this.contentFolders == null) { this.contentFolders = new ArrayList<>(); } return GeneratorSwitch.getGeneratorSwitches(template.getProjects().stream(), contentFolders); }
Source:
<code>public void testJavaUnwrap() { <START> Assert.assertEquals("Hello World", JavaStringEscapes.unwrapJavaString("\"Hello World\"")); <END> Assert.assertEquals("Hello \"Bob\"", JavaStringEscapes.unwrapJavaString("\"Hello \\\"Bob\\\"\"")); try { JavaStringEscapes.unwrapJavaString("Hello World"); Assert.fail("Should have thrown"); } catch (Exception e) { } try { JavaStringEscapes.unwrapJavaString("\"Hello \\\"Bob\\\""); Assert.fail("Should have thrown"); } catch (Exception e) { } Assert.assertEquals("Hello World", JavaStringEscapes.unwrapJavaStringIfWrapped("\"Hello World\"")); Assert.assertEquals("Hello \"Bob\"", JavaStringEscapes.unwrapJavaStringIfWrapped("\"Hello \\\"Bob\\\"\"")); Assert.assertEquals("Hello World", JavaStringEscapes.unwrapJavaStringIfWrapped("Hello World")); try { JavaStringEscapes.unwrapJavaStringIfWrapped("\"Hello \\\"Bob\\\""); Assert.fail("Should have thrown"); } catch (Exception e) { } }</code><technical_language>actual expected wrong (this is junit round, testng round)</technical_language>

Target:
public void testJavaUnwrap() { Assert.assertEquals(JavaStringEscapes.unwrapJavaString("\"Hello World\""), "Hello World"); Assert.assertEquals(JavaStringEscapes.unwrapJavaString("\"Hello \\\"Bob\\\"\""), "Hello \"Bob\""); try { JavaStringEscapes.unwrapJavaString("Hello World"); Assert.fail("Should have thrown"); } catch (Exception e) { } try { JavaStringEscapes.unwrapJavaString("\"Hello \\\"Bob\\\""); Assert.fail("Should have thrown"); } catch (Exception e) { } Assert.assertEquals(JavaStringEscapes.unwrapJavaStringIfWrapped("\"Hello World\""), "Hello World"); Assert.assertEquals(JavaStringEscapes.unwrapJavaStringIfWrapped("\"Hello \\\"Bob\\\"\""), "Hello \"Bob\""); Assert.assertEquals(JavaStringEscapes.unwrapJavaStringIfWrapped("Hello World"), "Hello World"); try { JavaStringEscapes.unwrapJavaStringIfWrapped("\"Hello \\\"Bob\\\""); Assert.fail("Should have thrown"); } catch (Exception e) { } }
Source:
<code>public static Status statusFromLifecycle(Lifecycle state) { if (state == null) return UNKNOWN; switch (state) { case CREATED: return ACCEPTED; case STARTING: return STARTING; case RUNNING: return RUNNING; case STOPPING: return STOPPING; case STOPPED: return STOPPED; case DESTROYED: <START> return TERMINATED; <END> case ON_FIRE: default: return UNKNOWN; } }</code><technical_language>this feel wrong. :)</technical_language>

Target:
public static Status statusFromLifecycle(Lifecycle state) { if (state == null) return UNKNOWN; switch (state) { case CREATED: return ACCEPTED; case STARTING: return STARTING; case RUNNING: return RUNNING; case STOPPING: return STOPPING; case STOPPED: return STOPPED; case DESTROYED: return DESTROYED; case ON_FIRE: default: return UNKNOWN; } }
Source:
<code><START> private void setAmbryHeadersForPut(JSONObject headers, String ttlInSecs, String serviceId, Container container, <END> String contentType, String ownerId) throws JSONException { setAmbryHeadersForPut(headers, ttlInSecs, serviceId, container, contentType, ownerId, true, true); }</code><technical_language>container is in @param</technical_language>

Target:
private void setAmbryHeadersForPut(JSONObject headers, String ttlInSecs, String serviceId, Container container, String contentType, String ownerId) throws JSONException { setAmbryHeadersForPut(headers, ttlInSecs, serviceId, container, contentType, ownerId, true); }
Source:
<code>public void close() { asyncClient.close(); <START> if (messageProcessor.get() != null) { <END> messageProcessor.get().dispose(); } Disposable activeSubscription = messageProcessorSubscription.get(); if (activeSubscription != null) { activeSubscription.dispose(); } }</code><technical_language>throw if call dispose twice</technical_language>

Target:
public void close() { asyncClient.close(); EmitterProcessor<ServiceBusReceivedMessageContext> processor = messageProcessor.getAndSet(null); if (processor != null) { processor.onComplete(); } }
Source:
<code>public Tenant(String name, CanonicalPath path, Map<String, Object> properties) { super(name, path, properties); <START> getId(); <END> }</code><technical_language>is purpose of this</technical_language>

Target:
public Tenant(String name, CanonicalPath path, Map<String, Object> properties) { super(name, path, properties); }
Source:
<code>public void createTopicWithMinMessage_ShouldPass() throws Exception { Users.signUpAndSignIn(); <START> Topic topic = new Topic("subject", "ab"); <END> Topics.createTopic(topic); }</code><technical_language>refactor Topic a bit able pass there. new Topic().withBody("ab") other fields title generated randomly</technical_language>

Target:
public void createTopicWithMinMessage_ShouldPass() throws Exception { Users.signUpAndSignIn(); Topic topic = new Topic().withBody("ab"); Topics.createTopic(topic); }
Source:
<code>public XYPair getLeftVector() { <START> return new XYPair(this.x * (xLeftInverted ? -1 : 1), this.y <END> * (yLeftInverted ? -1 : 1)); }</code><technical_language>internal vectors instead of variables. As-is, sticks return values</technical_language>

Target:
public XYPair getLeftVector() { return new XYPair( this.leftJoystickAxis.x * (getLeftStickXInversion() ? -1 : 1), this.leftJoystickAxis.y * (getLeftStickYInversion() ? -1 : 1)); }
Source:
<code>public void subscribe(Subscriber<? super Message<?>> subscriber) { this.subscribers.add(subscriber); this.flux.doFinally((signal) -> this.subscribers.remove(subscriber)) <START> .retry() <END> .subscribe(subscriber); this.publishers.values() .forEach((connectableFlux) -> this.disposables.put(connectableFlux, connectableFlux.connect())); }</code><technical_language>please explain of ConnectableFlux here</technical_language>

Target:
public void subscribe(Subscriber<? super Message<?>> subscriber) { this.processor .doFinally((s) -> this.subscribedSignal.onNext(this.processor.hasDownstreams())) .subscribe(subscriber); this.subscribedSignal.onNext(this.processor.hasDownstreams()); }
Source:
<code>public List<FeedbackResponseAttributes> getFeedbackResponsesFromGiverForSessionWithinRange (String giverEmail, String feedbackSessionName, String courseId, long range) { Assumption.assertNotNull(Const.StatusCodes.DBLEVEL_NULL_INPUT, giverEmail); Assumption.assertNotNull(Const.StatusCodes.DBLEVEL_NULL_INPUT, feedbackSessionName); Assumption.assertNotNull(Const.StatusCodes.DBLEVEL_NULL_INPUT, courseId); Collection<FeedbackResponse> frList = getFeedbackResponseEntitiesFromGiverForSessionWithinRange(giverEmail, feedbackSessionName, courseId, range); List<FeedbackResponseAttributes> fraList = new ArrayList<FeedbackResponseAttributes>(); for (FeedbackResponse fr : frList) { try { <START> fraList.add(new FeedbackResponseAttributes(fr)); <END> } catch (JDOUserException jdoException) { log.info("Skip counting of respondent for deleted response: " + jdoException.getMessage()); } } return fraList; }</code><technical_language>In cases this, previously check if is a deleted object object. is a jdo method for checking if returned object is 'deleted'. solution work too</technical_language>

Target:
public List<FeedbackResponseAttributes> getFeedbackResponsesFromGiverForSessionWithinRange (String giverEmail, String feedbackSessionName, String courseId, long range) { Assumption.assertNotNull(Const.StatusCodes.DBLEVEL_NULL_INPUT, giverEmail); Assumption.assertNotNull(Const.StatusCodes.DBLEVEL_NULL_INPUT, feedbackSessionName); Assumption.assertNotNull(Const.StatusCodes.DBLEVEL_NULL_INPUT, courseId); Collection<FeedbackResponse> frList = getFeedbackResponseEntitiesFromGiverForSessionWithinRange(giverEmail, feedbackSessionName, courseId, range); List<FeedbackResponseAttributes> fraList = new ArrayList<FeedbackResponseAttributes>(); for (FeedbackResponse fr : frList) { if (!JDOHelper.isDeleted(fr)) { fraList.add(new FeedbackResponseAttributes(fr)); } } return fraList; }
Source:
<code>public void initTraceState(Map<String, Object> state) { <START> if (state.containsKey(Constants.HAWKULAR_APM_TRACEID)) { <END> setTraceId(state.get(Constants.HAWKULAR_APM_TRACEID).toString()); } else { log.severe("Trace id has not been propagated"); } if (state.containsKey(Constants.HAWKULAR_APM_TXN)) { setTransaction(state.get(Constants.HAWKULAR_APM_TXN).toString()); } if (state.containsKey(Constants.HAWKULAR_APM_LEVEL)) { setReportingLevel(state.get(Constants.HAWKULAR_APM_LEVEL).toString()); } }</code><technical_language>please change this access map</technical_language>

Target:
public void initTraceState(Map<String, Object> state) { Object traceId = state.get(Constants.HAWKULAR_APM_TRACEID); Object transaction = state.get(Constants.HAWKULAR_APM_TXN); Object level = state.get(Constants.HAWKULAR_APM_LEVEL); if (traceId != null) { setTraceId(traceId.toString()); } else { log.severe("Trace id has not been propagated"); } if (transaction != null) { setTransaction(transaction.toString()); } if (level != null) { setReportingLevel(level.toString()); } }
Source:
<code>public void testIPv4EncodeProxyV2() { HAProxyMessageEncoder encoder = new HAProxyMessageEncoder(); EmbeddedChannel ch = new EmbeddedChannel(encoder); HAProxyMessage message = new HAProxyMessage( HAProxyProtocolVersion.V2, HAProxyCommand.PROXY, HAProxyProxiedProtocol.TCP4, "192.168.0.1", "192.168.0.11", 56324, 443); assertTrue(ch.writeOutbound(message)); ByteBuf byteBuf = ch.readOutbound(); byte[] headerBytes = ByteBufUtil.getBytes(byteBuf, 0, 12); assertArrayEquals(BINARY_PREFIX, headerBytes); byte commandByte = byteBuf.getByte(12); assertEquals(0x02, (commandByte & 0xf0) >> 4); assertEquals(0x01, commandByte & 0x0f); byte transportByte = byteBuf.getByte(13); assertEquals(0x01, (transportByte & 0xf0) >> 4); assertEquals(0x01, transportByte & 0x0f); int sourceAddrLength = byteBuf.getUnsignedShort(14); assertEquals(12, sourceAddrLength); byte[] sourceAddr = ByteBufUtil.getBytes(byteBuf, 16, 4); assertArrayEquals(new byte[] { (byte) 0xc0, (byte) 0xa8, 0x00, 0x01}, sourceAddr); byte[] destAddr = ByteBufUtil.getBytes(byteBuf, 20, 4); assertArrayEquals(new byte[] { (byte) 0xc0, (byte) 0xa8, 0x00, 0x0b}, destAddr); int sourcePort = byteBuf.getUnsignedShort(24); assertEquals(56324, sourcePort); int destPort = byteBuf.getUnsignedShort(26); <START> assertEquals(443, destPort); <END> }</code><technical_language>call byteBuf.release() add assertFalse(ch.finish());</technical_language>

Target:
public void testIPv4EncodeProxyV2() { EmbeddedChannel ch = new EmbeddedChannel(INSTANCE); HAProxyMessage message = new HAProxyMessage( HAProxyProtocolVersion.V2, HAProxyCommand.PROXY, HAProxyProxiedProtocol.TCP4, "192.168.0.1", "192.168.0.11", 56324, 443); assertTrue(ch.writeOutbound(message)); ByteBuf byteBuf = ch.readOutbound(); byte[] headerBytes = ByteBufUtil.getBytes(byteBuf, 0, 12); assertArrayEquals(BINARY_PREFIX, headerBytes); byte commandByte = byteBuf.getByte(12); assertEquals(0x02, (commandByte & 0xf0) >> 4); assertEquals(0x01, commandByte & 0x0f); byte transportByte = byteBuf.getByte(13); assertEquals(0x01, (transportByte & 0xf0) >> 4); assertEquals(0x01, transportByte & 0x0f); int sourceAddrLength = byteBuf.getUnsignedShort(14); assertEquals(12, sourceAddrLength); byte[] sourceAddr = ByteBufUtil.getBytes(byteBuf, 16, 4); assertArrayEquals(new byte[] { (byte) 0xc0, (byte) 0xa8, 0x00, 0x01 }, sourceAddr); byte[] destAddr = ByteBufUtil.getBytes(byteBuf, 20, 4); assertArrayEquals(new byte[] { (byte) 0xc0, (byte) 0xa8, 0x00, 0x0b }, destAddr); int sourcePort = byteBuf.getUnsignedShort(24); assertEquals(56324, sourcePort); int destPort = byteBuf.getUnsignedShort(26); assertEquals(443, destPort); byteBuf.release(); assertFalse(ch.finish()); }
Source:
<code>private static void usage(PrintStream s) { s.println("usage: Client [options] <torrent>"); s.println(); s.println("Available options:"); s.println(" -h,--help Show this help and exit."); s.println(" -o,--output DIR Read/write data to directory DIR."); s.println(" -i,--iface IFACE Bind to interface IFACE."); s.println(" -s,--seed SECONDS Time to seed after downloading (default: infinitely)."); <START> s.println(" -d,--max-download KB/SEC Max download rate (default: infinitely)."); <END> s.println(" -u,--max-upload KB/SEC Max upload rate (default: infinitely)."); s.println(); }</code><technical_language>Copy/paste warning, infinitely unlimited</technical_language>

Target:
private static void usage(PrintStream s) { s.println("usage: Client [options] <torrent>"); s.println(); s.println("Available options:"); s.println(" -h,--help Show this help and exit."); s.println(" -o,--output DIR Read/write data to directory DIR."); s.println(" -i,--iface IFACE Bind to interface IFACE."); s.println(" -s,--seed SECONDS Time to seed after downloading (default: infinitely)."); s.println(" -d,--max-download KB/SEC Max download rate (default: unlimited)."); s.println(" -u,--max-upload KB/SEC Max upload rate (default: unlimited)."); s.println(); }
Source:
<code>public Row next() throws IOException { <START> resultsMeter.mark(); <END> Timer.Context timerContext = resultsTimer.time(); try { return responseQueueReader.getNextMergedRow(); } finally { timerContext.close(); } }</code><technical_language>this counting calls next() instead of Rows returned</technical_language>

Target:
public Row next() throws IOException { Timer.Context timerContext = resultsTimer.time(); Row row = responseQueueReader.getNextMergedRow(); if (row != null) { resultsMeter.mark(); } timerContext.close(); return row; }
Source:
<code>public void testConcCreateDestroy() throws Exception { IgnoredException.addIgnoredException("RegionDestroyedException"); IgnoredException.addIgnoredException("IndexInvalidException"); final int ops = 40; final String hKey = KEY + "hash"; final String lKey = KEY + "list"; final String zKey = KEY + "zset"; final String sKey = KEY + "set"; class ConcCreateDestroy extends ClientTestBase { protected ConcCreateDestroy(int port) { super(port); } @Override public void run() throws InterruptedException { Jedis jedis = new Jedis(LOCALHOST, port, JEDIS_TIMEOUT); Random r = new Random(); for (int i = 0; i < ops; i++) { int n = r.nextInt(4); if (n == 0) { if (r.nextBoolean()) { jedis.hset(hKey, randString(), randString()); } else { jedis.del(hKey); } <START> } else { <END> if (r.nextBoolean()) { jedis.sadd(sKey, randString()); } else { jedis.del(sKey); } } } } } AsyncInvocation<Void> i = client1.invokeAsync(new ConcCreateDestroy(server1Port)); client2.invoke(new ConcCreateDestroy(server2Port)); i.await(); }</code><technical_language>get rid of @Ignore this test testing hashes sets</technical_language>

Target:
public void testConcCreateDestroy() throws Exception { IgnoredException.addIgnoredException("RegionDestroyedException"); IgnoredException.addIgnoredException("IndexInvalidException"); final int ops = 40; final String hKey = KEY + "hash"; final String sKey = KEY + "set"; class ConcCreateDestroy extends ClientTestBase { protected ConcCreateDestroy(int port) { super(port); } @Override public void run() { Jedis jedis = new Jedis(LOCALHOST, port, JEDIS_TIMEOUT); Random r = new Random(); for (int i = 0; i < ops; i++) { int n = r.nextInt(4); if (n == 0) { if (r.nextBoolean()) { jedis.hset(hKey, randString(), randString()); } else { jedis.del(hKey); } } else { if (r.nextBoolean()) { jedis.sadd(sKey, randString()); } else { jedis.del(sKey); } } } } } AsyncInvocation<Void> i = client1.invokeAsync(new ConcCreateDestroy(server1Port)); client2.invoke(new ConcCreateDestroy(server2Port)); i.await(); }
Source:
<code>public void run(TransformContext context, GtfsMutableRelationalDao dao) { ExternalServices es = new ExternalServicesBridgeFactory().getExternalServices(); for (Trip trip: dao.getAllTrips()) { StopTime oldTime = new StopTime(); boolean starting = true; for (StopTime newTime: dao.getStopTimesForTrip(trip)) { if (starting) { starting = false; oldTime = newTime; } if(newTime.getArrivalTime() - oldTime.getDepartureTime() > 5 * MINUTES_PER_HOUR * SECONDS_PER_MINUTE){ <START> _log.error("Trip on Route is scheduled for unrealistic transit time between trip at {}, and trip at {}", trip.getId(), trip.getRoute(), oldTime.getId(), humanReadableTime(oldTime.getDepartureTime()), newTime.getId(), humanReadableTime(newTime.getArrivalTime())); <END> es.publishMessage(getTopic(), "Trip " + trip.getId() + " on Route "+ trip.getRoute() +" is scheduled for unrealistic transit time when traveling between stoptime" + oldTime.getId()+ " at " + oldTime.getDepartureTime() + ", and stoptime" + newTime.getId() + " at " + newTime.getDepartureTime()); _log.error("Trip "+trip.getId().getId()+" on Route "+trip.getRoute().getId().getId()+" is scheduled for unrealistic transit time between trip "+ oldTime.getId()+" at "+humanReadableTime(oldTime.getDepartureTime())+", and trip "+newTime.getId()+" at " + humanReadableTime(newTime.getArrivalTime())); } oldTime= newTime; } } }</code><technical_language>try line lengths 120 -- in fact aim for 80 if possible</technical_language>

Target:
public void run(TransformContext context, GtfsMutableRelationalDao dao) { ExternalServices es = new ExternalServicesBridgeFactory().getExternalServices(); SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss"); for (Trip trip: dao.getAllTrips()) { StopTime oldTime = new StopTime(); boolean starting = true; for (StopTime newTime: dao.getStopTimesForTrip(trip)) { if (starting) { starting = false; oldTime = newTime; } if(newTime.getArrivalTime() - oldTime.getDepartureTime() > 5 * MINUTES_PER_HOUR * SECONDS_PER_MINUTE){ Date departure = new Date(oldTime.getDepartureTime()*1000); Date arrival = new Date(newTime.getArrivalTime()*1000); String message = "Trip " + trip.getId().getId() + " on Route "+ trip.getRoute().getId() + " is scheduled for unrealistic transit time when traveling between stoptime" + oldTime.getId()+ " at " + sdf.format(departure) + ", and stoptime" + newTime.getId() + " at " + sdf.format(arrival); es.publishMessage(getTopic(), message); } oldTime= newTime; } } }
Source:
<code>protected ResourceBasedNode<?> getResourceBasedNode() { List<?> selection = projectExplorer.getSelection().getAllElements(); <START> if (selection != null && selection.size() >= 1) { <END> Object o = selection.get(0); if (o instanceof ResourceBasedNode<?>) { ResourceBasedNode<?> node = (ResourceBasedNode<?>)o; if (node.isLeaf() && isResourceAndStorableNode(node.getParent())) { return (ResourceBasedNode<?>)node.getParent(); } return isResourceAndStorableNode(node) ? node : null; } } return null; }</code><technical_language>!selection.isEmpty() instead of selection.size() >= 1</technical_language>

Target:
protected ResourceBasedNode<?> getResourceBasedNode() { List<?> selection = projectExplorer.getSelection().getAllElements(); if (selection != null && !selection.isEmpty()) { Object o = selection.get(0); if (o instanceof ResourceBasedNode<?>) { ResourceBasedNode<?> node = (ResourceBasedNode<?>)o; if (node.isLeaf() && isResourceAndStorableNode(node.getParent())) { return (ResourceBasedNode<?>)node.getParent(); } return isResourceAndStorableNode(node) ? node : null; } } return null; }
Source:
<code>public void setMap(final Map<String,T> map) { <START> this.map= checkNotNull(map); <END> }</code><technical_language>immutable : if (null == this.map) { this.map = .. } else { throw new KasperException(..); } if add this CollectionQueryResult appreciated :)</technical_language>

Target:
public void setMap(final Map<String,T> map) { if (null == this.map) { this.map = Maps.newHashMap(checkNotNull(map)); } else { throw new UnsupportedOperationException("MapQueryResult is immutable"); } this.map= checkNotNull(map); }
Source:
<code>private List<TargetFilterPredicate> composeFilterPredicateList() { final List<TargetFilterPredicate> result = new ArrayList<>(3); if (minimumTargetSize > 0 || maximumTargetSize < Integer.MAX_VALUE) { result.add(new ExtremeTargetSize()); } if (minimumGCContent > 0.0 || maximumGCContent < 1.0) { result.add(new ExtremeTargetGCContent()); } if (maximumRepeatContent < 1.0) { result.add(new ExtremeTargetRepeatContent()); } if (maximumCoverageMean < Double.POSITIVE_INFINITY || minimumCoverageMean > Double.NEGATIVE_INFINITY) { result.add(new ExtremeCoverageMean()); } if (maximumCoverageVariance < Double.POSITIVE_INFINITY || minimumCoverageVariance > Double.NEGATIVE_INFINITY) { result.add(new ExtremeCoverageVariance()); } <START> if (!excludeIntervals.isEmpty()) { <END> result.add(new ExcludeTargetList(excludeIntervals)); } return result; }</code><technical_language>excludedIntervals</technical_language>

Target:
private List<TargetFilterPredicate> composeFilterPredicateList() { final List<TargetFilterPredicate> result = new ArrayList<>(3); if (minimumTargetSize > 0 || maximumTargetSize < Integer.MAX_VALUE) { result.add(new ExtremeTargetSize()); } if (minimumGCContent > 0.0 || maximumGCContent < 1.0) { result.add(new ExtremeTargetGCContent()); } if (maximumRepeatContent < 1.0) { result.add(new ExtremeTargetRepeatContent()); } if (maximumCoverageMean < Double.POSITIVE_INFINITY || minimumCoverageMean > Double.NEGATIVE_INFINITY) { result.add(new ExtremeCoverageMean()); } if (maximumCoverageVariance < Double.POSITIVE_INFINITY || minimumCoverageVariance > Double.NEGATIVE_INFINITY) { result.add(new ExtremeCoverageVariance()); } if (maximumCoverageInterquartileRange < Double.POSITIVE_INFINITY) { result.add(new ExtremeCoverageInterquartileRange()); } if (!excludedIntervals.isEmpty()) { result.add(new ExcludedTargetList(excludedIntervals)); } return result; }
Source:
<code>private RelNode possiblyWrapRootWithOuterLimitFromContext( RelRoot root ) { Object outerLimitObj = plannerContext.getQueryContext().get(PlannerContext.CTX_SQL_OUTER_LIMIT); if (outerLimitObj == null) { return null; } Long outerLimit = DimensionHandlerUtils.convertObjectToLong(outerLimitObj, true); if (outerLimit == null) { return null; } return LogicalSort.create( root.rel, root.collation, <START> makeDecimalLiteral(0), <END> makeDecimalLiteral(outerLimit) ); }</code><technical_language>decimal instead of bigint or... something</technical_language>

Target:
private RelNode possiblyWrapRootWithOuterLimitFromContext( RelRoot root ) { Object outerLimitObj = plannerContext.getQueryContext().get(PlannerContext.CTX_SQL_OUTER_LIMIT); Long outerLimit = DimensionHandlerUtils.convertObjectToLong(outerLimitObj, true); if (outerLimit == null) { return root.rel; } return LogicalSort.create( root.rel, root.collation, makeBigIntLiteral(0), makeBigIntLiteral(outerLimit) ); }
Source:
<code>public boolean deleteExpiredObjectsByKey(String key) { try { ExpiredObject expiredObject = getExpiredObject(key); <START> this.persistenceEntryManager.remove(expiredObject); <END> LOG.debug("Removed expired_objects successfully: ", key); return true; } catch (Exception e) { LOG.error("Failed to remove expired_objects: ", key, e); } return false; }</code><technical_language>Remove dn/key</technical_language>

Target:
public boolean deleteExpiredObjectsByKey(String key) { try { this.persistenceEntryManager.remove(getDnForExpiredObj(key)); LOG.debug("Removed expired_objects successfully: ", key); return true; } catch (Exception e) { LOG.error("Failed to remove expired_objects: ", key, e); } return false; }
Source:
<code>public void initialize() throws ConfigurationException { String dSetupValue = System.getProperty("setup"); if (dSetupValue != null) { String filePath = CarbonUtils.getCarbonHome() + File.separator + "repository" + File.separator + "conf" + File.separator + "datasources" + File.separator + MASTER_DATASOURCE_FILE_NAME; <START> log.info("Initializing message broker RDBMS store..."); <END> DataSourceConfiguration configuration = new DataSourceConfiguration(); if (!mbStoreInitialized) { configuration.loadDbConfiguration(filePath); mbStoreInitialized = true; } setMBStoreRdbmsConfiguration(configuration); setupMBStoreRdbmsDatabase(); } }</code><technical_language>get rid of "..." enterprisy</technical_language>

Target:
public void initialize() throws ConfigurationException { String dSetupValue = System.getProperty("setup"); if (dSetupValue != null) { String filePath = CarbonUtils.getCarbonHome() + File.separator + "repository" + File.separator + "conf" + File.separator + "datasources" + File.separator + MASTER_DATA_SOURCE_FILE_NAME; log.info("Creating schema for RDBMS message store."); DataSourceConfiguration configuration = new DataSourceConfiguration(); if (!isMBStoreDatabaseConfigurationLoaded) { configuration.loadDbConfiguration(filePath); isMBStoreDatabaseConfigurationLoaded = true; } setMBStoreRdbmsConfiguration(configuration); if(isMessageStoreDataSourceSet) { setupMBStoreRdbmsDatabase(messageStoreDataSource); } if(isContextStoreDatasourceSet) { setupMBStoreRdbmsDatabase(contextStoreDataSource); } } }
Source:
<code>public void getUserPhonesShouldReturnTheRequest() throws Exception { final AtomicReference<Request> bodyRef = new AtomicReference<>(); final CountDownLatch latch = new CountDownLatch(1); final RestAdapter adapter = new RestAdapter.Builder().setEndpoint(MOCK_URL).setClient(new Client() { @Override public Response execute(Request request) throws IOException { bodyRef.set(request); latch.countDown(); <START> return null; <END> } }).build(); final UserService userService = adapter.create(UserService.class); userService.getUserPhones(new RetrofitPromise<List<Phone>>()); latch.await(); Assert.assertEquals(bodyRef.get().getUrl(), String.format("%s/v0/me/phones", MOCK_URL)); Assert.assertEquals(bodyRef.get().getMethod(), "GET"); }</code><technical_language>Add newline return</technical_language>

Target:
public void getUserPhonesShouldReturnTheRequest() throws Exception { final AtomicReference<Request> bodyRef = new AtomicReference<>(); final CountDownLatch latch = new CountDownLatch(1); final RestAdapter adapter = new RestAdapter.Builder().setEndpoint(MOCK_URL).setClient(new Client() { @Override public Response execute(Request request) throws IOException { bodyRef.set(request); latch.countDown(); return null; } }).build(); final UserService userService = adapter.create(UserService.class); userService.getUserPhones(new RetrofitPromise<List<Phone>>()); latch.await(); Assert.assertEquals(bodyRef.get().getMethod(), "GET"); Assert.assertEquals(bodyRef.get().getUrl(), String.format("%s/v0/me/phones", MOCK_URL)); }
Source:
<code>private long computeMemorySizeInBytes(AbstractNode root) { if (root.getLevel() == 0) { return ABSTRACT_NODE_INSTANCE_SIZE + ENVELOPE_INSTANCE_SIZE + root.getChildBoundables().stream().mapToLong(child -> computeMemorySizeInBytes((ItemBoundable) child)).sum(); } <START> else { <END> return ABSTRACT_NODE_INSTANCE_SIZE + ENVELOPE_INSTANCE_SIZE + root.getChildBoundables().stream().mapToLong(child -> computeMemorySizeInBytes((AbstractNode) child)).sum(); } }</code><technical_language>else needed</technical_language>

Target:
private long computeMemorySizeInBytes(AbstractNode root) { if (root.getLevel() == 0) { return ABSTRACT_NODE_INSTANCE_SIZE + ENVELOPE_INSTANCE_SIZE + root.getChildBoundables().stream().mapToLong(child -> computeMemorySizeInBytes((ItemBoundable) child)).sum(); } return ABSTRACT_NODE_INSTANCE_SIZE + ENVELOPE_INSTANCE_SIZE + root.getChildBoundables().stream().mapToLong(child -> computeMemorySizeInBytes((AbstractNode) child)).sum(); }
Source:
<code>public void visit(SystemStreamPartition systemStreamPartition, StartpointTimestamp startpointTimestamp) { Long timestampInStartpoint = startpointTimestamp.getTimestampOffset(); TopicPartition topicPartition = toTopicPartition(systemStreamPartition); Map<TopicPartition, Long> topicPartitionsToTimeStamps = ImmutableMap.of(topicPartition, timestampInStartpoint); LOG.info("Looking up the offsets of the topic partition: by timestamp: {}.", topicPartition, timestampInStartpoint); <START> Map<TopicPartition, OffsetAndTimestamp> topicPartitionToOffsetTimestamps = kafkaConsumer.offsetsForTimes(topicPartitionsToTimeStamps); <END> if (topicPartitionToOffsetTimestamps.get(topicPartition) == null) { LOG.info("Timestamp does not exist for partition: {}. Seeking the kafka consumer to the end offset.", topicPartition); synchronized (kafkaConsumer) { kafkaConsumer.seekToEnd(ImmutableList.of(topicPartition)); } } else { OffsetAndTimestamp offsetAndTimeStamp = topicPartitionToOffsetTimestamps.get(topicPartition); LOG.info("Updating the consumer fetch offsets of the topic partition: to {}.", topicPartition, offsetAndTimeStamp.offset()); synchronized (kafkaConsumer) { kafkaConsumer.seek(topicPartition, offsetAndTimeStamp.offset()); } } proxy.addTopicPartition(systemStreamPartition, kafkaConsumer.position(topicPartition)); }</code><technical_language>this need protected kafkaConsumer lock</technical_language>

Target:
public void visit(SystemStreamPartition systemStreamPartition, StartpointTimestamp startpointTimestamp) { Long timestampInStartpoint = startpointTimestamp.getTimestampOffset(); TopicPartition topicPartition = toTopicPartition(systemStreamPartition); Map<TopicPartition, Long> topicPartitionsToTimeStamps = ImmutableMap.of(topicPartition, timestampInStartpoint); LOG.info("Looking up the offsets of the topic partition: by timestamp: {}.", topicPartition, timestampInStartpoint); Map<TopicPartition, OffsetAndTimestamp> topicPartitionToOffsetTimestamps = new HashMap<>(); synchronized (kafkaConsumer) { topicPartitionToOffsetTimestamps = kafkaConsumer.offsetsForTimes(topicPartitionsToTimeStamps); } if (topicPartitionToOffsetTimestamps.get(topicPartition) == null) { LOG.info("Timestamp does not exist for partition: {}. Seeking the kafka consumer to the end offset.", topicPartition); synchronized (kafkaConsumer) { kafkaConsumer.seekToEnd(ImmutableList.of(topicPartition)); proxy.addTopicPartition(systemStreamPartition, kafkaConsumer.position(topicPartition)); } } else { synchronized (kafkaConsumer) { OffsetAndTimestamp offsetAndTimeStamp = topicPartitionToOffsetTimestamps.get(topicPartition); LOG.info("Updating the consumer fetch offsets of the topic partition: to {}.", topicPartition, offsetAndTimeStamp.offset()); kafkaConsumer.seek(topicPartition, offsetAndTimeStamp.offset()); proxy.addTopicPartition(systemStreamPartition, kafkaConsumer.position(topicPartition)); } } }
Source:
<code>public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ((WordPress) getApplication()).component().inject(this); mDispatcher.register(this); setContentView(R.layout.plugin_detail_activity); String pluginName; if (savedInstanceState == null) { mSite = (SiteModel) getIntent().getSerializableExtra(WordPress.SITE); pluginName = getIntent().getStringExtra(KEY_PLUGIN_NAME); } else { mSite = (SiteModel) savedInstanceState.getSerializable(WordPress.SITE); pluginName = savedInstanceState.getString(KEY_PLUGIN_NAME); } mPlugin = mPluginStore.getSitePluginByName(mSite, pluginName); <START> mPluginInfo = PluginUtils.getPluginInfo(mPluginStore, mPlugin); <END> if (mSite == null) { ToastUtils.showToast(this, R.string.blog_not_found, Duration.SHORT); finish(); return; } if (mPlugin == null) { ToastUtils.showToast(this, R.string.plugin_not_found, Duration.SHORT); finish(); return; } if (mPluginInfo == null) { mDispatcher.dispatch(PluginActionBuilder.newFetchPluginInfoAction(mPlugin.getSlug())); } Toolbar toolbar = findViewById(R.id.toolbar); setSupportActionBar(toolbar); ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { actionBar.setHomeButtonEnabled(true); actionBar.setDisplayHomeAsUpEnabled(true); actionBar.setElevation(0); } setupViews(); }</code><technical_language>I retrieve mPlugInfo *after* check mPlugin is null</technical_language>

Target:
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ((WordPress) getApplication()).component().inject(this); mDispatcher.register(this); String pluginName; if (savedInstanceState == null) { mSite = (SiteModel) getIntent().getSerializableExtra(WordPress.SITE); pluginName = getIntent().getStringExtra(KEY_PLUGIN_NAME); } else { mSite = (SiteModel) savedInstanceState.getSerializable(WordPress.SITE); pluginName = savedInstanceState.getString(KEY_PLUGIN_NAME); } if (mSite == null) { ToastUtils.showToast(this, R.string.blog_not_found, Duration.SHORT); finish(); return; } mPlugin = mPluginStore.getSitePluginByName(mSite, pluginName); if (mPlugin == null) { ToastUtils.showToast(this, R.string.plugin_not_found, Duration.SHORT); finish(); return; } mPluginInfo = PluginUtils.getPluginInfo(mPluginStore, mPlugin); if (mPluginInfo == null) { mDispatcher.dispatch(PluginActionBuilder.newFetchPluginInfoAction(mPlugin.getSlug())); } setContentView(R.layout.plugin_detail_activity); Toolbar toolbar = findViewById(R.id.toolbar); setSupportActionBar(toolbar); ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { actionBar.setTitle(mPlugin.getDisplayName()); actionBar.setHomeButtonEnabled(true); actionBar.setDisplayHomeAsUpEnabled(true); actionBar.setElevation(0); } setupViews(); }
Source:
<code>public static boolean runJobs(List<Jobby> jobs, HadoopDruidIndexerConfig config) { boolean succeeded = true; ObjectMapper objectMapper = new ObjectMapper(); for (Jobby job : jobs) { String hadoopJobId = job.submitAndGetHadoopJobId(); String hadoopJobIdFileName = config.getHadoopJobIdFileName(); if (hadoopJobIdFileName != null) { try { objectMapper.writeValue(new OutputStreamWriter( new FileOutputStream(new File(hadoopJobIdFileName)), StandardCharsets.UTF_8), hadoopJobId); log.info("MR job id is written to jobId file"); } catch (IOException e) { <START> log.error("Error wriritng job id to jobId file. Exception %s ", Throwables.getStackTraceAsString(e)); <END> } } if (!job.run()) { succeeded = false; break; } } if (!config.getSchema().getTuningConfig().isLeaveIntermediate()) { if (succeeded || config.getSchema().getTuningConfig().isCleanupOnFailure()) { Path workingPath = config.makeIntermediatePath(); log.info("Deleting path[%s]", workingPath); try { Configuration conf = injectSystemProperties(new Configuration()); config.addJobProperties(conf); workingPath.getFileSystem(conf).delete(workingPath, true); } catch (IOException e) { log.error(e, "Failed to cleanup path[%s]", workingPath); } } } return succeeded; }</code><technical_language>log.error accepts a Throwable directly, getStackTraceAsString is unnecessary, for runSingleJob also, wriritng -> writing</technical_language>

Target:
public static boolean runJobs(List<Jobby> jobs, HadoopDruidIndexerConfig config) { boolean succeeded = true; for (Jobby job : jobs) { if (!job.run()) { succeeded = false; break; } } if (!config.getSchema().getTuningConfig().isLeaveIntermediate()) { if (succeeded || config.getSchema().getTuningConfig().isCleanupOnFailure()) { Path workingPath = config.makeIntermediatePath(); log.info("Deleting path[%s]", workingPath); try { Configuration conf = injectSystemProperties(new Configuration()); config.addJobProperties(conf); workingPath.getFileSystem(conf).delete(workingPath, true); } catch (IOException e) { log.error(e, "Failed to cleanup path[%s]", workingPath); } } } return succeeded; }
Source:
<code><START> private void maybeAddCluster() throws IOException { <END> for (Map.Entry<String, HelixAdmin> entry : adminForDc.entrySet()) { String dcName = entry.getKey(); HelixAdmin admin = entry.getValue(); if (!admin.getClusters().contains(clusterName)) { info("Adding cluster in {}", clusterName, dcName); admin.addCluster(clusterName); admin.addStateModelDef(clusterName, LeaderStandbySMD.name, LeaderStandbySMD.build()); } } }</code><technical_language>is IOException thrown this method</technical_language>

Target:
private void maybeAddCluster() { for (Map.Entry<String, HelixAdmin> entry : adminForDc.entrySet()) { String dcName = entry.getKey(); HelixAdmin admin = entry.getValue(); if (!admin.getClusters().contains(clusterName)) { info("Adding cluster in {}", clusterName, dcName); admin.addCluster(clusterName); admin.addStateModelDef(clusterName, LeaderStandbySMD.name, LeaderStandbySMD.build()); } } }
Source:
<code>public URL[] getRedirectURLs(RepoObject repoObject) throws RepoException { try { String[] paths = mfs.getPaths(getObjectLocationString(repoObject.getBucketName(), repoObject.getChecksum()), true); int pathCount = paths.length; URL[] urls = new URL[pathCount]; for (int i = 0; i < pathCount; i++) { urls[i] = new URL(paths[i]); } return urls; } catch (Exception e) { log.error("Exception: + " + e.getMessage() + " when trying to fetch the reproxy url for object :" ); log.error("key ----> " + repoObject.getKey()); log.error("bucket name ----> " + repoObject.getBucketName()); log.error("content checksum ----> " + repoObject.getChecksum()); log.error("version number ----> " + repoObject.getVersionNumber()); <START> log.error("Content exists in mogile? ----> " + this.objectExists(repoObject)); <END> throw new RepoException(e); } }</code><technical_language>I this a bad idea. I I asking mogile if content exists in a catch block for mfs.getPaths function. parameterized messages logger.debug("The entry is {}.", entry); <LINK_0></technical_language>

Target:
public URL[] getRedirectURLs(RepoObject repoObject) throws RepoException { try { String[] paths = mfs.getPaths(getObjectLocationString(repoObject.getBucketName(), repoObject.getChecksum()), true); int pathCount = paths.length; URL[] urls = new URL[pathCount]; for (int i = 0; i < pathCount; i++) { urls[i] = new URL(paths[i]); } return urls; } catch (Exception e) { log.error("Exception: when trying to fetch reproxy url, key: , bucket name: , content checksum: , version number: ", e.getMessage(), repoObject.getKey(), repoObject.getBucketName(), repoObject.getChecksum(), repoObject.getVersionNumber()); throw new RepoException(e); } }
Source:
<code>public void parse(InputStream in) throws IOException { BufferedReader br = asReader(in); String txt; while ((txt = br.readLine()) != null) { txt = txt.trim(); <START> if (txt.length() > 0 && !txt.startsWith("#")) { END> int patternEndSpace = txt.indexOf(' '); int patternEndTab = txt.indexOf('\t'); final int patternEnd; if (patternEndSpace == -1) patternEnd = patternEndTab; else if (patternEndTab == -1) patternEnd = patternEndSpace; else patternEnd = Math.min(patternEndSpace, patternEndTab); if (patternEnd > -1) rules.add(new AttributesRule(txt.substring(0, patternEnd), txt.substring(patternEnd + 1).trim())); } } }</code><technical_language>I sense move check for leading negation sign "!" AttributesRule here</technical_language>

Target:
public void parse(InputStream in) throws IOException { BufferedReader br = asReader(in); String txt; while ((txt = br.readLine()) != null) { txt = txt.trim(); if (txt.length() > 0 && !txt.startsWith("#") && !txt.startsWith("!") ) { int patternEndSpace = txt.indexOf(' '); int patternEndTab = txt.indexOf('\t'); final int patternEnd; if (patternEndSpace == -1) patternEnd = patternEndTab; else if (patternEndTab == -1) patternEnd = patternEndSpace; else patternEnd = Math.min(patternEndSpace, patternEndTab); if (patternEnd > -1) rules.add(new AttributesRule(txt.substring(0, patternEnd), txt.substring(patternEnd + 1).trim())); } } }
Source:
<code>public void testStripDefaultPort() throws URISyntaxException { String methodName = "stripDefaultPort"; assertEquals(new URI("<LINK_3>"), invoke(Configuration.class, methodName, new URI("<LINK_6>"))); assertEquals(new URI("<LINK_5>"), invoke(Configuration.class, methodName, new URI("<LINK_5>"))); assertEquals(new URI("<LINK_1>"), invoke(Configuration.class, methodName, new URI("<LINK_2>"))); assertEquals(new URI("<LINK_7>"), invoke(Configuration.class, methodName, new URI("<LINK_7>"))); assertEquals(new URI("HTTP://example.com/test"), invoke(Configuration.class, methodName, new URI("HTTP://example.com:80/test"))); <START> } <END></code><technical_language>nice a test for <LINK_4></technical_language>

Target:
public void testStripDefaultPort() throws URISyntaxException { String methodName = "stripDefaultPort"; assertEquals(new URI("<LINK_3>"), invoke(Configuration.class, methodName, new URI("<LINK_6>"))); assertEquals(new URI("<LINK_5>"), invoke(Configuration.class, methodName, new URI("<LINK_5>"))); assertEquals(new URI("<LINK_1>"), invoke(Configuration.class, methodName, new URI("<LINK_2>"))); assertEquals(new URI("<LINK_7>"), invoke(Configuration.class, methodName, new URI("<LINK_7>"))); assertEquals(new URI("HTTP://example.com/test"), invoke(Configuration.class, methodName, new URI("HTTP://example.com:80/test"))); assertEquals(new URI("HTTP://example.com:9080/test"), invoke(Configuration.class, methodName, new URI("HTTP://example.com:9080/test"))); assertEquals(new URI("<LINK_4>"), invoke(Configuration.class, methodName, new URI("<LINK_4>"))); assertEquals(new URI("<LINK_0>"), invoke(Configuration.class, methodName, new URI("<LINK_0>"))); }
Source:
<code>public TestCase(final String name, final Object fieldValue, final String values, final Object expectedValue, final Class fieldType) { this.name = name; this.fieldValue = fieldValue; this.values = values; this.fieldType = fieldType; <START> this.expectedValue = expectedValue; <END> }</code><technical_language>Put assignments in order clearer</technical_language>

Target:
public TestCase(final String name, final Object fieldValue, final String values, final Object expectedValue, final Class fieldType) { this.name = name; this.fieldValue = fieldValue; this.values = values; this.expectedValue = expectedValue; this.fieldType = fieldType; }
Source:
<code><START> public Subscriber (FSubscriberTransport t, FProtocolFactory pf) { <END> transport = t; protocolFactory = pf; }</code><technical_language>Consider a private constructor for future extensibility a fluent API. java private Subscriber(...) { } public static Subscriber of(...) { return new Subscriber(); } Usage: FSubscriberTransport s = FScopeProvider.Subscriber.of(...).getTransport();</technical_language>

Target:
private Subscriber (FSubscriberTransport t, FProtocolFactory pf) { transport = t; protocolFactory = pf; }
Source:
<code>protected void executeCommand() { <START> storage_pool storagePool = DbFacade.getInstance().getStoragePoolDAO().get(getStoragePool().getId()); <END> if ((storagePool.getQuotaEnforcementType() != QuotaEnforcmentTypeEnum.DISABLED) && (getStoragePool().getQuotaEnforcementType() == QuotaEnforcmentTypeEnum.DISABLED)) { QuotaHelper.getInstance().addDefaultQuota(storagePool); } DbFacade.getInstance().getStoragePoolDAO().updatePartial(getStoragePool()); if (getStoragePool().getstatus() == StoragePoolStatus.Up && !StringHelper.EqOp(_oldStoragePool.getname(), getStoragePool().getname())) { Backend.getInstance() .getResourceManager() .RunVdsCommand( VDSCommandType.SetStoragePoolDescription, new SetStoragePoolDescriptionVDSCommandParameters(getStoragePool().getId(), getStoragePool().getname())); } setSucceeded(true); }</code><technical_language>this _oldStoragePool</technical_language>

Target:
protected void executeCommand() { storage_pool storagePool = DbFacade.getInstance().getStoragePoolDAO().get(getStoragePool().getId()); if ((storagePool.getQuotaEnforcementType() == QuotaEnforcmentTypeEnum.DISABLED) && (getStoragePool().getQuotaEnforcementType() != QuotaEnforcmentTypeEnum.DISABLED)) { QuotaHelper.getInstance().setDefaultQuotaAsRegularQuota(storagePool); } DbFacade.getInstance().getStoragePoolDAO().updatePartial(getStoragePool()); if (getStoragePool().getstatus() == StoragePoolStatus.Up && !StringHelper.EqOp(_oldStoragePool.getname(), getStoragePool().getname())) { Backend.getInstance() .getResourceManager() .RunVdsCommand( VDSCommandType.SetStoragePoolDescription, new SetStoragePoolDescriptionVDSCommandParameters(getStoragePool().getId(), getStoragePool().getname())); } setSucceeded(true); }