Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Advanced @Contract capabilities

オープン
#30 コメント 3 件 リアクション 3 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
java
領域
tooling

調査の方向性

まず、この issue の Contract アノテーションと例の構文を確認し、提案されている CacheReference と Reference の動作も確認してください。スタンドアロンの高度なコントラクト構文を仕様として定義できるか、またどのような検証ルールが必要かを判断してください。構文とサポートされる動作が明確に定義され、合意されれば作業完了です。

索引モデルが issue の本文から書いたものです。

説明

I was thinking about possible extra possibilities for the Contract annotation.
I have this example already; I will add more as I stumble upon them:
Consider this method:

    @Contract("CacheReference -> param1; null -> fail; !null -> new")
    protected abstract CacheReference<K, V> advanceIntoCacheRef(Reference<V> reference);

The method should do the following things; as described by the contract:

  • Throw an NPE, if the parameter is null
  • Wrap the parameter Reference (if not instanceof CacheReference, else see next) into a CacheReference
  • Return first parameter if the first parameter is instanceof CacheReference (which is already imported due to return type; return types should be validated by paramN)

Now, obviously this contract won't work, because it doesn't know about more things than nulls; really. Given other capabilities of IntelliJ, it should be fairly easy coming up with a simple, standalone concept for advanced Contract syntax.

主要言語
Kotlin
スター
464
フォーク
74
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

JetBrains/java-annotations のほかの issue

JetBrains/java-annotations の issue をすべて見る

似ている issue

Kotlin の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。