auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private static QualityProfile buildProfile(String key, String name, @Nullable String parentKey, Statistics statistics) { return QualityProfile.newBuilder() .setKey(key) .setName(name) <START> .setParent(parentKey == null ? "" : parentKey) <END> .setActiveRuleCount(statistics.getActiveRuleCount(key)) .setOverridingRuleCount(statistics.getOverridingRuleCount(key)) .build(); }</code><technical_language>changes API specification. parent field returned is parent. change returns "parent": "". A solution is use: QualityProfile.Builder builder = QualityProfile.newBuilder() .setKey(key) .setName(name) .setActiveRuleCount(statistics.getActiveRuleCount(key)) .setOverridingRuleCount(statistics.getOverridingRuleCount(key)); Protobuf.setNullable(parentKey, builder::setParent); return builder.build();</technical_language>

Target:
private static QualityProfile buildProfile(String key, String name, @Nullable String parentKey, Statistics statistics) { QualityProfile.Builder builder = QualityProfile.newBuilder() .setKey(key) .setName(name) .setActiveRuleCount(statistics.countRulesByProfileKey.getOrDefault(key, 0L)) .setOverridingRuleCount(statistics.countOverridingRulesByProfileKey.getOrDefault(key, 0L)); Protobuf.setNullable(parentKey, builder::setParent); return builder.build(); }
Source:
<code>public String getSeqResSequence(){ StringBuilder str = new StringBuilder(); for (Group g : seqResGroups) { ChemComp cc = g.getChemComp(); if ( cc == null) { logger.warn("Could not load ChemComp for group: ", g); str.append(StructureTools.UNKNOWN_GROUP_LABEL); } else if ( PolymerType.PROTEIN_ONLY.contains(cc.getPolymerType()) || PolymerType.POLYNUCLEOTIDE_ONLY.contains(cc.getPolymerType())){ String oneLetter= ChemCompGroupFactory.getOneLetterCode(cc); <START> if ( oneLetter == null || oneLetter.isEmpty() || oneLetter.equals("?") || oneLetter.length()!=1) { <END> oneLetter = Character.toString(StructureTools.UNKNOWN_GROUP_LABEL); } str.append(oneLetter); } else { str.append(StructureTools.UNKNOWN_GROUP_LABEL); } } return str.toString(); }</code><technical_language>FYI this changes behaviour discussed in #457, this getSeqResSequence getSeqResGroups size</technical_language>

Target:
public String getSeqResSequence(){ StringBuilder str = new StringBuilder(); for (Group g : seqResGroups) { ChemComp cc = g.getChemComp(); if ( cc == null) { logger.warn("Could not load ChemComp for group: ", g); str.append(StructureTools.UNKNOWN_GROUP_LABEL); } else if ( PolymerType.PROTEIN_ONLY.contains(cc.getPolymerType()) || PolymerType.POLYNUCLEOTIDE_ONLY.contains(cc.getPolymerType())){ String oneLetter= ChemCompGroupFactory.getOneLetterCode(cc); if ( oneLetter == null || oneLetter.isEmpty() || oneLetter.equals("?")) { oneLetter = Character.toString(StructureTools.UNKNOWN_GROUP_LABEL); } str.append(oneLetter); } else { str.append(StructureTools.UNKNOWN_GROUP_LABEL); } } return str.toString(); }
Source:
<code>private void handleSuccess(IndexedRecord input, String id, String status) { successCount++; Schema outSchema = sprops.schemaFlow.schema.getValue(); if (outSchema == null || outSchema.getFields().size() == 0) { return; } if (input.getSchema().equals(outSchema)) { successfulWrites.add(input); } else { IndexedRecord successful = new GenericData.Record(outSchema); for (Schema.Field outField : successful.getSchema().getFields()) { Object outValue = null; Schema.Field inField = input.getSchema().getField(outField.name()); if (inField != null) { outValue = input.get(inField.pos()); } else if (TSalesforceOutputProperties.FIELD_SALESFORCE_ID.equals(outField.name())) { outValue = id; } else if (TSalesforceOutputProperties.FIELD_STATUS.equals(outField.name())) { outValue = status; } successful.put(outField.pos(), outValue); } successfulWrites.add(successful); } <START> LOGGER.info("Has record successfully.", getPastForm(sprops.outputAction.getValue()), dataCount); <END> }</code><technical_language>I18N</technical_language>

Target:
private void handleSuccess(IndexedRecord input, String id, String status) { successCount++; Schema outSchema = sprops.schemaFlow.schema.getValue(); if (outSchema == null || outSchema.getFields().size() == 0) { return; } if (input.getSchema().equals(outSchema)) { successfulWrites.add(input); } else { IndexedRecord successful = new GenericData.Record(outSchema); for (Schema.Field outField : successful.getSchema().getFields()) { Object outValue = null; Schema.Field inField = input.getSchema().getField(outField.name()); if (inField != null) { outValue = input.get(inField.pos()); } else if (TSalesforceOutputProperties.FIELD_SALESFORCE_ID.equals(outField.name())) { outValue = id; } else if (TSalesforceOutputProperties.FIELD_STATUS.equals(outField.name())) { outValue = status; } successful.put(outField.pos(), outValue); } successfulWrites.add(successful); } LOGGER.info(MESSAGES.getMessage("info.successfulRecord", getPastForm(sprops.outputAction.getValue()), dataCount)); }
Source:
<code>public void setGuideItem(GuideInfo guide) { ImageSizes imageSizes = MainApplication.get().getImageSizes(); mTitleView.setText(mShortTitle && guide.hasSubject() ? guide.mSubject : Html.fromHtml(guide.mTitle)); Transformation transform = new RoundedTransformation(4, 0); if (guide.hasImage()) { Utils.safeStripImageView(mThumbnail); mPicasso.cancelRequest(mThumbnail); String url = guide.getImagePath(imageSizes.getGrid()); <START> Log.d("GuideItemView", "Loading image " + url); <END> mPicasso .load(url) .transform(transform) .error(R.drawable.no_image) .into(mThumbnail); } else { mPicasso .load(R.drawable.no_image) .fit() .transform(transform) .into(mThumbnail); } }</code><technical_language>Stray Log call</technical_language>

Target:
public void setGuideItem(GuideInfo guide) { ImageSizes imageSizes = MainApplication.get().getImageSizes(); mTitleView.setText(mShortTitle && guide.hasSubject() ? guide.mSubject : Html.fromHtml(guide.mTitle)); Transformation transform = new RoundedTransformation(4, 0); if (guide.hasImage()) { Utils.safeStripImageView(mThumbnail); mPicasso.cancelRequest(mThumbnail); String url = guide.getImagePath(imageSizes.getGrid()); mPicasso .load(url) .transform(transform) .error(R.drawable.no_image) .into(mThumbnail); } else { mPicasso .load(R.drawable.no_image) .fit() .transform(transform) .into(mThumbnail); } }
Source:
<code>public LeaderInitiatorFactoryBean setRole(String role) { this.candidate = newCandidate(role); return this; <START> } <END></code><technical_language>newCandidate() is overridable, need a null check too. Assert.state(candidate != null, "...");. Sonar complain a method called a CTOR is protected final, need a // NOSONAR (or method - I remember and/or Sonar assertion test)</technical_language>

Target:
public LeaderInitiatorFactoryBean setRole(String role) { this.candidate = this.candidateProvider.generate(role); Assert.state(this.candidate != null, String.format("The %s requires a candidate; newCandidate(role) returned none.", getClass().getName())); return this; }
Source:
<code>public void init(InstructorAttributes currentInstructor, CourseDetailsBundle courseDetails, List<InstructorAttributes> instructors, List<StudentAttributes> students) { this.currentInstructor = currentInstructor; this.courseDetails = courseDetails; this.instructors = instructors; boolean isDisabled = !currentInstructor.isAllowedForPrivilege( Const.ParamsNames.INSTRUCTOR_PERMISSION_GIVE_COMMENT_IN_SECTIONS); <START> String content = "<span class=\"glyphicon glyphicon-comment glyphicon-primary\"></span>"; <END> giveCommentButton = createButton(content, "btn btn-default btn-xs icon-button pull-right", "button_add_comment", null, "", "tooltip", null, isDisabled); isDisabled = !currentInstructor.isAllowedForPrivilege(Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_STUDENT); String onClick = "if(toggleSendRegistrationKeysConfirmation('" + Sanitizer.sanitizeForJs(courseDetails.course.id) + "')) " + "window.location.href='" + Sanitizer.sanitizeForJs(getInstructorCourseRemindLink()) + "';"; courseRemindButton = createButton(null, "btn btn-primary", "button_remind", null, Const.Tooltips.COURSE_REMIND, "tooltip", onClick, isDisabled); studentsTable = new CourseDetailsStudentsTable(); int studentIndex = 0; for (StudentAttributes student : students) { CourseDetailsStudentsTableRow row = createStudentsTableRow(studentIndex, student); studentsTable.getRows().add(row); studentIndex++; } }</code><technical_language>Is a more informative name content? I mean, I content of ElementTag (as attribute name suggests), is HTML in content? represent? Some sort of icon? (this too)</technical_language>

Target:
public void init(InstructorAttributes currentInstructor, CourseDetailsBundle courseDetails, List<InstructorAttributes> instructors, List<StudentAttributes> students) { this.currentInstructor = currentInstructor; this.courseDetails = courseDetails; this.instructors = instructors; boolean isDisabled = !currentInstructor.isAllowedForPrivilege( Const.ParamsNames.INSTRUCTOR_PERMISSION_GIVE_COMMENT_IN_SECTIONS); String content = "<span class=\"glyphicon glyphicon-comment glyphicon-primary\"></span>"; giveCommentButton = createButton(content, "btn btn-default btn-xs icon-button pull-right", "button_add_comment", null, "", "tooltip", null, isDisabled); isDisabled = !currentInstructor.isAllowedForPrivilege(Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_STUDENT); String onClick = "if(toggleSendRegistrationKeysConfirmation('" + sanitizeForJs(courseDetails.course.id) + "')) " + "window.location.href='" + sanitizeForJs(getInstructorCourseRemindLink()) + "';"; courseRemindButton = createButton(null, "btn btn-primary", "button_remind", null, Const.Tooltips.COURSE_REMIND, "tooltip", onClick, isDisabled); studentsTable = new CourseDetailsStudentsTable(); int studentIndex = 0; List<CourseDetailsStudentsTableRow> studentTableRows = new ArrayList<CourseDetailsStudentsTableRow>(); for (StudentAttributes student : students) { CourseDetailsStudentsTableRow row = createStudentsTableRow(studentIndex, student); studentTableRows.add(row); studentIndex++; } studentsTable.setRows(studentTableRows); }
Source:
<code>public DateTimeType(String zonedValue) { ZonedDateTime date = null; try { try { date = ZonedDateTime.parse(zonedValue, formatterTzMsRFC); } catch (DateTimeParseException tzMsRfcException) { try { date = ZonedDateTime.parse(zonedValue, formatterTzMs); } catch (DateTimeParseException tzMsException) { try { date = ZonedDateTime.parse(zonedValue, formatterTz); } catch (DateTimeParseException tzException) { try { date = ZonedDateTime.parse(zonedValue, formatter); } catch (DateTimeParseException regularFormatException) { date = ZonedDateTime.parse(zonedValue, formatterTzMsIso); } } } } } catch (DateTimeParseException invalidFormatException) { throw new IllegalArgumentException(zonedValue + " is not in a valid format.", invalidFormatException); } <START> if (date != null) { <END> zonedDateTime = ZonedDateTime.from(date); } }</code><technical_language>e is a commonly choice for variable name</technical_language>

Target:
public DateTimeType(String zonedValue) { ZonedDateTime date = null; try { try { date = ZonedDateTime.parse(zonedValue, formatterTzMsRFC); } catch (DateTimeParseException tzMsRfcException) { try { date = ZonedDateTime.parse(zonedValue, formatterTzMsIso); } catch (DateTimeParseException tzMsException) { try { date = ZonedDateTime.parse(zonedValue, formatterTz); } catch (DateTimeParseException tzException) { try { date = ZonedDateTime.parse(zonedValue, formatterTzMs); } catch (DateTimeParseException regularFormatException) { LocalDateTime localDateTime = LocalDateTime.parse(zonedValue, formatter); date = ZonedDateTime.of(localDateTime, ZoneId.systemDefault()); } } } } } catch (DateTimeParseException invalidFormatException) { throw new IllegalArgumentException(zonedValue + " is not in a valid format.", invalidFormatException); } if (date != null) { zonedDateTime = date; } }
Source:
<code>public Query createQuery(NamedQueryDefinition namedQueryDefinition) { String queryString = namedQueryDefinition.getQueryString(); Query query = createQuery( queryString ); <START> query.setComment( "named HQL query " + namedQueryDefinition.getName() ); <END> query.setFlushMode( namedQueryDefinition.getFlushMode() ); return query; }</code><technical_language>HQL/JP-QL</technical_language>

