auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void destroySession(String sessionName, IProgressMonitor monitor) throws ExecutionException { List<String> command = createCommand(LTTngControlServiceConstants.COMMAND_DESTROY_SESSION, sessionName); ICommandResult result = executeCommand(command, monitor, false); String[] errorOutput = result.getErrorOutput(); if (isError(result) && <START> (errorOutput.length > <END> 0)) { if (ignoredPattern(errorOutput, LTTngControlServiceConstants.SESSION_NOT_FOUND_ERROR_PATTERN)) { return; } throw new ExecutionException(Messages.TraceControl_CommandError + " " + toCommandString(command) + "\n" + result.toString()); } Document doc = getDocumentFromStrings(result.getOutput()); NodeList sessions = doc.getElementsByTagName(MIStrings.SESSION); if (sessions.getLength() != 1) { throw new ExecutionException(NLS.bind(Messages.TraceControl_MiInvalidNumberOfElementError, MIStrings.SESSION)); } Node rawSessionName = getFirstOf(sessions.item(0).getChildNodes(), MIStrings.NAME); if (rawSessionName == null) { throw new ExecutionException(Messages.TraceControl_MiMissingRequiredError); } if (!rawSessionName.getTextContent().equals(sessionName)) { throw new ExecutionException(NLS.bind(Messages.TraceControl_UnexpectedValueError, rawSessionName.getTextContent(), sessionName)); } }</code><technical_language>necessary</technical_language>

Target:
public void destroySession(String sessionName, IProgressMonitor monitor) throws ExecutionException { List<String> command = createCommand(LTTngControlServiceConstants.COMMAND_DESTROY_SESSION, sessionName); ICommandResult result = executeCommand(command, monitor, false); String[] errorOutput = result.getErrorOutput(); if (isError(result)) { if (ignoredPattern(errorOutput, LTTngControlServiceConstants.SESSION_NOT_FOUND_ERROR_PATTERN)) { return; } throw new ExecutionException(Messages.TraceControl_CommandError + " " + toCommandString(command) + "\n" + result.toString()); } Document doc = getDocumentFromStrings(result.getOutput()); NodeList sessions = doc.getElementsByTagName(MIStrings.SESSION); if (sessions.getLength() != 1) { throw new ExecutionException(NLS.bind(Messages.TraceControl_MiInvalidNumberOfElementError, MIStrings.SESSION)); } Node rawSessionName = getFirstOf(sessions.item(0).getChildNodes(), MIStrings.NAME); if (rawSessionName == null) { throw new ExecutionException(Messages.TraceControl_MiMissingRequiredError); } if (!rawSessionName.getTextContent().equals(sessionName)) { throw new ExecutionException(NLS.bind(Messages.TraceControl_UnexpectedValueError, rawSessionName.getTextContent(), sessionName)); } }
Source:
<code>private boolean isSystemUserImport(HttpServletRequest request){ boolean skipRoleCheck = false; String authHeader = request.getHeader("Authorization"); if (authHeader != null && !authHeader.isEmpty()) { StringTokenizer st = new StringTokenizer(authHeader); if (st.hasMoreTokens()) { String basic = st.nextToken(); if (basic.equalsIgnoreCase("Bearer")) { String accessToken = st.nextToken(); final Map<String, Object> decodedToken = tokenService.decodeAndVerify(accessToken); if (accessToken != null && !accessToken.isEmpty()) { LinkedHashMap<String, Object> userContextMap = (LinkedHashMap<String, Object>) decodedToken.get("<LINK_0>"); String userType = (String) userContextMap.get("userType"); if (userType.equals(UserType.SYSTEM.getName())){ String clientId = decodedToken.get("clientId").toString(); <START> if (clientId.equals(ApplicationConstants.RANDOMIZE_CLIENT) || clientId.equalsIgnoreCase(ApplicationConstants.DICOM_CLIENT)){ <END> skipRoleCheck = true; } } } } } } return skipRoleCheck; }</code><technical_language>Apache StringUtils compare</technical_language>

Target:
private boolean isSystemUserImport(HttpServletRequest request){ boolean skipRoleCheck = false; String authHeader = request.getHeader("Authorization"); if (authHeader != null && !authHeader.isEmpty()) { StringTokenizer st = new StringTokenizer(authHeader); if (st.hasMoreTokens()) { String basic = st.nextToken(); if (basic.equalsIgnoreCase("Bearer")) { String accessToken = st.nextToken(); final Map<String, Object> decodedToken = tokenService.decodeAndVerify(accessToken); if (accessToken != null && !accessToken.isEmpty()) { LinkedHashMap<String, Object> userContextMap = (LinkedHashMap<String, Object>) decodedToken.get("<LINK_0>"); String userType = (String) userContextMap.get("userType"); if (userType.equals(UserType.SYSTEM.getName())){ String clientId = decodedToken.get("clientId").toString(); if (StringUtils.equalsIgnoreCase(clientId, ApplicationConstants.RANDOMIZE_CLIENT) || StringUtils.equalsIgnoreCase(clientId, ApplicationConstants.DICOM_CLIENT)){ skipRoleCheck = true; } } } } } } return skipRoleCheck; }
Source:
<code>public QueryRunner<Result<SearchResultValue>> createRunner(Segment adapter) { <START> adapters.add(new SegmentForTesting(adapter.getIdentifier(), adapter.getDataInterval())); <END> return new NoopQueryRunner<Result<SearchResultValue>>(); }</code><technical_language>I _think_ I prefer expecting ReferenceCountingSegment unwrapping a SegmentForTesting. test is coupled implementation, rethink tests abstraction better</technical_language>

Target:
public QueryRunner<Result<SearchResultValue>> createRunner(Segment adapter) { if (!(adapter instanceof ReferenceCountingSegment)) { throw new IAE("Expected instance of ReferenceCountingSegment, got %s", adapter.getClass()); } adapters.add((SegmentForTesting) ((ReferenceCountingSegment) adapter).getBaseSegment()); return new BlockingQueryRunner<Result<SearchResultValue>>( new NoopQueryRunner<Result<SearchResultValue>>(), waitLatch, notifyLatch ); }
Source:
<code>public boolean hasNext() { if (backgroundThread == null) { throw new IllegalStateException("iterator has been closed"); } if (currentBlock.hasNext()) return true; <START> Throwable t = currentBlock.getException(); <END> if (t != null) { if (t instanceof Error) { throw (Error) t; } else if (t instanceof RuntimeException) { throw (RuntimeException) t; } else { throw new RuntimeException(t); } } if (currentBlock.isEndOfStream()) return false; try { currentBlock = buffer.take(); } catch (InterruptedException e) { throw new RuntimeException("Error reading from background thread", e); } return hasNext(); }</code><technical_language>extract this rethrowing a new method</technical_language>

Target:
public boolean hasNext() { if (backgroundThread == null) { throw new IllegalStateException("iterator has been closed"); } ensureHasNext(); return currentBlock.hasNext(); }
Source:
<code>private void addUDFValue(FieldTypeClass fieldType, FieldContainer container, Row row) { Integer fieldId = Integer.valueOf(row.getString("udf_type_id")); String fieldName = m_udfMap.get(fieldId); Object value = null; FieldType field = m_project.getCustomFields().getFieldByAlias(fieldType, fieldName); if (field != null) { DataType fieldDataType = field.getDataType(); switch (fieldDataType) { case DATE: { value = row.getDate("udf_date"); break; } case CURRENCY: case NUMERIC: { value = row.getDouble("udf_number"); break; } case GUID: case INTEGER: { value = row.getInteger("udf_code_id"); break; } case BOOLEAN: { <START> value = STATICTYPE_UDF_MAP.get(row.getString("udf_text")); <END> break; } default: { value = row.getString("udf_text"); break; } } container.set(field, value); } }</code><technical_language>prefer leave original values here, application library choose interpret them</technical_language>

Target:
private void addUDFValue(FieldTypeClass fieldType, FieldContainer container, Row row) { Integer fieldId = Integer.valueOf(row.getString("udf_type_id")); String fieldName = m_udfMap.get(fieldId); Object value = null; FieldType field = m_project.getCustomFields().getFieldByAlias(fieldType, fieldName); if (field != null) { DataType fieldDataType = field.getDataType(); switch (fieldDataType) { case DATE: { value = row.getDate("udf_date"); break; } case CURRENCY: case NUMERIC: { value = row.getDouble("udf_number"); break; } case GUID: case INTEGER: { value = row.getInteger("udf_code_id"); break; } case BOOLEAN: { String text = row.getString("udf_text"); if (text != null) { value = STATICTYPE_UDF_MAP.get(text); if (value == null) { value = Boolean.valueOf(row.getBoolean("udf_text")); } } else { value = Boolean.valueOf(row.getBoolean("udf_number")); } break; } default: { value = row.getString("udf_text"); break; } } container.set(field, value); } }
Source:
<code><START> List<MavenArtifact> fetchMavenArtifacts(Dependency dependency) throws IOException { <END> IOException lastException = null; long sleepingTimeBetweenRetriesInMillis = 1000; int triesLeft = NUMBER_OF_TRIES; while (triesLeft-- > 0) { try { return searcher.searchSha1(dependency.getSha1sum()); } catch (FileNotFoundException fnfe) { throw fnfe; } catch (IOException ioe) { LOGGER.debug("Could not connect to Central search (tries left: {}): {}", triesLeft, ioe.getMessage()); lastException = ioe; if (triesLeft > 0) { try { Thread.sleep(sleepingTimeBetweenRetriesInMillis); sleepingTimeBetweenRetriesInMillis *= 2; } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } } } LOGGER.warn("Finally failed connecting to Central search." + " Giving up after tries. Last exception was: {}", NUMBER_OF_TRIES, lastException); throw lastException; }</code><technical_language>this a protected scope</technical_language>

Target:
protected List<MavenArtifact> fetchMavenArtifacts(Dependency dependency) throws IOException { IOException lastException = null; long sleepingTimeBetweenRetriesInMillis = 1000; int triesLeft = NUMBER_OF_TRIES; while (triesLeft-- > 0) { try { return searcher.searchSha1(dependency.getSha1sum()); } catch (FileNotFoundException fnfe) { throw fnfe; } catch (IOException ioe) { LOGGER.debug("Could not connect to Central search (tries left: {}): {}", triesLeft, ioe.getMessage()); lastException = ioe; if (triesLeft > 0) { try { Thread.sleep(sleepingTimeBetweenRetriesInMillis); sleepingTimeBetweenRetriesInMillis *= 2; } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } } } final String message = "Finally failed connecting to Central search." + " Giving up after " + NUMBER_OF_TRIES + " tries."; throw new IOException(message, lastException); }
Source:
<code>public ContainerCreated createContainer(CreateContainerParams createContainerParams) throws IOException { String containerName = getNormalizedContainerName(createContainerParams); String workspaceID = getCheWorkspaceId(createContainerParams); workspaceID = workspaceID.isEmpty() ? generateWorkspaceID() : workspaceID; String imageName = createContainerParams.getContainerConfig().getImage(); Set<String> containerExposedPorts = createContainerParams.getContainerConfig().getExposedPorts().keySet(); Set<String> imageExposedPorts = inspectImage(imageName).getConfig().getExposedPorts().keySet(); <START> Set<String> exposedPorts = new HashSet<>(); <END> exposedPorts.addAll(containerExposedPorts); exposedPorts.addAll(imageExposedPorts); boolean runContainerAsRoot = runContainerAsRoot(imageName); String[] envVariables = createContainerParams.getContainerConfig().getEnv(); String[] volumes = createContainerParams.getContainerConfig().getHostConfig().getBinds(); Map<String, String> additionalLabels = createContainerParams.getContainerConfig().getLabels(); createOpenShiftService(workspaceID, exposedPorts, additionalLabels); String deploymentName = createOpenShiftDeployment(workspaceID, imageName, containerName, exposedPorts, envVariables, volumes, runContainerAsRoot); String containerID = waitAndRetrieveContainerID(deploymentName); if (containerID == null) { throw new RuntimeException("Failed to get the ID of the container running in the OpenShift pod"); } return new ContainerCreated(containerID, null); }</code><technical_language>do size of hashet set expected size</technical_language>

Target:
public ContainerCreated createContainer(CreateContainerParams createContainerParams) throws IOException { String containerName = getNormalizedContainerName(createContainerParams); String workspaceID = getCheWorkspaceId(createContainerParams); workspaceID = workspaceID.isEmpty() ? generateWorkspaceID() : workspaceID; String imageName = createContainerParams.getContainerConfig().getImage(); Set<String> containerExposedPorts = createContainerParams.getContainerConfig().getExposedPorts().keySet(); Set<String> imageExposedPorts = inspectImage(imageName).getConfig().getExposedPorts().keySet(); Set<String> exposedPorts = getExposedPorts(containerExposedPorts, imageExposedPorts); boolean runContainerAsRoot = runContainerAsRoot(imageName); String[] envVariables = createContainerParams.getContainerConfig().getEnv(); String[] volumes = createContainerParams.getContainerConfig().getHostConfig().getBinds(); Map<String, String> additionalLabels = createContainerParams.getContainerConfig().getLabels(); createOpenShiftService(workspaceID, exposedPorts, additionalLabels); String deploymentName = createOpenShiftDeployment(workspaceID, imageName, containerName, exposedPorts, envVariables, volumes, runContainerAsRoot); String containerID = waitAndRetrieveContainerID(deploymentName); if (containerID == null) { throw new OpenShiftException("Failed to get the ID of the container running in the OpenShift pod"); } return new ContainerCreated(containerID, null); }
Source:
<code>public String toString() { <START> return "CHUNKED_FIXED_SIZE"; <END> }</code><technical_language>if lesst magic constant toString instead</technical_language>

Target:
public String toString() { return "ChunkedNumberArrayFactory with delegate " + delegate; }
Source:
<code>public boolean needsAuthentication() { <START> return ((loginToken == null && apiKey == null) || super.needsAuthentication()); <END> }</code><technical_language>this check "" case? Consider Guava Strings.isNullOrEmpty</technical_language>

Target:
public boolean needsAuthentication() { return ((loginToken == null && Strings.isNullOrEmpty(apiKey)) || super.needsAuthentication()); }
Source:
<code>public void onMessage(ScheduleCheckMessage message) { LOGGER.debug("ScheduleCheckMessage for " + message.getPipelineName() + " is received"); try { schedulingPerformanceLogger.pickedUpPipelineForScheduleCheck(message.trackingId(), message.getPipelineName()); producer.autoSchedulePipeline(message.getPipelineName(), new ServerHealthStateOperationResult(), message.trackingId()); <START> LOGGER.debug("Finished checking for pipeline " + message.getPipelineName()); <END> } catch (Exception e) { LOGGER.error(e.getMessage(), e); throw new RuntimeException(e); } finally { checkCompletedTopic.post(new ScheduleCheckCompletedMessage(message.getPipelineName(), message.trackingId())); schedulingPerformanceLogger.postingMessageAboutScheduleCheckCompletion(message.trackingId(), message.getPipelineName()); LOGGER.debug("Finished posting materialCheckCompletedMessage for pipeline " + message.getPipelineName()); } }</code><technical_language>change</technical_language>

Target:
public void onMessage(ScheduleCheckMessage message) { LOGGER.debug("ScheduleCheckMessage for is received", message.getPipelineName()); try { schedulingPerformanceLogger.pickedUpPipelineForScheduleCheck(message.trackingId(), message.getPipelineName()); producer.autoSchedulePipeline(message.getPipelineName(), new ServerHealthStateOperationResult(), message.trackingId()); LOGGER.debug("Finished checking for pipeline {}", message.getPipelineName()); } catch (Exception e) { LOGGER.error(e.getMessage(), e); throw new RuntimeException(e); } finally { checkCompletedTopic.post(new ScheduleCheckCompletedMessage(message.getPipelineName(), message.trackingId())); schedulingPerformanceLogger.postingMessageAboutScheduleCheckCompletion(message.trackingId(), message.getPipelineName()); LOGGER.debug("Finished posting materialCheckCompletedMessage for pipeline {}", message.getPipelineName()); } }
Source:
<code>private void assertMessageEventExecutionSet(InterruptingMessageEventExecutionSet executionSet, String eventName, boolean isInterrupting, String slaDueDate) { assertNotNull(executionSet); assertNotNull(executionSet.getMessageRef()); assertEquals(eventName, executionSet.getMessageRef().getValue()); <START> if (getMarshallerType() == Marshaller.NEW) { <END> assertNotNull(executionSet.getIsInterrupting()); assertEquals(isInterrupting, executionSet.getIsInterrupting().getValue()); assertNotNull(executionSet.getSlaDueDate()); assertEquals(slaDueDate, executionSet.getSlaDueDate().getValue()); } }</code><technical_language>other hand this code works for new marshallers</technical_language>

Target:
private void assertMessageEventExecutionSet(InterruptingMessageEventExecutionSet executionSet, String eventName, boolean isInterrupting, String slaDueDate) { assertNotNull(executionSet); assertNotNull(executionSet.getMessageRef()); assertEquals(eventName, executionSet.getMessageRef().getValue()); assertStartEventIsInterrupting(executionSet, isInterrupting); assertStartEventSlaDueDate(executionSet, slaDueDate); }
Source:
<code>protected String generateId() { String id = Long.toString(new Date().getTime()%100000); <START> return id; <END> }</code><technical_language>id is once; simplify return <expr> "" + x is more concise Long.toString(x)</technical_language>

Target:
protected String generateId() { return "" + (new Date().getTime() % 100000); }
Source:
<code>protected ServiceInstance mapApplicationInstanceToServiceInstance( Tuple2<ApplicationDetail, InstanceDetail> tuple) { ApplicationDetail applicationDetail = tuple.getT1(); InstanceDetail instanceDetail = tuple.getT2(); String applicationId = applicationDetail.getId(); String applicationIndex = instanceDetail.getIndex(); String instanceId = applicationId + "." + applicationIndex; String name = applicationDetail.getName(); String url = applicationDetail.getUrls().size() > 0 ? applicationDetail.getUrls().get(0) : null; boolean secure = (url + "").toLowerCase().startsWith("https"); HashMap<String, String> metadata = new HashMap<>(); metadata.put("applicationId", applicationId); metadata.put("instanceId", applicationIndex); <START> return new DefaultServiceInstance(instanceId, name, url, 80, secure, metadata); <END> }</code><technical_language>80 set secure variable</technical_language>

