auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void serverAddedSegment(final DruidServerMetadata server, final DataSegment segment) { String segmentId = segment.getIdentifier(); synchronized (lock) { log.debug("Adding segment[%s] for server[%s]", segment, server); <START> Set<DruidServerMetadata> servers = this.servers.get(segmentId); <END> if (servers == null) { servers = Sets.newConcurrentHashSet(); VersionedIntervalTimeline<String, SegmentLoadInfo> timeline = timelines.get(segment.getDataSource()); if (timeline == null) { timeline = new VersionedIntervalTimeline<>(Ordering.natural()); timelines.put(segment.getDataSource(), timeline); } timeline.add( segment.getInterval(), segment.getVersion(), segment.getShardSpec().createChunk(new SegmentLoadInfo(segment, servers)) ); this.servers.put(segmentId, servers); } servers.add(server); } }</code><technical_language>please rename this, confusing servers servers a class member</technical_language>

Target:
private void serverAddedSegment(final DruidServerMetadata server, final DataSegment segment) { String segmentId = segment.getIdentifier(); synchronized (lock) { log.debug("Adding segment[%s] for server[%s]", segment, server); SegmentLoadInfo segmentLoadInfo = segmentLoadInfos.get(segmentId); if (segmentLoadInfo == null) { segmentLoadInfo = new SegmentLoadInfo(segment); VersionedIntervalTimeline<String, SegmentLoadInfo> timeline = timelines.get(segment.getDataSource()); if (timeline == null) { timeline = new VersionedIntervalTimeline<>(Ordering.natural()); timelines.put(segment.getDataSource(), timeline); } timeline.add( segment.getInterval(), segment.getVersion(), segment.getShardSpec().createChunk(segmentLoadInfo) ); segmentLoadInfos.put(segmentId, segmentLoadInfo); } segmentLoadInfo.addServer(server); } }
Source:
<code>@Override Bitmap decode(Uri uri, PicassoBitmapOptions options) throws IOException { <START> options.exifRotation = Utils.getFileExifRotation(uri.getPath()); <END> return super.decode(uri, options); }</code><technical_language>Inline utils crap in this class again</technical_language>

Target:
@Override Bitmap decode(Uri uri, PicassoBitmapOptions options) throws IOException { if (options != null) { options.exifRotation = getFileExifRotation(uri.getPath()); } return super.decode(uri, options); }
Source:
<code>private MirrorOptions createMirrorOptions() { MirrorOptions options = new MirrorOptions(); <START> options.setFollowOnlyFilteredRequirements(followOnlyFilteredRequirements); <END> options.setFollowStrictOnly(followStrictOnly); options.setIncludeFeatures(includeFeature); options.setIncludeNonGreedy(includeNonGreedy); options.setIncludeOptional(includeOptional); options.setLatestVersionOnly(latestVersionOnly); return options; }</code><technical_language>this.variable instead of variable</technical_language>

Target:
private MirrorOptions createMirrorOptions() { MirrorOptions options = new MirrorOptions(); options.setFollowOnlyFilteredRequirements(this.followOnlyFilteredRequirements); options.setFollowStrictOnly(this.followStrictOnly); options.setIncludeFeatures(this.includeFeature); options.setIncludeNonGreedy(this.includeNonGreedy); options.setIncludeOptional(this.includeOptional); options.setLatestVersionOnly(this.latestVersionOnly); return options; }
Source:
<code>public static void main(String... args) throws InterruptedException { System.out.println(">>> Decision tree regression trainer example started."); try (Ignite ignite = Ignition.start("examples/config/example-ignite.xml")) { System.out.println(">>> Ignite grid started."); IgniteThread igniteThread = new IgniteThread(ignite.configuration().getIgniteInstanceName(), DecisionTreeRegressionTrainerExample.class.getSimpleName(), () -> { CacheConfiguration<Integer, Point> trainingSetCfg = new CacheConfiguration<>(); trainingSetCfg.setName("TRAINING_SET"); <START> trainingSetCfg.setAffinity(new RendezvousAffinityFunction(false, 1)); <END> IgniteCache<Integer, Point> trainingSet = ignite.createCache(trainingSetCfg); generatePoints(trainingSet); DecisionTreeRegressionTrainer trainer = new DecisionTreeRegressionTrainer(10, 0, false); DecisionTreeNode mdl = trainer.fit( ignite, trainingSet, (k, v) -> VectorUtils.of(v.x), (k, v) -> v.y ); System.out.println(">>> Decision tree regression model: " + mdl); System.out.println(">>> ---------------------------------"); System.out.println(">>> | Prediction\t| Ground Truth\t|"); System.out.println(">>> ---------------------------------"); for (int x = 0; x < 10; x++) { double predicted = mdl.apply(VectorUtils.of(x)); System.out.printf(">>> | %.4f\t\t| %.4f\t\t|\n", predicted, Math.sin(x)); } System.out.println(">>> ---------------------------------"); System.out.println(">>> Decision tree regression trainer example completed."); }); igniteThread.start(); igniteThread.join(); } }</code><technical_language>again, 1? work multiple partitions</technical_language>

Target:
public static void main(String... args) throws InterruptedException { System.out.println(">>> Decision tree regression trainer example started."); try (Ignite ignite = Ignition.start("examples/config/example-ignite.xml")) { System.out.println(">>> Ignite grid started."); IgniteThread igniteThread = new IgniteThread(ignite.configuration().getIgniteInstanceName(), DecisionTreeRegressionTrainerExample.class.getSimpleName(), () -> { CacheConfiguration<Integer, Point> trainingSetCfg = new CacheConfiguration<>(); trainingSetCfg.setName("TRAINING_SET"); trainingSetCfg.setAffinity(new RendezvousAffinityFunction(false, 10)); IgniteCache<Integer, Point> trainingSet = ignite.createCache(trainingSetCfg); generatePoints(trainingSet); DecisionTreeRegressionTrainer trainer = new DecisionTreeRegressionTrainer(10, 0); DecisionTreeNode mdl = trainer.fit( ignite, trainingSet, (k, v) -> VectorUtils.of(v.x), (k, v) -> v.y ); System.out.println(">>> Decision tree regression model: " + mdl); System.out.println(">>> ---------------------------------"); System.out.println(">>> | Prediction\t| Ground Truth\t|"); System.out.println(">>> ---------------------------------"); for (int x = 0; x < 10; x++) { double predicted = mdl.apply(VectorUtils.of(x)); System.out.printf(">>> | %.4f\t\t| %.4f\t\t|\n", predicted, Math.sin(x)); } System.out.println(">>> ---------------------------------"); System.out.println(">>> Decision tree regression trainer example completed."); }); igniteThread.start(); igniteThread.join(); } }
Source:
<code>public boolean equals(final Object o) { if (o instanceof CSCMatrix) { return breezeMatrix.equals(((CSCMatrix) o).breezeMatrix); } <START> if (o instanceof DenseMatrix) { <END> return breezeMatrix.equals(((DenseMatrix) o).getBreezeMatrix()); } return false; }</code><technical_language>Please else if. However, I wondering if result is false o is instance of DenseMatrix. tested this in scala console a DenseMatrix a CSCMatrix of elements. check this</technical_language>