Target:
public Query createQuery(NamedQueryDefinition namedQueryDefinition) { String queryString = namedQueryDefinition.getQueryString(); Query query = createQuery( queryString ); query.setComment( "named HQL/JP-QL query " + namedQueryDefinition.getName() ); query.setFlushMode( namedQueryDefinition.getFlushMode() ); return query; }
Source:
<code>public void testInvalidUser(AuthenticationFlowContext context, UserModel user) { <START> if (user == null || user.getServiceAccountClientLink() != null) { <END> dummyHash(context); context.getEvent().error(Errors.USER_NOT_FOUND); Response challengeResponse = challenge(context, getDefaultChallengeMessage(context)); context.failureChallenge(AuthenticationFlowError.INVALID_USER, challengeResponse); } }</code><technical_language>Is necessary add this check here? AuthenticationProcessor prevent login request reaching this point</technical_language>

Target:
public void testInvalidUser(AuthenticationFlowContext context, UserModel user) { if (user == null) { dummyHash(context); context.getEvent().error(Errors.USER_NOT_FOUND); Response challengeResponse = challenge(context, getDefaultChallengeMessage(context)); context.failureChallenge(AuthenticationFlowError.INVALID_USER, challengeResponse); } }
Source:
<code>public static List<RegistryFileInfo> copyRegistryFiles() throws TskCoreException { List<AbstractFile> regFilesAbstract = findRegistryFiles(); List<RegistryFileInfo> regFilesLocal = new ArrayList<>(); String tmpDir = Case.getCurrentCase().getTempDirectory() + File.separator + "STIX"; File dir = new File(tmpDir); if (dir.exists() == false) { dir.mkdirs(); } long index = 1; for (AbstractFile regFile : regFilesAbstract) { String regFileName = regFile.getName(); String regFileNameLocal = tmpDir + File.separator + regFileName + "_" + index; File regFileNameLocalFile = new File(regFileNameLocal); try { if (regFile.getMetaFlagsAsString().contains("Allocated")) { ContentUtils.writeToFile(regFile, regFileNameLocalFile); regFilesLocal.add(new EvalRegistryObj().new RegistryFileInfo(regFile, regFileNameLocal)); } } catch (IOException ex) { logger.log(Level.WARNING, String.format("Error copying file '%s' (id=%d) into directory '%s'.", <START> regFileName, regFile.getId(), regFileNameLocal), ex); END> throw new TskCoreException(ex.getLocalizedMessage()); } index++; } return regFilesLocal; }</code><technical_language>log throw, both</technical_language>

Target:
public static List<RegistryFileInfo> copyRegistryFiles() throws TskCoreException { List<AbstractFile> regFilesAbstract = findRegistryFiles(); List<RegistryFileInfo> regFilesLocal = new ArrayList<>(); String tmpDir = Case.getCurrentCase().getTempDirectory() + File.separator + "STIX"; File dir = new File(tmpDir); if (dir.exists() == false) { dir.mkdirs(); } long index = 1; for (AbstractFile regFile : regFilesAbstract) { String regFileName = regFile.getName(); String regFileNameLocal = tmpDir + File.separator + regFileName + "_" + index; File regFileNameLocalFile = new File(regFileNameLocal); try { if (regFile.getMetaFlagsAsString().contains("Allocated")) { ContentUtils.writeToFile(regFile, regFileNameLocalFile); regFilesLocal.add(new EvalRegistryObj().new RegistryFileInfo(regFile, regFileNameLocal)); } } catch (IOException ex) { throw new TskCoreException(ex.getLocalizedMessage()); } index++; } return regFilesLocal; }
Source:
<code>private boolean isAbsoluteUrl(String path) { <START> return path.startsWith("http://") || path.startsWith("https://"); <END> }</code><technical_language>java.net.URI isAbsolute() method that</technical_language>

Target:
private boolean isAbsoluteUrl(String path) { String lowerCase = path.toLowerCase(); return lowerCase.startsWith("http://") || lowerCase.startsWith("https://"); }
Source:
<code>public List<DataSampleDto> getData() { <START> return Collections.unmodifiableList(data!=null?data:new ArrayList<>()); <END> }</code><technical_language>Add this qualifier: this.data</technical_language>

Target:
public List<DataSampleDto> getData() { return Collections.unmodifiableList(this.data!=null?this.data:new ArrayList<>()); }
Source:
<code>private void createWithRuntime(){ ProjectExplorer pe = new ProjectExplorer(); pe.open(); createWebProject(WEB_PROJECT_NAME, sr.getRuntimeName(), false); pe.open(); pe.getProject(WEB_PROJECT_NAME).select(); new ContextMenuItem("Configure","Convert to Maven Project").select(); new DefaultShell("Create new POM"); new PushButton("Finish").click(); <START> new WaitUntil(new ShellIsAvailable("Convert to Maven Dependencies"), TimePeriod.getCustom(2500)); <END> new WaitUntil(new ControlIsEnabled(new PushButton("Finish")), TimePeriod.VERY_LONG); }</code><technical_language>Wait 40 minutes? Is needed wait for long? suspicious</technical_language>

Target:
private void createWithRuntime(){ ProjectExplorer pe = new ProjectExplorer(); pe.open(); createWebProject(WEB_PROJECT_NAME, sr.getRuntimeName(), false); pe.open(); pe.getProject(WEB_PROJECT_NAME).select(); new ContextMenuItem("Configure","Convert to Maven Project").select(); new DefaultShell("Create new POM"); new PushButton("Finish").click(); new WaitUntil(new ShellIsAvailable("Convert to Maven Dependencies"), TimePeriod.VERY_LONG); new WaitUntil(new ControlIsEnabled(new PushButton("Finish")), TimePeriod.VERY_LONG); }
Source:
<code>public OrcStruct transform(StructuredRecord input, Schema schema) { List<Schema.Field> fields = input.getSchema().getFields(); OrcStruct orcRecord = parseOrcSchema(input.getSchema()); for (int i = 0; i < fields.size(); i++) { Schema.Field field = fields.get(i); try { WritableComparable writable = convertToWritable(field, input); orcRecord.setFieldValue(fields.get(i).getName(), writable); } catch (UnsupportedTypeException e) { <START> LOG.debug("{} is not a supported type", field.getName(), e); <END> throw new IllegalArgumentException(String.format("%s is not a supported type", field.getName()), e); } } return orcRecord; }</code><technical_language>unnecessary log</technical_language>