Target:
protected ServiceInstance mapApplicationInstanceToServiceInstance( Tuple2<ApplicationDetail, InstanceDetail> tuple) { ApplicationDetail applicationDetail = tuple.getT1(); InstanceDetail instanceDetail = tuple.getT2(); String applicationId = applicationDetail.getId(); String applicationIndex = instanceDetail.getIndex(); String instanceId = applicationId + "." + applicationIndex; String name = applicationDetail.getName(); String url = applicationDetail.getUrls().size() > 0 ? applicationDetail.getUrls().get(0) : null; boolean secure = (url + "").toLowerCase().startsWith("https"); HashMap<String, String> metadata = new HashMap<>(); metadata.put("applicationId", applicationId); metadata.put("instanceId", applicationIndex); return new DefaultServiceInstance(instanceId, name, url, secure ? 443 : 80, secure, metadata); }
Source:
<code>public void aCreateAndUpdateStandaloneTaskForUser() { String authenticatedUserId = securityManager.getAuthenticatedUserId(); Task standaloneTask = taskRuntime.create(TaskPayloadBuilder.create() .withName("test task update") .withDescription("test task update description") .withDueDate(new Date()) .withPriority(50) .withAssignee(authenticatedUserId) .build()); assertThat(RuntimeTestConfiguration.createdTasks).contains(standaloneTask.getId()); Page<Task> tasks = taskRuntime.tasks(Pageable.of(0, 50)); <START> assertThat(tasks.getTotalItems()).isEqualTo(1); <END> assertThat(tasks.getContent()).containsOnly(standaloneTask) .extracting("status", "assignee") .contains(tuple(Task.TaskStatus.ASSIGNED, authenticatedUserId)); final Task updatedTask = taskRuntime.update(TaskPayloadBuilder.update() .withTaskId(standaloneTask.getId()) .withName(standaloneTask.getName() + " [UPDATED]") .withPriority(60) .withDueDate(new Date()) .withDescription(standaloneTask.getDescription() + " [UPDATED]") .build()); tasks = taskRuntime.tasks(Pageable.of(0, 50)); assertThat(RuntimeTestConfiguration.updatedTasks).contains(updatedTask.getId()); assertThat(tasks.getTotalItems()).isEqualTo(1); assertThat(tasks.getContent()) .filteredOn("status", Task.TaskStatus.ASSIGNED) .containsOnly(updatedTask); }</code><technical_language>IMO this assertion is necessary</technical_language>

Target:
public void aCreateAndUpdateStandaloneTaskForUser() { String authenticatedUserId = securityManager.getAuthenticatedUserId(); Task standaloneTask = taskRuntime.create(TaskPayloadBuilder.create() .withName("test task update") .withDescription("test task update description") .withDueDate(new Date()) .withPriority(50) .withAssignee(authenticatedUserId) .build()); assertThat(RuntimeTestConfiguration.createdTasks).contains(standaloneTask.getId()); Page<Task> tasks = taskRuntime.tasks(Pageable.of(0, 50)); assertThat(tasks.getContent()).containsOnly(standaloneTask) .extracting("status", "assignee") .contains(tuple(Task.TaskStatus.ASSIGNED, authenticatedUserId)); final Task updatedTask = taskRuntime.update(TaskPayloadBuilder.update() .withTaskId(standaloneTask.getId()) .withName(standaloneTask.getName() + " [UPDATED]") .withPriority(60) .withDueDate(new Date()) .withDescription(standaloneTask.getDescription() + " [UPDATED]") .build()); tasks = taskRuntime.tasks(Pageable.of(0, 50)); assertThat(RuntimeTestConfiguration.updatedTasks).contains(updatedTask.getId()); assertThat(tasks.getTotalItems()).isEqualTo(1); assertThat(tasks.getContent()) .filteredOn("status", Task.TaskStatus.ASSIGNED) .containsOnly(updatedTask); }
Source:
<code>public String getBigImage() { <START> return nullIfEmpty(image.getUrl()); <END> }</code><technical_language>benefit of returning null instead of empty string template</technical_language>

Target:
public String getBigImage() { return trimToNull(image.getUrl()); }
Source:
<code><START> public void setFailure(Throwable failure) { <END> if (failure == null) { failure = new Exception(); } synchronized (resultLock) { this.failure = failure; if (! setDone()) { return; } } listenerHelper.callListeners(); }</code><technical_language>change overloaded variable name failure here</technical_language>

Target:
public void setFailure(Throwable failure) { synchronized (resultLock) { if (! setDone()) { return; } if (failure == null) { failure = new Exception(); } this.failure = failure; } listenerHelper.callListeners(); }
Source:
<code>public void should_create_list_codec_for_cql_type_and_empty_java_value() { ListType cqlType = DataTypes.listOf(DataTypes.listOf(DataTypes.INT)); <START> List<List<Integer>> value = Collections.emptyList(); <END> TestCachingCodecRegistry registry = new TestCachingCodecRegistry(mockCache); InOrder inOrder = inOrder(mockCache); TypeCodec<List<List<Integer>>> codec = registry.codecFor(cqlType, value); assertThat(codec).isNotNull(); assertThat(codec.accepts(value)).isTrue(); codec.encode(value, ProtocolVersion.DEFAULT); inOrder.verify(mockCache).lookup(null, GenericType.listOf(GenericType.BOOLEAN), false); }</code><technical_language>I tests more meaningful if enclosing collection empty enclosed was</technical_language>

Target:
public void should_create_list_codec_for_cql_type_and_empty_java_value() { ListType cqlType = DataTypes.listOf(DataTypes.listOf(DataTypes.INT)); GenericType<List<List<Integer>>> javaType = GenericType.listOf(GenericType.listOf(GenericType.INTEGER)); List<List<Integer>> value = Collections.singletonList(Collections.emptyList()); TestCachingCodecRegistry registry = new TestCachingCodecRegistry(mockCache); InOrder inOrder = inOrder(mockCache); TypeCodec<List<List<Integer>>> codec = registry.codecFor(cqlType, value); assertThat(codec).isNotNull(); assertThat(codec.accepts(cqlType)).isTrue(); assertThat(codec.accepts(javaType)).isTrue(); assertThat(codec.accepts(value)).isTrue(); codec.encode(value, ProtocolVersion.DEFAULT); inOrder.verify(mockCache).lookup(cqlType, javaType, true); }
Source:
<code>protected void log(final Level level, final String msg, final Throwable t) { <START> this.logger.log(level, this.simpleName + " " + msg, t); <END> }</code><technical_language>warning: static field AbstractProcessor.logger accessed in a static way</technical_language>

