auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public FeatureState getFeatureState(final Feature feature) { try (Jedis jedis = jedisPool.getResource()) { final Map<String, String> map = jedis.hgetAll(keyPrefix + feature.name()); if (map == null || map.size() == 0) { return null; } final FeatureState featureState = new FeatureState(feature); featureState.setEnabled(Boolean.valueOf(map.get(ENABLED_FIELD))); featureState.setStrategyId(map.get(STRATEGY_FIELD)); final String strategyParameters = map.get(PARAMETERS_FIELD); if (strategyParameters != null) { <START> for (final Map.Entry<String, String> entry : mapSerializer.deserialize(strategyParameters).entrySet()) { <END> featureState.setParameter(entry.getKey(), entry.getValue()); } } return featureState; } }</code><technical_language>wondering if sense MapSerializer here. store parameters separately. do for "enabled" "strategy-id"? this more in spirit of Redis</technical_language>

Target:
public FeatureState getFeatureState(final Feature feature) { try (final Jedis jedis = jedisPool.getResource()) { final Map<String, String> redisMap = jedis.hgetAll(keyPrefix + feature.name()); if (redisMap == null || redisMap.size() == 0) { return null; } final FeatureState featureState = new FeatureState(feature); featureState.setEnabled(Boolean.valueOf(redisMap.get(ENABLED_FIELD))); featureState.setStrategyId(redisMap.get(STRATEGY_FIELD)); for (final Map.Entry<String, String> entry : redisMap.entrySet()) { final String key = entry.getKey(); if (key.startsWith(PARAMETER_PREFIX)) { featureState.setParameter(key.substring(PARAMETER_PREFIX_LENGTH), entry.getValue()); } } return featureState; } }
Source:
<code>public void multiRefTestGetCRAIEntries() { final Slice slice1 = new Slice(ReferenceContext.MULTIPLE_REFERENCE_CONTEXT); final Slice slice2 = new Slice(ReferenceContext.MULTIPLE_REFERENCE_CONTEXT); final Container container = Container.initializeFromSlices(Arrays.asList(slice1, slice2)); final List<CRAIEntry> entries = container.getCRAIEntries(); Assert.assertNotNull(entries); Assert.assertEquals(entries.size(), 2); <START> assertEntryForSlice(entries.get(0), slice1); <END> assertEntryForSlice(entries.get(1), slice2); }</code><technical_language>test methods identical for slice creation, replaced a single method a data provider</technical_language>

Target:
public void multiRefTestGetCRAIEntries() { final Slice multi = new Slice(ReferenceContext.MULTIPLE_REFERENCE_CONTEXT); final Container container = Container.initializeFromSlices(Arrays.asList(multi)); container.getCRAIEntries(); }
Source:
<code>public NotifierTask(Context context, TaskContext taskContext, Uri uri, String notifyTitle, String notifyText) { mContext = context; mTaskContext = taskContext; mCR = mContext.getContentResolver(); mUri = uri; mNotifyTitle = notifyTitle; mNotifyText = notifyText; <START> mSettings = Application.getPrefs(); <END> }</code><technical_language>this need a member variable? is a static method a local variable in createNotification()</technical_language>

Target:
public NotifierTask(Context context, TaskContext taskContext, Uri uri, String notifyTitle, String notifyText) { mContext = context; mTaskContext = taskContext; mCR = mContext.getContentResolver(); mUri = uri; mNotifyTitle = notifyTitle; mNotifyText = notifyText; }
Source:
<code>public boolean optionExists(final String optionName) { <START> if (this.cmd.hasOption(optionName)) { <END> return true; } return false; }</code><technical_language>This simplified return this.cmd.hasOption(optionName));</technical_language>

Target:
public boolean optionExists(final String optionName) { return this.cmd.hasOption(optionName); }
Source:
<code>public static File task(File projectDir, String dstName) throws IOException { File dstDir = new File(projectDir.getParent(), FileMetaDataExtractor.encodeSpecialCharsForFileSystem(dstName)); try { if (projectDir.renameTo(dstDir) && XstreamSerializer.renameProject(new File(dstDir, CODE_XML_FILE_NAME), dstName)) { return dstDir; } else { <START> return null; <END> } } catch (IOException e) { Log.e(TAG, "Cannot rename project directory " + projectDir.getAbsolutePath() + " to " + dstName, e); throw e; } }</code><technical_language>loving null returns null checks needed then. :crying_cat_face: throwing a exception here? e.g. throw new IOException("some cool message")</technical_language>

Target:
public static File task(File projectDir, String dstName) throws IOException { File dstDir = new File(projectDir.getParent(), FileMetaDataExtractor.encodeSpecialCharsForFileSystem(dstName)); if (projectDir.renameTo(dstDir) && XstreamSerializer.renameProject(new File(dstDir, CODE_XML_FILE_NAME), dstName)) { return dstDir; } else { throw new IOException("Cannot rename project directory " + projectDir.getAbsolutePath() + " to " + dstName); } }
Source:
<code>void populate(final int row, final PluginInfo plugin) { if (plugin.disabled() || plugin.indexUrl() == null) { table.setText(row, 1, plugin.name()); } else { <START> HorizontalPanel p = new HorizontalPanel(); <END> p.setStyleName(Gerrit.RESOURCES.css().pluginName()); p.add(new Anchor(plugin.name(), Gerrit.selfRedirect(plugin.indexUrl()), "_blank")); if (plugin.adminUrl() != null) { Anchor adminScreenAcnhcor = new Anchor(new ImageResourceRenderer().render(Gerrit.RESOURCES.gear()), Gerrit.selfRedirect(plugin.adminUrl())); adminScreenAcnhcor.setTitle(Util.C.pluginAdminToolTip()); p.add(adminScreenAcnhcor); } table.setWidget(row, 1, p); } table.setText(row, 2, plugin.version()); table.setText(row, 3, plugin.disabled() ? Util.C.pluginDisabled() : Util.C.pluginEnabled()); final FlexCellFormatter fmt = table.getFlexCellFormatter(); fmt.addStyleName(row, 1, Gerrit.RESOURCES.css().dataCell()); fmt.addStyleName(row, 2, Gerrit.RESOURCES.css().dataCell()); fmt.addStyleName(row, 3, Gerrit.RESOURCES.css().dataCell()); setRowItem(row, plugin); }</code><technical_language>add another column table name version</technical_language>