Target:
public OrcStruct transform(StructuredRecord input, Schema schema) { List<Schema.Field> fields = input.getSchema().getFields(); OrcStruct orcRecord = parseOrcSchema(input.getSchema()); for (int i = 0; i < fields.size(); i++) { Schema.Field field = fields.get(i); try { WritableComparable writable = convertToWritable(field, input); orcRecord.setFieldValue(fields.get(i).getName(), writable); } catch (UnsupportedTypeException e) { throw new IllegalArgumentException(String.format("%s is not a supported type", field.getName()), e); } } return orcRecord; }
Source:
<code>private List<Pair<Guid, Integer>> filter(final VM vm, final VDS... hosts) { return <START> inClusterUpgradeWeightPolicyUnit.score(null, Arrays.asList(hosts), <END> vm, null); }</code><technical_language>rmohr null supported lets pass a valid api input</technical_language>

Target:
private List<Pair<Guid, Integer>> filter(final VM vm, final VDS... hosts) { return inClusterUpgradeWeightPolicyUnit.score(new Cluster(), Arrays.asList(hosts), vm, null); }
Source:
<code>private void updateRelevantVms() { List<VM> vms = getVmsDiskPluggedTo(); for (VM vm : vms) { <START> if (vm.getStatus().isUpOrPaused() || vms.size() == 1) { <END> try { VDSReturnValue ret = extendVmDiskSize(vm, getParameters().getNewSize()); if (!ret.getSucceeded()) { updateAuditLogFailedToUpdateVM(vm.getName()); } } catch (RuntimeException e) { if (log.isWarnEnabled()) { log.warnFormat("Failed to update VM '{0}' with the new volume size due to error: {1}." + "VM should be restarted to detect the new size.", vm.getName(), ExceptionUtils.getMessage(e)); } updateAuditLogFailedToUpdateVM(vm.getName()); } } } }</code><technical_language>if vm is down, do need perform it</technical_language>

Target:
private void updateRelevantVms() { List<VM> vms = getVmsDiskPluggedTo(); for (VM vm : vms) { if (vm.getStatus().isUpOrPaused() || vms.size() == 1) { try { VDSReturnValue ret = extendVmDiskSize(vm, getParameters().getNewSize()); if (!ret.getSucceeded()) { updateAuditLogFailedToUpdateVM(vm.getName()); } } catch (VdcBLLException e) { log.warnFormat("Failed to update VM '{0}' with the new volume size due to error: {1}." + "VM should be restarted to detect the new size.", vm.getName(), ExceptionUtils.getMessage(e)); updateAuditLogFailedToUpdateVM(vm.getName()); } } } }
Source:
<code>public SubordinateTransaction getImportedTransaction(Xid xid) throws XAException { if (xid == null) throw new IllegalArgumentException(); TransactionImpleHolder holder = _transactions.get(new SubordinateXidImple(xid)); if (holder == null) return null; SubordinateTransaction tx = holder.getImported(); if (tx == null) return null; <START> <END> try { if (tx.getStatus() == javax.transaction.Status.STATUS_ROLLEDBACK) { throw new XAException(XAException.XA_RBROLLBACK); } } catch (SystemException e) { e.printStackTrace(); throw new XAException(XAException.XA_RBROLLBACK); } if (!tx.activated()) { tx.recover(); return tx; } else return tx; }</code><technical_language>superfluous formatting change? main point is tx null now? I</technical_language>

Target:
public SubordinateTransaction getImportedTransaction(Xid xid) throws XAException { if (xid == null) throw new IllegalArgumentException(); AtomicReference<TransactionImple> holder = _transactions.get(new SubordinateXidImple(xid)); TransactionImple tx = holder == null ? null : holder.get(); if (tx == null) { return null; } try { if (tx.getStatus() == javax.transaction.Status.STATUS_ROLLEDBACK) { throw new XAException(XAException.XA_RBROLLBACK); } } catch (SystemException e) { e.printStackTrace(); throw new XAException(XAException.XA_RBROLLBACK); } if (!tx.activated()) { tx.recover(); return tx; } else return tx; }
Source:
<code>public final boolean isEnabled() { boolean result = false; IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); if (page != null) { ISelection selection = page.getSelection(); <START> if (selection instanceof IStructuredSelection) { <END> result = true; final Iterator<?> it = ((IStructuredSelection) selection).iterator(); while (it.hasNext() && result) { Object o = it.next(); if (o instanceof IAbstractDiagramNodeEditPart) { IAbstractDiagramNodeEditPart diagramEditPart = (IAbstractDiagramNodeEditPart) o; View view = (View) diagramEditPart.getModel(); EObject element = view.getElement(); IPermissionAuthority permissionAuthority = PermissionAuthorityRegistry.getDefault().getPermissionAuthority(element); if (permissionAuthority != null && !permissionAuthority.canEditInstance(element)) { result = false; break; } } else { result = false; break; } } } } return result; }</code><technical_language>check if selection is empty: current behavior is return true if selection is empty, in this case shoudl return false</technical_language>

Target:
public final boolean isEnabled() { boolean result = false; IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); if (page != null && page.getSelection() instanceof IStructuredSelection) { IStructuredSelection selection = (IStructuredSelection) page.getSelection(); if (!selection.isEmpty()) { result = true; final Iterator<?> it = selection.iterator(); while (it.hasNext() && result) { Object o = it.next(); if (o instanceof IAbstractDiagramNodeEditPart) { IAbstractDiagramNodeEditPart diagramEditPart = (IAbstractDiagramNodeEditPart) o; View view = (View) diagramEditPart.getModel(); EObject element = view.getElement(); IPermissionAuthority permissionAuthority = PermissionAuthorityRegistry.getDefault().getPermissionAuthority(element); if (permissionAuthority != null && !permissionAuthority.canEditInstance(element)) { result = false; } } else { result = false; } } } } return result; }
Source:
<code>private Function<PollingContext<OperationResult>, Mono<SimpleResponse<AnalyzeOperationResult>>> fetchingOperation( Function<UUID, Mono<SimpleResponse<AnalyzeOperationResult>>> fetchingFunction) { return (pollingContext) -> { try { <START> final UUID resultUid = UUID.fromString(pollingContext.getLatestResponse().getValue().getResultId()); <END> return fetchingFunction.apply(resultUid); } catch (RuntimeException ex) { return monoError(logger, ex); } }; }</code><technical_language>nit: rename resultUid resultUuid</technical_language>

Target:
private Function<PollingContext<OperationResult>, Mono<SimpleResponse<AnalyzeOperationResult>>> fetchingOperation( Function<UUID, Mono<SimpleResponse<AnalyzeOperationResult>>> fetchingFunction) { return pollingContext -> { try { final UUID resultUuid = UUID.fromString(pollingContext.getLatestResponse().getValue().getResultId()); return fetchingFunction.apply(resultUuid); } catch (RuntimeException ex) { return monoError(logger, ex); } }; }
Source:
<code>public ExtensionResponse executePreOutboundAction(final IExtensionRequest ier, List<RestcommExtensionGeneric> extensions) { ExtensionResponse response = new ExtensionResponse(); if (extensions != null && extensions.size() > 0) { for (RestcommExtensionGeneric extension : extensions) { if(logger.isInfoEnabled()) { logger.info( extension.getName()+" is enabled="+extension.isEnabled()); } if (extension.isEnabled()) { try { ExtensionResponse tempResponse = extension.preOutboundAction(ier); if (tempResponse != null) { response = tempResponse; if (!tempResponse.isAllowed()) { break; } } <START> } catch (Exception e) { <END> if (logger.isDebugEnabled()) { String msg = String.format("There was an exception while executing preInboundAction from extension %s, exception %s", extension.getName(), e); logger.debug(msg); } } } } } return response; }</code><technical_language>do want catch Exception? try catch Throwable? im sure, wondering... perspective is Extensions out of RC core, RC core works platform for specific Extensions. ExtensionController border RC extension, sense catch Throwable instead,and provide a default recovery path.</technical_language>

Target:
public ExtensionResponse executePreOutboundAction(final IExtensionRequest ier, List<RestcommExtensionGeneric> extensions) { ExtensionResponse response = new ExtensionResponse(); if (extensions != null && extensions.size() > 0) { for (RestcommExtensionGeneric extension : extensions) { if(logger.isInfoEnabled()) { logger.info( extension.getName()+" is enabled="+extension.isEnabled()); } if (extension.isEnabled()) { try { ExtensionResponse tempResponse = extension.preOutboundAction(ier); if (tempResponse != null) { response = tempResponse; if (!tempResponse.isAllowed()) { break; } } } catch (Throwable t) { if (logger.isDebugEnabled()) { String msg = String.format("There was an exception while executing preInboundAction from extension %s, exception %s", extension.getName(), t); logger.debug(msg); } } } } } return response; }
Source:
<code>public EPackage getPackage(String namespace, String loadedVersion) { if (namespace != null) { String mapTo = null; if (Version.parseVersion(loadedVersion).compareTo(ALREADY_MIGRATED_VERSION) < 0) { mapTo = VIEWPOINT_TO_SIRUS_0_9_NS_URI_MAPPINGS.get(namespace); } else if (Version.parseVersion(loadedVersion).compareTo(SIRIUS_1_0_0_M5_VERSION) < 0) { mapTo = SIRUS_0_9_TO_SIRUS_1_0_0_M5_NS_URI_MAPPINGS.get(namespace); } else if (Version.parseVersion(loadedVersion).compareTo(SIRIUS_1_0_0_M6_VERSION) < 0) { mapTo = SIRUS_1_0_0_M5_TO_SIRUS_1_0_0_M6_NS_URI_MAPPINGS.get(namespace); <START> } <END> if (mapTo != null) { EPackage found = EPackage.Registry.INSTANCE.getEPackage(mapTo); if (found != null) { return found; } } } return super.getPackage(namespace, loadedVersion); }</code><technical_language>do migrate step step, VIEWPOINT_SO_TO_SIRIUS_0_9 renamed FROM_VIEWPOINT, SIRIUS_0_9_TO_SI... FROM_SIRIUS_0_9, SIRIUS_1_0_0_M5_TO... FROM_SIRIUS_1_0_0_0_M5</technical_language>

Target:
public EPackage getPackage(String namespace, String loadedVersion) { if (namespace != null) { String mapTo = null; if (Version.parseVersion(loadedVersion).compareTo(SIRIUS_0_9_VERSION) < 0) { mapTo = FROM_VIEWPOINT_NS_URI_MAPPINGS.get(namespace); } else if (Version.parseVersion(loadedVersion).compareTo(SIRIUS_1_0_0_M5_VERSION) < 0) { mapTo = FROM_SIRIUS_0_9_NS_URI_MAPPINGS.get(namespace); } else if (Version.parseVersion(loadedVersion).compareTo(SIRIUS_1_0_0_M6_VERSION) < 0) { mapTo = FROM_SIRIUS_1_0_0_M5_NS_URI_MAPPINGS.get(namespace); } if (mapTo != null) { EPackage found = EPackage.Registry.INSTANCE.getEPackage(mapTo); if (found != null) { return found; } } } return super.getPackage(namespace, loadedVersion); }
Source:
<code>protected String[] customCommandLineValidation() { List<String> errors = new ArrayList<>(); if (INTERLEAVE && SECOND_END_FASTQ != null) { errors.add("Cannot set INTERLEAVE to true and pass in a SECOND_END_FASTQ"); } if (UNPAIRED_FASTQ != null && SECOND_END_FASTQ == null) { <START> errors.add("UNPAIRED_FASTQ may only be set when also emitting read1 and read2 fastqs (so SECOND_END_FASTQ must also be set)."); <END> } if ((CLIPPING_ATTRIBUTE != null && CLIPPING_ACTION == null) || (CLIPPING_ATTRIBUTE == null && CLIPPING_ACTION != null)) { errors.add("Both or neither of CLIPPING_ATTRIBUTE and CLIPPING_ACTION should be set."); } if (CLIPPING_ACTION != null) { if (!CLIPPING_ACTION.equals("N") && !CLIPPING_ACTION.equals("X")) { try { Integer.parseInt(CLIPPING_ACTION); } catch (NumberFormatException nfe) { errors.add("CLIPPING ACTION must be one of: N, X, or an integer"); } } } if ((OUTPUT_PER_RG && OUTPUT_DIR == null) || ((!OUTPUT_PER_RG) && OUTPUT_DIR != null)) { errors.add("If OUTPUT_PER_RG is true, then OUTPUT_DIR should be set. If "); } if (OUTPUT_PER_RG) { if (RG_TAG == null) { errors.add("If OUTPUT_PER_RG is true, then RG_TAG should be set."); } else if (!(RG_TAG.equalsIgnoreCase("PU") || RG_TAG.equalsIgnoreCase("ID"))) { errors.add("RG_TAG must be: PU or ID"); } } return errors.isEmpty() ? super.customCommandLineValidation() : errors.toArray(new String[errors.size()]); }</code><technical_language>this assertion done Argument annotation</technical_language>

Target:
protected String[] customCommandLineValidation() { List<String> errors = new ArrayList<>(); if (INTERLEAVE && SECOND_END_FASTQ != null) { errors.add("Cannot set INTERLEAVE to true and pass in a SECOND_END_FASTQ"); } if (UNPAIRED_FASTQ != null && SECOND_END_FASTQ == null) { errors.add("UNPAIRED_FASTQ may only be set when also emitting read1 and read2 fastqs (so SECOND_END_FASTQ must also be set)."); } if ((CLIPPING_ATTRIBUTE != null && CLIPPING_ACTION == null) || (CLIPPING_ATTRIBUTE == null && CLIPPING_ACTION != null)) { errors.add("Both or neither of CLIPPING_ATTRIBUTE and CLIPPING_ACTION should be set."); } if (CLIPPING_ACTION != null) { if (!CLIPPING_ACTION.equals(CLIP_TO_N) && !CLIPPING_ACTION.equals(CLIP_TRIM)) { try { Integer.parseInt(CLIPPING_ACTION); } catch (NumberFormatException nfe) { errors.add("CLIPPING ACTION must be one of: N, X, or an integer"); } } } if ((OUTPUT_PER_RG && OUTPUT_DIR == null) || ((!OUTPUT_PER_RG) && OUTPUT_DIR != null)) { errors.add("If OUTPUT_PER_RG is true, then OUTPUT_DIR should be set. If "); } if (OUTPUT_PER_RG) { if (RG_TAG == null) { errors.add("If OUTPUT_PER_RG is true, then RG_TAG should be set."); } else if (!(RG_TAG.equalsIgnoreCase("PU") || RG_TAG.equalsIgnoreCase("ID"))) { errors.add("RG_TAG must be: PU or ID"); } } return errors.isEmpty() ? super.customCommandLineValidation() : errors.toArray(new String[errors.size()]); }
Source:
<code>V unwrap() throws ResultException; V unwrap(String message) throws ResultException; @SuppressWarnings("unchecked") <START> <U> Result<U, E> then(final FunctionWithException<V, Result<U, E>> lambda); <END> <U> Result<U, E> map(final FunctionWithException<V, U> lambda); <F> Result<V, F> mapErr(final FunctionWithException<E, F> lambda); Result<V, E> recover(FunctionWithException<E, V> recover); default V orElse(V value) { return getValue().orElse(value); }</code><technical_language>This named flatMap is called in Optional Promise other places</technical_language>

Target:
V unwrap() throws ResultException; V unwrap(String message) throws ResultException; @SuppressWarnings("unchecked") <U> Result<U, E> flatMap(final FunctionWithException<V, Result<U, E>> lambda); <U> Result<U, E> map(final FunctionWithException<V, U> lambda); <F> Result<V, F> mapErr(final FunctionWithException<E, F> lambda); Result<V, E> recover(FunctionWithException<E, V> recover); default V orElse(V value) { return getValue().orElse(value); }
Source:
<code>public void testClearNonEmptyCacheAccessException() throws Exception { <START> final MockStore realStore = new MockStore(this.getTestStoreEntries()); <END> this.store = spy(realStore); doThrow(new CacheAccessException("")).when(this.store).clear(); final Ehcache<String, String> ehcache = this.getEhcache(); assertThat(realStore.getMap().isEmpty(), is(false)); ehcache.clear(); verifyZeroInteractions(this.cacheLoader); verifyZeroInteractions(this.cacheWriter); verify(this.spiedResilienceStrategy).clearFailure(any(CacheAccessException.class)); }</code><technical_language>Naming fun: consider FakeStore StubStore instead of MockStore - I need adjust mentally time I read mock is a mock in fact</technical_language>

Target:
public void testClearNonEmptyCacheAccessException() throws Exception { final FakeStore realStore = new FakeStore(this.getTestStoreEntries()); this.store = spy(realStore); doThrow(new CacheAccessException("")).when(this.store).clear(); final Ehcache<String, String> ehcache = this.getEhcache(); assertThat(realStore.getEntryMap().isEmpty(), is(false)); ehcache.clear(); verifyZeroInteractions(this.cacheLoader); verifyZeroInteractions(this.cacheWriter); verify(this.spiedResilienceStrategy).clearFailure(any(CacheAccessException.class)); }
Source:
<code>private boolean isChunkValidForRender(RenderableChunk chunk) { if (!chunk.isReady()) { return false; } <START> boolean surroundingChunksLoaded = worldProvider.getWorldViewAround(chunk.getPosition()) == null; <END> if (surroundingChunksLoaded) { return false; } return true; }</code><technical_language>this variable represent surroundingChunksNotLoaded</technical_language>

Target:
private boolean isChunkValidForRender(RenderableChunk chunk) { return chunk.isReady() && areSurroundingChunksLoaded(chunk); }
Source:
<code>public List<Throwable> getErrors() { <START> return errors; <END> }</code><technical_language>I hope do kill me, this is infra component is good practices... allow caller modify collection. return Collections.unmodifiableList(errors);</technical_language>

