Skip to content

Add detailed error message corresponding to the IndexOutOfBoundsException while calling getEntry(...)#10386

Merged
normanmaurer merged 2 commits intonetty:4.1from
seedeed:exception
Jul 6, 2020
Merged

Add detailed error message corresponding to the IndexOutOfBoundsException while calling getEntry(...)#10386
normanmaurer merged 2 commits intonetty:4.1from
seedeed:exception

Conversation

@seedeed
Copy link
Copy Markdown
Contributor

@seedeed seedeed commented Jul 1, 2020

Motivation:
getEntry(...) may throw an IndexOutOfBoundsException without any error messages.

Modification:

Add detailed error message corresponding to the IndexOutOfBoundsException while calling getEntry(...) in HpackDynamicTable.java.

@netty-bot
Copy link
Copy Markdown

Can one of the admins verify this patch?

3 similar comments
@netty-bot
Copy link
Copy Markdown

Can one of the admins verify this patch?

@netty-bot
Copy link
Copy Markdown

Can one of the admins verify this patch?

@netty-bot
Copy link
Copy Markdown

Can one of the admins verify this patch?

Comment on lines +86 to +87
throw new IndexOutOfBoundsException("expected: 0 < index(" + index + ") <= length("
+ length() + ')');
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JDK9 introduced the Objects.checkIndex​(int index, int length) method. Consider using the wording consistent with that error message:

https://github.com/AdoptOpenJDK/openjdk-jdk11/blob/19fb8f93c59dfd791f62d41f332db9e306bc1422/src/java.base/share/classes/jdk/internal/util/Preconditions.java#L188-L189

@normanmaurer
Copy link
Copy Markdown
Member

@seedeed please let me know once I should re-review.

@normanmaurer
Copy link
Copy Markdown
Member

@netty-bot test this please

@seedeed
Copy link
Copy Markdown
Contributor Author

seedeed commented Jul 2, 2020

@normanmaurer PTAL

@normanmaurer
Copy link
Copy Markdown
Member

@netty-bot test this please

@normanmaurer normanmaurer merged commit 7a05aa1 into netty:4.1 Jul 6, 2020
normanmaurer pushed a commit that referenced this pull request Jul 6, 2020
…tion while calling getEntry(...) (#10386)

Motivation:
`getEntry(...)` may throw an IndexOutOfBoundsException without any error messages.


Modification:

Add detailed error message corresponding to the IndexOutOfBoundsException while calling `getEntry(...)` in HpackDynamicTable.java.

Result: 

Easier to debug
Kvicii pushed a commit to Kvicii/netty that referenced this pull request Jul 20, 2020
* '4.1-read' of github.com:Kvicii/netty: (43 commits)
  Make the TLSv1.3 check more robust and not depend on the Java version… (netty#10409)
  Reduce the scope of synchronized block in PoolArena (netty#10410)
  Add IndexOutOfBoundsException error message (netty#10405)
  Add default handling for switch statement (netty#10408)
  Review PooledByteBufAllocator in respect of jemalloc 4.x changes and update allocate algorithm.(netty#10267)
  Support session cache for client and server when using native SSLEngine implementation (netty#10331)
  Simple fix typo (netty#10403)
  Eliminate a redundant method call in HpackDynamicTable.add(...) (netty#10399)
  jdk.tls.client.enableSessionTicketExtension must be respected by OPENSSL and OPENSSL_REFCNT SslProviders (netty#10401)
  重新编译4.1分支
  [maven-release-plugin] prepare for next development iteration
  [maven-release-plugin] prepare release netty-4.1.51.Final
  Correctly return NEED_WRAP if we produced some data even if we could not consume any during SSLEngine.wrap(...) (netty#10396)
  Modify OpenSSL native library loading to accommodate GraalVM (netty#10395)
  Update to netty-tcnative 2.0.31.Final and make SslErrorTest more robust (netty#10392)
  Add option to HttpObjectDecoder to allow duplicate Content-Lengths (netty#10349)
  Add detailed error message corresponding to the IndexOutOfBoundsException while calling getEntry(...) (netty#10386)
  Do not report ReferenceCountedOpenSslClientContext$ExtendedTrustManagerVerifyCallback.verify as blocking call (netty#10387)
  Add unit test for HpackDynamicTable. (netty#10389)
  netty用于测试的内嵌Channel | ChannelInboundHandler主要方法
  ...
ihanyong pushed a commit to ihanyong/netty that referenced this pull request Jul 31, 2020
…tion while calling getEntry(...) (netty#10386)

Motivation:
`getEntry(...)` may throw an IndexOutOfBoundsException without any error messages.


Modification:

Add detailed error message corresponding to the IndexOutOfBoundsException while calling `getEntry(...)` in HpackDynamicTable.java.

Result: 

Easier to debug
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants