mirror of
https://github.com/github/codeql.git
synced 2025-12-17 09:13:20 +01:00
126 lines
2.4 KiB
Java
126 lines
2.4 KiB
Java
/*>>> import org.checkerframework.checker.nullness.qual.Nullable;*/
|
|
public class CommentedCode {
|
|
|
|
public static int method(){
|
|
// int commentedOutCode = 6;
|
|
|
|
// int commentedOutCode = 6; // with a trailing comment
|
|
|
|
// String s = "commented code with";
|
|
//
|
|
//
|
|
//
|
|
// String t = "many blank lines";
|
|
|
|
// not commented-out code
|
|
|
|
// not commented-out code
|
|
// on multiple lines
|
|
// ending with a semicolon;
|
|
|
|
/** javadoc style comment */
|
|
|
|
/**
|
|
* javadoc style comment with code tags:
|
|
* <code>
|
|
* int looksLikeCode;
|
|
* int butIsnt;
|
|
* for(int i=1;i<100;i++){
|
|
* System.out.println("not code!!!");
|
|
* }
|
|
* </code>
|
|
*/
|
|
|
|
/**
|
|
* javadoc style comment with pre tags:
|
|
* <pre>
|
|
* int looksLikeCode;
|
|
* int butIsnt;
|
|
* for(int i=1;i<100;i++){
|
|
* System.out.println("not code!!!");
|
|
* }
|
|
* </pre>
|
|
*/
|
|
|
|
/**
|
|
* int blockCommentedCode;
|
|
* for(int i=1;i<100;i++){
|
|
* System.out.println("this is code!!!");
|
|
* }
|
|
*/
|
|
|
|
/**
|
|
* JavaDoc style comment containing HTML entities (e.g. for documentation of XML-related things). The semicolons should not trigger any alerts.
|
|
*
|
|
* >
|
|
* >
|
|
* >
|
|
*/
|
|
|
|
/**
|
|
* JavaDoc style comment containing HTML entities (e.g. for documentation of XML-related things). The semicolons should not trigger any alerts.
|
|
*
|
|
* à
|
|
* à
|
|
* à
|
|
*/
|
|
|
|
/**
|
|
* JavaDoc style comment containing HTML entities using decimal encoding. The semicolons should not trigger any alerts.
|
|
*
|
|
* à
|
|
* à
|
|
* à
|
|
*/
|
|
|
|
/**
|
|
* JavaDoc style comment containing HTML entities using hexadecimal encoding. The semicolons should not trigger any alerts.
|
|
*
|
|
* ̀F;
|
|
* ̀F;
|
|
* ̀F;
|
|
*/
|
|
|
|
/**
|
|
* Incorrect HTML entities should trigger alert on semicolon
|
|
*
|
|
*   ;
|
|
*   ;
|
|
*   ;
|
|
*/
|
|
}
|
|
|
|
// public static int commentedOutMethod(){
|
|
//
|
|
// return 123;
|
|
//
|
|
// }
|
|
|
|
// JSNI
|
|
class Element {}
|
|
public native void scrollTo(Element elem) /*-{
|
|
elem.scrollIntoView(true);
|
|
}-*/;
|
|
|
|
String empty = ""; //$NON-NLS-1$
|
|
String alsoEmpty = "" + ""; //$NON-NLS-1$ //$NON-NLS-2$
|
|
|
|
// Java Modeling Language (JML) comments
|
|
//@ assert ...;
|
|
//@ assert ...;
|
|
|
|
//
|
|
// /*
|
|
// *
|
|
// */
|
|
// /**
|
|
// *
|
|
// */
|
|
// @Deprecated
|
|
// void commentedOutMethodWithAnnotationsAndEmptyComments() {}
|
|
|
|
/***
|
|
System.out.println("");
|
|
***/
|
|
}
|