Target:
public List<Throwable> getErrors() { return Collections.unmodifiableList(errors); }
Source:
<code>public ChannelGroupType type() { final List<ChannelDefinition> channelDefinitions = channels.values().stream() <START> .map(c -> new ChannelDefinition(c.channelID, c.channelTypeUID)).collect(Collectors.toList()); <END> return ChannelGroupTypeBuilder.instance(channelGroupTypeUID, name()).withChannelDefinitions(channelDefinitions) .build(); }</code><technical_language>This needs reworked #6327 is merged</technical_language>

Target:
public ChannelGroupType type() { final List<ChannelDefinition> channelDefinitions = channels.values().stream() .map(c -> new ChannelDefinitionBuilder(c.channelID, c.channelTypeUID).build()) .collect(Collectors.toList()); return ChannelGroupTypeBuilder.instance(channelGroupTypeUID, name()).withChannelDefinitions(channelDefinitions) .build(); }
Source:
<code>public void start(ServiceProvider<Service> serviceProvider) { persistence = serviceProvider.getService(LocalPersistenceService.class); if (!serializers.containsKey(Serializable.class)) { serializers.put(Serializable.class, (Class) CompactPersistentJavaSerializer.class); } <START> if (!serializers.containsKey(Long.class)) { <END> serializers.put(Long.class, LongSerializer.class); } if (!serializers.containsKey(Integer.class)) { serializers.put(Integer.class, IntegerSerializer.class); } if (!serializers.containsKey(Float.class)) { serializers.put(Float.class, FloatSerializer.class); } if (!serializers.containsKey(Double.class)) { serializers.put(Double.class, DoubleSerializer.class); } if (!serializers.containsKey(Character.class)) { serializers.put(Character.class, CharSerializer.class); } if (!serializers.containsKey(String.class)) { serializers.put(String.class, StringSerializer.class); } }</code><technical_language>Time for a helper method</technical_language>

Target:
public void start(ServiceProvider<Service> serviceProvider) { persistence = serviceProvider.getService(LocalPersistenceService.class); addDefaultSerializerIfNoneRegistered(serializers, Serializable.class, (Class) CompactPersistentJavaSerializer.class); addDefaultSerializerIfNoneRegistered(serializers, Long.class, LongSerializer.class); addDefaultSerializerIfNoneRegistered(serializers, Integer.class, IntegerSerializer.class); addDefaultSerializerIfNoneRegistered(serializers, Float.class, FloatSerializer.class); addDefaultSerializerIfNoneRegistered(serializers, Double.class, DoubleSerializer.class); addDefaultSerializerIfNoneRegistered(serializers, Character.class, CharSerializer.class); addDefaultSerializerIfNoneRegistered(serializers, String.class, StringSerializer.class); }
Source:
<code>public void writeData(ObjectDataOutput out) throws IOException { out.writeLong(version); out.writeLong(hits); out.writeLong(ttl); out.writeLong(creationTime); out.writeLong(lastAccessTime); out.writeLong(lastUpdateTime); <START> out.writeLong(maxIdle); <END> boolean statsEnabled = !(lastStoredTime == NOT_AVAILABLE && expirationTime == NOT_AVAILABLE); out.writeBoolean(statsEnabled); if (statsEnabled) { out.writeLong(lastStoredTime); out.writeLong(expirationTime); } }</code><technical_language>RU compatibility</technical_language>

Target:
public void writeData(ObjectDataOutput out) throws IOException { out.writeLong(version); out.writeLong(hits); out.writeLong(ttl); out.writeLong(creationTime); out.writeLong(lastAccessTime); out.writeLong(lastUpdateTime); boolean statsEnabled = !(lastStoredTime == NOT_AVAILABLE && expirationTime == NOT_AVAILABLE); out.writeBoolean(statsEnabled); if (statsEnabled) { out.writeLong(lastStoredTime); out.writeLong(expirationTime); } if (out.getVersion().isGreaterOrEqual(V3_11)) { out.writeLong(maxIdle); } }
Source:
<code>private List<FeedbackQuestionTableRow> buildCopyQuestionsModalRows(List<FeedbackQuestionAttributes> copiableQuestions, InstructorAttributes instructor) { List<FeedbackQuestionTableRow> copyQuestionRows = new ArrayList<FeedbackQuestionTableRow>(); if (instructor.isAllowedForPrivilege(Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION)) { for (FeedbackQuestionAttributes question1 : copiableQuestions) { String courseId = question1.courseId; String fsName = question1.feedbackSessionName; String qnType = question1.getQuestionDetails().getQuestionTypeDisplayName(); String qnText = question1.getQuestionDetails().questionText; <START> String qnId = question1.getId(); <END> FeedbackQuestionTableRow row = new FeedbackQuestionTableRow(courseId, fsName, qnType, qnText, qnId); copyQuestionRows.add(row); } } return copyQuestionRows; }</code><technical_language>Is a reason variable is question1</technical_language>

Target:
private List<FeedbackQuestionTableRow> buildCopyQuestionsModalRows(List<FeedbackQuestionAttributes> copiableQuestions, InstructorAttributes instructor) { List<FeedbackQuestionTableRow> copyQuestionRows = new ArrayList<FeedbackQuestionTableRow>(); if (instructor.isAllowedForPrivilege(Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION)) { for (FeedbackQuestionAttributes question : copiableQuestions) { String courseId = question.courseId; String fsName = question.feedbackSessionName; String qnType = question.getQuestionDetails().getQuestionTypeDisplayName(); String qnText = question.getQuestionDetails().questionText; String qnId = question.getId(); FeedbackQuestionTableRow row = new FeedbackQuestionTableRow(courseId, fsName, qnType, qnText, qnId); copyQuestionRows.add(row); } } return copyQuestionRows; }
Source:
<code>private ChildEventingList acquireChildEventingList( Object parentElement, DocumentView documentView) { <START> ChildEventingList childEventingList = mCachedChildEventingList; <END> if (childEventingList == null) { childEventingList = new ChildEventingList(); } childEventingList.acquire(parentElement, documentView); return childEventingList; }</code><technical_language>This method a bug in it. need set mCachedChildEventingList null! hand out multiple call sites in event of some recursive algorithm reentrant code block</technical_language>

Target:
private ChildEventingList acquireChildEventingList( Object parentElement, DocumentView documentView) { ChildEventingList childEventingList = mCachedChildEventingList; if (childEventingList == null) { childEventingList = new ChildEventingList(); } mCachedChildEventingList = null; childEventingList.acquire(parentElement, documentView); return childEventingList; }
Source:
<code>public ExpressionRewriter(Expression<T> expression) { <START> super(); <END> this.expression = expression; }</code><technical_language>Call default super() constructor is implied. This is a question of style, eyes hurt... Feel free ignore</technical_language>

Target:
public ExpressionRewriter(Expression<T> expression) { this.expression = expression; }
Source:
<code>public NamedCounters(String[] initialCounterNames) { this.counters = Maps.newHashMap(); <START> for (String initialCounterName : initialCounterNames) { <END> this.counters.put(initialCounterName, 0L); } }</code><technical_language>add preconditions check assuring initialCounterNames null</technical_language>

Target:
public NamedCounters(String[] initialCounterNames) { Preconditions.checkNotNull(initialCounterNames); this.counters = Maps.newHashMap(); for (String initialCounterName : initialCounterNames) { this.counters.put(initialCounterName, 0L); } }
Source:
<code>public MachineTokenAccessFilter() { allowedMethods.putAll( "/workspace", asList("getByKey", "addProject", "updateProject", "deleteProject")); allowedMethods.putAll("/ssh", asList("getPair", "generatePair")); allowedMethods.put("/preferences", "find"); <START> allowedMethods.put("/activity", "active"); <END> }</code><technical_language>more service accessible machine token - Factory Service. <LINK_0> plans accessible</technical_language>

Target:
public MachineTokenAccessFilter() { allowedMethodsByPath.putAll( "/workspace", asList("getByKey", "addProject", "updateProject", "deleteProject")); allowedMethodsByPath.putAll("/ssh", asList("getPair", "generatePair")); allowedMethodsByPath.putAll( "/factory", asList("getFactoryJson", "getFactory", "getFactoryByAttribute", "resolveFactory")); allowedMethodsByPath.put("/preferences", "find"); allowedMethodsByPath.put("/activity", "active"); }
Source:
<code>public boolean setNamespaceRoutingData(String namespace, Map<String, List<String>> routingData) { synchronized (this) { <START> if (!_routingDataWriterMap.containsKey(namespace)) { <END> throw new IllegalArgumentException( "Failed to set routing data: Namespace " + namespace + " is not found!"); } boolean result = _routingDataWriterMap.get(namespace).setRoutingData(routingData); refreshRoutingData(namespace); return result; } }</code><technical_language>This is double lock checking. want check synchronized improves performance. Considering namespace is changed, check in synchronized block</technical_language>

Target:
public boolean setNamespaceRoutingData(String namespace, Map<String, List<String>> routingData) { if (!_routingDataWriterMap.containsKey(namespace)) { throw new IllegalArgumentException( "Failed to set routing data: Namespace " + namespace + " is not found!"); } synchronized (this) { boolean result = _routingDataWriterMap.get(namespace).setRoutingData(routingData); refreshRoutingData(namespace); return result; } }
Source:
<code>private InputStream getInputStreamFromResource( String resource, ProgressCallback extractionCallback) throws GeoEntryExtractionException, GeoNamesRemoteDownloadException { if (!urlValidator.isValid(resource) && FilenameUtils.isExtension(resource, "zip")) { InputStream inputStream = getFileInputStream(resource); return unZipInputStream(resource, inputStream); } else if (!urlValidator.isValid(resource) && FilenameUtils.isExtension(resource, "txt")) { return getFileInputStream(resource); } else if (StringUtils.isNotBlank(resource)) { if (!StringUtils.isAlphanumeric(resource) && !urlValidator.isValid(resource)) { throw new GeoEntryExtractionException( String.format( <START> "Unable to update the index. The file at %s is not a supported path.", resource)); <END> } if (resource.equalsIgnoreCase("all")) { resource = "allCountries"; } else if (resource.matches("((?i)cities[0-9]+)")) { resource = resource.toLowerCase(); } else if (!resource.equalsIgnoreCase("allCountries") && !urlValidator.isValid(resource)) { resource = resource.toUpperCase(); } Response response = createConnection(resource); InputStream urlInputStream = getUrlInputStreamFromWebClient(); InputStream inputStream = getInputStreamFromUrl(resource, response, urlInputStream, extractionCallback); return unZipInputStream(resource, inputStream); } throw new GeoEntryExtractionException( "Unable to update the index. " + resource + " is not a .zip or .txt, or an invalid country code was entered."); }</code><technical_language>Unable update index. %s is a supported file path</technical_language>

Target:
private InputStream getInputStreamFromResource( String resource, ProgressCallback extractionCallback) throws GeoEntryExtractionException, GeoNamesRemoteDownloadException { boolean resourceIsValidUrl = URL_VALIDATOR.isValid(resource); if (!resourceIsValidUrl && FilenameUtils.isExtension(resource, "zip")) { InputStream inputStream = getFileInputStream(resource); return unZipInputStream(resource, inputStream); } else if (!resourceIsValidUrl && FilenameUtils.isExtension(resource, "txt")) { return getFileInputStream(resource); } else if (StringUtils.isNotBlank(resource)) { if (!StringUtils.isAlphanumeric(resource) && !resourceIsValidUrl) { throw new GeoEntryExtractionException( String.format( "Unable to update the index. %s is not a supported file path.", resource)); } if (resource.equalsIgnoreCase("all")) { resource = "allCountries"; } else if (resource.matches("((?i)cities[0-9]+)")) { resource = resource.toLowerCase(); } else if (!resource.equalsIgnoreCase("allCountries") && !resourceIsValidUrl) { resource = resource.toUpperCase(); } Response response = createConnection(resource); InputStream urlInputStream = getUrlInputStreamFromWebClient(); InputStream inputStream = getInputStreamFromUrl(resource, response, urlInputStream, extractionCallback); return unZipInputStream(resource, inputStream); } throw new GeoEntryExtractionException( "Unable to update the index. " + resource + " is not a .zip or .txt, or an invalid country code was entered."); }
Source:
<code><START> public void whenChangingPINIfPINIsTooLongThrowAnException() { <END> alarmSystem.changePIN(INVALID_PIN, TOO_LONG_PIN); }</code><technical_language>D'habitude dit pas ...THENThrowAnException</technical_language>

Target:
public void whenChangingPINIfPINIsTooLongThrowAnException() { alarmSystem.changePIN(VALID_PIN, TOO_LONG_PIN); }