Target:
void populate(final int row, final PluginInfo plugin) { if (plugin.disabled() || plugin.indexUrl() == null) { table.setText(row, 1, plugin.name()); } else { table.setWidget(row, 1, new Anchor(plugin.name(), Gerrit.selfRedirect(plugin.indexUrl()), "_blank")); if (new ExtensionScreen(plugin.name() + "/admin").isFound()) { Anchor adminScreenAcnhcor = new Anchor(new ImageResourceRenderer().render(Gerrit.RESOURCES.gear()), Gerrit.selfRedirect("#/x/" + plugin.name() + "/admin")); adminScreenAcnhcor.setTitle(Util.C.pluginSettingsToolTip()); table.setWidget(row, 2, adminScreenAcnhcor); } } table.setText(row, 3, plugin.version()); table.setText(row, 4, plugin.disabled() ? Util.C.pluginDisabled() : Util.C.pluginEnabled()); final FlexCellFormatter fmt = table.getFlexCellFormatter(); fmt.addStyleName(row, 1, Gerrit.RESOURCES.css().dataCell()); fmt.addStyleName(row, 2, Gerrit.RESOURCES.css().dataCell()); fmt.addStyleName(row, 3, Gerrit.RESOURCES.css().dataCell()); fmt.addStyleName(row, 4, Gerrit.RESOURCES.css().dataCell()); setRowItem(row, plugin); }
Source:
<code>private static String emptyDirectory(String path){ File f = new File(path); if(f.exists()) { for (File log : f.listFiles()) { log.delete(); } <START> f.delete(); <END> } return path; }</code><technical_language>purpose (the directory is is need delete it), I guess is fine</technical_language>

Target:
private static String emptyDirectory(String path){ File f = new File(path); if(f.exists()) { for (File log : f.listFiles()) { log.delete(); } } return path; }
Source:
<code>public void setPosition(int position) { this.position = position; <START> if(position > 0) { <END> this.item.setPlayed(false); } }</code><technical_language>daft, is this condition backwards? set 'played' false position is greater 0? setting 'new' false</technical_language>

Target:
public void setPosition(int position) { this.position = position; if(position > 0 && item.isNew()) { this.item.setPlayed(false); } }
Source:
<code><START> protected List<TaskData> doProcess(CommonHttpResponse response, IOperationMonitor monitor) <END> throws IOException, BugzillaRestException { BufferedInputStream is = new BufferedInputStream(response.getResponseEntityAsStream()); InputStreamReader in = new InputStreamReader(is); isRestError(is, in); return parseFromJson(in); }</code><technical_language>ok, I fully understand class heirarchy in this connector. a bit confusing for me, if want change this ok. This review is big enough already</technical_language>

Target:
protected List<TaskData> doProcess(CommonHttpResponse response, IOperationMonitor monitor) throws IOException, BugzillaRestException { BufferedInputStream is = new BufferedInputStream(response.getResponseEntityAsStream()); InputStreamReader in = new InputStreamReader(is); throwExeptionIfRestError(is, in); return parseFromJson(in); }
Source:
<code>public void configurePipeline(PipelineConfigurer pipelineConfigurer) throws IllegalArgumentException { StageConfigurer stageConfigurer = pipelineConfigurer.getStageConfigurer(); Schema inputSchema = stageConfigurer.getInputSchema(); <START> Preconditions.checkArgument(inputSchema != null, "Input Schema must be a known constant."); <END> }</code><technical_language>performing more validation here. If input schema is null, need check fields in config exist in input schema strings nullable strings</technical_language>

Target:
public void configurePipeline(PipelineConfigurer pipelineConfigurer) throws IllegalArgumentException { StageConfigurer stageConfigurer = pipelineConfigurer.getStageConfigurer(); Schema inputSchema = stageConfigurer.getInputSchema(); Preconditions.checkArgument(inputSchema != null, "Input Schema must be a known constant."); config.validate(inputSchema); pipelineConfigurer.getStageConfigurer().setOutputSchema(config.getOutputSchema(inputSchema)); }
Source:
<code>public void setUp() { when(mockUserService.generatePassword()).thenReturn("topSecret"); MessageDestination anonMessageDestinationEntity = MessageDestination .createInstance(PublicKeyUtil.generateKeyPair().getPublic()); Set<Goal> goals = new HashSet<>(); deviceAnonEntity = DeviceAnonymized.createInstance(0, OperatingSystem.ANDROID, "Unknown", 5, <START> Optional.of("Firebase-12345")); <END> deviceAnonymizedRepository.save(deviceAnonEntity); userAnonEntity = UserAnonymized.createInstance(anonMessageDestinationEntity, goals); userAnonEntity.addDeviceAnonymized(deviceAnonEntity); UserAnonymizedDto userAnon = UserAnonymizedDto.createInstance(userAnonEntity); userAnonId = userAnon.getId(); when(mockUserAnonymizedService.getUserAnonymized(userAnonId)) .thenReturn(UserAnonymizedDto.createInstance(userAnonEntity)); when(mockMessageDestinationRepository.findById(anonMessageDestinationEntity.getId())) .thenReturn(Optional.of(anonMessageDestinationEntity)); }</code><technical_language>Extract "Firebase-12345" constant FIREBASE_REGISTRATION_TOKEN in tests</technical_language>

Target:
public void setUp() { when(mockUserService.generatePassword()).thenReturn("topSecret"); MessageDestination anonMessageDestinationEntity = MessageDestination .createInstance(PublicKeyUtil.generateKeyPair().getPublic()); Set<Goal> goals = new HashSet<>(); deviceAnonEntity = DeviceAnonymized.createInstance(0, OperatingSystem.ANDROID, "Unknown", 5, Optional.of(FIREBASE_REGISTRATION_TOKEN)); deviceAnonymizedRepository.save(deviceAnonEntity); userAnonEntity = UserAnonymized.createInstance(anonMessageDestinationEntity, goals); userAnonEntity.addDeviceAnonymized(deviceAnonEntity); UserAnonymizedDto userAnon = UserAnonymizedDto.createInstance(userAnonEntity); userAnonId = userAnon.getId(); when(mockUserAnonymizedService.getUserAnonymized(userAnonId)) .thenReturn(UserAnonymizedDto.createInstance(userAnonEntity)); when(mockMessageDestinationRepository.findById(anonMessageDestinationEntity.getId())) .thenReturn(Optional.of(anonMessageDestinationEntity)); }
Source:
<code>public M get() { if (message == null && messageBytes != null) { checkConverter(); try { return converter.fromBytes(messageBytes); <START> } catch (Exception e) { <END> throw new IllegalStateException("Converter failed to deserialize", e); } } return message; }</code><technical_language>catching Exception antipattern. catch OutOfMemoryException other RuntimeException job continue in a bad state a waste of resources</technical_language>

Target:
public M get() { if (message == null && messageBytes != null) { checkConverter(); try { return converter.fromBytes(messageBytes); } catch (DecodeException e) { throw new IllegalStateException("Converter failed to deserialize", e); } } return message; }
Source:
<code>public MockitoSessionBuilder initMocks(Object testClassInstance) { if (testClassInstance == null) { <START> testClassInstance = new Object(); <END> } testInstances = singletonList(testClassInstance); return this; }</code><technical_language>is purpose of this line</technical_language>

Target:
public MockitoSessionBuilder initMocks(Object testClassInstance) { if (testClassInstance != null) { this.testClassInstances.add(testClassInstance); } return this; }
Source:
<code>public void updateComment(String pipelineName, int pipelineCounter, String comment, Username username, HttpLocalizedOperationResult result) { if (securityService.hasOperatePermissionForPipeline(username.getUsername(), pipelineName)) { pipelineDao.updateComment(pipelineName, pipelineCounter, comment); } else { <START> result.unauthorized(LocalizedMessage.cannotViewPipeline(pipelineName), HealthStateType.general(HealthStateScope.forPipeline(pipelineName))); <END> } }</code><technical_language>LocalizedMessage.cannotViewPipeline(pipelineName) correct. need create & LocalizedMessage.cannotOperatePipeline(pipelineName). need add message PIPELINE_CANNOT_OPERATE in localize.xml & localize_ja.xml</technical_language>

Target:
public void updateComment(String pipelineName, int pipelineCounter, String comment, Username username, HttpLocalizedOperationResult result) { if (securityService.hasOperatePermissionForPipeline(username.getUsername(), pipelineName)) { pipelineDao.updateComment(pipelineName, pipelineCounter, comment); } else { result.unauthorized(LocalizedMessage.cannotOperatePipeline(pipelineName), HealthStateType.general(HealthStateScope.forPipeline(pipelineName))); } }
Source:
<code>public Map<String, String> getAllValues( Locator locator ) throws IOException { <START> Timer.Context ctx = Instrumentation.getReadTimerContext( CassandraModel.CF_METRICS_STATE_NAME ); <END> Session session = DatastaxIO.getSession(); try { Select.Where select = select() .all() .from( CassandraModel.CF_METRICS_METADATA_NAME ) .where( eq( KEY, locator.toString() )); List<Row> results = session.execute( select ).all(); Map<String, String> values = new HashMap<String, String>(); for ( Row row : results ) { if ( LOG.isDebugEnabled() ) { LOG.debug( "Read metrics_metadata: " + row.getString( KEY ) + row.getString( COLUMN1 ) + serDes.deserialize( row.getBytes( VALUE ) ) ); } values.put( row.getString( COLUMN1 ), serDes.deserialize( row.getBytes( VALUE ) ) ); } return values; } finally { ctx.stop(); } }</code><technical_language>this CF_METRICS_METADATA_NAME</technical_language>

Target:
public Map<String, String> getAllValues( Locator locator ) throws IOException { Timer.Context ctx = Instrumentation.getReadTimerContext( CassandraModel.CF_METRICS_METADATA_NAME ); Session session = DatastaxIO.getSession(); try { Select.Where select = select() .all() .from( CassandraModel.CF_METRICS_METADATA_NAME ) .where( eq( KEY, locator.toString() )); List<Row> results = session.execute( select ).all(); Map<String, String> values = new HashMap<String, String>(); for ( Row row : results ) { if ( LOG.isTraceEnabled() ) { LOG.trace( "Read metrics_metadata: " + row.getString( KEY ) + row.getString( COLUMN1 ) + serDes.deserialize( row.getBytes( VALUE ) ) ); } values.put( row.getString( COLUMN1 ), serDes.deserialize( row.getBytes( VALUE ) ) ); } return values; } finally { ctx.stop(); } }
Source:
<code>public String getErrorPage() { <START> return null; <END> }</code><technical_language>return null, return error page</technical_language>

Target:
public String getErrorPage() { return "public/404"; }
Source:
<code>public void handle(LoginRequest loginRequest) throws Exception { Preconditions.checkState( thisState == State.USERNAME, "Not expecting USERNAME" ); this.loginRequest = loginRequest; <START> if ( getName().length() == 0 ) <END> { disconnect( bungee.getTranslation( "name_empty" ) ); return; } if ( getName().length() > 16 ) { disconnect( bungee.getTranslation( "name_too_long" ) ); return; } if ( !Util.testUsername( getName() ) ) { disconnect( bungee.getTranslation( "name_invalid" ) ); return; } int limit = BungeeCord.getInstance().config.getPlayerLimit(); if ( limit > 0 && bungee.getOnlineCount() > limit ) { disconnect( bungee.getTranslation( "proxy_full" ) ); return; } if ( !isOnlineMode() && bungee.getPlayer( getUniqueId() ) != null ) { disconnect( bungee.getTranslation( "already_connected_proxy" ) ); return; } Callback<PreLoginEvent> callback = new Callback<PreLoginEvent>() { @Override public void done(PreLoginEvent result, Throwable error) { if ( result.isCancelled() ) { disconnect( result.getCancelReasonComponents() ); return; } if ( ch.isClosed() ) { return; } if ( onlineMode ) { unsafe().sendPacket( request = EncryptionUtil.encryptRequest() ); } else { finish(); } thisState = State.ENCRYPT; } }; bungee.getPluginManager().callEvent( new PreLoginEvent( InitialHandler.this, callback ) ); }</code><technical_language>getName().trim().length()</technical_language>

Target:
public void handle(LoginRequest loginRequest) throws Exception { Preconditions.checkState( thisState == State.USERNAME, "Not expecting USERNAME" ); this.loginRequest = loginRequest; if ( getName().length() == 0 ) { disconnect( bungee.getTranslation( "name_empty" ) ); return; } if ( getName().length() > 16 ) { disconnect( bungee.getTranslation( "name_too_long" ) ); return; } boolean validName; if ( isOnlineMode() || BungeeCord.getInstance().config.isStrictOfflineNameValidate() ) { validName = Util.testUsername( getName() ); } else { validName = !getName().contains( "." ); } if ( !validName ) { disconnect( bungee.getTranslation( "name_invalid" ) ); return; } int limit = BungeeCord.getInstance().config.getPlayerLimit(); if ( limit > 0 && bungee.getOnlineCount() > limit ) { disconnect( bungee.getTranslation( "proxy_full" ) ); return; } if ( !isOnlineMode() && bungee.getPlayer( getUniqueId() ) != null ) { disconnect( bungee.getTranslation( "already_connected_proxy" ) ); return; } Callback<PreLoginEvent> callback = new Callback<PreLoginEvent>() { @Override public void done(PreLoginEvent result, Throwable error) { if ( result.isCancelled() ) { disconnect( result.getCancelReasonComponents() ); return; } if ( ch.isClosed() ) { return; } if ( onlineMode ) { unsafe().sendPacket( request = EncryptionUtil.encryptRequest() ); } else { finish(); } thisState = State.ENCRYPT; } }; bungee.getPluginManager().callEvent( new PreLoginEvent( InitialHandler.this, callback ) ); }
Source:
<code>public BanCommitResult ban(final ProjectControl projectControl, final List<ObjectId> commitsToBan, final String reason) throws PermissionDeniedException, IOException, InterruptedException, MergeException, ConcurrentRefUpdateException { if (!projectControl.isOwner()) { throw new PermissionDeniedException( "No project owner: not permitted to ban commits"); } final BanCommitResult result = new BanCommitResult(); NoteMap banCommitNotes = NoteMap.newEmptyMap(); final Repository repo = <START> repoManager.openRepository(projectControl.getProject().getNameKey()); <END> final RevWalk revWalk = new RevWalk(repo); final ObjectInserter inserter = repo.newObjectInserter(); try { for (final ObjectId commitToBan : commitsToBan) { try { revWalk.parseCommit(commitToBan); } catch (MissingObjectException e) { } catch (IncorrectObjectTypeException e) { result.notACommit(commitToBan, e.getMessage()); continue; } banCommitNotes.set(commitToBan, createNoteContent(reason, inserter)); } NotesBranchUtil notesBranchUtil = notesBranchUtilFactory.create(repo); NoteMap newlyCreated = notesBranchUtil.commitNewNotes(banCommitNotes, REF_REJECT_COMMITS, createPersonIdent(), buildCommitMessage(commitsToBan, reason)); for (Note n : banCommitNotes) { if (newlyCreated.contains(n)) { result.commitBanned(n); } else { result.commitAlreadyBanned(n); } } return result; } finally { revWalk.release(); inserter.release(); } }</code><technical_language>a repo.close()</technical_language>

Target:
public BanCommitResult ban(final ProjectControl projectControl, final List<ObjectId> commitsToBan, final String reason) throws PermissionDeniedException, IOException, InterruptedException, MergeException, ConcurrentRefUpdateException { if (!projectControl.isOwner()) { throw new PermissionDeniedException( "No project owner: not permitted to ban commits"); } final BanCommitResult result = new BanCommitResult(); NoteMap banCommitNotes = NoteMap.newEmptyMap(); final Repository repo = repoManager.openRepository(projectControl.getProject().getNameKey()); try { final RevWalk revWalk = new RevWalk(repo); final ObjectInserter inserter = repo.newObjectInserter(); try { for (final ObjectId commitToBan : commitsToBan) { try { revWalk.parseCommit(commitToBan); } catch (MissingObjectException e) { } catch (IncorrectObjectTypeException e) { result.notACommit(commitToBan, e.getMessage()); continue; } banCommitNotes.set(commitToBan, createNoteContent(reason, inserter)); } inserter.flush(); NotesBranchUtil notesBranchUtil = notesBranchUtilFactory.create(repo); NoteMap newlyCreated = notesBranchUtil.commitNewNotes(banCommitNotes, REF_REJECT_COMMITS, createPersonIdent(), buildCommitMessage(commitsToBan, reason)); for (Note n : banCommitNotes) { if (newlyCreated.contains(n)) { result.commitBanned(n); } else { result.commitAlreadyBanned(n); } } return result; } finally { revWalk.release(); inserter.release(); } } finally { repo.close(); } }
Source:
<code>public void voidCondition_shouldVoidConditionSuccessfully(){ Condition condition = new Condition(); int patientId = 2; condition.setCondition(new CodedOrFreeText()); <START> condition.setAdditionalDetail("voiding a condition"); <END> condition.setVerificationStatus(ConditionVerificationStatus.PROVISIONAL); condition.setClinicalStatus(ConditionClinicalStatus.INACTIVE); condition.setUuid(UUID); condition.setPatient(patientService.getPatient(patientId)); expectedException = ExpectedException.none(); conditionService.voidCondition(condition, "Test Reason"); Condition voidedCondition = conditionService.getConditionByUuid(UUID); Assert.assertEquals(ConditionVerificationStatus.PROVISIONAL, voidedCondition.getVerificationStatus()); Assert.assertEquals(ConditionClinicalStatus.INACTIVE, voidedCondition.getClinicalStatus()); Assert.assertEquals(UUID, voidedCondition.getUuid()); }</code><technical_language>load a voided condition test dataset for voiding in this test</technical_language>

Target:
public void voidCondition_shouldVoidConditionSuccessfully(){ Integer conditionId = 2; String voidReason = "Test Reason"; Condition nonVoidedCondition = conditionService.getCondition(conditionId); Assert.assertFalse(nonVoidedCondition.getVoided()); Assert.assertNull(nonVoidedCondition.getVoidReason()); Assert.assertNull(nonVoidedCondition.getDateVoided()); Assert.assertNull(nonVoidedCondition.getVoidedBy()); conditionService.voidCondition(nonVoidedCondition, voidReason); Condition voidedCondition = conditionService.getCondition(conditionId); Assert.assertEquals(ConditionVerificationStatus.CONFIRMED, voidedCondition.getVerificationStatus()); Assert.assertEquals(ConditionClinicalStatus.ACTIVE, voidedCondition.getClinicalStatus()); Assert.assertEquals("2cc6880e-2c46-11e4-9138-a6c5e4d20fb7", voidedCondition.getUuid()); Assert.assertTrue(voidedCondition.getVoided()); Assert.assertEquals(voidReason, voidedCondition.getVoidReason()); Assert.assertNotNull(voidedCondition.getDateVoided()); Assert.assertEquals(Context.getAuthenticatedUser(), voidedCondition.getVoidedBy()); }
Source:
<code>public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final Permission that = (Permission) o; return Objects.equals(resource, that.resource) && Objects.equals(operation, that.operation) && Objects.equals(authorizationAttribute.getDataType(), that.authorizationAttribute.getDataType()) && <START> Objects.equals(authorizationAttribute.getValue(), that.authorizationAttribute.getDataType()); <END> }</code><technical_language>I guess compared suggestion Objects.equals(authorizationAttribute.getValue(), that.authorizationAttribute.getValue());</technical_language>

Target:
public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final Permission that = (Permission) o; return Objects.equals(resource, that.resource) && Objects.equals(operation, that.operation) && Objects.equals(authorizationAttribute.getDataType(), that.authorizationAttribute.getDataType()) && Objects.equals(authorizationAttribute.getValue(), that.authorizationAttribute.getValue()); }
Source:
<code>private static Path unsymlinkAndLookForIndex(Path samPath) { try { final Path canonicalSamPath = samPath.toRealPath(); final Path canonicalIndexPath = lookForIndex(canonicalSamPath); if ( canonicalIndexPath != null) { <START> System.err.println("The index file " + canonicalIndexPath.toAbsolutePath() <END> + " was found by resolving the canonical path of a symlink: " + samPath.toAbsolutePath() + " -> " + samPath.toRealPath()); } return canonicalIndexPath; } catch (IOException e) { return null; } }</code><technical_language>Gross! change this print warning logger instead</technical_language>

Target:
private static Path unsymlinkAndLookForIndex(Path samPath) { try { final Path canonicalSamPath = samPath.toRealPath(); final Path canonicalIndexPath = lookForIndex(canonicalSamPath); if ( canonicalIndexPath != null) { LOG.warn("The index file " + canonicalIndexPath.toAbsolutePath() + " was found by resolving the canonical path of a symlink: " + samPath.toAbsolutePath() + " -> " + samPath.toRealPath()); } return canonicalIndexPath; } catch (IOException e) { return null; } }
Source:
<code>public void prepareDatabaseForScenario() { Logger LOGGER = LoggerFactory.getLogger(this.getClass()); LOGGER.info(this.getClass() + ": prepareDatabaseForScenario"); cleanRepoAbstractEntity(this.oslpDeviceRepo); cleanRepoAbstractEntity(this.deviceAuthorizationRepo); cleanRepoSerializable(this.deviceRepo); cleanRepoSerializable(this.deviceModelRepo); cleanRepoSerializable(this.manufacturerRepo); for(Organisation org : this.organizationRepo.findAll()) { String orgName = org.getOrganisationIdentification(); <START> if (!orgName.equals("test-org") && <END> !orgName.equals("FlexOvlProject") && !orgName.equals("GemeenteArnhem") && !orgName.equals("LianderNetManagement")) { this.organizationRepo.delete(org); } } insertDefaultData(); }</code><technical_language>I expect issue here, a general practice, helping avoid NullPointerExceptions, safer put fixed like: "test-org".equals(orgName)</technical_language>

Target:
public void prepareDatabaseForScenario() { cleanRepoAbstractEntity(this.oslpDeviceRepo); cleanRepoAbstractEntity(this.deviceAuthorizationRepo); cleanRepoSerializable(this.smartMeterRepo); cleanRepoSerializable(this.deviceRepo); cleanRepoSerializable(this.deviceModelRepo); cleanRepoSerializable(this.manufacturerRepo); cleanRepoSerializable(this.ssldRepository); cleanRepoSerializable(this.organizationRepo); insertDefaultData(); }
Source:
<code>static ServerHolder reservoirSampleServer(final List<ServerHolder> serverHolders) { if (serverHolders.isEmpty()) { return null; } ServerHolder sampledServer = null; long total = 0; for (ServerHolder serverHolder : serverHolders) { ImmutableDruidServer server = serverHolder.getServer(); long numSegments = server.getSegments().size(); long endIndex = total + numSegments; <START> long randomIndex = ThreadLocalRandom.current().nextLong((endIndex == 0) ? 1 : endIndex); <END> if (randomIndex >= total && randomIndex < endIndex) { sampledServer = serverHolder; } total += numSegments; } return sampledServer; }</code><technical_language>split this out explicitly in if statement nextLong(1) a nested consideration</technical_language>

Target:
static ServerHolder reservoirSampleServer(final List<ServerHolder> serverHolders) { if (serverHolders.isEmpty()) { return null; } else if (serverHolders.size() == 1) { return serverHolders.get(0); } ServerHolder sampledServer = null; long total = 0; for (ServerHolder serverHolder : serverHolders) { ImmutableDruidServer server = serverHolder.getServer(); long numSegments = server.getSegments().size(); long endIndex = total + numSegments; long upperBound = endIndex; if (endIndex == 0) { upperBound = 1; } long randomIndex = ThreadLocalRandom.current().nextLong(upperBound); if (randomIndex >= total && randomIndex < endIndex) { sampledServer = serverHolder; } total += numSegments; } return sampledServer; }
Source:
<code>private InjectMenuActivity.MockMenuInflater createMenuInflater() { final InjectMenuActivity.MockMenuInflater menuInflater = Mockito.mock(InjectMenuActivity.MockMenuInflater.class); doAnswer(new Answer<Void>() { <START> public Void answer(InvocationOnMock invocation) { <END> menuInflater.menuInflated = true; return null; } }).when(menuInflater).inflate(anyInt(), any(Menu.class)); return menuInflater; }</code><technical_language>OK, i realised Mockito verification, mocking. java Mockito.verify(menuInflater).inflate(R.menu.my_menu, menu); This get rid of class boolean field well. Another thing: of times, static import methods mock verify</technical_language>

