auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public AlleleFractionInitializer(final AlleleFractionData data) { state = new AlleleFractionState(INITIAL_MEAN_BIAS, INITIAL_BIAS_VARIANCE, INITIAL_OUTLIER_PROBABILITY, initialMinorFractions(data)); double previousIterationLogLikelihood; double nextIterationLogLikelihood = Double.NEGATIVE_INFINITY; int iteration = 1; <START> System.out.format("Initializing allele fraction model. Iterating until log likelihood converges to within %.3f.%n", <END> LOG_LIKELIHOOD_CONVERGENCE_THRESHOLD); do { previousIterationLogLikelihood = nextIterationLogLikelihood; state = new AlleleFractionState(estimateMeanBias(data), estimateBiasVariance(data), estimateOutlierProbability(data), estimateMinorFractions(data)); nextIterationLogLikelihood = AlleleFractionModeller.logLikelihood(state, data); System.out.format("Iteration %d, model log likelihood = %.3f.%n", iteration, nextIterationLogLikelihood); iteration++; } while (nextIterationLogLikelihood - previousIterationLogLikelihood > LOG_LIKELIHOOD_CONVERGENCE_THRESHOLD); }</code><technical_language>logger instead of system out</technical_language>

Target:
public AlleleFractionInitializer(final AlleleFractionData data) { state = new AlleleFractionState(INITIAL_MEAN_BIAS, INITIAL_BIAS_VARIANCE, INITIAL_OUTLIER_PROBABILITY, initialMinorFractions(data)); double previousIterationLogLikelihood; double nextIterationLogLikelihood = Double.NEGATIVE_INFINITY; int iteration = 1; logger.info(String.format("Initializing allele fraction model. Iterating until log likelihood converges to within %.3f.%n", LOG_LIKELIHOOD_CONVERGENCE_THRESHOLD)); do { previousIterationLogLikelihood = nextIterationLogLikelihood; state = new AlleleFractionState(estimateMeanBias(data), estimateBiasVariance(data), estimateOutlierProbability(data), estimateMinorFractions(data)); nextIterationLogLikelihood = AlleleFractionModeller.logLikelihood(state, data); logger.info(String.format("Iteration %d, model log likelihood = %.3f.%n", iteration, nextIterationLogLikelihood)); iteration++; } while (iteration < MAX_ITERATIONS && nextIterationLogLikelihood - previousIterationLogLikelihood > LOG_LIKELIHOOD_CONVERGENCE_THRESHOLD); }
Source:
<code>public boolean checkIndex(DBBroker broker) { Connection conn = null; try { conn = acquireConnection(); return checkIndex(broker, conn); <START> } catch (SQLException | SpatialIndexException e) { <END> LOG.error(e); return false; } finally { try { if (conn != null) releaseConnection(conn); } catch (SQLException e) { LOG.error(e); return false; } } }</code><technical_language>final</technical_language>

Target:
public boolean checkIndex(DBBroker broker) { Connection conn = null; try { conn = acquireConnection(); return checkIndex(broker, conn); } catch (final SQLException | SpatialIndexException e) { LOG.error(e); return false; } finally { try { if (conn != null) releaseConnection(conn); } catch (SQLException e) { LOG.error(e); return false; } } }
Source:
<code>protected List<ResourceGroupSelector> buildSelectors(ManagerSpec managerSpec) { ImmutableList.Builder<ResourceGroupSelector> selectors = ImmutableList.builder(); for (SelectorSpec spec : managerSpec.getSelectors()) { validateSelectors(managerSpec.getRootGroups(), spec); selectors.add(new StaticSelector( spec.getUserRegex(), spec.getSourceRegex(), spec.getClientTags(), <START> spec.getResourceEstimatesRange(), <END> spec.getQueryType(), spec.getGroup())); } return selectors.build(); }</code><technical_language>Hm... call this resource range? range sort of self-explanatory.</technical_language>

Target:
protected List<ResourceGroupSelector> buildSelectors(ManagerSpec managerSpec) { ImmutableList.Builder<ResourceGroupSelector> selectors = ImmutableList.builder(); for (SelectorSpec spec : managerSpec.getSelectors()) { validateSelectors(managerSpec.getRootGroups(), spec); selectors.add(new StaticSelector( spec.getUserRegex(), spec.getSourceRegex(), spec.getClientTags(), spec.getResourceEstimate(), spec.getQueryType(), spec.getGroup())); } return selectors.build(); }
Source:
<code>public String displaySkinCssHeader(RenderRequest request, RenderResponse response, Model model) throws IOException { ENDER_HEADERS phase may be called before or at the same time as the RENDER_MARKUP. The spec is ENDER_HEADERS phase is included before ENDER_MARKUP phase). uPortal inserts the HTML markup returned from RENDER_HEADERS execution into the HEAD if (PortletRequest.RENDER_HEADERS.equals(request.getAttribute(PortletRequest.RENDER_PART))) { PortletPreferences prefs = request.getPreferences(); <START> Boolean enabled = Boolean.valueOf(prefs.getValue(PREF_DYNAMIC, "")); <END> String defaultSkinName = prefs.getValue(PREF_SKIN_NAME, DEFAULT_SKIN_NAME); String cssUrl = enabled ? calculateDynamicSkinUrlPathToUse(request, defaultSkinName) : calculateCssLocationInWebapp(defaultSkinName, ""); model.addAttribute("skinCssUrl", cssUrl); return "jsp/DynamicRespondrSkin/skinHeader"; } else { ENDER_MARKUP return null; } }</code><technical_language>"false" default preference more readable</technical_language>