Target:
protected void log(final Level level, final String msg, final Throwable t) { this.LOGGER.log(level, this.simpleName + " " + msg, t); }
Source:
<code>private AdHocPlannedStatement planTask(SqlTask task) throws PlanningErrorException, PlannerFallbackException { final PlannerTool ptool = m_catalogContext.m_ptool; assert(ptool != null); try { return ptool.planSqlCalcite(task); } catch (PlannerFallbackException ex) { throw ex; } catch (ValidationException vex) { <START> throw new PlannerFallbackException(); <END> } catch (Exception ex) { Throwable cause = ex.getCause(); while(cause != null && cause.getCause() != null) { cause = cause.getCause(); } throw new PlanningErrorException(ex.getMessage(), cause); } catch (StackOverflowError error) { throw new PlanningErrorException("Encountered stack overflow error. " + "Try reducing the number of predicate expressions in the query."); } catch (AssertionError ae) { String msg = "An unexpected internal error occurred when planning a statement issued via @AdHoc. " + "Please contact VoltDB at support@voltdb.com with your log files."; StringWriter stringWriter = new StringWriter(); PrintWriter writer = new PrintWriter(stringWriter); ae.printStackTrace(writer); String stackTrace = stringWriter.toString(); m_batch.getContext().getLogger().error(msg + "\n" + stackTrace); throw new PlanningErrorException(msg); } }</code><technical_language>I fallback here. ValidationException fails calcite validation. want mute validation exceptions. If some cases handle now, add a black-list message pattern fall-back those</technical_language>

Target:
private AdHocPlannedStatement planTask(SqlTask task) throws PlanningErrorException, PlannerFallbackException { final PlannerTool ptool = m_catalogContext.m_ptool; assert(ptool != null); try { return ptool.planSqlCalcite(task); } catch (PlannerFallbackException ex) { throw ex; } catch (Exception ex) { if (ex.getMessage().contains("class org.apache.calcite.sql.SqlDynamicParam: ?")) { throw new PlannerFallbackException(); } Throwable cause = ex.getCause(); while(cause != null && cause.getCause() != null) { cause = cause.getCause(); } if (cause.getMessage().contains("class org.apache.calcite.sql.SqlDynamicParam: ?")) { throw new PlannerFallbackException(); } throw new PlanningErrorException(ex.getMessage(), cause); } catch (StackOverflowError error) { throw new PlanningErrorException("Encountered stack overflow error. " + "Try reducing the number of predicate expressions in the query."); } catch (AssertionError ae) { String msg = "An unexpected internal error occurred when planning a statement issued via @AdHoc. " + "Please contact VoltDB at support@voltdb.com with your log files."; StringWriter stringWriter = new StringWriter(); PrintWriter writer = new PrintWriter(stringWriter); ae.printStackTrace(writer); String stackTrace = stringWriter.toString(); m_batch.getContext().getLogger().error(msg + "\n" + stackTrace); throw new PlanningErrorException(msg); } }
Source:
<code>public ListenableFuture<Map<Cell, byte[]>> getAsync(TableReference tableRef, Set<Cell> cells) { <START> return Futures.transform(super.getAsync(tableRef, cells), <END> ret -> { markCellsRead(tableRef, cells, ret); return ret; }, MoreExecutors.directExecutor()); }</code><technical_language>here, figure out if extract copy</technical_language>

Target:
public ListenableFuture<Map<Cell, byte[]>> getAsync(TableReference tableRef, Set<Cell> cells) { return getWithLoader(tableRef, cells, super::getAsync); }
Source:
<code>public String post(@RequestParam(value = "causeOfDeath",required = false) String causeOfDeath, @RequestParam(value = "dead",required = false) Boolean dead, @RequestParam(value = "deathDate",required = false) Date deathDate, @RequestParam("patientId") String patientId) { PersonService personService = Context.getPersonService(); try { PatientService patientService = Context.getPatientService(); Patient patient = patientService.getPatientByUuid(patientId); <START> Person person = personService.getPerson(patient.getPatientId()); <END> Date date=new Date(); if (dead!=null && !causeOfDeath.equals("null") && deathDate != null && !deathDate.before(person.getBirthdate()) && !deathDate.after(date)) { person.setDead(dead); person.setCauseOfDeath(getConceptByUUId(causeOfDeath)); person.setDeathDate(deathDate); } else { person.setDeathDate(null); person.setDead(false); person.setCauseOfDeath(null); } personService.savePerson(person); return "redirect:/coreapps/clinicianfacing/patient.page?patientId=" + patient.getUuid() + ""; } catch (Exception e) { System.out.println(e); return null; } }</code><technical_language>@slubwama Patient extends Person call methods for person</technical_language>

Target:
public String post(@RequestParam(value = "causeOfDeath", required = false) String causeOfDeath, @RequestParam(value = "dead", required = false) Boolean dead, @RequestParam(value = "deathDate", required = false) Date deathDate, @RequestParam("patientId") String patientId) { PatientService patientService = Context.getPatientService(); Patient patient = patientService.getPatientByUuid(patientId); try { Date date = new Date(); if (dead != null && !causeOfDeath.equals("") && deathDate != null && !deathDate.before(patient.getBirthdate()) && !deathDate.after(date)) { patient.setDead(dead); patient.setCauseOfDeath(getConceptByUUId(causeOfDeath)); patient.setDeathDate(deathDate); } else { patient.setDeathDate(null); patient.setDead(false); patient.setCauseOfDeath(null); } patientService.savePatient(patient); return "redirect:/coreapps/clinicianfacing/patient.page?patientId=" + patient.getUuid() + ""; } catch (Exception e) { log.error(e.getMessage()); return "redirect:/aijar/markPatientDead.page?patientId={{" + patient.getUuid() + "}}"; } }
Source:
<code>void executeSingleUpload(final S3BlobStore blobStore, final String blobName, final InputStream input, final long blobSize) throws IOException { if (blobSize > MAX_FILE_SIZE.getBytes()) { throw new IllegalArgumentException("Upload request size [" + blobSize + "] can't be larger than " + MAX_FILE_SIZE); } if (blobSize > blobStore.bufferSizeInBytes()) { throw new IllegalArgumentException("Upload request size [" + blobSize + "] can't be larger than buffer size"); } final ObjectMetadata md = new ObjectMetadata(); md.setContentLength(blobSize); if (blobStore.serverSideEncryption()) { md.setSSEAlgorithm(ObjectMetadata.AES_256_SERVER_SIDE_ENCRYPTION); } final PutObjectRequest putRequest = new PutObjectRequest(blobStore.bucket(), blobName, input, md); putRequest.setStorageClass(blobStore.getStorageClass()); putRequest.setCannedAcl(blobStore.getCannedACL()); try (AmazonS3Reference clientReference = blobStore.clientReference()) { clientReference.client().putObject(putRequest); } catch (final AmazonClientException e) { <START> if (!this.blobStore.getRepositoryMetaData().settings().hasValue(S3RepositorySettings.ACCESS_KEY_SETTING.getKey()) && <END> !this.blobStore.getRepositoryMetaData().settings().hasValue(S3RepositorySettings.SECRET_KEY_SETTING.getKey()) ) { throw new BlobStoreException("Cannot find required credentials to create a repository of type s3. " + "Credentials must be provided either as repository options access_key and secret_key or AWS IAM roles."); } else { throw new IOException("Unable to upload object [" + blobName + "] using a single upload", e); } } }</code><technical_language>Is executeSingleUpload right place for it? delete blob, read blob, other methods of BlobContainer. Is do in S3ClientSettings</technical_language>

