Fix lower bounds handling of getNearestValidPage

v2-dev
William 2 years ago
parent a4b168ad61
commit 00a0f22025

@ -0,0 +1,136 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AutoImportSettings">
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="1adcdbad-26db-47ae-b8e5-83088ba9f2ff" name="Changes" comment="Fix no builders for page button formats">
<change afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="ExternalProjectsData">
<projectState path="$PROJECT_DIR$">
<ProjectState />
</projectState>
</component>
<component name="ExternalProjectsManager">
<system id="GRADLE">
<state>
<task path="$PROJECT_DIR$">
<activation />
</task>
<projects_view>
<tree_state>
<expand />
<select />
</tree_state>
</projects_view>
</state>
</system>
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="MarkdownSettingsMigration">
<option name="stateVersion" value="1" />
</component>
<component name="ProjectId" id="2DSMko7ShF9uNBu7SRyaCBbt3Yc" />
<component name="ProjectLevelVcsManager" settingsEditedManually="true" />
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent">{
&quot;keyToString&quot;: {
&quot;RunOnceActivity.OpenProjectViewOnStart&quot;: &quot;true&quot;,
&quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
&quot;WebServerToolWindowFactoryState&quot;: &quot;false&quot;,
&quot;nodejs_package_manager_path&quot;: &quot;npm&quot;
}
}</component>
<component name="RunManager">
<configuration name="PagineDown build" type="GradleRunConfiguration" factoryName="Gradle">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value="clean" />
<option value="build" />
<option value="publish" />
</list>
</option>
<option name="vmOptions" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<method v="2" />
</configuration>
</component>
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="1adcdbad-26db-47ae-b8e5-83088ba9f2ff" name="Changes" comment="" />
<created>1660688177518</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1660688177518</updated>
<workItem from="1660688178768" duration="664000" />
<workItem from="1660734365241" duration="1564000" />
</task>
<task id="LOCAL-00001" summary="Make gradlew executable">
<created>1660688283740</created>
<option name="number" value="00001" />
<option name="presentableId" value="LOCAL-00001" />
<option name="project" value="LOCAL" />
<updated>1660688283740</updated>
</task>
<task id="LOCAL-00002" summary="Fix javadoc encoding and warnings">
<created>1660688500671</created>
<option name="number" value="00002" />
<option name="presentableId" value="LOCAL-00002" />
<option name="project" value="LOCAL" />
<updated>1660688500671</updated>
</task>
<task id="LOCAL-00003" summary="Fix no builders for page button formats">
<created>1660735113793</created>
<option name="number" value="00003" />
<option name="presentableId" value="LOCAL-00003" />
<option name="project" value="LOCAL" />
<updated>1660735113793</updated>
</task>
<option name="localTasksCounter" value="4" />
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="3" />
</component>
<component name="Vcs.Log.Tabs.Properties">
<option name="TAB_STATES">
<map>
<entry key="MAIN">
<value>
<State />
</value>
</entry>
</map>
</option>
</component>
<component name="VcsManagerConfiguration">
<MESSAGE value="Initial commit" />
<MESSAGE value="Make gradlew executable" />
<MESSAGE value="Fix javadoc encoding and warnings" />
<MESSAGE value="Fix no builders for page button formats" />
<option name="LAST_COMMIT_MESSAGE" value="Fix no builders for page button formats" />
</component>
</project>

@ -84,7 +84,7 @@ public class PaginatedList {
*/ */
@NotNull @NotNull
public MineDown getNearestValidPage(final int page) { public MineDown getNearestValidPage(final int page) {
return getPage(Math.max(0, Math.min(getTotalPages(), page))); return getPage(Math.max(1, Math.min(getTotalPages(), page)));
} }
/** /**

Loading…
Cancel
Save