Target:
public String displaySkinCssHeader(RenderRequest request, RenderResponse response, Model model) throws IOException { ENDER_HEADERS phase may be called before or at the same time as the RENDER_MARKUP. The spec is ENDER_HEADERS phase is included before ENDER_MARKUP phase). uPortal inserts the HTML markup returned from RENDER_HEADERS execution into the HEAD if (PortletRequest.RENDER_HEADERS.equals(request.getAttribute(PortletRequest.RENDER_PART))) { PortletPreferences prefs = request.getPreferences(); Boolean enabled = Boolean.valueOf(prefs.getValue(PREF_DYNAMIC, "false")); String defaultSkinName = prefs.getValue(PREF_SKIN_NAME, DEFAULT_SKIN_NAME); String cssUrl = enabled ? calculateDynamicSkinUrlPathToUse(request, defaultSkinName) : calculateCssLocationInWebapp(defaultSkinName, ""); model.addAttribute("skinCssUrl", cssUrl); return "jsp/DynamicRespondrSkin/skinHeader"; } else { ENDER_MARKUP return "jsp/DynamicRespondrSkin/skinBody"; } }
Source:
<code>public Block parseBlock(RawBlock rawBlock) throws BlockHashNotConnectingException, BlockHeightNotConnectingException { int blockHeight = rawBlock.getHeight(); log.trace("Parse block at height={} ", blockHeight); validateIfBlockIsConnecting(rawBlock); daoStateService.onNewBlockHeight(blockHeight); final Block block = new Block(blockHeight, rawBlock.getTime(), rawBlock.getHash(), rawBlock.getPreviousBlockHash()); if (isBlockAlreadyAdded(rawBlock)) { log.warn("Block was already added."); DevEnv.logErrorAndThrowIfDevMode("Block was already added. rawBlock=" + rawBlock); } else { daoStateService.onNewBlockWithEmptyTxs(block); } long startTs = System.currentTimeMillis(); rawBlock.getRawTxs().forEach(rawTx -> txParser.findTx(rawTx, genesisTxId, genesisBlockHeight, genesisTotalSupply) <START> .ifPresent(daoStateService::onNewTxForLastBlock)); <END> log.info("Parsing transactions at block height took ms", rawBlock.getRawTxs().size(), blockHeight, System.currentTimeMillis() - startTs); daoStateService.onParseBlockComplete(block); return block; }</code><technical_language>This a roundabout initialize Block object is error-prone. easier reason if BlockParser is responsible for initializing block txs DaoStateService call in breaks encapsulation</technical_language>

Target:
public Block parseBlock(RawBlock rawBlock) throws BlockHashNotConnectingException, BlockHeightNotConnectingException { int blockHeight = rawBlock.getHeight(); log.trace("Parse block at height={} ", blockHeight); validateIfBlockIsConnecting(rawBlock); daoStateService.onNewBlockHeight(blockHeight); final Block block = new Block(blockHeight, rawBlock.getTime(), rawBlock.getHash(), rawBlock.getPreviousBlockHash()); if (isBlockAlreadyAdded(rawBlock)) { log.warn("Block was already added."); DevEnv.logErrorAndThrowIfDevMode("Block was already added. rawBlock=" + rawBlock); } else { daoStateService.onNewBlockWithEmptyTxs(block); } long startTs = System.currentTimeMillis(); rawBlock.getRawTxs().forEach(rawTx -> txParser.findTx(rawTx, genesisTxId, genesisBlockHeight, genesisTotalSupply) .ifPresent(tx -> daoStateService.onNewTxForLastBlock(block, tx))); log.info("Parsing transactions at block height took ms", rawBlock.getRawTxs().size(), blockHeight, System.currentTimeMillis() - startTs); daoStateService.onParseBlockComplete(block); return block; }
Source:
<code>private static TypedSource[] createTypedSourcesForImportContainer(SourceTuple tuple, IImportContainer container) throws JavaModelException, CoreException { IJavaElement[] imports= container.getChildren(); List<TypedSource> result= new ArrayList<>(imports.length); for (IJavaElement <START> i : <END> imports) { result.addAll(Arrays.asList(createTypedSources(i, tuple))); } return result.toArray(new TypedSource[result.size()]); }</code><technical_language>rename element importedElement</technical_language>

Target:
private static TypedSource[] createTypedSourcesForImportContainer(SourceTuple tuple, IImportContainer container) throws JavaModelException, CoreException { IJavaElement[] imports= container.getChildren(); List<TypedSource> result= new ArrayList<>(imports.length); for (IJavaElement importedElement : imports) { result.addAll(Arrays.asList(createTypedSources(importedElement, tuple))); } return result.toArray(new TypedSource[result.size()]); }
Source:
<code>public boolean applicableInState(State state, String[] params) { if (!super.applicableInState(state, params)) { return false; } ObjectInstance agent = state.getObject(params[0]); ObjectInstance container = state.getObject(params[1]); if (ContainerFactory.isEmptyContainer(container)) { return false; } <START> if (ContainerFactory.isReceivingContainer(container)) { <END> return false; } if (ContainerFactory.isMixingContainer(container)) { return false; } if (ContainerFactory.getContentNames(container).size() != 1) { return false; } Set<String> contents = ContainerFactory.getContentNames(container); for (String ingredient : contents) { ObjectInstance ingredientObject = state.getObject(ingredient); if (IngredientFactory.isPeeledIngredient(ingredientObject)) { return false; } } return true; }</code><technical_language>peel in a receiving container</technical_language>

Target:
public boolean applicableInState(State state, String[] params) { if (!super.applicableInState(state, params)) { return false; } ObjectInstance container = state.getObject(params[1]); if (ContainerFactory.isEmptyContainer(container)) { return false; } if (ContainerFactory.getContentNames(container).size() != 1) { return false; } Set<String> contents = ContainerFactory.getContentNames(container); for (String ingredient : contents) { ObjectInstance ingredientObject = state.getObject(ingredient); if (IngredientFactory.isPeeledIngredient(ingredientObject)) { return false; } } return true; }
Source:
<code>private void handleVariantsReceived(JSONArray variants) { final SharedPreferences preferences = getSharedPreferences(); final SharedPreferences.Editor editor = preferences.edit(); <START> if(variants != null) { <END> editor.putString(SHARED_PREF_CHANGES_KEY, variants.toString()); } else { editor.remove(SHARED_PREF_CHANGES_KEY); } editor.apply(); initializeChanges(); }</code><technical_language>I a fan of null a meaningful change behavior/flow of product. For instance, variants empty JSONArray if variants. SHARED_PREF_CHANGES_KEY in device, empty variants</technical_language>

Target:
private void handleVariantsReceived(JSONArray variants) { final SharedPreferences preferences = getSharedPreferences(); final SharedPreferences.Editor editor = preferences.edit(); if(variants.length() > 0) { editor.putString(SHARED_PREF_CHANGES_KEY, variants.toString()); } else { editor.remove(SHARED_PREF_CHANGES_KEY); } editor.apply(); initializeChanges(); }
Source:
<code>public void shutdown(Optional<Duration> maximumCompletionWait) throws InterruptedException { stop = true; taskServer.interruptLocalWait(); synchronized (shutdownLock) { executor.shutdown(); shutdownLock.notifyAll(); } if (maximumCompletionWait.isPresent()) { long seconds = maximumCompletionWait.get().getSeconds(); if (!executor.awaitTermination(seconds, TimeUnit.SECONDS)) { logger.warn("Some tasks didn't finish within maximum wait time ({} seconds)", seconds); } } else { <START> while (!executor.awaitTermination(24, TimeUnit.HOURS)) <END> ; } }</code><technical_language>log agent is terminating</technical_language>

Target:
public void shutdown(Optional<Duration> maximumCompletionWait) throws InterruptedException { stop = true; taskServer.interruptLocalWait(); int activeCount; synchronized (newTaskLock) { executor.shutdown(); activeCount = executor.getActiveCount(); newTaskLock.notifyAll(); } if (activeCount > 0) { logger.info("Waiting for completion of running tasks...", activeCount); } if (maximumCompletionWait.isPresent()) { long seconds = maximumCompletionWait.get().getSeconds(); if (!executor.awaitTermination(seconds, TimeUnit.SECONDS)) { logger.warn("Some tasks didn't finish within maximum wait time ({} seconds)", seconds); } } else { while (!executor.awaitTermination(24, TimeUnit.HOURS)) ; } }
Source:
<code>private TaskRepository createRepository(Attributes attributes) { String kind = org.eclipse.mylyn.internal.commons.core.XmlStringConverter.convertXmlToString(attributes.getValue(IRepositoryConstants.PROPERTY_CONNECTOR_KIND)); String url = org.eclipse.mylyn.internal.commons.core.XmlStringConverter.convertXmlToString(attributes.getValue(IRepositoryConstants.PROPERTY_URL)); if (kind != null && kind.length() > 0 && url != null && url.length() > 0) { return new TaskRepository(kind, url); } <START> return null; <END> }</code><technical_language>ah correct, this end skipping serialized repository if URL kind is missing. I missed a null check</technical_language>

Target:
private TaskRepository createRepository(Attributes attributes) { String kind = attributes.getValue(IRepositoryConstants.PROPERTY_CONNECTOR_KIND); String url = attributes.getValue(IRepositoryConstants.PROPERTY_URL); if (kind != null && kind.length() > 0 && url != null && url.length() > 0) { return new TaskRepository(kind, url); } return null; }
Source:
<code>protected void executeCommand() { GlusterVolumeEntity volume = getDbFacade().getGlusterVolumeDao().getById(snapshot.getVolumeId()); VDSReturnValue retVal = runVdsCommand(VDSCommandType.CreateGlusterVolumeSnapshot, new GlusterVolumeCreateSnapshotVDSParameters(upServer.getId(), volume.getName(), snapshot.getSnapshotName(), snapshot.getDescription(), force)); setSucceeded(retVal.getSucceeded()); if (!getSucceeded()) { handleVdsError(AuditLogType.GLUSTER_VOLUME_SNAPSHOT_CREATE_FAILED, retVal.getVdsError().getMessage()); } else { <START> GlusterVolumeSnapshotEntity createdSnapshot = (GlusterVolumeSnapshotEntity)(retVal.getReturnValue()); <END> createdSnapshot.setClusterId(volume.getClusterId()); createdSnapshot.setVolumeId(volume.getId()); createdSnapshot.setDescription(snapshot.getDescription()); createdSnapshot.setSnapshotName(snapshot.getSnapshotName()); createdSnapshot.setCreatedAt(new Date()); createdSnapshot.setStatus(GlusterSnapshotStatus.ACTIVATED); getDbFacade().getGlusterVolumeSnapshotDao().save(createdSnapshot); } addCustomValue(GlusterConstants.VOLUME_SNAPSHOT_NAME, getParameters().getSnapshot().getSnapshotName()); }</code><technical_language>do snapshot.setId() return (which return Guid) save</technical_language>

Target:
protected void executeCommand() { VDSReturnValue retVal = runVdsCommand(VDSCommandType.CreateGlusterVolumeSnapshot, new GlusterVolumeCreateSnapshotVDSParameters(upServer.getId(), volume.getName(), snapshot.getSnapshotName(), snapshot.getDescription(), force)); setSucceeded(retVal.getSucceeded()); if (!getSucceeded()) { handleVdsError(AuditLogType.GLUSTER_VOLUME_SNAPSHOT_CREATE_FAILED, retVal.getVdsError().getMessage()); } else { GlusterVolumeSnapshotEntity createdSnapshot = getParameters().getSnapshot(); createdSnapshot.setSnapshotId(((GlusterVolumeSnapshotEntity) retVal.getReturnValue()).getSnapshotId()); createdSnapshot.setCreatedAt(new Date()); createdSnapshot.setStatus(GlusterSnapshotStatus.STARTED); getDbFacade().getGlusterVolumeSnapshotDao().save(createdSnapshot); } }
Source:
<code>public ActiveListItem deleteActiveListItem(ActiveListItem item) throws DAOException { sessionFactory.getCurrentSession().delete(item); <START> return null; <END> }</code><technical_language>reason return null. this a void</technical_language>

Target:
public void deleteActiveListItem(ActiveListItem item) throws DAOException { sessionFactory.getCurrentSession().delete(item); }
Source:
<code>public void init(ConfigurationContext configurationContext, TransportOutDescription transportOutDescription) { <START> LOG.info("init"); <END> HttpWsConnectorFactory httpWsConnectorFactory = new DefaultHttpWsConnectorFactory(); SenderConfiguration senderConfiguration = new SenderConfiguration(); ConnectionManager connectionManager = new ConnectionManager(senderConfiguration.getPoolConfiguration()); clientConnector = httpWsConnectorFactory .createHttpClientConnector(new HashMap<>(), senderConfiguration, connectionManager); workerPool = WorkerPoolFactory.getWorkerPool( BridgeConstants.DEFAULT_WORKER_POOL_SIZE_CORE, BridgeConstants.DEFAULT_WORKER_POOL_SIZE_MAX, BridgeConstants.DEFAULT_WORKER_THREAD_KEEPALIVE_SEC, BridgeConstants.DEFAULT_WORKER_POOL_QUEUE_LENGTH, BridgeConstants.HTTP_WORKER_THREAD_GROUP_NAME, BridgeConstants.HTTP_WORKER_THREAD_ID); }</code><technical_language>Add a meaningful log statement</technical_language>

Target:
public void init(ConfigurationContext configurationContext, TransportOutDescription transportOutDescription) { LOG.info("Initializing AxisToClientConnectorBridge"); HttpWsConnectorFactory httpWsConnectorFactory = new DefaultHttpWsConnectorFactory(); SenderConfiguration senderConfiguration = new SenderConfiguration(); ConnectionManager connectionManager = new ConnectionManager(senderConfiguration.getPoolConfiguration()); clientConnector = httpWsConnectorFactory .createHttpClientConnector(new HashMap<>(), senderConfiguration, connectionManager); workerPool = WorkerPoolFactory.getWorkerPool( BridgeConstants.DEFAULT_WORKER_POOL_SIZE_CORE, BridgeConstants.DEFAULT_WORKER_POOL_SIZE_MAX, BridgeConstants.DEFAULT_WORKER_THREAD_KEEPALIVE_SEC, BridgeConstants.DEFAULT_WORKER_POOL_QUEUE_LENGTH, BridgeConstants.HTTP_WORKER_THREAD_GROUP_NAME, BridgeConstants.HTTP_WORKER_THREAD_ID); }
Source:
<code>public void testLongFloorDivMod() { testFloorDivModL(123L, 456L); testFloorDivModL(456L, 123L); testFloorDivModL(369L, 123L); testFloorDivModL(1L, 0L); testFloorDivModL(Long.MAX_VALUE, 1L); testFloorDivModL(Long.MAX_VALUE, -1L); testFloorDivModL(Long.MIN_VALUE, <START> -1L); <END> testFloorDivModL(Long.MIN_VALUE, -1L); }</code><technical_language>1</technical_language>

Target:
public void testLongFloorDivMod() { testFloorDivModL(123L, 456L); testFloorDivModL(456L, 123L); testFloorDivModL(369L, 123L); testFloorDivModL(1L, 0L); testFloorDivModL(Long.MAX_VALUE, 1L); testFloorDivModL(Long.MAX_VALUE, -1L); testFloorDivModL(Long.MIN_VALUE, 1L); testFloorDivModL(Long.MIN_VALUE, -1L); }
Source:
<code>protected void cloneRepo(File destinationRepo, RepoRemoteBranchesPage remoteBranches) throws Exception { remoteBranches.assertRemoteBranches(SampleTestRepository.FIX, Constants.MASTER); remoteBranches.selectBranches(SampleTestRepository.FIX, Constants.MASTER); WorkingCopyPage workingCopy = remoteBranches.nextToWorkingCopy(); workingCopy.setDirectory(destinationRepo.toString()); workingCopy.assertDirectory(destinationRepo.toString()); workingCopy.assertBranch(Constants.MASTER); workingCopy.assertRemoteName(Constants.DEFAULT_REMOTE_NAME); workingCopy.waitForCreate(); <START> Repository repository = new RepositoryBuilder().setGitDir( <END> new File(destinationRepo, Constants.DOT_GIT)).build(); assertNotNull(repository.resolve("origin/master")); assertEquals(repository.resolve("master"), repository .resolve("origin/master")); assertNotNull(repository.resolve( Constants.R_TAGS + SampleTestRepository.v1_0_name).name()); int refs = repository.getAllRefs().size(); assertTrue(refs >= 4); assertTrue(new File(destinationRepo, SampleTestRepository.A_txt_name) .exists()); DirCacheEntry fileEntry = null; DirCache dc = repository.lockDirCache(); fileEntry = dc.getEntry(SampleTestRepository.A_txt_name); dc.unlock(); assertNotNull(fileEntry); assertEquals(0, ResourcesPlugin.getWorkspace().getRoot().getProjects().length); }</code><technical_language>FileRepositoryBuilder.create</technical_language>

Target:
protected void cloneRepo(File destinationRepo, RepoRemoteBranchesPage remoteBranches) throws Exception { remoteBranches.assertRemoteBranches(SampleTestRepository.FIX, Constants.MASTER); remoteBranches.selectBranches(SampleTestRepository.FIX, Constants.MASTER); WorkingCopyPage workingCopy = remoteBranches.nextToWorkingCopy(); workingCopy.setDirectory(destinationRepo.toString()); workingCopy.assertDirectory(destinationRepo.toString()); workingCopy.assertBranch(Constants.MASTER); workingCopy.assertRemoteName(Constants.DEFAULT_REMOTE_NAME); workingCopy.waitForCreate(); Repository repository = FileRepositoryBuilder.create(new File( destinationRepo, Constants.DOT_GIT)); assertNotNull(repository.resolve("origin/master")); assertEquals(repository.resolve("master"), repository .resolve("origin/master")); assertNotNull(repository.resolve( Constants.R_TAGS + SampleTestRepository.v1_0_name).name()); int refs = repository.getAllRefs().size(); assertTrue(refs >= 4); assertTrue(new File(destinationRepo, SampleTestRepository.A_txt_name) .exists()); DirCacheEntry fileEntry = null; DirCache dc = repository.lockDirCache(); fileEntry = dc.getEntry(SampleTestRepository.A_txt_name); dc.unlock(); assertNotNull(fileEntry); assertEquals(0, ResourcesPlugin.getWorkspace().getRoot().getProjects().length); }
Source:
<code><START> private <END> boolean checkCondtionalExpression(Expression expression) { if(getExpressionWithoutParenthezis(expression).getNodeType() == ASTNode.METHOD_INVOCATION) { return true; } return false; }</code><technical_language>'static' added, rely instance of class</technical_language>

Target:
private static boolean checkCondtionalExpression(Expression expression) { int nodeType= getExpressionWithoutParenthezis(expression).getNodeType(); if (nodeType == ASTNode.METHOD_INVOCATION || nodeType == ASTNode.POSTFIX_EXPRESSION || nodeType == ASTNode.PREFIX_EXPRESSION || nodeType == ASTNode.ASSIGNMENT) { return true; } return false; }
Source:
<code>public static void AdjustElevationForForwardMovement(MovePath source) { <START> if (!(source.getEntity().getMovementMode() == EntityMovementMode.VTOL)) { <END> return; } Coords destinationCoords = source.getFinalCoords().translated(source.getFinalFacing()); IHex destHex = source.getGame().getBoard().getHex(destinationCoords); if (destHex == null) { return; } int entityElevation = source.getFinalElevation(); boolean canGoUp = source.getEntity().canGoUp(entityElevation, source.getFinalCoords()); if (!canGoUp) { return; } IHex srcHex = source.getGame().getBoard().getHex(source.getFinalCoords()); int absHeight = srcHex.getLevel() + entityElevation; int destElevation = absHeight - destHex.getLevel(); int safeElevation = destHex.maxTerrainFeatureElevation(false); while (destElevation <= safeElevation) { boolean noLanding = (destElevation >= 1); if (destHex.containsTerrain(Terrains.BLDG_ELEV)) { noLanding &= destElevation > (destHex.terrainLevel(Terrains.BLDG_ELEV) - destHex.depth()); } if (destHex.containsTerrain(Terrains.BRIDGE_ELEV)) { noLanding &= destElevation != destHex.terrainLevel(Terrains.BRIDGE_ELEV); } if (source.getEntity().isElevationValid(destElevation, destHex) && noLanding) { return; } source.addStep(MoveStepType.UP); if(!source.isMoveLegal()) { source.removeLastStep(); return; } destElevation++; } }</code><technical_language>suggestion if (source.getEntity().getMovementMode() != EntityMovementMode.VTOL) {</technical_language>

Target:
public static void AdjustElevationForForwardMovement(MovePath source) { if (source.getEntity().getMovementMode() != EntityMovementMode.VTOL) { return; } Coords destinationCoords = source.getFinalCoords().translated(source.getFinalFacing()); IHex destHex = source.getGame().getBoard().getHex(destinationCoords); if (destHex == null) { return; } int entityElevation = source.getFinalElevation(); boolean canGoUp = source.getEntity().canGoUp(entityElevation, source.getFinalCoords()); if (!canGoUp) { return; } IHex srcHex = source.getGame().getBoard().getHex(source.getFinalCoords()); int absHeight = srcHex.getLevel() + entityElevation; int destElevation = absHeight - destHex.getLevel(); int safeElevation = destHex.maxTerrainFeatureElevation(false); while (destElevation <= safeElevation) { boolean noLanding = (destElevation >= 1); if (destHex.containsTerrain(Terrains.BLDG_ELEV)) { noLanding &= destElevation > (destHex.terrainLevel(Terrains.BLDG_ELEV) - destHex.depth()); } if (destHex.containsTerrain(Terrains.BRIDGE_ELEV)) { noLanding &= destElevation != destHex.terrainLevel(Terrains.BRIDGE_ELEV); } if (source.getEntity().isElevationValid(destElevation, destHex) && noLanding) { return; } source.addStep(MoveStepType.UP); if(!source.isMoveLegal()) { source.removeLastStep(); return; } destElevation++; } }
Source:
<code>public void write(byte[] buffer, int offset, int byteCount) throws IOException { Arrays.checkOffsetAndCount(buffer.length, offset, byteCount); if (currentEntry == null) { throw new ZipException("No active entry"); } final long totalBytes = crc.tbytes + byteCount; if ((totalBytes > Zip64.MAX_ZIP_ENTRY_AND_ARCHIVE_SIZE) && !currentEntryNeedsZip64) { throw new IOException("Zip entry size (" + totalBytes + <START> " bytes) cannot be represented in the zip format (needs Zip64)"); <END> } if (currentEntry.getMethod() == STORED) { out.write(buffer, offset, byteCount); } else { super.write(buffer, offset, byteCount); } crc.update(buffer, offset, byteCount); }</code><technical_language>public API for that, explicitly mention fix is supply size of time</technical_language>

Target:
public void write(byte[] buffer, int offset, int byteCount) throws IOException { Arrays.checkOffsetAndCount(buffer.length, offset, byteCount); if (currentEntry == null) { throw new ZipException("No active entry"); } final long totalBytes = crc.tbytes + byteCount; if ((totalBytes > Zip64.MAX_ZIP_ENTRY_AND_ARCHIVE_SIZE) && !currentEntryNeedsZip64) { throw new IOException("Zip entry size (" + totalBytes + " bytes) cannot be represented in the zip format (needs Zip64)." + " Set the entry length using ZipEntry#setLength to use Zip64 where necessary."); } if (currentEntry.getMethod() == STORED) { out.write(buffer, offset, byteCount); } else { super.write(buffer, offset, byteCount); } crc.update(buffer, offset, byteCount); }
Source:
<code>public static long geReleasedOnTimeForOngoingAppDownload() { if (CommCareApplication.instance().getCurrentApp() == null) { return 0; } return CommCareApplication.instance().getCurrentApp().getAppPreferences() <START> .getLong(RELEASED_ON_TIME_FOR_ONGOING_APP_DOWNLOAD, 0); <END> }</code><technical_language>I need a "sanity check" for this date/time. set, is set pretty if, say, phone date set wrong user downloaded update (say, future), failed sync set phone's time correct time, this constantly block updating. phone's date change, I do sanity checking is *read* is *written*, sense do here</technical_language>

Target:
public static long geReleasedOnTimeForOngoingAppDownload() { if (CommCareApplication.instance().getCurrentApp() == null) { return 0; } long releasedOnTime = CommCareApplication.instance().getCurrentApp().getAppPreferences() .getLong(RELEASED_ON_TIME_FOR_ONGOING_APP_DOWNLOAD, 0); releasedOnTime = Math.min(releasedOnTime, new Date().getTime()); return releasedOnTime; }
Source:
<code>default List<Pattern> getExcludedResponseHeaderPatterns() { <START> return emptyList(); <END> }</code><technical_language>Generally qualify making static import; this coming (ie. implement for some reason?) I tend static imports for constants in Unit tests obvious is provided custom code (ie. assertXXX(..), mock(..), etc.) suggestion return Collections.emptyList();</technical_language>

Target:
default List<Pattern> getExcludedResponseHeaderPatterns() { return Collections.emptyList(); }
Source:
<code>private List<WebElement> getUnreadNotificationsForTitle(String title) { List<WebElement> notifications = new ArrayList<WebElement>(); for (int i = 0; i < this.notificationsList.size(); i++) { WebElement n = this.notificationsList.get(i); WebElement nTitle = n.findElement(By.cssSelector(".notification-message h4")); String text = nTitle.getText(); <START> if (n != null && title.equals(nTitle.getText())) { <END> notifications.add(n); } } return notifications; }</code><technical_language>this line "text" var above? Also, if nTitle.getText() empty String null, flip left right of equals method avoid NullPointerException</technical_language>

Target:
private List<WebElement> getUnreadNotificationsForTitle(String title) { List<WebElement> notifications = new ArrayList<WebElement>(); for (int i = 0; i < this.notificationsList.size(); i++) { WebElement n = this.notificationsList.get(i); WebElement nTitle = n.findElement(By.cssSelector(".notification-message h4")); String text = nTitle.getText(); if (n != null && text.equals(title)) { notifications.add(n); } } return notifications; }
Source:
<code>public List<P4Head> getHeads(@NonNull TaskListener listener) throws Exception { List<String> paths = getIncludePaths(); HashSet<P4Head> list = new HashSet<P4Head>(); <START> ConnectionHelper p4 = new ConnectionHelper(credential, listener); <END> try { List<IFileSpec> specs = p4.getDirs(paths); for (IFileSpec s : specs) { String branch = s.getOriginalPathString(); Path depotPath = Paths.get(branch); String name = depotPath.getFileName().toString(); P4Head head = new P4Head(name, branch, false); list.add(head); } } finally { p4.disconnect(); } return new ArrayList<>(list); }</code><technical_language>consider making this class Closeable try resources</technical_language>

Target:
public List<P4Head> getHeads(@NonNull TaskListener listener) throws Exception { List<String> paths = getIncludePaths(); HashSet<P4Head> list = new HashSet<P4Head>(); ConnectionHelper p4 = new ConnectionHelper(credential, listener); List<IFileSpec> specs = p4.getDirs(paths); for (IFileSpec s : specs) { String branch = s.getOriginalPathString(); Path depotPath = Paths.get(branch); if (depotPath == null) { continue; } Path file = depotPath.getFileName(); if (file == null) { continue; } P4Head head = new P4Head(file.toString(), branch, false); list.add(head); } p4.disconnect(); return new ArrayList<>(list); }
Source:
<code>public void testGetLunsToUpdateInDbDiffLunIdDiffPvId() { Guid lunFromVgLunId = Guid.newGuid(); List<LUNs> lunsToUpdateInDb = getLunsToUpdateInDb(lunFromVgLunId, Guid.newGuid(), Guid.newGuid(), Guid.newGuid()); <START> assertTrue(Objects.equals( <END> lunsToUpdateInDb.stream().map(LUNs::getLUNId).findFirst().orElse(null), lunFromVgLunId.toString())); }</code><technical_language>assertEquals? (and for methods)</technical_language>

Target:
public void testGetLunsToUpdateInDbDiffLunIdDiffPvId() { Guid lunFromVgLunId = Guid.newGuid(); List<LUNs> newLunsToSaveInDb = getLunsToUpdateInDb(lunFromVgLunId, Guid.newGuid(), Guid.newGuid(), Guid.newGuid()). get(command.saveNewLuns); assertLunIdInList(newLunsToSaveInDb, lunFromVgLunId); }
Source:
<code>private void writeThenReadFile(FileSystem fs, Path path) throws IOException { byte[] data = dataset(1024, 'a', 'z'); <START> writeDataset(fs, path, data, data.length, 1024 * 1024, true); <END> ContractTestUtils.verifyFileContents(fs, path, data); }</code><technical_language>1MB tips this scale tests. If this is size needed validate perf this test a subclass of S3AScaleTestBase place in org.apache.hadoop.fs.s3a.scale</technical_language>

Target:
private void writeThenReadFile(FileSystem fs, Path path) throws IOException { byte[] data = dataset(1024, 'a', 'z'); writeDataset(fs, path, data, data.length, 1024, true); ContractTestUtils.verifyFileContents(fs, path, data); }
Source:
<code>ShowCasesDialog() { super((JFrame) WindowManager.getDefault().getMainWindow(), Bundle.ShowCasesDialog_title_text(), <START> true); END> tableModel = new ShowCasesTableModel(); initComponents(); try { EamDb dbManager = EamDb.getInstance(); List<CorrelationCase> eamCases = dbManager.getCases(); for(CorrelationCase eamCase : eamCases) { tableModel.addEamCase(eamCase); } } catch (EamDbException ex) { Exceptions.printStackTrace(ex); } display(); }</code><technical_language>NON-NLS unnecessary</technical_language>

Target:
ShowCasesDialog() { super((JFrame) WindowManager.getDefault().getMainWindow(), Bundle.ShowCasesDialog_title_text(), true); tableModel = new ShowCasesTableModel(); initComponents(); try { EamDb dbManager = EamDb.getInstance(); List<CorrelationCase> eamCases = dbManager.getCases(); for(CorrelationCase eamCase : eamCases) { tableModel.addEamCase(eamCase); } } catch (EamDbException ex) { logger.log(Level.SEVERE, "Error getting list of cases from database.", ex); } display(); }
Source:
<code>public POSTrain(int iter, String configFile) throws IOException { this.iter = iter; <START> rm = new POSConfigurator().getConfigFromFile(configFile); <END> this.init(); }</code><technical_language>This line "new POSConfigurator().getConfig( new ResourceManager( configFile ) )" -- this way, user needs non-default values in config</technical_language>

Target:
public POSTrain(int iter, String configFile) throws IOException { this.iter = iter; rm = new POSConfigurator().getConfig(new ResourceManager(configFile)); this.init(); }
Source:
<code>public TaskInfo<EntryType> map(int index, ResultSet resultSet, StatementContext context) throws SQLException { <START> final TaskInfo taskInfo; <END> try { TaskStatus status = getJsonMapper().readValue(resultSet.getBytes("status_payload"), getStatusType()); taskInfo = new TaskInfo( resultSet.getString("id"), DateTimes.of(resultSet.getString("created_date")), status, resultSet.getString("datasource"), getJsonMapper().readValue(resultSet.getBytes("payload"), getEntryType()) ); } catch (IOException e) { throw new SQLException(e); } return taskInfo; }</code><technical_language>add EntryType type parameter TaskInfo here</technical_language>

Target:
public TaskInfo<EntryType> map(int index, ResultSet resultSet, StatementContext context) throws SQLException { final TaskInfo<EntryType> taskInfo; try { TaskStatus status = getJsonMapper().readValue(resultSet.getBytes("status_payload"), getStatusType()); taskInfo = new TaskInfo<>( resultSet.getString("id"), DateTimes.of(resultSet.getString("created_date")), status, resultSet.getString("datasource"), getJsonMapper().readValue(resultSet.getBytes("payload"), getEntryType()) ); } catch (IOException e) { throw new SQLException(e); } return taskInfo; }
Source:
<code><START> private void onBoardNew() { <END> logger.info("Menu: Boards > New"); if (isCurrentOpenBoardDirty()) { promptToSaveCurrentBoard(); } newBoard(); }</code><technical_language>for name. implementation thingy</technical_language>

Target:
private void onBoardNew() { logger.info("Menu: Boards > New"); if (isCurrentBoardDirty() && isUserAgreeableToSavingBorad()) { saveBoard(); logger.info("Changes to the current board saved."); } else { logger.info("User abandoned unsaved changes."); } newBoard(); }
Source:
<code>public String getColumnReference(TimeGrain requestedGrain) { <START> Preconditions.checkArgument(getSupportedGrains().stream() <END> .anyMatch((grainDef -> grainDef.grain().equals(requestedGrain)))); TimeGrainDefinition definition = getSupportedGrains().stream() .filter(grainDef -> grainDef.grain().equals(requestedGrain)).findFirst().get(); return String.format(definition.expression(), getColumnReference()); }</code><technical_language>do findFirst().orElseThrow() here</technical_language>

Target:
public String getColumnReference(TimeGrain requestedGrain) { TimeGrainDefinition definition = getSupportedGrains().stream() .filter(grainDef -> grainDef.grain().equals(requestedGrain)) .findFirst() .orElseThrow(() -> new IllegalStateException("Requested time grain not supported.")); return String.format(definition.expression(), getColumnReference()); }
Source:
<code>public void testRejectTransformersEAP_7_2_0() throws Exception { final PathAddress subsystemAddress = PathAddress.pathAddress(UndertowExtension.SUBSYSTEM_PATH); final PathAddress serverAddress = subsystemAddress.append(UndertowExtension.SERVER_PATH); final PathAddress hostAddress = serverAddress.append(UndertowExtension.HOST_PATH); PathAddress servletContainer = subsystemAddress.append(UndertowExtension.PATH_SERVLET_CONTAINER); <START> PathAddress byteBufferPath = subsystemAddress.append(UndertowExtension.BYTE_BUFFER_POOL_PATH); <END> doRejectTest(ModelTestControllerVersion.EAP_7_2_0, EAP7_2_0, new FailedOperationTransformationConfig() .addFailedAttribute(hostAddress.append(PathElement.pathElement(Constants.SETTING, "console-access-log")), FailedOperationTransformationConfig.REJECTED_RESOURCE) .addFailedAttribute(servletContainer, new FailedOperationTransformationConfig.NewAttributesConfig( ServletContainerDefinition.PRESERVE_PATH_ON_FORWARD )) ); }</code><technical_language>in GitHub UI, this unused</technical_language>

Target:
public void testRejectTransformersEAP_7_2_0() throws Exception { final PathAddress subsystemAddress = PathAddress.pathAddress(UndertowExtension.SUBSYSTEM_PATH); final PathAddress serverAddress = subsystemAddress.append(UndertowExtension.SERVER_PATH); final PathAddress hostAddress = serverAddress.append(UndertowExtension.HOST_PATH); PathAddress servletContainer = subsystemAddress.append(UndertowExtension.PATH_SERVLET_CONTAINER); doRejectTest(ModelTestControllerVersion.EAP_7_2_0, EAP7_2_0, new FailedOperationTransformationConfig() .addFailedAttribute(hostAddress.append(PathElement.pathElement(Constants.SETTING, "console-access-log")), FailedOperationTransformationConfig.REJECTED_RESOURCE) .addFailedAttribute(servletContainer, new FailedOperationTransformationConfig.NewAttributesConfig( ServletContainerDefinition.PRESERVE_PATH_ON_FORWARD )) ); }
Source:
<code>public CacheDataStoreImpl( int partId, String name, CacheDataRowStore rowStore, CacheDataTree dataTree ) { this.partId = partId; this.name = name; this.rowStore = rowStore; this.dataTree = dataTree; <START> pCntr = grp.mvccEnabled() ? new PartitionMvccTxUpdateCounterImpl() : <END> grp.hasAtomicCaches() ? new PartitionAtomicUpdateCounterImpl() : ctx.logger(PartitionTxUpdateCounterDebugWrapper.class).isDebugEnabled() ? new PartitionTxUpdateCounterDebugWrapper(grp, partId) : new PartitionTxUpdateCounterImpl(); }</code><technical_language>rewritten if-else blocks? hard read expression</technical_language>

Target:
public CacheDataStoreImpl( int partId, String name, CacheDataRowStore rowStore, CacheDataTree dataTree ) { this.partId = partId; this.name = name; this.rowStore = rowStore; this.dataTree = dataTree; if (grp.mvccEnabled()) pCntr = new PartitionMvccTxUpdateCounterImpl(); else if (grp.hasAtomicCaches() || !grp.persistenceEnabled()) pCntr = new PartitionAtomicUpdateCounterImpl(); else { pCntr = ctx.logger(PartitionTxUpdateCounterDebugWrapper.class).isDebugEnabled() ? new PartitionTxUpdateCounterDebugWrapper(grp, partId) : new PartitionTxUpdateCounterImpl(); } }
Source:
<code>public MessageConsole getConsole(String packageName) { ConsolePlugin plugin = ConsolePlugin.getDefault(); IConsoleManager conMan = plugin.getConsoleManager(); <START> String projectConsoleName = "rpmbuild" + '(' + packageName + ')'; END> MessageConsole ret = null; for (IConsole cons : ConsolePlugin.getDefault().getConsoleManager() .getConsoles()) { if (cons.getName().equals(projectConsoleName)) { ret = (MessageConsole) cons; } } if (ret == null) { ret = new MessageConsole(projectConsoleName, null, null, true); } conMan.addConsoles(new IConsole[] { ret }); ret.clearConsole(); ret.activate(); return ret; }</code><technical_language>String externalized</technical_language>

Target:
public MessageConsole getConsole(String packageName) { ConsolePlugin plugin = ConsolePlugin.getDefault(); IConsoleManager conMan = plugin.getConsoleManager(); String projectConsoleName = NLS.bind(Messages.PrepareSources_consoleName, packageName); MessageConsole ret = null; for (IConsole cons : ConsolePlugin.getDefault().getConsoleManager() .getConsoles()) { if (cons.getName().equals(projectConsoleName)) { ret = (MessageConsole) cons; } } if (ret == null) { ret = new MessageConsole(projectConsoleName, null, null, true); } conMan.addConsoles(new IConsole[] { ret }); ret.clearConsole(); ret.activate(); return ret; }
Source:
<code>public void should_call_single_listener_on_verify() { RememberingListener listener = new RememberingListener(); ThreadSafeMockingProgress.mockingProgress().addListener(listener); Foo foo = mock(Foo.class); VerificationMode never = never(); verify(foo, never).doSomething(""); <START> assertThatHasBeenNotified(listener, foo, never, invocationWanted); <END> }</code><technical_language>This assertion method is obscure. read methods implementation is asserted</technical_language>

Target:
public void should_call_single_listener_on_verify() { Foo foo = mock(Foo.class); VerificationMode never = never(); verify(foo, never).doSomething(""); assertThat(listener).is(notifiedFor(foo, never, invocationWanted)); }
Source:
<code>public void testFailureOnServerErrors() throws Exception { List<ServerErrorCode> serverErrors = new ArrayList<>(Arrays.asList(ServerErrorCode.values())); <START> serverErrors.remove(ServerErrorCode.Blob_Deleted); <END> serverErrors.remove(ServerErrorCode.Blob_Expired); serverErrors.remove(ServerErrorCode.No_Error); serverErrors.remove(ServerErrorCode.Blob_Authorization_Failure); serverErrors.remove(ServerErrorCode.Blob_Not_Found); for (ServerErrorCode serverErrorCode : serverErrors) { mockServerLayout.getMockServers().forEach(server -> server.setServerErrorForAllRequests(serverErrorCode)); assertOperationFailure(serverErrorCode == ServerErrorCode.Disk_Unavailable ? RouterErrorCode.AmbryUnavailable : RouterErrorCode.UnexpectedInternalError); } }</code><technical_language>EnumSet.complementOf(EnumSet.of(Blob_Expired, No_Error, ...))</technical_language>

Target:
public void testFailureOnServerErrors() throws Exception { EnumSet<ServerErrorCode> serverErrors = EnumSet.complementOf( EnumSet.of(ServerErrorCode.Blob_Deleted, ServerErrorCode.Blob_Expired, ServerErrorCode.No_Error, ServerErrorCode.Blob_Authorization_Failure, ServerErrorCode.Blob_Not_Found)); for (ServerErrorCode serverErrorCode : serverErrors) { mockServerLayout.getMockServers().forEach(server -> server.setServerErrorForAllRequests(serverErrorCode)); assertOperationFailure(serverErrorCode == ServerErrorCode.Disk_Unavailable ? RouterErrorCode.AmbryUnavailable : RouterErrorCode.UnexpectedInternalError); } }
Source:
<code>private InputStream getResourceStream(File file, String resourceName) { try { JarFile jarFile = (JarFile) jarFiles.get(file); if (jarFile == null && file.isDirectory()) { File resource = new File(file, resourceName); if (resource.exists()) { return Files.newInputStream(resource.toPath()); } } else { <START> return (InputStream) storeAndConvert(jarFile, file, resourceName, (jar, entry) -> jar.getInputStream(entry)); <END> } } catch (Exception e) { log("Ignoring Exception " + e.getClass().getName() + ": " + e.getMessage() + " reading resource " + resourceName + " from " + file, Project.MSG_VERBOSE); } return null; }</code><technical_language>suggestion return storeAndConvert<InputStream>(jarFile, file, resourceName, (jar, entry) -> jar.getInputStream(entry));</technical_language>

Target:
private InputStream getResourceStream(File file, String resourceName) { try { JarFile jarFile = (JarFile) jarFiles.get(file); if (jarFile == null && file.isDirectory()) { File resource = new File(file, resourceName); if (resource.exists()) { return Files.newInputStream(resource.toPath()); } } else { return storeAndConvert(jarFile, file, resourceName, JarFile::getInputStream); } } catch (Exception e) { log("Ignoring Exception " + e.getClass().getName() + ": " + e.getMessage() + " reading resource " + resourceName + " from " + file, Project.MSG_VERBOSE); } return null; }
Source:
<code>void setUp() { <START> closeWebDriver(); <END> useProxy(true); }</code><technical_language>needed call closeWebDriver();: method useProxy(true); automatically if needed</technical_language>

Target:
void setUp() { useProxy(true); }
Source:
<code>public void testDeleteProject() throws SQLException{ ProjectInfo projectInfo = new ProjectInfo(); projectInfo.name = "TEST_PROJECT_NAME"; projectInfo.displayName = "TEST_PROJECT_DISPLAYNAME"; projectInfo.common = "TEST_PROJECT_COMMON"; projectInfo.manager = "TEST_PROJECT_MANAGER"; projectInfo.attachFileSize = 2048L; <START> long projectId = mProjectMapper.createProject(projectInfo.name, projectInfo); <END> assertTrue(projectId > 0); mProjectMapper.deleteProject(projectId); IQueryValueSet valueSet = new MySQLQuerySet(); valueSet.addTableName(ProjectEnum.TABLE_NAME); valueSet.addEqualCondition(ProjectEnum.ID, projectId); String query = valueSet.getSelectQuery(); ResultSet resultSet = mControl.executeQuery(query); assertFalse(resultSet.first()); }</code><technical_language>avoid other method</technical_language>

Target:
public void testDeleteProject() throws SQLException{ mProjectMapper.deleteProject(mProjectId); IQueryValueSet valueSet = new MySQLQuerySet(); valueSet.addTableName(ProjectEnum.TABLE_NAME); valueSet.addEqualCondition(ProjectEnum.ID, mProjectId); String query = valueSet.getSelectQuery(); ResultSet resultSet = mControl.executeQuery(query); assertFalse(resultSet.first()); }
Source:
<code>public void handleMessage(final ObjectMessage message) throws JMSException { this.correlationUid = message.getJMSCorrelationID(); this.domain = message.getStringProperty(Constants.DOMAIN); this.domainVersion = message.getStringProperty(Constants.DOMAIN_VERSION); this.messageType = message.getJMSType(); this.organisationIdentification = message.getStringProperty(Constants.ORGANISATION_IDENTIFICATION); this.deviceIdentification = message.getStringProperty(Constants.DEVICE_IDENTIFICATION); this.ipAddress = message.getStringProperty(Constants.IP_ADDRESS); this.retryCount = message.getIntProperty(Constants.RETRY_COUNT); <START> if (message.propertyExists(Constants.SCHEDULE_TIME)) { <END> this.scheduleTime = message.getLongProperty(Constants.SCHEDULE_TIME); } this.messagePriority = message.getJMSPriority(); }</code><technical_language>Scheduling is done Core, protocol adapter scheduleTime in DlmsDeviceMetadata? is I see. Is a reason for this</technical_language>

Target:
public void handleMessage(final ObjectMessage message) throws JMSException { this.correlationUid = message.getJMSCorrelationID(); this.domain = message.getStringProperty(Constants.DOMAIN); this.domainVersion = message.getStringProperty(Constants.DOMAIN_VERSION); this.messageType = message.getJMSType(); this.organisationIdentification = message.getStringProperty(Constants.ORGANISATION_IDENTIFICATION); this.deviceIdentification = message.getStringProperty(Constants.DEVICE_IDENTIFICATION); this.ipAddress = message.getStringProperty(Constants.IP_ADDRESS); this.retryCount = message.getIntProperty(Constants.RETRY_COUNT); this.messagePriority = message.getJMSPriority(); }
Source:
<code>private static boolean isDefaultConstructor(Symbol symbol) { if (symbol.isMethodSymbol()) { <START> Symbol.MethodSymbol methodSymbol = ((Symbol.MethodSymbol)symbol); <END> if ("<init>".equals(methodSymbol.name())) { if (methodSymbol.declaration() != null) { return methodSymbol.declaration().parameters().isEmpty(); } else { return methodSymbol.parameterTypes().isEmpty(); } } } return false; }</code><technical_language>useless parenthesis</technical_language>

Target:
private static boolean isDefaultConstructor(Symbol symbol) { if (symbol.isMethodSymbol()) { Symbol.MethodSymbol methodSymbol = (Symbol.MethodSymbol) symbol; if (CONSTRUCTOR_NAME.equals(methodSymbol.name())) { if (methodSymbol.declaration() != null) { return methodSymbol.declaration().parameters().isEmpty(); } else { return methodSymbol.parameterTypes().isEmpty(); } } } return false; }