Target:
public boolean equals(final Object o) { if (this == o) { return true; } else if (o instanceof CSCMatrix) { return breezeMatrix.equals(((CSCMatrix) o).breezeMatrix); } else if (o instanceof DenseMatrix) { return breezeMatrix.equals(((DenseMatrix) o).getBreezeMatrix()); } else { return false; } }
Source:
<code>protected void certificateSanity(String certificatePem) { Certificate certificate = getCertificateFromString(certificatePem); if (certificate instanceof X509CertImpl) { X509CertImpl x509Cert = (X509CertImpl) certificate; try { x509Cert.checkValidity(); } catch (CertificateExpiredException | CertificateNotYetValidException e) { <START> e.printStackTrace(); <END> throw new CloudRuntimeException("Certificate is invalid. Please provide a valid certificate. Error: " + e.getMessage()); } if (x509Cert.getSubjectDN() != null) { s_logger.info("Valid certificate for domain name: " + x509Cert.getSubjectDN().getName()); } } }</code><technical_language>A log message is printing stack trace</technical_language>

Target:
protected void certificateSanity(String certificatePem) { Certificate certificate = getCertificateFromString(certificatePem); if (certificate instanceof X509CertImpl) { X509CertImpl x509Cert = (X509CertImpl) certificate; try { x509Cert.checkValidity(); } catch (CertificateExpiredException | CertificateNotYetValidException e) { String msg = "Certificate is invalid. Please provide a valid certificate. Error: " + e.getMessage(); s_logger.error(msg); throw new CloudRuntimeException(msg); } if (x509Cert.getSubjectDN() != null) { s_logger.debug("Valid certificate for domain name: " + x509Cert.getSubjectDN().getName()); } } }
Source:
<code>private IPv4Addr vxlanTunnelEndpointForInternal(Bridge b, BridgePort port) throws SerializationException, StateAccessException { if (b.getVxLanPortIds() == null) { return null; } VxLanPort vxlanPort = null; int i = 0; while (vxlanPort == null && i < b.getVxLanPortIds().size()) { vxlanPort = (VxLanPort)portsGet(b.getVxLanPortIds().get(i++)); if (vxlanPort == null) { log.warn("VxLanPort at bridge does not exist anymore", b.getVxLanPortIds(), b.getId()); } } if (vxlanPort == null) { log.warn("Can't find VTEP tunnel zone on bridge - is it even " + "bound to a VTEP?", b.getId()); return null; } IPv4Addr vtepMgmtIp = vxlanPort.getMgmtIpAddr(); log.debug("Port's <START> bridge <END> is bound to one or more VTEPs"); UUID hostId = port.getHostId(); if (hostId == null) { log.error("Port is not bound to a host", port.getId()); return null; } VTEP vtep = vtepGet(vtepMgmtIp); if (vtep == null) { log.warn("Vtep bound to bridge does not exist anymore", vtepMgmtIp, b.getId()); return null; } UUID tzId = vtep.getTunnelZoneId(); TunnelZone.HostConfig hostCfg = this.tunnelZonesGetMembership(tzId, hostId); if (hostCfg == null) { log.error("Port on bridge bount to an interface in host " + "was expected to belong to tunnel zone through " + "binding to VTEP {}", port.getId(), b.getId(), hostId, tzId, vtepMgmtIp); return null; } return hostCfg.getIp(); }</code><technical_language>Give port id</technical_language>

Target:
private IPv4Addr vxlanTunnelEndpointForInternal(Bridge b, BridgePort port) throws SerializationException, StateAccessException { if (b.getVxLanPortIds() == null) { return null; } VxLanPort vxlanPort = null; int i = 0; while (vxlanPort == null && i < b.getVxLanPortIds().size()) { vxlanPort = (VxLanPort)portsGet(b.getVxLanPortIds().get(i++)); if (vxlanPort == null) { log.warn("VxLanPort at bridge does not exist anymore", b.getVxLanPortIds(), b.getId()); } } if (vxlanPort == null) { log.warn("Can't find VTEP tunnel zone on bridge - is it even " + "bound to a VTEP?", b.getId()); return null; } IPv4Addr vtepMgmtIp = vxlanPort.getMgmtIpAddr(); log.debug("Port's bridge is bound to one or more VTEPs", b.getId()); UUID hostId = port.getHostId(); if (hostId == null) { log.error("Port is not bound to a host", port.getId()); return null; } VTEP vtep = vtepGet(vtepMgmtIp); if (vtep == null) { log.warn("Vtep bound to bridge does not exist anymore", vtepMgmtIp, b.getId()); return null; } UUID tzId = vtep.getTunnelZoneId(); TunnelZone.HostConfig hostCfg = this.tunnelZonesGetMembership(tzId, hostId); if (hostCfg == null) { log.error("Port on bridge bount to an interface in host " + "was expected to belong to tunnel zone through " + "binding to VTEP {}", port.getId(), b.getId(), hostId, tzId, vtepMgmtIp); return null; } return hostCfg.getIp(); }
Source:
<code>private String name(final Request file) throws IOException { final Matcher matcher = FILE_NAME_PATTERN.matcher( new RqHeaders.Smart( new RqHeaders.Base(file) ).single("Content-Disposition") ); if (!matcher.find()) { throw new RsFailure("Filename was not provided"); } <START> final String name = URLDecoder.decode( <END> matcher.group(5), CharEncoding.UTF_8 ); return name; }</code><technical_language>@bdragan return URLDecoder.decode(</technical_language>

Target:
private String name(final Request file) throws IOException { final Matcher matcher = TkAttach.FILE_NAME_PATTERN.matcher( new RqHeaders.Smart( new RqHeaders.Base(file) ).single("Content-Disposition") ); if (!matcher.find()) { throw new RsFailure("Filename was not provided"); } return URLDecoder.decode(matcher.group(5), CharEncoding.UTF_8); }
Source:
<code>public static <T> T retry(Supplier<T> func, Duration period, Duration timeout) { final List<T> returnValue = new ArrayList<>(); <START> final Exception[] lastException = new Exception[1]; <END> boolean result = PollUtils.poll(() -> { try { returnValue.add(func.get()); } catch (Exception e) { if (e instanceof RetriableException) { lastException[0] = e; LOG.info("Method threw a retriable exception.", e); return false; } throw e; } return true; }, period.toMillis(), timeout.toMillis()); if (!result) { LOG.error("Retries exhausted.", lastException[0]); throw new RetriesExhaustedExeption(lastException[0]); } return returnValue.get(0); }</code><technical_language>I get idea of array here..</technical_language>

Target:
public static <T> T retry(Supplier<T> func, Duration period, Duration timeout) { ExceptionTrackingMethodCaller<T> supplier = new ExceptionTrackingMethodCaller<>(func); boolean result = PollUtils.poll(supplier, period.toMillis(), timeout.toMillis()); if (!result) { LOG.error("Retries exhausted.", supplier.getLastException()); throw new RetriesExhaustedExeption(supplier.getLastException()); } return supplier.getValue(); }
Source:
<code>protected List<IdealState> setupIdealState(int nodes, String[] resources, int partitions, int replicas, RebalanceMode rebalanceMode) { return setupIdealState(nodes, resources, partitions, replicas, rebalanceMode, <START> BuiltInStateModelDefinitions.MasterSlave.name(), null, null, -1); <END> }</code><technical_language>Nit: this a constant for readability: MIN_ACTIVE_REPLICA_NOT_SET = -1</technical_language>

Target:
protected List<IdealState> setupIdealState(int nodes, String[] resources, int partitions, int replicas, RebalanceMode rebalanceMode) { return setupIdealState(nodes, resources, partitions, replicas, rebalanceMode, BuiltInStateModelDefinitions.MasterSlave.name(), null, null, MIN_ACTIVE_REPLICA_NOT_SET); }
Source:
<code><START> void insertFieldAbove() { <END> closeEditMode(); final DataType newDataType = newDataType(); final List<DataType> updatedDataTypes = newDataType.create(getDataType(), ABOVE); if (newDataType.isTopLevel()) { dataTypeList.insertBefore(newDataType, getDataType()); } else { dataTypeList.refreshItemsByUpdatedDataTypes(updatedDataTypes); } }</code><technical_language>insertAfter(..) insertBefore(..) DataTypeList View insert(Field)Above(..) insert(Field)Below(..) here.. a consistent term better</technical_language>

Target:
void insertFieldAbove() { closeEditMode(); final DataType newDataType = newDataType(); final List<DataType> updatedDataTypes = newDataType.create(getDataType(), ABOVE); if (newDataType.isTopLevel()) { dataTypeList.insertAbove(newDataType, getDataType()); } else { dataTypeList.refreshItemsByUpdatedDataTypes(updatedDataTypes); } }
Source:
<code>public List<Plan> planQueries(BenchmarkData benchmarkData) { <START> return benchmarkData.queryRunner.inTransaction(txSession -> benchmarkData.getQueries() <END> .map(query -> plan(benchmarkData, txSession, query)) .collect(toImmutableList())); }</code><technical_language>s/txSession/transactionSession conver lambda { .. } form</technical_language>

Target:
public List<Plan> planQueries(BenchmarkData benchmarkData) { return benchmarkData.queryRunner.inTransaction(transactionSession -> { LogicalPlanner.Stage stage = LogicalPlanner.Stage.valueOf(benchmarkData.stage.toUpperCase()); return benchmarkData.queries.stream() .map(query -> benchmarkData.queryRunner.createPlan(transactionSession, query, stage)) .collect(toImmutableList()); }); }
Source:
<code>public void removeUnusedMessagesBroadcastTest() { onBrickAtPosition(0).checkShowsText(R.string.brick_when_started); <START> onBrickAtPosition(1).checkShowsText(R.string.brick_broadcast); <END> onBrickAtPosition(2).checkShowsText(R.string.brick_broadcast_receive); onBrickAtPosition(3).checkShowsText(R.string.brick_broadcast_wait); onBrickAtPosition(brickPosition).onSpinner(spinnerId) .checkShowsText(defaultMessage); String newMessage = "newMessage"; onBrickAtPosition(brickPosition).onSpinner(spinnerId) .perform(click()); onView(withText(R.string.new_broadcast_message)) .perform(click()); onView(withId(R.id.edit_text)) .perform(clearText(), typeTextIntoFocusedView(newMessage)); onView(withText(R.string.ok)) .perform(click()); onBrickAtPosition(brickPosition).onSpinner(spinnerId) .checkShowsText(newMessage); onBrickAtPosition(brickPosition).onSpinner(spinnerId) .perform(click()); onView(withText(defaultMessage)) .perform(click()); onBrickAtPosition(brickPosition).onSpinner(spinnerId) .checkShowsText(defaultMessage); onView(withId(R.id.button_play)) .perform(click()); pressBack(); pressBack(); onBrickAtPosition(brickPosition).onSpinner(spinnerId) .perform(click()); onView(withText(newMessage)) .check(doesNotExist()); }</code><technical_language>please variable names, easier read comprehend hardcoded values 1,2,3..</technical_language>

Target:
public void removeUnusedMessagesBroadcastTest() { onBrickAtPosition(whenBrickPosition).checkShowsText(R.string.brick_when_started); onBrickAtPosition(broadcastSendPosition).checkShowsText(R.string.brick_broadcast); onBrickAtPosition(broadcastReceivePosition).checkShowsText(R.string.brick_broadcast_receive); onBrickAtPosition(broadcastAndWaitPosition).checkShowsText(R.string.brick_broadcast_wait); onBrickAtPosition(brickPosition).onSpinner(spinnerId) .checkShowsText(defaultMessage); String newMessage = "newMessage"; onBrickAtPosition(brickPosition).onSpinner(spinnerId) .perform(click()); onView(withText(R.string.new_broadcast_message)) .perform(click()); onView(withId(R.id.edit_text)) .perform(clearText(), typeTextIntoFocusedView(newMessage)); onView(withText(R.string.ok)) .perform(click()); onBrickAtPosition(brickPosition).onSpinner(spinnerId) .checkShowsText(newMessage); onBrickAtPosition(brickPosition).onSpinner(spinnerId) .perform(click()); onView(withText(defaultMessage)) .perform(click()); onBrickAtPosition(brickPosition).onSpinner(spinnerId) .checkShowsText(defaultMessage); onView(withId(R.id.button_play)) .perform(click()); pressBack(); pressBack(); onBrickAtPosition(brickPosition).onSpinner(spinnerId) .perform(click()); onView(withText(newMessage)) .check(doesNotExist()); }
Source:
<code>public CompletionStage<Void> rollbackAllTxStores(TxInvocationContext<AbstractCacheTransaction> txInvocationContext, Predicate<? super StoreConfiguration> predicate) { return Completable.using( this::acquireReadLock, ignore -> { checkStoreAvailability(); if (trace) { log.tracef("Rolling back transaction %s for stores", txInvocationContext); } return Flowable.fromIterable(stores) .filter(storeStatus -> shouldPerformTransactionOperation(storeStatus, predicate)) <START> .flatMapCompletable(storeStatus -> Completable.fromCompletionStage(storeStatus.store.commit(txInvocationContext.getTransaction()))); <END> }, this::releaseReadLock ).toCompletionStage(null); }</code><technical_language>this storeStatus.store.rollback? worrying this detected testsuite :scream:</technical_language>

Target:
public CompletionStage<Void> rollbackAllTxStores(TxInvocationContext<AbstractCacheTransaction> txInvocationContext, Predicate<? super StoreConfiguration> predicate) { return Completable.using( this::acquireReadLock, ignore -> { checkStoreAvailability(); if (trace) { log.tracef("Rolling back transaction %s for stores", txInvocationContext); } return Flowable.fromIterable(stores) .filter(storeStatus -> shouldPerformTransactionOperation(storeStatus, predicate)) .flatMapCompletable(storeStatus -> Completable.fromCompletionStage(storeStatus.store.rollback(txInvocationContext.getTransaction()))); }, this::releaseReadLock ).toCompletionStage(null); }
Source:
<code>public void initialise() { playerCamera = worldRenderer.getActiveCamera(); wireframeStateChange = new SetWireframe(true); renderingDebugConfig = config.getRendering().getDebug(); new WireframeTrigger(renderingDebugConfig, this); requiresCondition(() -> !renderingDebugConfig.isFirstPersonElementsHidden()); renderingDebugConfig.subscribe(RenderingDebugConfig.FIRST_PERSON_ELEMENTS_HIDDEN, this); addDesiredStateChange(new SetViewportToSizeOf(READONLY_GBUFFER, displayResolutionDependentFBOs)); addDesiredStateChange(new BindFBO(READONLY_GBUFFER, displayResolutionDependentFBOs)); update(); addDesiredStateChange(new SetDepthFunction(GL_ALWAYS)); <START> displayResolutionDependentFBOs.subscribe(this); <END> }</code><technical_language>move this please</technical_language>

Target:
public void initialise() { playerCamera = worldRenderer.getActiveCamera(); wireframeStateChange = new SetWireframe(true); renderingDebugConfig = config.getRendering().getDebug(); new WireframeTrigger(renderingDebugConfig, this); requiresCondition(() -> !renderingDebugConfig.isFirstPersonElementsHidden()); renderingDebugConfig.subscribe(RenderingDebugConfig.FIRST_PERSON_ELEMENTS_HIDDEN, this); addDesiredStateChange(new BindFBO(READONLY_GBUFFER, displayResolutionDependentFBOs)); addDesiredStateChange(new SetDepthFunction(GL_ALWAYS)); }
Source:
<code><START> private String[] toPathArray(String notePath, boolean includeLast) { <END> if (null == notePath || notePath.length() == 0) { throw new NullPointerException("notePath is null"); } notePath = notePath.replaceAll("/+", "/"); if ("/".equals(notePath)) { return ArrayUtils.EMPTY_STRING_ARRAY; } String[] arr = notePath.substring(1).split("/"); return includeLast ? arr : Arrays.copyOfRange(arr, 0, arr.length - 1); }</code><technical_language>mght unit test for this</technical_language>

Target:
String[] toPathArray(String notePath, boolean includeLast) { if (null == notePath || notePath.length() == 0) { throw new NullPointerException("notePath is null"); } notePath = notePath.replaceAll("/+", "/"); if ("/".equals(notePath)) { return ArrayUtils.EMPTY_STRING_ARRAY; } if (notePath.startsWith("/")) { notePath = notePath.substring(1); } String[] arr = notePath.split("/"); return includeLast ? arr : Arrays.copyOfRange(arr, 0, arr.length - 1); }
Source:
<code>public Set<String> parse(Config cfg) { final Set<String> result = new HashSet<String>(); while (cfg != null) { for (final Entry e : cfg.state.get().entryList) { if (e.name != null && StringUtils.equalsIgnoreCase(e.section, section)) { if (subsection == null && e.subsection == null) <START> result.add(e.name); <END> else if (e.subsection != null && e.subsection.equals(subsection)) result.add(e.name); } } cfg = cfg.baseConfig; } return Collections.unmodifiableSet(result); }</code><technical_language>SectionNames, I export name in case, caller sees a consistent case in returned set</technical_language>

Target:
public Set<String> parse(Config cfg) { final Set<String> result = new HashSet<String>(); while (cfg != null) { for (final Entry e : cfg.state.get().entryList) { if (e.name != null && StringUtils.equalsIgnoreCase(e.section, section)) { if (subsection == null && e.subsection == null) result.add(StringUtils.toLowerCase(e.name)); else if (e.subsection != null && e.subsection.equals(subsection)) result.add(StringUtils.toLowerCase(e.name)); } } cfg = cfg.baseConfig; } return Collections.unmodifiableSet(result); }
Source:
<code>public Object convert(MBeanServerConnection connection, ObjectInstance instance) { Map<String, Object> attributeMap = new HashMap<String, Object>(); try { ObjectName objName = instance.getObjectName(); if (!connection.isRegistered(objName)) { return attributeMap; } MBeanInfo info = connection.getMBeanInfo(objName); MBeanAttributeInfo[] attributeInfos = info.getAttributes(); for (MBeanAttributeInfo attrInfo : attributeInfos) { if ("ObjectName".equals(attrInfo.getName())) continue; Object value; try { value = connection.getAttribute(objName, attrInfo.getName()); } catch (RuntimeMBeanException e) { <START> Throwable t = e; <END> while (t.getCause() != null) { t = t.getCause(); } value = String.format("%s[%s]", t.getClass().getName(), t.getMessage()); } attributeMap.put(attrInfo.getName(), checkAndConvert(value)); } } catch (Exception e) { throw new IllegalArgumentException(e); } return attributeMap; }</code><technical_language>a DEBUG log of exception unwrapping</technical_language>

Target:
public Object convert(MBeanServerConnection connection, ObjectInstance instance) { Map<String, Object> attributeMap = new HashMap<String, Object>(); try { ObjectName objName = instance.getObjectName(); if (!connection.isRegistered(objName)) { return attributeMap; } MBeanInfo info = connection.getMBeanInfo(objName); MBeanAttributeInfo[] attributeInfos = info.getAttributes(); for (MBeanAttributeInfo attrInfo : attributeInfos) { if ("ObjectName".equals(attrInfo.getName()) || !filter.accept(objName, attrInfo.getName())) { continue; } Object value; try { value = connection.getAttribute(objName, attrInfo.getName()); } catch (RuntimeMBeanException e) { if (log.isTraceEnabled()) { log.trace("Error getting attribute '" + attrInfo.getName() + "' on '" + objName + "'", e); } Throwable t = e; while (t.getCause() != null) { t = t.getCause(); } value = String.format("%s[%s]", t.getClass().getName(), t.getMessage()); } attributeMap.put(attrInfo.getName(), checkAndConvert(value)); } } catch (Exception e) { throw new IllegalArgumentException(e); } return attributeMap; }
Source:
<code>private void doDisplayRun() { try { showProgressHandler.sendEmptyMessage(SHOW_PROGRESS); final List<Geocache> cachesToDisplay = caches.getAsList(); final List<CachesOverlayItemImpl> itemsToDisplay = new ArrayList<>(); if (!cachesToDisplay.isEmpty()) { if (mapOptions.mapMode == MapMode.SINGLE || cachesCnt < Settings.getWayPointsThreshold()) { for (final Waypoint waypoint : waypoints) { if (waypoint != null && waypoint.getCoords() != null) { itemsToDisplay.add(getWaypointItem(waypoint)); } } } for (final Geocache cache : cachesToDisplay) { if (cache != null && cache.getCoords() != null) { itemsToDisplay.add(getCacheItem(cache)); } <START> } <END> } if (mapOptions.coords == null) { overlayCaches.updateItems(itemsToDisplay); } displayHandler.sendEmptyMessage(INVALIDATE_MAP); updateMapTitle(); } finally { showProgressHandler.sendEmptyMessage(HIDE_PROGRESS); } }</code><technical_language>This introduced in #1402 avoid iterating original waypoints collection asynchronously. Generally copy constructors in cgeo removed if is completely is more concurrent access collection in question</technical_language>

Target:
private void doDisplayRun() { try { showProgressHandler.sendEmptyMessage(SHOW_PROGRESS); final List<Geocache> cachesToDisplay = caches.getAsList(); final List<Waypoint> waypointsToDisplay = new ArrayList<>(waypoints); final List<CachesOverlayItemImpl> itemsToDisplay = new ArrayList<>(); if (!cachesToDisplay.isEmpty()) { if (mapOptions.mapMode == MapMode.SINGLE || cachesCnt < Settings.getWayPointsThreshold()) { for (final Waypoint waypoint : waypointsToDisplay) { if (waypoint != null && waypoint.getCoords() != null) { itemsToDisplay.add(getWaypointItem(waypoint)); } } } for (final Geocache cache : cachesToDisplay) { if (cache != null && cache.getCoords() != null) { itemsToDisplay.add(getCacheItem(cache)); } } } if (mapOptions.coords == null) { overlayCaches.updateItems(itemsToDisplay); } displayHandler.sendEmptyMessage(INVALIDATE_MAP); updateMapTitle(); } finally { showProgressHandler.sendEmptyMessage(HIDE_PROGRESS); } }
Source:
<code>public boolean execute(BindContext context) { Consumer consumer = context.getLockedConsumer(); Map<String, Entitlement> entitlementMap = context.getEntitlementMap(); Map<String, PoolQuantity> lockedPools = context.getPoolQuantities(); List<Pool> poolsToSave = new LinkedList<Pool>(); <START> for (Entry<String, PoolQuantity> entry: context.getPoolQuantities().entrySet()) { <END> Entitlement ent = entitlementMap.get(entry.getKey()); Pool pool = lockedPools.get(entry.getKey()).getPool(); Integer quantity = ent.getQuantity(); pool.getEntitlements().add(ent); ent.setPool(pool); ent.setConsumer(consumer); ent.setOwner(consumer.getOwner()); pool.setConsumed(pool.getConsumed() + quantity); if (consumer.isManifestDistributor()) { pool.setExported(pool.getExported() + quantity); } else if (consumer.isShare()) { pool.setShared(pool.getShared() + quantity); } consumer.addEntitlement(ent); consumer.setEntitlementCount(consumer.getEntitlementCount() + quantity); poolsToSave.add(pool); } entitlementCurator.saveAll(entitlementMap.values(), false, false); poolCurator.updateAll(poolsToSave, false, false); return true; }</code><technical_language>context.getPoolQuantities() stored in lockedPools. lockedPools.entrySet()</technical_language>

Target:
public boolean execute(BindContext context) { Consumer consumer = context.getLockedConsumer(); Map<String, Entitlement> entitlementMap = context.getEntitlementMap(); Map<String, PoolQuantity> lockedPools = context.getPoolQuantities(); List<Pool> poolsToSave = new LinkedList<Pool>(); for (Entry<String, PoolQuantity> entry: lockedPools.entrySet()) { Entitlement ent = entitlementMap.get(entry.getKey()); Pool pool = entry.getValue().getPool(); Integer quantity = ent.getQuantity(); pool.getEntitlements().add(ent); ent.setPool(pool); ent.setConsumer(consumer); ent.setOwner(consumer.getOwner()); pool.setConsumed(pool.getConsumed() + quantity); if (consumer.isManifestDistributor()) { pool.setExported(pool.getExported() + quantity); } else if (consumer.isShare()) { pool.setShared(pool.getShared() + quantity); } consumer.addEntitlement(ent); consumer.setEntitlementCount(consumer.getEntitlementCount() + quantity); poolsToSave.add(pool); } entitlementCurator.saveAll(entitlementMap.values(), false, false); poolCurator.updateAll(poolsToSave, false, false); return true; }
Source:
<code>public Wizard<C, T> expectedValuesPerContainer(int count) { sanityCheck(count); if (count < ArrayContainer.DEFAULT_MAX_SIZE) { <START> return optimiseForArrays(); <END> } else if (count < 1 << 14) { return optimiseForBitmaps(); } else { return optimiseForRuns(); } }</code><technical_language>great if count affects array allocated in ArrayContainer supplier</technical_language>

Target:
public Wizard<C, T> expectedValuesPerContainer(int count) { sanityCheck(count); this.expectedContainerSize = count; if (count < ArrayContainer.DEFAULT_MAX_SIZE) { return optimiseForArrays(); } else if (count < 1 << 14) { return optimiseForBitmaps(); } else { return optimiseForRuns(); } }
Source:
<code>public boolean performOk() { ExclusionsAndInclusions config = rulesConfigurationPart.computeExclusionsAndInclusions(); PreferencesUtils.setExcludedRules(config.excluded()); PreferencesUtils.setIncludedRules(config.included()); <START> JobUtils.scheduleAnalysisOfOpenFiles((ISonarLintProject) null, TriggerType.EXCLUSION_CHANGE); <END> return true; }</code><technical_language>trigger type renamed RULE_CHANGE</technical_language>

Target:
public boolean performOk() { ExclusionsAndInclusions config = rulesConfigurationPart.computeExclusionsAndInclusions(); PreferencesUtils.setExcludedRules(config.excluded()); PreferencesUtils.setIncludedRules(config.included()); JobUtils.scheduleAnalysisOfOpenFiles((ISonarLintProject) null, TriggerType.STANDALONE_CONFIG_CHANGE); return true; }
Source:
<code><START> public TabletFile(Path metaPath) { <END> this(metaPath, Optional.empty()); }</code><technical_language>Recently, appreciate of static methods a private constructor, overloaded constructors. For example: java var tabletFile = TabletFile.fromMetaPath(metaPath); var tabletFile = TabletFile.fromMetadataEntry(strEntry); I recommend this overloaded constructors get clear parameter semantics communicated method name, vs. infer overloaded constructors. error prone parameter numbers mismatch, easier handle overloading parameter type (usually String) semantics</technical_language>

Target:
public TabletFile(Path metaPath) { this.metaPath = Objects.requireNonNull(metaPath); String errorMsg = "Missing or invalid part of tablet file metadata entry: " + metaPath; this.fileName = metaPath.getName(); MetadataSchema.TabletsSection.ServerColumnFamily.validateDirCol(fileName); Path tabletDirPath = Objects.requireNonNull(metaPath.getParent(), errorMsg); this.tabletDir = tabletDirPath.getName(); MetadataSchema.TabletsSection.ServerColumnFamily.validateDirCol(tabletDir); Path tableIdPath = Objects.requireNonNull(tabletDirPath.getParent(), errorMsg); this.tableId = TableId.of(tableIdPath.getName()); MetadataSchema.TabletsSection.ServerColumnFamily.validateDirCol(tableId.canonical()); Path tablePath = Objects.requireNonNull(tableIdPath.getParent(), errorMsg); String tpString = "/" + tablePath.getName(); Preconditions.checkArgument(tpString.equals(Constants.HDFS_TABLES_DIR), errorMsg); Path volumePath = Objects.requireNonNull(tablePath.getParent(), errorMsg); Preconditions.checkArgument(volumePath.toUri().getScheme() != null, errorMsg); this.volume = volumePath.toString(); this.normalizedPath = volume + Constants.HDFS_TABLES_DIR + "/" + tableId.canonical() + "/" + tabletDir + "/" + fileName; }
Source:
<code>protected void doLookUpdate() { updateLookFromFormula(); if (wait) { <START> BackgroundWaitHandler.addObserver(look, this); <END> } if (look != null && sprite != null && sprite.getLookDataList().contains(look)) { sprite.look.setLookData(look); setLookDone = true; } }</code><technical_language>this done check below? if observer added, setLookData() called</technical_language>

Target:
protected void doLookUpdate() { updateLookFromFormula(); if (look != null && sprite != null && sprite.getLookDataList().contains(look)) { if (wait) { BackgroundWaitHandler.addObserver(look, this); } sprite.look.setLookData(look); setLookDone = true; } }
Source:
<code>public void updateErrataDetailFormPanel(Erratum erratum) { <START> logger.info("updateErrataDetailFormPanel for " + erratum); END> errataTitle.setText(erratum.getTitle()); FormBuilder formBuilder = new FormBuilder(errataDetailFormPanel, 1, 10); formBuilder.setRelativeColumnWidth(0, 3); formBuilder.addFormItem(new FormItem(constants.errataId(), new Span(erratum.getId()), 0, 0)); formBuilder.addFormItem(new FormItem(constants.errataDateIssued(), new Span(erratum.getIssued().toString()), 1, 0)); formBuilder.addFormItem(new FormItem(constants.errataType(), new Span(erratum.getType().toString()), 2, 0)); formBuilder.addFormItem(new FormItem(constants.errataSeverity(), new Span(erratum.getSeverity() == null? "N/A" : erratum.getSeverity().toString()), 3, 0)); formBuilder.addFormItem(new FormItem(constants.description(), new Span(erratum.getDescription().toString()), 4, 0)); formBuilder.addFormItem(new FormItem(constants.solution(), new Span(erratum.getSolution()), 5, 0)); formBuilder.addFormItem(new FormItem(constants.summary(), new Span(erratum.getSummary()), 6, 0)); formBuilder.addFormItem(new FormItem(constants.errataPackages(), new Span(StringUtils.join(erratum.getPackages(), ", ")), 7, 0)); }</code><technical_language>debug/trace/remove</technical_language>

Target:
public void updateErrataDetailFormPanel(Erratum erratum) { errataTitle.setText(erratum.getTitle()); FormBuilder formBuilder = new FormBuilder(errataDetailFormPanel, 1, 10); formBuilder.setRelativeColumnWidth(0, 3); formBuilder.addFormItem(new FormItem(constants.errataId(), new Span(erratum.getId()), 0, 0)); formBuilder.addFormItem(new FormItem(constants.errataDateIssued(), new Span(erratum.getIssued().toString()), 1, 0)); formBuilder.addFormItem(new FormItem(constants.errataType(), new Span(erratum.getType().toString()), 2, 0)); formBuilder.addFormItem(new FormItem(constants.errataSeverity(), new Span(erratum.getSeverity() == null? "N/A" : erratum.getSeverity().toString()), 3, 0)); formBuilder.addFormItem(new FormItem(constants.description(), new Span(erratum.getDescription().toString()), 4, 0)); formBuilder.addFormItem(new FormItem(constants.solution(), new Span(erratum.getSolution()), 5, 0)); formBuilder.addFormItem(new FormItem(constants.summary(), new Span(erratum.getSummary()), 6, 0)); formBuilder.addFormItem(new FormItem(constants.errataPackages(), new Span(StringUtils.join(erratum.getPackages(), ", ")), 7, 0)); }
Source:
<code>public void onDisconnect(CloseConnectionReason closeConnectionReason, Connection connection) { log.info("onDisconnect closeConnectionReason={}, nodeAddressOpt={}", closeConnectionReason, connection.getPeersNodeAddressOptional()); closeHandler(connection); if (retryTimer == null) { retryTimer = UserThread.runAfter(() -> { log.trace("ConnectToMorePeersTimer called from onDisconnect code path"); stopRetryTimer(); requestWithAvailablePeers(); }, RETRY_DELAY_SEC); } <START> if (peerManager.isPeerBanned(closeConnectionReason, connection) && connection.getPeersNodeAddressOptional().isPresent()) seedNodeAddresses.remove(connection.getPeersNodeAddressOptional().get()); <END> }</code><technical_language>suggestion if (peerManager.isPeerBanned(closeConnectionReason, connection)) connection.getPeersNodeAddressOptional().ifPresent(seedNodeAddresses::remove);</technical_language>

Target:
public void onDisconnect(CloseConnectionReason closeConnectionReason, Connection connection) { log.info("onDisconnect closeConnectionReason={}, nodeAddressOpt={}", closeConnectionReason, connection.getPeersNodeAddressOptional()); closeHandler(connection); if (retryTimer == null) { retryTimer = UserThread.runAfter(() -> { log.trace("ConnectToMorePeersTimer called from onDisconnect code path"); stopRetryTimer(); requestWithAvailablePeers(); }, RETRY_DELAY_SEC); } if (peerManager.isPeerBanned(closeConnectionReason, connection)) { connection.getPeersNodeAddressOptional().ifPresent(seedNodeAddresses::remove); } }
Source:
<code><START> public BigDecimal convert(String value, Class<? extends BigDecimal> type) { <END> if (isNullOrEmpty(value)) { return null; } try { return new BigDecimal(value); } catch (NumberFormatException e) { throw new ConversionException(new I18nMessage("", "is_not_a_valid_number", value)); } }</code><technical_language>weird indent (and some others @Overrides throws)</technical_language>

Target:
public BigDecimal convert(String value, Class<? extends BigDecimal> type) { if (isNullOrEmpty(value)) { return null; } try { return new BigDecimal(value); } catch (NumberFormatException e) { throw new ConversionException(new ConversionMessage("is_not_a_valid_number", value)); } }
Source:
<code>private void checkIconNodeInvalidate(final SWTBotVSMEditor odesignEditor, SWTBotTree tree) { final SWTBotTreeItem treeItem = tree.getTreeItem(ODESIGN).getNode("Group").getNode("emptyName").getNode("diagTest").getNode("Default").getNode("Node").select(); RunnableWithResult<Boolean> runnable = new RunnableWithResult.Impl<Boolean>() { public void run() { treeItem.widget.getDisplay().syncExec(new Runnable() { public void run() { Image treeItemImageDisplay = treeItem.widget.getImage(); <START> CustomSiriusEditor treeEditor = (CustomSiriusEditor) odesignEditor.getReference().getEditor(false); <END> Image treeItemImageExpected = imageComposer.getImageOfEditPlugin(treeEditor.getAdapterFactory(), (EObject) treeItem.widget.getData()); setResult(ImageEquality.areEqualImages(treeItemImageExpected, treeItemImageDisplay)); } }); } }; treeItem.widget.getDisplay().syncExec(runnable); assertTrue("A red cross must appear on the image of the node mapping.", ((Boolean) runnable.getResult()).booleanValue()); }</code><technical_language>If need a AdapterFactory need cast CustomSiriusEditor, SiriusEditor is enough</technical_language>

Target:
private void checkIconNodeInvalidate(final SWTBotVSMEditor odesignEditor, SWTBotTree tree) { final SWTBotTreeItem treeItem = tree.getTreeItem(ODESIGN).getNode("Group").getNode("emptyName").getNode("diagTest").getNode("Default").getNode("Node").select(); RunnableWithResult<Boolean> runnable = new RunnableWithResult.Impl<Boolean>() { public void run() { treeItem.widget.getDisplay().syncExec(new Runnable() { public void run() { Image treeItemImageDisplay = treeItem.widget.getImage(); SiriusEditor treeEditor = (CustomSiriusEditor) odesignEditor.getReference().getEditor(false); ImageComposer imageComposer = new ImageComposer(); Image treeItemImageExpected = imageComposer.getImageOfEditPlugin(treeEditor.getAdapterFactory(), (EObject) treeItem.widget.getData()); setResult(ImageEquality.areEqualImages(treeItemImageExpected, treeItemImageDisplay)); } }); } }; treeItem.widget.getDisplay().syncExec(runnable); assertTrue("A red cross must appear on the image of the node mapping.", runnable.getResult().booleanValue()); }
Source:
<code>void reset() { LOG.info("Reset HelixTaskExecutor"); if (_messageQueueMonitor != null) { _messageQueueMonitor.reset(); } for (String msgType : _hdlrFtyRegistry.keySet()) { ExecutorService pool = _executorMap.remove(msgType); _monitor.removeExecutorMonitor(msgType); if (pool != null) { LOG.info("Reset exectuor for msgType: " + msgType + ", pool: " + pool); shutdownAndAwaitTermination(pool); } MsgHandlerFactoryRegistryItem item = _hdlrFtyRegistry.get(msgType); if (item.factory() != null) { item.factory().reset(); } } for (String msgType : _executorMap.keySet()) { <START> ExecutorService pool = _executorMap.remove(msgType); <END> LOG.info("Reset exectuor for msgType: " + msgType + ", pool: " + pool); shutdownAndAwaitTermination(pool); } StringBuilder sb = new StringBuilder(); for (String taskId : _taskMap.keySet()) { MessageTaskInfo info = _taskMap.get(taskId); sb.append("Task: " + taskId + " fails to terminate. Message: " + info._task.getMessage() + "\n"); } LOG.info(sb.toString()); _taskMap.clear(); _messageTaskMap.clear(); _knownMessageIds.clear(); _lastSessionSyncTime = null; }</code><technical_language>If pool is created in user logic passed in construct executor, executor shutdown here</technical_language>

Target:
void reset() { LOG.info("Reset HelixTaskExecutor"); if (_messageQueueMonitor != null) { _messageQueueMonitor.reset(); } for (String msgType : _hdlrFtyRegistry.keySet()) { ExecutorService pool = _executorMap.remove(msgType); _monitor.removeExecutorMonitor(msgType); if (pool != null) { LOG.info("Reset exectuor for msgType: " + msgType + ", pool: " + pool); shutdownAndAwaitTermination(pool); } MsgHandlerFactoryRegistryItem item = _hdlrFtyRegistry.get(msgType); if (item.factory() != null) { try { item.factory().reset(); } catch (Exception ex) { LOG.error("Failed to reset the factory of message type {}.", item.factory().toString(), msgType, ex); } } } StringBuilder sb = new StringBuilder(); for (String taskId : _taskMap.keySet()) { MessageTaskInfo info = _taskMap.get(taskId); sb.append( "Task: " + taskId + " fails to terminate. Message: " + info._task.getMessage() + "\n"); } LOG.info(sb.toString()); _taskMap.clear(); _messageTaskMap.clear(); _knownMessageIds.clear(); _lastSessionSyncTime = null; }
Source:
<code>public void initialize(Context context) { context.registerSyntaxNodeConsumer(Tree.Kind.FILE_INPUT, ctx -> { FileVisitor visitor = new FileVisitor(); ctx.syntaxNode().accept(visitor); if (visitor.numberOfLines > maximum) { <START> String message = "File \"{0}\" has {1} lines, which is greater than {2} authorized. Split it into smaller files."; <END> ctx.addFileIssue(MessageFormat.format(message, ctx.pythonFile().fileName(), visitor.numberOfLines, maximum)); } }); }</code><technical_language>This more sense defined constant instantiated in lambda call</technical_language>

Target:
public void initialize(Context context) { context.registerSyntaxNodeConsumer(Tree.Kind.FILE_INPUT, ctx -> { FileVisitor visitor = new FileVisitor(); ctx.syntaxNode().accept(visitor); if (visitor.numberOfLines > maximum) { ctx.addFileIssue(MessageFormat.format(MESSAGE, ctx.pythonFile().fileName(), visitor.numberOfLines, maximum)); } }); }
Source:
<code>private void addFilterCriteriaToQuery(Query query, List<VariantEntityRepositoryFilter> filters) { <START> if ((filters != null) && (filters.size() > 0)){ <END> List<Criteria> criteriaList = getFiltersCriteria(filters); for (Criteria criteria : criteriaList) { query.addCriteria(criteria); } } }</code><technical_language>need for level of brackets</technical_language>

Target:
private void addFilterCriteriaToQuery(Query query, List<VariantEntityRepositoryFilter> filters) { if (filters != null && filters.size() > 0){ List<Criteria> criteriaList = getFiltersCriteria(filters); for (Criteria criteria : criteriaList) { query.addCriteria(criteria); } } }
Source:
<code>default String getLabel() { <START> return getElement().getProperty(ElementConstants.LABEL_PROPERTY_NAME, ""); <END> }</code><technical_language>for delay. decision is returning null for default setLabel(null) done. Please change setter pass null of property ""</technical_language>

Target:
default String getLabel() { return getElement().getProperty(ElementConstants.LABEL_PROPERTY_NAME, null); }
Source:
<code>public QueryRunner<Result<SelectResultValue>> preMergeQueryDecoration(QueryRunner<Result<SelectResultValue>> runner) { <START> return new UnionQueryRunner<Result<SelectResultValue>>( <END> new IntervalChunkingQueryRunner<Result<SelectResultValue>>( runner, config.getChunkPeriod() ) ); }</code><technical_language>is common place (at broker level) add unioning query runner</technical_language>

Target:
public QueryRunner<Result<SelectResultValue>> preMergeQueryDecoration(QueryRunner<Result<SelectResultValue>> runner) { return new IntervalChunkingQueryRunner<Result<SelectResultValue>>( runner, config.getChunkPeriod() ); }
Source:
<code>public void rpmVersionTest() { assertEquals("2.3.235.0", new RpmVersion("rhev-agent-2.3.235-1.el6").getValue()); assertEquals("2.3.17.0", new RpmVersion("rhev-agent-2.3.17-1.el6").getValue()); assertEquals("2.133.4.5", new RpmVersion("glibc-devel-2.133.4.5-1.x86_64").getValue()); assertEquals("10.6.2.0", new RpmVersion("test-javadb-common-10.6.2-1.1.i386").getValue()); assertEquals("10.6.2.3", new RpmVersion("test-javadb-common-10.6.2.3.3-1.1.i386").getValue()); <START> assertEquals(0, new RpmVersion("").getValue().length()); <END> assertEquals(0, new RpmVersion(null).getValue().length()); }</code><technical_language>about: assertTrue(new RpmVersion("").getValue().isEmpty())</technical_language>

Target:
public void rpmVersionTest() { assertEquals("2.3.235.0", new RpmVersion("rhev-agent-2.3.235-1.el6").getValue()); assertEquals("2.3.17.0", new RpmVersion("rhev-agent-2.3.17-1.el6").getValue()); assertEquals("2.133.4.5", new RpmVersion("glibc-devel-2.133.4.5-1.x86_64").getValue()); assertEquals("10.6.2.0", new RpmVersion("test-javadb-common-10.6.2-1.1.i386").getValue()); assertEquals("10.6.2.3", new RpmVersion("test-javadb-common-10.6.2.3.3-1.1.i386").getValue()); assertTrue(new RpmVersion("").getValue().isEmpty()); assertTrue(new RpmVersion(null).getValue().isEmpty()); }
Source:
<code>private Object decodeSrt(Channel channel, SocketAddress remoteAddress, String sentence) { Parser parser = new Parser(PATTERN_SRT, sentence); if (!parser.matches()) { return null; } Position position = new Position(); position.setProtocol(getProtocolName()); DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, parser.next()); if (deviceSession == null) { return null; } position.setDeviceId(deviceSession.getDeviceId()); position.setLatitude(parser.nextDouble()); position.setLongitude(parser.nextDouble()); <START> DateBuilder dateBuilder = new DateBuilder(TimeZone.getTimeZone("Asia/Calcutta")) <END> .setTime(parser.nextInt(), parser.nextInt(), parser.nextInt()) .setDateReverse(parser.nextInt(), parser.nextInt(), parser.nextInt()); position.setTime(dateBuilder.getDate()); position.set(Position.KEY_VERSION, parser.next()); parser.next(); return position; }</code><technical_language>this timezone</technical_language>

Target:
private Object decodeSrt(Channel channel, SocketAddress remoteAddress, String sentence) { Parser parser = new Parser(PATTERN_SRT, sentence); if (!parser.matches()) { return null; } Position position = new Position(); position.setProtocol(getProtocolName()); DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, parser.next()); if (deviceSession == null) { return null; } position.setDeviceId(deviceSession.getDeviceId()); position.setLatitude(parser.nextDouble()); position.setLongitude(parser.nextDouble()); DateBuilder dateBuilder = new DateBuilder(timeZone) .setTime(parser.nextInt(), parser.nextInt(), parser.nextInt()) .setDateReverse(parser.nextInt(), parser.nextInt(), parser.nextInt()); position.setTime(dateBuilder.getDate()); position.set(Position.KEY_VERSION, parser.next()); parser.next(); return position; }