forked from hyperledger-web3j/web3j
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request hyperledger-web3j#436 from mushketyk/transaction-r…
…eturn-warning Outputs a warning when non-constant function returns a value
- Loading branch information
Showing
5 changed files
with
78 additions
and
2 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
codegen/src/main/java/org/web3j/codegen/GenerationReporter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package org.web3j.codegen; | ||
|
||
/** | ||
* Can be used to provide report about a code generation process. | ||
*/ | ||
interface GenerationReporter { | ||
void report(String msg); | ||
} |
20 changes: 20 additions & 0 deletions
20
codegen/src/main/java/org/web3j/codegen/LogGenerationReporter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package org.web3j.codegen; | ||
|
||
import org.slf4j.Logger; | ||
|
||
/** | ||
* A reporter generation that outputs messages using a logger instance. | ||
*/ | ||
class LogGenerationReporter implements GenerationReporter { | ||
|
||
private final Logger logger; | ||
|
||
public LogGenerationReporter(Logger logger) { | ||
this.logger = logger; | ||
} | ||
|
||
@Override | ||
public void report(String msg) { | ||
logger.warn(msg); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters