signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class Expressions { /** * Create a new Template expression
* @ deprecated Use { @ link # simpleTemplate ( Class , String , List ) } instead .
* @ param cl type of expression
* @ param template template
* @ param args template parameters
* @ return template expression */
@ Deprecated public static < T > SimpleTemplate < T > simpleTemplate ( Class < ? extends T > cl , String template , ImmutableList < ? > args ) { } } | return simpleTemplate ( cl , createTemplate ( template ) , args ) ; |
public class UpdateDomainContactPrivacyRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( UpdateDomainContactPrivacyRequest updateDomainContactPrivacyRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( updateDomainContactPrivacyRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( updateDomainContactPrivacyRequest . getDomainName ( ) , DOMAINNAME_BINDING ) ; protocolMarshaller . marshall ( updateDomainContactPrivacyRequest . getAdminPrivacy ( ) , ADMINPRIVACY_BINDING ) ; protocolMarshaller . marshall ( updateDomainContactPrivacyRequest . getRegistrantPrivacy ( ) , REGISTRANTPRIVACY_BINDING ) ; protocolMarshaller . marshall ( updateDomainContactPrivacyRequest . getTechPrivacy ( ) , TECHPRIVACY_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class SameDiff { /** * Return a variable of given shape in which all values have a given constant value .
* @ param name Name of the new SDVariable
* @ param value constant to set for each value
* @ param shape shape of the variable as long array
* @ return A new SDVariable of provided shape with constant value . */
@ Deprecated public SDVariable constant ( String name , SDVariable value , long ... shape ) { } } | SDVariable ret = f ( ) . constant ( value , shape ) ; return updateVariableNameAndReference ( ret , name ) ; |
public class ResourceUtils { /** * Add a package name prefix if the name is not absolute Remove leading " / "
* if name is absolute */
private static String resolveName ( Class < ? > c , String name ) { } } | if ( name == null ) { return name ; } if ( ! name . startsWith ( "/" ) ) { while ( c . isArray ( ) ) { c = c . getComponentType ( ) ; } String baseName = c . getName ( ) ; int index = baseName . lastIndexOf ( '.' ) ; if ( index != - 1 ) { name = baseName . substring ( 0 , index ) . replace ( '.' , '/' ) + "/" + name ; } } else { name = name . substring ( 1 ) ; } return name ; |
public class BitInputStream { /** * Reads a single positive bounded integral value ( up to 64 - bit , including 0 , excluding max )
* @ param max Maximum value ( exclusive )
* @ return A long within the range [ 0 , max )
* @ throws IOException the io exception */
public long readBoundedLong ( final long max ) throws IOException { } } | final int bits = 0 >= max ? 0 : ( int ) ( Math . floor ( Math . log ( max ) / Math . log ( 2 ) ) + 1 ) ; return 0 < bits ? this . read ( bits ) . toLong ( ) : 0 ; |
public class BytecodeScanner { /** * sycklex _ bytecode _ utf8 */
private int real_yylex ( ) throws IOException { } } | Level lvl = null ; QuotedString q = null ; int tok = - 1 ; if ( parser . cursor == - 1 ) { parser . read ( ) ; } if ( parser . force_token != 0 ) { int t = parser . force_token ; parser . force_token = 0 ; return t ; } int mainLoopGoto = Start ; lvl = parser . currentLevel ( ) ; if ( lvl . status == LevelStatus . doc ) { mainLoopGoto = Document ; } parser . token = parser . cursor ; { int gotoPoint = - 1 ; byte yych = ( byte ) 0 ; gotoNext : while ( gotoPoint != - 2 ) { int currentGoto = gotoPoint ; gotoPoint = - 2 ; switch ( currentGoto ) { case - 1 : if ( ( parser . limit - parser . cursor ) < 3 ) parser . read ( ) ; yych = parser . buffer . buffer [ parser . cursor ] ; switch ( yych ) { case 0x00 : { gotoPoint = 2 ; continue gotoNext ; } case 'D' : { gotoPoint = 3 ; continue gotoNext ; } default : { gotoPoint = 5 ; continue gotoNext ; } } case 2 : parser . cursor = parser . marker ; { gotoPoint = 4 ; continue gotoNext ; } case 3 : yych = parser . buffer . buffer [ ( parser . marker = ++ parser . cursor ) ] ; switch ( yych ) { case '\n' : { gotoPoint = 6 ; continue gotoNext ; } case '\r' : { gotoPoint = 8 ; continue gotoNext ; } default : { gotoPoint = 4 ; continue gotoNext ; } } case 4 : { YYPOS ( 0 ) ; mainLoopGoto = Document ; } case 5 : yych = parser . buffer . buffer [ ++ parser . cursor ] ; { gotoPoint = 4 ; continue gotoNext ; } case 6 : ++ parser . cursor ; { if ( lvl . status == LevelStatus . header ) { CHK_NL ( parser . cursor ) ; mainLoopGoto = Directive ; } else { if ( lvl . spaces > - 1 ) { parser . popLevel ( ) ; YYPOS ( 0 ) ; return DefaultYAMLParser . YAML_IEND ; } YYPOS ( 0 ) ; return 0 ; } } case 8 : ++ parser . cursor ; switch ( ( yych = parser . buffer . buffer [ parser . cursor ] ) ) { case '\n' : { gotoPoint = 6 ; continue gotoNext ; } default : { gotoPoint = 2 ; continue gotoNext ; } } } } } do { gotoSomething : while ( true ) { switch ( mainLoopGoto ) { case Start : { } case Document : { lvl = parser . currentLevel ( ) ; if ( lvl . status == LevelStatus . header ) { lvl . status = LevelStatus . doc ; } parser . token = parser . cursor ; int gotoPoint = - 1 ; byte yych = ( byte ) 0 ; gotoNext : while ( gotoPoint != - 2 ) { int currentGoto = gotoPoint ; gotoPoint = - 2 ; switch ( currentGoto ) { case - 1 : if ( ( parser . limit - parser . cursor ) < 3 ) parser . read ( ) ; yych = parser . buffer . buffer [ parser . cursor ] ; switch ( yych ) { case 0x00 : { gotoPoint = 30 ; continue gotoNext ; } case '\n' : { gotoPoint = 27 ; continue gotoNext ; } case '\r' : { gotoPoint = 29 ; continue gotoNext ; } case 'A' : { gotoPoint = 19 ; continue gotoNext ; } case 'D' : { gotoPoint = 12 ; continue gotoNext ; } case 'E' : { gotoPoint = 16 ; continue gotoNext ; } case 'M' : { gotoPoint = 14 ; continue gotoNext ; } case 'P' : { gotoPoint = 13 ; continue gotoNext ; } case 'Q' : { gotoPoint = 15 ; continue gotoNext ; } case 'R' : { gotoPoint = 21 ; continue gotoNext ; } case 'S' : { gotoPoint = 17 ; continue gotoNext ; } case 'T' : { gotoPoint = 23 ; continue gotoNext ; } case 'c' : { gotoPoint = 25 ; continue gotoNext ; } default : { gotoPoint = 11 ; continue gotoNext ; } } case 11 : case 12 : yych = parser . buffer . buffer [ ++ parser . cursor ] ; switch ( yych ) { case '\n' : { gotoPoint = 41 ; continue gotoNext ; } case '\r' : { gotoPoint = 44 ; continue gotoNext ; } default : { gotoPoint = 11 ; continue gotoNext ; } } case 13 : yych = parser . buffer . buffer [ ++ parser . cursor ] ; switch ( yych ) { case '\n' : { gotoPoint = 41 ; continue gotoNext ; } case '\r' : { gotoPoint = 43 ; continue gotoNext ; } default : { gotoPoint = 11 ; continue gotoNext ; } } case 14 : yych = parser . buffer . buffer [ ++ parser . cursor ] ; switch ( yych ) { case '\n' : { gotoPoint = 38 ; continue gotoNext ; } case '\r' : { gotoPoint = 40 ; continue gotoNext ; } default : { gotoPoint = 11 ; continue gotoNext ; } } case 15 : yych = parser . buffer . buffer [ ++ parser . cursor ] ; switch ( yych ) { case '\n' : { gotoPoint = 35 ; continue gotoNext ; } case '\r' : { gotoPoint = 37 ; continue gotoNext ; } default : { gotoPoint = 11 ; continue gotoNext ; } } case 16 : yych = parser . buffer . buffer [ ++ parser . cursor ] ; switch ( yych ) { case '\n' : { gotoPoint = 32 ; continue gotoNext ; } case '\r' : { gotoPoint = 34 ; continue gotoNext ; } default : { gotoPoint = 11 ; continue gotoNext ; } } case 17 : ++ parser . cursor ; { if ( ADD_BYTE_LEVEL ( lvl , lvl . spaces + 1 , LevelStatus . str ) ) { return '-' ; } mainLoopGoto = Scalar ; break gotoSomething ; } case 19 : ++ parser . cursor ; { if ( ADD_BYTE_LEVEL ( lvl , lvl . spaces + 1 , LevelStatus . open ) ) { return '-' ; } lval = getInline ( ) ; parser . removeAnchor ( ( String ) lval ) ; CHK_NL ( parser . cursor ) ; return DefaultYAMLParser . YAML_ANCHOR ; } case 21 : ++ parser . cursor ; { if ( ADD_BYTE_LEVEL ( lvl , lvl . spaces + 1 , LevelStatus . str ) ) { return '-' ; } lval = getInline ( ) ; parser . popLevel ( ) ; if ( parser . buffer . buffer [ parser . cursor - 1 ] == '\n' ) parser . cursor -- ; return DefaultYAMLParser . YAML_ALIAS ; } case 23 : ++ parser . cursor ; { if ( ADD_BYTE_LEVEL ( lvl , lvl . spaces + 1 , LevelStatus . open ) ) { return '-' ; } String qstr = getInline ( ) ; CHK_NL ( parser . cursor ) ; if ( qstr . charAt ( 0 ) == '!' ) { int qidx = qstr . length ( ) ; if ( qidx == 1 ) { return DefaultYAMLParser . YAML_ITRANSFER ; } lvl = parser . currentLevel ( ) ; /* * URL Prefixing */
if ( qstr . charAt ( 1 ) == '^' ) { lval = lvl . domain + qstr . substring ( 2 ) ; } else { int carat = qstr . indexOf ( '^' ) ; if ( carat != - 1 ) { lvl . domain = qstr . substring ( 1 , carat ) ; lval = lvl . domain + qstr . substring ( carat + 1 ) ; } else { lval = qstr . substring ( 1 ) ; } } return DefaultYAMLParser . YAML_TRANSFER ; } lval = qstr ; return DefaultYAMLParser . YAML_TAGURI ; } case 25 : ++ parser . cursor ; { mainLoopGoto = Comment ; break gotoSomething ; } case 27 : ++ parser . cursor ; { CHK_NL ( parser . cursor ) ; if ( lvl . status == LevelStatus . seq ) { return DefaultYAMLParser . YAML_INDENT ; } else if ( lvl . status == LevelStatus . map ) { if ( lvl . ncount % 2 == 1 ) return ':' ; else return DefaultYAMLParser . YAML_INDENT ; } mainLoopGoto = Document ; break gotoSomething ; } case 29 : yych = parser . buffer . buffer [ ++ parser . cursor ] ; switch ( yych ) { case '\n' : { gotoPoint = 27 ; continue gotoNext ; } default : { gotoPoint = 11 ; continue gotoNext ; } } case 30 : ++ parser . cursor ; { if ( lvl . spaces > - 1 ) { parser . popLevel ( ) ; YYPOS ( 0 ) ; return DefaultYAMLParser . YAML_IEND ; } YYPOS ( 0 ) ; return 0 ; } case 32 : ++ parser . cursor ; { if ( lvl . status == LevelStatus . seq && lvl . ncount == 0 ) { lvl . ncount ++ ; YYPOS ( 0 ) ; FORCE_NEXT_TOKEN ( ']' ) ; return '[' ; } else if ( lvl . status == LevelStatus . map && lvl . ncount == 0 ) { lvl . ncount ++ ; YYPOS ( 0 ) ; FORCE_NEXT_TOKEN ( '}' ) ; return '{' ; } parser . popLevel ( ) ; lvl = parser . currentLevel ( ) ; if ( lvl . status == LevelStatus . seq ) { FORCE_NEXT_TOKEN ( DefaultYAMLParser . YAML_INDENT ) ; } else if ( lvl . status == LevelStatus . map ) { if ( lvl . ncount % 2 == 1 ) { FORCE_NEXT_TOKEN ( ':' ) ; } else { FORCE_NEXT_TOKEN ( DefaultYAMLParser . YAML_INDENT ) ; } } CHK_NL ( parser . cursor ) ; return DefaultYAMLParser . YAML_IEND ; } case 34 : yych = parser . buffer . buffer [ ++ parser . cursor ] ; switch ( yych ) { case '\n' : { gotoPoint = 32 ; continue gotoNext ; } default : { gotoPoint = 11 ; continue gotoNext ; } } case 35 : ++ parser . cursor ; { boolean complex = false ; if ( lvl . ncount % 2 == 0 && ( lvl . status == LevelStatus . map || lvl . status == LevelStatus . seq ) ) { complex = true ; } if ( ADD_BYTE_LEVEL ( lvl , lvl . spaces + 1 , LevelStatus . seq ) ) { return '-' ; } CHK_NL ( parser . cursor ) ; if ( complex ) { FORCE_NEXT_TOKEN ( DefaultYAMLParser . YAML_IOPEN ) ; return '?' ; } return DefaultYAMLParser . YAML_IOPEN ; } case 37 : yych = parser . buffer . buffer [ ++ parser . cursor ] ; switch ( yych ) { case '\n' : { gotoPoint = 35 ; continue gotoNext ; } default : { gotoPoint = 11 ; continue gotoNext ; } } case 38 : ++ parser . cursor ; { boolean complex = false ; if ( lvl . ncount % 2 == 0 && ( lvl . status == LevelStatus . map || lvl . status == LevelStatus . seq ) ) { complex = true ; } if ( ADD_BYTE_LEVEL ( lvl , lvl . spaces + 1 , LevelStatus . map ) ) { return '-' ; } CHK_NL ( parser . cursor ) ; if ( complex ) { FORCE_NEXT_TOKEN ( DefaultYAMLParser . YAML_IOPEN ) ; return '?' ; } return DefaultYAMLParser . YAML_IOPEN ; } case 40 : yych = parser . buffer . buffer [ ++ parser . cursor ] ; switch ( yych ) { case '\n' : { gotoPoint = 38 ; continue gotoNext ; } default : { gotoPoint = 11 ; continue gotoNext ; } } case 41 : ++ parser . cursor ; { if ( lvl . spaces > - 1 ) { parser . popLevel ( ) ; YYPOS ( 0 ) ; return DefaultYAMLParser . YAML_IEND ; } YYPOS ( 0 ) ; return 0 ; } case 43 : yych = parser . buffer . buffer [ ++ parser . cursor ] ; switch ( yych ) { case '\n' : { gotoPoint = 41 ; continue gotoNext ; } default : { gotoPoint = 11 ; continue gotoNext ; } } case 44 : ++ parser . cursor ; switch ( ( yych = parser . buffer . buffer [ parser . cursor ] ) ) { case '\n' : { gotoPoint = 41 ; continue gotoNext ; } default : { gotoPoint = 11 ; continue gotoNext ; } } } } } case Directive : { parser . token = parser . cursor ; int gotoPoint = - 1 ; byte yych = ( byte ) 0 ; gotoNext : while ( gotoPoint != - 2 ) { int currentGoto = gotoPoint ; gotoPoint = - 2 ; switch ( currentGoto ) { case - 1 : if ( ( parser . limit - parser . cursor ) < 2 ) parser . read ( ) ; yych = parser . buffer . buffer [ parser . cursor ] ; switch ( yych ) { case 0x00 : { gotoPoint = 47 ; continue gotoNext ; } case 'V' : { gotoPoint = 48 ; continue gotoNext ; } default : { gotoPoint = 50 ; continue gotoNext ; } } case 47 : parser . cursor = parser . marker ; { gotoPoint = 49 ; continue gotoNext ; } case 48 : yych = parser . buffer . buffer [ ( parser . marker = ++ parser . cursor ) ] ; switch ( yych ) { case '.' : case '/' : case '0' : case '1' : case '2' : case '3' : case '4' : case '5' : case '6' : case '7' : case '8' : case '9' : case ':' : case ';' : case '<' : case '=' : case '>' : case '?' : case '@' : case 'A' : case 'B' : case 'C' : case 'D' : case 'E' : case 'F' : case 'G' : case 'H' : case 'I' : case 'J' : case 'K' : case 'L' : case 'M' : case 'N' : case 'O' : case 'P' : case 'Q' : case 'R' : case 'S' : case 'T' : case 'U' : case 'V' : case 'W' : case 'X' : case 'Y' : case 'Z' : case '[' : case '\\' : case ']' : case '^' : case '_' : case 'a' : case 'b' : case 'c' : case 'd' : case 'e' : case 'f' : case 'g' : case 'h' : case 'i' : case 'j' : case 'k' : case 'l' : case 'm' : case 'n' : case 'o' : case 'p' : case 'q' : case 'r' : case 's' : case 't' : case 'u' : case 'v' : case 'w' : case 'x' : case 'y' : case 'z' : { gotoPoint = 51 ; continue gotoNext ; } default : { gotoPoint = 49 ; continue gotoNext ; } } case 49 : { parser . cursor = parser . token ; return DefaultYAMLParser . YAML_DOCSEP ; } case 50 : yych = parser . buffer . buffer [ ++ parser . cursor ] ; { gotoPoint = 49 ; continue gotoNext ; } case 51 : ++ parser . cursor ; if ( ( parser . limit - parser . cursor ) < 2 ) parser . read ( ) ; yych = parser . buffer . buffer [ parser . cursor ] ; switch ( yych ) { case '.' : case '/' : case '0' : case '1' : case '2' : case '3' : case '4' : case '5' : case '6' : case '7' : case '8' : case '9' : case ';' : case '<' : case '=' : case '>' : case '?' : case '@' : case 'A' : case 'B' : case 'C' : case 'D' : case 'E' : case 'F' : case 'G' : case 'H' : case 'I' : case 'J' : case 'K' : case 'L' : case 'M' : case 'N' : case 'O' : case 'P' : case 'Q' : case 'R' : case 'S' : case 'T' : case 'U' : case 'V' : case 'W' : case 'X' : case 'Y' : case 'Z' : case '[' : case '\\' : case ']' : case '^' : case '_' : case 'a' : case 'b' : case 'c' : case 'd' : case 'e' : case 'f' : case 'g' : case 'h' : case 'i' : case 'j' : case 'k' : case 'l' : case 'm' : case 'n' : case 'o' : case 'p' : case 'q' : case 'r' : case 's' : case 't' : case 'u' : case 'v' : case 'w' : case 'x' : case 'y' : case 'z' : { gotoPoint = 51 ; continue gotoNext ; } case ':' : { gotoPoint = 53 ; continue gotoNext ; } default : { gotoPoint = 47 ; continue gotoNext ; } } case 53 : yych = parser . buffer . buffer [ ++ parser . cursor ] ; switch ( yych ) { case '.' : case '/' : case '0' : case '1' : case '2' : case '3' : case '4' : case '5' : case '6' : case '7' : case '8' : case '9' : case ':' : case ';' : case '<' : case '=' : case '>' : case '?' : case '@' : case 'A' : case 'B' : case 'C' : case 'D' : case 'E' : case 'F' : case 'G' : case 'H' : case 'I' : case 'J' : case 'K' : case 'L' : case 'M' : case 'N' : case 'O' : case 'P' : case 'Q' : case 'R' : case 'S' : case 'T' : case 'U' : case 'V' : case 'W' : case 'X' : case 'Y' : case 'Z' : case '[' : case '\\' : case ']' : case '^' : case '_' : case 'a' : case 'b' : case 'c' : case 'd' : case 'e' : case 'f' : case 'g' : case 'h' : case 'i' : case 'j' : case 'k' : case 'l' : case 'm' : case 'n' : case 'o' : case 'p' : case 'q' : case 'r' : case 's' : case 't' : case 'u' : case 'v' : case 'w' : case 'x' : case 'y' : case 'z' : { gotoPoint = 54 ; continue gotoNext ; } default : { gotoPoint = 47 ; continue gotoNext ; } } case 54 : ++ parser . cursor ; if ( ( parser . limit - parser . cursor ) < 2 ) parser . read ( ) ; yych = parser . buffer . buffer [ parser . cursor ] ; switch ( yych ) { case '\n' : { gotoPoint = 56 ; continue gotoNext ; } case '\r' : { gotoPoint = 58 ; continue gotoNext ; } case '.' : case '/' : case '0' : case '1' : case '2' : case '3' : case '4' : case '5' : case '6' : case '7' : case '8' : case '9' : case ':' : case ';' : case '<' : case '=' : case '>' : case '?' : case '@' : case 'A' : case 'B' : case 'C' : case 'D' : case 'E' : case 'F' : case 'G' : case 'H' : case 'I' : case 'J' : case 'K' : case 'L' : case 'M' : case 'N' : case 'O' : case 'P' : case 'Q' : case 'R' : case 'S' : case 'T' : case 'U' : case 'V' : case 'W' : case 'X' : case 'Y' : case 'Z' : case '[' : case '\\' : case ']' : case '^' : case '_' : case 'a' : case 'b' : case 'c' : case 'd' : case 'e' : case 'f' : case 'g' : case 'h' : case 'i' : case 'j' : case 'k' : case 'l' : case 'm' : case 'n' : case 'o' : case 'p' : case 'q' : case 'r' : case 's' : case 't' : case 'u' : case 'v' : case 'w' : case 'x' : case 'y' : case 'z' : { gotoPoint = 54 ; continue gotoNext ; } default : { gotoPoint = 47 ; continue gotoNext ; } } case 56 : ++ parser . cursor ; { CHK_NL ( parser . cursor ) ; mainLoopGoto = Directive ; break gotoSomething ; } case 58 : ++ parser . cursor ; switch ( ( yych = parser . buffer . buffer [ parser . cursor ] ) ) { case '\n' : { gotoPoint = 56 ; continue gotoNext ; } default : { gotoPoint = 47 ; continue gotoNext ; } } } } } case Comment : { parser . token = parser . cursor ; int gotoPoint = - 1 ; byte yych = ( byte ) 0 ; gotoNext : while ( gotoPoint != - 2 ) { int currentGoto = gotoPoint ; gotoPoint = - 2 ; switch ( currentGoto ) { case - 1 : if ( ( parser . limit - parser . cursor ) < 2 ) parser . read ( ) ; yych = parser . buffer . buffer [ parser . cursor ] ; switch ( yych ) { case 0x00 : { gotoPoint = 61 ; continue gotoNext ; } case '\n' : { gotoPoint = 62 ; continue gotoNext ; } case '\r' : { gotoPoint = 64 ; continue gotoNext ; } default : { gotoPoint = 66 ; continue gotoNext ; } } case 61 : case 62 : ++ parser . cursor ; case 63 : { CHK_NL ( parser . cursor ) ; mainLoopGoto = Document ; break gotoSomething ; } case 64 : ++ parser . cursor ; switch ( ( yych = parser . buffer . buffer [ parser . cursor ] ) ) { case '\n' : { gotoPoint = 67 ; continue gotoNext ; } default : { gotoPoint = 65 ; continue gotoNext ; } } case 65 : { mainLoopGoto = Comment ; break gotoSomething ; } case 66 : yych = parser . buffer . buffer [ ++ parser . cursor ] ; { gotoPoint = 65 ; continue gotoNext ; } case 67 : ++ parser . cursor ; yych = parser . buffer . buffer [ parser . cursor ] ; { gotoPoint = 63 ; continue gotoNext ; } } } } case Scalar : q = new QuotedString ( ) ; q . str [ 0 ] = 0 ; case Scalar2 : { tok = parser . cursor ; int gotoPoint = - 1 ; byte yych = ( byte ) 0 ; gotoNext : while ( gotoPoint != - 2 ) { int currentGoto = gotoPoint ; gotoPoint = - 2 ; switch ( currentGoto ) { case - 1 : if ( ( parser . limit - parser . cursor ) < 3 ) parser . read ( ) ; yych = parser . buffer . buffer [ parser . cursor ] ; switch ( yych ) { case 0x00 : { gotoPoint = 74 ; continue gotoNext ; } case '\n' : { gotoPoint = 70 ; continue gotoNext ; } case '\r' : { gotoPoint = 72 ; continue gotoNext ; } default : { gotoPoint = 76 ; continue gotoNext ; } } case 70 : ++ parser . cursor ; switch ( ( yych = parser . buffer . buffer [ parser . cursor ] ) ) { case 'C' : { gotoPoint = 78 ; continue gotoNext ; } case 'N' : { gotoPoint = 80 ; continue gotoNext ; } case 'Z' : { gotoPoint = 83 ; continue gotoNext ; } default : { gotoPoint = 71 ; continue gotoNext ; } } case 71 : { parser . cursor = tok ; mainLoopGoto = ScalarEnd ; break gotoSomething ; } case 72 : ++ parser . cursor ; switch ( ( yych = parser . buffer . buffer [ parser . cursor ] ) ) { case '\n' : { gotoPoint = 77 ; continue gotoNext ; } default : { gotoPoint = 73 ; continue gotoNext ; } } case 73 : { q . cat ( parser . buffer . buffer [ tok ] ) ; mainLoopGoto = Scalar2 ; break gotoSomething ; } case 74 : ++ parser . cursor ; { parser . cursor = tok ; mainLoopGoto = ScalarEnd ; break gotoSomething ; } case 76 : yych = parser . buffer . buffer [ ++ parser . cursor ] ; { gotoPoint = 73 ; continue gotoNext ; } case 77 : yych = parser . buffer . buffer [ ++ parser . cursor ] ; switch ( yych ) { case 'C' : { gotoPoint = 78 ; continue gotoNext ; } case 'N' : { gotoPoint = 80 ; continue gotoNext ; } case 'Z' : { gotoPoint = 83 ; continue gotoNext ; } default : { gotoPoint = 71 ; continue gotoNext ; } } case 78 : ++ parser . cursor ; { CHK_NL ( tok + 1 ) ; mainLoopGoto = Scalar2 ; break gotoSomething ; } case 80 : ++ parser . cursor ; if ( parser . limit <= parser . cursor ) parser . read ( ) ; yych = parser . buffer . buffer [ parser . cursor ] ; switch ( yych ) { case '0' : case '1' : case '2' : case '3' : case '4' : case '5' : case '6' : case '7' : case '8' : case '9' : { gotoPoint = 80 ; continue gotoNext ; } default : { gotoPoint = 82 ; continue gotoNext ; } } case 82 : { CHK_NL ( tok + 1 ) ; if ( tok + 2 < parser . cursor ) { int count = tok + 2 ; int total = Integer . valueOf ( new String ( parser . buffer . buffer , tok + 2 , parser . cursor - ( tok + 2 ) ) , 10 ) . intValue ( ) ; for ( int i = 0 ; i < total ; i ++ ) { q . cat ( '\n' ) ; } } else { q . cat ( '\n' ) ; } mainLoopGoto = Scalar2 ; break gotoSomething ; } case 83 : ++ parser . cursor ; { CHK_NL ( tok + 1 ) ; q . cat ( ( byte ) 0 ) ; mainLoopGoto = Scalar2 ; break gotoSomething ; } } } } case ScalarEnd : { Node n = Node . allocStr ( ) ; Data . Str dd = ( Data . Str ) n . data ; dd . ptr = Pointer . create ( q . str , 0 ) ; dd . len = q . idx ; lval = n ; parser . popLevel ( ) ; if ( parser . implicit_typing ) { ImplicitScanner2 . tryTagImplicit ( n , parser . taguri_expansion ) ; } return DefaultYAMLParser . YAML_PLAIN ; } } } } while ( true ) ; |
public class RelationalJMapper { /** * Returns all Target Classes contained in the XML .
* @ param xml xml to analyze
* @ return target classes */
private Set < Class < ? > > getClasses ( XML xml ) { } } | HashSet < Class < ? > > result = new HashSet < Class < ? > > ( ) ; // in case of override only the last global configuration must be analyzed
Global global = null ; for ( Class < ? > clazz : getAllsuperClasses ( configuredClass ) ) { // only if global configuration is null will be searched global configuration on super classes
if ( isNull ( global ) ) { global = xml . loadGlobals ( ) . get ( clazz . getName ( ) ) ; if ( ! isNull ( global ) ) { addClasses ( global . getClasses ( ) , result ) ; if ( global . getExcluded ( ) != null ) for ( Attribute attribute : xml . loadAttributes ( ) . get ( clazz . getName ( ) ) ) for ( String fieldName : global . getExcluded ( ) ) if ( attribute . getName ( ) . equals ( fieldName ) ) addClasses ( attribute . getClasses ( ) , result , attribute . getName ( ) ) ; } } List < Attribute > attributes = xml . loadAttributes ( ) . get ( clazz . getName ( ) ) ; if ( ! isNull ( attributes ) ) for ( Attribute attribute : attributes ) if ( isNull ( global ) || isPresent ( global . getExcluded ( ) , attribute . getName ( ) ) || ( ! isEmpty ( global . getAttributes ( ) ) && ! isPresent ( global . getAttributes ( ) , new SimplyAttribute ( attribute . getName ( ) ) ) ) ) addClasses ( attribute . getClasses ( ) , result , attribute . getName ( ) ) ; } return result ; |
public class AtlasClientV2 { /** * Bulk retrieval API for retrieving all type definitions in Atlas
* @ return A composite wrapper object with lists of all type definitions */
public AtlasTypesDef getAllTypeDefs ( SearchFilter searchFilter ) throws AtlasServiceException { } } | return callAPI ( GET_ALL_TYPE_DEFS , AtlasTypesDef . class , searchFilter . getParams ( ) ) ; |
public class CmsContentEditor { /** * Synchronizes the locale independent fields to the other locales . < p > */
void synchronizeCurrentLocale ( ) { } } | m_basePanel . clear ( ) ; destroyForm ( false ) ; CmsEntity entity = m_entityBackend . getEntity ( m_entityId ) ; m_entityId = getIdForLocale ( m_locale ) ; ( ( CmsDefaultWidgetService ) getWidgetService ( ) ) . setSkipPaths ( Collections . < String > emptyList ( ) ) ; loadDefinition ( m_entityId , entity , new I_CmsSimpleCallback < CmsContentDefinition > ( ) { public void execute ( CmsContentDefinition contentDefinition ) { setContentDefinition ( contentDefinition ) ; renderFormContent ( ) ; setChanged ( ) ; } } ) ; |
public class Gen { /** * File name and file preamble related operations . */
protected void writeFileTop ( OutputStream o ) throws Util . Exit { } } | PrintWriter pw = wrapWriter ( o ) ; pw . println ( "/* DO NOT EDIT THIS FILE - it is machine generated */" + lineSep + getIncludes ( ) ) ; |
public class JMessageClient { /** * Get user ' s message list with cursor , the cursor will effective in 120 seconds .
* And will return same count of messages as first request .
* @ param username Necessary parameter .
* @ param cursor First request will return cursor
* @ return MessageListResult
* @ throws APIConnectionException connect exception
* @ throws APIRequestException request exception */
public MessageListResult getUserMessagesByCursor ( String username , String cursor ) throws APIConnectionException , APIRequestException { } } | return _messageClient . getUserMessagesByCursor ( username , cursor ) ; |
public class JesqueUtils { /** * Materializes a job by looking up { @ link Job # getClassName ( ) } in the
* provided map of job types .
* @ param job
* the job to materialize
* @ param jobTypes
* a map of String names to Java types
* @ return the materialized job
* @ throws UnpermittedJobException
* if there was not a non - null mapping in jobTypes for the class
* name
* @ throws Exception
* if there was an exception creating the object */
public static Object materializeJob ( final Job job , final Map < String , Class < ? > > jobTypes ) throws UnpermittedJobException , Exception { } } | final String className = job . getClassName ( ) ; final Class < ? > clazz = jobTypes . get ( className ) ; if ( clazz == null ) { throw new UnpermittedJobException ( className ) ; } // A bit redundant since we check when the job type is added . . .
if ( ! Runnable . class . isAssignableFrom ( clazz ) && ! Callable . class . isAssignableFrom ( clazz ) ) { throw new ClassCastException ( "jobs must be a Runnable or a Callable: " + clazz . getName ( ) + " - " + job ) ; } return ReflectionUtils . createObject ( clazz , job . getArgs ( ) , job . getVars ( ) ) ; |
public class ForkJoinPool { /** * If inactivating worker w has caused the pool to become
* quiescent , checks for pool termination , and , so long as this is
* not the only worker , waits for event for up to SHRINK _ RATE
* nanosecs . On timeout , if ctl has not changed , terminates the
* worker , which will in turn wake up another worker to possibly
* repeat this process .
* @ param w the calling worker
* @ param currentCtl the ctl value triggering possible quiescence
* @ param prevCtl the ctl value to restore if thread is terminated */
private void idleAwaitWork ( WorkQueue w , long currentCtl , long prevCtl ) { } } | if ( w . eventCount < 0 && ! tryTerminate ( false , false ) && ( int ) prevCtl != 0 && ! hasQueuedSubmissions ( ) && ctl == currentCtl ) { Thread wt = Thread . currentThread ( ) ; Thread . yield ( ) ; // yield before block
while ( ctl == currentCtl ) { long startTime = System . nanoTime ( ) ; Thread . interrupted ( ) ; // timed variant of version in scan ( )
U . putObject ( wt , PARKBLOCKER , this ) ; w . parker = wt ; if ( ctl == currentCtl ) U . park ( false , SHRINK_RATE ) ; w . parker = null ; U . putObject ( wt , PARKBLOCKER , null ) ; if ( ctl != currentCtl ) break ; if ( System . nanoTime ( ) - startTime >= SHRINK_TIMEOUT && U . compareAndSwapLong ( this , CTL , currentCtl , prevCtl ) ) { w . eventCount = ( w . eventCount + E_SEQ ) | E_MASK ; w . runState = - 1 ; // shrink
break ; } } } |
public class ClassLoadingServiceImpl { /** * { @ inheritDoc } */
@ Override public String getClassLoaderIdentifier ( String type , String appName , String moduleName , String componentName ) { } } | String metadataId = metadataIdentifierService . getMetaDataIdentifier ( type , appName , moduleName , componentName ) ; MetaData metadata = metadataIdentifierService . getMetaData ( metadataId ) ; ClassLoader classLoader = metadataIdentifierService . getClassLoader ( type , ( ComponentMetaData ) metadata ) ; return getClassLoaderIdentifier ( classLoader ) ; |
public class MapComposedElement { /** * Replies the ending index of a point in a group .
* @ param groupIndex is the index of the desired group
* @ return the index of the point in the list of points .
* This value is between < code > 0 < / code > and < code > this . pointCoordinates . length ( ) - 2 < / code >
* @ throws IndexOutOfBoundsException in case of error . */
private int lastInGroup ( int groupIndex ) { } } | if ( this . pointCoordinates == null ) { throw new IndexOutOfBoundsException ( ) ; } final int count = getGroupCount ( ) ; if ( groupIndex < 0 ) { throw new IndexOutOfBoundsException ( groupIndex + "<0" ) ; // $ NON - NLS - 1 $
} if ( groupIndex >= count ) { throw new IndexOutOfBoundsException ( groupIndex + ">=" + count ) ; // $ NON - NLS - 1 $
} if ( this . partIndexes != null && groupIndex < this . partIndexes . length ) { return this . partIndexes [ groupIndex ] - 2 ; } return this . pointCoordinates . length - 2 ; |
public class TypeHelper { /** * Realizes an unsharp equal for the class .
* In general we return true if the provided arguments are the same . But
* we will also return true if our argument class is a wrapper for
* the parameter class . For example the parameter is an int and the
* argument class is a wrapper . */
protected static boolean argumentClassIsParameterClass ( Class argumentClass , Class parameterClass ) { } } | if ( argumentClass == parameterClass ) return true ; if ( getWrapperClass ( parameterClass ) == argumentClass ) return true ; return false ; |
public class EmbeddableIntrospector { /** * Processes each field in this Embeddable and updates the metadata . */
private void processFields ( ) { } } | List < Field > fields = IntrospectionUtils . getPersistableFields ( embeddableClass ) ; for ( Field field : fields ) { if ( field . isAnnotationPresent ( Embedded . class ) ) { processEmbeddedField ( field ) ; } else { processSimpleField ( field ) ; } } |
public class Int2ObjectHashMap { /** * Overloaded version of { @ link Map # put ( Object , Object ) } that takes a primitive int key .
* @ param key for indexing the { @ link Map }
* @ param value to be inserted in the { @ link Map }
* @ return the previous value if found otherwise null */
@ SuppressWarnings ( "unchecked" ) public V put ( final int key , final V value ) { } } | checkNotNull ( value , "Value cannot be null" ) ; V oldValue = null ; int index = intHash ( key , mask ) ; while ( null != values [ index ] ) { if ( key == keys [ index ] ) { oldValue = ( V ) values [ index ] ; break ; } index = ++ index & mask ; } if ( null == oldValue ) { ++ size ; keys [ index ] = key ; } values [ index ] = value ; if ( size > resizeThreshold ) { increaseCapacity ( ) ; } return oldValue ; |
public class FrameManager { /** * Constructs a frame manager that will do its rendering to the supplied root and use the
* supplied media timer for timing information . */
public static FrameManager newInstance ( ManagedRoot root , MediaTimer timer ) { } } | FrameManager fmgr = ( root instanceof ManagedJFrame && _useFlip . getValue ( ) ) ? new FlipFrameManager ( ) : new BackFrameManager ( ) ; fmgr . init ( root , timer ) ; return fmgr ; |
public class Control { /** * This method sets a new string value for this control . The returned value
* is the new value of the control .
* @ param value the new value
* @ return the new value of the control after setting it
* @ throws ControlException if the value can not be set , or if the new string value ' s length
* is under / over the minimum / maximum length .
* @ throws UnsupportedMethod if this control is not of type { @ link V4L4JConstants # CTRL _ TYPE _ STRING } ,
* @ throws StateException if this control has been released and must not be used anymore . */
public String setStringValue ( String value ) throws ControlException { } } | String v = null ; if ( type != V4L4JConstants . CTRL_TYPE_STRING ) throw new UnsupportedMethod ( "This control is not a string control" ) ; if ( value . length ( ) > max ) throw new ControlException ( "The new string value for this control exceeds the maximum length" ) ; if ( value . length ( ) < min ) throw new ControlException ( "The new string value for this control is below the minimum length" ) ; state . get ( ) ; try { doSetStringValue ( v4l4jObject , id , value ) ; v = doGetStringValue ( v4l4jObject , id ) ; } finally { state . put ( ) ; } return v ; |
public class ConnectionDAODefaultImpl { public void checkIfTaco ( final Connection connection , final String cmdname ) throws DevFailed { } } | if ( ! is_taco ( connection ) ) { Except . throw_non_supported_exception ( "TangoApi_NOT_TANGO_CMD" , cmdname + " is NOT a TANGO command." , cmdname + "()" ) ; } |
public class IntPriorityQueue { /** * Removes the node specified from the heap
* @ param i the valid heap node index to remove from the heap
* @ return the value that was stored in the heap node */
protected int removeHeapNode ( int i ) { } } | int val = heap [ i ] ; int rightMost = -- size ; heap [ i ] = heap [ rightMost ] ; heap [ rightMost ] = 0 ; if ( fastValueRemove == Mode . HASH ) { valueIndexMap . remove ( val ) ; if ( size != 0 ) valueIndexMap . put ( heap [ i ] , i ) ; } else if ( fastValueRemove == Mode . BOUNDED ) { valueIndexStore [ val ] = - 1 ; } heapDown ( i ) ; return val ; |
public class AnyTimeInterrogationRequestImpl { /** * ( non - Javadoc )
* @ see org . restcomm . protocols . ss7 . map . primitives . MAPAsnPrimitive # encodeData ( org . mobicents . protocols . asn . AsnOutputStream ) */
public void encodeData ( AsnOutputStream asnOs ) throws MAPException { } } | if ( this . subscriberIdentity == null ) { throw new MAPException ( "Error while encoding " + _PrimitiveName + " the mandatory parameter subscriberIdentity is not defined" ) ; } if ( this . requestedInfo == null ) { throw new MAPException ( "Error while encoding " + _PrimitiveName + " the mandatory parameter requestedInfo is not defined" ) ; } if ( this . gsmSCFAddress == null ) { throw new MAPException ( "Error while encoding " + _PrimitiveName + " the mandatory parameter gsmSCF-Address is not defined" ) ; } try { asnOs . writeTag ( Tag . CLASS_CONTEXT_SPECIFIC , false , _TAG_SUBSCRIBER_IDENTITY ) ; int pos = asnOs . StartContentDefiniteLength ( ) ; ( ( SubscriberIdentityImpl ) this . subscriberIdentity ) . encodeAll ( asnOs ) ; asnOs . FinalizeContent ( pos ) ; } catch ( AsnException e ) { throw new MAPException ( "AsnException while encoding " + _PrimitiveName + " parameter subscriberIdentity [0] SubscriberIdentity" ) ; } ( ( RequestedInfoImpl ) this . requestedInfo ) . encodeAll ( asnOs , Tag . CLASS_CONTEXT_SPECIFIC , _TAG_REQUESTED_INFO ) ; ( ( ISDNAddressStringImpl ) this . gsmSCFAddress ) . encodeAll ( asnOs , Tag . CLASS_CONTEXT_SPECIFIC , _TAG_GSM_SCF_ADDRESS ) ; if ( this . extensionContainer != null ) { ( ( MAPExtensionContainerImpl ) this . extensionContainer ) . encodeAll ( asnOs , Tag . CLASS_CONTEXT_SPECIFIC , _TAG_EXTENSION_CONTAINER ) ; } |
public class KafkaSpec { /** * Check that the number of partitions is like expected .
* @ param topic _ name Name of kafka topic
* @ param numOfPartitions Number of partitions
* @ throws Exception */
@ Then ( "^The number of partitions in topic '(.+?)' should be '(.+?)''?$" ) public void checkNumberOfPartitions ( String topic_name , int numOfPartitions ) throws Exception { } } | Assertions . assertThat ( commonspec . getKafkaUtils ( ) . getPartitions ( topic_name ) ) . isEqualTo ( numOfPartitions ) ; |
public class FeatureTileLinkDao { /** * { @ inheritDoc } */
@ Override public int delete ( FeatureTileLink data ) throws SQLException { } } | DeleteBuilder < FeatureTileLink , FeatureTileLinkKey > db = deleteBuilder ( ) ; db . where ( ) . eq ( FeatureTileLink . COLUMN_FEATURE_TABLE_NAME , data . getFeatureTableName ( ) ) . and ( ) . eq ( FeatureTileLink . COLUMN_TILE_TABLE_NAME , data . getTileTableName ( ) ) ; PreparedDelete < FeatureTileLink > deleteQuery = db . prepare ( ) ; int deleted = delete ( deleteQuery ) ; return deleted ; |
public class FieldSet { /** * See { @ link Message # isInitialized ( ) } . Note : Since { @ code FieldSet }
* itself does not have any way of knowing about required fields that
* aren ' t actually present in the set , it is up to the caller to check
* that all required fields are present . */
public boolean isInitialized ( ) { } } | for ( int i = 0 ; i < fields . getNumArrayEntries ( ) ; i ++ ) { if ( ! isInitialized ( fields . getArrayEntryAt ( i ) ) ) { return false ; } } for ( final Map . Entry < FieldDescriptorType , Object > entry : fields . getOverflowEntries ( ) ) { if ( ! isInitialized ( entry ) ) { return false ; } } return true ; |
public class CompletableFutureT { /** * / * ( non - Javadoc )
* @ see cyclops2 . monads . transformers . values . ValueTransformer # zip ( java . lang . Iterable , java . util . function . BiFunction ) */
@ Override public < T2 , R > CompletableFutureT < W , R > zip ( Iterable < ? extends T2 > iterable , BiFunction < ? super T , ? super T2 , ? extends R > fn ) { } } | return ( CompletableFutureT < W , R > ) super . zip ( iterable , fn ) ; |
public class NotificationCenter { /** * / * package */
void clearEntry ( int target ) { } } | synchronized ( mActives ) { ArrayList < NotificationEntry > entries = getEntries ( ) ; Iterator < NotificationEntry > iter = entries . iterator ( ) ; while ( iter . hasNext ( ) ) { NotificationEntry entry = iter . next ( ) ; if ( entry . mTargets == target ) { if ( DBG ) Log . v ( TAG , "[entry:" + entry . ID + "] out - " + entry ) ; iter . remove ( ) ; mActives . removeEntry ( entry . ID ) ; mPendings . removeEntry ( entry . ID ) ; if ( entry . mSendToListener ) { schedule ( MSG_CANCEL , 0 , 0 , entry , 0 ) ; } } else { entry . mTargets &= ~ target ; } } } |
public class ProvidedResourceScanner { /** * Remove any metadata that was added by any { @ code ProvidesResources } annotation
* present in { @ code theProvider } . This method is callled from { @ code RestfulService }
* when it is unregistering a Resource Provider .
* @ param theProvider
* - Normally a { @ link ca . uhn . fhir . rest . server . IResourceProvider } that might
* be annotated with { @ link ca . uhn . fhir . model . api . annotation . ProvidesResources } */
public void removeProvidedResources ( Object theProvider ) { } } | ProvidesResources annotation = theProvider . getClass ( ) . getAnnotation ( ProvidesResources . class ) ; if ( annotation == null ) return ; for ( Class < ? > clazz : annotation . resources ( ) ) { if ( IBaseResource . class . isAssignableFrom ( clazz ) ) { // TODO - - not currently used but should be finished for completeness
} else { ourLog . warn ( clazz . getSimpleName ( ) + "is not assignable from IResource" ) ; } } |
public class AbstractLazyLoadRunMap { /** * / * package */
TreeMap < Integer , BuildReference < R > > all ( ) { } } | if ( ! fullyLoaded ) { synchronized ( this ) { if ( ! fullyLoaded ) { Index copy = copy ( ) ; for ( Integer number : numberOnDisk ) { if ( ! copy . byNumber . containsKey ( number ) ) load ( number , copy ) ; } index = copy ; fullyLoaded = true ; } } } return index . byNumber ; |
public class DestinationManager { /** * Remove the given destination from the DestinationManager .
* This will only be a BaseDestinationHandler removing either a link
* or a destination .
* @ param dh The DestinationHandler to remove . */
protected void removeDestination ( DestinationHandler dh ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "removeDestination" , dh ) ; if ( dh . isLink ( ) ) { if ( linkIndex . containsKey ( dh ) ) { linkIndex . remove ( dh ) ; } } else { if ( destinationIndex . containsKey ( dh ) ) { destinationIndex . remove ( dh ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "removeDestination" ) ; |
public class HodAuthenticationConfiguration { /** * Note that this bean cannot go in HavenSearchHodApplication because it would then cause a circular dependency in upstream applications */
@ Bean @ ConditionalOnMissingBean ( AuthenticationInformationRetriever . class ) public AuthenticationInformationRetriever < HodAuthentication < EntityType . Combined > , HodAuthenticationPrincipal > authenticationInformationRetriever ( ) { } } | @ SuppressWarnings ( "unchecked" ) final AuthenticationInformationRetriever < HodAuthentication < EntityType . Combined > , HodAuthenticationPrincipal > retriever = new SpringSecurityAuthenticationInformationRetriever < > ( ( Class < HodAuthentication < EntityType . Combined > > ) ( Class < ? > ) HodAuthentication . class , HodAuthenticationPrincipal . class ) ; return retriever ; |
public class AbstractIndexBuilder { /** * Create a value index with the given index items . The index items are a list of
* the properties or expressions to be indexed .
* @ param items The index items
* @ return The value index */
public static ValueIndex valueIndex ( @ NonNull ValueIndexItem ... items ) { } } | if ( items == null ) { throw new IllegalArgumentException ( "items cannot be null." ) ; } return new ValueIndex ( items ) ; |
public class BaseXMLBuilder { /** * Return the result of evaluating an XPath query on the builder ' s DOM .
* Returns null if the query finds nothing ,
* or finds a node that does not match the type specified by returnType .
* @ param xpath
* an XPath expression
* @ param type
* the type the XPath is expected to resolve to , e . g :
* { @ link XPathConstants # NODE } , { @ link XPathConstants # NODESET } ,
* { @ link XPathConstants # STRING }
* @ return
* a builder node representing the first Element that matches the
* XPath expression .
* @ throws XPathExpressionException
* If the XPath is invalid , or if does not resolve to at least one
* { @ link Node # ELEMENT _ NODE } . */
public Object xpathQuery ( String xpath , QName type ) throws XPathExpressionException { } } | return xpathQuery ( xpath , type , null ) ; |
public class WSJdbcResultSet { /** * Gives the JDBC driver a hint as to the number of rows that should be fetched from the database when
* more rows are needed for this result set . If the fetch size specified is zero , the JDBC driver ignores the value and is
* free to make its own best guess as to what the fetch size should be . The default value is set by the statement that
* created the result set . The fetch size may be changed at any time .
* @ param rows - the number of rows to fetch
* @ throws SQLException if a database access error occurs or the condition 0 < = rows < = this . getMaxRows ( ) is not
* satisfied . */
public void setFetchSize ( int rows ) throws SQLException { } } | if ( tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "setFetchSize" , rows ) ; try { rsetImpl . setFetchSize ( rows ) ; } catch ( SQLException ex ) { FFDCFilter . processException ( ex , "com.ibm.ws.rsadapter.jdbc.WSJdbcResultSet.setFetchSize" , "2891" , this ) ; throw WSJdbcUtil . mapException ( this , ex ) ; } catch ( NullPointerException nullX ) { // No FFDC code needed ; we might be closed .
throw runtimeXIfNotClosed ( nullX ) ; } |
public class FactoryBuilderSupport { /** * This is a hook for subclasses to plugin a custom strategy for mapping
* names to explicit methods .
* @ param methodName the name of the explicit method
* @ param args the arguments for the method
* @ return the closure for the matched explicit method . < br > */
@ SuppressWarnings ( { } } | "UnusedDeclaration" } ) protected Closure resolveExplicitMethod ( String methodName , Object args ) { return getExplicitMethods ( ) . get ( methodName ) ; |
public class Operation { /** * Fetches the current status of this operation . */
public Operation < R , M > reload ( ) throws SpannerException { } } | if ( isDone ) { return this ; } com . google . longrunning . Operation proto = rpc . getOperation ( name ) ; return Operation . < R , M > create ( rpc , proto , parser ) ; |
public class AWSDataSyncClient { /** * Creates an endpoint for an Amazon S3 bucket .
* For AWS DataSync to access a destination S3 bucket , it needs an AWS Identity and Access Management ( IAM ) role
* that has the required permissions . You can set up the required permissions by creating an IAM policy that grants
* the required permissions and attaching the policy to the role . An example of such a policy is shown in the
* examples section . For more information , see < a
* href = " https : / / docs . aws . amazon . com / sync - service / latest / userguide / configuring - s3 - locations . html " > Configuring Amazon
* S3 Location Settings < / a > in the < i > AWS DataSync User Guide < / i > .
* @ param createLocationS3Request
* CreateLocationS3Request
* @ return Result of the CreateLocationS3 operation returned by the service .
* @ throws InvalidRequestException
* This exception is thrown when the client submits a malformed request .
* @ sample AWSDataSync . CreateLocationS3
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / datasync - 2018-11-09 / CreateLocationS3 " target = " _ top " > AWS API
* Documentation < / a > */
@ Override public CreateLocationS3Result createLocationS3 ( CreateLocationS3Request request ) { } } | request = beforeClientExecution ( request ) ; return executeCreateLocationS3 ( request ) ; |
public class StyleUtilities { /** * Checks if the list of { @ link Rule } s supplied contains one with the supplied name .
* < p > If the rule is contained it adds an index to the name .
* @ param rulesWrapper the list of rules to check .
* @ param ruleName the name of the rule to find .
* @ return the new name of the rule . */
public static String checkSameNameRule ( List < RuleWrapper > rulesWrapper , String ruleName ) { } } | int index = 1 ; String name = ruleName . trim ( ) ; for ( int i = 0 ; i < rulesWrapper . size ( ) ; i ++ ) { RuleWrapper ruleWrapper = rulesWrapper . get ( i ) ; String tmpName = ruleWrapper . getName ( ) ; if ( tmpName == null ) { continue ; } tmpName = tmpName . trim ( ) ; if ( tmpName . equals ( name ) ) { // name exists , change the name of the entering
if ( name . endsWith ( ")" ) ) { name = name . trim ( ) . replaceFirst ( "\\([0-9]+\\)$" , "(" + ( index ++ ) + ")" ) ; } else { name = name + " (" + ( index ++ ) + ")" ; } // start again
i = 0 ; } if ( index == 1000 ) { // something odd is going on
throw new RuntimeException ( ) ; } } return name ; |
public class CollectionReference { /** * Decodes a document in to entities
* @ param datastore the datastore
* @ param mapper the mapper
* @ param mappedField the MappedField
* @ param paramType the type of the underlying entity
* @ param dbObject the DBObject to decode
* @ return the entities */
public static MorphiaReference < ? > decode ( final Datastore datastore , final Mapper mapper , final MappedField mappedField , final Class paramType , final DBObject dbObject ) { } } | MorphiaReference reference = null ; final List dbVal = ( List ) mappedField . getDbObjectValue ( dbObject ) ; if ( dbVal != null ) { final Class subType = mappedField . getTypeParameters ( ) . get ( 0 ) . getSubClass ( ) ; final MappedClass mappedClass = mapper . getMappedClass ( subType ) ; if ( Set . class . isAssignableFrom ( paramType ) ) { reference = new SetReference ( datastore , mappedClass , dbVal ) ; } else { reference = new ListReference ( datastore , mappedClass , dbVal ) ; } } return reference ; |
public class ByteBufQueue { /** * Consumes the first ByteBuf of the queue to the provided consumer
* if the ByteBuf has at least { @ code size } bytes available for reading .
* If after consuming ByteBuf has no readable bytes left , it is recycled
* and { @ code first } index is increased by 1 or set to the value 0 if it
* has run a full circle of the queue .
* If the first ByteBuf of the queue doesn ' t have enough bytes available
* for reading , a new ByteBuf with { @ code size } bytes is created , it contains
* all data from the queue ' s first ByteBuf . This new ByteBuf is consumed and
* then recycled .
* @ param size the size of the ByteBuf to be consumed
* @ param consumer a consumer for the ByteBuf */
public void consume ( int size , @ NotNull ByteBufConsumer consumer ) { } } | assert hasRemainingBytes ( size ) ; ByteBuf buf = bufs [ first ] ; if ( buf . readRemaining ( ) >= size ) { int newPos = buf . head ( ) + size ; consumer . accept ( buf ) ; buf . head ( newPos ) ; if ( ! buf . canRead ( ) ) { first = next ( first ) ; buf . recycle ( ) ; } } else { buf = ByteBufPool . allocate ( size ) ; drainTo ( buf , size ) ; consumer . accept ( buf ) ; buf . recycle ( ) ; } |
public class RuleElementImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public void setGuard ( Expression newGuard ) { } } | if ( newGuard != guard ) { NotificationChain msgs = null ; if ( guard != null ) msgs = ( ( InternalEObject ) guard ) . eInverseRemove ( this , EOPPOSITE_FEATURE_BASE - SimpleAntlrPackage . RULE_ELEMENT__GUARD , null , msgs ) ; if ( newGuard != null ) msgs = ( ( InternalEObject ) newGuard ) . eInverseAdd ( this , EOPPOSITE_FEATURE_BASE - SimpleAntlrPackage . RULE_ELEMENT__GUARD , null , msgs ) ; msgs = basicSetGuard ( newGuard , msgs ) ; if ( msgs != null ) msgs . dispatch ( ) ; } else if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , SimpleAntlrPackage . RULE_ELEMENT__GUARD , newGuard , newGuard ) ) ; |
public class PopularityWalker { /** * This method returns next walk sequence from this graph
* @ return */
@ Override public Sequence < T > next ( ) { } } | Sequence < T > sequence = new Sequence < > ( ) ; int [ ] visitedHops = new int [ walkLength ] ; Arrays . fill ( visitedHops , - 1 ) ; int startPosition = position . getAndIncrement ( ) ; int lastId = - 1 ; int startPoint = order [ startPosition ] ; startPosition = startPoint ; for ( int i = 0 ; i < walkLength ; i ++ ) { Vertex < T > vertex = sourceGraph . getVertex ( startPosition ) ; int currentPosition = startPosition ; sequence . addElement ( vertex . getValue ( ) ) ; visitedHops [ i ] = vertex . vertexID ( ) ; int cSpread = 0 ; if ( alpha > 0 && lastId != startPoint && lastId != - 1 && alpha > rng . nextDouble ( ) ) { startPosition = startPoint ; continue ; } switch ( walkDirection ) { case RANDOM : case FORWARD_ONLY : case FORWARD_UNIQUE : case FORWARD_PREFERRED : { // ArrayUtils . removeElements ( sourceGraph . getConnectedVertexIndices ( order [ currentPosition ] ) , visitedHops ) ;
int [ ] connections = ArrayUtils . removeElements ( sourceGraph . getConnectedVertexIndices ( vertex . vertexID ( ) ) , visitedHops ) ; // we get popularity of each node connected to the current node .
PriorityQueue < Node < T > > queue = new PriorityQueue < > ( Math . max ( 10 , connections . length ) , new NodeComparator ( ) ) ; int start = 0 ; int stop = 0 ; int cnt = 0 ; if ( connections . length > 0 ) { for ( int connected : connections ) { Node < T > tNode = new Node < > ( connected , sourceGraph . getConnectedVertices ( connected ) . size ( ) ) ; queue . add ( tNode ) ; } cSpread = spread > connections . length ? connections . length : spread ; switch ( popularityMode ) { case MAXIMUM : start = 0 ; stop = start + cSpread - 1 ; break ; case MINIMUM : start = connections . length - cSpread ; stop = connections . length - 1 ; break ; case AVERAGE : int mid = connections . length / 2 ; start = mid - ( cSpread / 2 ) ; stop = mid + ( cSpread / 2 ) ; break ; } // logger . info ( " Spread : [ " + cSpread + " ] , Connections : [ " + connections . length + " ] , Start : [ " + start + " ] , Stop : [ " + stop + " ] " ) ;
cnt = 0 ; // logger . info ( " Queue : " + queue ) ;
// logger . info ( " Queue size : " + queue . size ( ) ) ;
List < Node < T > > list = new ArrayList < > ( ) ; double [ ] weights = new double [ cSpread ] ; int fcnt = 0 ; while ( ! queue . isEmpty ( ) ) { Node < T > node = queue . poll ( ) ; if ( cnt >= start && cnt <= stop ) { list . add ( node ) ; weights [ fcnt ] = node . getWeight ( ) ; fcnt ++ ; } connections [ cnt ] = node . getVertexId ( ) ; cnt ++ ; } int con = - 1 ; switch ( spectrum ) { case PLAIN : { con = RandomUtils . nextInt ( start , stop + 1 ) ; // logger . info ( " Picked selection : " + con ) ;
Vertex < T > nV = sourceGraph . getVertex ( connections [ con ] ) ; startPosition = nV . vertexID ( ) ; lastId = vertex . vertexID ( ) ; } break ; case PROPORTIONAL : { double norm [ ] = MathArrays . normalizeArray ( weights , 1 ) ; double prob = rng . nextDouble ( ) ; double floor = 0.0 ; for ( int b = 0 ; b < weights . length ; b ++ ) { if ( prob >= floor && prob < floor + norm [ b ] ) { startPosition = list . get ( b ) . getVertexId ( ) ; lastId = startPosition ; break ; } else { floor += norm [ b ] ; } } } break ; } } else { switch ( noEdgeHandling ) { case EXCEPTION_ON_DISCONNECTED : throw new NoEdgesException ( "No more edges at vertex [" + currentPosition + "]" ) ; case CUTOFF_ON_DISCONNECTED : i += walkLength ; break ; case SELF_LOOP_ON_DISCONNECTED : startPosition = currentPosition ; break ; case RESTART_ON_DISCONNECTED : startPosition = startPoint ; break ; default : throw new UnsupportedOperationException ( "Unsupported noEdgeHandling: [" + noEdgeHandling + "]" ) ; } } } break ; default : throw new UnsupportedOperationException ( "Unknown WalkDirection: [" + walkDirection + "]" ) ; } } return sequence ; |
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public EEnum getIfcWorkScheduleTypeEnum ( ) { } } | if ( ifcWorkScheduleTypeEnumEEnum == null ) { ifcWorkScheduleTypeEnumEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 1110 ) ; } return ifcWorkScheduleTypeEnumEEnum ; |
public class ReduceRecordsPlan { /** * Buckets of a field may be discarded during the cost estimation if its
* frequency is less than 1 . As a result , the total frequencies of buckets
* may be diverse in different fields . This method synchronizes the total
* frequencies of different fields in the specified histogram .
* @ param hist
* the histogram
* @ return a histogram whose total frequencies in different fields are
* synchronized */
public static Histogram syncHistogram ( Histogram hist ) { } } | double maxRecs = 0.0 ; for ( String fld : hist . fields ( ) ) { double numRecs = 0.0 ; for ( Bucket bkt : hist . buckets ( fld ) ) numRecs += bkt . frequency ( ) ; if ( Double . compare ( numRecs , maxRecs ) > 0 ) maxRecs = numRecs ; } Histogram syncHist = new Histogram ( hist . fields ( ) ) ; for ( String fld : hist . fields ( ) ) { double numRecs = 0.0 ; for ( Bucket bkt : hist . buckets ( fld ) ) numRecs += bkt . frequency ( ) ; double extrapolation = maxRecs / numRecs ; for ( Bucket bkt : hist . buckets ( fld ) ) syncHist . addBucket ( fld , new Bucket ( bkt . valueRange ( ) , extrapolation * bkt . frequency ( ) , bkt . distinctValues ( ) , bkt . valuePercentiles ( ) ) ) ; } return syncHist ; |
public class NodeTypeDataManagerImpl { /** * Add a < code > NodeTypeRegistryListener < / code >
* @ param listener the new listener to be informed on ( un ) registration of node
* types */
public void addListener ( final NodeTypeManagerListener listener ) { } } | if ( ! this . listeners . containsKey ( listener ) ) { this . listeners . put ( listener , listener ) ; } |
public class ElementUI { /** * Create wrapped component ( s ) from specified template ( a cwf page ) .
* @ param template URL of cwf page that will serve as a template . If the URL is not specified ,
* the template name is obtained from getTemplateUrl .
* @ param parent The component that will become the parent .
* @ param controller If specified , events and variables are autowired to the controller .
* @ return Top level component . */
protected BaseUIComponent createFromTemplate ( String template , BaseComponent parent , Object controller ) { } } | if ( StringUtils . isEmpty ( template ) ) { template = getTemplateUrl ( ) ; } else if ( ! template . startsWith ( "web/" ) ) { template = CWFUtil . getResourcePath ( getClass ( ) ) + template ; } BaseUIComponent top = null ; try { top = ( BaseUIComponent ) PageUtil . createPage ( template , parent ) . get ( 0 ) ; top . wireController ( controller ) ; } catch ( Exception e ) { CWFException . raise ( "Error creating element from template." , e ) ; } return top ; |
public class DBUtility { /** * Checks the database for the existence of this table . column of the specified
* jdbc type . Returns true if it exists , false if it doesn ' t exist , and throws
* a SQLException if the connection is not established . NOTE : If a schema is
* required for your database , then it should have been provided in the
* connection url .
* @ paramtableNameString name of the table to check .
* @ paramcolumnNameString name of the table column to check .
* @ paramjdbcTypeCase insensitive String representation of
* the jdbc type of the column . Valid values
* are string representations of the types listed
* in java . sql . Types . For example , " bit " , " float " ,
* " varchar " , " clob " , etc .
* @ paramignoreCaseboolean flag that determines if the utility should
* consider the column name case when searching for
* the database table . column .
* @ throws SQLException if the Table doesn ' t exist , if the column doesn ' t exist , if the column type doesn ' t match the specified jdbcType . */
public void exists ( String tableName , String columnName , String jdbcType , boolean ignoreCase ) throws SQLException { } } | if ( tableName == null ) throw new SQLException ( "TableName was null. You must specify a valid table name." ) ; if ( columnName == null ) throw new SQLException ( "Column name was null. You must specify a valid column name." ) ; ResultSet columns = getColumns ( tableName ) ; if ( columns == null ) { // columns not in the cache , look them up and cache
PreparedStatement checkTable = null ; try { // System . out . println ( " DBUtility : looking up table : " + tableName ) ;
// System . out . println ( " Select * from " + tableName + " where 1 = 0 " ) ;
checkTable = m_connection . prepareStatement ( "Select * from " + tableName + " where 1=0" ) ; columns = checkTable . executeQuery ( ) ; putColumns ( tableName , columns ) ; } catch ( SQLException sqle ) { if ( sqle . getMessage ( ) . startsWith ( m_ORA_EXCEPTION_1000 ) || sqle . getMessage ( ) . startsWith ( m_ORA_EXCEPTION_604 ) ) { System . out . println ( "Exceeded available Oracle cursors. Resetting connection and trying the SQL statement again..." ) ; resetConnection ( ) ; exists ( tableName , columnName , jdbcType , ignoreCase ) ; } else { // System . out . println ( sqle . getMessage ( ) ) ;
throw sqle ; } } } ResultSetMetaData rsMeta = columns . getMetaData ( ) ; int iColumns = rsMeta . getColumnCount ( ) ; int jdbcTypeConst = this . getJdbcType ( jdbcType ) ; for ( int i = 1 ; i <= iColumns ; i ++ ) { if ( ignoreCase ) { // ignore case while testing
if ( columnName . equalsIgnoreCase ( rsMeta . getColumnName ( i ) ) ) { // The column exists , does the type match ?
if ( jdbcTypeConst != rsMeta . getColumnType ( i ) ) { throw new SQLException ( "The column '" + tableName + "." + columnName + "' is of type '" + rsMeta . getColumnTypeName ( i ) + "' and cannot be mapped to the jdbc type '" + jdbcType + "'." ) ; } else { return ; } } } else { // enforce case - sensitive compare
if ( columnName . equals ( rsMeta . getColumnName ( i ) ) ) { // The column exists , does the type match ?
if ( jdbcTypeConst != rsMeta . getColumnType ( i ) ) { throw new SQLException ( "The column '" + tableName + "." + columnName + "' is of type '" + rsMeta . getColumnTypeName ( i ) + "' and cannot be mapped to the jdbc type '" + jdbcType + "'." ) ; } else { return ; } } } // System . out . println ( " Found column : " + rsMeta . getColumnName ( i ) ) ;
} throw new SQLException ( "The column '" + columnName + "' was not found in table '" + tableName + "'." ) ; |
public class QueuedFuture { /** * { @ inheritDoc } */
@ Override @ FFDCIgnore ( { } } | ExecutionException . class } ) public R get ( ) throws InterruptedException , ExecutionException { R result = null ; Future < Future < R > > resultFuture = getResultFuture ( ) ; try { result = resultFuture . get ( ) . get ( ) ; } catch ( ExecutionException e ) { if ( e . getCause ( ) instanceof com . ibm . ws . microprofile . faulttolerance . spi . ExecutionException ) { throw new ExecutionException ( e . getCause ( ) . getCause ( ) ) ; } else { throw e ; } } return result ; |
public class ClassFileTypeSignatureParser { /** * parse the class name ( outer class and inner class )
* @ return */
public ClassTypeSignature parseClassName ( ) { } } | // read ID ( / Id ) *
String outerClassName = parseOuterClassName ( ) ; TypeArgSignature [ ] typeArgSignatures = new TypeArgSignature [ 0 ] ; int ch = peekChar ( ) ; if ( acceptGenerics && ch == '<' ) { typeArgSignatures = parseTypeArgs ( ) ; } ClassTypeSignature classTypeSignature = new ClassTypeSignature ( outerClassName , typeArgSignatures , null ) ; ch = peekChar ( ) ; if ( ch == innerClassPrefix ) { // ' . ' or ' $ '
classTypeSignature = parseInnerClasses ( classTypeSignature ) ; } return classTypeSignature ; |
public class Roaring64NavigableMap { /** * In - place bitwise ANDNOT ( difference ) operation . The current bitmap is modified .
* @ param x2 other bitmap */
public void andNot ( final Roaring64NavigableMap x2 ) { } } | boolean firstBucket = true ; Iterator < Entry < Integer , BitmapDataProvider > > thisIterator = highToBitmap . entrySet ( ) . iterator ( ) ; while ( thisIterator . hasNext ( ) ) { Entry < Integer , BitmapDataProvider > e1 = thisIterator . next ( ) ; // Keep object to prevent auto - boxing
Integer high = e1 . getKey ( ) ; BitmapDataProvider lowBitmap2 = x2 . highToBitmap . get ( high ) ; if ( lowBitmap2 != null ) { BitmapDataProvider lowBitmap1 = e1 . getValue ( ) ; if ( lowBitmap2 instanceof RoaringBitmap && lowBitmap1 instanceof RoaringBitmap ) { ( ( RoaringBitmap ) lowBitmap1 ) . andNot ( ( RoaringBitmap ) lowBitmap2 ) ; } else if ( lowBitmap2 instanceof MutableRoaringBitmap && lowBitmap1 instanceof MutableRoaringBitmap ) { ( ( MutableRoaringBitmap ) lowBitmap1 ) . andNot ( ( MutableRoaringBitmap ) lowBitmap2 ) ; } else { throw new UnsupportedOperationException ( ".and is not between " + this . getClass ( ) + " and " + lowBitmap1 . getClass ( ) ) ; } } if ( firstBucket ) { firstBucket = false ; // Invalidate the lowest high as lowest not valid
firstHighNotValid = Math . min ( firstHighNotValid , high ) ; allValid = false ; } } |
public class SimpleConsumerThread { /** * Request offsets from Kafka with a specified set of partition ' s offset request information .
* The returned offsets are used to set the internal partition states .
* < p > This method retries three times if the response has an error .
* @ param consumer The consumer connected to lead broker
* @ param partitionStates the partition states , will be set with offsets fetched from Kafka request
* @ param partitionToRequestInfo map of each partition to its offset request info */
private static void requestAndSetOffsetsFromKafka ( SimpleConsumer consumer , List < KafkaTopicPartitionState < TopicAndPartition > > partitionStates , Map < TopicAndPartition , PartitionOffsetRequestInfo > partitionToRequestInfo ) throws IOException { } } | int retries = 0 ; OffsetResponse response ; while ( true ) { kafka . javaapi . OffsetRequest request = new kafka . javaapi . OffsetRequest ( partitionToRequestInfo , kafka . api . OffsetRequest . CurrentVersion ( ) , consumer . clientId ( ) ) ; response = consumer . getOffsetsBefore ( request ) ; if ( response . hasError ( ) ) { StringBuilder exception = new StringBuilder ( ) ; for ( KafkaTopicPartitionState < TopicAndPartition > part : partitionStates ) { short code ; if ( ( code = response . errorCode ( part . getTopic ( ) , part . getPartition ( ) ) ) != ErrorMapping . NoError ( ) ) { exception . append ( "\nException for topic=" ) . append ( part . getTopic ( ) ) . append ( " partition=" ) . append ( part . getPartition ( ) ) . append ( ": " ) . append ( ExceptionUtils . stringifyException ( ErrorMapping . exceptionFor ( code ) ) ) ; } } if ( ++ retries >= 3 ) { throw new IOException ( "Unable to get last offset for partitions " + partitionStates + ": " + exception . toString ( ) ) ; } else { LOG . warn ( "Unable to get last offset for partitions: Exception(s): {}" , exception ) ; } } else { break ; // leave retry loop
} } for ( KafkaTopicPartitionState < TopicAndPartition > part : partitionStates ) { // there will be offsets only for partitions that were requested for
if ( partitionToRequestInfo . containsKey ( part . getKafkaPartitionHandle ( ) ) ) { final long offset = response . offsets ( part . getTopic ( ) , part . getPartition ( ) ) [ 0 ] ; // the offset returned is that of the next record to fetch . because our state reflects the latest
// successfully emitted record , we subtract one
part . setOffset ( offset - 1 ) ; } } |
public class RemoteBundleContextImpl { /** * Starts a bundle .
* @ param bundle bundle to be started
* @ throws BundleException - If bundle cannot be started */
private void startBundle ( final Bundle bundle ) throws BundleException { } } | // Don ' t start if bundle already active
int bundleState = bundle . getState ( ) ; if ( bundleState == Bundle . ACTIVE ) { return ; } // Don ' t start if bundle is a fragment bundle
Dictionary bundleHeaders = bundle . getHeaders ( ) ; if ( bundleHeaders . get ( Constants . FRAGMENT_HOST ) != null ) { return ; } // Start bundle
bundle . start ( ) ; bundleState = bundle . getState ( ) ; if ( bundleState != Bundle . ACTIVE ) { long bundleId = bundle . getBundleId ( ) ; String bundleName = bundle . getSymbolicName ( ) ; String bundleStateStr = bundleStateToString ( bundleState ) ; throw new BundleException ( "Bundle (" + bundleId + ", " + bundleName + ") not started (still " + bundleStateStr + ")" ) ; } |
public class HttpRequest { /** * Specify the { @ link ConnectionFactory } used to create new requests . */
public static void setConnectionFactory ( final ConnectionFactory connectionFactory ) { } } | if ( connectionFactory == null ) CONNECTION_FACTORY = ConnectionFactory . DEFAULT ; else CONNECTION_FACTORY = connectionFactory ; |
public class Queue { /** * Return a standard ( unextended ) JDK Stream connected to this Queue
* To disconnect cleanly close the queue
* < pre >
* { @ code
* use queue . stream ( ) . parallel ( ) to convert to a parallel Stream
* < / pre >
* @ param closeScalingFactor Scaling factor for Queue closed messages to propagate to connected parallel Streams .
* Scaling Factor may need to be high to reach all connect parallel threads .
* @ return Java 8 Stream connnected to this Queue */
public Stream < T > jdkStream ( int closeScalingFactor ) { } } | int cores = Runtime . getRuntime ( ) . availableProcessors ( ) ; String par = System . getProperty ( "java.util.concurrent.ForkJoinPool.common.parallelism" ) ; int connected = par != null ? Integer . valueOf ( par ) : cores ; int update = 0 ; do { update = listeningStreams . get ( ) + connected * closeScalingFactor ; } while ( ! listeningStreams . compareAndSet ( listeningStreams . get ( ) , update ) ) ; return closingStream ( this :: get , new AlwaysContinue ( ) ) ; |
public class BuffReaderParseFactory { /** * Not supported at this time . */
@ Override public Parser newFixedLengthParser ( final Connection con , final InputStream dataSourceStream , final String dataDefinition ) { } } | throw new UnsupportedOperationException ( "Not supported..." ) ; |
public class Quantile { /** * Adjust heights of markers 0 to 2 if necessary */
private void adjustMarkerHeights ( ) { } } | double mm = _n [ 1 ] - 1.0 ; double mp = _n [ 1 ] + 1.0 ; if ( _nn [ 0 ] >= mp && _n [ 2 ] > mp ) { _q [ 1 ] = qPlus ( mp , _n [ 0 ] , _n [ 1 ] , _n [ 2 ] , _q [ 0 ] , _q [ 1 ] , _q [ 2 ] ) ; _n [ 1 ] = mp ; } else if ( _nn [ 0 ] <= mm && _n [ 0 ] < mm ) { _q [ 1 ] = qMinus ( mm , _n [ 0 ] , _n [ 1 ] , _n [ 2 ] , _q [ 0 ] , _q [ 1 ] , _q [ 2 ] ) ; _n [ 1 ] = mm ; } mm = _n [ 2 ] - 1.0 ; mp = _n [ 2 ] + 1.0 ; if ( _nn [ 1 ] >= mp && _n [ 3 ] > mp ) { _q [ 2 ] = qPlus ( mp , _n [ 1 ] , _n [ 2 ] , _n [ 3 ] , _q [ 1 ] , _q [ 2 ] , _q [ 3 ] ) ; _n [ 2 ] = mp ; } else if ( _nn [ 1 ] <= mm && _n [ 1 ] < mm ) { _q [ 2 ] = qMinus ( mm , _n [ 1 ] , _n [ 2 ] , _n [ 3 ] , _q [ 1 ] , _q [ 2 ] , _q [ 3 ] ) ; _n [ 2 ] = mm ; } mm = _n [ 3 ] - 1.0 ; mp = _n [ 3 ] + 1.0 ; if ( _nn [ 2 ] >= mp && _n [ 4 ] > mp ) { _q [ 3 ] = qPlus ( mp , _n [ 2 ] , _n [ 3 ] , _n [ 4 ] , _q [ 2 ] , _q [ 3 ] , _q [ 4 ] ) ; _n [ 3 ] = mp ; } else if ( _nn [ 2 ] <= mm && _n [ 2 ] < mm ) { _q [ 3 ] = qMinus ( mm , _n [ 2 ] , _n [ 3 ] , _n [ 4 ] , _q [ 2 ] , _q [ 3 ] , _q [ 4 ] ) ; _n [ 3 ] = mm ; } |
public class MetricsTimeVaryingRate { /** * The max time for a single operation since the last reset
* { @ link # resetMinMax ( ) }
* @ return max time for an operation */
public long getMaxTime ( ) { } } | lock . lock ( ) ; try { if ( printMinMax ) { return previousIntervalMinMax . maxTime ; } return minMax . maxTime ; } finally { lock . unlock ( ) ; } |
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public EEnum getIfcTransformerTypeEnum ( ) { } } | if ( ifcTransformerTypeEnumEEnum == null ) { ifcTransformerTypeEnumEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 1089 ) ; } return ifcTransformerTypeEnumEEnum ; |
public class EmojiManager { /** * Installs the given EmojiProvider .
* NOTE : That only one can be present at any time .
* @ param provider the provider that should be installed . */
public static void install ( @ NonNull final EmojiProvider provider ) { } } | INSTANCE . categories = checkNotNull ( provider . getCategories ( ) , "categories == null" ) ; INSTANCE . emojiMap . clear ( ) ; INSTANCE . emojiReplacer = provider instanceof EmojiReplacer ? ( EmojiReplacer ) provider : DEFAULT_EMOJI_REPLACER ; final List < String > unicodesForPattern = new ArrayList < > ( GUESSED_UNICODE_AMOUNT ) ; final int categoriesSize = INSTANCE . categories . length ; // noinspection ForLoopReplaceableByForEach
for ( int i = 0 ; i < categoriesSize ; i ++ ) { final Emoji [ ] emojis = checkNotNull ( INSTANCE . categories [ i ] . getEmojis ( ) , "emojies == null" ) ; final int emojisSize = emojis . length ; // noinspection ForLoopReplaceableByForEach
for ( int j = 0 ; j < emojisSize ; j ++ ) { final Emoji emoji = emojis [ j ] ; final String unicode = emoji . getUnicode ( ) ; final List < Emoji > variants = emoji . getVariants ( ) ; INSTANCE . emojiMap . put ( unicode , emoji ) ; unicodesForPattern . add ( unicode ) ; // noinspection ForLoopReplaceableByForEach
for ( int k = 0 ; k < variants . size ( ) ; k ++ ) { final Emoji variant = variants . get ( k ) ; final String variantUnicode = variant . getUnicode ( ) ; INSTANCE . emojiMap . put ( variantUnicode , variant ) ; unicodesForPattern . add ( variantUnicode ) ; } } } if ( unicodesForPattern . isEmpty ( ) ) { throw new IllegalArgumentException ( "Your EmojiProvider must at least have one category with at least one emoji." ) ; } // We need to sort the unicodes by length so the longest one gets matched first .
Collections . sort ( unicodesForPattern , STRING_LENGTH_COMPARATOR ) ; final StringBuilder patternBuilder = new StringBuilder ( GUESSED_TOTAL_PATTERN_LENGTH ) ; final int unicodesForPatternSize = unicodesForPattern . size ( ) ; for ( int i = 0 ; i < unicodesForPatternSize ; i ++ ) { patternBuilder . append ( Pattern . quote ( unicodesForPattern . get ( i ) ) ) . append ( '|' ) ; } final String regex = patternBuilder . deleteCharAt ( patternBuilder . length ( ) - 1 ) . toString ( ) ; INSTANCE . emojiPattern = Pattern . compile ( regex ) ; INSTANCE . emojiRepetitivePattern = Pattern . compile ( '(' + regex + ")+" ) ; |
public class Resources { /** * Retrieve a char from bundle .
* @ param key the key of resource
* @ param defaultValue the default value if key is missing
* @ return the resource char
* @ throws MissingResourceException if the requested key is unknown */
public char getChar ( String key , char defaultValue ) throws MissingResourceException { } } | try { return getChar ( key ) ; } catch ( MissingResourceException mre ) { return defaultValue ; } |
public class GlobalClusterMember { /** * The Amazon Resource Name ( ARN ) for each read - only secondary cluster associated with the Aurora global database .
* @ return The Amazon Resource Name ( ARN ) for each read - only secondary cluster associated with the Aurora global
* database . */
public java . util . List < String > getReaders ( ) { } } | if ( readers == null ) { readers = new com . amazonaws . internal . SdkInternalList < String > ( ) ; } return readers ; |
public class DraweeView { /** * This method is idempotent so it only has effect the first time it ' s called */
private void init ( Context context ) { } } | try { if ( FrescoSystrace . isTracing ( ) ) { FrescoSystrace . beginSection ( "DraweeView#init" ) ; } if ( mInitialised ) { return ; } mInitialised = true ; mDraweeHolder = DraweeHolder . create ( null , context ) ; if ( Build . VERSION . SDK_INT >= Build . VERSION_CODES . LOLLIPOP ) { ColorStateList imageTintList = getImageTintList ( ) ; if ( imageTintList == null ) { return ; } setColorFilter ( imageTintList . getDefaultColor ( ) ) ; } // In Android N and above , visibility handling for Drawables has been changed , which breaks
// activity transitions with DraweeViews .
mLegacyVisibilityHandlingEnabled = sGlobalLegacyVisibilityHandlingEnabled && context . getApplicationInfo ( ) . targetSdkVersion >= 24 ; // Build . VERSION _ CODES . N
} finally { if ( FrescoSystrace . isTracing ( ) ) { FrescoSystrace . endSection ( ) ; } } |
public class RouteModel { /** * Creates the JSON representation of the given route .
* @ param route the route
* @ param json the JSON service
* @ return the json representation */
public static ObjectNode from ( Route route , Json json ) { } } | return json . newObject ( ) . put ( "url" , route . getUrl ( ) ) . put ( "controller" , route . getControllerClass ( ) . getName ( ) ) . put ( "method" , route . getControllerMethod ( ) . getName ( ) ) . put ( "http_method" , route . getHttpMethod ( ) . toString ( ) ) ; |
public class DataSet { /** * Writes a DataSet as text file ( s ) to the specified location .
* < p > For each element of the DataSet the result of { @ link Object # toString ( ) } is written .
* @ param filePath The path pointing to the location the text file is written to .
* @ param writeMode Control the behavior for existing files . Options are NO _ OVERWRITE and OVERWRITE .
* @ return The DataSink that writes the DataSet .
* @ see TextOutputFormat
* @ see DataSet # writeAsText ( String ) Output files and directories */
public DataSink < T > writeAsText ( String filePath , WriteMode writeMode ) { } } | TextOutputFormat < T > tof = new TextOutputFormat < > ( new Path ( filePath ) ) ; tof . setWriteMode ( writeMode ) ; return output ( tof ) ; |
public class EJBJarDescriptorHandler { /** * The local ref must be inserted into the ejb - jar file at the proper
* location based on the ejb - jar schema definition . Check for elements which
* can immediatly FOLLOW an ejb - ref from the closest to farthest as
* defined by the schema .
* @ param parent The ' session ' or ' entity ' XML element .
* @ return A suitable node to insert the ejb - local - ref BEFORE . */
private Node findEjbLocalRefInsertPoint ( Element parent ) { } } | Element e = DomUtils . getChildElementByName ( parent , "service-ref" ) ; if ( e != null ) return e ; e = DomUtils . getChildElementByName ( parent , "resource-ref" ) ; if ( e != null ) return e ; e = DomUtils . getChildElementByName ( parent , "resource-env-ref" ) ; if ( e != null ) return e ; e = DomUtils . getChildElementByName ( parent , "message-destination-ref" ) ; if ( e != null ) return e ; e = DomUtils . getChildElementByName ( parent , "security-role-ref" ) ; if ( e != null ) return e ; e = DomUtils . getChildElementByName ( parent , "security-identity" ) ; if ( e != null ) return e ; // only applies to entity beans
e = DomUtils . getChildElementByName ( parent , "query" ) ; if ( e != null ) return e ; return null ; |
public class ExampleGraphicsProvider { /** * we have no groups in this example */
@ Nullable @ Override public NodeGraphicDefinition getGroupGraphics ( Object group , Set < String > groupElements ) { } } | return null ; |
public class AmazonCloudSearchClient { /** * Gets the suggesters configured for a domain . A suggester enables you to display possible matches before users
* finish typing their queries . Can be limited to specific suggesters by name . By default , shows all suggesters and
* includes any pending changes to the configuration . Set the < code > Deployed < / code > option to < code > true < / code > to
* show the active configuration and exclude pending changes . For more information , see < a
* href = " http : / / docs . aws . amazon . com / cloudsearch / latest / developerguide / getting - suggestions . html "
* target = " _ blank " > Getting Search Suggestions < / a > in the < i > Amazon CloudSearch Developer Guide < / i > .
* @ param describeSuggestersRequest
* Container for the parameters to the < code > < a > DescribeSuggester < / a > < / code > operation . Specifies the name of
* the domain you want to describe . To restrict the response to particular suggesters , specify the names of
* the suggesters you want to describe . To show the active configuration and exclude any pending changes , set
* the < code > Deployed < / code > option to < code > true < / code > .
* @ return Result of the DescribeSuggesters operation returned by the service .
* @ throws BaseException
* An error occurred while processing the request .
* @ throws InternalException
* An internal error occurred while processing the request . If this problem persists , report an issue from
* the < a href = " http : / / status . aws . amazon . com / " target = " _ blank " > Service Health Dashboard < / a > .
* @ throws ResourceNotFoundException
* The request was rejected because it attempted to reference a resource that does not exist .
* @ sample AmazonCloudSearch . DescribeSuggesters */
@ Override public DescribeSuggestersResult describeSuggesters ( DescribeSuggestersRequest request ) { } } | request = beforeClientExecution ( request ) ; return executeDescribeSuggesters ( request ) ; |
public class SaxHtmlHandler { /** * Characters Method . */
public void characters ( char [ ] ch , int start , int length ) throws SAXException { } } | if ( startTable ) { try { String string = new String ( ch , start , length ) ; for ( int i = string . length ( ) - 1 ; i >= 0 ; i -- ) { // Trim trailing spaces
int x = Character . getNumericValue ( string . charAt ( i ) ) ; if ( ( Character . isWhitespace ( string . charAt ( i ) ) ) || ( x == - 1 ) ) string = string . substring ( 0 , string . length ( ) - 1 ) ; else break ; } if ( row == 0 ) { new StringField ( m_record , string , - 1 , string , null ) ; } else { if ( col == 0 ) { if ( m_record . getEditMode ( ) == DBConstants . EDIT_ADD ) m_record . add ( ) ; m_record . addNew ( ) ; } m_record . getField ( col + 1 ) . setString ( string ) ; } } catch ( DBException e ) { e . printStackTrace ( ) ; } } |
public class AWSDatabaseMigrationServiceClient { /** * Modifies an existing AWS DMS event notification subscription .
* @ param modifyEventSubscriptionRequest
* @ return Result of the ModifyEventSubscription operation returned by the service .
* @ throws ResourceQuotaExceededException
* The quota for this resource quota has been exceeded .
* @ throws ResourceNotFoundException
* The resource could not be found .
* @ throws SNSInvalidTopicException
* The SNS topic is invalid .
* @ throws SNSNoAuthorizationException
* You are not authorized for the SNS subscription .
* @ throws KMSAccessDeniedException
* The ciphertext references a key that doesn ' t exist or DMS account doesn ' t have an access to
* @ throws KMSDisabledException
* The specified master key ( CMK ) isn ' t enabled .
* @ throws KMSInvalidStateException
* The state of the specified KMS resource isn ' t valid for this request .
* @ throws KMSNotFoundException
* The specified KMS entity or resource can ' t be found .
* @ throws KMSThrottlingException
* This request triggered KMS request throttling .
* @ sample AWSDatabaseMigrationService . ModifyEventSubscription
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / dms - 2016-01-01 / ModifyEventSubscription " target = " _ top " > AWS
* API Documentation < / a > */
@ Override public ModifyEventSubscriptionResult modifyEventSubscription ( ModifyEventSubscriptionRequest request ) { } } | request = beforeClientExecution ( request ) ; return executeModifyEventSubscription ( request ) ; |
public class ScalingThreadPoolExecutor { /** * Creates a { @ link ScalingThreadPoolExecutor } .
* @ param min Core thread pool size .
* @ param max Max number of threads allowed .
* @ param keepAliveTime Keep alive time for unused threads in milliseconds .
* @ param threadFactory thread factory to use .
* @ return A { @ link ScalingThreadPoolExecutor } . */
public static ScalingThreadPoolExecutor newScalingThreadPool ( int min , int max , long keepAliveTime , ThreadFactory threadFactory ) { } } | ScalingQueue queue = new ScalingQueue ( ) ; ScalingThreadPoolExecutor executor = new ScalingThreadPoolExecutor ( min , max , keepAliveTime , TimeUnit . MILLISECONDS , queue , threadFactory ) ; executor . setRejectedExecutionHandler ( new ForceQueuePolicy ( ) ) ; queue . setThreadPoolExecutor ( executor ) ; return executor ; |
public class AbstractRateProvider { /** * A protected helper method to divide 2 { @ link NumberValue } types . < br >
* If either of the values is < code > null < / code > an { @ link ArithmeticException } is thrown .
* @ param dividend the first value to be divided
* @ param divisor the value to be divided by
* @ param context the { @ link MathContext } to use
* @ return the result of the division as { @ link NumberValue } */
protected static NumberValue divide ( NumberValue dividend , NumberValue divisor , MathContext context ) { } } | if ( dividend == null ) { throw new ArithmeticException ( "The dividend cannot be null" ) ; } if ( divisor == null ) { throw new ArithmeticException ( "The divisor cannot be null" ) ; } return new DefaultNumberValue ( dividend . numberValueExact ( BigDecimal . class ) . divide ( divisor . numberValue ( BigDecimal . class ) , context ) ) ; |
public class FixIntegerQuantityPrecisionsBot { /** * Checks if the given value is a number with precision + / - 1.
* @ param quantityValue
* @ return */
protected boolean isPlusMinusOneValue ( QuantityValue quantityValue ) { } } | BigDecimal valueSucc = quantityValue . getNumericValue ( ) . add ( BigDecimal . ONE ) ; BigDecimal valuePrec = quantityValue . getNumericValue ( ) . subtract ( BigDecimal . ONE ) ; return ( quantityValue . getLowerBound ( ) . equals ( valuePrec ) && quantityValue . getUpperBound ( ) . equals ( valueSucc ) && "1" . equals ( quantityValue . getUnit ( ) ) ) ; |
public class WebSecurityConfig { /** * { @ inheritDoc } */
@ Override protected void configure ( final HttpSecurity http ) throws Exception { } } | handleCsrf ( http ) . sessionManagement ( ) . sessionCreationPolicy ( SessionCreationPolicy . STATELESS ) . and ( ) . exceptionHandling ( ) . authenticationEntryPoint ( restAuthenticationEntryPoint ) . and ( ) . addFilterBefore ( jwtAuthenticationTokenFilter ( ) , BasicAuthenticationFilter . class ) . authorizeRequests ( ) . anyRequest ( ) . authenticated ( ) . and ( ) . formLogin ( ) . loginPage ( "/gedbrowserng/v1/login" ) . successHandler ( authenticationSuccessHandler ) . failureHandler ( authenticationFailureHandler ) . and ( ) . logout ( ) . logoutRequestMatcher ( new AntPathRequestMatcher ( "/gedbrowserng/v1/logout" ) ) . logoutSuccessHandler ( logoutSuccess ) . deleteCookies ( cookie ) ; |
public class LocalTransactionManager { /** * { @ inheritDoc }
* @ see jp . co . future . uroborosql . tx . TransactionManager # setSavepoint ( java . lang . String ) */
@ Override public void setSavepoint ( final String savepointName ) { } } | Optional < LocalTransactionContext > txContext = currentTxContext ( ) ; if ( txContext . isPresent ( ) ) { txContext . get ( ) . setSavepoint ( savepointName ) ; } else { this . unmanagedTransaction . ifPresent ( ut -> ut . setSavepoint ( savepointName ) ) ; } |
public class UriMappingResolver { /** * Calls { @ link # addResource ( java . lang . String , java . lang . String ) } with
* pairs taken from the argument array .
* @ param resources array of uri - resource pairs
* @ return this
* @ throws IllegalArgumentException if length of resources is not even */
public UriMappingResolver addResources ( String ... resources ) { } } | if ( resources . length % 2 == 1 ) { throw new IllegalArgumentException ( "Expected even number of arguments" ) ; } for ( int i = 0 ; i < resources . length ; i += 2 ) { addSchema ( resources [ i ] , resources [ i + 1 ] ) ; } return this ; |
public class ActionValidator { protected Set < ConstraintViolation < Object > > hibernateValidate ( Object form , Class < ? > [ ] groups ) { } } | try { return hibernateValidator . validate ( form , groups ) ; } catch ( RuntimeException e ) { handleHibernateValidatorException ( form , groups , e ) ; return null ; // unreachable
} |
public class KickflipApiClient { /** * Get Stream Metadata for a a public { @ link io . kickflip . sdk . api . json . Stream } .
* The target Stream must belong a User of your Kickflip app .
* @ param stream the { @ link io . kickflip . sdk . api . json . Stream } to get Meta data for
* @ param cb A callback to receive the updated Stream upon request completion */
public void getStreamInfo ( Stream stream , final KickflipCallback cb ) { } } | GenericData data = new GenericData ( ) ; data . put ( "stream_id" , stream . getStreamId ( ) ) ; post ( GET_META , new UrlEncodedContent ( data ) , Stream . class , cb ) ; |
public class Pattern { /** * Appends a new pattern to the existing one . The new pattern enforces strict
* temporal contiguity . This means that the whole pattern sequence matches only
* if an event which matches this pattern directly follows the preceding matching
* event . Thus , there cannot be any events in between two matching events .
* @ param name Name of the new pattern
* @ return A new pattern which is appended to this one */
public Pattern < T , T > next ( final String name ) { } } | return new Pattern < > ( name , this , ConsumingStrategy . STRICT , afterMatchSkipStrategy ) ; |
public class CommonExprTransformer { /** * < p > fields . < / p >
* @ param operator a { @ link java . lang . String } object .
* @ param args an array of { @ link ameba . db . dsl . QueryExprMeta . Val } objects .
* @ param parent a { @ link ameba . db . dsl . QueryExprMeta } object .
* @ return a { @ link io . ebean . Expression } object . */
public static Expression fields ( String operator , Val < Expression > [ ] args , QueryExprMeta parent ) { } } | if ( args . length < 1 ) { throw new QuerySyntaxException ( Messages . get ( "dsl.arguments.error2" , operator , 0 ) ) ; } if ( parent == null ) { throw new QuerySyntaxException ( Messages . get ( "dsl.arguments.error5" , operator ) ) ; } else if ( ! parent . operator ( ) . equals ( "option" ) ) { throw new QuerySyntaxException ( Messages . get ( "dsl.arguments.error6" , operator , "option" ) ) ; } return TextFieldsExpression . of ( args ) ; |
public class PutRecordsResult { /** * An array of successfully and unsuccessfully processed record results , correlated with the request by natural
* ordering . A record that is successfully added to a stream includes < code > SequenceNumber < / code > and
* < code > ShardId < / code > in the result . A record that fails to be added to a stream includes < code > ErrorCode < / code >
* and < code > ErrorMessage < / code > in the result .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setRecords ( java . util . Collection ) } or { @ link # withRecords ( java . util . Collection ) } if you want to override
* the existing values .
* @ param records
* An array of successfully and unsuccessfully processed record results , correlated with the request by
* natural ordering . A record that is successfully added to a stream includes < code > SequenceNumber < / code > and
* < code > ShardId < / code > in the result . A record that fails to be added to a stream includes
* < code > ErrorCode < / code > and < code > ErrorMessage < / code > in the result .
* @ return Returns a reference to this object so that method calls can be chained together . */
public PutRecordsResult withRecords ( PutRecordsResultEntry ... records ) { } } | if ( this . records == null ) { setRecords ( new com . amazonaws . internal . SdkInternalList < PutRecordsResultEntry > ( records . length ) ) ; } for ( PutRecordsResultEntry ele : records ) { this . records . add ( ele ) ; } return this ; |
public class CmsSetupBean { /** * Returns the user of the database from the properties . < p >
* @ return the database user used by the opencms core */
public String getDbWorkUser ( ) { } } | String user = getExtProperty ( CmsDbPoolV11 . KEY_DATABASE_POOL + '.' + getPool ( ) + ".user" ) ; if ( CmsStringUtil . isEmptyOrWhitespaceOnly ( user ) ) { return getDbCreateUser ( ) ; } return user ; |
public class ListUploadsRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( ListUploadsRequest listUploadsRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( listUploadsRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( listUploadsRequest . getArn ( ) , ARN_BINDING ) ; protocolMarshaller . marshall ( listUploadsRequest . getType ( ) , TYPE_BINDING ) ; protocolMarshaller . marshall ( listUploadsRequest . getNextToken ( ) , NEXTTOKEN_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class Location { /** * return value tells whether the given character
* has been included in location or not
* for example in sequence " \ r \ n " , the character
* ' \ n ' is not included in location . */
public boolean consume ( int ch ) { } } | offset ++ ; if ( ch == 0x0D ) { skipLF = true ; line ++ ; col = 0 ; return true ; } else if ( ch == 0x0A ) { if ( skipLF ) { skipLF = false ; return false ; } else { line ++ ; col = 0 ; return true ; } } else { skipLF = false ; col ++ ; return true ; } |
public class PathMetadataFactory { /** * Create a new PathMetadata instance for indexed array access
* @ param parent parent path
* @ param index index of element
* @ return array access path */
public static PathMetadata forArrayAccess ( Path < ? > parent , Expression < Integer > index ) { } } | return new PathMetadata ( parent , index , PathType . ARRAYVALUE ) ; |
public class BackupManagerImpl { /** * { @ inheritDoc } */
public void restoreExistingRepository ( String repositoryBackupIdentifier , boolean asynchronous ) throws BackupOperationException , BackupConfigurationException { } } | RepositoryBackupChainLog backupChainLog = null ; for ( RepositoryBackupChainLog chainLog : getRepositoryBackupsLogs ( ) ) { if ( chainLog . getBackupId ( ) . equals ( repositoryBackupIdentifier ) ) { backupChainLog = chainLog ; break ; } } if ( backupChainLog == null ) { throw new BackupConfigurationException ( "Can not found backup of repository with id \"" + repositoryBackupIdentifier + "\"" ) ; } this . restoreExistingRepository ( backupChainLog , backupChainLog . getOriginalRepositoryEntry ( ) , asynchronous ) ; |
public class FormSpec { /** * Parses an encoded size spec and returns the size .
* @ param token a token that represents a size , either bounded or plain
* @ return the decoded Size */
private Size parseSize ( String token ) { } } | if ( token . startsWith ( "[" ) && token . endsWith ( "]" ) ) { return parseBoundedSize ( token ) ; } if ( token . startsWith ( "max(" ) && token . endsWith ( ")" ) ) { return parseOldBoundedSize ( token , false ) ; } if ( token . startsWith ( "min(" ) && token . endsWith ( ")" ) ) { return parseOldBoundedSize ( token , true ) ; } return parseAtomicSize ( token ) ; |
public class ConstructorHelper { /** * create a new instance of the class represented by the no - argument constructor provided
* @ param constructor the zero argument constructor for the class
* @ return a new instance of the class
* @ throws InstantiationException
* @ throws ClassNotPersistenceCapableException if the constructor is null or there is an
* exception while trying to create a new instance */
public static Object instantiate ( Constructor constructor ) throws InstantiationException { } } | if ( constructor == null ) { throw new ClassNotPersistenceCapableException ( "A zero argument constructor was not provided!" ) ; } Object result = null ; try { result = constructor . newInstance ( NO_ARGS ) ; } catch ( InstantiationException e ) { throw e ; } catch ( Exception e ) { throw new ClassNotPersistenceCapableException ( "Can't instantiate class '" + ( constructor != null ? constructor . getDeclaringClass ( ) . getName ( ) : "null" ) + "' with given constructor: " + e . getMessage ( ) , e ) ; } return result ; |
public class CharacterTokenizer { /** * Return tokenized version of a string . Tokens are sequences
* of alphanumerics , or any single punctuation character . */
public Token [ ] tokenize ( String input ) { } } | char [ ] stringChars = input . toCharArray ( ) ; List < Token > tokens = new ArrayList < Token > ( ) ; for ( char c : stringChars ) { if ( Character . isLetterOrDigit ( c ) ) { tokens . add ( internSomething ( Character . toString ( c ) ) ) ; } else if ( ! ignorePunctuation && ! Character . isWhitespace ( c ) ) { tokens . add ( internSomething ( Character . toString ( c ) ) ) ; } } return ( Token [ ] ) tokens . toArray ( new BasicToken [ tokens . size ( ) ] ) ; |
public class ObjectToJsonConverter { /** * Set an value of an inner object
* @ param pInner the inner object
* @ param pAttribute the attribute to set
* @ param pValue the value to set
* @ return the old value
* @ throws IllegalAccessException if the reflection code fails during setting of the value
* @ throws InvocationTargetException reflection error */
private Object setObjectValue ( Object pInner , String pAttribute , Object pValue ) throws IllegalAccessException , InvocationTargetException { } } | // Call various handlers depending on the type of the inner object , as is extract Object
Class clazz = pInner . getClass ( ) ; if ( clazz . isArray ( ) ) { return arrayExtractor . setObjectValue ( stringToObjectConverter , pInner , pAttribute , pValue ) ; } Extractor handler = getExtractor ( clazz ) ; if ( handler != null ) { return handler . setObjectValue ( stringToObjectConverter , pInner , pAttribute , pValue ) ; } else { throw new IllegalStateException ( "Internal error: No handler found for class " + clazz + " for setting object value." + " (object: " + pInner + ", attribute: " + pAttribute + ", value: " + pValue + ")" ) ; } |
public class RecoveryAwareTransactionTable { /** * First moves the prepared transactions originated on the leavers into the recovery cache and then cleans up the
* transactions that are not yet prepared .
* @ param members The list of cluster members */
@ Override public void cleanupLeaverTransactions ( List < Address > members ) { } } | Iterator < RemoteTransaction > it = getRemoteTransactions ( ) . iterator ( ) ; while ( it . hasNext ( ) ) { RecoveryAwareRemoteTransaction recTx = ( RecoveryAwareRemoteTransaction ) it . next ( ) ; recTx . computeOrphan ( members ) ; if ( recTx . isInDoubt ( ) ) { recoveryManager . registerInDoubtTransaction ( recTx ) ; it . remove ( ) ; } } // this cleans up the transactions that are not yet prepared
super . cleanupLeaverTransactions ( members ) ; |
public class MapWebOperation { /** * Convert error to map
* @ param e
* @ return */
public static Map < String , Object > errorToMap ( Throwable e ) { } } | Map < String , Object > m = new HashMap < String , Object > ( ) ; m . put ( "requestId" , MDC . get ( "requestId" ) ) ; m . put ( "message" , e . getMessage ( ) ) ; m . put ( "errorClass" , e . getClass ( ) . getName ( ) ) ; return m ; |
public class JXMapViewer { /** * Set if the tile borders should be drawn . Mainly used for debugging .
* @ param drawTileBorders new value of this drawTileBorders */
public void setDrawTileBorders ( boolean drawTileBorders ) { } } | boolean old = isDrawTileBorders ( ) ; this . drawTileBorders = drawTileBorders ; firePropertyChange ( "drawTileBorders" , old , isDrawTileBorders ( ) ) ; repaint ( ) ; |
public class DifferentialFunctionFactory { /** * Batch norm operation . */
public SDVariable batchNorm ( SDVariable input , SDVariable mean , SDVariable variance , SDVariable gamma , SDVariable beta , boolean applyGamma , boolean applyBeta , double epsilon , int ... axis ) { } } | BatchNorm batchNorm = BatchNorm . builder ( ) . inputFunctions ( new SDVariable [ ] { input , mean , variance , gamma , beta } ) . applyGamma ( applyGamma ) . applyBeta ( applyBeta ) . epsilon ( epsilon ) . sameDiff ( sameDiff ( ) ) . axis ( axis ) . build ( ) ; val outputVars = batchNorm . outputVariables ( ) ; return outputVars [ 0 ] ; |
public class Cell { /** * Sets all constraint fields to null . */
public void clear ( ) { } } | minWidth = null ; minHeight = null ; prefWidth = null ; prefHeight = null ; maxWidth = null ; maxHeight = null ; spaceTop = null ; spaceLeft = null ; spaceBottom = null ; spaceRight = null ; padTop = null ; padLeft = null ; padBottom = null ; padRight = null ; fillX = null ; fillY = null ; align = null ; expandX = null ; expandY = null ; ignore = null ; colspan = null ; uniformX = null ; uniformY = null ; |
public class nspbr6 { /** * Use this API to fetch all the nspbr6 resources that are configured on netscaler .
* This uses nspbr6 _ args which is a way to provide additional arguments while fetching the resources . */
public static nspbr6 [ ] get ( nitro_service service , nspbr6_args args ) throws Exception { } } | nspbr6 obj = new nspbr6 ( ) ; options option = new options ( ) ; option . set_args ( nitro_util . object_to_string_withoutquotes ( args ) ) ; nspbr6 [ ] response = ( nspbr6 [ ] ) obj . get_resources ( service , option ) ; return response ; |
public class WebApp40 { /** * Throw NPE if name is null
* @ see com . ibm . ws . webcontainer . webapp . WebApp # getAttribute ( java . lang . String ) */
@ Override public Object getAttribute ( String name ) { } } | if ( name == null ) { logger . logp ( Level . SEVERE , CLASS_NAME , "getAttribute" , servlet40NLS . getString ( "name.is.null" ) ) ; throw new java . lang . NullPointerException ( servlet40NLS . getString ( "name.is.null" ) ) ; } return super . getAttribute ( name ) ; |
public class ComputeExecutor { /** * Helper method to get the label IDs of role players in a relation
* @ return a set of type label IDs */
private Set < Label > scopeTypeLabelsImplicitPlayers ( GraqlCompute query ) { } } | return scopeTypes ( query ) . filter ( Concept :: isRelationType ) . map ( Concept :: asRelationType ) . filter ( RelationType :: isImplicit ) . flatMap ( RelationType :: roles ) . flatMap ( Role :: players ) . map ( SchemaConcept :: label ) . collect ( toSet ( ) ) ; |
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link MasterAccount } { @ code > } } */
@ XmlElementDecl ( namespace = "http://schema.intuit.com/finance/v3" , name = "MasterAccount" , substitutionHeadNamespace = "http://schema.intuit.com/finance/v3" , substitutionHeadName = "IntuitObject" ) public JAXBElement < MasterAccount > createMasterAccount ( MasterAccount value ) { } } | return new JAXBElement < MasterAccount > ( _MasterAccount_QNAME , MasterAccount . class , null , value ) ; |
public class ParameterParser { /** * Extracts a map of name / value pairs from the given string . Names are
* expected to be unique . Multiple separators may be specified and the
* earliest found in the input string is used .
* @ param sStr
* the string that contains a sequence of name / value pairs
* @ param aSeparators
* the name / value pairs separators
* @ return a map of name / value pairs */
@ Nonnull @ ReturnsMutableCopy public ICommonsMap < String , String > parse ( @ Nullable final String sStr , @ Nullable final char [ ] aSeparators ) { } } | if ( ArrayHelper . isEmpty ( aSeparators ) ) return new CommonsHashMap < > ( ) ; char cSep = aSeparators [ 0 ] ; if ( sStr != null ) { // Find the first separator to use
int nFirstIndex = sStr . length ( ) ; for ( final char cSep2 : aSeparators ) { final int nCurIndex = sStr . indexOf ( cSep2 ) ; if ( nCurIndex != - 1 && nCurIndex < nFirstIndex ) { nFirstIndex = nCurIndex ; cSep = cSep2 ; } } } return parse ( sStr , cSep ) ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.