Target:
void executeSingleUpload(final S3BlobStore blobStore, final String blobName, final InputStream input, final long blobSize) throws IOException { if (blobSize > MAX_FILE_SIZE.getBytes()) { throw new IllegalArgumentException("Upload request size [" + blobSize + "] can't be larger than " + MAX_FILE_SIZE); } if (blobSize > blobStore.bufferSizeInBytes()) { throw new IllegalArgumentException("Upload request size [" + blobSize + "] can't be larger than buffer size"); } final ObjectMetadata md = new ObjectMetadata(); md.setContentLength(blobSize); if (blobStore.serverSideEncryption()) { md.setSSEAlgorithm(ObjectMetadata.AES_256_SERVER_SIDE_ENCRYPTION); } final PutObjectRequest putRequest = new PutObjectRequest(blobStore.bucket(), blobName, input, md); putRequest.setStorageClass(blobStore.getStorageClass()); putRequest.setCannedAcl(blobStore.getCannedACL()); try (AmazonS3Reference clientReference = blobStore.clientReference()) { clientReference.client().putObject(putRequest); } catch (final AmazonClientException e) { throw new IOException("Unable to upload object [" + blobName + "] using a single upload", e); } }
Source:
<code>public boolean isConnected(String context) { <START> return (getChannel(context) != null); <END> }</code><technical_language>suggestion return getChannel(context) != null;</technical_language>

Target:
public boolean isConnected(String context) { ManagedChannel channel = channels.get(context); return channel != null && !channel.isShutdown(); }
Source:
<code>public GetCrossColoParallelOperationPolicy(String datacenterName, PartitionId partitionId, int parallelism, OperationContext oc) throws CoordinatorException { super(datacenterName, partitionId, true); super.successTarget = 1; super.requestParallelism = parallelism; this.localDataCenterName = datacenterName; this.coordinatorMetrics = oc.getCoordinatorMetrics(); this.remainingReplicaCount = replicaIdCount; replicaListPerDatacenter = new HashMap<String, List<ReplicaId>>(); replicasInFlightPerDatacenter = new HashMap<String, List<ReplicaId>>(); Map<String, Integer> availableReplicaCountPerDatacenter = new HashMap<String, Integer>(); List<ReplicaId> replicaIds = partitionId.getReplicaIds(); for (ReplicaId replicaId : replicaIds) { addReplicaToDataCenter(replicaId, availableReplicaCountPerDatacenter); } <START> remoteDataCenterCount += replicaListPerDatacenter.size() - 1; <END> shuffleAndPopulate(availableReplicaCountPerDatacenter); }</code><technical_language>+= is a bit misleading, this '='</technical_language>

Target:
public GetCrossColoParallelOperationPolicy(String datacenterName, PartitionId partitionId, int parallelism, OperationContext oc) throws CoordinatorException { super(datacenterName, partitionId, true); super.successTarget = 1; super.requestParallelism = parallelism; this.localDataCenterName = datacenterName; this.coordinatorMetrics = oc.getCoordinatorMetrics(); this.remainingReplicaCount = replicaIdCount; replicaListPerDatacenter = new HashMap<String, List<ReplicaId>>(); replicasInFlightPerDatacenter = new HashMap<String, List<ReplicaId>>(); Map<String, Integer> availableReplicasCountPerDatacenter = new HashMap<String, Integer>(); populateReplicaListPerDatacenter(partitionId.getReplicaIds(), availableReplicasCountPerDatacenter); remoteDataCenterCount = replicaListPerDatacenter.size() - 1; shuffleAndPopulate(availableReplicasCountPerDatacenter); }
Source:
<code>public RemoveUnregisteredVmCommand(T parameters, CommandContext cmdContext) { super(parameters, cmdContext); <START> setStorageDomainId(parameters.getStorageDomainId()); <END> }</code><technical_language>done in super</technical_language>

Target:
public RemoveUnregisteredVmCommand(T parameters, CommandContext cmdContext) { super(parameters, cmdContext); }
Source:
<code>public String getOpenArgString() { <START> return openArg; <END> }</code><technical_language>this</technical_language>

Target:
public String getOpenArgString() { return this.openArg; }
Source:
<code>public void reportUsedIUs(Collection<IInstallableUnit> usedUnits) { if (localMetadataRepository.getConsider() == Consider.DEFAULT) { warnAboutLocalIus(usedUnits); <START> } <END> }</code><technical_language>In else case, debug output instead</technical_language>

Target:
public void reportUsedIUs(Collection<IInstallableUnit> usedUnits) { final Set<IInstallableUnit> localIUs = localMetadataRepository.query(QueryUtil.ALL_UNITS, null).toSet(); localIUs.retainAll(usedUnits); if (!localIUs.isEmpty()) { Boolean consider = localMetadataRepository.getConsider(); log(consider, "The following locally built units have been used to resolve project dependencies:"); for (IInstallableUnit localIu : localIUs) { log(consider, " " + localIu.getId() + "/" + localIu.getVersion()); } } }
Source:
<code>public void executeCommand(UICommand command) { super.executeCommand(command); if(command.equals(getNewSessionCommand())) { } else if(command.equals(getRemoveSessionCommand())) { } else if(command.equals(getStartSessionCommand())) { startGeoRepSession(); } else if(command.equals(getStopSessionCommand())) { } else if(command.equals(getSessionOptionsCommand())) { } else if(command.equals(getViewSessionDetailsCommand())) { } else if(command.getName().equalsIgnoreCase("createSession")) { setWindow(null); } else if(command.getName().equalsIgnoreCase("close")) { setWindow(null); } else if(command.getName().equalsIgnoreCase("closeConfirmWindow")) { setConfirmWindow(null); } else if(command.getName().equalsIgnoreCase("closeConfirmationWindow")) { <START> closeConfirmationWindow(); <END> } else if(command.getName().equalsIgnoreCase("onStartGeoRepSession")) { onStartGeoRepSession(); } else if(command.getName().equalsIgnoreCase("closeWindow")) { closeWindow(); } }</code><technical_language>duplicate of "closeConfirmWindow"</technical_language>

