{"record":{"id":"c3d19e7206d578f9","repo":"theonedev/onedev","slug":"not-a-changed-file","errorCode":null,"errorMessage":"Not a changed file: ","messagePattern":"Not a changed file: ","errorType":"exception","errorClass":"ExplicitException","httpStatus":null,"severity":"error","filePath":"server-core/src/main/java/io/onedev/server/web/page/project/workspaces/detail/changes/WorkspaceChangesPage.java","lineNumber":140,"sourceCode":"\t\taddRepositorySections(sidebar);\n\n\t\tdiffContent = new WebMarkupContainer(\"diffContent\");\n\t\tdiffContent.setOutputMarkupPlaceholderTag(true);\n\t\tdiffContent.setVisible(false);\n\t\tadd(diffContent);\n\n\t\tdiffContent.add(new Label(\"diffFileName\", \"\"));\n\t\tdiffContent.add(new WebMarkupContainer(\"diffPanel\"));\n\n\t\tnoSelection = new WebMarkupContainer(\"noSelection\");\n\t\tnoSelection.setOutputMarkupPlaceholderTag(true);\n\t\tadd(noSelection);\n\n\t\tif (selectedFile != null) {\n\t\t\tRepositoryInfo repository = findSelectedRepository();\n\t\t\tFileEntry found = findSelectedFileEntry(repository);\n\t\t\tif (found == null)\n\t\t\t\tthrow new ExplicitException(\"Not a changed file: \" + selectedFile);\n\t\t\tselectedStaged = found.staged;\n\t\t\tselectedConflicted = found.conflicted;\n\t\t\tshowDiffContent(repository, found);\n\t\t}\n\t}\n\n\tprivate void addRepositorySections(WebMarkupContainer container) {\n\t\tList<RepositoryInfo> repositories = repositoriesModel.getObject();\n\t\tcontainer.add(new ListView<>(\"repositorySections\", repositories) {\n\n\t\t\t@Override\n\t\t\tprotected void populateItem(ListItem<RepositoryInfo> item) {\n\t\t\t\tif (repositories.size() == 1)\n\t\t\t\t\titem.add(AttributeAppender.append(\"class\", \" flex-grow-1 min-height-0\"));\n\t\t\t\tRepositoryInfo repository = item.getModelObject();\n\t\t\t\tLabel title = new Label(\"repositoryTitle\",\n\t\t\t\t\t\trepository.path.isEmpty()\n\t\t\t\t\t\t\t\t? _T(\"Main Repository\")","sourceCodeStart":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/theonedev/onedev/blob/d44925c47c37992c828ea673a5f9620539bc3ff2/server-core/src/main/java/io/onedev/server/web/page/project/workspaces/detail/changes/WorkspaceChangesPage.java#L122-L158","documentation":"WorkspaceChangesPage.onInitialize resolves the file selected via the 'selectedFile' parameter among the workspace's changed/conflicted file entries. If findSelectedFileEntry cannot match it, it throws ExplicitException('Not a changed file: ' + selectedFile), because a diff can only be shown for files that actually changed in the workspace.","triggerScenarios":"Requesting WorkspaceChangesPage with a selectedFile path that is not among the workspace's changed entries — e.g. the file's changes were committed or reverted after the link was generated, the path is misspelled, or the file belongs to a different repository within the workspace.","commonSituations":"Stale link after committing/reverting workspace changes; selecting a file then switching workspace branch/state; hand-crafted URL with an arbitrary path.","solutions":["Reload the workspace changes page without the selectedFile parameter and pick the file from the current change list.","Verify the file still has pending (staged/unstaged) changes in the workspace.","Commit or discard the file's changes if it should no longer appear as changed.","Check the path matches the repository-relative path exactly (case-sensitive)."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"FileEntry found = findSelectedFileEntry(repository);\nif (found == null) { /* omit selection, show plain changes list */ }","typeGuard":null,"tryCatchPattern":"try {\n  showDiffContent(repository, found);\n} catch (ExplicitException e) {\n  // clear stale selectedFile param and re-render changes list\n}","preventionTips":["Only pass selectedFile values taken from the current changes list.","Re-derive the change set after commits/reverts before linking to a file diff.","Avoid persisting selectedFile in bookmarks.","Compare paths case-sensitively against the change list."],"tags":["wicket","workspace","diff"],"backgroundTag":"invalid-argument-value","analyzedSha":"d44925c47c37992c828ea673a5f9620539bc3ff2","analyzedAt":"2026-09-06T07:18:27.995Z","contentChangedAt":"2026-09-06T07:18:27.995Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}