Target:
private InjectMenuActivity.MockMenuInflater createMenuInflater() { final InjectMenuActivity.MockMenuInflater menuInflater = mock(InjectMenuActivity.MockMenuInflater.class); doAnswer(new Answer<Void>() { public Void answer(InvocationOnMock invocation) { menuInflater.menuInflated = true; return null; } }).when(menuInflater).inflate(anyInt(), any(Menu.class)); return menuInflater; }
Source:
<code>private void populateAbandonAction() { final Button b = new Button(Util.C.buttonAbandonChangeBegin()); b.addClickListener(new ClickListener() { public void onClick(Widget sender) { b.setEnabled(false); new AbandonChangeDialog(patchSet.getId(), new AsyncCallback<Object>() { public void onSuccess(Object result) { actionsPanel.remove(b); fireOnSuggestRefresh(); } public void onFailure(Throwable caught) { <START> b.setEnabled(true); <END> } }).center(); } }); actionsPanel.add(b); }</code><technical_language>is non-standard. dialog modal, ui, user interact button while is open. i in disabling button while dialog is open. disable buttons rpc, waiting for server respond rest of ui is live</technical_language>

Target:
private void populateAbandonAction() { final Button b = new Button(Util.C.buttonAbandonChangeBegin()); b.addClickListener(new ClickListener() { public void onClick(Widget sender) { new AbandonChangeDialog(patchSet.getId(), new AsyncCallback<Object>() { public void onSuccess(Object result) { actionsPanel.remove(b); fireOnSuggestRefresh(); } public void onFailure(Throwable caught) { } }).center(); } }); actionsPanel.add(b); }
Source:
<code>public OpenShiftEnvironment convert(DockerImageEnvironment environment) throws ValidationException { final Map<String, InternalMachineConfig> machines = environment.getMachines(); if (!machines.keySet().iterator().hasNext()) { <START> throw new ValidationException("Environment must contain at least one machine configuration"); <END> } final String machineName = machines.keySet().iterator().next(); final String dockerImage = environment.getRecipe().getContent(); final Map<String, String> annotations = new HashMap<>(); annotations.put(format(MACHINE_NAME_ANNOTATION_FMT, CONTAINER_NAME), machineName); final Pod pod = new PodBuilder() .withNewMetadata() .withName(POD_NAME) .withAnnotations(annotations) .endMetadata() .withNewSpec() .withContainers( new ContainerBuilder().withImage(dockerImage).withName(CONTAINER_NAME).build()) .endSpec() .build(); return OpenShiftEnvironment.builder() .setMachines(machines) .setInternalRecipe(environment.getRecipe()) .setWarnings(environment.getWarnings()) .setPods(ImmutableMap.of(POD_NAME, pod)) .build(); }</code><technical_language>for InternalInfrastructureException is fit is abnormal situation</technical_language>

Target:
public OpenShiftEnvironment convert(DockerImageEnvironment environment) throws InfrastructureException { final Iterator<String> iterator = environment.getMachines().keySet().iterator(); if (!iterator.hasNext()) { throw new InternalInfrastructureException( "DockerImage environment must contain at least one machine configuration"); } final String machineName = iterator.next(); final String dockerImage = environment.getRecipe().getContent(); final Map<String, String> annotations = new HashMap<>(); annotations.put(format(MACHINE_NAME_ANNOTATION_FMT, CONTAINER_NAME), machineName); final Pod pod = new PodBuilder() .withNewMetadata() .withName(POD_NAME) .withAnnotations(annotations) .endMetadata() .withNewSpec() .withContainers( new ContainerBuilder().withImage(dockerImage).withName(CONTAINER_NAME).build()) .endSpec() .build(); return OpenShiftEnvironment.builder() .setMachines(environment.getMachines()) .setInternalRecipe(environment.getRecipe()) .setWarnings(environment.getWarnings()) .setPods(ImmutableMap.of(POD_NAME, pod)) .build(); }
Source:
<code>public void put(Collection<SinkRecord> records) { if (records.isEmpty()) { return; } final SinkRecord first = records.iterator().next(); final int recordsCount = records.size(); log.trace( "Received records. First record kafka coordinates:({}-{}-{}). Writing them to the " + "database...", recordsCount, first.topic(), first.kafkaPartition(), first.kafkaOffset() ); try { writer.write(records); } catch (SQLException sqle) { log.warn( "Write of records failed, remainingRetries={}", records.size(), remainingRetries, sqle ); String sqleAllMessages = ""; for (Throwable e : sqle) { <START> sqleAllMessages += e.getMessage() + "\n"; <END> } if (remainingRetries == 0) { throw new ConnectException(sqleAllMessages); } else { writer.closeQuietly(); initWriter(); remainingRetries--; context.timeout(config.retryBackoffMs); throw new RetriableException(sqleAllMessages); } } remainingRetries = config.maxRetries; }</code><technical_language>toString method of throwable, if a "null" printed. this be: sqleAllMessages += e + "\n"; If is null, print classname of exception</technical_language>

Target:
public void put(Collection<SinkRecord> records) { if (records.isEmpty()) { return; } final SinkRecord first = records.iterator().next(); final int recordsCount = records.size(); log.trace( "Received records. First record kafka coordinates:({}-{}-{}). Writing them to the " + "database...", recordsCount, first.topic(), first.kafkaPartition(), first.kafkaOffset() ); try { writer.write(records); } catch (SQLException sqle) { log.warn( "Write of records failed, remainingRetries={}", records.size(), remainingRetries, sqle ); String sqleAllMessages = ""; for (Throwable e : sqle) { sqleAllMessages += e + System.lineSeparator(); } if (remainingRetries == 0) { throw new ConnectException(new SQLException(sqleAllMessages)); } else { writer.closeQuietly(); initWriter(); remainingRetries--; context.timeout(config.retryBackoffMs); throw new RetriableException(new SQLException(sqleAllMessages)); } } remainingRetries = config.maxRetries; }
Source:
<code>protected void setupDocks() { final String basicFiltersScreenId = getBasicFiltersScreenId(); if (basicFiltersScreenId != null) { basicFiltersDock = new UberfireDock(UberfireDockPosition.WEST, IconType.FILTER.toString(), new DefaultPlaceRequest(basicFiltersScreenId), getPerspectiveId()).withSize(400).withLabel(Constants.INSTANCE.Filters()); uberfireDocks.add(basicFiltersDock); } final String advancedFiltersScreenId = getAdvancedFiltersScreenId(); if (advancedFiltersScreenId != null) { advancedFiltersDock = new UberfireDock(UberfireDockPosition.WEST, <START> IconType.SEARCH_PLUS.toString(), <END> new DefaultPlaceRequest(advancedFiltersScreenId), getPerspectiveId()).withSize(500).withLabel(Constants.INSTANCE.AdvancedFilters()); uberfireDocks.add(advancedFiltersDock); } final String savedFiltersScreenId = getSavedFiltersScreenId(); if (savedFiltersScreenId != null) { savedFiltersDock = new UberfireDock(UberfireDockPosition.WEST, IconType.STAR_O.toString(), new DefaultPlaceRequest(savedFiltersScreenId), getPerspectiveId()).withSize(400).withLabel(Constants.INSTANCE.SavedFilters()); uberfireDocks.add(savedFiltersDock); } }</code><technical_language>checking designs, _FILTER_ icon a + sign. replicate this here. double check if this is ok use? user if this changing basic filters _SEARCH_ instead</technical_language>

Target:
protected void setupDocks() { final String basicFiltersScreenId = getBasicFiltersScreenId(); if (basicFiltersScreenId != null) { basicFiltersDock = new UberfireDock(UberfireDockPosition.WEST, IconType.FILTER.toString(), new DefaultPlaceRequest(basicFiltersScreenId), getPerspectiveId()).withSize(400).withLabel(Constants.INSTANCE.Filters()); uberfireDocks.add(basicFiltersDock); } final String advancedFiltersScreenId = getAdvancedFiltersScreenId(); if (advancedFiltersScreenId != null) { advancedFiltersDock = new UberfireDock(UberfireDockPosition.WEST, IconType.PLUS_SQUARE_O.toString(), new DefaultPlaceRequest(advancedFiltersScreenId), getPerspectiveId()).withSize(500).withLabel(Constants.INSTANCE.AdvancedFilters()); uberfireDocks.add(advancedFiltersDock); } final String savedFiltersScreenId = getSavedFiltersScreenId(); if (savedFiltersScreenId != null) { savedFiltersDock = new UberfireDock(UberfireDockPosition.WEST, IconType.STAR_O.toString(), new DefaultPlaceRequest(savedFiltersScreenId), getPerspectiveId()).withSize(400).withLabel(Constants.INSTANCE.SavedFilters()); uberfireDocks.add(savedFiltersDock); } }
Source:
<code>public synchronized void stop() { if (initiatedShutdown) { LOG.debug("Job Coordinator shutdown is already in progress!"); return; } LOG.info("Shutting down Job Coordinator..."); initiatedShutdown = true; boolean shutdownSuccessful = false; metrics.isLeader.set(false); try { if (coordinatorListener != null) { coordinatorListener.onJobModelExpired(); } debounceTimer.stopScheduler(); <START> LOG.debug("Shutting down Zk Client."); <END> if (leaderElector.amILeader()) { leaderElector.resignLeadership(); } if (zkUtils != null) { zkUtils.close(); } LOG.debug("Shutting down system admins."); systemAdmins.stop(); LOG.debug("Shutting down metrics."); shutdownMetrics(); if (coordinatorListener != null) { coordinatorListener.onCoordinatorStop(); } shutdownSuccessful = true; } catch (Throwable t) { LOG.error("Encountered errors during job coordinator stop.", t); if (coordinatorListener != null) { coordinatorListener.onCoordinatorFailure(t); } } finally { LOG.info("Job Coordinator shutdown finished with ShutdownComplete=" + shutdownSuccessful); } }</code><technical_language>info</technical_language>

Target:
public void stop() { if (initiatedShutdown.compareAndSet(false, true)) { LOG.info("Shutting down JobCoordinator."); boolean shutdownSuccessful = false; metrics.isLeader.set(false); try { if (coordinatorListener != null) { coordinatorListener.onJobModelExpired(); } debounceTimer.stopScheduler(); if (leaderElector.amILeader()) { LOG.info("Resigning leadership for processorId: " + processorId); leaderElector.resignLeadership(); } LOG.info("Shutting down ZkUtils."); if (zkUtils != null) { zkUtils.close(); } LOG.debug("Shutting down system admins."); systemAdmins.stop(); LOG.debug("Shutting down metrics."); shutdownMetrics(); if (coordinatorListener != null) { coordinatorListener.onCoordinatorStop(); } shutdownSuccessful = true; } catch (Throwable t) { LOG.error("Encountered errors during job coordinator stop.", t); if (coordinatorListener != null) { coordinatorListener.onCoordinatorFailure(t); } } finally { LOG.info("Job Coordinator shutdown finished with ShutdownComplete=" + shutdownSuccessful); } } else { LOG.info("Job Coordinator shutdown is in progress!"); } }
Source:
<code>private Throwable getExceptionCause(Throwable throwable) { if (throwable.getClass().equals(ModuleException.class)) { return throwable.getCause() != null <START> ? suppressIfPresent(throwable.getCause(), MessagingException.class) <END> : new MuleRuntimeException(createStaticMessage(throwable.getMessage())); } else { return throwable; } }</code><technical_language>this correct. this exception is a ModuleException. ignoring subclasses (which is more frequently used)</technical_language>

Target:
private Throwable getExceptionCause(Throwable throwable) { if (throwable.getClass().equals(ModuleException.class)) { return throwable.getCause() != null ? suppressIfPresent(throwable.getCause(), MessagingException.class) : new MuleRuntimeException(createStaticMessage(throwable.getMessage())); } else { return suppressIfPresent(throwable, MessagingException.class); } }
Source:
<code>public boolean performOk() { for (int i= 0; i < fCheckBoxes.size(); i++) { Button button= fCheckBoxes.get(i); String key= (String) button.getData(); IPreferenceStore <START> nextStore = <END> (IPreferenceStore) button.getData(PREFERENCE_STORE_KEY); nextStore.setValue(key, button.getSelection()); } IPreferenceStore store= getPreferenceStore(); for (int i= 0; i < fRadioButtons.size(); i++) { Button button= fRadioButtons.get(i); if (button.getSelection()) { String[] info= (String[]) button.getData(); store.setValue(info[0], info[1]); } } for (int i= 0; i < fTextControls.size(); i++) { Text text= fTextControls.get(i); String key= (String) text.getData(); store.setValue(key, text.getText()); } JavaPlugin.flushInstanceScope(); return super.performOk(); }</code><technical_language>"next"</technical_language>

Target:
public boolean performOk() { for (int i= 0; i < fCheckBoxes.size(); i++) { Button button= fCheckBoxes.get(i); String key= (String) button.getData(); IPreferenceStore buttonPreferenceStore = (IPreferenceStore) button.getData(PREFERENCE_STORE_KEY); buttonPreferenceStore.setValue(key, button.getSelection()); } IPreferenceStore store= getPreferenceStore(); for (int i= 0; i < fRadioButtons.size(); i++) { Button button= fRadioButtons.get(i); if (button.getSelection()) { String[] info= (String[]) button.getData(); store.setValue(info[0], info[1]); } } for (int i= 0; i < fTextControls.size(); i++) { Text text= fTextControls.get(i); String key= (String) text.getData(); store.setValue(key, text.getText()); } JavaPlugin.flushInstanceScope(); return super.performOk(); }
Source:
<code>public HaMaintenanceMode getMode() { <START> return this.mode; <END> }</code><technical_language>minor: I personally 'this' is redundant here</technical_language>

Target:
public HaMaintenanceMode getMode() { return mode; }
Source:
<code>public ProjectNegotiationData( String referencePointID, String projectName, boolean partial, FileList fileList) { this.fileList = fileList; this.referencePointName = projectName; <START> this.projectID = referencePointID; <END> this.partial = partial; }</code><technical_language>rename projectID</technical_language>

Target:
public ProjectNegotiationData( String referencePointID, String projectName, boolean partial, FileList fileList) { this.fileList = fileList; this.referencePointName = projectName; this.referencePointID = referencePointID; this.partial = partial; }
Source:
<code>public String getTableState( @ApiParam(value = "Name of the table to get its state", required = true) @PathParam("tableName") String tableName, @ApiParam(value = "realtime|offline", required = true) @QueryParam("type") String tableTypeStr ) { TableType tableType; try { tableType = TableType.valueOf(tableTypeStr.toUpperCase()); } catch (IllegalArgumentException e) { throw new ControllerApplicationException(LOGGER, "Illegal table type: " + tableTypeStr, Response.Status.BAD_REQUEST); } String tableNameWithType = TableNameBuilder.forType(tableType).tableNameWithType(tableName); try { ObjectNode data = JsonUtils.newObjectNode(); <START> data.put("tableName", tableNameWithType); <END> data.put("state", _pinotHelixResourceManager.isTableEnabled(tableNameWithType) ? "enabled" : "disabled"); return data.toString(); } catch (TableNotFoundException e) { throw new ControllerApplicationException(LOGGER, "Failed to find table: " + tableNameWithType, Response.Status.NOT_FOUND); } }</code><technical_language>dont need return tableName in response do we? return "enabled" "disabled"</technical_language>

Target:
public String getTableState( @ApiParam(value = "Name of the table to get its state", required = true) @PathParam("tableName") String tableName, @ApiParam(value = "realtime|offline", required = true) @QueryParam("type") String tableTypeStr ) { TableType tableType; try { tableType = TableType.valueOf(tableTypeStr.toUpperCase()); } catch (IllegalArgumentException e) { throw new ControllerApplicationException(LOGGER, "Illegal table type: " + tableTypeStr, Response.Status.BAD_REQUEST); } String tableNameWithType = TableNameBuilder.forType(tableType).tableNameWithType(tableName); try { ObjectNode data = JsonUtils.newObjectNode(); data.put("state", _pinotHelixResourceManager.isTableEnabled(tableNameWithType) ? "enabled" : "disabled"); return data.toString(); } catch (TableNotFoundException e) { throw new ControllerApplicationException(LOGGER, "Failed to find table: " + tableNameWithType, Response.Status.NOT_FOUND); } }
Source:
<code>private void validate() { if (countType == VCFHeaderLineCount.INTEGER && count <= 0) throw new IllegalArgumentException(String.format("Invalid count number, with fixed count the number should be 1 or higher: key=%s name=%s type=%s desc=%s lineType=%s count=%s", <START> super.getKey(), name, type, description, lineType, count)); <END> if (name == null || type == null || description == null || lineType == null) throw new IllegalArgumentException(String.format("Invalid VCFCompoundHeaderLine: key=%s name=%s type=%s desc=%s lineType=%s", super.getKey(), name, type, description, lineType)); if (name.contains("<") || name.contains(">")) throw new IllegalArgumentException("VCFHeaderLine: ID cannot contain angle brackets"); if (name.contains("=")) throw new IllegalArgumentException("VCFHeaderLine: ID cannot contain an equals sign"); if (type == VCFHeaderLineType.Flag && count != 0) { count = 0; if (GeneralUtils.DEBUG_MODE_ENABLED) { System.err.println("FLAG fields must have a count value of 0, but saw " + count + " for header line " + getID() + ". Changing it to 0 inside the code"); } } }</code><technical_language>super. is unnecessary getKey() is overridden</technical_language>

Target:
private void validate() { if (type != VCFHeaderLineType.Flag && countType == VCFHeaderLineCount.INTEGER && count <= 0) throw new IllegalArgumentException(String.format("Invalid count number, with fixed count the number should be 1 or higher: key=%s name=%s type=%s desc=%s lineType=%s count=%s", getKey(), name, type, description, lineType, count)); if (name == null || type == null || description == null || lineType == null) throw new IllegalArgumentException(String.format("Invalid VCFCompoundHeaderLine: key=%s name=%s type=%s desc=%s lineType=%s", getKey(), name, type, description, lineType)); if (name.contains("<") || name.contains(">")) throw new IllegalArgumentException("VCFHeaderLine: ID cannot contain angle brackets"); if (name.contains("=")) throw new IllegalArgumentException("VCFHeaderLine: ID cannot contain an equals sign"); if (type == VCFHeaderLineType.Flag && count != 0) { count = 0; if (GeneralUtils.DEBUG_MODE_ENABLED) { System.err.println("FLAG fields must have a count value of 0, but saw " + count + " for header line " + getID() + ". Changing it to 0 inside the code"); } } }
Source:
<code>public void close() { <START> throw new UnsupportedOperationException(format("%s should be closed directly", getClass())); <END> }</code><technical_language>I do get meaning of message. this moved #8263 merged sooner. get rid of default implementation of close() in SpillContext interface. If decide do add #8263</technical_language>

Target:
public void close() { throw new UnsupportedOperationException(format("%s should not be closed directly", getClass())); }
Source:
<code><START> private String formatDate(long date) { <END> return dateFormat.format(new Date(date)); }</code><technical_language>a static method</technical_language>

Target:
private static String formatDate(long date) { return dateFormat.format(new Date(date)); }