mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 15:19:59 +07:00
IDEA-368449 Modify NPE message in console for Java 30th anniversary - review IJ-CR-157699
(cherry picked from commit 6b62e3a667907da7a1dfec9e5432aef22d3b9ee8) (cherry picked from commit a1570d664c669ec6231935f28b7677cc78ec60b0) GitOrigin-RevId: b66b45489b48901d7242a4200f0026f8e7b8c763
This commit is contained in:
committed by
intellij-monorepo-bot
parent
4c3595139d
commit
09c679ef2b
@@ -0,0 +1,57 @@
|
||||
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.execution.filters
|
||||
|
||||
import com.intellij.codeInsight.hints.presentation.PresentationFactory
|
||||
import com.intellij.codeInsight.hints.presentation.PresentationRenderer
|
||||
import com.intellij.execution.filters.Filter.ResultItem
|
||||
import com.intellij.execution.impl.InlayProvider
|
||||
import com.intellij.icons.AllIcons
|
||||
import com.intellij.openapi.editor.Editor
|
||||
import com.intellij.openapi.editor.EditorCustomElementRenderer
|
||||
import com.intellij.openapi.editor.Inlay
|
||||
import com.intellij.openapi.util.registry.Registry
|
||||
import com.intellij.psi.PsiClass
|
||||
import java.time.LocalDate
|
||||
|
||||
class JavaExceptionFilter : JvmExceptionOccurrenceFilter {
|
||||
override fun applyFilter(
|
||||
exceptionClassName: String,
|
||||
classes: MutableList<PsiClass?>,
|
||||
exceptionStartOffset: Int,
|
||||
): ResultItem? {
|
||||
with(Registry.get("java.exceptions.anniversary.banner")) {
|
||||
if (isOptionEnabled("off")) {
|
||||
return null
|
||||
}
|
||||
if (isOptionEnabled("on")) {
|
||||
val startDate = LocalDate.of(2025, 5, 23)
|
||||
val endDate = LocalDate.of(2025, 5, 30)
|
||||
if (LocalDate.now() !in startDate..endDate) {
|
||||
return null
|
||||
}
|
||||
}
|
||||
}
|
||||
return CreateExceptionBreakpointResult(exceptionStartOffset, exceptionStartOffset + exceptionClassName.length)
|
||||
}
|
||||
|
||||
private class CreateExceptionBreakpointResult(highlightStartOffset: Int, highlightEndOffset: Int) : ResultItem(highlightStartOffset, highlightEndOffset, null), InlayProvider {
|
||||
override fun createInlay(editor: Editor, offset: Int): Inlay<*>? {
|
||||
return editor.getInlayModel().addBlockElement<EditorCustomElementRenderer?>(offset, true, false, 0, createInlayRenderer(editor))
|
||||
}
|
||||
|
||||
override fun createInlayRenderer(editor: Editor): EditorCustomElementRenderer {
|
||||
val presentation = with(PresentationFactory(editor)) {
|
||||
roundWithBackground(
|
||||
seq(
|
||||
smallScaledIcon(AllIcons.Promo.JavaDuke),
|
||||
inset(
|
||||
smallText("from Java with love - happy 30th anniversary! (captured by IntelliJ IDEA)"),
|
||||
left = 6, top = 1, down = 1
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
||||
return PresentationRenderer(presentation)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -934,6 +934,7 @@
|
||||
<consoleFilterProvider implementation="com.intellij.execution.impl.JavaDebuggerConsoleFilterProvider"/>
|
||||
<jvm.exceptionFilter implementation="com.intellij.debugger.impl.attach.JavaDebuggerAddExceptionBreakpointFilter"/>
|
||||
<jvm.exceptionFilter implementation="com.intellij.execution.filters.NavigateToExceptionClassFilter"/>
|
||||
<jvm.exceptionFilter implementation="com.intellij.execution.filters.JavaExceptionFilter"/>
|
||||
|
||||
<xdebugger.breakpointType implementation="com.intellij.debugger.ui.breakpoints.JavaCollectionBreakpointType"/>
|
||||
<xdebugger.breakpointType implementation="com.intellij.debugger.ui.breakpoints.JavaMethodBreakpointType"/>
|
||||
|
||||
6
platform/icons/src/promo/javaDuke.svg
Normal file
6
platform/icons/src/promo/javaDuke.svg
Normal file
@@ -0,0 +1,6 @@
|
||||
<!-- Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -->
|
||||
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M3.49385 14C-1.00003 14 6.02999 0 6.99303 0C7.95608 0 15 14 10.4931 14C9 14 8.99308 12.5 6.98782 12.5C4.98256 12.5 4.99999 14 3.49385 14Z" fill="#EBECF0"/>
|
||||
<ellipse cx="7" cy="6.5" rx="2" ry="1.5" fill="#F80000"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M2.05015 11.2573L0.646447 9.85359C0.451184 9.65833 0.451184 9.34175 0.646447 9.14648L3.45333 6.3396C4.75892 3.07304 6.54183 0 6.99303 0C7.44354 0 9.22472 3.06361 10.5317 6.32457L13.3536 9.14648C13.5489 9.34175 13.5489 9.65833 13.3536 9.85359L11.9431 11.2641C12.1199 12.8756 11.7703 14 10.4931 14C9.80149 14 9.42875 13.6782 9.02859 13.3327C8.56483 12.9322 8.06424 12.5 6.98782 12.5C5.91356 12.5 5.41981 12.9305 4.96133 13.3302C4.56398 13.6767 4.19313 14 3.49385 14C2.2185 14 1.87129 12.8724 2.05015 11.2573ZM3.16733 12.8763C3.20105 12.9311 3.24345 13 3.49385 13C3.81294 13 3.91653 12.9106 4.36747 12.5213L4.40035 12.4929C4.63301 12.2921 4.95221 12.0284 5.38775 11.8268C5.83388 11.6204 6.35363 11.5 6.98782 11.5C7.62202 11.5 8.1423 11.6204 8.58913 11.8258C9.02546 12.0263 9.34673 12.2887 9.58201 12.4896L9.61536 12.5181C10.0746 12.9106 10.1793 13 10.4931 13C10.7469 13 10.7903 12.9297 10.8244 12.8746L10.8258 12.8723C10.91 12.7361 11.0019 12.4244 10.9835 11.8442C10.9473 10.7026 10.5088 9.0795 9.85845 7.35241L9.84229 7.30958C9.66784 7.74044 9.36465 8.09784 9.01421 8.36066C8.46317 8.77394 7.74773 9 7 9C6.25227 9 5.53683 8.77394 4.98579 8.36066C4.63236 8.09559 4.32697 7.73432 4.15326 7.29851L4.1331 7.35198C3.48365 9.07906 3.04548 10.7025 3.0088 11.8446C2.99015 12.4252 3.08165 12.7373 3.16574 12.8737L3.16733 12.8763ZM2.66476 8.54239L1.70711 9.50004L2.25728 10.0502C2.36489 9.56759 2.50327 9.06093 2.66476 8.54239ZM11.7366 10.0564C11.6279 9.56834 11.4876 9.05562 11.3237 8.53083L12.2929 9.50004L11.7366 10.0564ZM7 8C8.10457 8 9 7.32843 9 6.5C9 5.67157 8.10457 5 7 5C5.89543 5 5 5.67157 5 6.5C5 7.32843 5.89543 8 7 8Z" fill="black"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.1 KiB |
6
platform/icons/src/promo/javaDuke_dark.svg
Normal file
6
platform/icons/src/promo/javaDuke_dark.svg
Normal file
@@ -0,0 +1,6 @@
|
||||
<!-- Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -->
|
||||
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M3.49385 14C-1.00003 14 6.02999 0 6.99303 0C7.95608 0 15 14 10.4931 14C9 14 8.99308 12.5 6.98782 12.5C4.98256 12.5 4.99999 14 3.49385 14Z" fill="#43454A"/>
|
||||
<ellipse cx="7" cy="6.5" rx="2" ry="1.5" fill="#F80000"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M2.05015 11.2573L0.646447 9.85359C0.451184 9.65833 0.451184 9.34175 0.646447 9.14648L3.45333 6.3396C4.75892 3.07304 6.54183 0 6.99303 0C7.44354 0 9.22472 3.06361 10.5317 6.32457L13.3536 9.14648C13.5489 9.34175 13.5489 9.65833 13.3536 9.85359L11.9431 11.2641C12.1199 12.8756 11.7703 14 10.4931 14C9.80149 14 9.42875 13.6782 9.02859 13.3327C8.56483 12.9322 8.06424 12.5 6.98782 12.5C5.91356 12.5 5.41981 12.9305 4.96133 13.3302C4.56398 13.6767 4.19313 14 3.49385 14C2.2185 14 1.87129 12.8724 2.05015 11.2573ZM3.16733 12.8763C3.20105 12.9311 3.24345 13 3.49385 13C3.81294 13 3.91653 12.9106 4.36747 12.5213L4.40035 12.4929C4.63301 12.2921 4.95221 12.0284 5.38775 11.8268C5.83388 11.6204 6.35363 11.5 6.98782 11.5C7.62202 11.5 8.1423 11.6204 8.58913 11.8258C9.02546 12.0263 9.34673 12.2887 9.58201 12.4896L9.61536 12.5181C10.0746 12.9106 10.1793 13 10.4931 13C10.7469 13 10.7903 12.9297 10.8244 12.8746L10.8258 12.8723C10.91 12.7361 11.0019 12.4244 10.9835 11.8442C10.9473 10.7026 10.5088 9.0795 9.85845 7.35241L9.84229 7.30958C9.66784 7.74044 9.36465 8.09784 9.01421 8.36066C8.46317 8.77394 7.74773 9 7 9C6.25227 9 5.53683 8.77394 4.98579 8.36066C4.63236 8.09559 4.32697 7.73432 4.15326 7.29851L4.1331 7.35198C3.48365 9.07906 3.04548 10.7025 3.0088 11.8446C2.99015 12.4252 3.08165 12.7373 3.16574 12.8737L3.16733 12.8763ZM2.66476 8.54239L1.70711 9.50004L2.25728 10.0502C2.36489 9.56759 2.50327 9.06093 2.66476 8.54239ZM11.7366 10.0564C11.6279 9.56834 11.4876 9.05562 11.3237 8.53083L12.2929 9.50004L11.7366 10.0564ZM7 8C8.10457 8 9 7.32843 9 6.5C9 5.67157 8.10457 5 7 5C5.89543 5 5 5.67157 5 6.5C5 7.32843 5.89543 8 7 8Z" fill="white"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.1 KiB |
@@ -701,6 +701,9 @@ debugger.hotswap.floating.toolbar.description=Show a floating toolbar with a hot
|
||||
debugger.hotswap.show.ide.popup=false
|
||||
debugger.hotswap.show.ide.popup.description=Show hot swap successful notification as a popup, or regular notification otherwise
|
||||
|
||||
java.exceptions.anniversary.banner=[on*|off|force]
|
||||
java.exceptions.anniversary.banner.description=Show the java anniversary banner in the console
|
||||
|
||||
index.run.configuration.jre=false
|
||||
index.run.configuration.jre.restartRequired=true
|
||||
index.run.configuration.jre.description=Index jre specified in run configuration for goto navigation etc.
|
||||
|
||||
@@ -1067,6 +1067,9 @@ f:com.intellij.icons.AllIcons$Profiler
|
||||
- sf:ExpandNode:javax.swing.Icon
|
||||
- sf:Rec:javax.swing.Icon
|
||||
- <init>():V
|
||||
f:com.intellij.icons.AllIcons$Promo
|
||||
- sf:JavaDuke:javax.swing.Icon
|
||||
- <init>():V
|
||||
f:com.intellij.icons.AllIcons$Providers
|
||||
- sf:ActiveMQ:javax.swing.Icon
|
||||
- sf:Apache:javax.swing.Icon
|
||||
|
||||
@@ -1137,6 +1137,10 @@ public class AllIcons {
|
||||
/** 12x12 */ public static final @NotNull Icon Rec = load("expui/profiler/rec.svg", "profiler/rec.svg", 204716318, 2);
|
||||
}
|
||||
|
||||
public static final class Promo {
|
||||
/** 14x14 */ public static final @NotNull Icon JavaDuke = load("promo/javaDuke.svg", 820578884, 2);
|
||||
}
|
||||
|
||||
public static final class Providers {
|
||||
/** 16x16 */ public static final @NotNull Icon ActiveMQ = load("providers/activeMQ.svg", -1202590345, 0);
|
||||
/** 16x16 */ public static final @NotNull Icon Apache = load("providers/apache.svg", 1920166272, 2);
|
||||
|
||||
Reference in New Issue
Block a user