Target:
public void executeCommand(UICommand command) { super.executeCommand(command); if(command.equals(getNewSessionCommand())) { } else if(command.equals(getRemoveSessionCommand())) { } else if(command.equals(getStartSessionCommand())) { startGeoRepSession(); } else if(command.equals(getStopSessionCommand())) { } else if(command.equals(getSessionOptionsCommand())) { } else if(command.equals(getViewSessionDetailsCommand())) { } else if (command.equals(getRefreshSessionsCommand())) { refreshSessions(); } else if(command.getName().equalsIgnoreCase("createSession")) { setWindow(null); } else if(command.getName().equalsIgnoreCase("closeConfirmationWindow")) { closeConfirmationWindow(); } else if(command.getName().equalsIgnoreCase("onStartGeoRepSession")) { onStartGeoRepSession(); } else if(command.getName().equalsIgnoreCase("closeWindow")) { closeWindow(); } }
Source:
<code>public void testThriftServerStop() throws Exception { int nThreads = NUM_CLIENTS; ExecutorService executorService = Executors.newFixedThreadPool(nThreads); for (int i = 0; i < nThreads; ++i) { executorService.submit(new Runnable() { @Override public void run() { try { TransactionSystemClient client1 = getClient(); CLIENTS_DONE_LATCH.countDown(); client1.startShort(); } catch (Exception e) { } } }); } CLIENTS_DONE_LATCH.await(); TimeUnit.SECONDS.sleep(1); expireZkSession(zkClientService); waitForThriftTermination(); zkClientService.stopAndWait(); STORAGE_WAIT_LATCH.countDown(); TimeUnit.SECONDS.sleep(1); <START> Assert.assertEquals(Service.State.TERMINATED, txService.thriftRPCServerState()); <END> }</code><technical_language>move this assertion waitForThriftTermination method? hoping in (while zkClientService shuts down), zkClientService shift TERMINATED state</technical_language>

Target:
public void testThriftServerStop() throws Exception { int nThreads = NUM_CLIENTS; ExecutorService executorService = Executors.newFixedThreadPool(nThreads); for (int i = 0; i < nThreads; ++i) { executorService.submit(new Runnable() { @Override public void run() { try { TransactionSystemClient txClient = getClient(); CLIENTS_DONE_LATCH.countDown(); txClient.startShort(); } catch (Exception e) { } } }); } CLIENTS_DONE_LATCH.await(); TimeUnit.SECONDS.sleep(1); expireZkSession(zkClientService); waitForThriftTermination(); zkClientService.stopAndWait(); STORAGE_WAIT_LATCH.countDown(); TimeUnit.SECONDS.sleep(1); Assert.assertEquals(Service.State.TERMINATED, txService.thriftRPCServerState()); }
Source:
<code>public void testDownloadUrlWithChangeToken() throws IOException { String repositoryName = "test"; try (CloseableCoreSession session = CoreInstance.openCoreSession(repositoryName)) { Framework.getProperties().setProperty("nuxeo.url", "http://localhost:8080/nuxeo"); DocumentModel doc = session.createDocumentModel("/", "James-Bond", "File"); doc.setProperty("dublincore", "title", "Spectre"); FileBlob blob = new FileBlob("Synopsis"); String blobFilename = "synopsis.txt"; blob.setFilename(blobFilename); Map<String, Object> fileMap = new HashMap<>(); fileMap.put("file", blob); List<Map<String, Object>> docFiles = new ArrayList<>(); docFiles.add(fileMap); doc.setProperty("files", "files", docFiles); doc = session.createDocument(doc); session.save(); String url = downloadService.getDownloadUrl(repositoryName, doc.getId(), "file:content", "synopsis.txt", doc.getChangeToken()); <START> String pattern = "nxfile/test/.*/file:content/synopsis.txt\\?changeToken=[0-9]+-[0-9]+"; <END> assertTrue(url.matches(pattern)); } }</code><technical_language>change token is supposed opaque match [^&]+ here</technical_language>

Target:
public void testDownloadUrlWithChangeToken() throws IOException { String repositoryName = "test"; try (CloseableCoreSession session = CoreInstance.openCoreSession(repositoryName)) { Framework.getProperties().setProperty("nuxeo.url", "http://localhost:8080/nuxeo"); DocumentModel doc = session.createDocumentModel("/", "James-Bond", "File"); doc.setProperty("dublincore", "title", "Spectre"); FileBlob blob = new FileBlob("Synopsis"); String blobFilename = "synopsis.txt"; blob.setFilename(blobFilename); Map<String, Object> fileMap = new HashMap<>(); fileMap.put("file", blob); List<Map<String, Object>> docFiles = new ArrayList<>(); docFiles.add(fileMap); doc.setProperty("files", "files", docFiles); doc = session.createDocument(doc); session.save(); String pattern = "nxfile/test/.*/file:content/synopsis.txt\\?changeToken=[^&]+"; String url = downloadService.getDownloadUrl(repositoryName, doc.getId(), "file:content", "synopsis.txt", doc.getChangeToken()); assertTrue(url.matches(pattern)); url = downloadService.getDownloadUrl(doc, "file:content", "synopsis.txt"); assertTrue(url.matches(pattern)); } }
Source:
<code>public static PackageLibraryType typeOfLibrary(Session session, String library) { FileSystemItem projectDir = null; SessionInfo sessionInfo = session.getSessionInfo(); if (sessionInfo != null) projectDir = sessionInfo.getActiveProjectDir(); String rLibsUser = sessionInfo.getRLibsUser(); <START> boolean hasRLibsUser = (rLibsUser != null && !rLibsUser.isEmpty()); <END> if (StringUtil.isNullOrEmpty(library) || (projectDir != null && library.startsWith(projectDir.getPath()))) { return PackageLibraryType.Project; } else if (library.startsWith(FileSystemItem.HOME_PATH) || (hasRLibsUser && library.startsWith(rLibsUser))) { return PackageLibraryType.User; } else { return PackageLibraryType.System; } }</code><technical_language>Nit: a helper for this pattern (StringUtil.isNullOrEmpty())</technical_language>

Target:
public static PackageLibraryType typeOfLibrary(Session session, String library) { FileSystemItem projectDir = null; SessionInfo sessionInfo = session.getSessionInfo(); if (sessionInfo != null) projectDir = sessionInfo.getActiveProjectDir(); String rLibsUser = sessionInfo.getRLibsUser(); boolean hasRLibsUser = !StringUtil.isNullOrEmpty(rLibsUser); if (StringUtil.isNullOrEmpty(library) || (projectDir != null && library.startsWith(projectDir.getPath()))) { return PackageLibraryType.Project; } else if (library.startsWith(FileSystemItem.HOME_PATH) || (hasRLibsUser && library.startsWith(rLibsUser))) { return PackageLibraryType.User; } else { return PackageLibraryType.System; } }
Source:
<code>private Map<String, String> createInitParams() { String[] initParamKeys = securityFilterServiceReference.getPropertyKeys(); final String PROPERTY_INIT_PREFIX = "init-prefix"; String initPrefixProp = getStringProperty(securityFilterServiceReference, PROPERTY_INIT_PREFIX); if (initPrefixProp == null) { final String DEFAULT_INIT_PREFIX_PROP = "init."; initPrefixProp = DEFAULT_INIT_PREFIX_PROP; } Map<String, String> initParameters = new HashMap<>(); for (String key : initParamKeys) { String value = securityFilterServiceReference.getProperty(key) == null ? "" : securityFilterServiceReference.getProperty(key).toString(); <START> final String HTTP_WHITEBOARD_SERVLET_INIT_PARAM_PREFIX = "servlet\\.init\\."; <END> if (key.startsWith(initPrefixProp)) { initParameters.put(key.replaceFirst(initPrefixProp, ""), value); } else if (key.startsWith(HTTP_WHITEBOARD_SERVLET_INIT_PARAM_PREFIX)) { initParameters.put( key.replaceFirst(HTTP_WHITEBOARD_SERVLET_INIT_PARAM_PREFIX, ""), value); } } return initParameters; }</code><technical_language>I issue here. escaping is good for call replaceFirst() expects a regex for startsWith() doesn't. I original code ok test for startsWith() checked actual dot (i.e. .) characters</technical_language>

Target:
private Map<String, String> createInitParams() { String[] initParamKeys = securityFilterServiceReference.getPropertyKeys(); final String PROPERTY_INIT_PREFIX = "init-prefix"; String initPrefixProp = getStringProperty(securityFilterServiceReference, PROPERTY_INIT_PREFIX); if (initPrefixProp == null) { final String DEFAULT_INIT_PREFIX_PROP = "init."; initPrefixProp = DEFAULT_INIT_PREFIX_PROP; } Map<String, String> initParameters = new HashMap<>(); for (String key : initParamKeys) { String value = securityFilterServiceReference.getProperty(key) == null ? "" : securityFilterServiceReference.getProperty(key).toString(); final String HTTP_WHITEBOARD_SERVLET_INIT_PARAM_PREFIX = "servlet.init."; if (key.startsWith(initPrefixProp)) { initParameters.put(key.replaceFirst(initPrefixProp, ""), value); } else if (key.startsWith(HTTP_WHITEBOARD_SERVLET_INIT_PARAM_PREFIX)) { initParameters.put( key.replaceFirst(HTTP_WHITEBOARD_SERVLET_INIT_PARAM_PREFIX, ""), value); } } return initParameters; }
Source:
<code>public ErrorTypeLocator getErrorTypeLocator() { <START> return ErrorTypeLocator.builder(muleContext.getErrorTypeRepository()).build(); <END> }</code><technical_language>build time</technical_language>

Target:
public ErrorTypeLocator getErrorTypeLocator() { return ((PrivilegedMuleContext) muleContext).getErrorTypeLocator(); }
Source:
<code>public synchronized void queueIntent(IntentListener asker) { int newIdentId; do { <START> newIdentId = StageActivity.randomGenerator.nextInt(100000); <END> } while (intentListeners.containsKey(newIdentId)); intentListeners.put(newIdentId, asker); ArrayList<Object> params = new ArrayList<>(); params.add(newIdentId); if (StageActivity.messageHandler == null) { return; } Message message = StageActivity.messageHandler.obtainMessage(StageActivity.PERFORM_INTENT, params); message.sendToTarget(); }</code><technical_language>is a reason for bound of 100000? full integer range? is 0 a valid number here</technical_language>

Target:
public synchronized void queueIntent(IntentListener asker) { if (StageActivity.messageHandler == null) { return; } int newIdentId; do { newIdentId = StageActivity.randomGenerator.nextInt(Integer.MAX_VALUE); } while (intentListeners.containsKey(newIdentId)); intentListeners.put(newIdentId, asker); ArrayList<Object> params = new ArrayList<>(); params.add(newIdentId); Message message = StageActivity.messageHandler.obtainMessage(StageActivity.PERFORM_INTENT, params); message.sendToTarget(); }
Source:
<code>private void checkSigOps() throws VerificationException { int sigOps = 0; for (Transaction tx : transactions) { sigOps += tx.getSigOpCount(); } <START> if (sigOps > MAX_BLOCK_SIGOPS) { <END> throw new VerificationException("Block had too many Signature Operations"); } }</code><technical_language>This is unrelated change snuck in. for bitching, reviewing harder for big refactorings this one</technical_language>

Target:
private void checkSigOps() throws VerificationException { int sigOps = 0; for (Transaction tx : transactions) { sigOps += tx.getSigOpCount(); } if (sigOps > MAX_BLOCK_SIGOPS) throw new VerificationException("Block had too many Signature Operations"); }
Source:
<code>public int hashCode() { <START> return super.hashCode(); <END> }</code><technical_language>This correct; defers default implementation of Object::hashCode, for instances, contract of hashCode requires objects' hash codes if equals is true. return a constant</technical_language>

Target:
public int hashCode() { return 0; }